[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y01jNqAZrx0uA2xe@kroah.com>
Date: Mon, 17 Oct 2022 16:14:14 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Jim Lin <jilin@...dia.com>
Cc: jonathanh@...dia.com, thierry.reding@...il.com,
mathias.nyman@...el.com, linux-usb@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] xhci: tegra: USB2 pad power controls
On Mon, Oct 17, 2022 at 08:25:31PM +0800, Jim Lin wrote:
> Program USB2 pad PD controls during port connect/disconnect, port
> suspend/resume, and test mode, to reduce power consumption on
> disconnect or suspend.
>
> Signed-off-by: Jim Lin <jilin@...dia.com>
> ---
> v2: Fix issue that wrong tegra->phys[] may be accessed on tegra124
> v3: No change on copyright
> v4: Remove hcd_to_tegra_xusb() function which is used only once.
>
> drivers/usb/host/xhci-tegra.c | 134 +++++++++++++++++++++++++++++++++-
> 1 file changed, 133 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index c8af2cd2216d..a47454503d9e 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -189,6 +189,13 @@ struct tegra_xusb_context_soc {
> } fpci;
> };
>
> +enum tegra_xhci_phy_type {
> + USB3_PHY,
> + USB2_PHY,
> + HSIC_PHY,
> + MAX_PHY_TYPES,
> +};
> +
> struct tegra_xusb_soc {
> const char *firmware;
> const char * const *supply_names;
> @@ -274,9 +281,12 @@ struct tegra_xusb {
>
> bool suspended;
> struct tegra_xusb_context context;
> + u32 enable_utmi_pad_after_lp0_exit;
> };
>
> static struct hc_driver __read_mostly tegra_xhci_hc_driver;
> +static int (*original_xhci_hub_control)(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
> + char *buf, u16 wLength);
That does not work when you have multiple devices in the system, right?
You should not have _any_ static data in a driver.
thanks,
greg k-h
Powered by blists - more mailing lists