public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Todd Fischer <todd.fischer@ridgerun.com>
Cc: linux-kernel@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	sameo@linux.intel.com, lrg@slimlogic.co.uk
Subject: Re: [PATCH 3/5] Add MFD driver for TPS6507x family of multi-function chips
Date: Mon, 29 Mar 2010 14:00:46 +0100	[thread overview]
Message-ID: <20100329130046.GD8434@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1269634292-29686-4-git-send-email-todd.fischer@ridgerun.com>

On Fri, Mar 26, 2010 at 02:11:30PM -0600, Todd Fischer wrote:
> MFD driver for TPS6507x family of multi-function chips.

This patch should also be updating the regulator driver to work in terms
of this new MFD driver - otherwise after applying it you'll have two
incompatible drivers for the same chip at once.

> @@ -62,4 +63,4 @@ obj-$(CONFIG_AB3100_OTP)	+= ab3100-otp.o
>  obj-$(CONFIG_AB4500_CORE)	+= ab4500-core.o
>  obj-$(CONFIG_MFD_TIMBERDALE)    += timberdale.o
>  obj-$(CONFIG_PMIC_ADP5520)	+= adp5520.o
> -obj-$(CONFIG_LPC_SCH)		+= lpc_sch.o
> \ No newline at end of file
> +obj-$(CONFIG_LPC_SCH)		+= lpc_sch.o

Extra change in the diff here (not unreasonable, but...).

> + * Credits:
> + *
> + *    Using code from wm8350-i2c.c, Wolfson Microelectronics PLC.
> + *

The WM831x is a much better thing to be cloning here - it fits in much
more directly with the MFD framework, meaning that you don't need...

> +/*
> + * Register a client device.  This is non-fatal since there is no need to
> + * fail the entire device init due to a single platform device failing.
> + */
> +static void tps6507x_client_dev_register(struct tps6507x_dev *tps6507x,
> +					 const char *name,
> +					 struct platform_device **pdev)
> +{

...stuff like this, you can just use the MFD core.

> +static int tps6507x_i2c_probe(struct i2c_client *i2c,
> +			    const struct i2c_device_id *id)
> +{

...

> +	ret = tps6507x_device_init(tps6507x, i2c->irq, i2c->dev.platform_data);
> +	if (ret < 0)
> +		goto err;

Does the hardware support SPI?  The reason the Wolfson drivers are split
up like they are is that the hardware supports both I2C and SPI so room
is being left to add SPI support but if not then you may as well just
have a single probe() function which does all the init.

> +/**
> + * struct tps6507x_dev - tps6507x sub-driver chip access routines
> + * @read_dev() - I2C register read function
> + * @write_dev() - I2C register write function
> + *
> + * Device data may be used to access the TPS6507x chip
> + */
> +
> +struct tps6507x_dev {
> +	struct device *dev;
> +	struct i2c_client *i2c_client;
> +	int (*read_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
> +			void *dest);
> +	int (*write_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
> +			 void *src);
> +	struct mutex adc_mutex;

Perhaps worth saving adc_mutex until you add support for the ADC?

  parent reply	other threads:[~2010-03-29 13:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 20:11 [PATCH 0/5] TPS6507x MFD driver Todd Fischer
2010-03-26 20:11 ` [PATCH 1/5] Move TPS6507x register definition to header file Todd Fischer
2010-03-26 20:11   ` [PATCH 2/5] Make room for other tps6507x drivers to have board specific initialization data Todd Fischer
2010-03-26 20:11     ` [PATCH 3/5] Add MFD driver for TPS6507x family of multi-function chips Todd Fischer
2010-03-26 20:11       ` [PATCH 4/5] Cleaned up name space so each MFD sub-driver uses a different name space Todd Fischer
2010-03-26 20:11         ` [PATCH 5/5] Move TPS6507x regulator driver from being stand-alone to using the MFD TPS6507x driver Todd Fischer
2010-03-29 13:00       ` Mark Brown [this message]
2010-03-29 12:54     ` [PATCH 2/5] Make room for other tps6507x drivers to have board specific initialization data Mark Brown
2010-03-29 12:50   ` [PATCH 1/5] Move TPS6507x register definition to header file Mark Brown
2010-04-02 13:35 ` [PATCH 0/5] TPS6507x MFD driver Samuel Ortiz
2010-04-02 21:33 ` [PATCH 0/4]-V2 " Todd Fischer

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=20100329130046.GD8434@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=sameo@linux.intel.com \
    --cc=todd.fischer@ridgerun.com \
    /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