devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
@ 2012-10-29 13:42 Vivek Gautam
  2012-10-29 13:42 ` [PATCH v3 2/4] ARM: Exynos5250: Enabling samsung-usbphy driver Vivek Gautam
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-10-29 13:42 UTC (permalink / raw)
  To: linux-usb, linux-samsung-soc, devicetree-discuss
  Cc: gregkh, stern, balbi, rob.herring, kgene.kim, jg1.han, yulgon.kim,
	thomas.abraham, kishon, p.paneri

This patchset is based on the work by Praveen Paneri for
samsung-usbphy driver:
http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653

Changes from v2:
 - Using "EXYNOS5_PHY_" as common prefix along with exact names for
   PHY SFRs for register definitions
 - Using register names with bit macros to make things more clear.
 - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
   in [patch 2/4 v2].

Tested on smdk5250 target with usb-next branch along with arch patches
for exynos5250:
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048

Vivek Gautam (4):
  usb: phy: samsung: Add host phy support to samsung-phy driver
  ARM: Exynos5250: Enabling samsung-usbphy driver
  USB: ehci-s5p: Add phy driver support
  USB: ohci-exynos: Add phy driver support

 .../devicetree/bindings/usb/samsung-usbphy.txt     |   12 +-
 arch/arm/boot/dts/exynos5250.dtsi                  |    5 +
 arch/arm/mach-exynos/Kconfig                       |    1 +
 arch/arm/mach-exynos/include/mach/map.h            |    1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c             |   10 +
 arch/arm/mach-exynos/setup-usb-phy.c               |   45 ++-
 arch/arm/mach-s3c64xx/setup-usb-phy.c              |    2 +-
 arch/arm/plat-samsung/include/plat/usb-phy.h       |    3 +-
 drivers/usb/host/ehci-s5p.c                        |   65 +++-
 drivers/usb/host/ohci-exynos.c                     |   65 +++-
 drivers/usb/phy/Kconfig                            |    1 -
 drivers/usb/phy/samsung-usbphy.c                   |  369 ++++++++++++++++++--
 include/linux/platform_data/samsung-usbphy.h       |    9 +-
 13 files changed, 508 insertions(+), 80 deletions(-)

-- 
1.7.6.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/4] usb: phy: samsung: Add host phy support to samsung-phy driver
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2012-10-29 13:42   ` Vivek Gautam
  2012-10-29 13:42   ` [PATCH v3 3/4] USB: ehci-s5p: Add phy driver support Vivek Gautam
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-10-29 13:42 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, balbi-l0cyMroinI0,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

This patch adds host phy support to samsung-usbphy.c and
further adds support for samsung's exynos5250 usb-phy.

Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/mach-exynos/setup-usb-phy.c         |    2 +-
 arch/arm/mach-s3c64xx/setup-usb-phy.c        |    2 +-
 arch/arm/plat-samsung/include/plat/usb-phy.h |    2 +-
 drivers/usb/phy/Kconfig                      |    1 -
 drivers/usb/phy/samsung-usbphy.c             |  369 ++++++++++++++++++++++++--
 include/linux/platform_data/samsung-usbphy.h |    8 +-
 6 files changed, 353 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c
index 1c62d20..be6cd4f 100644
--- a/arch/arm/mach-exynos/setup-usb-phy.c
+++ b/arch/arm/mach-exynos/setup-usb-phy.c
@@ -222,7 +222,7 @@ int s5p_usb_phy_exit(struct platform_device *pdev, int type)
 	return -EINVAL;
 }
 
-void s5p_usb_phy_pmu_isolation(int on)
+void s5p_usb_phy_pmu_isolation(int on, int type)
 {
 	if (on) {
 		writel(readl(S5P_USBDEVICE_PHY_CONTROL)
diff --git a/arch/arm/mach-s3c64xx/setup-usb-phy.c b/arch/arm/mach-s3c64xx/setup-usb-phy.c
index 3aee778..b7d1d95 100644
--- a/arch/arm/mach-s3c64xx/setup-usb-phy.c
+++ b/arch/arm/mach-s3c64xx/setup-usb-phy.c
@@ -13,7 +13,7 @@
 #include <mach/map.h>
 #include <mach/regs-sys.h>
 
-void s5p_usb_phy_pmu_isolation(int on)
+void s5p_usb_phy_pmu_isolation(int on, int type)
 {
 	if (on) {
 		writel(readl(S3C64XX_OTHERS) & ~S3C64XX_OTHERS_USBMASK,
diff --git a/arch/arm/plat-samsung/include/plat/usb-phy.h b/arch/arm/plat-samsung/include/plat/usb-phy.h
index 165ffe7..7a4a959 100644
--- a/arch/arm/plat-samsung/include/plat/usb-phy.h
+++ b/arch/arm/plat-samsung/include/plat/usb-phy.h
@@ -18,6 +18,6 @@ enum s5p_usb_phy_type {
 
 extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
 extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
-extern void s5p_usb_phy_pmu_isolation(int on);
+extern void s5p_usb_phy_pmu_isolation(int on, int type);
 
 #endif /* __PLAT_SAMSUNG_USB_PHY_H */
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 313685f..1ce5b32 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -35,7 +35,6 @@ config MV_U3D_PHY
 
 config SAMSUNG_USBPHY
 	bool "Samsung USB PHY controller Driver"
-	depends on USB_S3C_HSOTG
 	select USB_OTG_UTILS
 	help
 	  Enable this to support Samsung USB phy controller for samsung
diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c
index 4efe89c..006f72e 100644
--- a/drivers/usb/phy/samsung-usbphy.c
+++ b/drivers/usb/phy/samsung-usbphy.c
@@ -57,6 +57,116 @@
 #define S3C_RSTCON_HCLK				(1 << 1)
 #define S3C_RSTCON_PHY				(1 << 0)
 
+/* EXYNOS5 */
+#define EXYNOS5_PHY_HOST_CTRL0			(0x00)
+
+#define HOST_CTRL0_PHYSWRSTALL			(0x1 << 31)
+
+#define HOST_CTRL0_REFCLKSEL_MASK		(0x3)
+#define HOST_CTRL0_REFCLKSEL(_x)		((_x) << 19)
+#define HOST_CTRL0_REFCLKSEL_XTAL		\
+		HOST_CTRL0_REFCLKSEL(0x0)
+#define HOST_CTRL0_REFCLKSEL_EXTL		\
+		HOST_CTRL0_REFCLKSEL(0x1)
+#define HOST_CTRL0_REFCLKSEL_CLKCORE		\
+		HOST_CTRL0_REFCLKSEL(0x2)
+
+#define HOST_CTRL0_FSEL_MASK			(0x7 << 16)
+#define HOST_CTRL0_FSEL(_x)			((_x) << 16)
+#define HOST_CTRL0_FSEL_CLKSEL_50M		(0x7)
+#define HOST_CTRL0_FSEL_CLKSEL_24M		(0x5)
+#define HOST_CTRL0_FSEL_CLKSEL_20M		(0x4)
+#define HOST_CTRL0_FSEL_CLKSEL_19200K		(0x3)
+#define HOST_CTRL0_FSEL_CLKSEL_12M		(0x2)
+#define HOST_CTRL0_FSEL_CLKSEL_10M		(0x1)
+#define HOST_CTRL0_FSEL_CLKSEL_9600K		(0x0)
+
+#define HOST_CTRL0_TESTBURNIN			(0x1 << 11)
+#define HOST_CTRL0_RETENABLE			(0x1 << 10)
+#define HOST_CTRL0_COMMONON_N			(0x1 << 9)
+#define HOST_CTRL0_SIDDQ			(0x1 << 6)
+#define HOST_CTRL0_FORCESLEEP			(0x1 << 5)
+#define HOST_CTRL0_FORCESUSPEND			(0x1 << 4)
+#define HOST_CTRL0_WORDINTERFACE		(0x1 << 3)
+#define HOST_CTRL0_UTMISWRST			(0x1 << 2)
+#define HOST_CTRL0_LINKSWRST			(0x1 << 1)
+#define HOST_CTRL0_PHYSWRST			(0x1 << 0)
+
+#define EXYNOS5_PHY_HOST_TUNE0			(0x04)
+
+#define EXYNOS5_PHY_HSIC_CTRL1			(0x10)
+
+#define EXYNOS5_PHY_HSIC_TUNE1			(0x14)
+
+#define EXYNOS5_PHY_HSIC_CTRL2			(0x20)
+
+#define EXYNOS5_PHY_HSIC_TUNE2			(0x24)
+
+#define HSIC_CTRL_REFCLKSEL_MASK		(0x3)
+#define HSIC_CTRL_REFCLKSEL			(0x2 << 23)
+
+#define HSIC_CTRL_REFCLKDIV_MASK		(0x7f)
+#define HSIC_CTRL_REFCLKDIV(_x)			((_x) << 16)
+#define HSIC_CTRL_REFCLKDIV_12			\
+		HSIC_CTRL_REFCLKDIV(0x24)
+#define HSIC_CTRL_REFCLKDIV_15			\
+		HSIC_CTRL_REFCLKDIV(0x1C)
+#define HSIC_CTRL_REFCLKDIV_16			\
+		HSIC_CTRL_REFCLKDIV(0x1A)
+#define HSIC_CTRL_REFCLKDIV_19_2		\
+		HSIC_CTRL_REFCLKDIV(0x15)
+#define HSIC_CTRL_REFCLKDIV_20			\
+		HSIC_CTRL_REFCLKDIV(0x14)
+
+#define HSIC_CTRL_SIDDQ				(0x1 << 6)
+#define HSIC_CTRL_FORCESLEEP			(0x1 << 5)
+#define HSIC_CTRL_FORCESUSPEND			(0x1 << 4)
+#define HSIC_CTRL_WORDINTERFACE			(0x1 << 3)
+#define HSIC_CTRL_UTMISWRST			(0x1 << 2)
+#define HSIC_CTRL_PHYSWRST			(0x1 << 0)
+
+#define EXYNOS5_PHY_HOST_EHCICTRL		(0x30)
+
+#define HOST_EHCICTRL_ENAINCRXALIGN		(0x1 << 29)
+#define HOST_EHCICTRL_ENAINCR4			(0x1 << 28)
+#define HOST_EHCICTRL_ENAINCR8			(0x1 << 27)
+#define HOST_EHCICTRL_ENAINCR16			(0x1 << 26)
+
+#define EXYNOS5_PHY_HOST_OHCICTRL		(0x34)
+
+#define HOST_OHCICTRL_SUSPLGCY			(0x1 << 3)
+#define HOST_OHCICTRL_APPSTARTCLK		(0x1 << 2)
+#define HOST_OHCICTRL_CNTSEL			(0x1 << 1)
+#define HOST_OHCICTRL_CLKCKTRST			(0x1 << 0)
+
+#define EXYNOS5_PHY_OTG_SYS			(0x38)
+
+#define OTG_SYS_PHYLINK_SWRESET			(0x1 << 14)
+#define OTG_SYS_LINKSWRST_UOTG			(0x1 << 13)
+#define OTG_SYS_PHY0_SWRST			(0x1 << 12)
+
+#define OTG_SYS_REFCLKSEL_MASK			(0x3 << 9)
+#define OTG_SYS_REFCLKSEL(_x)			((_x) << 9)
+#define OTG_SYS_REFCLKSEL_XTAL			\
+		OTG_SYS_REFCLKSEL(0x0)
+#define OTG_SYS_REFCLKSEL_EXTL			\
+		OTG_SYS_REFCLKSEL(0x1)
+#define OTG_SYS_REFCLKSEL_CLKCORE		\
+		OTG_SYS_REFCLKSEL(0x2)
+
+#define OTG_SYS_IDPULLUP_UOTG			(0x1 << 8)
+#define OTG_SYS_COMMON_ON			(0x1 << 7)
+
+#define OTG_SYS_FSEL_MASK			(0x7 << 4)
+#define OTG_SYS_FSEL(_x)			((_x) << 4)
+
+#define OTG_SYS_FORCESLEEP			(0x1 << 3)
+#define OTG_SYS_OTGDISABLE			(0x1 << 2)
+#define OTG_SYS_SIDDQ_UOTG			(0x1 << 1)
+#define OTG_SYS_FORCESUSPEND			(0x1 << 0)
+
+#define EXYNOS5_PHY_OTG_TUNE			(0x40)
+
 #ifndef MHZ
 #define MHZ (1000*1000)
 #endif
@@ -64,6 +174,7 @@
 enum samsung_cpu_type {
 	TYPE_S3C64XX,
 	TYPE_EXYNOS4210,
+	TYPE_EXYNOS5250,
 };
 
 /*
@@ -84,6 +195,7 @@ struct samsung_usbphy {
 	void __iomem	*regs;
 	int		ref_clk_freq;
 	int		cpu_type;
+	atomic_t	host_usage;
 };
 
 #define phy_to_sphy(x)		container_of((x), struct samsung_usbphy, phy)
@@ -96,30 +208,176 @@ static int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy)
 	struct clk *ref_clk;
 	int refclk_freq = 0;
 
-	ref_clk = clk_get(sphy->dev, "xusbxti");
+	if (sphy->cpu_type == TYPE_EXYNOS5250)
+		ref_clk = clk_get(sphy->dev, "ext_xtal");
+	else
+		ref_clk = clk_get(sphy->dev, "xusbxti");
 	if (IS_ERR(ref_clk)) {
 		dev_err(sphy->dev, "Failed to get reference clock\n");
 		return PTR_ERR(ref_clk);
 	}
 
-	switch (clk_get_rate(ref_clk)) {
-	case 12 * MHZ:
-		refclk_freq |= S3C_PHYCLK_CLKSEL_12M;
-		break;
-	case 24 * MHZ:
-		refclk_freq |= S3C_PHYCLK_CLKSEL_24M;
-		break;
-	default:
-	case 48 * MHZ:
-		/* default reference clock */
-		refclk_freq |= S3C_PHYCLK_CLKSEL_48M;
-		break;
+	if (sphy->cpu_type == TYPE_EXYNOS5250) {
+		/* set clock frequency for PLL */
+		switch (clk_get_rate(ref_clk)) {
+		case 96 * 100000:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_9600K;
+			break;
+		case 10 * MHZ:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_10M;
+			break;
+		case 12 * MHZ:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_12M;
+			break;
+		case 192 * 100000:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_19200K;
+			break;
+		case 20 * MHZ:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_20M;
+			break;
+		case 50 * MHZ:
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_50M;
+			break;
+		case 24 * MHZ:
+		default:
+			/* default reference clock */
+			refclk_freq |= HOST_CTRL0_FSEL_CLKSEL_24M;
+			break;
+		}
+	} else {
+		switch (clk_get_rate(ref_clk)) {
+		case 12 * MHZ:
+			refclk_freq |= S3C_PHYCLK_CLKSEL_12M;
+			break;
+		case 24 * MHZ:
+			refclk_freq |= S3C_PHYCLK_CLKSEL_24M;
+			break;
+		default:
+		case 48 * MHZ:
+			/* default reference clock */
+			refclk_freq |= S3C_PHYCLK_CLKSEL_48M;
+			break;
+		}
 	}
 	clk_put(ref_clk);
 
 	return refclk_freq;
 }
 
+static int exynos5_phyhost_is_on(void *regs)
+{
+	return (readl(regs + EXYNOS5_PHY_HOST_CTRL0) &
+				HOST_CTRL0_SIDDQ) ? 0 : 1;
+}
+
+static void samsung_exynos5_usbphy_enable(struct samsung_usbphy *sphy)
+{
+	void __iomem *regs = sphy->regs;
+	u32 phyclk = sphy->ref_clk_freq;
+	u32 phyhost;
+	u32 phyotg;
+	u32 phyhsic;
+	u32 ehcictrl;
+	u32 ohcictrl;
+
+	atomic_inc(&sphy->host_usage);
+
+	if (exynos5_phyhost_is_on(regs)) {
+		dev_info(sphy->dev, "Already power on PHY\n");
+		return;
+	}
+
+	/* Selecting Host/OTG mode; After reset USB2.0PHY_CFG: HOST */
+	if (sphy->plat && sphy->plat->phy_cfg_sel) {
+		if (sphy->plat->type)
+			sphy->plat->phy_cfg_sel(sphy->dev, sphy->plat->type);
+		else
+			sphy->plat->phy_cfg_sel(sphy->dev, TYPE_OTG);
+	}
+
+	/* Host configuration */
+	phyhost = readl(regs + EXYNOS5_PHY_HOST_CTRL0);
+
+	/* phy reference clock configuration */
+	phyhost &= ~HOST_CTRL0_FSEL_MASK;
+	phyhost |= HOST_CTRL0_FSEL(phyclk);
+
+	/* host phy reset */
+	phyhost &= ~(HOST_CTRL0_PHYSWRST |
+			HOST_CTRL0_PHYSWRSTALL |
+			HOST_CTRL0_SIDDQ |
+			/* Enable normal mode of operation */
+			HOST_CTRL0_FORCESUSPEND |
+			HOST_CTRL0_FORCESLEEP);
+
+	/* Link reset */
+	phyhost |= (HOST_CTRL0_LINKSWRST |
+			HOST_CTRL0_UTMISWRST |
+			/* COMMON Block configuration during suspend */
+			HOST_CTRL0_COMMONON_N);
+	writel(phyhost, regs + EXYNOS5_PHY_HOST_CTRL0);
+	udelay(10);
+	phyhost &= ~(HOST_CTRL0_LINKSWRST |
+			HOST_CTRL0_UTMISWRST);
+	writel(phyhost, regs + EXYNOS5_PHY_HOST_CTRL0);
+
+	/* OTG configuration */
+	phyotg = readl(regs + EXYNOS5_PHY_OTG_SYS);
+
+	/* phy reference clock configuration */
+	phyotg &= ~OTG_SYS_FSEL_MASK;
+	phyotg |= OTG_SYS_FSEL(phyclk);
+
+	/* Enable normal mode of operation */
+	phyotg &= ~(OTG_SYS_FORCESUSPEND |
+			OTG_SYS_SIDDQ_UOTG |
+			OTG_SYS_FORCESLEEP |
+			OTG_SYS_REFCLKSEL_MASK |
+			/* COMMON Block configuration during suspend */
+			OTG_SYS_COMMON_ON);
+
+	/* OTG phy & link reset */
+	phyotg |= (OTG_SYS_PHY0_SWRST |
+			OTG_SYS_LINKSWRST_UOTG |
+			OTG_SYS_PHYLINK_SWRESET |
+			OTG_SYS_OTGDISABLE |
+			/* Set phy refclk */
+			OTG_SYS_REFCLKSEL_CLKCORE);
+
+	writel(phyotg, regs + EXYNOS5_PHY_OTG_SYS);
+	udelay(10);
+	phyotg &= ~(OTG_SYS_PHY0_SWRST |
+			OTG_SYS_LINKSWRST_UOTG |
+			OTG_SYS_PHYLINK_SWRESET);
+	writel(phyotg, regs + EXYNOS5_PHY_OTG_SYS);
+
+	/* HSIC phy configuration */
+	phyhsic = (HSIC_CTRL_REFCLKDIV_12 |
+			HSIC_CTRL_REFCLKSEL |
+			HSIC_CTRL_PHYSWRST);
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL1);
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL2);
+	udelay(10);
+	phyhsic &= ~HSIC_CTRL_PHYSWRST;
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL1);
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL2);
+
+	udelay(80);
+
+	/* enable EHCI DMA burst */
+	ehcictrl = readl(regs + EXYNOS5_PHY_HOST_EHCICTRL);
+	ehcictrl |= (HOST_EHCICTRL_ENAINCRXALIGN |
+				HOST_EHCICTRL_ENAINCR4 |
+				HOST_EHCICTRL_ENAINCR8 |
+				HOST_EHCICTRL_ENAINCR16);
+	writel(ehcictrl, regs + EXYNOS5_PHY_HOST_EHCICTRL);
+
+	/* set ohci_suspend_on_n */
+	ohcictrl = readl(regs + EXYNOS5_PHY_HOST_OHCICTRL);
+	ohcictrl |= HOST_OHCICTRL_SUSPLGCY;
+	writel(ohcictrl, regs + EXYNOS5_PHY_HOST_OHCICTRL);
+}
+
 static void samsung_usbphy_enable(struct samsung_usbphy *sphy)
 {
 	void __iomem *regs = sphy->regs;
@@ -155,6 +413,41 @@ static void samsung_usbphy_enable(struct samsung_usbphy *sphy)
 	writel(rstcon, regs + S3C_RSTCON);
 }
 
+static void samsung_exynos5_usbphy_disable(struct samsung_usbphy *sphy)
+{
+	void __iomem *regs = sphy->regs;
+	u32 phyhost;
+	u32 phyotg;
+	u32 phyhsic;
+
+	if (atomic_dec_return(&sphy->host_usage) > 0) {
+		dev_info(sphy->dev, "still being used\n");
+		return;
+	}
+
+	phyhsic = (HSIC_CTRL_REFCLKDIV_12 |
+			HSIC_CTRL_REFCLKSEL |
+			HSIC_CTRL_SIDDQ |
+			HSIC_CTRL_FORCESLEEP |
+			HSIC_CTRL_FORCESUSPEND);
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL1);
+	writel(phyhsic, regs + EXYNOS5_PHY_HSIC_CTRL2);
+
+	phyhost = readl(regs + EXYNOS5_PHY_HOST_CTRL0);
+	phyhost |= (HOST_CTRL0_SIDDQ |
+			HOST_CTRL0_FORCESUSPEND |
+			HOST_CTRL0_FORCESLEEP |
+			HOST_CTRL0_PHYSWRST |
+			HOST_CTRL0_PHYSWRSTALL);
+	writel(phyhost, regs + EXYNOS5_PHY_HOST_CTRL0);
+
+	phyotg = readl(regs + EXYNOS5_PHY_OTG_SYS);
+	phyotg |= (OTG_SYS_FORCESUSPEND |
+			OTG_SYS_SIDDQ_UOTG |
+			OTG_SYS_FORCESLEEP);
+	writel(phyotg, regs + EXYNOS5_PHY_OTG_SYS);
+}
+
 static void samsung_usbphy_disable(struct samsung_usbphy *sphy)
 {
 	void __iomem *regs = sphy->regs;
@@ -194,11 +487,18 @@ static int samsung_usbphy_init(struct usb_phy *phy)
 	}
 
 	/* Disable phy isolation */
-	if (sphy->plat && sphy->plat->pmu_isolation)
-		sphy->plat->pmu_isolation(false);
+	if (sphy->plat && sphy->plat->pmu_isolation) {
+		if (sphy->plat->type)
+			sphy->plat->pmu_isolation(false, sphy->plat->type);
+		else
+			sphy->plat->pmu_isolation(false, TYPE_OTG);
+	}
 
 	/* Initialize usb phy registers */
-	samsung_usbphy_enable(sphy);
+	if (sphy->cpu_type == TYPE_EXYNOS5250)
+		samsung_exynos5_usbphy_enable(sphy);
+	else
+		samsung_usbphy_enable(sphy);
 
 	/* Disable the phy clock */
 	clk_disable_unprepare(sphy->clk);
@@ -220,11 +520,18 @@ static void samsung_usbphy_shutdown(struct usb_phy *phy)
 	}
 
 	/* De-initialize usb phy registers */
-	samsung_usbphy_disable(sphy);
+	if (sphy->cpu_type == TYPE_EXYNOS5250)
+		samsung_exynos5_usbphy_disable(sphy);
+	else
+		samsung_usbphy_disable(sphy);
 
 	/* Enable phy isolation */
-	if (sphy->plat && sphy->plat->pmu_isolation)
-		sphy->plat->pmu_isolation(true);
+	if (sphy->plat && sphy->plat->pmu_isolation) {
+		if (sphy->plat->type)
+			sphy->plat->pmu_isolation(true, sphy->plat->type);
+		else
+			sphy->plat->pmu_isolation(true, TYPE_OTG);
+	}
 
 	clk_disable_unprepare(sphy->clk);
 }
@@ -277,16 +584,9 @@ static int __devinit samsung_usbphy_probe(struct platform_device *pdev)
 	if (!sphy)
 		return -ENOMEM;
 
-	clk = devm_clk_get(dev, "otg");
-	if (IS_ERR(clk)) {
-		dev_err(dev, "Failed to get otg clock\n");
-		return PTR_ERR(clk);
-	}
-
 	sphy->dev		= &pdev->dev;
 	sphy->plat		= pdata;
 	sphy->regs		= phy_base;
-	sphy->clk		= clk;
 	sphy->phy.dev		= sphy->dev;
 	sphy->phy.label		= "samsung-usbphy";
 	sphy->phy.init		= samsung_usbphy_init;
@@ -296,6 +596,17 @@ static int __devinit samsung_usbphy_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, sphy);
 
+	if (sphy->cpu_type == TYPE_EXYNOS5250)
+		clk = devm_clk_get(dev, "usbhost");
+	else
+		clk = devm_clk_get(dev, "otg");
+	if (IS_ERR(clk)) {
+		dev_err(dev, "Failed to get otg clock\n");
+		return PTR_ERR(clk);
+	}
+
+	sphy->clk = clk;
+
 	ret = usb_add_phy(&sphy->phy, USB_PHY_TYPE_USB2);
 	return ret;
 }
@@ -317,6 +628,9 @@ static const struct of_device_id samsung_usbphy_dt_match[] = {
 	}, {
 		.compatible = "samsung,exynos4210-usbphy",
 		.data = (void *)TYPE_EXYNOS4210,
+	}, {
+		.compatible = "samsung,exynos5250-usbphy",
+		.data = (void *)TYPE_EXYNOS5250,
 	},
 	{},
 };
@@ -332,6 +646,9 @@ static struct platform_device_id samsung_usbphy_driver_ids[] = {
 	}, {
 		.name		= "exynos4210-usbphy",
 		.driver_data	= TYPE_EXYNOS4210,
+	}, {
+		.name		= "exynos5250-usbphy",
+		.driver_data	= TYPE_EXYNOS5250,
 	},
 	{},
 };
diff --git a/include/linux/platform_data/samsung-usbphy.h b/include/linux/platform_data/samsung-usbphy.h
index 1bd24cb..364a38a 100644
--- a/include/linux/platform_data/samsung-usbphy.h
+++ b/include/linux/platform_data/samsung-usbphy.h
@@ -18,8 +18,14 @@
  * samsung_usbphy_data - Platform data for USB PHY driver.
  * @pmu_isolation: Function to control usb phy isolation in PMU.
  */
+enum phy_type {
+	TYPE_OTG,
+	TYPE_HOST,
+};
+
 struct samsung_usbphy_data {
-	void (*pmu_isolation)(int on);
+	void (*pmu_isolation)(int on, int phy_type);
+	int type;
 };
 
 extern void samsung_usbphy_set_pdata(struct samsung_usbphy_data *pd);
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/4] ARM: Exynos5250: Enabling samsung-usbphy driver
  2012-10-29 13:42 [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250 Vivek Gautam
@ 2012-10-29 13:42 ` Vivek Gautam
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-10-29 13:42 UTC (permalink / raw)
  To: linux-usb, linux-samsung-soc, devicetree-discuss
  Cc: gregkh, stern, balbi, rob.herring, kgene.kim, jg1.han, yulgon.kim,
	thomas.abraham, kishon, p.paneri

