diff options
author | Graeme Gregory <gg@slimlogic.co.uk> | 2011-05-22 16:21:24 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:49:30 -0400 |
commit | 5ccee4ae8eab957ab6d534283db5bd27703dba03 (patch) | |
tree | 98a82be99b8efba0c0dcee75f51d6dac1845e796 /drivers/usb | |
parent | 4d94aee577ea8179bd40f0f17e64cada25c66b85 (diff) |
USB: TWL6025 allow different regulator name
The twl6025 uses a different regulator for USB than the 6030 so select
the correct regulator name depending on the subclass of device.
Since V1
Use features passed via platform data instead of global variable.
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/otg/twl6030-usb.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index 3f2e07011a48..cfb5aa72b196 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c | |||
@@ -100,6 +100,7 @@ struct twl6030_usb { | |||
100 | u8 linkstat; | 100 | u8 linkstat; |
101 | u8 asleep; | 101 | u8 asleep; |
102 | bool irq_enabled; | 102 | bool irq_enabled; |
103 | unsigned long features; | ||
103 | }; | 104 | }; |
104 | 105 | ||
105 | #define xceiv_to_twl(x) container_of((x), struct twl6030_usb, otg) | 106 | #define xceiv_to_twl(x) container_of((x), struct twl6030_usb, otg) |
@@ -204,6 +205,12 @@ static int twl6030_start_srp(struct otg_transceiver *x) | |||
204 | 205 | ||
205 | static int twl6030_usb_ldo_init(struct twl6030_usb *twl) | 206 | static int twl6030_usb_ldo_init(struct twl6030_usb *twl) |
206 | { | 207 | { |
208 | char *regulator_name; | ||
209 | |||
210 | if (twl->features & TWL6025_SUBCLASS) | ||
211 | regulator_name = "ldousb"; | ||
212 | else | ||
213 | regulator_name = "vusb"; | ||
207 | 214 | ||
208 | /* Set to OTG_REV 1.3 and turn on the ID_WAKEUP_COMP */ | 215 | /* Set to OTG_REV 1.3 and turn on the ID_WAKEUP_COMP */ |
209 | twl6030_writeb(twl, TWL6030_MODULE_ID0 , 0x1, TWL6030_BACKUP_REG); | 216 | twl6030_writeb(twl, TWL6030_MODULE_ID0 , 0x1, TWL6030_BACKUP_REG); |
@@ -214,7 +221,7 @@ static int twl6030_usb_ldo_init(struct twl6030_usb *twl) | |||
214 | /* Program MISC2 register and set bit VUSB_IN_VBAT */ | 221 | /* Program MISC2 register and set bit VUSB_IN_VBAT */ |
215 | twl6030_writeb(twl, TWL6030_MODULE_ID0 , 0x10, TWL6030_MISC2); | 222 | twl6030_writeb(twl, TWL6030_MODULE_ID0 , 0x10, TWL6030_MISC2); |
216 | 223 | ||
217 | twl->usb3v3 = regulator_get(twl->dev, "vusb"); | 224 | twl->usb3v3 = regulator_get(twl->dev, regulator_name); |
218 | if (IS_ERR(twl->usb3v3)) | 225 | if (IS_ERR(twl->usb3v3)) |
219 | return -ENODEV; | 226 | return -ENODEV; |
220 | 227 | ||
@@ -409,6 +416,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev) | |||
409 | twl->dev = &pdev->dev; | 416 | twl->dev = &pdev->dev; |
410 | twl->irq1 = platform_get_irq(pdev, 0); | 417 | twl->irq1 = platform_get_irq(pdev, 0); |
411 | twl->irq2 = platform_get_irq(pdev, 1); | 418 | twl->irq2 = platform_get_irq(pdev, 1); |
419 | twl->features = pdata->features; | ||
412 | twl->otg.dev = twl->dev; | 420 | twl->otg.dev = twl->dev; |
413 | twl->otg.label = "twl6030"; | 421 | twl->otg.label = "twl6030"; |
414 | twl->otg.set_host = twl6030_set_host; | 422 | twl->otg.set_host = twl6030_set_host; |