From patchwork Fri Apr 30 14:43:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth V X-Patchwork-Id: 96022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3UJHc1R007196 for ; Fri, 30 Apr 2010 19:17:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932822Ab0D3TO6 (ORCPT ); Fri, 30 Apr 2010 15:14:58 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:38479 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932516Ab0D3Q56 (ORCPT ); Fri, 30 Apr 2010 12:57:58 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3UEheMW010680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Apr 2010 09:43:40 -0500 Received: from dbdmail.itg.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o3UEhZrP021447; Fri, 30 Apr 2010 09:43:36 -0500 (CDT) Received: from 10.24.255.18 (SquirrelMail authenticated user x0099946); by dbdmail.itg.ti.com with HTTP; Fri, 30 Apr 2010 20:13:37 +0530 (IST) Message-ID: <12076.10.24.255.18.1272638617.squirrel@dbdmail.itg.ti.com> Date: Fri, 30 Apr 2010 20:13:37 +0530 (IST) Subject: [RFC] [PATCH 2/2] Platform changes for CMA3000 From: "Hemanth V" To: linux-input@vger.kernel.org, linux-omap@vger.kernel.org Cc: Ossi.Kauppinen@vti.fi, hemanthv@ti.com User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 30 Apr 2010 19:17:43 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 72e7b14..717ad4b 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -39,9 +40,12 @@ #include #include #include +#include #include #include "mmc-twl4030.h" +#define OMAP4_CMA3000ACCL_GPIO 186 + static int sdp4430_keymap[] = { KEY(0, 0, KEY_E), KEY(0, 1, KEY_R), @@ -503,6 +507,18 @@ static struct twl4030_platform_data sdp4430_twldata = { .bci = &sdp4430_bci_data, }; +static struct cma3000_platform_data cma3000_platform_data = { + .fuzz_x = 25, + .fuzz_y = 25, + .fuzz_z = 25, + .g_range = CMARANGE_8G, + .mode = CMAMODE_MOTDET, + .mdthr = 0x8, + .mdfftmr = 0x33, + .ffthr = 0x8, + .irqflags = IRQF_TRIGGER_HIGH, +}; + static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { { I2C_BOARD_INFO("twl6030", 0x48), @@ -526,6 +542,14 @@ static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { }, }; +static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { + { + I2C_BOARD_INFO("cma3000_accl", 0x1c), + .platform_data = &cma3000_platform_data, + .irq = OMAP_GPIO_IRQ(OMAP4_CMA3000ACCL_GPIO), + }, +}; + static int __init omap4_i2c_init(void) { /* Phoenix Audio IC needs I2C1 to srat with 400 KHz and less */ @@ -535,7 +559,8 @@ static int __init omap4_i2c_init(void) ARRAY_SIZE(sdp4430_i2c_2_boardinfo)); omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); - omap_register_i2c_bus(4, 400, 0, 0); + omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo, + ARRAY_SIZE(sdp4430_i2c_4_boardinfo)); return 0; } @@ -578,6 +603,16 @@ static void omap_ethernet_init(void) gpio_direction_input(34); } +static void omap_cma3000accl_init(void) +{ + + if (gpio_request(OMAP4_CMA3000ACCL_GPIO, "Accelerometer") < 0) { + pr_err("Accelerometer GPIO request failed\n"); + return; + } + gpio_direction_input(OMAP4_CMA3000ACCL_GPIO); + +} static void __init omap_4430sdp_init(void) { omap4_i2c_init(); @@ -591,6 +626,7 @@ static void __init omap_4430sdp_init(void) sdp4430_spi_board_info[0].irq = gpio_to_irq(34); spi_register_board_info(sdp4430_spi_board_info, ARRAY_SIZE(sdp4430_spi_board_info)); + omap_cma3000accl_init(); }