summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
Commit message (Collapse)AuthorAgeFilesLines
...
| * | regmap: cache: To suppress the noise of checkpatchXiubo Li2015-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There will be some warning like the following when checking new patches near this code: "WARNING: Missing a blank line after declarations" This patch will suppress this warning. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: fix the warning about unused variableXiubo Li2015-12-091-0/+2
| | | | | | | | | | | | | | | | | | | | | The variable 'u64 *u64' should be only visible on 64-BIT platform. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: add 64-bit mode supportXiubo Li2015-12-081-0/+99
| |/ | | | | | | | | | | | | | | Since the mmio has support the 64-bit has been supported for the 64-bit platform, so should the regmap core too. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge remote-tracking branch 'regmap/topic/core' into regmap-nextMark Brown2016-01-055-22/+24
|\ \
| * | regmap: use IS_ALIGNED instead of % to improve the performanceXiubo Li2015-12-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | The stride value should always equal to 2^n, so we can use bit rotation instead of % to improve the performance. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: replace kmalloc with kmalloc_arraylixiubo2015-11-203-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | Replace kmalloc with specialized function kmalloc_array when the size is a multiplication of : number * size Signed-off-by: lixiubo <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: replace kzalloc with kcalloclixiubo2015-11-204-8/+9
| |/ | | | | | | | | | | | | | | Replace kzalloc with specialized function kcalloc when the size is a multiplication of : number * sizeof Signed-off-by: lixiubo <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regmap: cache: Move the num_reg_defaults check as early as possibleXiubo Li2015-12-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | If the register defaults are provided by the driver without the number by mistake, it should just return an error with one promotion. This should be as early as possible, then there is no need to verify the register defaults' stride and the other code followed. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regmap: cache: Add warning info for the cache checkXiubo Li2015-12-121-4/+8
|/ | | | | | | | | If there is no cache used for the drivers, the register defaults or the register defaults raw are not need any more. This patch will check this and print a warning. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'driver-core-4.4-rc1' of ↵Linus Torvalds2015-11-043-17/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here's the "big" driver core updates for 4.4-rc1. Primarily a bunch of debugfs updates, with a smattering of minor driver core fixes and updates as well. All have been in linux-next for a long time" * tag 'driver-core-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: debugfs: Add debugfs_create_ulong() of: to support binding numa node to specified device in devicetree debugfs: Add read-only/write-only bool file ops debugfs: Add read-only/write-only size_t file ops debugfs: Add read-only/write-only x64 file ops debugfs: Consolidate file mode checks in debugfs_create_*() Revert "mm: Check if section present during memory block (un)registering" driver-core: platform: Provide helpers for multi-driver modules mm: Check if section present during memory block (un)registering devres: fix a for loop bounds check CMA: fix CONFIG_CMA_SIZE_MBYTES overflow in 64bit base/platform: assert that dev_pm_domain callbacks are called unconditionally sysfs: correctly handle short reads on PREALLOC attrs. base: soc: siplify ida usage kobject: move EXPORT_SYMBOL() macros next to corresponding definitions kobject: explain what kobject's sd field is debugfs: document that debugfs_remove*() accepts NULL and error values debugfs: Pass bool pointer to debugfs_create_bool() ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'
| * debugfs: Pass bool pointer to debugfs_create_bool()Viresh Kumar2015-10-043-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument, when all it needs is a boolean pointer. It would be better to update this API to make it accept 'bool *' instead, as that will make it more consistent and often more convenient. Over that bool takes just a byte. That required updates to all user sites as well, in the same commit updating the API. regmap core was also using debugfs_{read|write}_file_bool(), directly and variable types were updated for that to be bool as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| |
| \
| \
| \
*---. \ Merge remote-tracking branches 'regmap/topic/atomic', 'regmap/topic/debugfs' ↵Mark Brown2015-10-123-14/+22
|\ \ \ \ | | | |/ | | | | | | | | and 'regmap/topic/irq-hdr' into regmap-next
| | * | regmap: debugfs: simplify regmap_reg_ranges_read_file() slightlyRasmus Villemoes2015-09-301-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By printing the newline character to entry, we can avoid accounting for it manually in several places. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: debugfs: use memcpy instead of snprintfRasmus Villemoes2015-09-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we know the length of entry and that there's room enough in the output buffer, using memcpy instead of snprintf is simpler and cheaper. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: debugfs: use snprintf return value in regmap_reg_ranges_read_file()Rasmus Villemoes2015-09-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling strlen() no less than three times on entry is silly. Since we're formatting into a buffer with plenty of room, there's no chance of truncation, so snprintf() has actually returned the value we want, meaning we don't even have to call strlen once. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: debugfs: Remove scratch buffer for register length calculationMark Brown2015-09-191-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we no longer use the scratch buffer for register length calculation there is no need for callers to supply one. Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | regmap: Allocate buffers with GFP_ATOMIC when fast_io == trueStephen Boyd2015-09-142-1/+12
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | If a regmap is using fast_io, allocate the scratch buffer in regmap_bulk_write() with GFP_ATOMIC instead of GFP_KERNEL. Otherwise we may schedule while atomic. Reported-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'regmap-offload-update-bits' into regmap-nextMark Brown2015-10-122-11/+20
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap: Allow buses to provide a custom update_bits() operation Some buses provide a native _update_bits() operation which for uncached registers is faster than doing a read/modify/write cycle as it is a single bus transaction. Add support for implementing this to regmap. # gpg: Signature made Tue 06 Oct 2015 16:21:47 BST using RSA key ID 5D5487D0 # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: key 00000000 occurs more than once in the trustdb # gpg: key 16005C11: no public key for trusted key - skipped # gpg: key 16005C11 marked as ultimately trusted # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
| * | | regmap: Allow installing custom reg_update_bits functionJon Ringle2015-10-062-11/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows installing a custom reg_update_bits function for cases where the hardware provides a mechanism to set or clear register bits without a read/modify/write cycle. Such is the case with the Microchip ENCX24J600. If a custom reg_update_bits function is provided, it will only be used against volatile registers. Signed-off-by: Jon Ringle <jringle@gridpoint.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'regmap-irq-unmask' into regmap-nextMark Brown2015-10-121-5/+38
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap: Support for split mask and unmask interrupt registers This branch adds an interface for supporting devices which have separate mask and unmask registers. # gpg: Signature made Thu 17 Sep 2015 11:52:20 BST using RSA key ID 5D5487D0 # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: key 00000000 occurs more than once in the trustdb # gpg: key 16005C11: no public key for trusted key - skipped # gpg: key 16005C11 marked as ultimately trusted # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
| * | regmap: irq: add ack_invert flag for chips using cleared bits as ackGuo Zeng2015-09-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | An user will be CSR SiRFSoC ARM chips. Signed-off-by: Guo Zeng <Guo.Zeng@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: irq: add support for chips who have separate unmask registersGuo Zeng2015-09-171-3/+28
| |/ | | | | | | | | | | | | | | | | | | | | | | Some chips have separate unmask registers from mask registers for some consideration of concurrency SMP write performance. And this patch adds a flag for it. An user will be CSR SiRFSoC ARM chips. Signed-off-by: Guo Zeng <Guo.Zeng@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regmap: debugfs: Don't bother actually printing when calculating max lengthMark Brown2015-09-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The in kernel snprintf() will conveniently return the actual length of the printed string even if not given an output beffer at all so just do that rather than relying on the user to pass in a suitable buffer, ensuring that we don't need to worry if the buffer was truncated due to the size of the buffer passed in. Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | regmap: debugfs: Ensure we don't underflow when printing access masksMark Brown2015-09-191-1/+1
|/ | | | | | | | | | | If a read is attempted which is smaller than the line length then we may underflow the subtraction we're doing with the unsigned size_t type so move some of the calculation to be additions on the right hand side instead in order to avoid this. Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
*-. Merge remote-tracking branches 'regmap/topic/lockdep' and ↵Mark Brown2015-09-047-219/+168
|\ \ | | | | | | | | | 'regmap/topic/seq-delay' into regmap-next
| | * regmap: Apply optional delay in multi_reg_write/register_patchNariman Poushin2015-07-161-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an optional delay_us field in reg_sequence to allow the client to specify a delay (in microseconds) to be applied after any given write in a sequence of writes. We treat a delay in a sequence the same way we treat a page change as they are logically similar in that you can coalesce all write before a delay (in the same way you can coalesce all writes before a page change is needed) Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin2015-07-162-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the functionality using sequences of register writes from the functions that take register defaults. This change renames the arguments in order to support the extension of reg_sequence to take an optional delay to be applied after any given register in a sequence is written. This avoids adding an int to all register defaults, which could substantially increase memory usage for regmaps with large default tables. This also updates all the clients of multi_reg_write/register_patch. Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: Move documentation to regmap.hNicolas Boichat2015-08-116-139/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Init functions defined in regmap*.c files are now prefixed with __, take lockdep key and class parameters, and should not be called directly: move the documentation to regmap.h, where the macros are defined. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: Use different lockdep class for each regmap init callNicolas Boichat2015-08-076-61/+107
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lockdep validator complains about recursive locking and deadlock when two different regmap instances are called in a nested order. That happens anytime a regmap read/write call needs to access another regmap. This is because, for performance reason, lockdep groups all locks initialized by the same mutex_init() in the same lock class. Therefore all regmap mutexes are in the same lock class, leading to lockdep "nested locking" warnings if a regmap accesses another regmap. In general, it is impossible to establish in advance the hierarchy of regmaps, so we make sure that each regmap init call initializes its own static lock_class_key. This is done by wrapping all regmap_init calls into macros. This also allows us to give meaningful names to the lock_class_key. For example, in rt5677 case, we have in /proc/lockdep_chains: irq_context: 0 [ffffffc0018d2198] &dev->mutex [ffffffc0018d2198] &dev->mutex [ffffffc001bd7f60] rt5677:5104:(&rt5677_regmap)->_lock [ffffffc001bd7f58] rt5677:5096:(&rt5677_regmap_physical)->_lock [ffffffc001b95448] &(&base->lock)->rlock The above would have resulted in a lockdep recursive warning previously. This is not the case anymore as the lockdep validator now clearly identifies the 2 regmaps as separate. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'regmap/topic/debugfs' and ↵Mark Brown2015-09-042-16/+134
|\ \ \ | | | | | | | | | | | | 'regmap/topic/force-update' into regmap-next
| | * | regmap: add regmap_fields_force_write()Kuninori Morimoto2015-07-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap_fields_force_write() is similar to regmap_fields_write(), but regmap_fields_force_write() write data to register even though it is same value. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: add regmap_write_bits()Kuninori Morimoto2015-07-101-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap_write_bits() is similar to regmap_update_bits(), but regmap_write_bits() write data to register even though it is same value. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: add force_write option on _regmap_update_bits()Kuninori Morimoto2015-07-101-8/+8
| | |/ | | | | | | | | | | | | | | | | | | | | | Sometimes we want to write data even though it doesn't change value. Then, force_write option on _regmap_update_bits() helps this purpose. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: debugfs: Fix misuse of IS_ENABLEDAxel Lin2015-08-071-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS_ENABLED should only be used for CONFIG_* symbols. I have done a small test: #define REGMAP_ALLOW_WRITE_DEBUGFS IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. #define REGMAP_ALLOW_WRITE_DEBUGFS 0 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. #define REGMAP_ALLOW_WRITE_DEBUGFS 1 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 1. #define REGMAP_ALLOW_WRITE_DEBUGFS 2 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. So fix the misuse of IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) and switch to use #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: debugfs: Allow writes to cache state settingsRichard Fitzgerald2015-07-201-4/+86
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the user to write the cache_only and cache_bypass settings. This can be useful for debugging. Since this can lead to the hardware getting out-of-sync with the cache, at least for the period that the cache state is forced, the kernel is tainted and the action is recorded in the kernel log. When disabling cache_only through debugfs a cache sync will be performed. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge remote-tracking branch 'regmap/topic/core' into regmap-nextMark Brown2015-09-045-26/+215
|\ \
| * \ Merge branch 'topic/smbus-block' of ↵Mark Brown2015-09-044-23/+176
| |\ \ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-core
| | * | regmap: fix a NULL pointer dereference in __regmap_initSergey SENOZHATSKY2015-08-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __regmap_init() may receive a NULL `struct regmap_bus *bus' pointer, for example, from snd_hdac_regmap_init(), and it make sure that it does not NULL deference `bus`, except around ->max_raw_read and ->max_raw_write initialisation. Add missing check. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap-i2c: Add smbus i2c block supportMarkus Pargmann2015-08-301-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to read/write up to 32 bytes of data and is to be prefered if supported before the register read/write smbus support. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: Add raw_write/read checks for max_raw_write/read sizesMarkus Pargmann2015-08-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check in regmap_raw_read() and regmap_raw_write() for correct maximum sizes of the operations. Return -E2BIG if this size is not supported because it is too big. Also this patch causes an uninitialized variable warning so it initializes ret (although not necessary). Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: regmap max_raw_read/write getter functionsMarkus Pargmann2015-08-301-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functions to access the maximum size we can read/write using regmap_raw_read/write(). This helps drivers that need to know how much they can write with the raw functions without problems. There are some devices (e.g. bmc150) that have fifos as registers which need to be read in specific chunks otherwise samples are dropped. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: Introduce max_raw_read/write for regmap_bulk_read/writeMarkus Pargmann2015-08-302-15/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some buses which have a limit on the maximum number of bytes that can be send/received. An example for this is I2C_FUNC_SMBUS_I2C_BLOCK which does not support any reads/writes of more than 32 bytes. The regmap_bulk operations should still be able to utilize the full 32 bytes in this case. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | |
| | | \
| | | \
| | | \
| | | \
| | | \
| | *-----. \ Merge branches 'fix/raw', 'topic/core', 'topic/i2c', 'topic/raw' and ↵Mark Brown2015-08-304-16/+45
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'topic/doc' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-smbus-block
| | | | | | * | regmap: fix typos in regmap.cXiubo Li2015-08-121-2/+2
| | | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two typos in drivers/base/regmap/regmap.c, and they may introduce some noise when checking new patches. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | regmap: Fix regmap_can_raw_write checkMarkus Pargmann2015-08-141-1/+2
| | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is missing a check if map->bus->write is implemented. If it is not implemented arbitrary raw writes are not possible. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | | regmap: Support bulk reads for devices without raw formattingMark Brown2015-08-311-1/+28
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing a bulk read 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. Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regmap: No multi_write support if bus->write does not existMarkus Pargmann2015-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regmap: Split use_single_rw internally into use_single_read/writeMarkus Pargmann2015-08-214-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regmap: Fix regmap_bulk_write for bus writesMarkus Pargmann2015-08-211-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regmap: Silence warning on invalid zero length readMark Brown2015-07-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
OpenPOWER on IntegriCloud