Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: otg/ulpi: extend id's table.

Extend id's table to have ulpi phy names in it.
Report if the known phy is found.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Igor Grinberg and committed by
Greg Kroah-Hartman
96b9e832 a9138192

+20 -5
+20 -5
drivers/usb/otg/ulpi.c
··· 29 29 #include <linux/usb/otg.h> 30 30 #include <linux/usb/ulpi.h> 31 31 32 + 33 + struct ulpi_info { 34 + unsigned int id; 35 + char *name; 36 + }; 37 + 32 38 #define ULPI_ID(vendor, product) (((vendor) << 16) | (product)) 39 + #define ULPI_INFO(_id, _name) \ 40 + { \ 41 + .id = (_id), \ 42 + .name = (_name), \ 43 + } 33 44 34 45 /* ULPI hardcoded IDs, used for probing */ 35 - static unsigned int ulpi_ids[] = { 36 - ULPI_ID(0x04cc, 0x1504), /* NXP ISP1504 */ 37 - ULPI_ID(0x0424, 0x0006), /* SMSC USB3319 */ 46 + static struct ulpi_info ulpi_ids[] = { 47 + ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"), 48 + ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB3319"), 38 49 }; 39 50 40 51 static int ulpi_set_otg_flags(struct otg_transceiver *otg) ··· 190 179 191 180 pr_info("ULPI transceiver vendor/product ID 0x%04x/0x%04x\n", vid, pid); 192 181 193 - for (i = 0; i < ARRAY_SIZE(ulpi_ids); i++) 194 - if (ulpi_ids[i] == ULPI_ID(vid, pid)) 182 + for (i = 0; i < ARRAY_SIZE(ulpi_ids); i++) { 183 + if (ulpi_ids[i].id == ULPI_ID(vid, pid)) { 184 + pr_info("Found %s ULPI transceiver.\n", 185 + ulpi_ids[i].name); 195 186 break; 187 + } 188 + } 196 189 197 190 ret = ulpi_check_integrity(otg); 198 191 if (ret)