2014-04-22 13:01:17

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 1/2] ARM: shmobile: armadillo800eva: Add LED support

Cfr. r8a7740-armadillo800eva-reference.dts

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
arch/arm/mach-shmobile/board-armadillo800eva.c | 35 ++++++++++++++++++++++++
1 file changed, 35 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 276d713f0ee9..688a69c7e5fc 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -586,6 +586,40 @@ static struct platform_device hdmi_lcdc_device = {
},
};

+/* LEDS */
+static struct gpio_led gpio_leds[] = {
+ {
+ .name = "led1",
+ .gpio = 102,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }, {
+ .name = "led2",
+ .gpio = 111,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }, {
+ .name = "led3",
+ .gpio = 110,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }, {
+ .name = "led4",
+ .gpio = 177,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+};
+
+static struct gpio_led_platform_data leds_gpio_info = {
+ .leds = gpio_leds,
+ .num_leds = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio_device = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &leds_gpio_info,
+ },
+};
+
/* GPIO KEY */
#define GPIO_KEY(c, g, d, ...) \
{ .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ }
@@ -1077,6 +1111,7 @@ static struct platform_device *eva_devices[] __initdata = {
&lcdc0_device,
&pwm_device,
&pwm_backlight_device,
+ &leds_gpio_device,
&gpio_keys_device,
&sh_eth_device,
&vcc_sdhi0,
--
1.7.9.5


2014-04-22 13:01:40

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH RFC 2/2] ARM: shmobile: armadillo800eva defconfig: Enable REGULATOR_GPIO and LEDS_GPIO

Refresh armadillo800eva_defconfig, and enable missing options for devices
in platform data and/or DT:
- REGULATOR_GPIO
- LEDS_GPIO

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
Do we want SHMOBILE_IOMMU, too? The help text says "If unsure, say N."
If yes, is the default SHMOBILE_IOMMU_ADDRSIZE_2048MB OK?

arch/arm/configs/armadillo800eva_defconfig | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index 065adddeee3e..1e47212a63b8 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -1,4 +1,3 @@
-CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
@@ -18,9 +17,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_ARCH_SHMOBILE_LEGACY=y
CONFIG_ARCH_R8A7740=y
CONFIG_MACH_ARMADILLO800EVA=y
-# CONFIG_SH_TIMER_TMU is not set
-CONFIG_ARM_THUMB=y
-CONFIG_CACHE_L2X0=y
CONFIG_ARM_ERRATA_430973=y
CONFIG_ARM_ERRATA_458693=y
CONFIG_ARM_ERRATA_460075=y
@@ -34,7 +30,6 @@ CONFIG_ARM_ERRATA_754322=y
CONFIG_PL310_ERRATA_769419=y
CONFIG_ARM_ERRATA_775420=y
CONFIG_AEABI=y
-# CONFIG_OABI_COMPAT is not set
CONFIG_FORCE_MAX_ZONEORDER=13
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
@@ -66,7 +61,6 @@ CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
@@ -74,6 +68,7 @@ CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
CONFIG_SH_ETH=y
+# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
@@ -91,18 +86,17 @@ CONFIG_SERIAL_SH_SCI=y
CONFIG_SERIAL_SH_SCI_NR_UARTS=9
CONFIG_SERIAL_SH_SCI_CONSOLE=y
# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
CONFIG_I2C_GPIO=y
CONFIG_I2C_SH_MOBILE=y
# CONFIG_HWMON is not set
CONFIG_REGULATOR=y
+CONFIG_REGULATOR_GPIO=y
CONFIG_MEDIA_SUPPORT=y
-CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_SOC_CAMERA=y
-CONFIG_SOC_CAMERA_MT9T112=y
CONFIG_VIDEO_SH_MOBILE_CEU=y
+CONFIG_SOC_CAMERA_MT9T112=y
CONFIG_FB=y
CONFIG_FB_SH_MOBILE_LCDC=y
CONFIG_FB_SH_MOBILE_HDMI=y
@@ -118,7 +112,6 @@ CONFIG_LOGO=y
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_ARM is not set
CONFIG_SND_SOC_SH4_FSI=y
-# CONFIG_HID_SUPPORT is not set
CONFIG_USB=y
CONFIG_USB_RENESAS_USBHS=y
CONFIG_USB_GADGET=y
@@ -127,6 +120,9 @@ CONFIG_USB_ETH=m
CONFIG_MMC=y
CONFIG_MMC_SDHI=y
CONFIG_MMC_SH_MMCIF=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_S35390A=y
CONFIG_DMADEVICES=y
@@ -150,7 +146,6 @@ CONFIG_NLS_ISO8859_1=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
# CONFIG_ARM_UNWIND is not set
-CONFIG_CRYPTO=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_DES=y
--
1.7.9.5

