From patchwork Thu Feb 8 09:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhargav Raviprakash X-Patchwork-Id: 198244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp44461dyd; Thu, 8 Feb 2024 01:24:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUMPUYYVZckbUc4KLxf6UPRPHLegJW4+bZGNnqwRMiJgGS4qdSc+Kjhg3kZ57NhZjnystUehdXP1NFyGOF3iG7nH3mYUA== X-Google-Smtp-Source: AGHT+IEk6l4I4GPu0w1j/S5qGB0anmwVShrog9GOiDx9n6b8cOAoh8rK2HvJ8yc/a/kNEn7dAJ8E X-Received: by 2002:a17:907:2da4:b0:a38:7015:fc01 with SMTP id gt36-20020a1709072da400b00a387015fc01mr4401467ejc.2.1707384275317; Thu, 08 Feb 2024 01:24:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384275; cv=pass; d=google.com; s=arc-20160816; b=oCf4kLRKHRXkiUlVfHavxee6UIjGxZYFHGj88fksM73/C9+sDyuSK/SPhtofOwjK3h sUs4P3iMs4kX0bn7mkCzcCr//J471QEqc94PxOOy1QBTSPg9JpG/H4XaEC/38QPxdslJ HCxbO9DJXaP1PsKzOdqOIn82pmyoeTWLQfOxH9y8Yt7PSx6DGbqKw0HDn5rqlj62o1sP P/IcwfSJgWg9SAILLxFzcOoNMYpdA+bfy5uX6gBW+rnJEp/8F3WaMciPzCxokKCKtuez i1wPsMk6xROrnHAeAOqH0AmuDLCXRz9tgjmKubOd83mckeHiplNwQ93ZcNsb3BHmC5k3 /EQA== 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=HWYMZ4pOld6uzsnNu3PhUsypEIYeyViGuHnPCwUtcuI=; b=MKiCzIuzCy7XMGyBkx0pGg5AJxbXGGzgQuSff/bcka0vFfPFYjaip42nz8dxJ7uoiH Z+Vsy75KxhJx3Igng1GIB6OAx12pipcMu2Oyg2TfmQQi2H3UNP/cLGnsZKArSzgwRCBY 5NRiy6SPGwuHhrKmXzur8U13qxwq+NfqVfIDvpjk5HQs8RJv1JdejRuMEKJSf8gfYoTV 87gtHX78IeDW1w1v13JGmLQnSkkGxj1zkSp1YKatmHE0YXY1IZf+UYtd1Yplgj/us/rU Wf1EXe4v1ePH26BMTY8jHFoZ6MNBwYKhqp0p1gaEaTUMk8JSUSNr75WETBGe9Z3hxp1u QJsA==; 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-57726-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57726-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com X-Forwarded-Encrypted: i=2; AJvYcCURr8LPWbfrJfCg7i1riGQAeIcv5FyTSiqfY/e/vHYKIIXjoI9wcDC/Yn3pBbLD0T5IBJyRZG1gIOQaTPwJyT6lYALyGw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jw21-20020a17090776b500b00a3b9390beb4si494926ejc.90.2024.02.08.01.24.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57726-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-57726-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57726-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) 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 am.mirrors.kernel.org (Postfix) with ESMTPS id E3E1C1F2122C for ; Thu, 8 Feb 2024 09:24:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1323745E5; Thu, 8 Feb 2024 09:21:25 +0000 (UTC) Received: from esa1.ltts.com (unknown [118.185.121.105]) (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 09F0E71B3B for ; Thu, 8 Feb 2024 09:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.185.121.105 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384084; cv=none; b=LuyEbULJeM5s3fzOX8dKUGNEzoW2G/XGJ9lja5NmLhCIa6q27fb3PJTgnzo5Oe2lTmPUwC2QcSAtEyidEgBaZYB4S7Ij1RPgqf7K648BITgkV9fajI4r+wOaarFW+obF/tv2mw1y8SBWqpBE+rHrxZB7oWwca45w+c9qom0K7Ls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384084; c=relaxed/simple; bh=ANFQs58thb6Sfo8Tnd1vzz2cEfX0deEseKjVLICGrQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=myxtKiaHUTAF5Osm4p81EF458KwRBCJFK9dfwoJpG0xa8TH5584jFLjSGHcM/cyITyrhMil0BvNqZ56Ike8wyTiAqv/BTNoXIsBnW1CxiAVVRZkKUrV5CfPCVKkafxW7YPHR2qnDGOiAfBsKE5/neDpAoQz/hyVXi30+CxQQ/8I= 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=118.185.121.105 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: 4/N13WmplNXRIeMIGn/FrRpk2Cyz+WSpmbB8whz8wzehNUbXss/FbNbvDU0VTJjgrE49cV8rnq W6bek2HdD9xA== Received: from unknown (HELO localhost.localdomain) ([192.168.34.55]) by esa1.ltts.com with ESMTP; 08 Feb 2024 14:51:14 +0530 From: Bhargav Raviprakash To: linux-kernel@vger.kernel.org Cc: m.nirmaladevi@ltts.com, arnd@arndb.de, gregkh@linuxfoundation.org, Bhargav Raviprakash Subject: [PATCH v1 10/13] misc: tps6594-esm: Add TI TPS65224 PMIC ESM Date: Thu, 8 Feb 2024 14:50:59 +0530 Message-Id: <20240208092059.1207134-4-bhargav.r@ltts.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240208092059.1207134-1-bhargav.r@ltts.com> References: <20240208092059.1207134-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322173931038086 X-GMAIL-MSGID: 1790322173931038086 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");