From patchwork Wed Jan 16 22:01:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 1993541 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 66E42DF2A2 for ; Wed, 16 Jan 2013 22:06:15 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tvb40-0005rt-NT; Wed, 16 Jan 2013 22:02:28 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tvb3u-0005rR-5N for linux-arm-kernel@lists.infradead.org; Wed, 16 Jan 2013 22:02:25 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0GM2FBq010143; Wed, 16 Jan 2013 16:02:15 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0GM2F1d002874; Wed, 16 Jan 2013 16:02:15 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 16 Jan 2013 16:02:15 -0600 Received: from cumari.coelho.fi (h79-16.vpn.ti.com [172.24.79.16]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0GM2Cli014519; Wed, 16 Jan 2013 16:02:13 -0600 From: Luciano Coelho To: Subject: [RFC] OMAP: 4430sdp: add shared trasport devices to the board file Date: Thu, 17 Jan 2013 00:01:21 +0200 Message-ID: <1358373682-13536-1-git-send-email-coelho@ti.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130116_170222_390926_7FE8718E X-CRM114-Status: GOOD ( 19.34 ) 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 [192.94.94.41 listed in list.dnswl.org] -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: linux-omap@vger.kernel.org, linux@arm.linux.org.uk, linux-kernel@vger.kernel.org, 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the btwilink, nfcwilink and shared transport devices to the board file, including functions to power things on and off. Additionally, add the UART2 muxing data, so it's properly configured. Signed-off-by: Luciano Coelho --- This is pretty much the same as the patch I just sent for panda, but there were a few more things missing in the 4430sdp board file and I also included NFC support. I'm sending this as RFC because I'm not sure this is the right thing to do for 4430sdp. This configuration works when the WiLink COM8 module is installed. The WLAN support is already hardcoded in this file, so adding shared transport (BT/NFC/FM/GPS) support at least won't make things much worse. Additionally, only WiLink8 has optional support for NFC and I'm not sure there is a way to figure that out at runtime. arch/arm/mach-omap2/board-4430sdp.c | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 1cc6696..7cf273e 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include @@ -53,6 +55,7 @@ #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 #define OMAP4_SFH7741_ENABLE_GPIO 188 +#define GPIO_BT_EN 55 #define GPIO_WIFI_PMENA 54 #define GPIO_WIFI_IRQ 53 @@ -408,6 +411,66 @@ static struct platform_device sdp4430_abe_audio = { }, }; +/* TI shared transport for Bluetooth and NFC */ +static int plat_kim_chip_enable(struct kim_data_s *kim_data) +{ + gpio_set_value(GPIO_BT_EN, GPIO_LOW); + mdelay(5); + gpio_set_value(GPIO_BT_EN, GPIO_HIGH); + mdelay(100); + + return 0; +} + +static int plat_kim_chip_disable(struct kim_data_s *kim_data) +{ + gpio_set_value(GPIO_BT_EN, GPIO_LOW); + mdelay(1); + gpio_set_value(GPIO_BT_EN, GPIO_HIGH); + mdelay(1); + gpio_set_value(GPIO_BT_EN, GPIO_LOW); + + return 0; +} + +static struct ti_st_plat_data wilink_pdata = { + .dev_name = "/dev/ttyO1", + .flow_cntrl = 1, + .baud_rate = 3000000, + .chip_enable = plat_kim_chip_enable, + .chip_disable = plat_kim_chip_disable, +}; + +static int wilink_st_init(void) +{ + int status; + + status = gpio_request_one(GPIO_BT_EN, GPIOF_OUT_INIT_LOW, "kim"); + if (status) + pr_err("%s: failed to request gpio %d\n", __func__, + GPIO_BT_EN); + + return status; +} + +static struct platform_device wl12xx_device = { + .name = "kim", + .id = -1, + .dev = { + .platform_data = &wilink_pdata, + }, +}; + +static struct platform_device btwilink_device = { + .name = "btwilink", + .id = -1, +}; + +static struct platform_device nfcwilink_device = { + .name = "nfcwilink", + .id = -1, +}; + static struct platform_device *sdp4430_devices[] __initdata = { &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, @@ -416,6 +479,9 @@ static struct platform_device *sdp4430_devices[] __initdata = { &sdp4430_dmic_codec, &sdp4430_abe_audio, &sdp4430_hdmi_audio_codec, + &wl12xx_device, + &btwilink_device, + &nfcwilink_device, }; static struct omap_musb_board_data musb_board_data = { @@ -632,6 +698,12 @@ static struct omap_board_mux board_mux[] __initdata = { OMAP_PULL_ENA), OMAP4_MUX(ABE_MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), + /* UART2 - BT/FM/GPS shared transport */ + OMAP4_MUX(UART2_CTS, OMAP_PIN_INPUT | OMAP_MUX_MODE0), + OMAP4_MUX(UART2_RTS, OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), + OMAP4_MUX(UART2_RX, OMAP_PIN_INPUT | OMAP_MUX_MODE0), + OMAP4_MUX(UART2_TX, OMAP_PIN_OUTPUT | OMAP_MUX_MODE0), + { .reg_offset = OMAP_MUX_TERMINATOR }, }; @@ -711,6 +783,10 @@ static void __init omap_4430sdp_init(void) if (status) pr_err("Keypad initialization failed: %d\n", status); + status = wilink_st_init(); + if (status) + pr_err("WiLink shared transport init failed: %d\n", status); + omap_4430sdp_display_init(); }