2014-04-23 00:50:50

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH RFC 2/2] ARM: shmobile: armadillo800eva defconfig: Enable REGULATOR_GPIO and LEDS_GPIO

On Tue, Apr 22, 2014 at 03:01:07PM +0200, Geert Uytterhoeven wrote:
> Refresh armadillo800eva_defconfig, and enable missing options for devices
> in platform data and/or DT:
> - REGULATOR_GPIO
> - LEDS_GPIO

I would prefer if changes were made in a more incremental patch.

* A patch to enable LEDS_GPIO and REGULATOR_GPIO.
* Then a cleanup patch, if you really want to do that: but why?

>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> Do we want SHMOBILE_IOMMU, too? The help text says "If unsure, say N."
> If yes, is the default SHMOBILE_IOMMU_ADDRSIZE_2048MB OK?

I defer to Magnus on that one.

> arch/arm/configs/armadillo800eva_defconfig | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
> index 065adddeee3e..1e47212a63b8 100644
> --- a/arch/arm/configs/armadillo800eva_defconfig
> +++ b/arch/arm/configs/armadillo800eva_defconfig
> @@ -1,4 +1,3 @@
> -CONFIG_EXPERIMENTAL=y
> CONFIG_SYSVIPC=y
> CONFIG_IKCONFIG=y
> CONFIG_IKCONFIG_PROC=y
> @@ -18,9 +17,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_ARCH_SHMOBILE_LEGACY=y
> CONFIG_ARCH_R8A7740=y
> CONFIG_MACH_ARMADILLO800EVA=y
> -# CONFIG_SH_TIMER_TMU is not set
> -CONFIG_ARM_THUMB=y
> -CONFIG_CACHE_L2X0=y
> CONFIG_ARM_ERRATA_430973=y
> CONFIG_ARM_ERRATA_458693=y
> CONFIG_ARM_ERRATA_460075=y
> @@ -34,7 +30,6 @@ CONFIG_ARM_ERRATA_754322=y
> CONFIG_PL310_ERRATA_769419=y
> CONFIG_ARM_ERRATA_775420=y
> CONFIG_AEABI=y
> -# CONFIG_OABI_COMPAT is not set
> CONFIG_FORCE_MAX_ZONEORDER=13
> CONFIG_ZBOOT_ROM_TEXT=0x0
> CONFIG_ZBOOT_ROM_BSS=0x0
> @@ -66,7 +61,6 @@ CONFIG_MD=y
> CONFIG_BLK_DEV_DM=y
> CONFIG_NETDEVICES=y
> # CONFIG_NET_VENDOR_BROADCOM is not set
> -# CONFIG_NET_VENDOR_CHELSIO is not set
> # CONFIG_NET_VENDOR_CIRRUS is not set
> # CONFIG_NET_VENDOR_FARADAY is not set
> # CONFIG_NET_VENDOR_INTEL is not set
> @@ -74,6 +68,7 @@ CONFIG_NETDEVICES=y
> # CONFIG_NET_VENDOR_MICREL is not set
> # CONFIG_NET_VENDOR_NATSEMI is not set
> CONFIG_SH_ETH=y
> +# CONFIG_NET_VENDOR_SAMSUNG is not set
> # CONFIG_NET_VENDOR_SEEQ is not set
> # CONFIG_NET_VENDOR_SMSC is not set
> # CONFIG_NET_VENDOR_STMICRO is not set
> @@ -91,18 +86,17 @@ CONFIG_SERIAL_SH_SCI=y
> CONFIG_SERIAL_SH_SCI_NR_UARTS=9
> CONFIG_SERIAL_SH_SCI_CONSOLE=y
> # CONFIG_HW_RANDOM is not set
> -CONFIG_I2C=y
> CONFIG_I2C_GPIO=y
> CONFIG_I2C_SH_MOBILE=y
> # CONFIG_HWMON is not set
> CONFIG_REGULATOR=y
> +CONFIG_REGULATOR_GPIO=y
> CONFIG_MEDIA_SUPPORT=y
> -CONFIG_VIDEO_DEV=y
> CONFIG_MEDIA_CAMERA_SUPPORT=y
> CONFIG_V4L_PLATFORM_DRIVERS=y
> CONFIG_SOC_CAMERA=y
> -CONFIG_SOC_CAMERA_MT9T112=y
> CONFIG_VIDEO_SH_MOBILE_CEU=y
> +CONFIG_SOC_CAMERA_MT9T112=y
> CONFIG_FB=y
> CONFIG_FB_SH_MOBILE_LCDC=y
> CONFIG_FB_SH_MOBILE_HDMI=y
> @@ -118,7 +112,6 @@ CONFIG_LOGO=y
> # CONFIG_SND_DRIVERS is not set
> # CONFIG_SND_ARM is not set
> CONFIG_SND_SOC_SH4_FSI=y
> -# CONFIG_HID_SUPPORT is not set
> CONFIG_USB=y
> CONFIG_USB_RENESAS_USBHS=y
> CONFIG_USB_GADGET=y
> @@ -127,6 +120,9 @@ CONFIG_USB_ETH=m
> CONFIG_MMC=y
> CONFIG_MMC_SDHI=y
> CONFIG_MMC_SH_MMCIF=y
> +CONFIG_NEW_LEDS=y
> +CONFIG_LEDS_CLASS=y
> +CONFIG_LEDS_GPIO=y
> CONFIG_RTC_CLASS=y
> CONFIG_RTC_DRV_S35390A=y
> CONFIG_DMADEVICES=y
> @@ -150,7 +146,6 @@ CONFIG_NLS_ISO8859_1=y
> # CONFIG_ENABLE_WARN_DEPRECATED is not set
> # CONFIG_ENABLE_MUST_CHECK is not set
> # CONFIG_ARM_UNWIND is not set
> -CONFIG_CRYPTO=y
> CONFIG_CRYPTO_CBC=y
> CONFIG_CRYPTO_MD5=y
> CONFIG_CRYPTO_DES=y
> --
> 1.7.9.5
>

