linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* regmap issue with ranges and noinc read
@ 2020-04-03  7:46 Jean-Baptiste Maneyrol
  0 siblings, 0 replies; only message in thread
From: Jean-Baptiste Maneyrol @ 2020-04-03  7:46 UTC (permalink / raw)
  To: linux-kernel

Hello,

I have an issue using regmap noinc read when using ranges.

My device is 8-bits registers and 8-bits values and uses several register banks that you can switch using a bank register available on all banks.
I am configuring regmap with 1 range with window len of 0x100 and using virtual register addresses like 0x0aRR, where a is the bank number and RR register address (0x0032 for register 0x32 in bank 0, and 0x0123 for register 0x23 in bank 1). This is working pretty well so far.

The device has in bank 0 a virtual register for reading a data FIFO, which is larger than a bank (0x800, 2048). When using the regmap_noinc_read API for reading my FIFO, I am limited in size to not overflow the range window len. regmap is checking that and returns EINVAL in this case (check is done inside _regmap_select_page called in _regmap_raw_read). It certainly makes sense when using the standard remap_bulk_read API, but for the noinc_read where we are not reading continuous register this doesn't seem to be relevant. And this prevent the read of the entire FIFO data in this case.

Is there any reason to check the range window len bounds for the noinc_read API or is this a bug?

Thanks for your help.

Best regards,
JB

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-03  7:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03  7:46 regmap issue with ranges and noinc read Jean-Baptiste Maneyrol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).