mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 1/2] ARM: babbage: Make PMIC initialization shareable
Date: Wed, 20 Jun 2018 11:13:58 -0700	[thread overview]
Message-ID: <CAHQ1cqFzmCPGa0iya262DBXWTRo01S_zJdUHB=4AreC=-s+4XA@mail.gmail.com> (raw)
In-Reply-To: <20180620071641.ugore3xr72emxu6t@pengutronix.de>

On Wed, Jun 20, 2018 at 12:16 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Tue, Jun 19, 2018 at 09:55:02AM -0700, Andrey Smirnov wrote:
> > On Tue, Jun 19, 2018 at 1:51 AM Lucas Stach <l.stach@pengutronix.de> wrote:
> > >
> > > Am Montag, den 18.06.2018, 22:43 -0700 schrieb Andrey Smirnov:
> > > > Some board designs copy i.MX51 Babbadge board's PMIC design and so
> > > > require exactly the same initialization. Move correspoding code into a
> > > > separate file, add new compatiblity string and make appropriate
> > > > Kconfig change to allow other boards to share that code.
> > > >
> > > > > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > > > ---
> > >
> > > [...]
> > >
> > > > +static int imx51_babbage_power_init(void)
> > > > +{
> > > > > +   if (!of_machine_is_compatible("fsl,imx51-babbage") &&
> > > > > +       !of_machine_is_compatible("fsl,imx51-babbage-power"))
> > > > > +           return 0;
> > > > +
> > > > > +   mc13xxx_register_init_callback(babbage_power_init);
> > >
> > > I think it would be better for the board code to explicitly call this
> > > setup function. Gating this by DT compatible is a bit too much magic.
> > >
> >
> > Where do you see magic here? There's nothing unusual in gating board
> > initialization code on "compatible", it's used all over the place. And
> > having multiple level of compatibility one of the intended use-cases
> > of "compatible" property.
>
> Better just export imx51_babbage_power_init (maybe with a better name)
> and call it from your board code after having checked the compatible
> strings. Putting "fsl,imx51-babbage-power" in your board dts in order to
> run some hardware init code for hardware that happens to be the same as
> parts of the babbage board, that's indeed magic.
>

OK, I rest my case. Will change in v2.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-06-20 18:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  5:43 Andrey Smirnov
2018-06-19  5:43 ` [PATCH 2/2] ARM: i.MX: Add support for ZII RDU1 board Andrey Smirnov
2018-06-19  8:51   ` Lucas Stach
2018-06-19 11:34     ` Nikita Yushchenko
2018-06-19 12:42       ` Lucas Stach
2018-06-19 16:24     ` Andrey Smirnov
2018-06-19  8:51 ` [PATCH 1/2] ARM: babbage: Make PMIC initialization shareable Lucas Stach
2018-06-19 16:55   ` Andrey Smirnov
2018-06-20  7:16     ` Sascha Hauer
2018-06-20 18:13       ` Andrey Smirnov [this message]

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='CAHQ1cqFzmCPGa0iya262DBXWTRo01S_zJdUHB=4AreC=-s+4XA@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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