From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF076C4332F for ; Sun, 11 Dec 2022 13:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbiLKNEp (ORCPT ); Sun, 11 Dec 2022 08:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbiLKNEm (ORCPT ); Sun, 11 Dec 2022 08:04:42 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08112E0EE; Sun, 11 Dec 2022 05:04:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2392CCE0B3C; Sun, 11 Dec 2022 13:04:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583E3C433EF; Sun, 11 Dec 2022 13:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670763872; bh=rjulAWcB0oewyoruaQq0t/DRG1FGCBitINMFcj8ZIA8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g5o50Y7macok3FyLB64HZwwbZ0nNmAIsrM5vxMTe5Kh3j2lTKPWfyT/DPi/bwfTa2 E1B7wjTTzHyFG0NdgjW3l0yNwdUqijl559AwMVooJtLCp8XzzImzKFm9BLpOq/z6IC ng7YsjJJNvpwyW9YyXxrg49wxHpOCwoEiqQ/XLkRpLSwuB0sFMxD7d5+3nQlSzEpox 9p2y2BnTS/LHqWLJVPxLqGEXhF/M4dJCS+oHOKhp9oTVBxu9S5ZBr83n6O5pn30313 ytR584F7STiCQg753JUaVLa21MqZ09EgS5YJU/HasLGNw70Lh4zyyGJmj6A5iJNu/I 1r7hPyUfHhr3Q== Date: Sun, 11 Dec 2022 13:17:27 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Lars-Peter Clausen , Ferry Toth Subject: Re: [PATCH v1 03/11] iio: light: tsl2563: Configure INT in one place Message-ID: <20221211131727.24ac49d2@jic23-huawei> In-Reply-To: <20221207190348.9347-3-andriy.shevchenko@linux.intel.com> References: <20221207190348.9347-1-andriy.shevchenko@linux.intel.com> <20221207190348.9347-3-andriy.shevchenko@linux.intel.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Wed, 7 Dec 2022 21:03:40 +0200 Andy Shevchenko 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 > Tested-by: Ferry Toth 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) >