Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Add placeholders for WM8350 client devices

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>

authored by

Mark Brown and committed by
Liam Girdwood
add41cb4 129eef96

+57 -3
+16 -2
drivers/mfd/wm8350-core.c
··· 1234 1234 1235 1235 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0x0); 1236 1236 1237 + wm8350_client_dev_register(wm8350, "wm8350-codec", 1238 + &(wm8350->codec.pdev)); 1239 + wm8350_client_dev_register(wm8350, "wm8350-gpio", 1240 + &(wm8350->gpio.pdev)); 1241 + wm8350_client_dev_register(wm8350, "wm8350-power", 1242 + &(wm8350->power.pdev)); 1243 + wm8350_client_dev_register(wm8350, "wm8350-rtc", &(wm8350->rtc.pdev)); 1244 + wm8350_client_dev_register(wm8350, "wm8350-wdt", &(wm8350->wdt.pdev)); 1245 + 1237 1246 return 0; 1238 1247 1239 1248 err: ··· 1256 1247 int i; 1257 1248 1258 1249 for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++) 1259 - if (wm8350->pmic.pdev[i] != NULL) 1260 - platform_device_unregister(wm8350->pmic.pdev[i]); 1250 + platform_device_unregister(wm8350->pmic.pdev[i]); 1251 + 1252 + platform_device_unregister(wm8350->wdt.pdev); 1253 + platform_device_unregister(wm8350->rtc.pdev); 1254 + platform_device_unregister(wm8350->power.pdev); 1255 + platform_device_unregister(wm8350->gpio.pdev); 1256 + platform_device_unregister(wm8350->codec.pdev); 1261 1257 1262 1258 free_irq(wm8350->chip_irq, wm8350); 1263 1259 flush_work(&wm8350->irq_work);
+6
include/linux/mfd/wm8350/audio.h
··· 13 13 #ifndef __LINUX_MFD_WM8350_AUDIO_H_ 14 14 #define __LINUX_MFD_WM8350_AUDIO_H_ 15 15 16 + #include <linux/platform_device.h> 17 + 16 18 #define WM8350_CLOCK_CONTROL_1 0x28 17 19 #define WM8350_CLOCK_CONTROL_2 0x29 18 20 #define WM8350_FLL_CONTROL_1 0x2A ··· 590 588 #define WM8350_IRQ_CODEC_JCK_DET_R 40 591 589 #define WM8350_IRQ_CODEC_MICSCD 41 592 590 #define WM8350_IRQ_CODEC_MICD 42 591 + 592 + struct wm8350_codec { 593 + struct platform_device *pdev; 594 + }; 593 595 594 596 #endif
+10
include/linux/mfd/wm8350/core.h
··· 17 17 #include <linux/mutex.h> 18 18 #include <linux/workqueue.h> 19 19 20 + #include <linux/mfd/wm8350/audio.h> 21 + #include <linux/mfd/wm8350/gpio.h> 20 22 #include <linux/mfd/wm8350/pmic.h> 23 + #include <linux/mfd/wm8350/rtc.h> 24 + #include <linux/mfd/wm8350/supply.h> 25 + #include <linux/mfd/wm8350/wdt.h> 21 26 22 27 /* 23 28 * Register values. ··· 579 574 int chip_irq; 580 575 581 576 /* Client devices */ 577 + struct wm8350_codec codec; 578 + struct wm8350_gpio gpio; 582 579 struct wm8350_pmic pmic; 580 + struct wm8350_power power; 581 + struct wm8350_rtc rtc; 582 + struct wm8350_wdt wdt; 583 583 }; 584 584 585 585 /**
+6
include/linux/mfd/wm8350/gpio.h
··· 13 13 #ifndef __LINUX_MFD_WM8350_GPIO_H_ 14 14 #define __LINUX_MFD_WM8350_GPIO_H_ 15 15 16 + #include <linux/platform_device.h> 17 + 16 18 /* 17 19 * GPIO Registers. 18 20 */ ··· 329 327 330 328 int wm8350_gpio_config(struct wm8350 *wm8350, int gpio, int dir, int func, 331 329 int pol, int pull, int invert, int debounce); 330 + 331 + struct wm8350_gpio { 332 + struct platform_device *pdev; 333 + }; 332 334 333 335 /* 334 336 * GPIO Interrupts
+6
include/linux/mfd/wm8350/rtc.h
··· 12 12 #ifndef __LINUX_MFD_WM8350_RTC_H 13 13 #define __LINUX_MFD_WM8350_RTC_H 14 14 15 + #include <linux/platform_device.h> 16 + 15 17 /* 16 18 * Register values. 17 19 */ ··· 258 256 #define WM8350_IRQ_RTC_PER 7 259 257 #define WM8350_IRQ_RTC_SEC 8 260 258 #define WM8350_IRQ_RTC_ALM 9 259 + 260 + struct wm8350_rtc { 261 + struct platform_device *pdev; 262 + }; 261 263 262 264 #endif
+6
include/linux/mfd/wm8350/supply.h
··· 13 13 #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ 14 14 #define __LINUX_MFD_WM8350_SUPPLY_H_ 15 15 16 + #include <linux/platform_device.h> 17 + 16 18 /* 17 19 * Charger registers 18 20 */ ··· 103 101 #define WM8350_IRQ_EXT_USB_FB 36 104 102 #define WM8350_IRQ_EXT_WALL_FB 37 105 103 #define WM8350_IRQ_EXT_BAT_FB 38 104 + 105 + struct wm8350_power { 106 + struct platform_device *pdev; 107 + }; 106 108 107 109 #endif
+7 -1
include/linux/mfd/wm8350/wdt.h
··· 1 1 /* 2 2 * wdt.h -- Watchdog Driver for Wolfson WM8350 PMIC 3 3 * 4 - * Copyright 2007 Wolfson Microelectronics PLC 4 + * Copyright 2007, 2008 Wolfson Microelectronics PLC 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it 7 7 * under the terms of the GNU General Public License as published by the ··· 12 12 #ifndef __LINUX_MFD_WM8350_WDT_H_ 13 13 #define __LINUX_MFD_WM8350_WDT_H_ 14 14 15 + #include <linux/platform_device.h> 16 + 15 17 #define WM8350_WDOG_HIB_MODE 0x0080 16 18 #define WM8350_WDOG_DEBUG 0x0040 17 19 #define WM8350_WDOG_MODE_MASK 0x0030 18 20 #define WM8350_WDOG_TO_MASK 0x0007 19 21 20 22 #define WM8350_IRQ_SYS_WDOG_TO 24 23 + 24 + struct wm8350_wdt { 25 + struct platform_device *pdev; 26 + }; 21 27 22 28 #endif