Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281678
b: refs/heads/master
c: 3dad535
h: refs/heads/master
v: v3
  • Loading branch information
Aaro Koskinen authored and Tony Lindgren committed Dec 13, 2011
1 parent c9081e9 commit 9b9b3b6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2404f4275badc719b8335420c97ae9380e01227
refs/heads/master: 3dad5356aa47097cf67027cf0a07298b4f5baef6
46 changes: 44 additions & 2 deletions trunk/arch/arm/mach-omap2/board-rx51-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/input/matrix_keypad.h>
#include <linux/spi/spi.h>
#include <linux/wl12xx.h>
#include <linux/spi/tsc2005.h>
#include <linux/i2c.h>
#include <linux/i2c/twl.h>
#include <linux/clk.h>
Expand Down Expand Up @@ -58,6 +59,9 @@

#define RX51_USB_TRANSCEIVER_RST_GPIO 67

#define RX51_TSC2005_RESET_GPIO 104
#define RX51_TSC2005_IRQ_GPIO 100

/* list all spi devices here */
enum {
RX51_SPI_WL1251,
Expand All @@ -66,6 +70,7 @@ enum {
};

static struct wl12xx_platform_data wl1251_pdata;
static struct tsc2005_platform_data tsc2005_pdata;

#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
Expand Down Expand Up @@ -167,10 +172,10 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
.modalias = "tsc2005",
.bus_num = 1,
.chip_select = 0,
/* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
.irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
.max_speed_hz = 6000000,
.controller_data = &tsc2005_mcspi_config,
/* .platform_data = &tsc2005_config,*/
.platform_data = &tsc2005_pdata,
},
};

Expand Down Expand Up @@ -1086,6 +1091,42 @@ static void __init rx51_init_wl1251(void)
*/
}

static struct tsc2005_platform_data tsc2005_pdata = {
.ts_pressure_max = 2048,
.ts_pressure_fudge = 2,
.ts_x_max = 4096,
.ts_x_fudge = 4,
.ts_y_max = 4096,
.ts_y_fudge = 7,
.ts_x_plate_ohm = 280,
.esd_timeout_ms = 8000,
};

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_one(RX51_TSC2005_IRQ_GPIO, GPIOF_IN, "tsc2005 IRQ");
if (r < 0) {
printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 IRQ");
rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq = 0;
}

r = gpio_request_one(RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
"tsc2005 reset");
if (r >= 0) {
tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
} else {
printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset");
tsc2005_pdata.esd_timeout_ms = 0;
}
}

void __init rx51_peripherals_init(void)
{
rx51_i2c_init();
Expand All @@ -1094,6 +1135,7 @@ void __init rx51_peripherals_init(void)
board_smc91x_init();
rx51_add_gpio_keys();
rx51_init_wl1251();
rx51_init_tsc2005();
rx51_init_si4713();
spi_register_board_info(rx51_peripherals_spi_board_info,
ARRAY_SIZE(rx51_peripherals_spi_board_info));
Expand Down

0 comments on commit 9b9b3b6

Please sign in to comment.