Dear,
I want to use gpio0_4 as chipselect for spi2.But I don't know how to do.Our board is based on dm8148.
Need your help .Thank you very much.
Bob
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 Pavel,
I add controller_data in struct spi_board_info __initdata ti8148_spi_slave_info[],but the kernel is panic when read spi.
{
.modalias = "spidev",
.irq = -1,
.max_speed_hz = 500000,
.bus_num = 2,
.chip_select = 0,
.mode = SPI_MODE_3,
.controller_data = (void *) 4, // gpio0_4
},
Do you tell me how to modify the code ?
Thank you
Bob
Hi Pavel,
At which physical pin you export the gpio0_4 signal?
The physical pin is Y5.
And do you connect this pin to the CS external chip?
Yes
Are you driving gpio0_4 to low to select this external chip?
Yes
I use dvrrdk_04.01.00.02 and our board is based on dm8148.
I think I don't modify the code correctly,that is ,maybe I don't know how to add the gpio as chipselect in the code.
Need your more help.Thank you.
Bob
Bob,
I do not have ready made patch for your custom board. You can have a look in the below resources, they might be in help:
bob lee said:I use dvrrdk_04.01.00.02
Check the below post regarding DVR RDK support:
Regards,
Pavel
Hi Pavel,
And I also find there is no chip_sel member int the struct davinci_spi_platform_data in out source code .
Here is the struct in my kernel.
struct davinci_spi_platform_data {
u8 version;
u8 num_chipselect;
u8 wdelay;
u8 odd_parity;
u8 parity_enable;
u8 wait_enable;
u8 timer_disable;
u8 clk_internal;
u8 cs_hold;
u8 intr_level;
u8 poll_mode;
u8 use_dma;
u8 c2tdelay;
u8 t2cdelay;
};
Bob
Hi Pavel,
From the post,I can see chip_sel in devices-da8xx.c.
struct davinci_spi_platform_data da8xx_spi_pdata[] = {
[0] = {
.version = SPI_VERSION_2,
.intr_line = 1,
.dma_event_q = EVENTQ_0,
.num_chipselect = ARRAY_SIZE(csi_spi0_chip_selects),
.chip_sel = (void*)csi_spi0_chip_selects,
},
[1] = {
.version = SPI_VERSION_2,
.intr_line = 1,
.dma_event_q = EVENTQ_0,
.num_chipselect = ARRAY_SIZE(csi_spi1_chip_selects),
.chip_sel = (void*)csi_spi1_chip_selects,
},
};
BR
Bob