]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'kconfig-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/robh...
authorOlof Johansson <olof@lixom.net>
Mon, 5 May 2014 21:18:49 +0000 (14:18 -0700)
committerOlof Johansson <olof@lixom.net>
Mon, 5 May 2014 21:18:49 +0000 (14:18 -0700)
Merge Kconfig cleanups from Rob Herring:

Several mach kconfig clean-ups of redundant selects

* tag 'kconfig-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  ARM: qcom: clean-up unneeded kconfig selects
  ARM: bcm: clean-up unneeded kconfig selects
  ARM: mvebu: clean-up unneeded kconfig selects
  + Linux 3.15-rc2

Signed-off-by: Olof Johansson <olof@lixom.net>
17 files changed:
arch/arm/configs/realview-smp_defconfig
arch/arm/configs/realview_defconfig
arch/arm/configs/versatile_defconfig
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-versatile/core.c
arch/arm/plat-versatile/Kconfig
arch/arm/plat-versatile/Makefile
arch/arm/plat-versatile/leds.c [deleted file]
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-versatile.c [new file with mode: 0644]

index abe61bf379d265988220ea03fa6fe9346a737bba..1da5d9e48224246ae3c813f9100587293f886fbd 100644 (file)
@@ -76,8 +76,10 @@ CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_PL031=y
index 7079cbe898a8c8041983dcb95679dfa24fc4f0f2..d02e9d911bb7298291260b367a9ccdc03e4ec9aa 100644 (file)
@@ -75,8 +75,10 @@ CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_PL031=y
index 073541a50e2313869aeb0d0c60fd705e9833cec5..d52b4ffe2012ccdcf9c54b728113f49b1a1e05d2 100644 (file)
@@ -61,6 +61,9 @@ CONFIG_SND_ARMAACI=m
 CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=m
 CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
+CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
index 1d5ee5c9a1dcd36624ab2c29d0a7111e7a3e1bdc..960b8dd78c4498f935fb841a510bb38736d09d4e 100644 (file)
@@ -148,6 +148,21 @@ struct platform_device realview_cf_device = {
        },
 };
 
