linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Linux-sh list <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 10/12] video: Add ADV751[13] DT bindings documentation
Date: Fri, 26 Sep 2014 12:30:56 +0000	[thread overview]
Message-ID: <1464975.QfMrH1tcTG@avalon> (raw)
In-Reply-To: <CAMuHMdXmaxmb0GgidM9LL7DhqHQXO3YfOdfpWv=zwHBN6T_UXA@mail.gmail.com>

Hi Geert,

On Thursday 25 September 2014 12:10:59 Geert Uytterhoeven wrote:
> On Thu, Sep 25, 2014 at 11:57 AM, Laurent Pinchart wrote:
> > On Thursday 25 September 2014 09:06:46 Geert Uytterhoeven wrote:
> >> On Wed, Sep 24, 2014 at 10:04 PM, Laurent Pinchart
> >> 
> >> <laurent.pinchart+renesas@ideasonboard.com> wrote:
> >> > +- adi,input-style: The input components arrangement variant (1, 2 or
> >> > 3).
> >> 
> >> What's the meaning of the numerical values 1, 2, and 3?
> >> 
> >> I found this code in "[PATCH 11/12] drm: Add adv7511 encoder driver":
> >> 
> >> +       input_style = config->input_style = 1 ? 2
> >> +                   : (config->input_style = 2 ? 1 : 3);
> >> 
> >> which didn't really help much ;-)
> >> 
> > :-)
> > 
> > The ADV751[13]W? datasheets document all the supported input formats.
> > They're split in categories, each of them having multiple variants called
> > styles. The styles are just numbered 1, 2 and 3 in the tables that
> > describe the formats, and there's a register field used to select a
> > style. For some reason style 1 maps to register value 2, style 2 to
> > register value 1, and style 3 to register value 3. Go figure...
> 
> Thanks, that explains it.
> 
> Then I suggest to reflect this in the binding:
> 
>     - adi,input-style: The input components arrangement variant (1, 2 or 3),
> as listed in the datasheet.
> 
> and in the code, e.g. by translating the values using a mapping array?

I'll document the property as

- adi,input-style: The input components arrangement variant (1, 2 or 3), as
  listed in the input format tables in the datasheet.

and modify the code to use an array as in

    /*
     * The input style values documented in the datasheet don't match the
     * hardware register field values :-(
     */
    static const unsigned int input_styles[4] = { 0, 2, 1, 3 };

    ...
    regmap_update_bits(adv7511->regmap, ADV7511_REG_VIDEO_INPUT_CFG1, 0x7e,
                       (color_depth << 4) |
                       (input_styles[config->input_style] << 2));

(config->input_style is validated when parsing DT).

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-09-26 12:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 20:04 [PATCH 00/12] Renesas R-Car DU HDMI support Laurent Pinchart
2014-09-24 20:04 ` [PATCH 01/12] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint Laurent Pinchart
2014-09-24 20:04 ` [PATCH 02/12] of: Add for_each_endpoint_of_node helper macro Laurent Pinchart
2014-09-24 20:04 ` [PATCH 03/12] drm: rcar-du: Remove platform data support Laurent Pinchart
2014-09-24 20:04 ` [PATCH 04/12] drm: rcar-du: Use for_each_endpoint_of_node() Laurent Pinchart
2014-09-24 20:04 ` [PATCH 05/12] drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init() Laurent Pinchart
2014-09-24 20:04 ` [PATCH 06/12] drm: rcar-du: Replace direct DRM encoder access with cast macro Laurent Pinchart
2014-09-24 20:04 ` [PATCH 07/12] drm: rcar-du: Replace drm_encoder with drm_slave_encoder Laurent Pinchart
2014-09-24 20:04 ` [PATCH 08/12] drm: rcar-du: Add HDMI encoder and connector support Laurent Pinchart
2014-09-24 20:04 ` [PATCH 09/12] drm: Decouple EDID parsing from I2C adapter Laurent Pinchart
2014-09-24 20:04 ` [PATCH 10/12] video: Add ADV751[13] DT bindings documentation Laurent Pinchart
2014-09-25  7:06   ` Geert Uytterhoeven
2014-09-25  9:57     ` Laurent Pinchart
2014-09-25 10:10       ` Geert Uytterhoeven
2014-09-26 12:30         ` Laurent Pinchart [this message]
2014-09-24 20:04 ` [PATCH 11/12] drm: Add adv7511 encoder driver Laurent Pinchart
2014-09-24 20:04 ` [PATCH 12/12] ARM: shmobile: koelsch: Add DU HDMI output support Laurent Pinchart
2014-10-27  0:38   ` Simon Horman
2014-10-27 12:12     ` Laurent Pinchart
2015-02-06  0:58       ` Simon Horman
2015-02-08 16:08         ` Laurent Pinchart
2015-02-09  5:27           ` Simon Horman
2014-09-25 13:09 ` [PATCH 00/12] Renesas R-Car DU HDMI support Philipp Zabel
2014-09-26 11:35   ` Laurent Pinchart

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=1464975.QfMrH1tcTG@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-sh@vger.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;
as well as URLs for NNTP newsgroup(s).