...
static int mx27_ads7846_pendown_state(void)
{
return !mxc_get_gpio_datain(MX27_PIN_PC_BVD2);
}
static struct ads7846_platform_data ads_info = {
.model = 7843,
.vref_delay_usecs = 100,
.x_max = 0x0fff,
.y_max = 0x0fff,
.x_plate_ohms = 440,
.y_plate_ohms = 250,
.get_pendown_state = mx27_ads7846_pendown_state,
};
static struct spi_board_info mxc_spi_board_info[] __initdata = {
{
.modalias = "ads7846",
.platform_data = &ads_info,
.irq = IOMUX_TO_IRQ(MX27_PIN_PC_BVD2),
.max_speed_hz = 500000,
.bus_num = 1,
.chip_select = 0,
.mode = 0,
},
};
...
... void gpio_spi_active(int cspi_mod) { switch (cspi_mod) { case 0: /* SPI1 */ gpio_request_mux(MX27_PIN_CSPI1_MOSI, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_MISO, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_SCLK, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_RDY, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_SS0, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_SS1, GPIO_MUX_PRIMARY); gpio_request_mux(MX27_PIN_CSPI1_SS2, GPIO_MUX_PRIMARY); gpio_config_mux(MX27_PIN_PC_BVD2, GPIO_MUX_GPIO); mxc_set_gpio_direction(MX27_PIN_PC_BVD2, 1); break; case 1: ...
Solved! Go to Solution.