Message ID | 20250312082700.260260-1-xu.yang_2@nxp.com |
---|---|
Headers | show |
Series | add USB2.0 support for i.MX95-19x19 EVK board | expand |
On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > the USB wake-up handling mechanism is integrated within the HSIO block > control module, utilizing a dedicated wake-up interrupt. Therefore, we > also implemented corresponding wake-up logic code to properly manage this > functionality. > > For detailed changes can refer to patch commit log. Does not apply to my tree :(
Hi Greg, On Fri, Mar 14, 2025 at 09:18:51AM +0100, Greg KH wrote: > On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > > the USB wake-up handling mechanism is integrated within the HSIO block > > control module, utilizing a dedicated wake-up interrupt. Therefore, we > > also implemented corresponding wake-up logic code to properly manage this > > functionality. > > > > For detailed changes can refer to patch commit log. > > Does not apply to my tree :( It'd due to below dts patch #2,3 not in usb tree. However, linux-next already have them. I see Shawn just send pull request for 6.15. To make it easy, let me ping you when usb tree have them, is it ok? https://lore.kernel.org/linux-usb/20241204050907.1081781-1-xu.yang_2@nxp.com/#t Thanks, Xu Yang
On Fri, Mar 14, 2025 at 05:21:37PM +0800, Xu Yang wrote: > Hi Greg, > > On Fri, Mar 14, 2025 at 09:18:51AM +0100, Greg KH wrote: > > On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > > > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > > > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > > > the USB wake-up handling mechanism is integrated within the HSIO block > > > control module, utilizing a dedicated wake-up interrupt. Therefore, we > > > also implemented corresponding wake-up logic code to properly manage this > > > functionality. > > > > > > For detailed changes can refer to patch commit log. > > > > Does not apply to my tree :( > > It'd due to below dts patch #2,3 not in usb tree. However, linux-next already > have them. I see Shawn just send pull request for 6.15. To make it easy, > let me ping you when usb tree have them, is it ok? > > https://lore.kernel.org/linux-usb/20241204050907.1081781-1-xu.yang_2@nxp.com/#t That will not be until after 6.15-rc1 is out. thanks, greg k-h
On 25-03-12 16:26:57, Xu Yang wrote: > In previous imx platform, normal USB controller interrupt and wakeup > interrupt are bound to one irq line. However, it changes on latest > i.MX95 platform since it has a dedicated irq line for wakeup interrupt. > This will add wakeup interrupt handling for i.MX95 to support various > wakeup events. > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Acked-by: Peter Chen <peter.chen@kernel.org> > --- > Changes in v5: > - remove warning > - add wakeup_irq checking > Changes in v4: > - warning if no irq provided for imx95 > Changes in v3: > - include <linux/irq.h> to fix possible build issue > Changes in v2: > - rename irq to wakeup_irq > - disable irq by default > - enable irq when suspend, disable irq when resume > --- > drivers/usb/chipidea/ci_hdrc_imx.c | 37 ++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c > index 1a7fc638213e..c34298ccc399 100644 > --- a/drivers/usb/chipidea/ci_hdrc_imx.c > +++ b/drivers/usb/chipidea/ci_hdrc_imx.c > @@ -6,6 +6,7 @@ > */ > > #include <linux/module.h> > +#include <linux/irq.h> > #include <linux/of.h> > #include <linux/of_platform.h> > #include <linux/platform_device.h> > @@ -98,6 +99,7 @@ struct ci_hdrc_imx_data { > struct clk *clk; > struct clk *clk_wakeup; > struct imx_usbmisc_data *usbmisc_data; > + int wakeup_irq; > bool supports_runtime_pm; > bool override_phy_control; > bool in_lpm; > @@ -336,6 +338,16 @@ static int ci_hdrc_imx_notify_event(struct ci_hdrc *ci, unsigned int event) > return ret; > } > > +static irqreturn_t ci_wakeup_irq_handler(int irq, void *data) > +{ > + struct ci_hdrc_imx_data *imx_data = data; > + > + disable_irq_nosync(irq); > + pm_runtime_resume(&imx_data->ci_pdev->dev); > + > + return IRQ_HANDLED; > +} > + > static int ci_hdrc_imx_probe(struct platform_device *pdev) > { > struct ci_hdrc_imx_data *data; > @@ -476,6 +488,16 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) > if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM) > data->supports_runtime_pm = true; > > + data->wakeup_irq = platform_get_irq_optional(pdev, 1); > + if (data->wakeup_irq > 0) { > + ret = devm_request_threaded_irq(dev, data->wakeup_irq, > + NULL, ci_wakeup_irq_handler, > + IRQF_ONESHOT | IRQF_NO_AUTOEN, > + pdata.name, data); > + if (ret) > + goto err_clk; > + } > + > ret = imx_usbmisc_init(data->usbmisc_data); > if (ret) { > dev_err(dev, "usbmisc init failed, ret=%d\n", ret); > @@ -584,6 +606,10 @@ static int imx_controller_suspend(struct device *dev, > } > > imx_disable_unprepare_clks(dev); > + > + if (data->wakeup_irq > 0) > + enable_irq(data->wakeup_irq); > + > if (data->plat_data->flags & CI_HDRC_PMQOS) > cpu_latency_qos_remove_request(&data->pm_qos_req); > > @@ -608,6 +634,10 @@ static int imx_controller_resume(struct device *dev, > if (data->plat_data->flags & CI_HDRC_PMQOS) > cpu_latency_qos_add_request(&data->pm_qos_req, 0); > > + if (data->wakeup_irq > 0 && > + !irqd_irq_disabled(irq_get_irq_data(data->wakeup_irq))) > + disable_irq_nosync(data->wakeup_irq); > + > ret = imx_prepare_enable_clks(dev); > if (ret) > return ret; > @@ -643,6 +673,10 @@ static int ci_hdrc_imx_suspend(struct device *dev) > return ret; > > pinctrl_pm_select_sleep_state(dev); > + > + if (data->wakeup_irq > 0 && device_may_wakeup(dev)) > + enable_irq_wake(data->wakeup_irq); > + > return ret; > } > > @@ -651,6 +685,9 @@ static int ci_hdrc_imx_resume(struct device *dev) > struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); > int ret; > > + if (data->wakeup_irq > 0 && device_may_wakeup(dev)) > + disable_irq_wake(data->wakeup_irq); > + > pinctrl_pm_select_default_state(dev); > ret = imx_controller_resume(dev, PMSG_RESUME); > if (!ret && data->supports_runtime_pm) { > -- > 2.34.1 >
Hi Greg, On Fri, Mar 14, 2025 at 01:37:19PM +0100, Greg KH wrote: > On Fri, Mar 14, 2025 at 05:21:37PM +0800, Xu Yang wrote: > > Hi Greg, > > > > On Fri, Mar 14, 2025 at 09:18:51AM +0100, Greg KH wrote: > > > On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > > > > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > > > > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > > > > the USB wake-up handling mechanism is integrated within the HSIO block > > > > control module, utilizing a dedicated wake-up interrupt. Therefore, we > > > > also implemented corresponding wake-up logic code to properly manage this > > > > functionality. > > > > > > > > For detailed changes can refer to patch commit log. > > > > > > Does not apply to my tree :( > > > > It'd due to below dts patch #2,3 not in usb tree. However, linux-next already > > have them. I see Shawn just send pull request for 6.15. To make it easy, > > let me ping you when usb tree have them, is it ok? > > > > https://lore.kernel.org/linux-usb/20241204050907.1081781-1-xu.yang_2@nxp.com/#t > > That will not be until after 6.15-rc1 is out. In this series, patch #1-4 should go to usb tree and path #5,6 should go to Shawn tree. You can't apply patch #5,6, right? However, you can ignore patch #5,6 and pick up patch #1-4, am my understanding right? Shawn will pick patch #5,6 to his tree. Thanks, Xu Yang
On Tue, Mar 18, 2025 at 03:24:14PM +0800, Xu Yang wrote: > Hi Greg, > > On Fri, Mar 14, 2025 at 01:37:19PM +0100, Greg KH wrote: > > On Fri, Mar 14, 2025 at 05:21:37PM +0800, Xu Yang wrote: > > > Hi Greg, > > > > > > On Fri, Mar 14, 2025 at 09:18:51AM +0100, Greg KH wrote: > > > > On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > > > > > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > > > > > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > > > > > the USB wake-up handling mechanism is integrated within the HSIO block > > > > > control module, utilizing a dedicated wake-up interrupt. Therefore, we > > > > > also implemented corresponding wake-up logic code to properly manage this > > > > > functionality. > > > > > > > > > > For detailed changes can refer to patch commit log. > > > > > > > > Does not apply to my tree :( > > > > > > It'd due to below dts patch #2,3 not in usb tree. However, linux-next already > > > have them. I see Shawn just send pull request for 6.15. To make it easy, > > > let me ping you when usb tree have them, is it ok? > > > > > > https://lore.kernel.org/linux-usb/20241204050907.1081781-1-xu.yang_2@nxp.com/#t > > > > That will not be until after 6.15-rc1 is out. > > In this series, patch #1-4 should go to usb tree and path #5,6 should go to Shawn > tree. You can't apply patch #5,6, right? However, you can ignore patch #5,6 and > pick up patch #1-4, am my understanding right? Shawn will pick patch #5,6 to his > tree. Ok, can you resend just what you want me to take so I can suck in the whole patch series at once and don't have to do it "by hand"? thanks, greg k-h
On Tue, Mar 18, 2025 at 02:12:46PM +0100, Greg KH wrote: > On Tue, Mar 18, 2025 at 03:24:14PM +0800, Xu Yang wrote: > > Hi Greg, > > > > On Fri, Mar 14, 2025 at 01:37:19PM +0100, Greg KH wrote: > > > On Fri, Mar 14, 2025 at 05:21:37PM +0800, Xu Yang wrote: > > > > Hi Greg, > > > > > > > > On Fri, Mar 14, 2025 at 09:18:51AM +0100, Greg KH wrote: > > > > > On Wed, Mar 12, 2025 at 04:26:54PM +0800, Xu Yang wrote: > > > > > > The i.MX95-19x19 EVK board features a USB 2.0 Type-A port, with this > > > > > > series primarily introducing USB 2.0 support. In the i.MX95 architecture, > > > > > > the USB wake-up handling mechanism is integrated within the HSIO block > > > > > > control module, utilizing a dedicated wake-up interrupt. Therefore, we > > > > > > also implemented corresponding wake-up logic code to properly manage this > > > > > > functionality. > > > > > > > > > > > > For detailed changes can refer to patch commit log. > > > > > > > > > > Does not apply to my tree :( > > > > > > > > It'd due to below dts patch #2,3 not in usb tree. However, linux-next already > > > > have them. I see Shawn just send pull request for 6.15. To make it easy, > > > > let me ping you when usb tree have them, is it ok? > > > > > > > > https://lore.kernel.org/linux-usb/20241204050907.1081781-1-xu.yang_2@nxp.com/#t > > > > > > That will not be until after 6.15-rc1 is out. > > > > In this series, patch #1-4 should go to usb tree and path #5,6 should go to Shawn > > tree. You can't apply patch #5,6, right? However, you can ignore patch #5,6 and > > pick up patch #1-4, am my understanding right? Shawn will pick patch #5,6 to his > > tree. > > Ok, can you resend just what you want me to take so I can suck in the > whole patch series at once and don't have to do it "by hand"? Okay. Thanks, Xu Yang