mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 23:02:27 +07:00
8de262531f
- Set 'struct device' fwnode when registering a new device - New Drivers - Add support for ROHM BD70528 PMIC - New Device Support - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC - Add support for RK809 and RK817 to Rockchip RK808 - Add support for Lid Angle to ChromeOS core - Add support for CS47L15 CODEC to Madera core - Add support for CS47L92 CODEC to Madera core - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core - Add support for Add Intel Elkhart Lake PCH to Intel LPSS - New Functionality - Provide regulator supply information when registering; madera-core - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic - Allow over-riding power button press via Device Tree; rohm-bd718x7 - Differentiate between running processors; cros_ec_dev - Fix-ups - Big header file update; cros_ec_commands.h - Split header per-subsystem; rohm-bd718x7 - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables - Trivial; sorting, coding style; intel-lpss-pci - Only remove Power Off functionality if set locally; rk808 - Make use for Power Off Prepare(); rk808 - Fix spelling mistake in header guards; stmfx - Properly free IDA resources - SPDX fixups; cs47lXX-tables, madera - Error path fixups; hi655x-pmic - Bug Fixes - Add missing break in case() statement - Repair undefined behaviour when not initialising variables; arizona-core, madera-core - Fix reference to Device Tree documentation; madera -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl0sLxgACgkQUa+KL4f8 d2E25Q/9HmDJIdfyDQg0xv5IM5HS1WsP9BcJCEgoRIsad4mMDRYt+ZeLbslwMhue E9tsFH359gGvyqR+7d6hPpEUET1UEcJy4eRD1zAc0+epllQTDHSy8oHt1dtH+8xB 2AU5rvAKOqBk83D+V2Hkx2KcroWEQQNYIoR9/12Pi3xmEB1uaCO0/Ajd3B28bIBM Tzi3cVQ3U7jY9EIM44GVTsjDAbMSkQR0iab6cQF0vJAWaUmGKlsO7iRrU1XkN69V qXyBauI8WGiGssihrE8r+jYvHvmg7hA9OKZIckUaMXD/k7kpHbwIaFRh7gukq4Re Q6Cy30NfVJ1tY66/5oqN6gj5znfeuEudMCCzYAkzlROSp5eApe2Ke5ajYn3kOCZd ZKcsrw9Fiox1lKmuWXDbyf0nqf4zwdDPAnShRWaaF5aipwgywyGcwSigVtK4F0P5 Hjc5RLv7GjTAJq+ZzwgKyAdtx8L0mhdLd1ZTQpEXk/g/E9dW4GF72hWj9TQ/9BnA ZflKv8aP3lDGRHgO3Huwi4lMzskB8BVCQMCFwLwGs5cY1oZQhAjTdJzBZjTGexhC evuuA8OUsCrOWMvnZf3saSdHJ1iMHtfPnqEGHRJQtNj4fFaXv80LasIomvvfJc1/ 9JlRyAgm2pF7YDrgTh65ZzBb324eKSZZoAj9XZbnTyzxUAcF69A= =A3jw -----END PGP SIGNATURE----- Merge tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Set 'struct device' fwnode when registering a new device New Drivers: - Add support for ROHM BD70528 PMIC New Device Support: - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC - Add support for RK809 and RK817 to Rockchip RK808 - Add support for Lid Angle to ChromeOS core - Add support for CS47L15 CODEC to Madera core - Add support for CS47L92 CODEC to Madera core - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core - Add support for Add Intel Elkhart Lake PCH to Intel LPSS New Functionality: - Provide regulator supply information when registering; madera-core - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic - Allow over-riding power button press via Device Tree; rohm-bd718x7 - Differentiate between running processors; cros_ec_dev Fix-ups: - Big header file update; cros_ec_commands.h - Split header per-subsystem; rohm-bd718x7 - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables - Trivial; sorting, coding style; intel-lpss-pci - Only remove Power Off functionality if set locally; rk808 - Make use for Power Off Prepare(); rk808 - Fix spelling mistake in header guards; stmfx - Properly free IDA resources - SPDX fixups; cs47lXX-tables, madera - Error path fixups; hi655x-pmic Bug Fixes: - Add missing break in case() statement - Repair undefined behaviour when not initialising variables; arizona-core, madera-core - Fix reference to Device Tree documentation; madera" * tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits) mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk mfd: madera: Fixup SPDX headers mfd: madera: Remove some unused registers and fix some defaults mfd: intel-lpss: Release IDA resources mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs mfd: cs5535-mfd: Remove ifdef OLPC noise mfd: stmfx: Fix macro definition spelling dt-bindings: mfd: Add link to ROHM BD71847 Datasheet MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice mfd: rk808: Prepare rk805 for poweroff mfd: rk808: Check pm_power_off pointer mfd: cros_ec: differentiate SCP from EC by feature bit dt-bindings: Add binding for cros-ec-rpmsg mfd: madera: Add Madera core support for CS47L92 mfd: madera: Add Madera core support for CS47L15 mfd: madera: Update DT bindings to add additional CODECs mfd: madera: Add supply mapping for MICVDD mfd: madera: Fix potential uninitialised use of variable mfd: madera: Fix bad reference to pinctrl.txt file ...
101 lines
2.4 KiB
C
101 lines
2.4 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
|
|
*
|
|
* Author: Keerthy <j-keerthy@ti.com>
|
|
*/
|
|
|
|
#include <linux/interrupt.h>
|
|
#include <linux/mfd/core.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of_device.h>
|
|
#include <linux/regmap.h>
|
|
|
|
#include <linux/mfd/lp87565.h>
|
|
|
|
static const struct regmap_config lp87565_regmap_config = {
|
|
.reg_bits = 8,
|
|
.val_bits = 8,
|
|
.max_register = LP87565_REG_MAX,
|
|
};
|
|
|
|
static const struct mfd_cell lp87565_cells[] = {
|
|
{ .name = "lp87565-q1-regulator", },
|
|
{ .name = "lp87565-q1-gpio", },
|
|
};
|
|
|
|
static const struct of_device_id of_lp87565_match_table[] = {
|
|
{ .compatible = "ti,lp87565", },
|
|
{
|
|
.compatible = "ti,lp87565-q1",
|
|
.data = (void *)LP87565_DEVICE_TYPE_LP87565_Q1,
|
|
},
|
|
{
|
|
.compatible = "ti,lp87561-q1",
|
|
.data = (void *)LP87565_DEVICE_TYPE_LP87561_Q1,
|
|
},
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(of, of_lp87565_match_table);
|
|
|
|
static int lp87565_probe(struct i2c_client *client,
|
|
const struct i2c_device_id *ids)
|
|
{
|
|
struct lp87565 *lp87565;
|
|
const struct of_device_id *of_id;
|
|
int ret;
|
|
unsigned int otpid;
|
|
|
|
lp87565 = devm_kzalloc(&client->dev, sizeof(*lp87565), GFP_KERNEL);
|
|
if (!lp87565)
|
|
return -ENOMEM;
|
|
|
|
lp87565->dev = &client->dev;
|
|
|
|
lp87565->regmap = devm_regmap_init_i2c(client, &lp87565_regmap_config);
|
|
if (IS_ERR(lp87565->regmap)) {
|
|
ret = PTR_ERR(lp87565->regmap);
|
|
dev_err(lp87565->dev,
|
|
"Failed to initialize register map: %d\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
ret = regmap_read(lp87565->regmap, LP87565_REG_OTP_REV, &otpid);
|
|
if (ret) {
|
|
dev_err(lp87565->dev, "Failed to read OTP ID\n");
|
|
return ret;
|
|
}
|
|
|
|
lp87565->rev = otpid & LP87565_OTP_REV_OTP_ID;
|
|
|
|
of_id = of_match_device(of_lp87565_match_table, &client->dev);
|
|
if (of_id)
|
|
lp87565->dev_type = (enum lp87565_device_type)of_id->data;
|
|
|
|
i2c_set_clientdata(client, lp87565);
|
|
|
|
return devm_mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO,
|
|
lp87565_cells, ARRAY_SIZE(lp87565_cells),
|
|
NULL, 0, NULL);
|
|
}
|
|
|
|
static const struct i2c_device_id lp87565_id_table[] = {
|
|
{ "lp87565-q1", 0 },
|
|
{ },
|
|
};
|
|
MODULE_DEVICE_TABLE(i2c, lp87565_id_table);
|
|
|
|
static struct i2c_driver lp87565_driver = {
|
|
.driver = {
|
|
.name = "lp87565",
|
|
.of_match_table = of_lp87565_match_table,
|
|
},
|
|
.probe = lp87565_probe,
|
|
.id_table = lp87565_id_table,
|
|
};
|
|
module_i2c_driver(lp87565_driver);
|
|
|
|
MODULE_AUTHOR("J Keerthy <j-keerthy@ti.com>");
|
|
MODULE_DESCRIPTION("lp87565 chip family Multi-Function Device driver");
|
|
MODULE_LICENSE("GPL v2");
|