mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

- Remove unused platform driver support for syscon. - Allow syscon nodes to be registered without a "syscon" compatible string. - Make `platform_data` pointer const in struct mfd_cell. - Revert support for multiple AXP PMICs to avoid regressions. - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO operation. - Store the result from fault_log() for use by other sub-components. - Fix an invalid regmap-config max_register value. - Add another Gemini Lake ISA bridge PCI device ID. - Use devm_register_power_off_handler() to simplify code. - Add support for QNAP microcontroller units, including LEDs, input, and hwmon. - Use MFD_CELL macros and remove unused code. - Add support for AAEON UP board FPGA. - Remove unused includes. - Fix various typos and compatibility issues in multiple bindings. - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424. - Convert several bindings to YAML schema. - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings directly. - Fix rohm,bd71815 bindings by correcting resistor values and typos. - Documentation improvements: - Add documentation for LED1202 and qnap-mcu-hwmon. - Adjust the file entry for the qnap-mcu header in MAINTAINERS. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmePbHkACgkQUa+KL4f8 d2HQNw//fM3+JpyTUKjUtBl8YH0ilgZ2iKiXLHyJ6vMIqv+RfLlPAliM8f1bkEj8 x/9kKp6ytdyAhQ/oAJW/vxRhWZVsfh9T7WSy/Q/WNChcGJ0KtUwtjWWuezdDJoyr 6Ju4PhKHVz46cBW56u3OCbcogN8AHi1gZiAh8APwVhldUO6swaisPBvxw/4u4WMs HGviTLueXEptF4/actnArQ1YJ6tctY7C5tV06f6Irxn6hSz8EpGBRQ47S7Hom+mx aIyRLkERqhZ1FNBDfk2YERqaOyxzQRYy+PMNr6AtQ/TE+7pVBOz7xoSI3VH3k7mM k4u8Gau9qbnVi/pUkabgcdKOCGUYeZzXZgJT/Ttq5O9ddPE8sHMcLrxKMtUP2CBE 6Zf0EljscGFOWise/ocNUblpy0rfXPl+wMiibxY5C+X56QkluDn2Q8ObGODt0bbR ACgPFL2S8m2MLEOTzBKDlSgeqoMZFKVWkqAry+yNUgIKbtM6pIdaM5ZCUhgdJ5GL CxGP6uw68oAUnr1lRCytgGR5XtmcIXS/Jo2u/T7cmucD3inuxQyt5TrZxma48QbL 2+P2vmymn6ZWQb82OptrnKCMsBEXnNbWv+2BiRYoKXQt48BxIocVrsyEQIh4qGcP KPUB1aCxP/zJ2H7rTaK4QqM+fgOloShs5nI21v5EWSCQKvTN5ko= =3HQm -----END PGP SIGNATURE----- Merge tag 'mfd-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull mfd updates from Lee Jones: - Fix race in device_node_get_regmap() using more extensive locking - Remove unused platform driver support for syscon - Allow syscon nodes to be registered without a "syscon" compatible string - Make `platform_data` pointer const in struct mfd_cell - Revert support for multiple AXP PMICs to avoid regressions - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO operation - Store the result from fault_log() for use by other sub-components - Fix an invalid regmap-config max_register value - Add another Gemini Lake ISA bridge PCI device ID - Use devm_register_power_off_handler() to simplify code - Add support for QNAP microcontroller units, including LEDs, input, and hwmon - Use MFD_CELL macros and remove unused code - Add support for AAEON UP board FPGA - Remove unused includes - Fix various typos and compatibility issues in multiple bindings - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424 - Convert several bindings to YAML schema - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings directly - Fix rohm,bd71815 bindings by correcting resistor values and typos - Documentation improvements: - Add documentation for LED1202 and qnap-mcu-hwmon - Adjust the file entry for the qnap-mcu header in MAINTAINERS * tag 'mfd-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (35 commits) MAINTAINERS: Adjust the file entry for the qnap-mcu header dt-bindings: mfd: syscon: Fix ti,j784s4-acspcie-proxy-ctrl compatible dt-bindings: mfd: syscon: Fix al,alpine-sysfabric-service compatible Revert "mfd: axp20x: Allow multiple regulators" dt-bindings: mfd: syscon: Add rk3562 QoS register compatible mfd: syscon: Allow syscon nodes without a "syscon" compatible mfd: syscon: Remove the platform driver support mfd: syscon: Fix race in device_node_get_regmap() dt-bindings: mfd: atmel: Convert to YAML schema dt-bindings: mfd: atmel,at91sam9260: Convert to YAML schema dt-bindings: mfd: sprd,sc2731: Reference sprd,sc2731-efuse bindings mfd: tps65219: Remove unused macros & add regmap.h mfd: tps65219: Use MFD_CELL macros leds: Add LED1202 I2C driver dt-bindings: leds: Add LED1202 LED Controller Documentation:leds: Add leds-st1202.rst mfd: Add support for AAEON UP board FPGA mfd: da9052: Store result from fault_log mfd: intel_soc_pmic_chtdc_ti: Fix invalid regmap-config max_register value mfd: cs42l43: Use devres for remove as well ...
91 lines
2.3 KiB
C
91 lines
2.3 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* CS42L43 I2C driver
|
|
*
|
|
* Copyright (C) 2022-2023 Cirrus Logic, Inc. and
|
|
* Cirrus Logic International Semiconductor Ltd.
|
|
*/
|
|
|
|
#include <linux/array_size.h>
|
|
#include <linux/err.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/mfd/cs42l43.h>
|
|
#include <linux/mfd/cs42l43-regs.h>
|
|
#include <linux/mod_devicetable.h>
|
|
#include <linux/module.h>
|
|
#include <linux/pm.h>
|
|
#include <linux/regmap.h>
|
|
|
|
#include "cs42l43.h"
|
|
|
|
static const struct regmap_config cs42l43_i2c_regmap = {
|
|
.reg_bits = 32,
|
|
.reg_stride = 4,
|
|
.val_bits = 32,
|
|
.reg_format_endian = REGMAP_ENDIAN_BIG,
|
|
.val_format_endian = REGMAP_ENDIAN_BIG,
|
|
|
|
.max_register = CS42L43_MCU_RAM_MAX,
|
|
.readable_reg = cs42l43_readable_register,
|
|
.volatile_reg = cs42l43_volatile_register,
|
|
.precious_reg = cs42l43_precious_register,
|
|
|
|
.cache_type = REGCACHE_MAPLE,
|
|
.reg_defaults = cs42l43_reg_default,
|
|
.num_reg_defaults = ARRAY_SIZE(cs42l43_reg_default),
|
|
};
|
|
|
|
static int cs42l43_i2c_probe(struct i2c_client *i2c)
|
|
{
|
|
struct cs42l43 *cs42l43;
|
|
|
|
cs42l43 = devm_kzalloc(&i2c->dev, sizeof(*cs42l43), GFP_KERNEL);
|
|
if (!cs42l43)
|
|
return -ENOMEM;
|
|
|
|
cs42l43->dev = &i2c->dev;
|
|
cs42l43->irq = i2c->irq;
|
|
/* A device on an I2C is always attached by definition. */
|
|
cs42l43->attached = true;
|
|
|
|
cs42l43->regmap = devm_regmap_init_i2c(i2c, &cs42l43_i2c_regmap);
|
|
if (IS_ERR(cs42l43->regmap))
|
|
return dev_err_probe(cs42l43->dev, PTR_ERR(cs42l43->regmap),
|
|
"Failed to allocate regmap\n");
|
|
|
|
return cs42l43_dev_probe(cs42l43);
|
|
}
|
|
|
|
#if IS_ENABLED(CONFIG_OF)
|
|
static const struct of_device_id cs42l43_of_match[] = {
|
|
{ .compatible = "cirrus,cs42l43", },
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(of, cs42l43_of_match);
|
|
#endif
|
|
|
|
#if IS_ENABLED(CONFIG_ACPI)
|
|
static const struct acpi_device_id cs42l43_acpi_match[] = {
|
|
{ "CSC4243", 0 },
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(acpi, cs42l43_acpi_match);
|
|
#endif
|
|
|
|
static struct i2c_driver cs42l43_i2c_driver = {
|
|
.driver = {
|
|
.name = "cs42l43",
|
|
.pm = pm_ptr(&cs42l43_pm_ops),
|
|
.of_match_table = of_match_ptr(cs42l43_of_match),
|
|
.acpi_match_table = ACPI_PTR(cs42l43_acpi_match),
|
|
},
|
|
|
|
.probe = cs42l43_i2c_probe,
|
|
};
|
|
module_i2c_driver(cs42l43_i2c_driver);
|
|
|
|
MODULE_IMPORT_NS("MFD_CS42L43");
|
|
|
|
MODULE_DESCRIPTION("CS42L43 I2C Driver");
|
|
MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.cirrus.com>");
|
|
MODULE_LICENSE("GPL");
|