From: Hao Wu <hao.wu@xxxxxxxxx> 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@xxxxxxxxx> --- drivers/usb/gadget/langwell_udc.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index 7359dd0..f9d8bda 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__); } -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html