phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support
@ 2021-01-30 10:57 Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 1/4] dt-bindings: vendor-prefixes: add Alcatel Vincent Knecht
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Vincent Knecht @ 2021-01-30 10:57 UTC (permalink / raw)
  To: phone-devel
  Cc: ~postmarketos/upstreaming, Vincent Knecht, Rob Herring,
	Andy Gross, Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Max Merchel, allen, Geert Uytterhoeven, devicetree, linux-kernel,
	linux-arm-msm

Changes in v2:
- Disable MDSS by default in msm8916.dtsi
- Split framebuffer suppport in its own patch
- v1 sent on 2021-01-29 didn't make it to the MLs for some reason...

The Alcatel Idol 3 (4.7") is a msm8916-based smartphone released in 2015.
This series adds support for framebuffer, USB, eMMC, SD-Card, WiFi,
BT, power/volume buttons, vibrator and the following sensors:
magnetometer, accelerometer, gyroscope, ambient light+proximity

Touchscreen support will be added later when MStar msg26xx is merged:
https://lore.kernel.org/linux-input/20210121174359.1455393-1-vincent.knecht@mailoo.org/T/

Vincent Knecht (4):
  dt-bindings: vendor-prefixes: add Alcatel
  arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7")
  arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices
  arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support

 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi     |   4 +
 .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 322 ++++++++++++++++++
 .../qcom/msm8916-samsung-a2015-common.dtsi    |   4 +
 arch/arm64/boot/dts/qcom/msm8916.dtsi         |   1 +
 6 files changed, 334 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts

-- 
2.29.2




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

* [PATCH v2 1/4] dt-bindings: vendor-prefixes: add Alcatel
  2021-01-30 10:57 [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support Vincent Knecht
@ 2021-01-30 10:57 ` Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7") Vincent Knecht
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Vincent Knecht @ 2021-01-30 10:57 UTC (permalink / raw)
  To: phone-devel
  Cc: ~postmarketos/upstreaming, Vincent Knecht, Rob Herring,
	Andy Gross, Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Oleksij Rempel, Daniel Palmer, allen,
	Geert Uytterhoeven, Kuninori Morimoto, devicetree, linux-kernel,
	linux-arm-msm

Document vendor prefix for Alcatel

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 076d4b26261b..7b30fe135d83 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -59,6 +59,8 @@ patternProperties:
     description: Aeroflex Gaisler AB
   "^al,.*":
     description: Annapurna Labs
+  "^alcatel,.*":
+    description: Alcatel
   "^allegro,.*":
     description: Allegro DVT
   "^allo,.*":
-- 
2.29.2




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

* [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7")
  2021-01-30 10:57 [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 1/4] dt-bindings: vendor-prefixes: add Alcatel Vincent Knecht
@ 2021-01-30 10:57 ` Vincent Knecht
  2021-01-30 11:25   ` Stephan Gerhold
  2021-01-30 15:45   ` Konrad Dybcio
  2021-01-30 10:57 ` [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support Vincent Knecht
  3 siblings, 2 replies; 10+ messages in thread
From: Vincent Knecht @ 2021-01-30 10:57 UTC (permalink / raw)
  To: phone-devel
  Cc: ~postmarketos/upstreaming, Vincent Knecht, Rob Herring,
	Andy Gross, Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Kuninori Morimoto, allen, Max Merchel, devicetree, linux-kernel,
	linux-arm-msm

The Alcatel Idol 3 (4.7") is a smartphone based on MSM8916.
Add a device tree with support for USB, eMMC, SD-Card, WiFi,
BT, power/volume buttons, vibrator and the following sensors:
magnetometer, accelerometer, gyroscope, ambient light+proximity

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 291 ++++++++++++++++++
 2 files changed, 292 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 59455db7b493..0feeedb712cc 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-ifc6640.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= ipq6018-cp01-c1.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= ipq8074-hk01.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-alcatel-idol347.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-asus-z00l.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-longcheer-l8150.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-mtp.dtb
diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
new file mode 100644
index 000000000000..540b1fa4b260
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -0,0 +1,291 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+#include "msm8916-pm8916.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Alcatel OneTouch Idol 3 (4.7)";
+	compatible = "alcatel,idol347", "qcom,msm8916";
+
+	aliases {
+		serial0 = &blsp1_uart2;
+	};
+
+	chosen {
+		stdout-path = "serial0";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_keys_default>;
+
+		label = "GPIO Buttons";
+
+		volume-up {
+			label = "Volume Up";
+			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+	};
+
+	usb_id: usb-id {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb_id_default>;
+	};
+};
+
+&blsp1_uart2 {
+	status = "okay";
+};
+
+&blsp_i2c5 {
+	status = "okay";
+
+	magnetometer@c {
+		compatible = "asahi-kasei,ak09911";
+		reg = <0x0c>;
+		vdd-supply = <&pm8916_l17>;
+		vid-supply = <&pm8916_l6>;
+		reset-gpios = <&msmgpio 8 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&mag_reset_default>;
+		mount-matrix = "0", "1", "0",
+			       "-1", "0", "0",
+			       "0", "0", "1";
+	};
+
+	accelerometer@f {
+		compatible = "kionix,kxtj21009";
+		reg = <0x0f>;
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l6>;
+		interrupt-parent = <&msmgpio>;
+		interrupts = <31 IRQ_TYPE_EDGE_RISING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&accel_int_default>;
+		mount-matrix = "-1", "0", "0",
+			       "0", "1", "0",
+			       "0", "0", "-1";
+	};
+
+	proximity@48 {
+		compatible = "sensortek,stk3310";
+		reg = <0x48>;
+		interrupt-parent = <&msmgpio>;
+		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&proximity_int_default>;
+	};
+
+	gyroscope@68 {
+		compatible = "bosch,bmg160";
+		reg = <0x68>;
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l6>;
+		interrupt-parent = <&msmgpio>;
+		interrupts = <97 IRQ_TYPE_EDGE_RISING>,
+			     <98 IRQ_TYPE_EDGE_RISING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&gyro_int_default>;
+	};
+};
+
+&pm8916_resin {
+	status = "okay";
+	linux,code = <KEY_VOLUMEDOWN>;
+};
+
+&pm8916_vib {
+	status = "okay";
+};
+
+&pronto {
+	status = "okay";
+};
+
+&sdhc_1 {
+	status = "okay";
+
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
+	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
+};
+
+&sdhc_2 {
+	status = "okay";
+
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
+	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
+
+	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
+};
+
+&usb {
+	status = "okay";
+	extcon = <&usb_id>, <&usb_id>;
+};
+
+&usb_hs_phy {
+	extcon = <&usb_id>;
+};
+
+&smd_rpm_regulators {
+	vdd_l1_l2_l3-supply = <&pm8916_s3>;
+	vdd_l4_l5_l6-supply = <&pm8916_s4>;
+	vdd_l7-supply = <&pm8916_s4>;
+
+	s3 {
+		regulator-min-microvolt = <1200000>;
+		regulator-max-microvolt = <1300000>;
+	};
+
+	s4 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <2100000>;
+	};
+
+	l1 {
+		regulator-min-microvolt = <1225000>;
+		regulator-max-microvolt = <1225000>;
+	};
+
+	l2 {
+		regulator-min-microvolt = <1200000>;
+		regulator-max-microvolt = <1200000>;
+	};
+
+	l4 {
+		regulator-min-microvolt = <2050000>;
+		regulator-max-microvolt = <2050000>;
+	};
+
+	l5 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	l6 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	l7 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	l8 {
+		regulator-min-microvolt = <2850000>;
+		regulator-max-microvolt = <2900000>;
+	};
+
+	l9 {
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	l10 {
+		regulator-min-microvolt = <2700000>;
+		regulator-max-microvolt = <2800000>;
+	};
+
+	l11 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <2950000>;
+		regulator-allow-set-load;
+		regulator-system-load = <200000>;
+	};
+
+	l12 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <2950000>;
+	};
+
+	l13 {
+		regulator-min-microvolt = <3075000>;
+		regulator-max-microvolt = <3075000>;
+	};
+
+	l14 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	l15 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	l16 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	l17 {
+		regulator-min-microvolt = <2850000>;
+		regulator-max-microvolt = <2850000>;
+	};
+
+	l18 {
+		regulator-min-microvolt = <2700000>;
+		regulator-max-microvolt = <2700000>;
+	};
+};
+
+&msmgpio {
+	accel_int_default: accel-int-default {
+		pins = "gpio31";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	gpio_keys_default: gpio-keys-default {
+		pins = "gpio107";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	gyro_int_default: gyro-int-default {
+		pins = "gpio97", "gpio98";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	mag_reset_default: mag-reset-default {
+		pins = "gpio8";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	proximity_int_default: proximity-int-default {
+		pins = "gpio12";
+		function = "gpio";
+
+		drive-strength = <6>;
+		bias-pull-up;
+	};
+
+	usb_id_default: usb-id-default {
+		pins = "gpio69";
+		function = "gpio";
+
+		drive-strength = <8>;
+		bias-pull-up;
+	};
+};
-- 
2.29.2




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

* [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices
  2021-01-30 10:57 [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 1/4] dt-bindings: vendor-prefixes: add Alcatel Vincent Knecht
  2021-01-30 10:57 ` [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7") Vincent Knecht
@ 2021-01-30 10:57 ` Vincent Knecht
  2021-01-30 11:28   ` Stephan Gerhold
  2021-01-30 15:40   ` Konrad Dybcio
  2021-01-30 10:57 ` [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support Vincent Knecht
  3 siblings, 2 replies; 10+ messages in thread
From: Vincent Knecht @ 2021-01-30 10:57 UTC (permalink / raw)
  To: phone-devel
  Cc: ~postmarketos/upstreaming, Vincent Knecht, Rob Herring,
	Andy Gross, Bjorn Andersson, Sam Ravnborg, Arnd Bergmann,
	Krzysztof Kozlowski, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Max Merchel, Geert Uytterhoeven, allen, devicetree, linux-kernel,
	linux-arm-msm

Disable MDSS (Mobile Display Subsystem) by default in msm8916.dtsi
and only explicitly enable it in devices' DT which actually use it.

This leads to faster boot and cleaner logs for other devices,
which also won't have to explicitly disable MDSS to use framebuffer.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi                  | 4 ++++
 arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi | 4 ++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi                      | 1 +
 3 files changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
index 3a9538e1ec97..6aef0c2e4f0a 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
@@ -301,6 +301,10 @@ &lpass {
 	status = "okay";
 };
 
+&mdss {
+	status = "okay";
+};
+
 &pm8916_resin {
 	status = "okay";
 	linux,code = <KEY_VOLUMEDOWN>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
index f1af798abd74..230ba3ce3277 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
@@ -132,6 +132,10 @@ &dsi0 {
 	pinctrl-1 = <&mdss_sleep>;
 };
 
+&mdss {
+	status = "okay";
+};
+
 &pm8916_resin {
 	status = "okay";
 	linux,code = <KEY_VOLUMEDOWN>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 402e891a84ab..8f9a651d3827 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -913,6 +913,7 @@ tcsr: syscon@1937000 {
 		};
 
 		mdss: mdss@1a00000 {
+			status = "disabled";
 			compatible = "qcom,mdss";
 			reg = <0x01a00000 0x1000>,
 			      <0x01ac8000 0x3000>;
-- 
2.29.2




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

* [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support
  2021-01-30 10:57 [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support Vincent Knecht
                   ` (2 preceding siblings ...)
  2021-01-30 10:57 ` [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices Vincent Knecht
@ 2021-01-30 10:57 ` Vincent Knecht
  2021-01-30 15:42   ` Konrad Dybcio
  3 siblings, 1 reply; 10+ messages in thread
From: Vincent Knecht @ 2021-01-30 10:57 UTC (permalink / raw)
  To: phone-devel
  Cc: ~postmarketos/upstreaming, Vincent Knecht, Rob Herring,
	Andy Gross, Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel, allen,
	Max Merchel, Kuninori Morimoto, devicetree, linux-kernel,
	linux-arm-msm

Add simple-framebuffer support and related reserved-memory block.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
 .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
index 540b1fa4b260..e4d22cec8ff0 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include "msm8916-pm8916.dtsi"
+#include <dt-bindings/clock/qcom,gcc-msm8916.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
@@ -16,6 +17,36 @@ aliases {
 
 	chosen {
 		stdout-path = "serial0";
+
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		framebuffer0: framebuffer@83200000 {
+			status = "okay";
+			compatible = "simple-framebuffer";
+			reg = <0x0 0x83200000 0x0 (720 * 1280 * 3)>;
+			width = <720>;
+			height = <1280>;
+			stride = <(720 * 3)>;
+			format = "r8g8b8";
+			power-domains = <&gcc MDSS_GDSC>;
+			clocks = <&gcc GCC_MDSS_AHB_CLK>,
+				 <&gcc GCC_MDSS_VSYNC_CLK>,
+				 <&gcc GCC_MDSS_AXI_CLK>,
+				 <&gcc GCC_MDSS_MDP_CLK>,
+				 <&gcc GCC_MDSS_BYTE0_CLK>,
+				 <&gcc GCC_MDSS_PCLK0_CLK>,
+				 <&gcc GCC_MDSS_ESC0_CLK>,
+				 <&xo_board>;
+		};
+	};
+
+	reserved-memory {
+		continuous_splash: framebuffer@83000000 {
+			reg = <0x0 0x83000000 0x0 0x1400000>;
+			no-map;
+		};
 	};
 
 	gpio-keys {
-- 
2.29.2




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

* Re: [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7")
  2021-01-30 10:57 ` [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7") Vincent Knecht
@ 2021-01-30 11:25   ` Stephan Gerhold
  2021-01-30 15:45   ` Konrad Dybcio
  1 sibling, 0 replies; 10+ messages in thread
From: Stephan Gerhold @ 2021-01-30 11:25 UTC (permalink / raw)
  To: Vincent Knecht
  Cc: phone-devel, ~postmarketos/upstreaming, Rob Herring, Andy Gross,
	Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Kuninori Morimoto, allen, Max Merchel, devicetree, linux-kernel,
	linux-arm-msm

On Sat, Jan 30, 2021 at 11:57:11AM +0100, Vincent Knecht wrote:
> The Alcatel Idol 3 (4.7") is a smartphone based on MSM8916.
> Add a device tree with support for USB, eMMC, SD-Card, WiFi,
> BT, power/volume buttons, vibrator and the following sensors:
> magnetometer, accelerometer, gyroscope, ambient light+proximity
> 
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>

Reviewed-by: Stephan Gerhold <stephan@gerhold.net>

> ---
>  arch/arm64/boot/dts/qcom/Makefile             |   1 +
>  .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 291 ++++++++++++++++++
>  2 files changed, 292 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> 
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index 59455db7b493..0feeedb712cc 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-ifc6640.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= ipq6018-cp01-c1.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= ipq8074-hk01.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-alcatel-idol347.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-asus-z00l.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-longcheer-l8150.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-mtp.dtb
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> new file mode 100644
> index 000000000000..540b1fa4b260
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -0,0 +1,291 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +/dts-v1/;
> +
> +#include "msm8916-pm8916.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	model = "Alcatel OneTouch Idol 3 (4.7)";
> +	compatible = "alcatel,idol347", "qcom,msm8916";
> +
> +	aliases {
> +		serial0 = &blsp1_uart2;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0";
> +	};
> +
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_keys_default>;
> +
> +		label = "GPIO Buttons";
> +
> +		volume-up {
> +			label = "Volume Up";
> +			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_VOLUMEUP>;
> +		};
> +	};
> +
> +	usb_id: usb-id {
> +		compatible = "linux,extcon-usb-gpio";
> +		id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&usb_id_default>;
> +	};
> +};
> +
> +&blsp1_uart2 {
> +	status = "okay";
> +};
> +
> +&blsp_i2c5 {
> +	status = "okay";
> +
> +	magnetometer@c {
> +		compatible = "asahi-kasei,ak09911";
> +		reg = <0x0c>;
> +		vdd-supply = <&pm8916_l17>;
> +		vid-supply = <&pm8916_l6>;
> +		reset-gpios = <&msmgpio 8 GPIO_ACTIVE_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&mag_reset_default>;
> +		mount-matrix = "0", "1", "0",
> +			       "-1", "0", "0",
> +			       "0", "0", "1";
> +	};
> +
> +	accelerometer@f {
> +		compatible = "kionix,kxtj21009";
> +		reg = <0x0f>;
> +		vdd-supply = <&pm8916_l17>;
> +		vddio-supply = <&pm8916_l6>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <31 IRQ_TYPE_EDGE_RISING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&accel_int_default>;
> +		mount-matrix = "-1", "0", "0",
> +			       "0", "1", "0",
> +			       "0", "0", "-1";
> +	};
> +
> +	proximity@48 {
> +		compatible = "sensortek,stk3310";
> +		reg = <0x48>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&proximity_int_default>;
> +	};
> +
> +	gyroscope@68 {
> +		compatible = "bosch,bmg160";
> +		reg = <0x68>;
> +		vdd-supply = <&pm8916_l17>;
> +		vddio-supply = <&pm8916_l6>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <97 IRQ_TYPE_EDGE_RISING>,
> +			     <98 IRQ_TYPE_EDGE_RISING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gyro_int_default>;
> +	};
> +};
> +
> +&pm8916_resin {
> +	status = "okay";
> +	linux,code = <KEY_VOLUMEDOWN>;
> +};
> +
> +&pm8916_vib {
> +	status = "okay";
> +};
> +
> +&pronto {
> +	status = "okay";
> +};
> +
> +&sdhc_1 {
> +	status = "okay";
> +
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
> +	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
> +};
> +
> +&sdhc_2 {
> +	status = "okay";
> +
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
> +	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
> +
> +	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
> +};
> +
> +&usb {
> +	status = "okay";
> +	extcon = <&usb_id>, <&usb_id>;
> +};
> +
> +&usb_hs_phy {
> +	extcon = <&usb_id>;
> +};
> +
> +&smd_rpm_regulators {
> +	vdd_l1_l2_l3-supply = <&pm8916_s3>;
> +	vdd_l4_l5_l6-supply = <&pm8916_s4>;
> +	vdd_l7-supply = <&pm8916_s4>;
> +
> +	s3 {
> +		regulator-min-microvolt = <1200000>;
> +		regulator-max-microvolt = <1300000>;
> +	};
> +
> +	s4 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2100000>;
> +	};
> +
> +	l1 {
> +		regulator-min-microvolt = <1225000>;
> +		regulator-max-microvolt = <1225000>;
> +	};
> +
> +	l2 {
> +		regulator-min-microvolt = <1200000>;
> +		regulator-max-microvolt = <1200000>;
> +	};
> +
> +	l4 {
> +		regulator-min-microvolt = <2050000>;
> +		regulator-max-microvolt = <2050000>;
> +	};
> +
> +	l5 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l6 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l7 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l8 {
> +		regulator-min-microvolt = <2850000>;
> +		regulator-max-microvolt = <2900000>;
> +	};
> +
> +	l9 {
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l10 {
> +		regulator-min-microvolt = <2700000>;
> +		regulator-max-microvolt = <2800000>;
> +	};
> +
> +	l11 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2950000>;
> +		regulator-allow-set-load;
> +		regulator-system-load = <200000>;
> +	};
> +
> +	l12 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2950000>;
> +	};
> +
> +	l13 {
> +		regulator-min-microvolt = <3075000>;
> +		regulator-max-microvolt = <3075000>;
> +	};
> +
> +	l14 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l15 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l16 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l17 {
> +		regulator-min-microvolt = <2850000>;
> +		regulator-max-microvolt = <2850000>;
> +	};
> +
> +	l18 {
> +		regulator-min-microvolt = <2700000>;
> +		regulator-max-microvolt = <2700000>;
> +	};
> +};
> +
> +&msmgpio {
> +	accel_int_default: accel-int-default {
> +		pins = "gpio31";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	gpio_keys_default: gpio-keys-default {
> +		pins = "gpio107";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
> +	gyro_int_default: gyro-int-default {
> +		pins = "gpio97", "gpio98";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	mag_reset_default: mag-reset-default {
> +		pins = "gpio8";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	proximity_int_default: proximity-int-default {
> +		pins = "gpio12";
> +		function = "gpio";
> +
> +		drive-strength = <6>;
> +		bias-pull-up;
> +	};
> +
> +	usb_id_default: usb-id-default {
> +		pins = "gpio69";
> +		function = "gpio";
> +
> +		drive-strength = <8>;
> +		bias-pull-up;
> +	};
> +};
> -- 
> 2.29.2
> 
> 
> 

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

* Re: [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices
  2021-01-30 10:57 ` [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices Vincent Knecht
@ 2021-01-30 11:28   ` Stephan Gerhold
  2021-01-30 15:40   ` Konrad Dybcio
  1 sibling, 0 replies; 10+ messages in thread
From: Stephan Gerhold @ 2021-01-30 11:28 UTC (permalink / raw)
  To: Vincent Knecht
  Cc: phone-devel, ~postmarketos/upstreaming, Rob Herring, Andy Gross,
	Bjorn Andersson, Sam Ravnborg, Arnd Bergmann,
	Krzysztof Kozlowski, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Max Merchel, Geert Uytterhoeven, allen, devicetree, linux-kernel,
	linux-arm-msm

On Sat, Jan 30, 2021 at 11:57:12AM +0100, Vincent Knecht wrote:
> Disable MDSS (Mobile Display Subsystem) by default in msm8916.dtsi
> and only explicitly enable it in devices' DT which actually use it.
> 
> This leads to faster boot and cleaner logs for other devices,
> which also won't have to explicitly disable MDSS to use framebuffer.
> 
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>

Thanks for the patch! I think this is a good thing because normally most
things are disabled by default in msm8916.dtsi (e.g. eMMC, SD card,
WCNSS, ....). Also, there are actually some devices that don't have a
display (e.g. the 4IoT board [1]). Having to disable it specifically is
kind of weird. So:

Reviewed-by: Stephan Gerhold <stephan@gerhold.net>

[1]: https://www.96boards.org/product/4iot/

> ---
>  arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi                  | 4 ++++
>  arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi | 4 ++++
>  arch/arm64/boot/dts/qcom/msm8916.dtsi                      | 1 +
>  3 files changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> index 3a9538e1ec97..6aef0c2e4f0a 100644
> --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> @@ -301,6 +301,10 @@ &lpass {
>  	status = "okay";
>  };
>  
> +&mdss {
> +	status = "okay";
> +};
> +
>  &pm8916_resin {
>  	status = "okay";
>  	linux,code = <KEY_VOLUMEDOWN>;
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> index f1af798abd74..230ba3ce3277 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> @@ -132,6 +132,10 @@ &dsi0 {
>  	pinctrl-1 = <&mdss_sleep>;
>  };
>  
> +&mdss {
> +	status = "okay";
> +};
> +
>  &pm8916_resin {
>  	status = "okay";
>  	linux,code = <KEY_VOLUMEDOWN>;
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 402e891a84ab..8f9a651d3827 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -913,6 +913,7 @@ tcsr: syscon@1937000 {
>  		};
>  
>  		mdss: mdss@1a00000 {
> +			status = "disabled";
>  			compatible = "qcom,mdss";
>  			reg = <0x01a00000 0x1000>,
>  			      <0x01ac8000 0x3000>;
> -- 
> 2.29.2
> 
> 
> 

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

* Re: [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices
  2021-01-30 10:57 ` [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices Vincent Knecht
  2021-01-30 11:28   ` Stephan Gerhold
@ 2021-01-30 15:40   ` Konrad Dybcio
  1 sibling, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2021-01-30 15:40 UTC (permalink / raw)
  To: Vincent Knecht, phone-devel
  Cc: ~postmarketos/upstreaming, Rob Herring, Andy Gross,
	Bjorn Andersson, Sam Ravnborg, Arnd Bergmann,
	Krzysztof Kozlowski, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Max Merchel, Geert Uytterhoeven, allen, devicetree, linux-kernel,
	linux-arm-msm


On 30.01.2021 11:57, Vincent Knecht wrote:
> Disable MDSS (Mobile Display Subsystem) by default in msm8916.dtsi
> and only explicitly enable it in devices' DT which actually use it.
>
> This leads to faster boot and cleaner logs for other devices,
> which also won't have to explicitly disable MDSS to use framebuffer.
>
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>  arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi                  | 4 ++++
>  arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi | 4 ++++
>  arch/arm64/boot/dts/qcom/msm8916.dtsi                      | 1 +
>  3 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> index 3a9538e1ec97..6aef0c2e4f0a 100644
> --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> @@ -301,6 +301,10 @@ &lpass {
>  	status = "okay";
>  };
>  
> +&mdss {
> +	status = "okay";
> +};
> +
>  &pm8916_resin {
>  	status = "okay";
>  	linux,code = <KEY_VOLUMEDOWN>;
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> index f1af798abd74..230ba3ce3277 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> @@ -132,6 +132,10 @@ &dsi0 {
>  	pinctrl-1 = <&mdss_sleep>;
>  };
>  
> +&mdss {
> +	status = "okay";
> +};
> +
>  &pm8916_resin {
>  	status = "okay";
>  	linux,code = <KEY_VOLUMEDOWN>;
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 402e891a84ab..8f9a651d3827 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -913,6 +913,7 @@ tcsr: syscon@1937000 {
>  		};
>  
>  		mdss: mdss@1a00000 {
> +			status = "disabled";
>  			compatible = "qcom,mdss";
>  			reg = <0x01a00000 0x1000>,
>  			      <0x01ac8000 0x3000>;
>

Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>

Konrad


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

* Re: [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support
  2021-01-30 10:57 ` [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support Vincent Knecht
@ 2021-01-30 15:42   ` Konrad Dybcio
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2021-01-30 15:42 UTC (permalink / raw)
  To: Vincent Knecht, phone-devel
  Cc: ~postmarketos/upstreaming, Rob Herring, Andy Gross,
	Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel, allen,
	Max Merchel, Kuninori Morimoto, devicetree, linux-kernel,
	linux-arm-msm


On 30.01.2021 11:57, Vincent Knecht wrote:
> Add simple-framebuffer support and related reserved-memory block.
>
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> ---
>  .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 31 +++++++++++++++++++
>  1 file changed, 31 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> index 540b1fa4b260..e4d22cec8ff0 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -3,6 +3,7 @@
>  /dts-v1/;
>  
>  #include "msm8916-pm8916.dtsi"
> +#include <dt-bindings/clock/qcom,gcc-msm8916.h>
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  
> @@ -16,6 +17,36 @@ aliases {
>  
>  	chosen {
>  		stdout-path = "serial0";
> +
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		framebuffer0: framebuffer@83200000 {
> +			status = "okay";
> +			compatible = "simple-framebuffer";
> +			reg = <0x0 0x83200000 0x0 (720 * 1280 * 3)>;
> +			width = <720>;
> +			height = <1280>;
> +			stride = <(720 * 3)>;
> +			format = "r8g8b8";
> +			power-domains = <&gcc MDSS_GDSC>;
> +			clocks = <&gcc GCC_MDSS_AHB_CLK>,
> +				 <&gcc GCC_MDSS_VSYNC_CLK>,
> +				 <&gcc GCC_MDSS_AXI_CLK>,
> +				 <&gcc GCC_MDSS_MDP_CLK>,
> +				 <&gcc GCC_MDSS_BYTE0_CLK>,
> +				 <&gcc GCC_MDSS_PCLK0_CLK>,

I'm not sure about BYTE/PCLK, it used to cause issues at least on my boards, but if it works for you, I guess it's only good.


> +				 <&gcc GCC_MDSS_ESC0_CLK>,
> +				 <&xo_board>;

Fake XO seems redundant here.


> +		};
> +	};
> +
> +	reserved-memory {
> +		continuous_splash: framebuffer@83000000 {
> +			reg = <0x0 0x83000000 0x0 0x1400000>;
> +			no-map;
> +		};
>  	};
>  
>  	gpio-keys {
>

Konrad


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

* Re: [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7")
  2021-01-30 10:57 ` [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7") Vincent Knecht
  2021-01-30 11:25   ` Stephan Gerhold
@ 2021-01-30 15:45   ` Konrad Dybcio
  1 sibling, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2021-01-30 15:45 UTC (permalink / raw)
  To: Vincent Knecht, phone-devel
  Cc: ~postmarketos/upstreaming, Rob Herring, Andy Gross,
	Bjorn Andersson, Sam Ravnborg, Krzysztof Kozlowski,
	Arnd Bergmann, Shawn Guo, Daniel Palmer, Oleksij Rempel,
	Kuninori Morimoto, allen, Max Merchel, devicetree, linux-kernel,
	linux-arm-msm


On 30.01.2021 11:57, Vincent Knecht wrote:
> The Alcatel Idol 3 (4.7") is a smartphone based on MSM8916.
> Add a device tree with support for USB, eMMC, SD-Card, WiFi,
> BT, power/volume buttons, vibrator and the following sensors:
> magnetometer, accelerometer, gyroscope, ambient light+proximity
>
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>  arch/arm64/boot/dts/qcom/Makefile             |   1 +
>  .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 291 ++++++++++++++++++
>  2 files changed, 292 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
>
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index 59455db7b493..0feeedb712cc 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-ifc6640.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= ipq6018-cp01-c1.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= ipq8074-hk01.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-alcatel-idol347.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-asus-z00l.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-longcheer-l8150.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-mtp.dtb
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> new file mode 100644
> index 000000000000..540b1fa4b260
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -0,0 +1,291 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +/dts-v1/;
> +
> +#include "msm8916-pm8916.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	model = "Alcatel OneTouch Idol 3 (4.7)";
> +	compatible = "alcatel,idol347", "qcom,msm8916";
> +
> +	aliases {
> +		serial0 = &blsp1_uart2;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0";
> +	};
> +
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_keys_default>;
> +
> +		label = "GPIO Buttons";
> +
> +		volume-up {
> +			label = "Volume Up";
> +			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_VOLUMEUP>;
> +		};
> +	};
> +
> +	usb_id: usb-id {
> +		compatible = "linux,extcon-usb-gpio";
> +		id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&usb_id_default>;
> +	};
> +};
> +
> +&blsp1_uart2 {
> +	status = "okay";
> +};
> +
> +&blsp_i2c5 {
> +	status = "okay";
> +
> +	magnetometer@c {
> +		compatible = "asahi-kasei,ak09911";
> +		reg = <0x0c>;
> +		vdd-supply = <&pm8916_l17>;
> +		vid-supply = <&pm8916_l6>;
> +		reset-gpios = <&msmgpio 8 GPIO_ACTIVE_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&mag_reset_default>;
> +		mount-matrix = "0", "1", "0",
> +			       "-1", "0", "0",
> +			       "0", "0", "1";
> +	};
> +
> +	accelerometer@f {
> +		compatible = "kionix,kxtj21009";
> +		reg = <0x0f>;
> +		vdd-supply = <&pm8916_l17>;
> +		vddio-supply = <&pm8916_l6>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <31 IRQ_TYPE_EDGE_RISING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&accel_int_default>;
> +		mount-matrix = "-1", "0", "0",
> +			       "0", "1", "0",
> +			       "0", "0", "-1";
> +	};
> +
> +	proximity@48 {
> +		compatible = "sensortek,stk3310";
> +		reg = <0x48>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&proximity_int_default>;
> +	};
> +
> +	gyroscope@68 {
> +		compatible = "bosch,bmg160";
> +		reg = <0x68>;
> +		vdd-supply = <&pm8916_l17>;
> +		vddio-supply = <&pm8916_l6>;
> +		interrupt-parent = <&msmgpio>;
> +		interrupts = <97 IRQ_TYPE_EDGE_RISING>,
> +			     <98 IRQ_TYPE_EDGE_RISING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gyro_int_default>;
> +	};
> +};
> +
> +&pm8916_resin {
> +	status = "okay";
> +	linux,code = <KEY_VOLUMEDOWN>;
> +};
> +
> +&pm8916_vib {
> +	status = "okay";
> +};
> +
> +&pronto {
> +	status = "okay";
> +};
> +
> +&sdhc_1 {
> +	status = "okay";
> +
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
> +	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
> +};
> +
> +&sdhc_2 {
> +	status = "okay";
> +
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
> +	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
> +
> +	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
> +};
> +
> +&usb {
> +	status = "okay";
> +	extcon = <&usb_id>, <&usb_id>;
> +};
> +
> +&usb_hs_phy {
> +	extcon = <&usb_id>;
> +};
> +
> +&smd_rpm_regulators {
> +	vdd_l1_l2_l3-supply = <&pm8916_s3>;
> +	vdd_l4_l5_l6-supply = <&pm8916_s4>;
> +	vdd_l7-supply = <&pm8916_s4>;
> +
> +	s3 {
> +		regulator-min-microvolt = <1200000>;
> +		regulator-max-microvolt = <1300000>;
> +	};
> +
> +	s4 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2100000>;
> +	};
> +
> +	l1 {
> +		regulator-min-microvolt = <1225000>;
> +		regulator-max-microvolt = <1225000>;
> +	};
> +
> +	l2 {
> +		regulator-min-microvolt = <1200000>;
> +		regulator-max-microvolt = <1200000>;
> +	};
> +
> +	l4 {
> +		regulator-min-microvolt = <2050000>;
> +		regulator-max-microvolt = <2050000>;
> +	};
> +
> +	l5 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l6 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l7 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	l8 {
> +		regulator-min-microvolt = <2850000>;
> +		regulator-max-microvolt = <2900000>;
> +	};
> +
> +	l9 {
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l10 {
> +		regulator-min-microvolt = <2700000>;
> +		regulator-max-microvolt = <2800000>;
> +	};
> +
> +	l11 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2950000>;
> +		regulator-allow-set-load;
> +		regulator-system-load = <200000>;
> +	};
> +
> +	l12 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <2950000>;
> +	};
> +
> +	l13 {
> +		regulator-min-microvolt = <3075000>;
> +		regulator-max-microvolt = <3075000>;
> +	};
> +
> +	l14 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l15 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l16 {
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	l17 {
> +		regulator-min-microvolt = <2850000>;
> +		regulator-max-microvolt = <2850000>;
> +	};
> +
> +	l18 {
> +		regulator-min-microvolt = <2700000>;
> +		regulator-max-microvolt = <2700000>;
> +	};
> +};
> +
> +&msmgpio {
> +	accel_int_default: accel-int-default {
> +		pins = "gpio31";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	gpio_keys_default: gpio-keys-default {
> +		pins = "gpio107";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
> +	gyro_int_default: gyro-int-default {
> +		pins = "gpio97", "gpio98";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	mag_reset_default: mag-reset-default {
> +		pins = "gpio8";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
> +	proximity_int_default: proximity-int-default {
> +		pins = "gpio12";
> +		function = "gpio";
> +
> +		drive-strength = <6>;
> +		bias-pull-up;
> +	};
> +
> +	usb_id_default: usb-id-default {
> +		pins = "gpio69";
> +		function = "gpio";
> +
> +		drive-strength = <8>;
> +		bias-pull-up;
> +	};
> +};
>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>


Konrad


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

end of thread, other threads:[~2021-01-30 16:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30 10:57 [PATCH v2 0/4] Alcatel Idol 3 (4.7") smartphone support Vincent Knecht
2021-01-30 10:57 ` [PATCH v2 1/4] dt-bindings: vendor-prefixes: add Alcatel Vincent Knecht
2021-01-30 10:57 ` [PATCH v2 2/4] arm64: dts: qcom: Add device tree for Alcatel Idol 3 (4.7") Vincent Knecht
2021-01-30 11:25   ` Stephan Gerhold
2021-01-30 15:45   ` Konrad Dybcio
2021-01-30 10:57 ` [PATCH v2 3/4] arm64: dts: qcom: Disable MDSS by default for 8916/8016 devices Vincent Knecht
2021-01-30 11:28   ` Stephan Gerhold
2021-01-30 15:40   ` Konrad Dybcio
2021-01-30 10:57 ` [PATCH v2 4/4] arm64: dts: qcom: msm8916-alcatel-idol347: Add framebuffer support Vincent Knecht
2021-01-30 15:42   ` Konrad Dybcio

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).