summaryrefslogtreecommitdiffstats
path: root/lib/Kconfig
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2019-05-02 23:23:29 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-03 10:49:17 -0400
commit554aae35007e49f533d3d10e788295f7141725bc (patch)
tree188b3a98394b427d9f69e6539f7b3d871ade63b8 /lib/Kconfig
parent8b952747844526cef50fa2e0ae903f586e3cb2e4 (diff)
downloadlinux-554aae35007e49f533d3d10e788295f7141725bc.tar.gz
linux-554aae35007e49f533d3d10e788295f7141725bc.tar.bz2
linux-554aae35007e49f533d3d10e788295f7141725bc.zip
lib: Add support for generic packing operations
This provides an unified API for accessing register bit fields regardless of memory layout. The basic unit of data for these API functions is the u64. The process of transforming an u64 from native CPU encoding into the peripheral's encoding is called 'pack', and transforming it from peripheral to native CPU encoding is 'unpack'. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r--lib/Kconfig17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index a9e56539bd11..ac1fcf06d8ea 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -18,6 +18,23 @@ config RAID6_PQ_BENCHMARK
Benchmark all available RAID6 PQ functions on init and choose the
fastest one.
+config PACKING
+ bool "Generic bitfield packing and unpacking"
+ default n
+ help
+ This option provides the packing() helper function, which permits
+ converting bitfields between a CPU-usable representation and a
+ memory representation that can have any combination of these quirks:
+ - Is little endian (bytes are reversed within a 32-bit group)
+ - The least-significant 32-bit word comes first (within a 64-bit
+ group)
+ - The most significant bit of a byte is at its right (bit 0 of a
+ register description is numerically 2^7).
+ Drivers may use these helpers to match the bit indices as described
+ in the data sheets of the peripherals they are in control of.
+
+ When in doubt, say N.
+
config BITREVERSE
tristate