summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'regmap-v3.9-rc1' of ↵Linus Torvalds2013-03-071-0/+1
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap PM fix from Mark Brown: "A simple fix to stop us leaking a runtime PM reference in the case where we fail to enable a device." * tag 'regmap-v3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: irq: call pm_runtime_put in pm_runtime_get_sync failed case
| * regmap: irq: call pm_runtime_put in pm_runtime_get_sync failed caseLi Fei2013-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value and runtime power management to behave correctly, call pm_runtime_put(_sync) in such case. Signed-off-by Liu Chuansheng <chuansheng.liu@intel.com> Signed-off-by: Li Fei <fei.li@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge tag 'modules-next-for-linus' of ↵Linus Torvalds2013-02-251-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull module update from Rusty Russell: "The sweeping change is to make add_taint() explicitly indicate whether to disable lockdep, but it's a mechanical change." * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: MODSIGN: Add option to not sign modules during modules_install MODSIGN: Add -s <signature> option to sign-file MODSIGN: Specify the hash algorithm on sign-file command line MODSIGN: Simplify Makefile with a Kconfig helper module: clean up load_module a little more. modpost: Ignore ARC specific non-alloc sections module: constify within_module_* taint: add explicit flag to show whether lock dep is still OK. module: printk message when module signature fail taints kernel.
| * taint: add explicit flag to show whether lock dep is still OK.Rusty Russell2013-01-211-1/+1
| | | | | | | | | | | | | | Fix up all callers as they were before, with make one change: an unsigned module taints the kernel, but doesn't turn off lockdep. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* | Merge remote-tracking branch 'regmap/topic/no-bus' into regmap-nextMark Brown2013-02-142-12/+48
|\ \
| * | regmap: Add "no-bus" option for regmap APIAndrey Smirnov2013-01-292-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds provision for "no-bus" usage of the regmap API. In this configuration user can provide API with two callbacks 'reg_read' and 'reg_write' which are to be called when reads and writes to one of device's registers is performed. This is useful for devices that expose registers but whose register access sequence does not fit the 'bus' abstraction. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | Merge remote-tracking branch 'regmap/topic/mmio' into regmap-nextMark Brown2013-02-141-13/+66
|\ \ \
| * | | regmap: mmio: add register clock supportPhilipp Zabel2013-02-141-13/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some mmio devices have a dedicated interface clock that needs to be enabled to access their registers. This patch optionally enables a clock before accessing registers in the regmap_bus callbacks. I added (devm_)regmap_init_mmio_clk variants of the init functions that have an added clk_id string parameter. This is passed to clk_get to request the clock from the clk framework. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | Merge remote-tracking branch 'regmap/topic/irq' into regmap-nextMark Brown2013-02-141-26/+99
|\ \ \ \
| * | | | regmap: irq: Support wake IRQ mask inversionMark Brown2013-01-041-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support devices which have an enable rather than mask register for wake sources. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: irq: Fix sync of wake statuses to hardwareMark Brown2013-01-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wasn't implemented but happened to work on test systems due to lack of wake mask inversion support. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: irq: Use a bulk read for interrupt status where possibleMark Brown2013-01-041-7/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the interrupt status registers are a single block of registers and the chip supports bulk reads then do a single bulk read rather than pay the extra I/O cost. This restores the original behaviour which was lost when support for register striding was added. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: irq: Factor register read out of the IRQ parsing loopMark Brown2013-01-031-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for adding back support for block reads. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: irq: enable wake support by defaultLaxman Dewangan2012-12-241-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap-irq framework is used vastly by mfd drivers and some of devices like TPS65910, TPS80036 do not support the wake base register to enable wake. Currently wake in regmap-irq only supported if client driver passes the wake base register. As the regmap-irq is mostly used by mfd devices and it is require to have wake support from these devices in most of use cases, enabling wake support by default in regmap-irq. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | | Merge remote-tracking branch 'regmap/topic/flat' into regmap-nextMark Brown2013-02-144-1/+75
|\ \ \ \ \
| * | | | | regmap: flat: Add flat cache typeMark Brown2013-01-024-1/+75
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While for I2C and SPI devices the overhead of using rbtree for devices with only one block of registers is negligible the same isn't always going to be true for MMIO devices where the I/O costs are very much lower. Cater for these devices by adding a simple flat array type for them where the lookups are simple array accesses, taking us right back to the original ASoC cache implementation. Thanks to Magnus Damm for the discussion which prompted this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | | Merge remote-tracking branch 'regmap/topic/debugfs' into regmap-nextMark Brown2013-02-142-18/+33
|\ \ \ \ \
| * | | | | regmap: debugfs: Factor out debugfs_tot_len calc into a functionDimitris Papastamos2013-02-111-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation to support the regmap debugfs ranges functionality factor this code out to a separate function. We'll need to ensure that the value has been correctly calculated from two separate places in the code. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: debugfs: Optimize seeking within blocks of registersDimitris Papastamos2013-02-111-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize this so that we can better guess where to start scanning from. We know the length of the register field format, therefore given the file pointer position align to the nearest register field and scan from there onwards. We round down in this calculation and we let the rest of the code figure out where to start scanning from. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: debugfs: Add a `max_reg' member in struct regmap_debugfs_off_cacheDimitris Papastamos2013-02-112-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are keeping track of the maximum register as well, this will make things easier for us in sharing this code with the code implementing the register ranges functionality. It also simplifies a bit the calculations when looking for the relevant block:offset from within the cache. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: debugfs: Fix reading in register field unitsDimitris Papastamos2013-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, if the length of the register field format is N bytes, we can only get anything meaningful back to userspace by providing a buffer that is N + 2 bytes large. Fix this so we that we only need to provide a buffer of N bytes. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: regmap: avoid spurious warning in regmap_read_debugfsRussell King2013-01-271-4/+2
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gcc warns about the case where regmap_read_debugfs tries to walk an empty map->debugfs_off_cache list, which would results in uninitialized variable getting returned, if we hadn't checked the same condition just before that. After an originally suggested inferior patch from Arnd Bergmann, this is the solution that Russell King came up with, sidestepping the problem by merging the error case for an empty list with the normal path. Without this patch, building mxs_defconfig results in: drivers/base/regmap/regmap-debugfs.c: In function 'regmap_read_debugfs': drivers/base/regmap/regmap-debugfs.c:147:9: : warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Reported-by: Vincent Stehle <v-stehle@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | | Merge remote-tracking branch 'regmap/topic/async' into regmap-nextMark Brown2013-02-143-47/+326
|\ \ \ \ \
| * | | | | regmap: spi: Handle allocation failures gracefullyMark Brown2013-02-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: Export regmap_async_complete()Mark Brown2013-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: Export regmap_async_complete_cbAxel Lin2013-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: include linux/sched.h to fix buildStephen Warren2013-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: spi: Support asynchronous I/O for SPIMark Brown2013-01-291-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | | regmap: Add asynchronous I/O supportMark Brown2013-01-292-10/+187
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some use cases like firmware download can transfer a lot of data in quick succession. With high speed buses these use cases can benefit from having multiple transfers scheduled at once since this allows the bus to minimise the delay between transfers. Support this by adding regmap_raw_write_async(), allowing raw transfers to be scheduled, and regmap_async_complete() to wait for them to finish. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: Add provisions to have user-defined write operationAndrey Smirnov2013-01-142-29/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a preparatory commit to provide "no-bus" configuration option for regmap API. It adds necessary plumbing needed to have the ability to provide user define register write function. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | | | regmap: Add provisions to have user-defined read operationAndrey Smirnov2013-01-142-9/+28
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a preparatory commit to provide "no-bus" configuration option for regmap API. It adds necessary plumbing needed to have the ability to provide user define register read function. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | Merge remote-tracking branch 'regmap/topic/24bit' into regmap-nextMark Brown2013-02-141-0/+6
|\ \ \ \ | |_|/ / |/| | |
| * | | regmap: Add support for 24 bit wide register addressesLars-Peter Clausen2013-01-121-0/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | Since regmap already has support for formatting 24 bit wide values, so adding support for 24 bit wide registers is pretty much straight forward. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | Merge remote-tracking branch 'regmap/fix/debugfs' into tmpMark Brown2013-01-241-2/+0
|\ \ \
| * | | regmap: debugfs: Fix seeking from the cacheMark Brown2013-01-171-2/+0
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | We don't want to bomb out early if we failed to get the cache any more, just soldier on instead and we won't get confused and always return the first block. Reported-by: Philipp Zabel <p.zabel@pengutronix.de Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | regmap: fix small typo in regmap_bulk_write commentNestor Ovroy2013-01-221-1/+1
|/ / | | | | | | | | Signed-off-by: Nestor Ovroy <novroy@riseup.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regmap: debugfs: Make sure we store the last entry in the offset cacheMark Brown2013-01-081-0/+9
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regmap: debugfs: Ensure a correct return value for empty cachesMark Brown2013-01-081-0/+10
| | | | | | | | | | | | This should never happen in the real world. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regmap: debugfs: Discard the cache if we fail to allocate an entryMark Brown2013-01-081-11/+18
| | | | | | | | | | | | | | | | Rather than trying to soldier on with a partially allocated cache just throw the cache away and pretend we don't have one in case we can get a full cache next time around. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regmap: debugfs: Fix check for block start in cached seeksMark Brown2013-01-081-1/+1
| | | | | | | | | | | | | | Check for the block we were asked to start from, not the position we're in. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regmap: debugfs: Fix attempts to read nonexistant register blocksMark Brown2013-01-081-1/+2
|/ | | | | | | | Return the start of the last block we tried to read rather than a position, and also make sure we update the byte position while we're at it. Without this reads that go into nonexistant areas get confused. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge remote-tracking branch 'regmap/topic/type' into regmap-nextMark Brown2012-12-111-1/+1
|\
| * regmap: silence GCC warningPaul Bolle2012-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Building regmap.o triggers this GCC warning: drivers/base/regmap/regmap.c: In function ‘regmap_raw_read’: drivers/base/regmap/regmap.c:1172:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] Long story short: Jakub Jelinek pointed out that there is a type mismatch between 'num' in regmap_volatile_range() and 'val_count' in regmap_raw_read(). And indeed, converting 'num' to the type of 'val_count' (ie, size_t) makes this warning go away. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge remote-tracking branch 'regmap/topic/table' into regmap-nextMark Brown2012-12-112-0/+50
|\ \
| * | regmap: introduce tables for readable/writeable/volatile/precious checksDavide Ciminaghi2012-11-212-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the regmap enabled drivers implementing one or more of the readable, writeable, volatile and precious methods use the same code pattern: return ((reg >= X && reg <= Y) || (reg >= W && reg <= Z) || ...) Switch to a data driven approach, using tables to describe readable/writeable/volatile and precious registers ranges instead. The table based check can still be overridden by passing the usual function pointers via struct regmap_config. Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | Merge branch 'topic/lock' of ↵Mark Brown2012-11-212-30/+39
| |\ \ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-table
| | \ \
| | \ \
| *-. \ \ Merge branches 'topic/core' and 'topic/range' of ↵Mark Brown2012-11-213-53/+155
| |\ \ \ \ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-table
* | \ \ \ \ Merge remote-tracking branch 'regmap/topic/lock' into regmap-nextMark Brown2012-12-112-30/+39
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | |
| * | | | | regmap: make lock/unlock functions customizableDavide Ciminaghi2012-10-172-30/+39
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is sometimes convenient for a regmap user to override the standard regmap lock/unlock functions with custom functions. For instance this can be useful in case an already existing spinlock or mutex has to be used for locking a set of registers instead of the internal regmap spinlock/mutex. Note that the fast_io field of struct regmap_bus is ignored in case custom locking functions are used. Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | | Merge remote-tracking branch 'regmap/topic/domain' into regmap-nextMark Brown2012-12-111-0/+19
|\ \ \ \ \
OpenPOWER on IntegriCloud