summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-05-19 10:51:43 -0400
committerTom Rini <trini@konsulko.com>2020-05-19 10:51:43 -0400
commitc2279d784e35fa25ee3a9fa28a74a1ba545f8c1e (patch)
tree158fd30f3d06142f6a99cbae6ed8ccb0f3be567b /drivers/rtc
parented9a3aa6452f57af65eb74f73bd2a54c3a2f4b03 (diff)
parentcd93d625fd751d55c729c78b10f82109d56a5f1d (diff)
Merge branch '2020-05-18-reduce-size-of-common.h'
Bring in the latest round of Simon's changes to reduce what's in <common.h> overall.
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/davinci.c2
-rw-r--r--drivers/rtc/ds1302.c1
-rw-r--r--drivers/rtc/ds1306.c27
-rw-r--r--drivers/rtc/ds1307.c1
-rw-r--r--drivers/rtc/ds1337.c1
-rw-r--r--drivers/rtc/ds3231.c1
-rw-r--r--drivers/rtc/ds3232.c1
-rw-r--r--drivers/rtc/ftrtc010.c1
-rw-r--r--drivers/rtc/i2c_rtc_emul.c1
-rw-r--r--drivers/rtc/imxdi.c1
-rw-r--r--drivers/rtc/m41t11.c13
-rw-r--r--drivers/rtc/m41t60.c1
-rw-r--r--drivers/rtc/m41t62.c1
-rw-r--r--drivers/rtc/max6900.c1
-rw-r--r--drivers/rtc/mvrtc.c1
-rw-r--r--drivers/rtc/pcf2127.c1
-rw-r--r--drivers/rtc/pcf8563.c1
-rw-r--r--drivers/rtc/pl031.c1
-rw-r--r--drivers/rtc/pt7c4338.c1
-rw-r--r--drivers/rtc/rtc-uclass.c1
-rw-r--r--drivers/rtc/rv3029.c3
-rw-r--r--drivers/rtc/rv8803.c2
-rw-r--r--drivers/rtc/rx8010sj.c1
-rw-r--r--drivers/rtc/s35392a.c1
-rw-r--r--drivers/rtc/stm32_rtc.c1
-rw-r--r--drivers/rtc/x1205.c1
26 files changed, 49 insertions, 19 deletions
diff --git a/drivers/rtc/davinci.c b/drivers/rtc/davinci.c
index b6930bd839..c446e7a735 100644
--- a/drivers/rtc/davinci.c
+++ b/drivers/rtc/davinci.c
@@ -5,9 +5,11 @@
*/
#include <common.h>
#include <command.h>
+#include <log.h>
#include <rtc.h>
#include <asm/io.h>
#include <asm/davinci_rtc.h>
+#include <linux/delay.h>
int rtc_get(struct rtc_time *tmp)
{
diff --git a/drivers/rtc/ds1302.c b/drivers/rtc/ds1302.c
index b94163f748..189607c3e0 100644
--- a/drivers/rtc/ds1302.c
+++ b/drivers/rtc/ds1302.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <command.h>
#include <rtc.h>
+#include <linux/delay.h>
/* GPP Pins */
#define DATA 0x200
diff --git a/drivers/rtc/ds1306.c b/drivers/rtc/ds1306.c
index 02d617e09c..36d615812b 100644
--- a/drivers/rtc/ds1306.c
+++ b/drivers/rtc/ds1306.c
@@ -18,6 +18,7 @@
#include <command.h>
#include <rtc.h>
#include <spi.h>
+#include <linux/delay.h>
#define RTC_SECONDS 0x00
#define RTC_MINUTES 0x01
@@ -71,7 +72,7 @@ int rtc_get (struct rtc_time *tmp)
/* Now we can enable the DS1306 RTC */
immap->im_cpm.cp_pbdat |= PB_SPI_CE;
- udelay (10);
+ udelay(10);
/* Shift out the address (0) of the time in the Clock Chip */
soft_spi_send (0);
@@ -105,7 +106,7 @@ int rtc_get (struct rtc_time *tmp)
/* Now we can disable the DS1306 RTC */
immap->im_cpm.cp_pbdat &= ~PB_SPI_CE; /* Disable DS1306 Chip */
- udelay (10);
+ udelay(10);
rtc_calc_weekday(tmp); /* Determine the day of week */
@@ -127,7 +128,7 @@ int rtc_set (struct rtc_time *tmp)
/* Now we can enable the DS1306 RTC */
immap->im_cpm.cp_pbdat |= PB_SPI_CE; /* Enable DS1306 Chip */
- udelay (10);
+ udelay(10);
/* First disable write protect in the clock chip control register */
soft_spi_send (0x8F); /* send address of the control register */
@@ -135,11 +136,11 @@ int rtc_set (struct rtc_time *tmp)
/* Now disable the DS1306 to terminate the write */
immap->im_cpm.cp_pbdat &= ~PB_SPI_CE;
- udelay (10);
+ udelay(10);
/* Now enable the DS1306 to initiate a new write */
immap->im_cpm.cp_pbdat |= PB_SPI_CE;
- udelay (10);
+ udelay(10);
/* Next, send the address of the clock time write registers */
soft_spi_send (0x80); /* send address of the first time register */
@@ -156,11 +157,11 @@ int rtc_set (struct rtc_time *tmp)
/* Now we can disable the Clock chip to terminate the burst write */
immap->im_cpm.cp_pbdat &= ~PB_SPI_CE; /* Disable DS1306 Chip */
- udelay (10);
+ udelay(10);
/* Now we can enable the Clock chip to initiate a new write */
immap->im_cpm.cp_pbdat |= PB_SPI_CE; /* Enable DS1306 Chip */
- udelay (10);
+ udelay(10);
/* First we Enable write protect in the clock chip control register */
soft_spi_send (0x8F); /* send address of the control register */
@@ -168,7 +169,7 @@ int rtc_set (struct rtc_time *tmp)
/* Now disable the DS1306 */
immap->im_cpm.cp_pbdat &= ~PB_SPI_CE; /* Disable DS1306 Chip */
- udelay (10);
+ udelay(10);
/* Set standard MPC8xx clock to the same time so Linux will
* see the time even if it doesn't have a DS1306 clock driver.
@@ -204,7 +205,7 @@ static void init_spi (void)
immap->im_cpm.cp_pbdir |= (PB_SPIMOSI | PB_SPI_CE | PB_SPISCK);
immap->im_cpm.cp_pbdir &= ~PB_SPIMISO; /* Make MISO pin an input */
- udelay (10);
+ udelay(10);
}
/* ------------------------------------------------------------------------- */
@@ -227,10 +228,10 @@ static void soft_spi_send (unsigned char n)
immap->im_cpm.cp_pbdat |= PB_SPIMOSI; /* Set MOSI to 1 */
else
immap->im_cpm.cp_pbdat &= ~PB_SPIMOSI; /* Set MOSI to 0 */
- udelay (10);
+ udelay(10);
immap->im_cpm.cp_pbdat &= ~PB_SPISCK; /* Lower SCK */
- udelay (10);
+ udelay(10);
bitpos >>= 1; /* Shift for next bit position */
}
@@ -253,11 +254,11 @@ static unsigned char soft_spi_read (void)
/* Read 8 bits here */
for (i = 0; i < 8; i++) { /* Do 8 bits in loop */
immap->im_cpm.cp_pbdat |= PB_SPISCK; /* Raise SCK */
- udelay (10);
+ udelay(10);
if (immap->im_cpm.cp_pbdat & PB_SPIMISO) /* Get a bit of data */
spi_byte |= bitpos; /* Set data accordingly */
immap->im_cpm.cp_pbdat &= ~PB_SPISCK; /* Lower SCK */
- udelay (10);
+ udelay(10);
bitpos >>= 1; /* Shift for next bit position */
}
diff --git a/drivers/rtc/ds1307.c b/drivers/rtc/ds1307.c
index a33f47525f..17344d4d4f 100644
--- a/drivers/rtc/ds1307.c
+++ b/drivers/rtc/ds1307.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/ds1337.c b/drivers/rtc/ds1337.c
index af94bcfdf4..4986c96f86 100644
--- a/drivers/rtc/ds1337.c
+++ b/drivers/rtc/ds1337.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/ds3231.c b/drivers/rtc/ds3231.c
index eb5ce73a76..5b72e86768 100644
--- a/drivers/rtc/ds3231.c
+++ b/drivers/rtc/ds3231.c
@@ -17,6 +17,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/ds3232.c b/drivers/rtc/ds3232.c
index e3b3579c4a..0a30e0eabb 100644
--- a/drivers/rtc/ds3232.c
+++ b/drivers/rtc/ds3232.c
@@ -9,6 +9,7 @@
#include <i2c.h>
#include <rtc.h>
#include <dm/device_compat.h>
+#include <linux/bitops.h>
/*
* RTC register addresses
diff --git a/drivers/rtc/ftrtc010.c b/drivers/rtc/ftrtc010.c
index b68ea223f7..67c2b6e320 100644
--- a/drivers/rtc/ftrtc010.c
+++ b/drivers/rtc/ftrtc010.c
@@ -8,6 +8,7 @@
#include <config.h>
#include <common.h>
+#include <log.h>
#include <rtc.h>
#include <asm/io.h>
diff --git a/drivers/rtc/i2c_rtc_emul.c b/drivers/rtc/i2c_rtc_emul.c
index d4b33e59d6..a010af411b 100644
--- a/drivers/rtc/i2c_rtc_emul.c
+++ b/drivers/rtc/i2c_rtc_emul.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <dm.h>
#include <i2c.h>
+#include <log.h>
#include <os.h>
#include <rtc.h>
#include <asm/rtc.h>
diff --git a/drivers/rtc/imxdi.c b/drivers/rtc/imxdi.c
index 39920f1a7a..e3a1393266 100644
--- a/drivers/rtc/imxdi.c
+++ b/drivers/rtc/imxdi.c
@@ -16,6 +16,7 @@
#include <command.h>
#include <linux/compat.h>
#include <rtc.h>
+#include <linux/delay.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
diff --git a/drivers/rtc/m41t11.c b/drivers/rtc/m41t11.c
index 960348bb3e..706b7188cf 100644
--- a/drivers/rtc/m41t11.c
+++ b/drivers/rtc/m41t11.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
@@ -109,9 +110,9 @@ int rtc_get (struct rtc_time *tmp)
tmp->tm_yday = 0;
tmp->tm_isdst= 0;
- debug ( "Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
- tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+ debug("Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
+ tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
return rel;
}
@@ -120,9 +121,9 @@ int rtc_set (struct rtc_time *tmp)
{
uchar data[RTC_REG_CNT];
- debug ( "Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
- tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+ debug("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
+ tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
data[RTC_SEC_ADDR] = bin2bcd(tmp->tm_sec) & 0x7F;/*just in case*/
data[RTC_MIN_ADDR] = bin2bcd(tmp->tm_min);
diff --git a/drivers/rtc/m41t60.c b/drivers/rtc/m41t60.c
index 532d2105e1..692042b935 100644
--- a/drivers/rtc/m41t60.c
+++ b/drivers/rtc/m41t60.c
@@ -18,6 +18,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c
index f52e1291a9..94a6b523aa 100644
--- a/drivers/rtc/m41t62.c
+++ b/drivers/rtc/m41t62.c
@@ -19,6 +19,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/max6900.c b/drivers/rtc/max6900.c
index b35186579a..11928839dc 100644
--- a/drivers/rtc/max6900.c
+++ b/drivers/rtc/max6900.c
@@ -14,6 +14,7 @@
#include <command.h>
#include <rtc.h>
#include <i2c.h>
+#include <linux/delay.h>
#ifndef CONFIG_SYS_I2C_RTC_ADDR
#define CONFIG_SYS_I2C_RTC_ADDR 0x50
diff --git a/drivers/rtc/mvrtc.c b/drivers/rtc/mvrtc.c
index 94a065379c..6f49505d4e 100644
--- a/drivers/rtc/mvrtc.c
+++ b/drivers/rtc/mvrtc.c
@@ -13,6 +13,7 @@
#include <dm.h>
#include <rtc.h>
#include <asm/io.h>
+#include <linux/delay.h>
#include "mvrtc.h"
/* This RTC does not support century, so we assume 20 */
diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c
index b34ed63bf0..c423960b34 100644
--- a/drivers/rtc/pcf2127.c
+++ b/drivers/rtc/pcf2127.c
@@ -9,6 +9,7 @@
#include <command.h>
#include <dm.h>
#include <i2c.h>
+#include <log.h>
#include <rtc.h>
#define PCF2127_REG_CTRL1 0x00
diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c
index 84f2b231c2..19faefba7c 100644
--- a/drivers/rtc/pcf8563.c
+++ b/drivers/rtc/pcf8563.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/pl031.c b/drivers/rtc/pl031.c
index 8bf04f26a3..1b6717232c 100644
--- a/drivers/rtc/pl031.c
+++ b/drivers/rtc/pl031.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <dm.h>
#include <errno.h>
+#include <log.h>
#include <rtc.h>
#include <asm/io.h>
#include <asm/types.h>
diff --git a/drivers/rtc/pt7c4338.c b/drivers/rtc/pt7c4338.c
index 5211d07586..c987494b66 100644
--- a/drivers/rtc/pt7c4338.c
+++ b/drivers/rtc/pt7c4338.c
@@ -21,6 +21,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/rtc/rtc-uclass.c b/drivers/rtc/rtc-uclass.c
index a0a238aedd..926cca234e 100644
--- a/drivers/rtc/rtc-uclass.c
+++ b/drivers/rtc/rtc-uclass.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <dm.h>
#include <errno.h>
+#include <log.h>
#include <rtc.h>
int dm_rtc_get(struct udevice *dev, struct rtc_time *time)
diff --git a/drivers/rtc/rv3029.c b/drivers/rtc/rv3029.c
index 87c4320d5f..3afe5b2fdd 100644
--- a/drivers/rtc/rv3029.c
+++ b/drivers/rtc/rv3029.c
@@ -12,8 +12,11 @@
#include <dm.h>
#include <eeprom.h>
#include <i2c.h>
+#include <log.h>
#include <rtc.h>
#include <dm/device_compat.h>
+#include <linux/bitops.h>
+#include <linux/delay.h>
#define RTC_RV3029_PAGE_LEN 7
diff --git a/drivers/rtc/rv8803.c b/drivers/rtc/rv8803.c
index 2ab40f0833..acd50c6564 100644
--- a/drivers/rtc/rv8803.c
+++ b/drivers/rtc/rv8803.c
@@ -13,8 +13,10 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
+#include <linux/bitops.h>
/*
* RTC register addresses
diff --git a/drivers/rtc/rx8010sj.c b/drivers/rtc/rx8010sj.c
index 82c5185e2e..d513561b82 100644
--- a/drivers/rtc/rx8010sj.c
+++ b/drivers/rtc/rx8010sj.c
@@ -21,6 +21,7 @@
#include <dm.h>
#include <i2c.h>
#include <rtc.h>
+#include <linux/bitops.h>
/*---------------------------------------------------------------------*/
/* #undef DEBUG_RTC */
diff --git a/drivers/rtc/s35392a.c b/drivers/rtc/s35392a.c
index 3bfe481403..80f55c8623 100644
--- a/drivers/rtc/s35392a.c
+++ b/drivers/rtc/s35392a.c
@@ -23,6 +23,7 @@
#include <i2c.h>
#include <linux/bitrev.h>
#include <rtc.h>
+#include <linux/delay.h>
#define S35390A_CHIP_ADDR 0x30
diff --git a/drivers/rtc/stm32_rtc.c b/drivers/rtc/stm32_rtc.c
index 3e12f57ce0..f9db318af1 100644
--- a/drivers/rtc/stm32_rtc.c
+++ b/drivers/rtc/stm32_rtc.c
@@ -9,6 +9,7 @@
#include <rtc.h>
#include <asm/io.h>
#include <dm/device_compat.h>
+#include <linux/bitops.h>
#include <linux/iopoll.h>
#define STM32_RTC_TR 0x00
diff --git a/drivers/rtc/x1205.c b/drivers/rtc/x1205.c
index ed6aaa5237..ce23427b17 100644
--- a/drivers/rtc/x1205.c
+++ b/drivers/rtc/x1205.c
@@ -19,6 +19,7 @@
#include <common.h>
#include <command.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>