From: Andrew Victor Date: Wed, 23 Jan 2008 08:29:46 +0000 (+0100) Subject: [ARM] 4760/1: [AT91] SPI CS0 errata on AT91RM9200 X-Git-Tag: v2.6.25-rc1~1175^2~2^2~5 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2743f0c1dcca54d6c80b0de1273b3f4e90051a85;p=linux-2.6-omap-h63xx.git [ARM] 4760/1: [AT91] SPI CS0 errata on AT91RM9200 Due to errata regarding the handling of SPI CS0 on the AT91RM9200, the atmel_spi driver drives CS0 from the SPI controller and not as a GPIO pin. We therefore need to configure CS0 for use by the controller Signed-off-by: Andrew Victor Signed-off-by: Russell King --- diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index ea9a952fb87..ef6aeb86e98 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -558,8 +558,11 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) else cs_pin = spi_standard_cs[devices[i].chip_select]; - /* enable chip-select pin */ - at91_set_gpio_output(cs_pin, 1); + if (devices[i].chip_select == 0) /* for CS0 errata */ + at91_set_A_periph(cs_pin, 0); + else + at91_set_gpio_output(cs_pin, 1); + /* pass chip-select pin to driver */ devices[i].controller_data = (void *) cs_pin;