Adding usbphy node for Exynos5250 along with the platform data.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 .../devicetree/bindings/usb/samsung-usbphy.txt     |   12 +++++-
 arch/arm/boot/dts/exynos5250.dtsi                  |    5 ++
 arch/arm/mach-exynos/Kconfig                       |    1 +
 arch/arm/mach-exynos/include/mach/map.h            |    1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c             |   10 +++++
 arch/arm/mach-exynos/setup-usb-phy.c               |   43 ++++++++++++++++---
 arch/arm/plat-samsung/include/plat/usb-phy.h       |    1 +
 include/linux/platform_data/samsung-usbphy.h       |    1 +
 8 files changed, 65 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
index 7b26e2d..9e21f4b 100644
--- a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
+++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
@@ -1,11 +1,19 @@
 * Samsung's usb phy transceiver
 
-The Samsung's phy transceiver is used for controlling usb otg phy for
-s3c-hsotg usb device controller.
+The Samsung's phy transceiver is used for controlling usb phy for
+s3c-hsotg as well as ehci-s5p and ohci-exynos usb controllers
+across Samsung SOCs.
 TODO: Adding the PHY binding with controller(s) according to the under
 developement generic PHY driver.
 
+Exynos4210:
 Required properties:
 - compatible : should be "samsung,exynos4210-usbphy"
 - reg : base physical address of the phy registers and length of memory mapped
 	region.
