diff options
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/stamp.c')
| -rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 894 | 
1 files changed, 510 insertions, 384 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 3aa344ce8e5..de19b8a5600 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c @@ -7,6 +7,7 @@   */  #include <linux/device.h> +#include <linux/export.h>  #include <linux/kernel.h>  #include <linux/platform_device.h>  #include <linux/io.h> @@ -17,7 +18,7 @@  #include <linux/mtd/physmap.h>  #include <linux/spi/spi.h>  #include <linux/spi/flash.h> -#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)  #include <linux/usb/isp1362.h>  #endif  #include <linux/i2c.h> @@ -35,6 +36,7 @@  #include <asm/reboot.h>  #include <asm/portmux.h>  #include <asm/dpmc.h> +#include <asm/bfin_sport.h>  #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE  #include <linux/regulator/fixed.h>  #endif @@ -51,7 +53,7 @@ const char bfin_board_name[] = "ADI BF537-STAMP";   *  Driver needs to know address, irq and flag pin.   */ -#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)  #include <linux/usb/isp1760.h>  static struct resource bfin_isp1760_resources[] = {  	[0] = { @@ -86,7 +88,7 @@ static struct platform_device bfin_isp1760_device = {  };  #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)  #include <linux/gpio_keys.h>  static struct gpio_keys_button bfin_gpio_keys_table[] = { @@ -109,7 +111,7 @@ static struct platform_device bfin_device_gpiokeys = {  };  #endif -#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) +#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)  static struct resource bfin_pcmcia_cf_resources[] = {  	{  		.start = 0x20310000, /* IO PORT */ @@ -138,14 +140,14 @@ static struct platform_device bfin_pcmcia_cf_device = {  };  #endif -#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) +#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)  static struct platform_device rtc_device = {  	.name = "rtc-bfin",  	.id   = -1,  };  #endif -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X)  #include <linux/smc91x.h>  static struct smc91x_platdata smc91x_info = { @@ -178,7 +180,7 @@ static struct platform_device smc91x_device = {  };  #endif -#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) +#if IS_ENABLED(CONFIG_DM9000)  static struct resource dm9000_resources[] = {  	[0] = {  		.start	= 0x203FB800, @@ -205,7 +207,7 @@ static struct platform_device dm9000_device = {  };  #endif -#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_SL811_HCD)  static struct resource sl811_hcd_resources[] = {  	{  		.start = 0x20340000, @@ -249,7 +251,7 @@ static struct platform_device sl811_hcd_device = {  };  #endif -#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)  static struct resource isp1362_hcd_resources[] = {  	{  		.start = 0x20360000, @@ -288,8 +290,8 @@ static struct platform_device isp1362_hcd_device = {  };  #endif -#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) -unsigned short bfin_can_peripherals[] = { +#if IS_ENABLED(CONFIG_CAN_BFIN) +static unsigned short bfin_can_peripherals[] = {  	P_CAN0_RX, P_CAN0_TX, 0  }; @@ -326,7 +328,7 @@ static struct platform_device bfin_can_device = {  };  #endif -#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) +#if IS_ENABLED(CONFIG_BFIN_MAC)  #include <linux/bfin_mac.h>  static const unsigned short bfin_mac_peripherals[] = P_MII0; @@ -359,13 +361,16 @@ static struct platform_device bfin_mac_device = {  };  #endif -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272)  static struct resource net2272_bfin_resources[] = {  	{  		.start = 0x20300000,  		.end = 0x20300000 + 0x100,  		.flags = IORESOURCE_MEM,  	}, { +		.start = 1, +		.flags = IORESOURCE_BUS, +	}, {  		.start = IRQ_PF7,  		.end = IRQ_PF7,  		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, @@ -380,8 +385,7 @@ static struct platform_device net2272_bfin_device = {  };  #endif -#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) -#ifdef CONFIG_MTD_PARTITIONS +#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)  const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };  static struct mtd_partition bfin_plat_nand_partitions[] = { @@ -395,7 +399,6 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {  		.offset = MTDPART_OFS_APPEND,  	},  }; -#endif  #define BFIN_NAND_PLAT_CLE 2  #define BFIN_NAND_PLAT_ALE 1 @@ -422,11 +425,9 @@ static struct platform_nand_data bfin_plat_nand_data = {  	.chip = {  		.nr_chips = 1,  		.chip_delay = 30, -#ifdef CONFIG_MTD_PARTITIONS  		.part_probe_types = part_probes,  		.partitions = bfin_plat_nand_partitions,  		.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions), -#endif  	},  	.ctrl = {  		.cmd_ctrl  = bfin_plat_nand_cmd_ctrl, @@ -454,12 +455,13 @@ static struct platform_device bfin_async_nand_device = {  static void bfin_plat_nand_init(void)  {  	gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat"); +	gpio_direction_input(BFIN_NAND_PLAT_READY);  }  #else  static void bfin_plat_nand_init(void) {}  #endif -#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) +#if IS_ENABLED(CONFIG_MTD_PHYSMAP)  static struct mtd_partition stamp_partitions[] = {  	{  		.name       = "bootloader(nor)", @@ -507,8 +509,7 @@ static struct platform_device stamp_flash_device = {  };  #endif -#if defined(CONFIG_MTD_M25P80) \ -	|| defined(CONFIG_MTD_M25P80_MODULE) +#if IS_ENABLED(CONFIG_MTD_M25P80)  static struct mtd_partition bfin_spi_flash_partitions[] = {  	{  		.name = "bootloader(spi)", @@ -536,49 +537,11 @@ static struct flash_platform_data bfin_spi_flash_data = {  /* SPI flash chip (m25p64) */  static struct bfin5xx_spi_chip spi_flash_chip_info = {  	.enable_dma = 0,         /* use dma transfer with this chip*/ -	.bits_per_word = 8, -}; -#endif - -#if defined(CONFIG_BFIN_SPI_ADC) \ -	|| defined(CONFIG_BFIN_SPI_ADC_MODULE) -/* SPI ADC chip */ -static struct bfin5xx_spi_chip spi_adc_chip_info = { -	.enable_dma = 1,         /* use dma transfer with this chip*/ -	.bits_per_word = 16, -}; -#endif - -#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ -	|| defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) -static struct bfin5xx_spi_chip ad1836_spi_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 16, -}; -#endif - -#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \ -	|| defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE) -static struct bfin5xx_spi_chip ad1938_spi_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 8, -}; -#endif - -#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) \ -	|| defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE) -static struct bfin5xx_spi_chip adav801_spi_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE) +#if IS_ENABLED(CONFIG_INPUT_AD714X_SPI)  #include <linux/input/ad714x.h> -static struct bfin5xx_spi_chip ad7147_spi_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 16, -};  static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {  	{ @@ -638,7 +601,7 @@ static struct ad714x_platform_data ad7147_spi_platform_data = {  };  #endif -#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE) +#if IS_ENABLED(CONFIG_INPUT_AD714X_I2C)  #include <linux/input/ad714x.h>  static struct ad714x_button_plat ad7142_i2c_button_plat[] = {  	{ @@ -685,27 +648,25 @@ static struct ad714x_platform_data ad7142_i2c_platform_data = {  };  #endif -#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE) +#if IS_ENABLED(CONFIG_AD2S90)  static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 16,  };  #endif -#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE) -unsigned short ad2s120x_platform_data[] = { +#if IS_ENABLED(CONFIG_AD2S1200) +static unsigned short ad2s1200_platform_data[] = {  	/* used as SAMPLE and RDVEL */  	GPIO_PF5, GPIO_PF6, 0  }; -static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = { +static struct bfin5xx_spi_chip ad2s1200_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 16,  };  #endif -#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE) -unsigned short ad2s1210_platform_data[] = { +#if IS_ENABLED(CONFIG_AD2S1210) +static unsigned short ad2s1210_platform_data[] = {  	/* use as SAMPLE, A0, A1 */  	GPIO_PF7, GPIO_PF8, GPIO_PF9,  # if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT) @@ -717,18 +678,16 @@ unsigned short ad2s1210_platform_data[] = {  static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE) +#if IS_ENABLED(CONFIG_SENSORS_AD7314)  static struct bfin5xx_spi_chip ad7314_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 16,  };  #endif -#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE) +#if IS_ENABLED(CONFIG_AD7816)  static unsigned short ad7816_platform_data[] = {  	GPIO_PF4, /* rdwr_pin */  	GPIO_PF5, /* convert_pin */ @@ -738,11 +697,10 @@ static unsigned short ad7816_platform_data[] = {  static struct bfin5xx_spi_chip ad7816_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE) +#if IS_ENABLED(CONFIG_ADT7310)  static unsigned long adt7310_platform_data[3] = {  /* INT bound temperature alarm event. line 1 */  	IRQ_PG4, IRQF_TRIGGER_LOW, @@ -752,23 +710,17 @@ static unsigned long adt7310_platform_data[3] = {  static struct bfin5xx_spi_chip adt7310_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE) +#if IS_ENABLED(CONFIG_AD7298)  static unsigned short ad7298_platform_data[] = {  	GPIO_PF7, /* busy_pin */  	0,  }; - -static struct bfin5xx_spi_chip ad7298_spi_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 16, -};  #endif -#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE) +#if IS_ENABLED(CONFIG_ADT7316_SPI)  static unsigned long adt7316_spi_data[2] = {  	IRQF_TRIGGER_LOW, /* interrupt flags */  	GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */ @@ -776,11 +728,10 @@ static unsigned long adt7316_spi_data[2] = {  static struct bfin5xx_spi_chip adt7316_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) +#if IS_ENABLED(CONFIG_MMC_SPI)  #define MMC_SPI_CARD_DETECT_INT IRQ_PF5  static int bfin_mmc_spi_init(struct device *dev, @@ -803,18 +754,12 @@ static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {  static struct bfin5xx_spi_chip  mmc_spi_chip_info = {  	.enable_dma = 0, -	.bits_per_word = 8,  	.pio_interrupt = 0,  };  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)  #include <linux/spi/ad7877.h> -static struct bfin5xx_spi_chip spi_ad7877_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 16, -}; -  static const struct ad7877_platform_data bfin_ad7877_ts_info = {  	.model			= 7877,  	.vref_delay_usecs	= 50,	/* internal, no capacitor */ @@ -830,7 +775,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {  };  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)  #include <linux/spi/ad7879.h>  static const struct ad7879_platform_data bfin_ad7879_ts_info = {  	.model			= 7879,	/* Model = AD7879 */ @@ -847,7 +792,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {  };  #endif -#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) +#if IS_ENABLED(CONFIG_INPUT_ADXL34X)  #include <linux/input/adxl34x.h>  static const struct adxl34x_platform_data adxl34x_info = {  	.x_axis_offset = 0, @@ -886,39 +831,13 @@ static const struct adxl34x_platform_data adxl34x_info = {  };  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) -static struct bfin5xx_spi_chip spi_ad7879_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 16, -}; -#endif - -#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) -static struct bfin5xx_spi_chip spidev_chip_info = { -	.enable_dma = 0, -	.bits_per_word = 8, -}; -#endif - -#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) -static struct bfin5xx_spi_chip lq035q1_spi_chip_info = { -	.enable_dma	= 0, -	.bits_per_word	= 8, -}; -#endif - -#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) +#if IS_ENABLED(CONFIG_ENC28J60)  static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {  	.enable_dma	= 1, -	.bits_per_word	= 8,  };  #endif -#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE) -static struct bfin5xx_spi_chip adf7021_spi_chip_info = { -	.bits_per_word = 16, -}; - +#if IS_ENABLED(CONFIG_ADF702X)  #include <linux/spi/adf702x.h>  #define TXREG 0x0160A470  static const u32 adf7021_regs[] = { @@ -954,18 +873,14 @@ static struct adf702x_platform_data adf7021_platform_data = {  };  static inline void adf702x_mac_init(void)  { -	random_ether_addr(adf7021_platform_data.mac_addr); +	eth_random_addr(adf7021_platform_data.mac_addr);  }  #else  static inline void adf702x_mac_init(void) {}  #endif -#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_ADS7846)  #include <linux/spi/ads7846.h> -static struct bfin5xx_spi_chip ad7873_spi_chip_info = { -	.bits_per_word	= 8, -}; -  static int ads7873_get_pendown_state(void)  {  	return gpio_get_value(GPIO_PF6); @@ -983,8 +898,7 @@ static struct ads7846_platform_data __initdata ad7873_pdata = {  };  #endif -#if defined(CONFIG_MTD_DATAFLASH) \ -	|| defined(CONFIG_MTD_DATAFLASH_MODULE) +#if IS_ENABLED(CONFIG_MTD_DATAFLASH)  static struct mtd_partition bfin_spi_dataflash_partitions[] = {  	{ @@ -1012,27 +926,17 @@ static struct flash_platform_data bfin_spi_dataflash_data = {  /* DataFlash chip */  static struct bfin5xx_spi_chip data_flash_chip_info = {  	.enable_dma = 0,         /* use dma transfer with this chip*/ -	.bits_per_word = 8, -}; -#endif - -#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) -static struct bfin5xx_spi_chip spi_adxl34x_chip_info = { -	.enable_dma = 0,         /* use dma transfer with this chip*/ -	.bits_per_word = 8,  };  #endif -#if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE) +#if IS_ENABLED(CONFIG_AD7476)  static struct bfin5xx_spi_chip spi_ad7476_chip_info = {  	.enable_dma = 0,         /* use dma transfer with this chip*/ -	.bits_per_word = 8,  };  #endif  static struct spi_board_info bfin_spi_board_info[] __initdata = { -#if defined(CONFIG_MTD_M25P80) \ -	|| defined(CONFIG_MTD_M25P80_MODULE) +#if IS_ENABLED(CONFIG_MTD_M25P80)  	{  		/* the modalias must be the same as spi device driver name */  		.modalias = "m25p80", /* Name of spi_driver for this device */ @@ -1044,8 +948,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_MTD_DATAFLASH) \ -	|| defined(CONFIG_MTD_DATAFLASH_MODULE) +#if IS_ENABLED(CONFIG_MTD_DATAFLASH)  	{	/* DataFlash chip */  		.modalias = "mtd_dataflash",  		.max_speed_hz = 33250000,     /* max spi clock (SCK) speed in HZ */ @@ -1056,54 +959,39 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_BFIN_SPI_ADC) \ -	|| defined(CONFIG_BFIN_SPI_ADC_MODULE) -	{ -		.modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ -		.max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */ -		.bus_num = 0, /* Framework bus number */ -		.chip_select = 1, /* Framework chip select. */ -		.platform_data = NULL, /* No spi_driver specific config */ -		.controller_data = &spi_adc_chip_info, -	}, -#endif -#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ -	|| defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)  	{ -		.modalias = "ad183x", +		.modalias = "ad1836",  		.max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 4,  		.platform_data = "ad1836", /* only includes chip name for the moment */ -		.controller_data = &ad1836_spi_chip_info,  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE) +#ifdef CONFIG_SND_SOC_AD193X_SPI  	{  		.modalias = "ad193x",  		.max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 5, -		.controller_data = &ad1938_spi_chip_info,  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAV80X)  	{ -		.modalias = "adav80x", +		.modalias = "adav801",  		.max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 1, -		.controller_data = &adav801_spi_chip_info,  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE) +#if IS_ENABLED(CONFIG_INPUT_AD714X_SPI)  	{  		.modalias = "ad714x_captouch",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1112,11 +1000,10 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.chip_select = 5,  		.mode = SPI_MODE_3,  		.platform_data = &ad7147_spi_platform_data, -		.controller_data = &ad7147_spi_chip_info,  	},  #endif -#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE) +#if IS_ENABLED(CONFIG_AD2S90)  	{  		.modalias = "ad2s90",  		.bus_num = 0, @@ -1127,17 +1014,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE) +#if IS_ENABLED(CONFIG_AD2S1200)  	{ -		.modalias = "ad2s120x", +		.modalias = "ad2s1200",  		.bus_num = 0,  		.chip_select = 4,            /* CS, change it for your board */ -		.platform_data = ad2s120x_platform_data, -		.controller_data = &ad2s120x_spi_chip_info, +		.platform_data = ad2s1200_platform_data, +		.controller_data = &ad2s1200_spi_chip_info,  	},  #endif -#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE) +#if IS_ENABLED(CONFIG_AD2S1210)  	{  		.modalias = "ad2s1210",  		.max_speed_hz = 8192000, @@ -1148,7 +1035,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE) +#if IS_ENABLED(CONFIG_SENSORS_AD7314)  	{  		.modalias = "ad7314",  		.max_speed_hz = 1000000, @@ -1159,7 +1046,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE) +#if IS_ENABLED(CONFIG_AD7816)  	{  		.modalias = "ad7818",  		.max_speed_hz = 1000000, @@ -1171,7 +1058,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE) +#if IS_ENABLED(CONFIG_ADT7310)  	{  		.modalias = "adt7310",  		.max_speed_hz = 1000000, @@ -1184,19 +1071,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE) +#if IS_ENABLED(CONFIG_AD7298)  	{  		.modalias = "ad7298",  		.max_speed_hz = 1000000,  		.bus_num = 0,  		.chip_select = 4,            /* CS, change it for your board */  		.platform_data = ad7298_platform_data, -		.controller_data = &ad7298_spi_chip_info,  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE) +#if IS_ENABLED(CONFIG_ADT7316_SPI)  	{  		.modalias = "adt7316",  		.max_speed_hz = 1000000, @@ -1209,7 +1095,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  	},  #endif -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) +#if IS_ENABLED(CONFIG_MMC_SPI)  	{  		.modalias = "mmc_spi",  		.max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */ @@ -1220,7 +1106,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)  	{  		.modalias		= "ad7877",  		.platform_data		= &bfin_ad7877_ts_info, @@ -1228,10 +1114,9 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.max_speed_hz	= 12500000,     /* max spi clock (SCK) speed in HZ */  		.bus_num	= 0,  		.chip_select  = 1, -		.controller_data = &spi_ad7877_chip_info,  	},  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)  	{  		.modalias = "ad7879",  		.platform_data = &bfin_ad7879_ts_info, @@ -1239,30 +1124,27 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.max_speed_hz = 5000000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 1, -		.controller_data = &spi_ad7879_chip_info,  		.mode = SPI_CPHA | SPI_CPOL,  	},  #endif -#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) +#if IS_ENABLED(CONFIG_SPI_SPIDEV)  	{  		.modalias = "spidev",  		.max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 1, -		.controller_data = &spidev_chip_info,  	},  #endif -#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) +#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)  	{  		.modalias = "bfin-lq035q1-spi",  		.max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = 2, -		.controller_data = &lq035q1_spi_chip_info,  		.mode = SPI_CPHA | SPI_CPOL,  	},  #endif -#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) +#if IS_ENABLED(CONFIG_ENC28J60)  	{  		.modalias = "enc28j60",  		.max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */ @@ -1273,7 +1155,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_0,  	},  #endif -#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) +#if IS_ENABLED(CONFIG_INPUT_ADXL34X_SPI)  	{  		.modalias	= "adxl34x",  		.platform_data	= &adxl34x_info, @@ -1281,35 +1163,31 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.max_speed_hz	= 5000000,    /* max spi clock (SCK) speed in HZ */  		.bus_num	= 0,  		.chip_select	= 2, -		.controller_data = &spi_adxl34x_chip_info,  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE) +#if IS_ENABLED(CONFIG_ADF702X)  	{  		.modalias = "adf702x",  		.max_speed_hz = 16000000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.chip_select = GPIO_PF10 + MAX_CTRL_CS,	/* GPIO controlled SSEL */ -		.controller_data = &adf7021_spi_chip_info,  		.platform_data = &adf7021_platform_data,  		.mode = SPI_MODE_0,  	},  #endif -#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_ADS7846)  	{  		.modalias = "ads7846",  		.max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */  		.bus_num = 0,  		.irq = IRQ_PF6,  		.chip_select = GPIO_PF10 + MAX_CTRL_CS,	/* GPIO controlled SSEL */ -		.controller_data = &ad7873_spi_chip_info,  		.platform_data = &ad7873_pdata,  		.mode = SPI_MODE_0,  	},  #endif -#if defined(CONFIG_AD7476) \ -	|| defined(CONFIG_AD7476_MODULE) +#if IS_ENABLED(CONFIG_AD7476)  	{  		.modalias = "ad7476", /* Name of spi_driver for this device */  		.max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */ @@ -1320,8 +1198,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADE7753) \ -	|| defined(CONFIG_ADE7753_MODULE) +#if IS_ENABLED(CONFIG_ADE7753)  	{  		.modalias = "ade7753",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1331,8 +1208,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_1,  	},  #endif -#if defined(CONFIG_ADE7754) \ -	|| defined(CONFIG_ADE7754_MODULE) +#if IS_ENABLED(CONFIG_ADE7754)  	{  		.modalias = "ade7754",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1342,8 +1218,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_1,  	},  #endif -#if defined(CONFIG_ADE7758) \ -	|| defined(CONFIG_ADE7758_MODULE) +#if IS_ENABLED(CONFIG_ADE7758)  	{  		.modalias = "ade7758",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1353,8 +1228,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_1,  	},  #endif -#if defined(CONFIG_ADE7759) \ -	|| defined(CONFIG_ADE7759_MODULE) +#if IS_ENABLED(CONFIG_ADE7759)  	{  		.modalias = "ade7759",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1364,8 +1238,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_1,  	},  #endif -#if defined(CONFIG_ADE7854_SPI) \ -	|| defined(CONFIG_ADE7854_SPI_MODULE) +#if IS_ENABLED(CONFIG_ADE7854_SPI)  	{  		.modalias = "ade7854",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1375,8 +1248,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADIS16060) \ -	|| defined(CONFIG_ADIS16060_MODULE) +#if IS_ENABLED(CONFIG_ADIS16060)  	{  		.modalias = "adis16060_r",  		.max_speed_hz = 2900000,     /* max spi clock (SCK) speed in HZ */ @@ -1394,8 +1266,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_1,  	},  #endif -#if defined(CONFIG_ADIS16130) \ -	|| defined(CONFIG_ADIS16130_MODULE) +#if IS_ENABLED(CONFIG_ADIS16130)  	{  		.modalias = "adis16130",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1405,8 +1276,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADIS16201) \ -	|| defined(CONFIG_ADIS16201_MODULE) +#if IS_ENABLED(CONFIG_ADIS16201)  	{  		.modalias = "adis16201",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1417,8 +1287,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16203) \ -	|| defined(CONFIG_ADIS16203_MODULE) +#if IS_ENABLED(CONFIG_ADIS16203)  	{  		.modalias = "adis16203",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1429,8 +1298,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16204) \ -	|| defined(CONFIG_ADIS16204_MODULE) +#if IS_ENABLED(CONFIG_ADIS16204)  	{  		.modalias = "adis16204",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1441,8 +1309,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16209) \ -	|| defined(CONFIG_ADIS16209_MODULE) +#if IS_ENABLED(CONFIG_ADIS16209)  	{  		.modalias = "adis16209",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1453,8 +1320,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16220) \ -	|| defined(CONFIG_ADIS16220_MODULE) +#if IS_ENABLED(CONFIG_ADIS16220)  	{  		.modalias = "adis16220",  		.max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */ @@ -1465,8 +1331,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16240) \ -	|| defined(CONFIG_ADIS16240_MODULE) +#if IS_ENABLED(CONFIG_ADIS16240)  	{  		.modalias = "adis16240",  		.max_speed_hz = 1500000,     /* max spi clock (SCK) speed in HZ */ @@ -1477,8 +1342,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16260) \ -	|| defined(CONFIG_ADIS16260_MODULE) +#if IS_ENABLED(CONFIG_ADIS16260)  	{  		.modalias = "adis16260",  		.max_speed_hz = 1500000,     /* max spi clock (SCK) speed in HZ */ @@ -1489,8 +1353,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16261) \ -	|| defined(CONFIG_ADIS16261_MODULE) +#if IS_ENABLED(CONFIG_ADIS16261)  	{  		.modalias = "adis16261",  		.max_speed_hz = 2500000,     /* max spi clock (SCK) speed in HZ */ @@ -1500,8 +1363,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.mode = SPI_MODE_3,  	},  #endif -#if defined(CONFIG_ADIS16300) \ -	|| defined(CONFIG_ADIS16300_MODULE) +#if IS_ENABLED(CONFIG_ADIS16300)  	{  		.modalias = "adis16300",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1512,8 +1374,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16350) \ -	|| defined(CONFIG_ADIS16350_MODULE) +#if IS_ENABLED(CONFIG_ADIS16350)  	{  		.modalias = "adis16364",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1524,8 +1385,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  		.irq = IRQ_PF4,  	},  #endif -#if defined(CONFIG_ADIS16400) \ -	|| defined(CONFIG_ADIS16400_MODULE) +#if IS_ENABLED(CONFIG_ADIS16400)  	{  		.modalias = "adis16400",  		.max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */ @@ -1537,7 +1397,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {  #endif  }; -#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX)  /* SPI controller data */  static struct bfin5xx_spi_master bfin_spi0_info = {  	.num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, @@ -1575,11 +1435,11 @@ static struct platform_device bfin_spi0_device = {  };  #endif  /* spi master and devices */ -#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)  /* SPORT SPI controller data */  static struct bfin5xx_spi_master bfin_sport_spi0_info = { -	.num_chipselect = 1, /* master only supports one device */ +	.num_chipselect = MAX_BLACKFIN_GPIOS,  	.enable_dma = 0,  /* master don't support DMA */  	.pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,  		P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0}, @@ -1609,7 +1469,7 @@ static struct platform_device bfin_sport_spi0_device = {  };  static struct bfin5xx_spi_master bfin_sport_spi1_info = { -	.num_chipselect = 1, /* master only supports one device */ +	.num_chipselect = MAX_BLACKFIN_GPIOS,  	.enable_dma = 0,  /* master don't support DMA */  	.pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,  		P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0}, @@ -1640,13 +1500,13 @@ static struct platform_device bfin_sport_spi1_device = {  #endif  /* sport spi master and devices */ -#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) +#if IS_ENABLED(CONFIG_FB_BF537_LQ035)  static struct platform_device bfin_fb_device = { -	.name = "bf537-lq035", +	.name = "bf537_lq035",  };  #endif -#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) +#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)  #include <asm/bfin-lq035q1.h>  static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { @@ -1675,7 +1535,70 @@ static struct platform_device bfin_lq035q1_device = {  };  #endif -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE) +#include <linux/videodev2.h> +#include <media/blackfin/bfin_capture.h> +#include <media/blackfin/ppi.h> + +static const unsigned short ppi_req[] = { +	P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3, +	P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7, +	P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, +	0, +}; + +static const struct ppi_info ppi_info = { +	.type = PPI_TYPE_PPI, +	.dma_ch = CH_PPI, +	.irq_err = IRQ_PPI_ERROR, +	.base = (void __iomem *)PPI_CONTROL, +	.pin_req = ppi_req, +}; + +#if IS_ENABLED(CONFIG_VIDEO_VS6624) +static struct v4l2_input vs6624_inputs[] = { +	{ +		.index = 0, +		.name = "Camera", +		.type = V4L2_INPUT_TYPE_CAMERA, +		.std = V4L2_STD_UNKNOWN, +	}, +}; + +static struct bcap_route vs6624_routes[] = { +	{ +		.input = 0, +		.output = 0, +	}, +}; + +static const unsigned vs6624_ce_pin = GPIO_PF10; + +static struct bfin_capture_config bfin_capture_data = { +	.card_name = "BF537", +	.inputs = vs6624_inputs, +	.num_inputs = ARRAY_SIZE(vs6624_inputs), +	.routes = vs6624_routes, +	.i2c_adapter_id = 0, +	.board_info = { +		.type = "vs6624", +		.addr = 0x10, +		.platform_data = (void *)&vs6624_ce_pin, +	}, +	.ppi_info = &ppi_info, +	.ppi_control = (PACK_EN | DLEN_8 | XFR_TYPE | 0x0020), +}; +#endif + +static struct platform_device bfin_capture_device = { +	.name = "bfin_capture", +	.dev = { +		.platform_data = &bfin_capture_data, +	}, +}; +#endif + +#if IS_ENABLED(CONFIG_SERIAL_BFIN)  #ifdef CONFIG_SERIAL_BFIN_UART0  static struct resource bfin_uart0_resources[] = {  	{ @@ -1684,8 +1607,13 @@ static struct resource bfin_uart0_resources[] = {  		.flags = IORESOURCE_MEM,  	},  	{ +		.start = IRQ_UART0_TX, +		.end = IRQ_UART0_TX, +		.flags = IORESOURCE_IRQ, +	}, +	{  		.start = IRQ_UART0_RX, -		.end = IRQ_UART0_RX+1, +		.end = IRQ_UART0_RX,  		.flags = IORESOURCE_IRQ,  	},  	{ @@ -1717,7 +1645,7 @@ static struct resource bfin_uart0_resources[] = {  #endif  }; -unsigned short bfin_uart0_peripherals[] = { +static unsigned short bfin_uart0_peripherals[] = {  	P_UART0_TX, P_UART0_RX, 0  }; @@ -1739,8 +1667,13 @@ static struct resource bfin_uart1_resources[] = {  		.flags = IORESOURCE_MEM,  	},  	{ +		.start = IRQ_UART1_TX, +		.end = IRQ_UART1_TX, +		.flags = IORESOURCE_IRQ, +	}, +	{  		.start = IRQ_UART1_RX, -		.end = IRQ_UART1_RX+1, +		.end = IRQ_UART1_RX,  		.flags = IORESOURCE_IRQ,  	},  	{ @@ -1760,7 +1693,7 @@ static struct resource bfin_uart1_resources[] = {  	},  }; -unsigned short bfin_uart1_peripherals[] = { +static unsigned short bfin_uart1_peripherals[] = {  	P_UART1_TX, P_UART1_RX, 0  }; @@ -1776,7 +1709,7 @@ static struct platform_device bfin_uart1_device = {  #endif  #endif -#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SIR)  #ifdef CONFIG_BFIN_SIR0  static struct resource bfin_sir0_resources[] = {  	{ @@ -1831,7 +1764,9 @@ static struct platform_device bfin_sir1_device = {  #endif  #endif -#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) +#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI) +static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; +  static struct resource bfin_twi0_resource[] = {  	[0] = {  		.start = TWI0_REGBASE, @@ -1850,10 +1785,13 @@ static struct platform_device i2c_bfin_twi_device = {  	.id = 0,  	.num_resources = ARRAY_SIZE(bfin_twi0_resource),  	.resource = bfin_twi0_resource, +	.dev = { +		.platform_data = &bfin_twi0_pins, +	},  };  #endif -#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_ADP5588)  static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {  	[0]	 = KEY_GRAVE,  	[1]	 = KEY_1, @@ -1938,7 +1876,7 @@ static struct adp5588_kpad_platform_data adp5588_kpad_data = {  };  #endif -#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) +#if IS_ENABLED(CONFIG_PMIC_ADP5520)  #include <linux/mfd/adp5520.h>  	/* @@ -2049,14 +1987,14 @@ static struct adp5520_platform_data adp5520_pdev_data = {  #endif -#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) +#if IS_ENABLED(CONFIG_GPIO_ADP5588)  static struct adp5588_gpio_platform_data adp5588_gpio_data = {  	.gpio_start = 50,  	.pullup_dis_mask = 0,  };  #endif -#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE) +#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)  #include <linux/i2c/adp8870.h>  static struct led_info adp8870_leds[] = {  	{ @@ -2108,7 +2046,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = {  };  #endif -#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) +#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)  #include <linux/i2c/adp8860.h>  static struct led_info adp8860_leds[] = {  	{ @@ -2150,7 +2088,7 @@ static struct adp8860_backlight_platform_data adp8860_pdata = {  };  #endif -#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_AD5398)  static struct regulator_consumer_supply ad5398_consumer = {  	.supply = "current",  }; @@ -2165,8 +2103,7 @@ static struct regulator_init_data ad5398_regulator_data = {  	.consumer_supplies     = &ad5398_consumer,  }; -#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ -	defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_VIRTUAL_CONSUMER)  static struct platform_device ad5398_virt_consumer_device = {  	.name = "reg-virt-consumer",  	.id = 0, @@ -2175,8 +2112,7 @@ static struct platform_device ad5398_virt_consumer_device = {  	},  };  #endif -#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ -	defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)  static struct regulator_bulk_data ad5398_bulk_data = {  	.supply = "current",  }; @@ -2197,14 +2133,14 @@ static struct platform_device ad5398_userspace_consumer_device = {  #endif  #endif -#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE) +#if IS_ENABLED(CONFIG_ADT7410)  /* INT bound temperature alarm event. line 1 */  static unsigned long adt7410_platform_data[2] = {  	IRQ_PG4, IRQF_TRIGGER_LOW,  };  #endif -#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE) +#if IS_ENABLED(CONFIG_ADT7316_I2C)  /* INT bound temperature alarm event. line 1 */  static unsigned long adt7316_i2c_data[2] = {  	IRQF_TRIGGER_LOW, /* interrupt flags */ @@ -2213,19 +2149,19 @@ static unsigned long adt7316_i2c_data[2] = {  #endif  static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE) +#ifdef CONFIG_SND_SOC_AD193X_I2C  	{  		I2C_BOARD_INFO("ad1937", 0x04),  	},  #endif -#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAV80X)  	{  		I2C_BOARD_INFO("adav803", 0x10),  	},  #endif -#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE) +#if IS_ENABLED(CONFIG_INPUT_AD714X_I2C)  	{  		I2C_BOARD_INFO("ad7142_captouch", 0x2C),  		.irq = IRQ_PG5, @@ -2233,83 +2169,55 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {  	},  #endif -#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE) +#if IS_ENABLED(CONFIG_AD7150)  	{  		I2C_BOARD_INFO("ad7150", 0x48),  		.irq = IRQ_PG5, /* fixme: use real interrupt number */  	},  #endif -#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE) +#if IS_ENABLED(CONFIG_AD7152)  	{  		I2C_BOARD_INFO("ad7152", 0x48),  	},  #endif -#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE) +#if IS_ENABLED(CONFIG_AD774X)  	{  		I2C_BOARD_INFO("ad774x", 0x48),  	},  #endif -#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE) -	{ -		I2C_BOARD_INFO("ad7414", 0x9), -		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW, -	}, -#endif - -#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE) -	{ -		I2C_BOARD_INFO("ad7417", 0xb), -		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW, -		.platform_data = (void *)GPIO_PF4, -	}, -#endif - -#if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE) +#if IS_ENABLED(CONFIG_ADE7854_I2C)  	{  		I2C_BOARD_INFO("ade7854", 0x38),  	},  #endif -#if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE) +#if IS_ENABLED(CONFIG_SENSORS_LM75)  	{  		I2C_BOARD_INFO("adt75", 0x9),  		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW,  	},  #endif -#if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE) -	{ -		I2C_BOARD_INFO("adt7408", 0x18), -		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW, -	}, -#endif - -#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE) +#if IS_ENABLED(CONFIG_ADT7410)  	{  		I2C_BOARD_INFO("adt7410", 0x48),  		/* CT critical temperature event. line 0 */  		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW,  		.platform_data = (void *)&adt7410_platform_data,  	},  #endif -#if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE) +#if IS_ENABLED(CONFIG_AD7291)  	{  		I2C_BOARD_INFO("ad7291", 0x20),  		.irq = IRQ_PG5, -		.irq_flags = IRQF_TRIGGER_LOW,  	},  #endif -#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE) +#if IS_ENABLED(CONFIG_ADT7316_I2C)  	{  		I2C_BOARD_INFO("adt7316", 0x48),  		.irq = IRQ_PG6, @@ -2317,117 +2225,128 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {  	},  #endif -#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) +#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)  	{  		I2C_BOARD_INFO("pcf8574_lcd", 0x22),  	},  #endif -#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) +#if IS_ENABLED(CONFIG_INPUT_PCF8574)  	{  		I2C_BOARD_INFO("pcf8574_keypad", 0x27),  		.irq = IRQ_PG6,  	},  #endif -#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) +#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_I2C)  	{  		I2C_BOARD_INFO("ad7879", 0x2F),  		.irq = IRQ_PG5,  		.platform_data = (void *)&bfin_ad7879_ts_info,  	},  #endif -#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_ADP5588)  	{  		I2C_BOARD_INFO("adp5588-keys", 0x34),  		.irq = IRQ_PG0,  		.platform_data = (void *)&adp5588_kpad_data,  	},  #endif -#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) +#if IS_ENABLED(CONFIG_PMIC_ADP5520)  	{  		I2C_BOARD_INFO("pmic-adp5520", 0x32),  		.irq = IRQ_PG0,  		.platform_data = (void *)&adp5520_pdev_data,  	},  #endif -#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) +#if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)  	{  		I2C_BOARD_INFO("adxl34x", 0x53),  		.irq = IRQ_PG3,  		.platform_data = (void *)&adxl34x_info,  	},  #endif -#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) +#if IS_ENABLED(CONFIG_GPIO_ADP5588)  	{  		I2C_BOARD_INFO("adp5588-gpio", 0x34),  		.platform_data = (void *)&adp5588_gpio_data,  	},  #endif -#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) +#if IS_ENABLED(CONFIG_FB_BFIN_7393)  	{  		I2C_BOARD_INFO("bfin-adv7393", 0x2B),  	},  #endif -#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) +#if IS_ENABLED(CONFIG_FB_BF537_LQ035)  	{  		I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),  	},  #endif -#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE) +#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)  	{  		I2C_BOARD_INFO("adp8870", 0x2B),  		.platform_data = (void *)&adp8870_pdata,  	},  #endif -#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAU1371)  	{  		I2C_BOARD_INFO("adau1371", 0x1A),  	},  #endif -#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAU1761)  	{  		I2C_BOARD_INFO("adau1761", 0x38),  	},  #endif -#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAU1361)  	{  		I2C_BOARD_INFO("adau1361", 0x38),  	},  #endif -#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAU1701) +	{ +		I2C_BOARD_INFO("adau1701", 0x34), +	}, +#endif +#if IS_ENABLED(CONFIG_AD525X_DPOT)  	{  		I2C_BOARD_INFO("ad5258", 0x18),  	},  #endif -#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)  	{  		I2C_BOARD_INFO("ssm2602", 0x1b),  	},  #endif -#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_AD5398)  	{  		I2C_BOARD_INFO("ad5398", 0xC),  		.platform_data = (void *)&ad5398_regulator_data,  	},  #endif -#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) +#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)  	{  		I2C_BOARD_INFO("adp8860", 0x2A),  		.platform_data = (void *)&adp8860_pdata,  	},  #endif -#if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_ADAU1373)  	{  		I2C_BOARD_INFO("adau1373", 0x1A),  	},  #endif -#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) +#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)  	{  		I2C_BOARD_INFO("ad5252", 0x2e),  	},  #endif  }; - -#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) \ +|| IS_ENABLED(CONFIG_BFIN_SPORT) +unsigned short bfin_sport0_peripherals[] = { +	P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, +	P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 +}; +#endif +#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)  #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART  static struct resource bfin_sport0_uart_resources[] = {  	{ @@ -2447,11 +2366,6 @@ static struct resource bfin_sport0_uart_resources[] = {  	},  }; -unsigned short bfin_sport0_peripherals[] = { -	P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, -	P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 -}; -  static struct platform_device bfin_sport0_uart_device = {  	.name = "bfin-sport-uart",  	.id = 0, @@ -2481,9 +2395,9 @@ static struct resource bfin_sport1_uart_resources[] = {  	},  }; -unsigned short bfin_sport1_peripherals[] = { +static unsigned short bfin_sport1_peripherals[] = {  	P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, -	P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 +	P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0  };  static struct platform_device bfin_sport1_uart_device = { @@ -2497,8 +2411,50 @@ static struct platform_device bfin_sport1_uart_device = {  };  #endif  #endif - -#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SPORT) +static struct resource bfin_sport0_resources[] = { +	{ +		.start = SPORT0_TCR1, +		.end = SPORT0_MRCS3+4, +		.flags = IORESOURCE_MEM, +	}, +	{ +		.start = IRQ_SPORT0_RX, +		.end = IRQ_SPORT0_RX+1, +		.flags = IORESOURCE_IRQ, +	}, +	{ +		.start = IRQ_SPORT0_TX, +		.end = IRQ_SPORT0_TX+1, +		.flags = IORESOURCE_IRQ, +	}, +	{ +		.start = IRQ_SPORT0_ERROR, +		.end = IRQ_SPORT0_ERROR, +		.flags = IORESOURCE_IRQ, +	}, +	{ +		.start = CH_SPORT0_TX, +		.end = CH_SPORT0_TX, +		.flags = IORESOURCE_DMA, +	}, +	{ +		.start = CH_SPORT0_RX, +		.end = CH_SPORT0_RX, +		.flags = IORESOURCE_DMA, +	}, +}; +static struct platform_device bfin_sport0_device = { +	.name = "bfin_sport_raw", +	.id = 0, +	.num_resources = ARRAY_SIZE(bfin_sport0_resources), +	.resource = bfin_sport0_resources, +	.dev = { +		.platform_data = &bfin_sport0_peripherals, /* Passed to driver */ +	}, +}; +#endif +#if IS_ENABLED(CONFIG_PATA_PLATFORM)  #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE  /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */ @@ -2506,7 +2462,7 @@ static struct platform_device bfin_sport1_uart_device = {  #define PATA_INT	IRQ_PF5  static struct pata_platform_info bfin_pata_platform_data = {  	.ioport_shift = 1, -	.irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED, +	.irq_flags = IRQF_TRIGGER_HIGH,  };  static struct resource bfin_pata_resources[] = { @@ -2530,7 +2486,7 @@ static struct resource bfin_pata_resources[] = {  static struct pata_platform_info bfin_pata_platform_data = {  	.ioport_shift = 0,  }; -/* CompactFlash Storage Card Memory Mapped Adressing +/* CompactFlash Storage Card Memory Mapped Addressing   * /REG = A11 = 1   */  static struct resource bfin_pata_resources[] = { @@ -2585,31 +2541,138 @@ static struct platform_device bfin_dpmc = {  	},  }; -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) -static struct platform_device bfin_i2s = { -	.name = "bfin-i2s", -	.id = CONFIG_SND_BF5XX_SPORT_NUM, -	/* TODO: add platform data here */ +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \ +	IS_ENABLED(CONFIG_SND_BF5XX_AC97) + +#define SPORT_REQ(x) \ +	[x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ +		P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} + +static const u16 bfin_snd_pin[][7] = { +	SPORT_REQ(0), +	SPORT_REQ(1), +}; + +static struct bfin_snd_platform_data bfin_snd_data[] = { +	{ +		.pin_req = &bfin_snd_pin[0][0], +	}, +	{ +		.pin_req = &bfin_snd_pin[1][0], +	}, +}; + +#define BFIN_SND_RES(x) \ +	[x] = { \ +		{ \ +			.start = SPORT##x##_TCR1, \ +			.end = SPORT##x##_TCR1, \ +			.flags = IORESOURCE_MEM \ +		}, \ +		{ \ +			.start = CH_SPORT##x##_RX, \ +			.end = CH_SPORT##x##_RX, \ +			.flags = IORESOURCE_DMA, \ +		}, \ +		{ \ +			.start = CH_SPORT##x##_TX, \ +			.end = CH_SPORT##x##_TX, \ +			.flags = IORESOURCE_DMA, \ +		}, \ +		{ \ +			.start = IRQ_SPORT##x##_ERROR, \ +			.end = IRQ_SPORT##x##_ERROR, \ +			.flags = IORESOURCE_IRQ, \ +		} \ +	} + +static struct resource bfin_snd_resources[][4] = { +	BFIN_SND_RES(0), +	BFIN_SND_RES(1), +}; +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) +static struct platform_device bfin_i2s_pcm = { +	.name = "bfin-i2s-pcm-audio", +	.id = -1, +}; +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) +static struct platform_device bfin_ac97_pcm = { +	.name = "bfin-ac97-pcm-audio", +	.id = -1, +}; +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) +static const char * const ad1836_link[] = { +	"bfin-i2s.0", +	"spi0.4", +}; +static struct platform_device bfin_ad1836_machine = { +	.name = "bfin-snd-ad1836", +	.id = -1, +	.dev = { +		.platform_data = (void *)ad1836_link, +	},  };  #endif -#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) -static struct platform_device bfin_tdm = { -	.name = "bfin-tdm", +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) +static const unsigned ad73311_gpio[] = { +	GPIO_PF4, +}; + +static struct platform_device bfin_ad73311_machine = { +	.name = "bfin-snd-ad73311", +	.id = 1, +	.dev = { +		.platform_data = (void *)ad73311_gpio, +	}, +}; +#endif + +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) +static struct platform_device bfin_ad73311_codec_device = { +	.name = "ad73311", +	.id = -1, +}; +#endif + +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) +static struct platform_device bfin_eval_adav801_device = { +	.name = "bfin-eval-adav801", +	.id = -1, +}; +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) +static struct platform_device bfin_i2s = { +	.name = "bfin-i2s",  	.id = CONFIG_SND_BF5XX_SPORT_NUM, -	/* TODO: add platform data here */ +	.num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), +	.resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], +	.dev = { +		.platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], +	},  };  #endif -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)  static struct platform_device bfin_ac97 = {  	.name = "bfin-ac97",  	.id = CONFIG_SND_BF5XX_SPORT_NUM, -	/* TODO: add platform data here */ +	.num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), +	.resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], +	.dev = { +		.platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], +	},  };  #endif -#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE)  #define REGULATOR_ADP122	"adp122"  #define REGULATOR_ADP122_UV	2500000 @@ -2647,8 +2710,7 @@ static struct platform_device adp_switch_device = {  	},  }; -#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ -	defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)  static struct regulator_bulk_data adp122_bulk_data = {  	.supply = REGULATOR_ADP122,  }; @@ -2669,8 +2731,7 @@ static struct platform_device adp122_userspace_consumer_device = {  #endif  #endif -#if defined(CONFIG_IIO_GPIO_TRIGGER) || \ -	defined(CONFIG_IIO_GPIO_TRIGGER_MODULE) +#if IS_ENABLED(CONFIG_IIO_GPIO_TRIGGER)  static struct resource iio_gpio_trigger_resources[] = {  	[0] = { @@ -2687,69 +2748,87 @@ static struct platform_device iio_gpio_trigger = {  };  #endif +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373) +static struct platform_device bf5xx_adau1373_device = { +	.name = "bfin-eval-adau1373", +}; +#endif + +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701) +static struct platform_device bf5xx_adau1701_device = { +	.name = "bfin-eval-adau1701", +}; +#endif +  static struct platform_device *stamp_devices[] __initdata = {  	&bfin_dpmc, - -#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SPORT) +	&bfin_sport0_device, +#endif +#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)  	&bfin_pcmcia_cf_device,  #endif -#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) +#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)  	&rtc_device,  #endif -#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_SL811_HCD)  	&sl811_hcd_device,  #endif -#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)  	&isp1362_hcd_device,  #endif -#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)  	&bfin_isp1760_device,  #endif -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X)  	&smc91x_device,  #endif -#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) +#if IS_ENABLED(CONFIG_DM9000)  	&dm9000_device,  #endif -#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) +#if IS_ENABLED(CONFIG_CAN_BFIN)  	&bfin_can_device,  #endif -#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) +#if IS_ENABLED(CONFIG_BFIN_MAC)  	&bfin_mii_bus,  	&bfin_mac_device,  #endif -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272)  	&net2272_bfin_device,  #endif -#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX)  	&bfin_spi0_device,  #endif -#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)  	&bfin_sport_spi0_device,  	&bfin_sport_spi1_device,  #endif -#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) +#if IS_ENABLED(CONFIG_FB_BF537_LQ035)  	&bfin_fb_device,  #endif -#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) +#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)  	&bfin_lq035q1_device,  #endif -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE) +	&bfin_capture_device, +#endif + +#if IS_ENABLED(CONFIG_SERIAL_BFIN)  #ifdef CONFIG_SERIAL_BFIN_UART0  	&bfin_uart0_device,  #endif @@ -2758,7 +2837,7 @@ static struct platform_device *stamp_devices[] __initdata = {  #endif  #endif -#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SIR)  #ifdef CONFIG_BFIN_SIR0  	&bfin_sir0_device,  #endif @@ -2767,11 +2846,11 @@ static struct platform_device *stamp_devices[] __initdata = {  #endif  #endif -#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) +#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)  	&i2c_bfin_twi_device,  #endif -#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)  #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART  	&bfin_sport0_uart_device,  #endif @@ -2780,58 +2859,101 @@ static struct platform_device *stamp_devices[] __initdata = {  #endif  #endif -#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) +#if IS_ENABLED(CONFIG_PATA_PLATFORM)  	&bfin_pata_device,  #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)  	&bfin_device_gpiokeys,  #endif -#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) +#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)  	&bfin_async_nand_device,  #endif -#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) +#if IS_ENABLED(CONFIG_MTD_PHYSMAP)  	&stamp_flash_device,  #endif -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) -	&bfin_i2s, +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) +	&bfin_i2s_pcm, +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) +	&bfin_ac97_pcm, +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) +	&bfin_ad1836_machine,  #endif -#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) -	&bfin_tdm, +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) +	&bfin_ad73311_machine,  #endif -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) +	&bfin_ad73311_codec_device, +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) +	&bfin_i2s, +#endif + +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)  	&bfin_ac97,  #endif -#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) -#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ -	defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE) + +#if IS_ENABLED(CONFIG_REGULATOR_AD5398) +#if IS_ENABLED(CONFIG_REGULATOR_VIRTUAL_CONSUMER)  	&ad5398_virt_consumer_device,  #endif -#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ -	defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)  	&ad5398_userspace_consumer_device,  #endif  #endif -#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE)  	&adp_switch_device, -#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ -	defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE) +#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)  	&adp122_userspace_consumer_device,  #endif  #endif -#if defined(CONFIG_IIO_GPIO_TRIGGER) || \ -	defined(CONFIG_IIO_GPIO_TRIGGER_MODULE) +#if IS_ENABLED(CONFIG_IIO_GPIO_TRIGGER)  	&iio_gpio_trigger,  #endif + +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373) +	&bf5xx_adau1373_device, +#endif + +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701) +	&bf5xx_adau1701_device, +#endif + +#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) +	&bfin_eval_adav801_device, +#endif  }; +static int __init net2272_init(void) +{ +#if IS_ENABLED(CONFIG_USB_NET2272) +	int ret; + +	ret = gpio_request(GPIO_PF6, "net2272"); +	if (ret) +		return ret; + +	/* Reset the USB chip */ +	gpio_direction_output(GPIO_PF6, 0); +	mdelay(2); +	gpio_set_value(GPIO_PF6, 1); +#endif + +	return 0; +} +  static int __init stamp_init(void)  {  	printk(KERN_INFO "%s(): registering device resources\n", __func__); @@ -2842,6 +2964,9 @@ static int __init stamp_init(void)  				ARRAY_SIZE(bfin_i2c_board_info));  	spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); +	if (net2272_init()) +		pr_warning("unable to configure net2272; it probably won't work\n"); +  	return 0;  } @@ -2886,9 +3011,10 @@ void native_machine_restart(char *cmd)   * Currently the MAC address is saved in Flash by U-Boot   */  #define FLASH_MAC	0x203f0000 -void bfin_get_ether_addr(char *addr) +int bfin_get_ether_addr(char *addr)  {  	*(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);  	*(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); +	return 0;  }  EXPORT_SYMBOL(bfin_get_ether_addr);  | 
