From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Thu, 06 Nov 2014 10:43:53 +0100 Subject: [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control In-Reply-To: <1415077654-17181-2-git-send-email-marex@denx.de> References: <1415077654-17181-1-git-send-email-marex@denx.de> <1415077654-17181-2-git-send-email-marex@denx.de> Message-ID: <20141106104353.7ea6222d@amdc2363> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, > Encapsulate the Samsung PHY control and it's register accesses > into the otg_phy_init() and otg_phy_off() functions. > > Signed-off-by: Marek Vasut > Cc: Chin Liang See > Cc: Dinh Nguyen > Cc: Vince Bridgers > Cc: Pavel Machek > Cc: Stefan Roese > Cc: Lukasz Majewski > --- > drivers/usb/gadget/s3c_udc_otg.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/gadget/s3c_udc_otg.c > b/drivers/usb/gadget/s3c_udc_otg.c index 7508b1a..b808ddaf 100644 > --- a/drivers/usb/gadget/s3c_udc_otg.c > +++ b/drivers/usb/gadget/s3c_udc_otg.c > @@ -145,8 +145,6 @@ static struct usb_ep_ops s3c_ep_ops = { > > void __iomem *regs_otg; > struct s3c_usbotg_reg *reg; > -struct s3c_usbotg_phy *phy; > -static unsigned int usb_phy_ctrl; > > bool dfu_usb_get_reset(void) > { > @@ -155,6 +153,10 @@ bool dfu_usb_get_reset(void) > > void otg_phy_init(struct s3c_udc *dev) > { > + unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > + struct s3c_usbotg_phy *phy = > + (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > + > dev->pdata->phy_control(1); > > /*USB PHY0 Enable */ > @@ -189,6 +191,10 @@ void otg_phy_init(struct s3c_udc *dev) > > void otg_phy_off(struct s3c_udc *dev) > { > + unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > + struct s3c_usbotg_phy *phy = > + (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > + > /* reset controller just in case */ > writel(PHY_SW_RST0, &phy->rstcon); > udelay(20); > @@ -853,9 +859,7 @@ int s3c_udc_probe(struct s3c_plat_otg_data *pdata) > > dev->pdata = pdata; > > - phy = (struct s3c_usbotg_phy *)pdata->regs_phy; > reg = (struct s3c_usbotg_reg *)pdata->regs_otg; > - usb_phy_ctrl = pdata->usb_phy_ctrl; > > /* regs_otg = (void *)pdata->regs_otg; */ > Acked-by: Lukasz Majewski Tested-by: Lukasz Majewski HW: Trats2 (Exynos4412) - on top of v2014.10 -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group