Skip to content

Commit 505dfc6

Browse files
andy-shevvinodkoul
authored andcommitted
phy: ti: tusb1210: Define device IDs
Define device IDs since some of them are being used more than once. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240209160334.2304230-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 03db178 commit 505dfc6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/phy/ti/phy-tusb1210.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include <linux/property.h>
1818
#include <linux/workqueue.h>
1919

20+
#define TI_VENDOR_ID 0x0451
21+
#define TI_DEVICE_TUSB1210 0x1507
22+
#define TI_DEVICE_TUSB1211 0x1508
23+
2024
#define TUSB1211_POWER_CONTROL 0x3d
2125
#define TUSB1211_POWER_CONTROL_SET 0x3e
2226
#define TUSB1211_POWER_CONTROL_CLEAR 0x3f
@@ -436,7 +440,7 @@ static void tusb1210_probe_charger_detect(struct tusb1210 *tusb)
436440
if (!device_property_read_bool(dev->parent, "linux,phy_charger_detect"))
437441
return;
438442

439-
if (ulpi->id.product != 0x1508) {
443+
if (ulpi->id.product != TI_DEVICE_TUSB1211) {
440444
dev_err(dev, "error charger detection is only supported on the TUSB1211\n");
441445
return;
442446
}
@@ -562,11 +566,9 @@ static void tusb1210_remove(struct ulpi *ulpi)
562566
tusb1210_remove_charger_detect(tusb);
563567
}
564568

565-
#define TI_VENDOR_ID 0x0451
566-
567569
static const struct ulpi_device_id tusb1210_ulpi_id[] = {
568-
{ TI_VENDOR_ID, 0x1507, }, /* TUSB1210 */
569-
{ TI_VENDOR_ID, 0x1508, }, /* TUSB1211 */
570+
{ TI_VENDOR_ID, TI_DEVICE_TUSB1210 },
571+
{ TI_VENDOR_ID, TI_DEVICE_TUSB1211 },
570572
{ },
571573
};
572574
MODULE_DEVICE_TABLE(ulpi, tusb1210_ulpi_id);

0 commit comments

Comments
 (0)