+static struct resource realview_leds_resources[] = {
+       {
+               .start  = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET,
+               .end    = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET + 4,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device realview_leds_device = {
+       .name           = "versatile-leds",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(realview_leds_resources),
+       .resource       = realview_leds_resources,
+};
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
index 602ca5ec52c53a855e3bb6fa8ec2013486d28ba8..13dc830ef469a3587e22a54e1ad31a2b44a43737 100644 (file)
@@ -37,6 +37,7 @@ struct machine_desc;
 
 extern struct platform_device realview_flash_device;
 extern struct platform_device realview_cf_device;
+extern struct platform_device realview_leds_device;
 extern struct platform_device realview_i2c_device;
 extern struct mmci_platform_data realview_mmc0_plat_data;
 extern struct mmci_platform_data realview_mmc1_plat_data;
index c85ddb2a0ad09083e3e3c30901bc28bb3c807af2..6bb070e801287606466a54cd1e411d4b377570ef 100644 (file)
@@ -452,6 +452,7 @@ static void __init realview_eb_init(void)
        realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&realview_leds_device);
        eth_device_register();
        realview_usb_register(realview_eb_isp1761_resources);
 
index c5eade76461be3cf2faa4d6dffbb9becc7cbb872..173f2c15de49ac6709d028d607fb0bb49a339df5 100644 (file)
@@ -367,6 +367,7 @@ static void __init realview_pb1176_init(void)
        realview_usb_register(realview_pb1176_isp1761_resources);
        platform_device_register(&pmu_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&realview_leds_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index f4b0962578feb94dd653033620bfed0fcfddeaac..bde7e6b1fd44ddba8cde40e13497b0bfc9f71314 100644 (file)
@@ -347,6 +347,7 @@ static void __init realview_pb11mp_init(void)
        realview_eth_register(NULL, realview_pb11mp_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pb11mp_isp1761_resources);
        platform_device_register(&pmu_device);
 
index 10a3e1d76891315d6fce093a36d69618cbe48f44..4e57a8599265b6d69c70285a7573957f3da9347d 100644 (file)
@@ -289,6 +289,7 @@ static void __init realview_pba8_init(void)
        realview_eth_register(NULL, realview_pba8_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pba8_isp1761_resources);
        platform_device_register(&pmu_device);
 
index 9d75493e3f0cc110751b168cadff78093b0d129f..72c96caebefa92fdfaac1f4cb19348b793a69631 100644 (file)
@@ -385,6 +385,7 @@ static void __init realview_pbx_init(void)
        realview_eth_register(NULL, realview_pbx_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pbx_isp1761_resources);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
index f2c89fb8fca9d6bf6d2324404b45fad1869288f8..be83ba25f81b7e75064befef4dd4b599d63d91e2 100644 (file)
@@ -310,6 +310,21 @@ static struct platform_device char_lcd_device = {
        .resource       =       char_lcd_resources,
 };
 
+static struct resource leds_resources[] = {
+       {
+               .start  = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET,
+               .end    = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET + 4,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device leds_device = {
+       .name           = "versatile-leds",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(leds_resources),
+       .resource       = leds_resources,
+};
+
 /*
  * Clock handling
  */
@@ -795,6 +810,7 @@ void __init versatile_init(void)
        platform_device_register(&versatile_i2c_device);
        platform_device_register(&smc91x_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&leds_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index 2c4332b9f9484883a00ab6b7af2a3edc0ccd88ac..fce41e93b6a4e74d9b4fb7622d12a80b1734dc36 100644 (file)
@@ -6,12 +6,6 @@ config PLAT_VERSATILE_CLOCK
 config PLAT_VERSATILE_CLCD
        bool
 
-config PLAT_VERSATILE_LEDS
-       def_bool y if NEW_LEDS
-       depends on ARCH_REALVIEW || ARCH_VERSATILE
-       select LEDS_CLASS
-       select LEDS_TRIGGERS
-
 config PLAT_VERSATILE_SCHED_CLOCK
        def_bool y
 
index f88d448b629caa43171f63b5c9bd9d9cf4bd1df0..2e0c472958ae42b0e175a65ea566f793ef07cd3d 100644 (file)
@@ -2,6 +2,5 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
 
 obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o
 obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
-obj-$(CONFIG_PLAT_VERSATILE_LEDS) += leds.o
 obj-$(CONFIG_PLAT_VERSATILE_SCHED_CLOCK) += sched-clock.o
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c
deleted file mode 100644 (file)
index d2490d0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Driver for the 8 user LEDs found on the RealViews and Versatiles
- * Based on DaVinci's DM365 board code
- *
- * License terms: GNU General Public License (GPL) version 2
- * Author: Linus Walleij <triad@df.lth.se>
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/leds.h>
-
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
-#ifdef VERSATILE_SYS_BASE
-#define LEDREG (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET)
-#endif
-
-#ifdef REALVIEW_SYS_BASE
-#define LEDREG (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
-#endif
-
-struct versatile_led {
-       struct led_classdev     cdev;
-       u8                      mask;
-};
-
-/*
- * The triggers lines up below will only be used if the
- * LED triggers are compiled in.
- */
-static const struct {
-       const char *name;
-       const char *trigger;
-} versatile_leds[] = {
-       { "versatile:0", "heartbeat", },
-       { "versatile:1", "mmc0", },
-       { "versatile:2", "cpu0" },
-       { "versatile:3", "cpu1" },
-       { "versatile:4", "cpu2" },
-       { "versatile:5", "cpu3" },
-       { "versatile:6", },
-       { "versatile:7", },
-};
-
-static void versatile_led_set(struct led_classdev *cdev,
-                             enum led_brightness b)
-{
-       struct versatile_led *led = container_of(cdev,
-                                                struct versatile_led, cdev);
-       u32 reg = readl(LEDREG);
-
-       if (b != LED_OFF)
-               reg |= led->mask;
-       else
-               reg &= ~led->mask;
-       writel(reg, LEDREG);
-}
-
-static enum led_brightness versatile_led_get(struct led_classdev *cdev)
-{
-       struct versatile_led *led = container_of(cdev,
-                                                struct versatile_led, cdev);
-       u32 reg = readl(LEDREG);
-
-       return (reg & led->mask) ? LED_FULL : LED_OFF;
-}
-
-static int __init versatile_leds_init(void)
-{
-       int i;
-
-       /* All ON */
-       writel(0xff, LEDREG);
-       for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) {
-               struct versatile_led *led;
-
-               led = kzalloc(sizeof(*led), GFP_KERNEL);
-               if (!led)
-                       break;
-
-               led->cdev.name = versatile_leds[i].name;
-               led->cdev.brightness_set = versatile_led_set;
-               led->cdev.brightness_get = versatile_led_get;
-               led->cdev.default_trigger = versatile_leds[i].trigger;
-               led->mask = BIT(i);
-
-               if (led_classdev_register(NULL, &led->cdev) < 0) {
-                       kfree(led);
-                       break;
-               }
-       }
-
-       return 0;
-}
-
-/*
- * Since we may have triggers on any subsystem, defer registration
- * until after subsystem_init.
- */
-fs_initcall(versatile_leds_init);
index 6de9dfbf61c197fe6078a633aabc47cd47805bcf..9adc79406ff39623093246bfc05edc36db2a6912 100644 (file)
@@ -487,6 +487,14 @@ config LEDS_BLINKM
          This option enables support for the BlinkM RGB LED connected
          through I2C. Say Y to enable support for the BlinkM LED.
 
+config LEDS_VERSATILE
+       bool "LED support for the ARM Versatile and RealView"
+       depends on ARCH_REALVIEW || ARCH_VERSATILE
+       depends on LEDS_CLASS
+       help
+         This option enabled support for the LEDs on the ARM Versatile
+         and RealView boards. Say Y to enabled these.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"
 
index 3cd76dbd9be2ff9bd1763b34adad1d0c692ce054..8b4c956e11bad78162fe20c254e4f8f6d58566bd 100644 (file)
@@ -54,6 +54,7 @@ obj-$(CONFIG_LEDS_ASIC3)              += leds-asic3.o
 obj-$(CONFIG_LEDS_MAX8997)             += leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
+obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
diff --git a/drivers/leds/leds-versatile.c b/drivers/leds/leds-versatile.c
new file mode 100644 (file)
index 0000000..8055302
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Driver for the 8 user LEDs found on the RealViews and Versatiles
+ * Based on DaVinci's DM365 board code
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ * Author: Linus Walleij <triad@df.lth.se>
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
+
+struct versatile_led {
+       void __iomem            *base;
+       struct led_classdev     cdev;
+       u8                      mask;
+};
+
+/*
+ * The triggers lines up below will only be used if the
+ * LED triggers are compiled in.
+ */
+static const struct {
+       const char *name;
+       const char *trigger;
+} versatile_leds[] = {
+       { "versatile:0", "heartbeat", },
+       { "versatile:1", "mmc0", },
+       { "versatile:2", "cpu0" },
+       { "versatile:3", "cpu1" },
+       { "versatile:4", "cpu2" },
+       { "versatile:5", "cpu3" },
+       { "versatile:6", },
+       { "versatile:7", },
+};
+
+static void versatile_led_set(struct led_classdev *cdev,
+                             enum led_brightness b)
+{
+       struct versatile_led *led = container_of(cdev,
+                                                struct versatile_led, cdev);
+       u32 reg = readl(led->base);
+
+       if (b != LED_OFF)
+               reg |= led->mask;
+       else
+               reg &= ~led->mask;
+       writel(reg, led->base);
+}
+
+static enum led_brightness versatile_led_get(struct led_classdev *cdev)
+{
+       struct versatile_led *led = container_of(cdev,
+                                                struct versatile_led, cdev);
+       u32 reg = readl(led->base);
+
+       return (reg & led->mask) ? LED_FULL : LED_OFF;
+}
+
+static int versatile_leds_probe(struct platform_device *dev)
+{
+       int i;
+       struct resource *res;
+       void __iomem *base;
+
+       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       base = devm_ioremap_resource(&dev->dev, res);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
+
+       /* All off */
+       writel(0, base);
+       for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) {
+               struct versatile_led *led;
+
+               led = kzalloc(sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       break;
+
+               led->base = base;
+               led->cdev.name = versatile_leds[i].name;
+               led->cdev.brightness_set = versatile_led_set;
+               led->cdev.brightness_get = versatile_led_get;
+               led->cdev.default_trigger = versatile_leds[i].trigger;
+               led->mask = BIT(i);
+
+               if (led_classdev_register(NULL, &led->cdev) < 0) {
+                       kfree(led);
+                       break;
+               }
+       }
+
+       return 0;
+}
+
+static struct platform_driver versatile_leds_driver = {
+       .driver = {
+               .name   = "versatile-leds",
+       },
+       .probe = versatile_leds_probe,
+};
+
+module_platform_driver(versatile_leds_driver);
+
+MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
+MODULE_DESCRIPTION("ARM Versatile LED driver");
+MODULE_LICENSE("GPL v2");