From: Jan Weitzel <J.Weitzel@phytec.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] i2c: omap: fix fclk_rate for ti,omap4-i2c
Date: Wed, 17 Dec 2014 14:59:25 +0100 [thread overview]
Message-ID: <20141217135925.GA3034@lws-weitzel.phytec.de> (raw)
In-Reply-To: <20141211075948.GD30369@pengutronix.de>
On Thu, Dec 11, 2014 at 08:59:48AM +0100, Sascha Hauer wrote:
> On Wed, Dec 10, 2014 at 07:49:28AM +0100, Jan Weitzel wrote:
> > "ti,am33xx" and "ti,omap4" use "ti,omap4-i2c" with different fclk_rate.
> > By now set it according to the used cpu compatible.
> >
> > Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> > ---
> > drivers/i2c/busses/i2c-omap.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> > index 094f591..d2254d4 100644
> > --- a/drivers/i2c/busses/i2c-omap.c
> > +++ b/drivers/i2c/busses/i2c-omap.c
> > @@ -1015,6 +1015,13 @@ i2c_omap_probe(struct device_d *pdev)
> > i2c_omap->reg_shift = (i2c_data->flags >>
> > OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3;
> >
> > + if (!i2c_data->fclk_rate) {
> > + if (of_machine_is_compatible("ti,am33xx"))
> > + i2c_data->fclk_rate = am33xx_data.fclk_rate;
> > + if (of_machine_is_compatible("ti,omap4"))
> > + i2c_data->fclk_rate = omap4_data.fclk_rate;
> > + }
>
> Can't we just do a:
>
> if (of_machine_is_compatible("ti,am33xx"))
> i2c_omap->data = &am33xx_data;
> if (of_machine_is_compatible("ti,omap4"))
> i2c_omap->data = &omap4_data;
>
> Instead?
Sounds good, I reworked the patch.
Jan
>
> With that we could also remove the nonworking omap4_of_data.
>
> 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
prev parent reply other threads:[~2014-12-17 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-10 6:49 Jan Weitzel
2014-12-11 7:59 ` Sascha Hauer
2014-12-11 9:47 ` [PATCH v2] " Jan Weitzel
2015-01-05 12:22 ` Jan Weitzel
2015-01-06 13:47 ` Sascha Hauer
2015-01-07 11:00 ` Jan Weitzel
2014-12-17 13:59 ` Jan Weitzel [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=20141217135925.GA3034@lws-weitzel.phytec.de \
--to=j.weitzel@phytec.de \
--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