Loading drivers/usb/gadget/ci13xxx_msm.c +187 −9 Original line number Diff line number Diff line /* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -11,6 +11,7 @@ #include <linux/usb/msm_hsusb_hw.h> #include <linux/usb/ulpi.h> #include <linux/gpio.h> #include <linux/pinctrl/consumer.h> #include "ci13xxx_udc.c" Loading @@ -24,9 +25,13 @@ struct ci13xxx_udc_context { int wake_gpio; int wake_irq; bool wake_irq_state; struct pinctrl *ci13xxx_pinctrl; struct timer_list irq_enable_timer; bool irq_disabled; }; static struct ci13xxx_udc_context _udc_ctxt; #define IRQ_ENABLE_DELAY (jiffies + msecs_to_jiffies(1000)) static irqreturn_t msm_udc_irq(int irq, void *data) { Loading @@ -36,6 +41,7 @@ static irqreturn_t msm_udc_irq(int irq, void *data) static void ci13xxx_msm_suspend(void) { struct device *dev = _udc->gadget.dev.parent; dev_dbg(dev, "ci13xxx_msm_suspend\n"); if (_udc_ctxt.wake_irq && !_udc_ctxt.wake_irq_state) { Loading @@ -48,6 +54,7 @@ static void ci13xxx_msm_suspend(void) static void ci13xxx_msm_resume(void) { struct device *dev = _udc->gadget.dev.parent; dev_dbg(dev, "ci13xxx_msm_resume\n"); if (_udc_ctxt.wake_irq && _udc_ctxt.wake_irq_state) { Loading @@ -62,11 +69,27 @@ static void ci13xxx_msm_disconnect(void) struct ci13xxx *udc = _udc; struct usb_phy *phy = udc->transceiver; if (phy && (phy->flags & ENABLE_DP_MANUAL_PULLUP)) if (phy && (phy->flags & ENABLE_DP_MANUAL_PULLUP)) { u32 temp; usb_phy_io_write(phy, ULPI_MISC_A_VBUSVLDEXT | ULPI_MISC_A_VBUSVLDEXTSEL, ULPI_CLR(ULPI_MISC_A)); /* Notify LINK of VBUS LOW */ temp = readl_relaxed(USB_USBCMD); temp &= ~USBCMD_SESS_VLD_CTRL; writel_relaxed(temp, USB_USBCMD); /* * Add memory barrier as it is must to complete * above USB PHY and Link register writes before * moving ahead with USB peripheral mode enumeration, * otherwise USB peripheral mode may not work. */ mb(); } } /* Link power management will reduce power consumption by Loading Loading @@ -102,9 +125,9 @@ static void ci13xxx_msm_connect(void) ULPI_MISC_A_VBUSVLDEXTSEL, ULPI_SET(ULPI_MISC_A)); temp = readl_relaxed(USB_GENCONFIG2); temp |= GENCFG2_SESS_VLD_CTRL_EN; writel_relaxed(temp, USB_GENCONFIG2); temp = readl_relaxed(USB_GENCONFIG_2); temp |= GENCONFIG_2_SESS_VLD_CTRL_EN; writel_relaxed(temp, USB_GENCONFIG_2); temp = readl_relaxed(USB_USBCMD); temp |= USBCMD_SESS_VLD_CTRL; Loading @@ -125,10 +148,17 @@ static void ci13xxx_msm_reset(void) struct ci13xxx *udc = _udc; struct usb_phy *phy = udc->transceiver; struct device *dev = udc->gadget.dev.parent; int temp; writel_relaxed(0, USB_AHBBURST); writel_relaxed(0x08, USB_AHBMODE); /* workaround for rx buffer collision issue */ temp = readl_relaxed(USB_GENCONFIG); temp &= ~GENCONFIG_TXFIFO_IDLE_FORCE_DISABLE; temp &= ~GENCONFIG_ULPI_SERIAL_EN; writel_relaxed(temp, USB_GENCONFIG); if (udc->gadget.l1_supported) ci13xxx_msm_set_l1(udc); Loading @@ -149,7 +179,24 @@ static void ci13xxx_msm_reset(void) } } static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) static void ci13xxx_msm_mark_err_event(void) { struct ci13xxx *udc = _udc; struct msm_otg *otg; if (udc == NULL) return; if (udc->transceiver == NULL) return; otg = container_of(udc->transceiver, struct msm_otg, phy); /* This will trigger hardware reset before next connection */ otg->err_event_seen = true; } static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned int event) { struct device *dev = udc->gadget.dev.parent; Loading @@ -175,13 +222,36 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) dev_info(dev, "CI13XXX_CONTROLLER_RESUME_EVENT received\n"); ci13xxx_msm_resume(); break; case CI13XXX_CONTROLLER_ERROR_EVENT: dev_info(dev, "CI13XXX_CONTROLLER_ERROR_EVENT received\n"); ci13xxx_msm_mark_err_event(); break; case CI13XXX_CONTROLLER_UDC_STARTED_EVENT: dev_info(dev, "CI13XXX_CONTROLLER_UDC_STARTED_EVENT received\n"); break; default: dev_dbg(dev, "unknown ci13xxx_udc event\n"); break; } } static bool ci13xxx_msm_in_lpm(struct ci13xxx *udc) { struct msm_otg *otg; if (udc == NULL) return false; if (udc->transceiver == NULL) return false; otg = container_of(udc->transceiver, struct msm_otg, phy); return (atomic_read(&otg->in_lpm) != 0); } static irqreturn_t ci13xxx_msm_resume_irq(int irq, void *data) { struct ci13xxx *udc = _udc; Loading @@ -200,10 +270,10 @@ static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { CI13XXX_REQUIRE_TRANSCEIVER | CI13XXX_PULLUP_ON_VBUS | CI13XXX_ZERO_ITC | CI13XXX_DISABLE_STREAMING | CI13XXX_IS_OTG, CI13XXX_DISABLE_STREAMING, .nz_itc = 0, .notify_event = ci13xxx_msm_notify_event, .in_lpm = ci13xxx_msm_in_lpm, }; static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, Loading @@ -211,10 +281,20 @@ static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, { int wake_irq; int ret; struct pinctrl_state *set_state; dev_dbg(&pdev->dev, "ci13xxx_msm_install_wake_gpio\n"); _udc_ctxt.wake_gpio = res->start; if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_active"); if (IS_ERR(set_state)) { pr_err("cannot get ci13xxx pinctrl active state\n"); return PTR_ERR(set_state); } pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } gpio_request(_udc_ctxt.wake_gpio, "USB_RESUME"); gpio_direction_input(_udc_ctxt.wake_gpio); wake_irq = gpio_to_irq(_udc_ctxt.wake_gpio); Loading @@ -238,20 +318,42 @@ static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, gpio_free: gpio_free(_udc_ctxt.wake_gpio); if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_sleep"); if (IS_ERR(set_state)) pr_err("cannot get ci13xxx pinctrl sleep state\n"); else pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } _udc_ctxt.wake_gpio = 0; return ret; } static void ci13xxx_msm_uninstall_wake_gpio(struct platform_device *pdev) { struct pinctrl_state *set_state; dev_dbg(&pdev->dev, "ci13xxx_msm_uninstall_wake_gpio\n"); if (_udc_ctxt.wake_gpio) { gpio_free(_udc_ctxt.wake_gpio); if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_sleep"); if (IS_ERR(set_state)) pr_err("cannot get ci13xxx pinctrl sleep state\n"); else pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } _udc_ctxt.wake_gpio = 0; } } static void enable_usb_irq_timer_func(unsigned long data); static int ci13xxx_msm_probe(struct platform_device *pdev) { struct resource *res; Loading @@ -271,6 +373,15 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) 1 << (pdata->log2_itc-1); is_l1_supported = pdata->l1_supported; /* Set ahb2ahb bypass flag if it is requested. */ if (pdata->enable_ahb2ahb_bypass) ci13xxx_msm_udc_driver.flags |= CI13XXX_ENABLE_AHB2AHB_BYPASS; /* Clear disable streaming flag if is requested. */ if (pdata->enable_streaming) ci13xxx_msm_udc_driver.flags &= ~CI13XXX_DISABLE_STREAMING; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); Loading Loading @@ -301,6 +412,17 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) } res = platform_get_resource_byname(pdev, IORESOURCE_IO, "USB_RESUME"); /* Get pinctrl if target uses pinctrl */ _udc_ctxt.ci13xxx_pinctrl = devm_pinctrl_get(&pdev->dev); if (IS_ERR(_udc_ctxt.ci13xxx_pinctrl)) { if (of_property_read_bool(pdev->dev.of_node, "pinctrl-names")) { dev_err(&pdev->dev, "Error encountered while getting pinctrl"); ret = PTR_ERR(_udc_ctxt.ci13xxx_pinctrl); goto udc_remove; } dev_dbg(&pdev->dev, "Target does not use pinctrl\n"); _udc_ctxt.ci13xxx_pinctrl = NULL; } if (res) { ret = ci13xxx_msm_install_wake_gpio(pdev, res); if (ret < 0) { Loading @@ -316,7 +438,11 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) goto gpio_uninstall; } setup_timer(&_udc_ctxt.irq_enable_timer, enable_usb_irq_timer_func, (unsigned long)NULL); pm_runtime_no_callbacks(&pdev->dev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); return 0; Loading @@ -341,6 +467,18 @@ int ci13xxx_msm_remove(struct platform_device *pdev) return 0; } void ci13xxx_msm_shutdown(struct platform_device *pdev) { ci13xxx_pullup(&_udc->gadget, 0); } void msm_hw_soft_reset(void) { struct ci13xxx *udc = _udc; hw_device_reset(udc); } void msm_hw_bam_disable(bool bam_disable) { u32 val; Loading @@ -354,12 +492,52 @@ void msm_hw_bam_disable(bool bam_disable) writel_relaxed(val, USB_GENCONFIG); } void msm_usb_irq_disable(bool disable) { struct ci13xxx *udc = _udc; unsigned long flags; spin_lock_irqsave(udc->lock, flags); if (_udc_ctxt.irq_disabled == disable) { pr_debug("Interrupt state already disable = %d\n", disable); if (disable) mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY); spin_unlock_irqrestore(udc->lock, flags); return; } if (disable) { disable_irq_nosync(_udc_ctxt.irq); /* start timer here */ pr_debug("%s: Disabling interrupts\n", __func__); mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY); _udc_ctxt.irq_disabled = true; } else { pr_debug("%s: Enabling interrupts\n", __func__); del_timer(&_udc_ctxt.irq_enable_timer); enable_irq(_udc_ctxt.irq); _udc_ctxt.irq_disabled = false; } spin_unlock_irqrestore(udc->lock, flags); } static void enable_usb_irq_timer_func(unsigned long data) { pr_debug("enabling interrupt from timer\n"); msm_usb_irq_disable(false); } static struct platform_driver ci13xxx_msm_driver = { .probe = ci13xxx_msm_probe, .driver = { .name = "msm_hsusb", }, .remove = ci13xxx_msm_remove, .shutdown = ci13xxx_msm_shutdown, }; MODULE_ALIAS("platform:msm_hsusb"); Loading Loading
drivers/usb/gadget/ci13xxx_msm.c +187 −9 Original line number Diff line number Diff line /* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -11,6 +11,7 @@ #include <linux/usb/msm_hsusb_hw.h> #include <linux/usb/ulpi.h> #include <linux/gpio.h> #include <linux/pinctrl/consumer.h> #include "ci13xxx_udc.c" Loading @@ -24,9 +25,13 @@ struct ci13xxx_udc_context { int wake_gpio; int wake_irq; bool wake_irq_state; struct pinctrl *ci13xxx_pinctrl; struct timer_list irq_enable_timer; bool irq_disabled; }; static struct ci13xxx_udc_context _udc_ctxt; #define IRQ_ENABLE_DELAY (jiffies + msecs_to_jiffies(1000)) static irqreturn_t msm_udc_irq(int irq, void *data) { Loading @@ -36,6 +41,7 @@ static irqreturn_t msm_udc_irq(int irq, void *data) static void ci13xxx_msm_suspend(void) { struct device *dev = _udc->gadget.dev.parent; dev_dbg(dev, "ci13xxx_msm_suspend\n"); if (_udc_ctxt.wake_irq && !_udc_ctxt.wake_irq_state) { Loading @@ -48,6 +54,7 @@ static void ci13xxx_msm_suspend(void) static void ci13xxx_msm_resume(void) { struct device *dev = _udc->gadget.dev.parent; dev_dbg(dev, "ci13xxx_msm_resume\n"); if (_udc_ctxt.wake_irq && _udc_ctxt.wake_irq_state) { Loading @@ -62,11 +69,27 @@ static void ci13xxx_msm_disconnect(void) struct ci13xxx *udc = _udc; struct usb_phy *phy = udc->transceiver; if (phy && (phy->flags & ENABLE_DP_MANUAL_PULLUP)) if (phy && (phy->flags & ENABLE_DP_MANUAL_PULLUP)) { u32 temp; usb_phy_io_write(phy, ULPI_MISC_A_VBUSVLDEXT | ULPI_MISC_A_VBUSVLDEXTSEL, ULPI_CLR(ULPI_MISC_A)); /* Notify LINK of VBUS LOW */ temp = readl_relaxed(USB_USBCMD); temp &= ~USBCMD_SESS_VLD_CTRL; writel_relaxed(temp, USB_USBCMD); /* * Add memory barrier as it is must to complete * above USB PHY and Link register writes before * moving ahead with USB peripheral mode enumeration, * otherwise USB peripheral mode may not work. */ mb(); } } /* Link power management will reduce power consumption by Loading Loading @@ -102,9 +125,9 @@ static void ci13xxx_msm_connect(void) ULPI_MISC_A_VBUSVLDEXTSEL, ULPI_SET(ULPI_MISC_A)); temp = readl_relaxed(USB_GENCONFIG2); temp |= GENCFG2_SESS_VLD_CTRL_EN; writel_relaxed(temp, USB_GENCONFIG2); temp = readl_relaxed(USB_GENCONFIG_2); temp |= GENCONFIG_2_SESS_VLD_CTRL_EN; writel_relaxed(temp, USB_GENCONFIG_2); temp = readl_relaxed(USB_USBCMD); temp |= USBCMD_SESS_VLD_CTRL; Loading @@ -125,10 +148,17 @@ static void ci13xxx_msm_reset(void) struct ci13xxx *udc = _udc; struct usb_phy *phy = udc->transceiver; struct device *dev = udc->gadget.dev.parent; int temp; writel_relaxed(0, USB_AHBBURST); writel_relaxed(0x08, USB_AHBMODE); /* workaround for rx buffer collision issue */ temp = readl_relaxed(USB_GENCONFIG); temp &= ~GENCONFIG_TXFIFO_IDLE_FORCE_DISABLE; temp &= ~GENCONFIG_ULPI_SERIAL_EN; writel_relaxed(temp, USB_GENCONFIG); if (udc->gadget.l1_supported) ci13xxx_msm_set_l1(udc); Loading @@ -149,7 +179,24 @@ static void ci13xxx_msm_reset(void) } } static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) static void ci13xxx_msm_mark_err_event(void) { struct ci13xxx *udc = _udc; struct msm_otg *otg; if (udc == NULL) return; if (udc->transceiver == NULL) return; otg = container_of(udc->transceiver, struct msm_otg, phy); /* This will trigger hardware reset before next connection */ otg->err_event_seen = true; } static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned int event) { struct device *dev = udc->gadget.dev.parent; Loading @@ -175,13 +222,36 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) dev_info(dev, "CI13XXX_CONTROLLER_RESUME_EVENT received\n"); ci13xxx_msm_resume(); break; case CI13XXX_CONTROLLER_ERROR_EVENT: dev_info(dev, "CI13XXX_CONTROLLER_ERROR_EVENT received\n"); ci13xxx_msm_mark_err_event(); break; case CI13XXX_CONTROLLER_UDC_STARTED_EVENT: dev_info(dev, "CI13XXX_CONTROLLER_UDC_STARTED_EVENT received\n"); break; default: dev_dbg(dev, "unknown ci13xxx_udc event\n"); break; } } static bool ci13xxx_msm_in_lpm(struct ci13xxx *udc) { struct msm_otg *otg; if (udc == NULL) return false; if (udc->transceiver == NULL) return false; otg = container_of(udc->transceiver, struct msm_otg, phy); return (atomic_read(&otg->in_lpm) != 0); } static irqreturn_t ci13xxx_msm_resume_irq(int irq, void *data) { struct ci13xxx *udc = _udc; Loading @@ -200,10 +270,10 @@ static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { CI13XXX_REQUIRE_TRANSCEIVER | CI13XXX_PULLUP_ON_VBUS | CI13XXX_ZERO_ITC | CI13XXX_DISABLE_STREAMING | CI13XXX_IS_OTG, CI13XXX_DISABLE_STREAMING, .nz_itc = 0, .notify_event = ci13xxx_msm_notify_event, .in_lpm = ci13xxx_msm_in_lpm, }; static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, Loading @@ -211,10 +281,20 @@ static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, { int wake_irq; int ret; struct pinctrl_state *set_state; dev_dbg(&pdev->dev, "ci13xxx_msm_install_wake_gpio\n"); _udc_ctxt.wake_gpio = res->start; if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_active"); if (IS_ERR(set_state)) { pr_err("cannot get ci13xxx pinctrl active state\n"); return PTR_ERR(set_state); } pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } gpio_request(_udc_ctxt.wake_gpio, "USB_RESUME"); gpio_direction_input(_udc_ctxt.wake_gpio); wake_irq = gpio_to_irq(_udc_ctxt.wake_gpio); Loading @@ -238,20 +318,42 @@ static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev, gpio_free: gpio_free(_udc_ctxt.wake_gpio); if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_sleep"); if (IS_ERR(set_state)) pr_err("cannot get ci13xxx pinctrl sleep state\n"); else pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } _udc_ctxt.wake_gpio = 0; return ret; } static void ci13xxx_msm_uninstall_wake_gpio(struct platform_device *pdev) { struct pinctrl_state *set_state; dev_dbg(&pdev->dev, "ci13xxx_msm_uninstall_wake_gpio\n"); if (_udc_ctxt.wake_gpio) { gpio_free(_udc_ctxt.wake_gpio); if (_udc_ctxt.ci13xxx_pinctrl) { set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl, "ci13xxx_sleep"); if (IS_ERR(set_state)) pr_err("cannot get ci13xxx pinctrl sleep state\n"); else pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state); } _udc_ctxt.wake_gpio = 0; } } static void enable_usb_irq_timer_func(unsigned long data); static int ci13xxx_msm_probe(struct platform_device *pdev) { struct resource *res; Loading @@ -271,6 +373,15 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) 1 << (pdata->log2_itc-1); is_l1_supported = pdata->l1_supported; /* Set ahb2ahb bypass flag if it is requested. */ if (pdata->enable_ahb2ahb_bypass) ci13xxx_msm_udc_driver.flags |= CI13XXX_ENABLE_AHB2AHB_BYPASS; /* Clear disable streaming flag if is requested. */ if (pdata->enable_streaming) ci13xxx_msm_udc_driver.flags &= ~CI13XXX_DISABLE_STREAMING; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); Loading Loading @@ -301,6 +412,17 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) } res = platform_get_resource_byname(pdev, IORESOURCE_IO, "USB_RESUME"); /* Get pinctrl if target uses pinctrl */ _udc_ctxt.ci13xxx_pinctrl = devm_pinctrl_get(&pdev->dev); if (IS_ERR(_udc_ctxt.ci13xxx_pinctrl)) { if (of_property_read_bool(pdev->dev.of_node, "pinctrl-names")) { dev_err(&pdev->dev, "Error encountered while getting pinctrl"); ret = PTR_ERR(_udc_ctxt.ci13xxx_pinctrl); goto udc_remove; } dev_dbg(&pdev->dev, "Target does not use pinctrl\n"); _udc_ctxt.ci13xxx_pinctrl = NULL; } if (res) { ret = ci13xxx_msm_install_wake_gpio(pdev, res); if (ret < 0) { Loading @@ -316,7 +438,11 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) goto gpio_uninstall; } setup_timer(&_udc_ctxt.irq_enable_timer, enable_usb_irq_timer_func, (unsigned long)NULL); pm_runtime_no_callbacks(&pdev->dev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); return 0; Loading @@ -341,6 +467,18 @@ int ci13xxx_msm_remove(struct platform_device *pdev) return 0; } void ci13xxx_msm_shutdown(struct platform_device *pdev) { ci13xxx_pullup(&_udc->gadget, 0); } void msm_hw_soft_reset(void) { struct ci13xxx *udc = _udc; hw_device_reset(udc); } void msm_hw_bam_disable(bool bam_disable) { u32 val; Loading @@ -354,12 +492,52 @@ void msm_hw_bam_disable(bool bam_disable) writel_relaxed(val, USB_GENCONFIG); } void msm_usb_irq_disable(bool disable) { struct ci13xxx *udc = _udc; unsigned long flags; spin_lock_irqsave(udc->lock, flags); if (_udc_ctxt.irq_disabled == disable) { pr_debug("Interrupt state already disable = %d\n", disable); if (disable) mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY); spin_unlock_irqrestore(udc->lock, flags); return; } if (disable) { disable_irq_nosync(_udc_ctxt.irq); /* start timer here */ pr_debug("%s: Disabling interrupts\n", __func__); mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY); _udc_ctxt.irq_disabled = true; } else { pr_debug("%s: Enabling interrupts\n", __func__); del_timer(&_udc_ctxt.irq_enable_timer); enable_irq(_udc_ctxt.irq); _udc_ctxt.irq_disabled = false; } spin_unlock_irqrestore(udc->lock, flags); } static void enable_usb_irq_timer_func(unsigned long data) { pr_debug("enabling interrupt from timer\n"); msm_usb_irq_disable(false); } static struct platform_driver ci13xxx_msm_driver = { .probe = ci13xxx_msm_probe, .driver = { .name = "msm_hsusb", }, .remove = ci13xxx_msm_remove, .shutdown = ci13xxx_msm_shutdown, }; MODULE_ALIAS("platform:msm_hsusb"); Loading