Hi team ,
Since i am working with driver binding using board-file for first , apologies if any of my question miss any well known info .
I am referring to board-apalis_t30.c « mach-tegra « arm « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules based on which could team member please help me for :-
- As per my little understanding:-
apalis_t30_register_spidev = Create 2 instance of SPIDEV device
apalis_t30_mcp2515_can_init = Create 2 instance of MCP2515 device
[ which will thus call the probe function of respective protocol driver
when their respective driver code calls spi_register_driver ]
If this understanding is correct , then i am unable to appreciate what role does “apalis_t30_spi_init” & "apalis_t30_spi_devices " plays here ?
( what are these 4 instance of platform_device when we already have
2-instance of mcp2515 & 2-instance of spidev as mentioned in point-1 above )
- As per my understanding of this board-file logic , i should look & replicate
apalis_t30_mcp2515_can_init equivalent logic for our spi device
I am basically trying to understand how is the spi device being register here so that i could use this as template for my work. something like :-
static struct tegra_spi_device_controller_data adc7606dev_controller_data = {
.cs_hold_clk_count = 1,
.cs_setup_clk_count = 1,
.is_hw_based_cs = 1,
};
static struct spi_board_info tegra_adc7606spi_devices[] __initdata = {
{
.bus_num = 0, /* SPI1: Apalis SPI1 */
.chip_select = 0,
.controller_data = &adc7606dev_controller_data,
.irq = 0,
.max_speed_hz = 150000000,
.modalias = "adc7606dev",
.mode = SPI_MODE_0,
.platform_data = NULL,
},
};
/*
* In static void __init apalis_t30_init(void) function
* Comment apalis_t30_register_spidev apalis_t30_mcp2515_can_init
* Add an line to call apalis_t30_register_adc7606dev
*/
static void __init apalis_t30_register_adc7606dev(void)
{
spi_register_board_info(tegra_adc7606spi_devices,ARRAY_SIZE(tegra_adc7606spi_devices));
}