Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: tps6594-spi: Add TI TPS65224 PMIC SPI

Add support for TPS65224 PMIC in TPS6594's SPI driver which has
significant functional overlap.

Signed-off-by: Bhargav Raviprakash <bhargav.r@ltts.com>
Acked-by: Julien Panis <jpanis@baylibre.com>
Link: https://lore.kernel.org/r/0109018f2fdc6328-6d13785c-9832-471b-bdfe-fb1dac3bdc60-000000@ap-south-1.amazonses.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Bhargav Raviprakash and committed by
Lee Jones
02716864 f8e5fc60

+11 -7
+11 -7
drivers/mfd/tps6594-spi.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs 3 + * SPI access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 4 * 5 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 6 */ ··· 66 66 return spi_write(spi, buf, count); 67 67 } 68 68 69 - static const struct regmap_config tps6594_spi_regmap_config = { 69 + static struct regmap_config tps6594_spi_regmap_config = { 70 70 .reg_bits = 16, 71 71 .val_bits = 8, 72 72 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, ··· 81 81 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 82 82 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 83 83 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 84 + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, 84 85 {} 85 86 }; 86 87 MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); ··· 102 101 tps->reg = spi_get_chipselect(spi, 0); 103 102 tps->irq = spi->irq; 104 103 105 - tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); 106 - if (IS_ERR(tps->regmap)) 107 - return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 108 - 109 104 match = of_match_device(tps6594_spi_of_match_table, dev); 110 105 if (!match) 111 106 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 112 107 tps->chip_id = (unsigned long)match->data; 108 + 109 + if (tps->chip_id == TPS65224) 110 + tps6594_spi_regmap_config.volatile_table = &tps65224_volatile_table; 111 + 112 + tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); 113 + if (IS_ERR(tps->regmap)) 114 + return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 113 115 114 116 crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); 115 117 ··· 129 125 module_spi_driver(tps6594_spi_driver); 130 126 131 127 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 132 - MODULE_DESCRIPTION("TPS6594 SPI Interface Driver"); 128 + MODULE_DESCRIPTION("SPI Interface Driver for TPS65224, TPS6594/3, and LP8764"); 133 129 MODULE_LICENSE("GPL");