2014-04-23 08:39:05

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH RFC 2/2] ARM: shmobile: armadillo800eva defconfig: Enable REGULATOR_GPIO and LEDS_GPIO

Hi Simon,

On Wed, Apr 23, 2014 at 2:50 AM, Simon Horman <[email protected]> wrote:
> On Tue, Apr 22, 2014 at 03:01:07PM +0200, Geert Uytterhoeven wrote:
>> Refresh armadillo800eva_defconfig, and enable missing options for devices
>> in platform data and/or DT:
>> - REGULATOR_GPIO
>> - LEDS_GPIO
>
> I would prefer if changes were made in a more incremental patch.
>
> * A patch to enable LEDS_GPIO and REGULATOR_GPIO.

OK, will do for v2, when I know more about SHMOBILE_IOMMU.

> * Then a cleanup patch, if you really want to do that: but why?

It's a good idea to run a "make savedefconfig" once in a while, to get rid of
stale symbols, and symbols that are now auto-selected.
Anyway, although there were quite some changes in the actual defconfig, the
net impact on "make armadillo800eva_defconfig" is much smaller than I expected
(only CONFIG_NET_VENDOR_SAMSUNG gets enabled), so I'll leave the regular
refreshing to you ;-

>> Signed-off-by: Geert Uytterhoeven <[email protected]>
>> ---
>> Do we want SHMOBILE_IOMMU, too? The help text says "If unsure, say N."
>> If yes, is the default SHMOBILE_IOMMU_ADDRSIZE_2048MB OK?
>
> I defer to Magnus on that one.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2014-04-24 00:23:37

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH RFC 2/2] ARM: shmobile: armadillo800eva defconfig: Enable REGULATOR_GPIO and LEDS_GPIO

