regualtor: Add samsung s2mps11 regulator driver
Subsystems (3)
PATCH 6/7 regualtor: Add samsung s2mps11 regulator driver
This patch add Samsung S2MPS11 regulator driver. The S2MPS11 can support 10 Bucks and 38 LDOs and RTC. Especially, S2MPS11 is designed for high performance Samsung application processor.
Signed-off-by Sangbeom Kim <[email protected]>
--- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/s2mps11.c | 767 +++++++++++++++++++++++++++++++++++ drivers/regulator/s5m8767.c | 6 - include/linux/mfd/samsung/core.h | 15 + include/linux/mfd/samsung/s2mps11.h | 179 ++++++++ 6 files changed, 970 insertions(+), 6 deletions(-) create mode 100644 drivers/regulator/s2mps11.c create mode 100644 include/linux/mfd/samsung/s2mps11.h
drivers/regulator/Kconfig +8 -0
@@ -241,6 +241,14 @@ config REGULATOR_RC5T583 through regulator interface. The device supports multiple DCDC/LDO outputs which can be controlled by i2c communication. +config REGULATOR_S2MPS11 + tristate "Samsung S2MPS11 voltage regulator" + depends on MFD_SEC_CORE + help + This driver supports a Samsung S2MPS11 voltage output regulator + via I2C bus. S2MPS11 is comprised of high efficient Buck converters + including Dual-Phase Buck converter, Buck-Boost converter, various LDOs. + config REGULATOR_S5M8767 tristate "Samsung S5M8767A voltage regulator" depends on MFD_SEC_CORE
drivers/regulator/Makefile +1 -0
@@ -38,6 +38,7 @@ obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o +obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
drivers/regulator/s2mps11.c new file +767 -0
767 lines not on this page · raw message
drivers/regulator/s5m8767.c +0 -6
@@ -45,12 +45,6 @@ struct s5m8767_info {int buck_gpioindex; }; -struct sec_voltage_desc { -int max; -int min; -int step; -}; -static const struct sec_voltage_desc buck_voltage_val1 = { .max =2225000 , .min =650000 ,
include/linux/mfd/samsung/core.h +15 -0
@@ -20,6 +20,7 @@ enum sec_device_type {S5M8751X ,S5M8763X ,S5M8767X , + S2MPS11X, };/**
@@ -98,9 +99,17 @@ struct sec_pmic_platform_data {int buck4_default_idx;int buck_ramp_delay; + +int buck2_ramp_delay; +int buck34_ramp_delay; +int buck5_ramp_delay; +int buck16_ramp_delay; +int buck7810_ramp_delay; +int buck9_ramp_delay;bool buck2_ramp_enable;bool buck3_ramp_enable;bool buck4_ramp_enable; +bool buck6_ramp_enable;int buck2_init;int buck3_init;
@@ -144,4 +153,10 @@ enum sec_opmode { SEC_OPMODE_SUSPEND, }; +struct sec_voltage_desc { +int max; +int min; +int step; +}; +#endif /* __LINUX_MFD_SEC_CORE_H */
include/linux/mfd/samsung/s2mps11.h new file +179 -0
179 lines not on this page · raw message
Signature · 1 line
1.7.1
drivers/regulator/s2mps11.c line 129
Quoted 3 lines · Sangbeom Kim
drivers/regulator/s2mps11.c new file +3
-0+static int s2mps11_list_voltage (struct regulator_dev *rdev, +unsigned int selector) +{
Please take a look at the new helper functions which have been added to the regulator core for factoring out things like table based and linear maps. This and quite a bit of the rest of the code can probably be converted to use those.
drivers/regulator/s2mps11.c line 269
Quoted 9 lines
drivers/regulator/s2mps11.c new file +9
-0+case S2MPS11_AP_EN32KHZ : + mask =0x01 ; +break ; +case S2MPS11_CP_EN32KHZ : + mask =0x02 ; +break ; +case S2MPS11_BT_EN32KHZ : + mask =0x04 ; +break ;
Use the clk API for clocks.