Devicetree
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
	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: Tue, 26 Jan 2010 14:39:25 +0000	[thread overview]
Message-ID: <20100126143925.GD12774@fluff.org.uk> (raw)
In-Reply-To: <20100125151509.GD5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Mon, Jan 25, 2010 at 04:15:09PM +0100, 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())
> 'clock ==  0' means 'safe divider' (and is checked in mpc_i2c_get_fdr_52xx())

hmm, sounds like a job for a  #define or similar.
 
> This is not a beauty ;)
> 
> What about adding a flags variable to the setup-functions?
> 
> Regards,
> 
>    Wolfram
> 
> -- 
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |



-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

  parent reply	other threads:[~2010-01-26 14:39 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
     [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
     [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
     [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
     [not found]             ` <1264408029-5290-4-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
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:52           ` [PATCH 2/3] i2c-mpc: add support for the MPC512x processors from Freescale Wolfram Sang
     [not found]             ` <20100125115211.GA5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 12:06               ` Wolfgang Grandegger
     [not found]                 ` <4B5D894C.4090001-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 15:15                   ` Wolfram Sang
     [not found]                     ` <20100125151509.GD5257-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-25 18:33                       ` Wolfgang Grandegger
     [not found]                         ` <4B5DE3FB.10505-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-01-25 20:48                           ` Wolfram Sang
     [not found]                             ` <20100125204833.GB9693-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
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-26 14:39                       ` Ben Dooks [this message]
     [not found]                         ` <20100126143925.GD12774-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
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=20100126143925.GD12774@fluff.org.uk \
    --to=ben-linux-elnmno+kys3ytjvyw6ydsg@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-5Yr1BZd7O62+XT7JhA+gdA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox