From patchwork Tue Jan 15 08:42:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 1975951 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 E6881DF23A for ; Tue, 15 Jan 2013 08:48:33 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tv28b-0001sh-Cg; Tue, 15 Jan 2013 08:44:55 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tv27H-0001TV-E1 for linux-arm-kernel@lists.infradead.org; Tue, 15 Jan 2013 08:43:31 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0F8hI99014825; Tue, 15 Jan 2013 02:43:19 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0F8hBrb023741; Tue, 15 Jan 2013 14:13:18 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Tue, 15 Jan 2013 14:13:11 +0530 Received: from a0393678lt.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0F8h1uN008885; Tue, 15 Jan 2013 14:13:11 +0530 From: Kishon Vijay Abraham I To: , , , , , , , , , , , , , Subject: [RFC PATCH 2/7] ARM: OMAP: devices: create device for usb part of control module Date: Tue, 15 Jan 2013 14:12:53 +0530 Message-ID: <1358239378-10030-3-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358239378-10030-1-git-send-email-kishon@ti.com> References: <1358239378-10030-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130115_034331_609720_009DB40C X-CRM114-Status: GOOD ( 16.57 ) X-Spam-Score: -4.6 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender 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: Kishon Vijay Abraham I 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org A seperate driver has been added to handle the usb part of control module. A device for the above driver is created here, using the register address information to be used by the driver for powering on the PHY and for writing to the mailbox. Signed-off-by: Kishon Vijay Abraham I --- arch/arm/mach-omap2/devices.c | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 5e304d0..a761faf4 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -254,6 +255,54 @@ static inline void omap_init_camera(void) #endif } +#if (defined(CONFIG_OMAP_CONTROL_USB) || \ + defined(CONFIG_OMAP_CONTROL_USB_MODULE)) + +static struct omap_control_usb_platform_data omap4_control_usb_pdata = { + .has_mailbox = true, +}; + +struct resource omap4_control_usb_res[] = { + { + .name = "control_dev_conf", + .start = 0x4a002300, + .end = 0x4a002303, + .flags = IORESOURCE_MEM, + }, + { + .name = "otghs_control", + .start = 0x4a00233c, + .end = 0x4a00233f, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device omap4_control_usb = { + .name = "omap-control-usb", + .id = -1, + .dev = { + .platform_data = &omap4_control_usb_pdata, + }, + .num_resources = 2, + .resource = omap4_control_usb_res, +}; + +static inline void __init omap_init_control_usb(void) +{ + int ret = 0; + + if (cpu_is_omap44xx()) { + ret = platform_device_register(&omap4_control_usb); + if (ret) + pr_err("Error registering omap_control_usb device: %d\n" + , ret); + } +} + +#else +static inline void omap_init_control_usb(void) { } +#endif /* CONFIG_OMAP_CONTROL_USB */ + int __init omap4_keyboard_init(struct omap4_keypad_platform_data *sdp4430_keypad_data, struct omap_board_data *bdata) { @@ -721,6 +770,7 @@ static int __init omap2_init_devices(void) omap_init_mbox(); /* If dtb is there, the devices will be created dynamically */ if (!of_have_populated_dt()) { + omap_init_control_usb(); omap_init_dmic(); omap_init_mcpdm(); omap_init_mcspi();