- 04 11月, 2017 2 次提交
-
-
由 Mark Brown 提交于
We should free any hwspinlocks when we destroy the regmap, do so. Signed-off-by: NMark Brown <broonie@kernel.org> -
由 Mark Brown 提交于
The previous patch to allow the hwspinlock code to be disabled missed handling the free in the error path, do so using the better IS_ENABLED() pattern as suggested by Baolin. While we're at it also check that we have a hardware spinlock before freeing it - the core code reports an error when freeing an invalid lock. Suggested-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 11月, 2017 1 次提交
-
-
由 Mark Brown 提交于
Unlike other lock types hwspinlocks are optional and can be built modular so we can't use them unconditionally in regmap so add a config option that drivers that want to use hwspinlocks with regmap can select which will ensure that hwspinlock is built in. Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 11月, 2017 1 次提交
-
-
由 Baolin Wang 提交于
On some platforms, when reading or writing some special registers through regmap, we should acquire one hardware spinlock to synchronize between the multiple subsystems. Thus this patch adds the hardware spinlock support for regmap. Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 7月, 2017 2 次提交
-
-
由 minimumlaw@rambler.ru 提交于
Fixes: cc5d0db3 ("regmap: Add 1-Wire bus support") Commit de0d6dbd ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: NAlex A. Mihaylov <minimumlaw@rambler.ru> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Alex A. Mihaylov 提交于
Fixes: cc5d0db3 ("regmap: Add 1-Wire bus support") Commit de0d6dbd ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: NAlex A. Mihaylov <minimumlaw@rambler.ru> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Cc: Mark Brown <broonie@kernel.org> Acked-by: NEvgeniy Polyakov <zbr@ioremap.net> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 29 6月, 2017 1 次提交
-
-
由 Michael Grzeschik 提交于
Some irq controllers have writeonly/multipurpose register layouts. In those cases we read invalid data back. Here we add the option mask_writeonly as masking option. Signed-off-by: NMichael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 6月, 2017 1 次提交
-
-
由 Vladimir Zapolskiy 提交于
The change makes possible to use regmap-irq interface within drivers of simple interrupt controllers, which don't have an option to handle different interrupt types and thus have one cell interrupt controllers described in device tree bindings. Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 6月, 2017 1 次提交
-
-
由 Mark Brown 提交于
Reported-by: NAndreas Ziegler <andreas.ziegler@fau.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 6月, 2017 2 次提交
-
-
由 Alex A. Mihaylov 提交于
Add basic support regmap (register map access) API for 1-Wire bus Signed-off-by: NMark Brown <broonie@kernel.org> -
由 Jonas Gorski 提交于
Commit 2cbbb579 ("regmap: Add the LZO cache support") added support for LZO compression in regcache, but there were never any users added afterwards. Since LZO support itself has its own size, it currently is rather a deoptimization. So make it optional by introducing a symbol that can be selected by drivers wanting to make use of it. Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code). Signed-off-by: NJonas Gorski <jonas.gorski@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 1月, 2017 1 次提交
-
-
由 Charles Keepax 提交于
Most of the kernel-doc comments in regmap don't actually generate correctly. This patch fixes up a few common issues, corrects some typos and adds some missing argument descriptions. The most common issues being using a : after the function name which causes the short description to not render correctly and not separating the long and short descriptions of the function. There are quite a few instances of arguments not being described or given the wrong name as well. This patch doesn't fixup functions/structures that are currently missing descriptions. Signed-off-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 12月, 2016 1 次提交
-
-
由 Geliang Tang 提交于
To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: NGeliang Tang <geliangtang@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 11月, 2016 1 次提交
-
-
由 Kirtika Ruchandani 提交于
Commit 2cbbb579 ("regmap: Add the LZO cache support") introduced 'blksize' in regcache_lzo_read() and regcache_lzo_write(), that is set but not used. Compiling with W=1 gives the following warnings, fix them. drivers/base/regmap/regcache-lzo.c: In function ‘regcache_lzo_read’: drivers/base/regmap/regcache-lzo.c:239:9: warning: variable ‘blksize’ set but not used [-Wunused-but-set-variable] size_t blksize, tmp_dst_len; ^ drivers/base/regmap/regcache-lzo.c: In function ‘regcache_lzo_write’: drivers/base/regmap/regcache-lzo.c:278:9: warning: variable ‘blksize’ set but not used [-Wunused-but-set-variable] size_t blksize, tmp_dst_len; ^ These are harmless warnings and are only being fixed to reduce the noise with W=1 in the kernel. Fixes: 2cbbb579 ("regmap: Add the LZO cache support") Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: NKirtika Ruchandani <kirtika@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 9月, 2016 1 次提交
-
-
由 Nikita Yushchenko 提交于
Commit 815806e3 ("regmap: drop cache if the bus transfer error") added a call to regcache_drop_region() to error path in _regmap_raw_write(). However that path runs with regmap lock taken, and regcache_drop_region() tries to re-take it, causing a deadlock. Fix that by calling map->cache_ops->drop() directly. Signed-off-by: NNikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 9月, 2016 2 次提交
-
-
由 Tony Lindgren 提交于
This with the longer read and write masks allow supporting more exotic devices. For example a little endian SPI device: static const struct regmap_config foo_regmap_config = { .reg_bits = 16, .reg_stride = 4, .val_bits = 16, .write_flag_mask = 0x8000, .reg_format_endian = REGMAP_ENDIAN_LITTLE, .val_format_endian = REGMAP_ENDIAN_LITTLE, ... }; Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NMark Brown <broonie@kernel.org> -
由 Tony Lindgren 提交于
We currently only support masking the top bit for read and write flags. Let's make the mask unsigned long and mask the bytes based on the configured register length to make things more generic. This allows using regmap for more exotic combinations like SPI devices that need little endian addressing. Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 8月, 2016 1 次提交
-
-
由 Elaine Zhang 提交于
regmap_write ->_regmap_raw_write -->regcache_write first and than use map->bus->write to wirte i2c or spi But if the i2c or spi transfer failed, But the cache is updated, So if I use regmap_read will get the cache data which is not the real register value. Signed-off-by: NElaine Zhang <zhangqing@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 09 8月, 2016 2 次提交
-
-
由 Cristian Birsan 提交于
Add support for dumping write only device registers in debugfs. This is useful for audio codecs that have write only registers (like WM8731). The logic that decides if a value can be printed is moved to regmap_printable() function to allow for easier future updates. Signed-off-by: NCristian Birsan <cristian.birsan@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Cristian Birsan 提交于
Add a function to check if a regmap register is cached. This will be used in debugfs to dump the cached values of write only registers. Signed-off-by: NCristian Birsan <cristian.birsan@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 04 8月, 2016 1 次提交
-
-
由 Lars-Peter Clausen 提交于
When searching for a suitable node that should be used for inserting a new register, which does not fall within the range of any existing node, we not only looks for nodes which are directly adjacent to the new register, but for nodes within a certain proximity. This is done to avoid creating lots of small nodes with just a few registers spacing in between, which would increase memory usage as well as tree traversal time. This means there might be multiple node candidates which fall within the proximity range of the new register. If we choose the first node we encounter, under certain register insertion patterns it is possible to end up with overlapping ranges. This will break order in the rbtree and can cause the cached register value to become corrupted. E.g. take the simplified example where the proximity range is 2 and the register insertion sequence is 1, 4, 2, 3, 5. * Insert of register 1 creates a new node, this is the root of the rbtree * Insert of register 4 creates a new node, which is inserted to the right of the root. * Insert of register 2 gets inserted to the first node * Insert of register 3 gets inserted to the first node * Insert of register 5 also gets inserted into the first node since this is the first node encountered and it is within the proximity range. Now there are two overlapping nodes. To avoid this always choose the node that is closest to the new register. This will ensure that nodes will not overlap. The tree traversal is still done as a binary search, we just don't stop at the first node found. So the complexity of the algorithm stays within the same order. Ideally if a new register is in the range of two adjacent blocks those blocks should be merged, but that is a much more invasive change and left for later. The issue was initially introduced in commit 472fdec7 ("regmap: rbtree: Reduce number of nodes, take 2"), but became much more exposed by commit 6399aea6 ("regmap: rbtree: When adding a reg do a bsearch for target node") which changed the order in which nodes are looked-up. Fixes: 6399aea6 ("regmap: rbtree: When adding a reg do a bsearch for target node") Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 7月, 2016 1 次提交
-
-
由 Maarten ter Huurne 提交于
In 3245d460 (regmap: cache: Fall back to register by register read for cache defaults) non-readable registers are skipped when initializing reg_defaults, but are still included in num_reg_defaults. So there can be uninitialized entries at the end of reg_defaults, which can cause problems when the register cache initializes from the full array. Fixed it by excluding non-readable registers from the count as well. Signed-off-by: NMaarten ter Huurne <maarten@treewalker.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 6月, 2016 1 次提交
-
-
由 Chen-Yu Tsai 提交于
When doing a bulk writes from a device which lacks raw I/O support we fall back to doing register at a time reads but we still use the raw formatters in order to render the data into the word size used by the device (since bulk reads still operate on the device word size rather than unsigned ints). This means that devices without raw formatting such as those that provide reg_read() are not supported. Provide handling for them by copying the values read into native endian values of the appropriate size. This complements commit d5b98eb1 ("regmap: Support bulk reads for devices without raw formatting"). Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 6月, 2016 1 次提交
-
-
由 Guenter Roeck 提交于
Chips with 16-bit registers don't usually work well with I2C block commands. For example, neither the LM75 datasheet nor the TMP102 datasheet mentions block command support, and in fact it does not work for any of those chips. Also, it is not clear how the block command would handle 16-bit SMBus operations in the fist place, since the data format associated with those commands is either little endian or big endian, which requires some kind of conversion to or from host byte order. Only use i2c block commands if both register and value width is 8 bit. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 6月, 2016 1 次提交
-
-
由 Laxman Dewangan 提交于
Regmap irq implements the generic interrupt service routine which is common for most of devices. Some devices, like MAX77620, MAX20024 needs the special handling before and after servicing the interrupt as generic. For the example, MAX77620 programming guidelines for interrupt servicing says: 1. When interrupt occurs from PMIC, mask the PMIC interrupt by setting GLBLM. 2. Read IRQTOP and service the interrupt accordingly. 3. Once all interrupts has been checked and serviced, the interrupt service routine un-masks the hardware interrupt line by clearing GLBLM. The step (2) is implemented in regmap irq as generic routine. For step (1) and (3), add callbacks from regmap irq to client driver to handle chip specific configurations. Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 4月, 2016 1 次提交
-
-
由 Jack Pham 提交于
Specifically for the case of reads that use the Extended Register Read Long command, a multi-byte read operation is broken up into 8-byte chunks. However the call to spmi_ext_register_readl() is incorrectly passing 'val_size', which if greater than 8 will always fail. The argument should instead be 'len'. Fixes: c9afbb05 ("regmap: spmi: support base and extended register spaces") Signed-off-by: NJack Pham <jackp@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 01 4月, 2016 1 次提交
-
-
由 Mark Brown 提交于
Otherwise the DT parsing will default to big endian if nothing is specified. Reported-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 3月, 2016 3 次提交
-
-
由 Mark Brown 提交于
Since we changed to do formatting in the bus we now skip all the format parsing that the core does for its data marshalling code. This means that we skip the DT parsing it does which breaks some systems, we need to add an explict call in the MMIO code to do this. Reported-by: NAlexander Stein <alexander.stein@systec-electronic.com> Tested-by: NAlexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
internal.h is using dev_name() but doesn't include device.h which defines it. Add an explicit include to avoid build problems due to this. Tested-by: NAlexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Alexander Stein 提交于
If max_register is unset, regcache_flat_get_index will return 0 and only memory for 1 unsigned int will be allocated, resulting in writing out of bounds. Signed-off-by: NAlexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 3月, 2016 1 次提交
-
-
由 Andrew F. Davis 提交于
Setting the flag 'cache_bypass' will bypass the cache not the hardware. Fix this comment here. Fixes: 0eef6b04 ("regmap: Fix doc comment") Signed-off-by: NAndrew F. Davis <afd@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 3月, 2016 1 次提交
-
-
由 Mark Brown 提交于
Currently when selecting value endianness we check the register endiannes, not the value endianness. Reported-by: NAlexander Stein <alexander.stein@systec-electronic.com> Tested-by: NAlexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 3月, 2016 2 次提交
-
-
由 Laxman Dewangan 提交于
Add device managed APIs for regmap_add_irq_chip() and regmap_del_irq_chip() so that it can be managed by device framework for freeing it. This helps on following: 1. Maintaining the sequence of resource allocation and deallocation regmap_add_irq_chip(&d); devm_requested_threaded_irq(virq) On free path: regmap_del_irq_chip(d); and then removing the irq registration. On this case, regmap irq is deleted before the irq is free. This force to use normal irq registration. By using devm apis, the sequence can be maintain properly: devm_regmap_add_irq_chip(&d); devm_requested_threaded_irq(virq); and resource deallocation will be done in reverse order by device framework. 2. No need to delete the regmap_irq_chip in error path or remove callback and hence there is less code on this path. Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Kuninori Morimoto 提交于
commit 23b92e4cf5fd ("regmap: remove regmap_write_bits()") removed regmap_write_bits(), but MFD driver was using it. So, commit e30fccd6771d ("regmap: Keep regmap_write_bits()") turns out it, but it is using original style. This patch uses regmap_update_bits_base() for regmap_write_bits() Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 2月, 2016 1 次提交
-
-
由 Grygorii Strashko 提交于
When nested interrupts are handled with regmap irq framework, we need to mark the interrupts to be resend for pending interrupts on enable_irq. Else the events might be lost for nested irqs. Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com> Tested-by: NNishanth Menon <nm@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 26 2月, 2016 1 次提交
-
-
由 Kuninori Morimoto 提交于
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 2月, 2016 4 次提交
-
-
由 Kuninori Morimoto 提交于
This patch merges regmap_fields_update_bits() into macro by using regmap_field_update_bits_base(). Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Kuninori Morimoto 提交于
This patch merges regmap_fields_write() into macro by using regmap_fields_update_bits_base(). Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Kuninori Morimoto 提交于
This patch adds new regmap_fields_update_bits_base() which is using regmap_update_bits_base(). Current regmap_fields_xxx() can be merged into it by macro. Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Kuninori Morimoto 提交于
This patch merges regmap_field_update_bits() into macro by using regmap_field_update_bits_base(). Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-