public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@kernel.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@openedhand.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/13] mfd: Core support for the WM8350 AudioPlus PMIC
Date: Thu, 09 Oct 2008 13:05:48 +0100	[thread overview]
Message-ID: <1223553948.6814.291.camel@dell-desktop.example.com> (raw)
In-Reply-To: <1223296688-9960-8-git-send-email-broonie@opensource.wolfsonmicro.com>

On Mon, 2008-10-06 at 13:38 +0100, Mark Brown wrote:

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 0541dfb..c32d676 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -86,6 +86,53 @@ config MFD_WM8400
>  	  the device, additional drivers must be enabled in order to use
>  	  the functionality of the device.
>  
> +config MFD_WM8350
> +	tristate
> +
> +config MFD_WM8350_CONFIG_MODE_0
> +	bool "Support WM8350 in configuration mode 0"
> +	depends on MFD_WM8350
> +	default y
> +	help
> +	  The WM8350 offers four configuration modes with different
> +	  initial register states.  This option enables support for the
> +	  WM8350 in mode 0.
> +
> +	  If unsure say Y

I would make the WM8350 mode configuration selectable by the target
machines Kconfig rather than let the user choose. Wrong choices would
probably mean broken hardware.   

>  
>  menu "Multimedia Capabilities Port drivers"
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 172439d..b0adca0 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -13,6 +13,8 @@ obj-$(CONFIG_MFD_TC6387XB)	+= tc6387xb.o
>  obj-$(CONFIG_MFD_TC6393XB)	+= tc6393xb.o
>  
>  obj-$(CONFIG_MFD_WM8400)	+= wm8400-core.o
> +wm8350-objs			:= wm8350-core.o wm8350-regmap.o
> +obj-$(CONFIG_MFD_WM8350)	+= wm8350.o
>  
>  obj-$(CONFIG_MFD_CORE)		+= mfd-core.o
>  
> diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
> new file mode 100644
> index 0000000..c7552c0
> --- /dev/null
> +++ b/drivers/mfd/wm8350-core.c

> +
> +/*
> + * Cache is always host endian.
> + */
> +static int wm8350_create_cache(struct wm8350 *wm8350, int mode)
> +{
> +	int i, ret = 0;
> +	u16 value;
> +	const u16 *reg_map;
> +
> +	switch (mode) {
> +#ifdef CONFIG_MFD_WM8350_CONFIG_MODE_0
> +	case 0:
> +		reg_map = wm8350_mode0_defaults;
> +		break;
> +#endif
> +#ifdef CONFIG_MFD_WM8350_CONFIG_MODE_1
> +	case 1:
> +		reg_map = wm8350_mode1_defaults;
> +		break;
> +#endif
> +#ifdef CONFIG_MFD_WM8350_CONFIG_MODE_2
> +	case 2:
> +		reg_map = wm8350_mode2_defaults;
> +		break;
> +#endif
> +#ifdef CONFIG_MFD_WM8350_CONFIG_MODE_3
> +	case 3:
> +		reg_map = wm8350_mode3_defaults;
> +		break;
> +#endif

Shouldn't this be #elif for each mode ?

Ditto for the default register values. I would also #error if no mode
was selected just to make it's correctly set by machine/board authors.

Liam



  parent reply	other threads:[~2008-10-09 12:07 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 12:32 [PATCH 0/13] WM8350 support Mark Brown
2008-10-06 12:37 ` [PATCH 01/13] mfd: Add WM8350 audio register definitions Mark Brown
2008-10-06 12:37   ` [PATCH 02/13] mfd: Add WM8350 GPIO " Mark Brown
2008-10-06 12:37     ` [PATCH 03/13] mfd: Add WM8350 PMIC " Mark Brown
2008-10-06 12:37       ` [PATCH 04/13] mfd: Add WM8350 PMU " Mark Brown
2008-10-06 12:38         ` [PATCH 05/13] mfd: Add WM8350 comparator " Mark Brown
2008-10-06 12:38           ` [PATCH 06/13] mfd: Add WM8350 RTC " Mark Brown
2008-10-06 12:38             ` [PATCH 07/13] mfd: Add WM8350 watchdog " Mark Brown
2008-10-06 12:38               ` [PATCH 08/13] mfd: Core support for the WM8350 AudioPlus PMIC Mark Brown
2008-10-06 12:38                 ` [PATCH 09/13] mfd: Add I2C control support for WM8350 Mark Brown
2008-10-06 12:38                   ` [PATCH 10/13] mfd: Add GPIO pin configuration " Mark Brown
2008-10-06 12:38                     ` [PATCH 11/13] mfd: Add initialisation callback " Mark Brown
2008-10-06 12:38                       ` [PATCH 12/13] mfd: Add WM8350 interrupt support Mark Brown
2008-10-06 12:38                         ` [PATCH 13/13] regulator: Add WM8350 regulator support Mark Brown
2008-10-09 12:05                 ` Liam Girdwood [this message]
2008-10-09 12:53                   ` [PATCH 08/13] mfd: Core support for the WM8350 AudioPlus PMIC Mark Brown
2008-10-10 14:24 ` [PATCH 0/13] WM8350 support Liam Girdwood
2008-10-10 14:31   ` Samuel Ortiz
2008-10-10 14:38     ` Mark Brown
2008-10-10 14:45       ` Liam Girdwood
2008-10-10 14:58         ` [PATCH 01/14] mfd: Add WM8350 audio register definitions Mark Brown
2008-10-10 14:58           ` [PATCH 02/14] mfd: Add WM8350 GPIO " Mark Brown
2008-10-10 14:58             ` [PATCH 03/14] mfd: Add WM8350 PMIC " Mark Brown
2008-10-10 14:58               ` [PATCH 04/14] mfd: Add WM8350 PMU " Mark Brown
2008-10-10 14:58                 ` [PATCH 05/14] mfd: Add WM8350 comparator " Mark Brown
2008-10-10 14:58                   ` [PATCH 06/14] mfd: Add WM8350 RTC " Mark Brown
2008-10-10 14:58                     ` [PATCH 07/14] mfd: Add WM8350 watchdog " Mark Brown
2008-10-10 14:58                       ` [PATCH 08/14] mfd: Core support for the WM8350 AudioPlus PMIC Mark Brown
2008-10-10 14:58                         ` [PATCH 09/14] mfd: Add I2C control support for WM8350 Mark Brown
2008-10-10 14:58                           ` [PATCH 10/14] mfd: Add GPIO pin configuration " Mark Brown
2008-10-10 14:58                             ` [PATCH 11/14] mfd: Add initialisation callback " Mark Brown
2008-10-10 14:58                               ` [PATCH 12/14] mfd: Add WM8350 interrupt support Mark Brown
2008-10-10 14:58                                 ` [PATCH 13/14] regulator: Add WM8350 regulator support Mark Brown
2008-10-10 14:58                                   ` [PATCH 14/14] mfd: Add WM8350 subdevice registration helper Mark Brown
2008-10-11 14:18                                     ` Samuel Ortiz
2008-10-11 15:38                                       ` Mark Brown
2008-10-11 14:09                             ` [PATCH 10/14] mfd: Add GPIO pin configuration support for WM8350 Samuel Ortiz
2008-10-11 14:46                               ` Mark Brown
2008-10-11 14:23         ` [PATCH 0/13] WM8350 support Samuel Ortiz
2008-10-10 14:48       ` Samuel Ortiz
2008-10-10 14:38     ` Liam Girdwood

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=1223553948.6814.291.camel@dell-desktop.example.com \
    --to=lrg@kernel.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.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