From patchwork Wed Apr 17 11:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhargav Raviprakash X-Patchwork-Id: 13633235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4285C04FFE for ; Wed, 17 Apr 2024 11:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bppHLi4gI3zYCbo5VP/4CC/i5Ev4RwsAQU/fzGfcLN0=; b=0heK4iWPX0Sgxu mSWshvzeN6Md6bibzrW3CsHOc9PIglsRdlsM9BzcJv9ogsAx78MPuACaM6mXMwPKAmuwCQvS9jaJ7 oS1J9xQb5KwlvIAi5ZLG6fV5N2KLSxdQzV1WmnUEyE+VggskwjvsVbu7F9YRJ01IWaBHAn5pGZn30 j+RNojBy2UbF+4kkUOAR55almOmkMAakhva9+/TO/0fvvkuewXxiqnWJB7vTtosVZkGEHoKeQ8D6p 4IcsC+WY/rQqHzOuPUI7duIJEwy/LnK/8j3aaenAjjk5hNhTcU8Cx3gRGs3bxTmfoGFNbQazNXExE NyAnCQtQ/A5PxQWVBTZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx3ny-0000000FpVQ-3do5; Wed, 17 Apr 2024 11:50:22 +0000 Received: from c180-15.smtp-out.ap-south-1.amazonses.com ([76.223.180.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx3nf-0000000FpHs-0zUU for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 11:50:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=i3fe3efcd4pbz7ipgssfqjhzqx347xbc; d=ltts.com; t=1713354596; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=IJCwVFHC82xALU9Z+JouTycL0dke5j/Wvz5yZnuBIwI=; b=wiy4mEFzdDsconXdj9saFtiUTNauojzhkC9sNaayY4UYv5w4OeaVOENRzkDeCQK3 BTk+XeIcnrWtknR/BaISH8G62Y6uB1yQ3e9dJ7YX4JfI2DzDBPSGjazcj3U4F/wIedd kGpFasI5WIw2HfgY36JYiASD4jFV5k27uMS6ydLsRppNnGQFm1LadNwFh5p4POClsoc 1U2LltbdCX2kbXpV4qejvqKPiDPVQyA/iy5u38FN5SFJ+55cB0Odw9nS3ycfstCJdJJ PFDKJ0eAUv8jLEswpEj8Po3N9wcJCXz9GIpDiu9yPEjaCDd2ZxJD90iKh+gu+shWzKU A7oeeriBzw== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=rlntogby6xsxlfnvyxwnvvhttakdsqto; d=amazonses.com; t=1713354596; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Feedback-ID; bh=IJCwVFHC82xALU9Z+JouTycL0dke5j/Wvz5yZnuBIwI=; b=AlPoElaas3p1c/qeSSY5zbzCO8gAgv12uZW3D1wjf0l3SYJSri6Cqnn4Bd7A5kmy eFSpfRZtG3EAhciG7ktwTdL/pLAUVxdtGLYzTqg+cbeZeBNFADPfp+tNNtWEZXThJyB kxVItaAE2TmTcwd21Ca6Cy5mANqr84ENsWGg+JUg= 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, eblanc@baylibre.com, Bhargav Raviprakash Subject: [PATCH v7 05/10] mfd: tps6594-spi: Add TI TPS65224 PMIC SPI Date: Wed, 17 Apr 2024 11:49:56 +0000 Message-ID: <0109018eebe45f0a-6aef6bbc-11ee-4e48-b39e-b1fbf42e510d-000000@ap-south-1.amazonses.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240417114934.186248-1-bhargav.r@ltts.com> References: <20240417114934.186248-1-bhargav.r@ltts.com> MIME-Version: 1.0 Feedback-ID: 1.ap-south-1./RC/PI2M8xOxQmTMPi0M1Q8h2FX69egpT62QKSaMPIA=:AmazonSES X-SES-Outgoing: 2024.04.17-76.223.180.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_045003_673818_AB12D408 X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for TPS65224 PMIC in TPS6594's SPI driver which has significant functional overlap. Signed-off-by: Bhargav Raviprakash Acked-by: Julien Panis --- drivers/mfd/tps6594-spi.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/tps6594-spi.c b/drivers/mfd/tps6594-spi.c index 5afb1736f..6ebccb79f 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); @@ -125,5 +129,5 @@ static struct spi_driver tps6594_spi_driver = { module_spi_driver(tps6594_spi_driver); MODULE_AUTHOR("Julien Panis "); -MODULE_DESCRIPTION("TPS6594 SPI Interface Driver"); +MODULE_DESCRIPTION("SPI Interface Driver for TPS65224, TPS6594/3, and LP8764"); MODULE_LICENSE("GPL");