[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1476153846.15546.15.camel@mhfsdcap03>
Date: Tue, 11 Oct 2016 10:44:06 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Matthias Brugger <matthias.bgg@...il.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Mathias Nyman <mathias.nyman@...el.com>,
Oliver Neukum <oneukum@...e.com>,
Alan Stern <stern@...land.harvard.edu>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
"Ian Campbell" <ijc+devicetree@...lion.org.uk>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Pawel Moll <pawel.moll@....com>,
Kumar Gala <galak@...eaurora.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Alan Cooper <alcooperx@...il.com>, <linux-usb@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>
Subject: Re: [RESEND PATCH v6, 3/5] usb: xhci-mtk: make IPPC register
optional
On Mon, 2016-10-10 at 12:55 +0200, Matthias Brugger wrote:
>
> On 09/21/2016 07:54 AM, Chunfeng Yun wrote:
> > Make IPPC register optional to support host side of dual-role mode,
> > due to it is moved into common glue layer for simplification.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 36 +++++++++++++++++++++++++++++-------
> > 1 file changed, 29 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> > index 79959f1..4bf99b9 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -94,6 +94,9 @@ static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
> > int ret;
> > int i;
> >
> > + if (ippc == NULL)
> > + return 0;
> > +
> > /* power on host ip */
> > value = readl(&ippc->ip_pw_ctr1);
> > value &= ~CTRL1_IP_HOST_PDN;
> > @@ -139,6 +142,9 @@ static int xhci_mtk_host_disable(struct xhci_hcd_mtk *mtk)
> > int ret;
> > int i;
> >
> > + if (ippc == NULL)
> > + return 0;
> > +
> > /* power down all u3 ports */
> > for (i = 0; i < mtk->num_u3_ports; i++) {
> > value = readl(&ippc->u3_ctrl_p[i]);
> > @@ -173,6 +179,9 @@ static int xhci_mtk_ssusb_config(struct xhci_hcd_mtk *mtk)
> > struct mu3c_ippc_regs __iomem *ippc = mtk->ippc_regs;
> > u32 value;
> >
> > + if (ippc == NULL)
> > + return 0;
> > +
>
> I would prefer to add a flag/bool in xhci_hcd_mtk to signal the absence
> of the ippc. Or at least use a macro which checks the presence before
> calling any of this three functions.
Ok. I will modify it later.
thanks.
>
> Regards,
> Matthias
Powered by blists - more mailing lists