public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
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.

  reply	other threads:[~2010-01-25 18:33 UTC|newest]

Thread overview: 16+ 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 ` [PATCH 1/3] i2c-mpc: use __devinit[data] for initialization functions and data Wolfgang Grandegger
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     ` [PATCH 3/3] powerpc: doc/dts-bindings: update doc of FSL I2C bindings Wolfgang Grandegger
2010-01-25 11:56       ` Wolfram Sang
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 12:06       ` Wolfgang Grandegger
2010-01-25 15:15         ` Wolfram Sang
2010-01-25 18:33           ` Wolfgang Grandegger [this message]
2010-01-25 20:48             ` Wolfram Sang
2010-01-25 20:54               ` Wolfgang Grandegger
2010-01-25 21:09                 ` Wolfram Sang
2010-01-26 14:39           ` Ben Dooks
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

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@grandegger$(echo .)com \
    --cc=Devicetree-discuss@lists$(echo .)ozlabs.org \
    --cc=Linux-i2c@vger$(echo .)kernel.org \
    --cc=Linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=w.sang@pengutronix$(echo .)de \
    --cc=wg@denx$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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