From patchwork Wed Nov 4 13:23:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Koskinen, Aaro (Nokia - FI/Espoo)" X-Patchwork-Id: 57573 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA4DNWHm007454 for ; Wed, 4 Nov 2009 13:23:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756039AbZKDNXV (ORCPT ); Wed, 4 Nov 2009 08:23:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756091AbZKDNXV (ORCPT ); Wed, 4 Nov 2009 08:23:21 -0500 Received: from smtp.nokia.com ([192.100.122.230]:40539 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756039AbZKDNXU (ORCPT ); Wed, 4 Nov 2009 08:23:20 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nA4DNCn5002582; Wed, 4 Nov 2009 15:23:19 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 15:23:12 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 15:23:11 +0200 Received: from localhost.localdomain (esdhcp041122.research.nokia.com [172.21.41.122]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nA4DN356004800; Wed, 4 Nov 2009 15:23:08 +0200 From: Aaro Koskinen To: linux-input@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, tony@atomide.com Cc: Aaro Koskinen Subject: [PATCH v2 2/2] omap: RX-51: enable tsc2005 Date: Wed, 4 Nov 2009 15:23:02 +0200 Message-Id: <1257340982-22814-2-git-send-email-aaro.koskinen@nokia.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1257340982-22814-1-git-send-email-aaro.koskinen@nokia.com> References: <1257340982-22814-1-git-send-email-aaro.koskinen@nokia.com> X-OriginalArrivalTime: 04 Nov 2009 13:23:11.0497 (UTC) FILETIME=[F4D75F90:01CA5D51] X-Nokia-AV: Clean Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig index e7e3133..b10de8f 100644 --- a/arch/arm/configs/rx51_defconfig +++ b/arch/arm/configs/rx51_defconfig @@ -802,6 +802,7 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_TOUCHWIN is not set # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +CONFIG_TOUCHSCREEN_TSC2005=m # CONFIG_TOUCHSCREEN_TSC2007 is not set CONFIG_INPUT_MISC=y # CONFIG_INPUT_ATI_REMOTE is not set diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e34d96a..ff3869a 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -509,6 +510,68 @@ static inline void board_onenand_init(void) #endif +#define RX51_TSC2005_RESET_GPIO 104 +#define RX51_TSC2005_IRQ_GPIO 100 + +static struct omap2_mcspi_device_config tsc2005_mcspi_config = { + .turbo_mode = 0, + .single_channel = 1, +}; + +static struct tsc2005_platform_data tsc2005_config = { + .ts_x_plate_ohm = 280, + .ts_hw_avg = 0, + .ts_touch_pressure = 1500, + .ts_stab_time = 1000, + .ts_pressure_max = 2048, + .ts_pressure_fudge = 2, + .ts_x_max = 4096, + .ts_x_fudge = 4, + .ts_y_max = 4096, + .ts_y_fudge = 7, + + .esd_timeout = 8*1000, /* ms of inactivity before we check */ + + .set_reset = NULL, +}; + +static void rx51_tsc2005_set_reset(bool enable) +{ + gpio_set_value(RX51_TSC2005_RESET_GPIO, enable); +} + +static void __init rx51_init_tsc2005(void) +{ + int r; + + r = gpio_request(RX51_TSC2005_IRQ_GPIO, "tsc2005 DAV IRQ"); + if (r >= 0) + gpio_direction_input(RX51_TSC2005_IRQ_GPIO); + else + printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 DAV IRQ"); + + r = gpio_request(RX51_TSC2005_RESET_GPIO, "tsc2005 reset"); + if (r >= 0) { + gpio_direction_output(RX51_TSC2005_RESET_GPIO, 1); + tsc2005_config.set_reset = rx51_tsc2005_set_reset; + } else { + printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset"); + tsc2005_config.esd_timeout = 0; + } +} + +static struct spi_board_info rx51_peripherals_spi_board_info[] = { + [0] = { + .modalias = "tsc2005", + .bus_num = 1, + .chip_select = 0, + .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO), + .max_speed_hz = 6000000, + .controller_data = &tsc2005_mcspi_config, + .platform_data = &tsc2005_config, + }, +}; + #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) static struct omap_smc91x_platform_data board_smc91x_data = { @@ -538,6 +601,9 @@ static inline void board_smc91x_init(void) void __init rx51_peripherals_init(void) { + spi_register_board_info(rx51_peripherals_spi_board_info, + ARRAY_SIZE(rx51_peripherals_spi_board_info)); + rx51_init_tsc2005(); rx51_i2c_init(); board_onenand_init(); board_smc91x_init();