Skip to content
  1. Feb 16, 2014
  2. Dec 30, 2013
  3. Dec 16, 2013
  4. Nov 24, 2013
  5. Nov 21, 2013
  6. Nov 12, 2013
  7. Oct 14, 2013
  8. Oct 10, 2013
  9. Oct 09, 2013
  10. Oct 07, 2013
  11. Sep 17, 2013
    • Kuninori Morimoto's avatar
      regmap: Add regmap_fields APIs · a0102375
      Kuninori Morimoto authored
      
      
      Current Linux kernel is supporting regmap_field method
      and it is very useful feature.
      It needs one regmap_filed for one register access.
      
      OTOH, there is multi port device which
      has many same registers in the market.
      The difference for each register access is
      only its address offset.
      
      Current API needs many regmap_field for such device,
      but it is not good.
      This patch adds new regmap_fileds API which can care
      about multi port/offset access via regmap.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      a0102375
  12. Sep 16, 2013
  13. Aug 16, 2013
  14. Aug 09, 2013
    • Ionut Nicu's avatar
      regmap: regcache: allow read-only regs to be cached · 515f2261
      Ionut Nicu authored
      
      
      The regmap_writeable() check should not be done in
      regcache_write() because this prevents read-only
      registers to be cached. After a read on a read-only
      register its value will not be stored in the cache
      and the next time someone will try to read it the
      value will be read from the bus instead of the
      cache.
      
      Instead the regmap_writeable() check should be done
      in _regmap_write() to prevent callers from writing
      to read-only registers.
      
      Signed-off-by: default avatarIonut Nicu <ioan.nicu.ext@nsn.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      515f2261
  15. Aug 06, 2013
    • Philipp Zabel's avatar
      regmap: core: allow a virtual range to cover its own data window · f161d220
      Philipp Zabel authored
      
      
      I see no reason why a virtual range shouldn't be allowed to cover its
      own data window if the page selection register is in the same place
      on every page.
      For chips which use paged access for all of their registers, but only
      when connected via I2C, and which can access the whole register space
      directly when connected via SPI, this allows to avoid acrobatics with
      the register ranges by simply mapping the I2C ranges over the data
      window beginning at 0x0, and then using linear access for the SPI
      variant.
      
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      f161d220
  16. Jul 16, 2013
  17. Jul 04, 2013
  18. Jun 12, 2013
    • Srinivas Kandagatla's avatar
      regmap: Add regmap_field APIs · 67252287
      Srinivas Kandagatla authored
      
      
      It is common to access regmap registers at bit level, using
      regmap_update_bits or regmap_read functions, however the end user has to
      take care of a mask or shifting. This becomes overhead when such use
      cases are high. Having a common function to do this is much convenient
      and less error prone.
      
      The idea of regmap_field is simple, regmap_field gives a logical
      structure to bits of the regmap register, and the driver can use this
      logical entity without the knowledge of the bit positions and masks all
      over the code. This way code looks much neat and it need not handle the
      masks, shifts every time it access the those entities.
      
      With this new regmap_field_read/write apis the end user can setup a
      regmap field using regmap_field_init and use the return regmap_field to
      read write the register field without worrying about the masks or
      shifts.
      
      Also this apis will be useful for drivers which are based on regmaps,
      like some clocks or pinctrls which can work on the regmap_fields
      directly without having to worry about bit positions.
      
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      67252287
  19. Jun 03, 2013
  20. May 25, 2013
  21. May 12, 2013
  22. Apr 16, 2013
    • Stephen Warren's avatar
      regmap: don't corrupt work buffer in _regmap_raw_write() · 5a08d156
      Stephen Warren authored
      
      
      _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: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      5a08d156
  23. Apr 09, 2013
    • Mark Brown's avatar
      regmap: Back out work buffer fix · 51a246aa
      Mark Brown authored
      
      
      This reverts commit bc8ce4 (regmap: don't corrupt work buffer in
      _regmap_raw_write()) since it turns out that it can cause issues when
      taken in isolation from the other changes in -next that lead to its
      discovery.  On the basis that nobody noticed the problems for quite some
      time without that subsequent work let's drop it from v3.9.
      
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      51a246aa
  24. Mar 27, 2013
  25. Mar 26, 2013
  26. Mar 21, 2013
    • Stephen Warren's avatar
      regmap: don't corrupt work buffer in _regmap_raw_write() · bc8ce4af
      Stephen Warren authored
      
      
      _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: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      bc8ce4af
  27. Mar 12, 2013
  28. Mar 04, 2013
  29. Feb 05, 2013
  30. Feb 04, 2013
    • Axel Lin's avatar
      regmap: Export regmap_async_complete_cb · f804fb56
      Axel Lin authored
      
      
      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: default avatarAxel Lin <axel.lin@ingics.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      f804fb56
    • Stephen Warren's avatar
      regmap: include linux/sched.h to fix build · 30b2a553
      Stephen Warren authored
      
      
      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: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      30b2a553
  31. Jan 29, 2013
Loading