From patchwork Fri Nov 23 12:32:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: p.paneri@samsung.com X-Patchwork-Id: 1795291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D6784DF254 for ; Fri, 23 Nov 2012 12:28:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbsKi-0004vM-5z; Fri, 23 Nov 2012 12:26:12 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbsKa-0004sh-3x for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 12:26:08 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDX00CVSX771GR0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 21:26:03 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 24.82.01231.B5B6FA05; Fri, 23 Nov 2012 21:26:03 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-50-50af6b5bb96d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 03.82.01231.A5B6FA05; Fri, 23 Nov 2012 21:26:02 +0900 (KST) Received: from matrix.sisodomain.com ([107.108.73.199]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDX00FDOWXRAT40@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 21:26:02 +0900 (KST) From: Praveen Paneri To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v9 3/3] ARM: EXYNOS: Enabling samsung-usbphy driver for EXYNOS4210 Date: Fri, 23 Nov 2012 18:02:32 +0530 Message-id: <1353673952-13537-4-git-send-email-p.paneri@samsung.com> X-Mailer: git-send-email 1.7.1 In-reply-to: <1353673952-13537-1-git-send-email-p.paneri@samsung.com> References: <1353673952-13537-1-git-send-email-p.paneri@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsWyRsSkSjc6e32AwalmdotNj6+xOjB6bF5S H8AYxWWTkpqTWZZapG+XwJXxtv0ve8EGpYqPb6cwNzD2yHYxcnJICJhIzP6+lxnCFpO4cG89 WxcjF4eQwFJGiePnLrHAFK3bs4gJIjGdUWL57ofMEM4GJonn5x4CtXBwsAloSzTMNAJpEBFQ lfjctoAdpIZZ4BeTxL0PU9lBEsICIRLNpxezgtgsQEXXP7czgti8Ai4S7xZ/Y4PYJiexY/UT JhCbU8BV4tXk2WA1QkA1Mz+9ZYLoFZD4NvkQC8heCQFZiU0HwO6RELjOJtHxcSPU1ZISB1fc YJnAKLyAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRmAQnv73TGoH48oGi0OMAhyMSjy8 hmXrAoRYE8uKK3MPMUpwMCuJ8Jb7rQ8Q4k1JrKxKLcqPLyrNSS0+xOgDdMlEZinR5HxghOSV xBsam5ibGptaGhmZmZriEFYS5232SAkQEkhPLEnNTk0tSC2CGcfEwSnVwNiaIL7Zffvf/JzO 9lkl4q/b3odHLNg099oFk3XVOQFCequP8t63rY01s+SRWVn50vNM1LItBgLnqlJsfus7Ln1m mu/xPUx6X/n2qlNHUy9d+q4w2yPpxORyqwvnZrGe2W51eI/Gwkt/0p72TGw//zt2f9CeY0f8 T80vuB2qJTr90S/1ywLFk2OUWIozEg21mIuKEwFa8i3xbwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+xoG5U9voAg4lXTSw2Pb7G6sDosXlJ fQBjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jxtv2v+wFG5QqPr6dwtzA 2CPbxcjJISFgIrFuzyImCFtM4sK99WxdjFwcQgLTGSWW737IDOFsYJJ4fu4hUIaDg01AW6Jh phFIg4iAqsTntgXsIDXMAr+YJO59mMoOkhAWCJFoPr2YFcRmASq6/rmdEcTmFXCReLf4GxvE NjmJHaufgG3mFHCVeDV5NliNEFDNzE9vmSYw8i5gZFjFKJpakFxQnJSea6hXnJhbXJqXrpec n7uJERziz6R2MK5ssDjEKMDBqMTDa1i2LkCINbGsuDL3EKMEB7OSCG+53/oAId6UxMqq1KL8 +KLSnNTiQ4w+QFdNZJYSTc4Hxl9eSbyhsYm5qbGppYmFiZklDmElcd5mj5QAIYH0xJLU7NTU gtQimHFMHJxSDYzBr2+tVZ+ow6h7WnjN+elCEXqrF50Jvtlx/9oslRMi1Usq/LSYpWc1bpyX wNE2V+vTnU0mdj8e6AsoxYfrxlhbzcmTEeVIj53JueXqu9NG+/r3v1RecoFRxeUMk2nz7GdN mo+YJU2CPS+4m3Xczj/z1vT6x/M2fJ65LVduPPWNU15w9F9twWslluKMREMt5qLiRABePjk/ ngIAAA== X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121123_072604_705518_9ECD62CA X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: l.majewski@samsung.com, kgene.kim@samsung.com, heiko@sntech.de, gregkh@linuxfoundation.org, devicetree-discuss@lists.ozlabs.org, broonie@opensource.wolfsonmicro.com, balbi@ti.com, grant.likely@secretlab.ca, kyungmin.park@samsung.com, thomas.abraham@linaro.org, gautam.vivek@samsung.com, ben-linux@fluff.org, t.figa@samsung.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Adding usbphy node for Exynos4210 along with the platform data. Signed-off-by: Praveen Paneri --- arch/arm/boot/dts/exynos4210-smdkv310.dts | 5 +++++ arch/arm/mach-exynos/Kconfig | 1 + arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/mach-exynos4-dt.c | 8 ++++++++ arch/arm/mach-exynos/setup-usb-phy.c | 13 +++++++++++++ arch/arm/plat-samsung/include/plat/usb-phy.h | 1 + 6 files changed, 29 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts index 9b23a82..550903a 100644 --- a/arch/arm/boot/dts/exynos4210-smdkv310.dts +++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts @@ -59,6 +59,11 @@ status = "okay"; }; + usbphy@125B0000 { + compatible = "samsung,exynos4210-usbphy"; + reg = <0x125B0000 0x100>; + }; + keypad@100A0000 { samsung,keypad-num-rows = <2>; samsung,keypad-num-columns = <8>; diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 945ce49..e0d481f 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -419,6 +419,7 @@ config MACH_EXYNOS4_DT select PINCTRL select PINCTRL_EXYNOS4 select USE_OF + select EXYNOS4_SETUP_USB_PHY help Machine support for Samsung Exynos4 machine with device tree enabled. Select this if a fdt blob is available for the Exynos4 SoC based board. diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 1df6abb..556aced 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -246,6 +246,7 @@ #define S3C_PA_SPI1 EXYNOS4_PA_SPI1 #define S3C_PA_SPI2 EXYNOS4_PA_SPI2 #define S3C_PA_USB_HSOTG EXYNOS4_PA_HSOTG +#define S3C_PA_USB_PHY EXYNOS4_PA_HSPHY #define S5P_PA_EHCI EXYNOS4_PA_EHCI #define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 8858068..f7887e5 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -20,9 +21,14 @@ #include #include +#include #include "common.h" +static struct samsung_usbphy_data exynos4_usbphy_pdata = { + .pmu_isolation = s5p_usb_phy_pmu_isolation, +}; + /* * The following lookup table is used to override device names when devices * are registered from device tree. This is temporarily added to enable @@ -79,6 +85,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL), OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU, "exynos-tmu", NULL), + OF_DEV_AUXDATA("samsung,exynos4210-usbphy", EXYNOS4_PA_HSPHY, + "s3c-usbphy", &exynos4_usbphy_pdata), {}, }; diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index b81cc56..1c62d20 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c @@ -221,3 +221,16 @@ int s5p_usb_phy_exit(struct platform_device *pdev, int type) return -EINVAL; } + +void s5p_usb_phy_pmu_isolation(int on) +{ + 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); + } +} diff --git a/arch/arm/plat-samsung/include/plat/usb-phy.h b/arch/arm/plat-samsung/include/plat/usb-phy.h index 46b54bf..fafb0cc 100644 --- a/arch/arm/plat-samsung/include/plat/usb-phy.h +++ b/arch/arm/plat-samsung/include/plat/usb-phy.h @@ -20,5 +20,6 @@ enum s5p_usb_phy_type { extern struct samsung_usbphy_data s3c_usbphy_pdata; 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); #endif /* __PLAT_SAMSUNG_USB_PHY_H */