Skip to content

Commit

Permalink
mfd: vexpress: Make the driver optional for arm and arm64
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pawel Moll authored and Samuel Ortiz committed Jun 19, 2013
1 parent cb3cabd commit 8eb12b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ config MCP_UCB1200_TS
endmenu

config VEXPRESS_CONFIG
bool
bool "ARM Versatile Express platform infrastructure"
depends on ARM || ARM64
help
Platform configuration infrastructure for the ARM Ltd.
Versatile Express.
10 changes: 8 additions & 2 deletions drivers/mfd/vexpress-sysreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ void __init vexpress_sysreg_of_early_init(void)
}


#ifdef CONFIG_GPIOLIB

#define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \
[VEXPRESS_GPIO_##_name] = { \
.reg = _reg, \
Expand Down Expand Up @@ -445,6 +447,8 @@ struct gpio_led_platform_data vexpress_sysreg_leds_pdata = {
.leds = vexpress_sysreg_leds,
};

#endif


static ssize_t vexpress_sysreg_sys_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
Expand Down Expand Up @@ -480,6 +484,9 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
setup_timer(&vexpress_sysreg_config_timer,
vexpress_sysreg_config_complete, 0);

vexpress_sysreg_dev = &pdev->dev;

#ifdef CONFIG_GPIOLIB
vexpress_sysreg_gpio_chip.dev = &pdev->dev;
err = gpiochip_add(&vexpress_sysreg_gpio_chip);
if (err) {
Expand All @@ -490,11 +497,10 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
return err;
}

vexpress_sysreg_dev = &pdev->dev;

platform_device_register_data(vexpress_sysreg_dev, "leds-gpio",
PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata,
sizeof(vexpress_sysreg_leds_pdata));
#endif

device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id);

Expand Down

0 comments on commit 8eb12b9

Please sign in to comment.