rtc: pcf85063: Fix reading alarm
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Wed, 21 Sep 2022 07:41:41 +0000 (09:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:49 +0000 (13:32 +0100)
commit51a7fbc5984522fd179b3590011d4846cd481642
tree893860c24e23b1671ffbfc30dfd900c229fe7275
parent6d4dacd4a91a365999c5cf57a996b96a306602c8
rtc: pcf85063: Fix reading alarm

[ Upstream commit a6ceee26fd5ed9b5bd37322b1ca88e4548cee4a3 ]

If the alarms are disabled the topmost bit (AEN_*) is set in the alarm
registers. This is also interpreted in BCD number leading to this warning:
rtc rtc0: invalid alarm value: 2022-09-21T80:80:80

Fix this by masking alarm enabling and reserved bits.

Fixes: 05cb3a56ee8c ("rtc: pcf85063: add alarm support")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20220921074141.3903104-1-alexander.stein@ew.tq-group.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-pcf85063.c