Skip to contentSkip to conversation

Introduce ccu8540 uib-v3

PATCH In review Gabriel Fernandez 3 participants 10 messages May 29, 2013 – Jun 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Introduce ccu8540 uib-v3

From: Gabriel Fernandez <[email protected]>

This patch set introduces a new board for u8540 platform: ccu8540-uib-v3.

Gabriel Fernandez (4):
ARM: ux540: Add ccu8540-uib-v3 Device Tree Machine
ARM: u8540: Add device tree support for lp5521 leds
ARM: u8540: Add device tree support for bh1780
ARM: u8540: Add DT probing for SFH7741 Proximity Sensor

 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 58 ++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 arch/arm/boot/dts/ccu8540-uib-v3.dts
Signature · 1 line
1.8.1.1
#1 lore raw

PATCH 1/4 ARM: ux540: Add ccu8540-uib-v3 Device Tree Machine

From: Gabriel Fernandez <[email protected]>

This board includes the U8540 platform and specifies only the ST-Ericsson UIB version 3.

---
 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 arch/arm/boot/dts/ccu8540-uib-v3.dts
arch/arm/boot/dts/Makefile +1 -0
index 1995988..29cb5db 100644
@@ -159,6 +159,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	hrefprev60.dtb \
 	hrefv60plus.dtb \
 	ccu8540.dtb \
+	ccu8540-uib-v3.dtb 	\
 	ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +16 -0
new file mode 100644
index 0000000..4b4982e
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2012 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "ccu8540.dts"
+
+/ {
+	model = "ST-Ericsson U8540 platform with device tree UIB v3";
+};
Signature · 1 line
1.8.1.1
#2 lore raw

Re: [PATCH 1/4] ARM: ux540: Add ccu8540-uib-v3 Device Tree Machine

Quoted 4 lines · Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This board includes the U8540 platform and specifies only the ST-Ericsson UIB version 3.

I'm confused by this.

Is it a new board, or just a UIB?

arch/arm/boot/dts/ccu8540-uib-v3.dts

Quoted 23 lines
---
 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 arch/arm/boot/dts/ccu8540-uib-v3.dts
arch/arm/boot/dts/Makefile +1 -0
index 1995988..29cb5db 100644
@@ -159,6 +159,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	hrefprev60.dtb \
 	hrefv60plus.dtb \
 	ccu8540.dtb \
+	ccu8540-uib-v3.dtb 	\
 	ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +0 -0
new file mode 100644
index 0000000..4b4982e

If this is a UIB, it should be an include file (*.dtsi).

arch/arm/boot/dts/ccu8540-uib-v3.dts line 12

Quoted 13 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +12 -0
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2012 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "ccu8540.dts"

No, the other way round.

ccu8540.dts should include this one.

arch/arm/boot/dts/ccu8540-uib-v3.dts line 16

Quoted 3 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +3 -0
+/ {
+	model = "ST-Ericsson U8540 platform with device tree UIB v3";
+};

This patch doesn't actually do anything.

Fix it up, so it at least as some functionality.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

Re: [PATCH 1/4] ARM: ux540: Add ccu8540-uib-v3 Device Tree Machine

Quoted 10 lines · Lee Jones
Quoted 4 lines · Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This board includes the U8540 platform and specifies only the ST-Ericsson UIB version 3.

I'm confused by this.

Is it a new board, or just a UIB?

For me it's a new board.

ccu8540.dts is a board without uib.
You can can plug on this board some different uibs.
That's why, i created a ccu8540-uib-v3.dts board in which i included a common board ccu8540.dts

Another solution is to create one *.dtsi file with all uibs for ccu8540 and makes a dynamique detection.
Linus, Lee what do you think about that ?

Quoted 58 lines

arch/arm/boot/dts/ccu8540-uib-v3.dts

Quoted 24 lines
---
 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 arch/arm/boot/dts/ccu8540-uib-v3.dts
arch/arm/boot/dts/Makefile +1 -0
index 1995988..29cb5db 100644
@@ -159,6 +159,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
      hrefprev60.dtb \
      hrefv60plus.dtb \
      ccu8540.dtb \
+     ccu8540-uib-v3.dtb      \
      ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
      r8a7740-armadillo800eva.dtb \
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +0 -0
new file mode 100644
index 0000000..4b4982e

If this is a UIB, it should be an include file (*.dtsi).

arch/arm/boot/dts/ccu8540-uib-v3.dts line 12

Quoted 13 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +12 -0
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2012 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "ccu8540.dts"

No, the other way round.

ccu8540.dts should include this one.

arch/arm/boot/dts/ccu8540-uib-v3.dts line 16

Quoted 3 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts new file +3 -0
+/ {
+     model = "ST-Ericsson U8540 platform with device tree UIB v3";
+};

This patch doesn't actually do anything.

Fix it up, so it at least as some functionality.

--
Lee Jones
Linaro ST-Ericsson Landing Team Lead

Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

Re: [PATCH 1/4] ARM: ux540: Add ccu8540-uib-v3 Device Tree Machine

On Thu, May 30, 2013 at 3:20 PM, Gabriel Fernandez <[email protected]> wrote:

[Lee]

Quoted 8 lines
Quoted 1 line

