summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap (follow)
Commit message (Collapse)AuthorAgeFilesLines
*---. Merge remote-tracking branches 'regmap/topic/mmio', 'regmap/topic/rbtree' ↵Mark Brown2016-01-053-81/+63
|\ \ \ | | | | | | | | | | | | and 'regmap/topic/seq' into regmap-next
| | | * regmap: debugfs: Use seq_file for the access mapMark Brown2016-01-051-51/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the registers file we don't have any substantial performance concerns rendering the entire file (it involves no device accesses) so just use seq_printf() to simplify the code. Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | regmap: rbtree: When adding a reg do a bsearch for target nodeNikesh Oswal2015-11-161-2/+7
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A binary search is much more efficient rather than iterating over the rbtree in ascending order which the current code is doing. During initialisation the reg defaults are written to the cache in a large chunk and these are always sorted in the ascending order so for this situation ideally we should have iterated the rbtree in descending order. But at runtime the drivers may write into the cache in any random order so this patch selects to use a bsearch to give an optimal runtime performance and also at initialisation time when reg defaults are written the performance of binary search would be much better than iterating in ascending order which the current code was doing. Signed-off-by: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: mmio: Add regmap_mmio_get_min_strideXiubo Li2015-12-081-19/+30
| | | | | | | | | | | | | | | | | | | | | Splite the minimal stride parsing into one signal function. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: mmio: remove the useless codeXiubo Li2015-12-081-1/+0
| | | | | | | | | | | | | | | Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap-mmio: Use native endianness for read/writeSimon Arlott2015-11-161-8/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regmap API has an endianness setting for formatting reads and writes. This can be set by the usual DT "little-endian" and "big-endian" properties. To work properly the associated regmap_bus needs to read/write in native endian. The "syscon" DT device binding creates an mmio-based regmap_bus which performs all reads/writes as little-endian. These values are then converted again by regmap, which means that all of the MIPS BCM boards (which are big-endian) have been declared as "little-endian" to get regmap to convert them back to big-endian. Modify regmap-mmio to use the native-endian functions __raw_read*() and __raw_write*() instead of the little-endian functions read*() and write*(). Modify the big-endian MIPS BCM boards to use what will now be the correct endianness instead of pretending that the devices are little-endian. Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'regmap/topic/64bit' and ↵Mark Brown2016-01-053-0/+223
|\ \ \ | | | | | | | | | | | | 'regmap/topic/irq-type' into regmap-next
| | * | regmap: irq: add support for configuration of trigger typeLaxman Dewangan2016-01-051-0/+100
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of devices supports the trigger level for interrupt like rising/falling edge specially for GPIOs. The interrupt support of such devices may have uses the generic regmap irq framework for implementation. Add support to configure the trigger type device interrupt register via regmap-irq framework. The regmap-irq framework configures the trigger register only if the details of trigger type registers are provided. [Fixed use of terery operator for legibility -- broonie] Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: missing case statementDan Carpenter2015-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This new code is unreachable. Presumably there was supposed to be a case statement there similar to the earlier code. Fixes: afcc00b91f18 ('regmap: add 64-bit mode support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: shift wrapping bugs in 64 bit codeDan Carpenter2015-12-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | We should cast these to 64bit so that we don't truncate away the high bits. Fixes: afcc00b91f18 ('regmap: add 64-bit mode support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regmap: cache: Add 64-bit mode supportXiubo Li2015-12-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Since the mmio has support the 64-bit has been supported for the 64-bit platform, so should the regcache core too. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | 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-053-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>