+1
Going to have to support students(undergrad and post grad) using spi on
overo(tobi) next semester and this would help a lot.
They'll be using spi for a few sensors and sparkfun led matrix displays(4
-8 daisy chained).
They have to get spi working themselves.
Alex
> Hi Scott,
>
> As I have spent some time getting SPI to work by following various bits
> of info scattered around the web, I would welcome your proposed patch.
> It should help save lots of time for beginners and people unfamiliar
> with SPI.
>
> Regards,
> Markus.
>
>
> On 2010.12.10 15:13, ScottEllis wrote:
>> I'd like to propose this patch to board-overo.c
>>
>> diff --git git/arch/arm/mach-omap2/board-overo.c
>> git/arch/arm/mach-omap2/board-overo.c
>> index 95efc77..315daa7 100644
>> --- git/arch/arm/mach-omap2/board-overo.c
>> +++ git/arch/arm/mach-omap2/board-overo.c
>> @@ -628,6 +628,14 @@ static struct spi_board_info overo_spi_board_info[]
>> __initdata = {
>> .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
>> .platform_data =&ads7846_config,
>> },
>> +#elif defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
>> + {
>> + .modalias = "spidev",
>> + .bus_num = 1,
>> + .chip_select = 0,
>> + .max_speed_hz = 48000000,
>> + .mode = SPI_MODE_0,
>> + },
>> #endif
>> #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
>> defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
>> @@ -638,6 +646,14 @@ static struct spi_board_info overo_spi_board_info[]
>> __initdata = {
>> .max_speed_hz = 500000,
>> .mode = SPI_MODE_3,
>> },
>> +#elif defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
>> + {
>> + .modalias = "spidev",
>> + .bus_num = 1,
>> + .chip_select = 1,
>> + .max_speed_hz = 48000000,
>> + .mode = SPI_MODE_0,
>> + },
>> #endif
>> };
>>
>>
>> This would allow enabling of spidev on either CS0 or CS1 with only a
>> kernel
>> defconfig change and rebuild rather then a board-overo.c change with the
>> added
>> steps that a patch involves when using OE.
>>
>> It also eliminates the question for new users on where and what changes
>> are
>> needed to enable or customize spidev.
>>
>> The change does not impact current behavior since both ADS7846 and
>> LGPHILIPS_LB035Q02 are enabled in the default defconfig, as is
>> SPI_SPIDEV.
>>
>>
>> With this patch in place, the instructions for enabling spidev would be
>>
>> (to enable spidev on SPI1.CS0)
>>
>> sed -i 's:CONFIG_TOUCHSCREEN_ADS7846=m:# CONFIG_TOUCHSCREEN_ADS7846 is
>> not
>> set:g' defconfig
>>
>> (to enable spidev on SPI1.CS1)
>>
>> sed -i 's:CONFIG_PANEL_LGPHILIPS_LB035Q02=y:# #
>> CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set:g' defconfig
>>
>>
>> And then a kernel rebuild.
>>
>> Those sed lines could incorporated into a patch or a recipe (like the
>> MUSB_MODE),
>> but the core idea is that users would not have to mess with
>> board-overo.c
>> unless
>> the spi_board_info needed modifications. In which case this change still
>> helps
>> because it directs users to where they should edit.
>>
>> Thoughts?
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for
> PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> gumstix-users mailing list
> gumstix-users@...
> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>
|