From patchwork Thu Feb 8 09:20:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhargav Raviprakash X-Patchwork-Id: 198242 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp44402dyd; Thu, 8 Feb 2024 01:24:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWMJuO9qRT684vNKTyjXM4mpmawWSxawRKWhoCjws/TtXp6vvIMb098FN70SPi280kC/ey X-Received: by 2002:a05:6830:328e:b0:6dd:f075:e45b with SMTP id m14-20020a056830328e00b006ddf075e45bmr8757186ott.16.1707384267339; Thu, 08 Feb 2024 01:24:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384267; cv=pass; d=google.com; s=arc-20160816; b=BgDzgQvTAqgb/fmAo9a5oRen5ETToxBkwohD33agJO3y2lkHd/z7YKk0tS6+VmEAWV QsylBAtFjQnxgbV37Y9aMalfmBSXHRJUvYlI+U1qGuJLagCYqsd0cDGhrgboj30mVIqw 87+5Y6EQSB8lGBU3TnFTROBZwgCZiCw7dJu1ha1G1R08UnmAi5S6MGRqBtDXhSwI2kVs Ee1jpUAWDZ9lV89lFLQELJ0dbqFFy9V0G6u/9fMtKZz5VCH25MN07rl6sFtv8J9waP2p wVcNP7MQOznBZu9iFwXdahPeL3eZfbh5wBUuOGav0ng2bSdjGdAaw49UNgN2LW5rq4qS QGhQ== 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=PAiLVy2IsYeaLD5mSihwK/6eFq4cW7mUyGCWKZuDCg0=; b=nRvlAx7/wqEmPrWUwp4Phg0xm+nAvFl4J/I4N2ZXPMCPHmViDK3zG2R1sBIus3lJdk wsLCDW553Ho+Xj5Frkcq3j6Dfa3HvDBUWzBBPoS1RG7bhX3QRAWWwVz/CtwUA9UEkmUC nvpib8Ibbm2LIgcFc7x42oPpOV6COxj7rfN6xr0rVRZM7v1n5EtwYAyGTjsaN+T3H2yi ekJhw3olzhV461KeWnW/Dp36gXJjlHrGqFjTMSWQmobggTwf0qKtDbGtBwlYdfOwD4jt liEqAf5haFM30jsOpLN8iMKAJuBCiJ2tIs1TIC453xBYEoq0eMa7WPNG5whdS/S3YqL0 dWKw==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57724-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com X-Forwarded-Encrypted: i=2; AJvYcCX+iCIuOimHpcSfrKMgRmL4ee5nbe5Xr0GLJDHoc1H8EWd2cLD7wXGT6InWGc1RLTZFuhGNvsUoJhUkGZTCmv0MGzm03w== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bx30-20020a056a02051e00b005d6d6f8cbddsi3985163pgb.360.2024.02.08.01.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:24:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57724-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57724-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DE7F82878B1 for ; Thu, 8 Feb 2024 09:24:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D5F771B4C; Thu, 8 Feb 2024 09:21:23 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322165728432270 X-GMAIL-MSGID: 1790322165728432270 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);