From patchwork Thu Dec 2 07:44:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth V X-Patchwork-Id: 373221 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB27iio5030023 for ; Thu, 2 Dec 2010 07:44:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751748Ab0LBHom (ORCPT ); Thu, 2 Dec 2010 02:44:42 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:58893 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043Ab0LBHom (ORCPT ); Thu, 2 Dec 2010 02:44:42 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id oB27ifuN027036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Dec 2010 01:44:41 -0600 Received: from dbdmail.itg.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id oB27idVi018472 for ; Thu, 2 Dec 2010 01:44:40 -0600 (CST) Received: from 10.24.255.17 (SquirrelMail authenticated user x0099946); by dbdmail.itg.ti.com with HTTP; Thu, 2 Dec 2010 13:14:40 +0530 (IST) Message-ID: <62022.10.24.255.17.1291275880.squirrel@dbdmail.itg.ti.com> Date: Thu, 2 Dec 2010 13:14:40 +0530 (IST) Subject: [RESEND] [PATCH 3/3] omap4: Platform changes for CMA3000 Accelerometer driver From: "Hemanth V" To: linux-omap@vger.kernel.org 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 (demeter1.kernel.org [140.211.167.41]); Thu, 02 Dec 2010 07:44:44 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index ea56c30..6bda335 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -45,6 +47,7 @@ #define ETH_KS8851_POWER_ON 48 #define ETH_KS8851_QUART 138 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 +#define OMAP4_CMA3000ACCL_GPIO 186 #define OMAP4_SFH7741_ENABLE_GPIO 188 static struct gpio_led sdp4430_gpio_leds[] = { @@ -477,6 +480,27 @@ static struct twl4030_platform_data sdp4430_twldata = { .vaux3 = &sdp4430_vaux3, }; +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 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 struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { { I2C_BOARD_INFO("twl6030", 0x48), @@ -497,6 +521,11 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { { I2C_BOARD_INFO("hmc5843", 0x1e), }, + { + I2C_BOARD_INFO("cma3000_d01", 0x1c), + .platform_data = &cma3000_platform_data, + .irq = OMAP_GPIO_IRQ(OMAP4_CMA3000ACCL_GPIO), + }, }; static int __init omap4_i2c_init(void) { @@ -570,6 +599,7 @@ static void __init omap_4430sdp_init(void) spi_register_board_info(sdp4430_spi_board_info, ARRAY_SIZE(sdp4430_spi_board_info)); } + omap_cma3000accl_init(); } static void __init omap_4430sdp_map_io(void)