aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf518
diff options
context:
space:
mode:
authorSteven Miao <realmz6@gmail.com>2014-04-11 14:07:27 -0400
committerSteven Miao <realmz6@gmail.com>2014-04-11 20:48:01 -0400
commitc4a2c58d20953ff1080f50f705cdd952f6d301b2 (patch)
tree9e604fad91d728839cbbea1549248339729a1829 /arch/blackfin/mach-bf518
parentf8ef77d9389f9b52fe80de4f1b236af3391420b8 (diff)
blackfin: cleanup board files
using IS_ENABLED() macro instead of defined(CONFIG_XXX) || defined(CONFIG_XXX_MODULE) Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf518')
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c87
-rw-r--r--arch/blackfin/mach-bf518/boards/tcm-bf518.c64
2 files changed, 73 insertions, 78 deletions
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index f8047ca3b339..d022112927c2 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -36,7 +36,7 @@ const char bfin_board_name[] = "ADI BF518F-EZBRD";
36 * Driver needs to know address, irq and flag pin. 36 * Driver needs to know address, irq and flag pin.
37 */ 37 */
38 38
39#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 39#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
40static struct mtd_partition ezbrd_partitions[] = { 40static struct mtd_partition ezbrd_partitions[] = {
41 { 41 {
42 .name = "bootloader(nor)", 42 .name = "bootloader(nor)",
@@ -61,7 +61,7 @@ static struct physmap_flash_data ezbrd_flash_data = {
61 61
62static struct resource ezbrd_flash_resource = { 62static struct resource ezbrd_flash_resource = {
63 .start = 0x20000000, 63 .start = 0x20000000,
64#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 64#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
65 .end = 0x202fffff, 65 .end = 0x202fffff,
66#else 66#else
67 .end = 0x203fffff, 67 .end = 0x203fffff,
@@ -80,14 +80,14 @@ static struct platform_device ezbrd_flash_device = {
80}; 80};
81#endif 81#endif
82 82
83#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 83#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
84static struct platform_device rtc_device = { 84static struct platform_device rtc_device = {
85 .name = "rtc-bfin", 85 .name = "rtc-bfin",
86 .id = -1, 86 .id = -1,
87}; 87};
88#endif 88#endif
89 89
90#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 90#if IS_ENABLED(CONFIG_BFIN_MAC)
91#include <linux/bfin_mac.h> 91#include <linux/bfin_mac.h>
92static const unsigned short bfin_mac_peripherals[] = { 92static const unsigned short bfin_mac_peripherals[] = {
93 P_MII0_ETxD0, 93 P_MII0_ETxD0,
@@ -105,7 +105,7 @@ static const unsigned short bfin_mac_peripherals[] = {
105 105
106static struct bfin_phydev_platform_data bfin_phydev_data[] = { 106static struct bfin_phydev_platform_data bfin_phydev_data[] = {
107 { 107 {
108#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 108#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
109 .addr = 3, 109 .addr = 3,
110#else 110#else
111 .addr = 1, 111 .addr = 1,
@@ -119,7 +119,7 @@ static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
119 .phydev_data = bfin_phydev_data, 119 .phydev_data = bfin_phydev_data,
120 .phy_mode = PHY_INTERFACE_MODE_MII, 120 .phy_mode = PHY_INTERFACE_MODE_MII,
121 .mac_peripherals = bfin_mac_peripherals, 121 .mac_peripherals = bfin_mac_peripherals,
122#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 122#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
123 .phy_mask = 0xfff7, /* Only probe the port phy connect to the on chip MAC */ 123 .phy_mask = 0xfff7, /* Only probe the port phy connect to the on chip MAC */
124#endif 124#endif
125 .vlan1_mask = 1, 125 .vlan1_mask = 1,
@@ -140,7 +140,7 @@ static struct platform_device bfin_mac_device = {
140 } 140 }
141}; 141};
142 142
143#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 143#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
144static struct dsa_chip_data ksz8893m_switch_chip_data = { 144static struct dsa_chip_data ksz8893m_switch_chip_data = {
145 .mii_bus = &bfin_mii_bus.dev, 145 .mii_bus = &bfin_mii_bus.dev,
146 .port_names = { 146 .port_names = {
@@ -165,8 +165,7 @@ static struct platform_device ksz8893m_switch_device = {
165#endif 165#endif
166#endif 166#endif
167 167
168#if defined(CONFIG_MTD_M25P80) \ 168#if IS_ENABLED(CONFIG_MTD_M25P80)
169 || defined(CONFIG_MTD_M25P80_MODULE)
170static struct mtd_partition bfin_spi_flash_partitions[] = { 169static struct mtd_partition bfin_spi_flash_partitions[] = {
171 { 170 {
172 .name = "bootloader(spi)", 171 .name = "bootloader(spi)",
@@ -193,13 +192,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
193}; 192};
194#endif 193#endif
195 194
196#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 195#if IS_ENABLED(CONFIG_MMC_SPI)
197static struct bfin5xx_spi_chip mmc_spi_chip_info = { 196static struct bfin5xx_spi_chip mmc_spi_chip_info = {
198 .enable_dma = 0, 197 .enable_dma = 0,
199}; 198};
200#endif 199#endif
201 200
202#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 201#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
203static const struct ad7877_platform_data bfin_ad7877_ts_info = { 202static const struct ad7877_platform_data bfin_ad7877_ts_info = {
204 .model = 7877, 203 .model = 7877,
205 .vref_delay_usecs = 50, /* internal, no capacitor */ 204 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -216,8 +215,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
216#endif 215#endif
217 216
218static struct spi_board_info bfin_spi_board_info[] __initdata = { 217static struct spi_board_info bfin_spi_board_info[] __initdata = {
219#if defined(CONFIG_MTD_M25P80) \ 218#if IS_ENABLED(CONFIG_MTD_M25P80)
220 || defined(CONFIG_MTD_M25P80_MODULE)
221 { 219 {
222 /* the modalias must be the same as spi device driver name */ 220 /* the modalias must be the same as spi device driver name */
223 .modalias = "m25p80", /* Name of spi_driver for this device */ 221 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -230,9 +228,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
230 }, 228 },
231#endif 229#endif
232 230
233#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 231#if IS_ENABLED(CONFIG_BFIN_MAC)
234#if defined(CONFIG_NET_DSA_KSZ8893M) \ 232#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
235 || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
236 { 233 {
237 .modalias = "ksz8893m", 234 .modalias = "ksz8893m",
238 .max_speed_hz = 5000000, 235 .max_speed_hz = 5000000,
@@ -244,7 +241,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
244#endif 241#endif
245#endif 242#endif
246 243
247#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 244#if IS_ENABLED(CONFIG_MMC_SPI)
248 { 245 {
249 .modalias = "mmc_spi", 246 .modalias = "mmc_spi",
250 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 247 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
@@ -254,7 +251,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
254 .mode = SPI_MODE_3, 251 .mode = SPI_MODE_3,
255 }, 252 },
256#endif 253#endif
257#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 254#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
258 { 255 {
259 .modalias = "ad7877", 256 .modalias = "ad7877",
260 .platform_data = &bfin_ad7877_ts_info, 257 .platform_data = &bfin_ad7877_ts_info,
@@ -264,7 +261,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
264 .chip_select = 2, 261 .chip_select = 2,
265 }, 262 },
266#endif 263#endif
267#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 264#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
268 && defined(CONFIG_SND_SOC_WM8731_SPI) 265 && defined(CONFIG_SND_SOC_WM8731_SPI)
269 { 266 {
270 .modalias = "wm8731", 267 .modalias = "wm8731",
@@ -274,7 +271,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
274 .mode = SPI_MODE_0, 271 .mode = SPI_MODE_0,
275 }, 272 },
276#endif 273#endif
277#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 274#if IS_ENABLED(CONFIG_SPI_SPIDEV)
278 { 275 {
279 .modalias = "spidev", 276 .modalias = "spidev",
280 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 277 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -282,7 +279,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
282 .chip_select = 1, 279 .chip_select = 1,
283 }, 280 },
284#endif 281#endif
285#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 282#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
286 { 283 {
287 .modalias = "bfin-lq035q1-spi", 284 .modalias = "bfin-lq035q1-spi",
288 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 285 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -294,7 +291,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
294}; 291};
295 292
296/* SPI controller data */ 293/* SPI controller data */
297#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 294#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
298/* SPI (0) */ 295/* SPI (0) */
299static struct bfin5xx_spi_master bfin_spi0_info = { 296static struct bfin5xx_spi_master bfin_spi0_info = {
300 .num_chipselect = 6, 297 .num_chipselect = 6,
@@ -366,7 +363,7 @@ static struct platform_device bfin_spi1_device = {
366}; 363};
367#endif /* spi master and devices */ 364#endif /* spi master and devices */
368 365
369#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 366#if IS_ENABLED(CONFIG_SERIAL_BFIN)
370#ifdef CONFIG_SERIAL_BFIN_UART0 367#ifdef CONFIG_SERIAL_BFIN_UART0
371static struct resource bfin_uart0_resources[] = { 368static struct resource bfin_uart0_resources[] = {
372 { 369 {
@@ -465,7 +462,7 @@ static struct platform_device bfin_uart1_device = {
465#endif 462#endif
466#endif 463#endif
467 464
468#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 465#if IS_ENABLED(CONFIG_BFIN_SIR)
469#ifdef CONFIG_BFIN_SIR0 466#ifdef CONFIG_BFIN_SIR0
470static struct resource bfin_sir0_resources[] = { 467static struct resource bfin_sir0_resources[] = {
471 { 468 {
@@ -520,7 +517,7 @@ static struct platform_device bfin_sir1_device = {
520#endif 517#endif
521#endif 518#endif
522 519
523#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 520#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
524static struct platform_device bfin_i2s = { 521static struct platform_device bfin_i2s = {
525 .name = "bfin-i2s", 522 .name = "bfin-i2s",
526 .id = CONFIG_SND_BF5XX_SPORT_NUM, 523 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -528,7 +525,7 @@ static struct platform_device bfin_i2s = {
528}; 525};
529#endif 526#endif
530 527
531#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 528#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
532static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 529static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
533 530
534static struct resource bfin_twi0_resource[] = { 531static struct resource bfin_twi0_resource[] = {
@@ -556,25 +553,25 @@ static struct platform_device i2c_bfin_twi_device = {
556#endif 553#endif
557 554
558static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 555static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
559#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 556#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
560 { 557 {
561 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 558 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
562 }, 559 },
563#endif 560#endif
564#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 561#if IS_ENABLED(CONFIG_INPUT_PCF8574)
565 { 562 {
566 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 563 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
567 .irq = IRQ_PF8, 564 .irq = IRQ_PF8,
568 }, 565 },
569#endif 566#endif
570#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 567#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
571 { 568 {
572 I2C_BOARD_INFO("ssm2602", 0x1b), 569 I2C_BOARD_INFO("ssm2602", 0x1b),
573 }, 570 },
574#endif 571#endif
575}; 572};
576 573
577#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 574#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
578#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 575#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
579static struct resource bfin_sport0_uart_resources[] = { 576static struct resource bfin_sport0_uart_resources[] = {
580 { 577 {
@@ -645,7 +642,7 @@ static struct platform_device bfin_sport1_uart_device = {
645#endif 642#endif
646#endif 643#endif
647 644
648#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 645#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
649#include <linux/input.h> 646#include <linux/input.h>
650#include <linux/gpio_keys.h> 647#include <linux/gpio_keys.h>
651 648
@@ -667,7 +664,7 @@ static struct platform_device bfin_device_gpiokeys = {
667}; 664};
668#endif 665#endif
669 666
670#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 667#if IS_ENABLED(CONFIG_SDH_BFIN)
671 668
672static struct bfin_sd_host bfin_sdh_data = { 669static struct bfin_sd_host bfin_sdh_data = {
673 .dma_chan = CH_RSI, 670 .dma_chan = CH_RSI,
@@ -710,24 +707,24 @@ static struct platform_device *stamp_devices[] __initdata = {
710 707
711 &bfin_dpmc, 708 &bfin_dpmc,
712 709
713#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 710#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
714 &rtc_device, 711 &rtc_device,
715#endif 712#endif
716 713
717#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 714#if IS_ENABLED(CONFIG_BFIN_MAC)
718 &bfin_mii_bus, 715 &bfin_mii_bus,
719 &bfin_mac_device, 716 &bfin_mac_device,
720#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 717#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
721 &ksz8893m_switch_device, 718 &ksz8893m_switch_device,
722#endif 719#endif
723#endif 720#endif
724 721
725#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 722#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
726 &bfin_spi0_device, 723 &bfin_spi0_device,
727 &bfin_spi1_device, 724 &bfin_spi1_device,
728#endif 725#endif
729 726
730#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 727#if IS_ENABLED(CONFIG_SERIAL_BFIN)
731#ifdef CONFIG_SERIAL_BFIN_UART0 728#ifdef CONFIG_SERIAL_BFIN_UART0
732 &bfin_uart0_device, 729 &bfin_uart0_device,
733#endif 730#endif
@@ -736,7 +733,7 @@ static struct platform_device *stamp_devices[] __initdata = {
736#endif 733#endif
737#endif 734#endif
738 735
739#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 736#if IS_ENABLED(CONFIG_BFIN_SIR)
740#ifdef CONFIG_BFIN_SIR0 737#ifdef CONFIG_BFIN_SIR0
741 &bfin_sir0_device, 738 &bfin_sir0_device,
742#endif 739#endif
@@ -745,15 +742,15 @@ static struct platform_device *stamp_devices[] __initdata = {
745#endif 742#endif
746#endif 743#endif
747 744
748#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 745#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
749 &i2c_bfin_twi_device, 746 &i2c_bfin_twi_device,
750#endif 747#endif
751 748
752#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 749#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
753 &bfin_i2s, 750 &bfin_i2s,
754#endif 751#endif
755 752
756#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 753#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
757#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 754#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
758 &bfin_sport0_uart_device, 755 &bfin_sport0_uart_device,
759#endif 756#endif
@@ -762,15 +759,15 @@ static struct platform_device *stamp_devices[] __initdata = {
762#endif 759#endif
763#endif 760#endif
764 761
765#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 762#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
766 &bfin_device_gpiokeys, 763 &bfin_device_gpiokeys,
767#endif 764#endif
768 765
769#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 766#if IS_ENABLED(CONFIG_SDH_BFIN)
770 &bf51x_sdh_device, 767 &bf51x_sdh_device,
771#endif 768#endif
772 769
773#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 770#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
774 &ezbrd_flash_device, 771 &ezbrd_flash_device,
775#endif 772#endif
776}; 773};
@@ -784,7 +781,7 @@ static int __init ezbrd_init(void)
784 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 781 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
785 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */ 782 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */
786 peripheral_request(P_AMS2, "ParaFlash"); 783 peripheral_request(P_AMS2, "ParaFlash");
787#if !defined(CONFIG_SPI_BFIN5XX) && !defined(CONFIG_SPI_BFIN5XX_MODULE) 784#if !IS_ENABLED(CONFIG_SPI_BFIN5XX)
788 peripheral_request(P_AMS3, "ParaFlash"); 785 peripheral_request(P_AMS3, "ParaFlash");
789#endif 786#endif
790 return 0; 787 return 0;
diff --git a/arch/blackfin/mach-bf518/boards/tcm-bf518.c b/arch/blackfin/mach-bf518/boards/tcm-bf518.c
index 0bedc737566b..240d5cb1f02c 100644
--- a/arch/blackfin/mach-bf518/boards/tcm-bf518.c
+++ b/arch/blackfin/mach-bf518/boards/tcm-bf518.c
@@ -36,7 +36,7 @@ const char bfin_board_name[] = "Bluetechnix TCM-BF518";
36 * Driver needs to know address, irq and flag pin. 36 * Driver needs to know address, irq and flag pin.
37 */ 37 */
38 38
39#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 39#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
40static struct mtd_partition tcm_partitions[] = { 40static struct mtd_partition tcm_partitions[] = {
41 { 41 {
42 .name = "bootloader(nor)", 42 .name = "bootloader(nor)",
@@ -73,14 +73,14 @@ static struct platform_device tcm_flash_device = {
73}; 73};
74#endif 74#endif
75 75
76#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 76#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
77static struct platform_device rtc_device = { 77static struct platform_device rtc_device = {
78 .name = "rtc-bfin", 78 .name = "rtc-bfin",
79 .id = -1, 79 .id = -1,
80}; 80};
81#endif 81#endif
82 82
83#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 83#if IS_ENABLED(CONFIG_BFIN_MAC)
84#include <linux/bfin_mac.h> 84#include <linux/bfin_mac.h>
85static const unsigned short bfin_mac_peripherals[] = P_MII0; 85static const unsigned short bfin_mac_peripherals[] = P_MII0;
86 86
@@ -113,8 +113,7 @@ static struct platform_device bfin_mac_device = {
113}; 113};
114#endif 114#endif
115 115
116#if defined(CONFIG_MTD_M25P80) \ 116#if IS_ENABLED(CONFIG_MTD_M25P80)
117 || defined(CONFIG_MTD_M25P80_MODULE)
118static struct mtd_partition bfin_spi_flash_partitions[] = { 117static struct mtd_partition bfin_spi_flash_partitions[] = {
119 { 118 {
120 .name = "bootloader(spi)", 119 .name = "bootloader(spi)",
@@ -141,13 +140,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
141}; 140};
142#endif 141#endif
143 142
144#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 143#if IS_ENABLED(CONFIG_MMC_SPI)
145static struct bfin5xx_spi_chip mmc_spi_chip_info = { 144static struct bfin5xx_spi_chip mmc_spi_chip_info = {
146 .enable_dma = 0, 145 .enable_dma = 0,
147}; 146};
148#endif 147#endif
149 148
150#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 149#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
151static const struct ad7877_platform_data bfin_ad7877_ts_info = { 150static const struct ad7877_platform_data bfin_ad7877_ts_info = {
152 .model = 7877, 151 .model = 7877,
153 .vref_delay_usecs = 50, /* internal, no capacitor */ 152 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -164,8 +163,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
164#endif 163#endif
165 164
166static struct spi_board_info bfin_spi_board_info[] __initdata = { 165static struct spi_board_info bfin_spi_board_info[] __initdata = {
167#if defined(CONFIG_MTD_M25P80) \ 166#if IS_ENABLED(CONFIG_MTD_M25P80)
168 || defined(CONFIG_MTD_M25P80_MODULE)
169 { 167 {
170 /* the modalias must be the same as spi device driver name */ 168 /* the modalias must be the same as spi device driver name */
171 .modalias = "m25p80", /* Name of spi_driver for this device */ 169 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -178,7 +176,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
178 }, 176 },
179#endif 177#endif
180 178
181#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 179#if IS_ENABLED(CONFIG_MMC_SPI)
182 { 180 {
183 .modalias = "mmc_spi", 181 .modalias = "mmc_spi",
184 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 182 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -188,7 +186,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
188 .mode = SPI_MODE_3, 186 .mode = SPI_MODE_3,
189 }, 187 },
190#endif 188#endif
191#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 189#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
192 { 190 {
193 .modalias = "ad7877", 191 .modalias = "ad7877",
194 .platform_data = &bfin_ad7877_ts_info, 192 .platform_data = &bfin_ad7877_ts_info,
@@ -198,7 +196,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
198 .chip_select = 2, 196 .chip_select = 2,
199 }, 197 },
200#endif 198#endif
201#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 199#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
202 && defined(CONFIG_SND_SOC_WM8731_SPI) 200 && defined(CONFIG_SND_SOC_WM8731_SPI)
203 { 201 {
204 .modalias = "wm8731", 202 .modalias = "wm8731",
@@ -208,7 +206,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
208 .mode = SPI_MODE_0, 206 .mode = SPI_MODE_0,
209 }, 207 },
210#endif 208#endif
211#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 209#if IS_ENABLED(CONFIG_SPI_SPIDEV)
212 { 210 {
213 .modalias = "spidev", 211 .modalias = "spidev",
214 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 212 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -216,7 +214,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
216 .chip_select = 1, 214 .chip_select = 1,
217 }, 215 },
218#endif 216#endif
219#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 217#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
220 { 218 {
221 .modalias = "bfin-lq035q1-spi", 219 .modalias = "bfin-lq035q1-spi",
222 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 220 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -228,7 +226,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
228}; 226};
229 227
230/* SPI controller data */ 228/* SPI controller data */
231#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 229#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
232/* SPI (0) */ 230/* SPI (0) */
233static struct bfin5xx_spi_master bfin_spi0_info = { 231static struct bfin5xx_spi_master bfin_spi0_info = {
234 .num_chipselect = 6, 232 .num_chipselect = 6,
@@ -300,7 +298,7 @@ static struct platform_device bfin_spi1_device = {
300}; 298};
301#endif /* spi master and devices */ 299#endif /* spi master and devices */
302 300
303#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 301#if IS_ENABLED(CONFIG_SERIAL_BFIN)
304#ifdef CONFIG_SERIAL_BFIN_UART0 302#ifdef CONFIG_SERIAL_BFIN_UART0
305static struct resource bfin_uart0_resources[] = { 303static struct resource bfin_uart0_resources[] = {
306 { 304 {
@@ -399,7 +397,7 @@ static struct platform_device bfin_uart1_device = {
399#endif 397#endif
400#endif 398#endif
401 399
402#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 400#if IS_ENABLED(CONFIG_BFIN_SIR)
403#ifdef CONFIG_BFIN_SIR0 401#ifdef CONFIG_BFIN_SIR0
404static struct resource bfin_sir0_resources[] = { 402static struct resource bfin_sir0_resources[] = {
405 { 403 {
@@ -454,7 +452,7 @@ static struct platform_device bfin_sir1_device = {
454#endif 452#endif
455#endif 453#endif
456 454
457#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 455#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
458static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 456static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
459 457
460static struct resource bfin_twi0_resource[] = { 458static struct resource bfin_twi0_resource[] = {
@@ -482,12 +480,12 @@ static struct platform_device i2c_bfin_twi_device = {
482#endif 480#endif
483 481
484static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 482static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
485#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 483#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
486 { 484 {
487 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 485 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
488 }, 486 },
489#endif 487#endif
490#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 488#if IS_ENABLED(CONFIG_INPUT_PCF8574)
491 { 489 {
492 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 490 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
493 .irq = IRQ_PF8, 491 .irq = IRQ_PF8,
@@ -495,7 +493,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
495#endif 493#endif
496}; 494};
497 495
498#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 496#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
499#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 497#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
500static struct resource bfin_sport0_uart_resources[] = { 498static struct resource bfin_sport0_uart_resources[] = {
501 { 499 {
@@ -566,7 +564,7 @@ static struct platform_device bfin_sport1_uart_device = {
566#endif 564#endif
567#endif 565#endif
568 566
569#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 567#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
570#include <linux/input.h> 568#include <linux/input.h>
571#include <linux/gpio_keys.h> 569#include <linux/gpio_keys.h>
572 570
@@ -588,7 +586,7 @@ static struct platform_device bfin_device_gpiokeys = {
588}; 586};
589#endif 587#endif
590 588
591#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 589#if IS_ENABLED(CONFIG_SDH_BFIN)
592 590
593static struct bfin_sd_host bfin_sdh_data = { 591static struct bfin_sd_host bfin_sdh_data = {
594 .dma_chan = CH_RSI, 592 .dma_chan = CH_RSI,
@@ -631,21 +629,21 @@ static struct platform_device *tcm_devices[] __initdata = {
631 629
632 &bfin_dpmc, 630 &bfin_dpmc,
633 631
634#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 632#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
635 &rtc_device, 633 &rtc_device,
636#endif 634#endif
637 635
638#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 636#if IS_ENABLED(CONFIG_BFIN_MAC)
639 &bfin_mii_bus, 637 &bfin_mii_bus,
640 &bfin_mac_device, 638 &bfin_mac_device,
641#endif 639#endif
642 640
643#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 641#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
644 &bfin_spi0_device, 642 &bfin_spi0_device,
645 &bfin_spi1_device, 643 &bfin_spi1_device,
646#endif 644#endif
647 645
648#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 646#if IS_ENABLED(CONFIG_SERIAL_BFIN)
649#ifdef CONFIG_SERIAL_BFIN_UART0 647#ifdef CONFIG_SERIAL_BFIN_UART0
650 &bfin_uart0_device, 648 &bfin_uart0_device,
651#endif 649#endif
@@ -654,7 +652,7 @@ static struct platform_device *tcm_devices[] __initdata = {
654#endif 652#endif
655#endif 653#endif
656 654
657#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 655#if IS_ENABLED(CONFIG_BFIN_SIR)
658#ifdef CONFIG_BFIN_SIR0 656#ifdef CONFIG_BFIN_SIR0
659 &bfin_sir0_device, 657 &bfin_sir0_device,
660#endif 658#endif
@@ -663,11 +661,11 @@ static struct platform_device *tcm_devices[] __initdata = {
663#endif 661#endif
664#endif 662#endif
665 663
666#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 664#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
667 &i2c_bfin_twi_device, 665 &i2c_bfin_twi_device,
668#endif 666#endif
669 667
670#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 668#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
671#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 669#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
672 &bfin_sport0_uart_device, 670 &bfin_sport0_uart_device,
673#endif 671#endif
@@ -676,15 +674,15 @@ static struct platform_device *tcm_devices[] __initdata = {
676#endif 674#endif
677#endif 675#endif
678 676
679#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 677#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
680 &bfin_device_gpiokeys, 678 &bfin_device_gpiokeys,
681#endif 679#endif
682 680
683#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 681#if IS_ENABLED(CONFIG_SDH_BFIN)
684 &bf51x_sdh_device, 682 &bf51x_sdh_device,
685#endif 683#endif
686 684
687#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 685#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
688 &tcm_flash_device, 686 &tcm_flash_device,
689#endif 687#endif
690}; 688};