From: Felipe Balbi <balbi@kernel.org>
To: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
michal.simek@xilinx.com, shubhrajyoti.datta@gmail.com,
git-dev@xilinx.com
Subject: Re: [PATCH] usb: xilinx: Add suspend resume support
Date: Tue, 05 Oct 2021 15:20:21 +0300 [thread overview]
Message-ID: <871r4zzmnu.fsf@kernel.org> (raw)
In-Reply-To: <20211005111025.3514231-1-shubhrajyoti.datta@xilinx.com>
Hi,
Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> writes:
> Add suspend resume support. In the suspend udc is disconnected
> and it is set to ready at resume for it to be functional.
>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
> drivers/usb/gadget/udc/udc-xilinx.c | 52 +++++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
> index f5ca670776a3..1369792f195a 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -2176,6 +2176,57 @@ static int xudc_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int xudc_suspend(struct device *dev)
> +{
> + struct xusb_udc *udc;
> + u32 crtlreg;
> + unsigned long flags;
> +
> + udc = dev_get_drvdata(dev);
> +
> + spin_lock_irqsave(&udc->lock, flags);
> +
> + crtlreg = udc->read_fn(udc->addr + XUSB_CONTROL_OFFSET);
> + crtlreg &= ~XUSB_CONTROL_USB_READY_MASK;
> +
> + udc->write_fn(udc->addr, XUSB_CONTROL_OFFSET, crtlreg);
> +
> + spin_unlock_irqrestore(&udc->lock, flags);
> + if (udc->driver && udc->driver->disconnect)
> + udc->driver->disconnect(&udc->gadget);
Why disconnect? Seems like you should call ->suspend() instead, no?
--
balbi
next prev parent reply other threads:[~2021-10-05 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 11:10 [PATCH] usb: xilinx: Add suspend resume support Shubhrajyoti Datta
2021-10-05 12:20 ` Felipe Balbi [this message]
2021-10-05 14:17 ` kernel test robot
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=871r4zzmnu.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=git-dev@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=shubhrajyoti.datta@gmail.com \
--cc=shubhrajyoti.datta@xilinx.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.