mirror of
https://github.com/torvalds/linux.git
synced 2026-10-15 12:19:02 +02:00
- New Support & Features
- MediaTek MT6397: Add mt6323 AUXADC support.
- MediaTek MT6397: Add mt6323 EFUSE support.
- Spreadtrum SC27xx: Add SC2730 regulator cell.
- Improvements & Fixes
- Apple SMC: Fix key count endianness annotation.
- Azoteq IQS62x: Reject zero-length firmware records.
- ChromeOS EC: Introduce cros_ec_read_features helper and read features during
probe to catch transfer errors.
- Cirrus Logic CS42L43: Fix regmap defaults ordering.
- Cirrus Logic CS42L43: Remove redundant NULL checks on SoundWire.
- Congatec Board Controller: Fix teardown ordering in cgbc_remove().
- HP iPAQ Micro: Fix out-of-bounds stack read in ipaq_micro_str.
- Marvell 88PM886: Initialize the battery page.
- QNAP MCU: Keep the reply buffer alive past a command timeout.
- RAVE SP: Validate received frame payload lengths.
- Silicon Labs Si476x: Drop duplicate NULL checks.
- Silicon Labs Si476x: Modernize GPIO handling.
- Silicon Motion SM501: Fix potential memory leaks during remove.
- UCB1x00: Convert Assabet gpio-keys to use software nodes and register software
node for GPIO controller.
- Viperboard: Fix native fields type in structures as little-endian.
- Viperboard: Remove redundant NULL check before kfree().
- X-Powers AXP20x: Preserve other control bits when powering off.
- Cleanups & Refactoring
- Core: Drop unused assignment of spi_device_id driver data.
- Core: Initialize spi_device_id arrays using member names.
- Core: Unify style of spi_device_id arrays.
- Maintainers: Add Intel LPSS section to follow the changes.
- Maintainers: Add a mailing list entry to MFD.
- Cirrus Logic CS42L43: Format sdw_device_id table.
- Cirrus Logic CS42L43: Use new SoundWire enumeration helper.
- ROHM PMIC: Factor out power button registration and convert gpio-keys to use
software nodes.
- ST-Ericsson DB8500: Fold dbx500 header into db8500.
- Device Tree Binding Updates
- Core: Add techvision vendor prefix.
- Marvell 88PM886: Allow vbus regulator.
- MediaTek MT8195 SCP: Add support for MT8189 SoC.
- Qualcomm SPMI PMIC: Document PMG1110.
- Qualcomm SPMI PMIC: Document haptics device.
- Qualcomm TCSR: Add compatible for Hawi and Maili SoCs.
- Qualcomm TCSR: Add compatible for Shikra.
- Qualcomm TCSR: Document the IPQ9650 TCSR block.
- STMicroelectronics STMPE: Fix typo st,stmpe601 (should be st,stmpe610).
- Syscon: Add ESWIN EIC7700 compatible.
- Syscon: Allow syscon compatible for Loongson-2K0300 chip id.
- Syscon: Disallow simple-bus with syscon.
- Syscon: Drop custom select for older dtschema.
- TI OMAP USBHS TLL: Convert to DT schema.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmqPE0EACgkQUa+KL4f8
d2EwsA/6Ah511L+E+sH3PMz9/9ZR7F6b4xXx+YI0WuiWANNNEdxkkIiq6smdCQI9
oS//iJBdMigdKzjllIwnAHTcfatZE+3A6qCroM0pnxsQejDdAR0BP2VA4b7QMGg0
ey44e5CYZgRorh9oOTtsjE/jL4sNZK6AgyZab0gZ3Q/A5qubLRiSaphHfpfCej+q
RC3W2m3jbQSge5iNy8iIg41PH4fHcjpRNM/UxT6UVexxBWiJ6i9yiNYdfb4joCuG
Oh4Rr4TfnoN8yIuoA8WRngYejpV5ZGGnwXwTDl47WPvoJiMeWSnpQU0u/fSJARqm
YAMtZ+GLjSfj60SgCu6HR8AyH9q5U54pNdBiCSQ/7fGhYJwq9WS/XDjr+Xaj0+ku
g4veatMTMaNdwJr0RAViw1RAOA97cAqfgOADnlAJM/tzvGw0VjIxdrbciywUXB2A
At26ibT6WQX/I/fPSJqmwieEYiueikZfvuLFYAeSrLQ4GWGGgq3Aj4k1LtOVLEP3
y3Pt4rkxJQxW3EDKseaZYsyR7EbU3PnJFTsAY0/p1XiDSeiM4d0IIi7dZQiQygg4
3XwmqE8ODxetHna+dPXr0ooaU9UIaaT1X5AyOr6t6Tp/n0Yq50F1PpjBCS2nLAYk
JdkgfFBMWlkOZcCTgLYMKNSnmWZihUxb0zfDaOMCe4HUoqc1WLA=
=92XF
-----END PGP SIGNATURE-----
Merge tag 'mfd-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"New Support & Features:
- MediaTek MT6397: Add mt6323 AUXADC support
- MediaTek MT6397: Add mt6323 EFUSE support
- Spreadtrum SC27xx: Add SC2730 regulator cell
Improvements & Fixes:
- Apple SMC: Fix key count endianness annotation
- Azoteq IQS62x: Reject zero-length firmware records
- ChromeOS EC: Introduce cros_ec_read_features helper and read
features during probe to catch transfer errors
- Cirrus Logic CS42L43: Fix regmap defaults ordering
- Cirrus Logic CS42L43: Remove redundant NULL checks on SoundWire
- Congatec Board Controller: Fix teardown ordering in cgbc_remove()
- HP iPAQ Micro: Fix out-of-bounds stack read in ipaq_micro_str
- Marvell 88PM886: Initialize the battery page
- QNAP MCU: Keep the reply buffer alive past a command timeout
- RAVE SP: Validate received frame payload lengths
- Silicon Labs Si476x: Drop duplicate NULL checks
- Silicon Labs Si476x: Modernize GPIO handling
- Silicon Motion SM501: Fix potential memory leaks during remove
- UCB1x00: Convert Assabet gpio-keys to use software nodes and
register software node for GPIO controller
- Viperboard: Fix native fields type in structures as little-endian
- Viperboard: Remove redundant NULL check before kfree()
- X-Powers AXP20x: Preserve other control bits when powering off
Cleanups & Refactoring:
- Core: Drop unused assignment of spi_device_id driver data
- Core: Initialize spi_device_id arrays using member names
- Core: Unify style of spi_device_id arrays
- Maintainers: Add Intel LPSS section to follow the changes
- Maintainers: Add a mailing list entry to MFD
- Cirrus Logic CS42L43: Format sdw_device_id table
- Cirrus Logic CS42L43: Use new SoundWire enumeration helper
- ROHM PMIC: Factor out power button registration and convert
gpio-keys to use software nodes
- ST-Ericsson DB8500: Fold dbx500 header into db8500
Device Tree Binding Updates:
- Core: Add techvision vendor prefix
- Marvell 88PM886: Allow vbus regulator
- MediaTek MT8195 SCP: Add support for MT8189 SoC
- Qualcomm SPMI PMIC: Document PMG1110
- Qualcomm SPMI PMIC: Document haptics device
- Qualcomm TCSR: Add compatible for Hawi and Maili SoCs
- Qualcomm TCSR: Add compatible for Shikra
- Qualcomm TCSR: Document the IPQ9650 TCSR block
- STMicroelectronics STMPE: Fix typo st,stmpe601 (should be
st,stmpe610)
- Syscon: Add ESWIN EIC7700 compatible
- Syscon: Allow syscon compatible for Loongson-2K0300 chip id
- Syscon: Disallow simple-bus with syscon
- Syscon: Drop custom select for older dtschema
- TI OMAP USBHS TLL: Convert to DT schema"
* tag 'mfd-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits)
mfd: cs42l43: Fix regmap defaults ordering
dt-bindings: mfd: syscon: Allow syscon compatible for Loongson-2K0300 chip id
dt-bindings: mfd: syscon: Add ESWIN EIC7700 compatible
mfd: qnap-mcu: keep the reply buffer alive past a command timeout
dt-bindings: mfd: qcom,tcsr: Document the IPQ9650 TCSR block
mfd: macsmc: Fix key count endianness annotation
dt-bindings: mfd: qcom,spmi-pmic: Document haptics device
mfd: iqs62x: Reject zero-length firmware records
mfd: rave-sp: validate received frame payload lengths
mfd: sm501: Fix potential memory leaks during remove
mfd: viperboard: Fix native fields type in structures as little-endian
mfd: si476x-i2c: Get rid of duplicate NULL checks
dt-bindings: mfd: Convert OMAP USB TLL to DT schema
mfd: cgbc: Fix teardown ordering in cgbc_remove()
mfd: mt6397-core: Add mt6323 AUXADC support
dt-bindings: mfd: qcom,tcsr: Add compatible for Hawi and Maili SoCs
mfd: rohm: Factor out power button registration
mfd: ucb1x00: Convert Assabet gpio-keys to use software nodes
mfd: ucb1x00: Register software node for GPIO controller
mfd: cs42l43: Tidy up formatting on sdw_device_id table
...
92 lines
2.4 KiB
C
92 lines
2.4 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/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;
|
|
cs42l43->variant_id = (long)device_get_match_data(cs42l43->dev);
|
|
|
|
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", .data = (void *)CS42L43_DEVID_VAL },
|
|
{ .compatible = "cirrus,cs42l43b", .data = (void *)CS42L43B_DEVID_VAL },
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(of, cs42l43_of_match);
|
|
#endif
|
|
|
|
#if IS_ENABLED(CONFIG_ACPI)
|
|
static const struct acpi_device_id cs42l43_acpi_match[] = {
|
|
{ "CSC4243", CS42L43_DEVID_VAL },
|
|
{ "CSC2A3B", CS42L43B_DEVID_VAL },
|
|
{}
|
|
};
|
|
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");
|