Re: [PATCH v4 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
On Fri, Aug 10, 2012 at 12:49 PM, ABRAHAM, KISHON VIJAY wrote: > Hi, > > On Fri, Aug 10, 2012 at 12:40 PM, Praveen Paneri wrote: >> This driver uses usb_phy interface to interact with s3c-hsotg. Supports >> phy_init and phy_shutdown functions to enable/disable phy. Tested with >> smdk6410 and smdkv310. More SoCs can be brought under later. >> >> Signed-off-by: Praveen Paneri >> Acked-by: Heiko Stuebner >> --- >> .../devicetree/bindings/usb/samsung-usbphy.txt |9 + >> drivers/usb/phy/Kconfig|8 + >> drivers/usb/phy/Makefile |1 + >> drivers/usb/phy/samsung-usbphy.c | 345 >> >> drivers/usb/phy/samsung-usbphy.h | 48 +++ >> include/linux/platform_data/samsung-usbphy.h | 27 ++ >> 6 files changed, 438 insertions(+), 0 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> create mode 100644 drivers/usb/phy/samsung-usbphy.c >> create mode 100644 drivers/usb/phy/samsung-usbphy.h >> create mode 100644 include/linux/platform_data/samsung-usbphy.h >> >> diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> new file mode 100644 >> index 000..fefd9c8 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> @@ -0,0 +1,9 @@ >> +* Samsung's usb phy transceiver >> + >> +The Samsung's phy transceiver is used for controlling usb otg phy for >> +s3c-hsotg usb device controller. >> + >> +Required properties: >> +- compatible : should be "samsung,exynos4210-usbphy" >> +- reg : base physical address of the phy registers and length of memory >> mapped >> + region. >> diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig >> index e7cf84f..d916477 100644 >> --- a/drivers/usb/phy/Kconfig >> +++ b/drivers/usb/phy/Kconfig >> @@ -15,3 +15,11 @@ config USB_ISP1301 >> >> To compile this driver as a module, choose M here: the >> module will be called isp1301. >> + >> +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 >> + SoCs. >> diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile >> index eca095b..dfca70d 100644 >> --- a/drivers/usb/phy/Makefile >> +++ b/drivers/usb/phy/Makefile >> @@ -5,3 +5,4 @@ >> ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG >> >> obj-$(CONFIG_USB_ISP1301) += isp1301.o >> +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o >> diff --git a/drivers/usb/phy/samsung-usbphy.c >> b/drivers/usb/phy/samsung-usbphy.c >> new file mode 100644 >> index 000..739b6c9 >> --- /dev/null >> +++ b/drivers/usb/phy/samsung-usbphy.c >> @@ -0,0 +1,345 @@ >> +/* linux/drivers/usb/phy/samsung-usbphy.c >> + * >> + * Copyright (c) 2012 Samsung Electronics Co., Ltd. >> + * http://www.samsung.com >> + * >> + * Author: Praveen Paneri >> + * >> + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + * >> + * You should have received a copy of the GNU General Public License >> + * along with this program; if not, write to the Free Software >> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > > I suggest you drop that last paragraph unless you want to keep track > of Free Software Foundation office. Right now it is 51 Franklin > Street, Boston (http://www.fsf.org/about/contact/) :-) Yeah! it can be dropped :-) Praveen > > -Kishon > -- > To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" > in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
Hi, On Fri, Aug 10, 2012 at 12:40 PM, Praveen Paneri wrote: > This driver uses usb_phy interface to interact with s3c-hsotg. Supports > phy_init and phy_shutdown functions to enable/disable phy. Tested with > smdk6410 and smdkv310. More SoCs can be brought under later. > > Signed-off-by: Praveen Paneri > Acked-by: Heiko Stuebner > --- > .../devicetree/bindings/usb/samsung-usbphy.txt |9 + > drivers/usb/phy/Kconfig|8 + > drivers/usb/phy/Makefile |1 + > drivers/usb/phy/samsung-usbphy.c | 345 > > drivers/usb/phy/samsung-usbphy.h | 48 +++ > include/linux/platform_data/samsung-usbphy.h | 27 ++ > 6 files changed, 438 insertions(+), 0 deletions(-) > create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt > create mode 100644 drivers/usb/phy/samsung-usbphy.c > create mode 100644 drivers/usb/phy/samsung-usbphy.h > create mode 100644 include/linux/platform_data/samsung-usbphy.h > > diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > new file mode 100644 > index 000..fefd9c8 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > @@ -0,0 +1,9 @@ > +* Samsung's usb phy transceiver > + > +The Samsung's phy transceiver is used for controlling usb otg phy for > +s3c-hsotg usb device controller. > + > +Required properties: > +- compatible : should be "samsung,exynos4210-usbphy" > +- reg : base physical address of the phy registers and length of memory > mapped > + region. > diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig > index e7cf84f..d916477 100644 > --- a/drivers/usb/phy/Kconfig > +++ b/drivers/usb/phy/Kconfig > @@ -15,3 +15,11 @@ config USB_ISP1301 > > To compile this driver as a module, choose M here: the > module will be called isp1301. > + > +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 > + SoCs. > diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile > index eca095b..dfca70d 100644 > --- a/drivers/usb/phy/Makefile > +++ b/drivers/usb/phy/Makefile > @@ -5,3 +5,4 @@ > ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG > > obj-$(CONFIG_USB_ISP1301) += isp1301.o > +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o > diff --git a/drivers/usb/phy/samsung-usbphy.c > b/drivers/usb/phy/samsung-usbphy.c > new file mode 100644 > index 000..739b6c9 > --- /dev/null > +++ b/drivers/usb/phy/samsung-usbphy.c > @@ -0,0 +1,345 @@ > +/* linux/drivers/usb/phy/samsung-usbphy.c > + * > + * Copyright (c) 2012 Samsung Electronics Co., Ltd. > + * http://www.samsung.com > + * > + * Author: Praveen Paneri > + * > + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. I suggest you drop that last paragraph unless you want to keep track of Free Software Foundation office. Right now it is 51 Franklin Street, Boston (http://www.fsf.org/about/contact/) :-) -Kishon -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
On Fri, Aug 10, 2012 at 12:34 PM, Felipe Balbi wrote: > Hi, > > On Fri, Aug 10, 2012 at 12:40:27PM +0530, Praveen Paneri wrote: >> This driver uses usb_phy interface to interact with s3c-hsotg. Supports >> phy_init and phy_shutdown functions to enable/disable phy. Tested with >> smdk6410 and smdkv310. More SoCs can be brought under later. >> >> Signed-off-by: Praveen Paneri >> Acked-by: Heiko Stuebner > > this looks good. Just 2 comments below. > >> --- >> .../devicetree/bindings/usb/samsung-usbphy.txt |9 + >> drivers/usb/phy/Kconfig|8 + >> drivers/usb/phy/Makefile |1 + >> drivers/usb/phy/samsung-usbphy.c | 345 >> >> drivers/usb/phy/samsung-usbphy.h | 48 +++ >> include/linux/platform_data/samsung-usbphy.h | 27 ++ >> 6 files changed, 438 insertions(+), 0 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> create mode 100644 drivers/usb/phy/samsung-usbphy.c >> create mode 100644 drivers/usb/phy/samsung-usbphy.h >> create mode 100644 include/linux/platform_data/samsung-usbphy.h >> >> diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> new file mode 100644 >> index 000..fefd9c8 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt >> @@ -0,0 +1,9 @@ >> +* Samsung's usb phy transceiver >> + >> +The Samsung's phy transceiver is used for controlling usb otg phy for >> +s3c-hsotg usb device controller. >> + >> +Required properties: >> +- compatible : should be "samsung,exynos4210-usbphy" >> +- reg : base physical address of the phy registers and length of memory >> mapped >> + region. >> diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig >> index e7cf84f..d916477 100644 >> --- a/drivers/usb/phy/Kconfig >> +++ b/drivers/usb/phy/Kconfig >> @@ -15,3 +15,11 @@ config USB_ISP1301 >> >> To compile this driver as a module, choose M here: the >> module will be called isp1301. >> + >> +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 >> + SoCs. >> diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile >> index eca095b..dfca70d 100644 >> --- a/drivers/usb/phy/Makefile >> +++ b/drivers/usb/phy/Makefile >> @@ -5,3 +5,4 @@ >> ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG >> >> obj-$(CONFIG_USB_ISP1301)+= isp1301.o >> +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o >> diff --git a/drivers/usb/phy/samsung-usbphy.c >> b/drivers/usb/phy/samsung-usbphy.c >> new file mode 100644 >> index 000..739b6c9 >> --- /dev/null >> +++ b/drivers/usb/phy/samsung-usbphy.c >> @@ -0,0 +1,345 @@ >> +/* linux/drivers/usb/phy/samsung-usbphy.c >> + * >> + * Copyright (c) 2012 Samsung Electronics Co., Ltd. >> + * http://www.samsung.com >> + * >> + * Author: Praveen Paneri >> + * >> + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + * >> + * You should have received a copy of the GNU General Public License >> + * along with this program; if not, write to the Free Software >> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >> +*/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include "samsung-usbphy.h" >> + >> +enum samsung_cpu_type { >> + TYPE_S3C64XX, >> + TYPE_EXYNOS4210, >> +}; >> + >> +/* >> + * struct samsung_usbphy - transceiver driver state >> + * @phy: transceiver structure >> + * @plat: platform data >> + * @dev: The parent device supplied to the probe function >> + * @clk: usb phy clock >> + * @regs: usb phy register memory base >> + * @cpu_type: machine identifier >> + */ >> +struct samsung_usbphy { >> + struct usb_phy phy; >> + struct samsung_usbphy_data *plat; >> + struct device *dev; >> + struct clk *clk; >> + void __iomem*regs; >> + int cpu_type; >> +}; >> + >> +#define phy_to_sphy(x) container_of((x), struct >> samsung_usbphy, phy) >> + >> +/* >> + * Enables or disables the phy clock >> + * returns 0 on success else the error >> + */ >> +static int samsung_usbphy_clk_control(struct samsung_usb
Re: [PATCH v4 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
Hi, On Fri, Aug 10, 2012 at 12:40:27PM +0530, Praveen Paneri wrote: > This driver uses usb_phy interface to interact with s3c-hsotg. Supports > phy_init and phy_shutdown functions to enable/disable phy. Tested with > smdk6410 and smdkv310. More SoCs can be brought under later. > > Signed-off-by: Praveen Paneri > Acked-by: Heiko Stuebner this looks good. Just 2 comments below. > --- > .../devicetree/bindings/usb/samsung-usbphy.txt |9 + > drivers/usb/phy/Kconfig|8 + > drivers/usb/phy/Makefile |1 + > drivers/usb/phy/samsung-usbphy.c | 345 > > drivers/usb/phy/samsung-usbphy.h | 48 +++ > include/linux/platform_data/samsung-usbphy.h | 27 ++ > 6 files changed, 438 insertions(+), 0 deletions(-) > create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt > create mode 100644 drivers/usb/phy/samsung-usbphy.c > create mode 100644 drivers/usb/phy/samsung-usbphy.h > create mode 100644 include/linux/platform_data/samsung-usbphy.h > > diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > new file mode 100644 > index 000..fefd9c8 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt > @@ -0,0 +1,9 @@ > +* Samsung's usb phy transceiver > + > +The Samsung's phy transceiver is used for controlling usb otg phy for > +s3c-hsotg usb device controller. > + > +Required properties: > +- compatible : should be "samsung,exynos4210-usbphy" > +- reg : base physical address of the phy registers and length of memory > mapped > + region. > diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig > index e7cf84f..d916477 100644 > --- a/drivers/usb/phy/Kconfig > +++ b/drivers/usb/phy/Kconfig > @@ -15,3 +15,11 @@ config USB_ISP1301 > > To compile this driver as a module, choose M here: the > module will be called isp1301. > + > +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 > + SoCs. > diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile > index eca095b..dfca70d 100644 > --- a/drivers/usb/phy/Makefile > +++ b/drivers/usb/phy/Makefile > @@ -5,3 +5,4 @@ > ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG > > obj-$(CONFIG_USB_ISP1301)+= isp1301.o > +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o > diff --git a/drivers/usb/phy/samsung-usbphy.c > b/drivers/usb/phy/samsung-usbphy.c > new file mode 100644 > index 000..739b6c9 > --- /dev/null > +++ b/drivers/usb/phy/samsung-usbphy.c > @@ -0,0 +1,345 @@ > +/* linux/drivers/usb/phy/samsung-usbphy.c > + * > + * Copyright (c) 2012 Samsung Electronics Co., Ltd. > + * http://www.samsung.com > + * > + * Author: Praveen Paneri > + * > + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > +*/ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "samsung-usbphy.h" > + > +enum samsung_cpu_type { > + TYPE_S3C64XX, > + TYPE_EXYNOS4210, > +}; > + > +/* > + * struct samsung_usbphy - transceiver driver state > + * @phy: transceiver structure > + * @plat: platform data > + * @dev: The parent device supplied to the probe function > + * @clk: usb phy clock > + * @regs: usb phy register memory base > + * @cpu_type: machine identifier > + */ > +struct samsung_usbphy { > + struct usb_phy phy; > + struct samsung_usbphy_data *plat; > + struct device *dev; > + struct clk *clk; > + void __iomem*regs; > + int cpu_type; > +}; > + > +#define phy_to_sphy(x) container_of((x), struct > samsung_usbphy, phy) > + > +/* > + * Enables or disables the phy clock > + * returns 0 on success else the error > + */ > +static int samsung_usbphy_clk_control(struct samsung_usbphy *sphy, bool on) > +{ > + if (on) { > + if (!sphy->clk) { > + sphy->clk = clk_get(sphy->dev, "otg"); > + if (IS_ERR(sphy->clk)) { > +
[PATCH v4 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. Signed-off-by: Praveen Paneri Acked-by: Heiko Stuebner --- .../devicetree/bindings/usb/samsung-usbphy.txt |9 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usbphy.c | 345 drivers/usb/phy/samsung-usbphy.h | 48 +++ include/linux/platform_data/samsung-usbphy.h | 27 ++ 6 files changed, 438 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/samsung-usbphy.c create mode 100644 drivers/usb/phy/samsung-usbphy.h create mode 100644 include/linux/platform_data/samsung-usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..fefd9c8 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,9 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. + +Required properties: +- compatible : should be "samsung,exynos4210-usbphy" +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index e7cf84f..d916477 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -15,3 +15,11 @@ config USB_ISP1301 To compile this driver as a module, choose M here: the module will be called isp1301. + +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 + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index eca095b..dfca70d 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -5,3 +5,4 @@ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG obj-$(CONFIG_USB_ISP1301) += isp1301.o +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c new file mode 100644 index 000..739b6c9 --- /dev/null +++ b/drivers/usb/phy/samsung-usbphy.c @@ -0,0 +1,345 @@ +/* linux/drivers/usb/phy/samsung-usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "samsung-usbphy.h" + +enum samsung_cpu_type { + TYPE_S3C64XX, + TYPE_EXYNOS4210, +}; + +/* + * struct samsung_usbphy - transceiver driver state + * @phy: transceiver structure + * @plat: platform data + * @dev: The parent device supplied to the probe function + * @clk: usb phy clock + * @regs: usb phy register memory base + * @cpu_type: machine identifier + */ +struct samsung_usbphy { + struct usb_phy phy; + struct samsung_usbphy_data *plat; + struct device *dev; + struct clk *clk; + void __iomem*regs; + int cpu_type; +}; + +#define phy_to_sphy(x) container_of((x), struct samsung_usbphy, phy) + +/* + * Enables or disables the phy clock + * returns 0 on success else the error + */ +static int samsung_usbphy_clk_control(struct samsung_usbphy *sphy, bool on) +{ + if (on) { + if (!sphy->clk) { + sphy->clk = clk_get(sphy->dev, "otg"); + if (IS_ERR(sphy->clk)) { + dev_err(sphy->dev, "Failed to get otg clock\n"); + return PTR_ERR(sphy->clk); + } + } + clk_enable(sphy->clk); + } else { + clk_disable(sphy->clk); + clk_put(sphy->clk); + } + + return 0; +} + +/* + * Returns refe