Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp849868rdb; Fri, 23 Feb 2024 01:46:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7vZHW5x75CmprIxLryyO2beW8xt+1rmD8m+/gYOWEW/yqM9Ut4y2pueWjIAow0DOWK98Afi2eb9DeAtQsisNZc6jW0GQD/OalOW++Nw== X-Google-Smtp-Source: AGHT+IGufUBiMmvD/9ul8BzIIe6md0DFjMXH8vQpLjPJfOBsNcag027dbECtWhe+MEUuUc7prYgO X-Received: by 2002:a05:6a00:1a8e:b0:6e3:3631:96d4 with SMTP id e14-20020a056a001a8e00b006e3363196d4mr1415406pfv.28.1708681593401; Fri, 23 Feb 2024 01:46:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708681593; cv=pass; d=google.com; s=arc-20160816; b=pWWohzLOr43ds8pU1YzR8tZeBPPZnObkfgzvv4eK76114L0LdAy9cdXOSiNSJXSB+F ORVsE1i0tmseuZHFUT9ygWStqSCbh+nzw8YX7YJU81wnUZFYznjyZPJSdyU9Jqu/EoQB 4v64SKDzNzLQ+EQ5rA8vGsVmRQh6eASri2TZ01v9OzppaI7yD44pEiX6J/npzp5qslg7 Weh932nM9aut8wd7ouH9Vi9+nwo4s0CLCi7CnukD18v+YfaVoNEFDweVTd6Y/3jDH3Cz XdswC9KkQlsgX6ycTrvexwojVLeo+lj5jI5IOkGnKucMvphwIlpQXs6E6E0O3LdIhr8q gztQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:ironport-sdr; bh=NN1llcWdBQHokQJPFRpQz7bGkD9RTbu1efcZrrk9daE=; fh=PYFgvMsJkZr80o/LKy5s4XAuzlyGJLnldFQceezwP4w=; b=XsaSiZ/8MNKn6ZyheiEhDsDrvtV3JrAwoNVK5oF5WpIR6SDi6OxIANVOHEkyCxnm2s nJV4QqN7qEz7Bcw3UXWkA9Ma2aeZbRz5a/NhNtkiZR+BvOZeTsmurIGIEC9lXAVrGybn 2n21fOflsiPJL5pTYRZcBLBM+MpxavswuODFXHYXG8lTPkinIZhXeFg4hHN57iQJ20RV YQZqz91h3SjaiHQa8nRAgTLjxpDe0n3osSdNnfTYODU2+fUXoRQUH1HKTSvvMYzIBLF/ uhIX76pWQ7+VFA6M270dB5T+yDhojnnfKTOcb+qWPeE7Vp71i7d2/3Ht1Vgx+4JiE1ab wVOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ltts.com dmarc=pass fromdomain=ltts.com); spf=pass (google.com: domain of linux-kernel+bounces-78041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ltts.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p15-20020a056a000b4f00b006e4647c26casi9134146pfo.348.2024.02.23.01.46.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 01:46:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ltts.com dmarc=pass fromdomain=ltts.com); spf=pass (google.com: domain of linux-kernel+bounces-78041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ltts.com 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 1B69BB25034 for ; Fri, 23 Feb 2024 09:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B3E95F496; Fri, 23 Feb 2024 09:38:41 +0000 (UTC) Received: from esa2.ltts.com (unknown [14.140.155.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE60F5E3BA; Fri, 23 Feb 2024 09:38:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=14.140.155.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708681120; cv=none; b=PqTqGTEiIC9U5Jr+Ygk+WPnxmqB+P4wN99MaYi/p6Ocjr2pE1tG/cEwaERtHD2qvc+J4HGIuUvTEQVg5jWsszd5iBPg+kmd22xMNHHA+dplE+0r+v3MPWWq+hbADK9aJ/dF1xCx9PgBGckJtnajhzRu5/n8V0pch4wtBqnh6jvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708681120; c=relaxed/simple; bh=ANFQs58thb6Sfo8Tnd1vzz2cEfX0deEseKjVLICGrQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VhY3D0qEJNjhb+6dSO7/8synmti0TDbLg7WMKqrJ/nhN+oCx220dMZpinmkrBBv0IDYyRIYvSWRAqoEdQBAqtb6cnNI6kwSUnr2N/0ZZsiyMGEFpqrsEsQwOleEOZkN9VXrPy2kf2KTsZhfYlcRSSWBd0561fCvUCL8/TDOXsds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ltts.com; spf=pass smtp.mailfrom=ltts.com; arc=none smtp.client-ip=14.140.155.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ltts.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ltts.com IronPort-SDR: l7sBvG3RqvWxhq/IQT1+9LF4MByomStBnxI1m9a4CafVQhYI6NVKY/VHLkZg8zubQOTC2mgoXs muTIygVjDzeA== Received: from unknown (HELO localhost.localdomain) ([192.168.34.55]) by esa2.ltts.com with ESMTP; 23 Feb 2024 15:07:18 +0530 From: Bhargav Raviprakash To: 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, jpanis@baylibre.com, 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, Bhargav Raviprakash Subject: [PATCH v2 11/14] misc: tps6594-esm: Add TI TPS65224 PMIC ESM Date: Fri, 23 Feb 2024 15:06:58 +0530 Message-Id: <20240223093701.66034-12-bhargav.r@ltts.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240223093701.66034-1-bhargav.r@ltts.com> References: <20240223093701.66034-1-bhargav.r@ltts.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add support for TPS65224 Error Signal Monitor in the TPS6594 ESM driver as they share significant functionality. Signed-off-by: Bhargav Raviprakash --- drivers/misc/tps6594-esm.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/misc/tps6594-esm.c b/drivers/misc/tps6594-esm.c index d0f86b0e9..445d82bd3 100644 --- a/drivers/misc/tps6594-esm.c +++ b/drivers/misc/tps6594-esm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * ESM (Error Signal Monitor) driver for TI TPS6594/TPS6593/LP8764 PMICs + * ESM (Error Signal Monitor) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs * * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ */ @@ -20,6 +20,8 @@ #define ESM_MODE_CFG_CLR 0x0 #define ESM_START_CLR 0x0 +static struct reg_field tps65224_esm_mode_cfg = REG_FIELD(TPS6594_REG_ESM_MCU_MODE_CFG, 5, 6); +static struct reg_field tps65224_esm_start = REG_FIELD(TPS6594_REG_ESM_MCU_START_REG, 0, 0); static struct reg_field tps6594_esm_mode_cfg = REG_FIELD(TPS6594_REG_ESM_SOC_MODE_CFG, 5, 6); static struct reg_field tps6594_esm_start = REG_FIELD(TPS6594_REG_ESM_SOC_START_REG, 0, 0); @@ -87,8 +89,14 @@ static int tps6594_esm_probe(struct platform_device *pdev) if (!esm) return -ENOMEM; - esm->esm_mode_cfg = devm_regmap_field_alloc(dev, tps->regmap, tps6594_esm_mode_cfg); - esm->esm_start = devm_regmap_field_alloc(dev, tps->regmap, tps6594_esm_start); + if (tps->chip_id == TPS65224) { + esm->esm_mode_cfg = devm_regmap_field_alloc(dev, tps->regmap, + tps65224_esm_mode_cfg); + esm->esm_start = devm_regmap_field_alloc(dev, tps->regmap, tps65224_esm_start); + } else { + esm->esm_mode_cfg = devm_regmap_field_alloc(dev, tps->regmap, tps6594_esm_mode_cfg); + esm->esm_start = devm_regmap_field_alloc(dev, tps->regmap, tps6594_esm_start); + } if (IS_ERR(esm->esm_mode_cfg)) { dev_err(dev, "esm_mode_cfg reg field init failed\n"); @@ -176,5 +184,6 @@ module_platform_driver(tps6594_esm_driver); MODULE_ALIAS("platform:tps6594-esm"); MODULE_AUTHOR("Julien Panis "); +MODULE_AUTHOR("Bhargav Raviprakash "); MODULE_DESCRIPTION("TPS6594 Error Signal Monitor Driver"); MODULE_LICENSE("GPL"); -- 2.25.1