Hi,
In Linux kernel version 3.8 there is a patch for cs_gpio which enables GPIO to be selected as cs in spi driver.
I am using kernel 2.6.37 and need this patch and was wondering if there is one available for linux kernel 2.6.37
Thanks
Ali
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
In Linux kernel version 3.8 there is a patch for cs_gpio which enables GPIO to be selected as cs in spi driver.
I am using kernel 2.6.37 and need this patch and was wondering if there is one available for linux kernel 2.6.37
Thanks
Ali
Hi Titus,
I just specified the .controller_data to (void *)138 which is the GPIO connected to the chip select of GPIO expander and I am not sure why its not working. Just as background. SPI 2.0 CS 0 is connected to touchscreen and I am using driver ads7846 for this. The SPI 2.0 CS 1 is not connected at all. But I have Two GPIO expanders on the same bus which are connected via GPIO 138 and 136 to their specific CS pins.
This is what I have in my board specific file.
static struct spi_board_info xra1405_spi_info[] = {
[0] = {
.modalias = "xra1405",
.bus_num = 2,
.chip_select = 1,
.max_speed_hz = 12000000,
.controller_data = (void *)138,
.irq = OMAP_GPIO_IRQ(HAWK_III_IO_IRQ),
},
};
OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), /* GPIO138, IO_CS0 */
OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), /* GPIO136, IO_CS1 */
OMAP3_MUX(ETK_D14, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), /* GPIO28, nIRQ_CS */
and in the main routine I have
static void __init HAWK_III_init(void)
{
if (gpio_request(138,"GPIO138")<0)
printk(KERN_ERR "Can't get GPIO138\n");
gpio_direction_output(138, 0);
gpio_set_value(138, 0);
if (gpio_request(136,"GPIO136")<0)
printk(KERN_ERR "Can't get GPIO138\n");
gpio_direction_output(136, 0);
gpio_set_value(136, 0);
spi_register_board_info(xra1405_spi_info,
ARRAY_SIZE(xra1405_spi_info));
}
I am not sure how to go about this as I think I should register SPI bus as normal same as I did for ADS7846 driver but then communicating with GPIO expander set the appropriate GPIO line as high to talk to the right one and once finished lower the GPIO line.
Please advise what your thoughts would be on this.