From patchwork Tue Jun 21 07:03:44 2011 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: 899882 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5L708kd020741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 21 Jun 2011 07:00:29 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QYuwD-0007V5-P4; Tue, 21 Jun 2011 06:59:54 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QYuwD-0007G6-Ao; Tue, 21 Jun 2011 06:59:53 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QYuvp-0007Bu-88 for linux-arm-kernel@lists.infradead.org; Tue, 21 Jun 2011 06:59:34 +0000 Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LN4005M3OQ03QH0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 21 Jun 2011 15:59:26 +0900 (KST) X-AuditID: cbfee61b-b7b2dae000007af9-c1-4e00414e3906 Received: from epmmp1 ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id F9.B6.31481.E41400E4; Tue, 21 Jun 2011 15:59:26 +0900 (KST) Received: from localhost.localdomain ([107.108.73.199]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LN40097UOQQD9@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 21 Jun 2011 15:59:26 +0900 (KST) Date: Tue, 21 Jun 2011 12:33:44 +0530 From: p.paneri@samsung.com Subject: [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung. In-reply-to: <1308639827-2121-1-git-send-email-p.paneri@samsung.com> To: linux-usb@vger.kernel.org Message-id: <1308639827-2121-3-git-send-email-p.paneri@samsung.com> X-Mailer: git-send-email 1.7.0.4 References: <1308639827-2121-1-git-send-email-p.paneri@samsung.com> X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110621_025929_565757_D6255E00 X-CRM114-Status: GOOD ( 17.80 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.24 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain Cc: kgene.kim@samsung.com, tmarri@apm.com, balbi@ti.com, naushad@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.ab@samsung.com, a.kesavan@samsung.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Jun 2011 07:00:29 +0000 (UTC) From: Praveen Paneri Adding dwc driver name in existing platform device to probe DWC OTG driver. Introduced otg_set_platdata function to pass platform data Added selectable config option to add DWC OTG driver for different machines. Signed-off-by: Praveen Paneri --- arch/arm/plat-samsung/Kconfig | 6 ++++++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-usb-hsotg.c | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 4d79519..58ed8b1 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -227,6 +227,12 @@ config S3C_DEV_USB_HSOTG help Compile in platform device definition for USB high-speed OtG +config S3C_DEV_DWC_OTG + bool + help + Compile in platform device definition for DWC OTG. This + will make it selectable for different machines. + config S3C_DEV_WDT bool default y if ARCH_S3C2410 diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 53eb15b..785ca79 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -49,6 +49,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-y += dev-uart.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o +obj-$(CONFIG_S3C_DEV_DWC_OTG) += dev-usb-hsotg.o obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c index 33a844a..7e6228b 100644 --- a/arch/arm/plat-samsung/dev-usb-hsotg.c +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c @@ -20,6 +20,8 @@ #include #include +#include +#include static struct resource s3c_usb_hsotg_resources[] = { [0] = { @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = { static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32); struct platform_device s3c_device_usb_hsotg = { +#ifdef CONFIG_S3C_DEV_USB_HSOTG .name = "s3c-hsotg", +#endif +#ifdef CONFIG_S3C_DEV_DWC_OTG + .name = "dwc_otg", +#endif .id = -1, .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources), .resource = s3c_usb_hsotg_resources, @@ -46,3 +53,16 @@ struct platform_device s3c_device_usb_hsotg = { .coherent_dma_mask = DMA_BIT_MASK(32), }, }; + +void __init s5p_otg_set_platdata(struct s5p_otg_platdata *pd) +{ + struct s5p_otg_platdata *npd; + + npd = s3c_set_platdata(pd, sizeof(struct s5p_otg_platdata), + &s3c_device_usb_hsotg); + + if (!npd->phy_init) + npd->phy_init = s5p_usb_phy_init; + if (!npd->phy_exit) + npd->phy_exit = s5p_usb_phy_exit; +}