/* Physical address space information */
static unsigned long universal_pin_config[] __initdata = {
....
/* SSP 1 */
GPIO23_SSP1_SCLK,
GPIO24_GPIO | MFP_LPM_DRIVE_HIGH,
GPIO25_SSP1_TXD,
GPIO26_SSP1_RXD,
...
};
/*************************************************************************
* Touchscreen - TSC2046
**************************************************************************/
/* fixed regulator for ads7846 */
static struct regulator_consumer_supply ads7846_supply =
REGULATOR_SUPPLY("vcc", "spi1.0");
static struct regulator_init_data vads7846_regulator = {
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
.consumer_supplies = &ads7846_supply,
};
static struct fixed_voltage_config vads7846 = {
.supply_name = "vads7846",
.microvolts = 3300000, /* 3.3V */
.gpio = -EINVAL,
.startup_delay = 0,
.init_data = &vads7846_regulator,
};
static struct platform_device vads7846_device = {
.name = "reg-fixed-voltage",
.id = 1,
.dev = {
.platform_data = &vads7846,
},
};
static const struct ads7846_platform_data tsc2046_info = {
.model = 7845,
.vref_delay_usecs = 100,
.pressure_max = 512,
.debounce_max = 20,
.debounce_tol = 10,
.debounce_rep = 1,
.gpio_pendown = GPIOA12_TOUCHSCREEN_N,
.x_max = 480,
.y_max = 640,
.calib_data = {9078, 26, -3438768, 36, -11665, 45389832},
};
static struct pxa2xx_spi_chip tsc2046_chip = {
.tx_threshold = 1,
.rx_threshold = 2,
.timeout = 64,
.gpio_cs = GPIO24_TSC2046_CS,
};
static struct spi_board_info tsc2046_board_info[] __initdata = {
{
.modalias = "ads7846",
.bus_num = 1,
.max_speed_hz = 2600000, /* 100 kHz sample rate */
.irq = PXA_GPIO_TO_IRQ(GPIOA12_TOUCHSCREEN_N),
.platform_data = &tsc2046_info,
.controller_data = &tsc2046_chip,
},
};
static struct pxa2xx_spi_master pxa_ssp_master_info = {
.num_chipselect = 1,
.clock_enable = CKEN_SSP1,
.enable_dma = 1,
};
static void __init universal_init(void)
{
...
spi_register_board_info(tsc2046_board_info, 1);
pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
platform_device_register(&vads7846_device);
...
}