Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion of control 2 register contents #757

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions drivers/rtc/rtc-ab-b5ze-s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,38 @@ static int abb5zes3_rtc_check_setup(struct device *dev)
* individually by clearing/setting MSB of each associated register. So,
* we set all alarm enable bits to disable current alarm setting.
*/
mask = (ABB5ZES3_REG_ALRM_MN_AE | ABB5ZES3_REG_ALRM_HR_AE |
ABB5ZES3_REG_ALRM_DT_AE | ABB5ZES3_REG_ALRM_DW_AE);
ret = regmap_update_bits(regmap, ABB5ZES3_REG_CTRL2, mask, mask);
mask = (ABB5ZES3_REG_ALRM_MN_AE);
ret = regmap_update_bits(regmap, ABB5ZES3_REG_ALRM_MN, mask, mask);
if (ret < 0) {
dev_err(dev, "%s: unable to disable alarm setting (%d)\n",
dev_err(dev, "%s: unable to disable minute alarm setting (%d)\n",
__func__, ret);
return ret;
}

mask = (ABB5ZES3_REG_ALRM_HR_AE);
ret = regmap_update_bits(regmap, ABB5ZES3_REG_ALRM_HR, mask, mask);
if (ret < 0) {
dev_err(dev, "%s: unable to disable hour alarm setting (%d)\n",
__func__, ret);
return ret;
}

mask = (ABB5ZES3_REG_ALRM_DT_AE);
ret = regmap_update_bits(regmap, ABB5ZES3_REG_ALRM_DT, mask, mask);
if (ret < 0) {
dev_err(dev, "%s: unable to disable day alarm setting (%d)\n",
__func__, ret);
return ret;
}

mask = (ABB5ZES3_REG_ALRM_DW_AE);
ret = regmap_update_bits(regmap, ABB5ZES3_REG_ALRM_DW, mask, mask);
if (ret < 0) {
dev_err(dev, "%s: unable to disable weekday alarm setting (%d)\n",
__func__, ret);
return ret;
}

/* Set Control 1 register (RTC enabled, 24hr mode, all int. disabled) */
mask = (ABB5ZES3_REG_CTRL1_CIE | ABB5ZES3_REG_CTRL1_AIE |
ABB5ZES3_REG_CTRL1_SIE | ABB5ZES3_REG_CTRL1_PM |
Expand Down