devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
To: Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
Cc: Jernej Skrabec <jernej.skrabec-gGgVlfcn5nU@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Stephen Boyd <sboyd-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Archit Taneja <architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Laurent Pinchart
	<Laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-clk <linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
Subject: Re: [PATCH v2 25/29] drm: sun4i: add quirks for TCON TOP
Date: Mon, 8 Oct 2018 21:10:54 +0800	[thread overview]
Message-ID: <CAGb2v64remLNFdX-FT2xcbcSSkeqmFEjQDEJLPQHiNMctcKTfQ@mail.gmail.com> (raw)
In-Reply-To: <20181008123313.sxqzulfuktslchhy@flea>

On Mon, Oct 8, 2018 at 8:33 PM Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
>
> On Mon, Oct 08, 2018 at 06:50:44PM +0800, Chen-Yu Tsai wrote:
> > On Mon, Oct 8, 2018 at 6:20 PM Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> > >
> > > On Mon, Oct 08, 2018 at 05:06:45PM +0800, Chen-Yu Tsai wrote:
> > > > On Mon, Oct 8, 2018 at 4:51 PM Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> > > > >
> > > > > On Sun, Oct 07, 2018 at 11:39:01AM +0200, Jernej Skrabec wrote:
> > > > > > From: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> > > > > >
> > > > > > Some SoCs, such as H6, doesn't have a full-featured TCON TOP.
> > > > > >
> > > > > > Add quirks support for TCON TOP.
> > > > > >
> > > > > > Currently the presence of TCON_TV1 and DSI is controlled via the quirks
> > > > > > structure.
> > > > > >
> > > > > > Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
> > > > > > ---
> > > > > >  drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 43 ++++++++++++++++++++------
> > > > > >  1 file changed, 34 insertions(+), 9 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> > > > > > index 37158548b447..ed13233cad88 100644
> > > > > > --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> > > > > > +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> > > > > > @@ -9,11 +9,17 @@
> > > > > >  #include <linux/component.h>
> > > > > >  #include <linux/device.h>
> > > > > >  #include <linux/module.h>
> > > > > > +#include <linux/of_device.h>
> > > > > >  #include <linux/of_graph.h>
> > > > > >  #include <linux/platform_device.h>
> > > > > >
> > > > > >  #include "sun8i_tcon_top.h"
> > > > > >
> > > > > > +struct sun8i_tcon_top_quirks {
> > > > > > +     bool has_tcon_tv1;
> > > > > > +     bool has_dsi;
> > > > > > +};
> > > > > > +
> > > > > >  static bool sun8i_tcon_top_node_is_tcon_top(struct device_node *node)
> > > > > >  {
> > > > > >       return !!of_match_node(sun8i_tcon_top_of_table, node);
> > > > > > @@ -121,10 +127,13 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
> > > > > >       struct platform_device *pdev = to_platform_device(dev);
> > > > > >       struct clk_hw_onecell_data *clk_data;
> > > > > >       struct sun8i_tcon_top *tcon_top;
> > > > > > +     const struct sun8i_tcon_top_quirks *quirks;
> > > > > >       struct resource *res;
> > > > > >       void __iomem *regs;
> > > > > >       int ret, i;
> > > > > >
> > > > > > +     quirks = of_device_get_match_data(&pdev->dev);
> > > > > > +
> > > > > >       tcon_top = devm_kzalloc(dev, sizeof(*tcon_top), GFP_KERNEL);
> > > > > >       if (!tcon_top)
> > > > > >               return -ENOMEM;
> > > > > > @@ -187,15 +196,23 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
> > > > > >                                            &tcon_top->reg_lock,
> > > > > >                                            TCON_TOP_TCON_TV0_GATE, 0);
> > > > > >
> > > > > > -     clk_data->hws[CLK_TCON_TOP_TV1] =
> > > > > > -             sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
> > > > > > -                                          &tcon_top->reg_lock,
> > > > > > -                                          TCON_TOP_TCON_TV1_GATE, 1);
> > > > > > +     if (quirks->has_tcon_tv1) {
> > > > > > +             clk_data->hws[CLK_TCON_TOP_TV1] =
> > > > > > +                     sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
> > > > > > +                                                  &tcon_top->reg_lock,
> > > > > > +                                                  TCON_TOP_TCON_TV1_GATE, 1);
> > > > > > +     } else {
> > > > > > +             clk_data->hws[CLK_TCON_TOP_TV1] = NULL;
> > > > > > +     }
> > > > > >
> > > > > > -     clk_data->hws[CLK_TCON_TOP_DSI] =
> > > > > > -             sun8i_tcon_top_register_gate(dev, "dsi", regs,
> > > > > > -                                          &tcon_top->reg_lock,
> > > > > > -                                          TCON_TOP_TCON_DSI_GATE, 2);
> > > > > > +     if (quirks->has_dsi) {
> > > > > > +             clk_data->hws[CLK_TCON_TOP_DSI] =
> > > > > > +                     sun8i_tcon_top_register_gate(dev, "dsi", regs,
> > > > > > +                                                  &tcon_top->reg_lock,
> > > > > > +                                                  TCON_TOP_TCON_DSI_GATE, 2);
> > > > > > +     } else {
> > > > > > +             clk_data->hws[CLK_TCON_TOP_DSI] = NULL;
> > > > >
> > > > > clk_data has been kzalloc'd so its content is already NULL.
> > > > >
> > > > > And you shouldn't have brackets for single line blocks.
> > > > >
> > > > > with that fixed,
> > > >
> > > > FYI checkpatch.pl complains if you use brackets for the if block
> > > > but not for the else block. They should be matching.
> > >
> > > Checkpatch might not warn on this, but
> > > https://www.kernel.org/doc/Documentation/process/coding-style.rst,
> > > section 3 is pretty clear on whether we should use them or not.
> >
> > Right. What I'm pointing out what checkpatch.pl complains about is
> > shown in the second last example in section 3:
> >
> >     This does not apply if only one branch of a conditional statement
> > is a single
> >     statement; in the latter case use braces in both branches:
> >
> > Which is where I think your comment on "shouldn't have brackets for
> > single line blocks"
> > is pointing in the opposite direction.
>
> I think we have a communication failure :)
>
> The two blocks above are single line blocks, even though the line is
> wrapped. So whether or not there is an else condition or not doesn't
> matter, you shouldn't have braces at all.

