AnsweredAssumed Answered

spidev

Question asked by Rory Hansen on May 13, 2013
Latest reply on Feb 26, 2014 by polestar
Branched to a new discussion

I have 2 spi devices on the spi bus that I want to access as "/dev/spidevx.x".  I have altered "mx28evk.c" as follows:

 

static struct spi_board_info spi_device_info[2] __initdata = {

    [0] = {

        /* the modalias must be the same as spi device driver name */

        .modalias = "spidev", /* Name of spi_driver for this device */

        .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */

        .bus_num = 1, /* Framework bus number */

        .chip_select = 1, /* Framework chip select. */

    },

    [1] = {

        /* the modalias must be the same as spi device driver name */

        .modalias = "spidev", /* Name of spi_driver for this device */

        .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */

        .bus_num = 1, /* Framework bus number */

        .chip_select = 2, /* Framework chip select. */

    },

};

 

static void spi_device_init(void)

{

    spi_register_board_info(spi_device_info, ARRAY_SIZE(spi_device_info));

}

 

When I do a  search for spi devices on the target system I get:

 

root@freescale /$ find -name '*spi*'

./lib/modules/2.6.35.3-670-g914558e/kernel/drivers/scsi/scsi_transport_spi.ko

./proc/irq/98/mxs-spi.0

./proc/irq/84/mxs-spi.0

./sys/devices/platform/mxs-spi.0

./sys/devices/platform/mxs-spi.0/spi_master

./sys/devices/platform/mxs-spi.0/spi_master/spi1

./sys/bus/platform/devices/mxs-spi.0

./sys/bus/platform/drivers/mxs-spi

./sys/bus/platform/drivers/mxs-spi/mxs-spi.0

./sys/bus/spi

./sys/bus/spi/drivers/spidev

./sys/class/spi_master

./sys/class/spi_master/spi1

./sys/class/spidev

./sys/module/spi_mxs

./sys/module/spidev

 

So, what am I missing and/or doing wrong?


Outcomes