public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control
Date: Tue,  4 Nov 2014 06:07:31 +0100	[thread overview]
Message-ID: <1415077654-17181-2-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1415077654-17181-1-git-send-email-marex@denx.de>

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 <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Pavel Machek <pavel@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
---
 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; */
 
-- 
2.0.0

  reply	other threads:[~2014-11-04  5:07 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  5:07 [U-Boot] [PATCH 1/5] usb: s3c-otg: Remove useless include Marek Vasut
2014-11-04  5:07 ` Marek Vasut [this message]
2014-11-04 19:30   ` [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control Pavel Machek
2014-11-06  9:43   ` Lukasz Majewski
2014-11-04  5:07 ` [U-Boot] [PATCH 3/5] usb: s3c-otg: Split out " Marek Vasut
2014-11-04 19:34   ` Pavel Machek
2014-11-06 20:26     ` Marek Vasut
2014-11-07  8:59       ` Lukasz Majewski
2014-11-07  9:12         ` Marek Vasut
2014-11-07 10:08           ` Lukasz Majewski
2014-11-07 10:28             ` Marek Vasut
2014-11-07 14:23               ` Lukasz Majewski
2014-11-07 15:30                 ` Marek Vasut
2014-11-06  9:59   ` Lukasz Majewski
2014-11-06 20:23     ` Marek Vasut
2014-11-06 21:29       ` Lukasz Majewski
2014-11-07  8:05         ` Marek Vasut
2014-11-07 10:40           ` Lukasz Majewski
2014-11-04  5:07 ` [U-Boot] [PATCH 4/5] usb: s3c-otg: Allow custom gusbcfg Marek Vasut
2014-11-04 19:36   ` Pavel Machek
2014-11-06 20:27     ` Marek Vasut
2014-11-07  9:11       ` Lukasz Majewski
2014-11-07  9:25         ` Marek Vasut
2014-11-07 10:22           ` Lukasz Majewski
2014-11-07 14:33           ` Lukasz Majewski
2014-11-07 15:31             ` Marek Vasut
2014-11-04  5:07 ` [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config Marek Vasut
2014-11-04 19:51   ` Pavel Machek
2014-11-04 20:09     ` Marek Vasut
2014-11-04 21:01       ` Pavel Machek
2014-11-07 14:40   ` Lukasz Majewski
2014-11-07 14:53     ` Marek Vasut
2014-11-07 15:28       ` Lukasz Majewski
2014-11-07 15:37         ` Marek Vasut
2014-11-07 15:31     ` Marek Vasut
2014-11-04 19:28 ` [U-Boot] [PATCH 1/5] usb: s3c-otg: Remove useless include Pavel Machek
2014-11-06  9:32 ` Lukasz Majewski

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=1415077654-17181-2-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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