On Wed, Apr 23, 2014 at 10:38:58AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
>
> On Wed, Apr 23, 2014 at 2:50 AM, Simon Horman <[email protected]> wrote:
> > On Tue, Apr 22, 2014 at 03:01:07PM +0200, Geert Uytterhoeven wrote:
> >> Refresh armadillo800eva_defconfig, and enable missing options for devices
> >> in platform data and/or DT:
> >> - REGULATOR_GPIO
> >> - LEDS_GPIO
> >
> > I would prefer if changes were made in a more incremental patch.
> >
> > * A patch to enable LEDS_GPIO and REGULATOR_GPIO.
>
> OK, will do for v2, when I know more about SHMOBILE_IOMMU.
>
> > * Then a cleanup patch, if you really want to do that: but why?
>
> It's a good idea to run a "make savedefconfig" once in a while, to get rid of
> stale symbols, and symbols that are now auto-selected.
> Anyway, although there were quite some changes in the actual defconfig, the
> net impact on "make armadillo800eva_defconfig" is much smaller than I expected
> (only CONFIG_NET_VENDOR_SAMSUNG gets enabled), so I'll leave the regular
> refreshing to you ;-

I agree that its nice to keep things up to date. But there
is a goal to eventually remove the per-board defconfigs.
So my motivation to spruce things up is a little lower than
it might otherwise be.

> >> Signed-off-by: Geert Uytterhoeven <[email protected]>
> >> ---
> >> Do we want SHMOBILE_IOMMU, too? The help text says "If unsure, say N."
> >> If yes, is the default SHMOBILE_IOMMU_ADDRSIZE_2048MB OK?
> >
> > I defer to Magnus on that one.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>

2014-04-24 06:43:52

by Magnus Damm

[permalink] [raw]
Subject: Re: [PATCH RFC 2/2] ARM: shmobile: armadillo800eva defconfig: Enable REGULATOR_GPIO and LEDS_GPIO

On Wed, Apr 23, 2014 at 9:50 AM, Simon Horman <[email protected]> wrote:
> On Tue, Apr 22, 2014 at 03:01:07PM +0200, Geert Uytterhoeven wrote:
>> Refresh armadillo800eva_defconfig, and enable missing options for devices
>> in platform data and/or DT:
>> - REGULATOR_GPIO
>> - LEDS_GPIO
>
> I would prefer if changes were made in a more incremental patch.
>
> * A patch to enable LEDS_GPIO and REGULATOR_GPIO.
> * Then a cleanup patch, if you really want to do that: but why?
>
>>
>> Signed-off-by: Geert Uytterhoeven <[email protected]>
>> ---
>> Do we want SHMOBILE_IOMMU, too? The help text says "If unsure, say N."
>> If yes, is the default SHMOBILE_IOMMU_ADDRSIZE_2048MB OK?
>
> I defer to Magnus on that one.

I think it's best to go with a "N" here. Unless someone can prove to
me that we need it and that it is working!

In general I'd like to begin by integrating IOMMU support for R-Car
Gen2 in a controlled manner and once that is in place I think we can
revisit this older case. At that time hopefully we will be dealing
with the multiplatform defconfig for r8a7740 and Armadillo.

Cheers,

/ magnus