Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp144210rdb; Thu, 8 Feb 2024 01:23:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPLkX0ExiFG+8odgoL9rl2Ofdutezvuwxv7taS3T2l2ZarWdDyV4x+d2zHZ0Y5H/Fsr5pQ X-Received: by 2002:ac8:7c8c:0:b0:42b:f656:c0a5 with SMTP id y12-20020ac87c8c000000b0042bf656c0a5mr8549553qtv.18.1707384237664; Thu, 08 Feb 2024 01:23:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384237; cv=pass; d=google.com; s=arc-20160816; b=uO0X6uDZVKDIV7LwOV9pkbZc+QdC/9hG7jCMAiTC38LySRbboZKB+3goCNHMJGfMvR HlXbYWaURVto1tq4xffq1dkLciHk10JLKi250bMIT+tafbwXoFiIEAigevw1QrkMAPld uWaBL1j1ERJ3mLB6FWwqaIHf/G/m3LzvYjyr8esU8HoJe4kAXcX4IDJpmvTNbVZXGcQ6 zPldOt0WVHDuOm8Hhzj3M08XIYiwOJVUeaYwLePvaTQ2yAWVg2Ucj/gASqbt8GORBSvu /bpqnnGbZ5CWm2rjoagIbKWa8lai76u9fdR6c9qqFa+HF0g0TkR69VAR7fj6s0M0E+4w FzNA== 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=hYy7mJ6GqLf6v9ReOyKGjxWG5S0lvLvlx424QKIi8Gk=; fh=SMYRsG6/TaXi6/J5aLsTH6l3gp21ZKEebbqNthgXuDU=; b=hFdxeVWDd/4Bvaej8QTMv8Z4cSOUzbNnC/goVe/fZ6pmEF1FvVuNgl4XEGmGXD7Usg 5PYPEFKU6tFvJ4aoL1CR3bD0JEql6F9m+XWD5j5lrTF1soAInO0xqZ1ixRGr9L1k3wiW SqauihZl7I49AeCstJxaFXX7/lE+fJVWjvD8VK43emuVIeeEtMyBQbuopvl7VzGJItRk ihAm8DRbp2auEIPp2ht2Kl2FJVESndxOQutEg3M42ySQF05vzXOYbbZiu7GEu4X+oXlh SSJotUXxIlIEFySFV9kj/LrZ+DHBY9bVB2KloVDA6/7DuH7VtueAWzpPIOOlMYcskvWD 2MDw==; 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-57724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com X-Forwarded-Encrypted: i=2; AJvYcCWE2mmgFE8MWfHOzPiMdgmzvQvNFsB9TARuLNzZGr4/GojCM1KI9pynjdkvb1F6+yqzeNKLNcp6CwVrsuCxN+j964mFYtYOLSvN96q92w== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e17-20020ac85dd1000000b0042a7092de67si2823083qtx.42.2024.02.08.01.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-57724-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57724-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3CDBD1C232E2 for ; Thu, 8 Feb 2024 09:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF38E71B38; Thu, 8 Feb 2024 09:21:21 +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 6106A71B21 for ; Thu, 8 Feb 2024 09:21:19 +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=1707384081; cv=none; b=lLHediNsdlF8Ml51kSIIYcIxdBnr8T8XRhhuk0d5+3axO0dMp9qW2DW673ak19o205o6pxUrb4mVZytvPGazuqEHSqI9Q4iRApWhFjbeU6oZVnr7a+JVrhL3BNFCv+ciXdjrnJW4Y+S+6tnSAIt6kBqyHsr6f7hm4h+temGNro0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384081; c=relaxed/simple; bh=6KBxbdjaQLnVhpeBHZmuCEbJu0n286hs7uzybtzFK9Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SNwOnmls02DYbkmUGNbiiyv0LBFtLmcQ0Y2Xt1KqjERpehaVftgiAKkY/Gz96hoKFyAf/5y+Pp+OtnSSwSrkZgK/7NhPgscSTgTVvuU9UlTPPZbTp4mrsd/zOuuHi2oH9ZOB8L24FPns85KyWUUbfKIwqAYKGICv5bvDM6zkGvQ= 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: cpNfb3ZsQAjM4Sd0jB+YJRSe2/lAN9CzXemENI9SJsiL2REuAd4om2RpzL3DbIJh6/dMIENpm7 yt3wPhZMbgog== Received: from unknown (HELO localhost.localdomain) ([192.168.34.55]) by esa1.ltts.com with ESMTP; 08 Feb 2024 14:51:13 +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 08/13] misc: tps6594-esm: reversion check limited to TPS6594 family Date: Thu, 8 Feb 2024 14:50:57 +0530 Message-Id: <20240208092059.1207134-2-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 Content-Transfer-Encoding: 8bit The reversion check is only applicable on TPS6594 family of PMICs. Conditionally add that check if the chip_id is one of the PMIC in the TPS6594 family. Signed-off-by: Bhargav Raviprakash --- drivers/misc/tps6594-esm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/misc/tps6594-esm.c b/drivers/misc/tps6594-esm.c index b4d67a1a2..8ec5af9dc 100644 --- a/drivers/misc/tps6594-esm.c +++ b/drivers/misc/tps6594-esm.c @@ -45,13 +45,17 @@ static int tps6594_esm_probe(struct platform_device *pdev) * As a consequence, ESM can not be used on those PMIC. * Check the version and return an error in case of revision 1. */ - ret = regmap_read(tps->regmap, TPS6594_REG_DEV_REV, &rev); - if (ret) - return dev_err_probe(dev, ret, - "Failed to read PMIC revision\n"); - if (rev == TPS6594_DEV_REV_1) - return dev_err_probe(dev, -ENODEV, - "ESM not supported for revision 1 PMIC\n"); + if (tps->chip_id == TPS6594 || + tps->chip_id == TPS6593 || + tps->chip_id == LP8764) { + ret = regmap_read(tps->regmap, TPS6594_REG_DEV_REV, &rev); + if (ret) + return dev_err_probe(dev, ret, + "Failed to read PMIC revision\n"); + if (rev == TPS6594_DEV_REV_1) + return dev_err_probe(dev, -ENODEV, + "ESM not supported for revision 1 PMIC\n"); + } for (i = 0; i < pdev->num_resources; i++) { irq = platform_get_irq_byname(pdev, pdev->resource[i].name); -- 2.25.1