Commit 1ad528db authored by Nicolae Rosia's avatar Nicolae Rosia Committed by Felipe Balbi

usb: twl6030-usb: make driver DT only

All users are DT-only and it makes no sense to keep
unused code
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarNicolae Rosia <Nicolae_Rosia@mentor.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 65aca320
...@@ -84,6 +84,7 @@ config SAMSUNG_USBPHY ...@@ -84,6 +84,7 @@ config SAMSUNG_USBPHY
config TWL6030_USB config TWL6030_USB
tristate "TWL6030 USB Transceiver Driver" tristate "TWL6030 USB Transceiver Driver"
depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS
depends on OF
help help
Enable this to support the USB OTG transceiver on TWL6030 Enable this to support the USB OTG transceiver on TWL6030
family chips. This TWL6030 transceiver has the VBUS and ID GND family chips. This TWL6030 transceiver has the VBUS and ID GND
......
...@@ -108,7 +108,6 @@ struct twl6030_usb { ...@@ -108,7 +108,6 @@ struct twl6030_usb {
enum musb_vbus_id_status linkstat; enum musb_vbus_id_status linkstat;
u8 asleep; u8 asleep;
bool vbus_enable; bool vbus_enable;
const char *regulator;
}; };
#define comparator_to_twl(x) container_of((x), struct twl6030_usb, comparator) #define comparator_to_twl(x) container_of((x), struct twl6030_usb, comparator)
...@@ -166,7 +165,7 @@ static int twl6030_usb_ldo_init(struct twl6030_usb *twl) ...@@ -166,7 +165,7 @@ static int twl6030_usb_ldo_init(struct twl6030_usb *twl)
/* Program MISC2 register and set bit VUSB_IN_VBAT */ /* Program MISC2 register and set bit VUSB_IN_VBAT */
twl6030_writeb(twl, TWL6030_MODULE_ID0, 0x10, TWL6030_MISC2); twl6030_writeb(twl, TWL6030_MODULE_ID0, 0x10, TWL6030_MISC2);
twl->usb3v3 = regulator_get(twl->dev, twl->regulator); twl->usb3v3 = regulator_get(twl->dev, "usb");
if (IS_ERR(twl->usb3v3)) if (IS_ERR(twl->usb3v3))
return -ENODEV; return -ENODEV;
...@@ -341,7 +340,11 @@ static int twl6030_usb_probe(struct platform_device *pdev) ...@@ -341,7 +340,11 @@ static int twl6030_usb_probe(struct platform_device *pdev)
int status, err; int status, err;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct twl4030_usb_data *pdata = dev_get_platdata(dev);
if (!np) {
dev_err(dev, "no DT info\n");
return -EINVAL;
}
twl = devm_kzalloc(dev, sizeof(*twl), GFP_KERNEL); twl = devm_kzalloc(dev, sizeof(*twl), GFP_KERNEL);
if (!twl) if (!twl)
...@@ -361,18 +364,6 @@ static int twl6030_usb_probe(struct platform_device *pdev) ...@@ -361,18 +364,6 @@ static int twl6030_usb_probe(struct platform_device *pdev)
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
if (np) {
twl->regulator = "usb";
} else if (pdata) {
if (pdata->features & TWL6032_SUBCLASS)
twl->regulator = "ldousb";
else
twl->regulator = "vusb";
} else {
dev_err(&pdev->dev, "twl6030 initialized without pdata\n");
return -EINVAL;
}
/* init spinlock for workqueue */ /* init spinlock for workqueue */
spin_lock_init(&twl->lock); spin_lock_init(&twl->lock);
...@@ -436,13 +427,11 @@ static int twl6030_usb_remove(struct platform_device *pdev) ...@@ -436,13 +427,11 @@ static int twl6030_usb_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id twl6030_usb_id_table[] = { static const struct of_device_id twl6030_usb_id_table[] = {
{ .compatible = "ti,twl6030-usb" }, { .compatible = "ti,twl6030-usb" },
{} {}
}; };
MODULE_DEVICE_TABLE(of, twl6030_usb_id_table); MODULE_DEVICE_TABLE(of, twl6030_usb_id_table);
#endif
static struct platform_driver twl6030_usb_driver = { static struct platform_driver twl6030_usb_driver = {
.probe = twl6030_usb_probe, .probe = twl6030_usb_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment