ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct usbhs_phy_data

The platform data bits can be inferred from the other members of
struct usbhs_phy_data. So get rid of the platform_data member.

Build the platform data for the PHY device in usbhs_init_phys() instead.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Roger Quadros 2013-09-24 11:53:49 +03:00 committed by Felipe Balbi
parent bd27fa44e1
commit 67c8d06364
3 changed files with 10 additions and 8 deletions

View File

@ -289,18 +289,12 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
static struct gpio_led gpio_leds[];
/* PHY's VCC regulator might be added later, so flag that we need it */
static struct usb_phy_gen_xceiv_platform_data hsusb2_phy_data = {
.needs_vcc = true,
};
static struct usbhs_phy_data phy_data[] = {
{
.port = 2,
.reset_gpio = 147,
.vcc_gpio = -1, /* updated in beagle_twl_gpio_setup */
.vcc_polarity = 1, /* updated in beagle_twl_gpio_setup */
.platform_data = &hsusb2_phy_data,
},
};

View File

@ -435,6 +435,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
struct platform_device *pdev;
char *phy_id;
struct platform_device_info pdevinfo;
struct usb_phy_gen_xceiv_platform_data nop_pdata;
for (i = 0; i < num_phys; i++) {
@ -455,11 +456,19 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
return -ENOMEM;
}
/* set platform data */
memset(&nop_pdata, 0, sizeof(nop_pdata));
if (gpio_is_valid(phy->vcc_gpio))
nop_pdata.needs_vcc = true;
if (gpio_is_valid(phy->reset_gpio))
nop_pdata.needs_reset = true;
nop_pdata.type = USB_PHY_TYPE_USB2;
/* create a NOP PHY device */
memset(&pdevinfo, 0, sizeof(pdevinfo));
pdevinfo.name = nop_name;
pdevinfo.id = phy->port;
pdevinfo.data = phy->platform_data;
pdevinfo.data = &nop_pdata;
pdevinfo.size_data =
sizeof(struct usb_phy_gen_xceiv_platform_data);
scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d",

View File

@ -58,7 +58,6 @@ struct usbhs_phy_data {
int reset_gpio;
int vcc_gpio;
bool vcc_polarity; /* 1 active high, 0 active low */
void *platform_data;
};
extern void usb_musb_init(struct omap_musb_board_data *board_data);