All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@openedhand.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mfd: Add placeholders for WM8350 client devices
Date: Mon, 13 Oct 2008 15:37:08 +0200	[thread overview]
Message-ID: <20081013133707.GA4759@localdomain> (raw)
In-Reply-To: <1223897792-32031-1-git-send-email-broonie@opensource.wolfsonmicro.com>

Hi Mark,
Hi Mark,

a few comments:

On Mon, Oct 13, 2008 at 12:36:31PM +0100, Mark Brown wrote:
> In order to avoid merge problems further down the line add placeholders
> for several of the WM8350 client devices and register them, otherwise
> the patches adding the client devices will all try to update the same
> code.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/mfd/wm8350-core.c         |   20 ++++++++++++++++++++
>  include/linux/mfd/wm8350/audio.h  |    6 ++++++
>  include/linux/mfd/wm8350/core.h   |   10 ++++++++++
>  include/linux/mfd/wm8350/gpio.h   |    6 ++++++
>  include/linux/mfd/wm8350/rtc.h    |    6 ++++++
>  include/linux/mfd/wm8350/supply.h |    6 ++++++
>  include/linux/mfd/wm8350/wdt.h    |    8 +++++++-
>  7 files changed, 61 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
> index cd1f76e..8554855 100644
> --- a/drivers/mfd/wm8350-core.c
> +++ b/drivers/mfd/wm8350-core.c
> @@ -1234,6 +1234,15 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
>  
>  	wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0x0);
>  
> +	wm8350_client_dev_register(wm8350, "wm8350-codec",
> +				   &(wm8350->codec.pdev));
> +	wm8350_client_dev_register(wm8350, "wm8350-gpio",
> +				   &(wm8350->gpio.pdev));
> +	wm8350_client_dev_register(wm8350, "wm8350-power",
> +				   &(wm8350->power.pdev));
> +	wm8350_client_dev_register(wm8350, "wm8350-rtc", &(wm8350->rtc.pdev));
> +	wm8350_client_dev_register(wm8350, "wm8350-wdt", &(wm8350->wdt.pdev));
> +
>  	return 0;
>  
>  err:
> @@ -1250,6 +1259,17 @@ void wm8350_device_exit(struct wm8350 *wm8350)
>  		if (wm8350->pmic.pdev[i] != NULL)
>  			platform_device_unregister(wm8350->pmic.pdev[i]);
>  
> +	if (wm8350->wdt.pdev)
> +		platform_device_unregister(wm8350->wdt.pdev);
> +	if (wm8350->rtc.pdev)
> +		platform_device_unregister(wm8350->rtc.pdev);
> +	if (wm8350->power.pdev)
> +		platform_device_unregister(wm8350->power.pdev);
> +	if (wm8350->gpio.pdev)
> +		platform_device_unregister(wm8350->gpio.pdev);
> +	if (wm8350->codec.pdev)
> +		platform_device_unregister(wm8350->codec.pdev);
You don't need to check for pdev here, platform_device_unregister does
that for you.


>  	free_irq(wm8350->chip_irq, wm8350);
>  	flush_work(&wm8350->irq_work);
>  	kfree(wm8350->reg_cache);
> diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h
> index 43342f7..217bb22 100644
> --- a/include/linux/mfd/wm8350/audio.h
> +++ b/include/linux/mfd/wm8350/audio.h
> @@ -13,6 +13,8 @@
>  #ifndef __LINUX_MFD_WM8350_AUDIO_H_
>  #define __LINUX_MFD_WM8350_AUDIO_H_
>  
> +#include <linux/platform_device.h>
> +
>  #define WM8350_CLOCK_CONTROL_1                  0x28
>  #define WM8350_CLOCK_CONTROL_2                  0x29
>  #define WM8350_FLL_CONTROL_1                    0x2A
> @@ -589,4 +591,8 @@
>  #define WM8350_IRQ_CODEC_MICSCD			41
>  #define WM8350_IRQ_CODEC_MICD			42
>  
> +struct wm8350_codec {
> +	struct platform_device *pdev;
> +};
> +
>  #endif
> diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
> index 348101c..6ebf97f 100644
> --- a/include/linux/mfd/wm8350/core.h
> +++ b/include/linux/mfd/wm8350/core.h
> @@ -17,7 +17,12 @@
>  #include <linux/mutex.h>
>  #include <linux/workqueue.h>
>  
> +#include <linux/mfd/wm8350/audio.h>
> +#include <linux/mfd/wm8350/gpio.h>
>  #include <linux/mfd/wm8350/pmic.h>
> +#include <linux/mfd/wm8350/rtc.h>
> +#include <linux/mfd/wm8350/supply.h>
> +#include <linux/mfd/wm8350/wdt.h>
>  
>  /*
>   * Register values.
> @@ -574,7 +579,12 @@ struct wm8350 {
>  	int chip_irq;
>  
>  	/* Client devices */
> +	struct wm8350_codec codec;
> +	struct wm8350_gpio gpio;
>  	struct wm8350_pmic pmic;
> +	struct wm8350_power power;
> +	struct wm8350_rtc rtc;
> +	struct wm8350_wdt wdt;
>  };
>  
>  /**
> diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h
> index c6cd2ca..ed91e8f 100644
> --- a/include/linux/mfd/wm8350/gpio.h
> +++ b/include/linux/mfd/wm8350/gpio.h
> @@ -13,6 +13,8 @@
>  #ifndef __LINUX_MFD_WM8350_GPIO_H_
>  #define __LINUX_MFD_WM8350_GPIO_H_
>  
> +#include <linux/platform_device.h>
> +
>  /*
>   * GPIO Registers.
>   */
> @@ -328,6 +330,10 @@ struct wm8350;
>  int wm8350_gpio_config(struct wm8350 *wm8350, int gpio, int dir, int func,
>  		       int pol, int pull, int invert, int debounce);
>  
> +struct wm8350_gpio {
> +	struct platform_device *pdev;
> +};
I guess you're planning to add more stuff to those structures at some point ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  parent reply	other threads:[~2008-10-13 13:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 11:35 WM8350 updates Mark Brown
2008-10-13 11:36 ` [PATCH 1/2] mfd: Add placeholders for WM8350 client devices Mark Brown
2008-10-13 11:36   ` [PATCH 2/2] mfd: Fix warning in WM8350 Mark Brown
2008-10-13 13:37     ` Samuel Ortiz
2008-10-13 13:37   ` Samuel Ortiz [this message]
2008-10-13 14:23     ` [PATCH 1/2] mfd: Add placeholders for WM8350 client devices Mark Brown
2008-10-13 14:45     ` Mark Brown
2008-10-13 14:45       ` [PATCH 2/2] mfd: Fix warning in WM8350 Mark Brown
2008-10-13 14:52       ` [PATCH 1/2] mfd: Add placeholders for WM8350 client devices Samuel Ortiz

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=20081013133707.GA4759@localdomain \
    --to=sameo@openedhand.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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.