Skip to content

Commit 8eb12b9

Browse files
pawelmollSamuel Ortiz
authored andcommitted
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>
1 parent cb3cabd commit 8eb12b9

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎drivers/mfd/Kconfig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,8 @@ config MCP_UCB1200_TS
11511151
endmenu
11521152

11531153
config VEXPRESS_CONFIG
1154-
bool
1154+
bool "ARM Versatile Express platform infrastructure"
1155+
depends on ARM || ARM64
11551156
help
11561157
Platform configuration infrastructure for the ARM Ltd.
11571158
Versatile Express.

‎drivers/mfd/vexpress-sysreg.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ void __init vexpress_sysreg_of_early_init(void)
351351
}
352352

353353

354+
#ifdef CONFIG_GPIOLIB
355+
354356
#define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \
355357
[VEXPRESS_GPIO_##_name] = { \
356358
.reg = _reg, \
@@ -445,6 +447,8 @@ struct gpio_led_platform_data vexpress_sysreg_leds_pdata = {
445447
.leds = vexpress_sysreg_leds,
446448
};
447449

450+
#endif
451+
448452

449453
static ssize_t vexpress_sysreg_sys_id_show(struct device *dev,
450454
struct device_attribute *attr, char *buf)
@@ -480,6 +484,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
480484
setup_timer(&vexpress_sysreg_config_timer,
481485
vexpress_sysreg_config_complete, 0);
482486

487+
vexpress_sysreg_dev = &pdev->dev;
488+
489+
#ifdef CONFIG_GPIOLIB
483490
vexpress_sysreg_gpio_chip.dev = &pdev->dev;
484491
err = gpiochip_add(&vexpress_sysreg_gpio_chip);
485492
if (err) {
@@ -490,11 +497,10 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
490497
return err;
491498
}
492499

493-
vexpress_sysreg_dev = &pdev->dev;
494-
495500
platform_device_register_data(vexpress_sysreg_dev, "leds-gpio",
496501
PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata,
497502
sizeof(vexpress_sysreg_leds_pdata));
503+
#endif
498504

499505
device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id);
500506

0 commit comments

Comments
 (0)