RE: [PATCH] iio: xilinx-ams: Fix AMS_ALARM_THR_DIRECT_MASK
From: Erim, Salih
Date: Wed Aug 20 2025 - 07:27:53 EST
Hi Sean,
Thanks for it.
> -----Original Message-----
> From: Sean Anderson <sean.anderson@xxxxxxxxx>
> Sent: Tuesday, July 15, 2025 1:31 AM
> To: Anand Ashok Dumbre <anand.ashok.dumbre@xxxxxxxxxx>; Jonathan Cameron
> <jic23@xxxxxxxxxx>; linux-iio@xxxxxxxxxxxxxxx
> Cc: Andy Shevchenko <andy@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Simek,
> Michal <michal.simek@xxxxxxx>; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; David
> Lechner <dlechner@xxxxxxxxxxxx>; Manish Narani <manish.narani@xxxxxxxxxx>;
> Nuno Sá <nuno.sa@xxxxxxxxxx>; Sean Anderson <sean.anderson@xxxxxxxxx>
> Subject: [PATCH] iio: xilinx-ams: Fix AMS_ALARM_THR_DIRECT_MASK
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> AMS_ALARM_THR_DIRECT_MASK should be bit 0, not bit 1. This would cause
> hysteresis to be enabled with a lower threshold of -28C. The temperature alarm
> would never deassert even if the temperature dropped below the upper threshold.
>
> Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
> Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxxx>
> ---
>
> drivers/iio/adc/xilinx-ams.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index
> 76dd0343f5f7..552190dd0e6e 100644
> --- a/drivers/iio/adc/xilinx-ams.c
> +++ b/drivers/iio/adc/xilinx-ams.c
> @@ -118,7 +118,7 @@
> #define AMS_ALARM_THRESHOLD_OFF_10 0x10
> #define AMS_ALARM_THRESHOLD_OFF_20 0x20
>
> -#define AMS_ALARM_THR_DIRECT_MASK BIT(1)
> +#define AMS_ALARM_THR_DIRECT_MASK BIT(0)
> #define AMS_ALARM_THR_MIN 0x0000
> #define AMS_ALARM_THR_MAX (BIT(16) - 1)
>
> --
> 2.35.1.1320.gc452695387.dirty
>
Tested-by: Erim, Salih <Salih.Erim@xxxxxxx>
Acked-by: Erim, Salih <Salih.Erim@xxxxxxx>