Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH v2 2/2] omap: RX-51: enable tsc2005

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


aaro.koskinen at nokia

Nov 4, 2009, 5:23 AM

Post #1 of 5 (129 views)
Permalink
[PATCH v2 2/2] omap: RX-51: enable tsc2005

Enable tsc2005 touchscreen driver on the RX-51 board.

Signed-off-by: Aaro Koskinen <aaro.koskinen [at] nokia>
---

The patch is for 2.6.32-rc6.

arch/arm/configs/rx51_defconfig | 1 +
arch/arm/mach-omap2/board-rx51-peripherals.c | 66 ++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 0 deletions(-)

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 <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/spi/spi.h>
+#include <linux/spi/tsc2005.h>
#include <linux/i2c.h>
#include <linux/i2c/twl4030.h>
#include <linux/clk.h>
@@ -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();
--
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tt.rantala at gmail

Nov 4, 2009, 7:07 AM

Post #2 of 5 (126 views)
Permalink
Re: [PATCH v2 2/2] omap: RX-51: enable tsc2005 [In reply to]

Aaro Koskinen wrote:
> +static struct spi_board_info rx51_peripherals_spi_board_info[] = {

This can be marked with __initdata.

BR,
Tommi Rantala
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


kalle.valo at iki

Nov 7, 2009, 7:43 AM

Post #3 of 5 (123 views)
Permalink
Re: [PATCH v2 2/2] omap: RX-51: enable tsc2005 [In reply to]

Aaro Koskinen <aaro.koskinen [at] nokia> writes:

> Enable tsc2005 touchscreen driver on the RX-51 board.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen [at] nokia>
> ---
>
> The patch is for 2.6.32-rc6.

[...]

> +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,
> + },
> +};

I sent a wl1251 patch which adds spi_board_info and conflicts with
this patch:

http://www.mail-archive.com/linux-omap [at] vger/msg17604.html

How do we handle this?

--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


aaro.koskinen at nokia

Nov 9, 2009, 5:29 AM

Post #4 of 5 (118 views)
Permalink
Re: [PATCH v2 2/2] omap: RX-51: enable tsc2005 [In reply to]

Hi,

ext Kalle Valo wrote:
> Aaro Koskinen <aaro.koskinen [at] nokia> writes:
>
>> Enable tsc2005 touchscreen driver on the RX-51 board.
>>
>> Signed-off-by: Aaro Koskinen <aaro.koskinen [at] nokia>
>> ---
>>
>> The patch is for 2.6.32-rc6.
>
> [...]
>
>> +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,
>> + },
>> +};
>
> I sent a wl1251 patch which adds spi_board_info and conflicts with
> this patch:
>
> http://www.mail-archive.com/linux-omap [at] vger/msg17604.html
>
> How do we handle this?

I can resend/rebase this patch once the wl1251 patch is integrated.

BTW, check the comment from Tommi Rantala - spi_board_info can be marked
with __initdata.

A.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


kalle.valo at iki

Nov 10, 2009, 2:30 AM

Post #5 of 5 (115 views)
Permalink
Re: [PATCH v2 2/2] omap: RX-51: enable tsc2005 [In reply to]

Aaro Koskinen <aaro.koskinen [at] nokia> writes:

>> I sent a wl1251 patch which adds spi_board_info and conflicts with
>> this patch:
>>
>> http://www.mail-archive.com/linux-omap [at] vger/msg17604.html
>>
>> How do we handle this?
>
> I can resend/rebase this patch once the wl1251 patch is integrated.

Ok, thanks. I'll resend the wl1251 patch just to be sure that it
doesn't get lost.

> BTW, check the comment from Tommi Rantala - spi_board_info can be marked
> with __initdata.

I'll add it to my patch.

--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.