OSDN Git Service

mfd: madera: Add register definitions for Cirrus Logic Madera codecs
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 21 May 2018 09:59:54 +0000 (10:59 +0100)
committerLee Jones <lee.jones@linaro.org>
Tue, 5 Jun 2018 10:14:32 +0000 (11:14 +0100)
commit97c2b5cba2044f1c0bc3f14d7102176dbcf81af0
tree17858c6f0f5bd85f136aedf0bff006a4cedf32b5
parent29dcea88779c856c7dc92040a0c01233263101d4
mfd: madera: Add register definitions for Cirrus Logic Madera codecs

This patch adds a header file of register definitions for Cirrus
Logic "Madera" class codecs. These codecs are all based off a common
set of hardware IP so have a common register map (with a few minor
device-to-device variations).

The registers.h file is tool-generated directly from the hardware design
but has been manually stripped down to reduce size (full register
map is >44000 lines). All names are kept the same as datasheet names
so that they can be cross-referenced between source and datasheet without
confusion.

The register map layout is kept fully-defined rather than factored into
macros and/or block-indexing code. The major reasons for this are:

 - #1 is that it makes the source highly greppable, which is important.
   "What does the driver do with register bits XYZ" or "Where does it use
   register bits XYZ" are commonly types of questions. These can be quickly
   answered by a grep. Squashing definitions into generator macros or block-
   indexing code is a way of defeating grep.

 - most of the register definitions are used in tables, so a constant value
   is required. Using generator macros make the table definition clunky and
   obscure.

 - the code is clearer when it's there in the source exactly what register
   and field it is using

 - it is easier to diff the register map of a new (unsupported) codec against
   what is already supported and merge in differences

 - it makes the register map available in source for maintenance/debugging
   instead of having to refer back to the datasheet for a register map

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
MAINTAINERS
include/linux/mfd/madera/registers.h [new file with mode: 0644]