mfd: Add placeholders for WM8350 client devices
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 13 Oct 2008 14:45:22 +0000 (15:45 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Mon, 13 Oct 2008 20:51:57 +0000 (21:51 +0100)
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.

Also remove redundant checks for null regulator platform devices while
we're at it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@openedhand.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/mfd/wm8350-core.c
include/linux/mfd/wm8350/audio.h
include/linux/mfd/wm8350/core.h
include/linux/mfd/wm8350/gpio.h
include/linux/mfd/wm8350/rtc.h
include/linux/mfd/wm8350/supply.h
include/linux/mfd/wm8350/wdt.h

index cd1f76efed4e2161b96676c029754e82971c1e68..382e38c6691453b718b91e114db9aa367674e009 100644 (file)
@@ -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:
@@ -1247,8 +1256,13 @@ void wm8350_device_exit(struct wm8350 *wm8350)
        int i;
 
        for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++)
-               if (wm8350->pmic.pdev[i] != NULL)
-                       platform_device_unregister(wm8350->pmic.pdev[i]);
+               platform_device_unregister(wm8350->pmic.pdev[i]);
+
+       platform_device_unregister(wm8350->wdt.pdev);
+       platform_device_unregister(wm8350->rtc.pdev);
+       platform_device_unregister(wm8350->power.pdev);
+       platform_device_unregister(wm8350->gpio.pdev);
+       platform_device_unregister(wm8350->codec.pdev);
 
        free_irq(wm8350->chip_irq, wm8350);
        flush_work(&wm8350->irq_work);
index 43342f767112f7081b484b6ba973fe6185370ca2..217bb22ebb8e81a532d7023312e64dba76776737 100644 (file)
@@ -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
 #define WM8350_IRQ_CODEC_MICSCD                        41
 #define WM8350_IRQ_CODEC_MICD                  42
 
+struct wm8350_codec {
+       struct platform_device *pdev;
+};
+
 #endif
index 348101cb00dc7f09567c7deeebd2c63b413d0135..6ebf97f2a475f9eb198378b24b98d7cca2bbc9e8 100644 (file)
 #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;
 };
 
 /**
index c6cd2ca8854a68fa711bc3a28b7e4ac8806adf80..ed91e8f5d298fb8ea393927be7f621e746cf83f6 100644 (file)
@@ -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;
+};
+
 /*
  * GPIO Interrupts
  */
index cb337ea8082fc864322b03131388b5678a491177..dfda69e9f4409ca973385dc1cb7d1123fb21194c 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef __LINUX_MFD_WM8350_RTC_H
 #define __LINUX_MFD_WM8350_RTC_H
 
+#include <linux/platform_device.h>
+
 /*
  * Register values.
  */
 #define WM8350_IRQ_RTC_SEC                     8
 #define WM8350_IRQ_RTC_ALM                     9
 
+struct wm8350_rtc {
+       struct platform_device *pdev;
+};
+
 #endif
index f1d4317cf02219632a56fd4ef0b8295edc645d94..1c8f3cde79b05cc87452b3806c37a490a1a65609 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __LINUX_MFD_WM8350_SUPPLY_H_
 #define __LINUX_MFD_WM8350_SUPPLY_H_
 
+#include <linux/platform_device.h>
+
 /*
  * Charger registers
  */
 #define WM8350_IRQ_EXT_WALL_FB                 37
 #define WM8350_IRQ_EXT_BAT_FB                  38
 
+struct wm8350_power {
+       struct platform_device *pdev;
+};
+
 #endif
index 72fc9f5545696b532276a56a0f80bb6dcf83e6e7..f6135b5e5ef424d1d6ff005ff3c4145e18acab1a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * wdt.h  --  Watchdog Driver for Wolfson WM8350 PMIC
  *
- * Copyright 2007 Wolfson Microelectronics PLC
+ * Copyright 2007, 2008 Wolfson Microelectronics PLC
  *
  *  This program is free software; you can redistribute  it and/or modify it
  *  under  the terms of  the GNU General  Public License as published by the
@@ -12,6 +12,8 @@
 #ifndef __LINUX_MFD_WM8350_WDT_H_
 #define __LINUX_MFD_WM8350_WDT_H_
 
+#include <linux/platform_device.h>
+
 #define WM8350_WDOG_HIB_MODE                    0x0080
 #define WM8350_WDOG_DEBUG                       0x0040
 #define WM8350_WDOG_MODE_MASK                   0x0030
@@ -19,4 +21,8 @@
 
 #define WM8350_IRQ_SYS_WDOG_TO                 24
 
+struct wm8350_wdt {
+       struct platform_device *pdev;
+};
+
 #endif