kernel: backport two fixes for MediaTek Ethernet driver
[openwrt/openwrt.git] / target / linux / generic / pending-6.1 / 190-rtc-rs5c372-support_alarms_up_to_1_week.patch
index 13b79b5c098733bd6155c1ad275a53ea7c4fe1d3..2f5c2228c7a4e224ffc18a5c9f77937137a7d0cc 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
 
 --- a/drivers/rtc/rtc-rs5c372.c
 +++ b/drivers/rtc/rtc-rs5c372.c
-@@ -393,7 +393,9 @@ static int rs5c_read_alarm(struct device
+@@ -399,7 +399,9 @@ static int rs5c_read_alarm(struct device
  {
        struct i2c_client       *client = to_i2c_client(dev);
        struct rs5c372          *rs5c = i2c_get_clientdata(client);
@@ -25,7 +25,7 @@ Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
  
        status = rs5c_get_regs(rs5c);
        if (status < 0)
-@@ -403,6 +405,30 @@ static int rs5c_read_alarm(struct device
+@@ -409,6 +411,30 @@ static int rs5c_read_alarm(struct device
        t->time.tm_sec = 0;
        t->time.tm_min = bcd2bin(rs5c->regs[RS5C_REG_ALARM_A_MIN] & 0x7f);
        t->time.tm_hour = rs5c_reg2hr(rs5c, rs5c->regs[RS5C_REG_ALARM_A_HOURS]);
@@ -56,7 +56,7 @@ Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
  
        /* ... and status */
        t->enabled = !!(rs5c->regs[RS5C_REG_CTRL1] & RS5C_CTRL1_AALE);
-@@ -417,12 +443,20 @@ static int rs5c_set_alarm(struct device
+@@ -423,12 +449,20 @@ static int rs5c_set_alarm(struct device
        struct rs5c372          *rs5c = i2c_get_clientdata(client);
        int                     status, addr, i;
        unsigned char           buf[3];
@@ -81,7 +81,7 @@ Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
  
        /* REVISIT: round up tm_sec */
  
-@@ -443,7 +477,9 @@ static int rs5c_set_alarm(struct device
+@@ -449,7 +483,9 @@ static int rs5c_set_alarm(struct device
        /* set alarm */
        buf[0] = bin2bcd(t->time.tm_min);
        buf[1] = rs5c_hr2reg(rs5c, t->time.tm_hour);