• Emil Bartczak's avatar
    rtc: mcp795: fix month write resetting date to 1. · 43d0b10f
    Emil Bartczak authored
    According to Microchip errata some combinations of date and month
    values may result in the date being reset to 1, even if the date
    is also written with the month (for example 31-07 or 31-08).
    As a workaround avoid writing date and month values within the same
    Write command. Instead, terminate the Write command after loading
    the date and begin a new command to write the month. In addition,
    disable the oscillator before loading the new values. This is done
    by ensuring both the ST and EXTOSC bits are cleared and waiting for
    the OSCON bit to clear.
    Signed-off-by: default avatarEmil Bartczak <emilbart@gmail.com>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
    43d0b10f
rtc-mcp795.c 6.74 KB