summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-09-20mfd: Support software initiated shutdown of WM831x PMICsMark Brown
In systems where there is no hardware signal from the processor to the PMIC to initiate the final power off sequence we must initiate the shutdown with a register write to the PMIC. Support such systems in the driver. Since this may prevent a full shutdown of the system platform data is used to enable the feature. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-19regmap: Allow drivers to control cache_only flagMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Prototype regcache_sync()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: A cache type of _NONE behaves like a bypassed cacheMark Brown
Avoid extra special casing by setting the cache_bypass flag when we're not caching. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Incorporate the regcache core into regmapDimitris Papastamos
This patch incorporates the regcache core code into regmap. All previous patches have been no-ops essentially up to this point. The bulk read operation is not supported by regcache at the moment. This will be implemented incrementally. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Add the regcache_sync trace eventDimitris Papastamos
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Add the LZO cache supportDimitris Papastamos
This patch adds support for LZO compression when storing the register cache. For a typical device whose register map would normally occupy 25kB or 50kB by using the LZO compression technique, one can get down to ~5-7kB. There might be a performance penalty associated with each individual read/write due to decompressing/compressing the underlying cache, however that should not be noticeable. These memory benefits depend on whether the target architecture can get rid of the memory occupied by the original register defaults cache which is marked as __devinitconst. Nevertheless there will be some memory gain even if the target architecture can't get rid of the original register map, this should be around ~30-32kB instead of 50kB. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Add the rbtree cache supportDimitris Papastamos
This patch adds support for the rbtree cache compression type. Each rbnode manages a variable length block of registers. There can be no two nodes with overlapping blocks. Each block has a base register and a currently top register, all the other registers, if any, lie in between these two and in ascending order. The reasoning behind the construction of this rbtree is simple. In the snd_soc_rbtree_cache_init() function, we iterate over the register defaults provided by the regcache core. For each register value that is non-zero we insert it in the rbtree. In order to determine in which rbnode we need to add the register, we first look if there is another register already added that is adjacent to the one we are about to add. If that is the case we append it in that rbnode block, otherwise we create a new rbnode with a single register in its block and add it to the tree. There are various optimizations across the implementation to speed up lookups by caching the most recently used rbnode. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Add the indexed cache supportDimitris Papastamos
This is the simplest form of a cache available in regcache. Any registers whose default value is 0 are ignored. If any of those registers are modified in the future, they will be placed in the cache on demand. The cache layout is essentially using the provided register defaults by the regcache core directly and does not re-map it to another representation. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19regmap: Introduce caching supportDimitris Papastamos
This patch introduces caching support for regmap. The regcache API has evolved essentially out of ASoC soc-cache so most of the actual caching types (except LZO) have been tested in the past. The purpose of regcache is to optimize in time and space the handling of register caches. Time optimization is achieved by not having to go over a slow bus like I2C to read the value of a register, instead it is cached locally in memory and can be retrieved faster. Regarding space optimization, some of the cache types are better at packing the caches, for e.g. the rbtree and the LZO caches. By doing this the sacrifice in time still wins over doing I2C transactions. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-09Merge branch 'regmap-interface' into regmap-nextMark Brown
2011-09-09regmap: Provide device read and write map interface for mergingMark Brown
Add the externally visible interface introduced by Lars-Peter's commit 6f3064 (regmap: Add support for device specific write and read flag masks) separately in order to allow merge into other subsystems for integration with drivers. Drivers relying on this feature will not be functional until they are merged with the implementation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-05regmap: Make debugfs stubs static inlineLars-Peter Clausen
Make the debugfs stubs static inline to avoid future compilation issues due to duplicated symbols when CONFIG_DEBUG_FS=n once internal.h is included by multiple source files. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-05regmap: Add support for device specific write and read flag masks.Lars-Peter Clausen
Some buses like SPI have no standard notation of read or write operations. The general scheme here is to set or clear specific bits in the register address to indicate whether the operation is a read or write. We already support having a read flag mask per bus, but as there is no standard the bits which need to be set or cleared differ between devices and vendors, thus we need a mechanism to specify them per device. This patch adds two new entries to the regmap_config struct, read_flag_mask and write_flag_mask. These will be or'ed onto the top byte when doing a read or write operation. If both masks are empty the device will fallback to the regmap_bus masks. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-05regmap: Include the last register in debugfs outputMark Brown
Off by one in the array iteration. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-05regmap: Remove redundant owner field from the bus type structMark Brown
No longer used as users link directly with the bus types so the core module infrastructure does refcounting for us. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-05Merge branch 'regmap-linus' into regmap-nextMark Brown
2011-09-05regmap: Remove bitrotted module_put()sMark Brown
The conversion to per bus type registration functions means we don't need to do module_get()s to hold the bus types in memory (their users will link to them) so we removed all those calls. This left module_put() calls in the cleanup paths which aren't needed and which cause unbalanced puts if we ever try to unload anything. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-22Merge branch 'regmap-mfd' into regmap-nextMark Brown
2011-08-22mfd: Convert WM8400 to regmap APIMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-22mfd: Convert WM8994 to use new register map APIMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2011-08-22mfd: Use device ID matching for WM831x SPI driverMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2011-08-22mfd: Provide regmap register access info from wm831x driverMark Brown
Lets us see the register map in debugfs and will enable us to push access checking down into the regmap API. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2011-08-22mfd: Convert WM831x to use regmap APIMark Brown
Factor out the register read/write code to use the register map API. We still need some wm831x specific code and locking in place to check that the user key is handled correctly but only on the write side, reads are not affected by the key. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2011-08-21Merge branch 'regmap-interface' into regmap-nextMark Brown
2011-08-21regmap: Allow drivers to specify register defaultsMark Brown
It is useful for the register cache code to be able to specify the default values for the device registers. The major use is when restoring the register cache after suspend, knowing the register defaults allows us to skip registers that are at their default values when we resume which can be a substantial win on larger modern devices. For some devices (mostly older ones) the hardware does not support readback so the only way we can know the values is from code and so initializing the cache with default values makes it much easier for drivers work with read/modify/write updates. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-14regmap: Provide access information via debugfsMark Brown
Let userspace know what the access map for the device is. This is helpful for verifying that the access map is correctly configured and could also be useful for programs that try to work with the data. File format is: register: R W V P where R, W, V and P are 'y' or 'n' showing readable, writable, volatile and precious respectively. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-14regmap: Share some of the debugfs infrastructure ready for more filesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-14regmap: Add functions to check for access on registersMark Brown
We're going to be using these in quite a few places so factor out the readable/writable/volatile/precious checks. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-12Merge branch 'regmap-linus' into regmap-nextMark Brown
2011-08-12regmap: Specify a module licenseStephen Warren
CONFIG_REGMAP_I2C/SPI are set to m when selected by a tristate config option that's set to m. The regmap modules don't specify a license, so fail to link to regmap_init at load time, since that is EXPORT_SYMBOL_GPL. Fix this by specifying a license for the regmap modules. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-10regmap: Remove unused type and list fields from bus interfaceMark Brown
We no longer enumerate the bus types, we rely on the driver telling us this on init. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-10regmap: Fix type of field width specifiers for x86_64Mark Brown
x86_64 size_t is not an int but the printf format specifier for size_t should be an int. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
2011-08-10regmap: Use int rather than size_t for lengths when logging blocksMark Brown
x86_64 warns as size_t is not an int. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
2011-08-09Merge branch 'regmap-interface' into regmap-nextMark Brown
2011-08-09regmap: Fix kerneldoc errors for regmapMark Brown
Field names didn't match between the documentation and the code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Skip precious registers when dumping registers via debugfsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Provide register map dump via debugfsMark Brown
Copy over the read parts of the ASoC debugfs implementation into regmap, allowing users to see what the register values the device has are at runtime. The implementation, especially the support for seeking, is mostly due to Dimitris Papastamos' work in ASoC. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Use a local header for API internalsMark Brown
Allowing the implementation to be multi-file. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Implement writable register checksMark Brown
This is mainly intended to be used by devices which can dynamically block register writes at runtime, for other devices there is usually limited value. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Add basic tracepointsMark Brown
Trace single register reads and writes, plus start/stop tracepoints for the actual I/O to see where we're spending time. This makes it easy to have always on logging without overwhelming the logs and also lets us take advantage of all the context and time information that the trace subsystem collects for us. We don't currently trace register values for bulk operations as this would add complexity and overhead parsing the cooked data that's being worked with. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08Merge branches 'regmap-linus' and 'regmap-interface' into regmap-nextMark Brown
2011-08-08regmap: Just send the buffer directly for single register writesMark Brown
When doing a single register write we use work_buf for both the register and the value with the buffer formatted for sending directly to the device so we can just do a write() directly. This saves allocating a temporary buffer if we can't do gather writes and is likely to be faster than doing a gather write. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Add precious registers to the driver interfaceMark Brown
Some devices are sensitive to reads on their registers, especially for things like clear on read interrupt status registers. Avoid creating problems with these with things like debugfs by allowing drivers to tell the core about them. If a register is marked as precious then the core will not internally generate any reads of it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Allow devices to specify which registers are accessibleMark Brown
This is currently unused but we need to know which registers exist and their properties in order to implement diagnostics like register map dumps and the cache features. We use callbacks partly because properties can vary at runtime (eg, through access locks on registers) and partly because big switch statements are a good compromise between readable code and small data size for providing information on big register maps. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-08regmap: Add kerneldoc for struct regmap_configMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-07Linux 3.1-rc1v3.1-rc1Linus Torvalds
2011-08-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparcLinus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc: Fix build with DEBUG_PAGEALLOC enabled.
2011-08-07sh: Fix boot crash related to SCIRafael J. Wysocki
Commit d006199e72a9 ("serial: sh-sci: Regtype probing doesn't need to be fatal.") made sci_init_single() return when sci_probe_regmap() succeeds, although it should return when sci_probe_regmap() fails. This causes systems using the serial sh-sci driver to crash during boot. Fix the problem by using the right return condition. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-07arm: remove stale export of 'sha_transform'Linus Torvalds
The generic library code already exports the generic function, this was left-over from the ARM-specific version that just got removed. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>