diff mbox series

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

Message ID 20210124135409.5473-4-jonathan.albrieux@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add initial support for BQ Aquaris X5 | expand

Commit Message

Jonathan Albrieux Jan. 24, 2021, 1:54 p.m. UTC
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 <jonathan.albrieux@gmail.com>
---
 .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

Comments

Konrad Dybcio Jan. 24, 2021, 3:07 p.m. UTC | #1
> +&blsp_i2c3 {
> +	status = "okay";
> +
> +	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";
> +	};
> +
> +	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>;
> +	};
> +};

Please sort I2C devices by their address.


>  	};
>  
> +	mag_reset_default: mag-reset-default {
> +		pins = "gpio111";
> +		function = "gpio";
> +
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +

Please add this after gpio110 to keep it sorted gpio-number-wise.


Konrad
Stephan Gerhold Jan. 24, 2021, 3:51 p.m. UTC | #2
On Sun, Jan 24, 2021 at 04:07:19PM +0100, Konrad Dybcio wrote:
> > +&blsp_i2c3 {
> > +	status = "okay";
> > +
> > +	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";
> > +	};
> > +
> > +	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>;
> > +	};
> > +};
> 
> Please sort I2C devices by their address.
> 

+1 :)

> 
> >  	};
> >  
> > +	mag_reset_default: mag-reset-default {
> > +		pins = "gpio111";
> > +		function = "gpio";
> > +
> > +		drive-strength = <2>;
> > +		bias-disable;
> > +	};
> > +
> 
> Please add this after gpio110 to keep it sorted gpio-number-wise.
> 

This is ordered alphabetically. I haven't seen gpio-number order
anywhere yet... :)

Thanks,
Stephan
Jonathan Albrieux Jan. 24, 2021, 7:49 p.m. UTC | #3
On Sun, Jan 24, 2021 at 04:51:31PM +0100, Stephan Gerhold wrote:
> On Sun, Jan 24, 2021 at 04:07:19PM +0100, Konrad Dybcio wrote:
> > > +&blsp_i2c3 {
> > > +	status = "okay";
> > > +
> > > +	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";
> > > +	};
> > > +
> > > +	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>;
> > > +	};
> > > +};
> > 
> > Please sort I2C devices by their address.
> > 
> 
> +1 :)
> 
Thank you Konrad, thank you Stephan, I'll fix the order!

> > 
> > >  	};
> > >  
> > > +	mag_reset_default: mag-reset-default {
> > > +		pins = "gpio111";
> > > +		function = "gpio";
> > > +
> > > +		drive-strength = <2>;
> > > +		bias-disable;
> > > +	};
> > > +
> > 
> > Please add this after gpio110 to keep it sorted gpio-number-wise.
> > 
> 
> This is ordered alphabetically. I haven't seen gpio-number order
> anywhere yet... :)
> 
Let me know if this order has to be changed, meanwhile I'll prepare
a v2 for the i2c device order and will prepare a v3 in case this
order too has to be changed.

Again, thank you,
Jonathan

> Thanks,
> Stephan
Bjorn Andersson Jan. 28, 2021, 4:22 a.m. UTC | #4
On Sun 24 Jan 13:49 CST 2021, Jonathan Albrieux wrote:

> On Sun, Jan 24, 2021 at 04:51:31PM +0100, Stephan Gerhold wrote:
> > On Sun, Jan 24, 2021 at 04:07:19PM +0100, Konrad Dybcio wrote:
> > > > +&blsp_i2c3 {
> > > > +	status = "okay";
> > > > +
> > > > +	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";
> > > > +	};
> > > > +
> > > > +	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>;
> > > > +	};
> > > > +};
> > > 
> > > Please sort I2C devices by their address.
> > > 
> > 
> > +1 :)
> > 
> Thank you Konrad, thank you Stephan, I'll fix the order!
> 
> > > 
> > > >  	};
> > > >  
> > > > +	mag_reset_default: mag-reset-default {
> > > > +		pins = "gpio111";
> > > > +		function = "gpio";
> > > > +
> > > > +		drive-strength = <2>;
> > > > +		bias-disable;
> > > > +	};
> > > > +
> > > 
> > > Please add this after gpio110 to keep it sorted gpio-number-wise.
> > > 
> > 
> > This is ordered alphabetically. I haven't seen gpio-number order
> > anywhere yet... :)
> > 
> Let me know if this order has to be changed, meanwhile I'll prepare
> a v2 for the i2c device order and will prepare a v3 in case this
> order too has to be changed.
> 

I'm happy with having these sorted alphabetically.

Regards,
Bjorn
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
index 7d5eff922f41..c3933ec0f116 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";
+
+	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";
+	};
+
+	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>;
+	};
+};
+
 &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";