aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/sec-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/sec-core.c')
-rw-r--r--drivers/mfd/sec-core.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 34c18fb8c089..54cc25546592 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -81,31 +81,31 @@ static struct of_device_id sec_dt_match[] = {
81 81
82int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest) 82int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
83{ 83{
84 return regmap_read(sec_pmic->regmap, reg, dest); 84 return regmap_read(sec_pmic->regmap_pmic, reg, dest);
85} 85}
86EXPORT_SYMBOL_GPL(sec_reg_read); 86EXPORT_SYMBOL_GPL(sec_reg_read);
87 87
88int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf) 88int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
89{ 89{
90 return regmap_bulk_read(sec_pmic->regmap, reg, buf, count); 90 return regmap_bulk_read(sec_pmic->regmap_pmic, reg, buf, count);
91} 91}
92EXPORT_SYMBOL_GPL(sec_bulk_read); 92EXPORT_SYMBOL_GPL(sec_bulk_read);
93 93
94int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value) 94int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
95{ 95{
96 return regmap_write(sec_pmic->regmap, reg, value); 96 return regmap_write(sec_pmic->regmap_pmic, reg, value);
97} 97}
98EXPORT_SYMBOL_GPL(sec_reg_write); 98EXPORT_SYMBOL_GPL(sec_reg_write);
99 99
100int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf) 100int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
101{ 101{
102 return regmap_raw_write(sec_pmic->regmap, reg, buf, count); 102 return regmap_raw_write(sec_pmic->regmap_pmic, reg, buf, count);
103} 103}
104EXPORT_SYMBOL_GPL(sec_bulk_write); 104EXPORT_SYMBOL_GPL(sec_bulk_write);
105 105
106int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask) 106int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
107{ 107{
108 return regmap_update_bits(sec_pmic->regmap, reg, mask, val); 108 return regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, val);
109} 109}
110EXPORT_SYMBOL_GPL(sec_reg_update); 110EXPORT_SYMBOL_GPL(sec_reg_update);
111 111
@@ -166,6 +166,11 @@ static struct regmap_config s5m8767_regmap_config = {
166 .cache_type = REGCACHE_FLAT, 166 .cache_type = REGCACHE_FLAT,
167}; 167};
168 168
169static const struct regmap_config sec_rtc_regmap_config = {
170 .reg_bits = 8,
171 .val_bits = 8,
172};
173
169#ifdef CONFIG_OF 174#ifdef CONFIG_OF
170/* 175/*
171 * Only the common platform data elements for s5m8767 are parsed here from the 176 * Only the common platform data elements for s5m8767 are parsed here from the
@@ -266,9 +271,9 @@ static int sec_pmic_probe(struct i2c_client *i2c,
266 break; 271 break;
267 } 272 }
268 273
269 sec_pmic->regmap = devm_regmap_init_i2c(i2c, regmap); 274 sec_pmic->regmap_pmic = devm_regmap_init_i2c(i2c, regmap);
270 if (IS_ERR(sec_pmic->regmap)) { 275 if (IS_ERR(sec_pmic->regmap_pmic)) {
271 ret = PTR_ERR(sec_pmic->regmap); 276 ret = PTR_ERR(sec_pmic->regmap_pmic);
272 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 277 dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
273 ret); 278 ret);
274 return ret; 279 return ret;
@@ -277,6 +282,15 @@ static int sec_pmic_probe(struct i2c_client *i2c,
277 sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); 282 sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
278 i2c_set_clientdata(sec_pmic->rtc, sec_pmic); 283 i2c_set_clientdata(sec_pmic->rtc, sec_pmic);
279 284
285 sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc,
286 &sec_rtc_regmap_config);
287 if (IS_ERR(sec_pmic->regmap_rtc)) {
288 ret = PTR_ERR(sec_pmic->regmap_rtc);
289 dev_err(&i2c->dev, "Failed to allocate RTC register map: %d\n",
290 ret);
291 return ret;
292 }
293
280 if (pdata && pdata->cfg_pmic_irq) 294 if (pdata && pdata->cfg_pmic_irq)
281 pdata->cfg_pmic_irq(); 295 pdata->cfg_pmic_irq();
282 296