Skip to contentSkip to conversation

Add initial support for BQ Aquaris X5

PATCH In review Jonathan Albrieux 2 participants 5 messages Jan 25, 2021 – Jan 26, 2021

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

v2 cover Add initial support for BQ Aquaris X5

v2:
- reorder I2C devices sorting them by address

v1:
- initial patch submission
https://lore.kernel.org/linux-arm-msm/[email protected]/

Aquaris X5 (Longcheer L8910) is a smartphone released by BQ in 2015.

As part of msm8916-mainline project, this series aims to bring initial mainline support for it.

Features added:
- SDHCI (internal and external storage)
- USB Device Mode
- UART
- Regulators
- WiFi/BT
- Volume buttons
- Vibrator
- Touchkeys backlight
- Accelerometer and gyroscope sensor
- Magnetometer sensor

Jonathan Albrieux (3):
arm64: dts: qcom: Add device tree for BQ Aquaris X5 (Longcheer L8910)
arm64: dts: qcom: msm8916: Add blsp_i2c3
arm64: dts: qcom: msm8916-longcheer-l8910: Add imu/magnetometer

 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 267 ++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi    |  16 ++
 arch/arm64/boot/dts/qcom/msm8916.dtsi         |  15 +
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 arm64: dts: qcom: Add device tree for BQ Aquaris X5 (Longcheer L8910)

BQ Aquaris X5 (Longcheer L8910) is a smartphone using the MSM8916 SoC.

Add device tree with initial support for:

- SDHCI (internal and external storage)
- USB Device Mode
- UART
- Regulators
- WiFi/BT
- Volume buttons
- Vibrator
- Touchkeys backlight

This device tree is based on downstream device tree from BQ and from Longcheer L8915 device tree.

---
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 230 ++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index b5d86739f781..94b76a7ac6ba 100644
@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= ipq6018-cp01-c1.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= ipq8074-hk01.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-asus-z00l.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-longcheer-l8150.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-longcheer-l8910.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-samsung-a3u-eur.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8916-samsung-a5u-eur.dtb
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts new file +230 -0

230 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/3 arm64: dts: qcom: msm8916: Add blsp_i2c3

In reply to Jonathan Albrieux

MSM8916 has another I2C QUP controller that can be enabled on GPIO 10 and 11.

Add blsp_i2c3 to msm8916.dtsi and disable it by default.

---
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 16 ++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi      | 15 +++++++++++++++
 2 files changed, 31 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +16 -0
index 4dc437f13fa5..7dedb91b9930 100644
@@ -220,6 +220,22 @@
 		bias-disable;
 	};
 
+	i2c3_default: i2c3-default {
+		pins = "gpio10", "gpio11";
+		function = "blsp_i2c3";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	i2c3_sleep: i2c3-sleep {
+		pins = "gpio10", "gpio11";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	i2c4_default: i2c4-default {
 		pins = "gpio14", "gpio15";
 		function = "blsp_i2c4";
arch/arm64/boot/dts/qcom/msm8916.dtsi +15 -0
index 402e891a84ab..1045d7e518f3 100644
@@ -1528,6 +1528,21 @@
 			status = "disabled";
 		};
 
+		blsp_i2c3: i2c@78b7000 {
+			compatible = "qcom,i2c-qup-v2.2.1";
+			reg = <0x078b7000 0x500>;
+			interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+				 <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>;
+			clock-names = "iface", "core";
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&i2c3_default>;
+			pinctrl-1 = <&i2c3_sleep>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		blsp_spi3: spi@78b7000 {
 			compatible = "qcom,spi-qup-v2.2.1";
 			reg = <0x078b7000 0x500>;
Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 3/3 arm64: dts: qcom: msm8916-longcheer-l8910: Add imu/magnetometer

In reply to Jonathan Albrieux

BQ Aquaris X5 (Longcheer L8910) has:
- BMI160 accelerometer and gyroscope sensor
- AK09911 magnetometer sensor
Add them to the device tree.

This patch depends on patch "arm64: dts: qcom: msm8916: Add blsp_i2c3".

---
 .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts +37 -0
index 7d5eff922f41..27845189ac2b 100644
@@ -56,6 +56,35 @@
 	};
 };
 
+&blsp_i2c3 {
+	status = "okay";
+
+	magnetometer@d {
+		compatible = "asahi-kasei,ak09911";
+		reg = <0x0d>;
+
+		vdd-supply = <&pm8916_l17>;
+		vid-supply = <&pm8916_l6>;
+
+		reset-gpios = <&msmgpio 111 GPIO_ACTIVE_LOW>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&mag_reset_default>;
+	};
+
+	imu@68 {
+		compatible = "bosch,bmi160";
+		reg = <0x68>;
+
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l6>;
+
+		mount-matrix = "0", "1", "0",
+			      "-1", "0", "0",
+			       "0", "0", "1";
+	};
+};
+
 &blsp1_uart2 {
 	status = "okay";
 };
@@ -220,6 +249,14 @@
 		bias-pull-up;
 	};
 
+	mag_reset_default: mag-reset-default {
+		pins = "gpio111";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	usb_id_default: usb-id-default {
 		pins = "gpio110";
 		function = "gpio";
Signature · 1 line
2.17.1
Reviewed-by on v2 3/3
#4 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: msm8916-longcheer-l8910: Add imu/magnetometer

Quoted 8 lines · Jonathan Albrieux

BQ Aquaris X5 (Longcheer L8910) has:
- BMI160 accelerometer and gyroscope sensor
- AK09911 magnetometer sensor
Add them to the device tree.

This patch depends on patch "arm64: dts: qcom: msm8916: Add blsp_i2c3".

Quoted 62 lines
---
 .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts +37 -0
index 7d5eff922f41..27845189ac2b 100644
@@ -56,6 +56,35 @@
 	};
 };
 
+&blsp_i2c3 {
+	status = "okay";
+
+	magnetometer@d {
+		compatible = "asahi-kasei,ak09911";
+		reg = <0x0d>;
+
+		vdd-supply = <&pm8916_l17>;
+		vid-supply = <&pm8916_l6>;
+
+		reset-gpios = <&msmgpio 111 GPIO_ACTIVE_LOW>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&mag_reset_default>;
+	};
+
+	imu@68 {
+		compatible = "bosch,bmi160";
+		reg = <0x68>;
+
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l6>;
+
+		mount-matrix = "0", "1", "0",
+			      "-1", "0", "0",
+			       "0", "0", "1";
+	};
+};
+
 &blsp1_uart2 {
 	status = "okay";
 };
@@ -220,6 +249,14 @@
 		bias-pull-up;
 	};
 
+	mag_reset_default: mag-reset-default {
+		pins = "gpio111";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	usb_id_default: usb-id-default {
 		pins = "gpio110";
 		function = "gpio";
Signature · 1 line
2.17.1