From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Wolfgang Grandegger <wg-ynQEQJNshbs@public.gmane.org>
Subject: Re: [PATCH 2/3] i2c-mpc: add support for the MPC512x processors from Freescale
Date: Mon, 25 Jan 2010 19:33:31 +0100 [thread overview]
Message-ID: <4B5DE3FB.10505@grandegger.com> (raw)
In-Reply-To: <20100125151509.GD5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Wolfram Sang wrote:
>>>>
>>>> -static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
>>>> - struct mpc_i2c *i2c,
>>>> - u32 clock, u32 prescaler)
>>>> +static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
>>>> + struct mpc_i2c *i2c,
>>>> + u32 clock, u32 prescaler)
>>>> {
>>>> int ret, fdr;
>>>>
>>>> + if (clock == -1) {
>>> Could we use 0 for 'no_clock'? This would make the above statement simply
>> "0" is already used to maintain backward compatibility setting a safe
>> divider.
>
> Ah, now I see:
>
> 'clock == -1' means 'preserve clocks' (and is checked here in mpc_i2c_setup_52xx())
Yes, this is now necessary because "setup" does not just do clock settings.
> 'clock == 0' means 'safe divider' (and is checked in mpc_i2c_get_fdr_52xx())
This is for compatibility with old DTS files and last time it was tricky
to get that right and therefore...
> This is not a beauty ;)
>
> What about adding a flags variable to the setup-functions?
.. I hesitate to make bigger changes to the code flow, which the
introduction of a flags variable would required. Also it seems to be
overkill to me. I will have a closer look, though. At a minimum I will
replace "-1" with "MPC_I2C_PRESERVE_CLOCK".
Wolfgang.
WARNING: multiple messages have this Message-ID (diff)
From: Wolfgang Grandegger <wg@grandegger.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Devicetree-discuss@lists.ozlabs.org,
Linuxppc-dev@lists.ozlabs.org, Linux-i2c@vger.kernel.org,
Wolfgang Grandegger <wg@denx.de>
Subject: Re: [PATCH 2/3] i2c-mpc: add support for the MPC512x processors from Freescale
Date: Mon, 25 Jan 2010 19:33:31 +0100 [thread overview]
Message-ID: <4B5DE3FB.10505@grandegger.com> (raw)
In-Reply-To: <20100125151509.GD5257@pengutronix.de>
Wolfram Sang wrote:
>>>>
>>>> -static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
>>>> - struct mpc_i2c *i2c,
>>>> - u32 clock, u32 prescaler)
>>>> +static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
>>>> + struct mpc_i2c *i2c,
>>>> + u32 clock, u32 prescaler)
>>>> {
>>>> int ret, fdr;
>>>>
>>>> + if (clock == -1) {
>>> Could we use 0 for 'no_clock'? This would make the above statement simply
>> "0" is already used to maintain backward compatibility setting a safe
>> divider.
>
> Ah, now I see:
>
> 'clock == -1' means 'preserve clocks' (and is checked here in mpc_i2c_setup_52xx())
Yes, this is now necessary because "setup" does not just do clock settings.
> 'clock == 0' means 'safe divider' (and is checked in mpc_i2c_get_fdr_52xx())
This is for compatibility with old DTS files and last time it was tricky
to get that right and therefore...
> This is not a beauty ;)
>
> What about adding a flags variable to the setup-functions?
.. I hesitate to make bigger changes to the code flow, which the
introduction of a flags variable would required. Also it seems to be
overkill to me. I will have a closer look, though. At a minimum I will
replace "-1" with "MPC_I2C_PRESERVE_CLOCK".
Wolfgang.
next prev parent reply other threads:[~2010-01-25 18:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-25 8:27 [PATCH 0/3] i2c-mpc: add support for the Freescale MPC512x and other fixes Wolfgang Grandegger
2010-01-25 8:27 ` Wolfgang Grandegger
[not found] ` <1264408029-5290-1-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 8:27 ` [PATCH 1/3] i2c-mpc: use __devinit[data] for initialization functions and data Wolfgang Grandegger
2010-01-25 8:27 ` Wolfgang Grandegger
[not found] ` <1264408029-5290-2-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 8:27 ` [PATCH 2/3] i2c-mpc: add support for the MPC512x processors from Freescale Wolfgang Grandegger
2010-01-25 8:27 ` Wolfgang Grandegger
[not found] ` <1264408029-5290-3-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 8:27 ` [PATCH 3/3] powerpc: doc/dts-bindings: update doc of FSL I2C bindings Wolfgang Grandegger
2010-01-25 8:27 ` Wolfgang Grandegger
[not found] ` <1264408029-5290-4-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 11:56 ` Wolfram Sang
2010-01-25 11:56 ` Wolfram Sang
[not found] ` <20100125115654.GB5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 11:58 ` Wolfgang Grandegger
2010-01-25 11:58 ` Wolfgang Grandegger
2010-01-25 11:52 ` [PATCH 2/3] i2c-mpc: add support for the MPC512x processors from Freescale Wolfram Sang
2010-01-25 11:52 ` Wolfram Sang
[not found] ` <20100125115211.GA5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 12:06 ` Wolfgang Grandegger
2010-01-25 12:06 ` Wolfgang Grandegger
[not found] ` <4B5D894C.4090001-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 15:15 ` Wolfram Sang
2010-01-25 15:15 ` Wolfram Sang
[not found] ` <20100125151509.GD5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 18:33 ` Wolfgang Grandegger [this message]
2010-01-25 18:33 ` Wolfgang Grandegger
[not found] ` <4B5DE3FB.10505-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 20:48 ` Wolfram Sang
2010-01-25 20:48 ` Wolfram Sang
[not found] ` <20100125204833.GB9693-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 20:54 ` Wolfgang Grandegger
2010-01-25 20:54 ` Wolfgang Grandegger
[not found] ` <4B5E0523.9080701-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 21:09 ` Wolfram Sang
2010-01-25 21:09 ` Wolfram Sang
2010-01-26 14:39 ` Ben Dooks
2010-01-26 14:39 ` Ben Dooks
[not found] ` <20100126143925.GD12774-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2010-01-26 18:44 ` Wolfgang Grandegger
2010-01-26 18:44 ` Wolfgang Grandegger
2010-01-25 12:02 ` [PATCH 0/3] i2c-mpc: add support for the Freescale MPC512x and other fixes Wolfram Sang
2010-01-25 12:02 ` Wolfram Sang
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=4B5DE3FB.10505@grandegger.com \
--to=wg-5yr1bzd7o62+xt7jha+gda@public.gmane.org \
--cc=Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=Linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=Linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=wg-ynQEQJNshbs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.