diff mbox series

ARM: dts: qcom: motorola-falcon: add accelerometer, magnetometer

Message ID ZmWMh6fuLasvGkR/@standask-GA-A55M-S2HP (mailing list archive)
State New, archived
Headers show
Series ARM: dts: qcom: motorola-falcon: add accelerometer, magnetometer | expand

Commit Message

Stanislav Jakubek June 9, 2024, 11:05 a.m. UTC
Add the accelerometer and magnetometer that are present on the Motorola
Moto G (2013) device.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
---
 .../boot/dts/qcom/msm8226-motorola-falcon.dts | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)

Comments

Konrad Dybcio June 13, 2024, 7:48 a.m. UTC | #1
On 6/9/24 13:05, Stanislav Jakubek wrote:
> Add the accelerometer and magnetometer that are present on the Motorola
> Moto G (2013) device.
> 
> Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> ---

[...]

> +&blsp1_i2c2 {

Consider setting a clock-frequency = <>

With that:

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

Konrad
Stanislav Jakubek June 13, 2024, 5:18 p.m. UTC | #2
On Thu, Jun 13, 2024 at 09:48:26AM +0200, Konrad Dybcio wrote:
> 
> 
> On 6/9/24 13:05, Stanislav Jakubek wrote:
> > Add the accelerometer and magnetometer that are present on the Motorola
> > Moto G (2013) device.
> > 
> > Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> > ---
> 
> [...]
> 
> > +&blsp1_i2c2 {
> 
> Consider setting a clock-frequency = <>

Hi Konrad,

checking downstream [1], qcom,i2c-bus-freq for I2C2 is 100000, which seems
to be the default. Should I specify it anyway?

Though, now that I've checked, it seems that I missed the clock-frequency
for I2C3, for which qcom,i2c-bus-freq is 400000...
The currently supported HW on it seems to work fine though ¯\_(ツ)_/¯

[1] https://github.com/LineageOS/android_kernel_motorola_msm8226/blob/cm-14.1/arch/arm/boot/dts/msm8226.dtsi#L983

Stanislav

> 
> With that:
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> Konrad
Konrad Dybcio June 13, 2024, 5:20 p.m. UTC | #3
On 6/13/24 19:18, Stanislav Jakubek wrote:
> On Thu, Jun 13, 2024 at 09:48:26AM +0200, Konrad Dybcio wrote:
>>
>>
>> On 6/9/24 13:05, Stanislav Jakubek wrote:
>>> Add the accelerometer and magnetometer that are present on the Motorola
>>> Moto G (2013) device.
>>>
>>> Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
>>> ---
>>
>> [...]
>>
>>> +&blsp1_i2c2 {
>>
>> Consider setting a clock-frequency = <>
> 
> Hi Konrad,
> 
> checking downstream [1], qcom,i2c-bus-freq for I2C2 is 100000, which seems
> to be the default. Should I specify it anyway?

Yes, at the very least to silence the dmesg warning ;)

Konrad
Bjorn Andersson June 14, 2024, 10:48 p.m. UTC | #4
On Sun, 09 Jun 2024 13:05:43 +0200, Stanislav Jakubek wrote:
> Add the accelerometer and magnetometer that are present on the Motorola
> Moto G (2013) device.
> 
> 

Applied, thanks!

[1/1] ARM: dts: qcom: motorola-falcon: add accelerometer, magnetometer
      commit: 5756101babc5334a9bc99601d1cc0d6776fa9ada

Best regards,
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts b/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts
index 029e1b1659c9..5dbca83f2230 100644
--- a/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts
+++ b/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts
@@ -96,6 +96,35 @@  reserved@fb00000 {
 	};
 };
 
+&blsp1_i2c2 {
+	status = "okay";
+
+	magnetometer@c {
+		compatible = "asahi-kasei,ak8963";
+		reg = <0xc>;
+		interrupts-extended = <&tlmm 66 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&pm8226_l19>;
+		vid-supply = <&pm8226_lvs1>;
+		pinctrl-0 = <&mag_int_default &mag_reset_default>;
+		pinctrl-names = "default";
+	};
+
+	accelerometer@19 {
+		compatible = "st,lis3dh-accel";
+		reg = <0x19>;
+		interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_FALLING>;
+		vdd-supply = <&pm8226_l19>;
+		vddio-supply = <&pm8226_lvs1>;
+		pinctrl-0 = <&accel_int_default>;
+		pinctrl-names = "default";
+		mount-matrix = "0", "1", "0",
+			       "1", "0", "0",
+			       "0", "0", "-1";
+		st,drdy-int-pin = <1>;
+	};
+};
+
 &blsp1_i2c3 {
 	status = "okay";
 
@@ -321,6 +350,30 @@  &smbb {
 };
 
 &tlmm {
+	accel_int_default: accel-int-default-state {
+		pins = "gpio63";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-disable;
+	};
+
+	mag_int_default: mag-int-default-state {
+		pins = "gpio66";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-disable;
+	};
+
+	mag_reset_default: mag-reset-default-state {
+		pins = "gpio62";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
 	reg_lcd_default: reg-lcd-default-state {
 		pins = "gpio31", "gpio33";
 		function = "gpio";