From: Haavard Skinnemoen There's no point in having a separate file just to set up the board- specific data for spi. By moving it into the rest of the board- specific setup code, we can also make sure that the data is registered before we register the spi master controller. This patch also records the GPIO pin to use as chip select in the controller_data member of the spi_board_info data for each device. Signed-off-by: Haavard Skinnemoen Cc: David Brownell Signed-off-by: Andrew Morton --- arch/avr32/boards/atstk1000/Makefile | 2 - arch/avr32/boards/atstk1000/atstk1002.c | 15 ++++++++++++ arch/avr32/boards/atstk1000/spi.c | 27 ---------------------- 3 files changed, 16 insertions(+), 28 deletions(-) diff -puN arch/avr32/boards/atstk1000/Makefile~avr32-move-spi-device-definitions-into-main-board arch/avr32/boards/atstk1000/Makefile --- a/arch/avr32/boards/atstk1000/Makefile~avr32-move-spi-device-definitions-into-main-board +++ a/arch/avr32/boards/atstk1000/Makefile @@ -1,2 +1,2 @@ -obj-y += setup.o spi.o flash.o +obj-y += setup.o flash.o obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o diff -puN arch/avr32/boards/atstk1000/atstk1002.c~avr32-move-spi-device-definitions-into-main-board arch/avr32/boards/atstk1000/atstk1002.c --- a/arch/avr32/boards/atstk1000/atstk1002.c~avr32-move-spi-device-definitions-into-main-board +++ a/arch/avr32/boards/atstk1000/atstk1002.c @@ -7,11 +7,24 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include +#include +#include #include #include +static struct spi_board_info spi_board_info[] __initdata = { + { + .modalias = "ltv350qv", + .controller_data = (void *)GPIO_PIN_PA4, + .max_speed_hz = 16000000, + .bus_num = 0, + .chip_select = 1, + }, +}; + struct eth_platform_data __initdata eth0_data = { .valid = 1, .mii_phy_addr = 0x10, @@ -39,6 +52,8 @@ static int __init atstk1002_init(void) at32_add_device_usart(2); at32_add_device_eth(0, ð0_data); + + spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); at32_add_device_spi(0); at32_add_device_lcdc(0, &atstk1000_fb0_data); diff -puN arch/avr32/boards/atstk1000/spi.c~avr32-move-spi-device-definitions-into-main-board /dev/null --- a/arch/avr32/boards/atstk1000/spi.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * ATSTK1000 SPI devices - * - * Copyright (C) 2005 Atmel Norway - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include -#include - -static struct spi_board_info spi_board_info[] __initdata = { - { - .modalias = "ltv350qv", - .max_speed_hz = 16000000, - .bus_num = 0, - .chip_select = 1, - }, -}; - -static int board_init_spi(void) -{ - spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); - return 0; -} -arch_initcall(board_init_spi); _