Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: vexpress: Make the driver optional for arm and arm64

The driver can be used on either arm or arm64 platforms, but
the latter doesn't have any platform-specific configuration
options, so it must be possible to manually enable the driver.

As the gpiolib is optional for arm64 arch, the gpio/led code
must be compiled conditionally.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Pawel Moll and committed by
Samuel Ortiz
8eb12b98 cb3cabd6

+10 -3
+2 -1
drivers/mfd/Kconfig
··· 1151 1151 endmenu 1152 1152 1153 1153 config VEXPRESS_CONFIG 1154 - bool 1154 + bool "ARM Versatile Express platform infrastructure" 1155 + depends on ARM || ARM64 1155 1156 help 1156 1157 Platform configuration infrastructure for the ARM Ltd. 1157 1158 Versatile Express.
+8 -2
drivers/mfd/vexpress-sysreg.c
··· 351 351 } 352 352 353 353 354 + #ifdef CONFIG_GPIOLIB 355 + 354 356 #define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \ 355 357 [VEXPRESS_GPIO_##_name] = { \ 356 358 .reg = _reg, \ ··· 447 445 .leds = vexpress_sysreg_leds, 448 446 }; 449 447 448 + #endif 449 + 450 450 451 451 static ssize_t vexpress_sysreg_sys_id_show(struct device *dev, 452 452 struct device_attribute *attr, char *buf) ··· 484 480 setup_timer(&vexpress_sysreg_config_timer, 485 481 vexpress_sysreg_config_complete, 0); 486 482 483 + vexpress_sysreg_dev = &pdev->dev; 484 + 485 + #ifdef CONFIG_GPIOLIB 487 486 vexpress_sysreg_gpio_chip.dev = &pdev->dev; 488 487 err = gpiochip_add(&vexpress_sysreg_gpio_chip); 489 488 if (err) { ··· 497 490 return err; 498 491 } 499 492 500 - vexpress_sysreg_dev = &pdev->dev; 501 - 502 493 platform_device_register_data(vexpress_sysreg_dev, "leds-gpio", 503 494 PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata, 504 495 sizeof(vexpress_sysreg_leds_pdata)); 496 + #endif 505 497 506 498 device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id); 507 499