[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <699cc89d-7366-c167-4295-5153ab7b5716@cogentembedded.com>
Date: Mon, 8 Jul 2019 11:30:36 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: "Chen, Hu" <hu1.chen@...el.com>, hdegoede@...hat.com
Cc: Balaji <m.balaji@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: roles: Add PM callbacks
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@...el.com>
> Signed-off-by: Balaji <m.balaji@...el.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
Powered by blists - more mailing lists