linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217
       [not found] <1324617679-14301-1-git-send-email-anilkumar@ti.com>
@ 2011-12-23 10:49 ` Mark Brown
  2011-12-28  9:14   ` AnilKumar, Chimata
  2012-01-02  9:48   ` AnilKumar, Chimata
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2011-12-23 10:49 UTC (permalink / raw)
  To: AnilKumar Ch; +Cc: sameo, lrg, linux-kernel, linux-omap, nsekhar

On Fri, Dec 23, 2011 at 10:51:19AM +0530, AnilKumar Ch wrote:
> The TPS65217 chip is a power management IC for Portable Navigation Systems
> and Tablet Computing devices. It contains the following components:

I can't help but thinking that there ought to be more code sharing
between the various TI PMIC drivers.

> +static int tps65217_i2c_read_device(struct tps65217_dev *tps65217, char reg,
> +				  int bytes, void *dest)
> +{
> +	struct i2c_client *i2c = tps65217->i2c_client;
> +	struct i2c_msg xfer[2];
> +	int ret;

Use regmap for the register I/O, this will save a lot of code and will
also give access to things like the register cache code.

> +	tps65217 = kzalloc(sizeof(struct tps65217_dev), GFP_KERNEL);
> +	if (tps65217 == NULL)
> +		return -ENOMEM;

Use devm_kzalloc(), it saves all the unwinding code.

> +/* All register addresses */
> +#define TPS65217_REG_CHIPID		0X00

You should verify this as part of the probe() routine - read it back to
make sure it's what's expected, and log the chip revision too in case it
is useful for diagnostics.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217
  2011-12-23 10:49 ` [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217 Mark Brown
@ 2011-12-28  9:14   ` AnilKumar, Chimata
  2012-01-02  9:48   ` AnilKumar, Chimata
  1 sibling, 0 replies; 4+ messages in thread
From: AnilKumar, Chimata @ 2011-12-28  9:14 UTC (permalink / raw)
  To: Mark Brown
  Cc: sameo@linux.intel.com, Girdwood, Liam,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Nori, Sekhar

Hi Mark,

Thanks for reviewing these patches.

On Fri, Dec 23, 2011 at 16:19:18, Mark Brown wrote:
> On Fri, Dec 23, 2011 at 10:51:19AM +0530, AnilKumar Ch wrote:
> > The TPS65217 chip is a power management IC for Portable Navigation Systems
> > and Tablet Computing devices. It contains the following components:
> 
> I can't help but thinking that there ought to be more code sharing
> between the various TI PMIC drivers.
> 
> > +static int tps65217_i2c_read_device(struct tps65217_dev *tps65217, char reg,
> > +				  int bytes, void *dest)
> > +{
> > +	struct i2c_client *i2c = tps65217->i2c_client;
> > +	struct i2c_msg xfer[2];
> > +	int ret;
> 
> Use regmap for the register I/O, this will save a lot of code and will
> also give access to things like the register cache code.
> 

All the I2C read and writes moved to regmap read and writes.

> > +	tps65217 = kzalloc(sizeof(struct tps65217_dev), GFP_KERNEL);
> > +	if (tps65217 == NULL)
> > +		return -ENOMEM;
> 
> Use devm_kzalloc(), it saves all the unwinding code.

Changed kzalloc to devm_kzalloc

> 
> > +/* All register addresses */
> > +#define TPS65217_REG_CHIPID		0X00
> 
> You should verify this as part of the probe() routine - read it back to
> make sure it's what's expected, and log the chip revision too in case it
> is useful for diagnostics.
> 

Added chip verification code to mfd probe and printing the regulator ID &
version number.

Thanks
AnilKumar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217
  2011-12-23 10:49 ` [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217 Mark Brown
  2011-12-28  9:14   ` AnilKumar, Chimata
@ 2012-01-02  9:48   ` AnilKumar, Chimata
  2012-01-02 11:29     ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: AnilKumar, Chimata @ 2012-01-02  9:48 UTC (permalink / raw)
  To: AnilKumar, Chimata, Mark Brown
  Cc: sameo@linux.intel.com, Girdwood, Liam,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Nori, Sekhar

Hi Mark,

> > 
> > > +/* All register addresses */
> > > +#define TPS65217_REG_CHIPID		0X00
> > 
> > You should verify this as part of the probe() routine - read it back to
> > make sure it's what's expected, and log the chip revision too in case it
> > is useful for diagnostics.
> > 
> 
> Added chip verification code to mfd probe and printing the regulator ID &
> version number.

TPS65217 has two versions A and B.
i.  TPS65217A - not supporting DVFS on AM335X
ii. TPS65217B - supports DVFS on AM335X

Right now I am supporting the version B but not A since I am testing DVFS on
AM335X.

I have BeagleBone with me having TPS65217B, but the CHIPID reads 0x70
(corresponds to TPS65217A)!
I am discussing with hardware folks on what to do about this, but for
now I will skip interpreting the CHIPID. I can print it out for reference
though.

Thanks
AnilKumar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217
  2012-01-02  9:48   ` AnilKumar, Chimata
@ 2012-01-02 11:29     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-01-02 11:29 UTC (permalink / raw)
  To: AnilKumar, Chimata
  Cc: sameo@linux.intel.com, Girdwood, Liam,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Nori, Sekhar

On Mon, Jan 02, 2012 at 09:48:40AM +0000, AnilKumar, Chimata wrote:

> I am discussing with hardware folks on what to do about this, but for
> now I will skip interpreting the CHIPID. I can print it out for reference
> though.

Logging for diagnostics is probably enough - it'll verify that register
access to the device and mean that the value is available if it's useful
for debugging problems.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-02 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1324617679-14301-1-git-send-email-anilkumar@ti.com>
2011-12-23 10:49 ` [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217 Mark Brown
2011-12-28  9:14   ` AnilKumar, Chimata
2012-01-02  9:48   ` AnilKumar, Chimata
2012-01-02 11:29     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).