mbox series

[RFC,0/3] regmap: Implement regmap_multi_reg_read()

Message ID 20240710015622.1960522-1-linux@roeck-us.net (mailing list archive)
Headers show
Series regmap: Implement regmap_multi_reg_read() | expand

Message

Guenter Roeck July 10, 2024, 1:56 a.m. UTC
regmap_multi_reg_read() is similar to regmap_bilk_read() but reads from
an array of non-sequential registers. It is helpful if multiple non-
sequential registers need to be read in a single operation which would
otherwise have to be mutex protected.

The name of the new function was chosen to match the existing function
regmap_multi_reg_write().

The first patch of the series introduces the new function. The following
two patches provide examples for its use.

----------------------------------------------------------------
Guenter Roeck (3):
      regmap: Implement regmap_multi_reg_read()
      hwmon: (adt7470) Use multi-byte regmap operations
      hwmon: (tmp401) Use multi-byte regmap operations

 drivers/base/regmap/regmap.c | 103 ++++++++++++++++++++++++++++---------------
 drivers/hwmon/adt7470.c      |  22 +++------
 drivers/hwmon/tmp401.c       |  19 +++-----
 include/linux/regmap.h       |   2 +
 4 files changed, 84 insertions(+), 62 deletions(-)

Comments

Mark Brown July 10, 2024, 11:24 p.m. UTC | #1
On Tue, 09 Jul 2024 18:56:19 -0700, Guenter Roeck wrote:
> regmap_multi_reg_read() is similar to regmap_bilk_read() but reads from
> an array of non-sequential registers. It is helpful if multiple non-
> sequential registers need to be read in a single operation which would
> otherwise have to be mutex protected.
> 
> The name of the new function was chosen to match the existing function
> regmap_multi_reg_write().
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/3] regmap: Implement regmap_multi_reg_read()
      commit: 450a60ef607900bb9affb0e822fea9726679c512

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Mark Brown July 11, 2024, 1:14 a.m. UTC | #2
On Tue, Jul 09, 2024 at 06:56:19PM -0700, Guenter Roeck wrote:
> regmap_multi_reg_read() is similar to regmap_bilk_read() but reads from
> an array of non-sequential registers. It is helpful if multiple non-
> sequential registers need to be read in a single operation which would
> otherwise have to be mutex protected.

It would be nice to have KUnit coverage for the new function too.

The following changes since commit f2661062f16b2de5d7b6a5c42a9a5c96326b8454:

  Linux 6.10-rc5 (2024-06-23 17:08:54 -0400)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-multi-reg-write

for you to fetch changes up to 3c1ff93b4deea502cd8b0869839557cab2a28b71:

  regmap: Implement regmap_multi_reg_read() (2024-07-10 18:45:34 +0100)

----------------------------------------------------------------
regmap: Implement regmap_multi_reg_read()

A new API function from Guenter Roeck:

regmap_multi_reg_read() is similar to regmap_bulk_read() but reads from
an array of non-sequential registers. It is helpful if multiple non-
sequential registers need to be read in a single operation which would
otherwise have to be mutex protected.

The name of the new function was chosen to match the existing function
regmap_multi_reg_write().

----------------------------------------------------------------
Guenter Roeck (1):
      regmap: Implement regmap_multi_reg_read()

 drivers/base/regmap/regmap.c | 103 ++++++++++++++++++++++++++++---------------
 include/linux/regmap.h       |   2 +
 2 files changed, 70 insertions(+), 35 deletions(-)
Guenter Roeck July 11, 2024, 3:33 a.m. UTC | #3
On 7/10/24 18:14, Mark Brown wrote:
> On Tue, Jul 09, 2024 at 06:56:19PM -0700, Guenter Roeck wrote:
>> regmap_multi_reg_read() is similar to regmap_bilk_read() but reads from
>> an array of non-sequential registers. It is helpful if multiple non-
>> sequential registers need to be read in a single operation which would
>> otherwise have to be mutex protected.
> 
> It would be nice to have KUnit coverage for the new function too.
> 

Agreed, makes sense. I'll have a look and see what I can come up with.
I assume you'd also like to have a unit test for regmap_multi_reg_write() ?

Thanks,
Guenter
Mark Brown July 11, 2024, 11:39 a.m. UTC | #4
On Wed, Jul 10, 2024 at 08:33:42PM -0700, Guenter Roeck wrote:
> On 7/10/24 18:14, Mark Brown wrote:

> > It would be nice to have KUnit coverage for the new function too.

> Agreed, makes sense. I'll have a look and see what I can come up with.
> I assume you'd also like to have a unit test for regmap_multi_reg_write() ?

Yes, indeed - thanks for sending that.  In general it'd be nice to fill
out the whole API and things like formatting as well.