Hi,
I try to use SPI1 bus to configure a TFT display, but I don't really understand how to do that. I try to create a new driver like "AT25xxA_eeprom", but it doesn't work.
I create "TFT2N.c" in "/lsp/ti-davinci/driver/video" and I have modified "Kconfig" and "Makefile" and in "make menu config" I have added my driver to the kernel. After rebooting the dm355evm board, I look at Kernel Debug Message with "dmesg" and I see that my driver is running. My question is, how make-work spi1 in my lcd driver ?
I have try to create, in "/lsp/ti-davinci/arch/arm/mach-davinci/davinci_spi_platform.c", a new spi platform :
static struct resource lcd_spi_resources[] = {
[0] = {
.start = DAVINCI_DM355_SPI1_BASE,
.end = DAVINCI_DM355_SPI1_BASE + (SZ_4K) - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_DM355_SPINT1_0,
.end = IRQ_DM355_SPINT1_0,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device lcd_platform_spi_device = {
.name = "TFT2N spi Platform",
.id = 0,
.num_resources = ARRAY_SIZE(lcd_spi_resources),
.resource = lcd_spi_resources,
};
...
/** add one chip to the board **/
static struct spi_board_info dm355_spi_board_info[] = {
...
{
.modalias = "lcd",
.platform_data = NULL,
.mode = SPI_MODE_3,
.irq = 0,
.max_speed_hz = 2 * 1000 * 1000 /* max sample rate at 3V */ ,
.bus_num = 1,
.chip_select = 0,
},
};
...
/** Registering the new platform **/
lcd_platform_spi_device.dev.platform_data = &lcd_spi_platform_data;
(void)platform_device_register(&lcd_platform_spi_device);
After this, I use "lcd_platform_spi_device" in my driver code but I don't succeed to have to "struct spi_device" needed to write and read something on SPI.
I saw also, in "AT25xxA_eeprom.c", that the system send directly an spi_device parameter to the "_devinit" function. But I don't understand how. In my driver, the system never calls this function.
Please, can you help me to make-work SPI interface ?
Thanks a lot and sorry for my bad english.
ROCHE Guillaume