+
+Exynos5250:
+Required properties:
+- compatible : should be "samsung,exynos5250-usbphy"
+- reg : base physical address of the phy registers and length of memory mapped
+	region.
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index dddfd6e..82bf042 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -218,6 +218,11 @@
 		#size-cells = <0>;
 	};
 
+	usbphy {
+		compatible = "samsung,exynos5250-usbphy";
+		reg = <0x12130000 0x100>;
+	};
+
 	amba {
 		#address-cells = <1>;
 		#size-cells = <1>;
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index da55107..d73fa42 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -419,6 +419,7 @@ config MACH_EXYNOS5_DT
 	bool "SAMSUNG EXYNOS5 Machine using device tree"
 	depends on ARCH_EXYNOS5
 	select ARM_AMBA
+	select EXYNOS4_SETUP_USB_PHY
 	select SOC_EXYNOS5250
 	select USE_OF
 	help
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 9694424..7f5eb03 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -195,6 +195,7 @@
 #define EXYNOS4_PA_EHCI			0x12580000
 #define EXYNOS4_PA_OHCI			0x12590000
 #define EXYNOS4_PA_HSPHY		0x125B0000
+#define EXYNOS5_PA_HSPHY		0x12130000
 #define EXYNOS4_PA_MFC			0x13400000
 
 #define EXYNOS4_PA_UART			0x13800000
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index db1cd8e..bc041be 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -11,6 +11,7 @@
 
 #include <linux/of_platform.h>
 #include <linux/serial_core.h>
+#include <linux/platform_data/samsung-usbphy.h>
 
 #include <asm/mach/arch.h>
 #include <asm/hardware/gic.h>
@@ -18,9 +19,16 @@
 
 #include <plat/cpu.h>
 #include <plat/regs-serial.h>
+#include <plat/usb-phy.h>
 
 #include "common.h"
 
+static struct samsung_usbphy_data exynos5_usbphy_pdata = {
+	.pmu_isolation = s5p_usb_phy_pmu_isolation,
+	.phy_cfg_sel = s5p_usb_phy_cfg_sel,
+	.type = TYPE_HOST,
+};
+
 /*
  * The following lookup table is used to override device names when devices
  * are registered from device tree. This is temporarily added to enable
@@ -72,6 +80,8 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
 				"exynos-gsc.2", NULL),
 	OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
 				"exynos-gsc.3", NULL),
+	OF_DEV_AUXDATA("samsung,exynos5250-usbphy", EXYNOS5_PA_HSPHY,
+				"s3c-usbphy", &exynos5_usbphy_pdata),
 	{},
 };
 
diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c
index be6cd4f..5aafc93 100644
--- a/arch/arm/mach-exynos/setup-usb-phy.c
+++ b/arch/arm/mach-exynos/setup-usb-phy.c
@@ -14,11 +14,15 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/samsung-usbphy.h>
 #include <mach/regs-pmu.h>
 #include <mach/regs-usb-phy.h>
 #include <plat/cpu.h>
+#include <plat/map-base.h>
 #include <plat/usb-phy.h>
 
+#define EXYNOS5_USB_CFG			(S3C_VA_SYS + 0x230)
+
 static atomic_t host_usage;
 
 static int exynos4_usb_host_phy_is_on(void)
@@ -224,13 +228,38 @@ int s5p_usb_phy_exit(struct platform_device *pdev, int type)
 
 void s5p_usb_phy_pmu_isolation(int on, int type)
 {
-	if (on) {
-		writel(readl(S5P_USBDEVICE_PHY_CONTROL)
-			& ~S5P_USBDEVICE_PHY_ENABLE,
-				S5P_USBDEVICE_PHY_CONTROL);
+	if (type == TYPE_HOST) {
+		if (on) {
+			writel(readl(S5P_USBHOST_PHY_CONTROL)
+				& ~S5P_USBHOST_PHY_ENABLE,
+					S5P_USBHOST_PHY_CONTROL);
+		} else {
+			writel(readl(S5P_USBHOST_PHY_CONTROL)
+				| S5P_USBHOST_PHY_ENABLE,
+					S5P_USBHOST_PHY_CONTROL);
+		}
 	} else {
-		writel(readl(S5P_USBDEVICE_PHY_CONTROL)
-			| S5P_USBDEVICE_PHY_ENABLE,
-				S5P_USBDEVICE_PHY_CONTROL);
+		if (on) {
+			writel(readl(S5P_USBDEVICE_PHY_CONTROL)
+				& ~S5P_USBDEVICE_PHY_ENABLE,
+					S5P_USBDEVICE_PHY_CONTROL);
+		} else {
+			writel(readl(S5P_USBDEVICE_PHY_CONTROL)
+				| S5P_USBDEVICE_PHY_ENABLE,
+					S5P_USBDEVICE_PHY_CONTROL);
+		}
 	}
 }
+
+/* Switch between HOST and OTG link from PHY_CFG */
+void s5p_usb_phy_cfg_sel(struct device *dev, int type)
+{
+	u32 is_host;
+
+	is_host = readl(EXYNOS5_USB_CFG);
+	writel(type, EXYNOS5_USB_CFG);
+
+	if (is_host != type)
+		dev_dbg(dev, "Changed USB MUX from %s to %s",
+			is_host ? "Host" : "Device", type ? "Host" : "Device");
+}
diff --git a/arch/arm/plat-samsung/include/plat/usb-phy.h b/arch/arm/plat-samsung/include/plat/usb-phy.h
index 7a4a959..a57b8bb 100644
--- a/arch/arm/plat-samsung/include/plat/usb-phy.h
+++ b/arch/arm/plat-samsung/include/plat/usb-phy.h
@@ -19,5 +19,6 @@ enum s5p_usb_phy_type {
 extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
 extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
 extern void s5p_usb_phy_pmu_isolation(int on, int type);
+extern void s5p_usb_phy_cfg_sel(struct device *dev, int type);
 
 #endif /* __PLAT_SAMSUNG_USB_PHY_H */
diff --git a/include/linux/platform_data/samsung-usbphy.h b/include/linux/platform_data/samsung-usbphy.h
index 364a38a..2b400e0 100644
--- a/include/linux/platform_data/samsung-usbphy.h
+++ b/include/linux/platform_data/samsung-usbphy.h
@@ -25,6 +25,7 @@ enum phy_type {
 
 struct samsung_usbphy_data {
 	void (*pmu_isolation)(int on, int phy_type);
+	void (*phy_cfg_sel)(struct device *dev, int phy_type);
 	int type;
 };
 
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 3/4] USB: ehci-s5p: Add phy driver support
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2012-10-29 13:42   ` [PATCH v3 1/4] usb: phy: samsung: Add host phy support to samsung-phy driver Vivek Gautam
@ 2012-10-29 13:42   ` Vivek Gautam
  2012-10-29 13:42   ` [PATCH v3 4/4] USB: ohci-exynos: " Vivek Gautam
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-10-29 13:42 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, balbi-l0cyMroinI0,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

Adding the transceiver to ehci driver. Keeping the platform data
for continuing the smooth operation for boards which still uses it

Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Acked-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---

No change since v2.

 drivers/usb/host/ehci-s5p.c |   65 +++++++++++++++++++++++++++++-------------
 1 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index abc178d..e0a99af 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/of_gpio.h>
 #include <linux/platform_data/usb-ehci-s5p.h>
+#include <linux/usb/phy.h>
 #include <plat/usb-phy.h>
 
 #define EHCI_INSNREG00(base)			(base + 0x90)
@@ -32,6 +33,8 @@ struct s5p_ehci_hcd {
 	struct device *dev;
 	struct usb_hcd *hcd;
 	struct clk *clk;
+	struct usb_phy *phy;
+	struct s5p_ehci_platdata *pdata;
 };
 
 static const struct hc_driver s5p_ehci_hc_driver = {
@@ -65,6 +68,26 @@ static const struct hc_driver s5p_ehci_hc_driver = {
 	.clear_tt_buffer_complete	= ehci_clear_tt_buffer_complete,
 };
 
+static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci)
+{
+	struct platform_device *pdev = to_platform_device(s5p_ehci->dev);
+
+	if (s5p_ehci->phy)
+		usb_phy_init(s5p_ehci->phy);
+	else if (s5p_ehci->pdata->phy_init)
+		s5p_ehci->pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+}
+
+static void s5p_ehci_phy_disable(struct s5p_ehci_hcd *s5p_ehci)
+{
+	struct platform_device *pdev = to_platform_device(s5p_ehci->dev);
+
+	if (s5p_ehci->phy)
+		usb_phy_shutdown(s5p_ehci->phy);
+	else if (s5p_ehci->pdata->phy_exit)
+		s5p_ehci->pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+}
+
 static void s5p_setup_vbus_gpio(struct platform_device *pdev)
 {
 	int err;
@@ -92,15 +115,10 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
 	struct usb_hcd *hcd;
 	struct ehci_hcd *ehci;
 	struct resource *res;
+	struct usb_phy *phy;
 	int irq;
 	int err;
 
-	pdata = pdev->dev.platform_data;
-	if (!pdata) {
-		dev_err(&pdev->dev, "No platform data defined\n");
-		return -EINVAL;
-	}
-
 	/*
 	 * Right now device-tree probed devices don't get dma_mask set.
 	 * Since shared usb code relies on it, set it here for now.
@@ -118,6 +136,20 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
 	if (!s5p_ehci)
 		return -ENOMEM;
 
+	pdata = pdev->dev.platform_data;
+	if (!pdata) {
+		/* Fallback to Phy transceiver */
+		phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
+		if (IS_ERR_OR_NULL(phy)) {
+			dev_err(&pdev->dev, "no platform data or transceiver defined\n");
+			return -EPROBE_DEFER;
+		} else {
+			s5p_ehci->phy = phy;
+		}
+	} else {
+		s5p_ehci->pdata = pdata;
+	}
+
 	s5p_ehci->dev = &pdev->dev;
 
 	hcd = usb_create_hcd(&s5p_ehci_hc_driver, &pdev->dev,
@@ -163,8 +195,7 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
 		goto fail_io;
 	}
 
-	if (pdata->phy_init)
-		pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+	s5p_ehci_phy_enable(s5p_ehci);
 
 	ehci = hcd_to_ehci(hcd);
 	ehci->caps = hcd->regs;
@@ -175,13 +206,15 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
 	err = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to add USB HCD\n");
-		goto fail_io;
+		goto fail_add_hcd;
 	}
 
 	platform_set_drvdata(pdev, s5p_ehci);
 
 	return 0;
 
+fail_add_hcd:
+	s5p_ehci_phy_disable(s5p_ehci);
 fail_io:
 	clk_disable_unprepare(s5p_ehci->clk);
 fail_clk:
@@ -191,14 +224,12 @@ fail_clk:
 
 static int __devexit s5p_ehci_remove(struct platform_device *pdev)
 {
-	struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
 	struct s5p_ehci_hcd *s5p_ehci = platform_get_drvdata(pdev);
 	struct usb_hcd *hcd = s5p_ehci->hcd;
 
 	usb_remove_hcd(hcd);
 
-	if (pdata && pdata->phy_exit)
-		pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+	s5p_ehci_phy_disable(s5p_ehci);
 
 	clk_disable_unprepare(s5p_ehci->clk);
 
@@ -222,14 +253,11 @@ static int s5p_ehci_suspend(struct device *dev)
 	struct s5p_ehci_hcd *s5p_ehci = dev_get_drvdata(dev);
 	struct usb_hcd *hcd = s5p_ehci->hcd;
 	bool do_wakeup = device_may_wakeup(dev);
-	struct platform_device *pdev = to_platform_device(dev);
-	struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
 	int rc;
 
 	rc = ehci_suspend(hcd, do_wakeup);
 
-	if (pdata && pdata->phy_exit)
-		pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+	s5p_ehci_phy_disable(s5p_ehci);
 
 	clk_disable_unprepare(s5p_ehci->clk);
 
@@ -240,13 +268,10 @@ static int s5p_ehci_resume(struct device *dev)
 {
 	struct s5p_ehci_hcd *s5p_ehci = dev_get_drvdata(dev);
 	struct usb_hcd *hcd = s5p_ehci->hcd;
-	struct platform_device *pdev = to_platform_device(dev);
-	struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
 
 	clk_prepare_enable(s5p_ehci->clk);
 
-	if (pdata && pdata->phy_init)
-		pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+	s5p_ehci_phy_enable(s5p_ehci);
 
 	/* DMA burst Enable */
 	writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 4/4] USB: ohci-exynos: Add phy driver support
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2012-10-29 13:42   ` [PATCH v3 1/4] usb: phy: samsung: Add host phy support to samsung-phy driver Vivek Gautam
  2012-10-29 13:42   ` [PATCH v3 3/4] USB: ehci-s5p: Add phy driver support Vivek Gautam
@ 2012-10-29 13:42   ` Vivek Gautam
  2012-10-31 14:07   ` [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250 Felipe Balbi
  2012-11-06 13:14   ` Felipe Balbi
  4 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-10-29 13:42 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, balbi-l0cyMroinI0,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

Adding the transceiver to ohci driver. Keeping the platform data
for continuing the smooth operation for boards which still uses it

Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Acked-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---

No change since v2.

 drivers/usb/host/ohci-exynos.c |   65 +++++++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 2f30329..c98dd96 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -15,14 +15,37 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/usb-exynos.h>
+#include <linux/usb/phy.h>
 #include <plat/usb-phy.h>
 
 struct exynos_ohci_hcd {
 	struct device *dev;
 	struct usb_hcd *hcd;
 	struct clk *clk;
+	struct usb_phy *phy;
+	struct exynos4_ohci_platdata *pdata;
 };
 
+static void exynos_ohci_phy_enable(struct exynos_ohci_hcd *exynos_ohci)
+{
+	struct platform_device *pdev = to_platform_device(exynos_ohci->dev);
+
+	if (exynos_ohci->phy)
+		usb_phy_init(exynos_ohci->phy);
+	else if (exynos_ohci->pdata->phy_init)
+		exynos_ohci->pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+}
+
+static void exynos_ohci_phy_disable(struct exynos_ohci_hcd *exynos_ohci)
+{
+	struct platform_device *pdev = to_platform_device(exynos_ohci->dev);
+
+	if (exynos_ohci->phy)
+		usb_phy_shutdown(exynos_ohci->phy);
+	else if (exynos_ohci->pdata->phy_exit)
+		exynos_ohci->pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+}
+
 static int ohci_exynos_start(struct usb_hcd *hcd)
 {
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
@@ -81,15 +104,10 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
 	struct usb_hcd *hcd;
 	struct ohci_hcd *ohci;
 	struct resource *res;
+	struct usb_phy *phy;
 	int irq;
 	int err;
 
-	pdata = pdev->dev.platform_data;
-	if (!pdata) {
-		dev_err(&pdev->dev, "No platform data defined\n");
-		return -EINVAL;
-	}
-
 	/*
 	 * Right now device-tree probed devices don't get dma_mask set.
 	 * Since shared usb code relies on it, set it here for now.
@@ -105,6 +123,20 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
 	if (!exynos_ohci)
 		return -ENOMEM;
 
+	pdata = pdev->dev.platform_data;
+	if (!pdata) {
+		/* Fallback to Phy transceiver */
+		phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
+		if (IS_ERR_OR_NULL(phy)) {
+			dev_err(&pdev->dev, "no platform data or transceiver defined\n");
+			return -EPROBE_DEFER;
+		} else {
+			exynos_ohci->phy = phy;
+		}
+	} else {
+		exynos_ohci->pdata = pdata;
+	}
+
 	exynos_ohci->dev = &pdev->dev;
 
 	hcd = usb_create_hcd(&exynos_ohci_hc_driver, &pdev->dev,
@@ -150,8 +182,7 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
 		goto fail_io;
 	}
 
-	if (pdata->phy_init)
-		pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+	exynos_ohci_phy_enable(exynos_ohci);
 
 	ohci = hcd_to_ohci(hcd);
 	ohci_hcd_init(ohci);
@@ -159,13 +190,15 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
 	err = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to add USB HCD\n");
-		goto fail_io;
+		goto fail_add_hcd;
 	}
 
 	platform_set_drvdata(pdev, exynos_ohci);
 
 	return 0;
 
+fail_add_hcd:
+	exynos_ohci_phy_disable(exynos_ohci);
 fail_io:
 	clk_disable_unprepare(exynos_ohci->clk);
 fail_clk:
@@ -175,14 +208,12 @@ fail_clk:
 
 static int __devexit exynos_ohci_remove(struct platform_device *pdev)
 {
-	struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);
 	struct usb_hcd *hcd = exynos_ohci->hcd;
 
 	usb_remove_hcd(hcd);
 
-	if (pdata && pdata->phy_exit)
-		pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+	exynos_ohci_phy_disable(exynos_ohci);
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
@@ -206,8 +237,6 @@ static int exynos_ohci_suspend(struct device *dev)
 	struct exynos_ohci_hcd *exynos_ohci = dev_get_drvdata(dev);
 	struct usb_hcd *hcd = exynos_ohci->hcd;
 	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-	struct platform_device *pdev = to_platform_device(dev);
-	struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
 	unsigned long flags;
 	int rc = 0;
 
@@ -226,8 +255,7 @@ static int exynos_ohci_suspend(struct device *dev)
 
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 
-	if (pdata && pdata->phy_exit)
-		pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
+	exynos_ohci_phy_disable(exynos_ohci);
 
 	clk_disable_unprepare(exynos_ohci->clk);
 
@@ -241,13 +269,10 @@ static int exynos_ohci_resume(struct device *dev)
 {
 	struct exynos_ohci_hcd *exynos_ohci = dev_get_drvdata(dev);
 	struct usb_hcd *hcd = exynos_ohci->hcd;
-	struct platform_device *pdev = to_platform_device(dev);
-	struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
 
 	clk_prepare_enable(exynos_ohci->clk);
 
-	if (pdata && pdata->phy_init)
-		pdata->phy_init(pdev, S5P_USB_PHY_HOST);
+	exynos_ohci_phy_enable(exynos_ohci);
 
 	ohci_resume(hcd, false);
 
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-10-29 13:42   ` [PATCH v3 4/4] USB: ohci-exynos: " Vivek Gautam
@ 2012-10-31 14:07   ` Felipe Balbi
       [not found]     ` <20121031140723.GF10998-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  2012-11-06 13:14   ` Felipe Balbi
  4 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2012-10-31 14:07 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, balbi-l0cyMroinI0,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]

Hi,

On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
> This patchset is based on the work by Praveen Paneri for
> samsung-usbphy driver:
> http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
> 
> Changes from v2:
>  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
>    PHY SFRs for register definitions
>  - Using register names with bit macros to make things more clear.
>  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
>    in [patch 2/4 v2].
> 
> Tested on smdk5250 target with usb-next branch along with arch patches
> for exynos5250:
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
> 
> Vivek Gautam (4):
>   usb: phy: samsung: Add host phy support to samsung-phy driver
>   ARM: Exynos5250: Enabling samsung-usbphy driver
>   USB: ehci-s5p: Add phy driver support
>   USB: ohci-exynos: Add phy driver support

you should join forces with Praveen Paneri so you guys have a single PHY
code.

(I haven't fully read your patches, so apologize if what I'm saying is
already taken care of)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
       [not found]     ` <20121031140723.GF10998-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2012-10-31 14:27       ` Felipe Balbi
  0 siblings, 0 replies; 11+ messages in thread
From: Felipe Balbi @ 2012-10-31 14:27 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Vivek Gautam, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

Hi,

On Wed, Oct 31, 2012 at 04:07:23PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
> > This patchset is based on the work by Praveen Paneri for
> > samsung-usbphy driver:
> > http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
> > 
> > Changes from v2:
> >  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
> >    PHY SFRs for register definitions
> >  - Using register names with bit macros to make things more clear.
> >  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
> >    in [patch 2/4 v2].
> > 
> > Tested on smdk5250 target with usb-next branch along with arch patches
> > for exynos5250:
> > http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
> > http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
> > 
> > Vivek Gautam (4):
> >   usb: phy: samsung: Add host phy support to samsung-phy driver
> >   ARM: Exynos5250: Enabling samsung-usbphy driver
> >   USB: ehci-s5p: Add phy driver support
> >   USB: ohci-exynos: Add phy driver support
> 
> you should join forces with Praveen Paneri so you guys have a single PHY
> code.
> 
> (I haven't fully read your patches, so apologize if what I'm saying is
> already taken care of)

nevermind this comment, now I read more carefully :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
       [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
                     ` (3 preceding siblings ...)
  2012-10-31 14:07   ` [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250 Felipe Balbi
@ 2012-11-06 13:14   ` Felipe Balbi
  2012-11-06 13:53     ` Vivek Gautam
  4 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2012-11-06 13:14 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, balbi-l0cyMroinI0,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	thomas.abraham-QSEj5FYQhm4dnm+yROfE0A, kishon-l0cyMroinI0,
	p.paneri-Sze3O3UU22JBDgjK7y7TUQ

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]

Hi,

On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
> This patchset is based on the work by Praveen Paneri for
> samsung-usbphy driver:
> http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
> 
> Changes from v2:
>  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
>    PHY SFRs for register definitions
>  - Using register names with bit macros to make things more clear.
>  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
>    in [patch 2/4 v2].
> 
> Tested on smdk5250 target with usb-next branch along with arch patches
> for exynos5250:
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
> 
> Vivek Gautam (4):
>   usb: phy: samsung: Add host phy support to samsung-phy driver
>   ARM: Exynos5250: Enabling samsung-usbphy driver
>   USB: ehci-s5p: Add phy driver support
>   USB: ohci-exynos: Add phy driver support

I really don't know what to do with this series. I know it depends on
the other PHY changes which I have in my queue, but it touches too much
arch specific code, plus the USB Host code which I don't maintain.

On top of all that, I have no platform to test these patches, which
makes me even more worried about signing off under this series ;-)

Would it be ok if we delay this to v3.9 ? At least the dependency with
other PHY changes would be dropped by then.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
  2012-11-06 13:14   ` Felipe Balbi
@ 2012-11-06 13:53     ` Vivek Gautam
  2012-11-06 16:39       ` Felipe Balbi
  0 siblings, 1 reply; 11+ messages in thread
From: Vivek Gautam @ 2012-11-06 13:53 UTC (permalink / raw)
  To: balbi
  Cc: Vivek Gautam, linux-usb, linux-samsung-soc, devicetree-discuss,
	gregkh, stern, rob.herring, kgene.kim, jg1.han, yulgon.kim,
	thomas.abraham, kishon, p.paneri

Hi Balbi,


On Tue, Nov 6, 2012 at 6:44 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
>> This patchset is based on the work by Praveen Paneri for
>> samsung-usbphy driver:
>> http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
>>
>> Changes from v2:
>>  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
>>    PHY SFRs for register definitions
>>  - Using register names with bit macros to make things more clear.
>>  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
>>    in [patch 2/4 v2].
>>
>> Tested on smdk5250 target with usb-next branch along with arch patches
>> for exynos5250:
>> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
>> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
>>
>> Vivek Gautam (4):
>>   usb: phy: samsung: Add host phy support to samsung-phy driver
>>   ARM: Exynos5250: Enabling samsung-usbphy driver
>>   USB: ehci-s5p: Add phy driver support
>>   USB: ohci-exynos: Add phy driver support
>
> I really don't know what to do with this series. I know it depends on
> the other PHY changes which I have in my queue, but it touches too much
> arch specific code, plus the USB Host code which I don't maintain.
>

True, that it has dependency on the work by Praveen Paneri for samsung-usbphy
driver plus the arch support patches.

This is based on usb-next branch, so the host-code can be taken care of ?

> On top of all that, I have no platform to test these patches, which
> makes me even more worried about signing off under this series ;-)
>
The patches have however been tested. The two patches:
"USB: ehci-s5p: Add phy driver support",
"USB: ohci-exynos: Add phy driver support" have been acked by Jingoo Han
based on the patch-series.

Possibly Kukjin Kim can help on this one.

Kukjin,
Can we have a thought on this please.

> Would it be ok if we delay this to v3.9 ? At least the dependency with
> other PHY changes would be dropped by then.
>
This changes are almost in shape ;-) and i am updating the next patchset soon.
If possible can we try to get this in 3.8 please. :-)

> --
> balbi


-- 
Thanks & Regards
Vivek

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
  2012-11-06 13:53     ` Vivek Gautam
@ 2012-11-06 16:39       ` Felipe Balbi
       [not found]         ` <20121106163920.GC3993-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2012-11-06 16:39 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: balbi, Vivek Gautam, linux-usb, linux-samsung-soc,
	devicetree-discuss, gregkh, stern, rob.herring, kgene.kim,
	jg1.han, yulgon.kim, thomas.abraham, kishon, p.paneri

[-- Attachment #1: Type: text/plain, Size: 2727 bytes --]

Hi,

On Tue, Nov 06, 2012 at 07:23:12PM +0530, Vivek Gautam wrote:
> Hi Balbi,
> 
> 
> On Tue, Nov 6, 2012 at 6:44 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
> >> This patchset is based on the work by Praveen Paneri for
> >> samsung-usbphy driver:
> >> http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
> >>
> >> Changes from v2:
> >>  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
> >>    PHY SFRs for register definitions
> >>  - Using register names with bit macros to make things more clear.
> >>  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
> >>    in [patch 2/4 v2].
> >>
> >> Tested on smdk5250 target with usb-next branch along with arch patches
> >> for exynos5250:
> >> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
> >> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
> >>
> >> Vivek Gautam (4):
> >>   usb: phy: samsung: Add host phy support to samsung-phy driver
> >>   ARM: Exynos5250: Enabling samsung-usbphy driver
> >>   USB: ehci-s5p: Add phy driver support
> >>   USB: ohci-exynos: Add phy driver support
> >
> > I really don't know what to do with this series. I know it depends on
> > the other PHY changes which I have in my queue, but it touches too much
> > arch specific code, plus the USB Host code which I don't maintain.
> >
> 
> True, that it has dependency on the work by Praveen Paneri for samsung-usbphy
> driver plus the arch support patches.
> 
> This is based on usb-next branch, so the host-code can be taken care of ?
> 
> > On top of all that, I have no platform to test these patches, which
> > makes me even more worried about signing off under this series ;-)
> >
> The patches have however been tested. The two patches:
> "USB: ehci-s5p: Add phy driver support",
> "USB: ohci-exynos: Add phy driver support" have been acked by Jingoo Han
> based on the patch-series.
> 
> Possibly Kukjin Kim can help on this one.
> 
> Kukjin,
> Can we have a thought on this please.
> 
> > Would it be ok if we delay this to v3.9 ? At least the dependency with
> > other PHY changes would be dropped by then.
> >
> This changes are almost in shape ;-) and i am updating the next patchset soon.
> If possible can we try to get this in 3.8 please. :-)

