mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] atmel_lcdfb: introduce driver data
Date: Wed, 17 Jan 2018 09:06:59 +0100	[thread overview]
Message-ID: <20180117080659.zg24mtfiy6roaahv@pengutronix.de> (raw)
In-Reply-To: <20180113102119.GA29458@ravnborg.org>

On Sat, Jan 13, 2018 at 11:21:19AM +0100, Sam Ravnborg wrote:
> Hi Sasha.
> 
> > > +
> > >  static __maybe_unused struct of_device_id atmel_lcdfb_compatible[] = {
> > > -	{ .compatible = "atmel,at91sam9261-lcdc", },
> > > -	{ .compatible = "atmel,at91sam9263-lcdc", },
> > > -	{ .compatible = "atmel,at91sam9g10-lcdc", },
> > > -	{ .compatible = "atmel,at91sam9g45-lcdc", },
> > > +	{ .compatible = "atmel,at91sam9261-lcdc",	.data = &at91sam9261_config, },
> > > +	{ .compatible = "atmel,at91sam9263-lcdc",	.data = &at91sam9263_config, },
> > > +	{ .compatible = "atmel,at91sam9g10-lcdc",	.data = &at91sam9g10_config, },
> > > +	{ .compatible = "atmel,at91sam9g45-lcdc",	.data = &at91sam9g45_config, },
> > >  	{ .compatible = "atmel,at91sam9g45es-lcdc", },
> > > -	{ .compatible = "atmel,at91sam9rl-lcdc", },
> > > -	{ .compatible = "atmel,at32ap-lcdc", },
> > > +	{ .compatible = "atmel,at91sam9rl-lcdc",	.data = &at91sam9rl_config, },
> > > +	{ .compatible = "atmel,at32ap-lcdc",		.data = &at32ap_config, },
> > >  	{ /* sentinel */ }
> > >  };
> > 
> > Note that we can match on different platform_device_ids aswell, so you
> > could also attach driver_data to platform devices aswell. For an example
> > see drivers/serial/serial_imx.c.
> > 
> > I leave it up to you if you change this patch accordingly, I can also
> > apply it as is.
> 
> I took a look at it today.
> With these Atmel CPUs we have different behaviour of each IP block
> depending on what CPU it is included in which is why I have added
> all these _config blocks (I could have re-used a few).
> 
> So it is not that we see that for example at91sam9rl-lcdc
> is used in many CPU's.
> Adding the platform_id in this case resulted in extra code with no
> added benefit - or at least no benefit I could see.
> I had to maintain both a of_device_id table and a platform_device_id table,
> so it also looked like a duplicate.
> 
> So unless I miss something then the original patch is the best
> solution.

I see your point, so applied your original patch.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

      reply	other threads:[~2018-01-17  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06 21:19 Sam Ravnborg
2018-01-09 11:04 ` Sascha Hauer
2018-01-13 10:21   ` Sam Ravnborg
2018-01-17  8:06     ` Sascha Hauer [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=20180117080659.zg24mtfiy6roaahv@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sam@ravnborg.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