All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chaithrika U S" <chaithrika-l0cyMroinI0@public.gmane.org>
To: 'Sergei Shtylyov' <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
Subject: RE: [PATCH v2 2/4] i2c: davinci: Add helper functions
Date: Thu, 10 Dec 2009 16:45:48 +0530	[thread overview]
Message-ID: <005b01ca798a$20572430$61056c90$@com> (raw)
In-Reply-To: <4B1E376F.1030808-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>

On Tue, Dec 08, 2009 at 16:54:31, Sergei Shtylyov wrote:
> Hello.
> 
> Chaithrika U S wrote:
> 
> > Add i2c reset control and clock divider calculation functions
> > which will be useful for power management features.
> >
> > Signed-off-by: Chaithrika U S <chaithrika-l0cyMroinI0@public.gmane.org>
> >   
> 
> [...]
> 
> > @@ -138,15 +147,6 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
> >  	u32 clkh;
> >  	u32 clkl;
> >  	u32 input_clock = clk_get_rate(dev->clk);
> > -	u16 w;
> > -
> > -	if (!pdata)
> > -		pdata = &davinci_i2c_platform_data_default;
> > -
> > -	/* put I2C into reset */
> > -	w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG);
> > -	w &= ~DAVINCI_I2C_MDR_IRS;
> > -	davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
> >  
> >  	/* NOTE: I2C Clock divider programming info
> >  	 * As per I2C specs the following formulas provide prescaler
> > @@ -178,12 +178,32 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
> >  	davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh);
> >  	davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl);
> >  
> > +	dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk);
> > +}
> > +
> > +/*
> > + * This function configures I2C and brings I2C out of reset.
> > + * This function is called during I2C init function. This function
> > + * also gets called if I2C encounters any errors.
> > + */
> > +static int i2c_davinci_init(struct davinci_i2c_dev *dev)
> > +{
> > +	struct davinci_i2c_platform_data *pdata = dev->dev->platform_data;
> > +
> > +	if (!pdata)
> > +		pdata = &davinci_i2c_platform_data_default;
> >   
> 
>    The very idea of "default" platform data seems doubtful. Could we 
> remove it?
> 

This platform data is used to set the default parameters in case the 
platform is not specifying it. I am not too sure of why it is different
from other drivers where an error is raised if the platform data is missing.
May be this update can be made as a separate patch out of this series.

Regards, 
Chaithrika

  parent reply	other threads:[~2009-12-10 11:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 10:13 [PATCH v2 0/4] i2c: davinci: Add power management features Chaithrika U S
     [not found] ` <1260267218-19406-1-git-send-email-chaithrika-l0cyMroinI0@public.gmane.org>
2009-12-08 10:13   ` [PATCH v2 1/4] i2c: davinci: Remove MOD_REG_BIT and IO_ADDRESS usage Chaithrika U S
     [not found]     ` <1260267218-19406-2-git-send-email-chaithrika-l0cyMroinI0@public.gmane.org>
2009-12-08 10:13       ` [PATCH v2 2/4] i2c: davinci: Add helper functions Chaithrika U S
     [not found]         ` <1260267218-19406-3-git-send-email-chaithrika-l0cyMroinI0@public.gmane.org>
2009-12-08 10:13           ` [PATCH v2 3/4] i2c: davinci: Add suspend/resume support Chaithrika U S
     [not found]             ` <1260267218-19406-4-git-send-email-chaithrika-l0cyMroinI0@public.gmane.org>
2009-12-08 10:13               ` [PATCH v2 4/4] i2c: davinci: Add cpufreq support Chaithrika U S
2010-01-05 22:56               ` [PATCH v2 3/4] i2c: davinci: Add suspend/resume support Kevin Hilman
     [not found]                 ` <87vdfgrwib.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2010-01-06  4:56                   ` Chaithrika U S
2009-12-08 11:24           ` [PATCH v2 2/4] i2c: davinci: Add helper functions Sergei Shtylyov
     [not found]             ` <4B1E376F.1030808-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2009-12-10 11:15               ` Chaithrika U S [this message]
2009-12-10 13:02                 ` Sergei Shtylyov
2009-12-15 12:57   ` [PATCH v2 0/4] i2c: davinci: Add power management features Chaithrika U S
  -- strict thread matches above, loose matches on Subject: below --
2010-01-06  9:24 [PATCH v3 " Chaithrika U S
2010-01-06  9:24 ` [PATCH v2 1/4] i2c: davinci: Remove MOD_REG_BIT and IO_ADDRESS usage Chaithrika U S
     [not found]   ` <1262769900-2710-2-git-send-email-chaithrika-l0cyMroinI0@public.gmane.org>
2010-01-06  9:24     ` [PATCH v2 2/4] i2c: davinci: Add helper functions Chaithrika U S
2010-01-06  9:24       ` Chaithrika U S

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='005b01ca798a$20572430$61056c90$@com' \
    --to=chaithrika-l0cymroini0@public.gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sshtylyov-hkdhdckH98+B+jHODAdFcQ@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.