Ah... It was a single line split wrapped to two lines...
Sorry for the noise.

ChenYu

  reply	other threads:[~2018-10-08 13:10 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07  9:38 [PATCH v2 00/29] Allwinner H6 DE3 and HDMI support Jernej Skrabec
     [not found] ` <20181007093905.11253-1-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-07  9:38   ` [PATCH v2 01/29] dt-bindings: bus: add H6 DE3 bus binding Jernej Skrabec
     [not found]     ` <20181007093905.11253-2-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-08  8:31       ` Maxime Ripard
2018-10-08 14:25         ` Jernej Škrabec
2018-10-07  9:38   ` [PATCH v2 02/29] clk: sunxi-ng: Adjust MP clock parent rate when allowed Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 03/29] clk: sunxi-ng: Use u64 for calculation of NM rate Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 04/29] clk: sunxi-ng: h6: Set video PLLs limits Jernej Skrabec
     [not found]     ` <20181007093905.11253-5-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-12  8:13       ` Jagan Teki
     [not found]         ` <a303145c-b123-d912-91d7-9830dec3244e-oRp2ZoJdM/RWk0Htik3J/w@public.gmane.org>
2018-10-12  9:03           ` Chen-Yu Tsai
2018-10-07  9:38   ` [PATCH v2 05/29] dt-bindings: clock: sun8i-de2: Add H6 DE3 clock description Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 06/29] clk: sunxi-ng: Add support for H6 DE3 clocks Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 07/29] dt-bindings: display: sun4i-drm: Add H6 display engine compatibles Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 08/29] drm/sun4i: Add compatible for H6 display engine Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 09/29] drm/sun4i: Rework DE2 register defines Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 10/29] drm/sun4i: Rename DE2 registers related macros Jernej Skrabec
     [not found]     ` <20181007093905.11253-11-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-08 10:18       ` Maxime Ripard
2018-10-08 14:28         ` Jernej Škrabec
2018-10-09 15:53           ` Maxime Ripard
2018-10-07  9:38   ` [PATCH v2 11/29] drm/sun4i: Fix DE2 mixer size Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 12/29] drm/sun4i: Disable unused DE2 sub-engines Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 13/29] drm/sun4i: Add basic support for DE3 Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 14/29] drm/sun4i: Add support for H6 DE3 mixer 0 Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 15/29] drm/bridge/synopsys: dw-hdmi: Enable workaround for v2.12a Jernej Skrabec
     [not found]     ` <20181007093905.11253-16-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-09 17:40       ` Laurent Pinchart