we can try, but I'd like to minimize the amount of code outside of
drivers/usb/ I take in my tree. If there's any way to split the series
so it makes my life easier, I'd be really glad.

Also, I can't apply arch/* patches without proper Acked-bys, so Kukjin
would need to help us out there too :-)

cheers

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250
       [not found]         ` <20121106163920.GC3993-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2012-11-07  9:36           ` Vivek Gautam
  0 siblings, 0 replies; 11+ messages in thread
From: Vivek Gautam @ 2012-11-07  9:36 UTC (permalink / raw)
  To: balbi-l0cyMroinI0
  Cc: Jingoo Han, yulgon.kim-Sze3O3UU22JBDgjK7y7TUQ,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Praveen Paneri,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Rob Herring, kishon,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, Vivek Gautam


[-- Attachment #1.1: Type: text/plain, Size: 3770 bytes --]

Hi,


On Tue, Nov 6, 2012 at 10:09 PM, Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> wrote:

> Hi,
>
> On Tue, Nov 06, 2012 at 07:23:12PM +0530, Vivek Gautam wrote:
> > Hi Balbi,
> >
> >
> > On Tue, Nov 6, 2012 at 6:44 PM, Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> wrote:
> > > Hi,
> > >
> > > On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
> > >> This patchset is based on the work by Praveen Paneri for
> > >> samsung-usbphy driver:
> > >> http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
> > >>
> > >> Changes from v2:
> > >>  - Using "EXYNOS5_PHY_" as common prefix along with exact names for
> > >>    PHY SFRs for register definitions
> > >>  - Using register names with bit macros to make things more clear.
> > >>  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
> > >>    in [patch 2/4 v2].
> > >>
> > >> Tested on smdk5250 target with usb-next branch along with arch patches
> > >> for exynos5250:
> > >> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
> > >> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
> > >>
> > >> Vivek Gautam (4):
> > >>   usb: phy: samsung: Add host phy support to samsung-phy driver
> > >>   ARM: Exynos5250: Enabling samsung-usbphy driver
> > >>   USB: ehci-s5p: Add phy driver support
> > >>   USB: ohci-exynos: Add phy driver support
> > >
> > > I really don't know what to do with this series. I know it depends on
> > > the other PHY changes which I have in my queue, but it touches too much
> > > arch specific code, plus the USB Host code which I don't maintain.
> > >
> >
> > True, that it has dependency on the work by Praveen Paneri for
> samsung-usbphy
> > driver plus the arch support patches.
> >
> > This is based on usb-next branch, so the host-code can be taken care of ?
> >
> > > On top of all that, I have no platform to test these patches, which
> > > makes me even more worried about signing off under this series ;-)
> > >
> > The patches have however been tested. The two patches:
> > "USB: ehci-s5p: Add phy driver support",
> > "USB: ohci-exynos: Add phy driver support" have been acked by Jingoo Han
> > based on the patch-series.
> >
> > Possibly Kukjin Kim can help on this one.
> >
> > Kukjin,
> > Can we have a thought on this please.
> >
> > > Would it be ok if we delay this to v3.9 ? At least the dependency with
> > > other PHY changes would be dropped by then.
> > >
> > This changes are almost in shape ;-) and i am updating the next patchset
> soon.
> > If possible can we try to get this in 3.8 please. :-)
>
> we can try, but I'd like to minimize the amount of code outside of
> drivers/usb/ I take in my tree. If there's any way to split the series
> so it makes my life easier, I'd be really glad.
>

