2021-01-26 05:21:33

by Jonathan Albrieux

[permalink] [raw]
Subject: [PATCH v2 0/3] 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

--
2.17.1


2021-01-27 03:27:45

by Jonathan Albrieux

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: qcom: msm8916: Add blsp_i2c3

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.

Reviewed-by: Konrad Dybcio <[email protected]>
Reviewed-by: Stephan Gerhold <[email protected]>
Signed-off-by: Jonathan Albrieux <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 16 ++++++++++++++++
arch/arm64/boot/dts/qcom/msm8916.dtsi | 15 +++++++++++++++
2 files changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi
index 4dc437f13fa5..7dedb91b9930 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi
@@ -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";
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 402e891a84ab..1045d7e518f3 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -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>;
--
2.17.1

2021-01-27 03:27:56

by Jonathan Albrieux

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

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

Signed-off-by: Jonathan Albrieux <[email protected]>
---
.../boot/dts/qcom/msm8916-longcheer-l8910.dts | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
index 7d5eff922f41..27845189ac2b 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
@@ -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";
--
2.17.1