[beagleboard] Re: Accessing SPI interface from user space

Hi Sandeep, Hi All,

you wrote that you have to register the “spidev” driver. I read all the documentation, but there is nothing about this topic. Can you tell me how to register “spidev” as the driver for the SPI port?

Best Regards
Tino

Generally you need something like the following in your kernel
platform code (this is PXA, but OMAP should be similar). It is fairly
tedious to get the bus_num and chip_select right, the is the price of
flexibility.

static struct pxa2xx_spi_master pxa_ssp_master_info = {
  .num_chipselect = 1,
};

static struct spi_board_info spi_board_info[] __initdata = {
  {
    .modalias = "spidev",
    .max_speed_hz = 13000000,
    .bus_num = 1,
    .chip_select = 0,
  },
};

pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));

Cliff