mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, <patches@opensource.cirrus.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 1/9] mfd: madera: Add register definitions for Cirrus Logic Madera codecs
Date: Mon, 26 Feb 2018 17:41:48 +0000	[thread overview]
Message-ID: <edb9d625-a859-2c57-999a-4d00ed5c656b@opensource.cirrus.com> (raw)
In-Reply-To: <CAHp75VdTdtT8D0OmPo1DPZfjEogSJcBRJBuesHDPrB+bD9CVgA@mail.gmail.com>

On 26/02/18 13:46, Andy Shevchenko wrote:
> On Mon, Feb 26, 2018 at 3:05 PM, Richard Fitzgerald
> <rf@opensource.cirrus.com> wrote:
>> 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
> 
> ...
> 
>> +#define MADERA_OTP_HPDET_GRADIENT_1X_MASK          0x0000FF00
> 
>> +#define MADERA_OTP_HPDET_GRADIENT_0X_MASK          0x000000FF
> 
> GENMASK() for all masks?
> 

I'm an un-fan of GENMASK(). It seems to me to make it less readable.
Unless it's important I'd rather leave the masks as they are because
this is all auto-generated from the hardware design. Also keeping it
in plain form like this makes it easier for people converting
settings from the output of codec tuning tools.

  reply	other threads:[~2018-02-26 17:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 13:05 [PATCH v8 0/9] Add support for Cirrus Logic CS47L35/L85/L90/L91 codecs Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 1/9] mfd: madera: Add register definitions for Cirrus Logic Madera codecs Richard Fitzgerald
2018-02-26 13:46   ` Andy Shevchenko
2018-02-26 17:41     ` Richard Fitzgerald [this message]
2018-02-26 13:05 ` [PATCH v8 2/9] mfd: madera: Add DT bindings " Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 3/9] mfd: madera: Add common support " Richard Fitzgerald
2018-02-26 13:58   ` Fabio Estevam
2018-02-26 15:36     ` Richard Fitzgerald
2018-02-26 14:11   ` Andy Shevchenko
2018-02-26 17:06     ` Richard Fitzgerald
2018-02-26 17:19       ` Andy Shevchenko
2018-02-26 17:37         ` Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 4/9] mfd: madera: Register map tables for Cirrus Logic CS47L35 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 5/9] mfd: madera: Register map tables for Cirrus Logic CS47L85 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 6/9] mfd: madera: Register map tables for Cirrus Logic CS47L90/91 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 7/9] pinctrl: madera: Add DT bindings for Cirrus Logic Madera codecs Richard Fitzgerald
2018-03-21  8:04   ` Linus Walleij
2018-02-26 13:05 ` [PATCH v8 8/9] pinctrl: madera: Add driver " Richard Fitzgerald
2018-03-21  8:07   ` Linus Walleij
2018-02-26 13:05 ` [PATCH v8 9/9] gpio: madera: Support Cirrus Logic Madera class codecs Richard Fitzgerald
2018-02-26 14:16   ` Andy Shevchenko
2018-02-26 17:19     ` Richard Fitzgerald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=edb9d625-a859-2c57-999a-4d00ed5c656b@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®