summaryrefslogtreecommitdiff
path: root/drivers/base/regmap
AgeCommit message (Collapse)Author
2014-04-11Merge tag 'regmap-v3.15-nodev' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "regmap: Fix for nodev mode Add mising braces so that the nodev mode actually works (which was a bit of an oversight)" Testing schmesting. We don't need not steenking testing. We have deadlines to beat, and new code to write. * tag 'regmap-v3.15-nodev' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: adds missing braces in regmap_init()
2014-04-01Merge tag 'driver-core-3.15-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core and sysfs updates from Greg KH: "Here's the big driver core / sysfs update for 3.15-rc1. Lots of kernfs updates to make it useful for other subsystems, and a few other tiny driver core patches. All have been in linux-next for a while" * tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (42 commits) Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()" kernfs: cache atomic_write_len in kernfs_open_file numa: fix NULL pointer access and memory leak in unregister_one_node() Revert "driver core: synchronize device shutdown" kernfs: fix off by one error. kernfs: remove duplicate dir.c at the top dir x86: align x86 arch with generic CPU modalias handling cpu: add generic support for CPU feature based module autoloading sysfs: create bin_attributes under the requested group driver core: unexport static function create_syslog_header firmware: use power efficient workqueue for unloading and aborting fw load firmware: give a protection when map page failed firmware: google memconsole driver fixes firmware: fix google/gsmi duplicate efivars_sysfs_init() drivers/base: delete non-required instances of include <linux/init.h> kernfs: fix kernfs_node_from_dentry() ACPI / platform: drop redundant ACPI_HANDLE check kernfs: fix hash calculation in kernfs_rename_ns() kernfs: add CONFIG_KERNFS sysfs, kobject: add sysfs wrapper for kernfs_enable_ns() ...
2014-04-01Merge tag 'char-misc-3.15-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver patches from Greg KH: "Here's the big char/misc driver updates for 3.15-rc1. Lots of various things here, including the new mcb driver subsystem. All of these have been in linux-next for a while" * tag 'char-misc-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (118 commits) extcon: Move OF helper function to extcon core and change function name extcon: of: Remove unnecessary function call by using the name of device_node extcon: gpio: Use SIMPLE_DEV_PM_OPS macro extcon: palmas: Use SIMPLE_DEV_PM_OPS macro mei: don't use deprecated DEFINE_PCI_DEVICE_TABLE macro mei: amthif: fix checkpatch error mei: client.h fix checkpatch errors mei: use cl_dbg where appropriate mei: fix Unnecessary space after function pointer name mei: report consistently copy_from/to_user failures mei: drop pr_fmt macros mei: make me hw headers private to me hw. mei: fix memory leak of pending write cb objects mei: me: do not reset when less than expected data is received drivers: mcb: Fix build error discovered by 0-day bot cs5535-mfgpt: Simplify dependencies spmi: pm: drop bus-level PM suspend/resume routines spmi: pmic_arb: make selectable on ARCH_QCOM Drivers: hv: vmbus: Increase the limit on the number of pfns we can handle pch_phub: Report error writing MAC back to user ...
2014-04-01regmap: adds missing braces in regmap_init()Daeseok Youn
It need to add curly braces because the inner for "if" has two statements. coccicheck says: drivers/base/regmap/regmap.c:765:2-44: code aligned with following code on line 766 Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-28Merge remote-tracking branches 'regmap/topic/cache', 'regmap/topic/irq', ↵Mark Brown
'regmap/topic/lock', 'regmap/topic/mmio', 'regmap/topic/nodev', 'regmap/topic/parse-val' and 'regmap/topic/patch' into regmap-next
2014-03-28Merge remote-tracking branch 'regmap/topic/core' into regmap-nextMark Brown
2014-03-28regmap: mmio: Add regmap_mmio_regbits_check.Xiubo Li
Fix the support for 1/2/8 bytes wide register address checking. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-27regmap: mmio: Add support for 1/2/8 bytes wide register address.Xiubo Li
Since regmap core and mmio have already support for 1/2/8 bytes wide values, so adds support for 1/2/8 bytes wide registers address. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-27regmap: mmio: add regmap_mmio_{regsize, count}_check.Xiubo Li
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-19regmap: cache: Don't attempt to sync non-writeable registersDylan Reid
In the regcache_default_sync, if a register isn't writeable, then _regmap_write will return an error and the rest of the sync will be aborted. Avoid this by checking if a register is writeable before trying to sync it. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-19regmap: cache: Step by stride in default syncDylan Reid
The default sync operation was still assuming a stride of one, fix it to respect the reg_stride set in the map. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18regmap: Fix possible sleep-in-atomic in regmap_bulk_write()Takashi Iwai
regmap deploys the spinlock for the protection when set up in fast_io mode. This may lead to sleep-in-atomic by memory allocation with GFP_KERNEL in regmap_bulk_write(). This patch fixes it by moving the allocation out of the lock. [Fix excessively large locked region -- broonie] Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18regmap: Ensure regmap_register_patch() is compatible with fast_ioMark Brown
With fast_io we use mutexes to lock the I/O operations so we would need to do GFP_ATOMIC allocations if we wanted to do allocations inside the lock as we do currently. Since it is unlikely that we will want to register a patch outside of init where concurrency shouldn't be an issue move the allocation of the patch data outside the lock. Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13regmap: irq: Set data pointer only on regmap_add_irq_chip successKrzysztof Kozlowski
After setting the 'data' pointer (wchich is returned to the caller for freeing later) the regmap_add_irq_chip() could still fail for various reasons (ENOMEM, regmap_read or regmap_write failure). In such case the memory under 'data' was freed in error path and error value was returned but the 'data' variable was not changed. This could lead to errors if the caller passed such 'data' to regmap_del_irq_chip(). The 'data' pointer should be changed atomically from the caller perspective - set it only on regmap_add_irq_chip() success. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10regmap: Implementation for regmap_multi_reg_writeOpensource [Anthony Olech]
This is the implementation of regmap_multi_reg_write() There is a new capability 'can_multi_write' that device drivers must set in order to use this multi reg write mode. This replaces the first definition, which just defined the API. Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06regmap: add regmap_parse_val apiNenghua Cao
In some cases, we need regmap's format parse_val function to do be/le translation according to the bus configuration. For example, snd_soc_bytes_put() uses regmap to write/read values, and use cpu_to_be() directly to covert MASK into big endian. This is a defect, and should use regmap's format function to do it according to bus configuration. Signed-off-by: Nenghua Cao <nhcao@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26regmap: Base regmap_register_patch on _regmap_multi_reg_writeCharles Keepax
Since we now have an internal version of regmap_multi_reg_write use this to apply the register patch. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26regmap: Add bypassed version of regmap_multi_reg_writeCharles Keepax
Devices with more complex boot proceedures may occasionally apply the register patch manual. regmap_multi_reg_write is a logical way to do so, however the patch must be applied with cache bypass on, such that it doesn't override any user settings. This patch adds a regmap_multi_reg_write_bypassed function that applies a set of writes with the bypass enabled. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26regmap: Mark reg_defaults in regmap_multi_reg_write as constCharles Keepax
There should be no need for the writes supplied to this function to be edited by it so mark them as const. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22regmap: fix coccinelle warningsNenghua Cao
/drivers/base/regmap/regmap.c:717:6-33: WARNING: Comparison to bool. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Nenghua Cao <nhcao@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22regmap: Check stride of register patch as we register itCharles Keepax
Currently, we check the registers in the patch are aligned to the register stride everytime we sync the cache and the first time the patch is written out is unchecked. This patch checks the register patch when we first register it so the first writes are no longer unchecked and then doesn't check on subsequent syncs as the patch will be unchanged. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20regmap: Clean up _regmap_update_bits()Xiubo Li
Since sometimes the 'config' parameter has no use, it should be NULL. And make the code simplifier. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-16regmap: Separate regmap dev initializationMichal Simek
Create special function regmap_attach_dev which can be called separately out of regmap_init. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-15regmap: spmi: support base and extended register spacesJosh Cartwright
SPMI states that a slave may contain two register spaces, the Base register space is a 5-bit byte-addressable space accessed via the Register Read/Write and Register Zero Write command sequences, and the Extended register space: a 16-bit byte-addressable space accessed via the Extended Read/Write and Extended Read/Write Long command sequences. Provide support for accessing both of these spaces, taking advantage of the more bandwidth-efficient commands ('Register 0 Write' vs 'Register Write', and 'Extended Register Read/Write' vs 'Extended Register Read/Write Long') when possible. Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14drivers/base: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: Len Brown <len.brown@intel.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11regmap: Check readable regs in _regmap_readMichal Simek
Check if regs are readable. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03regmap: irq: Remove domain on exitMark Brown
irqdomain now supports removal of domains on exit so we can properly clean up on deletion of a regmap irqchip. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03regmap: debugfs: "registers" & "access" for single register mapsPawel Moll
When a map covers a single register, max_register is equal to 0, so the "registers" & "access" files were not created. Now they will be, as register 0 must be readable for such map to make sense. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-27regmap: cache: Handle stride > 1 in sync_block_raw_flushDylan Reid
regcache_sync_block_raw_flush takes the address of the base register and the address of one past the last register to write to. "count" is the number of registers in the range, not the number of bytes, it should be (end addr - start addr) / stride. Without accounting for strides greater than one, registers past the end might be synced or the writeable_reg callback at the beginning of _regmap_raw_write will fail and nothing will be written. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09Merge remote-tracking branch 'regmap/topic/ack' into regmap-nextMark Brown
2013-12-30regmap: Allow regmap_bulk_write() to work for "no-bus" regmapsStephen Boyd
regmap_bulk_write() should decay to performing individual writes if we're using a "no-bus" regmap. Unfortunately, it returns an error because there is no map->bus pointer. Fix it. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-30Merge tag 'v3.13-rc4' into regmap-coreMark Brown
Needed as a subsequent patch is built on some of the fixes. Linux 3.13-rc4
2013-12-16regmap: Allow regmap_bulk_read() to work for "no-bus" regmapsStephen Boyd
regmap_bulk_read() should decay to performing individual reads if we're using a "no-bus" regmap. Unfortunately, it returns an error because there is no map->bus pointer. Fix it. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16regmap: irq: Allow using zero value for ack_baseAlexander Shiyan
In some cases, clear interrupt register may be at address 0. This patch allows to use such configurations by adding additional configuration bit to indicate this. [With doc fix from Levente Kurusa <levex@linux.com> -- broonie] Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-26Merge remote-tracking branches 'regmap/fix/doc' and 'regmap/fix/mmio' into ↵Mark Brown
regmap-linus
2013-11-26regmap: use IS_ERR() to check clk_get() resultsStephen Warren
clk_get() returns an error pointer, or a valid token to pass back to the clock API. Hence, the result must be checked with IS_ERR(), not by comparison against NULL. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-24regmap: Fix 'ret' would return an uninitialized valueCai Zhiyong
This patch give a warning when calling regmap_register_patch with parameter num_regs <= 0. When the num_regs parameter is zero and krealloc doesn't fail, then the code would return an uninitialized value. However, calling this function with num_regs == 0, would be a waste as it essentially does nothing. Signed-off-by: Cai Zhiyong <caizhiyong@huawei.com> Reviewed-by: Geyslan G. Bem <geyslan@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-21regmap: make sure we unlock on failure in regmap_bulk_writeCourtney Cavin
Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-12regmap: trivial comment fix (copy'n'paste error)Gerhard Sittig
fix a trivial copy'n'paste error in the regmap kerneldoc, s/write/read/ for the regmap_read(), regmap_raw_read() and regmap_bulk_read() routines Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-28Merge remote-tracking branch 'regmap/topic/spmi' into regmap-nextMark Brown
2013-10-28Merge remote-tracking branch 'regmap/topic/multi' into regmap-nextMark Brown
2013-10-28Merge remote-tracking branch 'regmap/topic/irq' into regmap-nextMark Brown
2013-10-28Merge remote-tracking branch 'regmap/topic/field' into regmap-nextMark Brown
2013-10-28Merge remote-tracking branch 'regmap/topic/core' into regmap-nextMark Brown
2013-10-28regmap: add SPMI supportJosh Cartwright
Add basic support for the System Power Management Interface (SPMI) bus. This is a simple implementation which only implements register accesses via the Extended Register Read/Write Long commands. Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-24regmap: debugfs: Fix a boot time crash with early regmap initTero Kristo
If called early enough, regmap_debugfs_init causes a crash, if the fs subsystem does not have its mount cache created yet. Even if this would work, the root node for the regmap debugfs is still missing, thus postpone the regmap_debugfs_init in this case until the root node is created. A special regmap_debugfs_early list is created for this purpose which is parsed later in the boot. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-22regmap: irq: clear status when disable irqYi Zhang
clear the status bit if the mask register doesn't prevent the chip level irq from being asserted OR in the following sequence, there will be irq storm happens: 1) interrupt is triggered; 2) another thread disables it(the mask bit is set); 3) _Then_ the interrupt thread is not ACKed(the status bit is not cleared), and it's ignored; 4) if the irq is still asserted because of the uncleared status bit, the irq storm happens; Signed-off-by: Yi Zhang <yizhang@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-14regmap: Only send a single buffer for async I/O if writing one registerMark Brown
Extend the interface for async I/O by allowing the value buffer to be omitted and sending the value as part of the register buffer, minimising the number of separate hardware operations required. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-14regmap: spi: Handle async writes of only one bufferMark Brown
If the value is zero then assume it has been included in the register data and don't send anything, minimising the number of interactions with the hardware. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-14regmap: new API regmap_multi_reg_write() definitionAnthony Olech
New API regmap_multi_reg_write() is defined that allows a set of reg,val pairs to be written to a I2C client device as one block transfer from the point of view of a single I2C master system. A simple demonstration implementation is included that just splits the block write request into a sequence of single register writes. The implementation will be modified later to support those I2C clients that implement the alternative non-standard MULTIWRITE block write mode so to achieve a single I2C transfer that will be atomic even in multiple I2C master systems. Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com> Signed-off-by: David Dajun Chen <david.chen@diasemi.com> Signed-off-by: Mark Brown <broonie@linaro.org>