lkml.org 
[lkml]   [2022]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 03/11] iio: light: tsl2563: Configure INT in one place
On Wed,  7 Dec 2022 21:03:40 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Introduce tsl2563_configure_irq() to configure INT in one place.
>
> While at it, make use of TSL2563_INT_LEVEL and newly introduced
> TSL2563_INT_MASK.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Trivial note on a further improvement inline.

LGTM
> ---
> drivers/iio/light/tsl2563.c | 42 ++++++++++++++++++++++---------------
> 1 file changed, 25 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index d836c15ba777..d071805239ef 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -69,6 +69,7 @@
>
> #define TSL2563_INT_DISABLED 0x00
> #define TSL2563_INT_LEVEL 0x10
> +#define TSL2563_INT_MASK 0x30

Better to use GENMASK etc, but given age of driver I'm not surprised no one
has made the conversion to that and FIELD_GET/ FIELD_PREP.

Nice follow up if anyone is bored enough ;)


> #define TSL2563_INT_PERSIST(n) ((n) & 0x0F)
>

\
 
 \ /
  Last update: 2022-12-11 14:05    [W:0.141 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site