From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Chen, Hu" <hu1.chen@intel.com>, hdegoede@redhat.com
Cc: Balaji <m.balaji@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: roles: Add PM callbacks
Date: Mon, 8 Jul 2019 11:30:36 +0300 [thread overview]
Message-ID: <699cc89d-7366-c167-4295-5153ab7b5716@cogentembedded.com> (raw)
In-Reply-To: <20190708022514.7161-1-hu1.chen@intel.com>
Hello!
On 08.07.2019 5:25, Chen, Hu wrote:
> On some Broxton NUC, the usb role is lost after S3 (it becomes "none").
> Add PM callbacks to address this issue: save the role during suspend and
> restore usb to that role during resume.
>
> Test:
> Run Android on UC6CAY, a NUC powered by Broxton. Access this NUC via
> "adb shell" from a host PC. After a suspend/resume cycle, the adb still
> works well.
>
> Signed-off-by: Chen, Hu <hu1.chen@intel.com>
> Signed-off-by: Balaji <m.balaji@intel.com>
>
> diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c b/drivers/usb/roles/intel-xhci-usb-role-switch.c
> index 277de96181f9..caa1cfab41cc 100644
> --- a/drivers/usb/roles/intel-xhci-usb-role-switch.c
> +++ b/drivers/usb/roles/intel-xhci-usb-role-switch.c
[...]
> @@ -167,6 +168,30 @@ static int intel_xhci_usb_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static int intel_xhci_usb_suspend(struct platform_device *pdev,
> + pm_message_t state)
> +{
> + struct intel_xhci_usb_data *data = platform_get_drvdata(pdev);
> + struct device *dev = &pdev->dev;
> +
> + data->role = intel_xhci_usb_get_role(dev);
Why not just pass &pdev->dev here?
> +
> + return 0;
> +}
> +
[...]
MBR, Sergei
next prev parent reply other threads:[~2019-07-08 8:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 2:25 Chen, Hu
2019-07-08 8:30 ` Sergei Shtylyov [this message]
2019-07-08 14:10 ` Hans de Goede
2019-07-09 10:30 ` [PATCH v2] " Chen, Hu
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=699cc89d-7366-c167-4295-5153ab7b5716@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=hu1.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.balaji@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®