diff options
author | Pawel Moll <pawel.moll@arm.com> | 2013-06-11 06:56:02 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-19 05:32:00 -0400 |
commit | 8eb12b98163deaafae82e7dde044709919e4fdfa (patch) | |
tree | 26e34391966660210c61fada3a66d640a6dce7ab | |
parent | cb3cabd6788dd8c2e87dc7262a45a24e063681a3 (diff) |
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>
-rw-r--r-- | drivers/mfd/Kconfig | 3 | ||||
-rw-r--r-- | drivers/mfd/vexpress-sysreg.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 29f7363f6bc4..3e3be603cf82 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -1151,7 +1151,8 @@ config MCP_UCB1200_TS | |||
1151 | endmenu | 1151 | endmenu |
1152 | 1152 | ||
1153 | config VEXPRESS_CONFIG | 1153 | config VEXPRESS_CONFIG |
1154 | bool | 1154 | bool "ARM Versatile Express platform infrastructure" |
1155 | depends on ARM || ARM64 | ||
1155 | help | 1156 | help |
1156 | Platform configuration infrastructure for the ARM Ltd. | 1157 | Platform configuration infrastructure for the ARM Ltd. |
1157 | Versatile Express. | 1158 | Versatile Express. |
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index 96a020b1dcd1..981bef4b7ebc 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c | |||
@@ -351,6 +351,8 @@ void __init vexpress_sysreg_of_early_init(void) | |||
351 | } | 351 | } |
352 | 352 | ||
353 | 353 | ||
354 | #ifdef CONFIG_GPIOLIB | ||
355 | |||
354 | #define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \ | 356 | #define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \ |
355 | [VEXPRESS_GPIO_##_name] = { \ | 357 | [VEXPRESS_GPIO_##_name] = { \ |
356 | .reg = _reg, \ | 358 | .reg = _reg, \ |
@@ -445,6 +447,8 @@ struct gpio_led_platform_data vexpress_sysreg_leds_pdata = { | |||
445 | .leds = vexpress_sysreg_leds, | 447 | .leds = vexpress_sysreg_leds, |
446 | }; | 448 | }; |
447 | 449 | ||
450 | #endif | ||
451 | |||
448 | 452 | ||
449 | static ssize_t vexpress_sysreg_sys_id_show(struct device *dev, | 453 | static ssize_t vexpress_sysreg_sys_id_show(struct device *dev, |
450 | struct device_attribute *attr, char *buf) | 454 | struct device_attribute *attr, char *buf) |
@@ -480,6 +484,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) | |||
480 | setup_timer(&vexpress_sysreg_config_timer, | 484 | setup_timer(&vexpress_sysreg_config_timer, |
481 | vexpress_sysreg_config_complete, 0); | 485 | vexpress_sysreg_config_complete, 0); |
482 | 486 | ||
487 | vexpress_sysreg_dev = &pdev->dev; | ||
488 | |||
489 | #ifdef CONFIG_GPIOLIB | ||
483 | vexpress_sysreg_gpio_chip.dev = &pdev->dev; | 490 | vexpress_sysreg_gpio_chip.dev = &pdev->dev; |
484 | err = gpiochip_add(&vexpress_sysreg_gpio_chip); | 491 | err = gpiochip_add(&vexpress_sysreg_gpio_chip); |
485 | if (err) { | 492 | if (err) { |
@@ -490,11 +497,10 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) | |||
490 | return err; | 497 | return err; |
491 | } | 498 | } |
492 | 499 | ||
493 | vexpress_sysreg_dev = &pdev->dev; | ||
494 | |||
495 | platform_device_register_data(vexpress_sysreg_dev, "leds-gpio", | 500 | platform_device_register_data(vexpress_sysreg_dev, "leds-gpio", |
496 | PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata, | 501 | PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata, |
497 | sizeof(vexpress_sysreg_leds_pdata)); | 502 | sizeof(vexpress_sysreg_leds_pdata)); |
503 | #endif | ||
498 | 504 | ||
499 | device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id); | 505 | device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id); |
500 | 506 | ||