Commit 69be249a authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Alexandre Belloni

rtc: max77686: use rtc regmap to access RTC registers

rtc_regmap should be used to access all RTC registers instead
of parent regmap regardless of what chip or property have it.

This makes the register access uniform and extendible for other
chips.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Tested-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 0b4f8b08
...@@ -370,7 +370,7 @@ static int max77686_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -370,7 +370,7 @@ static int max77686_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
goto out; goto out;
} }
ret = regmap_read(info->max77686->regmap, ret = regmap_read(info->max77686->rtc_regmap,
map[REG_RTC_AE1], &val); map[REG_RTC_AE1], &val);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, dev_err(info->dev,
...@@ -426,7 +426,8 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info *info) ...@@ -426,7 +426,8 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info *info)
goto out; goto out;
} }
ret = regmap_write(info->max77686->regmap, map[REG_RTC_AE1], 0); ret = regmap_write(info->max77686->rtc_regmap,
map[REG_RTC_AE1], 0);
} else { } else {
ret = regmap_bulk_read(info->max77686->rtc_regmap, ret = regmap_bulk_read(info->max77686->rtc_regmap,
map[REG_ALARM1_SEC], data, map[REG_ALARM1_SEC], data,
...@@ -471,7 +472,7 @@ static int max77686_rtc_start_alarm(struct max77686_rtc_info *info) ...@@ -471,7 +472,7 @@ static int max77686_rtc_start_alarm(struct max77686_rtc_info *info)
goto out; goto out;
if (info->drv_data->alarm_enable_reg) { if (info->drv_data->alarm_enable_reg) {
ret = regmap_write(info->max77686->regmap, map[REG_RTC_AE1], ret = regmap_write(info->max77686->rtc_regmap, map[REG_RTC_AE1],
MAX77802_ALARM_ENABLE_VALUE); MAX77802_ALARM_ENABLE_VALUE);
} else { } else {
ret = regmap_bulk_read(info->max77686->rtc_regmap, ret = regmap_bulk_read(info->max77686->rtc_regmap,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment