Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137500
b: refs/heads/master
c: c6a8131
h: refs/heads/master
v: v3
  • Loading branch information
Steve Sakoman authored and Tony Lindgren committed Mar 24, 2009
1 parent 8456e73 commit 6564bff
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18cb7aca6f94357d78d99970ec0bd5933ac4495d
refs/heads/master: c6a81316c721a20639871f08cf0cbff7e83889b4
60 changes: 60 additions & 0 deletions trunk/arch/arm/mach-omap2/board-overo.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,65 @@
#define GPMC_CS0_BASE 0x60
#define GPMC_CS_SIZE 0x30

#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)

#include <mach/mcspi.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>

static struct omap2_mcspi_device_config ads7846_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1, /* 0: slave, 1: master */
};

static int ads7846_get_pendown_state(void)
{
return !gpio_get_value(OVERO_GPIO_PENDOWN);
}

static struct ads7846_platform_data ads7846_config = {
.x_max = 0x0fff,
.y_max = 0x0fff,
.x_plate_ohms = 180,
.pressure_max = 255,
.debounce_max = 10,
.debounce_tol = 3,
.debounce_rep = 1,
.get_pendown_state = ads7846_get_pendown_state,
.keep_vref_on = 1,
};

static struct spi_board_info overo_spi_board_info[] __initdata = {
{
.modalias = "ads7846",
.bus_num = 1,
.chip_select = 0,
.max_speed_hz = 1500000,
.controller_data = &ads7846_mcspi_config,
.irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
.platform_data = &ads7846_config,
}
};

static void __init overo_ads7846_init(void)
{
if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
(gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) {
gpio_export(OVERO_GPIO_PENDOWN, 0);
} else {
printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
return;
}

spi_register_board_info(overo_spi_board_info,
ARRAY_SIZE(overo_spi_board_info));
}

#else
static inline void __init overo_ads7846_init(void) { return; }
#endif

static struct mtd_partition overo_nand_partitions[] = {
{
.name = "xloader",
Expand Down Expand Up @@ -230,6 +289,7 @@ static void __init overo_init(void)
twl4030_mmc_init(mmc);
overo_flash_init();
usb_musb_init();
overo_ads7846_init();

if ((gpio_request(OVERO_GPIO_W2W_NRESET,
"OVERO_GPIO_W2W_NRESET") == 0) &&
Expand Down

0 comments on commit 6564bff

Please sign in to comment.