From: Frank Li <Frank.li@nxp.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Peter Chen <peter.chen@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
linux-usb@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>,
s32@nxp.com, linaro-s32@linaro.org
Subject: Re: [PATCH 2/4] usb: chipidea: usbmisc: s32g: Add a REINIT_DURING_RESUME flag
Date: Wed, 28 May 2025 17:27:00 -0400 [thread overview]
Message-ID: <aDd/pNP0jt73PKtb@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <b1ddbc5993b2906cf916d023fdf27b07088a9672.1748453565.git.dan.carpenter@linaro.org>
On Wed, May 28, 2025 at 10:57:20PM +0300, Dan Carpenter wrote:
> From: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
>
> The s32g2 and s32g3 chips will need to re-initialize in the resume path.
> Add a REINIT_DURING_RESUME flag which will trigger the reinitialization.
why power_lost_check() doesn't work for you?
Frank
>
> Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/usb/chipidea/usbmisc_imx.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 118b9a68496b..95759a4ec60c 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -155,6 +155,9 @@
> BLKCTL_OTG_VBUS_WAKEUP_EN | \
> BLKCTL_OTG_DPDM_WAKEUP_EN)
>
> +/* Flags for 'struct imx_usbmisc' */
> +#define REINIT_DURING_RESUME BIT(1)
> +
> struct usbmisc_ops {
> /* It's called once when probe a usb device */
> int (*init)(struct imx_usbmisc_data *data);
> @@ -171,6 +174,7 @@ struct usbmisc_ops {
> /* It's called when system resume from usb power lost */
> int (*power_lost_check)(struct imx_usbmisc_data *data);
> void (*vbus_comparator_on)(struct imx_usbmisc_data *data, bool on);
> + u32 flags;
> };
>
> struct imx_usbmisc {
> @@ -1266,6 +1270,9 @@ int imx_usbmisc_resume(struct imx_usbmisc_data *data, bool wakeup)
>
> usbmisc = dev_get_drvdata(data->dev);
>
> + if ((usbmisc->ops->flags & REINIT_DURING_RESUME) && usbmisc->ops->init)
> + usbmisc->ops->init(data);
> +
> if (usbmisc->ops->power_lost_check)
> ret = usbmisc->ops->power_lost_check(data);
> if (ret > 0) {
> --
> 2.47.2
>
next prev parent reply other threads:[~2025-05-28 21:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 19:57 [PATCH 0/4] usb: chipidea: Add support for s32g2 and s32g3 Dan Carpenter
2025-05-28 19:57 ` [PATCH 2/4] usb: chipidea: usbmisc: s32g: Add a REINIT_DURING_RESUME flag Dan Carpenter
2025-05-28 21:27 ` Frank Li [this message]
2025-06-02 14:01 ` Dan Carpenter
2025-05-28 19:57 ` [PATCH 3/4] usb: chipidea: s32g: Add usb support for s32g2 Dan Carpenter
2025-05-28 21:37 ` Frank Li
2025-05-28 19:57 ` [PATCH 4/4] usb: chipidea: s32g: Add usb support for s32g3 Dan Carpenter
2025-05-28 21:40 ` Frank Li
2025-06-11 19:17 ` Dan Carpenter
2025-06-11 21:24 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aDd/pNP0jt73PKtb@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=dan.carpenter@linaro.org \
--cc=festevam@gmail.com \
--cc=ghennadi.procopciuc@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linaro-s32@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox