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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5122BC48BF6 for ; Thu, 7 Mar 2024 09:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n2QLazTT9hd2PPDWBvPhkV7amFBaXJ85EabSOQKm6yw=; b=3u/aBpx9E2T6U4 WJfx1HfpTaJLZDLhcKeig0wF+5TcA1WeQ7zoIqi9UpY26lbGkUB7Hd/Vq7c/Zm2w+5S+zCIKgj55E atnEABsc2jRX+bnZDnQz5obxavwGP8EqKkYSBJdVW5eWUVppj/8tjUxr6+kig/zE3rGWYfXLFRB58 hPQGFceoFM1OhQ/zswcmofPHsnxyWartSHQ6NUNbvqmOe9jp1EYikY+f4NDTwR0JjTDqwBdeETWoZ SS/Ruo0jkRnkMqGvbyzXuoQ1g8QBWQilsVIfRLmn8hwlaRYEzsHeTbKzWDNWxQvJ0OiscOtt2bc2n 16fQHOp580xPOUE1Ylvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri9p1-00000003n4C-1jaR; Thu, 07 Mar 2024 09:13:51 +0000 Received: from [14.140.155.42] (helo=esa2.ltts.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri9ov-00000003mxk-3lsv for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 09:13:48 +0000 IronPort-SDR: JGxyyw0lc7IFuJCHQ3LYoxMFm0DAC7ho0mS6XnXtNk48t8PoXqA4Uiq2HE7CSOKgC9JrCS4p7G lSl8Dc4KL3BA== Received: from unknown (HELO localhost.localdomain) ([192.168.34.55]) by esa2.ltts.com with ESMTP; 07 Mar 2024 14:43:20 +0530 From: Bhargav Raviprakash To: jpanis@baylibre.com Cc: arnd@arndb.de, bhargav.r@ltts.com, broonie@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, gregkh@linuxfoundation.org, kristo@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, lgirdwood@gmail.com, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, m.nirmaladevi@ltts.com, nm@ti.com, robh+dt@kernel.org, vigneshr@ti.com Subject: Re: [PATCH v2 08/14] misc: tps6594-pfsm: Add TI TPS65224 PMIC PFSM Date: Thu, 7 Mar 2024 14:43:10 +0530 Message-Id: <20240307091310.170807-1-bhargav.r@ltts.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <8f09bc42-b85d-446f-bd9d-77155060a4b8@baylibre.com> References: <8f09bc42-b85d-446f-bd9d-77155060a4b8@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_011346_511102_B2DA35CA X-CRM114-Status: GOOD ( 21.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Mon, 26 Feb 2024 13:43:51 +0100, Julien Panis wrote: > On 2/23/24 10:36, Bhargav Raviprakash wrote: > > Add support for TPS65224 PFSM in the TPS6594 PFSM driver > > as they share significant functionality. > > > > Signed-off-by: Bhargav Raviprakash > > --- > > drivers/misc/tps6594-pfsm.c | 55 +++++++++++++++++++++++++++---------- > > 1 file changed, 40 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/misc/tps6594-pfsm.c b/drivers/misc/tps6594-pfsm.c > > index 88dcac814..4fa071093 100644 > > --- a/drivers/misc/tps6594-pfsm.c > > +++ b/drivers/misc/tps6594-pfsm.c > > @@ -1,6 +1,6 @@ > > // SPDX-License-Identifier: GPL-2.0 > > /* > > - * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764 PMICs > > + * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs > > * > > * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ > > */ > > @@ -34,15 +34,17 @@ > > > > #define TPS6594_FILE_TO_PFSM(f) container_of((f)->private_data, struct tps6594_pfsm, miscdev) > > > > -/** > > +/* > > Here it should be /** for the structure documentation, I think. > Please check in kernel doc. > Thanks for pointing it out! Will fix it in the next version. > [...] > > > @@ -210,8 +230,12 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a > > return ret; > > > > /* Modify NSLEEP1-2 bits */ > > - ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, > > - TPS6594_BIT_NSLEEP2B); > > + if (pfsm->chip_id == TPS65224) > > + ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, > > + TPS6594_BIT_NSLEEP1B); > > + else > > + ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, > > + TPS6594_BIT_NSLEEP2B); > > Instead of this if/else, a ternary operator might do the trick here: > regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, > pfsm->chip_id == TPS65224 ? TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B) > > Julien Sure, this looks neat :-). We will use ternary operator here in the next version. Thanks! Regards, Bhargav _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel