summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/sec-core.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-02-28 11:41:42 +0100
committerLee Jones <lee.jones@linaro.org>2014-03-18 10:49:38 +0000
commit3e5a45f7f16e9f71c0e2ce4f8f5827a8298a8362 (patch)
tree5c938d5788f5bac27c898cbdc45ac415de60e2d9 /drivers/mfd/sec-core.c
parentb07e2b70b9a1ff9f59af66fd0085c1c52178f440 (diff)
downloadop-kernel-dev-3e5a45f7f16e9f71c0e2ce4f8f5827a8298a8362.zip
op-kernel-dev-3e5a45f7f16e9f71c0e2ce4f8f5827a8298a8362.tar.gz
mfd: sec-core: Select different RTC regmaps for devices
This patch prepares for adding support for S2MPS14 RTC driver by selecting different regmaps for S2MPS1X/S5M876X RTC devices. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/sec-core.c')
-rw-r--r--drivers/mfd/sec-core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 306b3a2..9623899 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -199,7 +199,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
- const struct regmap_config *regmap;
+ const struct regmap_config *regmap, *regmap_rtc;
struct sec_pmic_dev *sec_pmic;
int ret;
@@ -233,15 +233,25 @@ static int sec_pmic_probe(struct i2c_client *i2c,
switch (sec_pmic->device_type) {
case S2MPS11X:
regmap = &s2mps11_regmap_config;
+ /*
+ * The rtc-s5m driver does not support S2MPS11 and there
+ * is no mfd_cell for S2MPS11 RTC device.
+ * However we must pass something to devm_regmap_init_i2c()
+ * so use S5M-like regmap config even though it wouldn't work.
+ */
+ regmap_rtc = &sec_rtc_regmap_config;
break;
case S5M8763X:
regmap = &s5m8763_regmap_config;
+ regmap_rtc = &sec_rtc_regmap_config;
break;
case S5M8767X:
regmap = &s5m8767_regmap_config;
+ regmap_rtc = &sec_rtc_regmap_config;
break;
default:
regmap = &sec_regmap_config;
+ regmap_rtc = &sec_rtc_regmap_config;
break;
}
@@ -256,8 +266,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
i2c_set_clientdata(sec_pmic->rtc, sec_pmic);
- sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc,
- &sec_rtc_regmap_config);
+ sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc, regmap_rtc);
if (IS_ERR(sec_pmic->regmap_rtc)) {
ret = PTR_ERR(sec_pmic->regmap_rtc);
dev_err(&i2c->dev, "Failed to allocate RTC register map: %d\n",
OpenPOWER on IntegriCloud