Is it a new board, or just a UIB?

For me it's a new board.

ccu8540.dts is a board without uib.
You can can plug on this board some different uibs.
That's why, i created a ccu8540-uib-v3.dts board in which i included a common board ccu8540.dts

So that means that ccu8540.dts will boot the system even without any UIB if I understand correctly. Anything that pertains to the UIB should be in the UIB overlay.

Quoted 3 lines

Another solution is to create one *.dtsi file with all uibs for ccu8540 and makes a dynamique detection.
Linus, Lee what do you think about that ?

I'm lost on this, dynamic detection would be done in the boot loader, usually this just encodes one, static tree.

The first approach seems OK with me.

Yours,
Linus Walleij

#5 lore raw

PATCH 2/4 ARM: u8540: Add device tree support for lp5521 leds

In reply to Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This patch adds DT probing of lp5521 leds for u8540.

---
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm/boot/dts/ccu8540-uib-v3.dts +22 -0
index 4b4982e..422a292 100644
@@ -14,3 +14,25 @@
 / {
 	model = "ST-Ericsson U8540 platform with device tree UIB v3";
 };
+
+&i2c2 {
+
+	lp5521@32 {
+		compatible = "national,lp5521";
+		reg = <0x32>;
+		label = "lp5521_pri";
+		clock-mode = /bits/ 8 <2>;
+		chan0 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};
+		chan1 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};
+		chan2 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};
+	};
+};
Signature · 1 line
1.8.1.1
#6 lore raw

Re: [PATCH 2/4] ARM: u8540: Add device tree support for lp5521 leds

Quoted 14 lines · Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This patch adds DT probing of lp5521 leds for u8540.

---
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm/boot/dts/ccu8540-uib-v3.dts +0 -0
index 4b4982e..422a292 100644

arch/arm/boot/dts/ccu8540-uib-v3.dts line 18

Quoted 5 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts +2 -0
@@ -14,3 +14,25 @@
 / {
 	model = "ST-Ericsson U8540 platform with device tree UIB v3";
 };
+
+&i2c2 {

I'm really not a fan of this syntax.

I only see it lending itself to more abstraction and obfuscation.

Quoted 10 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts +10 -0
+
+	lp5521@32 {
+		compatible = "national,lp5521";
+		reg = <0x32>;
+		label = "lp5521_pri";
+		clock-mode = /bits/ 8 <2>;
+		chan0 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};

arch/arm/boot/dts/ccu8540-uib-v3.dts line 38

Quoted 10 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts +10 -0
+		chan1 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};
+		chan2 {
+			led-cur = /bits/ 8 <0x2f>;
+			max-cur = /bits/ 8 <0x5f>;
+		};
+	};
+};

More odd tabbing above.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#7 lore raw

PATCH 3/4 ARM: u8540: Add device tree support for bh1780

In reply to Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This patch adds DT probing of the light sensor bh1780 for u8540.

---
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/ccu8540-uib-v3.dts +5 -0
index 422a292..dc90571 100644
@@ -16,6 +16,11 @@
 };
 
 &i2c2 {
+	bh1780@29 {
+		compatible = "bh1780";
+		reg = <0x29>;
+		vcc-supply = <&ab8500_ldo_aux1_reg>;
+	};
 
 	lp5521@32 {
 		compatible = "national,lp5521";
Signature · 1 line
1.8.1.1
Acked-by on v1 3/4
#8 lore raw

Re: [PATCH 3/4] ARM: u8540: Add device tree support for bh1780

Quoted 16 lines · Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

This patch adds DT probing of the light sensor bh1780 for u8540.

---
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/ccu8540-uib-v3.dts +0 -0
index 422a292..dc90571 100644
@@ -16,6 +16,11 @@
 };

arch/arm/boot/dts/ccu8540-uib-v3.dts line 26

Quoted 10 lines
arch/arm/boot/dts/ccu8540-uib-v3.dts +5 -0
 
 &i2c2 {
+	bh1780@29 {
+		compatible = "bh1780";
+		reg = <0x29>;
+		vcc-supply = <&ab8500_ldo_aux1_reg>;
+	};
 
 	lp5521@32 {
 		compatible = "national,lp5521";

For this patch, not withstanding the ones prior:

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw

PATCH 4/4 ARM: u8540: Add DT probing for SFH7741 Proximity Sensor

In reply to Gabriel Fernandez

From: Gabriel Fernandez <[email protected]>

Here we ensure the SFH7741 Proximity Sensor is registered through gpio-keys when booting with Device Tree enabled.

---
 arch/arm/boot/dts/ccu8540-uib-v3.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/ccu8540-uib-v3.dts +15 -0
index dc90571..26f3106 100644
@@ -13,6 +13,21 @@
 
 / {
 	model = "ST-Ericsson U8540 platform with device tree UIB v3";
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		v-vcc-supply = <&ab8500_ldo_aux1_reg>;
+
+		button@1 {
+			debounce_interval = <50>;
+			wakeup = <1>;
+			linux,code = <0xb>;
+			label = "SFH7741 Proximity Sensor";
+			gpios = <&gpio7 5 0x8>;
+		};
+	};
 };
 
 &i2c2 {
Signature · 1 line
1.8.1.1