Skip to content

Commit 6fc5d41

Browse files
alexelderlag-linaro
authored andcommitted
mfd: simple-mfd-i2c: Add SpacemiT P1 support
Enable support for the RTC and regulators found in the SpacemiT P1 PMIC. Support is implemented by the simple I2C MFD driver. The P1 PMIC is normally implemented with the SpacemiT K1 SoC. This PMIC provides 6 buck converters and 12 LDO regulators. It also implements a switch, watchdog timer, real-time clock, and more. Initially its RTC and regulators are supported. Signed-off-by: Alex Elder <elder@riscstar.com> Link: https://lore.kernel.org/r/20250825172057.163883-3-elder@riscstar.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 8566de1 commit 6fc5d41

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

drivers/mfd/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,19 @@ config MFD_QCOM_RPM
12541254
Say M here if you want to include support for the Qualcomm RPM as a
12551255
module. This will build a module called "qcom_rpm".
12561256

1257+
config MFD_SPACEMIT_P1
1258+
tristate "SpacemiT P1 PMIC"
1259+
depends on ARCH_SPACEMIT || COMPILE_TEST
1260+
depends on I2C
1261+
select I2C_K1
1262+
select MFD_SIMPLE_MFD_I2C
1263+
help
1264+
This option supports the I2C-based SpacemiT P1 PMIC, which
1265+
contains regulators, a power switch, GPIOs, an RTC, and more.
1266+
This option is selected when any of the supported sub-devices
1267+
is configured. The basic functionality is implemented by the
1268+
simple MFD I2C driver.
1269+
12571270
config MFD_SPMI_PMIC
12581271
tristate "Qualcomm SPMI PMICs"
12591272
depends on ARCH_QCOM || COMPILE_TEST

drivers/mfd/simple-mfd-i2c.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ static const struct simple_mfd_data maxim_mon_max77705 = {
9393
.mfd_cell_size = ARRAY_SIZE(max77705_sensor_cells),
9494
};
9595

96+
static const struct regmap_config spacemit_p1_regmap_config = {
97+
.reg_bits = 8,
98+
.val_bits = 8,
99+
};
100+
101+
static const struct mfd_cell spacemit_p1_cells[] = {
102+
{ .name = "spacemit-p1-regulator", },
103+
{ .name = "spacemit-p1-rtc", },
104+
};
105+
106+
static const struct simple_mfd_data spacemit_p1 = {
107+
.regmap_config = &spacemit_p1_regmap_config,
108+
.mfd_cell = spacemit_p1_cells,
109+
.mfd_cell_size = ARRAY_SIZE(spacemit_p1_cells),
110+
};
111+
96112
static const struct of_device_id simple_mfd_i2c_of_match[] = {
97113
{ .compatible = "kontron,sl28cpld" },
98114
{ .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
@@ -101,6 +117,7 @@ static const struct of_device_id simple_mfd_i2c_of_match[] = {
101117
{ .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705},
102118
{ .compatible = "fsl,lx2160aqds-fpga" },
103119
{ .compatible = "fsl,ls1028aqds-fpga" },
120+
{ .compatible = "spacemit,p1", .data = &spacemit_p1, },
104121
{}
105122
};
106123
MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);

0 commit comments

Comments
 (0)