devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Add various peripheral support for K3G
@ 2023-07-16 22:05 Markuss Broks
  2023-07-16 22:05 ` [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support Markuss Broks
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This series adds support for some peripherals installed on
Samsung Galaxy S5 (SM-G900H). This includes the WiFi card,
GPIO keys, fuel gauge, touchkeys, notification LED and display.
Also documents the peripherals for which we currently lack drivers.

Markuss Broks (7):
  ARM: dts: exynos: k3g: Add WiFi card support
  ARM: dts: exynos: Add GPIO keys support for k3g
  ARM: dts: exynos: k3g: Add fuel gauge support
  ARM: dts: exynos: k3g: Add touchkeys support
  ARM: dts: exynos: k3g: Add notification LED support
  ARM: dts: exynos: k3g: Document the devices which are not supported
  ARM: dts: exynos: k3g: Add display support

 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 256 +++++++++++++++++++
 1 file changed, 256 insertions(+)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-19  9:04   ` Krzysztof Kozlowski
  2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: Add GPIO keys support for k3g Markuss Broks
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This device has Broadcom BCM4354 WiFi card installed,
which uses SDIO interface.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index c35261a338ff..1a11a6993ba7 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -48,6 +48,13 @@ tsp_vdd: regulator-tsp-vdd-en {
 		gpio = <&gpy3 5 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	wlan_pwrseq: wlan-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpy7 7 GPIO_ACTIVE_LOW>; /* WIFI_EN */
+		clocks = <&s2mps11_osc S2MPS11_CLK_BT>; /* Used not only for Bluetooth */
+		clock-names = "ext_clock";
+	};
 };
 
 &cpu0 {
@@ -616,6 +623,23 @@ &mmc_0 {
 	bus-width = <8>;
 };
 
+/* WiFi SDIO module */
+&mmc_1 {
+	status = "okay";
+	cap-sdio-irq;
+	cap-sd-highspeed;
+	non-removable;
+	samsung,dw-mshc-ciu-div = <1>;
+	samsung,dw-mshc-sdr-timing = <0 1>;
+	samsung,dw-mshc-ddr-timing = <0 2>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_int>, <&sd1_bus1>,
+			<&sd1_bus4>, <&wlan_reset>;
+	bus-width = <4>;
+	vqmmc-supply = <&ldo3_reg>;
+	mmc-pwrseq = <&wlan_pwrseq>;
+};
+
 &pinctrl_0 {
 	s2mps11_irq: s2mps11-irq-pins {
 		samsung,pins = "gpx0-7";
@@ -628,6 +652,11 @@ touch_irq: touch-irq-pins {
 		samsung,pins = "gpx1-6";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 	};
+
+	wlan_reset: wlan-reset {
+		samsung,pins = "gpy7-7";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+	};
 };
 
 &rtc {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/7] ARM: dts: exynos: Add GPIO keys support for k3g
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
  2023-07-16 22:05 ` [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support Markuss Broks
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

Add the four physical buttons support, volume buttons have
external pull-up resistors.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index 1a11a6993ba7..c3e006dc34ea 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include <dt-bindings/clock/samsung,s2mps11.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include "exynos5800.dtsi"
 #include "exynos5422-cpus.dtsi"
@@ -21,6 +22,45 @@ / {
 
 	aliases {
 		mmc0 = &mmc_0;
+		mmc1 = &mmc_1;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&power_gpio &volume_up_gpio &volume_down_gpio &home_gpio>;
+
+		key-volume-up {
+			label = "Volume Up";
+			gpios = <&gpx0 2 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+			debounce-interval = <15>;
+		};
+
+		key-volume-down {
+			label = "Volume Down";
+			gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEDOWN>;
+			debounce-interval = <15>;
+		};
+
+		key-home {
+			label = "Home";
+			gpios = <&gpx0 5 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_HOMEPAGE>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		key-power {
+			label = "Power";
+			gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_POWER>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
 	};
 
 	memory@20000000 {
@@ -641,6 +681,21 @@ &mmc_1 {
 };
 
 &pinctrl_0 {
+	volume_up_gpio: volume-up-pins {
+		samsung,pins = "gpx0-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	volume_down_gpio: volume-down-pins {
+		samsung,pins = "gpx0-3";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	home_gpio: home-key-pins {
+		samsung,pins = "gpx0-5";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	s2mps11_irq: s2mps11-irq-pins {
 		samsung,pins = "gpx0-7";
 		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
@@ -653,6 +708,11 @@ touch_irq: touch-irq-pins {
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 	};
 
+	power_gpio: power-key-pins {
+		samsung,pins = "gpx2-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	wlan_reset: wlan-reset {
 		samsung,pins = "gpy7-7";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
  2023-07-16 22:05 ` [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support Markuss Broks
  2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: Add GPIO keys support for k3g Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-19  9:04   ` Krzysztof Kozlowski
  2023-07-16 22:05 ` [PATCH 3/7] ARM: dts: exynos: k3g: Add fuel gauge support Markuss Broks
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

Add the four physical buttons support, volume buttons have
external pull-up resistors.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index 1a11a6993ba7..c3e006dc34ea 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include <dt-bindings/clock/samsung,s2mps11.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include "exynos5800.dtsi"
 #include "exynos5422-cpus.dtsi"
@@ -21,6 +22,45 @@ / {
 
 	aliases {
 		mmc0 = &mmc_0;
+		mmc1 = &mmc_1;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&power_gpio &volume_up_gpio &volume_down_gpio &home_gpio>;
+
+		key-volume-up {
+			label = "Volume Up";
+			gpios = <&gpx0 2 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+			debounce-interval = <15>;
+		};
+
+		key-volume-down {
+			label = "Volume Down";
+			gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEDOWN>;
+			debounce-interval = <15>;
+		};
+
+		key-home {
+			label = "Home";
+			gpios = <&gpx0 5 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_HOMEPAGE>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		key-power {
+			label = "Power";
+			gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_POWER>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
 	};
 
 	memory@20000000 {
@@ -641,6 +681,21 @@ &mmc_1 {
 };
 
 &pinctrl_0 {
+	volume_up_gpio: volume-up-pins {
+		samsung,pins = "gpx0-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	volume_down_gpio: volume-down-pins {
+		samsung,pins = "gpx0-3";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	home_gpio: home-key-pins {
+		samsung,pins = "gpx0-5";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	s2mps11_irq: s2mps11-irq-pins {
 		samsung,pins = "gpx0-7";
 		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
@@ -653,6 +708,11 @@ touch_irq: touch-irq-pins {
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 	};
 
+	power_gpio: power-key-pins {
+		samsung,pins = "gpx2-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	wlan_reset: wlan-reset {
 		samsung,pins = "gpy7-7";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/7] ARM: dts: exynos: k3g: Add fuel gauge support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (2 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-16 22:05 ` [PATCH 4/7] ARM: dts: exynos: k3g: Add touchkeys support Markuss Broks
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This device has Maxim MAX17048 fuel gauge, just like
its Snapdragon counterpart. It inherits the double capacity
issue.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index c3e006dc34ea..582faedd6aab 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -80,6 +80,30 @@ firmware@2073000 {
 		reg = <0x02073000 0x1000>;
 	};
 
+	i2c-battery {
+		compatible = "i2c-gpio";
+
+		sda-gpios = <&gpb0 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpb0 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		battery@36 {
+			compatible = "maxim,max17048";
+			reg = <0x36>;
+
+			interrupt-parent = <&gpx1>;
+			interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&battery_irq>;
+
+			maxim,double-soc; /* Reports double the capacity */
+		};
+	};
+
 	tsp_vdd: regulator-tsp-vdd-en {
 		compatible = "regulator-fixed";
 		regulator-name = "tsp_vdd_en";
@@ -703,6 +727,11 @@ s2mps11_irq: s2mps11-irq-pins {
 		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
 	};
 
+	battery_irq: battery-irq-pins {
+		samsung,pins = "gpx1-5";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+	};
+
 	touch_irq: touch-irq-pins {
 		samsung,pins = "gpx1-6";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/7] ARM: dts: exynos: k3g: Add touchkeys support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (3 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 3/7] ARM: dts: exynos: k3g: Add fuel gauge support Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-16 22:05 ` [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support Markuss Broks
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This device has touch keys that are compatible with those
installed on Samsung TM2 dev board.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index 582faedd6aab..b3576a745054 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -104,6 +104,33 @@ battery@36 {
 		};
 	};
 
+	i2c-touchkey {
+		compatible = "i2c-gpio";
+
+		sda-gpios = <&gpd1 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpd1 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		touchkey@20 {
+			compatible = "cypress,tm2-touchkey";
+			reg = <0x20>;
+
+			interrupt-parent = <&gpy7>;
+			interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&touchkey_irq>;
+
+			vcc-supply = <&ldo38_reg>;
+			vdd-supply = <&ldo30_reg>;
+
+			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
+		};
+	};
+
 	tsp_vdd: regulator-tsp-vdd-en {
 		compatible = "regulator-fixed";
 		regulator-name = "tsp_vdd_en";
@@ -742,6 +769,11 @@ power_gpio: power-key-pins {
 		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 	};
 
+	touchkey_irq: touchkey-irq-pins {
+		samsung,pins = "gpy7-1";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+	};
+
 	wlan_reset: wlan-reset {
 		samsung,pins = "gpy7-7";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (4 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 4/7] ARM: dts: exynos: k3g: Add touchkeys support Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-19  9:17   ` Krzysztof Kozlowski
  2023-07-16 22:05 ` [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported Markuss Broks
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This device has a Texas Instruments LP5562 LED controller
which controls the LEDs which are used as notification lights.
It has three colors which can be combined, supports pulse mode
and other various features.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 47 ++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index b3576a745054..813dbf0438de 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -10,6 +10,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 #include "exynos5800.dtsi"
 #include "exynos5422-cpus.dtsi"
 
@@ -131,6 +132,52 @@ touchkey@20 {
 		};
 	};
 
+	i2c-led {
+		compatible = "i2c-gpio";
+
+		sda-gpios = <&gpy3 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpy3 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		lp5562@30 {
+			compatible = "ti,lp5562";
+			reg = <0x30>;
+
+			clock-mode = /bits/ 8 <2>;
+			label = "notification-leds";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			led@0 {
+				reg = <0>;
+				chan-name = "notification-red";
+				color = <LED_COLOR_ID_RED>;
+				led-cur = /bits/ 8 <0x40>;
+				max-cur = /bits/ 8 <0x40>;
+			};
+
+			led@1 {
+				reg = <1>;
+				chan-name = "notification-green";
+				color = <LED_COLOR_ID_GREEN>;
+				led-cur = /bits/ 8 <0x40>;
+				max-cur = /bits/ 8 <0x40>;
+			};
+
+			led@2 {
+				reg = <2>;
+				chan-name = "notification-blue";
+				color = <LED_COLOR_ID_BLUE>;
+				led-cur = /bits/ 8 <0x40>;
+				max-cur = /bits/ 8 <0x40>;
+			};
+		};
+	};
+
 	tsp_vdd: regulator-tsp-vdd-en {
 		compatible = "regulator-fixed";
 		regulator-name = "tsp_vdd_en";
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (5 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-19  9:18   ` Krzysztof Kozlowski
  2023-07-16 22:05 ` [PATCH 7/7] ARM: dts: exynos: k3g: Add display support Markuss Broks
  2023-07-19  9:03 ` [PATCH 0/7] Add various peripheral support for K3G Krzysztof Kozlowski
  8 siblings, 1 reply; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

Add placeholders for peripherals which we currently lack support for.
This includes Maxim MAX86900 heart rate sensor and oximeter, which
seems to be similar to other health sensors by Maxim, but it is not
fully compatible; STM32F401 MCU which acts like a sensor hub,
which can be flashed and controlled via the SPI bus, for which I made
some simple firmware to check if it's possible to program with custom
code, and it appears you can do so, but at the moment kernel lacks
the APIs to either control sensors directly through the MCU or any
standards for a sensor hub, so it's laid off; WM5110 audio codec which
fails to communicate for some reason.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index 813dbf0438de..e019b630db94 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -743,6 +743,24 @@ rmi4-f12@12 {
 	};
 };
 
+&i2c_3 {
+	status = "okay";
+
+	/* Maxim MAX86900 heart rate sensor and oximeter on address 0x57 */
+};
+
+&spi_0 {
+	status = "okay";
+
+	/* STMicroelectronics STM32F401 MCU to which sensors are connected */
+};
+
+&spi_2 {
+	status = "okay";
+
+	/* Wolfson WM5110 audio codec */
+};
+
 /* eMMC flash */
 &mmc_0 {
 	status = "okay";
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 7/7] ARM: dts: exynos: k3g: Add display support
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (6 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported Markuss Broks
@ 2023-07-16 22:05 ` Markuss Broks
  2023-07-19  9:19   ` Krzysztof Kozlowski
  2023-07-19  9:03 ` [PATCH 0/7] Add various peripheral support for K3G Krzysztof Kozlowski
  8 siblings, 1 reply; 15+ messages in thread
From: Markuss Broks @ 2023-07-16 22:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Markuss Broks, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

This device has Samsung S6E3FA2 DSI display installed,
this adds the device-tree bindings for it but two things
prevent it from being fully usable: one is a bug in Exynos5
DSI subsystem, which I believe is not tested properly;
the bug occurs randomly regardless of any variables, but it
seems to occur less if the Exynos DRM kernel module is loaded
later in the kernel boot process (the bug concludes in display
filling with static) ; another issue is that efforts
to support the S6E3FA2 panel are still going on, and the driver
for the panel is not in the kernel tree yet.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index e019b630db94..954de392afbf 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -203,6 +203,42 @@ &cpu4 {
 	cpu-supply = <&buck6_reg>;
 };
 
+&mixer {
+	status = "okay";
+};
+
+&fimd {
+	status = "okay";
+	samsung,invert-vclk;
+};
+
+&dsi {
+	status = "okay";
+
+	samsung,pll-clock-frequency = <24000000>;
+	samsung,burst-clock-frequency = <500000000>;
+	samsung,esc-clock-frequency = <16000000>;
+
+	vddcore-supply = <&ldo8_reg>;
+	vddio-supply = <&ldo10_reg>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	panel@0 {
+		reg = <0>;
+		compatible = "samsung,s6e3fa2";
+
+		reset-gpios = <&gpy7 4 GPIO_ACTIVE_LOW>;
+
+		vddio-supply = <&ldo25_reg>;
+		vdd-supply = <&ldo28_reg>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&display_reset>;
+	};
+};
+
 &gpu {
 	status = "okay";
 	mali-supply = <&buck4_reg>;
@@ -839,6 +875,11 @@ touchkey_irq: touchkey-irq-pins {
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 	};
 
+	display_reset: display-reset-pins {
+		samsung,pins = "gpy7-4";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+	};
+
 	wlan_reset: wlan-reset {
 		samsung,pins = "gpy7-7";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/7] Add various peripheral support for K3G
  2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
                   ` (7 preceding siblings ...)
  2023-07-16 22:05 ` [PATCH 7/7] ARM: dts: exynos: k3g: Add display support Markuss Broks
@ 2023-07-19  9:03 ` Krzysztof Kozlowski
  8 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:03 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> This series adds support for some peripherals installed on
> Samsung Galaxy S5 (SM-G900H). This includes the WiFi card,
> GPIO keys, fuel gauge, touchkeys, notification LED and display.
> Also documents the peripherals for which we currently lack drivers.
> 
> Markuss Broks (7):
>   ARM: dts: exynos: k3g: Add WiFi card support
>   ARM: dts: exynos: Add GPIO keys support for k3g
>   ARM: dts: exynos: k3g: Add fuel gauge support
>   ARM: dts: exynos: k3g: Add touchkeys support
>   ARM: dts: exynos: k3g: Add notification LED support
>   ARM: dts: exynos: k3g: Document the devices which are not supported
>   ARM: dts: exynos: k3g: Add display support
> 
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 256 +++++++++++++++++++

I don't think you based your tree on anything recent. Looks like
something 1 month old or even older. Please always, always base your
patches on maintainer's tree or recent linux-next.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support
  2023-07-16 22:05 ` [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support Markuss Broks
@ 2023-07-19  9:04   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:04 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> This device has Broadcom BCM4354 WiFi card installed,
> which uses SDIO interface.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---


>  &pinctrl_0 {
>  	s2mps11_irq: s2mps11-irq-pins {
>  		samsung,pins = "gpx0-7";
> @@ -628,6 +652,11 @@ touch_irq: touch-irq-pins {
>  		samsung,pins = "gpx1-6";
>  		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
>  	};
> +
> +	wlan_reset: wlan-reset {

It does not look like you tested the DTS against bindings. Please run
`make dtbs_check` (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).

This is a requirement since few months (half a year?).

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support
  2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support Markuss Broks
@ 2023-07-19  9:04   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:04 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> Add the four physical buttons support, volume buttons have
> external pull-up resistors.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 60 ++++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 

Is it a duplicate? You know it cannot be then applied?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support
  2023-07-16 22:05 ` [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support Markuss Broks
@ 2023-07-19  9:17   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:17 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> This device has a Texas Instruments LP5562 LED controller
> which controls the LEDs which are used as notification lights.
> It has three colors which can be combined, supports pulse mode
> and other various features.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 47 ++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> index b3576a745054..813dbf0438de 100644
> --- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> +++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> @@ -10,6 +10,7 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/leds/common.h>
>  #include "exynos5800.dtsi"
>  #include "exynos5422-cpus.dtsi"
>  
> @@ -131,6 +132,52 @@ touchkey@20 {
>  		};
>  	};
>  
> +	i2c-led {
> +		compatible = "i2c-gpio";
> +
> +		sda-gpios = <&gpy3 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +		scl-gpios = <&gpy3 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +		i2c-gpio,delay-us = <2>;
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		lp5562@30 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Most likely this is led-controller



Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported
  2023-07-16 22:05 ` [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported Markuss Broks
@ 2023-07-19  9:18   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:18 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> Add placeholders for peripherals which we currently lack support for.
> This includes Maxim MAX86900 heart rate sensor and oximeter, which
> seems to be similar to other health sensors by Maxim, but it is not
> fully compatible; STM32F401 MCU which acts like a sensor hub,
> which can be flashed and controlled via the SPI bus, for which I made
> some simple firmware to check if it's possible to program with custom
> code, and it appears you can do so, but at the moment kernel lacks
> the APIs to either control sensors directly through the MCU or any
> standards for a sensor hub, so it's laid off; WM5110 audio codec which
> fails to communicate for some reason.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> index 813dbf0438de..e019b630db94 100644
> --- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> +++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> @@ -743,6 +743,24 @@ rmi4-f12@12 {
>  	};
>  };
>  
> +&i2c_3 {
> +	status = "okay";
> +
> +	/* Maxim MAX86900 heart rate sensor and oximeter on address 0x57 */
> +};
> +
> +&spi_0 {

The node overrides/extends are ordered by name.



Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 7/7] ARM: dts: exynos: k3g: Add display support
  2023-07-16 22:05 ` [PATCH 7/7] ARM: dts: exynos: k3g: Add display support Markuss Broks
@ 2023-07-19  9:19   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-19  9:19 UTC (permalink / raw)
  To: Markuss Broks
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 17/07/2023 00:05, Markuss Broks wrote:
> This device has Samsung S6E3FA2 DSI display installed,

Full stop.

> this adds the device-tree bindings for it but two things

Please do not use "This commit/patch", but imperative mood. See longer
explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

> prevent it from being fully usable: one is a bug in Exynos5
> DSI subsystem, which I believe is not tested properly;

Full stop.

> the bug occurs randomly regardless of any variables, but it
> seems to occur less if the Exynos DRM kernel module is loaded
> later in the kernel boot process (the bug concludes in display
> filling with static) ; another issue is that efforts

Full stop.

> to support the S6E3FA2 panel are still going on, and the driver
> for the panel is not in the kernel tree yet.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 41 ++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> index e019b630db94..954de392afbf 100644
> --- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> +++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
> @@ -203,6 +203,42 @@ &cpu4 {
>  	cpu-supply = <&buck6_reg>;
>  };
>  
> +&mixer {
> +	status = "okay";
> +};
> +
> +&fimd {

Mixed order.

> +	status = "okay";
> +	samsung,invert-vclk;
> +};
> +
> +&dsi {
> +	status = "okay";
> +
> +	samsung,pll-clock-frequency = <24000000>;
> +	samsung,burst-clock-frequency = <500000000>;
> +	samsung,esc-clock-frequency = <16000000>;
> +
> +	vddcore-supply = <&ldo8_reg>;
> +	vddio-supply = <&ldo10_reg>;
> +
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +
> +	panel@0 {
> +		reg = <0>;
> +		compatible = "samsung,s6e3fa2";

Compatible is always the first property. Second is reg.



Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-07-19  9:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-16 22:05 [PATCH 0/7] Add various peripheral support for K3G Markuss Broks
2023-07-16 22:05 ` [PATCH 1/7] ARM: dts: exynos: k3g: Add WiFi card support Markuss Broks
2023-07-19  9:04   ` Krzysztof Kozlowski
2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: Add GPIO keys support for k3g Markuss Broks
2023-07-16 22:05 ` [PATCH 2/7] ARM: dts: exynos: k3g: Add GPIO keys support Markuss Broks
2023-07-19  9:04   ` Krzysztof Kozlowski
2023-07-16 22:05 ` [PATCH 3/7] ARM: dts: exynos: k3g: Add fuel gauge support Markuss Broks
2023-07-16 22:05 ` [PATCH 4/7] ARM: dts: exynos: k3g: Add touchkeys support Markuss Broks
2023-07-16 22:05 ` [PATCH 5/7] ARM: dts: exynos: k3g: Add notification LED support Markuss Broks
2023-07-19  9:17   ` Krzysztof Kozlowski
2023-07-16 22:05 ` [PATCH 6/7] ARM: dts: exynos: k3g: Document the devices which are not supported Markuss Broks
2023-07-19  9:18   ` Krzysztof Kozlowski
2023-07-16 22:05 ` [PATCH 7/7] ARM: dts: exynos: k3g: Add display support Markuss Broks
2023-07-19  9:19   ` Krzysztof Kozlowski
2023-07-19  9:03 ` [PATCH 0/7] Add various peripheral support for K3G Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).