blob: 90a3278d2820818ac0075c21da1414846c491577 [file] [log] [blame]
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +01001/*
2 * drivers/usb/otg/ab8500_usb.c
3 *
4 * USB transceiver driver for AB8500 chip
5 *
6 * Copyright (C) 2010 ST-Ericsson AB
7 * Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#include <linux/module.h>
26#include <linux/platform_device.h>
27#include <linux/usb/otg.h>
28#include <linux/slab.h>
29#include <linux/notifier.h>
30#include <linux/interrupt.h>
31#include <linux/delay.h>
32#include <linux/mfd/abx500.h>
Linus Walleijee66e652011-12-02 14:16:33 +010033#include <linux/mfd/abx500/ab8500.h>
Fabio Baltieriaf6882b2013-03-08 10:27:09 +080034#include <linux/usb/musb-ux500.h>
Fabio Baltierie65b36c2013-04-03 10:45:06 +020035#include <linux/regulator/consumer.h>
Patrice Chotard899f0f52013-04-03 10:45:11 +020036#include <linux/pinctrl/consumer.h>
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010037
Sakethram Bommisetti71246312013-04-03 10:45:04 +020038/* Bank AB8500_SYS_CTRL2_BLOCK */
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010039#define AB8500_MAIN_WD_CTRL_REG 0x01
Sakethram Bommisetti71246312013-04-03 10:45:04 +020040
41/* Bank AB8500_USB */
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010042#define AB8500_USB_LINE_STAT_REG 0x80
Fabio Baltieriaf6882b2013-03-08 10:27:09 +080043#define AB8505_USB_LINE_STAT_REG 0x94
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010044#define AB8500_USB_PHY_CTRL_REG 0x8A
45
Sakethram Bommisetti71246312013-04-03 10:45:04 +020046/* Bank AB8500_DEVELOPMENT */
47#define AB8500_BANK12_ACCESS 0x00
48
49/* Bank AB8500_DEBUG */
50#define AB8500_USB_PHY_TUNE1 0x05
51#define AB8500_USB_PHY_TUNE2 0x06
52#define AB8500_USB_PHY_TUNE3 0x07
53
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010054#define AB8500_BIT_OTG_STAT_ID (1 << 0)
55#define AB8500_BIT_PHY_CTRL_HOST_EN (1 << 0)
56#define AB8500_BIT_PHY_CTRL_DEVICE_EN (1 << 1)
57#define AB8500_BIT_WD_CTRL_ENABLE (1 << 0)
58#define AB8500_BIT_WD_CTRL_KICK (1 << 1)
59
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010060#define AB8500_WD_KICK_DELAY_US 100 /* usec */
61#define AB8500_WD_V11_DISABLE_DELAY_US 100 /* usec */
Fabio Baltieriaf6882b2013-03-08 10:27:09 +080062#define AB8500_V20_31952_DISABLE_DELAY_US 100 /* usec */
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +010063
64/* Usb line status register */
65enum ab8500_usb_link_status {
Fabio Baltieriaf6882b2013-03-08 10:27:09 +080066 USB_LINK_NOT_CONFIGURED_8500 = 0,
67 USB_LINK_STD_HOST_NC_8500,
68 USB_LINK_STD_HOST_C_NS_8500,
69 USB_LINK_STD_HOST_C_S_8500,
70 USB_LINK_HOST_CHG_NM_8500,
71 USB_LINK_HOST_CHG_HS_8500,
72 USB_LINK_HOST_CHG_HS_CHIRP_8500,
73 USB_LINK_DEDICATED_CHG_8500,
74 USB_LINK_ACA_RID_A_8500,
75 USB_LINK_ACA_RID_B_8500,
76 USB_LINK_ACA_RID_C_NM_8500,
77 USB_LINK_ACA_RID_C_HS_8500,
78 USB_LINK_ACA_RID_C_HS_CHIRP_8500,
79 USB_LINK_HM_IDGND_8500,
80 USB_LINK_RESERVED_8500,
81 USB_LINK_NOT_VALID_LINK_8500,
82};
83
84enum ab8505_usb_link_status {
85 USB_LINK_NOT_CONFIGURED_8505 = 0,
86 USB_LINK_STD_HOST_NC_8505,
87 USB_LINK_STD_HOST_C_NS_8505,
88 USB_LINK_STD_HOST_C_S_8505,
89 USB_LINK_CDP_8505,
90 USB_LINK_RESERVED0_8505,
91 USB_LINK_RESERVED1_8505,
92 USB_LINK_DEDICATED_CHG_8505,
93 USB_LINK_ACA_RID_A_8505,
94 USB_LINK_ACA_RID_B_8505,
95 USB_LINK_ACA_RID_C_NM_8505,
96 USB_LINK_RESERVED2_8505,
97 USB_LINK_RESERVED3_8505,
98 USB_LINK_HM_IDGND_8505,
99 USB_LINK_CHARGERPORT_NOT_OK_8505,
100 USB_LINK_CHARGER_DM_HIGH_8505,
101 USB_LINK_PHYEN_NO_VBUS_NO_IDGND_8505,
102 USB_LINK_STD_UPSTREAM_NO_IDGNG_NO_VBUS_8505,
103 USB_LINK_STD_UPSTREAM_8505,
104 USB_LINK_CHARGER_SE1_8505,
105 USB_LINK_CARKIT_CHGR_1_8505,
106 USB_LINK_CARKIT_CHGR_2_8505,
107 USB_LINK_ACA_DOCK_CHGR_8505,
108 USB_LINK_SAMSUNG_BOOT_CBL_PHY_EN_8505,
109 USB_LINK_SAMSUNG_BOOT_CBL_PHY_DISB_8505,
110 USB_LINK_SAMSUNG_UART_CBL_PHY_EN_8505,
111 USB_LINK_SAMSUNG_UART_CBL_PHY_DISB_8505,
112 USB_LINK_MOTOROLA_FACTORY_CBL_PHY_EN_8505,
113};
114
115enum ab8500_usb_mode {
116 USB_IDLE = 0,
117 USB_PERIPHERAL,
118 USB_HOST,
119 USB_DEDICATED_CHG
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100120};
121
122struct ab8500_usb {
Heikki Krogerus144713f2012-02-13 13:24:05 +0200123 struct usb_phy phy;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100124 struct device *dev;
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800125 struct ab8500 *ab8500;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100126 unsigned vbus_draw;
127 struct delayed_work dwork;
128 struct work_struct phy_dis_work;
129 unsigned long link_status_wait;
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800130 enum ab8500_usb_mode mode;
Fabio Baltierie65b36c2013-04-03 10:45:06 +0200131 struct regulator *v_ape;
132 struct regulator *v_musb;
133 struct regulator *v_ulpi;
Fabio Baltieri54dfbb02013-04-03 10:45:08 +0200134 int saved_v_ulpi;
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800135 int previous_link_status_state;
Patrice Chotard899f0f52013-04-03 10:45:11 +0200136 struct pinctrl *pinctrl;
137 struct pinctrl_state *pins_sleep;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100138};
139
Heikki Krogerus144713f2012-02-13 13:24:05 +0200140static inline struct ab8500_usb *phy_to_ab(struct usb_phy *x)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100141{
Heikki Krogerus144713f2012-02-13 13:24:05 +0200142 return container_of(x, struct ab8500_usb, phy);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100143}
144
145static void ab8500_usb_wd_workaround(struct ab8500_usb *ab)
146{
147 abx500_set_register_interruptible(ab->dev,
148 AB8500_SYS_CTRL2_BLOCK,
149 AB8500_MAIN_WD_CTRL_REG,
150 AB8500_BIT_WD_CTRL_ENABLE);
151
152 udelay(AB8500_WD_KICK_DELAY_US);
153
154 abx500_set_register_interruptible(ab->dev,
155 AB8500_SYS_CTRL2_BLOCK,
156 AB8500_MAIN_WD_CTRL_REG,
157 (AB8500_BIT_WD_CTRL_ENABLE
158 | AB8500_BIT_WD_CTRL_KICK));
159
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800160 udelay(AB8500_WD_V11_DISABLE_DELAY_US);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100161
162 abx500_set_register_interruptible(ab->dev,
163 AB8500_SYS_CTRL2_BLOCK,
164 AB8500_MAIN_WD_CTRL_REG,
165 0);
166}
167
Fabio Baltieri54dfbb02013-04-03 10:45:08 +0200168static void ab8500_usb_regulator_enable(struct ab8500_usb *ab)
169{
170 int ret, volt;
171
172 regulator_enable(ab->v_ape);
173
174 if (!is_ab8500_2p0_or_earlier(ab->ab8500)) {
175 ab->saved_v_ulpi = regulator_get_voltage(ab->v_ulpi);
176 if (ab->saved_v_ulpi < 0)
177 dev_err(ab->dev, "Failed to get v_ulpi voltage\n");
178
179 ret = regulator_set_voltage(ab->v_ulpi, 1300000, 1350000);
180 if (ret < 0)
181 dev_err(ab->dev, "Failed to set the Vintcore to 1.3V, ret=%d\n",
182 ret);
183
184 ret = regulator_set_optimum_mode(ab->v_ulpi, 28000);
185 if (ret < 0)
186 dev_err(ab->dev, "Failed to set optimum mode (ret=%d)\n",
187 ret);
188 }
189
190 regulator_enable(ab->v_ulpi);
191
192 if (!is_ab8500_2p0_or_earlier(ab->ab8500)) {
193 volt = regulator_get_voltage(ab->v_ulpi);
194 if ((volt != 1300000) && (volt != 1350000))
195 dev_err(ab->dev, "Vintcore is not set to 1.3V volt=%d\n",
196 volt);
197 }
198
199 regulator_enable(ab->v_musb);
200}
201
202static void ab8500_usb_regulator_disable(struct ab8500_usb *ab)
203{
204 int ret;
205
206 regulator_disable(ab->v_musb);
207
208 regulator_disable(ab->v_ulpi);
209
210 /* USB is not the only consumer of Vintcore, restore old settings */
211 if (!is_ab8500_2p0_or_earlier(ab->ab8500)) {
212 if (ab->saved_v_ulpi > 0) {
213 ret = regulator_set_voltage(ab->v_ulpi,
214 ab->saved_v_ulpi, ab->saved_v_ulpi);
215 if (ret < 0)
216 dev_err(ab->dev, "Failed to set the Vintcore to %duV, ret=%d\n",
217 ab->saved_v_ulpi, ret);
218 }
219
220 ret = regulator_set_optimum_mode(ab->v_ulpi, 0);
221 if (ret < 0)
222 dev_err(ab->dev, "Failed to set optimum mode (ret=%d)\n",
223 ret);
224 }
225
226 regulator_disable(ab->v_ape);
227}
228
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800229static void ab8500_usb_wd_linkstatus(struct ab8500_usb *ab, u8 bit)
230{
231 /* Workaround for v2.0 bug # 31952 */
232 if (is_ab8500_2p0(ab->ab8500)) {
233 abx500_mask_and_set_register_interruptible(ab->dev,
234 AB8500_USB, AB8500_USB_PHY_CTRL_REG,
235 bit, bit);
236 udelay(AB8500_V20_31952_DISABLE_DELAY_US);
237 }
238}
239
Fabio Baltieric0ea7062013-04-03 10:45:07 +0200240static void ab8500_usb_phy_enable(struct ab8500_usb *ab, bool sel_host)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100241{
Fabio Baltieric0ea7062013-04-03 10:45:07 +0200242 u8 bit;
243 bit = sel_host ? AB8500_BIT_PHY_CTRL_HOST_EN :
244 AB8500_BIT_PHY_CTRL_DEVICE_EN;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100245
Patrice Chotard899f0f52013-04-03 10:45:11 +0200246 /* mux and configure USB pins to DEFAULT state */
247 ab->pinctrl = pinctrl_get_select(ab->dev, PINCTRL_STATE_DEFAULT);
248 if (IS_ERR(ab->pinctrl))
249 dev_err(ab->dev, "could not get/set default pinstate\n");
250
Fabio Baltieri54dfbb02013-04-03 10:45:08 +0200251 ab8500_usb_regulator_enable(ab);
252
Fabio Baltieric0ea7062013-04-03 10:45:07 +0200253 abx500_mask_and_set_register_interruptible(ab->dev,
254 AB8500_USB, AB8500_USB_PHY_CTRL_REG,
255 bit, bit);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100256}
257
Fabio Baltieric0ea7062013-04-03 10:45:07 +0200258static void ab8500_usb_phy_disable(struct ab8500_usb *ab, bool sel_host)
259{
260 u8 bit;
261 bit = sel_host ? AB8500_BIT_PHY_CTRL_HOST_EN :
262 AB8500_BIT_PHY_CTRL_DEVICE_EN;
263
264 ab8500_usb_wd_linkstatus(ab, bit);
265
266 abx500_mask_and_set_register_interruptible(ab->dev,
267 AB8500_USB, AB8500_USB_PHY_CTRL_REG,
268 bit, 0);
269
270 /* Needed to disable the phy.*/
271 ab8500_usb_wd_workaround(ab);
Fabio Baltieri54dfbb02013-04-03 10:45:08 +0200272
273 ab8500_usb_regulator_disable(ab);
Patrice Chotard899f0f52013-04-03 10:45:11 +0200274
275 if (!IS_ERR(ab->pinctrl)) {
276 /* configure USB pins to SLEEP state */
277 ab->pins_sleep = pinctrl_lookup_state(ab->pinctrl,
278 PINCTRL_STATE_SLEEP);
279
280 if (IS_ERR(ab->pins_sleep))
281 dev_dbg(ab->dev, "could not get sleep pinstate\n");
282 else if (pinctrl_select_state(ab->pinctrl, ab->pins_sleep))
283 dev_err(ab->dev, "could not set pins to sleep state\n");
284
285 /* as USB pins are shared with idddet, release them to allow
286 * iddet to request them
287 */
288 pinctrl_put(ab->pinctrl);
289 }
Fabio Baltieric0ea7062013-04-03 10:45:07 +0200290}
291
292#define ab8500_usb_host_phy_en(ab) ab8500_usb_phy_enable(ab, true)
293#define ab8500_usb_host_phy_dis(ab) ab8500_usb_phy_disable(ab, true)
294#define ab8500_usb_peri_phy_en(ab) ab8500_usb_phy_enable(ab, false)
295#define ab8500_usb_peri_phy_dis(ab) ab8500_usb_phy_disable(ab, false)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100296
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800297static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
298 enum ab8505_usb_link_status lsts)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100299{
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800300 enum ux500_musb_vbus_id_status event = 0;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100301
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800302 dev_dbg(ab->dev, "ab8505_usb_link_status_update %d\n", lsts);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100303
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800304 /*
305 * Spurious link_status interrupts are seen at the time of
306 * disconnection of a device in RIDA state
307 */
308 if (ab->previous_link_status_state == USB_LINK_ACA_RID_A_8505 &&
309 (lsts == USB_LINK_STD_HOST_NC_8505))
310 return 0;
311
312 ab->previous_link_status_state = lsts;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100313
314 switch (lsts) {
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800315 case USB_LINK_ACA_RID_B_8505:
316 event = UX500_MUSB_RIDB;
317 case USB_LINK_NOT_CONFIGURED_8505:
318 case USB_LINK_RESERVED0_8505:
319 case USB_LINK_RESERVED1_8505:
320 case USB_LINK_RESERVED2_8505:
321 case USB_LINK_RESERVED3_8505:
322 ab->mode = USB_IDLE;
Heikki Krogerus144713f2012-02-13 13:24:05 +0200323 ab->phy.otg->default_a = false;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100324 ab->vbus_draw = 0;
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800325 if (event != UX500_MUSB_RIDB)
326 event = UX500_MUSB_NONE;
327 /*
328 * Fallback to default B_IDLE as nothing
329 * is connected
330 */
331 ab->phy.state = OTG_STATE_B_IDLE;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100332 break;
333
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800334 case USB_LINK_ACA_RID_C_NM_8505:
335 event = UX500_MUSB_RIDC;
336 case USB_LINK_STD_HOST_NC_8505:
337 case USB_LINK_STD_HOST_C_NS_8505:
338 case USB_LINK_STD_HOST_C_S_8505:
339 case USB_LINK_CDP_8505:
340 if (ab->mode == USB_IDLE) {
341 ab->mode = USB_PERIPHERAL;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100342 ab8500_usb_peri_phy_en(ab);
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800343 atomic_notifier_call_chain(&ab->phy.notifier,
344 UX500_MUSB_PREPARE, &ab->vbus_draw);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100345 }
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800346 if (event != UX500_MUSB_RIDC)
347 event = UX500_MUSB_VBUS;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100348 break;
349
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800350 case USB_LINK_ACA_RID_A_8505:
351 case USB_LINK_ACA_DOCK_CHGR_8505:
352 event = UX500_MUSB_RIDA;
353 case USB_LINK_HM_IDGND_8505:
354 if (ab->mode == USB_IDLE) {
355 ab->mode = USB_HOST;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100356 ab8500_usb_host_phy_en(ab);
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800357 atomic_notifier_call_chain(&ab->phy.notifier,
358 UX500_MUSB_PREPARE, &ab->vbus_draw);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100359 }
Heikki Krogerus144713f2012-02-13 13:24:05 +0200360 ab->phy.otg->default_a = true;
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800361 if (event != UX500_MUSB_RIDA)
362 event = UX500_MUSB_ID;
363 atomic_notifier_call_chain(&ab->phy.notifier,
364 event, &ab->vbus_draw);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100365 break;
366
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800367 case USB_LINK_DEDICATED_CHG_8505:
368 ab->mode = USB_DEDICATED_CHG;
369 event = UX500_MUSB_CHARGER;
370 atomic_notifier_call_chain(&ab->phy.notifier,
371 event, &ab->vbus_draw);
372 break;
373
374 default:
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100375 break;
376 }
377
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800378 return 0;
379}
380
381static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
382 enum ab8500_usb_link_status lsts)
383{
384 enum ux500_musb_vbus_id_status event = 0;
385
386 dev_dbg(ab->dev, "ab8500_usb_link_status_update %d\n", lsts);
387
388 /*
389 * Spurious link_status interrupts are seen in case of a
390 * disconnection of a device in IDGND and RIDA stage
391 */
392 if (ab->previous_link_status_state == USB_LINK_HM_IDGND_8500 &&
393 (lsts == USB_LINK_STD_HOST_C_NS_8500 ||
394 lsts == USB_LINK_STD_HOST_NC_8500))
395 return 0;
396
397 if (ab->previous_link_status_state == USB_LINK_ACA_RID_A_8500 &&
398 lsts == USB_LINK_STD_HOST_NC_8500)
399 return 0;
400
401 ab->previous_link_status_state = lsts;
402
403 switch (lsts) {
404 case USB_LINK_ACA_RID_B_8500:
405 event = UX500_MUSB_RIDB;
406 case USB_LINK_NOT_CONFIGURED_8500:
407 case USB_LINK_NOT_VALID_LINK_8500:
408 ab->mode = USB_IDLE;
409 ab->phy.otg->default_a = false;
410 ab->vbus_draw = 0;
411 if (event != UX500_MUSB_RIDB)
412 event = UX500_MUSB_NONE;
413 /* Fallback to default B_IDLE as nothing is connected */
414 ab->phy.state = OTG_STATE_B_IDLE;
415 break;
416
417 case USB_LINK_ACA_RID_C_NM_8500:
418 case USB_LINK_ACA_RID_C_HS_8500:
419 case USB_LINK_ACA_RID_C_HS_CHIRP_8500:
420 event = UX500_MUSB_RIDC;
421 case USB_LINK_STD_HOST_NC_8500:
422 case USB_LINK_STD_HOST_C_NS_8500:
423 case USB_LINK_STD_HOST_C_S_8500:
424 case USB_LINK_HOST_CHG_NM_8500:
425 case USB_LINK_HOST_CHG_HS_8500:
426 case USB_LINK_HOST_CHG_HS_CHIRP_8500:
427 if (ab->mode == USB_IDLE) {
428 ab->mode = USB_PERIPHERAL;
429 ab8500_usb_peri_phy_en(ab);
430 atomic_notifier_call_chain(&ab->phy.notifier,
431 UX500_MUSB_PREPARE, &ab->vbus_draw);
432 }
433 if (event != UX500_MUSB_RIDC)
434 event = UX500_MUSB_VBUS;
435 break;
436
437 case USB_LINK_ACA_RID_A_8500:
438 event = UX500_MUSB_RIDA;
439 case USB_LINK_HM_IDGND_8500:
440 if (ab->mode == USB_IDLE) {
441 ab->mode = USB_HOST;
442 ab8500_usb_host_phy_en(ab);
443 atomic_notifier_call_chain(&ab->phy.notifier,
444 UX500_MUSB_PREPARE, &ab->vbus_draw);
445 }
446 ab->phy.otg->default_a = true;
447 if (event != UX500_MUSB_RIDA)
448 event = UX500_MUSB_ID;
449 atomic_notifier_call_chain(&ab->phy.notifier,
450 event, &ab->vbus_draw);
451 break;
452
453 case USB_LINK_DEDICATED_CHG_8500:
454 ab->mode = USB_DEDICATED_CHG;
455 event = UX500_MUSB_CHARGER;
456 atomic_notifier_call_chain(&ab->phy.notifier,
457 event, &ab->vbus_draw);
458 break;
459
460 case USB_LINK_RESERVED_8500:
461 break;
462 }
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100463
464 return 0;
465}
466
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800467/*
468 * Connection Sequence:
469 * 1. Link Status Interrupt
470 * 2. Enable AB clock
471 * 3. Enable AB regulators
472 * 4. Enable USB phy
473 * 5. Reset the musb controller
474 * 6. Switch the ULPI GPIO pins to fucntion mode
475 * 7. Enable the musb Peripheral5 clock
476 * 8. Restore MUSB context
477 */
478static int abx500_usb_link_status_update(struct ab8500_usb *ab)
479{
480 u8 reg;
481 int ret = 0;
482
483 if (is_ab8500(ab->ab8500)) {
484 enum ab8500_usb_link_status lsts;
485
486 abx500_get_register_interruptible(ab->dev,
487 AB8500_USB, AB8500_USB_LINE_STAT_REG, &reg);
488 lsts = (reg >> 3) & 0x0F;
489 ret = ab8500_usb_link_status_update(ab, lsts);
490 } else if (is_ab8505(ab->ab8500)) {
491 enum ab8505_usb_link_status lsts;
492
493 abx500_get_register_interruptible(ab->dev,
494 AB8500_USB, AB8505_USB_LINE_STAT_REG, &reg);
495 lsts = (reg >> 3) & 0x1F;
496 ret = ab8505_usb_link_status_update(ab, lsts);
497 }
498
499 return ret;
500}
501
502/*
503 * Disconnection Sequence:
504 * 1. Disconect Interrupt
505 * 2. Disable regulators
506 * 3. Disable AB clock
507 * 4. Disable the Phy
508 * 5. Link Status Interrupt
509 * 6. Disable Musb Clock
510 */
511static irqreturn_t ab8500_usb_disconnect_irq(int irq, void *data)
512{
513 struct ab8500_usb *ab = (struct ab8500_usb *) data;
514 enum usb_phy_events event = UX500_MUSB_NONE;
515
516 /* Link status will not be updated till phy is disabled. */
517 if (ab->mode == USB_HOST) {
518 ab->phy.otg->default_a = false;
519 ab->vbus_draw = 0;
520 atomic_notifier_call_chain(&ab->phy.notifier,
521 event, &ab->vbus_draw);
522 ab8500_usb_host_phy_dis(ab);
523 ab->mode = USB_IDLE;
524 }
525
526 if (ab->mode == USB_PERIPHERAL) {
527 atomic_notifier_call_chain(&ab->phy.notifier,
528 event, &ab->vbus_draw);
529 ab8500_usb_peri_phy_dis(ab);
530 atomic_notifier_call_chain(&ab->phy.notifier,
531 UX500_MUSB_CLEAN, &ab->vbus_draw);
532 ab->mode = USB_IDLE;
533 ab->phy.otg->default_a = false;
534 ab->vbus_draw = 0;
535 }
536
537 if (is_ab8500_2p0(ab->ab8500)) {
538 if (ab->mode == USB_DEDICATED_CHG) {
539 ab8500_usb_wd_linkstatus(ab,
540 AB8500_BIT_PHY_CTRL_DEVICE_EN);
541 abx500_mask_and_set_register_interruptible(ab->dev,
542 AB8500_USB, AB8500_USB_PHY_CTRL_REG,
543 AB8500_BIT_PHY_CTRL_DEVICE_EN, 0);
544 }
545 }
546
547 return IRQ_HANDLED;
548}
549
550static irqreturn_t ab8500_usb_link_status_irq(int irq, void *data)
551{
552 struct ab8500_usb *ab = (struct ab8500_usb *) data;
553
554 abx500_usb_link_status_update(ab);
555
556 return IRQ_HANDLED;
557}
558
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100559static void ab8500_usb_delayed_work(struct work_struct *work)
560{
561 struct ab8500_usb *ab = container_of(work, struct ab8500_usb,
562 dwork.work);
563
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800564 abx500_usb_link_status_update(ab);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100565}
566
567static void ab8500_usb_phy_disable_work(struct work_struct *work)
568{
569 struct ab8500_usb *ab = container_of(work, struct ab8500_usb,
570 phy_dis_work);
571
Heikki Krogerus144713f2012-02-13 13:24:05 +0200572 if (!ab->phy.otg->host)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100573 ab8500_usb_host_phy_dis(ab);
574
Heikki Krogerus144713f2012-02-13 13:24:05 +0200575 if (!ab->phy.otg->gadget)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100576 ab8500_usb_peri_phy_dis(ab);
577}
578
Sakethram Bommisettic2a0ab62013-04-03 10:45:05 +0200579static unsigned ab8500_eyediagram_workaroud(struct ab8500_usb *ab, unsigned mA)
580{
581 /*
582 * AB8500 V2 has eye diagram issues when drawing more than 100mA from
583 * VBUS. Set charging current to 100mA in case of standard host
584 */
585 if (is_ab8500_2p0_or_earlier(ab->ab8500))
586 if (mA > 100)
587 mA = 100;
588
589 return mA;
590}
591
Heikki Krogerus144713f2012-02-13 13:24:05 +0200592static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100593{
594 struct ab8500_usb *ab;
595
Heikki Krogerus144713f2012-02-13 13:24:05 +0200596 if (!phy)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100597 return -ENODEV;
598
Heikki Krogerus144713f2012-02-13 13:24:05 +0200599 ab = phy_to_ab(phy);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100600
Sakethram Bommisettic2a0ab62013-04-03 10:45:05 +0200601 mA = ab8500_eyediagram_workaroud(ab, mA);
602
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100603 ab->vbus_draw = mA;
604
Fabio Baltieri77f43962013-04-03 10:45:10 +0200605 atomic_notifier_call_chain(&ab->phy.notifier,
606 UX500_MUSB_VBUS, &ab->vbus_draw);
607
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100608 return 0;
609}
610
Heikki Krogerus86753812012-02-13 13:24:02 +0200611static int ab8500_usb_set_suspend(struct usb_phy *x, int suspend)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100612{
613 /* TODO */
614 return 0;
615}
616
Heikki Krogerus144713f2012-02-13 13:24:05 +0200617static int ab8500_usb_set_peripheral(struct usb_otg *otg,
618 struct usb_gadget *gadget)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100619{
620 struct ab8500_usb *ab;
621
622 if (!otg)
623 return -ENODEV;
624
Heikki Krogerus144713f2012-02-13 13:24:05 +0200625 ab = phy_to_ab(otg->phy);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100626
627 /* Some drivers call this function in atomic context.
628 * Do not update ab8500 registers directly till this
629 * is fixed.
630 */
631
632 if (!gadget) {
Heikki Krogerus144713f2012-02-13 13:24:05 +0200633 otg->gadget = NULL;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100634 schedule_work(&ab->phy_dis_work);
635 } else {
Heikki Krogerus144713f2012-02-13 13:24:05 +0200636 otg->gadget = gadget;
637 otg->phy->state = OTG_STATE_B_IDLE;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100638
639 /* Phy will not be enabled if cable is already
640 * plugged-in. Schedule to enable phy.
641 * Use same delay to avoid any race condition.
642 */
643 schedule_delayed_work(&ab->dwork, ab->link_status_wait);
644 }
645
646 return 0;
647}
648
Heikki Krogerus144713f2012-02-13 13:24:05 +0200649static int ab8500_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100650{
651 struct ab8500_usb *ab;
652
653 if (!otg)
654 return -ENODEV;
655
Heikki Krogerus144713f2012-02-13 13:24:05 +0200656 ab = phy_to_ab(otg->phy);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100657
658 /* Some drivers call this function in atomic context.
659 * Do not update ab8500 registers directly till this
660 * is fixed.
661 */
662
663 if (!host) {
Heikki Krogerus144713f2012-02-13 13:24:05 +0200664 otg->host = NULL;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100665 schedule_work(&ab->phy_dis_work);
666 } else {
Heikki Krogerus144713f2012-02-13 13:24:05 +0200667 otg->host = host;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100668 /* Phy will not be enabled if cable is already
669 * plugged-in. Schedule to enable phy.
670 * Use same delay to avoid any race condition.
671 */
672 schedule_delayed_work(&ab->dwork, ab->link_status_wait);
673 }
674
675 return 0;
676}
677
Fabio Baltierie65b36c2013-04-03 10:45:06 +0200678static int ab8500_usb_regulator_get(struct ab8500_usb *ab)
679{
680 int err;
681
682 ab->v_ape = devm_regulator_get(ab->dev, "v-ape");
683 if (IS_ERR(ab->v_ape)) {
684 dev_err(ab->dev, "Could not get v-ape supply\n");
685 err = PTR_ERR(ab->v_ape);
686 return err;
687 }
688
689 ab->v_ulpi = devm_regulator_get(ab->dev, "vddulpivio18");
690 if (IS_ERR(ab->v_ulpi)) {
691 dev_err(ab->dev, "Could not get vddulpivio18 supply\n");
692 err = PTR_ERR(ab->v_ulpi);
693 return err;
694 }
695
696 ab->v_musb = devm_regulator_get(ab->dev, "musb_1v8");
697 if (IS_ERR(ab->v_musb)) {
698 dev_err(ab->dev, "Could not get musb_1v8 supply\n");
699 err = PTR_ERR(ab->v_musb);
700 return err;
701 }
702
703 return 0;
704}
705
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800706static int ab8500_usb_irq_setup(struct platform_device *pdev,
707 struct ab8500_usb *ab)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100708{
709 int err;
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800710 int irq;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100711
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800712 irq = platform_get_irq_byname(pdev, "USB_LINK_STATUS");
713 if (irq < 0) {
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100714 dev_err(&pdev->dev, "Link status irq not found\n");
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800715 return irq;
716 }
717 err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
718 ab8500_usb_link_status_irq,
719 IRQF_NO_SUSPEND | IRQF_SHARED, "usb-link-status", ab);
720 if (err < 0) {
721 dev_err(ab->dev, "request_irq failed for link status irq\n");
722 return err;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100723 }
724
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800725 irq = platform_get_irq_byname(pdev, "ID_WAKEUP_F");
726 if (irq < 0) {
727 dev_err(&pdev->dev, "ID fall irq not found\n");
728 return irq;
729 }
730 err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
731 ab8500_usb_disconnect_irq,
732 IRQF_NO_SUSPEND | IRQF_SHARED, "usb-id-fall", ab);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100733 if (err < 0) {
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800734 dev_err(ab->dev, "request_irq failed for ID fall irq\n");
735 return err;
736 }
737
738 irq = platform_get_irq_byname(pdev, "VBUS_DET_F");
739 if (irq < 0) {
740 dev_err(&pdev->dev, "VBUS fall irq not found\n");
741 return irq;
742 }
743 err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
744 ab8500_usb_disconnect_irq,
745 IRQF_NO_SUSPEND | IRQF_SHARED, "usb-vbus-fall", ab);
746 if (err < 0) {
747 dev_err(ab->dev, "request_irq failed for Vbus fall irq\n");
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100748 return err;
749 }
750
751 return 0;
752}
753
Bill Pemberton41ac7b32012-11-19 13:21:48 -0500754static int ab8500_usb_probe(struct platform_device *pdev)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100755{
756 struct ab8500_usb *ab;
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800757 struct ab8500 *ab8500;
Heikki Krogerus144713f2012-02-13 13:24:05 +0200758 struct usb_otg *otg;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100759 int err;
760 int rev;
761
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800762 ab8500 = dev_get_drvdata(pdev->dev.parent);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100763 rev = abx500_get_chip_id(&pdev->dev);
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800764
765 if (is_ab8500_1p1_or_earlier(ab8500)) {
766 dev_err(&pdev->dev, "Unsupported AB8500 chip rev=%d\n", rev);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100767 return -ENODEV;
768 }
769
Fabio Baltieri81ef6722013-04-03 10:45:03 +0200770 ab = devm_kzalloc(&pdev->dev, sizeof(*ab), GFP_KERNEL);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100771 if (!ab)
772 return -ENOMEM;
773
Fabio Baltieri81ef6722013-04-03 10:45:03 +0200774 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
775 if (!otg)
Heikki Krogerus144713f2012-02-13 13:24:05 +0200776 return -ENOMEM;
Heikki Krogerus144713f2012-02-13 13:24:05 +0200777
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100778 ab->dev = &pdev->dev;
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800779 ab->ab8500 = ab8500;
Heikki Krogerus144713f2012-02-13 13:24:05 +0200780 ab->phy.dev = ab->dev;
781 ab->phy.otg = otg;
782 ab->phy.label = "ab8500";
783 ab->phy.set_suspend = ab8500_usb_set_suspend;
784 ab->phy.set_power = ab8500_usb_set_power;
785 ab->phy.state = OTG_STATE_UNDEFINED;
786
787 otg->phy = &ab->phy;
788 otg->set_host = ab8500_usb_set_host;
789 otg->set_peripheral = ab8500_usb_set_peripheral;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100790
791 platform_set_drvdata(pdev, ab);
792
Heikki Krogerus144713f2012-02-13 13:24:05 +0200793 ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100794
795 /* v1: Wait for link status to become stable.
796 * all: Updates form set_host and set_peripheral as they are atomic.
797 */
798 INIT_DELAYED_WORK(&ab->dwork, ab8500_usb_delayed_work);
799
800 /* all: Disable phy when called from set_host and set_peripheral */
801 INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work);
802
Fabio Baltierie65b36c2013-04-03 10:45:06 +0200803 err = ab8500_usb_regulator_get(ab);
804 if (err)
805 return err;
806
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800807 err = ab8500_usb_irq_setup(pdev, ab);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100808 if (err < 0)
Fabio Baltieri81ef6722013-04-03 10:45:03 +0200809 return err;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100810
Kishon Vijay Abraham I662dca52012-06-22 17:02:46 +0530811 err = usb_add_phy(&ab->phy, USB_PHY_TYPE_USB2);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100812 if (err) {
813 dev_err(&pdev->dev, "Can't register transceiver\n");
Fabio Baltieri81ef6722013-04-03 10:45:03 +0200814 return err;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100815 }
816
Sakethram Bommisetti71246312013-04-03 10:45:04 +0200817 /* Phy tuning values for AB8500 */
818 if (!is_ab8500_2p0_or_earlier(ab->ab8500)) {
819 /* Enable the PBT/Bank 0x12 access */
820 err = abx500_set_register_interruptible(ab->dev,
821 AB8500_DEVELOPMENT, AB8500_BANK12_ACCESS, 0x01);
822 if (err < 0)
823 dev_err(ab->dev, "Failed to enable bank12 access err=%d\n",
824 err);
825
826 err = abx500_set_register_interruptible(ab->dev,
827 AB8500_DEBUG, AB8500_USB_PHY_TUNE1, 0xC8);
828 if (err < 0)
829 dev_err(ab->dev, "Failed to set PHY_TUNE1 register err=%d\n",
830 err);
831
832 err = abx500_set_register_interruptible(ab->dev,
833 AB8500_DEBUG, AB8500_USB_PHY_TUNE2, 0x00);
834 if (err < 0)
835 dev_err(ab->dev, "Failed to set PHY_TUNE2 register err=%d\n",
836 err);
837
838 err = abx500_set_register_interruptible(ab->dev,
839 AB8500_DEBUG, AB8500_USB_PHY_TUNE3, 0x78);
840 if (err < 0)
841 dev_err(ab->dev, "Failed to set PHY_TUNE3 regester err=%d\n",
842 err);
843
844 /* Switch to normal mode/disable Bank 0x12 access */
845 err = abx500_set_register_interruptible(ab->dev,
846 AB8500_DEVELOPMENT, AB8500_BANK12_ACCESS, 0x00);
847 if (err < 0)
848 dev_err(ab->dev, "Failed to switch bank12 access err=%d\n",
849 err);
850 }
851
852 /* Phy tuning values for AB8505 */
853 if (is_ab8505(ab->ab8500)) {
854 /* Enable the PBT/Bank 0x12 access */
855 err = abx500_mask_and_set_register_interruptible(ab->dev,
856 AB8500_DEVELOPMENT, AB8500_BANK12_ACCESS,
857 0x01, 0x01);
858 if (err < 0)
859 dev_err(ab->dev, "Failed to enable bank12 access err=%d\n",
860 err);
861
862 err = abx500_mask_and_set_register_interruptible(ab->dev,
863 AB8500_DEBUG, AB8500_USB_PHY_TUNE1,
864 0xC8, 0xC8);
865 if (err < 0)
866 dev_err(ab->dev, "Failed to set PHY_TUNE1 register err=%d\n",
867 err);
868
869 err = abx500_mask_and_set_register_interruptible(ab->dev,
870 AB8500_DEBUG, AB8500_USB_PHY_TUNE2,
871 0x60, 0x60);
872 if (err < 0)
873 dev_err(ab->dev, "Failed to set PHY_TUNE2 register err=%d\n",
874 err);
875
876 err = abx500_mask_and_set_register_interruptible(ab->dev,
877 AB8500_DEBUG, AB8500_USB_PHY_TUNE3,
878 0xFC, 0x80);
879
880 if (err < 0)
881 dev_err(ab->dev, "Failed to set PHY_TUNE3 regester err=%d\n",
882 err);
883
884 /* Switch to normal mode/disable Bank 0x12 access */
885 err = abx500_mask_and_set_register_interruptible(ab->dev,
886 AB8500_DEVELOPMENT, AB8500_BANK12_ACCESS,
887 0x00, 0x00);
888 if (err < 0)
889 dev_err(ab->dev, "Failed to switch bank12 access err=%d\n",
890 err);
891 }
892
Fabio Baltieriaf6882b2013-03-08 10:27:09 +0800893 /* Needed to enable ID detection. */
894 ab8500_usb_wd_workaround(ab);
895
Fabio Baltieri73f226c2013-03-08 10:27:08 +0800896 dev_info(&pdev->dev, "revision 0x%2x driver initialized\n", rev);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100897
898 return 0;
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100899}
900
Bill Pembertonfb4e98a2012-11-19 13:26:20 -0500901static int ab8500_usb_remove(struct platform_device *pdev)
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100902{
903 struct ab8500_usb *ab = platform_get_drvdata(pdev);
904
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100905 cancel_delayed_work_sync(&ab->dwork);
906
907 cancel_work_sync(&ab->phy_dis_work);
908
Kishon Vijay Abraham I662dca52012-06-22 17:02:46 +0530909 usb_remove_phy(&ab->phy);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100910
Mian Yousaf Kaukabf5ef7b42013-04-03 10:45:09 +0200911 if (ab->mode == USB_HOST)
912 ab8500_usb_host_phy_dis(ab);
913 else if (ab->mode == USB_PERIPHERAL)
914 ab8500_usb_peri_phy_dis(ab);
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100915
916 platform_set_drvdata(pdev, NULL);
917
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100918 return 0;
919}
920
921static struct platform_driver ab8500_usb_driver = {
922 .probe = ab8500_usb_probe,
Bill Pemberton76904172012-11-19 13:21:08 -0500923 .remove = ab8500_usb_remove,
Mian Yousaf Kaukab96915232010-12-07 15:00:09 +0100924 .driver = {
925 .name = "ab8500-usb",
926 .owner = THIS_MODULE,
927 },
928};
929
930static int __init ab8500_usb_init(void)
931{
932 return platform_driver_register(&ab8500_usb_driver);
933}
934subsys_initcall(ab8500_usb_init);
935
936static void __exit ab8500_usb_exit(void)
937{
938 platform_driver_unregister(&ab8500_usb_driver);
939}
940module_exit(ab8500_usb_exit);
941
942MODULE_ALIAS("platform:ab8500_usb");
943MODULE_AUTHOR("ST-Ericsson AB");
944MODULE_DESCRIPTION("AB8500 usb transceiver driver");
945MODULE_LICENSE("GPL");