summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2015-07-01 00:11:31 -0400
committerFelipe Balbi <balbi@ti.com>2015-07-29 10:59:18 -0400
commita2fd2423240fe1abd7a154a1cc0fd1624c339bff (patch)
tree27ce20de88b1e88da2c8736ffd66f7da5129d3d9 /drivers/usb/phy
parent5960387a2fb8314687351f6d8485cf62d7722b4e (diff)
usb: phy: omap-otg: Replace deprecated API of extcon
This patch removes the deprecated notifier API of extcon framwork and then use the new extcon API with the unique id to indicate the each external connector (USB, USB-HOST). Alter deprecated API as following: - extcon_register_interest() -> extcon_register_notifier() - extcon_get_cable_state(*edev, char *) -> extcon_get_cable_state_(*edev, id) [ balbi@ti.com : fix build break ] Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-omap-otg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
index 56ee7603034b..1270906ccb95 100644
--- a/drivers/usb/phy/phy-omap-otg.c
+++ b/drivers/usb/phy/phy-omap-otg.c
@@ -30,8 +30,7 @@ struct otg_device {
30 void __iomem *base; 30 void __iomem *base;
31 bool id; 31 bool id;
32 bool vbus; 32 bool vbus;
33 struct extcon_specific_cable_nb vbus_dev; 33 struct extcon_dev *extcon;
34 struct extcon_specific_cable_nb id_dev;
35 struct notifier_block vbus_nb; 34 struct notifier_block vbus_nb;
36 struct notifier_block id_nb; 35 struct notifier_block id_nb;
37}; 36};
@@ -106,6 +105,7 @@ static int omap_otg_probe(struct platform_device *pdev)
106 extcon = extcon_get_extcon_dev(config->extcon); 105 extcon = extcon_get_extcon_dev(config->extcon);
107 if (!extcon) 106 if (!extcon)
108 return -EPROBE_DEFER; 107 return -EPROBE_DEFER;
108 otg_dev->extcon = extcon;
109 109
110 otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL); 110 otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL);
111 if (!otg_dev) 111 if (!otg_dev)
@@ -118,20 +118,19 @@ static int omap_otg_probe(struct platform_device *pdev)
118 otg_dev->id_nb.notifier_call = omap_otg_id_notifier; 118 otg_dev->id_nb.notifier_call = omap_otg_id_notifier;
119 otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier; 119 otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier;
120 120
121 ret = extcon_register_interest(&otg_dev->id_dev, config->extcon, 121 ret = extcon_register_notifier(extcon, EXTCON_USB_HOST, &otg_dev->id_nb);
122 "USB-HOST", &otg_dev->id_nb);
123 if (ret) 122 if (ret)
124 return ret; 123 return ret;
125 124
126 ret = extcon_register_interest(&otg_dev->vbus_dev, config->extcon, 125 ret = extcon_register_notifier(extcon, EXTCON_USB, &otg_dev->vbus_nb);
127 "USB", &otg_dev->vbus_nb);
128 if (ret) { 126 if (ret) {
129 extcon_unregister_interest(&otg_dev->id_dev); 127 extcon_unregister_notifier(extcon, EXTCON_USB_HOST,
128 &otg_dev->id_nb);
130 return ret; 129 return ret;
131 } 130 }
132 131
133 otg_dev->id = extcon_get_cable_state(extcon, "USB-HOST"); 132 otg_dev->id = extcon_get_cable_state_(extcon, EXTCON_USB_HOST);
134 otg_dev->vbus = extcon_get_cable_state(extcon, "USB"); 133 otg_dev->vbus = extcon_get_cable_state_(extcon, EXTCON_USB);
135 omap_otg_set_mode(otg_dev); 134 omap_otg_set_mode(otg_dev);
136 135
137 rev = readl(otg_dev->base); 136 rev = readl(otg_dev->base);
@@ -147,9 +146,10 @@ static int omap_otg_probe(struct platform_device *pdev)
147static int omap_otg_remove(struct platform_device *pdev) 146static int omap_otg_remove(struct platform_device *pdev)
148{ 147{
149 struct otg_device *otg_dev = platform_get_drvdata(pdev); 148 struct otg_device *otg_dev = platform_get_drvdata(pdev);
149 struct extcon_dev *edev = otg_dev->extcon;
150 150
151 extcon_unregister_interest(&otg_dev->id_dev); 151 extcon_unregister_notifier(edev, EXTCON_USB_HOST,&otg_dev->id_nb);
152 extcon_unregister_interest(&otg_dev->vbus_dev); 152 extcon_unregister_notifier(edev, EXTCON_USB, &otg_dev->vbus_nb);
153 153
154 return 0; 154 return 0;
155} 155}