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

Merge tag 'mfd-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD update from Lee Jones:
"Changes to existing drivers:
- checkpatch fixes throughout the subsystem
- use Regmap to handle IRQs in max77686, extcon-max77693 and
mc13xxx-core
- use DMA in rtsx_pcr
- restrict building on unsupported architectures on timberdale,
cs5535
- SPI hardening in cros_ec_spi
- more robust error handing in asic3, cros_ec, ab8500-debugfs,
max77686 and pcf50633-core
- reorder PM runtime and regulator handing during shutdown in arizona
- enable wakeup in cros_ec_spi
- unused variable/code clean-up in pm8921-core, cros_ec, htc-i2cpld,
tps65912-spi, wm5110-tables and ab8500-debugfs
- add regulator handing into suspend() in sec-core
- remove pointless wrapper functions in extcon-max77693 and
i2c-cros-ec-tunnel
- use cross-architecture friendly data sizes in stmpe-i2c, arizona,
max77686 and tps65910
- devicetree documentation updates throughout
- provide power management support in max77686
- few OF clean-ups in max77686
- use manged resources in tps6105x

New drivers/supported devices:
- add support for s2mpu02 to sec-core
- add support for Allwinner A32 to sun6i-prcm
- add support for Maxim 77802 in max77686
- add support for DA9063 AD in da9063
- new driver for Intel PMICs (generic) and specifically Crystal Cove

(Re-)moved drivers ==
- move out keyboard functionality cros_ec ==> input/keyboard/cros_ec_keyb"

* tag 'mfd-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (101 commits)
MAINTAINERS: Update MFD repo location
mfd: omap-usb-host: Fix improper mask use.
mfd: arizona: Only free the CTRLIF_ERR IRQ if we requested it
mfd: arizona: Add missing handling for ISRC3 under/overclocked
mfd: wm5110: Add new interrupt register definitions
mfd: arizona: Rename thermal shutdown interrupt
mfd: wm5110: Add in the output done interrupts
mfd: wm5110: Remove non-existant interrupts
mfd: tps65912-spi: Remove unused variable
mfd: htc-i2cpld: Remove unused code
mfd: da9063: Add support for AD silicon variant
mfd: arizona: Map MICVDD from extcon device to the Arizona core
mfd: arizona: Add MICVDD to mapped regulators for wm8997
mfd: max77686: Ensure device type IDs are architecture agnostic
mfd: max77686: Add Maxim 77802 PMIC support
mfd: tps6105x: Use managed resources when allocating memory
mfd: wm8997-tables: Suppress 'line over 80 chars' warnings
mfd: kempld-core: Correct a variety of checkpatch warnings
mfd: ipaq-micro: Fix coding style errors/warnings reported by checkpatch
mfd: si476x-cmd: Remedy checkpatch style complains
...

+4310 -1438
+10
Documentation/devicetree/bindings/mfd/arizona.txt
··· 42 42 the chip default will be used. If present exactly five values must 43 43 be specified. 44 44 45 + - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if 46 + they are being externally supplied. As covered in 47 + Documentation/devicetree/bindings/regulator/regulator.txt 48 + 49 + Optional subnodes: 50 + - ldo1 : Initial data for the LDO1 regulator, as covered in 51 + Documentation/devicetree/bindings/regulator/regulator.txt 52 + - micvdd : Initial data for the MICVDD regulator, as covered in 53 + Documentation/devicetree/bindings/regulator/regulator.txt 54 + 45 55 Example: 46 56 47 57 codec: wm5102@1a {
+8
Documentation/devicetree/bindings/mfd/as3722.txt
··· 13 13 The second cell is the flags, encoded as the trigger masks from binding document 14 14 interrupts.txt, using dt-bindings/irq. 15 15 16 + Optional properties: 17 + -------------------- 18 + - ams,enable-internal-int-pullup: Boolean property, to enable internal pullup on 19 + interrupt pin. Missing this will disable internal pullup on INT pin. 20 + - ams,enable-internal-i2c-pullup: Boolean property, to enable internal pullup on 21 + i2c scl/sda pins. Missing this will disable internal pullup on i2c 22 + scl/sda lines. 23 + 16 24 Optional submodule and their properties: 17 25 ======================================= 18 26
+7 -4
Documentation/devicetree/bindings/mfd/s2mps11.txt
··· 1 1 2 - * Samsung S2MPS11 and S2MPS14 Voltage and Current Regulator 2 + * Samsung S2MPS11, S2MPS14 and S2MPU02 Voltage and Current Regulator 3 3 4 4 The Samsung S2MPS11 is a multi-function device which includes voltage and 5 5 current regulators, RTC, charger controller and other sub-blocks. It is ··· 7 7 addressed by the host system using different I2C slave addresses. 8 8 9 9 Required properties: 10 - - compatible: Should be "samsung,s2mps11-pmic" or "samsung,s2mps14-pmic". 10 + - compatible: Should be "samsung,s2mps11-pmic" or "samsung,s2mps14-pmic" 11 + or "samsung,s2mpu02-pmic". 11 12 - reg: Specifies the I2C slave address of the pmic block. It should be 0x66. 12 13 13 14 Optional properties: ··· 82 81 - valid values for n are: 83 82 - S2MPS11: 1 to 38 84 83 - S2MPS14: 1 to 25 85 - - Example: LDO1, LD02, LDO28 84 + - S2MPU02: 1 to 28 85 + - Example: LDO1, LDO2, LDO28 86 86 - BUCKn 87 87 - valid values for n are: 88 88 - S2MPS11: 1 to 10 89 89 - S2MPS14: 1 to 5 90 + - S2MPU02: 1 to 7 90 91 - Example: BUCK1, BUCK2, BUCK9 91 92 92 93 Example: ··· 99 96 100 97 s2m_osc: clocks { 101 98 compatible = "samsung,s2mps11-clk"; 102 - #clock-cells = 1; 99 + #clock-cells = <1>; 103 100 clock-output-names = "xx", "yy", "zz"; 104 101 }; 105 102
+1 -1
Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
··· 4 4 (like clks and reset controllers). 5 5 6 6 Required properties: 7 - - compatible: "allwinner,sun6i-a31-prcm" 7 + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm" 8 8 - reg: The PRCM registers range 9 9 10 10 The prcm node may contain several subdevices definitions:
+1 -1
Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt
··· 86 86 87 87 - LDOn 88 88 - valid values for n are 1 to 28 89 - - Example: LDO1, LD02, LDO28 89 + - Example: LDO1, LDO2, LDO28 90 90 - BUCKn 91 91 - valid values for n are 1 to 9. 92 92 - Example: BUCK1, BUCK2, BUCK9
+1 -2
MAINTAINERS
··· 6037 6037 MULTIFUNCTION DEVICES (MFD) 6038 6038 M: Samuel Ortiz <sameo@linux.intel.com> 6039 6039 M: Lee Jones <lee.jones@linaro.org> 6040 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next.git 6041 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes.git 6040 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git 6042 6041 S: Supported 6043 6042 F: drivers/mfd/ 6044 6043 F: include/linux/mfd/
+13
drivers/gpio/Kconfig
··· 450 450 help 451 451 Support for GPIOs on Wolfson Arizona class devices. 452 452 453 + config GPIO_CRYSTAL_COVE 454 + tristate "GPIO support for Crystal Cove PMIC" 455 + depends on INTEL_SOC_PMIC 456 + select GPIOLIB_IRQCHIP 457 + help 458 + Support for GPIO pins on Crystal Cove PMIC. 459 + 460 + Say Yes if you have a Intel SoC based tablet with Crystal Cove PMIC 461 + inside. 462 + 463 + This driver can also be built as a module. If so, the module will be 464 + called gpio-crystalcove. 465 + 453 466 config GPIO_LP3943 454 467 tristate "TI/National Semiconductor LP3943 GPIO expander" 455 468 depends on MFD_LP3943
+1
drivers/gpio/Makefile
··· 20 20 obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o 21 21 obj-$(CONFIG_GPIO_CLPS711X) += gpio-clps711x.o 22 22 obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o 23 + obj-$(CONFIG_GPIO_CRYSTAL_COVE) += gpio-crystalcove.o 23 24 obj-$(CONFIG_GPIO_DA9052) += gpio-da9052.o 24 25 obj-$(CONFIG_GPIO_DA9055) += gpio-da9055.o 25 26 obj-$(CONFIG_GPIO_DAVINCI) += gpio-davinci.o
+380
drivers/gpio/gpio-crystalcove.c
··· 1 + /* 2 + * gpio-crystalcove.c - Intel Crystal Cove GPIO Driver 3 + * 4 + * Copyright (C) 2012, 2014 Intel Corporation. All rights reserved. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License version 8 + * 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * Author: Yang, Bin <bin.yang@intel.com> 16 + */ 17 + 18 + #include <linux/interrupt.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/gpio.h> 21 + #include <linux/seq_file.h> 22 + #include <linux/bitops.h> 23 + #include <linux/regmap.h> 24 + #include <linux/mfd/intel_soc_pmic.h> 25 + 26 + #define CRYSTALCOVE_GPIO_NUM 16 27 + 28 + #define UPDATE_IRQ_TYPE BIT(0) 29 + #define UPDATE_IRQ_MASK BIT(1) 30 + 31 + #define GPIO0IRQ 0x0b 32 + #define GPIO1IRQ 0x0c 33 + #define MGPIO0IRQS0 0x19 34 + #define MGPIO1IRQS0 0x1a 35 + #define MGPIO0IRQSX 0x1b 36 + #define MGPIO1IRQSX 0x1c 37 + #define GPIO0P0CTLO 0x2b 38 + #define GPIO0P0CTLI 0x33 39 + #define GPIO1P0CTLO 0x3b 40 + #define GPIO1P0CTLI 0x43 41 + 42 + #define CTLI_INTCNT_DIS (0) 43 + #define CTLI_INTCNT_NE (1 << 1) 44 + #define CTLI_INTCNT_PE (2 << 1) 45 + #define CTLI_INTCNT_BE (3 << 1) 46 + 47 + #define CTLO_DIR_IN (0) 48 + #define CTLO_DIR_OUT (1 << 5) 49 + 50 + #define CTLO_DRV_CMOS (0) 51 + #define CTLO_DRV_OD (1 << 4) 52 + 53 + #define CTLO_DRV_REN (1 << 3) 54 + 55 + #define CTLO_RVAL_2KDW (0) 56 + #define CTLO_RVAL_2KUP (1 << 1) 57 + #define CTLO_RVAL_50KDW (2 << 1) 58 + #define CTLO_RVAL_50KUP (3 << 1) 59 + 60 + #define CTLO_INPUT_SET (CTLO_DRV_CMOS | CTLO_DRV_REN | CTLO_RVAL_2KUP) 61 + #define CTLO_OUTPUT_SET (CTLO_DIR_OUT | CTLO_INPUT_SET) 62 + 63 + enum ctrl_register { 64 + CTRL_IN, 65 + CTRL_OUT, 66 + }; 67 + 68 + /** 69 + * struct crystalcove_gpio - Crystal Cove GPIO controller 70 + * @buslock: for bus lock/sync and unlock. 71 + * @chip: the abstract gpio_chip structure. 72 + * @regmap: the regmap from the parent device. 73 + * @update: pending IRQ setting update, to be written to the chip upon unlock. 74 + * @intcnt_value: the Interrupt Detect value to be written. 75 + * @set_irq_mask: true if the IRQ mask needs to be set, false to clear. 76 + */ 77 + struct crystalcove_gpio { 78 + struct mutex buslock; /* irq_bus_lock */ 79 + struct gpio_chip chip; 80 + struct regmap *regmap; 81 + int update; 82 + int intcnt_value; 83 + bool set_irq_mask; 84 + }; 85 + 86 + static inline struct crystalcove_gpio *to_cg(struct gpio_chip *gc) 87 + { 88 + return container_of(gc, struct crystalcove_gpio, chip); 89 + } 90 + 91 + static inline int to_reg(int gpio, enum ctrl_register reg_type) 92 + { 93 + int reg; 94 + 95 + if (reg_type == CTRL_IN) { 96 + if (gpio < 8) 97 + reg = GPIO0P0CTLI; 98 + else 99 + reg = GPIO1P0CTLI; 100 + } else { 101 + if (gpio < 8) 102 + reg = GPIO0P0CTLO; 103 + else 104 + reg = GPIO1P0CTLO; 105 + } 106 + 107 + return reg + gpio % 8; 108 + } 109 + 110 + static void crystalcove_update_irq_mask(struct crystalcove_gpio *cg, 111 + int gpio) 112 + { 113 + u8 mirqs0 = gpio < 8 ? MGPIO0IRQS0 : MGPIO1IRQS0; 114 + int mask = BIT(gpio % 8); 115 + 116 + if (cg->set_irq_mask) 117 + regmap_update_bits(cg->regmap, mirqs0, mask, mask); 118 + else 119 + regmap_update_bits(cg->regmap, mirqs0, mask, 0); 120 + } 121 + 122 + static void crystalcove_update_irq_ctrl(struct crystalcove_gpio *cg, int gpio) 123 + { 124 + int reg = to_reg(gpio, CTRL_IN); 125 + 126 + regmap_update_bits(cg->regmap, reg, CTLI_INTCNT_BE, cg->intcnt_value); 127 + } 128 + 129 + static int crystalcove_gpio_dir_in(struct gpio_chip *chip, unsigned gpio) 130 + { 131 + struct crystalcove_gpio *cg = to_cg(chip); 132 + 133 + return regmap_write(cg->regmap, to_reg(gpio, CTRL_OUT), 134 + CTLO_INPUT_SET); 135 + } 136 + 137 + static int crystalcove_gpio_dir_out(struct gpio_chip *chip, unsigned gpio, 138 + int value) 139 + { 140 + struct crystalcove_gpio *cg = to_cg(chip); 141 + 142 + return regmap_write(cg->regmap, to_reg(gpio, CTRL_OUT), 143 + CTLO_OUTPUT_SET | value); 144 + } 145 + 146 + static int crystalcove_gpio_get(struct gpio_chip *chip, unsigned gpio) 147 + { 148 + struct crystalcove_gpio *cg = to_cg(chip); 149 + int ret; 150 + unsigned int val; 151 + 152 + ret = regmap_read(cg->regmap, to_reg(gpio, CTRL_IN), &val); 153 + if (ret) 154 + return ret; 155 + 156 + return val & 0x1; 157 + } 158 + 159 + static void crystalcove_gpio_set(struct gpio_chip *chip, 160 + unsigned gpio, int value) 161 + { 162 + struct crystalcove_gpio *cg = to_cg(chip); 163 + 164 + if (value) 165 + regmap_update_bits(cg->regmap, to_reg(gpio, CTRL_OUT), 1, 1); 166 + else 167 + regmap_update_bits(cg->regmap, to_reg(gpio, CTRL_OUT), 1, 0); 168 + } 169 + 170 + static int crystalcove_irq_type(struct irq_data *data, unsigned type) 171 + { 172 + struct crystalcove_gpio *cg = to_cg(irq_data_get_irq_chip_data(data)); 173 + 174 + switch (type) { 175 + case IRQ_TYPE_NONE: 176 + cg->intcnt_value = CTLI_INTCNT_DIS; 177 + break; 178 + case IRQ_TYPE_EDGE_BOTH: 179 + cg->intcnt_value = CTLI_INTCNT_BE; 180 + break; 181 + case IRQ_TYPE_EDGE_RISING: 182 + cg->intcnt_value = CTLI_INTCNT_PE; 183 + break; 184 + case IRQ_TYPE_EDGE_FALLING: 185 + cg->intcnt_value = CTLI_INTCNT_NE; 186 + break; 187 + default: 188 + return -EINVAL; 189 + } 190 + 191 + cg->update |= UPDATE_IRQ_TYPE; 192 + 193 + return 0; 194 + } 195 + 196 + static void crystalcove_bus_lock(struct irq_data *data) 197 + { 198 + struct crystalcove_gpio *cg = to_cg(irq_data_get_irq_chip_data(data)); 199 + 200 + mutex_lock(&cg->buslock); 201 + } 202 + 203 + static void crystalcove_bus_sync_unlock(struct irq_data *data) 204 + { 205 + struct crystalcove_gpio *cg = to_cg(irq_data_get_irq_chip_data(data)); 206 + int gpio = data->hwirq; 207 + 208 + if (cg->update & UPDATE_IRQ_TYPE) 209 + crystalcove_update_irq_ctrl(cg, gpio); 210 + if (cg->update & UPDATE_IRQ_MASK) 211 + crystalcove_update_irq_mask(cg, gpio); 212 + cg->update = 0; 213 + 214 + mutex_unlock(&cg->buslock); 215 + } 216 + 217 + static void crystalcove_irq_unmask(struct irq_data *data) 218 + { 219 + struct crystalcove_gpio *cg = to_cg(irq_data_get_irq_chip_data(data)); 220 + 221 + cg->set_irq_mask = false; 222 + cg->update |= UPDATE_IRQ_MASK; 223 + } 224 + 225 + static void crystalcove_irq_mask(struct irq_data *data) 226 + { 227 + struct crystalcove_gpio *cg = to_cg(irq_data_get_irq_chip_data(data)); 228 + 229 + cg->set_irq_mask = true; 230 + cg->update |= UPDATE_IRQ_MASK; 231 + } 232 + 233 + static struct irq_chip crystalcove_irqchip = { 234 + .name = "Crystal Cove", 235 + .irq_mask = crystalcove_irq_mask, 236 + .irq_unmask = crystalcove_irq_unmask, 237 + .irq_set_type = crystalcove_irq_type, 238 + .irq_bus_lock = crystalcove_bus_lock, 239 + .irq_bus_sync_unlock = crystalcove_bus_sync_unlock, 240 + }; 241 + 242 + static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data) 243 + { 244 + struct crystalcove_gpio *cg = data; 245 + unsigned int p0, p1; 246 + int pending; 247 + int gpio; 248 + unsigned int virq; 249 + 250 + if (regmap_read(cg->regmap, GPIO0IRQ, &p0) || 251 + regmap_read(cg->regmap, GPIO1IRQ, &p1)) 252 + return IRQ_NONE; 253 + 254 + regmap_write(cg->regmap, GPIO0IRQ, p0); 255 + regmap_write(cg->regmap, GPIO1IRQ, p1); 256 + 257 + pending = p0 | p1 << 8; 258 + 259 + for (gpio = 0; gpio < cg->chip.ngpio; gpio++) { 260 + if (pending & BIT(gpio)) { 261 + virq = irq_find_mapping(cg->chip.irqdomain, gpio); 262 + generic_handle_irq(virq); 263 + } 264 + } 265 + 266 + return IRQ_HANDLED; 267 + } 268 + 269 + static void crystalcove_gpio_dbg_show(struct seq_file *s, 270 + struct gpio_chip *chip) 271 + { 272 + struct crystalcove_gpio *cg = to_cg(chip); 273 + int gpio, offset; 274 + unsigned int ctlo, ctli, mirqs0, mirqsx, irq; 275 + 276 + for (gpio = 0; gpio < cg->chip.ngpio; gpio++) { 277 + regmap_read(cg->regmap, to_reg(gpio, CTRL_OUT), &ctlo); 278 + regmap_read(cg->regmap, to_reg(gpio, CTRL_IN), &ctli); 279 + regmap_read(cg->regmap, gpio < 8 ? MGPIO0IRQS0 : MGPIO1IRQS0, 280 + &mirqs0); 281 + regmap_read(cg->regmap, gpio < 8 ? MGPIO0IRQSX : MGPIO1IRQSX, 282 + &mirqsx); 283 + regmap_read(cg->regmap, gpio < 8 ? GPIO0IRQ : GPIO1IRQ, 284 + &irq); 285 + 286 + offset = gpio % 8; 287 + seq_printf(s, " gpio-%-2d %s %s %s %s ctlo=%2x,%s %s %s\n", 288 + gpio, ctlo & CTLO_DIR_OUT ? "out" : "in ", 289 + ctli & 0x1 ? "hi" : "lo", 290 + ctli & CTLI_INTCNT_NE ? "fall" : " ", 291 + ctli & CTLI_INTCNT_PE ? "rise" : " ", 292 + ctlo, 293 + mirqs0 & BIT(offset) ? "s0 mask " : "s0 unmask", 294 + mirqsx & BIT(offset) ? "sx mask " : "sx unmask", 295 + irq & BIT(offset) ? "pending" : " "); 296 + } 297 + } 298 + 299 + static int crystalcove_gpio_probe(struct platform_device *pdev) 300 + { 301 + int irq = platform_get_irq(pdev, 0); 302 + struct crystalcove_gpio *cg; 303 + int retval; 304 + struct device *dev = pdev->dev.parent; 305 + struct intel_soc_pmic *pmic = dev_get_drvdata(dev); 306 + 307 + if (irq < 0) 308 + return irq; 309 + 310 + cg = devm_kzalloc(&pdev->dev, sizeof(*cg), GFP_KERNEL); 311 + if (!cg) 312 + return -ENOMEM; 313 + 314 + platform_set_drvdata(pdev, cg); 315 + 316 + mutex_init(&cg->buslock); 317 + cg->chip.label = KBUILD_MODNAME; 318 + cg->chip.direction_input = crystalcove_gpio_dir_in; 319 + cg->chip.direction_output = crystalcove_gpio_dir_out; 320 + cg->chip.get = crystalcove_gpio_get; 321 + cg->chip.set = crystalcove_gpio_set; 322 + cg->chip.base = -1; 323 + cg->chip.ngpio = CRYSTALCOVE_GPIO_NUM; 324 + cg->chip.can_sleep = true; 325 + cg->chip.dev = dev; 326 + cg->chip.dbg_show = crystalcove_gpio_dbg_show; 327 + cg->regmap = pmic->regmap; 328 + 329 + retval = gpiochip_add(&cg->chip); 330 + if (retval) { 331 + dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval); 332 + return retval; 333 + } 334 + 335 + gpiochip_irqchip_add(&cg->chip, &crystalcove_irqchip, 0, 336 + handle_simple_irq, IRQ_TYPE_NONE); 337 + 338 + retval = request_threaded_irq(irq, NULL, crystalcove_gpio_irq_handler, 339 + IRQF_ONESHOT, KBUILD_MODNAME, cg); 340 + 341 + if (retval) { 342 + dev_warn(&pdev->dev, "request irq failed: %d\n", retval); 343 + goto out_remove_gpio; 344 + } 345 + 346 + return 0; 347 + 348 + out_remove_gpio: 349 + WARN_ON(gpiochip_remove(&cg->chip)); 350 + return retval; 351 + } 352 + 353 + static int crystalcove_gpio_remove(struct platform_device *pdev) 354 + { 355 + struct crystalcove_gpio *cg = platform_get_drvdata(pdev); 356 + int irq = platform_get_irq(pdev, 0); 357 + int err; 358 + 359 + err = gpiochip_remove(&cg->chip); 360 + 361 + if (irq >= 0) 362 + free_irq(irq, cg); 363 + 364 + return err; 365 + } 366 + 367 + static struct platform_driver crystalcove_gpio_driver = { 368 + .probe = crystalcove_gpio_probe, 369 + .remove = crystalcove_gpio_remove, 370 + .driver = { 371 + .name = "crystal_cove_gpio", 372 + .owner = THIS_MODULE, 373 + }, 374 + }; 375 + 376 + module_platform_driver(crystalcove_gpio_driver); 377 + 378 + MODULE_AUTHOR("Yang, Bin <bin.yang@intel.com>"); 379 + MODULE_DESCRIPTION("Intel Crystal Cove GPIO Driver"); 380 + MODULE_LICENSE("GPL v2");
+12 -5
drivers/i2c/busses/i2c-cros-ec-tunnel.c
··· 183 183 u8 *request = NULL; 184 184 u8 *response = NULL; 185 185 int result; 186 + struct cros_ec_command msg; 186 187 187 188 request_len = ec_i2c_count_message(i2c_msgs, num); 188 189 if (request_len < 0) { ··· 219 218 } 220 219 221 220 ec_i2c_construct_message(request, i2c_msgs, num, bus_num); 222 - result = bus->ec->command_sendrecv(bus->ec, EC_CMD_I2C_PASSTHRU, 223 - request, request_len, 224 - response, response_len); 225 - if (result) 221 + 222 + msg.version = 0; 223 + msg.command = EC_CMD_I2C_PASSTHRU; 224 + msg.outdata = request; 225 + msg.outsize = request_len; 226 + msg.indata = response; 227 + msg.insize = response_len; 228 + 229 + result = bus->ec->cmd_xfer(bus->ec, &msg); 230 + if (result < 0) 226 231 goto exit; 227 232 228 233 result = ec_i2c_parse_response(response, i2c_msgs, &num); ··· 265 258 u32 remote_bus; 266 259 int err; 267 260 268 - if (!ec->command_sendrecv) { 261 + if (!ec->cmd_xfer) { 269 262 dev_err(dev, "Missing sendrecv\n"); 270 263 return -EINVAL; 271 264 }
+45 -29
drivers/input/keyboard/cros_ec_keyb.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/i2c.h> 26 26 #include <linux/input.h> 27 + #include <linux/interrupt.h> 27 28 #include <linux/kernel.h> 28 - #include <linux/notifier.h> 29 29 #include <linux/platform_device.h> 30 30 #include <linux/slab.h> 31 31 #include <linux/input/matrix_keypad.h> ··· 42 42 * @dev: Device pointer 43 43 * @idev: Input device 44 44 * @ec: Top level ChromeOS device to use to talk to EC 45 - * @event_notifier: interrupt event notifier for transport devices 46 45 */ 47 46 struct cros_ec_keyb { 48 47 unsigned int rows; ··· 54 55 struct device *dev; 55 56 struct input_dev *idev; 56 57 struct cros_ec_device *ec; 57 - struct notifier_block notifier; 58 58 }; 59 59 60 60 ··· 171 173 input_sync(ckdev->idev); 172 174 } 173 175 176 + static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state) 177 + { 178 + struct cros_ec_command msg = { 179 + .version = 0, 180 + .command = EC_CMD_MKBP_STATE, 181 + .outdata = NULL, 182 + .outsize = 0, 183 + .indata = kb_state, 184 + .insize = ckdev->cols, 185 + }; 186 + 187 + return ckdev->ec->cmd_xfer(ckdev->ec, &msg); 188 + } 189 + 190 + static irqreturn_t cros_ec_keyb_irq(int irq, void *data) 191 + { 192 + struct cros_ec_keyb *ckdev = data; 193 + struct cros_ec_device *ec = ckdev->ec; 194 + int ret; 195 + uint8_t kb_state[ckdev->cols]; 196 + 197 + if (device_may_wakeup(ec->dev)) 198 + pm_wakeup_event(ec->dev, 0); 199 + 200 + ret = cros_ec_keyb_get_state(ckdev, kb_state); 201 + if (ret >= 0) 202 + cros_ec_keyb_process(ckdev, kb_state, ret); 203 + else 204 + dev_err(ec->dev, "failed to get keyboard state: %d\n", ret); 205 + 206 + return IRQ_HANDLED; 207 + } 208 + 174 209 static int cros_ec_keyb_open(struct input_dev *dev) 175 210 { 176 211 struct cros_ec_keyb *ckdev = input_get_drvdata(dev); 212 + struct cros_ec_device *ec = ckdev->ec; 177 213 178 - return blocking_notifier_chain_register(&ckdev->ec->event_notifier, 179 - &ckdev->notifier); 214 + return request_threaded_irq(ec->irq, NULL, cros_ec_keyb_irq, 215 + IRQF_TRIGGER_LOW | IRQF_ONESHOT, 216 + "cros_ec_keyb", ckdev); 180 217 } 181 218 182 219 static void cros_ec_keyb_close(struct input_dev *dev) 183 220 { 184 221 struct cros_ec_keyb *ckdev = input_get_drvdata(dev); 222 + struct cros_ec_device *ec = ckdev->ec; 185 223 186 - blocking_notifier_chain_unregister(&ckdev->ec->event_notifier, 187 - &ckdev->notifier); 188 - } 189 - 190 - static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state) 191 - { 192 - return ckdev->ec->command_recv(ckdev->ec, EC_CMD_MKBP_STATE, 193 - kb_state, ckdev->cols); 194 - } 195 - 196 - static int cros_ec_keyb_work(struct notifier_block *nb, 197 - unsigned long state, void *_notify) 198 - { 199 - int ret; 200 - struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb, 201 - notifier); 202 - uint8_t kb_state[ckdev->cols]; 203 - 204 - ret = cros_ec_keyb_get_state(ckdev, kb_state); 205 - if (ret >= 0) 206 - cros_ec_keyb_process(ckdev, kb_state, ret); 207 - 208 - return NOTIFY_DONE; 224 + free_irq(ec->irq, ckdev); 209 225 } 210 226 211 227 static int cros_ec_keyb_probe(struct platform_device *pdev) ··· 250 238 if (!idev) 251 239 return -ENOMEM; 252 240 241 + if (!ec->irq) { 242 + dev_err(dev, "no EC IRQ specified\n"); 243 + return -EINVAL; 244 + } 245 + 253 246 ckdev->ec = ec; 254 - ckdev->notifier.notifier_call = cros_ec_keyb_work; 255 247 ckdev->dev = dev; 256 248 dev_set_drvdata(&pdev->dev, ckdev); 257 249
+1 -1
drivers/mfd/88pm805.c
··· 158 158 * PM805_INT_STATUS is under 32K clock domain, so need to 159 159 * add proper delay before the next I2C register access. 160 160 */ 161 - msleep(1); 161 + usleep_range(1000, 3000); 162 162 163 163 if (ret < 0) 164 164 goto out;
+22 -15
drivers/mfd/88pm860x-core.c
··· 2 2 * Base driver for Marvell 88PM8607 3 3 * 4 4 * Copyright (C) 2009 Marvell International Ltd. 5 - * Haojian Zhuang <haojian.zhuang@marvell.com> 5 + * 6 + * Author: Haojian Zhuang <haojian.zhuang@marvell.com> 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License version 2 as ··· 141 140 /* Headset insertion or removal */ 142 141 {PM8607_IRQ_HEADSET, PM8607_IRQ_HEADSET, "headset", IORESOURCE_IRQ,}, 143 142 /* Audio short */ 144 - {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,}, 143 + {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", 144 + IORESOURCE_IRQ,}, 145 145 }; 146 146 147 147 static struct resource battery_resources[] = { ··· 152 150 153 151 static struct resource charger_resources[] = { 154 152 {PM8607_IRQ_CHG, PM8607_IRQ_CHG, "charger detect", IORESOURCE_IRQ,}, 155 - {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,}, 156 - {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,}, 157 - {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,}, 158 - {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,}, 153 + {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", 154 + IORESOURCE_IRQ,}, 155 + {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", 156 + IORESOURCE_IRQ,}, 157 + {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", 158 + IORESOURCE_IRQ,}, 159 + {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", 160 + IORESOURCE_IRQ,}, 159 161 {PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,}, 160 162 {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, 161 163 }; ··· 574 568 static int device_irq_init(struct pm860x_chip *chip, 575 569 struct pm860x_platform_data *pdata) 576 570 { 577 - struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ 578 - : chip->companion; 571 + struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? 572 + chip->client : chip->companion; 579 573 unsigned char status_buf[INT_STATUS_NUM]; 580 574 unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; 581 575 int data, mask, ret = -EINVAL; ··· 637 631 if (!chip->core_irq) 638 632 goto out; 639 633 640 - ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT, 641 - "88pm860x", chip); 634 + ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, 635 + flags | IRQF_ONESHOT, "88pm860x", chip); 642 636 if (ret) { 643 637 dev_err(chip->dev, "Failed to request IRQ: %d\n", ret); 644 638 chip->core_irq = 0; ··· 877 871 { 878 872 int ret; 879 873 880 - if ((pdata == NULL)) 874 + if (!pdata) 881 875 return; 882 876 883 877 rtc_devs[0].platform_data = pdata->rtc; ··· 1003 997 ret); 1004 998 break; 1005 999 default: 1006 - dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " 1007 - "Chip ID: %02x\n", ret); 1000 + dev_err(chip->dev, 1001 + "Failed to detect Marvell 88PM8607. Chip ID: %02x\n", 1002 + ret); 1008 1003 goto out; 1009 1004 } 1010 1005 ··· 1127 1120 ret = of_property_read_u32(np, "marvell,88pm860x-slave-addr", 1128 1121 &pdata->companion_addr); 1129 1122 if (ret) { 1130 - dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" " 1131 - "property\n"); 1123 + dev_err(dev, 1124 + "Not found \"marvell,88pm860x-slave-addr\" property\n"); 1132 1125 pdata->companion_addr = 0; 1133 1126 } 1134 1127 return 0;
+2 -1
drivers/mfd/88pm860x-i2c.c
··· 2 2 * I2C driver for Marvell 88PM860x 3 3 * 4 4 * Copyright (C) 2009 Marvell International Ltd. 5 - * Haojian Zhuang <haojian.zhuang@marvell.com> 5 + * 6 + * Author: Haojian Zhuang <haojian.zhuang@marvell.com> 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License version 2 as
+20 -5
drivers/mfd/Kconfig
··· 13 13 config MFD_CS5535 14 14 tristate "AMD CS5535 and CS5536 southbridge core functions" 15 15 select MFD_CORE 16 - depends on PCI && X86 16 + depends on PCI && (X86_32 || (X86 && COMPILE_TEST)) 17 17 ---help--- 18 18 This is the core driver for CS5535/CS5536 MFD functions. This is 19 19 necessary for using the board's GPIO and MFGPT functionality. ··· 187 187 tristate 188 188 depends on (SPI_MASTER || I2C) 189 189 select MFD_CORE 190 + select REGMAP_IRQ 190 191 help 191 192 Enable support for the Freescale MC13783 and MC13892 PMICs. 192 193 This driver provides common support for accessing the device, ··· 253 252 help 254 253 LPC bridge function of the Intel SCH provides support for 255 254 System Management Bus and General Purpose I/O. 255 + 256 + config INTEL_SOC_PMIC 257 + bool "Support for Intel Atom SoC PMIC" 258 + depends on I2C=y 259 + select MFD_CORE 260 + select REGMAP_I2C 261 + select REGMAP_IRQ 262 + help 263 + Select this option to enable support for the PMIC device 264 + on some Intel SoC systems. The PMIC provides ADC, GPIO, 265 + thermal, charger and related power management functions 266 + on these systems. 256 267 257 268 config MFD_INTEL_MSIC 258 269 bool "Intel MSIC" ··· 380 367 of the device. 381 368 382 369 config MFD_MAX77686 383 - bool "Maxim Semiconductor MAX77686 PMIC Support" 370 + bool "Maxim Semiconductor MAX77686/802 PMIC Support" 384 371 depends on I2C=y 385 372 select MFD_CORE 386 373 select REGMAP_I2C 374 + select REGMAP_IRQ 387 375 select IRQ_DOMAIN 388 376 help 389 - Say yes here to add support for Maxim Semiconductor MAX77686. 390 - This is a Power Management IC with RTC on chip. 377 + Say yes here to add support for Maxim Semiconductor MAX77686 and 378 + MAX77802 which are Power Management IC with an RTC on chip. 391 379 This driver provides common support for accessing the device; 392 380 additional drivers must be enabled in order to use the functionality 393 381 of the device. ··· 588 574 select MFD_CORE 589 575 select REGMAP_I2C 590 576 select REGMAP_IRQ 577 + select REGULATOR 591 578 help 592 579 Support for the Samsung Electronics MFD series. 593 580 This driver provides common support for accessing the device, ··· 1072 1057 config MFD_TIMBERDALE 1073 1058 tristate "Timberdale FPGA" 1074 1059 select MFD_CORE 1075 - depends on PCI && GPIOLIB 1060 + depends on PCI && GPIOLIB && (X86_32 || COMPILE_TEST) 1076 1061 ---help--- 1077 1062 This is the core driver for the timberdale FPGA. This device is a 1078 1063 multifunction device which exposes numerous platform devices.
+4 -1
drivers/mfd/Makefile
··· 115 115 obj-$(CONFIG_MFD_DA9063) += da9063.o 116 116 117 117 obj-$(CONFIG_MFD_MAX14577) += max14577.o 118 - obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o 118 + obj-$(CONFIG_MFD_MAX77686) += max77686.o 119 119 obj-$(CONFIG_MFD_MAX77693) += max77693.o 120 120 obj-$(CONFIG_MFD_MAX8907) += max8907.o 121 121 max8925-objs := max8925-core.o max8925-i2c.o ··· 169 169 obj-$(CONFIG_MFD_AS3722) += as3722.o 170 170 obj-$(CONFIG_MFD_STW481X) += stw481x.o 171 171 obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o 172 + 173 + intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o 174 + obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
+4 -1
drivers/mfd/aat2870-core.c
··· 303 303 while (*start == ' ') 304 304 start++; 305 305 306 - addr = simple_strtoul(start, &start, 16); 306 + ret = kstrtoul(start, 16, &addr); 307 + if (ret) 308 + return ret; 309 + 307 310 if (addr >= AAT2870_REG_NUM) { 308 311 dev_err(aat2870->dev, "Invalid address, 0x%lx\n", addr); 309 312 return -EINVAL;
+26 -28
drivers/mfd/ab3100-core.c
··· 91 91 err); 92 92 } else if (err != 2) { 93 93 dev_err(ab3100->dev, 94 - "write error (write register) " 95 - "%d bytes transferred (expected 2)\n", 94 + "write error (write register)\n" 95 + " %d bytes transferred (expected 2)\n", 96 96 err); 97 97 err = -EIO; 98 98 } else { ··· 135 135 err); 136 136 } else if (err != 2) { 137 137 dev_err(ab3100->dev, 138 - "write error (write test register) " 139 - "%d bytes transferred (expected 2)\n", 138 + "write error (write test register)\n" 139 + " %d bytes transferred (expected 2)\n", 140 140 err); 141 141 err = -EIO; 142 142 } else { ··· 171 171 goto get_reg_out_unlock; 172 172 } else if (err != 1) { 173 173 dev_err(ab3100->dev, 174 - "write error (send register address) " 175 - "%d bytes transferred (expected 1)\n", 174 + "write error (send register address)\n" 175 + " %d bytes transferred (expected 1)\n", 176 176 err); 177 177 err = -EIO; 178 178 goto get_reg_out_unlock; ··· 189 189 goto get_reg_out_unlock; 190 190 } else if (err != 1) { 191 191 dev_err(ab3100->dev, 192 - "write error (read register) " 193 - "%d bytes transferred (expected 1)\n", 192 + "write error (read register)\n" 193 + " %d bytes transferred (expected 1)\n", 194 194 err); 195 195 err = -EIO; 196 196 goto get_reg_out_unlock; ··· 237 237 goto get_reg_page_out_unlock; 238 238 } else if (err != 1) { 239 239 dev_err(ab3100->dev, 240 - "write error (send first register address) " 241 - "%d bytes transferred (expected 1)\n", 240 + "write error (send first register address)\n" 241 + " %d bytes transferred (expected 1)\n", 242 242 err); 243 243 err = -EIO; 244 244 goto get_reg_page_out_unlock; ··· 252 252 goto get_reg_page_out_unlock; 253 253 } else if (err != numregs) { 254 254 dev_err(ab3100->dev, 255 - "write error (read register page) " 256 - "%d bytes transferred (expected %d)\n", 255 + "write error (read register page)\n" 256 + " %d bytes transferred (expected %d)\n", 257 257 err, numregs); 258 258 err = -EIO; 259 259 goto get_reg_page_out_unlock; ··· 295 295 goto get_maskset_unlock; 296 296 } else if (err != 1) { 297 297 dev_err(ab3100->dev, 298 - "write error (maskset send address) " 299 - "%d bytes transferred (expected 1)\n", 298 + "write error (maskset send address)\n" 299 + " %d bytes transferred (expected 1)\n", 300 300 err); 301 301 err = -EIO; 302 302 goto get_maskset_unlock; ··· 310 310 goto get_maskset_unlock; 311 311 } else if (err != 1) { 312 312 dev_err(ab3100->dev, 313 - "write error (maskset read register) " 314 - "%d bytes transferred (expected 1)\n", 313 + "write error (maskset read register)\n" 314 + " %d bytes transferred (expected 1)\n", 315 315 err); 316 316 err = -EIO; 317 317 goto get_maskset_unlock; ··· 330 330 goto get_maskset_unlock; 331 331 } else if (err != 2) { 332 332 dev_err(ab3100->dev, 333 - "write error (write register) " 334 - "%d bytes transferred (expected 2)\n", 333 + "write error (write register)\n" 334 + " %d bytes transferred (expected 2)\n", 335 335 err); 336 336 err = -EIO; 337 337 goto get_maskset_unlock; ··· 371 371 int ab3100_event_unregister(struct ab3100 *ab3100, 372 372 struct notifier_block *nb) 373 373 { 374 - return blocking_notifier_chain_unregister(&ab3100->event_subscribers, 374 + return blocking_notifier_chain_unregister(&ab3100->event_subscribers, 375 375 nb); 376 376 } 377 377 EXPORT_SYMBOL(ab3100_event_unregister); ··· 455 455 u8 value; 456 456 u8 reg; 457 457 458 - seq_printf(s, "AB3100 registers:\n"); 458 + seq_puts(s, "AB3100 registers:\n"); 459 459 460 460 for (reg = 0; reg < 0xff; reg++) { 461 461 ab3100_get_register_interruptible(ab3100, reg, &value); ··· 560 560 ab3100_get_register_interruptible(ab3100, user_reg, &regvalue); 561 561 562 562 dev_info(ab3100->dev, 563 - "debug write reg[0x%02x] with 0x%02x, " 564 - "after readback: 0x%02x\n", 563 + "debug write reg[0x%02x]\n" 564 + " with 0x%02x, after readback: 0x%02x\n", 565 565 user_reg, user_value, regvalue); 566 566 } 567 567 return buf_size; ··· 719 719 */ 720 720 if (ab3100->chip_id == 0xc4) { 721 721 dev_warn(ab3100->dev, 722 - "AB3100 P1E variant detected, " 723 - "forcing chip to 32KHz\n"); 722 + "AB3100 P1E variant detected forcing chip to 32KHz\n"); 724 723 err = ab3100_set_test_register_interruptible(ab3100, 725 724 0x02, 0x08); 726 725 } ··· 877 878 &ab3100->chip_id); 878 879 if (err) { 879 880 dev_err(&client->dev, 880 - "could not communicate with the AB3100 analog " 881 - "baseband chip\n"); 881 + "failed to communicate with AB3100 chip\n"); 882 882 goto exit_no_detect; 883 883 } 884 884 ··· 900 902 if (ids[i].id == 0x0) { 901 903 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n", 902 904 ab3100->chip_id); 903 - dev_err(&client->dev, "accepting it anyway. Please update " 904 - "the driver.\n"); 905 + dev_err(&client->dev, 906 + "accepting it anyway. Please update the driver.\n"); 905 907 goto exit_no_detect; 906 908 } 907 909
+26 -23
drivers/mfd/ab8500-core.c
··· 148 148 149 149 /* AB8540 support */ 150 150 static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = { 151 - 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23, 152 - 25, 26, 27, 28, 29, 30, 31, 151 + 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 152 + 23, 25, 26, 27, 28, 29, 30, 31, 153 153 }; 154 154 155 155 static const char ab8500_version_str[][7] = { ··· 322 322 struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); 323 323 324 324 atomic_inc(&ab8500->transfer_ongoing); 325 - ret= mask_and_set_register_interruptible(ab8500, bank, reg, 325 + ret = mask_and_set_register_interruptible(ab8500, bank, reg, 326 326 bitmask, bitvalues); 327 327 atomic_dec(&ab8500->transfer_ongoing); 328 328 return ret; ··· 415 415 if (type & IRQ_TYPE_EDGE_FALLING) { 416 416 if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R) 417 417 ab8500->mask[index + 2] &= ~mask; 418 - else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R) 418 + else if (offset >= AB9540_INT_GPIO50R && 419 + offset <= AB9540_INT_GPIO54R) 419 420 ab8500->mask[index + 1] &= ~mask; 420 - else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R) 421 + else if (offset == AB8540_INT_GPIO43R || 422 + offset == AB8540_INT_GPIO44R) 421 423 /* Here the falling IRQ is one bit lower */ 422 424 ab8500->mask[index] &= ~(mask << 1); 423 425 else ··· 453 451 /* Fix inconsistent ab8540 bit mapping... */ 454 452 if (unlikely(*offset == 16)) 455 453 *offset = 25; 456 - if ((i==3) && (*offset >= 24)) 454 + if ((i == 3) && (*offset >= 24)) 457 455 *offset += 2; 458 456 } 459 457 ··· 575 573 } 576 574 577 575 static struct irq_domain_ops ab8500_irq_ops = { 578 - .map = ab8500_irq_map, 579 - .xlate = irq_domain_xlate_twocell, 576 + .map = ab8500_irq_map, 577 + .xlate = irq_domain_xlate_twocell, 580 578 }; 581 579 582 580 static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) ··· 609 607 { 610 608 if (atomic_read(&ab8500->transfer_ongoing)) 611 609 return -EINVAL; 612 - else 613 - return 0; 610 + 611 + return 0; 614 612 } 615 613 616 614 static struct resource ab8500_gpadc_resources[] = { ··· 1553 1551 1554 1552 static int ab8500_probe(struct platform_device *pdev) 1555 1553 { 1556 - static char *switch_off_status[] = { 1554 + static const char *switch_off_status[] = { 1557 1555 "Swoff bit programming", 1558 1556 "Thermal protection activation", 1559 1557 "Vbat lower then BattOk falling threshold", ··· 1562 1560 "Battery level lower than power on reset threshold", 1563 1561 "Power on key 1 pressed longer than 10 seconds", 1564 1562 "DB8500 thermal shutdown"}; 1565 - static char *turn_on_status[] = { 1563 + static const char *turn_on_status[] = { 1566 1564 "Battery rising (Vbat)", 1567 1565 "Power On Key 1 dbF", 1568 1566 "Power On Key 2 dbF", ··· 1581 1579 int i; 1582 1580 u8 value; 1583 1581 1584 - ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL); 1582 + ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL); 1585 1583 if (!ab8500) 1586 1584 return -ENOMEM; 1587 1585 ··· 1638 1636 ab8500->mask_size = AB8540_NUM_IRQ_REGS; 1639 1637 ab8500->irq_reg_offset = ab8540_irq_regoffset; 1640 1638 ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM; 1641 - }/* Configure AB8500 or AB9540 IRQ */ 1639 + } /* Configure AB8500 or AB9540 IRQ */ 1642 1640 else if (is_ab9540(ab8500) || is_ab8505(ab8500)) { 1643 1641 ab8500->mask_size = AB9540_NUM_IRQ_REGS; 1644 1642 ab8500->irq_reg_offset = ab9540_irq_regoffset; ··· 1648 1646 ab8500->irq_reg_offset = ab8500_irq_regoffset; 1649 1647 ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM; 1650 1648 } 1651 - ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL); 1649 + ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, 1650 + GFP_KERNEL); 1652 1651 if (!ab8500->mask) 1653 1652 return -ENOMEM; 1654 - ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL); 1653 + ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, 1654 + GFP_KERNEL); 1655 1655 if (!ab8500->oldmask) 1656 1656 return -ENOMEM; 1657 1657 ··· 1678 1674 if (value) { 1679 1675 for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) { 1680 1676 if (value & 1) 1681 - printk(KERN_CONT " \"%s\"", 1682 - switch_off_status[i]); 1677 + pr_cont(" \"%s\"", switch_off_status[i]); 1683 1678 value = value >> 1; 1684 1679 1685 1680 } 1686 - printk(KERN_CONT "\n"); 1681 + pr_cont("\n"); 1687 1682 } else { 1688 - printk(KERN_CONT " None\n"); 1683 + pr_cont(" None\n"); 1689 1684 } 1690 1685 ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, 1691 1686 AB8500_TURN_ON_STATUS, &value); ··· 1695 1692 if (value) { 1696 1693 for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) { 1697 1694 if (value & 1) 1698 - printk("\"%s\" ", turn_on_status[i]); 1695 + pr_cont("\"%s\" ", turn_on_status[i]); 1699 1696 value = value >> 1; 1700 1697 } 1701 - printk("\n"); 1698 + pr_cont("\n"); 1702 1699 } else { 1703 - printk("None\n"); 1700 + pr_cont("None\n"); 1704 1701 } 1705 1702 1706 1703 if (plat && plat->init)
+181 -127
drivers/mfd/ab8500-debugfs.c
··· 135 135 /* hwreg- "mask" and "shift" entries ressources */ 136 136 struct hwreg_cfg { 137 137 u32 bank; /* target bank */ 138 - u32 addr; /* target address */ 138 + unsigned long addr; /* target address */ 139 139 uint fmt; /* format */ 140 - uint mask; /* read/write mask, applied before any bit shift */ 141 - int shift; /* bit shift (read:right shift, write:left shift */ 140 + unsigned long mask; /* read/write mask, applied before any bit shift */ 141 + long shift; /* bit shift (read:right shift, write:left shift */ 142 142 }; 143 143 /* fmt bit #0: 0=hexa, 1=dec */ 144 144 #define REG_FMT_DEC(c) ((c)->fmt & 0x1) ··· 1304 1304 } 1305 1305 1306 1306 if (s) { 1307 - err = seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n", 1308 - bank, reg, value); 1307 + err = seq_printf(s, 1308 + " [0x%02X/0x%02X]: 0x%02X\n", 1309 + bank, reg, value); 1309 1310 if (err < 0) { 1310 1311 /* Error is not returned here since 1311 1312 * the output is wanted in any case */ 1312 1313 return 0; 1313 1314 } 1314 1315 } else { 1315 - printk(KERN_INFO" [0x%02X/0x%02X]: 0x%02X\n", 1316 - bank, reg, value); 1316 + dev_info(dev, " [0x%02X/0x%02X]: 0x%02X\n", 1317 + bank, reg, value); 1317 1318 } 1318 1319 } 1319 1320 } ··· 1326 1325 struct device *dev = s->private; 1327 1326 u32 bank = debug_bank; 1328 1327 1329 - seq_printf(s, AB8500_NAME_STRING " register values:\n"); 1328 + seq_puts(s, AB8500_NAME_STRING " register values:\n"); 1330 1329 1331 1330 seq_printf(s, " bank 0x%02X:\n", bank); 1332 1331 ··· 1351 1350 { 1352 1351 struct device *dev = s->private; 1353 1352 unsigned int i; 1354 - int err; 1355 1353 1356 - seq_printf(s, AB8500_NAME_STRING " register values:\n"); 1354 + seq_puts(s, AB8500_NAME_STRING " register values:\n"); 1357 1355 1358 1356 for (i = 0; i < AB8500_NUM_BANKS; i++) { 1359 - err = seq_printf(s, " bank 0x%02X:\n", i); 1357 + seq_printf(s, " bank 0x%02X:\n", i); 1360 1358 1361 1359 ab8500_registers_print(dev, i, s); 1362 1360 } ··· 1367 1367 { 1368 1368 unsigned int i; 1369 1369 1370 - printk(KERN_INFO"ab8500 register values:\n"); 1370 + dev_info(dev, "ab8500 register values:\n"); 1371 1371 1372 1372 for (i = 1; i < AB8500_NUM_BANKS; i++) { 1373 - printk(KERN_INFO" bank 0x%02X:\n", i); 1373 + dev_info(dev, " bank 0x%02X:\n", i); 1374 1374 ab8500_registers_print(dev, i, NULL); 1375 1375 } 1376 1376 } ··· 1384 1384 u8 value; 1385 1385 } ab8500_complete_register_dump[DUMP_MAX_REGS]; 1386 1386 1387 - extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 1388 - 1389 1387 /* This shall only be called upon kernel panic! */ 1390 1388 void ab8500_dump_all_banks_to_mem(void) 1391 1389 { ··· 1391 1393 u8 bank; 1392 1394 int err = 0; 1393 1395 1394 - pr_info("Saving all ABB registers at \"ab8500_complete_register_dump\" " 1395 - "for crash analyze.\n"); 1396 + pr_info("Saving all ABB registers for crash analysis.\n"); 1396 1397 1397 1398 for (bank = 0; bank < AB8500_NUM_BANKS; bank++) { 1398 1399 for (i = 0; i < debug_ranges[bank].num_ranges; i++) { ··· 1561 1564 err = abx500_set_register_interruptible(dev, 1562 1565 (u8)debug_bank, debug_address, (u8)user_val); 1563 1566 if (err < 0) { 1564 - printk(KERN_ERR "abx500_set_reg failed %d, %d", err, __LINE__); 1567 + pr_err("abx500_set_reg failed %d, %d", err, __LINE__); 1565 1568 return -EINVAL; 1566 1569 } 1567 1570 ··· 1593 1596 { 1594 1597 int line; 1595 1598 1596 - seq_printf(s, "name: number: number of: wake:\n"); 1599 + seq_puts(s, "name: number: number of: wake:\n"); 1597 1600 1598 1601 for (line = 0; line < num_interrupt_lines; line++) { 1599 1602 struct irq_desc *desc = irq_to_desc(line + irq_first); ··· 1719 1722 1720 1723 static int ab8500_modem_open(struct inode *inode, struct file *file) 1721 1724 { 1722 - return single_open(file, ab8500_print_modem_registers, inode->i_private); 1725 + return single_open(file, ab8500_print_modem_registers, 1726 + inode->i_private); 1723 1727 } 1724 1728 1725 1729 static const struct file_operations ab8500_modem_fops = { ··· 1749 1751 1750 1752 static int ab8500_gpadc_bat_ctrl_open(struct inode *inode, struct file *file) 1751 1753 { 1752 - return single_open(file, ab8500_gpadc_bat_ctrl_print, inode->i_private); 1754 + return single_open(file, ab8500_gpadc_bat_ctrl_print, 1755 + inode->i_private); 1753 1756 } 1754 1757 1755 1758 static const struct file_operations ab8500_gpadc_bat_ctrl_fops = { ··· 1780 1781 static int ab8500_gpadc_btemp_ball_open(struct inode *inode, 1781 1782 struct file *file) 1782 1783 { 1783 - return single_open(file, ab8500_gpadc_btemp_ball_print, inode->i_private); 1784 + return single_open(file, ab8500_gpadc_btemp_ball_print, 1785 + inode->i_private); 1784 1786 } 1785 1787 1786 1788 static const struct file_operations ab8500_gpadc_btemp_ball_fops = { ··· 1962 1962 static int ab8500_gpadc_main_bat_v_open(struct inode *inode, 1963 1963 struct file *file) 1964 1964 { 1965 - return single_open(file, ab8500_gpadc_main_bat_v_print, inode->i_private); 1965 + return single_open(file, ab8500_gpadc_main_bat_v_print, 1966 + inode->i_private); 1966 1967 } 1967 1968 1968 1969 static const struct file_operations ab8500_gpadc_main_bat_v_fops = { ··· 2083 2082 2084 2083 static int ab8500_gpadc_bk_bat_v_open(struct inode *inode, struct file *file) 2085 2084 { 2086 - return single_open(file, ab8500_gpadc_bk_bat_v_print, inode->i_private); 2085 + return single_open(file, ab8500_gpadc_bk_bat_v_print, 2086 + inode->i_private); 2087 2087 } 2088 2088 2089 2089 static const struct file_operations ab8500_gpadc_bk_bat_v_fops = { ··· 2113 2111 2114 2112 static int ab8500_gpadc_die_temp_open(struct inode *inode, struct file *file) 2115 2113 { 2116 - return single_open(file, ab8500_gpadc_die_temp_print, inode->i_private); 2114 + return single_open(file, ab8500_gpadc_die_temp_print, 2115 + inode->i_private); 2117 2116 } 2118 2117 2119 2118 static const struct file_operations ab8500_gpadc_die_temp_fops = { ··· 2193 2190 gpadc = ab8500_gpadc_get("ab8500-gpadc.0"); 2194 2191 vbat_true_meas_raw = ab8500_gpadc_read_raw(gpadc, VBAT_TRUE_MEAS, 2195 2192 avg_sample, trig_edge, trig_timer, conv_type); 2196 - vbat_true_meas_convert = ab8500_gpadc_ad_to_voltage(gpadc, VBAT_TRUE_MEAS, 2197 - vbat_true_meas_raw); 2193 + vbat_true_meas_convert = 2194 + ab8500_gpadc_ad_to_voltage(gpadc, VBAT_TRUE_MEAS, 2195 + vbat_true_meas_raw); 2198 2196 2199 2197 return seq_printf(s, "%d,0x%X\n", 2200 2198 vbat_true_meas_convert, vbat_true_meas_raw); ··· 2289 2285 .owner = THIS_MODULE, 2290 2286 }; 2291 2287 2292 - static int ab8540_gpadc_vbat_true_meas_and_ibat_print(struct seq_file *s, void *p) 2288 + static int ab8540_gpadc_vbat_true_meas_and_ibat_print(struct seq_file *s, 2289 + void *p) 2293 2290 { 2294 2291 int vbat_true_meas_raw; 2295 2292 int vbat_true_meas_convert; ··· 2319 2314 inode->i_private); 2320 2315 } 2321 2316 2322 - static const struct file_operations ab8540_gpadc_vbat_true_meas_and_ibat_fops = { 2317 + static const struct file_operations 2318 + ab8540_gpadc_vbat_true_meas_and_ibat_fops = { 2323 2319 .open = ab8540_gpadc_vbat_true_meas_and_ibat_open, 2324 2320 .read = seq_read, 2325 2321 .llseek = seq_lseek, ··· 2374 2368 ab8540_gpadc_get_otp(gpadc, &vmain_l, &vmain_h, &btemp_l, &btemp_h, 2375 2369 &vbat_l, &vbat_h, &ibat_l, &ibat_h); 2376 2370 return seq_printf(s, "VMAIN_L:0x%X\n" 2377 - "VMAIN_H:0x%X\n" 2378 - "BTEMP_L:0x%X\n" 2379 - "BTEMP_H:0x%X\n" 2380 - "VBAT_L:0x%X\n" 2381 - "VBAT_H:0x%X\n" 2382 - "IBAT_L:0x%X\n" 2383 - "IBAT_H:0x%X\n", 2384 - vmain_l, vmain_h, btemp_l, btemp_h, vbat_l, vbat_h, ibat_l, ibat_h); 2371 + "VMAIN_H:0x%X\n" 2372 + "BTEMP_L:0x%X\n" 2373 + "BTEMP_H:0x%X\n" 2374 + "VBAT_L:0x%X\n" 2375 + "VBAT_H:0x%X\n" 2376 + "IBAT_L:0x%X\n" 2377 + "IBAT_H:0x%X\n", 2378 + vmain_l, vmain_h, btemp_l, btemp_h, 2379 + vbat_l, vbat_h, ibat_l, ibat_h); 2385 2380 } 2386 2381 2387 2382 static int ab8540_gpadc_otp_cal_open(struct inode *inode, struct file *file) ··· 2426 2419 || (user_avg_sample == SAMPLE_16)) { 2427 2420 avg_sample = (u8) user_avg_sample; 2428 2421 } else { 2429 - dev_err(dev, "debugfs error input: " 2430 - "should be egal to 1, 4, 8 or 16\n"); 2422 + dev_err(dev, 2423 + "debugfs err input: should be egal to 1, 4, 8 or 16\n"); 2431 2424 return -EINVAL; 2432 2425 } 2433 2426 ··· 2511 2504 if (err) 2512 2505 return err; 2513 2506 2514 - if ((user_trig_timer >= 0) && (user_trig_timer <= 255)) { 2515 - trig_timer = (u8) user_trig_timer; 2516 - } else { 2517 - dev_err(dev, "debugfs error input: " 2518 - "should be beetween 0 to 255\n"); 2507 + if (user_trig_timer & ~0xFF) { 2508 + dev_err(dev, 2509 + "debugfs error input: should be beetween 0 to 255\n"); 2519 2510 return -EINVAL; 2520 2511 } 2512 + 2513 + trig_timer = (u8) user_trig_timer; 2521 2514 2522 2515 return count; 2523 2516 } ··· 2586 2579 static int strval_len(char *b) 2587 2580 { 2588 2581 char *s = b; 2582 + 2589 2583 if ((*s == '0') && ((*(s+1) == 'x') || (*(s+1) == 'X'))) { 2590 2584 s += 2; 2591 2585 for (; *s && (*s != ' ') && (*s != '\n'); s++) { ··· 2651 2643 b += (*(b+2) == ' ') ? 3 : 6; 2652 2644 if (strval_len(b) == 0) 2653 2645 return -EINVAL; 2654 - loc.mask = simple_strtoul(b, &b, 0); 2646 + ret = kstrtoul(b, 0, &loc.mask); 2647 + if (ret) 2648 + return ret; 2655 2649 } else if ((!strncmp(b, "-s ", 3)) || 2656 2650 (!strncmp(b, "-shift ", 7))) { 2657 2651 b += (*(b+2) == ' ') ? 3 : 7; 2658 2652 if (strval_len(b) == 0) 2659 2653 return -EINVAL; 2660 - loc.shift = simple_strtol(b, &b, 0); 2654 + ret = kstrtol(b, 0, &loc.shift); 2655 + if (ret) 2656 + return ret; 2661 2657 } else { 2662 2658 return -EINVAL; 2663 2659 } ··· 2669 2657 /* get arg BANK and ADDRESS */ 2670 2658 if (strval_len(b) == 0) 2671 2659 return -EINVAL; 2672 - loc.bank = simple_strtoul(b, &b, 0); 2660 + ret = kstrtouint(b, 0, &loc.bank); 2661 + if (ret) 2662 + return ret; 2673 2663 while (*b == ' ') 2674 2664 b++; 2675 2665 if (strval_len(b) == 0) 2676 2666 return -EINVAL; 2677 - loc.addr = simple_strtoul(b, &b, 0); 2667 + ret = kstrtoul(b, 0, &loc.addr); 2668 + if (ret) 2669 + return ret; 2678 2670 2679 2671 if (write) { 2680 2672 while (*b == ' ') 2681 2673 b++; 2682 2674 if (strval_len(b) == 0) 2683 2675 return -EINVAL; 2684 - val = simple_strtoul(b, &b, 0); 2676 + ret = kstrtouint(b, 0, &val); 2677 + if (ret) 2678 + return ret; 2685 2679 } 2686 2680 2687 2681 /* args are ok, update target cfg (mainly for read) */ 2688 2682 *cfg = loc; 2689 2683 2690 2684 #ifdef ABB_HWREG_DEBUG 2691 - pr_warn("HWREG request: %s, %s, addr=0x%08X, mask=0x%X, shift=%d" 2692 - "value=0x%X\n", (write) ? "write" : "read", 2693 - REG_FMT_DEC(cfg) ? "decimal" : "hexa", 2694 - cfg->addr, cfg->mask, cfg->shift, val); 2685 + pr_warn("HWREG request: %s, %s,\n" 2686 + " addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n", 2687 + (write) ? "write" : "read", 2688 + REG_FMT_DEC(cfg) ? "decimal" : "hexa", 2689 + cfg->addr, cfg->mask, cfg->shift, val); 2695 2690 #endif 2696 2691 2697 2692 if (!write) ··· 2784 2765 irq_index = name - irq_first; 2785 2766 if (irq_index >= num_irqs) 2786 2767 return -EINVAL; 2787 - else 2788 - return sprintf(buf, "%u\n", irq_count[irq_index]); 2768 + 2769 + return sprintf(buf, "%u\n", irq_count[irq_index]); 2789 2770 } 2790 2771 2791 2772 static ssize_t ab8500_subscribe_write(struct file *file, ··· 2834 2815 dev_attr[irq_index]->attr.mode = S_IRUGO; 2835 2816 err = sysfs_create_file(&dev->kobj, &dev_attr[irq_index]->attr); 2836 2817 if (err < 0) { 2837 - printk(KERN_ERR "sysfs_create_file failed %d\n", err); 2818 + pr_info("sysfs_create_file failed %d\n", err); 2838 2819 return err; 2839 2820 } 2840 2821 ··· 2842 2823 IRQF_SHARED | IRQF_NO_SUSPEND, 2843 2824 "ab8500-debug", &dev->kobj); 2844 2825 if (err < 0) { 2845 - printk(KERN_ERR "request_threaded_irq failed %d, %lu\n", 2846 - err, user_val); 2826 + pr_info("request_threaded_irq failed %d, %lu\n", 2827 + err, user_val); 2847 2828 sysfs_remove_file(&dev->kobj, &dev_attr[irq_index]->attr); 2848 2829 return err; 2849 2830 } ··· 2965 2946 struct dentry *file; 2966 2947 struct ab8500 *ab8500; 2967 2948 struct resource *res; 2949 + 2968 2950 debug_bank = AB8500_MISC; 2969 2951 debug_address = AB8500_REV_REG & 0x00FF; 2970 2952 ··· 2978 2958 return -ENOMEM; 2979 2959 2980 2960 dev_attr = devm_kzalloc(&plf->dev, 2981 - sizeof(*dev_attr)*num_irqs,GFP_KERNEL); 2961 + sizeof(*dev_attr)*num_irqs, GFP_KERNEL); 2982 2962 if (!dev_attr) 2983 2963 return -ENOMEM; 2984 2964 ··· 2989 2969 2990 2970 res = platform_get_resource_byname(plf, 0, "IRQ_AB8500"); 2991 2971 if (!res) { 2992 - dev_err(&plf->dev, "AB8500 irq not found, err %d\n", 2993 - irq_first); 2994 - return ENXIO; 2972 + dev_err(&plf->dev, "AB8500 irq not found, err %d\n", irq_first); 2973 + return -ENXIO; 2995 2974 } 2996 2975 irq_ab8500 = res->start; 2997 2976 2998 2977 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST"); 2999 2978 if (irq_first < 0) { 3000 - dev_err(&plf->dev, "First irq not found, err %d\n", 3001 - irq_first); 2979 + dev_err(&plf->dev, "First irq not found, err %d\n", irq_first); 3002 2980 return irq_first; 3003 2981 } 3004 2982 3005 2983 irq_last = platform_get_irq_byname(plf, "IRQ_LAST"); 3006 2984 if (irq_last < 0) { 3007 - dev_err(&plf->dev, "Last irq not found, err %d\n", 3008 - irq_last); 2985 + dev_err(&plf->dev, "Last irq not found, err %d\n", irq_last); 3009 2986 return irq_last; 3010 2987 } 3011 2988 ··· 3011 2994 goto err; 3012 2995 3013 2996 ab8500_gpadc_dir = debugfs_create_dir(AB8500_ADC_NAME_STRING, 3014 - ab8500_dir); 2997 + ab8500_dir); 3015 2998 if (!ab8500_gpadc_dir) 3016 2999 goto err; 3017 3000 3018 - file = debugfs_create_file("all-bank-registers", S_IRUGO, 3019 - ab8500_dir, &plf->dev, &ab8500_registers_fops); 3001 + file = debugfs_create_file("all-bank-registers", S_IRUGO, ab8500_dir, 3002 + &plf->dev, &ab8500_registers_fops); 3020 3003 if (!file) 3021 3004 goto err; 3022 3005 3023 - file = debugfs_create_file("all-banks", S_IRUGO, 3024 - ab8500_dir, &plf->dev, &ab8500_all_banks_fops); 3006 + file = debugfs_create_file("all-banks", S_IRUGO, ab8500_dir, 3007 + &plf->dev, &ab8500_all_banks_fops); 3025 3008 if (!file) 3026 3009 goto err; 3027 3010 3028 - file = debugfs_create_file("register-bank", (S_IRUGO | S_IWUSR | S_IWGRP), 3029 - ab8500_dir, &plf->dev, &ab8500_bank_fops); 3011 + file = debugfs_create_file("register-bank", 3012 + (S_IRUGO | S_IWUSR | S_IWGRP), 3013 + ab8500_dir, &plf->dev, &ab8500_bank_fops); 3030 3014 if (!file) 3031 3015 goto err; 3032 3016 3033 - file = debugfs_create_file("register-address", (S_IRUGO | S_IWUSR | S_IWGRP), 3034 - ab8500_dir, &plf->dev, &ab8500_address_fops); 3017 + file = debugfs_create_file("register-address", 3018 + (S_IRUGO | S_IWUSR | S_IWGRP), 3019 + ab8500_dir, &plf->dev, &ab8500_address_fops); 3035 3020 if (!file) 3036 3021 goto err; 3037 3022 3038 - file = debugfs_create_file("register-value", (S_IRUGO | S_IWUSR | S_IWGRP), 3039 - ab8500_dir, &plf->dev, &ab8500_val_fops); 3023 + file = debugfs_create_file("register-value", 3024 + (S_IRUGO | S_IWUSR | S_IWGRP), 3025 + ab8500_dir, &plf->dev, &ab8500_val_fops); 3040 3026 if (!file) 3041 3027 goto err; 3042 3028 3043 - file = debugfs_create_file("irq-subscribe", (S_IRUGO | S_IWUSR | S_IWGRP), 3044 - ab8500_dir, &plf->dev, &ab8500_subscribe_fops); 3029 + file = debugfs_create_file("irq-subscribe", 3030 + (S_IRUGO | S_IWUSR | S_IWGRP), ab8500_dir, 3031 + &plf->dev, &ab8500_subscribe_fops); 3045 3032 if (!file) 3046 3033 goto err; 3047 3034 ··· 3063 3042 num_interrupt_lines = AB8540_NR_IRQS; 3064 3043 } 3065 3044 3066 - file = debugfs_create_file("interrupts", (S_IRUGO), 3067 - ab8500_dir, &plf->dev, &ab8500_interrupts_fops); 3045 + file = debugfs_create_file("interrupts", (S_IRUGO), ab8500_dir, 3046 + &plf->dev, &ab8500_interrupts_fops); 3068 3047 if (!file) 3069 3048 goto err; 3070 3049 3071 - file = debugfs_create_file("irq-unsubscribe", (S_IRUGO | S_IWUSR | S_IWGRP), 3072 - ab8500_dir, &plf->dev, &ab8500_unsubscribe_fops); 3050 + file = debugfs_create_file("irq-unsubscribe", 3051 + (S_IRUGO | S_IWUSR | S_IWGRP), ab8500_dir, 3052 + &plf->dev, &ab8500_unsubscribe_fops); 3073 3053 if (!file) 3074 3054 goto err; 3075 3055 3076 3056 file = debugfs_create_file("hwreg", (S_IRUGO | S_IWUSR | S_IWGRP), 3077 - ab8500_dir, &plf->dev, &ab8500_hwreg_fops); 3057 + ab8500_dir, &plf->dev, &ab8500_hwreg_fops); 3078 3058 if (!file) 3079 3059 goto err; 3080 3060 3081 - file = debugfs_create_file("all-modem-registers", (S_IRUGO | S_IWUSR | S_IWGRP), 3082 - ab8500_dir, &plf->dev, &ab8500_modem_fops); 3061 + file = debugfs_create_file("all-modem-registers", 3062 + (S_IRUGO | S_IWUSR | S_IWGRP), 3063 + ab8500_dir, &plf->dev, &ab8500_modem_fops); 3083 3064 if (!file) 3084 3065 goto err; 3085 3066 3086 3067 file = debugfs_create_file("bat_ctrl", (S_IRUGO | S_IWUSR | S_IWGRP), 3087 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_bat_ctrl_fops); 3068 + ab8500_gpadc_dir, &plf->dev, 3069 + &ab8500_gpadc_bat_ctrl_fops); 3088 3070 if (!file) 3089 3071 goto err; 3090 3072 3091 3073 file = debugfs_create_file("btemp_ball", (S_IRUGO | S_IWUSR | S_IWGRP), 3092 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_btemp_ball_fops); 3074 + ab8500_gpadc_dir, 3075 + &plf->dev, &ab8500_gpadc_btemp_ball_fops); 3093 3076 if (!file) 3094 3077 goto err; 3095 3078 3096 - file = debugfs_create_file("main_charger_v", (S_IRUGO | S_IWUSR | S_IWGRP), 3097 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_main_charger_v_fops); 3079 + file = debugfs_create_file("main_charger_v", 3080 + (S_IRUGO | S_IWUSR | S_IWGRP), 3081 + ab8500_gpadc_dir, &plf->dev, 3082 + &ab8500_gpadc_main_charger_v_fops); 3098 3083 if (!file) 3099 3084 goto err; 3100 3085 3101 - file = debugfs_create_file("acc_detect1", (S_IRUGO | S_IWUSR | S_IWGRP), 3102 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_acc_detect1_fops); 3086 + file = debugfs_create_file("acc_detect1", 3087 + (S_IRUGO | S_IWUSR | S_IWGRP), 3088 + ab8500_gpadc_dir, &plf->dev, 3089 + &ab8500_gpadc_acc_detect1_fops); 3103 3090 if (!file) 3104 3091 goto err; 3105 3092 3106 - file = debugfs_create_file("acc_detect2", (S_IRUGO | S_IWUSR | S_IWGRP), 3107 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_acc_detect2_fops); 3093 + file = debugfs_create_file("acc_detect2", 3094 + (S_IRUGO | S_IWUSR | S_IWGRP), 3095 + ab8500_gpadc_dir, &plf->dev, 3096 + &ab8500_gpadc_acc_detect2_fops); 3108 3097 if (!file) 3109 3098 goto err; 3110 3099 3111 3100 file = debugfs_create_file("adc_aux1", (S_IRUGO | S_IWUSR | S_IWGRP), 3112 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_aux1_fops); 3101 + ab8500_gpadc_dir, &plf->dev, 3102 + &ab8500_gpadc_aux1_fops); 3113 3103 if (!file) 3114 3104 goto err; 3115 3105 3116 3106 file = debugfs_create_file("adc_aux2", (S_IRUGO | S_IWUSR | S_IWGRP), 3117 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_aux2_fops); 3107 + ab8500_gpadc_dir, &plf->dev, 3108 + &ab8500_gpadc_aux2_fops); 3118 3109 if (!file) 3119 3110 goto err; 3120 3111 3121 3112 file = debugfs_create_file("main_bat_v", (S_IRUGO | S_IWUSR | S_IWGRP), 3122 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_main_bat_v_fops); 3113 + ab8500_gpadc_dir, &plf->dev, 3114 + &ab8500_gpadc_main_bat_v_fops); 3123 3115 if (!file) 3124 3116 goto err; 3125 3117 3126 3118 file = debugfs_create_file("vbus_v", (S_IRUGO | S_IWUSR | S_IWGRP), 3127 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_vbus_v_fops); 3119 + ab8500_gpadc_dir, &plf->dev, 3120 + &ab8500_gpadc_vbus_v_fops); 3128 3121 if (!file) 3129 3122 goto err; 3130 3123 3131 - file = debugfs_create_file("main_charger_c", (S_IRUGO | S_IWUSR | S_IWGRP), 3132 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_main_charger_c_fops); 3124 + file = debugfs_create_file("main_charger_c", 3125 + (S_IRUGO | S_IWUSR | S_IWGRP), 3126 + ab8500_gpadc_dir, &plf->dev, 3127 + &ab8500_gpadc_main_charger_c_fops); 3133 3128 if (!file) 3134 3129 goto err; 3135 3130 3136 - file = debugfs_create_file("usb_charger_c", (S_IRUGO | S_IWUSR | S_IWGRP), 3137 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_usb_charger_c_fops); 3131 + file = debugfs_create_file("usb_charger_c", 3132 + (S_IRUGO | S_IWUSR | S_IWGRP), 3133 + ab8500_gpadc_dir, 3134 + &plf->dev, &ab8500_gpadc_usb_charger_c_fops); 3138 3135 if (!file) 3139 3136 goto err; 3140 3137 3141 3138 file = debugfs_create_file("bk_bat_v", (S_IRUGO | S_IWUSR | S_IWGRP), 3142 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_bk_bat_v_fops); 3139 + ab8500_gpadc_dir, &plf->dev, 3140 + &ab8500_gpadc_bk_bat_v_fops); 3143 3141 if (!file) 3144 3142 goto err; 3145 3143 3146 3144 file = debugfs_create_file("die_temp", (S_IRUGO | S_IWUSR | S_IWGRP), 3147 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_die_temp_fops); 3145 + ab8500_gpadc_dir, &plf->dev, 3146 + &ab8500_gpadc_die_temp_fops); 3148 3147 if (!file) 3149 3148 goto err; 3150 3149 3151 3150 file = debugfs_create_file("usb_id", (S_IRUGO | S_IWUSR | S_IWGRP), 3152 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_usb_id_fops); 3151 + ab8500_gpadc_dir, &plf->dev, 3152 + &ab8500_gpadc_usb_id_fops); 3153 3153 if (!file) 3154 3154 goto err; 3155 3155 3156 3156 if (is_ab8540(ab8500)) { 3157 - file = debugfs_create_file("xtal_temp", (S_IRUGO | S_IWUSR | S_IWGRP), 3158 - ab8500_gpadc_dir, &plf->dev, &ab8540_gpadc_xtal_temp_fops); 3157 + file = debugfs_create_file("xtal_temp", 3158 + (S_IRUGO | S_IWUSR | S_IWGRP), 3159 + ab8500_gpadc_dir, &plf->dev, 3160 + &ab8540_gpadc_xtal_temp_fops); 3159 3161 if (!file) 3160 3162 goto err; 3161 - file = debugfs_create_file("vbattruemeas", (S_IRUGO | S_IWUSR | S_IWGRP), 3162 - ab8500_gpadc_dir, &plf->dev, 3163 - &ab8540_gpadc_vbat_true_meas_fops); 3163 + file = debugfs_create_file("vbattruemeas", 3164 + (S_IRUGO | S_IWUSR | S_IWGRP), 3165 + ab8500_gpadc_dir, &plf->dev, 3166 + &ab8540_gpadc_vbat_true_meas_fops); 3164 3167 if (!file) 3165 3168 goto err; 3166 3169 file = debugfs_create_file("batctrl_and_ibat", 3167 - (S_IRUGO | S_IWUGO), ab8500_gpadc_dir, 3168 - &plf->dev, &ab8540_gpadc_bat_ctrl_and_ibat_fops); 3170 + (S_IRUGO | S_IWUGO), 3171 + ab8500_gpadc_dir, 3172 + &plf->dev, 3173 + &ab8540_gpadc_bat_ctrl_and_ibat_fops); 3169 3174 if (!file) 3170 3175 goto err; 3171 3176 file = debugfs_create_file("vbatmeas_and_ibat", 3172 - (S_IRUGO | S_IWUGO), ab8500_gpadc_dir, 3173 - &plf->dev, 3174 - &ab8540_gpadc_vbat_meas_and_ibat_fops); 3177 + (S_IRUGO | S_IWUGO), 3178 + ab8500_gpadc_dir, &plf->dev, 3179 + &ab8540_gpadc_vbat_meas_and_ibat_fops); 3175 3180 if (!file) 3176 3181 goto err; 3177 3182 file = debugfs_create_file("vbattruemeas_and_ibat", 3178 - (S_IRUGO | S_IWUGO), ab8500_gpadc_dir, 3179 - &plf->dev, 3180 - &ab8540_gpadc_vbat_true_meas_and_ibat_fops); 3183 + (S_IRUGO | S_IWUGO), 3184 + ab8500_gpadc_dir, 3185 + &plf->dev, 3186 + &ab8540_gpadc_vbat_true_meas_and_ibat_fops); 3181 3187 if (!file) 3182 3188 goto err; 3183 3189 file = debugfs_create_file("battemp_and_ibat", 3184 - (S_IRUGO | S_IWUGO), ab8500_gpadc_dir, 3190 + (S_IRUGO | S_IWUGO), 3191 + ab8500_gpadc_dir, 3185 3192 &plf->dev, &ab8540_gpadc_bat_temp_and_ibat_fops); 3186 3193 if (!file) 3187 3194 goto err; 3188 - file = debugfs_create_file("otp_calib", (S_IRUGO | S_IWUSR | S_IWGRP), 3189 - ab8500_gpadc_dir, &plf->dev, &ab8540_gpadc_otp_calib_fops); 3195 + file = debugfs_create_file("otp_calib", 3196 + (S_IRUGO | S_IWUSR | S_IWGRP), 3197 + ab8500_gpadc_dir, 3198 + &plf->dev, &ab8540_gpadc_otp_calib_fops); 3190 3199 if (!file) 3191 3200 goto err; 3192 3201 } 3193 3202 file = debugfs_create_file("avg_sample", (S_IRUGO | S_IWUSR | S_IWGRP), 3194 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_avg_sample_fops); 3203 + ab8500_gpadc_dir, &plf->dev, 3204 + &ab8500_gpadc_avg_sample_fops); 3195 3205 if (!file) 3196 3206 goto err; 3197 3207 3198 3208 file = debugfs_create_file("trig_edge", (S_IRUGO | S_IWUSR | S_IWGRP), 3199 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_trig_edge_fops); 3209 + ab8500_gpadc_dir, &plf->dev, 3210 + &ab8500_gpadc_trig_edge_fops); 3200 3211 if (!file) 3201 3212 goto err; 3202 3213 3203 3214 file = debugfs_create_file("trig_timer", (S_IRUGO | S_IWUSR | S_IWGRP), 3204 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_trig_timer_fops); 3215 + ab8500_gpadc_dir, &plf->dev, 3216 + &ab8500_gpadc_trig_timer_fops); 3205 3217 if (!file) 3206 3218 goto err; 3207 3219 3208 3220 file = debugfs_create_file("conv_type", (S_IRUGO | S_IWUSR | S_IWGRP), 3209 - ab8500_gpadc_dir, &plf->dev, &ab8500_gpadc_conv_type_fops); 3221 + ab8500_gpadc_dir, &plf->dev, 3222 + &ab8500_gpadc_conv_type_fops); 3210 3223 if (!file) 3211 3224 goto err; 3212 3225 3213 3226 return 0; 3214 3227 3215 3228 err: 3216 - if (ab8500_dir) 3217 - debugfs_remove_recursive(ab8500_dir); 3229 + debugfs_remove_recursive(ab8500_dir); 3218 3230 dev_err(&plf->dev, "failed to create debugfs entries.\n"); 3219 3231 3220 3232 return -ENOMEM;
+41 -12
drivers/mfd/arizona-core.c
··· 123 123 dev_err(arizona->dev, "AIF2 underclocked\n"); 124 124 if (val & ARIZONA_AIF1_UNDERCLOCKED_STS) 125 125 dev_err(arizona->dev, "AIF1 underclocked\n"); 126 + if (val & ARIZONA_ISRC3_UNDERCLOCKED_STS) 127 + dev_err(arizona->dev, "ISRC3 underclocked\n"); 126 128 if (val & ARIZONA_ISRC2_UNDERCLOCKED_STS) 127 129 dev_err(arizona->dev, "ISRC2 underclocked\n"); 128 130 if (val & ARIZONA_ISRC1_UNDERCLOCKED_STS) ··· 194 192 dev_err(arizona->dev, "ASRC sync WARP overclocked\n"); 195 193 if (val[1] & ARIZONA_ADSP2_1_OVERCLOCKED_STS) 196 194 dev_err(arizona->dev, "DSP1 overclocked\n"); 195 + if (val[1] & ARIZONA_ISRC3_OVERCLOCKED_STS) 196 + dev_err(arizona->dev, "ISRC3 overclocked\n"); 197 197 if (val[1] & ARIZONA_ISRC2_OVERCLOCKED_STS) 198 198 dev_err(arizona->dev, "ISRC2 overclocked\n"); 199 199 if (val[1] & ARIZONA_ISRC1_OVERCLOCKED_STS) ··· 501 497 EXPORT_SYMBOL_GPL(arizona_pm_ops); 502 498 503 499 #ifdef CONFIG_OF 504 - int arizona_of_get_type(struct device *dev) 500 + unsigned long arizona_of_get_type(struct device *dev) 505 501 { 506 502 const struct of_device_id *id = of_match_device(arizona_of_match, dev); 507 503 508 504 if (id) 509 - return (int)id->data; 505 + return (unsigned long)id->data; 510 506 else 511 507 return 0; 512 508 } ··· 582 578 }; 583 579 584 580 static const char *wm5102_supplies[] = { 581 + "MICVDD", 585 582 "DBVDD2", 586 583 "DBVDD3", 587 584 "CPVDD", 588 585 "SPKVDDL", 589 586 "SPKVDDR", 590 - "MICVDD", 591 587 }; 592 588 593 589 static const struct mfd_cell wm5102_devs[] = { 594 590 { .name = "arizona-micsupp" }, 595 - { .name = "arizona-extcon" }, 591 + { 592 + .name = "arizona-extcon", 593 + .parent_supplies = wm5102_supplies, 594 + .num_parent_supplies = 1, /* We only need MICVDD */ 595 + }, 596 596 { .name = "arizona-gpio" }, 597 597 { .name = "arizona-haptics" }, 598 598 { .name = "arizona-pwm" }, ··· 609 601 610 602 static const struct mfd_cell wm5110_devs[] = { 611 603 { .name = "arizona-micsupp" }, 612 - { .name = "arizona-extcon" }, 604 + { 605 + .name = "arizona-extcon", 606 + .parent_supplies = wm5102_supplies, 607 + .num_parent_supplies = 1, /* We only need MICVDD */ 608 + }, 613 609 { .name = "arizona-gpio" }, 614 610 { .name = "arizona-haptics" }, 615 611 { .name = "arizona-pwm" }, ··· 625 613 }; 626 614 627 615 static const char *wm8997_supplies[] = { 616 + "MICVDD", 628 617 "DBVDD2", 629 618 "CPVDD", 630 619 "SPKVDD", ··· 633 620 634 621 static const struct mfd_cell wm8997_devs[] = { 635 622 { .name = "arizona-micsupp" }, 636 - { .name = "arizona-extcon" }, 623 + { 624 + .name = "arizona-extcon", 625 + .parent_supplies = wm8997_supplies, 626 + .num_parent_supplies = 1, /* We only need MICVDD */ 627 + }, 637 628 { .name = "arizona-gpio" }, 638 629 { .name = "arizona-haptics" }, 639 630 { .name = "arizona-pwm" }, ··· 700 683 goto err_early; 701 684 } 702 685 703 - arizona->dcvdd = devm_regulator_get(arizona->dev, "DCVDD"); 686 + /** 687 + * Don't use devres here because the only device we have to get 688 + * against is the MFD device and DCVDD will likely be supplied by 689 + * one of its children. Meaning that the regulator will be 690 + * destroyed by the time devres calls regulator put. 691 + */ 692 + arizona->dcvdd = regulator_get(arizona->dev, "DCVDD"); 704 693 if (IS_ERR(arizona->dcvdd)) { 705 694 ret = PTR_ERR(arizona->dcvdd); 706 695 dev_err(dev, "Failed to request DCVDD: %d\n", ret); ··· 720 697 "arizona /RESET"); 721 698 if (ret != 0) { 722 699 dev_err(dev, "Failed to request /RESET: %d\n", ret); 723 - goto err_early; 700 + goto err_dcvdd; 724 701 } 725 702 } 726 703 ··· 729 706 if (ret != 0) { 730 707 dev_err(dev, "Failed to enable core supplies: %d\n", 731 708 ret); 732 - goto err_early; 709 + goto err_dcvdd; 733 710 } 734 711 735 712 ret = regulator_enable(arizona->dcvdd); ··· 1038 1015 err_enable: 1039 1016 regulator_bulk_disable(arizona->num_core_supplies, 1040 1017 arizona->core_supplies); 1018 + err_dcvdd: 1019 + regulator_put(arizona->dcvdd); 1041 1020 err_early: 1042 1021 mfd_remove_devices(dev); 1043 1022 return ret; ··· 1048 1023 1049 1024 int arizona_dev_exit(struct arizona *arizona) 1050 1025 { 1026 + pm_runtime_disable(arizona->dev); 1027 + 1028 + regulator_disable(arizona->dcvdd); 1029 + regulator_put(arizona->dcvdd); 1030 + 1051 1031 mfd_remove_devices(arizona->dev); 1052 1032 arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona); 1053 1033 arizona_free_irq(arizona, ARIZONA_IRQ_OVERCLOCKED, arizona); 1054 1034 arizona_free_irq(arizona, ARIZONA_IRQ_CLKGEN_ERR, arizona); 1055 - pm_runtime_disable(arizona->dev); 1056 1035 arizona_irq_exit(arizona); 1057 1036 if (arizona->pdata.reset) 1058 1037 gpio_set_value_cansleep(arizona->pdata.reset, 0); 1059 - regulator_disable(arizona->dcvdd); 1060 - regulator_bulk_disable(ARRAY_SIZE(arizona->core_supplies), 1038 + 1039 + regulator_bulk_disable(arizona->num_core_supplies, 1061 1040 arizona->core_supplies); 1062 1041 return 0; 1063 1042 }
+3 -2
drivers/mfd/arizona-i2c.c
··· 24 24 #include "arizona.h" 25 25 26 26 static int arizona_i2c_probe(struct i2c_client *i2c, 27 - const struct i2c_device_id *id) 27 + const struct i2c_device_id *id) 28 28 { 29 29 struct arizona *arizona; 30 30 const struct regmap_config *regmap_config; 31 - int ret, type; 31 + unsigned long type; 32 + int ret; 32 33 33 34 if (i2c->dev.of_node) 34 35 type = arizona_of_get_type(&i2c->dev);
+21 -8
drivers/mfd/arizona-irq.c
··· 188 188 int flags = IRQF_ONESHOT; 189 189 int ret, i; 190 190 const struct regmap_irq_chip *aod, *irq; 191 - bool ctrlif_error = true; 192 191 struct irq_data *irq_data; 192 + 193 + arizona->ctrlif_error = true; 193 194 194 195 switch (arizona->type) { 195 196 #ifdef CONFIG_MFD_WM5102 ··· 198 197 aod = &wm5102_aod; 199 198 irq = &wm5102_irq; 200 199 201 - ctrlif_error = false; 200 + arizona->ctrlif_error = false; 202 201 break; 203 202 #endif 204 203 #ifdef CONFIG_MFD_WM5110 205 204 case WM5110: 206 205 aod = &wm5110_aod; 207 - irq = &wm5110_irq; 208 206 209 - ctrlif_error = false; 207 + switch (arizona->rev) { 208 + case 0 ... 2: 209 + irq = &wm5110_irq; 210 + break; 211 + default: 212 + irq = &wm5110_revd_irq; 213 + break; 214 + } 215 + 216 + arizona->ctrlif_error = false; 210 217 break; 211 218 #endif 212 219 #ifdef CONFIG_MFD_WM8997 ··· 222 213 aod = &wm8997_aod; 223 214 irq = &wm8997_irq; 224 215 225 - ctrlif_error = false; 216 + arizona->ctrlif_error = false; 226 217 break; 227 218 #endif 228 219 default: ··· 309 300 } 310 301 311 302 /* Handle control interface errors in the core */ 312 - if (ctrlif_error) { 303 + if (arizona->ctrlif_error) { 313 304 i = arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR); 314 305 ret = request_threaded_irq(i, NULL, arizona_ctrlif_err, 315 306 IRQF_ONESHOT, ··· 354 345 return 0; 355 346 356 347 err_main_irq: 357 - free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR), arizona); 348 + if (arizona->ctrlif_error) 349 + free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR), 350 + arizona); 358 351 err_ctrlif: 359 352 free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE), arizona); 360 353 err_boot_done: ··· 372 361 373 362 int arizona_irq_exit(struct arizona *arizona) 374 363 { 375 - free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR), arizona); 364 + if (arizona->ctrlif_error) 365 + free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR), 366 + arizona); 376 367 free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE), arizona); 377 368 regmap_del_irq_chip(irq_create_mapping(arizona->virq, 1), 378 369 arizona->irq_chip);
+2 -1
drivers/mfd/arizona-spi.c
··· 28 28 const struct spi_device_id *id = spi_get_device_id(spi); 29 29 struct arizona *arizona; 30 30 const struct regmap_config *regmap_config; 31 - int ret, type; 31 + unsigned long type; 32 + int ret; 32 33 33 34 if (spi->dev.of_node) 34 35 type = arizona_of_get_type(&spi->dev);
+3 -2
drivers/mfd/arizona.h
··· 36 36 37 37 extern const struct regmap_irq_chip wm5110_aod; 38 38 extern const struct regmap_irq_chip wm5110_irq; 39 + extern const struct regmap_irq_chip wm5110_revd_irq; 39 40 40 41 extern const struct regmap_irq_chip wm8997_aod; 41 42 extern const struct regmap_irq_chip wm8997_irq; ··· 47 46 int arizona_irq_exit(struct arizona *arizona); 48 47 49 48 #ifdef CONFIG_OF 50 - int arizona_of_get_type(struct device *dev); 49 + unsigned long arizona_of_get_type(struct device *dev); 51 50 #else 52 - static inline int arizona_of_get_type(struct device *dev) 51 + static inline unsigned long arizona_of_get_type(struct device *dev) 53 52 { 54 53 return 0; 55 54 }
+7 -5
drivers/mfd/asic3.c
··· 899 899 ds1wm_resources[0].end >>= asic->bus_shift; 900 900 901 901 /* MMC */ 902 - asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) + 902 + if (mem_sdio) { 903 + asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) + 903 904 mem_sdio->start, 904 905 ASIC3_SD_CONFIG_SIZE >> asic->bus_shift); 905 - if (!asic->tmio_cnf) { 906 - ret = -ENOMEM; 907 - dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n"); 908 - goto out; 906 + if (!asic->tmio_cnf) { 907 + ret = -ENOMEM; 908 + dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n"); 909 + goto out; 910 + } 909 911 } 910 912 asic3_mmc_resources[0].start >>= asic->bus_shift; 911 913 asic3_mmc_resources[0].end >>= asic->bus_shift;
+25 -72
drivers/mfd/cros_ec.c
··· 25 25 #include <linux/mfd/cros_ec_commands.h> 26 26 27 27 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 28 - struct cros_ec_msg *msg) 28 + struct cros_ec_command *msg) 29 29 { 30 30 uint8_t *out; 31 31 int csum, i; 32 32 33 - BUG_ON(msg->out_len > EC_PROTO2_MAX_PARAM_SIZE); 33 + BUG_ON(msg->outsize > EC_PROTO2_MAX_PARAM_SIZE); 34 34 out = ec_dev->dout; 35 35 out[0] = EC_CMD_VERSION0 + msg->version; 36 - out[1] = msg->cmd; 37 - out[2] = msg->out_len; 36 + out[1] = msg->command; 37 + out[2] = msg->outsize; 38 38 csum = out[0] + out[1] + out[2]; 39 - for (i = 0; i < msg->out_len; i++) 40 - csum += out[EC_MSG_TX_HEADER_BYTES + i] = msg->out_buf[i]; 41 - out[EC_MSG_TX_HEADER_BYTES + msg->out_len] = (uint8_t)(csum & 0xff); 39 + for (i = 0; i < msg->outsize; i++) 40 + csum += out[EC_MSG_TX_HEADER_BYTES + i] = msg->outdata[i]; 41 + out[EC_MSG_TX_HEADER_BYTES + msg->outsize] = (uint8_t)(csum & 0xff); 42 42 43 - return EC_MSG_TX_PROTO_BYTES + msg->out_len; 43 + return EC_MSG_TX_PROTO_BYTES + msg->outsize; 44 44 } 45 45 EXPORT_SYMBOL(cros_ec_prepare_tx); 46 46 47 - static int cros_ec_command_sendrecv(struct cros_ec_device *ec_dev, 48 - uint16_t cmd, void *out_buf, int out_len, 49 - void *in_buf, int in_len) 47 + int cros_ec_check_result(struct cros_ec_device *ec_dev, 48 + struct cros_ec_command *msg) 50 49 { 51 - struct cros_ec_msg msg; 52 - 53 - msg.version = cmd >> 8; 54 - msg.cmd = cmd & 0xff; 55 - msg.out_buf = out_buf; 56 - msg.out_len = out_len; 57 - msg.in_buf = in_buf; 58 - msg.in_len = in_len; 59 - 60 - return ec_dev->command_xfer(ec_dev, &msg); 50 + switch (msg->result) { 51 + case EC_RES_SUCCESS: 52 + return 0; 53 + case EC_RES_IN_PROGRESS: 54 + dev_dbg(ec_dev->dev, "command 0x%02x in progress\n", 55 + msg->command); 56 + return -EAGAIN; 57 + default: 58 + dev_dbg(ec_dev->dev, "command 0x%02x returned %d\n", 59 + msg->command, msg->result); 60 + return 0; 61 + } 61 62 } 62 - 63 - static int cros_ec_command_recv(struct cros_ec_device *ec_dev, 64 - uint16_t cmd, void *buf, int buf_len) 65 - { 66 - return cros_ec_command_sendrecv(ec_dev, cmd, NULL, 0, buf, buf_len); 67 - } 68 - 69 - static int cros_ec_command_send(struct cros_ec_device *ec_dev, 70 - uint16_t cmd, void *buf, int buf_len) 71 - { 72 - return cros_ec_command_sendrecv(ec_dev, cmd, buf, buf_len, NULL, 0); 73 - } 74 - 75 - static irqreturn_t ec_irq_thread(int irq, void *data) 76 - { 77 - struct cros_ec_device *ec_dev = data; 78 - 79 - if (device_may_wakeup(ec_dev->dev)) 80 - pm_wakeup_event(ec_dev->dev, 0); 81 - 82 - blocking_notifier_call_chain(&ec_dev->event_notifier, 1, ec_dev); 83 - 84 - return IRQ_HANDLED; 85 - } 63 + EXPORT_SYMBOL(cros_ec_check_result); 86 64 87 65 static const struct mfd_cell cros_devs[] = { 88 66 { ··· 80 102 struct device *dev = ec_dev->dev; 81 103 int err = 0; 82 104 83 - BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier); 84 - 85 - ec_dev->command_send = cros_ec_command_send; 86 - ec_dev->command_recv = cros_ec_command_recv; 87 - ec_dev->command_sendrecv = cros_ec_command_sendrecv; 88 - 89 105 if (ec_dev->din_size) { 90 106 ec_dev->din = devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); 91 107 if (!ec_dev->din) ··· 91 119 return -ENOMEM; 92 120 } 93 121 94 - if (!ec_dev->irq) { 95 - dev_dbg(dev, "no valid IRQ: %d\n", ec_dev->irq); 96 - return err; 97 - } 98 - 99 - err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, 100 - IRQF_TRIGGER_LOW | IRQF_ONESHOT, 101 - "chromeos-ec", ec_dev); 102 - if (err) { 103 - dev_err(dev, "request irq %d: error %d\n", ec_dev->irq, err); 104 - return err; 105 - } 106 - 107 122 err = mfd_add_devices(dev, 0, cros_devs, 108 123 ARRAY_SIZE(cros_devs), 109 124 NULL, ec_dev->irq, NULL); 110 125 if (err) { 111 126 dev_err(dev, "failed to add mfd devices\n"); 112 - goto fail_mfd; 127 + return err; 113 128 } 114 129 115 - dev_info(dev, "Chrome EC (%s)\n", ec_dev->name); 130 + dev_info(dev, "Chrome EC device registered\n"); 116 131 117 132 return 0; 118 - 119 - fail_mfd: 120 - free_irq(ec_dev->irq, ec_dev); 121 - 122 - return err; 123 133 } 124 134 EXPORT_SYMBOL(cros_ec_register); 125 135 126 136 int cros_ec_remove(struct cros_ec_device *ec_dev) 127 137 { 128 138 mfd_remove_devices(ec_dev->dev); 129 - free_irq(ec_dev->irq, ec_dev); 130 139 131 140 return 0; 132 141 }
+25 -19
drivers/mfd/cros_ec_i2c.c
··· 29 29 return i2c_get_clientdata(client); 30 30 } 31 31 32 - static int cros_ec_command_xfer(struct cros_ec_device *ec_dev, 33 - struct cros_ec_msg *msg) 32 + static int cros_ec_cmd_xfer_i2c(struct cros_ec_device *ec_dev, 33 + struct cros_ec_command *msg) 34 34 { 35 35 struct i2c_client *client = ec_dev->priv; 36 36 int ret = -ENOMEM; 37 37 int i; 38 + int len; 38 39 int packet_len; 39 40 u8 *out_buf = NULL; 40 41 u8 *in_buf = NULL; ··· 51 50 * allocate larger packet (one byte for checksum, one byte for 52 51 * length, and one for result code) 53 52 */ 54 - packet_len = msg->in_len + 3; 53 + packet_len = msg->insize + 3; 55 54 in_buf = kzalloc(packet_len, GFP_KERNEL); 56 55 if (!in_buf) 57 56 goto done; ··· 62 61 * allocate larger packet (one byte for checksum, one for 63 62 * command code, one for length, and one for command version) 64 63 */ 65 - packet_len = msg->out_len + 4; 64 + packet_len = msg->outsize + 4; 66 65 out_buf = kzalloc(packet_len, GFP_KERNEL); 67 66 if (!out_buf) 68 67 goto done; ··· 70 69 i2c_msg[0].buf = (char *)out_buf; 71 70 72 71 out_buf[0] = EC_CMD_VERSION0 + msg->version; 73 - out_buf[1] = msg->cmd; 74 - out_buf[2] = msg->out_len; 72 + out_buf[1] = msg->command; 73 + out_buf[2] = msg->outsize; 75 74 76 75 /* copy message payload and compute checksum */ 77 76 sum = out_buf[0] + out_buf[1] + out_buf[2]; 78 - for (i = 0; i < msg->out_len; i++) { 79 - out_buf[3 + i] = msg->out_buf[i]; 77 + for (i = 0; i < msg->outsize; i++) { 78 + out_buf[3 + i] = msg->outdata[i]; 80 79 sum += out_buf[3 + i]; 81 80 } 82 - out_buf[3 + msg->out_len] = sum; 81 + out_buf[3 + msg->outsize] = sum; 83 82 84 83 /* send command to EC and read answer */ 85 84 ret = i2c_transfer(client->adapter, i2c_msg, 2); ··· 93 92 } 94 93 95 94 /* check response error code */ 96 - if (i2c_msg[1].buf[0]) { 97 - dev_warn(ec_dev->dev, "command 0x%02x returned an error %d\n", 98 - msg->cmd, i2c_msg[1].buf[0]); 99 - ret = -EINVAL; 95 + msg->result = i2c_msg[1].buf[0]; 96 + ret = cros_ec_check_result(ec_dev, msg); 97 + if (ret) 98 + goto done; 99 + 100 + len = in_buf[1]; 101 + if (len > msg->insize) { 102 + dev_err(ec_dev->dev, "packet too long (%d bytes, expected %d)", 103 + len, msg->insize); 104 + ret = -ENOSPC; 100 105 goto done; 101 106 } 102 107 103 108 /* copy response packet payload and compute checksum */ 104 109 sum = in_buf[0] + in_buf[1]; 105 - for (i = 0; i < msg->in_len; i++) { 106 - msg->in_buf[i] = in_buf[2 + i]; 110 + for (i = 0; i < len; i++) { 111 + msg->indata[i] = in_buf[2 + i]; 107 112 sum += in_buf[2 + i]; 108 113 } 109 114 dev_dbg(ec_dev->dev, "packet: %*ph, sum = %02x\n", 110 115 i2c_msg[1].len, in_buf, sum); 111 - if (sum != in_buf[2 + msg->in_len]) { 116 + if (sum != in_buf[2 + len]) { 112 117 dev_err(ec_dev->dev, "bad packet checksum\n"); 113 118 ret = -EBADMSG; 114 119 goto done; 115 120 } 116 121 117 - ret = 0; 122 + ret = len; 118 123 done: 119 124 kfree(in_buf); 120 125 kfree(out_buf); ··· 139 132 return -ENOMEM; 140 133 141 134 i2c_set_clientdata(client, ec_dev); 142 - ec_dev->name = "I2C"; 143 135 ec_dev->dev = dev; 144 136 ec_dev->priv = client; 145 137 ec_dev->irq = client->irq; 146 - ec_dev->command_xfer = cros_ec_command_xfer; 138 + ec_dev->cmd_xfer = cros_ec_cmd_xfer_i2c; 147 139 ec_dev->ec_name = client->name; 148 140 ec_dev->phys_name = client->adapter->name; 149 141 ec_dev->parent = &client->dev;
+26 -30
drivers/mfd/cros_ec_spi.c
··· 73 73 * if no record 74 74 * @end_of_msg_delay: used to set the delay_usecs on the spi_transfer that 75 75 * is sent when we want to turn off CS at the end of a transaction. 76 - * @lock: mutex to ensure only one user of cros_ec_command_spi_xfer at a time 76 + * @lock: mutex to ensure only one user of cros_ec_cmd_xfer_spi at a time 77 77 */ 78 78 struct cros_ec_spi { 79 79 struct spi_device *spi; ··· 210 210 } 211 211 212 212 /** 213 - * cros_ec_command_spi_xfer - Transfer a message over SPI and receive the reply 213 + * cros_ec_cmd_xfer_spi - Transfer a message over SPI and receive the reply 214 214 * 215 215 * @ec_dev: ChromeOS EC device 216 216 * @ec_msg: Message to transfer 217 217 */ 218 - static int cros_ec_command_spi_xfer(struct cros_ec_device *ec_dev, 219 - struct cros_ec_msg *ec_msg) 218 + static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, 219 + struct cros_ec_command *ec_msg) 220 220 { 221 221 struct cros_ec_spi *ec_spi = ec_dev->priv; 222 222 struct spi_transfer trans; ··· 258 258 /* Get the response */ 259 259 if (!ret) { 260 260 ret = cros_ec_spi_receive_response(ec_dev, 261 - ec_msg->in_len + EC_MSG_TX_PROTO_BYTES); 261 + ec_msg->insize + EC_MSG_TX_PROTO_BYTES); 262 262 } else { 263 263 dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret); 264 264 } 265 265 266 - /* turn off CS */ 266 + /* 267 + * Turn off CS, possibly adding a delay to ensure the rising edge 268 + * doesn't come too soon after the end of the data. 269 + */ 267 270 spi_message_init(&msg); 268 - 269 - if (ec_spi->end_of_msg_delay) { 270 - /* 271 - * Add delay for last transaction, to ensure the rising edge 272 - * doesn't come too soon after the end of the data. 273 - */ 274 - memset(&trans, 0, sizeof(trans)); 275 - trans.delay_usecs = ec_spi->end_of_msg_delay; 276 - spi_message_add_tail(&trans, &msg); 277 - } 271 + memset(&trans, 0, sizeof(trans)); 272 + trans.delay_usecs = ec_spi->end_of_msg_delay; 273 + spi_message_add_tail(&trans, &msg); 278 274 279 275 final_ret = spi_sync(ec_spi->spi, &msg); 280 276 ec_spi->last_transfer_ns = ktime_get_ns(); ··· 281 285 goto exit; 282 286 } 283 287 284 - /* check response error code */ 285 288 ptr = ec_dev->din; 286 - if (ptr[0]) { 287 - dev_warn(ec_dev->dev, "command 0x%02x returned an error %d\n", 288 - ec_msg->cmd, ptr[0]); 289 - debug_packet(ec_dev->dev, "in_err", ptr, len); 290 - ret = -EINVAL; 289 + 290 + /* check response error code */ 291 + ec_msg->result = ptr[0]; 292 + ret = cros_ec_check_result(ec_dev, ec_msg); 293 + if (ret) 291 294 goto exit; 292 - } 295 + 293 296 len = ptr[1]; 294 297 sum = ptr[0] + ptr[1]; 295 - if (len > ec_msg->in_len) { 298 + if (len > ec_msg->insize) { 296 299 dev_err(ec_dev->dev, "packet too long (%d bytes, expected %d)", 297 - len, ec_msg->in_len); 300 + len, ec_msg->insize); 298 301 ret = -ENOSPC; 299 302 goto exit; 300 303 } ··· 301 306 /* copy response packet payload and compute checksum */ 302 307 for (i = 0; i < len; i++) { 303 308 sum += ptr[i + 2]; 304 - if (ec_msg->in_len) 305 - ec_msg->in_buf[i] = ptr[i + 2]; 309 + if (ec_msg->insize) 310 + ec_msg->indata[i] = ptr[i + 2]; 306 311 } 307 312 sum &= 0xff; 308 313 ··· 316 321 goto exit; 317 322 } 318 323 319 - ret = 0; 324 + ret = len; 320 325 exit: 321 326 mutex_unlock(&ec_spi->lock); 322 327 return ret; ··· 359 364 cros_ec_spi_dt_probe(ec_spi, dev); 360 365 361 366 spi_set_drvdata(spi, ec_dev); 362 - ec_dev->name = "SPI"; 363 367 ec_dev->dev = dev; 364 368 ec_dev->priv = ec_spi; 365 369 ec_dev->irq = spi->irq; 366 - ec_dev->command_xfer = cros_ec_command_spi_xfer; 370 + ec_dev->cmd_xfer = cros_ec_cmd_xfer_spi; 367 371 ec_dev->ec_name = ec_spi->spi->modalias; 368 372 ec_dev->phys_name = dev_name(&ec_spi->spi->dev); 369 373 ec_dev->parent = &ec_spi->spi->dev; ··· 374 380 dev_err(dev, "cannot register EC\n"); 375 381 return err; 376 382 } 383 + 384 + device_init_wakeup(&spi->dev, true); 377 385 378 386 return 0; 379 387 }
+3 -3
drivers/mfd/da9063-core.c
··· 153 153 "Device detected (chip-ID: 0x%02X, var-ID: 0x%02X)\n", 154 154 model, variant_id); 155 155 156 - if (variant_code != PMIC_DA9063_BB) { 157 - dev_err(da9063->dev, "Unknown chip variant code: 0x%02X\n", 158 - variant_code); 156 + if (variant_code < PMIC_DA9063_BB && variant_code != PMIC_DA9063_AD) { 157 + dev_err(da9063->dev, 158 + "Cannot support variant code: 0x%02X\n", variant_code); 159 159 return -ENODEV; 160 160 } 161 161
+109 -25
drivers/mfd/da9063-i2c.c
··· 25 25 #include <linux/mfd/da9063/pdata.h> 26 26 #include <linux/mfd/da9063/registers.h> 27 27 28 - static const struct regmap_range da9063_readable_ranges[] = { 28 + static const struct regmap_range da9063_ad_readable_ranges[] = { 29 29 { 30 30 .range_min = DA9063_REG_PAGE_CON, 31 - .range_max = DA9063_REG_SECOND_D, 31 + .range_max = DA9063_AD_REG_SECOND_D, 32 32 }, { 33 33 .range_min = DA9063_REG_SEQ, 34 34 .range_max = DA9063_REG_ID_32_31, ··· 37 37 .range_max = DA9063_REG_AUTO3_LOW, 38 38 }, { 39 39 .range_min = DA9063_REG_T_OFFSET, 40 - .range_max = DA9063_REG_GP_ID_19, 40 + .range_max = DA9063_AD_REG_GP_ID_19, 41 41 }, { 42 42 .range_min = DA9063_REG_CHIP_ID, 43 43 .range_max = DA9063_REG_CHIP_VARIANT, 44 44 }, 45 45 }; 46 46 47 - static const struct regmap_range da9063_writeable_ranges[] = { 47 + static const struct regmap_range da9063_ad_writeable_ranges[] = { 48 48 { 49 49 .range_min = DA9063_REG_PAGE_CON, 50 50 .range_max = DA9063_REG_PAGE_CON, ··· 53 53 .range_max = DA9063_REG_VSYS_MON, 54 54 }, { 55 55 .range_min = DA9063_REG_COUNT_S, 56 - .range_max = DA9063_REG_ALARM_Y, 56 + .range_max = DA9063_AD_REG_ALARM_Y, 57 57 }, { 58 58 .range_min = DA9063_REG_SEQ, 59 59 .range_max = DA9063_REG_ID_32_31, ··· 62 62 .range_max = DA9063_REG_AUTO3_LOW, 63 63 }, { 64 64 .range_min = DA9063_REG_CONFIG_I, 65 - .range_max = DA9063_REG_MON_REG_4, 65 + .range_max = DA9063_AD_REG_MON_REG_4, 66 66 }, { 67 - .range_min = DA9063_REG_GP_ID_0, 68 - .range_max = DA9063_REG_GP_ID_19, 67 + .range_min = DA9063_AD_REG_GP_ID_0, 68 + .range_max = DA9063_AD_REG_GP_ID_19, 69 69 }, 70 70 }; 71 71 72 - static const struct regmap_range da9063_volatile_ranges[] = { 72 + static const struct regmap_range da9063_ad_volatile_ranges[] = { 73 73 { 74 74 .range_min = DA9063_REG_STATUS_A, 75 75 .range_max = DA9063_REG_EVENT_D, ··· 81 81 .range_max = DA9063_REG_ADC_MAN, 82 82 }, { 83 83 .range_min = DA9063_REG_ADC_RES_L, 84 - .range_max = DA9063_REG_SECOND_D, 84 + .range_max = DA9063_AD_REG_SECOND_D, 85 85 }, { 86 - .range_min = DA9063_REG_MON_REG_5, 87 - .range_max = DA9063_REG_MON_REG_6, 86 + .range_min = DA9063_AD_REG_MON_REG_5, 87 + .range_max = DA9063_AD_REG_MON_REG_6, 88 88 }, 89 89 }; 90 90 91 - static const struct regmap_access_table da9063_readable_table = { 92 - .yes_ranges = da9063_readable_ranges, 93 - .n_yes_ranges = ARRAY_SIZE(da9063_readable_ranges), 91 + static const struct regmap_access_table da9063_ad_readable_table = { 92 + .yes_ranges = da9063_ad_readable_ranges, 93 + .n_yes_ranges = ARRAY_SIZE(da9063_ad_readable_ranges), 94 94 }; 95 95 96 - static const struct regmap_access_table da9063_writeable_table = { 97 - .yes_ranges = da9063_writeable_ranges, 98 - .n_yes_ranges = ARRAY_SIZE(da9063_writeable_ranges), 96 + static const struct regmap_access_table da9063_ad_writeable_table = { 97 + .yes_ranges = da9063_ad_writeable_ranges, 98 + .n_yes_ranges = ARRAY_SIZE(da9063_ad_writeable_ranges), 99 99 }; 100 100 101 - static const struct regmap_access_table da9063_volatile_table = { 102 - .yes_ranges = da9063_volatile_ranges, 103 - .n_yes_ranges = ARRAY_SIZE(da9063_volatile_ranges), 101 + static const struct regmap_access_table da9063_ad_volatile_table = { 102 + .yes_ranges = da9063_ad_volatile_ranges, 103 + .n_yes_ranges = ARRAY_SIZE(da9063_ad_volatile_ranges), 104 + }; 105 + 106 + static const struct regmap_range da9063_bb_readable_ranges[] = { 107 + { 108 + .range_min = DA9063_REG_PAGE_CON, 109 + .range_max = DA9063_BB_REG_SECOND_D, 110 + }, { 111 + .range_min = DA9063_REG_SEQ, 112 + .range_max = DA9063_REG_ID_32_31, 113 + }, { 114 + .range_min = DA9063_REG_SEQ_A, 115 + .range_max = DA9063_REG_AUTO3_LOW, 116 + }, { 117 + .range_min = DA9063_REG_T_OFFSET, 118 + .range_max = DA9063_BB_REG_GP_ID_19, 119 + }, { 120 + .range_min = DA9063_REG_CHIP_ID, 121 + .range_max = DA9063_REG_CHIP_VARIANT, 122 + }, 123 + }; 124 + 125 + static const struct regmap_range da9063_bb_writeable_ranges[] = { 126 + { 127 + .range_min = DA9063_REG_PAGE_CON, 128 + .range_max = DA9063_REG_PAGE_CON, 129 + }, { 130 + .range_min = DA9063_REG_FAULT_LOG, 131 + .range_max = DA9063_REG_VSYS_MON, 132 + }, { 133 + .range_min = DA9063_REG_COUNT_S, 134 + .range_max = DA9063_BB_REG_ALARM_Y, 135 + }, { 136 + .range_min = DA9063_REG_SEQ, 137 + .range_max = DA9063_REG_ID_32_31, 138 + }, { 139 + .range_min = DA9063_REG_SEQ_A, 140 + .range_max = DA9063_REG_AUTO3_LOW, 141 + }, { 142 + .range_min = DA9063_REG_CONFIG_I, 143 + .range_max = DA9063_BB_REG_MON_REG_4, 144 + }, { 145 + .range_min = DA9063_BB_REG_GP_ID_0, 146 + .range_max = DA9063_BB_REG_GP_ID_19, 147 + }, 148 + }; 149 + 150 + static const struct regmap_range da9063_bb_volatile_ranges[] = { 151 + { 152 + .range_min = DA9063_REG_STATUS_A, 153 + .range_max = DA9063_REG_EVENT_D, 154 + }, { 155 + .range_min = DA9063_REG_CONTROL_F, 156 + .range_max = DA9063_REG_CONTROL_F, 157 + }, { 158 + .range_min = DA9063_REG_ADC_MAN, 159 + .range_max = DA9063_REG_ADC_MAN, 160 + }, { 161 + .range_min = DA9063_REG_ADC_RES_L, 162 + .range_max = DA9063_BB_REG_SECOND_D, 163 + }, { 164 + .range_min = DA9063_BB_REG_MON_REG_5, 165 + .range_max = DA9063_BB_REG_MON_REG_6, 166 + }, 167 + }; 168 + 169 + static const struct regmap_access_table da9063_bb_readable_table = { 170 + .yes_ranges = da9063_bb_readable_ranges, 171 + .n_yes_ranges = ARRAY_SIZE(da9063_bb_readable_ranges), 172 + }; 173 + 174 + static const struct regmap_access_table da9063_bb_writeable_table = { 175 + .yes_ranges = da9063_bb_writeable_ranges, 176 + .n_yes_ranges = ARRAY_SIZE(da9063_bb_writeable_ranges), 177 + }; 178 + 179 + static const struct regmap_access_table da9063_bb_volatile_table = { 180 + .yes_ranges = da9063_bb_volatile_ranges, 181 + .n_yes_ranges = ARRAY_SIZE(da9063_bb_volatile_ranges), 104 182 }; 105 183 106 184 static const struct regmap_range_cfg da9063_range_cfg[] = { ··· 201 123 .max_register = DA9063_REG_CHIP_VARIANT, 202 124 203 125 .cache_type = REGCACHE_RBTREE, 204 - 205 - .rd_table = &da9063_readable_table, 206 - .wr_table = &da9063_writeable_table, 207 - .volatile_table = &da9063_volatile_table, 208 126 }; 209 127 210 128 static int da9063_i2c_probe(struct i2c_client *i2c, ··· 216 142 i2c_set_clientdata(i2c, da9063); 217 143 da9063->dev = &i2c->dev; 218 144 da9063->chip_irq = i2c->irq; 145 + 146 + if (da9063->variant_code == PMIC_DA9063_AD) { 147 + da9063_regmap_config.rd_table = &da9063_ad_readable_table; 148 + da9063_regmap_config.wr_table = &da9063_ad_writeable_table; 149 + da9063_regmap_config.volatile_table = &da9063_ad_volatile_table; 150 + } else { 151 + da9063_regmap_config.rd_table = &da9063_bb_readable_table; 152 + da9063_regmap_config.wr_table = &da9063_bb_writeable_table; 153 + da9063_regmap_config.volatile_table = &da9063_bb_volatile_table; 154 + } 219 155 220 156 da9063->regmap = devm_regmap_init_i2c(i2c, &da9063_regmap_config); 221 157 if (IS_ERR(da9063->regmap)) {
+1 -1
drivers/mfd/dm355evm_msp.c
··· 95 95 * Many of the msp430 pins are just used as fixed-direction GPIOs. 96 96 * We could export a few more of them this way, if we wanted. 97 97 */ 98 - #define MSP_GPIO(bit,reg) ((DM355EVM_MSP_ ## reg) << 3 | (bit)) 98 + #define MSP_GPIO(bit, reg) ((DM355EVM_MSP_ ## reg) << 3 | (bit)) 99 99 100 100 static const u8 msp_gpios[] = { 101 101 /* eight leds */
+1 -2
drivers/mfd/ezx-pcap.c
··· 62 62 struct spi_message m; 63 63 int status; 64 64 65 - memset(&t, 0, sizeof t); 65 + memset(&t, 0, sizeof(t)); 66 66 spi_message_init(&m); 67 67 t.len = sizeof(u32); 68 68 spi_message_add_tail(&t, &m); ··· 211 211 212 212 desc->irq_data.chip->irq_ack(&desc->irq_data); 213 213 queue_work(pcap->workqueue, &pcap->isr_work); 214 - return; 215 214 } 216 215 217 216 /* ADC */
-5
drivers/mfd/htc-i2cpld.c
··· 332 332 int chip_index) 333 333 { 334 334 struct htcpld_data *htcpld; 335 - struct device *dev = &pdev->dev; 336 - struct htcpld_core_platform_data *pdata; 337 335 struct htcpld_chip *chip; 338 - struct htcpld_chip_platform_data *plat_chip_data; 339 336 unsigned int irq, irq_end; 340 337 int ret = 0; 341 338 342 339 /* Get the platform and driver data */ 343 - pdata = dev_get_platdata(dev); 344 340 htcpld = platform_get_drvdata(pdev); 345 341 chip = &htcpld->chip[chip_index]; 346 - plat_chip_data = &pdata->chip[chip_index]; 347 342 348 343 /* Setup irq handlers */ 349 344 irq_end = chip->irq_start + chip->nirqs;
+170
drivers/mfd/intel_soc_pmic_core.c
··· 1 + /* 2 + * intel_soc_pmic_core.c - Intel SoC PMIC MFD Driver 3 + * 4 + * Copyright (C) 2013, 2014 Intel Corporation. All rights reserved. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License version 8 + * 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * Author: Yang, Bin <bin.yang@intel.com> 16 + * Author: Zhu, Lejun <lejun.zhu@linux.intel.com> 17 + */ 18 + 19 + #include <linux/module.h> 20 + #include <linux/mfd/core.h> 21 + #include <linux/i2c.h> 22 + #include <linux/interrupt.h> 23 + #include <linux/gpio/consumer.h> 24 + #include <linux/acpi.h> 25 + #include <linux/regmap.h> 26 + #include <linux/mfd/intel_soc_pmic.h> 27 + #include "intel_soc_pmic_core.h" 28 + 29 + /* 30 + * On some boards the PMIC interrupt may come from a GPIO line. 31 + * Try to lookup the ACPI table and see if such connection exists. If not, 32 + * return -ENOENT and use the IRQ provided by I2C. 33 + */ 34 + static int intel_soc_pmic_find_gpio_irq(struct device *dev) 35 + { 36 + struct gpio_desc *desc; 37 + int irq; 38 + 39 + desc = devm_gpiod_get_index(dev, "intel_soc_pmic", 0); 40 + if (IS_ERR(desc)) 41 + return -ENOENT; 42 + 43 + irq = gpiod_to_irq(desc); 44 + if (irq < 0) 45 + dev_warn(dev, "Can't get irq: %d\n", irq); 46 + 47 + return irq; 48 + } 49 + 50 + static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c, 51 + const struct i2c_device_id *i2c_id) 52 + { 53 + struct device *dev = &i2c->dev; 54 + const struct acpi_device_id *id; 55 + struct intel_soc_pmic_config *config; 56 + struct intel_soc_pmic *pmic; 57 + int ret; 58 + int irq; 59 + 60 + id = acpi_match_device(dev->driver->acpi_match_table, dev); 61 + if (!id || !id->driver_data) 62 + return -ENODEV; 63 + 64 + config = (struct intel_soc_pmic_config *)id->driver_data; 65 + 66 + pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL); 67 + dev_set_drvdata(dev, pmic); 68 + 69 + pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config); 70 + 71 + irq = intel_soc_pmic_find_gpio_irq(dev); 72 + pmic->irq = (irq < 0) ? i2c->irq : irq; 73 + 74 + ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, 75 + config->irq_flags | IRQF_ONESHOT, 76 + 0, config->irq_chip, 77 + &pmic->irq_chip_data); 78 + if (ret) 79 + return ret; 80 + 81 + ret = enable_irq_wake(pmic->irq); 82 + if (ret) 83 + dev_warn(dev, "Can't enable IRQ as wake source: %d\n", ret); 84 + 85 + ret = mfd_add_devices(dev, -1, config->cell_dev, 86 + config->n_cell_devs, NULL, 0, 87 + regmap_irq_get_domain(pmic->irq_chip_data)); 88 + if (ret) 89 + goto err_del_irq_chip; 90 + 91 + return 0; 92 + 93 + err_del_irq_chip: 94 + regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); 95 + return ret; 96 + } 97 + 98 + static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c) 99 + { 100 + struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev); 101 + 102 + regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); 103 + 104 + mfd_remove_devices(&i2c->dev); 105 + 106 + return 0; 107 + } 108 + 109 + static void intel_soc_pmic_shutdown(struct i2c_client *i2c) 110 + { 111 + struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev); 112 + 113 + disable_irq(pmic->irq); 114 + 115 + return; 116 + } 117 + 118 + static int intel_soc_pmic_suspend(struct device *dev) 119 + { 120 + struct intel_soc_pmic *pmic = dev_get_drvdata(dev); 121 + 122 + disable_irq(pmic->irq); 123 + 124 + return 0; 125 + } 126 + 127 + static int intel_soc_pmic_resume(struct device *dev) 128 + { 129 + struct intel_soc_pmic *pmic = dev_get_drvdata(dev); 130 + 131 + enable_irq(pmic->irq); 132 + 133 + return 0; 134 + } 135 + 136 + static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend, 137 + intel_soc_pmic_resume); 138 + 139 + static const struct i2c_device_id intel_soc_pmic_i2c_id[] = { 140 + { } 141 + }; 142 + MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id); 143 + 144 + #if defined(CONFIG_ACPI) 145 + static struct acpi_device_id intel_soc_pmic_acpi_match[] = { 146 + {"INT33FD", (kernel_ulong_t)&intel_soc_pmic_config_crc}, 147 + { }, 148 + }; 149 + MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match); 150 + #endif 151 + 152 + static struct i2c_driver intel_soc_pmic_i2c_driver = { 153 + .driver = { 154 + .name = "intel_soc_pmic_i2c", 155 + .owner = THIS_MODULE, 156 + .pm = &intel_soc_pmic_pm_ops, 157 + .acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match), 158 + }, 159 + .probe = intel_soc_pmic_i2c_probe, 160 + .remove = intel_soc_pmic_i2c_remove, 161 + .id_table = intel_soc_pmic_i2c_id, 162 + .shutdown = intel_soc_pmic_shutdown, 163 + }; 164 + 165 + module_i2c_driver(intel_soc_pmic_i2c_driver); 166 + 167 + MODULE_DESCRIPTION("I2C driver for Intel SoC PMIC"); 168 + MODULE_LICENSE("GPL v2"); 169 + MODULE_AUTHOR("Yang, Bin <bin.yang@intel.com>"); 170 + MODULE_AUTHOR("Zhu, Lejun <lejun.zhu@linux.intel.com>");
+32
drivers/mfd/intel_soc_pmic_core.h
··· 1 + /* 2 + * intel_soc_pmic_core.h - Intel SoC PMIC MFD Driver 3 + * 4 + * Copyright (C) 2012-2014 Intel Corporation. All rights reserved. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License version 8 + * 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * Author: Yang, Bin <bin.yang@intel.com> 16 + * Author: Zhu, Lejun <lejun.zhu@linux.intel.com> 17 + */ 18 + 19 + #ifndef __INTEL_SOC_PMIC_CORE_H__ 20 + #define __INTEL_SOC_PMIC_CORE_H__ 21 + 22 + struct intel_soc_pmic_config { 23 + unsigned long irq_flags; 24 + struct mfd_cell *cell_dev; 25 + int n_cell_devs; 26 + struct regmap_config *regmap_config; 27 + struct regmap_irq_chip *irq_chip; 28 + }; 29 + 30 + extern struct intel_soc_pmic_config intel_soc_pmic_config_crc; 31 + 32 + #endif /* __INTEL_SOC_PMIC_CORE_H__ */
+158
drivers/mfd/intel_soc_pmic_crc.c
··· 1 + /* 2 + * intel_soc_pmic_crc.c - Device access for Crystal Cove PMIC 3 + * 4 + * Copyright (C) 2013, 2014 Intel Corporation. All rights reserved. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License version 8 + * 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * Author: Yang, Bin <bin.yang@intel.com> 16 + * Author: Zhu, Lejun <lejun.zhu@linux.intel.com> 17 + */ 18 + 19 + #include <linux/mfd/core.h> 20 + #include <linux/interrupt.h> 21 + #include <linux/regmap.h> 22 + #include <linux/mfd/intel_soc_pmic.h> 23 + #include "intel_soc_pmic_core.h" 24 + 25 + #define CRYSTAL_COVE_MAX_REGISTER 0xC6 26 + 27 + #define CRYSTAL_COVE_REG_IRQLVL1 0x02 28 + #define CRYSTAL_COVE_REG_MIRQLVL1 0x0E 29 + 30 + #define CRYSTAL_COVE_IRQ_PWRSRC 0 31 + #define CRYSTAL_COVE_IRQ_THRM 1 32 + #define CRYSTAL_COVE_IRQ_BCU 2 33 + #define CRYSTAL_COVE_IRQ_ADC 3 34 + #define CRYSTAL_COVE_IRQ_CHGR 4 35 + #define CRYSTAL_COVE_IRQ_GPIO 5 36 + #define CRYSTAL_COVE_IRQ_VHDMIOCP 6 37 + 38 + static struct resource gpio_resources[] = { 39 + { 40 + .name = "GPIO", 41 + .start = CRYSTAL_COVE_IRQ_GPIO, 42 + .end = CRYSTAL_COVE_IRQ_GPIO, 43 + .flags = IORESOURCE_IRQ, 44 + }, 45 + }; 46 + 47 + static struct resource pwrsrc_resources[] = { 48 + { 49 + .name = "PWRSRC", 50 + .start = CRYSTAL_COVE_IRQ_PWRSRC, 51 + .end = CRYSTAL_COVE_IRQ_PWRSRC, 52 + .flags = IORESOURCE_IRQ, 53 + }, 54 + }; 55 + 56 + static struct resource adc_resources[] = { 57 + { 58 + .name = "ADC", 59 + .start = CRYSTAL_COVE_IRQ_ADC, 60 + .end = CRYSTAL_COVE_IRQ_ADC, 61 + .flags = IORESOURCE_IRQ, 62 + }, 63 + }; 64 + 65 + static struct resource thermal_resources[] = { 66 + { 67 + .name = "THERMAL", 68 + .start = CRYSTAL_COVE_IRQ_THRM, 69 + .end = CRYSTAL_COVE_IRQ_THRM, 70 + .flags = IORESOURCE_IRQ, 71 + }, 72 + }; 73 + 74 + static struct resource bcu_resources[] = { 75 + { 76 + .name = "BCU", 77 + .start = CRYSTAL_COVE_IRQ_BCU, 78 + .end = CRYSTAL_COVE_IRQ_BCU, 79 + .flags = IORESOURCE_IRQ, 80 + }, 81 + }; 82 + 83 + static struct mfd_cell crystal_cove_dev[] = { 84 + { 85 + .name = "crystal_cove_pwrsrc", 86 + .num_resources = ARRAY_SIZE(pwrsrc_resources), 87 + .resources = pwrsrc_resources, 88 + }, 89 + { 90 + .name = "crystal_cove_adc", 91 + .num_resources = ARRAY_SIZE(adc_resources), 92 + .resources = adc_resources, 93 + }, 94 + { 95 + .name = "crystal_cove_thermal", 96 + .num_resources = ARRAY_SIZE(thermal_resources), 97 + .resources = thermal_resources, 98 + }, 99 + { 100 + .name = "crystal_cove_bcu", 101 + .num_resources = ARRAY_SIZE(bcu_resources), 102 + .resources = bcu_resources, 103 + }, 104 + { 105 + .name = "crystal_cove_gpio", 106 + .num_resources = ARRAY_SIZE(gpio_resources), 107 + .resources = gpio_resources, 108 + }, 109 + }; 110 + 111 + static struct regmap_config crystal_cove_regmap_config = { 112 + .reg_bits = 8, 113 + .val_bits = 8, 114 + 115 + .max_register = CRYSTAL_COVE_MAX_REGISTER, 116 + .cache_type = REGCACHE_NONE, 117 + }; 118 + 119 + static const struct regmap_irq crystal_cove_irqs[] = { 120 + [CRYSTAL_COVE_IRQ_PWRSRC] = { 121 + .mask = BIT(CRYSTAL_COVE_IRQ_PWRSRC), 122 + }, 123 + [CRYSTAL_COVE_IRQ_THRM] = { 124 + .mask = BIT(CRYSTAL_COVE_IRQ_THRM), 125 + }, 126 + [CRYSTAL_COVE_IRQ_BCU] = { 127 + .mask = BIT(CRYSTAL_COVE_IRQ_BCU), 128 + }, 129 + [CRYSTAL_COVE_IRQ_ADC] = { 130 + .mask = BIT(CRYSTAL_COVE_IRQ_ADC), 131 + }, 132 + [CRYSTAL_COVE_IRQ_CHGR] = { 133 + .mask = BIT(CRYSTAL_COVE_IRQ_CHGR), 134 + }, 135 + [CRYSTAL_COVE_IRQ_GPIO] = { 136 + .mask = BIT(CRYSTAL_COVE_IRQ_GPIO), 137 + }, 138 + [CRYSTAL_COVE_IRQ_VHDMIOCP] = { 139 + .mask = BIT(CRYSTAL_COVE_IRQ_VHDMIOCP), 140 + }, 141 + }; 142 + 143 + static struct regmap_irq_chip crystal_cove_irq_chip = { 144 + .name = "Crystal Cove", 145 + .irqs = crystal_cove_irqs, 146 + .num_irqs = ARRAY_SIZE(crystal_cove_irqs), 147 + .num_regs = 1, 148 + .status_base = CRYSTAL_COVE_REG_IRQLVL1, 149 + .mask_base = CRYSTAL_COVE_REG_MIRQLVL1, 150 + }; 151 + 152 + struct intel_soc_pmic_config intel_soc_pmic_config_crc = { 153 + .irq_flags = IRQF_TRIGGER_RISING, 154 + .cell_dev = crystal_cove_dev, 155 + .n_cell_devs = ARRAY_SIZE(crystal_cove_dev), 156 + .regmap_config = &crystal_cove_regmap_config, 157 + .irq_chip = &crystal_cove_irq_chip, 158 + };
+4 -4
drivers/mfd/ipaq-micro.c
··· 115 115 } else { 116 116 dev_err(micro->dev, 117 117 "out of band RX message 0x%02x\n", id); 118 - if(!micro->msg) 118 + if (!micro->msg) 119 119 dev_info(micro->dev, "no message queued\n"); 120 120 else 121 121 dev_info(micro->dev, "expected message %02x\n", ··· 126 126 if (micro->key) 127 127 micro->key(micro->key_data, len, data); 128 128 else 129 - dev_dbg(micro->dev, "key message ignored, no handle \n"); 129 + dev_dbg(micro->dev, "key message ignored, no handle\n"); 130 130 break; 131 131 case MSG_TOUCHSCREEN: 132 132 if (micro->ts) 133 133 micro->ts(micro->ts_data, len, data); 134 134 else 135 - dev_dbg(micro->dev, "touchscreen message ignored, no handle \n"); 135 + dev_dbg(micro->dev, "touchscreen message ignored, no handle\n"); 136 136 break; 137 137 default: 138 138 dev_err(micro->dev, ··· 154 154 rx->state = STATE_ID; /* Next byte is the id and len */ 155 155 break; 156 156 case STATE_ID: /* Looking for id and len byte */ 157 - rx->id = (ch & 0xf0) >> 4 ; 157 + rx->id = (ch & 0xf0) >> 4; 158 158 rx->len = (ch & 0x0f); 159 159 rx->index = 0; 160 160 rx->chksum = ch;
+6 -4
drivers/mfd/kempld-core.c
··· 24 24 25 25 #define MAX_ID_LEN 4 26 26 static char force_device_id[MAX_ID_LEN + 1] = ""; 27 - module_param_string(force_device_id, force_device_id, sizeof(force_device_id), 0); 27 + module_param_string(force_device_id, force_device_id, 28 + sizeof(force_device_id), 0); 28 29 MODULE_PARM_DESC(force_device_id, "Override detected product"); 29 30 30 31 /* ··· 37 36 { 38 37 /* The mutex bit will read 1 until access has been granted */ 39 38 while (ioread8(pld->io_index) & KEMPLD_MUTEX_KEY) 40 - msleep(1); 39 + usleep_range(1000, 3000); 41 40 } 42 41 43 42 static void kempld_release_hardware_mutex(struct kempld_device_data *pld) ··· 500 499 .remove = kempld_remove, 501 500 }; 502 501 503 - static struct dmi_system_id __initdata kempld_dmi_table[] = { 502 + static struct dmi_system_id kempld_dmi_table[] __initdata = { 504 503 { 505 504 .ident = "BHL6", 506 505 .matches = { ··· 737 736 int ret; 738 737 739 738 if (force_device_id[0]) { 740 - for (id = kempld_dmi_table; id->matches[0].slot != DMI_NONE; id++) 739 + for (id = kempld_dmi_table; 740 + id->matches[0].slot != DMI_NONE; id++) 741 741 if (strstr(id->ident, force_device_id)) 742 742 if (id->callback && id->callback(id)) 743 743 break;
+2
drivers/mfd/lp8788-irq.c
··· 66 66 static void lp8788_irq_enable(struct irq_data *data) 67 67 { 68 68 struct lp8788_irq_data *irqd = irq_data_get_irq_chip_data(data); 69 + 69 70 irqd->enabled[data->hwirq] = 1; 70 71 } 71 72 72 73 static void lp8788_irq_disable(struct irq_data *data) 73 74 { 74 75 struct lp8788_irq_data *irqd = irq_data_get_irq_chip_data(data); 76 + 75 77 irqd->enabled[data->hwirq] = 0; 76 78 } 77 79
-319
drivers/mfd/max77686-irq.c
··· 1 - /* 2 - * max77686-irq.c - Interrupt controller support for MAX77686 3 - * 4 - * Copyright (C) 2012 Samsung Electronics Co.Ltd 5 - * Chiwoong Byun <woong.byun@samsung.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 as published by 9 - * the Free Software Foundation; either version 2 of the License, or 10 - * (at your option) any later version. 11 - * 12 - * This program is distributed in the hope that it will be useful, 13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 - * GNU General Public License for more details. 16 - * 17 - * You should have received a copy of the GNU General Public License 18 - * along with this program; if not, write to the Free Software 19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 - * 21 - * This driver is based on max8997-irq.c 22 - */ 23 - 24 - #include <linux/err.h> 25 - #include <linux/irq.h> 26 - #include <linux/interrupt.h> 27 - #include <linux/gpio.h> 28 - #include <linux/mfd/max77686.h> 29 - #include <linux/mfd/max77686-private.h> 30 - #include <linux/irqdomain.h> 31 - #include <linux/regmap.h> 32 - 33 - enum { 34 - MAX77686_DEBUG_IRQ_INFO = 1 << 0, 35 - MAX77686_DEBUG_IRQ_MASK = 1 << 1, 36 - MAX77686_DEBUG_IRQ_INT = 1 << 2, 37 - }; 38 - 39 - static int debug_mask = 0; 40 - module_param(debug_mask, int, 0); 41 - MODULE_PARM_DESC(debug_mask, "Set debug_mask : 0x0=off 0x1=IRQ_INFO 0x2=IRQ_MASK 0x4=IRQ_INI)"); 42 - 43 - static const u8 max77686_mask_reg[] = { 44 - [PMIC_INT1] = MAX77686_REG_INT1MSK, 45 - [PMIC_INT2] = MAX77686_REG_INT2MSK, 46 - [RTC_INT] = MAX77686_RTC_INTM, 47 - }; 48 - 49 - static struct regmap *max77686_get_regmap(struct max77686_dev *max77686, 50 - enum max77686_irq_source src) 51 - { 52 - switch (src) { 53 - case PMIC_INT1 ... PMIC_INT2: 54 - return max77686->regmap; 55 - case RTC_INT: 56 - return max77686->rtc_regmap; 57 - default: 58 - return ERR_PTR(-EINVAL); 59 - } 60 - } 61 - 62 - struct max77686_irq_data { 63 - int mask; 64 - enum max77686_irq_source group; 65 - }; 66 - 67 - #define DECLARE_IRQ(idx, _group, _mask) \ 68 - [(idx)] = { .group = (_group), .mask = (_mask) } 69 - static const struct max77686_irq_data max77686_irqs[] = { 70 - DECLARE_IRQ(MAX77686_PMICIRQ_PWRONF, PMIC_INT1, 1 << 0), 71 - DECLARE_IRQ(MAX77686_PMICIRQ_PWRONR, PMIC_INT1, 1 << 1), 72 - DECLARE_IRQ(MAX77686_PMICIRQ_JIGONBF, PMIC_INT1, 1 << 2), 73 - DECLARE_IRQ(MAX77686_PMICIRQ_JIGONBR, PMIC_INT1, 1 << 3), 74 - DECLARE_IRQ(MAX77686_PMICIRQ_ACOKBF, PMIC_INT1, 1 << 4), 75 - DECLARE_IRQ(MAX77686_PMICIRQ_ACOKBR, PMIC_INT1, 1 << 5), 76 - DECLARE_IRQ(MAX77686_PMICIRQ_ONKEY1S, PMIC_INT1, 1 << 6), 77 - DECLARE_IRQ(MAX77686_PMICIRQ_MRSTB, PMIC_INT1, 1 << 7), 78 - DECLARE_IRQ(MAX77686_PMICIRQ_140C, PMIC_INT2, 1 << 0), 79 - DECLARE_IRQ(MAX77686_PMICIRQ_120C, PMIC_INT2, 1 << 1), 80 - DECLARE_IRQ(MAX77686_RTCIRQ_RTC60S, RTC_INT, 1 << 0), 81 - DECLARE_IRQ(MAX77686_RTCIRQ_RTCA1, RTC_INT, 1 << 1), 82 - DECLARE_IRQ(MAX77686_RTCIRQ_RTCA2, RTC_INT, 1 << 2), 83 - DECLARE_IRQ(MAX77686_RTCIRQ_SMPL, RTC_INT, 1 << 3), 84 - DECLARE_IRQ(MAX77686_RTCIRQ_RTC1S, RTC_INT, 1 << 4), 85 - DECLARE_IRQ(MAX77686_RTCIRQ_WTSR, RTC_INT, 1 << 5), 86 - }; 87 - 88 - static void max77686_irq_lock(struct irq_data *data) 89 - { 90 - struct max77686_dev *max77686 = irq_get_chip_data(data->irq); 91 - 92 - if (debug_mask & MAX77686_DEBUG_IRQ_MASK) 93 - pr_info("%s\n", __func__); 94 - 95 - mutex_lock(&max77686->irqlock); 96 - } 97 - 98 - static void max77686_irq_sync_unlock(struct irq_data *data) 99 - { 100 - struct max77686_dev *max77686 = irq_get_chip_data(data->irq); 101 - int i; 102 - 103 - for (i = 0; i < MAX77686_IRQ_GROUP_NR; i++) { 104 - u8 mask_reg = max77686_mask_reg[i]; 105 - struct regmap *map = max77686_get_regmap(max77686, i); 106 - 107 - if (debug_mask & MAX77686_DEBUG_IRQ_MASK) 108 - pr_debug("%s: mask_reg[%d]=0x%x, cur=0x%x\n", 109 - __func__, i, mask_reg, max77686->irq_masks_cur[i]); 110 - 111 - if (mask_reg == MAX77686_REG_INVALID || 112 - IS_ERR_OR_NULL(map)) 113 - continue; 114 - 115 - max77686->irq_masks_cache[i] = max77686->irq_masks_cur[i]; 116 - 117 - regmap_write(map, max77686_mask_reg[i], 118 - max77686->irq_masks_cur[i]); 119 - } 120 - 121 - mutex_unlock(&max77686->irqlock); 122 - } 123 - 124 - static const inline struct max77686_irq_data *to_max77686_irq(int irq) 125 - { 126 - struct irq_data *data = irq_get_irq_data(irq); 127 - return &max77686_irqs[data->hwirq]; 128 - } 129 - 130 - static void max77686_irq_mask(struct irq_data *data) 131 - { 132 - struct max77686_dev *max77686 = irq_get_chip_data(data->irq); 133 - const struct max77686_irq_data *irq_data = to_max77686_irq(data->irq); 134 - 135 - max77686->irq_masks_cur[irq_data->group] |= irq_data->mask; 136 - 137 - if (debug_mask & MAX77686_DEBUG_IRQ_MASK) 138 - pr_info("%s: group=%d, cur=0x%x\n", 139 - __func__, irq_data->group, 140 - max77686->irq_masks_cur[irq_data->group]); 141 - } 142 - 143 - static void max77686_irq_unmask(struct irq_data *data) 144 - { 145 - struct max77686_dev *max77686 = irq_get_chip_data(data->irq); 146 - const struct max77686_irq_data *irq_data = to_max77686_irq(data->irq); 147 - 148 - max77686->irq_masks_cur[irq_data->group] &= ~irq_data->mask; 149 - 150 - if (debug_mask & MAX77686_DEBUG_IRQ_MASK) 151 - pr_info("%s: group=%d, cur=0x%x\n", 152 - __func__, irq_data->group, 153 - max77686->irq_masks_cur[irq_data->group]); 154 - } 155 - 156 - static struct irq_chip max77686_irq_chip = { 157 - .name = "max77686", 158 - .irq_bus_lock = max77686_irq_lock, 159 - .irq_bus_sync_unlock = max77686_irq_sync_unlock, 160 - .irq_mask = max77686_irq_mask, 161 - .irq_unmask = max77686_irq_unmask, 162 - }; 163 - 164 - static irqreturn_t max77686_irq_thread(int irq, void *data) 165 - { 166 - struct max77686_dev *max77686 = data; 167 - unsigned int irq_reg[MAX77686_IRQ_GROUP_NR] = {}; 168 - unsigned int irq_src; 169 - int ret; 170 - int i, cur_irq; 171 - 172 - ret = regmap_read(max77686->regmap, MAX77686_REG_INTSRC, &irq_src); 173 - if (ret < 0) { 174 - dev_err(max77686->dev, "Failed to read interrupt source: %d\n", 175 - ret); 176 - return IRQ_NONE; 177 - } 178 - 179 - if (debug_mask & MAX77686_DEBUG_IRQ_INT) 180 - pr_info("%s: irq_src=0x%x\n", __func__, irq_src); 181 - 182 - if (irq_src == MAX77686_IRQSRC_PMIC) { 183 - ret = regmap_bulk_read(max77686->regmap, 184 - MAX77686_REG_INT1, irq_reg, 2); 185 - if (ret < 0) { 186 - dev_err(max77686->dev, "Failed to read interrupt source: %d\n", 187 - ret); 188 - return IRQ_NONE; 189 - } 190 - 191 - if (debug_mask & MAX77686_DEBUG_IRQ_INT) 192 - pr_info("%s: int1=0x%x, int2=0x%x\n", __func__, 193 - irq_reg[PMIC_INT1], irq_reg[PMIC_INT2]); 194 - } 195 - 196 - if (irq_src & MAX77686_IRQSRC_RTC) { 197 - ret = regmap_read(max77686->rtc_regmap, 198 - MAX77686_RTC_INT, &irq_reg[RTC_INT]); 199 - if (ret < 0) { 200 - dev_err(max77686->dev, "Failed to read interrupt source: %d\n", 201 - ret); 202 - return IRQ_NONE; 203 - } 204 - 205 - if (debug_mask & MAX77686_DEBUG_IRQ_INT) 206 - pr_info("%s: rtc int=0x%x\n", __func__, 207 - irq_reg[RTC_INT]); 208 - 209 - } 210 - 211 - for (i = 0; i < MAX77686_IRQ_GROUP_NR; i++) 212 - irq_reg[i] &= ~max77686->irq_masks_cur[i]; 213 - 214 - for (i = 0; i < MAX77686_IRQ_NR; i++) { 215 - if (irq_reg[max77686_irqs[i].group] & max77686_irqs[i].mask) { 216 - cur_irq = irq_find_mapping(max77686->irq_domain, i); 217 - if (cur_irq) 218 - handle_nested_irq(cur_irq); 219 - } 220 - } 221 - 222 - return IRQ_HANDLED; 223 - } 224 - 225 - static int max77686_irq_domain_map(struct irq_domain *d, unsigned int irq, 226 - irq_hw_number_t hw) 227 - { 228 - struct max77686_dev *max77686 = d->host_data; 229 - 230 - irq_set_chip_data(irq, max77686); 231 - irq_set_chip_and_handler(irq, &max77686_irq_chip, handle_edge_irq); 232 - irq_set_nested_thread(irq, 1); 233 - #ifdef CONFIG_ARM 234 - set_irq_flags(irq, IRQF_VALID); 235 - #else 236 - irq_set_noprobe(irq); 237 - #endif 238 - return 0; 239 - } 240 - 241 - static struct irq_domain_ops max77686_irq_domain_ops = { 242 - .map = max77686_irq_domain_map, 243 - }; 244 - 245 - int max77686_irq_init(struct max77686_dev *max77686) 246 - { 247 - struct irq_domain *domain; 248 - int i; 249 - int ret; 250 - int val; 251 - struct regmap *map; 252 - 253 - mutex_init(&max77686->irqlock); 254 - 255 - if (max77686->irq_gpio && !max77686->irq) { 256 - max77686->irq = gpio_to_irq(max77686->irq_gpio); 257 - 258 - if (debug_mask & MAX77686_DEBUG_IRQ_INT) { 259 - ret = gpio_request(max77686->irq_gpio, "pmic_irq"); 260 - if (ret < 0) { 261 - dev_err(max77686->dev, 262 - "Failed to request gpio %d with ret:" 263 - "%d\n", max77686->irq_gpio, ret); 264 - return IRQ_NONE; 265 - } 266 - 267 - gpio_direction_input(max77686->irq_gpio); 268 - val = gpio_get_value(max77686->irq_gpio); 269 - gpio_free(max77686->irq_gpio); 270 - pr_info("%s: gpio_irq=%x\n", __func__, val); 271 - } 272 - } 273 - 274 - if (!max77686->irq) { 275 - dev_err(max77686->dev, "irq is not specified\n"); 276 - return -ENODEV; 277 - } 278 - 279 - /* Mask individual interrupt sources */ 280 - for (i = 0; i < MAX77686_IRQ_GROUP_NR; i++) { 281 - max77686->irq_masks_cur[i] = 0xff; 282 - max77686->irq_masks_cache[i] = 0xff; 283 - map = max77686_get_regmap(max77686, i); 284 - 285 - if (IS_ERR_OR_NULL(map)) 286 - continue; 287 - if (max77686_mask_reg[i] == MAX77686_REG_INVALID) 288 - continue; 289 - 290 - regmap_write(map, max77686_mask_reg[i], 0xff); 291 - } 292 - domain = irq_domain_add_linear(NULL, MAX77686_IRQ_NR, 293 - &max77686_irq_domain_ops, max77686); 294 - if (!domain) { 295 - dev_err(max77686->dev, "could not create irq domain\n"); 296 - return -ENODEV; 297 - } 298 - max77686->irq_domain = domain; 299 - 300 - ret = request_threaded_irq(max77686->irq, NULL, max77686_irq_thread, 301 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 302 - "max77686-irq", max77686); 303 - 304 - if (ret) 305 - dev_err(max77686->dev, "Failed to request IRQ %d: %d\n", 306 - max77686->irq, ret); 307 - 308 - 309 - if (debug_mask & MAX77686_DEBUG_IRQ_INFO) 310 - pr_info("%s-\n", __func__); 311 - 312 - return 0; 313 - } 314 - 315 - void max77686_irq_exit(struct max77686_dev *max77686) 316 - { 317 - if (max77686->irq) 318 - free_irq(max77686->irq, max77686); 319 - }
+294 -37
drivers/mfd/max77686.c
··· 1 1 /* 2 - * max77686.c - mfd core driver for the Maxim 77686 2 + * max77686.c - mfd core driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electronics 5 5 * Chiwoong Byun <woong.byun@smasung.com> ··· 25 25 #include <linux/export.h> 26 26 #include <linux/slab.h> 27 27 #include <linux/i2c.h> 28 + #include <linux/irq.h> 29 + #include <linux/interrupt.h> 28 30 #include <linux/pm_runtime.h> 29 31 #include <linux/module.h> 30 32 #include <linux/mfd/core.h> ··· 43 41 { .name = "max77686-clk", }, 44 42 }; 45 43 44 + static const struct mfd_cell max77802_devs[] = { 45 + { .name = "max77802-pmic", }, 46 + { .name = "max77802-clk", }, 47 + { .name = "max77802-rtc", }, 48 + }; 49 + 50 + static bool max77802_pmic_is_accessible_reg(struct device *dev, 51 + unsigned int reg) 52 + { 53 + return (reg >= MAX77802_REG_DEVICE_ID && reg < MAX77802_REG_PMIC_END); 54 + } 55 + 56 + static bool max77802_rtc_is_accessible_reg(struct device *dev, 57 + unsigned int reg) 58 + { 59 + return (reg >= MAX77802_RTC_INT && reg < MAX77802_RTC_END); 60 + } 61 + 62 + static bool max77802_is_accessible_reg(struct device *dev, unsigned int reg) 63 + { 64 + return (max77802_pmic_is_accessible_reg(dev, reg) || 65 + max77802_rtc_is_accessible_reg(dev, reg)); 66 + } 67 + 68 + static bool max77802_pmic_is_precious_reg(struct device *dev, unsigned int reg) 69 + { 70 + return (reg == MAX77802_REG_INTSRC || reg == MAX77802_REG_INT1 || 71 + reg == MAX77802_REG_INT2); 72 + } 73 + 74 + static bool max77802_rtc_is_precious_reg(struct device *dev, unsigned int reg) 75 + { 76 + return (reg == MAX77802_RTC_INT || 77 + reg == MAX77802_RTC_UPDATE0 || 78 + reg == MAX77802_RTC_UPDATE1); 79 + } 80 + 81 + static bool max77802_is_precious_reg(struct device *dev, unsigned int reg) 82 + { 83 + return (max77802_pmic_is_precious_reg(dev, reg) || 84 + max77802_rtc_is_precious_reg(dev, reg)); 85 + } 86 + 87 + static bool max77802_pmic_is_volatile_reg(struct device *dev, unsigned int reg) 88 + { 89 + return (max77802_is_precious_reg(dev, reg) || 90 + reg == MAX77802_REG_STATUS1 || reg == MAX77802_REG_STATUS2 || 91 + reg == MAX77802_REG_PWRON); 92 + } 93 + 94 + static bool max77802_rtc_is_volatile_reg(struct device *dev, unsigned int reg) 95 + { 96 + return (max77802_rtc_is_precious_reg(dev, reg) || 97 + reg == MAX77802_RTC_SEC || 98 + reg == MAX77802_RTC_MIN || 99 + reg == MAX77802_RTC_HOUR || 100 + reg == MAX77802_RTC_WEEKDAY || 101 + reg == MAX77802_RTC_MONTH || 102 + reg == MAX77802_RTC_YEAR || 103 + reg == MAX77802_RTC_DATE); 104 + } 105 + 106 + static bool max77802_is_volatile_reg(struct device *dev, unsigned int reg) 107 + { 108 + return (max77802_pmic_is_volatile_reg(dev, reg) || 109 + max77802_rtc_is_volatile_reg(dev, reg)); 110 + } 111 + 46 112 static struct regmap_config max77686_regmap_config = { 47 113 .reg_bits = 8, 48 114 .val_bits = 8, 49 115 }; 50 116 51 - #ifdef CONFIG_OF 117 + static struct regmap_config max77686_rtc_regmap_config = { 118 + .reg_bits = 8, 119 + .val_bits = 8, 120 + }; 121 + 122 + static struct regmap_config max77802_regmap_config = { 123 + .reg_bits = 8, 124 + .val_bits = 8, 125 + .writeable_reg = max77802_is_accessible_reg, 126 + .readable_reg = max77802_is_accessible_reg, 127 + .precious_reg = max77802_is_precious_reg, 128 + .volatile_reg = max77802_is_volatile_reg, 129 + .name = "max77802-pmic", 130 + .cache_type = REGCACHE_RBTREE, 131 + }; 132 + 133 + static const struct regmap_irq max77686_irqs[] = { 134 + /* INT1 interrupts */ 135 + { .reg_offset = 0, .mask = MAX77686_INT1_PWRONF_MSK, }, 136 + { .reg_offset = 0, .mask = MAX77686_INT1_PWRONR_MSK, }, 137 + { .reg_offset = 0, .mask = MAX77686_INT1_JIGONBF_MSK, }, 138 + { .reg_offset = 0, .mask = MAX77686_INT1_JIGONBR_MSK, }, 139 + { .reg_offset = 0, .mask = MAX77686_INT1_ACOKBF_MSK, }, 140 + { .reg_offset = 0, .mask = MAX77686_INT1_ACOKBR_MSK, }, 141 + { .reg_offset = 0, .mask = MAX77686_INT1_ONKEY1S_MSK, }, 142 + { .reg_offset = 0, .mask = MAX77686_INT1_MRSTB_MSK, }, 143 + /* INT2 interrupts */ 144 + { .reg_offset = 1, .mask = MAX77686_INT2_140C_MSK, }, 145 + { .reg_offset = 1, .mask = MAX77686_INT2_120C_MSK, }, 146 + }; 147 + 148 + static const struct regmap_irq_chip max77686_irq_chip = { 149 + .name = "max77686-pmic", 150 + .status_base = MAX77686_REG_INT1, 151 + .mask_base = MAX77686_REG_INT1MSK, 152 + .num_regs = 2, 153 + .irqs = max77686_irqs, 154 + .num_irqs = ARRAY_SIZE(max77686_irqs), 155 + }; 156 + 157 + static const struct regmap_irq max77686_rtc_irqs[] = { 158 + /* RTC interrupts */ 159 + { .reg_offset = 0, .mask = MAX77686_RTCINT_RTC60S_MSK, }, 160 + { .reg_offset = 0, .mask = MAX77686_RTCINT_RTCA1_MSK, }, 161 + { .reg_offset = 0, .mask = MAX77686_RTCINT_RTCA2_MSK, }, 162 + { .reg_offset = 0, .mask = MAX77686_RTCINT_SMPL_MSK, }, 163 + { .reg_offset = 0, .mask = MAX77686_RTCINT_RTC1S_MSK, }, 164 + { .reg_offset = 0, .mask = MAX77686_RTCINT_WTSR_MSK, }, 165 + }; 166 + 167 + static const struct regmap_irq_chip max77686_rtc_irq_chip = { 168 + .name = "max77686-rtc", 169 + .status_base = MAX77686_RTC_INT, 170 + .mask_base = MAX77686_RTC_INTM, 171 + .num_regs = 1, 172 + .irqs = max77686_rtc_irqs, 173 + .num_irqs = ARRAY_SIZE(max77686_rtc_irqs), 174 + }; 175 + 176 + static const struct regmap_irq_chip max77802_irq_chip = { 177 + .name = "max77802-pmic", 178 + .status_base = MAX77802_REG_INT1, 179 + .mask_base = MAX77802_REG_INT1MSK, 180 + .num_regs = 2, 181 + .irqs = max77686_irqs, /* same masks as 77686 */ 182 + .num_irqs = ARRAY_SIZE(max77686_irqs), 183 + }; 184 + 185 + static const struct regmap_irq_chip max77802_rtc_irq_chip = { 186 + .name = "max77802-rtc", 187 + .status_base = MAX77802_RTC_INT, 188 + .mask_base = MAX77802_RTC_INTM, 189 + .num_regs = 1, 190 + .irqs = max77686_rtc_irqs, /* same masks as 77686 */ 191 + .num_irqs = ARRAY_SIZE(max77686_rtc_irqs), 192 + }; 193 + 52 194 static const struct of_device_id max77686_pmic_dt_match[] = { 53 - {.compatible = "maxim,max77686", .data = NULL}, 54 - {}, 195 + { 196 + .compatible = "maxim,max77686", 197 + .data = (void *)TYPE_MAX77686, 198 + }, 199 + { 200 + .compatible = "maxim,max77802", 201 + .data = (void *)TYPE_MAX77802, 202 + }, 203 + { }, 55 204 }; 56 205 57 206 static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device ··· 211 58 struct max77686_platform_data *pd; 212 59 213 60 pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); 214 - if (!pd) { 215 - dev_err(dev, "could not allocate memory for pdata\n"); 61 + if (!pd) 216 62 return NULL; 217 - } 218 63 219 64 dev->platform_data = pd; 220 65 return pd; 221 66 } 222 - #else 223 - static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device 224 - *dev) 225 - { 226 - return 0; 227 - } 228 - #endif 229 67 230 68 static int max77686_i2c_probe(struct i2c_client *i2c, 231 69 const struct i2c_device_id *id) 232 70 { 233 71 struct max77686_dev *max77686 = NULL; 234 72 struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev); 73 + const struct of_device_id *match; 235 74 unsigned int data; 236 75 int ret = 0; 76 + const struct regmap_config *config; 77 + const struct regmap_irq_chip *irq_chip; 78 + const struct regmap_irq_chip *rtc_irq_chip; 79 + struct regmap **rtc_regmap; 80 + const struct mfd_cell *cells; 81 + int n_devs; 237 82 238 - if (i2c->dev.of_node) 83 + if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node && !pdata) 239 84 pdata = max77686_i2c_parse_dt_pdata(&i2c->dev); 240 85 241 86 if (!pdata) { 242 87 dev_err(&i2c->dev, "No platform data found.\n"); 243 - return -EIO; 88 + return -EINVAL; 244 89 } 245 90 246 91 max77686 = devm_kzalloc(&i2c->dev, 247 92 sizeof(struct max77686_dev), GFP_KERNEL); 248 - if (max77686 == NULL) 93 + if (!max77686) 249 94 return -ENOMEM; 95 + 96 + if (i2c->dev.of_node) { 97 + match = of_match_node(max77686_pmic_dt_match, i2c->dev.of_node); 98 + if (!match) 99 + return -EINVAL; 100 + 101 + max77686->type = (unsigned long)match->data; 102 + } else 103 + max77686->type = id->driver_data; 250 104 251 105 i2c_set_clientdata(i2c, max77686); 252 106 max77686->dev = &i2c->dev; 253 107 max77686->i2c = i2c; 254 - max77686->type = id->driver_data; 255 108 256 109 max77686->wakeup = pdata->wakeup; 257 - max77686->irq_gpio = pdata->irq_gpio; 258 110 max77686->irq = i2c->irq; 259 111 260 - max77686->regmap = devm_regmap_init_i2c(i2c, &max77686_regmap_config); 112 + if (max77686->type == TYPE_MAX77686) { 113 + config = &max77686_regmap_config; 114 + irq_chip = &max77686_irq_chip; 115 + rtc_irq_chip = &max77686_rtc_irq_chip; 116 + rtc_regmap = &max77686->rtc_regmap; 117 + cells = max77686_devs; 118 + n_devs = ARRAY_SIZE(max77686_devs); 119 + } else { 120 + config = &max77802_regmap_config; 121 + irq_chip = &max77802_irq_chip; 122 + rtc_irq_chip = &max77802_rtc_irq_chip; 123 + rtc_regmap = &max77686->regmap; 124 + cells = max77802_devs; 125 + n_devs = ARRAY_SIZE(max77802_devs); 126 + } 127 + 128 + max77686->regmap = devm_regmap_init_i2c(i2c, config); 261 129 if (IS_ERR(max77686->regmap)) { 262 130 ret = PTR_ERR(max77686->regmap); 263 131 dev_err(max77686->dev, "Failed to allocate register map: %d\n", ··· 286 112 return ret; 287 113 } 288 114 289 - if (regmap_read(max77686->regmap, 290 - MAX77686_REG_DEVICE_ID, &data) < 0) { 115 + ret = regmap_read(max77686->regmap, MAX77686_REG_DEVICE_ID, &data); 116 + if (ret < 0) { 291 117 dev_err(max77686->dev, 292 118 "device not found on this channel (this is not an error)\n"); 293 119 return -ENODEV; 294 - } else 295 - dev_info(max77686->dev, "device found\n"); 296 - 297 - max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC); 298 - if (!max77686->rtc) { 299 - dev_err(max77686->dev, "Failed to allocate I2C device for RTC\n"); 300 - return -ENODEV; 301 120 } 302 - i2c_set_clientdata(max77686->rtc, max77686); 303 121 304 - max77686_irq_init(max77686); 122 + if (max77686->type == TYPE_MAX77686) { 123 + max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC); 124 + if (!max77686->rtc) { 125 + dev_err(max77686->dev, 126 + "Failed to allocate I2C device for RTC\n"); 127 + return -ENODEV; 128 + } 129 + i2c_set_clientdata(max77686->rtc, max77686); 305 130 306 - ret = mfd_add_devices(max77686->dev, -1, max77686_devs, 307 - ARRAY_SIZE(max77686_devs), NULL, 0, NULL); 131 + max77686->rtc_regmap = 132 + devm_regmap_init_i2c(max77686->rtc, 133 + &max77686_rtc_regmap_config); 134 + if (IS_ERR(max77686->rtc_regmap)) { 135 + ret = PTR_ERR(max77686->rtc_regmap); 136 + dev_err(max77686->dev, 137 + "failed to allocate RTC regmap: %d\n", 138 + ret); 139 + goto err_unregister_i2c; 140 + } 141 + } 142 + 143 + ret = regmap_add_irq_chip(max77686->regmap, max77686->irq, 144 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT | 145 + IRQF_SHARED, 0, irq_chip, 146 + &max77686->irq_data); 147 + if (ret) { 148 + dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret); 149 + goto err_unregister_i2c; 150 + } 151 + 152 + ret = regmap_add_irq_chip(*rtc_regmap, max77686->irq, 153 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT | 154 + IRQF_SHARED, 0, rtc_irq_chip, 155 + &max77686->rtc_irq_data); 156 + if (ret) { 157 + dev_err(&i2c->dev, "failed to add RTC irq chip: %d\n", ret); 158 + goto err_del_irqc; 159 + } 160 + 161 + ret = mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, 0, NULL); 308 162 if (ret < 0) { 309 - mfd_remove_devices(max77686->dev); 310 - i2c_unregister_device(max77686->rtc); 163 + dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret); 164 + goto err_del_rtc_irqc; 311 165 } 166 + 167 + return 0; 168 + 169 + err_del_rtc_irqc: 170 + regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); 171 + err_del_irqc: 172 + regmap_del_irq_chip(max77686->irq, max77686->irq_data); 173 + err_unregister_i2c: 174 + if (max77686->type == TYPE_MAX77686) 175 + i2c_unregister_device(max77686->rtc); 312 176 313 177 return ret; 314 178 } ··· 356 144 struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 357 145 358 146 mfd_remove_devices(max77686->dev); 359 - i2c_unregister_device(max77686->rtc); 147 + 148 + regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); 149 + regmap_del_irq_chip(max77686->irq, max77686->irq_data); 150 + 151 + if (max77686->type == TYPE_MAX77686) 152 + i2c_unregister_device(max77686->rtc); 360 153 361 154 return 0; 362 155 } ··· 372 155 }; 373 156 MODULE_DEVICE_TABLE(i2c, max77686_i2c_id); 374 157 158 + #ifdef CONFIG_PM_SLEEP 159 + static int max77686_suspend(struct device *dev) 160 + { 161 + struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 162 + struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 163 + 164 + if (device_may_wakeup(dev)) 165 + enable_irq_wake(max77686->irq); 166 + 167 + /* 168 + * IRQ must be disabled during suspend because if it happens 169 + * while suspended it will be handled before resuming I2C. 170 + * 171 + * When device is woken up from suspend (e.g. by RTC wake alarm), 172 + * an interrupt occurs before resuming I2C bus controller. 173 + * Interrupt handler tries to read registers but this read 174 + * will fail because I2C is still suspended. 175 + */ 176 + disable_irq(max77686->irq); 177 + 178 + return 0; 179 + } 180 + 181 + static int max77686_resume(struct device *dev) 182 + { 183 + struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 184 + struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 185 + 186 + if (device_may_wakeup(dev)) 187 + disable_irq_wake(max77686->irq); 188 + 189 + enable_irq(max77686->irq); 190 + 191 + return 0; 192 + } 193 + #endif /* CONFIG_PM_SLEEP */ 194 + 195 + static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume); 196 + 375 197 static struct i2c_driver max77686_i2c_driver = { 376 198 .driver = { 377 199 .name = "max77686", 378 200 .owner = THIS_MODULE, 201 + .pm = &max77686_pm, 379 202 .of_match_table = of_match_ptr(max77686_pmic_dt_match), 380 203 }, 381 204 .probe = max77686_i2c_probe, ··· 436 179 } 437 180 module_exit(max77686_i2c_exit); 438 181 439 - MODULE_DESCRIPTION("MAXIM 77686 multi-function core driver"); 182 + MODULE_DESCRIPTION("MAXIM 77686/802 multi-function core driver"); 440 183 MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>"); 441 184 MODULE_LICENSE("GPL");
+2
drivers/mfd/max8925-core.c
··· 624 624 static void max8925_irq_enable(struct irq_data *data) 625 625 { 626 626 struct max8925_chip *chip = irq_data_get_irq_chip_data(data); 627 + 627 628 max8925_irqs[data->irq - chip->irq_base].enable 628 629 = max8925_irqs[data->irq - chip->irq_base].offs; 629 630 } ··· 632 631 static void max8925_irq_disable(struct irq_data *data) 633 632 { 634 633 struct max8925_chip *chip = irq_data_get_irq_chip_data(data); 634 + 635 635 max8925_irqs[data->irq - chip->irq_base].enable = 0; 636 636 } 637 637
+2
drivers/mfd/max8925-i2c.c
··· 257 257 static int __init max8925_i2c_init(void) 258 258 { 259 259 int ret; 260 + 260 261 ret = i2c_add_driver(&max8925_driver); 261 262 if (ret != 0) 262 263 pr_err("Failed to register MAX8925 I2C driver: %d\n", ret); 264 + 263 265 return ret; 264 266 } 265 267 subsys_initcall(max8925_i2c_init);
+41 -269
drivers/mfd/mc13xxx-core.c
··· 10 10 * Free Software Foundation. 11 11 */ 12 12 13 - #include <linux/slab.h> 14 13 #include <linux/module.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/mutex.h> 17 - #include <linux/interrupt.h> 18 - #include <linux/mfd/core.h> 19 - #include <linux/mfd/mc13xxx.h> 20 14 #include <linux/of.h> 21 15 #include <linux/of_device.h> 22 - #include <linux/of_gpio.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/mfd/core.h> 23 18 24 19 #include "mc13xxx.h" 25 20 26 21 #define MC13XXX_IRQSTAT0 0 27 - #define MC13XXX_IRQSTAT0_ADCDONEI (1 << 0) 28 - #define MC13XXX_IRQSTAT0_ADCBISDONEI (1 << 1) 29 - #define MC13XXX_IRQSTAT0_TSI (1 << 2) 30 - #define MC13783_IRQSTAT0_WHIGHI (1 << 3) 31 - #define MC13783_IRQSTAT0_WLOWI (1 << 4) 32 - #define MC13XXX_IRQSTAT0_CHGDETI (1 << 6) 33 - #define MC13783_IRQSTAT0_CHGOVI (1 << 7) 34 - #define MC13XXX_IRQSTAT0_CHGREVI (1 << 8) 35 - #define MC13XXX_IRQSTAT0_CHGSHORTI (1 << 9) 36 - #define MC13XXX_IRQSTAT0_CCCVI (1 << 10) 37 - #define MC13XXX_IRQSTAT0_CHGCURRI (1 << 11) 38 - #define MC13XXX_IRQSTAT0_BPONI (1 << 12) 39 - #define MC13XXX_IRQSTAT0_LOBATLI (1 << 13) 40 - #define MC13XXX_IRQSTAT0_LOBATHI (1 << 14) 41 - #define MC13783_IRQSTAT0_UDPI (1 << 15) 42 - #define MC13783_IRQSTAT0_USBI (1 << 16) 43 - #define MC13783_IRQSTAT0_IDI (1 << 19) 44 - #define MC13783_IRQSTAT0_SE1I (1 << 21) 45 - #define MC13783_IRQSTAT0_CKDETI (1 << 22) 46 - #define MC13783_IRQSTAT0_UDMI (1 << 23) 47 - 48 22 #define MC13XXX_IRQMASK0 1 49 - #define MC13XXX_IRQMASK0_ADCDONEM MC13XXX_IRQSTAT0_ADCDONEI 50 - #define MC13XXX_IRQMASK0_ADCBISDONEM MC13XXX_IRQSTAT0_ADCBISDONEI 51 - #define MC13XXX_IRQMASK0_TSM MC13XXX_IRQSTAT0_TSI 52 - #define MC13783_IRQMASK0_WHIGHM MC13783_IRQSTAT0_WHIGHI 53 - #define MC13783_IRQMASK0_WLOWM MC13783_IRQSTAT0_WLOWI 54 - #define MC13XXX_IRQMASK0_CHGDETM MC13XXX_IRQSTAT0_CHGDETI 55 - #define MC13783_IRQMASK0_CHGOVM MC13783_IRQSTAT0_CHGOVI 56 - #define MC13XXX_IRQMASK0_CHGREVM MC13XXX_IRQSTAT0_CHGREVI 57 - #define MC13XXX_IRQMASK0_CHGSHORTM MC13XXX_IRQSTAT0_CHGSHORTI 58 - #define MC13XXX_IRQMASK0_CCCVM MC13XXX_IRQSTAT0_CCCVI 59 - #define MC13XXX_IRQMASK0_CHGCURRM MC13XXX_IRQSTAT0_CHGCURRI 60 - #define MC13XXX_IRQMASK0_BPONM MC13XXX_IRQSTAT0_BPONI 61 - #define MC13XXX_IRQMASK0_LOBATLM MC13XXX_IRQSTAT0_LOBATLI 62 - #define MC13XXX_IRQMASK0_LOBATHM MC13XXX_IRQSTAT0_LOBATHI 63 - #define MC13783_IRQMASK0_UDPM MC13783_IRQSTAT0_UDPI 64 - #define MC13783_IRQMASK0_USBM MC13783_IRQSTAT0_USBI 65 - #define MC13783_IRQMASK0_IDM MC13783_IRQSTAT0_IDI 66 - #define MC13783_IRQMASK0_SE1M MC13783_IRQSTAT0_SE1I 67 - #define MC13783_IRQMASK0_CKDETM MC13783_IRQSTAT0_CKDETI 68 - #define MC13783_IRQMASK0_UDMM MC13783_IRQSTAT0_UDMI 69 - 70 23 #define MC13XXX_IRQSTAT1 3 71 - #define MC13XXX_IRQSTAT1_1HZI (1 << 0) 72 - #define MC13XXX_IRQSTAT1_TODAI (1 << 1) 73 - #define MC13783_IRQSTAT1_ONOFD1I (1 << 3) 74 - #define MC13783_IRQSTAT1_ONOFD2I (1 << 4) 75 - #define MC13783_IRQSTAT1_ONOFD3I (1 << 5) 76 - #define MC13XXX_IRQSTAT1_SYSRSTI (1 << 6) 77 - #define MC13XXX_IRQSTAT1_RTCRSTI (1 << 7) 78 - #define MC13XXX_IRQSTAT1_PCI (1 << 8) 79 - #define MC13XXX_IRQSTAT1_WARMI (1 << 9) 80 - #define MC13XXX_IRQSTAT1_MEMHLDI (1 << 10) 81 - #define MC13783_IRQSTAT1_PWRRDYI (1 << 11) 82 - #define MC13XXX_IRQSTAT1_THWARNLI (1 << 12) 83 - #define MC13XXX_IRQSTAT1_THWARNHI (1 << 13) 84 - #define MC13XXX_IRQSTAT1_CLKI (1 << 14) 85 - #define MC13783_IRQSTAT1_SEMAFI (1 << 15) 86 - #define MC13783_IRQSTAT1_MC2BI (1 << 17) 87 - #define MC13783_IRQSTAT1_HSDETI (1 << 18) 88 - #define MC13783_IRQSTAT1_HSLI (1 << 19) 89 - #define MC13783_IRQSTAT1_ALSPTHI (1 << 20) 90 - #define MC13783_IRQSTAT1_AHSSHORTI (1 << 21) 91 - 92 24 #define MC13XXX_IRQMASK1 4 93 - #define MC13XXX_IRQMASK1_1HZM MC13XXX_IRQSTAT1_1HZI 94 - #define MC13XXX_IRQMASK1_TODAM MC13XXX_IRQSTAT1_TODAI 95 - #define MC13783_IRQMASK1_ONOFD1M MC13783_IRQSTAT1_ONOFD1I 96 - #define MC13783_IRQMASK1_ONOFD2M MC13783_IRQSTAT1_ONOFD2I 97 - #define MC13783_IRQMASK1_ONOFD3M MC13783_IRQSTAT1_ONOFD3I 98 - #define MC13XXX_IRQMASK1_SYSRSTM MC13XXX_IRQSTAT1_SYSRSTI 99 - #define MC13XXX_IRQMASK1_RTCRSTM MC13XXX_IRQSTAT1_RTCRSTI 100 - #define MC13XXX_IRQMASK1_PCM MC13XXX_IRQSTAT1_PCI 101 - #define MC13XXX_IRQMASK1_WARMM MC13XXX_IRQSTAT1_WARMI 102 - #define MC13XXX_IRQMASK1_MEMHLDM MC13XXX_IRQSTAT1_MEMHLDI 103 - #define MC13783_IRQMASK1_PWRRDYM MC13783_IRQSTAT1_PWRRDYI 104 - #define MC13XXX_IRQMASK1_THWARNLM MC13XXX_IRQSTAT1_THWARNLI 105 - #define MC13XXX_IRQMASK1_THWARNHM MC13XXX_IRQSTAT1_THWARNHI 106 - #define MC13XXX_IRQMASK1_CLKM MC13XXX_IRQSTAT1_CLKI 107 - #define MC13783_IRQMASK1_SEMAFM MC13783_IRQSTAT1_SEMAFI 108 - #define MC13783_IRQMASK1_MC2BM MC13783_IRQSTAT1_MC2BI 109 - #define MC13783_IRQMASK1_HSDETM MC13783_IRQSTAT1_HSDETI 110 - #define MC13783_IRQMASK1_HSLM MC13783_IRQSTAT1_HSLI 111 - #define MC13783_IRQMASK1_ALSPTHM MC13783_IRQSTAT1_ALSPTHI 112 - #define MC13783_IRQMASK1_AHSSHORTM MC13783_IRQSTAT1_AHSSHORTI 113 25 114 26 #define MC13XXX_REVISION 7 115 27 #define MC13XXX_REVISION_REVMETAL (0x07 << 0) ··· 101 189 102 190 int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq) 103 191 { 104 - int ret; 105 - unsigned int offmask = irq < 24 ? MC13XXX_IRQMASK0 : MC13XXX_IRQMASK1; 106 - u32 irqbit = 1 << (irq < 24 ? irq : irq - 24); 107 - u32 mask; 192 + int virq = regmap_irq_get_virq(mc13xxx->irq_data, irq); 108 193 109 - if (irq < 0 || irq >= MC13XXX_NUM_IRQ) 110 - return -EINVAL; 194 + disable_irq_nosync(virq); 111 195 112 - ret = mc13xxx_reg_read(mc13xxx, offmask, &mask); 113 - if (ret) 114 - return ret; 115 - 116 - if (mask & irqbit) 117 - /* already masked */ 118 - return 0; 119 - 120 - return mc13xxx_reg_write(mc13xxx, offmask, mask | irqbit); 196 + return 0; 121 197 } 122 198 EXPORT_SYMBOL(mc13xxx_irq_mask); 123 199 124 200 int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq) 125 201 { 126 - int ret; 127 - unsigned int offmask = irq < 24 ? MC13XXX_IRQMASK0 : MC13XXX_IRQMASK1; 128 - u32 irqbit = 1 << (irq < 24 ? irq : irq - 24); 129 - u32 mask; 202 + int virq = regmap_irq_get_virq(mc13xxx->irq_data, irq); 130 203 131 - if (irq < 0 || irq >= MC13XXX_NUM_IRQ) 132 - return -EINVAL; 204 + enable_irq(virq); 133 205 134 - ret = mc13xxx_reg_read(mc13xxx, offmask, &mask); 135 - if (ret) 136 - return ret; 137 - 138 - if (!(mask & irqbit)) 139 - /* already unmasked */ 140 - return 0; 141 - 142 - return mc13xxx_reg_write(mc13xxx, offmask, mask & ~irqbit); 206 + return 0; 143 207 } 144 208 EXPORT_SYMBOL(mc13xxx_irq_unmask); 145 209 ··· 127 239 unsigned int offstat = irq < 24 ? MC13XXX_IRQSTAT0 : MC13XXX_IRQSTAT1; 128 240 u32 irqbit = 1 << (irq < 24 ? irq : irq - 24); 129 241 130 - if (irq < 0 || irq >= MC13XXX_NUM_IRQ) 242 + if (irq < 0 || irq >= ARRAY_SIZE(mc13xxx->irqs)) 131 243 return -EINVAL; 132 244 133 245 if (enabled) { ··· 154 266 } 155 267 EXPORT_SYMBOL(mc13xxx_irq_status); 156 268 157 - int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq) 158 - { 159 - unsigned int offstat = irq < 24 ? MC13XXX_IRQSTAT0 : MC13XXX_IRQSTAT1; 160 - unsigned int val = 1 << (irq < 24 ? irq : irq - 24); 161 - 162 - BUG_ON(irq < 0 || irq >= MC13XXX_NUM_IRQ); 163 - 164 - return mc13xxx_reg_write(mc13xxx, offstat, val); 165 - } 166 - EXPORT_SYMBOL(mc13xxx_irq_ack); 167 - 168 - int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, 169 - irq_handler_t handler, const char *name, void *dev) 170 - { 171 - BUG_ON(!mutex_is_locked(&mc13xxx->lock)); 172 - BUG_ON(!handler); 173 - 174 - if (irq < 0 || irq >= MC13XXX_NUM_IRQ) 175 - return -EINVAL; 176 - 177 - if (mc13xxx->irqhandler[irq]) 178 - return -EBUSY; 179 - 180 - mc13xxx->irqhandler[irq] = handler; 181 - mc13xxx->irqdata[irq] = dev; 182 - 183 - return 0; 184 - } 185 - EXPORT_SYMBOL(mc13xxx_irq_request_nounmask); 186 - 187 269 int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, 188 270 irq_handler_t handler, const char *name, void *dev) 189 271 { 190 - int ret; 272 + int virq = regmap_irq_get_virq(mc13xxx->irq_data, irq); 191 273 192 - ret = mc13xxx_irq_request_nounmask(mc13xxx, irq, handler, name, dev); 193 - if (ret) 194 - return ret; 195 - 196 - ret = mc13xxx_irq_unmask(mc13xxx, irq); 197 - if (ret) { 198 - mc13xxx->irqhandler[irq] = NULL; 199 - mc13xxx->irqdata[irq] = NULL; 200 - return ret; 201 - } 202 - 203 - return 0; 274 + return devm_request_threaded_irq(mc13xxx->dev, virq, NULL, handler, 275 + 0, name, dev); 204 276 } 205 277 EXPORT_SYMBOL(mc13xxx_irq_request); 206 278 207 279 int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev) 208 280 { 209 - int ret; 210 - BUG_ON(!mutex_is_locked(&mc13xxx->lock)); 281 + int virq = regmap_irq_get_virq(mc13xxx->irq_data, irq); 211 282 212 - if (irq < 0 || irq >= MC13XXX_NUM_IRQ || !mc13xxx->irqhandler[irq] || 213 - mc13xxx->irqdata[irq] != dev) 214 - return -EINVAL; 215 - 216 - ret = mc13xxx_irq_mask(mc13xxx, irq); 217 - if (ret) 218 - return ret; 219 - 220 - mc13xxx->irqhandler[irq] = NULL; 221 - mc13xxx->irqdata[irq] = NULL; 283 + devm_free_irq(mc13xxx->dev, virq, dev); 222 284 223 285 return 0; 224 286 } 225 287 EXPORT_SYMBOL(mc13xxx_irq_free); 226 - 227 - static inline irqreturn_t mc13xxx_irqhandler(struct mc13xxx *mc13xxx, int irq) 228 - { 229 - return mc13xxx->irqhandler[irq](irq, mc13xxx->irqdata[irq]); 230 - } 231 - 232 - /* 233 - * returns: number of handled irqs or negative error 234 - * locking: holds mc13xxx->lock 235 - */ 236 - static int mc13xxx_irq_handle(struct mc13xxx *mc13xxx, 237 - unsigned int offstat, unsigned int offmask, int baseirq) 238 - { 239 - u32 stat, mask; 240 - int ret = mc13xxx_reg_read(mc13xxx, offstat, &stat); 241 - int num_handled = 0; 242 - 243 - if (ret) 244 - return ret; 245 - 246 - ret = mc13xxx_reg_read(mc13xxx, offmask, &mask); 247 - if (ret) 248 - return ret; 249 - 250 - while (stat & ~mask) { 251 - int irq = __ffs(stat & ~mask); 252 - 253 - stat &= ~(1 << irq); 254 - 255 - if (likely(mc13xxx->irqhandler[baseirq + irq])) { 256 - irqreturn_t handled; 257 - 258 - handled = mc13xxx_irqhandler(mc13xxx, baseirq + irq); 259 - if (handled == IRQ_HANDLED) 260 - num_handled++; 261 - } else { 262 - dev_err(mc13xxx->dev, 263 - "BUG: irq %u but no handler\n", 264 - baseirq + irq); 265 - 266 - mask |= 1 << irq; 267 - 268 - ret = mc13xxx_reg_write(mc13xxx, offmask, mask); 269 - } 270 - } 271 - 272 - return num_handled; 273 - } 274 - 275 - static irqreturn_t mc13xxx_irq_thread(int irq, void *data) 276 - { 277 - struct mc13xxx *mc13xxx = data; 278 - irqreturn_t ret; 279 - int handled = 0; 280 - 281 - mc13xxx_lock(mc13xxx); 282 - 283 - ret = mc13xxx_irq_handle(mc13xxx, MC13XXX_IRQSTAT0, 284 - MC13XXX_IRQMASK0, 0); 285 - if (ret > 0) 286 - handled = 1; 287 - 288 - ret = mc13xxx_irq_handle(mc13xxx, MC13XXX_IRQSTAT1, 289 - MC13XXX_IRQMASK1, 24); 290 - if (ret > 0) 291 - handled = 1; 292 - 293 - mc13xxx_unlock(mc13xxx); 294 - 295 - return IRQ_RETVAL(handled); 296 - } 297 288 298 289 #define maskval(reg, mask) (((reg) & (mask)) >> __ffs(mask)) 299 290 static void mc13xxx_print_revision(struct mc13xxx *mc13xxx, u32 revision) ··· 242 475 { 243 476 struct mc13xxx_adcdone_data *adcdone_data = data; 244 477 245 - mc13xxx_irq_ack(adcdone_data->mc13xxx, irq); 246 - 247 478 complete_all(&adcdone_data->done); 248 479 249 480 return IRQ_HANDLED; ··· 309 544 dev_dbg(mc13xxx->dev, "%s: request irq\n", __func__); 310 545 mc13xxx_irq_request(mc13xxx, MC13XXX_IRQ_ADCDONE, 311 546 mc13xxx_handler_adcdone, __func__, &adcdone_data); 312 - mc13xxx_irq_ack(mc13xxx, MC13XXX_IRQ_ADCDONE); 313 547 314 548 mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, adc0); 315 549 mc13xxx_reg_write(mc13xxx, MC13XXX_ADC1, adc1); ··· 363 599 if (!cell.name) 364 600 return -ENOMEM; 365 601 366 - return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0, NULL); 602 + return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0, 603 + regmap_irq_get_domain(mc13xxx->irq_data)); 367 604 } 368 605 369 606 static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format) ··· 405 640 { 406 641 struct mc13xxx_platform_data *pdata = dev_get_platdata(dev); 407 642 struct mc13xxx *mc13xxx = dev_get_drvdata(dev); 408 - int ret; 409 643 u32 revision; 644 + int i, ret; 410 645 411 646 mc13xxx->dev = dev; 412 647 ··· 416 651 417 652 mc13xxx->variant->print_revision(mc13xxx, revision); 418 653 419 - /* mask all irqs */ 420 - ret = mc13xxx_reg_write(mc13xxx, MC13XXX_IRQMASK0, 0x00ffffff); 421 - if (ret) 422 - return ret; 654 + for (i = 0; i < ARRAY_SIZE(mc13xxx->irqs); i++) { 655 + mc13xxx->irqs[i].reg_offset = i / MC13XXX_IRQ_PER_REG; 656 + mc13xxx->irqs[i].mask = BIT(i % MC13XXX_IRQ_PER_REG); 657 + } 423 658 424 - ret = mc13xxx_reg_write(mc13xxx, MC13XXX_IRQMASK1, 0x00ffffff); 659 + mc13xxx->irq_chip.name = dev_name(dev); 660 + mc13xxx->irq_chip.status_base = MC13XXX_IRQSTAT0; 661 + mc13xxx->irq_chip.mask_base = MC13XXX_IRQMASK0; 662 + mc13xxx->irq_chip.ack_base = MC13XXX_IRQSTAT0; 663 + mc13xxx->irq_chip.irq_reg_stride = MC13XXX_IRQSTAT1 - MC13XXX_IRQSTAT0; 664 + mc13xxx->irq_chip.init_ack_masked = true; 665 + mc13xxx->irq_chip.use_ack = true; 666 + mc13xxx->irq_chip.num_regs = MC13XXX_IRQ_REG_CNT; 667 + mc13xxx->irq_chip.irqs = mc13xxx->irqs; 668 + mc13xxx->irq_chip.num_irqs = ARRAY_SIZE(mc13xxx->irqs); 669 + 670 + ret = regmap_add_irq_chip(mc13xxx->regmap, mc13xxx->irq, IRQF_ONESHOT, 671 + 0, &mc13xxx->irq_chip, &mc13xxx->irq_data); 425 672 if (ret) 426 673 return ret; 427 674 428 675 mutex_init(&mc13xxx->lock); 429 676 430 - ret = request_threaded_irq(mc13xxx->irq, NULL, mc13xxx_irq_thread, 431 - IRQF_ONESHOT | IRQF_TRIGGER_HIGH, "mc13xxx", mc13xxx); 432 - if (ret) 433 - return ret; 434 - 435 677 if (mc13xxx_probe_flags_dt(mc13xxx) < 0 && pdata) 436 678 mc13xxx->flags = pdata->flags; 437 - 438 - if (mc13xxx->flags & MC13XXX_USE_ADC) 439 - mc13xxx_add_subdevice(mc13xxx, "%s-adc"); 440 - 441 - if (mc13xxx->flags & MC13XXX_USE_RTC) 442 - mc13xxx_add_subdevice(mc13xxx, "%s-rtc"); 443 679 444 680 if (pdata) { 445 681 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator", ··· 465 699 mc13xxx_add_subdevice(mc13xxx, "%s-ts"); 466 700 } 467 701 702 + if (mc13xxx->flags & MC13XXX_USE_ADC) 703 + mc13xxx_add_subdevice(mc13xxx, "%s-adc"); 704 + 705 + if (mc13xxx->flags & MC13XXX_USE_RTC) 706 + mc13xxx_add_subdevice(mc13xxx, "%s-rtc"); 707 + 468 708 return 0; 469 709 } 470 710 EXPORT_SYMBOL_GPL(mc13xxx_common_init); ··· 479 707 { 480 708 struct mc13xxx *mc13xxx = dev_get_drvdata(dev); 481 709 482 - free_irq(mc13xxx->irq, mc13xxx); 483 710 mfd_remove_devices(dev); 711 + regmap_del_irq_chip(mc13xxx->irq, mc13xxx->irq_data); 484 712 mutex_destroy(&mc13xxx->lock); 485 713 486 714 return 0;
+7 -4
drivers/mfd/mc13xxx.h
··· 13 13 #include <linux/regmap.h> 14 14 #include <linux/mfd/mc13xxx.h> 15 15 16 - #define MC13XXX_NUMREGS 0x3f 16 + #define MC13XXX_NUMREGS 0x3f 17 + #define MC13XXX_IRQ_REG_CNT 2 18 + #define MC13XXX_IRQ_PER_REG 24 17 19 18 20 struct mc13xxx; 19 21 ··· 35 33 struct device *dev; 36 34 const struct mc13xxx_variant *variant; 37 35 36 + struct regmap_irq irqs[MC13XXX_IRQ_PER_REG * MC13XXX_IRQ_REG_CNT]; 37 + struct regmap_irq_chip irq_chip; 38 + struct regmap_irq_chip_data *irq_data; 39 + 38 40 struct mutex lock; 39 41 int irq; 40 42 int flags; 41 - 42 - irq_handler_t irqhandler[MC13XXX_NUM_IRQ]; 43 - void *irqdata[MC13XXX_NUM_IRQ]; 44 43 45 44 int adcflags; 46 45 };
+1
drivers/mfd/mcp-core.c
··· 137 137 void mcp_enable(struct mcp *mcp) 138 138 { 139 139 unsigned long flags; 140 + 140 141 spin_lock_irqsave(&mcp->lock, flags); 141 142 if (mcp->use_count++ == 0) 142 143 mcp->ops->enable(mcp);
+1 -1
drivers/mfd/omap-usb-host.c
··· 445 445 446 446 for (i = 0; i < omap->nports; i++) { 447 447 if (is_ehci_phy_mode(pdata->port_mode[i])) { 448 - reg &= OMAP_UHH_HOSTCONFIG_ULPI_BYPASS; 448 + reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_BYPASS; 449 449 break; 450 450 } 451 451 }
+9 -9
drivers/mfd/pcf50633-core.c
··· 244 244 245 245 for (i = 0; i < PCF50633_NUM_REGULATORS; i++) { 246 246 struct platform_device *pdev; 247 + int j; 247 248 248 249 pdev = platform_device_alloc("pcf50633-regulator", i); 249 - if (!pdev) { 250 - dev_err(pcf->dev, "Cannot create regulator %d\n", i); 251 - continue; 252 - } 250 + if (!pdev) 251 + return -ENOMEM; 253 252 254 253 pdev->dev.parent = pcf->dev; 255 - if (platform_device_add_data(pdev, &pdata->reg_init_data[i], 256 - sizeof(pdata->reg_init_data[i])) < 0) { 254 + ret = platform_device_add_data(pdev, &pdata->reg_init_data[i], 255 + sizeof(pdata->reg_init_data[i])); 256 + if (ret) { 257 257 platform_device_put(pdev); 258 - dev_err(pcf->dev, "Out of memory for regulator parameters %d\n", 259 - i); 260 - continue; 258 + for (j = 0; j < i; j++) 259 + platform_device_put(pcf->regulator_pdev[j]); 260 + return ret; 261 261 } 262 262 pcf->regulator_pdev[i] = pdev; 263 263
-4
drivers/mfd/pm8921-core.c
··· 186 186 { 187 187 struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d); 188 188 unsigned int pmirq = irqd_to_hwirq(d); 189 - int irq_bit; 190 189 u8 block, config; 191 190 192 191 block = pmirq / 8; 193 - irq_bit = pmirq % 8; 194 192 195 193 config = chip->config[pmirq] | PM_IRQF_MASK_ALL | PM_IRQF_CLR; 196 194 pm8xxx_config_irq(chip, block, config); ··· 198 200 { 199 201 struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d); 200 202 unsigned int pmirq = irqd_to_hwirq(d); 201 - int irq_bit; 202 203 u8 block, config; 203 204 204 205 block = pmirq / 8; 205 - irq_bit = pmirq % 8; 206 206 207 207 config = chip->config[pmirq]; 208 208 pm8xxx_config_irq(chip, block, config);
+48 -28
drivers/mfd/rtsx_pcr.c
··· 337 337 int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, 338 338 int num_sg, bool read, int timeout) 339 339 { 340 - struct completion trans_done; 341 - u8 dir; 342 - int err = 0, i, count; 343 - long timeleft; 344 - unsigned long flags; 345 - struct scatterlist *sg; 346 - enum dma_data_direction dma_dir; 347 - u32 val; 348 - dma_addr_t addr; 349 - unsigned int len; 340 + int err = 0, count; 350 341 351 342 dev_dbg(&(pcr->pci->dev), "--> %s: num_sg = %d\n", __func__, num_sg); 343 + count = rtsx_pci_dma_map_sg(pcr, sglist, num_sg, read); 344 + if (count < 1) 345 + return -EINVAL; 346 + dev_dbg(&(pcr->pci->dev), "DMA mapping count: %d\n", count); 352 347 353 - /* don't transfer data during abort processing */ 348 + err = rtsx_pci_dma_transfer(pcr, sglist, count, read, timeout); 349 + 350 + rtsx_pci_dma_unmap_sg(pcr, sglist, num_sg, read); 351 + 352 + return err; 353 + } 354 + EXPORT_SYMBOL_GPL(rtsx_pci_transfer_data); 355 + 356 + int rtsx_pci_dma_map_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, 357 + int num_sg, bool read) 358 + { 359 + enum dma_data_direction dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; 360 + 354 361 if (pcr->remove_pci) 355 362 return -EINVAL; 356 363 357 364 if ((sglist == NULL) || (num_sg <= 0)) 358 365 return -EINVAL; 359 366 360 - if (read) { 361 - dir = DEVICE_TO_HOST; 362 - dma_dir = DMA_FROM_DEVICE; 363 - } else { 364 - dir = HOST_TO_DEVICE; 365 - dma_dir = DMA_TO_DEVICE; 366 - } 367 + return dma_map_sg(&(pcr->pci->dev), sglist, num_sg, dir); 368 + } 369 + EXPORT_SYMBOL_GPL(rtsx_pci_dma_map_sg); 367 370 368 - count = dma_map_sg(&(pcr->pci->dev), sglist, num_sg, dma_dir); 369 - if (count < 1) { 370 - dev_err(&(pcr->pci->dev), "scatterlist map failed\n"); 371 + void rtsx_pci_dma_unmap_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, 372 + int num_sg, bool read) 373 + { 374 + enum dma_data_direction dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; 375 + 376 + dma_unmap_sg(&(pcr->pci->dev), sglist, num_sg, dir); 377 + } 378 + EXPORT_SYMBOL_GPL(rtsx_pci_dma_unmap_sg); 379 + 380 + int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist, 381 + int count, bool read, int timeout) 382 + { 383 + struct completion trans_done; 384 + struct scatterlist *sg; 385 + dma_addr_t addr; 386 + long timeleft; 387 + unsigned long flags; 388 + unsigned int len; 389 + int i, err = 0; 390 + u32 val; 391 + u8 dir = read ? DEVICE_TO_HOST : HOST_TO_DEVICE; 392 + 393 + if (pcr->remove_pci) 394 + return -ENODEV; 395 + 396 + if ((sglist == NULL) || (count < 1)) 371 397 return -EINVAL; 372 - } 373 - dev_dbg(&(pcr->pci->dev), "DMA mapping count: %d\n", count); 374 398 375 399 val = ((u32)(dir & 0x01) << 29) | TRIG_DMA | ADMA_MODE; 376 400 pcr->sgi = 0; ··· 424 400 } 425 401 426 402 spin_lock_irqsave(&pcr->lock, flags); 427 - 428 403 if (pcr->trans_result == TRANS_RESULT_FAIL) 429 404 err = -EINVAL; 430 405 else if (pcr->trans_result == TRANS_NO_DEVICE) 431 406 err = -ENODEV; 432 - 433 407 spin_unlock_irqrestore(&pcr->lock, flags); 434 408 435 409 out: 436 410 spin_lock_irqsave(&pcr->lock, flags); 437 411 pcr->done = NULL; 438 412 spin_unlock_irqrestore(&pcr->lock, flags); 439 - 440 - dma_unmap_sg(&(pcr->pci->dev), sglist, num_sg, dma_dir); 441 413 442 414 if ((err < 0) && (err != -ENODEV)) 443 415 rtsx_pci_stop_cmd(pcr); ··· 443 423 444 424 return err; 445 425 } 446 - EXPORT_SYMBOL_GPL(rtsx_pci_transfer_data); 426 + EXPORT_SYMBOL_GPL(rtsx_pci_dma_transfer); 447 427 448 428 int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len) 449 429 {
+68 -14
drivers/mfd/sec-core.c
··· 28 28 #include <linux/mfd/samsung/s2mpa01.h> 29 29 #include <linux/mfd/samsung/s2mps11.h> 30 30 #include <linux/mfd/samsung/s2mps14.h> 31 + #include <linux/mfd/samsung/s2mpu02.h> 31 32 #include <linux/mfd/samsung/s5m8763.h> 32 33 #include <linux/mfd/samsung/s5m8767.h> 34 + #include <linux/regulator/machine.h> 33 35 #include <linux/regmap.h> 34 36 35 37 static const struct mfd_cell s5m8751_devs[] = { ··· 91 89 }, 92 90 }; 93 91 92 + static const struct mfd_cell s2mpu02_devs[] = { 93 + { .name = "s2mpu02-pmic", }, 94 + { .name = "s2mpu02-rtc", }, 95 + { 96 + .name = "s2mpu02-clk", 97 + .of_compatible = "samsung,s2mpu02-clk", 98 + } 99 + }; 100 + 94 101 #ifdef CONFIG_OF 95 102 static const struct of_device_id sec_dt_match[] = { 96 103 { .compatible = "samsung,s5m8767-pmic", ··· 113 102 }, { 114 103 .compatible = "samsung,s2mpa01-pmic", 115 104 .data = (void *)S2MPA01, 105 + }, { 106 + .compatible = "samsung,s2mpu02-pmic", 107 + .data = (void *)S2MPU02, 116 108 }, { 117 109 /* Sentinel */ 118 110 }, ··· 140 126 case S2MPS11_REG_INT1M: 141 127 case S2MPS11_REG_INT2M: 142 128 case S2MPS11_REG_INT3M: 129 + return false; 130 + default: 131 + return true; 132 + } 133 + } 134 + 135 + static bool s2mpu02_volatile(struct device *dev, unsigned int reg) 136 + { 137 + switch (reg) { 138 + case S2MPU02_REG_INT1M: 139 + case S2MPU02_REG_INT2M: 140 + case S2MPU02_REG_INT3M: 143 141 return false; 144 142 default: 145 143 return true; ··· 200 174 201 175 .max_register = S2MPS14_REG_LDODSCH3, 202 176 .volatile_reg = s2mps11_volatile, 177 + .cache_type = REGCACHE_FLAT, 178 + }; 179 + 180 + static const struct regmap_config s2mpu02_regmap_config = { 181 + .reg_bits = 8, 182 + .val_bits = 8, 183 + 184 + .max_register = S2MPU02_REG_DVSDATA, 185 + .volatile_reg = s2mpu02_volatile, 203 186 .cache_type = REGCACHE_FLAT, 204 187 }; 205 188 ··· 273 238 #ifdef CONFIG_OF 274 239 if (i2c->dev.of_node) { 275 240 const struct of_device_id *match; 241 + 276 242 match = of_match_node(sec_dt_match, i2c->dev.of_node); 277 243 return (unsigned long)match->data; 278 244 } ··· 286 250 { 287 251 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); 288 252 const struct regmap_config *regmap; 253 + const struct mfd_cell *sec_devs; 289 254 struct sec_pmic_dev *sec_pmic; 290 255 unsigned long device_type; 291 - int ret; 256 + int ret, num_sec_devs; 292 257 293 258 sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), 294 259 GFP_KERNEL); ··· 334 297 case S5M8767X: 335 298 regmap = &s5m8767_regmap_config; 336 299 break; 300 + case S2MPU02: 301 + regmap = &s2mpu02_regmap_config; 302 + break; 337 303 default: 338 304 regmap = &sec_regmap_config; 339 305 break; ··· 359 319 360 320 switch (sec_pmic->device_type) { 361 321 case S5M8751X: 362 - ret = mfd_add_devices(sec_pmic->dev, -1, s5m8751_devs, 363 - ARRAY_SIZE(s5m8751_devs), NULL, 0, NULL); 322 + sec_devs = s5m8751_devs; 323 + num_sec_devs = ARRAY_SIZE(s5m8751_devs); 364 324 break; 365 325 case S5M8763X: 366 - ret = mfd_add_devices(sec_pmic->dev, -1, s5m8763_devs, 367 - ARRAY_SIZE(s5m8763_devs), NULL, 0, NULL); 326 + sec_devs = s5m8763_devs; 327 + num_sec_devs = ARRAY_SIZE(s5m8763_devs); 368 328 break; 369 329 case S5M8767X: 370 - ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs, 371 - ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL); 330 + sec_devs = s5m8767_devs; 331 + num_sec_devs = ARRAY_SIZE(s5m8767_devs); 372 332 break; 373 333 case S2MPA01: 374 - ret = mfd_add_devices(sec_pmic->dev, -1, s2mpa01_devs, 375 - ARRAY_SIZE(s2mpa01_devs), NULL, 0, NULL); 334 + sec_devs = s2mpa01_devs; 335 + num_sec_devs = ARRAY_SIZE(s2mpa01_devs); 376 336 break; 377 337 case S2MPS11X: 378 - ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, 379 - ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); 338 + sec_devs = s2mps11_devs; 339 + num_sec_devs = ARRAY_SIZE(s2mps11_devs); 380 340 break; 381 341 case S2MPS14X: 382 - ret = mfd_add_devices(sec_pmic->dev, -1, s2mps14_devs, 383 - ARRAY_SIZE(s2mps14_devs), NULL, 0, NULL); 342 + sec_devs = s2mps14_devs; 343 + num_sec_devs = ARRAY_SIZE(s2mps14_devs); 344 + break; 345 + case S2MPU02: 346 + sec_devs = s2mpu02_devs; 347 + num_sec_devs = ARRAY_SIZE(s2mpu02_devs); 384 348 break; 385 349 default: 386 350 /* If this happens the probe function is problem */ 387 351 BUG(); 388 352 } 389 - 353 + ret = mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs, NULL, 354 + 0, NULL); 390 355 if (ret) 391 356 goto err_mfd; 392 357 ··· 431 386 * suspended) and RTC Alarm interrupt is disabled. 432 387 */ 433 388 disable_irq(sec_pmic->irq); 389 + 390 + switch (sec_pmic->device_type) { 391 + case S2MPS14X: 392 + case S2MPU02: 393 + regulator_suspend_prepare(PM_SUSPEND_MEM); 394 + break; 395 + default: 396 + break; 397 + } 434 398 435 399 return 0; 436 400 }
+94 -16
drivers/mfd/sec-irq.c
··· 20 20 #include <linux/mfd/samsung/irq.h> 21 21 #include <linux/mfd/samsung/s2mps11.h> 22 22 #include <linux/mfd/samsung/s2mps14.h> 23 + #include <linux/mfd/samsung/s2mpu02.h> 23 24 #include <linux/mfd/samsung/s5m8763.h> 24 25 #include <linux/mfd/samsung/s5m8767.h> 25 26 ··· 157 156 .mask = S2MPS11_IRQ_INT140C_MASK, 158 157 }, 159 158 [S2MPS14_IRQ_TSD] = { 159 + .reg_offset = 2, 160 + .mask = S2MPS14_IRQ_TSD_MASK, 161 + }, 162 + }; 163 + 164 + static const struct regmap_irq s2mpu02_irqs[] = { 165 + [S2MPU02_IRQ_PWRONF] = { 166 + .reg_offset = 0, 167 + .mask = S2MPS11_IRQ_PWRONF_MASK, 168 + }, 169 + [S2MPU02_IRQ_PWRONR] = { 170 + .reg_offset = 0, 171 + .mask = S2MPS11_IRQ_PWRONR_MASK, 172 + }, 173 + [S2MPU02_IRQ_JIGONBF] = { 174 + .reg_offset = 0, 175 + .mask = S2MPS11_IRQ_JIGONBF_MASK, 176 + }, 177 + [S2MPU02_IRQ_JIGONBR] = { 178 + .reg_offset = 0, 179 + .mask = S2MPS11_IRQ_JIGONBR_MASK, 180 + }, 181 + [S2MPU02_IRQ_ACOKBF] = { 182 + .reg_offset = 0, 183 + .mask = S2MPS11_IRQ_ACOKBF_MASK, 184 + }, 185 + [S2MPU02_IRQ_ACOKBR] = { 186 + .reg_offset = 0, 187 + .mask = S2MPS11_IRQ_ACOKBR_MASK, 188 + }, 189 + [S2MPU02_IRQ_PWRON1S] = { 190 + .reg_offset = 0, 191 + .mask = S2MPS11_IRQ_PWRON1S_MASK, 192 + }, 193 + [S2MPU02_IRQ_MRB] = { 194 + .reg_offset = 0, 195 + .mask = S2MPS11_IRQ_MRB_MASK, 196 + }, 197 + [S2MPU02_IRQ_RTC60S] = { 198 + .reg_offset = 1, 199 + .mask = S2MPS11_IRQ_RTC60S_MASK, 200 + }, 201 + [S2MPU02_IRQ_RTCA1] = { 202 + .reg_offset = 1, 203 + .mask = S2MPS11_IRQ_RTCA1_MASK, 204 + }, 205 + [S2MPU02_IRQ_RTCA0] = { 206 + .reg_offset = 1, 207 + .mask = S2MPS11_IRQ_RTCA0_MASK, 208 + }, 209 + [S2MPU02_IRQ_SMPL] = { 210 + .reg_offset = 1, 211 + .mask = S2MPS11_IRQ_SMPL_MASK, 212 + }, 213 + [S2MPU02_IRQ_RTC1S] = { 214 + .reg_offset = 1, 215 + .mask = S2MPS11_IRQ_RTC1S_MASK, 216 + }, 217 + [S2MPU02_IRQ_WTSR] = { 218 + .reg_offset = 1, 219 + .mask = S2MPS11_IRQ_WTSR_MASK, 220 + }, 221 + [S2MPU02_IRQ_INT120C] = { 222 + .reg_offset = 2, 223 + .mask = S2MPS11_IRQ_INT120C_MASK, 224 + }, 225 + [S2MPU02_IRQ_INT140C] = { 226 + .reg_offset = 2, 227 + .mask = S2MPS11_IRQ_INT140C_MASK, 228 + }, 229 + [S2MPU02_IRQ_TSD] = { 160 230 .reg_offset = 2, 161 231 .mask = S2MPS14_IRQ_TSD_MASK, 162 232 }, ··· 399 327 .ack_base = S2MPS14_REG_INT1, 400 328 }; 401 329 330 + static const struct regmap_irq_chip s2mpu02_irq_chip = { 331 + .name = "s2mpu02", 332 + .irqs = s2mpu02_irqs, 333 + .num_irqs = ARRAY_SIZE(s2mpu02_irqs), 334 + .num_regs = 3, 335 + .status_base = S2MPU02_REG_INT1, 336 + .mask_base = S2MPU02_REG_INT1M, 337 + .ack_base = S2MPU02_REG_INT1, 338 + }; 339 + 402 340 static const struct regmap_irq_chip s5m8767_irq_chip = { 403 341 .name = "s5m8767", 404 342 .irqs = s5m8767_irqs, ··· 433 351 { 434 352 int ret = 0; 435 353 int type = sec_pmic->device_type; 354 + const struct regmap_irq_chip *sec_irq_chip; 436 355 437 356 if (!sec_pmic->irq) { 438 357 dev_warn(sec_pmic->dev, ··· 444 361 445 362 switch (type) { 446 363 case S5M8763X: 447 - ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq, 448 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 449 - sec_pmic->irq_base, &s5m8763_irq_chip, 450 - &sec_pmic->irq_data); 364 + sec_irq_chip = &s5m8763_irq_chip; 451 365 break; 452 366 case S5M8767X: 453 - ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq, 454 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 455 - sec_pmic->irq_base, &s5m8767_irq_chip, 456 - &sec_pmic->irq_data); 367 + sec_irq_chip = &s5m8767_irq_chip; 457 368 break; 458 369 case S2MPS11X: 459 - ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq, 460 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 461 - sec_pmic->irq_base, &s2mps11_irq_chip, 462 - &sec_pmic->irq_data); 370 + sec_irq_chip = &s2mps11_irq_chip; 463 371 break; 464 372 case S2MPS14X: 465 - ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq, 466 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 467 - sec_pmic->irq_base, &s2mps14_irq_chip, 468 - &sec_pmic->irq_data); 373 + sec_irq_chip = &s2mps14_irq_chip; 374 + break; 375 + case S2MPU02: 376 + sec_irq_chip = &s2mpu02_irq_chip; 469 377 break; 470 378 default: 471 379 dev_err(sec_pmic->dev, "Unknown device type %lu\n", ··· 464 390 return -EINVAL; 465 391 } 466 392 393 + ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq, 394 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 395 + sec_pmic->irq_base, sec_irq_chip, 396 + &sec_pmic->irq_data); 467 397 if (ret != 0) { 468 398 dev_err(sec_pmic->dev, "Failed to register IRQ chip: %d\n", ret); 469 399 return ret;
+6 -6
drivers/mfd/si476x-cmd.c
··· 1228 1228 } 1229 1229 1230 1230 static int si476x_core_cmd_fm_rsq_status_a20(struct si476x_core *core, 1231 - struct si476x_rsq_status_args *rsqargs, 1232 - struct si476x_rsq_status_report *report) 1231 + struct si476x_rsq_status_args *rsqargs, 1232 + struct si476x_rsq_status_report *report) 1233 1233 { 1234 1234 int err; 1235 1235 u8 resp[CMD_FM_RSQ_STATUS_A10_NRESP]; ··· 1434 1434 struct si476x_tune_freq_args *tuneargs); 1435 1435 1436 1436 static struct { 1437 - int (*power_up) (struct si476x_core *, 1438 - struct si476x_power_up_args *); 1439 - int (*power_down) (struct si476x_core *, 1440 - struct si476x_power_down_args *); 1437 + int (*power_up)(struct si476x_core *, 1438 + struct si476x_power_up_args *); 1439 + int (*power_down)(struct si476x_core *, 1440 + struct si476x_power_down_args *); 1441 1441 1442 1442 tune_freq_func_t fm_tune_freq; 1443 1443 tune_freq_func_t am_tune_freq;
+2 -2
drivers/mfd/stmpe-i2c.c
··· 68 68 static int 69 69 stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) 70 70 { 71 - int partnum; 71 + enum stmpe_partnum partnum; 72 72 const struct of_device_id *of_id; 73 73 74 74 i2c_ci.data = (void *)id; ··· 85 85 dev_info(&i2c->dev, "matching on node name, compatible is preferred\n"); 86 86 partnum = id->driver_data; 87 87 } else 88 - partnum = (int)of_id->data; 88 + partnum = (enum stmpe_partnum)of_id->data; 89 89 90 90 return stmpe_probe(&i2c_ci, partnum); 91 91 }
+1 -1
drivers/mfd/stmpe.c
··· 1147 1147 } 1148 1148 1149 1149 /* Called from client specific probe routines */ 1150 - int stmpe_probe(struct stmpe_client_info *ci, int partnum) 1150 + int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum) 1151 1151 { 1152 1152 struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev); 1153 1153 struct device_node *np = ci->dev->of_node;
+1 -1
drivers/mfd/stmpe.h
··· 97 97 void (*init)(struct stmpe *stmpe); 98 98 }; 99 99 100 - int stmpe_probe(struct stmpe_client_info *ci, int partnum); 100 + int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum); 101 101 int stmpe_remove(struct stmpe *stmpe); 102 102 103 103 #define STMPE_ICR_LSB_HIGH (1 << 2)
+30
drivers/mfd/sun6i-prcm.c
··· 76 76 }, 77 77 }; 78 78 79 + static const struct mfd_cell sun8i_a23_prcm_subdevs[] = { 80 + { 81 + .name = "sun8i-a23-apb0-clk", 82 + .of_compatible = "allwinner,sun8i-a23-apb0-clk", 83 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res), 84 + .resources = sun6i_a31_apb0_clk_res, 85 + }, 86 + { 87 + .name = "sun6i-a31-apb0-gates-clk", 88 + .of_compatible = "allwinner,sun8i-a23-apb0-gates-clk", 89 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res), 90 + .resources = sun6i_a31_apb0_gates_clk_res, 91 + }, 92 + { 93 + .name = "sun6i-a31-apb0-clock-reset", 94 + .of_compatible = "allwinner,sun6i-a31-clock-reset", 95 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_rstc_res), 96 + .resources = sun6i_a31_apb0_rstc_res, 97 + }, 98 + }; 99 + 79 100 static const struct prcm_data sun6i_a31_prcm_data = { 80 101 .nsubdevs = ARRAY_SIZE(sun6i_a31_prcm_subdevs), 81 102 .subdevs = sun6i_a31_prcm_subdevs, 103 + }; 104 + 105 + static const struct prcm_data sun8i_a23_prcm_data = { 106 + .nsubdevs = ARRAY_SIZE(sun8i_a23_prcm_subdevs), 107 + .subdevs = sun8i_a23_prcm_subdevs, 82 108 }; 83 109 84 110 static const struct of_device_id sun6i_prcm_dt_ids[] = { 85 111 { 86 112 .compatible = "allwinner,sun6i-a31-prcm", 87 113 .data = &sun6i_a31_prcm_data, 114 + }, 115 + { 116 + .compatible = "allwinner,sun8i-a23-prcm", 117 + .data = &sun8i_a23_prcm_data, 88 118 }, 89 119 { /* sentinel */ }, 90 120 };
+1 -1
drivers/mfd/tc3589x.c
··· 236 236 static struct irq_domain_ops tc3589x_irq_ops = { 237 237 .map = tc3589x_irq_map, 238 238 .unmap = tc3589x_irq_unmap, 239 - .xlate = irq_domain_xlate_twocell, 239 + .xlate = irq_domain_xlate_onecell, 240 240 }; 241 241 242 242 static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
+3 -4
drivers/mfd/tc6387xb.c
··· 147 147 int irq, ret; 148 148 149 149 iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); 150 - if (!iomem) { 150 + if (!iomem) 151 151 return -EINVAL; 152 - } 153 152 154 - tc6387xb = kzalloc(sizeof *tc6387xb, GFP_KERNEL); 153 + tc6387xb = kzalloc(sizeof(*tc6387xb), GFP_KERNEL); 155 154 if (!tc6387xb) 156 155 return -ENOMEM; 157 156 ··· 188 189 if (pdata && pdata->enable) 189 190 pdata->enable(dev); 190 191 191 - printk(KERN_INFO "Toshiba tc6387xb initialised\n"); 192 + dev_info(&dev->dev, "Toshiba tc6387xb initialised\n"); 192 193 193 194 ret = mfd_add_devices(&dev->dev, dev->id, tc6387xb_cells, 194 195 ARRAY_SIZE(tc6387xb_cells), iomem, irq, NULL);
+4 -13
drivers/mfd/tps6105x.c
··· 141 141 int ret; 142 142 int i; 143 143 144 - tps6105x = kmalloc(sizeof(*tps6105x), GFP_KERNEL); 144 + tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL); 145 145 if (!tps6105x) 146 146 return -ENOMEM; 147 147 ··· 154 154 ret = tps6105x_startup(tps6105x); 155 155 if (ret) { 156 156 dev_err(&client->dev, "chip initialization failed\n"); 157 - goto fail; 157 + return ret; 158 158 } 159 159 160 160 /* Remove warning texts when you implement new cell drivers */ ··· 187 187 tps6105x_cells[i].pdata_size = sizeof(*tps6105x); 188 188 } 189 189 190 - ret = mfd_add_devices(&client->dev, 0, tps6105x_cells, 191 - ARRAY_SIZE(tps6105x_cells), NULL, 0, NULL); 192 - if (ret) 193 - goto fail; 194 - 195 - return 0; 196 - 197 - fail: 198 - kfree(tps6105x); 199 - return ret; 190 + return mfd_add_devices(&client->dev, 0, tps6105x_cells, 191 + ARRAY_SIZE(tps6105x_cells), NULL, 0, NULL); 200 192 } 201 193 202 194 static int tps6105x_remove(struct i2c_client *client) ··· 202 210 TPS6105X_REG0_MODE_MASK, 203 211 TPS6105X_MODE_SHUTDOWN << TPS6105X_REG0_MODE_SHIFT); 204 212 205 - kfree(tps6105x); 206 213 return 0; 207 214 } 208 215
+5 -5
drivers/mfd/tps65910.c
··· 387 387 MODULE_DEVICE_TABLE(of, tps65910_of_match); 388 388 389 389 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, 390 - int *chip_id) 390 + unsigned long *chip_id) 391 391 { 392 392 struct device_node *np = client->dev.of_node; 393 393 struct tps65910_board *board_info; ··· 401 401 return NULL; 402 402 } 403 403 404 - *chip_id = (int)match->data; 404 + *chip_id = (unsigned long)match->data; 405 405 406 406 board_info = devm_kzalloc(&client->dev, sizeof(*board_info), 407 407 GFP_KERNEL); ··· 431 431 #else 432 432 static inline 433 433 struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, 434 - int *chip_id) 434 + unsigned long *chip_id) 435 435 { 436 436 return NULL; 437 437 } ··· 453 453 } 454 454 455 455 static int tps65910_i2c_probe(struct i2c_client *i2c, 456 - const struct i2c_device_id *id) 456 + const struct i2c_device_id *id) 457 457 { 458 458 struct tps65910 *tps65910; 459 459 struct tps65910_board *pmic_plat_data; 460 460 struct tps65910_board *of_pmic_plat_data = NULL; 461 461 struct tps65910_platform_data *init_data; 462 + unsigned long chip_id = id->driver_data; 462 463 int ret = 0; 463 - int chip_id = id->driver_data; 464 464 465 465 pmic_plat_data = dev_get_platdata(&i2c->dev); 466 466
+1 -2
drivers/mfd/tps65912-spi.c
··· 32 32 unsigned long spi_data = 1 << 23 | addr << 15 | *data; 33 33 struct spi_transfer xfer; 34 34 struct spi_message msg; 35 - u32 tx_buf, rx_buf; 35 + u32 tx_buf; 36 36 37 37 tx_buf = spi_data; 38 - rx_buf = 0; 39 38 40 39 xfer.tx_buf = &tx_buf; 41 40 xfer.rx_buf = NULL;
+3 -3
drivers/mfd/twl4030-irq.c
··· 297 297 ret = twl_i2c_read_u8(TWL_MODULE_PIH, &pih_isr, 298 298 REG_PIH_ISR_P1); 299 299 if (ret) { 300 - pr_warning("twl4030: I2C error %d reading PIH ISR\n", ret); 300 + pr_warn("twl4030: I2C error %d reading PIH ISR\n", ret); 301 301 return IRQ_NONE; 302 302 } 303 303 ··· 338 338 irq_line = line; 339 339 340 340 /* disable all interrupts on our line */ 341 - memset(buf, 0xff, sizeof buf); 341 + memset(buf, 0xff, sizeof(buf)); 342 342 sih = sih_modules; 343 343 for (i = 0; i < nr_sih_modules; i++, sih++) { 344 344 /* skip USB -- it's funky */ ··· 646 646 if (status < 0) 647 647 return status; 648 648 649 - agent = kzalloc(sizeof *agent, GFP_KERNEL); 649 + agent = kzalloc(sizeof(*agent), GFP_KERNEL); 650 650 if (!agent) 651 651 return -ENOMEM; 652 652
+3 -1
drivers/mfd/twl6030-irq.c
··· 70 70 BATDETECT_INTR_OFFSET, /* Bit 9 BAT */ 71 71 SIMDETECT_INTR_OFFSET, /* Bit 10 SIM */ 72 72 MMCDETECT_INTR_OFFSET, /* Bit 11 MMC */ 73 - RSV_INTR_OFFSET, /* Bit 12 Reserved */ 73 + RSV_INTR_OFFSET, /* Bit 12 Reserved */ 74 74 MADC_INTR_OFFSET, /* Bit 13 GPADC_RT_EOC */ 75 75 MADC_INTR_OFFSET, /* Bit 14 GPADC_SW_EOC */ 76 76 GASGAUGE_INTR_OFFSET, /* Bit 15 CC_AUTOCAL */ ··· 245 245 { 246 246 int ret; 247 247 u8 unmask_value; 248 + 248 249 ret = twl_i2c_read_u8(TWL_MODULE_PIH, &unmask_value, 249 250 REG_INT_STS_A + offset); 250 251 unmask_value &= (~(bit_mask)); ··· 259 258 { 260 259 int ret; 261 260 u8 mask_value; 261 + 262 262 ret = twl_i2c_read_u8(TWL_MODULE_PIH, &mask_value, 263 263 REG_INT_STS_A + offset); 264 264 mask_value |= (bit_mask);
+1 -1
drivers/mfd/twl6040.c
··· 700 700 } 701 701 702 702 ret = regmap_add_irq_chip(twl6040->regmap, twl6040->irq, IRQF_ONESHOT, 703 - 0, &twl6040_irq_chip,&twl6040->irq_data); 703 + 0, &twl6040_irq_chip, &twl6040->irq_data); 704 704 if (ret < 0) 705 705 goto gpio_err; 706 706
+4 -4
drivers/mfd/wm5102-tables.c
··· 138 138 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ1_EINT1 139 139 }, 140 140 141 - [ARIZONA_IRQ_SPK_SHUTDOWN_WARN] = { 142 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_WARN_EINT1 141 + [ARIZONA_IRQ_SPK_OVERHEAT_WARN] = { 142 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_WARN_EINT1 143 143 }, 144 - [ARIZONA_IRQ_SPK_SHUTDOWN] = { 145 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_EINT1 144 + [ARIZONA_IRQ_SPK_OVERHEAT] = { 145 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_EINT1 146 146 }, 147 147 [ARIZONA_IRQ_HPDET] = { 148 148 .reg_offset = 2, .mask = ARIZONA_HPDET_EINT1
+235 -10
drivers/mfd/wm5110-tables.c
··· 340 340 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ1_EINT1 341 341 }, 342 342 343 - [ARIZONA_IRQ_SPK_SHUTDOWN_WARN] = { 344 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_WARN_EINT1 343 + [ARIZONA_IRQ_SPK_OVERHEAT_WARN] = { 344 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_WARN_EINT1 345 345 }, 346 - [ARIZONA_IRQ_SPK_SHUTDOWN] = { 347 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_EINT1 346 + [ARIZONA_IRQ_SPK_OVERHEAT] = { 347 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_EINT1 348 348 }, 349 349 [ARIZONA_IRQ_HPDET] = { 350 350 .reg_offset = 2, .mask = ARIZONA_HPDET_EINT1 ··· 416 416 [ARIZONA_IRQ_ISRC2_CFG_ERR] = { 417 417 .reg_offset = 3, .mask = ARIZONA_ISRC2_CFG_ERR_EINT1 418 418 }, 419 + [ARIZONA_IRQ_HP3R_DONE] = { 420 + .reg_offset = 3, .mask = ARIZONA_HP3R_DONE_EINT1 421 + }, 422 + [ARIZONA_IRQ_HP3L_DONE] = { 423 + .reg_offset = 3, .mask = ARIZONA_HP3L_DONE_EINT1 424 + }, 425 + [ARIZONA_IRQ_HP2R_DONE] = { 426 + .reg_offset = 3, .mask = ARIZONA_HP2R_DONE_EINT1 427 + }, 428 + [ARIZONA_IRQ_HP2L_DONE] = { 429 + .reg_offset = 3, .mask = ARIZONA_HP2L_DONE_EINT1 430 + }, 431 + [ARIZONA_IRQ_HP1R_DONE] = { 432 + .reg_offset = 3, .mask = ARIZONA_HP1R_DONE_EINT1 433 + }, 434 + [ARIZONA_IRQ_HP1L_DONE] = { 435 + .reg_offset = 3, .mask = ARIZONA_HP1L_DONE_EINT1 436 + }, 419 437 420 438 [ARIZONA_IRQ_BOOT_DONE] = { 421 439 .reg_offset = 4, .mask = ARIZONA_BOOT_DONE_EINT1 422 - }, 423 - [ARIZONA_IRQ_DCS_DAC_DONE] = { 424 - .reg_offset = 4, .mask = ARIZONA_DCS_DAC_DONE_EINT1 425 - }, 426 - [ARIZONA_IRQ_DCS_HP_DONE] = { 427 - .reg_offset = 4, .mask = ARIZONA_DCS_HP_DONE_EINT1 428 440 }, 429 441 [ARIZONA_IRQ_FLL2_CLOCK_OK] = { 430 442 .reg_offset = 4, .mask = ARIZONA_FLL2_CLOCK_OK_EINT1 ··· 456 444 .num_irqs = ARRAY_SIZE(wm5110_irqs), 457 445 }; 458 446 EXPORT_SYMBOL_GPL(wm5110_irq); 447 + 448 + static const struct regmap_irq wm5110_revd_irqs[ARIZONA_NUM_IRQ] = { 449 + [ARIZONA_IRQ_GP4] = { .reg_offset = 0, .mask = ARIZONA_GP4_EINT1 }, 450 + [ARIZONA_IRQ_GP3] = { .reg_offset = 0, .mask = ARIZONA_GP3_EINT1 }, 451 + [ARIZONA_IRQ_GP2] = { .reg_offset = 0, .mask = ARIZONA_GP2_EINT1 }, 452 + [ARIZONA_IRQ_GP1] = { .reg_offset = 0, .mask = ARIZONA_GP1_EINT1 }, 453 + 454 + [ARIZONA_IRQ_DSP4_RAM_RDY] = { 455 + .reg_offset = 1, .mask = ARIZONA_DSP4_RAM_RDY_EINT1 456 + }, 457 + [ARIZONA_IRQ_DSP3_RAM_RDY] = { 458 + .reg_offset = 1, .mask = ARIZONA_DSP3_RAM_RDY_EINT1 459 + }, 460 + [ARIZONA_IRQ_DSP2_RAM_RDY] = { 461 + .reg_offset = 1, .mask = ARIZONA_DSP2_RAM_RDY_EINT1 462 + }, 463 + [ARIZONA_IRQ_DSP1_RAM_RDY] = { 464 + .reg_offset = 1, .mask = ARIZONA_DSP1_RAM_RDY_EINT1 465 + }, 466 + [ARIZONA_IRQ_DSP_IRQ8] = { 467 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ8_EINT1 468 + }, 469 + [ARIZONA_IRQ_DSP_IRQ7] = { 470 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ7_EINT1 471 + }, 472 + [ARIZONA_IRQ_DSP_IRQ6] = { 473 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ6_EINT1 474 + }, 475 + [ARIZONA_IRQ_DSP_IRQ5] = { 476 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ5_EINT1 477 + }, 478 + [ARIZONA_IRQ_DSP_IRQ4] = { 479 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ4_EINT1 480 + }, 481 + [ARIZONA_IRQ_DSP_IRQ3] = { 482 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ3_EINT1 483 + }, 484 + [ARIZONA_IRQ_DSP_IRQ2] = { 485 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ2_EINT1 486 + }, 487 + [ARIZONA_IRQ_DSP_IRQ1] = { 488 + .reg_offset = 1, .mask = ARIZONA_DSP_IRQ1_EINT1 489 + }, 490 + 491 + [ARIZONA_IRQ_SPK_OVERHEAT_WARN] = { 492 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_WARN_EINT1 493 + }, 494 + [ARIZONA_IRQ_SPK_OVERHEAT] = { 495 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_EINT1 496 + }, 497 + [ARIZONA_IRQ_HPDET] = { 498 + .reg_offset = 2, .mask = ARIZONA_HPDET_EINT1 499 + }, 500 + [ARIZONA_IRQ_MICDET] = { 501 + .reg_offset = 2, .mask = ARIZONA_MICDET_EINT1 502 + }, 503 + [ARIZONA_IRQ_WSEQ_DONE] = { 504 + .reg_offset = 2, .mask = ARIZONA_WSEQ_DONE_EINT1 505 + }, 506 + [ARIZONA_IRQ_DRC2_SIG_DET] = { 507 + .reg_offset = 2, .mask = ARIZONA_DRC2_SIG_DET_EINT1 508 + }, 509 + [ARIZONA_IRQ_DRC1_SIG_DET] = { 510 + .reg_offset = 2, .mask = ARIZONA_DRC1_SIG_DET_EINT1 511 + }, 512 + [ARIZONA_IRQ_ASRC2_LOCK] = { 513 + .reg_offset = 2, .mask = ARIZONA_ASRC2_LOCK_EINT1 514 + }, 515 + [ARIZONA_IRQ_ASRC1_LOCK] = { 516 + .reg_offset = 2, .mask = ARIZONA_ASRC1_LOCK_EINT1 517 + }, 518 + [ARIZONA_IRQ_UNDERCLOCKED] = { 519 + .reg_offset = 2, .mask = ARIZONA_UNDERCLOCKED_EINT1 520 + }, 521 + [ARIZONA_IRQ_OVERCLOCKED] = { 522 + .reg_offset = 2, .mask = ARIZONA_OVERCLOCKED_EINT1 523 + }, 524 + [ARIZONA_IRQ_FLL2_LOCK] = { 525 + .reg_offset = 2, .mask = ARIZONA_FLL2_LOCK_EINT1 526 + }, 527 + [ARIZONA_IRQ_FLL1_LOCK] = { 528 + .reg_offset = 2, .mask = ARIZONA_FLL1_LOCK_EINT1 529 + }, 530 + [ARIZONA_IRQ_CLKGEN_ERR] = { 531 + .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_EINT1 532 + }, 533 + [ARIZONA_IRQ_CLKGEN_ERR_ASYNC] = { 534 + .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_ASYNC_EINT1 535 + }, 536 + 537 + [ARIZONA_IRQ_CTRLIF_ERR] = { 538 + .reg_offset = 3, .mask = ARIZONA_V2_CTRLIF_ERR_EINT1 539 + }, 540 + [ARIZONA_IRQ_MIXER_DROPPED_SAMPLES] = { 541 + .reg_offset = 3, .mask = ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1 542 + }, 543 + [ARIZONA_IRQ_ASYNC_CLK_ENA_LOW] = { 544 + .reg_offset = 3, .mask = ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1 545 + }, 546 + [ARIZONA_IRQ_SYSCLK_ENA_LOW] = { 547 + .reg_offset = 3, .mask = ARIZONA_V2_SYSCLK_ENA_LOW_EINT1 548 + }, 549 + [ARIZONA_IRQ_ISRC1_CFG_ERR] = { 550 + .reg_offset = 3, .mask = ARIZONA_V2_ISRC1_CFG_ERR_EINT1 551 + }, 552 + [ARIZONA_IRQ_ISRC2_CFG_ERR] = { 553 + .reg_offset = 3, .mask = ARIZONA_V2_ISRC2_CFG_ERR_EINT1 554 + }, 555 + [ARIZONA_IRQ_ISRC3_CFG_ERR] = { 556 + .reg_offset = 3, .mask = ARIZONA_V2_ISRC3_CFG_ERR_EINT1 557 + }, 558 + [ARIZONA_IRQ_HP3R_DONE] = { 559 + .reg_offset = 3, .mask = ARIZONA_HP3R_DONE_EINT1 560 + }, 561 + [ARIZONA_IRQ_HP3L_DONE] = { 562 + .reg_offset = 3, .mask = ARIZONA_HP3L_DONE_EINT1 563 + }, 564 + [ARIZONA_IRQ_HP2R_DONE] = { 565 + .reg_offset = 3, .mask = ARIZONA_HP2R_DONE_EINT1 566 + }, 567 + [ARIZONA_IRQ_HP2L_DONE] = { 568 + .reg_offset = 3, .mask = ARIZONA_HP2L_DONE_EINT1 569 + }, 570 + [ARIZONA_IRQ_HP1R_DONE] = { 571 + .reg_offset = 3, .mask = ARIZONA_HP1R_DONE_EINT1 572 + }, 573 + [ARIZONA_IRQ_HP1L_DONE] = { 574 + .reg_offset = 3, .mask = ARIZONA_HP1L_DONE_EINT1 575 + }, 576 + 577 + [ARIZONA_IRQ_BOOT_DONE] = { 578 + .reg_offset = 4, .mask = ARIZONA_BOOT_DONE_EINT1 579 + }, 580 + [ARIZONA_IRQ_ASRC_CFG_ERR] = { 581 + .reg_offset = 4, .mask = ARIZONA_V2_ASRC_CFG_ERR_EINT1 582 + }, 583 + [ARIZONA_IRQ_FLL2_CLOCK_OK] = { 584 + .reg_offset = 4, .mask = ARIZONA_FLL2_CLOCK_OK_EINT1 585 + }, 586 + [ARIZONA_IRQ_FLL1_CLOCK_OK] = { 587 + .reg_offset = 4, .mask = ARIZONA_FLL1_CLOCK_OK_EINT1 588 + }, 589 + 590 + [ARIZONA_IRQ_DSP_SHARED_WR_COLL] = { 591 + .reg_offset = 5, .mask = ARIZONA_DSP_SHARED_WR_COLL_EINT1 592 + }, 593 + [ARIZONA_IRQ_SPK_SHUTDOWN] = { 594 + .reg_offset = 5, .mask = ARIZONA_SPK_SHUTDOWN_EINT1 595 + }, 596 + [ARIZONA_IRQ_SPK1R_SHORT] = { 597 + .reg_offset = 5, .mask = ARIZONA_SPK1R_SHORT_EINT1 598 + }, 599 + [ARIZONA_IRQ_SPK1L_SHORT] = { 600 + .reg_offset = 5, .mask = ARIZONA_SPK1L_SHORT_EINT1 601 + }, 602 + [ARIZONA_IRQ_HP3R_SC_NEG] = { 603 + .reg_offset = 5, .mask = ARIZONA_HP3R_SC_NEG_EINT1 604 + }, 605 + [ARIZONA_IRQ_HP3R_SC_POS] = { 606 + .reg_offset = 5, .mask = ARIZONA_HP3R_SC_POS_EINT1 607 + }, 608 + [ARIZONA_IRQ_HP3L_SC_NEG] = { 609 + .reg_offset = 5, .mask = ARIZONA_HP3L_SC_NEG_EINT1 610 + }, 611 + [ARIZONA_IRQ_HP3L_SC_POS] = { 612 + .reg_offset = 5, .mask = ARIZONA_HP3L_SC_POS_EINT1 613 + }, 614 + [ARIZONA_IRQ_HP2R_SC_NEG] = { 615 + .reg_offset = 5, .mask = ARIZONA_HP2R_SC_NEG_EINT1 616 + }, 617 + [ARIZONA_IRQ_HP2R_SC_POS] = { 618 + .reg_offset = 5, .mask = ARIZONA_HP2R_SC_POS_EINT1 619 + }, 620 + [ARIZONA_IRQ_HP2L_SC_NEG] = { 621 + .reg_offset = 5, .mask = ARIZONA_HP2L_SC_NEG_EINT1 622 + }, 623 + [ARIZONA_IRQ_HP2L_SC_POS] = { 624 + .reg_offset = 5, .mask = ARIZONA_HP2L_SC_POS_EINT1 625 + }, 626 + [ARIZONA_IRQ_HP1R_SC_NEG] = { 627 + .reg_offset = 5, .mask = ARIZONA_HP1R_SC_NEG_EINT1 628 + }, 629 + [ARIZONA_IRQ_HP1R_SC_POS] = { 630 + .reg_offset = 5, .mask = ARIZONA_HP1R_SC_POS_EINT1 631 + }, 632 + [ARIZONA_IRQ_HP1L_SC_NEG] = { 633 + .reg_offset = 5, .mask = ARIZONA_HP1L_SC_NEG_EINT1 634 + }, 635 + [ARIZONA_IRQ_HP1L_SC_POS] = { 636 + .reg_offset = 5, .mask = ARIZONA_HP1L_SC_POS_EINT1 637 + }, 638 + }; 639 + 640 + const struct regmap_irq_chip wm5110_revd_irq = { 641 + .name = "wm5110 IRQ", 642 + .status_base = ARIZONA_INTERRUPT_STATUS_1, 643 + .mask_base = ARIZONA_INTERRUPT_STATUS_1_MASK, 644 + .ack_base = ARIZONA_INTERRUPT_STATUS_1, 645 + .num_regs = 6, 646 + .irqs = wm5110_revd_irqs, 647 + .num_irqs = ARRAY_SIZE(wm5110_revd_irqs), 648 + }; 649 + EXPORT_SYMBOL_GPL(wm5110_revd_irq); 459 650 460 651 static const struct reg_default wm5110_reg_default[] = { 461 652 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ ··· 1489 1274 { 0x00000D0A, 0xFFFF }, /* R3338 - Interrupt Status 3 Mask */ 1490 1275 { 0x00000D0B, 0xFFFF }, /* R3339 - Interrupt Status 4 Mask */ 1491 1276 { 0x00000D0C, 0xFEFF }, /* R3340 - Interrupt Status 5 Mask */ 1277 + { 0x00000D0D, 0xFFFF }, /* R3341 - Interrupt Status 6 Mask */ 1492 1278 { 0x00000D0F, 0x0000 }, /* R3343 - Interrupt Control */ 1493 1279 { 0x00000D18, 0xFFFF }, /* R3352 - IRQ2 Status 1 Mask */ 1494 1280 { 0x00000D19, 0xFFFF }, /* R3353 - IRQ2 Status 2 Mask */ 1495 1281 { 0x00000D1A, 0xFFFF }, /* R3354 - IRQ2 Status 3 Mask */ 1496 1282 { 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */ 1497 1283 { 0x00000D1C, 0xFFFF }, /* R3356 - IRQ2 Status 5 Mask */ 1284 + { 0x00000D1D, 0xFFFF }, /* R3357 - IRQ2 Status 6 Mask */ 1498 1285 { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */ 1499 1286 { 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */ 1500 1287 { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ ··· 2528 2311 case ARIZONA_INTERRUPT_STATUS_3: 2529 2312 case ARIZONA_INTERRUPT_STATUS_4: 2530 2313 case ARIZONA_INTERRUPT_STATUS_5: 2314 + case ARIZONA_INTERRUPT_STATUS_6: 2531 2315 case ARIZONA_INTERRUPT_STATUS_1_MASK: 2532 2316 case ARIZONA_INTERRUPT_STATUS_2_MASK: 2533 2317 case ARIZONA_INTERRUPT_STATUS_3_MASK: 2534 2318 case ARIZONA_INTERRUPT_STATUS_4_MASK: 2535 2319 case ARIZONA_INTERRUPT_STATUS_5_MASK: 2320 + case ARIZONA_INTERRUPT_STATUS_6_MASK: 2536 2321 case ARIZONA_INTERRUPT_CONTROL: 2537 2322 case ARIZONA_IRQ2_STATUS_1: 2538 2323 case ARIZONA_IRQ2_STATUS_2: 2539 2324 case ARIZONA_IRQ2_STATUS_3: 2540 2325 case ARIZONA_IRQ2_STATUS_4: 2541 2326 case ARIZONA_IRQ2_STATUS_5: 2327 + case ARIZONA_IRQ2_STATUS_6: 2542 2328 case ARIZONA_IRQ2_STATUS_1_MASK: 2543 2329 case ARIZONA_IRQ2_STATUS_2_MASK: 2544 2330 case ARIZONA_IRQ2_STATUS_3_MASK: 2545 2331 case ARIZONA_IRQ2_STATUS_4_MASK: 2546 2332 case ARIZONA_IRQ2_STATUS_5_MASK: 2333 + case ARIZONA_IRQ2_STATUS_6_MASK: 2547 2334 case ARIZONA_IRQ2_CONTROL: 2548 2335 case ARIZONA_INTERRUPT_RAW_STATUS_2: 2549 2336 case ARIZONA_INTERRUPT_RAW_STATUS_3: ··· 2556 2335 case ARIZONA_INTERRUPT_RAW_STATUS_6: 2557 2336 case ARIZONA_INTERRUPT_RAW_STATUS_7: 2558 2337 case ARIZONA_INTERRUPT_RAW_STATUS_8: 2338 + case ARIZONA_INTERRUPT_RAW_STATUS_9: 2559 2339 case ARIZONA_IRQ_PIN_STATUS: 2560 2340 case ARIZONA_AOD_WKUP_AND_TRIG: 2561 2341 case ARIZONA_AOD_IRQ1: ··· 2832 2610 case ARIZONA_INTERRUPT_STATUS_3: 2833 2611 case ARIZONA_INTERRUPT_STATUS_4: 2834 2612 case ARIZONA_INTERRUPT_STATUS_5: 2613 + case ARIZONA_INTERRUPT_STATUS_6: 2835 2614 case ARIZONA_IRQ2_STATUS_1: 2836 2615 case ARIZONA_IRQ2_STATUS_2: 2837 2616 case ARIZONA_IRQ2_STATUS_3: 2838 2617 case ARIZONA_IRQ2_STATUS_4: 2839 2618 case ARIZONA_IRQ2_STATUS_5: 2619 + case ARIZONA_IRQ2_STATUS_6: 2840 2620 case ARIZONA_INTERRUPT_RAW_STATUS_2: 2841 2621 case ARIZONA_INTERRUPT_RAW_STATUS_3: 2842 2622 case ARIZONA_INTERRUPT_RAW_STATUS_4: ··· 2846 2622 case ARIZONA_INTERRUPT_RAW_STATUS_6: 2847 2623 case ARIZONA_INTERRUPT_RAW_STATUS_7: 2848 2624 case ARIZONA_INTERRUPT_RAW_STATUS_8: 2625 + case ARIZONA_INTERRUPT_RAW_STATUS_9: 2849 2626 case ARIZONA_IRQ_PIN_STATUS: 2850 2627 case ARIZONA_AOD_WKUP_AND_TRIG: 2851 2628 case ARIZONA_AOD_IRQ1:
+4 -4
drivers/mfd/wm8350-i2c.c
··· 58 58 } 59 59 60 60 static const struct i2c_device_id wm8350_i2c_id[] = { 61 - { "wm8350", 0 }, 62 - { "wm8351", 0 }, 63 - { "wm8352", 0 }, 64 - { } 61 + { "wm8350", 0 }, 62 + { "wm8351", 0 }, 63 + { "wm8352", 0 }, 64 + { } 65 65 }; 66 66 MODULE_DEVICE_TABLE(i2c, wm8350_i2c_id); 67 67
+2 -1
drivers/mfd/wm8350-irq.c
··· 497 497 if (pdata && pdata->irq_base > 0) 498 498 irq_base = pdata->irq_base; 499 499 500 - wm8350->irq_base = irq_alloc_descs(irq_base, 0, ARRAY_SIZE(wm8350_irqs), 0); 500 + wm8350->irq_base = 501 + irq_alloc_descs(irq_base, 0, ARRAY_SIZE(wm8350_irqs), 0); 501 502 if (wm8350->irq_base < 0) { 502 503 dev_warn(wm8350->dev, "Allocating irqs failed with %d\n", 503 504 wm8350->irq_base);
+64
drivers/mfd/wm8994-regmap.c
··· 123 123 { 0x0402, 0x00C0 }, /* R1026 - AIF1 DAC1 Left Volume */ 124 124 { 0x0403, 0x00C0 }, /* R1027 - AIF1 DAC1 Right Volume */ 125 125 { 0x0410, 0x0000 }, /* R1040 - AIF1 ADC1 Filters */ 126 + { 0x0411, 0x0000 }, /* R1041 - AIF1 ADC2 Filters */ 126 127 { 0x0420, 0x0200 }, /* R1056 - AIF1 DAC1 Filters (1) */ 127 128 { 0x0421, 0x0010 }, /* R1057 - AIF1 DAC1 Filters (2) */ 129 + { 0x0422, 0x0200 }, /* R1058 - AIF1 DAC2 Filters (1) */ 130 + { 0x0423, 0x0010 }, /* R1059 - AIF1 DAC2 Filters (2) */ 128 131 { 0x0430, 0x0068 }, /* R1072 - AIF1 DAC1 Noise Gate */ 132 + { 0x0431, 0x0068 }, /* R1073 - AIF1 DAC2 Noise Gate */ 129 133 { 0x0440, 0x0098 }, /* R1088 - AIF1 DRC1 (1) */ 130 134 { 0x0441, 0x0845 }, /* R1089 - AIF1 DRC1 (2) */ 131 135 { 0x0442, 0x0000 }, /* R1090 - AIF1 DRC1 (3) */ 132 136 { 0x0443, 0x0000 }, /* R1091 - AIF1 DRC1 (4) */ 133 137 { 0x0444, 0x0000 }, /* R1092 - AIF1 DRC1 (5) */ 138 + { 0x0450, 0x0098 }, /* R1104 - AIF1 DRC2 (1) */ 139 + { 0x0451, 0x0845 }, /* R1105 - AIF1 DRC2 (2) */ 140 + { 0x0452, 0x0000 }, /* R1106 - AIF1 DRC2 (3) */ 141 + { 0x0453, 0x0000 }, /* R1107 - AIF1 DRC2 (4) */ 142 + { 0x0454, 0x0000 }, /* R1108 - AIF1 DRC2 (5) */ 134 143 { 0x0480, 0x6318 }, /* R1152 - AIF1 DAC1 EQ Gains (1) */ 135 144 { 0x0481, 0x6300 }, /* R1153 - AIF1 DAC1 EQ Gains (2) */ 136 145 { 0x0482, 0x0FCA }, /* R1154 - AIF1 DAC1 EQ Band 1 A */ ··· 161 152 { 0x0492, 0x0559 }, /* R1170 - AIF1 DAC1 EQ Band 5 B */ 162 153 { 0x0493, 0x4000 }, /* R1171 - AIF1 DAC1 EQ Band 5 PG */ 163 154 { 0x0494, 0x0000 }, /* R1172 - AIF1 DAC1 EQ Band 1 C */ 155 + { 0x04A0, 0x6318 }, /* R1184 - AIF1 DAC2 EQ Gains (1) */ 156 + { 0x04A1, 0x6300 }, /* R1185 - AIF1 DAC2 EQ Gains (2) */ 157 + { 0x04A2, 0x0FCA }, /* R1186 - AIF1 DAC2 EQ Band 1 A */ 158 + { 0x04A3, 0x0400 }, /* R1187 - AIF1 DAC2 EQ Band 1 B */ 159 + { 0x04A4, 0x00D8 }, /* R1188 - AIF1 DAC2 EQ Band 1 PG */ 160 + { 0x04A5, 0x1EB5 }, /* R1189 - AIF1 DAC2 EQ Band 2 A */ 161 + { 0x04A6, 0xF145 }, /* R1190 - AIF1 DAC2 EQ Band 2 B */ 162 + { 0x04A7, 0x0B75 }, /* R1191 - AIF1 DAC2 EQ Band 2 C */ 163 + { 0x04A8, 0x01C5 }, /* R1192 - AIF1 DAC2 EQ Band 2 PG */ 164 + { 0x04A9, 0x1C58 }, /* R1193 - AIF1 DAC2 EQ Band 3 A */ 165 + { 0x04AA, 0xF373 }, /* R1194 - AIF1 DAC2 EQ Band 3 B */ 166 + { 0x04AB, 0x0A54 }, /* R1195 - AIF1 DAC2 EQ Band 3 C */ 167 + { 0x04AC, 0x0558 }, /* R1196 - AIF1 DAC2 EQ Band 3 PG */ 168 + { 0x04AD, 0x168E }, /* R1197 - AIF1 DAC2 EQ Band 4 A */ 169 + { 0x04AE, 0xF829 }, /* R1198 - AIF1 DAC2 EQ Band 4 B */ 170 + { 0x04AF, 0x07AD }, /* R1199 - AIF1 DAC2 EQ Band 4 C */ 171 + { 0x04B0, 0x1103 }, /* R1200 - AIF1 DAC2 EQ Band 4 PG */ 172 + { 0x04B1, 0x0564 }, /* R1201 - AIF1 DAC2 EQ Band 5 A */ 173 + { 0x04B2, 0x0559 }, /* R1202 - AIF1 DAC2 EQ Band 5 B */ 174 + { 0x04B3, 0x4000 }, /* R1203 - AIF1 DAC2 EQ Band 5 PG */ 175 + { 0x04B4, 0x0000 }, /* R1204 - AIF1 DAC2 EQ Band 1 C */ 164 176 { 0x0500, 0x00C0 }, /* R1280 - AIF2 ADC Left Volume */ 165 177 { 0x0501, 0x00C0 }, /* R1281 - AIF2 ADC Right Volume */ 166 178 { 0x0502, 0x00C0 }, /* R1282 - AIF2 DAC Left Volume */ ··· 224 194 { 0x0605, 0x0000 }, /* R1541 - AIF2ADC Right Mixer Routing */ 225 195 { 0x0606, 0x0000 }, /* R1542 - AIF1 ADC1 Left Mixer Routing */ 226 196 { 0x0607, 0x0000 }, /* R1543 - AIF1 ADC1 Right Mixer Routing */ 197 + { 0x0608, 0x0000 }, /* R1544 - AIF1 ADC2 Left Mixer Routing */ 198 + { 0x0609, 0x0000 }, /* R1545 - AIF1 ADC2 Right Mixer Routing */ 227 199 { 0x0610, 0x02C0 }, /* R1552 - DAC1 Left Volume */ 228 200 { 0x0611, 0x02C0 }, /* R1553 - DAC1 Right Volume */ 229 201 { 0x0612, 0x02C0 }, /* R1554 - AIF2TX Left Volume */ ··· 878 846 case WM8994_AIF1_DAC1_LEFT_VOLUME: 879 847 case WM8994_AIF1_DAC1_RIGHT_VOLUME: 880 848 case WM8994_AIF1_ADC1_FILTERS: 849 + case WM8994_AIF1_ADC2_FILTERS: 881 850 case WM8994_AIF1_DAC1_FILTERS_1: 882 851 case WM8994_AIF1_DAC1_FILTERS_2: 852 + case WM8994_AIF1_DAC2_FILTERS_1: 853 + case WM8994_AIF1_DAC2_FILTERS_2: 883 854 case WM8958_AIF1_DAC1_NOISE_GATE: 855 + case WM8958_AIF1_DAC2_NOISE_GATE: 884 856 case WM8994_AIF1_DRC1_1: 885 857 case WM8994_AIF1_DRC1_2: 886 858 case WM8994_AIF1_DRC1_3: 887 859 case WM8994_AIF1_DRC1_4: 888 860 case WM8994_AIF1_DRC1_5: 861 + case WM8994_AIF1_DRC2_1: 862 + case WM8994_AIF1_DRC2_2: 863 + case WM8994_AIF1_DRC2_3: 864 + case WM8994_AIF1_DRC2_4: 865 + case WM8994_AIF1_DRC2_5: 889 866 case WM8994_AIF1_DAC1_EQ_GAINS_1: 890 867 case WM8994_AIF1_DAC1_EQ_GAINS_2: 891 868 case WM8994_AIF1_DAC1_EQ_BAND_1_A: ··· 916 875 case WM8994_AIF1_DAC1_EQ_BAND_5_B: 917 876 case WM8994_AIF1_DAC1_EQ_BAND_5_PG: 918 877 case WM8994_AIF1_DAC1_EQ_BAND_1_C: 878 + case WM8994_AIF1_DAC2_EQ_GAINS_1: 879 + case WM8994_AIF1_DAC2_EQ_GAINS_2: 880 + case WM8994_AIF1_DAC2_EQ_BAND_1_A: 881 + case WM8994_AIF1_DAC2_EQ_BAND_1_B: 882 + case WM8994_AIF1_DAC2_EQ_BAND_1_PG: 883 + case WM8994_AIF1_DAC2_EQ_BAND_2_A: 884 + case WM8994_AIF1_DAC2_EQ_BAND_2_B: 885 + case WM8994_AIF1_DAC2_EQ_BAND_2_C: 886 + case WM8994_AIF1_DAC2_EQ_BAND_2_PG: 887 + case WM8994_AIF1_DAC2_EQ_BAND_3_A: 888 + case WM8994_AIF1_DAC2_EQ_BAND_3_B: 889 + case WM8994_AIF1_DAC2_EQ_BAND_3_C: 890 + case WM8994_AIF1_DAC2_EQ_BAND_3_PG: 891 + case WM8994_AIF1_DAC2_EQ_BAND_4_A: 892 + case WM8994_AIF1_DAC2_EQ_BAND_4_B: 893 + case WM8994_AIF1_DAC2_EQ_BAND_4_C: 894 + case WM8994_AIF1_DAC2_EQ_BAND_4_PG: 895 + case WM8994_AIF1_DAC2_EQ_BAND_5_A: 896 + case WM8994_AIF1_DAC2_EQ_BAND_5_B: 897 + case WM8994_AIF1_DAC2_EQ_BAND_5_PG: 898 + case WM8994_AIF1_DAC2_EQ_BAND_1_C: 919 899 case WM8994_AIF2_ADC_LEFT_VOLUME: 920 900 case WM8994_AIF2_ADC_RIGHT_VOLUME: 921 901 case WM8994_AIF2_DAC_LEFT_VOLUME: ··· 979 917 case WM8994_DAC2_RIGHT_MIXER_ROUTING: 980 918 case WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING: 981 919 case WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING: 920 + case WM8994_AIF1_ADC2_LEFT_MIXER_ROUTING: 921 + case WM8994_AIF1_ADC2_RIGHT_MIXER_ROUTING: 982 922 case WM8994_DAC1_LEFT_VOLUME: 983 923 case WM8994_DAC1_RIGHT_VOLUME: 984 924 case WM8994_DAC2_LEFT_VOLUME:
+8 -8
drivers/mfd/wm8997-tables.c
··· 65 65 [ARIZONA_IRQ_GP2] = { .reg_offset = 0, .mask = ARIZONA_GP2_EINT1 }, 66 66 [ARIZONA_IRQ_GP1] = { .reg_offset = 0, .mask = ARIZONA_GP1_EINT1 }, 67 67 68 - [ARIZONA_IRQ_SPK_SHUTDOWN_WARN] = { 69 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_WARN_EINT1 68 + [ARIZONA_IRQ_SPK_OVERHEAT_WARN] = { 69 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_WARN_EINT1 70 70 }, 71 - [ARIZONA_IRQ_SPK_SHUTDOWN] = { 72 - .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_EINT1 71 + [ARIZONA_IRQ_SPK_OVERHEAT] = { 72 + .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_EINT1 73 73 }, 74 74 [ARIZONA_IRQ_HPDET] = { 75 75 .reg_offset = 2, .mask = ARIZONA_HPDET_EINT1 ··· 174 174 { 0x00000062, 0x01FF }, /* R98 - Sample Rate Sequence Select 2 */ 175 175 { 0x00000063, 0x01FF }, /* R99 - Sample Rate Sequence Select 3 */ 176 176 { 0x00000064, 0x01FF }, /* R100 - Sample Rate Sequence Select 4 */ 177 - { 0x00000068, 0x01FF }, /* R104 - Always On Triggers Sequence Select 3 */ 178 - { 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 4 */ 179 - { 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 5 */ 180 - { 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 6 */ 177 + { 0x00000068, 0x01FF }, /* R104 - AlwaysOn Triggers Seq Select 3 */ 178 + { 0x00000069, 0x01FF }, /* R105 - AlwaysOn Triggers Seq Select 4 */ 179 + { 0x0000006A, 0x01FF }, /* R106 - AlwaysOn Triggers Seq Select 5 */ 180 + { 0x0000006B, 0x01FF }, /* R107 - AlwaysOn Triggers Seq Select 6 */ 181 181 { 0x00000070, 0x0000 }, /* R112 - Comfort Noise Generator */ 182 182 { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */ 183 183 { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */
+127 -6
drivers/mmc/host/rtsx_pci_sdmmc.c
··· 24 24 #include <linux/highmem.h> 25 25 #include <linux/delay.h> 26 26 #include <linux/platform_device.h> 27 + #include <linux/workqueue.h> 27 28 #include <linux/mmc/host.h> 28 29 #include <linux/mmc/mmc.h> 29 30 #include <linux/mmc/sd.h> ··· 37 36 struct rtsx_pcr *pcr; 38 37 struct mmc_host *mmc; 39 38 struct mmc_request *mrq; 39 + struct workqueue_struct *workq; 40 + #define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" 40 41 42 + struct work_struct work; 41 43 struct mutex host_mutex; 42 44 43 45 u8 ssc_depth; ··· 52 48 int power_state; 53 49 #define SDMMC_POWER_ON 1 54 50 #define SDMMC_POWER_OFF 0 51 + 52 + unsigned int sg_count; 53 + s32 cookie; 54 + unsigned int cookie_sg_count; 55 + bool using_cookie; 55 56 }; 56 57 57 58 static inline struct device *sdmmc_dev(struct realtek_pci_sdmmc *host) ··· 94 85 #else 95 86 #define sd_print_debug_regs(host) 96 87 #endif /* DEBUG */ 88 + 89 + /* 90 + * sd_pre_dma_transfer - do dma_map_sg() or using cookie 91 + * 92 + * @pre: if called in pre_req() 93 + * return: 94 + * 0 - do dma_map_sg() 95 + * 1 - using cookie 96 + */ 97 + static int sd_pre_dma_transfer(struct realtek_pci_sdmmc *host, 98 + struct mmc_data *data, bool pre) 99 + { 100 + struct rtsx_pcr *pcr = host->pcr; 101 + int read = data->flags & MMC_DATA_READ; 102 + int count = 0; 103 + int using_cookie = 0; 104 + 105 + if (!pre && data->host_cookie && data->host_cookie != host->cookie) { 106 + dev_err(sdmmc_dev(host), 107 + "error: data->host_cookie = %d, host->cookie = %d\n", 108 + data->host_cookie, host->cookie); 109 + data->host_cookie = 0; 110 + } 111 + 112 + if (pre || data->host_cookie != host->cookie) { 113 + count = rtsx_pci_dma_map_sg(pcr, data->sg, data->sg_len, read); 114 + } else { 115 + count = host->cookie_sg_count; 116 + using_cookie = 1; 117 + } 118 + 119 + if (pre) { 120 + host->cookie_sg_count = count; 121 + if (++host->cookie < 0) 122 + host->cookie = 1; 123 + data->host_cookie = host->cookie; 124 + } else { 125 + host->sg_count = count; 126 + } 127 + 128 + return using_cookie; 129 + } 130 + 131 + static void sdmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, 132 + bool is_first_req) 133 + { 134 + struct realtek_pci_sdmmc *host = mmc_priv(mmc); 135 + struct mmc_data *data = mrq->data; 136 + 137 + if (data->host_cookie) { 138 + dev_err(sdmmc_dev(host), 139 + "error: reset data->host_cookie = %d\n", 140 + data->host_cookie); 141 + data->host_cookie = 0; 142 + } 143 + 144 + sd_pre_dma_transfer(host, data, true); 145 + dev_dbg(sdmmc_dev(host), "pre dma sg: %d\n", host->cookie_sg_count); 146 + } 147 + 148 + static void sdmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, 149 + int err) 150 + { 151 + struct realtek_pci_sdmmc *host = mmc_priv(mmc); 152 + struct rtsx_pcr *pcr = host->pcr; 153 + struct mmc_data *data = mrq->data; 154 + int read = data->flags & MMC_DATA_READ; 155 + 156 + rtsx_pci_dma_unmap_sg(pcr, data->sg, data->sg_len, read); 157 + data->host_cookie = 0; 158 + } 97 159 98 160 static int sd_read_data(struct realtek_pci_sdmmc *host, u8 *cmd, u16 byte_cnt, 99 161 u8 *buf, int buf_len, int timeout) ··· 495 415 496 416 rtsx_pci_send_cmd_no_wait(pcr); 497 417 498 - err = rtsx_pci_transfer_data(pcr, data->sg, data->sg_len, read, 10000); 418 + err = rtsx_pci_dma_transfer(pcr, data->sg, host->sg_count, read, 10000); 499 419 if (err < 0) { 500 420 sd_clear_error(host); 501 421 return err; ··· 720 640 return 0; 721 641 } 722 642 723 - static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq) 643 + static inline int sd_rw_cmd(struct mmc_command *cmd) 724 644 { 725 - struct realtek_pci_sdmmc *host = mmc_priv(mmc); 645 + return mmc_op_multi(cmd->opcode) || 646 + (cmd->opcode == MMC_READ_SINGLE_BLOCK) || 647 + (cmd->opcode == MMC_WRITE_BLOCK); 648 + } 649 + 650 + static void sd_request(struct work_struct *work) 651 + { 652 + struct realtek_pci_sdmmc *host = container_of(work, 653 + struct realtek_pci_sdmmc, work); 726 654 struct rtsx_pcr *pcr = host->pcr; 655 + 656 + struct mmc_host *mmc = host->mmc; 657 + struct mmc_request *mrq = host->mrq; 727 658 struct mmc_command *cmd = mrq->cmd; 728 659 struct mmc_data *data = mrq->data; 660 + 729 661 unsigned int data_size = 0; 730 662 int err; 731 663 ··· 769 677 if (mrq->data) 770 678 data_size = data->blocks * data->blksz; 771 679 772 - if (!data_size || mmc_op_multi(cmd->opcode) || 773 - (cmd->opcode == MMC_READ_SINGLE_BLOCK) || 774 - (cmd->opcode == MMC_WRITE_BLOCK)) { 680 + if (!data_size || sd_rw_cmd(cmd)) { 775 681 sd_send_cmd_get_rsp(host, cmd); 776 682 777 683 if (!cmd->error && data_size) { 778 684 sd_rw_multi(host, mrq); 685 + if (!host->using_cookie) 686 + sdmmc_post_req(host->mmc, host->mrq, 0); 779 687 780 688 if (mmc_op_multi(cmd->opcode) && mrq->stop) 781 689 sd_send_cmd_get_rsp(host, mrq->stop); ··· 802 710 mutex_unlock(&host->host_mutex); 803 711 804 712 mmc_request_done(mmc, mrq); 713 + } 714 + 715 + static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq) 716 + { 717 + struct realtek_pci_sdmmc *host = mmc_priv(mmc); 718 + struct mmc_data *data = mrq->data; 719 + 720 + mutex_lock(&host->host_mutex); 721 + host->mrq = mrq; 722 + mutex_unlock(&host->host_mutex); 723 + 724 + if (sd_rw_cmd(mrq->cmd)) 725 + host->using_cookie = sd_pre_dma_transfer(host, data, false); 726 + 727 + queue_work(host->workq, &host->work); 805 728 } 806 729 807 730 static int sd_set_bus_width(struct realtek_pci_sdmmc *host, ··· 1253 1146 } 1254 1147 1255 1148 static const struct mmc_host_ops realtek_pci_sdmmc_ops = { 1149 + .pre_req = sdmmc_pre_req, 1150 + .post_req = sdmmc_post_req, 1256 1151 .request = sdmmc_request, 1257 1152 .set_ios = sdmmc_set_ios, 1258 1153 .get_ro = sdmmc_get_ro, ··· 1333 1224 return -ENOMEM; 1334 1225 1335 1226 host = mmc_priv(mmc); 1227 + host->workq = create_singlethread_workqueue(SDMMC_WORKQ_NAME); 1228 + if (!host->workq) { 1229 + mmc_free_host(mmc); 1230 + return -ENOMEM; 1231 + } 1336 1232 host->pcr = pcr; 1337 1233 host->mmc = mmc; 1338 1234 host->pdev = pdev; 1339 1235 host->power_state = SDMMC_POWER_OFF; 1236 + INIT_WORK(&host->work, sd_request); 1340 1237 platform_set_drvdata(pdev, host); 1341 1238 pcr->slots[RTSX_SD_CARD].p_dev = pdev; 1342 1239 pcr->slots[RTSX_SD_CARD].card_event = rtsx_pci_sdmmc_card_event; ··· 1370 1255 pcr->slots[RTSX_SD_CARD].card_event = NULL; 1371 1256 mmc = host->mmc; 1372 1257 1258 + cancel_work_sync(&host->work); 1259 + 1373 1260 mutex_lock(&host->host_mutex); 1374 1261 if (host->mrq) { 1375 1262 dev_dbg(&(pdev->dev), ··· 1389 1272 1390 1273 mmc_remove_host(mmc); 1391 1274 host->eject = true; 1275 + 1276 + flush_workqueue(host->workq); 1277 + destroy_workqueue(host->workq); 1278 + host->workq = NULL; 1392 1279 1393 1280 mmc_free_host(mmc); 1394 1281
+300 -21
drivers/regulator/s2mps11.c
··· 31 31 #include <linux/mfd/samsung/core.h> 32 32 #include <linux/mfd/samsung/s2mps11.h> 33 33 #include <linux/mfd/samsung/s2mps14.h> 34 + #include <linux/mfd/samsung/s2mpu02.h> 34 35 35 36 struct s2mps11_info { 36 37 unsigned int rdev_num; ··· 41 40 int ramp_delay16; 42 41 int ramp_delay7810; 43 42 int ramp_delay9; 43 + 44 + enum sec_device_type dev_type; 45 + 44 46 /* 45 - * One bit for each S2MPS14 regulator whether the suspend mode 47 + * One bit for each S2MPS14/S2MPU02 regulator whether the suspend mode 46 48 * was enabled. 47 49 */ 48 - unsigned int s2mps14_suspend_state:30; 50 + unsigned long long s2mps14_suspend_state:35; 51 + 49 52 /* Array of size rdev_num with GPIO-s for external sleep control */ 50 53 int *ext_control_gpio; 51 54 }; ··· 420 415 struct s2mps11_info *s2mps11 = rdev_get_drvdata(rdev); 421 416 unsigned int val; 422 417 423 - if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev))) 424 - val = S2MPS14_ENABLE_SUSPEND; 425 - else if (gpio_is_valid(s2mps11->ext_control_gpio[rdev_get_id(rdev)])) 426 - val = S2MPS14_ENABLE_EXT_CONTROL; 427 - else 428 - val = rdev->desc->enable_mask; 418 + switch (s2mps11->dev_type) { 419 + case S2MPS14X: 420 + if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev))) 421 + val = S2MPS14_ENABLE_SUSPEND; 422 + else if (gpio_is_valid(s2mps11->ext_control_gpio[rdev_get_id(rdev)])) 423 + val = S2MPS14_ENABLE_EXT_CONTROL; 424 + else 425 + val = rdev->desc->enable_mask; 426 + break; 427 + case S2MPU02: 428 + if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev))) 429 + val = S2MPU02_ENABLE_SUSPEND; 430 + else 431 + val = rdev->desc->enable_mask; 432 + break; 433 + default: 434 + return -EINVAL; 435 + }; 429 436 430 437 return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, 431 438 rdev->desc->enable_mask, val); ··· 446 429 static int s2mps14_regulator_set_suspend_disable(struct regulator_dev *rdev) 447 430 { 448 431 int ret; 449 - unsigned int val; 432 + unsigned int val, state; 450 433 struct s2mps11_info *s2mps11 = rdev_get_drvdata(rdev); 434 + int rdev_id = rdev_get_id(rdev); 451 435 452 - /* LDO3 should be always on and does not support suspend mode */ 453 - if (rdev_get_id(rdev) == S2MPS14_LDO3) 454 - return 0; 436 + /* Below LDO should be always on or does not support suspend mode. */ 437 + switch (s2mps11->dev_type) { 438 + case S2MPS14X: 439 + switch (rdev_id) { 440 + case S2MPS14_LDO3: 441 + return 0; 442 + default: 443 + state = S2MPS14_ENABLE_SUSPEND; 444 + break; 445 + }; 446 + break; 447 + case S2MPU02: 448 + switch (rdev_id) { 449 + case S2MPU02_LDO13: 450 + case S2MPU02_LDO14: 451 + case S2MPU02_LDO15: 452 + case S2MPU02_LDO17: 453 + case S2MPU02_BUCK7: 454 + state = S2MPU02_DISABLE_SUSPEND; 455 + break; 456 + default: 457 + state = S2MPU02_ENABLE_SUSPEND; 458 + break; 459 + }; 460 + break; 461 + default: 462 + return -EINVAL; 463 + }; 455 464 456 465 ret = regmap_read(rdev->regmap, rdev->desc->enable_reg, &val); 457 466 if (ret < 0) ··· 495 452 return 0; 496 453 497 454 return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, 498 - rdev->desc->enable_mask, S2MPS14_ENABLE_SUSPEND); 455 + rdev->desc->enable_mask, state); 499 456 } 500 457 501 458 static struct regulator_ops s2mps14_reg_ops = { ··· 648 605 } 649 606 650 607 static int s2mps11_pmic_dt_parse(struct platform_device *pdev, 651 - struct of_regulator_match *rdata, struct s2mps11_info *s2mps11, 652 - enum sec_device_type dev_type) 608 + struct of_regulator_match *rdata, struct s2mps11_info *s2mps11) 653 609 { 654 610 struct device_node *reg_np; 655 611 ··· 659 617 } 660 618 661 619 of_regulator_match(&pdev->dev, reg_np, rdata, s2mps11->rdev_num); 662 - if (dev_type == S2MPS14X) 620 + if (s2mps11->dev_type == S2MPS14X) 663 621 s2mps14_pmic_dt_parse_ext_control_gpio(pdev, rdata, s2mps11); 664 622 665 623 of_node_put(reg_np); 666 624 667 625 return 0; 668 626 } 627 + 628 + static int s2mpu02_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) 629 + { 630 + unsigned int ramp_val, ramp_shift, ramp_reg; 631 + 632 + switch (rdev_get_id(rdev)) { 633 + case S2MPU02_BUCK1: 634 + ramp_shift = S2MPU02_BUCK1_RAMP_SHIFT; 635 + break; 636 + case S2MPU02_BUCK2: 637 + ramp_shift = S2MPU02_BUCK2_RAMP_SHIFT; 638 + break; 639 + case S2MPU02_BUCK3: 640 + ramp_shift = S2MPU02_BUCK3_RAMP_SHIFT; 641 + break; 642 + case S2MPU02_BUCK4: 643 + ramp_shift = S2MPU02_BUCK4_RAMP_SHIFT; 644 + break; 645 + default: 646 + return 0; 647 + } 648 + ramp_reg = S2MPU02_REG_RAMP1; 649 + ramp_val = get_ramp_delay(ramp_delay); 650 + 651 + return regmap_update_bits(rdev->regmap, ramp_reg, 652 + S2MPU02_BUCK1234_RAMP_MASK << ramp_shift, 653 + ramp_val << ramp_shift); 654 + } 655 + 656 + static struct regulator_ops s2mpu02_ldo_ops = { 657 + .list_voltage = regulator_list_voltage_linear, 658 + .map_voltage = regulator_map_voltage_linear, 659 + .is_enabled = regulator_is_enabled_regmap, 660 + .enable = s2mps14_regulator_enable, 661 + .disable = regulator_disable_regmap, 662 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 663 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 664 + .set_voltage_time_sel = regulator_set_voltage_time_sel, 665 + .set_suspend_disable = s2mps14_regulator_set_suspend_disable, 666 + }; 667 + 668 + static struct regulator_ops s2mpu02_buck_ops = { 669 + .list_voltage = regulator_list_voltage_linear, 670 + .map_voltage = regulator_map_voltage_linear, 671 + .is_enabled = regulator_is_enabled_regmap, 672 + .enable = s2mps14_regulator_enable, 673 + .disable = regulator_disable_regmap, 674 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 675 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 676 + .set_voltage_time_sel = regulator_set_voltage_time_sel, 677 + .set_suspend_disable = s2mps14_regulator_set_suspend_disable, 678 + .set_ramp_delay = s2mpu02_set_ramp_delay, 679 + }; 680 + 681 + #define regulator_desc_s2mpu02_ldo1(num) { \ 682 + .name = "LDO"#num, \ 683 + .id = S2MPU02_LDO##num, \ 684 + .ops = &s2mpu02_ldo_ops, \ 685 + .type = REGULATOR_VOLTAGE, \ 686 + .owner = THIS_MODULE, \ 687 + .min_uV = S2MPU02_LDO_MIN_900MV, \ 688 + .uV_step = S2MPU02_LDO_STEP_12_5MV, \ 689 + .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \ 690 + .n_voltages = S2MPU02_LDO_N_VOLTAGES, \ 691 + .vsel_reg = S2MPU02_REG_L1CTRL, \ 692 + .vsel_mask = S2MPU02_LDO_VSEL_MASK, \ 693 + .enable_reg = S2MPU02_REG_L1CTRL, \ 694 + .enable_mask = S2MPU02_ENABLE_MASK \ 695 + } 696 + #define regulator_desc_s2mpu02_ldo2(num) { \ 697 + .name = "LDO"#num, \ 698 + .id = S2MPU02_LDO##num, \ 699 + .ops = &s2mpu02_ldo_ops, \ 700 + .type = REGULATOR_VOLTAGE, \ 701 + .owner = THIS_MODULE, \ 702 + .min_uV = S2MPU02_LDO_MIN_1050MV, \ 703 + .uV_step = S2MPU02_LDO_STEP_25MV, \ 704 + .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \ 705 + .n_voltages = S2MPU02_LDO_N_VOLTAGES, \ 706 + .vsel_reg = S2MPU02_REG_L2CTRL1, \ 707 + .vsel_mask = S2MPU02_LDO_VSEL_MASK, \ 708 + .enable_reg = S2MPU02_REG_L2CTRL1, \ 709 + .enable_mask = S2MPU02_ENABLE_MASK \ 710 + } 711 + #define regulator_desc_s2mpu02_ldo3(num) { \ 712 + .name = "LDO"#num, \ 713 + .id = S2MPU02_LDO##num, \ 714 + .ops = &s2mpu02_ldo_ops, \ 715 + .type = REGULATOR_VOLTAGE, \ 716 + .owner = THIS_MODULE, \ 717 + .min_uV = S2MPU02_LDO_MIN_900MV, \ 718 + .uV_step = S2MPU02_LDO_STEP_12_5MV, \ 719 + .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \ 720 + .n_voltages = S2MPU02_LDO_N_VOLTAGES, \ 721 + .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \ 722 + .vsel_mask = S2MPU02_LDO_VSEL_MASK, \ 723 + .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \ 724 + .enable_mask = S2MPU02_ENABLE_MASK \ 725 + } 726 + #define regulator_desc_s2mpu02_ldo4(num) { \ 727 + .name = "LDO"#num, \ 728 + .id = S2MPU02_LDO##num, \ 729 + .ops = &s2mpu02_ldo_ops, \ 730 + .type = REGULATOR_VOLTAGE, \ 731 + .owner = THIS_MODULE, \ 732 + .min_uV = S2MPU02_LDO_MIN_1050MV, \ 733 + .uV_step = S2MPU02_LDO_STEP_25MV, \ 734 + .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \ 735 + .n_voltages = S2MPU02_LDO_N_VOLTAGES, \ 736 + .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \ 737 + .vsel_mask = S2MPU02_LDO_VSEL_MASK, \ 738 + .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \ 739 + .enable_mask = S2MPU02_ENABLE_MASK \ 740 + } 741 + #define regulator_desc_s2mpu02_ldo5(num) { \ 742 + .name = "LDO"#num, \ 743 + .id = S2MPU02_LDO##num, \ 744 + .ops = &s2mpu02_ldo_ops, \ 745 + .type = REGULATOR_VOLTAGE, \ 746 + .owner = THIS_MODULE, \ 747 + .min_uV = S2MPU02_LDO_MIN_1600MV, \ 748 + .uV_step = S2MPU02_LDO_STEP_50MV, \ 749 + .linear_min_sel = S2MPU02_LDO_GROUP3_START_SEL, \ 750 + .n_voltages = S2MPU02_LDO_N_VOLTAGES, \ 751 + .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \ 752 + .vsel_mask = S2MPU02_LDO_VSEL_MASK, \ 753 + .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \ 754 + .enable_mask = S2MPU02_ENABLE_MASK \ 755 + } 756 + 757 + #define regulator_desc_s2mpu02_buck1234(num) { \ 758 + .name = "BUCK"#num, \ 759 + .id = S2MPU02_BUCK##num, \ 760 + .ops = &s2mpu02_buck_ops, \ 761 + .type = REGULATOR_VOLTAGE, \ 762 + .owner = THIS_MODULE, \ 763 + .min_uV = S2MPU02_BUCK1234_MIN_600MV, \ 764 + .uV_step = S2MPU02_BUCK1234_STEP_6_25MV, \ 765 + .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \ 766 + .linear_min_sel = S2MPU02_BUCK1234_START_SEL, \ 767 + .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \ 768 + .vsel_reg = S2MPU02_REG_B1CTRL2 + (num - 1) * 2, \ 769 + .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \ 770 + .enable_reg = S2MPU02_REG_B1CTRL1 + (num - 1) * 2, \ 771 + .enable_mask = S2MPU02_ENABLE_MASK \ 772 + } 773 + #define regulator_desc_s2mpu02_buck5(num) { \ 774 + .name = "BUCK"#num, \ 775 + .id = S2MPU02_BUCK##num, \ 776 + .ops = &s2mpu02_ldo_ops, \ 777 + .type = REGULATOR_VOLTAGE, \ 778 + .owner = THIS_MODULE, \ 779 + .min_uV = S2MPU02_BUCK5_MIN_1081_25MV, \ 780 + .uV_step = S2MPU02_BUCK5_STEP_6_25MV, \ 781 + .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \ 782 + .linear_min_sel = S2MPU02_BUCK5_START_SEL, \ 783 + .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \ 784 + .vsel_reg = S2MPU02_REG_B5CTRL2, \ 785 + .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \ 786 + .enable_reg = S2MPU02_REG_B5CTRL1, \ 787 + .enable_mask = S2MPU02_ENABLE_MASK \ 788 + } 789 + #define regulator_desc_s2mpu02_buck6(num) { \ 790 + .name = "BUCK"#num, \ 791 + .id = S2MPU02_BUCK##num, \ 792 + .ops = &s2mpu02_ldo_ops, \ 793 + .type = REGULATOR_VOLTAGE, \ 794 + .owner = THIS_MODULE, \ 795 + .min_uV = S2MPU02_BUCK6_MIN_1700MV, \ 796 + .uV_step = S2MPU02_BUCK6_STEP_2_50MV, \ 797 + .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \ 798 + .linear_min_sel = S2MPU02_BUCK6_START_SEL, \ 799 + .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \ 800 + .vsel_reg = S2MPU02_REG_B6CTRL2, \ 801 + .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \ 802 + .enable_reg = S2MPU02_REG_B6CTRL1, \ 803 + .enable_mask = S2MPU02_ENABLE_MASK \ 804 + } 805 + #define regulator_desc_s2mpu02_buck7(num) { \ 806 + .name = "BUCK"#num, \ 807 + .id = S2MPU02_BUCK##num, \ 808 + .ops = &s2mpu02_ldo_ops, \ 809 + .type = REGULATOR_VOLTAGE, \ 810 + .owner = THIS_MODULE, \ 811 + .min_uV = S2MPU02_BUCK7_MIN_900MV, \ 812 + .uV_step = S2MPU02_BUCK7_STEP_6_25MV, \ 813 + .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \ 814 + .linear_min_sel = S2MPU02_BUCK7_START_SEL, \ 815 + .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \ 816 + .vsel_reg = S2MPU02_REG_B7CTRL2, \ 817 + .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \ 818 + .enable_reg = S2MPU02_REG_B7CTRL1, \ 819 + .enable_mask = S2MPU02_ENABLE_MASK \ 820 + } 821 + 822 + static const struct regulator_desc s2mpu02_regulators[] = { 823 + regulator_desc_s2mpu02_ldo1(1), 824 + regulator_desc_s2mpu02_ldo2(2), 825 + regulator_desc_s2mpu02_ldo4(3), 826 + regulator_desc_s2mpu02_ldo5(4), 827 + regulator_desc_s2mpu02_ldo4(5), 828 + regulator_desc_s2mpu02_ldo3(6), 829 + regulator_desc_s2mpu02_ldo3(7), 830 + regulator_desc_s2mpu02_ldo4(8), 831 + regulator_desc_s2mpu02_ldo5(9), 832 + regulator_desc_s2mpu02_ldo3(10), 833 + regulator_desc_s2mpu02_ldo4(11), 834 + regulator_desc_s2mpu02_ldo5(12), 835 + regulator_desc_s2mpu02_ldo5(13), 836 + regulator_desc_s2mpu02_ldo5(14), 837 + regulator_desc_s2mpu02_ldo5(15), 838 + regulator_desc_s2mpu02_ldo5(16), 839 + regulator_desc_s2mpu02_ldo4(17), 840 + regulator_desc_s2mpu02_ldo5(18), 841 + regulator_desc_s2mpu02_ldo3(19), 842 + regulator_desc_s2mpu02_ldo4(20), 843 + regulator_desc_s2mpu02_ldo5(21), 844 + regulator_desc_s2mpu02_ldo5(22), 845 + regulator_desc_s2mpu02_ldo5(23), 846 + regulator_desc_s2mpu02_ldo4(24), 847 + regulator_desc_s2mpu02_ldo5(25), 848 + regulator_desc_s2mpu02_ldo4(26), 849 + regulator_desc_s2mpu02_ldo5(27), 850 + regulator_desc_s2mpu02_ldo5(28), 851 + regulator_desc_s2mpu02_buck1234(1), 852 + regulator_desc_s2mpu02_buck1234(2), 853 + regulator_desc_s2mpu02_buck1234(3), 854 + regulator_desc_s2mpu02_buck1234(4), 855 + regulator_desc_s2mpu02_buck5(5), 856 + regulator_desc_s2mpu02_buck6(6), 857 + regulator_desc_s2mpu02_buck7(7), 858 + }; 669 859 670 860 static int s2mps11_pmic_probe(struct platform_device *pdev) 671 861 { ··· 908 634 struct s2mps11_info *s2mps11; 909 635 int i, ret = 0; 910 636 const struct regulator_desc *regulators; 911 - enum sec_device_type dev_type; 912 637 913 638 s2mps11 = devm_kzalloc(&pdev->dev, sizeof(struct s2mps11_info), 914 639 GFP_KERNEL); 915 640 if (!s2mps11) 916 641 return -ENOMEM; 917 642 918 - dev_type = platform_get_device_id(pdev)->driver_data; 919 - switch (dev_type) { 643 + s2mps11->dev_type = platform_get_device_id(pdev)->driver_data; 644 + switch (s2mps11->dev_type) { 920 645 case S2MPS11X: 921 646 s2mps11->rdev_num = ARRAY_SIZE(s2mps11_regulators); 922 647 regulators = s2mps11_regulators; ··· 924 651 s2mps11->rdev_num = ARRAY_SIZE(s2mps14_regulators); 925 652 regulators = s2mps14_regulators; 926 653 break; 654 + case S2MPU02: 655 + s2mps11->rdev_num = ARRAY_SIZE(s2mpu02_regulators); 656 + regulators = s2mpu02_regulators; 657 + break; 927 658 default: 928 - dev_err(&pdev->dev, "Invalid device type: %u\n", dev_type); 659 + dev_err(&pdev->dev, "Invalid device type: %u\n", 660 + s2mps11->dev_type); 929 661 return -EINVAL; 930 662 }; 931 663 ··· 964 686 for (i = 0; i < s2mps11->rdev_num; i++) 965 687 rdata[i].name = regulators[i].name; 966 688 967 - ret = s2mps11_pmic_dt_parse(pdev, rdata, s2mps11, dev_type); 689 + ret = s2mps11_pmic_dt_parse(pdev, rdata, s2mps11); 968 690 if (ret) 969 691 goto out; 970 692 ··· 1017 739 static const struct platform_device_id s2mps11_pmic_id[] = { 1018 740 { "s2mps11-pmic", S2MPS11X}, 1019 741 { "s2mps14-pmic", S2MPS14X}, 742 + { "s2mpu02-pmic", S2MPU02}, 1020 743 { }, 1021 744 }; 1022 745 MODULE_DEVICE_TABLE(platform, s2mps11_pmic_id);
+37 -17
drivers/rtc/rtc-da9063.c
··· 29 29 #define YEARS_FROM_DA9063(year) ((year) + 100) 30 30 #define MONTHS_FROM_DA9063(month) ((month) - 1) 31 31 32 + #define RTC_ALARM_DATA_LEN (DA9063_AD_REG_ALARM_Y - DA9063_AD_REG_ALARM_MI + 1) 33 + 32 34 #define RTC_DATA_LEN (DA9063_REG_COUNT_Y - DA9063_REG_COUNT_S + 1) 33 35 #define RTC_SEC 0 34 36 #define RTC_MIN 1 ··· 44 42 struct da9063 *hw; 45 43 struct rtc_time alarm_time; 46 44 bool rtc_sync; 45 + int alarm_year; 46 + int alarm_start; 47 + int alarm_len; 48 + int data_start; 47 49 }; 48 50 49 51 static void da9063_data_to_tm(u8 *data, struct rtc_time *tm) ··· 89 83 { 90 84 struct da9063_rtc *rtc = dev_get_drvdata(dev); 91 85 92 - return regmap_update_bits(rtc->hw->regmap, DA9063_REG_ALARM_Y, 86 + return regmap_update_bits(rtc->hw->regmap, rtc->alarm_year, 93 87 DA9063_ALARM_ON, 0); 94 88 } 95 89 ··· 97 91 { 98 92 struct da9063_rtc *rtc = dev_get_drvdata(dev); 99 93 100 - return regmap_update_bits(rtc->hw->regmap, DA9063_REG_ALARM_Y, 94 + return regmap_update_bits(rtc->hw->regmap, rtc->alarm_year, 101 95 DA9063_ALARM_ON, DA9063_ALARM_ON); 102 96 } 103 97 ··· 157 151 int ret; 158 152 unsigned int val; 159 153 160 - ret = regmap_bulk_read(rtc->hw->regmap, DA9063_REG_ALARM_S, 161 - &data[RTC_SEC], RTC_DATA_LEN); 154 + data[RTC_SEC] = 0; 155 + ret = regmap_bulk_read(rtc->hw->regmap, rtc->alarm_start, 156 + &data[rtc->data_start], rtc->alarm_len); 162 157 if (ret < 0) 163 158 return ret; 164 159 ··· 193 186 return ret; 194 187 } 195 188 196 - ret = regmap_bulk_write(rtc->hw->regmap, DA9063_REG_ALARM_S, 197 - data, RTC_DATA_LEN); 189 + ret = regmap_bulk_write(rtc->hw->regmap, rtc->alarm_start, 190 + &data[rtc->data_start], rtc->alarm_len); 198 191 if (ret < 0) { 199 192 dev_err(dev, "Failed to write alarm: %d\n", ret); 200 193 return ret; 201 194 } 202 195 203 - rtc->alarm_time = alrm->time; 196 + da9063_data_to_tm(data, &rtc->alarm_time); 204 197 205 198 if (alrm->enabled) { 206 199 ret = da9063_rtc_start_alarm(dev); ··· 225 218 { 226 219 struct da9063_rtc *rtc = data; 227 220 228 - regmap_update_bits(rtc->hw->regmap, DA9063_REG_ALARM_Y, 221 + regmap_update_bits(rtc->hw->regmap, rtc->alarm_year, 229 222 DA9063_ALARM_ON, 0); 230 223 231 224 rtc->rtc_sync = true; ··· 264 257 goto err; 265 258 } 266 259 267 - ret = regmap_update_bits(da9063->regmap, DA9063_REG_ALARM_S, 260 + rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); 261 + if (!rtc) 262 + return -ENOMEM; 263 + 264 + if (da9063->variant_code == PMIC_DA9063_AD) { 265 + rtc->alarm_year = DA9063_AD_REG_ALARM_Y; 266 + rtc->alarm_start = DA9063_AD_REG_ALARM_MI; 267 + rtc->alarm_len = RTC_ALARM_DATA_LEN; 268 + rtc->data_start = RTC_MIN; 269 + } else { 270 + rtc->alarm_year = DA9063_BB_REG_ALARM_Y; 271 + rtc->alarm_start = DA9063_BB_REG_ALARM_S; 272 + rtc->alarm_len = RTC_DATA_LEN; 273 + rtc->data_start = RTC_SEC; 274 + } 275 + 276 + ret = regmap_update_bits(da9063->regmap, rtc->alarm_start, 268 277 DA9063_ALARM_STATUS_TICK | DA9063_ALARM_STATUS_ALARM, 269 278 0); 270 279 if (ret < 0) { ··· 288 265 goto err; 289 266 } 290 267 291 - ret = regmap_update_bits(da9063->regmap, DA9063_REG_ALARM_S, 268 + ret = regmap_update_bits(da9063->regmap, rtc->alarm_start, 292 269 DA9063_ALARM_STATUS_ALARM, 293 270 DA9063_ALARM_STATUS_ALARM); 294 271 if (ret < 0) { ··· 296 273 goto err; 297 274 } 298 275 299 - ret = regmap_update_bits(da9063->regmap, DA9063_REG_ALARM_Y, 276 + ret = regmap_update_bits(da9063->regmap, rtc->alarm_year, 300 277 DA9063_TICK_ON, 0); 301 278 if (ret < 0) { 302 279 dev_err(&pdev->dev, "Failed to disable TICKs\n"); 303 280 goto err; 304 281 } 305 282 306 - ret = regmap_bulk_read(da9063->regmap, DA9063_REG_ALARM_S, 307 - data, RTC_DATA_LEN); 283 + data[RTC_SEC] = 0; 284 + ret = regmap_bulk_read(da9063->regmap, rtc->alarm_start, 285 + &data[rtc->data_start], rtc->alarm_len); 308 286 if (ret < 0) { 309 287 dev_err(&pdev->dev, "Failed to read initial alarm data: %d\n", 310 288 ret); 311 289 goto err; 312 290 } 313 - 314 - rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); 315 - if (!rtc) 316 - return -ENOMEM; 317 291 318 292 platform_set_drvdata(pdev, rtc); 319 293
+8 -19
drivers/rtc/rtc-max77686.c
··· 492 492 return ret; 493 493 } 494 494 495 - static struct regmap_config max77686_rtc_regmap_config = { 496 - .reg_bits = 8, 497 - .val_bits = 8, 498 - }; 499 - 500 495 static int max77686_rtc_probe(struct platform_device *pdev) 501 496 { 502 497 struct max77686_dev *max77686 = dev_get_drvdata(pdev->dev.parent); 503 498 struct max77686_rtc_info *info; 504 - int ret, virq; 499 + int ret; 505 500 506 501 dev_info(&pdev->dev, "%s\n", __func__); 507 502 ··· 509 514 info->dev = &pdev->dev; 510 515 info->max77686 = max77686; 511 516 info->rtc = max77686->rtc; 512 - info->max77686->rtc_regmap = devm_regmap_init_i2c(info->max77686->rtc, 513 - &max77686_rtc_regmap_config); 514 - if (IS_ERR(info->max77686->rtc_regmap)) { 515 - ret = PTR_ERR(info->max77686->rtc_regmap); 516 - dev_err(info->max77686->dev, "Failed to allocate register map: %d\n", 517 - ret); 518 - return ret; 519 - } 517 + 520 518 platform_set_drvdata(pdev, info); 521 519 522 520 ret = max77686_rtc_init_reg(info); ··· 538 550 ret = -EINVAL; 539 551 goto err_rtc; 540 552 } 541 - virq = irq_create_mapping(max77686->irq_domain, MAX77686_RTCIRQ_RTCA1); 542 - if (!virq) { 553 + 554 + info->virq = regmap_irq_get_virq(max77686->rtc_irq_data, 555 + MAX77686_RTCIRQ_RTCA1); 556 + if (!info->virq) { 543 557 ret = -ENXIO; 544 558 goto err_rtc; 545 559 } 546 - info->virq = virq; 547 560 548 - ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, 549 - max77686_rtc_alarm_irq, 0, "rtc-alarm0", info); 561 + ret = devm_request_threaded_irq(&pdev->dev, info->virq, NULL, 562 + max77686_rtc_alarm_irq, 0, "rtc-alarm1", info); 550 563 if (ret < 0) 551 564 dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", 552 565 info->virq, ret);
+1 -1
include/dt-bindings/mfd/as3722.h
··· 13 13 /* External control pins */ 14 14 #define AS3722_EXT_CONTROL_PIN_ENABLE1 1 15 15 #define AS3722_EXT_CONTROL_PIN_ENABLE2 2 16 - #define AS3722_EXT_CONTROL_PIN_ENABLE2 3 16 + #define AS3722_EXT_CONTROL_PIN_ENABLE3 3 17 17 18 18 /* Interrupt numbers for AS3722 */ 19 19 #define AS3722_IRQ_LID 0
+1
include/linux/mfd/abx500/ab8500.h
··· 505 505 void ab8500_override_turn_on_stat(u8 mask, u8 set); 506 506 507 507 #ifdef CONFIG_AB8500_DEBUG 508 + extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 508 509 void ab8500_dump_all_banks(struct device *dev); 509 510 void ab8500_debug_register_interrupt(int line); 510 511 #else
+29 -4
include/linux/mfd/arizona/core.h
··· 18 18 #include <linux/regulator/consumer.h> 19 19 #include <linux/mfd/arizona/pdata.h> 20 20 21 - #define ARIZONA_MAX_CORE_SUPPLIES 3 21 + #define ARIZONA_MAX_CORE_SUPPLIES 2 22 22 23 23 enum arizona_type { 24 24 WM5102 = 1, ··· 46 46 #define ARIZONA_IRQ_DSP_IRQ6 17 47 47 #define ARIZONA_IRQ_DSP_IRQ7 18 48 48 #define ARIZONA_IRQ_DSP_IRQ8 19 49 - #define ARIZONA_IRQ_SPK_SHUTDOWN_WARN 20 50 - #define ARIZONA_IRQ_SPK_SHUTDOWN 21 49 + #define ARIZONA_IRQ_SPK_OVERHEAT_WARN 20 50 + #define ARIZONA_IRQ_SPK_OVERHEAT 21 51 51 #define ARIZONA_IRQ_MICDET 22 52 52 #define ARIZONA_IRQ_HPDET 23 53 53 #define ARIZONA_IRQ_WSEQ_DONE 24 ··· 78 78 #define ARIZONA_IRQ_FLL1_CLOCK_OK 49 79 79 #define ARIZONA_IRQ_MICD_CLAMP_RISE 50 80 80 #define ARIZONA_IRQ_MICD_CLAMP_FALL 51 81 + #define ARIZONA_IRQ_HP3R_DONE 52 82 + #define ARIZONA_IRQ_HP3L_DONE 53 83 + #define ARIZONA_IRQ_HP2R_DONE 54 84 + #define ARIZONA_IRQ_HP2L_DONE 55 85 + #define ARIZONA_IRQ_HP1R_DONE 56 86 + #define ARIZONA_IRQ_HP1L_DONE 57 87 + #define ARIZONA_IRQ_ISRC3_CFG_ERR 58 88 + #define ARIZONA_IRQ_DSP_SHARED_WR_COLL 59 89 + #define ARIZONA_IRQ_SPK_SHUTDOWN 60 90 + #define ARIZONA_IRQ_SPK1R_SHORT 61 91 + #define ARIZONA_IRQ_SPK1L_SHORT 62 92 + #define ARIZONA_IRQ_HP3R_SC_NEG 63 93 + #define ARIZONA_IRQ_HP3R_SC_POS 64 94 + #define ARIZONA_IRQ_HP3L_SC_NEG 65 95 + #define ARIZONA_IRQ_HP3L_SC_POS 66 96 + #define ARIZONA_IRQ_HP2R_SC_NEG 67 97 + #define ARIZONA_IRQ_HP2R_SC_POS 68 98 + #define ARIZONA_IRQ_HP2L_SC_NEG 69 99 + #define ARIZONA_IRQ_HP2L_SC_POS 70 100 + #define ARIZONA_IRQ_HP1R_SC_NEG 71 101 + #define ARIZONA_IRQ_HP1R_SC_POS 72 102 + #define ARIZONA_IRQ_HP1L_SC_NEG 73 103 + #define ARIZONA_IRQ_HP1L_SC_POS 74 81 104 82 - #define ARIZONA_NUM_IRQ 52 105 + #define ARIZONA_NUM_IRQ 75 83 106 84 107 struct snd_soc_dapm_context; 85 108 ··· 131 108 132 109 struct mutex clk_lock; 133 110 int clk32k_ref; 111 + 112 + bool ctrlif_error; 134 113 135 114 struct snd_soc_dapm_context *dapm; 136 115
+745 -40
include/linux/mfd/arizona/registers.h
··· 878 878 #define ARIZONA_INTERRUPT_STATUS_3 0xD02 879 879 #define ARIZONA_INTERRUPT_STATUS_4 0xD03 880 880 #define ARIZONA_INTERRUPT_STATUS_5 0xD04 881 + #define ARIZONA_INTERRUPT_STATUS_6 0xD05 881 882 #define ARIZONA_INTERRUPT_STATUS_1_MASK 0xD08 882 883 #define ARIZONA_INTERRUPT_STATUS_2_MASK 0xD09 883 884 #define ARIZONA_INTERRUPT_STATUS_3_MASK 0xD0A 884 885 #define ARIZONA_INTERRUPT_STATUS_4_MASK 0xD0B 885 886 #define ARIZONA_INTERRUPT_STATUS_5_MASK 0xD0C 887 + #define ARIZONA_INTERRUPT_STATUS_6_MASK 0xD0D 886 888 #define ARIZONA_INTERRUPT_CONTROL 0xD0F 887 889 #define ARIZONA_IRQ2_STATUS_1 0xD10 888 890 #define ARIZONA_IRQ2_STATUS_2 0xD11 889 891 #define ARIZONA_IRQ2_STATUS_3 0xD12 890 892 #define ARIZONA_IRQ2_STATUS_4 0xD13 891 893 #define ARIZONA_IRQ2_STATUS_5 0xD14 894 + #define ARIZONA_IRQ2_STATUS_6 0xD15 892 895 #define ARIZONA_IRQ2_STATUS_1_MASK 0xD18 893 896 #define ARIZONA_IRQ2_STATUS_2_MASK 0xD19 894 897 #define ARIZONA_IRQ2_STATUS_3_MASK 0xD1A 895 898 #define ARIZONA_IRQ2_STATUS_4_MASK 0xD1B 896 899 #define ARIZONA_IRQ2_STATUS_5_MASK 0xD1C 900 + #define ARIZONA_IRQ2_STATUS_6_MASK 0xD1D 897 901 #define ARIZONA_IRQ2_CONTROL 0xD1F 898 902 #define ARIZONA_INTERRUPT_RAW_STATUS_2 0xD20 899 903 #define ARIZONA_INTERRUPT_RAW_STATUS_3 0xD21 ··· 906 902 #define ARIZONA_INTERRUPT_RAW_STATUS_6 0xD24 907 903 #define ARIZONA_INTERRUPT_RAW_STATUS_7 0xD25 908 904 #define ARIZONA_INTERRUPT_RAW_STATUS_8 0xD26 905 + #define ARIZONA_INTERRUPT_RAW_STATUS_9 0xD28 909 906 #define ARIZONA_IRQ_PIN_STATUS 0xD40 910 907 #define ARIZONA_ADSP2_IRQ0 0xD41 911 908 #define ARIZONA_AOD_WKUP_AND_TRIG 0xD50 ··· 4696 4691 /* 4697 4692 * R3330 (0xD02) - Interrupt Status 3 4698 4693 */ 4699 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT1 0x8000 /* SPK_SHUTDOWN_WARN_EINT1 */ 4700 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_MASK 0x8000 /* SPK_SHUTDOWN_WARN_EINT1 */ 4701 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_SHIFT 15 /* SPK_SHUTDOWN_WARN_EINT1 */ 4702 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_WIDTH 1 /* SPK_SHUTDOWN_WARN_EINT1 */ 4703 - #define ARIZONA_SPK_SHUTDOWN_EINT1 0x4000 /* SPK_SHUTDOWN_EINT1 */ 4704 - #define ARIZONA_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* SPK_SHUTDOWN_EINT1 */ 4705 - #define ARIZONA_SPK_SHUTDOWN_EINT1_SHIFT 14 /* SPK_SHUTDOWN_EINT1 */ 4706 - #define ARIZONA_SPK_SHUTDOWN_EINT1_WIDTH 1 /* SPK_SHUTDOWN_EINT1 */ 4694 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT1 0x8000 /* SPK_OVERHEAT_WARN_EINT1 */ 4695 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT1_MASK 0x8000 /* SPK_OVERHEAD_WARN_EINT1 */ 4696 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT1_SHIFT 15 /* SPK_OVERHEAT_WARN_EINT1 */ 4697 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT1_WIDTH 1 /* SPK_OVERHEAT_WARN_EINT1 */ 4698 + #define ARIZONA_SPK_OVERHEAT_EINT1 0x4000 /* SPK_OVERHEAT_EINT1 */ 4699 + #define ARIZONA_SPK_OVERHEAT_EINT1_MASK 0x4000 /* SPK_OVERHEAT_EINT1 */ 4700 + #define ARIZONA_SPK_OVERHEAT_EINT1_SHIFT 14 /* SPK_OVERHEAT_EINT1 */ 4701 + #define ARIZONA_SPK_OVERHEAT_EINT1_WIDTH 1 /* SPK_OVERHEAT_EINT1 */ 4707 4702 #define ARIZONA_HPDET_EINT1 0x2000 /* HPDET_EINT1 */ 4708 4703 #define ARIZONA_HPDET_EINT1_MASK 0x2000 /* HPDET_EINT1 */ 4709 4704 #define ARIZONA_HPDET_EINT1_SHIFT 13 /* HPDET_EINT1 */ ··· 4800 4795 #define ARIZONA_ISRC2_CFG_ERR_EINT1_MASK 0x0040 /* ISRC2_CFG_ERR_EINT1 */ 4801 4796 #define ARIZONA_ISRC2_CFG_ERR_EINT1_SHIFT 6 /* ISRC2_CFG_ERR_EINT1 */ 4802 4797 #define ARIZONA_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* ISRC2_CFG_ERR_EINT1 */ 4798 + #define ARIZONA_HP3R_DONE_EINT1 0x0020 /* HP3R_DONE_EINT1 */ 4799 + #define ARIZONA_HP3R_DONE_EINT1_MASK 0x0020 /* HP3R_DONE_EINT1 */ 4800 + #define ARIZONA_HP3R_DONE_EINT1_SHIFT 5 /* HP3R_DONE_EINT1 */ 4801 + #define ARIZONA_HP3R_DONE_EINT1_WIDTH 1 /* HP3R_DONE_EINT1 */ 4802 + #define ARIZONA_HP3L_DONE_EINT1 0x0010 /* HP3L_DONE_EINT1 */ 4803 + #define ARIZONA_HP3L_DONE_EINT1_MASK 0x0010 /* HP3L_DONE_EINT1 */ 4804 + #define ARIZONA_HP3L_DONE_EINT1_SHIFT 4 /* HP3L_DONE_EINT1 */ 4805 + #define ARIZONA_HP3L_DONE_EINT1_WIDTH 1 /* HP3L_DONE_EINT1 */ 4806 + #define ARIZONA_HP2R_DONE_EINT1 0x0008 /* HP2R_DONE_EINT1 */ 4807 + #define ARIZONA_HP2R_DONE_EINT1_MASK 0x0008 /* HP2R_DONE_EINT1 */ 4808 + #define ARIZONA_HP2R_DONE_EINT1_SHIFT 3 /* HP2R_DONE_EINT1 */ 4809 + #define ARIZONA_HP2R_DONE_EINT1_WIDTH 1 /* HP2R_DONE_EINT1 */ 4810 + #define ARIZONA_HP2L_DONE_EINT1 0x0004 /* HP2L_DONE_EINT1 */ 4811 + #define ARIZONA_HP2L_DONE_EINT1_MASK 0x0004 /* HP2L_DONE_EINT1 */ 4812 + #define ARIZONA_HP2L_DONE_EINT1_SHIFT 2 /* HP2L_DONE_EINT1 */ 4813 + #define ARIZONA_HP2L_DONE_EINT1_WIDTH 1 /* HP2L_DONE_EINT1 */ 4814 + #define ARIZONA_HP1R_DONE_EINT1 0x0002 /* HP1R_DONE_EINT1 */ 4815 + #define ARIZONA_HP1R_DONE_EINT1_MASK 0x0002 /* HP1R_DONE_EINT1 */ 4816 + #define ARIZONA_HP1R_DONE_EINT1_SHIFT 1 /* HP1R_DONE_EINT1 */ 4817 + #define ARIZONA_HP1R_DONE_EINT1_WIDTH 1 /* HP1R_DONE_EINT1 */ 4818 + #define ARIZONA_HP1L_DONE_EINT1 0x0001 /* HP1L_DONE_EINT1 */ 4819 + #define ARIZONA_HP1L_DONE_EINT1_MASK 0x0001 /* HP1L_DONE_EINT1 */ 4820 + #define ARIZONA_HP1L_DONE_EINT1_SHIFT 0 /* HP1L_DONE_EINT1 */ 4821 + #define ARIZONA_HP1L_DONE_EINT1_WIDTH 1 /* HP1L_DONE_EINT1 */ 4822 + 4823 + /* 4824 + * R3331 (0xD03) - Interrupt Status 4 (Alternate layout) 4825 + * 4826 + * Alternate layout used on later devices, note only fields that have moved 4827 + * are specified 4828 + */ 4829 + #define ARIZONA_V2_AIF3_ERR_EINT1 0x8000 /* AIF3_ERR_EINT1 */ 4830 + #define ARIZONA_V2_AIF3_ERR_EINT1_MASK 0x8000 /* AIF3_ERR_EINT1 */ 4831 + #define ARIZONA_V2_AIF3_ERR_EINT1_SHIFT 15 /* AIF3_ERR_EINT1 */ 4832 + #define ARIZONA_V2_AIF3_ERR_EINT1_WIDTH 1 /* AIF3_ERR_EINT1 */ 4833 + #define ARIZONA_V2_AIF2_ERR_EINT1 0x4000 /* AIF2_ERR_EINT1 */ 4834 + #define ARIZONA_V2_AIF2_ERR_EINT1_MASK 0x4000 /* AIF2_ERR_EINT1 */ 4835 + #define ARIZONA_V2_AIF2_ERR_EINT1_SHIFT 14 /* AIF2_ERR_EINT1 */ 4836 + #define ARIZONA_V2_AIF2_ERR_EINT1_WIDTH 1 /* AIF2_ERR_EINT1 */ 4837 + #define ARIZONA_V2_AIF1_ERR_EINT1 0x2000 /* AIF1_ERR_EINT1 */ 4838 + #define ARIZONA_V2_AIF1_ERR_EINT1_MASK 0x2000 /* AIF1_ERR_EINT1 */ 4839 + #define ARIZONA_V2_AIF1_ERR_EINT1_SHIFT 13 /* AIF1_ERR_EINT1 */ 4840 + #define ARIZONA_V2_AIF1_ERR_EINT1_WIDTH 1 /* AIF1_ERR_EINT1 */ 4841 + #define ARIZONA_V2_CTRLIF_ERR_EINT1 0x1000 /* CTRLIF_ERR_EINT1 */ 4842 + #define ARIZONA_V2_CTRLIF_ERR_EINT1_MASK 0x1000 /* CTRLIF_ERR_EINT1 */ 4843 + #define ARIZONA_V2_CTRLIF_ERR_EINT1_SHIFT 12 /* CTRLIF_ERR_EINT1 */ 4844 + #define ARIZONA_V2_CTRLIF_ERR_EINT1_WIDTH 1 /* CTRLIF_ERR_EINT1 */ 4845 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1 0x0800 /* MIXER_DROPPED_SAMPLE_EINT1 */ 4846 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1_MASK 0x0800 /* MIXER_DROPPED_SAMPLE_EINT1 */ 4847 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1_SHIFT 11 /* MIXER_DROPPED_SAMPLE_EINT1 */ 4848 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1_WIDTH 1 /* MIXER_DROPPED_SAMPLE_EINT1 */ 4849 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1 0x0400 /* ASYNC_CLK_ENA_LOW_EINT1 */ 4850 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1_MASK 0x0400 /* ASYNC_CLK_ENA_LOW_EINT1 */ 4851 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1_SHIFT 10 /* ASYNC_CLK_ENA_LOW_EINT1 */ 4852 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1_WIDTH 1 /* ASYNC_CLK_ENA_LOW_EINT1 */ 4853 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT1 0x0200 /* SYSCLK_ENA_LOW_EINT1 */ 4854 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT1_MASK 0x0200 /* SYSCLK_ENA_LOW_EINT1 */ 4855 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT1_SHIFT 9 /* SYSCLK_ENA_LOW_EINT1 */ 4856 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT1_WIDTH 1 /* SYSCLK_ENA_LOW_EINT1 */ 4857 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT1 0x0100 /* ISRC1_CFG_ERR_EINT1 */ 4858 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT1_MASK 0x0100 /* ISRC1_CFG_ERR_EINT1 */ 4859 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT1_SHIFT 8 /* ISRC1_CFG_ERR_EINT1 */ 4860 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT1_WIDTH 1 /* ISRC1_CFG_ERR_EINT1 */ 4861 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT1 0x0080 /* ISRC2_CFG_ERR_EINT1 */ 4862 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT1_MASK 0x0080 /* ISRC2_CFG_ERR_EINT1 */ 4863 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT1_SHIFT 7 /* ISRC2_CFG_ERR_EINT1 */ 4864 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* ISRC2_CFG_ERR_EINT1 */ 4865 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT1 0x0040 /* ISRC3_CFG_ERR_EINT1 */ 4866 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT1_MASK 0x0040 /* ISRC3_CFG_ERR_EINT1 */ 4867 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT1_SHIFT 6 /* ISRC3_CFG_ERR_EINT1 */ 4868 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT1_WIDTH 1 /* ISRC3_CFG_ERR_EINT1 */ 4803 4869 4804 4870 /* 4805 4871 * R3332 (0xD04) - Interrupt Status 5 ··· 4895 4819 #define ARIZONA_FLL1_CLOCK_OK_EINT1_MASK 0x0001 /* FLL1_CLOCK_OK_EINT1 */ 4896 4820 #define ARIZONA_FLL1_CLOCK_OK_EINT1_SHIFT 0 /* FLL1_CLOCK_OK_EINT1 */ 4897 4821 #define ARIZONA_FLL1_CLOCK_OK_EINT1_WIDTH 1 /* FLL1_CLOCK_OK_EINT1 */ 4822 + 4823 + /* 4824 + * R3332 (0xD05) - Interrupt Status 5 (Alternate layout) 4825 + * 4826 + * Alternate layout used on later devices, note only fields that have moved 4827 + * are specified 4828 + */ 4829 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT1 0x0008 /* ASRC_CFG_ERR_EINT1 */ 4830 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT1_MASK 0x0008 /* ASRC_CFG_ERR_EINT1 */ 4831 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT1_SHIFT 3 /* ASRC_CFG_ERR_EINT1 */ 4832 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT1_WIDTH 1 /* ASRC_CFG_ERR_EINT1 */ 4833 + 4834 + /* 4835 + * R3333 (0xD05) - Interrupt Status 6 4836 + */ 4837 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT1 0x8000 /* DSP_SHARED_WR_COLL_EINT1 */ 4838 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT1_MASK 0x8000 /* DSP_SHARED_WR_COLL_EINT1 */ 4839 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT1_SHIFT 15 /* DSP_SHARED_WR_COLL_EINT1 */ 4840 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT1_WIDTH 1 /* DSP_SHARED_WR_COLL_EINT1 */ 4841 + #define ARIZONA_SPK_SHUTDOWN_EINT1 0x4000 /* SPK_SHUTDOWN_EINT1 */ 4842 + #define ARIZONA_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* SPK_SHUTDOWN_EINT1 */ 4843 + #define ARIZONA_SPK_SHUTDOWN_EINT1_SHIFT 14 /* SPK_SHUTDOWN_EINT1 */ 4844 + #define ARIZONA_SPK_SHUTDOWN_EINT1_WIDTH 1 /* SPK_SHUTDOWN_EINT1 */ 4845 + #define ARIZONA_SPK1R_SHORT_EINT1 0x2000 /* SPK1R_SHORT_EINT1 */ 4846 + #define ARIZONA_SPK1R_SHORT_EINT1_MASK 0x2000 /* SPK1R_SHORT_EINT1 */ 4847 + #define ARIZONA_SPK1R_SHORT_EINT1_SHIFT 13 /* SPK1R_SHORT_EINT1 */ 4848 + #define ARIZONA_SPK1R_SHORT_EINT1_WIDTH 1 /* SPK1R_SHORT_EINT1 */ 4849 + #define ARIZONA_SPK1L_SHORT_EINT1 0x1000 /* SPK1L_SHORT_EINT1 */ 4850 + #define ARIZONA_SPK1L_SHORT_EINT1_MASK 0x1000 /* SPK1L_SHORT_EINT1 */ 4851 + #define ARIZONA_SPK1L_SHORT_EINT1_SHIFT 12 /* SPK1L_SHORT_EINT1 */ 4852 + #define ARIZONA_SPK1L_SHORT_EINT1_WIDTH 1 /* SPK1L_SHORT_EINT1 */ 4853 + #define ARIZONA_HP3R_SC_NEG_EINT1 0x0800 /* HP3R_SC_NEG_EINT1 */ 4854 + #define ARIZONA_HP3R_SC_NEG_EINT1_MASK 0x0800 /* HP3R_SC_NEG_EINT1 */ 4855 + #define ARIZONA_HP3R_SC_NEG_EINT1_SHIFT 11 /* HP3R_SC_NEG_EINT1 */ 4856 + #define ARIZONA_HP3R_SC_NEG_EINT1_WIDTH 1 /* HP3R_SC_NEG_EINT1 */ 4857 + #define ARIZONA_HP3R_SC_POS_EINT1 0x0400 /* HP3R_SC_POS_EINT1 */ 4858 + #define ARIZONA_HP3R_SC_POS_EINT1_MASK 0x0400 /* HP3R_SC_POS_EINT1 */ 4859 + #define ARIZONA_HP3R_SC_POS_EINT1_SHIFT 10 /* HP3R_SC_POS_EINT1 */ 4860 + #define ARIZONA_HP3R_SC_POS_EINT1_WIDTH 1 /* HP3R_SC_POS_EINT1 */ 4861 + #define ARIZONA_HP3L_SC_NEG_EINT1 0x0200 /* HP3L_SC_NEG_EINT1 */ 4862 + #define ARIZONA_HP3L_SC_NEG_EINT1_MASK 0x0200 /* HP3L_SC_NEG_EINT1 */ 4863 + #define ARIZONA_HP3L_SC_NEG_EINT1_SHIFT 9 /* HP3L_SC_NEG_EINT1 */ 4864 + #define ARIZONA_HP3L_SC_NEG_EINT1_WIDTH 1 /* HP3L_SC_NEG_EINT1 */ 4865 + #define ARIZONA_HP3L_SC_POS_EINT1 0x0100 /* HP3L_SC_POS_EINT1 */ 4866 + #define ARIZONA_HP3L_SC_POS_EINT1_MASK 0x0100 /* HP3L_SC_POS_EINT1 */ 4867 + #define ARIZONA_HP3L_SC_POS_EINT1_SHIFT 8 /* HP3L_SC_POS_EINT1 */ 4868 + #define ARIZONA_HP3L_SC_POS_EINT1_WIDTH 1 /* HP3L_SC_POS_EINT1 */ 4869 + #define ARIZONA_HP2R_SC_NEG_EINT1 0x0080 /* HP2R_SC_NEG_EINT1 */ 4870 + #define ARIZONA_HP2R_SC_NEG_EINT1_MASK 0x0080 /* HP2R_SC_NEG_EINT1 */ 4871 + #define ARIZONA_HP2R_SC_NEG_EINT1_SHIFT 7 /* HP2R_SC_NEG_EINT1 */ 4872 + #define ARIZONA_HP2R_SC_NEG_EINT1_WIDTH 1 /* HP2R_SC_NEG_EINT1 */ 4873 + #define ARIZONA_HP2R_SC_POS_EINT1 0x0040 /* HP2R_SC_POS_EINT1 */ 4874 + #define ARIZONA_HP2R_SC_POS_EINT1_MASK 0x0040 /* HP2R_SC_POS_EINT1 */ 4875 + #define ARIZONA_HP2R_SC_POS_EINT1_SHIFT 6 /* HP2R_SC_POS_EINT1 */ 4876 + #define ARIZONA_HP2R_SC_POS_EINT1_WIDTH 1 /* HP2R_SC_POS_EINT1 */ 4877 + #define ARIZONA_HP2L_SC_NEG_EINT1 0x0020 /* HP2L_SC_NEG_EINT1 */ 4878 + #define ARIZONA_HP2L_SC_NEG_EINT1_MASK 0x0020 /* HP2L_SC_NEG_EINT1 */ 4879 + #define ARIZONA_HP2L_SC_NEG_EINT1_SHIFT 5 /* HP2L_SC_NEG_EINT1 */ 4880 + #define ARIZONA_HP2L_SC_NEG_EINT1_WIDTH 1 /* HP2L_SC_NEG_EINT1 */ 4881 + #define ARIZONA_HP2L_SC_POS_EINT1 0x0010 /* HP2L_SC_POS_EINT1 */ 4882 + #define ARIZONA_HP2L_SC_POS_EINT1_MASK 0x0010 /* HP2L_SC_POS_EINT1 */ 4883 + #define ARIZONA_HP2L_SC_POS_EINT1_SHIFT 4 /* HP2L_SC_POS_EINT1 */ 4884 + #define ARIZONA_HP2L_SC_POS_EINT1_WIDTH 1 /* HP2L_SC_POS_EINT1 */ 4885 + #define ARIZONA_HP1R_SC_NEG_EINT1 0x0008 /* HP1R_SC_NEG_EINT1 */ 4886 + #define ARIZONA_HP1R_SC_NEG_EINT1_MASK 0x0008 /* HP1R_SC_NEG_EINT1 */ 4887 + #define ARIZONA_HP1R_SC_NEG_EINT1_SHIFT 3 /* HP1R_SC_NEG_EINT1 */ 4888 + #define ARIZONA_HP1R_SC_NEG_EINT1_WIDTH 1 /* HP1R_SC_NEG_EINT1 */ 4889 + #define ARIZONA_HP1R_SC_POS_EINT1 0x0004 /* HP1R_SC_POS_EINT1 */ 4890 + #define ARIZONA_HP1R_SC_POS_EINT1_MASK 0x0004 /* HP1R_SC_POS_EINT1 */ 4891 + #define ARIZONA_HP1R_SC_POS_EINT1_SHIFT 2 /* HP1R_SC_POS_EINT1 */ 4892 + #define ARIZONA_HP1R_SC_POS_EINT1_WIDTH 1 /* HP1R_SC_POS_EINT1 */ 4893 + #define ARIZONA_HP1L_SC_NEG_EINT1 0x0002 /* HP1L_SC_NEG_EINT1 */ 4894 + #define ARIZONA_HP1L_SC_NEG_EINT1_MASK 0x0002 /* HP1L_SC_NEG_EINT1 */ 4895 + #define ARIZONA_HP1L_SC_NEG_EINT1_SHIFT 1 /* HP1L_SC_NEG_EINT1 */ 4896 + #define ARIZONA_HP1L_SC_NEG_EINT1_WIDTH 1 /* HP1L_SC_NEG_EINT1 */ 4897 + #define ARIZONA_HP1L_SC_POS_EINT1 0x0001 /* HP1L_SC_POS_EINT1 */ 4898 + #define ARIZONA_HP1L_SC_POS_EINT1_MASK 0x0001 /* HP1L_SC_POS_EINT1 */ 4899 + #define ARIZONA_HP1L_SC_POS_EINT1_SHIFT 0 /* HP1L_SC_POS_EINT1 */ 4900 + #define ARIZONA_HP1L_SC_POS_EINT1_WIDTH 1 /* HP1L_SC_POS_EINT1 */ 4898 4901 4899 4902 /* 4900 4903 * R3336 (0xD08) - Interrupt Status 1 Mask ··· 5014 4859 /* 5015 4860 * R3338 (0xD0A) - Interrupt Status 3 Mask 5016 4861 */ 5017 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT1 */ 5018 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_MASK 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT1 */ 5019 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_SHIFT 15 /* IM_SPK_SHUTDOWN_WARN_EINT1 */ 5020 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_WIDTH 1 /* IM_SPK_SHUTDOWN_WARN_EINT1 */ 5021 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT1 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */ 5022 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */ 5023 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT1 */ 5024 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT1 */ 4862 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT1 0x8000 /* IM_SPK_OVERHEAT_WARN_EINT1 */ 4863 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT1_MASK 0x8000 /* IM_SPK_OVERHEAT_WARN_EINT1 */ 4864 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT1_SHIFT 15 /* IM_SPK_OVERHEAT_WARN_EINT1 */ 4865 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT1_WIDTH 1 /* IM_SPK_OVERHEAT_WARN_EINT1 */ 4866 + #define ARIZONA_IM_SPK_OVERHEAT_EINT1 0x4000 /* IM_SPK_OVERHEAT_EINT1 */ 4867 + #define ARIZONA_IM_SPK_OVERHEAT_EINT1_MASK 0x4000 /* IM_SPK_OVERHEAT_EINT1 */ 4868 + #define ARIZONA_IM_SPK_OVERHEAT_EINT1_SHIFT 14 /* IM_SPK_OVERHEAT_EINT1 */ 4869 + #define ARIZONA_IM_SPK_OVERHEAT_EINT1_WIDTH 1 /* IM_SPK_OVERHEAT_EINT1 */ 5025 4870 #define ARIZONA_IM_HPDET_EINT1 0x2000 /* IM_HPDET_EINT1 */ 5026 4871 #define ARIZONA_IM_HPDET_EINT1_MASK 0x2000 /* IM_HPDET_EINT1 */ 5027 4872 #define ARIZONA_IM_HPDET_EINT1_SHIFT 13 /* IM_HPDET_EINT1 */ ··· 5118 4963 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_MASK 0x0040 /* IM_ISRC2_CFG_ERR_EINT1 */ 5119 4964 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_SHIFT 6 /* IM_ISRC2_CFG_ERR_EINT1 */ 5120 4965 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT1 */ 4966 + #define ARIZONA_IM_HP3R_DONE_EINT1 0x0020 /* IM_HP3R_DONE_EINT1 */ 4967 + #define ARIZONA_IM_HP3R_DONE_EINT1_MASK 0x0020 /* IM_HP3R_DONE_EINT1 */ 4968 + #define ARIZONA_IM_HP3R_DONE_EINT1_SHIFT 5 /* IM_HP3R_DONE_EINT1 */ 4969 + #define ARIZONA_IM_HP3R_DONE_EINT1_WIDTH 1 /* IM_HP3R_DONE_EINT1 */ 4970 + #define ARIZONA_IM_HP3L_DONE_EINT1 0x0010 /* IM_HP3L_DONE_EINT1 */ 4971 + #define ARIZONA_IM_HP3L_DONE_EINT1_MASK 0x0010 /* IM_HP3L_DONE_EINT1 */ 4972 + #define ARIZONA_IM_HP3L_DONE_EINT1_SHIFT 4 /* IM_HP3L_DONE_EINT1 */ 4973 + #define ARIZONA_IM_HP3L_DONE_EINT1_WIDTH 1 /* IM_HP3L_DONE_EINT1 */ 4974 + #define ARIZONA_IM_HP2R_DONE_EINT1 0x0008 /* IM_HP2R_DONE_EINT1 */ 4975 + #define ARIZONA_IM_HP2R_DONE_EINT1_MASK 0x0008 /* IM_HP2R_DONE_EINT1 */ 4976 + #define ARIZONA_IM_HP2R_DONE_EINT1_SHIFT 3 /* IM_HP2R_DONE_EINT1 */ 4977 + #define ARIZONA_IM_HP2R_DONE_EINT1_WIDTH 1 /* IM_HP2R_DONE_EINT1 */ 4978 + #define ARIZONA_IM_HP2L_DONE_EINT1 0x0004 /* IM_HP2L_DONE_EINT1 */ 4979 + #define ARIZONA_IM_HP2L_DONE_EINT1_MASK 0x0004 /* IM_HP2L_DONE_EINT1 */ 4980 + #define ARIZONA_IM_HP2L_DONE_EINT1_SHIFT 2 /* IM_HP2L_DONE_EINT1 */ 4981 + #define ARIZONA_IM_HP2L_DONE_EINT1_WIDTH 1 /* IM_HP2L_DONE_EINT1 */ 4982 + #define ARIZONA_IM_HP1R_DONE_EINT1 0x0002 /* IM_HP1R_DONE_EINT1 */ 4983 + #define ARIZONA_IM_HP1R_DONE_EINT1_MASK 0x0002 /* IM_HP1R_DONE_EINT1 */ 4984 + #define ARIZONA_IM_HP1R_DONE_EINT1_SHIFT 1 /* IM_HP1R_DONE_EINT1 */ 4985 + #define ARIZONA_IM_HP1R_DONE_EINT1_WIDTH 1 /* IM_HP1R_DONE_EINT1 */ 4986 + #define ARIZONA_IM_HP1L_DONE_EINT1 0x0001 /* IM_HP1L_DONE_EINT1 */ 4987 + #define ARIZONA_IM_HP1L_DONE_EINT1_MASK 0x0001 /* IM_HP1L_DONE_EINT1 */ 4988 + #define ARIZONA_IM_HP1L_DONE_EINT1_SHIFT 0 /* IM_HP1L_DONE_EINT1 */ 4989 + #define ARIZONA_IM_HP1L_DONE_EINT1_WIDTH 1 /* IM_HP1L_DONE_EINT1 */ 4990 + 4991 + /* 4992 + * R3339 (0xD0B) - Interrupt Status 4 Mask (Alternate layout) 4993 + * 4994 + * Alternate layout used on later devices, note only fields that have moved 4995 + * are specified 4996 + */ 4997 + #define ARIZONA_V2_IM_AIF3_ERR_EINT1 0x8000 /* IM_AIF3_ERR_EINT1 */ 4998 + #define ARIZONA_V2_IM_AIF3_ERR_EINT1_MASK 0x8000 /* IM_AIF3_ERR_EINT1 */ 4999 + #define ARIZONA_V2_IM_AIF3_ERR_EINT1_SHIFT 15 /* IM_AIF3_ERR_EINT1 */ 5000 + #define ARIZONA_V2_IM_AIF3_ERR_EINT1_WIDTH 1 /* IM_AIF3_ERR_EINT1 */ 5001 + #define ARIZONA_V2_IM_AIF2_ERR_EINT1 0x4000 /* IM_AIF2_ERR_EINT1 */ 5002 + #define ARIZONA_V2_IM_AIF2_ERR_EINT1_MASK 0x4000 /* IM_AIF2_ERR_EINT1 */ 5003 + #define ARIZONA_V2_IM_AIF2_ERR_EINT1_SHIFT 14 /* IM_AIF2_ERR_EINT1 */ 5004 + #define ARIZONA_V2_IM_AIF2_ERR_EINT1_WIDTH 1 /* IM_AIF2_ERR_EINT1 */ 5005 + #define ARIZONA_V2_IM_AIF1_ERR_EINT1 0x2000 /* IM_AIF1_ERR_EINT1 */ 5006 + #define ARIZONA_V2_IM_AIF1_ERR_EINT1_MASK 0x2000 /* IM_AIF1_ERR_EINT1 */ 5007 + #define ARIZONA_V2_IM_AIF1_ERR_EINT1_SHIFT 13 /* IM_AIF1_ERR_EINT1 */ 5008 + #define ARIZONA_V2_IM_AIF1_ERR_EINT1_WIDTH 1 /* IM_AIF1_ERR_EINT1 */ 5009 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT1 0x1000 /* IM_CTRLIF_ERR_EINT1 */ 5010 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT1_MASK 0x1000 /* IM_CTRLIF_ERR_EINT1 */ 5011 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT1_SHIFT 12 /* IM_CTRLIF_ERR_EINT1 */ 5012 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT1_WIDTH 1 /* IM_CTRLIF_ERR_EINT1 */ 5013 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT1 0x0800 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */ 5014 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT1_MASK 0x0800 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */ 5015 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT1_SHIFT 11 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */ 5016 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT1_WIDTH 1 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */ 5017 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT1 0x0400 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */ 5018 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT1_MASK 0x0400 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */ 5019 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT1_SHIFT 10 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */ 5020 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT1_WIDTH 1 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */ 5021 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT1 0x0200 /* IM_SYSCLK_ENA_LOW_EINT1 */ 5022 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT1_MASK 0x0200 /* IM_SYSCLK_ENA_LOW_EINT1 */ 5023 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT1_SHIFT 9 /* IM_SYSCLK_ENA_LOW_EINT1 */ 5024 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT1_WIDTH 1 /* IM_SYSCLK_ENA_LOW_EINT1 */ 5025 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT1 0x0100 /* IM_ISRC1_CFG_ERR_EINT1 */ 5026 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT1_MASK 0x0100 /* IM_ISRC1_CFG_ERR_EINT1 */ 5027 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT1_SHIFT 8 /* IM_ISRC1_CFG_ERR_EINT1 */ 5028 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC1_CFG_ERR_EINT1 */ 5029 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT1 0x0080 /* IM_ISRC2_CFG_ERR_EINT1 */ 5030 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT1_MASK 0x0080 /* IM_ISRC2_CFG_ERR_EINT1 */ 5031 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT1_SHIFT 7 /* IM_ISRC2_CFG_ERR_EINT1 */ 5032 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT1 */ 5033 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT1 0x0040 /* IM_ISRC3_CFG_ERR_EINT1 */ 5034 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT1_MASK 0x0040 /* IM_ISRC3_CFG_ERR_EINT1 */ 5035 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT1_SHIFT 6 /* IM_ISRC3_CFG_ERR_EINT1 */ 5036 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC3_CFG_ERR_EINT1 */ 5121 5037 5122 5038 /* 5123 5039 * R3340 (0xD0C) - Interrupt Status 5 Mask ··· 5213 4987 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_MASK 0x0001 /* IM_FLL1_CLOCK_OK_EINT1 */ 5214 4988 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_SHIFT 0 /* IM_FLL1_CLOCK_OK_EINT1 */ 5215 4989 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_WIDTH 1 /* IM_FLL1_CLOCK_OK_EINT1 */ 4990 + 4991 + /* 4992 + * R3340 (0xD0C) - Interrupt Status 5 Mask (Alternate layout) 4993 + * 4994 + * Alternate layout used on later devices, note only fields that have moved 4995 + * are specified 4996 + */ 4997 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT1 0x0008 /* IM_ASRC_CFG_ERR_EINT1 */ 4998 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT1_MASK 0x0008 /* IM_ASRC_CFG_ERR_EINT1 */ 4999 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT1_SHIFT 3 /* IM_ASRC_CFG_ERR_EINT1 */ 5000 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT1_WIDTH 1 /* IM_ASRC_CFG_ERR_EINT1 */ 5001 + 5002 + /* 5003 + * R3341 (0xD0D) - Interrupt Status 6 Mask 5004 + */ 5005 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT1 0x8000 /* IM_DSP_SHARED_WR_COLL_EINT1 */ 5006 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT1_MASK 0x8000 /* IM_DSP_SHARED_WR_COLL_EINT1 */ 5007 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT1_SHIFT 15 /* IM_DSP_SHARED_WR_COLL_EINT1 */ 5008 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT1_WIDTH 1 /* IM_DSP_SHARED_WR_COLL_EINT1 */ 5009 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT1 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */ 5010 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */ 5011 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT1 */ 5012 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT1_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT1 */ 5013 + #define ARIZONA_IM_SPK1R_SHORT_EINT1 0x2000 /* IM_SPK1R_SHORT_EINT1 */ 5014 + #define ARIZONA_IM_SPK1R_SHORT_EINT1_MASK 0x2000 /* IM_SPK1R_SHORT_EINT1 */ 5015 + #define ARIZONA_IM_SPK1R_SHORT_EINT1_SHIFT 13 /* IM_SPK1R_SHORT_EINT1 */ 5016 + #define ARIZONA_IM_SPK1R_SHORT_EINT1_WIDTH 1 /* IM_SPK1R_SHORT_EINT1 */ 5017 + #define ARIZONA_IM_SPK1L_SHORT_EINT1 0x1000 /* IM_SPK1L_SHORT_EINT1 */ 5018 + #define ARIZONA_IM_SPK1L_SHORT_EINT1_MASK 0x1000 /* IM_SPK1L_SHORT_EINT1 */ 5019 + #define ARIZONA_IM_SPK1L_SHORT_EINT1_SHIFT 12 /* IM_SPK1L_SHORT_EINT1 */ 5020 + #define ARIZONA_IM_SPK1L_SHORT_EINT1_WIDTH 1 /* IM_SPK1L_SHORT_EINT1 */ 5021 + #define ARIZONA_IM_HP3R_SC_NEG_EINT1 0x0800 /* IM_HP3R_SC_NEG_EINT1 */ 5022 + #define ARIZONA_IM_HP3R_SC_NEG_EINT1_MASK 0x0800 /* IM_HP3R_SC_NEG_EINT1 */ 5023 + #define ARIZONA_IM_HP3R_SC_NEG_EINT1_SHIFT 11 /* IM_HP3R_SC_NEG_EINT1 */ 5024 + #define ARIZONA_IM_HP3R_SC_NEG_EINT1_WIDTH 1 /* IM_HP3R_SC_NEG_EINT1 */ 5025 + #define ARIZONA_IM_HP3R_SC_POS_EINT1 0x0400 /* IM_HP3R_SC_POS_EINT1 */ 5026 + #define ARIZONA_IM_HP3R_SC_POS_EINT1_MASK 0x0400 /* IM_HP3R_SC_POS_EINT1 */ 5027 + #define ARIZONA_IM_HP3R_SC_POS_EINT1_SHIFT 10 /* IM_HP3R_SC_POS_EINT1 */ 5028 + #define ARIZONA_IM_HP3R_SC_POS_EINT1_WIDTH 1 /* IM_HP3R_SC_POS_EINT1 */ 5029 + #define ARIZONA_IM_HP3L_SC_NEG_EINT1 0x0200 /* IM_HP3L_SC_NEG_EINT1 */ 5030 + #define ARIZONA_IM_HP3L_SC_NEG_EINT1_MASK 0x0200 /* IM_HP3L_SC_NEG_EINT1 */ 5031 + #define ARIZONA_IM_HP3L_SC_NEG_EINT1_SHIFT 9 /* IM_HP3L_SC_NEG_EINT1 */ 5032 + #define ARIZONA_IM_HP3L_SC_NEG_EINT1_WIDTH 1 /* IM_HP3L_SC_NEG_EINT1 */ 5033 + #define ARIZONA_IM_HP3L_SC_POS_EINT1 0x0100 /* IM_HP3L_SC_POS_EINT1 */ 5034 + #define ARIZONA_IM_HP3L_SC_POS_EINT1_MASK 0x0100 /* IM_HP3L_SC_POS_EINT1 */ 5035 + #define ARIZONA_IM_HP3L_SC_POS_EINT1_SHIFT 8 /* IM_HP3L_SC_POS_EINT1 */ 5036 + #define ARIZONA_IM_HP3L_SC_POS_EINT1_WIDTH 1 /* IM_HP3L_SC_POS_EINT1 */ 5037 + #define ARIZONA_IM_HP2R_SC_NEG_EINT1 0x0080 /* IM_HP2R_SC_NEG_EINT1 */ 5038 + #define ARIZONA_IM_HP2R_SC_NEG_EINT1_MASK 0x0080 /* IM_HP2R_SC_NEG_EINT1 */ 5039 + #define ARIZONA_IM_HP2R_SC_NEG_EINT1_SHIFT 7 /* IM_HP2R_SC_NEG_EINT1 */ 5040 + #define ARIZONA_IM_HP2R_SC_NEG_EINT1_WIDTH 1 /* IM_HP2R_SC_NEG_EINT1 */ 5041 + #define ARIZONA_IM_HP2R_SC_POS_EINT1 0x0040 /* IM_HP2R_SC_POS_EINT1 */ 5042 + #define ARIZONA_IM_HP2R_SC_POS_EINT1_MASK 0x0040 /* IM_HP2R_SC_POS_EINT1 */ 5043 + #define ARIZONA_IM_HP2R_SC_POS_EINT1_SHIFT 6 /* IM_HP2R_SC_POS_EINT1 */ 5044 + #define ARIZONA_IM_HP2R_SC_POS_EINT1_WIDTH 1 /* IM_HP2R_SC_POS_EINT1 */ 5045 + #define ARIZONA_IM_HP2L_SC_NEG_EINT1 0x0020 /* IM_HP2L_SC_NEG_EINT1 */ 5046 + #define ARIZONA_IM_HP2L_SC_NEG_EINT1_MASK 0x0020 /* IM_HP2L_SC_NEG_EINT1 */ 5047 + #define ARIZONA_IM_HP2L_SC_NEG_EINT1_SHIFT 5 /* IM_HP2L_SC_NEG_EINT1 */ 5048 + #define ARIZONA_IM_HP2L_SC_NEG_EINT1_WIDTH 1 /* IM_HP2L_SC_NEG_EINT1 */ 5049 + #define ARIZONA_IM_HP2L_SC_POS_EINT1 0x0010 /* IM_HP2L_SC_POS_EINT1 */ 5050 + #define ARIZONA_IM_HP2L_SC_POS_EINT1_MASK 0x0010 /* IM_HP2L_SC_POS_EINT1 */ 5051 + #define ARIZONA_IM_HP2L_SC_POS_EINT1_SHIFT 4 /* IM_HP2L_SC_POS_EINT1 */ 5052 + #define ARIZONA_IM_HP2L_SC_POS_EINT1_WIDTH 1 /* IM_HP2L_SC_POS_EINT1 */ 5053 + #define ARIZONA_IM_HP1R_SC_NEG_EINT1 0x0008 /* IM_HP1R_SC_NEG_EINT1 */ 5054 + #define ARIZONA_IM_HP1R_SC_NEG_EINT1_MASK 0x0008 /* IM_HP1R_SC_NEG_EINT1 */ 5055 + #define ARIZONA_IM_HP1R_SC_NEG_EINT1_SHIFT 3 /* IM_HP1R_SC_NEG_EINT1 */ 5056 + #define ARIZONA_IM_HP1R_SC_NEG_EINT1_WIDTH 1 /* IM_HP1R_SC_NEG_EINT1 */ 5057 + #define ARIZONA_IM_HP1R_SC_POS_EINT1 0x0004 /* IM_HP1R_SC_POS_EINT1 */ 5058 + #define ARIZONA_IM_HP1R_SC_POS_EINT1_MASK 0x0004 /* IM_HP1R_SC_POS_EINT1 */ 5059 + #define ARIZONA_IM_HP1R_SC_POS_EINT1_SHIFT 2 /* IM_HP1R_SC_POS_EINT1 */ 5060 + #define ARIZONA_IM_HP1R_SC_POS_EINT1_WIDTH 1 /* IM_HP1R_SC_POS_EINT1 */ 5061 + #define ARIZONA_IM_HP1L_SC_NEG_EINT1 0x0002 /* IM_HP1L_SC_NEG_EINT1 */ 5062 + #define ARIZONA_IM_HP1L_SC_NEG_EINT1_MASK 0x0002 /* IM_HP1L_SC_NEG_EINT1 */ 5063 + #define ARIZONA_IM_HP1L_SC_NEG_EINT1_SHIFT 1 /* IM_HP1L_SC_NEG_EINT1 */ 5064 + #define ARIZONA_IM_HP1L_SC_NEG_EINT1_WIDTH 1 /* IM_HP1L_SC_NEG_EINT1 */ 5065 + #define ARIZONA_IM_HP1L_SC_POS_EINT1 0x0001 /* IM_HP1L_SC_POS_EINT1 */ 5066 + #define ARIZONA_IM_HP1L_SC_POS_EINT1_MASK 0x0001 /* IM_HP1L_SC_POS_EINT1 */ 5067 + #define ARIZONA_IM_HP1L_SC_POS_EINT1_SHIFT 0 /* IM_HP1L_SC_POS_EINT1 */ 5068 + #define ARIZONA_IM_HP1L_SC_POS_EINT1_WIDTH 1 /* IM_HP1L_SC_POS_EINT1 */ 5216 5069 5217 5070 /* 5218 5071 * R3343 (0xD0F) - Interrupt Control ··· 5340 5035 /* 5341 5036 * R3346 (0xD12) - IRQ2 Status 3 5342 5037 */ 5343 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT2 0x8000 /* SPK_SHUTDOWN_WARN_EINT2 */ 5344 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_MASK 0x8000 /* SPK_SHUTDOWN_WARN_EINT2 */ 5345 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_SHIFT 15 /* SPK_SHUTDOWN_WARN_EINT2 */ 5346 - #define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_WIDTH 1 /* SPK_SHUTDOWN_WARN_EINT2 */ 5347 - #define ARIZONA_SPK_SHUTDOWN_EINT2 0x4000 /* SPK_SHUTDOWN_EINT2 */ 5348 - #define ARIZONA_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* SPK_SHUTDOWN_EINT2 */ 5349 - #define ARIZONA_SPK_SHUTDOWN_EINT2_SHIFT 14 /* SPK_SHUTDOWN_EINT2 */ 5350 - #define ARIZONA_SPK_SHUTDOWN_EINT2_WIDTH 1 /* SPK_SHUTDOWN_EINT2 */ 5038 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT2 0x8000 /* SPK_OVERHEAT_WARN_EINT2 */ 5039 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT2_MASK 0x8000 /* SPK_OVERHEAT_WARN_EINT2 */ 5040 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT2_SHIFT 15 /* SPK_OVERHEAT_WARN_EINT2 */ 5041 + #define ARIZONA_SPK_OVERHEAT_WARN_EINT2_WIDTH 1 /* SPK_OVERHEAT_WARN_EINT2 */ 5042 + #define ARIZONA_SPK_OVERHEAT_EINT2 0x4000 /* SPK_OVERHEAT_EINT2 */ 5043 + #define ARIZONA_SPK_OVERHEAT_EINT2_MASK 0x4000 /* SPK_OVERHEAT_EINT2 */ 5044 + #define ARIZONA_SPK_OVERHEAT_EINT2_SHIFT 14 /* SPK_OVERHEAT_EINT2 */ 5045 + #define ARIZONA_SPK_OVERHEAT_EINT2_WIDTH 1 /* SPK_OVERHEAT_EINT2 */ 5351 5046 #define ARIZONA_HPDET_EINT2 0x2000 /* HPDET_EINT2 */ 5352 5047 #define ARIZONA_HPDET_EINT2_MASK 0x2000 /* HPDET_EINT2 */ 5353 5048 #define ARIZONA_HPDET_EINT2_SHIFT 13 /* HPDET_EINT2 */ ··· 5444 5139 #define ARIZONA_ISRC2_CFG_ERR_EINT2_MASK 0x0040 /* ISRC2_CFG_ERR_EINT2 */ 5445 5140 #define ARIZONA_ISRC2_CFG_ERR_EINT2_SHIFT 6 /* ISRC2_CFG_ERR_EINT2 */ 5446 5141 #define ARIZONA_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* ISRC2_CFG_ERR_EINT2 */ 5142 + #define ARIZONA_HP3R_DONE_EINT2 0x0020 /* HP3R_DONE_EINT2 */ 5143 + #define ARIZONA_HP3R_DONE_EINT2_MASK 0x0020 /* HP3R_DONE_EINT2 */ 5144 + #define ARIZONA_HP3R_DONE_EINT2_SHIFT 5 /* HP3R_DONE_EINT2 */ 5145 + #define ARIZONA_HP3R_DONE_EINT2_WIDTH 1 /* HP3R_DONE_EINT2 */ 5146 + #define ARIZONA_HP3L_DONE_EINT2 0x0010 /* HP3L_DONE_EINT2 */ 5147 + #define ARIZONA_HP3L_DONE_EINT2_MASK 0x0010 /* HP3L_DONE_EINT2 */ 5148 + #define ARIZONA_HP3L_DONE_EINT2_SHIFT 4 /* HP3L_DONE_EINT2 */ 5149 + #define ARIZONA_HP3L_DONE_EINT2_WIDTH 1 /* HP3L_DONE_EINT2 */ 5150 + #define ARIZONA_HP2R_DONE_EINT2 0x0008 /* HP2R_DONE_EINT2 */ 5151 + #define ARIZONA_HP2R_DONE_EINT2_MASK 0x0008 /* HP2R_DONE_EINT2 */ 5152 + #define ARIZONA_HP2R_DONE_EINT2_SHIFT 3 /* HP2R_DONE_EINT2 */ 5153 + #define ARIZONA_HP2R_DONE_EINT2_WIDTH 1 /* HP2R_DONE_EINT2 */ 5154 + #define ARIZONA_HP2L_DONE_EINT2 0x0004 /* HP2L_DONE_EINT2 */ 5155 + #define ARIZONA_HP2L_DONE_EINT2_MASK 0x0004 /* HP2L_DONE_EINT2 */ 5156 + #define ARIZONA_HP2L_DONE_EINT2_SHIFT 2 /* HP2L_DONE_EINT2 */ 5157 + #define ARIZONA_HP2L_DONE_EINT2_WIDTH 1 /* HP2L_DONE_EINT2 */ 5158 + #define ARIZONA_HP1R_DONE_EINT2 0x0002 /* HP1R_DONE_EINT2 */ 5159 + #define ARIZONA_HP1R_DONE_EINT2_MASK 0x0002 /* HP1R_DONE_EINT2 */ 5160 + #define ARIZONA_HP1R_DONE_EINT2_SHIFT 1 /* HP1R_DONE_EINT2 */ 5161 + #define ARIZONA_HP1R_DONE_EINT2_WIDTH 1 /* HP1R_DONE_EINT2 */ 5162 + #define ARIZONA_HP1L_DONE_EINT2 0x0001 /* HP1L_DONE_EINT2 */ 5163 + #define ARIZONA_HP1L_DONE_EINT2_MASK 0x0001 /* HP1L_DONE_EINT2 */ 5164 + #define ARIZONA_HP1L_DONE_EINT2_SHIFT 0 /* HP1L_DONE_EINT2 */ 5165 + #define ARIZONA_HP1L_DONE_EINT2_WIDTH 1 /* HP1L_DONE_EINT2 */ 5166 + 5167 + /* 5168 + * R3347 (0xD13) - IRQ2 Status 4 (Alternate layout) 5169 + * 5170 + * Alternate layout used on later devices, note only fields that have moved 5171 + * are specified 5172 + */ 5173 + #define ARIZONA_V2_AIF3_ERR_EINT2 0x8000 /* AIF3_ERR_EINT2 */ 5174 + #define ARIZONA_V2_AIF3_ERR_EINT2_MASK 0x8000 /* AIF3_ERR_EINT2 */ 5175 + #define ARIZONA_V2_AIF3_ERR_EINT2_SHIFT 15 /* AIF3_ERR_EINT2 */ 5176 + #define ARIZONA_V2_AIF3_ERR_EINT2_WIDTH 1 /* AIF3_ERR_EINT2 */ 5177 + #define ARIZONA_V2_AIF2_ERR_EINT2 0x4000 /* AIF2_ERR_EINT2 */ 5178 + #define ARIZONA_V2_AIF2_ERR_EINT2_MASK 0x4000 /* AIF2_ERR_EINT2 */ 5179 + #define ARIZONA_V2_AIF2_ERR_EINT2_SHIFT 14 /* AIF2_ERR_EINT2 */ 5180 + #define ARIZONA_V2_AIF2_ERR_EINT2_WIDTH 1 /* AIF2_ERR_EINT2 */ 5181 + #define ARIZONA_V2_AIF1_ERR_EINT2 0x2000 /* AIF1_ERR_EINT2 */ 5182 + #define ARIZONA_V2_AIF1_ERR_EINT2_MASK 0x2000 /* AIF1_ERR_EINT2 */ 5183 + #define ARIZONA_V2_AIF1_ERR_EINT2_SHIFT 13 /* AIF1_ERR_EINT2 */ 5184 + #define ARIZONA_V2_AIF1_ERR_EINT2_WIDTH 1 /* AIF1_ERR_EINT2 */ 5185 + #define ARIZONA_V2_CTRLIF_ERR_EINT2 0x1000 /* CTRLIF_ERR_EINT2 */ 5186 + #define ARIZONA_V2_CTRLIF_ERR_EINT2_MASK 0x1000 /* CTRLIF_ERR_EINT2 */ 5187 + #define ARIZONA_V2_CTRLIF_ERR_EINT2_SHIFT 12 /* CTRLIF_ERR_EINT2 */ 5188 + #define ARIZONA_V2_CTRLIF_ERR_EINT2_WIDTH 1 /* CTRLIF_ERR_EINT2 */ 5189 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT2 0x0800 /* MIXER_DROPPED_SAMPLE_EINT2 */ 5190 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT2_MASK 0x0800 /* MIXER_DROPPED_SAMPLE_EINT2 */ 5191 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT2_SHIFT 11 /* MIXER_DROPPED_SAMPLE_EINT2 */ 5192 + #define ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT2_WIDTH 1 /* MIXER_DROPPED_SAMPLE_EINT2 */ 5193 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT2 0x0400 /* ASYNC_CLK_ENA_LOW_EINT2 */ 5194 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT2_MASK 0x0400 /* ASYNC_CLK_ENA_LOW_EINT2 */ 5195 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT2_SHIFT 10 /* ASYNC_CLK_ENA_LOW_EINT2 */ 5196 + #define ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT2_WIDTH 1 /* ASYNC_CLK_ENA_LOW_EINT2 */ 5197 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT2 0x0200 /* SYSCLK_ENA_LOW_EINT2 */ 5198 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT2_MASK 0x0200 /* SYSCLK_ENA_LOW_EINT2 */ 5199 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT2_SHIFT 9 /* SYSCLK_ENA_LOW_EINT2 */ 5200 + #define ARIZONA_V2_SYSCLK_ENA_LOW_EINT2_WIDTH 1 /* SYSCLK_ENA_LOW_EINT2 */ 5201 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT2 0x0100 /* ISRC1_CFG_ERR_EINT2 */ 5202 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT2_MASK 0x0100 /* ISRC1_CFG_ERR_EINT2 */ 5203 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT2_SHIFT 8 /* ISRC1_CFG_ERR_EINT2 */ 5204 + #define ARIZONA_V2_ISRC1_CFG_ERR_EINT2_WIDTH 1 /* ISRC1_CFG_ERR_EINT2 */ 5205 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT2 0x0080 /* ISRC2_CFG_ERR_EINT2 */ 5206 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT2_MASK 0x0080 /* ISRC2_CFG_ERR_EINT2 */ 5207 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT2_SHIFT 7 /* ISRC2_CFG_ERR_EINT2 */ 5208 + #define ARIZONA_V2_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* ISRC2_CFG_ERR_EINT2 */ 5209 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT2 0x0040 /* ISRC3_CFG_ERR_EINT2 */ 5210 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT2_MASK 0x0040 /* ISRC3_CFG_ERR_EINT2 */ 5211 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT2_SHIFT 6 /* ISRC3_CFG_ERR_EINT2 */ 5212 + #define ARIZONA_V2_ISRC3_CFG_ERR_EINT2_WIDTH 1 /* ISRC3_CFG_ERR_EINT2 */ 5447 5213 5448 5214 /* 5449 5215 * R3348 (0xD14) - IRQ2 Status 5 ··· 5539 5163 #define ARIZONA_FLL1_CLOCK_OK_EINT2_MASK 0x0001 /* FLL1_CLOCK_OK_EINT2 */ 5540 5164 #define ARIZONA_FLL1_CLOCK_OK_EINT2_SHIFT 0 /* FLL1_CLOCK_OK_EINT2 */ 5541 5165 #define ARIZONA_FLL1_CLOCK_OK_EINT2_WIDTH 1 /* FLL1_CLOCK_OK_EINT2 */ 5166 + 5167 + /* 5168 + * R3348 (0xD14) - IRQ2 Status 5 (Alternate layout) 5169 + * 5170 + * Alternate layout used on later devices, note only fields that have moved 5171 + * are specified 5172 + */ 5173 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT2 0x0008 /* ASRC_CFG_ERR_EINT2 */ 5174 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT2_MASK 0x0008 /* ASRC_CFG_ERR_EINT2 */ 5175 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT2_SHIFT 3 /* ASRC_CFG_ERR_EINT2 */ 5176 + #define ARIZONA_V2_ASRC_CFG_ERR_EINT2_WIDTH 1 /* ASRC_CFG_ERR_EINT2 */ 5177 + 5178 + /* 5179 + * R3349 (0xD15) - IRQ2 Status 6 5180 + */ 5181 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT2 0x8000 /* DSP_SHARED_WR_COLL_EINT2 */ 5182 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT2_MASK 0x8000 /* DSP_SHARED_WR_COLL_EINT2 */ 5183 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT2_SHIFT 15 /* DSP_SHARED_WR_COLL_EINT2 */ 5184 + #define ARIZONA_DSP_SHARED_WR_COLL_EINT2_WIDTH 1 /* DSP_SHARED_WR_COLL_EINT2 */ 5185 + #define ARIZONA_SPK_SHUTDOWN_EINT2 0x4000 /* SPK_SHUTDOWN_EINT2 */ 5186 + #define ARIZONA_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* SPK_SHUTDOWN_EINT2 */ 5187 + #define ARIZONA_SPK_SHUTDOWN_EINT2_SHIFT 14 /* SPK_SHUTDOWN_EINT2 */ 5188 + #define ARIZONA_SPK_SHUTDOWN_EINT2_WIDTH 1 /* SPK_SHUTDOWN_EINT2 */ 5189 + #define ARIZONA_SPK1R_SHORT_EINT2 0x2000 /* SPK1R_SHORT_EINT2 */ 5190 + #define ARIZONA_SPK1R_SHORT_EINT2_MASK 0x2000 /* SPK1R_SHORT_EINT2 */ 5191 + #define ARIZONA_SPK1R_SHORT_EINT2_SHIFT 13 /* SPK1R_SHORT_EINT2 */ 5192 + #define ARIZONA_SPK1R_SHORT_EINT2_WIDTH 1 /* SPK1R_SHORT_EINT2 */ 5193 + #define ARIZONA_SPK1L_SHORT_EINT2 0x1000 /* SPK1L_SHORT_EINT2 */ 5194 + #define ARIZONA_SPK1L_SHORT_EINT2_MASK 0x1000 /* SPK1L_SHORT_EINT2 */ 5195 + #define ARIZONA_SPK1L_SHORT_EINT2_SHIFT 12 /* SPK1L_SHORT_EINT2 */ 5196 + #define ARIZONA_SPK1L_SHORT_EINT2_WIDTH 1 /* SPK1L_SHORT_EINT2 */ 5197 + #define ARIZONA_HP3R_SC_NEG_EINT2 0x0800 /* HP3R_SC_NEG_EINT2 */ 5198 + #define ARIZONA_HP3R_SC_NEG_EINT2_MASK 0x0800 /* HP3R_SC_NEG_EINT2 */ 5199 + #define ARIZONA_HP3R_SC_NEG_EINT2_SHIFT 11 /* HP3R_SC_NEG_EINT2 */ 5200 + #define ARIZONA_HP3R_SC_NEG_EINT2_WIDTH 1 /* HP3R_SC_NEG_EINT2 */ 5201 + #define ARIZONA_HP3R_SC_POS_EINT2 0x0400 /* HP3R_SC_POS_EINT2 */ 5202 + #define ARIZONA_HP3R_SC_POS_EINT2_MASK 0x0400 /* HP3R_SC_POS_EINT2 */ 5203 + #define ARIZONA_HP3R_SC_POS_EINT2_SHIFT 10 /* HP3R_SC_POS_EINT2 */ 5204 + #define ARIZONA_HP3R_SC_POS_EINT2_WIDTH 1 /* HP3R_SC_POS_EINT2 */ 5205 + #define ARIZONA_HP3L_SC_NEG_EINT2 0x0200 /* HP3L_SC_NEG_EINT2 */ 5206 + #define ARIZONA_HP3L_SC_NEG_EINT2_MASK 0x0200 /* HP3L_SC_NEG_EINT2 */ 5207 + #define ARIZONA_HP3L_SC_NEG_EINT2_SHIFT 9 /* HP3L_SC_NEG_EINT2 */ 5208 + #define ARIZONA_HP3L_SC_NEG_EINT2_WIDTH 1 /* HP3L_SC_NEG_EINT2 */ 5209 + #define ARIZONA_HP3L_SC_POS_EINT2 0x0100 /* HP3L_SC_POS_EINT2 */ 5210 + #define ARIZONA_HP3L_SC_POS_EINT2_MASK 0x0100 /* HP3L_SC_POS_EINT2 */ 5211 + #define ARIZONA_HP3L_SC_POS_EINT2_SHIFT 8 /* HP3L_SC_POS_EINT2 */ 5212 + #define ARIZONA_HP3L_SC_POS_EINT2_WIDTH 1 /* HP3L_SC_POS_EINT2 */ 5213 + #define ARIZONA_HP2R_SC_NEG_EINT2 0x0080 /* HP2R_SC_NEG_EINT2 */ 5214 + #define ARIZONA_HP2R_SC_NEG_EINT2_MASK 0x0080 /* HP2R_SC_NEG_EINT2 */ 5215 + #define ARIZONA_HP2R_SC_NEG_EINT2_SHIFT 7 /* HP2R_SC_NEG_EINT2 */ 5216 + #define ARIZONA_HP2R_SC_NEG_EINT2_WIDTH 1 /* HP2R_SC_NEG_EINT2 */ 5217 + #define ARIZONA_HP2R_SC_POS_EINT2 0x0040 /* HP2R_SC_POS_EINT2 */ 5218 + #define ARIZONA_HP2R_SC_POS_EINT2_MASK 0x0040 /* HP2R_SC_POS_EINT2 */ 5219 + #define ARIZONA_HP2R_SC_POS_EINT2_SHIFT 6 /* HP2R_SC_POS_EINT2 */ 5220 + #define ARIZONA_HP2R_SC_POS_EINT2_WIDTH 1 /* HP2R_SC_POS_EINT2 */ 5221 + #define ARIZONA_HP2L_SC_NEG_EINT2 0x0020 /* HP2L_SC_NEG_EINT2 */ 5222 + #define ARIZONA_HP2L_SC_NEG_EINT2_MASK 0x0020 /* HP2L_SC_NEG_EINT2 */ 5223 + #define ARIZONA_HP2L_SC_NEG_EINT2_SHIFT 5 /* HP2L_SC_NEG_EINT2 */ 5224 + #define ARIZONA_HP2L_SC_NEG_EINT2_WIDTH 1 /* HP2L_SC_NEG_EINT2 */ 5225 + #define ARIZONA_HP2L_SC_POS_EINT2 0x0010 /* HP2L_SC_POS_EINT2 */ 5226 + #define ARIZONA_HP2L_SC_POS_EINT2_MASK 0x0010 /* HP2L_SC_POS_EINT2 */ 5227 + #define ARIZONA_HP2L_SC_POS_EINT2_SHIFT 4 /* HP2L_SC_POS_EINT2 */ 5228 + #define ARIZONA_HP2L_SC_POS_EINT2_WIDTH 1 /* HP2L_SC_POS_EINT2 */ 5229 + #define ARIZONA_HP1R_SC_NEG_EINT2 0x0008 /* HP1R_SC_NEG_EINT2 */ 5230 + #define ARIZONA_HP1R_SC_NEG_EINT2_MASK 0x0008 /* HP1R_SC_NEG_EINT2 */ 5231 + #define ARIZONA_HP1R_SC_NEG_EINT2_SHIFT 3 /* HP1R_SC_NEG_EINT2 */ 5232 + #define ARIZONA_HP1R_SC_NEG_EINT2_WIDTH 1 /* HP1R_SC_NEG_EINT2 */ 5233 + #define ARIZONA_HP1R_SC_POS_EINT2 0x0004 /* HP1R_SC_POS_EINT2 */ 5234 + #define ARIZONA_HP1R_SC_POS_EINT2_MASK 0x0004 /* HP1R_SC_POS_EINT2 */ 5235 + #define ARIZONA_HP1R_SC_POS_EINT2_SHIFT 2 /* HP1R_SC_POS_EINT2 */ 5236 + #define ARIZONA_HP1R_SC_POS_EINT2_WIDTH 1 /* HP1R_SC_POS_EINT2 */ 5237 + #define ARIZONA_HP1L_SC_NEG_EINT2 0x0002 /* HP1L_SC_NEG_EINT2 */ 5238 + #define ARIZONA_HP1L_SC_NEG_EINT2_MASK 0x0002 /* HP1L_SC_NEG_EINT2 */ 5239 + #define ARIZONA_HP1L_SC_NEG_EINT2_SHIFT 1 /* HP1L_SC_NEG_EINT2 */ 5240 + #define ARIZONA_HP1L_SC_NEG_EINT2_WIDTH 1 /* HP1L_SC_NEG_EINT2 */ 5241 + #define ARIZONA_HP1L_SC_POS_EINT2 0x0001 /* HP1L_SC_POS_EINT2 */ 5242 + #define ARIZONA_HP1L_SC_POS_EINT2_MASK 0x0001 /* HP1L_SC_POS_EINT2 */ 5243 + #define ARIZONA_HP1L_SC_POS_EINT2_SHIFT 0 /* HP1L_SC_POS_EINT2 */ 5244 + #define ARIZONA_HP1L_SC_POS_EINT2_WIDTH 1 /* HP1L_SC_POS_EINT2 */ 5542 5245 5543 5246 /* 5544 5247 * R3352 (0xD18) - IRQ2 Status 1 Mask ··· 5658 5203 /* 5659 5204 * R3354 (0xD1A) - IRQ2 Status 3 Mask 5660 5205 */ 5661 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT2 */ 5662 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_MASK 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT2 */ 5663 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_SHIFT 15 /* IM_SPK_SHUTDOWN_WARN_EINT2 */ 5664 - #define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_WIDTH 1 /* IM_SPK_SHUTDOWN_WARN_EINT2 */ 5665 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT2 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */ 5666 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */ 5667 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT2 */ 5668 - #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT2 */ 5206 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT2 0x8000 /* IM_SPK_OVERHEAT_WARN_EINT2 */ 5207 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT2_MASK 0x8000 /* IM_SPK_OVERHEAT_WARN_EINT2 */ 5208 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT2_SHIFT 15 /* IM_SPK_OVERHEAT_WARN_EINT2 */ 5209 + #define ARIZONA_IM_SPK_OVERHEAT_WARN_EINT2_WIDTH 1 /* IM_SPK_OVERHEAT_WARN_EINT2 */ 5210 + #define ARIZONA_IM_SPK_OVERHEAT_EINT2 0x4000 /* IM_SPK_OVERHEAT_EINT2 */ 5211 + #define ARIZONA_IM_SPK_OVERHEAT_EINT2_MASK 0x4000 /* IM_SPK_OVERHEAT_EINT2 */ 5212 + #define ARIZONA_IM_SPK_OVERHEAT_EINT2_SHIFT 14 /* IM_SPK_OVERHEAT_EINT2 */ 5213 + #define ARIZONA_IM_SPK_OVERHEAT_EINT2_WIDTH 1 /* IM_SPK_OVERHEAT_EINT2 */ 5669 5214 #define ARIZONA_IM_HPDET_EINT2 0x2000 /* IM_HPDET_EINT2 */ 5670 5215 #define ARIZONA_IM_HPDET_EINT2_MASK 0x2000 /* IM_HPDET_EINT2 */ 5671 5216 #define ARIZONA_IM_HPDET_EINT2_SHIFT 13 /* IM_HPDET_EINT2 */ ··· 5762 5307 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_MASK 0x0040 /* IM_ISRC2_CFG_ERR_EINT2 */ 5763 5308 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_SHIFT 6 /* IM_ISRC2_CFG_ERR_EINT2 */ 5764 5309 #define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT2 */ 5310 + #define ARIZONA_IM_HP3R_DONE_EINT2 0x0020 /* IM_HP3R_DONE_EINT2 */ 5311 + #define ARIZONA_IM_HP3R_DONE_EINT2_MASK 0x0020 /* IM_HP3R_DONE_EINT2 */ 5312 + #define ARIZONA_IM_HP3R_DONE_EINT2_SHIFT 5 /* IM_HP3R_DONE_EINT2 */ 5313 + #define ARIZONA_IM_HP3R_DONE_EINT2_WIDTH 1 /* IM_HP3R_DONE_EINT2 */ 5314 + #define ARIZONA_IM_HP3L_DONE_EINT2 0x0010 /* IM_HP3L_DONE_EINT2 */ 5315 + #define ARIZONA_IM_HP3L_DONE_EINT2_MASK 0x0010 /* IM_HP3L_DONE_EINT2 */ 5316 + #define ARIZONA_IM_HP3L_DONE_EINT2_SHIFT 4 /* IM_HP3L_DONE_EINT2 */ 5317 + #define ARIZONA_IM_HP3L_DONE_EINT2_WIDTH 1 /* IM_HP3L_DONE_EINT2 */ 5318 + #define ARIZONA_IM_HP2R_DONE_EINT2 0x0008 /* IM_HP2R_DONE_EINT2 */ 5319 + #define ARIZONA_IM_HP2R_DONE_EINT2_MASK 0x0008 /* IM_HP2R_DONE_EINT2 */ 5320 + #define ARIZONA_IM_HP2R_DONE_EINT2_SHIFT 3 /* IM_HP2R_DONE_EINT2 */ 5321 + #define ARIZONA_IM_HP2R_DONE_EINT2_WIDTH 1 /* IM_HP2R_DONE_EINT2 */ 5322 + #define ARIZONA_IM_HP2L_DONE_EINT2 0x0004 /* IM_HP2L_DONE_EINT2 */ 5323 + #define ARIZONA_IM_HP2L_DONE_EINT2_MASK 0x0004 /* IM_HP2L_DONE_EINT2 */ 5324 + #define ARIZONA_IM_HP2L_DONE_EINT2_SHIFT 2 /* IM_HP2L_DONE_EINT2 */ 5325 + #define ARIZONA_IM_HP2L_DONE_EINT2_WIDTH 1 /* IM_HP2L_DONE_EINT2 */ 5326 + #define ARIZONA_IM_HP1R_DONE_EINT2 0x0002 /* IM_HP1R_DONE_EINT2 */ 5327 + #define ARIZONA_IM_HP1R_DONE_EINT2_MASK 0x0002 /* IM_HP1R_DONE_EINT2 */ 5328 + #define ARIZONA_IM_HP1R_DONE_EINT2_SHIFT 1 /* IM_HP1R_DONE_EINT2 */ 5329 + #define ARIZONA_IM_HP1R_DONE_EINT2_WIDTH 1 /* IM_HP1R_DONE_EINT2 */ 5330 + #define ARIZONA_IM_HP1L_DONE_EINT2 0x0001 /* IM_HP1L_DONE_EINT2 */ 5331 + #define ARIZONA_IM_HP1L_DONE_EINT2_MASK 0x0001 /* IM_HP1L_DONE_EINT2 */ 5332 + #define ARIZONA_IM_HP1L_DONE_EINT2_SHIFT 0 /* IM_HP1L_DONE_EINT2 */ 5333 + #define ARIZONA_IM_HP1L_DONE_EINT2_WIDTH 1 /* IM_HP1L_DONE_EINT2 */ 5334 + 5335 + /* 5336 + * R3355 (0xD1B) - IRQ2 Status 4 Mask (Alternate layout) 5337 + * 5338 + * Alternate layout used on later devices, note only fields that have moved 5339 + * are specified 5340 + */ 5341 + #define ARIZONA_V2_IM_AIF3_ERR_EINT2 0x8000 /* IM_AIF3_ERR_EINT2 */ 5342 + #define ARIZONA_V2_IM_AIF3_ERR_EINT2_MASK 0x8000 /* IM_AIF3_ERR_EINT2 */ 5343 + #define ARIZONA_V2_IM_AIF3_ERR_EINT2_SHIFT 15 /* IM_AIF3_ERR_EINT2 */ 5344 + #define ARIZONA_V2_IM_AIF3_ERR_EINT2_WIDTH 1 /* IM_AIF3_ERR_EINT2 */ 5345 + #define ARIZONA_V2_IM_AIF2_ERR_EINT2 0x4000 /* IM_AIF2_ERR_EINT2 */ 5346 + #define ARIZONA_V2_IM_AIF2_ERR_EINT2_MASK 0x4000 /* IM_AIF2_ERR_EINT2 */ 5347 + #define ARIZONA_V2_IM_AIF2_ERR_EINT2_SHIFT 14 /* IM_AIF2_ERR_EINT2 */ 5348 + #define ARIZONA_V2_IM_AIF2_ERR_EINT2_WIDTH 1 /* IM_AIF2_ERR_EINT2 */ 5349 + #define ARIZONA_V2_IM_AIF1_ERR_EINT2 0x2000 /* IM_AIF1_ERR_EINT2 */ 5350 + #define ARIZONA_V2_IM_AIF1_ERR_EINT2_MASK 0x2000 /* IM_AIF1_ERR_EINT2 */ 5351 + #define ARIZONA_V2_IM_AIF1_ERR_EINT2_SHIFT 13 /* IM_AIF1_ERR_EINT2 */ 5352 + #define ARIZONA_V2_IM_AIF1_ERR_EINT2_WIDTH 1 /* IM_AIF1_ERR_EINT2 */ 5353 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT2 0x1000 /* IM_CTRLIF_ERR_EINT2 */ 5354 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT2_MASK 0x1000 /* IM_CTRLIF_ERR_EINT2 */ 5355 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT2_SHIFT 12 /* IM_CTRLIF_ERR_EINT2 */ 5356 + #define ARIZONA_V2_IM_CTRLIF_ERR_EINT2_WIDTH 1 /* IM_CTRLIF_ERR_EINT2 */ 5357 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT2 0x0800 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */ 5358 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT2_MASK 0x0800 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */ 5359 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT2_SHIFT 11 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */ 5360 + #define ARIZONA_V2_IM_MIXER_DROPPED_SAMPLE_EINT2_WIDTH 1 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */ 5361 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT2 0x0400 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */ 5362 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT2_MASK 0x0400 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */ 5363 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT2_SHIFT 10 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */ 5364 + #define ARIZONA_V2_IM_ASYNC_CLK_ENA_LOW_EINT2_WIDTH 1 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */ 5365 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT2 0x0200 /* IM_SYSCLK_ENA_LOW_EINT2 */ 5366 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT2_MASK 0x0200 /* IM_SYSCLK_ENA_LOW_EINT2 */ 5367 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT2_SHIFT 9 /* IM_SYSCLK_ENA_LOW_EINT2 */ 5368 + #define ARIZONA_V2_IM_SYSCLK_ENA_LOW_EINT2_WIDTH 1 /* IM_SYSCLK_ENA_LOW_EINT2 */ 5369 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT2 0x0100 /* IM_ISRC1_CFG_ERR_EINT2 */ 5370 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT2_MASK 0x0100 /* IM_ISRC1_CFG_ERR_EINT2 */ 5371 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT2_SHIFT 8 /* IM_ISRC1_CFG_ERR_EINT2 */ 5372 + #define ARIZONA_V2_IM_ISRC1_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC1_CFG_ERR_EINT2 */ 5373 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT2 0x0080 /* IM_ISRC2_CFG_ERR_EINT2 */ 5374 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT2_MASK 0x0080 /* IM_ISRC2_CFG_ERR_EINT2 */ 5375 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT2_SHIFT 7 /* IM_ISRC2_CFG_ERR_EINT2 */ 5376 + #define ARIZONA_V2_IM_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT2 */ 5377 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT2 0x0040 /* IM_ISRC3_CFG_ERR_EINT2 */ 5378 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT2_MASK 0x0040 /* IM_ISRC3_CFG_ERR_EINT2 */ 5379 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT2_SHIFT 6 /* IM_ISRC3_CFG_ERR_EINT2 */ 5380 + #define ARIZONA_V2_IM_ISRC3_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC3_CFG_ERR_EINT2 */ 5765 5381 5766 5382 /* 5767 5383 * R3356 (0xD1C) - IRQ2 Status 5 Mask ··· 5858 5332 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_MASK 0x0001 /* IM_FLL1_CLOCK_OK_EINT2 */ 5859 5333 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_SHIFT 0 /* IM_FLL1_CLOCK_OK_EINT2 */ 5860 5334 #define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_WIDTH 1 /* IM_FLL1_CLOCK_OK_EINT2 */ 5335 + 5336 + /* 5337 + * R3340 (0xD0C) - Interrupt Status 5 Mask (Alternate layout) 5338 + * 5339 + * Alternate layout used on later devices, note only fields that have moved 5340 + * are specified 5341 + */ 5342 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT2 0x0008 /* IM_ASRC_CFG_ERR_EINT2 */ 5343 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT2_MASK 0x0008 /* IM_ASRC_CFG_ERR_EINT2 */ 5344 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT2_SHIFT 3 /* IM_ASRC_CFG_ERR_EINT2 */ 5345 + #define ARIZONA_V2_IM_ASRC_CFG_ERR_EINT2_WIDTH 1 /* IM_ASRC_CFG_ERR_EINT2 */ 5346 + 5347 + /* 5348 + * R3357 (0xD1D) - IRQ2 Status 6 Mask 5349 + */ 5350 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT2 0x8000 /* IM_DSP_SHARED_WR_COLL_EINT2 */ 5351 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT2_MASK 0x8000 /* IM_DSP_SHARED_WR_COLL_EINT2 */ 5352 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT2_SHIFT 15 /* IM_DSP_SHARED_WR_COLL_EINT2 */ 5353 + #define ARIZONA_IM_DSP_SHARED_WR_COLL_EINT2_WIDTH 1 /* IM_DSP_SHARED_WR_COLL_EINT2 */ 5354 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT2 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */ 5355 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */ 5356 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT2 */ 5357 + #define ARIZONA_IM_SPK_SHUTDOWN_EINT2_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT2 */ 5358 + #define ARIZONA_IM_SPK1R_SHORT_EINT2 0x2000 /* IM_SPK1R_SHORT_EINT2 */ 5359 + #define ARIZONA_IM_SPK1R_SHORT_EINT2_MASK 0x2000 /* IM_SPK1R_SHORT_EINT2 */ 5360 + #define ARIZONA_IM_SPK1R_SHORT_EINT2_SHIFT 13 /* IM_SPK1R_SHORT_EINT2 */ 5361 + #define ARIZONA_IM_SPK1R_SHORT_EINT2_WIDTH 1 /* IM_SPK1R_SHORT_EINT2 */ 5362 + #define ARIZONA_IM_SPK1L_SHORT_EINT2 0x1000 /* IM_SPK1L_SHORT_EINT2 */ 5363 + #define ARIZONA_IM_SPK1L_SHORT_EINT2_MASK 0x1000 /* IM_SPK1L_SHORT_EINT2 */ 5364 + #define ARIZONA_IM_SPK1L_SHORT_EINT2_SHIFT 12 /* IM_SPK1L_SHORT_EINT2 */ 5365 + #define ARIZONA_IM_SPK1L_SHORT_EINT2_WIDTH 1 /* IM_SPK1L_SHORT_EINT2 */ 5366 + #define ARIZONA_IM_HP3R_SC_NEG_EINT2 0x0800 /* IM_HP3R_SC_NEG_EINT2 */ 5367 + #define ARIZONA_IM_HP3R_SC_NEG_EINT2_MASK 0x0800 /* IM_HP3R_SC_NEG_EINT2 */ 5368 + #define ARIZONA_IM_HP3R_SC_NEG_EINT2_SHIFT 11 /* IM_HP3R_SC_NEG_EINT2 */ 5369 + #define ARIZONA_IM_HP3R_SC_NEG_EINT2_WIDTH 1 /* IM_HP3R_SC_NEG_EINT2 */ 5370 + #define ARIZONA_IM_HP3R_SC_POS_EINT2 0x0400 /* IM_HP3R_SC_POS_EINT2 */ 5371 + #define ARIZONA_IM_HP3R_SC_POS_EINT2_MASK 0x0400 /* IM_HP3R_SC_POS_EINT2 */ 5372 + #define ARIZONA_IM_HP3R_SC_POS_EINT2_SHIFT 10 /* IM_HP3R_SC_POS_EINT2 */ 5373 + #define ARIZONA_IM_HP3R_SC_POS_EINT2_WIDTH 1 /* IM_HP3R_SC_POS_EINT2 */ 5374 + #define ARIZONA_IM_HP3L_SC_NEG_EINT2 0x0200 /* IM_HP3L_SC_NEG_EINT2 */ 5375 + #define ARIZONA_IM_HP3L_SC_NEG_EINT2_MASK 0x0200 /* IM_HP3L_SC_NEG_EINT2 */ 5376 + #define ARIZONA_IM_HP3L_SC_NEG_EINT2_SHIFT 9 /* IM_HP3L_SC_NEG_EINT2 */ 5377 + #define ARIZONA_IM_HP3L_SC_NEG_EINT2_WIDTH 1 /* IM_HP3L_SC_NEG_EINT2 */ 5378 + #define ARIZONA_IM_HP3L_SC_POS_EINT2 0x0100 /* IM_HP3L_SC_POS_EINT2 */ 5379 + #define ARIZONA_IM_HP3L_SC_POS_EINT2_MASK 0x0100 /* IM_HP3L_SC_POS_EINT2 */ 5380 + #define ARIZONA_IM_HP3L_SC_POS_EINT2_SHIFT 8 /* IM_HP3L_SC_POS_EINT2 */ 5381 + #define ARIZONA_IM_HP3L_SC_POS_EINT2_WIDTH 1 /* IM_HP3L_SC_POS_EINT2 */ 5382 + #define ARIZONA_IM_HP2R_SC_NEG_EINT2 0x0080 /* IM_HP2R_SC_NEG_EINT2 */ 5383 + #define ARIZONA_IM_HP2R_SC_NEG_EINT2_MASK 0x0080 /* IM_HP2R_SC_NEG_EINT2 */ 5384 + #define ARIZONA_IM_HP2R_SC_NEG_EINT2_SHIFT 7 /* IM_HP2R_SC_NEG_EINT2 */ 5385 + #define ARIZONA_IM_HP2R_SC_NEG_EINT2_WIDTH 1 /* IM_HP2R_SC_NEG_EINT2 */ 5386 + #define ARIZONA_IM_HP2R_SC_POS_EINT2 0x0040 /* IM_HP2R_SC_POS_EINT2 */ 5387 + #define ARIZONA_IM_HP2R_SC_POS_EINT2_MASK 0x0040 /* IM_HP2R_SC_POS_EINT2 */ 5388 + #define ARIZONA_IM_HP2R_SC_POS_EINT2_SHIFT 6 /* IM_HP2R_SC_POS_EINT2 */ 5389 + #define ARIZONA_IM_HP2R_SC_POS_EINT2_WIDTH 1 /* IM_HP2R_SC_POS_EINT2 */ 5390 + #define ARIZONA_IM_HP2L_SC_NEG_EINT2 0x0020 /* IM_HP2L_SC_NEG_EINT2 */ 5391 + #define ARIZONA_IM_HP2L_SC_NEG_EINT2_MASK 0x0020 /* IM_HP2L_SC_NEG_EINT2 */ 5392 + #define ARIZONA_IM_HP2L_SC_NEG_EINT2_SHIFT 5 /* IM_HP2L_SC_NEG_EINT2 */ 5393 + #define ARIZONA_IM_HP2L_SC_NEG_EINT2_WIDTH 1 /* IM_HP2L_SC_NEG_EINT2 */ 5394 + #define ARIZONA_IM_HP2L_SC_POS_EINT2 0x0010 /* IM_HP2L_SC_POS_EINT2 */ 5395 + #define ARIZONA_IM_HP2L_SC_POS_EINT2_MASK 0x0010 /* IM_HP2L_SC_POS_EINT2 */ 5396 + #define ARIZONA_IM_HP2L_SC_POS_EINT2_SHIFT 4 /* IM_HP2L_SC_POS_EINT2 */ 5397 + #define ARIZONA_IM_HP2L_SC_POS_EINT2_WIDTH 1 /* IM_HP2L_SC_POS_EINT2 */ 5398 + #define ARIZONA_IM_HP1R_SC_NEG_EINT2 0x0008 /* IM_HP1R_SC_NEG_EINT2 */ 5399 + #define ARIZONA_IM_HP1R_SC_NEG_EINT2_MASK 0x0008 /* IM_HP1R_SC_NEG_EINT2 */ 5400 + #define ARIZONA_IM_HP1R_SC_NEG_EINT2_SHIFT 3 /* IM_HP1R_SC_NEG_EINT2 */ 5401 + #define ARIZONA_IM_HP1R_SC_NEG_EINT2_WIDTH 1 /* IM_HP1R_SC_NEG_EINT2 */ 5402 + #define ARIZONA_IM_HP1R_SC_POS_EINT2 0x0004 /* IM_HP1R_SC_POS_EINT2 */ 5403 + #define ARIZONA_IM_HP1R_SC_POS_EINT2_MASK 0x0004 /* IM_HP1R_SC_POS_EINT2 */ 5404 + #define ARIZONA_IM_HP1R_SC_POS_EINT2_SHIFT 2 /* IM_HP1R_SC_POS_EINT2 */ 5405 + #define ARIZONA_IM_HP1R_SC_POS_EINT2_WIDTH 1 /* IM_HP1R_SC_POS_EINT2 */ 5406 + #define ARIZONA_IM_HP1L_SC_NEG_EINT2 0x0002 /* IM_HP1L_SC_NEG_EINT2 */ 5407 + #define ARIZONA_IM_HP1L_SC_NEG_EINT2_MASK 0x0002 /* IM_HP1L_SC_NEG_EINT2 */ 5408 + #define ARIZONA_IM_HP1L_SC_NEG_EINT2_SHIFT 1 /* IM_HP1L_SC_NEG_EINT2 */ 5409 + #define ARIZONA_IM_HP1L_SC_NEG_EINT2_WIDTH 1 /* IM_HP1L_SC_NEG_EINT2 */ 5410 + #define ARIZONA_IM_HP1L_SC_POS_EINT2 0x0001 /* IM_HP1L_SC_POS_EINT2 */ 5411 + #define ARIZONA_IM_HP1L_SC_POS_EINT2_MASK 0x0001 /* IM_HP1L_SC_POS_EINT2 */ 5412 + #define ARIZONA_IM_HP1L_SC_POS_EINT2_SHIFT 0 /* IM_HP1L_SC_POS_EINT2 */ 5413 + #define ARIZONA_IM_HP1L_SC_POS_EINT2_WIDTH 1 /* IM_HP1L_SC_POS_EINT2 */ 5861 5414 5862 5415 /* 5863 5416 * R3359 (0xD1F) - IRQ2 Control ··· 5965 5360 /* 5966 5361 * R3361 (0xD21) - Interrupt Raw Status 3 5967 5362 */ 5968 - #define ARIZONA_SPK_SHUTDOWN_WARN_STS 0x8000 /* SPK_SHUTDOWN_WARN_STS */ 5969 - #define ARIZONA_SPK_SHUTDOWN_WARN_STS_MASK 0x8000 /* SPK_SHUTDOWN_WARN_STS */ 5970 - #define ARIZONA_SPK_SHUTDOWN_WARN_STS_SHIFT 15 /* SPK_SHUTDOWN_WARN_STS */ 5971 - #define ARIZONA_SPK_SHUTDOWN_WARN_STS_WIDTH 1 /* SPK_SHUTDOWN_WARN_STS */ 5972 - #define ARIZONA_SPK_SHUTDOWN_STS 0x4000 /* SPK_SHUTDOWN_STS */ 5973 - #define ARIZONA_SPK_SHUTDOWN_STS_MASK 0x4000 /* SPK_SHUTDOWN_STS */ 5974 - #define ARIZONA_SPK_SHUTDOWN_STS_SHIFT 14 /* SPK_SHUTDOWN_STS */ 5975 - #define ARIZONA_SPK_SHUTDOWN_STS_WIDTH 1 /* SPK_SHUTDOWN_STS */ 5363 + #define ARIZONA_SPK_OVERHEAT_WARN_STS 0x8000 /* SPK_OVERHEAT_WARN_STS */ 5364 + #define ARIZONA_SPK_OVERHEAT_WARN_STS_MASK 0x8000 /* SPK_OVERHEAT_WARN_STS */ 5365 + #define ARIZONA_SPK_OVERHEAT_WARN_STS_SHIFT 15 /* SPK_OVERHEAT_WARN_STS */ 5366 + #define ARIZONA_SPK_OVERHEAT_WARN_STS_WIDTH 1 /* SPK_OVERHEAT_WARN_STS */ 5367 + #define ARIZONA_SPK_OVERHEAT_STS 0x4000 /* SPK_OVERHEAT_STS */ 5368 + #define ARIZONA_SPK_OVERHEAT_STS_MASK 0x4000 /* SPK_OVERHEAT_STS */ 5369 + #define ARIZONA_SPK_OVERHEAT_STS_SHIFT 14 /* SPK_OVERHEAT_STS */ 5370 + #define ARIZONA_SPK_OVERHEAT_STS_WIDTH 1 /* SPK_OVERHEAT_STS */ 5976 5371 #define ARIZONA_HPDET_STS 0x2000 /* HPDET_STS */ 5977 5372 #define ARIZONA_HPDET_STS_MASK 0x2000 /* HPDET_STS */ 5978 5373 #define ARIZONA_HPDET_STS_SHIFT 13 /* HPDET_STS */ ··· 6069 5464 #define ARIZONA_ISRC2_CFG_ERR_STS_MASK 0x0040 /* ISRC2_CFG_ERR_STS */ 6070 5465 #define ARIZONA_ISRC2_CFG_ERR_STS_SHIFT 6 /* ISRC2_CFG_ERR_STS */ 6071 5466 #define ARIZONA_ISRC2_CFG_ERR_STS_WIDTH 1 /* ISRC2_CFG_ERR_STS */ 5467 + #define ARIZONA_HP3R_DONE_STS 0x0020 /* HP3R_DONE_STS */ 5468 + #define ARIZONA_HP3R_DONE_STS_MASK 0x0020 /* HP3R_DONE_STS */ 5469 + #define ARIZONA_HP3R_DONE_STS_SHIFT 5 /* HP3R_DONE_STS */ 5470 + #define ARIZONA_HP3R_DONE_STS_WIDTH 1 /* HP3R_DONE_STS */ 5471 + #define ARIZONA_HP3L_DONE_STS 0x0010 /* HP3L_DONE_STS */ 5472 + #define ARIZONA_HP3L_DONE_STS_MASK 0x0010 /* HP3L_DONE_STS */ 5473 + #define ARIZONA_HP3L_DONE_STS_SHIFT 4 /* HP3L_DONE_STS */ 5474 + #define ARIZONA_HP3L_DONE_STS_WIDTH 1 /* HP3L_DONE_STS */ 5475 + #define ARIZONA_HP2R_DONE_STS 0x0008 /* HP2R_DONE_STS */ 5476 + #define ARIZONA_HP2R_DONE_STS_MASK 0x0008 /* HP2R_DONE_STS */ 5477 + #define ARIZONA_HP2R_DONE_STS_SHIFT 3 /* HP2R_DONE_STS */ 5478 + #define ARIZONA_HP2R_DONE_STS_WIDTH 1 /* HP2R_DONE_STS */ 5479 + #define ARIZONA_HP2L_DONE_STS 0x0004 /* HP2L_DONE_STS */ 5480 + #define ARIZONA_HP2L_DONE_STS_MASK 0x0004 /* HP2L_DONE_STS */ 5481 + #define ARIZONA_HP2L_DONE_STS_SHIFT 2 /* HP2L_DONE_STS */ 5482 + #define ARIZONA_HP2L_DONE_STS_WIDTH 1 /* HP2L_DONE_STS */ 5483 + #define ARIZONA_HP1R_DONE_STS 0x0002 /* HP1R_DONE_STS */ 5484 + #define ARIZONA_HP1R_DONE_STS_MASK 0x0002 /* HP1R_DONE_STS */ 5485 + #define ARIZONA_HP1R_DONE_STS_SHIFT 1 /* HP1R_DONE_STS */ 5486 + #define ARIZONA_HP1R_DONE_STS_WIDTH 1 /* HP1R_DONE_STS */ 5487 + #define ARIZONA_HP1L_DONE_STS 0x0001 /* HP1L_DONE_STS */ 5488 + #define ARIZONA_HP1L_DONE_STS_MASK 0x0001 /* HP1L_DONE_STS */ 5489 + #define ARIZONA_HP1L_DONE_STS_SHIFT 0 /* HP1L_DONE_STS */ 5490 + #define ARIZONA_HP1L_DONE_STS_WIDTH 1 /* HP1L_DONE_STS */ 6072 5491 6073 5492 /* 6074 5493 * R3363 (0xD23) - Interrupt Raw Status 5 ··· 6209 5580 #define ARIZONA_ADSP2_1_OVERCLOCKED_STS_MASK 0x0008 /* ADSP2_1_OVERCLOCKED_STS */ 6210 5581 #define ARIZONA_ADSP2_1_OVERCLOCKED_STS_SHIFT 3 /* ADSP2_1_OVERCLOCKED_STS */ 6211 5582 #define ARIZONA_ADSP2_1_OVERCLOCKED_STS_WIDTH 1 /* ADSP2_1_OVERCLOCKED_STS */ 5583 + #define ARIZONA_ISRC3_OVERCLOCKED_STS 0x0004 /* ISRC3_OVERCLOCKED_STS */ 5584 + #define ARIZONA_ISRC3_OVERCLOCKED_STS_MASK 0x0004 /* ISRC3_OVERCLOCKED_STS */ 5585 + #define ARIZONA_ISRC3_OVERCLOCKED_STS_SHIFT 2 /* ISRC3_OVERCLOCKED_STS */ 5586 + #define ARIZONA_ISRC3_OVERCLOCKED_STS_WIDTH 1 /* ISRC3_OVERCLOCKED_STS */ 6212 5587 #define ARIZONA_ISRC2_OVERCLOCKED_STS 0x0002 /* ISRC2_OVERCLOCKED_STS */ 6213 5588 #define ARIZONA_ISRC2_OVERCLOCKED_STS_MASK 0x0002 /* ISRC2_OVERCLOCKED_STS */ 6214 5589 #define ARIZONA_ISRC2_OVERCLOCKED_STS_SHIFT 1 /* ISRC2_OVERCLOCKED_STS */ ··· 6237 5604 #define ARIZONA_AIF1_UNDERCLOCKED_STS_MASK 0x0100 /* AIF1_UNDERCLOCKED_STS */ 6238 5605 #define ARIZONA_AIF1_UNDERCLOCKED_STS_SHIFT 8 /* AIF1_UNDERCLOCKED_STS */ 6239 5606 #define ARIZONA_AIF1_UNDERCLOCKED_STS_WIDTH 1 /* AIF1_UNDERCLOCKED_STS */ 5607 + #define ARIZONA_ISRC3_UNDERCLOCKED_STS 0x0080 /* ISRC3_UNDERCLOCKED_STS */ 5608 + #define ARIZONA_ISRC3_UNDERCLOCKED_STS_MASK 0x0080 /* ISRC3_UNDERCLOCKED_STS */ 5609 + #define ARIZONA_ISRC3_UNDERCLOCKED_STS_SHIFT 7 /* ISRC3_UNDERCLOCKED_STS */ 5610 + #define ARIZONA_ISRC3_UNDERCLOCKED_STS_WIDTH 1 /* ISRC3_UNDERCLOCKED_STS */ 6240 5611 #define ARIZONA_ISRC2_UNDERCLOCKED_STS 0x0040 /* ISRC2_UNDERCLOCKED_STS */ 6241 5612 #define ARIZONA_ISRC2_UNDERCLOCKED_STS_MASK 0x0040 /* ISRC2_UNDERCLOCKED_STS */ 6242 5613 #define ARIZONA_ISRC2_UNDERCLOCKED_STS_SHIFT 6 /* ISRC2_UNDERCLOCKED_STS */ ··· 6269 5632 #define ARIZONA_MIXER_UNDERCLOCKED_STS_MASK 0x0001 /* MIXER_UNDERCLOCKED_STS */ 6270 5633 #define ARIZONA_MIXER_UNDERCLOCKED_STS_SHIFT 0 /* MIXER_UNDERCLOCKED_STS */ 6271 5634 #define ARIZONA_MIXER_UNDERCLOCKED_STS_WIDTH 1 /* MIXER_UNDERCLOCKED_STS */ 5635 + 5636 + /* 5637 + * R3368 (0xD28) - Interrupt Raw Status 9 5638 + */ 5639 + #define ARIZONA_DSP_SHARED_WR_COLL_STS 0x8000 /* DSP_SHARED_WR_COLL_STS */ 5640 + #define ARIZONA_DSP_SHARED_WR_COLL_STS_MASK 0x8000 /* DSP_SHARED_WR_COLL_STS */ 5641 + #define ARIZONA_DSP_SHARED_WR_COLL_STS_SHIFT 15 /* DSP_SHARED_WR_COLL_STS */ 5642 + #define ARIZONA_DSP_SHARED_WR_COLL_STS_WIDTH 1 /* DSP_SHARED_WR_COLL_STS */ 5643 + #define ARIZONA_SPK_SHUTDOWN_STS 0x4000 /* SPK_SHUTDOWN_STS */ 5644 + #define ARIZONA_SPK_SHUTDOWN_STS_MASK 0x4000 /* SPK_SHUTDOWN_STS */ 5645 + #define ARIZONA_SPK_SHUTDOWN_STS_SHIFT 14 /* SPK_SHUTDOWN_STS */ 5646 + #define ARIZONA_SPK_SHUTDOWN_STS_WIDTH 1 /* SPK_SHUTDOWN_STS */ 5647 + #define ARIZONA_SPK1R_SHORT_STS 0x2000 /* SPK1R_SHORT_STS */ 5648 + #define ARIZONA_SPK1R_SHORT_STS_MASK 0x2000 /* SPK1R_SHORT_STS */ 5649 + #define ARIZONA_SPK1R_SHORT_STS_SHIFT 13 /* SPK1R_SHORT_STS */ 5650 + #define ARIZONA_SPK1R_SHORT_STS_WIDTH 1 /* SPK1R_SHORT_STS */ 5651 + #define ARIZONA_SPK1L_SHORT_STS 0x1000 /* SPK1L_SHORT_STS */ 5652 + #define ARIZONA_SPK1L_SHORT_STS_MASK 0x1000 /* SPK1L_SHORT_STS */ 5653 + #define ARIZONA_SPK1L_SHORT_STS_SHIFT 12 /* SPK1L_SHORT_STS */ 5654 + #define ARIZONA_SPK1L_SHORT_STS_WIDTH 1 /* SPK1L_SHORT_STS */ 5655 + #define ARIZONA_HP3R_SC_NEG_STS 0x0800 /* HP3R_SC_NEG_STS */ 5656 + #define ARIZONA_HP3R_SC_NEG_STS_MASK 0x0800 /* HP3R_SC_NEG_STS */ 5657 + #define ARIZONA_HP3R_SC_NEG_STS_SHIFT 11 /* HP3R_SC_NEG_STS */ 5658 + #define ARIZONA_HP3R_SC_NEG_STS_WIDTH 1 /* HP3R_SC_NEG_STS */ 5659 + #define ARIZONA_HP3R_SC_POS_STS 0x0400 /* HP3R_SC_POS_STS */ 5660 + #define ARIZONA_HP3R_SC_POS_STS_MASK 0x0400 /* HP3R_SC_POS_STS */ 5661 + #define ARIZONA_HP3R_SC_POS_STS_SHIFT 10 /* HP3R_SC_POS_STS */ 5662 + #define ARIZONA_HP3R_SC_POS_STS_WIDTH 1 /* HP3R_SC_POS_STS */ 5663 + #define ARIZONA_HP3L_SC_NEG_STS 0x0200 /* HP3L_SC_NEG_STS */ 5664 + #define ARIZONA_HP3L_SC_NEG_STS_MASK 0x0200 /* HP3L_SC_NEG_STS */ 5665 + #define ARIZONA_HP3L_SC_NEG_STS_SHIFT 9 /* HP3L_SC_NEG_STS */ 5666 + #define ARIZONA_HP3L_SC_NEG_STS_WIDTH 1 /* HP3L_SC_NEG_STS */ 5667 + #define ARIZONA_HP3L_SC_POS_STS 0x0100 /* HP3L_SC_POS_STS */ 5668 + #define ARIZONA_HP3L_SC_POS_STS_MASK 0x0100 /* HP3L_SC_POS_STS */ 5669 + #define ARIZONA_HP3L_SC_POS_STS_SHIFT 8 /* HP3L_SC_POS_STS */ 5670 + #define ARIZONA_HP3L_SC_POS_STS_WIDTH 1 /* HP3L_SC_POS_STS */ 5671 + #define ARIZONA_HP2R_SC_NEG_STS 0x0080 /* HP2R_SC_NEG_STS */ 5672 + #define ARIZONA_HP2R_SC_NEG_STS_MASK 0x0080 /* HP2R_SC_NEG_STS */ 5673 + #define ARIZONA_HP2R_SC_NEG_STS_SHIFT 7 /* HP2R_SC_NEG_STS */ 5674 + #define ARIZONA_HP2R_SC_NEG_STS_WIDTH 1 /* HP2R_SC_NEG_STS */ 5675 + #define ARIZONA_HP2R_SC_POS_STS 0x0040 /* HP2R_SC_POS_STS */ 5676 + #define ARIZONA_HP2R_SC_POS_STS_MASK 0x0040 /* HP2R_SC_POS_STS */ 5677 + #define ARIZONA_HP2R_SC_POS_STS_SHIFT 6 /* HP2R_SC_POS_STS */ 5678 + #define ARIZONA_HP2R_SC_POS_STS_WIDTH 1 /* HP2R_SC_POS_STS */ 5679 + #define ARIZONA_HP2L_SC_NEG_STS 0x0020 /* HP2L_SC_NEG_STS */ 5680 + #define ARIZONA_HP2L_SC_NEG_STS_MASK 0x0020 /* HP2L_SC_NEG_STS */ 5681 + #define ARIZONA_HP2L_SC_NEG_STS_SHIFT 5 /* HP2L_SC_NEG_STS */ 5682 + #define ARIZONA_HP2L_SC_NEG_STS_WIDTH 1 /* HP2L_SC_NEG_STS */ 5683 + #define ARIZONA_HP2L_SC_POS_STS 0x0010 /* HP2L_SC_POS_STS */ 5684 + #define ARIZONA_HP2L_SC_POS_STS_MASK 0x0010 /* HP2L_SC_POS_STS */ 5685 + #define ARIZONA_HP2L_SC_POS_STS_SHIFT 4 /* HP2L_SC_POS_STS */ 5686 + #define ARIZONA_HP2L_SC_POS_STS_WIDTH 1 /* HP2L_SC_POS_STS */ 5687 + #define ARIZONA_HP1R_SC_NEG_STS 0x0008 /* HP1R_SC_NEG_STS */ 5688 + #define ARIZONA_HP1R_SC_NEG_STS_MASK 0x0008 /* HP1R_SC_NEG_STS */ 5689 + #define ARIZONA_HP1R_SC_NEG_STS_SHIFT 3 /* HP1R_SC_NEG_STS */ 5690 + #define ARIZONA_HP1R_SC_NEG_STS_WIDTH 1 /* HP1R_SC_NEG_STS */ 5691 + #define ARIZONA_HP1R_SC_POS_STS 0x0004 /* HP1R_SC_POS_STS */ 5692 + #define ARIZONA_HP1R_SC_POS_STS_MASK 0x0004 /* HP1R_SC_POS_STS */ 5693 + #define ARIZONA_HP1R_SC_POS_STS_SHIFT 2 /* HP1R_SC_POS_STS */ 5694 + #define ARIZONA_HP1R_SC_POS_STS_WIDTH 1 /* HP1R_SC_POS_STS */ 5695 + #define ARIZONA_HP1L_SC_NEG_STS 0x0002 /* HP1L_SC_NEG_STS */ 5696 + #define ARIZONA_HP1L_SC_NEG_STS_MASK 0x0002 /* HP1L_SC_NEG_STS */ 5697 + #define ARIZONA_HP1L_SC_NEG_STS_SHIFT 1 /* HP1L_SC_NEG_STS */ 5698 + #define ARIZONA_HP1L_SC_NEG_STS_WIDTH 1 /* HP1L_SC_NEG_STS */ 5699 + #define ARIZONA_HP1L_SC_POS_STS 0x0001 /* HP1L_SC_POS_STS */ 5700 + #define ARIZONA_HP1L_SC_POS_STS_MASK 0x0001 /* HP1L_SC_POS_STS */ 5701 + #define ARIZONA_HP1L_SC_POS_STS_SHIFT 0 /* HP1L_SC_POS_STS */ 5702 + #define ARIZONA_HP1L_SC_POS_STS_WIDTH 1 /* HP1L_SC_POS_STS */ 6272 5703 6273 5704 /* 6274 5705 * R3392 (0xD40) - IRQ Pin Status
+58 -52
include/linux/mfd/cros_ec.h
··· 16 16 #ifndef __LINUX_MFD_CROS_EC_H 17 17 #define __LINUX_MFD_CROS_EC_H 18 18 19 + #include <linux/notifier.h> 19 20 #include <linux/mfd/cros_ec_commands.h> 21 + #include <linux/mutex.h> 20 22 21 23 /* 22 24 * Command interface between EC and AP, for LPC, I2C and SPI interfaces. ··· 35 33 EC_MSG_TX_PROTO_BYTES, 36 34 }; 37 35 38 - /** 39 - * struct cros_ec_msg - A message sent to the EC, and its reply 40 - * 36 + /* 41 37 * @version: Command version number (often 0) 42 - * @cmd: Command to send (EC_CMD_...) 43 - * @out_buf: Outgoing payload (to EC) 44 - * @outlen: Outgoing length 45 - * @in_buf: Incoming payload (from EC) 46 - * @in_len: Incoming length 38 + * @command: Command to send (EC_CMD_...) 39 + * @outdata: Outgoing data to EC 40 + * @outsize: Outgoing length in bytes 41 + * @indata: Where to put the incoming data from EC 42 + * @insize: Max number of bytes to accept from EC 43 + * @result: EC's response to the command (separate from communication failure) 47 44 */ 48 - struct cros_ec_msg { 49 - u8 version; 50 - u8 cmd; 51 - uint8_t *out_buf; 52 - int out_len; 53 - uint8_t *in_buf; 54 - int in_len; 45 + struct cros_ec_command { 46 + uint32_t version; 47 + uint32_t command; 48 + uint8_t *outdata; 49 + uint32_t outsize; 50 + uint8_t *indata; 51 + uint32_t insize; 52 + uint32_t result; 55 53 }; 56 54 57 55 /** 58 56 * struct cros_ec_device - Information about a ChromeOS EC device 59 57 * 60 - * @name: Name of this EC interface 58 + * @ec_name: name of EC device (e.g. 'chromeos-ec') 59 + * @phys_name: name of physical comms layer (e.g. 'i2c-4') 60 + * @dev: Device pointer 61 + * @was_wake_device: true if this device was set to wake the system from 62 + * sleep at the last suspend 63 + * @cmd_xfer: send command to EC and get response 64 + * Returns the number of bytes received if the communication succeeded, but 65 + * that doesn't mean the EC was happy with the command. The caller 66 + * should check msg.result for the EC's result code. 67 + * 61 68 * @priv: Private data 62 69 * @irq: Interrupt to use 63 - * @din: input buffer (from EC) 64 - * @dout: output buffer (to EC) 70 + * @din: input buffer (for data from EC) 71 + * @dout: output buffer (for data to EC) 65 72 * \note 66 73 * These two buffers will always be dword-aligned and include enough 67 74 * space for up to 7 word-alignment bytes also, so we can ensure that 68 75 * the body of the message is always dword-aligned (64-bit). 69 - * 70 76 * We use this alignment to keep ARM and x86 happy. Probably word 71 77 * alignment would be OK, there might be a small performance advantage 72 78 * to using dword. 73 - * @din_size: size of din buffer 74 - * @dout_size: size of dout buffer 75 - * @command_send: send a command 76 - * @command_recv: receive a command 77 - * @ec_name: name of EC device (e.g. 'chromeos-ec') 78 - * @phys_name: name of physical comms layer (e.g. 'i2c-4') 79 + * @din_size: size of din buffer to allocate (zero to use static din) 80 + * @dout_size: size of dout buffer to allocate (zero to use static dout) 79 81 * @parent: pointer to parent device (e.g. i2c or spi device) 80 - * @dev: Device pointer 81 - * dev_lock: Lock to prevent concurrent access 82 82 * @wake_enabled: true if this device can wake the system from sleep 83 - * @was_wake_device: true if this device was set to wake the system from 84 - * sleep at the last suspend 85 - * @event_notifier: interrupt event notifier for transport devices 83 + * @lock: one transaction at a time 86 84 */ 87 85 struct cros_ec_device { 88 - const char *name; 86 + 87 + /* These are used by other drivers that want to talk to the EC */ 88 + const char *ec_name; 89 + const char *phys_name; 90 + struct device *dev; 91 + bool was_wake_device; 92 + struct class *cros_class; 93 + int (*cmd_xfer)(struct cros_ec_device *ec, 94 + struct cros_ec_command *msg); 95 + 96 + /* These are used to implement the platform-specific interface */ 89 97 void *priv; 90 98 int irq; 91 99 uint8_t *din; 92 100 uint8_t *dout; 93 101 int din_size; 94 102 int dout_size; 95 - int (*command_send)(struct cros_ec_device *ec, 96 - uint16_t cmd, void *out_buf, int out_len); 97 - int (*command_recv)(struct cros_ec_device *ec, 98 - uint16_t cmd, void *in_buf, int in_len); 99 - int (*command_sendrecv)(struct cros_ec_device *ec, 100 - uint16_t cmd, void *out_buf, int out_len, 101 - void *in_buf, int in_len); 102 - int (*command_xfer)(struct cros_ec_device *ec, 103 - struct cros_ec_msg *msg); 104 - 105 - const char *ec_name; 106 - const char *phys_name; 107 103 struct device *parent; 108 - 109 - /* These are --private-- fields - do not assign */ 110 - struct device *dev; 111 - struct mutex dev_lock; 112 104 bool wake_enabled; 113 - bool was_wake_device; 114 - struct blocking_notifier_head event_notifier; 105 + struct mutex lock; 115 106 }; 116 107 117 108 /** ··· 138 143 * @msg: Message to write 139 144 */ 140 145 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 141 - struct cros_ec_msg *msg); 146 + struct cros_ec_command *msg); 147 + 148 + /** 149 + * cros_ec_check_result - Check ec_msg->result 150 + * 151 + * This is used by ChromeOS EC drivers to check the ec_msg->result for 152 + * errors and to warn about them. 153 + * 154 + * @ec_dev: EC device 155 + * @msg: Message to check 156 + */ 157 + int cros_ec_check_result(struct cros_ec_device *ec_dev, 158 + struct cros_ec_command *msg); 142 159 143 160 /** 144 161 * cros_ec_remove - Remove a ChromeOS EC 145 162 * 146 - * Call this to deregister a ChromeOS EC. After this you should call 147 - * cros_ec_free(). 163 + * Call this to deregister a ChromeOS EC, then clean up any private data. 148 164 * 149 165 * @ec_dev: Device to register 150 166 * @return 0 if ok, -ve on error
+2 -1
include/linux/mfd/da9063/core.h
··· 34 34 }; 35 35 36 36 enum da9063_variant_codes { 37 - PMIC_DA9063_BB = 0x5 37 + PMIC_DA9063_AD = 0x3, 38 + PMIC_DA9063_BB = 0x5, 38 39 }; 39 40 40 41 /* Interrupts */
+84 -43
include/linux/mfd/da9063/registers.h
··· 104 104 #define DA9063_REG_COUNT_D 0x43 105 105 #define DA9063_REG_COUNT_MO 0x44 106 106 #define DA9063_REG_COUNT_Y 0x45 107 - #define DA9063_REG_ALARM_S 0x46 108 - #define DA9063_REG_ALARM_MI 0x47 109 - #define DA9063_REG_ALARM_H 0x48 110 - #define DA9063_REG_ALARM_D 0x49 111 - #define DA9063_REG_ALARM_MO 0x4A 112 - #define DA9063_REG_ALARM_Y 0x4B 113 - #define DA9063_REG_SECOND_A 0x4C 114 - #define DA9063_REG_SECOND_B 0x4D 115 - #define DA9063_REG_SECOND_C 0x4E 116 - #define DA9063_REG_SECOND_D 0x4F 107 + 108 + #define DA9063_AD_REG_ALARM_MI 0x46 109 + #define DA9063_AD_REG_ALARM_H 0x47 110 + #define DA9063_AD_REG_ALARM_D 0x48 111 + #define DA9063_AD_REG_ALARM_MO 0x49 112 + #define DA9063_AD_REG_ALARM_Y 0x4A 113 + #define DA9063_AD_REG_SECOND_A 0x4B 114 + #define DA9063_AD_REG_SECOND_B 0x4C 115 + #define DA9063_AD_REG_SECOND_C 0x4D 116 + #define DA9063_AD_REG_SECOND_D 0x4E 117 + 118 + #define DA9063_BB_REG_ALARM_S 0x46 119 + #define DA9063_BB_REG_ALARM_MI 0x47 120 + #define DA9063_BB_REG_ALARM_H 0x48 121 + #define DA9063_BB_REG_ALARM_D 0x49 122 + #define DA9063_BB_REG_ALARM_MO 0x4A 123 + #define DA9063_BB_REG_ALARM_Y 0x4B 124 + #define DA9063_BB_REG_SECOND_A 0x4C 125 + #define DA9063_BB_REG_SECOND_B 0x4D 126 + #define DA9063_BB_REG_SECOND_C 0x4E 127 + #define DA9063_BB_REG_SECOND_D 0x4F 117 128 118 129 /* Sequencer Control Registers */ 119 130 #define DA9063_REG_SEQ 0x81 ··· 234 223 #define DA9063_REG_CONFIG_J 0x10F 235 224 #define DA9063_REG_CONFIG_K 0x110 236 225 #define DA9063_REG_CONFIG_L 0x111 237 - #define DA9063_REG_CONFIG_M 0x112 238 - #define DA9063_REG_CONFIG_N 0x113 239 226 240 - #define DA9063_REG_MON_REG_1 0x114 241 - #define DA9063_REG_MON_REG_2 0x115 242 - #define DA9063_REG_MON_REG_3 0x116 243 - #define DA9063_REG_MON_REG_4 0x117 244 - #define DA9063_REG_MON_REG_5 0x11E 245 - #define DA9063_REG_MON_REG_6 0x11F 246 - #define DA9063_REG_TRIM_CLDR 0x120 227 + #define DA9063_AD_REG_MON_REG_1 0x112 228 + #define DA9063_AD_REG_MON_REG_2 0x113 229 + #define DA9063_AD_REG_MON_REG_3 0x114 230 + #define DA9063_AD_REG_MON_REG_4 0x115 231 + #define DA9063_AD_REG_MON_REG_5 0x116 232 + #define DA9063_AD_REG_MON_REG_6 0x117 233 + #define DA9063_AD_REG_TRIM_CLDR 0x118 234 + 235 + #define DA9063_AD_REG_GP_ID_0 0x119 236 + #define DA9063_AD_REG_GP_ID_1 0x11A 237 + #define DA9063_AD_REG_GP_ID_2 0x11B 238 + #define DA9063_AD_REG_GP_ID_3 0x11C 239 + #define DA9063_AD_REG_GP_ID_4 0x11D 240 + #define DA9063_AD_REG_GP_ID_5 0x11E 241 + #define DA9063_AD_REG_GP_ID_6 0x11F 242 + #define DA9063_AD_REG_GP_ID_7 0x120 243 + #define DA9063_AD_REG_GP_ID_8 0x121 244 + #define DA9063_AD_REG_GP_ID_9 0x122 245 + #define DA9063_AD_REG_GP_ID_10 0x123 246 + #define DA9063_AD_REG_GP_ID_11 0x124 247 + #define DA9063_AD_REG_GP_ID_12 0x125 248 + #define DA9063_AD_REG_GP_ID_13 0x126 249 + #define DA9063_AD_REG_GP_ID_14 0x127 250 + #define DA9063_AD_REG_GP_ID_15 0x128 251 + #define DA9063_AD_REG_GP_ID_16 0x129 252 + #define DA9063_AD_REG_GP_ID_17 0x12A 253 + #define DA9063_AD_REG_GP_ID_18 0x12B 254 + #define DA9063_AD_REG_GP_ID_19 0x12C 255 + 256 + #define DA9063_BB_REG_CONFIG_M 0x112 257 + #define DA9063_BB_REG_CONFIG_N 0x113 258 + 259 + #define DA9063_BB_REG_MON_REG_1 0x114 260 + #define DA9063_BB_REG_MON_REG_2 0x115 261 + #define DA9063_BB_REG_MON_REG_3 0x116 262 + #define DA9063_BB_REG_MON_REG_4 0x117 263 + #define DA9063_BB_REG_MON_REG_5 0x11E 264 + #define DA9063_BB_REG_MON_REG_6 0x11F 265 + #define DA9063_BB_REG_TRIM_CLDR 0x120 247 266 /* General Purpose Registers */ 248 - #define DA9063_REG_GP_ID_0 0x121 249 - #define DA9063_REG_GP_ID_1 0x122 250 - #define DA9063_REG_GP_ID_2 0x123 251 - #define DA9063_REG_GP_ID_3 0x124 252 - #define DA9063_REG_GP_ID_4 0x125 253 - #define DA9063_REG_GP_ID_5 0x126 254 - #define DA9063_REG_GP_ID_6 0x127 255 - #define DA9063_REG_GP_ID_7 0x128 256 - #define DA9063_REG_GP_ID_8 0x129 257 - #define DA9063_REG_GP_ID_9 0x12A 258 - #define DA9063_REG_GP_ID_10 0x12B 259 - #define DA9063_REG_GP_ID_11 0x12C 260 - #define DA9063_REG_GP_ID_12 0x12D 261 - #define DA9063_REG_GP_ID_13 0x12E 262 - #define DA9063_REG_GP_ID_14 0x12F 263 - #define DA9063_REG_GP_ID_15 0x130 264 - #define DA9063_REG_GP_ID_16 0x131 265 - #define DA9063_REG_GP_ID_17 0x132 266 - #define DA9063_REG_GP_ID_18 0x133 267 - #define DA9063_REG_GP_ID_19 0x134 267 + #define DA9063_BB_REG_GP_ID_0 0x121 268 + #define DA9063_BB_REG_GP_ID_1 0x122 269 + #define DA9063_BB_REG_GP_ID_2 0x123 270 + #define DA9063_BB_REG_GP_ID_3 0x124 271 + #define DA9063_BB_REG_GP_ID_4 0x125 272 + #define DA9063_BB_REG_GP_ID_5 0x126 273 + #define DA9063_BB_REG_GP_ID_6 0x127 274 + #define DA9063_BB_REG_GP_ID_7 0x128 275 + #define DA9063_BB_REG_GP_ID_8 0x129 276 + #define DA9063_BB_REG_GP_ID_9 0x12A 277 + #define DA9063_BB_REG_GP_ID_10 0x12B 278 + #define DA9063_BB_REG_GP_ID_11 0x12C 279 + #define DA9063_BB_REG_GP_ID_12 0x12D 280 + #define DA9063_BB_REG_GP_ID_13 0x12E 281 + #define DA9063_BB_REG_GP_ID_14 0x12F 282 + #define DA9063_BB_REG_GP_ID_15 0x130 283 + #define DA9063_BB_REG_GP_ID_16 0x131 284 + #define DA9063_BB_REG_GP_ID_17 0x132 285 + #define DA9063_BB_REG_GP_ID_18 0x133 286 + #define DA9063_BB_REG_GP_ID_19 0x134 268 287 269 288 /* Chip ID and variant */ 270 289 #define DA9063_REG_CHIP_ID 0x181 ··· 445 404 /* DA9063_REG_CONTROL_B (addr=0x0F) */ 446 405 #define DA9063_CHG_SEL 0x01 447 406 #define DA9063_WATCHDOG_PD 0x02 448 - #define DA9063_RESET_BLINKING 0x04 407 + #define DA9063_BB_RESET_BLINKING 0x04 449 408 #define DA9063_NRES_MODE 0x08 450 409 #define DA9063_NONKEY_LOCK 0x10 451 - #define DA9063_BUCK_SLOWSTART 0x80 410 + #define DA9063_BB_BUCK_SLOWSTART 0x80 452 411 453 412 /* DA9063_REG_CONTROL_C (addr=0x10) */ 454 413 #define DA9063_DEBOUNCING_MASK 0x07 ··· 508 467 #define DA9063_GPADC_PAUSE 0x02 509 468 #define DA9063_PMIF_DIS 0x04 510 469 #define DA9063_HS2WIRE_DIS 0x08 511 - #define DA9063_CLDR_PAUSE 0x10 470 + #define DA9063_BB_CLDR_PAUSE 0x10 512 471 #define DA9063_BBAT_DIS 0x20 513 472 #define DA9063_OUT_32K_PAUSE 0x40 514 473 #define DA9063_PMCONT_DIS 0x80 ··· 885 844 #define DA9063_MONITOR 0x40 886 845 887 846 /* DA9063_REG_ALARM_S (addr=0x46) */ 888 - #define DA9063_ALARM_S_MASK 0x3F 847 + #define DA9063_BB_ALARM_S_MASK 0x3F 889 848 #define DA9063_ALARM_STATUS_ALARM 0x80 890 849 #define DA9063_ALARM_STATUS_TICK 0x40 891 850 /* DA9063_REG_ALARM_MI (addr=0x47) */
+30
include/linux/mfd/intel_soc_pmic.h
··· 1 + /* 2 + * intel_soc_pmic.h - Intel SoC PMIC Driver 3 + * 4 + * Copyright (C) 2012-2014 Intel Corporation. All rights reserved. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License version 8 + * 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * Author: Yang, Bin <bin.yang@intel.com> 16 + * Author: Zhu, Lejun <lejun.zhu@linux.intel.com> 17 + */ 18 + 19 + #ifndef __INTEL_SOC_PMIC_H__ 20 + #define __INTEL_SOC_PMIC_H__ 21 + 22 + #include <linux/regmap.h> 23 + 24 + struct intel_soc_pmic { 25 + int irq; 26 + struct regmap *regmap; 27 + struct regmap_irq_chip_data *irq_chip_data; 28 + }; 29 + 30 + #endif /* __INTEL_SOC_PMIC_H__ */
+229 -10
include/linux/mfd/max77686-private.h
··· 1 1 /* 2 - * max77686-private.h - Voltage regulator driver for the Maxim 77686 2 + * max77686-private.h - Voltage regulator driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electrnoics 5 5 * Chiwoong Byun <woong.byun@samsung.com> ··· 28 28 29 29 #define MAX77686_REG_INVALID (0xff) 30 30 31 + /* MAX77686 PMIC registers */ 31 32 enum max77686_pmic_reg { 32 33 MAX77686_REG_DEVICE_ID = 0x00, 33 34 MAX77686_REG_INTSRC = 0x01, ··· 182 181 MAX77686_ALARM2_DATE = 0x1B, 183 182 }; 184 183 185 - #define MAX77686_IRQSRC_PMIC (0) 186 - #define MAX77686_IRQSRC_RTC (1 << 0) 184 + /* MAX77802 PMIC registers */ 185 + enum max77802_pmic_reg { 186 + MAX77802_REG_DEVICE_ID = 0x00, 187 + MAX77802_REG_INTSRC = 0x01, 188 + MAX77802_REG_INT1 = 0x02, 189 + MAX77802_REG_INT2 = 0x03, 190 + 191 + MAX77802_REG_INT1MSK = 0x04, 192 + MAX77802_REG_INT2MSK = 0x05, 193 + 194 + MAX77802_REG_STATUS1 = 0x06, 195 + MAX77802_REG_STATUS2 = 0x07, 196 + 197 + MAX77802_REG_PWRON = 0x08, 198 + /* Reserved: 0x09 */ 199 + MAX77802_REG_MRSTB = 0x0A, 200 + MAX77802_REG_EPWRHOLD = 0x0B, 201 + /* Reserved: 0x0C-0x0D */ 202 + MAX77802_REG_BOOSTCTRL = 0x0E, 203 + MAX77802_REG_BOOSTOUT = 0x0F, 204 + 205 + MAX77802_REG_BUCK1CTRL = 0x10, 206 + MAX77802_REG_BUCK1DVS1 = 0x11, 207 + MAX77802_REG_BUCK1DVS2 = 0x12, 208 + MAX77802_REG_BUCK1DVS3 = 0x13, 209 + MAX77802_REG_BUCK1DVS4 = 0x14, 210 + MAX77802_REG_BUCK1DVS5 = 0x15, 211 + MAX77802_REG_BUCK1DVS6 = 0x16, 212 + MAX77802_REG_BUCK1DVS7 = 0x17, 213 + MAX77802_REG_BUCK1DVS8 = 0x18, 214 + /* Reserved: 0x19 */ 215 + MAX77802_REG_BUCK2CTRL1 = 0x1A, 216 + MAX77802_REG_BUCK2CTRL2 = 0x1B, 217 + MAX77802_REG_BUCK2PHTRAN = 0x1C, 218 + MAX77802_REG_BUCK2DVS1 = 0x1D, 219 + MAX77802_REG_BUCK2DVS2 = 0x1E, 220 + MAX77802_REG_BUCK2DVS3 = 0x1F, 221 + MAX77802_REG_BUCK2DVS4 = 0x20, 222 + MAX77802_REG_BUCK2DVS5 = 0x21, 223 + MAX77802_REG_BUCK2DVS6 = 0x22, 224 + MAX77802_REG_BUCK2DVS7 = 0x23, 225 + MAX77802_REG_BUCK2DVS8 = 0x24, 226 + /* Reserved: 0x25-0x26 */ 227 + MAX77802_REG_BUCK3CTRL1 = 0x27, 228 + MAX77802_REG_BUCK3DVS1 = 0x28, 229 + MAX77802_REG_BUCK3DVS2 = 0x29, 230 + MAX77802_REG_BUCK3DVS3 = 0x2A, 231 + MAX77802_REG_BUCK3DVS4 = 0x2B, 232 + MAX77802_REG_BUCK3DVS5 = 0x2C, 233 + MAX77802_REG_BUCK3DVS6 = 0x2D, 234 + MAX77802_REG_BUCK3DVS7 = 0x2E, 235 + MAX77802_REG_BUCK3DVS8 = 0x2F, 236 + /* Reserved: 0x30-0x36 */ 237 + MAX77802_REG_BUCK4CTRL1 = 0x37, 238 + MAX77802_REG_BUCK4DVS1 = 0x38, 239 + MAX77802_REG_BUCK4DVS2 = 0x39, 240 + MAX77802_REG_BUCK4DVS3 = 0x3A, 241 + MAX77802_REG_BUCK4DVS4 = 0x3B, 242 + MAX77802_REG_BUCK4DVS5 = 0x3C, 243 + MAX77802_REG_BUCK4DVS6 = 0x3D, 244 + MAX77802_REG_BUCK4DVS7 = 0x3E, 245 + MAX77802_REG_BUCK4DVS8 = 0x3F, 246 + /* Reserved: 0x40 */ 247 + MAX77802_REG_BUCK5CTRL = 0x41, 248 + MAX77802_REG_BUCK5OUT = 0x42, 249 + /* Reserved: 0x43 */ 250 + MAX77802_REG_BUCK6CTRL = 0x44, 251 + MAX77802_REG_BUCK6DVS1 = 0x45, 252 + MAX77802_REG_BUCK6DVS2 = 0x46, 253 + MAX77802_REG_BUCK6DVS3 = 0x47, 254 + MAX77802_REG_BUCK6DVS4 = 0x48, 255 + MAX77802_REG_BUCK6DVS5 = 0x49, 256 + MAX77802_REG_BUCK6DVS6 = 0x4A, 257 + MAX77802_REG_BUCK6DVS7 = 0x4B, 258 + MAX77802_REG_BUCK6DVS8 = 0x4C, 259 + /* Reserved: 0x4D */ 260 + MAX77802_REG_BUCK7CTRL = 0x4E, 261 + MAX77802_REG_BUCK7OUT = 0x4F, 262 + /* Reserved: 0x50 */ 263 + MAX77802_REG_BUCK8CTRL = 0x51, 264 + MAX77802_REG_BUCK8OUT = 0x52, 265 + /* Reserved: 0x53 */ 266 + MAX77802_REG_BUCK9CTRL = 0x54, 267 + MAX77802_REG_BUCK9OUT = 0x55, 268 + /* Reserved: 0x56 */ 269 + MAX77802_REG_BUCK10CTRL = 0x57, 270 + MAX77802_REG_BUCK10OUT = 0x58, 271 + 272 + /* Reserved: 0x59-0x5F */ 273 + 274 + MAX77802_REG_LDO1CTRL1 = 0x60, 275 + MAX77802_REG_LDO2CTRL1 = 0x61, 276 + MAX77802_REG_LDO3CTRL1 = 0x62, 277 + MAX77802_REG_LDO4CTRL1 = 0x63, 278 + MAX77802_REG_LDO5CTRL1 = 0x64, 279 + MAX77802_REG_LDO6CTRL1 = 0x65, 280 + MAX77802_REG_LDO7CTRL1 = 0x66, 281 + MAX77802_REG_LDO8CTRL1 = 0x67, 282 + MAX77802_REG_LDO9CTRL1 = 0x68, 283 + MAX77802_REG_LDO10CTRL1 = 0x69, 284 + MAX77802_REG_LDO11CTRL1 = 0x6A, 285 + MAX77802_REG_LDO12CTRL1 = 0x6B, 286 + MAX77802_REG_LDO13CTRL1 = 0x6C, 287 + MAX77802_REG_LDO14CTRL1 = 0x6D, 288 + MAX77802_REG_LDO15CTRL1 = 0x6E, 289 + /* Reserved: 0x6F */ 290 + MAX77802_REG_LDO17CTRL1 = 0x70, 291 + MAX77802_REG_LDO18CTRL1 = 0x71, 292 + MAX77802_REG_LDO19CTRL1 = 0x72, 293 + MAX77802_REG_LDO20CTRL1 = 0x73, 294 + MAX77802_REG_LDO21CTRL1 = 0x74, 295 + MAX77802_REG_LDO22CTRL1 = 0x75, 296 + MAX77802_REG_LDO23CTRL1 = 0x76, 297 + MAX77802_REG_LDO24CTRL1 = 0x77, 298 + MAX77802_REG_LDO25CTRL1 = 0x78, 299 + MAX77802_REG_LDO26CTRL1 = 0x79, 300 + MAX77802_REG_LDO27CTRL1 = 0x7A, 301 + MAX77802_REG_LDO28CTRL1 = 0x7B, 302 + MAX77802_REG_LDO29CTRL1 = 0x7C, 303 + MAX77802_REG_LDO30CTRL1 = 0x7D, 304 + /* Reserved: 0x7E */ 305 + MAX77802_REG_LDO32CTRL1 = 0x7F, 306 + MAX77802_REG_LDO33CTRL1 = 0x80, 307 + MAX77802_REG_LDO34CTRL1 = 0x81, 308 + MAX77802_REG_LDO35CTRL1 = 0x82, 309 + /* Reserved: 0x83-0x8F */ 310 + MAX77802_REG_LDO1CTRL2 = 0x90, 311 + MAX77802_REG_LDO2CTRL2 = 0x91, 312 + MAX77802_REG_LDO3CTRL2 = 0x92, 313 + MAX77802_REG_LDO4CTRL2 = 0x93, 314 + MAX77802_REG_LDO5CTRL2 = 0x94, 315 + MAX77802_REG_LDO6CTRL2 = 0x95, 316 + MAX77802_REG_LDO7CTRL2 = 0x96, 317 + MAX77802_REG_LDO8CTRL2 = 0x97, 318 + MAX77802_REG_LDO9CTRL2 = 0x98, 319 + MAX77802_REG_LDO10CTRL2 = 0x99, 320 + MAX77802_REG_LDO11CTRL2 = 0x9A, 321 + MAX77802_REG_LDO12CTRL2 = 0x9B, 322 + MAX77802_REG_LDO13CTRL2 = 0x9C, 323 + MAX77802_REG_LDO14CTRL2 = 0x9D, 324 + MAX77802_REG_LDO15CTRL2 = 0x9E, 325 + /* Reserved: 0x9F */ 326 + MAX77802_REG_LDO17CTRL2 = 0xA0, 327 + MAX77802_REG_LDO18CTRL2 = 0xA1, 328 + MAX77802_REG_LDO19CTRL2 = 0xA2, 329 + MAX77802_REG_LDO20CTRL2 = 0xA3, 330 + MAX77802_REG_LDO21CTRL2 = 0xA4, 331 + MAX77802_REG_LDO22CTRL2 = 0xA5, 332 + MAX77802_REG_LDO23CTRL2 = 0xA6, 333 + MAX77802_REG_LDO24CTRL2 = 0xA7, 334 + MAX77802_REG_LDO25CTRL2 = 0xA8, 335 + MAX77802_REG_LDO26CTRL2 = 0xA9, 336 + MAX77802_REG_LDO27CTRL2 = 0xAA, 337 + MAX77802_REG_LDO28CTRL2 = 0xAB, 338 + MAX77802_REG_LDO29CTRL2 = 0xAC, 339 + MAX77802_REG_LDO30CTRL2 = 0xAD, 340 + /* Reserved: 0xAE */ 341 + MAX77802_REG_LDO32CTRL2 = 0xAF, 342 + MAX77802_REG_LDO33CTRL2 = 0xB0, 343 + MAX77802_REG_LDO34CTRL2 = 0xB1, 344 + MAX77802_REG_LDO35CTRL2 = 0xB2, 345 + /* Reserved: 0xB3 */ 346 + 347 + MAX77802_REG_BBAT_CHG = 0xB4, 348 + MAX77802_REG_32KHZ = 0xB5, 349 + 350 + MAX77802_REG_PMIC_END = 0xB6, 351 + }; 352 + 353 + enum max77802_rtc_reg { 354 + MAX77802_RTC_INT = 0xC0, 355 + MAX77802_RTC_INTM = 0xC1, 356 + MAX77802_RTC_CONTROLM = 0xC2, 357 + MAX77802_RTC_CONTROL = 0xC3, 358 + MAX77802_RTC_UPDATE0 = 0xC4, 359 + MAX77802_RTC_UPDATE1 = 0xC5, 360 + MAX77802_WTSR_SMPL_CNTL = 0xC6, 361 + MAX77802_RTC_SEC = 0xC7, 362 + MAX77802_RTC_MIN = 0xC8, 363 + MAX77802_RTC_HOUR = 0xC9, 364 + MAX77802_RTC_WEEKDAY = 0xCA, 365 + MAX77802_RTC_MONTH = 0xCB, 366 + MAX77802_RTC_YEAR = 0xCC, 367 + MAX77802_RTC_DATE = 0xCD, 368 + MAX77802_RTC_AE1 = 0xCE, 369 + MAX77802_ALARM1_SEC = 0xCF, 370 + MAX77802_ALARM1_MIN = 0xD0, 371 + MAX77802_ALARM1_HOUR = 0xD1, 372 + MAX77802_ALARM1_WEEKDAY = 0xD2, 373 + MAX77802_ALARM1_MONTH = 0xD3, 374 + MAX77802_ALARM1_YEAR = 0xD4, 375 + MAX77802_ALARM1_DATE = 0xD5, 376 + MAX77802_RTC_AE2 = 0xD6, 377 + MAX77802_ALARM2_SEC = 0xD7, 378 + MAX77802_ALARM2_MIN = 0xD8, 379 + MAX77802_ALARM2_HOUR = 0xD9, 380 + MAX77802_ALARM2_WEEKDAY = 0xDA, 381 + MAX77802_ALARM2_MONTH = 0xDB, 382 + MAX77802_ALARM2_YEAR = 0xDC, 383 + MAX77802_ALARM2_DATE = 0xDD, 384 + 385 + MAX77802_RTC_END = 0xDF, 386 + }; 187 387 188 388 enum max77686_irq_source { 189 389 PMIC_INT1 = 0, ··· 407 205 MAX77686_PMICIRQ_140C, 408 206 MAX77686_PMICIRQ_120C, 409 207 410 - MAX77686_RTCIRQ_RTC60S, 208 + MAX77686_RTCIRQ_RTC60S = 0, 411 209 MAX77686_RTCIRQ_RTCA1, 412 210 MAX77686_RTCIRQ_RTCA2, 413 211 MAX77686_RTCIRQ_SMPL, 414 212 MAX77686_RTCIRQ_RTC1S, 415 213 MAX77686_RTCIRQ_WTSR, 416 - 417 - MAX77686_IRQ_NR, 418 214 }; 215 + 216 + #define MAX77686_INT1_PWRONF_MSK BIT(0) 217 + #define MAX77686_INT1_PWRONR_MSK BIT(1) 218 + #define MAX77686_INT1_JIGONBF_MSK BIT(2) 219 + #define MAX77686_INT1_JIGONBR_MSK BIT(3) 220 + #define MAX77686_INT1_ACOKBF_MSK BIT(4) 221 + #define MAX77686_INT1_ACOKBR_MSK BIT(5) 222 + #define MAX77686_INT1_ONKEY1S_MSK BIT(6) 223 + #define MAX77686_INT1_MRSTB_MSK BIT(7) 224 + 225 + #define MAX77686_INT2_140C_MSK BIT(0) 226 + #define MAX77686_INT2_120C_MSK BIT(1) 227 + 228 + #define MAX77686_RTCINT_RTC60S_MSK BIT(0) 229 + #define MAX77686_RTCINT_RTCA1_MSK BIT(1) 230 + #define MAX77686_RTCINT_RTCA2_MSK BIT(2) 231 + #define MAX77686_RTCINT_SMPL_MSK BIT(3) 232 + #define MAX77686_RTCINT_RTC1S_MSK BIT(4) 233 + #define MAX77686_RTCINT_WTSR_MSK BIT(5) 419 234 420 235 struct max77686_dev { 421 236 struct device *dev; 422 237 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ 423 238 struct i2c_client *rtc; /* slave addr 0x0c */ 424 239 425 - int type; 240 + unsigned long type; 426 241 427 242 struct regmap *regmap; /* regmap for mfd */ 428 243 struct regmap *rtc_regmap; /* regmap for rtc */ 429 - 430 - struct irq_domain *irq_domain; 244 + struct regmap_irq_chip_data *irq_data; 245 + struct regmap_irq_chip_data *rtc_irq_data; 431 246 432 247 int irq; 433 - int irq_gpio; 434 248 bool wakeup; 435 249 struct mutex irqlock; 436 250 int irq_masks_cur[MAX77686_IRQ_GROUP_NR]; ··· 455 237 456 238 enum max77686_types { 457 239 TYPE_MAX77686, 240 + TYPE_MAX77802, 458 241 }; 459 242 460 243 extern int max77686_irq_init(struct max77686_dev *max77686);
+56 -3
include/linux/mfd/max77686.h
··· 1 1 /* 2 - * max77686.h - Driver for the Maxim 77686 2 + * max77686.h - Driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electrnoics 5 5 * Chiwoong Byun <woong.byun@samsung.com> ··· 71 71 MAX77686_REG_MAX, 72 72 }; 73 73 74 + /* MAX77802 regulator IDs */ 75 + enum max77802_regulators { 76 + MAX77802_BUCK1 = 0, 77 + MAX77802_BUCK2, 78 + MAX77802_BUCK3, 79 + MAX77802_BUCK4, 80 + MAX77802_BUCK5, 81 + MAX77802_BUCK6, 82 + MAX77802_BUCK7, 83 + MAX77802_BUCK8, 84 + MAX77802_BUCK9, 85 + MAX77802_BUCK10, 86 + MAX77802_LDO1, 87 + MAX77802_LDO2, 88 + MAX77802_LDO3, 89 + MAX77802_LDO4, 90 + MAX77802_LDO5, 91 + MAX77802_LDO6, 92 + MAX77802_LDO7, 93 + MAX77802_LDO8, 94 + MAX77802_LDO9, 95 + MAX77802_LDO10, 96 + MAX77802_LDO11, 97 + MAX77802_LDO12, 98 + MAX77802_LDO13, 99 + MAX77802_LDO14, 100 + MAX77802_LDO15, 101 + MAX77802_LDO17, 102 + MAX77802_LDO18, 103 + MAX77802_LDO19, 104 + MAX77802_LDO20, 105 + MAX77802_LDO21, 106 + MAX77802_LDO23, 107 + MAX77802_LDO24, 108 + MAX77802_LDO25, 109 + MAX77802_LDO26, 110 + MAX77802_LDO27, 111 + MAX77802_LDO28, 112 + MAX77802_LDO29, 113 + MAX77802_LDO30, 114 + MAX77802_LDO32, 115 + MAX77802_LDO33, 116 + MAX77802_LDO34, 117 + MAX77802_LDO35, 118 + 119 + MAX77802_REG_MAX, 120 + }; 121 + 74 122 struct max77686_regulator_data { 75 123 int id; 76 124 struct regulator_init_data *initdata; ··· 131 83 MAX77686_OPMODE_STANDBY, 132 84 }; 133 85 86 + enum max77802_opmode { 87 + MAX77802_OPMODE_OFF, 88 + MAX77802_OPMODE_STANDBY, 89 + MAX77802_OPMODE_LP, 90 + MAX77802_OPMODE_NORMAL, 91 + }; 92 + 134 93 struct max77686_opmode_data { 135 94 int id; 136 95 int mode; 137 96 }; 138 97 139 98 struct max77686_platform_data { 140 - /* IRQ */ 141 - int irq_gpio; 142 99 int ono; 143 100 int wakeup; 144 101
-1
include/linux/mfd/mc13783.h
··· 86 86 #define MC13783_IRQ_HSL 43 87 87 #define MC13783_IRQ_ALSPTH 44 88 88 #define MC13783_IRQ_AHSSHORT 45 89 - #define MC13783_NUM_IRQ MC13XXX_NUM_IRQ 90 89 91 90 #endif /* ifndef __LINUX_MFD_MC13783_H */
+16 -7
include/linux/mfd/mc13xxx.h
··· 23 23 24 24 int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, 25 25 irq_handler_t handler, const char *name, void *dev); 26 - int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, 27 - irq_handler_t handler, const char *name, void *dev); 28 26 int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev); 29 27 30 - int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq); 31 - int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq); 32 28 int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq, 33 29 int *enabled, int *pending); 34 - int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq); 35 30 36 31 int mc13xxx_get_flags(struct mc13xxx *mc13xxx); 37 32 38 33 int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, 39 34 unsigned int mode, unsigned int channel, 40 35 u8 ato, bool atox, unsigned int *sample); 36 + 37 + /* Deprecated calls */ 38 + static inline int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq) 39 + { 40 + return 0; 41 + } 42 + 43 + static inline int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, 44 + irq_handler_t handler, 45 + const char *name, void *dev) 46 + { 47 + return mc13xxx_irq_request(mc13xxx, irq, handler, name, dev); 48 + } 49 + 50 + int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq); 51 + int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq); 41 52 42 53 #define MC13783_AUDIO_RX0 36 43 54 #define MC13783_AUDIO_RX1 37 ··· 78 67 #define MC13XXX_IRQ_THWARNL 36 79 68 #define MC13XXX_IRQ_THWARNH 37 80 69 #define MC13XXX_IRQ_CLK 38 81 - 82 - #define MC13XXX_NUM_IRQ 46 83 70 84 71 struct regulator_init_data; 85 72
+6
include/linux/mfd/rtsx_pci.h
··· 943 943 int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout); 944 944 int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, 945 945 int num_sg, bool read, int timeout); 946 + int rtsx_pci_dma_map_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, 947 + int num_sg, bool read); 948 + void rtsx_pci_dma_unmap_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, 949 + int num_sg, bool read); 950 + int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist, 951 + int count, bool read, int timeout); 946 952 int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); 947 953 int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); 948 954 int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card);
+1
include/linux/mfd/samsung/core.h
··· 21 21 S2MPA01, 22 22 S2MPS11X, 23 23 S2MPS14X, 24 + S2MPU02, 24 25 }; 25 26 26 27 /**
+24
include/linux/mfd/samsung/irq.h
··· 129 129 S2MPS14_IRQ_NR, 130 130 }; 131 131 132 + enum s2mpu02_irq { 133 + S2MPU02_IRQ_PWRONF, 134 + S2MPU02_IRQ_PWRONR, 135 + S2MPU02_IRQ_JIGONBF, 136 + S2MPU02_IRQ_JIGONBR, 137 + S2MPU02_IRQ_ACOKBF, 138 + S2MPU02_IRQ_ACOKBR, 139 + S2MPU02_IRQ_PWRON1S, 140 + S2MPU02_IRQ_MRB, 141 + 142 + S2MPU02_IRQ_RTC60S, 143 + S2MPU02_IRQ_RTCA1, 144 + S2MPU02_IRQ_RTCA0, 145 + S2MPU02_IRQ_SMPL, 146 + S2MPU02_IRQ_RTC1S, 147 + S2MPU02_IRQ_WTSR, 148 + 149 + S2MPU02_IRQ_INT120C, 150 + S2MPU02_IRQ_INT140C, 151 + S2MPU02_IRQ_TSD, 152 + 153 + S2MPU02_IRQ_NR, 154 + }; 155 + 132 156 /* Masks for interrupts are the same as in s2mps11 */ 133 157 #define S2MPS14_IRQ_TSD_MASK (1 << 2) 134 158
+201
include/linux/mfd/samsung/s2mpu02.h
··· 1 + /* 2 + * s2mpu02.h 3 + * 4 + * Copyright (c) 2014 Samsung Electronics Co., Ltd 5 + * http://www.samsung.com 6 + * 7 + * This program is free software; you can redistribute it and/or modify it 8 + * under the terms of the GNU General Public License as published by the 9 + * Free Software Foundation; either version 2 of the License, or (at your 10 + * option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + */ 18 + 19 + #ifndef __LINUX_MFD_S2MPU02_H 20 + #define __LINUX_MFD_S2MPU02_H 21 + 22 + /* S2MPU02 registers */ 23 + enum S2MPU02_reg { 24 + S2MPU02_REG_ID, 25 + S2MPU02_REG_INT1, 26 + S2MPU02_REG_INT2, 27 + S2MPU02_REG_INT3, 28 + S2MPU02_REG_INT1M, 29 + S2MPU02_REG_INT2M, 30 + S2MPU02_REG_INT3M, 31 + S2MPU02_REG_ST1, 32 + S2MPU02_REG_ST2, 33 + S2MPU02_REG_PWRONSRC, 34 + S2MPU02_REG_OFFSRC, 35 + S2MPU02_REG_BU_CHG, 36 + S2MPU02_REG_RTCCTRL, 37 + S2MPU02_REG_PMCTRL1, 38 + S2MPU02_REG_RSVD1, 39 + S2MPU02_REG_RSVD2, 40 + S2MPU02_REG_RSVD3, 41 + S2MPU02_REG_RSVD4, 42 + S2MPU02_REG_RSVD5, 43 + S2MPU02_REG_RSVD6, 44 + S2MPU02_REG_RSVD7, 45 + S2MPU02_REG_WRSTEN, 46 + S2MPU02_REG_RSVD8, 47 + S2MPU02_REG_RSVD9, 48 + S2MPU02_REG_RSVD10, 49 + S2MPU02_REG_B1CTRL1, 50 + S2MPU02_REG_B1CTRL2, 51 + S2MPU02_REG_B2CTRL1, 52 + S2MPU02_REG_B2CTRL2, 53 + S2MPU02_REG_B3CTRL1, 54 + S2MPU02_REG_B3CTRL2, 55 + S2MPU02_REG_B4CTRL1, 56 + S2MPU02_REG_B4CTRL2, 57 + S2MPU02_REG_B5CTRL1, 58 + S2MPU02_REG_B5CTRL2, 59 + S2MPU02_REG_B5CTRL3, 60 + S2MPU02_REG_B5CTRL4, 61 + S2MPU02_REG_B5CTRL5, 62 + S2MPU02_REG_B6CTRL1, 63 + S2MPU02_REG_B6CTRL2, 64 + S2MPU02_REG_B7CTRL1, 65 + S2MPU02_REG_B7CTRL2, 66 + S2MPU02_REG_RAMP1, 67 + S2MPU02_REG_RAMP2, 68 + S2MPU02_REG_L1CTRL, 69 + S2MPU02_REG_L2CTRL1, 70 + S2MPU02_REG_L2CTRL2, 71 + S2MPU02_REG_L2CTRL3, 72 + S2MPU02_REG_L2CTRL4, 73 + S2MPU02_REG_L3CTRL, 74 + S2MPU02_REG_L4CTRL, 75 + S2MPU02_REG_L5CTRL, 76 + S2MPU02_REG_L6CTRL, 77 + S2MPU02_REG_L7CTRL, 78 + S2MPU02_REG_L8CTRL, 79 + S2MPU02_REG_L9CTRL, 80 + S2MPU02_REG_L10CTRL, 81 + S2MPU02_REG_L11CTRL, 82 + S2MPU02_REG_L12CTRL, 83 + S2MPU02_REG_L13CTRL, 84 + S2MPU02_REG_L14CTRL, 85 + S2MPU02_REG_L15CTRL, 86 + S2MPU02_REG_L16CTRL, 87 + S2MPU02_REG_L17CTRL, 88 + S2MPU02_REG_L18CTRL, 89 + S2MPU02_REG_L19CTRL, 90 + S2MPU02_REG_L20CTRL, 91 + S2MPU02_REG_L21CTRL, 92 + S2MPU02_REG_L22CTRL, 93 + S2MPU02_REG_L23CTRL, 94 + S2MPU02_REG_L24CTRL, 95 + S2MPU02_REG_L25CTRL, 96 + S2MPU02_REG_L26CTRL, 97 + S2MPU02_REG_L27CTRL, 98 + S2MPU02_REG_L28CTRL, 99 + S2MPU02_REG_LDODSCH1, 100 + S2MPU02_REG_LDODSCH2, 101 + S2MPU02_REG_LDODSCH3, 102 + S2MPU02_REG_LDODSCH4, 103 + S2MPU02_REG_SELMIF, 104 + S2MPU02_REG_RSVD11, 105 + S2MPU02_REG_RSVD12, 106 + S2MPU02_REG_RSVD13, 107 + S2MPU02_REG_DVSSEL, 108 + S2MPU02_REG_DVSPTR, 109 + S2MPU02_REG_DVSDATA, 110 + }; 111 + 112 + /* S2MPU02 regulator ids */ 113 + enum S2MPU02_regulators { 114 + S2MPU02_LDO1, 115 + S2MPU02_LDO2, 116 + S2MPU02_LDO3, 117 + S2MPU02_LDO4, 118 + S2MPU02_LDO5, 119 + S2MPU02_LDO6, 120 + S2MPU02_LDO7, 121 + S2MPU02_LDO8, 122 + S2MPU02_LDO9, 123 + S2MPU02_LDO10, 124 + S2MPU02_LDO11, 125 + S2MPU02_LDO12, 126 + S2MPU02_LDO13, 127 + S2MPU02_LDO14, 128 + S2MPU02_LDO15, 129 + S2MPU02_LDO16, 130 + S2MPU02_LDO17, 131 + S2MPU02_LDO18, 132 + S2MPU02_LDO19, 133 + S2MPU02_LDO20, 134 + S2MPU02_LDO21, 135 + S2MPU02_LDO22, 136 + S2MPU02_LDO23, 137 + S2MPU02_LDO24, 138 + S2MPU02_LDO25, 139 + S2MPU02_LDO26, 140 + S2MPU02_LDO27, 141 + S2MPU02_LDO28, 142 + S2MPU02_BUCK1, 143 + S2MPU02_BUCK2, 144 + S2MPU02_BUCK3, 145 + S2MPU02_BUCK4, 146 + S2MPU02_BUCK5, 147 + S2MPU02_BUCK6, 148 + S2MPU02_BUCK7, 149 + 150 + S2MPU02_REGULATOR_MAX, 151 + }; 152 + 153 + /* Regulator constraints for BUCKx */ 154 + #define S2MPU02_BUCK1234_MIN_600MV 600000 155 + #define S2MPU02_BUCK5_MIN_1081_25MV 1081250 156 + #define S2MPU02_BUCK6_MIN_1700MV 1700000 157 + #define S2MPU02_BUCK7_MIN_900MV 900000 158 + 159 + #define S2MPU02_BUCK1234_STEP_6_25MV 6250 160 + #define S2MPU02_BUCK5_STEP_6_25MV 6250 161 + #define S2MPU02_BUCK6_STEP_2_50MV 2500 162 + #define S2MPU02_BUCK7_STEP_6_25MV 6250 163 + 164 + #define S2MPU02_BUCK1234_START_SEL 0x00 165 + #define S2MPU02_BUCK5_START_SEL 0x4D 166 + #define S2MPU02_BUCK6_START_SEL 0x28 167 + #define S2MPU02_BUCK7_START_SEL 0x30 168 + 169 + #define S2MPU02_BUCK_RAMP_DELAY 12500 170 + 171 + /* Regulator constraints for different types of LDOx */ 172 + #define S2MPU02_LDO_MIN_900MV 900000 173 + #define S2MPU02_LDO_MIN_1050MV 1050000 174 + #define S2MPU02_LDO_MIN_1600MV 1600000 175 + #define S2MPU02_LDO_STEP_12_5MV 12500 176 + #define S2MPU02_LDO_STEP_25MV 25000 177 + #define S2MPU02_LDO_STEP_50MV 50000 178 + 179 + #define S2MPU02_LDO_GROUP1_START_SEL 0x8 180 + #define S2MPU02_LDO_GROUP2_START_SEL 0xA 181 + #define S2MPU02_LDO_GROUP3_START_SEL 0x10 182 + 183 + #define S2MPU02_LDO_VSEL_MASK 0x3F 184 + #define S2MPU02_BUCK_VSEL_MASK 0xFF 185 + #define S2MPU02_ENABLE_MASK (0x03 << S2MPU02_ENABLE_SHIFT) 186 + #define S2MPU02_ENABLE_SHIFT 6 187 + 188 + /* On/Off controlled by PWREN */ 189 + #define S2MPU02_ENABLE_SUSPEND (0x01 << S2MPU02_ENABLE_SHIFT) 190 + #define S2MPU02_DISABLE_SUSPEND (0x11 << S2MPU02_ENABLE_SHIFT) 191 + #define S2MPU02_LDO_N_VOLTAGES (S2MPU02_LDO_VSEL_MASK + 1) 192 + #define S2MPU02_BUCK_N_VOLTAGES (S2MPU02_BUCK_VSEL_MASK + 1) 193 + 194 + /* RAMP delay for BUCK1234*/ 195 + #define S2MPU02_BUCK1_RAMP_SHIFT 6 196 + #define S2MPU02_BUCK2_RAMP_SHIFT 4 197 + #define S2MPU02_BUCK3_RAMP_SHIFT 2 198 + #define S2MPU02_BUCK4_RAMP_SHIFT 0 199 + #define S2MPU02_BUCK1234_RAMP_MASK 0x3 200 + 201 + #endif /* __LINUX_MFD_S2MPU02_H */
+1 -1
include/linux/mfd/tps65910.h
··· 892 892 struct device *dev; 893 893 struct i2c_client *i2c_client; 894 894 struct regmap *regmap; 895 - unsigned int id; 895 + unsigned long id; 896 896 897 897 /* Client devices */ 898 898 struct tps65910_pmic *pmic;
+5 -5
sound/soc/codecs/arizona.c
··· 107 107 break; 108 108 case SND_SOC_DAPM_POST_PMU: 109 109 val = snd_soc_read(codec, ARIZONA_INTERRUPT_RAW_STATUS_3); 110 - if (val & ARIZONA_SPK_SHUTDOWN_STS) { 110 + if (val & ARIZONA_SPK_OVERHEAT_STS) { 111 111 dev_crit(arizona->dev, 112 112 "Speaker not enabled due to temperature\n"); 113 113 return -EBUSY; ··· 159 159 if (ret != 0) { 160 160 dev_err(arizona->dev, "Failed to read thermal status: %d\n", 161 161 ret); 162 - } else if (val & ARIZONA_SPK_SHUTDOWN_WARN_STS) { 162 + } else if (val & ARIZONA_SPK_OVERHEAT_WARN_STS) { 163 163 dev_crit(arizona->dev, "Thermal warning\n"); 164 164 } 165 165 ··· 177 177 if (ret != 0) { 178 178 dev_err(arizona->dev, "Failed to read thermal status: %d\n", 179 179 ret); 180 - } else if (val & ARIZONA_SPK_SHUTDOWN_STS) { 180 + } else if (val & ARIZONA_SPK_OVERHEAT_STS) { 181 181 dev_crit(arizona->dev, "Thermal shutdown\n"); 182 182 ret = regmap_update_bits(arizona->regmap, 183 183 ARIZONA_OUTPUT_ENABLES_1, ··· 223 223 break; 224 224 } 225 225 226 - ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_SHUTDOWN_WARN, 226 + ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_OVERHEAT_WARN, 227 227 "Thermal warning", arizona_thermal_warn, 228 228 arizona); 229 229 if (ret != 0) ··· 231 231 "Failed to get thermal warning IRQ: %d\n", 232 232 ret); 233 233 234 - ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_SHUTDOWN, 234 + ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_OVERHEAT, 235 235 "Thermal shutdown", arizona_thermal_shutdown, 236 236 arizona); 237 237 if (ret != 0)