diff mbox series

[3/3] arm64: dts: qcom: sm7225-fp4: Revert "arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics"

Message ID 20230827122842.63741-3-krzysztof.kozlowski@linaro.org
State Accepted
Commit e34d0497f3c4d1e71063c38e1d8b1d182277f17a
Headers show
Series [1/3] ARM: dts: qcom: drop incorrect cell-index from SPMI | expand

Commit Message

Krzysztof Kozlowski Aug. 27, 2023, 12:28 p.m. UTC
This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it
was never reviewed, was buggy (report from kernel test robot:
https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and
used undocumented, broken bindings.  Half of the properties in this
device are questioned, thus adding DTS node causes only errors and does
not make the device usable without the bindings and driver part:

  sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695']
  sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null'
  sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null'

Since bindings were abandoned (4 months since review), revert the commit
to avoid false sense of supporting something which is not supported.

Cc: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../boot/dts/qcom/sm7225-fairphone-fp4.dts    | 28 +------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

Comments

Luca Weiss Aug. 28, 2023, 6:56 a.m. UTC | #1
Hi Krzysztof,

On Sun Aug 27, 2023 at 2:28 PM CEST, Krzysztof Kozlowski wrote:
> This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it
> was never reviewed, was buggy (report from kernel test robot:
> https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and

(I wouldn't say this part is accurate, the robot just didn't use a tree
with the i2c10 node already present, it was sent in an earlier patch
IIRC, but whatever)

> used undocumented, broken bindings.  Half of the properties in this
> device are questioned, thus adding DTS node causes only errors and does
> not make the device usable without the bindings and driver part:
>
>   sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695']
>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null'
>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null'
>
> Since bindings were abandoned (4 months since review), revert the commit
> to avoid false sense of supporting something which is not supported.

I've been avoiding touching this topic again since I'm really not sure
how to resolve.

There's a bunch of magic registers being written to in the downstream
driver, I don't have any documentation for that so I'm not exactly sure
what I can do to make nice bindings with proper properties.

Would you recommend just hardcoding some of these properties in the
driver, assuming they're constant for every AW8695, even though the
downstream driver has these properties in devicetree? Because of that I
assumed these properties could differ per implementation / usage of the
AW8695 in different devices.

Or do you have any other suggestion?

In any case:

Acked-by: Luca Weiss <luca.weiss@fairphone.com>

Regards
Luca

>
> Cc: Luca Weiss <luca.weiss@fairphone.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../boot/dts/qcom/sm7225-fairphone-fp4.dts    | 28 +------------------
>  1 file changed, 1 insertion(+), 27 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> index 18171c5d8a38..568165f4f9e4 100644
> --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> @@ -386,36 +386,10 @@ &i2c8 {
>  };
>  
>  &i2c10 {
> -	clock-frequency = <400000>;
> -	status = "okay";
> -
>  	/* PM8008 PMIC @ 8 and 9 */
>  	/* PX8618 @ 26 */
>  	/* SMB1395 PMIC @ 34 */
> -
> -	haptics@5a {
> -		compatible = "awinic,aw8695";
> -		reg = <0x5a>;
> -		interrupts-extended = <&tlmm 85 IRQ_TYPE_EDGE_FALLING>;
> -		reset-gpios = <&tlmm 90 GPIO_ACTIVE_HIGH>;
> -
> -		awinic,f0-preset = <2350>;
> -		awinic,f0-coefficient = <260>;
> -		awinic,f0-calibration-percent = <7>;
> -		awinic,drive-level = <125>;
> -
> -		awinic,f0-detection-play-time = <5>;
> -		awinic,f0-detection-wait-time = <3>;
> -		awinic,f0-detection-repeat = <2>;
> -		awinic,f0-detection-trace = <15>;
> -
> -		awinic,boost-debug = /bits/ 8 <0x30 0xeb 0xd4>;
> -		awinic,tset = /bits/ 8 <0x12>;
> -		awinic,r-spare = /bits/ 8 <0x68>;
> -
> -		awinic,bemf-upper-threshold = <4104>;
> -		awinic,bemf-lower-threshold = <1016>;
> -	};
> +	/* awinic,aw8695 @ 5a */
>  };
>  
>  &ipa {
Krzysztof Kozlowski Aug. 28, 2023, 7 a.m. UTC | #2
On 28/08/2023 08:56, Luca Weiss wrote:
> Hi Krzysztof,
> 
> On Sun Aug 27, 2023 at 2:28 PM CEST, Krzysztof Kozlowski wrote:
>> This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it
>> was never reviewed, was buggy (report from kernel test robot:
>> https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and
> 
> (I wouldn't say this part is accurate, the robot just didn't use a tree
> with the i2c10 node already present, it was sent in an earlier patch
> IIRC, but whatever)
> 
>> used undocumented, broken bindings.  Half of the properties in this
>> device are questioned, thus adding DTS node causes only errors and does
>> not make the device usable without the bindings and driver part:
>>
>>   sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695']
>>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null'
>>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null'
>>
>> Since bindings were abandoned (4 months since review), revert the commit
>> to avoid false sense of supporting something which is not supported.
> 
> I've been avoiding touching this topic again since I'm really not sure
> how to resolve.

Happens, but the DTS should not have been applied in such case.

> 
> There's a bunch of magic registers being written to in the downstream
> driver, I don't have any documentation for that so I'm not exactly sure
> what I can do to make nice bindings with proper properties.
> 
> Would you recommend just hardcoding some of these properties in the
> driver, assuming they're constant for every AW8695, even though the
> downstream driver has these properties in devicetree? Because of that I
> assumed these properties could differ per implementation / usage of the
> AW8695 in different devices.

Yes, keep them in the driver.

Best regards,
Krzysztof
Luca Weiss Aug. 28, 2023, 7:26 a.m. UTC | #3
On Mon Aug 28, 2023 at 9:00 AM CEST, Krzysztof Kozlowski wrote:
> On 28/08/2023 08:56, Luca Weiss wrote:
> > Hi Krzysztof,
> > 
> > On Sun Aug 27, 2023 at 2:28 PM CEST, Krzysztof Kozlowski wrote:
> >> This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it
> >> was never reviewed, was buggy (report from kernel test robot:
> >> https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and
> > 
> > (I wouldn't say this part is accurate, the robot just didn't use a tree
> > with the i2c10 node already present, it was sent in an earlier patch
> > IIRC, but whatever)
> > 
> >> used undocumented, broken bindings.  Half of the properties in this
> >> device are questioned, thus adding DTS node causes only errors and does
> >> not make the device usable without the bindings and driver part:
> >>
> >>   sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695']
> >>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null'
> >>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null'
> >>
> >> Since bindings were abandoned (4 months since review), revert the commit
> >> to avoid false sense of supporting something which is not supported.
> > 
> > I've been avoiding touching this topic again since I'm really not sure
> > how to resolve.
>
> Happens, but the DTS should not have been applied in such case.

True, back when it was applied I told Bjorn but I also thought I'd get
the driver in soon also. Obviously this hasn't happened. So fine with me
to revert now, and I'll add it back once the new bindings are in.

>
> > 
> > There's a bunch of magic registers being written to in the downstream
> > driver, I don't have any documentation for that so I'm not exactly sure
> > what I can do to make nice bindings with proper properties.
> > 
> > Would you recommend just hardcoding some of these properties in the
> > driver, assuming they're constant for every AW8695, even though the
> > downstream driver has these properties in devicetree? Because of that I
> > assumed these properties could differ per implementation / usage of the
> > AW8695 in different devices.
>
> Yes, keep them in the driver.

Okay.. I'll make sure to document this in the driver or commit message
or somewhere so other people using the same AW8695 will know that this
is hardcoded.

Regards
Luca

>
> Best regards,
> Krzysztof
Konrad Dybcio Aug. 28, 2023, 9:48 a.m. UTC | #4
On 27.08.2023 14:28, Krzysztof Kozlowski wrote:
> This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it
> was never reviewed, was buggy (report from kernel test robot:
> https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and
> used undocumented, broken bindings.  Half of the properties in this
> device are questioned, thus adding DTS node causes only errors and does
> not make the device usable without the bindings and driver part:
> 
>   sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695']
>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null'
>   sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null'
> 
> Since bindings were abandoned (4 months since review), revert the commit
> to avoid false sense of supporting something which is not supported.
> 
> Cc: Luca Weiss <luca.weiss@fairphone.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index 18171c5d8a38..568165f4f9e4 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -386,36 +386,10 @@  &i2c8 {
 };
 
 &i2c10 {
-	clock-frequency = <400000>;
-	status = "okay";
-
 	/* PM8008 PMIC @ 8 and 9 */
 	/* PX8618 @ 26 */
 	/* SMB1395 PMIC @ 34 */
-
-	haptics@5a {
-		compatible = "awinic,aw8695";
-		reg = <0x5a>;
-		interrupts-extended = <&tlmm 85 IRQ_TYPE_EDGE_FALLING>;
-		reset-gpios = <&tlmm 90 GPIO_ACTIVE_HIGH>;
-
-		awinic,f0-preset = <2350>;
-		awinic,f0-coefficient = <260>;
-		awinic,f0-calibration-percent = <7>;
-		awinic,drive-level = <125>;
-
-		awinic,f0-detection-play-time = <5>;
-		awinic,f0-detection-wait-time = <3>;
-		awinic,f0-detection-repeat = <2>;
-		awinic,f0-detection-trace = <15>;
-
-		awinic,boost-debug = /bits/ 8 <0x30 0xeb 0xd4>;
-		awinic,tset = /bits/ 8 <0x12>;
-		awinic,r-spare = /bits/ 8 <0x68>;
-
-		awinic,bemf-upper-threshold = <4104>;
-		awinic,bemf-lower-threshold = <1016>;
-	};
+	/* awinic,aw8695 @ 5a */
 };
 
 &ipa {