Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1298247rbb; Mon, 26 Feb 2024 05:19:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXufUFq2OnXo9ETUHxUsEy5TB+reto1TofE3at/yuTKHkW/E01Bh4nZIKu8RD40b4I9ltF3yLeQeyFBQDAPFmTW5duMO9p1+FLDGTgp2w== X-Google-Smtp-Source: AGHT+IEhdnAwdDepX+aD+8C1kARS29R78JoTt68U7+5UDnD0OB0l0WJI5Gtix7/4MdPwly0i6AT/ X-Received: by 2002:a17:90a:1b8f:b0:29a:9093:619a with SMTP id w15-20020a17090a1b8f00b0029a9093619amr4339608pjc.20.1708953594781; Mon, 26 Feb 2024 05:19:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708953594; cv=pass; d=google.com; s=arc-20160816; b=X4HTXMF4hAj0tgcrnUI5aLjZBH2e6OQ+SKej/F69x52ICLIVsbqIPGpNYh/4TOAlsj hgnlwC3/1kTpyi5LlJ6IacSAcCJN+9iD4ziBLls1rgvPCAq82PNDm/l6o5sHsieA+jpF D2h5yBDdNlsnv7nA0AxVFYeu0QNU1iFBehuBBTU+ow8HhgLvw/fZOUSa0NhtOZvIkLwV 2zGKx+906NhCT2aduZvVE9nLoKwmCQ5rZoVpx09ZXL8OOaAlVGN82pnG36VpCVh5Xoc9 LtFtg8ji4u4d+CbV9E3uFwQM/KrAx8jFKCDc7ZcDwR/8bzFFJzfvKFQ4+4DMS5lGDoX7 UhWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=naqFL0E+hNyDvv+vNCMwB2nUVsIEfS7e+n3trxNKW+M=; fh=moJmZn/0qc8cA5By0DYGnMnmq6Z2ykpmVPPVruZWgKs=; b=f2mWpPBhAYihASVeN4sldA3CP5ndS4YQXz9lKSjFBAmzZlR6yiJbDk3IOtZkl856eO j8mQ0ZjfVrs1UG+/eM1hy+Dv+RkguhUnn+iSoGGqrAnaw4AUSOiOmjXpT/PdBbSyzD2q dAH6btqUM0S15CaXNfLw2MJaFSuT5UfuIwcebhOskkt3L33sawgre5Caf8TPkwpSA5Xy MUYjTRpureV0WGS4DLfCQ63VKjcFUqP1RnaSJ8Hge4gGvtLv7aOzMGMDuHqFs1B4kwjv r0oGam9GCzCj+FHkdPKJoZZpbXLfETm1RR2gC0oWkcuG2VAxXf+40OEWdPSf8afINLtG cH9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=HMR8jM7J; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-81397-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81397-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id oj3-20020a17090b4d8300b0029aad340026si2885169pjb.29.2024.02.26.05.19.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:19:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81397-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=HMR8jM7J; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-81397-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81397-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 83663B26A0A for ; Mon, 26 Feb 2024 12:44:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D7637F7E8; Mon, 26 Feb 2024 12:43:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="HMR8jM7J" Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59CDD7F497 for ; Mon, 26 Feb 2024 12:43:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951438; cv=none; b=PtBqvgXkO2wkY7Pgn9XZ4TDh5VKBlNz0yIvJLd77ombWtV768cxD6krbTrorRFj0B9baWGNCIZWzzrmPtjKXfDQrUYDZgTkkmqIAZ5VPwAphtEco93HsO8qHE0sSwbTTgLBWpCmmA0JGTZfDAm+vCxVhoUAXinQKphHJqo9QG/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951438; c=relaxed/simple; bh=QWUMPu+CtYb0e6Z/NfDSuuMZHNPPaOp7x8I5Ob5Dgfo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XBlDr8to9xuwsUkVezhf78XQL9Fr+mFcj3BXTRq2j3wPhopvjlHxSmsf+S+6VUkNc+cMIqhzUKRMs7sbmVAVq9KlJHfPAj4BS1NkYwxpEXxbxkuH8Fzl7EsqfTz48uVHZmSbjHUi9KFkUYT5q4ugtybiW8r03ClRgYOro4xdxDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=HMR8jM7J; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-512f892500cso1000760e87.3 for ; Mon, 26 Feb 2024 04:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708951434; x=1709556234; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=naqFL0E+hNyDvv+vNCMwB2nUVsIEfS7e+n3trxNKW+M=; b=HMR8jM7JnQfNJZAtaIKkDoP+fKuLdKMrOAtYXHo1zHaQrU8Sl/ohZHUdzAOYq5+Ng0 ZNsI1MLI6NiOEj6aJgWXvOccyrRT0m9mvxXIKAV5Fqz6Bi2ixqn/QE1ojOsuQnow4jfw lyimbQGdC8KGdukVkB9G3VrB5ML/1hl8UbWPCmDgayAYZQ0uXe1XrQWjhazEAT5sGrgZ TfWLl/MtYh56y6c8EI+IvzZdPCF3IkrcuUGc64YZOdtJ4kWbE+r4GgETJ4rl+2+jAj7q NLM/tyyt/1i2d6Yhol1TYjDrrn+dbnEn8GoXGI6qInNdrK5dhYKJ3y3neuOosxnuH4H2 FQ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708951434; x=1709556234; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=naqFL0E+hNyDvv+vNCMwB2nUVsIEfS7e+n3trxNKW+M=; b=a3APiljtEzyb64bo+bvk8Xcdbs9m3Snngsq2SbAmu6EkM0yFPD7gKpI9LLyAIHPoVF I1R298/0UQtG9gDPwaeyj6GPHP3oi+0kzEApHEbF57EmHvCrQdckPpYAgx+HvBfzwwS0 Lj3NOG2hWq0vXkF2Qs+4lgKVWLQ9/OnL289CMOsqly0nV6AUmEABakgzGZnUwwsFbh2g BNUcoi6z0ax2Y+Tyw105xqsc7wdUm4g+SxNqMCIzfY2XZbgxjs5BFxBwiM0/9xeHfrj9 ebwZNy6R0Ko4bDy3ViEYNt/LwPYhwCAdgQUQUnovEDG/dsaTSstQvIadMyJZ811lz12z 6LSw== X-Forwarded-Encrypted: i=1; AJvYcCXMClaSsIENQvn1El+OOTGUB0+yk2qDZUIU8kTTvJ2ab/V7NAJuq3jOyhYl280+PRGDr/fRTS2qiP5qZ2Yz8KW6d9xi2AjIa9EjETlJ X-Gm-Message-State: AOJu0YxKmbtkJ5XcoWayyR5br5sYpyYSBoE13NH5IORaaY/PQDzzvFvM zIacCX3Ise15iZ9Ho20Tjpq5SSTFEwdUAJsyLGLxrZybqHBJFpFhDVpriefOiTg= X-Received: by 2002:a05:6512:1156:b0:512:b426:53e8 with SMTP id m22-20020a056512115600b00512b42653e8mr5504601lfg.30.1708951434428; Mon, 26 Feb 2024 04:43:54 -0800 (PST) Received: from [192.168.1.70] ([84.102.31.43]) by smtp.gmail.com with ESMTPSA id d11-20020a056512368b00b00513022c0d3esm42963lfs.91.2024.02.26.04.43.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Feb 2024 04:43:54 -0800 (PST) Message-ID: <8f09bc42-b85d-446f-bd9d-77155060a4b8@baylibre.com> Date: Mon, 26 Feb 2024 13:43:51 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 08/14] misc: tps6594-pfsm: Add TI TPS65224 PMIC PFSM Content-Language: en-US To: Bhargav Raviprakash , linux-kernel@vger.kernel.org Cc: m.nirmaladevi@ltts.com, lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, lgirdwood@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nm@ti.com, vigneshr@ti.com, kristo@kernel.org References: <20240223093701.66034-1-bhargav.r@ltts.com> <20240223093701.66034-9-bhargav.r@ltts.com> From: Julien Panis In-Reply-To: <20240223093701.66034-9-bhargav.r@ltts.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. [...] > @@ -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