All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dts: adjust proximity near level
@ 2023-08-02 21:07 Philipp Jungkamp
  2023-08-03 15:47 ` Guido Günther
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Jungkamp @ 2023-08-02 21:07 UTC (permalink / raw)
  To: Guido Günther, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Sebastian Krzyszkowiak, Martin Kepplinger,
	Angus Ainslie
  Cc: devicetree, Philipp Jungkamp

Adjust the proximity-near-level by one to account for an error in
calibration using iio-sensor-proxy, which interpreted the
in_proximity_nearlevel attribute slightly differently than specified in
the kernel documentation.

Signed-off-by: Philipp Jungkamp <p.jungkamp@gmx.net>
---
Hello,

Most userspace programs seem to use the in_proximity_nearlevel sysfs attribute
implicitly through the iio-sensor-proxy dbus daemon. But the proximity sensor
near level detection does not adhere to the kernel documentation for the sysfs
attribute. This is, next to some techical defficulties in iio-sensor-proxy, the
reason that I proposed to fix the near level criterion there.
See: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/364

It has been pointed out that devices with a DT calibrated against
iio-sensor-proxy will see a slight change in the interpretation of the near
level criterion.

I want this more or less serious patch to be a heads up for the users and
implementors of the iio proximity sensors on linux.

Regards,
Philipp Jungkamp

 arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts  | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts  | 2 +-
 arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
index 2b3d437a642a..31426cf055b4 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
@@ -23,5 +23,5 @@ &bq25895 {
 };

 &proximity {
-	proximity-near-level = <50>;
+	proximity-near-level = <51>;
 };
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
index 7fd0176e4bd3..12ccc20afc8a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
@@ -45,5 +45,5 @@ &magnetometer {
 };

 &proximity {
-	proximity-near-level = <10>;
+	proximity-near-level = <11>;
 };
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
index 97577c0a7715..fab872ecbf1c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
@@ -23,5 +23,5 @@ &lcd_panel {
 };

 &proximity {
-	proximity-near-level = <5>;
+	proximity-near-level = <6>;
 };
diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
index 97262b8519b3..19173d9efa22 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
@@ -156,7 +156,7 @@ magnetometer@12 {
 	light-sensor@23 {
 		compatible = "liteon,ltr559";
 		reg = <0x23>;
-		proximity-near-level = <75>;
+		proximity-near-level = <76>;

 		interrupt-parent = <&tlmm>;
 		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
--
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dts: adjust proximity near level
  2023-08-02 21:07 [PATCH] dts: adjust proximity near level Philipp Jungkamp
@ 2023-08-03 15:47 ` Guido Günther
  0 siblings, 0 replies; 2+ messages in thread
From: Guido Günther @ 2023-08-03 15:47 UTC (permalink / raw)
  To: Philipp Jungkamp
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Sebastian Krzyszkowiak, Martin Kepplinger, Angus Ainslie,
	devicetree

Hi,
On Wed, Aug 02, 2023 at 11:07:46PM +0200, Philipp Jungkamp wrote:
> Adjust the proximity-near-level by one to account for an error in
> calibration using iio-sensor-proxy, which interpreted the
> in_proximity_nearlevel attribute slightly differently than specified in
> the kernel documentation.
> 
> Signed-off-by: Philipp Jungkamp <p.jungkamp@gmx.net>
> ---
> Hello,
> 
> Most userspace programs seem to use the in_proximity_nearlevel sysfs
> attribute

Even all we found.

> implicitly through the iio-sensor-proxy dbus daemon. But the proximity sensor
> near level detection does not adhere to the kernel documentation for the sysfs
> attribute. This is, next to some techical defficulties in iio-sensor-proxy, the
> reason that I proposed to fix the near level criterion there.
> See: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/364
> 
> It has been pointed out that devices with a DT calibrated against
> iio-sensor-proxy will see a slight change in the interpretation of the near
> level criterion.

I'd make that part of the commit message as well. With that the
imx8mq-librem5* bits are

  Reviewed-by: Guido Günther <agx@sigxcpu.org>

Cheers,
 -- Guido

> 
> I want this more or less serious patch to be a heads up for the users and
> implementors of the iio proximity sensors on linux.
> 
> Regards,
> Philipp Jungkamp
> 
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts  | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts  | 2 +-
>  arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
> index 2b3d437a642a..31426cf055b4 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dts
> @@ -23,5 +23,5 @@ &bq25895 {
>  };
> 
>  &proximity {
> -	proximity-near-level = <50>;
> +	proximity-near-level = <51>;
>  };
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
> index 7fd0176e4bd3..12ccc20afc8a 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtsi
> @@ -45,5 +45,5 @@ &magnetometer {
>  };
> 
>  &proximity {
> -	proximity-near-level = <10>;
> +	proximity-near-level = <11>;
>  };
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
> index 97577c0a7715..fab872ecbf1c 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts
> @@ -23,5 +23,5 @@ &lcd_panel {
>  };
> 
>  &proximity {
> -	proximity-near-level = <5>;
> +	proximity-near-level = <6>;
>  };
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
> index 97262b8519b3..19173d9efa22 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
> @@ -156,7 +156,7 @@ magnetometer@12 {
>  	light-sensor@23 {
>  		compatible = "liteon,ltr559";
>  		reg = <0x23>;
> -		proximity-near-level = <75>;
> +		proximity-near-level = <76>;
> 
>  		interrupt-parent = <&tlmm>;
>  		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
> --
> 2.41.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-03 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02 21:07 [PATCH] dts: adjust proximity near level Philipp Jungkamp
2023-08-03 15:47 ` Guido Günther

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.