Thanks for this.
I have submitted v4 patch-set in this series:
http://www.spinics.net/lists/linux-usb/msg73977.html
This again contains some arch changes. I can minimize the arch support as
far as possible.
Possibly i can put up following changes further in v4.
 - Remove arch changes from [PATCH v4 1/5] ARM: EXYNOS: Update & move
usb-phy types to generic include layer

Small arch changes in [PATCH 2/5] usb: phy: samsung: Add host phy support
to samsung-phy driver,
in the same series (i missed v4 suffix in this :-( comes as a result of
Praveen Paneri's patches
in the series http://www.spinics.net/lists/linux-usb/msg73518.html, to
prevent build-break.

Kukjin can help Ack-ing with [PATCH v4 3/5] ARM: Exynos5250: Enabling
samsung-usbphy driver, since
this is machine specific patch.

Will this be fine ? Please suggest.


> Also, I can't apply arch/* patches without proper Acked-bys, so Kukjin
> would need to help us out there too :-)
>
> cheers
>
> --
> balbi
>



-- 
Thanks & Regards
Vivek

[-- Attachment #1.2: Type: text/html, Size: 5478 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-07  9:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 13:42 [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250 Vivek Gautam
2012-10-29 13:42 ` [PATCH v3 2/4] ARM: Exynos5250: Enabling samsung-usbphy driver Vivek Gautam
     [not found] ` <1351518160-22369-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-10-29 13:42   ` [PATCH v3 1/4] usb: phy: samsung: Add host phy support to samsung-phy driver Vivek Gautam
2012-10-29 13:42   ` [PATCH v3 3/4] USB: ehci-s5p: Add phy driver support Vivek Gautam
2012-10-29 13:42   ` [PATCH v3 4/4] USB: ohci-exynos: " Vivek Gautam
2012-10-31 14:07   ` [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250 Felipe Balbi
     [not found]     ` <20121031140723.GF10998-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-31 14:27       ` Felipe Balbi
2012-11-06 13:14   ` Felipe Balbi
2012-11-06 13:53     ` Vivek Gautam
2012-11-06 16:39       ` Felipe Balbi
     [not found]         ` <20121106163920.GC3993-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-11-07  9:36           ` Vivek Gautam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).