[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectregmap issue with ranges and noinc read

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,
 \ /
  Last update: 2020-04-03 09:47    [W:0.045 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site