From patchwork Thu Feb 8 09:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhargav Raviprakash X-Patchwork-Id: 198236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp43555dyd; Thu, 8 Feb 2024 01:22:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaEzgzYfzYZf5ys0xT04HakgQrbXMC9uzXFdbKCOAz/CUuUFaNccTIxOz0gxfqu/minnO9 X-Received: by 2002:a05:6808:d4f:b0:3bf:f4b8:7816 with SMTP id w15-20020a0568080d4f00b003bff4b87816mr971923oik.4.1707384136597; Thu, 08 Feb 2024 01:22:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384136; cv=pass; d=google.com; s=arc-20160816; b=ytEGqPS650MwZZ2ckLg0u5OiD3bOLhJ5cK3G1G5lxSofarwRYOs0F5SxWgKe20K+mL E/1GkMccUWMcv/5yldnsVhrUUl88KPl3d/odABH3/qD9kZMow1M1k9NLNXPFlHgQ05tc gk0yYqx30BzGAJ0W+2L88iTT5DGEvM41wZxnim9pKThuZLaiq9Vp4jmjbBLJvOGGY9eX fIzo9p5kya6yzN6l3TzqcbNcHZxZbJvA3qNI4W5u3RmaKmSrp/iomcgEqWAYmcPAIH1J xx69SFV1WWsun/Y9Aj5lgL+Bte7lWBLUxqk9Bbg0M9HIbA0456X6gey/blTww2hwUb37 pMUQ== 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=TMjvD/ATCJ/zUNYU/xQAh9y/wi/wXa3bAn75wEtsT1k=; fh=WP/BluM6qU3IjHxrrNDxaN0fGqHPQWr6Q1z9AFNa65k=; b=JkjptBgkbT74fgZkJJ1BNK3OR0rwSKTCMNMEqGsTk/GKyzOuASbjACQluJ1rJAjrEv iYRLX9+14WW8sb+pQDsOpf/laWl3MXvD7bZaagyn9QR5A7bDNGxV0/pt3JjrBRu+eCgb tkvsaI9t3WftNBtORwgzH35B9N1HwFaHvPMI+7XkuHxLIv0hwlF1+A33f/0sOeG5awFw UTIiQOmigYQr/1hVVnLZq2Y/sLkHRuEVQyyPf/cVb8uSrJkEwLOqP34pUI6ckpT91qKu BJtlAbndrtZNsvYcdJW95PQOHd0ETfmE5vBbOvN6a8TGRVF3Zz/LIXp7JsFlowmMCm1W un6Q==; 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-57718-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57718-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ltts.com X-Forwarded-Encrypted: i=2; AJvYcCVwfv3d331GLBlsHxBIOfYBFf0znw9mEGA/3upLgoAqwssgg/GgGayJeCPfcIrK7OslRobsxlcZtXGQP1Alss6vkpRNug== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jc35-20020a056a006ca300b006e07c71b74fsi234232pfb.338.2024.02.08.01.22.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:22:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57718-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-57718-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57718-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 58678288B87 for ; Thu, 8 Feb 2024 09:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FCE86EB6E; Thu, 8 Feb 2024 09:20:59 +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 3C6116BFA9 for ; Thu, 8 Feb 2024 09:20:53 +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=1707384057; cv=none; b=B59atcQ71mKlGOA49EA0GbYsMCk2wAsZtfAsOdExfzoy/WgM/KpfCsBWp0HbAGVBiELT+cnld5h2eeW5EbCVf2cQh/IibgVUKE3VpJGtDuS8ZD7/VLAYAJiAu8yzJMtdjpKm9dO2AMOjiZBa523wC8IQBFG6CMRVMaB7pBNW4XE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384057; c=relaxed/simple; bh=QEhLrpWSamTGYLYMwHJ3aLQ/OdCpxb6FCO3gAWHGCTM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MOrfbKqQZrpJvTPBtEEeTmEkqmZJ6ApBsEhcuABK+aZSNQP0eYU//hN1uzfydiVAzp+xNbiKf+q/YJ0F/FmGvDtSl4BvtW1pM1TP0nZVTGb5CfWeOdxnnpJn5W6OiIhQksOucNfREMG5+z/YnFhHLAuKexQ0iC3oGCBqV6dN1fc= 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: kYbrwjj5HXgnK2Aj2YIBiLoonUN60hvCRRStpk6I1rrFem8+AZFTTna9JzSaBhqObcXcjX7ZE4 Cjp/oceqdIvQ== Received: from unknown (HELO localhost.localdomain) ([192.168.34.55]) by esa1.ltts.com with ESMTP; 08 Feb 2024 14:50:48 +0530 From: Bhargav Raviprakash To: linux-kernel@vger.kernel.org Cc: m.nirmaladevi@ltts.com, lee@kernel.org, Bhargav Raviprakash Subject: [PATCH v1 05/13] mfd: tps6594-spi: Add TI TPS65224 PMIC SPI Date: Thu, 8 Feb 2024 14:50:33 +0530 Message-Id: <20240208092034.1207057-2-bhargav.r@ltts.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240208092034.1207057-1-bhargav.r@ltts.com> References: <20240208092034.1207057-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: 1790322028060579349 X-GMAIL-MSGID: 1790322028060579349 Add support for TPS65224 PMIC in the TPS6594 driver as they share significant functional overlap. Signed-off-by: Bhargav Raviprakash --- drivers/mfd/tps6594-spi.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/tps6594-spi.c b/drivers/mfd/tps6594-spi.c index 5afb1736f..7ec66d31b 100644 --- a/drivers/mfd/tps6594-spi.c +++ b/drivers/mfd/tps6594-spi.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs + * SPI access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs * * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ */ @@ -66,7 +66,7 @@ static int tps6594_spi_reg_write(void *context, unsigned int reg, unsigned int v return spi_write(spi, buf, count); } -static const struct regmap_config tps6594_spi_regmap_config = { +static struct regmap_config tps6594_spi_regmap_config = { .reg_bits = 16, .val_bits = 8, .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, @@ -81,6 +81,7 @@ static const struct of_device_id tps6594_spi_of_match_table[] = { { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, {} }; MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); @@ -101,15 +102,18 @@ static int tps6594_spi_probe(struct spi_device *spi) tps->reg = spi_get_chipselect(spi, 0); tps->irq = spi->irq; - tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); - if (IS_ERR(tps->regmap)) - return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); - match = of_match_device(tps6594_spi_of_match_table, dev); if (!match) return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); tps->chip_id = (unsigned long)match->data; + if (tps->chip_id == TPS65224) + tps6594_spi_regmap_config.volatile_table = &tps65224_volatile_table; + + tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); + if (IS_ERR(tps->regmap)) + return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); + crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); return tps6594_device_init(tps, enable_crc);