2018-10-09 17:56         ` Ilia Mirkin
2018-10-09 21:23           ` Russell King - ARM Linux
2018-10-15 17:43         ` Jernej Škrabec
2018-10-07  9:38   ` [PATCH v2 16/29] drm/sun4i: Not all DW HDMI controllers has scrambled addresses Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 17/29] drm/sun4i: dw-hdmi: Make mode_valid function configurable Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 18/29] drm/sun4i: dw-hdmi: Add quirk for setting TMDS clock Jernej Skrabec
2018-10-08  9:14     ` Maxime Ripard
2018-10-08 15:09       ` Jernej Škrabec
2018-10-09  9:14         ` Maxime Ripard
2018-10-07  9:38   ` [PATCH v2 19/29] dt-bindings: display: sunxi: add DT binding for Allwinner H6 DW HDMI Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 20/29] drm/sun4i: Add support for H6 DW HDMI controller Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 21/29] drm/sun4i: dw-hdmi-phy: Reorder quirks by family Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 22/29] drm/sun4i: Add support for Synopsys HDMI PHY Jernej Skrabec
2018-10-07  9:38   ` [PATCH v2 23/29] drm/sun4i: Add support for H6 " Jernej Skrabec
2018-10-07  9:39   ` [PATCH v2 24/29] drm/sun4i: Initialize registers in tcon-top driver Jernej Skrabec
2018-10-07  9:39   ` [PATCH v2 25/29] drm: sun4i: add quirks for TCON TOP Jernej Skrabec
     [not found]     ` <20181007093905.11253-26-jernej.skrabec-gGgVlfcn5nU@public.gmane.org>
2018-10-08  8:51       ` Maxime Ripard
2018-10-08  9:06         ` Chen-Yu Tsai
2018-10-08 10:20           ` Maxime Ripard
2018-10-08 10:50             ` Chen-Yu Tsai
     [not found]               ` <CAGb2v65vG2sCMLOFSVAko+MUBDQa_A+qrMZLFe20QXJhApd1Gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-10-08 12:33                 ` Maxime Ripard
2018-10-08 13:10                   ` Chen-Yu Tsai [this message]
2018-10-08 14:30         ` Jernej Škrabec
2018-10-07  9:39   ` [PATCH v2 26/29] dt-bindings: display: sun4i-drm: document H6 " Jernej Skrabec
2018-10-07  9:39   ` [PATCH v2 27/29] drm: sun4i: add support for " Jernej Skrabec
2018-10-07  9:39   ` [PATCH v2 28/29] arm64: dts: allwinner: h6: Add HDMI pipeline Jernej Skrabec
2018-10-07  9:39   ` [PATCH v2 29/29] arm64: dts: allwinner: h6: Enable HDMI output on Pine H64 board Jernej Skrabec
2018-10-07  9:50   ` [PATCH v2 00/29] Allwinner H6 DE3 and HDMI support Jernej Škrabec

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=CAGb2v64remLNFdX-FT2xcbcSSkeqmFEjQDEJLPQHiNMctcKTfQ@mail.gmail.com \
    --to=wens-jday2fn1rrm@public.gmane.org \
    --cc=Laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=icenowy-h8G6r0blFSE@public.gmane.org \
    --cc=jernej.skrabec-gGgVlfcn5nU@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sboyd-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).