--- zzzz-none-000/linux-3.10.107/arch/blackfin/mach-bf533/boards/stamp.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/blackfin/mach-bf533/boards/stamp.c 2021-02-04 17:41:59.000000000 +0000 @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -14,9 +15,10 @@ #include #include #include -#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1362_HCD) #include #endif +#include #include #include #include @@ -30,7 +32,7 @@ */ const char bfin_board_name[] = "ADI BF533-STAMP"; -#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, @@ -40,7 +42,7 @@ /* * Driver needs to know address, irq and flag pin. */ -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) #include static struct smc91x_platdata smc91x_info = { @@ -73,7 +75,7 @@ }; #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, @@ -97,7 +99,7 @@ }; #endif -#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) +#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC) static struct mtd_partition stamp_partitions[] = { { .name = "bootloader(nor)", @@ -147,7 +149,7 @@ }; #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)", @@ -178,7 +180,7 @@ }; #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, irqreturn_t (*detect_int)(int, void *), void *data) @@ -206,7 +208,7 @@ #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 */ @@ -219,8 +221,7 @@ }, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ - defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) { .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ @@ -231,7 +232,7 @@ }, #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 */ @@ -239,7 +240,7 @@ .chip_select = 1, }, #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 */ @@ -252,7 +253,7 @@ #endif }; -#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX) /* SPI (0) */ static struct resource bfin_spi0_resource[] = { [0] = { @@ -290,7 +291,7 @@ }; #endif /* spi master and devices */ -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN) #ifdef CONFIG_SERIAL_BFIN_UART0 static struct resource bfin_uart0_resources[] = { { @@ -341,7 +342,7 @@ #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[] = { { @@ -370,7 +371,7 @@ #endif #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 static struct resource bfin_sport0_uart_resources[] = { { @@ -441,7 +442,51 @@ #endif #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_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_TX, + .end = IRQ_SPORT0_TX+1, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_SPORT0_RX, + .end = IRQ_SPORT0_RX+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, + }, +}; +#endif + +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO) #include #include @@ -464,7 +509,7 @@ }; #endif -#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) +#if IS_ENABLED(CONFIG_I2C_GPIO) #include static struct i2c_gpio_platform_data i2c_gpio_data = { @@ -485,29 +530,29 @@ #endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) +#if IS_ENABLED(CONFIG_JOYSTICK_AD7142) { I2C_BOARD_INFO("ad7142_joystick", 0x2C), .irq = 39, }, #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 = 39, }, #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_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) +#if IS_ENABLED(CONFIG_BFIN_TWI_LCD) { I2C_BOARD_INFO("ad5252", 0x2f), }, @@ -541,10 +586,8 @@ }, }; -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ - defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) \ - || defined(CONFIG_SND_BF5XX_AC97) || \ - defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \ + IS_ENABLED(CONFIG_SND_BF5XX_AC97) #include @@ -596,31 +639,23 @@ }; #endif -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) static struct platform_device bfin_i2s_pcm = { .name = "bfin-i2s-pcm-audio", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) -static struct platform_device bfin_tdm_pcm = { - .name = "bfin-tdm-pcm-audio", - .id = -1, -}; -#endif - -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) static struct platform_device bfin_ac97_pcm = { .name = "bfin-ac97-pcm-audio", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ - || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) static const char * const ad1836_link[] = { - "bfin-tdm.0", + "bfin-i2s.0", "spi0.4", }; static struct platform_device bfin_ad1836_machine = { @@ -632,8 +667,7 @@ }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ - defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) static const unsigned ad73311_gpio[] = { GPIO_PF4, }; @@ -647,22 +681,21 @@ }; #endif -#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) static struct platform_device bfin_ad73311_codec_device = { .name = "ad73311", .id = -1, }; #endif -#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD74111) static struct platform_device bfin_ad74111_codec_device = { .name = "ad74111", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ - defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) static struct platform_device bfin_i2s = { .name = "bfin-i2s", .id = CONFIG_SND_BF5XX_SPORT_NUM, @@ -675,22 +708,7 @@ }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_TDM) || \ - defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) -static struct platform_device bfin_tdm = { - .name = "bfin-tdm", - .id = CONFIG_SND_BF5XX_SPORT_NUM, - .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_SOC_AC97) || \ - defined(CONFIG_SND_BF5XX_SOC_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, @@ -707,36 +725,35 @@ &bfin_dpmc, -#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_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) &smc91x_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_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX) &bfin_spi0_device, #endif -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN) #ifdef CONFIG_SERIAL_BFIN_UART0 &bfin_uart0_device, #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 #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 @@ -745,67 +762,54 @@ #endif #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO) &bfin_device_gpiokeys, #endif -#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) +#if IS_ENABLED(CONFIG_I2C_GPIO) &i2c_gpio_device, #endif -#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) +#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC) &stamp_flash_device, #endif -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) &bfin_i2s_pcm, #endif -#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) - &bfin_tdm_pcm, -#endif - -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) &bfin_ac97_pcm, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ - defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) &bfin_ad1836_machine, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ - defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) &bfin_ad73311_machine, #endif -#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) &bfin_ad73311_codec_device, #endif -#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD74111) &bfin_ad74111_codec_device, #endif -#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ - defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) &bfin_i2s, #endif -#if defined(CONFIG_SND_BF5XX_SOC_TDM) || \ - defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) - &bfin_tdm, -#endif - -#if defined(CONFIG_SND_BF5XX_SOC_AC97) || \ - defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97) &bfin_ac97, #endif }; static int __init net2272_init(void) { -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272) int ret; /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */ @@ -851,7 +855,7 @@ if (ret < 0) return ret; -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) /* * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC. * the bfin-async-map driver takes care of flipping between