- 22 8月, 2015 3 次提交
-
-
由 Markus Pargmann 提交于
There is no multi_write support available if we cannot use raw_write. This is the case if bus->write is not implemented. This patch adds a condition that we need bus and bus->write so that can_multi_write is true. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Markus Pargmann 提交于
use_single_rw currently reflects the capabilities of the connected device. The capabilities of the bus are currently missing for this variable. As there are read only and write only buses we need seperate values for use_single_rw to also reflect tha capabilities of the bus. This patch splits use_single_rw into use_single_read and use_single_write. The initialization is changed to check the configuration for use_single_rw and to check the capabilities of the used bus. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Markus Pargmann 提交于
The regmap config does not prohibit val_bytes that are not powers of two. But the current code of regmap_bulk_write for use_single_rw does limit the possible val_bytes to 1, 2 and 4. This patch fixes the behaviour to allow bus writes with non-standard val_bytes sizes. Cc: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 7月, 2015 1 次提交
-
-
由 Mark Brown 提交于
Zero length reads make no sense in a regmap context and are likely to trigger bugs further down the stack so insert an error check, also silencing compiler warnings about use of ret in cases where we iterate per register. Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 7月, 2015 1 次提交
-
-
由 Lars-Peter Clausen 提交于
Currently regmap requires that a reg_read callback is supplied, otherwise a warning is emitted each time regmap_read() is called. This means a device or bus without readback support needs to supply dummy reg_read callback. Apart from that regmap_read() will still work fine if a cache is used. Remove the warning and let regmap_readable() return false if not reg_read callback is supplied. This means a device no longer has to supply a dummy callback if it does not support readback and it also doesn't have to have a readable_reg callback that always returns false since this is now implicit. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 6月, 2015 1 次提交
-
-
由 Maxime Coquelin 提交于
The way the mask is generated in regmap_field_init() is wrong. Indeed, a field initialized with msb = 31 and lsb = 0 provokes a shift overflow while calculating the mask field. On some 32 bits architectures, such as x86, the generated mask is 0, instead of the expected 0xffffffff. This patch uses GENMASK() to fix the problem, as this macro is already safe regarding shift overflow. Signed-off-by: NMaxime Coquelin <maxime.coquelin@st.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 15 6月, 2015 1 次提交
-
-
由 Arun Chandran 提交于
In big endian mode regmap_bulk_read gives incorrect data for byte reads. This is because memcpy of a single byte from an address after full word read gives different results when endianness differs. ie. we get little-end in LE and big-end in BE. Signed-off-by: NArun Chandran <achandran@mvista.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 10 6月, 2015 1 次提交
-
-
由 Rob Herring 提交于
set_irq_flags is ARM specific with custom flags which have genirq equivalents. Convert drivers to use the genirq interfaces directly, so we can kill off set_irq_flags. The translation of flags is as follows: IRQF_VALID -> !IRQ_NOREQUEST IRQF_PROBE -> !IRQ_NOPROBE IRQF_NOAUTOEN -> IRQ_NOAUTOEN For IRQs managed by an irqdomain, the irqdomain core code handles clearing and setting IRQ_NOREQUEST already, so there is no need to do this in .map() functions and we can simply remove the set_irq_flags calls. Some users also set IRQ_NOPROBE and this has been maintained although it is not clear that is really needed. There appears to be a great deal of blind copy and paste of this code. Signed-off-by: NRob Herring <robh@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 6月, 2015 1 次提交
-
-
由 dashsriram 提交于
Fixed a typo error in the file Signed-off-by: NSriram Dash <dash.sriram@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 5月, 2015 1 次提交
-
-
由 Julia Lawall 提交于
Delete jump to a label on the next line, when that label is not used elsewhere. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier l; @@ -if (...) goto l; -l: // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 5月, 2015 2 次提交
-
-
由 Srinivas Kandagatla 提交于
This patch introduces regmap_get_reg_stride() function which would be used by the infrastructures like nvmem framework built on top of regmap. Mostly this function would be used for sanity checks on inputs within such infrastructure. Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Srinivas Kandagatla 提交于
This patch introduces regmap_get_max_register() function which would be used by the infrastructures like nvmem framework built on top of regmap. Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 06 5月, 2015 2 次提交
-
-
由 Kevin Cernekee 提交于
Existing regmap users call regcache_mark_dirty() as part of the suspend/resume sequence, to tell regcache that non-default values need to be resynced post-resume. Add an internal "no_sync_defaults" regmap flag to remember this state, so that regcache_sync() can differentiate between these two cases: 1) HW was reset, so any cache values that match map->reg_defaults can be safely skipped. On some chips there are a lot of registers in the reg_defaults list, so this optimization speeds things up quite a bit. 2) HW was not reset (maybe it was just clock-gated), so if we cached any writes, they should be sent to the hardware regardless of whether they match the HW default. Currently this will write out all values in the regcache, since we don't maintain per-register dirty bits. Suggested-by: NMark Brown <broonie@kernel.org> Signed-off-by: NKevin Cernekee <cernekee@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Kevin Cernekee 提交于
We're going to add another "does this register need syncing?" check, so rather than repeating it in three places, we'll separate all of the relevant logic into a helper function. Signed-off-by: NKevin Cernekee <cernekee@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 4月, 2015 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
The irq_domain_ops are not modified by the driver and the irqdomain core code accepts pointer to a const data. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 3月, 2015 2 次提交
-
-
由 Steven Rostedt 提交于
The tracing events for regmap are confined to the regmap subsystem. It also requires accessing an internal header. Instead of including the internal header from a generic file location, move the tracing file into the regmap directory. Also rename the regmap tracing header to trace.h, as it is redundant to keep the regmap.h name when it is in the regmap directory. Signed-off-by: NSteven Rostedt <rostedt@goodmis.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Philipp Zabel 提交于
This patch fixes a NULL pointer dereference when enabling regmap event tracing in the presence of a syscon regmap, introduced by commit bdb0066d ("mfd: syscon: Decouple syscon interface from platform devices"). That patch introduced syscon regmaps that have their dev field set to NULL. The regmap trace events expect it to point to a valid struct device and feed it to dev_name(): $ echo 1 > /sys/kernel/debug/tracing/events/regmap/enable Unable to handle kernel NULL pointer dereference at virtual address 0000002c pgd = 80004000 [0000002c] *pgd=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: coda videobuf2_vmalloc CPU: 0 PID: 304 Comm: kworker/0:2 Not tainted 4.0.0-rc2+ #9197 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) Workqueue: events_freezable thermal_zone_device_check task: 9f25a200 ti: 9f1ee000 task.ti: 9f1ee000 PC is at ftrace_raw_event_regmap_block+0x3c/0xe4 LR is at _regmap_raw_read+0x1bc/0x1cc pc : [<803636e8>] lr : [<80365f2c>] psr: 600f0093 sp : 9f1efd78 ip : 9f1efdb8 fp : 9f1efdb4 r10: 00000004 r9 : 00000001 r8 : 00000001 r7 : 00000180 r6 : 00000000 r5 : 9f00e3c0 r4 : 00000003 r3 : 00000001 r2 : 00000180 r1 : 00000000 r0 : 9f00e3c0 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5387d Table: 2d91004a DAC: 00000015 Process kworker/0:2 (pid: 304, stack limit = 0x9f1ee210) Stack: (0x9f1efd78 to 0x9f1f0000) fd60: 9f1efda4 9f1efd88 fd80: 800708c0 805f9510 80927140 800f0013 9f1fc800 9eb2f490 00000000 00000180 fda0: 808e3840 00000001 9f1efdfc 9f1efdb8 80365f2c 803636b8 805f8958 800708e0 fdc0: a00f0013 803636ac 9f16de00 00000180 80927140 9f1fc800 9f1fc800 9f1efe6c fde0: 9f1efe6c 9f732400 00000000 00000000 9f1efe1c 9f1efe00 80365f70 80365d7c fe00: 80365f3c 9f1fc800 9f1fc800 00000180 9f1efe44 9f1efe20 803656a4 80365f48 fe20: 9f1fc800 00000180 9f1efe6c 9f1efe6c 9f732400 00000000 9f1efe64 9f1efe48 fe40: 803657bc 80365634 00000001 9e95f910 9f1fc800 9f1efeb4 9f1efe8c 9f1efe68 fe60: 80452ac0 80365778 9f1efe8c 9f1efe78 9e93d400 9e93d5e8 9f1efeb4 9f72ef40 fe80: 9f1efeac 9f1efe90 8044e11c 80452998 8045298c 9e93d608 9e93d400 808e1978 fea0: 9f1efecc 9f1efeb0 8044fd14 8044e0d0 ffffffff 9f25a200 9e93d608 9e481380 fec0: 9f1efedc 9f1efed0 8044fde8 8044fcec 9f1eff1c 9f1efee0 80038d50 8044fdd8 fee0: 9f1ee020 9f72ef40 9e481398 00000000 00000008 9f72ef54 9f1ee020 9f72ef40 ff00: 9e481398 9e481380 00000008 9f72ef40 9f1eff5c 9f1eff20 80039754 80038bfc ff20: 00000000 9e481380 80894100 808e1662 00000000 9e4f2ec0 00000000 9e481380 ff40: 800396f8 00000000 00000000 00000000 9f1effac 9f1eff60 8003e020 80039704 ff60: ffffffff 00000000 ffffffff 9e481380 00000000 00000000 9f1eff78 9f1eff78 ff80: 00000000 00000000 9f1eff88 9f1eff88 9e4f2ec0 8003df30 00000000 00000000 ffa0: 00000000 9f1effb0 8000eb60 8003df3c 00000000 00000000 00000000 00000000 ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff Backtrace: [<803636ac>] (ftrace_raw_event_regmap_block) from [<80365f2c>] (_regmap_raw_read+0x1bc/0x1cc) r9:00000001 r8:808e3840 r7:00000180 r6:00000000 r5:9eb2f490 r4:9f1fc800 [<80365d70>] (_regmap_raw_read) from [<80365f70>] (_regmap_bus_read+0x34/0x6c) r10:00000000 r9:00000000 r8:9f732400 r7:9f1efe6c r6:9f1efe6c r5:9f1fc800 r4:9f1fc800 [<80365f3c>] (_regmap_bus_read) from [<803656a4>] (_regmap_read+0x7c/0x144) r6:00000180 r5:9f1fc800 r4:9f1fc800 r3:80365f3c [<80365628>] (_regmap_read) from [<803657bc>] (regmap_read+0x50/0x70) r9:00000000 r8:9f732400 r7:9f1efe6c r6:9f1efe6c r5:00000180 r4:9f1fc800 [<8036576c>] (regmap_read) from [<80452ac0>] (imx_get_temp+0x134/0x1a4) r6:9f1efeb4 r5:9f1fc800 r4:9e95f910 r3:00000001 [<8045298c>] (imx_get_temp) from [<8044e11c>] (thermal_zone_get_temp+0x58/0x74) r7:9f72ef40 r6:9f1efeb4 r5:9e93d5e8 r4:9e93d400 [<8044e0c4>] (thermal_zone_get_temp) from [<8044fd14>] (thermal_zone_device_update+0x34/0xec) r6:808e1978 r5:9e93d400 r4:9e93d608 r3:8045298c [<8044fce0>] (thermal_zone_device_update) from [<8044fde8>] (thermal_zone_device_check+0x1c/0x20) r5:9e481380 r4:9e93d608 [<8044fdcc>] (thermal_zone_device_check) from [<80038d50>] (process_one_work+0x160/0x3d4) [<80038bf0>] (process_one_work) from [<80039754>] (worker_thread+0x5c/0x4f4) r10:9f72ef40 r9:00000008 r8:9e481380 r7:9e481398 r6:9f72ef40 r5:9f1ee020 r4:9f72ef54 [<800396f8>] (worker_thread) from [<8003e020>] (kthread+0xf0/0x108) r10:00000000 r9:00000000 r8:00000000 r7:800396f8 r6:9e481380 r5:00000000 r4:9e4f2ec0 [<8003df30>] (kthread) from [<8000eb60>] (ret_from_fork+0x14/0x34) r7:00000000 r6:00000000 r5:8003df30 r4:9e4f2ec0 Code: e3140040 1a00001a e3140020 1a000016 (e596002c) ---[ end trace 193c15c2494ec960 ]--- Fixes: bdb0066d (mfd: syscon: Decouple syscon interface from platform devices) Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 08 3月, 2015 1 次提交
-
-
由 Lars-Peter Clausen 提交于
When inserting a new register into a block at the lower end the present bitmap is currently shifted into the wrong direction. The effect of this is that the bitmap becomes corrupted and registers which are present might be reported as not present and vice versa. Fix this by shifting left rather than right. Fixes: 472fdec7("regmap: rbtree: Reduce number of nodes, take 2") Reported-by: NDaniel Baluta <daniel.baluta@gmail.com> Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 05 3月, 2015 1 次提交
-
-
由 Takashi Iwai 提交于
regcache_sync() spews warnings when a value was cached for a read-only register as it tries to write all registers no matter whether they are writable or not. This patch adds regmap_wrtieable() checks for avoiding it in regcache_sync_block_single() and regcache_block_raw(). Signed-off-by: NTakashi Iwai <tiwai@suse.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 2月, 2015 1 次提交
-
-
由 Valentin Rothberg 提交于
Since commit 1c6c6952 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. The %irq_flags flag is used to request the threaded IRQ and is also a parameter of the caller. Hence, we cannot be sure that IRQF_ONESHOT is set. This change avoids the potentially missing flag by setting IRQF_ONESHOT when requesting the threaded IRQ. Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci Signed-off-by: NValentin Rothberg <Valentin.Rothberg@lip6.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 2月, 2015 2 次提交
-
-
由 Guenter Roeck 提交于
SMBus access functions assume that 16-bit values are formatted as little endian numbers. The direct i2c access functions in regmap, however, assume that 16-bit values are formatted as big endian numbers. As a result, the current code returns different values if an i2c chip's 16-bit registers are accessed through i2c access functions vs. SMBus access functions. Use regmap_smbus_read_word_swapped and regmap_smbus_write_word_swapped for 16-bit SMBus accesses if a chip is configured as REGMAP_ENDIAN_BIG. If the chip is configured as REGMAP_ENDIAN_LITTLE, keep using regmap_smbus_write_word_data and regmap_smbus_read_word_data. Otherwise reject registration if the controller does not support direct i2c accesses. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Guenter Roeck 提交于
We'll need to call it from regmap-i2c.c, which can be built as module. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 2月, 2015 1 次提交
-
-
由 Mark Brown 提交于
Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 12月, 2014 1 次提交
-
-
由 Wang, Yalin 提交于
This patch move struct regmap.spinlock_flags into the union of spinlock, so that we can shrink struct regmap size. Signed-off-by: NYalin Wang <yalin.wang@sonymobile.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 11月, 2014 1 次提交
-
-
由 Mark Brown 提交于
Use the recently added support for bus operations to provide a standard mapping for AC'97 register I/O. Signed-off-by: NMark Brown <broonie@kernel.org> Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
-
- 20 10月, 2014 6 次提交
-
-
由 Xiubo Li 提交于
If the inlcude headers aren't sorted alphabetically, then the logical choice is to append new ones, however that creates a lot of potential for conflicts or duplicates because every change will then add new includes in the same location. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Xiubo Li 提交于
When all the registers are volatile(unlikely, but logically and mostly will happen for some 'device' who has very few registers), then the count will be euqal to 0, then kmalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16). So this patch fix this with just doing the zero check before calling kmalloc(). If the count == 0, so we can make sure that all the registers are volatile, so no cache is need. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Xiubo Li 提交于
This patch fixes checkpatch.pl warning for regmap cache. WARNING : prefer kmalloc_array over kmalloc with multiply Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Xiubo Li 提交于
This may speed regcache_hw_init() up for some cases that there has volatile registers. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Xiubo Li 提交于
When kmalloc() fails, we should return -ENOMEM. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Xiubo Li 提交于
Remove the redundant code for regmap cache. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 10月, 2014 1 次提交
-
-
由 Xiubo Li 提交于
When kmalloc() fails, we should return -ENOMEM. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 9月, 2014 1 次提交
-
-
由 Markus Pargmann 提交于
The macro "REGMAP_ALLOW_WRITE_DEBUGFS" can be used to enable write support on the registers file in the debugfs. The mode of the file is fixed to 0400 so it is not possible to write the file ever. This patch fixes the mode by setting it to the correct value depending on the macro. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 9月, 2014 2 次提交
-
-
由 Xiubo Li 提交于
Since we cannot make sure the 'val_count' will always be none zero here, and then if it equals to zero, the kmemdup() will return ZERO_SIZE_PTR, which equals to ((void *)16). So this patch fix this with just doing the zero check before calling kmemdup(). Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
由 Xiubo Li 提交于
If 'map->dev' is NULL and there will lead dev_name() to be NULL pointer dereference. So before dev_name(), we need to have check of the map->dev pionter. We also should make sure that the 'name' pointer shouldn't be NULL for debugfs_create_dir(). So here using one default "dummy" debugfs name when the 'name' pointer and 'map->dev' are both NULL. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 27 9月, 2014 1 次提交
-
-
由 Pankaj Dubey 提交于
If LOG_DEVICE is defined and map->dev is NULL it will lead to NULL pointer dereference. This patch fixes this issue by adding check for dev->NULL in all such places in regmap.c Signed-off-by: NPankaj Dubey <pankaj.dubey@samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 19 9月, 2014 1 次提交
-
-
由 Pankaj Dubey 提交于
Recents commits for getting reg endianness causing NULL pointer dereference if dev is passed NULL in regmap_init_mmio. This patch fixes this issue, and allows to parse reg endianness only if dev and dev->of_node exist. Signed-off-by: NPankaj Dubey <pankaj.dubey@samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 9月, 2014 1 次提交
-
-
由 Jarkko Nikula 提交于
Call stack of regcache_sync calls may not emit any error message even if operation was cancelled due an error in I/O driver. One such a silent error is for instance if I2C bus driver doesn't receive ACK from the I2C device and returns -EREMOTEIO. Since many users of regcache_sync() don't check and print the error there is no any indication that HW registers are potentially out of sync. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 9月, 2014 1 次提交
-
-
由 Wang, Yalin 提交于
this patch change struct regmap->mutex and struct regmap->spinlock as an union, because these 2 members are only used one of them, we change it to shrink the struct size. Signed-off-by: NYalin Wang <yalin.wang@sonymobile.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 9月, 2014 1 次提交
-
-
由 Markus Pargmann 提交于
The macro "REGMAP_ALLOW_WRITE_DEBUGFS" can be used to enable write support on the registers file in the debugfs. The mode of the file is fixed to 0400 so it is not possible to write the file ever. This patch fixes the mode by setting it to the correct value depending on the macro. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-