SPI interface on panda board

177 views
Skip to first unread message

Mark Mason

unread,
Apr 20, 2011, 9:23:58 PM4/20/11
to pandaboard
Hello,

I have a pandaboard, running ubuntu 10.10. I want to access one of the
SPI interfaces on the expansion header through the user-level spidev
driver. I've done this on other boards by setting the modalias for the
spi device to "spidev". However, I'm not finding where the
corresponding spi_board_info is in arch/arm/mach-omap2 to modify. It
looks like the spi devices are built on-the fly, and 'cat /sys/devices/
platform/omap2_mcspi.4/modalias' is returning 'platform:omap2_mcspi' -
but I'm not finding where that string is built either.

I realize I'm probably looking in the wrong place, but any pointers to
how to get this up and running would be very much appreciated. I've
already searched the groups and googled for it in general, but to no
avail so far.

Many thanks in advance.

Mark

egost

unread,
Apr 22, 2011, 11:38:14 AM4/22/11
to panda...@googlegroups.com
Hi Mark,

you can modify the file arch/arm/mach-omap2/board-omap4panda.c  and define spi_board_info structure:

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


and somewhere in omap_panda_init() add a call:

spi_register_board_info(panda_spi_board_info,
                ARRAY_SIZE(panda_spi_board_info));

regards
Eugen
Reply all
Reply to author
Forward
0 new messages