Merge tag 'rpi-next-2019.10' of https://github.com/mbgg/u-boot
[oweals/u-boot.git] / drivers / rtc / ds1302.c
index d28a9fd724cae6362ef8518655345046356971b8..b94163f7486baa1a4c0b01364f915fd6290c5283 100644 (file)
@@ -9,8 +9,6 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_CMD_DATE)
-
 /* GPP Pins */
 #define DATA           0x200
 #define SCLK           0x400
@@ -287,8 +285,7 @@ rtc_get(struct rtc_time *tmp)
        return rel;
 }
 
-void
-rtc_set(struct rtc_time *tmp)
+int rtc_set(struct rtc_time *tmp)
 {
        struct ds1302_st bbclk;
        unsigned char b=0;
@@ -326,6 +323,6 @@ rtc_set(struct rtc_time *tmp)
 
        write_ser_drv(0x8e,&b,1);           /* disable write protect */
        write_ser_drv(0xbe,(unsigned char *)&bbclk, 8);     /* write burst */
-}
 
-#endif
+       return 0;
+}