diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-07 18:56:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-07 18:56:04 -0500 |
commit | 6dc3eb5c1f96641cda7056aa34393e317076d6cf (patch) | |
tree | 9a615b884d7ff5375382b5a3f020f518f618c589 | |
parent | 8fe900b8c7aa6a307e552ff776e0c04c28dcf9c8 (diff) | |
parent | 2c08583c6a6b4c5f5dea4cb0931eca82af7db6fe (diff) |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (66 commits)
mfd: Fix ucb1x00 build failure for collie_defconfig
mfd: Fix lpc_sch related depends/selects, fix build error
gpio: Fix sch_gpio warning
gpio: add Intel SCH GPIO controller driver
i2c: convert i2c-isch to platform_device
mfd: Use completion interrupt for WM831x AUXADC
mfd: Use completion interrupt for WM835x AUXADC
mfd: Introduce remove_script function for twl4030
mfd/mmc: SDHI Kconfig update
mfd: sh_mobile_sdhi MMC_CAP_MMC_HIGHSPEED support
gpiolib: Force wm831x GPIOs into GPIO mode when requested
mfd: Add WM831x revision B support
gpiolib: Correct debugfs display of WM831x GPIO inversion
gpiolib: Actually set output state in wm831x_gpio_direction_output()
tmio_mmc: Balance cell enable()/disable() calls
tmio_mmc: Remove const from platform data V3
tmio_mmc: Use 100ms mmc_detect_change() delay
tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support V2
tmio_mmc: Keep card-detect interrupts enabled
mfd: Add twl6030 base addr for ID0, ID1, ID2
...
78 files changed, 12151 insertions, 1024 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index a4cdbd51b1c6..fee678f74a19 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -94,6 +94,23 @@ config GPIO_VR41XX | |||
94 | help | 94 | help |
95 | Say yes here to support the NEC VR4100 series General-purpose I/O Uint | 95 | Say yes here to support the NEC VR4100 series General-purpose I/O Uint |
96 | 96 | ||
97 | config GPIO_SCH | ||
98 | tristate "Intel SCH GPIO" | ||
99 | depends on GPIOLIB && PCI | ||
100 | select MFD_CORE | ||
101 | select LPC_SCH | ||
102 | help | ||
103 | Say yes here to support GPIO interface on Intel Poulsbo SCH. | ||
104 | The Intel SCH contains a total of 14 GPIO pins. Ten GPIOs are | ||
105 | powered by the core power rail and are turned off during sleep | ||
106 | modes (S3 and higher). The remaining four GPIOs are powered by | ||
107 | the Intel SCH suspend power supply. These GPIOs remain | ||
108 | active during S3. The suspend powered GPIOs can be used to wake the | ||
109 | system from the Suspend-to-RAM state. | ||
110 | |||
111 | This driver can also be built as a module. If so, the module | ||
112 | will be called sch-gpio. | ||
113 | |||
97 | comment "I2C GPIO expanders:" | 114 | comment "I2C GPIO expanders:" |
98 | 115 | ||
99 | config GPIO_MAX7300 | 116 | config GPIO_MAX7300 |
@@ -185,6 +202,20 @@ config GPIO_WM831X | |||
185 | Say yes here to access the GPIO signals of WM831x power management | 202 | Say yes here to access the GPIO signals of WM831x power management |
186 | chips from Wolfson Microelectronics. | 203 | chips from Wolfson Microelectronics. |
187 | 204 | ||
205 | config GPIO_WM8350 | ||
206 | tristate "WM8350 GPIOs" | ||
207 | depends on MFD_WM8350 | ||
208 | help | ||
209 | Say yes here to access the GPIO signals of WM8350 power management | ||
210 | chips from Wolfson Microelectronics. | ||
211 | |||
212 | config GPIO_WM8994 | ||
213 | tristate "WM8994 GPIOs" | ||
214 | depends on MFD_WM8994 | ||
215 | help | ||
216 | Say yes here to access the GPIO signals of WM8994 audio hub | ||
217 | CODECs from Wolfson Microelectronics. | ||
218 | |||
188 | config GPIO_ADP5520 | 219 | config GPIO_ADP5520 |
189 | tristate "GPIO Support for ADP5520 PMIC" | 220 | tristate "GPIO Support for ADP5520 PMIC" |
190 | depends on PMIC_ADP5520 | 221 | depends on PMIC_ADP5520 |
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 128abf8a98da..10f3f8d958b1 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile | |||
@@ -25,3 +25,6 @@ obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o | |||
25 | obj-$(CONFIG_GPIO_IT8761E) += it8761e_gpio.o | 25 | obj-$(CONFIG_GPIO_IT8761E) += it8761e_gpio.o |
26 | obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o | 26 | obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o |
27 | obj-$(CONFIG_GPIO_WM831X) += wm831x-gpio.o | 27 | obj-$(CONFIG_GPIO_WM831X) += wm831x-gpio.o |
28 | obj-$(CONFIG_GPIO_WM8350) += wm8350-gpiolib.o | ||
29 | obj-$(CONFIG_GPIO_WM8994) += wm8994-gpio.o | ||
30 | obj-$(CONFIG_GPIO_SCH) += sch_gpio.o \ No newline at end of file | ||
diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c new file mode 100644 index 000000000000..583521352c16 --- /dev/null +++ b/drivers/gpio/sch_gpio.c | |||
@@ -0,0 +1,295 @@ | |||
1 | /* | ||
2 | * sch_gpio.c - GPIO interface for Intel Poulsbo SCH | ||
3 | * | ||
4 | * Copyright (c) 2010 CompuLab Ltd | ||
5 | * Author: Denis Turischev <denis@compulab.co.il> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License 2 as published | ||
9 | * by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; see the file COPYING. If not, write to | ||
18 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/init.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/io.h> | ||
25 | #include <linux/errno.h> | ||
26 | #include <linux/acpi.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | |||
29 | #include <linux/gpio.h> | ||
30 | |||
31 | static DEFINE_SPINLOCK(gpio_lock); | ||
32 | |||
33 | #define CGEN (0x00) | ||
34 | #define CGIO (0x04) | ||
35 | #define CGLV (0x08) | ||
36 | |||
37 | #define RGEN (0x20) | ||
38 | #define RGIO (0x24) | ||
39 | #define RGLV (0x28) | ||
40 | |||
41 | static unsigned short gpio_ba; | ||
42 | |||
43 | static int sch_gpio_core_direction_in(struct gpio_chip *gc, unsigned gpio_num) | ||
44 | { | ||
45 | u8 curr_dirs; | ||
46 | unsigned short offset, bit; | ||
47 | |||
48 | spin_lock(&gpio_lock); | ||
49 | |||
50 | offset = CGIO + gpio_num / 8; | ||
51 | bit = gpio_num % 8; | ||
52 | |||
53 | curr_dirs = inb(gpio_ba + offset); | ||
54 | |||
55 | if (!(curr_dirs & (1 << bit))) | ||
56 | outb(curr_dirs | (1 << bit), gpio_ba + offset); | ||
57 | |||
58 | spin_unlock(&gpio_lock); | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static int sch_gpio_core_get(struct gpio_chip *gc, unsigned gpio_num) | ||
63 | { | ||
64 | int res; | ||
65 | unsigned short offset, bit; | ||
66 | |||
67 | offset = CGLV + gpio_num / 8; | ||
68 | bit = gpio_num % 8; | ||
69 | |||
70 | res = !!(inb(gpio_ba + offset) & (1 << bit)); | ||
71 | return res; | ||
72 | } | ||
73 | |||
74 | static void sch_gpio_core_set(struct gpio_chip *gc, unsigned gpio_num, int val) | ||
75 | { | ||
76 | u8 curr_vals; | ||
77 | unsigned short offset, bit; | ||
78 | |||
79 | spin_lock(&gpio_lock); | ||
80 | |||
81 | offset = CGLV + gpio_num / 8; | ||
82 | bit = gpio_num % 8; | ||
83 | |||
84 | curr_vals = inb(gpio_ba + offset); | ||
85 | |||
86 | if (val) | ||
87 | outb(curr_vals | (1 << bit), gpio_ba + offset); | ||
88 | else | ||
89 | outb((curr_vals & ~(1 << bit)), gpio_ba + offset); | ||
90 | spin_unlock(&gpio_lock); | ||
91 | } | ||
92 | |||
93 | static int sch_gpio_core_direction_out(struct gpio_chip *gc, | ||
94 | unsigned gpio_num, int val) | ||
95 | { | ||
96 | u8 curr_dirs; | ||
97 | unsigned short offset, bit; | ||
98 | |||
99 | sch_gpio_core_set(gc, gpio_num, val); | ||
100 | |||
101 | spin_lock(&gpio_lock); | ||
102 | |||
103 | offset = CGIO + gpio_num / 8; | ||
104 | bit = gpio_num % 8; | ||
105 | |||
106 | curr_dirs = inb(gpio_ba + offset); | ||
107 | if (curr_dirs & (1 << bit)) | ||
108 | outb(curr_dirs & ~(1 << bit), gpio_ba + offset); | ||
109 | |||
110 | spin_unlock(&gpio_lock); | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | static struct gpio_chip sch_gpio_core = { | ||
115 | .label = "sch_gpio_core", | ||
116 | .owner = THIS_MODULE, | ||
117 | .direction_input = sch_gpio_core_direction_in, | ||
118 | .get = sch_gpio_core_get, | ||
119 | .direction_output = sch_gpio_core_direction_out, | ||
120 | .set = sch_gpio_core_set, | ||
121 | }; | ||
122 | |||
123 | static int sch_gpio_resume_direction_in(struct gpio_chip *gc, | ||
124 | unsigned gpio_num) | ||
125 | { | ||
126 | u8 curr_dirs; | ||
127 | |||
128 | spin_lock(&gpio_lock); | ||
129 | |||
130 | curr_dirs = inb(gpio_ba + RGIO); | ||
131 | |||
132 | if (!(curr_dirs & (1 << gpio_num))) | ||
133 | outb(curr_dirs | (1 << gpio_num) , gpio_ba + RGIO); | ||
134 | |||
135 | spin_unlock(&gpio_lock); | ||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | static int sch_gpio_resume_get(struct gpio_chip *gc, unsigned gpio_num) | ||
140 | { | ||
141 | return !!(inb(gpio_ba + RGLV) & (1 << gpio_num)); | ||
142 | } | ||
143 | |||
144 | static void sch_gpio_resume_set(struct gpio_chip *gc, | ||
145 | unsigned gpio_num, int val) | ||
146 | { | ||
147 | u8 curr_vals; | ||
148 | |||
149 | spin_lock(&gpio_lock); | ||
150 | |||
151 | curr_vals = inb(gpio_ba + RGLV); | ||
152 | |||
153 | if (val) | ||
154 | outb(curr_vals | (1 << gpio_num), gpio_ba + RGLV); | ||
155 | else | ||
156 | outb((curr_vals & ~(1 << gpio_num)), gpio_ba + RGLV); | ||
157 | |||
158 | spin_unlock(&gpio_lock); | ||
159 | } | ||
160 | |||
161 | static int sch_gpio_resume_direction_out(struct gpio_chip *gc, | ||
162 | unsigned gpio_num, int val) | ||
163 | { | ||
164 | u8 curr_dirs; | ||
165 | |||
166 | sch_gpio_resume_set(gc, gpio_num, val); | ||
167 | |||
168 | spin_lock(&gpio_lock); | ||
169 | |||
170 | curr_dirs = inb(gpio_ba + RGIO); | ||
171 | if (curr_dirs & (1 << gpio_num)) | ||
172 | outb(curr_dirs & ~(1 << gpio_num), gpio_ba + RGIO); | ||
173 | |||
174 | spin_unlock(&gpio_lock); | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static struct gpio_chip sch_gpio_resume = { | ||
179 | .label = "sch_gpio_resume", | ||
180 | .owner = THIS_MODULE, | ||
181 | .direction_input = sch_gpio_resume_direction_in, | ||
182 | .get = sch_gpio_resume_get, | ||
183 | .direction_output = sch_gpio_resume_direction_out, | ||
184 | .set = sch_gpio_resume_set, | ||
185 | }; | ||
186 | |||
187 | static int __devinit sch_gpio_probe(struct platform_device *pdev) | ||
188 | { | ||
189 | struct resource *res; | ||
190 | int err; | ||
191 | |||
192 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | ||
193 | if (!res) | ||
194 | return -EBUSY; | ||
195 | |||
196 | if (!request_region(res->start, resource_size(res), pdev->name)) | ||
197 | return -EBUSY; | ||
198 | |||
199 | gpio_ba = res->start; | ||
200 | |||
201 | sch_gpio_core.base = 0; | ||
202 | sch_gpio_core.ngpio = 10; | ||
203 | sch_gpio_core.dev = &pdev->dev; | ||
204 | |||
205 | sch_gpio_resume.base = 10; | ||
206 | sch_gpio_resume.ngpio = 4; | ||
207 | sch_gpio_resume.dev = &pdev->dev; | ||
208 | |||
209 | err = gpiochip_add(&sch_gpio_core); | ||
210 | if (err < 0) | ||
211 | goto err_sch_gpio_core; | ||
212 | |||
213 | err = gpiochip_add(&sch_gpio_resume); | ||
214 | if (err < 0) | ||
215 | goto err_sch_gpio_resume; | ||
216 | |||
217 | /* | ||
218 | * GPIO[6:0] enabled by default | ||
219 | * GPIO7 is configured by the CMC as SLPIOVR | ||
220 | * Enable GPIO[9:8] core powered gpios explicitly | ||
221 | */ | ||
222 | outb(0x3, gpio_ba + CGEN + 1); | ||
223 | /* | ||
224 | * SUS_GPIO[2:0] enabled by default | ||
225 | * Enable SUS_GPIO3 resume powered gpio explicitly | ||
226 | */ | ||
227 | outb(0x8, gpio_ba + RGEN); | ||
228 | |||
229 | return 0; | ||
230 | |||
231 | err_sch_gpio_resume: | ||
232 | err = gpiochip_remove(&sch_gpio_core); | ||
233 | if (err) | ||
234 | dev_err(&pdev->dev, "%s failed, %d\n", | ||
235 | "gpiochip_remove()", err); | ||
236 | |||
237 | err_sch_gpio_core: | ||
238 | release_region(res->start, resource_size(res)); | ||
239 | gpio_ba = 0; | ||
240 | |||
241 | return err; | ||
242 | } | ||
243 | |||
244 | static int __devexit sch_gpio_remove(struct platform_device *pdev) | ||
245 | { | ||
246 | struct resource *res; | ||
247 | if (gpio_ba) { | ||
248 | int err; | ||
249 | |||
250 | err = gpiochip_remove(&sch_gpio_core); | ||
251 | if (err) | ||
252 | dev_err(&pdev->dev, "%s failed, %d\n", | ||
253 | "gpiochip_remove()", err); | ||
254 | err = gpiochip_remove(&sch_gpio_resume); | ||
255 | if (err) | ||
256 | dev_err(&pdev->dev, "%s failed, %d\n", | ||
257 | "gpiochip_remove()", err); | ||
258 | |||
259 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | ||
260 | |||
261 | release_region(res->start, resource_size(res)); | ||
262 | gpio_ba = 0; | ||
263 | |||
264 | return err; | ||
265 | } | ||
266 | |||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static struct platform_driver sch_gpio_driver = { | ||
271 | .driver = { | ||
272 | .name = "sch_gpio", | ||
273 | .owner = THIS_MODULE, | ||
274 | }, | ||
275 | .probe = sch_gpio_probe, | ||
276 | .remove = __devexit_p(sch_gpio_remove), | ||
277 | }; | ||
278 | |||
279 | static int __init sch_gpio_init(void) | ||
280 | { | ||
281 | return platform_driver_register(&sch_gpio_driver); | ||
282 | } | ||
283 | |||
284 | static void __exit sch_gpio_exit(void) | ||
285 | { | ||
286 | platform_driver_unregister(&sch_gpio_driver); | ||
287 | } | ||
288 | |||
289 | module_init(sch_gpio_init); | ||
290 | module_exit(sch_gpio_exit); | ||
291 | |||
292 | MODULE_AUTHOR("Denis Turischev <denis@compulab.co.il>"); | ||
293 | MODULE_DESCRIPTION("GPIO interface for Intel Poulsbo SCH"); | ||
294 | MODULE_LICENSE("GPL"); | ||
295 | MODULE_ALIAS("platform:sch_gpio"); | ||
diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c index b4468b616890..d09021f4a7d3 100644 --- a/drivers/gpio/wm831x-gpio.c +++ b/drivers/gpio/wm831x-gpio.c | |||
@@ -38,10 +38,14 @@ static int wm831x_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | |||
38 | { | 38 | { |
39 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); | 39 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); |
40 | struct wm831x *wm831x = wm831x_gpio->wm831x; | 40 | struct wm831x *wm831x = wm831x_gpio->wm831x; |
41 | int val = WM831X_GPN_DIR; | ||
42 | |||
43 | if (wm831x->has_gpio_ena) | ||
44 | val |= WM831X_GPN_TRI; | ||
41 | 45 | ||
42 | return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, | 46 | return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, |
43 | WM831X_GPN_DIR | WM831X_GPN_TRI, | 47 | WM831X_GPN_DIR | WM831X_GPN_TRI | |
44 | WM831X_GPN_DIR); | 48 | WM831X_GPN_FN_MASK, val); |
45 | } | 49 | } |
46 | 50 | ||
47 | static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset) | 51 | static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset) |
@@ -60,23 +64,36 @@ static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
60 | return 0; | 64 | return 0; |
61 | } | 65 | } |
62 | 66 | ||
63 | static int wm831x_gpio_direction_out(struct gpio_chip *chip, | 67 | static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
64 | unsigned offset, int value) | ||
65 | { | 68 | { |
66 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); | 69 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); |
67 | struct wm831x *wm831x = wm831x_gpio->wm831x; | 70 | struct wm831x *wm831x = wm831x_gpio->wm831x; |
68 | 71 | ||
69 | return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, | 72 | wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset, |
70 | WM831X_GPN_DIR | WM831X_GPN_TRI, 0); | 73 | value << offset); |
71 | } | 74 | } |
72 | 75 | ||
73 | static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 76 | static int wm831x_gpio_direction_out(struct gpio_chip *chip, |
77 | unsigned offset, int value) | ||
74 | { | 78 | { |
75 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); | 79 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); |
76 | struct wm831x *wm831x = wm831x_gpio->wm831x; | 80 | struct wm831x *wm831x = wm831x_gpio->wm831x; |
81 | int val = 0; | ||
82 | int ret; | ||
77 | 83 | ||
78 | wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset, | 84 | if (wm831x->has_gpio_ena) |
79 | value << offset); | 85 | val |= WM831X_GPN_TRI; |
86 | |||
87 | ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, | ||
88 | WM831X_GPN_DIR | WM831X_GPN_TRI | | ||
89 | WM831X_GPN_FN_MASK, val); | ||
90 | if (ret < 0) | ||
91 | return ret; | ||
92 | |||
93 | /* Can only set GPIO state once it's in output mode */ | ||
94 | wm831x_gpio_set(chip, offset, value); | ||
95 | |||
96 | return 0; | ||
80 | } | 97 | } |
81 | 98 | ||
82 | static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 99 | static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
@@ -95,7 +112,7 @@ static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | |||
95 | { | 112 | { |
96 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); | 113 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); |
97 | struct wm831x *wm831x = wm831x_gpio->wm831x; | 114 | struct wm831x *wm831x = wm831x_gpio->wm831x; |
98 | int i; | 115 | int i, tristated; |
99 | 116 | ||
100 | for (i = 0; i < chip->ngpio; i++) { | 117 | for (i = 0; i < chip->ngpio; i++) { |
101 | int gpio = i + chip->base; | 118 | int gpio = i + chip->base; |
@@ -162,15 +179,19 @@ static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | |||
162 | break; | 179 | break; |
163 | } | 180 | } |
164 | 181 | ||
182 | tristated = reg & WM831X_GPN_TRI; | ||
183 | if (wm831x->has_gpio_ena) | ||
184 | tristated = !tristated; | ||
185 | |||
165 | seq_printf(s, " %s %s %s %s%s\n" | 186 | seq_printf(s, " %s %s %s %s%s\n" |
166 | " %s%s (0x%4x)\n", | 187 | " %s%s (0x%4x)\n", |
167 | reg & WM831X_GPN_DIR ? "in" : "out", | 188 | reg & WM831X_GPN_DIR ? "in" : "out", |
168 | wm831x_gpio_get(chip, i) ? "high" : "low", | 189 | wm831x_gpio_get(chip, i) ? "high" : "low", |
169 | pull, | 190 | pull, |
170 | powerdomain, | 191 | powerdomain, |
171 | reg & WM831X_GPN_POL ? " inverted" : "", | 192 | reg & WM831X_GPN_POL ? "" : " inverted", |
172 | reg & WM831X_GPN_OD ? "open-drain" : "CMOS", | 193 | reg & WM831X_GPN_OD ? "open-drain" : "CMOS", |
173 | reg & WM831X_GPN_TRI ? " tristated" : "", | 194 | tristated ? " tristated" : "", |
174 | reg); | 195 | reg); |
175 | } | 196 | } |
176 | } | 197 | } |
diff --git a/drivers/gpio/wm8350-gpiolib.c b/drivers/gpio/wm8350-gpiolib.c new file mode 100644 index 000000000000..511840d1c7ba --- /dev/null +++ b/drivers/gpio/wm8350-gpiolib.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * wm835x-gpiolib.c -- gpiolib support for Wolfson WM835x PMICs | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/mfd/core.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/seq_file.h> | ||
21 | |||
22 | #include <linux/mfd/wm8350/core.h> | ||
23 | #include <linux/mfd/wm8350/gpio.h> | ||
24 | |||
25 | struct wm8350_gpio_data { | ||
26 | struct wm8350 *wm8350; | ||
27 | struct gpio_chip gpio_chip; | ||
28 | }; | ||
29 | |||
30 | static inline struct wm8350_gpio_data *to_wm8350_gpio(struct gpio_chip *chip) | ||
31 | { | ||
32 | return container_of(chip, struct wm8350_gpio_data, gpio_chip); | ||
33 | } | ||
34 | |||
35 | static int wm8350_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | ||
36 | { | ||
37 | struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip); | ||
38 | struct wm8350 *wm8350 = wm8350_gpio->wm8350; | ||
39 | |||
40 | return wm8350_set_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, | ||
41 | 1 << offset); | ||
42 | } | ||
43 | |||
44 | static int wm8350_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
45 | { | ||
46 | struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip); | ||
47 | struct wm8350 *wm8350 = wm8350_gpio->wm8350; | ||
48 | int ret; | ||
49 | |||
50 | ret = wm8350_reg_read(wm8350, WM8350_GPIO_LEVEL); | ||
51 | if (ret < 0) | ||
52 | return ret; | ||
53 | |||
54 | if (ret & (1 << offset)) | ||
55 | return 1; | ||
56 | else | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static void wm8350_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
61 | { | ||
62 | struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip); | ||
63 | struct wm8350 *wm8350 = wm8350_gpio->wm8350; | ||
64 | |||
65 | if (value) | ||
66 | wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); | ||
67 | else | ||
68 | wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); | ||
69 | } | ||
70 | |||
71 | static int wm8350_gpio_direction_out(struct gpio_chip *chip, | ||
72 | unsigned offset, int value) | ||
73 | { | ||
74 | struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip); | ||
75 | struct wm8350 *wm8350 = wm8350_gpio->wm8350; | ||
76 | int ret; | ||
77 | |||
78 | ret = wm8350_clear_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, | ||
79 | 1 << offset); | ||
80 | if (ret < 0) | ||
81 | return ret; | ||
82 | |||
83 | /* Don't have an atomic direction/value setup */ | ||
84 | wm8350_gpio_set(chip, offset, value); | ||
85 | |||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | static int wm8350_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
90 | { | ||
91 | struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip); | ||
92 | struct wm8350 *wm8350 = wm8350_gpio->wm8350; | ||
93 | |||
94 | if (!wm8350->irq_base) | ||
95 | return -EINVAL; | ||
96 | |||
97 | return wm8350->irq_base + WM8350_IRQ_GPIO(offset); | ||
98 | } | ||
99 | |||
100 | static struct gpio_chip template_chip = { | ||
101 | .label = "wm8350", | ||
102 | .owner = THIS_MODULE, | ||
103 | .direction_input = wm8350_gpio_direction_in, | ||
104 | .get = wm8350_gpio_get, | ||
105 | .direction_output = wm8350_gpio_direction_out, | ||
106 | .set = wm8350_gpio_set, | ||
107 | .to_irq = wm8350_gpio_to_irq, | ||
108 | .can_sleep = 1, | ||
109 | }; | ||
110 | |||
111 | static int __devinit wm8350_gpio_probe(struct platform_device *pdev) | ||
112 | { | ||
113 | struct wm8350 *wm8350 = dev_get_drvdata(pdev->dev.parent); | ||
114 | struct wm8350_platform_data *pdata = wm8350->dev->platform_data; | ||
115 | struct wm8350_gpio_data *wm8350_gpio; | ||
116 | int ret; | ||
117 | |||
118 | wm8350_gpio = kzalloc(sizeof(*wm8350_gpio), GFP_KERNEL); | ||
119 | if (wm8350_gpio == NULL) | ||
120 | return -ENOMEM; | ||
121 | |||
122 | wm8350_gpio->wm8350 = wm8350; | ||
123 | wm8350_gpio->gpio_chip = template_chip; | ||
124 | wm8350_gpio->gpio_chip.ngpio = 13; | ||
125 | wm8350_gpio->gpio_chip.dev = &pdev->dev; | ||
126 | if (pdata && pdata->gpio_base) | ||
127 | wm8350_gpio->gpio_chip.base = pdata->gpio_base; | ||
128 | else | ||
129 | wm8350_gpio->gpio_chip.base = -1; | ||
130 | |||
131 | ret = gpiochip_add(&wm8350_gpio->gpio_chip); | ||
132 | if (ret < 0) { | ||
133 | dev_err(&pdev->dev, "Could not register gpiochip, %d\n", | ||
134 | ret); | ||
135 | goto err; | ||
136 | } | ||
137 | |||
138 | platform_set_drvdata(pdev, wm8350_gpio); | ||
139 | |||
140 | return ret; | ||
141 | |||
142 | err: | ||
143 | kfree(wm8350_gpio); | ||
144 | return ret; | ||
145 | } | ||
146 | |||
147 | static int __devexit wm8350_gpio_remove(struct platform_device *pdev) | ||
148 | { | ||
149 | struct wm8350_gpio_data *wm8350_gpio = platform_get_drvdata(pdev); | ||
150 | int ret; | ||
151 | |||
152 | ret = gpiochip_remove(&wm8350_gpio->gpio_chip); | ||
153 | if (ret == 0) | ||
154 | kfree(wm8350_gpio); | ||
155 | |||
156 | return ret; | ||
157 | } | ||
158 | |||
159 | static struct platform_driver wm8350_gpio_driver = { | ||
160 | .driver.name = "wm8350-gpio", | ||
161 | .driver.owner = THIS_MODULE, | ||
162 | .probe = wm8350_gpio_probe, | ||
163 | .remove = __devexit_p(wm8350_gpio_remove), | ||
164 | }; | ||
165 | |||
166 | static int __init wm8350_gpio_init(void) | ||
167 | { | ||
168 | return platform_driver_register(&wm8350_gpio_driver); | ||
169 | } | ||
170 | subsys_initcall(wm8350_gpio_init); | ||
171 | |||
172 | static void __exit wm8350_gpio_exit(void) | ||
173 | { | ||
174 | platform_driver_unregister(&wm8350_gpio_driver); | ||
175 | } | ||
176 | module_exit(wm8350_gpio_exit); | ||
177 | |||
178 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | ||
179 | MODULE_DESCRIPTION("GPIO interface for WM8350 PMICs"); | ||
180 | MODULE_LICENSE("GPL"); | ||
181 | MODULE_ALIAS("platform:wm8350-gpio"); | ||
diff --git a/drivers/gpio/wm8994-gpio.c b/drivers/gpio/wm8994-gpio.c new file mode 100644 index 000000000000..de28b4a470ea --- /dev/null +++ b/drivers/gpio/wm8994-gpio.c | |||
@@ -0,0 +1,204 @@ | |||
1 | /* | ||
2 | * wm8994-gpio.c -- gpiolib support for Wolfson WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/mfd/core.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/seq_file.h> | ||
21 | |||
22 | #include <linux/mfd/wm8994/core.h> | ||
23 | #include <linux/mfd/wm8994/pdata.h> | ||
24 | #include <linux/mfd/wm8994/gpio.h> | ||
25 | #include <linux/mfd/wm8994/registers.h> | ||
26 | |||
27 | struct wm8994_gpio { | ||
28 | struct wm8994 *wm8994; | ||
29 | struct gpio_chip gpio_chip; | ||
30 | }; | ||
31 | |||
32 | static inline struct wm8994_gpio *to_wm8994_gpio(struct gpio_chip *chip) | ||
33 | { | ||
34 | return container_of(chip, struct wm8994_gpio, gpio_chip); | ||
35 | } | ||
36 | |||
37 | static int wm8994_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | ||
38 | { | ||
39 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
40 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
41 | |||
42 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, | ||
43 | WM8994_GPN_DIR, WM8994_GPN_DIR); | ||
44 | } | ||
45 | |||
46 | static int wm8994_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
47 | { | ||
48 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
49 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
50 | int ret; | ||
51 | |||
52 | ret = wm8994_reg_read(wm8994, WM8994_GPIO_1 + offset); | ||
53 | if (ret < 0) | ||
54 | return ret; | ||
55 | |||
56 | if (ret & WM8994_GPN_LVL) | ||
57 | return 1; | ||
58 | else | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static int wm8994_gpio_direction_out(struct gpio_chip *chip, | ||
63 | unsigned offset, int value) | ||
64 | { | ||
65 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
66 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
67 | |||
68 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, | ||
69 | WM8994_GPN_DIR, 0); | ||
70 | } | ||
71 | |||
72 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
73 | { | ||
74 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
75 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
76 | |||
77 | if (value) | ||
78 | value = WM8994_GPN_LVL; | ||
79 | |||
80 | wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, WM8994_GPN_LVL, value); | ||
81 | } | ||
82 | |||
83 | #ifdef CONFIG_DEBUG_FS | ||
84 | static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | ||
85 | { | ||
86 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
87 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
88 | int i; | ||
89 | |||
90 | for (i = 0; i < chip->ngpio; i++) { | ||
91 | int gpio = i + chip->base; | ||
92 | int reg; | ||
93 | const char *label; | ||
94 | |||
95 | /* We report the GPIO even if it's not requested since | ||
96 | * we're also reporting things like alternate | ||
97 | * functions which apply even when the GPIO is not in | ||
98 | * use as a GPIO. | ||
99 | */ | ||
100 | label = gpiochip_is_requested(chip, i); | ||
101 | if (!label) | ||
102 | label = "Unrequested"; | ||
103 | |||
104 | seq_printf(s, " gpio-%-3d (%-20.20s) ", gpio, label); | ||
105 | |||
106 | reg = wm8994_reg_read(wm8994, WM8994_GPIO_1 + i); | ||
107 | if (reg < 0) { | ||
108 | dev_err(wm8994->dev, | ||
109 | "GPIO control %d read failed: %d\n", | ||
110 | gpio, reg); | ||
111 | seq_printf(s, "\n"); | ||
112 | continue; | ||
113 | } | ||
114 | |||
115 | /* No decode yet; note that GPIO2 is special */ | ||
116 | seq_printf(s, "(%x)\n", reg); | ||
117 | } | ||
118 | } | ||
119 | #else | ||
120 | #define wm8994_gpio_dbg_show NULL | ||
121 | #endif | ||
122 | |||
123 | static struct gpio_chip template_chip = { | ||
124 | .label = "wm8994", | ||
125 | .owner = THIS_MODULE, | ||
126 | .direction_input = wm8994_gpio_direction_in, | ||
127 | .get = wm8994_gpio_get, | ||
128 | .direction_output = wm8994_gpio_direction_out, | ||
129 | .set = wm8994_gpio_set, | ||
130 | .dbg_show = wm8994_gpio_dbg_show, | ||
131 | .can_sleep = 1, | ||
132 | }; | ||
133 | |||
134 | static int __devinit wm8994_gpio_probe(struct platform_device *pdev) | ||
135 | { | ||
136 | struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); | ||
137 | struct wm8994_pdata *pdata = wm8994->dev->platform_data; | ||
138 | struct wm8994_gpio *wm8994_gpio; | ||
139 | int ret; | ||
140 | |||
141 | wm8994_gpio = kzalloc(sizeof(*wm8994_gpio), GFP_KERNEL); | ||
142 | if (wm8994_gpio == NULL) | ||
143 | return -ENOMEM; | ||
144 | |||
145 | wm8994_gpio->wm8994 = wm8994; | ||
146 | wm8994_gpio->gpio_chip = template_chip; | ||
147 | wm8994_gpio->gpio_chip.ngpio = WM8994_GPIO_MAX; | ||
148 | wm8994_gpio->gpio_chip.dev = &pdev->dev; | ||
149 | if (pdata && pdata->gpio_base) | ||
150 | wm8994_gpio->gpio_chip.base = pdata->gpio_base; | ||
151 | else | ||
152 | wm8994_gpio->gpio_chip.base = -1; | ||
153 | |||
154 | ret = gpiochip_add(&wm8994_gpio->gpio_chip); | ||
155 | if (ret < 0) { | ||
156 | dev_err(&pdev->dev, "Could not register gpiochip, %d\n", | ||
157 | ret); | ||
158 | goto err; | ||
159 | } | ||
160 | |||
161 | platform_set_drvdata(pdev, wm8994_gpio); | ||
162 | |||
163 | return ret; | ||
164 | |||
165 | err: | ||
166 | kfree(wm8994_gpio); | ||
167 | return ret; | ||
168 | } | ||
169 | |||
170 | static int __devexit wm8994_gpio_remove(struct platform_device *pdev) | ||
171 | { | ||
172 | struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev); | ||
173 | int ret; | ||
174 | |||
175 | ret = gpiochip_remove(&wm8994_gpio->gpio_chip); | ||
176 | if (ret == 0) | ||
177 | kfree(wm8994_gpio); | ||
178 | |||
179 | return ret; | ||
180 | } | ||
181 | |||
182 | static struct platform_driver wm8994_gpio_driver = { | ||
183 | .driver.name = "wm8994-gpio", | ||
184 | .driver.owner = THIS_MODULE, | ||
185 | .probe = wm8994_gpio_probe, | ||
186 | .remove = __devexit_p(wm8994_gpio_remove), | ||
187 | }; | ||
188 | |||
189 | static int __init wm8994_gpio_init(void) | ||
190 | { | ||
191 | return platform_driver_register(&wm8994_gpio_driver); | ||
192 | } | ||
193 | subsys_initcall(wm8994_gpio_init); | ||
194 | |||
195 | static void __exit wm8994_gpio_exit(void) | ||
196 | { | ||
197 | platform_driver_unregister(&wm8994_gpio_driver); | ||
198 | } | ||
199 | module_exit(wm8994_gpio_exit); | ||
200 | |||
201 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | ||
202 | MODULE_DESCRIPTION("GPIO interface for WM8994"); | ||
203 | MODULE_LICENSE("GPL"); | ||
204 | MODULE_ALIAS("platform:wm8994-gpio"); | ||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 4cc3807bd31c..4cd1ff77ceda 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -106,6 +106,8 @@ config I2C_I801 | |||
106 | config I2C_ISCH | 106 | config I2C_ISCH |
107 | tristate "Intel SCH SMBus 1.0" | 107 | tristate "Intel SCH SMBus 1.0" |
108 | depends on PCI | 108 | depends on PCI |
109 | select MFD_CORE | ||
110 | select LPC_SCH | ||
109 | help | 111 | help |
110 | Say Y here if you want to use SMBus controller on the Intel SCH | 112 | Say Y here if you want to use SMBus controller on the Intel SCH |
111 | based systems. | 113 | based systems. |
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c index 69c22f79f231..ddc258edb34f 100644 --- a/drivers/i2c/busses/i2c-isch.c +++ b/drivers/i2c/busses/i2c-isch.c | |||
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/pci.h> | 30 | #include <linux/platform_device.h> |
31 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/stddef.h> | 33 | #include <linux/stddef.h> |
@@ -46,12 +46,6 @@ | |||
46 | #define SMBHSTDAT1 (7 + sch_smba) | 46 | #define SMBHSTDAT1 (7 + sch_smba) |
47 | #define SMBBLKDAT (0x20 + sch_smba) | 47 | #define SMBBLKDAT (0x20 + sch_smba) |
48 | 48 | ||
49 | /* count for request_region */ | ||
50 | #define SMBIOSIZE 64 | ||
51 | |||
52 | /* PCI Address Constants */ | ||
53 | #define SMBBA_SCH 0x40 | ||
54 | |||
55 | /* Other settings */ | 49 | /* Other settings */ |
56 | #define MAX_TIMEOUT 500 | 50 | #define MAX_TIMEOUT 500 |
57 | 51 | ||
@@ -63,7 +57,6 @@ | |||
63 | #define SCH_BLOCK_DATA 0x05 | 57 | #define SCH_BLOCK_DATA 0x05 |
64 | 58 | ||
65 | static unsigned short sch_smba; | 59 | static unsigned short sch_smba; |
66 | static struct pci_driver sch_driver; | ||
67 | static struct i2c_adapter sch_adapter; | 60 | static struct i2c_adapter sch_adapter; |
68 | 61 | ||
69 | /* | 62 | /* |
@@ -256,37 +249,23 @@ static struct i2c_adapter sch_adapter = { | |||
256 | .algo = &smbus_algorithm, | 249 | .algo = &smbus_algorithm, |
257 | }; | 250 | }; |
258 | 251 | ||
259 | static const struct pci_device_id sch_ids[] = { | 252 | static int __devinit smbus_sch_probe(struct platform_device *dev) |
260 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, | ||
261 | { 0, } | ||
262 | }; | ||
263 | |||
264 | MODULE_DEVICE_TABLE(pci, sch_ids); | ||
265 | |||
266 | static int __devinit sch_probe(struct pci_dev *dev, | ||
267 | const struct pci_device_id *id) | ||
268 | { | 253 | { |
254 | struct resource *res; | ||
269 | int retval; | 255 | int retval; |
270 | unsigned int smba; | ||
271 | 256 | ||
272 | pci_read_config_dword(dev, SMBBA_SCH, &smba); | 257 | res = platform_get_resource(dev, IORESOURCE_IO, 0); |
273 | if (!(smba & (1 << 31))) { | 258 | if (!res) |
274 | dev_err(&dev->dev, "SMBus I/O space disabled!\n"); | 259 | return -EBUSY; |
275 | return -ENODEV; | ||
276 | } | ||
277 | 260 | ||
278 | sch_smba = (unsigned short)smba; | 261 | if (!request_region(res->start, resource_size(res), dev->name)) { |
279 | if (sch_smba == 0) { | ||
280 | dev_err(&dev->dev, "SMBus base address uninitialized!\n"); | ||
281 | return -ENODEV; | ||
282 | } | ||
283 | if (acpi_check_region(sch_smba, SMBIOSIZE, sch_driver.name)) | ||
284 | return -ENODEV; | ||
285 | if (!request_region(sch_smba, SMBIOSIZE, sch_driver.name)) { | ||
286 | dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", | 262 | dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", |
287 | sch_smba); | 263 | sch_smba); |
288 | return -EBUSY; | 264 | return -EBUSY; |
289 | } | 265 | } |
266 | |||
267 | sch_smba = res->start; | ||
268 | |||
290 | dev_dbg(&dev->dev, "SMBA = 0x%X\n", sch_smba); | 269 | dev_dbg(&dev->dev, "SMBA = 0x%X\n", sch_smba); |
291 | 270 | ||
292 | /* set up the sysfs linkage to our parent device */ | 271 | /* set up the sysfs linkage to our parent device */ |
@@ -298,37 +277,43 @@ static int __devinit sch_probe(struct pci_dev *dev, | |||
298 | retval = i2c_add_adapter(&sch_adapter); | 277 | retval = i2c_add_adapter(&sch_adapter); |
299 | if (retval) { | 278 | if (retval) { |
300 | dev_err(&dev->dev, "Couldn't register adapter!\n"); | 279 | dev_err(&dev->dev, "Couldn't register adapter!\n"); |
301 | release_region(sch_smba, SMBIOSIZE); | 280 | release_region(res->start, resource_size(res)); |
302 | sch_smba = 0; | 281 | sch_smba = 0; |
303 | } | 282 | } |
304 | 283 | ||
305 | return retval; | 284 | return retval; |
306 | } | 285 | } |
307 | 286 | ||
308 | static void __devexit sch_remove(struct pci_dev *dev) | 287 | static int __devexit smbus_sch_remove(struct platform_device *pdev) |
309 | { | 288 | { |
289 | struct resource *res; | ||
310 | if (sch_smba) { | 290 | if (sch_smba) { |
311 | i2c_del_adapter(&sch_adapter); | 291 | i2c_del_adapter(&sch_adapter); |
312 | release_region(sch_smba, SMBIOSIZE); | 292 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); |
293 | release_region(res->start, resource_size(res)); | ||
313 | sch_smba = 0; | 294 | sch_smba = 0; |
314 | } | 295 | } |
296 | |||
297 | return 0; | ||
315 | } | 298 | } |
316 | 299 | ||
317 | static struct pci_driver sch_driver = { | 300 | static struct platform_driver smbus_sch_driver = { |
318 | .name = "isch_smbus", | 301 | .driver = { |
319 | .id_table = sch_ids, | 302 | .name = "isch_smbus", |
320 | .probe = sch_probe, | 303 | .owner = THIS_MODULE, |
321 | .remove = __devexit_p(sch_remove), | 304 | }, |
305 | .probe = smbus_sch_probe, | ||
306 | .remove = __devexit_p(smbus_sch_remove), | ||
322 | }; | 307 | }; |
323 | 308 | ||
324 | static int __init i2c_sch_init(void) | 309 | static int __init i2c_sch_init(void) |
325 | { | 310 | { |
326 | return pci_register_driver(&sch_driver); | 311 | return platform_driver_register(&smbus_sch_driver); |
327 | } | 312 | } |
328 | 313 | ||
329 | static void __exit i2c_sch_exit(void) | 314 | static void __exit i2c_sch_exit(void) |
330 | { | 315 | { |
331 | pci_unregister_driver(&sch_driver); | 316 | platform_driver_unregister(&smbus_sch_driver); |
332 | } | 317 | } |
333 | 318 | ||
334 | MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); | 319 | MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); |
@@ -337,3 +322,4 @@ MODULE_LICENSE("GPL"); | |||
337 | 322 | ||
338 | module_init(i2c_sch_init); | 323 | module_init(i2c_sch_init); |
339 | module_exit(i2c_sch_exit); | 324 | module_exit(i2c_sch_exit); |
325 | MODULE_ALIAS("platform:isch_smbus"); | ||
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c new file mode 100644 index 000000000000..69a48e8701b9 --- /dev/null +++ b/drivers/input/misc/88pm860x_onkey.c | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * 88pm860x_onkey.c - Marvell 88PM860x ONKEY driver | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General | ||
8 | * Public License. See the file "COPYING" in the main directory of this | ||
9 | * archive for more details. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/i2c.h> | ||
25 | #include <linux/input.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/mfd/88pm860x.h> | ||
28 | |||
29 | #define PM8607_WAKEUP 0x0b | ||
30 | |||
31 | #define LONG_ONKEY_EN (1 << 1) | ||
32 | #define ONKEY_STATUS (1 << 0) | ||
33 | |||
34 | struct pm860x_onkey_info { | ||
35 | struct input_dev *idev; | ||
36 | struct pm860x_chip *chip; | ||
37 | struct i2c_client *i2c; | ||
38 | struct device *dev; | ||
39 | int irq; | ||
40 | }; | ||
41 | |||
42 | /* 88PM860x gives us an interrupt when ONKEY is held */ | ||
43 | static irqreturn_t pm860x_onkey_handler(int irq, void *data) | ||
44 | { | ||
45 | struct pm860x_onkey_info *info = data; | ||
46 | int ret; | ||
47 | |||
48 | ret = pm860x_reg_read(info->i2c, PM8607_STATUS_2); | ||
49 | ret &= ONKEY_STATUS; | ||
50 | input_report_key(info->idev, KEY_POWER, ret); | ||
51 | input_sync(info->idev); | ||
52 | |||
53 | /* Enable 8-second long onkey detection */ | ||
54 | pm860x_set_bits(info->i2c, PM8607_WAKEUP, 3, LONG_ONKEY_EN); | ||
55 | return IRQ_HANDLED; | ||
56 | } | ||
57 | |||
58 | static int __devinit pm860x_onkey_probe(struct platform_device *pdev) | ||
59 | { | ||
60 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
61 | struct pm860x_onkey_info *info; | ||
62 | int irq, ret; | ||
63 | |||
64 | irq = platform_get_irq(pdev, 0); | ||
65 | if (irq < 0) { | ||
66 | dev_err(&pdev->dev, "No IRQ resource!\n"); | ||
67 | return -EINVAL; | ||
68 | } | ||
69 | |||
70 | info = kzalloc(sizeof(struct pm860x_onkey_info), GFP_KERNEL); | ||
71 | if (!info) | ||
72 | return -ENOMEM; | ||
73 | info->chip = chip; | ||
74 | info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | ||
75 | info->dev = &pdev->dev; | ||
76 | info->irq = irq + chip->irq_base; | ||
77 | |||
78 | info->idev = input_allocate_device(); | ||
79 | if (!info->idev) { | ||
80 | dev_err(chip->dev, "Failed to allocate input dev\n"); | ||
81 | ret = -ENOMEM; | ||
82 | goto out; | ||
83 | } | ||
84 | |||
85 | info->idev->name = "88pm860x_on"; | ||
86 | info->idev->phys = "88pm860x_on/input0"; | ||
87 | info->idev->id.bustype = BUS_I2C; | ||
88 | info->idev->dev.parent = &pdev->dev; | ||
89 | info->irq = irq; | ||
90 | info->idev->evbit[0] = BIT_MASK(EV_KEY); | ||
91 | info->idev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER); | ||
92 | |||
93 | ret = input_register_device(info->idev); | ||
94 | if (ret) { | ||
95 | dev_err(chip->dev, "Can't register input device: %d\n", ret); | ||
96 | goto out_reg; | ||
97 | } | ||
98 | |||
99 | ret = request_threaded_irq(info->irq, NULL, pm860x_onkey_handler, | ||
100 | IRQF_ONESHOT, "onkey", info); | ||
101 | if (ret < 0) { | ||
102 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", | ||
103 | info->irq, ret); | ||
104 | goto out_irq; | ||
105 | } | ||
106 | |||
107 | platform_set_drvdata(pdev, info); | ||
108 | return 0; | ||
109 | |||
110 | out_irq: | ||
111 | input_unregister_device(info->idev); | ||
112 | kfree(info); | ||
113 | return ret; | ||
114 | |||
115 | out_reg: | ||
116 | input_free_device(info->idev); | ||
117 | out: | ||
118 | kfree(info); | ||
119 | return ret; | ||
120 | } | ||
121 | |||
122 | static int __devexit pm860x_onkey_remove(struct platform_device *pdev) | ||
123 | { | ||
124 | struct pm860x_onkey_info *info = platform_get_drvdata(pdev); | ||
125 | |||
126 | free_irq(info->irq, info); | ||
127 | input_unregister_device(info->idev); | ||
128 | kfree(info); | ||
129 | return 0; | ||
130 | } | ||
131 | |||
132 | static struct platform_driver pm860x_onkey_driver = { | ||
133 | .driver = { | ||
134 | .name = "88pm860x-onkey", | ||
135 | .owner = THIS_MODULE, | ||
136 | }, | ||
137 | .probe = pm860x_onkey_probe, | ||
138 | .remove = __devexit_p(pm860x_onkey_remove), | ||
139 | }; | ||
140 | |||
141 | static int __init pm860x_onkey_init(void) | ||
142 | { | ||
143 | return platform_driver_register(&pm860x_onkey_driver); | ||
144 | } | ||
145 | module_init(pm860x_onkey_init); | ||
146 | |||
147 | static void __exit pm860x_onkey_exit(void) | ||
148 | { | ||
149 | platform_driver_unregister(&pm860x_onkey_driver); | ||
150 | } | ||
151 | module_exit(pm860x_onkey_exit); | ||
152 | |||
153 | MODULE_DESCRIPTION("Marvell 88PM860x ONKEY driver"); | ||
154 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
155 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 16ec5233441c..7097bfe581d7 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -12,6 +12,16 @@ menuconfig INPUT_MISC | |||
12 | 12 | ||
13 | if INPUT_MISC | 13 | if INPUT_MISC |
14 | 14 | ||
15 | config INPUT_88PM860X_ONKEY | ||
16 | tristate "88PM860x ONKEY support" | ||
17 | depends on MFD_88PM860X | ||
18 | help | ||
19 | Support the ONKEY of Marvell 88PM860x PMICs as an input device | ||
20 | reporting power button status. | ||
21 | |||
22 | To compile this driver as a module, choose M here: the module | ||
23 | will be called 88pm860x_onkey. | ||
24 | |||
15 | config INPUT_PCSPKR | 25 | config INPUT_PCSPKR |
16 | tristate "PC Speaker support" | 26 | tristate "PC Speaker support" |
17 | depends on PCSPKR_PLATFORM | 27 | depends on PCSPKR_PLATFORM |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index a8b84854fb7b..b611615e24ad 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | # Each configuration option enables a list of files. | 5 | # Each configuration option enables a list of files. |
6 | 6 | ||
7 | obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o | ||
7 | obj-$(CONFIG_INPUT_APANEL) += apanel.o | 8 | obj-$(CONFIG_INPUT_APANEL) += apanel.o |
8 | obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o | 9 | obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o |
9 | obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o | 10 | obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o |
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c new file mode 100644 index 000000000000..286bb490a9f2 --- /dev/null +++ b/drivers/input/touchscreen/88pm860x-ts.c | |||
@@ -0,0 +1,236 @@ | |||
1 | /* | ||
2 | * Touchscreen driver for Marvell 88PM860x | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/input.h> | ||
16 | #include <linux/mfd/88pm860x.h> | ||
17 | |||
18 | #define MEAS_LEN (8) | ||
19 | #define ACCURATE_BIT (12) | ||
20 | |||
21 | /* touch register */ | ||
22 | #define MEAS_EN3 (0x52) | ||
23 | |||
24 | #define MEAS_TSIX_1 (0x8D) | ||
25 | #define MEAS_TSIX_2 (0x8E) | ||
26 | #define MEAS_TSIY_1 (0x8F) | ||
27 | #define MEAS_TSIY_2 (0x90) | ||
28 | #define MEAS_TSIZ1_1 (0x91) | ||
29 | #define MEAS_TSIZ1_2 (0x92) | ||
30 | #define MEAS_TSIZ2_1 (0x93) | ||
31 | #define MEAS_TSIZ2_2 (0x94) | ||
32 | |||
33 | /* bit definitions of touch */ | ||
34 | #define MEAS_PD_EN (1 << 3) | ||
35 | #define MEAS_TSIX_EN (1 << 4) | ||
36 | #define MEAS_TSIY_EN (1 << 5) | ||
37 | #define MEAS_TSIZ1_EN (1 << 6) | ||
38 | #define MEAS_TSIZ2_EN (1 << 7) | ||
39 | |||
40 | struct pm860x_touch { | ||
41 | struct input_dev *idev; | ||
42 | struct i2c_client *i2c; | ||
43 | struct pm860x_chip *chip; | ||
44 | int irq; | ||
45 | int res_x; /* resistor of Xplate */ | ||
46 | }; | ||
47 | |||
48 | static irqreturn_t pm860x_touch_handler(int irq, void *data) | ||
49 | { | ||
50 | struct pm860x_touch *touch = data; | ||
51 | struct pm860x_chip *chip = touch->chip; | ||
52 | unsigned char buf[MEAS_LEN]; | ||
53 | int x, y, pen_down; | ||
54 | int z1, z2, rt = 0; | ||
55 | int ret; | ||
56 | |||
57 | ret = pm860x_bulk_read(touch->i2c, MEAS_TSIX_1, MEAS_LEN, buf); | ||
58 | if (ret < 0) | ||
59 | goto out; | ||
60 | |||
61 | pen_down = buf[1] & (1 << 6); | ||
62 | x = ((buf[0] & 0xFF) << 4) | (buf[1] & 0x0F); | ||
63 | y = ((buf[2] & 0xFF) << 4) | (buf[3] & 0x0F); | ||
64 | z1 = ((buf[4] & 0xFF) << 4) | (buf[5] & 0x0F); | ||
65 | z2 = ((buf[6] & 0xFF) << 4) | (buf[7] & 0x0F); | ||
66 | |||
67 | if (pen_down) { | ||
68 | if ((x != 0) && (z1 != 0) && (touch->res_x != 0)) { | ||
69 | rt = z2 / z1 - 1; | ||
70 | rt = (rt * touch->res_x * x) >> ACCURATE_BIT; | ||
71 | dev_dbg(chip->dev, "z1:%d, z2:%d, rt:%d\n", | ||
72 | z1, z2, rt); | ||
73 | } | ||
74 | input_report_abs(touch->idev, ABS_X, x); | ||
75 | input_report_abs(touch->idev, ABS_Y, y); | ||
76 | input_report_abs(touch->idev, ABS_PRESSURE, rt); | ||
77 | input_report_key(touch->idev, BTN_TOUCH, 1); | ||
78 | dev_dbg(chip->dev, "pen down at [%d, %d].\n", x, y); | ||
79 | } else { | ||
80 | input_report_abs(touch->idev, ABS_PRESSURE, 0); | ||
81 | input_report_key(touch->idev, BTN_TOUCH, 0); | ||
82 | dev_dbg(chip->dev, "pen release\n"); | ||
83 | } | ||
84 | input_sync(touch->idev); | ||
85 | |||
86 | out: | ||
87 | return IRQ_HANDLED; | ||
88 | } | ||
89 | |||
90 | static int pm860x_touch_open(struct input_dev *dev) | ||
91 | { | ||
92 | struct pm860x_touch *touch = input_get_drvdata(dev); | ||
93 | int data, ret; | ||
94 | |||
95 | data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN | ||
96 | | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN; | ||
97 | ret = pm860x_set_bits(touch->i2c, MEAS_EN3, data, data); | ||
98 | if (ret < 0) | ||
99 | goto out; | ||
100 | return 0; | ||
101 | out: | ||
102 | return ret; | ||
103 | } | ||
104 | |||
105 | static void pm860x_touch_close(struct input_dev *dev) | ||
106 | { | ||
107 | struct pm860x_touch *touch = input_get_drvdata(dev); | ||
108 | int data; | ||
109 | |||
110 | data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN | ||
111 | | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN; | ||
112 | pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0); | ||
113 | } | ||
114 | |||
115 | static int __devinit pm860x_touch_probe(struct platform_device *pdev) | ||
116 | { | ||
117 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
118 | struct pm860x_platform_data *pm860x_pdata = \ | ||
119 | pdev->dev.parent->platform_data; | ||
120 | struct pm860x_touch_pdata *pdata = NULL; | ||
121 | struct pm860x_touch *touch; | ||
122 | int irq, ret; | ||
123 | |||
124 | irq = platform_get_irq(pdev, 0); | ||
125 | if (irq < 0) { | ||
126 | dev_err(&pdev->dev, "No IRQ resource!\n"); | ||
127 | return -EINVAL; | ||
128 | } | ||
129 | |||
130 | if (!pm860x_pdata) { | ||
131 | dev_err(&pdev->dev, "platform data is missing\n"); | ||
132 | return -EINVAL; | ||
133 | } | ||
134 | |||
135 | pdata = pm860x_pdata->touch; | ||
136 | if (!pdata) { | ||
137 | dev_err(&pdev->dev, "touchscreen data is missing\n"); | ||
138 | return -EINVAL; | ||
139 | } | ||
140 | |||
141 | touch = kzalloc(sizeof(struct pm860x_touch), GFP_KERNEL); | ||
142 | if (touch == NULL) | ||
143 | return -ENOMEM; | ||
144 | dev_set_drvdata(&pdev->dev, touch); | ||
145 | |||
146 | touch->idev = input_allocate_device(); | ||
147 | if (touch->idev == NULL) { | ||
148 | dev_err(&pdev->dev, "Failed to allocate input device!\n"); | ||
149 | ret = -ENOMEM; | ||
150 | goto out; | ||
151 | } | ||
152 | |||
153 | touch->idev->name = "88pm860x-touch"; | ||
154 | touch->idev->phys = "88pm860x/input0"; | ||
155 | touch->idev->id.bustype = BUS_I2C; | ||
156 | touch->idev->dev.parent = &pdev->dev; | ||
157 | touch->idev->open = pm860x_touch_open; | ||
158 | touch->idev->close = pm860x_touch_close; | ||
159 | touch->chip = chip; | ||
160 | touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | ||
161 | touch->irq = irq + chip->irq_base; | ||
162 | touch->res_x = pdata->res_x; | ||
163 | input_set_drvdata(touch->idev, touch); | ||
164 | |||
165 | ret = request_threaded_irq(touch->irq, NULL, pm860x_touch_handler, | ||
166 | IRQF_ONESHOT, "touch", touch); | ||
167 | if (ret < 0) | ||
168 | goto out_irq; | ||
169 | |||
170 | __set_bit(EV_ABS, touch->idev->evbit); | ||
171 | __set_bit(ABS_X, touch->idev->absbit); | ||
172 | __set_bit(ABS_Y, touch->idev->absbit); | ||
173 | __set_bit(ABS_PRESSURE, touch->idev->absbit); | ||
174 | __set_bit(EV_SYN, touch->idev->evbit); | ||
175 | __set_bit(EV_KEY, touch->idev->evbit); | ||
176 | __set_bit(BTN_TOUCH, touch->idev->keybit); | ||
177 | |||
178 | input_set_abs_params(touch->idev, ABS_X, 0, 1 << ACCURATE_BIT, 0, 0); | ||
179 | input_set_abs_params(touch->idev, ABS_Y, 0, 1 << ACCURATE_BIT, 0, 0); | ||
180 | input_set_abs_params(touch->idev, ABS_PRESSURE, 0, 1 << ACCURATE_BIT, | ||
181 | 0, 0); | ||
182 | |||
183 | ret = input_register_device(touch->idev); | ||
184 | if (ret < 0) { | ||
185 | dev_err(chip->dev, "Failed to register touch!\n"); | ||
186 | goto out_rg; | ||
187 | } | ||
188 | |||
189 | platform_set_drvdata(pdev, touch); | ||
190 | return 0; | ||
191 | out_rg: | ||
192 | free_irq(touch->irq, touch); | ||
193 | out_irq: | ||
194 | input_free_device(touch->idev); | ||
195 | out: | ||
196 | kfree(touch); | ||
197 | return ret; | ||
198 | } | ||
199 | |||
200 | static int __devexit pm860x_touch_remove(struct platform_device *pdev) | ||
201 | { | ||
202 | struct pm860x_touch *touch = platform_get_drvdata(pdev); | ||
203 | |||
204 | input_unregister_device(touch->idev); | ||
205 | free_irq(touch->irq, touch); | ||
206 | platform_set_drvdata(pdev, NULL); | ||
207 | kfree(touch); | ||
208 | return 0; | ||
209 | } | ||
210 | |||
211 | static struct platform_driver pm860x_touch_driver = { | ||
212 | .driver = { | ||
213 | .name = "88pm860x-touch", | ||
214 | .owner = THIS_MODULE, | ||
215 | }, | ||
216 | .probe = pm860x_touch_probe, | ||
217 | .remove = __devexit_p(pm860x_touch_remove), | ||
218 | }; | ||
219 | |||
220 | static int __init pm860x_touch_init(void) | ||
221 | { | ||
222 | return platform_driver_register(&pm860x_touch_driver); | ||
223 | } | ||
224 | module_init(pm860x_touch_init); | ||
225 | |||
226 | static void __exit pm860x_touch_exit(void) | ||
227 | { | ||
228 | platform_driver_unregister(&pm860x_touch_driver); | ||
229 | } | ||
230 | module_exit(pm860x_touch_exit); | ||
231 | |||
232 | MODULE_DESCRIPTION("Touchscreen driver for Marvell Semiconductor 88PM860x"); | ||
233 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
234 | MODULE_LICENSE("GPL"); | ||
235 | MODULE_ALIAS("platform:88pm860x-touch"); | ||
236 | |||
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 6457e060ae49..7208654a94ae 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -11,6 +11,18 @@ menuconfig INPUT_TOUCHSCREEN | |||
11 | 11 | ||
12 | if INPUT_TOUCHSCREEN | 12 | if INPUT_TOUCHSCREEN |
13 | 13 | ||
14 | config TOUCHSCREEN_88PM860X | ||
15 | tristate "Marvell 88PM860x touchscreen" | ||
16 | depends on MFD_88PM860X | ||
17 | help | ||
18 | Say Y here if you have a 88PM860x PMIC and want to enable | ||
19 | support for the built-in touchscreen. | ||
20 | |||
21 | If unsure, say N. | ||
22 | |||
23 | To compile this driver as a module, choose M here: the | ||
24 | module will be called 88pm860x-ts. | ||
25 | |||
14 | config TOUCHSCREEN_ADS7846 | 26 | config TOUCHSCREEN_ADS7846 |
15 | tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" | 27 | tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" |
16 | depends on SPI_MASTER | 28 | depends on SPI_MASTER |
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index d61a3b4def9a..7fef7d5cca23 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | wm97xx-ts-y := wm97xx-core.o | 7 | wm97xx-ts-y := wm97xx-core.o |
8 | 8 | ||
9 | obj-$(CONFIG_TOUCHSCREEN_88PM860X) += 88pm860x-ts.o | ||
9 | obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o | 10 | obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o |
10 | obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o | 11 | obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o |
11 | obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o | 12 | obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 8a0e1ec95e4a..e0b64312e66a 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -17,6 +17,13 @@ config LEDS_CLASS | |||
17 | 17 | ||
18 | comment "LED drivers" | 18 | comment "LED drivers" |
19 | 19 | ||
20 | config LEDS_88PM860X | ||
21 | tristate "LED Support for Marvell 88PM860x PMIC" | ||
22 | depends on LEDS_CLASS && MFD_88PM860X | ||
23 | help | ||
24 | This option enables support for on-chip LED drivers found on Marvell | ||
25 | Semiconductor 88PM8606 PMIC. | ||
26 | |||
20 | config LEDS_ATMEL_PWM | 27 | config LEDS_ATMEL_PWM |
21 | tristate "LED Support using Atmel PWM outputs" | 28 | tristate "LED Support using Atmel PWM outputs" |
22 | depends on LEDS_CLASS && ATMEL_PWM | 29 | depends on LEDS_CLASS && ATMEL_PWM |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 9e63869d7c0d..d76fb32b77c0 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -5,6 +5,7 @@ obj-$(CONFIG_LEDS_CLASS) += led-class.o | |||
5 | obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o | 5 | obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o |
6 | 6 | ||
7 | # LED Platform Drivers | 7 | # LED Platform Drivers |
8 | obj-$(CONFIG_LEDS_88PM860X) += leds-88pm860x.o | ||
8 | obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o | 9 | obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o |
9 | obj-$(CONFIG_LEDS_BD2802) += leds-bd2802.o | 10 | obj-$(CONFIG_LEDS_BD2802) += leds-bd2802.o |
10 | obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o | 11 | obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o |
diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c new file mode 100644 index 000000000000..d196073a6aeb --- /dev/null +++ b/drivers/leds/leds-88pm860x.c | |||
@@ -0,0 +1,325 @@ | |||
1 | /* | ||
2 | * LED driver for Marvell 88PM860x | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/leds.h> | ||
18 | #include <linux/workqueue.h> | ||
19 | #include <linux/mfd/88pm860x.h> | ||
20 | |||
21 | #define LED_PWM_SHIFT (3) | ||
22 | #define LED_PWM_MASK (0x1F) | ||
23 | #define LED_CURRENT_MASK (0x07 << 5) | ||
24 | |||
25 | #define LED_BLINK_ON_MASK (0x07) | ||
26 | #define LED_BLINK_PERIOD_MASK (0x0F << 3) | ||
27 | #define LED_BLINK_MASK (0x7F) | ||
28 | |||
29 | #define LED_BLINK_ON(x) ((x & 0x7) * 66 + 66) | ||
30 | #define LED_BLINK_PERIOD(x) ((x & 0xF) * 530 + 930) | ||
31 | #define LED_BLINK_ON_MIN LED_BLINK_ON(0) | ||
32 | #define LED_BLINK_ON_MAX LED_BLINK_ON(0x7) | ||
33 | #define LED_BLINK_PERIOD_MIN LED_BLINK_PERIOD(0) | ||
34 | #define LED_BLINK_PERIOD_MAX LED_BLINK_PERIOD(0xE) | ||
35 | #define LED_TO_ON(x) ((x - 66) / 66) | ||
36 | #define LED_TO_PERIOD(x) ((x - 930) / 530) | ||
37 | |||
38 | #define LED1_BLINK_EN (1 << 1) | ||
39 | #define LED2_BLINK_EN (1 << 2) | ||
40 | |||
41 | enum { | ||
42 | SET_BRIGHTNESS, | ||
43 | SET_BLINK, | ||
44 | }; | ||
45 | |||
46 | struct pm860x_led { | ||
47 | struct led_classdev cdev; | ||
48 | struct i2c_client *i2c; | ||
49 | struct work_struct work; | ||
50 | struct pm860x_chip *chip; | ||
51 | struct mutex lock; | ||
52 | char name[MFD_NAME_SIZE]; | ||
53 | |||
54 | int port; | ||
55 | int iset; | ||
56 | int command; | ||
57 | int offset; | ||
58 | unsigned char brightness; | ||
59 | unsigned char current_brightness; | ||
60 | |||
61 | int blink_data; | ||
62 | int blink_time; | ||
63 | int blink_on; | ||
64 | int blink_off; | ||
65 | }; | ||
66 | |||
67 | /* return offset of color register */ | ||
68 | static inline int __led_off(int port) | ||
69 | { | ||
70 | int ret = -EINVAL; | ||
71 | |||
72 | switch (port) { | ||
73 | case PM8606_LED1_RED: | ||
74 | case PM8606_LED1_GREEN: | ||
75 | case PM8606_LED1_BLUE: | ||
76 | ret = port - PM8606_LED1_RED + PM8606_RGB1B; | ||
77 | break; | ||
78 | case PM8606_LED2_RED: | ||
79 | case PM8606_LED2_GREEN: | ||
80 | case PM8606_LED2_BLUE: | ||
81 | ret = port - PM8606_LED2_RED + PM8606_RGB2B; | ||
82 | break; | ||
83 | } | ||
84 | return ret; | ||
85 | } | ||
86 | |||
87 | /* return offset of blink register */ | ||
88 | static inline int __blink_off(int port) | ||
89 | { | ||
90 | int ret = -EINVAL; | ||
91 | |||
92 | switch (port) { | ||
93 | case PM8606_LED1_RED: | ||
94 | case PM8606_LED1_GREEN: | ||
95 | case PM8606_LED1_BLUE: | ||
96 | ret = PM8606_RGB1A; | ||
97 | case PM8606_LED2_RED: | ||
98 | case PM8606_LED2_GREEN: | ||
99 | case PM8606_LED2_BLUE: | ||
100 | ret = PM8606_RGB2A; | ||
101 | } | ||
102 | return ret; | ||
103 | } | ||
104 | |||
105 | static inline int __blink_ctl_mask(int port) | ||
106 | { | ||
107 | int ret = -EINVAL; | ||
108 | |||
109 | switch (port) { | ||
110 | case PM8606_LED1_RED: | ||
111 | case PM8606_LED1_GREEN: | ||
112 | case PM8606_LED1_BLUE: | ||
113 | ret = LED1_BLINK_EN; | ||
114 | break; | ||
115 | case PM8606_LED2_RED: | ||
116 | case PM8606_LED2_GREEN: | ||
117 | case PM8606_LED2_BLUE: | ||
118 | ret = LED2_BLINK_EN; | ||
119 | break; | ||
120 | } | ||
121 | return ret; | ||
122 | } | ||
123 | |||
124 | static int __led_set(struct pm860x_led *led, int command) | ||
125 | { | ||
126 | struct pm860x_chip *chip = led->chip; | ||
127 | int mask, ret; | ||
128 | |||
129 | mutex_lock(&led->lock); | ||
130 | switch (command) { | ||
131 | case SET_BRIGHTNESS: | ||
132 | if ((led->current_brightness == 0) && led->brightness) { | ||
133 | if (led->iset) { | ||
134 | ret = pm860x_set_bits(led->i2c, led->offset, | ||
135 | LED_CURRENT_MASK, led->iset); | ||
136 | if (ret < 0) | ||
137 | goto out; | ||
138 | } | ||
139 | } else if (led->brightness == 0) { | ||
140 | ret = pm860x_set_bits(led->i2c, led->offset, | ||
141 | LED_CURRENT_MASK, 0); | ||
142 | if (ret < 0) | ||
143 | goto out; | ||
144 | } | ||
145 | ret = pm860x_set_bits(led->i2c, led->offset, LED_PWM_MASK, | ||
146 | led->brightness); | ||
147 | if (ret < 0) | ||
148 | goto out; | ||
149 | led->current_brightness = led->brightness; | ||
150 | dev_dbg(chip->dev, "Update LED. (reg:%d, brightness:%d)\n", | ||
151 | led->offset, led->brightness); | ||
152 | break; | ||
153 | case SET_BLINK: | ||
154 | ret = pm860x_set_bits(led->i2c, led->offset, | ||
155 | LED_BLINK_MASK, led->blink_data); | ||
156 | if (ret < 0) | ||
157 | goto out; | ||
158 | |||
159 | mask = __blink_ctl_mask(led->port); | ||
160 | ret = pm860x_set_bits(led->i2c, PM8606_WLED3B, mask, mask); | ||
161 | if (ret < 0) | ||
162 | goto out; | ||
163 | dev_dbg(chip->dev, "LED blink delay on:%dms, delay off:%dms\n", | ||
164 | led->blink_on, led->blink_off); | ||
165 | break; | ||
166 | } | ||
167 | out: | ||
168 | mutex_unlock(&led->lock); | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | static void pm860x_led_work(struct work_struct *work) | ||
173 | { | ||
174 | struct pm860x_led *led; | ||
175 | |||
176 | led = container_of(work, struct pm860x_led, work); | ||
177 | __led_set(led, led->command); | ||
178 | } | ||
179 | |||
180 | static void pm860x_led_set(struct led_classdev *cdev, | ||
181 | enum led_brightness value) | ||
182 | { | ||
183 | struct pm860x_led *data = container_of(cdev, struct pm860x_led, cdev); | ||
184 | |||
185 | data->offset = __led_off(data->port); | ||
186 | data->brightness = value >> 3; | ||
187 | data->command = SET_BRIGHTNESS; | ||
188 | schedule_work(&data->work); | ||
189 | } | ||
190 | |||
191 | static int pm860x_led_blink(struct led_classdev *cdev, | ||
192 | unsigned long *delay_on, | ||
193 | unsigned long *delay_off) | ||
194 | { | ||
195 | struct pm860x_led *data = container_of(cdev, struct pm860x_led, cdev); | ||
196 | int period, on; | ||
197 | |||
198 | on = *delay_on; | ||
199 | if ((on < LED_BLINK_ON_MIN) || (on > LED_BLINK_ON_MAX)) | ||
200 | return -EINVAL; | ||
201 | |||
202 | on = LED_TO_ON(on); | ||
203 | on = LED_BLINK_ON(on); | ||
204 | |||
205 | period = on + *delay_off; | ||
206 | if ((period < LED_BLINK_PERIOD_MIN) || (period > LED_BLINK_PERIOD_MAX)) | ||
207 | return -EINVAL; | ||
208 | period = LED_TO_PERIOD(period); | ||
209 | period = LED_BLINK_PERIOD(period); | ||
210 | |||
211 | data->offset = __blink_off(data->port); | ||
212 | data->blink_on = on; | ||
213 | data->blink_off = period - data->blink_on; | ||
214 | data->blink_data = (period << 3) | data->blink_on; | ||
215 | data->command = SET_BLINK; | ||
216 | schedule_work(&data->work); | ||
217 | |||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static int __check_device(struct pm860x_led_pdata *pdata, char *name) | ||
222 | { | ||
223 | struct pm860x_led_pdata *p = pdata; | ||
224 | int ret = -EINVAL; | ||
225 | |||
226 | while (p && p->id) { | ||
227 | if ((p->id != PM8606_ID_LED) || (p->flags < 0)) | ||
228 | break; | ||
229 | |||
230 | if (!strncmp(name, pm860x_led_name[p->flags], | ||
231 | MFD_NAME_SIZE)) { | ||
232 | ret = (int)p->flags; | ||
233 | break; | ||
234 | } | ||
235 | p++; | ||
236 | } | ||
237 | return ret; | ||
238 | } | ||
239 | |||
240 | static int pm860x_led_probe(struct platform_device *pdev) | ||
241 | { | ||
242 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
243 | struct pm860x_platform_data *pm860x_pdata; | ||
244 | struct pm860x_led_pdata *pdata; | ||
245 | struct pm860x_led *data; | ||
246 | struct resource *res; | ||
247 | int ret; | ||
248 | |||
249 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | ||
250 | if (res == NULL) { | ||
251 | dev_err(&pdev->dev, "No I/O resource!\n"); | ||
252 | return -EINVAL; | ||
253 | } | ||
254 | |||
255 | if (pdev->dev.parent->platform_data) { | ||
256 | pm860x_pdata = pdev->dev.parent->platform_data; | ||
257 | pdata = pm860x_pdata->led; | ||
258 | } else | ||
259 | pdata = NULL; | ||
260 | |||
261 | data = kzalloc(sizeof(struct pm860x_led), GFP_KERNEL); | ||
262 | if (data == NULL) | ||
263 | return -ENOMEM; | ||
264 | strncpy(data->name, res->name, MFD_NAME_SIZE); | ||
265 | dev_set_drvdata(&pdev->dev, data); | ||
266 | data->chip = chip; | ||
267 | data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion; | ||
268 | data->iset = pdata->iset; | ||
269 | data->port = __check_device(pdata, data->name); | ||
270 | if (data->port < 0) | ||
271 | return -EINVAL; | ||
272 | |||
273 | data->current_brightness = 0; | ||
274 | data->cdev.name = data->name; | ||
275 | data->cdev.brightness_set = pm860x_led_set; | ||
276 | data->cdev.blink_set = pm860x_led_blink; | ||
277 | mutex_init(&data->lock); | ||
278 | INIT_WORK(&data->work, pm860x_led_work); | ||
279 | |||
280 | ret = led_classdev_register(chip->dev, &data->cdev); | ||
281 | if (ret < 0) { | ||
282 | dev_err(&pdev->dev, "Failed to register LED: %d\n", ret); | ||
283 | goto out; | ||
284 | } | ||
285 | return 0; | ||
286 | out: | ||
287 | kfree(data); | ||
288 | return ret; | ||
289 | } | ||
290 | |||
291 | static int pm860x_led_remove(struct platform_device *pdev) | ||
292 | { | ||
293 | struct pm860x_led *data = platform_get_drvdata(pdev); | ||
294 | |||
295 | led_classdev_unregister(&data->cdev); | ||
296 | kfree(data); | ||
297 | |||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | static struct platform_driver pm860x_led_driver = { | ||
302 | .driver = { | ||
303 | .name = "88pm860x-led", | ||
304 | .owner = THIS_MODULE, | ||
305 | }, | ||
306 | .probe = pm860x_led_probe, | ||
307 | .remove = pm860x_led_remove, | ||
308 | }; | ||
309 | |||
310 | static int __devinit pm860x_led_init(void) | ||
311 | { | ||
312 | return platform_driver_register(&pm860x_led_driver); | ||
313 | } | ||
314 | module_init(pm860x_led_init); | ||
315 | |||
316 | static void __devexit pm860x_led_exit(void) | ||
317 | { | ||
318 | platform_driver_unregister(&pm860x_led_driver); | ||
319 | } | ||
320 | module_exit(pm860x_led_exit); | ||
321 | |||
322 | MODULE_DESCRIPTION("LED driver for Marvell PM860x"); | ||
323 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
324 | MODULE_LICENSE("GPL"); | ||
325 | MODULE_ALIAS("platform:88pm860x-led"); | ||
diff --git a/drivers/mfd/88pm8607.c b/drivers/mfd/88pm8607.c deleted file mode 100644 index 7e3f65907993..000000000000 --- a/drivers/mfd/88pm8607.c +++ /dev/null | |||
@@ -1,302 +0,0 @@ | |||
1 | /* | ||
2 | * Base driver for Marvell 88PM8607 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/mfd/core.h> | ||
18 | #include <linux/mfd/88pm8607.h> | ||
19 | |||
20 | |||
21 | #define PM8607_REG_RESOURCE(_start, _end) \ | ||
22 | { \ | ||
23 | .start = PM8607_##_start, \ | ||
24 | .end = PM8607_##_end, \ | ||
25 | .flags = IORESOURCE_IO, \ | ||
26 | } | ||
27 | |||
28 | static struct resource pm8607_regulator_resources[] = { | ||
29 | PM8607_REG_RESOURCE(BUCK1, BUCK1), | ||
30 | PM8607_REG_RESOURCE(BUCK2, BUCK2), | ||
31 | PM8607_REG_RESOURCE(BUCK3, BUCK3), | ||
32 | PM8607_REG_RESOURCE(LDO1, LDO1), | ||
33 | PM8607_REG_RESOURCE(LDO2, LDO2), | ||
34 | PM8607_REG_RESOURCE(LDO3, LDO3), | ||
35 | PM8607_REG_RESOURCE(LDO4, LDO4), | ||
36 | PM8607_REG_RESOURCE(LDO5, LDO5), | ||
37 | PM8607_REG_RESOURCE(LDO6, LDO6), | ||
38 | PM8607_REG_RESOURCE(LDO7, LDO7), | ||
39 | PM8607_REG_RESOURCE(LDO8, LDO8), | ||
40 | PM8607_REG_RESOURCE(LDO9, LDO9), | ||
41 | PM8607_REG_RESOURCE(LDO10, LDO10), | ||
42 | PM8607_REG_RESOURCE(LDO12, LDO12), | ||
43 | PM8607_REG_RESOURCE(LDO14, LDO14), | ||
44 | }; | ||
45 | |||
46 | #define PM8607_REG_DEVS(_name, _id) \ | ||
47 | { \ | ||
48 | .name = "88pm8607-" #_name, \ | ||
49 | .num_resources = 1, \ | ||
50 | .resources = &pm8607_regulator_resources[PM8607_ID_##_id], \ | ||
51 | } | ||
52 | |||
53 | static struct mfd_cell pm8607_devs[] = { | ||
54 | PM8607_REG_DEVS(buck1, BUCK1), | ||
55 | PM8607_REG_DEVS(buck2, BUCK2), | ||
56 | PM8607_REG_DEVS(buck3, BUCK3), | ||
57 | PM8607_REG_DEVS(ldo1, LDO1), | ||
58 | PM8607_REG_DEVS(ldo2, LDO2), | ||
59 | PM8607_REG_DEVS(ldo3, LDO3), | ||
60 | PM8607_REG_DEVS(ldo4, LDO4), | ||
61 | PM8607_REG_DEVS(ldo5, LDO5), | ||
62 | PM8607_REG_DEVS(ldo6, LDO6), | ||
63 | PM8607_REG_DEVS(ldo7, LDO7), | ||
64 | PM8607_REG_DEVS(ldo8, LDO8), | ||
65 | PM8607_REG_DEVS(ldo9, LDO9), | ||
66 | PM8607_REG_DEVS(ldo10, LDO10), | ||
67 | PM8607_REG_DEVS(ldo12, LDO12), | ||
68 | PM8607_REG_DEVS(ldo14, LDO14), | ||
69 | }; | ||
70 | |||
71 | static inline int pm8607_read_device(struct pm8607_chip *chip, | ||
72 | int reg, int bytes, void *dest) | ||
73 | { | ||
74 | struct i2c_client *i2c = chip->client; | ||
75 | unsigned char data; | ||
76 | int ret; | ||
77 | |||
78 | data = (unsigned char)reg; | ||
79 | ret = i2c_master_send(i2c, &data, 1); | ||
80 | if (ret < 0) | ||
81 | return ret; | ||
82 | |||
83 | ret = i2c_master_recv(i2c, dest, bytes); | ||
84 | if (ret < 0) | ||
85 | return ret; | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | static inline int pm8607_write_device(struct pm8607_chip *chip, | ||
90 | int reg, int bytes, void *src) | ||
91 | { | ||
92 | struct i2c_client *i2c = chip->client; | ||
93 | unsigned char buf[bytes + 1]; | ||
94 | int ret; | ||
95 | |||
96 | buf[0] = (unsigned char)reg; | ||
97 | memcpy(&buf[1], src, bytes); | ||
98 | |||
99 | ret = i2c_master_send(i2c, buf, bytes + 1); | ||
100 | if (ret < 0) | ||
101 | return ret; | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | int pm8607_reg_read(struct pm8607_chip *chip, int reg) | ||
106 | { | ||
107 | unsigned char data; | ||
108 | int ret; | ||
109 | |||
110 | mutex_lock(&chip->io_lock); | ||
111 | ret = chip->read(chip, reg, 1, &data); | ||
112 | mutex_unlock(&chip->io_lock); | ||
113 | |||
114 | if (ret < 0) | ||
115 | return ret; | ||
116 | else | ||
117 | return (int)data; | ||
118 | } | ||
119 | EXPORT_SYMBOL(pm8607_reg_read); | ||
120 | |||
121 | int pm8607_reg_write(struct pm8607_chip *chip, int reg, | ||
122 | unsigned char data) | ||
123 | { | ||
124 | int ret; | ||
125 | |||
126 | mutex_lock(&chip->io_lock); | ||
127 | ret = chip->write(chip, reg, 1, &data); | ||
128 | mutex_unlock(&chip->io_lock); | ||
129 | |||
130 | return ret; | ||
131 | } | ||
132 | EXPORT_SYMBOL(pm8607_reg_write); | ||
133 | |||
134 | int pm8607_bulk_read(struct pm8607_chip *chip, int reg, | ||
135 | int count, unsigned char *buf) | ||
136 | { | ||
137 | int ret; | ||
138 | |||
139 | mutex_lock(&chip->io_lock); | ||
140 | ret = chip->read(chip, reg, count, buf); | ||
141 | mutex_unlock(&chip->io_lock); | ||
142 | |||
143 | return ret; | ||
144 | } | ||
145 | EXPORT_SYMBOL(pm8607_bulk_read); | ||
146 | |||
147 | int pm8607_bulk_write(struct pm8607_chip *chip, int reg, | ||
148 | int count, unsigned char *buf) | ||
149 | { | ||
150 | int ret; | ||
151 | |||
152 | mutex_lock(&chip->io_lock); | ||
153 | ret = chip->write(chip, reg, count, buf); | ||
154 | mutex_unlock(&chip->io_lock); | ||
155 | |||
156 | return ret; | ||
157 | } | ||
158 | EXPORT_SYMBOL(pm8607_bulk_write); | ||
159 | |||
160 | int pm8607_set_bits(struct pm8607_chip *chip, int reg, | ||
161 | unsigned char mask, unsigned char data) | ||
162 | { | ||
163 | unsigned char value; | ||
164 | int ret; | ||
165 | |||
166 | mutex_lock(&chip->io_lock); | ||
167 | ret = chip->read(chip, reg, 1, &value); | ||
168 | if (ret < 0) | ||
169 | goto out; | ||
170 | value &= ~mask; | ||
171 | value |= data; | ||
172 | ret = chip->write(chip, reg, 1, &value); | ||
173 | out: | ||
174 | mutex_unlock(&chip->io_lock); | ||
175 | return ret; | ||
176 | } | ||
177 | EXPORT_SYMBOL(pm8607_set_bits); | ||
178 | |||
179 | |||
180 | static const struct i2c_device_id pm8607_id_table[] = { | ||
181 | { "88PM8607", 0 }, | ||
182 | {} | ||
183 | }; | ||
184 | MODULE_DEVICE_TABLE(i2c, pm8607_id_table); | ||
185 | |||
186 | |||
187 | static int __devinit pm8607_probe(struct i2c_client *client, | ||
188 | const struct i2c_device_id *id) | ||
189 | { | ||
190 | struct pm8607_platform_data *pdata = client->dev.platform_data; | ||
191 | struct pm8607_chip *chip; | ||
192 | int i, count; | ||
193 | int ret; | ||
194 | |||
195 | chip = kzalloc(sizeof(struct pm8607_chip), GFP_KERNEL); | ||
196 | if (chip == NULL) | ||
197 | return -ENOMEM; | ||
198 | |||
199 | chip->client = client; | ||
200 | chip->dev = &client->dev; | ||
201 | chip->read = pm8607_read_device; | ||
202 | chip->write = pm8607_write_device; | ||
203 | i2c_set_clientdata(client, chip); | ||
204 | |||
205 | mutex_init(&chip->io_lock); | ||
206 | dev_set_drvdata(chip->dev, chip); | ||
207 | |||
208 | ret = pm8607_reg_read(chip, PM8607_CHIP_ID); | ||
209 | if (ret < 0) { | ||
210 | dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); | ||
211 | goto out; | ||
212 | } | ||
213 | if ((ret & CHIP_ID_MASK) == CHIP_ID) | ||
214 | dev_info(chip->dev, "Marvell 88PM8607 (ID: %02x) detected\n", | ||
215 | ret); | ||
216 | else { | ||
217 | dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " | ||
218 | "Chip ID: %02x\n", ret); | ||
219 | goto out; | ||
220 | } | ||
221 | chip->chip_id = ret; | ||
222 | |||
223 | ret = pm8607_reg_read(chip, PM8607_BUCK3); | ||
224 | if (ret < 0) { | ||
225 | dev_err(chip->dev, "Failed to read BUCK3 register: %d\n", ret); | ||
226 | goto out; | ||
227 | } | ||
228 | if (ret & PM8607_BUCK3_DOUBLE) | ||
229 | chip->buck3_double = 1; | ||
230 | |||
231 | ret = pm8607_reg_read(chip, PM8607_MISC1); | ||
232 | if (ret < 0) { | ||
233 | dev_err(chip->dev, "Failed to read MISC1 register: %d\n", ret); | ||
234 | goto out; | ||
235 | } | ||
236 | if (pdata->i2c_port == PI2C_PORT) | ||
237 | ret |= PM8607_MISC1_PI2C; | ||
238 | else | ||
239 | ret &= ~PM8607_MISC1_PI2C; | ||
240 | ret = pm8607_reg_write(chip, PM8607_MISC1, ret); | ||
241 | if (ret < 0) { | ||
242 | dev_err(chip->dev, "Failed to write MISC1 register: %d\n", ret); | ||
243 | goto out; | ||
244 | } | ||
245 | |||
246 | |||
247 | count = ARRAY_SIZE(pm8607_devs); | ||
248 | for (i = 0; i < count; i++) { | ||
249 | ret = mfd_add_devices(chip->dev, i, &pm8607_devs[i], | ||
250 | 1, NULL, 0); | ||
251 | if (ret != 0) { | ||
252 | dev_err(chip->dev, "Failed to add subdevs\n"); | ||
253 | goto out; | ||
254 | } | ||
255 | } | ||
256 | |||
257 | return 0; | ||
258 | |||
259 | out: | ||
260 | i2c_set_clientdata(client, NULL); | ||
261 | kfree(chip); | ||
262 | return ret; | ||
263 | } | ||
264 | |||
265 | static int __devexit pm8607_remove(struct i2c_client *client) | ||
266 | { | ||
267 | struct pm8607_chip *chip = i2c_get_clientdata(client); | ||
268 | |||
269 | mfd_remove_devices(chip->dev); | ||
270 | kfree(chip); | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | static struct i2c_driver pm8607_driver = { | ||
275 | .driver = { | ||
276 | .name = "88PM8607", | ||
277 | .owner = THIS_MODULE, | ||
278 | }, | ||
279 | .probe = pm8607_probe, | ||
280 | .remove = __devexit_p(pm8607_remove), | ||
281 | .id_table = pm8607_id_table, | ||
282 | }; | ||
283 | |||
284 | static int __init pm8607_init(void) | ||
285 | { | ||
286 | int ret; | ||
287 | ret = i2c_add_driver(&pm8607_driver); | ||
288 | if (ret != 0) | ||
289 | pr_err("Failed to register 88PM8607 I2C driver: %d\n", ret); | ||
290 | return ret; | ||
291 | } | ||
292 | subsys_initcall(pm8607_init); | ||
293 | |||
294 | static void __exit pm8607_exit(void) | ||
295 | { | ||
296 | i2c_del_driver(&pm8607_driver); | ||
297 | } | ||
298 | module_exit(pm8607_exit); | ||
299 | |||
300 | MODULE_DESCRIPTION("PMIC Driver for Marvell 88PM8607"); | ||
301 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
302 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c new file mode 100644 index 000000000000..6a14d2b1ccf0 --- /dev/null +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -0,0 +1,740 @@ | |||
1 | /* | ||
2 | * Base driver for Marvell 88PM8607 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/mfd/core.h> | ||
19 | #include <linux/mfd/88pm860x.h> | ||
20 | |||
21 | #define INT_STATUS_NUM 3 | ||
22 | |||
23 | char pm860x_backlight_name[][MFD_NAME_SIZE] = { | ||
24 | "backlight-0", | ||
25 | "backlight-1", | ||
26 | "backlight-2", | ||
27 | }; | ||
28 | EXPORT_SYMBOL(pm860x_backlight_name); | ||
29 | |||
30 | char pm860x_led_name[][MFD_NAME_SIZE] = { | ||
31 | "led0-red", | ||
32 | "led0-green", | ||
33 | "led0-blue", | ||
34 | "led1-red", | ||
35 | "led1-green", | ||
36 | "led1-blue", | ||
37 | }; | ||
38 | EXPORT_SYMBOL(pm860x_led_name); | ||
39 | |||
40 | #define PM8606_BACKLIGHT_RESOURCE(_i, _x) \ | ||
41 | { \ | ||
42 | .name = pm860x_backlight_name[_i], \ | ||
43 | .start = PM8606_##_x, \ | ||
44 | .end = PM8606_##_x, \ | ||
45 | .flags = IORESOURCE_IO, \ | ||
46 | } | ||
47 | |||
48 | static struct resource backlight_resources[] = { | ||
49 | PM8606_BACKLIGHT_RESOURCE(PM8606_BACKLIGHT1, WLED1A), | ||
50 | PM8606_BACKLIGHT_RESOURCE(PM8606_BACKLIGHT2, WLED2A), | ||
51 | PM8606_BACKLIGHT_RESOURCE(PM8606_BACKLIGHT3, WLED3A), | ||
52 | }; | ||
53 | |||
54 | #define PM8606_BACKLIGHT_DEVS(_i) \ | ||
55 | { \ | ||
56 | .name = "88pm860x-backlight", \ | ||
57 | .num_resources = 1, \ | ||
58 | .resources = &backlight_resources[_i], \ | ||
59 | .id = _i, \ | ||
60 | } | ||
61 | |||
62 | static struct mfd_cell backlight_devs[] = { | ||
63 | PM8606_BACKLIGHT_DEVS(PM8606_BACKLIGHT1), | ||
64 | PM8606_BACKLIGHT_DEVS(PM8606_BACKLIGHT2), | ||
65 | PM8606_BACKLIGHT_DEVS(PM8606_BACKLIGHT3), | ||
66 | }; | ||
67 | |||
68 | #define PM8606_LED_RESOURCE(_i, _x) \ | ||
69 | { \ | ||
70 | .name = pm860x_led_name[_i], \ | ||
71 | .start = PM8606_##_x, \ | ||
72 | .end = PM8606_##_x, \ | ||
73 | .flags = IORESOURCE_IO, \ | ||
74 | } | ||
75 | |||
76 | static struct resource led_resources[] = { | ||
77 | PM8606_LED_RESOURCE(PM8606_LED1_RED, RGB2B), | ||
78 | PM8606_LED_RESOURCE(PM8606_LED1_GREEN, RGB2C), | ||
79 | PM8606_LED_RESOURCE(PM8606_LED1_BLUE, RGB2D), | ||
80 | PM8606_LED_RESOURCE(PM8606_LED2_RED, RGB1B), | ||
81 | PM8606_LED_RESOURCE(PM8606_LED2_GREEN, RGB1C), | ||
82 | PM8606_LED_RESOURCE(PM8606_LED2_BLUE, RGB1D), | ||
83 | }; | ||
84 | |||
85 | #define PM8606_LED_DEVS(_i) \ | ||
86 | { \ | ||
87 | .name = "88pm860x-led", \ | ||
88 | .num_resources = 1, \ | ||
89 | .resources = &led_resources[_i], \ | ||
90 | .id = _i, \ | ||
91 | } | ||
92 | |||
93 | static struct mfd_cell led_devs[] = { | ||
94 | PM8606_LED_DEVS(PM8606_LED1_RED), | ||
95 | PM8606_LED_DEVS(PM8606_LED1_GREEN), | ||
96 | PM8606_LED_DEVS(PM8606_LED1_BLUE), | ||
97 | PM8606_LED_DEVS(PM8606_LED2_RED), | ||
98 | PM8606_LED_DEVS(PM8606_LED2_GREEN), | ||
99 | PM8606_LED_DEVS(PM8606_LED2_BLUE), | ||
100 | }; | ||
101 | |||
102 | static struct resource touch_resources[] = { | ||
103 | { | ||
104 | .start = PM8607_IRQ_PEN, | ||
105 | .end = PM8607_IRQ_PEN, | ||
106 | .flags = IORESOURCE_IRQ, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | static struct mfd_cell touch_devs[] = { | ||
111 | { | ||
112 | .name = "88pm860x-touch", | ||
113 | .num_resources = 1, | ||
114 | .resources = &touch_resources[0], | ||
115 | }, | ||
116 | }; | ||
117 | |||
118 | #define PM8607_REG_RESOURCE(_start, _end) \ | ||
119 | { \ | ||
120 | .start = PM8607_##_start, \ | ||
121 | .end = PM8607_##_end, \ | ||
122 | .flags = IORESOURCE_IO, \ | ||
123 | } | ||
124 | |||
125 | static struct resource power_supply_resources[] = { | ||
126 | { | ||
127 | .name = "88pm860x-power", | ||
128 | .start = PM8607_IRQ_CHG, | ||
129 | .end = PM8607_IRQ_CHG, | ||
130 | .flags = IORESOURCE_IRQ, | ||
131 | }, | ||
132 | }; | ||
133 | |||
134 | static struct mfd_cell power_devs[] = { | ||
135 | { | ||
136 | .name = "88pm860x-power", | ||
137 | .num_resources = 1, | ||
138 | .resources = &power_supply_resources[0], | ||
139 | .id = -1, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct resource onkey_resources[] = { | ||
144 | { | ||
145 | .name = "88pm860x-onkey", | ||
146 | .start = PM8607_IRQ_ONKEY, | ||
147 | .end = PM8607_IRQ_ONKEY, | ||
148 | .flags = IORESOURCE_IRQ, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | static struct mfd_cell onkey_devs[] = { | ||
153 | { | ||
154 | .name = "88pm860x-onkey", | ||
155 | .num_resources = 1, | ||
156 | .resources = &onkey_resources[0], | ||
157 | .id = -1, | ||
158 | }, | ||
159 | }; | ||
160 | |||
161 | static struct resource regulator_resources[] = { | ||
162 | PM8607_REG_RESOURCE(BUCK1, BUCK1), | ||
163 | PM8607_REG_RESOURCE(BUCK2, BUCK2), | ||
164 | PM8607_REG_RESOURCE(BUCK3, BUCK3), | ||
165 | PM8607_REG_RESOURCE(LDO1, LDO1), | ||
166 | PM8607_REG_RESOURCE(LDO2, LDO2), | ||
167 | PM8607_REG_RESOURCE(LDO3, LDO3), | ||
168 | PM8607_REG_RESOURCE(LDO4, LDO4), | ||
169 | PM8607_REG_RESOURCE(LDO5, LDO5), | ||
170 | PM8607_REG_RESOURCE(LDO6, LDO6), | ||
171 | PM8607_REG_RESOURCE(LDO7, LDO7), | ||
172 | PM8607_REG_RESOURCE(LDO8, LDO8), | ||
173 | PM8607_REG_RESOURCE(LDO9, LDO9), | ||
174 | PM8607_REG_RESOURCE(LDO10, LDO10), | ||
175 | PM8607_REG_RESOURCE(LDO12, LDO12), | ||
176 | PM8607_REG_RESOURCE(LDO14, LDO14), | ||
177 | }; | ||
178 | |||
179 | #define PM8607_REG_DEVS(_name, _id) \ | ||
180 | { \ | ||
181 | .name = "88pm8607-" #_name, \ | ||
182 | .num_resources = 1, \ | ||
183 | .resources = ®ulator_resources[PM8607_ID_##_id], \ | ||
184 | .id = PM8607_ID_##_id, \ | ||
185 | } | ||
186 | |||
187 | static struct mfd_cell regulator_devs[] = { | ||
188 | PM8607_REG_DEVS(buck1, BUCK1), | ||
189 | PM8607_REG_DEVS(buck2, BUCK2), | ||
190 | PM8607_REG_DEVS(buck3, BUCK3), | ||
191 | PM8607_REG_DEVS(ldo1, LDO1), | ||
192 | PM8607_REG_DEVS(ldo2, LDO2), | ||
193 | PM8607_REG_DEVS(ldo3, LDO3), | ||
194 | PM8607_REG_DEVS(ldo4, LDO4), | ||
195 | PM8607_REG_DEVS(ldo5, LDO5), | ||
196 | PM8607_REG_DEVS(ldo6, LDO6), | ||
197 | PM8607_REG_DEVS(ldo7, LDO7), | ||
198 | PM8607_REG_DEVS(ldo8, LDO8), | ||
199 | PM8607_REG_DEVS(ldo9, LDO9), | ||
200 | PM8607_REG_DEVS(ldo10, LDO10), | ||
201 | PM8607_REG_DEVS(ldo12, LDO12), | ||
202 | PM8607_REG_DEVS(ldo14, LDO14), | ||
203 | }; | ||
204 | |||
205 | struct pm860x_irq_data { | ||
206 | int reg; | ||
207 | int mask_reg; | ||
208 | int enable; /* enable or not */ | ||
209 | int offs; /* bit offset in mask register */ | ||
210 | }; | ||
211 | |||
212 | static struct pm860x_irq_data pm860x_irqs[] = { | ||
213 | [PM8607_IRQ_ONKEY] = { | ||
214 | .reg = PM8607_INT_STATUS1, | ||
215 | .mask_reg = PM8607_INT_MASK_1, | ||
216 | .offs = 1 << 0, | ||
217 | }, | ||
218 | [PM8607_IRQ_EXTON] = { | ||
219 | .reg = PM8607_INT_STATUS1, | ||
220 | .mask_reg = PM8607_INT_MASK_1, | ||
221 | .offs = 1 << 1, | ||
222 | }, | ||
223 | [PM8607_IRQ_CHG] = { | ||
224 | .reg = PM8607_INT_STATUS1, | ||
225 | .mask_reg = PM8607_INT_MASK_1, | ||
226 | .offs = 1 << 2, | ||
227 | }, | ||
228 | [PM8607_IRQ_BAT] = { | ||
229 | .reg = PM8607_INT_STATUS1, | ||
230 | .mask_reg = PM8607_INT_MASK_1, | ||
231 | .offs = 1 << 3, | ||
232 | }, | ||
233 | [PM8607_IRQ_RTC] = { | ||
234 | .reg = PM8607_INT_STATUS1, | ||
235 | .mask_reg = PM8607_INT_MASK_1, | ||
236 | .offs = 1 << 4, | ||
237 | }, | ||
238 | [PM8607_IRQ_CC] = { | ||
239 | .reg = PM8607_INT_STATUS1, | ||
240 | .mask_reg = PM8607_INT_MASK_1, | ||
241 | .offs = 1 << 5, | ||
242 | }, | ||
243 | [PM8607_IRQ_VBAT] = { | ||
244 | .reg = PM8607_INT_STATUS2, | ||
245 | .mask_reg = PM8607_INT_MASK_2, | ||
246 | .offs = 1 << 0, | ||
247 | }, | ||
248 | [PM8607_IRQ_VCHG] = { | ||
249 | .reg = PM8607_INT_STATUS2, | ||
250 | .mask_reg = PM8607_INT_MASK_2, | ||
251 | .offs = 1 << 1, | ||
252 | }, | ||
253 | [PM8607_IRQ_VSYS] = { | ||
254 | .reg = PM8607_INT_STATUS2, | ||
255 | .mask_reg = PM8607_INT_MASK_2, | ||
256 | .offs = 1 << 2, | ||
257 | }, | ||
258 | [PM8607_IRQ_TINT] = { | ||
259 | .reg = PM8607_INT_STATUS2, | ||
260 | .mask_reg = PM8607_INT_MASK_2, | ||
261 | .offs = 1 << 3, | ||
262 | }, | ||
263 | [PM8607_IRQ_GPADC0] = { | ||
264 | .reg = PM8607_INT_STATUS2, | ||
265 | .mask_reg = PM8607_INT_MASK_2, | ||
266 | .offs = 1 << 4, | ||
267 | }, | ||
268 | [PM8607_IRQ_GPADC1] = { | ||
269 | .reg = PM8607_INT_STATUS2, | ||
270 | .mask_reg = PM8607_INT_MASK_2, | ||
271 | .offs = 1 << 5, | ||
272 | }, | ||
273 | [PM8607_IRQ_GPADC2] = { | ||
274 | .reg = PM8607_INT_STATUS2, | ||
275 | .mask_reg = PM8607_INT_MASK_2, | ||
276 | .offs = 1 << 6, | ||
277 | }, | ||
278 | [PM8607_IRQ_GPADC3] = { | ||
279 | .reg = PM8607_INT_STATUS2, | ||
280 | .mask_reg = PM8607_INT_MASK_2, | ||
281 | .offs = 1 << 7, | ||
282 | }, | ||
283 | [PM8607_IRQ_AUDIO_SHORT] = { | ||
284 | .reg = PM8607_INT_STATUS3, | ||
285 | .mask_reg = PM8607_INT_MASK_3, | ||
286 | .offs = 1 << 0, | ||
287 | }, | ||
288 | [PM8607_IRQ_PEN] = { | ||
289 | .reg = PM8607_INT_STATUS3, | ||
290 | .mask_reg = PM8607_INT_MASK_3, | ||
291 | .offs = 1 << 1, | ||
292 | }, | ||
293 | [PM8607_IRQ_HEADSET] = { | ||
294 | .reg = PM8607_INT_STATUS3, | ||
295 | .mask_reg = PM8607_INT_MASK_3, | ||
296 | .offs = 1 << 2, | ||
297 | }, | ||
298 | [PM8607_IRQ_HOOK] = { | ||
299 | .reg = PM8607_INT_STATUS3, | ||
300 | .mask_reg = PM8607_INT_MASK_3, | ||
301 | .offs = 1 << 3, | ||
302 | }, | ||
303 | [PM8607_IRQ_MICIN] = { | ||
304 | .reg = PM8607_INT_STATUS3, | ||
305 | .mask_reg = PM8607_INT_MASK_3, | ||
306 | .offs = 1 << 4, | ||
307 | }, | ||
308 | [PM8607_IRQ_CHG_FAIL] = { | ||
309 | .reg = PM8607_INT_STATUS3, | ||
310 | .mask_reg = PM8607_INT_MASK_3, | ||
311 | .offs = 1 << 5, | ||
312 | }, | ||
313 | [PM8607_IRQ_CHG_DONE] = { | ||
314 | .reg = PM8607_INT_STATUS3, | ||
315 | .mask_reg = PM8607_INT_MASK_3, | ||
316 | .offs = 1 << 6, | ||
317 | }, | ||
318 | [PM8607_IRQ_CHG_FAULT] = { | ||
319 | .reg = PM8607_INT_STATUS3, | ||
320 | .mask_reg = PM8607_INT_MASK_3, | ||
321 | .offs = 1 << 7, | ||
322 | }, | ||
323 | }; | ||
324 | |||
325 | static inline struct pm860x_irq_data *irq_to_pm860x(struct pm860x_chip *chip, | ||
326 | int irq) | ||
327 | { | ||
328 | return &pm860x_irqs[irq - chip->irq_base]; | ||
329 | } | ||
330 | |||
331 | static irqreturn_t pm860x_irq(int irq, void *data) | ||
332 | { | ||
333 | struct pm860x_chip *chip = data; | ||
334 | struct pm860x_irq_data *irq_data; | ||
335 | struct i2c_client *i2c; | ||
336 | int read_reg = -1, value = 0; | ||
337 | int i; | ||
338 | |||
339 | i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | ||
340 | for (i = 0; i < ARRAY_SIZE(pm860x_irqs); i++) { | ||
341 | irq_data = &pm860x_irqs[i]; | ||
342 | if (read_reg != irq_data->reg) { | ||
343 | read_reg = irq_data->reg; | ||
344 | value = pm860x_reg_read(i2c, irq_data->reg); | ||
345 | } | ||
346 | if (value & irq_data->enable) | ||
347 | handle_nested_irq(chip->irq_base + i); | ||
348 | } | ||
349 | return IRQ_HANDLED; | ||
350 | } | ||
351 | |||
352 | static void pm860x_irq_lock(unsigned int irq) | ||
353 | { | ||
354 | struct pm860x_chip *chip = get_irq_chip_data(irq); | ||
355 | |||
356 | mutex_lock(&chip->irq_lock); | ||
357 | } | ||
358 | |||
359 | static void pm860x_irq_sync_unlock(unsigned int irq) | ||
360 | { | ||
361 | struct pm860x_chip *chip = get_irq_chip_data(irq); | ||
362 | struct pm860x_irq_data *irq_data; | ||
363 | struct i2c_client *i2c; | ||
364 | static unsigned char cached[3] = {0x0, 0x0, 0x0}; | ||
365 | unsigned char mask[3]; | ||
366 | int i; | ||
367 | |||
368 | i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | ||
369 | /* Load cached value. In initial, all IRQs are masked */ | ||
370 | for (i = 0; i < 3; i++) | ||
371 | mask[i] = cached[i]; | ||
372 | for (i = 0; i < ARRAY_SIZE(pm860x_irqs); i++) { | ||
373 | irq_data = &pm860x_irqs[i]; | ||
374 | switch (irq_data->mask_reg) { | ||
375 | case PM8607_INT_MASK_1: | ||
376 | mask[0] &= ~irq_data->offs; | ||
377 | mask[0] |= irq_data->enable; | ||
378 | break; | ||
379 | case PM8607_INT_MASK_2: | ||
380 | mask[1] &= ~irq_data->offs; | ||
381 | mask[1] |= irq_data->enable; | ||
382 | break; | ||
383 | case PM8607_INT_MASK_3: | ||
384 | mask[2] &= ~irq_data->offs; | ||
385 | mask[2] |= irq_data->enable; | ||
386 | break; | ||
387 | default: | ||
388 | dev_err(chip->dev, "wrong IRQ\n"); | ||
389 | break; | ||
390 | } | ||
391 | } | ||
392 | /* update mask into registers */ | ||
393 | for (i = 0; i < 3; i++) { | ||
394 | if (mask[i] != cached[i]) { | ||
395 | cached[i] = mask[i]; | ||
396 | pm860x_reg_write(i2c, PM8607_INT_MASK_1 + i, mask[i]); | ||
397 | } | ||
398 | } | ||
399 | |||
400 | mutex_unlock(&chip->irq_lock); | ||
401 | } | ||
402 | |||
403 | static void pm860x_irq_enable(unsigned int irq) | ||
404 | { | ||
405 | struct pm860x_chip *chip = get_irq_chip_data(irq); | ||
406 | pm860x_irqs[irq - chip->irq_base].enable | ||
407 | = pm860x_irqs[irq - chip->irq_base].offs; | ||
408 | } | ||
409 | |||
410 | static void pm860x_irq_disable(unsigned int irq) | ||
411 | { | ||
412 | struct pm860x_chip *chip = get_irq_chip_data(irq); | ||
413 | pm860x_irqs[irq - chip->irq_base].enable = 0; | ||
414 | } | ||
415 | |||
416 | static struct irq_chip pm860x_irq_chip = { | ||
417 | .name = "88pm860x", | ||
418 | .bus_lock = pm860x_irq_lock, | ||
419 | .bus_sync_unlock = pm860x_irq_sync_unlock, | ||
420 | .enable = pm860x_irq_enable, | ||
421 | .disable = pm860x_irq_disable, | ||
422 | }; | ||
423 | |||
424 | static int __devinit device_gpadc_init(struct pm860x_chip *chip, | ||
425 | struct pm860x_platform_data *pdata) | ||
426 | { | ||
427 | struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ | ||
428 | : chip->companion; | ||
429 | int use_gpadc = 0, data, ret; | ||
430 | |||
431 | /* initialize GPADC without activating it */ | ||
432 | |||
433 | if (pdata && pdata->touch) { | ||
434 | /* set GPADC MISC1 register */ | ||
435 | data = 0; | ||
436 | data |= (pdata->touch->gpadc_prebias << 1) | ||
437 | & PM8607_GPADC_PREBIAS_MASK; | ||
438 | data |= (pdata->touch->slot_cycle << 3) | ||
439 | & PM8607_GPADC_SLOT_CYCLE_MASK; | ||
440 | data |= (pdata->touch->off_scale << 5) | ||
441 | & PM8607_GPADC_OFF_SCALE_MASK; | ||
442 | data |= (pdata->touch->sw_cal << 7) | ||
443 | & PM8607_GPADC_SW_CAL_MASK; | ||
444 | if (data) { | ||
445 | ret = pm860x_reg_write(i2c, PM8607_GPADC_MISC1, data); | ||
446 | if (ret < 0) | ||
447 | goto out; | ||
448 | } | ||
449 | /* set tsi prebias time */ | ||
450 | if (pdata->touch->tsi_prebias) { | ||
451 | data = pdata->touch->tsi_prebias; | ||
452 | ret = pm860x_reg_write(i2c, PM8607_TSI_PREBIAS, data); | ||
453 | if (ret < 0) | ||
454 | goto out; | ||
455 | } | ||
456 | /* set prebias & prechg time of pen detect */ | ||
457 | data = 0; | ||
458 | data |= pdata->touch->pen_prebias & PM8607_PD_PREBIAS_MASK; | ||
459 | data |= (pdata->touch->pen_prechg << 5) | ||
460 | & PM8607_PD_PRECHG_MASK; | ||
461 | if (data) { | ||
462 | ret = pm860x_reg_write(i2c, PM8607_PD_PREBIAS, data); | ||
463 | if (ret < 0) | ||
464 | goto out; | ||
465 | } | ||
466 | |||
467 | use_gpadc = 1; | ||
468 | } | ||
469 | |||
470 | /* turn on GPADC */ | ||
471 | if (use_gpadc) { | ||
472 | ret = pm860x_set_bits(i2c, PM8607_GPADC_MISC1, | ||
473 | PM8607_GPADC_EN, PM8607_GPADC_EN); | ||
474 | } | ||
475 | out: | ||
476 | return ret; | ||
477 | } | ||
478 | |||
479 | static int __devinit device_irq_init(struct pm860x_chip *chip, | ||
480 | struct pm860x_platform_data *pdata) | ||
481 | { | ||
482 | struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ | ||
483 | : chip->companion; | ||
484 | unsigned char status_buf[INT_STATUS_NUM]; | ||
485 | unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; | ||
486 | struct irq_desc *desc; | ||
487 | int i, data, mask, ret = -EINVAL; | ||
488 | int __irq; | ||
489 | |||
490 | if (!pdata || !pdata->irq_base) { | ||
491 | dev_warn(chip->dev, "No interrupt support on IRQ base\n"); | ||
492 | return -EINVAL; | ||
493 | } | ||
494 | |||
495 | mask = PM8607_B0_MISC1_INV_INT | PM8607_B0_MISC1_INT_CLEAR | ||
496 | | PM8607_B0_MISC1_INT_MASK; | ||
497 | data = 0; | ||
498 | chip->irq_mode = 0; | ||
499 | if (pdata && pdata->irq_mode) { | ||
500 | /* | ||
501 | * irq_mode defines the way of clearing interrupt. If it's 1, | ||
502 | * clear IRQ by write. Otherwise, clear it by read. | ||
503 | * This control bit is valid from 88PM8607 B0 steping. | ||
504 | */ | ||
505 | data |= PM8607_B0_MISC1_INT_CLEAR; | ||
506 | chip->irq_mode = 1; | ||
507 | } | ||
508 | ret = pm860x_set_bits(i2c, PM8607_B0_MISC1, mask, data); | ||
509 | if (ret < 0) | ||
510 | goto out; | ||
511 | |||
512 | /* mask all IRQs */ | ||
513 | memset(status_buf, 0, INT_STATUS_NUM); | ||
514 | ret = pm860x_bulk_write(i2c, PM8607_INT_MASK_1, | ||
515 | INT_STATUS_NUM, status_buf); | ||
516 | if (ret < 0) | ||
517 | goto out; | ||
518 | |||
519 | if (chip->irq_mode) { | ||
520 | /* clear interrupt status by write */ | ||
521 | memset(status_buf, 0xFF, INT_STATUS_NUM); | ||
522 | ret = pm860x_bulk_write(i2c, PM8607_INT_STATUS1, | ||
523 | INT_STATUS_NUM, status_buf); | ||
524 | } else { | ||
525 | /* clear interrupt status by read */ | ||
526 | ret = pm860x_bulk_read(i2c, PM8607_INT_STATUS1, | ||
527 | INT_STATUS_NUM, status_buf); | ||
528 | } | ||
529 | if (ret < 0) | ||
530 | goto out; | ||
531 | |||
532 | mutex_init(&chip->irq_lock); | ||
533 | chip->irq_base = pdata->irq_base; | ||
534 | chip->core_irq = i2c->irq; | ||
535 | if (!chip->core_irq) | ||
536 | goto out; | ||
537 | |||
538 | desc = irq_to_desc(chip->core_irq); | ||
539 | |||
540 | /* register IRQ by genirq */ | ||
541 | for (i = 0; i < ARRAY_SIZE(pm860x_irqs); i++) { | ||
542 | __irq = i + chip->irq_base; | ||
543 | set_irq_chip_data(__irq, chip); | ||
544 | set_irq_chip_and_handler(__irq, &pm860x_irq_chip, | ||
545 | handle_edge_irq); | ||
546 | set_irq_nested_thread(__irq, 1); | ||
547 | #ifdef CONFIG_ARM | ||
548 | set_irq_flags(__irq, IRQF_VALID); | ||
549 | #else | ||
550 | set_irq_noprobe(__irq); | ||
551 | #endif | ||
552 | } | ||
553 | |||
554 | ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags, | ||
555 | "88pm860x", chip); | ||
556 | if (ret) { | ||
557 | dev_err(chip->dev, "Failed to request IRQ: %d\n", ret); | ||
558 | chip->core_irq = 0; | ||
559 | } | ||
560 | |||
561 | return 0; | ||
562 | out: | ||
563 | chip->core_irq = 0; | ||
564 | return ret; | ||
565 | } | ||
566 | |||
567 | static void __devexit device_irq_exit(struct pm860x_chip *chip) | ||
568 | { | ||
569 | if (chip->core_irq) | ||
570 | free_irq(chip->core_irq, chip); | ||
571 | } | ||
572 | |||
573 | static void __devinit device_8606_init(struct pm860x_chip *chip, | ||
574 | struct i2c_client *i2c, | ||
575 | struct pm860x_platform_data *pdata) | ||
576 | { | ||
577 | int ret; | ||
578 | |||
579 | if (pdata && pdata->backlight) { | ||
580 | ret = mfd_add_devices(chip->dev, 0, &backlight_devs[0], | ||
581 | ARRAY_SIZE(backlight_devs), | ||
582 | &backlight_resources[0], 0); | ||
583 | if (ret < 0) { | ||
584 | dev_err(chip->dev, "Failed to add backlight " | ||
585 | "subdev\n"); | ||
586 | goto out_dev; | ||
587 | } | ||
588 | } | ||
589 | |||
590 | if (pdata && pdata->led) { | ||
591 | ret = mfd_add_devices(chip->dev, 0, &led_devs[0], | ||
592 | ARRAY_SIZE(led_devs), | ||
593 | &led_resources[0], 0); | ||
594 | if (ret < 0) { | ||
595 | dev_err(chip->dev, "Failed to add led " | ||
596 | "subdev\n"); | ||
597 | goto out_dev; | ||
598 | } | ||
599 | } | ||
600 | return; | ||
601 | out_dev: | ||
602 | mfd_remove_devices(chip->dev); | ||
603 | device_irq_exit(chip); | ||
604 | } | ||
605 | |||
606 | static void __devinit device_8607_init(struct pm860x_chip *chip, | ||
607 | struct i2c_client *i2c, | ||
608 | struct pm860x_platform_data *pdata) | ||
609 | { | ||
610 | int data, ret; | ||
611 | |||
612 | ret = pm860x_reg_read(i2c, PM8607_CHIP_ID); | ||
613 | if (ret < 0) { | ||
614 | dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); | ||
615 | goto out; | ||
616 | } | ||
617 | if ((ret & PM8607_VERSION_MASK) == PM8607_VERSION) | ||
618 | dev_info(chip->dev, "Marvell 88PM8607 (ID: %02x) detected\n", | ||
619 | ret); | ||
620 | else { | ||
621 | dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " | ||
622 | "Chip ID: %02x\n", ret); | ||
623 | goto out; | ||
624 | } | ||
625 | |||
626 | ret = pm860x_reg_read(i2c, PM8607_BUCK3); | ||
627 | if (ret < 0) { | ||
628 | dev_err(chip->dev, "Failed to read BUCK3 register: %d\n", ret); | ||
629 | goto out; | ||
630 | } | ||
631 | if (ret & PM8607_BUCK3_DOUBLE) | ||
632 | chip->buck3_double = 1; | ||
633 | |||
634 | ret = pm860x_reg_read(i2c, PM8607_B0_MISC1); | ||
635 | if (ret < 0) { | ||
636 | dev_err(chip->dev, "Failed to read MISC1 register: %d\n", ret); | ||
637 | goto out; | ||
638 | } | ||
639 | |||
640 | if (pdata && (pdata->i2c_port == PI2C_PORT)) | ||
641 | data = PM8607_B0_MISC1_PI2C; | ||
642 | else | ||
643 | data = 0; | ||
644 | ret = pm860x_set_bits(i2c, PM8607_B0_MISC1, PM8607_B0_MISC1_PI2C, data); | ||
645 | if (ret < 0) { | ||
646 | dev_err(chip->dev, "Failed to access MISC1:%d\n", ret); | ||
647 | goto out; | ||
648 | } | ||
649 | |||
650 | ret = device_gpadc_init(chip, pdata); | ||
651 | if (ret < 0) | ||
652 | goto out; | ||
653 | |||
654 | ret = device_irq_init(chip, pdata); | ||
655 | if (ret < 0) | ||
656 | goto out; | ||
657 | |||
658 | ret = mfd_add_devices(chip->dev, 0, ®ulator_devs[0], | ||
659 | ARRAY_SIZE(regulator_devs), | ||
660 | ®ulator_resources[0], 0); | ||
661 | if (ret < 0) { | ||
662 | dev_err(chip->dev, "Failed to add regulator subdev\n"); | ||
663 | goto out_dev; | ||
664 | } | ||
665 | |||
666 | if (pdata && pdata->touch) { | ||
667 | ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], | ||
668 | ARRAY_SIZE(touch_devs), | ||
669 | &touch_resources[0], 0); | ||
670 | if (ret < 0) { | ||
671 | dev_err(chip->dev, "Failed to add touch " | ||
672 | "subdev\n"); | ||
673 | goto out_dev; | ||
674 | } | ||
675 | } | ||
676 | |||
677 | if (pdata && pdata->power) { | ||
678 | ret = mfd_add_devices(chip->dev, 0, &power_devs[0], | ||
679 | ARRAY_SIZE(power_devs), | ||
680 | &power_supply_resources[0], 0); | ||
681 | if (ret < 0) { | ||
682 | dev_err(chip->dev, "Failed to add power supply " | ||
683 | "subdev\n"); | ||
684 | goto out_dev; | ||
685 | } | ||
686 | } | ||
687 | |||
688 | ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], | ||
689 | ARRAY_SIZE(onkey_devs), | ||
690 | &onkey_resources[0], 0); | ||
691 | if (ret < 0) { | ||
692 | dev_err(chip->dev, "Failed to add onkey subdev\n"); | ||
693 | goto out_dev; | ||
694 | } | ||
695 | |||
696 | return; | ||
697 | out_dev: | ||
698 | mfd_remove_devices(chip->dev); | ||
699 | device_irq_exit(chip); | ||
700 | out: | ||
701 | return; | ||
702 | } | ||
703 | |||
704 | int pm860x_device_init(struct pm860x_chip *chip, | ||
705 | struct pm860x_platform_data *pdata) | ||
706 | { | ||
707 | chip->core_irq = 0; | ||
708 | |||
709 | switch (chip->id) { | ||
710 | case CHIP_PM8606: | ||
711 | device_8606_init(chip, chip->client, pdata); | ||
712 | break; | ||
713 | case CHIP_PM8607: | ||
714 | device_8607_init(chip, chip->client, pdata); | ||
715 | break; | ||
716 | } | ||
717 | |||
718 | if (chip->companion) { | ||
719 | switch (chip->id) { | ||
720 | case CHIP_PM8607: | ||
721 | device_8606_init(chip, chip->companion, pdata); | ||
722 | break; | ||
723 | case CHIP_PM8606: | ||
724 | device_8607_init(chip, chip->companion, pdata); | ||
725 | break; | ||
726 | } | ||
727 | } | ||
728 | |||
729 | return 0; | ||
730 | } | ||
731 | |||
732 | void pm860x_device_exit(struct pm860x_chip *chip) | ||
733 | { | ||
734 | device_irq_exit(chip); | ||
735 | mfd_remove_devices(chip->dev); | ||
736 | } | ||
737 | |||
738 | MODULE_DESCRIPTION("PMIC Driver for Marvell 88PM860x"); | ||
739 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
740 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c new file mode 100644 index 000000000000..c37e12bf3004 --- /dev/null +++ b/drivers/mfd/88pm860x-i2c.c | |||
@@ -0,0 +1,236 @@ | |||
1 | /* | ||
2 | * I2C driver for Marvell 88PM860x | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/mfd/88pm860x.h> | ||
16 | |||
17 | static inline int pm860x_read_device(struct i2c_client *i2c, | ||
18 | int reg, int bytes, void *dest) | ||
19 | { | ||
20 | unsigned char data; | ||
21 | int ret; | ||
22 | |||
23 | data = (unsigned char)reg; | ||
24 | ret = i2c_master_send(i2c, &data, 1); | ||
25 | if (ret < 0) | ||
26 | return ret; | ||
27 | |||
28 | ret = i2c_master_recv(i2c, dest, bytes); | ||
29 | if (ret < 0) | ||
30 | return ret; | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | static inline int pm860x_write_device(struct i2c_client *i2c, | ||
35 | int reg, int bytes, void *src) | ||
36 | { | ||
37 | unsigned char buf[bytes + 1]; | ||
38 | int ret; | ||
39 | |||
40 | buf[0] = (unsigned char)reg; | ||
41 | memcpy(&buf[1], src, bytes); | ||
42 | |||
43 | ret = i2c_master_send(i2c, buf, bytes + 1); | ||
44 | if (ret < 0) | ||
45 | return ret; | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | int pm860x_reg_read(struct i2c_client *i2c, int reg) | ||
50 | { | ||
51 | struct pm860x_chip *chip = i2c_get_clientdata(i2c); | ||
52 | unsigned char data; | ||
53 | int ret; | ||
54 | |||
55 | mutex_lock(&chip->io_lock); | ||
56 | ret = pm860x_read_device(i2c, reg, 1, &data); | ||
57 | mutex_unlock(&chip->io_lock); | ||
58 | |||
59 | if (ret < 0) | ||
60 | return ret; | ||
61 | else | ||
62 | return (int)data; | ||
63 | } | ||
64 | EXPORT_SYMBOL(pm860x_reg_read); | ||
65 | |||
66 | int pm860x_reg_write(struct i2c_client *i2c, int reg, | ||
67 | unsigned char data) | ||
68 | { | ||
69 | struct pm860x_chip *chip = i2c_get_clientdata(i2c); | ||
70 | int ret; | ||
71 | |||
72 | mutex_lock(&chip->io_lock); | ||
73 | ret = pm860x_write_device(i2c, reg, 1, &data); | ||
74 | mutex_unlock(&chip->io_lock); | ||
75 | |||
76 | return ret; | ||
77 | } | ||
78 | EXPORT_SYMBOL(pm860x_reg_write); | ||
79 | |||
80 | int pm860x_bulk_read(struct i2c_client *i2c, int reg, | ||
81 | int count, unsigned char *buf) | ||
82 | { | ||
83 | struct pm860x_chip *chip = i2c_get_clientdata(i2c); | ||
84 | int ret; | ||
85 | |||
86 | mutex_lock(&chip->io_lock); | ||
87 | ret = pm860x_read_device(i2c, reg, count, buf); | ||
88 | mutex_unlock(&chip->io_lock); | ||
89 | |||
90 | return ret; | ||
91 | } | ||
92 | EXPORT_SYMBOL(pm860x_bulk_read); | ||
93 | |||
94 | int pm860x_bulk_write(struct i2c_client *i2c, int reg, | ||
95 | int count, unsigned char *buf) | ||
96 | { | ||
97 | struct pm860x_chip *chip = i2c_get_clientdata(i2c); | ||
98 | int ret; | ||
99 | |||
100 | mutex_lock(&chip->io_lock); | ||
101 | ret = pm860x_write_device(i2c, reg, count, buf); | ||
102 | mutex_unlock(&chip->io_lock); | ||
103 | |||
104 | return ret; | ||
105 | } | ||
106 | EXPORT_SYMBOL(pm860x_bulk_write); | ||
107 | |||
108 | int pm860x_set_bits(struct i2c_client *i2c, int reg, | ||
109 | unsigned char mask, unsigned char data) | ||
110 | { | ||
111 | struct pm860x_chip *chip = i2c_get_clientdata(i2c); | ||
112 | unsigned char value; | ||
113 | int ret; | ||
114 | |||
115 | mutex_lock(&chip->io_lock); | ||
116 | ret = pm860x_read_device(i2c, reg, 1, &value); | ||
117 | if (ret < 0) | ||
118 | goto out; | ||
119 | value &= ~mask; | ||
120 | value |= data; | ||
121 | ret = pm860x_write_device(i2c, reg, 1, &value); | ||
122 | out: | ||
123 | mutex_unlock(&chip->io_lock); | ||
124 | return ret; | ||
125 | } | ||
126 | EXPORT_SYMBOL(pm860x_set_bits); | ||
127 | |||
128 | |||
129 | static const struct i2c_device_id pm860x_id_table[] = { | ||
130 | { "88PM860x", 0 }, | ||
131 | {} | ||
132 | }; | ||
133 | MODULE_DEVICE_TABLE(i2c, pm860x_id_table); | ||
134 | |||
135 | static int verify_addr(struct i2c_client *i2c) | ||
136 | { | ||
137 | unsigned short addr_8607[] = {0x30, 0x34}; | ||
138 | unsigned short addr_8606[] = {0x10, 0x11}; | ||
139 | int size, i; | ||
140 | |||
141 | if (i2c == NULL) | ||
142 | return 0; | ||
143 | size = ARRAY_SIZE(addr_8606); | ||
144 | for (i = 0; i < size; i++) { | ||
145 | if (i2c->addr == *(addr_8606 + i)) | ||
146 | return CHIP_PM8606; | ||
147 | } | ||
148 | size = ARRAY_SIZE(addr_8607); | ||
149 | for (i = 0; i < size; i++) { | ||
150 | if (i2c->addr == *(addr_8607 + i)) | ||
151 | return CHIP_PM8607; | ||
152 | } | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static int __devinit pm860x_probe(struct i2c_client *client, | ||
157 | const struct i2c_device_id *id) | ||
158 | { | ||
159 | struct pm860x_platform_data *pdata = client->dev.platform_data; | ||
160 | struct pm860x_chip *chip; | ||
161 | |||
162 | if (!pdata) { | ||
163 | pr_info("No platform data in %s!\n", __func__); | ||
164 | return -EINVAL; | ||
165 | } | ||
166 | |||
167 | chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); | ||
168 | if (chip == NULL) | ||
169 | return -ENOMEM; | ||
170 | |||
171 | chip->id = verify_addr(client); | ||
172 | chip->client = client; | ||
173 | i2c_set_clientdata(client, chip); | ||
174 | chip->dev = &client->dev; | ||
175 | mutex_init(&chip->io_lock); | ||
176 | dev_set_drvdata(chip->dev, chip); | ||
177 | |||
178 | /* | ||
179 | * Both client and companion client shares same platform driver. | ||
180 | * Driver distinguishes them by pdata->companion_addr. | ||
181 | * pdata->companion_addr is only assigned if companion chip exists. | ||
182 | * At the same time, the companion_addr shouldn't equal to client | ||
183 | * address. | ||
184 | */ | ||
185 | if (pdata->companion_addr && (pdata->companion_addr != client->addr)) { | ||
186 | chip->companion_addr = pdata->companion_addr; | ||
187 | chip->companion = i2c_new_dummy(chip->client->adapter, | ||
188 | chip->companion_addr); | ||
189 | i2c_set_clientdata(chip->companion, chip); | ||
190 | } | ||
191 | |||
192 | pm860x_device_init(chip, pdata); | ||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | static int __devexit pm860x_remove(struct i2c_client *client) | ||
197 | { | ||
198 | struct pm860x_chip *chip = i2c_get_clientdata(client); | ||
199 | |||
200 | pm860x_device_exit(chip); | ||
201 | i2c_unregister_device(chip->companion); | ||
202 | i2c_set_clientdata(chip->companion, NULL); | ||
203 | i2c_set_clientdata(chip->client, NULL); | ||
204 | kfree(chip); | ||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | static struct i2c_driver pm860x_driver = { | ||
209 | .driver = { | ||
210 | .name = "88PM860x", | ||
211 | .owner = THIS_MODULE, | ||
212 | }, | ||
213 | .probe = pm860x_probe, | ||
214 | .remove = __devexit_p(pm860x_remove), | ||
215 | .id_table = pm860x_id_table, | ||
216 | }; | ||
217 | |||
218 | static int __init pm860x_i2c_init(void) | ||
219 | { | ||
220 | int ret; | ||
221 | ret = i2c_add_driver(&pm860x_driver); | ||
222 | if (ret != 0) | ||
223 | pr_err("Failed to register 88PM860x I2C driver: %d\n", ret); | ||
224 | return ret; | ||
225 | } | ||
226 | subsys_initcall(pm860x_i2c_init); | ||
227 | |||
228 | static void __exit pm860x_i2c_exit(void) | ||
229 | { | ||
230 | i2c_del_driver(&pm860x_driver); | ||
231 | } | ||
232 | module_exit(pm860x_i2c_exit); | ||
233 | |||
234 | MODULE_DESCRIPTION("I2C Driver for Marvell 88PM860x"); | ||
235 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
236 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index b670d10d5c92..951fa9b93fbe 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -9,6 +9,16 @@ config MFD_CORE | |||
9 | tristate | 9 | tristate |
10 | default n | 10 | default n |
11 | 11 | ||
12 | config MFD_88PM860X | ||
13 | bool "Support Marvell 88PM8606/88PM8607" | ||
14 | depends on I2C=y | ||
15 | select MFD_CORE | ||
16 | help | ||
17 | This supports for Marvell 88PM8606/88PM8607 Power Management IC. | ||
18 | This includes the I2C driver and the core APIs _only_, you have to | ||
19 | select individual components like voltage regulators, RTC and | ||
20 | battery-charger under the corresponding menus. | ||
21 | |||
12 | config MFD_SM501 | 22 | config MFD_SM501 |
13 | tristate "Support for Silicon Motion SM501" | 23 | tristate "Support for Silicon Motion SM501" |
14 | ---help--- | 24 | ---help--- |
@@ -37,7 +47,7 @@ config MFD_ASIC3 | |||
37 | 47 | ||
38 | config MFD_SH_MOBILE_SDHI | 48 | config MFD_SH_MOBILE_SDHI |
39 | bool "Support for SuperH Mobile SDHI" | 49 | bool "Support for SuperH Mobile SDHI" |
40 | depends on SUPERH | 50 | depends on SUPERH || ARCH_SHMOBILE |
41 | select MFD_CORE | 51 | select MFD_CORE |
42 | ---help--- | 52 | ---help--- |
43 | This driver supports the SDHI hardware block found in many | 53 | This driver supports the SDHI hardware block found in many |
@@ -68,6 +78,15 @@ config HTC_PASIC3 | |||
68 | HTC Magician devices, respectively. Actual functionality is | 78 | HTC Magician devices, respectively. Actual functionality is |
69 | handled by the leds-pasic3 and ds1wm drivers. | 79 | handled by the leds-pasic3 and ds1wm drivers. |
70 | 80 | ||
81 | config HTC_I2CPLD | ||
82 | bool "HTC I2C PLD chip support" | ||
83 | depends on I2C=y && GPIOLIB | ||
84 | help | ||
85 | If you say yes here you get support for the supposed CPLD | ||
86 | found on omap850 HTC devices like the HTC Wizard and HTC Herald. | ||
87 | This device provides input and output GPIOs through an I2C | ||
88 | interface to one or more sub-chips. | ||
89 | |||
71 | config UCB1400_CORE | 90 | config UCB1400_CORE |
72 | tristate "Philips UCB1400 Core driver" | 91 | tristate "Philips UCB1400 Core driver" |
73 | depends on AC97_BUS | 92 | depends on AC97_BUS |
@@ -184,6 +203,16 @@ config PMIC_ADP5520 | |||
184 | individual components like LCD backlight, LEDs, GPIOs and Kepad | 203 | individual components like LCD backlight, LEDs, GPIOs and Kepad |
185 | under the corresponding menus. | 204 | under the corresponding menus. |
186 | 205 | ||
206 | config MFD_MAX8925 | ||
207 | bool "Maxim Semiconductor MAX8925 PMIC Support" | ||
208 | depends on I2C=y | ||
209 | select MFD_CORE | ||
210 | help | ||
211 | Say yes here to support for Maxim Semiconductor MAX8925. This is | ||
212 | a Power Management IC. This driver provies common support for | ||
213 | accessing the device, additional drivers must be enabled in order | ||
214 | to use the functionality of the device. | ||
215 | |||
187 | config MFD_WM8400 | 216 | config MFD_WM8400 |
188 | tristate "Support Wolfson Microelectronics WM8400" | 217 | tristate "Support Wolfson Microelectronics WM8400" |
189 | select MFD_CORE | 218 | select MFD_CORE |
@@ -205,7 +234,7 @@ config MFD_WM831X | |||
205 | functionality of the device. | 234 | functionality of the device. |
206 | 235 | ||
207 | config MFD_WM8350 | 236 | config MFD_WM8350 |
208 | tristate | 237 | bool |
209 | 238 | ||
210 | config MFD_WM8350_CONFIG_MODE_0 | 239 | config MFD_WM8350_CONFIG_MODE_0 |
211 | bool | 240 | bool |
@@ -256,9 +285,9 @@ config MFD_WM8352_CONFIG_MODE_3 | |||
256 | depends on MFD_WM8350 | 285 | depends on MFD_WM8350 |
257 | 286 | ||
258 | config MFD_WM8350_I2C | 287 | config MFD_WM8350_I2C |
259 | tristate "Support Wolfson Microelectronics WM8350 with I2C" | 288 | bool "Support Wolfson Microelectronics WM8350 with I2C" |
260 | select MFD_WM8350 | 289 | select MFD_WM8350 |
261 | depends on I2C | 290 | depends on I2C=y |
262 | help | 291 | help |
263 | The WM8350 is an integrated audio and power management | 292 | The WM8350 is an integrated audio and power management |
264 | subsystem with watchdog and RTC functionality for embedded | 293 | subsystem with watchdog and RTC functionality for embedded |
@@ -266,6 +295,18 @@ config MFD_WM8350_I2C | |||
266 | I2C as the control interface. Additional options must be | 295 | I2C as the control interface. Additional options must be |
267 | selected to enable support for the functionality of the chip. | 296 | selected to enable support for the functionality of the chip. |
268 | 297 | ||
298 | config MFD_WM8994 | ||
299 | tristate "Support Wolfson Microelectronics WM8994" | ||
300 | select MFD_CORE | ||
301 | depends on I2C | ||
302 | help | ||
303 | The WM8994 is a highly integrated hi-fi CODEC designed for | ||
304 | smartphone applicatiosn. As well as audio functionality it | ||
305 | has on board GPIO and regulator functionality which is | ||
306 | supported via the relevant subsystems. This driver provides | ||
307 | core support for the WM8994, in order to use the actual | ||
308 | functionaltiy of the device other drivers must be enabled. | ||
309 | |||
269 | config MFD_PCF50633 | 310 | config MFD_PCF50633 |
270 | tristate "Support for NXP PCF50633" | 311 | tristate "Support for NXP PCF50633" |
271 | depends on I2C | 312 | depends on I2C |
@@ -300,8 +341,8 @@ config PCF50633_GPIO | |||
300 | the PCF50633 chip. | 341 | the PCF50633 chip. |
301 | 342 | ||
302 | config AB3100_CORE | 343 | config AB3100_CORE |
303 | tristate "ST-Ericsson AB3100 Mixed Signal Circuit core functions" | 344 | bool "ST-Ericsson AB3100 Mixed Signal Circuit core functions" |
304 | depends on I2C | 345 | depends on I2C=y |
305 | default y if ARCH_U300 | 346 | default y if ARCH_U300 |
306 | help | 347 | help |
307 | Select this to enable the AB3100 Mixed Signal IC core | 348 | Select this to enable the AB3100 Mixed Signal IC core |
@@ -329,16 +370,6 @@ config EZX_PCAP | |||
329 | This enables the PCAP ASIC present on EZX Phones. This is | 370 | This enables the PCAP ASIC present on EZX Phones. This is |
330 | needed for MMC, TouchScreen, Sound, USB, etc.. | 371 | needed for MMC, TouchScreen, Sound, USB, etc.. |
331 | 372 | ||
332 | config MFD_88PM8607 | ||
333 | bool "Support Marvell 88PM8607" | ||
334 | depends on I2C=y | ||
335 | select MFD_CORE | ||
336 | help | ||
337 | This supports for Marvell 88PM8607 Power Management IC. This includes | ||
338 | the I2C driver and the core APIs _only_, you have to select | ||
339 | individual components like voltage regulators, RTC and | ||
340 | battery-charger under the corresponding menus. | ||
341 | |||
342 | config AB4500_CORE | 373 | config AB4500_CORE |
343 | tristate "ST-Ericsson's AB4500 Mixed Signal Power management chip" | 374 | tristate "ST-Ericsson's AB4500 Mixed Signal Power management chip" |
344 | depends on SPI | 375 | depends on SPI |
@@ -358,6 +389,15 @@ config MFD_TIMBERDALE | |||
358 | 389 | ||
359 | The timberdale FPGA can be found on the Intel Atom development board | 390 | The timberdale FPGA can be found on the Intel Atom development board |
360 | for in-vehicle infontainment, called Russellville. | 391 | for in-vehicle infontainment, called Russellville. |
392 | |||
393 | config LPC_SCH | ||
394 | tristate "Intel SCH LPC" | ||
395 | depends on PCI | ||
396 | select MFD_CORE | ||
397 | help | ||
398 | LPC bridge function of the Intel SCH provides support for | ||
399 | System Management Bus and General Purpose I/O. | ||
400 | |||
361 | endmenu | 401 | endmenu |
362 | 402 | ||
363 | menu "Multimedia Capabilities Port drivers" | 403 | menu "Multimedia Capabilities Port drivers" |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 78295d6a75f7..22715add99a7 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -2,12 +2,15 @@ | |||
2 | # Makefile for multifunction miscellaneous devices | 2 | # Makefile for multifunction miscellaneous devices |
3 | # | 3 | # |
4 | 4 | ||
5 | 88pm860x-objs := 88pm860x-core.o 88pm860x-i2c.o | ||
6 | obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o | ||
5 | obj-$(CONFIG_MFD_SM501) += sm501.o | 7 | obj-$(CONFIG_MFD_SM501) += sm501.o |
6 | obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o | 8 | obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o |
7 | obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o | 9 | obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o |
8 | 10 | ||
9 | obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o | 11 | obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o |
10 | obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o | 12 | obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o |
13 | obj-$(CONFIG_HTC_I2CPLD) += htc-i2cpld.o | ||
11 | 14 | ||
12 | obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o | 15 | obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o |
13 | 16 | ||
@@ -22,6 +25,7 @@ wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o | |||
22 | wm8350-objs += wm8350-irq.o | 25 | wm8350-objs += wm8350-irq.o |
23 | obj-$(CONFIG_MFD_WM8350) += wm8350.o | 26 | obj-$(CONFIG_MFD_WM8350) += wm8350.o |
24 | obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o | 27 | obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o |
28 | obj-$(CONFIG_MFD_WM8994) += wm8994-core.o | ||
25 | 29 | ||
26 | obj-$(CONFIG_TPS65010) += tps65010.o | 30 | obj-$(CONFIG_TPS65010) += tps65010.o |
27 | obj-$(CONFIG_MENELAUS) += menelaus.o | 31 | obj-$(CONFIG_MENELAUS) += menelaus.o |
@@ -47,6 +51,8 @@ endif | |||
47 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o | 51 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o |
48 | 52 | ||
49 | obj-$(CONFIG_PMIC_DA903X) += da903x.o | 53 | obj-$(CONFIG_PMIC_DA903X) += da903x.o |
54 | max8925-objs := max8925-core.o max8925-i2c.o | ||
55 | obj-$(CONFIG_MFD_MAX8925) += max8925.o | ||
50 | 56 | ||
51 | obj-$(CONFIG_MFD_PCF50633) += pcf50633-core.o | 57 | obj-$(CONFIG_MFD_PCF50633) += pcf50633-core.o |
52 | obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o | 58 | obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o |
@@ -55,5 +61,5 @@ obj-$(CONFIG_AB3100_CORE) += ab3100-core.o | |||
55 | obj-$(CONFIG_AB3100_OTP) += ab3100-otp.o | 61 | obj-$(CONFIG_AB3100_OTP) += ab3100-otp.o |
56 | obj-$(CONFIG_AB4500_CORE) += ab4500-core.o | 62 | obj-$(CONFIG_AB4500_CORE) += ab4500-core.o |
57 | obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o | 63 | obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o |
58 | obj-$(CONFIG_MFD_88PM8607) += 88pm8607.o | ||
59 | obj-$(CONFIG_PMIC_ADP5520) += adp5520.o | 64 | obj-$(CONFIG_PMIC_ADP5520) += adp5520.o |
65 | obj-$(CONFIG_LPC_SCH) += lpc_sch.o \ No newline at end of file | ||
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c index fd42a80e7bf9..a2ce3b6af4a2 100644 --- a/drivers/mfd/ab3100-core.c +++ b/drivers/mfd/ab3100-core.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2009 ST-Ericsson | 2 | * Copyright (C) 2007-2010 ST-Ericsson |
3 | * License terms: GNU General Public License (GPL) version 2 | 3 | * License terms: GNU General Public License (GPL) version 2 |
4 | * Low-level core for exclusive access to the AB3100 IC on the I2C bus | 4 | * Low-level core for exclusive access to the AB3100 IC on the I2C bus |
5 | * and some basic chip-configuration. | 5 | * and some basic chip-configuration. |
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/random.h> | ||
17 | #include <linux/debugfs.h> | 18 | #include <linux/debugfs.h> |
18 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
19 | #include <linux/uaccess.h> | 20 | #include <linux/uaccess.h> |
@@ -365,18 +366,23 @@ int ab3100_event_registers_startup_state_get(struct ab3100 *ab3100, | |||
365 | } | 366 | } |
366 | EXPORT_SYMBOL(ab3100_event_registers_startup_state_get); | 367 | EXPORT_SYMBOL(ab3100_event_registers_startup_state_get); |
367 | 368 | ||
368 | /* Interrupt handling worker */ | 369 | /* |
369 | static void ab3100_work(struct work_struct *work) | 370 | * This is a threaded interrupt handler so we can make some |
371 | * I2C calls etc. | ||
372 | */ | ||
373 | static irqreturn_t ab3100_irq_handler(int irq, void *data) | ||
370 | { | 374 | { |
371 | struct ab3100 *ab3100 = container_of(work, struct ab3100, work); | 375 | struct ab3100 *ab3100 = data; |
372 | u8 event_regs[3]; | 376 | u8 event_regs[3]; |
373 | u32 fatevent; | 377 | u32 fatevent; |
374 | int err; | 378 | int err; |
375 | 379 | ||
380 | add_interrupt_randomness(irq); | ||
381 | |||
376 | err = ab3100_get_register_page_interruptible(ab3100, AB3100_EVENTA1, | 382 | err = ab3100_get_register_page_interruptible(ab3100, AB3100_EVENTA1, |
377 | event_regs, 3); | 383 | event_regs, 3); |
378 | if (err) | 384 | if (err) |
379 | goto err_event_wq; | 385 | goto err_event; |
380 | 386 | ||
381 | fatevent = (event_regs[0] << 16) | | 387 | fatevent = (event_regs[0] << 16) | |
382 | (event_regs[1] << 8) | | 388 | (event_regs[1] << 8) | |
@@ -398,29 +404,11 @@ static void ab3100_work(struct work_struct *work) | |||
398 | dev_dbg(ab3100->dev, | 404 | dev_dbg(ab3100->dev, |
399 | "IRQ Event: 0x%08x\n", fatevent); | 405 | "IRQ Event: 0x%08x\n", fatevent); |
400 | 406 | ||
401 | /* By now the IRQ should be acked and deasserted so enable it again */ | 407 | return IRQ_HANDLED; |
402 | enable_irq(ab3100->i2c_client->irq); | ||
403 | return; | ||
404 | 408 | ||
405 | err_event_wq: | 409 | err_event: |
406 | dev_dbg(ab3100->dev, | 410 | dev_dbg(ab3100->dev, |
407 | "error in event workqueue\n"); | 411 | "error reading event status\n"); |
408 | /* Enable the IRQ anyway, what choice do we have? */ | ||
409 | enable_irq(ab3100->i2c_client->irq); | ||
410 | return; | ||
411 | } | ||
412 | |||
413 | static irqreturn_t ab3100_irq_handler(int irq, void *data) | ||
414 | { | ||
415 | struct ab3100 *ab3100 = data; | ||
416 | /* | ||
417 | * Disable the IRQ and dispatch a worker to handle the | ||
418 | * event. Since the chip resides on I2C this is slow | ||
419 | * stuff and we will re-enable the interrupts once th | ||
420 | * worker has finished. | ||
421 | */ | ||
422 | disable_irq_nosync(irq); | ||
423 | schedule_work(&ab3100->work); | ||
424 | return IRQ_HANDLED; | 412 | return IRQ_HANDLED; |
425 | } | 413 | } |
426 | 414 | ||
@@ -735,10 +723,7 @@ static struct platform_device ab3100_##devname##_device = { \ | |||
735 | .id = -1, \ | 723 | .id = -1, \ |
736 | } | 724 | } |
737 | 725 | ||
738 | /* | 726 | /* This lists all the subdevices */ |
739 | * This lists all the subdevices and corresponding register | ||
740 | * ranges. | ||
741 | */ | ||
742 | AB3100_DEVICE(dac, "ab3100-dac"); | 727 | AB3100_DEVICE(dac, "ab3100-dac"); |
743 | AB3100_DEVICE(leds, "ab3100-leds"); | 728 | AB3100_DEVICE(leds, "ab3100-leds"); |
744 | AB3100_DEVICE(power, "ab3100-power"); | 729 | AB3100_DEVICE(power, "ab3100-power"); |
@@ -904,12 +889,11 @@ static int __init ab3100_probe(struct i2c_client *client, | |||
904 | if (err) | 889 | if (err) |
905 | goto exit_no_setup; | 890 | goto exit_no_setup; |
906 | 891 | ||
907 | INIT_WORK(&ab3100->work, ab3100_work); | 892 | err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler, |
908 | 893 | IRQF_ONESHOT, "ab3100-core", ab3100); | |
909 | /* This real unpredictable IRQ is of course sampled for entropy */ | 894 | /* This real unpredictable IRQ is of course sampled for entropy */ |
910 | err = request_irq(client->irq, ab3100_irq_handler, | 895 | rand_initialize_irq(client->irq); |
911 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, | 896 | |
912 | "AB3100 IRQ", ab3100); | ||
913 | if (err) | 897 | if (err) |
914 | goto exit_no_irq; | 898 | goto exit_no_irq; |
915 | 899 | ||
diff --git a/drivers/mfd/ab3100-otp.c b/drivers/mfd/ab3100-otp.c index 0499b2031a2c..b603469dff69 100644 --- a/drivers/mfd/ab3100-otp.c +++ b/drivers/mfd/ab3100-otp.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/mfd/ab3100.h> | 14 | #include <linux/mfd/ab3100.h> |
15 | #include <linux/debugfs.h> | 15 | #include <linux/debugfs.h> |
16 | #include <linux/seq_file.h> | ||
16 | 17 | ||
17 | /* The OTP registers */ | 18 | /* The OTP registers */ |
18 | #define AB3100_OTP0 0xb0 | 19 | #define AB3100_OTP0 0xb0 |
@@ -95,11 +96,10 @@ static int __init ab3100_otp_read(struct ab3100_otp *otp) | |||
95 | * This is a simple debugfs human-readable file that dumps out | 96 | * This is a simple debugfs human-readable file that dumps out |
96 | * the contents of the OTP. | 97 | * the contents of the OTP. |
97 | */ | 98 | */ |
98 | #ifdef CONFIG_DEBUGFS | 99 | #ifdef CONFIG_DEBUG_FS |
99 | static int show_otp(struct seq_file *s, void *v) | 100 | static int ab3100_show_otp(struct seq_file *s, void *v) |
100 | { | 101 | { |
101 | struct ab3100_otp *otp = s->private; | 102 | struct ab3100_otp *otp = s->private; |
102 | int err; | ||
103 | 103 | ||
104 | seq_printf(s, "OTP is %s\n", otp->locked ? "LOCKED" : "UNLOCKED"); | 104 | seq_printf(s, "OTP is %s\n", otp->locked ? "LOCKED" : "UNLOCKED"); |
105 | seq_printf(s, "OTP clock switch startup is %uHz\n", otp->freq); | 105 | seq_printf(s, "OTP clock switch startup is %uHz\n", otp->freq); |
@@ -113,7 +113,7 @@ static int show_otp(struct seq_file *s, void *v) | |||
113 | 113 | ||
114 | static int ab3100_otp_open(struct inode *inode, struct file *file) | 114 | static int ab3100_otp_open(struct inode *inode, struct file *file) |
115 | { | 115 | { |
116 | return single_open(file, ab3100_otp_show, inode->i_private); | 116 | return single_open(file, ab3100_show_otp, inode->i_private); |
117 | } | 117 | } |
118 | 118 | ||
119 | static const struct file_operations ab3100_otp_operations = { | 119 | static const struct file_operations ab3100_otp_operations = { |
@@ -131,13 +131,14 @@ static int __init ab3100_otp_init_debugfs(struct device *dev, | |||
131 | &ab3100_otp_operations); | 131 | &ab3100_otp_operations); |
132 | if (!otp->debugfs) { | 132 | if (!otp->debugfs) { |
133 | dev_err(dev, "AB3100 debugfs OTP file registration failed!\n"); | 133 | dev_err(dev, "AB3100 debugfs OTP file registration failed!\n"); |
134 | return err; | 134 | return -ENOENT; |
135 | } | 135 | } |
136 | return 0; | ||
136 | } | 137 | } |
137 | 138 | ||
138 | static void __exit ab3100_otp_exit_debugfs(struct ab3100_otp *otp) | 139 | static void __exit ab3100_otp_exit_debugfs(struct ab3100_otp *otp) |
139 | { | 140 | { |
140 | debugfs_remove_file(otp->debugfs); | 141 | debugfs_remove(otp->debugfs); |
141 | } | 142 | } |
142 | #else | 143 | #else |
143 | /* Compile this out if debugfs not selected */ | 144 | /* Compile this out if debugfs not selected */ |
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c new file mode 100644 index 000000000000..37b9fdab4f36 --- /dev/null +++ b/drivers/mfd/htc-i2cpld.c | |||
@@ -0,0 +1,710 @@ | |||
1 | /* | ||
2 | * htc-i2cpld.c | ||
3 | * Chip driver for an unknown CPLD chip found on omap850 HTC devices like | ||
4 | * the HTC Wizard and HTC Herald. | ||
5 | * The cpld is located on the i2c bus and acts as an input/output GPIO | ||
6 | * extender. | ||
7 | * | ||
8 | * Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com> | ||
9 | * | ||
10 | * Based on work done in the linwizard project | ||
11 | * Copyright (C) 2008-2009 Angelo Arrifano <miknix@gmail.com> | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | |||
28 | #include <linux/kernel.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/module.h> | ||
31 | #include <linux/interrupt.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/i2c.h> | ||
34 | #include <linux/irq.h> | ||
35 | #include <linux/spinlock.h> | ||
36 | #include <linux/htcpld.h> | ||
37 | #include <linux/gpio.h> | ||
38 | |||
39 | struct htcpld_chip { | ||
40 | spinlock_t lock; | ||
41 | |||
42 | /* chip info */ | ||
43 | u8 reset; | ||
44 | u8 addr; | ||
45 | struct device *dev; | ||
46 | struct i2c_client *client; | ||
47 | |||
48 | /* Output details */ | ||
49 | u8 cache_out; | ||
50 | struct gpio_chip chip_out; | ||
51 | |||
52 | /* Input details */ | ||
53 | u8 cache_in; | ||
54 | struct gpio_chip chip_in; | ||
55 | |||
56 | u16 irqs_enabled; | ||
57 | uint irq_start; | ||
58 | int nirqs; | ||
59 | |||
60 | /* | ||
61 | * Work structure to allow for setting values outside of any | ||
62 | * possible interrupt context | ||
63 | */ | ||
64 | struct work_struct set_val_work; | ||
65 | }; | ||
66 | |||
67 | struct htcpld_data { | ||
68 | /* irq info */ | ||
69 | u16 irqs_enabled; | ||
70 | uint irq_start; | ||
71 | int nirqs; | ||
72 | uint chained_irq; | ||
73 | unsigned int int_reset_gpio_hi; | ||
74 | unsigned int int_reset_gpio_lo; | ||
75 | |||
76 | /* htcpld info */ | ||
77 | struct htcpld_chip *chip; | ||
78 | unsigned int nchips; | ||
79 | }; | ||
80 | |||
81 | /* There does not appear to be a way to proactively mask interrupts | ||
82 | * on the htcpld chip itself. So, we simply ignore interrupts that | ||
83 | * aren't desired. */ | ||
84 | static void htcpld_mask(unsigned int irq) | ||
85 | { | ||
86 | struct htcpld_chip *chip = get_irq_chip_data(irq); | ||
87 | chip->irqs_enabled &= ~(1 << (irq - chip->irq_start)); | ||
88 | pr_debug("HTCPLD mask %d %04x\n", irq, chip->irqs_enabled); | ||
89 | } | ||
90 | static void htcpld_unmask(unsigned int irq) | ||
91 | { | ||
92 | struct htcpld_chip *chip = get_irq_chip_data(irq); | ||
93 | chip->irqs_enabled |= 1 << (irq - chip->irq_start); | ||
94 | pr_debug("HTCPLD unmask %d %04x\n", irq, chip->irqs_enabled); | ||
95 | } | ||
96 | |||
97 | static int htcpld_set_type(unsigned int irq, unsigned int flags) | ||
98 | { | ||
99 | struct irq_desc *d = irq_to_desc(irq); | ||
100 | |||
101 | if (!d) { | ||
102 | pr_err("HTCPLD invalid IRQ: %d\n", irq); | ||
103 | return -EINVAL; | ||
104 | } | ||
105 | |||
106 | if (flags & ~IRQ_TYPE_SENSE_MASK) | ||
107 | return -EINVAL; | ||
108 | |||
109 | /* We only allow edge triggering */ | ||
110 | if (flags & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH)) | ||
111 | return -EINVAL; | ||
112 | |||
113 | d->status &= ~IRQ_TYPE_SENSE_MASK; | ||
114 | d->status |= flags; | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static struct irq_chip htcpld_muxed_chip = { | ||
120 | .name = "htcpld", | ||
121 | .mask = htcpld_mask, | ||
122 | .unmask = htcpld_unmask, | ||
123 | .set_type = htcpld_set_type, | ||
124 | }; | ||
125 | |||
126 | /* To properly dispatch IRQ events, we need to read from the | ||
127 | * chip. This is an I2C action that could possibly sleep | ||
128 | * (which is bad in interrupt context) -- so we use a threaded | ||
129 | * interrupt handler to get around that. | ||
130 | */ | ||
131 | static irqreturn_t htcpld_handler(int irq, void *dev) | ||
132 | { | ||
133 | struct htcpld_data *htcpld = dev; | ||
134 | unsigned int i; | ||
135 | unsigned long flags; | ||
136 | int irqpin; | ||
137 | struct irq_desc *desc; | ||
138 | |||
139 | if (!htcpld) { | ||
140 | pr_debug("htcpld is null in ISR\n"); | ||
141 | return IRQ_HANDLED; | ||
142 | } | ||
143 | |||
144 | /* | ||
145 | * For each chip, do a read of the chip and trigger any interrupts | ||
146 | * desired. The interrupts will be triggered from LSB to MSB (i.e. | ||
147 | * bit 0 first, then bit 1, etc.) | ||
148 | * | ||
149 | * For chips that have no interrupt range specified, just skip 'em. | ||
150 | */ | ||
151 | for (i = 0; i < htcpld->nchips; i++) { | ||
152 | struct htcpld_chip *chip = &htcpld->chip[i]; | ||
153 | struct i2c_client *client; | ||
154 | int val; | ||
155 | unsigned long uval, old_val; | ||
156 | |||
157 | if (!chip) { | ||
158 | pr_debug("chip %d is null in ISR\n", i); | ||
159 | continue; | ||
160 | } | ||
161 | |||
162 | if (chip->nirqs == 0) | ||
163 | continue; | ||
164 | |||
165 | client = chip->client; | ||
166 | if (!client) { | ||
167 | pr_debug("client %d is null in ISR\n", i); | ||
168 | continue; | ||
169 | } | ||
170 | |||
171 | /* Scan the chip */ | ||
172 | val = i2c_smbus_read_byte_data(client, chip->cache_out); | ||
173 | if (val < 0) { | ||
174 | /* Throw a warning and skip this chip */ | ||
175 | dev_warn(chip->dev, "Unable to read from chip: %d\n", | ||
176 | val); | ||
177 | continue; | ||
178 | } | ||
179 | |||
180 | uval = (unsigned long)val; | ||
181 | |||
182 | spin_lock_irqsave(&chip->lock, flags); | ||
183 | |||
184 | /* Save away the old value so we can compare it */ | ||
185 | old_val = chip->cache_in; | ||
186 | |||
187 | /* Write the new value */ | ||
188 | chip->cache_in = uval; | ||
189 | |||
190 | spin_unlock_irqrestore(&chip->lock, flags); | ||
191 | |||
192 | /* | ||
193 | * For each bit in the data (starting at bit 0), trigger | ||
194 | * associated interrupts. | ||
195 | */ | ||
196 | for (irqpin = 0; irqpin < chip->nirqs; irqpin++) { | ||
197 | unsigned oldb, newb; | ||
198 | int flags; | ||
199 | |||
200 | irq = chip->irq_start + irqpin; | ||
201 | desc = irq_to_desc(irq); | ||
202 | flags = desc->status; | ||
203 | |||
204 | /* Run the IRQ handler, but only if the bit value | ||
205 | * changed, and the proper flags are set */ | ||
206 | oldb = (old_val >> irqpin) & 1; | ||
207 | newb = (uval >> irqpin) & 1; | ||
208 | |||
209 | if ((!oldb && newb && (flags & IRQ_TYPE_EDGE_RISING)) || | ||
210 | (oldb && !newb && | ||
211 | (flags & IRQ_TYPE_EDGE_FALLING))) { | ||
212 | pr_debug("fire IRQ %d\n", irqpin); | ||
213 | desc->handle_irq(irq, desc); | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | |||
218 | /* | ||
219 | * In order to continue receiving interrupts, the int_reset_gpio must | ||
220 | * be asserted. | ||
221 | */ | ||
222 | if (htcpld->int_reset_gpio_hi) | ||
223 | gpio_set_value(htcpld->int_reset_gpio_hi, 1); | ||
224 | if (htcpld->int_reset_gpio_lo) | ||
225 | gpio_set_value(htcpld->int_reset_gpio_lo, 0); | ||
226 | |||
227 | return IRQ_HANDLED; | ||
228 | } | ||
229 | |||
230 | /* | ||
231 | * The GPIO set routines can be called from interrupt context, especially if, | ||
232 | * for example they're attached to the led-gpio framework and a trigger is | ||
233 | * enabled. As such, we declared work above in the htcpld_chip structure, | ||
234 | * and that work is scheduled in the set routine. The kernel can then run | ||
235 | * the I2C functions, which will sleep, in process context. | ||
236 | */ | ||
237 | void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) | ||
238 | { | ||
239 | struct i2c_client *client; | ||
240 | struct htcpld_chip *chip_data; | ||
241 | unsigned long flags; | ||
242 | |||
243 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
244 | if (!chip_data) | ||
245 | return; | ||
246 | |||
247 | client = chip_data->client; | ||
248 | if (client == NULL) | ||
249 | return; | ||
250 | |||
251 | spin_lock_irqsave(&chip_data->lock, flags); | ||
252 | if (val) | ||
253 | chip_data->cache_out |= (1 << offset); | ||
254 | else | ||
255 | chip_data->cache_out &= ~(1 << offset); | ||
256 | spin_unlock_irqrestore(&chip_data->lock, flags); | ||
257 | |||
258 | schedule_work(&(chip_data->set_val_work)); | ||
259 | } | ||
260 | |||
261 | void htcpld_chip_set_ni(struct work_struct *work) | ||
262 | { | ||
263 | struct htcpld_chip *chip_data; | ||
264 | struct i2c_client *client; | ||
265 | |||
266 | chip_data = container_of(work, struct htcpld_chip, set_val_work); | ||
267 | client = chip_data->client; | ||
268 | i2c_smbus_read_byte_data(client, chip_data->cache_out); | ||
269 | } | ||
270 | |||
271 | int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) | ||
272 | { | ||
273 | struct htcpld_chip *chip_data; | ||
274 | int val = 0; | ||
275 | int is_input = 0; | ||
276 | |||
277 | /* Try out first */ | ||
278 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
279 | if (!chip_data) { | ||
280 | /* Try in */ | ||
281 | is_input = 1; | ||
282 | chip_data = container_of(chip, struct htcpld_chip, chip_in); | ||
283 | if (!chip_data) | ||
284 | return -EINVAL; | ||
285 | } | ||
286 | |||
287 | /* Determine if this is an input or output GPIO */ | ||
288 | if (!is_input) | ||
289 | /* Use the output cache */ | ||
290 | val = (chip_data->cache_out >> offset) & 1; | ||
291 | else | ||
292 | /* Use the input cache */ | ||
293 | val = (chip_data->cache_in >> offset) & 1; | ||
294 | |||
295 | if (val) | ||
296 | return 1; | ||
297 | else | ||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | static int htcpld_direction_output(struct gpio_chip *chip, | ||
302 | unsigned offset, int value) | ||
303 | { | ||
304 | htcpld_chip_set(chip, offset, value); | ||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | static int htcpld_direction_input(struct gpio_chip *chip, | ||
309 | unsigned offset) | ||
310 | { | ||
311 | /* | ||
312 | * No-op: this function can only be called on the input chip. | ||
313 | * We do however make sure the offset is within range. | ||
314 | */ | ||
315 | return (offset < chip->ngpio) ? 0 : -EINVAL; | ||
316 | } | ||
317 | |||
318 | int htcpld_chip_to_irq(struct gpio_chip *chip, unsigned offset) | ||
319 | { | ||
320 | struct htcpld_chip *chip_data; | ||
321 | |||
322 | chip_data = container_of(chip, struct htcpld_chip, chip_in); | ||
323 | |||
324 | if (offset < chip_data->nirqs) | ||
325 | return chip_data->irq_start + offset; | ||
326 | else | ||
327 | return -EINVAL; | ||
328 | } | ||
329 | |||
330 | void htcpld_chip_reset(struct i2c_client *client) | ||
331 | { | ||
332 | struct htcpld_chip *chip_data = i2c_get_clientdata(client); | ||
333 | if (!chip_data) | ||
334 | return; | ||
335 | |||
336 | i2c_smbus_read_byte_data( | ||
337 | client, (chip_data->cache_out = chip_data->reset)); | ||
338 | } | ||
339 | |||
340 | static int __devinit htcpld_setup_chip_irq( | ||
341 | struct platform_device *pdev, | ||
342 | int chip_index) | ||
343 | { | ||
344 | struct htcpld_data *htcpld; | ||
345 | struct device *dev = &pdev->dev; | ||
346 | struct htcpld_core_platform_data *pdata; | ||
347 | struct htcpld_chip *chip; | ||
348 | struct htcpld_chip_platform_data *plat_chip_data; | ||
349 | unsigned int irq, irq_end; | ||
350 | int ret = 0; | ||
351 | |||
352 | /* Get the platform and driver data */ | ||
353 | pdata = dev->platform_data; | ||
354 | htcpld = platform_get_drvdata(pdev); | ||
355 | chip = &htcpld->chip[chip_index]; | ||
356 | plat_chip_data = &pdata->chip[chip_index]; | ||
357 | |||
358 | /* Setup irq handlers */ | ||
359 | irq_end = chip->irq_start + chip->nirqs; | ||
360 | for (irq = chip->irq_start; irq < irq_end; irq++) { | ||
361 | set_irq_chip(irq, &htcpld_muxed_chip); | ||
362 | set_irq_chip_data(irq, chip); | ||
363 | set_irq_handler(irq, handle_simple_irq); | ||
364 | #ifdef CONFIG_ARM | ||
365 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
366 | #else | ||
367 | set_irq_probe(irq); | ||
368 | #endif | ||
369 | } | ||
370 | |||
371 | return ret; | ||
372 | } | ||
373 | |||
374 | static int __devinit htcpld_register_chip_i2c( | ||
375 | struct platform_device *pdev, | ||
376 | int chip_index) | ||
377 | { | ||
378 | struct htcpld_data *htcpld; | ||
379 | struct device *dev = &pdev->dev; | ||
380 | struct htcpld_core_platform_data *pdata; | ||
381 | struct htcpld_chip *chip; | ||
382 | struct htcpld_chip_platform_data *plat_chip_data; | ||
383 | struct i2c_adapter *adapter; | ||
384 | struct i2c_client *client; | ||
385 | struct i2c_board_info info; | ||
386 | |||
387 | /* Get the platform and driver data */ | ||
388 | pdata = dev->platform_data; | ||
389 | htcpld = platform_get_drvdata(pdev); | ||
390 | chip = &htcpld->chip[chip_index]; | ||
391 | plat_chip_data = &pdata->chip[chip_index]; | ||
392 | |||
393 | adapter = i2c_get_adapter(pdata->i2c_adapter_id); | ||
394 | if (adapter == NULL) { | ||
395 | /* Eek, no such I2C adapter! Bail out. */ | ||
396 | dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", | ||
397 | plat_chip_data->addr, pdata->i2c_adapter_id); | ||
398 | return -ENODEV; | ||
399 | } | ||
400 | |||
401 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA)) { | ||
402 | dev_warn(dev, "i2c adapter %d non-functional\n", | ||
403 | pdata->i2c_adapter_id); | ||
404 | return -EINVAL; | ||
405 | } | ||
406 | |||
407 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
408 | info.addr = plat_chip_data->addr; | ||
409 | strlcpy(info.type, "htcpld-chip", I2C_NAME_SIZE); | ||
410 | info.platform_data = chip; | ||
411 | |||
412 | /* Add the I2C device. This calls the probe() function. */ | ||
413 | client = i2c_new_device(adapter, &info); | ||
414 | if (!client) { | ||
415 | /* I2C device registration failed, contineu with the next */ | ||
416 | dev_warn(dev, "Unable to add I2C device for 0x%x\n", | ||
417 | plat_chip_data->addr); | ||
418 | return -ENODEV; | ||
419 | } | ||
420 | |||
421 | i2c_set_clientdata(client, chip); | ||
422 | snprintf(client->name, I2C_NAME_SIZE, "Chip_0x%d", client->addr); | ||
423 | chip->client = client; | ||
424 | |||
425 | /* Reset the chip */ | ||
426 | htcpld_chip_reset(client); | ||
427 | chip->cache_in = i2c_smbus_read_byte_data(client, chip->cache_out); | ||
428 | |||
429 | return 0; | ||
430 | } | ||
431 | |||
432 | static void __devinit htcpld_unregister_chip_i2c( | ||
433 | struct platform_device *pdev, | ||
434 | int chip_index) | ||
435 | { | ||
436 | struct htcpld_data *htcpld; | ||
437 | struct htcpld_chip *chip; | ||
438 | |||
439 | /* Get the platform and driver data */ | ||
440 | htcpld = platform_get_drvdata(pdev); | ||
441 | chip = &htcpld->chip[chip_index]; | ||
442 | |||
443 | if (chip->client) | ||
444 | i2c_unregister_device(chip->client); | ||
445 | } | ||
446 | |||
447 | static int __devinit htcpld_register_chip_gpio( | ||
448 | struct platform_device *pdev, | ||
449 | int chip_index) | ||
450 | { | ||
451 | struct htcpld_data *htcpld; | ||
452 | struct device *dev = &pdev->dev; | ||
453 | struct htcpld_core_platform_data *pdata; | ||
454 | struct htcpld_chip *chip; | ||
455 | struct htcpld_chip_platform_data *plat_chip_data; | ||
456 | struct gpio_chip *gpio_chip; | ||
457 | int ret = 0; | ||
458 | |||
459 | /* Get the platform and driver data */ | ||
460 | pdata = dev->platform_data; | ||
461 | htcpld = platform_get_drvdata(pdev); | ||
462 | chip = &htcpld->chip[chip_index]; | ||
463 | plat_chip_data = &pdata->chip[chip_index]; | ||
464 | |||
465 | /* Setup the GPIO chips */ | ||
466 | gpio_chip = &(chip->chip_out); | ||
467 | gpio_chip->label = "htcpld-out"; | ||
468 | gpio_chip->dev = dev; | ||
469 | gpio_chip->owner = THIS_MODULE; | ||
470 | gpio_chip->get = htcpld_chip_get; | ||
471 | gpio_chip->set = htcpld_chip_set; | ||
472 | gpio_chip->direction_input = NULL; | ||
473 | gpio_chip->direction_output = htcpld_direction_output; | ||
474 | gpio_chip->base = plat_chip_data->gpio_out_base; | ||
475 | gpio_chip->ngpio = plat_chip_data->num_gpios; | ||
476 | |||
477 | gpio_chip = &(chip->chip_in); | ||
478 | gpio_chip->label = "htcpld-in"; | ||
479 | gpio_chip->dev = dev; | ||
480 | gpio_chip->owner = THIS_MODULE; | ||
481 | gpio_chip->get = htcpld_chip_get; | ||
482 | gpio_chip->set = NULL; | ||
483 | gpio_chip->direction_input = htcpld_direction_input; | ||
484 | gpio_chip->direction_output = NULL; | ||
485 | gpio_chip->to_irq = htcpld_chip_to_irq; | ||
486 | gpio_chip->base = plat_chip_data->gpio_in_base; | ||
487 | gpio_chip->ngpio = plat_chip_data->num_gpios; | ||
488 | |||
489 | /* Add the GPIO chips */ | ||
490 | ret = gpiochip_add(&(chip->chip_out)); | ||
491 | if (ret) { | ||
492 | dev_warn(dev, "Unable to register output GPIOs for 0x%x: %d\n", | ||
493 | plat_chip_data->addr, ret); | ||
494 | return ret; | ||
495 | } | ||
496 | |||
497 | ret = gpiochip_add(&(chip->chip_in)); | ||
498 | if (ret) { | ||
499 | int error; | ||
500 | |||
501 | dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n", | ||
502 | plat_chip_data->addr, ret); | ||
503 | |||
504 | error = gpiochip_remove(&(chip->chip_out)); | ||
505 | if (error) | ||
506 | dev_warn(dev, "Error while trying to unregister gpio chip: %d\n", error); | ||
507 | |||
508 | return ret; | ||
509 | } | ||
510 | |||
511 | return 0; | ||
512 | } | ||
513 | |||
514 | static int __devinit htcpld_setup_chips(struct platform_device *pdev) | ||
515 | { | ||
516 | struct htcpld_data *htcpld; | ||
517 | struct device *dev = &pdev->dev; | ||
518 | struct htcpld_core_platform_data *pdata; | ||
519 | int i; | ||
520 | |||
521 | /* Get the platform and driver data */ | ||
522 | pdata = dev->platform_data; | ||
523 | htcpld = platform_get_drvdata(pdev); | ||
524 | |||
525 | /* Setup each chip's output GPIOs */ | ||
526 | htcpld->nchips = pdata->num_chip; | ||
527 | htcpld->chip = kzalloc(sizeof(struct htcpld_chip) * htcpld->nchips, | ||
528 | GFP_KERNEL); | ||
529 | if (!htcpld->chip) { | ||
530 | dev_warn(dev, "Unable to allocate memory for chips\n"); | ||
531 | return -ENOMEM; | ||
532 | } | ||
533 | |||
534 | /* Add the chips as best we can */ | ||
535 | for (i = 0; i < htcpld->nchips; i++) { | ||
536 | int ret; | ||
537 | |||
538 | /* Setup the HTCPLD chips */ | ||
539 | htcpld->chip[i].reset = pdata->chip[i].reset; | ||
540 | htcpld->chip[i].cache_out = pdata->chip[i].reset; | ||
541 | htcpld->chip[i].cache_in = 0; | ||
542 | htcpld->chip[i].dev = dev; | ||
543 | htcpld->chip[i].irq_start = pdata->chip[i].irq_base; | ||
544 | htcpld->chip[i].nirqs = pdata->chip[i].num_irqs; | ||
545 | |||
546 | INIT_WORK(&(htcpld->chip[i].set_val_work), &htcpld_chip_set_ni); | ||
547 | spin_lock_init(&(htcpld->chip[i].lock)); | ||
548 | |||
549 | /* Setup the interrupts for the chip */ | ||
550 | if (htcpld->chained_irq) { | ||
551 | ret = htcpld_setup_chip_irq(pdev, i); | ||
552 | if (ret) | ||
553 | continue; | ||
554 | } | ||
555 | |||
556 | /* Register the chip with I2C */ | ||
557 | ret = htcpld_register_chip_i2c(pdev, i); | ||
558 | if (ret) | ||
559 | continue; | ||
560 | |||
561 | |||
562 | /* Register the chips with the GPIO subsystem */ | ||
563 | ret = htcpld_register_chip_gpio(pdev, i); | ||
564 | if (ret) { | ||
565 | /* Unregister the chip from i2c and continue */ | ||
566 | htcpld_unregister_chip_i2c(pdev, i); | ||
567 | continue; | ||
568 | } | ||
569 | |||
570 | dev_info(dev, "Registered chip at 0x%x\n", pdata->chip[i].addr); | ||
571 | } | ||
572 | |||
573 | return 0; | ||
574 | } | ||
575 | |||
576 | static int __devinit htcpld_core_probe(struct platform_device *pdev) | ||
577 | { | ||
578 | struct htcpld_data *htcpld; | ||
579 | struct device *dev = &pdev->dev; | ||
580 | struct htcpld_core_platform_data *pdata; | ||
581 | struct resource *res; | ||
582 | int ret = 0; | ||
583 | |||
584 | if (!dev) | ||
585 | return -ENODEV; | ||
586 | |||
587 | pdata = dev->platform_data; | ||
588 | if (!pdata) { | ||
589 | dev_warn(dev, "Platform data not found for htcpld core!\n"); | ||
590 | return -ENXIO; | ||
591 | } | ||
592 | |||
593 | htcpld = kzalloc(sizeof(struct htcpld_data), GFP_KERNEL); | ||
594 | if (!htcpld) | ||
595 | return -ENOMEM; | ||
596 | |||
597 | /* Find chained irq */ | ||
598 | ret = -EINVAL; | ||
599 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
600 | if (res) { | ||
601 | int flags; | ||
602 | htcpld->chained_irq = res->start; | ||
603 | |||
604 | /* Setup the chained interrupt handler */ | ||
605 | flags = IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING; | ||
606 | ret = request_threaded_irq(htcpld->chained_irq, | ||
607 | NULL, htcpld_handler, | ||
608 | flags, pdev->name, htcpld); | ||
609 | if (ret) { | ||
610 | dev_warn(dev, "Unable to setup chained irq handler: %d\n", ret); | ||
611 | goto fail; | ||
612 | } else | ||
613 | device_init_wakeup(dev, 0); | ||
614 | } | ||
615 | |||
616 | /* Set the driver data */ | ||
617 | platform_set_drvdata(pdev, htcpld); | ||
618 | |||
619 | /* Setup the htcpld chips */ | ||
620 | ret = htcpld_setup_chips(pdev); | ||
621 | if (ret) | ||
622 | goto fail; | ||
623 | |||
624 | /* Request the GPIO(s) for the int reset and set them up */ | ||
625 | if (pdata->int_reset_gpio_hi) { | ||
626 | ret = gpio_request(pdata->int_reset_gpio_hi, "htcpld-core"); | ||
627 | if (ret) { | ||
628 | /* | ||
629 | * If it failed, that sucks, but we can probably | ||
630 | * continue on without it. | ||
631 | */ | ||
632 | dev_warn(dev, "Unable to request int_reset_gpio_hi -- interrupts may not work\n"); | ||
633 | htcpld->int_reset_gpio_hi = 0; | ||
634 | } else { | ||
635 | htcpld->int_reset_gpio_hi = pdata->int_reset_gpio_hi; | ||
636 | gpio_set_value(htcpld->int_reset_gpio_hi, 1); | ||
637 | } | ||
638 | } | ||
639 | |||
640 | if (pdata->int_reset_gpio_lo) { | ||
641 | ret = gpio_request(pdata->int_reset_gpio_lo, "htcpld-core"); | ||
642 | if (ret) { | ||
643 | /* | ||
644 | * If it failed, that sucks, but we can probably | ||
645 | * continue on without it. | ||
646 | */ | ||
647 | dev_warn(dev, "Unable to request int_reset_gpio_lo -- interrupts may not work\n"); | ||
648 | htcpld->int_reset_gpio_lo = 0; | ||
649 | } else { | ||
650 | htcpld->int_reset_gpio_lo = pdata->int_reset_gpio_lo; | ||
651 | gpio_set_value(htcpld->int_reset_gpio_lo, 0); | ||
652 | } | ||
653 | } | ||
654 | |||
655 | dev_info(dev, "Initialized successfully\n"); | ||
656 | return 0; | ||
657 | |||
658 | fail: | ||
659 | kfree(htcpld); | ||
660 | return ret; | ||
661 | } | ||
662 | |||
663 | /* The I2C Driver -- used internally */ | ||
664 | static const struct i2c_device_id htcpld_chip_id[] = { | ||
665 | { "htcpld-chip", 0 }, | ||
666 | { } | ||
667 | }; | ||
668 | MODULE_DEVICE_TABLE(i2c, htcpld_chip_id); | ||
669 | |||
670 | |||
671 | static struct i2c_driver htcpld_chip_driver = { | ||
672 | .driver = { | ||
673 | .name = "htcpld-chip", | ||
674 | }, | ||
675 | .id_table = htcpld_chip_id, | ||
676 | }; | ||
677 | |||
678 | /* The Core Driver */ | ||
679 | static struct platform_driver htcpld_core_driver = { | ||
680 | .driver = { | ||
681 | .name = "i2c-htcpld", | ||
682 | }, | ||
683 | }; | ||
684 | |||
685 | static int __init htcpld_core_init(void) | ||
686 | { | ||
687 | int ret; | ||
688 | |||
689 | /* Register the I2C Chip driver */ | ||
690 | ret = i2c_add_driver(&htcpld_chip_driver); | ||
691 | if (ret) | ||
692 | return ret; | ||
693 | |||
694 | /* Probe for our chips */ | ||
695 | return platform_driver_probe(&htcpld_core_driver, htcpld_core_probe); | ||
696 | } | ||
697 | |||
698 | static void __exit htcpld_core_exit(void) | ||
699 | { | ||
700 | i2c_del_driver(&htcpld_chip_driver); | ||
701 | platform_driver_unregister(&htcpld_core_driver); | ||
702 | } | ||
703 | |||
704 | module_init(htcpld_core_init); | ||
705 | module_exit(htcpld_core_exit); | ||
706 | |||
707 | MODULE_AUTHOR("Cory Maccarrone <darkstar6262@gmail.com>"); | ||
708 | MODULE_DESCRIPTION("I2C HTC PLD Driver"); | ||
709 | MODULE_LICENSE("GPL"); | ||
710 | |||
diff --git a/drivers/mfd/lpc_sch.c b/drivers/mfd/lpc_sch.c new file mode 100644 index 000000000000..51b2f6065a0b --- /dev/null +++ b/drivers/mfd/lpc_sch.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* | ||
2 | * lpc_sch.c - LPC interface for Intel Poulsbo SCH | ||
3 | * | ||
4 | * LPC bridge function of the Intel SCH contains many other | ||
5 | * functional units, such as Interrupt controllers, Timers, | ||
6 | * Power Management, System Management, GPIO, RTC, and LPC | ||
7 | * Configuration Registers. | ||
8 | * | ||
9 | * Copyright (c) 2010 CompuLab Ltd | ||
10 | * Author: Denis Turischev <denis@compulab.co.il> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License 2 as published | ||
14 | * by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; see the file COPYING. If not, write to | ||
23 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | #include <linux/init.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/module.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/acpi.h> | ||
31 | #include <linux/pci.h> | ||
32 | #include <linux/mfd/core.h> | ||
33 | |||
34 | #define SMBASE 0x40 | ||
35 | #define SMBUS_IO_SIZE 64 | ||
36 | |||
37 | #define GPIOBASE 0x44 | ||
38 | #define GPIO_IO_SIZE 64 | ||
39 | |||
40 | static struct resource smbus_sch_resource = { | ||
41 | .flags = IORESOURCE_IO, | ||
42 | }; | ||
43 | |||
44 | |||
45 | static struct resource gpio_sch_resource = { | ||
46 | .flags = IORESOURCE_IO, | ||
47 | }; | ||
48 | |||
49 | static struct mfd_cell lpc_sch_cells[] = { | ||
50 | { | ||
51 | .name = "isch_smbus", | ||
52 | .num_resources = 1, | ||
53 | .resources = &smbus_sch_resource, | ||
54 | }, | ||
55 | { | ||
56 | .name = "sch_gpio", | ||
57 | .num_resources = 1, | ||
58 | .resources = &gpio_sch_resource, | ||
59 | }, | ||
60 | }; | ||
61 | |||
62 | static struct pci_device_id lpc_sch_ids[] = { | ||
63 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, | ||
64 | { 0, } | ||
65 | }; | ||
66 | MODULE_DEVICE_TABLE(pci, lpc_sch_ids); | ||
67 | |||
68 | static int __devinit lpc_sch_probe(struct pci_dev *dev, | ||
69 | const struct pci_device_id *id) | ||
70 | { | ||
71 | unsigned int base_addr_cfg; | ||
72 | unsigned short base_addr; | ||
73 | |||
74 | pci_read_config_dword(dev, SMBASE, &base_addr_cfg); | ||
75 | if (!(base_addr_cfg & (1 << 31))) { | ||
76 | dev_err(&dev->dev, "Decode of the SMBus I/O range disabled\n"); | ||
77 | return -ENODEV; | ||
78 | } | ||
79 | base_addr = (unsigned short)base_addr_cfg; | ||
80 | if (base_addr == 0) { | ||
81 | dev_err(&dev->dev, "I/O space for SMBus uninitialized\n"); | ||
82 | return -ENODEV; | ||
83 | } | ||
84 | |||
85 | smbus_sch_resource.start = base_addr; | ||
86 | smbus_sch_resource.end = base_addr + SMBUS_IO_SIZE - 1; | ||
87 | |||
88 | pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg); | ||
89 | if (!(base_addr_cfg & (1 << 31))) { | ||
90 | dev_err(&dev->dev, "Decode of the GPIO I/O range disabled\n"); | ||
91 | return -ENODEV; | ||
92 | } | ||
93 | base_addr = (unsigned short)base_addr_cfg; | ||
94 | if (base_addr == 0) { | ||
95 | dev_err(&dev->dev, "I/O space for GPIO uninitialized\n"); | ||
96 | return -ENODEV; | ||
97 | } | ||
98 | |||
99 | gpio_sch_resource.start = base_addr; | ||
100 | gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1; | ||
101 | |||
102 | return mfd_add_devices(&dev->dev, -1, | ||
103 | lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0); | ||
104 | } | ||
105 | |||
106 | static void __devexit lpc_sch_remove(struct pci_dev *dev) | ||
107 | { | ||
108 | mfd_remove_devices(&dev->dev); | ||
109 | } | ||
110 | |||
111 | static struct pci_driver lpc_sch_driver = { | ||
112 | .name = "lpc_sch", | ||
113 | .id_table = lpc_sch_ids, | ||
114 | .probe = lpc_sch_probe, | ||
115 | .remove = __devexit_p(lpc_sch_remove), | ||
116 | }; | ||
117 | |||
118 | static int __init lpc_sch_init(void) | ||
119 | { | ||
120 | return pci_register_driver(&lpc_sch_driver); | ||
121 | } | ||
122 | |||
123 | static void __exit lpc_sch_exit(void) | ||
124 | { | ||
125 | pci_unregister_driver(&lpc_sch_driver); | ||
126 | } | ||
127 | |||
128 | module_init(lpc_sch_init); | ||
129 | module_exit(lpc_sch_exit); | ||
130 | |||
131 | MODULE_AUTHOR("Denis Turischev <denis@compulab.co.il>"); | ||
132 | MODULE_DESCRIPTION("LPC interface for Intel Poulsbo SCH"); | ||
133 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c new file mode 100644 index 000000000000..85d63c04749b --- /dev/null +++ b/drivers/mfd/max8925-core.c | |||
@@ -0,0 +1,656 @@ | |||
1 | /* | ||
2 | * Base driver for Maxim MAX8925 | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/mfd/core.h> | ||
19 | #include <linux/mfd/max8925.h> | ||
20 | |||
21 | static struct resource backlight_resources[] = { | ||
22 | { | ||
23 | .name = "max8925-backlight", | ||
24 | .start = MAX8925_WLED_MODE_CNTL, | ||
25 | .end = MAX8925_WLED_CNTL, | ||
26 | .flags = IORESOURCE_IO, | ||
27 | }, | ||
28 | }; | ||
29 | |||
30 | static struct mfd_cell backlight_devs[] = { | ||
31 | { | ||
32 | .name = "max8925-backlight", | ||
33 | .num_resources = 1, | ||
34 | .resources = &backlight_resources[0], | ||
35 | .id = -1, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | static struct resource touch_resources[] = { | ||
40 | { | ||
41 | .name = "max8925-tsc", | ||
42 | .start = MAX8925_TSC_IRQ, | ||
43 | .end = MAX8925_ADC_RES_END, | ||
44 | .flags = IORESOURCE_IO, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | static struct mfd_cell touch_devs[] = { | ||
49 | { | ||
50 | .name = "max8925-touch", | ||
51 | .num_resources = 1, | ||
52 | .resources = &touch_resources[0], | ||
53 | .id = -1, | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static struct resource power_supply_resources[] = { | ||
58 | { | ||
59 | .name = "max8925-power", | ||
60 | .start = MAX8925_CHG_IRQ1, | ||
61 | .end = MAX8925_CHG_IRQ1_MASK, | ||
62 | .flags = IORESOURCE_IO, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | static struct mfd_cell power_devs[] = { | ||
67 | { | ||
68 | .name = "max8925-power", | ||
69 | .num_resources = 1, | ||
70 | .resources = &power_supply_resources[0], | ||
71 | .id = -1, | ||
72 | }, | ||
73 | }; | ||
74 | |||
75 | static struct resource rtc_resources[] = { | ||
76 | { | ||
77 | .name = "max8925-rtc", | ||
78 | .start = MAX8925_RTC_IRQ, | ||
79 | .end = MAX8925_RTC_IRQ_MASK, | ||
80 | .flags = IORESOURCE_IO, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | static struct mfd_cell rtc_devs[] = { | ||
85 | { | ||
86 | .name = "max8925-rtc", | ||
87 | .num_resources = 1, | ||
88 | .resources = &rtc_resources[0], | ||
89 | .id = -1, | ||
90 | }, | ||
91 | }; | ||
92 | |||
93 | #define MAX8925_REG_RESOURCE(_start, _end) \ | ||
94 | { \ | ||
95 | .start = MAX8925_##_start, \ | ||
96 | .end = MAX8925_##_end, \ | ||
97 | .flags = IORESOURCE_IO, \ | ||
98 | } | ||
99 | |||
100 | static struct resource regulator_resources[] = { | ||
101 | MAX8925_REG_RESOURCE(SDCTL1, SDCTL1), | ||
102 | MAX8925_REG_RESOURCE(SDCTL2, SDCTL2), | ||
103 | MAX8925_REG_RESOURCE(SDCTL3, SDCTL3), | ||
104 | MAX8925_REG_RESOURCE(LDOCTL1, LDOCTL1), | ||
105 | MAX8925_REG_RESOURCE(LDOCTL2, LDOCTL2), | ||
106 | MAX8925_REG_RESOURCE(LDOCTL3, LDOCTL3), | ||
107 | MAX8925_REG_RESOURCE(LDOCTL4, LDOCTL4), | ||
108 | MAX8925_REG_RESOURCE(LDOCTL5, LDOCTL5), | ||
109 | MAX8925_REG_RESOURCE(LDOCTL6, LDOCTL6), | ||
110 | MAX8925_REG_RESOURCE(LDOCTL7, LDOCTL7), | ||
111 | MAX8925_REG_RESOURCE(LDOCTL8, LDOCTL8), | ||
112 | MAX8925_REG_RESOURCE(LDOCTL9, LDOCTL9), | ||
113 | MAX8925_REG_RESOURCE(LDOCTL10, LDOCTL10), | ||
114 | MAX8925_REG_RESOURCE(LDOCTL11, LDOCTL11), | ||
115 | MAX8925_REG_RESOURCE(LDOCTL12, LDOCTL12), | ||
116 | MAX8925_REG_RESOURCE(LDOCTL13, LDOCTL13), | ||
117 | MAX8925_REG_RESOURCE(LDOCTL14, LDOCTL14), | ||
118 | MAX8925_REG_RESOURCE(LDOCTL15, LDOCTL15), | ||
119 | MAX8925_REG_RESOURCE(LDOCTL16, LDOCTL16), | ||
120 | MAX8925_REG_RESOURCE(LDOCTL17, LDOCTL17), | ||
121 | MAX8925_REG_RESOURCE(LDOCTL18, LDOCTL18), | ||
122 | MAX8925_REG_RESOURCE(LDOCTL19, LDOCTL19), | ||
123 | MAX8925_REG_RESOURCE(LDOCTL20, LDOCTL20), | ||
124 | }; | ||
125 | |||
126 | #define MAX8925_REG_DEVS(_id) \ | ||
127 | { \ | ||
128 | .name = "max8925-regulator", \ | ||
129 | .num_resources = 1, \ | ||
130 | .resources = ®ulator_resources[MAX8925_ID_##_id], \ | ||
131 | .id = MAX8925_ID_##_id, \ | ||
132 | } | ||
133 | |||
134 | static struct mfd_cell regulator_devs[] = { | ||
135 | MAX8925_REG_DEVS(SD1), | ||
136 | MAX8925_REG_DEVS(SD2), | ||
137 | MAX8925_REG_DEVS(SD3), | ||
138 | MAX8925_REG_DEVS(LDO1), | ||
139 | MAX8925_REG_DEVS(LDO2), | ||
140 | MAX8925_REG_DEVS(LDO3), | ||
141 | MAX8925_REG_DEVS(LDO4), | ||
142 | MAX8925_REG_DEVS(LDO5), | ||
143 | MAX8925_REG_DEVS(LDO6), | ||
144 | MAX8925_REG_DEVS(LDO7), | ||
145 | MAX8925_REG_DEVS(LDO8), | ||
146 | MAX8925_REG_DEVS(LDO9), | ||
147 | MAX8925_REG_DEVS(LDO10), | ||
148 | MAX8925_REG_DEVS(LDO11), | ||
149 | MAX8925_REG_DEVS(LDO12), | ||
150 | MAX8925_REG_DEVS(LDO13), | ||
151 | MAX8925_REG_DEVS(LDO14), | ||
152 | MAX8925_REG_DEVS(LDO15), | ||
153 | MAX8925_REG_DEVS(LDO16), | ||
154 | MAX8925_REG_DEVS(LDO17), | ||
155 | MAX8925_REG_DEVS(LDO18), | ||
156 | MAX8925_REG_DEVS(LDO19), | ||
157 | MAX8925_REG_DEVS(LDO20), | ||
158 | }; | ||
159 | |||
160 | enum { | ||
161 | FLAGS_ADC = 1, /* register in ADC component */ | ||
162 | FLAGS_RTC, /* register in RTC component */ | ||
163 | }; | ||
164 | |||
165 | struct max8925_irq_data { | ||
166 | int reg; | ||
167 | int mask_reg; | ||
168 | int enable; /* enable or not */ | ||
169 | int offs; /* bit offset in mask register */ | ||
170 | int flags; | ||
171 | int tsc_irq; | ||
172 | }; | ||
173 | |||
174 | static struct max8925_irq_data max8925_irqs[] = { | ||
175 | [MAX8925_IRQ_VCHG_DC_OVP] = { | ||
176 | .reg = MAX8925_CHG_IRQ1, | ||
177 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
178 | .offs = 1 << 0, | ||
179 | }, | ||
180 | [MAX8925_IRQ_VCHG_DC_F] = { | ||
181 | .reg = MAX8925_CHG_IRQ1, | ||
182 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
183 | .offs = 1 << 1, | ||
184 | }, | ||
185 | [MAX8925_IRQ_VCHG_DC_R] = { | ||
186 | .reg = MAX8925_CHG_IRQ1, | ||
187 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
188 | .offs = 1 << 2, | ||
189 | }, | ||
190 | [MAX8925_IRQ_VCHG_USB_OVP] = { | ||
191 | .reg = MAX8925_CHG_IRQ1, | ||
192 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
193 | .offs = 1 << 3, | ||
194 | }, | ||
195 | [MAX8925_IRQ_VCHG_USB_F] = { | ||
196 | .reg = MAX8925_CHG_IRQ1, | ||
197 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
198 | .offs = 1 << 4, | ||
199 | }, | ||
200 | [MAX8925_IRQ_VCHG_USB_R] = { | ||
201 | .reg = MAX8925_CHG_IRQ1, | ||
202 | .mask_reg = MAX8925_CHG_IRQ1_MASK, | ||
203 | .offs = 1 << 5, | ||
204 | }, | ||
205 | [MAX8925_IRQ_VCHG_THM_OK_R] = { | ||
206 | .reg = MAX8925_CHG_IRQ2, | ||
207 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
208 | .offs = 1 << 0, | ||
209 | }, | ||
210 | [MAX8925_IRQ_VCHG_THM_OK_F] = { | ||
211 | .reg = MAX8925_CHG_IRQ2, | ||
212 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
213 | .offs = 1 << 1, | ||
214 | }, | ||
215 | [MAX8925_IRQ_VCHG_SYSLOW_F] = { | ||
216 | .reg = MAX8925_CHG_IRQ2, | ||
217 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
218 | .offs = 1 << 2, | ||
219 | }, | ||
220 | [MAX8925_IRQ_VCHG_SYSLOW_R] = { | ||
221 | .reg = MAX8925_CHG_IRQ2, | ||
222 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
223 | .offs = 1 << 3, | ||
224 | }, | ||
225 | [MAX8925_IRQ_VCHG_RST] = { | ||
226 | .reg = MAX8925_CHG_IRQ2, | ||
227 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
228 | .offs = 1 << 4, | ||
229 | }, | ||
230 | [MAX8925_IRQ_VCHG_DONE] = { | ||
231 | .reg = MAX8925_CHG_IRQ2, | ||
232 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
233 | .offs = 1 << 5, | ||
234 | }, | ||
235 | [MAX8925_IRQ_VCHG_TOPOFF] = { | ||
236 | .reg = MAX8925_CHG_IRQ2, | ||
237 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
238 | .offs = 1 << 6, | ||
239 | }, | ||
240 | [MAX8925_IRQ_VCHG_TMR_FAULT] = { | ||
241 | .reg = MAX8925_CHG_IRQ2, | ||
242 | .mask_reg = MAX8925_CHG_IRQ2_MASK, | ||
243 | .offs = 1 << 7, | ||
244 | }, | ||
245 | [MAX8925_IRQ_GPM_RSTIN] = { | ||
246 | .reg = MAX8925_ON_OFF_IRQ1, | ||
247 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
248 | .offs = 1 << 0, | ||
249 | }, | ||
250 | [MAX8925_IRQ_GPM_MPL] = { | ||
251 | .reg = MAX8925_ON_OFF_IRQ1, | ||
252 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
253 | .offs = 1 << 1, | ||
254 | }, | ||
255 | [MAX8925_IRQ_GPM_SW_3SEC] = { | ||
256 | .reg = MAX8925_ON_OFF_IRQ1, | ||
257 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
258 | .offs = 1 << 2, | ||
259 | }, | ||
260 | [MAX8925_IRQ_GPM_EXTON_F] = { | ||
261 | .reg = MAX8925_ON_OFF_IRQ1, | ||
262 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
263 | .offs = 1 << 3, | ||
264 | }, | ||
265 | [MAX8925_IRQ_GPM_EXTON_R] = { | ||
266 | .reg = MAX8925_ON_OFF_IRQ1, | ||
267 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
268 | .offs = 1 << 4, | ||
269 | }, | ||
270 | [MAX8925_IRQ_GPM_SW_1SEC] = { | ||
271 | .reg = MAX8925_ON_OFF_IRQ1, | ||
272 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
273 | .offs = 1 << 5, | ||
274 | }, | ||
275 | [MAX8925_IRQ_GPM_SW_F] = { | ||
276 | .reg = MAX8925_ON_OFF_IRQ1, | ||
277 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
278 | .offs = 1 << 6, | ||
279 | }, | ||
280 | [MAX8925_IRQ_GPM_SW_R] = { | ||
281 | .reg = MAX8925_ON_OFF_IRQ1, | ||
282 | .mask_reg = MAX8925_ON_OFF_IRQ1_MASK, | ||
283 | .offs = 1 << 7, | ||
284 | }, | ||
285 | [MAX8925_IRQ_GPM_SYSCKEN_F] = { | ||
286 | .reg = MAX8925_ON_OFF_IRQ2, | ||
287 | .mask_reg = MAX8925_ON_OFF_IRQ2_MASK, | ||
288 | .offs = 1 << 0, | ||
289 | }, | ||
290 | [MAX8925_IRQ_GPM_SYSCKEN_R] = { | ||
291 | .reg = MAX8925_ON_OFF_IRQ2, | ||
292 | .mask_reg = MAX8925_ON_OFF_IRQ2_MASK, | ||
293 | .offs = 1 << 1, | ||
294 | }, | ||
295 | [MAX8925_IRQ_RTC_ALARM1] = { | ||
296 | .reg = MAX8925_RTC_IRQ, | ||
297 | .mask_reg = MAX8925_RTC_IRQ_MASK, | ||
298 | .offs = 1 << 2, | ||
299 | .flags = FLAGS_RTC, | ||
300 | }, | ||
301 | [MAX8925_IRQ_RTC_ALARM0] = { | ||
302 | .reg = MAX8925_RTC_IRQ, | ||
303 | .mask_reg = MAX8925_RTC_IRQ_MASK, | ||
304 | .offs = 1 << 3, | ||
305 | .flags = FLAGS_RTC, | ||
306 | }, | ||
307 | [MAX8925_IRQ_TSC_STICK] = { | ||
308 | .reg = MAX8925_TSC_IRQ, | ||
309 | .mask_reg = MAX8925_TSC_IRQ_MASK, | ||
310 | .offs = 1 << 0, | ||
311 | .flags = FLAGS_ADC, | ||
312 | .tsc_irq = 1, | ||
313 | }, | ||
314 | [MAX8925_IRQ_TSC_NSTICK] = { | ||
315 | .reg = MAX8925_TSC_IRQ, | ||
316 | .mask_reg = MAX8925_TSC_IRQ_MASK, | ||
317 | .offs = 1 << 1, | ||
318 | .flags = FLAGS_ADC, | ||
319 | .tsc_irq = 1, | ||
320 | }, | ||
321 | }; | ||
322 | |||
323 | static inline struct max8925_irq_data *irq_to_max8925(struct max8925_chip *chip, | ||
324 | int irq) | ||
325 | { | ||
326 | return &max8925_irqs[irq - chip->irq_base]; | ||
327 | } | ||
328 | |||
329 | static irqreturn_t max8925_irq(int irq, void *data) | ||
330 | { | ||
331 | struct max8925_chip *chip = data; | ||
332 | struct max8925_irq_data *irq_data; | ||
333 | struct i2c_client *i2c; | ||
334 | int read_reg = -1, value = 0; | ||
335 | int i; | ||
336 | |||
337 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | ||
338 | irq_data = &max8925_irqs[i]; | ||
339 | /* TSC IRQ should be serviced in max8925_tsc_irq() */ | ||
340 | if (irq_data->tsc_irq) | ||
341 | continue; | ||
342 | if (irq_data->flags == FLAGS_RTC) | ||
343 | i2c = chip->rtc; | ||
344 | else if (irq_data->flags == FLAGS_ADC) | ||
345 | i2c = chip->adc; | ||
346 | else | ||
347 | i2c = chip->i2c; | ||
348 | if (read_reg != irq_data->reg) { | ||
349 | read_reg = irq_data->reg; | ||
350 | value = max8925_reg_read(i2c, irq_data->reg); | ||
351 | } | ||
352 | if (value & irq_data->enable) | ||
353 | handle_nested_irq(chip->irq_base + i); | ||
354 | } | ||
355 | return IRQ_HANDLED; | ||
356 | } | ||
357 | |||
358 | static irqreturn_t max8925_tsc_irq(int irq, void *data) | ||
359 | { | ||
360 | struct max8925_chip *chip = data; | ||
361 | struct max8925_irq_data *irq_data; | ||
362 | struct i2c_client *i2c; | ||
363 | int read_reg = -1, value = 0; | ||
364 | int i; | ||
365 | |||
366 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | ||
367 | irq_data = &max8925_irqs[i]; | ||
368 | /* non TSC IRQ should be serviced in max8925_irq() */ | ||
369 | if (!irq_data->tsc_irq) | ||
370 | continue; | ||
371 | if (irq_data->flags == FLAGS_RTC) | ||
372 | i2c = chip->rtc; | ||
373 | else if (irq_data->flags == FLAGS_ADC) | ||
374 | i2c = chip->adc; | ||
375 | else | ||
376 | i2c = chip->i2c; | ||
377 | if (read_reg != irq_data->reg) { | ||
378 | read_reg = irq_data->reg; | ||
379 | value = max8925_reg_read(i2c, irq_data->reg); | ||
380 | } | ||
381 | if (value & irq_data->enable) | ||
382 | handle_nested_irq(chip->irq_base + i); | ||
383 | } | ||
384 | return IRQ_HANDLED; | ||
385 | } | ||
386 | |||
387 | static void max8925_irq_lock(unsigned int irq) | ||
388 | { | ||
389 | struct max8925_chip *chip = get_irq_chip_data(irq); | ||
390 | |||
391 | mutex_lock(&chip->irq_lock); | ||
392 | } | ||
393 | |||
394 | static void max8925_irq_sync_unlock(unsigned int irq) | ||
395 | { | ||
396 | struct max8925_chip *chip = get_irq_chip_data(irq); | ||
397 | struct max8925_irq_data *irq_data; | ||
398 | static unsigned char cache_chg[2] = {0xff, 0xff}; | ||
399 | static unsigned char cache_on[2] = {0xff, 0xff}; | ||
400 | static unsigned char cache_rtc = 0xff, cache_tsc = 0xff; | ||
401 | unsigned char irq_chg[2], irq_on[2]; | ||
402 | unsigned char irq_rtc, irq_tsc; | ||
403 | int i; | ||
404 | |||
405 | /* Load cached value. In initial, all IRQs are masked */ | ||
406 | irq_chg[0] = cache_chg[0]; | ||
407 | irq_chg[1] = cache_chg[1]; | ||
408 | irq_on[0] = cache_on[0]; | ||
409 | irq_on[1] = cache_on[1]; | ||
410 | irq_rtc = cache_rtc; | ||
411 | irq_tsc = cache_tsc; | ||
412 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | ||
413 | irq_data = &max8925_irqs[i]; | ||
414 | switch (irq_data->mask_reg) { | ||
415 | case MAX8925_CHG_IRQ1_MASK: | ||
416 | irq_chg[0] &= irq_data->enable; | ||
417 | break; | ||
418 | case MAX8925_CHG_IRQ2_MASK: | ||
419 | irq_chg[1] &= irq_data->enable; | ||
420 | break; | ||
421 | case MAX8925_ON_OFF_IRQ1_MASK: | ||
422 | irq_on[0] &= irq_data->enable; | ||
423 | break; | ||
424 | case MAX8925_ON_OFF_IRQ2_MASK: | ||
425 | irq_on[1] &= irq_data->enable; | ||
426 | break; | ||
427 | case MAX8925_RTC_IRQ_MASK: | ||
428 | irq_rtc &= irq_data->enable; | ||
429 | break; | ||
430 | case MAX8925_TSC_IRQ_MASK: | ||
431 | irq_tsc &= irq_data->enable; | ||
432 | break; | ||
433 | default: | ||
434 | dev_err(chip->dev, "wrong IRQ\n"); | ||
435 | break; | ||
436 | } | ||
437 | } | ||
438 | /* update mask into registers */ | ||
439 | if (cache_chg[0] != irq_chg[0]) { | ||
440 | cache_chg[0] = irq_chg[0]; | ||
441 | max8925_reg_write(chip->i2c, MAX8925_CHG_IRQ1_MASK, | ||
442 | irq_chg[0]); | ||
443 | } | ||
444 | if (cache_chg[1] != irq_chg[1]) { | ||
445 | cache_chg[1] = irq_chg[1]; | ||
446 | max8925_reg_write(chip->i2c, MAX8925_CHG_IRQ2_MASK, | ||
447 | irq_chg[1]); | ||
448 | } | ||
449 | if (cache_on[0] != irq_on[0]) { | ||
450 | cache_on[0] = irq_on[0]; | ||
451 | max8925_reg_write(chip->i2c, MAX8925_ON_OFF_IRQ1_MASK, | ||
452 | irq_on[0]); | ||
453 | } | ||
454 | if (cache_on[1] != irq_on[1]) { | ||
455 | cache_on[1] = irq_on[1]; | ||
456 | max8925_reg_write(chip->i2c, MAX8925_ON_OFF_IRQ2_MASK, | ||
457 | irq_on[1]); | ||
458 | } | ||
459 | if (cache_rtc != irq_rtc) { | ||
460 | cache_rtc = irq_rtc; | ||
461 | max8925_reg_write(chip->rtc, MAX8925_RTC_IRQ_MASK, irq_rtc); | ||
462 | } | ||
463 | if (cache_tsc != irq_tsc) { | ||
464 | cache_tsc = irq_tsc; | ||
465 | max8925_reg_write(chip->adc, MAX8925_TSC_IRQ_MASK, irq_tsc); | ||
466 | } | ||
467 | |||
468 | mutex_unlock(&chip->irq_lock); | ||
469 | } | ||
470 | |||
471 | static void max8925_irq_enable(unsigned int irq) | ||
472 | { | ||
473 | struct max8925_chip *chip = get_irq_chip_data(irq); | ||
474 | max8925_irqs[irq - chip->irq_base].enable | ||
475 | = max8925_irqs[irq - chip->irq_base].offs; | ||
476 | } | ||
477 | |||
478 | static void max8925_irq_disable(unsigned int irq) | ||
479 | { | ||
480 | struct max8925_chip *chip = get_irq_chip_data(irq); | ||
481 | max8925_irqs[irq - chip->irq_base].enable = 0; | ||
482 | } | ||
483 | |||
484 | static struct irq_chip max8925_irq_chip = { | ||
485 | .name = "max8925", | ||
486 | .bus_lock = max8925_irq_lock, | ||
487 | .bus_sync_unlock = max8925_irq_sync_unlock, | ||
488 | .enable = max8925_irq_enable, | ||
489 | .disable = max8925_irq_disable, | ||
490 | }; | ||
491 | |||
492 | static int max8925_irq_init(struct max8925_chip *chip, int irq, | ||
493 | struct max8925_platform_data *pdata) | ||
494 | { | ||
495 | unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; | ||
496 | struct irq_desc *desc; | ||
497 | int i, ret; | ||
498 | int __irq; | ||
499 | |||
500 | if (!pdata || !pdata->irq_base) { | ||
501 | dev_warn(chip->dev, "No interrupt support on IRQ base\n"); | ||
502 | return -EINVAL; | ||
503 | } | ||
504 | /* clear all interrupts */ | ||
505 | max8925_reg_read(chip->i2c, MAX8925_CHG_IRQ1); | ||
506 | max8925_reg_read(chip->i2c, MAX8925_CHG_IRQ2); | ||
507 | max8925_reg_read(chip->i2c, MAX8925_ON_OFF_IRQ1); | ||
508 | max8925_reg_read(chip->i2c, MAX8925_ON_OFF_IRQ2); | ||
509 | max8925_reg_read(chip->rtc, MAX8925_RTC_IRQ); | ||
510 | max8925_reg_read(chip->adc, MAX8925_TSC_IRQ); | ||
511 | /* mask all interrupts */ | ||
512 | max8925_reg_write(chip->rtc, MAX8925_ALARM0_CNTL, 0); | ||
513 | max8925_reg_write(chip->rtc, MAX8925_ALARM1_CNTL, 0); | ||
514 | max8925_reg_write(chip->i2c, MAX8925_CHG_IRQ1_MASK, 0xff); | ||
515 | max8925_reg_write(chip->i2c, MAX8925_CHG_IRQ2_MASK, 0xff); | ||
516 | max8925_reg_write(chip->i2c, MAX8925_ON_OFF_IRQ1_MASK, 0xff); | ||
517 | max8925_reg_write(chip->i2c, MAX8925_ON_OFF_IRQ2_MASK, 0xff); | ||
518 | max8925_reg_write(chip->rtc, MAX8925_RTC_IRQ_MASK, 0xff); | ||
519 | max8925_reg_write(chip->adc, MAX8925_TSC_IRQ_MASK, 0xff); | ||
520 | |||
521 | mutex_init(&chip->irq_lock); | ||
522 | chip->core_irq = irq; | ||
523 | chip->irq_base = pdata->irq_base; | ||
524 | desc = irq_to_desc(chip->core_irq); | ||
525 | |||
526 | /* register with genirq */ | ||
527 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | ||
528 | __irq = i + chip->irq_base; | ||
529 | set_irq_chip_data(__irq, chip); | ||
530 | set_irq_chip_and_handler(__irq, &max8925_irq_chip, | ||
531 | handle_edge_irq); | ||
532 | set_irq_nested_thread(__irq, 1); | ||
533 | #ifdef CONFIG_ARM | ||
534 | set_irq_flags(__irq, IRQF_VALID); | ||
535 | #else | ||
536 | set_irq_noprobe(__irq); | ||
537 | #endif | ||
538 | } | ||
539 | if (!irq) { | ||
540 | dev_warn(chip->dev, "No interrupt support on core IRQ\n"); | ||
541 | goto tsc_irq; | ||
542 | } | ||
543 | |||
544 | ret = request_threaded_irq(irq, NULL, max8925_irq, flags, | ||
545 | "max8925", chip); | ||
546 | if (ret) { | ||
547 | dev_err(chip->dev, "Failed to request core IRQ: %d\n", ret); | ||
548 | chip->core_irq = 0; | ||
549 | } | ||
550 | tsc_irq: | ||
551 | if (!pdata->tsc_irq) { | ||
552 | dev_warn(chip->dev, "No interrupt support on TSC IRQ\n"); | ||
553 | return 0; | ||
554 | } | ||
555 | chip->tsc_irq = pdata->tsc_irq; | ||
556 | |||
557 | ret = request_threaded_irq(chip->tsc_irq, NULL, max8925_tsc_irq, | ||
558 | flags, "max8925-tsc", chip); | ||
559 | if (ret) { | ||
560 | dev_err(chip->dev, "Failed to request TSC IRQ: %d\n", ret); | ||
561 | chip->tsc_irq = 0; | ||
562 | } | ||
563 | return 0; | ||
564 | } | ||
565 | |||
566 | int __devinit max8925_device_init(struct max8925_chip *chip, | ||
567 | struct max8925_platform_data *pdata) | ||
568 | { | ||
569 | int ret; | ||
570 | |||
571 | max8925_irq_init(chip, chip->i2c->irq, pdata); | ||
572 | |||
573 | if (pdata && (pdata->power || pdata->touch)) { | ||
574 | /* enable ADC to control internal reference */ | ||
575 | max8925_set_bits(chip->i2c, MAX8925_RESET_CNFG, 1, 1); | ||
576 | /* enable internal reference for ADC */ | ||
577 | max8925_set_bits(chip->adc, MAX8925_TSC_CNFG1, 3, 2); | ||
578 | /* check for internal reference IRQ */ | ||
579 | do { | ||
580 | ret = max8925_reg_read(chip->adc, MAX8925_TSC_IRQ); | ||
581 | } while (ret & MAX8925_NREF_OK); | ||
582 | /* enaable ADC scheduler, interval is 1 second */ | ||
583 | max8925_set_bits(chip->adc, MAX8925_ADC_SCHED, 3, 2); | ||
584 | } | ||
585 | |||
586 | /* enable Momentary Power Loss */ | ||
587 | max8925_set_bits(chip->rtc, MAX8925_MPL_CNTL, 1 << 4, 1 << 4); | ||
588 | |||
589 | ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], | ||
590 | ARRAY_SIZE(rtc_devs), | ||
591 | &rtc_resources[0], 0); | ||
592 | if (ret < 0) { | ||
593 | dev_err(chip->dev, "Failed to add rtc subdev\n"); | ||
594 | goto out; | ||
595 | } | ||
596 | if (pdata && pdata->regulator[0]) { | ||
597 | ret = mfd_add_devices(chip->dev, 0, ®ulator_devs[0], | ||
598 | ARRAY_SIZE(regulator_devs), | ||
599 | ®ulator_resources[0], 0); | ||
600 | if (ret < 0) { | ||
601 | dev_err(chip->dev, "Failed to add regulator subdev\n"); | ||
602 | goto out_dev; | ||
603 | } | ||
604 | } | ||
605 | |||
606 | if (pdata && pdata->backlight) { | ||
607 | ret = mfd_add_devices(chip->dev, 0, &backlight_devs[0], | ||
608 | ARRAY_SIZE(backlight_devs), | ||
609 | &backlight_resources[0], 0); | ||
610 | if (ret < 0) { | ||
611 | dev_err(chip->dev, "Failed to add backlight subdev\n"); | ||
612 | goto out_dev; | ||
613 | } | ||
614 | } | ||
615 | |||
616 | if (pdata && pdata->power) { | ||
617 | ret = mfd_add_devices(chip->dev, 0, &power_devs[0], | ||
618 | ARRAY_SIZE(power_devs), | ||
619 | &power_supply_resources[0], 0); | ||
620 | if (ret < 0) { | ||
621 | dev_err(chip->dev, "Failed to add power supply " | ||
622 | "subdev\n"); | ||
623 | goto out_dev; | ||
624 | } | ||
625 | } | ||
626 | |||
627 | if (pdata && pdata->touch) { | ||
628 | ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], | ||
629 | ARRAY_SIZE(touch_devs), | ||
630 | &touch_resources[0], 0); | ||
631 | if (ret < 0) { | ||
632 | dev_err(chip->dev, "Failed to add touch subdev\n"); | ||
633 | goto out_dev; | ||
634 | } | ||
635 | } | ||
636 | |||
637 | return 0; | ||
638 | out_dev: | ||
639 | mfd_remove_devices(chip->dev); | ||
640 | out: | ||
641 | return ret; | ||
642 | } | ||
643 | |||
644 | void __devexit max8925_device_exit(struct max8925_chip *chip) | ||
645 | { | ||
646 | if (chip->core_irq) | ||
647 | free_irq(chip->core_irq, chip); | ||
648 | if (chip->tsc_irq) | ||
649 | free_irq(chip->tsc_irq, chip); | ||
650 | mfd_remove_devices(chip->dev); | ||
651 | } | ||
652 | |||
653 | |||
654 | MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925"); | ||
655 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com"); | ||
656 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c new file mode 100644 index 000000000000..c0b883c14f41 --- /dev/null +++ b/drivers/mfd/max8925-i2c.c | |||
@@ -0,0 +1,211 @@ | |||
1 | /* | ||
2 | * I2C driver for Maxim MAX8925 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/mfd/max8925.h> | ||
16 | |||
17 | #define RTC_I2C_ADDR 0x68 | ||
18 | #define ADC_I2C_ADDR 0x47 | ||
19 | |||
20 | static inline int max8925_read_device(struct i2c_client *i2c, | ||
21 | int reg, int bytes, void *dest) | ||
22 | { | ||
23 | int ret; | ||
24 | |||
25 | if (bytes > 1) | ||
26 | ret = i2c_smbus_read_i2c_block_data(i2c, reg, bytes, dest); | ||
27 | else { | ||
28 | ret = i2c_smbus_read_byte_data(i2c, reg); | ||
29 | if (ret < 0) | ||
30 | return ret; | ||
31 | *(unsigned char *)dest = (unsigned char)ret; | ||
32 | } | ||
33 | return ret; | ||
34 | } | ||
35 | |||
36 | static inline int max8925_write_device(struct i2c_client *i2c, | ||
37 | int reg, int bytes, void *src) | ||
38 | { | ||
39 | unsigned char buf[bytes + 1]; | ||
40 | int ret; | ||
41 | |||
42 | buf[0] = (unsigned char)reg; | ||
43 | memcpy(&buf[1], src, bytes); | ||
44 | |||
45 | ret = i2c_master_send(i2c, buf, bytes + 1); | ||
46 | if (ret < 0) | ||
47 | return ret; | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | int max8925_reg_read(struct i2c_client *i2c, int reg) | ||
52 | { | ||
53 | struct max8925_chip *chip = i2c_get_clientdata(i2c); | ||
54 | unsigned char data = 0; | ||
55 | int ret; | ||
56 | |||
57 | mutex_lock(&chip->io_lock); | ||
58 | ret = max8925_read_device(i2c, reg, 1, &data); | ||
59 | mutex_unlock(&chip->io_lock); | ||
60 | |||
61 | if (ret < 0) | ||
62 | return ret; | ||
63 | else | ||
64 | return (int)data; | ||
65 | } | ||
66 | EXPORT_SYMBOL(max8925_reg_read); | ||
67 | |||
68 | int max8925_reg_write(struct i2c_client *i2c, int reg, | ||
69 | unsigned char data) | ||
70 | { | ||
71 | struct max8925_chip *chip = i2c_get_clientdata(i2c); | ||
72 | int ret; | ||
73 | |||
74 | mutex_lock(&chip->io_lock); | ||
75 | ret = max8925_write_device(i2c, reg, 1, &data); | ||
76 | mutex_unlock(&chip->io_lock); | ||
77 | |||
78 | return ret; | ||
79 | } | ||
80 | EXPORT_SYMBOL(max8925_reg_write); | ||
81 | |||
82 | int max8925_bulk_read(struct i2c_client *i2c, int reg, | ||
83 | int count, unsigned char *buf) | ||
84 | { | ||
85 | struct max8925_chip *chip = i2c_get_clientdata(i2c); | ||
86 | int ret; | ||
87 | |||
88 | mutex_lock(&chip->io_lock); | ||
89 | ret = max8925_read_device(i2c, reg, count, buf); | ||
90 | mutex_unlock(&chip->io_lock); | ||
91 | |||
92 | return ret; | ||
93 | } | ||
94 | EXPORT_SYMBOL(max8925_bulk_read); | ||
95 | |||
96 | int max8925_bulk_write(struct i2c_client *i2c, int reg, | ||
97 | int count, unsigned char *buf) | ||
98 | { | ||
99 | struct max8925_chip *chip = i2c_get_clientdata(i2c); | ||
100 | int ret; | ||
101 | |||
102 | mutex_lock(&chip->io_lock); | ||
103 | ret = max8925_write_device(i2c, reg, count, buf); | ||
104 | mutex_unlock(&chip->io_lock); | ||
105 | |||
106 | return ret; | ||
107 | } | ||
108 | EXPORT_SYMBOL(max8925_bulk_write); | ||
109 | |||
110 | int max8925_set_bits(struct i2c_client *i2c, int reg, | ||
111 | unsigned char mask, unsigned char data) | ||
112 | { | ||
113 | struct max8925_chip *chip = i2c_get_clientdata(i2c); | ||
114 | unsigned char value; | ||
115 | int ret; | ||
116 | |||
117 | mutex_lock(&chip->io_lock); | ||
118 | ret = max8925_read_device(i2c, reg, 1, &value); | ||
119 | if (ret < 0) | ||
120 | goto out; | ||
121 | value &= ~mask; | ||
122 | value |= data; | ||
123 | ret = max8925_write_device(i2c, reg, 1, &value); | ||
124 | out: | ||
125 | mutex_unlock(&chip->io_lock); | ||
126 | return ret; | ||
127 | } | ||
128 | EXPORT_SYMBOL(max8925_set_bits); | ||
129 | |||
130 | |||
131 | static const struct i2c_device_id max8925_id_table[] = { | ||
132 | { "max8925", 0 }, | ||
133 | { }, | ||
134 | }; | ||
135 | MODULE_DEVICE_TABLE(i2c, max8925_id_table); | ||
136 | |||
137 | static int __devinit max8925_probe(struct i2c_client *client, | ||
138 | const struct i2c_device_id *id) | ||
139 | { | ||
140 | struct max8925_platform_data *pdata = client->dev.platform_data; | ||
141 | static struct max8925_chip *chip; | ||
142 | |||
143 | if (!pdata) { | ||
144 | pr_info("%s: platform data is missing\n", __func__); | ||
145 | return -EINVAL; | ||
146 | } | ||
147 | |||
148 | chip = kzalloc(sizeof(struct max8925_chip), GFP_KERNEL); | ||
149 | if (chip == NULL) | ||
150 | return -ENOMEM; | ||
151 | chip->i2c = client; | ||
152 | chip->dev = &client->dev; | ||
153 | i2c_set_clientdata(client, chip); | ||
154 | dev_set_drvdata(chip->dev, chip); | ||
155 | mutex_init(&chip->io_lock); | ||
156 | |||
157 | chip->rtc = i2c_new_dummy(chip->i2c->adapter, RTC_I2C_ADDR); | ||
158 | i2c_set_clientdata(chip->rtc, chip); | ||
159 | |||
160 | chip->adc = i2c_new_dummy(chip->i2c->adapter, ADC_I2C_ADDR); | ||
161 | i2c_set_clientdata(chip->adc, chip); | ||
162 | |||
163 | max8925_device_init(chip, pdata); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | static int __devexit max8925_remove(struct i2c_client *client) | ||
169 | { | ||
170 | struct max8925_chip *chip = i2c_get_clientdata(client); | ||
171 | |||
172 | max8925_device_exit(chip); | ||
173 | i2c_unregister_device(chip->adc); | ||
174 | i2c_unregister_device(chip->rtc); | ||
175 | i2c_set_clientdata(chip->adc, NULL); | ||
176 | i2c_set_clientdata(chip->rtc, NULL); | ||
177 | i2c_set_clientdata(chip->i2c, NULL); | ||
178 | kfree(chip); | ||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static struct i2c_driver max8925_driver = { | ||
183 | .driver = { | ||
184 | .name = "max8925", | ||
185 | .owner = THIS_MODULE, | ||
186 | }, | ||
187 | .probe = max8925_probe, | ||
188 | .remove = __devexit_p(max8925_remove), | ||
189 | .id_table = max8925_id_table, | ||
190 | }; | ||
191 | |||
192 | static int __init max8925_i2c_init(void) | ||
193 | { | ||
194 | int ret; | ||
195 | |||
196 | ret = i2c_add_driver(&max8925_driver); | ||
197 | if (ret != 0) | ||
198 | pr_err("Failed to register MAX8925 I2C driver: %d\n", ret); | ||
199 | return ret; | ||
200 | } | ||
201 | subsys_initcall(max8925_i2c_init); | ||
202 | |||
203 | static void __exit max8925_i2c_exit(void) | ||
204 | { | ||
205 | i2c_del_driver(&max8925_driver); | ||
206 | } | ||
207 | module_exit(max8925_i2c_exit); | ||
208 | |||
209 | MODULE_DESCRIPTION("I2C Driver for Maxim 8925"); | ||
210 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
211 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index ae15e495e20e..aa17f4bddc56 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/acpi.h> | ||
16 | #include <linux/mfd/core.h> | 17 | #include <linux/mfd/core.h> |
17 | 18 | ||
18 | static int mfd_add_device(struct device *parent, int id, | 19 | static int mfd_add_device(struct device *parent, int id, |
@@ -62,6 +63,10 @@ static int mfd_add_device(struct device *parent, int id, | |||
62 | res[r].start = cell->resources[r].start; | 63 | res[r].start = cell->resources[r].start; |
63 | res[r].end = cell->resources[r].end; | 64 | res[r].end = cell->resources[r].end; |
64 | } | 65 | } |
66 | |||
67 | ret = acpi_check_resource_conflict(res); | ||
68 | if (ret) | ||
69 | goto fail_res; | ||
65 | } | 70 | } |
66 | 71 | ||
67 | platform_device_add_resources(pdev, res, cell->num_resources); | 72 | platform_device_add_resources(pdev, res, cell->num_resources); |
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c index 03efae8041ab..468fd366d4da 100644 --- a/drivers/mfd/sh_mobile_sdhi.c +++ b/drivers/mfd/sh_mobile_sdhi.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | 24 | #include <linux/mmc/host.h> | |
25 | #include <linux/mfd/core.h> | 25 | #include <linux/mfd/core.h> |
26 | #include <linux/mfd/tmio.h> | 26 | #include <linux/mfd/tmio.h> |
27 | #include <linux/mfd/sh_mobile_sdhi.h> | 27 | #include <linux/mfd/sh_mobile_sdhi.h> |
@@ -95,9 +95,9 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
95 | 95 | ||
96 | clk_enable(priv->clk); | 96 | clk_enable(priv->clk); |
97 | 97 | ||
98 | /* FIXME: silly const unsigned int hclk */ | 98 | priv->mmc_data.hclk = clk_get_rate(priv->clk); |
99 | *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk); | ||
100 | priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; | 99 | priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; |
100 | priv->mmc_data.capabilities = MMC_CAP_MMC_HIGHSPEED; | ||
101 | 101 | ||
102 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); | 102 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); |
103 | priv->cell_mmc.driver_data = &priv->mmc_data; | 103 | priv->cell_mmc.driver_data = &priv->mmc_data; |
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 0cc5eeff5ee8..dc9ea95c0561 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -1430,7 +1430,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev) | |||
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | sm->regs_claim = request_mem_region(sm->io_res->start, | 1432 | sm->regs_claim = request_mem_region(sm->io_res->start, |
1433 | 0x100, "sm501"); | 1433 | resource_size(sm->io_res), "sm501"); |
1434 | 1434 | ||
1435 | if (sm->regs_claim == NULL) { | 1435 | if (sm->regs_claim == NULL) { |
1436 | dev_err(&dev->dev, "cannot claim registers\n"); | 1436 | dev_err(&dev->dev, "cannot claim registers\n"); |
@@ -1440,8 +1440,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev) | |||
1440 | 1440 | ||
1441 | platform_set_drvdata(dev, sm); | 1441 | platform_set_drvdata(dev, sm); |
1442 | 1442 | ||
1443 | sm->regs = ioremap(sm->io_res->start, | 1443 | sm->regs = ioremap(sm->io_res->start, resource_size(sm->io_res)); |
1444 | (sm->io_res->end - sm->io_res->start) - 1); | ||
1445 | 1444 | ||
1446 | if (sm->regs == NULL) { | 1445 | if (sm->regs == NULL) { |
1447 | dev_err(&dev->dev, "cannot remap registers\n"); | 1446 | dev_err(&dev->dev, "cannot remap registers\n"); |
@@ -1645,7 +1644,7 @@ static int __devinit sm501_pci_probe(struct pci_dev *dev, | |||
1645 | sm->mem_res = &dev->resource[0]; | 1644 | sm->mem_res = &dev->resource[0]; |
1646 | 1645 | ||
1647 | sm->regs_claim = request_mem_region(sm->io_res->start, | 1646 | sm->regs_claim = request_mem_region(sm->io_res->start, |
1648 | 0x100, "sm501"); | 1647 | resource_size(sm->io_res), "sm501"); |
1649 | if (sm->regs_claim == NULL) { | 1648 | if (sm->regs_claim == NULL) { |
1650 | dev_err(&dev->dev, "cannot claim registers\n"); | 1649 | dev_err(&dev->dev, "cannot claim registers\n"); |
1651 | err= -EBUSY; | 1650 | err= -EBUSY; |
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index bcf4687d4af5..26d9176fca91 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c | |||
@@ -360,7 +360,7 @@ static int t7l66xb_probe(struct platform_device *dev) | |||
360 | if (ret) | 360 | if (ret) |
361 | goto err_request_scr; | 361 | goto err_request_scr; |
362 | 362 | ||
363 | t7l66xb->scr = ioremap(rscr->start, rscr->end - rscr->start + 1); | 363 | t7l66xb->scr = ioremap(rscr->start, resource_size(rscr)); |
364 | if (!t7l66xb->scr) { | 364 | if (!t7l66xb->scr) { |
365 | ret = -ENOMEM; | 365 | ret = -ENOMEM; |
366 | goto err_ioremap; | 366 | goto err_ioremap; |
@@ -403,12 +403,12 @@ static int t7l66xb_probe(struct platform_device *dev) | |||
403 | err_ioremap: | 403 | err_ioremap: |
404 | release_resource(&t7l66xb->rscr); | 404 | release_resource(&t7l66xb->rscr); |
405 | err_request_scr: | 405 | err_request_scr: |
406 | kfree(t7l66xb); | ||
407 | clk_put(t7l66xb->clk48m); | 406 | clk_put(t7l66xb->clk48m); |
408 | err_clk48m_get: | 407 | err_clk48m_get: |
409 | clk_put(t7l66xb->clk32k); | 408 | clk_put(t7l66xb->clk32k); |
410 | err_clk32k_get: | 409 | err_clk32k_get: |
411 | err_noirq: | 410 | err_noirq: |
411 | kfree(t7l66xb); | ||
412 | return ret; | 412 | return ret; |
413 | } | 413 | } |
414 | 414 | ||
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index 4bc5a08a2b09..c59e5c5737d0 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c | |||
@@ -647,7 +647,7 @@ static int __devinit tc6393xb_probe(struct platform_device *dev) | |||
647 | if (ret) | 647 | if (ret) |
648 | goto err_request_scr; | 648 | goto err_request_scr; |
649 | 649 | ||
650 | tc6393xb->scr = ioremap(rscr->start, rscr->end - rscr->start + 1); | 650 | tc6393xb->scr = ioremap(rscr->start, resource_size(rscr)); |
651 | if (!tc6393xb->scr) { | 651 | if (!tc6393xb->scr) { |
652 | ret = -ENOMEM; | 652 | ret = -ENOMEM; |
653 | goto err_ioremap; | 653 | goto err_ioremap; |
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 19a930d06241..562cd4935e17 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -58,13 +58,6 @@ | |||
58 | 58 | ||
59 | #define DRIVER_NAME "twl" | 59 | #define DRIVER_NAME "twl" |
60 | 60 | ||
61 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | ||
62 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | ||
63 | #define twl_has_bci() true | ||
64 | #else | ||
65 | #define twl_has_bci() false | ||
66 | #endif | ||
67 | |||
68 | #if defined(CONFIG_KEYBOARD_TWL4030) || defined(CONFIG_KEYBOARD_TWL4030_MODULE) | 61 | #if defined(CONFIG_KEYBOARD_TWL4030) || defined(CONFIG_KEYBOARD_TWL4030_MODULE) |
69 | #define twl_has_keypad() true | 62 | #define twl_has_keypad() true |
70 | #else | 63 | #else |
@@ -130,7 +123,7 @@ | |||
130 | #define TWL_NUM_SLAVES 4 | 123 | #define TWL_NUM_SLAVES 4 |
131 | 124 | ||
132 | #if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \ | 125 | #if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \ |
133 | || defined(CONFIG_INPUT_TWL4030_PWBUTTON_MODULE) | 126 | || defined(CONFIG_INPUT_TWL4030_PWRBUTTON_MODULE) |
134 | #define twl_has_pwrbutton() true | 127 | #define twl_has_pwrbutton() true |
135 | #else | 128 | #else |
136 | #define twl_has_pwrbutton() false | 129 | #define twl_has_pwrbutton() false |
@@ -205,6 +198,7 @@ | |||
205 | /* subchip/slave 3 0x4B - AUDIO */ | 198 | /* subchip/slave 3 0x4B - AUDIO */ |
206 | #define TWL6030_BASEADD_AUDIO 0x0000 | 199 | #define TWL6030_BASEADD_AUDIO 0x0000 |
207 | #define TWL6030_BASEADD_RSV 0x0000 | 200 | #define TWL6030_BASEADD_RSV 0x0000 |
201 | #define TWL6030_BASEADD_ZERO 0x0000 | ||
208 | 202 | ||
209 | /* Few power values */ | 203 | /* Few power values */ |
210 | #define R_CFG_BOOT 0x05 | 204 | #define R_CFG_BOOT 0x05 |
@@ -320,9 +314,11 @@ static struct twl_mapping twl6030_map[] = { | |||
320 | { SUB_CHIP_ID1, TWL6030_BASEADD_CHARGER }, | 314 | { SUB_CHIP_ID1, TWL6030_BASEADD_CHARGER }, |
321 | { SUB_CHIP_ID1, TWL6030_BASEADD_GASGAUGE }, | 315 | { SUB_CHIP_ID1, TWL6030_BASEADD_GASGAUGE }, |
322 | { SUB_CHIP_ID1, TWL6030_BASEADD_PWM }, | 316 | { SUB_CHIP_ID1, TWL6030_BASEADD_PWM }, |
323 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, | 317 | { SUB_CHIP_ID0, TWL6030_BASEADD_ZERO }, |
324 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, | 318 | { SUB_CHIP_ID1, TWL6030_BASEADD_ZERO }, |
325 | 319 | ||
320 | { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO }, | ||
321 | { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO }, | ||
326 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, | 322 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, |
327 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, | 323 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, |
328 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, | 324 | { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, |
@@ -588,18 +584,6 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
588 | struct device *child; | 584 | struct device *child; |
589 | unsigned sub_chip_id; | 585 | unsigned sub_chip_id; |
590 | 586 | ||
591 | if (twl_has_bci() && pdata->bci && | ||
592 | !(features & (TPS_SUBSET | TWL5031))) { | ||
593 | child = add_child(3, "twl4030_bci", | ||
594 | pdata->bci, sizeof(*pdata->bci), | ||
595 | false, | ||
596 | /* irq0 = CHG_PRES, irq1 = BCI */ | ||
597 | pdata->irq_base + BCI_PRES_INTR_OFFSET, | ||
598 | pdata->irq_base + BCI_INTR_OFFSET); | ||
599 | if (IS_ERR(child)) | ||
600 | return PTR_ERR(child); | ||
601 | } | ||
602 | |||
603 | if (twl_has_gpio() && pdata->gpio) { | 587 | if (twl_has_gpio() && pdata->gpio) { |
604 | child = add_child(SUB_CHIP_ID1, "twl4030_gpio", | 588 | child = add_child(SUB_CHIP_ID1, "twl4030_gpio", |
605 | pdata->gpio, sizeof(*pdata->gpio), | 589 | pdata->gpio, sizeof(*pdata->gpio), |
@@ -977,6 +961,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
977 | int status; | 961 | int status; |
978 | unsigned i; | 962 | unsigned i; |
979 | struct twl4030_platform_data *pdata = client->dev.platform_data; | 963 | struct twl4030_platform_data *pdata = client->dev.platform_data; |
964 | u8 temp; | ||
980 | 965 | ||
981 | if (!pdata) { | 966 | if (!pdata) { |
982 | dev_dbg(&client->dev, "no platform data?\n"); | 967 | dev_dbg(&client->dev, "no platform data?\n"); |
@@ -1044,6 +1029,18 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1044 | goto fail; | 1029 | goto fail; |
1045 | } | 1030 | } |
1046 | 1031 | ||
1032 | /* Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface. | ||
1033 | * Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0, | ||
1034 | * SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0. | ||
1035 | */ | ||
1036 | |||
1037 | if (twl_class_is_4030()) { | ||
1038 | twl_i2c_read_u8(TWL4030_MODULE_INTBR, &temp, REG_GPPUPDCTR1); | ||
1039 | temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \ | ||
1040 | I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU); | ||
1041 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); | ||
1042 | } | ||
1043 | |||
1047 | status = add_children(pdata, id->driver_data); | 1044 | status = add_children(pdata, id->driver_data); |
1048 | fail: | 1045 | fail: |
1049 | if (status < 0) | 1046 | if (status < 0) |
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 0815292fdafc..7efa8789a3a2 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c | |||
@@ -405,7 +405,7 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig) | |||
405 | 405 | ||
406 | if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) { | 406 | if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) { |
407 | remap &= ~SLEEP_STATE_MASK; | 407 | remap &= ~SLEEP_STATE_MASK; |
408 | remap |= rconfig->remap_off << SLEEP_STATE_SHIFT; | 408 | remap |= rconfig->remap_sleep << SLEEP_STATE_SHIFT; |
409 | } | 409 | } |
410 | 410 | ||
411 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, | 411 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, |
@@ -461,6 +461,56 @@ out: | |||
461 | return err; | 461 | return err; |
462 | } | 462 | } |
463 | 463 | ||
464 | int twl4030_remove_script(u8 flags) | ||
465 | { | ||
466 | int err = 0; | ||
467 | |||
468 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_1, | ||
469 | R_PROTECT_KEY); | ||
470 | if (err) { | ||
471 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); | ||
472 | return err; | ||
473 | } | ||
474 | |||
475 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_2, | ||
476 | R_PROTECT_KEY); | ||
477 | if (err) { | ||
478 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); | ||
479 | return err; | ||
480 | } | ||
481 | |||
482 | if (flags & TWL4030_WRST_SCRIPT) { | ||
483 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, | ||
484 | R_SEQ_ADD_WARM); | ||
485 | if (err) | ||
486 | return err; | ||
487 | } | ||
488 | if (flags & TWL4030_WAKEUP12_SCRIPT) { | ||
489 | if (err) | ||
490 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, | ||
491 | R_SEQ_ADD_S2A12); | ||
492 | return err; | ||
493 | } | ||
494 | if (flags & TWL4030_WAKEUP3_SCRIPT) { | ||
495 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, | ||
496 | R_SEQ_ADD_S2A3); | ||
497 | if (err) | ||
498 | return err; | ||
499 | } | ||
500 | if (flags & TWL4030_SLEEP_SCRIPT) { | ||
501 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, | ||
502 | R_SEQ_ADD_A2S); | ||
503 | if (err) | ||
504 | return err; | ||
505 | } | ||
506 | |||
507 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY); | ||
508 | if (err) | ||
509 | pr_err("TWL4030 Unable to relock registers\n"); | ||
510 | |||
511 | return err; | ||
512 | } | ||
513 | |||
464 | void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) | 514 | void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) |
465 | { | 515 | { |
466 | int err = 0; | 516 | int err = 0; |
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 252b74188ec2..b281217334eb 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/mfd/ucb1x00.h> | 28 | #include <linux/mfd/ucb1x00.h> |
29 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
30 | #include <linux/semaphore.h> | ||
30 | 31 | ||
31 | #include <mach/dma.h> | 32 | #include <mach/dma.h> |
32 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index 4b2021af1d96..07101e9e1cba 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -321,7 +321,6 @@ EXPORT_SYMBOL_GPL(wm831x_set_bits); | |||
321 | */ | 321 | */ |
322 | int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input) | 322 | int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input) |
323 | { | 323 | { |
324 | int tries = 10; | ||
325 | int ret, src; | 324 | int ret, src; |
326 | 325 | ||
327 | mutex_lock(&wm831x->auxadc_lock); | 326 | mutex_lock(&wm831x->auxadc_lock); |
@@ -349,13 +348,14 @@ int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input) | |||
349 | goto disable; | 348 | goto disable; |
350 | } | 349 | } |
351 | 350 | ||
352 | do { | 351 | /* Ignore the result to allow us to soldier on without IRQ hookup */ |
353 | msleep(1); | 352 | wait_for_completion_timeout(&wm831x->auxadc_done, msecs_to_jiffies(5)); |
354 | 353 | ||
355 | ret = wm831x_reg_read(wm831x, WM831X_AUXADC_CONTROL); | 354 | ret = wm831x_reg_read(wm831x, WM831X_AUXADC_CONTROL); |
356 | if (ret < 0) | 355 | if (ret < 0) { |
357 | ret = WM831X_AUX_CVT_ENA; | 356 | dev_err(wm831x->dev, "AUXADC status read failed: %d\n", ret); |
358 | } while ((ret & WM831X_AUX_CVT_ENA) && --tries); | 357 | goto disable; |
358 | } | ||
359 | 359 | ||
360 | if (ret & WM831X_AUX_CVT_ENA) { | 360 | if (ret & WM831X_AUX_CVT_ENA) { |
361 | dev_err(wm831x->dev, "Timed out reading AUXADC\n"); | 361 | dev_err(wm831x->dev, "Timed out reading AUXADC\n"); |
@@ -390,6 +390,15 @@ out: | |||
390 | } | 390 | } |
391 | EXPORT_SYMBOL_GPL(wm831x_auxadc_read); | 391 | EXPORT_SYMBOL_GPL(wm831x_auxadc_read); |
392 | 392 | ||
393 | static irqreturn_t wm831x_auxadc_irq(int irq, void *irq_data) | ||
394 | { | ||
395 | struct wm831x *wm831x = irq_data; | ||
396 | |||
397 | complete(&wm831x->auxadc_done); | ||
398 | |||
399 | return IRQ_HANDLED; | ||
400 | } | ||
401 | |||
393 | /** | 402 | /** |
394 | * wm831x_auxadc_read_uv: Read a voltage from the WM831x AUXADC | 403 | * wm831x_auxadc_read_uv: Read a voltage from the WM831x AUXADC |
395 | * | 404 | * |
@@ -1411,6 +1420,7 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1411 | mutex_init(&wm831x->io_lock); | 1420 | mutex_init(&wm831x->io_lock); |
1412 | mutex_init(&wm831x->key_lock); | 1421 | mutex_init(&wm831x->key_lock); |
1413 | mutex_init(&wm831x->auxadc_lock); | 1422 | mutex_init(&wm831x->auxadc_lock); |
1423 | init_completion(&wm831x->auxadc_done); | ||
1414 | dev_set_drvdata(wm831x->dev, wm831x); | 1424 | dev_set_drvdata(wm831x->dev, wm831x); |
1415 | 1425 | ||
1416 | ret = wm831x_reg_read(wm831x, WM831X_PARENT_ID); | 1426 | ret = wm831x_reg_read(wm831x, WM831X_PARENT_ID); |
@@ -1449,18 +1459,33 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1449 | case WM8310: | 1459 | case WM8310: |
1450 | parent = WM8310; | 1460 | parent = WM8310; |
1451 | wm831x->num_gpio = 16; | 1461 | wm831x->num_gpio = 16; |
1462 | if (rev > 0) { | ||
1463 | wm831x->has_gpio_ena = 1; | ||
1464 | wm831x->has_cs_sts = 1; | ||
1465 | } | ||
1466 | |||
1452 | dev_info(wm831x->dev, "WM8310 revision %c\n", 'A' + rev); | 1467 | dev_info(wm831x->dev, "WM8310 revision %c\n", 'A' + rev); |
1453 | break; | 1468 | break; |
1454 | 1469 | ||
1455 | case WM8311: | 1470 | case WM8311: |
1456 | parent = WM8311; | 1471 | parent = WM8311; |
1457 | wm831x->num_gpio = 16; | 1472 | wm831x->num_gpio = 16; |
1473 | if (rev > 0) { | ||
1474 | wm831x->has_gpio_ena = 1; | ||
1475 | wm831x->has_cs_sts = 1; | ||
1476 | } | ||
1477 | |||
1458 | dev_info(wm831x->dev, "WM8311 revision %c\n", 'A' + rev); | 1478 | dev_info(wm831x->dev, "WM8311 revision %c\n", 'A' + rev); |
1459 | break; | 1479 | break; |
1460 | 1480 | ||
1461 | case WM8312: | 1481 | case WM8312: |
1462 | parent = WM8312; | 1482 | parent = WM8312; |
1463 | wm831x->num_gpio = 16; | 1483 | wm831x->num_gpio = 16; |
1484 | if (rev > 0) { | ||
1485 | wm831x->has_gpio_ena = 1; | ||
1486 | wm831x->has_cs_sts = 1; | ||
1487 | } | ||
1488 | |||
1464 | dev_info(wm831x->dev, "WM8312 revision %c\n", 'A' + rev); | 1489 | dev_info(wm831x->dev, "WM8312 revision %c\n", 'A' + rev); |
1465 | break; | 1490 | break; |
1466 | 1491 | ||
@@ -1508,6 +1533,16 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1508 | if (ret != 0) | 1533 | if (ret != 0) |
1509 | goto err; | 1534 | goto err; |
1510 | 1535 | ||
1536 | if (wm831x->irq_base) { | ||
1537 | ret = request_threaded_irq(wm831x->irq_base + | ||
1538 | WM831X_IRQ_AUXADC_DATA, | ||
1539 | NULL, wm831x_auxadc_irq, 0, | ||
1540 | "auxadc", wm831x); | ||
1541 | if (ret < 0) | ||
1542 | dev_err(wm831x->dev, "AUXADC IRQ request failed: %d\n", | ||
1543 | ret); | ||
1544 | } | ||
1545 | |||
1511 | /* The core device is up, instantiate the subdevices. */ | 1546 | /* The core device is up, instantiate the subdevices. */ |
1512 | switch (parent) { | 1547 | switch (parent) { |
1513 | case WM8310: | 1548 | case WM8310: |
@@ -1578,6 +1613,8 @@ static void wm831x_device_exit(struct wm831x *wm831x) | |||
1578 | { | 1613 | { |
1579 | wm831x_otp_exit(wm831x); | 1614 | wm831x_otp_exit(wm831x); |
1580 | mfd_remove_devices(wm831x->dev); | 1615 | mfd_remove_devices(wm831x->dev); |
1616 | if (wm831x->irq_base) | ||
1617 | free_irq(wm831x->irq_base + WM831X_IRQ_AUXADC_DATA, wm831x); | ||
1581 | wm831x_irq_exit(wm831x); | 1618 | wm831x_irq_exit(wm831x); |
1582 | kfree(wm831x); | 1619 | kfree(wm831x); |
1583 | } | 1620 | } |
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index 9a970bd68775..bd75807d5302 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c | |||
@@ -339,7 +339,6 @@ EXPORT_SYMBOL_GPL(wm8350_reg_unlock); | |||
339 | int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) | 339 | int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) |
340 | { | 340 | { |
341 | u16 reg, result = 0; | 341 | u16 reg, result = 0; |
342 | int tries = 5; | ||
343 | 342 | ||
344 | if (channel < WM8350_AUXADC_AUX1 || channel > WM8350_AUXADC_TEMP) | 343 | if (channel < WM8350_AUXADC_AUX1 || channel > WM8350_AUXADC_TEMP) |
345 | return -EINVAL; | 344 | return -EINVAL; |
@@ -363,12 +362,13 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) | |||
363 | reg |= 1 << channel | WM8350_AUXADC_POLL; | 362 | reg |= 1 << channel | WM8350_AUXADC_POLL; |
364 | wm8350_reg_write(wm8350, WM8350_DIGITISER_CONTROL_1, reg); | 363 | wm8350_reg_write(wm8350, WM8350_DIGITISER_CONTROL_1, reg); |
365 | 364 | ||
366 | do { | 365 | /* We ignore the result of the completion and just check for a |
367 | schedule_timeout_interruptible(1); | 366 | * conversion result, allowing us to soldier on if the IRQ |
368 | reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1); | 367 | * infrastructure is not set up for the chip. */ |
369 | } while ((reg & WM8350_AUXADC_POLL) && --tries); | 368 | wait_for_completion_timeout(&wm8350->auxadc_done, msecs_to_jiffies(5)); |
370 | 369 | ||
371 | if (!tries) | 370 | reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1); |
371 | if (reg & WM8350_AUXADC_POLL) | ||
372 | dev_err(wm8350->dev, "adc chn %d read timeout\n", channel); | 372 | dev_err(wm8350->dev, "adc chn %d read timeout\n", channel); |
373 | else | 373 | else |
374 | result = wm8350_reg_read(wm8350, | 374 | result = wm8350_reg_read(wm8350, |
@@ -385,6 +385,15 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref) | |||
385 | } | 385 | } |
386 | EXPORT_SYMBOL_GPL(wm8350_read_auxadc); | 386 | EXPORT_SYMBOL_GPL(wm8350_read_auxadc); |
387 | 387 | ||
388 | static irqreturn_t wm8350_auxadc_irq(int irq, void *irq_data) | ||
389 | { | ||
390 | struct wm8350 *wm8350 = irq_data; | ||
391 | |||
392 | complete(&wm8350->auxadc_done); | ||
393 | |||
394 | return IRQ_HANDLED; | ||
395 | } | ||
396 | |||
388 | /* | 397 | /* |
389 | * Cache is always host endian. | 398 | * Cache is always host endian. |
390 | */ | 399 | */ |
@@ -682,11 +691,22 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
682 | } | 691 | } |
683 | 692 | ||
684 | mutex_init(&wm8350->auxadc_mutex); | 693 | mutex_init(&wm8350->auxadc_mutex); |
694 | init_completion(&wm8350->auxadc_done); | ||
685 | 695 | ||
686 | ret = wm8350_irq_init(wm8350, irq, pdata); | 696 | ret = wm8350_irq_init(wm8350, irq, pdata); |
687 | if (ret < 0) | 697 | if (ret < 0) |
688 | goto err; | 698 | goto err; |
689 | 699 | ||
700 | if (wm8350->irq_base) { | ||
701 | ret = request_threaded_irq(wm8350->irq_base + | ||
702 | WM8350_IRQ_AUXADC_DATARDY, | ||
703 | NULL, wm8350_auxadc_irq, 0, | ||
704 | "auxadc", wm8350); | ||
705 | if (ret < 0) | ||
706 | dev_warn(wm8350->dev, | ||
707 | "Failed to request AUXADC IRQ: %d\n", ret); | ||
708 | } | ||
709 | |||
690 | if (pdata && pdata->init) { | 710 | if (pdata && pdata->init) { |
691 | ret = pdata->init(wm8350); | 711 | ret = pdata->init(wm8350); |
692 | if (ret != 0) { | 712 | if (ret != 0) { |
@@ -736,6 +756,9 @@ void wm8350_device_exit(struct wm8350 *wm8350) | |||
736 | platform_device_unregister(wm8350->gpio.pdev); | 756 | platform_device_unregister(wm8350->gpio.pdev); |
737 | platform_device_unregister(wm8350->codec.pdev); | 757 | platform_device_unregister(wm8350->codec.pdev); |
738 | 758 | ||
759 | if (wm8350->irq_base) | ||
760 | free_irq(wm8350->irq_base + WM8350_IRQ_AUXADC_DATARDY, wm8350); | ||
761 | |||
739 | wm8350_irq_exit(wm8350); | 762 | wm8350_irq_exit(wm8350); |
740 | 763 | ||
741 | kfree(wm8350->reg_cache); | 764 | kfree(wm8350->reg_cache); |
diff --git a/drivers/mfd/wm8350-irq.c b/drivers/mfd/wm8350-irq.c index 9025f29e2707..f56c9adf9493 100644 --- a/drivers/mfd/wm8350-irq.c +++ b/drivers/mfd/wm8350-irq.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/bug.h> | 18 | #include <linux/bug.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/workqueue.h> | 21 | #include <linux/irq.h> |
22 | 22 | ||
23 | #include <linux/mfd/wm8350/core.h> | 23 | #include <linux/mfd/wm8350/core.h> |
24 | #include <linux/mfd/wm8350/audio.h> | 24 | #include <linux/mfd/wm8350/audio.h> |
@@ -29,8 +29,6 @@ | |||
29 | #include <linux/mfd/wm8350/supply.h> | 29 | #include <linux/mfd/wm8350/supply.h> |
30 | #include <linux/mfd/wm8350/wdt.h> | 30 | #include <linux/mfd/wm8350/wdt.h> |
31 | 31 | ||
32 | #define WM8350_NUM_IRQ_REGS 7 | ||
33 | |||
34 | #define WM8350_INT_OFFSET_1 0 | 32 | #define WM8350_INT_OFFSET_1 0 |
35 | #define WM8350_INT_OFFSET_2 1 | 33 | #define WM8350_INT_OFFSET_2 1 |
36 | #define WM8350_POWER_UP_INT_OFFSET 2 | 34 | #define WM8350_POWER_UP_INT_OFFSET 2 |
@@ -366,19 +364,10 @@ static struct wm8350_irq_data wm8350_irqs[] = { | |||
366 | }, | 364 | }, |
367 | }; | 365 | }; |
368 | 366 | ||
369 | static void wm8350_irq_call_handler(struct wm8350 *wm8350, int irq) | 367 | static inline struct wm8350_irq_data *irq_to_wm8350_irq(struct wm8350 *wm8350, |
368 | int irq) | ||
370 | { | 369 | { |
371 | mutex_lock(&wm8350->irq_mutex); | 370 | return &wm8350_irqs[irq - wm8350->irq_base]; |
372 | |||
373 | if (wm8350->irq[irq].handler) | ||
374 | wm8350->irq[irq].handler(irq, wm8350->irq[irq].data); | ||
375 | else { | ||
376 | dev_err(wm8350->dev, "irq %d nobody cared. now masked.\n", | ||
377 | irq); | ||
378 | wm8350_mask_irq(wm8350, irq); | ||
379 | } | ||
380 | |||
381 | mutex_unlock(&wm8350->irq_mutex); | ||
382 | } | 371 | } |
383 | 372 | ||
384 | /* | 373 | /* |
@@ -386,7 +375,9 @@ static void wm8350_irq_call_handler(struct wm8350 *wm8350, int irq) | |||
386 | * interrupts are clear on read the IRQ line will be reasserted and | 375 | * interrupts are clear on read the IRQ line will be reasserted and |
387 | * the physical IRQ will be handled again if another interrupt is | 376 | * the physical IRQ will be handled again if another interrupt is |
388 | * asserted while we run - in the normal course of events this is a | 377 | * asserted while we run - in the normal course of events this is a |
389 | * rare occurrence so we save I2C/SPI reads. | 378 | * rare occurrence so we save I2C/SPI reads. We're also assuming that |
379 | * it's rare to get lots of interrupts firing simultaneously so try to | ||
380 | * minimise I/O. | ||
390 | */ | 381 | */ |
391 | static irqreturn_t wm8350_irq(int irq, void *irq_data) | 382 | static irqreturn_t wm8350_irq(int irq, void *irq_data) |
392 | { | 383 | { |
@@ -397,7 +388,6 @@ static irqreturn_t wm8350_irq(int irq, void *irq_data) | |||
397 | struct wm8350_irq_data *data; | 388 | struct wm8350_irq_data *data; |
398 | int i; | 389 | int i; |
399 | 390 | ||
400 | /* TODO: Use block reads to improve performance? */ | ||
401 | level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) | 391 | level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) |
402 | & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); | 392 | & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); |
403 | 393 | ||
@@ -416,93 +406,101 @@ static irqreturn_t wm8350_irq(int irq, void *irq_data) | |||
416 | sub_reg[data->reg] = | 406 | sub_reg[data->reg] = |
417 | wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + | 407 | wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + |
418 | data->reg); | 408 | data->reg); |
419 | sub_reg[data->reg] &= | 409 | sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; |
420 | ~wm8350_reg_read(wm8350, | ||
421 | WM8350_INT_STATUS_1_MASK + | ||
422 | data->reg); | ||
423 | read_done[data->reg] = 1; | 410 | read_done[data->reg] = 1; |
424 | } | 411 | } |
425 | 412 | ||
426 | if (sub_reg[data->reg] & data->mask) | 413 | if (sub_reg[data->reg] & data->mask) |
427 | wm8350_irq_call_handler(wm8350, i); | 414 | handle_nested_irq(wm8350->irq_base + i); |
428 | } | 415 | } |
429 | 416 | ||
430 | return IRQ_HANDLED; | 417 | return IRQ_HANDLED; |
431 | } | 418 | } |
432 | 419 | ||
433 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | 420 | static void wm8350_irq_lock(unsigned int irq) |
434 | irq_handler_t handler, unsigned long flags, | ||
435 | const char *name, void *data) | ||
436 | { | 421 | { |
437 | if (irq < 0 || irq >= WM8350_NUM_IRQ || !handler) | 422 | struct wm8350 *wm8350 = get_irq_chip_data(irq); |
438 | return -EINVAL; | ||
439 | |||
440 | if (wm8350->irq[irq].handler) | ||
441 | return -EBUSY; | ||
442 | |||
443 | mutex_lock(&wm8350->irq_mutex); | ||
444 | wm8350->irq[irq].handler = handler; | ||
445 | wm8350->irq[irq].data = data; | ||
446 | mutex_unlock(&wm8350->irq_mutex); | ||
447 | |||
448 | wm8350_unmask_irq(wm8350, irq); | ||
449 | 423 | ||
450 | return 0; | 424 | mutex_lock(&wm8350->irq_lock); |
451 | } | 425 | } |
452 | EXPORT_SYMBOL_GPL(wm8350_register_irq); | ||
453 | 426 | ||
454 | int wm8350_free_irq(struct wm8350 *wm8350, int irq) | 427 | static void wm8350_irq_sync_unlock(unsigned int irq) |
455 | { | 428 | { |
456 | if (irq < 0 || irq >= WM8350_NUM_IRQ) | 429 | struct wm8350 *wm8350 = get_irq_chip_data(irq); |
457 | return -EINVAL; | 430 | int i; |
458 | 431 | ||
459 | wm8350_mask_irq(wm8350, irq); | 432 | for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { |
433 | /* If there's been a change in the mask write it back | ||
434 | * to the hardware. */ | ||
435 | if (wm8350->irq_masks[i] != | ||
436 | wm8350->reg_cache[WM8350_INT_STATUS_1_MASK + i]) | ||
437 | WARN_ON(wm8350_reg_write(wm8350, | ||
438 | WM8350_INT_STATUS_1_MASK + i, | ||
439 | wm8350->irq_masks[i])); | ||
440 | } | ||
460 | 441 | ||
461 | mutex_lock(&wm8350->irq_mutex); | 442 | mutex_unlock(&wm8350->irq_lock); |
462 | wm8350->irq[irq].handler = NULL; | ||
463 | mutex_unlock(&wm8350->irq_mutex); | ||
464 | return 0; | ||
465 | } | 443 | } |
466 | EXPORT_SYMBOL_GPL(wm8350_free_irq); | ||
467 | 444 | ||
468 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq) | 445 | static void wm8350_irq_enable(unsigned int irq) |
469 | { | 446 | { |
470 | return wm8350_set_bits(wm8350, WM8350_INT_STATUS_1_MASK + | 447 | struct wm8350 *wm8350 = get_irq_chip_data(irq); |
471 | wm8350_irqs[irq].reg, | 448 | struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, irq); |
472 | wm8350_irqs[irq].mask); | 449 | |
450 | wm8350->irq_masks[irq_data->reg] &= ~irq_data->mask; | ||
473 | } | 451 | } |
474 | EXPORT_SYMBOL_GPL(wm8350_mask_irq); | ||
475 | 452 | ||
476 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq) | 453 | static void wm8350_irq_disable(unsigned int irq) |
477 | { | 454 | { |
478 | return wm8350_clear_bits(wm8350, WM8350_INT_STATUS_1_MASK + | 455 | struct wm8350 *wm8350 = get_irq_chip_data(irq); |
479 | wm8350_irqs[irq].reg, | 456 | struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, irq); |
480 | wm8350_irqs[irq].mask); | 457 | |
458 | wm8350->irq_masks[irq_data->reg] |= irq_data->mask; | ||
481 | } | 459 | } |
482 | EXPORT_SYMBOL_GPL(wm8350_unmask_irq); | 460 | |
461 | static struct irq_chip wm8350_irq_chip = { | ||
462 | .name = "wm8350", | ||
463 | .bus_lock = wm8350_irq_lock, | ||
464 | .bus_sync_unlock = wm8350_irq_sync_unlock, | ||
465 | .disable = wm8350_irq_disable, | ||
466 | .enable = wm8350_irq_enable, | ||
467 | }; | ||
483 | 468 | ||
484 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, | 469 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, |
485 | struct wm8350_platform_data *pdata) | 470 | struct wm8350_platform_data *pdata) |
486 | { | 471 | { |
487 | int ret; | 472 | int ret, cur_irq, i; |
488 | int flags = IRQF_ONESHOT; | 473 | int flags = IRQF_ONESHOT; |
489 | 474 | ||
490 | if (!irq) { | 475 | if (!irq) { |
491 | dev_err(wm8350->dev, "No IRQ configured\n"); | 476 | dev_warn(wm8350->dev, "No interrupt support, no core IRQ\n"); |
492 | return -EINVAL; | 477 | return 0; |
478 | } | ||
479 | |||
480 | if (!pdata || !pdata->irq_base) { | ||
481 | dev_warn(wm8350->dev, "No interrupt support, no IRQ base\n"); | ||
482 | return 0; | ||
493 | } | 483 | } |
494 | 484 | ||
485 | /* Mask top level interrupts */ | ||
495 | wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF); | 486 | wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF); |
496 | wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK, 0xFFFF); | ||
497 | wm8350_reg_write(wm8350, WM8350_INT_STATUS_2_MASK, 0xFFFF); | ||
498 | wm8350_reg_write(wm8350, WM8350_UNDER_VOLTAGE_INT_STATUS_MASK, 0xFFFF); | ||
499 | wm8350_reg_write(wm8350, WM8350_GPIO_INT_STATUS_MASK, 0xFFFF); | ||
500 | wm8350_reg_write(wm8350, WM8350_COMPARATOR_INT_STATUS_MASK, 0xFFFF); | ||
501 | 487 | ||
502 | mutex_init(&wm8350->irq_mutex); | 488 | /* Mask all individual interrupts by default and cache the |
489 | * masks. We read the masks back since there are unwritable | ||
490 | * bits in the mask registers. */ | ||
491 | for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { | ||
492 | wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK + i, | ||
493 | 0xFFFF); | ||
494 | wm8350->irq_masks[i] = | ||
495 | wm8350_reg_read(wm8350, | ||
496 | WM8350_INT_STATUS_1_MASK + i); | ||
497 | } | ||
498 | |||
499 | mutex_init(&wm8350->irq_lock); | ||
503 | wm8350->chip_irq = irq; | 500 | wm8350->chip_irq = irq; |
501 | wm8350->irq_base = pdata->irq_base; | ||
504 | 502 | ||
505 | if (pdata && pdata->irq_high) { | 503 | if (pdata->irq_high) { |
506 | flags |= IRQF_TRIGGER_HIGH; | 504 | flags |= IRQF_TRIGGER_HIGH; |
507 | 505 | ||
508 | wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, | 506 | wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, |
@@ -514,11 +512,32 @@ int wm8350_irq_init(struct wm8350 *wm8350, int irq, | |||
514 | WM8350_IRQ_POL); | 512 | WM8350_IRQ_POL); |
515 | } | 513 | } |
516 | 514 | ||
515 | /* Register with genirq */ | ||
516 | for (cur_irq = wm8350->irq_base; | ||
517 | cur_irq < ARRAY_SIZE(wm8350_irqs) + wm8350->irq_base; | ||
518 | cur_irq++) { | ||
519 | set_irq_chip_data(cur_irq, wm8350); | ||
520 | set_irq_chip_and_handler(cur_irq, &wm8350_irq_chip, | ||
521 | handle_edge_irq); | ||
522 | set_irq_nested_thread(cur_irq, 1); | ||
523 | |||
524 | /* ARM needs us to explicitly flag the IRQ as valid | ||
525 | * and will set them noprobe when we do so. */ | ||
526 | #ifdef CONFIG_ARM | ||
527 | set_irq_flags(cur_irq, IRQF_VALID); | ||
528 | #else | ||
529 | set_irq_noprobe(cur_irq); | ||
530 | #endif | ||
531 | } | ||
532 | |||
517 | ret = request_threaded_irq(irq, NULL, wm8350_irq, flags, | 533 | ret = request_threaded_irq(irq, NULL, wm8350_irq, flags, |
518 | "wm8350", wm8350); | 534 | "wm8350", wm8350); |
519 | if (ret != 0) | 535 | if (ret != 0) |
520 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", ret); | 536 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", ret); |
521 | 537 | ||
538 | /* Allow interrupts to fire */ | ||
539 | wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0); | ||
540 | |||
522 | return ret; | 541 | return ret; |
523 | } | 542 | } |
524 | 543 | ||
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c new file mode 100644 index 000000000000..844e1c1b7d90 --- /dev/null +++ b/drivers/mfd/wm8994-core.c | |||
@@ -0,0 +1,537 @@ | |||
1 | /* | ||
2 | * wm8994-core.c -- Device access for Wolfson WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <linux/mfd/core.h> | ||
20 | #include <linux/regulator/consumer.h> | ||
21 | #include <linux/regulator/machine.h> | ||
22 | |||
23 | #include <linux/mfd/wm8994/core.h> | ||
24 | #include <linux/mfd/wm8994/pdata.h> | ||
25 | #include <linux/mfd/wm8994/registers.h> | ||
26 | |||
27 | static int wm8994_read(struct wm8994 *wm8994, unsigned short reg, | ||
28 | int bytes, void *dest) | ||
29 | { | ||
30 | int ret, i; | ||
31 | u16 *buf = dest; | ||
32 | |||
33 | BUG_ON(bytes % 2); | ||
34 | BUG_ON(bytes <= 0); | ||
35 | |||
36 | ret = wm8994->read_dev(wm8994, reg, bytes, dest); | ||
37 | if (ret < 0) | ||
38 | return ret; | ||
39 | |||
40 | for (i = 0; i < bytes / 2; i++) { | ||
41 | buf[i] = be16_to_cpu(buf[i]); | ||
42 | |||
43 | dev_vdbg(wm8994->dev, "Read %04x from R%d(0x%x)\n", | ||
44 | buf[i], reg + i, reg + i); | ||
45 | } | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * wm8994_reg_read: Read a single WM8994 register. | ||
52 | * | ||
53 | * @wm8994: Device to read from. | ||
54 | * @reg: Register to read. | ||
55 | */ | ||
56 | int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg) | ||
57 | { | ||
58 | unsigned short val; | ||
59 | int ret; | ||
60 | |||
61 | mutex_lock(&wm8994->io_lock); | ||
62 | |||
63 | ret = wm8994_read(wm8994, reg, 2, &val); | ||
64 | |||
65 | mutex_unlock(&wm8994->io_lock); | ||
66 | |||
67 | if (ret < 0) | ||
68 | return ret; | ||
69 | else | ||
70 | return val; | ||
71 | } | ||
72 | EXPORT_SYMBOL_GPL(wm8994_reg_read); | ||
73 | |||
74 | /** | ||
75 | * wm8994_bulk_read: Read multiple WM8994 registers | ||
76 | * | ||
77 | * @wm8994: Device to read from | ||
78 | * @reg: First register | ||
79 | * @count: Number of registers | ||
80 | * @buf: Buffer to fill. | ||
81 | */ | ||
82 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, | ||
83 | int count, u16 *buf) | ||
84 | { | ||
85 | int ret; | ||
86 | |||
87 | mutex_lock(&wm8994->io_lock); | ||
88 | |||
89 | ret = wm8994_read(wm8994, reg, count * 2, buf); | ||
90 | |||
91 | mutex_unlock(&wm8994->io_lock); | ||
92 | |||
93 | return ret; | ||
94 | } | ||
95 | EXPORT_SYMBOL_GPL(wm8994_bulk_read); | ||
96 | |||
97 | static int wm8994_write(struct wm8994 *wm8994, unsigned short reg, | ||
98 | int bytes, void *src) | ||
99 | { | ||
100 | u16 *buf = src; | ||
101 | int i; | ||
102 | |||
103 | BUG_ON(bytes % 2); | ||
104 | BUG_ON(bytes <= 0); | ||
105 | |||
106 | for (i = 0; i < bytes / 2; i++) { | ||
107 | dev_vdbg(wm8994->dev, "Write %04x to R%d(0x%x)\n", | ||
108 | buf[i], reg + i, reg + i); | ||
109 | |||
110 | buf[i] = cpu_to_be16(buf[i]); | ||
111 | } | ||
112 | |||
113 | return wm8994->write_dev(wm8994, reg, bytes, src); | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * wm8994_reg_write: Write a single WM8994 register. | ||
118 | * | ||
119 | * @wm8994: Device to write to. | ||
120 | * @reg: Register to write to. | ||
121 | * @val: Value to write. | ||
122 | */ | ||
123 | int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg, | ||
124 | unsigned short val) | ||
125 | { | ||
126 | int ret; | ||
127 | |||
128 | mutex_lock(&wm8994->io_lock); | ||
129 | |||
130 | ret = wm8994_write(wm8994, reg, 2, &val); | ||
131 | |||
132 | mutex_unlock(&wm8994->io_lock); | ||
133 | |||
134 | return ret; | ||
135 | } | ||
136 | EXPORT_SYMBOL_GPL(wm8994_reg_write); | ||
137 | |||
138 | /** | ||
139 | * wm8994_set_bits: Set the value of a bitfield in a WM8994 register | ||
140 | * | ||
141 | * @wm8994: Device to write to. | ||
142 | * @reg: Register to write to. | ||
143 | * @mask: Mask of bits to set. | ||
144 | * @val: Value to set (unshifted) | ||
145 | */ | ||
146 | int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, | ||
147 | unsigned short mask, unsigned short val) | ||
148 | { | ||
149 | int ret; | ||
150 | u16 r; | ||
151 | |||
152 | mutex_lock(&wm8994->io_lock); | ||
153 | |||
154 | ret = wm8994_read(wm8994, reg, 2, &r); | ||
155 | if (ret < 0) | ||
156 | goto out; | ||
157 | |||
158 | r &= ~mask; | ||
159 | r |= val; | ||
160 | |||
161 | ret = wm8994_write(wm8994, reg, 2, &r); | ||
162 | |||
163 | out: | ||
164 | mutex_unlock(&wm8994->io_lock); | ||
165 | |||
166 | return ret; | ||
167 | } | ||
168 | EXPORT_SYMBOL_GPL(wm8994_set_bits); | ||
169 | |||
170 | static struct mfd_cell wm8994_regulator_devs[] = { | ||
171 | { .name = "wm8994-ldo", .id = 1 }, | ||
172 | { .name = "wm8994-ldo", .id = 2 }, | ||
173 | }; | ||
174 | |||
175 | static struct mfd_cell wm8994_devs[] = { | ||
176 | { .name = "wm8994-codec" }, | ||
177 | { .name = "wm8994-gpio" }, | ||
178 | }; | ||
179 | |||
180 | /* | ||
181 | * Supplies for the main bulk of CODEC; the LDO supplies are ignored | ||
182 | * and should be handled via the standard regulator API supply | ||
183 | * management. | ||
184 | */ | ||
185 | static const char *wm8994_main_supplies[] = { | ||
186 | "DBVDD", | ||
187 | "DCVDD", | ||
188 | "AVDD1", | ||
189 | "AVDD2", | ||
190 | "CPVDD", | ||
191 | "SPKVDD1", | ||
192 | "SPKVDD2", | ||
193 | }; | ||
194 | |||
195 | #ifdef CONFIG_PM | ||
196 | static int wm8994_device_suspend(struct device *dev) | ||
197 | { | ||
198 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | ||
199 | int ret; | ||
200 | |||
201 | /* GPIO configuration state is saved here since we may be configuring | ||
202 | * the GPIO alternate functions even if we're not using the gpiolib | ||
203 | * driver for them. | ||
204 | */ | ||
205 | ret = wm8994_read(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2, | ||
206 | &wm8994->gpio_regs); | ||
207 | if (ret < 0) | ||
208 | dev_err(dev, "Failed to save GPIO registers: %d\n", ret); | ||
209 | |||
210 | /* For similar reasons we also stash the regulator states */ | ||
211 | ret = wm8994_read(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2, | ||
212 | &wm8994->ldo_regs); | ||
213 | if (ret < 0) | ||
214 | dev_err(dev, "Failed to save LDO registers: %d\n", ret); | ||
215 | |||
216 | ret = regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), | ||
217 | wm8994->supplies); | ||
218 | if (ret != 0) { | ||
219 | dev_err(dev, "Failed to disable supplies: %d\n", ret); | ||
220 | return ret; | ||
221 | } | ||
222 | |||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | static int wm8994_device_resume(struct device *dev) | ||
227 | { | ||
228 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | ||
229 | int ret; | ||
230 | |||
231 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8994_main_supplies), | ||
232 | wm8994->supplies); | ||
233 | if (ret != 0) { | ||
234 | dev_err(dev, "Failed to enable supplies: %d\n", ret); | ||
235 | return ret; | ||
236 | } | ||
237 | |||
238 | ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2, | ||
239 | &wm8994->ldo_regs); | ||
240 | if (ret < 0) | ||
241 | dev_err(dev, "Failed to restore LDO registers: %d\n", ret); | ||
242 | |||
243 | ret = wm8994_write(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2, | ||
244 | &wm8994->gpio_regs); | ||
245 | if (ret < 0) | ||
246 | dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); | ||
247 | |||
248 | return 0; | ||
249 | } | ||
250 | #endif | ||
251 | |||
252 | #ifdef CONFIG_REGULATOR | ||
253 | static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo) | ||
254 | { | ||
255 | struct wm8994_ldo_pdata *ldo_pdata; | ||
256 | |||
257 | if (!pdata) | ||
258 | return 0; | ||
259 | |||
260 | ldo_pdata = &pdata->ldo[ldo]; | ||
261 | |||
262 | if (!ldo_pdata->init_data) | ||
263 | return 0; | ||
264 | |||
265 | return ldo_pdata->init_data->num_consumer_supplies != 0; | ||
266 | } | ||
267 | #else | ||
268 | static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo) | ||
269 | { | ||
270 | return 0; | ||
271 | } | ||
272 | #endif | ||
273 | |||
274 | /* | ||
275 | * Instantiate the generic non-control parts of the device. | ||
276 | */ | ||
277 | static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) | ||
278 | { | ||
279 | struct wm8994_pdata *pdata = wm8994->dev->platform_data; | ||
280 | int ret, i; | ||
281 | |||
282 | mutex_init(&wm8994->io_lock); | ||
283 | dev_set_drvdata(wm8994->dev, wm8994); | ||
284 | |||
285 | /* Add the on-chip regulators first for bootstrapping */ | ||
286 | ret = mfd_add_devices(wm8994->dev, -1, | ||
287 | wm8994_regulator_devs, | ||
288 | ARRAY_SIZE(wm8994_regulator_devs), | ||
289 | NULL, 0); | ||
290 | if (ret != 0) { | ||
291 | dev_err(wm8994->dev, "Failed to add children: %d\n", ret); | ||
292 | goto err; | ||
293 | } | ||
294 | |||
295 | wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * | ||
296 | ARRAY_SIZE(wm8994_main_supplies), | ||
297 | GFP_KERNEL); | ||
298 | if (!wm8994->supplies) | ||
299 | goto err; | ||
300 | |||
301 | for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++) | ||
302 | wm8994->supplies[i].supply = wm8994_main_supplies[i]; | ||
303 | |||
304 | ret = regulator_bulk_get(wm8994->dev, ARRAY_SIZE(wm8994_main_supplies), | ||
305 | wm8994->supplies); | ||
306 | if (ret != 0) { | ||
307 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); | ||
308 | goto err_supplies; | ||
309 | } | ||
310 | |||
311 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8994_main_supplies), | ||
312 | wm8994->supplies); | ||
313 | if (ret != 0) { | ||
314 | dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); | ||
315 | goto err_get; | ||
316 | } | ||
317 | |||
318 | ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); | ||
319 | if (ret < 0) { | ||
320 | dev_err(wm8994->dev, "Failed to read ID register\n"); | ||
321 | goto err_enable; | ||
322 | } | ||
323 | if (ret != 0x8994) { | ||
324 | dev_err(wm8994->dev, "Device is not a WM8994, ID is %x\n", | ||
325 | ret); | ||
326 | ret = -EINVAL; | ||
327 | goto err_enable; | ||
328 | } | ||
329 | |||
330 | ret = wm8994_reg_read(wm8994, WM8994_CHIP_REVISION); | ||
331 | if (ret < 0) { | ||
332 | dev_err(wm8994->dev, "Failed to read revision register: %d\n", | ||
333 | ret); | ||
334 | goto err_enable; | ||
335 | } | ||
336 | |||
337 | switch (ret) { | ||
338 | case 0: | ||
339 | case 1: | ||
340 | dev_warn(wm8994->dev, "revision %c not fully supported\n", | ||
341 | 'A' + ret); | ||
342 | break; | ||
343 | default: | ||
344 | dev_info(wm8994->dev, "revision %c\n", 'A' + ret); | ||
345 | break; | ||
346 | } | ||
347 | |||
348 | |||
349 | if (pdata) { | ||
350 | wm8994->gpio_base = pdata->gpio_base; | ||
351 | |||
352 | /* GPIO configuration is only applied if it's non-zero */ | ||
353 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) { | ||
354 | if (pdata->gpio_defaults[i]) { | ||
355 | wm8994_set_bits(wm8994, WM8994_GPIO_1 + i, | ||
356 | 0xffff, | ||
357 | pdata->gpio_defaults[i]); | ||
358 | } | ||
359 | } | ||
360 | } | ||
361 | |||
362 | /* In some system designs where the regulators are not in use, | ||
363 | * we can achieve a small reduction in leakage currents by | ||
364 | * floating LDO outputs. This bit makes no difference if the | ||
365 | * LDOs are enabled, it only affects cases where the LDOs were | ||
366 | * in operation and are then disabled. | ||
367 | */ | ||
368 | for (i = 0; i < WM8994_NUM_LDO_REGS; i++) { | ||
369 | if (wm8994_ldo_in_use(pdata, i)) | ||
370 | wm8994_set_bits(wm8994, WM8994_LDO_1 + i, | ||
371 | WM8994_LDO1_DISCH, WM8994_LDO1_DISCH); | ||
372 | else | ||
373 | wm8994_set_bits(wm8994, WM8994_LDO_1 + i, | ||
374 | WM8994_LDO1_DISCH, 0); | ||
375 | } | ||
376 | |||
377 | ret = mfd_add_devices(wm8994->dev, -1, | ||
378 | wm8994_devs, ARRAY_SIZE(wm8994_devs), | ||
379 | NULL, 0); | ||
380 | if (ret != 0) { | ||
381 | dev_err(wm8994->dev, "Failed to add children: %d\n", ret); | ||
382 | goto err_enable; | ||
383 | } | ||
384 | |||
385 | return 0; | ||
386 | |||
387 | err_enable: | ||
388 | regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), | ||
389 | wm8994->supplies); | ||
390 | err_get: | ||
391 | regulator_bulk_free(ARRAY_SIZE(wm8994_main_supplies), wm8994->supplies); | ||
392 | err_supplies: | ||
393 | kfree(wm8994->supplies); | ||
394 | err: | ||
395 | mfd_remove_devices(wm8994->dev); | ||
396 | kfree(wm8994); | ||
397 | return ret; | ||
398 | } | ||
399 | |||
400 | static void wm8994_device_exit(struct wm8994 *wm8994) | ||
401 | { | ||
402 | mfd_remove_devices(wm8994->dev); | ||
403 | regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), | ||
404 | wm8994->supplies); | ||
405 | regulator_bulk_free(ARRAY_SIZE(wm8994_main_supplies), wm8994->supplies); | ||
406 | kfree(wm8994->supplies); | ||
407 | kfree(wm8994); | ||
408 | } | ||
409 | |||
410 | static int wm8994_i2c_read_device(struct wm8994 *wm8994, unsigned short reg, | ||
411 | int bytes, void *dest) | ||
412 | { | ||
413 | struct i2c_client *i2c = wm8994->control_data; | ||
414 | int ret; | ||
415 | u16 r = cpu_to_be16(reg); | ||
416 | |||
417 | ret = i2c_master_send(i2c, (unsigned char *)&r, 2); | ||
418 | if (ret < 0) | ||
419 | return ret; | ||
420 | if (ret != 2) | ||
421 | return -EIO; | ||
422 | |||
423 | ret = i2c_master_recv(i2c, dest, bytes); | ||
424 | if (ret < 0) | ||
425 | return ret; | ||
426 | if (ret != bytes) | ||
427 | return -EIO; | ||
428 | return 0; | ||
429 | } | ||
430 | |||
431 | /* Currently we allocate the write buffer on the stack; this is OK for | ||
432 | * small writes - if we need to do large writes this will need to be | ||
433 | * revised. | ||
434 | */ | ||
435 | static int wm8994_i2c_write_device(struct wm8994 *wm8994, unsigned short reg, | ||
436 | int bytes, void *src) | ||
437 | { | ||
438 | struct i2c_client *i2c = wm8994->control_data; | ||
439 | unsigned char msg[bytes + 2]; | ||
440 | int ret; | ||
441 | |||
442 | reg = cpu_to_be16(reg); | ||
443 | memcpy(&msg[0], ®, 2); | ||
444 | memcpy(&msg[2], src, bytes); | ||
445 | |||
446 | ret = i2c_master_send(i2c, msg, bytes + 2); | ||
447 | if (ret < 0) | ||
448 | return ret; | ||
449 | if (ret < bytes + 2) | ||
450 | return -EIO; | ||
451 | |||
452 | return 0; | ||
453 | } | ||
454 | |||
455 | static int wm8994_i2c_probe(struct i2c_client *i2c, | ||
456 | const struct i2c_device_id *id) | ||
457 | { | ||
458 | struct wm8994 *wm8994; | ||
459 | |||
460 | wm8994 = kzalloc(sizeof(struct wm8994), GFP_KERNEL); | ||
461 | if (wm8994 == NULL) { | ||
462 | kfree(i2c); | ||
463 | return -ENOMEM; | ||
464 | } | ||
465 | |||
466 | i2c_set_clientdata(i2c, wm8994); | ||
467 | wm8994->dev = &i2c->dev; | ||
468 | wm8994->control_data = i2c; | ||
469 | wm8994->read_dev = wm8994_i2c_read_device; | ||
470 | wm8994->write_dev = wm8994_i2c_write_device; | ||
471 | |||
472 | return wm8994_device_init(wm8994, id->driver_data, i2c->irq); | ||
473 | } | ||
474 | |||
475 | static int wm8994_i2c_remove(struct i2c_client *i2c) | ||
476 | { | ||
477 | struct wm8994 *wm8994 = i2c_get_clientdata(i2c); | ||
478 | |||
479 | wm8994_device_exit(wm8994); | ||
480 | |||
481 | return 0; | ||
482 | } | ||
483 | |||
484 | #ifdef CONFIG_PM | ||
485 | static int wm8994_i2c_suspend(struct i2c_client *i2c, pm_message_t state) | ||
486 | { | ||
487 | return wm8994_device_suspend(&i2c->dev); | ||
488 | } | ||
489 | |||
490 | static int wm8994_i2c_resume(struct i2c_client *i2c) | ||
491 | { | ||
492 | return wm8994_device_resume(&i2c->dev); | ||
493 | } | ||
494 | #else | ||
495 | #define wm8994_i2c_suspend NULL | ||
496 | #define wm8994_i2c_resume NULL | ||
497 | #endif | ||
498 | |||
499 | static const struct i2c_device_id wm8994_i2c_id[] = { | ||
500 | { "wm8994", 0 }, | ||
501 | { } | ||
502 | }; | ||
503 | MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id); | ||
504 | |||
505 | static struct i2c_driver wm8994_i2c_driver = { | ||
506 | .driver = { | ||
507 | .name = "wm8994", | ||
508 | .owner = THIS_MODULE, | ||
509 | }, | ||
510 | .probe = wm8994_i2c_probe, | ||
511 | .remove = wm8994_i2c_remove, | ||
512 | .suspend = wm8994_i2c_suspend, | ||
513 | .resume = wm8994_i2c_resume, | ||
514 | .id_table = wm8994_i2c_id, | ||
515 | }; | ||
516 | |||
517 | static int __init wm8994_i2c_init(void) | ||
518 | { | ||
519 | int ret; | ||
520 | |||
521 | ret = i2c_add_driver(&wm8994_i2c_driver); | ||
522 | if (ret != 0) | ||
523 | pr_err("Failed to register wm8994 I2C driver: %d\n", ret); | ||
524 | |||
525 | return ret; | ||
526 | } | ||
527 | module_init(wm8994_i2c_init); | ||
528 | |||
529 | static void __exit wm8994_i2c_exit(void) | ||
530 | { | ||
531 | i2c_del_driver(&wm8994_i2c_driver); | ||
532 | } | ||
533 | module_exit(wm8994_i2c_exit); | ||
534 | |||
535 | MODULE_DESCRIPTION("Core support for the WM8994 audio CODEC"); | ||
536 | MODULE_LICENSE("GPL"); | ||
537 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | ||
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 7b431bbab7f1..2e13b94769fd 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -365,7 +365,7 @@ config MMC_SDRICOH_CS | |||
365 | 365 | ||
366 | config MMC_TMIO | 366 | config MMC_TMIO |
367 | tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support" | 367 | tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support" |
368 | depends on MFD_TMIO || MFD_ASIC3 || SUPERH | 368 | depends on MFD_TMIO || MFD_ASIC3 || MFD_SH_MOBILE_SDHI |
369 | help | 369 | help |
370 | This provides support for the SD/MMC cell found in TC6393XB, | 370 | This provides support for the SD/MMC cell found in TC6393XB, |
371 | T7L66XB and also HTC ASIC3 | 371 | T7L66XB and also HTC ASIC3 |
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index e22c3fa3516a..b2b577f6afd4 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -323,7 +323,7 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid) | |||
323 | if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) { | 323 | if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) { |
324 | ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT | | 324 | ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT | |
325 | TMIO_STAT_CARD_REMOVE); | 325 | TMIO_STAT_CARD_REMOVE); |
326 | mmc_detect_change(host->mmc, 0); | 326 | mmc_detect_change(host->mmc, msecs_to_jiffies(100)); |
327 | } | 327 | } |
328 | 328 | ||
329 | /* CRC and other errors */ | 329 | /* CRC and other errors */ |
@@ -550,6 +550,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev) | |||
550 | 550 | ||
551 | mmc->ops = &tmio_mmc_ops; | 551 | mmc->ops = &tmio_mmc_ops; |
552 | mmc->caps = MMC_CAP_4_BIT_DATA; | 552 | mmc->caps = MMC_CAP_4_BIT_DATA; |
553 | mmc->caps |= pdata->capabilities; | ||
553 | mmc->f_max = pdata->hclk; | 554 | mmc->f_max = pdata->hclk; |
554 | mmc->f_min = mmc->f_max / 512; | 555 | mmc->f_min = mmc->f_max / 512; |
555 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | 556 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
@@ -568,14 +569,14 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev) | |||
568 | if (ret >= 0) | 569 | if (ret >= 0) |
569 | host->irq = ret; | 570 | host->irq = ret; |
570 | else | 571 | else |
571 | goto unmap_ctl; | 572 | goto cell_disable; |
572 | 573 | ||
573 | disable_mmc_irqs(host, TMIO_MASK_ALL); | 574 | disable_mmc_irqs(host, TMIO_MASK_ALL); |
574 | 575 | ||
575 | ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED | | 576 | ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED | |
576 | IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host); | 577 | IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host); |
577 | if (ret) | 578 | if (ret) |
578 | goto unmap_ctl; | 579 | goto cell_disable; |
579 | 580 | ||
580 | mmc_add_host(mmc); | 581 | mmc_add_host(mmc); |
581 | 582 | ||
@@ -587,6 +588,9 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev) | |||
587 | 588 | ||
588 | return 0; | 589 | return 0; |
589 | 590 | ||
591 | cell_disable: | ||
592 | if (cell->disable) | ||
593 | cell->disable(dev); | ||
590 | unmap_ctl: | 594 | unmap_ctl: |
591 | iounmap(host->ctl); | 595 | iounmap(host->ctl); |
592 | host_free: | 596 | host_free: |
@@ -597,6 +601,7 @@ out: | |||
597 | 601 | ||
598 | static int __devexit tmio_mmc_remove(struct platform_device *dev) | 602 | static int __devexit tmio_mmc_remove(struct platform_device *dev) |
599 | { | 603 | { |
604 | struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; | ||
600 | struct mmc_host *mmc = platform_get_drvdata(dev); | 605 | struct mmc_host *mmc = platform_get_drvdata(dev); |
601 | 606 | ||
602 | platform_set_drvdata(dev, NULL); | 607 | platform_set_drvdata(dev, NULL); |
@@ -605,6 +610,8 @@ static int __devexit tmio_mmc_remove(struct platform_device *dev) | |||
605 | struct tmio_mmc_host *host = mmc_priv(mmc); | 610 | struct tmio_mmc_host *host = mmc_priv(mmc); |
606 | mmc_remove_host(mmc); | 611 | mmc_remove_host(mmc); |
607 | free_irq(host->irq, host); | 612 | free_irq(host->irq, host); |
613 | if (cell->disable) | ||
614 | cell->disable(dev); | ||
608 | iounmap(host->ctl); | 615 | iounmap(host->ctl); |
609 | mmc_free_host(mmc); | 616 | mmc_free_host(mmc); |
610 | } | 617 | } |
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 692dc23363b9..dafecfbcd91a 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h | |||
@@ -55,10 +55,8 @@ | |||
55 | /* Define some IRQ masks */ | 55 | /* Define some IRQ masks */ |
56 | /* This is the mask used at reset by the chip */ | 56 | /* This is the mask used at reset by the chip */ |
57 | #define TMIO_MASK_ALL 0x837f031d | 57 | #define TMIO_MASK_ALL 0x837f031d |
58 | #define TMIO_MASK_READOP (TMIO_STAT_RXRDY | TMIO_STAT_DATAEND | \ | 58 | #define TMIO_MASK_READOP (TMIO_STAT_RXRDY | TMIO_STAT_DATAEND) |
59 | TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) | 59 | #define TMIO_MASK_WRITEOP (TMIO_STAT_TXRQ | TMIO_STAT_DATAEND) |
60 | #define TMIO_MASK_WRITEOP (TMIO_STAT_TXRQ | TMIO_STAT_DATAEND | \ | ||
61 | TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) | ||
62 | #define TMIO_MASK_CMD (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT | \ | 60 | #define TMIO_MASK_CMD (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT | \ |
63 | TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) | 61 | TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) |
64 | #define TMIO_MASK_IRQ (TMIO_MASK_READOP | TMIO_MASK_WRITEOP | TMIO_MASK_CMD) | 62 | #define TMIO_MASK_IRQ (TMIO_MASK_READOP | TMIO_MASK_WRITEOP | TMIO_MASK_CMD) |
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index bf1467213954..faaa9b4d0d07 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig | |||
@@ -29,6 +29,13 @@ config APM_POWER | |||
29 | Say Y here to enable support APM status emulation using | 29 | Say Y here to enable support APM status emulation using |
30 | battery class devices. | 30 | battery class devices. |
31 | 31 | ||
32 | config MAX8925_POWER | ||
33 | tristate "MAX8925 battery charger support" | ||
34 | depends on MFD_MAX8925 | ||
35 | help | ||
36 | Say Y here to enable support for the battery charger in the Maxim | ||
37 | MAX8925 PMIC. | ||
38 | |||
32 | config WM831X_BACKUP | 39 | config WM831X_BACKUP |
33 | tristate "WM831X backup battery charger support" | 40 | tristate "WM831X backup battery charger support" |
34 | depends on MFD_WM831X | 41 | depends on MFD_WM831X |
diff --git a/drivers/power/Makefile b/drivers/power/Makefile index 573597c683b4..a2ba7c85c97a 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile | |||
@@ -16,6 +16,7 @@ obj-$(CONFIG_POWER_SUPPLY) += power_supply.o | |||
16 | 16 | ||
17 | obj-$(CONFIG_PDA_POWER) += pda_power.o | 17 | obj-$(CONFIG_PDA_POWER) += pda_power.o |
18 | obj-$(CONFIG_APM_POWER) += apm_power.o | 18 | obj-$(CONFIG_APM_POWER) += apm_power.o |
19 | obj-$(CONFIG_MAX8925_POWER) += max8925_power.o | ||
19 | obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o | 20 | obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o |
20 | obj-$(CONFIG_WM831X_POWER) += wm831x_power.o | 21 | obj-$(CONFIG_WM831X_POWER) += wm831x_power.o |
21 | obj-$(CONFIG_WM8350_POWER) += wm8350_power.o | 22 | obj-$(CONFIG_WM8350_POWER) += wm8350_power.o |
diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c new file mode 100644 index 000000000000..a1b4410544d7 --- /dev/null +++ b/drivers/power/max8925_power.c | |||
@@ -0,0 +1,534 @@ | |||
1 | /* | ||
2 | * Battery driver for Maxim MAX8925 | ||
3 | * | ||
4 | * Copyright (c) 2009-2010 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/power_supply.h> | ||
18 | #include <linux/mfd/max8925.h> | ||
19 | |||
20 | /* registers in GPM */ | ||
21 | #define MAX8925_OUT5VEN 0x54 | ||
22 | #define MAX8925_OUT3VEN 0x58 | ||
23 | #define MAX8925_CHG_CNTL1 0x7c | ||
24 | |||
25 | /* bits definition */ | ||
26 | #define MAX8925_CHG_STAT_VSYSLOW (1 << 0) | ||
27 | #define MAX8925_CHG_STAT_MODE_MASK (3 << 2) | ||
28 | #define MAX8925_CHG_STAT_EN_MASK (1 << 4) | ||
29 | #define MAX8925_CHG_MBDET (1 << 1) | ||
30 | #define MAX8925_CHG_AC_RANGE_MASK (3 << 6) | ||
31 | |||
32 | /* registers in ADC */ | ||
33 | #define MAX8925_ADC_RES_CNFG1 0x06 | ||
34 | #define MAX8925_ADC_AVG_CNFG1 0x07 | ||
35 | #define MAX8925_ADC_ACQ_CNFG1 0x08 | ||
36 | #define MAX8925_ADC_ACQ_CNFG2 0x09 | ||
37 | /* 2 bytes registers in below. MSB is 1st, LSB is 2nd. */ | ||
38 | #define MAX8925_ADC_AUX2 0x62 | ||
39 | #define MAX8925_ADC_VCHG 0x64 | ||
40 | #define MAX8925_ADC_VBBATT 0x66 | ||
41 | #define MAX8925_ADC_VMBATT 0x68 | ||
42 | #define MAX8925_ADC_ISNS 0x6a | ||
43 | #define MAX8925_ADC_THM 0x6c | ||
44 | #define MAX8925_ADC_TDIE 0x6e | ||
45 | #define MAX8925_CMD_AUX2 0xc8 | ||
46 | #define MAX8925_CMD_VCHG 0xd0 | ||
47 | #define MAX8925_CMD_VBBATT 0xd8 | ||
48 | #define MAX8925_CMD_VMBATT 0xe0 | ||
49 | #define MAX8925_CMD_ISNS 0xe8 | ||
50 | #define MAX8925_CMD_THM 0xf0 | ||
51 | #define MAX8925_CMD_TDIE 0xf8 | ||
52 | |||
53 | enum { | ||
54 | MEASURE_AUX2, | ||
55 | MEASURE_VCHG, | ||
56 | MEASURE_VBBATT, | ||
57 | MEASURE_VMBATT, | ||
58 | MEASURE_ISNS, | ||
59 | MEASURE_THM, | ||
60 | MEASURE_TDIE, | ||
61 | MEASURE_MAX, | ||
62 | }; | ||
63 | |||
64 | struct max8925_power_info { | ||
65 | struct max8925_chip *chip; | ||
66 | struct i2c_client *gpm; | ||
67 | struct i2c_client *adc; | ||
68 | |||
69 | struct power_supply ac; | ||
70 | struct power_supply usb; | ||
71 | struct power_supply battery; | ||
72 | int irq_base; | ||
73 | unsigned ac_online:1; | ||
74 | unsigned usb_online:1; | ||
75 | unsigned bat_online:1; | ||
76 | unsigned chg_mode:2; | ||
77 | unsigned batt_detect:1; /* detecing MB by ID pin */ | ||
78 | unsigned topoff_threshold:2; | ||
79 | unsigned fast_charge:3; | ||
80 | |||
81 | int (*set_charger) (int); | ||
82 | }; | ||
83 | |||
84 | static int __set_charger(struct max8925_power_info *info, int enable) | ||
85 | { | ||
86 | struct max8925_chip *chip = info->chip; | ||
87 | if (enable) { | ||
88 | /* enable charger in platform */ | ||
89 | if (info->set_charger) | ||
90 | info->set_charger(1); | ||
91 | /* enable charger */ | ||
92 | max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 0); | ||
93 | } else { | ||
94 | /* disable charge */ | ||
95 | max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 1 << 7); | ||
96 | if (info->set_charger) | ||
97 | info->set_charger(0); | ||
98 | } | ||
99 | dev_dbg(chip->dev, "%s\n", (enable) ? "Enable charger" | ||
100 | : "Disable charger"); | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static irqreturn_t max8925_charger_handler(int irq, void *data) | ||
105 | { | ||
106 | struct max8925_power_info *info = (struct max8925_power_info *)data; | ||
107 | struct max8925_chip *chip = info->chip; | ||
108 | |||
109 | switch (irq - chip->irq_base) { | ||
110 | case MAX8925_IRQ_VCHG_DC_R: | ||
111 | info->ac_online = 1; | ||
112 | __set_charger(info, 1); | ||
113 | dev_dbg(chip->dev, "Adapter inserted\n"); | ||
114 | break; | ||
115 | case MAX8925_IRQ_VCHG_DC_F: | ||
116 | info->ac_online = 0; | ||
117 | __set_charger(info, 0); | ||
118 | dev_dbg(chip->dev, "Adapter is removal\n"); | ||
119 | break; | ||
120 | case MAX8925_IRQ_VCHG_USB_R: | ||
121 | info->usb_online = 1; | ||
122 | __set_charger(info, 1); | ||
123 | dev_dbg(chip->dev, "USB inserted\n"); | ||
124 | break; | ||
125 | case MAX8925_IRQ_VCHG_USB_F: | ||
126 | info->usb_online = 0; | ||
127 | __set_charger(info, 0); | ||
128 | dev_dbg(chip->dev, "USB is removal\n"); | ||
129 | break; | ||
130 | case MAX8925_IRQ_VCHG_THM_OK_F: | ||
131 | /* Battery is not ready yet */ | ||
132 | dev_dbg(chip->dev, "Battery temperature is out of range\n"); | ||
133 | case MAX8925_IRQ_VCHG_DC_OVP: | ||
134 | dev_dbg(chip->dev, "Error detection\n"); | ||
135 | __set_charger(info, 0); | ||
136 | break; | ||
137 | case MAX8925_IRQ_VCHG_THM_OK_R: | ||
138 | /* Battery is ready now */ | ||
139 | dev_dbg(chip->dev, "Battery temperature is in range\n"); | ||
140 | break; | ||
141 | case MAX8925_IRQ_VCHG_SYSLOW_R: | ||
142 | /* VSYS is low */ | ||
143 | dev_info(chip->dev, "Sys power is too low\n"); | ||
144 | break; | ||
145 | case MAX8925_IRQ_VCHG_SYSLOW_F: | ||
146 | dev_dbg(chip->dev, "Sys power is above low threshold\n"); | ||
147 | break; | ||
148 | case MAX8925_IRQ_VCHG_DONE: | ||
149 | __set_charger(info, 0); | ||
150 | dev_dbg(chip->dev, "Charging is done\n"); | ||
151 | break; | ||
152 | case MAX8925_IRQ_VCHG_TOPOFF: | ||
153 | dev_dbg(chip->dev, "Charging in top-off mode\n"); | ||
154 | break; | ||
155 | case MAX8925_IRQ_VCHG_TMR_FAULT: | ||
156 | __set_charger(info, 0); | ||
157 | dev_dbg(chip->dev, "Safe timer is expired\n"); | ||
158 | break; | ||
159 | case MAX8925_IRQ_VCHG_RST: | ||
160 | __set_charger(info, 0); | ||
161 | dev_dbg(chip->dev, "Charger is reset\n"); | ||
162 | break; | ||
163 | } | ||
164 | return IRQ_HANDLED; | ||
165 | } | ||
166 | |||
167 | static int start_measure(struct max8925_power_info *info, int type) | ||
168 | { | ||
169 | unsigned char buf[2] = {0, 0}; | ||
170 | int meas_reg = 0, ret; | ||
171 | |||
172 | switch (type) { | ||
173 | case MEASURE_VCHG: | ||
174 | meas_reg = MAX8925_ADC_VCHG; | ||
175 | break; | ||
176 | case MEASURE_VBBATT: | ||
177 | meas_reg = MAX8925_ADC_VBBATT; | ||
178 | break; | ||
179 | case MEASURE_VMBATT: | ||
180 | meas_reg = MAX8925_ADC_VMBATT; | ||
181 | break; | ||
182 | case MEASURE_ISNS: | ||
183 | meas_reg = MAX8925_ADC_ISNS; | ||
184 | break; | ||
185 | default: | ||
186 | return -EINVAL; | ||
187 | } | ||
188 | |||
189 | max8925_bulk_read(info->adc, meas_reg, 2, buf); | ||
190 | ret = (buf[0] << 4) | (buf[1] >> 4); | ||
191 | |||
192 | return ret; | ||
193 | } | ||
194 | |||
195 | static int max8925_ac_get_prop(struct power_supply *psy, | ||
196 | enum power_supply_property psp, | ||
197 | union power_supply_propval *val) | ||
198 | { | ||
199 | struct max8925_power_info *info = dev_get_drvdata(psy->dev->parent); | ||
200 | int ret = 0; | ||
201 | |||
202 | switch (psp) { | ||
203 | case POWER_SUPPLY_PROP_ONLINE: | ||
204 | val->intval = info->ac_online; | ||
205 | break; | ||
206 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | ||
207 | if (info->ac_online) { | ||
208 | ret = start_measure(info, MEASURE_VCHG); | ||
209 | if (ret >= 0) { | ||
210 | val->intval = ret << 1; /* unit is mV */ | ||
211 | goto out; | ||
212 | } | ||
213 | } | ||
214 | ret = -ENODATA; | ||
215 | break; | ||
216 | default: | ||
217 | ret = -ENODEV; | ||
218 | break; | ||
219 | } | ||
220 | out: | ||
221 | return ret; | ||
222 | } | ||
223 | |||
224 | static enum power_supply_property max8925_ac_props[] = { | ||
225 | POWER_SUPPLY_PROP_ONLINE, | ||
226 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
227 | }; | ||
228 | |||
229 | static int max8925_usb_get_prop(struct power_supply *psy, | ||
230 | enum power_supply_property psp, | ||
231 | union power_supply_propval *val) | ||
232 | { | ||
233 | struct max8925_power_info *info = dev_get_drvdata(psy->dev->parent); | ||
234 | int ret = 0; | ||
235 | |||
236 | switch (psp) { | ||
237 | case POWER_SUPPLY_PROP_ONLINE: | ||
238 | val->intval = info->usb_online; | ||
239 | break; | ||
240 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | ||
241 | if (info->usb_online) { | ||
242 | ret = start_measure(info, MEASURE_VCHG); | ||
243 | if (ret >= 0) { | ||
244 | val->intval = ret << 1; /* unit is mV */ | ||
245 | goto out; | ||
246 | } | ||
247 | } | ||
248 | ret = -ENODATA; | ||
249 | break; | ||
250 | default: | ||
251 | ret = -ENODEV; | ||
252 | break; | ||
253 | } | ||
254 | out: | ||
255 | return ret; | ||
256 | } | ||
257 | |||
258 | static enum power_supply_property max8925_usb_props[] = { | ||
259 | POWER_SUPPLY_PROP_ONLINE, | ||
260 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
261 | }; | ||
262 | |||
263 | static int max8925_bat_get_prop(struct power_supply *psy, | ||
264 | enum power_supply_property psp, | ||
265 | union power_supply_propval *val) | ||
266 | { | ||
267 | struct max8925_power_info *info = dev_get_drvdata(psy->dev->parent); | ||
268 | long long int tmp = 0; | ||
269 | int ret = 0; | ||
270 | |||
271 | switch (psp) { | ||
272 | case POWER_SUPPLY_PROP_ONLINE: | ||
273 | val->intval = info->bat_online; | ||
274 | break; | ||
275 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | ||
276 | if (info->bat_online) { | ||
277 | ret = start_measure(info, MEASURE_VMBATT); | ||
278 | if (ret >= 0) { | ||
279 | val->intval = ret << 1; /* unit is mV */ | ||
280 | ret = 0; | ||
281 | break; | ||
282 | } | ||
283 | } | ||
284 | ret = -ENODATA; | ||
285 | break; | ||
286 | case POWER_SUPPLY_PROP_CURRENT_NOW: | ||
287 | if (info->bat_online) { | ||
288 | ret = start_measure(info, MEASURE_ISNS); | ||
289 | if (ret >= 0) { | ||
290 | tmp = (long long int)ret * 6250 / 4096 - 3125; | ||
291 | ret = (int)tmp; | ||
292 | val->intval = 0; | ||
293 | if (ret > 0) | ||
294 | val->intval = ret; /* unit is mA */ | ||
295 | ret = 0; | ||
296 | break; | ||
297 | } | ||
298 | } | ||
299 | ret = -ENODATA; | ||
300 | break; | ||
301 | case POWER_SUPPLY_PROP_CHARGE_TYPE: | ||
302 | if (!info->bat_online) { | ||
303 | ret = -ENODATA; | ||
304 | break; | ||
305 | } | ||
306 | ret = max8925_reg_read(info->gpm, MAX8925_CHG_STATUS); | ||
307 | ret = (ret & MAX8925_CHG_STAT_MODE_MASK) >> 2; | ||
308 | switch (ret) { | ||
309 | case 1: | ||
310 | val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; | ||
311 | break; | ||
312 | case 0: | ||
313 | case 2: | ||
314 | val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; | ||
315 | break; | ||
316 | case 3: | ||
317 | val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; | ||
318 | break; | ||
319 | } | ||
320 | ret = 0; | ||
321 | break; | ||
322 | case POWER_SUPPLY_PROP_STATUS: | ||
323 | if (!info->bat_online) { | ||
324 | ret = -ENODATA; | ||
325 | break; | ||
326 | } | ||
327 | ret = max8925_reg_read(info->gpm, MAX8925_CHG_STATUS); | ||
328 | if (info->usb_online || info->ac_online) { | ||
329 | val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; | ||
330 | if (ret & MAX8925_CHG_STAT_EN_MASK) | ||
331 | val->intval = POWER_SUPPLY_STATUS_CHARGING; | ||
332 | } else | ||
333 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; | ||
334 | ret = 0; | ||
335 | break; | ||
336 | default: | ||
337 | ret = -ENODEV; | ||
338 | break; | ||
339 | } | ||
340 | return ret; | ||
341 | } | ||
342 | |||
343 | static enum power_supply_property max8925_battery_props[] = { | ||
344 | POWER_SUPPLY_PROP_ONLINE, | ||
345 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
346 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
347 | POWER_SUPPLY_PROP_CHARGE_TYPE, | ||
348 | POWER_SUPPLY_PROP_STATUS, | ||
349 | }; | ||
350 | |||
351 | #define REQUEST_IRQ(_irq, _name) \ | ||
352 | do { \ | ||
353 | ret = request_threaded_irq(chip->irq_base + _irq, NULL, \ | ||
354 | max8925_charger_handler, \ | ||
355 | IRQF_ONESHOT, _name, info); \ | ||
356 | if (ret) \ | ||
357 | dev_err(chip->dev, "Failed to request IRQ #%d: %d\n", \ | ||
358 | _irq, ret); \ | ||
359 | } while (0) | ||
360 | |||
361 | static __devinit int max8925_init_charger(struct max8925_chip *chip, | ||
362 | struct max8925_power_info *info) | ||
363 | { | ||
364 | int ret; | ||
365 | |||
366 | REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_OVP, "ac-ovp"); | ||
367 | REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_F, "ac-remove"); | ||
368 | REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_R, "ac-insert"); | ||
369 | REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_OVP, "usb-ovp"); | ||
370 | REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_F, "usb-remove"); | ||
371 | REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_R, "usb-insert"); | ||
372 | REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_R, "batt-temp-in-range"); | ||
373 | REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_F, "batt-temp-out-range"); | ||
374 | REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_F, "vsys-high"); | ||
375 | REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_R, "vsys-low"); | ||
376 | REQUEST_IRQ(MAX8925_IRQ_VCHG_RST, "charger-reset"); | ||
377 | REQUEST_IRQ(MAX8925_IRQ_VCHG_DONE, "charger-done"); | ||
378 | REQUEST_IRQ(MAX8925_IRQ_VCHG_TOPOFF, "charger-topoff"); | ||
379 | REQUEST_IRQ(MAX8925_IRQ_VCHG_TMR_FAULT, "charger-timer-expire"); | ||
380 | |||
381 | info->ac_online = 0; | ||
382 | info->usb_online = 0; | ||
383 | info->bat_online = 0; | ||
384 | ret = max8925_reg_read(info->gpm, MAX8925_CHG_STATUS); | ||
385 | if (ret >= 0) { | ||
386 | /* | ||
387 | * If battery detection is enabled, ID pin of battery is | ||
388 | * connected to MBDET pin of MAX8925. It could be used to | ||
389 | * detect battery presence. | ||
390 | * Otherwise, we have to assume that battery is always on. | ||
391 | */ | ||
392 | if (info->batt_detect) | ||
393 | info->bat_online = (ret & MAX8925_CHG_MBDET) ? 0 : 1; | ||
394 | else | ||
395 | info->bat_online = 1; | ||
396 | if (ret & MAX8925_CHG_AC_RANGE_MASK) | ||
397 | info->ac_online = 1; | ||
398 | else | ||
399 | info->ac_online = 0; | ||
400 | } | ||
401 | /* disable charge */ | ||
402 | max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 1 << 7); | ||
403 | /* set charging current in charge topoff mode */ | ||
404 | max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 3 << 5, | ||
405 | info->topoff_threshold << 5); | ||
406 | /* set charing current in fast charge mode */ | ||
407 | max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 7, info->fast_charge); | ||
408 | |||
409 | return 0; | ||
410 | } | ||
411 | |||
412 | static __devexit int max8925_deinit_charger(struct max8925_power_info *info) | ||
413 | { | ||
414 | struct max8925_chip *chip = info->chip; | ||
415 | int irq; | ||
416 | |||
417 | irq = chip->irq_base + MAX8925_IRQ_VCHG_DC_OVP; | ||
418 | for (; irq <= chip->irq_base + MAX8925_IRQ_VCHG_TMR_FAULT; irq++) | ||
419 | free_irq(irq, info); | ||
420 | |||
421 | return 0; | ||
422 | } | ||
423 | |||
424 | static __devinit int max8925_power_probe(struct platform_device *pdev) | ||
425 | { | ||
426 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
427 | struct max8925_platform_data *max8925_pdata; | ||
428 | struct max8925_power_pdata *pdata = NULL; | ||
429 | struct max8925_power_info *info; | ||
430 | int ret; | ||
431 | |||
432 | if (pdev->dev.parent->platform_data) { | ||
433 | max8925_pdata = pdev->dev.parent->platform_data; | ||
434 | pdata = max8925_pdata->power; | ||
435 | } | ||
436 | |||
437 | if (!pdata) { | ||
438 | dev_err(&pdev->dev, "platform data isn't assigned to " | ||
439 | "power supply\n"); | ||
440 | return -EINVAL; | ||
441 | } | ||
442 | |||
443 | info = kzalloc(sizeof(struct max8925_power_info), GFP_KERNEL); | ||
444 | if (!info) | ||
445 | return -ENOMEM; | ||
446 | info->chip = chip; | ||
447 | info->gpm = chip->i2c; | ||
448 | info->adc = chip->adc; | ||
449 | |||
450 | info->ac.name = "max8925-ac"; | ||
451 | info->ac.type = POWER_SUPPLY_TYPE_MAINS; | ||
452 | info->ac.properties = max8925_ac_props; | ||
453 | info->ac.num_properties = ARRAY_SIZE(max8925_ac_props); | ||
454 | info->ac.get_property = max8925_ac_get_prop; | ||
455 | ret = power_supply_register(&pdev->dev, &info->ac); | ||
456 | if (ret) | ||
457 | goto out; | ||
458 | info->ac.dev->parent = &pdev->dev; | ||
459 | |||
460 | info->usb.name = "max8925-usb"; | ||
461 | info->usb.type = POWER_SUPPLY_TYPE_USB; | ||
462 | info->usb.properties = max8925_usb_props; | ||
463 | info->usb.num_properties = ARRAY_SIZE(max8925_usb_props); | ||
464 | info->usb.get_property = max8925_usb_get_prop; | ||
465 | ret = power_supply_register(&pdev->dev, &info->usb); | ||
466 | if (ret) | ||
467 | goto out_usb; | ||
468 | info->usb.dev->parent = &pdev->dev; | ||
469 | |||
470 | info->battery.name = "max8925-battery"; | ||
471 | info->battery.type = POWER_SUPPLY_TYPE_BATTERY; | ||
472 | info->battery.properties = max8925_battery_props; | ||
473 | info->battery.num_properties = ARRAY_SIZE(max8925_battery_props); | ||
474 | info->battery.get_property = max8925_bat_get_prop; | ||
475 | ret = power_supply_register(&pdev->dev, &info->battery); | ||
476 | if (ret) | ||
477 | goto out_battery; | ||
478 | info->battery.dev->parent = &pdev->dev; | ||
479 | |||
480 | info->batt_detect = pdata->batt_detect; | ||
481 | info->topoff_threshold = pdata->topoff_threshold; | ||
482 | info->fast_charge = pdata->fast_charge; | ||
483 | info->set_charger = pdata->set_charger; | ||
484 | dev_set_drvdata(&pdev->dev, info); | ||
485 | platform_set_drvdata(pdev, info); | ||
486 | |||
487 | max8925_init_charger(chip, info); | ||
488 | return 0; | ||
489 | out_battery: | ||
490 | power_supply_unregister(&info->battery); | ||
491 | out_usb: | ||
492 | power_supply_unregister(&info->ac); | ||
493 | out: | ||
494 | kfree(info); | ||
495 | return ret; | ||
496 | } | ||
497 | |||
498 | static __devexit int max8925_power_remove(struct platform_device *pdev) | ||
499 | { | ||
500 | struct max8925_power_info *info = platform_get_drvdata(pdev); | ||
501 | |||
502 | if (info) { | ||
503 | power_supply_unregister(&info->ac); | ||
504 | power_supply_unregister(&info->usb); | ||
505 | power_supply_unregister(&info->battery); | ||
506 | max8925_deinit_charger(info); | ||
507 | kfree(info); | ||
508 | } | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | static struct platform_driver max8925_power_driver = { | ||
513 | .probe = max8925_power_probe, | ||
514 | .remove = __devexit_p(max8925_power_remove), | ||
515 | .driver = { | ||
516 | .name = "max8925-power", | ||
517 | }, | ||
518 | }; | ||
519 | |||
520 | static int __init max8925_power_init(void) | ||
521 | { | ||
522 | return platform_driver_register(&max8925_power_driver); | ||
523 | } | ||
524 | module_init(max8925_power_init); | ||
525 | |||
526 | static void __exit max8925_power_exit(void) | ||
527 | { | ||
528 | platform_driver_unregister(&max8925_power_driver); | ||
529 | } | ||
530 | module_exit(max8925_power_exit); | ||
531 | |||
532 | MODULE_LICENSE("GPL"); | ||
533 | MODULE_DESCRIPTION("Power supply driver for MAX8925"); | ||
534 | MODULE_ALIAS("platform:max8925-power"); | ||
diff --git a/drivers/power/wm8350_power.c b/drivers/power/wm8350_power.c index ad4f071e1287..0693902d6151 100644 --- a/drivers/power/wm8350_power.c +++ b/drivers/power/wm8350_power.c | |||
@@ -190,7 +190,7 @@ static irqreturn_t wm8350_charger_handler(int irq, void *data) | |||
190 | struct wm8350_power *power = &wm8350->power; | 190 | struct wm8350_power *power = &wm8350->power; |
191 | struct wm8350_charger_policy *policy = power->policy; | 191 | struct wm8350_charger_policy *policy = power->policy; |
192 | 192 | ||
193 | switch (irq) { | 193 | switch (irq - wm8350->irq_base) { |
194 | case WM8350_IRQ_CHG_BAT_FAIL: | 194 | case WM8350_IRQ_CHG_BAT_FAIL: |
195 | dev_err(wm8350->dev, "battery failed\n"); | 195 | dev_err(wm8350->dev, "battery failed\n"); |
196 | break; | 196 | break; |
@@ -428,18 +428,18 @@ static void wm8350_init_charger(struct wm8350 *wm8350) | |||
428 | 428 | ||
429 | static void free_charger_irq(struct wm8350 *wm8350) | 429 | static void free_charger_irq(struct wm8350 *wm8350) |
430 | { | 430 | { |
431 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT); | 431 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT, wm8350); |
432 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD); | 432 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD, wm8350); |
433 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL); | 433 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL, wm8350); |
434 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO); | 434 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO, wm8350); |
435 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END); | 435 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END, wm8350); |
436 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START); | 436 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START, wm8350); |
437 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9); | 437 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9, wm8350); |
438 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1); | 438 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1, wm8350); |
439 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85); | 439 | wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85, wm8350); |
440 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB); | 440 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB, wm8350); |
441 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB); | 441 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB, wm8350); |
442 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB); | 442 | wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB, wm8350); |
443 | } | 443 | } |
444 | 444 | ||
445 | static __devinit int wm8350_power_probe(struct platform_device *pdev) | 445 | static __devinit int wm8350_power_probe(struct platform_device *pdev) |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 04719551381b..5fb83e2ced25 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
@@ -11,15 +11,17 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <linux/i2c.h> | ||
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
15 | #include <linux/regulator/driver.h> | 16 | #include <linux/regulator/driver.h> |
16 | #include <linux/regulator/machine.h> | 17 | #include <linux/regulator/machine.h> |
17 | #include <linux/mfd/88pm8607.h> | 18 | #include <linux/mfd/88pm860x.h> |
18 | 19 | ||
19 | struct pm8607_regulator_info { | 20 | struct pm8607_regulator_info { |
20 | struct regulator_desc desc; | 21 | struct regulator_desc desc; |
21 | struct pm8607_chip *chip; | 22 | struct pm860x_chip *chip; |
22 | struct regulator_dev *regulator; | 23 | struct regulator_dev *regulator; |
24 | struct i2c_client *i2c; | ||
23 | 25 | ||
24 | int min_uV; | 26 | int min_uV; |
25 | int max_uV; | 27 | int max_uV; |
@@ -46,7 +48,6 @@ static inline int check_range(struct pm8607_regulator_info *info, | |||
46 | static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index) | 48 | static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index) |
47 | { | 49 | { |
48 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 50 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
49 | uint8_t chip_id = info->chip->chip_id; | ||
50 | int ret = -EINVAL; | 51 | int ret = -EINVAL; |
51 | 52 | ||
52 | switch (info->desc.id) { | 53 | switch (info->desc.id) { |
@@ -88,79 +89,29 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index) | |||
88 | case PM8607_ID_LDO2: | 89 | case PM8607_ID_LDO2: |
89 | case PM8607_ID_LDO3: | 90 | case PM8607_ID_LDO3: |
90 | case PM8607_ID_LDO9: | 91 | case PM8607_ID_LDO9: |
91 | switch (chip_id) { | 92 | ret = (index < 3) ? (index * 50000 + 1800000) : |
92 | case PM8607_CHIP_A0: | 93 | ((index < 7) ? (index * 50000 + 2550000) : |
93 | case PM8607_CHIP_A1: | 94 | 3300000); |
94 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
95 | ((index < 8) ? (index * 50000 + 2550000) : | ||
96 | -EINVAL); | ||
97 | break; | ||
98 | case PM8607_CHIP_B0: | ||
99 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
100 | ((index < 7) ? (index * 50000 + 2550000) : | ||
101 | 3300000); | ||
102 | break; | ||
103 | } | ||
104 | break; | 95 | break; |
105 | case PM8607_ID_LDO4: | 96 | case PM8607_ID_LDO4: |
106 | switch (chip_id) { | 97 | ret = (index < 3) ? (index * 50000 + 1800000) : |
107 | case PM8607_CHIP_A0: | 98 | ((index < 6) ? (index * 50000 + 2550000) : |
108 | case PM8607_CHIP_A1: | 99 | ((index == 6) ? 2900000 : 3300000)); |
109 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
110 | ((index < 8) ? (index * 50000 + 2550000) : | ||
111 | -EINVAL); | ||
112 | break; | ||
113 | case PM8607_CHIP_B0: | ||
114 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
115 | ((index < 6) ? (index * 50000 + 2550000) : | ||
116 | ((index == 6) ? 2900000 : 3300000)); | ||
117 | break; | ||
118 | } | ||
119 | break; | 100 | break; |
120 | case PM8607_ID_LDO6: | 101 | case PM8607_ID_LDO6: |
121 | switch (chip_id) { | 102 | ret = (index < 2) ? (index * 50000 + 1800000) : |
122 | case PM8607_CHIP_A0: | 103 | ((index < 7) ? (index * 50000 + 2500000) : |
123 | case PM8607_CHIP_A1: | 104 | 3300000); |
124 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
125 | ((index < 8) ? (index * 50000 + 2450000) : | ||
126 | -EINVAL); | ||
127 | break; | ||
128 | case PM8607_CHIP_B0: | ||
129 | ret = (index < 2) ? (index * 50000 + 1800000) : | ||
130 | ((index < 7) ? (index * 50000 + 2500000) : | ||
131 | 3300000); | ||
132 | break; | ||
133 | } | ||
134 | break; | 105 | break; |
135 | case PM8607_ID_LDO10: | 106 | case PM8607_ID_LDO10: |
136 | switch (chip_id) { | 107 | ret = (index < 3) ? (index * 50000 + 1800000) : |
137 | case PM8607_CHIP_A0: | 108 | ((index < 7) ? (index * 50000 + 2550000) : |
138 | case PM8607_CHIP_A1: | 109 | ((index == 7) ? 3300000 : 1200000)); |
139 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
140 | ((index < 8) ? (index * 50000 + 2550000) : | ||
141 | 1200000); | ||
142 | break; | ||
143 | case PM8607_CHIP_B0: | ||
144 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
145 | ((index < 7) ? (index * 50000 + 2550000) : | ||
146 | ((index == 7) ? 3300000 : 1200000)); | ||
147 | break; | ||
148 | } | ||
149 | break; | 110 | break; |
150 | case PM8607_ID_LDO14: | 111 | case PM8607_ID_LDO14: |
151 | switch (chip_id) { | 112 | ret = (index < 2) ? (index * 50000 + 1800000) : |
152 | case PM8607_CHIP_A0: | 113 | ((index < 7) ? (index * 50000 + 2600000) : |
153 | case PM8607_CHIP_A1: | 114 | 3300000); |
154 | ret = (index < 3) ? (index * 50000 + 1800000) : | ||
155 | ((index < 8) ? (index * 50000 + 2550000) : | ||
156 | -EINVAL); | ||
157 | break; | ||
158 | case PM8607_CHIP_B0: | ||
159 | ret = (index < 2) ? (index * 50000 + 1800000) : | ||
160 | ((index < 7) ? (index * 50000 + 2600000) : | ||
161 | 3300000); | ||
162 | break; | ||
163 | } | ||
164 | break; | 115 | break; |
165 | } | 116 | } |
166 | return ret; | 117 | return ret; |
@@ -169,7 +120,6 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index) | |||
169 | static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) | 120 | static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) |
170 | { | 121 | { |
171 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 122 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
172 | uint8_t chip_id = info->chip->chip_id; | ||
173 | int val = -ENOENT; | 123 | int val = -ENOENT; |
174 | int ret; | 124 | int ret; |
175 | 125 | ||
@@ -254,161 +204,77 @@ static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) | |||
254 | case PM8607_ID_LDO2: | 204 | case PM8607_ID_LDO2: |
255 | case PM8607_ID_LDO3: | 205 | case PM8607_ID_LDO3: |
256 | case PM8607_ID_LDO9: | 206 | case PM8607_ID_LDO9: |
257 | switch (chip_id) { | 207 | if (min_uV < 2700000) { /* 1800mV ~ 1900mV / 50mV */ |
258 | case PM8607_CHIP_A0: | 208 | if (min_uV <= 1800000) |
259 | case PM8607_CHIP_A1: | 209 | val = 0; |
260 | if (min_uV < 2700000) /* 1800mV ~ 1900mV / 50mV */ | 210 | else if (min_uV <= 1900000) |
261 | if (min_uV <= 1800000) | 211 | val = (min_uV - 1750001) / 50000; |
262 | val = 0; | 212 | else |
263 | else if (min_uV <= 1900000) | 213 | val = 3; /* 2700mV */ |
264 | val = (min_uV - 1750001) / 50000; | 214 | } else { /* 2700mV ~ 2850mV / 50mV */ |
265 | else | 215 | if (min_uV <= 2850000) { |
266 | val = 3; /* 2700mV */ | 216 | val = (min_uV - 2650001) / 50000; |
267 | else { /* 2700mV ~ 2900mV / 50mV */ | 217 | val += 3; |
268 | if (min_uV <= 2900000) { | 218 | } else if (min_uV <= 3300000) |
269 | val = (min_uV - 2650001) / 50000; | 219 | val = 7; |
270 | val += 3; | 220 | else |
271 | } else | 221 | val = -EINVAL; |
272 | val = -EINVAL; | ||
273 | } | ||
274 | break; | ||
275 | case PM8607_CHIP_B0: | ||
276 | if (min_uV < 2700000) { /* 1800mV ~ 1900mV / 50mV */ | ||
277 | if (min_uV <= 1800000) | ||
278 | val = 0; | ||
279 | else if (min_uV <= 1900000) | ||
280 | val = (min_uV - 1750001) / 50000; | ||
281 | else | ||
282 | val = 3; /* 2700mV */ | ||
283 | } else { /* 2700mV ~ 2850mV / 50mV */ | ||
284 | if (min_uV <= 2850000) { | ||
285 | val = (min_uV - 2650001) / 50000; | ||
286 | val += 3; | ||
287 | } else if (min_uV <= 3300000) | ||
288 | val = 7; | ||
289 | else | ||
290 | val = -EINVAL; | ||
291 | } | ||
292 | break; | ||
293 | } | 222 | } |
294 | break; | 223 | break; |
295 | case PM8607_ID_LDO4: | 224 | case PM8607_ID_LDO4: |
296 | switch (chip_id) { | 225 | if (min_uV < 2700000) { /* 1800mV ~ 1900mV / 50mV */ |
297 | case PM8607_CHIP_A0: | 226 | if (min_uV <= 1800000) |
298 | case PM8607_CHIP_A1: | 227 | val = 0; |
299 | if (min_uV < 2700000) /* 1800mV ~ 1900mV / 50mV */ | 228 | else if (min_uV <= 1900000) |
300 | if (min_uV <= 1800000) | 229 | val = (min_uV - 1750001) / 50000; |
301 | val = 0; | 230 | else |
302 | else if (min_uV <= 1900000) | 231 | val = 3; /* 2700mV */ |
303 | val = (min_uV - 1750001) / 50000; | 232 | } else { /* 2700mV ~ 2800mV / 50mV */ |
304 | else | 233 | if (min_uV <= 2850000) { |
305 | val = 3; /* 2700mV */ | 234 | val = (min_uV - 2650001) / 50000; |
306 | else { /* 2700mV ~ 2900mV / 50mV */ | 235 | val += 3; |
307 | if (min_uV <= 2900000) { | 236 | } else if (min_uV <= 2900000) |
308 | val = (min_uV - 2650001) / 50000; | 237 | val = 6; |
309 | val += 3; | 238 | else if (min_uV <= 3300000) |
310 | } else | 239 | val = 7; |
311 | val = -EINVAL; | 240 | else |
312 | } | 241 | val = -EINVAL; |
313 | break; | ||
314 | case PM8607_CHIP_B0: | ||
315 | if (min_uV < 2700000) { /* 1800mV ~ 1900mV / 50mV */ | ||
316 | if (min_uV <= 1800000) | ||
317 | val = 0; | ||
318 | else if (min_uV <= 1900000) | ||
319 | val = (min_uV - 1750001) / 50000; | ||
320 | else | ||
321 | val = 3; /* 2700mV */ | ||
322 | } else { /* 2700mV ~ 2800mV / 50mV */ | ||
323 | if (min_uV <= 2850000) { | ||
324 | val = (min_uV - 2650001) / 50000; | ||
325 | val += 3; | ||
326 | } else if (min_uV <= 2900000) | ||
327 | val = 6; | ||
328 | else if (min_uV <= 3300000) | ||
329 | val = 7; | ||
330 | else | ||
331 | val = -EINVAL; | ||
332 | } | ||
333 | break; | ||
334 | } | 242 | } |
335 | break; | 243 | break; |
336 | case PM8607_ID_LDO6: | 244 | case PM8607_ID_LDO6: |
337 | switch (chip_id) { | 245 | if (min_uV < 2600000) { /* 1800mV ~ 1850mV / 50mV */ |
338 | case PM8607_CHIP_A0: | 246 | if (min_uV <= 1800000) |
339 | case PM8607_CHIP_A1: | 247 | val = 0; |
340 | if (min_uV < 2600000) { /* 1800mV ~ 1900mV / 50mV */ | 248 | else if (min_uV <= 1850000) |
341 | if (min_uV <= 1800000) | 249 | val = (min_uV - 1750001) / 50000; |
342 | val = 0; | 250 | else |
343 | else if (min_uV <= 1900000) | 251 | val = 2; /* 2600mV */ |
344 | val = (min_uV - 1750001) / 50000; | 252 | } else { /* 2600mV ~ 2800mV / 50mV */ |
345 | else | 253 | if (min_uV <= 2800000) { |
346 | val = 3; /* 2600mV */ | 254 | val = (min_uV - 2550001) / 50000; |
347 | } else { /* 2600mV ~ 2800mV / 50mV */ | 255 | val += 2; |
348 | if (min_uV <= 2800000) { | 256 | } else if (min_uV <= 3300000) |
349 | val = (min_uV - 2550001) / 50000; | 257 | val = 7; |
350 | val += 3; | 258 | else |
351 | } else | 259 | val = -EINVAL; |
352 | val = -EINVAL; | ||
353 | } | ||
354 | break; | ||
355 | case PM8607_CHIP_B0: | ||
356 | if (min_uV < 2600000) { /* 1800mV ~ 1850mV / 50mV */ | ||
357 | if (min_uV <= 1800000) | ||
358 | val = 0; | ||
359 | else if (min_uV <= 1850000) | ||
360 | val = (min_uV - 1750001) / 50000; | ||
361 | else | ||
362 | val = 2; /* 2600mV */ | ||
363 | } else { /* 2600mV ~ 2800mV / 50mV */ | ||
364 | if (min_uV <= 2800000) { | ||
365 | val = (min_uV - 2550001) / 50000; | ||
366 | val += 2; | ||
367 | } else if (min_uV <= 3300000) | ||
368 | val = 7; | ||
369 | else | ||
370 | val = -EINVAL; | ||
371 | } | ||
372 | break; | ||
373 | } | 260 | } |
374 | break; | 261 | break; |
375 | case PM8607_ID_LDO14: | 262 | case PM8607_ID_LDO14: |
376 | switch (chip_id) { | 263 | if (min_uV < 2700000) { /* 1800mV ~ 1850mV / 50mV */ |
377 | case PM8607_CHIP_A0: | 264 | if (min_uV <= 1800000) |
378 | case PM8607_CHIP_A1: | 265 | val = 0; |
379 | if (min_uV < 2700000) { /* 1800mV ~ 1900mV / 50mV */ | 266 | else if (min_uV <= 1850000) |
380 | if (min_uV <= 1800000) | 267 | val = (min_uV - 1750001) / 50000; |
381 | val = 0; | 268 | else |
382 | else if (min_uV <= 1900000) | 269 | val = 2; /* 2700mV */ |
383 | val = (min_uV - 1750001) / 50000; | 270 | } else { /* 2700mV ~ 2900mV / 50mV */ |
384 | else | 271 | if (min_uV <= 2900000) { |
385 | val = 3; /* 2700mV */ | 272 | val = (min_uV - 2650001) / 50000; |
386 | } else { /* 2700mV ~ 2900mV / 50mV */ | 273 | val += 2; |
387 | if (min_uV <= 2900000) { | 274 | } else if (min_uV <= 3300000) |
388 | val = (min_uV - 2650001) / 50000; | 275 | val = 7; |
389 | val += 3; | 276 | else |
390 | } else | 277 | val = -EINVAL; |
391 | val = -EINVAL; | ||
392 | } | ||
393 | break; | ||
394 | case PM8607_CHIP_B0: | ||
395 | if (min_uV < 2700000) { /* 1800mV ~ 1850mV / 50mV */ | ||
396 | if (min_uV <= 1800000) | ||
397 | val = 0; | ||
398 | else if (min_uV <= 1850000) | ||
399 | val = (min_uV - 1750001) / 50000; | ||
400 | else | ||
401 | val = 2; /* 2700mV */ | ||
402 | } else { /* 2700mV ~ 2900mV / 50mV */ | ||
403 | if (min_uV <= 2900000) { | ||
404 | val = (min_uV - 2650001) / 50000; | ||
405 | val += 2; | ||
406 | } else if (min_uV <= 3300000) | ||
407 | val = 7; | ||
408 | else | ||
409 | val = -EINVAL; | ||
410 | } | ||
411 | break; | ||
412 | } | 278 | } |
413 | break; | 279 | break; |
414 | } | 280 | } |
@@ -428,7 +294,6 @@ static int pm8607_set_voltage(struct regulator_dev *rdev, | |||
428 | int min_uV, int max_uV) | 294 | int min_uV, int max_uV) |
429 | { | 295 | { |
430 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 296 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
431 | struct pm8607_chip *chip = info->chip; | ||
432 | uint8_t val, mask; | 297 | uint8_t val, mask; |
433 | int ret; | 298 | int ret; |
434 | 299 | ||
@@ -443,13 +308,13 @@ static int pm8607_set_voltage(struct regulator_dev *rdev, | |||
443 | val = (uint8_t)(ret << info->vol_shift); | 308 | val = (uint8_t)(ret << info->vol_shift); |
444 | mask = ((1 << info->vol_nbits) - 1) << info->vol_shift; | 309 | mask = ((1 << info->vol_nbits) - 1) << info->vol_shift; |
445 | 310 | ||
446 | ret = pm8607_set_bits(chip, info->vol_reg, mask, val); | 311 | ret = pm860x_set_bits(info->i2c, info->vol_reg, mask, val); |
447 | if (ret) | 312 | if (ret) |
448 | return ret; | 313 | return ret; |
449 | switch (info->desc.id) { | 314 | switch (info->desc.id) { |
450 | case PM8607_ID_BUCK1: | 315 | case PM8607_ID_BUCK1: |
451 | case PM8607_ID_BUCK3: | 316 | case PM8607_ID_BUCK3: |
452 | ret = pm8607_set_bits(chip, info->update_reg, | 317 | ret = pm860x_set_bits(info->i2c, info->update_reg, |
453 | 1 << info->update_bit, | 318 | 1 << info->update_bit, |
454 | 1 << info->update_bit); | 319 | 1 << info->update_bit); |
455 | break; | 320 | break; |
@@ -460,11 +325,10 @@ static int pm8607_set_voltage(struct regulator_dev *rdev, | |||
460 | static int pm8607_get_voltage(struct regulator_dev *rdev) | 325 | static int pm8607_get_voltage(struct regulator_dev *rdev) |
461 | { | 326 | { |
462 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 327 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
463 | struct pm8607_chip *chip = info->chip; | ||
464 | uint8_t val, mask; | 328 | uint8_t val, mask; |
465 | int ret; | 329 | int ret; |
466 | 330 | ||
467 | ret = pm8607_reg_read(chip, info->vol_reg); | 331 | ret = pm860x_reg_read(info->i2c, info->vol_reg); |
468 | if (ret < 0) | 332 | if (ret < 0) |
469 | return ret; | 333 | return ret; |
470 | 334 | ||
@@ -477,9 +341,8 @@ static int pm8607_get_voltage(struct regulator_dev *rdev) | |||
477 | static int pm8607_enable(struct regulator_dev *rdev) | 341 | static int pm8607_enable(struct regulator_dev *rdev) |
478 | { | 342 | { |
479 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 343 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
480 | struct pm8607_chip *chip = info->chip; | ||
481 | 344 | ||
482 | return pm8607_set_bits(chip, info->enable_reg, | 345 | return pm860x_set_bits(info->i2c, info->enable_reg, |
483 | 1 << info->enable_bit, | 346 | 1 << info->enable_bit, |
484 | 1 << info->enable_bit); | 347 | 1 << info->enable_bit); |
485 | } | 348 | } |
@@ -487,19 +350,17 @@ static int pm8607_enable(struct regulator_dev *rdev) | |||
487 | static int pm8607_disable(struct regulator_dev *rdev) | 350 | static int pm8607_disable(struct regulator_dev *rdev) |
488 | { | 351 | { |
489 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 352 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
490 | struct pm8607_chip *chip = info->chip; | ||
491 | 353 | ||
492 | return pm8607_set_bits(chip, info->enable_reg, | 354 | return pm860x_set_bits(info->i2c, info->enable_reg, |
493 | 1 << info->enable_bit, 0); | 355 | 1 << info->enable_bit, 0); |
494 | } | 356 | } |
495 | 357 | ||
496 | static int pm8607_is_enabled(struct regulator_dev *rdev) | 358 | static int pm8607_is_enabled(struct regulator_dev *rdev) |
497 | { | 359 | { |
498 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 360 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
499 | struct pm8607_chip *chip = info->chip; | ||
500 | int ret; | 361 | int ret; |
501 | 362 | ||
502 | ret = pm8607_reg_read(chip, info->enable_reg); | 363 | ret = pm860x_reg_read(info->i2c, info->enable_reg); |
503 | if (ret < 0) | 364 | if (ret < 0) |
504 | return ret; | 365 | return ret; |
505 | 366 | ||
@@ -589,8 +450,8 @@ static inline struct pm8607_regulator_info *find_regulator_info(int id) | |||
589 | 450 | ||
590 | static int __devinit pm8607_regulator_probe(struct platform_device *pdev) | 451 | static int __devinit pm8607_regulator_probe(struct platform_device *pdev) |
591 | { | 452 | { |
592 | struct pm8607_chip *chip = dev_get_drvdata(pdev->dev.parent); | 453 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
593 | struct pm8607_platform_data *pdata = chip->dev->platform_data; | 454 | struct pm860x_platform_data *pdata = chip->dev->platform_data; |
594 | struct pm8607_regulator_info *info = NULL; | 455 | struct pm8607_regulator_info *info = NULL; |
595 | 456 | ||
596 | info = find_regulator_info(pdev->id); | 457 | info = find_regulator_info(pdev->id); |
@@ -599,6 +460,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev) | |||
599 | return -EINVAL; | 460 | return -EINVAL; |
600 | } | 461 | } |
601 | 462 | ||
463 | info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | ||
602 | info->chip = chip; | 464 | info->chip = chip; |
603 | 465 | ||
604 | info->regulator = regulator_register(&info->desc, &pdev->dev, | 466 | info->regulator = regulator_register(&info->desc, &pdev->dev, |
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 834b48441829..04f2e085116a 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
@@ -94,6 +94,12 @@ config REGULATOR_MAX8660 | |||
94 | This driver controls a Maxim 8660/8661 voltage output | 94 | This driver controls a Maxim 8660/8661 voltage output |
95 | regulator via I2C bus. | 95 | regulator via I2C bus. |
96 | 96 | ||
97 | config REGULATOR_MAX8925 | ||
98 | tristate "Maxim MAX8925 Power Management IC" | ||
99 | depends on MFD_MAX8925 | ||
100 | help | ||
101 | Say y here to support the voltage regulaltor of Maxim MAX8925 PMIC. | ||
102 | |||
97 | config REGULATOR_TWL4030 | 103 | config REGULATOR_TWL4030 |
98 | bool "TI TWL4030/TWL5030/TWL6030/TPS695x0 PMIC" | 104 | bool "TI TWL4030/TWL5030/TWL6030/TPS695x0 PMIC" |
99 | depends on TWL4030_CORE | 105 | depends on TWL4030_CORE |
@@ -191,7 +197,7 @@ config REGULATOR_TPS6507X | |||
191 | 197 | ||
192 | config REGULATOR_88PM8607 | 198 | config REGULATOR_88PM8607 |
193 | bool "Marvell 88PM8607 Power regulators" | 199 | bool "Marvell 88PM8607 Power regulators" |
194 | depends on MFD_88PM8607=y | 200 | depends on MFD_88PM860X=y |
195 | help | 201 | help |
196 | This driver supports 88PM8607 voltage regulator chips. | 202 | This driver supports 88PM8607 voltage regulator chips. |
197 | 203 | ||
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index e845b66ad59c..4e7feece22d5 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o | |||
15 | obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o | 15 | obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o |
16 | obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o | 16 | obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o |
17 | obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o | 17 | obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o |
18 | obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o | ||
18 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o | 19 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o |
19 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o | 20 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o |
20 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o | 21 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o |
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c new file mode 100644 index 000000000000..67873f08ed40 --- /dev/null +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -0,0 +1,306 @@ | |||
1 | /* | ||
2 | * Regulators driver for Maxim max8925 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/regulator/driver.h> | ||
17 | #include <linux/regulator/machine.h> | ||
18 | #include <linux/mfd/max8925.h> | ||
19 | |||
20 | #define SD1_DVM_VMIN 850000 | ||
21 | #define SD1_DVM_VMAX 1000000 | ||
22 | #define SD1_DVM_STEP 50000 | ||
23 | #define SD1_DVM_SHIFT 5 /* SDCTL1 bit5 */ | ||
24 | #define SD1_DVM_EN 6 /* SDV1 bit 6 */ | ||
25 | |||
26 | struct max8925_regulator_info { | ||
27 | struct regulator_desc desc; | ||
28 | struct regulator_dev *regulator; | ||
29 | struct i2c_client *i2c; | ||
30 | struct max8925_chip *chip; | ||
31 | |||
32 | int min_uV; | ||
33 | int max_uV; | ||
34 | int step_uV; | ||
35 | int vol_reg; | ||
36 | int vol_shift; | ||
37 | int vol_nbits; | ||
38 | int enable_bit; | ||
39 | int enable_reg; | ||
40 | }; | ||
41 | |||
42 | static inline int check_range(struct max8925_regulator_info *info, | ||
43 | int min_uV, int max_uV) | ||
44 | { | ||
45 | if (min_uV < info->min_uV || min_uV > info->max_uV) | ||
46 | return -EINVAL; | ||
47 | |||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static int max8925_list_voltage(struct regulator_dev *rdev, unsigned index) | ||
52 | { | ||
53 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
54 | return info->min_uV + index * info->step_uV; | ||
55 | } | ||
56 | |||
57 | static int max8925_set_voltage(struct regulator_dev *rdev, | ||
58 | int min_uV, int max_uV) | ||
59 | { | ||
60 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
61 | unsigned char data, mask; | ||
62 | |||
63 | if (check_range(info, min_uV, max_uV)) { | ||
64 | dev_err(info->chip->dev, "invalid voltage range (%d, %d) uV\n", | ||
65 | min_uV, max_uV); | ||
66 | return -EINVAL; | ||
67 | } | ||
68 | data = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV; | ||
69 | data <<= info->vol_shift; | ||
70 | mask = ((1 << info->vol_nbits) - 1) << info->vol_shift; | ||
71 | |||
72 | return max8925_set_bits(info->i2c, info->vol_reg, mask, data); | ||
73 | } | ||
74 | |||
75 | static int max8925_get_voltage(struct regulator_dev *rdev) | ||
76 | { | ||
77 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
78 | unsigned char data, mask; | ||
79 | int ret; | ||
80 | |||
81 | ret = max8925_reg_read(info->i2c, info->vol_reg); | ||
82 | if (ret < 0) | ||
83 | return ret; | ||
84 | mask = ((1 << info->vol_nbits) - 1) << info->vol_shift; | ||
85 | data = (ret & mask) >> info->vol_shift; | ||
86 | |||
87 | return max8925_list_voltage(rdev, data); | ||
88 | } | ||
89 | |||
90 | static int max8925_enable(struct regulator_dev *rdev) | ||
91 | { | ||
92 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
93 | |||
94 | return max8925_set_bits(info->i2c, info->enable_reg, | ||
95 | 1 << info->enable_bit, | ||
96 | 1 << info->enable_bit); | ||
97 | } | ||
98 | |||
99 | static int max8925_disable(struct regulator_dev *rdev) | ||
100 | { | ||
101 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
102 | |||
103 | return max8925_set_bits(info->i2c, info->enable_reg, | ||
104 | 1 << info->enable_bit, 0); | ||
105 | } | ||
106 | |||
107 | static int max8925_is_enabled(struct regulator_dev *rdev) | ||
108 | { | ||
109 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
110 | int ret; | ||
111 | |||
112 | ret = max8925_reg_read(info->i2c, info->vol_reg); | ||
113 | if (ret < 0) | ||
114 | return ret; | ||
115 | |||
116 | return ret & (1 << info->enable_bit); | ||
117 | } | ||
118 | |||
119 | static int max8925_set_dvm_voltage(struct regulator_dev *rdev, int uV) | ||
120 | { | ||
121 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
122 | unsigned char data, mask; | ||
123 | |||
124 | if (uV < SD1_DVM_VMIN || uV > SD1_DVM_VMAX) | ||
125 | return -EINVAL; | ||
126 | |||
127 | data = (uV - SD1_DVM_VMIN + SD1_DVM_STEP - 1) / SD1_DVM_STEP; | ||
128 | data <<= SD1_DVM_SHIFT; | ||
129 | mask = 3 << SD1_DVM_SHIFT; | ||
130 | |||
131 | return max8925_set_bits(info->i2c, info->enable_reg, mask, data); | ||
132 | } | ||
133 | |||
134 | static int max8925_set_dvm_enable(struct regulator_dev *rdev) | ||
135 | { | ||
136 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
137 | |||
138 | return max8925_set_bits(info->i2c, info->vol_reg, 1 << SD1_DVM_EN, | ||
139 | 1 << SD1_DVM_EN); | ||
140 | } | ||
141 | |||
142 | static int max8925_set_dvm_disable(struct regulator_dev *rdev) | ||
143 | { | ||
144 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | ||
145 | |||
146 | return max8925_set_bits(info->i2c, info->vol_reg, 1 << SD1_DVM_EN, 0); | ||
147 | } | ||
148 | |||
149 | static struct regulator_ops max8925_regulator_sdv_ops = { | ||
150 | .set_voltage = max8925_set_voltage, | ||
151 | .get_voltage = max8925_get_voltage, | ||
152 | .enable = max8925_enable, | ||
153 | .disable = max8925_disable, | ||
154 | .is_enabled = max8925_is_enabled, | ||
155 | .set_suspend_voltage = max8925_set_dvm_voltage, | ||
156 | .set_suspend_enable = max8925_set_dvm_enable, | ||
157 | .set_suspend_disable = max8925_set_dvm_disable, | ||
158 | }; | ||
159 | |||
160 | static struct regulator_ops max8925_regulator_ldo_ops = { | ||
161 | .set_voltage = max8925_set_voltage, | ||
162 | .get_voltage = max8925_get_voltage, | ||
163 | .enable = max8925_enable, | ||
164 | .disable = max8925_disable, | ||
165 | .is_enabled = max8925_is_enabled, | ||
166 | }; | ||
167 | |||
168 | #define MAX8925_SDV(_id, min, max, step) \ | ||
169 | { \ | ||
170 | .desc = { \ | ||
171 | .name = "SDV" #_id, \ | ||
172 | .ops = &max8925_regulator_sdv_ops, \ | ||
173 | .type = REGULATOR_VOLTAGE, \ | ||
174 | .id = MAX8925_ID_SD##_id, \ | ||
175 | .owner = THIS_MODULE, \ | ||
176 | }, \ | ||
177 | .min_uV = min * 1000, \ | ||
178 | .max_uV = max * 1000, \ | ||
179 | .step_uV = step * 1000, \ | ||
180 | .vol_reg = MAX8925_SDV##_id, \ | ||
181 | .vol_shift = 0, \ | ||
182 | .vol_nbits = 6, \ | ||
183 | .enable_reg = MAX8925_SDCTL##_id, \ | ||
184 | .enable_bit = 0, \ | ||
185 | } | ||
186 | |||
187 | #define MAX8925_LDO(_id, min, max, step) \ | ||
188 | { \ | ||
189 | .desc = { \ | ||
190 | .name = "LDO" #_id, \ | ||
191 | .ops = &max8925_regulator_ldo_ops, \ | ||
192 | .type = REGULATOR_VOLTAGE, \ | ||
193 | .id = MAX8925_ID_LDO##_id, \ | ||
194 | .owner = THIS_MODULE, \ | ||
195 | }, \ | ||
196 | .min_uV = min * 1000, \ | ||
197 | .max_uV = max * 1000, \ | ||
198 | .step_uV = step * 1000, \ | ||
199 | .vol_reg = MAX8925_LDOVOUT##_id, \ | ||
200 | .vol_shift = 0, \ | ||
201 | .vol_nbits = 6, \ | ||
202 | .enable_reg = MAX8925_LDOCTL##_id, \ | ||
203 | .enable_bit = 0, \ | ||
204 | } | ||
205 | |||
206 | static struct max8925_regulator_info max8925_regulator_info[] = { | ||
207 | MAX8925_SDV(1, 637.5, 1425, 12.5), | ||
208 | MAX8925_SDV(2, 650, 2225, 25), | ||
209 | MAX8925_SDV(3, 750, 3900, 50), | ||
210 | |||
211 | MAX8925_LDO(1, 750, 3900, 50), | ||
212 | MAX8925_LDO(2, 650, 2250, 25), | ||
213 | MAX8925_LDO(3, 650, 2250, 25), | ||
214 | MAX8925_LDO(4, 750, 3900, 50), | ||
215 | MAX8925_LDO(5, 750, 3900, 50), | ||
216 | MAX8925_LDO(6, 750, 3900, 50), | ||
217 | MAX8925_LDO(7, 750, 3900, 50), | ||
218 | MAX8925_LDO(8, 750, 3900, 50), | ||
219 | MAX8925_LDO(9, 750, 3900, 50), | ||
220 | MAX8925_LDO(10, 750, 3900, 50), | ||
221 | MAX8925_LDO(11, 750, 3900, 50), | ||
222 | MAX8925_LDO(12, 750, 3900, 50), | ||
223 | MAX8925_LDO(13, 750, 3900, 50), | ||
224 | MAX8925_LDO(14, 750, 3900, 50), | ||
225 | MAX8925_LDO(15, 750, 3900, 50), | ||
226 | MAX8925_LDO(16, 750, 3900, 50), | ||
227 | MAX8925_LDO(17, 650, 2250, 25), | ||
228 | MAX8925_LDO(18, 650, 2250, 25), | ||
229 | MAX8925_LDO(19, 750, 3900, 50), | ||
230 | MAX8925_LDO(20, 750, 3900, 50), | ||
231 | }; | ||
232 | |||
233 | static inline struct max8925_regulator_info *find_regulator_info(int id) | ||
234 | { | ||
235 | struct max8925_regulator_info *ri; | ||
236 | int i; | ||
237 | |||
238 | for (i = 0; i < ARRAY_SIZE(max8925_regulator_info); i++) { | ||
239 | ri = &max8925_regulator_info[i]; | ||
240 | if (ri->desc.id == id) | ||
241 | return ri; | ||
242 | } | ||
243 | return NULL; | ||
244 | } | ||
245 | |||
246 | static int __devinit max8925_regulator_probe(struct platform_device *pdev) | ||
247 | { | ||
248 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
249 | struct max8925_platform_data *pdata = chip->dev->platform_data; | ||
250 | struct max8925_regulator_info *ri = NULL; | ||
251 | struct regulator_dev *rdev; | ||
252 | |||
253 | ri = find_regulator_info(pdev->id); | ||
254 | if (ri == NULL) { | ||
255 | dev_err(&pdev->dev, "invalid regulator ID specified\n"); | ||
256 | return -EINVAL; | ||
257 | } | ||
258 | ri->i2c = chip->i2c; | ||
259 | ri->chip = chip; | ||
260 | |||
261 | rdev = regulator_register(&ri->desc, &pdev->dev, | ||
262 | pdata->regulator[pdev->id], ri); | ||
263 | if (IS_ERR(rdev)) { | ||
264 | dev_err(&pdev->dev, "failed to register regulator %s\n", | ||
265 | ri->desc.name); | ||
266 | return PTR_ERR(rdev); | ||
267 | } | ||
268 | |||
269 | platform_set_drvdata(pdev, rdev); | ||
270 | return 0; | ||
271 | } | ||
272 | |||
273 | static int __devexit max8925_regulator_remove(struct platform_device *pdev) | ||
274 | { | ||
275 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | ||
276 | |||
277 | regulator_unregister(rdev); | ||
278 | return 0; | ||
279 | } | ||
280 | |||
281 | static struct platform_driver max8925_regulator_driver = { | ||
282 | .driver = { | ||
283 | .name = "max8925-regulator", | ||
284 | .owner = THIS_MODULE, | ||
285 | }, | ||
286 | .probe = max8925_regulator_probe, | ||
287 | .remove = __devexit_p(max8925_regulator_remove), | ||
288 | }; | ||
289 | |||
290 | static int __init max8925_regulator_init(void) | ||
291 | { | ||
292 | return platform_driver_register(&max8925_regulator_driver); | ||
293 | } | ||
294 | subsys_initcall(max8925_regulator_init); | ||
295 | |||
296 | static void __exit max8925_regulator_exit(void) | ||
297 | { | ||
298 | platform_driver_unregister(&max8925_regulator_driver); | ||
299 | } | ||
300 | module_exit(max8925_regulator_exit); | ||
301 | |||
302 | MODULE_LICENSE("GPL"); | ||
303 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
304 | MODULE_DESCRIPTION("Regulator Driver for Maxim 8925 PMIC"); | ||
305 | MODULE_ALIAS("platform:max8925-regulator"); | ||
306 | |||
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 94227dd6ba7b..723cd1fb4867 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1453,7 +1453,7 @@ static int wm8350_regulator_remove(struct platform_device *pdev) | |||
1453 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | 1453 | struct regulator_dev *rdev = platform_get_drvdata(pdev); |
1454 | struct wm8350 *wm8350 = rdev_get_drvdata(rdev); | 1454 | struct wm8350 *wm8350 = rdev_get_drvdata(rdev); |
1455 | 1455 | ||
1456 | wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq); | 1456 | wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev); |
1457 | 1457 | ||
1458 | regulator_unregister(rdev); | 1458 | regulator_unregister(rdev); |
1459 | 1459 | ||
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 2bb8a8b7ffaf..6a1303759432 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -175,6 +175,16 @@ config RTC_DRV_MAX6900 | |||
175 | This driver can also be built as a module. If so, the module | 175 | This driver can also be built as a module. If so, the module |
176 | will be called rtc-max6900. | 176 | will be called rtc-max6900. |
177 | 177 | ||
178 | config RTC_DRV_MAX8925 | ||
179 | tristate "Maxim MAX8925" | ||
180 | depends on MFD_MAX8925 | ||
181 | help | ||
182 | If you say yes here you will get support for the | ||
183 | RTC of Maxim MAX8925 PMIC. | ||
184 | |||
185 | This driver can also be built as a module. If so, the module | ||
186 | will be called rtc-max8925. | ||
187 | |||
178 | config RTC_DRV_RS5C372 | 188 | config RTC_DRV_RS5C372 |
179 | tristate "Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A" | 189 | tristate "Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A" |
180 | help | 190 | help |
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index b7148afb8f55..44ef194a9573 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile | |||
@@ -52,6 +52,7 @@ obj-$(CONFIG_RTC_DRV_M48T59) += rtc-m48t59.o | |||
52 | obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o | 52 | obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o |
53 | obj-$(CONFIG_RTC_MXC) += rtc-mxc.o | 53 | obj-$(CONFIG_RTC_MXC) += rtc-mxc.o |
54 | obj-$(CONFIG_RTC_DRV_MAX6900) += rtc-max6900.o | 54 | obj-$(CONFIG_RTC_DRV_MAX6900) += rtc-max6900.o |
55 | obj-$(CONFIG_RTC_DRV_MAX8925) += rtc-max8925.o | ||
55 | obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o | 56 | obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o |
56 | obj-$(CONFIG_RTC_DRV_MC13783) += rtc-mc13783.o | 57 | obj-$(CONFIG_RTC_DRV_MC13783) += rtc-mc13783.o |
57 | obj-$(CONFIG_RTC_DRV_MSM6242) += rtc-msm6242.o | 58 | obj-$(CONFIG_RTC_DRV_MSM6242) += rtc-msm6242.o |
diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c new file mode 100644 index 000000000000..acdbb1760187 --- /dev/null +++ b/drivers/rtc/rtc-max8925.c | |||
@@ -0,0 +1,314 @@ | |||
1 | /* | ||
2 | * RTC driver for Maxim MAX8925 | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/rtc.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mfd/max8925.h> | ||
17 | |||
18 | enum { | ||
19 | RTC_SEC = 0, | ||
20 | RTC_MIN, | ||
21 | RTC_HOUR, | ||
22 | RTC_WEEKDAY, | ||
23 | RTC_DATE, | ||
24 | RTC_MONTH, | ||
25 | RTC_YEAR1, | ||
26 | RTC_YEAR2, | ||
27 | }; | ||
28 | |||
29 | #define MAX8925_RTC_SEC 0x00 | ||
30 | #define MAX8925_RTC_MIN 0x01 | ||
31 | #define MAX8925_RTC_HOUR 0x02 | ||
32 | #define MAX8925_RTC_WEEKDAY 0x03 | ||
33 | #define MAX8925_RTC_DATE 0x04 | ||
34 | #define MAX8925_RTC_MONTH 0x05 | ||
35 | #define MAX8925_RTC_YEAR1 0x06 | ||
36 | #define MAX8925_RTC_YEAR2 0x07 | ||
37 | #define MAX8925_ALARM0_SEC 0x08 | ||
38 | #define MAX8925_ALARM0_MIN 0x09 | ||
39 | #define MAX8925_ALARM0_HOUR 0x0a | ||
40 | #define MAX8925_ALARM0_WEEKDAY 0x0b | ||
41 | #define MAX8925_ALARM0_DATE 0x0c | ||
42 | #define MAX8925_ALARM0_MON 0x0d | ||
43 | #define MAX8925_ALARM0_YEAR1 0x0e | ||
44 | #define MAX8925_ALARM0_YEAR2 0x0f | ||
45 | #define MAX8925_ALARM1_SEC 0x10 | ||
46 | #define MAX8925_ALARM1_MIN 0x11 | ||
47 | #define MAX8925_ALARM1_HOUR 0x12 | ||
48 | #define MAX8925_ALARM1_WEEKDAY 0x13 | ||
49 | #define MAX8925_ALARM1_DATE 0x14 | ||
50 | #define MAX8925_ALARM1_MON 0x15 | ||
51 | #define MAX8925_ALARM1_YEAR1 0x16 | ||
52 | #define MAX8925_ALARM1_YEAR2 0x17 | ||
53 | #define MAX8925_RTC_CNTL 0x1b | ||
54 | #define MAX8925_RTC_STATUS 0x20 | ||
55 | |||
56 | #define TIME_NUM 8 | ||
57 | #define ALARM_1SEC (1 << 7) | ||
58 | #define HOUR_12 (1 << 7) | ||
59 | #define HOUR_AM_PM (1 << 5) | ||
60 | #define ALARM0_IRQ (1 << 3) | ||
61 | #define ALARM1_IRQ (1 << 2) | ||
62 | #define ALARM0_STATUS (1 << 2) | ||
63 | #define ALARM1_STATUS (1 << 1) | ||
64 | |||
65 | |||
66 | struct max8925_rtc_info { | ||
67 | struct rtc_device *rtc_dev; | ||
68 | struct max8925_chip *chip; | ||
69 | struct i2c_client *rtc; | ||
70 | struct device *dev; | ||
71 | }; | ||
72 | |||
73 | static irqreturn_t rtc_update_handler(int irq, void *data) | ||
74 | { | ||
75 | struct max8925_rtc_info *info = (struct max8925_rtc_info *)data; | ||
76 | |||
77 | /* disable ALARM0 except for 1SEC alarm */ | ||
78 | max8925_set_bits(info->rtc, MAX8925_ALARM0_CNTL, 0x7f, 0); | ||
79 | rtc_update_irq(info->rtc_dev, 1, RTC_IRQF | RTC_AF); | ||
80 | return IRQ_HANDLED; | ||
81 | } | ||
82 | |||
83 | static int tm_calc(struct rtc_time *tm, unsigned char *buf, int len) | ||
84 | { | ||
85 | if (len < TIME_NUM) | ||
86 | return -EINVAL; | ||
87 | tm->tm_year = (buf[RTC_YEAR2] >> 4) * 1000 | ||
88 | + (buf[RTC_YEAR2] & 0xf) * 100 | ||
89 | + (buf[RTC_YEAR1] >> 4) * 10 | ||
90 | + (buf[RTC_YEAR1] & 0xf); | ||
91 | tm->tm_year -= 1900; | ||
92 | tm->tm_mon = ((buf[RTC_MONTH] >> 4) & 0x01) * 10 | ||
93 | + (buf[RTC_MONTH] & 0x0f); | ||
94 | tm->tm_mday = ((buf[RTC_DATE] >> 4) & 0x03) * 10 | ||
95 | + (buf[RTC_DATE] & 0x0f); | ||
96 | tm->tm_wday = buf[RTC_WEEKDAY] & 0x07; | ||
97 | if (buf[RTC_HOUR] & HOUR_12) { | ||
98 | tm->tm_hour = ((buf[RTC_HOUR] >> 4) & 0x1) * 10 | ||
99 | + (buf[RTC_HOUR] & 0x0f); | ||
100 | if (buf[RTC_HOUR] & HOUR_AM_PM) | ||
101 | tm->tm_hour += 12; | ||
102 | } else | ||
103 | tm->tm_hour = ((buf[RTC_HOUR] >> 4) & 0x03) * 10 | ||
104 | + (buf[RTC_HOUR] & 0x0f); | ||
105 | tm->tm_min = ((buf[RTC_MIN] >> 4) & 0x7) * 10 | ||
106 | + (buf[RTC_MIN] & 0x0f); | ||
107 | tm->tm_sec = ((buf[RTC_SEC] >> 4) & 0x7) * 10 | ||
108 | + (buf[RTC_SEC] & 0x0f); | ||
109 | return 0; | ||
110 | } | ||
111 | |||
112 | static int data_calc(unsigned char *buf, struct rtc_time *tm, int len) | ||
113 | { | ||
114 | unsigned char high, low; | ||
115 | |||
116 | if (len < TIME_NUM) | ||
117 | return -EINVAL; | ||
118 | |||
119 | high = (tm->tm_year + 1900) / 1000; | ||
120 | low = (tm->tm_year + 1900) / 100; | ||
121 | low = low - high * 10; | ||
122 | buf[RTC_YEAR2] = (high << 4) + low; | ||
123 | high = (tm->tm_year + 1900) / 10; | ||
124 | low = tm->tm_year + 1900; | ||
125 | low = low - high * 10; | ||
126 | high = high - (high / 10) * 10; | ||
127 | buf[RTC_YEAR1] = (high << 4) + low; | ||
128 | high = tm->tm_mon / 10; | ||
129 | low = tm->tm_mon; | ||
130 | low = low - high * 10; | ||
131 | buf[RTC_MONTH] = (high << 4) + low; | ||
132 | high = tm->tm_mday / 10; | ||
133 | low = tm->tm_mday; | ||
134 | low = low - high * 10; | ||
135 | buf[RTC_DATE] = (high << 4) + low; | ||
136 | buf[RTC_WEEKDAY] = tm->tm_wday; | ||
137 | high = tm->tm_hour / 10; | ||
138 | low = tm->tm_hour; | ||
139 | low = low - high * 10; | ||
140 | buf[RTC_HOUR] = (high << 4) + low; | ||
141 | high = tm->tm_min / 10; | ||
142 | low = tm->tm_min; | ||
143 | low = low - high * 10; | ||
144 | buf[RTC_MIN] = (high << 4) + low; | ||
145 | high = tm->tm_sec / 10; | ||
146 | low = tm->tm_sec; | ||
147 | low = low - high * 10; | ||
148 | buf[RTC_SEC] = (high << 4) + low; | ||
149 | return 0; | ||
150 | } | ||
151 | |||
152 | static int max8925_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
153 | { | ||
154 | struct max8925_rtc_info *info = dev_get_drvdata(dev); | ||
155 | unsigned char buf[TIME_NUM]; | ||
156 | int ret; | ||
157 | |||
158 | ret = max8925_bulk_read(info->rtc, MAX8925_RTC_SEC, TIME_NUM, buf); | ||
159 | if (ret < 0) | ||
160 | goto out; | ||
161 | ret = tm_calc(tm, buf, TIME_NUM); | ||
162 | out: | ||
163 | return ret; | ||
164 | } | ||
165 | |||
166 | static int max8925_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
167 | { | ||
168 | struct max8925_rtc_info *info = dev_get_drvdata(dev); | ||
169 | unsigned char buf[TIME_NUM]; | ||
170 | int ret; | ||
171 | |||
172 | ret = data_calc(buf, tm, TIME_NUM); | ||
173 | if (ret < 0) | ||
174 | goto out; | ||
175 | ret = max8925_bulk_write(info->rtc, MAX8925_RTC_SEC, TIME_NUM, buf); | ||
176 | out: | ||
177 | return ret; | ||
178 | } | ||
179 | |||
180 | static int max8925_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | ||
181 | { | ||
182 | struct max8925_rtc_info *info = dev_get_drvdata(dev); | ||
183 | unsigned char buf[TIME_NUM]; | ||
184 | int ret; | ||
185 | |||
186 | ret = max8925_bulk_read(info->rtc, MAX8925_ALARM0_SEC, TIME_NUM, buf); | ||
187 | if (ret < 0) | ||
188 | goto out; | ||
189 | ret = tm_calc(&alrm->time, buf, TIME_NUM); | ||
190 | if (ret < 0) | ||
191 | goto out; | ||
192 | ret = max8925_reg_read(info->rtc, MAX8925_RTC_IRQ_MASK); | ||
193 | if (ret < 0) | ||
194 | goto out; | ||
195 | if ((ret & ALARM0_IRQ) == 0) | ||
196 | alrm->enabled = 1; | ||
197 | else | ||
198 | alrm->enabled = 0; | ||
199 | ret = max8925_reg_read(info->rtc, MAX8925_RTC_STATUS); | ||
200 | if (ret < 0) | ||
201 | goto out; | ||
202 | if (ret & ALARM0_STATUS) | ||
203 | alrm->pending = 1; | ||
204 | else | ||
205 | alrm->pending = 0; | ||
206 | out: | ||
207 | return ret; | ||
208 | } | ||
209 | |||
210 | static int max8925_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | ||
211 | { | ||
212 | struct max8925_rtc_info *info = dev_get_drvdata(dev); | ||
213 | unsigned char buf[TIME_NUM]; | ||
214 | int ret; | ||
215 | |||
216 | ret = data_calc(buf, &alrm->time, TIME_NUM); | ||
217 | if (ret < 0) | ||
218 | goto out; | ||
219 | ret = max8925_bulk_write(info->rtc, MAX8925_ALARM0_SEC, TIME_NUM, buf); | ||
220 | if (ret < 0) | ||
221 | goto out; | ||
222 | /* only enable alarm on year/month/day/hour/min/sec */ | ||
223 | ret = max8925_reg_write(info->rtc, MAX8925_ALARM0_CNTL, 0x77); | ||
224 | if (ret < 0) | ||
225 | goto out; | ||
226 | out: | ||
227 | return ret; | ||
228 | } | ||
229 | |||
230 | static const struct rtc_class_ops max8925_rtc_ops = { | ||
231 | .read_time = max8925_rtc_read_time, | ||
232 | .set_time = max8925_rtc_set_time, | ||
233 | .read_alarm = max8925_rtc_read_alarm, | ||
234 | .set_alarm = max8925_rtc_set_alarm, | ||
235 | }; | ||
236 | |||
237 | static int __devinit max8925_rtc_probe(struct platform_device *pdev) | ||
238 | { | ||
239 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
240 | struct max8925_rtc_info *info; | ||
241 | int irq, ret; | ||
242 | |||
243 | info = kzalloc(sizeof(struct max8925_rtc_info), GFP_KERNEL); | ||
244 | if (!info) | ||
245 | return -ENOMEM; | ||
246 | info->chip = chip; | ||
247 | info->rtc = chip->rtc; | ||
248 | info->dev = &pdev->dev; | ||
249 | irq = chip->irq_base + MAX8925_IRQ_RTC_ALARM0; | ||
250 | |||
251 | ret = request_threaded_irq(irq, NULL, rtc_update_handler, | ||
252 | IRQF_ONESHOT, "rtc-alarm0", info); | ||
253 | if (ret < 0) { | ||
254 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", | ||
255 | irq, ret); | ||
256 | goto out_irq; | ||
257 | } | ||
258 | |||
259 | info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev, | ||
260 | &max8925_rtc_ops, THIS_MODULE); | ||
261 | ret = PTR_ERR(info->rtc_dev); | ||
262 | if (IS_ERR(info->rtc_dev)) { | ||
263 | dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret); | ||
264 | goto out_rtc; | ||
265 | } | ||
266 | |||
267 | dev_set_drvdata(&pdev->dev, info); | ||
268 | platform_set_drvdata(pdev, info); | ||
269 | |||
270 | return 0; | ||
271 | out_rtc: | ||
272 | free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); | ||
273 | out_irq: | ||
274 | kfree(info); | ||
275 | return ret; | ||
276 | } | ||
277 | |||
278 | static int __devexit max8925_rtc_remove(struct platform_device *pdev) | ||
279 | { | ||
280 | struct max8925_rtc_info *info = platform_get_drvdata(pdev); | ||
281 | |||
282 | if (info) { | ||
283 | free_irq(info->chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); | ||
284 | rtc_device_unregister(info->rtc_dev); | ||
285 | kfree(info); | ||
286 | } | ||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | static struct platform_driver max8925_rtc_driver = { | ||
291 | .driver = { | ||
292 | .name = "max8925-rtc", | ||
293 | .owner = THIS_MODULE, | ||
294 | }, | ||
295 | .probe = max8925_rtc_probe, | ||
296 | .remove = __devexit_p(max8925_rtc_remove), | ||
297 | }; | ||
298 | |||
299 | static int __init max8925_rtc_init(void) | ||
300 | { | ||
301 | return platform_driver_register(&max8925_rtc_driver); | ||
302 | } | ||
303 | module_init(max8925_rtc_init); | ||
304 | |||
305 | static void __exit max8925_rtc_exit(void) | ||
306 | { | ||
307 | platform_driver_unregister(&max8925_rtc_driver); | ||
308 | } | ||
309 | module_exit(max8925_rtc_exit); | ||
310 | |||
311 | MODULE_DESCRIPTION("Maxim MAX8925 RTC driver"); | ||
312 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
313 | MODULE_LICENSE("GPL"); | ||
314 | |||
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c index f1e440521c54..3d0dc76b38af 100644 --- a/drivers/rtc/rtc-wm8350.c +++ b/drivers/rtc/rtc-wm8350.c | |||
@@ -307,11 +307,18 @@ static int wm8350_rtc_update_irq_enable(struct device *dev, | |||
307 | { | 307 | { |
308 | struct wm8350 *wm8350 = dev_get_drvdata(dev); | 308 | struct wm8350 *wm8350 = dev_get_drvdata(dev); |
309 | 309 | ||
310 | /* Suppress duplicate changes since genirq nests enable and | ||
311 | * disable calls. */ | ||
312 | if (enabled == wm8350->rtc.update_enabled) | ||
313 | return 0; | ||
314 | |||
310 | if (enabled) | 315 | if (enabled) |
311 | wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC); | 316 | wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC); |
312 | else | 317 | else |
313 | wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); | 318 | wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); |
314 | 319 | ||
320 | wm8350->rtc.update_enabled = enabled; | ||
321 | |||
315 | return 0; | 322 | return 0; |
316 | } | 323 | } |
317 | 324 | ||
@@ -478,8 +485,8 @@ static int __devexit wm8350_rtc_remove(struct platform_device *pdev) | |||
478 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); | 485 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); |
479 | struct wm8350_rtc *wm_rtc = &wm8350->rtc; | 486 | struct wm8350_rtc *wm_rtc = &wm8350->rtc; |
480 | 487 | ||
481 | wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC); | 488 | wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350); |
482 | wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM); | 489 | wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM, wm8350); |
483 | 490 | ||
484 | rtc_device_unregister(wm_rtc->rtc); | 491 | rtc_device_unregister(wm_rtc->rtc); |
485 | 492 | ||
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c new file mode 100644 index 000000000000..b8f705cca438 --- /dev/null +++ b/drivers/video/backlight/88pm860x_bl.c | |||
@@ -0,0 +1,304 @@ | |||
1 | /* | ||
2 | * Backlight driver for Marvell Semiconductor 88PM8606 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/fb.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/backlight.h> | ||
18 | #include <linux/mfd/88pm860x.h> | ||
19 | |||
20 | #define MAX_BRIGHTNESS (0xFF) | ||
21 | #define MIN_BRIGHTNESS (0) | ||
22 | |||
23 | #define CURRENT_MASK (0x1F << 1) | ||
24 | |||
25 | struct pm860x_backlight_data { | ||
26 | struct pm860x_chip *chip; | ||
27 | struct i2c_client *i2c; | ||
28 | int current_brightness; | ||
29 | int port; | ||
30 | int pwm; | ||
31 | int iset; | ||
32 | }; | ||
33 | |||
34 | static inline int wled_a(int port) | ||
35 | { | ||
36 | int ret; | ||
37 | |||
38 | ret = ((port - PM8606_BACKLIGHT1) << 1) + 2; | ||
39 | return ret; | ||
40 | } | ||
41 | |||
42 | static inline int wled_b(int port) | ||
43 | { | ||
44 | int ret; | ||
45 | |||
46 | ret = ((port - PM8606_BACKLIGHT1) << 1) + 3; | ||
47 | return ret; | ||
48 | } | ||
49 | |||
50 | /* WLED2 & WLED3 share the same IDC */ | ||
51 | static inline int wled_idc(int port) | ||
52 | { | ||
53 | int ret; | ||
54 | |||
55 | switch (port) { | ||
56 | case PM8606_BACKLIGHT1: | ||
57 | case PM8606_BACKLIGHT2: | ||
58 | ret = ((port - PM8606_BACKLIGHT1) << 1) + 3; | ||
59 | break; | ||
60 | case PM8606_BACKLIGHT3: | ||
61 | default: | ||
62 | ret = ((port - PM8606_BACKLIGHT2) << 1) + 3; | ||
63 | break; | ||
64 | } | ||
65 | return ret; | ||
66 | } | ||
67 | |||
68 | static int pm860x_backlight_set(struct backlight_device *bl, int brightness) | ||
69 | { | ||
70 | struct pm860x_backlight_data *data = bl_get_data(bl); | ||
71 | struct pm860x_chip *chip = data->chip; | ||
72 | unsigned char value; | ||
73 | int ret; | ||
74 | |||
75 | if (brightness > MAX_BRIGHTNESS) | ||
76 | value = MAX_BRIGHTNESS; | ||
77 | else | ||
78 | value = brightness; | ||
79 | |||
80 | ret = pm860x_reg_write(data->i2c, wled_a(data->port), value); | ||
81 | if (ret < 0) | ||
82 | goto out; | ||
83 | |||
84 | if ((data->current_brightness == 0) && brightness) { | ||
85 | if (data->iset) { | ||
86 | ret = pm860x_set_bits(data->i2c, wled_idc(data->port), | ||
87 | CURRENT_MASK, data->iset); | ||
88 | if (ret < 0) | ||
89 | goto out; | ||
90 | } | ||
91 | if (data->pwm) { | ||
92 | ret = pm860x_set_bits(data->i2c, PM8606_PWM, | ||
93 | PM8606_PWM_FREQ_MASK, data->pwm); | ||
94 | if (ret < 0) | ||
95 | goto out; | ||
96 | } | ||
97 | if (brightness == MAX_BRIGHTNESS) { | ||
98 | /* set WLED_ON bit as 100% */ | ||
99 | ret = pm860x_set_bits(data->i2c, wled_b(data->port), | ||
100 | PM8606_WLED_ON, PM8606_WLED_ON); | ||
101 | } | ||
102 | } else { | ||
103 | if (brightness == MAX_BRIGHTNESS) { | ||
104 | /* set WLED_ON bit as 100% */ | ||
105 | ret = pm860x_set_bits(data->i2c, wled_b(data->port), | ||
106 | PM8606_WLED_ON, PM8606_WLED_ON); | ||
107 | } else { | ||
108 | /* clear WLED_ON bit since it's not 100% */ | ||
109 | ret = pm860x_set_bits(data->i2c, wled_b(data->port), | ||
110 | PM8606_WLED_ON, 0); | ||
111 | } | ||
112 | } | ||
113 | if (ret < 0) | ||
114 | goto out; | ||
115 | |||
116 | dev_dbg(chip->dev, "set brightness %d\n", value); | ||
117 | data->current_brightness = value; | ||
118 | return 0; | ||
119 | out: | ||
120 | dev_dbg(chip->dev, "set brightness %d failure with return " | ||
121 | "value:%d\n", value, ret); | ||
122 | return ret; | ||
123 | } | ||
124 | |||
125 | static int pm860x_backlight_update_status(struct backlight_device *bl) | ||
126 | { | ||
127 | int brightness = bl->props.brightness; | ||
128 | |||
129 | if (bl->props.power != FB_BLANK_UNBLANK) | ||
130 | brightness = 0; | ||
131 | |||
132 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
133 | brightness = 0; | ||
134 | |||
135 | if (bl->props.state & BL_CORE_SUSPENDED) | ||
136 | brightness = 0; | ||
137 | |||
138 | return pm860x_backlight_set(bl, brightness); | ||
139 | } | ||
140 | |||
141 | static int pm860x_backlight_get_brightness(struct backlight_device *bl) | ||
142 | { | ||
143 | struct pm860x_backlight_data *data = bl_get_data(bl); | ||
144 | struct pm860x_chip *chip = data->chip; | ||
145 | int ret; | ||
146 | |||
147 | ret = pm860x_reg_read(data->i2c, wled_a(data->port)); | ||
148 | if (ret < 0) | ||
149 | goto out; | ||
150 | data->current_brightness = ret; | ||
151 | dev_dbg(chip->dev, "get brightness %d\n", data->current_brightness); | ||
152 | return data->current_brightness; | ||
153 | out: | ||
154 | return -EINVAL; | ||
155 | } | ||
156 | |||
157 | static struct backlight_ops pm860x_backlight_ops = { | ||
158 | .options = BL_CORE_SUSPENDRESUME, | ||
159 | .update_status = pm860x_backlight_update_status, | ||
160 | .get_brightness = pm860x_backlight_get_brightness, | ||
161 | }; | ||
162 | |||
163 | static int __check_device(struct pm860x_backlight_pdata *pdata, char *name) | ||
164 | { | ||
165 | struct pm860x_backlight_pdata *p = pdata; | ||
166 | int ret = -EINVAL; | ||
167 | |||
168 | while (p && p->id) { | ||
169 | if ((p->id != PM8606_ID_BACKLIGHT) || (p->flags < 0)) | ||
170 | break; | ||
171 | |||
172 | if (!strncmp(name, pm860x_backlight_name[p->flags], | ||
173 | MFD_NAME_SIZE)) { | ||
174 | ret = (int)p->flags; | ||
175 | break; | ||
176 | } | ||
177 | p++; | ||
178 | } | ||
179 | return ret; | ||
180 | } | ||
181 | |||
182 | static int pm860x_backlight_probe(struct platform_device *pdev) | ||
183 | { | ||
184 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
185 | struct pm860x_platform_data *pm860x_pdata; | ||
186 | struct pm860x_backlight_pdata *pdata = NULL; | ||
187 | struct pm860x_backlight_data *data; | ||
188 | struct backlight_device *bl; | ||
189 | struct resource *res; | ||
190 | unsigned char value; | ||
191 | char name[MFD_NAME_SIZE]; | ||
192 | int ret; | ||
193 | |||
194 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | ||
195 | if (res == NULL) { | ||
196 | dev_err(&pdev->dev, "No I/O resource!\n"); | ||
197 | return -EINVAL; | ||
198 | } | ||
199 | |||
200 | if (pdev->dev.parent->platform_data) { | ||
201 | pm860x_pdata = pdev->dev.parent->platform_data; | ||
202 | pdata = pm860x_pdata->backlight; | ||
203 | } | ||
204 | if (pdata == NULL) { | ||
205 | dev_err(&pdev->dev, "platform data isn't assigned to " | ||
206 | "backlight\n"); | ||
207 | return -EINVAL; | ||
208 | } | ||
209 | |||
210 | data = kzalloc(sizeof(struct pm860x_backlight_data), GFP_KERNEL); | ||
211 | if (data == NULL) | ||
212 | return -ENOMEM; | ||
213 | strncpy(name, res->name, MFD_NAME_SIZE); | ||
214 | data->chip = chip; | ||
215 | data->i2c = (chip->id == CHIP_PM8606) ? chip->client \ | ||
216 | : chip->companion; | ||
217 | data->current_brightness = MAX_BRIGHTNESS; | ||
218 | data->pwm = pdata->pwm; | ||
219 | data->iset = pdata->iset; | ||
220 | data->port = __check_device(pdata, name); | ||
221 | if (data->port < 0) { | ||
222 | dev_err(&pdev->dev, "wrong platform data is assigned"); | ||
223 | return -EINVAL; | ||
224 | } | ||
225 | |||
226 | bl = backlight_device_register(name, &pdev->dev, data, | ||
227 | &pm860x_backlight_ops); | ||
228 | if (IS_ERR(bl)) { | ||
229 | dev_err(&pdev->dev, "failed to register backlight\n"); | ||
230 | kfree(data); | ||
231 | return PTR_ERR(bl); | ||
232 | } | ||
233 | bl->props.max_brightness = MAX_BRIGHTNESS; | ||
234 | bl->props.brightness = MAX_BRIGHTNESS; | ||
235 | |||
236 | platform_set_drvdata(pdev, bl); | ||
237 | |||
238 | /* Enable reference VSYS */ | ||
239 | ret = pm860x_reg_read(data->i2c, PM8606_VSYS); | ||
240 | if (ret < 0) | ||
241 | goto out; | ||
242 | if ((ret & PM8606_VSYS_EN) == 0) { | ||
243 | value = ret | PM8606_VSYS_EN; | ||
244 | ret = pm860x_reg_write(data->i2c, PM8606_VSYS, value); | ||
245 | if (ret < 0) | ||
246 | goto out; | ||
247 | } | ||
248 | /* Enable reference OSC */ | ||
249 | ret = pm860x_reg_read(data->i2c, PM8606_MISC); | ||
250 | if (ret < 0) | ||
251 | goto out; | ||
252 | if ((ret & PM8606_MISC_OSC_EN) == 0) { | ||
253 | value = ret | PM8606_MISC_OSC_EN; | ||
254 | ret = pm860x_reg_write(data->i2c, PM8606_MISC, value); | ||
255 | if (ret < 0) | ||
256 | goto out; | ||
257 | } | ||
258 | /* read current backlight */ | ||
259 | ret = pm860x_backlight_get_brightness(bl); | ||
260 | if (ret < 0) | ||
261 | goto out; | ||
262 | |||
263 | backlight_update_status(bl); | ||
264 | return 0; | ||
265 | out: | ||
266 | kfree(data); | ||
267 | return ret; | ||
268 | } | ||
269 | |||
270 | static int pm860x_backlight_remove(struct platform_device *pdev) | ||
271 | { | ||
272 | struct backlight_device *bl = platform_get_drvdata(pdev); | ||
273 | struct pm860x_backlight_data *data = bl_get_data(bl); | ||
274 | |||
275 | backlight_device_unregister(bl); | ||
276 | kfree(data); | ||
277 | return 0; | ||
278 | } | ||
279 | |||
280 | static struct platform_driver pm860x_backlight_driver = { | ||
281 | .driver = { | ||
282 | .name = "88pm860x-backlight", | ||
283 | .owner = THIS_MODULE, | ||
284 | }, | ||
285 | .probe = pm860x_backlight_probe, | ||
286 | .remove = pm860x_backlight_remove, | ||
287 | }; | ||
288 | |||
289 | static int __init pm860x_backlight_init(void) | ||
290 | { | ||
291 | return platform_driver_register(&pm860x_backlight_driver); | ||
292 | } | ||
293 | module_init(pm860x_backlight_init); | ||
294 | |||
295 | static void __exit pm860x_backlight_exit(void) | ||
296 | { | ||
297 | platform_driver_unregister(&pm860x_backlight_driver); | ||
298 | } | ||
299 | module_exit(pm860x_backlight_exit); | ||
300 | |||
301 | MODULE_DESCRIPTION("Backlight Driver for Marvell Semiconductor 88PM8606"); | ||
302 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
303 | MODULE_LICENSE("GPL"); | ||
304 | MODULE_ALIAS("platform:88pm860x-backlight"); | ||
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 09bfa9662e4d..0c77fc610212 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -212,6 +212,13 @@ config BACKLIGHT_DA903X | |||
212 | If you have a LCD backlight connected to the WLED output of DA9030 | 212 | If you have a LCD backlight connected to the WLED output of DA9030 |
213 | or DA9034 WLED output, say Y here to enable this driver. | 213 | or DA9034 WLED output, say Y here to enable this driver. |
214 | 214 | ||
215 | config BACKLIGHT_MAX8925 | ||
216 | tristate "Backlight driver for MAX8925" | ||
217 | depends on BACKLIGHT_CLASS_DEVICE && MFD_MAX8925 | ||
218 | help | ||
219 | If you have a LCD backlight connected to the WLED output of MAX8925 | ||
220 | WLED output, say Y here to enable this driver. | ||
221 | |||
215 | config BACKLIGHT_MBP_NVIDIA | 222 | config BACKLIGHT_MBP_NVIDIA |
216 | tristate "MacBook Pro Nvidia Backlight Driver" | 223 | tristate "MacBook Pro Nvidia Backlight Driver" |
217 | depends on BACKLIGHT_CLASS_DEVICE && X86 | 224 | depends on BACKLIGHT_CLASS_DEVICE && X86 |
@@ -262,3 +269,9 @@ config BACKLIGHT_ADP5520 | |||
262 | To compile this driver as a module, choose M here: the module will | 269 | To compile this driver as a module, choose M here: the module will |
263 | be called adp5520_bl. | 270 | be called adp5520_bl. |
264 | 271 | ||
272 | config BACKLIGHT_88PM860X | ||
273 | tristate "Backlight Driver for 88PM8606 using WLED" | ||
274 | depends on BACKLIGHT_CLASS_DEVICE && MFD_88PM860X | ||
275 | help | ||
276 | Say Y to enable the backlight driver for Marvell 88PM8606. | ||
277 | |||
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 9a405548874c..6c704d41462d 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile | |||
@@ -22,10 +22,12 @@ obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o | |||
22 | obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o | 22 | obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o |
23 | obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o | 23 | obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o |
24 | obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o | 24 | obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o |
25 | obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o | ||
25 | obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o | 26 | obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o |
26 | obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o | 27 | obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o |
27 | obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o | 28 | obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o |
28 | obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o | 29 | obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o |
29 | obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o | 30 | obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o |
30 | obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o | 31 | obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o |
32 | obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o | ||
31 | 33 | ||
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c new file mode 100644 index 000000000000..c267069a52a3 --- /dev/null +++ b/drivers/video/backlight/max8925_bl.c | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * Backlight driver for Maxim MAX8925 | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/fb.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/backlight.h> | ||
18 | #include <linux/mfd/max8925.h> | ||
19 | |||
20 | #define MAX_BRIGHTNESS (0xff) | ||
21 | #define MIN_BRIGHTNESS (0) | ||
22 | |||
23 | #define LWX_FREQ(x) (((x - 601) / 100) & 0x7) | ||
24 | |||
25 | struct max8925_backlight_data { | ||
26 | struct max8925_chip *chip; | ||
27 | |||
28 | int current_brightness; | ||
29 | }; | ||
30 | |||
31 | static int max8925_backlight_set(struct backlight_device *bl, int brightness) | ||
32 | { | ||
33 | struct max8925_backlight_data *data = bl_get_data(bl); | ||
34 | struct max8925_chip *chip = data->chip; | ||
35 | unsigned char value; | ||
36 | int ret; | ||
37 | |||
38 | if (brightness > MAX_BRIGHTNESS) | ||
39 | value = MAX_BRIGHTNESS; | ||
40 | else | ||
41 | value = brightness; | ||
42 | |||
43 | ret = max8925_reg_write(chip->i2c, MAX8925_WLED_CNTL, value); | ||
44 | if (ret < 0) | ||
45 | goto out; | ||
46 | |||
47 | if (!data->current_brightness && brightness) | ||
48 | /* enable WLED output */ | ||
49 | ret = max8925_set_bits(chip->i2c, MAX8925_WLED_MODE_CNTL, 1, 1); | ||
50 | else if (!brightness) | ||
51 | /* disable WLED output */ | ||
52 | ret = max8925_set_bits(chip->i2c, MAX8925_WLED_MODE_CNTL, 1, 0); | ||
53 | if (ret < 0) | ||
54 | goto out; | ||
55 | dev_dbg(chip->dev, "set brightness %d\n", value); | ||
56 | data->current_brightness = value; | ||
57 | return 0; | ||
58 | out: | ||
59 | dev_dbg(chip->dev, "set brightness %d failure with return value:%d\n", | ||
60 | value, ret); | ||
61 | return ret; | ||
62 | } | ||
63 | |||
64 | static int max8925_backlight_update_status(struct backlight_device *bl) | ||
65 | { | ||
66 | int brightness = bl->props.brightness; | ||
67 | |||
68 | if (bl->props.power != FB_BLANK_UNBLANK) | ||
69 | brightness = 0; | ||
70 | |||
71 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
72 | brightness = 0; | ||
73 | |||
74 | if (bl->props.state & BL_CORE_SUSPENDED) | ||
75 | brightness = 0; | ||
76 | |||
77 | return max8925_backlight_set(bl, brightness); | ||
78 | } | ||
79 | |||
80 | static int max8925_backlight_get_brightness(struct backlight_device *bl) | ||
81 | { | ||
82 | struct max8925_backlight_data *data = bl_get_data(bl); | ||
83 | struct max8925_chip *chip = data->chip; | ||
84 | int ret; | ||
85 | |||
86 | ret = max8925_reg_read(chip->i2c, MAX8925_WLED_CNTL); | ||
87 | if (ret < 0) | ||
88 | return -EINVAL; | ||
89 | data->current_brightness = ret; | ||
90 | dev_dbg(chip->dev, "get brightness %d\n", data->current_brightness); | ||
91 | return ret; | ||
92 | } | ||
93 | |||
94 | static struct backlight_ops max8925_backlight_ops = { | ||
95 | .options = BL_CORE_SUSPENDRESUME, | ||
96 | .update_status = max8925_backlight_update_status, | ||
97 | .get_brightness = max8925_backlight_get_brightness, | ||
98 | }; | ||
99 | |||
100 | static int __devinit max8925_backlight_probe(struct platform_device *pdev) | ||
101 | { | ||
102 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
103 | struct max8925_platform_data *max8925_pdata; | ||
104 | struct max8925_backlight_pdata *pdata = NULL; | ||
105 | struct max8925_backlight_data *data; | ||
106 | struct backlight_device *bl; | ||
107 | struct resource *res; | ||
108 | char name[MAX8925_NAME_SIZE]; | ||
109 | unsigned char value; | ||
110 | int ret; | ||
111 | |||
112 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | ||
113 | if (res == NULL) { | ||
114 | dev_err(&pdev->dev, "No I/O resource!\n"); | ||
115 | return -EINVAL; | ||
116 | } | ||
117 | |||
118 | if (pdev->dev.parent->platform_data) { | ||
119 | max8925_pdata = pdev->dev.parent->platform_data; | ||
120 | pdata = max8925_pdata->backlight; | ||
121 | } | ||
122 | |||
123 | if (!pdata) { | ||
124 | dev_err(&pdev->dev, "platform data isn't assigned to " | ||
125 | "backlight\n"); | ||
126 | return -EINVAL; | ||
127 | } | ||
128 | |||
129 | data = kzalloc(sizeof(struct max8925_backlight_data), GFP_KERNEL); | ||
130 | if (data == NULL) | ||
131 | return -ENOMEM; | ||
132 | strncpy(name, res->name, MAX8925_NAME_SIZE); | ||
133 | data->chip = chip; | ||
134 | data->current_brightness = 0; | ||
135 | |||
136 | bl = backlight_device_register(name, &pdev->dev, data, | ||
137 | &max8925_backlight_ops); | ||
138 | if (IS_ERR(bl)) { | ||
139 | dev_err(&pdev->dev, "failed to register backlight\n"); | ||
140 | kfree(data); | ||
141 | return PTR_ERR(bl); | ||
142 | } | ||
143 | bl->props.max_brightness = MAX_BRIGHTNESS; | ||
144 | bl->props.brightness = MAX_BRIGHTNESS; | ||
145 | |||
146 | platform_set_drvdata(pdev, bl); | ||
147 | |||
148 | value = 0; | ||
149 | if (pdata->lxw_scl) | ||
150 | value |= (1 << 7); | ||
151 | if (pdata->lxw_freq) | ||
152 | value |= (LWX_FREQ(pdata->lxw_freq) << 4); | ||
153 | if (pdata->dual_string) | ||
154 | value |= (1 << 1); | ||
155 | ret = max8925_set_bits(chip->i2c, MAX8925_WLED_MODE_CNTL, 0xfe, value); | ||
156 | if (ret < 0) | ||
157 | goto out; | ||
158 | |||
159 | backlight_update_status(bl); | ||
160 | return 0; | ||
161 | out: | ||
162 | kfree(data); | ||
163 | return ret; | ||
164 | } | ||
165 | |||
166 | static int __devexit max8925_backlight_remove(struct platform_device *pdev) | ||
167 | { | ||
168 | struct backlight_device *bl = platform_get_drvdata(pdev); | ||
169 | struct max8925_backlight_data *data = bl_get_data(bl); | ||
170 | |||
171 | backlight_device_unregister(bl); | ||
172 | kfree(data); | ||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | static struct platform_driver max8925_backlight_driver = { | ||
177 | .driver = { | ||
178 | .name = "max8925-backlight", | ||
179 | .owner = THIS_MODULE, | ||
180 | }, | ||
181 | .probe = max8925_backlight_probe, | ||
182 | .remove = __devexit_p(max8925_backlight_remove), | ||
183 | }; | ||
184 | |||
185 | static int __init max8925_backlight_init(void) | ||
186 | { | ||
187 | return platform_driver_register(&max8925_backlight_driver); | ||
188 | } | ||
189 | module_init(max8925_backlight_init); | ||
190 | |||
191 | static void __exit max8925_backlight_exit(void) | ||
192 | { | ||
193 | platform_driver_unregister(&max8925_backlight_driver); | ||
194 | }; | ||
195 | module_exit(max8925_backlight_exit); | ||
196 | |||
197 | MODULE_DESCRIPTION("Backlight Driver for Maxim MAX8925"); | ||
198 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | ||
199 | MODULE_LICENSE("GPL"); | ||
200 | MODULE_ALIAS("platform:max8925-backlight"); | ||
diff --git a/include/linux/htcpld.h b/include/linux/htcpld.h new file mode 100644 index 000000000000..ab3f6cb4dddc --- /dev/null +++ b/include/linux/htcpld.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef __LINUX_HTCPLD_H | ||
2 | #define __LINUX_HTCPLD_H | ||
3 | |||
4 | struct htcpld_chip_platform_data { | ||
5 | unsigned int addr; | ||
6 | unsigned int reset; | ||
7 | unsigned int num_gpios; | ||
8 | unsigned int gpio_out_base; | ||
9 | unsigned int gpio_in_base; | ||
10 | unsigned int irq_base; | ||
11 | unsigned int num_irqs; | ||
12 | }; | ||
13 | |||
14 | struct htcpld_core_platform_data { | ||
15 | unsigned int int_reset_gpio_hi; | ||
16 | unsigned int int_reset_gpio_lo; | ||
17 | unsigned int i2c_adapter_id; | ||
18 | |||
19 | struct htcpld_chip_platform_data *chip; | ||
20 | unsigned int num_chip; | ||
21 | }; | ||
22 | |||
23 | #endif /* __LINUX_HTCPLD_H */ | ||
24 | |||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 7897f3096560..fb6784e86d5f 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -80,6 +80,11 @@ | |||
80 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | 80 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER |
81 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | 81 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER |
82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC |
83 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | ||
84 | |||
85 | #define TWL6030_MODULE_ID0 0x0D | ||
86 | #define TWL6030_MODULE_ID1 0x0E | ||
87 | #define TWL6030_MODULE_ID2 0x0F | ||
83 | 88 | ||
84 | #define GPIO_INTR_OFFSET 0 | 89 | #define GPIO_INTR_OFFSET 0 |
85 | #define KEYPAD_INTR_OFFSET 1 | 90 | #define KEYPAD_INTR_OFFSET 1 |
@@ -239,6 +244,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | |||
239 | 244 | ||
240 | /*----------------------------------------------------------------------*/ | 245 | /*----------------------------------------------------------------------*/ |
241 | 246 | ||
247 | /*Interface Bit Register (INTBR) offsets | ||
248 | *(Use TWL_4030_MODULE_INTBR) | ||
249 | */ | ||
250 | |||
251 | #define REG_GPPUPDCTR1 0x0F | ||
252 | |||
253 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ | ||
254 | |||
255 | #define I2C_SCL_CTRL_PU BIT(0) | ||
256 | #define I2C_SDA_CTRL_PU BIT(2) | ||
257 | #define SR_I2C_SCL_CTRL_PU BIT(4) | ||
258 | #define SR_I2C_SDA_CTRL_PU BIT(6) | ||
259 | |||
260 | /*----------------------------------------------------------------------*/ | ||
261 | |||
242 | /* | 262 | /* |
243 | * Keypad register offsets (use TWL4030_MODULE_KEYPAD) | 263 | * Keypad register offsets (use TWL4030_MODULE_KEYPAD) |
244 | * ... SIH/interrupt only | 264 | * ... SIH/interrupt only |
@@ -530,6 +550,7 @@ struct twl4030_power_data { | |||
530 | }; | 550 | }; |
531 | 551 | ||
532 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 552 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
553 | extern int twl4030_remove_script(u8 flags); | ||
533 | 554 | ||
534 | struct twl4030_codec_audio_data { | 555 | struct twl4030_codec_audio_data { |
535 | unsigned int audio_mclk; | 556 | unsigned int audio_mclk; |
@@ -605,12 +626,7 @@ int twl4030_sih_setup(int module); | |||
605 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 626 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
606 | #define TWL4030_VAUX3_DEDICATED 0x22 | 627 | #define TWL4030_VAUX3_DEDICATED 0x22 |
607 | 628 | ||
608 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 629 | static inline int twl4030charger_usb_en(int enable) { return 0; } |
609 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | ||
610 | extern int twl4030charger_usb_en(int enable); | ||
611 | #else | ||
612 | static inline int twl4030charger_usb_en(int enable) { return 0; } | ||
613 | #endif | ||
614 | 630 | ||
615 | /*----------------------------------------------------------------------*/ | 631 | /*----------------------------------------------------------------------*/ |
616 | 632 | ||
diff --git a/include/linux/mfd/88pm8607.h b/include/linux/mfd/88pm8607.h deleted file mode 100644 index f41b428d2cec..000000000000 --- a/include/linux/mfd/88pm8607.h +++ /dev/null | |||
@@ -1,217 +0,0 @@ | |||
1 | /* | ||
2 | * Marvell 88PM8607 Interface | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_88PM8607_H | ||
13 | #define __LINUX_MFD_88PM8607_H | ||
14 | |||
15 | enum { | ||
16 | PM8607_ID_BUCK1 = 0, | ||
17 | PM8607_ID_BUCK2, | ||
18 | PM8607_ID_BUCK3, | ||
19 | |||
20 | PM8607_ID_LDO1, | ||
21 | PM8607_ID_LDO2, | ||
22 | PM8607_ID_LDO3, | ||
23 | PM8607_ID_LDO4, | ||
24 | PM8607_ID_LDO5, | ||
25 | PM8607_ID_LDO6, | ||
26 | PM8607_ID_LDO7, | ||
27 | PM8607_ID_LDO8, | ||
28 | PM8607_ID_LDO9, | ||
29 | PM8607_ID_LDO10, | ||
30 | PM8607_ID_LDO12, | ||
31 | PM8607_ID_LDO14, | ||
32 | |||
33 | PM8607_ID_RG_MAX, | ||
34 | }; | ||
35 | |||
36 | #define CHIP_ID (0x40) | ||
37 | #define CHIP_ID_MASK (0xF8) | ||
38 | |||
39 | /* Interrupt Registers */ | ||
40 | #define PM8607_STATUS_1 (0x01) | ||
41 | #define PM8607_STATUS_2 (0x02) | ||
42 | #define PM8607_INT_STATUS1 (0x03) | ||
43 | #define PM8607_INT_STATUS2 (0x04) | ||
44 | #define PM8607_INT_STATUS3 (0x05) | ||
45 | #define PM8607_INT_MASK_1 (0x06) | ||
46 | #define PM8607_INT_MASK_2 (0x07) | ||
47 | #define PM8607_INT_MASK_3 (0x08) | ||
48 | |||
49 | /* Regulator Control Registers */ | ||
50 | #define PM8607_LDO1 (0x10) | ||
51 | #define PM8607_LDO2 (0x11) | ||
52 | #define PM8607_LDO3 (0x12) | ||
53 | #define PM8607_LDO4 (0x13) | ||
54 | #define PM8607_LDO5 (0x14) | ||
55 | #define PM8607_LDO6 (0x15) | ||
56 | #define PM8607_LDO7 (0x16) | ||
57 | #define PM8607_LDO8 (0x17) | ||
58 | #define PM8607_LDO9 (0x18) | ||
59 | #define PM8607_LDO10 (0x19) | ||
60 | #define PM8607_LDO12 (0x1A) | ||
61 | #define PM8607_LDO14 (0x1B) | ||
62 | #define PM8607_SLEEP_MODE1 (0x1C) | ||
63 | #define PM8607_SLEEP_MODE2 (0x1D) | ||
64 | #define PM8607_SLEEP_MODE3 (0x1E) | ||
65 | #define PM8607_SLEEP_MODE4 (0x1F) | ||
66 | #define PM8607_GO (0x20) | ||
67 | #define PM8607_SLEEP_BUCK1 (0x21) | ||
68 | #define PM8607_SLEEP_BUCK2 (0x22) | ||
69 | #define PM8607_SLEEP_BUCK3 (0x23) | ||
70 | #define PM8607_BUCK1 (0x24) | ||
71 | #define PM8607_BUCK2 (0x25) | ||
72 | #define PM8607_BUCK3 (0x26) | ||
73 | #define PM8607_BUCK_CONTROLS (0x27) | ||
74 | #define PM8607_SUPPLIES_EN11 (0x2B) | ||
75 | #define PM8607_SUPPLIES_EN12 (0x2C) | ||
76 | #define PM8607_GROUP1 (0x2D) | ||
77 | #define PM8607_GROUP2 (0x2E) | ||
78 | #define PM8607_GROUP3 (0x2F) | ||
79 | #define PM8607_GROUP4 (0x30) | ||
80 | #define PM8607_GROUP5 (0x31) | ||
81 | #define PM8607_GROUP6 (0x32) | ||
82 | #define PM8607_SUPPLIES_EN21 (0x33) | ||
83 | #define PM8607_SUPPLIES_EN22 (0x34) | ||
84 | |||
85 | /* RTC Control Registers */ | ||
86 | #define PM8607_RTC1 (0xA0) | ||
87 | #define PM8607_RTC_COUNTER1 (0xA1) | ||
88 | #define PM8607_RTC_COUNTER2 (0xA2) | ||
89 | #define PM8607_RTC_COUNTER3 (0xA3) | ||
90 | #define PM8607_RTC_COUNTER4 (0xA4) | ||
91 | #define PM8607_RTC_EXPIRE1 (0xA5) | ||
92 | #define PM8607_RTC_EXPIRE2 (0xA6) | ||
93 | #define PM8607_RTC_EXPIRE3 (0xA7) | ||
94 | #define PM8607_RTC_EXPIRE4 (0xA8) | ||
95 | #define PM8607_RTC_TRIM1 (0xA9) | ||
96 | #define PM8607_RTC_TRIM2 (0xAA) | ||
97 | #define PM8607_RTC_TRIM3 (0xAB) | ||
98 | #define PM8607_RTC_TRIM4 (0xAC) | ||
99 | #define PM8607_RTC_MISC1 (0xAD) | ||
100 | #define PM8607_RTC_MISC2 (0xAE) | ||
101 | #define PM8607_RTC_MISC3 (0xAF) | ||
102 | |||
103 | /* Misc Registers */ | ||
104 | #define PM8607_CHIP_ID (0x00) | ||
105 | #define PM8607_LDO1 (0x10) | ||
106 | #define PM8607_DVC3 (0x26) | ||
107 | #define PM8607_MISC1 (0x40) | ||
108 | |||
109 | /* bit definitions for PM8607 events */ | ||
110 | #define PM8607_EVENT_ONKEY (1 << 0) | ||
111 | #define PM8607_EVENT_EXTON (1 << 1) | ||
112 | #define PM8607_EVENT_CHG (1 << 2) | ||
113 | #define PM8607_EVENT_BAT (1 << 3) | ||
114 | #define PM8607_EVENT_RTC (1 << 4) | ||
115 | #define PM8607_EVENT_CC (1 << 5) | ||
116 | #define PM8607_EVENT_VBAT (1 << 8) | ||
117 | #define PM8607_EVENT_VCHG (1 << 9) | ||
118 | #define PM8607_EVENT_VSYS (1 << 10) | ||
119 | #define PM8607_EVENT_TINT (1 << 11) | ||
120 | #define PM8607_EVENT_GPADC0 (1 << 12) | ||
121 | #define PM8607_EVENT_GPADC1 (1 << 13) | ||
122 | #define PM8607_EVENT_GPADC2 (1 << 14) | ||
123 | #define PM8607_EVENT_GPADC3 (1 << 15) | ||
124 | #define PM8607_EVENT_AUDIO_SHORT (1 << 16) | ||
125 | #define PM8607_EVENT_PEN (1 << 17) | ||
126 | #define PM8607_EVENT_HEADSET (1 << 18) | ||
127 | #define PM8607_EVENT_HOOK (1 << 19) | ||
128 | #define PM8607_EVENT_MICIN (1 << 20) | ||
129 | #define PM8607_EVENT_CHG_TIMEOUT (1 << 21) | ||
130 | #define PM8607_EVENT_CHG_DONE (1 << 22) | ||
131 | #define PM8607_EVENT_CHG_FAULT (1 << 23) | ||
132 | |||
133 | /* bit definitions of Status Query Interface */ | ||
134 | #define PM8607_STATUS_CC (1 << 3) | ||
135 | #define PM8607_STATUS_PEN (1 << 4) | ||
136 | #define PM8607_STATUS_HEADSET (1 << 5) | ||
137 | #define PM8607_STATUS_HOOK (1 << 6) | ||
138 | #define PM8607_STATUS_MICIN (1 << 7) | ||
139 | #define PM8607_STATUS_ONKEY (1 << 8) | ||
140 | #define PM8607_STATUS_EXTON (1 << 9) | ||
141 | #define PM8607_STATUS_CHG (1 << 10) | ||
142 | #define PM8607_STATUS_BAT (1 << 11) | ||
143 | #define PM8607_STATUS_VBUS (1 << 12) | ||
144 | #define PM8607_STATUS_OV (1 << 13) | ||
145 | |||
146 | /* bit definitions of BUCK3 */ | ||
147 | #define PM8607_BUCK3_DOUBLE (1 << 6) | ||
148 | |||
149 | /* bit definitions of Misc1 */ | ||
150 | #define PM8607_MISC1_PI2C (1 << 0) | ||
151 | |||
152 | /* Interrupt Number in 88PM8607 */ | ||
153 | enum { | ||
154 | PM8607_IRQ_ONKEY = 0, | ||
155 | PM8607_IRQ_EXTON, | ||
156 | PM8607_IRQ_CHG, | ||
157 | PM8607_IRQ_BAT, | ||
158 | PM8607_IRQ_RTC, | ||
159 | PM8607_IRQ_VBAT = 8, | ||
160 | PM8607_IRQ_VCHG, | ||
161 | PM8607_IRQ_VSYS, | ||
162 | PM8607_IRQ_TINT, | ||
163 | PM8607_IRQ_GPADC0, | ||
164 | PM8607_IRQ_GPADC1, | ||
165 | PM8607_IRQ_GPADC2, | ||
166 | PM8607_IRQ_GPADC3, | ||
167 | PM8607_IRQ_AUDIO_SHORT = 16, | ||
168 | PM8607_IRQ_PEN, | ||
169 | PM8607_IRQ_HEADSET, | ||
170 | PM8607_IRQ_HOOK, | ||
171 | PM8607_IRQ_MICIN, | ||
172 | PM8607_IRQ_CHG_FAIL, | ||
173 | PM8607_IRQ_CHG_DONE, | ||
174 | PM8607_IRQ_CHG_FAULT, | ||
175 | }; | ||
176 | |||
177 | enum { | ||
178 | PM8607_CHIP_A0 = 0x40, | ||
179 | PM8607_CHIP_A1 = 0x41, | ||
180 | PM8607_CHIP_B0 = 0x48, | ||
181 | }; | ||
182 | |||
183 | |||
184 | struct pm8607_chip { | ||
185 | struct device *dev; | ||
186 | struct mutex io_lock; | ||
187 | struct i2c_client *client; | ||
188 | |||
189 | int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest); | ||
190 | int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src); | ||
191 | |||
192 | int buck3_double; /* DVC ramp slope double */ | ||
193 | unsigned char chip_id; | ||
194 | |||
195 | }; | ||
196 | |||
197 | #define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ | ||
198 | |||
199 | enum { | ||
200 | GI2C_PORT = 0, | ||
201 | PI2C_PORT, | ||
202 | }; | ||
203 | |||
204 | struct pm8607_platform_data { | ||
205 | int i2c_port; /* Controlled by GI2C or PI2C */ | ||
206 | struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; | ||
207 | }; | ||
208 | |||
209 | extern int pm8607_reg_read(struct pm8607_chip *, int); | ||
210 | extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char); | ||
211 | extern int pm8607_bulk_read(struct pm8607_chip *, int, int, | ||
212 | unsigned char *); | ||
213 | extern int pm8607_bulk_write(struct pm8607_chip *, int, int, | ||
214 | unsigned char *); | ||
215 | extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char, | ||
216 | unsigned char); | ||
217 | #endif /* __LINUX_MFD_88PM8607_H */ | ||
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h new file mode 100644 index 000000000000..73f92c5feea2 --- /dev/null +++ b/include/linux/mfd/88pm860x.h | |||
@@ -0,0 +1,375 @@ | |||
1 | /* | ||
2 | * Marvell 88PM860x Interface | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_88PM860X_H | ||
13 | #define __LINUX_MFD_88PM860X_H | ||
14 | |||
15 | #include <linux/interrupt.h> | ||
16 | |||
17 | #define MFD_NAME_SIZE (40) | ||
18 | |||
19 | enum { | ||
20 | CHIP_INVALID = 0, | ||
21 | CHIP_PM8606, | ||
22 | CHIP_PM8607, | ||
23 | CHIP_MAX, | ||
24 | }; | ||
25 | |||
26 | enum { | ||
27 | PM8606_ID_INVALID, | ||
28 | PM8606_ID_BACKLIGHT, | ||
29 | PM8606_ID_LED, | ||
30 | PM8606_ID_VIBRATOR, | ||
31 | PM8606_ID_TOUCH, | ||
32 | PM8606_ID_SOUND, | ||
33 | PM8606_ID_CHARGER, | ||
34 | PM8606_ID_MAX, | ||
35 | }; | ||
36 | |||
37 | enum { | ||
38 | PM8606_BACKLIGHT1 = 0, | ||
39 | PM8606_BACKLIGHT2, | ||
40 | PM8606_BACKLIGHT3, | ||
41 | }; | ||
42 | |||
43 | enum { | ||
44 | PM8606_LED1_RED = 0, | ||
45 | PM8606_LED1_GREEN, | ||
46 | PM8606_LED1_BLUE, | ||
47 | PM8606_LED2_RED, | ||
48 | PM8606_LED2_GREEN, | ||
49 | PM8606_LED2_BLUE, | ||
50 | PM8607_LED_VIBRATOR, | ||
51 | }; | ||
52 | |||
53 | |||
54 | /* 8606 Registers */ | ||
55 | #define PM8606_DCM_BOOST (0x00) | ||
56 | #define PM8606_PWM (0x01) | ||
57 | |||
58 | /* Backlight Registers */ | ||
59 | #define PM8606_WLED1A (0x02) | ||
60 | #define PM8606_WLED1B (0x03) | ||
61 | #define PM8606_WLED2A (0x04) | ||
62 | #define PM8606_WLED2B (0x05) | ||
63 | #define PM8606_WLED3A (0x06) | ||
64 | #define PM8606_WLED3B (0x07) | ||
65 | |||
66 | /* LED Registers */ | ||
67 | #define PM8606_RGB2A (0x08) | ||
68 | #define PM8606_RGB2B (0x09) | ||
69 | #define PM8606_RGB2C (0x0A) | ||
70 | #define PM8606_RGB2D (0x0B) | ||
71 | #define PM8606_RGB1A (0x0C) | ||
72 | #define PM8606_RGB1B (0x0D) | ||
73 | #define PM8606_RGB1C (0x0E) | ||
74 | #define PM8606_RGB1D (0x0F) | ||
75 | |||
76 | #define PM8606_PREREGULATORA (0x10) | ||
77 | #define PM8606_PREREGULATORB (0x11) | ||
78 | #define PM8606_VIBRATORA (0x12) | ||
79 | #define PM8606_VIBRATORB (0x13) | ||
80 | #define PM8606_VCHG (0x14) | ||
81 | #define PM8606_VSYS (0x15) | ||
82 | #define PM8606_MISC (0x16) | ||
83 | #define PM8606_CHIP_ID (0x17) | ||
84 | #define PM8606_STATUS (0x18) | ||
85 | #define PM8606_FLAGS (0x19) | ||
86 | #define PM8606_PROTECTA (0x1A) | ||
87 | #define PM8606_PROTECTB (0x1B) | ||
88 | #define PM8606_PROTECTC (0x1C) | ||
89 | |||
90 | /* Bit definitions of PM8606 registers */ | ||
91 | #define PM8606_DCM_500MA (0x0) /* current limit */ | ||
92 | #define PM8606_DCM_750MA (0x1) | ||
93 | #define PM8606_DCM_1000MA (0x2) | ||
94 | #define PM8606_DCM_1250MA (0x3) | ||
95 | #define PM8606_DCM_250MV (0x0 << 2) | ||
96 | #define PM8606_DCM_300MV (0x1 << 2) | ||
97 | #define PM8606_DCM_350MV (0x2 << 2) | ||
98 | #define PM8606_DCM_400MV (0x3 << 2) | ||
99 | |||
100 | #define PM8606_PWM_31200HZ (0x0) | ||
101 | #define PM8606_PWM_15600HZ (0x1) | ||
102 | #define PM8606_PWM_7800HZ (0x2) | ||
103 | #define PM8606_PWM_3900HZ (0x3) | ||
104 | #define PM8606_PWM_1950HZ (0x4) | ||
105 | #define PM8606_PWM_976HZ (0x5) | ||
106 | #define PM8606_PWM_488HZ (0x6) | ||
107 | #define PM8606_PWM_244HZ (0x7) | ||
108 | #define PM8606_PWM_FREQ_MASK (0x7) | ||
109 | |||
110 | #define PM8606_WLED_ON (1 << 0) | ||
111 | #define PM8606_WLED_CURRENT(x) ((x & 0x1F) << 1) | ||
112 | |||
113 | #define PM8606_LED_CURRENT(x) (((x >> 2) & 0x07) << 5) | ||
114 | |||
115 | #define PM8606_VSYS_EN (1 << 1) | ||
116 | |||
117 | #define PM8606_MISC_OSC_EN (1 << 4) | ||
118 | |||
119 | enum { | ||
120 | PM8607_ID_BUCK1 = 0, | ||
121 | PM8607_ID_BUCK2, | ||
122 | PM8607_ID_BUCK3, | ||
123 | |||
124 | PM8607_ID_LDO1, | ||
125 | PM8607_ID_LDO2, | ||
126 | PM8607_ID_LDO3, | ||
127 | PM8607_ID_LDO4, | ||
128 | PM8607_ID_LDO5, | ||
129 | PM8607_ID_LDO6, | ||
130 | PM8607_ID_LDO7, | ||
131 | PM8607_ID_LDO8, | ||
132 | PM8607_ID_LDO9, | ||
133 | PM8607_ID_LDO10, | ||
134 | PM8607_ID_LDO12, | ||
135 | PM8607_ID_LDO14, | ||
136 | |||
137 | PM8607_ID_RG_MAX, | ||
138 | }; | ||
139 | |||
140 | #define PM8607_VERSION (0x40) /* 8607 chip ID */ | ||
141 | #define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ | ||
142 | |||
143 | /* Interrupt Registers */ | ||
144 | #define PM8607_STATUS_1 (0x01) | ||
145 | #define PM8607_STATUS_2 (0x02) | ||
146 | #define PM8607_INT_STATUS1 (0x03) | ||
147 | #define PM8607_INT_STATUS2 (0x04) | ||
148 | #define PM8607_INT_STATUS3 (0x05) | ||
149 | #define PM8607_INT_MASK_1 (0x06) | ||
150 | #define PM8607_INT_MASK_2 (0x07) | ||
151 | #define PM8607_INT_MASK_3 (0x08) | ||
152 | |||
153 | /* Regulator Control Registers */ | ||
154 | #define PM8607_LDO1 (0x10) | ||
155 | #define PM8607_LDO2 (0x11) | ||
156 | #define PM8607_LDO3 (0x12) | ||
157 | #define PM8607_LDO4 (0x13) | ||
158 | #define PM8607_LDO5 (0x14) | ||
159 | #define PM8607_LDO6 (0x15) | ||
160 | #define PM8607_LDO7 (0x16) | ||
161 | #define PM8607_LDO8 (0x17) | ||
162 | #define PM8607_LDO9 (0x18) | ||
163 | #define PM8607_LDO10 (0x19) | ||
164 | #define PM8607_LDO12 (0x1A) | ||
165 | #define PM8607_LDO14 (0x1B) | ||
166 | #define PM8607_SLEEP_MODE1 (0x1C) | ||
167 | #define PM8607_SLEEP_MODE2 (0x1D) | ||
168 | #define PM8607_SLEEP_MODE3 (0x1E) | ||
169 | #define PM8607_SLEEP_MODE4 (0x1F) | ||
170 | #define PM8607_GO (0x20) | ||
171 | #define PM8607_SLEEP_BUCK1 (0x21) | ||
172 | #define PM8607_SLEEP_BUCK2 (0x22) | ||
173 | #define PM8607_SLEEP_BUCK3 (0x23) | ||
174 | #define PM8607_BUCK1 (0x24) | ||
175 | #define PM8607_BUCK2 (0x25) | ||
176 | #define PM8607_BUCK3 (0x26) | ||
177 | #define PM8607_BUCK_CONTROLS (0x27) | ||
178 | #define PM8607_SUPPLIES_EN11 (0x2B) | ||
179 | #define PM8607_SUPPLIES_EN12 (0x2C) | ||
180 | #define PM8607_GROUP1 (0x2D) | ||
181 | #define PM8607_GROUP2 (0x2E) | ||
182 | #define PM8607_GROUP3 (0x2F) | ||
183 | #define PM8607_GROUP4 (0x30) | ||
184 | #define PM8607_GROUP5 (0x31) | ||
185 | #define PM8607_GROUP6 (0x32) | ||
186 | #define PM8607_SUPPLIES_EN21 (0x33) | ||
187 | #define PM8607_SUPPLIES_EN22 (0x34) | ||
188 | |||
189 | /* Vibrator Control Registers */ | ||
190 | #define PM8607_VIBRATOR_SET (0x28) | ||
191 | #define PM8607_VIBRATOR_PWM (0x29) | ||
192 | |||
193 | /* GPADC Registers */ | ||
194 | #define PM8607_GP_BIAS1 (0x4F) | ||
195 | #define PM8607_MEAS_EN1 (0x50) | ||
196 | #define PM8607_MEAS_EN2 (0x51) | ||
197 | #define PM8607_MEAS_EN3 (0x52) | ||
198 | #define PM8607_MEAS_OFF_TIME1 (0x53) | ||
199 | #define PM8607_MEAS_OFF_TIME2 (0x54) | ||
200 | #define PM8607_TSI_PREBIAS (0x55) /* prebias time */ | ||
201 | #define PM8607_PD_PREBIAS (0x56) /* prebias time */ | ||
202 | #define PM8607_GPADC_MISC1 (0x57) | ||
203 | |||
204 | /* RTC Control Registers */ | ||
205 | #define PM8607_RTC1 (0xA0) | ||
206 | #define PM8607_RTC_COUNTER1 (0xA1) | ||
207 | #define PM8607_RTC_COUNTER2 (0xA2) | ||
208 | #define PM8607_RTC_COUNTER3 (0xA3) | ||
209 | #define PM8607_RTC_COUNTER4 (0xA4) | ||
210 | #define PM8607_RTC_EXPIRE1 (0xA5) | ||
211 | #define PM8607_RTC_EXPIRE2 (0xA6) | ||
212 | #define PM8607_RTC_EXPIRE3 (0xA7) | ||
213 | #define PM8607_RTC_EXPIRE4 (0xA8) | ||
214 | #define PM8607_RTC_TRIM1 (0xA9) | ||
215 | #define PM8607_RTC_TRIM2 (0xAA) | ||
216 | #define PM8607_RTC_TRIM3 (0xAB) | ||
217 | #define PM8607_RTC_TRIM4 (0xAC) | ||
218 | #define PM8607_RTC_MISC1 (0xAD) | ||
219 | #define PM8607_RTC_MISC2 (0xAE) | ||
220 | #define PM8607_RTC_MISC3 (0xAF) | ||
221 | |||
222 | /* Misc Registers */ | ||
223 | #define PM8607_CHIP_ID (0x00) | ||
224 | #define PM8607_B0_MISC1 (0x0C) | ||
225 | #define PM8607_LDO1 (0x10) | ||
226 | #define PM8607_DVC3 (0x26) | ||
227 | #define PM8607_A1_MISC1 (0x40) | ||
228 | |||
229 | /* bit definitions of Status Query Interface */ | ||
230 | #define PM8607_STATUS_CC (1 << 3) | ||
231 | #define PM8607_STATUS_PEN (1 << 4) | ||
232 | #define PM8607_STATUS_HEADSET (1 << 5) | ||
233 | #define PM8607_STATUS_HOOK (1 << 6) | ||
234 | #define PM8607_STATUS_MICIN (1 << 7) | ||
235 | #define PM8607_STATUS_ONKEY (1 << 8) | ||
236 | #define PM8607_STATUS_EXTON (1 << 9) | ||
237 | #define PM8607_STATUS_CHG (1 << 10) | ||
238 | #define PM8607_STATUS_BAT (1 << 11) | ||
239 | #define PM8607_STATUS_VBUS (1 << 12) | ||
240 | #define PM8607_STATUS_OV (1 << 13) | ||
241 | |||
242 | /* bit definitions of BUCK3 */ | ||
243 | #define PM8607_BUCK3_DOUBLE (1 << 6) | ||
244 | |||
245 | /* bit definitions of Misc1 */ | ||
246 | #define PM8607_A1_MISC1_PI2C (1 << 0) | ||
247 | #define PM8607_B0_MISC1_INV_INT (1 << 0) | ||
248 | #define PM8607_B0_MISC1_INT_CLEAR (1 << 1) | ||
249 | #define PM8607_B0_MISC1_INT_MASK (1 << 2) | ||
250 | #define PM8607_B0_MISC1_PI2C (1 << 3) | ||
251 | #define PM8607_B0_MISC1_RESET (1 << 6) | ||
252 | |||
253 | /* bits definitions of GPADC */ | ||
254 | #define PM8607_GPADC_EN (1 << 0) | ||
255 | #define PM8607_GPADC_PREBIAS_MASK (3 << 1) | ||
256 | #define PM8607_GPADC_SLOT_CYCLE_MASK (3 << 3) /* slow mode */ | ||
257 | #define PM8607_GPADC_OFF_SCALE_MASK (3 << 5) /* GP sleep mode */ | ||
258 | #define PM8607_GPADC_SW_CAL_MASK (1 << 7) | ||
259 | |||
260 | #define PM8607_PD_PREBIAS_MASK (0x1F << 0) | ||
261 | #define PM8607_PD_PRECHG_MASK (7 << 5) | ||
262 | |||
263 | /* Interrupt Number in 88PM8607 */ | ||
264 | enum { | ||
265 | PM8607_IRQ_ONKEY, | ||
266 | PM8607_IRQ_EXTON, | ||
267 | PM8607_IRQ_CHG, | ||
268 | PM8607_IRQ_BAT, | ||
269 | PM8607_IRQ_RTC, | ||
270 | PM8607_IRQ_CC, | ||
271 | PM8607_IRQ_VBAT, | ||
272 | PM8607_IRQ_VCHG, | ||
273 | PM8607_IRQ_VSYS, | ||
274 | PM8607_IRQ_TINT, | ||
275 | PM8607_IRQ_GPADC0, | ||
276 | PM8607_IRQ_GPADC1, | ||
277 | PM8607_IRQ_GPADC2, | ||
278 | PM8607_IRQ_GPADC3, | ||
279 | PM8607_IRQ_AUDIO_SHORT, | ||
280 | PM8607_IRQ_PEN, | ||
281 | PM8607_IRQ_HEADSET, | ||
282 | PM8607_IRQ_HOOK, | ||
283 | PM8607_IRQ_MICIN, | ||
284 | PM8607_IRQ_CHG_FAIL, | ||
285 | PM8607_IRQ_CHG_DONE, | ||
286 | PM8607_IRQ_CHG_FAULT, | ||
287 | }; | ||
288 | |||
289 | enum { | ||
290 | PM8607_CHIP_A0 = 0x40, | ||
291 | PM8607_CHIP_A1 = 0x41, | ||
292 | PM8607_CHIP_B0 = 0x48, | ||
293 | }; | ||
294 | |||
295 | struct pm860x_chip { | ||
296 | struct device *dev; | ||
297 | struct mutex io_lock; | ||
298 | struct mutex irq_lock; | ||
299 | struct i2c_client *client; | ||
300 | struct i2c_client *companion; /* companion chip client */ | ||
301 | |||
302 | int buck3_double; /* DVC ramp slope double */ | ||
303 | unsigned short companion_addr; | ||
304 | int id; | ||
305 | int irq_mode; | ||
306 | int irq_base; | ||
307 | int core_irq; | ||
308 | unsigned char chip_version; | ||
309 | |||
310 | }; | ||
311 | |||
312 | #define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ | ||
313 | |||
314 | enum { | ||
315 | GI2C_PORT = 0, | ||
316 | PI2C_PORT, | ||
317 | }; | ||
318 | |||
319 | struct pm860x_backlight_pdata { | ||
320 | int id; | ||
321 | int pwm; | ||
322 | int iset; | ||
323 | unsigned long flags; | ||
324 | }; | ||
325 | |||
326 | struct pm860x_led_pdata { | ||
327 | int id; | ||
328 | int iset; | ||
329 | unsigned long flags; | ||
330 | }; | ||
331 | |||
332 | struct pm860x_touch_pdata { | ||
333 | int gpadc_prebias; | ||
334 | int slot_cycle; | ||
335 | int off_scale; | ||
336 | int sw_cal; | ||
337 | int tsi_prebias; /* time, slot */ | ||
338 | int pen_prebias; /* time, slot */ | ||
339 | int pen_prechg; /* time, slot */ | ||
340 | int res_x; /* resistor of Xplate */ | ||
341 | unsigned long flags; | ||
342 | }; | ||
343 | |||
344 | struct pm860x_power_pdata { | ||
345 | unsigned fast_charge; /* charge current */ | ||
346 | }; | ||
347 | |||
348 | struct pm860x_platform_data { | ||
349 | struct pm860x_backlight_pdata *backlight; | ||
350 | struct pm860x_led_pdata *led; | ||
351 | struct pm860x_touch_pdata *touch; | ||
352 | struct pm860x_power_pdata *power; | ||
353 | |||
354 | unsigned short companion_addr; /* I2C address of companion chip */ | ||
355 | int i2c_port; /* Controlled by GI2C or PI2C */ | ||
356 | int irq_mode; /* Clear interrupt by read/write(0/1) */ | ||
357 | int irq_base; /* IRQ base number of 88pm860x */ | ||
358 | struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; | ||
359 | }; | ||
360 | |||
361 | extern char pm860x_backlight_name[][MFD_NAME_SIZE]; | ||
362 | extern char pm860x_led_name[][MFD_NAME_SIZE]; | ||
363 | |||
364 | extern int pm860x_reg_read(struct i2c_client *, int); | ||
365 | extern int pm860x_reg_write(struct i2c_client *, int, unsigned char); | ||
366 | extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *); | ||
367 | extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *); | ||
368 | extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, | ||
369 | unsigned char); | ||
370 | |||
371 | extern int pm860x_device_init(struct pm860x_chip *chip, | ||
372 | struct pm860x_platform_data *pdata); | ||
373 | extern void pm860x_device_exit(struct pm860x_chip *chip); | ||
374 | |||
375 | #endif /* __LINUX_MFD_88PM860X_H */ | ||
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h index e9aa4c9d749d..9a881c305a50 100644 --- a/include/linux/mfd/ab3100.h +++ b/include/linux/mfd/ab3100.h | |||
@@ -6,7 +6,6 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/workqueue.h> | ||
10 | #include <linux/regulator/machine.h> | 9 | #include <linux/regulator/machine.h> |
11 | 10 | ||
12 | #ifndef MFD_AB3100_H | 11 | #ifndef MFD_AB3100_H |
@@ -74,7 +73,6 @@ | |||
74 | * @testreg_client: secondary client for test registers | 73 | * @testreg_client: secondary client for test registers |
75 | * @chip_name: name of this chip variant | 74 | * @chip_name: name of this chip variant |
76 | * @chip_id: 8 bit chip ID for this chip variant | 75 | * @chip_id: 8 bit chip ID for this chip variant |
77 | * @work: an event handling worker | ||
78 | * @event_subscribers: event subscribers are listed here | 76 | * @event_subscribers: event subscribers are listed here |
79 | * @startup_events: a copy of the first reading of the event registers | 77 | * @startup_events: a copy of the first reading of the event registers |
80 | * @startup_events_read: whether the first events have been read | 78 | * @startup_events_read: whether the first events have been read |
@@ -90,7 +88,6 @@ struct ab3100 { | |||
90 | struct i2c_client *testreg_client; | 88 | struct i2c_client *testreg_client; |
91 | char chip_name[32]; | 89 | char chip_name[32]; |
92 | u8 chip_id; | 90 | u8 chip_id; |
93 | struct work_struct work; | ||
94 | struct blocking_notifier_head event_subscribers; | 91 | struct blocking_notifier_head event_subscribers; |
95 | u32 startup_events; | 92 | u32 startup_events; |
96 | bool startup_events_read; | 93 | bool startup_events_read; |
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h new file mode 100644 index 000000000000..5259dfe8c585 --- /dev/null +++ b/include/linux/mfd/max8925.h | |||
@@ -0,0 +1,253 @@ | |||
1 | /* | ||
2 | * Maxim8925 Interface | ||
3 | * | ||
4 | * Copyright (C) 2009 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_MAX8925_H | ||
13 | #define __LINUX_MFD_MAX8925_H | ||
14 | |||
15 | #include <linux/mutex.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | |||
18 | /* Unified sub device IDs for MAX8925 */ | ||
19 | enum { | ||
20 | MAX8925_ID_SD1, | ||
21 | MAX8925_ID_SD2, | ||
22 | MAX8925_ID_SD3, | ||
23 | MAX8925_ID_LDO1, | ||
24 | MAX8925_ID_LDO2, | ||
25 | MAX8925_ID_LDO3, | ||
26 | MAX8925_ID_LDO4, | ||
27 | MAX8925_ID_LDO5, | ||
28 | MAX8925_ID_LDO6, | ||
29 | MAX8925_ID_LDO7, | ||
30 | MAX8925_ID_LDO8, | ||
31 | MAX8925_ID_LDO9, | ||
32 | MAX8925_ID_LDO10, | ||
33 | MAX8925_ID_LDO11, | ||
34 | MAX8925_ID_LDO12, | ||
35 | MAX8925_ID_LDO13, | ||
36 | MAX8925_ID_LDO14, | ||
37 | MAX8925_ID_LDO15, | ||
38 | MAX8925_ID_LDO16, | ||
39 | MAX8925_ID_LDO17, | ||
40 | MAX8925_ID_LDO18, | ||
41 | MAX8925_ID_LDO19, | ||
42 | MAX8925_ID_LDO20, | ||
43 | MAX8925_ID_MAX, | ||
44 | }; | ||
45 | |||
46 | enum { | ||
47 | /* | ||
48 | * Charging current threshold trigger going from fast charge | ||
49 | * to TOPOFF charge. From 5% to 20% of fasting charging current. | ||
50 | */ | ||
51 | MAX8925_TOPOFF_THR_5PER, | ||
52 | MAX8925_TOPOFF_THR_10PER, | ||
53 | MAX8925_TOPOFF_THR_15PER, | ||
54 | MAX8925_TOPOFF_THR_20PER, | ||
55 | }; | ||
56 | |||
57 | enum { | ||
58 | /* Fast charging current */ | ||
59 | MAX8925_FCHG_85MA, | ||
60 | MAX8925_FCHG_300MA, | ||
61 | MAX8925_FCHG_460MA, | ||
62 | MAX8925_FCHG_600MA, | ||
63 | MAX8925_FCHG_700MA, | ||
64 | MAX8925_FCHG_800MA, | ||
65 | MAX8925_FCHG_900MA, | ||
66 | MAX8925_FCHG_1000MA, | ||
67 | }; | ||
68 | |||
69 | /* Charger registers */ | ||
70 | #define MAX8925_CHG_IRQ1 (0x7e) | ||
71 | #define MAX8925_CHG_IRQ2 (0x7f) | ||
72 | #define MAX8925_CHG_IRQ1_MASK (0x80) | ||
73 | #define MAX8925_CHG_IRQ2_MASK (0x81) | ||
74 | #define MAX8925_CHG_STATUS (0x82) | ||
75 | |||
76 | /* GPM registers */ | ||
77 | #define MAX8925_SYSENSEL (0x00) | ||
78 | #define MAX8925_ON_OFF_IRQ1 (0x01) | ||
79 | #define MAX8925_ON_OFF_IRQ1_MASK (0x02) | ||
80 | #define MAX8925_ON_OFF_STATUS (0x03) | ||
81 | #define MAX8925_ON_OFF_IRQ2 (0x0d) | ||
82 | #define MAX8925_ON_OFF_IRQ2_MASK (0x0e) | ||
83 | #define MAX8925_RESET_CNFG (0x0f) | ||
84 | |||
85 | /* Touch registers */ | ||
86 | #define MAX8925_TSC_IRQ (0x00) | ||
87 | #define MAX8925_TSC_IRQ_MASK (0x01) | ||
88 | #define MAX8925_TSC_CNFG1 (0x02) | ||
89 | #define MAX8925_ADC_SCHED (0x10) | ||
90 | #define MAX8925_ADC_RES_END (0x6f) | ||
91 | |||
92 | #define MAX8925_NREF_OK (1 << 4) | ||
93 | |||
94 | /* RTC registers */ | ||
95 | #define MAX8925_ALARM0_CNTL (0x18) | ||
96 | #define MAX8925_ALARM1_CNTL (0x19) | ||
97 | #define MAX8925_RTC_IRQ (0x1c) | ||
98 | #define MAX8925_RTC_IRQ_MASK (0x1d) | ||
99 | #define MAX8925_MPL_CNTL (0x1e) | ||
100 | |||
101 | /* WLED registers */ | ||
102 | #define MAX8925_WLED_MODE_CNTL (0x84) | ||
103 | #define MAX8925_WLED_CNTL (0x85) | ||
104 | |||
105 | /* MAX8925 Registers */ | ||
106 | #define MAX8925_SDCTL1 (0x04) | ||
107 | #define MAX8925_SDCTL2 (0x07) | ||
108 | #define MAX8925_SDCTL3 (0x0A) | ||
109 | #define MAX8925_SDV1 (0x06) | ||
110 | #define MAX8925_SDV2 (0x09) | ||
111 | #define MAX8925_SDV3 (0x0C) | ||
112 | #define MAX8925_LDOCTL1 (0x18) | ||
113 | #define MAX8925_LDOCTL2 (0x1C) | ||
114 | #define MAX8925_LDOCTL3 (0x20) | ||
115 | #define MAX8925_LDOCTL4 (0x24) | ||
116 | #define MAX8925_LDOCTL5 (0x28) | ||
117 | #define MAX8925_LDOCTL6 (0x2C) | ||
118 | #define MAX8925_LDOCTL7 (0x30) | ||
119 | #define MAX8925_LDOCTL8 (0x34) | ||
120 | #define MAX8925_LDOCTL9 (0x38) | ||
121 | #define MAX8925_LDOCTL10 (0x3C) | ||
122 | #define MAX8925_LDOCTL11 (0x40) | ||
123 | #define MAX8925_LDOCTL12 (0x44) | ||
124 | #define MAX8925_LDOCTL13 (0x48) | ||
125 | #define MAX8925_LDOCTL14 (0x4C) | ||
126 | #define MAX8925_LDOCTL15 (0x50) | ||
127 | #define MAX8925_LDOCTL16 (0x10) | ||
128 | #define MAX8925_LDOCTL17 (0x14) | ||
129 | #define MAX8925_LDOCTL18 (0x72) | ||
130 | #define MAX8925_LDOCTL19 (0x5C) | ||
131 | #define MAX8925_LDOCTL20 (0x9C) | ||
132 | #define MAX8925_LDOVOUT1 (0x1A) | ||
133 | #define MAX8925_LDOVOUT2 (0x1E) | ||
134 | #define MAX8925_LDOVOUT3 (0x22) | ||
135 | #define MAX8925_LDOVOUT4 (0x26) | ||
136 | #define MAX8925_LDOVOUT5 (0x2A) | ||
137 | #define MAX8925_LDOVOUT6 (0x2E) | ||
138 | #define MAX8925_LDOVOUT7 (0x32) | ||
139 | #define MAX8925_LDOVOUT8 (0x36) | ||
140 | #define MAX8925_LDOVOUT9 (0x3A) | ||
141 | #define MAX8925_LDOVOUT10 (0x3E) | ||
142 | #define MAX8925_LDOVOUT11 (0x42) | ||
143 | #define MAX8925_LDOVOUT12 (0x46) | ||
144 | #define MAX8925_LDOVOUT13 (0x4A) | ||
145 | #define MAX8925_LDOVOUT14 (0x4E) | ||
146 | #define MAX8925_LDOVOUT15 (0x52) | ||
147 | #define MAX8925_LDOVOUT16 (0x12) | ||
148 | #define MAX8925_LDOVOUT17 (0x16) | ||
149 | #define MAX8925_LDOVOUT18 (0x74) | ||
150 | #define MAX8925_LDOVOUT19 (0x5E) | ||
151 | #define MAX8925_LDOVOUT20 (0x9E) | ||
152 | |||
153 | /* bit definitions */ | ||
154 | #define CHG_IRQ1_MASK (0x07) | ||
155 | #define CHG_IRQ2_MASK (0xff) | ||
156 | #define ON_OFF_IRQ1_MASK (0xff) | ||
157 | #define ON_OFF_IRQ2_MASK (0x03) | ||
158 | #define TSC_IRQ_MASK (0x03) | ||
159 | #define RTC_IRQ_MASK (0x0c) | ||
160 | |||
161 | #define MAX8925_MAX_REGULATOR (23) | ||
162 | |||
163 | #define MAX8925_NAME_SIZE (32) | ||
164 | |||
165 | /* IRQ definitions */ | ||
166 | enum { | ||
167 | MAX8925_IRQ_VCHG_DC_OVP, | ||
168 | MAX8925_IRQ_VCHG_DC_F, | ||
169 | MAX8925_IRQ_VCHG_DC_R, | ||
170 | MAX8925_IRQ_VCHG_USB_OVP, | ||
171 | MAX8925_IRQ_VCHG_USB_F, | ||
172 | MAX8925_IRQ_VCHG_USB_R, | ||
173 | MAX8925_IRQ_VCHG_THM_OK_R, | ||
174 | MAX8925_IRQ_VCHG_THM_OK_F, | ||
175 | MAX8925_IRQ_VCHG_SYSLOW_F, | ||
176 | MAX8925_IRQ_VCHG_SYSLOW_R, | ||
177 | MAX8925_IRQ_VCHG_RST, | ||
178 | MAX8925_IRQ_VCHG_DONE, | ||
179 | MAX8925_IRQ_VCHG_TOPOFF, | ||
180 | MAX8925_IRQ_VCHG_TMR_FAULT, | ||
181 | MAX8925_IRQ_GPM_RSTIN, | ||
182 | MAX8925_IRQ_GPM_MPL, | ||
183 | MAX8925_IRQ_GPM_SW_3SEC, | ||
184 | MAX8925_IRQ_GPM_EXTON_F, | ||
185 | MAX8925_IRQ_GPM_EXTON_R, | ||
186 | MAX8925_IRQ_GPM_SW_1SEC, | ||
187 | MAX8925_IRQ_GPM_SW_F, | ||
188 | MAX8925_IRQ_GPM_SW_R, | ||
189 | MAX8925_IRQ_GPM_SYSCKEN_F, | ||
190 | MAX8925_IRQ_GPM_SYSCKEN_R, | ||
191 | MAX8925_IRQ_RTC_ALARM1, | ||
192 | MAX8925_IRQ_RTC_ALARM0, | ||
193 | MAX8925_IRQ_TSC_STICK, | ||
194 | MAX8925_IRQ_TSC_NSTICK, | ||
195 | MAX8925_NR_IRQS, | ||
196 | }; | ||
197 | |||
198 | struct max8925_chip { | ||
199 | struct device *dev; | ||
200 | struct i2c_client *i2c; | ||
201 | struct i2c_client *adc; | ||
202 | struct i2c_client *rtc; | ||
203 | struct mutex io_lock; | ||
204 | struct mutex irq_lock; | ||
205 | |||
206 | int irq_base; | ||
207 | int core_irq; | ||
208 | int tsc_irq; | ||
209 | }; | ||
210 | |||
211 | struct max8925_backlight_pdata { | ||
212 | int lxw_scl; /* 0/1 -- 0.8Ohm/0.4Ohm */ | ||
213 | int lxw_freq; /* 700KHz ~ 1400KHz */ | ||
214 | int dual_string; /* 0/1 -- single/dual string */ | ||
215 | }; | ||
216 | |||
217 | struct max8925_touch_pdata { | ||
218 | unsigned int flags; | ||
219 | }; | ||
220 | |||
221 | struct max8925_power_pdata { | ||
222 | int (*set_charger)(int); | ||
223 | unsigned batt_detect:1; | ||
224 | unsigned topoff_threshold:2; | ||
225 | unsigned fast_charge:3; /* charge current */ | ||
226 | }; | ||
227 | |||
228 | /* | ||
229 | * irq_base: stores IRQ base number of MAX8925 in platform | ||
230 | * tsc_irq: stores IRQ number of MAX8925 TSC | ||
231 | */ | ||
232 | struct max8925_platform_data { | ||
233 | struct max8925_backlight_pdata *backlight; | ||
234 | struct max8925_touch_pdata *touch; | ||
235 | struct max8925_power_pdata *power; | ||
236 | struct regulator_init_data *regulator[MAX8925_MAX_REGULATOR]; | ||
237 | |||
238 | int irq_base; | ||
239 | int tsc_irq; | ||
240 | }; | ||
241 | |||
242 | extern int max8925_reg_read(struct i2c_client *, int); | ||
243 | extern int max8925_reg_write(struct i2c_client *, int, unsigned char); | ||
244 | extern int max8925_bulk_read(struct i2c_client *, int, int, unsigned char *); | ||
245 | extern int max8925_bulk_write(struct i2c_client *, int, int, unsigned char *); | ||
246 | extern int max8925_set_bits(struct i2c_client *, int, unsigned char, | ||
247 | unsigned char); | ||
248 | |||
249 | extern int max8925_device_init(struct max8925_chip *, | ||
250 | struct max8925_platform_data *); | ||
251 | extern void max8925_device_exit(struct max8925_chip *); | ||
252 | #endif /* __LINUX_MFD_MAX8925_H */ | ||
253 | |||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 9cb1834deffa..c3f7dff8effc 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -59,7 +59,8 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | |||
59 | * data for the MMC controller | 59 | * data for the MMC controller |
60 | */ | 60 | */ |
61 | struct tmio_mmc_data { | 61 | struct tmio_mmc_data { |
62 | const unsigned int hclk; | 62 | unsigned int hclk; |
63 | unsigned long capabilities; | ||
63 | void (*set_pwr)(struct platform_device *host, int state); | 64 | void (*set_pwr)(struct platform_device *host, int state); |
64 | void (*set_clk_div)(struct platform_device *host, int state); | 65 | void (*set_clk_div)(struct platform_device *host, int state); |
65 | }; | 66 | }; |
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h index aa9c3789bed4..4321f044d1e4 100644 --- a/include/linux/mfd/ucb1x00.h +++ b/include/linux/mfd/ucb1x00.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/mfd/mcp.h> | 13 | #include <linux/mfd/mcp.h> |
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/semaphore.h> | ||
15 | 16 | ||
16 | #define UCB_IO_DATA 0x00 | 17 | #define UCB_IO_DATA 0x00 |
17 | #define UCB_IO_DIR 0x01 | 18 | #define UCB_IO_DIR 0x01 |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 5184b79c700b..5915f6e3d9ab 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #ifndef __MFD_WM831X_CORE_H__ | 15 | #ifndef __MFD_WM831X_CORE_H__ |
16 | #define __MFD_WM831X_CORE_H__ | 16 | #define __MFD_WM831X_CORE_H__ |
17 | 17 | ||
18 | #include <linux/completion.h> | ||
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | 20 | ||
20 | /* | 21 | /* |
@@ -254,9 +255,14 @@ struct wm831x { | |||
254 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ | 255 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
255 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | 256 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ |
256 | 257 | ||
258 | /* Chip revision based flags */ | ||
259 | unsigned has_gpio_ena:1; /* Has GPIO enable bit */ | ||
260 | unsigned has_cs_sts:1; /* Has current sink status bit */ | ||
261 | |||
257 | int num_gpio; | 262 | int num_gpio; |
258 | 263 | ||
259 | struct mutex auxadc_lock; | 264 | struct mutex auxadc_lock; |
265 | struct completion auxadc_done; | ||
260 | 266 | ||
261 | /* The WM831x has a security key blocking access to certain | 267 | /* The WM831x has a security key blocking access to certain |
262 | * registers. The mutex is taken by the accessors for locking | 268 | * registers. The mutex is taken by the accessors for locking |
diff --git a/include/linux/mfd/wm831x/gpio.h b/include/linux/mfd/wm831x/gpio.h index 2835614af0e3..9b163c58865f 100644 --- a/include/linux/mfd/wm831x/gpio.h +++ b/include/linux/mfd/wm831x/gpio.h | |||
@@ -41,6 +41,10 @@ | |||
41 | #define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */ | 41 | #define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */ |
42 | #define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */ | 42 | #define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */ |
43 | #define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */ | 43 | #define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */ |
44 | #define WM831X_GPN_ENA 0x0080 /* GPN_ENA */ | ||
45 | #define WM831X_GPN_ENA_MASK 0x0080 /* GPN_ENA */ | ||
46 | #define WM831X_GPN_ENA_SHIFT 7 /* GPN_ENA */ | ||
47 | #define WM831X_GPN_ENA_WIDTH 1 /* GPN_ENA */ | ||
44 | #define WM831X_GPN_TRI 0x0080 /* GPN_TRI */ | 48 | #define WM831X_GPN_TRI 0x0080 /* GPN_TRI */ |
45 | #define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */ | 49 | #define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */ |
46 | #define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */ | 50 | #define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */ |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 43868899bf49..98fcc977e82b 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/completion.h> | ||
19 | 20 | ||
20 | #include <linux/mfd/wm8350/audio.h> | 21 | #include <linux/mfd/wm8350/audio.h> |
21 | #include <linux/mfd/wm8350/gpio.h> | 22 | #include <linux/mfd/wm8350/gpio.h> |
@@ -579,6 +580,8 @@ | |||
579 | 580 | ||
580 | #define WM8350_NUM_IRQ 63 | 581 | #define WM8350_NUM_IRQ 63 |
581 | 582 | ||
583 | #define WM8350_NUM_IRQ_REGS 7 | ||
584 | |||
582 | struct wm8350_reg_access { | 585 | struct wm8350_reg_access { |
583 | u16 readable; /* Mask of readable bits */ | 586 | u16 readable; /* Mask of readable bits */ |
584 | u16 writable; /* Mask of writable bits */ | 587 | u16 writable; /* Mask of writable bits */ |
@@ -600,11 +603,6 @@ extern const u16 wm8352_mode3_defaults[]; | |||
600 | 603 | ||
601 | struct wm8350; | 604 | struct wm8350; |
602 | 605 | ||
603 | struct wm8350_irq { | ||
604 | irq_handler_t handler; | ||
605 | void *data; | ||
606 | }; | ||
607 | |||
608 | struct wm8350_hwmon { | 606 | struct wm8350_hwmon { |
609 | struct platform_device *pdev; | 607 | struct platform_device *pdev; |
610 | struct device *classdev; | 608 | struct device *classdev; |
@@ -624,11 +622,13 @@ struct wm8350 { | |||
624 | u16 *reg_cache; | 622 | u16 *reg_cache; |
625 | 623 | ||
626 | struct mutex auxadc_mutex; | 624 | struct mutex auxadc_mutex; |
625 | struct completion auxadc_done; | ||
627 | 626 | ||
628 | /* Interrupt handling */ | 627 | /* Interrupt handling */ |
629 | struct mutex irq_mutex; /* IRQ table mutex */ | 628 | struct mutex irq_lock; |
630 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | ||
631 | int chip_irq; | 629 | int chip_irq; |
630 | int irq_base; | ||
631 | u16 irq_masks[WM8350_NUM_IRQ_REGS]; | ||
632 | 632 | ||
633 | /* Client devices */ | 633 | /* Client devices */ |
634 | struct wm8350_codec codec; | 634 | struct wm8350_codec codec; |
@@ -647,11 +647,13 @@ struct wm8350 { | |||
647 | * used by the platform to configure GPIO functions and similar. | 647 | * used by the platform to configure GPIO functions and similar. |
648 | * @irq_high: Set if WM8350 IRQ is active high. | 648 | * @irq_high: Set if WM8350 IRQ is active high. |
649 | * @irq_base: Base IRQ for genirq (not currently used). | 649 | * @irq_base: Base IRQ for genirq (not currently used). |
650 | * @gpio_base: Base for gpiolib. | ||
650 | */ | 651 | */ |
651 | struct wm8350_platform_data { | 652 | struct wm8350_platform_data { |
652 | int (*init)(struct wm8350 *wm8350); | 653 | int (*init)(struct wm8350 *wm8350); |
653 | int irq_high; | 654 | int irq_high; |
654 | int irq_base; | 655 | int irq_base; |
656 | int gpio_base; | ||
655 | }; | 657 | }; |
656 | 658 | ||
657 | 659 | ||
@@ -677,12 +679,33 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | |||
677 | /* | 679 | /* |
678 | * WM8350 internal interrupts | 680 | * WM8350 internal interrupts |
679 | */ | 681 | */ |
680 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | 682 | static inline int wm8350_register_irq(struct wm8350 *wm8350, int irq, |
681 | irq_handler_t handler, unsigned long flags, | 683 | irq_handler_t handler, |
682 | const char *name, void *data); | 684 | unsigned long flags, |
683 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); | 685 | const char *name, void *data) |
684 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | 686 | { |
685 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | 687 | if (!wm8350->irq_base) |
688 | return -ENODEV; | ||
689 | |||
690 | return request_threaded_irq(irq + wm8350->irq_base, NULL, | ||
691 | handler, flags, name, data); | ||
692 | } | ||
693 | |||
694 | static inline void wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data) | ||
695 | { | ||
696 | free_irq(irq + wm8350->irq_base, data); | ||
697 | } | ||
698 | |||
699 | static inline void wm8350_mask_irq(struct wm8350 *wm8350, int irq) | ||
700 | { | ||
701 | disable_irq(irq + wm8350->irq_base); | ||
702 | } | ||
703 | |||
704 | static inline void wm8350_unmask_irq(struct wm8350 *wm8350, int irq) | ||
705 | { | ||
706 | enable_irq(irq + wm8350->irq_base); | ||
707 | } | ||
708 | |||
686 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, | 709 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, |
687 | struct wm8350_platform_data *pdata); | 710 | struct wm8350_platform_data *pdata); |
688 | int wm8350_irq_exit(struct wm8350 *wm8350); | 711 | int wm8350_irq_exit(struct wm8350 *wm8350); |
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h index 71af3d6ebe9d..d657bcd6d955 100644 --- a/include/linux/mfd/wm8350/gpio.h +++ b/include/linux/mfd/wm8350/gpio.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define WM8350_GPIO_FUNCTION_SELECT_2 0x8D | 29 | #define WM8350_GPIO_FUNCTION_SELECT_2 0x8D |
30 | #define WM8350_GPIO_FUNCTION_SELECT_3 0x8E | 30 | #define WM8350_GPIO_FUNCTION_SELECT_3 0x8E |
31 | #define WM8350_GPIO_FUNCTION_SELECT_4 0x8F | 31 | #define WM8350_GPIO_FUNCTION_SELECT_4 0x8F |
32 | #define WM8350_GPIO_LEVEL 0xE6 | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * GPIO Functions | 35 | * GPIO Functions |
diff --git a/include/linux/mfd/wm8350/rtc.h b/include/linux/mfd/wm8350/rtc.h index 24add2bef6c9..ebd72ffc62d1 100644 --- a/include/linux/mfd/wm8350/rtc.h +++ b/include/linux/mfd/wm8350/rtc.h | |||
@@ -263,6 +263,7 @@ struct wm8350_rtc { | |||
263 | struct platform_device *pdev; | 263 | struct platform_device *pdev; |
264 | struct rtc_device *rtc; | 264 | struct rtc_device *rtc; |
265 | int alarm_enabled; /* used over suspend/resume */ | 265 | int alarm_enabled; /* used over suspend/resume */ |
266 | int update_enabled; | ||
266 | }; | 267 | }; |
267 | 268 | ||
268 | #endif | 269 | #endif |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h new file mode 100644 index 000000000000..b06ff2846748 --- /dev/null +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm8994/core.h -- Core interface for WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM8994_CORE_H__ | ||
16 | #define __MFD_WM8994_CORE_H__ | ||
17 | |||
18 | struct regulator_dev; | ||
19 | struct regulator_bulk_data; | ||
20 | |||
21 | #define WM8994_NUM_GPIO_REGS 11 | ||
22 | #define WM8994_NUM_LDO_REGS 2 | ||
23 | |||
24 | struct wm8994 { | ||
25 | struct mutex io_lock; | ||
26 | |||
27 | struct device *dev; | ||
28 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | ||
29 | int bytes, void *dest); | ||
30 | int (*write_dev)(struct wm8994 *wm8994, unsigned short reg, | ||
31 | int bytes, void *src); | ||
32 | |||
33 | void *control_data; | ||
34 | |||
35 | int gpio_base; | ||
36 | |||
37 | /* Used over suspend/resume */ | ||
38 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; | ||
39 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; | ||
40 | |||
41 | struct regulator_dev *dbvdd; | ||
42 | struct regulator_bulk_data *supplies; | ||
43 | }; | ||
44 | |||
45 | /* Device I/O API */ | ||
46 | int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg); | ||
47 | int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg, | ||
48 | unsigned short val); | ||
49 | int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, | ||
50 | unsigned short mask, unsigned short val); | ||
51 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, | ||
52 | int count, u16 *buf); | ||
53 | |||
54 | #endif | ||
diff --git a/include/linux/mfd/wm8994/gpio.h b/include/linux/mfd/wm8994/gpio.h new file mode 100644 index 000000000000..b4d4c22991e8 --- /dev/null +++ b/include/linux/mfd/wm8994/gpio.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm8994/gpio.h - GPIO configuration for WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM8994_GPIO_H__ | ||
16 | #define __MFD_WM8994_GPIO_H__ | ||
17 | |||
18 | #define WM8994_GPIO_MAX 11 | ||
19 | |||
20 | #define WM8994_GP_FN_PIN_SPECIFIC 0 | ||
21 | #define WM8994_GP_FN_GPIO 1 | ||
22 | #define WM8994_GP_FN_SDOUT 2 | ||
23 | #define WM8994_GP_FN_IRQ 3 | ||
24 | #define WM8994_GP_FN_TEMPERATURE 4 | ||
25 | #define WM8994_GP_FN_MICBIAS1_DET 5 | ||
26 | #define WM8994_GP_FN_MICBIAS1_SHORT 6 | ||
27 | #define WM8994_GP_FN_MICBIAS2_DET 7 | ||
28 | #define WM8994_GP_FN_MICBIAS2_SHORT 8 | ||
29 | #define WM8994_GP_FN_FLL1_LOCK 9 | ||
30 | #define WM8994_GP_FN_FLL2_LOCK 10 | ||
31 | #define WM8994_GP_FN_SRC1_LOCK 11 | ||
32 | #define WM8994_GP_FN_SRC2_LOCK 12 | ||
33 | #define WM8994_GP_FN_DRC1_ACT 13 | ||
34 | #define WM8994_GP_FN_DRC2_ACT 14 | ||
35 | #define WM8994_GP_FN_DRC3_ACT 15 | ||
36 | #define WM8994_GP_FN_WSEQ_STATUS 16 | ||
37 | #define WM8994_GP_FN_FIFO_ERROR 17 | ||
38 | #define WM8994_GP_FN_OPCLK 18 | ||
39 | |||
40 | #define WM8994_GPN_DIR 0x8000 /* GPN_DIR */ | ||
41 | #define WM8994_GPN_DIR_MASK 0x8000 /* GPN_DIR */ | ||
42 | #define WM8994_GPN_DIR_SHIFT 15 /* GPN_DIR */ | ||
43 | #define WM8994_GPN_DIR_WIDTH 1 /* GPN_DIR */ | ||
44 | #define WM8994_GPN_PU 0x4000 /* GPN_PU */ | ||
45 | #define WM8994_GPN_PU_MASK 0x4000 /* GPN_PU */ | ||
46 | #define WM8994_GPN_PU_SHIFT 14 /* GPN_PU */ | ||
47 | #define WM8994_GPN_PU_WIDTH 1 /* GPN_PU */ | ||
48 | #define WM8994_GPN_PD 0x2000 /* GPN_PD */ | ||
49 | #define WM8994_GPN_PD_MASK 0x2000 /* GPN_PD */ | ||
50 | #define WM8994_GPN_PD_SHIFT 13 /* GPN_PD */ | ||
51 | #define WM8994_GPN_PD_WIDTH 1 /* GPN_PD */ | ||
52 | #define WM8994_GPN_POL 0x0400 /* GPN_POL */ | ||
53 | #define WM8994_GPN_POL_MASK 0x0400 /* GPN_POL */ | ||
54 | #define WM8994_GPN_POL_SHIFT 10 /* GPN_POL */ | ||
55 | #define WM8994_GPN_POL_WIDTH 1 /* GPN_POL */ | ||
56 | #define WM8994_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */ | ||
57 | #define WM8994_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */ | ||
58 | #define WM8994_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */ | ||
59 | #define WM8994_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */ | ||
60 | #define WM8994_GPN_DB 0x0100 /* GPN_DB */ | ||
61 | #define WM8994_GPN_DB_MASK 0x0100 /* GPN_DB */ | ||
62 | #define WM8994_GPN_DB_SHIFT 8 /* GPN_DB */ | ||
63 | #define WM8994_GPN_DB_WIDTH 1 /* GPN_DB */ | ||
64 | #define WM8994_GPN_LVL 0x0040 /* GPN_LVL */ | ||
65 | #define WM8994_GPN_LVL_MASK 0x0040 /* GPN_LVL */ | ||
66 | #define WM8994_GPN_LVL_SHIFT 6 /* GPN_LVL */ | ||
67 | #define WM8994_GPN_LVL_WIDTH 1 /* GPN_LVL */ | ||
68 | #define WM8994_GPN_FN_MASK 0x001F /* GPN_FN - [4:0] */ | ||
69 | #define WM8994_GPN_FN_SHIFT 0 /* GPN_FN - [4:0] */ | ||
70 | #define WM8994_GPN_FN_WIDTH 5 /* GPN_FN - [4:0] */ | ||
71 | |||
72 | #endif | ||
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h new file mode 100644 index 000000000000..70d6a8687dc5 --- /dev/null +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm8994/pdata.h -- Platform data for WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM8994_PDATA_H__ | ||
16 | #define __MFD_WM8994_PDATA_H__ | ||
17 | |||
18 | #define WM8994_NUM_LDO 2 | ||
19 | #define WM8994_NUM_GPIO 11 | ||
20 | |||
21 | struct wm8994_ldo_pdata { | ||
22 | /** GPIOs to enable regulator, 0 or less if not available */ | ||
23 | int enable; | ||
24 | |||
25 | const char *supply; | ||
26 | struct regulator_init_data *init_data; | ||
27 | }; | ||
28 | |||
29 | #define WM8994_CONFIGURE_GPIO 0x8000 | ||
30 | |||
31 | #define WM8994_DRC_REGS 5 | ||
32 | #define WM8994_EQ_REGS 19 | ||
33 | |||
34 | /** | ||
35 | * DRC configurations are specified with a label and a set of register | ||
36 | * values to write (the enable bits will be ignored). At runtime an | ||
37 | * enumerated control will be presented for each DRC block allowing | ||
38 | * the user to choose the configration to use. | ||
39 | * | ||
40 | * Configurations may be generated by hand or by using the DRC control | ||
41 | * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
42 | * for details. | ||
43 | */ | ||
44 | struct wm8994_drc_cfg { | ||
45 | const char *name; | ||
46 | u16 regs[WM8994_DRC_REGS]; | ||
47 | }; | ||
48 | |||
49 | /** | ||
50 | * ReTune Mobile configurations are specified with a label, sample | ||
51 | * rate and set of values to write (the enable bits will be ignored). | ||
52 | * | ||
53 | * Configurations are expected to be generated using the ReTune Mobile | ||
54 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
55 | */ | ||
56 | struct wm8994_retune_mobile_cfg { | ||
57 | const char *name; | ||
58 | unsigned int rate; | ||
59 | u16 regs[WM8994_EQ_REGS]; | ||
60 | }; | ||
61 | |||
62 | struct wm8994_pdata { | ||
63 | int gpio_base; | ||
64 | |||
65 | /** | ||
66 | * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO | ||
67 | * can be used for all zero values. | ||
68 | */ | ||
69 | int gpio_defaults[WM8994_NUM_GPIO]; | ||
70 | |||
71 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; | ||
72 | |||
73 | |||
74 | int num_drc_cfgs; | ||
75 | struct wm8994_drc_cfg *drc_cfgs; | ||
76 | |||
77 | int num_retune_mobile_cfgs; | ||
78 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; | ||
79 | |||
80 | /* LINEOUT can be differential or single ended */ | ||
81 | unsigned int lineout1_diff:1; | ||
82 | unsigned int lineout2_diff:1; | ||
83 | |||
84 | /* Common mode feedback */ | ||
85 | unsigned int lineout1fb:1; | ||
86 | unsigned int lineout2fb:1; | ||
87 | |||
88 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | ||
89 | unsigned int micbias1_lvl:1; | ||
90 | unsigned int micbias2_lvl:1; | ||
91 | |||
92 | /* Jack detect threashold levels, see datasheet for values */ | ||
93 | unsigned int jd_scthr:2; | ||
94 | unsigned int jd_thr:2; | ||
95 | }; | ||
96 | |||
97 | #endif | ||
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h new file mode 100644 index 000000000000..967f62f54159 --- /dev/null +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -0,0 +1,4292 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm8994/registers.h -- Register definitions for WM8994 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM8994_REGISTERS_H__ | ||
16 | #define __MFD_WM8994_REGISTERS_H__ | ||
17 | |||
18 | /* | ||
19 | * Register values. | ||
20 | */ | ||
21 | #define WM8994_SOFTWARE_RESET 0x00 | ||
22 | #define WM8994_POWER_MANAGEMENT_1 0x01 | ||
23 | #define WM8994_POWER_MANAGEMENT_2 0x02 | ||
24 | #define WM8994_POWER_MANAGEMENT_3 0x03 | ||
25 | #define WM8994_POWER_MANAGEMENT_4 0x04 | ||
26 | #define WM8994_POWER_MANAGEMENT_5 0x05 | ||
27 | #define WM8994_POWER_MANAGEMENT_6 0x06 | ||
28 | #define WM8994_INPUT_MIXER_1 0x15 | ||
29 | #define WM8994_LEFT_LINE_INPUT_1_2_VOLUME 0x18 | ||
30 | #define WM8994_LEFT_LINE_INPUT_3_4_VOLUME 0x19 | ||
31 | #define WM8994_RIGHT_LINE_INPUT_1_2_VOLUME 0x1A | ||
32 | #define WM8994_RIGHT_LINE_INPUT_3_4_VOLUME 0x1B | ||
33 | #define WM8994_LEFT_OUTPUT_VOLUME 0x1C | ||
34 | #define WM8994_RIGHT_OUTPUT_VOLUME 0x1D | ||
35 | #define WM8994_LINE_OUTPUTS_VOLUME 0x1E | ||
36 | #define WM8994_HPOUT2_VOLUME 0x1F | ||
37 | #define WM8994_LEFT_OPGA_VOLUME 0x20 | ||
38 | #define WM8994_RIGHT_OPGA_VOLUME 0x21 | ||
39 | #define WM8994_SPKMIXL_ATTENUATION 0x22 | ||
40 | #define WM8994_SPKMIXR_ATTENUATION 0x23 | ||
41 | #define WM8994_SPKOUT_MIXERS 0x24 | ||
42 | #define WM8994_CLASSD 0x25 | ||
43 | #define WM8994_SPEAKER_VOLUME_LEFT 0x26 | ||
44 | #define WM8994_SPEAKER_VOLUME_RIGHT 0x27 | ||
45 | #define WM8994_INPUT_MIXER_2 0x28 | ||
46 | #define WM8994_INPUT_MIXER_3 0x29 | ||
47 | #define WM8994_INPUT_MIXER_4 0x2A | ||
48 | #define WM8994_INPUT_MIXER_5 0x2B | ||
49 | #define WM8994_INPUT_MIXER_6 0x2C | ||
50 | #define WM8994_OUTPUT_MIXER_1 0x2D | ||
51 | #define WM8994_OUTPUT_MIXER_2 0x2E | ||
52 | #define WM8994_OUTPUT_MIXER_3 0x2F | ||
53 | #define WM8994_OUTPUT_MIXER_4 0x30 | ||
54 | #define WM8994_OUTPUT_MIXER_5 0x31 | ||
55 | #define WM8994_OUTPUT_MIXER_6 0x32 | ||
56 | #define WM8994_HPOUT2_MIXER 0x33 | ||
57 | #define WM8994_LINE_MIXER_1 0x34 | ||
58 | #define WM8994_LINE_MIXER_2 0x35 | ||
59 | #define WM8994_SPEAKER_MIXER 0x36 | ||
60 | #define WM8994_ADDITIONAL_CONTROL 0x37 | ||
61 | #define WM8994_ANTIPOP_1 0x38 | ||
62 | #define WM8994_ANTIPOP_2 0x39 | ||
63 | #define WM8994_MICBIAS 0x3A | ||
64 | #define WM8994_LDO_1 0x3B | ||
65 | #define WM8994_LDO_2 0x3C | ||
66 | #define WM8994_CHARGE_PUMP_1 0x4C | ||
67 | #define WM8994_CLASS_W_1 0x51 | ||
68 | #define WM8994_DC_SERVO_1 0x54 | ||
69 | #define WM8994_DC_SERVO_2 0x55 | ||
70 | #define WM8994_DC_SERVO_4 0x57 | ||
71 | #define WM8994_DC_SERVO_READBACK 0x58 | ||
72 | #define WM8994_ANALOGUE_HP_1 0x60 | ||
73 | #define WM8994_CHIP_REVISION 0x100 | ||
74 | #define WM8994_CONTROL_INTERFACE 0x101 | ||
75 | #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 | ||
76 | #define WM8994_WRITE_SEQUENCER_CTRL_2 0x111 | ||
77 | #define WM8994_AIF1_CLOCKING_1 0x200 | ||
78 | #define WM8994_AIF1_CLOCKING_2 0x201 | ||
79 | #define WM8994_AIF2_CLOCKING_1 0x204 | ||
80 | #define WM8994_AIF2_CLOCKING_2 0x205 | ||
81 | #define WM8994_CLOCKING_1 0x208 | ||
82 | #define WM8994_CLOCKING_2 0x209 | ||
83 | #define WM8994_AIF1_RATE 0x210 | ||
84 | #define WM8994_AIF2_RATE 0x211 | ||
85 | #define WM8994_RATE_STATUS 0x212 | ||
86 | #define WM8994_FLL1_CONTROL_1 0x220 | ||
87 | #define WM8994_FLL1_CONTROL_2 0x221 | ||
88 | #define WM8994_FLL1_CONTROL_3 0x222 | ||
89 | #define WM8994_FLL1_CONTROL_4 0x223 | ||
90 | #define WM8994_FLL1_CONTROL_5 0x224 | ||
91 | #define WM8994_FLL2_CONTROL_1 0x240 | ||
92 | #define WM8994_FLL2_CONTROL_2 0x241 | ||
93 | #define WM8994_FLL2_CONTROL_3 0x242 | ||
94 | #define WM8994_FLL2_CONTROL_4 0x243 | ||
95 | #define WM8994_FLL2_CONTROL_5 0x244 | ||
96 | #define WM8994_AIF1_CONTROL_1 0x300 | ||
97 | #define WM8994_AIF1_CONTROL_2 0x301 | ||
98 | #define WM8994_AIF1_MASTER_SLAVE 0x302 | ||
99 | #define WM8994_AIF1_BCLK 0x303 | ||
100 | #define WM8994_AIF1ADC_LRCLK 0x304 | ||
101 | #define WM8994_AIF1DAC_LRCLK 0x305 | ||
102 | #define WM8994_AIF1DAC_DATA 0x306 | ||
103 | #define WM8994_AIF1ADC_DATA 0x307 | ||
104 | #define WM8994_AIF2_CONTROL_1 0x310 | ||
105 | #define WM8994_AIF2_CONTROL_2 0x311 | ||
106 | #define WM8994_AIF2_MASTER_SLAVE 0x312 | ||
107 | #define WM8994_AIF2_BCLK 0x313 | ||
108 | #define WM8994_AIF2ADC_LRCLK 0x314 | ||
109 | #define WM8994_AIF2DAC_LRCLK 0x315 | ||
110 | #define WM8994_AIF2DAC_DATA 0x316 | ||
111 | #define WM8994_AIF2ADC_DATA 0x317 | ||
112 | #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 | ||
113 | #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 | ||
114 | #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 | ||
115 | #define WM8994_AIF1_DAC1_RIGHT_VOLUME 0x403 | ||
116 | #define WM8994_AIF1_ADC2_LEFT_VOLUME 0x404 | ||
117 | #define WM8994_AIF1_ADC2_RIGHT_VOLUME 0x405 | ||
118 | #define WM8994_AIF1_DAC2_LEFT_VOLUME 0x406 | ||
119 | #define WM8994_AIF1_DAC2_RIGHT_VOLUME 0x407 | ||
120 | #define WM8994_AIF1_ADC1_FILTERS 0x410 | ||
121 | #define WM8994_AIF1_ADC2_FILTERS 0x411 | ||
122 | #define WM8994_AIF1_DAC1_FILTERS_1 0x420 | ||
123 | #define WM8994_AIF1_DAC1_FILTERS_2 0x421 | ||
124 | #define WM8994_AIF1_DAC2_FILTERS_1 0x422 | ||
125 | #define WM8994_AIF1_DAC2_FILTERS_2 0x423 | ||
126 | #define WM8994_AIF1_DRC1_1 0x440 | ||
127 | #define WM8994_AIF1_DRC1_2 0x441 | ||
128 | #define WM8994_AIF1_DRC1_3 0x442 | ||
129 | #define WM8994_AIF1_DRC1_4 0x443 | ||
130 | #define WM8994_AIF1_DRC1_5 0x444 | ||
131 | #define WM8994_AIF1_DRC2_1 0x450 | ||
132 | #define WM8994_AIF1_DRC2_2 0x451 | ||
133 | #define WM8994_AIF1_DRC2_3 0x452 | ||
134 | #define WM8994_AIF1_DRC2_4 0x453 | ||
135 | #define WM8994_AIF1_DRC2_5 0x454 | ||
136 | #define WM8994_AIF1_DAC1_EQ_GAINS_1 0x480 | ||
137 | #define WM8994_AIF1_DAC1_EQ_GAINS_2 0x481 | ||
138 | #define WM8994_AIF1_DAC1_EQ_BAND_1_A 0x482 | ||
139 | #define WM8994_AIF1_DAC1_EQ_BAND_1_B 0x483 | ||
140 | #define WM8994_AIF1_DAC1_EQ_BAND_1_PG 0x484 | ||
141 | #define WM8994_AIF1_DAC1_EQ_BAND_2_A 0x485 | ||
142 | #define WM8994_AIF1_DAC1_EQ_BAND_2_B 0x486 | ||
143 | #define WM8994_AIF1_DAC1_EQ_BAND_2_C 0x487 | ||
144 | #define WM8994_AIF1_DAC1_EQ_BAND_2_PG 0x488 | ||
145 | #define WM8994_AIF1_DAC1_EQ_BAND_3_A 0x489 | ||
146 | #define WM8994_AIF1_DAC1_EQ_BAND_3_B 0x48A | ||
147 | #define WM8994_AIF1_DAC1_EQ_BAND_3_C 0x48B | ||
148 | #define WM8994_AIF1_DAC1_EQ_BAND_3_PG 0x48C | ||
149 | #define WM8994_AIF1_DAC1_EQ_BAND_4_A 0x48D | ||
150 | #define WM8994_AIF1_DAC1_EQ_BAND_4_B 0x48E | ||
151 | #define WM8994_AIF1_DAC1_EQ_BAND_4_C 0x48F | ||
152 | #define WM8994_AIF1_DAC1_EQ_BAND_4_PG 0x490 | ||
153 | #define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491 | ||
154 | #define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492 | ||
155 | #define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493 | ||
156 | #define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0 | ||
157 | #define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1 | ||
158 | #define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2 | ||
159 | #define WM8994_AIF1_DAC2_EQ_BAND_1_B 0x4A3 | ||
160 | #define WM8994_AIF1_DAC2_EQ_BAND_1_PG 0x4A4 | ||
161 | #define WM8994_AIF1_DAC2_EQ_BAND_2_A 0x4A5 | ||
162 | #define WM8994_AIF1_DAC2_EQ_BAND_2_B 0x4A6 | ||
163 | #define WM8994_AIF1_DAC2_EQ_BAND_2_C 0x4A7 | ||
164 | #define WM8994_AIF1_DAC2_EQ_BAND_2_PG 0x4A8 | ||
165 | #define WM8994_AIF1_DAC2_EQ_BAND_3_A 0x4A9 | ||
166 | #define WM8994_AIF1_DAC2_EQ_BAND_3_B 0x4AA | ||
167 | #define WM8994_AIF1_DAC2_EQ_BAND_3_C 0x4AB | ||
168 | #define WM8994_AIF1_DAC2_EQ_BAND_3_PG 0x4AC | ||
169 | #define WM8994_AIF1_DAC2_EQ_BAND_4_A 0x4AD | ||
170 | #define WM8994_AIF1_DAC2_EQ_BAND_4_B 0x4AE | ||
171 | #define WM8994_AIF1_DAC2_EQ_BAND_4_C 0x4AF | ||
172 | #define WM8994_AIF1_DAC2_EQ_BAND_4_PG 0x4B0 | ||
173 | #define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1 | ||
174 | #define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2 | ||
175 | #define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3 | ||
176 | #define WM8994_AIF2_ADC_LEFT_VOLUME 0x500 | ||
177 | #define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501 | ||
178 | #define WM8994_AIF2_DAC_LEFT_VOLUME 0x502 | ||
179 | #define WM8994_AIF2_DAC_RIGHT_VOLUME 0x503 | ||
180 | #define WM8994_AIF2_ADC_FILTERS 0x510 | ||
181 | #define WM8994_AIF2_DAC_FILTERS_1 0x520 | ||
182 | #define WM8994_AIF2_DAC_FILTERS_2 0x521 | ||
183 | #define WM8994_AIF2_DRC_1 0x540 | ||
184 | #define WM8994_AIF2_DRC_2 0x541 | ||
185 | #define WM8994_AIF2_DRC_3 0x542 | ||
186 | #define WM8994_AIF2_DRC_4 0x543 | ||
187 | #define WM8994_AIF2_DRC_5 0x544 | ||
188 | #define WM8994_AIF2_EQ_GAINS_1 0x580 | ||
189 | #define WM8994_AIF2_EQ_GAINS_2 0x581 | ||
190 | #define WM8994_AIF2_EQ_BAND_1_A 0x582 | ||
191 | #define WM8994_AIF2_EQ_BAND_1_B 0x583 | ||
192 | #define WM8994_AIF2_EQ_BAND_1_PG 0x584 | ||
193 | #define WM8994_AIF2_EQ_BAND_2_A 0x585 | ||
194 | #define WM8994_AIF2_EQ_BAND_2_B 0x586 | ||
195 | #define WM8994_AIF2_EQ_BAND_2_C 0x587 | ||
196 | #define WM8994_AIF2_EQ_BAND_2_PG 0x588 | ||
197 | #define WM8994_AIF2_EQ_BAND_3_A 0x589 | ||
198 | #define WM8994_AIF2_EQ_BAND_3_B 0x58A | ||
199 | #define WM8994_AIF2_EQ_BAND_3_C 0x58B | ||
200 | #define WM8994_AIF2_EQ_BAND_3_PG 0x58C | ||
201 | #define WM8994_AIF2_EQ_BAND_4_A 0x58D | ||
202 | #define WM8994_AIF2_EQ_BAND_4_B 0x58E | ||
203 | #define WM8994_AIF2_EQ_BAND_4_C 0x58F | ||
204 | #define WM8994_AIF2_EQ_BAND_4_PG 0x590 | ||
205 | #define WM8994_AIF2_EQ_BAND_5_A 0x591 | ||
206 | #define WM8994_AIF2_EQ_BAND_5_B 0x592 | ||
207 | #define WM8994_AIF2_EQ_BAND_5_PG 0x593 | ||
208 | #define WM8994_DAC1_MIXER_VOLUMES 0x600 | ||
209 | #define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601 | ||
210 | #define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602 | ||
211 | #define WM8994_DAC2_MIXER_VOLUMES 0x603 | ||
212 | #define WM8994_DAC2_LEFT_MIXER_ROUTING 0x604 | ||
213 | #define WM8994_DAC2_RIGHT_MIXER_ROUTING 0x605 | ||
214 | #define WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING 0x606 | ||
215 | #define WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING 0x607 | ||
216 | #define WM8994_AIF1_ADC2_LEFT_MIXER_ROUTING 0x608 | ||
217 | #define WM8994_AIF1_ADC2_RIGHT_MIXER_ROUTING 0x609 | ||
218 | #define WM8994_DAC1_LEFT_VOLUME 0x610 | ||
219 | #define WM8994_DAC1_RIGHT_VOLUME 0x611 | ||
220 | #define WM8994_DAC2_LEFT_VOLUME 0x612 | ||
221 | #define WM8994_DAC2_RIGHT_VOLUME 0x613 | ||
222 | #define WM8994_DAC_SOFTMUTE 0x614 | ||
223 | #define WM8994_OVERSAMPLING 0x620 | ||
224 | #define WM8994_SIDETONE 0x621 | ||
225 | #define WM8994_GPIO_1 0x700 | ||
226 | #define WM8994_GPIO_2 0x701 | ||
227 | #define WM8994_GPIO_3 0x702 | ||
228 | #define WM8994_GPIO_4 0x703 | ||
229 | #define WM8994_GPIO_5 0x704 | ||
230 | #define WM8994_GPIO_6 0x705 | ||
231 | #define WM8994_GPIO_7 0x706 | ||
232 | #define WM8994_GPIO_8 0x707 | ||
233 | #define WM8994_GPIO_9 0x708 | ||
234 | #define WM8994_GPIO_10 0x709 | ||
235 | #define WM8994_GPIO_11 0x70A | ||
236 | #define WM8994_PULL_CONTROL_1 0x720 | ||
237 | #define WM8994_PULL_CONTROL_2 0x721 | ||
238 | #define WM8994_INTERRUPT_STATUS_1 0x730 | ||
239 | #define WM8994_INTERRUPT_STATUS_2 0x731 | ||
240 | #define WM8994_INTERRUPT_RAW_STATUS_2 0x732 | ||
241 | #define WM8994_INTERRUPT_STATUS_1_MASK 0x738 | ||
242 | #define WM8994_INTERRUPT_STATUS_2_MASK 0x739 | ||
243 | #define WM8994_INTERRUPT_CONTROL 0x740 | ||
244 | #define WM8994_IRQ_DEBOUNCE 0x748 | ||
245 | #define WM8994_WRITE_SEQUENCER_0 0x3000 | ||
246 | #define WM8994_WRITE_SEQUENCER_1 0x3001 | ||
247 | #define WM8994_WRITE_SEQUENCER_2 0x3002 | ||
248 | #define WM8994_WRITE_SEQUENCER_3 0x3003 | ||
249 | #define WM8994_WRITE_SEQUENCER_4 0x3004 | ||
250 | #define WM8994_WRITE_SEQUENCER_5 0x3005 | ||
251 | #define WM8994_WRITE_SEQUENCER_6 0x3006 | ||
252 | #define WM8994_WRITE_SEQUENCER_7 0x3007 | ||
253 | #define WM8994_WRITE_SEQUENCER_8 0x3008 | ||
254 | #define WM8994_WRITE_SEQUENCER_9 0x3009 | ||
255 | #define WM8994_WRITE_SEQUENCER_10 0x300A | ||
256 | #define WM8994_WRITE_SEQUENCER_11 0x300B | ||
257 | #define WM8994_WRITE_SEQUENCER_12 0x300C | ||
258 | #define WM8994_WRITE_SEQUENCER_13 0x300D | ||
259 | #define WM8994_WRITE_SEQUENCER_14 0x300E | ||
260 | #define WM8994_WRITE_SEQUENCER_15 0x300F | ||
261 | #define WM8994_WRITE_SEQUENCER_16 0x3010 | ||
262 | #define WM8994_WRITE_SEQUENCER_17 0x3011 | ||
263 | #define WM8994_WRITE_SEQUENCER_18 0x3012 | ||
264 | #define WM8994_WRITE_SEQUENCER_19 0x3013 | ||
265 | #define WM8994_WRITE_SEQUENCER_20 0x3014 | ||
266 | #define WM8994_WRITE_SEQUENCER_21 0x3015 | ||
267 | #define WM8994_WRITE_SEQUENCER_22 0x3016 | ||
268 | #define WM8994_WRITE_SEQUENCER_23 0x3017 | ||
269 | #define WM8994_WRITE_SEQUENCER_24 0x3018 | ||
270 | #define WM8994_WRITE_SEQUENCER_25 0x3019 | ||
271 | #define WM8994_WRITE_SEQUENCER_26 0x301A | ||
272 | #define WM8994_WRITE_SEQUENCER_27 0x301B | ||
273 | #define WM8994_WRITE_SEQUENCER_28 0x301C | ||
274 | #define WM8994_WRITE_SEQUENCER_29 0x301D | ||
275 | #define WM8994_WRITE_SEQUENCER_30 0x301E | ||
276 | #define WM8994_WRITE_SEQUENCER_31 0x301F | ||
277 | #define WM8994_WRITE_SEQUENCER_32 0x3020 | ||
278 | #define WM8994_WRITE_SEQUENCER_33 0x3021 | ||
279 | #define WM8994_WRITE_SEQUENCER_34 0x3022 | ||
280 | #define WM8994_WRITE_SEQUENCER_35 0x3023 | ||
281 | #define WM8994_WRITE_SEQUENCER_36 0x3024 | ||
282 | #define WM8994_WRITE_SEQUENCER_37 0x3025 | ||
283 | #define WM8994_WRITE_SEQUENCER_38 0x3026 | ||
284 | #define WM8994_WRITE_SEQUENCER_39 0x3027 | ||
285 | #define WM8994_WRITE_SEQUENCER_40 0x3028 | ||
286 | #define WM8994_WRITE_SEQUENCER_41 0x3029 | ||
287 | #define WM8994_WRITE_SEQUENCER_42 0x302A | ||
288 | #define WM8994_WRITE_SEQUENCER_43 0x302B | ||
289 | #define WM8994_WRITE_SEQUENCER_44 0x302C | ||
290 | #define WM8994_WRITE_SEQUENCER_45 0x302D | ||
291 | #define WM8994_WRITE_SEQUENCER_46 0x302E | ||
292 | #define WM8994_WRITE_SEQUENCER_47 0x302F | ||
293 | #define WM8994_WRITE_SEQUENCER_48 0x3030 | ||
294 | #define WM8994_WRITE_SEQUENCER_49 0x3031 | ||
295 | #define WM8994_WRITE_SEQUENCER_50 0x3032 | ||
296 | #define WM8994_WRITE_SEQUENCER_51 0x3033 | ||
297 | #define WM8994_WRITE_SEQUENCER_52 0x3034 | ||
298 | #define WM8994_WRITE_SEQUENCER_53 0x3035 | ||
299 | #define WM8994_WRITE_SEQUENCER_54 0x3036 | ||
300 | #define WM8994_WRITE_SEQUENCER_55 0x3037 | ||
301 | #define WM8994_WRITE_SEQUENCER_56 0x3038 | ||
302 | #define WM8994_WRITE_SEQUENCER_57 0x3039 | ||
303 | #define WM8994_WRITE_SEQUENCER_58 0x303A | ||
304 | #define WM8994_WRITE_SEQUENCER_59 0x303B | ||
305 | #define WM8994_WRITE_SEQUENCER_60 0x303C | ||
306 | #define WM8994_WRITE_SEQUENCER_61 0x303D | ||
307 | #define WM8994_WRITE_SEQUENCER_62 0x303E | ||
308 | #define WM8994_WRITE_SEQUENCER_63 0x303F | ||
309 | #define WM8994_WRITE_SEQUENCER_64 0x3040 | ||
310 | #define WM8994_WRITE_SEQUENCER_65 0x3041 | ||
311 | #define WM8994_WRITE_SEQUENCER_66 0x3042 | ||
312 | #define WM8994_WRITE_SEQUENCER_67 0x3043 | ||
313 | #define WM8994_WRITE_SEQUENCER_68 0x3044 | ||
314 | #define WM8994_WRITE_SEQUENCER_69 0x3045 | ||
315 | #define WM8994_WRITE_SEQUENCER_70 0x3046 | ||
316 | #define WM8994_WRITE_SEQUENCER_71 0x3047 | ||
317 | #define WM8994_WRITE_SEQUENCER_72 0x3048 | ||
318 | #define WM8994_WRITE_SEQUENCER_73 0x3049 | ||
319 | #define WM8994_WRITE_SEQUENCER_74 0x304A | ||
320 | #define WM8994_WRITE_SEQUENCER_75 0x304B | ||
321 | #define WM8994_WRITE_SEQUENCER_76 0x304C | ||
322 | #define WM8994_WRITE_SEQUENCER_77 0x304D | ||
323 | #define WM8994_WRITE_SEQUENCER_78 0x304E | ||
324 | #define WM8994_WRITE_SEQUENCER_79 0x304F | ||
325 | #define WM8994_WRITE_SEQUENCER_80 0x3050 | ||
326 | #define WM8994_WRITE_SEQUENCER_81 0x3051 | ||
327 | #define WM8994_WRITE_SEQUENCER_82 0x3052 | ||
328 | #define WM8994_WRITE_SEQUENCER_83 0x3053 | ||
329 | #define WM8994_WRITE_SEQUENCER_84 0x3054 | ||
330 | #define WM8994_WRITE_SEQUENCER_85 0x3055 | ||
331 | #define WM8994_WRITE_SEQUENCER_86 0x3056 | ||
332 | #define WM8994_WRITE_SEQUENCER_87 0x3057 | ||
333 | #define WM8994_WRITE_SEQUENCER_88 0x3058 | ||
334 | #define WM8994_WRITE_SEQUENCER_89 0x3059 | ||
335 | #define WM8994_WRITE_SEQUENCER_90 0x305A | ||
336 | #define WM8994_WRITE_SEQUENCER_91 0x305B | ||
337 | #define WM8994_WRITE_SEQUENCER_92 0x305C | ||
338 | #define WM8994_WRITE_SEQUENCER_93 0x305D | ||
339 | #define WM8994_WRITE_SEQUENCER_94 0x305E | ||
340 | #define WM8994_WRITE_SEQUENCER_95 0x305F | ||
341 | #define WM8994_WRITE_SEQUENCER_96 0x3060 | ||
342 | #define WM8994_WRITE_SEQUENCER_97 0x3061 | ||
343 | #define WM8994_WRITE_SEQUENCER_98 0x3062 | ||
344 | #define WM8994_WRITE_SEQUENCER_99 0x3063 | ||
345 | #define WM8994_WRITE_SEQUENCER_100 0x3064 | ||
346 | #define WM8994_WRITE_SEQUENCER_101 0x3065 | ||
347 | #define WM8994_WRITE_SEQUENCER_102 0x3066 | ||
348 | #define WM8994_WRITE_SEQUENCER_103 0x3067 | ||
349 | #define WM8994_WRITE_SEQUENCER_104 0x3068 | ||
350 | #define WM8994_WRITE_SEQUENCER_105 0x3069 | ||
351 | #define WM8994_WRITE_SEQUENCER_106 0x306A | ||
352 | #define WM8994_WRITE_SEQUENCER_107 0x306B | ||
353 | #define WM8994_WRITE_SEQUENCER_108 0x306C | ||
354 | #define WM8994_WRITE_SEQUENCER_109 0x306D | ||
355 | #define WM8994_WRITE_SEQUENCER_110 0x306E | ||
356 | #define WM8994_WRITE_SEQUENCER_111 0x306F | ||
357 | #define WM8994_WRITE_SEQUENCER_112 0x3070 | ||
358 | #define WM8994_WRITE_SEQUENCER_113 0x3071 | ||
359 | #define WM8994_WRITE_SEQUENCER_114 0x3072 | ||
360 | #define WM8994_WRITE_SEQUENCER_115 0x3073 | ||
361 | #define WM8994_WRITE_SEQUENCER_116 0x3074 | ||
362 | #define WM8994_WRITE_SEQUENCER_117 0x3075 | ||
363 | #define WM8994_WRITE_SEQUENCER_118 0x3076 | ||
364 | #define WM8994_WRITE_SEQUENCER_119 0x3077 | ||
365 | #define WM8994_WRITE_SEQUENCER_120 0x3078 | ||
366 | #define WM8994_WRITE_SEQUENCER_121 0x3079 | ||
367 | #define WM8994_WRITE_SEQUENCER_122 0x307A | ||
368 | #define WM8994_WRITE_SEQUENCER_123 0x307B | ||
369 | #define WM8994_WRITE_SEQUENCER_124 0x307C | ||
370 | #define WM8994_WRITE_SEQUENCER_125 0x307D | ||
371 | #define WM8994_WRITE_SEQUENCER_126 0x307E | ||
372 | #define WM8994_WRITE_SEQUENCER_127 0x307F | ||
373 | #define WM8994_WRITE_SEQUENCER_128 0x3080 | ||
374 | #define WM8994_WRITE_SEQUENCER_129 0x3081 | ||
375 | #define WM8994_WRITE_SEQUENCER_130 0x3082 | ||
376 | #define WM8994_WRITE_SEQUENCER_131 0x3083 | ||
377 | #define WM8994_WRITE_SEQUENCER_132 0x3084 | ||
378 | #define WM8994_WRITE_SEQUENCER_133 0x3085 | ||
379 | #define WM8994_WRITE_SEQUENCER_134 0x3086 | ||
380 | #define WM8994_WRITE_SEQUENCER_135 0x3087 | ||
381 | #define WM8994_WRITE_SEQUENCER_136 0x3088 | ||
382 | #define WM8994_WRITE_SEQUENCER_137 0x3089 | ||
383 | #define WM8994_WRITE_SEQUENCER_138 0x308A | ||
384 | #define WM8994_WRITE_SEQUENCER_139 0x308B | ||
385 | #define WM8994_WRITE_SEQUENCER_140 0x308C | ||
386 | #define WM8994_WRITE_SEQUENCER_141 0x308D | ||
387 | #define WM8994_WRITE_SEQUENCER_142 0x308E | ||
388 | #define WM8994_WRITE_SEQUENCER_143 0x308F | ||
389 | #define WM8994_WRITE_SEQUENCER_144 0x3090 | ||
390 | #define WM8994_WRITE_SEQUENCER_145 0x3091 | ||
391 | #define WM8994_WRITE_SEQUENCER_146 0x3092 | ||
392 | #define WM8994_WRITE_SEQUENCER_147 0x3093 | ||
393 | #define WM8994_WRITE_SEQUENCER_148 0x3094 | ||
394 | #define WM8994_WRITE_SEQUENCER_149 0x3095 | ||
395 | #define WM8994_WRITE_SEQUENCER_150 0x3096 | ||
396 | #define WM8994_WRITE_SEQUENCER_151 0x3097 | ||
397 | #define WM8994_WRITE_SEQUENCER_152 0x3098 | ||
398 | #define WM8994_WRITE_SEQUENCER_153 0x3099 | ||
399 | #define WM8994_WRITE_SEQUENCER_154 0x309A | ||
400 | #define WM8994_WRITE_SEQUENCER_155 0x309B | ||
401 | #define WM8994_WRITE_SEQUENCER_156 0x309C | ||
402 | #define WM8994_WRITE_SEQUENCER_157 0x309D | ||
403 | #define WM8994_WRITE_SEQUENCER_158 0x309E | ||
404 | #define WM8994_WRITE_SEQUENCER_159 0x309F | ||
405 | #define WM8994_WRITE_SEQUENCER_160 0x30A0 | ||
406 | #define WM8994_WRITE_SEQUENCER_161 0x30A1 | ||
407 | #define WM8994_WRITE_SEQUENCER_162 0x30A2 | ||
408 | #define WM8994_WRITE_SEQUENCER_163 0x30A3 | ||
409 | #define WM8994_WRITE_SEQUENCER_164 0x30A4 | ||
410 | #define WM8994_WRITE_SEQUENCER_165 0x30A5 | ||
411 | #define WM8994_WRITE_SEQUENCER_166 0x30A6 | ||
412 | #define WM8994_WRITE_SEQUENCER_167 0x30A7 | ||
413 | #define WM8994_WRITE_SEQUENCER_168 0x30A8 | ||
414 | #define WM8994_WRITE_SEQUENCER_169 0x30A9 | ||
415 | #define WM8994_WRITE_SEQUENCER_170 0x30AA | ||
416 | #define WM8994_WRITE_SEQUENCER_171 0x30AB | ||
417 | #define WM8994_WRITE_SEQUENCER_172 0x30AC | ||
418 | #define WM8994_WRITE_SEQUENCER_173 0x30AD | ||
419 | #define WM8994_WRITE_SEQUENCER_174 0x30AE | ||
420 | #define WM8994_WRITE_SEQUENCER_175 0x30AF | ||
421 | #define WM8994_WRITE_SEQUENCER_176 0x30B0 | ||
422 | #define WM8994_WRITE_SEQUENCER_177 0x30B1 | ||
423 | #define WM8994_WRITE_SEQUENCER_178 0x30B2 | ||
424 | #define WM8994_WRITE_SEQUENCER_179 0x30B3 | ||
425 | #define WM8994_WRITE_SEQUENCER_180 0x30B4 | ||
426 | #define WM8994_WRITE_SEQUENCER_181 0x30B5 | ||
427 | #define WM8994_WRITE_SEQUENCER_182 0x30B6 | ||
428 | #define WM8994_WRITE_SEQUENCER_183 0x30B7 | ||
429 | #define WM8994_WRITE_SEQUENCER_184 0x30B8 | ||
430 | #define WM8994_WRITE_SEQUENCER_185 0x30B9 | ||
431 | #define WM8994_WRITE_SEQUENCER_186 0x30BA | ||
432 | #define WM8994_WRITE_SEQUENCER_187 0x30BB | ||
433 | #define WM8994_WRITE_SEQUENCER_188 0x30BC | ||
434 | #define WM8994_WRITE_SEQUENCER_189 0x30BD | ||
435 | #define WM8994_WRITE_SEQUENCER_190 0x30BE | ||
436 | #define WM8994_WRITE_SEQUENCER_191 0x30BF | ||
437 | #define WM8994_WRITE_SEQUENCER_192 0x30C0 | ||
438 | #define WM8994_WRITE_SEQUENCER_193 0x30C1 | ||
439 | #define WM8994_WRITE_SEQUENCER_194 0x30C2 | ||
440 | #define WM8994_WRITE_SEQUENCER_195 0x30C3 | ||
441 | #define WM8994_WRITE_SEQUENCER_196 0x30C4 | ||
442 | #define WM8994_WRITE_SEQUENCER_197 0x30C5 | ||
443 | #define WM8994_WRITE_SEQUENCER_198 0x30C6 | ||
444 | #define WM8994_WRITE_SEQUENCER_199 0x30C7 | ||
445 | #define WM8994_WRITE_SEQUENCER_200 0x30C8 | ||
446 | #define WM8994_WRITE_SEQUENCER_201 0x30C9 | ||
447 | #define WM8994_WRITE_SEQUENCER_202 0x30CA | ||
448 | #define WM8994_WRITE_SEQUENCER_203 0x30CB | ||
449 | #define WM8994_WRITE_SEQUENCER_204 0x30CC | ||
450 | #define WM8994_WRITE_SEQUENCER_205 0x30CD | ||
451 | #define WM8994_WRITE_SEQUENCER_206 0x30CE | ||
452 | #define WM8994_WRITE_SEQUENCER_207 0x30CF | ||
453 | #define WM8994_WRITE_SEQUENCER_208 0x30D0 | ||
454 | #define WM8994_WRITE_SEQUENCER_209 0x30D1 | ||
455 | #define WM8994_WRITE_SEQUENCER_210 0x30D2 | ||
456 | #define WM8994_WRITE_SEQUENCER_211 0x30D3 | ||
457 | #define WM8994_WRITE_SEQUENCER_212 0x30D4 | ||
458 | #define WM8994_WRITE_SEQUENCER_213 0x30D5 | ||
459 | #define WM8994_WRITE_SEQUENCER_214 0x30D6 | ||
460 | #define WM8994_WRITE_SEQUENCER_215 0x30D7 | ||
461 | #define WM8994_WRITE_SEQUENCER_216 0x30D8 | ||
462 | #define WM8994_WRITE_SEQUENCER_217 0x30D9 | ||
463 | #define WM8994_WRITE_SEQUENCER_218 0x30DA | ||
464 | #define WM8994_WRITE_SEQUENCER_219 0x30DB | ||
465 | #define WM8994_WRITE_SEQUENCER_220 0x30DC | ||
466 | #define WM8994_WRITE_SEQUENCER_221 0x30DD | ||
467 | #define WM8994_WRITE_SEQUENCER_222 0x30DE | ||
468 | #define WM8994_WRITE_SEQUENCER_223 0x30DF | ||
469 | #define WM8994_WRITE_SEQUENCER_224 0x30E0 | ||
470 | #define WM8994_WRITE_SEQUENCER_225 0x30E1 | ||
471 | #define WM8994_WRITE_SEQUENCER_226 0x30E2 | ||
472 | #define WM8994_WRITE_SEQUENCER_227 0x30E3 | ||
473 | #define WM8994_WRITE_SEQUENCER_228 0x30E4 | ||
474 | #define WM8994_WRITE_SEQUENCER_229 0x30E5 | ||
475 | #define WM8994_WRITE_SEQUENCER_230 0x30E6 | ||
476 | #define WM8994_WRITE_SEQUENCER_231 0x30E7 | ||
477 | #define WM8994_WRITE_SEQUENCER_232 0x30E8 | ||
478 | #define WM8994_WRITE_SEQUENCER_233 0x30E9 | ||
479 | #define WM8994_WRITE_SEQUENCER_234 0x30EA | ||
480 | #define WM8994_WRITE_SEQUENCER_235 0x30EB | ||
481 | #define WM8994_WRITE_SEQUENCER_236 0x30EC | ||
482 | #define WM8994_WRITE_SEQUENCER_237 0x30ED | ||
483 | #define WM8994_WRITE_SEQUENCER_238 0x30EE | ||
484 | #define WM8994_WRITE_SEQUENCER_239 0x30EF | ||
485 | #define WM8994_WRITE_SEQUENCER_240 0x30F0 | ||
486 | #define WM8994_WRITE_SEQUENCER_241 0x30F1 | ||
487 | #define WM8994_WRITE_SEQUENCER_242 0x30F2 | ||
488 | #define WM8994_WRITE_SEQUENCER_243 0x30F3 | ||
489 | #define WM8994_WRITE_SEQUENCER_244 0x30F4 | ||
490 | #define WM8994_WRITE_SEQUENCER_245 0x30F5 | ||
491 | #define WM8994_WRITE_SEQUENCER_246 0x30F6 | ||
492 | #define WM8994_WRITE_SEQUENCER_247 0x30F7 | ||
493 | #define WM8994_WRITE_SEQUENCER_248 0x30F8 | ||
494 | #define WM8994_WRITE_SEQUENCER_249 0x30F9 | ||
495 | #define WM8994_WRITE_SEQUENCER_250 0x30FA | ||
496 | #define WM8994_WRITE_SEQUENCER_251 0x30FB | ||
497 | #define WM8994_WRITE_SEQUENCER_252 0x30FC | ||
498 | #define WM8994_WRITE_SEQUENCER_253 0x30FD | ||
499 | #define WM8994_WRITE_SEQUENCER_254 0x30FE | ||
500 | #define WM8994_WRITE_SEQUENCER_255 0x30FF | ||
501 | #define WM8994_WRITE_SEQUENCER_256 0x3100 | ||
502 | #define WM8994_WRITE_SEQUENCER_257 0x3101 | ||
503 | #define WM8994_WRITE_SEQUENCER_258 0x3102 | ||
504 | #define WM8994_WRITE_SEQUENCER_259 0x3103 | ||
505 | #define WM8994_WRITE_SEQUENCER_260 0x3104 | ||
506 | #define WM8994_WRITE_SEQUENCER_261 0x3105 | ||
507 | #define WM8994_WRITE_SEQUENCER_262 0x3106 | ||
508 | #define WM8994_WRITE_SEQUENCER_263 0x3107 | ||
509 | #define WM8994_WRITE_SEQUENCER_264 0x3108 | ||
510 | #define WM8994_WRITE_SEQUENCER_265 0x3109 | ||
511 | #define WM8994_WRITE_SEQUENCER_266 0x310A | ||
512 | #define WM8994_WRITE_SEQUENCER_267 0x310B | ||
513 | #define WM8994_WRITE_SEQUENCER_268 0x310C | ||
514 | #define WM8994_WRITE_SEQUENCER_269 0x310D | ||
515 | #define WM8994_WRITE_SEQUENCER_270 0x310E | ||
516 | #define WM8994_WRITE_SEQUENCER_271 0x310F | ||
517 | #define WM8994_WRITE_SEQUENCER_272 0x3110 | ||
518 | #define WM8994_WRITE_SEQUENCER_273 0x3111 | ||
519 | #define WM8994_WRITE_SEQUENCER_274 0x3112 | ||
520 | #define WM8994_WRITE_SEQUENCER_275 0x3113 | ||
521 | #define WM8994_WRITE_SEQUENCER_276 0x3114 | ||
522 | #define WM8994_WRITE_SEQUENCER_277 0x3115 | ||
523 | #define WM8994_WRITE_SEQUENCER_278 0x3116 | ||
524 | #define WM8994_WRITE_SEQUENCER_279 0x3117 | ||
525 | #define WM8994_WRITE_SEQUENCER_280 0x3118 | ||
526 | #define WM8994_WRITE_SEQUENCER_281 0x3119 | ||
527 | #define WM8994_WRITE_SEQUENCER_282 0x311A | ||
528 | #define WM8994_WRITE_SEQUENCER_283 0x311B | ||
529 | #define WM8994_WRITE_SEQUENCER_284 0x311C | ||
530 | #define WM8994_WRITE_SEQUENCER_285 0x311D | ||
531 | #define WM8994_WRITE_SEQUENCER_286 0x311E | ||
532 | #define WM8994_WRITE_SEQUENCER_287 0x311F | ||
533 | #define WM8994_WRITE_SEQUENCER_288 0x3120 | ||
534 | #define WM8994_WRITE_SEQUENCER_289 0x3121 | ||
535 | #define WM8994_WRITE_SEQUENCER_290 0x3122 | ||
536 | #define WM8994_WRITE_SEQUENCER_291 0x3123 | ||
537 | #define WM8994_WRITE_SEQUENCER_292 0x3124 | ||
538 | #define WM8994_WRITE_SEQUENCER_293 0x3125 | ||
539 | #define WM8994_WRITE_SEQUENCER_294 0x3126 | ||
540 | #define WM8994_WRITE_SEQUENCER_295 0x3127 | ||
541 | #define WM8994_WRITE_SEQUENCER_296 0x3128 | ||
542 | #define WM8994_WRITE_SEQUENCER_297 0x3129 | ||
543 | #define WM8994_WRITE_SEQUENCER_298 0x312A | ||
544 | #define WM8994_WRITE_SEQUENCER_299 0x312B | ||
545 | #define WM8994_WRITE_SEQUENCER_300 0x312C | ||
546 | #define WM8994_WRITE_SEQUENCER_301 0x312D | ||
547 | #define WM8994_WRITE_SEQUENCER_302 0x312E | ||
548 | #define WM8994_WRITE_SEQUENCER_303 0x312F | ||
549 | #define WM8994_WRITE_SEQUENCER_304 0x3130 | ||
550 | #define WM8994_WRITE_SEQUENCER_305 0x3131 | ||
551 | #define WM8994_WRITE_SEQUENCER_306 0x3132 | ||
552 | #define WM8994_WRITE_SEQUENCER_307 0x3133 | ||
553 | #define WM8994_WRITE_SEQUENCER_308 0x3134 | ||
554 | #define WM8994_WRITE_SEQUENCER_309 0x3135 | ||
555 | #define WM8994_WRITE_SEQUENCER_310 0x3136 | ||
556 | #define WM8994_WRITE_SEQUENCER_311 0x3137 | ||
557 | #define WM8994_WRITE_SEQUENCER_312 0x3138 | ||
558 | #define WM8994_WRITE_SEQUENCER_313 0x3139 | ||
559 | #define WM8994_WRITE_SEQUENCER_314 0x313A | ||
560 | #define WM8994_WRITE_SEQUENCER_315 0x313B | ||
561 | #define WM8994_WRITE_SEQUENCER_316 0x313C | ||
562 | #define WM8994_WRITE_SEQUENCER_317 0x313D | ||
563 | #define WM8994_WRITE_SEQUENCER_318 0x313E | ||
564 | #define WM8994_WRITE_SEQUENCER_319 0x313F | ||
565 | #define WM8994_WRITE_SEQUENCER_320 0x3140 | ||
566 | #define WM8994_WRITE_SEQUENCER_321 0x3141 | ||
567 | #define WM8994_WRITE_SEQUENCER_322 0x3142 | ||
568 | #define WM8994_WRITE_SEQUENCER_323 0x3143 | ||
569 | #define WM8994_WRITE_SEQUENCER_324 0x3144 | ||
570 | #define WM8994_WRITE_SEQUENCER_325 0x3145 | ||
571 | #define WM8994_WRITE_SEQUENCER_326 0x3146 | ||
572 | #define WM8994_WRITE_SEQUENCER_327 0x3147 | ||
573 | #define WM8994_WRITE_SEQUENCER_328 0x3148 | ||
574 | #define WM8994_WRITE_SEQUENCER_329 0x3149 | ||
575 | #define WM8994_WRITE_SEQUENCER_330 0x314A | ||
576 | #define WM8994_WRITE_SEQUENCER_331 0x314B | ||
577 | #define WM8994_WRITE_SEQUENCER_332 0x314C | ||
578 | #define WM8994_WRITE_SEQUENCER_333 0x314D | ||
579 | #define WM8994_WRITE_SEQUENCER_334 0x314E | ||
580 | #define WM8994_WRITE_SEQUENCER_335 0x314F | ||
581 | #define WM8994_WRITE_SEQUENCER_336 0x3150 | ||
582 | #define WM8994_WRITE_SEQUENCER_337 0x3151 | ||
583 | #define WM8994_WRITE_SEQUENCER_338 0x3152 | ||
584 | #define WM8994_WRITE_SEQUENCER_339 0x3153 | ||
585 | #define WM8994_WRITE_SEQUENCER_340 0x3154 | ||
586 | #define WM8994_WRITE_SEQUENCER_341 0x3155 | ||
587 | #define WM8994_WRITE_SEQUENCER_342 0x3156 | ||
588 | #define WM8994_WRITE_SEQUENCER_343 0x3157 | ||
589 | #define WM8994_WRITE_SEQUENCER_344 0x3158 | ||
590 | #define WM8994_WRITE_SEQUENCER_345 0x3159 | ||
591 | #define WM8994_WRITE_SEQUENCER_346 0x315A | ||
592 | #define WM8994_WRITE_SEQUENCER_347 0x315B | ||
593 | #define WM8994_WRITE_SEQUENCER_348 0x315C | ||
594 | #define WM8994_WRITE_SEQUENCER_349 0x315D | ||
595 | #define WM8994_WRITE_SEQUENCER_350 0x315E | ||
596 | #define WM8994_WRITE_SEQUENCER_351 0x315F | ||
597 | #define WM8994_WRITE_SEQUENCER_352 0x3160 | ||
598 | #define WM8994_WRITE_SEQUENCER_353 0x3161 | ||
599 | #define WM8994_WRITE_SEQUENCER_354 0x3162 | ||
600 | #define WM8994_WRITE_SEQUENCER_355 0x3163 | ||
601 | #define WM8994_WRITE_SEQUENCER_356 0x3164 | ||
602 | #define WM8994_WRITE_SEQUENCER_357 0x3165 | ||
603 | #define WM8994_WRITE_SEQUENCER_358 0x3166 | ||
604 | #define WM8994_WRITE_SEQUENCER_359 0x3167 | ||
605 | #define WM8994_WRITE_SEQUENCER_360 0x3168 | ||
606 | #define WM8994_WRITE_SEQUENCER_361 0x3169 | ||
607 | #define WM8994_WRITE_SEQUENCER_362 0x316A | ||
608 | #define WM8994_WRITE_SEQUENCER_363 0x316B | ||
609 | #define WM8994_WRITE_SEQUENCER_364 0x316C | ||
610 | #define WM8994_WRITE_SEQUENCER_365 0x316D | ||
611 | #define WM8994_WRITE_SEQUENCER_366 0x316E | ||
612 | #define WM8994_WRITE_SEQUENCER_367 0x316F | ||
613 | #define WM8994_WRITE_SEQUENCER_368 0x3170 | ||
614 | #define WM8994_WRITE_SEQUENCER_369 0x3171 | ||
615 | #define WM8994_WRITE_SEQUENCER_370 0x3172 | ||
616 | #define WM8994_WRITE_SEQUENCER_371 0x3173 | ||
617 | #define WM8994_WRITE_SEQUENCER_372 0x3174 | ||
618 | #define WM8994_WRITE_SEQUENCER_373 0x3175 | ||
619 | #define WM8994_WRITE_SEQUENCER_374 0x3176 | ||
620 | #define WM8994_WRITE_SEQUENCER_375 0x3177 | ||
621 | #define WM8994_WRITE_SEQUENCER_376 0x3178 | ||
622 | #define WM8994_WRITE_SEQUENCER_377 0x3179 | ||
623 | #define WM8994_WRITE_SEQUENCER_378 0x317A | ||
624 | #define WM8994_WRITE_SEQUENCER_379 0x317B | ||
625 | #define WM8994_WRITE_SEQUENCER_380 0x317C | ||
626 | #define WM8994_WRITE_SEQUENCER_381 0x317D | ||
627 | #define WM8994_WRITE_SEQUENCER_382 0x317E | ||
628 | #define WM8994_WRITE_SEQUENCER_383 0x317F | ||
629 | #define WM8994_WRITE_SEQUENCER_384 0x3180 | ||
630 | #define WM8994_WRITE_SEQUENCER_385 0x3181 | ||
631 | #define WM8994_WRITE_SEQUENCER_386 0x3182 | ||
632 | #define WM8994_WRITE_SEQUENCER_387 0x3183 | ||
633 | #define WM8994_WRITE_SEQUENCER_388 0x3184 | ||
634 | #define WM8994_WRITE_SEQUENCER_389 0x3185 | ||
635 | #define WM8994_WRITE_SEQUENCER_390 0x3186 | ||
636 | #define WM8994_WRITE_SEQUENCER_391 0x3187 | ||
637 | #define WM8994_WRITE_SEQUENCER_392 0x3188 | ||
638 | #define WM8994_WRITE_SEQUENCER_393 0x3189 | ||
639 | #define WM8994_WRITE_SEQUENCER_394 0x318A | ||
640 | #define WM8994_WRITE_SEQUENCER_395 0x318B | ||
641 | #define WM8994_WRITE_SEQUENCER_396 0x318C | ||
642 | #define WM8994_WRITE_SEQUENCER_397 0x318D | ||
643 | #define WM8994_WRITE_SEQUENCER_398 0x318E | ||
644 | #define WM8994_WRITE_SEQUENCER_399 0x318F | ||
645 | #define WM8994_WRITE_SEQUENCER_400 0x3190 | ||
646 | #define WM8994_WRITE_SEQUENCER_401 0x3191 | ||
647 | #define WM8994_WRITE_SEQUENCER_402 0x3192 | ||
648 | #define WM8994_WRITE_SEQUENCER_403 0x3193 | ||
649 | #define WM8994_WRITE_SEQUENCER_404 0x3194 | ||
650 | #define WM8994_WRITE_SEQUENCER_405 0x3195 | ||
651 | #define WM8994_WRITE_SEQUENCER_406 0x3196 | ||
652 | #define WM8994_WRITE_SEQUENCER_407 0x3197 | ||
653 | #define WM8994_WRITE_SEQUENCER_408 0x3198 | ||
654 | #define WM8994_WRITE_SEQUENCER_409 0x3199 | ||
655 | #define WM8994_WRITE_SEQUENCER_410 0x319A | ||
656 | #define WM8994_WRITE_SEQUENCER_411 0x319B | ||
657 | #define WM8994_WRITE_SEQUENCER_412 0x319C | ||
658 | #define WM8994_WRITE_SEQUENCER_413 0x319D | ||
659 | #define WM8994_WRITE_SEQUENCER_414 0x319E | ||
660 | #define WM8994_WRITE_SEQUENCER_415 0x319F | ||
661 | #define WM8994_WRITE_SEQUENCER_416 0x31A0 | ||
662 | #define WM8994_WRITE_SEQUENCER_417 0x31A1 | ||
663 | #define WM8994_WRITE_SEQUENCER_418 0x31A2 | ||
664 | #define WM8994_WRITE_SEQUENCER_419 0x31A3 | ||
665 | #define WM8994_WRITE_SEQUENCER_420 0x31A4 | ||
666 | #define WM8994_WRITE_SEQUENCER_421 0x31A5 | ||
667 | #define WM8994_WRITE_SEQUENCER_422 0x31A6 | ||
668 | #define WM8994_WRITE_SEQUENCER_423 0x31A7 | ||
669 | #define WM8994_WRITE_SEQUENCER_424 0x31A8 | ||
670 | #define WM8994_WRITE_SEQUENCER_425 0x31A9 | ||
671 | #define WM8994_WRITE_SEQUENCER_426 0x31AA | ||
672 | #define WM8994_WRITE_SEQUENCER_427 0x31AB | ||
673 | #define WM8994_WRITE_SEQUENCER_428 0x31AC | ||
674 | #define WM8994_WRITE_SEQUENCER_429 0x31AD | ||
675 | #define WM8994_WRITE_SEQUENCER_430 0x31AE | ||
676 | #define WM8994_WRITE_SEQUENCER_431 0x31AF | ||
677 | #define WM8994_WRITE_SEQUENCER_432 0x31B0 | ||
678 | #define WM8994_WRITE_SEQUENCER_433 0x31B1 | ||
679 | #define WM8994_WRITE_SEQUENCER_434 0x31B2 | ||
680 | #define WM8994_WRITE_SEQUENCER_435 0x31B3 | ||
681 | #define WM8994_WRITE_SEQUENCER_436 0x31B4 | ||
682 | #define WM8994_WRITE_SEQUENCER_437 0x31B5 | ||
683 | #define WM8994_WRITE_SEQUENCER_438 0x31B6 | ||
684 | #define WM8994_WRITE_SEQUENCER_439 0x31B7 | ||
685 | #define WM8994_WRITE_SEQUENCER_440 0x31B8 | ||
686 | #define WM8994_WRITE_SEQUENCER_441 0x31B9 | ||
687 | #define WM8994_WRITE_SEQUENCER_442 0x31BA | ||
688 | #define WM8994_WRITE_SEQUENCER_443 0x31BB | ||
689 | #define WM8994_WRITE_SEQUENCER_444 0x31BC | ||
690 | #define WM8994_WRITE_SEQUENCER_445 0x31BD | ||
691 | #define WM8994_WRITE_SEQUENCER_446 0x31BE | ||
692 | #define WM8994_WRITE_SEQUENCER_447 0x31BF | ||
693 | #define WM8994_WRITE_SEQUENCER_448 0x31C0 | ||
694 | #define WM8994_WRITE_SEQUENCER_449 0x31C1 | ||
695 | #define WM8994_WRITE_SEQUENCER_450 0x31C2 | ||
696 | #define WM8994_WRITE_SEQUENCER_451 0x31C3 | ||
697 | #define WM8994_WRITE_SEQUENCER_452 0x31C4 | ||
698 | #define WM8994_WRITE_SEQUENCER_453 0x31C5 | ||
699 | #define WM8994_WRITE_SEQUENCER_454 0x31C6 | ||
700 | #define WM8994_WRITE_SEQUENCER_455 0x31C7 | ||
701 | #define WM8994_WRITE_SEQUENCER_456 0x31C8 | ||
702 | #define WM8994_WRITE_SEQUENCER_457 0x31C9 | ||
703 | #define WM8994_WRITE_SEQUENCER_458 0x31CA | ||
704 | #define WM8994_WRITE_SEQUENCER_459 0x31CB | ||
705 | #define WM8994_WRITE_SEQUENCER_460 0x31CC | ||
706 | #define WM8994_WRITE_SEQUENCER_461 0x31CD | ||
707 | #define WM8994_WRITE_SEQUENCER_462 0x31CE | ||
708 | #define WM8994_WRITE_SEQUENCER_463 0x31CF | ||
709 | #define WM8994_WRITE_SEQUENCER_464 0x31D0 | ||
710 | #define WM8994_WRITE_SEQUENCER_465 0x31D1 | ||
711 | #define WM8994_WRITE_SEQUENCER_466 0x31D2 | ||
712 | #define WM8994_WRITE_SEQUENCER_467 0x31D3 | ||
713 | #define WM8994_WRITE_SEQUENCER_468 0x31D4 | ||
714 | #define WM8994_WRITE_SEQUENCER_469 0x31D5 | ||
715 | #define WM8994_WRITE_SEQUENCER_470 0x31D6 | ||
716 | #define WM8994_WRITE_SEQUENCER_471 0x31D7 | ||
717 | #define WM8994_WRITE_SEQUENCER_472 0x31D8 | ||
718 | #define WM8994_WRITE_SEQUENCER_473 0x31D9 | ||
719 | #define WM8994_WRITE_SEQUENCER_474 0x31DA | ||
720 | #define WM8994_WRITE_SEQUENCER_475 0x31DB | ||
721 | #define WM8994_WRITE_SEQUENCER_476 0x31DC | ||
722 | #define WM8994_WRITE_SEQUENCER_477 0x31DD | ||
723 | #define WM8994_WRITE_SEQUENCER_478 0x31DE | ||
724 | #define WM8994_WRITE_SEQUENCER_479 0x31DF | ||
725 | #define WM8994_WRITE_SEQUENCER_480 0x31E0 | ||
726 | #define WM8994_WRITE_SEQUENCER_481 0x31E1 | ||
727 | #define WM8994_WRITE_SEQUENCER_482 0x31E2 | ||
728 | #define WM8994_WRITE_SEQUENCER_483 0x31E3 | ||
729 | #define WM8994_WRITE_SEQUENCER_484 0x31E4 | ||
730 | #define WM8994_WRITE_SEQUENCER_485 0x31E5 | ||
731 | #define WM8994_WRITE_SEQUENCER_486 0x31E6 | ||
732 | #define WM8994_WRITE_SEQUENCER_487 0x31E7 | ||
733 | #define WM8994_WRITE_SEQUENCER_488 0x31E8 | ||
734 | #define WM8994_WRITE_SEQUENCER_489 0x31E9 | ||
735 | #define WM8994_WRITE_SEQUENCER_490 0x31EA | ||
736 | #define WM8994_WRITE_SEQUENCER_491 0x31EB | ||
737 | #define WM8994_WRITE_SEQUENCER_492 0x31EC | ||
738 | #define WM8994_WRITE_SEQUENCER_493 0x31ED | ||
739 | #define WM8994_WRITE_SEQUENCER_494 0x31EE | ||
740 | #define WM8994_WRITE_SEQUENCER_495 0x31EF | ||
741 | #define WM8994_WRITE_SEQUENCER_496 0x31F0 | ||
742 | #define WM8994_WRITE_SEQUENCER_497 0x31F1 | ||
743 | #define WM8994_WRITE_SEQUENCER_498 0x31F2 | ||
744 | #define WM8994_WRITE_SEQUENCER_499 0x31F3 | ||
745 | #define WM8994_WRITE_SEQUENCER_500 0x31F4 | ||
746 | #define WM8994_WRITE_SEQUENCER_501 0x31F5 | ||
747 | #define WM8994_WRITE_SEQUENCER_502 0x31F6 | ||
748 | #define WM8994_WRITE_SEQUENCER_503 0x31F7 | ||
749 | #define WM8994_WRITE_SEQUENCER_504 0x31F8 | ||
750 | #define WM8994_WRITE_SEQUENCER_505 0x31F9 | ||
751 | #define WM8994_WRITE_SEQUENCER_506 0x31FA | ||
752 | #define WM8994_WRITE_SEQUENCER_507 0x31FB | ||
753 | #define WM8994_WRITE_SEQUENCER_508 0x31FC | ||
754 | #define WM8994_WRITE_SEQUENCER_509 0x31FD | ||
755 | #define WM8994_WRITE_SEQUENCER_510 0x31FE | ||
756 | #define WM8994_WRITE_SEQUENCER_511 0x31FF | ||
757 | |||
758 | #define WM8994_REGISTER_COUNT 736 | ||
759 | #define WM8994_MAX_REGISTER 0x31FF | ||
760 | #define WM8994_MAX_CACHED_REGISTER 0x749 | ||
761 | |||
762 | /* | ||
763 | * Field Definitions. | ||
764 | */ | ||
765 | |||
766 | /* | ||
767 | * R0 (0x00) - Software Reset | ||
768 | */ | ||
769 | #define WM8994_SW_RESET_MASK 0xFFFF /* SW_RESET - [15:0] */ | ||
770 | #define WM8994_SW_RESET_SHIFT 0 /* SW_RESET - [15:0] */ | ||
771 | #define WM8994_SW_RESET_WIDTH 16 /* SW_RESET - [15:0] */ | ||
772 | |||
773 | /* | ||
774 | * R1 (0x01) - Power Management (1) | ||
775 | */ | ||
776 | #define WM8994_SPKOUTR_ENA 0x2000 /* SPKOUTR_ENA */ | ||
777 | #define WM8994_SPKOUTR_ENA_MASK 0x2000 /* SPKOUTR_ENA */ | ||
778 | #define WM8994_SPKOUTR_ENA_SHIFT 13 /* SPKOUTR_ENA */ | ||
779 | #define WM8994_SPKOUTR_ENA_WIDTH 1 /* SPKOUTR_ENA */ | ||
780 | #define WM8994_SPKOUTL_ENA 0x1000 /* SPKOUTL_ENA */ | ||
781 | #define WM8994_SPKOUTL_ENA_MASK 0x1000 /* SPKOUTL_ENA */ | ||
782 | #define WM8994_SPKOUTL_ENA_SHIFT 12 /* SPKOUTL_ENA */ | ||
783 | #define WM8994_SPKOUTL_ENA_WIDTH 1 /* SPKOUTL_ENA */ | ||
784 | #define WM8994_HPOUT2_ENA 0x0800 /* HPOUT2_ENA */ | ||
785 | #define WM8994_HPOUT2_ENA_MASK 0x0800 /* HPOUT2_ENA */ | ||
786 | #define WM8994_HPOUT2_ENA_SHIFT 11 /* HPOUT2_ENA */ | ||
787 | #define WM8994_HPOUT2_ENA_WIDTH 1 /* HPOUT2_ENA */ | ||
788 | #define WM8994_HPOUT1L_ENA 0x0200 /* HPOUT1L_ENA */ | ||
789 | #define WM8994_HPOUT1L_ENA_MASK 0x0200 /* HPOUT1L_ENA */ | ||
790 | #define WM8994_HPOUT1L_ENA_SHIFT 9 /* HPOUT1L_ENA */ | ||
791 | #define WM8994_HPOUT1L_ENA_WIDTH 1 /* HPOUT1L_ENA */ | ||
792 | #define WM8994_HPOUT1R_ENA 0x0100 /* HPOUT1R_ENA */ | ||
793 | #define WM8994_HPOUT1R_ENA_MASK 0x0100 /* HPOUT1R_ENA */ | ||
794 | #define WM8994_HPOUT1R_ENA_SHIFT 8 /* HPOUT1R_ENA */ | ||
795 | #define WM8994_HPOUT1R_ENA_WIDTH 1 /* HPOUT1R_ENA */ | ||
796 | #define WM8994_MICB2_ENA 0x0020 /* MICB2_ENA */ | ||
797 | #define WM8994_MICB2_ENA_MASK 0x0020 /* MICB2_ENA */ | ||
798 | #define WM8994_MICB2_ENA_SHIFT 5 /* MICB2_ENA */ | ||
799 | #define WM8994_MICB2_ENA_WIDTH 1 /* MICB2_ENA */ | ||
800 | #define WM8994_MICB1_ENA 0x0010 /* MICB1_ENA */ | ||
801 | #define WM8994_MICB1_ENA_MASK 0x0010 /* MICB1_ENA */ | ||
802 | #define WM8994_MICB1_ENA_SHIFT 4 /* MICB1_ENA */ | ||
803 | #define WM8994_MICB1_ENA_WIDTH 1 /* MICB1_ENA */ | ||
804 | #define WM8994_VMID_SEL_MASK 0x0006 /* VMID_SEL - [2:1] */ | ||
805 | #define WM8994_VMID_SEL_SHIFT 1 /* VMID_SEL - [2:1] */ | ||
806 | #define WM8994_VMID_SEL_WIDTH 2 /* VMID_SEL - [2:1] */ | ||
807 | #define WM8994_BIAS_ENA 0x0001 /* BIAS_ENA */ | ||
808 | #define WM8994_BIAS_ENA_MASK 0x0001 /* BIAS_ENA */ | ||
809 | #define WM8994_BIAS_ENA_SHIFT 0 /* BIAS_ENA */ | ||
810 | #define WM8994_BIAS_ENA_WIDTH 1 /* BIAS_ENA */ | ||
811 | |||
812 | /* | ||
813 | * R2 (0x02) - Power Management (2) | ||
814 | */ | ||
815 | #define WM8994_TSHUT_ENA 0x4000 /* TSHUT_ENA */ | ||
816 | #define WM8994_TSHUT_ENA_MASK 0x4000 /* TSHUT_ENA */ | ||
817 | #define WM8994_TSHUT_ENA_SHIFT 14 /* TSHUT_ENA */ | ||
818 | #define WM8994_TSHUT_ENA_WIDTH 1 /* TSHUT_ENA */ | ||
819 | #define WM8994_TSHUT_OPDIS 0x2000 /* TSHUT_OPDIS */ | ||
820 | #define WM8994_TSHUT_OPDIS_MASK 0x2000 /* TSHUT_OPDIS */ | ||
821 | #define WM8994_TSHUT_OPDIS_SHIFT 13 /* TSHUT_OPDIS */ | ||
822 | #define WM8994_TSHUT_OPDIS_WIDTH 1 /* TSHUT_OPDIS */ | ||
823 | #define WM8994_OPCLK_ENA 0x0800 /* OPCLK_ENA */ | ||
824 | #define WM8994_OPCLK_ENA_MASK 0x0800 /* OPCLK_ENA */ | ||
825 | #define WM8994_OPCLK_ENA_SHIFT 11 /* OPCLK_ENA */ | ||
826 | #define WM8994_OPCLK_ENA_WIDTH 1 /* OPCLK_ENA */ | ||
827 | #define WM8994_MIXINL_ENA 0x0200 /* MIXINL_ENA */ | ||
828 | #define WM8994_MIXINL_ENA_MASK 0x0200 /* MIXINL_ENA */ | ||
829 | #define WM8994_MIXINL_ENA_SHIFT 9 /* MIXINL_ENA */ | ||
830 | #define WM8994_MIXINL_ENA_WIDTH 1 /* MIXINL_ENA */ | ||
831 | #define WM8994_MIXINR_ENA 0x0100 /* MIXINR_ENA */ | ||
832 | #define WM8994_MIXINR_ENA_MASK 0x0100 /* MIXINR_ENA */ | ||
833 | #define WM8994_MIXINR_ENA_SHIFT 8 /* MIXINR_ENA */ | ||
834 | #define WM8994_MIXINR_ENA_WIDTH 1 /* MIXINR_ENA */ | ||
835 | #define WM8994_IN2L_ENA 0x0080 /* IN2L_ENA */ | ||
836 | #define WM8994_IN2L_ENA_MASK 0x0080 /* IN2L_ENA */ | ||
837 | #define WM8994_IN2L_ENA_SHIFT 7 /* IN2L_ENA */ | ||
838 | #define WM8994_IN2L_ENA_WIDTH 1 /* IN2L_ENA */ | ||
839 | #define WM8994_IN1L_ENA 0x0040 /* IN1L_ENA */ | ||
840 | #define WM8994_IN1L_ENA_MASK 0x0040 /* IN1L_ENA */ | ||
841 | #define WM8994_IN1L_ENA_SHIFT 6 /* IN1L_ENA */ | ||
842 | #define WM8994_IN1L_ENA_WIDTH 1 /* IN1L_ENA */ | ||
843 | #define WM8994_IN2R_ENA 0x0020 /* IN2R_ENA */ | ||
844 | #define WM8994_IN2R_ENA_MASK 0x0020 /* IN2R_ENA */ | ||
845 | #define WM8994_IN2R_ENA_SHIFT 5 /* IN2R_ENA */ | ||
846 | #define WM8994_IN2R_ENA_WIDTH 1 /* IN2R_ENA */ | ||
847 | #define WM8994_IN1R_ENA 0x0010 /* IN1R_ENA */ | ||
848 | #define WM8994_IN1R_ENA_MASK 0x0010 /* IN1R_ENA */ | ||
849 | #define WM8994_IN1R_ENA_SHIFT 4 /* IN1R_ENA */ | ||
850 | #define WM8994_IN1R_ENA_WIDTH 1 /* IN1R_ENA */ | ||
851 | |||
852 | /* | ||
853 | * R3 (0x03) - Power Management (3) | ||
854 | */ | ||
855 | #define WM8994_LINEOUT1N_ENA 0x2000 /* LINEOUT1N_ENA */ | ||
856 | #define WM8994_LINEOUT1N_ENA_MASK 0x2000 /* LINEOUT1N_ENA */ | ||
857 | #define WM8994_LINEOUT1N_ENA_SHIFT 13 /* LINEOUT1N_ENA */ | ||
858 | #define WM8994_LINEOUT1N_ENA_WIDTH 1 /* LINEOUT1N_ENA */ | ||
859 | #define WM8994_LINEOUT1P_ENA 0x1000 /* LINEOUT1P_ENA */ | ||
860 | #define WM8994_LINEOUT1P_ENA_MASK 0x1000 /* LINEOUT1P_ENA */ | ||
861 | #define WM8994_LINEOUT1P_ENA_SHIFT 12 /* LINEOUT1P_ENA */ | ||
862 | #define WM8994_LINEOUT1P_ENA_WIDTH 1 /* LINEOUT1P_ENA */ | ||
863 | #define WM8994_LINEOUT2N_ENA 0x0800 /* LINEOUT2N_ENA */ | ||
864 | #define WM8994_LINEOUT2N_ENA_MASK 0x0800 /* LINEOUT2N_ENA */ | ||
865 | #define WM8994_LINEOUT2N_ENA_SHIFT 11 /* LINEOUT2N_ENA */ | ||
866 | #define WM8994_LINEOUT2N_ENA_WIDTH 1 /* LINEOUT2N_ENA */ | ||
867 | #define WM8994_LINEOUT2P_ENA 0x0400 /* LINEOUT2P_ENA */ | ||
868 | #define WM8994_LINEOUT2P_ENA_MASK 0x0400 /* LINEOUT2P_ENA */ | ||
869 | #define WM8994_LINEOUT2P_ENA_SHIFT 10 /* LINEOUT2P_ENA */ | ||
870 | #define WM8994_LINEOUT2P_ENA_WIDTH 1 /* LINEOUT2P_ENA */ | ||
871 | #define WM8994_SPKRVOL_ENA 0x0200 /* SPKRVOL_ENA */ | ||
872 | #define WM8994_SPKRVOL_ENA_MASK 0x0200 /* SPKRVOL_ENA */ | ||
873 | #define WM8994_SPKRVOL_ENA_SHIFT 9 /* SPKRVOL_ENA */ | ||
874 | #define WM8994_SPKRVOL_ENA_WIDTH 1 /* SPKRVOL_ENA */ | ||
875 | #define WM8994_SPKLVOL_ENA 0x0100 /* SPKLVOL_ENA */ | ||
876 | #define WM8994_SPKLVOL_ENA_MASK 0x0100 /* SPKLVOL_ENA */ | ||
877 | #define WM8994_SPKLVOL_ENA_SHIFT 8 /* SPKLVOL_ENA */ | ||
878 | #define WM8994_SPKLVOL_ENA_WIDTH 1 /* SPKLVOL_ENA */ | ||
879 | #define WM8994_MIXOUTLVOL_ENA 0x0080 /* MIXOUTLVOL_ENA */ | ||
880 | #define WM8994_MIXOUTLVOL_ENA_MASK 0x0080 /* MIXOUTLVOL_ENA */ | ||
881 | #define WM8994_MIXOUTLVOL_ENA_SHIFT 7 /* MIXOUTLVOL_ENA */ | ||
882 | #define WM8994_MIXOUTLVOL_ENA_WIDTH 1 /* MIXOUTLVOL_ENA */ | ||
883 | #define WM8994_MIXOUTRVOL_ENA 0x0040 /* MIXOUTRVOL_ENA */ | ||
884 | #define WM8994_MIXOUTRVOL_ENA_MASK 0x0040 /* MIXOUTRVOL_ENA */ | ||
885 | #define WM8994_MIXOUTRVOL_ENA_SHIFT 6 /* MIXOUTRVOL_ENA */ | ||
886 | #define WM8994_MIXOUTRVOL_ENA_WIDTH 1 /* MIXOUTRVOL_ENA */ | ||
887 | #define WM8994_MIXOUTL_ENA 0x0020 /* MIXOUTL_ENA */ | ||
888 | #define WM8994_MIXOUTL_ENA_MASK 0x0020 /* MIXOUTL_ENA */ | ||
889 | #define WM8994_MIXOUTL_ENA_SHIFT 5 /* MIXOUTL_ENA */ | ||
890 | #define WM8994_MIXOUTL_ENA_WIDTH 1 /* MIXOUTL_ENA */ | ||
891 | #define WM8994_MIXOUTR_ENA 0x0010 /* MIXOUTR_ENA */ | ||
892 | #define WM8994_MIXOUTR_ENA_MASK 0x0010 /* MIXOUTR_ENA */ | ||
893 | #define WM8994_MIXOUTR_ENA_SHIFT 4 /* MIXOUTR_ENA */ | ||
894 | #define WM8994_MIXOUTR_ENA_WIDTH 1 /* MIXOUTR_ENA */ | ||
895 | |||
896 | /* | ||
897 | * R4 (0x04) - Power Management (4) | ||
898 | */ | ||
899 | #define WM8994_AIF2ADCL_ENA 0x2000 /* AIF2ADCL_ENA */ | ||
900 | #define WM8994_AIF2ADCL_ENA_MASK 0x2000 /* AIF2ADCL_ENA */ | ||
901 | #define WM8994_AIF2ADCL_ENA_SHIFT 13 /* AIF2ADCL_ENA */ | ||
902 | #define WM8994_AIF2ADCL_ENA_WIDTH 1 /* AIF2ADCL_ENA */ | ||
903 | #define WM8994_AIF2ADCR_ENA 0x1000 /* AIF2ADCR_ENA */ | ||
904 | #define WM8994_AIF2ADCR_ENA_MASK 0x1000 /* AIF2ADCR_ENA */ | ||
905 | #define WM8994_AIF2ADCR_ENA_SHIFT 12 /* AIF2ADCR_ENA */ | ||
906 | #define WM8994_AIF2ADCR_ENA_WIDTH 1 /* AIF2ADCR_ENA */ | ||
907 | #define WM8994_AIF1ADC2L_ENA 0x0800 /* AIF1ADC2L_ENA */ | ||
908 | #define WM8994_AIF1ADC2L_ENA_MASK 0x0800 /* AIF1ADC2L_ENA */ | ||
909 | #define WM8994_AIF1ADC2L_ENA_SHIFT 11 /* AIF1ADC2L_ENA */ | ||
910 | #define WM8994_AIF1ADC2L_ENA_WIDTH 1 /* AIF1ADC2L_ENA */ | ||
911 | #define WM8994_AIF1ADC2R_ENA 0x0400 /* AIF1ADC2R_ENA */ | ||
912 | #define WM8994_AIF1ADC2R_ENA_MASK 0x0400 /* AIF1ADC2R_ENA */ | ||
913 | #define WM8994_AIF1ADC2R_ENA_SHIFT 10 /* AIF1ADC2R_ENA */ | ||
914 | #define WM8994_AIF1ADC2R_ENA_WIDTH 1 /* AIF1ADC2R_ENA */ | ||
915 | #define WM8994_AIF1ADC1L_ENA 0x0200 /* AIF1ADC1L_ENA */ | ||
916 | #define WM8994_AIF1ADC1L_ENA_MASK 0x0200 /* AIF1ADC1L_ENA */ | ||
917 | #define WM8994_AIF1ADC1L_ENA_SHIFT 9 /* AIF1ADC1L_ENA */ | ||
918 | #define WM8994_AIF1ADC1L_ENA_WIDTH 1 /* AIF1ADC1L_ENA */ | ||
919 | #define WM8994_AIF1ADC1R_ENA 0x0100 /* AIF1ADC1R_ENA */ | ||
920 | #define WM8994_AIF1ADC1R_ENA_MASK 0x0100 /* AIF1ADC1R_ENA */ | ||
921 | #define WM8994_AIF1ADC1R_ENA_SHIFT 8 /* AIF1ADC1R_ENA */ | ||
922 | #define WM8994_AIF1ADC1R_ENA_WIDTH 1 /* AIF1ADC1R_ENA */ | ||
923 | #define WM8994_DMIC2L_ENA 0x0020 /* DMIC2L_ENA */ | ||
924 | #define WM8994_DMIC2L_ENA_MASK 0x0020 /* DMIC2L_ENA */ | ||
925 | #define WM8994_DMIC2L_ENA_SHIFT 5 /* DMIC2L_ENA */ | ||
926 | #define WM8994_DMIC2L_ENA_WIDTH 1 /* DMIC2L_ENA */ | ||
927 | #define WM8994_DMIC2R_ENA 0x0010 /* DMIC2R_ENA */ | ||
928 | #define WM8994_DMIC2R_ENA_MASK 0x0010 /* DMIC2R_ENA */ | ||
929 | #define WM8994_DMIC2R_ENA_SHIFT 4 /* DMIC2R_ENA */ | ||
930 | #define WM8994_DMIC2R_ENA_WIDTH 1 /* DMIC2R_ENA */ | ||
931 | #define WM8994_DMIC1L_ENA 0x0008 /* DMIC1L_ENA */ | ||
932 | #define WM8994_DMIC1L_ENA_MASK 0x0008 /* DMIC1L_ENA */ | ||
933 | #define WM8994_DMIC1L_ENA_SHIFT 3 /* DMIC1L_ENA */ | ||
934 | #define WM8994_DMIC1L_ENA_WIDTH 1 /* DMIC1L_ENA */ | ||
935 | #define WM8994_DMIC1R_ENA 0x0004 /* DMIC1R_ENA */ | ||
936 | #define WM8994_DMIC1R_ENA_MASK 0x0004 /* DMIC1R_ENA */ | ||
937 | #define WM8994_DMIC1R_ENA_SHIFT 2 /* DMIC1R_ENA */ | ||
938 | #define WM8994_DMIC1R_ENA_WIDTH 1 /* DMIC1R_ENA */ | ||
939 | #define WM8994_ADCL_ENA 0x0002 /* ADCL_ENA */ | ||
940 | #define WM8994_ADCL_ENA_MASK 0x0002 /* ADCL_ENA */ | ||
941 | #define WM8994_ADCL_ENA_SHIFT 1 /* ADCL_ENA */ | ||
942 | #define WM8994_ADCL_ENA_WIDTH 1 /* ADCL_ENA */ | ||
943 | #define WM8994_ADCR_ENA 0x0001 /* ADCR_ENA */ | ||
944 | #define WM8994_ADCR_ENA_MASK 0x0001 /* ADCR_ENA */ | ||
945 | #define WM8994_ADCR_ENA_SHIFT 0 /* ADCR_ENA */ | ||
946 | #define WM8994_ADCR_ENA_WIDTH 1 /* ADCR_ENA */ | ||
947 | |||
948 | /* | ||
949 | * R5 (0x05) - Power Management (5) | ||
950 | */ | ||
951 | #define WM8994_AIF2DACL_ENA 0x2000 /* AIF2DACL_ENA */ | ||
952 | #define WM8994_AIF2DACL_ENA_MASK 0x2000 /* AIF2DACL_ENA */ | ||
953 | #define WM8994_AIF2DACL_ENA_SHIFT 13 /* AIF2DACL_ENA */ | ||
954 | #define WM8994_AIF2DACL_ENA_WIDTH 1 /* AIF2DACL_ENA */ | ||
955 | #define WM8994_AIF2DACR_ENA 0x1000 /* AIF2DACR_ENA */ | ||
956 | #define WM8994_AIF2DACR_ENA_MASK 0x1000 /* AIF2DACR_ENA */ | ||
957 | #define WM8994_AIF2DACR_ENA_SHIFT 12 /* AIF2DACR_ENA */ | ||
958 | #define WM8994_AIF2DACR_ENA_WIDTH 1 /* AIF2DACR_ENA */ | ||
959 | #define WM8994_AIF1DAC2L_ENA 0x0800 /* AIF1DAC2L_ENA */ | ||
960 | #define WM8994_AIF1DAC2L_ENA_MASK 0x0800 /* AIF1DAC2L_ENA */ | ||
961 | #define WM8994_AIF1DAC2L_ENA_SHIFT 11 /* AIF1DAC2L_ENA */ | ||
962 | #define WM8994_AIF1DAC2L_ENA_WIDTH 1 /* AIF1DAC2L_ENA */ | ||
963 | #define WM8994_AIF1DAC2R_ENA 0x0400 /* AIF1DAC2R_ENA */ | ||
964 | #define WM8994_AIF1DAC2R_ENA_MASK 0x0400 /* AIF1DAC2R_ENA */ | ||
965 | #define WM8994_AIF1DAC2R_ENA_SHIFT 10 /* AIF1DAC2R_ENA */ | ||
966 | #define WM8994_AIF1DAC2R_ENA_WIDTH 1 /* AIF1DAC2R_ENA */ | ||
967 | #define WM8994_AIF1DAC1L_ENA 0x0200 /* AIF1DAC1L_ENA */ | ||
968 | #define WM8994_AIF1DAC1L_ENA_MASK 0x0200 /* AIF1DAC1L_ENA */ | ||
969 | #define WM8994_AIF1DAC1L_ENA_SHIFT 9 /* AIF1DAC1L_ENA */ | ||
970 | #define WM8994_AIF1DAC1L_ENA_WIDTH 1 /* AIF1DAC1L_ENA */ | ||
971 | #define WM8994_AIF1DAC1R_ENA 0x0100 /* AIF1DAC1R_ENA */ | ||
972 | #define WM8994_AIF1DAC1R_ENA_MASK 0x0100 /* AIF1DAC1R_ENA */ | ||
973 | #define WM8994_AIF1DAC1R_ENA_SHIFT 8 /* AIF1DAC1R_ENA */ | ||
974 | #define WM8994_AIF1DAC1R_ENA_WIDTH 1 /* AIF1DAC1R_ENA */ | ||
975 | #define WM8994_DAC2L_ENA 0x0008 /* DAC2L_ENA */ | ||
976 | #define WM8994_DAC2L_ENA_MASK 0x0008 /* DAC2L_ENA */ | ||
977 | #define WM8994_DAC2L_ENA_SHIFT 3 /* DAC2L_ENA */ | ||
978 | #define WM8994_DAC2L_ENA_WIDTH 1 /* DAC2L_ENA */ | ||
979 | #define WM8994_DAC2R_ENA 0x0004 /* DAC2R_ENA */ | ||
980 | #define WM8994_DAC2R_ENA_MASK 0x0004 /* DAC2R_ENA */ | ||
981 | #define WM8994_DAC2R_ENA_SHIFT 2 /* DAC2R_ENA */ | ||
982 | #define WM8994_DAC2R_ENA_WIDTH 1 /* DAC2R_ENA */ | ||
983 | #define WM8994_DAC1L_ENA 0x0002 /* DAC1L_ENA */ | ||
984 | #define WM8994_DAC1L_ENA_MASK 0x0002 /* DAC1L_ENA */ | ||
985 | #define WM8994_DAC1L_ENA_SHIFT 1 /* DAC1L_ENA */ | ||
986 | #define WM8994_DAC1L_ENA_WIDTH 1 /* DAC1L_ENA */ | ||
987 | #define WM8994_DAC1R_ENA 0x0001 /* DAC1R_ENA */ | ||
988 | #define WM8994_DAC1R_ENA_MASK 0x0001 /* DAC1R_ENA */ | ||
989 | #define WM8994_DAC1R_ENA_SHIFT 0 /* DAC1R_ENA */ | ||
990 | #define WM8994_DAC1R_ENA_WIDTH 1 /* DAC1R_ENA */ | ||
991 | |||
992 | /* | ||
993 | * R6 (0x06) - Power Management (6) | ||
994 | */ | ||
995 | #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ | ||
996 | #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ | ||
997 | #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ | ||
998 | #define WM8994_AIF3_TRI_WIDTH 1 /* AIF3_TRI */ | ||
999 | #define WM8994_AIF3_ADCDAT_SRC_MASK 0x0018 /* AIF3_ADCDAT_SRC - [4:3] */ | ||
1000 | #define WM8994_AIF3_ADCDAT_SRC_SHIFT 3 /* AIF3_ADCDAT_SRC - [4:3] */ | ||
1001 | #define WM8994_AIF3_ADCDAT_SRC_WIDTH 2 /* AIF3_ADCDAT_SRC - [4:3] */ | ||
1002 | #define WM8994_AIF2_ADCDAT_SRC 0x0004 /* AIF2_ADCDAT_SRC */ | ||
1003 | #define WM8994_AIF2_ADCDAT_SRC_MASK 0x0004 /* AIF2_ADCDAT_SRC */ | ||
1004 | #define WM8994_AIF2_ADCDAT_SRC_SHIFT 2 /* AIF2_ADCDAT_SRC */ | ||
1005 | #define WM8994_AIF2_ADCDAT_SRC_WIDTH 1 /* AIF2_ADCDAT_SRC */ | ||
1006 | #define WM8994_AIF2_DACDAT_SRC 0x0002 /* AIF2_DACDAT_SRC */ | ||
1007 | #define WM8994_AIF2_DACDAT_SRC_MASK 0x0002 /* AIF2_DACDAT_SRC */ | ||
1008 | #define WM8994_AIF2_DACDAT_SRC_SHIFT 1 /* AIF2_DACDAT_SRC */ | ||
1009 | #define WM8994_AIF2_DACDAT_SRC_WIDTH 1 /* AIF2_DACDAT_SRC */ | ||
1010 | #define WM8994_AIF1_DACDAT_SRC 0x0001 /* AIF1_DACDAT_SRC */ | ||
1011 | #define WM8994_AIF1_DACDAT_SRC_MASK 0x0001 /* AIF1_DACDAT_SRC */ | ||
1012 | #define WM8994_AIF1_DACDAT_SRC_SHIFT 0 /* AIF1_DACDAT_SRC */ | ||
1013 | #define WM8994_AIF1_DACDAT_SRC_WIDTH 1 /* AIF1_DACDAT_SRC */ | ||
1014 | |||
1015 | /* | ||
1016 | * R21 (0x15) - Input Mixer (1) | ||
1017 | */ | ||
1018 | #define WM8994_IN1RP_MIXINR_BOOST 0x0100 /* IN1RP_MIXINR_BOOST */ | ||
1019 | #define WM8994_IN1RP_MIXINR_BOOST_MASK 0x0100 /* IN1RP_MIXINR_BOOST */ | ||
1020 | #define WM8994_IN1RP_MIXINR_BOOST_SHIFT 8 /* IN1RP_MIXINR_BOOST */ | ||
1021 | #define WM8994_IN1RP_MIXINR_BOOST_WIDTH 1 /* IN1RP_MIXINR_BOOST */ | ||
1022 | #define WM8994_IN1LP_MIXINL_BOOST 0x0080 /* IN1LP_MIXINL_BOOST */ | ||
1023 | #define WM8994_IN1LP_MIXINL_BOOST_MASK 0x0080 /* IN1LP_MIXINL_BOOST */ | ||
1024 | #define WM8994_IN1LP_MIXINL_BOOST_SHIFT 7 /* IN1LP_MIXINL_BOOST */ | ||
1025 | #define WM8994_IN1LP_MIXINL_BOOST_WIDTH 1 /* IN1LP_MIXINL_BOOST */ | ||
1026 | #define WM8994_INPUTS_CLAMP 0x0040 /* INPUTS_CLAMP */ | ||
1027 | #define WM8994_INPUTS_CLAMP_MASK 0x0040 /* INPUTS_CLAMP */ | ||
1028 | #define WM8994_INPUTS_CLAMP_SHIFT 6 /* INPUTS_CLAMP */ | ||
1029 | #define WM8994_INPUTS_CLAMP_WIDTH 1 /* INPUTS_CLAMP */ | ||
1030 | |||
1031 | /* | ||
1032 | * R24 (0x18) - Left Line Input 1&2 Volume | ||
1033 | */ | ||
1034 | #define WM8994_IN1_VU 0x0100 /* IN1_VU */ | ||
1035 | #define WM8994_IN1_VU_MASK 0x0100 /* IN1_VU */ | ||
1036 | #define WM8994_IN1_VU_SHIFT 8 /* IN1_VU */ | ||
1037 | #define WM8994_IN1_VU_WIDTH 1 /* IN1_VU */ | ||
1038 | #define WM8994_IN1L_MUTE 0x0080 /* IN1L_MUTE */ | ||
1039 | #define WM8994_IN1L_MUTE_MASK 0x0080 /* IN1L_MUTE */ | ||
1040 | #define WM8994_IN1L_MUTE_SHIFT 7 /* IN1L_MUTE */ | ||
1041 | #define WM8994_IN1L_MUTE_WIDTH 1 /* IN1L_MUTE */ | ||
1042 | #define WM8994_IN1L_ZC 0x0040 /* IN1L_ZC */ | ||
1043 | #define WM8994_IN1L_ZC_MASK 0x0040 /* IN1L_ZC */ | ||
1044 | #define WM8994_IN1L_ZC_SHIFT 6 /* IN1L_ZC */ | ||
1045 | #define WM8994_IN1L_ZC_WIDTH 1 /* IN1L_ZC */ | ||
1046 | #define WM8994_IN1L_VOL_MASK 0x001F /* IN1L_VOL - [4:0] */ | ||
1047 | #define WM8994_IN1L_VOL_SHIFT 0 /* IN1L_VOL - [4:0] */ | ||
1048 | #define WM8994_IN1L_VOL_WIDTH 5 /* IN1L_VOL - [4:0] */ | ||
1049 | |||
1050 | /* | ||
1051 | * R25 (0x19) - Left Line Input 3&4 Volume | ||
1052 | */ | ||
1053 | #define WM8994_IN2_VU 0x0100 /* IN2_VU */ | ||
1054 | #define WM8994_IN2_VU_MASK 0x0100 /* IN2_VU */ | ||
1055 | #define WM8994_IN2_VU_SHIFT 8 /* IN2_VU */ | ||
1056 | #define WM8994_IN2_VU_WIDTH 1 /* IN2_VU */ | ||
1057 | #define WM8994_IN2L_MUTE 0x0080 /* IN2L_MUTE */ | ||
1058 | #define WM8994_IN2L_MUTE_MASK 0x0080 /* IN2L_MUTE */ | ||
1059 | #define WM8994_IN2L_MUTE_SHIFT 7 /* IN2L_MUTE */ | ||
1060 | #define WM8994_IN2L_MUTE_WIDTH 1 /* IN2L_MUTE */ | ||
1061 | #define WM8994_IN2L_ZC 0x0040 /* IN2L_ZC */ | ||
1062 | #define WM8994_IN2L_ZC_MASK 0x0040 /* IN2L_ZC */ | ||
1063 | #define WM8994_IN2L_ZC_SHIFT 6 /* IN2L_ZC */ | ||
1064 | #define WM8994_IN2L_ZC_WIDTH 1 /* IN2L_ZC */ | ||
1065 | #define WM8994_IN2L_VOL_MASK 0x001F /* IN2L_VOL - [4:0] */ | ||
1066 | #define WM8994_IN2L_VOL_SHIFT 0 /* IN2L_VOL - [4:0] */ | ||
1067 | #define WM8994_IN2L_VOL_WIDTH 5 /* IN2L_VOL - [4:0] */ | ||
1068 | |||
1069 | /* | ||
1070 | * R26 (0x1A) - Right Line Input 1&2 Volume | ||
1071 | */ | ||
1072 | #define WM8994_IN1_VU 0x0100 /* IN1_VU */ | ||
1073 | #define WM8994_IN1_VU_MASK 0x0100 /* IN1_VU */ | ||
1074 | #define WM8994_IN1_VU_SHIFT 8 /* IN1_VU */ | ||
1075 | #define WM8994_IN1_VU_WIDTH 1 /* IN1_VU */ | ||
1076 | #define WM8994_IN1R_MUTE 0x0080 /* IN1R_MUTE */ | ||
1077 | #define WM8994_IN1R_MUTE_MASK 0x0080 /* IN1R_MUTE */ | ||
1078 | #define WM8994_IN1R_MUTE_SHIFT 7 /* IN1R_MUTE */ | ||
1079 | #define WM8994_IN1R_MUTE_WIDTH 1 /* IN1R_MUTE */ | ||
1080 | #define WM8994_IN1R_ZC 0x0040 /* IN1R_ZC */ | ||
1081 | #define WM8994_IN1R_ZC_MASK 0x0040 /* IN1R_ZC */ | ||
1082 | #define WM8994_IN1R_ZC_SHIFT 6 /* IN1R_ZC */ | ||
1083 | #define WM8994_IN1R_ZC_WIDTH 1 /* IN1R_ZC */ | ||
1084 | #define WM8994_IN1R_VOL_MASK 0x001F /* IN1R_VOL - [4:0] */ | ||
1085 | #define WM8994_IN1R_VOL_SHIFT 0 /* IN1R_VOL - [4:0] */ | ||
1086 | #define WM8994_IN1R_VOL_WIDTH 5 /* IN1R_VOL - [4:0] */ | ||
1087 | |||
1088 | /* | ||
1089 | * R27 (0x1B) - Right Line Input 3&4 Volume | ||
1090 | */ | ||
1091 | #define WM8994_IN2_VU 0x0100 /* IN2_VU */ | ||
1092 | #define WM8994_IN2_VU_MASK 0x0100 /* IN2_VU */ | ||
1093 | #define WM8994_IN2_VU_SHIFT 8 /* IN2_VU */ | ||
1094 | #define WM8994_IN2_VU_WIDTH 1 /* IN2_VU */ | ||
1095 | #define WM8994_IN2R_MUTE 0x0080 /* IN2R_MUTE */ | ||
1096 | #define WM8994_IN2R_MUTE_MASK 0x0080 /* IN2R_MUTE */ | ||
1097 | #define WM8994_IN2R_MUTE_SHIFT 7 /* IN2R_MUTE */ | ||
1098 | #define WM8994_IN2R_MUTE_WIDTH 1 /* IN2R_MUTE */ | ||
1099 | #define WM8994_IN2R_ZC 0x0040 /* IN2R_ZC */ | ||
1100 | #define WM8994_IN2R_ZC_MASK 0x0040 /* IN2R_ZC */ | ||
1101 | #define WM8994_IN2R_ZC_SHIFT 6 /* IN2R_ZC */ | ||
1102 | #define WM8994_IN2R_ZC_WIDTH 1 /* IN2R_ZC */ | ||
1103 | #define WM8994_IN2R_VOL_MASK 0x001F /* IN2R_VOL - [4:0] */ | ||
1104 | #define WM8994_IN2R_VOL_SHIFT 0 /* IN2R_VOL - [4:0] */ | ||
1105 | #define WM8994_IN2R_VOL_WIDTH 5 /* IN2R_VOL - [4:0] */ | ||
1106 | |||
1107 | /* | ||
1108 | * R28 (0x1C) - Left Output Volume | ||
1109 | */ | ||
1110 | #define WM8994_HPOUT1_VU 0x0100 /* HPOUT1_VU */ | ||
1111 | #define WM8994_HPOUT1_VU_MASK 0x0100 /* HPOUT1_VU */ | ||
1112 | #define WM8994_HPOUT1_VU_SHIFT 8 /* HPOUT1_VU */ | ||
1113 | #define WM8994_HPOUT1_VU_WIDTH 1 /* HPOUT1_VU */ | ||
1114 | #define WM8994_HPOUT1L_ZC 0x0080 /* HPOUT1L_ZC */ | ||
1115 | #define WM8994_HPOUT1L_ZC_MASK 0x0080 /* HPOUT1L_ZC */ | ||
1116 | #define WM8994_HPOUT1L_ZC_SHIFT 7 /* HPOUT1L_ZC */ | ||
1117 | #define WM8994_HPOUT1L_ZC_WIDTH 1 /* HPOUT1L_ZC */ | ||
1118 | #define WM8994_HPOUT1L_MUTE_N 0x0040 /* HPOUT1L_MUTE_N */ | ||
1119 | #define WM8994_HPOUT1L_MUTE_N_MASK 0x0040 /* HPOUT1L_MUTE_N */ | ||
1120 | #define WM8994_HPOUT1L_MUTE_N_SHIFT 6 /* HPOUT1L_MUTE_N */ | ||
1121 | #define WM8994_HPOUT1L_MUTE_N_WIDTH 1 /* HPOUT1L_MUTE_N */ | ||
1122 | #define WM8994_HPOUT1L_VOL_MASK 0x003F /* HPOUT1L_VOL - [5:0] */ | ||
1123 | #define WM8994_HPOUT1L_VOL_SHIFT 0 /* HPOUT1L_VOL - [5:0] */ | ||
1124 | #define WM8994_HPOUT1L_VOL_WIDTH 6 /* HPOUT1L_VOL - [5:0] */ | ||
1125 | |||
1126 | /* | ||
1127 | * R29 (0x1D) - Right Output Volume | ||
1128 | */ | ||
1129 | #define WM8994_HPOUT1_VU 0x0100 /* HPOUT1_VU */ | ||
1130 | #define WM8994_HPOUT1_VU_MASK 0x0100 /* HPOUT1_VU */ | ||
1131 | #define WM8994_HPOUT1_VU_SHIFT 8 /* HPOUT1_VU */ | ||
1132 | #define WM8994_HPOUT1_VU_WIDTH 1 /* HPOUT1_VU */ | ||
1133 | #define WM8994_HPOUT1R_ZC 0x0080 /* HPOUT1R_ZC */ | ||
1134 | #define WM8994_HPOUT1R_ZC_MASK 0x0080 /* HPOUT1R_ZC */ | ||
1135 | #define WM8994_HPOUT1R_ZC_SHIFT 7 /* HPOUT1R_ZC */ | ||
1136 | #define WM8994_HPOUT1R_ZC_WIDTH 1 /* HPOUT1R_ZC */ | ||
1137 | #define WM8994_HPOUT1R_MUTE_N 0x0040 /* HPOUT1R_MUTE_N */ | ||
1138 | #define WM8994_HPOUT1R_MUTE_N_MASK 0x0040 /* HPOUT1R_MUTE_N */ | ||
1139 | #define WM8994_HPOUT1R_MUTE_N_SHIFT 6 /* HPOUT1R_MUTE_N */ | ||
1140 | #define WM8994_HPOUT1R_MUTE_N_WIDTH 1 /* HPOUT1R_MUTE_N */ | ||
1141 | #define WM8994_HPOUT1R_VOL_MASK 0x003F /* HPOUT1R_VOL - [5:0] */ | ||
1142 | #define WM8994_HPOUT1R_VOL_SHIFT 0 /* HPOUT1R_VOL - [5:0] */ | ||
1143 | #define WM8994_HPOUT1R_VOL_WIDTH 6 /* HPOUT1R_VOL - [5:0] */ | ||
1144 | |||
1145 | /* | ||
1146 | * R30 (0x1E) - Line Outputs Volume | ||
1147 | */ | ||
1148 | #define WM8994_LINEOUT1N_MUTE 0x0040 /* LINEOUT1N_MUTE */ | ||
1149 | #define WM8994_LINEOUT1N_MUTE_MASK 0x0040 /* LINEOUT1N_MUTE */ | ||
1150 | #define WM8994_LINEOUT1N_MUTE_SHIFT 6 /* LINEOUT1N_MUTE */ | ||
1151 | #define WM8994_LINEOUT1N_MUTE_WIDTH 1 /* LINEOUT1N_MUTE */ | ||
1152 | #define WM8994_LINEOUT1P_MUTE 0x0020 /* LINEOUT1P_MUTE */ | ||
1153 | #define WM8994_LINEOUT1P_MUTE_MASK 0x0020 /* LINEOUT1P_MUTE */ | ||
1154 | #define WM8994_LINEOUT1P_MUTE_SHIFT 5 /* LINEOUT1P_MUTE */ | ||
1155 | #define WM8994_LINEOUT1P_MUTE_WIDTH 1 /* LINEOUT1P_MUTE */ | ||
1156 | #define WM8994_LINEOUT1_VOL 0x0010 /* LINEOUT1_VOL */ | ||
1157 | #define WM8994_LINEOUT1_VOL_MASK 0x0010 /* LINEOUT1_VOL */ | ||
1158 | #define WM8994_LINEOUT1_VOL_SHIFT 4 /* LINEOUT1_VOL */ | ||
1159 | #define WM8994_LINEOUT1_VOL_WIDTH 1 /* LINEOUT1_VOL */ | ||
1160 | #define WM8994_LINEOUT2N_MUTE 0x0004 /* LINEOUT2N_MUTE */ | ||
1161 | #define WM8994_LINEOUT2N_MUTE_MASK 0x0004 /* LINEOUT2N_MUTE */ | ||
1162 | #define WM8994_LINEOUT2N_MUTE_SHIFT 2 /* LINEOUT2N_MUTE */ | ||
1163 | #define WM8994_LINEOUT2N_MUTE_WIDTH 1 /* LINEOUT2N_MUTE */ | ||
1164 | #define WM8994_LINEOUT2P_MUTE 0x0002 /* LINEOUT2P_MUTE */ | ||
1165 | #define WM8994_LINEOUT2P_MUTE_MASK 0x0002 /* LINEOUT2P_MUTE */ | ||
1166 | #define WM8994_LINEOUT2P_MUTE_SHIFT 1 /* LINEOUT2P_MUTE */ | ||
1167 | #define WM8994_LINEOUT2P_MUTE_WIDTH 1 /* LINEOUT2P_MUTE */ | ||
1168 | #define WM8994_LINEOUT2_VOL 0x0001 /* LINEOUT2_VOL */ | ||
1169 | #define WM8994_LINEOUT2_VOL_MASK 0x0001 /* LINEOUT2_VOL */ | ||
1170 | #define WM8994_LINEOUT2_VOL_SHIFT 0 /* LINEOUT2_VOL */ | ||
1171 | #define WM8994_LINEOUT2_VOL_WIDTH 1 /* LINEOUT2_VOL */ | ||
1172 | |||
1173 | /* | ||
1174 | * R31 (0x1F) - HPOUT2 Volume | ||
1175 | */ | ||
1176 | #define WM8994_HPOUT2_MUTE 0x0020 /* HPOUT2_MUTE */ | ||
1177 | #define WM8994_HPOUT2_MUTE_MASK 0x0020 /* HPOUT2_MUTE */ | ||
1178 | #define WM8994_HPOUT2_MUTE_SHIFT 5 /* HPOUT2_MUTE */ | ||
1179 | #define WM8994_HPOUT2_MUTE_WIDTH 1 /* HPOUT2_MUTE */ | ||
1180 | #define WM8994_HPOUT2_VOL 0x0010 /* HPOUT2_VOL */ | ||
1181 | #define WM8994_HPOUT2_VOL_MASK 0x0010 /* HPOUT2_VOL */ | ||
1182 | #define WM8994_HPOUT2_VOL_SHIFT 4 /* HPOUT2_VOL */ | ||
1183 | #define WM8994_HPOUT2_VOL_WIDTH 1 /* HPOUT2_VOL */ | ||
1184 | |||
1185 | /* | ||
1186 | * R32 (0x20) - Left OPGA Volume | ||
1187 | */ | ||
1188 | #define WM8994_MIXOUT_VU 0x0100 /* MIXOUT_VU */ | ||
1189 | #define WM8994_MIXOUT_VU_MASK 0x0100 /* MIXOUT_VU */ | ||
1190 | #define WM8994_MIXOUT_VU_SHIFT 8 /* MIXOUT_VU */ | ||
1191 | #define WM8994_MIXOUT_VU_WIDTH 1 /* MIXOUT_VU */ | ||
1192 | #define WM8994_MIXOUTL_ZC 0x0080 /* MIXOUTL_ZC */ | ||
1193 | #define WM8994_MIXOUTL_ZC_MASK 0x0080 /* MIXOUTL_ZC */ | ||
1194 | #define WM8994_MIXOUTL_ZC_SHIFT 7 /* MIXOUTL_ZC */ | ||
1195 | #define WM8994_MIXOUTL_ZC_WIDTH 1 /* MIXOUTL_ZC */ | ||
1196 | #define WM8994_MIXOUTL_MUTE_N 0x0040 /* MIXOUTL_MUTE_N */ | ||
1197 | #define WM8994_MIXOUTL_MUTE_N_MASK 0x0040 /* MIXOUTL_MUTE_N */ | ||
1198 | #define WM8994_MIXOUTL_MUTE_N_SHIFT 6 /* MIXOUTL_MUTE_N */ | ||
1199 | #define WM8994_MIXOUTL_MUTE_N_WIDTH 1 /* MIXOUTL_MUTE_N */ | ||
1200 | #define WM8994_MIXOUTL_VOL_MASK 0x003F /* MIXOUTL_VOL - [5:0] */ | ||
1201 | #define WM8994_MIXOUTL_VOL_SHIFT 0 /* MIXOUTL_VOL - [5:0] */ | ||
1202 | #define WM8994_MIXOUTL_VOL_WIDTH 6 /* MIXOUTL_VOL - [5:0] */ | ||
1203 | |||
1204 | /* | ||
1205 | * R33 (0x21) - Right OPGA Volume | ||
1206 | */ | ||
1207 | #define WM8994_MIXOUT_VU 0x0100 /* MIXOUT_VU */ | ||
1208 | #define WM8994_MIXOUT_VU_MASK 0x0100 /* MIXOUT_VU */ | ||
1209 | #define WM8994_MIXOUT_VU_SHIFT 8 /* MIXOUT_VU */ | ||
1210 | #define WM8994_MIXOUT_VU_WIDTH 1 /* MIXOUT_VU */ | ||
1211 | #define WM8994_MIXOUTR_ZC 0x0080 /* MIXOUTR_ZC */ | ||
1212 | #define WM8994_MIXOUTR_ZC_MASK 0x0080 /* MIXOUTR_ZC */ | ||
1213 | #define WM8994_MIXOUTR_ZC_SHIFT 7 /* MIXOUTR_ZC */ | ||
1214 | #define WM8994_MIXOUTR_ZC_WIDTH 1 /* MIXOUTR_ZC */ | ||
1215 | #define WM8994_MIXOUTR_MUTE_N 0x0040 /* MIXOUTR_MUTE_N */ | ||
1216 | #define WM8994_MIXOUTR_MUTE_N_MASK 0x0040 /* MIXOUTR_MUTE_N */ | ||
1217 | #define WM8994_MIXOUTR_MUTE_N_SHIFT 6 /* MIXOUTR_MUTE_N */ | ||
1218 | #define WM8994_MIXOUTR_MUTE_N_WIDTH 1 /* MIXOUTR_MUTE_N */ | ||
1219 | #define WM8994_MIXOUTR_VOL_MASK 0x003F /* MIXOUTR_VOL - [5:0] */ | ||
1220 | #define WM8994_MIXOUTR_VOL_SHIFT 0 /* MIXOUTR_VOL - [5:0] */ | ||
1221 | #define WM8994_MIXOUTR_VOL_WIDTH 6 /* MIXOUTR_VOL - [5:0] */ | ||
1222 | |||
1223 | /* | ||
1224 | * R34 (0x22) - SPKMIXL Attenuation | ||
1225 | */ | ||
1226 | #define WM8994_DAC2L_SPKMIXL_VOL 0x0040 /* DAC2L_SPKMIXL_VOL */ | ||
1227 | #define WM8994_DAC2L_SPKMIXL_VOL_MASK 0x0040 /* DAC2L_SPKMIXL_VOL */ | ||
1228 | #define WM8994_DAC2L_SPKMIXL_VOL_SHIFT 6 /* DAC2L_SPKMIXL_VOL */ | ||
1229 | #define WM8994_DAC2L_SPKMIXL_VOL_WIDTH 1 /* DAC2L_SPKMIXL_VOL */ | ||
1230 | #define WM8994_MIXINL_SPKMIXL_VOL 0x0020 /* MIXINL_SPKMIXL_VOL */ | ||
1231 | #define WM8994_MIXINL_SPKMIXL_VOL_MASK 0x0020 /* MIXINL_SPKMIXL_VOL */ | ||
1232 | #define WM8994_MIXINL_SPKMIXL_VOL_SHIFT 5 /* MIXINL_SPKMIXL_VOL */ | ||
1233 | #define WM8994_MIXINL_SPKMIXL_VOL_WIDTH 1 /* MIXINL_SPKMIXL_VOL */ | ||
1234 | #define WM8994_IN1LP_SPKMIXL_VOL 0x0010 /* IN1LP_SPKMIXL_VOL */ | ||
1235 | #define WM8994_IN1LP_SPKMIXL_VOL_MASK 0x0010 /* IN1LP_SPKMIXL_VOL */ | ||
1236 | #define WM8994_IN1LP_SPKMIXL_VOL_SHIFT 4 /* IN1LP_SPKMIXL_VOL */ | ||
1237 | #define WM8994_IN1LP_SPKMIXL_VOL_WIDTH 1 /* IN1LP_SPKMIXL_VOL */ | ||
1238 | #define WM8994_MIXOUTL_SPKMIXL_VOL 0x0008 /* MIXOUTL_SPKMIXL_VOL */ | ||
1239 | #define WM8994_MIXOUTL_SPKMIXL_VOL_MASK 0x0008 /* MIXOUTL_SPKMIXL_VOL */ | ||
1240 | #define WM8994_MIXOUTL_SPKMIXL_VOL_SHIFT 3 /* MIXOUTL_SPKMIXL_VOL */ | ||
1241 | #define WM8994_MIXOUTL_SPKMIXL_VOL_WIDTH 1 /* MIXOUTL_SPKMIXL_VOL */ | ||
1242 | #define WM8994_DAC1L_SPKMIXL_VOL 0x0004 /* DAC1L_SPKMIXL_VOL */ | ||
1243 | #define WM8994_DAC1L_SPKMIXL_VOL_MASK 0x0004 /* DAC1L_SPKMIXL_VOL */ | ||
1244 | #define WM8994_DAC1L_SPKMIXL_VOL_SHIFT 2 /* DAC1L_SPKMIXL_VOL */ | ||
1245 | #define WM8994_DAC1L_SPKMIXL_VOL_WIDTH 1 /* DAC1L_SPKMIXL_VOL */ | ||
1246 | #define WM8994_SPKMIXL_VOL_MASK 0x0003 /* SPKMIXL_VOL - [1:0] */ | ||
1247 | #define WM8994_SPKMIXL_VOL_SHIFT 0 /* SPKMIXL_VOL - [1:0] */ | ||
1248 | #define WM8994_SPKMIXL_VOL_WIDTH 2 /* SPKMIXL_VOL - [1:0] */ | ||
1249 | |||
1250 | /* | ||
1251 | * R35 (0x23) - SPKMIXR Attenuation | ||
1252 | */ | ||
1253 | #define WM8994_SPKOUT_CLASSAB 0x0100 /* SPKOUT_CLASSAB */ | ||
1254 | #define WM8994_SPKOUT_CLASSAB_MASK 0x0100 /* SPKOUT_CLASSAB */ | ||
1255 | #define WM8994_SPKOUT_CLASSAB_SHIFT 8 /* SPKOUT_CLASSAB */ | ||
1256 | #define WM8994_SPKOUT_CLASSAB_WIDTH 1 /* SPKOUT_CLASSAB */ | ||
1257 | #define WM8994_DAC2R_SPKMIXR_VOL 0x0040 /* DAC2R_SPKMIXR_VOL */ | ||
1258 | #define WM8994_DAC2R_SPKMIXR_VOL_MASK 0x0040 /* DAC2R_SPKMIXR_VOL */ | ||
1259 | #define WM8994_DAC2R_SPKMIXR_VOL_SHIFT 6 /* DAC2R_SPKMIXR_VOL */ | ||
1260 | #define WM8994_DAC2R_SPKMIXR_VOL_WIDTH 1 /* DAC2R_SPKMIXR_VOL */ | ||
1261 | #define WM8994_MIXINR_SPKMIXR_VOL 0x0020 /* MIXINR_SPKMIXR_VOL */ | ||
1262 | #define WM8994_MIXINR_SPKMIXR_VOL_MASK 0x0020 /* MIXINR_SPKMIXR_VOL */ | ||
1263 | #define WM8994_MIXINR_SPKMIXR_VOL_SHIFT 5 /* MIXINR_SPKMIXR_VOL */ | ||
1264 | #define WM8994_MIXINR_SPKMIXR_VOL_WIDTH 1 /* MIXINR_SPKMIXR_VOL */ | ||
1265 | #define WM8994_IN1RP_SPKMIXR_VOL 0x0010 /* IN1RP_SPKMIXR_VOL */ | ||
1266 | #define WM8994_IN1RP_SPKMIXR_VOL_MASK 0x0010 /* IN1RP_SPKMIXR_VOL */ | ||
1267 | #define WM8994_IN1RP_SPKMIXR_VOL_SHIFT 4 /* IN1RP_SPKMIXR_VOL */ | ||
1268 | #define WM8994_IN1RP_SPKMIXR_VOL_WIDTH 1 /* IN1RP_SPKMIXR_VOL */ | ||
1269 | #define WM8994_MIXOUTR_SPKMIXR_VOL 0x0008 /* MIXOUTR_SPKMIXR_VOL */ | ||
1270 | #define WM8994_MIXOUTR_SPKMIXR_VOL_MASK 0x0008 /* MIXOUTR_SPKMIXR_VOL */ | ||
1271 | #define WM8994_MIXOUTR_SPKMIXR_VOL_SHIFT 3 /* MIXOUTR_SPKMIXR_VOL */ | ||
1272 | #define WM8994_MIXOUTR_SPKMIXR_VOL_WIDTH 1 /* MIXOUTR_SPKMIXR_VOL */ | ||
1273 | #define WM8994_DAC1R_SPKMIXR_VOL 0x0004 /* DAC1R_SPKMIXR_VOL */ | ||
1274 | #define WM8994_DAC1R_SPKMIXR_VOL_MASK 0x0004 /* DAC1R_SPKMIXR_VOL */ | ||
1275 | #define WM8994_DAC1R_SPKMIXR_VOL_SHIFT 2 /* DAC1R_SPKMIXR_VOL */ | ||
1276 | #define WM8994_DAC1R_SPKMIXR_VOL_WIDTH 1 /* DAC1R_SPKMIXR_VOL */ | ||
1277 | #define WM8994_SPKMIXR_VOL_MASK 0x0003 /* SPKMIXR_VOL - [1:0] */ | ||
1278 | #define WM8994_SPKMIXR_VOL_SHIFT 0 /* SPKMIXR_VOL - [1:0] */ | ||
1279 | #define WM8994_SPKMIXR_VOL_WIDTH 2 /* SPKMIXR_VOL - [1:0] */ | ||
1280 | |||
1281 | /* | ||
1282 | * R36 (0x24) - SPKOUT Mixers | ||
1283 | */ | ||
1284 | #define WM8994_IN2LRP_TO_SPKOUTL 0x0020 /* IN2LRP_TO_SPKOUTL */ | ||
1285 | #define WM8994_IN2LRP_TO_SPKOUTL_MASK 0x0020 /* IN2LRP_TO_SPKOUTL */ | ||
1286 | #define WM8994_IN2LRP_TO_SPKOUTL_SHIFT 5 /* IN2LRP_TO_SPKOUTL */ | ||
1287 | #define WM8994_IN2LRP_TO_SPKOUTL_WIDTH 1 /* IN2LRP_TO_SPKOUTL */ | ||
1288 | #define WM8994_SPKMIXL_TO_SPKOUTL 0x0010 /* SPKMIXL_TO_SPKOUTL */ | ||
1289 | #define WM8994_SPKMIXL_TO_SPKOUTL_MASK 0x0010 /* SPKMIXL_TO_SPKOUTL */ | ||
1290 | #define WM8994_SPKMIXL_TO_SPKOUTL_SHIFT 4 /* SPKMIXL_TO_SPKOUTL */ | ||
1291 | #define WM8994_SPKMIXL_TO_SPKOUTL_WIDTH 1 /* SPKMIXL_TO_SPKOUTL */ | ||
1292 | #define WM8994_SPKMIXR_TO_SPKOUTL 0x0008 /* SPKMIXR_TO_SPKOUTL */ | ||
1293 | #define WM8994_SPKMIXR_TO_SPKOUTL_MASK 0x0008 /* SPKMIXR_TO_SPKOUTL */ | ||
1294 | #define WM8994_SPKMIXR_TO_SPKOUTL_SHIFT 3 /* SPKMIXR_TO_SPKOUTL */ | ||
1295 | #define WM8994_SPKMIXR_TO_SPKOUTL_WIDTH 1 /* SPKMIXR_TO_SPKOUTL */ | ||
1296 | #define WM8994_IN2LRP_TO_SPKOUTR 0x0004 /* IN2LRP_TO_SPKOUTR */ | ||
1297 | #define WM8994_IN2LRP_TO_SPKOUTR_MASK 0x0004 /* IN2LRP_TO_SPKOUTR */ | ||
1298 | #define WM8994_IN2LRP_TO_SPKOUTR_SHIFT 2 /* IN2LRP_TO_SPKOUTR */ | ||
1299 | #define WM8994_IN2LRP_TO_SPKOUTR_WIDTH 1 /* IN2LRP_TO_SPKOUTR */ | ||
1300 | #define WM8994_SPKMIXL_TO_SPKOUTR 0x0002 /* SPKMIXL_TO_SPKOUTR */ | ||
1301 | #define WM8994_SPKMIXL_TO_SPKOUTR_MASK 0x0002 /* SPKMIXL_TO_SPKOUTR */ | ||
1302 | #define WM8994_SPKMIXL_TO_SPKOUTR_SHIFT 1 /* SPKMIXL_TO_SPKOUTR */ | ||
1303 | #define WM8994_SPKMIXL_TO_SPKOUTR_WIDTH 1 /* SPKMIXL_TO_SPKOUTR */ | ||
1304 | #define WM8994_SPKMIXR_TO_SPKOUTR 0x0001 /* SPKMIXR_TO_SPKOUTR */ | ||
1305 | #define WM8994_SPKMIXR_TO_SPKOUTR_MASK 0x0001 /* SPKMIXR_TO_SPKOUTR */ | ||
1306 | #define WM8994_SPKMIXR_TO_SPKOUTR_SHIFT 0 /* SPKMIXR_TO_SPKOUTR */ | ||
1307 | #define WM8994_SPKMIXR_TO_SPKOUTR_WIDTH 1 /* SPKMIXR_TO_SPKOUTR */ | ||
1308 | |||
1309 | /* | ||
1310 | * R37 (0x25) - ClassD | ||
1311 | */ | ||
1312 | #define WM8994_SPKOUTL_BOOST_MASK 0x0038 /* SPKOUTL_BOOST - [5:3] */ | ||
1313 | #define WM8994_SPKOUTL_BOOST_SHIFT 3 /* SPKOUTL_BOOST - [5:3] */ | ||
1314 | #define WM8994_SPKOUTL_BOOST_WIDTH 3 /* SPKOUTL_BOOST - [5:3] */ | ||
1315 | #define WM8994_SPKOUTR_BOOST_MASK 0x0007 /* SPKOUTR_BOOST - [2:0] */ | ||
1316 | #define WM8994_SPKOUTR_BOOST_SHIFT 0 /* SPKOUTR_BOOST - [2:0] */ | ||
1317 | #define WM8994_SPKOUTR_BOOST_WIDTH 3 /* SPKOUTR_BOOST - [2:0] */ | ||
1318 | |||
1319 | /* | ||
1320 | * R38 (0x26) - Speaker Volume Left | ||
1321 | */ | ||
1322 | #define WM8994_SPKOUT_VU 0x0100 /* SPKOUT_VU */ | ||
1323 | #define WM8994_SPKOUT_VU_MASK 0x0100 /* SPKOUT_VU */ | ||
1324 | #define WM8994_SPKOUT_VU_SHIFT 8 /* SPKOUT_VU */ | ||
1325 | #define WM8994_SPKOUT_VU_WIDTH 1 /* SPKOUT_VU */ | ||
1326 | #define WM8994_SPKOUTL_ZC 0x0080 /* SPKOUTL_ZC */ | ||
1327 | #define WM8994_SPKOUTL_ZC_MASK 0x0080 /* SPKOUTL_ZC */ | ||
1328 | #define WM8994_SPKOUTL_ZC_SHIFT 7 /* SPKOUTL_ZC */ | ||
1329 | #define WM8994_SPKOUTL_ZC_WIDTH 1 /* SPKOUTL_ZC */ | ||
1330 | #define WM8994_SPKOUTL_MUTE_N 0x0040 /* SPKOUTL_MUTE_N */ | ||
1331 | #define WM8994_SPKOUTL_MUTE_N_MASK 0x0040 /* SPKOUTL_MUTE_N */ | ||
1332 | #define WM8994_SPKOUTL_MUTE_N_SHIFT 6 /* SPKOUTL_MUTE_N */ | ||
1333 | #define WM8994_SPKOUTL_MUTE_N_WIDTH 1 /* SPKOUTL_MUTE_N */ | ||
1334 | #define WM8994_SPKOUTL_VOL_MASK 0x003F /* SPKOUTL_VOL - [5:0] */ | ||
1335 | #define WM8994_SPKOUTL_VOL_SHIFT 0 /* SPKOUTL_VOL - [5:0] */ | ||
1336 | #define WM8994_SPKOUTL_VOL_WIDTH 6 /* SPKOUTL_VOL - [5:0] */ | ||
1337 | |||
1338 | /* | ||
1339 | * R39 (0x27) - Speaker Volume Right | ||
1340 | */ | ||
1341 | #define WM8994_SPKOUT_VU 0x0100 /* SPKOUT_VU */ | ||
1342 | #define WM8994_SPKOUT_VU_MASK 0x0100 /* SPKOUT_VU */ | ||
1343 | #define WM8994_SPKOUT_VU_SHIFT 8 /* SPKOUT_VU */ | ||
1344 | #define WM8994_SPKOUT_VU_WIDTH 1 /* SPKOUT_VU */ | ||
1345 | #define WM8994_SPKOUTR_ZC 0x0080 /* SPKOUTR_ZC */ | ||
1346 | #define WM8994_SPKOUTR_ZC_MASK 0x0080 /* SPKOUTR_ZC */ | ||
1347 | #define WM8994_SPKOUTR_ZC_SHIFT 7 /* SPKOUTR_ZC */ | ||
1348 | #define WM8994_SPKOUTR_ZC_WIDTH 1 /* SPKOUTR_ZC */ | ||
1349 | #define WM8994_SPKOUTR_MUTE_N 0x0040 /* SPKOUTR_MUTE_N */ | ||
1350 | #define WM8994_SPKOUTR_MUTE_N_MASK 0x0040 /* SPKOUTR_MUTE_N */ | ||
1351 | #define WM8994_SPKOUTR_MUTE_N_SHIFT 6 /* SPKOUTR_MUTE_N */ | ||
1352 | #define WM8994_SPKOUTR_MUTE_N_WIDTH 1 /* SPKOUTR_MUTE_N */ | ||
1353 | #define WM8994_SPKOUTR_VOL_MASK 0x003F /* SPKOUTR_VOL - [5:0] */ | ||
1354 | #define WM8994_SPKOUTR_VOL_SHIFT 0 /* SPKOUTR_VOL - [5:0] */ | ||
1355 | #define WM8994_SPKOUTR_VOL_WIDTH 6 /* SPKOUTR_VOL - [5:0] */ | ||
1356 | |||
1357 | /* | ||
1358 | * R40 (0x28) - Input Mixer (2) | ||
1359 | */ | ||
1360 | #define WM8994_IN2LP_TO_IN2L 0x0080 /* IN2LP_TO_IN2L */ | ||
1361 | #define WM8994_IN2LP_TO_IN2L_MASK 0x0080 /* IN2LP_TO_IN2L */ | ||
1362 | #define WM8994_IN2LP_TO_IN2L_SHIFT 7 /* IN2LP_TO_IN2L */ | ||
1363 | #define WM8994_IN2LP_TO_IN2L_WIDTH 1 /* IN2LP_TO_IN2L */ | ||
1364 | #define WM8994_IN2LN_TO_IN2L 0x0040 /* IN2LN_TO_IN2L */ | ||
1365 | #define WM8994_IN2LN_TO_IN2L_MASK 0x0040 /* IN2LN_TO_IN2L */ | ||
1366 | #define WM8994_IN2LN_TO_IN2L_SHIFT 6 /* IN2LN_TO_IN2L */ | ||
1367 | #define WM8994_IN2LN_TO_IN2L_WIDTH 1 /* IN2LN_TO_IN2L */ | ||
1368 | #define WM8994_IN1LP_TO_IN1L 0x0020 /* IN1LP_TO_IN1L */ | ||
1369 | #define WM8994_IN1LP_TO_IN1L_MASK 0x0020 /* IN1LP_TO_IN1L */ | ||
1370 | #define WM8994_IN1LP_TO_IN1L_SHIFT 5 /* IN1LP_TO_IN1L */ | ||
1371 | #define WM8994_IN1LP_TO_IN1L_WIDTH 1 /* IN1LP_TO_IN1L */ | ||
1372 | #define WM8994_IN1LN_TO_IN1L 0x0010 /* IN1LN_TO_IN1L */ | ||
1373 | #define WM8994_IN1LN_TO_IN1L_MASK 0x0010 /* IN1LN_TO_IN1L */ | ||
1374 | #define WM8994_IN1LN_TO_IN1L_SHIFT 4 /* IN1LN_TO_IN1L */ | ||
1375 | #define WM8994_IN1LN_TO_IN1L_WIDTH 1 /* IN1LN_TO_IN1L */ | ||
1376 | #define WM8994_IN2RP_TO_IN2R 0x0008 /* IN2RP_TO_IN2R */ | ||
1377 | #define WM8994_IN2RP_TO_IN2R_MASK 0x0008 /* IN2RP_TO_IN2R */ | ||
1378 | #define WM8994_IN2RP_TO_IN2R_SHIFT 3 /* IN2RP_TO_IN2R */ | ||
1379 | #define WM8994_IN2RP_TO_IN2R_WIDTH 1 /* IN2RP_TO_IN2R */ | ||
1380 | #define WM8994_IN2RN_TO_IN2R 0x0004 /* IN2RN_TO_IN2R */ | ||
1381 | #define WM8994_IN2RN_TO_IN2R_MASK 0x0004 /* IN2RN_TO_IN2R */ | ||
1382 | #define WM8994_IN2RN_TO_IN2R_SHIFT 2 /* IN2RN_TO_IN2R */ | ||
1383 | #define WM8994_IN2RN_TO_IN2R_WIDTH 1 /* IN2RN_TO_IN2R */ | ||
1384 | #define WM8994_IN1RP_TO_IN1R 0x0002 /* IN1RP_TO_IN1R */ | ||
1385 | #define WM8994_IN1RP_TO_IN1R_MASK 0x0002 /* IN1RP_TO_IN1R */ | ||
1386 | #define WM8994_IN1RP_TO_IN1R_SHIFT 1 /* IN1RP_TO_IN1R */ | ||
1387 | #define WM8994_IN1RP_TO_IN1R_WIDTH 1 /* IN1RP_TO_IN1R */ | ||
1388 | #define WM8994_IN1RN_TO_IN1R 0x0001 /* IN1RN_TO_IN1R */ | ||
1389 | #define WM8994_IN1RN_TO_IN1R_MASK 0x0001 /* IN1RN_TO_IN1R */ | ||
1390 | #define WM8994_IN1RN_TO_IN1R_SHIFT 0 /* IN1RN_TO_IN1R */ | ||
1391 | #define WM8994_IN1RN_TO_IN1R_WIDTH 1 /* IN1RN_TO_IN1R */ | ||
1392 | |||
1393 | /* | ||
1394 | * R41 (0x29) - Input Mixer (3) | ||
1395 | */ | ||
1396 | #define WM8994_IN2L_TO_MIXINL 0x0100 /* IN2L_TO_MIXINL */ | ||
1397 | #define WM8994_IN2L_TO_MIXINL_MASK 0x0100 /* IN2L_TO_MIXINL */ | ||
1398 | #define WM8994_IN2L_TO_MIXINL_SHIFT 8 /* IN2L_TO_MIXINL */ | ||
1399 | #define WM8994_IN2L_TO_MIXINL_WIDTH 1 /* IN2L_TO_MIXINL */ | ||
1400 | #define WM8994_IN2L_MIXINL_VOL 0x0080 /* IN2L_MIXINL_VOL */ | ||
1401 | #define WM8994_IN2L_MIXINL_VOL_MASK 0x0080 /* IN2L_MIXINL_VOL */ | ||
1402 | #define WM8994_IN2L_MIXINL_VOL_SHIFT 7 /* IN2L_MIXINL_VOL */ | ||
1403 | #define WM8994_IN2L_MIXINL_VOL_WIDTH 1 /* IN2L_MIXINL_VOL */ | ||
1404 | #define WM8994_IN1L_TO_MIXINL 0x0020 /* IN1L_TO_MIXINL */ | ||
1405 | #define WM8994_IN1L_TO_MIXINL_MASK 0x0020 /* IN1L_TO_MIXINL */ | ||
1406 | #define WM8994_IN1L_TO_MIXINL_SHIFT 5 /* IN1L_TO_MIXINL */ | ||
1407 | #define WM8994_IN1L_TO_MIXINL_WIDTH 1 /* IN1L_TO_MIXINL */ | ||
1408 | #define WM8994_IN1L_MIXINL_VOL 0x0010 /* IN1L_MIXINL_VOL */ | ||
1409 | #define WM8994_IN1L_MIXINL_VOL_MASK 0x0010 /* IN1L_MIXINL_VOL */ | ||
1410 | #define WM8994_IN1L_MIXINL_VOL_SHIFT 4 /* IN1L_MIXINL_VOL */ | ||
1411 | #define WM8994_IN1L_MIXINL_VOL_WIDTH 1 /* IN1L_MIXINL_VOL */ | ||
1412 | #define WM8994_MIXOUTL_MIXINL_VOL_MASK 0x0007 /* MIXOUTL_MIXINL_VOL - [2:0] */ | ||
1413 | #define WM8994_MIXOUTL_MIXINL_VOL_SHIFT 0 /* MIXOUTL_MIXINL_VOL - [2:0] */ | ||
1414 | #define WM8994_MIXOUTL_MIXINL_VOL_WIDTH 3 /* MIXOUTL_MIXINL_VOL - [2:0] */ | ||
1415 | |||
1416 | /* | ||
1417 | * R42 (0x2A) - Input Mixer (4) | ||
1418 | */ | ||
1419 | #define WM8994_IN2R_TO_MIXINR 0x0100 /* IN2R_TO_MIXINR */ | ||
1420 | #define WM8994_IN2R_TO_MIXINR_MASK 0x0100 /* IN2R_TO_MIXINR */ | ||
1421 | #define WM8994_IN2R_TO_MIXINR_SHIFT 8 /* IN2R_TO_MIXINR */ | ||
1422 | #define WM8994_IN2R_TO_MIXINR_WIDTH 1 /* IN2R_TO_MIXINR */ | ||
1423 | #define WM8994_IN2R_MIXINR_VOL 0x0080 /* IN2R_MIXINR_VOL */ | ||
1424 | #define WM8994_IN2R_MIXINR_VOL_MASK 0x0080 /* IN2R_MIXINR_VOL */ | ||
1425 | #define WM8994_IN2R_MIXINR_VOL_SHIFT 7 /* IN2R_MIXINR_VOL */ | ||
1426 | #define WM8994_IN2R_MIXINR_VOL_WIDTH 1 /* IN2R_MIXINR_VOL */ | ||
1427 | #define WM8994_IN1R_TO_MIXINR 0x0020 /* IN1R_TO_MIXINR */ | ||
1428 | #define WM8994_IN1R_TO_MIXINR_MASK 0x0020 /* IN1R_TO_MIXINR */ | ||
1429 | #define WM8994_IN1R_TO_MIXINR_SHIFT 5 /* IN1R_TO_MIXINR */ | ||
1430 | #define WM8994_IN1R_TO_MIXINR_WIDTH 1 /* IN1R_TO_MIXINR */ | ||
1431 | #define WM8994_IN1R_MIXINR_VOL 0x0010 /* IN1R_MIXINR_VOL */ | ||
1432 | #define WM8994_IN1R_MIXINR_VOL_MASK 0x0010 /* IN1R_MIXINR_VOL */ | ||
1433 | #define WM8994_IN1R_MIXINR_VOL_SHIFT 4 /* IN1R_MIXINR_VOL */ | ||
1434 | #define WM8994_IN1R_MIXINR_VOL_WIDTH 1 /* IN1R_MIXINR_VOL */ | ||
1435 | #define WM8994_MIXOUTR_MIXINR_VOL_MASK 0x0007 /* MIXOUTR_MIXINR_VOL - [2:0] */ | ||
1436 | #define WM8994_MIXOUTR_MIXINR_VOL_SHIFT 0 /* MIXOUTR_MIXINR_VOL - [2:0] */ | ||
1437 | #define WM8994_MIXOUTR_MIXINR_VOL_WIDTH 3 /* MIXOUTR_MIXINR_VOL - [2:0] */ | ||
1438 | |||
1439 | /* | ||
1440 | * R43 (0x2B) - Input Mixer (5) | ||
1441 | */ | ||
1442 | #define WM8994_IN1LP_MIXINL_VOL_MASK 0x01C0 /* IN1LP_MIXINL_VOL - [8:6] */ | ||
1443 | #define WM8994_IN1LP_MIXINL_VOL_SHIFT 6 /* IN1LP_MIXINL_VOL - [8:6] */ | ||
1444 | #define WM8994_IN1LP_MIXINL_VOL_WIDTH 3 /* IN1LP_MIXINL_VOL - [8:6] */ | ||
1445 | #define WM8994_IN2LRP_MIXINL_VOL_MASK 0x0007 /* IN2LRP_MIXINL_VOL - [2:0] */ | ||
1446 | #define WM8994_IN2LRP_MIXINL_VOL_SHIFT 0 /* IN2LRP_MIXINL_VOL - [2:0] */ | ||
1447 | #define WM8994_IN2LRP_MIXINL_VOL_WIDTH 3 /* IN2LRP_MIXINL_VOL - [2:0] */ | ||
1448 | |||
1449 | /* | ||
1450 | * R44 (0x2C) - Input Mixer (6) | ||
1451 | */ | ||
1452 | #define WM8994_IN1RP_MIXINR_VOL_MASK 0x01C0 /* IN1RP_MIXINR_VOL - [8:6] */ | ||
1453 | #define WM8994_IN1RP_MIXINR_VOL_SHIFT 6 /* IN1RP_MIXINR_VOL - [8:6] */ | ||
1454 | #define WM8994_IN1RP_MIXINR_VOL_WIDTH 3 /* IN1RP_MIXINR_VOL - [8:6] */ | ||
1455 | #define WM8994_IN2LRP_MIXINR_VOL_MASK 0x0007 /* IN2LRP_MIXINR_VOL - [2:0] */ | ||
1456 | #define WM8994_IN2LRP_MIXINR_VOL_SHIFT 0 /* IN2LRP_MIXINR_VOL - [2:0] */ | ||
1457 | #define WM8994_IN2LRP_MIXINR_VOL_WIDTH 3 /* IN2LRP_MIXINR_VOL - [2:0] */ | ||
1458 | |||
1459 | /* | ||
1460 | * R45 (0x2D) - Output Mixer (1) | ||
1461 | */ | ||
1462 | #define WM8994_DAC1L_TO_HPOUT1L 0x0100 /* DAC1L_TO_HPOUT1L */ | ||
1463 | #define WM8994_DAC1L_TO_HPOUT1L_MASK 0x0100 /* DAC1L_TO_HPOUT1L */ | ||
1464 | #define WM8994_DAC1L_TO_HPOUT1L_SHIFT 8 /* DAC1L_TO_HPOUT1L */ | ||
1465 | #define WM8994_DAC1L_TO_HPOUT1L_WIDTH 1 /* DAC1L_TO_HPOUT1L */ | ||
1466 | #define WM8994_MIXINR_TO_MIXOUTL 0x0080 /* MIXINR_TO_MIXOUTL */ | ||
1467 | #define WM8994_MIXINR_TO_MIXOUTL_MASK 0x0080 /* MIXINR_TO_MIXOUTL */ | ||
1468 | #define WM8994_MIXINR_TO_MIXOUTL_SHIFT 7 /* MIXINR_TO_MIXOUTL */ | ||
1469 | #define WM8994_MIXINR_TO_MIXOUTL_WIDTH 1 /* MIXINR_TO_MIXOUTL */ | ||
1470 | #define WM8994_MIXINL_TO_MIXOUTL 0x0040 /* MIXINL_TO_MIXOUTL */ | ||
1471 | #define WM8994_MIXINL_TO_MIXOUTL_MASK 0x0040 /* MIXINL_TO_MIXOUTL */ | ||
1472 | #define WM8994_MIXINL_TO_MIXOUTL_SHIFT 6 /* MIXINL_TO_MIXOUTL */ | ||
1473 | #define WM8994_MIXINL_TO_MIXOUTL_WIDTH 1 /* MIXINL_TO_MIXOUTL */ | ||
1474 | #define WM8994_IN2RN_TO_MIXOUTL 0x0020 /* IN2RN_TO_MIXOUTL */ | ||
1475 | #define WM8994_IN2RN_TO_MIXOUTL_MASK 0x0020 /* IN2RN_TO_MIXOUTL */ | ||
1476 | #define WM8994_IN2RN_TO_MIXOUTL_SHIFT 5 /* IN2RN_TO_MIXOUTL */ | ||
1477 | #define WM8994_IN2RN_TO_MIXOUTL_WIDTH 1 /* IN2RN_TO_MIXOUTL */ | ||
1478 | #define WM8994_IN2LN_TO_MIXOUTL 0x0010 /* IN2LN_TO_MIXOUTL */ | ||
1479 | #define WM8994_IN2LN_TO_MIXOUTL_MASK 0x0010 /* IN2LN_TO_MIXOUTL */ | ||
1480 | #define WM8994_IN2LN_TO_MIXOUTL_SHIFT 4 /* IN2LN_TO_MIXOUTL */ | ||
1481 | #define WM8994_IN2LN_TO_MIXOUTL_WIDTH 1 /* IN2LN_TO_MIXOUTL */ | ||
1482 | #define WM8994_IN1R_TO_MIXOUTL 0x0008 /* IN1R_TO_MIXOUTL */ | ||
1483 | #define WM8994_IN1R_TO_MIXOUTL_MASK 0x0008 /* IN1R_TO_MIXOUTL */ | ||
1484 | #define WM8994_IN1R_TO_MIXOUTL_SHIFT 3 /* IN1R_TO_MIXOUTL */ | ||
1485 | #define WM8994_IN1R_TO_MIXOUTL_WIDTH 1 /* IN1R_TO_MIXOUTL */ | ||
1486 | #define WM8994_IN1L_TO_MIXOUTL 0x0004 /* IN1L_TO_MIXOUTL */ | ||
1487 | #define WM8994_IN1L_TO_MIXOUTL_MASK 0x0004 /* IN1L_TO_MIXOUTL */ | ||
1488 | #define WM8994_IN1L_TO_MIXOUTL_SHIFT 2 /* IN1L_TO_MIXOUTL */ | ||
1489 | #define WM8994_IN1L_TO_MIXOUTL_WIDTH 1 /* IN1L_TO_MIXOUTL */ | ||
1490 | #define WM8994_IN2LP_TO_MIXOUTL 0x0002 /* IN2LP_TO_MIXOUTL */ | ||
1491 | #define WM8994_IN2LP_TO_MIXOUTL_MASK 0x0002 /* IN2LP_TO_MIXOUTL */ | ||
1492 | #define WM8994_IN2LP_TO_MIXOUTL_SHIFT 1 /* IN2LP_TO_MIXOUTL */ | ||
1493 | #define WM8994_IN2LP_TO_MIXOUTL_WIDTH 1 /* IN2LP_TO_MIXOUTL */ | ||
1494 | #define WM8994_DAC1L_TO_MIXOUTL 0x0001 /* DAC1L_TO_MIXOUTL */ | ||
1495 | #define WM8994_DAC1L_TO_MIXOUTL_MASK 0x0001 /* DAC1L_TO_MIXOUTL */ | ||
1496 | #define WM8994_DAC1L_TO_MIXOUTL_SHIFT 0 /* DAC1L_TO_MIXOUTL */ | ||
1497 | #define WM8994_DAC1L_TO_MIXOUTL_WIDTH 1 /* DAC1L_TO_MIXOUTL */ | ||
1498 | |||
1499 | /* | ||
1500 | * R46 (0x2E) - Output Mixer (2) | ||
1501 | */ | ||
1502 | #define WM8994_DAC1R_TO_HPOUT1R 0x0100 /* DAC1R_TO_HPOUT1R */ | ||
1503 | #define WM8994_DAC1R_TO_HPOUT1R_MASK 0x0100 /* DAC1R_TO_HPOUT1R */ | ||
1504 | #define WM8994_DAC1R_TO_HPOUT1R_SHIFT 8 /* DAC1R_TO_HPOUT1R */ | ||
1505 | #define WM8994_DAC1R_TO_HPOUT1R_WIDTH 1 /* DAC1R_TO_HPOUT1R */ | ||
1506 | #define WM8994_MIXINL_TO_MIXOUTR 0x0080 /* MIXINL_TO_MIXOUTR */ | ||
1507 | #define WM8994_MIXINL_TO_MIXOUTR_MASK 0x0080 /* MIXINL_TO_MIXOUTR */ | ||
1508 | #define WM8994_MIXINL_TO_MIXOUTR_SHIFT 7 /* MIXINL_TO_MIXOUTR */ | ||
1509 | #define WM8994_MIXINL_TO_MIXOUTR_WIDTH 1 /* MIXINL_TO_MIXOUTR */ | ||
1510 | #define WM8994_MIXINR_TO_MIXOUTR 0x0040 /* MIXINR_TO_MIXOUTR */ | ||
1511 | #define WM8994_MIXINR_TO_MIXOUTR_MASK 0x0040 /* MIXINR_TO_MIXOUTR */ | ||
1512 | #define WM8994_MIXINR_TO_MIXOUTR_SHIFT 6 /* MIXINR_TO_MIXOUTR */ | ||
1513 | #define WM8994_MIXINR_TO_MIXOUTR_WIDTH 1 /* MIXINR_TO_MIXOUTR */ | ||
1514 | #define WM8994_IN2LN_TO_MIXOUTR 0x0020 /* IN2LN_TO_MIXOUTR */ | ||
1515 | #define WM8994_IN2LN_TO_MIXOUTR_MASK 0x0020 /* IN2LN_TO_MIXOUTR */ | ||
1516 | #define WM8994_IN2LN_TO_MIXOUTR_SHIFT 5 /* IN2LN_TO_MIXOUTR */ | ||
1517 | #define WM8994_IN2LN_TO_MIXOUTR_WIDTH 1 /* IN2LN_TO_MIXOUTR */ | ||
1518 | #define WM8994_IN2RN_TO_MIXOUTR 0x0010 /* IN2RN_TO_MIXOUTR */ | ||
1519 | #define WM8994_IN2RN_TO_MIXOUTR_MASK 0x0010 /* IN2RN_TO_MIXOUTR */ | ||
1520 | #define WM8994_IN2RN_TO_MIXOUTR_SHIFT 4 /* IN2RN_TO_MIXOUTR */ | ||
1521 | #define WM8994_IN2RN_TO_MIXOUTR_WIDTH 1 /* IN2RN_TO_MIXOUTR */ | ||
1522 | #define WM8994_IN1L_TO_MIXOUTR 0x0008 /* IN1L_TO_MIXOUTR */ | ||
1523 | #define WM8994_IN1L_TO_MIXOUTR_MASK 0x0008 /* IN1L_TO_MIXOUTR */ | ||
1524 | #define WM8994_IN1L_TO_MIXOUTR_SHIFT 3 /* IN1L_TO_MIXOUTR */ | ||
1525 | #define WM8994_IN1L_TO_MIXOUTR_WIDTH 1 /* IN1L_TO_MIXOUTR */ | ||
1526 | #define WM8994_IN1R_TO_MIXOUTR 0x0004 /* IN1R_TO_MIXOUTR */ | ||
1527 | #define WM8994_IN1R_TO_MIXOUTR_MASK 0x0004 /* IN1R_TO_MIXOUTR */ | ||
1528 | #define WM8994_IN1R_TO_MIXOUTR_SHIFT 2 /* IN1R_TO_MIXOUTR */ | ||
1529 | #define WM8994_IN1R_TO_MIXOUTR_WIDTH 1 /* IN1R_TO_MIXOUTR */ | ||
1530 | #define WM8994_IN2RP_TO_MIXOUTR 0x0002 /* IN2RP_TO_MIXOUTR */ | ||
1531 | #define WM8994_IN2RP_TO_MIXOUTR_MASK 0x0002 /* IN2RP_TO_MIXOUTR */ | ||
1532 | #define WM8994_IN2RP_TO_MIXOUTR_SHIFT 1 /* IN2RP_TO_MIXOUTR */ | ||
1533 | #define WM8994_IN2RP_TO_MIXOUTR_WIDTH 1 /* IN2RP_TO_MIXOUTR */ | ||
1534 | #define WM8994_DAC1R_TO_MIXOUTR 0x0001 /* DAC1R_TO_MIXOUTR */ | ||
1535 | #define WM8994_DAC1R_TO_MIXOUTR_MASK 0x0001 /* DAC1R_TO_MIXOUTR */ | ||
1536 | #define WM8994_DAC1R_TO_MIXOUTR_SHIFT 0 /* DAC1R_TO_MIXOUTR */ | ||
1537 | #define WM8994_DAC1R_TO_MIXOUTR_WIDTH 1 /* DAC1R_TO_MIXOUTR */ | ||
1538 | |||
1539 | /* | ||
1540 | * R47 (0x2F) - Output Mixer (3) | ||
1541 | */ | ||
1542 | #define WM8994_IN2LP_MIXOUTL_VOL_MASK 0x0E00 /* IN2LP_MIXOUTL_VOL - [11:9] */ | ||
1543 | #define WM8994_IN2LP_MIXOUTL_VOL_SHIFT 9 /* IN2LP_MIXOUTL_VOL - [11:9] */ | ||
1544 | #define WM8994_IN2LP_MIXOUTL_VOL_WIDTH 3 /* IN2LP_MIXOUTL_VOL - [11:9] */ | ||
1545 | #define WM8994_IN2LN_MIXOUTL_VOL_MASK 0x01C0 /* IN2LN_MIXOUTL_VOL - [8:6] */ | ||
1546 | #define WM8994_IN2LN_MIXOUTL_VOL_SHIFT 6 /* IN2LN_MIXOUTL_VOL - [8:6] */ | ||
1547 | #define WM8994_IN2LN_MIXOUTL_VOL_WIDTH 3 /* IN2LN_MIXOUTL_VOL - [8:6] */ | ||
1548 | #define WM8994_IN1R_MIXOUTL_VOL_MASK 0x0038 /* IN1R_MIXOUTL_VOL - [5:3] */ | ||
1549 | #define WM8994_IN1R_MIXOUTL_VOL_SHIFT 3 /* IN1R_MIXOUTL_VOL - [5:3] */ | ||
1550 | #define WM8994_IN1R_MIXOUTL_VOL_WIDTH 3 /* IN1R_MIXOUTL_VOL - [5:3] */ | ||
1551 | #define WM8994_IN1L_MIXOUTL_VOL_MASK 0x0007 /* IN1L_MIXOUTL_VOL - [2:0] */ | ||
1552 | #define WM8994_IN1L_MIXOUTL_VOL_SHIFT 0 /* IN1L_MIXOUTL_VOL - [2:0] */ | ||
1553 | #define WM8994_IN1L_MIXOUTL_VOL_WIDTH 3 /* IN1L_MIXOUTL_VOL - [2:0] */ | ||
1554 | |||
1555 | /* | ||
1556 | * R48 (0x30) - Output Mixer (4) | ||
1557 | */ | ||
1558 | #define WM8994_IN2RP_MIXOUTR_VOL_MASK 0x0E00 /* IN2RP_MIXOUTR_VOL - [11:9] */ | ||
1559 | #define WM8994_IN2RP_MIXOUTR_VOL_SHIFT 9 /* IN2RP_MIXOUTR_VOL - [11:9] */ | ||
1560 | #define WM8994_IN2RP_MIXOUTR_VOL_WIDTH 3 /* IN2RP_MIXOUTR_VOL - [11:9] */ | ||
1561 | #define WM8994_IN2RN_MIXOUTR_VOL_MASK 0x01C0 /* IN2RN_MIXOUTR_VOL - [8:6] */ | ||
1562 | #define WM8994_IN2RN_MIXOUTR_VOL_SHIFT 6 /* IN2RN_MIXOUTR_VOL - [8:6] */ | ||
1563 | #define WM8994_IN2RN_MIXOUTR_VOL_WIDTH 3 /* IN2RN_MIXOUTR_VOL - [8:6] */ | ||
1564 | #define WM8994_IN1L_MIXOUTR_VOL_MASK 0x0038 /* IN1L_MIXOUTR_VOL - [5:3] */ | ||
1565 | #define WM8994_IN1L_MIXOUTR_VOL_SHIFT 3 /* IN1L_MIXOUTR_VOL - [5:3] */ | ||
1566 | #define WM8994_IN1L_MIXOUTR_VOL_WIDTH 3 /* IN1L_MIXOUTR_VOL - [5:3] */ | ||
1567 | #define WM8994_IN1R_MIXOUTR_VOL_MASK 0x0007 /* IN1R_MIXOUTR_VOL - [2:0] */ | ||
1568 | #define WM8994_IN1R_MIXOUTR_VOL_SHIFT 0 /* IN1R_MIXOUTR_VOL - [2:0] */ | ||
1569 | #define WM8994_IN1R_MIXOUTR_VOL_WIDTH 3 /* IN1R_MIXOUTR_VOL - [2:0] */ | ||
1570 | |||
1571 | /* | ||
1572 | * R49 (0x31) - Output Mixer (5) | ||
1573 | */ | ||
1574 | #define WM8994_DAC1L_MIXOUTL_VOL_MASK 0x0E00 /* DAC1L_MIXOUTL_VOL - [11:9] */ | ||
1575 | #define WM8994_DAC1L_MIXOUTL_VOL_SHIFT 9 /* DAC1L_MIXOUTL_VOL - [11:9] */ | ||
1576 | #define WM8994_DAC1L_MIXOUTL_VOL_WIDTH 3 /* DAC1L_MIXOUTL_VOL - [11:9] */ | ||
1577 | #define WM8994_IN2RN_MIXOUTL_VOL_MASK 0x01C0 /* IN2RN_MIXOUTL_VOL - [8:6] */ | ||
1578 | #define WM8994_IN2RN_MIXOUTL_VOL_SHIFT 6 /* IN2RN_MIXOUTL_VOL - [8:6] */ | ||
1579 | #define WM8994_IN2RN_MIXOUTL_VOL_WIDTH 3 /* IN2RN_MIXOUTL_VOL - [8:6] */ | ||
1580 | #define WM8994_MIXINR_MIXOUTL_VOL_MASK 0x0038 /* MIXINR_MIXOUTL_VOL - [5:3] */ | ||
1581 | #define WM8994_MIXINR_MIXOUTL_VOL_SHIFT 3 /* MIXINR_MIXOUTL_VOL - [5:3] */ | ||
1582 | #define WM8994_MIXINR_MIXOUTL_VOL_WIDTH 3 /* MIXINR_MIXOUTL_VOL - [5:3] */ | ||
1583 | #define WM8994_MIXINL_MIXOUTL_VOL_MASK 0x0007 /* MIXINL_MIXOUTL_VOL - [2:0] */ | ||
1584 | #define WM8994_MIXINL_MIXOUTL_VOL_SHIFT 0 /* MIXINL_MIXOUTL_VOL - [2:0] */ | ||
1585 | #define WM8994_MIXINL_MIXOUTL_VOL_WIDTH 3 /* MIXINL_MIXOUTL_VOL - [2:0] */ | ||
1586 | |||
1587 | /* | ||
1588 | * R50 (0x32) - Output Mixer (6) | ||
1589 | */ | ||
1590 | #define WM8994_DAC1R_MIXOUTR_VOL_MASK 0x0E00 /* DAC1R_MIXOUTR_VOL - [11:9] */ | ||
1591 | #define WM8994_DAC1R_MIXOUTR_VOL_SHIFT 9 /* DAC1R_MIXOUTR_VOL - [11:9] */ | ||
1592 | #define WM8994_DAC1R_MIXOUTR_VOL_WIDTH 3 /* DAC1R_MIXOUTR_VOL - [11:9] */ | ||
1593 | #define WM8994_IN2LN_MIXOUTR_VOL_MASK 0x01C0 /* IN2LN_MIXOUTR_VOL - [8:6] */ | ||
1594 | #define WM8994_IN2LN_MIXOUTR_VOL_SHIFT 6 /* IN2LN_MIXOUTR_VOL - [8:6] */ | ||
1595 | #define WM8994_IN2LN_MIXOUTR_VOL_WIDTH 3 /* IN2LN_MIXOUTR_VOL - [8:6] */ | ||
1596 | #define WM8994_MIXINL_MIXOUTR_VOL_MASK 0x0038 /* MIXINL_MIXOUTR_VOL - [5:3] */ | ||
1597 | #define WM8994_MIXINL_MIXOUTR_VOL_SHIFT 3 /* MIXINL_MIXOUTR_VOL - [5:3] */ | ||
1598 | #define WM8994_MIXINL_MIXOUTR_VOL_WIDTH 3 /* MIXINL_MIXOUTR_VOL - [5:3] */ | ||
1599 | #define WM8994_MIXINR_MIXOUTR_VOL_MASK 0x0007 /* MIXINR_MIXOUTR_VOL - [2:0] */ | ||
1600 | #define WM8994_MIXINR_MIXOUTR_VOL_SHIFT 0 /* MIXINR_MIXOUTR_VOL - [2:0] */ | ||
1601 | #define WM8994_MIXINR_MIXOUTR_VOL_WIDTH 3 /* MIXINR_MIXOUTR_VOL - [2:0] */ | ||
1602 | |||
1603 | /* | ||
1604 | * R51 (0x33) - HPOUT2 Mixer | ||
1605 | */ | ||
1606 | #define WM8994_IN2LRP_TO_HPOUT2 0x0020 /* IN2LRP_TO_HPOUT2 */ | ||
1607 | #define WM8994_IN2LRP_TO_HPOUT2_MASK 0x0020 /* IN2LRP_TO_HPOUT2 */ | ||
1608 | #define WM8994_IN2LRP_TO_HPOUT2_SHIFT 5 /* IN2LRP_TO_HPOUT2 */ | ||
1609 | #define WM8994_IN2LRP_TO_HPOUT2_WIDTH 1 /* IN2LRP_TO_HPOUT2 */ | ||
1610 | #define WM8994_MIXOUTLVOL_TO_HPOUT2 0x0010 /* MIXOUTLVOL_TO_HPOUT2 */ | ||
1611 | #define WM8994_MIXOUTLVOL_TO_HPOUT2_MASK 0x0010 /* MIXOUTLVOL_TO_HPOUT2 */ | ||
1612 | #define WM8994_MIXOUTLVOL_TO_HPOUT2_SHIFT 4 /* MIXOUTLVOL_TO_HPOUT2 */ | ||
1613 | #define WM8994_MIXOUTLVOL_TO_HPOUT2_WIDTH 1 /* MIXOUTLVOL_TO_HPOUT2 */ | ||
1614 | #define WM8994_MIXOUTRVOL_TO_HPOUT2 0x0008 /* MIXOUTRVOL_TO_HPOUT2 */ | ||
1615 | #define WM8994_MIXOUTRVOL_TO_HPOUT2_MASK 0x0008 /* MIXOUTRVOL_TO_HPOUT2 */ | ||
1616 | #define WM8994_MIXOUTRVOL_TO_HPOUT2_SHIFT 3 /* MIXOUTRVOL_TO_HPOUT2 */ | ||
1617 | #define WM8994_MIXOUTRVOL_TO_HPOUT2_WIDTH 1 /* MIXOUTRVOL_TO_HPOUT2 */ | ||
1618 | |||
1619 | /* | ||
1620 | * R52 (0x34) - Line Mixer (1) | ||
1621 | */ | ||
1622 | #define WM8994_MIXOUTL_TO_LINEOUT1N 0x0040 /* MIXOUTL_TO_LINEOUT1N */ | ||
1623 | #define WM8994_MIXOUTL_TO_LINEOUT1N_MASK 0x0040 /* MIXOUTL_TO_LINEOUT1N */ | ||
1624 | #define WM8994_MIXOUTL_TO_LINEOUT1N_SHIFT 6 /* MIXOUTL_TO_LINEOUT1N */ | ||
1625 | #define WM8994_MIXOUTL_TO_LINEOUT1N_WIDTH 1 /* MIXOUTL_TO_LINEOUT1N */ | ||
1626 | #define WM8994_MIXOUTR_TO_LINEOUT1N 0x0020 /* MIXOUTR_TO_LINEOUT1N */ | ||
1627 | #define WM8994_MIXOUTR_TO_LINEOUT1N_MASK 0x0020 /* MIXOUTR_TO_LINEOUT1N */ | ||
1628 | #define WM8994_MIXOUTR_TO_LINEOUT1N_SHIFT 5 /* MIXOUTR_TO_LINEOUT1N */ | ||
1629 | #define WM8994_MIXOUTR_TO_LINEOUT1N_WIDTH 1 /* MIXOUTR_TO_LINEOUT1N */ | ||
1630 | #define WM8994_LINEOUT1_MODE 0x0010 /* LINEOUT1_MODE */ | ||
1631 | #define WM8994_LINEOUT1_MODE_MASK 0x0010 /* LINEOUT1_MODE */ | ||
1632 | #define WM8994_LINEOUT1_MODE_SHIFT 4 /* LINEOUT1_MODE */ | ||
1633 | #define WM8994_LINEOUT1_MODE_WIDTH 1 /* LINEOUT1_MODE */ | ||
1634 | #define WM8994_IN1R_TO_LINEOUT1P 0x0004 /* IN1R_TO_LINEOUT1P */ | ||
1635 | #define WM8994_IN1R_TO_LINEOUT1P_MASK 0x0004 /* IN1R_TO_LINEOUT1P */ | ||
1636 | #define WM8994_IN1R_TO_LINEOUT1P_SHIFT 2 /* IN1R_TO_LINEOUT1P */ | ||
1637 | #define WM8994_IN1R_TO_LINEOUT1P_WIDTH 1 /* IN1R_TO_LINEOUT1P */ | ||
1638 | #define WM8994_IN1L_TO_LINEOUT1P 0x0002 /* IN1L_TO_LINEOUT1P */ | ||
1639 | #define WM8994_IN1L_TO_LINEOUT1P_MASK 0x0002 /* IN1L_TO_LINEOUT1P */ | ||
1640 | #define WM8994_IN1L_TO_LINEOUT1P_SHIFT 1 /* IN1L_TO_LINEOUT1P */ | ||
1641 | #define WM8994_IN1L_TO_LINEOUT1P_WIDTH 1 /* IN1L_TO_LINEOUT1P */ | ||
1642 | #define WM8994_MIXOUTL_TO_LINEOUT1P 0x0001 /* MIXOUTL_TO_LINEOUT1P */ | ||
1643 | #define WM8994_MIXOUTL_TO_LINEOUT1P_MASK 0x0001 /* MIXOUTL_TO_LINEOUT1P */ | ||
1644 | #define WM8994_MIXOUTL_TO_LINEOUT1P_SHIFT 0 /* MIXOUTL_TO_LINEOUT1P */ | ||
1645 | #define WM8994_MIXOUTL_TO_LINEOUT1P_WIDTH 1 /* MIXOUTL_TO_LINEOUT1P */ | ||
1646 | |||
1647 | /* | ||
1648 | * R53 (0x35) - Line Mixer (2) | ||
1649 | */ | ||
1650 | #define WM8994_MIXOUTR_TO_LINEOUT2N 0x0040 /* MIXOUTR_TO_LINEOUT2N */ | ||
1651 | #define WM8994_MIXOUTR_TO_LINEOUT2N_MASK 0x0040 /* MIXOUTR_TO_LINEOUT2N */ | ||
1652 | #define WM8994_MIXOUTR_TO_LINEOUT2N_SHIFT 6 /* MIXOUTR_TO_LINEOUT2N */ | ||
1653 | #define WM8994_MIXOUTR_TO_LINEOUT2N_WIDTH 1 /* MIXOUTR_TO_LINEOUT2N */ | ||
1654 | #define WM8994_MIXOUTL_TO_LINEOUT2N 0x0020 /* MIXOUTL_TO_LINEOUT2N */ | ||
1655 | #define WM8994_MIXOUTL_TO_LINEOUT2N_MASK 0x0020 /* MIXOUTL_TO_LINEOUT2N */ | ||
1656 | #define WM8994_MIXOUTL_TO_LINEOUT2N_SHIFT 5 /* MIXOUTL_TO_LINEOUT2N */ | ||
1657 | #define WM8994_MIXOUTL_TO_LINEOUT2N_WIDTH 1 /* MIXOUTL_TO_LINEOUT2N */ | ||
1658 | #define WM8994_LINEOUT2_MODE 0x0010 /* LINEOUT2_MODE */ | ||
1659 | #define WM8994_LINEOUT2_MODE_MASK 0x0010 /* LINEOUT2_MODE */ | ||
1660 | #define WM8994_LINEOUT2_MODE_SHIFT 4 /* LINEOUT2_MODE */ | ||
1661 | #define WM8994_LINEOUT2_MODE_WIDTH 1 /* LINEOUT2_MODE */ | ||
1662 | #define WM8994_IN1L_TO_LINEOUT2P 0x0004 /* IN1L_TO_LINEOUT2P */ | ||
1663 | #define WM8994_IN1L_TO_LINEOUT2P_MASK 0x0004 /* IN1L_TO_LINEOUT2P */ | ||
1664 | #define WM8994_IN1L_TO_LINEOUT2P_SHIFT 2 /* IN1L_TO_LINEOUT2P */ | ||
1665 | #define WM8994_IN1L_TO_LINEOUT2P_WIDTH 1 /* IN1L_TO_LINEOUT2P */ | ||
1666 | #define WM8994_IN1R_TO_LINEOUT2P 0x0002 /* IN1R_TO_LINEOUT2P */ | ||
1667 | #define WM8994_IN1R_TO_LINEOUT2P_MASK 0x0002 /* IN1R_TO_LINEOUT2P */ | ||
1668 | #define WM8994_IN1R_TO_LINEOUT2P_SHIFT 1 /* IN1R_TO_LINEOUT2P */ | ||
1669 | #define WM8994_IN1R_TO_LINEOUT2P_WIDTH 1 /* IN1R_TO_LINEOUT2P */ | ||
1670 | #define WM8994_MIXOUTR_TO_LINEOUT2P 0x0001 /* MIXOUTR_TO_LINEOUT2P */ | ||
1671 | #define WM8994_MIXOUTR_TO_LINEOUT2P_MASK 0x0001 /* MIXOUTR_TO_LINEOUT2P */ | ||
1672 | #define WM8994_MIXOUTR_TO_LINEOUT2P_SHIFT 0 /* MIXOUTR_TO_LINEOUT2P */ | ||
1673 | #define WM8994_MIXOUTR_TO_LINEOUT2P_WIDTH 1 /* MIXOUTR_TO_LINEOUT2P */ | ||
1674 | |||
1675 | /* | ||
1676 | * R54 (0x36) - Speaker Mixer | ||
1677 | */ | ||
1678 | #define WM8994_DAC2L_TO_SPKMIXL 0x0200 /* DAC2L_TO_SPKMIXL */ | ||
1679 | #define WM8994_DAC2L_TO_SPKMIXL_MASK 0x0200 /* DAC2L_TO_SPKMIXL */ | ||
1680 | #define WM8994_DAC2L_TO_SPKMIXL_SHIFT 9 /* DAC2L_TO_SPKMIXL */ | ||
1681 | #define WM8994_DAC2L_TO_SPKMIXL_WIDTH 1 /* DAC2L_TO_SPKMIXL */ | ||
1682 | #define WM8994_DAC2R_TO_SPKMIXR 0x0100 /* DAC2R_TO_SPKMIXR */ | ||
1683 | #define WM8994_DAC2R_TO_SPKMIXR_MASK 0x0100 /* DAC2R_TO_SPKMIXR */ | ||
1684 | #define WM8994_DAC2R_TO_SPKMIXR_SHIFT 8 /* DAC2R_TO_SPKMIXR */ | ||
1685 | #define WM8994_DAC2R_TO_SPKMIXR_WIDTH 1 /* DAC2R_TO_SPKMIXR */ | ||
1686 | #define WM8994_MIXINL_TO_SPKMIXL 0x0080 /* MIXINL_TO_SPKMIXL */ | ||
1687 | #define WM8994_MIXINL_TO_SPKMIXL_MASK 0x0080 /* MIXINL_TO_SPKMIXL */ | ||
1688 | #define WM8994_MIXINL_TO_SPKMIXL_SHIFT 7 /* MIXINL_TO_SPKMIXL */ | ||
1689 | #define WM8994_MIXINL_TO_SPKMIXL_WIDTH 1 /* MIXINL_TO_SPKMIXL */ | ||
1690 | #define WM8994_MIXINR_TO_SPKMIXR 0x0040 /* MIXINR_TO_SPKMIXR */ | ||
1691 | #define WM8994_MIXINR_TO_SPKMIXR_MASK 0x0040 /* MIXINR_TO_SPKMIXR */ | ||
1692 | #define WM8994_MIXINR_TO_SPKMIXR_SHIFT 6 /* MIXINR_TO_SPKMIXR */ | ||
1693 | #define WM8994_MIXINR_TO_SPKMIXR_WIDTH 1 /* MIXINR_TO_SPKMIXR */ | ||
1694 | #define WM8994_IN1LP_TO_SPKMIXL 0x0020 /* IN1LP_TO_SPKMIXL */ | ||
1695 | #define WM8994_IN1LP_TO_SPKMIXL_MASK 0x0020 /* IN1LP_TO_SPKMIXL */ | ||
1696 | #define WM8994_IN1LP_TO_SPKMIXL_SHIFT 5 /* IN1LP_TO_SPKMIXL */ | ||
1697 | #define WM8994_IN1LP_TO_SPKMIXL_WIDTH 1 /* IN1LP_TO_SPKMIXL */ | ||
1698 | #define WM8994_IN1RP_TO_SPKMIXR 0x0010 /* IN1RP_TO_SPKMIXR */ | ||
1699 | #define WM8994_IN1RP_TO_SPKMIXR_MASK 0x0010 /* IN1RP_TO_SPKMIXR */ | ||
1700 | #define WM8994_IN1RP_TO_SPKMIXR_SHIFT 4 /* IN1RP_TO_SPKMIXR */ | ||
1701 | #define WM8994_IN1RP_TO_SPKMIXR_WIDTH 1 /* IN1RP_TO_SPKMIXR */ | ||
1702 | #define WM8994_MIXOUTL_TO_SPKMIXL 0x0008 /* MIXOUTL_TO_SPKMIXL */ | ||
1703 | #define WM8994_MIXOUTL_TO_SPKMIXL_MASK 0x0008 /* MIXOUTL_TO_SPKMIXL */ | ||
1704 | #define WM8994_MIXOUTL_TO_SPKMIXL_SHIFT 3 /* MIXOUTL_TO_SPKMIXL */ | ||
1705 | #define WM8994_MIXOUTL_TO_SPKMIXL_WIDTH 1 /* MIXOUTL_TO_SPKMIXL */ | ||
1706 | #define WM8994_MIXOUTR_TO_SPKMIXR 0x0004 /* MIXOUTR_TO_SPKMIXR */ | ||
1707 | #define WM8994_MIXOUTR_TO_SPKMIXR_MASK 0x0004 /* MIXOUTR_TO_SPKMIXR */ | ||
1708 | #define WM8994_MIXOUTR_TO_SPKMIXR_SHIFT 2 /* MIXOUTR_TO_SPKMIXR */ | ||
1709 | #define WM8994_MIXOUTR_TO_SPKMIXR_WIDTH 1 /* MIXOUTR_TO_SPKMIXR */ | ||
1710 | #define WM8994_DAC1L_TO_SPKMIXL 0x0002 /* DAC1L_TO_SPKMIXL */ | ||
1711 | #define WM8994_DAC1L_TO_SPKMIXL_MASK 0x0002 /* DAC1L_TO_SPKMIXL */ | ||
1712 | #define WM8994_DAC1L_TO_SPKMIXL_SHIFT 1 /* DAC1L_TO_SPKMIXL */ | ||
1713 | #define WM8994_DAC1L_TO_SPKMIXL_WIDTH 1 /* DAC1L_TO_SPKMIXL */ | ||
1714 | #define WM8994_DAC1R_TO_SPKMIXR 0x0001 /* DAC1R_TO_SPKMIXR */ | ||
1715 | #define WM8994_DAC1R_TO_SPKMIXR_MASK 0x0001 /* DAC1R_TO_SPKMIXR */ | ||
1716 | #define WM8994_DAC1R_TO_SPKMIXR_SHIFT 0 /* DAC1R_TO_SPKMIXR */ | ||
1717 | #define WM8994_DAC1R_TO_SPKMIXR_WIDTH 1 /* DAC1R_TO_SPKMIXR */ | ||
1718 | |||
1719 | /* | ||
1720 | * R55 (0x37) - Additional Control | ||
1721 | */ | ||
1722 | #define WM8994_LINEOUT1_FB 0x0080 /* LINEOUT1_FB */ | ||
1723 | #define WM8994_LINEOUT1_FB_MASK 0x0080 /* LINEOUT1_FB */ | ||
1724 | #define WM8994_LINEOUT1_FB_SHIFT 7 /* LINEOUT1_FB */ | ||
1725 | #define WM8994_LINEOUT1_FB_WIDTH 1 /* LINEOUT1_FB */ | ||
1726 | #define WM8994_LINEOUT2_FB 0x0040 /* LINEOUT2_FB */ | ||
1727 | #define WM8994_LINEOUT2_FB_MASK 0x0040 /* LINEOUT2_FB */ | ||
1728 | #define WM8994_LINEOUT2_FB_SHIFT 6 /* LINEOUT2_FB */ | ||
1729 | #define WM8994_LINEOUT2_FB_WIDTH 1 /* LINEOUT2_FB */ | ||
1730 | #define WM8994_VROI 0x0001 /* VROI */ | ||
1731 | #define WM8994_VROI_MASK 0x0001 /* VROI */ | ||
1732 | #define WM8994_VROI_SHIFT 0 /* VROI */ | ||
1733 | #define WM8994_VROI_WIDTH 1 /* VROI */ | ||
1734 | |||
1735 | /* | ||
1736 | * R56 (0x38) - AntiPOP (1) | ||
1737 | */ | ||
1738 | #define WM8994_LINEOUT_VMID_BUF_ENA 0x0080 /* LINEOUT_VMID_BUF_ENA */ | ||
1739 | #define WM8994_LINEOUT_VMID_BUF_ENA_MASK 0x0080 /* LINEOUT_VMID_BUF_ENA */ | ||
1740 | #define WM8994_LINEOUT_VMID_BUF_ENA_SHIFT 7 /* LINEOUT_VMID_BUF_ENA */ | ||
1741 | #define WM8994_LINEOUT_VMID_BUF_ENA_WIDTH 1 /* LINEOUT_VMID_BUF_ENA */ | ||
1742 | #define WM8994_HPOUT2_IN_ENA 0x0040 /* HPOUT2_IN_ENA */ | ||
1743 | #define WM8994_HPOUT2_IN_ENA_MASK 0x0040 /* HPOUT2_IN_ENA */ | ||
1744 | #define WM8994_HPOUT2_IN_ENA_SHIFT 6 /* HPOUT2_IN_ENA */ | ||
1745 | #define WM8994_HPOUT2_IN_ENA_WIDTH 1 /* HPOUT2_IN_ENA */ | ||
1746 | #define WM8994_LINEOUT1_DISCH 0x0020 /* LINEOUT1_DISCH */ | ||
1747 | #define WM8994_LINEOUT1_DISCH_MASK 0x0020 /* LINEOUT1_DISCH */ | ||
1748 | #define WM8994_LINEOUT1_DISCH_SHIFT 5 /* LINEOUT1_DISCH */ | ||
1749 | #define WM8994_LINEOUT1_DISCH_WIDTH 1 /* LINEOUT1_DISCH */ | ||
1750 | #define WM8994_LINEOUT2_DISCH 0x0010 /* LINEOUT2_DISCH */ | ||
1751 | #define WM8994_LINEOUT2_DISCH_MASK 0x0010 /* LINEOUT2_DISCH */ | ||
1752 | #define WM8994_LINEOUT2_DISCH_SHIFT 4 /* LINEOUT2_DISCH */ | ||
1753 | #define WM8994_LINEOUT2_DISCH_WIDTH 1 /* LINEOUT2_DISCH */ | ||
1754 | |||
1755 | /* | ||
1756 | * R57 (0x39) - AntiPOP (2) | ||
1757 | */ | ||
1758 | #define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */ | ||
1759 | #define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */ | ||
1760 | #define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */ | ||
1761 | #define WM8994_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ | ||
1762 | #define WM8994_MICB1_DISCH 0x0080 /* MICB1_DISCH */ | ||
1763 | #define WM8994_MICB1_DISCH_MASK 0x0080 /* MICB1_DISCH */ | ||
1764 | #define WM8994_MICB1_DISCH_SHIFT 7 /* MICB1_DISCH */ | ||
1765 | #define WM8994_MICB1_DISCH_WIDTH 1 /* MICB1_DISCH */ | ||
1766 | #define WM8994_VMID_RAMP_MASK 0x0060 /* VMID_RAMP - [6:5] */ | ||
1767 | #define WM8994_VMID_RAMP_SHIFT 5 /* VMID_RAMP - [6:5] */ | ||
1768 | #define WM8994_VMID_RAMP_WIDTH 2 /* VMID_RAMP - [6:5] */ | ||
1769 | #define WM8994_VMID_BUF_ENA 0x0008 /* VMID_BUF_ENA */ | ||
1770 | #define WM8994_VMID_BUF_ENA_MASK 0x0008 /* VMID_BUF_ENA */ | ||
1771 | #define WM8994_VMID_BUF_ENA_SHIFT 3 /* VMID_BUF_ENA */ | ||
1772 | #define WM8994_VMID_BUF_ENA_WIDTH 1 /* VMID_BUF_ENA */ | ||
1773 | #define WM8994_STARTUP_BIAS_ENA 0x0004 /* STARTUP_BIAS_ENA */ | ||
1774 | #define WM8994_STARTUP_BIAS_ENA_MASK 0x0004 /* STARTUP_BIAS_ENA */ | ||
1775 | #define WM8994_STARTUP_BIAS_ENA_SHIFT 2 /* STARTUP_BIAS_ENA */ | ||
1776 | #define WM8994_STARTUP_BIAS_ENA_WIDTH 1 /* STARTUP_BIAS_ENA */ | ||
1777 | #define WM8994_BIAS_SRC 0x0002 /* BIAS_SRC */ | ||
1778 | #define WM8994_BIAS_SRC_MASK 0x0002 /* BIAS_SRC */ | ||
1779 | #define WM8994_BIAS_SRC_SHIFT 1 /* BIAS_SRC */ | ||
1780 | #define WM8994_BIAS_SRC_WIDTH 1 /* BIAS_SRC */ | ||
1781 | #define WM8994_VMID_DISCH 0x0001 /* VMID_DISCH */ | ||
1782 | #define WM8994_VMID_DISCH_MASK 0x0001 /* VMID_DISCH */ | ||
1783 | #define WM8994_VMID_DISCH_SHIFT 0 /* VMID_DISCH */ | ||
1784 | #define WM8994_VMID_DISCH_WIDTH 1 /* VMID_DISCH */ | ||
1785 | |||
1786 | /* | ||
1787 | * R58 (0x3A) - MICBIAS | ||
1788 | */ | ||
1789 | #define WM8994_MICD_SCTHR_MASK 0x00C0 /* MICD_SCTHR - [7:6] */ | ||
1790 | #define WM8994_MICD_SCTHR_SHIFT 6 /* MICD_SCTHR - [7:6] */ | ||
1791 | #define WM8994_MICD_SCTHR_WIDTH 2 /* MICD_SCTHR - [7:6] */ | ||
1792 | #define WM8994_MICD_THR_MASK 0x0038 /* MICD_THR - [5:3] */ | ||
1793 | #define WM8994_MICD_THR_SHIFT 3 /* MICD_THR - [5:3] */ | ||
1794 | #define WM8994_MICD_THR_WIDTH 3 /* MICD_THR - [5:3] */ | ||
1795 | #define WM8994_MICD_ENA 0x0004 /* MICD_ENA */ | ||
1796 | #define WM8994_MICD_ENA_MASK 0x0004 /* MICD_ENA */ | ||
1797 | #define WM8994_MICD_ENA_SHIFT 2 /* MICD_ENA */ | ||
1798 | #define WM8994_MICD_ENA_WIDTH 1 /* MICD_ENA */ | ||
1799 | #define WM8994_MICB2_LVL 0x0002 /* MICB2_LVL */ | ||
1800 | #define WM8994_MICB2_LVL_MASK 0x0002 /* MICB2_LVL */ | ||
1801 | #define WM8994_MICB2_LVL_SHIFT 1 /* MICB2_LVL */ | ||
1802 | #define WM8994_MICB2_LVL_WIDTH 1 /* MICB2_LVL */ | ||
1803 | #define WM8994_MICB1_LVL 0x0001 /* MICB1_LVL */ | ||
1804 | #define WM8994_MICB1_LVL_MASK 0x0001 /* MICB1_LVL */ | ||
1805 | #define WM8994_MICB1_LVL_SHIFT 0 /* MICB1_LVL */ | ||
1806 | #define WM8994_MICB1_LVL_WIDTH 1 /* MICB1_LVL */ | ||
1807 | |||
1808 | /* | ||
1809 | * R59 (0x3B) - LDO 1 | ||
1810 | */ | ||
1811 | #define WM8994_LDO1_VSEL_MASK 0x000E /* LDO1_VSEL - [3:1] */ | ||
1812 | #define WM8994_LDO1_VSEL_SHIFT 1 /* LDO1_VSEL - [3:1] */ | ||
1813 | #define WM8994_LDO1_VSEL_WIDTH 3 /* LDO1_VSEL - [3:1] */ | ||
1814 | #define WM8994_LDO1_DISCH 0x0001 /* LDO1_DISCH */ | ||
1815 | #define WM8994_LDO1_DISCH_MASK 0x0001 /* LDO1_DISCH */ | ||
1816 | #define WM8994_LDO1_DISCH_SHIFT 0 /* LDO1_DISCH */ | ||
1817 | #define WM8994_LDO1_DISCH_WIDTH 1 /* LDO1_DISCH */ | ||
1818 | |||
1819 | /* | ||
1820 | * R60 (0x3C) - LDO 2 | ||
1821 | */ | ||
1822 | #define WM8994_LDO2_VSEL_MASK 0x0006 /* LDO2_VSEL - [2:1] */ | ||
1823 | #define WM8994_LDO2_VSEL_SHIFT 1 /* LDO2_VSEL - [2:1] */ | ||
1824 | #define WM8994_LDO2_VSEL_WIDTH 2 /* LDO2_VSEL - [2:1] */ | ||
1825 | #define WM8994_LDO2_DISCH 0x0001 /* LDO2_DISCH */ | ||
1826 | #define WM8994_LDO2_DISCH_MASK 0x0001 /* LDO2_DISCH */ | ||
1827 | #define WM8994_LDO2_DISCH_SHIFT 0 /* LDO2_DISCH */ | ||
1828 | #define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */ | ||
1829 | |||
1830 | /* | ||
1831 | * R76 (0x4C) - Charge Pump (1) | ||
1832 | */ | ||
1833 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ | ||
1834 | #define WM8994_CP_ENA_MASK 0x8000 /* CP_ENA */ | ||
1835 | #define WM8994_CP_ENA_SHIFT 15 /* CP_ENA */ | ||
1836 | #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ | ||
1837 | |||
1838 | /* | ||
1839 | * R81 (0x51) - Class W (1) | ||
1840 | */ | ||
1841 | #define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ | ||
1842 | #define WM8994_CP_DYN_SRC_SEL_SHIFT 8 /* CP_DYN_SRC_SEL - [9:8] */ | ||
1843 | #define WM8994_CP_DYN_SRC_SEL_WIDTH 2 /* CP_DYN_SRC_SEL - [9:8] */ | ||
1844 | #define WM8994_CP_DYN_PWR 0x0001 /* CP_DYN_PWR */ | ||
1845 | #define WM8994_CP_DYN_PWR_MASK 0x0001 /* CP_DYN_PWR */ | ||
1846 | #define WM8994_CP_DYN_PWR_SHIFT 0 /* CP_DYN_PWR */ | ||
1847 | #define WM8994_CP_DYN_PWR_WIDTH 1 /* CP_DYN_PWR */ | ||
1848 | |||
1849 | /* | ||
1850 | * R84 (0x54) - DC Servo (1) | ||
1851 | */ | ||
1852 | #define WM8994_DCS_TRIG_SINGLE_1 0x2000 /* DCS_TRIG_SINGLE_1 */ | ||
1853 | #define WM8994_DCS_TRIG_SINGLE_1_MASK 0x2000 /* DCS_TRIG_SINGLE_1 */ | ||
1854 | #define WM8994_DCS_TRIG_SINGLE_1_SHIFT 13 /* DCS_TRIG_SINGLE_1 */ | ||
1855 | #define WM8994_DCS_TRIG_SINGLE_1_WIDTH 1 /* DCS_TRIG_SINGLE_1 */ | ||
1856 | #define WM8994_DCS_TRIG_SINGLE_0 0x1000 /* DCS_TRIG_SINGLE_0 */ | ||
1857 | #define WM8994_DCS_TRIG_SINGLE_0_MASK 0x1000 /* DCS_TRIG_SINGLE_0 */ | ||
1858 | #define WM8994_DCS_TRIG_SINGLE_0_SHIFT 12 /* DCS_TRIG_SINGLE_0 */ | ||
1859 | #define WM8994_DCS_TRIG_SINGLE_0_WIDTH 1 /* DCS_TRIG_SINGLE_0 */ | ||
1860 | #define WM8994_DCS_TRIG_SERIES_1 0x0200 /* DCS_TRIG_SERIES_1 */ | ||
1861 | #define WM8994_DCS_TRIG_SERIES_1_MASK 0x0200 /* DCS_TRIG_SERIES_1 */ | ||
1862 | #define WM8994_DCS_TRIG_SERIES_1_SHIFT 9 /* DCS_TRIG_SERIES_1 */ | ||
1863 | #define WM8994_DCS_TRIG_SERIES_1_WIDTH 1 /* DCS_TRIG_SERIES_1 */ | ||
1864 | #define WM8994_DCS_TRIG_SERIES_0 0x0100 /* DCS_TRIG_SERIES_0 */ | ||
1865 | #define WM8994_DCS_TRIG_SERIES_0_MASK 0x0100 /* DCS_TRIG_SERIES_0 */ | ||
1866 | #define WM8994_DCS_TRIG_SERIES_0_SHIFT 8 /* DCS_TRIG_SERIES_0 */ | ||
1867 | #define WM8994_DCS_TRIG_SERIES_0_WIDTH 1 /* DCS_TRIG_SERIES_0 */ | ||
1868 | #define WM8994_DCS_TRIG_STARTUP_1 0x0020 /* DCS_TRIG_STARTUP_1 */ | ||
1869 | #define WM8994_DCS_TRIG_STARTUP_1_MASK 0x0020 /* DCS_TRIG_STARTUP_1 */ | ||
1870 | #define WM8994_DCS_TRIG_STARTUP_1_SHIFT 5 /* DCS_TRIG_STARTUP_1 */ | ||
1871 | #define WM8994_DCS_TRIG_STARTUP_1_WIDTH 1 /* DCS_TRIG_STARTUP_1 */ | ||
1872 | #define WM8994_DCS_TRIG_STARTUP_0 0x0010 /* DCS_TRIG_STARTUP_0 */ | ||
1873 | #define WM8994_DCS_TRIG_STARTUP_0_MASK 0x0010 /* DCS_TRIG_STARTUP_0 */ | ||
1874 | #define WM8994_DCS_TRIG_STARTUP_0_SHIFT 4 /* DCS_TRIG_STARTUP_0 */ | ||
1875 | #define WM8994_DCS_TRIG_STARTUP_0_WIDTH 1 /* DCS_TRIG_STARTUP_0 */ | ||
1876 | #define WM8994_DCS_TRIG_DAC_WR_1 0x0008 /* DCS_TRIG_DAC_WR_1 */ | ||
1877 | #define WM8994_DCS_TRIG_DAC_WR_1_MASK 0x0008 /* DCS_TRIG_DAC_WR_1 */ | ||
1878 | #define WM8994_DCS_TRIG_DAC_WR_1_SHIFT 3 /* DCS_TRIG_DAC_WR_1 */ | ||
1879 | #define WM8994_DCS_TRIG_DAC_WR_1_WIDTH 1 /* DCS_TRIG_DAC_WR_1 */ | ||
1880 | #define WM8994_DCS_TRIG_DAC_WR_0 0x0004 /* DCS_TRIG_DAC_WR_0 */ | ||
1881 | #define WM8994_DCS_TRIG_DAC_WR_0_MASK 0x0004 /* DCS_TRIG_DAC_WR_0 */ | ||
1882 | #define WM8994_DCS_TRIG_DAC_WR_0_SHIFT 2 /* DCS_TRIG_DAC_WR_0 */ | ||
1883 | #define WM8994_DCS_TRIG_DAC_WR_0_WIDTH 1 /* DCS_TRIG_DAC_WR_0 */ | ||
1884 | #define WM8994_DCS_ENA_CHAN_1 0x0002 /* DCS_ENA_CHAN_1 */ | ||
1885 | #define WM8994_DCS_ENA_CHAN_1_MASK 0x0002 /* DCS_ENA_CHAN_1 */ | ||
1886 | #define WM8994_DCS_ENA_CHAN_1_SHIFT 1 /* DCS_ENA_CHAN_1 */ | ||
1887 | #define WM8994_DCS_ENA_CHAN_1_WIDTH 1 /* DCS_ENA_CHAN_1 */ | ||
1888 | #define WM8994_DCS_ENA_CHAN_0 0x0001 /* DCS_ENA_CHAN_0 */ | ||
1889 | #define WM8994_DCS_ENA_CHAN_0_MASK 0x0001 /* DCS_ENA_CHAN_0 */ | ||
1890 | #define WM8994_DCS_ENA_CHAN_0_SHIFT 0 /* DCS_ENA_CHAN_0 */ | ||
1891 | #define WM8994_DCS_ENA_CHAN_0_WIDTH 1 /* DCS_ENA_CHAN_0 */ | ||
1892 | |||
1893 | /* | ||
1894 | * R85 (0x55) - DC Servo (2) | ||
1895 | */ | ||
1896 | #define WM8994_DCS_SERIES_NO_01_MASK 0x0FE0 /* DCS_SERIES_NO_01 - [11:5] */ | ||
1897 | #define WM8994_DCS_SERIES_NO_01_SHIFT 5 /* DCS_SERIES_NO_01 - [11:5] */ | ||
1898 | #define WM8994_DCS_SERIES_NO_01_WIDTH 7 /* DCS_SERIES_NO_01 - [11:5] */ | ||
1899 | #define WM8994_DCS_TIMER_PERIOD_01_MASK 0x000F /* DCS_TIMER_PERIOD_01 - [3:0] */ | ||
1900 | #define WM8994_DCS_TIMER_PERIOD_01_SHIFT 0 /* DCS_TIMER_PERIOD_01 - [3:0] */ | ||
1901 | #define WM8994_DCS_TIMER_PERIOD_01_WIDTH 4 /* DCS_TIMER_PERIOD_01 - [3:0] */ | ||
1902 | |||
1903 | /* | ||
1904 | * R87 (0x57) - DC Servo (4) | ||
1905 | */ | ||
1906 | #define WM8994_DCS_DAC_WR_VAL_1_MASK 0xFF00 /* DCS_DAC_WR_VAL_1 - [15:8] */ | ||
1907 | #define WM8994_DCS_DAC_WR_VAL_1_SHIFT 8 /* DCS_DAC_WR_VAL_1 - [15:8] */ | ||
1908 | #define WM8994_DCS_DAC_WR_VAL_1_WIDTH 8 /* DCS_DAC_WR_VAL_1 - [15:8] */ | ||
1909 | #define WM8994_DCS_DAC_WR_VAL_0_MASK 0x00FF /* DCS_DAC_WR_VAL_0 - [7:0] */ | ||
1910 | #define WM8994_DCS_DAC_WR_VAL_0_SHIFT 0 /* DCS_DAC_WR_VAL_0 - [7:0] */ | ||
1911 | #define WM8994_DCS_DAC_WR_VAL_0_WIDTH 8 /* DCS_DAC_WR_VAL_0 - [7:0] */ | ||
1912 | |||
1913 | /* | ||
1914 | * R88 (0x58) - DC Servo Readback | ||
1915 | */ | ||
1916 | #define WM8994_DCS_CAL_COMPLETE_MASK 0x0300 /* DCS_CAL_COMPLETE - [9:8] */ | ||
1917 | #define WM8994_DCS_CAL_COMPLETE_SHIFT 8 /* DCS_CAL_COMPLETE - [9:8] */ | ||
1918 | #define WM8994_DCS_CAL_COMPLETE_WIDTH 2 /* DCS_CAL_COMPLETE - [9:8] */ | ||
1919 | #define WM8994_DCS_DAC_WR_COMPLETE_MASK 0x0030 /* DCS_DAC_WR_COMPLETE - [5:4] */ | ||
1920 | #define WM8994_DCS_DAC_WR_COMPLETE_SHIFT 4 /* DCS_DAC_WR_COMPLETE - [5:4] */ | ||
1921 | #define WM8994_DCS_DAC_WR_COMPLETE_WIDTH 2 /* DCS_DAC_WR_COMPLETE - [5:4] */ | ||
1922 | #define WM8994_DCS_STARTUP_COMPLETE_MASK 0x0003 /* DCS_STARTUP_COMPLETE - [1:0] */ | ||
1923 | #define WM8994_DCS_STARTUP_COMPLETE_SHIFT 0 /* DCS_STARTUP_COMPLETE - [1:0] */ | ||
1924 | #define WM8994_DCS_STARTUP_COMPLETE_WIDTH 2 /* DCS_STARTUP_COMPLETE - [1:0] */ | ||
1925 | |||
1926 | /* | ||
1927 | * R96 (0x60) - Analogue HP (1) | ||
1928 | */ | ||
1929 | #define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */ | ||
1930 | #define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */ | ||
1931 | #define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */ | ||
1932 | #define WM8994_HPOUT1L_RMV_SHORT_WIDTH 1 /* HPOUT1L_RMV_SHORT */ | ||
1933 | #define WM8994_HPOUT1L_OUTP 0x0040 /* HPOUT1L_OUTP */ | ||
1934 | #define WM8994_HPOUT1L_OUTP_MASK 0x0040 /* HPOUT1L_OUTP */ | ||
1935 | #define WM8994_HPOUT1L_OUTP_SHIFT 6 /* HPOUT1L_OUTP */ | ||
1936 | #define WM8994_HPOUT1L_OUTP_WIDTH 1 /* HPOUT1L_OUTP */ | ||
1937 | #define WM8994_HPOUT1L_DLY 0x0020 /* HPOUT1L_DLY */ | ||
1938 | #define WM8994_HPOUT1L_DLY_MASK 0x0020 /* HPOUT1L_DLY */ | ||
1939 | #define WM8994_HPOUT1L_DLY_SHIFT 5 /* HPOUT1L_DLY */ | ||
1940 | #define WM8994_HPOUT1L_DLY_WIDTH 1 /* HPOUT1L_DLY */ | ||
1941 | #define WM8994_HPOUT1R_RMV_SHORT 0x0008 /* HPOUT1R_RMV_SHORT */ | ||
1942 | #define WM8994_HPOUT1R_RMV_SHORT_MASK 0x0008 /* HPOUT1R_RMV_SHORT */ | ||
1943 | #define WM8994_HPOUT1R_RMV_SHORT_SHIFT 3 /* HPOUT1R_RMV_SHORT */ | ||
1944 | #define WM8994_HPOUT1R_RMV_SHORT_WIDTH 1 /* HPOUT1R_RMV_SHORT */ | ||
1945 | #define WM8994_HPOUT1R_OUTP 0x0004 /* HPOUT1R_OUTP */ | ||
1946 | #define WM8994_HPOUT1R_OUTP_MASK 0x0004 /* HPOUT1R_OUTP */ | ||
1947 | #define WM8994_HPOUT1R_OUTP_SHIFT 2 /* HPOUT1R_OUTP */ | ||
1948 | #define WM8994_HPOUT1R_OUTP_WIDTH 1 /* HPOUT1R_OUTP */ | ||
1949 | #define WM8994_HPOUT1R_DLY 0x0002 /* HPOUT1R_DLY */ | ||
1950 | #define WM8994_HPOUT1R_DLY_MASK 0x0002 /* HPOUT1R_DLY */ | ||
1951 | #define WM8994_HPOUT1R_DLY_SHIFT 1 /* HPOUT1R_DLY */ | ||
1952 | #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ | ||
1953 | |||
1954 | /* | ||
1955 | * R256 (0x100) - Chip Revision | ||
1956 | */ | ||
1957 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ | ||
1958 | #define WM8994_CHIP_REV_SHIFT 0 /* CHIP_REV - [3:0] */ | ||
1959 | #define WM8994_CHIP_REV_WIDTH 4 /* CHIP_REV - [3:0] */ | ||
1960 | |||
1961 | /* | ||
1962 | * R257 (0x101) - Control Interface | ||
1963 | */ | ||
1964 | #define WM8994_SPI_CONTRD 0x0040 /* SPI_CONTRD */ | ||
1965 | #define WM8994_SPI_CONTRD_MASK 0x0040 /* SPI_CONTRD */ | ||
1966 | #define WM8994_SPI_CONTRD_SHIFT 6 /* SPI_CONTRD */ | ||
1967 | #define WM8994_SPI_CONTRD_WIDTH 1 /* SPI_CONTRD */ | ||
1968 | #define WM8994_SPI_4WIRE 0x0020 /* SPI_4WIRE */ | ||
1969 | #define WM8994_SPI_4WIRE_MASK 0x0020 /* SPI_4WIRE */ | ||
1970 | #define WM8994_SPI_4WIRE_SHIFT 5 /* SPI_4WIRE */ | ||
1971 | #define WM8994_SPI_4WIRE_WIDTH 1 /* SPI_4WIRE */ | ||
1972 | #define WM8994_SPI_CFG 0x0010 /* SPI_CFG */ | ||
1973 | #define WM8994_SPI_CFG_MASK 0x0010 /* SPI_CFG */ | ||
1974 | #define WM8994_SPI_CFG_SHIFT 4 /* SPI_CFG */ | ||
1975 | #define WM8994_SPI_CFG_WIDTH 1 /* SPI_CFG */ | ||
1976 | #define WM8994_AUTO_INC 0x0004 /* AUTO_INC */ | ||
1977 | #define WM8994_AUTO_INC_MASK 0x0004 /* AUTO_INC */ | ||
1978 | #define WM8994_AUTO_INC_SHIFT 2 /* AUTO_INC */ | ||
1979 | #define WM8994_AUTO_INC_WIDTH 1 /* AUTO_INC */ | ||
1980 | |||
1981 | /* | ||
1982 | * R272 (0x110) - Write Sequencer Ctrl (1) | ||
1983 | */ | ||
1984 | #define WM8994_WSEQ_ENA 0x8000 /* WSEQ_ENA */ | ||
1985 | #define WM8994_WSEQ_ENA_MASK 0x8000 /* WSEQ_ENA */ | ||
1986 | #define WM8994_WSEQ_ENA_SHIFT 15 /* WSEQ_ENA */ | ||
1987 | #define WM8994_WSEQ_ENA_WIDTH 1 /* WSEQ_ENA */ | ||
1988 | #define WM8994_WSEQ_ABORT 0x0200 /* WSEQ_ABORT */ | ||
1989 | #define WM8994_WSEQ_ABORT_MASK 0x0200 /* WSEQ_ABORT */ | ||
1990 | #define WM8994_WSEQ_ABORT_SHIFT 9 /* WSEQ_ABORT */ | ||
1991 | #define WM8994_WSEQ_ABORT_WIDTH 1 /* WSEQ_ABORT */ | ||
1992 | #define WM8994_WSEQ_START 0x0100 /* WSEQ_START */ | ||
1993 | #define WM8994_WSEQ_START_MASK 0x0100 /* WSEQ_START */ | ||
1994 | #define WM8994_WSEQ_START_SHIFT 8 /* WSEQ_START */ | ||
1995 | #define WM8994_WSEQ_START_WIDTH 1 /* WSEQ_START */ | ||
1996 | #define WM8994_WSEQ_START_INDEX_MASK 0x007F /* WSEQ_START_INDEX - [6:0] */ | ||
1997 | #define WM8994_WSEQ_START_INDEX_SHIFT 0 /* WSEQ_START_INDEX - [6:0] */ | ||
1998 | #define WM8994_WSEQ_START_INDEX_WIDTH 7 /* WSEQ_START_INDEX - [6:0] */ | ||
1999 | |||
2000 | /* | ||
2001 | * R273 (0x111) - Write Sequencer Ctrl (2) | ||
2002 | */ | ||
2003 | #define WM8994_WSEQ_BUSY 0x0100 /* WSEQ_BUSY */ | ||
2004 | #define WM8994_WSEQ_BUSY_MASK 0x0100 /* WSEQ_BUSY */ | ||
2005 | #define WM8994_WSEQ_BUSY_SHIFT 8 /* WSEQ_BUSY */ | ||
2006 | #define WM8994_WSEQ_BUSY_WIDTH 1 /* WSEQ_BUSY */ | ||
2007 | #define WM8994_WSEQ_CURRENT_INDEX_MASK 0x007F /* WSEQ_CURRENT_INDEX - [6:0] */ | ||
2008 | #define WM8994_WSEQ_CURRENT_INDEX_SHIFT 0 /* WSEQ_CURRENT_INDEX - [6:0] */ | ||
2009 | #define WM8994_WSEQ_CURRENT_INDEX_WIDTH 7 /* WSEQ_CURRENT_INDEX - [6:0] */ | ||
2010 | |||
2011 | /* | ||
2012 | * R512 (0x200) - AIF1 Clocking (1) | ||
2013 | */ | ||
2014 | #define WM8994_AIF1CLK_SRC_MASK 0x0018 /* AIF1CLK_SRC - [4:3] */ | ||
2015 | #define WM8994_AIF1CLK_SRC_SHIFT 3 /* AIF1CLK_SRC - [4:3] */ | ||
2016 | #define WM8994_AIF1CLK_SRC_WIDTH 2 /* AIF1CLK_SRC - [4:3] */ | ||
2017 | #define WM8994_AIF1CLK_INV 0x0004 /* AIF1CLK_INV */ | ||
2018 | #define WM8994_AIF1CLK_INV_MASK 0x0004 /* AIF1CLK_INV */ | ||
2019 | #define WM8994_AIF1CLK_INV_SHIFT 2 /* AIF1CLK_INV */ | ||
2020 | #define WM8994_AIF1CLK_INV_WIDTH 1 /* AIF1CLK_INV */ | ||
2021 | #define WM8994_AIF1CLK_DIV 0x0002 /* AIF1CLK_DIV */ | ||
2022 | #define WM8994_AIF1CLK_DIV_MASK 0x0002 /* AIF1CLK_DIV */ | ||
2023 | #define WM8994_AIF1CLK_DIV_SHIFT 1 /* AIF1CLK_DIV */ | ||
2024 | #define WM8994_AIF1CLK_DIV_WIDTH 1 /* AIF1CLK_DIV */ | ||
2025 | #define WM8994_AIF1CLK_ENA 0x0001 /* AIF1CLK_ENA */ | ||
2026 | #define WM8994_AIF1CLK_ENA_MASK 0x0001 /* AIF1CLK_ENA */ | ||
2027 | #define WM8994_AIF1CLK_ENA_SHIFT 0 /* AIF1CLK_ENA */ | ||
2028 | #define WM8994_AIF1CLK_ENA_WIDTH 1 /* AIF1CLK_ENA */ | ||
2029 | |||
2030 | /* | ||
2031 | * R513 (0x201) - AIF1 Clocking (2) | ||
2032 | */ | ||
2033 | #define WM8994_AIF1DAC_DIV_MASK 0x0038 /* AIF1DAC_DIV - [5:3] */ | ||
2034 | #define WM8994_AIF1DAC_DIV_SHIFT 3 /* AIF1DAC_DIV - [5:3] */ | ||
2035 | #define WM8994_AIF1DAC_DIV_WIDTH 3 /* AIF1DAC_DIV - [5:3] */ | ||
2036 | #define WM8994_AIF1ADC_DIV_MASK 0x0007 /* AIF1ADC_DIV - [2:0] */ | ||
2037 | #define WM8994_AIF1ADC_DIV_SHIFT 0 /* AIF1ADC_DIV - [2:0] */ | ||
2038 | #define WM8994_AIF1ADC_DIV_WIDTH 3 /* AIF1ADC_DIV - [2:0] */ | ||
2039 | |||
2040 | /* | ||
2041 | * R516 (0x204) - AIF2 Clocking (1) | ||
2042 | */ | ||
2043 | #define WM8994_AIF2CLK_SRC_MASK 0x0018 /* AIF2CLK_SRC - [4:3] */ | ||
2044 | #define WM8994_AIF2CLK_SRC_SHIFT 3 /* AIF2CLK_SRC - [4:3] */ | ||
2045 | #define WM8994_AIF2CLK_SRC_WIDTH 2 /* AIF2CLK_SRC - [4:3] */ | ||
2046 | #define WM8994_AIF2CLK_INV 0x0004 /* AIF2CLK_INV */ | ||
2047 | #define WM8994_AIF2CLK_INV_MASK 0x0004 /* AIF2CLK_INV */ | ||
2048 | #define WM8994_AIF2CLK_INV_SHIFT 2 /* AIF2CLK_INV */ | ||
2049 | #define WM8994_AIF2CLK_INV_WIDTH 1 /* AIF2CLK_INV */ | ||
2050 | #define WM8994_AIF2CLK_DIV 0x0002 /* AIF2CLK_DIV */ | ||
2051 | #define WM8994_AIF2CLK_DIV_MASK 0x0002 /* AIF2CLK_DIV */ | ||
2052 | #define WM8994_AIF2CLK_DIV_SHIFT 1 /* AIF2CLK_DIV */ | ||
2053 | #define WM8994_AIF2CLK_DIV_WIDTH 1 /* AIF2CLK_DIV */ | ||
2054 | #define WM8994_AIF2CLK_ENA 0x0001 /* AIF2CLK_ENA */ | ||
2055 | #define WM8994_AIF2CLK_ENA_MASK 0x0001 /* AIF2CLK_ENA */ | ||
2056 | #define WM8994_AIF2CLK_ENA_SHIFT 0 /* AIF2CLK_ENA */ | ||
2057 | #define WM8994_AIF2CLK_ENA_WIDTH 1 /* AIF2CLK_ENA */ | ||
2058 | |||
2059 | /* | ||
2060 | * R517 (0x205) - AIF2 Clocking (2) | ||
2061 | */ | ||
2062 | #define WM8994_AIF2DAC_DIV_MASK 0x0038 /* AIF2DAC_DIV - [5:3] */ | ||
2063 | #define WM8994_AIF2DAC_DIV_SHIFT 3 /* AIF2DAC_DIV - [5:3] */ | ||
2064 | #define WM8994_AIF2DAC_DIV_WIDTH 3 /* AIF2DAC_DIV - [5:3] */ | ||
2065 | #define WM8994_AIF2ADC_DIV_MASK 0x0007 /* AIF2ADC_DIV - [2:0] */ | ||
2066 | #define WM8994_AIF2ADC_DIV_SHIFT 0 /* AIF2ADC_DIV - [2:0] */ | ||
2067 | #define WM8994_AIF2ADC_DIV_WIDTH 3 /* AIF2ADC_DIV - [2:0] */ | ||
2068 | |||
2069 | /* | ||
2070 | * R520 (0x208) - Clocking (1) | ||
2071 | */ | ||
2072 | #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ | ||
2073 | #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ | ||
2074 | #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ | ||
2075 | #define WM8994_TOCLK_ENA_WIDTH 1 /* TOCLK_ENA */ | ||
2076 | #define WM8994_AIF1DSPCLK_ENA 0x0008 /* AIF1DSPCLK_ENA */ | ||
2077 | #define WM8994_AIF1DSPCLK_ENA_MASK 0x0008 /* AIF1DSPCLK_ENA */ | ||
2078 | #define WM8994_AIF1DSPCLK_ENA_SHIFT 3 /* AIF1DSPCLK_ENA */ | ||
2079 | #define WM8994_AIF1DSPCLK_ENA_WIDTH 1 /* AIF1DSPCLK_ENA */ | ||
2080 | #define WM8994_AIF2DSPCLK_ENA 0x0004 /* AIF2DSPCLK_ENA */ | ||
2081 | #define WM8994_AIF2DSPCLK_ENA_MASK 0x0004 /* AIF2DSPCLK_ENA */ | ||
2082 | #define WM8994_AIF2DSPCLK_ENA_SHIFT 2 /* AIF2DSPCLK_ENA */ | ||
2083 | #define WM8994_AIF2DSPCLK_ENA_WIDTH 1 /* AIF2DSPCLK_ENA */ | ||
2084 | #define WM8994_SYSDSPCLK_ENA 0x0002 /* SYSDSPCLK_ENA */ | ||
2085 | #define WM8994_SYSDSPCLK_ENA_MASK 0x0002 /* SYSDSPCLK_ENA */ | ||
2086 | #define WM8994_SYSDSPCLK_ENA_SHIFT 1 /* SYSDSPCLK_ENA */ | ||
2087 | #define WM8994_SYSDSPCLK_ENA_WIDTH 1 /* SYSDSPCLK_ENA */ | ||
2088 | #define WM8994_SYSCLK_SRC 0x0001 /* SYSCLK_SRC */ | ||
2089 | #define WM8994_SYSCLK_SRC_MASK 0x0001 /* SYSCLK_SRC */ | ||
2090 | #define WM8994_SYSCLK_SRC_SHIFT 0 /* SYSCLK_SRC */ | ||
2091 | #define WM8994_SYSCLK_SRC_WIDTH 1 /* SYSCLK_SRC */ | ||
2092 | |||
2093 | /* | ||
2094 | * R521 (0x209) - Clocking (2) | ||
2095 | */ | ||
2096 | #define WM8994_TOCLK_DIV_MASK 0x0700 /* TOCLK_DIV - [10:8] */ | ||
2097 | #define WM8994_TOCLK_DIV_SHIFT 8 /* TOCLK_DIV - [10:8] */ | ||
2098 | #define WM8994_TOCLK_DIV_WIDTH 3 /* TOCLK_DIV - [10:8] */ | ||
2099 | #define WM8994_DBCLK_DIV_MASK 0x0070 /* DBCLK_DIV - [6:4] */ | ||
2100 | #define WM8994_DBCLK_DIV_SHIFT 4 /* DBCLK_DIV - [6:4] */ | ||
2101 | #define WM8994_DBCLK_DIV_WIDTH 3 /* DBCLK_DIV - [6:4] */ | ||
2102 | #define WM8994_OPCLK_DIV_MASK 0x0007 /* OPCLK_DIV - [2:0] */ | ||
2103 | #define WM8994_OPCLK_DIV_SHIFT 0 /* OPCLK_DIV - [2:0] */ | ||
2104 | #define WM8994_OPCLK_DIV_WIDTH 3 /* OPCLK_DIV - [2:0] */ | ||
2105 | |||
2106 | /* | ||
2107 | * R528 (0x210) - AIF1 Rate | ||
2108 | */ | ||
2109 | #define WM8994_AIF1_SR_MASK 0x00F0 /* AIF1_SR - [7:4] */ | ||
2110 | #define WM8994_AIF1_SR_SHIFT 4 /* AIF1_SR - [7:4] */ | ||
2111 | #define WM8994_AIF1_SR_WIDTH 4 /* AIF1_SR - [7:4] */ | ||
2112 | #define WM8994_AIF1CLK_RATE_MASK 0x000F /* AIF1CLK_RATE - [3:0] */ | ||
2113 | #define WM8994_AIF1CLK_RATE_SHIFT 0 /* AIF1CLK_RATE - [3:0] */ | ||
2114 | #define WM8994_AIF1CLK_RATE_WIDTH 4 /* AIF1CLK_RATE - [3:0] */ | ||
2115 | |||
2116 | /* | ||
2117 | * R529 (0x211) - AIF2 Rate | ||
2118 | */ | ||
2119 | #define WM8994_AIF2_SR_MASK 0x00F0 /* AIF2_SR - [7:4] */ | ||
2120 | #define WM8994_AIF2_SR_SHIFT 4 /* AIF2_SR - [7:4] */ | ||
2121 | #define WM8994_AIF2_SR_WIDTH 4 /* AIF2_SR - [7:4] */ | ||
2122 | #define WM8994_AIF2CLK_RATE_MASK 0x000F /* AIF2CLK_RATE - [3:0] */ | ||
2123 | #define WM8994_AIF2CLK_RATE_SHIFT 0 /* AIF2CLK_RATE - [3:0] */ | ||
2124 | #define WM8994_AIF2CLK_RATE_WIDTH 4 /* AIF2CLK_RATE - [3:0] */ | ||
2125 | |||
2126 | /* | ||
2127 | * R530 (0x212) - Rate Status | ||
2128 | */ | ||
2129 | #define WM8994_SR_ERROR_MASK 0x000F /* SR_ERROR - [3:0] */ | ||
2130 | #define WM8994_SR_ERROR_SHIFT 0 /* SR_ERROR - [3:0] */ | ||
2131 | #define WM8994_SR_ERROR_WIDTH 4 /* SR_ERROR - [3:0] */ | ||
2132 | |||
2133 | /* | ||
2134 | * R544 (0x220) - FLL1 Control (1) | ||
2135 | */ | ||
2136 | #define WM8994_FLL1_FRAC 0x0004 /* FLL1_FRAC */ | ||
2137 | #define WM8994_FLL1_FRAC_MASK 0x0004 /* FLL1_FRAC */ | ||
2138 | #define WM8994_FLL1_FRAC_SHIFT 2 /* FLL1_FRAC */ | ||
2139 | #define WM8994_FLL1_FRAC_WIDTH 1 /* FLL1_FRAC */ | ||
2140 | #define WM8994_FLL1_OSC_ENA 0x0002 /* FLL1_OSC_ENA */ | ||
2141 | #define WM8994_FLL1_OSC_ENA_MASK 0x0002 /* FLL1_OSC_ENA */ | ||
2142 | #define WM8994_FLL1_OSC_ENA_SHIFT 1 /* FLL1_OSC_ENA */ | ||
2143 | #define WM8994_FLL1_OSC_ENA_WIDTH 1 /* FLL1_OSC_ENA */ | ||
2144 | #define WM8994_FLL1_ENA 0x0001 /* FLL1_ENA */ | ||
2145 | #define WM8994_FLL1_ENA_MASK 0x0001 /* FLL1_ENA */ | ||
2146 | #define WM8994_FLL1_ENA_SHIFT 0 /* FLL1_ENA */ | ||
2147 | #define WM8994_FLL1_ENA_WIDTH 1 /* FLL1_ENA */ | ||
2148 | |||
2149 | /* | ||
2150 | * R545 (0x221) - FLL1 Control (2) | ||
2151 | */ | ||
2152 | #define WM8994_FLL1_OUTDIV_MASK 0x3F00 /* FLL1_OUTDIV - [13:8] */ | ||
2153 | #define WM8994_FLL1_OUTDIV_SHIFT 8 /* FLL1_OUTDIV - [13:8] */ | ||
2154 | #define WM8994_FLL1_OUTDIV_WIDTH 6 /* FLL1_OUTDIV - [13:8] */ | ||
2155 | #define WM8994_FLL1_CTRL_RATE_MASK 0x0070 /* FLL1_CTRL_RATE - [6:4] */ | ||
2156 | #define WM8994_FLL1_CTRL_RATE_SHIFT 4 /* FLL1_CTRL_RATE - [6:4] */ | ||
2157 | #define WM8994_FLL1_CTRL_RATE_WIDTH 3 /* FLL1_CTRL_RATE - [6:4] */ | ||
2158 | #define WM8994_FLL1_FRATIO_MASK 0x0007 /* FLL1_FRATIO - [2:0] */ | ||
2159 | #define WM8994_FLL1_FRATIO_SHIFT 0 /* FLL1_FRATIO - [2:0] */ | ||
2160 | #define WM8994_FLL1_FRATIO_WIDTH 3 /* FLL1_FRATIO - [2:0] */ | ||
2161 | |||
2162 | /* | ||
2163 | * R546 (0x222) - FLL1 Control (3) | ||
2164 | */ | ||
2165 | #define WM8994_FLL1_K_MASK 0xFFFF /* FLL1_K - [15:0] */ | ||
2166 | #define WM8994_FLL1_K_SHIFT 0 /* FLL1_K - [15:0] */ | ||
2167 | #define WM8994_FLL1_K_WIDTH 16 /* FLL1_K - [15:0] */ | ||
2168 | |||
2169 | /* | ||
2170 | * R547 (0x223) - FLL1 Control (4) | ||
2171 | */ | ||
2172 | #define WM8994_FLL1_N_MASK 0x7FE0 /* FLL1_N - [14:5] */ | ||
2173 | #define WM8994_FLL1_N_SHIFT 5 /* FLL1_N - [14:5] */ | ||
2174 | #define WM8994_FLL1_N_WIDTH 10 /* FLL1_N - [14:5] */ | ||
2175 | #define WM8994_FLL1_LOOP_GAIN_MASK 0x000F /* FLL1_LOOP_GAIN - [3:0] */ | ||
2176 | #define WM8994_FLL1_LOOP_GAIN_SHIFT 0 /* FLL1_LOOP_GAIN - [3:0] */ | ||
2177 | #define WM8994_FLL1_LOOP_GAIN_WIDTH 4 /* FLL1_LOOP_GAIN - [3:0] */ | ||
2178 | |||
2179 | /* | ||
2180 | * R548 (0x224) - FLL1 Control (5) | ||
2181 | */ | ||
2182 | #define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */ | ||
2183 | #define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */ | ||
2184 | #define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */ | ||
2185 | #define WM8994_FLL1_FRC_NCO 0x0040 /* FLL1_FRC_NCO */ | ||
2186 | #define WM8994_FLL1_FRC_NCO_MASK 0x0040 /* FLL1_FRC_NCO */ | ||
2187 | #define WM8994_FLL1_FRC_NCO_SHIFT 6 /* FLL1_FRC_NCO */ | ||
2188 | #define WM8994_FLL1_FRC_NCO_WIDTH 1 /* FLL1_FRC_NCO */ | ||
2189 | #define WM8994_FLL1_REFCLK_DIV_MASK 0x0018 /* FLL1_REFCLK_DIV - [4:3] */ | ||
2190 | #define WM8994_FLL1_REFCLK_DIV_SHIFT 3 /* FLL1_REFCLK_DIV - [4:3] */ | ||
2191 | #define WM8994_FLL1_REFCLK_DIV_WIDTH 2 /* FLL1_REFCLK_DIV - [4:3] */ | ||
2192 | #define WM8994_FLL1_REFCLK_SRC_MASK 0x0003 /* FLL1_REFCLK_SRC - [1:0] */ | ||
2193 | #define WM8994_FLL1_REFCLK_SRC_SHIFT 0 /* FLL1_REFCLK_SRC - [1:0] */ | ||
2194 | #define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */ | ||
2195 | |||
2196 | /* | ||
2197 | * R576 (0x240) - FLL2 Control (1) | ||
2198 | */ | ||
2199 | #define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */ | ||
2200 | #define WM8994_FLL2_FRAC_MASK 0x0004 /* FLL2_FRAC */ | ||
2201 | #define WM8994_FLL2_FRAC_SHIFT 2 /* FLL2_FRAC */ | ||
2202 | #define WM8994_FLL2_FRAC_WIDTH 1 /* FLL2_FRAC */ | ||
2203 | #define WM8994_FLL2_OSC_ENA 0x0002 /* FLL2_OSC_ENA */ | ||
2204 | #define WM8994_FLL2_OSC_ENA_MASK 0x0002 /* FLL2_OSC_ENA */ | ||
2205 | #define WM8994_FLL2_OSC_ENA_SHIFT 1 /* FLL2_OSC_ENA */ | ||
2206 | #define WM8994_FLL2_OSC_ENA_WIDTH 1 /* FLL2_OSC_ENA */ | ||
2207 | #define WM8994_FLL2_ENA 0x0001 /* FLL2_ENA */ | ||
2208 | #define WM8994_FLL2_ENA_MASK 0x0001 /* FLL2_ENA */ | ||
2209 | #define WM8994_FLL2_ENA_SHIFT 0 /* FLL2_ENA */ | ||
2210 | #define WM8994_FLL2_ENA_WIDTH 1 /* FLL2_ENA */ | ||
2211 | |||
2212 | /* | ||
2213 | * R577 (0x241) - FLL2 Control (2) | ||
2214 | */ | ||
2215 | #define WM8994_FLL2_OUTDIV_MASK 0x3F00 /* FLL2_OUTDIV - [13:8] */ | ||
2216 | #define WM8994_FLL2_OUTDIV_SHIFT 8 /* FLL2_OUTDIV - [13:8] */ | ||
2217 | #define WM8994_FLL2_OUTDIV_WIDTH 6 /* FLL2_OUTDIV - [13:8] */ | ||
2218 | #define WM8994_FLL2_CTRL_RATE_MASK 0x0070 /* FLL2_CTRL_RATE - [6:4] */ | ||
2219 | #define WM8994_FLL2_CTRL_RATE_SHIFT 4 /* FLL2_CTRL_RATE - [6:4] */ | ||
2220 | #define WM8994_FLL2_CTRL_RATE_WIDTH 3 /* FLL2_CTRL_RATE - [6:4] */ | ||
2221 | #define WM8994_FLL2_FRATIO_MASK 0x0007 /* FLL2_FRATIO - [2:0] */ | ||
2222 | #define WM8994_FLL2_FRATIO_SHIFT 0 /* FLL2_FRATIO - [2:0] */ | ||
2223 | #define WM8994_FLL2_FRATIO_WIDTH 3 /* FLL2_FRATIO - [2:0] */ | ||
2224 | |||
2225 | /* | ||
2226 | * R578 (0x242) - FLL2 Control (3) | ||
2227 | */ | ||
2228 | #define WM8994_FLL2_K_MASK 0xFFFF /* FLL2_K - [15:0] */ | ||
2229 | #define WM8994_FLL2_K_SHIFT 0 /* FLL2_K - [15:0] */ | ||
2230 | #define WM8994_FLL2_K_WIDTH 16 /* FLL2_K - [15:0] */ | ||
2231 | |||
2232 | /* | ||
2233 | * R579 (0x243) - FLL2 Control (4) | ||
2234 | */ | ||
2235 | #define WM8994_FLL2_N_MASK 0x7FE0 /* FLL2_N - [14:5] */ | ||
2236 | #define WM8994_FLL2_N_SHIFT 5 /* FLL2_N - [14:5] */ | ||
2237 | #define WM8994_FLL2_N_WIDTH 10 /* FLL2_N - [14:5] */ | ||
2238 | #define WM8994_FLL2_LOOP_GAIN_MASK 0x000F /* FLL2_LOOP_GAIN - [3:0] */ | ||
2239 | #define WM8994_FLL2_LOOP_GAIN_SHIFT 0 /* FLL2_LOOP_GAIN - [3:0] */ | ||
2240 | #define WM8994_FLL2_LOOP_GAIN_WIDTH 4 /* FLL2_LOOP_GAIN - [3:0] */ | ||
2241 | |||
2242 | /* | ||
2243 | * R580 (0x244) - FLL2 Control (5) | ||
2244 | */ | ||
2245 | #define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */ | ||
2246 | #define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */ | ||
2247 | #define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */ | ||
2248 | #define WM8994_FLL2_FRC_NCO 0x0040 /* FLL2_FRC_NCO */ | ||
2249 | #define WM8994_FLL2_FRC_NCO_MASK 0x0040 /* FLL2_FRC_NCO */ | ||
2250 | #define WM8994_FLL2_FRC_NCO_SHIFT 6 /* FLL2_FRC_NCO */ | ||
2251 | #define WM8994_FLL2_FRC_NCO_WIDTH 1 /* FLL2_FRC_NCO */ | ||
2252 | #define WM8994_FLL2_REFCLK_DIV_MASK 0x0018 /* FLL2_REFCLK_DIV - [4:3] */ | ||
2253 | #define WM8994_FLL2_REFCLK_DIV_SHIFT 3 /* FLL2_REFCLK_DIV - [4:3] */ | ||
2254 | #define WM8994_FLL2_REFCLK_DIV_WIDTH 2 /* FLL2_REFCLK_DIV - [4:3] */ | ||
2255 | #define WM8994_FLL2_REFCLK_SRC_MASK 0x0003 /* FLL2_REFCLK_SRC - [1:0] */ | ||
2256 | #define WM8994_FLL2_REFCLK_SRC_SHIFT 0 /* FLL2_REFCLK_SRC - [1:0] */ | ||
2257 | #define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */ | ||
2258 | |||
2259 | /* | ||
2260 | * R768 (0x300) - AIF1 Control (1) | ||
2261 | */ | ||
2262 | #define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */ | ||
2263 | #define WM8994_AIF1ADCL_SRC_MASK 0x8000 /* AIF1ADCL_SRC */ | ||
2264 | #define WM8994_AIF1ADCL_SRC_SHIFT 15 /* AIF1ADCL_SRC */ | ||
2265 | #define WM8994_AIF1ADCL_SRC_WIDTH 1 /* AIF1ADCL_SRC */ | ||
2266 | #define WM8994_AIF1ADCR_SRC 0x4000 /* AIF1ADCR_SRC */ | ||
2267 | #define WM8994_AIF1ADCR_SRC_MASK 0x4000 /* AIF1ADCR_SRC */ | ||
2268 | #define WM8994_AIF1ADCR_SRC_SHIFT 14 /* AIF1ADCR_SRC */ | ||
2269 | #define WM8994_AIF1ADCR_SRC_WIDTH 1 /* AIF1ADCR_SRC */ | ||
2270 | #define WM8994_AIF1ADC_TDM 0x2000 /* AIF1ADC_TDM */ | ||
2271 | #define WM8994_AIF1ADC_TDM_MASK 0x2000 /* AIF1ADC_TDM */ | ||
2272 | #define WM8994_AIF1ADC_TDM_SHIFT 13 /* AIF1ADC_TDM */ | ||
2273 | #define WM8994_AIF1ADC_TDM_WIDTH 1 /* AIF1ADC_TDM */ | ||
2274 | #define WM8994_AIF1_BCLK_INV 0x0100 /* AIF1_BCLK_INV */ | ||
2275 | #define WM8994_AIF1_BCLK_INV_MASK 0x0100 /* AIF1_BCLK_INV */ | ||
2276 | #define WM8994_AIF1_BCLK_INV_SHIFT 8 /* AIF1_BCLK_INV */ | ||
2277 | #define WM8994_AIF1_BCLK_INV_WIDTH 1 /* AIF1_BCLK_INV */ | ||
2278 | #define WM8994_AIF1_LRCLK_INV 0x0080 /* AIF1_LRCLK_INV */ | ||
2279 | #define WM8994_AIF1_LRCLK_INV_MASK 0x0080 /* AIF1_LRCLK_INV */ | ||
2280 | #define WM8994_AIF1_LRCLK_INV_SHIFT 7 /* AIF1_LRCLK_INV */ | ||
2281 | #define WM8994_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */ | ||
2282 | #define WM8994_AIF1_WL_MASK 0x0060 /* AIF1_WL - [6:5] */ | ||
2283 | #define WM8994_AIF1_WL_SHIFT 5 /* AIF1_WL - [6:5] */ | ||
2284 | #define WM8994_AIF1_WL_WIDTH 2 /* AIF1_WL - [6:5] */ | ||
2285 | #define WM8994_AIF1_FMT_MASK 0x0018 /* AIF1_FMT - [4:3] */ | ||
2286 | #define WM8994_AIF1_FMT_SHIFT 3 /* AIF1_FMT - [4:3] */ | ||
2287 | #define WM8994_AIF1_FMT_WIDTH 2 /* AIF1_FMT - [4:3] */ | ||
2288 | |||
2289 | /* | ||
2290 | * R769 (0x301) - AIF1 Control (2) | ||
2291 | */ | ||
2292 | #define WM8994_AIF1DACL_SRC 0x8000 /* AIF1DACL_SRC */ | ||
2293 | #define WM8994_AIF1DACL_SRC_MASK 0x8000 /* AIF1DACL_SRC */ | ||
2294 | #define WM8994_AIF1DACL_SRC_SHIFT 15 /* AIF1DACL_SRC */ | ||
2295 | #define WM8994_AIF1DACL_SRC_WIDTH 1 /* AIF1DACL_SRC */ | ||
2296 | #define WM8994_AIF1DACR_SRC 0x4000 /* AIF1DACR_SRC */ | ||
2297 | #define WM8994_AIF1DACR_SRC_MASK 0x4000 /* AIF1DACR_SRC */ | ||
2298 | #define WM8994_AIF1DACR_SRC_SHIFT 14 /* AIF1DACR_SRC */ | ||
2299 | #define WM8994_AIF1DACR_SRC_WIDTH 1 /* AIF1DACR_SRC */ | ||
2300 | #define WM8994_AIF1DAC_BOOST_MASK 0x0C00 /* AIF1DAC_BOOST - [11:10] */ | ||
2301 | #define WM8994_AIF1DAC_BOOST_SHIFT 10 /* AIF1DAC_BOOST - [11:10] */ | ||
2302 | #define WM8994_AIF1DAC_BOOST_WIDTH 2 /* AIF1DAC_BOOST - [11:10] */ | ||
2303 | #define WM8994_AIF1_MONO 0x0100 /* AIF1_MONO */ | ||
2304 | #define WM8994_AIF1_MONO_MASK 0x0100 /* AIF1_MONO */ | ||
2305 | #define WM8994_AIF1_MONO_SHIFT 8 /* AIF1_MONO */ | ||
2306 | #define WM8994_AIF1_MONO_WIDTH 1 /* AIF1_MONO */ | ||
2307 | #define WM8994_AIF1DAC_COMP 0x0010 /* AIF1DAC_COMP */ | ||
2308 | #define WM8994_AIF1DAC_COMP_MASK 0x0010 /* AIF1DAC_COMP */ | ||
2309 | #define WM8994_AIF1DAC_COMP_SHIFT 4 /* AIF1DAC_COMP */ | ||
2310 | #define WM8994_AIF1DAC_COMP_WIDTH 1 /* AIF1DAC_COMP */ | ||
2311 | #define WM8994_AIF1DAC_COMPMODE 0x0008 /* AIF1DAC_COMPMODE */ | ||
2312 | #define WM8994_AIF1DAC_COMPMODE_MASK 0x0008 /* AIF1DAC_COMPMODE */ | ||
2313 | #define WM8994_AIF1DAC_COMPMODE_SHIFT 3 /* AIF1DAC_COMPMODE */ | ||
2314 | #define WM8994_AIF1DAC_COMPMODE_WIDTH 1 /* AIF1DAC_COMPMODE */ | ||
2315 | #define WM8994_AIF1ADC_COMP 0x0004 /* AIF1ADC_COMP */ | ||
2316 | #define WM8994_AIF1ADC_COMP_MASK 0x0004 /* AIF1ADC_COMP */ | ||
2317 | #define WM8994_AIF1ADC_COMP_SHIFT 2 /* AIF1ADC_COMP */ | ||
2318 | #define WM8994_AIF1ADC_COMP_WIDTH 1 /* AIF1ADC_COMP */ | ||
2319 | #define WM8994_AIF1ADC_COMPMODE 0x0002 /* AIF1ADC_COMPMODE */ | ||
2320 | #define WM8994_AIF1ADC_COMPMODE_MASK 0x0002 /* AIF1ADC_COMPMODE */ | ||
2321 | #define WM8994_AIF1ADC_COMPMODE_SHIFT 1 /* AIF1ADC_COMPMODE */ | ||
2322 | #define WM8994_AIF1ADC_COMPMODE_WIDTH 1 /* AIF1ADC_COMPMODE */ | ||
2323 | #define WM8994_AIF1_LOOPBACK 0x0001 /* AIF1_LOOPBACK */ | ||
2324 | #define WM8994_AIF1_LOOPBACK_MASK 0x0001 /* AIF1_LOOPBACK */ | ||
2325 | #define WM8994_AIF1_LOOPBACK_SHIFT 0 /* AIF1_LOOPBACK */ | ||
2326 | #define WM8994_AIF1_LOOPBACK_WIDTH 1 /* AIF1_LOOPBACK */ | ||
2327 | |||
2328 | /* | ||
2329 | * R770 (0x302) - AIF1 Master/Slave | ||
2330 | */ | ||
2331 | #define WM8994_AIF1_TRI 0x8000 /* AIF1_TRI */ | ||
2332 | #define WM8994_AIF1_TRI_MASK 0x8000 /* AIF1_TRI */ | ||
2333 | #define WM8994_AIF1_TRI_SHIFT 15 /* AIF1_TRI */ | ||
2334 | #define WM8994_AIF1_TRI_WIDTH 1 /* AIF1_TRI */ | ||
2335 | #define WM8994_AIF1_MSTR 0x4000 /* AIF1_MSTR */ | ||
2336 | #define WM8994_AIF1_MSTR_MASK 0x4000 /* AIF1_MSTR */ | ||
2337 | #define WM8994_AIF1_MSTR_SHIFT 14 /* AIF1_MSTR */ | ||
2338 | #define WM8994_AIF1_MSTR_WIDTH 1 /* AIF1_MSTR */ | ||
2339 | #define WM8994_AIF1_CLK_FRC 0x2000 /* AIF1_CLK_FRC */ | ||
2340 | #define WM8994_AIF1_CLK_FRC_MASK 0x2000 /* AIF1_CLK_FRC */ | ||
2341 | #define WM8994_AIF1_CLK_FRC_SHIFT 13 /* AIF1_CLK_FRC */ | ||
2342 | #define WM8994_AIF1_CLK_FRC_WIDTH 1 /* AIF1_CLK_FRC */ | ||
2343 | #define WM8994_AIF1_LRCLK_FRC 0x1000 /* AIF1_LRCLK_FRC */ | ||
2344 | #define WM8994_AIF1_LRCLK_FRC_MASK 0x1000 /* AIF1_LRCLK_FRC */ | ||
2345 | #define WM8994_AIF1_LRCLK_FRC_SHIFT 12 /* AIF1_LRCLK_FRC */ | ||
2346 | #define WM8994_AIF1_LRCLK_FRC_WIDTH 1 /* AIF1_LRCLK_FRC */ | ||
2347 | |||
2348 | /* | ||
2349 | * R771 (0x303) - AIF1 BCLK | ||
2350 | */ | ||
2351 | #define WM8994_AIF1_BCLK_DIV_MASK 0x01F0 /* AIF1_BCLK_DIV - [8:4] */ | ||
2352 | #define WM8994_AIF1_BCLK_DIV_SHIFT 4 /* AIF1_BCLK_DIV - [8:4] */ | ||
2353 | #define WM8994_AIF1_BCLK_DIV_WIDTH 5 /* AIF1_BCLK_DIV - [8:4] */ | ||
2354 | |||
2355 | /* | ||
2356 | * R772 (0x304) - AIF1ADC LRCLK | ||
2357 | */ | ||
2358 | #define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */ | ||
2359 | #define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */ | ||
2360 | #define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */ | ||
2361 | #define WM8994_AIF1ADC_LRCLK_DIR_WIDTH 1 /* AIF1ADC_LRCLK_DIR */ | ||
2362 | #define WM8994_AIF1ADC_RATE_MASK 0x07FF /* AIF1ADC_RATE - [10:0] */ | ||
2363 | #define WM8994_AIF1ADC_RATE_SHIFT 0 /* AIF1ADC_RATE - [10:0] */ | ||
2364 | #define WM8994_AIF1ADC_RATE_WIDTH 11 /* AIF1ADC_RATE - [10:0] */ | ||
2365 | |||
2366 | /* | ||
2367 | * R773 (0x305) - AIF1DAC LRCLK | ||
2368 | */ | ||
2369 | #define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */ | ||
2370 | #define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */ | ||
2371 | #define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */ | ||
2372 | #define WM8994_AIF1DAC_LRCLK_DIR_WIDTH 1 /* AIF1DAC_LRCLK_DIR */ | ||
2373 | #define WM8994_AIF1DAC_RATE_MASK 0x07FF /* AIF1DAC_RATE - [10:0] */ | ||
2374 | #define WM8994_AIF1DAC_RATE_SHIFT 0 /* AIF1DAC_RATE - [10:0] */ | ||
2375 | #define WM8994_AIF1DAC_RATE_WIDTH 11 /* AIF1DAC_RATE - [10:0] */ | ||
2376 | |||
2377 | /* | ||
2378 | * R774 (0x306) - AIF1DAC Data | ||
2379 | */ | ||
2380 | #define WM8994_AIF1DACL_DAT_INV 0x0002 /* AIF1DACL_DAT_INV */ | ||
2381 | #define WM8994_AIF1DACL_DAT_INV_MASK 0x0002 /* AIF1DACL_DAT_INV */ | ||
2382 | #define WM8994_AIF1DACL_DAT_INV_SHIFT 1 /* AIF1DACL_DAT_INV */ | ||
2383 | #define WM8994_AIF1DACL_DAT_INV_WIDTH 1 /* AIF1DACL_DAT_INV */ | ||
2384 | #define WM8994_AIF1DACR_DAT_INV 0x0001 /* AIF1DACR_DAT_INV */ | ||
2385 | #define WM8994_AIF1DACR_DAT_INV_MASK 0x0001 /* AIF1DACR_DAT_INV */ | ||
2386 | #define WM8994_AIF1DACR_DAT_INV_SHIFT 0 /* AIF1DACR_DAT_INV */ | ||
2387 | #define WM8994_AIF1DACR_DAT_INV_WIDTH 1 /* AIF1DACR_DAT_INV */ | ||
2388 | |||
2389 | /* | ||
2390 | * R775 (0x307) - AIF1ADC Data | ||
2391 | */ | ||
2392 | #define WM8994_AIF1ADCL_DAT_INV 0x0002 /* AIF1ADCL_DAT_INV */ | ||
2393 | #define WM8994_AIF1ADCL_DAT_INV_MASK 0x0002 /* AIF1ADCL_DAT_INV */ | ||
2394 | #define WM8994_AIF1ADCL_DAT_INV_SHIFT 1 /* AIF1ADCL_DAT_INV */ | ||
2395 | #define WM8994_AIF1ADCL_DAT_INV_WIDTH 1 /* AIF1ADCL_DAT_INV */ | ||
2396 | #define WM8994_AIF1ADCR_DAT_INV 0x0001 /* AIF1ADCR_DAT_INV */ | ||
2397 | #define WM8994_AIF1ADCR_DAT_INV_MASK 0x0001 /* AIF1ADCR_DAT_INV */ | ||
2398 | #define WM8994_AIF1ADCR_DAT_INV_SHIFT 0 /* AIF1ADCR_DAT_INV */ | ||
2399 | #define WM8994_AIF1ADCR_DAT_INV_WIDTH 1 /* AIF1ADCR_DAT_INV */ | ||
2400 | |||
2401 | /* | ||
2402 | * R784 (0x310) - AIF2 Control (1) | ||
2403 | */ | ||
2404 | #define WM8994_AIF2ADCL_SRC 0x8000 /* AIF2ADCL_SRC */ | ||
2405 | #define WM8994_AIF2ADCL_SRC_MASK 0x8000 /* AIF2ADCL_SRC */ | ||
2406 | #define WM8994_AIF2ADCL_SRC_SHIFT 15 /* AIF2ADCL_SRC */ | ||
2407 | #define WM8994_AIF2ADCL_SRC_WIDTH 1 /* AIF2ADCL_SRC */ | ||
2408 | #define WM8994_AIF2ADCR_SRC 0x4000 /* AIF2ADCR_SRC */ | ||
2409 | #define WM8994_AIF2ADCR_SRC_MASK 0x4000 /* AIF2ADCR_SRC */ | ||
2410 | #define WM8994_AIF2ADCR_SRC_SHIFT 14 /* AIF2ADCR_SRC */ | ||
2411 | #define WM8994_AIF2ADCR_SRC_WIDTH 1 /* AIF2ADCR_SRC */ | ||
2412 | #define WM8994_AIF2ADC_TDM 0x2000 /* AIF2ADC_TDM */ | ||
2413 | #define WM8994_AIF2ADC_TDM_MASK 0x2000 /* AIF2ADC_TDM */ | ||
2414 | #define WM8994_AIF2ADC_TDM_SHIFT 13 /* AIF2ADC_TDM */ | ||
2415 | #define WM8994_AIF2ADC_TDM_WIDTH 1 /* AIF2ADC_TDM */ | ||
2416 | #define WM8994_AIF2ADC_TDM_CHAN 0x1000 /* AIF2ADC_TDM_CHAN */ | ||
2417 | #define WM8994_AIF2ADC_TDM_CHAN_MASK 0x1000 /* AIF2ADC_TDM_CHAN */ | ||
2418 | #define WM8994_AIF2ADC_TDM_CHAN_SHIFT 12 /* AIF2ADC_TDM_CHAN */ | ||
2419 | #define WM8994_AIF2ADC_TDM_CHAN_WIDTH 1 /* AIF2ADC_TDM_CHAN */ | ||
2420 | #define WM8994_AIF2_BCLK_INV 0x0100 /* AIF2_BCLK_INV */ | ||
2421 | #define WM8994_AIF2_BCLK_INV_MASK 0x0100 /* AIF2_BCLK_INV */ | ||
2422 | #define WM8994_AIF2_BCLK_INV_SHIFT 8 /* AIF2_BCLK_INV */ | ||
2423 | #define WM8994_AIF2_BCLK_INV_WIDTH 1 /* AIF2_BCLK_INV */ | ||
2424 | #define WM8994_AIF2_LRCLK_INV 0x0080 /* AIF2_LRCLK_INV */ | ||
2425 | #define WM8994_AIF2_LRCLK_INV_MASK 0x0080 /* AIF2_LRCLK_INV */ | ||
2426 | #define WM8994_AIF2_LRCLK_INV_SHIFT 7 /* AIF2_LRCLK_INV */ | ||
2427 | #define WM8994_AIF2_LRCLK_INV_WIDTH 1 /* AIF2_LRCLK_INV */ | ||
2428 | #define WM8994_AIF2_WL_MASK 0x0060 /* AIF2_WL - [6:5] */ | ||
2429 | #define WM8994_AIF2_WL_SHIFT 5 /* AIF2_WL - [6:5] */ | ||
2430 | #define WM8994_AIF2_WL_WIDTH 2 /* AIF2_WL - [6:5] */ | ||
2431 | #define WM8994_AIF2_FMT_MASK 0x0018 /* AIF2_FMT - [4:3] */ | ||
2432 | #define WM8994_AIF2_FMT_SHIFT 3 /* AIF2_FMT - [4:3] */ | ||
2433 | #define WM8994_AIF2_FMT_WIDTH 2 /* AIF2_FMT - [4:3] */ | ||
2434 | |||
2435 | /* | ||
2436 | * R785 (0x311) - AIF2 Control (2) | ||
2437 | */ | ||
2438 | #define WM8994_AIF2DACL_SRC 0x8000 /* AIF2DACL_SRC */ | ||
2439 | #define WM8994_AIF2DACL_SRC_MASK 0x8000 /* AIF2DACL_SRC */ | ||
2440 | #define WM8994_AIF2DACL_SRC_SHIFT 15 /* AIF2DACL_SRC */ | ||
2441 | #define WM8994_AIF2DACL_SRC_WIDTH 1 /* AIF2DACL_SRC */ | ||
2442 | #define WM8994_AIF2DACR_SRC 0x4000 /* AIF2DACR_SRC */ | ||
2443 | #define WM8994_AIF2DACR_SRC_MASK 0x4000 /* AIF2DACR_SRC */ | ||
2444 | #define WM8994_AIF2DACR_SRC_SHIFT 14 /* AIF2DACR_SRC */ | ||
2445 | #define WM8994_AIF2DACR_SRC_WIDTH 1 /* AIF2DACR_SRC */ | ||
2446 | #define WM8994_AIF2DAC_TDM 0x2000 /* AIF2DAC_TDM */ | ||
2447 | #define WM8994_AIF2DAC_TDM_MASK 0x2000 /* AIF2DAC_TDM */ | ||
2448 | #define WM8994_AIF2DAC_TDM_SHIFT 13 /* AIF2DAC_TDM */ | ||
2449 | #define WM8994_AIF2DAC_TDM_WIDTH 1 /* AIF2DAC_TDM */ | ||
2450 | #define WM8994_AIF2DAC_TDM_CHAN 0x1000 /* AIF2DAC_TDM_CHAN */ | ||
2451 | #define WM8994_AIF2DAC_TDM_CHAN_MASK 0x1000 /* AIF2DAC_TDM_CHAN */ | ||
2452 | #define WM8994_AIF2DAC_TDM_CHAN_SHIFT 12 /* AIF2DAC_TDM_CHAN */ | ||
2453 | #define WM8994_AIF2DAC_TDM_CHAN_WIDTH 1 /* AIF2DAC_TDM_CHAN */ | ||
2454 | #define WM8994_AIF2DAC_BOOST_MASK 0x0C00 /* AIF2DAC_BOOST - [11:10] */ | ||
2455 | #define WM8994_AIF2DAC_BOOST_SHIFT 10 /* AIF2DAC_BOOST - [11:10] */ | ||
2456 | #define WM8994_AIF2DAC_BOOST_WIDTH 2 /* AIF2DAC_BOOST - [11:10] */ | ||
2457 | #define WM8994_AIF2_MONO 0x0100 /* AIF2_MONO */ | ||
2458 | #define WM8994_AIF2_MONO_MASK 0x0100 /* AIF2_MONO */ | ||
2459 | #define WM8994_AIF2_MONO_SHIFT 8 /* AIF2_MONO */ | ||
2460 | #define WM8994_AIF2_MONO_WIDTH 1 /* AIF2_MONO */ | ||
2461 | #define WM8994_AIF2DAC_COMP 0x0010 /* AIF2DAC_COMP */ | ||
2462 | #define WM8994_AIF2DAC_COMP_MASK 0x0010 /* AIF2DAC_COMP */ | ||
2463 | #define WM8994_AIF2DAC_COMP_SHIFT 4 /* AIF2DAC_COMP */ | ||
2464 | #define WM8994_AIF2DAC_COMP_WIDTH 1 /* AIF2DAC_COMP */ | ||
2465 | #define WM8994_AIF2DAC_COMPMODE 0x0008 /* AIF2DAC_COMPMODE */ | ||
2466 | #define WM8994_AIF2DAC_COMPMODE_MASK 0x0008 /* AIF2DAC_COMPMODE */ | ||
2467 | #define WM8994_AIF2DAC_COMPMODE_SHIFT 3 /* AIF2DAC_COMPMODE */ | ||
2468 | #define WM8994_AIF2DAC_COMPMODE_WIDTH 1 /* AIF2DAC_COMPMODE */ | ||
2469 | #define WM8994_AIF2ADC_COMP 0x0004 /* AIF2ADC_COMP */ | ||
2470 | #define WM8994_AIF2ADC_COMP_MASK 0x0004 /* AIF2ADC_COMP */ | ||
2471 | #define WM8994_AIF2ADC_COMP_SHIFT 2 /* AIF2ADC_COMP */ | ||
2472 | #define WM8994_AIF2ADC_COMP_WIDTH 1 /* AIF2ADC_COMP */ | ||
2473 | #define WM8994_AIF2ADC_COMPMODE 0x0002 /* AIF2ADC_COMPMODE */ | ||
2474 | #define WM8994_AIF2ADC_COMPMODE_MASK 0x0002 /* AIF2ADC_COMPMODE */ | ||
2475 | #define WM8994_AIF2ADC_COMPMODE_SHIFT 1 /* AIF2ADC_COMPMODE */ | ||
2476 | #define WM8994_AIF2ADC_COMPMODE_WIDTH 1 /* AIF2ADC_COMPMODE */ | ||
2477 | #define WM8994_AIF2_LOOPBACK 0x0001 /* AIF2_LOOPBACK */ | ||
2478 | #define WM8994_AIF2_LOOPBACK_MASK 0x0001 /* AIF2_LOOPBACK */ | ||
2479 | #define WM8994_AIF2_LOOPBACK_SHIFT 0 /* AIF2_LOOPBACK */ | ||
2480 | #define WM8994_AIF2_LOOPBACK_WIDTH 1 /* AIF2_LOOPBACK */ | ||
2481 | |||
2482 | /* | ||
2483 | * R786 (0x312) - AIF2 Master/Slave | ||
2484 | */ | ||
2485 | #define WM8994_AIF2_TRI 0x8000 /* AIF2_TRI */ | ||
2486 | #define WM8994_AIF2_TRI_MASK 0x8000 /* AIF2_TRI */ | ||
2487 | #define WM8994_AIF2_TRI_SHIFT 15 /* AIF2_TRI */ | ||
2488 | #define WM8994_AIF2_TRI_WIDTH 1 /* AIF2_TRI */ | ||
2489 | #define WM8994_AIF2_MSTR 0x4000 /* AIF2_MSTR */ | ||
2490 | #define WM8994_AIF2_MSTR_MASK 0x4000 /* AIF2_MSTR */ | ||
2491 | #define WM8994_AIF2_MSTR_SHIFT 14 /* AIF2_MSTR */ | ||
2492 | #define WM8994_AIF2_MSTR_WIDTH 1 /* AIF2_MSTR */ | ||
2493 | #define WM8994_AIF2_CLK_FRC 0x2000 /* AIF2_CLK_FRC */ | ||
2494 | #define WM8994_AIF2_CLK_FRC_MASK 0x2000 /* AIF2_CLK_FRC */ | ||
2495 | #define WM8994_AIF2_CLK_FRC_SHIFT 13 /* AIF2_CLK_FRC */ | ||
2496 | #define WM8994_AIF2_CLK_FRC_WIDTH 1 /* AIF2_CLK_FRC */ | ||
2497 | #define WM8994_AIF2_LRCLK_FRC 0x1000 /* AIF2_LRCLK_FRC */ | ||
2498 | #define WM8994_AIF2_LRCLK_FRC_MASK 0x1000 /* AIF2_LRCLK_FRC */ | ||
2499 | #define WM8994_AIF2_LRCLK_FRC_SHIFT 12 /* AIF2_LRCLK_FRC */ | ||
2500 | #define WM8994_AIF2_LRCLK_FRC_WIDTH 1 /* AIF2_LRCLK_FRC */ | ||
2501 | |||
2502 | /* | ||
2503 | * R787 (0x313) - AIF2 BCLK | ||
2504 | */ | ||
2505 | #define WM8994_AIF2_BCLK_DIV_MASK 0x01F0 /* AIF2_BCLK_DIV - [8:4] */ | ||
2506 | #define WM8994_AIF2_BCLK_DIV_SHIFT 4 /* AIF2_BCLK_DIV - [8:4] */ | ||
2507 | #define WM8994_AIF2_BCLK_DIV_WIDTH 5 /* AIF2_BCLK_DIV - [8:4] */ | ||
2508 | |||
2509 | /* | ||
2510 | * R788 (0x314) - AIF2ADC LRCLK | ||
2511 | */ | ||
2512 | #define WM8994_AIF2ADC_LRCLK_DIR 0x0800 /* AIF2ADC_LRCLK_DIR */ | ||
2513 | #define WM8994_AIF2ADC_LRCLK_DIR_MASK 0x0800 /* AIF2ADC_LRCLK_DIR */ | ||
2514 | #define WM8994_AIF2ADC_LRCLK_DIR_SHIFT 11 /* AIF2ADC_LRCLK_DIR */ | ||
2515 | #define WM8994_AIF2ADC_LRCLK_DIR_WIDTH 1 /* AIF2ADC_LRCLK_DIR */ | ||
2516 | #define WM8994_AIF2ADC_RATE_MASK 0x07FF /* AIF2ADC_RATE - [10:0] */ | ||
2517 | #define WM8994_AIF2ADC_RATE_SHIFT 0 /* AIF2ADC_RATE - [10:0] */ | ||
2518 | #define WM8994_AIF2ADC_RATE_WIDTH 11 /* AIF2ADC_RATE - [10:0] */ | ||
2519 | |||
2520 | /* | ||
2521 | * R789 (0x315) - AIF2DAC LRCLK | ||
2522 | */ | ||
2523 | #define WM8994_AIF2DAC_LRCLK_DIR 0x0800 /* AIF2DAC_LRCLK_DIR */ | ||
2524 | #define WM8994_AIF2DAC_LRCLK_DIR_MASK 0x0800 /* AIF2DAC_LRCLK_DIR */ | ||
2525 | #define WM8994_AIF2DAC_LRCLK_DIR_SHIFT 11 /* AIF2DAC_LRCLK_DIR */ | ||
2526 | #define WM8994_AIF2DAC_LRCLK_DIR_WIDTH 1 /* AIF2DAC_LRCLK_DIR */ | ||
2527 | #define WM8994_AIF2DAC_RATE_MASK 0x07FF /* AIF2DAC_RATE - [10:0] */ | ||
2528 | #define WM8994_AIF2DAC_RATE_SHIFT 0 /* AIF2DAC_RATE - [10:0] */ | ||
2529 | #define WM8994_AIF2DAC_RATE_WIDTH 11 /* AIF2DAC_RATE - [10:0] */ | ||
2530 | |||
2531 | /* | ||
2532 | * R790 (0x316) - AIF2DAC Data | ||
2533 | */ | ||
2534 | #define WM8994_AIF2DACL_DAT_INV 0x0002 /* AIF2DACL_DAT_INV */ | ||
2535 | #define WM8994_AIF2DACL_DAT_INV_MASK 0x0002 /* AIF2DACL_DAT_INV */ | ||
2536 | #define WM8994_AIF2DACL_DAT_INV_SHIFT 1 /* AIF2DACL_DAT_INV */ | ||
2537 | #define WM8994_AIF2DACL_DAT_INV_WIDTH 1 /* AIF2DACL_DAT_INV */ | ||
2538 | #define WM8994_AIF2DACR_DAT_INV 0x0001 /* AIF2DACR_DAT_INV */ | ||
2539 | #define WM8994_AIF2DACR_DAT_INV_MASK 0x0001 /* AIF2DACR_DAT_INV */ | ||
2540 | #define WM8994_AIF2DACR_DAT_INV_SHIFT 0 /* AIF2DACR_DAT_INV */ | ||
2541 | #define WM8994_AIF2DACR_DAT_INV_WIDTH 1 /* AIF2DACR_DAT_INV */ | ||
2542 | |||
2543 | /* | ||
2544 | * R791 (0x317) - AIF2ADC Data | ||
2545 | */ | ||
2546 | #define WM8994_AIF2ADCL_DAT_INV 0x0002 /* AIF2ADCL_DAT_INV */ | ||
2547 | #define WM8994_AIF2ADCL_DAT_INV_MASK 0x0002 /* AIF2ADCL_DAT_INV */ | ||
2548 | #define WM8994_AIF2ADCL_DAT_INV_SHIFT 1 /* AIF2ADCL_DAT_INV */ | ||
2549 | #define WM8994_AIF2ADCL_DAT_INV_WIDTH 1 /* AIF2ADCL_DAT_INV */ | ||
2550 | #define WM8994_AIF2ADCR_DAT_INV 0x0001 /* AIF2ADCR_DAT_INV */ | ||
2551 | #define WM8994_AIF2ADCR_DAT_INV_MASK 0x0001 /* AIF2ADCR_DAT_INV */ | ||
2552 | #define WM8994_AIF2ADCR_DAT_INV_SHIFT 0 /* AIF2ADCR_DAT_INV */ | ||
2553 | #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ | ||
2554 | |||
2555 | /* | ||
2556 | * R1024 (0x400) - AIF1 ADC1 Left Volume | ||
2557 | */ | ||
2558 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ | ||
2559 | #define WM8994_AIF1ADC1_VU_MASK 0x0100 /* AIF1ADC1_VU */ | ||
2560 | #define WM8994_AIF1ADC1_VU_SHIFT 8 /* AIF1ADC1_VU */ | ||
2561 | #define WM8994_AIF1ADC1_VU_WIDTH 1 /* AIF1ADC1_VU */ | ||
2562 | #define WM8994_AIF1ADC1L_VOL_MASK 0x00FF /* AIF1ADC1L_VOL - [7:0] */ | ||
2563 | #define WM8994_AIF1ADC1L_VOL_SHIFT 0 /* AIF1ADC1L_VOL - [7:0] */ | ||
2564 | #define WM8994_AIF1ADC1L_VOL_WIDTH 8 /* AIF1ADC1L_VOL - [7:0] */ | ||
2565 | |||
2566 | /* | ||
2567 | * R1025 (0x401) - AIF1 ADC1 Right Volume | ||
2568 | */ | ||
2569 | #define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ | ||
2570 | #define WM8994_AIF1ADC1_VU_MASK 0x0100 /* AIF1ADC1_VU */ | ||
2571 | #define WM8994_AIF1ADC1_VU_SHIFT 8 /* AIF1ADC1_VU */ | ||
2572 | #define WM8994_AIF1ADC1_VU_WIDTH 1 /* AIF1ADC1_VU */ | ||
2573 | #define WM8994_AIF1ADC1R_VOL_MASK 0x00FF /* AIF1ADC1R_VOL - [7:0] */ | ||
2574 | #define WM8994_AIF1ADC1R_VOL_SHIFT 0 /* AIF1ADC1R_VOL - [7:0] */ | ||
2575 | #define WM8994_AIF1ADC1R_VOL_WIDTH 8 /* AIF1ADC1R_VOL - [7:0] */ | ||
2576 | |||
2577 | /* | ||
2578 | * R1026 (0x402) - AIF1 DAC1 Left Volume | ||
2579 | */ | ||
2580 | #define WM8994_AIF1DAC1_VU 0x0100 /* AIF1DAC1_VU */ | ||
2581 | #define WM8994_AIF1DAC1_VU_MASK 0x0100 /* AIF1DAC1_VU */ | ||
2582 | #define WM8994_AIF1DAC1_VU_SHIFT 8 /* AIF1DAC1_VU */ | ||
2583 | #define WM8994_AIF1DAC1_VU_WIDTH 1 /* AIF1DAC1_VU */ | ||
2584 | #define WM8994_AIF1DAC1L_VOL_MASK 0x00FF /* AIF1DAC1L_VOL - [7:0] */ | ||
2585 | #define WM8994_AIF1DAC1L_VOL_SHIFT 0 /* AIF1DAC1L_VOL - [7:0] */ | ||
2586 | #define WM8994_AIF1DAC1L_VOL_WIDTH 8 /* AIF1DAC1L_VOL - [7:0] */ | ||
2587 | |||
2588 | /* | ||
2589 | * R1027 (0x403) - AIF1 DAC1 Right Volume | ||
2590 | */ | ||
2591 | #define WM8994_AIF1DAC1_VU 0x0100 /* AIF1DAC1_VU */ | ||
2592 | #define WM8994_AIF1DAC1_VU_MASK 0x0100 /* AIF1DAC1_VU */ | ||
2593 | #define WM8994_AIF1DAC1_VU_SHIFT 8 /* AIF1DAC1_VU */ | ||
2594 | #define WM8994_AIF1DAC1_VU_WIDTH 1 /* AIF1DAC1_VU */ | ||
2595 | #define WM8994_AIF1DAC1R_VOL_MASK 0x00FF /* AIF1DAC1R_VOL - [7:0] */ | ||
2596 | #define WM8994_AIF1DAC1R_VOL_SHIFT 0 /* AIF1DAC1R_VOL - [7:0] */ | ||
2597 | #define WM8994_AIF1DAC1R_VOL_WIDTH 8 /* AIF1DAC1R_VOL - [7:0] */ | ||
2598 | |||
2599 | /* | ||
2600 | * R1028 (0x404) - AIF1 ADC2 Left Volume | ||
2601 | */ | ||
2602 | #define WM8994_AIF1ADC2_VU 0x0100 /* AIF1ADC2_VU */ | ||
2603 | #define WM8994_AIF1ADC2_VU_MASK 0x0100 /* AIF1ADC2_VU */ | ||
2604 | #define WM8994_AIF1ADC2_VU_SHIFT 8 /* AIF1ADC2_VU */ | ||
2605 | #define WM8994_AIF1ADC2_VU_WIDTH 1 /* AIF1ADC2_VU */ | ||
2606 | #define WM8994_AIF1ADC2L_VOL_MASK 0x00FF /* AIF1ADC2L_VOL - [7:0] */ | ||
2607 | #define WM8994_AIF1ADC2L_VOL_SHIFT 0 /* AIF1ADC2L_VOL - [7:0] */ | ||
2608 | #define WM8994_AIF1ADC2L_VOL_WIDTH 8 /* AIF1ADC2L_VOL - [7:0] */ | ||
2609 | |||
2610 | /* | ||
2611 | * R1029 (0x405) - AIF1 ADC2 Right Volume | ||
2612 | */ | ||
2613 | #define WM8994_AIF1ADC2_VU 0x0100 /* AIF1ADC2_VU */ | ||
2614 | #define WM8994_AIF1ADC2_VU_MASK 0x0100 /* AIF1ADC2_VU */ | ||
2615 | #define WM8994_AIF1ADC2_VU_SHIFT 8 /* AIF1ADC2_VU */ | ||
2616 | #define WM8994_AIF1ADC2_VU_WIDTH 1 /* AIF1ADC2_VU */ | ||
2617 | #define WM8994_AIF1ADC2R_VOL_MASK 0x00FF /* AIF1ADC2R_VOL - [7:0] */ | ||
2618 | #define WM8994_AIF1ADC2R_VOL_SHIFT 0 /* AIF1ADC2R_VOL - [7:0] */ | ||
2619 | #define WM8994_AIF1ADC2R_VOL_WIDTH 8 /* AIF1ADC2R_VOL - [7:0] */ | ||
2620 | |||
2621 | /* | ||
2622 | * R1030 (0x406) - AIF1 DAC2 Left Volume | ||
2623 | */ | ||
2624 | #define WM8994_AIF1DAC2_VU 0x0100 /* AIF1DAC2_VU */ | ||
2625 | #define WM8994_AIF1DAC2_VU_MASK 0x0100 /* AIF1DAC2_VU */ | ||
2626 | #define WM8994_AIF1DAC2_VU_SHIFT 8 /* AIF1DAC2_VU */ | ||
2627 | #define WM8994_AIF1DAC2_VU_WIDTH 1 /* AIF1DAC2_VU */ | ||
2628 | #define WM8994_AIF1DAC2L_VOL_MASK 0x00FF /* AIF1DAC2L_VOL - [7:0] */ | ||
2629 | #define WM8994_AIF1DAC2L_VOL_SHIFT 0 /* AIF1DAC2L_VOL - [7:0] */ | ||
2630 | #define WM8994_AIF1DAC2L_VOL_WIDTH 8 /* AIF1DAC2L_VOL - [7:0] */ | ||
2631 | |||
2632 | /* | ||
2633 | * R1031 (0x407) - AIF1 DAC2 Right Volume | ||
2634 | */ | ||
2635 | #define WM8994_AIF1DAC2_VU 0x0100 /* AIF1DAC2_VU */ | ||
2636 | #define WM8994_AIF1DAC2_VU_MASK 0x0100 /* AIF1DAC2_VU */ | ||
2637 | #define WM8994_AIF1DAC2_VU_SHIFT 8 /* AIF1DAC2_VU */ | ||
2638 | #define WM8994_AIF1DAC2_VU_WIDTH 1 /* AIF1DAC2_VU */ | ||
2639 | #define WM8994_AIF1DAC2R_VOL_MASK 0x00FF /* AIF1DAC2R_VOL - [7:0] */ | ||
2640 | #define WM8994_AIF1DAC2R_VOL_SHIFT 0 /* AIF1DAC2R_VOL - [7:0] */ | ||
2641 | #define WM8994_AIF1DAC2R_VOL_WIDTH 8 /* AIF1DAC2R_VOL - [7:0] */ | ||
2642 | |||
2643 | /* | ||
2644 | * R1040 (0x410) - AIF1 ADC1 Filters | ||
2645 | */ | ||
2646 | #define WM8994_AIF1ADC_4FS 0x8000 /* AIF1ADC_4FS */ | ||
2647 | #define WM8994_AIF1ADC_4FS_MASK 0x8000 /* AIF1ADC_4FS */ | ||
2648 | #define WM8994_AIF1ADC_4FS_SHIFT 15 /* AIF1ADC_4FS */ | ||
2649 | #define WM8994_AIF1ADC_4FS_WIDTH 1 /* AIF1ADC_4FS */ | ||
2650 | #define WM8994_AIF1ADC1_HPF_CUT_MASK 0x6000 /* AIF1ADC1_HPF_CUT - [14:13] */ | ||
2651 | #define WM8994_AIF1ADC1_HPF_CUT_SHIFT 13 /* AIF1ADC1_HPF_CUT - [14:13] */ | ||
2652 | #define WM8994_AIF1ADC1_HPF_CUT_WIDTH 2 /* AIF1ADC1_HPF_CUT - [14:13] */ | ||
2653 | #define WM8994_AIF1ADC1L_HPF 0x1000 /* AIF1ADC1L_HPF */ | ||
2654 | #define WM8994_AIF1ADC1L_HPF_MASK 0x1000 /* AIF1ADC1L_HPF */ | ||
2655 | #define WM8994_AIF1ADC1L_HPF_SHIFT 12 /* AIF1ADC1L_HPF */ | ||
2656 | #define WM8994_AIF1ADC1L_HPF_WIDTH 1 /* AIF1ADC1L_HPF */ | ||
2657 | #define WM8994_AIF1ADC1R_HPF 0x0800 /* AIF1ADC1R_HPF */ | ||
2658 | #define WM8994_AIF1ADC1R_HPF_MASK 0x0800 /* AIF1ADC1R_HPF */ | ||
2659 | #define WM8994_AIF1ADC1R_HPF_SHIFT 11 /* AIF1ADC1R_HPF */ | ||
2660 | #define WM8994_AIF1ADC1R_HPF_WIDTH 1 /* AIF1ADC1R_HPF */ | ||
2661 | |||
2662 | /* | ||
2663 | * R1041 (0x411) - AIF1 ADC2 Filters | ||
2664 | */ | ||
2665 | #define WM8994_AIF1ADC2_HPF_CUT_MASK 0x6000 /* AIF1ADC2_HPF_CUT - [14:13] */ | ||
2666 | #define WM8994_AIF1ADC2_HPF_CUT_SHIFT 13 /* AIF1ADC2_HPF_CUT - [14:13] */ | ||
2667 | #define WM8994_AIF1ADC2_HPF_CUT_WIDTH 2 /* AIF1ADC2_HPF_CUT - [14:13] */ | ||
2668 | #define WM8994_AIF1ADC2L_HPF 0x1000 /* AIF1ADC2L_HPF */ | ||
2669 | #define WM8994_AIF1ADC2L_HPF_MASK 0x1000 /* AIF1ADC2L_HPF */ | ||
2670 | #define WM8994_AIF1ADC2L_HPF_SHIFT 12 /* AIF1ADC2L_HPF */ | ||
2671 | #define WM8994_AIF1ADC2L_HPF_WIDTH 1 /* AIF1ADC2L_HPF */ | ||
2672 | #define WM8994_AIF1ADC2R_HPF 0x0800 /* AIF1ADC2R_HPF */ | ||
2673 | #define WM8994_AIF1ADC2R_HPF_MASK 0x0800 /* AIF1ADC2R_HPF */ | ||
2674 | #define WM8994_AIF1ADC2R_HPF_SHIFT 11 /* AIF1ADC2R_HPF */ | ||
2675 | #define WM8994_AIF1ADC2R_HPF_WIDTH 1 /* AIF1ADC2R_HPF */ | ||
2676 | |||
2677 | /* | ||
2678 | * R1056 (0x420) - AIF1 DAC1 Filters (1) | ||
2679 | */ | ||
2680 | #define WM8994_AIF1DAC1_MUTE 0x0200 /* AIF1DAC1_MUTE */ | ||
2681 | #define WM8994_AIF1DAC1_MUTE_MASK 0x0200 /* AIF1DAC1_MUTE */ | ||
2682 | #define WM8994_AIF1DAC1_MUTE_SHIFT 9 /* AIF1DAC1_MUTE */ | ||
2683 | #define WM8994_AIF1DAC1_MUTE_WIDTH 1 /* AIF1DAC1_MUTE */ | ||
2684 | #define WM8994_AIF1DAC1_MONO 0x0080 /* AIF1DAC1_MONO */ | ||
2685 | #define WM8994_AIF1DAC1_MONO_MASK 0x0080 /* AIF1DAC1_MONO */ | ||
2686 | #define WM8994_AIF1DAC1_MONO_SHIFT 7 /* AIF1DAC1_MONO */ | ||
2687 | #define WM8994_AIF1DAC1_MONO_WIDTH 1 /* AIF1DAC1_MONO */ | ||
2688 | #define WM8994_AIF1DAC1_MUTERATE 0x0020 /* AIF1DAC1_MUTERATE */ | ||
2689 | #define WM8994_AIF1DAC1_MUTERATE_MASK 0x0020 /* AIF1DAC1_MUTERATE */ | ||
2690 | #define WM8994_AIF1DAC1_MUTERATE_SHIFT 5 /* AIF1DAC1_MUTERATE */ | ||
2691 | #define WM8994_AIF1DAC1_MUTERATE_WIDTH 1 /* AIF1DAC1_MUTERATE */ | ||
2692 | #define WM8994_AIF1DAC1_UNMUTE_RAMP 0x0010 /* AIF1DAC1_UNMUTE_RAMP */ | ||
2693 | #define WM8994_AIF1DAC1_UNMUTE_RAMP_MASK 0x0010 /* AIF1DAC1_UNMUTE_RAMP */ | ||
2694 | #define WM8994_AIF1DAC1_UNMUTE_RAMP_SHIFT 4 /* AIF1DAC1_UNMUTE_RAMP */ | ||
2695 | #define WM8994_AIF1DAC1_UNMUTE_RAMP_WIDTH 1 /* AIF1DAC1_UNMUTE_RAMP */ | ||
2696 | #define WM8994_AIF1DAC1_DEEMP_MASK 0x0006 /* AIF1DAC1_DEEMP - [2:1] */ | ||
2697 | #define WM8994_AIF1DAC1_DEEMP_SHIFT 1 /* AIF1DAC1_DEEMP - [2:1] */ | ||
2698 | #define WM8994_AIF1DAC1_DEEMP_WIDTH 2 /* AIF1DAC1_DEEMP - [2:1] */ | ||
2699 | |||
2700 | /* | ||
2701 | * R1057 (0x421) - AIF1 DAC1 Filters (2) | ||
2702 | */ | ||
2703 | #define WM8994_AIF1DAC1_3D_GAIN_MASK 0x3E00 /* AIF1DAC1_3D_GAIN - [13:9] */ | ||
2704 | #define WM8994_AIF1DAC1_3D_GAIN_SHIFT 9 /* AIF1DAC1_3D_GAIN - [13:9] */ | ||
2705 | #define WM8994_AIF1DAC1_3D_GAIN_WIDTH 5 /* AIF1DAC1_3D_GAIN - [13:9] */ | ||
2706 | #define WM8994_AIF1DAC1_3D_ENA 0x0100 /* AIF1DAC1_3D_ENA */ | ||
2707 | #define WM8994_AIF1DAC1_3D_ENA_MASK 0x0100 /* AIF1DAC1_3D_ENA */ | ||
2708 | #define WM8994_AIF1DAC1_3D_ENA_SHIFT 8 /* AIF1DAC1_3D_ENA */ | ||
2709 | #define WM8994_AIF1DAC1_3D_ENA_WIDTH 1 /* AIF1DAC1_3D_ENA */ | ||
2710 | |||
2711 | /* | ||
2712 | * R1058 (0x422) - AIF1 DAC2 Filters (1) | ||
2713 | */ | ||
2714 | #define WM8994_AIF1DAC2_MUTE 0x0200 /* AIF1DAC2_MUTE */ | ||
2715 | #define WM8994_AIF1DAC2_MUTE_MASK 0x0200 /* AIF1DAC2_MUTE */ | ||
2716 | #define WM8994_AIF1DAC2_MUTE_SHIFT 9 /* AIF1DAC2_MUTE */ | ||
2717 | #define WM8994_AIF1DAC2_MUTE_WIDTH 1 /* AIF1DAC2_MUTE */ | ||
2718 | #define WM8994_AIF1DAC2_MONO 0x0080 /* AIF1DAC2_MONO */ | ||
2719 | #define WM8994_AIF1DAC2_MONO_MASK 0x0080 /* AIF1DAC2_MONO */ | ||
2720 | #define WM8994_AIF1DAC2_MONO_SHIFT 7 /* AIF1DAC2_MONO */ | ||
2721 | #define WM8994_AIF1DAC2_MONO_WIDTH 1 /* AIF1DAC2_MONO */ | ||
2722 | #define WM8994_AIF1DAC2_MUTERATE 0x0020 /* AIF1DAC2_MUTERATE */ | ||
2723 | #define WM8994_AIF1DAC2_MUTERATE_MASK 0x0020 /* AIF1DAC2_MUTERATE */ | ||
2724 | #define WM8994_AIF1DAC2_MUTERATE_SHIFT 5 /* AIF1DAC2_MUTERATE */ | ||
2725 | #define WM8994_AIF1DAC2_MUTERATE_WIDTH 1 /* AIF1DAC2_MUTERATE */ | ||
2726 | #define WM8994_AIF1DAC2_UNMUTE_RAMP 0x0010 /* AIF1DAC2_UNMUTE_RAMP */ | ||
2727 | #define WM8994_AIF1DAC2_UNMUTE_RAMP_MASK 0x0010 /* AIF1DAC2_UNMUTE_RAMP */ | ||
2728 | #define WM8994_AIF1DAC2_UNMUTE_RAMP_SHIFT 4 /* AIF1DAC2_UNMUTE_RAMP */ | ||
2729 | #define WM8994_AIF1DAC2_UNMUTE_RAMP_WIDTH 1 /* AIF1DAC2_UNMUTE_RAMP */ | ||
2730 | #define WM8994_AIF1DAC2_DEEMP_MASK 0x0006 /* AIF1DAC2_DEEMP - [2:1] */ | ||
2731 | #define WM8994_AIF1DAC2_DEEMP_SHIFT 1 /* AIF1DAC2_DEEMP - [2:1] */ | ||
2732 | #define WM8994_AIF1DAC2_DEEMP_WIDTH 2 /* AIF1DAC2_DEEMP - [2:1] */ | ||
2733 | |||
2734 | /* | ||
2735 | * R1059 (0x423) - AIF1 DAC2 Filters (2) | ||
2736 | */ | ||
2737 | #define WM8994_AIF1DAC2_3D_GAIN_MASK 0x3E00 /* AIF1DAC2_3D_GAIN - [13:9] */ | ||
2738 | #define WM8994_AIF1DAC2_3D_GAIN_SHIFT 9 /* AIF1DAC2_3D_GAIN - [13:9] */ | ||
2739 | #define WM8994_AIF1DAC2_3D_GAIN_WIDTH 5 /* AIF1DAC2_3D_GAIN - [13:9] */ | ||
2740 | #define WM8994_AIF1DAC2_3D_ENA 0x0100 /* AIF1DAC2_3D_ENA */ | ||
2741 | #define WM8994_AIF1DAC2_3D_ENA_MASK 0x0100 /* AIF1DAC2_3D_ENA */ | ||
2742 | #define WM8994_AIF1DAC2_3D_ENA_SHIFT 8 /* AIF1DAC2_3D_ENA */ | ||
2743 | #define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */ | ||
2744 | |||
2745 | /* | ||
2746 | * R1088 (0x440) - AIF1 DRC1 (1) | ||
2747 | */ | ||
2748 | #define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ | ||
2749 | #define WM8994_AIF1DRC1_SIG_DET_RMS_SHIFT 11 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ | ||
2750 | #define WM8994_AIF1DRC1_SIG_DET_RMS_WIDTH 5 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ | ||
2751 | #define WM8994_AIF1DRC1_SIG_DET_PK_MASK 0x0600 /* AIF1DRC1_SIG_DET_PK - [10:9] */ | ||
2752 | #define WM8994_AIF1DRC1_SIG_DET_PK_SHIFT 9 /* AIF1DRC1_SIG_DET_PK - [10:9] */ | ||
2753 | #define WM8994_AIF1DRC1_SIG_DET_PK_WIDTH 2 /* AIF1DRC1_SIG_DET_PK - [10:9] */ | ||
2754 | #define WM8994_AIF1DRC1_NG_ENA 0x0100 /* AIF1DRC1_NG_ENA */ | ||
2755 | #define WM8994_AIF1DRC1_NG_ENA_MASK 0x0100 /* AIF1DRC1_NG_ENA */ | ||
2756 | #define WM8994_AIF1DRC1_NG_ENA_SHIFT 8 /* AIF1DRC1_NG_ENA */ | ||
2757 | #define WM8994_AIF1DRC1_NG_ENA_WIDTH 1 /* AIF1DRC1_NG_ENA */ | ||
2758 | #define WM8994_AIF1DRC1_SIG_DET_MODE 0x0080 /* AIF1DRC1_SIG_DET_MODE */ | ||
2759 | #define WM8994_AIF1DRC1_SIG_DET_MODE_MASK 0x0080 /* AIF1DRC1_SIG_DET_MODE */ | ||
2760 | #define WM8994_AIF1DRC1_SIG_DET_MODE_SHIFT 7 /* AIF1DRC1_SIG_DET_MODE */ | ||
2761 | #define WM8994_AIF1DRC1_SIG_DET_MODE_WIDTH 1 /* AIF1DRC1_SIG_DET_MODE */ | ||
2762 | #define WM8994_AIF1DRC1_SIG_DET 0x0040 /* AIF1DRC1_SIG_DET */ | ||
2763 | #define WM8994_AIF1DRC1_SIG_DET_MASK 0x0040 /* AIF1DRC1_SIG_DET */ | ||
2764 | #define WM8994_AIF1DRC1_SIG_DET_SHIFT 6 /* AIF1DRC1_SIG_DET */ | ||
2765 | #define WM8994_AIF1DRC1_SIG_DET_WIDTH 1 /* AIF1DRC1_SIG_DET */ | ||
2766 | #define WM8994_AIF1DRC1_KNEE2_OP_ENA 0x0020 /* AIF1DRC1_KNEE2_OP_ENA */ | ||
2767 | #define WM8994_AIF1DRC1_KNEE2_OP_ENA_MASK 0x0020 /* AIF1DRC1_KNEE2_OP_ENA */ | ||
2768 | #define WM8994_AIF1DRC1_KNEE2_OP_ENA_SHIFT 5 /* AIF1DRC1_KNEE2_OP_ENA */ | ||
2769 | #define WM8994_AIF1DRC1_KNEE2_OP_ENA_WIDTH 1 /* AIF1DRC1_KNEE2_OP_ENA */ | ||
2770 | #define WM8994_AIF1DRC1_QR 0x0010 /* AIF1DRC1_QR */ | ||
2771 | #define WM8994_AIF1DRC1_QR_MASK 0x0010 /* AIF1DRC1_QR */ | ||
2772 | #define WM8994_AIF1DRC1_QR_SHIFT 4 /* AIF1DRC1_QR */ | ||
2773 | #define WM8994_AIF1DRC1_QR_WIDTH 1 /* AIF1DRC1_QR */ | ||
2774 | #define WM8994_AIF1DRC1_ANTICLIP 0x0008 /* AIF1DRC1_ANTICLIP */ | ||
2775 | #define WM8994_AIF1DRC1_ANTICLIP_MASK 0x0008 /* AIF1DRC1_ANTICLIP */ | ||
2776 | #define WM8994_AIF1DRC1_ANTICLIP_SHIFT 3 /* AIF1DRC1_ANTICLIP */ | ||
2777 | #define WM8994_AIF1DRC1_ANTICLIP_WIDTH 1 /* AIF1DRC1_ANTICLIP */ | ||
2778 | #define WM8994_AIF1DAC1_DRC_ENA 0x0004 /* AIF1DAC1_DRC_ENA */ | ||
2779 | #define WM8994_AIF1DAC1_DRC_ENA_MASK 0x0004 /* AIF1DAC1_DRC_ENA */ | ||
2780 | #define WM8994_AIF1DAC1_DRC_ENA_SHIFT 2 /* AIF1DAC1_DRC_ENA */ | ||
2781 | #define WM8994_AIF1DAC1_DRC_ENA_WIDTH 1 /* AIF1DAC1_DRC_ENA */ | ||
2782 | #define WM8994_AIF1ADC1L_DRC_ENA 0x0002 /* AIF1ADC1L_DRC_ENA */ | ||
2783 | #define WM8994_AIF1ADC1L_DRC_ENA_MASK 0x0002 /* AIF1ADC1L_DRC_ENA */ | ||
2784 | #define WM8994_AIF1ADC1L_DRC_ENA_SHIFT 1 /* AIF1ADC1L_DRC_ENA */ | ||
2785 | #define WM8994_AIF1ADC1L_DRC_ENA_WIDTH 1 /* AIF1ADC1L_DRC_ENA */ | ||
2786 | #define WM8994_AIF1ADC1R_DRC_ENA 0x0001 /* AIF1ADC1R_DRC_ENA */ | ||
2787 | #define WM8994_AIF1ADC1R_DRC_ENA_MASK 0x0001 /* AIF1ADC1R_DRC_ENA */ | ||
2788 | #define WM8994_AIF1ADC1R_DRC_ENA_SHIFT 0 /* AIF1ADC1R_DRC_ENA */ | ||
2789 | #define WM8994_AIF1ADC1R_DRC_ENA_WIDTH 1 /* AIF1ADC1R_DRC_ENA */ | ||
2790 | |||
2791 | /* | ||
2792 | * R1089 (0x441) - AIF1 DRC1 (2) | ||
2793 | */ | ||
2794 | #define WM8994_AIF1DRC1_ATK_MASK 0x1E00 /* AIF1DRC1_ATK - [12:9] */ | ||
2795 | #define WM8994_AIF1DRC1_ATK_SHIFT 9 /* AIF1DRC1_ATK - [12:9] */ | ||
2796 | #define WM8994_AIF1DRC1_ATK_WIDTH 4 /* AIF1DRC1_ATK - [12:9] */ | ||
2797 | #define WM8994_AIF1DRC1_DCY_MASK 0x01E0 /* AIF1DRC1_DCY - [8:5] */ | ||
2798 | #define WM8994_AIF1DRC1_DCY_SHIFT 5 /* AIF1DRC1_DCY - [8:5] */ | ||
2799 | #define WM8994_AIF1DRC1_DCY_WIDTH 4 /* AIF1DRC1_DCY - [8:5] */ | ||
2800 | #define WM8994_AIF1DRC1_MINGAIN_MASK 0x001C /* AIF1DRC1_MINGAIN - [4:2] */ | ||
2801 | #define WM8994_AIF1DRC1_MINGAIN_SHIFT 2 /* AIF1DRC1_MINGAIN - [4:2] */ | ||
2802 | #define WM8994_AIF1DRC1_MINGAIN_WIDTH 3 /* AIF1DRC1_MINGAIN - [4:2] */ | ||
2803 | #define WM8994_AIF1DRC1_MAXGAIN_MASK 0x0003 /* AIF1DRC1_MAXGAIN - [1:0] */ | ||
2804 | #define WM8994_AIF1DRC1_MAXGAIN_SHIFT 0 /* AIF1DRC1_MAXGAIN - [1:0] */ | ||
2805 | #define WM8994_AIF1DRC1_MAXGAIN_WIDTH 2 /* AIF1DRC1_MAXGAIN - [1:0] */ | ||
2806 | |||
2807 | /* | ||
2808 | * R1090 (0x442) - AIF1 DRC1 (3) | ||
2809 | */ | ||
2810 | #define WM8994_AIF1DRC1_NG_MINGAIN_MASK 0xF000 /* AIF1DRC1_NG_MINGAIN - [15:12] */ | ||
2811 | #define WM8994_AIF1DRC1_NG_MINGAIN_SHIFT 12 /* AIF1DRC1_NG_MINGAIN - [15:12] */ | ||
2812 | #define WM8994_AIF1DRC1_NG_MINGAIN_WIDTH 4 /* AIF1DRC1_NG_MINGAIN - [15:12] */ | ||
2813 | #define WM8994_AIF1DRC1_NG_EXP_MASK 0x0C00 /* AIF1DRC1_NG_EXP - [11:10] */ | ||
2814 | #define WM8994_AIF1DRC1_NG_EXP_SHIFT 10 /* AIF1DRC1_NG_EXP - [11:10] */ | ||
2815 | #define WM8994_AIF1DRC1_NG_EXP_WIDTH 2 /* AIF1DRC1_NG_EXP - [11:10] */ | ||
2816 | #define WM8994_AIF1DRC1_QR_THR_MASK 0x0300 /* AIF1DRC1_QR_THR - [9:8] */ | ||
2817 | #define WM8994_AIF1DRC1_QR_THR_SHIFT 8 /* AIF1DRC1_QR_THR - [9:8] */ | ||
2818 | #define WM8994_AIF1DRC1_QR_THR_WIDTH 2 /* AIF1DRC1_QR_THR - [9:8] */ | ||
2819 | #define WM8994_AIF1DRC1_QR_DCY_MASK 0x00C0 /* AIF1DRC1_QR_DCY - [7:6] */ | ||
2820 | #define WM8994_AIF1DRC1_QR_DCY_SHIFT 6 /* AIF1DRC1_QR_DCY - [7:6] */ | ||
2821 | #define WM8994_AIF1DRC1_QR_DCY_WIDTH 2 /* AIF1DRC1_QR_DCY - [7:6] */ | ||
2822 | #define WM8994_AIF1DRC1_HI_COMP_MASK 0x0038 /* AIF1DRC1_HI_COMP - [5:3] */ | ||
2823 | #define WM8994_AIF1DRC1_HI_COMP_SHIFT 3 /* AIF1DRC1_HI_COMP - [5:3] */ | ||
2824 | #define WM8994_AIF1DRC1_HI_COMP_WIDTH 3 /* AIF1DRC1_HI_COMP - [5:3] */ | ||
2825 | #define WM8994_AIF1DRC1_LO_COMP_MASK 0x0007 /* AIF1DRC1_LO_COMP - [2:0] */ | ||
2826 | #define WM8994_AIF1DRC1_LO_COMP_SHIFT 0 /* AIF1DRC1_LO_COMP - [2:0] */ | ||
2827 | #define WM8994_AIF1DRC1_LO_COMP_WIDTH 3 /* AIF1DRC1_LO_COMP - [2:0] */ | ||
2828 | |||
2829 | /* | ||
2830 | * R1091 (0x443) - AIF1 DRC1 (4) | ||
2831 | */ | ||
2832 | #define WM8994_AIF1DRC1_KNEE_IP_MASK 0x07E0 /* AIF1DRC1_KNEE_IP - [10:5] */ | ||
2833 | #define WM8994_AIF1DRC1_KNEE_IP_SHIFT 5 /* AIF1DRC1_KNEE_IP - [10:5] */ | ||
2834 | #define WM8994_AIF1DRC1_KNEE_IP_WIDTH 6 /* AIF1DRC1_KNEE_IP - [10:5] */ | ||
2835 | #define WM8994_AIF1DRC1_KNEE_OP_MASK 0x001F /* AIF1DRC1_KNEE_OP - [4:0] */ | ||
2836 | #define WM8994_AIF1DRC1_KNEE_OP_SHIFT 0 /* AIF1DRC1_KNEE_OP - [4:0] */ | ||
2837 | #define WM8994_AIF1DRC1_KNEE_OP_WIDTH 5 /* AIF1DRC1_KNEE_OP - [4:0] */ | ||
2838 | |||
2839 | /* | ||
2840 | * R1092 (0x444) - AIF1 DRC1 (5) | ||
2841 | */ | ||
2842 | #define WM8994_AIF1DRC1_KNEE2_IP_MASK 0x03E0 /* AIF1DRC1_KNEE2_IP - [9:5] */ | ||
2843 | #define WM8994_AIF1DRC1_KNEE2_IP_SHIFT 5 /* AIF1DRC1_KNEE2_IP - [9:5] */ | ||
2844 | #define WM8994_AIF1DRC1_KNEE2_IP_WIDTH 5 /* AIF1DRC1_KNEE2_IP - [9:5] */ | ||
2845 | #define WM8994_AIF1DRC1_KNEE2_OP_MASK 0x001F /* AIF1DRC1_KNEE2_OP - [4:0] */ | ||
2846 | #define WM8994_AIF1DRC1_KNEE2_OP_SHIFT 0 /* AIF1DRC1_KNEE2_OP - [4:0] */ | ||
2847 | #define WM8994_AIF1DRC1_KNEE2_OP_WIDTH 5 /* AIF1DRC1_KNEE2_OP - [4:0] */ | ||
2848 | |||
2849 | /* | ||
2850 | * R1104 (0x450) - AIF1 DRC2 (1) | ||
2851 | */ | ||
2852 | #define WM8994_AIF1DRC2_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC2_SIG_DET_RMS - [15:11] */ | ||
2853 | #define WM8994_AIF1DRC2_SIG_DET_RMS_SHIFT 11 /* AIF1DRC2_SIG_DET_RMS - [15:11] */ | ||
2854 | #define WM8994_AIF1DRC2_SIG_DET_RMS_WIDTH 5 /* AIF1DRC2_SIG_DET_RMS - [15:11] */ | ||
2855 | #define WM8994_AIF1DRC2_SIG_DET_PK_MASK 0x0600 /* AIF1DRC2_SIG_DET_PK - [10:9] */ | ||
2856 | #define WM8994_AIF1DRC2_SIG_DET_PK_SHIFT 9 /* AIF1DRC2_SIG_DET_PK - [10:9] */ | ||
2857 | #define WM8994_AIF1DRC2_SIG_DET_PK_WIDTH 2 /* AIF1DRC2_SIG_DET_PK - [10:9] */ | ||
2858 | #define WM8994_AIF1DRC2_NG_ENA 0x0100 /* AIF1DRC2_NG_ENA */ | ||
2859 | #define WM8994_AIF1DRC2_NG_ENA_MASK 0x0100 /* AIF1DRC2_NG_ENA */ | ||
2860 | #define WM8994_AIF1DRC2_NG_ENA_SHIFT 8 /* AIF1DRC2_NG_ENA */ | ||
2861 | #define WM8994_AIF1DRC2_NG_ENA_WIDTH 1 /* AIF1DRC2_NG_ENA */ | ||
2862 | #define WM8994_AIF1DRC2_SIG_DET_MODE 0x0080 /* AIF1DRC2_SIG_DET_MODE */ | ||
2863 | #define WM8994_AIF1DRC2_SIG_DET_MODE_MASK 0x0080 /* AIF1DRC2_SIG_DET_MODE */ | ||
2864 | #define WM8994_AIF1DRC2_SIG_DET_MODE_SHIFT 7 /* AIF1DRC2_SIG_DET_MODE */ | ||
2865 | #define WM8994_AIF1DRC2_SIG_DET_MODE_WIDTH 1 /* AIF1DRC2_SIG_DET_MODE */ | ||
2866 | #define WM8994_AIF1DRC2_SIG_DET 0x0040 /* AIF1DRC2_SIG_DET */ | ||
2867 | #define WM8994_AIF1DRC2_SIG_DET_MASK 0x0040 /* AIF1DRC2_SIG_DET */ | ||
2868 | #define WM8994_AIF1DRC2_SIG_DET_SHIFT 6 /* AIF1DRC2_SIG_DET */ | ||
2869 | #define WM8994_AIF1DRC2_SIG_DET_WIDTH 1 /* AIF1DRC2_SIG_DET */ | ||
2870 | #define WM8994_AIF1DRC2_KNEE2_OP_ENA 0x0020 /* AIF1DRC2_KNEE2_OP_ENA */ | ||
2871 | #define WM8994_AIF1DRC2_KNEE2_OP_ENA_MASK 0x0020 /* AIF1DRC2_KNEE2_OP_ENA */ | ||
2872 | #define WM8994_AIF1DRC2_KNEE2_OP_ENA_SHIFT 5 /* AIF1DRC2_KNEE2_OP_ENA */ | ||
2873 | #define WM8994_AIF1DRC2_KNEE2_OP_ENA_WIDTH 1 /* AIF1DRC2_KNEE2_OP_ENA */ | ||
2874 | #define WM8994_AIF1DRC2_QR 0x0010 /* AIF1DRC2_QR */ | ||
2875 | #define WM8994_AIF1DRC2_QR_MASK 0x0010 /* AIF1DRC2_QR */ | ||
2876 | #define WM8994_AIF1DRC2_QR_SHIFT 4 /* AIF1DRC2_QR */ | ||
2877 | #define WM8994_AIF1DRC2_QR_WIDTH 1 /* AIF1DRC2_QR */ | ||
2878 | #define WM8994_AIF1DRC2_ANTICLIP 0x0008 /* AIF1DRC2_ANTICLIP */ | ||
2879 | #define WM8994_AIF1DRC2_ANTICLIP_MASK 0x0008 /* AIF1DRC2_ANTICLIP */ | ||
2880 | #define WM8994_AIF1DRC2_ANTICLIP_SHIFT 3 /* AIF1DRC2_ANTICLIP */ | ||
2881 | #define WM8994_AIF1DRC2_ANTICLIP_WIDTH 1 /* AIF1DRC2_ANTICLIP */ | ||
2882 | #define WM8994_AIF1DAC2_DRC_ENA 0x0004 /* AIF1DAC2_DRC_ENA */ | ||
2883 | #define WM8994_AIF1DAC2_DRC_ENA_MASK 0x0004 /* AIF1DAC2_DRC_ENA */ | ||
2884 | #define WM8994_AIF1DAC2_DRC_ENA_SHIFT 2 /* AIF1DAC2_DRC_ENA */ | ||
2885 | #define WM8994_AIF1DAC2_DRC_ENA_WIDTH 1 /* AIF1DAC2_DRC_ENA */ | ||
2886 | #define WM8994_AIF1ADC2L_DRC_ENA 0x0002 /* AIF1ADC2L_DRC_ENA */ | ||
2887 | #define WM8994_AIF1ADC2L_DRC_ENA_MASK 0x0002 /* AIF1ADC2L_DRC_ENA */ | ||
2888 | #define WM8994_AIF1ADC2L_DRC_ENA_SHIFT 1 /* AIF1ADC2L_DRC_ENA */ | ||
2889 | #define WM8994_AIF1ADC2L_DRC_ENA_WIDTH 1 /* AIF1ADC2L_DRC_ENA */ | ||
2890 | #define WM8994_AIF1ADC2R_DRC_ENA 0x0001 /* AIF1ADC2R_DRC_ENA */ | ||
2891 | #define WM8994_AIF1ADC2R_DRC_ENA_MASK 0x0001 /* AIF1ADC2R_DRC_ENA */ | ||
2892 | #define WM8994_AIF1ADC2R_DRC_ENA_SHIFT 0 /* AIF1ADC2R_DRC_ENA */ | ||
2893 | #define WM8994_AIF1ADC2R_DRC_ENA_WIDTH 1 /* AIF1ADC2R_DRC_ENA */ | ||
2894 | |||
2895 | /* | ||
2896 | * R1105 (0x451) - AIF1 DRC2 (2) | ||
2897 | */ | ||
2898 | #define WM8994_AIF1DRC2_ATK_MASK 0x1E00 /* AIF1DRC2_ATK - [12:9] */ | ||
2899 | #define WM8994_AIF1DRC2_ATK_SHIFT 9 /* AIF1DRC2_ATK - [12:9] */ | ||
2900 | #define WM8994_AIF1DRC2_ATK_WIDTH 4 /* AIF1DRC2_ATK - [12:9] */ | ||
2901 | #define WM8994_AIF1DRC2_DCY_MASK 0x01E0 /* AIF1DRC2_DCY - [8:5] */ | ||
2902 | #define WM8994_AIF1DRC2_DCY_SHIFT 5 /* AIF1DRC2_DCY - [8:5] */ | ||
2903 | #define WM8994_AIF1DRC2_DCY_WIDTH 4 /* AIF1DRC2_DCY - [8:5] */ | ||
2904 | #define WM8994_AIF1DRC2_MINGAIN_MASK 0x001C /* AIF1DRC2_MINGAIN - [4:2] */ | ||
2905 | #define WM8994_AIF1DRC2_MINGAIN_SHIFT 2 /* AIF1DRC2_MINGAIN - [4:2] */ | ||
2906 | #define WM8994_AIF1DRC2_MINGAIN_WIDTH 3 /* AIF1DRC2_MINGAIN - [4:2] */ | ||
2907 | #define WM8994_AIF1DRC2_MAXGAIN_MASK 0x0003 /* AIF1DRC2_MAXGAIN - [1:0] */ | ||
2908 | #define WM8994_AIF1DRC2_MAXGAIN_SHIFT 0 /* AIF1DRC2_MAXGAIN - [1:0] */ | ||
2909 | #define WM8994_AIF1DRC2_MAXGAIN_WIDTH 2 /* AIF1DRC2_MAXGAIN - [1:0] */ | ||
2910 | |||
2911 | /* | ||
2912 | * R1106 (0x452) - AIF1 DRC2 (3) | ||
2913 | */ | ||
2914 | #define WM8994_AIF1DRC2_NG_MINGAIN_MASK 0xF000 /* AIF1DRC2_NG_MINGAIN - [15:12] */ | ||
2915 | #define WM8994_AIF1DRC2_NG_MINGAIN_SHIFT 12 /* AIF1DRC2_NG_MINGAIN - [15:12] */ | ||
2916 | #define WM8994_AIF1DRC2_NG_MINGAIN_WIDTH 4 /* AIF1DRC2_NG_MINGAIN - [15:12] */ | ||
2917 | #define WM8994_AIF1DRC2_NG_EXP_MASK 0x0C00 /* AIF1DRC2_NG_EXP - [11:10] */ | ||
2918 | #define WM8994_AIF1DRC2_NG_EXP_SHIFT 10 /* AIF1DRC2_NG_EXP - [11:10] */ | ||
2919 | #define WM8994_AIF1DRC2_NG_EXP_WIDTH 2 /* AIF1DRC2_NG_EXP - [11:10] */ | ||
2920 | #define WM8994_AIF1DRC2_QR_THR_MASK 0x0300 /* AIF1DRC2_QR_THR - [9:8] */ | ||
2921 | #define WM8994_AIF1DRC2_QR_THR_SHIFT 8 /* AIF1DRC2_QR_THR - [9:8] */ | ||
2922 | #define WM8994_AIF1DRC2_QR_THR_WIDTH 2 /* AIF1DRC2_QR_THR - [9:8] */ | ||
2923 | #define WM8994_AIF1DRC2_QR_DCY_MASK 0x00C0 /* AIF1DRC2_QR_DCY - [7:6] */ | ||
2924 | #define WM8994_AIF1DRC2_QR_DCY_SHIFT 6 /* AIF1DRC2_QR_DCY - [7:6] */ | ||
2925 | #define WM8994_AIF1DRC2_QR_DCY_WIDTH 2 /* AIF1DRC2_QR_DCY - [7:6] */ | ||
2926 | #define WM8994_AIF1DRC2_HI_COMP_MASK 0x0038 /* AIF1DRC2_HI_COMP - [5:3] */ | ||
2927 | #define WM8994_AIF1DRC2_HI_COMP_SHIFT 3 /* AIF1DRC2_HI_COMP - [5:3] */ | ||
2928 | #define WM8994_AIF1DRC2_HI_COMP_WIDTH 3 /* AIF1DRC2_HI_COMP - [5:3] */ | ||
2929 | #define WM8994_AIF1DRC2_LO_COMP_MASK 0x0007 /* AIF1DRC2_LO_COMP - [2:0] */ | ||
2930 | #define WM8994_AIF1DRC2_LO_COMP_SHIFT 0 /* AIF1DRC2_LO_COMP - [2:0] */ | ||
2931 | #define WM8994_AIF1DRC2_LO_COMP_WIDTH 3 /* AIF1DRC2_LO_COMP - [2:0] */ | ||
2932 | |||
2933 | /* | ||
2934 | * R1107 (0x453) - AIF1 DRC2 (4) | ||
2935 | */ | ||
2936 | #define WM8994_AIF1DRC2_KNEE_IP_MASK 0x07E0 /* AIF1DRC2_KNEE_IP - [10:5] */ | ||
2937 | #define WM8994_AIF1DRC2_KNEE_IP_SHIFT 5 /* AIF1DRC2_KNEE_IP - [10:5] */ | ||
2938 | #define WM8994_AIF1DRC2_KNEE_IP_WIDTH 6 /* AIF1DRC2_KNEE_IP - [10:5] */ | ||
2939 | #define WM8994_AIF1DRC2_KNEE_OP_MASK 0x001F /* AIF1DRC2_KNEE_OP - [4:0] */ | ||
2940 | #define WM8994_AIF1DRC2_KNEE_OP_SHIFT 0 /* AIF1DRC2_KNEE_OP - [4:0] */ | ||
2941 | #define WM8994_AIF1DRC2_KNEE_OP_WIDTH 5 /* AIF1DRC2_KNEE_OP - [4:0] */ | ||
2942 | |||
2943 | /* | ||
2944 | * R1108 (0x454) - AIF1 DRC2 (5) | ||
2945 | */ | ||
2946 | #define WM8994_AIF1DRC2_KNEE2_IP_MASK 0x03E0 /* AIF1DRC2_KNEE2_IP - [9:5] */ | ||
2947 | #define WM8994_AIF1DRC2_KNEE2_IP_SHIFT 5 /* AIF1DRC2_KNEE2_IP - [9:5] */ | ||
2948 | #define WM8994_AIF1DRC2_KNEE2_IP_WIDTH 5 /* AIF1DRC2_KNEE2_IP - [9:5] */ | ||
2949 | #define WM8994_AIF1DRC2_KNEE2_OP_MASK 0x001F /* AIF1DRC2_KNEE2_OP - [4:0] */ | ||
2950 | #define WM8994_AIF1DRC2_KNEE2_OP_SHIFT 0 /* AIF1DRC2_KNEE2_OP - [4:0] */ | ||
2951 | #define WM8994_AIF1DRC2_KNEE2_OP_WIDTH 5 /* AIF1DRC2_KNEE2_OP - [4:0] */ | ||
2952 | |||
2953 | /* | ||
2954 | * R1152 (0x480) - AIF1 DAC1 EQ Gains (1) | ||
2955 | */ | ||
2956 | #define WM8994_AIF1DAC1_EQ_B1_GAIN_MASK 0xF800 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */ | ||
2957 | #define WM8994_AIF1DAC1_EQ_B1_GAIN_SHIFT 11 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */ | ||
2958 | #define WM8994_AIF1DAC1_EQ_B1_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */ | ||
2959 | #define WM8994_AIF1DAC1_EQ_B2_GAIN_MASK 0x07C0 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */ | ||
2960 | #define WM8994_AIF1DAC1_EQ_B2_GAIN_SHIFT 6 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */ | ||
2961 | #define WM8994_AIF1DAC1_EQ_B2_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */ | ||
2962 | #define WM8994_AIF1DAC1_EQ_B3_GAIN_MASK 0x003E /* AIF1DAC1_EQ_B3_GAIN - [5:1] */ | ||
2963 | #define WM8994_AIF1DAC1_EQ_B3_GAIN_SHIFT 1 /* AIF1DAC1_EQ_B3_GAIN - [5:1] */ | ||
2964 | #define WM8994_AIF1DAC1_EQ_B3_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B3_GAIN - [5:1] */ | ||
2965 | #define WM8994_AIF1DAC1_EQ_ENA 0x0001 /* AIF1DAC1_EQ_ENA */ | ||
2966 | #define WM8994_AIF1DAC1_EQ_ENA_MASK 0x0001 /* AIF1DAC1_EQ_ENA */ | ||
2967 | #define WM8994_AIF1DAC1_EQ_ENA_SHIFT 0 /* AIF1DAC1_EQ_ENA */ | ||
2968 | #define WM8994_AIF1DAC1_EQ_ENA_WIDTH 1 /* AIF1DAC1_EQ_ENA */ | ||
2969 | |||
2970 | /* | ||
2971 | * R1153 (0x481) - AIF1 DAC1 EQ Gains (2) | ||
2972 | */ | ||
2973 | #define WM8994_AIF1DAC1_EQ_B4_GAIN_MASK 0xF800 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */ | ||
2974 | #define WM8994_AIF1DAC1_EQ_B4_GAIN_SHIFT 11 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */ | ||
2975 | #define WM8994_AIF1DAC1_EQ_B4_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */ | ||
2976 | #define WM8994_AIF1DAC1_EQ_B5_GAIN_MASK 0x07C0 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */ | ||
2977 | #define WM8994_AIF1DAC1_EQ_B5_GAIN_SHIFT 6 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */ | ||
2978 | #define WM8994_AIF1DAC1_EQ_B5_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */ | ||
2979 | |||
2980 | /* | ||
2981 | * R1154 (0x482) - AIF1 DAC1 EQ Band 1 A | ||
2982 | */ | ||
2983 | #define WM8994_AIF1DAC1_EQ_B1_A_MASK 0xFFFF /* AIF1DAC1_EQ_B1_A - [15:0] */ | ||
2984 | #define WM8994_AIF1DAC1_EQ_B1_A_SHIFT 0 /* AIF1DAC1_EQ_B1_A - [15:0] */ | ||
2985 | #define WM8994_AIF1DAC1_EQ_B1_A_WIDTH 16 /* AIF1DAC1_EQ_B1_A - [15:0] */ | ||
2986 | |||
2987 | /* | ||
2988 | * R1155 (0x483) - AIF1 DAC1 EQ Band 1 B | ||
2989 | */ | ||
2990 | #define WM8994_AIF1DAC1_EQ_B1_B_MASK 0xFFFF /* AIF1DAC1_EQ_B1_B - [15:0] */ | ||
2991 | #define WM8994_AIF1DAC1_EQ_B1_B_SHIFT 0 /* AIF1DAC1_EQ_B1_B - [15:0] */ | ||
2992 | #define WM8994_AIF1DAC1_EQ_B1_B_WIDTH 16 /* AIF1DAC1_EQ_B1_B - [15:0] */ | ||
2993 | |||
2994 | /* | ||
2995 | * R1156 (0x484) - AIF1 DAC1 EQ Band 1 PG | ||
2996 | */ | ||
2997 | #define WM8994_AIF1DAC1_EQ_B1_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B1_PG - [15:0] */ | ||
2998 | #define WM8994_AIF1DAC1_EQ_B1_PG_SHIFT 0 /* AIF1DAC1_EQ_B1_PG - [15:0] */ | ||
2999 | #define WM8994_AIF1DAC1_EQ_B1_PG_WIDTH 16 /* AIF1DAC1_EQ_B1_PG - [15:0] */ | ||
3000 | |||
3001 | /* | ||
3002 | * R1157 (0x485) - AIF1 DAC1 EQ Band 2 A | ||
3003 | */ | ||
3004 | #define WM8994_AIF1DAC1_EQ_B2_A_MASK 0xFFFF /* AIF1DAC1_EQ_B2_A - [15:0] */ | ||
3005 | #define WM8994_AIF1DAC1_EQ_B2_A_SHIFT 0 /* AIF1DAC1_EQ_B2_A - [15:0] */ | ||
3006 | #define WM8994_AIF1DAC1_EQ_B2_A_WIDTH 16 /* AIF1DAC1_EQ_B2_A - [15:0] */ | ||
3007 | |||
3008 | /* | ||
3009 | * R1158 (0x486) - AIF1 DAC1 EQ Band 2 B | ||
3010 | */ | ||
3011 | #define WM8994_AIF1DAC1_EQ_B2_B_MASK 0xFFFF /* AIF1DAC1_EQ_B2_B - [15:0] */ | ||
3012 | #define WM8994_AIF1DAC1_EQ_B2_B_SHIFT 0 /* AIF1DAC1_EQ_B2_B - [15:0] */ | ||
3013 | #define WM8994_AIF1DAC1_EQ_B2_B_WIDTH 16 /* AIF1DAC1_EQ_B2_B - [15:0] */ | ||
3014 | |||
3015 | /* | ||
3016 | * R1159 (0x487) - AIF1 DAC1 EQ Band 2 C | ||
3017 | */ | ||
3018 | #define WM8994_AIF1DAC1_EQ_B2_C_MASK 0xFFFF /* AIF1DAC1_EQ_B2_C - [15:0] */ | ||
3019 | #define WM8994_AIF1DAC1_EQ_B2_C_SHIFT 0 /* AIF1DAC1_EQ_B2_C - [15:0] */ | ||
3020 | #define WM8994_AIF1DAC1_EQ_B2_C_WIDTH 16 /* AIF1DAC1_EQ_B2_C - [15:0] */ | ||
3021 | |||
3022 | /* | ||
3023 | * R1160 (0x488) - AIF1 DAC1 EQ Band 2 PG | ||
3024 | */ | ||
3025 | #define WM8994_AIF1DAC1_EQ_B2_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B2_PG - [15:0] */ | ||
3026 | #define WM8994_AIF1DAC1_EQ_B2_PG_SHIFT 0 /* AIF1DAC1_EQ_B2_PG - [15:0] */ | ||
3027 | #define WM8994_AIF1DAC1_EQ_B2_PG_WIDTH 16 /* AIF1DAC1_EQ_B2_PG - [15:0] */ | ||
3028 | |||
3029 | /* | ||
3030 | * R1161 (0x489) - AIF1 DAC1 EQ Band 3 A | ||
3031 | */ | ||
3032 | #define WM8994_AIF1DAC1_EQ_B3_A_MASK 0xFFFF /* AIF1DAC1_EQ_B3_A - [15:0] */ | ||
3033 | #define WM8994_AIF1DAC1_EQ_B3_A_SHIFT 0 /* AIF1DAC1_EQ_B3_A - [15:0] */ | ||
3034 | #define WM8994_AIF1DAC1_EQ_B3_A_WIDTH 16 /* AIF1DAC1_EQ_B3_A - [15:0] */ | ||
3035 | |||
3036 | /* | ||
3037 | * R1162 (0x48A) - AIF1 DAC1 EQ Band 3 B | ||
3038 | */ | ||
3039 | #define WM8994_AIF1DAC1_EQ_B3_B_MASK 0xFFFF /* AIF1DAC1_EQ_B3_B - [15:0] */ | ||
3040 | #define WM8994_AIF1DAC1_EQ_B3_B_SHIFT 0 /* AIF1DAC1_EQ_B3_B - [15:0] */ | ||
3041 | #define WM8994_AIF1DAC1_EQ_B3_B_WIDTH 16 /* AIF1DAC1_EQ_B3_B - [15:0] */ | ||
3042 | |||
3043 | /* | ||
3044 | * R1163 (0x48B) - AIF1 DAC1 EQ Band 3 C | ||
3045 | */ | ||
3046 | #define WM8994_AIF1DAC1_EQ_B3_C_MASK 0xFFFF /* AIF1DAC1_EQ_B3_C - [15:0] */ | ||
3047 | #define WM8994_AIF1DAC1_EQ_B3_C_SHIFT 0 /* AIF1DAC1_EQ_B3_C - [15:0] */ | ||
3048 | #define WM8994_AIF1DAC1_EQ_B3_C_WIDTH 16 /* AIF1DAC1_EQ_B3_C - [15:0] */ | ||
3049 | |||
3050 | /* | ||
3051 | * R1164 (0x48C) - AIF1 DAC1 EQ Band 3 PG | ||
3052 | */ | ||
3053 | #define WM8994_AIF1DAC1_EQ_B3_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B3_PG - [15:0] */ | ||
3054 | #define WM8994_AIF1DAC1_EQ_B3_PG_SHIFT 0 /* AIF1DAC1_EQ_B3_PG - [15:0] */ | ||
3055 | #define WM8994_AIF1DAC1_EQ_B3_PG_WIDTH 16 /* AIF1DAC1_EQ_B3_PG - [15:0] */ | ||
3056 | |||
3057 | /* | ||
3058 | * R1165 (0x48D) - AIF1 DAC1 EQ Band 4 A | ||
3059 | */ | ||
3060 | #define WM8994_AIF1DAC1_EQ_B4_A_MASK 0xFFFF /* AIF1DAC1_EQ_B4_A - [15:0] */ | ||
3061 | #define WM8994_AIF1DAC1_EQ_B4_A_SHIFT 0 /* AIF1DAC1_EQ_B4_A - [15:0] */ | ||
3062 | #define WM8994_AIF1DAC1_EQ_B4_A_WIDTH 16 /* AIF1DAC1_EQ_B4_A - [15:0] */ | ||
3063 | |||
3064 | /* | ||
3065 | * R1166 (0x48E) - AIF1 DAC1 EQ Band 4 B | ||
3066 | */ | ||
3067 | #define WM8994_AIF1DAC1_EQ_B4_B_MASK 0xFFFF /* AIF1DAC1_EQ_B4_B - [15:0] */ | ||
3068 | #define WM8994_AIF1DAC1_EQ_B4_B_SHIFT 0 /* AIF1DAC1_EQ_B4_B - [15:0] */ | ||
3069 | #define WM8994_AIF1DAC1_EQ_B4_B_WIDTH 16 /* AIF1DAC1_EQ_B4_B - [15:0] */ | ||
3070 | |||
3071 | /* | ||
3072 | * R1167 (0x48F) - AIF1 DAC1 EQ Band 4 C | ||
3073 | */ | ||
3074 | #define WM8994_AIF1DAC1_EQ_B4_C_MASK 0xFFFF /* AIF1DAC1_EQ_B4_C - [15:0] */ | ||
3075 | #define WM8994_AIF1DAC1_EQ_B4_C_SHIFT 0 /* AIF1DAC1_EQ_B4_C - [15:0] */ | ||
3076 | #define WM8994_AIF1DAC1_EQ_B4_C_WIDTH 16 /* AIF1DAC1_EQ_B4_C - [15:0] */ | ||
3077 | |||
3078 | /* | ||
3079 | * R1168 (0x490) - AIF1 DAC1 EQ Band 4 PG | ||
3080 | */ | ||
3081 | #define WM8994_AIF1DAC1_EQ_B4_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B4_PG - [15:0] */ | ||
3082 | #define WM8994_AIF1DAC1_EQ_B4_PG_SHIFT 0 /* AIF1DAC1_EQ_B4_PG - [15:0] */ | ||
3083 | #define WM8994_AIF1DAC1_EQ_B4_PG_WIDTH 16 /* AIF1DAC1_EQ_B4_PG - [15:0] */ | ||
3084 | |||
3085 | /* | ||
3086 | * R1169 (0x491) - AIF1 DAC1 EQ Band 5 A | ||
3087 | */ | ||
3088 | #define WM8994_AIF1DAC1_EQ_B5_A_MASK 0xFFFF /* AIF1DAC1_EQ_B5_A - [15:0] */ | ||
3089 | #define WM8994_AIF1DAC1_EQ_B5_A_SHIFT 0 /* AIF1DAC1_EQ_B5_A - [15:0] */ | ||
3090 | #define WM8994_AIF1DAC1_EQ_B5_A_WIDTH 16 /* AIF1DAC1_EQ_B5_A - [15:0] */ | ||
3091 | |||
3092 | /* | ||
3093 | * R1170 (0x492) - AIF1 DAC1 EQ Band 5 B | ||
3094 | */ | ||
3095 | #define WM8994_AIF1DAC1_EQ_B5_B_MASK 0xFFFF /* AIF1DAC1_EQ_B5_B - [15:0] */ | ||
3096 | #define WM8994_AIF1DAC1_EQ_B5_B_SHIFT 0 /* AIF1DAC1_EQ_B5_B - [15:0] */ | ||
3097 | #define WM8994_AIF1DAC1_EQ_B5_B_WIDTH 16 /* AIF1DAC1_EQ_B5_B - [15:0] */ | ||
3098 | |||
3099 | /* | ||
3100 | * R1171 (0x493) - AIF1 DAC1 EQ Band 5 PG | ||
3101 | */ | ||
3102 | #define WM8994_AIF1DAC1_EQ_B5_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B5_PG - [15:0] */ | ||
3103 | #define WM8994_AIF1DAC1_EQ_B5_PG_SHIFT 0 /* AIF1DAC1_EQ_B5_PG - [15:0] */ | ||
3104 | #define WM8994_AIF1DAC1_EQ_B5_PG_WIDTH 16 /* AIF1DAC1_EQ_B5_PG - [15:0] */ | ||
3105 | |||
3106 | /* | ||
3107 | * R1184 (0x4A0) - AIF1 DAC2 EQ Gains (1) | ||
3108 | */ | ||
3109 | #define WM8994_AIF1DAC2_EQ_B1_GAIN_MASK 0xF800 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */ | ||
3110 | #define WM8994_AIF1DAC2_EQ_B1_GAIN_SHIFT 11 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */ | ||
3111 | #define WM8994_AIF1DAC2_EQ_B1_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */ | ||
3112 | #define WM8994_AIF1DAC2_EQ_B2_GAIN_MASK 0x07C0 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */ | ||
3113 | #define WM8994_AIF1DAC2_EQ_B2_GAIN_SHIFT 6 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */ | ||
3114 | #define WM8994_AIF1DAC2_EQ_B2_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */ | ||
3115 | #define WM8994_AIF1DAC2_EQ_B3_GAIN_MASK 0x003E /* AIF1DAC2_EQ_B3_GAIN - [5:1] */ | ||
3116 | #define WM8994_AIF1DAC2_EQ_B3_GAIN_SHIFT 1 /* AIF1DAC2_EQ_B3_GAIN - [5:1] */ | ||
3117 | #define WM8994_AIF1DAC2_EQ_B3_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B3_GAIN - [5:1] */ | ||
3118 | #define WM8994_AIF1DAC2_EQ_ENA 0x0001 /* AIF1DAC2_EQ_ENA */ | ||
3119 | #define WM8994_AIF1DAC2_EQ_ENA_MASK 0x0001 /* AIF1DAC2_EQ_ENA */ | ||
3120 | #define WM8994_AIF1DAC2_EQ_ENA_SHIFT 0 /* AIF1DAC2_EQ_ENA */ | ||
3121 | #define WM8994_AIF1DAC2_EQ_ENA_WIDTH 1 /* AIF1DAC2_EQ_ENA */ | ||
3122 | |||
3123 | /* | ||
3124 | * R1185 (0x4A1) - AIF1 DAC2 EQ Gains (2) | ||
3125 | */ | ||
3126 | #define WM8994_AIF1DAC2_EQ_B4_GAIN_MASK 0xF800 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */ | ||
3127 | #define WM8994_AIF1DAC2_EQ_B4_GAIN_SHIFT 11 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */ | ||
3128 | #define WM8994_AIF1DAC2_EQ_B4_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */ | ||
3129 | #define WM8994_AIF1DAC2_EQ_B5_GAIN_MASK 0x07C0 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */ | ||
3130 | #define WM8994_AIF1DAC2_EQ_B5_GAIN_SHIFT 6 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */ | ||
3131 | #define WM8994_AIF1DAC2_EQ_B5_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */ | ||
3132 | |||
3133 | /* | ||
3134 | * R1186 (0x4A2) - AIF1 DAC2 EQ Band 1 A | ||
3135 | */ | ||
3136 | #define WM8994_AIF1DAC2_EQ_B1_A_MASK 0xFFFF /* AIF1DAC2_EQ_B1_A - [15:0] */ | ||
3137 | #define WM8994_AIF1DAC2_EQ_B1_A_SHIFT 0 /* AIF1DAC2_EQ_B1_A - [15:0] */ | ||
3138 | #define WM8994_AIF1DAC2_EQ_B1_A_WIDTH 16 /* AIF1DAC2_EQ_B1_A - [15:0] */ | ||
3139 | |||
3140 | /* | ||
3141 | * R1187 (0x4A3) - AIF1 DAC2 EQ Band 1 B | ||
3142 | */ | ||
3143 | #define WM8994_AIF1DAC2_EQ_B1_B_MASK 0xFFFF /* AIF1DAC2_EQ_B1_B - [15:0] */ | ||
3144 | #define WM8994_AIF1DAC2_EQ_B1_B_SHIFT 0 /* AIF1DAC2_EQ_B1_B - [15:0] */ | ||
3145 | #define WM8994_AIF1DAC2_EQ_B1_B_WIDTH 16 /* AIF1DAC2_EQ_B1_B - [15:0] */ | ||
3146 | |||
3147 | /* | ||
3148 | * R1188 (0x4A4) - AIF1 DAC2 EQ Band 1 PG | ||
3149 | */ | ||
3150 | #define WM8994_AIF1DAC2_EQ_B1_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B1_PG - [15:0] */ | ||
3151 | #define WM8994_AIF1DAC2_EQ_B1_PG_SHIFT 0 /* AIF1DAC2_EQ_B1_PG - [15:0] */ | ||
3152 | #define WM8994_AIF1DAC2_EQ_B1_PG_WIDTH 16 /* AIF1DAC2_EQ_B1_PG - [15:0] */ | ||
3153 | |||
3154 | /* | ||
3155 | * R1189 (0x4A5) - AIF1 DAC2 EQ Band 2 A | ||
3156 | */ | ||
3157 | #define WM8994_AIF1DAC2_EQ_B2_A_MASK 0xFFFF /* AIF1DAC2_EQ_B2_A - [15:0] */ | ||
3158 | #define WM8994_AIF1DAC2_EQ_B2_A_SHIFT 0 /* AIF1DAC2_EQ_B2_A - [15:0] */ | ||
3159 | #define WM8994_AIF1DAC2_EQ_B2_A_WIDTH 16 /* AIF1DAC2_EQ_B2_A - [15:0] */ | ||
3160 | |||
3161 | /* | ||
3162 | * R1190 (0x4A6) - AIF1 DAC2 EQ Band 2 B | ||
3163 | */ | ||
3164 | #define WM8994_AIF1DAC2_EQ_B2_B_MASK 0xFFFF /* AIF1DAC2_EQ_B2_B - [15:0] */ | ||
3165 | #define WM8994_AIF1DAC2_EQ_B2_B_SHIFT 0 /* AIF1DAC2_EQ_B2_B - [15:0] */ | ||
3166 | #define WM8994_AIF1DAC2_EQ_B2_B_WIDTH 16 /* AIF1DAC2_EQ_B2_B - [15:0] */ | ||
3167 | |||
3168 | /* | ||
3169 | * R1191 (0x4A7) - AIF1 DAC2 EQ Band 2 C | ||
3170 | */ | ||
3171 | #define WM8994_AIF1DAC2_EQ_B2_C_MASK 0xFFFF /* AIF1DAC2_EQ_B2_C - [15:0] */ | ||
3172 | #define WM8994_AIF1DAC2_EQ_B2_C_SHIFT 0 /* AIF1DAC2_EQ_B2_C - [15:0] */ | ||
3173 | #define WM8994_AIF1DAC2_EQ_B2_C_WIDTH 16 /* AIF1DAC2_EQ_B2_C - [15:0] */ | ||
3174 | |||
3175 | /* | ||
3176 | * R1192 (0x4A8) - AIF1 DAC2 EQ Band 2 PG | ||
3177 | */ | ||
3178 | #define WM8994_AIF1DAC2_EQ_B2_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B2_PG - [15:0] */ | ||
3179 | #define WM8994_AIF1DAC2_EQ_B2_PG_SHIFT 0 /* AIF1DAC2_EQ_B2_PG - [15:0] */ | ||
3180 | #define WM8994_AIF1DAC2_EQ_B2_PG_WIDTH 16 /* AIF1DAC2_EQ_B2_PG - [15:0] */ | ||
3181 | |||
3182 | /* | ||
3183 | * R1193 (0x4A9) - AIF1 DAC2 EQ Band 3 A | ||
3184 | */ | ||
3185 | #define WM8994_AIF1DAC2_EQ_B3_A_MASK 0xFFFF /* AIF1DAC2_EQ_B3_A - [15:0] */ | ||
3186 | #define WM8994_AIF1DAC2_EQ_B3_A_SHIFT 0 /* AIF1DAC2_EQ_B3_A - [15:0] */ | ||
3187 | #define WM8994_AIF1DAC2_EQ_B3_A_WIDTH 16 /* AIF1DAC2_EQ_B3_A - [15:0] */ | ||
3188 | |||
3189 | /* | ||
3190 | * R1194 (0x4AA) - AIF1 DAC2 EQ Band 3 B | ||
3191 | */ | ||
3192 | #define WM8994_AIF1DAC2_EQ_B3_B_MASK 0xFFFF /* AIF1DAC2_EQ_B3_B - [15:0] */ | ||
3193 | #define WM8994_AIF1DAC2_EQ_B3_B_SHIFT 0 /* AIF1DAC2_EQ_B3_B - [15:0] */ | ||
3194 | #define WM8994_AIF1DAC2_EQ_B3_B_WIDTH 16 /* AIF1DAC2_EQ_B3_B - [15:0] */ | ||
3195 | |||
3196 | /* | ||
3197 | * R1195 (0x4AB) - AIF1 DAC2 EQ Band 3 C | ||
3198 | */ | ||
3199 | #define WM8994_AIF1DAC2_EQ_B3_C_MASK 0xFFFF /* AIF1DAC2_EQ_B3_C - [15:0] */ | ||
3200 | #define WM8994_AIF1DAC2_EQ_B3_C_SHIFT 0 /* AIF1DAC2_EQ_B3_C - [15:0] */ | ||
3201 | #define WM8994_AIF1DAC2_EQ_B3_C_WIDTH 16 /* AIF1DAC2_EQ_B3_C - [15:0] */ | ||
3202 | |||
3203 | /* | ||
3204 | * R1196 (0x4AC) - AIF1 DAC2 EQ Band 3 PG | ||
3205 | */ | ||
3206 | #define WM8994_AIF1DAC2_EQ_B3_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B3_PG - [15:0] */ | ||
3207 | #define WM8994_AIF1DAC2_EQ_B3_PG_SHIFT 0 /* AIF1DAC2_EQ_B3_PG - [15:0] */ | ||
3208 | #define WM8994_AIF1DAC2_EQ_B3_PG_WIDTH 16 /* AIF1DAC2_EQ_B3_PG - [15:0] */ | ||
3209 | |||
3210 | /* | ||
3211 | * R1197 (0x4AD) - AIF1 DAC2 EQ Band 4 A | ||
3212 | */ | ||
3213 | #define WM8994_AIF1DAC2_EQ_B4_A_MASK 0xFFFF /* AIF1DAC2_EQ_B4_A - [15:0] */ | ||
3214 | #define WM8994_AIF1DAC2_EQ_B4_A_SHIFT 0 /* AIF1DAC2_EQ_B4_A - [15:0] */ | ||
3215 | #define WM8994_AIF1DAC2_EQ_B4_A_WIDTH 16 /* AIF1DAC2_EQ_B4_A - [15:0] */ | ||
3216 | |||
3217 | /* | ||
3218 | * R1198 (0x4AE) - AIF1 DAC2 EQ Band 4 B | ||
3219 | */ | ||
3220 | #define WM8994_AIF1DAC2_EQ_B4_B_MASK 0xFFFF /* AIF1DAC2_EQ_B4_B - [15:0] */ | ||
3221 | #define WM8994_AIF1DAC2_EQ_B4_B_SHIFT 0 /* AIF1DAC2_EQ_B4_B - [15:0] */ | ||
3222 | #define WM8994_AIF1DAC2_EQ_B4_B_WIDTH 16 /* AIF1DAC2_EQ_B4_B - [15:0] */ | ||
3223 | |||
3224 | /* | ||
3225 | * R1199 (0x4AF) - AIF1 DAC2 EQ Band 4 C | ||
3226 | */ | ||
3227 | #define WM8994_AIF1DAC2_EQ_B4_C_MASK 0xFFFF /* AIF1DAC2_EQ_B4_C - [15:0] */ | ||
3228 | #define WM8994_AIF1DAC2_EQ_B4_C_SHIFT 0 /* AIF1DAC2_EQ_B4_C - [15:0] */ | ||
3229 | #define WM8994_AIF1DAC2_EQ_B4_C_WIDTH 16 /* AIF1DAC2_EQ_B4_C - [15:0] */ | ||
3230 | |||
3231 | /* | ||
3232 | * R1200 (0x4B0) - AIF1 DAC2 EQ Band 4 PG | ||
3233 | */ | ||
3234 | #define WM8994_AIF1DAC2_EQ_B4_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B4_PG - [15:0] */ | ||
3235 | #define WM8994_AIF1DAC2_EQ_B4_PG_SHIFT 0 /* AIF1DAC2_EQ_B4_PG - [15:0] */ | ||
3236 | #define WM8994_AIF1DAC2_EQ_B4_PG_WIDTH 16 /* AIF1DAC2_EQ_B4_PG - [15:0] */ | ||
3237 | |||
3238 | /* | ||
3239 | * R1201 (0x4B1) - AIF1 DAC2 EQ Band 5 A | ||
3240 | */ | ||
3241 | #define WM8994_AIF1DAC2_EQ_B5_A_MASK 0xFFFF /* AIF1DAC2_EQ_B5_A - [15:0] */ | ||
3242 | #define WM8994_AIF1DAC2_EQ_B5_A_SHIFT 0 /* AIF1DAC2_EQ_B5_A - [15:0] */ | ||
3243 | #define WM8994_AIF1DAC2_EQ_B5_A_WIDTH 16 /* AIF1DAC2_EQ_B5_A - [15:0] */ | ||
3244 | |||
3245 | /* | ||
3246 | * R1202 (0x4B2) - AIF1 DAC2 EQ Band 5 B | ||
3247 | */ | ||
3248 | #define WM8994_AIF1DAC2_EQ_B5_B_MASK 0xFFFF /* AIF1DAC2_EQ_B5_B - [15:0] */ | ||
3249 | #define WM8994_AIF1DAC2_EQ_B5_B_SHIFT 0 /* AIF1DAC2_EQ_B5_B - [15:0] */ | ||
3250 | #define WM8994_AIF1DAC2_EQ_B5_B_WIDTH 16 /* AIF1DAC2_EQ_B5_B - [15:0] */ | ||
3251 | |||
3252 | /* | ||
3253 | * R1203 (0x4B3) - AIF1 DAC2 EQ Band 5 PG | ||
3254 | */ | ||
3255 | #define WM8994_AIF1DAC2_EQ_B5_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B5_PG - [15:0] */ | ||
3256 | #define WM8994_AIF1DAC2_EQ_B5_PG_SHIFT 0 /* AIF1DAC2_EQ_B5_PG - [15:0] */ | ||
3257 | #define WM8994_AIF1DAC2_EQ_B5_PG_WIDTH 16 /* AIF1DAC2_EQ_B5_PG - [15:0] */ | ||
3258 | |||
3259 | /* | ||
3260 | * R1280 (0x500) - AIF2 ADC Left Volume | ||
3261 | */ | ||
3262 | #define WM8994_AIF2ADC_VU 0x0100 /* AIF2ADC_VU */ | ||
3263 | #define WM8994_AIF2ADC_VU_MASK 0x0100 /* AIF2ADC_VU */ | ||
3264 | #define WM8994_AIF2ADC_VU_SHIFT 8 /* AIF2ADC_VU */ | ||
3265 | #define WM8994_AIF2ADC_VU_WIDTH 1 /* AIF2ADC_VU */ | ||
3266 | #define WM8994_AIF2ADCL_VOL_MASK 0x00FF /* AIF2ADCL_VOL - [7:0] */ | ||
3267 | #define WM8994_AIF2ADCL_VOL_SHIFT 0 /* AIF2ADCL_VOL - [7:0] */ | ||
3268 | #define WM8994_AIF2ADCL_VOL_WIDTH 8 /* AIF2ADCL_VOL - [7:0] */ | ||
3269 | |||
3270 | /* | ||
3271 | * R1281 (0x501) - AIF2 ADC Right Volume | ||
3272 | */ | ||
3273 | #define WM8994_AIF2ADC_VU 0x0100 /* AIF2ADC_VU */ | ||
3274 | #define WM8994_AIF2ADC_VU_MASK 0x0100 /* AIF2ADC_VU */ | ||
3275 | #define WM8994_AIF2ADC_VU_SHIFT 8 /* AIF2ADC_VU */ | ||
3276 | #define WM8994_AIF2ADC_VU_WIDTH 1 /* AIF2ADC_VU */ | ||
3277 | #define WM8994_AIF2ADCR_VOL_MASK 0x00FF /* AIF2ADCR_VOL - [7:0] */ | ||
3278 | #define WM8994_AIF2ADCR_VOL_SHIFT 0 /* AIF2ADCR_VOL - [7:0] */ | ||
3279 | #define WM8994_AIF2ADCR_VOL_WIDTH 8 /* AIF2ADCR_VOL - [7:0] */ | ||
3280 | |||
3281 | /* | ||
3282 | * R1282 (0x502) - AIF2 DAC Left Volume | ||
3283 | */ | ||
3284 | #define WM8994_AIF2DAC_VU 0x0100 /* AIF2DAC_VU */ | ||
3285 | #define WM8994_AIF2DAC_VU_MASK 0x0100 /* AIF2DAC_VU */ | ||
3286 | #define WM8994_AIF2DAC_VU_SHIFT 8 /* AIF2DAC_VU */ | ||
3287 | #define WM8994_AIF2DAC_VU_WIDTH 1 /* AIF2DAC_VU */ | ||
3288 | #define WM8994_AIF2DACL_VOL_MASK 0x00FF /* AIF2DACL_VOL - [7:0] */ | ||
3289 | #define WM8994_AIF2DACL_VOL_SHIFT 0 /* AIF2DACL_VOL - [7:0] */ | ||
3290 | #define WM8994_AIF2DACL_VOL_WIDTH 8 /* AIF2DACL_VOL - [7:0] */ | ||
3291 | |||
3292 | /* | ||
3293 | * R1283 (0x503) - AIF2 DAC Right Volume | ||
3294 | */ | ||
3295 | #define WM8994_AIF2DAC_VU 0x0100 /* AIF2DAC_VU */ | ||
3296 | #define WM8994_AIF2DAC_VU_MASK 0x0100 /* AIF2DAC_VU */ | ||
3297 | #define WM8994_AIF2DAC_VU_SHIFT 8 /* AIF2DAC_VU */ | ||
3298 | #define WM8994_AIF2DAC_VU_WIDTH 1 /* AIF2DAC_VU */ | ||
3299 | #define WM8994_AIF2DACR_VOL_MASK 0x00FF /* AIF2DACR_VOL - [7:0] */ | ||
3300 | #define WM8994_AIF2DACR_VOL_SHIFT 0 /* AIF2DACR_VOL - [7:0] */ | ||
3301 | #define WM8994_AIF2DACR_VOL_WIDTH 8 /* AIF2DACR_VOL - [7:0] */ | ||
3302 | |||
3303 | /* | ||
3304 | * R1296 (0x510) - AIF2 ADC Filters | ||
3305 | */ | ||
3306 | #define WM8994_AIF2ADC_4FS 0x8000 /* AIF2ADC_4FS */ | ||
3307 | #define WM8994_AIF2ADC_4FS_MASK 0x8000 /* AIF2ADC_4FS */ | ||
3308 | #define WM8994_AIF2ADC_4FS_SHIFT 15 /* AIF2ADC_4FS */ | ||
3309 | #define WM8994_AIF2ADC_4FS_WIDTH 1 /* AIF2ADC_4FS */ | ||
3310 | #define WM8994_AIF2ADC_HPF_CUT_MASK 0x6000 /* AIF2ADC_HPF_CUT - [14:13] */ | ||
3311 | #define WM8994_AIF2ADC_HPF_CUT_SHIFT 13 /* AIF2ADC_HPF_CUT - [14:13] */ | ||
3312 | #define WM8994_AIF2ADC_HPF_CUT_WIDTH 2 /* AIF2ADC_HPF_CUT - [14:13] */ | ||
3313 | #define WM8994_AIF2ADCL_HPF 0x1000 /* AIF2ADCL_HPF */ | ||
3314 | #define WM8994_AIF2ADCL_HPF_MASK 0x1000 /* AIF2ADCL_HPF */ | ||
3315 | #define WM8994_AIF2ADCL_HPF_SHIFT 12 /* AIF2ADCL_HPF */ | ||
3316 | #define WM8994_AIF2ADCL_HPF_WIDTH 1 /* AIF2ADCL_HPF */ | ||
3317 | #define WM8994_AIF2ADCR_HPF 0x0800 /* AIF2ADCR_HPF */ | ||
3318 | #define WM8994_AIF2ADCR_HPF_MASK 0x0800 /* AIF2ADCR_HPF */ | ||
3319 | #define WM8994_AIF2ADCR_HPF_SHIFT 11 /* AIF2ADCR_HPF */ | ||
3320 | #define WM8994_AIF2ADCR_HPF_WIDTH 1 /* AIF2ADCR_HPF */ | ||
3321 | |||
3322 | /* | ||
3323 | * R1312 (0x520) - AIF2 DAC Filters (1) | ||
3324 | */ | ||
3325 | #define WM8994_AIF2DAC_MUTE 0x0200 /* AIF2DAC_MUTE */ | ||
3326 | #define WM8994_AIF2DAC_MUTE_MASK 0x0200 /* AIF2DAC_MUTE */ | ||
3327 | #define WM8994_AIF2DAC_MUTE_SHIFT 9 /* AIF2DAC_MUTE */ | ||
3328 | #define WM8994_AIF2DAC_MUTE_WIDTH 1 /* AIF2DAC_MUTE */ | ||
3329 | #define WM8994_AIF2DAC_MONO 0x0080 /* AIF2DAC_MONO */ | ||
3330 | #define WM8994_AIF2DAC_MONO_MASK 0x0080 /* AIF2DAC_MONO */ | ||
3331 | #define WM8994_AIF2DAC_MONO_SHIFT 7 /* AIF2DAC_MONO */ | ||
3332 | #define WM8994_AIF2DAC_MONO_WIDTH 1 /* AIF2DAC_MONO */ | ||
3333 | #define WM8994_AIF2DAC_MUTERATE 0x0020 /* AIF2DAC_MUTERATE */ | ||
3334 | #define WM8994_AIF2DAC_MUTERATE_MASK 0x0020 /* AIF2DAC_MUTERATE */ | ||
3335 | #define WM8994_AIF2DAC_MUTERATE_SHIFT 5 /* AIF2DAC_MUTERATE */ | ||
3336 | #define WM8994_AIF2DAC_MUTERATE_WIDTH 1 /* AIF2DAC_MUTERATE */ | ||
3337 | #define WM8994_AIF2DAC_UNMUTE_RAMP 0x0010 /* AIF2DAC_UNMUTE_RAMP */ | ||
3338 | #define WM8994_AIF2DAC_UNMUTE_RAMP_MASK 0x0010 /* AIF2DAC_UNMUTE_RAMP */ | ||
3339 | #define WM8994_AIF2DAC_UNMUTE_RAMP_SHIFT 4 /* AIF2DAC_UNMUTE_RAMP */ | ||
3340 | #define WM8994_AIF2DAC_UNMUTE_RAMP_WIDTH 1 /* AIF2DAC_UNMUTE_RAMP */ | ||
3341 | #define WM8994_AIF2DAC_DEEMP_MASK 0x0006 /* AIF2DAC_DEEMP - [2:1] */ | ||
3342 | #define WM8994_AIF2DAC_DEEMP_SHIFT 1 /* AIF2DAC_DEEMP - [2:1] */ | ||
3343 | #define WM8994_AIF2DAC_DEEMP_WIDTH 2 /* AIF2DAC_DEEMP - [2:1] */ | ||
3344 | |||
3345 | /* | ||
3346 | * R1313 (0x521) - AIF2 DAC Filters (2) | ||
3347 | */ | ||
3348 | #define WM8994_AIF2DAC_3D_GAIN_MASK 0x3E00 /* AIF2DAC_3D_GAIN - [13:9] */ | ||
3349 | #define WM8994_AIF2DAC_3D_GAIN_SHIFT 9 /* AIF2DAC_3D_GAIN - [13:9] */ | ||
3350 | #define WM8994_AIF2DAC_3D_GAIN_WIDTH 5 /* AIF2DAC_3D_GAIN - [13:9] */ | ||
3351 | #define WM8994_AIF2DAC_3D_ENA 0x0100 /* AIF2DAC_3D_ENA */ | ||
3352 | #define WM8994_AIF2DAC_3D_ENA_MASK 0x0100 /* AIF2DAC_3D_ENA */ | ||
3353 | #define WM8994_AIF2DAC_3D_ENA_SHIFT 8 /* AIF2DAC_3D_ENA */ | ||
3354 | #define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */ | ||
3355 | |||
3356 | /* | ||
3357 | * R1344 (0x540) - AIF2 DRC (1) | ||
3358 | */ | ||
3359 | #define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */ | ||
3360 | #define WM8994_AIF2DRC_SIG_DET_RMS_SHIFT 11 /* AIF2DRC_SIG_DET_RMS - [15:11] */ | ||
3361 | #define WM8994_AIF2DRC_SIG_DET_RMS_WIDTH 5 /* AIF2DRC_SIG_DET_RMS - [15:11] */ | ||
3362 | #define WM8994_AIF2DRC_SIG_DET_PK_MASK 0x0600 /* AIF2DRC_SIG_DET_PK - [10:9] */ | ||
3363 | #define WM8994_AIF2DRC_SIG_DET_PK_SHIFT 9 /* AIF2DRC_SIG_DET_PK - [10:9] */ | ||
3364 | #define WM8994_AIF2DRC_SIG_DET_PK_WIDTH 2 /* AIF2DRC_SIG_DET_PK - [10:9] */ | ||
3365 | #define WM8994_AIF2DRC_NG_ENA 0x0100 /* AIF2DRC_NG_ENA */ | ||
3366 | #define WM8994_AIF2DRC_NG_ENA_MASK 0x0100 /* AIF2DRC_NG_ENA */ | ||
3367 | #define WM8994_AIF2DRC_NG_ENA_SHIFT 8 /* AIF2DRC_NG_ENA */ | ||
3368 | #define WM8994_AIF2DRC_NG_ENA_WIDTH 1 /* AIF2DRC_NG_ENA */ | ||
3369 | #define WM8994_AIF2DRC_SIG_DET_MODE 0x0080 /* AIF2DRC_SIG_DET_MODE */ | ||
3370 | #define WM8994_AIF2DRC_SIG_DET_MODE_MASK 0x0080 /* AIF2DRC_SIG_DET_MODE */ | ||
3371 | #define WM8994_AIF2DRC_SIG_DET_MODE_SHIFT 7 /* AIF2DRC_SIG_DET_MODE */ | ||
3372 | #define WM8994_AIF2DRC_SIG_DET_MODE_WIDTH 1 /* AIF2DRC_SIG_DET_MODE */ | ||
3373 | #define WM8994_AIF2DRC_SIG_DET 0x0040 /* AIF2DRC_SIG_DET */ | ||
3374 | #define WM8994_AIF2DRC_SIG_DET_MASK 0x0040 /* AIF2DRC_SIG_DET */ | ||
3375 | #define WM8994_AIF2DRC_SIG_DET_SHIFT 6 /* AIF2DRC_SIG_DET */ | ||
3376 | #define WM8994_AIF2DRC_SIG_DET_WIDTH 1 /* AIF2DRC_SIG_DET */ | ||
3377 | #define WM8994_AIF2DRC_KNEE2_OP_ENA 0x0020 /* AIF2DRC_KNEE2_OP_ENA */ | ||
3378 | #define WM8994_AIF2DRC_KNEE2_OP_ENA_MASK 0x0020 /* AIF2DRC_KNEE2_OP_ENA */ | ||
3379 | #define WM8994_AIF2DRC_KNEE2_OP_ENA_SHIFT 5 /* AIF2DRC_KNEE2_OP_ENA */ | ||
3380 | #define WM8994_AIF2DRC_KNEE2_OP_ENA_WIDTH 1 /* AIF2DRC_KNEE2_OP_ENA */ | ||
3381 | #define WM8994_AIF2DRC_QR 0x0010 /* AIF2DRC_QR */ | ||
3382 | #define WM8994_AIF2DRC_QR_MASK 0x0010 /* AIF2DRC_QR */ | ||
3383 | #define WM8994_AIF2DRC_QR_SHIFT 4 /* AIF2DRC_QR */ | ||
3384 | #define WM8994_AIF2DRC_QR_WIDTH 1 /* AIF2DRC_QR */ | ||
3385 | #define WM8994_AIF2DRC_ANTICLIP 0x0008 /* AIF2DRC_ANTICLIP */ | ||
3386 | #define WM8994_AIF2DRC_ANTICLIP_MASK 0x0008 /* AIF2DRC_ANTICLIP */ | ||
3387 | #define WM8994_AIF2DRC_ANTICLIP_SHIFT 3 /* AIF2DRC_ANTICLIP */ | ||
3388 | #define WM8994_AIF2DRC_ANTICLIP_WIDTH 1 /* AIF2DRC_ANTICLIP */ | ||
3389 | #define WM8994_AIF2DAC_DRC_ENA 0x0004 /* AIF2DAC_DRC_ENA */ | ||
3390 | #define WM8994_AIF2DAC_DRC_ENA_MASK 0x0004 /* AIF2DAC_DRC_ENA */ | ||
3391 | #define WM8994_AIF2DAC_DRC_ENA_SHIFT 2 /* AIF2DAC_DRC_ENA */ | ||
3392 | #define WM8994_AIF2DAC_DRC_ENA_WIDTH 1 /* AIF2DAC_DRC_ENA */ | ||
3393 | #define WM8994_AIF2ADCL_DRC_ENA 0x0002 /* AIF2ADCL_DRC_ENA */ | ||
3394 | #define WM8994_AIF2ADCL_DRC_ENA_MASK 0x0002 /* AIF2ADCL_DRC_ENA */ | ||
3395 | #define WM8994_AIF2ADCL_DRC_ENA_SHIFT 1 /* AIF2ADCL_DRC_ENA */ | ||
3396 | #define WM8994_AIF2ADCL_DRC_ENA_WIDTH 1 /* AIF2ADCL_DRC_ENA */ | ||
3397 | #define WM8994_AIF2ADCR_DRC_ENA 0x0001 /* AIF2ADCR_DRC_ENA */ | ||
3398 | #define WM8994_AIF2ADCR_DRC_ENA_MASK 0x0001 /* AIF2ADCR_DRC_ENA */ | ||
3399 | #define WM8994_AIF2ADCR_DRC_ENA_SHIFT 0 /* AIF2ADCR_DRC_ENA */ | ||
3400 | #define WM8994_AIF2ADCR_DRC_ENA_WIDTH 1 /* AIF2ADCR_DRC_ENA */ | ||
3401 | |||
3402 | /* | ||
3403 | * R1345 (0x541) - AIF2 DRC (2) | ||
3404 | */ | ||
3405 | #define WM8994_AIF2DRC_ATK_MASK 0x1E00 /* AIF2DRC_ATK - [12:9] */ | ||
3406 | #define WM8994_AIF2DRC_ATK_SHIFT 9 /* AIF2DRC_ATK - [12:9] */ | ||
3407 | #define WM8994_AIF2DRC_ATK_WIDTH 4 /* AIF2DRC_ATK - [12:9] */ | ||
3408 | #define WM8994_AIF2DRC_DCY_MASK 0x01E0 /* AIF2DRC_DCY - [8:5] */ | ||
3409 | #define WM8994_AIF2DRC_DCY_SHIFT 5 /* AIF2DRC_DCY - [8:5] */ | ||
3410 | #define WM8994_AIF2DRC_DCY_WIDTH 4 /* AIF2DRC_DCY - [8:5] */ | ||
3411 | #define WM8994_AIF2DRC_MINGAIN_MASK 0x001C /* AIF2DRC_MINGAIN - [4:2] */ | ||
3412 | #define WM8994_AIF2DRC_MINGAIN_SHIFT 2 /* AIF2DRC_MINGAIN - [4:2] */ | ||
3413 | #define WM8994_AIF2DRC_MINGAIN_WIDTH 3 /* AIF2DRC_MINGAIN - [4:2] */ | ||
3414 | #define WM8994_AIF2DRC_MAXGAIN_MASK 0x0003 /* AIF2DRC_MAXGAIN - [1:0] */ | ||
3415 | #define WM8994_AIF2DRC_MAXGAIN_SHIFT 0 /* AIF2DRC_MAXGAIN - [1:0] */ | ||
3416 | #define WM8994_AIF2DRC_MAXGAIN_WIDTH 2 /* AIF2DRC_MAXGAIN - [1:0] */ | ||
3417 | |||
3418 | /* | ||
3419 | * R1346 (0x542) - AIF2 DRC (3) | ||
3420 | */ | ||
3421 | #define WM8994_AIF2DRC_NG_MINGAIN_MASK 0xF000 /* AIF2DRC_NG_MINGAIN - [15:12] */ | ||
3422 | #define WM8994_AIF2DRC_NG_MINGAIN_SHIFT 12 /* AIF2DRC_NG_MINGAIN - [15:12] */ | ||
3423 | #define WM8994_AIF2DRC_NG_MINGAIN_WIDTH 4 /* AIF2DRC_NG_MINGAIN - [15:12] */ | ||
3424 | #define WM8994_AIF2DRC_NG_EXP_MASK 0x0C00 /* AIF2DRC_NG_EXP - [11:10] */ | ||
3425 | #define WM8994_AIF2DRC_NG_EXP_SHIFT 10 /* AIF2DRC_NG_EXP - [11:10] */ | ||
3426 | #define WM8994_AIF2DRC_NG_EXP_WIDTH 2 /* AIF2DRC_NG_EXP - [11:10] */ | ||
3427 | #define WM8994_AIF2DRC_QR_THR_MASK 0x0300 /* AIF2DRC_QR_THR - [9:8] */ | ||
3428 | #define WM8994_AIF2DRC_QR_THR_SHIFT 8 /* AIF2DRC_QR_THR - [9:8] */ | ||
3429 | #define WM8994_AIF2DRC_QR_THR_WIDTH 2 /* AIF2DRC_QR_THR - [9:8] */ | ||
3430 | #define WM8994_AIF2DRC_QR_DCY_MASK 0x00C0 /* AIF2DRC_QR_DCY - [7:6] */ | ||
3431 | #define WM8994_AIF2DRC_QR_DCY_SHIFT 6 /* AIF2DRC_QR_DCY - [7:6] */ | ||
3432 | #define WM8994_AIF2DRC_QR_DCY_WIDTH 2 /* AIF2DRC_QR_DCY - [7:6] */ | ||
3433 | #define WM8994_AIF2DRC_HI_COMP_MASK 0x0038 /* AIF2DRC_HI_COMP - [5:3] */ | ||
3434 | #define WM8994_AIF2DRC_HI_COMP_SHIFT 3 /* AIF2DRC_HI_COMP - [5:3] */ | ||
3435 | #define WM8994_AIF2DRC_HI_COMP_WIDTH 3 /* AIF2DRC_HI_COMP - [5:3] */ | ||
3436 | #define WM8994_AIF2DRC_LO_COMP_MASK 0x0007 /* AIF2DRC_LO_COMP - [2:0] */ | ||
3437 | #define WM8994_AIF2DRC_LO_COMP_SHIFT 0 /* AIF2DRC_LO_COMP - [2:0] */ | ||
3438 | #define WM8994_AIF2DRC_LO_COMP_WIDTH 3 /* AIF2DRC_LO_COMP - [2:0] */ | ||
3439 | |||
3440 | /* | ||
3441 | * R1347 (0x543) - AIF2 DRC (4) | ||
3442 | */ | ||
3443 | #define WM8994_AIF2DRC_KNEE_IP_MASK 0x07E0 /* AIF2DRC_KNEE_IP - [10:5] */ | ||
3444 | #define WM8994_AIF2DRC_KNEE_IP_SHIFT 5 /* AIF2DRC_KNEE_IP - [10:5] */ | ||
3445 | #define WM8994_AIF2DRC_KNEE_IP_WIDTH 6 /* AIF2DRC_KNEE_IP - [10:5] */ | ||
3446 | #define WM8994_AIF2DRC_KNEE_OP_MASK 0x001F /* AIF2DRC_KNEE_OP - [4:0] */ | ||
3447 | #define WM8994_AIF2DRC_KNEE_OP_SHIFT 0 /* AIF2DRC_KNEE_OP - [4:0] */ | ||
3448 | #define WM8994_AIF2DRC_KNEE_OP_WIDTH 5 /* AIF2DRC_KNEE_OP - [4:0] */ | ||
3449 | |||
3450 | /* | ||
3451 | * R1348 (0x544) - AIF2 DRC (5) | ||
3452 | */ | ||
3453 | #define WM8994_AIF2DRC_KNEE2_IP_MASK 0x03E0 /* AIF2DRC_KNEE2_IP - [9:5] */ | ||
3454 | #define WM8994_AIF2DRC_KNEE2_IP_SHIFT 5 /* AIF2DRC_KNEE2_IP - [9:5] */ | ||
3455 | #define WM8994_AIF2DRC_KNEE2_IP_WIDTH 5 /* AIF2DRC_KNEE2_IP - [9:5] */ | ||
3456 | #define WM8994_AIF2DRC_KNEE2_OP_MASK 0x001F /* AIF2DRC_KNEE2_OP - [4:0] */ | ||
3457 | #define WM8994_AIF2DRC_KNEE2_OP_SHIFT 0 /* AIF2DRC_KNEE2_OP - [4:0] */ | ||
3458 | #define WM8994_AIF2DRC_KNEE2_OP_WIDTH 5 /* AIF2DRC_KNEE2_OP - [4:0] */ | ||
3459 | |||
3460 | /* | ||
3461 | * R1408 (0x580) - AIF2 EQ Gains (1) | ||
3462 | */ | ||
3463 | #define WM8994_AIF2DAC_EQ_B1_GAIN_MASK 0xF800 /* AIF2DAC_EQ_B1_GAIN - [15:11] */ | ||
3464 | #define WM8994_AIF2DAC_EQ_B1_GAIN_SHIFT 11 /* AIF2DAC_EQ_B1_GAIN - [15:11] */ | ||
3465 | #define WM8994_AIF2DAC_EQ_B1_GAIN_WIDTH 5 /* AIF2DAC_EQ_B1_GAIN - [15:11] */ | ||
3466 | #define WM8994_AIF2DAC_EQ_B2_GAIN_MASK 0x07C0 /* AIF2DAC_EQ_B2_GAIN - [10:6] */ | ||
3467 | #define WM8994_AIF2DAC_EQ_B2_GAIN_SHIFT 6 /* AIF2DAC_EQ_B2_GAIN - [10:6] */ | ||
3468 | #define WM8994_AIF2DAC_EQ_B2_GAIN_WIDTH 5 /* AIF2DAC_EQ_B2_GAIN - [10:6] */ | ||
3469 | #define WM8994_AIF2DAC_EQ_B3_GAIN_MASK 0x003E /* AIF2DAC_EQ_B3_GAIN - [5:1] */ | ||
3470 | #define WM8994_AIF2DAC_EQ_B3_GAIN_SHIFT 1 /* AIF2DAC_EQ_B3_GAIN - [5:1] */ | ||
3471 | #define WM8994_AIF2DAC_EQ_B3_GAIN_WIDTH 5 /* AIF2DAC_EQ_B3_GAIN - [5:1] */ | ||
3472 | #define WM8994_AIF2DAC_EQ_ENA 0x0001 /* AIF2DAC_EQ_ENA */ | ||
3473 | #define WM8994_AIF2DAC_EQ_ENA_MASK 0x0001 /* AIF2DAC_EQ_ENA */ | ||
3474 | #define WM8994_AIF2DAC_EQ_ENA_SHIFT 0 /* AIF2DAC_EQ_ENA */ | ||
3475 | #define WM8994_AIF2DAC_EQ_ENA_WIDTH 1 /* AIF2DAC_EQ_ENA */ | ||
3476 | |||
3477 | /* | ||
3478 | * R1409 (0x581) - AIF2 EQ Gains (2) | ||
3479 | */ | ||
3480 | #define WM8994_AIF2DAC_EQ_B4_GAIN_MASK 0xF800 /* AIF2DAC_EQ_B4_GAIN - [15:11] */ | ||
3481 | #define WM8994_AIF2DAC_EQ_B4_GAIN_SHIFT 11 /* AIF2DAC_EQ_B4_GAIN - [15:11] */ | ||
3482 | #define WM8994_AIF2DAC_EQ_B4_GAIN_WIDTH 5 /* AIF2DAC_EQ_B4_GAIN - [15:11] */ | ||
3483 | #define WM8994_AIF2DAC_EQ_B5_GAIN_MASK 0x07C0 /* AIF2DAC_EQ_B5_GAIN - [10:6] */ | ||
3484 | #define WM8994_AIF2DAC_EQ_B5_GAIN_SHIFT 6 /* AIF2DAC_EQ_B5_GAIN - [10:6] */ | ||
3485 | #define WM8994_AIF2DAC_EQ_B5_GAIN_WIDTH 5 /* AIF2DAC_EQ_B5_GAIN - [10:6] */ | ||
3486 | |||
3487 | /* | ||
3488 | * R1410 (0x582) - AIF2 EQ Band 1 A | ||
3489 | */ | ||
3490 | #define WM8994_AIF2DAC_EQ_B1_A_MASK 0xFFFF /* AIF2DAC_EQ_B1_A - [15:0] */ | ||
3491 | #define WM8994_AIF2DAC_EQ_B1_A_SHIFT 0 /* AIF2DAC_EQ_B1_A - [15:0] */ | ||
3492 | #define WM8994_AIF2DAC_EQ_B1_A_WIDTH 16 /* AIF2DAC_EQ_B1_A - [15:0] */ | ||
3493 | |||
3494 | /* | ||
3495 | * R1411 (0x583) - AIF2 EQ Band 1 B | ||
3496 | */ | ||
3497 | #define WM8994_AIF2DAC_EQ_B1_B_MASK 0xFFFF /* AIF2DAC_EQ_B1_B - [15:0] */ | ||
3498 | #define WM8994_AIF2DAC_EQ_B1_B_SHIFT 0 /* AIF2DAC_EQ_B1_B - [15:0] */ | ||
3499 | #define WM8994_AIF2DAC_EQ_B1_B_WIDTH 16 /* AIF2DAC_EQ_B1_B - [15:0] */ | ||
3500 | |||
3501 | /* | ||
3502 | * R1412 (0x584) - AIF2 EQ Band 1 PG | ||
3503 | */ | ||
3504 | #define WM8994_AIF2DAC_EQ_B1_PG_MASK 0xFFFF /* AIF2DAC_EQ_B1_PG - [15:0] */ | ||
3505 | #define WM8994_AIF2DAC_EQ_B1_PG_SHIFT 0 /* AIF2DAC_EQ_B1_PG - [15:0] */ | ||
3506 | #define WM8994_AIF2DAC_EQ_B1_PG_WIDTH 16 /* AIF2DAC_EQ_B1_PG - [15:0] */ | ||
3507 | |||
3508 | /* | ||
3509 | * R1413 (0x585) - AIF2 EQ Band 2 A | ||
3510 | */ | ||
3511 | #define WM8994_AIF2DAC_EQ_B2_A_MASK 0xFFFF /* AIF2DAC_EQ_B2_A - [15:0] */ | ||
3512 | #define WM8994_AIF2DAC_EQ_B2_A_SHIFT 0 /* AIF2DAC_EQ_B2_A - [15:0] */ | ||
3513 | #define WM8994_AIF2DAC_EQ_B2_A_WIDTH 16 /* AIF2DAC_EQ_B2_A - [15:0] */ | ||
3514 | |||
3515 | /* | ||
3516 | * R1414 (0x586) - AIF2 EQ Band 2 B | ||
3517 | */ | ||
3518 | #define WM8994_AIF2DAC_EQ_B2_B_MASK 0xFFFF /* AIF2DAC_EQ_B2_B - [15:0] */ | ||
3519 | #define WM8994_AIF2DAC_EQ_B2_B_SHIFT 0 /* AIF2DAC_EQ_B2_B - [15:0] */ | ||
3520 | #define WM8994_AIF2DAC_EQ_B2_B_WIDTH 16 /* AIF2DAC_EQ_B2_B - [15:0] */ | ||
3521 | |||
3522 | /* | ||
3523 | * R1415 (0x587) - AIF2 EQ Band 2 C | ||
3524 | */ | ||
3525 | #define WM8994_AIF2DAC_EQ_B2_C_MASK 0xFFFF /* AIF2DAC_EQ_B2_C - [15:0] */ | ||
3526 | #define WM8994_AIF2DAC_EQ_B2_C_SHIFT 0 /* AIF2DAC_EQ_B2_C - [15:0] */ | ||
3527 | #define WM8994_AIF2DAC_EQ_B2_C_WIDTH 16 /* AIF2DAC_EQ_B2_C - [15:0] */ | ||
3528 | |||
3529 | /* | ||
3530 | * R1416 (0x588) - AIF2 EQ Band 2 PG | ||
3531 | */ | ||
3532 | #define WM8994_AIF2DAC_EQ_B2_PG_MASK 0xFFFF /* AIF2DAC_EQ_B2_PG - [15:0] */ | ||
3533 | #define WM8994_AIF2DAC_EQ_B2_PG_SHIFT 0 /* AIF2DAC_EQ_B2_PG - [15:0] */ | ||
3534 | #define WM8994_AIF2DAC_EQ_B2_PG_WIDTH 16 /* AIF2DAC_EQ_B2_PG - [15:0] */ | ||
3535 | |||
3536 | /* | ||
3537 | * R1417 (0x589) - AIF2 EQ Band 3 A | ||
3538 | */ | ||
3539 | #define WM8994_AIF2DAC_EQ_B3_A_MASK 0xFFFF /* AIF2DAC_EQ_B3_A - [15:0] */ | ||
3540 | #define WM8994_AIF2DAC_EQ_B3_A_SHIFT 0 /* AIF2DAC_EQ_B3_A - [15:0] */ | ||
3541 | #define WM8994_AIF2DAC_EQ_B3_A_WIDTH 16 /* AIF2DAC_EQ_B3_A - [15:0] */ | ||
3542 | |||
3543 | /* | ||
3544 | * R1418 (0x58A) - AIF2 EQ Band 3 B | ||
3545 | */ | ||
3546 | #define WM8994_AIF2DAC_EQ_B3_B_MASK 0xFFFF /* AIF2DAC_EQ_B3_B - [15:0] */ | ||
3547 | #define WM8994_AIF2DAC_EQ_B3_B_SHIFT 0 /* AIF2DAC_EQ_B3_B - [15:0] */ | ||
3548 | #define WM8994_AIF2DAC_EQ_B3_B_WIDTH 16 /* AIF2DAC_EQ_B3_B - [15:0] */ | ||
3549 | |||
3550 | /* | ||
3551 | * R1419 (0x58B) - AIF2 EQ Band 3 C | ||
3552 | */ | ||
3553 | #define WM8994_AIF2DAC_EQ_B3_C_MASK 0xFFFF /* AIF2DAC_EQ_B3_C - [15:0] */ | ||
3554 | #define WM8994_AIF2DAC_EQ_B3_C_SHIFT 0 /* AIF2DAC_EQ_B3_C - [15:0] */ | ||
3555 | #define WM8994_AIF2DAC_EQ_B3_C_WIDTH 16 /* AIF2DAC_EQ_B3_C - [15:0] */ | ||
3556 | |||
3557 | /* | ||
3558 | * R1420 (0x58C) - AIF2 EQ Band 3 PG | ||
3559 | */ | ||
3560 | #define WM8994_AIF2DAC_EQ_B3_PG_MASK 0xFFFF /* AIF2DAC_EQ_B3_PG - [15:0] */ | ||
3561 | #define WM8994_AIF2DAC_EQ_B3_PG_SHIFT 0 /* AIF2DAC_EQ_B3_PG - [15:0] */ | ||
3562 | #define WM8994_AIF2DAC_EQ_B3_PG_WIDTH 16 /* AIF2DAC_EQ_B3_PG - [15:0] */ | ||
3563 | |||
3564 | /* | ||
3565 | * R1421 (0x58D) - AIF2 EQ Band 4 A | ||
3566 | */ | ||
3567 | #define WM8994_AIF2DAC_EQ_B4_A_MASK 0xFFFF /* AIF2DAC_EQ_B4_A - [15:0] */ | ||
3568 | #define WM8994_AIF2DAC_EQ_B4_A_SHIFT 0 /* AIF2DAC_EQ_B4_A - [15:0] */ | ||
3569 | #define WM8994_AIF2DAC_EQ_B4_A_WIDTH 16 /* AIF2DAC_EQ_B4_A - [15:0] */ | ||
3570 | |||
3571 | /* | ||
3572 | * R1422 (0x58E) - AIF2 EQ Band 4 B | ||
3573 | */ | ||
3574 | #define WM8994_AIF2DAC_EQ_B4_B_MASK 0xFFFF /* AIF2DAC_EQ_B4_B - [15:0] */ | ||
3575 | #define WM8994_AIF2DAC_EQ_B4_B_SHIFT 0 /* AIF2DAC_EQ_B4_B - [15:0] */ | ||
3576 | #define WM8994_AIF2DAC_EQ_B4_B_WIDTH 16 /* AIF2DAC_EQ_B4_B - [15:0] */ | ||
3577 | |||
3578 | /* | ||
3579 | * R1423 (0x58F) - AIF2 EQ Band 4 C | ||
3580 | */ | ||
3581 | #define WM8994_AIF2DAC_EQ_B4_C_MASK 0xFFFF /* AIF2DAC_EQ_B4_C - [15:0] */ | ||
3582 | #define WM8994_AIF2DAC_EQ_B4_C_SHIFT 0 /* AIF2DAC_EQ_B4_C - [15:0] */ | ||
3583 | #define WM8994_AIF2DAC_EQ_B4_C_WIDTH 16 /* AIF2DAC_EQ_B4_C - [15:0] */ | ||
3584 | |||
3585 | /* | ||
3586 | * R1424 (0x590) - AIF2 EQ Band 4 PG | ||
3587 | */ | ||
3588 | #define WM8994_AIF2DAC_EQ_B4_PG_MASK 0xFFFF /* AIF2DAC_EQ_B4_PG - [15:0] */ | ||
3589 | #define WM8994_AIF2DAC_EQ_B4_PG_SHIFT 0 /* AIF2DAC_EQ_B4_PG - [15:0] */ | ||
3590 | #define WM8994_AIF2DAC_EQ_B4_PG_WIDTH 16 /* AIF2DAC_EQ_B4_PG - [15:0] */ | ||
3591 | |||
3592 | /* | ||
3593 | * R1425 (0x591) - AIF2 EQ Band 5 A | ||
3594 | */ | ||
3595 | #define WM8994_AIF2DAC_EQ_B5_A_MASK 0xFFFF /* AIF2DAC_EQ_B5_A - [15:0] */ | ||
3596 | #define WM8994_AIF2DAC_EQ_B5_A_SHIFT 0 /* AIF2DAC_EQ_B5_A - [15:0] */ | ||
3597 | #define WM8994_AIF2DAC_EQ_B5_A_WIDTH 16 /* AIF2DAC_EQ_B5_A - [15:0] */ | ||
3598 | |||
3599 | /* | ||
3600 | * R1426 (0x592) - AIF2 EQ Band 5 B | ||
3601 | */ | ||
3602 | #define WM8994_AIF2DAC_EQ_B5_B_MASK 0xFFFF /* AIF2DAC_EQ_B5_B - [15:0] */ | ||
3603 | #define WM8994_AIF2DAC_EQ_B5_B_SHIFT 0 /* AIF2DAC_EQ_B5_B - [15:0] */ | ||
3604 | #define WM8994_AIF2DAC_EQ_B5_B_WIDTH 16 /* AIF2DAC_EQ_B5_B - [15:0] */ | ||
3605 | |||
3606 | /* | ||
3607 | * R1427 (0x593) - AIF2 EQ Band 5 PG | ||
3608 | */ | ||
3609 | #define WM8994_AIF2DAC_EQ_B5_PG_MASK 0xFFFF /* AIF2DAC_EQ_B5_PG - [15:0] */ | ||
3610 | #define WM8994_AIF2DAC_EQ_B5_PG_SHIFT 0 /* AIF2DAC_EQ_B5_PG - [15:0] */ | ||
3611 | #define WM8994_AIF2DAC_EQ_B5_PG_WIDTH 16 /* AIF2DAC_EQ_B5_PG - [15:0] */ | ||
3612 | |||
3613 | /* | ||
3614 | * R1536 (0x600) - DAC1 Mixer Volumes | ||
3615 | */ | ||
3616 | #define WM8994_ADCR_DAC1_VOL_MASK 0x01E0 /* ADCR_DAC1_VOL - [8:5] */ | ||
3617 | #define WM8994_ADCR_DAC1_VOL_SHIFT 5 /* ADCR_DAC1_VOL - [8:5] */ | ||
3618 | #define WM8994_ADCR_DAC1_VOL_WIDTH 4 /* ADCR_DAC1_VOL - [8:5] */ | ||
3619 | #define WM8994_ADCL_DAC1_VOL_MASK 0x000F /* ADCL_DAC1_VOL - [3:0] */ | ||
3620 | #define WM8994_ADCL_DAC1_VOL_SHIFT 0 /* ADCL_DAC1_VOL - [3:0] */ | ||
3621 | #define WM8994_ADCL_DAC1_VOL_WIDTH 4 /* ADCL_DAC1_VOL - [3:0] */ | ||
3622 | |||
3623 | /* | ||
3624 | * R1537 (0x601) - DAC1 Left Mixer Routing | ||
3625 | */ | ||
3626 | #define WM8994_ADCR_TO_DAC1L 0x0020 /* ADCR_TO_DAC1L */ | ||
3627 | #define WM8994_ADCR_TO_DAC1L_MASK 0x0020 /* ADCR_TO_DAC1L */ | ||
3628 | #define WM8994_ADCR_TO_DAC1L_SHIFT 5 /* ADCR_TO_DAC1L */ | ||
3629 | #define WM8994_ADCR_TO_DAC1L_WIDTH 1 /* ADCR_TO_DAC1L */ | ||
3630 | #define WM8994_ADCL_TO_DAC1L 0x0010 /* ADCL_TO_DAC1L */ | ||
3631 | #define WM8994_ADCL_TO_DAC1L_MASK 0x0010 /* ADCL_TO_DAC1L */ | ||
3632 | #define WM8994_ADCL_TO_DAC1L_SHIFT 4 /* ADCL_TO_DAC1L */ | ||
3633 | #define WM8994_ADCL_TO_DAC1L_WIDTH 1 /* ADCL_TO_DAC1L */ | ||
3634 | #define WM8994_AIF2DACL_TO_DAC1L 0x0004 /* AIF2DACL_TO_DAC1L */ | ||
3635 | #define WM8994_AIF2DACL_TO_DAC1L_MASK 0x0004 /* AIF2DACL_TO_DAC1L */ | ||
3636 | #define WM8994_AIF2DACL_TO_DAC1L_SHIFT 2 /* AIF2DACL_TO_DAC1L */ | ||
3637 | #define WM8994_AIF2DACL_TO_DAC1L_WIDTH 1 /* AIF2DACL_TO_DAC1L */ | ||
3638 | #define WM8994_AIF1DAC2L_TO_DAC1L 0x0002 /* AIF1DAC2L_TO_DAC1L */ | ||
3639 | #define WM8994_AIF1DAC2L_TO_DAC1L_MASK 0x0002 /* AIF1DAC2L_TO_DAC1L */ | ||
3640 | #define WM8994_AIF1DAC2L_TO_DAC1L_SHIFT 1 /* AIF1DAC2L_TO_DAC1L */ | ||
3641 | #define WM8994_AIF1DAC2L_TO_DAC1L_WIDTH 1 /* AIF1DAC2L_TO_DAC1L */ | ||
3642 | #define WM8994_AIF1DAC1L_TO_DAC1L 0x0001 /* AIF1DAC1L_TO_DAC1L */ | ||
3643 | #define WM8994_AIF1DAC1L_TO_DAC1L_MASK 0x0001 /* AIF1DAC1L_TO_DAC1L */ | ||
3644 | #define WM8994_AIF1DAC1L_TO_DAC1L_SHIFT 0 /* AIF1DAC1L_TO_DAC1L */ | ||
3645 | #define WM8994_AIF1DAC1L_TO_DAC1L_WIDTH 1 /* AIF1DAC1L_TO_DAC1L */ | ||
3646 | |||
3647 | /* | ||
3648 | * R1538 (0x602) - DAC1 Right Mixer Routing | ||
3649 | */ | ||
3650 | #define WM8994_ADCR_TO_DAC1R 0x0020 /* ADCR_TO_DAC1R */ | ||
3651 | #define WM8994_ADCR_TO_DAC1R_MASK 0x0020 /* ADCR_TO_DAC1R */ | ||
3652 | #define WM8994_ADCR_TO_DAC1R_SHIFT 5 /* ADCR_TO_DAC1R */ | ||
3653 | #define WM8994_ADCR_TO_DAC1R_WIDTH 1 /* ADCR_TO_DAC1R */ | ||
3654 | #define WM8994_ADCL_TO_DAC1R 0x0010 /* ADCL_TO_DAC1R */ | ||
3655 | #define WM8994_ADCL_TO_DAC1R_MASK 0x0010 /* ADCL_TO_DAC1R */ | ||
3656 | #define WM8994_ADCL_TO_DAC1R_SHIFT 4 /* ADCL_TO_DAC1R */ | ||
3657 | #define WM8994_ADCL_TO_DAC1R_WIDTH 1 /* ADCL_TO_DAC1R */ | ||
3658 | #define WM8994_AIF2DACR_TO_DAC1R 0x0004 /* AIF2DACR_TO_DAC1R */ | ||
3659 | #define WM8994_AIF2DACR_TO_DAC1R_MASK 0x0004 /* AIF2DACR_TO_DAC1R */ | ||
3660 | #define WM8994_AIF2DACR_TO_DAC1R_SHIFT 2 /* AIF2DACR_TO_DAC1R */ | ||
3661 | #define WM8994_AIF2DACR_TO_DAC1R_WIDTH 1 /* AIF2DACR_TO_DAC1R */ | ||
3662 | #define WM8994_AIF1DAC2R_TO_DAC1R 0x0002 /* AIF1DAC2R_TO_DAC1R */ | ||
3663 | #define WM8994_AIF1DAC2R_TO_DAC1R_MASK 0x0002 /* AIF1DAC2R_TO_DAC1R */ | ||
3664 | #define WM8994_AIF1DAC2R_TO_DAC1R_SHIFT 1 /* AIF1DAC2R_TO_DAC1R */ | ||
3665 | #define WM8994_AIF1DAC2R_TO_DAC1R_WIDTH 1 /* AIF1DAC2R_TO_DAC1R */ | ||
3666 | #define WM8994_AIF1DAC1R_TO_DAC1R 0x0001 /* AIF1DAC1R_TO_DAC1R */ | ||
3667 | #define WM8994_AIF1DAC1R_TO_DAC1R_MASK 0x0001 /* AIF1DAC1R_TO_DAC1R */ | ||
3668 | #define WM8994_AIF1DAC1R_TO_DAC1R_SHIFT 0 /* AIF1DAC1R_TO_DAC1R */ | ||
3669 | #define WM8994_AIF1DAC1R_TO_DAC1R_WIDTH 1 /* AIF1DAC1R_TO_DAC1R */ | ||
3670 | |||
3671 | /* | ||
3672 | * R1539 (0x603) - DAC2 Mixer Volumes | ||
3673 | */ | ||
3674 | #define WM8994_ADCR_DAC2_VOL_MASK 0x01E0 /* ADCR_DAC2_VOL - [8:5] */ | ||
3675 | #define WM8994_ADCR_DAC2_VOL_SHIFT 5 /* ADCR_DAC2_VOL - [8:5] */ | ||
3676 | #define WM8994_ADCR_DAC2_VOL_WIDTH 4 /* ADCR_DAC2_VOL - [8:5] */ | ||
3677 | #define WM8994_ADCL_DAC2_VOL_MASK 0x000F /* ADCL_DAC2_VOL - [3:0] */ | ||
3678 | #define WM8994_ADCL_DAC2_VOL_SHIFT 0 /* ADCL_DAC2_VOL - [3:0] */ | ||
3679 | #define WM8994_ADCL_DAC2_VOL_WIDTH 4 /* ADCL_DAC2_VOL - [3:0] */ | ||
3680 | |||
3681 | /* | ||
3682 | * R1540 (0x604) - DAC2 Left Mixer Routing | ||
3683 | */ | ||
3684 | #define WM8994_ADCR_TO_DAC2L 0x0020 /* ADCR_TO_DAC2L */ | ||
3685 | #define WM8994_ADCR_TO_DAC2L_MASK 0x0020 /* ADCR_TO_DAC2L */ | ||
3686 | #define WM8994_ADCR_TO_DAC2L_SHIFT 5 /* ADCR_TO_DAC2L */ | ||
3687 | #define WM8994_ADCR_TO_DAC2L_WIDTH 1 /* ADCR_TO_DAC2L */ | ||
3688 | #define WM8994_ADCL_TO_DAC2L 0x0010 /* ADCL_TO_DAC2L */ | ||
3689 | #define WM8994_ADCL_TO_DAC2L_MASK 0x0010 /* ADCL_TO_DAC2L */ | ||
3690 | #define WM8994_ADCL_TO_DAC2L_SHIFT 4 /* ADCL_TO_DAC2L */ | ||
3691 | #define WM8994_ADCL_TO_DAC2L_WIDTH 1 /* ADCL_TO_DAC2L */ | ||
3692 | #define WM8994_AIF2DACL_TO_DAC2L 0x0004 /* AIF2DACL_TO_DAC2L */ | ||
3693 | #define WM8994_AIF2DACL_TO_DAC2L_MASK 0x0004 /* AIF2DACL_TO_DAC2L */ | ||
3694 | #define WM8994_AIF2DACL_TO_DAC2L_SHIFT 2 /* AIF2DACL_TO_DAC2L */ | ||
3695 | #define WM8994_AIF2DACL_TO_DAC2L_WIDTH 1 /* AIF2DACL_TO_DAC2L */ | ||
3696 | #define WM8994_AIF1DAC2L_TO_DAC2L 0x0002 /* AIF1DAC2L_TO_DAC2L */ | ||
3697 | #define WM8994_AIF1DAC2L_TO_DAC2L_MASK 0x0002 /* AIF1DAC2L_TO_DAC2L */ | ||
3698 | #define WM8994_AIF1DAC2L_TO_DAC2L_SHIFT 1 /* AIF1DAC2L_TO_DAC2L */ | ||
3699 | #define WM8994_AIF1DAC2L_TO_DAC2L_WIDTH 1 /* AIF1DAC2L_TO_DAC2L */ | ||
3700 | #define WM8994_AIF1DAC1L_TO_DAC2L 0x0001 /* AIF1DAC1L_TO_DAC2L */ | ||
3701 | #define WM8994_AIF1DAC1L_TO_DAC2L_MASK 0x0001 /* AIF1DAC1L_TO_DAC2L */ | ||
3702 | #define WM8994_AIF1DAC1L_TO_DAC2L_SHIFT 0 /* AIF1DAC1L_TO_DAC2L */ | ||
3703 | #define WM8994_AIF1DAC1L_TO_DAC2L_WIDTH 1 /* AIF1DAC1L_TO_DAC2L */ | ||
3704 | |||
3705 | /* | ||
3706 | * R1541 (0x605) - DAC2 Right Mixer Routing | ||
3707 | */ | ||
3708 | #define WM8994_ADCR_TO_DAC2R 0x0020 /* ADCR_TO_DAC2R */ | ||
3709 | #define WM8994_ADCR_TO_DAC2R_MASK 0x0020 /* ADCR_TO_DAC2R */ | ||
3710 | #define WM8994_ADCR_TO_DAC2R_SHIFT 5 /* ADCR_TO_DAC2R */ | ||
3711 | #define WM8994_ADCR_TO_DAC2R_WIDTH 1 /* ADCR_TO_DAC2R */ | ||
3712 | #define WM8994_ADCL_TO_DAC2R 0x0010 /* ADCL_TO_DAC2R */ | ||
3713 | #define WM8994_ADCL_TO_DAC2R_MASK 0x0010 /* ADCL_TO_DAC2R */ | ||
3714 | #define WM8994_ADCL_TO_DAC2R_SHIFT 4 /* ADCL_TO_DAC2R */ | ||
3715 | #define WM8994_ADCL_TO_DAC2R_WIDTH 1 /* ADCL_TO_DAC2R */ | ||
3716 | #define WM8994_AIF2DACR_TO_DAC2R 0x0004 /* AIF2DACR_TO_DAC2R */ | ||
3717 | #define WM8994_AIF2DACR_TO_DAC2R_MASK 0x0004 /* AIF2DACR_TO_DAC2R */ | ||
3718 | #define WM8994_AIF2DACR_TO_DAC2R_SHIFT 2 /* AIF2DACR_TO_DAC2R */ | ||
3719 | #define WM8994_AIF2DACR_TO_DAC2R_WIDTH 1 /* AIF2DACR_TO_DAC2R */ | ||
3720 | #define WM8994_AIF1DAC2R_TO_DAC2R 0x0002 /* AIF1DAC2R_TO_DAC2R */ | ||
3721 | #define WM8994_AIF1DAC2R_TO_DAC2R_MASK 0x0002 /* AIF1DAC2R_TO_DAC2R */ | ||
3722 | #define WM8994_AIF1DAC2R_TO_DAC2R_SHIFT 1 /* AIF1DAC2R_TO_DAC2R */ | ||
3723 | #define WM8994_AIF1DAC2R_TO_DAC2R_WIDTH 1 /* AIF1DAC2R_TO_DAC2R */ | ||
3724 | #define WM8994_AIF1DAC1R_TO_DAC2R 0x0001 /* AIF1DAC1R_TO_DAC2R */ | ||
3725 | #define WM8994_AIF1DAC1R_TO_DAC2R_MASK 0x0001 /* AIF1DAC1R_TO_DAC2R */ | ||
3726 | #define WM8994_AIF1DAC1R_TO_DAC2R_SHIFT 0 /* AIF1DAC1R_TO_DAC2R */ | ||
3727 | #define WM8994_AIF1DAC1R_TO_DAC2R_WIDTH 1 /* AIF1DAC1R_TO_DAC2R */ | ||
3728 | |||
3729 | /* | ||
3730 | * R1542 (0x606) - AIF1 ADC1 Left Mixer Routing | ||
3731 | */ | ||
3732 | #define WM8994_ADC1L_TO_AIF1ADC1L 0x0002 /* ADC1L_TO_AIF1ADC1L */ | ||
3733 | #define WM8994_ADC1L_TO_AIF1ADC1L_MASK 0x0002 /* ADC1L_TO_AIF1ADC1L */ | ||
3734 | #define WM8994_ADC1L_TO_AIF1ADC1L_SHIFT 1 /* ADC1L_TO_AIF1ADC1L */ | ||
3735 | #define WM8994_ADC1L_TO_AIF1ADC1L_WIDTH 1 /* ADC1L_TO_AIF1ADC1L */ | ||
3736 | #define WM8994_AIF2DACL_TO_AIF1ADC1L 0x0001 /* AIF2DACL_TO_AIF1ADC1L */ | ||
3737 | #define WM8994_AIF2DACL_TO_AIF1ADC1L_MASK 0x0001 /* AIF2DACL_TO_AIF1ADC1L */ | ||
3738 | #define WM8994_AIF2DACL_TO_AIF1ADC1L_SHIFT 0 /* AIF2DACL_TO_AIF1ADC1L */ | ||
3739 | #define WM8994_AIF2DACL_TO_AIF1ADC1L_WIDTH 1 /* AIF2DACL_TO_AIF1ADC1L */ | ||
3740 | |||
3741 | /* | ||
3742 | * R1543 (0x607) - AIF1 ADC1 Right Mixer Routing | ||
3743 | */ | ||
3744 | #define WM8994_ADC1R_TO_AIF1ADC1R 0x0002 /* ADC1R_TO_AIF1ADC1R */ | ||
3745 | #define WM8994_ADC1R_TO_AIF1ADC1R_MASK 0x0002 /* ADC1R_TO_AIF1ADC1R */ | ||
3746 | #define WM8994_ADC1R_TO_AIF1ADC1R_SHIFT 1 /* ADC1R_TO_AIF1ADC1R */ | ||
3747 | #define WM8994_ADC1R_TO_AIF1ADC1R_WIDTH 1 /* ADC1R_TO_AIF1ADC1R */ | ||
3748 | #define WM8994_AIF2DACR_TO_AIF1ADC1R 0x0001 /* AIF2DACR_TO_AIF1ADC1R */ | ||
3749 | #define WM8994_AIF2DACR_TO_AIF1ADC1R_MASK 0x0001 /* AIF2DACR_TO_AIF1ADC1R */ | ||
3750 | #define WM8994_AIF2DACR_TO_AIF1ADC1R_SHIFT 0 /* AIF2DACR_TO_AIF1ADC1R */ | ||
3751 | #define WM8994_AIF2DACR_TO_AIF1ADC1R_WIDTH 1 /* AIF2DACR_TO_AIF1ADC1R */ | ||
3752 | |||
3753 | /* | ||
3754 | * R1544 (0x608) - AIF1 ADC2 Left Mixer Routing | ||
3755 | */ | ||
3756 | #define WM8994_ADC2L_TO_AIF1ADC2L 0x0002 /* ADC2L_TO_AIF1ADC2L */ | ||
3757 | #define WM8994_ADC2L_TO_AIF1ADC2L_MASK 0x0002 /* ADC2L_TO_AIF1ADC2L */ | ||
3758 | #define WM8994_ADC2L_TO_AIF1ADC2L_SHIFT 1 /* ADC2L_TO_AIF1ADC2L */ | ||
3759 | #define WM8994_ADC2L_TO_AIF1ADC2L_WIDTH 1 /* ADC2L_TO_AIF1ADC2L */ | ||
3760 | #define WM8994_AIF2DACL_TO_AIF1ADC2L 0x0001 /* AIF2DACL_TO_AIF1ADC2L */ | ||
3761 | #define WM8994_AIF2DACL_TO_AIF1ADC2L_MASK 0x0001 /* AIF2DACL_TO_AIF1ADC2L */ | ||
3762 | #define WM8994_AIF2DACL_TO_AIF1ADC2L_SHIFT 0 /* AIF2DACL_TO_AIF1ADC2L */ | ||
3763 | #define WM8994_AIF2DACL_TO_AIF1ADC2L_WIDTH 1 /* AIF2DACL_TO_AIF1ADC2L */ | ||
3764 | |||
3765 | /* | ||
3766 | * R1545 (0x609) - AIF1 ADC2 Right mixer Routing | ||
3767 | */ | ||
3768 | #define WM8994_ADC2R_TO_AIF1ADC2R 0x0002 /* ADC2R_TO_AIF1ADC2R */ | ||
3769 | #define WM8994_ADC2R_TO_AIF1ADC2R_MASK 0x0002 /* ADC2R_TO_AIF1ADC2R */ | ||
3770 | #define WM8994_ADC2R_TO_AIF1ADC2R_SHIFT 1 /* ADC2R_TO_AIF1ADC2R */ | ||
3771 | #define WM8994_ADC2R_TO_AIF1ADC2R_WIDTH 1 /* ADC2R_TO_AIF1ADC2R */ | ||
3772 | #define WM8994_AIF2DACR_TO_AIF1ADC2R 0x0001 /* AIF2DACR_TO_AIF1ADC2R */ | ||
3773 | #define WM8994_AIF2DACR_TO_AIF1ADC2R_MASK 0x0001 /* AIF2DACR_TO_AIF1ADC2R */ | ||
3774 | #define WM8994_AIF2DACR_TO_AIF1ADC2R_SHIFT 0 /* AIF2DACR_TO_AIF1ADC2R */ | ||
3775 | #define WM8994_AIF2DACR_TO_AIF1ADC2R_WIDTH 1 /* AIF2DACR_TO_AIF1ADC2R */ | ||
3776 | |||
3777 | /* | ||
3778 | * R1552 (0x610) - DAC1 Left Volume | ||
3779 | */ | ||
3780 | #define WM8994_DAC1L_MUTE 0x0200 /* DAC1L_MUTE */ | ||
3781 | #define WM8994_DAC1L_MUTE_MASK 0x0200 /* DAC1L_MUTE */ | ||
3782 | #define WM8994_DAC1L_MUTE_SHIFT 9 /* DAC1L_MUTE */ | ||
3783 | #define WM8994_DAC1L_MUTE_WIDTH 1 /* DAC1L_MUTE */ | ||
3784 | #define WM8994_DAC1_VU 0x0100 /* DAC1_VU */ | ||
3785 | #define WM8994_DAC1_VU_MASK 0x0100 /* DAC1_VU */ | ||
3786 | #define WM8994_DAC1_VU_SHIFT 8 /* DAC1_VU */ | ||
3787 | #define WM8994_DAC1_VU_WIDTH 1 /* DAC1_VU */ | ||
3788 | #define WM8994_DAC1L_VOL_MASK 0x00FF /* DAC1L_VOL - [7:0] */ | ||
3789 | #define WM8994_DAC1L_VOL_SHIFT 0 /* DAC1L_VOL - [7:0] */ | ||
3790 | #define WM8994_DAC1L_VOL_WIDTH 8 /* DAC1L_VOL - [7:0] */ | ||
3791 | |||
3792 | /* | ||
3793 | * R1553 (0x611) - DAC1 Right Volume | ||
3794 | */ | ||
3795 | #define WM8994_DAC1R_MUTE 0x0200 /* DAC1R_MUTE */ | ||
3796 | #define WM8994_DAC1R_MUTE_MASK 0x0200 /* DAC1R_MUTE */ | ||
3797 | #define WM8994_DAC1R_MUTE_SHIFT 9 /* DAC1R_MUTE */ | ||
3798 | #define WM8994_DAC1R_MUTE_WIDTH 1 /* DAC1R_MUTE */ | ||
3799 | #define WM8994_DAC1_VU 0x0100 /* DAC1_VU */ | ||
3800 | #define WM8994_DAC1_VU_MASK 0x0100 /* DAC1_VU */ | ||
3801 | #define WM8994_DAC1_VU_SHIFT 8 /* DAC1_VU */ | ||
3802 | #define WM8994_DAC1_VU_WIDTH 1 /* DAC1_VU */ | ||
3803 | #define WM8994_DAC1R_VOL_MASK 0x00FF /* DAC1R_VOL - [7:0] */ | ||
3804 | #define WM8994_DAC1R_VOL_SHIFT 0 /* DAC1R_VOL - [7:0] */ | ||
3805 | #define WM8994_DAC1R_VOL_WIDTH 8 /* DAC1R_VOL - [7:0] */ | ||
3806 | |||
3807 | /* | ||
3808 | * R1554 (0x612) - DAC2 Left Volume | ||
3809 | */ | ||
3810 | #define WM8994_DAC2L_MUTE 0x0200 /* DAC2L_MUTE */ | ||
3811 | #define WM8994_DAC2L_MUTE_MASK 0x0200 /* DAC2L_MUTE */ | ||
3812 | #define WM8994_DAC2L_MUTE_SHIFT 9 /* DAC2L_MUTE */ | ||
3813 | #define WM8994_DAC2L_MUTE_WIDTH 1 /* DAC2L_MUTE */ | ||
3814 | #define WM8994_DAC2_VU 0x0100 /* DAC2_VU */ | ||
3815 | #define WM8994_DAC2_VU_MASK 0x0100 /* DAC2_VU */ | ||
3816 | #define WM8994_DAC2_VU_SHIFT 8 /* DAC2_VU */ | ||
3817 | #define WM8994_DAC2_VU_WIDTH 1 /* DAC2_VU */ | ||
3818 | #define WM8994_DAC2L_VOL_MASK 0x00FF /* DAC2L_VOL - [7:0] */ | ||
3819 | #define WM8994_DAC2L_VOL_SHIFT 0 /* DAC2L_VOL - [7:0] */ | ||
3820 | #define WM8994_DAC2L_VOL_WIDTH 8 /* DAC2L_VOL - [7:0] */ | ||
3821 | |||
3822 | /* | ||
3823 | * R1555 (0x613) - DAC2 Right Volume | ||
3824 | */ | ||
3825 | #define WM8994_DAC2R_MUTE 0x0200 /* DAC2R_MUTE */ | ||
3826 | #define WM8994_DAC2R_MUTE_MASK 0x0200 /* DAC2R_MUTE */ | ||
3827 | #define WM8994_DAC2R_MUTE_SHIFT 9 /* DAC2R_MUTE */ | ||
3828 | #define WM8994_DAC2R_MUTE_WIDTH 1 /* DAC2R_MUTE */ | ||
3829 | #define WM8994_DAC2_VU 0x0100 /* DAC2_VU */ | ||
3830 | #define WM8994_DAC2_VU_MASK 0x0100 /* DAC2_VU */ | ||
3831 | #define WM8994_DAC2_VU_SHIFT 8 /* DAC2_VU */ | ||
3832 | #define WM8994_DAC2_VU_WIDTH 1 /* DAC2_VU */ | ||
3833 | #define WM8994_DAC2R_VOL_MASK 0x00FF /* DAC2R_VOL - [7:0] */ | ||
3834 | #define WM8994_DAC2R_VOL_SHIFT 0 /* DAC2R_VOL - [7:0] */ | ||
3835 | #define WM8994_DAC2R_VOL_WIDTH 8 /* DAC2R_VOL - [7:0] */ | ||
3836 | |||
3837 | /* | ||
3838 | * R1556 (0x614) - DAC Softmute | ||
3839 | */ | ||
3840 | #define WM8994_DAC_SOFTMUTEMODE 0x0002 /* DAC_SOFTMUTEMODE */ | ||
3841 | #define WM8994_DAC_SOFTMUTEMODE_MASK 0x0002 /* DAC_SOFTMUTEMODE */ | ||
3842 | #define WM8994_DAC_SOFTMUTEMODE_SHIFT 1 /* DAC_SOFTMUTEMODE */ | ||
3843 | #define WM8994_DAC_SOFTMUTEMODE_WIDTH 1 /* DAC_SOFTMUTEMODE */ | ||
3844 | #define WM8994_DAC_MUTERATE 0x0001 /* DAC_MUTERATE */ | ||
3845 | #define WM8994_DAC_MUTERATE_MASK 0x0001 /* DAC_MUTERATE */ | ||
3846 | #define WM8994_DAC_MUTERATE_SHIFT 0 /* DAC_MUTERATE */ | ||
3847 | #define WM8994_DAC_MUTERATE_WIDTH 1 /* DAC_MUTERATE */ | ||
3848 | |||
3849 | /* | ||
3850 | * R1568 (0x620) - Oversampling | ||
3851 | */ | ||
3852 | #define WM8994_ADC_OSR128 0x0002 /* ADC_OSR128 */ | ||
3853 | #define WM8994_ADC_OSR128_MASK 0x0002 /* ADC_OSR128 */ | ||
3854 | #define WM8994_ADC_OSR128_SHIFT 1 /* ADC_OSR128 */ | ||
3855 | #define WM8994_ADC_OSR128_WIDTH 1 /* ADC_OSR128 */ | ||
3856 | #define WM8994_DAC_OSR128 0x0001 /* DAC_OSR128 */ | ||
3857 | #define WM8994_DAC_OSR128_MASK 0x0001 /* DAC_OSR128 */ | ||
3858 | #define WM8994_DAC_OSR128_SHIFT 0 /* DAC_OSR128 */ | ||
3859 | #define WM8994_DAC_OSR128_WIDTH 1 /* DAC_OSR128 */ | ||
3860 | |||
3861 | /* | ||
3862 | * R1569 (0x621) - Sidetone | ||
3863 | */ | ||
3864 | #define WM8994_ST_HPF_CUT_MASK 0x0380 /* ST_HPF_CUT - [9:7] */ | ||
3865 | #define WM8994_ST_HPF_CUT_SHIFT 7 /* ST_HPF_CUT - [9:7] */ | ||
3866 | #define WM8994_ST_HPF_CUT_WIDTH 3 /* ST_HPF_CUT - [9:7] */ | ||
3867 | #define WM8994_ST_HPF 0x0040 /* ST_HPF */ | ||
3868 | #define WM8994_ST_HPF_MASK 0x0040 /* ST_HPF */ | ||
3869 | #define WM8994_ST_HPF_SHIFT 6 /* ST_HPF */ | ||
3870 | #define WM8994_ST_HPF_WIDTH 1 /* ST_HPF */ | ||
3871 | #define WM8994_STR_SEL 0x0002 /* STR_SEL */ | ||
3872 | #define WM8994_STR_SEL_MASK 0x0002 /* STR_SEL */ | ||
3873 | #define WM8994_STR_SEL_SHIFT 1 /* STR_SEL */ | ||
3874 | #define WM8994_STR_SEL_WIDTH 1 /* STR_SEL */ | ||
3875 | #define WM8994_STL_SEL 0x0001 /* STL_SEL */ | ||
3876 | #define WM8994_STL_SEL_MASK 0x0001 /* STL_SEL */ | ||
3877 | #define WM8994_STL_SEL_SHIFT 0 /* STL_SEL */ | ||
3878 | #define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */ | ||
3879 | |||
3880 | /* | ||
3881 | * R1824 (0x720) - Pull Control (1) | ||
3882 | */ | ||
3883 | #define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */ | ||
3884 | #define WM8994_DMICDAT2_PU_MASK 0x0800 /* DMICDAT2_PU */ | ||
3885 | #define WM8994_DMICDAT2_PU_SHIFT 11 /* DMICDAT2_PU */ | ||
3886 | #define WM8994_DMICDAT2_PU_WIDTH 1 /* DMICDAT2_PU */ | ||
3887 | #define WM8994_DMICDAT2_PD 0x0400 /* DMICDAT2_PD */ | ||
3888 | #define WM8994_DMICDAT2_PD_MASK 0x0400 /* DMICDAT2_PD */ | ||
3889 | #define WM8994_DMICDAT2_PD_SHIFT 10 /* DMICDAT2_PD */ | ||
3890 | #define WM8994_DMICDAT2_PD_WIDTH 1 /* DMICDAT2_PD */ | ||
3891 | #define WM8994_DMICDAT1_PU 0x0200 /* DMICDAT1_PU */ | ||
3892 | #define WM8994_DMICDAT1_PU_MASK 0x0200 /* DMICDAT1_PU */ | ||
3893 | #define WM8994_DMICDAT1_PU_SHIFT 9 /* DMICDAT1_PU */ | ||
3894 | #define WM8994_DMICDAT1_PU_WIDTH 1 /* DMICDAT1_PU */ | ||
3895 | #define WM8994_DMICDAT1_PD 0x0100 /* DMICDAT1_PD */ | ||
3896 | #define WM8994_DMICDAT1_PD_MASK 0x0100 /* DMICDAT1_PD */ | ||
3897 | #define WM8994_DMICDAT1_PD_SHIFT 8 /* DMICDAT1_PD */ | ||
3898 | #define WM8994_DMICDAT1_PD_WIDTH 1 /* DMICDAT1_PD */ | ||
3899 | #define WM8994_MCLK1_PU 0x0080 /* MCLK1_PU */ | ||
3900 | #define WM8994_MCLK1_PU_MASK 0x0080 /* MCLK1_PU */ | ||
3901 | #define WM8994_MCLK1_PU_SHIFT 7 /* MCLK1_PU */ | ||
3902 | #define WM8994_MCLK1_PU_WIDTH 1 /* MCLK1_PU */ | ||
3903 | #define WM8994_MCLK1_PD 0x0040 /* MCLK1_PD */ | ||
3904 | #define WM8994_MCLK1_PD_MASK 0x0040 /* MCLK1_PD */ | ||
3905 | #define WM8994_MCLK1_PD_SHIFT 6 /* MCLK1_PD */ | ||
3906 | #define WM8994_MCLK1_PD_WIDTH 1 /* MCLK1_PD */ | ||
3907 | #define WM8994_DACDAT1_PU 0x0020 /* DACDAT1_PU */ | ||
3908 | #define WM8994_DACDAT1_PU_MASK 0x0020 /* DACDAT1_PU */ | ||
3909 | #define WM8994_DACDAT1_PU_SHIFT 5 /* DACDAT1_PU */ | ||
3910 | #define WM8994_DACDAT1_PU_WIDTH 1 /* DACDAT1_PU */ | ||
3911 | #define WM8994_DACDAT1_PD 0x0010 /* DACDAT1_PD */ | ||
3912 | #define WM8994_DACDAT1_PD_MASK 0x0010 /* DACDAT1_PD */ | ||
3913 | #define WM8994_DACDAT1_PD_SHIFT 4 /* DACDAT1_PD */ | ||
3914 | #define WM8994_DACDAT1_PD_WIDTH 1 /* DACDAT1_PD */ | ||
3915 | #define WM8994_DACLRCLK1_PU 0x0008 /* DACLRCLK1_PU */ | ||
3916 | #define WM8994_DACLRCLK1_PU_MASK 0x0008 /* DACLRCLK1_PU */ | ||
3917 | #define WM8994_DACLRCLK1_PU_SHIFT 3 /* DACLRCLK1_PU */ | ||
3918 | #define WM8994_DACLRCLK1_PU_WIDTH 1 /* DACLRCLK1_PU */ | ||
3919 | #define WM8994_DACLRCLK1_PD 0x0004 /* DACLRCLK1_PD */ | ||
3920 | #define WM8994_DACLRCLK1_PD_MASK 0x0004 /* DACLRCLK1_PD */ | ||
3921 | #define WM8994_DACLRCLK1_PD_SHIFT 2 /* DACLRCLK1_PD */ | ||
3922 | #define WM8994_DACLRCLK1_PD_WIDTH 1 /* DACLRCLK1_PD */ | ||
3923 | #define WM8994_BCLK1_PU 0x0002 /* BCLK1_PU */ | ||
3924 | #define WM8994_BCLK1_PU_MASK 0x0002 /* BCLK1_PU */ | ||
3925 | #define WM8994_BCLK1_PU_SHIFT 1 /* BCLK1_PU */ | ||
3926 | #define WM8994_BCLK1_PU_WIDTH 1 /* BCLK1_PU */ | ||
3927 | #define WM8994_BCLK1_PD 0x0001 /* BCLK1_PD */ | ||
3928 | #define WM8994_BCLK1_PD_MASK 0x0001 /* BCLK1_PD */ | ||
3929 | #define WM8994_BCLK1_PD_SHIFT 0 /* BCLK1_PD */ | ||
3930 | #define WM8994_BCLK1_PD_WIDTH 1 /* BCLK1_PD */ | ||
3931 | |||
3932 | /* | ||
3933 | * R1825 (0x721) - Pull Control (2) | ||
3934 | */ | ||
3935 | #define WM8994_CSNADDR_PD 0x0100 /* CSNADDR_PD */ | ||
3936 | #define WM8994_CSNADDR_PD_MASK 0x0100 /* CSNADDR_PD */ | ||
3937 | #define WM8994_CSNADDR_PD_SHIFT 8 /* CSNADDR_PD */ | ||
3938 | #define WM8994_CSNADDR_PD_WIDTH 1 /* CSNADDR_PD */ | ||
3939 | #define WM8994_LDO2ENA_PD 0x0040 /* LDO2ENA_PD */ | ||
3940 | #define WM8994_LDO2ENA_PD_MASK 0x0040 /* LDO2ENA_PD */ | ||
3941 | #define WM8994_LDO2ENA_PD_SHIFT 6 /* LDO2ENA_PD */ | ||
3942 | #define WM8994_LDO2ENA_PD_WIDTH 1 /* LDO2ENA_PD */ | ||
3943 | #define WM8994_LDO1ENA_PD 0x0010 /* LDO1ENA_PD */ | ||
3944 | #define WM8994_LDO1ENA_PD_MASK 0x0010 /* LDO1ENA_PD */ | ||
3945 | #define WM8994_LDO1ENA_PD_SHIFT 4 /* LDO1ENA_PD */ | ||
3946 | #define WM8994_LDO1ENA_PD_WIDTH 1 /* LDO1ENA_PD */ | ||
3947 | #define WM8994_CIFMODE_PD 0x0004 /* CIFMODE_PD */ | ||
3948 | #define WM8994_CIFMODE_PD_MASK 0x0004 /* CIFMODE_PD */ | ||
3949 | #define WM8994_CIFMODE_PD_SHIFT 2 /* CIFMODE_PD */ | ||
3950 | #define WM8994_CIFMODE_PD_WIDTH 1 /* CIFMODE_PD */ | ||
3951 | #define WM8994_SPKMODE_PU 0x0002 /* SPKMODE_PU */ | ||
3952 | #define WM8994_SPKMODE_PU_MASK 0x0002 /* SPKMODE_PU */ | ||
3953 | #define WM8994_SPKMODE_PU_SHIFT 1 /* SPKMODE_PU */ | ||
3954 | #define WM8994_SPKMODE_PU_WIDTH 1 /* SPKMODE_PU */ | ||
3955 | |||
3956 | /* | ||
3957 | * R1840 (0x730) - Interrupt Status 1 | ||
3958 | */ | ||
3959 | #define WM8994_GP11_EINT 0x0400 /* GP11_EINT */ | ||
3960 | #define WM8994_GP11_EINT_MASK 0x0400 /* GP11_EINT */ | ||
3961 | #define WM8994_GP11_EINT_SHIFT 10 /* GP11_EINT */ | ||
3962 | #define WM8994_GP11_EINT_WIDTH 1 /* GP11_EINT */ | ||
3963 | #define WM8994_GP10_EINT 0x0200 /* GP10_EINT */ | ||
3964 | #define WM8994_GP10_EINT_MASK 0x0200 /* GP10_EINT */ | ||
3965 | #define WM8994_GP10_EINT_SHIFT 9 /* GP10_EINT */ | ||
3966 | #define WM8994_GP10_EINT_WIDTH 1 /* GP10_EINT */ | ||
3967 | #define WM8994_GP9_EINT 0x0100 /* GP9_EINT */ | ||
3968 | #define WM8994_GP9_EINT_MASK 0x0100 /* GP9_EINT */ | ||
3969 | #define WM8994_GP9_EINT_SHIFT 8 /* GP9_EINT */ | ||
3970 | #define WM8994_GP9_EINT_WIDTH 1 /* GP9_EINT */ | ||
3971 | #define WM8994_GP8_EINT 0x0080 /* GP8_EINT */ | ||
3972 | #define WM8994_GP8_EINT_MASK 0x0080 /* GP8_EINT */ | ||
3973 | #define WM8994_GP8_EINT_SHIFT 7 /* GP8_EINT */ | ||
3974 | #define WM8994_GP8_EINT_WIDTH 1 /* GP8_EINT */ | ||
3975 | #define WM8994_GP7_EINT 0x0040 /* GP7_EINT */ | ||
3976 | #define WM8994_GP7_EINT_MASK 0x0040 /* GP7_EINT */ | ||
3977 | #define WM8994_GP7_EINT_SHIFT 6 /* GP7_EINT */ | ||
3978 | #define WM8994_GP7_EINT_WIDTH 1 /* GP7_EINT */ | ||
3979 | #define WM8994_GP6_EINT 0x0020 /* GP6_EINT */ | ||
3980 | #define WM8994_GP6_EINT_MASK 0x0020 /* GP6_EINT */ | ||
3981 | #define WM8994_GP6_EINT_SHIFT 5 /* GP6_EINT */ | ||
3982 | #define WM8994_GP6_EINT_WIDTH 1 /* GP6_EINT */ | ||
3983 | #define WM8994_GP5_EINT 0x0010 /* GP5_EINT */ | ||
3984 | #define WM8994_GP5_EINT_MASK 0x0010 /* GP5_EINT */ | ||
3985 | #define WM8994_GP5_EINT_SHIFT 4 /* GP5_EINT */ | ||
3986 | #define WM8994_GP5_EINT_WIDTH 1 /* GP5_EINT */ | ||
3987 | #define WM8994_GP4_EINT 0x0008 /* GP4_EINT */ | ||
3988 | #define WM8994_GP4_EINT_MASK 0x0008 /* GP4_EINT */ | ||
3989 | #define WM8994_GP4_EINT_SHIFT 3 /* GP4_EINT */ | ||
3990 | #define WM8994_GP4_EINT_WIDTH 1 /* GP4_EINT */ | ||
3991 | #define WM8994_GP3_EINT 0x0004 /* GP3_EINT */ | ||
3992 | #define WM8994_GP3_EINT_MASK 0x0004 /* GP3_EINT */ | ||
3993 | #define WM8994_GP3_EINT_SHIFT 2 /* GP3_EINT */ | ||
3994 | #define WM8994_GP3_EINT_WIDTH 1 /* GP3_EINT */ | ||
3995 | #define WM8994_GP2_EINT 0x0002 /* GP2_EINT */ | ||
3996 | #define WM8994_GP2_EINT_MASK 0x0002 /* GP2_EINT */ | ||
3997 | #define WM8994_GP2_EINT_SHIFT 1 /* GP2_EINT */ | ||
3998 | #define WM8994_GP2_EINT_WIDTH 1 /* GP2_EINT */ | ||
3999 | #define WM8994_GP1_EINT 0x0001 /* GP1_EINT */ | ||
4000 | #define WM8994_GP1_EINT_MASK 0x0001 /* GP1_EINT */ | ||
4001 | #define WM8994_GP1_EINT_SHIFT 0 /* GP1_EINT */ | ||
4002 | #define WM8994_GP1_EINT_WIDTH 1 /* GP1_EINT */ | ||
4003 | |||
4004 | /* | ||
4005 | * R1841 (0x731) - Interrupt Status 2 | ||
4006 | */ | ||
4007 | #define WM8994_TEMP_WARN_EINT 0x8000 /* TEMP_WARN_EINT */ | ||
4008 | #define WM8994_TEMP_WARN_EINT_MASK 0x8000 /* TEMP_WARN_EINT */ | ||
4009 | #define WM8994_TEMP_WARN_EINT_SHIFT 15 /* TEMP_WARN_EINT */ | ||
4010 | #define WM8994_TEMP_WARN_EINT_WIDTH 1 /* TEMP_WARN_EINT */ | ||
4011 | #define WM8994_DCS_DONE_EINT 0x4000 /* DCS_DONE_EINT */ | ||
4012 | #define WM8994_DCS_DONE_EINT_MASK 0x4000 /* DCS_DONE_EINT */ | ||
4013 | #define WM8994_DCS_DONE_EINT_SHIFT 14 /* DCS_DONE_EINT */ | ||
4014 | #define WM8994_DCS_DONE_EINT_WIDTH 1 /* DCS_DONE_EINT */ | ||
4015 | #define WM8994_WSEQ_DONE_EINT 0x2000 /* WSEQ_DONE_EINT */ | ||
4016 | #define WM8994_WSEQ_DONE_EINT_MASK 0x2000 /* WSEQ_DONE_EINT */ | ||
4017 | #define WM8994_WSEQ_DONE_EINT_SHIFT 13 /* WSEQ_DONE_EINT */ | ||
4018 | #define WM8994_WSEQ_DONE_EINT_WIDTH 1 /* WSEQ_DONE_EINT */ | ||
4019 | #define WM8994_FIFOS_ERR_EINT 0x1000 /* FIFOS_ERR_EINT */ | ||
4020 | #define WM8994_FIFOS_ERR_EINT_MASK 0x1000 /* FIFOS_ERR_EINT */ | ||
4021 | #define WM8994_FIFOS_ERR_EINT_SHIFT 12 /* FIFOS_ERR_EINT */ | ||
4022 | #define WM8994_FIFOS_ERR_EINT_WIDTH 1 /* FIFOS_ERR_EINT */ | ||
4023 | #define WM8994_AIF2DRC_SIG_DET_EINT 0x0800 /* AIF2DRC_SIG_DET_EINT */ | ||
4024 | #define WM8994_AIF2DRC_SIG_DET_EINT_MASK 0x0800 /* AIF2DRC_SIG_DET_EINT */ | ||
4025 | #define WM8994_AIF2DRC_SIG_DET_EINT_SHIFT 11 /* AIF2DRC_SIG_DET_EINT */ | ||
4026 | #define WM8994_AIF2DRC_SIG_DET_EINT_WIDTH 1 /* AIF2DRC_SIG_DET_EINT */ | ||
4027 | #define WM8994_AIF1DRC2_SIG_DET_EINT 0x0400 /* AIF1DRC2_SIG_DET_EINT */ | ||
4028 | #define WM8994_AIF1DRC2_SIG_DET_EINT_MASK 0x0400 /* AIF1DRC2_SIG_DET_EINT */ | ||
4029 | #define WM8994_AIF1DRC2_SIG_DET_EINT_SHIFT 10 /* AIF1DRC2_SIG_DET_EINT */ | ||
4030 | #define WM8994_AIF1DRC2_SIG_DET_EINT_WIDTH 1 /* AIF1DRC2_SIG_DET_EINT */ | ||
4031 | #define WM8994_AIF1DRC1_SIG_DET_EINT 0x0200 /* AIF1DRC1_SIG_DET_EINT */ | ||
4032 | #define WM8994_AIF1DRC1_SIG_DET_EINT_MASK 0x0200 /* AIF1DRC1_SIG_DET_EINT */ | ||
4033 | #define WM8994_AIF1DRC1_SIG_DET_EINT_SHIFT 9 /* AIF1DRC1_SIG_DET_EINT */ | ||
4034 | #define WM8994_AIF1DRC1_SIG_DET_EINT_WIDTH 1 /* AIF1DRC1_SIG_DET_EINT */ | ||
4035 | #define WM8994_SRC2_LOCK_EINT 0x0100 /* SRC2_LOCK_EINT */ | ||
4036 | #define WM8994_SRC2_LOCK_EINT_MASK 0x0100 /* SRC2_LOCK_EINT */ | ||
4037 | #define WM8994_SRC2_LOCK_EINT_SHIFT 8 /* SRC2_LOCK_EINT */ | ||
4038 | #define WM8994_SRC2_LOCK_EINT_WIDTH 1 /* SRC2_LOCK_EINT */ | ||
4039 | #define WM8994_SRC1_LOCK_EINT 0x0080 /* SRC1_LOCK_EINT */ | ||
4040 | #define WM8994_SRC1_LOCK_EINT_MASK 0x0080 /* SRC1_LOCK_EINT */ | ||
4041 | #define WM8994_SRC1_LOCK_EINT_SHIFT 7 /* SRC1_LOCK_EINT */ | ||
4042 | #define WM8994_SRC1_LOCK_EINT_WIDTH 1 /* SRC1_LOCK_EINT */ | ||
4043 | #define WM8994_FLL2_LOCK_EINT 0x0040 /* FLL2_LOCK_EINT */ | ||
4044 | #define WM8994_FLL2_LOCK_EINT_MASK 0x0040 /* FLL2_LOCK_EINT */ | ||
4045 | #define WM8994_FLL2_LOCK_EINT_SHIFT 6 /* FLL2_LOCK_EINT */ | ||
4046 | #define WM8994_FLL2_LOCK_EINT_WIDTH 1 /* FLL2_LOCK_EINT */ | ||
4047 | #define WM8994_FLL1_LOCK_EINT 0x0020 /* FLL1_LOCK_EINT */ | ||
4048 | #define WM8994_FLL1_LOCK_EINT_MASK 0x0020 /* FLL1_LOCK_EINT */ | ||
4049 | #define WM8994_FLL1_LOCK_EINT_SHIFT 5 /* FLL1_LOCK_EINT */ | ||
4050 | #define WM8994_FLL1_LOCK_EINT_WIDTH 1 /* FLL1_LOCK_EINT */ | ||
4051 | #define WM8994_MIC2_SHRT_EINT 0x0010 /* MIC2_SHRT_EINT */ | ||
4052 | #define WM8994_MIC2_SHRT_EINT_MASK 0x0010 /* MIC2_SHRT_EINT */ | ||
4053 | #define WM8994_MIC2_SHRT_EINT_SHIFT 4 /* MIC2_SHRT_EINT */ | ||
4054 | #define WM8994_MIC2_SHRT_EINT_WIDTH 1 /* MIC2_SHRT_EINT */ | ||
4055 | #define WM8994_MIC2_DET_EINT 0x0008 /* MIC2_DET_EINT */ | ||
4056 | #define WM8994_MIC2_DET_EINT_MASK 0x0008 /* MIC2_DET_EINT */ | ||
4057 | #define WM8994_MIC2_DET_EINT_SHIFT 3 /* MIC2_DET_EINT */ | ||
4058 | #define WM8994_MIC2_DET_EINT_WIDTH 1 /* MIC2_DET_EINT */ | ||
4059 | #define WM8994_MIC1_SHRT_EINT 0x0004 /* MIC1_SHRT_EINT */ | ||
4060 | #define WM8994_MIC1_SHRT_EINT_MASK 0x0004 /* MIC1_SHRT_EINT */ | ||
4061 | #define WM8994_MIC1_SHRT_EINT_SHIFT 2 /* MIC1_SHRT_EINT */ | ||
4062 | #define WM8994_MIC1_SHRT_EINT_WIDTH 1 /* MIC1_SHRT_EINT */ | ||
4063 | #define WM8994_MIC1_DET_EINT 0x0002 /* MIC1_DET_EINT */ | ||
4064 | #define WM8994_MIC1_DET_EINT_MASK 0x0002 /* MIC1_DET_EINT */ | ||
4065 | #define WM8994_MIC1_DET_EINT_SHIFT 1 /* MIC1_DET_EINT */ | ||
4066 | #define WM8994_MIC1_DET_EINT_WIDTH 1 /* MIC1_DET_EINT */ | ||
4067 | #define WM8994_TEMP_SHUT_EINT 0x0001 /* TEMP_SHUT_EINT */ | ||
4068 | #define WM8994_TEMP_SHUT_EINT_MASK 0x0001 /* TEMP_SHUT_EINT */ | ||
4069 | #define WM8994_TEMP_SHUT_EINT_SHIFT 0 /* TEMP_SHUT_EINT */ | ||
4070 | #define WM8994_TEMP_SHUT_EINT_WIDTH 1 /* TEMP_SHUT_EINT */ | ||
4071 | |||
4072 | /* | ||
4073 | * R1842 (0x732) - Interrupt Raw Status 2 | ||
4074 | */ | ||
4075 | #define WM8994_TEMP_WARN_STS 0x8000 /* TEMP_WARN_STS */ | ||
4076 | #define WM8994_TEMP_WARN_STS_MASK 0x8000 /* TEMP_WARN_STS */ | ||
4077 | #define WM8994_TEMP_WARN_STS_SHIFT 15 /* TEMP_WARN_STS */ | ||
4078 | #define WM8994_TEMP_WARN_STS_WIDTH 1 /* TEMP_WARN_STS */ | ||
4079 | #define WM8994_DCS_DONE_STS 0x4000 /* DCS_DONE_STS */ | ||
4080 | #define WM8994_DCS_DONE_STS_MASK 0x4000 /* DCS_DONE_STS */ | ||
4081 | #define WM8994_DCS_DONE_STS_SHIFT 14 /* DCS_DONE_STS */ | ||
4082 | #define WM8994_DCS_DONE_STS_WIDTH 1 /* DCS_DONE_STS */ | ||
4083 | #define WM8994_WSEQ_DONE_STS 0x2000 /* WSEQ_DONE_STS */ | ||
4084 | #define WM8994_WSEQ_DONE_STS_MASK 0x2000 /* WSEQ_DONE_STS */ | ||
4085 | #define WM8994_WSEQ_DONE_STS_SHIFT 13 /* WSEQ_DONE_STS */ | ||
4086 | #define WM8994_WSEQ_DONE_STS_WIDTH 1 /* WSEQ_DONE_STS */ | ||
4087 | #define WM8994_FIFOS_ERR_STS 0x1000 /* FIFOS_ERR_STS */ | ||
4088 | #define WM8994_FIFOS_ERR_STS_MASK 0x1000 /* FIFOS_ERR_STS */ | ||
4089 | #define WM8994_FIFOS_ERR_STS_SHIFT 12 /* FIFOS_ERR_STS */ | ||
4090 | #define WM8994_FIFOS_ERR_STS_WIDTH 1 /* FIFOS_ERR_STS */ | ||
4091 | #define WM8994_AIF2DRC_SIG_DET_STS 0x0800 /* AIF2DRC_SIG_DET_STS */ | ||
4092 | #define WM8994_AIF2DRC_SIG_DET_STS_MASK 0x0800 /* AIF2DRC_SIG_DET_STS */ | ||
4093 | #define WM8994_AIF2DRC_SIG_DET_STS_SHIFT 11 /* AIF2DRC_SIG_DET_STS */ | ||
4094 | #define WM8994_AIF2DRC_SIG_DET_STS_WIDTH 1 /* AIF2DRC_SIG_DET_STS */ | ||
4095 | #define WM8994_AIF1DRC2_SIG_DET_STS 0x0400 /* AIF1DRC2_SIG_DET_STS */ | ||
4096 | #define WM8994_AIF1DRC2_SIG_DET_STS_MASK 0x0400 /* AIF1DRC2_SIG_DET_STS */ | ||
4097 | #define WM8994_AIF1DRC2_SIG_DET_STS_SHIFT 10 /* AIF1DRC2_SIG_DET_STS */ | ||
4098 | #define WM8994_AIF1DRC2_SIG_DET_STS_WIDTH 1 /* AIF1DRC2_SIG_DET_STS */ | ||
4099 | #define WM8994_AIF1DRC1_SIG_DET_STS 0x0200 /* AIF1DRC1_SIG_DET_STS */ | ||
4100 | #define WM8994_AIF1DRC1_SIG_DET_STS_MASK 0x0200 /* AIF1DRC1_SIG_DET_STS */ | ||
4101 | #define WM8994_AIF1DRC1_SIG_DET_STS_SHIFT 9 /* AIF1DRC1_SIG_DET_STS */ | ||
4102 | #define WM8994_AIF1DRC1_SIG_DET_STS_WIDTH 1 /* AIF1DRC1_SIG_DET_STS */ | ||
4103 | #define WM8994_SRC2_LOCK_STS 0x0100 /* SRC2_LOCK_STS */ | ||
4104 | #define WM8994_SRC2_LOCK_STS_MASK 0x0100 /* SRC2_LOCK_STS */ | ||
4105 | #define WM8994_SRC2_LOCK_STS_SHIFT 8 /* SRC2_LOCK_STS */ | ||
4106 | #define WM8994_SRC2_LOCK_STS_WIDTH 1 /* SRC2_LOCK_STS */ | ||
4107 | #define WM8994_SRC1_LOCK_STS 0x0080 /* SRC1_LOCK_STS */ | ||
4108 | #define WM8994_SRC1_LOCK_STS_MASK 0x0080 /* SRC1_LOCK_STS */ | ||
4109 | #define WM8994_SRC1_LOCK_STS_SHIFT 7 /* SRC1_LOCK_STS */ | ||
4110 | #define WM8994_SRC1_LOCK_STS_WIDTH 1 /* SRC1_LOCK_STS */ | ||
4111 | #define WM8994_FLL2_LOCK_STS 0x0040 /* FLL2_LOCK_STS */ | ||
4112 | #define WM8994_FLL2_LOCK_STS_MASK 0x0040 /* FLL2_LOCK_STS */ | ||
4113 | #define WM8994_FLL2_LOCK_STS_SHIFT 6 /* FLL2_LOCK_STS */ | ||
4114 | #define WM8994_FLL2_LOCK_STS_WIDTH 1 /* FLL2_LOCK_STS */ | ||
4115 | #define WM8994_FLL1_LOCK_STS 0x0020 /* FLL1_LOCK_STS */ | ||
4116 | #define WM8994_FLL1_LOCK_STS_MASK 0x0020 /* FLL1_LOCK_STS */ | ||
4117 | #define WM8994_FLL1_LOCK_STS_SHIFT 5 /* FLL1_LOCK_STS */ | ||
4118 | #define WM8994_FLL1_LOCK_STS_WIDTH 1 /* FLL1_LOCK_STS */ | ||
4119 | #define WM8994_MIC2_SHRT_STS 0x0010 /* MIC2_SHRT_STS */ | ||
4120 | #define WM8994_MIC2_SHRT_STS_MASK 0x0010 /* MIC2_SHRT_STS */ | ||
4121 | #define WM8994_MIC2_SHRT_STS_SHIFT 4 /* MIC2_SHRT_STS */ | ||
4122 | #define WM8994_MIC2_SHRT_STS_WIDTH 1 /* MIC2_SHRT_STS */ | ||
4123 | #define WM8994_MIC2_DET_STS 0x0008 /* MIC2_DET_STS */ | ||
4124 | #define WM8994_MIC2_DET_STS_MASK 0x0008 /* MIC2_DET_STS */ | ||
4125 | #define WM8994_MIC2_DET_STS_SHIFT 3 /* MIC2_DET_STS */ | ||
4126 | #define WM8994_MIC2_DET_STS_WIDTH 1 /* MIC2_DET_STS */ | ||
4127 | #define WM8994_MIC1_SHRT_STS 0x0004 /* MIC1_SHRT_STS */ | ||
4128 | #define WM8994_MIC1_SHRT_STS_MASK 0x0004 /* MIC1_SHRT_STS */ | ||
4129 | #define WM8994_MIC1_SHRT_STS_SHIFT 2 /* MIC1_SHRT_STS */ | ||
4130 | #define WM8994_MIC1_SHRT_STS_WIDTH 1 /* MIC1_SHRT_STS */ | ||
4131 | #define WM8994_MIC1_DET_STS 0x0002 /* MIC1_DET_STS */ | ||
4132 | #define WM8994_MIC1_DET_STS_MASK 0x0002 /* MIC1_DET_STS */ | ||
4133 | #define WM8994_MIC1_DET_STS_SHIFT 1 /* MIC1_DET_STS */ | ||
4134 | #define WM8994_MIC1_DET_STS_WIDTH 1 /* MIC1_DET_STS */ | ||
4135 | #define WM8994_TEMP_SHUT_STS 0x0001 /* TEMP_SHUT_STS */ | ||
4136 | #define WM8994_TEMP_SHUT_STS_MASK 0x0001 /* TEMP_SHUT_STS */ | ||
4137 | #define WM8994_TEMP_SHUT_STS_SHIFT 0 /* TEMP_SHUT_STS */ | ||
4138 | #define WM8994_TEMP_SHUT_STS_WIDTH 1 /* TEMP_SHUT_STS */ | ||
4139 | |||
4140 | /* | ||
4141 | * R1848 (0x738) - Interrupt Status 1 Mask | ||
4142 | */ | ||
4143 | #define WM8994_IM_GP11_EINT 0x0400 /* IM_GP11_EINT */ | ||
4144 | #define WM8994_IM_GP11_EINT_MASK 0x0400 /* IM_GP11_EINT */ | ||
4145 | #define WM8994_IM_GP11_EINT_SHIFT 10 /* IM_GP11_EINT */ | ||
4146 | #define WM8994_IM_GP11_EINT_WIDTH 1 /* IM_GP11_EINT */ | ||
4147 | #define WM8994_IM_GP10_EINT 0x0200 /* IM_GP10_EINT */ | ||
4148 | #define WM8994_IM_GP10_EINT_MASK 0x0200 /* IM_GP10_EINT */ | ||
4149 | #define WM8994_IM_GP10_EINT_SHIFT 9 /* IM_GP10_EINT */ | ||
4150 | #define WM8994_IM_GP10_EINT_WIDTH 1 /* IM_GP10_EINT */ | ||
4151 | #define WM8994_IM_GP9_EINT 0x0100 /* IM_GP9_EINT */ | ||
4152 | #define WM8994_IM_GP9_EINT_MASK 0x0100 /* IM_GP9_EINT */ | ||
4153 | #define WM8994_IM_GP9_EINT_SHIFT 8 /* IM_GP9_EINT */ | ||
4154 | #define WM8994_IM_GP9_EINT_WIDTH 1 /* IM_GP9_EINT */ | ||
4155 | #define WM8994_IM_GP8_EINT 0x0080 /* IM_GP8_EINT */ | ||
4156 | #define WM8994_IM_GP8_EINT_MASK 0x0080 /* IM_GP8_EINT */ | ||
4157 | #define WM8994_IM_GP8_EINT_SHIFT 7 /* IM_GP8_EINT */ | ||
4158 | #define WM8994_IM_GP8_EINT_WIDTH 1 /* IM_GP8_EINT */ | ||
4159 | #define WM8994_IM_GP7_EINT 0x0040 /* IM_GP7_EINT */ | ||
4160 | #define WM8994_IM_GP7_EINT_MASK 0x0040 /* IM_GP7_EINT */ | ||
4161 | #define WM8994_IM_GP7_EINT_SHIFT 6 /* IM_GP7_EINT */ | ||
4162 | #define WM8994_IM_GP7_EINT_WIDTH 1 /* IM_GP7_EINT */ | ||
4163 | #define WM8994_IM_GP6_EINT 0x0020 /* IM_GP6_EINT */ | ||
4164 | #define WM8994_IM_GP6_EINT_MASK 0x0020 /* IM_GP6_EINT */ | ||
4165 | #define WM8994_IM_GP6_EINT_SHIFT 5 /* IM_GP6_EINT */ | ||
4166 | #define WM8994_IM_GP6_EINT_WIDTH 1 /* IM_GP6_EINT */ | ||
4167 | #define WM8994_IM_GP5_EINT 0x0010 /* IM_GP5_EINT */ | ||
4168 | #define WM8994_IM_GP5_EINT_MASK 0x0010 /* IM_GP5_EINT */ | ||
4169 | #define WM8994_IM_GP5_EINT_SHIFT 4 /* IM_GP5_EINT */ | ||
4170 | #define WM8994_IM_GP5_EINT_WIDTH 1 /* IM_GP5_EINT */ | ||
4171 | #define WM8994_IM_GP4_EINT 0x0008 /* IM_GP4_EINT */ | ||
4172 | #define WM8994_IM_GP4_EINT_MASK 0x0008 /* IM_GP4_EINT */ | ||
4173 | #define WM8994_IM_GP4_EINT_SHIFT 3 /* IM_GP4_EINT */ | ||
4174 | #define WM8994_IM_GP4_EINT_WIDTH 1 /* IM_GP4_EINT */ | ||
4175 | #define WM8994_IM_GP3_EINT 0x0004 /* IM_GP3_EINT */ | ||
4176 | #define WM8994_IM_GP3_EINT_MASK 0x0004 /* IM_GP3_EINT */ | ||
4177 | #define WM8994_IM_GP3_EINT_SHIFT 2 /* IM_GP3_EINT */ | ||
4178 | #define WM8994_IM_GP3_EINT_WIDTH 1 /* IM_GP3_EINT */ | ||
4179 | #define WM8994_IM_GP2_EINT 0x0002 /* IM_GP2_EINT */ | ||
4180 | #define WM8994_IM_GP2_EINT_MASK 0x0002 /* IM_GP2_EINT */ | ||
4181 | #define WM8994_IM_GP2_EINT_SHIFT 1 /* IM_GP2_EINT */ | ||
4182 | #define WM8994_IM_GP2_EINT_WIDTH 1 /* IM_GP2_EINT */ | ||
4183 | #define WM8994_IM_GP1_EINT 0x0001 /* IM_GP1_EINT */ | ||
4184 | #define WM8994_IM_GP1_EINT_MASK 0x0001 /* IM_GP1_EINT */ | ||
4185 | #define WM8994_IM_GP1_EINT_SHIFT 0 /* IM_GP1_EINT */ | ||
4186 | #define WM8994_IM_GP1_EINT_WIDTH 1 /* IM_GP1_EINT */ | ||
4187 | |||
4188 | /* | ||
4189 | * R1849 (0x739) - Interrupt Status 2 Mask | ||
4190 | */ | ||
4191 | #define WM8994_IM_TEMP_WARN_EINT 0x8000 /* IM_TEMP_WARN_EINT */ | ||
4192 | #define WM8994_IM_TEMP_WARN_EINT_MASK 0x8000 /* IM_TEMP_WARN_EINT */ | ||
4193 | #define WM8994_IM_TEMP_WARN_EINT_SHIFT 15 /* IM_TEMP_WARN_EINT */ | ||
4194 | #define WM8994_IM_TEMP_WARN_EINT_WIDTH 1 /* IM_TEMP_WARN_EINT */ | ||
4195 | #define WM8994_IM_DCS_DONE_EINT 0x4000 /* IM_DCS_DONE_EINT */ | ||
4196 | #define WM8994_IM_DCS_DONE_EINT_MASK 0x4000 /* IM_DCS_DONE_EINT */ | ||
4197 | #define WM8994_IM_DCS_DONE_EINT_SHIFT 14 /* IM_DCS_DONE_EINT */ | ||
4198 | #define WM8994_IM_DCS_DONE_EINT_WIDTH 1 /* IM_DCS_DONE_EINT */ | ||
4199 | #define WM8994_IM_WSEQ_DONE_EINT 0x2000 /* IM_WSEQ_DONE_EINT */ | ||
4200 | #define WM8994_IM_WSEQ_DONE_EINT_MASK 0x2000 /* IM_WSEQ_DONE_EINT */ | ||
4201 | #define WM8994_IM_WSEQ_DONE_EINT_SHIFT 13 /* IM_WSEQ_DONE_EINT */ | ||
4202 | #define WM8994_IM_WSEQ_DONE_EINT_WIDTH 1 /* IM_WSEQ_DONE_EINT */ | ||
4203 | #define WM8994_IM_FIFOS_ERR_EINT 0x1000 /* IM_FIFOS_ERR_EINT */ | ||
4204 | #define WM8994_IM_FIFOS_ERR_EINT_MASK 0x1000 /* IM_FIFOS_ERR_EINT */ | ||
4205 | #define WM8994_IM_FIFOS_ERR_EINT_SHIFT 12 /* IM_FIFOS_ERR_EINT */ | ||
4206 | #define WM8994_IM_FIFOS_ERR_EINT_WIDTH 1 /* IM_FIFOS_ERR_EINT */ | ||
4207 | #define WM8994_IM_AIF2DRC_SIG_DET_EINT 0x0800 /* IM_AIF2DRC_SIG_DET_EINT */ | ||
4208 | #define WM8994_IM_AIF2DRC_SIG_DET_EINT_MASK 0x0800 /* IM_AIF2DRC_SIG_DET_EINT */ | ||
4209 | #define WM8994_IM_AIF2DRC_SIG_DET_EINT_SHIFT 11 /* IM_AIF2DRC_SIG_DET_EINT */ | ||
4210 | #define WM8994_IM_AIF2DRC_SIG_DET_EINT_WIDTH 1 /* IM_AIF2DRC_SIG_DET_EINT */ | ||
4211 | #define WM8994_IM_AIF1DRC2_SIG_DET_EINT 0x0400 /* IM_AIF1DRC2_SIG_DET_EINT */ | ||
4212 | #define WM8994_IM_AIF1DRC2_SIG_DET_EINT_MASK 0x0400 /* IM_AIF1DRC2_SIG_DET_EINT */ | ||
4213 | #define WM8994_IM_AIF1DRC2_SIG_DET_EINT_SHIFT 10 /* IM_AIF1DRC2_SIG_DET_EINT */ | ||
4214 | #define WM8994_IM_AIF1DRC2_SIG_DET_EINT_WIDTH 1 /* IM_AIF1DRC2_SIG_DET_EINT */ | ||
4215 | #define WM8994_IM_AIF1DRC1_SIG_DET_EINT 0x0200 /* IM_AIF1DRC1_SIG_DET_EINT */ | ||
4216 | #define WM8994_IM_AIF1DRC1_SIG_DET_EINT_MASK 0x0200 /* IM_AIF1DRC1_SIG_DET_EINT */ | ||
4217 | #define WM8994_IM_AIF1DRC1_SIG_DET_EINT_SHIFT 9 /* IM_AIF1DRC1_SIG_DET_EINT */ | ||
4218 | #define WM8994_IM_AIF1DRC1_SIG_DET_EINT_WIDTH 1 /* IM_AIF1DRC1_SIG_DET_EINT */ | ||
4219 | #define WM8994_IM_SRC2_LOCK_EINT 0x0100 /* IM_SRC2_LOCK_EINT */ | ||
4220 | #define WM8994_IM_SRC2_LOCK_EINT_MASK 0x0100 /* IM_SRC2_LOCK_EINT */ | ||
4221 | #define WM8994_IM_SRC2_LOCK_EINT_SHIFT 8 /* IM_SRC2_LOCK_EINT */ | ||
4222 | #define WM8994_IM_SRC2_LOCK_EINT_WIDTH 1 /* IM_SRC2_LOCK_EINT */ | ||
4223 | #define WM8994_IM_SRC1_LOCK_EINT 0x0080 /* IM_SRC1_LOCK_EINT */ | ||
4224 | #define WM8994_IM_SRC1_LOCK_EINT_MASK 0x0080 /* IM_SRC1_LOCK_EINT */ | ||
4225 | #define WM8994_IM_SRC1_LOCK_EINT_SHIFT 7 /* IM_SRC1_LOCK_EINT */ | ||
4226 | #define WM8994_IM_SRC1_LOCK_EINT_WIDTH 1 /* IM_SRC1_LOCK_EINT */ | ||
4227 | #define WM8994_IM_FLL2_LOCK_EINT 0x0040 /* IM_FLL2_LOCK_EINT */ | ||
4228 | #define WM8994_IM_FLL2_LOCK_EINT_MASK 0x0040 /* IM_FLL2_LOCK_EINT */ | ||
4229 | #define WM8994_IM_FLL2_LOCK_EINT_SHIFT 6 /* IM_FLL2_LOCK_EINT */ | ||
4230 | #define WM8994_IM_FLL2_LOCK_EINT_WIDTH 1 /* IM_FLL2_LOCK_EINT */ | ||
4231 | #define WM8994_IM_FLL1_LOCK_EINT 0x0020 /* IM_FLL1_LOCK_EINT */ | ||
4232 | #define WM8994_IM_FLL1_LOCK_EINT_MASK 0x0020 /* IM_FLL1_LOCK_EINT */ | ||
4233 | #define WM8994_IM_FLL1_LOCK_EINT_SHIFT 5 /* IM_FLL1_LOCK_EINT */ | ||
4234 | #define WM8994_IM_FLL1_LOCK_EINT_WIDTH 1 /* IM_FLL1_LOCK_EINT */ | ||
4235 | #define WM8994_IM_MIC2_SHRT_EINT 0x0010 /* IM_MIC2_SHRT_EINT */ | ||
4236 | #define WM8994_IM_MIC2_SHRT_EINT_MASK 0x0010 /* IM_MIC2_SHRT_EINT */ | ||
4237 | #define WM8994_IM_MIC2_SHRT_EINT_SHIFT 4 /* IM_MIC2_SHRT_EINT */ | ||
4238 | #define WM8994_IM_MIC2_SHRT_EINT_WIDTH 1 /* IM_MIC2_SHRT_EINT */ | ||
4239 | #define WM8994_IM_MIC2_DET_EINT 0x0008 /* IM_MIC2_DET_EINT */ | ||
4240 | #define WM8994_IM_MIC2_DET_EINT_MASK 0x0008 /* IM_MIC2_DET_EINT */ | ||
4241 | #define WM8994_IM_MIC2_DET_EINT_SHIFT 3 /* IM_MIC2_DET_EINT */ | ||
4242 | #define WM8994_IM_MIC2_DET_EINT_WIDTH 1 /* IM_MIC2_DET_EINT */ | ||
4243 | #define WM8994_IM_MIC1_SHRT_EINT 0x0004 /* IM_MIC1_SHRT_EINT */ | ||
4244 | #define WM8994_IM_MIC1_SHRT_EINT_MASK 0x0004 /* IM_MIC1_SHRT_EINT */ | ||
4245 | #define WM8994_IM_MIC1_SHRT_EINT_SHIFT 2 /* IM_MIC1_SHRT_EINT */ | ||
4246 | #define WM8994_IM_MIC1_SHRT_EINT_WIDTH 1 /* IM_MIC1_SHRT_EINT */ | ||
4247 | #define WM8994_IM_MIC1_DET_EINT 0x0002 /* IM_MIC1_DET_EINT */ | ||
4248 | #define WM8994_IM_MIC1_DET_EINT_MASK 0x0002 /* IM_MIC1_DET_EINT */ | ||
4249 | #define WM8994_IM_MIC1_DET_EINT_SHIFT 1 /* IM_MIC1_DET_EINT */ | ||
4250 | #define WM8994_IM_MIC1_DET_EINT_WIDTH 1 /* IM_MIC1_DET_EINT */ | ||
4251 | #define WM8994_IM_TEMP_SHUT_EINT 0x0001 /* IM_TEMP_SHUT_EINT */ | ||
4252 | #define WM8994_IM_TEMP_SHUT_EINT_MASK 0x0001 /* IM_TEMP_SHUT_EINT */ | ||
4253 | #define WM8994_IM_TEMP_SHUT_EINT_SHIFT 0 /* IM_TEMP_SHUT_EINT */ | ||
4254 | #define WM8994_IM_TEMP_SHUT_EINT_WIDTH 1 /* IM_TEMP_SHUT_EINT */ | ||
4255 | |||
4256 | /* | ||
4257 | * R1856 (0x740) - Interrupt Control | ||
4258 | */ | ||
4259 | #define WM8994_IM_IRQ 0x0001 /* IM_IRQ */ | ||
4260 | #define WM8994_IM_IRQ_MASK 0x0001 /* IM_IRQ */ | ||
4261 | #define WM8994_IM_IRQ_SHIFT 0 /* IM_IRQ */ | ||
4262 | #define WM8994_IM_IRQ_WIDTH 1 /* IM_IRQ */ | ||
4263 | |||
4264 | /* | ||
4265 | * R1864 (0x748) - IRQ Debounce | ||
4266 | */ | ||
4267 | #define WM8994_TEMP_WARN_DB 0x0020 /* TEMP_WARN_DB */ | ||
4268 | #define WM8994_TEMP_WARN_DB_MASK 0x0020 /* TEMP_WARN_DB */ | ||
4269 | #define WM8994_TEMP_WARN_DB_SHIFT 5 /* TEMP_WARN_DB */ | ||
4270 | #define WM8994_TEMP_WARN_DB_WIDTH 1 /* TEMP_WARN_DB */ | ||
4271 | #define WM8994_MIC2_SHRT_DB 0x0010 /* MIC2_SHRT_DB */ | ||
4272 | #define WM8994_MIC2_SHRT_DB_MASK 0x0010 /* MIC2_SHRT_DB */ | ||
4273 | #define WM8994_MIC2_SHRT_DB_SHIFT 4 /* MIC2_SHRT_DB */ | ||
4274 | #define WM8994_MIC2_SHRT_DB_WIDTH 1 /* MIC2_SHRT_DB */ | ||
4275 | #define WM8994_MIC2_DET_DB 0x0008 /* MIC2_DET_DB */ | ||
4276 | #define WM8994_MIC2_DET_DB_MASK 0x0008 /* MIC2_DET_DB */ | ||
4277 | #define WM8994_MIC2_DET_DB_SHIFT 3 /* MIC2_DET_DB */ | ||
4278 | #define WM8994_MIC2_DET_DB_WIDTH 1 /* MIC2_DET_DB */ | ||
4279 | #define WM8994_MIC1_SHRT_DB 0x0004 /* MIC1_SHRT_DB */ | ||
4280 | #define WM8994_MIC1_SHRT_DB_MASK 0x0004 /* MIC1_SHRT_DB */ | ||
4281 | #define WM8994_MIC1_SHRT_DB_SHIFT 2 /* MIC1_SHRT_DB */ | ||
4282 | #define WM8994_MIC1_SHRT_DB_WIDTH 1 /* MIC1_SHRT_DB */ | ||
4283 | #define WM8994_MIC1_DET_DB 0x0002 /* MIC1_DET_DB */ | ||
4284 | #define WM8994_MIC1_DET_DB_MASK 0x0002 /* MIC1_DET_DB */ | ||
4285 | #define WM8994_MIC1_DET_DB_SHIFT 1 /* MIC1_DET_DB */ | ||
4286 | #define WM8994_MIC1_DET_DB_WIDTH 1 /* MIC1_DET_DB */ | ||
4287 | #define WM8994_TEMP_SHUT_DB 0x0001 /* TEMP_SHUT_DB */ | ||
4288 | #define WM8994_TEMP_SHUT_DB_MASK 0x0001 /* TEMP_SHUT_DB */ | ||
4289 | #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ | ||
4290 | #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ | ||
4291 | |||
4292 | #endif | ||
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 718ef912e758..df2c6d9617fb 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -1349,7 +1349,7 @@ static irqreturn_t wm8350_hp_jack_handler(int irq, void *data) | |||
1349 | int mask; | 1349 | int mask; |
1350 | struct wm8350_jack_data *jack = NULL; | 1350 | struct wm8350_jack_data *jack = NULL; |
1351 | 1351 | ||
1352 | switch (irq) { | 1352 | switch (irq - wm8350->irq_base) { |
1353 | case WM8350_IRQ_CODEC_JCK_DET_L: | 1353 | case WM8350_IRQ_CODEC_JCK_DET_L: |
1354 | jack = &priv->hpl; | 1354 | jack = &priv->hpl; |
1355 | mask = WM8350_JACK_L_LVL; | 1355 | mask = WM8350_JACK_L_LVL; |
@@ -1424,7 +1424,7 @@ int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which, | |||
1424 | wm8350_set_bits(wm8350, WM8350_JACK_DETECT, ena); | 1424 | wm8350_set_bits(wm8350, WM8350_JACK_DETECT, ena); |
1425 | 1425 | ||
1426 | /* Sync status */ | 1426 | /* Sync status */ |
1427 | wm8350_hp_jack_handler(irq, priv); | 1427 | wm8350_hp_jack_handler(irq + wm8350->irq_base, priv); |
1428 | 1428 | ||
1429 | return 0; | 1429 | return 0; |
1430 | } | 1430 | } |
@@ -1521,8 +1521,8 @@ static int wm8350_remove(struct platform_device *pdev) | |||
1521 | WM8350_JDL_ENA | WM8350_JDR_ENA); | 1521 | WM8350_JDL_ENA | WM8350_JDR_ENA); |
1522 | wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA); | 1522 | wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA); |
1523 | 1523 | ||
1524 | wm8350_free_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_L); | 1524 | wm8350_free_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_L, priv); |
1525 | wm8350_free_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_R); | 1525 | wm8350_free_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_R, priv); |
1526 | 1526 | ||
1527 | priv->hpl.jack = NULL; | 1527 | priv->hpl.jack = NULL; |
1528 | priv->hpr.jack = NULL; | 1528 | priv->hpr.jack = NULL; |