Skip to contentSkip to conversation

DS1307 RTC update

PATCH Superseded Chris Packham 3 participants 5 messages Apr 21, 2017 – Apr 25, 2017 Real time clock (RTC)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover DS1307 RTC update

The first patch is the addition of a KConfig option for the date command. I haven't updated any boards to use the new option due to the sheer number of boards that would affect. It's probably better if board maintainers switch if/when they're ready.

The second patch is the change I really want to see. As it allows me to switch a board I'm working on over to the driver model. I've tried to replicate the non-DM version of the driver faithfully but I've only got access to a ds1340 device so I can't be sure that the mcp7941x specific code is correct.

Chris Packham (2):
cmd: add Kconfig option for 'date' command
rtc: Add DM support to ds1307

 cmd/Kconfig          |   6 ++
 drivers/rtc/Kconfig  |   7 ++
 drivers/rtc/ds1307.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 190 insertions(+), 19 deletions(-)
Signature · 1 line
2.10.1
#1 lore raw

PATCH 1/2 cmd: add Kconfig option for 'date' command

---

 cmd/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
cmd/Kconfig +6 -0
index 13dc46a..1aaf8c5 100644
@@ -676,6 +676,12 @@ config CMD_LED
 	  with led on/off/togle/blink. Any LED drivers can be controlled with
 	  this command, e.g. led_gpio.
 
+config CMD_DATE
+	bool "date"
+	help
+	  Enable the 'date' command for getting/setting the time/date in RTC
+	  devices.
+
 config CMD_TIME
 	bool "time"
 	help
Signature · 1 line
2.10.1
#2 lore raw

PATCH 2/2 rtc: Add DM support to ds1307

In reply to Chris Packham

Add an implementation of the ds1307 driver that uses the driver model i2c APIs.

---

 drivers/rtc/Kconfig  |   7 ++
 drivers/rtc/ds1307.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 184 insertions(+), 19 deletions(-)
drivers/rtc/Kconfig +7 -0
index cb79a01..d06130c7 100644
@@ -23,4 +23,11 @@ config RTC_PCF2127
 	  has a selectable I2C-bus or SPI-bus, a backup battery switch-over circuit, a
 	  programmable watchdog function, a timestamp function, and many other features.
 
+config RTC_DS1307
+	bool "Enable DS1307 driver"
+	depends on DM_RTC
+	help
+	  Support for Dallas Semiconductor (now Maxim) DS1307 and DS1338/9 and
+	  compatible Real Time Clock devices.
+
 endmenu
drivers/rtc/ds1307.c +177 -19

216 lines not on this page · raw message

Signature · 1 line
2.10.1
#3 lore raw

cover DS1307 RTC update

In reply to Chris Packham

+Tom

Hi Chris,

Quoted 5 lines · Chris Packham

The first patch is the addition of a KConfig option for the date command. I haven't updated any boards to use the new option due to the sheer number of boards that would affect. It's probably better if board maintainers switch if/when they're ready.

You should be able to use moveconfig.py to do this automatically.

I'm not sure of the best method here.

Tom, do you expect people to run the tool or are you doing this yourself before you apply it?

Quoted 11 lines

The second patch is the change I really want to see. As it allows me to switch a board I'm working on over to the driver model. I've tried to replicate the non-DM version of the driver faithfully but I've only got access to a ds1340 device so I can't be sure that the mcp7941x specific code is correct.

Chris Packham (2):
cmd: add Kconfig option for 'date' command
rtc: Add DM support to ds1307

Quoted 8 lines
 cmd/Kconfig          |   6 ++
 drivers/rtc/Kconfig  |   7 ++
 drivers/rtc/ds1307.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 190 insertions(+), 19 deletions(-)

--
2.10.1

Regards,
Simon

#4 lore raw

cover DS1307 RTC update

Quoted 11 lines · Simon Glass

+Tom

Hi Chris,

Quoted 5 lines · Chris Packham

The first patch is the addition of a KConfig option for the date command. I haven't updated any boards to use the new option due to the sheer number of boards that would affect. It's probably better if board maintainers switch if/when they're ready.

Quoted 6 lines

You should be able to use moveconfig.py to do this automatically.

I'm not sure of the best method here.

Tom, do you expect people to run the tool or are you doing this yourself before you apply it?

It depends greatly on the complexity. I appreciate it when people do it and this is probably an easy one to move. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170425/ee88d974/attachment.sig>