]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Merge remote-tracking branches 'regmap/topic/debugfs' and 'regmap/topic/mmio-clk...
authorMark Brown <broonie@kernel.org>
Mon, 12 Mar 2018 16:50:42 +0000 (09:50 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 12 Mar 2018 16:50:42 +0000 (09:50 -0700)
1  2  3 
drivers/base/regmap/regmap.c

index 9d042ee8707d6d520f099ff8a6987ec0756e6792,f5fa1ddc65e9bbc13378ac5adeff59089ae0d792,ee302ccdfbc8d366fec3f39574a4c28462b20240..3bc84885eb91953c81d0c4b19fc38da2d8dd4d5b
@@@@ -2514,32 -2548,14 -2546,14 +2516,32 @@@@ int regmap_raw_read(struct regmap *map
                        ret = -ENOTSUPP;
                        goto out;
                }
 --             if (map->max_raw_read && map->max_raw_read < val_len) {
 --                     ret = -E2BIG;
 --                     goto out;
 --             }
   
 --             /* Physical block read if there's no cache involved */
 --             ret = _regmap_raw_read(map, reg, val, val_len);
 ++             if (map->use_single_read)
 ++                     chunk_regs = 1;
 ++             else if (map->max_raw_read && val_len > map->max_raw_read)
 ++                     chunk_regs = map->max_raw_read / val_bytes;
 ++
 ++             chunk_count = val_count / chunk_regs;
 ++             chunk_bytes = chunk_regs * val_bytes;
 + 
 ++             /* Read bytes that fit into whole chunks */
 ++             for (i = 0; i < chunk_count; i++) {
 ++                     ret = _regmap_raw_read(map, reg, val, chunk_bytes);
 ++                     if (ret != 0)
 ++                             goto out;
 ++
 ++                     reg += regmap_get_offset(map, chunk_regs);
 ++                     val += chunk_bytes;
 ++                     val_len -= chunk_bytes;
 ++             }
  +
 ++             /* Read remaining bytes */
 ++             if (val_len) {
 ++                     ret = _regmap_raw_read(map, reg, val, val_len);
 ++                     if (ret != 0)
 ++                             goto out;
 ++             }
        } else {
                /* Otherwise go word by word for the cache; should be low
                 * cost as we expect to hit the cache.