rtc: ds1347: fix value written to century register
authorIan Abbott <abbotti@mev.co.uk>
Thu, 27 Oct 2022 16:32:49 +0000 (17:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:58:56 +0000 (11:58 +0100)
commit8e91679f7bd2fb05089040b1a2727518aea4c1a9
treed1060b8ad84fc4f2e4aeda0d55893eb861f4bd4e
parent5eb8296d73da5319e908591560498ad377f4573f
rtc: ds1347: fix value written to century register

commit 4dfe05bdc1ade79b943d4979a2e2a8b5ef68fbb5 upstream.

In `ds1347_set_time()`, the wrong value is being written to the
`DS1347_CENTURY_REG` register.  It needs to be converted to BCD.  Fix
it.

Fixes: 147dae76dbb9 ("rtc: ds1347: handle century register")
Cc: <stable@vger.kernel.org> # v5.5+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20221027163249.447416-1-abbotti@mev.co.uk
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-ds1347.c