1. 12 Aug, 2019 1 commit
  2. 09 Aug, 2019 1 commit
  3. 01 Aug, 2019 1 commit
  4. 04 Jul, 2019 1 commit
  5. 17 Jun, 2019 1 commit
  6. 12 Jun, 2019 1 commit
    • Srinivas Kandagatla's avatar
      regmap: fix bulk writes on paged registers · db057679
      Srinivas Kandagatla authored and Mark Brown's avatar Mark Brown committed
      
      
      On buses like SlimBus and SoundWire which does not support
      gather_writes yet in regmap, A bulk write on paged register
      would be silently ignored after programming page.
      This is because local variable 'ret' value in regmap_raw_write_impl()
      gets reset to 0 once page register is written successfully and the
      code below checks for 'ret' value to be -ENOTSUPP before linearising
      the write buffer to send to bus->write().
      
      Fix this by resetting the 'ret' value to -ENOTSUPP in cases where
      gather_writes() is not supported or single register write is
      not possible.
      
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      db057679
  7. 07 Jun, 2019 1 commit
  8. 20 May, 2019 1 commit
    • Daniel Baluta's avatar
      regmap: debugfs: Fix memory leak in regmap_debugfs_init · 2899872b
      Daniel Baluta authored and Mark Brown's avatar Mark Brown committed
      
      
      As detected by kmemleak running on i.MX6ULL board:
      
      nreferenced object 0xd8366600 (size 64):
        comm "swapper/0", pid 1, jiffies 4294937370 (age 933.220s)
        hex dump (first 32 bytes):
          64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72  dummy-iomuxc-gpr
          40 32 30 65 34 30 30 30 00 e3 f3 ab fe d1 1b dd  @20e4000........
        backtrace:
          [<b0402aec>] kasprintf+0x2c/0x54
          [<a6fbad2c>] regmap_debugfs_init+0x7c/0x31c
          [<9c8d91fa>] __regmap_init+0xb5c/0xcf4
          [<5b1c3d2a>] of_syscon_register+0x164/0x2c4
          [<596a5d80>] syscon_node_to_regmap+0x64/0x90
          [<49bd597b>] imx6ul_init_machine+0x34/0xa0
          [<250a4dac>] customize_machine+0x1c/0x30
          [<2d19fdaf>] do_one_initcall+0x7c/0x398
          [<e6084469>] kernel_init_freeable+0x328/0x448
          [<168c9101>] kernel_init+0x8/0x114
          [<913268aa>] ret_from_fork+0x14/0x20
          [<ce7b131a>] 0x0
      
      Root cause is that map->debugfs_name is allocated using kasprintf
      and then the pointer is lost by assigning it other memory address.
      
      Reported-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      2899872b
  9. 25 Apr, 2019 1 commit
  10. 03 Apr, 2019 1 commit
    • Han Nandor's avatar
      regmap: verify if register is writeable before writing operations · 8b9f9d4d
      Han Nandor authored and Mark Brown's avatar Mark Brown committed
      
      
      regmap provides a couple of ways to validate the register range used.
      a) maxim allowed register, b) writable/readable register tables,
      c) callback function that can be provided by the driver to validate
      a register. regmap framework should verify if registers
      are writeable before every write operation. However this doesn't
      seems to happen in every situation.
      
      The method `_regmap_raw_write_impl` is only using the `writeable_reg`
      callback to verify if register is writeable, ignoring the other two.
      This can lead to undefined behaviour since this allows to write to
      registers that could be declared un-writeable by using any other
      option.
      
      Change `_regmap_raw_write_impl` to use the `regmap_writeable` method
      to verify if registers are writable before the write operation.
      
      Signed-off-by: default avatarNandor Han <nandor.han@vaisala.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      8b9f9d4d
  11. 01 Apr, 2019 1 commit
  12. 20 Mar, 2019 1 commit
  13. 19 Mar, 2019 1 commit
  14. 29 Jan, 2019 1 commit
    • Mathieu Malaterre's avatar
      regmap: Remove attribute packed from struct 'regcache_rbtree_node' · 435bba0f
      Mathieu Malaterre authored and Mark Brown's avatar Mark Brown committed
      On one hand commit 28644c80 ("regmap: Add the rbtree cache support")
      added 'regcache_rbtree_node' as packed structure, while on the other hand
      commit e977145a
      
       ("[RBTREE] Add explicit alignment to sizeof(long)
      for struct rb_node.") declared struct 'rb_node' as aligned.
      
      Solve the ambiguity of placing aligned structure in a packed one by
      removing the packed attribute from struct. This seems to be the behavior
      of gcc anyway.
      
      This removes the following warning (W=1):
      
        drivers/base/regmap/regcache-rbtree.c:36:1: warning: alignment 1 of 'struct regcache_rbtree_node' is less than 4 [-Wpacked-not-aligned]
      
      Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      435bba0f
  15. 23 Jan, 2019 1 commit
    • Matti Vaittinen's avatar
      regmap: regmap-irq: Add main status register support · a2d21848
      Matti Vaittinen authored and Mark Brown's avatar Mark Brown committed
      
      
      There is bunch of devices with multiple logical blocks which
      can generate interrupts. It's not a rare case that the interrupt
      reason registers are arranged so that there is own status/ack/mask
      register for each logical block. In some devices there is also a
      'main interrupt register(s)' which can indicate what sub blocks
      have interrupts pending.
      
      When such a device is connected via slow bus like i2c the main
      part of interrupt handling latency can be caused by bus accesses.
      On systems where it is expected that only one (or few) sub blocks
      have active interrupts we can reduce the latency by only reading
      the main register and those sub registers which have active
      interrupts. Support this with regmap-irq for simple cases where
      main register does not require acking or masking.
      
      Signed-off-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      a2d21848
  16. 14 Jan, 2019 1 commit
  17. 31 Dec, 2018 1 commit
  18. 19 Dec, 2018 3 commits
  19. 17 Dec, 2018 2 commits
  20. 13 Dec, 2018 1 commit
    • Bartosz Golaszewski's avatar
      regmap: irq: handle HW using separate rising/falling edge interrupts · bc998a73
      Bartosz Golaszewski authored and Mark Brown's avatar Mark Brown committed
      
      
      Some interrupt controllers use separate bits for controlling rising
      and falling edge interrupts in the mask register i.e. they have one
      interrupt for rising edge and one for falling.
      
      We already handle the case where we have a single interrupt in the
      mask register and a separate type configuration register.
      
      Add a new switch to regmap_irq_chip which tells the framework to use
      the mask_base address for configuring the edge of the interrupts that
      define type_falling/rising_mask values.
      
      For such interrupts we never update the type_base bits. For interrupts
      that don't define type masks or their regmap irq chip doesn't set the
      type_in_mask to true everything stays the same.
      
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      bc998a73
  21. 19 Oct, 2018 2 commits
  22. 07 Sep, 2018 2 commits
  23. 09 Aug, 2018 1 commit
    • Crestez Dan Leonard's avatar
      regmap: Add regmap_noinc_read API · 74fe7b55
      Crestez Dan Leonard authored and Mark Brown's avatar Mark Brown committed
      
      
      The regmap API usually assumes that bulk read operations will read a
      range of registers but some I2C/SPI devices have certain registers for
      which a such a read operation will return data from an internal FIFO
      instead. Add an explicit API to support bulk read without range semantics.
      
      Some linux drivers use regmap_bulk_read or regmap_raw_read for such
      registers, for example mpu6050 or bmi150 from IIO. This only happens to
      work because when caching is disabled a single regmap read op will map
      to a single bus read op (as desired). This breaks if caching is enabled and
      reg+1 happens to be a cacheable register.
      
      Without regmap support refactoring a driver to enable regmap caching
      requires separate I2C and SPI paths. This is exactly what regmap is
      supposed to help avoid.
      
      Suggested-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarCrestez Dan Leonard <leonard.crestez@intel.com>
      Signed-off-by: default avatarStefan Popa <stefan.popa@analog.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      74fe7b55
  24. 23 Jul, 2018 1 commit
  25. 18 Jul, 2018 1 commit
    • Akinobu Mita's avatar
      regmap: add SCCB support · bcf7eac3
      Akinobu Mita authored and Mark Brown's avatar Mark Brown committed
      This adds Serial Camera Control Bus (SCCB) support for regmap API that
      is intended to be used by some of Omnivision sensor drivers.
      
      The ov772x and ov9650 drivers are going to use this SCCB regmap API.
      
      The ov772x driver was previously only worked with the i2c controller
      drivers that support I2C_FUNC_PROTOCOL_MANGLING, because the ov772x
      device doesn't support repeated starts.  After commit 0b964d18
      
      
      ("media: ov772x: allow i2c controllers without
      I2C_FUNC_PROTOCOL_MANGLING"), reading ov772x register is replaced with
      issuing two separated i2c messages in order to avoid repeated start.
      Using this SCCB regmap hides the implementation detail.
      
      The ov9650 driver also issues two separated i2c messages to read the
      registers as the device doesn't support repeated start.  So it can
      make use of this SCCB regmap.
      
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
      Cc: Wolfram Sang <wsa@the-dreams.de>
      Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
      Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      bcf7eac3
  26. 11 Jul, 2018 1 commit
  27. 25 May, 2018 1 commit
  28. 17 May, 2018 1 commit
  29. 06 Mar, 2018 2 commits
  30. 05 Mar, 2018 2 commits
  31. 26 Feb, 2018 3 commits