aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHao Wu <hao.wu@intel.com>2010-12-09 10:37:44 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:44 +0000
commita42fa26b941af63031e10e9fc9ef099c5627f31f (patch)
treed90bda74d0f5ba9eeca09cd371483ff32b1642e4
parentcbaa7ebe95493a974598501175daf52d11904742 (diff)
downloadmrst-s0i3-test-a42fa26b941af63031e10e9fc9ef099c5627f31f.tar.gz
mrst-s0i3-test-a42fa26b941af63031e10e9fc9ef099c5627f31f.tar.xz
mrst-s0i3-test-a42fa26b941af63031e10e9fc9ef099c5627f31f.zip
usb: langwell_udc: add HighSpeed/FullSpeed events notification
It adds notification to Intel Penwell otg transceiver driver for HighSpeed/FullSpeed. This change mainly to support battery charging current negotiation for Charging Downstream Port(CDP) case. USB OTG Transceiver driver will notify battery driver about charging current limitation change according to different Speed Mode (HS/FS). Signed-off-by: Hao Wu <hao.wu@intel.com>
-rw-r--r--drivers/usb/gadget/langwell_udc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 7359dd0ef6d..f9d8bdab22f 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -2606,8 +2606,9 @@ done:
/* port change detect interrupt handler */
static void handle_port_change(struct langwell_udc *dev)
{
- u32 portsc1, devlc;
- u32 speed;
+ u32 portsc1, devlc;
+ u32 speed;
+ unsigned long event = 0;
dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__);
@@ -2626,12 +2627,15 @@ static void handle_port_change(struct langwell_udc *dev)
switch (speed) {
case LPM_SPEED_HIGH:
dev->gadget.speed = USB_SPEED_HIGH;
+ event = MID_OTG_NOTIFY_CLIENTHS;
break;
case LPM_SPEED_FULL:
dev->gadget.speed = USB_SPEED_FULL;
+ event = MID_OTG_NOTIFY_CLIENTFS;
break;
case LPM_SPEED_LOW:
dev->gadget.speed = USB_SPEED_LOW;
+ event = MID_OTG_NOTIFY_CLIENTFS;
break;
default:
dev->gadget.speed = USB_SPEED_UNKNOWN;
@@ -2640,6 +2644,10 @@ static void handle_port_change(struct langwell_udc *dev)
dev_vdbg(&dev->pdev->dev,
"speed = %d, dev->gadget.speed = %d\n",
speed, dev->gadget.speed);
+
+ if (event && dev->iotg)
+ atomic_notifier_call_chain(&dev->iotg->iotg_notifier,
+ event, dev->iotg);
}
/* LPM L0 to L1 */
@@ -2743,6 +2751,10 @@ static void handle_usb_reset(struct langwell_udc *dev)
dev->usb_state = USB_STATE_ATTACHED;
}
+ if (dev->iotg)
+ atomic_notifier_call_chain(&dev->iotg->iotg_notifier,
+ MID_OTG_NOTIFY_CLIENTFS, dev->iotg);
+
dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__);
}