All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] new rtc methods, rtc command, and tests
@ 2020-07-06 20:01 Rasmus Villemoes
  2020-07-06 20:01 ` [PATCH v4 01/11] rtc: add dm_rtc_read helper and ->read method Rasmus Villemoes
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Rasmus Villemoes @ 2020-07-06 20:01 UTC (permalink / raw)
  To: u-boot

I need access to registers other than just the timekeeping ones of the
pcf2127, so I wanted to implement ->read8 and ->write8. But for
testing these it appeared there was no convenient way to invoke those
from the shell, so I also ended up adding such a command.

Also, it seemed more natural to provide array variants that can read
or write several registers at once, so rtc_ops is expanded a bit.

Changes in v4:

- Add CONFIG_CMD_RTC to sandbox defconfigs (new patch 10/11). Not
  quite sure exactly which it needed to be added to, but at least
  sandbox and sandbox_flattree showed CI failures.

- Add Heiko's R-B to the 10 v3 patches (1-9 + 11), and Simon's R-B to 6/11.

- Fix some checkpatch warnings - I don't really agree with most of
  them - e.g. having to add an empty line in

  int foo = something();
  if (foo < 0)
    return foo;
  return something_else(foo);

  doesn't make the code more readable IMO.

  The remaining checkpatch blurps are things I really don't think
  warrant "fixing", e.g. "WARNING: ENOSYS means 'invalid syscall nr'
  and nothing else" seems irrelevant in context of U-Boot, and in any
  case I've only copied existing practice. For "WARNING: please write
  a paragraph that describes the config symbol fully", that seems to
  be a false positive, there's certainly a full help text for CMD_RTC.

Changes in v3:

- Call the functions dm_rtc_read/dm_rtc_write rather than just
  rtc_read/rtc_write, since the latter names are used for local
  helpers by a number of drivers. That also matches the existing
  dm_rtc_set/dm_rtc_get (though then not the existing
  rtc_read{8,16,32}).

- Update the rtc command (patch 6) as per Simon's feedback (parse
  input as hex, avoid overlong lines, use print_buffer()).
  
- Update the tests (patches 9 and 10) according to these changes.

Changes in v2:

- Use simply "read" and "write" instead of "read8_array",
  "write8_array", both for functions and methods, as suggested by
  Simon.

- The rtc command's interface has been simplified a bit (no separate
  read/readm; the number of arguments determines whether the user
  wants the result on the console or to a memory address)

- Add tests, both of rtc_{read,write}() and of the shell command,
  fixing a few things I stumbled on.

Rasmus Villemoes (11):
  rtc: add dm_rtc_read helper and ->read method
  rtc: add dm_rtc_write() helper
  rtc: fall back to ->{read,write} if ->{read,write}8 are not provided
  rtc: pcf2127: provide ->read method
  rtc: pcf2127: provide ->write method
  rtc: add rtc command
  rtc: sandbox-rtc: fix set method
  rtc: i2c_rtc_emul: catch any write to the "reset" register
  test: dm: rtc: add test of dm_rtc_read, dm_rtc_write
  sandbox: add rtc command to defconfigs
  test: dm: rtc: add tests of rtc shell command

 arch/sandbox/include/asm/rtc.h     |   5 +
 cmd/Kconfig                        |   6 ++
 cmd/Makefile                       |   1 +
 cmd/rtc.c                          | 167 +++++++++++++++++++++++++++++
 configs/sandbox64_defconfig        |   1 +
 configs/sandbox_defconfig          |   1 +
 configs/sandbox_flattree_defconfig |   1 +
 drivers/rtc/i2c_rtc_emul.c         |   3 +-
 drivers/rtc/pcf2127.c              |  13 ++-
 drivers/rtc/rtc-uclass.c           |  59 +++++++++-
 drivers/rtc/sandbox_rtc.c          |  65 +++++------
 include/rtc.h                      |  47 ++++++++
 test/dm/rtc.c                      | 118 +++++++++++++++++++-
 13 files changed, 437 insertions(+), 50 deletions(-)
 create mode 100644 cmd/rtc.c

-- 
2.23.0

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-07-09  8:39 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 20:01 [PATCH v4 00/11] new rtc methods, rtc command, and tests Rasmus Villemoes
2020-07-06 20:01 ` [PATCH v4 01/11] rtc: add dm_rtc_read helper and ->read method Rasmus Villemoes
2020-07-09  8:35   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 02/11] rtc: add dm_rtc_write() helper Rasmus Villemoes
2020-07-09  8:36   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 03/11] rtc: fall back to ->{read, write} if ->{read, write}8 are not provided Rasmus Villemoes
2020-07-09  8:36   ` [PATCH v4 03/11] rtc: fall back to ->{read,write} if ->{read,write}8 " Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 04/11] rtc: pcf2127: provide ->read method Rasmus Villemoes
2020-07-09  8:36   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 05/11] rtc: pcf2127: provide ->write method Rasmus Villemoes
2020-07-09  8:37   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 06/11] rtc: add rtc command Rasmus Villemoes
2020-07-09  8:37   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 07/11] rtc: sandbox-rtc: fix set method Rasmus Villemoes
2020-07-09  8:37   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 08/11] rtc: i2c_rtc_emul: catch any write to the "reset" register Rasmus Villemoes
2020-07-09  8:38   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 09/11] test: dm: rtc: add test of dm_rtc_read, dm_rtc_write Rasmus Villemoes
2020-07-09  8:38   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 10/11] sandbox: add rtc command to defconfigs Rasmus Villemoes
2020-07-09  8:38   ` Heiko Schocher
2020-07-06 20:01 ` [PATCH v4 11/11] test: dm: rtc: add tests of rtc shell command Rasmus Villemoes
2020-07-09  8:39   ` Heiko Schocher
2020-07-07  5:02 ` [PATCH v4 00/11] new rtc methods, rtc command, and tests Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.