1. 22 3月, 2013 1 次提交
    • S
      regmap: don't corrupt work buffer in _regmap_raw_write() · bc8ce4af
      Stephen Warren 提交于
      _regmap_raw_write() contains code to call regcache_write() to write
      values to the cache. That code calls memcpy() to copy the value data to
      the start of the work_buf. However, at least when _regmap_raw_write() is
      called from _regmap_bus_raw_write(), the value data is in the work_buf,
      and this memcpy() operation may over-write part of that value data,
      depending on the value of reg_bytes + pad_bytes. At least when using
      reg_bytes==1 and pad_bytes==0, corruption of the value data does occur.
      
      To solve this, remove the memcpy() operation, and modify the subsequent
      .parse_val() call to parse the original value buffer directly.
      
      At least in the case of 8-bit register address and 16-bit values, and
      writes of single registers at a time, this memcpy-then-parse combination
      used to cancel each-other out; for a work-buffer containing xx 89 03,
      the memcpy changed it to 89 03 03, and the parse_val changed it back to
      89 89 03, thus leaving the value uncorrupted. This appears completely
      accidental though. Since commit 8a819ff8 "regmap: core: Split out in
      place value parsing", .parse_val only returns the parsed value, and does
      not modify the buffer, and hence does not (accidentally) undo the
      corruption caused by memcpy(). This caused bogus values to get written
      to HW, thus preventing e.g. audio playback on systems with a WM8903
      CODEC. This patch fixes that.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      bc8ce4af
  2. 14 3月, 2013 1 次提交
    • L
      regmap: cache Fix regcache-rbtree sync · 8abac3ba
      Lars-Peter Clausen 提交于
      The last register block, which falls into the specified range, is not handled
      correctly. The formula which calculates the number of register which should be
      synced is inverse (and off by one). E.g. if all registers in that block should
      be synced only one is synced, and if only one should be synced all (but one) are
      synced. To calculate the number of registers that need to be synced we need to
      subtract the number of the first register in the block from the max register
      number and add one. This patch updates the code accordingly.
      
      The issue was introduced in commit ac8d91c8 ("regmap: Supply ranges to the sync
      operations").
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: stable@vger.kernel.org
      8abac3ba
  3. 13 3月, 2013 1 次提交
  4. 01 3月, 2013 1 次提交
  5. 15 2月, 2013 1 次提交
  6. 11 2月, 2013 3 次提交
  7. 08 2月, 2013 1 次提交
  8. 05 2月, 2013 2 次提交
  9. 04 2月, 2013 2 次提交
    • A
      regmap: Export regmap_async_complete_cb · f804fb56
      Axel Lin 提交于
      This fixes below build error when CONFIG_REGMAP=y && CONFIG_REGMAP_SPI=m
      
      ERROR: "regmap_async_complete_cb" [drivers/base/regmap/regmap-spi.ko] undefined!
      make[1]: *** [__modpost] Error 1
      make: *** [modules] Error 2
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f804fb56
    • S
      regmap: include linux/sched.h to fix build · 30b2a553
      Stephen Warren 提交于
      This fixes:
      
      drivers/base/regmap/regmap.c: In function 'regmap_async_complete_cb':
      drivers/base/regmap/regmap.c:1656:3: error: 'TASK_NORMAL' undeclared (first use in this function)
      drivers/base/regmap/regmap.c:1656:3: note: each undeclared identifier is reported only once for each function it appears in
      drivers/base/regmap/regmap.c: In function 'regmap_async_complete':
      drivers/base/regmap/regmap.c:1688:2: error: 'TASK_UNINTERRUPTIBLE' undeclared (first use in this function)
      drivers/base/regmap/regmap.c:1688:2: error: implicit declaration of function 'schedule'
      
      An alternative might be to adjust linux/wait.h to include linux/sched.h,
      but since that hasn't been done before, I assume we're consciously
      avoiding doing that.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      30b2a553
  10. 29 1月, 2013 3 次提交
  11. 27 1月, 2013 1 次提交
    • R
      regmap: regmap: avoid spurious warning in regmap_read_debugfs · a3471469
      Russell King 提交于
      Gcc warns about the case where regmap_read_debugfs tries to walk an
      empty map->debugfs_off_cache list, which would results in uninitialized
      variable getting returned, if we hadn't checked the same condition
      just before that.
      
      After an originally suggested inferior patch from Arnd Bergmann,
      this is the solution that Russell King came up with, sidestepping
      the problem by merging the error case for an empty list with the
      normal path.
      
      Without this patch, building mxs_defconfig results in:
      
      drivers/base/regmap/regmap-debugfs.c: In function 'regmap_read_debugfs':
      drivers/base/regmap/regmap-debugfs.c:147:9: : warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
      Reported-by: NVincent Stehle <v-stehle@ti.com>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      a3471469
  12. 22 1月, 2013 1 次提交
  13. 21 1月, 2013 1 次提交
  14. 16 1月, 2013 1 次提交
  15. 14 1月, 2013 2 次提交
  16. 12 1月, 2013 1 次提交
  17. 09 1月, 2013 5 次提交
  18. 05 1月, 2013 3 次提交
  19. 03 1月, 2013 1 次提交
  20. 02 1月, 2013 1 次提交
    • M
      regmap: flat: Add flat cache type · 2ac902ce
      Mark Brown 提交于
      While for I2C and SPI devices the overhead of using rbtree for devices with
      only one block of registers is negligible the same isn't always going to
      be true for MMIO devices where the I/O costs are very much lower. Cater
      for these devices by adding a simple flat array type for them where the
      lookups are simple array accesses, taking us right back to the original
      ASoC cache implementation.
      
      Thanks to Magnus Damm for the discussion which prompted this.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      2ac902ce
  21. 25 12月, 2012 1 次提交
  22. 11 12月, 2012 3 次提交
  23. 06 12月, 2012 1 次提交
  24. 21 11月, 2012 1 次提交
  25. 30 10月, 2012 1 次提交