From patchwork Wed Jan 16 21:45:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 1993511 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 6BEF6DF2A2 for ; Wed, 16 Jan 2013 21:49:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tvao9-0004jq-CK; Wed, 16 Jan 2013 21:46:05 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tvao4-0004jY-VB for linux-arm-kernel@lists.infradead.org; Wed, 16 Jan 2013 21:46:02 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0GLjuls005056; Wed, 16 Jan 2013 15:45:56 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0GLjuLj020175; Wed, 16 Jan 2013 15:45:56 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 16 Jan 2013 15:45:56 -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 r0GLjs3l010397; Wed, 16 Jan 2013 15:45:54 -0600 From: Luciano Coelho To: Subject: [[PATCH v2]] OMAP: omap4-panda: add WiLink shared transport power functions Date: Wed, 16 Jan 2013 23:45:02 +0200 Message-ID: <1358372702-13102-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_164601_179362_654A9F97 X-CRM114-Status: GOOD ( 12.30 ) 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.40 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 The code to enable and disable the WiLink shared transport has been removed from the TI-ST driver, so it must be implemented in the board files instead. Add the relevant operations to Panda's board file. Additionally, add the UART2 muxing data, so it's properly configured. Cc: stable [3.7] Signed-off-by: Luciano Coelho Reviewed-by: Peter Ujfalusi --- In v2: use gpio_request_one() instead of gpio_request() and gpio_direction_output(). (Thanks Fabio!) arch/arm/mach-omap2/board-omap4panda.c | 50 +++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 5c8e9ce..f44fccf 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -51,18 +51,50 @@ #define GPIO_HUB_NRESET 62 #define GPIO_WIFI_PMENA 43 #define GPIO_WIFI_IRQ 53 +#define GPIO_BT_EN 46 /* wl127x BT, FM, GPS connectivity chip */ +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_platform_data = { - .nshutdown_gpio = 46, .dev_name = "/dev/ttyO1", .flow_cntrl = 1, .baud_rate = 3000000, - .chip_enable = NULL, - .suspend = NULL, - .resume = NULL, + .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 wl1271_device = { .name = "kim", .id = -1, @@ -397,6 +429,12 @@ static struct omap_board_mux board_mux[] __initdata = { OMAP_PULL_ENA), OMAP4_MUX(ABE_MCBSP1_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 }, }; @@ -433,6 +471,10 @@ static void __init omap4_panda_init(void) if (ret) pr_err("error setting wl12xx data: %d\n", ret); + ret = wilink_st_init(); + if (ret) + pr_err("WiLink shared transport init failed: %d\n", ret); + omap4_panda_init_rev(); omap4_panda_i2c_init(); platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));