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

Merge tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next

Pull MFD update from Samuel Ortiz:
"For the 3.11 merge we only have one new MFD driver for the Kontron
PLD.

But we also have:
- Support for the TPS659038 PMIC from the palmas driver.
- Intel's Coleto Creek and Avoton SoCs support from the lpc_ich
driver.
- RTL8411B support from the rtsx driver.
- More DT support for the Arizona, max8998, twl4030-power and the
ti_am335x_tsadc drivers.
- The SSBI driver move under MFD.
- A conversion to the devm_* API for most of the MFD drivers.
- The twl4030-power got split from twl-core into its own module.
- A major ti_am335x_adc cleanup, leading to a proper DT support.
- Our regular arizona and wm* updates and cleanups from the Wolfson
folks.
- A better error handling and initialization, and a regulator
subdevice addition for the 88pm80x driver.
- A bulk platform_set_drvdata() call removal that's no longer need
since commit 0998d0631001 ("device-core: Ensure drvdata = NULL when
no driver is bound")

* tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (102 commits)
mfd: sec: Provide max_register to regmap
mfd: wm8994: Remove duplicate check for active JACKDET
MAINTAINERS: Add include directory to MFD file patterns
mfd: sec: Remove fields not used since regmap conversion
watchdog: Kontron PLD watchdog timer driver
mfd: max8998: Add support for Device Tree
regulator: max8998: Use arrays for specifying voltages in platform data
mfd: max8998: Add irq domain support
regulator: palmas: Add TPS659038 support
mfd: Kontron PLD mfd driver
mfd: palmas: Add TPS659038 PMIC support
mfd: palmas: Add SMPS10_BOOST feature
mfd: palmas: Check if irq is valid
mfd: lpc_ich: iTCO_wdt patch for Intel Coleto Creek DeviceIDs
mfd: twl-core: Change TWL6025 references to TWL6032
mfd: davinci_voicecodec: Fix build breakage
mfd: vexpress: Make the driver optional for arm and arm64
mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
mfd: davinci_voicecodec: Convert to use devm_* APIs
mfd: twl4030-power: Fix relocking on error
...

+4831 -1013
+44
Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
··· 1 + * TI - TSC ADC (Touschscreen and analog digital converter) 2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 + 4 + Required properties: 5 + - child "tsc" 6 + ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen 7 + support on the platform. 8 + ti,x-plate-resistance: X plate resistance 9 + ti,coordiante-readouts: The sequencer supports a total of 16 10 + programmable steps each step is used to 11 + read a single coordinate. A single 12 + readout is enough but multiple reads can 13 + increase the quality. 14 + A value of 5 means, 5 reads for X, 5 for 15 + Y and 2 for Z (always). This utilises 12 16 + of the 16 software steps available. The 17 + remaining 4 can be used by the ADC. 18 + ti,wire-config: Different boards could have a different order for 19 + connecting wires on touchscreen. We need to provide an 20 + 8 bit number where in the 1st four bits represent the 21 + analog lines and the next 4 bits represent positive/ 22 + negative terminal on that input line. Notations to 23 + represent the input lines and terminals resoectively 24 + is as follows: 25 + AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7. 26 + XP = 0, XN = 1, YP = 2, YN = 3. 27 + - child "adc" 28 + ti,adc-channels: List of analog inputs available for ADC. 29 + AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7. 30 + 31 + Example: 32 + tscadc: tscadc@44e0d000 { 33 + compatible = "ti,am3359-tscadc"; 34 + tsc { 35 + ti,wires = <4>; 36 + ti,x-plate-resistance = <200>; 37 + ti,coordiante-readouts = <5>; 38 + ti,wire-config = <0x00 0x11 0x22 0x33>; 39 + }; 40 + 41 + adc { 42 + ti,adc-channels = <4 5 6 7>; 43 + }; 44 + }
+119
Documentation/devicetree/bindings/mfd/max8998.txt
··· 1 + * Maxim MAX8998, National/TI LP3974 multi-function device 2 + 3 + The Maxim MAX8998 is a multi-function device which includes voltage/current 4 + regulators, real time clock, battery charging controller and several 5 + other sub-blocks. It is interfaced using an I2C interface. Each sub-block 6 + is addressed by the host system using different i2c slave address. 7 + 8 + PMIC sub-block 9 + -------------- 10 + 11 + The PMIC sub-block contains a number of voltage and current regulators, 12 + with controllable parameters and dynamic voltage scaling capability. 13 + In addition, it includes a real time clock and battery charging controller 14 + as well. It is accessible at I2C address 0x66. 15 + 16 + Required properties: 17 + - compatible: Should be one of the following: 18 + - "maxim,max8998" for Maxim MAX8998 19 + - "national,lp3974" or "ti,lp3974" for National/TI LP3974. 20 + - reg: Specifies the i2c slave address of the pmic block. It should be 0x66. 21 + 22 + Optional properties: 23 + - interrupt-parent: Specifies the phandle of the interrupt controller to which 24 + the interrupts from MAX8998 are routed to. 25 + - interrupts: Interrupt specifiers for two interrupt sources. 26 + - First interrupt specifier is for main interrupt. 27 + - Second interrupt specifier is for power-on/-off interrupt. 28 + - max8998,pmic-buck1-dvs-gpios: GPIO specifiers for two host gpios used 29 + for buck 1 dvs. The format of the gpio specifier depends on the gpio 30 + controller. 31 + - max8998,pmic-buck2-dvs-gpio: GPIO specifier for host gpio used 32 + for buck 2 dvs. The format of the gpio specifier depends on the gpio 33 + controller. 34 + - max8998,pmic-buck1-default-dvs-idx: Default voltage setting selected from 35 + the possible 4 options selectable by the dvs gpios. The value of this 36 + property should be 0, 1, 2 or 3. If not specified or out of range, 37 + a default value of 0 is taken. 38 + - max8998,pmic-buck2-default-dvs-idx: Default voltage setting selected from 39 + the possible 2 options selectable by the dvs gpios. The value of this 40 + property should be 0 or 1. If not specified or out of range, a default 41 + value of 0 is taken. 42 + - max8998,pmic-buck-voltage-lock: If present, disallows changing of 43 + preprogrammed buck dvfs voltages. 44 + 45 + Additional properties required if max8998,pmic-buck1-dvs-gpios is defined: 46 + - max8998,pmic-buck1-dvs-voltage: An array of 4 voltage values in microvolts 47 + for buck1 regulator that can be selected using dvs gpio. 48 + 49 + Additional properties required if max8998,pmic-buck2-dvs-gpio is defined: 50 + - max8998,pmic-buck2-dvs-voltage: An array of 2 voltage values in microvolts 51 + for buck2 regulator that can be selected using dvs gpio. 52 + 53 + Regulators: All the regulators of MAX8998 to be instantiated shall be 54 + listed in a child node named 'regulators'. Each regulator is represented 55 + by a child node of the 'regulators' node. 56 + 57 + regulator-name { 58 + /* standard regulator bindings here */ 59 + }; 60 + 61 + Following regulators of the MAX8998 PMIC block are supported. Note that 62 + the 'n' in regulator name, as in LDOn or BUCKn, represents the LDO or BUCK 63 + number as described in MAX8998 datasheet. 64 + 65 + - LDOn 66 + - valid values for n are 2 to 17 67 + - Example: LDO2, LDO10, LDO17 68 + - BUCKn 69 + - valid values for n are 1 to 4. 70 + - Example: BUCK1, BUCK2, BUCK3, BUCK4 71 + 72 + - ENVICHG: Battery Charging Current Monitor Output. This is a fixed 73 + voltage type regulator 74 + 75 + - ESAFEOUT1: (ldo19) 76 + - ESAFEOUT2: (ld020) 77 + 78 + Standard regulator bindings are used inside regulator subnodes. Check 79 + Documentation/devicetree/bindings/regulator/regulator.txt 80 + for more details. 81 + 82 + Example: 83 + 84 + pmic@66 { 85 + compatible = "maxim,max8998-pmic"; 86 + reg = <0x66>; 87 + interrupt-parent = <&wakeup_eint>; 88 + interrupts = <4 0>, <3 0>; 89 + 90 + /* Buck 1 DVS settings */ 91 + max8998,pmic-buck1-default-dvs-idx = <0>; 92 + max8998,pmic-buck1-dvs-gpios = <&gpx0 0 1 0 0>, /* SET1 */ 93 + <&gpx0 1 1 0 0>; /* SET2 */ 94 + max8998,pmic-buck1-dvs-voltage = <1350000>, <1300000>, 95 + <1000000>, <950000>; 96 + 97 + /* Buck 2 DVS settings */ 98 + max8998,pmic-buck2-default-dvs-idx = <0>; 99 + max8998,pmic-buck2-dvs-gpio = <&gpx0 0 3 0 0>; /* SET3 */ 100 + max8998,pmic-buck2-dvs-voltage = <1350000>, <1300000>; 101 + 102 + /* Regulators to instantiate */ 103 + regulators { 104 + ldo2_reg: LDO2 { 105 + regulator-name = "VDD_ALIVE_1.1V"; 106 + regulator-min-microvolt = <1100000>; 107 + regulator-max-microvolt = <1100000>; 108 + regulator-always-on; 109 + }; 110 + 111 + buck1_reg: BUCK1 { 112 + regulator-name = "VDD_ARM_1.2V"; 113 + regulator-min-microvolt = <950000>; 114 + regulator-max-microvolt = <1350000>; 115 + regulator-always-on; 116 + regulator-boot-on; 117 + }; 118 + }; 119 + };
+28
Documentation/devicetree/bindings/mfd/twl4030-power.txt
··· 1 + Texas Instruments TWL family (twl4030) reset and power management module 2 + 3 + The power management module inside the TWL family provides several facilities 4 + to control the power resources, including power scripts. For now, the 5 + binding only supports the complete shutdown of the system after poweroff. 6 + 7 + Required properties: 8 + - compatible : must be "ti,twl4030-power" 9 + 10 + Optional properties: 11 + - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or 12 + SLEEP-to-OFF transition when the system poweroffs. 13 + 14 + Example: 15 + &i2c1 { 16 + clock-frequency = <2600000>; 17 + 18 + twl: twl@48 { 19 + reg = <0x48>; 20 + interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 21 + interrupt-parent = <&intc>; 22 + 23 + twl_power: power { 24 + compatible = "ti,twl4030-power"; 25 + ti,use_poweroff; 26 + }; 27 + }; 28 + };
+13 -13
Documentation/devicetree/bindings/regulator/twl-regulator.txt
··· 18 18 - "ti,twl6030-vdd1" for VDD1 SMPS 19 19 - "ti,twl6030-vdd2" for VDD2 SMPS 20 20 - "ti,twl6030-vdd3" for VDD3 SMPS 21 - For twl6025 regulators/LDOs 21 + For twl6032 regulators/LDOs 22 22 - compatible: 23 - - "ti,twl6025-ldo1" for LDO1 LDO 24 - - "ti,twl6025-ldo2" for LDO2 LDO 25 - - "ti,twl6025-ldo3" for LDO3 LDO 26 - - "ti,twl6025-ldo4" for LDO4 LDO 27 - - "ti,twl6025-ldo5" for LDO5 LDO 28 - - "ti,twl6025-ldo6" for LDO6 LDO 29 - - "ti,twl6025-ldo7" for LDO7 LDO 30 - - "ti,twl6025-ldoln" for LDOLN LDO 31 - - "ti,twl6025-ldousb" for LDOUSB LDO 32 - - "ti,twl6025-smps3" for SMPS3 SMPS 33 - - "ti,twl6025-smps4" for SMPS4 SMPS 34 - - "ti,twl6025-vio" for VIO SMPS 23 + - "ti,twl6032-ldo1" for LDO1 LDO 24 + - "ti,twl6032-ldo2" for LDO2 LDO 25 + - "ti,twl6032-ldo3" for LDO3 LDO 26 + - "ti,twl6032-ldo4" for LDO4 LDO 27 + - "ti,twl6032-ldo5" for LDO5 LDO 28 + - "ti,twl6032-ldo6" for LDO6 LDO 29 + - "ti,twl6032-ldo7" for LDO7 LDO 30 + - "ti,twl6032-ldoln" for LDOLN LDO 31 + - "ti,twl6032-ldousb" for LDOUSB LDO 32 + - "ti,twl6032-smps3" for SMPS3 SMPS 33 + - "ti,twl6032-smps4" for SMPS4 SMPS 34 + - "ti,twl6032-vio" for VIO SMPS 35 35 For twl4030 regulators/LDOs 36 36 - compatible: 37 37 - "ti,twl4030-vaux1" for VAUX1 LDO
+1 -1
Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
··· 8 8 usb interrupt number that raises VBUS interrupts when the controller has to 9 9 act as device 10 10 - usb-supply : phandle to the regulator device tree node. It should be vusb 11 - if it is twl6030 or ldousb if it is twl6025 subclass. 11 + if it is twl6030 or ldousb if it is twl6032 subclass. 12 12 13 13 twl6030-usb { 14 14 compatible = "ti,twl6030-usb";
+4 -1
MAINTAINERS
··· 5500 5500 5501 5501 MULTIFUNCTION DEVICES (MFD) 5502 5502 M: Samuel Ortiz <sameo@linux.intel.com> 5503 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git 5503 + M: Lee Jones <lee.jones@linaro.org> 5504 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next.git 5505 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes.git 5504 5506 S: Supported 5505 5507 F: drivers/mfd/ 5508 + F: include/linux/mfd/ 5506 5509 5507 5510 MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 5508 5511 M: Chris Ball <cjb@laptop.org>
+14
arch/arm/boot/dts/am335x-evm.dts
··· 474 474 phy_id = <&davinci_mdio>, <1>; 475 475 phy-mode = "rgmii-txid"; 476 476 }; 477 + 478 + &tscadc { 479 + status = "okay"; 480 + tsc { 481 + ti,wires = <4>; 482 + ti,x-plate-resistance = <200>; 483 + ti,coordiante-readouts = <5>; 484 + ti,wire-config = <0x00 0x11 0x22 0x33>; 485 + }; 486 + 487 + adc { 488 + ti,adc-channels = <4 5 6 7>; 489 + }; 490 + };
+17
arch/arm/boot/dts/am33xx.dtsi
··· 502 502 status = "disabled"; 503 503 }; 504 504 505 + tscadc: tscadc@44e0d000 { 506 + compatible = "ti,am3359-tscadc"; 507 + reg = <0x44e0d000 0x1000>; 508 + interrupt-parent = <&intc>; 509 + interrupts = <16>; 510 + ti,hwmods = "adc_tsc"; 511 + status = "disabled"; 512 + 513 + tsc { 514 + compatible = "ti,am3359-tsc"; 515 + }; 516 + am335x_adc: adc { 517 + #io-channel-cells = <1>; 518 + compatible = "ti,am3359-adc"; 519 + }; 520 + }; 521 + 505 522 gpmc: gpmc@50000000 { 506 523 compatible = "ti,am3352-gpmc"; 507 524 ti,hwmods = "gpmc";
+2 -6
arch/arm/mach-s5pv210/mach-aquila.c
··· 377 377 .buck1_set1 = S5PV210_GPH0(3), 378 378 .buck1_set2 = S5PV210_GPH0(4), 379 379 .buck2_set3 = S5PV210_GPH0(5), 380 - .buck1_voltage1 = 1200000, 381 - .buck1_voltage2 = 1200000, 382 - .buck1_voltage3 = 1200000, 383 - .buck1_voltage4 = 1200000, 384 - .buck2_voltage1 = 1200000, 385 - .buck2_voltage2 = 1200000, 380 + .buck1_voltage = { 1200000, 1200000, 1200000, 1200000 }, 381 + .buck2_voltage = { 1200000, 1200000 }, 386 382 }; 387 383 #endif 388 384
+2 -6
arch/arm/mach-s5pv210/mach-goni.c
··· 580 580 .buck1_set1 = S5PV210_GPH0(3), 581 581 .buck1_set2 = S5PV210_GPH0(4), 582 582 .buck2_set3 = S5PV210_GPH0(5), 583 - .buck1_voltage1 = 1200000, 584 - .buck1_voltage2 = 1200000, 585 - .buck1_voltage3 = 1200000, 586 - .buck1_voltage4 = 1200000, 587 - .buck2_voltage1 = 1200000, 588 - .buck2_voltage2 = 1200000, 583 + .buck1_voltage = { 1200000, 1200000, 1200000, 1200000 }, 584 + .buck2_voltage = { 1200000, 1200000 }, 589 585 }; 590 586 #endif 591 587
-2
drivers/Kconfig
··· 52 52 53 53 source "drivers/spi/Kconfig" 54 54 55 - source "drivers/ssbi/Kconfig" 56 - 57 55 source "drivers/hsi/Kconfig" 58 56 59 57 source "drivers/pps/Kconfig"
-1
drivers/Makefile
··· 117 117 obj-$(CONFIG_CRYPTO) += crypto/ 118 118 obj-$(CONFIG_SUPERH) += sh/ 119 119 obj-$(CONFIG_ARCH_SHMOBILE) += sh/ 120 - obj-$(CONFIG_SSBI) += ssbi/ 121 120 ifndef CONFIG_ARCH_USES_GETTIMEOFFSET 122 121 obj-y += clocksource/ 123 122 endif
+100 -32
drivers/iio/adc/ti_am335x_adc.c
··· 22 22 #include <linux/platform_device.h> 23 23 #include <linux/io.h> 24 24 #include <linux/iio/iio.h> 25 + #include <linux/of.h> 26 + #include <linux/of_device.h> 27 + #include <linux/iio/machine.h> 28 + #include <linux/iio/driver.h> 25 29 26 30 #include <linux/mfd/ti_am335x_tscadc.h> 27 - #include <linux/platform_data/ti_am335x_adc.h> 28 31 29 32 struct tiadc_device { 30 33 struct ti_tscadc_dev *mfd_tscadc; 31 34 int channels; 35 + u8 channel_line[8]; 36 + u8 channel_step[8]; 32 37 }; 33 38 34 39 static unsigned int tiadc_readl(struct tiadc_device *adc, unsigned int reg) ··· 47 42 writel(val, adc->mfd_tscadc->tscadc_base + reg); 48 43 } 49 44 45 + static u32 get_adc_step_mask(struct tiadc_device *adc_dev) 46 + { 47 + u32 step_en; 48 + 49 + step_en = ((1 << adc_dev->channels) - 1); 50 + step_en <<= TOTAL_STEPS - adc_dev->channels + 1; 51 + return step_en; 52 + } 53 + 50 54 static void tiadc_step_config(struct tiadc_device *adc_dev) 51 55 { 52 56 unsigned int stepconfig; 53 - int i, channels = 0, steps; 57 + int i, steps; 58 + u32 step_en; 54 59 55 60 /* 56 61 * There are 16 configurable steps and 8 analog input ··· 73 58 */ 74 59 75 60 steps = TOTAL_STEPS - adc_dev->channels; 76 - channels = TOTAL_CHANNELS - adc_dev->channels; 77 - 78 61 stepconfig = STEPCONFIG_AVG_16 | STEPCONFIG_FIFO1; 79 62 80 - for (i = (steps + 1); i <= TOTAL_STEPS; i++) { 81 - tiadc_writel(adc_dev, REG_STEPCONFIG(i), 82 - stepconfig | STEPCONFIG_INP(channels)); 83 - tiadc_writel(adc_dev, REG_STEPDELAY(i), 63 + for (i = 0; i < adc_dev->channels; i++) { 64 + int chan; 65 + 66 + chan = adc_dev->channel_line[i]; 67 + tiadc_writel(adc_dev, REG_STEPCONFIG(steps), 68 + stepconfig | STEPCONFIG_INP(chan)); 69 + tiadc_writel(adc_dev, REG_STEPDELAY(steps), 84 70 STEPCONFIG_OPENDLY); 85 - channels++; 71 + adc_dev->channel_step[i] = steps; 72 + steps++; 86 73 } 87 - tiadc_writel(adc_dev, REG_SE, STPENB_STEPENB); 74 + step_en = get_adc_step_mask(adc_dev); 75 + am335x_tsc_se_set(adc_dev->mfd_tscadc, step_en); 88 76 } 77 + 78 + static const char * const chan_name_ain[] = { 79 + "AIN0", 80 + "AIN1", 81 + "AIN2", 82 + "AIN3", 83 + "AIN4", 84 + "AIN5", 85 + "AIN6", 86 + "AIN7", 87 + }; 89 88 90 89 static int tiadc_channel_init(struct iio_dev *indio_dev, int channels) 91 90 { 91 + struct tiadc_device *adc_dev = iio_priv(indio_dev); 92 92 struct iio_chan_spec *chan_array; 93 + struct iio_chan_spec *chan; 93 94 int i; 94 95 95 96 indio_dev->num_channels = channels; 96 - chan_array = kcalloc(indio_dev->num_channels, 97 + chan_array = kcalloc(channels, 97 98 sizeof(struct iio_chan_spec), GFP_KERNEL); 98 - 99 99 if (chan_array == NULL) 100 100 return -ENOMEM; 101 101 102 - for (i = 0; i < (indio_dev->num_channels); i++) { 103 - struct iio_chan_spec *chan = chan_array + i; 102 + chan = chan_array; 103 + for (i = 0; i < channels; i++, chan++) { 104 + 104 105 chan->type = IIO_VOLTAGE; 105 106 chan->indexed = 1; 106 - chan->channel = i; 107 + chan->channel = adc_dev->channel_line[i]; 107 108 chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW); 109 + chan->datasheet_name = chan_name_ain[chan->channel]; 110 + chan->scan_type.sign = 'u'; 111 + chan->scan_type.realbits = 12; 112 + chan->scan_type.storagebits = 32; 108 113 } 109 114 110 115 indio_dev->channels = chan_array; 111 116 112 - return indio_dev->num_channels; 117 + return 0; 113 118 } 114 119 115 120 static void tiadc_channels_remove(struct iio_dev *indio_dev) ··· 143 108 { 144 109 struct tiadc_device *adc_dev = iio_priv(indio_dev); 145 110 int i; 146 - unsigned int fifo1count, readx1; 111 + unsigned int fifo1count, read; 112 + u32 step = UINT_MAX; 113 + bool found = false; 147 114 148 115 /* 149 116 * When the sub-system is first enabled, ··· 158 121 * Hence we need to flush out this data. 159 122 */ 160 123 124 + for (i = 0; i < ARRAY_SIZE(adc_dev->channel_step); i++) { 125 + if (chan->channel == adc_dev->channel_line[i]) { 126 + step = adc_dev->channel_step[i]; 127 + break; 128 + } 129 + } 130 + if (WARN_ON_ONCE(step == UINT_MAX)) 131 + return -EINVAL; 132 + 161 133 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); 162 134 for (i = 0; i < fifo1count; i++) { 163 - readx1 = tiadc_readl(adc_dev, REG_FIFO1); 164 - if (i == chan->channel) 165 - *val = readx1 & 0xfff; 135 + read = tiadc_readl(adc_dev, REG_FIFO1); 136 + if (read >> 16 == step) { 137 + *val = read & 0xfff; 138 + found = true; 139 + } 166 140 } 167 - tiadc_writel(adc_dev, REG_SE, STPENB_STEPENB); 168 - 141 + am335x_tsc_se_update(adc_dev->mfd_tscadc); 142 + if (found == false) 143 + return -EBUSY; 169 144 return IIO_VAL_INT; 170 145 } 171 146 ··· 189 140 { 190 141 struct iio_dev *indio_dev; 191 142 struct tiadc_device *adc_dev; 192 - struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; 193 - struct mfd_tscadc_board *pdata; 143 + struct device_node *node = pdev->dev.of_node; 144 + struct property *prop; 145 + const __be32 *cur; 194 146 int err; 147 + u32 val; 148 + int channels = 0; 195 149 196 - pdata = tscadc_dev->dev->platform_data; 197 - if (!pdata || !pdata->adc_init) { 198 - dev_err(&pdev->dev, "Could not find platform data\n"); 150 + if (!node) { 151 + dev_err(&pdev->dev, "Could not find valid DT data.\n"); 199 152 return -EINVAL; 200 153 } 201 154 ··· 209 158 } 210 159 adc_dev = iio_priv(indio_dev); 211 160 212 - adc_dev->mfd_tscadc = tscadc_dev; 213 - adc_dev->channels = pdata->adc_init->adc_channels; 161 + adc_dev->mfd_tscadc = ti_tscadc_dev_get(pdev); 162 + 163 + of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) { 164 + adc_dev->channel_line[channels] = val; 165 + channels++; 166 + } 167 + adc_dev->channels = channels; 214 168 215 169 indio_dev->dev.parent = &pdev->dev; 216 170 indio_dev->name = dev_name(&pdev->dev); ··· 247 191 static int tiadc_remove(struct platform_device *pdev) 248 192 { 249 193 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 194 + struct tiadc_device *adc_dev = iio_priv(indio_dev); 195 + u32 step_en; 250 196 251 197 iio_device_unregister(indio_dev); 252 198 tiadc_channels_remove(indio_dev); 199 + 200 + step_en = get_adc_step_mask(adc_dev); 201 + am335x_tsc_se_clr(adc_dev->mfd_tscadc, step_en); 253 202 254 203 iio_device_free(indio_dev); 255 204 ··· 266 205 { 267 206 struct iio_dev *indio_dev = dev_get_drvdata(dev); 268 207 struct tiadc_device *adc_dev = iio_priv(indio_dev); 269 - struct ti_tscadc_dev *tscadc_dev = dev->platform_data; 208 + struct ti_tscadc_dev *tscadc_dev; 270 209 unsigned int idle; 271 210 211 + tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev)); 272 212 if (!device_may_wakeup(tscadc_dev->dev)) { 273 213 idle = tiadc_readl(adc_dev, REG_CTRL); 274 214 idle &= ~(CNTRLREG_TSCSSENB); ··· 305 243 #define TIADC_PM_OPS NULL 306 244 #endif 307 245 246 + static const struct of_device_id ti_adc_dt_ids[] = { 247 + { .compatible = "ti,am3359-adc", }, 248 + { } 249 + }; 250 + MODULE_DEVICE_TABLE(of, ti_adc_dt_ids); 251 + 308 252 static struct platform_driver tiadc_driver = { 309 253 .driver = { 310 - .name = "tiadc", 254 + .name = "TI-am335x-adc", 311 255 .owner = THIS_MODULE, 312 256 .pm = TIADC_PM_OPS, 257 + .of_match_table = of_match_ptr(ti_adc_dt_ids), 313 258 }, 314 259 .probe = tiadc_probe, 315 260 .remove = tiadc_remove, 316 261 }; 317 - 318 262 module_platform_driver(tiadc_driver); 319 263 320 264 MODULE_DESCRIPTION("TI ADC controller driver");
+203 -85
drivers/input/touchscreen/ti_am335x_tsc.c
··· 24 24 #include <linux/clk.h> 25 25 #include <linux/platform_device.h> 26 26 #include <linux/io.h> 27 - #include <linux/input/ti_am335x_tsc.h> 28 27 #include <linux/delay.h> 28 + #include <linux/of.h> 29 + #include <linux/of_device.h> 29 30 30 31 #include <linux/mfd/ti_am335x_tscadc.h> 31 32 32 33 #define ADCFSM_STEPID 0x10 33 34 #define SEQ_SETTLE 275 34 35 #define MAX_12BIT ((1 << 12) - 1) 36 + 37 + static const int config_pins[] = { 38 + STEPCONFIG_XPP, 39 + STEPCONFIG_XNN, 40 + STEPCONFIG_YPP, 41 + STEPCONFIG_YNN, 42 + }; 35 43 36 44 struct titsc { 37 45 struct input_dev *input; ··· 48 40 unsigned int wires; 49 41 unsigned int x_plate_resistance; 50 42 bool pen_down; 51 - int steps_to_configure; 43 + int coordinate_readouts; 44 + u32 config_inp[4]; 45 + u32 bit_xp, bit_xn, bit_yp, bit_yn; 46 + u32 inp_xp, inp_xn, inp_yp, inp_yn; 52 47 }; 53 48 54 49 static unsigned int titsc_readl(struct titsc *ts, unsigned int reg) ··· 65 54 writel(val, tsc->mfd_tscadc->tscadc_base + reg); 66 55 } 67 56 57 + static int titsc_config_wires(struct titsc *ts_dev) 58 + { 59 + u32 analog_line[4]; 60 + u32 wire_order[4]; 61 + int i, bit_cfg; 62 + 63 + for (i = 0; i < 4; i++) { 64 + /* 65 + * Get the order in which TSC wires are attached 66 + * w.r.t. each of the analog input lines on the EVM. 67 + */ 68 + analog_line[i] = (ts_dev->config_inp[i] & 0xF0) >> 4; 69 + wire_order[i] = ts_dev->config_inp[i] & 0x0F; 70 + if (WARN_ON(analog_line[i] > 7)) 71 + return -EINVAL; 72 + if (WARN_ON(wire_order[i] > ARRAY_SIZE(config_pins))) 73 + return -EINVAL; 74 + } 75 + 76 + for (i = 0; i < 4; i++) { 77 + int an_line; 78 + int wi_order; 79 + 80 + an_line = analog_line[i]; 81 + wi_order = wire_order[i]; 82 + bit_cfg = config_pins[wi_order]; 83 + if (bit_cfg == 0) 84 + return -EINVAL; 85 + switch (wi_order) { 86 + case 0: 87 + ts_dev->bit_xp = bit_cfg; 88 + ts_dev->inp_xp = an_line; 89 + break; 90 + 91 + case 1: 92 + ts_dev->bit_xn = bit_cfg; 93 + ts_dev->inp_xn = an_line; 94 + break; 95 + 96 + case 2: 97 + ts_dev->bit_yp = bit_cfg; 98 + ts_dev->inp_yp = an_line; 99 + break; 100 + case 3: 101 + ts_dev->bit_yn = bit_cfg; 102 + ts_dev->inp_yn = an_line; 103 + break; 104 + } 105 + } 106 + return 0; 107 + } 108 + 68 109 static void titsc_step_config(struct titsc *ts_dev) 69 110 { 70 111 unsigned int config; 71 - int i, total_steps; 72 - 73 - /* Configure the Step registers */ 74 - total_steps = 2 * ts_dev->steps_to_configure; 112 + int i; 113 + int end_step; 114 + u32 stepenable; 75 115 76 116 config = STEPCONFIG_MODE_HWSYNC | 77 - STEPCONFIG_AVG_16 | STEPCONFIG_XPP; 117 + STEPCONFIG_AVG_16 | ts_dev->bit_xp; 78 118 switch (ts_dev->wires) { 79 119 case 4: 80 - config |= STEPCONFIG_INP_AN2 | STEPCONFIG_XNN; 120 + config |= STEPCONFIG_INP(ts_dev->inp_yp) | ts_dev->bit_xn; 81 121 break; 82 122 case 5: 83 - config |= STEPCONFIG_YNN | 84 - STEPCONFIG_INP_AN4 | STEPCONFIG_XNN | 85 - STEPCONFIG_YPP; 123 + config |= ts_dev->bit_yn | 124 + STEPCONFIG_INP_AN4 | ts_dev->bit_xn | 125 + ts_dev->bit_yp; 86 126 break; 87 127 case 8: 88 - config |= STEPCONFIG_INP_AN2 | STEPCONFIG_XNN; 128 + config |= STEPCONFIG_INP(ts_dev->inp_yp) | ts_dev->bit_xn; 89 129 break; 90 130 } 91 131 92 - for (i = 1; i <= ts_dev->steps_to_configure; i++) { 132 + /* 1 … coordinate_readouts is for X */ 133 + end_step = ts_dev->coordinate_readouts; 134 + for (i = 0; i < end_step; i++) { 93 135 titsc_writel(ts_dev, REG_STEPCONFIG(i), config); 94 136 titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY); 95 137 } 96 138 97 139 config = 0; 98 140 config = STEPCONFIG_MODE_HWSYNC | 99 - STEPCONFIG_AVG_16 | STEPCONFIG_YNN | 100 - STEPCONFIG_INM_ADCREFM | STEPCONFIG_FIFO1; 141 + STEPCONFIG_AVG_16 | ts_dev->bit_yn | 142 + STEPCONFIG_INM_ADCREFM; 101 143 switch (ts_dev->wires) { 102 144 case 4: 103 - config |= STEPCONFIG_YPP; 145 + config |= ts_dev->bit_yp | STEPCONFIG_INP(ts_dev->inp_xp); 104 146 break; 105 147 case 5: 106 - config |= STEPCONFIG_XPP | STEPCONFIG_INP_AN4 | 107 - STEPCONFIG_XNP | STEPCONFIG_YPN; 148 + config |= ts_dev->bit_xp | STEPCONFIG_INP_AN4 | 149 + ts_dev->bit_xn | ts_dev->bit_yp; 108 150 break; 109 151 case 8: 110 - config |= STEPCONFIG_YPP; 152 + config |= ts_dev->bit_yp | STEPCONFIG_INP(ts_dev->inp_xp); 111 153 break; 112 154 } 113 155 114 - for (i = (ts_dev->steps_to_configure + 1); i <= total_steps; i++) { 156 + /* coordinate_readouts … coordinate_readouts * 2 is for Y */ 157 + end_step = ts_dev->coordinate_readouts * 2; 158 + for (i = ts_dev->coordinate_readouts; i < end_step; i++) { 115 159 titsc_writel(ts_dev, REG_STEPCONFIG(i), config); 116 160 titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY); 117 161 } 118 162 119 - config = 0; 120 163 /* Charge step configuration */ 121 - config = STEPCONFIG_XPP | STEPCONFIG_YNN | 164 + config = ts_dev->bit_xp | ts_dev->bit_yn | 122 165 STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR | 123 - STEPCHARGE_INM_AN1 | STEPCHARGE_INP_AN1; 166 + STEPCHARGE_INM_AN1 | STEPCHARGE_INP(ts_dev->inp_yp); 124 167 125 168 titsc_writel(ts_dev, REG_CHARGECONFIG, config); 126 169 titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY); 127 170 128 - config = 0; 129 - /* Configure to calculate pressure */ 171 + /* coordinate_readouts * 2 … coordinate_readouts * 2 + 2 is for Z */ 130 172 config = STEPCONFIG_MODE_HWSYNC | 131 - STEPCONFIG_AVG_16 | STEPCONFIG_YPP | 132 - STEPCONFIG_XNN | STEPCONFIG_INM_ADCREFM; 133 - titsc_writel(ts_dev, REG_STEPCONFIG(total_steps + 1), config); 134 - titsc_writel(ts_dev, REG_STEPDELAY(total_steps + 1), 173 + STEPCONFIG_AVG_16 | ts_dev->bit_yp | 174 + ts_dev->bit_xn | STEPCONFIG_INM_ADCREFM | 175 + STEPCONFIG_INP(ts_dev->inp_xp); 176 + titsc_writel(ts_dev, REG_STEPCONFIG(end_step), config); 177 + titsc_writel(ts_dev, REG_STEPDELAY(end_step), 135 178 STEPCONFIG_OPENDLY); 136 179 137 - config |= STEPCONFIG_INP_AN3 | STEPCONFIG_FIFO1; 138 - titsc_writel(ts_dev, REG_STEPCONFIG(total_steps + 2), config); 139 - titsc_writel(ts_dev, REG_STEPDELAY(total_steps + 2), 180 + end_step++; 181 + config |= STEPCONFIG_INP(ts_dev->inp_yn); 182 + titsc_writel(ts_dev, REG_STEPCONFIG(end_step), config); 183 + titsc_writel(ts_dev, REG_STEPDELAY(end_step), 140 184 STEPCONFIG_OPENDLY); 141 185 142 - titsc_writel(ts_dev, REG_SE, STPENB_STEPENB_TC); 186 + /* The steps1 … end and bit 0 for TS_Charge */ 187 + stepenable = (1 << (end_step + 2)) - 1; 188 + am335x_tsc_se_set(ts_dev->mfd_tscadc, stepenable); 143 189 } 144 190 145 191 static void titsc_read_coordinates(struct titsc *ts_dev, 146 - unsigned int *x, unsigned int *y) 192 + u32 *x, u32 *y, u32 *z1, u32 *z2) 147 193 { 148 194 unsigned int fifocount = titsc_readl(ts_dev, REG_FIFO0CNT); 149 195 unsigned int prev_val_x = ~0, prev_val_y = ~0; 150 196 unsigned int prev_diff_x = ~0, prev_diff_y = ~0; 151 197 unsigned int read, diff; 152 198 unsigned int i, channel; 199 + unsigned int creads = ts_dev->coordinate_readouts; 153 200 201 + *z1 = *z2 = 0; 202 + if (fifocount % (creads * 2 + 2)) 203 + fifocount -= fifocount % (creads * 2 + 2); 154 204 /* 155 205 * Delta filter is used to remove large variations in sampled 156 206 * values from ADC. The filter tries to predict where the next ··· 220 148 * algorithm compares the difference with that of a present value, 221 149 * if true the value is reported to the sub system. 222 150 */ 223 - for (i = 0; i < fifocount - 1; i++) { 151 + for (i = 0; i < fifocount; i++) { 224 152 read = titsc_readl(ts_dev, REG_FIFO0); 225 - channel = read & 0xf0000; 226 - channel = channel >> 0x10; 227 - if ((channel >= 0) && (channel < ts_dev->steps_to_configure)) { 228 - read &= 0xfff; 153 + 154 + channel = (read & 0xf0000) >> 16; 155 + read &= 0xfff; 156 + if (channel < creads) { 229 157 diff = abs(read - prev_val_x); 230 158 if (diff < prev_diff_x) { 231 159 prev_diff_x = diff; 232 160 *x = read; 233 161 } 234 162 prev_val_x = read; 235 - } 236 163 237 - read = titsc_readl(ts_dev, REG_FIFO1); 238 - channel = read & 0xf0000; 239 - channel = channel >> 0x10; 240 - if ((channel >= ts_dev->steps_to_configure) && 241 - (channel < (2 * ts_dev->steps_to_configure - 1))) { 242 - read &= 0xfff; 164 + } else if (channel < creads * 2) { 243 165 diff = abs(read - prev_val_y); 244 166 if (diff < prev_diff_y) { 245 167 prev_diff_y = diff; 246 168 *y = read; 247 169 } 248 170 prev_val_y = read; 171 + 172 + } else if (channel < creads * 2 + 1) { 173 + *z1 = read; 174 + 175 + } else if (channel < creads * 2 + 2) { 176 + *z2 = read; 249 177 } 250 178 } 251 179 } ··· 258 186 unsigned int x = 0, y = 0; 259 187 unsigned int z1, z2, z; 260 188 unsigned int fsm; 261 - unsigned int fifo1count, fifo0count; 262 - int i; 263 189 264 190 status = titsc_readl(ts_dev, REG_IRQSTATUS); 265 191 if (status & IRQENB_FIFO0THRES) { 266 - titsc_read_coordinates(ts_dev, &x, &y); 267 192 268 - z1 = titsc_readl(ts_dev, REG_FIFO0) & 0xfff; 269 - z2 = titsc_readl(ts_dev, REG_FIFO1) & 0xfff; 270 - 271 - fifo1count = titsc_readl(ts_dev, REG_FIFO1CNT); 272 - for (i = 0; i < fifo1count; i++) 273 - titsc_readl(ts_dev, REG_FIFO1); 274 - 275 - fifo0count = titsc_readl(ts_dev, REG_FIFO0CNT); 276 - for (i = 0; i < fifo0count; i++) 277 - titsc_readl(ts_dev, REG_FIFO0); 193 + titsc_read_coordinates(ts_dev, &x, &y, &z1, &z2); 278 194 279 195 if (ts_dev->pen_down && z1 != 0 && z2 != 0) { 280 196 /* ··· 270 210 * Resistance(touch) = x plate resistance * 271 211 * x postion/4096 * ((z2 / z1) - 1) 272 212 */ 273 - z = z2 - z1; 213 + z = z1 - z2; 274 214 z *= x; 275 215 z *= ts_dev->x_plate_resistance; 276 - z /= z1; 216 + z /= z2; 277 217 z = (z + 2047) >> 12; 278 218 279 219 if (z <= MAX_12BIT) { ··· 308 248 irqclr |= IRQENB_PENUP; 309 249 } 310 250 311 - titsc_writel(ts_dev, REG_IRQSTATUS, irqclr); 251 + if (status & IRQENB_HW_PEN) { 312 252 313 - titsc_writel(ts_dev, REG_SE, STPENB_STEPENB_TC); 314 - return IRQ_HANDLED; 253 + titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00); 254 + titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN); 255 + } 256 + 257 + if (irqclr) { 258 + titsc_writel(ts_dev, REG_IRQSTATUS, irqclr); 259 + am335x_tsc_se_update(ts_dev->mfd_tscadc); 260 + return IRQ_HANDLED; 261 + } 262 + return IRQ_NONE; 263 + } 264 + 265 + static int titsc_parse_dt(struct platform_device *pdev, 266 + struct titsc *ts_dev) 267 + { 268 + struct device_node *node = pdev->dev.of_node; 269 + int err; 270 + 271 + if (!node) 272 + return -EINVAL; 273 + 274 + err = of_property_read_u32(node, "ti,wires", &ts_dev->wires); 275 + if (err < 0) 276 + return err; 277 + switch (ts_dev->wires) { 278 + case 4: 279 + case 5: 280 + case 8: 281 + break; 282 + default: 283 + return -EINVAL; 284 + } 285 + 286 + err = of_property_read_u32(node, "ti,x-plate-resistance", 287 + &ts_dev->x_plate_resistance); 288 + if (err < 0) 289 + return err; 290 + 291 + err = of_property_read_u32(node, "ti,coordiante-readouts", 292 + &ts_dev->coordinate_readouts); 293 + if (err < 0) 294 + return err; 295 + 296 + return of_property_read_u32_array(node, "ti,wire-config", 297 + ts_dev->config_inp, ARRAY_SIZE(ts_dev->config_inp)); 315 298 } 316 299 317 300 /* ··· 365 262 { 366 263 struct titsc *ts_dev; 367 264 struct input_dev *input_dev; 368 - struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; 369 - struct mfd_tscadc_board *pdata; 265 + struct ti_tscadc_dev *tscadc_dev = ti_tscadc_dev_get(pdev); 370 266 int err; 371 - 372 - pdata = tscadc_dev->dev->platform_data; 373 - 374 - if (!pdata) { 375 - dev_err(&pdev->dev, "Could not find platform data\n"); 376 - return -EINVAL; 377 - } 378 267 379 268 /* Allocate memory for device */ 380 269 ts_dev = kzalloc(sizeof(struct titsc), GFP_KERNEL); ··· 381 286 ts_dev->mfd_tscadc = tscadc_dev; 382 287 ts_dev->input = input_dev; 383 288 ts_dev->irq = tscadc_dev->irq; 384 - ts_dev->wires = pdata->tsc_init->wires; 385 - ts_dev->x_plate_resistance = pdata->tsc_init->x_plate_resistance; 386 - ts_dev->steps_to_configure = pdata->tsc_init->steps_to_configure; 289 + 290 + err = titsc_parse_dt(pdev, ts_dev); 291 + if (err) { 292 + dev_err(&pdev->dev, "Could not find valid DT data.\n"); 293 + goto err_free_mem; 294 + } 387 295 388 296 err = request_irq(ts_dev->irq, titsc_irq, 389 297 0, pdev->dev.driver->name, ts_dev); ··· 396 298 } 397 299 398 300 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES); 301 + err = titsc_config_wires(ts_dev); 302 + if (err) { 303 + dev_err(&pdev->dev, "wrong i/p wire configuration\n"); 304 + goto err_free_irq; 305 + } 399 306 titsc_step_config(ts_dev); 400 - titsc_writel(ts_dev, REG_FIFO0THR, ts_dev->steps_to_configure); 307 + titsc_writel(ts_dev, REG_FIFO0THR, 308 + ts_dev->coordinate_readouts * 2 + 2 - 1); 401 309 402 310 input_dev->name = "ti-tsc"; 403 311 input_dev->dev.parent = &pdev->dev; ··· 433 329 434 330 static int titsc_remove(struct platform_device *pdev) 435 331 { 436 - struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; 437 - struct titsc *ts_dev = tscadc_dev->tsc; 332 + struct titsc *ts_dev = platform_get_drvdata(pdev); 333 + u32 steps; 438 334 439 335 free_irq(ts_dev->irq, ts_dev); 336 + 337 + /* total steps followed by the enable mask */ 338 + steps = 2 * ts_dev->coordinate_readouts + 2; 339 + steps = (1 << steps) - 1; 340 + am335x_tsc_se_clr(ts_dev->mfd_tscadc, steps); 440 341 441 342 input_unregister_device(ts_dev->input); 442 343 ··· 452 343 #ifdef CONFIG_PM 453 344 static int titsc_suspend(struct device *dev) 454 345 { 455 - struct ti_tscadc_dev *tscadc_dev = dev->platform_data; 456 - struct titsc *ts_dev = tscadc_dev->tsc; 346 + struct titsc *ts_dev = dev_get_drvdata(dev); 347 + struct ti_tscadc_dev *tscadc_dev; 457 348 unsigned int idle; 458 349 350 + tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev)); 459 351 if (device_may_wakeup(tscadc_dev->dev)) { 460 352 idle = titsc_readl(ts_dev, REG_IRQENABLE); 461 353 titsc_writel(ts_dev, REG_IRQENABLE, ··· 468 358 469 359 static int titsc_resume(struct device *dev) 470 360 { 471 - struct ti_tscadc_dev *tscadc_dev = dev->platform_data; 472 - struct titsc *ts_dev = tscadc_dev->tsc; 361 + struct titsc *ts_dev = dev_get_drvdata(dev); 362 + struct ti_tscadc_dev *tscadc_dev; 473 363 364 + tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev)); 474 365 if (device_may_wakeup(tscadc_dev->dev)) { 475 366 titsc_writel(ts_dev, REG_IRQWAKEUP, 476 367 0x00); ··· 479 368 } 480 369 titsc_step_config(ts_dev); 481 370 titsc_writel(ts_dev, REG_FIFO0THR, 482 - ts_dev->steps_to_configure); 371 + ts_dev->coordinate_readouts * 2 + 2 - 1); 483 372 return 0; 484 373 } 485 374 ··· 492 381 #define TITSC_PM_OPS NULL 493 382 #endif 494 383 384 + static const struct of_device_id ti_tsc_dt_ids[] = { 385 + { .compatible = "ti,am3359-tsc", }, 386 + { } 387 + }; 388 + MODULE_DEVICE_TABLE(of, ti_tsc_dt_ids); 389 + 495 390 static struct platform_driver ti_tsc_driver = { 496 391 .probe = titsc_probe, 497 392 .remove = titsc_remove, 498 393 .driver = { 499 - .name = "tsc", 394 + .name = "TI-am335x-tsc", 500 395 .owner = THIS_MODULE, 501 396 .pm = TITSC_PM_OPS, 397 + .of_match_table = of_match_ptr(ti_tsc_dt_ids), 502 398 }, 503 399 }; 504 400 module_platform_driver(ti_tsc_driver);
+137 -97
drivers/mfd/88pm800.c
··· 22 22 23 23 #include <linux/kernel.h> 24 24 #include <linux/module.h> 25 + #include <linux/err.h> 25 26 #include <linux/i2c.h> 26 27 #include <linux/mfd/core.h> 27 28 #include <linux/mfd/88pm80x.h> 28 29 #include <linux/slab.h> 29 - 30 - #define PM800_CHIP_ID (0x00) 31 30 32 31 /* Interrupt Registers */ 33 32 #define PM800_INT_STATUS1 (0x05) ··· 112 113 PM800_MAX_IRQ, 113 114 }; 114 115 115 - enum { 116 - /* Procida */ 117 - PM800_CHIP_A0 = 0x60, 118 - PM800_CHIP_A1 = 0x61, 119 - PM800_CHIP_B0 = 0x62, 120 - PM800_CHIP_C0 = 0x63, 121 - PM800_CHIP_END = PM800_CHIP_C0, 122 - 123 - /* Make sure to update this to the last stepping */ 124 - PM8XXX_CHIP_END = PM800_CHIP_END 125 - }; 116 + /* PM800: generation identification number */ 117 + #define PM800_CHIP_GEN_ID_NUM 0x3 126 118 127 119 static const struct i2c_device_id pm80x_id_table[] = { 128 - {"88PM800", CHIP_PM800}, 120 + {"88PM800", 0}, 129 121 {} /* NULL terminated */ 130 122 }; 131 123 MODULE_DEVICE_TABLE(i2c, pm80x_id_table); ··· 155 165 .resources = &onkey_resources[0], 156 166 .id = -1, 157 167 }, 168 + }; 169 + 170 + static struct mfd_cell regulator_devs[] = { 171 + { 172 + .name = "88pm80x-regulator", 173 + .id = -1, 174 + }, 158 175 }; 159 176 160 177 static const struct regmap_irq pm800_irqs[] = { ··· 312 315 return ret; 313 316 } 314 317 318 + static int device_onkey_init(struct pm80x_chip *chip, 319 + struct pm80x_platform_data *pdata) 320 + { 321 + int ret; 322 + 323 + ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], 324 + ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0, 325 + NULL); 326 + if (ret) { 327 + dev_err(chip->dev, "Failed to add onkey subdev\n"); 328 + return ret; 329 + } 330 + 331 + return 0; 332 + } 333 + 334 + static int device_rtc_init(struct pm80x_chip *chip, 335 + struct pm80x_platform_data *pdata) 336 + { 337 + int ret; 338 + 339 + rtc_devs[0].platform_data = pdata->rtc; 340 + rtc_devs[0].pdata_size = 341 + pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0; 342 + ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 343 + ARRAY_SIZE(rtc_devs), NULL, 0, NULL); 344 + if (ret) { 345 + dev_err(chip->dev, "Failed to add rtc subdev\n"); 346 + return ret; 347 + } 348 + 349 + return 0; 350 + } 351 + 352 + static int device_regulator_init(struct pm80x_chip *chip, 353 + struct pm80x_platform_data *pdata) 354 + { 355 + int ret; 356 + 357 + ret = mfd_add_devices(chip->dev, 0, &regulator_devs[0], 358 + ARRAY_SIZE(regulator_devs), NULL, 0, NULL); 359 + if (ret) { 360 + dev_err(chip->dev, "Failed to add regulator subdev\n"); 361 + return ret; 362 + } 363 + 364 + return 0; 365 + } 366 + 315 367 static int device_irq_init_800(struct pm80x_chip *chip) 316 368 { 317 369 struct regmap *map = chip->regmap; 318 - unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; 370 + unsigned long flags = IRQF_ONESHOT; 319 371 int data, mask, ret = -EINVAL; 320 372 321 373 if (!map || !chip->irq) { ··· 408 362 .status_base = PM800_INT_STATUS1, 409 363 .mask_base = PM800_INT_ENA_1, 410 364 .ack_base = PM800_INT_STATUS1, 365 + .mask_invert = 1, 411 366 }; 412 367 413 368 static int pm800_pages_init(struct pm80x_chip *chip) ··· 416 369 struct pm80x_subchip *subchip; 417 370 struct i2c_client *client = chip->client; 418 371 372 + int ret = 0; 373 + 419 374 subchip = chip->subchip; 420 - /* PM800 block power: i2c addr 0x31 */ 421 - if (subchip->power_page_addr) { 422 - subchip->power_page = 423 - i2c_new_dummy(client->adapter, subchip->power_page_addr); 424 - subchip->regmap_power = 425 - devm_regmap_init_i2c(subchip->power_page, 426 - &pm80x_regmap_config); 427 - i2c_set_clientdata(subchip->power_page, chip); 428 - } else 429 - dev_info(chip->dev, 430 - "PM800 block power 0x31: No power_page_addr\n"); 375 + if (!subchip || !subchip->power_page_addr || !subchip->gpadc_page_addr) 376 + return -ENODEV; 431 377 432 - /* PM800 block GPADC: i2c addr 0x32 */ 433 - if (subchip->gpadc_page_addr) { 434 - subchip->gpadc_page = i2c_new_dummy(client->adapter, 435 - subchip->gpadc_page_addr); 436 - subchip->regmap_gpadc = 437 - devm_regmap_init_i2c(subchip->gpadc_page, 438 - &pm80x_regmap_config); 439 - i2c_set_clientdata(subchip->gpadc_page, chip); 440 - } else 441 - dev_info(chip->dev, 442 - "PM800 block GPADC 0x32: No gpadc_page_addr\n"); 378 + /* PM800 block power page */ 379 + subchip->power_page = i2c_new_dummy(client->adapter, 380 + subchip->power_page_addr); 381 + if (subchip->power_page == NULL) { 382 + ret = -ENODEV; 383 + goto out; 384 + } 443 385 444 - return 0; 386 + subchip->regmap_power = devm_regmap_init_i2c(subchip->power_page, 387 + &pm80x_regmap_config); 388 + if (IS_ERR(subchip->regmap_power)) { 389 + ret = PTR_ERR(subchip->regmap_power); 390 + dev_err(chip->dev, 391 + "Failed to allocate regmap_power: %d\n", ret); 392 + goto out; 393 + } 394 + 395 + i2c_set_clientdata(subchip->power_page, chip); 396 + 397 + /* PM800 block GPADC */ 398 + subchip->gpadc_page = i2c_new_dummy(client->adapter, 399 + subchip->gpadc_page_addr); 400 + if (subchip->gpadc_page == NULL) { 401 + ret = -ENODEV; 402 + goto out; 403 + } 404 + 405 + subchip->regmap_gpadc = devm_regmap_init_i2c(subchip->gpadc_page, 406 + &pm80x_regmap_config); 407 + if (IS_ERR(subchip->regmap_gpadc)) { 408 + ret = PTR_ERR(subchip->regmap_gpadc); 409 + dev_err(chip->dev, 410 + "Failed to allocate regmap_gpadc: %d\n", ret); 411 + goto out; 412 + } 413 + i2c_set_clientdata(subchip->gpadc_page, chip); 414 + 415 + out: 416 + return ret; 445 417 } 446 418 447 419 static void pm800_pages_exit(struct pm80x_chip *chip) 448 420 { 449 421 struct pm80x_subchip *subchip; 450 422 451 - regmap_exit(chip->regmap); 452 - i2c_unregister_device(chip->client); 453 - 454 423 subchip = chip->subchip; 455 - if (subchip->power_page) { 456 - regmap_exit(subchip->regmap_power); 424 + 425 + if (subchip && subchip->power_page) 457 426 i2c_unregister_device(subchip->power_page); 458 - } 459 - if (subchip->gpadc_page) { 460 - regmap_exit(subchip->regmap_gpadc); 427 + 428 + if (subchip && subchip->gpadc_page) 461 429 i2c_unregister_device(subchip->gpadc_page); 462 - } 463 430 } 464 431 465 432 static int device_800_init(struct pm80x_chip *chip, 466 433 struct pm80x_platform_data *pdata) 467 434 { 468 - int ret, pmic_id; 435 + int ret; 469 436 unsigned int val; 470 - 471 - ret = regmap_read(chip->regmap, PM800_CHIP_ID, &val); 472 - if (ret < 0) { 473 - dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); 474 - goto out; 475 - } 476 - 477 - pmic_id = val & PM80X_VERSION_MASK; 478 - 479 - if ((pmic_id >= PM800_CHIP_A0) && (pmic_id <= PM800_CHIP_END)) { 480 - chip->version = val; 481 - dev_info(chip->dev, 482 - "88PM80x:Marvell 88PM800 (ID:0x%x) detected\n", val); 483 - } else { 484 - dev_err(chip->dev, 485 - "Failed to detect Marvell 88PM800:ChipID[0x%x]\n", val); 486 - ret = -EINVAL; 487 - goto out; 488 - } 489 437 490 438 /* 491 439 * alarm wake up bit will be clear in device_irq_init(), ··· 510 468 goto out; 511 469 } 512 470 513 - ret = 514 - mfd_add_devices(chip->dev, 0, &onkey_devs[0], 515 - ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0, 516 - NULL); 517 - if (ret < 0) { 471 + ret = device_onkey_init(chip, pdata); 472 + if (ret) { 518 473 dev_err(chip->dev, "Failed to add onkey subdev\n"); 519 474 goto out_dev; 520 - } else 521 - dev_info(chip->dev, "[%s]:Added mfd onkey_devs\n", __func__); 475 + } 522 476 523 - if (pdata && pdata->rtc) { 524 - rtc_devs[0].platform_data = pdata->rtc; 525 - rtc_devs[0].pdata_size = sizeof(struct pm80x_rtc_pdata); 526 - ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 527 - ARRAY_SIZE(rtc_devs), NULL, 0, NULL); 528 - if (ret < 0) { 529 - dev_err(chip->dev, "Failed to add rtc subdev\n"); 530 - goto out_dev; 531 - } else 532 - dev_info(chip->dev, 533 - "[%s]:Added mfd rtc_devs\n", __func__); 477 + ret = device_rtc_init(chip, pdata); 478 + if (ret) { 479 + dev_err(chip->dev, "Failed to add rtc subdev\n"); 480 + goto out; 481 + } 482 + 483 + ret = device_regulator_init(chip, pdata); 484 + if (ret) { 485 + dev_err(chip->dev, "Failed to add regulators subdev\n"); 486 + goto out; 534 487 } 535 488 536 489 return 0; ··· 544 507 struct pm80x_platform_data *pdata = client->dev.platform_data; 545 508 struct pm80x_subchip *subchip; 546 509 547 - ret = pm80x_init(client, id); 510 + ret = pm80x_init(client); 548 511 if (ret) { 549 512 dev_err(&client->dev, "pm800_init fail\n"); 550 513 goto out_init; ··· 561 524 goto err_subchip_alloc; 562 525 } 563 526 564 - subchip->power_page_addr = pdata->power_page_addr; 565 - subchip->gpadc_page_addr = pdata->gpadc_page_addr; 527 + /* pm800 has 2 addtional pages to support power and gpadc. */ 528 + subchip->power_page_addr = client->addr + 1; 529 + subchip->gpadc_page_addr = client->addr + 2; 566 530 chip->subchip = subchip; 567 - 568 - ret = device_800_init(chip, pdata); 569 - if (ret) { 570 - dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id); 571 - goto err_subchip_alloc; 572 - } 573 531 574 532 ret = pm800_pages_init(chip); 575 533 if (ret) { ··· 572 540 goto err_page_init; 573 541 } 574 542 543 + ret = device_800_init(chip, pdata); 544 + if (ret) { 545 + dev_err(chip->dev, "Failed to initialize 88pm800 devices\n"); 546 + goto err_device_init; 547 + } 548 + 575 549 if (pdata->plat_config) 576 550 pdata->plat_config(chip, pdata); 577 551 552 + return 0; 553 + 554 + err_device_init: 555 + pm800_pages_exit(chip); 578 556 err_page_init: 579 - mfd_remove_devices(chip->dev); 580 - device_irq_exit_800(chip); 581 557 err_subchip_alloc: 582 558 pm80x_deinit(); 583 559 out_init: ··· 607 567 608 568 static struct i2c_driver pm800_driver = { 609 569 .driver = { 610 - .name = "88PM80X", 570 + .name = "88PM800", 611 571 .owner = THIS_MODULE, 612 572 .pm = &pm80x_pm_ops, 613 573 },
+5 -15
drivers/mfd/88pm805.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/delay.h> 31 31 32 - #define PM805_CHIP_ID (0x00) 33 - 34 32 static const struct i2c_device_id pm80x_id_table[] = { 35 - {"88PM805", CHIP_PM805}, 33 + {"88PM805", 0}, 36 34 {} /* NULL terminated */ 37 35 }; 38 36 MODULE_DEVICE_TABLE(i2c, pm80x_id_table); ··· 136 138 static int device_irq_init_805(struct pm80x_chip *chip) 137 139 { 138 140 struct regmap *map = chip->regmap; 139 - unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; 141 + unsigned long flags = IRQF_ONESHOT; 140 142 int data, mask, ret = -EINVAL; 141 143 142 144 if (!map || !chip->irq) { ··· 190 192 static int device_805_init(struct pm80x_chip *chip) 191 193 { 192 194 int ret = 0; 193 - unsigned int val; 194 195 struct regmap *map = chip->regmap; 195 196 196 197 if (!map) { 197 198 dev_err(chip->dev, "regmap is invalid\n"); 198 199 return -EINVAL; 199 200 } 200 - 201 - ret = regmap_read(map, PM805_CHIP_ID, &val); 202 - if (ret < 0) { 203 - dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); 204 - goto out_irq_init; 205 - } 206 - chip->version = val; 207 201 208 202 chip->regmap_irq_chip = &pm805_irq_chip; 209 203 ··· 229 239 struct pm80x_chip *chip; 230 240 struct pm80x_platform_data *pdata = client->dev.platform_data; 231 241 232 - ret = pm80x_init(client, id); 242 + ret = pm80x_init(client); 233 243 if (ret) { 234 244 dev_err(&client->dev, "pm805_init fail!\n"); 235 245 goto out_init; ··· 239 249 240 250 ret = device_805_init(chip); 241 251 if (ret) { 242 - dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id); 252 + dev_err(chip->dev, "Failed to initialize 88pm805 devices\n"); 243 253 goto err_805_init; 244 254 } 245 255 ··· 266 276 267 277 static struct i2c_driver pm805_driver = { 268 278 .driver = { 269 - .name = "88PM80X", 279 + .name = "88PM805", 270 280 .owner = THIS_MODULE, 271 281 .pm = &pm80x_pm_ops, 272 282 },
+40 -7
drivers/mfd/88pm80x.c
··· 18 18 #include <linux/uaccess.h> 19 19 #include <linux/err.h> 20 20 21 + /* 88pm80x chips have same definition for chip id register. */ 22 + #define PM80X_CHIP_ID (0x00) 23 + #define PM80X_CHIP_ID_NUM(x) (((x) >> 5) & 0x7) 24 + #define PM80X_CHIP_ID_REVISION(x) ((x) & 0x1F) 25 + 26 + struct pm80x_chip_mapping { 27 + unsigned int id; 28 + int type; 29 + }; 30 + 31 + static struct pm80x_chip_mapping chip_mapping[] = { 32 + /* 88PM800 chip id number */ 33 + {0x3, CHIP_PM800}, 34 + /* 88PM805 chip id number */ 35 + {0x0, CHIP_PM805}, 36 + }; 37 + 21 38 /* 22 39 * workaround: some registers needed by pm805 are defined in pm800, so 23 40 * need to use this global variable to maintain the relation between ··· 48 31 }; 49 32 EXPORT_SYMBOL_GPL(pm80x_regmap_config); 50 33 51 - int pm80x_init(struct i2c_client *client, 52 - const struct i2c_device_id *id) 34 + 35 + int pm80x_init(struct i2c_client *client) 53 36 { 54 37 struct pm80x_chip *chip; 55 38 struct regmap *map; 56 - int ret = 0; 39 + unsigned int val; 40 + int i, ret = 0; 57 41 58 42 chip = 59 43 devm_kzalloc(&client->dev, sizeof(struct pm80x_chip), GFP_KERNEL); ··· 69 51 return ret; 70 52 } 71 53 72 - chip->id = id->driver_data; 73 - if (chip->id < CHIP_PM800 || chip->id > CHIP_PM805) 74 - return -EINVAL; 75 - 76 54 chip->client = client; 77 55 chip->regmap = map; 78 56 ··· 77 63 chip->dev = &client->dev; 78 64 dev_set_drvdata(chip->dev, chip); 79 65 i2c_set_clientdata(chip->client, chip); 66 + 67 + ret = regmap_read(chip->regmap, PM80X_CHIP_ID, &val); 68 + if (ret < 0) { 69 + dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); 70 + return ret; 71 + } 72 + 73 + for (i = 0; i < ARRAY_SIZE(chip_mapping); i++) { 74 + if (chip_mapping[i].id == PM80X_CHIP_ID_NUM(val)) { 75 + chip->type = chip_mapping[i].type; 76 + break; 77 + } 78 + } 79 + 80 + if (i == ARRAY_SIZE(chip_mapping)) { 81 + dev_err(chip->dev, 82 + "Failed to detect Marvell 88PM800:ChipID[0x%x]\n", val); 83 + return -EINVAL; 84 + } 80 85 81 86 device_init_wakeup(&client->dev, 1); 82 87
+3 -5
drivers/mfd/88pm860x-core.c
··· 1150 1150 return -EINVAL; 1151 1151 } 1152 1152 1153 - chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); 1153 + chip = devm_kzalloc(&client->dev, 1154 + sizeof(struct pm860x_chip), GFP_KERNEL); 1154 1155 if (chip == NULL) 1155 1156 return -ENOMEM; 1156 1157 1157 1158 chip->id = verify_addr(client); 1158 - chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config); 1159 + chip->regmap = devm_regmap_init_i2c(client, &pm860x_regmap_config); 1159 1160 if (IS_ERR(chip->regmap)) { 1160 1161 ret = PTR_ERR(chip->regmap); 1161 1162 dev_err(&client->dev, "Failed to allocate register map: %d\n", 1162 1163 ret); 1163 - kfree(chip); 1164 1164 return ret; 1165 1165 } 1166 1166 chip->client = client; ··· 1203 1203 regmap_exit(chip->regmap_companion); 1204 1204 i2c_unregister_device(chip->companion); 1205 1205 } 1206 - regmap_exit(chip->regmap); 1207 - kfree(chip); 1208 1206 return 0; 1209 1207 } 1210 1208
+33 -3
drivers/mfd/Kconfig
··· 53 53 help 54 54 If you say Y here you get support for the ChromeOS Embedded 55 55 Controller (EC) providing keyboard, battery and power services. 56 - You also ned to enable the driver for the bus you are using. The 56 + You also need to enable the driver for the bus you are using. The 57 57 protocol for talking to the EC is defined by the bus driver. 58 58 59 59 config MFD_CROS_EC_I2C ··· 242 242 Say yes here if you want support for the ADC unit in the JZ4740 SoC. 243 243 This driver is necessary for jz4740-battery and jz4740-hwmon driver. 244 244 245 + config MFD_KEMPLD 246 + tristate "Kontron module PLD device" 247 + select MFD_CORE 248 + help 249 + This is the core driver for the PLD (Programmable Logic Device) found 250 + on some Kontron ETX and COMexpress (ETXexpress) modules. The PLD 251 + device may provide functions like watchdog, GPIO, UART and I2C bus. 252 + 253 + The following modules are supported: 254 + * COMe-bIP# 255 + * COMe-bPC2 (ETXexpress-PC) 256 + * COMe-bSC# (ETXexpress-SC T#) 257 + * COMe-cCT6 258 + * COMe-cDC2 (microETXexpress-DC) 259 + * COMe-cPC2 (microETXexpress-PC) 260 + * COMe-mCT10 261 + * ETX-OH 262 + 263 + This driver can also be built as a module. If so, the module 264 + will be called kempld-core. 265 + 245 266 config MFD_88PM800 246 267 tristate "Marvell 88PM800" 247 268 depends on I2C=y && GENERIC_HARDIRQS ··· 363 342 bool "Maxim Semiconductor MAX8998/National LP3974 PMIC Support" 364 343 depends on I2C=y && GENERIC_HARDIRQS 365 344 select MFD_CORE 345 + select IRQ_DOMAIN 366 346 help 367 347 Say yes here to support for Maxim Semiconductor MAX8998 and 368 348 National Semiconductor LP3974. This is a Power Management IC. ··· 441 419 442 420 config MFD_PM8921_CORE 443 421 tristate "Qualcomm PM8921 PMIC chip" 444 - depends on SSBI && BROKEN 422 + depends on (ARCH_MSM || HEXAGON) 423 + depends on BROKEN 445 424 select MFD_CORE 446 425 select MFD_PM8XXX 447 426 help ··· 1069 1046 help 1070 1047 Support for Wolfson Microelectronics WM5110 low power audio SoC 1071 1048 1049 + config MFD_WM8997 1050 + bool "Support Wolfson Microelectronics WM8997" 1051 + depends on MFD_ARIZONA 1052 + help 1053 + Support for Wolfson Microelectronics WM8997 low power audio SoC 1054 + 1072 1055 config MFD_WM8400 1073 1056 bool "Wolfson Microelectronics WM8400" 1074 1057 select MFD_CORE ··· 1173 1144 endmenu 1174 1145 1175 1146 config VEXPRESS_CONFIG 1176 - bool 1147 + bool "ARM Versatile Express platform infrastructure" 1148 + depends on ARM || ARM64 1177 1149 help 1178 1150 Platform configuration infrastructure for the ARM Ltd. 1179 1151 Versatile Express.
+5 -1
drivers/mfd/Makefile
··· 43 43 ifneq ($(CONFIG_MFD_WM5110),n) 44 44 obj-$(CONFIG_MFD_ARIZONA) += wm5110-tables.o 45 45 endif 46 + ifneq ($(CONFIG_MFD_WM8997),n) 47 + obj-$(CONFIG_MFD_ARIZONA) += wm8997-tables.o 48 + endif 46 49 obj-$(CONFIG_MFD_WM8400) += wm8400-core.o 47 50 wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o 48 51 wm831x-objs += wm831x-auxadc.o ··· 129 126 obj-$(CONFIG_AB8500_CORE) += ab8500-core.o ab8500-sysctrl.o 130 127 obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o 131 128 obj-$(CONFIG_PMIC_ADP5520) += adp5520.o 129 + obj-$(CONFIG_MFD_KEMPLD) += kempld-core.o 132 130 obj-$(CONFIG_LPC_SCH) += lpc_sch.o 133 131 obj-$(CONFIG_LPC_ICH) += lpc_ich.o 134 132 obj-$(CONFIG_MFD_RDC321X) += rdc321x-southbridge.o ··· 144 140 145 141 obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o 146 142 obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o 147 - obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o 143 + obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o 148 144 obj-$(CONFIG_MFD_PM8XXX_IRQ) += pm8xxx-irq.o 149 145 obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o 150 146 obj-$(CONFIG_MFD_TPS65090) += tps65090.o
+3 -2
drivers/mfd/aat2870-core.c
··· 312 312 while (*start == ' ') 313 313 start++; 314 314 315 - if (strict_strtoul(start, 16, &val)) 316 - return -EINVAL; 315 + ret = kstrtoul(start, 16, &val); 316 + if (ret) 317 + return ret; 317 318 318 319 ret = aat2870->write(aat2870, (u8)addr, (u8)val); 319 320 if (ret)
+10 -18
drivers/mfd/ab3100-core.c
··· 491 491 char buf[32]; 492 492 ssize_t buf_size; 493 493 int regp; 494 - unsigned long user_reg; 494 + u8 user_reg; 495 495 int err; 496 496 int i = 0; 497 497 ··· 514 514 /* 515 515 * Advance pointer to end of string then terminate 516 516 * the register string. This is needed to satisfy 517 - * the strict_strtoul() function. 517 + * the kstrtou8() function. 518 518 */ 519 519 while ((i < buf_size) && (buf[i] != ' ')) 520 520 i++; 521 521 buf[i] = '\0'; 522 522 523 - err = strict_strtoul(&buf[regp], 16, &user_reg); 523 + err = kstrtou8(&buf[regp], 16, &user_reg); 524 524 if (err) 525 525 return err; 526 - if (user_reg > 0xff) 527 - return -EINVAL; 528 526 529 527 /* Either we read or we write a register here */ 530 528 if (!priv->mode) { 531 529 /* Reading */ 532 - u8 reg = (u8) user_reg; 533 530 u8 regvalue; 534 531 535 - ab3100_get_register_interruptible(ab3100, reg, &regvalue); 532 + ab3100_get_register_interruptible(ab3100, user_reg, &regvalue); 536 533 537 534 dev_info(ab3100->dev, 538 535 "debug read AB3100 reg[0x%02x]: 0x%02x\n", 539 - reg, regvalue); 536 + user_reg, regvalue); 540 537 } else { 541 538 int valp; 542 - unsigned long user_value; 543 - u8 reg = (u8) user_reg; 544 - u8 value; 539 + u8 user_value; 545 540 u8 regvalue; 546 541 547 542 /* ··· 552 557 i++; 553 558 buf[i] = '\0'; 554 559 555 - err = strict_strtoul(&buf[valp], 16, &user_value); 560 + err = kstrtou8(&buf[valp], 16, &user_value); 556 561 if (err) 557 562 return err; 558 - if (user_reg > 0xff) 559 - return -EINVAL; 560 563 561 - value = (u8) user_value; 562 - ab3100_set_register_interruptible(ab3100, reg, value); 563 - ab3100_get_register_interruptible(ab3100, reg, &regvalue); 564 + ab3100_set_register_interruptible(ab3100, user_reg, user_value); 565 + ab3100_get_register_interruptible(ab3100, user_reg, &regvalue); 564 566 565 567 dev_info(ab3100->dev, 566 568 "debug write reg[0x%02x] with 0x%02x, " 567 569 "after readback: 0x%02x\n", 568 - reg, value, regvalue); 570 + user_reg, user_value, regvalue); 569 571 } 570 572 return buf_size; 571 573 }
+5 -9
drivers/mfd/ab3100-otp.c
··· 187 187 int err = 0; 188 188 int i; 189 189 190 - otp = kzalloc(sizeof(struct ab3100_otp), GFP_KERNEL); 190 + otp = devm_kzalloc(&pdev->dev, sizeof(struct ab3100_otp), GFP_KERNEL); 191 191 if (!otp) { 192 192 dev_err(&pdev->dev, "could not allocate AB3100 OTP device\n"); 193 193 return -ENOMEM; ··· 199 199 200 200 err = ab3100_otp_read(otp); 201 201 if (err) 202 - goto err_otp_read; 202 + return err; 203 203 204 204 dev_info(&pdev->dev, "AB3100 OTP readout registered\n"); 205 205 ··· 208 208 err = device_create_file(&pdev->dev, 209 209 &ab3100_otp_attrs[i]); 210 210 if (err) 211 - goto err_create_file; 211 + goto err; 212 212 } 213 213 214 214 /* debugfs entries */ 215 215 err = ab3100_otp_init_debugfs(&pdev->dev, otp); 216 216 if (err) 217 - goto err_init_debugfs; 217 + goto err; 218 218 219 219 return 0; 220 220 221 - err_init_debugfs: 222 - err_create_file: 221 + err: 223 222 while (--i >= 0) 224 223 device_remove_file(&pdev->dev, &ab3100_otp_attrs[i]); 225 - err_otp_read: 226 - kfree(otp); 227 224 return err; 228 225 } 229 226 ··· 233 236 device_remove_file(&pdev->dev, 234 237 &ab3100_otp_attrs[i]); 235 238 ab3100_otp_exit_debugfs(otp); 236 - kfree(otp); 237 239 return 0; 238 240 } 239 241
+58 -21
drivers/mfd/ab8500-core.c
··· 650 650 }, 651 651 }; 652 652 653 + static struct resource ab8540_rtc_resources[] = { 654 + { 655 + .name = "1S", 656 + .start = AB8540_INT_RTC_1S, 657 + .end = AB8540_INT_RTC_1S, 658 + .flags = IORESOURCE_IRQ, 659 + }, 660 + { 661 + .name = "ALARM", 662 + .start = AB8500_INT_RTC_ALARM, 663 + .end = AB8500_INT_RTC_ALARM, 664 + .flags = IORESOURCE_IRQ, 665 + }, 666 + }; 667 + 653 668 static struct resource ab8500_poweronkey_db_resources[] = { 654 669 { 655 670 .name = "ONKEY_DBF", ··· 1066 1051 .of_compatible = "stericsson,ab8500-sysctrl", 1067 1052 }, 1068 1053 { 1054 + .name = "ab8500-ext-regulator", 1055 + .of_compatible = "stericsson,ab8500-ext-regulator", 1056 + }, 1057 + { 1069 1058 .name = "ab8500-regulator", 1070 1059 .of_compatible = "stericsson,ab8500-regulator", 1071 1060 }, ··· 1118 1099 .id = 3, 1119 1100 }, 1120 1101 { 1121 - .name = "ab8500-leds", 1122 - .of_compatible = "stericsson,ab8500-leds", 1123 - }, 1124 - { 1125 1102 .name = "ab8500-denc", 1126 1103 .of_compatible = "stericsson,ab8500-denc", 1127 1104 }, ··· 1139 1124 }, 1140 1125 { 1141 1126 .name = "ab8500-codec", 1127 + .of_compatible = "stericsson,ab8500-codec", 1142 1128 }, 1143 1129 }; 1144 1130 ··· 1153 1137 #endif 1154 1138 { 1155 1139 .name = "ab8500-sysctrl", 1140 + }, 1141 + { 1142 + .name = "ab8500-ext-regulator", 1156 1143 }, 1157 1144 { 1158 1145 .name = "ab8500-regulator", ··· 1188 1169 { 1189 1170 .name = "ab8500-pwm", 1190 1171 .id = 1, 1191 - }, 1192 - { 1193 - .name = "ab8500-leds", 1194 1172 }, 1195 1173 { 1196 1174 .name = "abx500-temp", ··· 1258 1242 .id = 1, 1259 1243 }, 1260 1244 { 1261 - .name = "ab8500-leds", 1262 - }, 1263 - { 1264 1245 .name = "pinctrl-ab8505", 1265 1246 }, 1266 1247 { ··· 1287 1274 .name = "ab8500-sysctrl", 1288 1275 }, 1289 1276 { 1277 + .name = "ab8500-ext-regulator", 1278 + }, 1279 + { 1290 1280 .name = "ab8500-regulator", 1291 1281 }, 1292 1282 { ··· 1301 1285 .of_compatible = "stericsson,ab8500-gpadc", 1302 1286 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources), 1303 1287 .resources = ab8505_gpadc_resources, 1304 - }, 1305 - { 1306 - .name = "ab8500-rtc", 1307 - .num_resources = ARRAY_SIZE(ab8500_rtc_resources), 1308 - .resources = ab8500_rtc_resources, 1309 1288 }, 1310 1289 { 1311 1290 .name = "ab8500-acc-det", ··· 1315 1304 { 1316 1305 .name = "ab8500-pwm", 1317 1306 .id = 1, 1318 - }, 1319 - { 1320 - .name = "ab8500-leds", 1321 1307 }, 1322 1308 { 1323 1309 .name = "abx500-temp", ··· 1336 1328 .name = "ab-iddet", 1337 1329 .num_resources = ARRAY_SIZE(ab8505_iddet_resources), 1338 1330 .resources = ab8505_iddet_resources, 1331 + }, 1332 + }; 1333 + 1334 + static struct mfd_cell ab8540_cut1_devs[] = { 1335 + { 1336 + .name = "ab8500-rtc", 1337 + .of_compatible = "stericsson,ab8500-rtc", 1338 + .num_resources = ARRAY_SIZE(ab8500_rtc_resources), 1339 + .resources = ab8500_rtc_resources, 1340 + }, 1341 + }; 1342 + 1343 + static struct mfd_cell ab8540_cut2_devs[] = { 1344 + { 1345 + .name = "ab8540-rtc", 1346 + .of_compatible = "stericsson,ab8540-rtc", 1347 + .num_resources = ARRAY_SIZE(ab8540_rtc_resources), 1348 + .resources = ab8540_rtc_resources, 1339 1349 }, 1340 1350 }; 1341 1351 ··· 1760 1734 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1761 1735 ARRAY_SIZE(ab9540_devs), NULL, 1762 1736 ab8500->irq_base, ab8500->domain); 1763 - else if (is_ab8540(ab8500)) 1737 + else if (is_ab8540(ab8500)) { 1764 1738 ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs, 1765 1739 ARRAY_SIZE(ab8540_devs), NULL, 1766 - ab8500->irq_base, ab8500->domain); 1767 - else if (is_ab8505(ab8500)) 1740 + ab8500->irq_base, NULL); 1741 + if (ret) 1742 + return ret; 1743 + 1744 + if (is_ab8540_1p2_or_earlier(ab8500)) 1745 + ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs, 1746 + ARRAY_SIZE(ab8540_cut1_devs), NULL, 1747 + ab8500->irq_base, NULL); 1748 + else /* ab8540 >= cut2 */ 1749 + ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs, 1750 + ARRAY_SIZE(ab8540_cut2_devs), NULL, 1751 + ab8500->irq_base, NULL); 1752 + } else if (is_ab8505(ab8500)) 1768 1753 ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs, 1769 1754 ARRAY_SIZE(ab8505_devs), NULL, 1770 1755 ab8500->irq_base, ab8500->domain);
+13 -23
drivers/mfd/ab8500-debugfs.c
··· 2757 2757 unsigned int irq_index; 2758 2758 int err; 2759 2759 2760 - err = strict_strtoul(attr->attr.name, 0, &name); 2760 + err = kstrtoul(attr->attr.name, 0, &name); 2761 2761 if (err) 2762 2762 return err; 2763 2763 ··· 2937 2937 static int ab8500_debug_probe(struct platform_device *plf) 2938 2938 { 2939 2939 struct dentry *file; 2940 - int ret = -ENOMEM; 2941 2940 struct ab8500 *ab8500; 2942 2941 struct resource *res; 2943 2942 debug_bank = AB8500_MISC; ··· 2945 2946 ab8500 = dev_get_drvdata(plf->dev.parent); 2946 2947 num_irqs = ab8500->mask_size; 2947 2948 2948 - irq_count = kzalloc(sizeof(*irq_count)*num_irqs, GFP_KERNEL); 2949 + irq_count = devm_kzalloc(&plf->dev, 2950 + sizeof(*irq_count)*num_irqs, GFP_KERNEL); 2949 2951 if (!irq_count) 2950 2952 return -ENOMEM; 2951 2953 2952 - dev_attr = kzalloc(sizeof(*dev_attr)*num_irqs,GFP_KERNEL); 2954 + dev_attr = devm_kzalloc(&plf->dev, 2955 + sizeof(*dev_attr)*num_irqs,GFP_KERNEL); 2953 2956 if (!dev_attr) 2954 - goto out_freeirq_count; 2957 + return -ENOMEM; 2955 2958 2956 - event_name = kzalloc(sizeof(*event_name)*num_irqs, GFP_KERNEL); 2959 + event_name = devm_kzalloc(&plf->dev, 2960 + sizeof(*event_name)*num_irqs, GFP_KERNEL); 2957 2961 if (!event_name) 2958 - goto out_freedev_attr; 2962 + return -ENOMEM; 2959 2963 2960 2964 res = platform_get_resource_byname(plf, 0, "IRQ_AB8500"); 2961 2965 if (!res) { 2962 2966 dev_err(&plf->dev, "AB8500 irq not found, err %d\n", 2963 2967 irq_first); 2964 - ret = -ENXIO; 2965 - goto out_freeevent_name; 2968 + return ENXIO; 2966 2969 } 2967 2970 irq_ab8500 = res->start; 2968 2971 ··· 2972 2971 if (irq_first < 0) { 2973 2972 dev_err(&plf->dev, "First irq not found, err %d\n", 2974 2973 irq_first); 2975 - ret = irq_first; 2976 - goto out_freeevent_name; 2974 + return irq_first; 2977 2975 } 2978 2976 2979 2977 irq_last = platform_get_irq_byname(plf, "IRQ_LAST"); 2980 2978 if (irq_last < 0) { 2981 2979 dev_err(&plf->dev, "Last irq not found, err %d\n", 2982 2980 irq_last); 2983 - ret = irq_last; 2984 - goto out_freeevent_name; 2981 + return irq_last; 2985 2982 } 2986 2983 2987 2984 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL); ··· 3188 3189 if (ab8500_dir) 3189 3190 debugfs_remove_recursive(ab8500_dir); 3190 3191 dev_err(&plf->dev, "failed to create debugfs entries.\n"); 3191 - out_freeevent_name: 3192 - kfree(event_name); 3193 - out_freedev_attr: 3194 - kfree(dev_attr); 3195 - out_freeirq_count: 3196 - kfree(irq_count); 3197 3192 3198 - return ret; 3193 + return -ENOMEM; 3199 3194 } 3200 3195 3201 3196 static int ab8500_debug_remove(struct platform_device *plf) 3202 3197 { 3203 3198 debugfs_remove_recursive(ab8500_dir); 3204 - kfree(event_name); 3205 - kfree(dev_attr); 3206 - kfree(irq_count); 3207 3199 3208 3200 return 0; 3209 3201 }
+1 -5
drivers/mfd/ab8500-gpadc.c
··· 919 919 int ret = 0; 920 920 struct ab8500_gpadc *gpadc; 921 921 922 - gpadc = kzalloc(sizeof(struct ab8500_gpadc), GFP_KERNEL); 922 + gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL); 923 923 if (!gpadc) { 924 924 dev_err(&pdev->dev, "Error: No memory\n"); 925 925 return -ENOMEM; ··· 999 999 free_irq(gpadc->irq_sw, gpadc); 1000 1000 free_irq(gpadc->irq_hw, gpadc); 1001 1001 fail: 1002 - kfree(gpadc); 1003 - gpadc = NULL; 1004 1002 return ret; 1005 1003 } 1006 1004 ··· 1023 1025 1024 1026 pm_runtime_put_noidle(gpadc->dev); 1025 1027 1026 - kfree(gpadc); 1027 - gpadc = NULL; 1028 1028 return 0; 1029 1029 } 1030 1030
+4 -6
drivers/mfd/abx500-core.c
··· 36 36 { 37 37 struct abx500_device_entry *dev_entry; 38 38 39 - dev_entry = kzalloc(sizeof(struct abx500_device_entry), GFP_KERNEL); 39 + dev_entry = devm_kzalloc(dev, 40 + sizeof(struct abx500_device_entry), 41 + GFP_KERNEL); 40 42 if (!dev_entry) { 41 43 dev_err(dev, "register_ops kzalloc failed"); 42 44 return -ENOMEM; ··· 56 54 struct abx500_device_entry *dev_entry, *tmp; 57 55 58 56 list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list) 59 - { 60 - if (dev_entry->dev == dev) { 57 + if (dev_entry->dev == dev) 61 58 list_del(&dev_entry->list); 62 - kfree(dev_entry); 63 - } 64 - } 65 59 } 66 60 EXPORT_SYMBOL(abx500_remove_ops); 67 61
+2 -6
drivers/mfd/adp5520.c
··· 223 223 return -ENODEV; 224 224 } 225 225 226 - chip = kzalloc(sizeof(*chip), GFP_KERNEL); 226 + chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 227 227 if (!chip) 228 228 return -ENOMEM; 229 229 ··· 244 244 if (ret) { 245 245 dev_err(&client->dev, "failed to request irq %d\n", 246 246 chip->irq); 247 - goto out_free_chip; 247 + return ret; 248 248 } 249 249 } 250 250 ··· 302 302 if (chip->irq) 303 303 free_irq(chip->irq, chip); 304 304 305 - out_free_chip: 306 - kfree(chip); 307 - 308 305 return ret; 309 306 } 310 307 ··· 314 317 315 318 adp5520_remove_subdevs(chip); 316 319 adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0); 317 - kfree(chip); 318 320 return 0; 319 321 } 320 322
+27
drivers/mfd/arizona-core.c
··· 554 554 const struct of_device_id arizona_of_match[] = { 555 555 { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, 556 556 { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, 557 + { .compatible = "wlf,wm8997", .data = (void *)WM8997 }, 557 558 {}, 558 559 }; 559 560 EXPORT_SYMBOL_GPL(arizona_of_match); ··· 587 586 { .name = "wm5110-codec" }, 588 587 }; 589 588 589 + static struct mfd_cell wm8997_devs[] = { 590 + { .name = "arizona-micsupp" }, 591 + { .name = "arizona-extcon" }, 592 + { .name = "arizona-gpio" }, 593 + { .name = "arizona-haptics" }, 594 + { .name = "arizona-pwm" }, 595 + { .name = "wm8997-codec" }, 596 + }; 597 + 590 598 int arizona_dev_init(struct arizona *arizona) 591 599 { 592 600 struct device *dev = arizona->dev; ··· 618 608 switch (arizona->type) { 619 609 case WM5102: 620 610 case WM5110: 611 + case WM8997: 621 612 for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) 622 613 arizona->core_supplies[i].supply 623 614 = wm5102_core_supplies[i]; ··· 694 683 switch (reg) { 695 684 case 0x5102: 696 685 case 0x5110: 686 + case 0x8997: 697 687 break; 698 688 default: 699 689 dev_err(arizona->dev, "Unknown device ID: %x\n", reg); ··· 778 766 arizona->type = WM5110; 779 767 } 780 768 apply_patch = wm5110_patch; 769 + break; 770 + #endif 771 + #ifdef CONFIG_MFD_WM8997 772 + case 0x8997: 773 + type_name = "WM8997"; 774 + if (arizona->type != WM8997) { 775 + dev_err(arizona->dev, "WM8997 registered as %d\n", 776 + arizona->type); 777 + arizona->type = WM8997; 778 + } 779 + apply_patch = wm8997_patch; 781 780 break; 782 781 #endif 783 782 default: ··· 956 933 case WM5110: 957 934 ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, 958 935 ARRAY_SIZE(wm5110_devs), NULL, 0, NULL); 936 + break; 937 + case WM8997: 938 + ret = mfd_add_devices(arizona->dev, -1, wm8997_devs, 939 + ARRAY_SIZE(wm8997_devs), NULL, 0, NULL); 959 940 break; 960 941 } 961 942
+6
drivers/mfd/arizona-i2c.c
··· 45 45 regmap_config = &wm5110_i2c_regmap; 46 46 break; 47 47 #endif 48 + #ifdef CONFIG_MFD_WM8997 49 + case WM8997: 50 + regmap_config = &wm8997_i2c_regmap; 51 + break; 52 + #endif 48 53 default: 49 54 dev_err(&i2c->dev, "Unknown device type %ld\n", 50 55 id->driver_data); ··· 85 80 static const struct i2c_device_id arizona_i2c_id[] = { 86 81 { "wm5102", WM5102 }, 87 82 { "wm5110", WM5110 }, 83 + { "wm8997", WM8997 }, 88 84 { } 89 85 }; 90 86 MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
+8
drivers/mfd/arizona-irq.c
··· 208 208 ctrlif_error = false; 209 209 break; 210 210 #endif 211 + #ifdef CONFIG_MFD_WM8997 212 + case WM8997: 213 + aod = &wm8997_aod; 214 + irq = &wm8997_irq; 215 + 216 + ctrlif_error = false; 217 + break; 218 + #endif 211 219 default: 212 220 BUG_ON("Unknown Arizona class device" == NULL); 213 221 return -EINVAL;
+5
drivers/mfd/arizona.h
··· 25 25 extern const struct regmap_config wm5110_i2c_regmap; 26 26 extern const struct regmap_config wm5110_spi_regmap; 27 27 28 + extern const struct regmap_config wm8997_i2c_regmap; 29 + 28 30 extern const struct dev_pm_ops arizona_pm_ops; 29 31 30 32 extern const struct of_device_id arizona_of_match[]; ··· 36 34 37 35 extern const struct regmap_irq_chip wm5110_aod; 38 36 extern const struct regmap_irq_chip wm5110_irq; 37 + 38 + extern const struct regmap_irq_chip wm8997_aod; 39 + extern const struct regmap_irq_chip wm8997_irq; 39 40 40 41 int arizona_dev_init(struct arizona *arizona); 41 42 int arizona_dev_exit(struct arizona *arizona);
+4 -10
drivers/mfd/asic3.c
··· 958 958 unsigned long clksel; 959 959 int ret = 0; 960 960 961 - asic = kzalloc(sizeof(struct asic3), GFP_KERNEL); 961 + asic = devm_kzalloc(&pdev->dev, 962 + sizeof(struct asic3), GFP_KERNEL); 962 963 if (asic == NULL) { 963 964 printk(KERN_ERR "kzalloc failed\n"); 964 965 return -ENOMEM; ··· 971 970 972 971 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 973 972 if (!mem) { 974 - ret = -ENOMEM; 975 973 dev_err(asic->dev, "no MEM resource\n"); 976 - goto out_free; 974 + return -ENOMEM; 977 975 } 978 976 979 977 asic->mapping = ioremap(mem->start, resource_size(mem)); 980 978 if (!asic->mapping) { 981 - ret = -ENOMEM; 982 979 dev_err(asic->dev, "Couldn't ioremap\n"); 983 - goto out_free; 980 + return -ENOMEM; 984 981 } 985 982 986 983 asic->irq_base = pdata->irq_base; ··· 1032 1033 out_unmap: 1033 1034 iounmap(asic->mapping); 1034 1035 1035 - out_free: 1036 - kfree(asic); 1037 - 1038 1036 return ret; 1039 1037 } 1040 1038 ··· 1053 1057 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), 0); 1054 1058 1055 1059 iounmap(asic->mapping); 1056 - 1057 - kfree(asic); 1058 1060 1059 1061 return 0; 1060 1062 }
+9 -19
drivers/mfd/cros_ec.c
··· 104 104 ec_dev->command_sendrecv = cros_ec_command_sendrecv; 105 105 106 106 if (ec_dev->din_size) { 107 - ec_dev->din = kmalloc(ec_dev->din_size, GFP_KERNEL); 108 - if (!ec_dev->din) { 109 - err = -ENOMEM; 110 - goto fail_din; 111 - } 107 + ec_dev->din = devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); 108 + if (!ec_dev->din) 109 + return -ENOMEM; 112 110 } 113 111 if (ec_dev->dout_size) { 114 - ec_dev->dout = kmalloc(ec_dev->dout_size, GFP_KERNEL); 115 - if (!ec_dev->dout) { 116 - err = -ENOMEM; 117 - goto fail_dout; 118 - } 112 + ec_dev->dout = devm_kzalloc(dev, ec_dev->dout_size, GFP_KERNEL); 113 + if (!ec_dev->dout) 114 + return -ENOMEM; 119 115 } 120 116 121 117 if (!ec_dev->irq) { 122 118 dev_dbg(dev, "no valid IRQ: %d\n", ec_dev->irq); 123 - goto fail_irq; 119 + return err; 124 120 } 125 121 126 122 err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, ··· 124 128 "chromeos-ec", ec_dev); 125 129 if (err) { 126 130 dev_err(dev, "request irq %d: error %d\n", ec_dev->irq, err); 127 - goto fail_irq; 131 + return err; 128 132 } 129 133 130 134 err = mfd_add_devices(dev, 0, cros_devs, ··· 141 145 142 146 fail_mfd: 143 147 free_irq(ec_dev->irq, ec_dev); 144 - fail_irq: 145 - kfree(ec_dev->dout); 146 - fail_dout: 147 - kfree(ec_dev->din); 148 - fail_din: 148 + 149 149 return err; 150 150 } 151 151 EXPORT_SYMBOL(cros_ec_register); ··· 150 158 { 151 159 mfd_remove_devices(ec_dev->dev); 152 160 free_irq(ec_dev->irq, ec_dev); 153 - kfree(ec_dev->dout); 154 - kfree(ec_dev->din); 155 161 156 162 return 0; 157 163 }
+13 -45
drivers/mfd/davinci_voicecodec.c
··· 46 46 static int __init davinci_vc_probe(struct platform_device *pdev) 47 47 { 48 48 struct davinci_vc *davinci_vc; 49 - struct resource *res, *mem; 49 + struct resource *res; 50 50 struct mfd_cell *cell = NULL; 51 51 int ret; 52 52 53 - davinci_vc = kzalloc(sizeof(struct davinci_vc), GFP_KERNEL); 53 + davinci_vc = devm_kzalloc(&pdev->dev, 54 + sizeof(struct davinci_vc), GFP_KERNEL); 54 55 if (!davinci_vc) { 55 56 dev_dbg(&pdev->dev, 56 57 "could not allocate memory for private data\n"); 57 58 return -ENOMEM; 58 59 } 59 60 60 - davinci_vc->clk = clk_get(&pdev->dev, NULL); 61 + davinci_vc->clk = devm_clk_get(&pdev->dev, NULL); 61 62 if (IS_ERR(davinci_vc->clk)) { 62 63 dev_dbg(&pdev->dev, 63 64 "could not get the clock for voice codec\n"); 64 - ret = -ENODEV; 65 - goto fail1; 65 + return -ENODEV; 66 66 } 67 67 clk_enable(davinci_vc->clk); 68 68 69 69 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 70 - if (!res) { 71 - dev_err(&pdev->dev, "no mem resource\n"); 72 - ret = -ENODEV; 73 - goto fail2; 74 - } 75 70 76 - davinci_vc->pbase = res->start; 77 - davinci_vc->base_size = resource_size(res); 78 - 79 - mem = request_mem_region(davinci_vc->pbase, davinci_vc->base_size, 80 - pdev->name); 81 - if (!mem) { 82 - dev_err(&pdev->dev, "VCIF region already claimed\n"); 83 - ret = -EBUSY; 84 - goto fail2; 85 - } 86 - 87 - davinci_vc->base = ioremap(davinci_vc->pbase, davinci_vc->base_size); 88 - if (!davinci_vc->base) { 89 - dev_err(&pdev->dev, "can't ioremap mem resource.\n"); 90 - ret = -ENOMEM; 91 - goto fail3; 71 + davinci_vc->base = devm_ioremap_resource(&pdev->dev, res); 72 + if (IS_ERR(davinci_vc->base)) { 73 + ret = PTR_ERR(davinci_vc->base); 74 + goto fail; 92 75 } 93 76 94 77 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 95 78 if (!res) { 96 79 dev_err(&pdev->dev, "no DMA resource\n"); 97 80 ret = -ENXIO; 98 - goto fail4; 81 + goto fail; 99 82 } 100 83 101 84 davinci_vc->davinci_vcif.dma_tx_channel = res->start; ··· 89 106 if (!res) { 90 107 dev_err(&pdev->dev, "no DMA resource\n"); 91 108 ret = -ENXIO; 92 - goto fail4; 109 + goto fail; 93 110 } 94 111 95 112 davinci_vc->davinci_vcif.dma_rx_channel = res->start; ··· 115 132 DAVINCI_VC_CELLS, NULL, 0, NULL); 116 133 if (ret != 0) { 117 134 dev_err(&pdev->dev, "fail to register client devices\n"); 118 - goto fail4; 135 + goto fail; 119 136 } 120 137 121 138 return 0; 122 139 123 - fail4: 124 - iounmap(davinci_vc->base); 125 - fail3: 126 - release_mem_region(davinci_vc->pbase, davinci_vc->base_size); 127 - fail2: 140 + fail: 128 141 clk_disable(davinci_vc->clk); 129 - clk_put(davinci_vc->clk); 130 - davinci_vc->clk = NULL; 131 - fail1: 132 - kfree(davinci_vc); 133 142 134 143 return ret; 135 144 } ··· 132 157 133 158 mfd_remove_devices(&pdev->dev); 134 159 135 - iounmap(davinci_vc->base); 136 - release_mem_region(davinci_vc->pbase, davinci_vc->base_size); 137 - 138 160 clk_disable(davinci_vc->clk); 139 - clk_put(davinci_vc->clk); 140 - davinci_vc->clk = NULL; 141 - 142 - kfree(davinci_vc); 143 161 144 162 return 0; 145 163 }
+2 -2
drivers/mfd/dbx500-prcmu-regs.h
··· 16 16 #define BITS(_start, _end) ((BIT(_end) - BIT(_start)) + BIT(_end)) 17 17 18 18 #define PRCM_ACLK_MGT (0x004) 19 - #define PRCM_SVACLK_MGT (0x008) 20 - #define PRCM_SIACLK_MGT (0x00C) 19 + #define PRCM_SVAMMCSPCLK_MGT (0x008) 20 + #define PRCM_SIAMMDSPCLK_MGT (0x00C) 21 21 #define PRCM_SGACLK_MGT (0x014) 22 22 #define PRCM_UARTCLK_MGT (0x018) 23 23 #define PRCM_MSP02CLK_MGT (0x01C)
+6 -7
drivers/mfd/htc-egpio.c
··· 270 270 int ret; 271 271 272 272 /* Initialize ei data structure. */ 273 - ei = kzalloc(sizeof(*ei), GFP_KERNEL); 273 + ei = devm_kzalloc(&pdev->dev, sizeof(*ei), GFP_KERNEL); 274 274 if (!ei) 275 275 return -ENOMEM; 276 276 ··· 286 286 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 287 287 if (!res) 288 288 goto fail; 289 - ei->base_addr = ioremap_nocache(res->start, resource_size(res)); 289 + ei->base_addr = devm_ioremap_nocache(&pdev->dev, res->start, 290 + resource_size(res)); 290 291 if (!ei->base_addr) 291 292 goto fail; 292 293 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); ··· 307 306 platform_set_drvdata(pdev, ei); 308 307 309 308 ei->nchips = pdata->num_chips; 310 - ei->chip = kzalloc(sizeof(struct egpio_chip) * ei->nchips, GFP_KERNEL); 309 + ei->chip = devm_kzalloc(&pdev->dev, 310 + sizeof(struct egpio_chip) * ei->nchips, 311 + GFP_KERNEL); 311 312 if (!ei->chip) { 312 313 ret = -ENOMEM; 313 314 goto fail; ··· 364 361 365 362 fail: 366 363 printk(KERN_ERR "EGPIO failed to setup\n"); 367 - kfree(ei); 368 364 return ret; 369 365 } 370 366 ··· 381 379 irq_set_chained_handler(ei->chained_irq, NULL); 382 380 device_init_wakeup(&pdev->dev, 0); 383 381 } 384 - iounmap(ei->base_addr); 385 - kfree(ei->chip); 386 - kfree(ei); 387 382 388 383 return 0; 389 384 }
+5 -10
drivers/mfd/htc-i2cpld.c
··· 514 514 515 515 /* Setup each chip's output GPIOs */ 516 516 htcpld->nchips = pdata->num_chip; 517 - htcpld->chip = kzalloc(sizeof(struct htcpld_chip) * htcpld->nchips, 518 - GFP_KERNEL); 517 + htcpld->chip = devm_kzalloc(dev, sizeof(struct htcpld_chip) * htcpld->nchips, 518 + GFP_KERNEL); 519 519 if (!htcpld->chip) { 520 520 dev_warn(dev, "Unable to allocate memory for chips\n"); 521 521 return -ENOMEM; ··· 580 580 return -ENXIO; 581 581 } 582 582 583 - htcpld = kzalloc(sizeof(struct htcpld_data), GFP_KERNEL); 583 + htcpld = devm_kzalloc(dev, sizeof(struct htcpld_data), GFP_KERNEL); 584 584 if (!htcpld) 585 585 return -ENOMEM; 586 586 587 587 /* Find chained irq */ 588 - ret = -EINVAL; 589 588 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 590 589 if (res) { 591 590 int flags; ··· 597 598 flags, pdev->name, htcpld); 598 599 if (ret) { 599 600 dev_warn(dev, "Unable to setup chained irq handler: %d\n", ret); 600 - goto fail; 601 + return ret; 601 602 } else 602 603 device_init_wakeup(dev, 0); 603 604 } ··· 608 609 /* Setup the htcpld chips */ 609 610 ret = htcpld_setup_chips(pdev); 610 611 if (ret) 611 - goto fail; 612 + return ret; 612 613 613 614 /* Request the GPIO(s) for the int reset and set them up */ 614 615 if (pdata->int_reset_gpio_hi) { ··· 643 644 644 645 dev_info(dev, "Initialized successfully\n"); 645 646 return 0; 646 - 647 - fail: 648 - kfree(htcpld); 649 - return ret; 650 647 } 651 648 652 649 /* The I2C Driver -- used internally */
+1 -3
drivers/mfd/htc-pasic3.c
··· 147 147 if (!request_mem_region(r->start, resource_size(r), "pasic3")) 148 148 return -EBUSY; 149 149 150 - asic = kzalloc(sizeof(struct pasic3_data), GFP_KERNEL); 150 + asic = devm_kzalloc(dev, sizeof(struct pasic3_data), GFP_KERNEL); 151 151 if (!asic) 152 152 return -ENOMEM; 153 153 ··· 156 156 asic->mapping = ioremap(r->start, resource_size(r)); 157 157 if (!asic->mapping) { 158 158 dev_err(dev, "couldn't ioremap PASIC3\n"); 159 - kfree(asic); 160 159 return -ENOMEM; 161 160 } 162 161 ··· 194 195 iounmap(asic->mapping); 195 196 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 196 197 release_mem_region(r->start, resource_size(r)); 197 - kfree(asic); 198 198 return 0; 199 199 } 200 200
-1
drivers/mfd/intel_msic.c
··· 438 438 struct intel_msic *msic = platform_get_drvdata(pdev); 439 439 440 440 intel_msic_remove_devices(msic); 441 - platform_set_drvdata(pdev, NULL); 442 441 443 442 return 0; 444 443 }
+4 -8
drivers/mfd/janz-cmodio.c
··· 183 183 struct cmodio_device *priv; 184 184 int ret; 185 185 186 - priv = kzalloc(sizeof(*priv), GFP_KERNEL); 186 + priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); 187 187 if (!priv) { 188 188 dev_err(&dev->dev, "unable to allocate private data\n"); 189 - ret = -ENOMEM; 190 - goto out_return; 189 + return -ENOMEM; 191 190 } 192 191 193 192 pci_set_drvdata(dev, priv); ··· 196 197 ret = pci_enable_device(dev); 197 198 if (ret) { 198 199 dev_err(&dev->dev, "unable to enable device\n"); 199 - goto out_free_priv; 200 + return ret; 200 201 } 201 202 202 203 pci_set_master(dev); ··· 247 248 pci_release_regions(dev); 248 249 out_pci_disable_device: 249 250 pci_disable_device(dev); 250 - out_free_priv: 251 - kfree(priv); 252 - out_return: 251 + 253 252 return ret; 254 253 } 255 254 ··· 260 263 iounmap(priv->ctrl); 261 264 pci_release_regions(dev); 262 265 pci_disable_device(dev); 263 - kfree(priv); 264 266 } 265 267 266 268 #define PCI_VENDOR_ID_JANZ 0x13c3
+2 -5
drivers/mfd/jz4740-adc.c
··· 86 86 static inline void jz4740_adc_clk_enable(struct jz4740_adc *adc) 87 87 { 88 88 if (atomic_inc_return(&adc->clk_ref) == 1) 89 - clk_enable(adc->clk); 89 + clk_prepare_enable(adc->clk); 90 90 } 91 91 92 92 static inline void jz4740_adc_clk_disable(struct jz4740_adc *adc) 93 93 { 94 94 if (atomic_dec_return(&adc->clk_ref) == 0) 95 - clk_disable(adc->clk); 95 + clk_disable_unprepare(adc->clk); 96 96 } 97 97 98 98 static inline void jz4740_adc_set_enabled(struct jz4740_adc *adc, int engine, ··· 294 294 err_clk_put: 295 295 clk_put(adc->clk); 296 296 err_iounmap: 297 - platform_set_drvdata(pdev, NULL); 298 297 iounmap(adc->base); 299 298 err_release_mem_region: 300 299 release_mem_region(adc->mem->start, resource_size(adc->mem)); ··· 315 316 release_mem_region(adc->mem->start, resource_size(adc->mem)); 316 317 317 318 clk_put(adc->clk); 318 - 319 - platform_set_drvdata(pdev, NULL); 320 319 321 320 return 0; 322 321 }
+641
drivers/mfd/kempld-core.c
··· 1 + /* 2 + * Kontron PLD MFD core driver 3 + * 4 + * Copyright (c) 2010-2013 Kontron Europe GmbH 5 + * Author: Michael Brunner <michael.brunner@kontron.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 2 as published 9 + * by the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + */ 16 + 17 + #include <linux/platform_device.h> 18 + #include <linux/mfd/core.h> 19 + #include <linux/mfd/kempld.h> 20 + #include <linux/module.h> 21 + #include <linux/dmi.h> 22 + #include <linux/io.h> 23 + #include <linux/delay.h> 24 + 25 + #define MAX_ID_LEN 4 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); 28 + MODULE_PARM_DESC(force_device_id, "Override detected product"); 29 + 30 + /* 31 + * Get hardware mutex to block firmware from accessing the pld. 32 + * It is possible for the firmware may hold the mutex for an extended length of 33 + * time. This function will block until access has been granted. 34 + */ 35 + static void kempld_get_hardware_mutex(struct kempld_device_data *pld) 36 + { 37 + /* The mutex bit will read 1 until access has been granted */ 38 + while (ioread8(pld->io_index) & KEMPLD_MUTEX_KEY) 39 + msleep(1); 40 + } 41 + 42 + static void kempld_release_hardware_mutex(struct kempld_device_data *pld) 43 + { 44 + /* The harware mutex is released when 1 is written to the mutex bit. */ 45 + iowrite8(KEMPLD_MUTEX_KEY, pld->io_index); 46 + } 47 + 48 + static int kempld_get_info_generic(struct kempld_device_data *pld) 49 + { 50 + u16 version; 51 + u8 spec; 52 + 53 + kempld_get_mutex(pld); 54 + 55 + version = kempld_read16(pld, KEMPLD_VERSION); 56 + spec = kempld_read8(pld, KEMPLD_SPEC); 57 + pld->info.buildnr = kempld_read16(pld, KEMPLD_BUILDNR); 58 + 59 + pld->info.minor = KEMPLD_VERSION_GET_MINOR(version); 60 + pld->info.major = KEMPLD_VERSION_GET_MAJOR(version); 61 + pld->info.number = KEMPLD_VERSION_GET_NUMBER(version); 62 + pld->info.type = KEMPLD_VERSION_GET_TYPE(version); 63 + 64 + if (spec == 0xff) { 65 + pld->info.spec_minor = 0; 66 + pld->info.spec_major = 1; 67 + } else { 68 + pld->info.spec_minor = KEMPLD_SPEC_GET_MINOR(spec); 69 + pld->info.spec_major = KEMPLD_SPEC_GET_MAJOR(spec); 70 + } 71 + 72 + if (pld->info.spec_major > 0) 73 + pld->feature_mask = kempld_read16(pld, KEMPLD_FEATURE); 74 + else 75 + pld->feature_mask = 0; 76 + 77 + kempld_release_mutex(pld); 78 + 79 + return 0; 80 + } 81 + 82 + enum kempld_cells { 83 + KEMPLD_I2C = 0, 84 + KEMPLD_WDT, 85 + KEMPLD_GPIO, 86 + KEMPLD_UART, 87 + }; 88 + 89 + static struct mfd_cell kempld_devs[] = { 90 + [KEMPLD_I2C] = { 91 + .name = "kempld-i2c", 92 + }, 93 + [KEMPLD_WDT] = { 94 + .name = "kempld-wdt", 95 + }, 96 + [KEMPLD_GPIO] = { 97 + .name = "kempld-gpio", 98 + }, 99 + [KEMPLD_UART] = { 100 + .name = "kempld-uart", 101 + }, 102 + }; 103 + 104 + #define KEMPLD_MAX_DEVS ARRAY_SIZE(kempld_devs) 105 + 106 + static int kempld_register_cells_generic(struct kempld_device_data *pld) 107 + { 108 + struct mfd_cell devs[KEMPLD_MAX_DEVS]; 109 + int i = 0; 110 + 111 + if (pld->feature_mask & KEMPLD_FEATURE_BIT_I2C) 112 + devs[i++] = kempld_devs[KEMPLD_I2C]; 113 + 114 + if (pld->feature_mask & KEMPLD_FEATURE_BIT_WATCHDOG) 115 + devs[i++] = kempld_devs[KEMPLD_WDT]; 116 + 117 + if (pld->feature_mask & KEMPLD_FEATURE_BIT_GPIO) 118 + devs[i++] = kempld_devs[KEMPLD_GPIO]; 119 + 120 + if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART) 121 + devs[i++] = kempld_devs[KEMPLD_UART]; 122 + 123 + return mfd_add_devices(pld->dev, -1, devs, i, NULL, 0, NULL); 124 + } 125 + 126 + static struct resource kempld_ioresource = { 127 + .start = KEMPLD_IOINDEX, 128 + .end = KEMPLD_IODATA, 129 + .flags = IORESOURCE_IO, 130 + }; 131 + 132 + static const struct kempld_platform_data kempld_platform_data_generic = { 133 + .pld_clock = KEMPLD_CLK, 134 + .ioresource = &kempld_ioresource, 135 + .get_hardware_mutex = kempld_get_hardware_mutex, 136 + .release_hardware_mutex = kempld_release_hardware_mutex, 137 + .get_info = kempld_get_info_generic, 138 + .register_cells = kempld_register_cells_generic, 139 + }; 140 + 141 + static struct platform_device *kempld_pdev; 142 + 143 + static int kempld_create_platform_device(const struct dmi_system_id *id) 144 + { 145 + struct kempld_platform_data *pdata = id->driver_data; 146 + int ret; 147 + 148 + kempld_pdev = platform_device_alloc("kempld", -1); 149 + if (!kempld_pdev) 150 + return -ENOMEM; 151 + 152 + ret = platform_device_add_data(kempld_pdev, pdata, sizeof(*pdata)); 153 + if (ret) 154 + goto err; 155 + 156 + ret = platform_device_add_resources(kempld_pdev, pdata->ioresource, 1); 157 + if (ret) 158 + goto err; 159 + 160 + ret = platform_device_add(kempld_pdev); 161 + if (ret) 162 + goto err; 163 + 164 + return 0; 165 + err: 166 + platform_device_put(kempld_pdev); 167 + return ret; 168 + } 169 + 170 + /** 171 + * kempld_read8 - read 8 bit register 172 + * @pld: kempld_device_data structure describing the PLD 173 + * @index: register index on the chip 174 + * 175 + * kempld_get_mutex must be called prior to calling this function. 176 + */ 177 + u8 kempld_read8(struct kempld_device_data *pld, u8 index) 178 + { 179 + iowrite8(index, pld->io_index); 180 + return ioread8(pld->io_data); 181 + } 182 + EXPORT_SYMBOL_GPL(kempld_read8); 183 + 184 + /** 185 + * kempld_write8 - write 8 bit register 186 + * @pld: kempld_device_data structure describing the PLD 187 + * @index: register index on the chip 188 + * @data: new register value 189 + * 190 + * kempld_get_mutex must be called prior to calling this function. 191 + */ 192 + void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data) 193 + { 194 + iowrite8(index, pld->io_index); 195 + iowrite8(data, pld->io_data); 196 + } 197 + EXPORT_SYMBOL_GPL(kempld_write8); 198 + 199 + /** 200 + * kempld_read16 - read 16 bit register 201 + * @pld: kempld_device_data structure describing the PLD 202 + * @index: register index on the chip 203 + * 204 + * kempld_get_mutex must be called prior to calling this function. 205 + */ 206 + u16 kempld_read16(struct kempld_device_data *pld, u8 index) 207 + { 208 + return kempld_read8(pld, index) | kempld_read8(pld, index + 1) << 8; 209 + } 210 + EXPORT_SYMBOL_GPL(kempld_read16); 211 + 212 + /** 213 + * kempld_write16 - write 16 bit register 214 + * @pld: kempld_device_data structure describing the PLD 215 + * @index: register index on the chip 216 + * @data: new register value 217 + * 218 + * kempld_get_mutex must be called prior to calling this function. 219 + */ 220 + void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data) 221 + { 222 + kempld_write8(pld, index, (u8)data); 223 + kempld_write8(pld, index + 1, (u8)(data >> 8)); 224 + } 225 + EXPORT_SYMBOL_GPL(kempld_write16); 226 + 227 + /** 228 + * kempld_read32 - read 32 bit register 229 + * @pld: kempld_device_data structure describing the PLD 230 + * @index: register index on the chip 231 + * 232 + * kempld_get_mutex must be called prior to calling this function. 233 + */ 234 + u32 kempld_read32(struct kempld_device_data *pld, u8 index) 235 + { 236 + return kempld_read16(pld, index) | kempld_read16(pld, index + 2) << 16; 237 + } 238 + EXPORT_SYMBOL_GPL(kempld_read32); 239 + 240 + /** 241 + * kempld_write32 - write 32 bit register 242 + * @pld: kempld_device_data structure describing the PLD 243 + * @index: register index on the chip 244 + * @data: new register value 245 + * 246 + * kempld_get_mutex must be called prior to calling this function. 247 + */ 248 + void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data) 249 + { 250 + kempld_write16(pld, index, (u16)data); 251 + kempld_write16(pld, index + 2, (u16)(data >> 16)); 252 + } 253 + EXPORT_SYMBOL_GPL(kempld_write32); 254 + 255 + /** 256 + * kempld_get_mutex - acquire PLD mutex 257 + * @pld: kempld_device_data structure describing the PLD 258 + */ 259 + void kempld_get_mutex(struct kempld_device_data *pld) 260 + { 261 + struct kempld_platform_data *pdata = pld->dev->platform_data; 262 + 263 + mutex_lock(&pld->lock); 264 + pdata->get_hardware_mutex(pld); 265 + } 266 + EXPORT_SYMBOL_GPL(kempld_get_mutex); 267 + 268 + /** 269 + * kempld_release_mutex - release PLD mutex 270 + * @pld: kempld_device_data structure describing the PLD 271 + */ 272 + void kempld_release_mutex(struct kempld_device_data *pld) 273 + { 274 + struct kempld_platform_data *pdata = pld->dev->platform_data; 275 + 276 + pdata->release_hardware_mutex(pld); 277 + mutex_unlock(&pld->lock); 278 + } 279 + EXPORT_SYMBOL_GPL(kempld_release_mutex); 280 + 281 + /** 282 + * kempld_get_info - update device specific information 283 + * @pld: kempld_device_data structure describing the PLD 284 + * 285 + * This function calls the configured board specific kempld_get_info_XXXX 286 + * function which is responsible for gathering information about the specific 287 + * hardware. The information is then stored within the pld structure. 288 + */ 289 + static int kempld_get_info(struct kempld_device_data *pld) 290 + { 291 + struct kempld_platform_data *pdata = pld->dev->platform_data; 292 + 293 + return pdata->get_info(pld); 294 + } 295 + 296 + /* 297 + * kempld_register_cells - register cell drivers 298 + * 299 + * This function registers cell drivers for the detected hardware by calling 300 + * the configured kempld_register_cells_XXXX function which is responsible 301 + * to detect and register the needed cell drivers. 302 + */ 303 + static int kempld_register_cells(struct kempld_device_data *pld) 304 + { 305 + struct kempld_platform_data *pdata = pld->dev->platform_data; 306 + 307 + return pdata->register_cells(pld); 308 + } 309 + 310 + static int kempld_detect_device(struct kempld_device_data *pld) 311 + { 312 + char *version_type; 313 + u8 index_reg; 314 + int ret; 315 + 316 + mutex_lock(&pld->lock); 317 + 318 + /* Check for empty IO space */ 319 + index_reg = ioread8(pld->io_index); 320 + if (index_reg == 0xff && ioread8(pld->io_data) == 0xff) { 321 + mutex_unlock(&pld->lock); 322 + return -ENODEV; 323 + } 324 + 325 + /* Release hardware mutex if aquired */ 326 + if (!(index_reg & KEMPLD_MUTEX_KEY)) 327 + iowrite8(KEMPLD_MUTEX_KEY, pld->io_index); 328 + 329 + mutex_unlock(&pld->lock); 330 + 331 + ret = kempld_get_info(pld); 332 + if (ret) 333 + return ret; 334 + 335 + switch (pld->info.type) { 336 + case 0: 337 + version_type = "release"; 338 + break; 339 + case 1: 340 + version_type = "debug"; 341 + break; 342 + case 2: 343 + version_type = "custom"; 344 + break; 345 + default: 346 + version_type = "unspecified"; 347 + } 348 + 349 + dev_info(pld->dev, "Found Kontron PLD %d\n", pld->info.number); 350 + dev_info(pld->dev, "%s version %d.%d build %d, specification %d.%d\n", 351 + version_type, pld->info.major, pld->info.minor, 352 + pld->info.buildnr, pld->info.spec_major, 353 + pld->info.spec_minor); 354 + 355 + return kempld_register_cells(pld); 356 + } 357 + 358 + static int kempld_probe(struct platform_device *pdev) 359 + { 360 + struct kempld_platform_data *pdata = pdev->dev.platform_data; 361 + struct device *dev = &pdev->dev; 362 + struct kempld_device_data *pld; 363 + struct resource *ioport; 364 + int ret; 365 + 366 + pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); 367 + if (!pld) 368 + return -ENOMEM; 369 + 370 + ioport = platform_get_resource(pdev, IORESOURCE_IO, 0); 371 + if (!ioport) 372 + return -EINVAL; 373 + 374 + pld->io_base = devm_ioport_map(dev, ioport->start, 375 + ioport->end - ioport->start); 376 + if (!pld->io_base) 377 + return -ENOMEM; 378 + 379 + pld->io_index = pld->io_base; 380 + pld->io_data = pld->io_base + 1; 381 + pld->pld_clock = pdata->pld_clock; 382 + pld->dev = dev; 383 + 384 + mutex_init(&pld->lock); 385 + platform_set_drvdata(pdev, pld); 386 + 387 + ret = kempld_detect_device(pld); 388 + if (ret) 389 + return ret; 390 + 391 + return 0; 392 + } 393 + 394 + static int kempld_remove(struct platform_device *pdev) 395 + { 396 + struct kempld_device_data *pld = platform_get_drvdata(pdev); 397 + struct kempld_platform_data *pdata = pld->dev->platform_data; 398 + 399 + mfd_remove_devices(&pdev->dev); 400 + pdata->release_hardware_mutex(pld); 401 + 402 + return 0; 403 + } 404 + 405 + static struct platform_driver kempld_driver = { 406 + .driver = { 407 + .name = "kempld", 408 + .owner = THIS_MODULE, 409 + }, 410 + .probe = kempld_probe, 411 + .remove = kempld_remove, 412 + }; 413 + 414 + static struct dmi_system_id __initdata kempld_dmi_table[] = { 415 + { 416 + .ident = "CCR2", 417 + .matches = { 418 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 419 + DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP2"), 420 + }, 421 + .driver_data = (void *)&kempld_platform_data_generic, 422 + .callback = kempld_create_platform_device, 423 + }, { 424 + .ident = "CCR6", 425 + .matches = { 426 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 427 + DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP6"), 428 + }, 429 + .driver_data = (void *)&kempld_platform_data_generic, 430 + .callback = kempld_create_platform_device, 431 + }, { 432 + .ident = "CHR2", 433 + .matches = { 434 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 435 + DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T2"), 436 + }, 437 + .driver_data = (void *)&kempld_platform_data_generic, 438 + .callback = kempld_create_platform_device, 439 + }, { 440 + .ident = "CHR2", 441 + .matches = { 442 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 443 + DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T2"), 444 + }, 445 + .driver_data = (void *)&kempld_platform_data_generic, 446 + .callback = kempld_create_platform_device, 447 + }, { 448 + .ident = "CHR2", 449 + .matches = { 450 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 451 + DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC2"), 452 + }, 453 + .driver_data = (void *)&kempld_platform_data_generic, 454 + .callback = kempld_create_platform_device, 455 + }, { 456 + .ident = "CHR6", 457 + .matches = { 458 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 459 + DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T6"), 460 + }, 461 + .driver_data = (void *)&kempld_platform_data_generic, 462 + .callback = kempld_create_platform_device, 463 + }, { 464 + .ident = "CHR6", 465 + .matches = { 466 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 467 + DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T6"), 468 + }, 469 + .driver_data = (void *)&kempld_platform_data_generic, 470 + .callback = kempld_create_platform_device, 471 + }, { 472 + .ident = "CHR6", 473 + .matches = { 474 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 475 + DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC6"), 476 + }, 477 + .driver_data = (void *)&kempld_platform_data_generic, 478 + .callback = kempld_create_platform_device, 479 + }, { 480 + .ident = "CNTG", 481 + .matches = { 482 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 483 + DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-PC"), 484 + }, 485 + .driver_data = (void *)&kempld_platform_data_generic, 486 + .callback = kempld_create_platform_device, 487 + }, { 488 + .ident = "CNTG", 489 + .matches = { 490 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 491 + DMI_MATCH(DMI_BOARD_NAME, "COMe-bPC2"), 492 + }, 493 + .driver_data = (void *)&kempld_platform_data_generic, 494 + .callback = kempld_create_platform_device, 495 + }, { 496 + .ident = "CNTX", 497 + .matches = { 498 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 499 + DMI_MATCH(DMI_BOARD_NAME, "PXT"), 500 + }, 501 + .driver_data = (void *)&kempld_platform_data_generic, 502 + .callback = kempld_create_platform_device, 503 + }, { 504 + .ident = "FRI2", 505 + .matches = { 506 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 507 + DMI_MATCH(DMI_BIOS_VERSION, "FRI2"), 508 + }, 509 + .driver_data = (void *)&kempld_platform_data_generic, 510 + .callback = kempld_create_platform_device, 511 + }, { 512 + .ident = "FRI2", 513 + .matches = { 514 + DMI_MATCH(DMI_PRODUCT_NAME, "Fish River Island II"), 515 + }, 516 + .driver_data = (void *)&kempld_platform_data_generic, 517 + .callback = kempld_create_platform_device, 518 + }, { 519 + .ident = "MBR1", 520 + .matches = { 521 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 522 + DMI_MATCH(DMI_BOARD_NAME, "ETX-OH"), 523 + }, 524 + .driver_data = (void *)&kempld_platform_data_generic, 525 + .callback = kempld_create_platform_device, 526 + }, { 527 + .ident = "NTC1", 528 + .matches = { 529 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 530 + DMI_MATCH(DMI_BOARD_NAME, "nanoETXexpress-TT"), 531 + }, 532 + .driver_data = (void *)&kempld_platform_data_generic, 533 + .callback = kempld_create_platform_device, 534 + }, { 535 + .ident = "NTC1", 536 + .matches = { 537 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 538 + DMI_MATCH(DMI_BOARD_NAME, "nETXe-TT"), 539 + }, 540 + .driver_data = (void *)&kempld_platform_data_generic, 541 + .callback = kempld_create_platform_device, 542 + }, { 543 + .ident = "NTC1", 544 + .matches = { 545 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 546 + DMI_MATCH(DMI_BOARD_NAME, "COMe-mTT"), 547 + }, 548 + .driver_data = (void *)&kempld_platform_data_generic, 549 + .callback = kempld_create_platform_device, 550 + }, { 551 + .ident = "NUP1", 552 + .matches = { 553 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 554 + DMI_MATCH(DMI_BOARD_NAME, "COMe-mCT"), 555 + }, 556 + .driver_data = (void *)&kempld_platform_data_generic, 557 + .callback = kempld_create_platform_device, 558 + }, { 559 + .ident = "UNP1", 560 + .matches = { 561 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 562 + DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-DC"), 563 + }, 564 + .driver_data = (void *)&kempld_platform_data_generic, 565 + .callback = kempld_create_platform_device, 566 + }, { 567 + .ident = "UNP1", 568 + .matches = { 569 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 570 + DMI_MATCH(DMI_BOARD_NAME, "COMe-cDC2"), 571 + }, 572 + .driver_data = (void *)&kempld_platform_data_generic, 573 + .callback = kempld_create_platform_device, 574 + }, { 575 + .ident = "UNTG", 576 + .matches = { 577 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 578 + DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-PC"), 579 + }, 580 + .driver_data = (void *)&kempld_platform_data_generic, 581 + .callback = kempld_create_platform_device, 582 + }, { 583 + .ident = "UNTG", 584 + .matches = { 585 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 586 + DMI_MATCH(DMI_BOARD_NAME, "COMe-cPC2"), 587 + }, 588 + .driver_data = (void *)&kempld_platform_data_generic, 589 + .callback = kempld_create_platform_device, 590 + }, { 591 + .ident = "UUP6", 592 + .matches = { 593 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 594 + DMI_MATCH(DMI_BOARD_NAME, "COMe-cCT6"), 595 + }, 596 + .driver_data = (void *)&kempld_platform_data_generic, 597 + .callback = kempld_create_platform_device, 598 + }, 599 + {} 600 + }; 601 + MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); 602 + 603 + static int __init kempld_init(void) 604 + { 605 + const struct dmi_system_id *id; 606 + int ret; 607 + 608 + if (force_device_id[0]) { 609 + for (id = kempld_dmi_table; id->matches[0].slot != DMI_NONE; id++) 610 + if (strstr(id->ident, force_device_id)) 611 + if (id->callback && id->callback(id)) 612 + break; 613 + if (id->matches[0].slot == DMI_NONE) 614 + return -ENODEV; 615 + } else { 616 + if (!dmi_check_system(kempld_dmi_table)) 617 + return -ENODEV; 618 + } 619 + 620 + ret = platform_driver_register(&kempld_driver); 621 + if (ret) 622 + return ret; 623 + 624 + return 0; 625 + } 626 + 627 + static void __exit kempld_exit(void) 628 + { 629 + if (kempld_pdev) 630 + platform_device_unregister(kempld_pdev); 631 + 632 + platform_driver_unregister(&kempld_driver); 633 + } 634 + 635 + module_init(kempld_init); 636 + module_exit(kempld_exit); 637 + 638 + MODULE_DESCRIPTION("KEM PLD Core Driver"); 639 + MODULE_AUTHOR("Michael Brunner <michael.brunner@kontron.com>"); 640 + MODULE_LICENSE("GPL"); 641 + MODULE_ALIAS("platform:kempld-core");
+18 -12
drivers/mfd/lpc_ich.c
··· 51 51 * document number TBD : Lynx Point 52 52 * document number TBD : Lynx Point-LP 53 53 * document number TBD : Wellsburg 54 + * document number TBD : Avoton SoC 55 + * document number TBD : Coleto Creek 54 56 */ 55 57 56 58 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ··· 209 207 LPC_LPT, /* Lynx Point */ 210 208 LPC_LPT_LP, /* Lynx Point-LP */ 211 209 LPC_WBG, /* Wellsburg */ 210 + LPC_AVN, /* Avoton SoC */ 211 + LPC_COLETO, /* Coleto Creek */ 212 212 }; 213 213 214 214 struct lpc_ich_info lpc_chipset_info[] = { ··· 495 491 .name = "Wellsburg", 496 492 .iTCO_version = 2, 497 493 }, 494 + [LPC_AVN] = { 495 + .name = "Avoton SoC", 496 + .iTCO_version = 1, 497 + }, 498 + [LPC_COLETO] = { 499 + .name = "Coleto Creek", 500 + .iTCO_version = 2, 501 + }, 498 502 }; 499 503 500 504 /* ··· 716 704 { PCI_VDEVICE(INTEL, 0x8d5d), LPC_WBG}, 717 705 { PCI_VDEVICE(INTEL, 0x8d5e), LPC_WBG}, 718 706 { PCI_VDEVICE(INTEL, 0x8d5f), LPC_WBG}, 707 + { PCI_VDEVICE(INTEL, 0x1f38), LPC_AVN}, 708 + { PCI_VDEVICE(INTEL, 0x1f39), LPC_AVN}, 709 + { PCI_VDEVICE(INTEL, 0x1f3a), LPC_AVN}, 710 + { PCI_VDEVICE(INTEL, 0x1f3b), LPC_AVN}, 711 + { PCI_VDEVICE(INTEL, 0x2390), LPC_COLETO}, 719 712 { 0, }, /* End of list */ 720 713 }; 721 714 MODULE_DEVICE_TABLE(pci, lpc_ich_ids); ··· 990 973 .remove = lpc_ich_remove, 991 974 }; 992 975 993 - static int __init lpc_ich_init(void) 994 - { 995 - return pci_register_driver(&lpc_ich_driver); 996 - } 997 - 998 - static void __exit lpc_ich_exit(void) 999 - { 1000 - pci_unregister_driver(&lpc_ich_driver); 1001 - } 1002 - 1003 - module_init(lpc_ich_init); 1004 - module_exit(lpc_ich_exit); 976 + module_pci_driver(lpc_ich_driver); 1005 977 1006 978 MODULE_AUTHOR("Aaron Sierra <asierra@xes-inc.com>"); 1007 979 MODULE_DESCRIPTION("LPC interface for Intel ICH");
+9 -17
drivers/mfd/max77686.c
··· 37 37 static struct mfd_cell max77686_devs[] = { 38 38 { .name = "max77686-pmic", }, 39 39 { .name = "max77686-rtc", }, 40 + { .name = "max77686-clk", }, 40 41 }; 41 42 42 43 static struct regmap_config max77686_regmap_config = { ··· 85 84 pdata = max77686_i2c_parse_dt_pdata(&i2c->dev); 86 85 87 86 if (!pdata) { 88 - ret = -EIO; 89 87 dev_err(&i2c->dev, "No platform data found.\n"); 90 - goto err; 88 + return -EIO; 91 89 } 92 90 93 - max77686 = kzalloc(sizeof(struct max77686_dev), GFP_KERNEL); 91 + max77686 = devm_kzalloc(&i2c->dev, 92 + sizeof(struct max77686_dev), GFP_KERNEL); 94 93 if (max77686 == NULL) 95 94 return -ENOMEM; 96 95 ··· 108 107 ret = PTR_ERR(max77686->regmap); 109 108 dev_err(max77686->dev, "Failed to allocate register map: %d\n", 110 109 ret); 111 - kfree(max77686); 112 110 return ret; 113 111 } 114 112 ··· 115 115 MAX77686_REG_DEVICE_ID, &data) < 0) { 116 116 dev_err(max77686->dev, 117 117 "device not found on this channel (this is not an error)\n"); 118 - ret = -ENODEV; 119 - goto err; 118 + return -ENODEV; 120 119 } else 121 120 dev_info(max77686->dev, "device found\n"); 122 121 ··· 126 127 127 128 ret = mfd_add_devices(max77686->dev, -1, max77686_devs, 128 129 ARRAY_SIZE(max77686_devs), NULL, 0, NULL); 130 + if (ret < 0) { 131 + mfd_remove_devices(max77686->dev); 132 + i2c_unregister_device(max77686->rtc); 133 + } 129 134 130 - if (ret < 0) 131 - goto err_mfd; 132 - 133 - return ret; 134 - 135 - err_mfd: 136 - mfd_remove_devices(max77686->dev); 137 - i2c_unregister_device(max77686->rtc); 138 - err: 139 - kfree(max77686); 140 135 return ret; 141 136 } 142 137 ··· 140 147 141 148 mfd_remove_devices(max77686->dev); 142 149 i2c_unregister_device(max77686->rtc); 143 - kfree(max77686); 144 150 145 151 return 0; 146 152 }
+2 -2
drivers/mfd/max8925-i2c.c
··· 170 170 return -EINVAL; 171 171 } 172 172 173 - chip = kzalloc(sizeof(struct max8925_chip), GFP_KERNEL); 173 + chip = devm_kzalloc(&client->dev, 174 + sizeof(struct max8925_chip), GFP_KERNEL); 174 175 if (chip == NULL) 175 176 return -ENOMEM; 176 177 chip->i2c = client; ··· 200 199 max8925_device_exit(chip); 201 200 i2c_unregister_device(chip->adc); 202 201 i2c_unregister_device(chip->rtc); 203 - kfree(chip); 204 202 return 0; 205 203 } 206 204
+40 -25
drivers/mfd/max8998-irq.c
··· 14 14 #include <linux/device.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/irq.h> 17 + #include <linux/irqdomain.h> 17 18 #include <linux/mfd/max8998-private.h> 18 19 19 20 struct max8998_irq_data { ··· 100 99 static inline struct max8998_irq_data * 101 100 irq_to_max8998_irq(struct max8998_dev *max8998, int irq) 102 101 { 103 - return &max8998_irqs[irq - max8998->irq_base]; 102 + struct irq_data *data = irq_get_irq_data(irq); 103 + return &max8998_irqs[data->hwirq]; 104 104 } 105 105 106 106 static void max8998_irq_lock(struct irq_data *data) ··· 178 176 179 177 /* Report */ 180 178 for (i = 0; i < MAX8998_IRQ_NR; i++) { 181 - if (irq_reg[max8998_irqs[i].reg - 1] & max8998_irqs[i].mask) 182 - handle_nested_irq(max8998->irq_base + i); 179 + if (irq_reg[max8998_irqs[i].reg - 1] & max8998_irqs[i].mask) { 180 + irq = irq_find_mapping(max8998->irq_domain, i); 181 + if (WARN_ON(!irq)) { 182 + disable_irq_nosync(max8998->irq); 183 + return IRQ_NONE; 184 + } 185 + handle_nested_irq(irq); 186 + } 183 187 } 184 188 185 189 return IRQ_HANDLED; ··· 193 185 194 186 int max8998_irq_resume(struct max8998_dev *max8998) 195 187 { 196 - if (max8998->irq && max8998->irq_base) 197 - max8998_irq_thread(max8998->irq_base, max8998); 188 + if (max8998->irq && max8998->irq_domain) 189 + max8998_irq_thread(max8998->irq, max8998); 198 190 return 0; 199 191 } 192 + 193 + static int max8998_irq_domain_map(struct irq_domain *d, unsigned int irq, 194 + irq_hw_number_t hw) 195 + { 196 + struct max8997_dev *max8998 = d->host_data; 197 + 198 + irq_set_chip_data(irq, max8998); 199 + irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq); 200 + irq_set_nested_thread(irq, 1); 201 + #ifdef CONFIG_ARM 202 + set_irq_flags(irq, IRQF_VALID); 203 + #else 204 + irq_set_noprobe(irq); 205 + #endif 206 + return 0; 207 + } 208 + 209 + static struct irq_domain_ops max8998_irq_domain_ops = { 210 + .map = max8998_irq_domain_map, 211 + }; 200 212 201 213 int max8998_irq_init(struct max8998_dev *max8998) 202 214 { 203 215 int i; 204 - int cur_irq; 205 216 int ret; 217 + struct irq_domain *domain; 206 218 207 219 if (!max8998->irq) { 208 220 dev_warn(max8998->dev, 209 221 "No interrupt specified, no interrupts\n"); 210 - max8998->irq_base = 0; 211 - return 0; 212 - } 213 - 214 - if (!max8998->irq_base) { 215 - dev_err(max8998->dev, 216 - "No interrupt base specified, no interrupts\n"); 217 222 return 0; 218 223 } 219 224 ··· 242 221 max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM1, 0xff); 243 222 max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM2, 0xff); 244 223 245 - /* register with genirq */ 246 - for (i = 0; i < MAX8998_IRQ_NR; i++) { 247 - cur_irq = i + max8998->irq_base; 248 - irq_set_chip_data(cur_irq, max8998); 249 - irq_set_chip_and_handler(cur_irq, &max8998_irq_chip, 250 - handle_edge_irq); 251 - irq_set_nested_thread(cur_irq, 1); 252 - #ifdef CONFIG_ARM 253 - set_irq_flags(cur_irq, IRQF_VALID); 254 - #else 255 - irq_set_noprobe(cur_irq); 256 - #endif 224 + domain = irq_domain_add_simple(NULL, MAX8998_IRQ_NR, 225 + max8998->irq_base, &max8998_irq_domain_ops, max8998); 226 + if (!domain) { 227 + dev_err(max8998->dev, "could not create irq domain\n"); 228 + return -ENODEV; 257 229 } 230 + max8998->irq_domain = domain; 258 231 259 232 ret = request_threaded_irq(max8998->irq, NULL, max8998_irq_thread, 260 233 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+65 -2
drivers/mfd/max8998.c
··· 20 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 */ 22 22 23 + #include <linux/err.h> 23 24 #include <linux/module.h> 24 25 #include <linux/moduleparam.h> 25 26 #include <linux/init.h> 26 27 #include <linux/slab.h> 27 28 #include <linux/i2c.h> 28 29 #include <linux/interrupt.h> 30 + #include <linux/of.h> 31 + #include <linux/of_irq.h> 29 32 #include <linux/pm_runtime.h> 30 33 #include <linux/mutex.h> 31 34 #include <linux/mfd/core.h> ··· 131 128 } 132 129 EXPORT_SYMBOL(max8998_update_reg); 133 130 131 + #ifdef CONFIG_OF 132 + static struct of_device_id max8998_dt_match[] = { 133 + { .compatible = "maxim,max8998", .data = (void *)TYPE_MAX8998 }, 134 + { .compatible = "national,lp3974", .data = (void *)TYPE_LP3974 }, 135 + { .compatible = "ti,lp3974", .data = (void *)TYPE_LP3974 }, 136 + {}, 137 + }; 138 + MODULE_DEVICE_TABLE(of, max8998_dt_match); 139 + #endif 140 + 141 + /* 142 + * Only the common platform data elements for max8998 are parsed here from the 143 + * device tree. Other sub-modules of max8998 such as pmic, rtc and others have 144 + * to parse their own platform data elements from device tree. 145 + * 146 + * The max8998 platform data structure is instantiated here and the drivers for 147 + * the sub-modules need not instantiate another instance while parsing their 148 + * platform data. 149 + */ 150 + static struct max8998_platform_data *max8998_i2c_parse_dt_pdata( 151 + struct device *dev) 152 + { 153 + struct max8998_platform_data *pd; 154 + 155 + pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); 156 + if (!pd) 157 + return ERR_PTR(-ENOMEM); 158 + 159 + pd->ono = irq_of_parse_and_map(dev->of_node, 1); 160 + 161 + /* 162 + * ToDo: the 'wakeup' member in the platform data is more of a linux 163 + * specfic information. Hence, there is no binding for that yet and 164 + * not parsed here. 165 + */ 166 + return pd; 167 + } 168 + 169 + static inline int max8998_i2c_get_driver_data(struct i2c_client *i2c, 170 + const struct i2c_device_id *id) 171 + { 172 + if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 173 + const struct of_device_id *match; 174 + match = of_match_node(max8998_dt_match, i2c->dev.of_node); 175 + return (int)match->data; 176 + } 177 + 178 + return (int)id->driver_data; 179 + } 180 + 134 181 static int max8998_i2c_probe(struct i2c_client *i2c, 135 182 const struct i2c_device_id *id) 136 183 { ··· 192 139 if (max8998 == NULL) 193 140 return -ENOMEM; 194 141 142 + if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 143 + pdata = max8998_i2c_parse_dt_pdata(&i2c->dev); 144 + if (IS_ERR(pdata)) { 145 + ret = PTR_ERR(pdata); 146 + goto err; 147 + } 148 + } 149 + 195 150 i2c_set_clientdata(i2c, max8998); 196 151 max8998->dev = &i2c->dev; 197 152 max8998->i2c = i2c; 198 153 max8998->irq = i2c->irq; 199 - max8998->type = id->driver_data; 154 + max8998->type = max8998_i2c_get_driver_data(i2c, id); 155 + max8998->pdata = pdata; 200 156 if (pdata) { 201 157 max8998->ono = pdata->ono; 202 158 max8998->irq_base = pdata->irq_base; ··· 220 158 221 159 pm_runtime_set_active(max8998->dev); 222 160 223 - switch (id->driver_data) { 161 + switch (max8998->type) { 224 162 case TYPE_LP3974: 225 163 ret = mfd_add_devices(max8998->dev, -1, 226 164 lp3974_devs, ARRAY_SIZE(lp3974_devs), ··· 376 314 .name = "max8998", 377 315 .owner = THIS_MODULE, 378 316 .pm = &max8998_pm, 317 + .of_match_table = of_match_ptr(max8998_dt_match), 379 318 }, 380 319 .probe = max8998_i2c_probe, 381 320 .remove = max8998_i2c_remove,
-3
drivers/mfd/mcp-sa11x0.c
··· 225 225 if (ret == 0) 226 226 return 0; 227 227 228 - platform_set_drvdata(dev, NULL); 229 - 230 228 err_ioremap: 231 229 iounmap(m->base1); 232 230 iounmap(m->base0); ··· 250 252 mem0 = platform_get_resource(dev, IORESOURCE_MEM, 0); 251 253 mem1 = platform_get_resource(dev, IORESOURCE_MEM, 1); 252 254 253 - platform_set_drvdata(dev, NULL); 254 255 mcp_host_del(mcp); 255 256 iounmap(m->base1); 256 257 iounmap(m->base0);
+32 -114
drivers/mfd/palmas.c
··· 23 23 #include <linux/err.h> 24 24 #include <linux/mfd/core.h> 25 25 #include <linux/mfd/palmas.h> 26 - #include <linux/of_platform.h> 27 - 28 - enum palmas_ids { 29 - PALMAS_PMIC_ID, 30 - PALMAS_GPIO_ID, 31 - PALMAS_LEDS_ID, 32 - PALMAS_WDT_ID, 33 - PALMAS_RTC_ID, 34 - PALMAS_PWRBUTTON_ID, 35 - PALMAS_GPADC_ID, 36 - PALMAS_RESOURCE_ID, 37 - PALMAS_CLK_ID, 38 - PALMAS_PWM_ID, 39 - PALMAS_USB_ID, 40 - }; 41 - 42 - static struct resource palmas_rtc_resources[] = { 43 - { 44 - .start = PALMAS_RTC_ALARM_IRQ, 45 - .end = PALMAS_RTC_ALARM_IRQ, 46 - .flags = IORESOURCE_IRQ, 47 - }, 48 - }; 49 - 50 - static const struct mfd_cell palmas_children[] = { 51 - { 52 - .name = "palmas-pmic", 53 - .id = PALMAS_PMIC_ID, 54 - }, 55 - { 56 - .name = "palmas-gpio", 57 - .id = PALMAS_GPIO_ID, 58 - }, 59 - { 60 - .name = "palmas-leds", 61 - .id = PALMAS_LEDS_ID, 62 - }, 63 - { 64 - .name = "palmas-wdt", 65 - .id = PALMAS_WDT_ID, 66 - }, 67 - { 68 - .name = "palmas-rtc", 69 - .id = PALMAS_RTC_ID, 70 - .resources = &palmas_rtc_resources[0], 71 - .num_resources = ARRAY_SIZE(palmas_rtc_resources), 72 - }, 73 - { 74 - .name = "palmas-pwrbutton", 75 - .id = PALMAS_PWRBUTTON_ID, 76 - }, 77 - { 78 - .name = "palmas-gpadc", 79 - .id = PALMAS_GPADC_ID, 80 - }, 81 - { 82 - .name = "palmas-resource", 83 - .id = PALMAS_RESOURCE_ID, 84 - }, 85 - { 86 - .name = "palmas-clk", 87 - .id = PALMAS_CLK_ID, 88 - }, 89 - { 90 - .name = "palmas-pwm", 91 - .id = PALMAS_PWM_ID, 92 - }, 93 - { 94 - .name = "palmas-usb", 95 - .id = PALMAS_USB_ID, 96 - } 97 - }; 26 + #include <linux/of_device.h> 98 27 99 28 static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = { 100 29 { ··· 231 302 palmas_set_pdata_irq_flag(i2c, pdata); 232 303 } 233 304 305 + static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; 306 + static unsigned int tps659038_features; 307 + 308 + static const struct of_device_id of_palmas_match_tbl[] = { 309 + { 310 + .compatible = "ti,palmas", 311 + .data = &palmas_features, 312 + }, 313 + { 314 + .compatible = "ti,tps659038", 315 + .data = &tps659038_features, 316 + }, 317 + { }, 318 + }; 319 + 234 320 static int palmas_i2c_probe(struct i2c_client *i2c, 235 321 const struct i2c_device_id *id) 236 322 { ··· 253 309 struct palmas_platform_data *pdata; 254 310 struct device_node *node = i2c->dev.of_node; 255 311 int ret = 0, i; 256 - unsigned int reg, addr; 312 + unsigned int reg, addr, *features; 257 313 int slave; 258 - struct mfd_cell *children; 314 + const struct of_device_id *match; 259 315 260 316 pdata = dev_get_platdata(&i2c->dev); 261 317 ··· 277 333 278 334 i2c_set_clientdata(i2c, palmas); 279 335 palmas->dev = &i2c->dev; 280 - palmas->id = id->driver_data; 281 336 palmas->irq = i2c->irq; 337 + 338 + match = of_match_device(of_match_ptr(of_palmas_match_tbl), &i2c->dev); 339 + 340 + if (!match) 341 + return -ENODATA; 342 + 343 + features = (unsigned int *)match->data; 344 + palmas->features = *features; 282 345 283 346 for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { 284 347 if (i == 0) ··· 311 360 i, ret); 312 361 goto err; 313 362 } 363 + } 364 + 365 + if (!palmas->irq) { 366 + dev_warn(palmas->dev, "IRQ missing: skipping irq request\n"); 367 + goto no_irq; 314 368 } 315 369 316 370 /* Change interrupt line output polarity */ ··· 344 388 if (ret < 0) 345 389 goto err; 346 390 391 + no_irq: 347 392 slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); 348 393 addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE, 349 394 PALMAS_PRIMARY_SECONDARY_PAD1); ··· 429 472 return ret; 430 473 } 431 474 432 - children = kmemdup(palmas_children, sizeof(palmas_children), 433 - GFP_KERNEL); 434 - if (!children) { 435 - ret = -ENOMEM; 436 - goto err_irq; 437 - } 438 - 439 - children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata; 440 - children[PALMAS_PMIC_ID].pdata_size = sizeof(*pdata->pmic_pdata); 441 - 442 - children[PALMAS_GPADC_ID].platform_data = pdata->gpadc_pdata; 443 - children[PALMAS_GPADC_ID].pdata_size = sizeof(*pdata->gpadc_pdata); 444 - 445 - children[PALMAS_RESOURCE_ID].platform_data = pdata->resource_pdata; 446 - children[PALMAS_RESOURCE_ID].pdata_size = 447 - sizeof(*pdata->resource_pdata); 448 - 449 - children[PALMAS_USB_ID].platform_data = pdata->usb_pdata; 450 - children[PALMAS_USB_ID].pdata_size = sizeof(*pdata->usb_pdata); 451 - 452 - children[PALMAS_CLK_ID].platform_data = pdata->clk_pdata; 453 - children[PALMAS_CLK_ID].pdata_size = sizeof(*pdata->clk_pdata); 454 - 455 - ret = mfd_add_devices(palmas->dev, -1, 456 - children, ARRAY_SIZE(palmas_children), 457 - NULL, 0, 458 - regmap_irq_get_domain(palmas->irq_data)); 459 - kfree(children); 460 - 461 - if (ret < 0) 462 - goto err_devices; 463 - 464 475 return ret; 465 476 466 - err_devices: 467 - mfd_remove_devices(palmas->dev); 468 477 err_irq: 469 478 regmap_del_irq_chip(palmas->irq, palmas->irq_data); 470 479 err: ··· 455 532 { /* end */ } 456 533 }; 457 534 MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); 458 - 459 - static struct of_device_id of_palmas_match_tbl[] = { 460 - { .compatible = "ti,palmas", }, 461 - { /* end */ } 462 - }; 463 535 464 536 static struct i2c_driver palmas_i2c_driver = { 465 537 .driver = {
+132
drivers/mfd/rtl8411.c
··· 35 35 return val & 0x0F; 36 36 } 37 37 38 + static int rtl8411b_is_qfn48(struct rtsx_pcr *pcr) 39 + { 40 + u8 val = 0; 41 + 42 + rtsx_pci_read_register(pcr, RTL8411B_PACKAGE_MODE, &val); 43 + 44 + if (val & 0x2) 45 + return 1; 46 + else 47 + return 0; 48 + } 49 + 38 50 static int rtl8411_extra_init_hw(struct rtsx_pcr *pcr) 39 51 { 52 + return rtsx_pci_write_register(pcr, CD_PAD_CTL, 53 + CD_DISABLE_MASK | CD_AUTO_DISABLE, CD_ENABLE); 54 + } 55 + 56 + static int rtl8411b_extra_init_hw(struct rtsx_pcr *pcr) 57 + { 58 + if (rtl8411b_is_qfn48(pcr)) 59 + rtsx_pci_write_register(pcr, CARD_PULL_CTL3, 0xFF, 0xF5); 60 + 40 61 return rtsx_pci_write_register(pcr, CD_PAD_CTL, 41 62 CD_DISABLE_MASK | CD_AUTO_DISABLE, CD_ENABLE); 42 63 } ··· 235 214 .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n, 236 215 }; 237 216 217 + static const struct pcr_ops rtl8411b_pcr_ops = { 218 + .extra_init_hw = rtl8411b_extra_init_hw, 219 + .optimize_phy = NULL, 220 + .turn_on_led = rtl8411_turn_on_led, 221 + .turn_off_led = rtl8411_turn_off_led, 222 + .enable_auto_blink = rtl8411_enable_auto_blink, 223 + .disable_auto_blink = rtl8411_disable_auto_blink, 224 + .card_power_on = rtl8411_card_power_on, 225 + .card_power_off = rtl8411_card_power_off, 226 + .switch_output_voltage = rtl8411_switch_output_voltage, 227 + .cd_deglitch = rtl8411_cd_deglitch, 228 + .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n, 229 + }; 230 + 238 231 /* SD Pull Control Enable: 239 232 * SD_DAT[3:0] ==> pull up 240 233 * SD_CD ==> pull up ··· 311 276 0, 312 277 }; 313 278 279 + static const u32 rtl8411b_qfn64_sd_pull_ctl_enable_tbl[] = { 280 + RTSX_REG_PAIR(CARD_PULL_CTL1, 0xAA), 281 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0xAA), 282 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x09 | 0xD0), 283 + RTSX_REG_PAIR(CARD_PULL_CTL4, 0x09 | 0x50), 284 + RTSX_REG_PAIR(CARD_PULL_CTL5, 0x05 | 0x50), 285 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 286 + 0, 287 + }; 288 + 289 + static const u32 rtl8411b_qfn48_sd_pull_ctl_enable_tbl[] = { 290 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0xAA), 291 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x69 | 0x90), 292 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x08 | 0x11), 293 + 0, 294 + }; 295 + 296 + static const u32 rtl8411b_qfn64_sd_pull_ctl_disable_tbl[] = { 297 + RTSX_REG_PAIR(CARD_PULL_CTL1, 0x65), 298 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 299 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x05 | 0xD0), 300 + RTSX_REG_PAIR(CARD_PULL_CTL4, 0x09 | 0x50), 301 + RTSX_REG_PAIR(CARD_PULL_CTL5, 0x05 | 0x50), 302 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 303 + 0, 304 + }; 305 + 306 + static const u32 rtl8411b_qfn48_sd_pull_ctl_disable_tbl[] = { 307 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 308 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x65 | 0x90), 309 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 310 + 0, 311 + }; 312 + 313 + static const u32 rtl8411b_qfn64_ms_pull_ctl_enable_tbl[] = { 314 + RTSX_REG_PAIR(CARD_PULL_CTL1, 0x65), 315 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 316 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x05 | 0xD0), 317 + RTSX_REG_PAIR(CARD_PULL_CTL4, 0x05 | 0x50), 318 + RTSX_REG_PAIR(CARD_PULL_CTL5, 0x05 | 0x50), 319 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 320 + 0, 321 + }; 322 + 323 + static const u32 rtl8411b_qfn48_ms_pull_ctl_enable_tbl[] = { 324 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 325 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x65 | 0x90), 326 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 327 + 0, 328 + }; 329 + 330 + static const u32 rtl8411b_qfn64_ms_pull_ctl_disable_tbl[] = { 331 + RTSX_REG_PAIR(CARD_PULL_CTL1, 0x65), 332 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 333 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x05 | 0xD0), 334 + RTSX_REG_PAIR(CARD_PULL_CTL4, 0x09 | 0x50), 335 + RTSX_REG_PAIR(CARD_PULL_CTL5, 0x05 | 0x50), 336 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 337 + 0, 338 + }; 339 + 340 + static const u32 rtl8411b_qfn48_ms_pull_ctl_disable_tbl[] = { 341 + RTSX_REG_PAIR(CARD_PULL_CTL2, 0x55), 342 + RTSX_REG_PAIR(CARD_PULL_CTL3, 0x65 | 0x90), 343 + RTSX_REG_PAIR(CARD_PULL_CTL6, 0x04 | 0x11), 344 + 0, 345 + }; 346 + 314 347 void rtl8411_init_params(struct rtsx_pcr *pcr) 315 348 { 316 349 pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104; ··· 390 287 pcr->sd_pull_ctl_disable_tbl = rtl8411_sd_pull_ctl_disable_tbl; 391 288 pcr->ms_pull_ctl_enable_tbl = rtl8411_ms_pull_ctl_enable_tbl; 392 289 pcr->ms_pull_ctl_disable_tbl = rtl8411_ms_pull_ctl_disable_tbl; 290 + } 291 + 292 + void rtl8411b_init_params(struct rtsx_pcr *pcr) 293 + { 294 + pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104; 295 + pcr->num_slots = 2; 296 + pcr->ops = &rtl8411b_pcr_ops; 297 + 298 + pcr->ic_version = rtl8411_get_ic_version(pcr); 299 + 300 + if (rtl8411b_is_qfn48(pcr)) { 301 + pcr->sd_pull_ctl_enable_tbl = 302 + rtl8411b_qfn48_sd_pull_ctl_enable_tbl; 303 + pcr->sd_pull_ctl_disable_tbl = 304 + rtl8411b_qfn48_sd_pull_ctl_disable_tbl; 305 + pcr->ms_pull_ctl_enable_tbl = 306 + rtl8411b_qfn48_ms_pull_ctl_enable_tbl; 307 + pcr->ms_pull_ctl_disable_tbl = 308 + rtl8411b_qfn48_ms_pull_ctl_disable_tbl; 309 + } else { 310 + pcr->sd_pull_ctl_enable_tbl = 311 + rtl8411b_qfn64_sd_pull_ctl_enable_tbl; 312 + pcr->sd_pull_ctl_disable_tbl = 313 + rtl8411b_qfn64_sd_pull_ctl_disable_tbl; 314 + pcr->ms_pull_ctl_enable_tbl = 315 + rtl8411b_qfn64_ms_pull_ctl_enable_tbl; 316 + pcr->ms_pull_ctl_disable_tbl = 317 + rtl8411b_qfn64_ms_pull_ctl_disable_tbl; 318 + } 393 319 }
+5
drivers/mfd/rtsx_pcr.c
··· 57 57 { PCI_DEVICE(0x10EC, 0x5289), PCI_CLASS_OTHERS << 16, 0xFF0000 }, 58 58 { PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 }, 59 59 { PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 }, 60 + { PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 }, 60 61 { 0, } 61 62 }; 62 63 ··· 1038 1037 1039 1038 case 0x5249: 1040 1039 rts5249_init_params(pcr); 1040 + break; 1041 + 1042 + case 0x5287: 1043 + rtl8411b_init_params(pcr); 1041 1044 break; 1042 1045 } 1043 1046
+1
drivers/mfd/rtsx_pcr.h
··· 33 33 void rtl8411_init_params(struct rtsx_pcr *pcr); 34 34 void rts5227_init_params(struct rtsx_pcr *pcr); 35 35 void rts5249_init_params(struct rtsx_pcr *pcr); 36 + void rtl8411b_init_params(struct rtsx_pcr *pcr); 36 37 37 38 #endif
+41 -3
drivers/mfd/sec-core.c
··· 25 25 #include <linux/mfd/samsung/core.h> 26 26 #include <linux/mfd/samsung/irq.h> 27 27 #include <linux/mfd/samsung/rtc.h> 28 + #include <linux/mfd/samsung/s2mps11.h> 29 + #include <linux/mfd/samsung/s5m8763.h> 30 + #include <linux/mfd/samsung/s5m8767.h> 28 31 #include <linux/regmap.h> 29 32 30 33 static struct mfd_cell s5m8751_devs[] = { ··· 108 105 .val_bits = 8, 109 106 }; 110 107 108 + static struct regmap_config s2mps11_regmap_config = { 109 + .reg_bits = 8, 110 + .val_bits = 8, 111 + 112 + .max_register = S2MPS11_REG_L38CTRL, 113 + }; 114 + 115 + static struct regmap_config s5m8763_regmap_config = { 116 + .reg_bits = 8, 117 + .val_bits = 8, 118 + 119 + .max_register = S5M8763_REG_LBCNFG2, 120 + }; 121 + 122 + static struct regmap_config s5m8767_regmap_config = { 123 + .reg_bits = 8, 124 + .val_bits = 8, 125 + 126 + .max_register = S5M8767_REG_LDO28CTRL, 127 + }; 111 128 112 129 #ifdef CONFIG_OF 113 130 /* ··· 183 160 const struct i2c_device_id *id) 184 161 { 185 162 struct sec_platform_data *pdata = i2c->dev.platform_data; 163 + const struct regmap_config *regmap; 186 164 struct sec_pmic_dev *sec_pmic; 187 165 int ret; 188 166 ··· 214 190 sec_pmic->pdata = pdata; 215 191 } 216 192 217 - sec_pmic->regmap = devm_regmap_init_i2c(i2c, &sec_regmap_config); 193 + switch (sec_pmic->device_type) { 194 + case S2MPS11X: 195 + regmap = &s2mps11_regmap_config; 196 + break; 197 + case S5M8763X: 198 + regmap = &s5m8763_regmap_config; 199 + break; 200 + case S5M8767X: 201 + regmap = &s5m8767_regmap_config; 202 + break; 203 + default: 204 + regmap = &sec_regmap_config; 205 + break; 206 + } 207 + 208 + sec_pmic->regmap = devm_regmap_init_i2c(i2c, regmap); 218 209 if (IS_ERR(sec_pmic->regmap)) { 219 210 ret = PTR_ERR(sec_pmic->regmap); 220 211 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", ··· 269 230 BUG(); 270 231 } 271 232 272 - if (ret < 0) 233 + if (ret) 273 234 goto err; 274 235 275 236 return ret; 276 237 277 238 err: 278 - mfd_remove_devices(sec_pmic->dev); 279 239 sec_irq_exit(sec_pmic); 280 240 i2c_unregister_device(sec_pmic->rtc); 281 241 return ret;
-1
drivers/mfd/t7l66xb.c
··· 422 422 iounmap(t7l66xb->scr); 423 423 release_resource(&t7l66xb->rscr); 424 424 mfd_remove_devices(&dev->dev); 425 - platform_set_drvdata(dev, NULL); 426 425 kfree(t7l66xb); 427 426 428 427 return ret;
-1
drivers/mfd/tc6387xb.c
··· 217 217 release_resource(&tc6387xb->rscr); 218 218 clk_disable(tc6387xb->clk32k); 219 219 clk_put(tc6387xb->clk32k); 220 - platform_set_drvdata(dev, NULL); 221 220 kfree(tc6387xb); 222 221 223 222 return 0;
-1
drivers/mfd/tc6393xb.c
··· 756 756 clk_disable(tc6393xb->clk); 757 757 iounmap(tc6393xb->scr); 758 758 release_resource(&tc6393xb->rscr); 759 - platform_set_drvdata(dev, NULL); 760 759 clk_put(tc6393xb->clk); 761 760 kfree(tc6393xb); 762 761
+88 -22
drivers/mfd/ti_am335x_tscadc.c
··· 22 22 #include <linux/regmap.h> 23 23 #include <linux/mfd/core.h> 24 24 #include <linux/pm_runtime.h> 25 + #include <linux/of.h> 26 + #include <linux/of_device.h> 25 27 26 28 #include <linux/mfd/ti_am335x_tscadc.h> 27 - #include <linux/input/ti_am335x_tsc.h> 28 - #include <linux/platform_data/ti_am335x_adc.h> 29 29 30 30 static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg) 31 31 { ··· 48 48 .val_bits = 32, 49 49 }; 50 50 51 + void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc) 52 + { 53 + tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache); 54 + } 55 + EXPORT_SYMBOL_GPL(am335x_tsc_se_update); 56 + 57 + void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val) 58 + { 59 + spin_lock(&tsadc->reg_lock); 60 + tsadc->reg_se_cache |= val; 61 + spin_unlock(&tsadc->reg_lock); 62 + 63 + am335x_tsc_se_update(tsadc); 64 + } 65 + EXPORT_SYMBOL_GPL(am335x_tsc_se_set); 66 + 67 + void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val) 68 + { 69 + spin_lock(&tsadc->reg_lock); 70 + tsadc->reg_se_cache &= ~val; 71 + spin_unlock(&tsadc->reg_lock); 72 + 73 + am335x_tsc_se_update(tsadc); 74 + } 75 + EXPORT_SYMBOL_GPL(am335x_tsc_se_clr); 76 + 51 77 static void tscadc_idle_config(struct ti_tscadc_dev *config) 52 78 { 53 79 unsigned int idleconfig; ··· 89 63 struct ti_tscadc_dev *tscadc; 90 64 struct resource *res; 91 65 struct clk *clk; 92 - struct mfd_tscadc_board *pdata = pdev->dev.platform_data; 66 + struct device_node *node = pdev->dev.of_node; 93 67 struct mfd_cell *cell; 68 + struct property *prop; 69 + const __be32 *cur; 70 + u32 val; 94 71 int err, ctrl; 95 72 int clk_value, clock_rate; 96 - int tsc_wires, adc_channels = 0, total_channels; 73 + int tsc_wires = 0, adc_channels = 0, total_channels; 74 + int readouts = 0; 97 75 98 - if (!pdata) { 99 - dev_err(&pdev->dev, "Could not find platform data\n"); 76 + if (!pdev->dev.of_node) { 77 + dev_err(&pdev->dev, "Could not find valid DT data.\n"); 100 78 return -EINVAL; 101 79 } 102 80 103 - if (pdata->adc_init) 104 - adc_channels = pdata->adc_init->adc_channels; 81 + node = of_get_child_by_name(pdev->dev.of_node, "tsc"); 82 + of_property_read_u32(node, "ti,wires", &tsc_wires); 83 + of_property_read_u32(node, "ti,coordiante-readouts", &readouts); 105 84 106 - tsc_wires = pdata->tsc_init->wires; 85 + node = of_get_child_by_name(pdev->dev.of_node, "adc"); 86 + of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) { 87 + adc_channels++; 88 + if (val > 7) { 89 + dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n", 90 + val); 91 + return -EINVAL; 92 + } 93 + } 107 94 total_channels = tsc_wires + adc_channels; 108 - 109 95 if (total_channels > 8) { 110 96 dev_err(&pdev->dev, "Number of i/p channels more than 8\n"); 97 + return -EINVAL; 98 + } 99 + if (total_channels == 0) { 100 + dev_err(&pdev->dev, "Need atleast one channel.\n"); 101 + return -EINVAL; 102 + } 103 + 104 + if (readouts * 2 + 2 + adc_channels > 16) { 105 + dev_err(&pdev->dev, "Too many step configurations requested\n"); 111 106 return -EINVAL; 112 107 } 113 108 ··· 176 129 goto ret; 177 130 } 178 131 132 + spin_lock_init(&tscadc->reg_lock); 179 133 pm_runtime_enable(&pdev->dev); 180 134 pm_runtime_get_sync(&pdev->dev); 181 135 ··· 221 173 ctrl |= CNTRLREG_TSCSSENB; 222 174 tscadc_writel(tscadc, REG_CTRL, ctrl); 223 175 176 + tscadc->used_cells = 0; 177 + tscadc->tsc_cell = -1; 178 + tscadc->adc_cell = -1; 179 + 224 180 /* TSC Cell */ 225 - cell = &tscadc->cells[TSC_CELL]; 226 - cell->name = "tsc"; 227 - cell->platform_data = tscadc; 228 - cell->pdata_size = sizeof(*tscadc); 181 + if (tsc_wires > 0) { 182 + tscadc->tsc_cell = tscadc->used_cells; 183 + cell = &tscadc->cells[tscadc->used_cells++]; 184 + cell->name = "TI-am335x-tsc"; 185 + cell->of_compatible = "ti,am3359-tsc"; 186 + cell->platform_data = &tscadc; 187 + cell->pdata_size = sizeof(tscadc); 188 + } 229 189 230 190 /* ADC Cell */ 231 - cell = &tscadc->cells[ADC_CELL]; 232 - cell->name = "tiadc"; 233 - cell->platform_data = tscadc; 234 - cell->pdata_size = sizeof(*tscadc); 191 + if (adc_channels > 0) { 192 + tscadc->adc_cell = tscadc->used_cells; 193 + cell = &tscadc->cells[tscadc->used_cells++]; 194 + cell->name = "TI-am335x-adc"; 195 + cell->of_compatible = "ti,am3359-adc"; 196 + cell->platform_data = &tscadc; 197 + cell->pdata_size = sizeof(tscadc); 198 + } 235 199 236 200 err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, 237 - TSCADC_CELLS, NULL, 0, NULL); 201 + tscadc->used_cells, NULL, 0, NULL); 238 202 if (err < 0) 239 203 goto err_disable_clk; 240 204 241 205 device_init_wakeup(&pdev->dev, true); 242 206 platform_set_drvdata(pdev, tscadc); 243 - 244 207 return 0; 245 208 246 209 err_disable_clk: ··· 298 239 CNTRLREG_STEPID | CNTRLREG_4WIRE; 299 240 tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 300 241 tscadc_idle_config(tscadc_dev); 301 - tscadc_writel(tscadc_dev, REG_SE, STPENB_STEPENB); 242 + am335x_tsc_se_update(tscadc_dev); 302 243 restore = tscadc_readl(tscadc_dev, REG_CTRL); 303 244 tscadc_writel(tscadc_dev, REG_CTRL, 304 245 (restore | CNTRLREG_TSCSSENB)); ··· 315 256 #define TSCADC_PM_OPS NULL 316 257 #endif 317 258 259 + static const struct of_device_id ti_tscadc_dt_ids[] = { 260 + { .compatible = "ti,am3359-tscadc", }, 261 + { } 262 + }; 263 + MODULE_DEVICE_TABLE(of, ti_tscadc_dt_ids); 264 + 318 265 static struct platform_driver ti_tscadc_driver = { 319 266 .driver = { 320 - .name = "ti_tscadc", 267 + .name = "ti_am3359-tscadc", 321 268 .owner = THIS_MODULE, 322 269 .pm = TSCADC_PM_OPS, 270 + .of_match_table = of_match_ptr(ti_tscadc_dt_ids), 323 271 }, 324 272 .probe = ti_tscadc_probe, 325 273 .remove = ti_tscadc_remove,
-2
drivers/mfd/tps65912-core.c
··· 162 162 err: 163 163 kfree(init_data); 164 164 mfd_remove_devices(tps65912->dev); 165 - kfree(tps65912); 166 165 return ret; 167 166 } 168 167 ··· 169 170 { 170 171 mfd_remove_devices(tps65912->dev); 171 172 tps65912_irq_exit(tps65912); 172 - kfree(tps65912); 173 173 } 174 174 175 175 MODULE_AUTHOR("Margarita Olaya <magi@slimlogic.co.uk>");
+2 -1
drivers/mfd/tps65912-i2c.c
··· 77 77 { 78 78 struct tps65912 *tps65912; 79 79 80 - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); 80 + tps65912 = devm_kzalloc(&i2c->dev, 81 + sizeof(struct tps65912), GFP_KERNEL); 81 82 if (tps65912 == NULL) 82 83 return -ENOMEM; 83 84
+2 -1
drivers/mfd/tps65912-spi.c
··· 85 85 { 86 86 struct tps65912 *tps65912; 87 87 88 - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); 88 + tps65912 = devm_kzalloc(&spi->dev, 89 + sizeof(struct tps65912), GFP_KERNEL); 89 90 if (tps65912 == NULL) 90 91 return -ENOMEM; 91 92
+32 -38
drivers/mfd/twl-core.c
··· 118 118 #define TWL6030_BASEADD_GASGAUGE 0x00C0 119 119 #define TWL6030_BASEADD_PIH 0x00D0 120 120 #define TWL6030_BASEADD_CHARGER 0x00E0 121 - #define TWL6025_BASEADD_CHARGER 0x00DA 121 + #define TWL6032_BASEADD_CHARGER 0x00DA 122 122 #define TWL6030_BASEADD_LED 0x00F4 123 123 124 124 /* subchip/slave 2 0x4A - DFT */ ··· 718 718 | REGULATOR_CHANGE_STATUS, 719 719 }; 720 720 721 - if (features & TWL6025_SUBCLASS) { 721 + if (features & TWL6032_SUBCLASS) { 722 722 usb3v3.supply = "ldousb"; 723 - regulator = TWL6025_REG_LDOUSB; 723 + regulator = TWL6032_REG_LDOUSB; 724 724 } else { 725 725 usb3v3.supply = "vusb"; 726 726 regulator = TWL6030_REG_VUSB; ··· 747 747 usb3v3.dev_name = dev_name(child); 748 748 } else if (IS_ENABLED(CONFIG_REGULATOR_TWL4030) && 749 749 twl_class_is_6030()) { 750 - if (features & TWL6025_SUBCLASS) 751 - child = add_regulator(TWL6025_REG_LDOUSB, 750 + if (features & TWL6032_SUBCLASS) 751 + child = add_regulator(TWL6032_REG_LDOUSB, 752 752 pdata->ldousb, features); 753 753 else 754 754 child = add_regulator(TWL6030_REG_VUSB, ··· 872 872 873 873 /* twl6030 regulators */ 874 874 if (IS_ENABLED(CONFIG_REGULATOR_TWL4030) && twl_class_is_6030() && 875 - !(features & TWL6025_SUBCLASS)) { 875 + !(features & TWL6032_SUBCLASS)) { 876 876 child = add_regulator(TWL6030_REG_VDD1, pdata->vdd1, 877 877 features); 878 878 if (IS_ERR(child)) ··· 952 952 return PTR_ERR(child); 953 953 } 954 954 955 - /* twl6025 regulators */ 955 + /* twl6032 regulators */ 956 956 if (IS_ENABLED(CONFIG_REGULATOR_TWL4030) && twl_class_is_6030() && 957 - (features & TWL6025_SUBCLASS)) { 958 - child = add_regulator(TWL6025_REG_LDO5, pdata->ldo5, 957 + (features & TWL6032_SUBCLASS)) { 958 + child = add_regulator(TWL6032_REG_LDO5, pdata->ldo5, 959 959 features); 960 960 if (IS_ERR(child)) 961 961 return PTR_ERR(child); 962 962 963 - child = add_regulator(TWL6025_REG_LDO1, pdata->ldo1, 963 + child = add_regulator(TWL6032_REG_LDO1, pdata->ldo1, 964 964 features); 965 965 if (IS_ERR(child)) 966 966 return PTR_ERR(child); 967 967 968 - child = add_regulator(TWL6025_REG_LDO7, pdata->ldo7, 968 + child = add_regulator(TWL6032_REG_LDO7, pdata->ldo7, 969 969 features); 970 970 if (IS_ERR(child)) 971 971 return PTR_ERR(child); 972 972 973 - child = add_regulator(TWL6025_REG_LDO6, pdata->ldo6, 973 + child = add_regulator(TWL6032_REG_LDO6, pdata->ldo6, 974 974 features); 975 975 if (IS_ERR(child)) 976 976 return PTR_ERR(child); 977 977 978 - child = add_regulator(TWL6025_REG_LDOLN, pdata->ldoln, 978 + child = add_regulator(TWL6032_REG_LDOLN, pdata->ldoln, 979 979 features); 980 980 if (IS_ERR(child)) 981 981 return PTR_ERR(child); 982 982 983 - child = add_regulator(TWL6025_REG_LDO2, pdata->ldo2, 983 + child = add_regulator(TWL6032_REG_LDO2, pdata->ldo2, 984 984 features); 985 985 if (IS_ERR(child)) 986 986 return PTR_ERR(child); 987 987 988 - child = add_regulator(TWL6025_REG_LDO4, pdata->ldo4, 988 + child = add_regulator(TWL6032_REG_LDO4, pdata->ldo4, 989 989 features); 990 990 if (IS_ERR(child)) 991 991 return PTR_ERR(child); 992 992 993 - child = add_regulator(TWL6025_REG_LDO3, pdata->ldo3, 993 + child = add_regulator(TWL6032_REG_LDO3, pdata->ldo3, 994 994 features); 995 995 if (IS_ERR(child)) 996 996 return PTR_ERR(child); 997 997 998 - child = add_regulator(TWL6025_REG_SMPS3, pdata->smps3, 998 + child = add_regulator(TWL6032_REG_SMPS3, pdata->smps3, 999 999 features); 1000 1000 if (IS_ERR(child)) 1001 1001 return PTR_ERR(child); 1002 1002 1003 - child = add_regulator(TWL6025_REG_SMPS4, pdata->smps4, 1003 + child = add_regulator(TWL6032_REG_SMPS4, pdata->smps4, 1004 1004 features); 1005 1005 if (IS_ERR(child)) 1006 1006 return PTR_ERR(child); 1007 1007 1008 - child = add_regulator(TWL6025_REG_VIO, pdata->vio6025, 1008 + child = add_regulator(TWL6032_REG_VIO, pdata->vio6025, 1009 1009 features); 1010 1010 if (IS_ERR(child)) 1011 1011 return PTR_ERR(child); ··· 1019 1019 /* irq0 = CHG_PRES, irq1 = BCI */ 1020 1020 irq_base + BCI_PRES_INTR_OFFSET, 1021 1021 irq_base + BCI_INTR_OFFSET); 1022 + if (IS_ERR(child)) 1023 + return PTR_ERR(child); 1024 + } 1025 + 1026 + if (IS_ENABLED(CONFIG_TWL4030_POWER) && pdata->power) { 1027 + child = add_child(TWL_MODULE_PM_MASTER, "twl4030_power", 1028 + pdata->power, sizeof(*pdata->power), false, 1029 + 0, 0); 1022 1030 if (IS_ERR(child)) 1023 1031 return PTR_ERR(child); 1024 1032 } ··· 1184 1176 if ((id->driver_data) & TWL6030_CLASS) { 1185 1177 twl_priv->twl_id = TWL6030_CLASS_ID; 1186 1178 twl_priv->twl_map = &twl6030_map[0]; 1187 - /* The charger base address is different in twl6025 */ 1188 - if ((id->driver_data) & TWL6025_SUBCLASS) 1179 + /* The charger base address is different in twl6032 */ 1180 + if ((id->driver_data) & TWL6032_SUBCLASS) 1189 1181 twl_priv->twl_map[TWL_MODULE_MAIN_CHARGE].base = 1190 - TWL6025_BASEADD_CHARGER; 1182 + TWL6032_BASEADD_CHARGER; 1191 1183 twl_regmap_config = twl6030_regmap_config; 1192 1184 } else { 1193 1185 twl_priv->twl_id = TWL4030_CLASS_ID; ··· 1241 1233 status = twl_read_idcode_register(); 1242 1234 WARN(status < 0, "Error: reading twl_idcode register value\n"); 1243 1235 } 1244 - 1245 - /* load power event scripts */ 1246 - if (IS_ENABLED(CONFIG_TWL4030_POWER) && pdata && pdata->power) 1247 - twl4030_power_init(pdata->power); 1248 1236 1249 1237 /* Maybe init the T2 Interrupt subsystem */ 1250 1238 if (client->irq) { ··· 1296 1292 { "tps65921", TPS_SUBSET }, /* fewer LDOs; no codec, no LED 1297 1293 and vibrator. Charger in USB module*/ 1298 1294 { "twl6030", TWL6030_CLASS }, /* "Phoenix power chip" */ 1299 - { "twl6025", TWL6030_CLASS | TWL6025_SUBCLASS }, /* "Phoenix lite" */ 1295 + { "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */ 1300 1296 { /* end of list */ }, 1301 1297 }; 1302 1298 MODULE_DEVICE_TABLE(i2c, twl_ids); ··· 1309 1305 .remove = twl_remove, 1310 1306 }; 1311 1307 1312 - static int __init twl_init(void) 1313 - { 1314 - return i2c_add_driver(&twl_driver); 1315 - } 1316 - subsys_initcall(twl_init); 1317 - 1318 - static void __exit twl_exit(void) 1319 - { 1320 - i2c_del_driver(&twl_driver); 1321 - } 1322 - module_exit(twl_exit); 1308 + module_i2c_driver(twl_driver); 1323 1309 1324 1310 MODULE_AUTHOR("Texas Instruments, Inc."); 1325 1311 MODULE_DESCRIPTION("I2C Core interface for TWL");
+1 -4
drivers/mfd/twl4030-audio.c
··· 261 261 ret = -ENODEV; 262 262 } 263 263 264 - if (ret) { 265 - platform_set_drvdata(pdev, NULL); 264 + if (ret) 266 265 twl4030_audio_dev = NULL; 267 - } 268 266 269 267 return ret; 270 268 } ··· 270 272 static int twl4030_audio_remove(struct platform_device *pdev) 271 273 { 272 274 mfd_remove_devices(&pdev->dev); 273 - platform_set_drvdata(pdev, NULL); 274 275 twl4030_audio_dev = NULL; 275 276 276 277 return 0;
+1
drivers/mfd/twl4030-irq.c
··· 570 570 .irq_set_type = twl4030_sih_set_type, 571 571 .irq_bus_lock = twl4030_sih_bus_lock, 572 572 .irq_bus_sync_unlock = twl4030_sih_bus_sync_unlock, 573 + .flags = IRQCHIP_SKIP_SET_WAKE, 573 574 }; 574 575 575 576 /*----------------------------------------------------------------------*/
+1 -4
drivers/mfd/twl4030-madc.c
··· 775 775 IRQF_TRIGGER_RISING, "twl4030_madc", madc); 776 776 if (ret) { 777 777 dev_dbg(&pdev->dev, "could not request irq\n"); 778 - goto err_irq; 778 + goto err_i2c; 779 779 } 780 780 twl4030_madc = madc; 781 781 return 0; 782 - err_irq: 783 - platform_set_drvdata(pdev, NULL); 784 782 err_i2c: 785 783 twl4030_madc_set_current_generator(madc, 0, 0); 786 784 err_current_generator: ··· 794 796 struct twl4030_madc_data *madc = platform_get_drvdata(pdev); 795 797 796 798 free_irq(platform_get_irq(pdev, 0), madc); 797 - platform_set_drvdata(pdev, NULL); 798 799 twl4030_madc_set_current_generator(madc, 0, 0); 799 800 twl4030_madc_set_power(madc, 0); 800 801 kfree(madc);
+109 -39
drivers/mfd/twl4030-power.c
··· 28 28 #include <linux/pm.h> 29 29 #include <linux/i2c/twl.h> 30 30 #include <linux/platform_device.h> 31 + #include <linux/of.h> 31 32 32 33 #include <asm/mach-types.h> 33 34 ··· 493 492 return err; 494 493 } 495 494 495 + int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) 496 + { 497 + int err; 498 + int i; 499 + u8 address = twl4030_start_script_address; 500 + 501 + for (i = 0; i < pdata->num; i++) { 502 + err = load_twl4030_script(pdata->scripts[i], address); 503 + if (err) 504 + return err; 505 + address += pdata->scripts[i]->size; 506 + } 507 + 508 + return 0; 509 + } 510 + 511 + int twl4030_power_configure_resources(struct twl4030_power_data *pdata) 512 + { 513 + struct twl4030_resconfig *resconfig = pdata->resource_config; 514 + int err; 515 + 516 + if (resconfig) { 517 + while (resconfig->resource) { 518 + err = twl4030_configure_resource(resconfig); 519 + if (err) 520 + return err; 521 + resconfig++; 522 + } 523 + } 524 + 525 + return 0; 526 + } 527 + 496 528 /* 497 529 * In master mode, start the power off sequence. 498 530 * After a successful execution, TWL shuts down the power to the SoC ··· 541 507 pr_err("TWL4030 Unable to power off\n"); 542 508 } 543 509 544 - void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) 510 + static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata, 511 + struct device_node *node) 545 512 { 513 + if (pdata && pdata->use_poweroff) 514 + return true; 515 + 516 + if (of_property_read_bool(node, "ti,use_poweroff")) 517 + return true; 518 + 519 + return false; 520 + } 521 + 522 + int twl4030_power_probe(struct platform_device *pdev) 523 + { 524 + struct twl4030_power_data *pdata = pdev->dev.platform_data; 525 + struct device_node *node = pdev->dev.of_node; 546 526 int err = 0; 547 - int i; 548 - struct twl4030_resconfig *resconfig; 549 - u8 val, address = twl4030_start_script_address; 527 + int err2 = 0; 528 + u8 val; 529 + 530 + if (!pdata && !node) { 531 + dev_err(&pdev->dev, "Platform data is missing\n"); 532 + return -EINVAL; 533 + } 550 534 551 535 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, 552 536 TWL4030_PM_MASTER_PROTECT_KEY); 553 - if (err) 554 - goto unlock; 555 - 556 - err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2, 537 + err |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 538 + TWL4030_PM_MASTER_KEY_CFG2, 557 539 TWL4030_PM_MASTER_PROTECT_KEY); 558 - if (err) 559 - goto unlock; 560 540 561 - for (i = 0; i < twl4030_scripts->num; i++) { 562 - err = load_twl4030_script(twl4030_scripts->scripts[i], address); 563 - if (err) 564 - goto load; 565 - address += twl4030_scripts->scripts[i]->size; 541 + if (err) { 542 + pr_err("TWL4030 Unable to unlock registers\n"); 543 + return err; 566 544 } 567 545 568 - resconfig = twl4030_scripts->resource_config; 569 - if (resconfig) { 570 - while (resconfig->resource) { 571 - err = twl4030_configure_resource(resconfig); 572 - if (err) 573 - goto resource; 574 - resconfig++; 575 - 546 + if (pdata) { 547 + /* TODO: convert to device tree */ 548 + err = twl4030_power_configure_scripts(pdata); 549 + if (err) { 550 + pr_err("TWL4030 failed to load scripts\n"); 551 + goto relock; 552 + } 553 + err = twl4030_power_configure_resources(pdata); 554 + if (err) { 555 + pr_err("TWL4030 failed to configure resource\n"); 556 + goto relock; 576 557 } 577 558 } 578 559 579 560 /* Board has to be wired properly to use this feature */ 580 - if (twl4030_scripts->use_poweroff && !pm_power_off) { 561 + if (twl4030_power_use_poweroff(pdata, node) && !pm_power_off) { 581 562 /* Default for SEQ_OFFSYNC is set, lets ensure this */ 582 563 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val, 583 564 TWL4030_PM_MASTER_CFG_P123_TRANSITION); ··· 613 564 } 614 565 615 566 relock: 616 - err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0, 567 + err2 = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0, 617 568 TWL4030_PM_MASTER_PROTECT_KEY); 618 - if (err) 569 + if (err2) { 619 570 pr_err("TWL4030 Unable to relock registers\n"); 620 - return; 571 + return err2; 572 + } 621 573 622 - unlock: 623 - if (err) 624 - pr_err("TWL4030 Unable to unlock registers\n"); 625 - return; 626 - load: 627 - if (err) 628 - pr_err("TWL4030 failed to load scripts\n"); 629 - return; 630 - resource: 631 - if (err) 632 - pr_err("TWL4030 failed to configure resource\n"); 633 - return; 574 + return err; 634 575 } 576 + 577 + static int twl4030_power_remove(struct platform_device *pdev) 578 + { 579 + return 0; 580 + } 581 + 582 + #ifdef CONFIG_OF 583 + static const struct of_device_id twl4030_power_of_match[] = { 584 + {.compatible = "ti,twl4030-power", }, 585 + { }, 586 + }; 587 + MODULE_DEVICE_TABLE(of, twl4030_power_of_match); 588 + #endif 589 + 590 + static struct platform_driver twl4030_power_driver = { 591 + .driver = { 592 + .name = "twl4030_power", 593 + .owner = THIS_MODULE, 594 + .of_match_table = of_match_ptr(twl4030_power_of_match), 595 + }, 596 + .probe = twl4030_power_probe, 597 + .remove = twl4030_power_remove, 598 + }; 599 + 600 + module_platform_driver(twl4030_power_driver); 601 + 602 + MODULE_AUTHOR("Nokia Corporation"); 603 + MODULE_AUTHOR("Texas Instruments, Inc."); 604 + MODULE_DESCRIPTION("Power management for TWL4030"); 605 + MODULE_LICENSE("GPL"); 606 + MODULE_ALIAS("platform:twl4030_power");
+8 -2
drivers/mfd/vexpress-sysreg.c
··· 351 351 } 352 352 353 353 354 + #ifdef CONFIG_GPIOLIB 355 + 354 356 #define VEXPRESS_SYSREG_GPIO(_name, _reg, _value) \ 355 357 [VEXPRESS_GPIO_##_name] = { \ 356 358 .reg = _reg, \ ··· 447 445 .leds = vexpress_sysreg_leds, 448 446 }; 449 447 448 + #endif 449 + 450 450 451 451 static ssize_t vexpress_sysreg_sys_id_show(struct device *dev, 452 452 struct device_attribute *attr, char *buf) ··· 484 480 setup_timer(&vexpress_sysreg_config_timer, 485 481 vexpress_sysreg_config_complete, 0); 486 482 483 + vexpress_sysreg_dev = &pdev->dev; 484 + 485 + #ifdef CONFIG_GPIOLIB 487 486 vexpress_sysreg_gpio_chip.dev = &pdev->dev; 488 487 err = gpiochip_add(&vexpress_sysreg_gpio_chip); 489 488 if (err) { ··· 497 490 return err; 498 491 } 499 492 500 - vexpress_sysreg_dev = &pdev->dev; 501 - 502 493 platform_device_register_data(vexpress_sysreg_dev, "leds-gpio", 503 494 PLATFORM_DEVID_AUTO, &vexpress_sysreg_leds_pdata, 504 495 sizeof(vexpress_sysreg_leds_pdata)); 496 + #endif 505 497 506 498 device_create_file(vexpress_sysreg_dev, &dev_attr_sys_id); 507 499
+11 -14
drivers/mfd/wm8994-core.c
··· 259 259 break; 260 260 } 261 261 262 - switch (wm8994->type) { 263 - case WM1811: 264 - ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2); 265 - if (ret < 0) { 266 - dev_err(dev, "Failed to read jackdet: %d\n", ret); 267 - } else if (ret & WM1811_JACKDET_MODE_MASK) { 268 - dev_dbg(dev, "CODEC still active, ignoring suspend\n"); 269 - return 0; 270 - } 271 - break; 272 - default: 273 - break; 274 - } 275 - 276 262 /* Disable LDO pulldowns while the device is suspended if we 277 263 * don't know that something will be driving them. */ 278 264 if (!wm8994->ldo_ena_always_driven) ··· 635 649 if (ret != 0) { 636 650 dev_err(wm8994->dev, "Failed to reinit register cache: %d\n", 637 651 ret); 652 + return ret; 653 + } 654 + 655 + /* Explicitly put the device into reset in case regulators 656 + * don't get disabled in order to ensure we know the device 657 + * state. 658 + */ 659 + ret = wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET, 660 + wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET)); 661 + if (ret != 0) { 662 + dev_err(wm8994->dev, "Failed to reset device: %d\n", ret); 638 663 return ret; 639 664 } 640 665
+96 -4
drivers/mfd/wm8994-irq.c
··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/module.h> 17 + #include <linux/gpio.h> 17 18 #include <linux/i2c.h> 18 19 #include <linux/irq.h> 19 20 #include <linux/mfd/core.h> 20 21 #include <linux/interrupt.h> 22 + #include <linux/irqdomain.h> 21 23 #include <linux/regmap.h> 22 24 23 25 #include <linux/mfd/wm8994/core.h> ··· 140 138 .runtime_pm = true, 141 139 }; 142 140 141 + static void wm8994_edge_irq_enable(struct irq_data *data) 142 + { 143 + } 144 + 145 + static void wm8994_edge_irq_disable(struct irq_data *data) 146 + { 147 + } 148 + 149 + static struct irq_chip wm8994_edge_irq_chip = { 150 + .name = "wm8994_edge", 151 + .irq_disable = wm8994_edge_irq_disable, 152 + .irq_enable = wm8994_edge_irq_enable, 153 + }; 154 + 155 + static irqreturn_t wm8994_edge_irq(int irq, void *data) 156 + { 157 + struct wm8994 *wm8994 = data; 158 + 159 + while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio)) 160 + handle_nested_irq(irq_create_mapping(wm8994->edge_irq, 0)); 161 + 162 + return IRQ_HANDLED; 163 + } 164 + 165 + static int wm8994_edge_irq_map(struct irq_domain *h, unsigned int virq, 166 + irq_hw_number_t hw) 167 + { 168 + struct wm8994 *wm8994 = h->host_data; 169 + 170 + irq_set_chip_data(virq, wm8994); 171 + irq_set_chip_and_handler(virq, &wm8994_edge_irq_chip, handle_edge_irq); 172 + irq_set_nested_thread(virq, 1); 173 + 174 + /* ARM needs us to explicitly flag the IRQ as valid 175 + * and will set them noprobe when we do so. */ 176 + #ifdef CONFIG_ARM 177 + set_irq_flags(virq, IRQF_VALID); 178 + #else 179 + irq_set_noprobe(virq); 180 + #endif 181 + 182 + return 0; 183 + } 184 + 185 + static struct irq_domain_ops wm8994_edge_irq_ops = { 186 + .map = wm8994_edge_irq_map, 187 + .xlate = irq_domain_xlate_twocell, 188 + }; 189 + 143 190 int wm8994_irq_init(struct wm8994 *wm8994) 144 191 { 145 192 int ret; ··· 207 156 if (pdata->irq_flags) 208 157 irqflags = pdata->irq_flags; 209 158 210 - ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq, 211 - irqflags, 212 - wm8994->irq_base, &wm8994_irq_chip, 213 - &wm8994->irq_data); 159 + /* use a GPIO for edge triggered controllers */ 160 + if (irqflags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 161 + if (gpio_to_irq(pdata->irq_gpio) != wm8994->irq) { 162 + dev_warn(wm8994->dev, "IRQ %d is not GPIO %d (%d)\n", 163 + wm8994->irq, pdata->irq_gpio, 164 + gpio_to_irq(pdata->irq_gpio)); 165 + wm8994->irq = gpio_to_irq(pdata->irq_gpio); 166 + } 167 + 168 + ret = devm_gpio_request_one(wm8994->dev, pdata->irq_gpio, 169 + GPIOF_IN, "WM8994 IRQ"); 170 + 171 + if (ret != 0) { 172 + dev_err(wm8994->dev, "Failed to get IRQ GPIO: %d\n", 173 + ret); 174 + return ret; 175 + } 176 + 177 + wm8994->edge_irq = irq_domain_add_linear(NULL, 1, 178 + &wm8994_edge_irq_ops, 179 + wm8994); 180 + 181 + ret = regmap_add_irq_chip(wm8994->regmap, 182 + irq_create_mapping(wm8994->edge_irq, 183 + 0), 184 + IRQF_ONESHOT, 185 + wm8994->irq_base, &wm8994_irq_chip, 186 + &wm8994->irq_data); 187 + if (ret != 0) { 188 + dev_err(wm8994->dev, "Failed to get IRQ: %d\n", 189 + ret); 190 + return ret; 191 + } 192 + 193 + ret = request_threaded_irq(wm8994->irq, 194 + NULL, wm8994_edge_irq, 195 + irqflags, 196 + "WM8994 edge", wm8994); 197 + } else { 198 + ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq, 199 + irqflags, 200 + wm8994->irq_base, &wm8994_irq_chip, 201 + &wm8994->irq_data); 202 + } 203 + 214 204 if (ret != 0) { 215 205 dev_err(wm8994->dev, "Failed to register IRQ chip: %d\n", ret); 216 206 return ret;
+1525
drivers/mfd/wm8997-tables.c
··· 1 + /* 2 + * wm8997-tables.c -- WM8997 data tables 3 + * 4 + * Copyright 2012 Wolfson Microelectronics plc 5 + * 6 + * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/module.h> 14 + 15 + #include <linux/mfd/arizona/core.h> 16 + #include <linux/mfd/arizona/registers.h> 17 + 18 + #include "arizona.h" 19 + 20 + static const struct reg_default wm8997_reva_patch[] = { 21 + { 0x80, 0x0003 }, 22 + { 0x214, 0x0008 }, 23 + { 0x458, 0x0000 }, 24 + { 0x0081, 0xE022 }, 25 + { 0x294, 0x0000 }, 26 + { 0x80, 0x0000 }, 27 + { 0x171, 0x0000 }, 28 + }; 29 + 30 + /* We use a function so we can use ARRAY_SIZE() */ 31 + int wm8997_patch(struct arizona *arizona) 32 + { 33 + switch (arizona->rev) { 34 + case 0: 35 + return regmap_register_patch(arizona->regmap, 36 + wm8997_reva_patch, 37 + ARRAY_SIZE(wm8997_reva_patch)); 38 + default: 39 + return 0; 40 + } 41 + } 42 + EXPORT_SYMBOL_GPL(wm8997_patch); 43 + 44 + static const struct regmap_irq wm8997_aod_irqs[ARIZONA_NUM_IRQ] = { 45 + [ARIZONA_IRQ_GP5_FALL] = { .mask = ARIZONA_GP5_FALL_EINT1 }, 46 + [ARIZONA_IRQ_GP5_RISE] = { .mask = ARIZONA_GP5_RISE_EINT1 }, 47 + [ARIZONA_IRQ_JD_FALL] = { .mask = ARIZONA_JD1_FALL_EINT1 }, 48 + [ARIZONA_IRQ_JD_RISE] = { .mask = ARIZONA_JD1_RISE_EINT1 }, 49 + }; 50 + 51 + const struct regmap_irq_chip wm8997_aod = { 52 + .name = "wm8997 AOD", 53 + .status_base = ARIZONA_AOD_IRQ1, 54 + .mask_base = ARIZONA_AOD_IRQ_MASK_IRQ1, 55 + .ack_base = ARIZONA_AOD_IRQ1, 56 + .num_regs = 1, 57 + .irqs = wm8997_aod_irqs, 58 + .num_irqs = ARRAY_SIZE(wm8997_aod_irqs), 59 + }; 60 + EXPORT_SYMBOL_GPL(wm8997_aod); 61 + 62 + static const struct regmap_irq wm8997_irqs[ARIZONA_NUM_IRQ] = { 63 + [ARIZONA_IRQ_GP4] = { .reg_offset = 0, .mask = ARIZONA_GP4_EINT1 }, 64 + [ARIZONA_IRQ_GP3] = { .reg_offset = 0, .mask = ARIZONA_GP3_EINT1 }, 65 + [ARIZONA_IRQ_GP2] = { .reg_offset = 0, .mask = ARIZONA_GP2_EINT1 }, 66 + [ARIZONA_IRQ_GP1] = { .reg_offset = 0, .mask = ARIZONA_GP1_EINT1 }, 67 + 68 + [ARIZONA_IRQ_SPK_SHUTDOWN_WARN] = { 69 + .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_WARN_EINT1 70 + }, 71 + [ARIZONA_IRQ_SPK_SHUTDOWN] = { 72 + .reg_offset = 2, .mask = ARIZONA_SPK_SHUTDOWN_EINT1 73 + }, 74 + [ARIZONA_IRQ_HPDET] = { 75 + .reg_offset = 2, .mask = ARIZONA_HPDET_EINT1 76 + }, 77 + [ARIZONA_IRQ_MICDET] = { 78 + .reg_offset = 2, .mask = ARIZONA_MICDET_EINT1 79 + }, 80 + [ARIZONA_IRQ_WSEQ_DONE] = { 81 + .reg_offset = 2, .mask = ARIZONA_WSEQ_DONE_EINT1 82 + }, 83 + [ARIZONA_IRQ_DRC1_SIG_DET] = { 84 + .reg_offset = 2, .mask = ARIZONA_DRC1_SIG_DET_EINT1 85 + }, 86 + [ARIZONA_IRQ_UNDERCLOCKED] = { 87 + .reg_offset = 2, .mask = ARIZONA_UNDERCLOCKED_EINT1 88 + }, 89 + [ARIZONA_IRQ_OVERCLOCKED] = { 90 + .reg_offset = 2, .mask = ARIZONA_OVERCLOCKED_EINT1 91 + }, 92 + [ARIZONA_IRQ_FLL2_LOCK] = { 93 + .reg_offset = 2, .mask = ARIZONA_FLL2_LOCK_EINT1 94 + }, 95 + [ARIZONA_IRQ_FLL1_LOCK] = { 96 + .reg_offset = 2, .mask = ARIZONA_FLL1_LOCK_EINT1 97 + }, 98 + [ARIZONA_IRQ_CLKGEN_ERR] = { 99 + .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_EINT1 100 + }, 101 + [ARIZONA_IRQ_CLKGEN_ERR_ASYNC] = { 102 + .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_ASYNC_EINT1 103 + }, 104 + 105 + [ARIZONA_IRQ_AIF2_ERR] = { 106 + .reg_offset = 3, .mask = ARIZONA_AIF2_ERR_EINT1 107 + }, 108 + [ARIZONA_IRQ_AIF1_ERR] = { 109 + .reg_offset = 3, .mask = ARIZONA_AIF1_ERR_EINT1 110 + }, 111 + [ARIZONA_IRQ_CTRLIF_ERR] = { 112 + .reg_offset = 3, .mask = ARIZONA_CTRLIF_ERR_EINT1 113 + }, 114 + [ARIZONA_IRQ_MIXER_DROPPED_SAMPLES] = { 115 + .reg_offset = 3, .mask = ARIZONA_MIXER_DROPPED_SAMPLE_EINT1 116 + }, 117 + [ARIZONA_IRQ_ASYNC_CLK_ENA_LOW] = { 118 + .reg_offset = 3, .mask = ARIZONA_ASYNC_CLK_ENA_LOW_EINT1 119 + }, 120 + [ARIZONA_IRQ_SYSCLK_ENA_LOW] = { 121 + .reg_offset = 3, .mask = ARIZONA_SYSCLK_ENA_LOW_EINT1 122 + }, 123 + [ARIZONA_IRQ_ISRC1_CFG_ERR] = { 124 + .reg_offset = 3, .mask = ARIZONA_ISRC1_CFG_ERR_EINT1 125 + }, 126 + [ARIZONA_IRQ_ISRC2_CFG_ERR] = { 127 + .reg_offset = 3, .mask = ARIZONA_ISRC2_CFG_ERR_EINT1 128 + }, 129 + 130 + [ARIZONA_IRQ_BOOT_DONE] = { 131 + .reg_offset = 4, .mask = ARIZONA_BOOT_DONE_EINT1 132 + }, 133 + [ARIZONA_IRQ_DCS_DAC_DONE] = { 134 + .reg_offset = 4, .mask = ARIZONA_DCS_DAC_DONE_EINT1 135 + }, 136 + [ARIZONA_IRQ_DCS_HP_DONE] = { 137 + .reg_offset = 4, .mask = ARIZONA_DCS_HP_DONE_EINT1 138 + }, 139 + [ARIZONA_IRQ_FLL2_CLOCK_OK] = { 140 + .reg_offset = 4, .mask = ARIZONA_FLL2_CLOCK_OK_EINT1 141 + }, 142 + [ARIZONA_IRQ_FLL1_CLOCK_OK] = { 143 + .reg_offset = 4, .mask = ARIZONA_FLL1_CLOCK_OK_EINT1 144 + }, 145 + }; 146 + 147 + const struct regmap_irq_chip wm8997_irq = { 148 + .name = "wm8997 IRQ", 149 + .status_base = ARIZONA_INTERRUPT_STATUS_1, 150 + .mask_base = ARIZONA_INTERRUPT_STATUS_1_MASK, 151 + .ack_base = ARIZONA_INTERRUPT_STATUS_1, 152 + .num_regs = 5, 153 + .irqs = wm8997_irqs, 154 + .num_irqs = ARRAY_SIZE(wm8997_irqs), 155 + }; 156 + EXPORT_SYMBOL_GPL(wm8997_irq); 157 + 158 + static const struct reg_default wm8997_reg_default[] = { 159 + { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ 160 + { 0x00000016, 0x0000 }, /* R22 - Write Sequencer Ctrl 0 */ 161 + { 0x00000017, 0x0000 }, /* R23 - Write Sequencer Ctrl 1 */ 162 + { 0x00000018, 0x0000 }, /* R24 - Write Sequencer Ctrl 2 */ 163 + { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ 164 + { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ 165 + { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ 166 + { 0x00000023, 0x1000 }, /* R35 - Tone Generator 4 */ 167 + { 0x00000024, 0x0000 }, /* R36 - Tone Generator 5 */ 168 + { 0x00000030, 0x0000 }, /* R48 - PWM Drive 1 */ 169 + { 0x00000031, 0x0100 }, /* R49 - PWM Drive 2 */ 170 + { 0x00000032, 0x0100 }, /* R50 - PWM Drive 3 */ 171 + { 0x00000040, 0x0000 }, /* R64 - Wake control */ 172 + { 0x00000041, 0x0000 }, /* R65 - Sequence control */ 173 + { 0x00000061, 0x01FF }, /* R97 - Sample Rate Sequence Select 1 */ 174 + { 0x00000062, 0x01FF }, /* R98 - Sample Rate Sequence Select 2 */ 175 + { 0x00000063, 0x01FF }, /* R99 - Sample Rate Sequence Select 3 */ 176 + { 0x00000064, 0x01FF }, /* R100 - Sample Rate Sequence Select 4 */ 177 + { 0x00000068, 0x01FF }, /* R104 - Always On Triggers Sequence Select 1 */ 178 + { 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 2 */ 179 + { 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 3 */ 180 + { 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 4 */ 181 + { 0x00000070, 0x0000 }, /* R112 - Comfort Noise Generator */ 182 + { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */ 183 + { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */ 184 + { 0x00000092, 0x0000 }, /* R146 - Haptics phase 1 intensity */ 185 + { 0x00000093, 0x0000 }, /* R147 - Haptics phase 1 duration */ 186 + { 0x00000094, 0x0000 }, /* R148 - Haptics phase 2 intensity */ 187 + { 0x00000095, 0x0000 }, /* R149 - Haptics phase 2 duration */ 188 + { 0x00000096, 0x0000 }, /* R150 - Haptics phase 3 intensity */ 189 + { 0x00000097, 0x0000 }, /* R151 - Haptics phase 3 duration */ 190 + { 0x00000100, 0x0002 }, /* R256 - Clock 32k 1 */ 191 + { 0x00000101, 0x0304 }, /* R257 - System Clock 1 */ 192 + { 0x00000102, 0x0011 }, /* R258 - Sample rate 1 */ 193 + { 0x00000103, 0x0011 }, /* R259 - Sample rate 2 */ 194 + { 0x00000104, 0x0011 }, /* R260 - Sample rate 3 */ 195 + { 0x00000112, 0x0305 }, /* R274 - Async clock 1 */ 196 + { 0x00000113, 0x0011 }, /* R275 - Async sample rate 1 */ 197 + { 0x00000149, 0x0000 }, /* R329 - Output system clock */ 198 + { 0x0000014A, 0x0000 }, /* R330 - Output async clock */ 199 + { 0x00000152, 0x0000 }, /* R338 - Rate Estimator 1 */ 200 + { 0x00000153, 0x0000 }, /* R339 - Rate Estimator 2 */ 201 + { 0x00000154, 0x0000 }, /* R340 - Rate Estimator 3 */ 202 + { 0x00000155, 0x0000 }, /* R341 - Rate Estimator 4 */ 203 + { 0x00000156, 0x0000 }, /* R342 - Rate Estimator 5 */ 204 + { 0x00000161, 0x0000 }, /* R353 - Dynamic Frequency Scaling 1 */ 205 + { 0x00000171, 0x0000 }, /* R369 - FLL1 Control 1 */ 206 + { 0x00000172, 0x0008 }, /* R370 - FLL1 Control 2 */ 207 + { 0x00000173, 0x0018 }, /* R371 - FLL1 Control 3 */ 208 + { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 209 + { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ 210 + { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 211 + { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */ 212 + { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 213 + { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 214 + { 0x00000183, 0x0000 }, /* R387 - FLL1 Synchroniser 3 */ 215 + { 0x00000184, 0x0000 }, /* R388 - FLL1 Synchroniser 4 */ 216 + { 0x00000185, 0x0000 }, /* R389 - FLL1 Synchroniser 5 */ 217 + { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */ 218 + { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */ 219 + { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */ 220 + { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */ 221 + { 0x00000192, 0x0008 }, /* R402 - FLL2 Control 2 */ 222 + { 0x00000193, 0x0018 }, /* R403 - FLL2 Control 3 */ 223 + { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 224 + { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ 225 + { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 226 + { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 227 + { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 228 + { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 229 + { 0x000001A3, 0x0000 }, /* R419 - FLL2 Synchroniser 3 */ 230 + { 0x000001A4, 0x0000 }, /* R420 - FLL2 Synchroniser 4 */ 231 + { 0x000001A5, 0x0000 }, /* R421 - FLL2 Synchroniser 5 */ 232 + { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */ 233 + { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */ 234 + { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */ 235 + { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ 236 + { 0x00000210, 0x00D4 }, /* R528 - LDO1 Control 1 */ 237 + { 0x00000212, 0x0000 }, /* R530 - LDO1 Control 2 */ 238 + { 0x00000213, 0x0344 }, /* R531 - LDO2 Control 1 */ 239 + { 0x00000218, 0x01A6 }, /* R536 - Mic Bias Ctrl 1 */ 240 + { 0x00000219, 0x01A6 }, /* R537 - Mic Bias Ctrl 2 */ 241 + { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ 242 + { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ 243 + { 0x0000029B, 0x0020 }, /* R667 - Headphone Detect 1 */ 244 + { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 245 + { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 246 + { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */ 247 + { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ 248 + { 0x000002CB, 0x0000 }, /* R715 - Isolation control */ 249 + { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ 250 + { 0x00000300, 0x0000 }, /* R768 - Input Enables */ 251 + { 0x00000308, 0x0000 }, /* R776 - Input Rate */ 252 + { 0x00000309, 0x0022 }, /* R777 - Input Volume Ramp */ 253 + { 0x00000310, 0x2080 }, /* R784 - IN1L Control */ 254 + { 0x00000311, 0x0180 }, /* R785 - ADC Digital Volume 1L */ 255 + { 0x00000312, 0x0000 }, /* R786 - DMIC1L Control */ 256 + { 0x00000314, 0x0080 }, /* R788 - IN1R Control */ 257 + { 0x00000315, 0x0180 }, /* R789 - ADC Digital Volume 1R */ 258 + { 0x00000316, 0x0000 }, /* R790 - DMIC1R Control */ 259 + { 0x00000318, 0x2080 }, /* R792 - IN2L Control */ 260 + { 0x00000319, 0x0180 }, /* R793 - ADC Digital Volume 2L */ 261 + { 0x0000031A, 0x0000 }, /* R794 - DMIC2L Control */ 262 + { 0x0000031C, 0x0080 }, /* R796 - IN2R Control */ 263 + { 0x0000031D, 0x0180 }, /* R797 - ADC Digital Volume 2R */ 264 + { 0x0000031E, 0x0000 }, /* R798 - DMIC2R Control */ 265 + { 0x00000400, 0x0000 }, /* R1024 - Output Enables 1 */ 266 + { 0x00000408, 0x0000 }, /* R1032 - Output Rate 1 */ 267 + { 0x00000409, 0x0022 }, /* R1033 - Output Volume Ramp */ 268 + { 0x00000410, 0x0080 }, /* R1040 - Output Path Config 1L */ 269 + { 0x00000411, 0x0180 }, /* R1041 - DAC Digital Volume 1L */ 270 + { 0x00000412, 0x0080 }, /* R1042 - DAC Volume Limit 1L */ 271 + { 0x00000413, 0x0001 }, /* R1043 - Noise Gate Select 1L */ 272 + { 0x00000414, 0x0080 }, /* R1044 - Output Path Config 1R */ 273 + { 0x00000415, 0x0180 }, /* R1045 - DAC Digital Volume 1R */ 274 + { 0x00000416, 0x0080 }, /* R1046 - DAC Volume Limit 1R */ 275 + { 0x00000417, 0x0002 }, /* R1047 - Noise Gate Select 1R */ 276 + { 0x00000420, 0x0080 }, /* R1056 - Output Path Config 3L */ 277 + { 0x00000421, 0x0180 }, /* R1057 - DAC Digital Volume 3L */ 278 + { 0x00000422, 0x0080 }, /* R1058 - DAC Volume Limit 3L */ 279 + { 0x00000423, 0x0010 }, /* R1059 - Noise Gate Select 3L */ 280 + { 0x00000428, 0x0000 }, /* R1064 - Output Path Config 4L */ 281 + { 0x00000429, 0x0180 }, /* R1065 - DAC Digital Volume 4L */ 282 + { 0x0000042A, 0x0080 }, /* R1066 - Out Volume 4L */ 283 + { 0x0000042B, 0x0040 }, /* R1067 - Noise Gate Select 4L */ 284 + { 0x00000430, 0x0000 }, /* R1072 - Output Path Config 5L */ 285 + { 0x00000431, 0x0180 }, /* R1073 - DAC Digital Volume 5L */ 286 + { 0x00000432, 0x0080 }, /* R1074 - DAC Volume Limit 5L */ 287 + { 0x00000433, 0x0100 }, /* R1075 - Noise Gate Select 5L */ 288 + { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 289 + { 0x00000436, 0x0080 }, /* R1078 - DAC Volume Limit 5R */ 290 + { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 291 + { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ 292 + { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */ 293 + { 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */ 294 + { 0x00000491, 0x0000 }, /* R1169 - PDM SPK1 CTRL 2 */ 295 + { 0x00000500, 0x000C }, /* R1280 - AIF1 BCLK Ctrl */ 296 + { 0x00000501, 0x0008 }, /* R1281 - AIF1 Tx Pin Ctrl */ 297 + { 0x00000502, 0x0000 }, /* R1282 - AIF1 Rx Pin Ctrl */ 298 + { 0x00000503, 0x0000 }, /* R1283 - AIF1 Rate Ctrl */ 299 + { 0x00000504, 0x0000 }, /* R1284 - AIF1 Format */ 300 + { 0x00000505, 0x0040 }, /* R1285 - AIF1 Tx BCLK Rate */ 301 + { 0x00000506, 0x0040 }, /* R1286 - AIF1 Rx BCLK Rate */ 302 + { 0x00000507, 0x1818 }, /* R1287 - AIF1 Frame Ctrl 1 */ 303 + { 0x00000508, 0x1818 }, /* R1288 - AIF1 Frame Ctrl 2 */ 304 + { 0x00000509, 0x0000 }, /* R1289 - AIF1 Frame Ctrl 3 */ 305 + { 0x0000050A, 0x0001 }, /* R1290 - AIF1 Frame Ctrl 4 */ 306 + { 0x0000050B, 0x0002 }, /* R1291 - AIF1 Frame Ctrl 5 */ 307 + { 0x0000050C, 0x0003 }, /* R1292 - AIF1 Frame Ctrl 6 */ 308 + { 0x0000050D, 0x0004 }, /* R1293 - AIF1 Frame Ctrl 7 */ 309 + { 0x0000050E, 0x0005 }, /* R1294 - AIF1 Frame Ctrl 8 */ 310 + { 0x0000050F, 0x0006 }, /* R1295 - AIF1 Frame Ctrl 9 */ 311 + { 0x00000510, 0x0007 }, /* R1296 - AIF1 Frame Ctrl 10 */ 312 + { 0x00000511, 0x0000 }, /* R1297 - AIF1 Frame Ctrl 11 */ 313 + { 0x00000512, 0x0001 }, /* R1298 - AIF1 Frame Ctrl 12 */ 314 + { 0x00000513, 0x0002 }, /* R1299 - AIF1 Frame Ctrl 13 */ 315 + { 0x00000514, 0x0003 }, /* R1300 - AIF1 Frame Ctrl 14 */ 316 + { 0x00000515, 0x0004 }, /* R1301 - AIF1 Frame Ctrl 15 */ 317 + { 0x00000516, 0x0005 }, /* R1302 - AIF1 Frame Ctrl 16 */ 318 + { 0x00000517, 0x0006 }, /* R1303 - AIF1 Frame Ctrl 17 */ 319 + { 0x00000518, 0x0007 }, /* R1304 - AIF1 Frame Ctrl 18 */ 320 + { 0x00000519, 0x0000 }, /* R1305 - AIF1 Tx Enables */ 321 + { 0x0000051A, 0x0000 }, /* R1306 - AIF1 Rx Enables */ 322 + { 0x00000540, 0x000C }, /* R1344 - AIF2 BCLK Ctrl */ 323 + { 0x00000541, 0x0008 }, /* R1345 - AIF2 Tx Pin Ctrl */ 324 + { 0x00000542, 0x0000 }, /* R1346 - AIF2 Rx Pin Ctrl */ 325 + { 0x00000543, 0x0000 }, /* R1347 - AIF2 Rate Ctrl */ 326 + { 0x00000544, 0x0000 }, /* R1348 - AIF2 Format */ 327 + { 0x00000545, 0x0040 }, /* R1349 - AIF2 Tx BCLK Rate */ 328 + { 0x00000546, 0x0040 }, /* R1350 - AIF2 Rx BCLK Rate */ 329 + { 0x00000547, 0x1818 }, /* R1351 - AIF2 Frame Ctrl 1 */ 330 + { 0x00000548, 0x1818 }, /* R1352 - AIF2 Frame Ctrl 2 */ 331 + { 0x00000549, 0x0000 }, /* R1353 - AIF2 Frame Ctrl 3 */ 332 + { 0x0000054A, 0x0001 }, /* R1354 - AIF2 Frame Ctrl 4 */ 333 + { 0x00000551, 0x0000 }, /* R1361 - AIF2 Frame Ctrl 11 */ 334 + { 0x00000552, 0x0001 }, /* R1362 - AIF2 Frame Ctrl 12 */ 335 + { 0x00000559, 0x0000 }, /* R1369 - AIF2 Tx Enables */ 336 + { 0x0000055A, 0x0000 }, /* R1370 - AIF2 Rx Enables */ 337 + { 0x000005E3, 0x0004 }, /* R1507 - SLIMbus Framer Ref Gear */ 338 + { 0x000005E5, 0x0000 }, /* R1509 - SLIMbus Rates 1 */ 339 + { 0x000005E6, 0x0000 }, /* R1510 - SLIMbus Rates 2 */ 340 + { 0x000005E7, 0x0000 }, /* R1511 - SLIMbus Rates 3 */ 341 + { 0x000005E8, 0x0000 }, /* R1512 - SLIMbus Rates 4 */ 342 + { 0x000005E9, 0x0000 }, /* R1513 - SLIMbus Rates 5 */ 343 + { 0x000005EA, 0x0000 }, /* R1514 - SLIMbus Rates 6 */ 344 + { 0x000005EB, 0x0000 }, /* R1515 - SLIMbus Rates 7 */ 345 + { 0x000005EC, 0x0000 }, /* R1516 - SLIMbus Rates 8 */ 346 + { 0x000005F5, 0x0000 }, /* R1525 - SLIMbus RX Channel Enable */ 347 + { 0x000005F6, 0x0000 }, /* R1526 - SLIMbus TX Channel Enable */ 348 + { 0x00000640, 0x0000 }, /* R1600 - PWM1MIX Input 1 Source */ 349 + { 0x00000641, 0x0080 }, /* R1601 - PWM1MIX Input 1 Volume */ 350 + { 0x00000642, 0x0000 }, /* R1602 - PWM1MIX Input 2 Source */ 351 + { 0x00000643, 0x0080 }, /* R1603 - PWM1MIX Input 2 Volume */ 352 + { 0x00000644, 0x0000 }, /* R1604 - PWM1MIX Input 3 Source */ 353 + { 0x00000645, 0x0080 }, /* R1605 - PWM1MIX Input 3 Volume */ 354 + { 0x00000646, 0x0000 }, /* R1606 - PWM1MIX Input 4 Source */ 355 + { 0x00000647, 0x0080 }, /* R1607 - PWM1MIX Input 4 Volume */ 356 + { 0x00000648, 0x0000 }, /* R1608 - PWM2MIX Input 1 Source */ 357 + { 0x00000649, 0x0080 }, /* R1609 - PWM2MIX Input 1 Volume */ 358 + { 0x0000064A, 0x0000 }, /* R1610 - PWM2MIX Input 2 Source */ 359 + { 0x0000064B, 0x0080 }, /* R1611 - PWM2MIX Input 2 Volume */ 360 + { 0x0000064C, 0x0000 }, /* R1612 - PWM2MIX Input 3 Source */ 361 + { 0x0000064D, 0x0080 }, /* R1613 - PWM2MIX Input 3 Volume */ 362 + { 0x0000064E, 0x0000 }, /* R1614 - PWM2MIX Input 4 Source */ 363 + { 0x0000064F, 0x0080 }, /* R1615 - PWM2MIX Input 4 Volume */ 364 + { 0x00000660, 0x0000 }, /* R1632 - MICMIX Input 1 Source */ 365 + { 0x00000661, 0x0080 }, /* R1633 - MICMIX Input 1 Volume */ 366 + { 0x00000662, 0x0000 }, /* R1634 - MICMIX Input 2 Source */ 367 + { 0x00000663, 0x0080 }, /* R1635 - MICMIX Input 2 Volume */ 368 + { 0x00000664, 0x0000 }, /* R1636 - MICMIX Input 3 Source */ 369 + { 0x00000665, 0x0080 }, /* R1637 - MICMIX Input 3 Volume */ 370 + { 0x00000666, 0x0000 }, /* R1638 - MICMIX Input 4 Source */ 371 + { 0x00000667, 0x0080 }, /* R1639 - MICMIX Input 4 Volume */ 372 + { 0x00000668, 0x0000 }, /* R1640 - NOISEMIX Input 1 Source */ 373 + { 0x00000669, 0x0080 }, /* R1641 - NOISEMIX Input 1 Volume */ 374 + { 0x0000066A, 0x0000 }, /* R1642 - NOISEMIX Input 2 Source */ 375 + { 0x0000066B, 0x0080 }, /* R1643 - NOISEMIX Input 2 Volume */ 376 + { 0x0000066C, 0x0000 }, /* R1644 - NOISEMIX Input 3 Source */ 377 + { 0x0000066D, 0x0080 }, /* R1645 - NOISEMIX Input 3 Volume */ 378 + { 0x0000066E, 0x0000 }, /* R1646 - NOISEMIX Input 4 Source */ 379 + { 0x0000066F, 0x0080 }, /* R1647 - NOISEMIX Input 4 Volume */ 380 + { 0x00000680, 0x0000 }, /* R1664 - OUT1LMIX Input 1 Source */ 381 + { 0x00000681, 0x0080 }, /* R1665 - OUT1LMIX Input 1 Volume */ 382 + { 0x00000682, 0x0000 }, /* R1666 - OUT1LMIX Input 2 Source */ 383 + { 0x00000683, 0x0080 }, /* R1667 - OUT1LMIX Input 2 Volume */ 384 + { 0x00000684, 0x0000 }, /* R1668 - OUT1LMIX Input 3 Source */ 385 + { 0x00000685, 0x0080 }, /* R1669 - OUT1LMIX Input 3 Volume */ 386 + { 0x00000686, 0x0000 }, /* R1670 - OUT1LMIX Input 4 Source */ 387 + { 0x00000687, 0x0080 }, /* R1671 - OUT1LMIX Input 4 Volume */ 388 + { 0x00000688, 0x0000 }, /* R1672 - OUT1RMIX Input 1 Source */ 389 + { 0x00000689, 0x0080 }, /* R1673 - OUT1RMIX Input 1 Volume */ 390 + { 0x0000068A, 0x0000 }, /* R1674 - OUT1RMIX Input 2 Source */ 391 + { 0x0000068B, 0x0080 }, /* R1675 - OUT1RMIX Input 2 Volume */ 392 + { 0x0000068C, 0x0000 }, /* R1676 - OUT1RMIX Input 3 Source */ 393 + { 0x0000068D, 0x0080 }, /* R1677 - OUT1RMIX Input 3 Volume */ 394 + { 0x0000068E, 0x0000 }, /* R1678 - OUT1RMIX Input 4 Source */ 395 + { 0x0000068F, 0x0080 }, /* R1679 - OUT1RMIX Input 4 Volume */ 396 + { 0x000006A0, 0x0000 }, /* R1696 - OUT3LMIX Input 1 Source */ 397 + { 0x000006A1, 0x0080 }, /* R1697 - OUT3LMIX Input 1 Volume */ 398 + { 0x000006A2, 0x0000 }, /* R1698 - OUT3LMIX Input 2 Source */ 399 + { 0x000006A3, 0x0080 }, /* R1699 - OUT3LMIX Input 2 Volume */ 400 + { 0x000006A4, 0x0000 }, /* R1700 - OUT3LMIX Input 3 Source */ 401 + { 0x000006A5, 0x0080 }, /* R1701 - OUT3LMIX Input 3 Volume */ 402 + { 0x000006A6, 0x0000 }, /* R1702 - OUT3LMIX Input 4 Source */ 403 + { 0x000006A7, 0x0080 }, /* R1703 - OUT3LMIX Input 4 Volume */ 404 + { 0x000006B0, 0x0000 }, /* R1712 - OUT4LMIX Input 1 Source */ 405 + { 0x000006B1, 0x0080 }, /* R1713 - OUT4LMIX Input 1 Volume */ 406 + { 0x000006B2, 0x0000 }, /* R1714 - OUT4LMIX Input 2 Source */ 407 + { 0x000006B3, 0x0080 }, /* R1715 - OUT4LMIX Input 2 Volume */ 408 + { 0x000006B4, 0x0000 }, /* R1716 - OUT4LMIX Input 3 Source */ 409 + { 0x000006B5, 0x0080 }, /* R1717 - OUT4LMIX Input 3 Volume */ 410 + { 0x000006B6, 0x0000 }, /* R1718 - OUT4LMIX Input 4 Source */ 411 + { 0x000006B7, 0x0080 }, /* R1719 - OUT4LMIX Input 4 Volume */ 412 + { 0x000006C0, 0x0000 }, /* R1728 - OUT5LMIX Input 1 Source */ 413 + { 0x000006C1, 0x0080 }, /* R1729 - OUT5LMIX Input 1 Volume */ 414 + { 0x000006C2, 0x0000 }, /* R1730 - OUT5LMIX Input 2 Source */ 415 + { 0x000006C3, 0x0080 }, /* R1731 - OUT5LMIX Input 2 Volume */ 416 + { 0x000006C4, 0x0000 }, /* R1732 - OUT5LMIX Input 3 Source */ 417 + { 0x000006C5, 0x0080 }, /* R1733 - OUT5LMIX Input 3 Volume */ 418 + { 0x000006C6, 0x0000 }, /* R1734 - OUT5LMIX Input 4 Source */ 419 + { 0x000006C7, 0x0080 }, /* R1735 - OUT5LMIX Input 4 Volume */ 420 + { 0x000006C8, 0x0000 }, /* R1736 - OUT5RMIX Input 1 Source */ 421 + { 0x000006C9, 0x0080 }, /* R1737 - OUT5RMIX Input 1 Volume */ 422 + { 0x000006CA, 0x0000 }, /* R1738 - OUT5RMIX Input 2 Source */ 423 + { 0x000006CB, 0x0080 }, /* R1739 - OUT5RMIX Input 2 Volume */ 424 + { 0x000006CC, 0x0000 }, /* R1740 - OUT5RMIX Input 3 Source */ 425 + { 0x000006CD, 0x0080 }, /* R1741 - OUT5RMIX Input 3 Volume */ 426 + { 0x000006CE, 0x0000 }, /* R1742 - OUT5RMIX Input 4 Source */ 427 + { 0x000006CF, 0x0080 }, /* R1743 - OUT5RMIX Input 4 Volume */ 428 + { 0x00000700, 0x0000 }, /* R1792 - AIF1TX1MIX Input 1 Source */ 429 + { 0x00000701, 0x0080 }, /* R1793 - AIF1TX1MIX Input 1 Volume */ 430 + { 0x00000702, 0x0000 }, /* R1794 - AIF1TX1MIX Input 2 Source */ 431 + { 0x00000703, 0x0080 }, /* R1795 - AIF1TX1MIX Input 2 Volume */ 432 + { 0x00000704, 0x0000 }, /* R1796 - AIF1TX1MIX Input 3 Source */ 433 + { 0x00000705, 0x0080 }, /* R1797 - AIF1TX1MIX Input 3 Volume */ 434 + { 0x00000706, 0x0000 }, /* R1798 - AIF1TX1MIX Input 4 Source */ 435 + { 0x00000707, 0x0080 }, /* R1799 - AIF1TX1MIX Input 4 Volume */ 436 + { 0x00000708, 0x0000 }, /* R1800 - AIF1TX2MIX Input 1 Source */ 437 + { 0x00000709, 0x0080 }, /* R1801 - AIF1TX2MIX Input 1 Volume */ 438 + { 0x0000070A, 0x0000 }, /* R1802 - AIF1TX2MIX Input 2 Source */ 439 + { 0x0000070B, 0x0080 }, /* R1803 - AIF1TX2MIX Input 2 Volume */ 440 + { 0x0000070C, 0x0000 }, /* R1804 - AIF1TX2MIX Input 3 Source */ 441 + { 0x0000070D, 0x0080 }, /* R1805 - AIF1TX2MIX Input 3 Volume */ 442 + { 0x0000070E, 0x0000 }, /* R1806 - AIF1TX2MIX Input 4 Source */ 443 + { 0x0000070F, 0x0080 }, /* R1807 - AIF1TX2MIX Input 4 Volume */ 444 + { 0x00000710, 0x0000 }, /* R1808 - AIF1TX3MIX Input 1 Source */ 445 + { 0x00000711, 0x0080 }, /* R1809 - AIF1TX3MIX Input 1 Volume */ 446 + { 0x00000712, 0x0000 }, /* R1810 - AIF1TX3MIX Input 2 Source */ 447 + { 0x00000713, 0x0080 }, /* R1811 - AIF1TX3MIX Input 2 Volume */ 448 + { 0x00000714, 0x0000 }, /* R1812 - AIF1TX3MIX Input 3 Source */ 449 + { 0x00000715, 0x0080 }, /* R1813 - AIF1TX3MIX Input 3 Volume */ 450 + { 0x00000716, 0x0000 }, /* R1814 - AIF1TX3MIX Input 4 Source */ 451 + { 0x00000717, 0x0080 }, /* R1815 - AIF1TX3MIX Input 4 Volume */ 452 + { 0x00000718, 0x0000 }, /* R1816 - AIF1TX4MIX Input 1 Source */ 453 + { 0x00000719, 0x0080 }, /* R1817 - AIF1TX4MIX Input 1 Volume */ 454 + { 0x0000071A, 0x0000 }, /* R1818 - AIF1TX4MIX Input 2 Source */ 455 + { 0x0000071B, 0x0080 }, /* R1819 - AIF1TX4MIX Input 2 Volume */ 456 + { 0x0000071C, 0x0000 }, /* R1820 - AIF1TX4MIX Input 3 Source */ 457 + { 0x0000071D, 0x0080 }, /* R1821 - AIF1TX4MIX Input 3 Volume */ 458 + { 0x0000071E, 0x0000 }, /* R1822 - AIF1TX4MIX Input 4 Source */ 459 + { 0x0000071F, 0x0080 }, /* R1823 - AIF1TX4MIX Input 4 Volume */ 460 + { 0x00000720, 0x0000 }, /* R1824 - AIF1TX5MIX Input 1 Source */ 461 + { 0x00000721, 0x0080 }, /* R1825 - AIF1TX5MIX Input 1 Volume */ 462 + { 0x00000722, 0x0000 }, /* R1826 - AIF1TX5MIX Input 2 Source */ 463 + { 0x00000723, 0x0080 }, /* R1827 - AIF1TX5MIX Input 2 Volume */ 464 + { 0x00000724, 0x0000 }, /* R1828 - AIF1TX5MIX Input 3 Source */ 465 + { 0x00000725, 0x0080 }, /* R1829 - AIF1TX5MIX Input 3 Volume */ 466 + { 0x00000726, 0x0000 }, /* R1830 - AIF1TX5MIX Input 4 Source */ 467 + { 0x00000727, 0x0080 }, /* R1831 - AIF1TX5MIX Input 4 Volume */ 468 + { 0x00000728, 0x0000 }, /* R1832 - AIF1TX6MIX Input 1 Source */ 469 + { 0x00000729, 0x0080 }, /* R1833 - AIF1TX6MIX Input 1 Volume */ 470 + { 0x0000072A, 0x0000 }, /* R1834 - AIF1TX6MIX Input 2 Source */ 471 + { 0x0000072B, 0x0080 }, /* R1835 - AIF1TX6MIX Input 2 Volume */ 472 + { 0x0000072C, 0x0000 }, /* R1836 - AIF1TX6MIX Input 3 Source */ 473 + { 0x0000072D, 0x0080 }, /* R1837 - AIF1TX6MIX Input 3 Volume */ 474 + { 0x0000072E, 0x0000 }, /* R1838 - AIF1TX6MIX Input 4 Source */ 475 + { 0x0000072F, 0x0080 }, /* R1839 - AIF1TX6MIX Input 4 Volume */ 476 + { 0x00000730, 0x0000 }, /* R1840 - AIF1TX7MIX Input 1 Source */ 477 + { 0x00000731, 0x0080 }, /* R1841 - AIF1TX7MIX Input 1 Volume */ 478 + { 0x00000732, 0x0000 }, /* R1842 - AIF1TX7MIX Input 2 Source */ 479 + { 0x00000733, 0x0080 }, /* R1843 - AIF1TX7MIX Input 2 Volume */ 480 + { 0x00000734, 0x0000 }, /* R1844 - AIF1TX7MIX Input 3 Source */ 481 + { 0x00000735, 0x0080 }, /* R1845 - AIF1TX7MIX Input 3 Volume */ 482 + { 0x00000736, 0x0000 }, /* R1846 - AIF1TX7MIX Input 4 Source */ 483 + { 0x00000737, 0x0080 }, /* R1847 - AIF1TX7MIX Input 4 Volume */ 484 + { 0x00000738, 0x0000 }, /* R1848 - AIF1TX8MIX Input 1 Source */ 485 + { 0x00000739, 0x0080 }, /* R1849 - AIF1TX8MIX Input 1 Volume */ 486 + { 0x0000073A, 0x0000 }, /* R1850 - AIF1TX8MIX Input 2 Source */ 487 + { 0x0000073B, 0x0080 }, /* R1851 - AIF1TX8MIX Input 2 Volume */ 488 + { 0x0000073C, 0x0000 }, /* R1852 - AIF1TX8MIX Input 3 Source */ 489 + { 0x0000073D, 0x0080 }, /* R1853 - AIF1TX8MIX Input 3 Volume */ 490 + { 0x0000073E, 0x0000 }, /* R1854 - AIF1TX8MIX Input 4 Source */ 491 + { 0x0000073F, 0x0080 }, /* R1855 - AIF1TX8MIX Input 4 Volume */ 492 + { 0x00000740, 0x0000 }, /* R1856 - AIF2TX1MIX Input 1 Source */ 493 + { 0x00000741, 0x0080 }, /* R1857 - AIF2TX1MIX Input 1 Volume */ 494 + { 0x00000742, 0x0000 }, /* R1858 - AIF2TX1MIX Input 2 Source */ 495 + { 0x00000743, 0x0080 }, /* R1859 - AIF2TX1MIX Input 2 Volume */ 496 + { 0x00000744, 0x0000 }, /* R1860 - AIF2TX1MIX Input 3 Source */ 497 + { 0x00000745, 0x0080 }, /* R1861 - AIF2TX1MIX Input 3 Volume */ 498 + { 0x00000746, 0x0000 }, /* R1862 - AIF2TX1MIX Input 4 Source */ 499 + { 0x00000747, 0x0080 }, /* R1863 - AIF2TX1MIX Input 4 Volume */ 500 + { 0x00000748, 0x0000 }, /* R1864 - AIF2TX2MIX Input 1 Source */ 501 + { 0x00000749, 0x0080 }, /* R1865 - AIF2TX2MIX Input 1 Volume */ 502 + { 0x0000074A, 0x0000 }, /* R1866 - AIF2TX2MIX Input 2 Source */ 503 + { 0x0000074B, 0x0080 }, /* R1867 - AIF2TX2MIX Input 2 Volume */ 504 + { 0x0000074C, 0x0000 }, /* R1868 - AIF2TX2MIX Input 3 Source */ 505 + { 0x0000074D, 0x0080 }, /* R1869 - AIF2TX2MIX Input 3 Volume */ 506 + { 0x0000074E, 0x0000 }, /* R1870 - AIF2TX2MIX Input 4 Source */ 507 + { 0x0000074F, 0x0080 }, /* R1871 - AIF2TX2MIX Input 4 Volume */ 508 + { 0x000007C0, 0x0000 }, /* R1984 - SLIMTX1MIX Input 1 Source */ 509 + { 0x000007C1, 0x0080 }, /* R1985 - SLIMTX1MIX Input 1 Volume */ 510 + { 0x000007C2, 0x0000 }, /* R1986 - SLIMTX1MIX Input 2 Source */ 511 + { 0x000007C3, 0x0080 }, /* R1987 - SLIMTX1MIX Input 2 Volume */ 512 + { 0x000007C4, 0x0000 }, /* R1988 - SLIMTX1MIX Input 3 Source */ 513 + { 0x000007C5, 0x0080 }, /* R1989 - SLIMTX1MIX Input 3 Volume */ 514 + { 0x000007C6, 0x0000 }, /* R1990 - SLIMTX1MIX Input 4 Source */ 515 + { 0x000007C7, 0x0080 }, /* R1991 - SLIMTX1MIX Input 4 Volume */ 516 + { 0x000007C8, 0x0000 }, /* R1992 - SLIMTX2MIX Input 1 Source */ 517 + { 0x000007C9, 0x0080 }, /* R1993 - SLIMTX2MIX Input 1 Volume */ 518 + { 0x000007CA, 0x0000 }, /* R1994 - SLIMTX2MIX Input 2 Source */ 519 + { 0x000007CB, 0x0080 }, /* R1995 - SLIMTX2MIX Input 2 Volume */ 520 + { 0x000007CC, 0x0000 }, /* R1996 - SLIMTX2MIX Input 3 Source */ 521 + { 0x000007CD, 0x0080 }, /* R1997 - SLIMTX2MIX Input 3 Volume */ 522 + { 0x000007CE, 0x0000 }, /* R1998 - SLIMTX2MIX Input 4 Source */ 523 + { 0x000007CF, 0x0080 }, /* R1999 - SLIMTX2MIX Input 4 Volume */ 524 + { 0x000007D0, 0x0000 }, /* R2000 - SLIMTX3MIX Input 1 Source */ 525 + { 0x000007D1, 0x0080 }, /* R2001 - SLIMTX3MIX Input 1 Volume */ 526 + { 0x000007D2, 0x0000 }, /* R2002 - SLIMTX3MIX Input 2 Source */ 527 + { 0x000007D3, 0x0080 }, /* R2003 - SLIMTX3MIX Input 2 Volume */ 528 + { 0x000007D4, 0x0000 }, /* R2004 - SLIMTX3MIX Input 3 Source */ 529 + { 0x000007D5, 0x0080 }, /* R2005 - SLIMTX3MIX Input 3 Volume */ 530 + { 0x000007D6, 0x0000 }, /* R2006 - SLIMTX3MIX Input 4 Source */ 531 + { 0x000007D7, 0x0080 }, /* R2007 - SLIMTX3MIX Input 4 Volume */ 532 + { 0x000007D8, 0x0000 }, /* R2008 - SLIMTX4MIX Input 1 Source */ 533 + { 0x000007D9, 0x0080 }, /* R2009 - SLIMTX4MIX Input 1 Volume */ 534 + { 0x000007DA, 0x0000 }, /* R2010 - SLIMTX4MIX Input 2 Source */ 535 + { 0x000007DB, 0x0080 }, /* R2011 - SLIMTX4MIX Input 2 Volume */ 536 + { 0x000007DC, 0x0000 }, /* R2012 - SLIMTX4MIX Input 3 Source */ 537 + { 0x000007DD, 0x0080 }, /* R2013 - SLIMTX4MIX Input 3 Volume */ 538 + { 0x000007DE, 0x0000 }, /* R2014 - SLIMTX4MIX Input 4 Source */ 539 + { 0x000007DF, 0x0080 }, /* R2015 - SLIMTX4MIX Input 4 Volume */ 540 + { 0x000007E0, 0x0000 }, /* R2016 - SLIMTX5MIX Input 1 Source */ 541 + { 0x000007E1, 0x0080 }, /* R2017 - SLIMTX5MIX Input 1 Volume */ 542 + { 0x000007E2, 0x0000 }, /* R2018 - SLIMTX5MIX Input 2 Source */ 543 + { 0x000007E3, 0x0080 }, /* R2019 - SLIMTX5MIX Input 2 Volume */ 544 + { 0x000007E4, 0x0000 }, /* R2020 - SLIMTX5MIX Input 3 Source */ 545 + { 0x000007E5, 0x0080 }, /* R2021 - SLIMTX5MIX Input 3 Volume */ 546 + { 0x000007E6, 0x0000 }, /* R2022 - SLIMTX5MIX Input 4 Source */ 547 + { 0x000007E7, 0x0080 }, /* R2023 - SLIMTX5MIX Input 4 Volume */ 548 + { 0x000007E8, 0x0000 }, /* R2024 - SLIMTX6MIX Input 1 Source */ 549 + { 0x000007E9, 0x0080 }, /* R2025 - SLIMTX6MIX Input 1 Volume */ 550 + { 0x000007EA, 0x0000 }, /* R2026 - SLIMTX6MIX Input 2 Source */ 551 + { 0x000007EB, 0x0080 }, /* R2027 - SLIMTX6MIX Input 2 Volume */ 552 + { 0x000007EC, 0x0000 }, /* R2028 - SLIMTX6MIX Input 3 Source */ 553 + { 0x000007ED, 0x0080 }, /* R2029 - SLIMTX6MIX Input 3 Volume */ 554 + { 0x000007EE, 0x0000 }, /* R2030 - SLIMTX6MIX Input 4 Source */ 555 + { 0x000007EF, 0x0080 }, /* R2031 - SLIMTX6MIX Input 4 Volume */ 556 + { 0x000007F0, 0x0000 }, /* R2032 - SLIMTX7MIX Input 1 Source */ 557 + { 0x000007F1, 0x0080 }, /* R2033 - SLIMTX7MIX Input 1 Volume */ 558 + { 0x000007F2, 0x0000 }, /* R2034 - SLIMTX7MIX Input 2 Source */ 559 + { 0x000007F3, 0x0080 }, /* R2035 - SLIMTX7MIX Input 2 Volume */ 560 + { 0x000007F4, 0x0000 }, /* R2036 - SLIMTX7MIX Input 3 Source */ 561 + { 0x000007F5, 0x0080 }, /* R2037 - SLIMTX7MIX Input 3 Volume */ 562 + { 0x000007F6, 0x0000 }, /* R2038 - SLIMTX7MIX Input 4 Source */ 563 + { 0x000007F7, 0x0080 }, /* R2039 - SLIMTX7MIX Input 4 Volume */ 564 + { 0x000007F8, 0x0000 }, /* R2040 - SLIMTX8MIX Input 1 Source */ 565 + { 0x000007F9, 0x0080 }, /* R2041 - SLIMTX8MIX Input 1 Volume */ 566 + { 0x000007FA, 0x0000 }, /* R2042 - SLIMTX8MIX Input 2 Source */ 567 + { 0x000007FB, 0x0080 }, /* R2043 - SLIMTX8MIX Input 2 Volume */ 568 + { 0x000007FC, 0x0000 }, /* R2044 - SLIMTX8MIX Input 3 Source */ 569 + { 0x000007FD, 0x0080 }, /* R2045 - SLIMTX8MIX Input 3 Volume */ 570 + { 0x000007FE, 0x0000 }, /* R2046 - SLIMTX8MIX Input 4 Source */ 571 + { 0x000007FF, 0x0080 }, /* R2047 - SLIMTX8MIX Input 4 Volume */ 572 + { 0x00000880, 0x0000 }, /* R2176 - EQ1MIX Input 1 Source */ 573 + { 0x00000881, 0x0080 }, /* R2177 - EQ1MIX Input 1 Volume */ 574 + { 0x00000882, 0x0000 }, /* R2178 - EQ1MIX Input 2 Source */ 575 + { 0x00000883, 0x0080 }, /* R2179 - EQ1MIX Input 2 Volume */ 576 + { 0x00000884, 0x0000 }, /* R2180 - EQ1MIX Input 3 Source */ 577 + { 0x00000885, 0x0080 }, /* R2181 - EQ1MIX Input 3 Volume */ 578 + { 0x00000886, 0x0000 }, /* R2182 - EQ1MIX Input 4 Source */ 579 + { 0x00000887, 0x0080 }, /* R2183 - EQ1MIX Input 4 Volume */ 580 + { 0x00000888, 0x0000 }, /* R2184 - EQ2MIX Input 1 Source */ 581 + { 0x00000889, 0x0080 }, /* R2185 - EQ2MIX Input 1 Volume */ 582 + { 0x0000088A, 0x0000 }, /* R2186 - EQ2MIX Input 2 Source */ 583 + { 0x0000088B, 0x0080 }, /* R2187 - EQ2MIX Input 2 Volume */ 584 + { 0x0000088C, 0x0000 }, /* R2188 - EQ2MIX Input 3 Source */ 585 + { 0x0000088D, 0x0080 }, /* R2189 - EQ2MIX Input 3 Volume */ 586 + { 0x0000088E, 0x0000 }, /* R2190 - EQ2MIX Input 4 Source */ 587 + { 0x0000088F, 0x0080 }, /* R2191 - EQ2MIX Input 4 Volume */ 588 + { 0x00000890, 0x0000 }, /* R2192 - EQ3MIX Input 1 Source */ 589 + { 0x00000891, 0x0080 }, /* R2193 - EQ3MIX Input 1 Volume */ 590 + { 0x00000892, 0x0000 }, /* R2194 - EQ3MIX Input 2 Source */ 591 + { 0x00000893, 0x0080 }, /* R2195 - EQ3MIX Input 2 Volume */ 592 + { 0x00000894, 0x0000 }, /* R2196 - EQ3MIX Input 3 Source */ 593 + { 0x00000895, 0x0080 }, /* R2197 - EQ3MIX Input 3 Volume */ 594 + { 0x00000896, 0x0000 }, /* R2198 - EQ3MIX Input 4 Source */ 595 + { 0x00000897, 0x0080 }, /* R2199 - EQ3MIX Input 4 Volume */ 596 + { 0x00000898, 0x0000 }, /* R2200 - EQ4MIX Input 1 Source */ 597 + { 0x00000899, 0x0080 }, /* R2201 - EQ4MIX Input 1 Volume */ 598 + { 0x0000089A, 0x0000 }, /* R2202 - EQ4MIX Input 2 Source */ 599 + { 0x0000089B, 0x0080 }, /* R2203 - EQ4MIX Input 2 Volume */ 600 + { 0x0000089C, 0x0000 }, /* R2204 - EQ4MIX Input 3 Source */ 601 + { 0x0000089D, 0x0080 }, /* R2205 - EQ4MIX Input 3 Volume */ 602 + { 0x0000089E, 0x0000 }, /* R2206 - EQ4MIX Input 4 Source */ 603 + { 0x0000089F, 0x0080 }, /* R2207 - EQ4MIX Input 4 Volume */ 604 + { 0x000008C0, 0x0000 }, /* R2240 - DRC1LMIX Input 1 Source */ 605 + { 0x000008C1, 0x0080 }, /* R2241 - DRC1LMIX Input 1 Volume */ 606 + { 0x000008C2, 0x0000 }, /* R2242 - DRC1LMIX Input 2 Source */ 607 + { 0x000008C3, 0x0080 }, /* R2243 - DRC1LMIX Input 2 Volume */ 608 + { 0x000008C4, 0x0000 }, /* R2244 - DRC1LMIX Input 3 Source */ 609 + { 0x000008C5, 0x0080 }, /* R2245 - DRC1LMIX Input 3 Volume */ 610 + { 0x000008C6, 0x0000 }, /* R2246 - DRC1LMIX Input 4 Source */ 611 + { 0x000008C7, 0x0080 }, /* R2247 - DRC1LMIX Input 4 Volume */ 612 + { 0x000008C8, 0x0000 }, /* R2248 - DRC1RMIX Input 1 Source */ 613 + { 0x000008C9, 0x0080 }, /* R2249 - DRC1RMIX Input 1 Volume */ 614 + { 0x000008CA, 0x0000 }, /* R2250 - DRC1RMIX Input 2 Source */ 615 + { 0x000008CB, 0x0080 }, /* R2251 - DRC1RMIX Input 2 Volume */ 616 + { 0x000008CC, 0x0000 }, /* R2252 - DRC1RMIX Input 3 Source */ 617 + { 0x000008CD, 0x0080 }, /* R2253 - DRC1RMIX Input 3 Volume */ 618 + { 0x000008CE, 0x0000 }, /* R2254 - DRC1RMIX Input 4 Source */ 619 + { 0x000008CF, 0x0080 }, /* R2255 - DRC1RMIX Input 4 Volume */ 620 + { 0x00000900, 0x0000 }, /* R2304 - HPLP1MIX Input 1 Source */ 621 + { 0x00000901, 0x0080 }, /* R2305 - HPLP1MIX Input 1 Volume */ 622 + { 0x00000902, 0x0000 }, /* R2306 - HPLP1MIX Input 2 Source */ 623 + { 0x00000903, 0x0080 }, /* R2307 - HPLP1MIX Input 2 Volume */ 624 + { 0x00000904, 0x0000 }, /* R2308 - HPLP1MIX Input 3 Source */ 625 + { 0x00000905, 0x0080 }, /* R2309 - HPLP1MIX Input 3 Volume */ 626 + { 0x00000906, 0x0000 }, /* R2310 - HPLP1MIX Input 4 Source */ 627 + { 0x00000907, 0x0080 }, /* R2311 - HPLP1MIX Input 4 Volume */ 628 + { 0x00000908, 0x0000 }, /* R2312 - HPLP2MIX Input 1 Source */ 629 + { 0x00000909, 0x0080 }, /* R2313 - HPLP2MIX Input 1 Volume */ 630 + { 0x0000090A, 0x0000 }, /* R2314 - HPLP2MIX Input 2 Source */ 631 + { 0x0000090B, 0x0080 }, /* R2315 - HPLP2MIX Input 2 Volume */ 632 + { 0x0000090C, 0x0000 }, /* R2316 - HPLP2MIX Input 3 Source */ 633 + { 0x0000090D, 0x0080 }, /* R2317 - HPLP2MIX Input 3 Volume */ 634 + { 0x0000090E, 0x0000 }, /* R2318 - HPLP2MIX Input 4 Source */ 635 + { 0x0000090F, 0x0080 }, /* R2319 - HPLP2MIX Input 4 Volume */ 636 + { 0x00000910, 0x0000 }, /* R2320 - HPLP3MIX Input 1 Source */ 637 + { 0x00000911, 0x0080 }, /* R2321 - HPLP3MIX Input 1 Volume */ 638 + { 0x00000912, 0x0000 }, /* R2322 - HPLP3MIX Input 2 Source */ 639 + { 0x00000913, 0x0080 }, /* R2323 - HPLP3MIX Input 2 Volume */ 640 + { 0x00000914, 0x0000 }, /* R2324 - HPLP3MIX Input 3 Source */ 641 + { 0x00000915, 0x0080 }, /* R2325 - HPLP3MIX Input 3 Volume */ 642 + { 0x00000916, 0x0000 }, /* R2326 - HPLP3MIX Input 4 Source */ 643 + { 0x00000917, 0x0080 }, /* R2327 - HPLP3MIX Input 4 Volume */ 644 + { 0x00000918, 0x0000 }, /* R2328 - HPLP4MIX Input 1 Source */ 645 + { 0x00000919, 0x0080 }, /* R2329 - HPLP4MIX Input 1 Volume */ 646 + { 0x0000091A, 0x0000 }, /* R2330 - HPLP4MIX Input 2 Source */ 647 + { 0x0000091B, 0x0080 }, /* R2331 - HPLP4MIX Input 2 Volume */ 648 + { 0x0000091C, 0x0000 }, /* R2332 - HPLP4MIX Input 3 Source */ 649 + { 0x0000091D, 0x0080 }, /* R2333 - HPLP4MIX Input 3 Volume */ 650 + { 0x0000091E, 0x0000 }, /* R2334 - HPLP4MIX Input 4 Source */ 651 + { 0x0000091F, 0x0080 }, /* R2335 - HPLP4MIX Input 4 Volume */ 652 + { 0x00000B00, 0x0000 }, /* R2816 - ISRC1DEC1MIX Input 1 Source */ 653 + { 0x00000B08, 0x0000 }, /* R2824 - ISRC1DEC2MIX Input 1 Source */ 654 + { 0x00000B20, 0x0000 }, /* R2848 - ISRC1INT1MIX Input 1 Source */ 655 + { 0x00000B28, 0x0000 }, /* R2856 - ISRC1INT2MIX Input 1 Source */ 656 + { 0x00000B40, 0x0000 }, /* R2880 - ISRC2DEC1MIX Input 1 Source */ 657 + { 0x00000B48, 0x0000 }, /* R2888 - ISRC2DEC2MIX Input 1 Source */ 658 + { 0x00000B60, 0x0000 }, /* R2912 - ISRC2INT1MIX Input 1 Source */ 659 + { 0x00000B68, 0x0000 }, /* R2920 - ISRC2INT2MIX Input 1 Source */ 660 + { 0x00000C00, 0xA101 }, /* R3072 - GPIO1 CTRL */ 661 + { 0x00000C01, 0xA101 }, /* R3073 - GPIO2 CTRL */ 662 + { 0x00000C02, 0xA101 }, /* R3074 - GPIO3 CTRL */ 663 + { 0x00000C03, 0xA101 }, /* R3075 - GPIO4 CTRL */ 664 + { 0x00000C04, 0xA101 }, /* R3076 - GPIO5 CTRL */ 665 + { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */ 666 + { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 667 + { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 668 + { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */ 669 + { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 670 + { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 671 + { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 672 + { 0x00000D08, 0xFFFF }, /* R3336 - Interrupt Status 1 Mask */ 673 + { 0x00000D0A, 0xFFFF }, /* R3338 - Interrupt Status 3 Mask */ 674 + { 0x00000D0B, 0xFFFF }, /* R3339 - Interrupt Status 4 Mask */ 675 + { 0x00000D0C, 0xFEFF }, /* R3340 - Interrupt Status 5 Mask */ 676 + { 0x00000D0F, 0x0000 }, /* R3343 - Interrupt Control */ 677 + { 0x00000D18, 0xFFFF }, /* R3352 - IRQ2 Status 1 Mask */ 678 + { 0x00000D1A, 0xFFFF }, /* R3354 - IRQ2 Status 3 Mask */ 679 + { 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */ 680 + { 0x00000D1C, 0xFFFF }, /* R3356 - IRQ2 Status 5 Mask */ 681 + { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */ 682 + { 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */ 683 + { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ 684 + { 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */ 685 + { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */ 686 + { 0x00000E01, 0x0000 }, /* R3585 - FX_Ctrl2 */ 687 + { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */ 688 + { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */ 689 + { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */ 690 + { 0x00000E13, 0x03FE }, /* R3603 - EQ1_4 */ 691 + { 0x00000E14, 0x00E0 }, /* R3604 - EQ1_5 */ 692 + { 0x00000E15, 0x1EC4 }, /* R3605 - EQ1_6 */ 693 + { 0x00000E16, 0xF136 }, /* R3606 - EQ1_7 */ 694 + { 0x00000E17, 0x0409 }, /* R3607 - EQ1_8 */ 695 + { 0x00000E18, 0x04CC }, /* R3608 - EQ1_9 */ 696 + { 0x00000E19, 0x1C9B }, /* R3609 - EQ1_10 */ 697 + { 0x00000E1A, 0xF337 }, /* R3610 - EQ1_11 */ 698 + { 0x00000E1B, 0x040B }, /* R3611 - EQ1_12 */ 699 + { 0x00000E1C, 0x0CBB }, /* R3612 - EQ1_13 */ 700 + { 0x00000E1D, 0x16F8 }, /* R3613 - EQ1_14 */ 701 + { 0x00000E1E, 0xF7D9 }, /* R3614 - EQ1_15 */ 702 + { 0x00000E1F, 0x040A }, /* R3615 - EQ1_16 */ 703 + { 0x00000E20, 0x1F14 }, /* R3616 - EQ1_17 */ 704 + { 0x00000E21, 0x058C }, /* R3617 - EQ1_18 */ 705 + { 0x00000E22, 0x0563 }, /* R3618 - EQ1_19 */ 706 + { 0x00000E23, 0x4000 }, /* R3619 - EQ1_20 */ 707 + { 0x00000E24, 0x0B75 }, /* R3620 - EQ1_21 */ 708 + { 0x00000E26, 0x6318 }, /* R3622 - EQ2_1 */ 709 + { 0x00000E27, 0x6300 }, /* R3623 - EQ2_2 */ 710 + { 0x00000E28, 0x0FC8 }, /* R3624 - EQ2_3 */ 711 + { 0x00000E29, 0x03FE }, /* R3625 - EQ2_4 */ 712 + { 0x00000E2A, 0x00E0 }, /* R3626 - EQ2_5 */ 713 + { 0x00000E2B, 0x1EC4 }, /* R3627 - EQ2_6 */ 714 + { 0x00000E2C, 0xF136 }, /* R3628 - EQ2_7 */ 715 + { 0x00000E2D, 0x0409 }, /* R3629 - EQ2_8 */ 716 + { 0x00000E2E, 0x04CC }, /* R3630 - EQ2_9 */ 717 + { 0x00000E2F, 0x1C9B }, /* R3631 - EQ2_10 */ 718 + { 0x00000E30, 0xF337 }, /* R3632 - EQ2_11 */ 719 + { 0x00000E31, 0x040B }, /* R3633 - EQ2_12 */ 720 + { 0x00000E32, 0x0CBB }, /* R3634 - EQ2_13 */ 721 + { 0x00000E33, 0x16F8 }, /* R3635 - EQ2_14 */ 722 + { 0x00000E34, 0xF7D9 }, /* R3636 - EQ2_15 */ 723 + { 0x00000E35, 0x040A }, /* R3637 - EQ2_16 */ 724 + { 0x00000E36, 0x1F14 }, /* R3638 - EQ2_17 */ 725 + { 0x00000E37, 0x058C }, /* R3639 - EQ2_18 */ 726 + { 0x00000E38, 0x0563 }, /* R3640 - EQ2_19 */ 727 + { 0x00000E39, 0x4000 }, /* R3641 - EQ2_20 */ 728 + { 0x00000E3A, 0x0B75 }, /* R3642 - EQ2_21 */ 729 + { 0x00000E3C, 0x6318 }, /* R3644 - EQ3_1 */ 730 + { 0x00000E3D, 0x6300 }, /* R3645 - EQ3_2 */ 731 + { 0x00000E3E, 0x0FC8 }, /* R3646 - EQ3_3 */ 732 + { 0x00000E3F, 0x03FE }, /* R3647 - EQ3_4 */ 733 + { 0x00000E40, 0x00E0 }, /* R3648 - EQ3_5 */ 734 + { 0x00000E41, 0x1EC4 }, /* R3649 - EQ3_6 */ 735 + { 0x00000E42, 0xF136 }, /* R3650 - EQ3_7 */ 736 + { 0x00000E43, 0x0409 }, /* R3651 - EQ3_8 */ 737 + { 0x00000E44, 0x04CC }, /* R3652 - EQ3_9 */ 738 + { 0x00000E45, 0x1C9B }, /* R3653 - EQ3_10 */ 739 + { 0x00000E46, 0xF337 }, /* R3654 - EQ3_11 */ 740 + { 0x00000E47, 0x040B }, /* R3655 - EQ3_12 */ 741 + { 0x00000E48, 0x0CBB }, /* R3656 - EQ3_13 */ 742 + { 0x00000E49, 0x16F8 }, /* R3657 - EQ3_14 */ 743 + { 0x00000E4A, 0xF7D9 }, /* R3658 - EQ3_15 */ 744 + { 0x00000E4B, 0x040A }, /* R3659 - EQ3_16 */ 745 + { 0x00000E4C, 0x1F14 }, /* R3660 - EQ3_17 */ 746 + { 0x00000E4D, 0x058C }, /* R3661 - EQ3_18 */ 747 + { 0x00000E4E, 0x0563 }, /* R3662 - EQ3_19 */ 748 + { 0x00000E4F, 0x4000 }, /* R3663 - EQ3_20 */ 749 + { 0x00000E50, 0x0B75 }, /* R3664 - EQ3_21 */ 750 + { 0x00000E52, 0x6318 }, /* R3666 - EQ4_1 */ 751 + { 0x00000E53, 0x6300 }, /* R3667 - EQ4_2 */ 752 + { 0x00000E54, 0x0FC8 }, /* R3668 - EQ4_3 */ 753 + { 0x00000E55, 0x03FE }, /* R3669 - EQ4_4 */ 754 + { 0x00000E56, 0x00E0 }, /* R3670 - EQ4_5 */ 755 + { 0x00000E57, 0x1EC4 }, /* R3671 - EQ4_6 */ 756 + { 0x00000E58, 0xF136 }, /* R3672 - EQ4_7 */ 757 + { 0x00000E59, 0x0409 }, /* R3673 - EQ4_8 */ 758 + { 0x00000E5A, 0x04CC }, /* R3674 - EQ4_9 */ 759 + { 0x00000E5B, 0x1C9B }, /* R3675 - EQ4_10 */ 760 + { 0x00000E5C, 0xF337 }, /* R3676 - EQ4_11 */ 761 + { 0x00000E5D, 0x040B }, /* R3677 - EQ4_12 */ 762 + { 0x00000E5E, 0x0CBB }, /* R3678 - EQ4_13 */ 763 + { 0x00000E5F, 0x16F8 }, /* R3679 - EQ4_14 */ 764 + { 0x00000E60, 0xF7D9 }, /* R3680 - EQ4_15 */ 765 + { 0x00000E61, 0x040A }, /* R3681 - EQ4_16 */ 766 + { 0x00000E62, 0x1F14 }, /* R3682 - EQ4_17 */ 767 + { 0x00000E63, 0x058C }, /* R3683 - EQ4_18 */ 768 + { 0x00000E64, 0x0563 }, /* R3684 - EQ4_19 */ 769 + { 0x00000E65, 0x4000 }, /* R3685 - EQ4_20 */ 770 + { 0x00000E66, 0x0B75 }, /* R3686 - EQ4_21 */ 771 + { 0x00000E80, 0x0018 }, /* R3712 - DRC1 ctrl1 */ 772 + { 0x00000E81, 0x0933 }, /* R3713 - DRC1 ctrl2 */ 773 + { 0x00000E82, 0x0018 }, /* R3714 - DRC1 ctrl3 */ 774 + { 0x00000E83, 0x0000 }, /* R3715 - DRC1 ctrl4 */ 775 + { 0x00000E84, 0x0000 }, /* R3716 - DRC1 ctrl5 */ 776 + { 0x00000EC0, 0x0000 }, /* R3776 - HPLPF1_1 */ 777 + { 0x00000EC1, 0x0000 }, /* R3777 - HPLPF1_2 */ 778 + { 0x00000EC4, 0x0000 }, /* R3780 - HPLPF2_1 */ 779 + { 0x00000EC5, 0x0000 }, /* R3781 - HPLPF2_2 */ 780 + { 0x00000EC8, 0x0000 }, /* R3784 - HPLPF3_1 */ 781 + { 0x00000EC9, 0x0000 }, /* R3785 - HPLPF3_2 */ 782 + { 0x00000ECC, 0x0000 }, /* R3788 - HPLPF4_1 */ 783 + { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ 784 + { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ 785 + { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ 786 + { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ 787 + { 0x00000EF3, 0x0000 }, /* R3827 - ISRC 2 CTRL 1 */ 788 + { 0x00000EF4, 0x0000 }, /* R3828 - ISRC 2 CTRL 2 */ 789 + { 0x00000EF5, 0x0000 }, /* R3829 - ISRC 2 CTRL 3 */ 790 + { 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */ 791 + { 0x00001101, 0x0000 }, /* R4353 - DSP1 Clocking 1 */ 792 + }; 793 + 794 + static bool wm8997_readable_register(struct device *dev, unsigned int reg) 795 + { 796 + switch (reg) { 797 + case ARIZONA_SOFTWARE_RESET: 798 + case ARIZONA_DEVICE_REVISION: 799 + case ARIZONA_CTRL_IF_I2C1_CFG_1: 800 + case ARIZONA_WRITE_SEQUENCER_CTRL_0: 801 + case ARIZONA_WRITE_SEQUENCER_CTRL_1: 802 + case ARIZONA_WRITE_SEQUENCER_CTRL_2: 803 + case ARIZONA_TONE_GENERATOR_1: 804 + case ARIZONA_TONE_GENERATOR_2: 805 + case ARIZONA_TONE_GENERATOR_3: 806 + case ARIZONA_TONE_GENERATOR_4: 807 + case ARIZONA_TONE_GENERATOR_5: 808 + case ARIZONA_PWM_DRIVE_1: 809 + case ARIZONA_PWM_DRIVE_2: 810 + case ARIZONA_PWM_DRIVE_3: 811 + case ARIZONA_WAKE_CONTROL: 812 + case ARIZONA_SEQUENCE_CONTROL: 813 + case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_1: 814 + case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_2: 815 + case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_3: 816 + case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_4: 817 + case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_1: 818 + case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_2: 819 + case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_3: 820 + case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4: 821 + case ARIZONA_COMFORT_NOISE_GENERATOR: 822 + case ARIZONA_HAPTICS_CONTROL_1: 823 + case ARIZONA_HAPTICS_CONTROL_2: 824 + case ARIZONA_HAPTICS_PHASE_1_INTENSITY: 825 + case ARIZONA_HAPTICS_PHASE_1_DURATION: 826 + case ARIZONA_HAPTICS_PHASE_2_INTENSITY: 827 + case ARIZONA_HAPTICS_PHASE_2_DURATION: 828 + case ARIZONA_HAPTICS_PHASE_3_INTENSITY: 829 + case ARIZONA_HAPTICS_PHASE_3_DURATION: 830 + case ARIZONA_HAPTICS_STATUS: 831 + case ARIZONA_CLOCK_32K_1: 832 + case ARIZONA_SYSTEM_CLOCK_1: 833 + case ARIZONA_SAMPLE_RATE_1: 834 + case ARIZONA_SAMPLE_RATE_2: 835 + case ARIZONA_SAMPLE_RATE_3: 836 + case ARIZONA_SAMPLE_RATE_1_STATUS: 837 + case ARIZONA_SAMPLE_RATE_2_STATUS: 838 + case ARIZONA_SAMPLE_RATE_3_STATUS: 839 + case ARIZONA_ASYNC_CLOCK_1: 840 + case ARIZONA_ASYNC_SAMPLE_RATE_1: 841 + case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 842 + case ARIZONA_OUTPUT_SYSTEM_CLOCK: 843 + case ARIZONA_OUTPUT_ASYNC_CLOCK: 844 + case ARIZONA_RATE_ESTIMATOR_1: 845 + case ARIZONA_RATE_ESTIMATOR_2: 846 + case ARIZONA_RATE_ESTIMATOR_3: 847 + case ARIZONA_RATE_ESTIMATOR_4: 848 + case ARIZONA_RATE_ESTIMATOR_5: 849 + case ARIZONA_FLL1_CONTROL_1: 850 + case ARIZONA_FLL1_CONTROL_2: 851 + case ARIZONA_FLL1_CONTROL_3: 852 + case ARIZONA_FLL1_CONTROL_4: 853 + case ARIZONA_FLL1_CONTROL_5: 854 + case ARIZONA_FLL1_CONTROL_6: 855 + case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 856 + case ARIZONA_FLL1_NCO_TEST_0: 857 + case ARIZONA_FLL1_SYNCHRONISER_1: 858 + case ARIZONA_FLL1_SYNCHRONISER_2: 859 + case ARIZONA_FLL1_SYNCHRONISER_3: 860 + case ARIZONA_FLL1_SYNCHRONISER_4: 861 + case ARIZONA_FLL1_SYNCHRONISER_5: 862 + case ARIZONA_FLL1_SYNCHRONISER_6: 863 + case ARIZONA_FLL1_SPREAD_SPECTRUM: 864 + case ARIZONA_FLL1_GPIO_CLOCK: 865 + case ARIZONA_FLL2_CONTROL_1: 866 + case ARIZONA_FLL2_CONTROL_2: 867 + case ARIZONA_FLL2_CONTROL_3: 868 + case ARIZONA_FLL2_CONTROL_4: 869 + case ARIZONA_FLL2_CONTROL_5: 870 + case ARIZONA_FLL2_CONTROL_6: 871 + case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 872 + case ARIZONA_FLL2_NCO_TEST_0: 873 + case ARIZONA_FLL2_SYNCHRONISER_1: 874 + case ARIZONA_FLL2_SYNCHRONISER_2: 875 + case ARIZONA_FLL2_SYNCHRONISER_3: 876 + case ARIZONA_FLL2_SYNCHRONISER_4: 877 + case ARIZONA_FLL2_SYNCHRONISER_5: 878 + case ARIZONA_FLL2_SYNCHRONISER_6: 879 + case ARIZONA_FLL2_SPREAD_SPECTRUM: 880 + case ARIZONA_FLL2_GPIO_CLOCK: 881 + case ARIZONA_MIC_CHARGE_PUMP_1: 882 + case ARIZONA_LDO1_CONTROL_1: 883 + case ARIZONA_LDO2_CONTROL_1: 884 + case ARIZONA_MIC_BIAS_CTRL_1: 885 + case ARIZONA_MIC_BIAS_CTRL_2: 886 + case ARIZONA_MIC_BIAS_CTRL_3: 887 + case ARIZONA_ACCESSORY_DETECT_MODE_1: 888 + case ARIZONA_HEADPHONE_DETECT_1: 889 + case ARIZONA_HEADPHONE_DETECT_2: 890 + case ARIZONA_MIC_DETECT_1: 891 + case ARIZONA_MIC_DETECT_2: 892 + case ARIZONA_MIC_DETECT_3: 893 + case ARIZONA_MIC_NOISE_MIX_CONTROL_1: 894 + case ARIZONA_ISOLATION_CONTROL: 895 + case ARIZONA_JACK_DETECT_ANALOGUE: 896 + case ARIZONA_INPUT_ENABLES: 897 + case ARIZONA_INPUT_ENABLES_STATUS: 898 + case ARIZONA_INPUT_RATE: 899 + case ARIZONA_INPUT_VOLUME_RAMP: 900 + case ARIZONA_IN1L_CONTROL: 901 + case ARIZONA_ADC_DIGITAL_VOLUME_1L: 902 + case ARIZONA_DMIC1L_CONTROL: 903 + case ARIZONA_IN1R_CONTROL: 904 + case ARIZONA_ADC_DIGITAL_VOLUME_1R: 905 + case ARIZONA_DMIC1R_CONTROL: 906 + case ARIZONA_IN2L_CONTROL: 907 + case ARIZONA_ADC_DIGITAL_VOLUME_2L: 908 + case ARIZONA_DMIC2L_CONTROL: 909 + case ARIZONA_IN2R_CONTROL: 910 + case ARIZONA_ADC_DIGITAL_VOLUME_2R: 911 + case ARIZONA_DMIC2R_CONTROL: 912 + case ARIZONA_OUTPUT_ENABLES_1: 913 + case ARIZONA_OUTPUT_STATUS_1: 914 + case ARIZONA_RAW_OUTPUT_STATUS_1: 915 + case ARIZONA_OUTPUT_RATE_1: 916 + case ARIZONA_OUTPUT_VOLUME_RAMP: 917 + case ARIZONA_OUTPUT_PATH_CONFIG_1L: 918 + case ARIZONA_DAC_DIGITAL_VOLUME_1L: 919 + case ARIZONA_DAC_VOLUME_LIMIT_1L: 920 + case ARIZONA_NOISE_GATE_SELECT_1L: 921 + case ARIZONA_OUTPUT_PATH_CONFIG_1R: 922 + case ARIZONA_DAC_DIGITAL_VOLUME_1R: 923 + case ARIZONA_DAC_VOLUME_LIMIT_1R: 924 + case ARIZONA_NOISE_GATE_SELECT_1R: 925 + case ARIZONA_OUTPUT_PATH_CONFIG_3L: 926 + case ARIZONA_DAC_DIGITAL_VOLUME_3L: 927 + case ARIZONA_DAC_VOLUME_LIMIT_3L: 928 + case ARIZONA_NOISE_GATE_SELECT_3L: 929 + case ARIZONA_OUTPUT_PATH_CONFIG_4L: 930 + case ARIZONA_DAC_DIGITAL_VOLUME_4L: 931 + case ARIZONA_OUT_VOLUME_4L: 932 + case ARIZONA_NOISE_GATE_SELECT_4L: 933 + case ARIZONA_OUTPUT_PATH_CONFIG_5L: 934 + case ARIZONA_DAC_DIGITAL_VOLUME_5L: 935 + case ARIZONA_DAC_VOLUME_LIMIT_5L: 936 + case ARIZONA_NOISE_GATE_SELECT_5L: 937 + case ARIZONA_DAC_DIGITAL_VOLUME_5R: 938 + case ARIZONA_DAC_VOLUME_LIMIT_5R: 939 + case ARIZONA_NOISE_GATE_SELECT_5R: 940 + case ARIZONA_DAC_AEC_CONTROL_1: 941 + case ARIZONA_NOISE_GATE_CONTROL: 942 + case ARIZONA_PDM_SPK1_CTRL_1: 943 + case ARIZONA_PDM_SPK1_CTRL_2: 944 + case ARIZONA_AIF1_BCLK_CTRL: 945 + case ARIZONA_AIF1_TX_PIN_CTRL: 946 + case ARIZONA_AIF1_RX_PIN_CTRL: 947 + case ARIZONA_AIF1_RATE_CTRL: 948 + case ARIZONA_AIF1_FORMAT: 949 + case ARIZONA_AIF1_TX_BCLK_RATE: 950 + case ARIZONA_AIF1_RX_BCLK_RATE: 951 + case ARIZONA_AIF1_FRAME_CTRL_1: 952 + case ARIZONA_AIF1_FRAME_CTRL_2: 953 + case ARIZONA_AIF1_FRAME_CTRL_3: 954 + case ARIZONA_AIF1_FRAME_CTRL_4: 955 + case ARIZONA_AIF1_FRAME_CTRL_5: 956 + case ARIZONA_AIF1_FRAME_CTRL_6: 957 + case ARIZONA_AIF1_FRAME_CTRL_7: 958 + case ARIZONA_AIF1_FRAME_CTRL_8: 959 + case ARIZONA_AIF1_FRAME_CTRL_9: 960 + case ARIZONA_AIF1_FRAME_CTRL_10: 961 + case ARIZONA_AIF1_FRAME_CTRL_11: 962 + case ARIZONA_AIF1_FRAME_CTRL_12: 963 + case ARIZONA_AIF1_FRAME_CTRL_13: 964 + case ARIZONA_AIF1_FRAME_CTRL_14: 965 + case ARIZONA_AIF1_FRAME_CTRL_15: 966 + case ARIZONA_AIF1_FRAME_CTRL_16: 967 + case ARIZONA_AIF1_FRAME_CTRL_17: 968 + case ARIZONA_AIF1_FRAME_CTRL_18: 969 + case ARIZONA_AIF1_TX_ENABLES: 970 + case ARIZONA_AIF1_RX_ENABLES: 971 + case ARIZONA_AIF2_BCLK_CTRL: 972 + case ARIZONA_AIF2_TX_PIN_CTRL: 973 + case ARIZONA_AIF2_RX_PIN_CTRL: 974 + case ARIZONA_AIF2_RATE_CTRL: 975 + case ARIZONA_AIF2_FORMAT: 976 + case ARIZONA_AIF2_TX_BCLK_RATE: 977 + case ARIZONA_AIF2_RX_BCLK_RATE: 978 + case ARIZONA_AIF2_FRAME_CTRL_1: 979 + case ARIZONA_AIF2_FRAME_CTRL_2: 980 + case ARIZONA_AIF2_FRAME_CTRL_3: 981 + case ARIZONA_AIF2_FRAME_CTRL_4: 982 + case ARIZONA_AIF2_FRAME_CTRL_11: 983 + case ARIZONA_AIF2_FRAME_CTRL_12: 984 + case ARIZONA_AIF2_TX_ENABLES: 985 + case ARIZONA_AIF2_RX_ENABLES: 986 + case ARIZONA_SLIMBUS_FRAMER_REF_GEAR: 987 + case ARIZONA_SLIMBUS_RATES_1: 988 + case ARIZONA_SLIMBUS_RATES_2: 989 + case ARIZONA_SLIMBUS_RATES_3: 990 + case ARIZONA_SLIMBUS_RATES_4: 991 + case ARIZONA_SLIMBUS_RATES_5: 992 + case ARIZONA_SLIMBUS_RATES_6: 993 + case ARIZONA_SLIMBUS_RATES_7: 994 + case ARIZONA_SLIMBUS_RATES_8: 995 + case ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE: 996 + case ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE: 997 + case ARIZONA_SLIMBUS_RX_PORT_STATUS: 998 + case ARIZONA_SLIMBUS_TX_PORT_STATUS: 999 + case ARIZONA_PWM1MIX_INPUT_1_SOURCE: 1000 + case ARIZONA_PWM1MIX_INPUT_1_VOLUME: 1001 + case ARIZONA_PWM1MIX_INPUT_2_SOURCE: 1002 + case ARIZONA_PWM1MIX_INPUT_2_VOLUME: 1003 + case ARIZONA_PWM1MIX_INPUT_3_SOURCE: 1004 + case ARIZONA_PWM1MIX_INPUT_3_VOLUME: 1005 + case ARIZONA_PWM1MIX_INPUT_4_SOURCE: 1006 + case ARIZONA_PWM1MIX_INPUT_4_VOLUME: 1007 + case ARIZONA_PWM2MIX_INPUT_1_SOURCE: 1008 + case ARIZONA_PWM2MIX_INPUT_1_VOLUME: 1009 + case ARIZONA_PWM2MIX_INPUT_2_SOURCE: 1010 + case ARIZONA_PWM2MIX_INPUT_2_VOLUME: 1011 + case ARIZONA_PWM2MIX_INPUT_3_SOURCE: 1012 + case ARIZONA_PWM2MIX_INPUT_3_VOLUME: 1013 + case ARIZONA_PWM2MIX_INPUT_4_SOURCE: 1014 + case ARIZONA_PWM2MIX_INPUT_4_VOLUME: 1015 + case ARIZONA_MICMIX_INPUT_1_SOURCE: 1016 + case ARIZONA_MICMIX_INPUT_1_VOLUME: 1017 + case ARIZONA_MICMIX_INPUT_2_SOURCE: 1018 + case ARIZONA_MICMIX_INPUT_2_VOLUME: 1019 + case ARIZONA_MICMIX_INPUT_3_SOURCE: 1020 + case ARIZONA_MICMIX_INPUT_3_VOLUME: 1021 + case ARIZONA_MICMIX_INPUT_4_SOURCE: 1022 + case ARIZONA_MICMIX_INPUT_4_VOLUME: 1023 + case ARIZONA_NOISEMIX_INPUT_1_SOURCE: 1024 + case ARIZONA_NOISEMIX_INPUT_1_VOLUME: 1025 + case ARIZONA_NOISEMIX_INPUT_2_SOURCE: 1026 + case ARIZONA_NOISEMIX_INPUT_2_VOLUME: 1027 + case ARIZONA_NOISEMIX_INPUT_3_SOURCE: 1028 + case ARIZONA_NOISEMIX_INPUT_3_VOLUME: 1029 + case ARIZONA_NOISEMIX_INPUT_4_SOURCE: 1030 + case ARIZONA_NOISEMIX_INPUT_4_VOLUME: 1031 + case ARIZONA_OUT1LMIX_INPUT_1_SOURCE: 1032 + case ARIZONA_OUT1LMIX_INPUT_1_VOLUME: 1033 + case ARIZONA_OUT1LMIX_INPUT_2_SOURCE: 1034 + case ARIZONA_OUT1LMIX_INPUT_2_VOLUME: 1035 + case ARIZONA_OUT1LMIX_INPUT_3_SOURCE: 1036 + case ARIZONA_OUT1LMIX_INPUT_3_VOLUME: 1037 + case ARIZONA_OUT1LMIX_INPUT_4_SOURCE: 1038 + case ARIZONA_OUT1LMIX_INPUT_4_VOLUME: 1039 + case ARIZONA_OUT1RMIX_INPUT_1_SOURCE: 1040 + case ARIZONA_OUT1RMIX_INPUT_1_VOLUME: 1041 + case ARIZONA_OUT1RMIX_INPUT_2_SOURCE: 1042 + case ARIZONA_OUT1RMIX_INPUT_2_VOLUME: 1043 + case ARIZONA_OUT1RMIX_INPUT_3_SOURCE: 1044 + case ARIZONA_OUT1RMIX_INPUT_3_VOLUME: 1045 + case ARIZONA_OUT1RMIX_INPUT_4_SOURCE: 1046 + case ARIZONA_OUT1RMIX_INPUT_4_VOLUME: 1047 + case ARIZONA_OUT3LMIX_INPUT_1_SOURCE: 1048 + case ARIZONA_OUT3LMIX_INPUT_1_VOLUME: 1049 + case ARIZONA_OUT3LMIX_INPUT_2_SOURCE: 1050 + case ARIZONA_OUT3LMIX_INPUT_2_VOLUME: 1051 + case ARIZONA_OUT3LMIX_INPUT_3_SOURCE: 1052 + case ARIZONA_OUT3LMIX_INPUT_3_VOLUME: 1053 + case ARIZONA_OUT3LMIX_INPUT_4_SOURCE: 1054 + case ARIZONA_OUT3LMIX_INPUT_4_VOLUME: 1055 + case ARIZONA_OUT4LMIX_INPUT_1_SOURCE: 1056 + case ARIZONA_OUT4LMIX_INPUT_1_VOLUME: 1057 + case ARIZONA_OUT4LMIX_INPUT_2_SOURCE: 1058 + case ARIZONA_OUT4LMIX_INPUT_2_VOLUME: 1059 + case ARIZONA_OUT4LMIX_INPUT_3_SOURCE: 1060 + case ARIZONA_OUT4LMIX_INPUT_3_VOLUME: 1061 + case ARIZONA_OUT4LMIX_INPUT_4_SOURCE: 1062 + case ARIZONA_OUT4LMIX_INPUT_4_VOLUME: 1063 + case ARIZONA_OUT5LMIX_INPUT_1_SOURCE: 1064 + case ARIZONA_OUT5LMIX_INPUT_1_VOLUME: 1065 + case ARIZONA_OUT5LMIX_INPUT_2_SOURCE: 1066 + case ARIZONA_OUT5LMIX_INPUT_2_VOLUME: 1067 + case ARIZONA_OUT5LMIX_INPUT_3_SOURCE: 1068 + case ARIZONA_OUT5LMIX_INPUT_3_VOLUME: 1069 + case ARIZONA_OUT5LMIX_INPUT_4_SOURCE: 1070 + case ARIZONA_OUT5LMIX_INPUT_4_VOLUME: 1071 + case ARIZONA_OUT5RMIX_INPUT_1_SOURCE: 1072 + case ARIZONA_OUT5RMIX_INPUT_1_VOLUME: 1073 + case ARIZONA_OUT5RMIX_INPUT_2_SOURCE: 1074 + case ARIZONA_OUT5RMIX_INPUT_2_VOLUME: 1075 + case ARIZONA_OUT5RMIX_INPUT_3_SOURCE: 1076 + case ARIZONA_OUT5RMIX_INPUT_3_VOLUME: 1077 + case ARIZONA_OUT5RMIX_INPUT_4_SOURCE: 1078 + case ARIZONA_OUT5RMIX_INPUT_4_VOLUME: 1079 + case ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE: 1080 + case ARIZONA_AIF1TX1MIX_INPUT_1_VOLUME: 1081 + case ARIZONA_AIF1TX1MIX_INPUT_2_SOURCE: 1082 + case ARIZONA_AIF1TX1MIX_INPUT_2_VOLUME: 1083 + case ARIZONA_AIF1TX1MIX_INPUT_3_SOURCE: 1084 + case ARIZONA_AIF1TX1MIX_INPUT_3_VOLUME: 1085 + case ARIZONA_AIF1TX1MIX_INPUT_4_SOURCE: 1086 + case ARIZONA_AIF1TX1MIX_INPUT_4_VOLUME: 1087 + case ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE: 1088 + case ARIZONA_AIF1TX2MIX_INPUT_1_VOLUME: 1089 + case ARIZONA_AIF1TX2MIX_INPUT_2_SOURCE: 1090 + case ARIZONA_AIF1TX2MIX_INPUT_2_VOLUME: 1091 + case ARIZONA_AIF1TX2MIX_INPUT_3_SOURCE: 1092 + case ARIZONA_AIF1TX2MIX_INPUT_3_VOLUME: 1093 + case ARIZONA_AIF1TX2MIX_INPUT_4_SOURCE: 1094 + case ARIZONA_AIF1TX2MIX_INPUT_4_VOLUME: 1095 + case ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE: 1096 + case ARIZONA_AIF1TX3MIX_INPUT_1_VOLUME: 1097 + case ARIZONA_AIF1TX3MIX_INPUT_2_SOURCE: 1098 + case ARIZONA_AIF1TX3MIX_INPUT_2_VOLUME: 1099 + case ARIZONA_AIF1TX3MIX_INPUT_3_SOURCE: 1100 + case ARIZONA_AIF1TX3MIX_INPUT_3_VOLUME: 1101 + case ARIZONA_AIF1TX3MIX_INPUT_4_SOURCE: 1102 + case ARIZONA_AIF1TX3MIX_INPUT_4_VOLUME: 1103 + case ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE: 1104 + case ARIZONA_AIF1TX4MIX_INPUT_1_VOLUME: 1105 + case ARIZONA_AIF1TX4MIX_INPUT_2_SOURCE: 1106 + case ARIZONA_AIF1TX4MIX_INPUT_2_VOLUME: 1107 + case ARIZONA_AIF1TX4MIX_INPUT_3_SOURCE: 1108 + case ARIZONA_AIF1TX4MIX_INPUT_3_VOLUME: 1109 + case ARIZONA_AIF1TX4MIX_INPUT_4_SOURCE: 1110 + case ARIZONA_AIF1TX4MIX_INPUT_4_VOLUME: 1111 + case ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE: 1112 + case ARIZONA_AIF1TX5MIX_INPUT_1_VOLUME: 1113 + case ARIZONA_AIF1TX5MIX_INPUT_2_SOURCE: 1114 + case ARIZONA_AIF1TX5MIX_INPUT_2_VOLUME: 1115 + case ARIZONA_AIF1TX5MIX_INPUT_3_SOURCE: 1116 + case ARIZONA_AIF1TX5MIX_INPUT_3_VOLUME: 1117 + case ARIZONA_AIF1TX5MIX_INPUT_4_SOURCE: 1118 + case ARIZONA_AIF1TX5MIX_INPUT_4_VOLUME: 1119 + case ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE: 1120 + case ARIZONA_AIF1TX6MIX_INPUT_1_VOLUME: 1121 + case ARIZONA_AIF1TX6MIX_INPUT_2_SOURCE: 1122 + case ARIZONA_AIF1TX6MIX_INPUT_2_VOLUME: 1123 + case ARIZONA_AIF1TX6MIX_INPUT_3_SOURCE: 1124 + case ARIZONA_AIF1TX6MIX_INPUT_3_VOLUME: 1125 + case ARIZONA_AIF1TX6MIX_INPUT_4_SOURCE: 1126 + case ARIZONA_AIF1TX6MIX_INPUT_4_VOLUME: 1127 + case ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE: 1128 + case ARIZONA_AIF1TX7MIX_INPUT_1_VOLUME: 1129 + case ARIZONA_AIF1TX7MIX_INPUT_2_SOURCE: 1130 + case ARIZONA_AIF1TX7MIX_INPUT_2_VOLUME: 1131 + case ARIZONA_AIF1TX7MIX_INPUT_3_SOURCE: 1132 + case ARIZONA_AIF1TX7MIX_INPUT_3_VOLUME: 1133 + case ARIZONA_AIF1TX7MIX_INPUT_4_SOURCE: 1134 + case ARIZONA_AIF1TX7MIX_INPUT_4_VOLUME: 1135 + case ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE: 1136 + case ARIZONA_AIF1TX8MIX_INPUT_1_VOLUME: 1137 + case ARIZONA_AIF1TX8MIX_INPUT_2_SOURCE: 1138 + case ARIZONA_AIF1TX8MIX_INPUT_2_VOLUME: 1139 + case ARIZONA_AIF1TX8MIX_INPUT_3_SOURCE: 1140 + case ARIZONA_AIF1TX8MIX_INPUT_3_VOLUME: 1141 + case ARIZONA_AIF1TX8MIX_INPUT_4_SOURCE: 1142 + case ARIZONA_AIF1TX8MIX_INPUT_4_VOLUME: 1143 + case ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE: 1144 + case ARIZONA_AIF2TX1MIX_INPUT_1_VOLUME: 1145 + case ARIZONA_AIF2TX1MIX_INPUT_2_SOURCE: 1146 + case ARIZONA_AIF2TX1MIX_INPUT_2_VOLUME: 1147 + case ARIZONA_AIF2TX1MIX_INPUT_3_SOURCE: 1148 + case ARIZONA_AIF2TX1MIX_INPUT_3_VOLUME: 1149 + case ARIZONA_AIF2TX1MIX_INPUT_4_SOURCE: 1150 + case ARIZONA_AIF2TX1MIX_INPUT_4_VOLUME: 1151 + case ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE: 1152 + case ARIZONA_AIF2TX2MIX_INPUT_1_VOLUME: 1153 + case ARIZONA_AIF2TX2MIX_INPUT_2_SOURCE: 1154 + case ARIZONA_AIF2TX2MIX_INPUT_2_VOLUME: 1155 + case ARIZONA_AIF2TX2MIX_INPUT_3_SOURCE: 1156 + case ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME: 1157 + case ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE: 1158 + case ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME: 1159 + case ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE: 1160 + case ARIZONA_SLIMTX1MIX_INPUT_1_VOLUME: 1161 + case ARIZONA_SLIMTX1MIX_INPUT_2_SOURCE: 1162 + case ARIZONA_SLIMTX1MIX_INPUT_2_VOLUME: 1163 + case ARIZONA_SLIMTX1MIX_INPUT_3_SOURCE: 1164 + case ARIZONA_SLIMTX1MIX_INPUT_3_VOLUME: 1165 + case ARIZONA_SLIMTX1MIX_INPUT_4_SOURCE: 1166 + case ARIZONA_SLIMTX1MIX_INPUT_4_VOLUME: 1167 + case ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE: 1168 + case ARIZONA_SLIMTX2MIX_INPUT_1_VOLUME: 1169 + case ARIZONA_SLIMTX2MIX_INPUT_2_SOURCE: 1170 + case ARIZONA_SLIMTX2MIX_INPUT_2_VOLUME: 1171 + case ARIZONA_SLIMTX2MIX_INPUT_3_SOURCE: 1172 + case ARIZONA_SLIMTX2MIX_INPUT_3_VOLUME: 1173 + case ARIZONA_SLIMTX2MIX_INPUT_4_SOURCE: 1174 + case ARIZONA_SLIMTX2MIX_INPUT_4_VOLUME: 1175 + case ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE: 1176 + case ARIZONA_SLIMTX3MIX_INPUT_1_VOLUME: 1177 + case ARIZONA_SLIMTX3MIX_INPUT_2_SOURCE: 1178 + case ARIZONA_SLIMTX3MIX_INPUT_2_VOLUME: 1179 + case ARIZONA_SLIMTX3MIX_INPUT_3_SOURCE: 1180 + case ARIZONA_SLIMTX3MIX_INPUT_3_VOLUME: 1181 + case ARIZONA_SLIMTX3MIX_INPUT_4_SOURCE: 1182 + case ARIZONA_SLIMTX3MIX_INPUT_4_VOLUME: 1183 + case ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE: 1184 + case ARIZONA_SLIMTX4MIX_INPUT_1_VOLUME: 1185 + case ARIZONA_SLIMTX4MIX_INPUT_2_SOURCE: 1186 + case ARIZONA_SLIMTX4MIX_INPUT_2_VOLUME: 1187 + case ARIZONA_SLIMTX4MIX_INPUT_3_SOURCE: 1188 + case ARIZONA_SLIMTX4MIX_INPUT_3_VOLUME: 1189 + case ARIZONA_SLIMTX4MIX_INPUT_4_SOURCE: 1190 + case ARIZONA_SLIMTX4MIX_INPUT_4_VOLUME: 1191 + case ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE: 1192 + case ARIZONA_SLIMTX5MIX_INPUT_1_VOLUME: 1193 + case ARIZONA_SLIMTX5MIX_INPUT_2_SOURCE: 1194 + case ARIZONA_SLIMTX5MIX_INPUT_2_VOLUME: 1195 + case ARIZONA_SLIMTX5MIX_INPUT_3_SOURCE: 1196 + case ARIZONA_SLIMTX5MIX_INPUT_3_VOLUME: 1197 + case ARIZONA_SLIMTX5MIX_INPUT_4_SOURCE: 1198 + case ARIZONA_SLIMTX5MIX_INPUT_4_VOLUME: 1199 + case ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE: 1200 + case ARIZONA_SLIMTX6MIX_INPUT_1_VOLUME: 1201 + case ARIZONA_SLIMTX6MIX_INPUT_2_SOURCE: 1202 + case ARIZONA_SLIMTX6MIX_INPUT_2_VOLUME: 1203 + case ARIZONA_SLIMTX6MIX_INPUT_3_SOURCE: 1204 + case ARIZONA_SLIMTX6MIX_INPUT_3_VOLUME: 1205 + case ARIZONA_SLIMTX6MIX_INPUT_4_SOURCE: 1206 + case ARIZONA_SLIMTX6MIX_INPUT_4_VOLUME: 1207 + case ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE: 1208 + case ARIZONA_SLIMTX7MIX_INPUT_1_VOLUME: 1209 + case ARIZONA_SLIMTX7MIX_INPUT_2_SOURCE: 1210 + case ARIZONA_SLIMTX7MIX_INPUT_2_VOLUME: 1211 + case ARIZONA_SLIMTX7MIX_INPUT_3_SOURCE: 1212 + case ARIZONA_SLIMTX7MIX_INPUT_3_VOLUME: 1213 + case ARIZONA_SLIMTX7MIX_INPUT_4_SOURCE: 1214 + case ARIZONA_SLIMTX7MIX_INPUT_4_VOLUME: 1215 + case ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE: 1216 + case ARIZONA_SLIMTX8MIX_INPUT_1_VOLUME: 1217 + case ARIZONA_SLIMTX8MIX_INPUT_2_SOURCE: 1218 + case ARIZONA_SLIMTX8MIX_INPUT_2_VOLUME: 1219 + case ARIZONA_SLIMTX8MIX_INPUT_3_SOURCE: 1220 + case ARIZONA_SLIMTX8MIX_INPUT_3_VOLUME: 1221 + case ARIZONA_SLIMTX8MIX_INPUT_4_SOURCE: 1222 + case ARIZONA_SLIMTX8MIX_INPUT_4_VOLUME: 1223 + case ARIZONA_EQ1MIX_INPUT_1_SOURCE: 1224 + case ARIZONA_EQ1MIX_INPUT_1_VOLUME: 1225 + case ARIZONA_EQ1MIX_INPUT_2_SOURCE: 1226 + case ARIZONA_EQ1MIX_INPUT_2_VOLUME: 1227 + case ARIZONA_EQ1MIX_INPUT_3_SOURCE: 1228 + case ARIZONA_EQ1MIX_INPUT_3_VOLUME: 1229 + case ARIZONA_EQ1MIX_INPUT_4_SOURCE: 1230 + case ARIZONA_EQ1MIX_INPUT_4_VOLUME: 1231 + case ARIZONA_EQ2MIX_INPUT_1_SOURCE: 1232 + case ARIZONA_EQ2MIX_INPUT_1_VOLUME: 1233 + case ARIZONA_EQ2MIX_INPUT_2_SOURCE: 1234 + case ARIZONA_EQ2MIX_INPUT_2_VOLUME: 1235 + case ARIZONA_EQ2MIX_INPUT_3_SOURCE: 1236 + case ARIZONA_EQ2MIX_INPUT_3_VOLUME: 1237 + case ARIZONA_EQ2MIX_INPUT_4_SOURCE: 1238 + case ARIZONA_EQ2MIX_INPUT_4_VOLUME: 1239 + case ARIZONA_EQ3MIX_INPUT_1_SOURCE: 1240 + case ARIZONA_EQ3MIX_INPUT_1_VOLUME: 1241 + case ARIZONA_EQ3MIX_INPUT_2_SOURCE: 1242 + case ARIZONA_EQ3MIX_INPUT_2_VOLUME: 1243 + case ARIZONA_EQ3MIX_INPUT_3_SOURCE: 1244 + case ARIZONA_EQ3MIX_INPUT_3_VOLUME: 1245 + case ARIZONA_EQ3MIX_INPUT_4_SOURCE: 1246 + case ARIZONA_EQ3MIX_INPUT_4_VOLUME: 1247 + case ARIZONA_EQ4MIX_INPUT_1_SOURCE: 1248 + case ARIZONA_EQ4MIX_INPUT_1_VOLUME: 1249 + case ARIZONA_EQ4MIX_INPUT_2_SOURCE: 1250 + case ARIZONA_EQ4MIX_INPUT_2_VOLUME: 1251 + case ARIZONA_EQ4MIX_INPUT_3_SOURCE: 1252 + case ARIZONA_EQ4MIX_INPUT_3_VOLUME: 1253 + case ARIZONA_EQ4MIX_INPUT_4_SOURCE: 1254 + case ARIZONA_EQ4MIX_INPUT_4_VOLUME: 1255 + case ARIZONA_DRC1LMIX_INPUT_1_SOURCE: 1256 + case ARIZONA_DRC1LMIX_INPUT_1_VOLUME: 1257 + case ARIZONA_DRC1LMIX_INPUT_2_SOURCE: 1258 + case ARIZONA_DRC1LMIX_INPUT_2_VOLUME: 1259 + case ARIZONA_DRC1LMIX_INPUT_3_SOURCE: 1260 + case ARIZONA_DRC1LMIX_INPUT_3_VOLUME: 1261 + case ARIZONA_DRC1LMIX_INPUT_4_SOURCE: 1262 + case ARIZONA_DRC1LMIX_INPUT_4_VOLUME: 1263 + case ARIZONA_DRC1RMIX_INPUT_1_SOURCE: 1264 + case ARIZONA_DRC1RMIX_INPUT_1_VOLUME: 1265 + case ARIZONA_DRC1RMIX_INPUT_2_SOURCE: 1266 + case ARIZONA_DRC1RMIX_INPUT_2_VOLUME: 1267 + case ARIZONA_DRC1RMIX_INPUT_3_SOURCE: 1268 + case ARIZONA_DRC1RMIX_INPUT_3_VOLUME: 1269 + case ARIZONA_DRC1RMIX_INPUT_4_SOURCE: 1270 + case ARIZONA_DRC1RMIX_INPUT_4_VOLUME: 1271 + case ARIZONA_HPLP1MIX_INPUT_1_SOURCE: 1272 + case ARIZONA_HPLP1MIX_INPUT_1_VOLUME: 1273 + case ARIZONA_HPLP1MIX_INPUT_2_SOURCE: 1274 + case ARIZONA_HPLP1MIX_INPUT_2_VOLUME: 1275 + case ARIZONA_HPLP1MIX_INPUT_3_SOURCE: 1276 + case ARIZONA_HPLP1MIX_INPUT_3_VOLUME: 1277 + case ARIZONA_HPLP1MIX_INPUT_4_SOURCE: 1278 + case ARIZONA_HPLP1MIX_INPUT_4_VOLUME: 1279 + case ARIZONA_HPLP2MIX_INPUT_1_SOURCE: 1280 + case ARIZONA_HPLP2MIX_INPUT_1_VOLUME: 1281 + case ARIZONA_HPLP2MIX_INPUT_2_SOURCE: 1282 + case ARIZONA_HPLP2MIX_INPUT_2_VOLUME: 1283 + case ARIZONA_HPLP2MIX_INPUT_3_SOURCE: 1284 + case ARIZONA_HPLP2MIX_INPUT_3_VOLUME: 1285 + case ARIZONA_HPLP2MIX_INPUT_4_SOURCE: 1286 + case ARIZONA_HPLP2MIX_INPUT_4_VOLUME: 1287 + case ARIZONA_HPLP3MIX_INPUT_1_SOURCE: 1288 + case ARIZONA_HPLP3MIX_INPUT_1_VOLUME: 1289 + case ARIZONA_HPLP3MIX_INPUT_2_SOURCE: 1290 + case ARIZONA_HPLP3MIX_INPUT_2_VOLUME: 1291 + case ARIZONA_HPLP3MIX_INPUT_3_SOURCE: 1292 + case ARIZONA_HPLP3MIX_INPUT_3_VOLUME: 1293 + case ARIZONA_HPLP3MIX_INPUT_4_SOURCE: 1294 + case ARIZONA_HPLP3MIX_INPUT_4_VOLUME: 1295 + case ARIZONA_HPLP4MIX_INPUT_1_SOURCE: 1296 + case ARIZONA_HPLP4MIX_INPUT_1_VOLUME: 1297 + case ARIZONA_HPLP4MIX_INPUT_2_SOURCE: 1298 + case ARIZONA_HPLP4MIX_INPUT_2_VOLUME: 1299 + case ARIZONA_HPLP4MIX_INPUT_3_SOURCE: 1300 + case ARIZONA_HPLP4MIX_INPUT_3_VOLUME: 1301 + case ARIZONA_HPLP4MIX_INPUT_4_SOURCE: 1302 + case ARIZONA_HPLP4MIX_INPUT_4_VOLUME: 1303 + case ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE: 1304 + case ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE: 1305 + case ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE: 1306 + case ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE: 1307 + case ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE: 1308 + case ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE: 1309 + case ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE: 1310 + case ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE: 1311 + case ARIZONA_GPIO1_CTRL: 1312 + case ARIZONA_GPIO2_CTRL: 1313 + case ARIZONA_GPIO3_CTRL: 1314 + case ARIZONA_GPIO4_CTRL: 1315 + case ARIZONA_GPIO5_CTRL: 1316 + case ARIZONA_IRQ_CTRL_1: 1317 + case ARIZONA_GPIO_DEBOUNCE_CONFIG: 1318 + case ARIZONA_MISC_PAD_CTRL_1: 1319 + case ARIZONA_MISC_PAD_CTRL_2: 1320 + case ARIZONA_MISC_PAD_CTRL_3: 1321 + case ARIZONA_MISC_PAD_CTRL_4: 1322 + case ARIZONA_MISC_PAD_CTRL_5: 1323 + case ARIZONA_INTERRUPT_STATUS_1: 1324 + case ARIZONA_INTERRUPT_STATUS_2: 1325 + case ARIZONA_INTERRUPT_STATUS_3: 1326 + case ARIZONA_INTERRUPT_STATUS_4: 1327 + case ARIZONA_INTERRUPT_STATUS_5: 1328 + case ARIZONA_INTERRUPT_STATUS_1_MASK: 1329 + case ARIZONA_INTERRUPT_STATUS_3_MASK: 1330 + case ARIZONA_INTERRUPT_STATUS_4_MASK: 1331 + case ARIZONA_INTERRUPT_STATUS_5_MASK: 1332 + case ARIZONA_INTERRUPT_CONTROL: 1333 + case ARIZONA_IRQ2_STATUS_1: 1334 + case ARIZONA_IRQ2_STATUS_3: 1335 + case ARIZONA_IRQ2_STATUS_4: 1336 + case ARIZONA_IRQ2_STATUS_5: 1337 + case ARIZONA_IRQ2_STATUS_1_MASK: 1338 + case ARIZONA_IRQ2_STATUS_3_MASK: 1339 + case ARIZONA_IRQ2_STATUS_4_MASK: 1340 + case ARIZONA_IRQ2_STATUS_5_MASK: 1341 + case ARIZONA_IRQ2_CONTROL: 1342 + case ARIZONA_INTERRUPT_RAW_STATUS_3: 1343 + case ARIZONA_INTERRUPT_RAW_STATUS_4: 1344 + case ARIZONA_INTERRUPT_RAW_STATUS_5: 1345 + case ARIZONA_INTERRUPT_RAW_STATUS_6: 1346 + case ARIZONA_INTERRUPT_RAW_STATUS_7: 1347 + case ARIZONA_INTERRUPT_RAW_STATUS_8: 1348 + case ARIZONA_IRQ_PIN_STATUS: 1349 + case ARIZONA_AOD_WKUP_AND_TRIG: 1350 + case ARIZONA_AOD_IRQ1: 1351 + case ARIZONA_AOD_IRQ2: 1352 + case ARIZONA_AOD_IRQ_MASK_IRQ1: 1353 + case ARIZONA_AOD_IRQ_MASK_IRQ2: 1354 + case ARIZONA_AOD_IRQ_RAW_STATUS: 1355 + case ARIZONA_JACK_DETECT_DEBOUNCE: 1356 + case ARIZONA_FX_CTRL1: 1357 + case ARIZONA_FX_CTRL2: 1358 + case ARIZONA_EQ1_1: 1359 + case ARIZONA_EQ1_2: 1360 + case ARIZONA_EQ1_3: 1361 + case ARIZONA_EQ1_4: 1362 + case ARIZONA_EQ1_5: 1363 + case ARIZONA_EQ1_6: 1364 + case ARIZONA_EQ1_7: 1365 + case ARIZONA_EQ1_8: 1366 + case ARIZONA_EQ1_9: 1367 + case ARIZONA_EQ1_10: 1368 + case ARIZONA_EQ1_11: 1369 + case ARIZONA_EQ1_12: 1370 + case ARIZONA_EQ1_13: 1371 + case ARIZONA_EQ1_14: 1372 + case ARIZONA_EQ1_15: 1373 + case ARIZONA_EQ1_16: 1374 + case ARIZONA_EQ1_17: 1375 + case ARIZONA_EQ1_18: 1376 + case ARIZONA_EQ1_19: 1377 + case ARIZONA_EQ1_20: 1378 + case ARIZONA_EQ1_21: 1379 + case ARIZONA_EQ2_1: 1380 + case ARIZONA_EQ2_2: 1381 + case ARIZONA_EQ2_3: 1382 + case ARIZONA_EQ2_4: 1383 + case ARIZONA_EQ2_5: 1384 + case ARIZONA_EQ2_6: 1385 + case ARIZONA_EQ2_7: 1386 + case ARIZONA_EQ2_8: 1387 + case ARIZONA_EQ2_9: 1388 + case ARIZONA_EQ2_10: 1389 + case ARIZONA_EQ2_11: 1390 + case ARIZONA_EQ2_12: 1391 + case ARIZONA_EQ2_13: 1392 + case ARIZONA_EQ2_14: 1393 + case ARIZONA_EQ2_15: 1394 + case ARIZONA_EQ2_16: 1395 + case ARIZONA_EQ2_17: 1396 + case ARIZONA_EQ2_18: 1397 + case ARIZONA_EQ2_19: 1398 + case ARIZONA_EQ2_20: 1399 + case ARIZONA_EQ2_21: 1400 + case ARIZONA_EQ3_1: 1401 + case ARIZONA_EQ3_2: 1402 + case ARIZONA_EQ3_3: 1403 + case ARIZONA_EQ3_4: 1404 + case ARIZONA_EQ3_5: 1405 + case ARIZONA_EQ3_6: 1406 + case ARIZONA_EQ3_7: 1407 + case ARIZONA_EQ3_8: 1408 + case ARIZONA_EQ3_9: 1409 + case ARIZONA_EQ3_10: 1410 + case ARIZONA_EQ3_11: 1411 + case ARIZONA_EQ3_12: 1412 + case ARIZONA_EQ3_13: 1413 + case ARIZONA_EQ3_14: 1414 + case ARIZONA_EQ3_15: 1415 + case ARIZONA_EQ3_16: 1416 + case ARIZONA_EQ3_17: 1417 + case ARIZONA_EQ3_18: 1418 + case ARIZONA_EQ3_19: 1419 + case ARIZONA_EQ3_20: 1420 + case ARIZONA_EQ3_21: 1421 + case ARIZONA_EQ4_1: 1422 + case ARIZONA_EQ4_2: 1423 + case ARIZONA_EQ4_3: 1424 + case ARIZONA_EQ4_4: 1425 + case ARIZONA_EQ4_5: 1426 + case ARIZONA_EQ4_6: 1427 + case ARIZONA_EQ4_7: 1428 + case ARIZONA_EQ4_8: 1429 + case ARIZONA_EQ4_9: 1430 + case ARIZONA_EQ4_10: 1431 + case ARIZONA_EQ4_11: 1432 + case ARIZONA_EQ4_12: 1433 + case ARIZONA_EQ4_13: 1434 + case ARIZONA_EQ4_14: 1435 + case ARIZONA_EQ4_15: 1436 + case ARIZONA_EQ4_16: 1437 + case ARIZONA_EQ4_17: 1438 + case ARIZONA_EQ4_18: 1439 + case ARIZONA_EQ4_19: 1440 + case ARIZONA_EQ4_20: 1441 + case ARIZONA_EQ4_21: 1442 + case ARIZONA_DRC1_CTRL1: 1443 + case ARIZONA_DRC1_CTRL2: 1444 + case ARIZONA_DRC1_CTRL3: 1445 + case ARIZONA_DRC1_CTRL4: 1446 + case ARIZONA_DRC1_CTRL5: 1447 + case ARIZONA_HPLPF1_1: 1448 + case ARIZONA_HPLPF1_2: 1449 + case ARIZONA_HPLPF2_1: 1450 + case ARIZONA_HPLPF2_2: 1451 + case ARIZONA_HPLPF3_1: 1452 + case ARIZONA_HPLPF3_2: 1453 + case ARIZONA_HPLPF4_1: 1454 + case ARIZONA_HPLPF4_2: 1455 + case ARIZONA_ISRC_1_CTRL_1: 1456 + case ARIZONA_ISRC_1_CTRL_2: 1457 + case ARIZONA_ISRC_1_CTRL_3: 1458 + case ARIZONA_ISRC_2_CTRL_1: 1459 + case ARIZONA_ISRC_2_CTRL_2: 1460 + case ARIZONA_ISRC_2_CTRL_3: 1461 + return true; 1462 + default: 1463 + return false; 1464 + } 1465 + } 1466 + 1467 + static bool wm8997_volatile_register(struct device *dev, unsigned int reg) 1468 + { 1469 + switch (reg) { 1470 + case ARIZONA_SOFTWARE_RESET: 1471 + case ARIZONA_DEVICE_REVISION: 1472 + case ARIZONA_HAPTICS_STATUS: 1473 + case ARIZONA_SAMPLE_RATE_1_STATUS: 1474 + case ARIZONA_SAMPLE_RATE_2_STATUS: 1475 + case ARIZONA_SAMPLE_RATE_3_STATUS: 1476 + case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1477 + case ARIZONA_MIC_DETECT_3: 1478 + case ARIZONA_HEADPHONE_DETECT_2: 1479 + case ARIZONA_INPUT_ENABLES_STATUS: 1480 + case ARIZONA_OUTPUT_STATUS_1: 1481 + case ARIZONA_RAW_OUTPUT_STATUS_1: 1482 + case ARIZONA_SLIMBUS_RX_PORT_STATUS: 1483 + case ARIZONA_SLIMBUS_TX_PORT_STATUS: 1484 + case ARIZONA_INTERRUPT_STATUS_1: 1485 + case ARIZONA_INTERRUPT_STATUS_2: 1486 + case ARIZONA_INTERRUPT_STATUS_3: 1487 + case ARIZONA_INTERRUPT_STATUS_4: 1488 + case ARIZONA_INTERRUPT_STATUS_5: 1489 + case ARIZONA_IRQ2_STATUS_1: 1490 + case ARIZONA_IRQ2_STATUS_3: 1491 + case ARIZONA_IRQ2_STATUS_4: 1492 + case ARIZONA_IRQ2_STATUS_5: 1493 + case ARIZONA_INTERRUPT_RAW_STATUS_3: 1494 + case ARIZONA_INTERRUPT_RAW_STATUS_4: 1495 + case ARIZONA_INTERRUPT_RAW_STATUS_5: 1496 + case ARIZONA_INTERRUPT_RAW_STATUS_6: 1497 + case ARIZONA_INTERRUPT_RAW_STATUS_7: 1498 + case ARIZONA_INTERRUPT_RAW_STATUS_8: 1499 + case ARIZONA_IRQ_PIN_STATUS: 1500 + case ARIZONA_AOD_WKUP_AND_TRIG: 1501 + case ARIZONA_AOD_IRQ1: 1502 + case ARIZONA_AOD_IRQ2: 1503 + case ARIZONA_AOD_IRQ_RAW_STATUS: 1504 + case ARIZONA_FX_CTRL2: 1505 + return true; 1506 + default: 1507 + return false; 1508 + } 1509 + } 1510 + 1511 + #define WM8997_MAX_REGISTER 0x31ff 1512 + 1513 + const struct regmap_config wm8997_i2c_regmap = { 1514 + .reg_bits = 32, 1515 + .val_bits = 16, 1516 + 1517 + .max_register = WM8997_MAX_REGISTER, 1518 + .readable_reg = wm8997_readable_register, 1519 + .volatile_reg = wm8997_volatile_register, 1520 + 1521 + .cache_type = REGCACHE_RBTREE, 1522 + .reg_defaults = wm8997_reg_default, 1523 + .num_reg_defaults = ARRAY_SIZE(wm8997_reg_default), 1524 + }; 1525 + EXPORT_SYMBOL_GPL(wm8997_i2c_regmap);
+154 -69
drivers/regulator/max8998.c
··· 28 28 #include <linux/slab.h> 29 29 #include <linux/interrupt.h> 30 30 #include <linux/mutex.h> 31 + #include <linux/of.h> 32 + #include <linux/of_gpio.h> 31 33 #include <linux/platform_device.h> 32 34 #include <linux/regulator/driver.h> 35 + #include <linux/regulator/of_regulator.h> 33 36 #include <linux/mfd/max8998.h> 34 37 #include <linux/mfd/max8998-private.h> 35 38 ··· 592 589 .type = REGULATOR_VOLTAGE, 593 590 .owner = THIS_MODULE, 594 591 }, { 595 - .name = "EN32KHz AP", 592 + .name = "EN32KHz-AP", 596 593 .id = MAX8998_EN32KHZ_AP, 597 594 .ops = &max8998_others_ops, 598 595 .type = REGULATOR_VOLTAGE, 599 596 .owner = THIS_MODULE, 600 597 }, { 601 - .name = "EN32KHz CP", 598 + .name = "EN32KHz-CP", 602 599 .id = MAX8998_EN32KHZ_CP, 603 600 .ops = &max8998_others_ops, 604 601 .type = REGULATOR_VOLTAGE, ··· 624 621 } 625 622 }; 626 623 624 + static int max8998_pmic_dt_parse_dvs_gpio(struct max8998_dev *iodev, 625 + struct max8998_platform_data *pdata, 626 + struct device_node *pmic_np) 627 + { 628 + int gpio; 629 + 630 + gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck1-dvs-gpios", 0); 631 + if (!gpio_is_valid(gpio)) { 632 + dev_err(iodev->dev, "invalid buck1 gpio[0]: %d\n", gpio); 633 + return -EINVAL; 634 + } 635 + pdata->buck1_set1 = gpio; 636 + 637 + gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck1-dvs-gpios", 1); 638 + if (!gpio_is_valid(gpio)) { 639 + dev_err(iodev->dev, "invalid buck1 gpio[1]: %d\n", gpio); 640 + return -EINVAL; 641 + } 642 + pdata->buck1_set2 = gpio; 643 + 644 + gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck2-dvs-gpio", 0); 645 + if (!gpio_is_valid(gpio)) { 646 + dev_err(iodev->dev, "invalid buck 2 gpio: %d\n", gpio); 647 + return -EINVAL; 648 + } 649 + pdata->buck2_set3 = gpio; 650 + 651 + return 0; 652 + } 653 + 654 + static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev, 655 + struct max8998_platform_data *pdata) 656 + { 657 + struct device_node *pmic_np = iodev->dev->of_node; 658 + struct device_node *regulators_np, *reg_np; 659 + struct max8998_regulator_data *rdata; 660 + unsigned int i; 661 + int ret; 662 + 663 + regulators_np = of_get_child_by_name(pmic_np, "regulators"); 664 + if (!regulators_np) { 665 + dev_err(iodev->dev, "could not find regulators sub-node\n"); 666 + return -EINVAL; 667 + } 668 + 669 + /* count the number of regulators to be supported in pmic */ 670 + pdata->num_regulators = of_get_child_count(regulators_np); 671 + 672 + rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * 673 + pdata->num_regulators, GFP_KERNEL); 674 + if (!rdata) 675 + return -ENOMEM; 676 + 677 + pdata->regulators = rdata; 678 + for (i = 0; i < ARRAY_SIZE(regulators); ++i) { 679 + reg_np = of_get_child_by_name(regulators_np, 680 + regulators[i].name); 681 + if (!reg_np) 682 + continue; 683 + 684 + rdata->id = regulators[i].id; 685 + rdata->initdata = of_get_regulator_init_data( 686 + iodev->dev, reg_np); 687 + rdata->reg_node = reg_np; 688 + ++rdata; 689 + } 690 + pdata->num_regulators = rdata - pdata->regulators; 691 + 692 + ret = max8998_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); 693 + if (ret) 694 + return -EINVAL; 695 + 696 + if (of_find_property(pmic_np, "max8998,pmic-buck-voltage-lock", NULL)) 697 + pdata->buck_voltage_lock = true; 698 + 699 + ret = of_property_read_u32(pmic_np, 700 + "max8998,pmic-buck1-default-dvs-idx", 701 + &pdata->buck1_default_idx); 702 + if (!ret && pdata->buck1_default_idx >= 4) { 703 + pdata->buck1_default_idx = 0; 704 + dev_warn(iodev->dev, "invalid value for default dvs index, using 0 instead\n"); 705 + } 706 + 707 + ret = of_property_read_u32(pmic_np, 708 + "max8998,pmic-buck2-default-dvs-idx", 709 + &pdata->buck2_default_idx); 710 + if (!ret && pdata->buck2_default_idx >= 2) { 711 + pdata->buck2_default_idx = 0; 712 + dev_warn(iodev->dev, "invalid value for default dvs index, using 0 instead\n"); 713 + } 714 + 715 + ret = of_property_read_u32_array(pmic_np, 716 + "max8998,pmic-buck1-dvs-voltage", 717 + pdata->buck1_voltage, 718 + ARRAY_SIZE(pdata->buck1_voltage)); 719 + if (ret) { 720 + dev_err(iodev->dev, "buck1 voltages not specified\n"); 721 + return -EINVAL; 722 + } 723 + 724 + ret = of_property_read_u32_array(pmic_np, 725 + "max8998,pmic-buck2-dvs-voltage", 726 + pdata->buck2_voltage, 727 + ARRAY_SIZE(pdata->buck2_voltage)); 728 + if (ret) { 729 + dev_err(iodev->dev, "buck2 voltages not specified\n"); 730 + return -EINVAL; 731 + } 732 + 733 + return 0; 734 + } 735 + 627 736 static int max8998_pmic_probe(struct platform_device *pdev) 628 737 { 629 738 struct max8998_dev *iodev = dev_get_drvdata(pdev->dev.parent); 630 - struct max8998_platform_data *pdata = dev_get_platdata(iodev->dev); 739 + struct max8998_platform_data *pdata = iodev->pdata; 631 740 struct regulator_config config = { }; 632 741 struct regulator_dev **rdev; 633 742 struct max8998_data *max8998; 634 743 struct i2c_client *i2c; 635 744 int i, ret, size; 745 + unsigned int v; 636 746 637 747 if (!pdata) { 638 748 dev_err(pdev->dev.parent, "No platform init data supplied\n"); 639 749 return -ENODEV; 750 + } 751 + 752 + if (IS_ENABLED(CONFIG_OF) && iodev->dev->of_node) { 753 + ret = max8998_pmic_dt_parse_pdata(iodev, pdata); 754 + if (ret) 755 + return ret; 640 756 } 641 757 642 758 max8998 = devm_kzalloc(&pdev->dev, sizeof(struct max8998_data), ··· 810 688 gpio_request(pdata->buck1_set2, "MAX8998 BUCK1_SET2"); 811 689 gpio_direction_output(pdata->buck1_set2, 812 690 (max8998->buck1_idx >> 1) & 0x1); 813 - /* Set predefined value for BUCK1 register 1 */ 814 - i = 0; 815 - while (buck12_voltage_map_desc.min + 816 - buck12_voltage_map_desc.step*i 817 - < pdata->buck1_voltage1) 818 - i++; 819 - max8998->buck1_vol[0] = i; 820 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE1, i); 821 - if (ret) 822 - goto err_out; 823 691 824 - /* Set predefined value for BUCK1 register 2 */ 825 - i = 0; 826 - while (buck12_voltage_map_desc.min + 827 - buck12_voltage_map_desc.step*i 828 - < pdata->buck1_voltage2) 829 - i++; 692 + /* Set predefined values for BUCK1 registers */ 693 + for (v = 0; v < ARRAY_SIZE(pdata->buck1_voltage); ++v) { 694 + i = 0; 695 + while (buck12_voltage_map_desc.min + 696 + buck12_voltage_map_desc.step*i 697 + < pdata->buck1_voltage[v]) 698 + i++; 830 699 831 - max8998->buck1_vol[1] = i; 832 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE2, i); 833 - if (ret) 834 - goto err_out; 835 - 836 - /* Set predefined value for BUCK1 register 3 */ 837 - i = 0; 838 - while (buck12_voltage_map_desc.min + 839 - buck12_voltage_map_desc.step*i 840 - < pdata->buck1_voltage3) 841 - i++; 842 - 843 - max8998->buck1_vol[2] = i; 844 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE3, i); 845 - if (ret) 846 - goto err_out; 847 - 848 - /* Set predefined value for BUCK1 register 4 */ 849 - i = 0; 850 - while (buck12_voltage_map_desc.min + 851 - buck12_voltage_map_desc.step*i 852 - < pdata->buck1_voltage4) 853 - i++; 854 - 855 - max8998->buck1_vol[3] = i; 856 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK1_VOLTAGE4, i); 857 - if (ret) 858 - goto err_out; 859 - 700 + max8998->buck1_vol[v] = i; 701 + ret = max8998_write_reg(i2c, 702 + MAX8998_REG_BUCK1_VOLTAGE1 + v, i); 703 + if (ret) 704 + goto err_out; 705 + } 860 706 } 861 707 862 708 if (gpio_is_valid(pdata->buck2_set3)) { ··· 840 750 gpio_direction_output(pdata->buck2_set3, 841 751 max8998->buck2_idx & 0x1); 842 752 843 - /* BUCK2 register 1 */ 844 - i = 0; 845 - while (buck12_voltage_map_desc.min + 846 - buck12_voltage_map_desc.step*i 847 - < pdata->buck2_voltage1) 848 - i++; 849 - max8998->buck2_vol[0] = i; 850 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE1, i); 851 - if (ret) 852 - goto err_out; 753 + /* Set predefined values for BUCK2 registers */ 754 + for (v = 0; v < ARRAY_SIZE(pdata->buck2_voltage); ++v) { 755 + i = 0; 756 + while (buck12_voltage_map_desc.min + 757 + buck12_voltage_map_desc.step*i 758 + < pdata->buck2_voltage[v]) 759 + i++; 853 760 854 - /* BUCK2 register 2 */ 855 - i = 0; 856 - while (buck12_voltage_map_desc.min + 857 - buck12_voltage_map_desc.step*i 858 - < pdata->buck2_voltage2) 859 - i++; 860 - max8998->buck2_vol[1] = i; 861 - ret = max8998_write_reg(i2c, MAX8998_REG_BUCK2_VOLTAGE2, i); 862 - if (ret) 863 - goto err_out; 761 + max8998->buck2_vol[v] = i; 762 + ret = max8998_write_reg(i2c, 763 + MAX8998_REG_BUCK2_VOLTAGE1 + v, i); 764 + if (ret) 765 + goto err_out; 766 + } 864 767 } 865 768 866 769 for (i = 0; i < pdata->num_regulators; i++) { ··· 871 788 } 872 789 873 790 config.dev = max8998->dev; 791 + config.of_node = pdata->regulators[i].reg_node; 874 792 config.init_data = pdata->regulators[i].initdata; 875 793 config.driver_data = max8998; 876 794 877 795 rdev[i] = regulator_register(&regulators[index], &config); 878 796 if (IS_ERR(rdev[i])) { 879 797 ret = PTR_ERR(rdev[i]); 880 - dev_err(max8998->dev, "regulator init failed\n"); 798 + dev_err(max8998->dev, "regulator %s init failed (%d)\n", 799 + regulators[index].name, ret); 881 800 rdev[i] = NULL; 882 801 goto err; 883 802 }
+4
drivers/regulator/palmas-regulator.c
··· 838 838 continue; 839 839 ramp_delay_support = true; 840 840 break; 841 + case PALMAS_REG_SMPS10: 842 + if (!PALMAS_PMIC_HAS(palmas, SMPS10_BOOST)) 843 + continue; 841 844 } 842 845 843 846 if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8)) ··· 1054 1051 { .compatible = "ti,tps65913-pmic", }, 1055 1052 { .compatible = "ti,tps65914-pmic", }, 1056 1053 { .compatible = "ti,tps80036-pmic", }, 1054 + { .compatible = "ti,tps659038-pmic", }, 1057 1055 { /* end */ } 1058 1056 }; 1059 1057
+38 -38
drivers/regulator/twl-regulator.c
··· 109 109 #define SMPS_OFFSET_EN BIT(0) 110 110 #define SMPS_EXTENDED_EN BIT(1) 111 111 112 - /* twl6025 SMPS EPROM values */ 112 + /* twl6032 SMPS EPROM values */ 113 113 #define TWL6030_SMPS_OFFSET 0xB0 114 114 #define TWL6030_SMPS_MULT 0xB3 115 115 #define SMPS_MULTOFFSET_SMPS4 BIT(0) ··· 173 173 struct twlreg_info *info = rdev_get_drvdata(rdev); 174 174 int grp = 0, val; 175 175 176 - if (!(twl_class_is_6030() && (info->features & TWL6025_SUBCLASS))) { 176 + if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS))) { 177 177 grp = twlreg_grp(rdev); 178 178 if (grp < 0) 179 179 return grp; ··· 211 211 int grp = 0; 212 212 int ret; 213 213 214 - if (!(twl_class_is_6030() && (info->features & TWL6025_SUBCLASS))) 214 + if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS))) 215 215 grp = twlreg_grp(rdev); 216 216 if (grp < 0) 217 217 return grp; ··· 245 245 int grp = 0; 246 246 int ret; 247 247 248 - if (!(twl_class_is_6030() && (info->features & TWL6025_SUBCLASS))) 248 + if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS))) 249 249 grp = P1_GRP_6030 | P2_GRP_6030 | P3_GRP_6030; 250 250 251 251 /* For 6030, set the off state for all grps enabled */ ··· 339 339 int grp = 0; 340 340 int val; 341 341 342 - if (!(twl_class_is_6030() && (info->features & TWL6025_SUBCLASS))) 342 + if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS))) 343 343 grp = twlreg_grp(rdev); 344 344 345 345 if (grp < 0) ··· 899 899 }, \ 900 900 } 901 901 902 - #define TWL6025_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) \ 903 - static const struct twlreg_info TWL6025_INFO_##label = { \ 902 + #define TWL6032_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) \ 903 + static const struct twlreg_info TWL6032_INFO_##label = { \ 904 904 .base = offset, \ 905 905 .min_mV = min_mVolts, \ 906 906 .max_mV = max_mVolts, \ 907 907 .desc = { \ 908 908 .name = #label, \ 909 - .id = TWL6025_REG_##label, \ 909 + .id = TWL6032_REG_##label, \ 910 910 .n_voltages = 32, \ 911 911 .ops = &twl6030ldo_ops, \ 912 912 .type = REGULATOR_VOLTAGE, \ ··· 933 933 }, \ 934 934 } 935 935 936 - #define TWL6025_ADJUSTABLE_SMPS(label, offset) \ 936 + #define TWL6032_ADJUSTABLE_SMPS(label, offset) \ 937 937 static const struct twlreg_info TWLSMPS_INFO_##label = { \ 938 938 .base = offset, \ 939 939 .min_mV = 600, \ 940 940 .max_mV = 2100, \ 941 941 .desc = { \ 942 942 .name = #label, \ 943 - .id = TWL6025_REG_##label, \ 943 + .id = TWL6032_REG_##label, \ 944 944 .n_voltages = 63, \ 945 945 .ops = &twlsmps_ops, \ 946 946 .type = REGULATOR_VOLTAGE, \ ··· 981 981 TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 1000, 3300); 982 982 TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 1000, 3300); 983 983 /* 6025 are renamed compared to 6030 versions */ 984 - TWL6025_ADJUSTABLE_LDO(LDO2, 0x54, 1000, 3300); 985 - TWL6025_ADJUSTABLE_LDO(LDO4, 0x58, 1000, 3300); 986 - TWL6025_ADJUSTABLE_LDO(LDO3, 0x5c, 1000, 3300); 987 - TWL6025_ADJUSTABLE_LDO(LDO5, 0x68, 1000, 3300); 988 - TWL6025_ADJUSTABLE_LDO(LDO1, 0x6c, 1000, 3300); 989 - TWL6025_ADJUSTABLE_LDO(LDO7, 0x74, 1000, 3300); 990 - TWL6025_ADJUSTABLE_LDO(LDO6, 0x60, 1000, 3300); 991 - TWL6025_ADJUSTABLE_LDO(LDOLN, 0x64, 1000, 3300); 992 - TWL6025_ADJUSTABLE_LDO(LDOUSB, 0x70, 1000, 3300); 984 + TWL6032_ADJUSTABLE_LDO(LDO2, 0x54, 1000, 3300); 985 + TWL6032_ADJUSTABLE_LDO(LDO4, 0x58, 1000, 3300); 986 + TWL6032_ADJUSTABLE_LDO(LDO3, 0x5c, 1000, 3300); 987 + TWL6032_ADJUSTABLE_LDO(LDO5, 0x68, 1000, 3300); 988 + TWL6032_ADJUSTABLE_LDO(LDO1, 0x6c, 1000, 3300); 989 + TWL6032_ADJUSTABLE_LDO(LDO7, 0x74, 1000, 3300); 990 + TWL6032_ADJUSTABLE_LDO(LDO6, 0x60, 1000, 3300); 991 + TWL6032_ADJUSTABLE_LDO(LDOLN, 0x64, 1000, 3300); 992 + TWL6032_ADJUSTABLE_LDO(LDOUSB, 0x70, 1000, 3300); 993 993 TWL4030_FIXED_LDO(VINTANA1, 0x3f, 1500, 11, 100, 0x08); 994 994 TWL4030_FIXED_LDO(VINTDIG, 0x47, 1500, 13, 100, 0x08); 995 995 TWL4030_FIXED_LDO(VUSB1V5, 0x71, 1500, 17, 100, 0x08); ··· 1001 1001 TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 0); 1002 1002 TWL6030_FIXED_LDO(V1V8, 0x16, 1800, 0); 1003 1003 TWL6030_FIXED_LDO(V2V1, 0x1c, 2100, 0); 1004 - TWL6025_ADJUSTABLE_SMPS(SMPS3, 0x34); 1005 - TWL6025_ADJUSTABLE_SMPS(SMPS4, 0x10); 1006 - TWL6025_ADJUSTABLE_SMPS(VIO, 0x16); 1004 + TWL6032_ADJUSTABLE_SMPS(SMPS3, 0x34); 1005 + TWL6032_ADJUSTABLE_SMPS(SMPS4, 0x10); 1006 + TWL6032_ADJUSTABLE_SMPS(VIO, 0x16); 1007 1007 1008 1008 static u8 twl_get_smps_offset(void) 1009 1009 { ··· 1031 1031 1032 1032 #define TWL4030_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL4030, label) 1033 1033 #define TWL6030_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6030, label) 1034 - #define TWL6025_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6025, label) 1034 + #define TWL6032_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6032, label) 1035 1035 #define TWLFIXED_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLFIXED, label) 1036 1036 #define TWLSMPS_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLSMPS, label) 1037 1037 ··· 1060 1060 TWL6030_OF_MATCH("ti,twl6030-vmmc", VMMC), 1061 1061 TWL6030_OF_MATCH("ti,twl6030-vpp", VPP), 1062 1062 TWL6030_OF_MATCH("ti,twl6030-vusim", VUSIM), 1063 - TWL6025_OF_MATCH("ti,twl6025-ldo2", LDO2), 1064 - TWL6025_OF_MATCH("ti,twl6025-ldo4", LDO4), 1065 - TWL6025_OF_MATCH("ti,twl6025-ldo3", LDO3), 1066 - TWL6025_OF_MATCH("ti,twl6025-ldo5", LDO5), 1067 - TWL6025_OF_MATCH("ti,twl6025-ldo1", LDO1), 1068 - TWL6025_OF_MATCH("ti,twl6025-ldo7", LDO7), 1069 - TWL6025_OF_MATCH("ti,twl6025-ldo6", LDO6), 1070 - TWL6025_OF_MATCH("ti,twl6025-ldoln", LDOLN), 1071 - TWL6025_OF_MATCH("ti,twl6025-ldousb", LDOUSB), 1063 + TWL6032_OF_MATCH("ti,twl6032-ldo2", LDO2), 1064 + TWL6032_OF_MATCH("ti,twl6032-ldo4", LDO4), 1065 + TWL6032_OF_MATCH("ti,twl6032-ldo3", LDO3), 1066 + TWL6032_OF_MATCH("ti,twl6032-ldo5", LDO5), 1067 + TWL6032_OF_MATCH("ti,twl6032-ldo1", LDO1), 1068 + TWL6032_OF_MATCH("ti,twl6032-ldo7", LDO7), 1069 + TWL6032_OF_MATCH("ti,twl6032-ldo6", LDO6), 1070 + TWL6032_OF_MATCH("ti,twl6032-ldoln", LDOLN), 1071 + TWL6032_OF_MATCH("ti,twl6032-ldousb", LDOUSB), 1072 1072 TWLFIXED_OF_MATCH("ti,twl4030-vintana1", VINTANA1), 1073 1073 TWLFIXED_OF_MATCH("ti,twl4030-vintdig", VINTDIG), 1074 1074 TWLFIXED_OF_MATCH("ti,twl4030-vusb1v5", VUSB1V5), ··· 1080 1080 TWLFIXED_OF_MATCH("ti,twl6030-vusb", VUSB), 1081 1081 TWLFIXED_OF_MATCH("ti,twl6030-v1v8", V1V8), 1082 1082 TWLFIXED_OF_MATCH("ti,twl6030-v2v1", V2V1), 1083 - TWLSMPS_OF_MATCH("ti,twl6025-smps3", SMPS3), 1084 - TWLSMPS_OF_MATCH("ti,twl6025-smps4", SMPS4), 1085 - TWLSMPS_OF_MATCH("ti,twl6025-vio", VIO), 1083 + TWLSMPS_OF_MATCH("ti,twl6032-smps3", SMPS3), 1084 + TWLSMPS_OF_MATCH("ti,twl6032-smps4", SMPS4), 1085 + TWLSMPS_OF_MATCH("ti,twl6032-vio", VIO), 1086 1086 {}, 1087 1087 }; 1088 1088 MODULE_DEVICE_TABLE(of, twl_of_match); ··· 1163 1163 } 1164 1164 1165 1165 switch (id) { 1166 - case TWL6025_REG_SMPS3: 1166 + case TWL6032_REG_SMPS3: 1167 1167 if (twl_get_smps_mult() & SMPS_MULTOFFSET_SMPS3) 1168 1168 info->flags |= SMPS_EXTENDED_EN; 1169 1169 if (twl_get_smps_offset() & SMPS_MULTOFFSET_SMPS3) 1170 1170 info->flags |= SMPS_OFFSET_EN; 1171 1171 break; 1172 - case TWL6025_REG_SMPS4: 1172 + case TWL6032_REG_SMPS4: 1173 1173 if (twl_get_smps_mult() & SMPS_MULTOFFSET_SMPS4) 1174 1174 info->flags |= SMPS_EXTENDED_EN; 1175 1175 if (twl_get_smps_offset() & SMPS_MULTOFFSET_SMPS4) 1176 1176 info->flags |= SMPS_OFFSET_EN; 1177 1177 break; 1178 - case TWL6025_REG_VIO: 1178 + case TWL6032_REG_VIO: 1179 1179 if (twl_get_smps_mult() & SMPS_MULTOFFSET_VIO) 1180 1180 info->flags |= SMPS_EXTENDED_EN; 1181 1181 if (twl_get_smps_offset() & SMPS_MULTOFFSET_VIO)
+12 -2
drivers/rtc/rtc-max8998.c
··· 16 16 #include <linux/i2c.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/bcd.h> 19 + #include <linux/irqdomain.h> 19 20 #include <linux/rtc.h> 20 21 #include <linux/platform_device.h> 21 22 #include <linux/mfd/max8998.h> ··· 253 252 static int max8998_rtc_probe(struct platform_device *pdev) 254 253 { 255 254 struct max8998_dev *max8998 = dev_get_drvdata(pdev->dev.parent); 256 - struct max8998_platform_data *pdata = dev_get_platdata(max8998->dev); 255 + struct max8998_platform_data *pdata = max8998->pdata; 257 256 struct max8998_rtc_info *info; 258 257 int ret; 259 258 ··· 265 264 info->dev = &pdev->dev; 266 265 info->max8998 = max8998; 267 266 info->rtc = max8998->rtc; 268 - info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0; 269 267 270 268 platform_set_drvdata(pdev, info); 271 269 ··· 277 277 return ret; 278 278 } 279 279 280 + if (!max8998->irq_domain) 281 + goto no_irq; 282 + 283 + info->irq = irq_create_mapping(max8998->irq_domain, MAX8998_IRQ_ALARM0); 284 + if (!info->irq) { 285 + dev_warn(&pdev->dev, "Failed to map alarm IRQ\n"); 286 + goto no_irq; 287 + } 288 + 280 289 ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, 281 290 max8998_rtc_alarm_irq, 0, "rtc-alarm0", info); 282 291 ··· 293 284 dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", 294 285 info->irq, ret); 295 286 287 + no_irq: 296 288 dev_info(&pdev->dev, "RTC CHIP NAME: %s\n", pdev->id_entry->name); 297 289 if (pdata && pdata->rtc_delay) { 298 290 info->lp3974_bug_workaround = true;
-16
drivers/ssbi/Kconfig
··· 1 - # 2 - # SSBI bus support 3 - # 4 - 5 - menu "Qualcomm MSM SSBI bus support" 6 - 7 - config SSBI 8 - tristate "Qualcomm Single-wire Serial Bus Interface (SSBI)" 9 - help 10 - If you say yes to this option, support will be included for the 11 - built-in SSBI interface on Qualcomm MSM family processors. 12 - 13 - This is required for communicating with Qualcomm PMICs and 14 - other devices that have the SSBI interface. 15 - 16 - endmenu
-1
drivers/ssbi/Makefile
··· 1 - obj-$(CONFIG_SSBI) += ssbi.o
drivers/ssbi/ssbi.c drivers/mfd/ssbi.c
+1 -1
drivers/usb/phy/phy-twl6030-usb.c
··· 347 347 if (np) { 348 348 twl->regulator = "usb"; 349 349 } else if (pdata) { 350 - if (pdata->features & TWL6025_SUBCLASS) 350 + if (pdata->features & TWL6032_SUBCLASS) 351 351 twl->regulator = "ldousb"; 352 352 else 353 353 twl->regulator = "vusb";
+11
drivers/watchdog/Kconfig
··· 687 687 To compile this driver as a module, choose M here: the module will be 688 688 called hpwdt. 689 689 690 + config KEMPLD_WDT 691 + tristate "Kontron COM Watchdog Timer" 692 + depends on MFD_KEMPLD 693 + select WATCHDOG_CORE 694 + help 695 + Support for the PLD watchdog on some Kontron ETX and COMexpress 696 + (ETXexpress) modules 697 + 698 + This driver can also be built as a module. If so, the module will be 699 + called kempld_wdt. 700 + 690 701 config HPWDT_NMI_DECODING 691 702 bool "NMI decoding support for the HP ProLiant iLO2+ Hardware Watchdog Timer" 692 703 depends on HP_WATCHDOG
+1
drivers/watchdog/Makefile
··· 90 90 obj-$(CONFIG_IT8712F_WDT) += it8712f_wdt.o 91 91 obj-$(CONFIG_IT87_WDT) += it87_wdt.o 92 92 obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o 93 + obj-$(CONFIG_KEMPLD_WDT) += kempld_wdt.o 93 94 obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o 94 95 obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o 95 96 obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
+581
drivers/watchdog/kempld_wdt.c
··· 1 + /* 2 + * Kontron PLD watchdog driver 3 + * 4 + * Copyright (c) 2010-2013 Kontron Europe GmbH 5 + * Author: Michael Brunner <michael.brunner@kontron.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 2 as published 9 + * by the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * Note: From the PLD watchdog point of view timeout and pretimeout are 17 + * defined differently than in the kernel. 18 + * First the pretimeout stage runs out before the timeout stage gets 19 + * active. 20 + * 21 + * Kernel/API: P-----| pretimeout 22 + * |-----------------------T timeout 23 + * Watchdog: |-----------------P pretimeout_stage 24 + * |-----T timeout_stage 25 + */ 26 + 27 + #include <linux/module.h> 28 + #include <linux/moduleparam.h> 29 + #include <linux/miscdevice.h> 30 + #include <linux/uaccess.h> 31 + #include <linux/watchdog.h> 32 + #include <linux/platform_device.h> 33 + #include <linux/mfd/kempld.h> 34 + 35 + #define KEMPLD_WDT_STAGE_TIMEOUT(x) (0x1b + (x) * 4) 36 + #define KEMPLD_WDT_STAGE_CFG(x) (0x18 + (x)) 37 + #define STAGE_CFG_GET_PRESCALER(x) (((x) & 0x30) >> 4) 38 + #define STAGE_CFG_SET_PRESCALER(x) (((x) & 0x30) << 4) 39 + #define STAGE_CFG_PRESCALER_MASK 0x30 40 + #define STAGE_CFG_ACTION_MASK 0x7 41 + #define STAGE_CFG_ASSERT (1 << 3) 42 + 43 + #define KEMPLD_WDT_MAX_STAGES 2 44 + #define KEMPLD_WDT_KICK 0x16 45 + #define KEMPLD_WDT_CFG 0x17 46 + #define KEMPLD_WDT_CFG_ENABLE 0x10 47 + #define KEMPLD_WDT_CFG_ENABLE_LOCK 0x8 48 + #define KEMPLD_WDT_CFG_GLOBAL_LOCK 0x80 49 + 50 + enum { 51 + ACTION_NONE = 0, 52 + ACTION_RESET, 53 + ACTION_NMI, 54 + ACTION_SMI, 55 + ACTION_SCI, 56 + ACTION_DELAY, 57 + }; 58 + 59 + enum { 60 + STAGE_TIMEOUT = 0, 61 + STAGE_PRETIMEOUT, 62 + }; 63 + 64 + enum { 65 + PRESCALER_21 = 0, 66 + PRESCALER_17, 67 + PRESCALER_12, 68 + }; 69 + 70 + const u32 kempld_prescaler[] = { 71 + [PRESCALER_21] = (1 << 21) - 1, 72 + [PRESCALER_17] = (1 << 17) - 1, 73 + [PRESCALER_12] = (1 << 12) - 1, 74 + 0, 75 + }; 76 + 77 + struct kempld_wdt_stage { 78 + unsigned int id; 79 + u32 mask; 80 + }; 81 + 82 + struct kempld_wdt_data { 83 + struct kempld_device_data *pld; 84 + struct watchdog_device wdd; 85 + unsigned int pretimeout; 86 + struct kempld_wdt_stage stage[KEMPLD_WDT_MAX_STAGES]; 87 + #ifdef CONFIG_PM 88 + u8 pm_status_store; 89 + #endif 90 + }; 91 + 92 + #define DEFAULT_TIMEOUT 30 /* seconds */ 93 + #define DEFAULT_PRETIMEOUT 0 94 + 95 + static unsigned int timeout = DEFAULT_TIMEOUT; 96 + module_param(timeout, uint, 0); 97 + MODULE_PARM_DESC(timeout, 98 + "Watchdog timeout in seconds. (>=0, default=" 99 + __MODULE_STRING(DEFAULT_TIMEOUT) ")"); 100 + 101 + static unsigned int pretimeout = DEFAULT_PRETIMEOUT; 102 + module_param(pretimeout, uint, 0); 103 + MODULE_PARM_DESC(pretimeout, 104 + "Watchdog pretimeout in seconds. (>=0, default=" 105 + __MODULE_STRING(DEFAULT_PRETIMEOUT) ")"); 106 + 107 + static bool nowayout = WATCHDOG_NOWAYOUT; 108 + module_param(nowayout, bool, 0); 109 + MODULE_PARM_DESC(nowayout, 110 + "Watchdog cannot be stopped once started (default=" 111 + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 112 + 113 + static int kempld_wdt_set_stage_action(struct kempld_wdt_data *wdt_data, 114 + struct kempld_wdt_stage *stage, 115 + u8 action) 116 + { 117 + struct kempld_device_data *pld = wdt_data->pld; 118 + u8 stage_cfg; 119 + 120 + if (!stage || !stage->mask) 121 + return -EINVAL; 122 + 123 + kempld_get_mutex(pld); 124 + stage_cfg = kempld_read8(pld, KEMPLD_WDT_STAGE_CFG(stage->id)); 125 + stage_cfg &= ~STAGE_CFG_ACTION_MASK; 126 + stage_cfg |= (action & STAGE_CFG_ACTION_MASK); 127 + 128 + if (action == ACTION_RESET) 129 + stage_cfg |= STAGE_CFG_ASSERT; 130 + else 131 + stage_cfg &= ~STAGE_CFG_ASSERT; 132 + 133 + kempld_write8(pld, KEMPLD_WDT_STAGE_CFG(stage->id), stage_cfg); 134 + kempld_release_mutex(pld); 135 + 136 + return 0; 137 + } 138 + 139 + static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data, 140 + struct kempld_wdt_stage *stage, 141 + unsigned int timeout) 142 + { 143 + struct kempld_device_data *pld = wdt_data->pld; 144 + u32 prescaler = kempld_prescaler[PRESCALER_21]; 145 + u64 stage_timeout64; 146 + u32 stage_timeout; 147 + u32 remainder; 148 + u8 stage_cfg; 149 + 150 + if (!stage) 151 + return -EINVAL; 152 + 153 + stage_timeout64 = (u64)timeout * pld->pld_clock; 154 + remainder = do_div(stage_timeout64, prescaler); 155 + if (remainder) 156 + stage_timeout64++; 157 + 158 + if (stage_timeout64 > stage->mask) 159 + return -EINVAL; 160 + 161 + stage_timeout = stage_timeout64 & stage->mask; 162 + 163 + kempld_get_mutex(pld); 164 + stage_cfg = kempld_read8(pld, KEMPLD_WDT_STAGE_CFG(stage->id)); 165 + stage_cfg &= ~STAGE_CFG_PRESCALER_MASK; 166 + stage_cfg |= STAGE_CFG_SET_PRESCALER(prescaler); 167 + kempld_write8(pld, KEMPLD_WDT_STAGE_CFG(stage->id), stage_cfg); 168 + kempld_write32(pld, KEMPLD_WDT_STAGE_TIMEOUT(stage->id), 169 + stage_timeout); 170 + kempld_release_mutex(pld); 171 + 172 + return 0; 173 + } 174 + 175 + /* 176 + * kempld_get_mutex must be called prior to calling this function. 177 + */ 178 + static unsigned int kempld_wdt_get_timeout(struct kempld_wdt_data *wdt_data, 179 + struct kempld_wdt_stage *stage) 180 + { 181 + struct kempld_device_data *pld = wdt_data->pld; 182 + unsigned int timeout; 183 + u64 stage_timeout; 184 + u32 prescaler; 185 + u32 remainder; 186 + u8 stage_cfg; 187 + 188 + if (!stage->mask) 189 + return 0; 190 + 191 + stage_cfg = kempld_read8(pld, KEMPLD_WDT_STAGE_CFG(stage->id)); 192 + stage_timeout = kempld_read32(pld, KEMPLD_WDT_STAGE_TIMEOUT(stage->id)); 193 + prescaler = kempld_prescaler[STAGE_CFG_GET_PRESCALER(stage_cfg)]; 194 + 195 + stage_timeout = (stage_timeout & stage->mask) * prescaler; 196 + remainder = do_div(stage_timeout, pld->pld_clock); 197 + if (remainder) 198 + stage_timeout++; 199 + 200 + timeout = stage_timeout; 201 + WARN_ON_ONCE(timeout != stage_timeout); 202 + 203 + return timeout; 204 + } 205 + 206 + static int kempld_wdt_set_timeout(struct watchdog_device *wdd, 207 + unsigned int timeout) 208 + { 209 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 210 + struct kempld_wdt_stage *pretimeout_stage; 211 + struct kempld_wdt_stage *timeout_stage; 212 + int ret; 213 + 214 + timeout_stage = &wdt_data->stage[STAGE_TIMEOUT]; 215 + pretimeout_stage = &wdt_data->stage[STAGE_PRETIMEOUT]; 216 + 217 + if (pretimeout_stage->mask && wdt_data->pretimeout > 0) 218 + timeout = wdt_data->pretimeout; 219 + 220 + ret = kempld_wdt_set_stage_action(wdt_data, timeout_stage, 221 + ACTION_RESET); 222 + if (ret) 223 + return ret; 224 + ret = kempld_wdt_set_stage_timeout(wdt_data, timeout_stage, 225 + timeout); 226 + if (ret) 227 + return ret; 228 + 229 + wdd->timeout = timeout; 230 + return 0; 231 + } 232 + 233 + static int kempld_wdt_set_pretimeout(struct watchdog_device *wdd, 234 + unsigned int pretimeout) 235 + { 236 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 237 + struct kempld_wdt_stage *pretimeout_stage; 238 + u8 action = ACTION_NONE; 239 + int ret; 240 + 241 + pretimeout_stage = &wdt_data->stage[STAGE_PRETIMEOUT]; 242 + 243 + if (!pretimeout_stage->mask) 244 + return -ENXIO; 245 + 246 + if (pretimeout > wdd->timeout) 247 + return -EINVAL; 248 + 249 + if (pretimeout > 0) 250 + action = ACTION_NMI; 251 + 252 + ret = kempld_wdt_set_stage_action(wdt_data, pretimeout_stage, 253 + action); 254 + if (ret) 255 + return ret; 256 + ret = kempld_wdt_set_stage_timeout(wdt_data, pretimeout_stage, 257 + wdd->timeout - pretimeout); 258 + if (ret) 259 + return ret; 260 + 261 + wdt_data->pretimeout = pretimeout; 262 + return 0; 263 + } 264 + 265 + static void kempld_wdt_update_timeouts(struct kempld_wdt_data *wdt_data) 266 + { 267 + struct kempld_device_data *pld = wdt_data->pld; 268 + struct kempld_wdt_stage *pretimeout_stage; 269 + struct kempld_wdt_stage *timeout_stage; 270 + unsigned int pretimeout, timeout; 271 + 272 + pretimeout_stage = &wdt_data->stage[STAGE_PRETIMEOUT]; 273 + timeout_stage = &wdt_data->stage[STAGE_TIMEOUT]; 274 + 275 + kempld_get_mutex(pld); 276 + pretimeout = kempld_wdt_get_timeout(wdt_data, pretimeout_stage); 277 + timeout = kempld_wdt_get_timeout(wdt_data, timeout_stage); 278 + kempld_release_mutex(pld); 279 + 280 + if (pretimeout) 281 + wdt_data->pretimeout = timeout; 282 + else 283 + wdt_data->pretimeout = 0; 284 + 285 + wdt_data->wdd.timeout = pretimeout + timeout; 286 + } 287 + 288 + static int kempld_wdt_start(struct watchdog_device *wdd) 289 + { 290 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 291 + struct kempld_device_data *pld = wdt_data->pld; 292 + u8 status; 293 + int ret; 294 + 295 + ret = kempld_wdt_set_timeout(wdd, wdd->timeout); 296 + if (ret) 297 + return ret; 298 + 299 + kempld_get_mutex(pld); 300 + status = kempld_read8(pld, KEMPLD_WDT_CFG); 301 + status |= KEMPLD_WDT_CFG_ENABLE; 302 + kempld_write8(pld, KEMPLD_WDT_CFG, status); 303 + status = kempld_read8(pld, KEMPLD_WDT_CFG); 304 + kempld_release_mutex(pld); 305 + 306 + /* Check if the watchdog was enabled */ 307 + if (!(status & KEMPLD_WDT_CFG_ENABLE)) 308 + return -EACCES; 309 + 310 + return 0; 311 + } 312 + 313 + static int kempld_wdt_stop(struct watchdog_device *wdd) 314 + { 315 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 316 + struct kempld_device_data *pld = wdt_data->pld; 317 + u8 status; 318 + 319 + kempld_get_mutex(pld); 320 + status = kempld_read8(pld, KEMPLD_WDT_CFG); 321 + status &= ~KEMPLD_WDT_CFG_ENABLE; 322 + kempld_write8(pld, KEMPLD_WDT_CFG, status); 323 + status = kempld_read8(pld, KEMPLD_WDT_CFG); 324 + kempld_release_mutex(pld); 325 + 326 + /* Check if the watchdog was disabled */ 327 + if (status & KEMPLD_WDT_CFG_ENABLE) 328 + return -EACCES; 329 + 330 + return 0; 331 + } 332 + 333 + static int kempld_wdt_keepalive(struct watchdog_device *wdd) 334 + { 335 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 336 + struct kempld_device_data *pld = wdt_data->pld; 337 + 338 + kempld_get_mutex(pld); 339 + kempld_write8(pld, KEMPLD_WDT_KICK, 'K'); 340 + kempld_release_mutex(pld); 341 + 342 + return 0; 343 + } 344 + 345 + static long kempld_wdt_ioctl(struct watchdog_device *wdd, unsigned int cmd, 346 + unsigned long arg) 347 + { 348 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 349 + void __user *argp = (void __user *)arg; 350 + int ret = -ENOIOCTLCMD; 351 + int __user *p = argp; 352 + int new_value; 353 + 354 + switch (cmd) { 355 + case WDIOC_SETPRETIMEOUT: 356 + if (get_user(new_value, p)) 357 + return -EFAULT; 358 + ret = kempld_wdt_set_pretimeout(wdd, new_value); 359 + if (ret) 360 + return ret; 361 + ret = kempld_wdt_keepalive(wdd); 362 + break; 363 + case WDIOC_GETPRETIMEOUT: 364 + ret = put_user(wdt_data->pretimeout, (int *)arg); 365 + break; 366 + } 367 + 368 + return ret; 369 + } 370 + 371 + static int kempld_wdt_probe_stages(struct watchdog_device *wdd) 372 + { 373 + struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); 374 + struct kempld_device_data *pld = wdt_data->pld; 375 + struct kempld_wdt_stage *pretimeout_stage; 376 + struct kempld_wdt_stage *timeout_stage; 377 + u8 index, data, data_orig; 378 + u32 mask; 379 + int i, j; 380 + 381 + pretimeout_stage = &wdt_data->stage[STAGE_PRETIMEOUT]; 382 + timeout_stage = &wdt_data->stage[STAGE_TIMEOUT]; 383 + 384 + pretimeout_stage->mask = 0; 385 + timeout_stage->mask = 0; 386 + 387 + for (i = 0; i < 3; i++) { 388 + index = KEMPLD_WDT_STAGE_TIMEOUT(i); 389 + mask = 0; 390 + 391 + kempld_get_mutex(pld); 392 + /* Probe each byte individually. */ 393 + for (j = 0; j < 4; j++) { 394 + data_orig = kempld_read8(pld, index + j); 395 + kempld_write8(pld, index + j, 0x00); 396 + data = kempld_read8(pld, index + j); 397 + /* A failed write means this byte is reserved */ 398 + if (data != 0x00) 399 + break; 400 + kempld_write8(pld, index + j, data_orig); 401 + mask |= 0xff << (j * 8); 402 + } 403 + kempld_release_mutex(pld); 404 + 405 + /* Assign available stages to timeout and pretimeout */ 406 + if (!timeout_stage->mask) { 407 + timeout_stage->mask = mask; 408 + timeout_stage->id = i; 409 + } else { 410 + if (pld->feature_mask & KEMPLD_FEATURE_BIT_NMI) { 411 + pretimeout_stage->mask = timeout_stage->mask; 412 + timeout_stage->mask = mask; 413 + pretimeout_stage->id = timeout_stage->id; 414 + timeout_stage->id = i; 415 + } 416 + break; 417 + } 418 + } 419 + 420 + if (!timeout_stage->mask) 421 + return -ENODEV; 422 + 423 + return 0; 424 + } 425 + 426 + static struct watchdog_info kempld_wdt_info = { 427 + .identity = "KEMPLD Watchdog", 428 + .options = WDIOF_SETTIMEOUT | 429 + WDIOF_KEEPALIVEPING | 430 + WDIOF_MAGICCLOSE | 431 + WDIOF_PRETIMEOUT 432 + }; 433 + 434 + static struct watchdog_ops kempld_wdt_ops = { 435 + .owner = THIS_MODULE, 436 + .start = kempld_wdt_start, 437 + .stop = kempld_wdt_stop, 438 + .ping = kempld_wdt_keepalive, 439 + .set_timeout = kempld_wdt_set_timeout, 440 + .ioctl = kempld_wdt_ioctl, 441 + }; 442 + 443 + static int kempld_wdt_probe(struct platform_device *pdev) 444 + { 445 + struct kempld_device_data *pld = dev_get_drvdata(pdev->dev.parent); 446 + struct kempld_wdt_data *wdt_data; 447 + struct device *dev = &pdev->dev; 448 + struct watchdog_device *wdd; 449 + u8 status; 450 + int ret = 0; 451 + 452 + wdt_data = devm_kzalloc(dev, sizeof(*wdt_data), GFP_KERNEL); 453 + if (!wdt_data) 454 + return -ENOMEM; 455 + 456 + wdt_data->pld = pld; 457 + wdd = &wdt_data->wdd; 458 + wdd->parent = dev; 459 + 460 + kempld_get_mutex(pld); 461 + status = kempld_read8(pld, KEMPLD_WDT_CFG); 462 + kempld_release_mutex(pld); 463 + 464 + /* Enable nowayout if watchdog is already locked */ 465 + if (status & (KEMPLD_WDT_CFG_ENABLE_LOCK | 466 + KEMPLD_WDT_CFG_GLOBAL_LOCK)) { 467 + if (!nowayout) 468 + dev_warn(dev, 469 + "Forcing nowayout - watchdog lock enabled!\n"); 470 + nowayout = true; 471 + } 472 + 473 + wdd->info = &kempld_wdt_info; 474 + wdd->ops = &kempld_wdt_ops; 475 + 476 + watchdog_set_drvdata(wdd, wdt_data); 477 + watchdog_set_nowayout(wdd, nowayout); 478 + 479 + ret = kempld_wdt_probe_stages(wdd); 480 + if (ret) 481 + return ret; 482 + 483 + kempld_wdt_set_timeout(wdd, timeout); 484 + kempld_wdt_set_pretimeout(wdd, pretimeout); 485 + 486 + /* Check if watchdog is already enabled */ 487 + if (status & KEMPLD_WDT_CFG_ENABLE) { 488 + /* Get current watchdog settings */ 489 + kempld_wdt_update_timeouts(wdt_data); 490 + dev_info(dev, "Watchdog was already enabled\n"); 491 + } 492 + 493 + platform_set_drvdata(pdev, wdt_data); 494 + ret = watchdog_register_device(wdd); 495 + if (ret) 496 + return ret; 497 + 498 + dev_info(dev, "Watchdog registered with %ds timeout\n", wdd->timeout); 499 + 500 + return 0; 501 + } 502 + 503 + static void kempld_wdt_shutdown(struct platform_device *pdev) 504 + { 505 + struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev); 506 + 507 + kempld_wdt_stop(&wdt_data->wdd); 508 + } 509 + 510 + static int kempld_wdt_remove(struct platform_device *pdev) 511 + { 512 + struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev); 513 + struct watchdog_device *wdd = &wdt_data->wdd; 514 + int ret = 0; 515 + 516 + if (!nowayout) 517 + ret = kempld_wdt_stop(wdd); 518 + watchdog_unregister_device(wdd); 519 + 520 + return ret; 521 + } 522 + 523 + #ifdef CONFIG_PM 524 + /* Disable watchdog if it is active during suspend */ 525 + static int kempld_wdt_suspend(struct platform_device *pdev, 526 + pm_message_t message) 527 + { 528 + struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev); 529 + struct kempld_device_data *pld = wdt_data->pld; 530 + struct watchdog_device *wdd = &wdt_data->wdd; 531 + 532 + kempld_get_mutex(pld); 533 + wdt_data->pm_status_store = kempld_read8(pld, KEMPLD_WDT_CFG); 534 + kempld_release_mutex(pld); 535 + 536 + kempld_wdt_update_timeouts(wdt_data); 537 + 538 + if (wdt_data->pm_status_store & KEMPLD_WDT_CFG_ENABLE) 539 + return kempld_wdt_stop(wdd); 540 + 541 + return 0; 542 + } 543 + 544 + /* Enable watchdog and configure it if necessary */ 545 + static int kempld_wdt_resume(struct platform_device *pdev) 546 + { 547 + struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev); 548 + struct watchdog_device *wdd = &wdt_data->wdd; 549 + 550 + /* 551 + * If watchdog was stopped before suspend be sure it gets disabled 552 + * again, for the case BIOS has enabled it during resume 553 + */ 554 + if (wdt_data->pm_status_store & KEMPLD_WDT_CFG_ENABLE) 555 + return kempld_wdt_start(wdd); 556 + else 557 + return kempld_wdt_stop(wdd); 558 + } 559 + #else 560 + #define kempld_wdt_suspend NULL 561 + #define kempld_wdt_resume NULL 562 + #endif 563 + 564 + static struct platform_driver kempld_wdt_driver = { 565 + .driver = { 566 + .name = "kempld-wdt", 567 + .owner = THIS_MODULE, 568 + }, 569 + .probe = kempld_wdt_probe, 570 + .remove = kempld_wdt_remove, 571 + .shutdown = kempld_wdt_shutdown, 572 + .suspend = kempld_wdt_suspend, 573 + .resume = kempld_wdt_resume, 574 + }; 575 + 576 + module_platform_driver(kempld_wdt_driver); 577 + 578 + MODULE_DESCRIPTION("KEM PLD Watchdog Driver"); 579 + MODULE_AUTHOR("Michael Brunner <michael.brunner@kontron.com>"); 580 + MODULE_LICENSE("GPL"); 581 + MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+15 -16
include/linux/i2c/twl.h
··· 658 658 bool use_poweroff; /* Board is wired for TWL poweroff */ 659 659 }; 660 660 661 - extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 662 661 extern int twl4030_remove_script(u8 flags); 663 662 extern void twl4030_power_off(void); 664 663 ··· 725 726 struct regulator_init_data *clk32kg; 726 727 struct regulator_init_data *v1v8; 727 728 struct regulator_init_data *v2v1; 728 - /* TWL6025 LDO regulators */ 729 + /* TWL6032 LDO regulators */ 729 730 struct regulator_init_data *ldo1; 730 731 struct regulator_init_data *ldo2; 731 732 struct regulator_init_data *ldo3; ··· 735 736 struct regulator_init_data *ldo7; 736 737 struct regulator_init_data *ldoln; 737 738 struct regulator_init_data *ldousb; 738 - /* TWL6025 DCDC regulators */ 739 + /* TWL6032 DCDC regulators */ 739 740 struct regulator_init_data *smps3; 740 741 struct regulator_init_data *smps4; 741 742 struct regulator_init_data *vio6025; ··· 752 753 #define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ 753 754 #define TWL5031 BIT(2) /* twl5031 has different registers */ 754 755 #define TWL6030_CLASS BIT(3) /* TWL6030 class */ 755 - #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ 756 + #define TWL6032_SUBCLASS BIT(4) /* TWL6032 has changed registers */ 756 757 #define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible 757 758 * but not officially supported. 758 759 * This flag is necessary to ··· 839 840 #define TWL6030_REG_CLK32KG 48 840 841 841 842 /* LDOs on 6025 have different names */ 842 - #define TWL6025_REG_LDO2 49 843 - #define TWL6025_REG_LDO4 50 844 - #define TWL6025_REG_LDO3 51 845 - #define TWL6025_REG_LDO5 52 846 - #define TWL6025_REG_LDO1 53 847 - #define TWL6025_REG_LDO7 54 848 - #define TWL6025_REG_LDO6 55 849 - #define TWL6025_REG_LDOLN 56 850 - #define TWL6025_REG_LDOUSB 57 843 + #define TWL6032_REG_LDO2 49 844 + #define TWL6032_REG_LDO4 50 845 + #define TWL6032_REG_LDO3 51 846 + #define TWL6032_REG_LDO5 52 847 + #define TWL6032_REG_LDO1 53 848 + #define TWL6032_REG_LDO7 54 849 + #define TWL6032_REG_LDO6 55 850 + #define TWL6032_REG_LDOLN 56 851 + #define TWL6032_REG_LDOUSB 57 851 852 852 853 /* 6025 DCDC supplies */ 853 - #define TWL6025_REG_SMPS3 58 854 - #define TWL6025_REG_SMPS4 59 855 - #define TWL6025_REG_VIO 60 854 + #define TWL6032_REG_SMPS3 58 855 + #define TWL6032_REG_SMPS4 59 856 + #define TWL6032_REG_VIO 60 856 857 857 858 858 859 #endif /* End of __TWL4030_H */
-23
include/linux/input/ti_am335x_tsc.h
··· 1 - #ifndef __LINUX_TI_AM335X_TSC_H 2 - #define __LINUX_TI_AM335X_TSC_H 3 - 4 - /** 5 - * struct tsc_data Touchscreen wire configuration 6 - * @wires: Wires refer to application modes 7 - * i.e. 4/5/8 wire touchscreen support 8 - * on the platform. 9 - * @x_plate_resistance: X plate resistance. 10 - * @steps_to_configure: The sequencer supports a total of 11 - * 16 programmable steps. 12 - * A step configured to read a single 13 - * co-ordinate value, can be applied 14 - * more number of times for better results. 15 - */ 16 - 17 - struct tsc_data { 18 - int wires; 19 - int x_plate_resistance; 20 - int steps_to_configure; 21 - }; 22 - 23 - #endif
+10 -7
include/linux/mfd/88pm80x.h
··· 17 17 #include <linux/regmap.h> 18 18 #include <linux/atomic.h> 19 19 20 - #define PM80X_VERSION_MASK (0xFF) /* 80X chip ID mask */ 21 20 enum { 22 21 CHIP_INVALID = 0, 23 22 CHIP_PM800, ··· 298 299 struct regmap *regmap; 299 300 struct regmap_irq_chip *regmap_irq_chip; 300 301 struct regmap_irq_chip_data *irq_data; 301 - unsigned char version; 302 - int id; 302 + int type; 303 303 int irq; 304 304 int irq_mode; 305 305 unsigned long wu_flag; ··· 307 309 308 310 struct pm80x_platform_data { 309 311 struct pm80x_rtc_pdata *rtc; 310 - unsigned short power_page_addr; /* power page I2C address */ 311 - unsigned short gpadc_page_addr; /* gpadc page I2C address */ 312 + /* 313 + * For the regulator not defined, set regulators[not_defined] to be 314 + * NULL. num_regulators are the number of regulators supposed to be 315 + * initialized. If all regulators are not defined, set num_regulators 316 + * to be 0. 317 + */ 318 + struct regulator_init_data *regulators[PM800_ID_RG_MAX]; 319 + unsigned int num_regulators; 312 320 int irq_mode; /* Clear interrupt by read/write(0/1) */ 313 321 int batt_det; /* enable/disable */ 314 322 int (*plat_config)(struct pm80x_chip *chip, ··· 367 363 } 368 364 #endif 369 365 370 - extern int pm80x_init(struct i2c_client *client, 371 - const struct i2c_device_id *id); 366 + extern int pm80x_init(struct i2c_client *client); 372 367 extern int pm80x_deinit(void); 373 368 #endif /* __LINUX_MFD_88PM80X_H */
+2
include/linux/mfd/abx500/ab8500.h
··· 291 291 #define AB8540_INT_FSYNC2R 213 292 292 #define AB8540_INT_BITCLK2F 214 293 293 #define AB8540_INT_BITCLK2R 215 294 + /* ab8540_irq_regoffset[27] -> IT[Source|Latch|Mask]33 */ 295 + #define AB8540_INT_RTC_1S 216 294 296 295 297 /* 296 298 * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the
+2
include/linux/mfd/arizona/core.h
··· 23 23 enum arizona_type { 24 24 WM5102 = 1, 25 25 WM5110 = 2, 26 + WM8997 = 3, 26 27 }; 27 28 28 29 #define ARIZONA_IRQ_GP1 0 ··· 122 121 123 122 int wm5102_patch(struct arizona *arizona); 124 123 int wm5110_patch(struct arizona *arizona); 124 + int wm8997_patch(struct arizona *arizona); 125 125 126 126 #endif
+2 -2
include/linux/mfd/davinci_voicecodec.h
··· 28 28 #include <linux/mfd/core.h> 29 29 #include <linux/platform_data/edma.h> 30 30 31 + #include <mach/hardware.h> 32 + 31 33 /* 32 34 * Register values. 33 35 */ ··· 113 111 114 112 /* Memory resources */ 115 113 void __iomem *base; 116 - resource_size_t pbase; 117 - size_t base_size; 118 114 119 115 /* MFD cells */ 120 116 struct mfd_cell cells[DAVINCI_VC_CELLS];
+125
include/linux/mfd/kempld.h
··· 1 + /* 2 + * Kontron PLD driver definitions 3 + * 4 + * Copyright (c) 2010-2012 Kontron Europe GmbH 5 + * Author: Michael Brunner <michael.brunner@kontron.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 2 as published 9 + * by the Free Software Foundation. 10 + */ 11 + 12 + #ifndef _LINUX_MFD_KEMPLD_H_ 13 + #define _LINUX_MFD_KEMPLD_H_ 14 + 15 + /* kempld register definitions */ 16 + #define KEMPLD_IOINDEX 0xa80 17 + #define KEMPLD_IODATA 0xa81 18 + #define KEMPLD_MUTEX_KEY 0x80 19 + #define KEMPLD_VERSION 0x00 20 + #define KEMPLD_VERSION_LSB 0x00 21 + #define KEMPLD_VERSION_MSB 0x01 22 + #define KEMPLD_VERSION_GET_MINOR(x) (x & 0x1f) 23 + #define KEMPLD_VERSION_GET_MAJOR(x) ((x >> 5) & 0x1f) 24 + #define KEMPLD_VERSION_GET_NUMBER(x) ((x >> 10) & 0xf) 25 + #define KEMPLD_VERSION_GET_TYPE(x) ((x >> 14) & 0x3) 26 + #define KEMPLD_BUILDNR 0x02 27 + #define KEMPLD_BUILDNR_LSB 0x02 28 + #define KEMPLD_BUILDNR_MSB 0x03 29 + #define KEMPLD_FEATURE 0x04 30 + #define KEMPLD_FEATURE_LSB 0x04 31 + #define KEMPLD_FEATURE_MSB 0x05 32 + #define KEMPLD_FEATURE_BIT_I2C (1 << 0) 33 + #define KEMPLD_FEATURE_BIT_WATCHDOG (1 << 1) 34 + #define KEMPLD_FEATURE_BIT_GPIO (1 << 2) 35 + #define KEMPLD_FEATURE_MASK_UART (7 << 3) 36 + #define KEMPLD_FEATURE_BIT_NMI (1 << 8) 37 + #define KEMPLD_FEATURE_BIT_SMI (1 << 9) 38 + #define KEMPLD_FEATURE_BIT_SCI (1 << 10) 39 + #define KEMPLD_SPEC 0x06 40 + #define KEMPLD_SPEC_GET_MINOR(x) (x & 0x0f) 41 + #define KEMPLD_SPEC_GET_MAJOR(x) ((x >> 4) & 0x0f) 42 + #define KEMPLD_IRQ_GPIO 0x35 43 + #define KEMPLD_IRQ_I2C 0x36 44 + #define KEMPLD_CFG 0x37 45 + #define KEMPLD_CFG_GPIO_I2C_MUX (1 << 0) 46 + #define KEMPLD_CFG_BIOS_WP (1 << 7) 47 + 48 + #define KEMPLD_CLK 33333333 49 + 50 + #define KEMPLD_TYPE_RELEASE 0x0 51 + #define KEMPLD_TYPE_DEBUG 0x1 52 + #define KEMPLD_TYPE_CUSTOM 0x2 53 + 54 + /** 55 + * struct kempld_info - PLD device information structure 56 + * @major: PLD major revision 57 + * @minor: PLD minor revision 58 + * @buildnr: PLD build number 59 + * @number: PLD board specific index 60 + * @type: PLD type 61 + * @spec_major: PLD FW specification major revision 62 + * @spec_minor: PLD FW specification minor revision 63 + */ 64 + struct kempld_info { 65 + unsigned int major; 66 + unsigned int minor; 67 + unsigned int buildnr; 68 + unsigned int number; 69 + unsigned int type; 70 + unsigned int spec_major; 71 + unsigned int spec_minor; 72 + }; 73 + 74 + /** 75 + * struct kempld_device_data - Internal representation of the PLD device 76 + * @io_base: Pointer to the IO memory 77 + * @io_index: Pointer to the IO index register 78 + * @io_data: Pointer to the IO data register 79 + * @pld_clock: PLD clock frequency 80 + * @feature_mask: PLD feature mask 81 + * @dev: Pointer to kernel device structure 82 + * @info: KEMPLD info structure 83 + * @lock: PLD mutex 84 + */ 85 + struct kempld_device_data { 86 + void __iomem *io_base; 87 + void __iomem *io_index; 88 + void __iomem *io_data; 89 + u32 pld_clock; 90 + u32 feature_mask; 91 + struct device *dev; 92 + struct kempld_info info; 93 + struct mutex lock; 94 + }; 95 + 96 + /** 97 + * struct kempld_platform_data - PLD hardware configuration structure 98 + * @pld_clock: PLD clock frequency 99 + * @gpio_base GPIO base pin number 100 + * @ioresource: IO addresses of the PLD 101 + * @get_mutex: PLD specific get_mutex callback 102 + * @release_mutex: PLD specific release_mutex callback 103 + * @get_info: PLD specific get_info callback 104 + * @register_cells: PLD specific register_cells callback 105 + */ 106 + struct kempld_platform_data { 107 + u32 pld_clock; 108 + int gpio_base; 109 + struct resource *ioresource; 110 + void (*get_hardware_mutex) (struct kempld_device_data *); 111 + void (*release_hardware_mutex) (struct kempld_device_data *); 112 + int (*get_info) (struct kempld_device_data *); 113 + int (*register_cells) (struct kempld_device_data *); 114 + }; 115 + 116 + extern void kempld_get_mutex(struct kempld_device_data *pld); 117 + extern void kempld_release_mutex(struct kempld_device_data *pld); 118 + extern u8 kempld_read8(struct kempld_device_data *pld, u8 index); 119 + extern void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data); 120 + extern u16 kempld_read16(struct kempld_device_data *pld, u8 index); 121 + extern void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data); 122 + extern u32 kempld_read32(struct kempld_device_data *pld, u8 index); 123 + extern void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data); 124 + 125 + #endif /* _LINUX_MFD_KEMPLD_H_ */
+6 -1
include/linux/mfd/max8998-private.h
··· 132 132 133 133 #define MAX8998_ENRAMP (1 << 4) 134 134 135 + struct irq_domain; 136 + 135 137 /** 136 138 * struct max8998_dev - max8998 master device for sub-drivers 137 139 * @dev: master device of the chip (can be used to access platform data) 140 + * @pdata: platform data for the driver and subdrivers 138 141 * @i2c: i2c client private data for regulator 139 142 * @rtc: i2c client private data for rtc 140 143 * @iolock: mutex for serializing io access ··· 151 148 */ 152 149 struct max8998_dev { 153 150 struct device *dev; 151 + struct max8998_platform_data *pdata; 154 152 struct i2c_client *i2c; 155 153 struct i2c_client *rtc; 156 154 struct mutex iolock; 157 155 struct mutex irqlock; 158 156 159 - int irq_base; 157 + unsigned int irq_base; 158 + struct irq_domain *irq_domain; 160 159 int irq; 161 160 int ono; 162 161 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
+7 -13
include/linux/mfd/max8998.h
··· 58 58 * max8998_regulator_data - regulator data 59 59 * @id: regulator id 60 60 * @initdata: regulator init data (contraints, supplies, ...) 61 + * @reg_node: DT node of regulator (unused on non-DT platforms) 61 62 */ 62 63 struct max8998_regulator_data { 63 64 int id; 64 65 struct regulator_init_data *initdata; 66 + struct device_node *reg_node; 65 67 }; 66 68 67 69 /** ··· 75 73 * @buck_voltage_lock: Do NOT change the values of the following six 76 74 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot 77 75 * be other than the preset values. 78 - * @buck1_voltage1: BUCK1 DVS mode 1 voltage register 79 - * @buck1_voltage2: BUCK1 DVS mode 2 voltage register 80 - * @buck1_voltage3: BUCK1 DVS mode 3 voltage register 81 - * @buck1_voltage4: BUCK1 DVS mode 4 voltage register 82 - * @buck2_voltage1: BUCK2 DVS mode 1 voltage register 83 - * @buck2_voltage2: BUCK2 DVS mode 2 voltage register 76 + * @buck1_voltage: BUCK1 DVS mode 1 voltage registers 77 + * @buck2_voltage: BUCK2 DVS mode 2 voltage registers 84 78 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage 85 79 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage 86 80 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 ··· 98 100 struct max8998_platform_data { 99 101 struct max8998_regulator_data *regulators; 100 102 int num_regulators; 101 - int irq_base; 103 + unsigned int irq_base; 102 104 int ono; 103 105 bool buck_voltage_lock; 104 - int buck1_voltage1; 105 - int buck1_voltage2; 106 - int buck1_voltage3; 107 - int buck1_voltage4; 108 - int buck2_voltage1; 109 - int buck2_voltage2; 106 + int buck1_voltage[4]; 107 + int buck2_voltage[2]; 110 108 int buck1_set1; 111 109 int buck1_set2; 112 110 int buck1_default_idx;
+14
include/linux/mfd/palmas.h
··· 34 34 ((a) == PALMAS_CHIP_ID)) 35 35 #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) 36 36 37 + /** 38 + * Palmas PMIC feature types 39 + * 40 + * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10_BOOST 41 + * regulator. 42 + * 43 + * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a 44 + * specific feature (above) or not. Return non-zero, if yes. 45 + */ 46 + #define PALMAS_PMIC_FEATURE_SMPS10_BOOST BIT(0) 47 + #define PALMAS_PMIC_HAS(b, f) \ 48 + ((b)->features & PALMAS_PMIC_FEATURE_ ## f) 49 + 37 50 struct palmas_pmic; 38 51 struct palmas_gpadc; 39 52 struct palmas_resource; ··· 67 54 /* Stored chip id */ 68 55 int id; 69 56 57 + unsigned int features; 70 58 /* IRQ Data */ 71 59 int irq; 72 60 u32 irq_mask;
+1
include/linux/mfd/rtsx_pci.h
··· 575 575 576 576 #define CARD_PWR_CTL 0xFD50 577 577 #define CARD_CLK_SWITCH 0xFD51 578 + #define RTL8411B_PACKAGE_MODE 0xFD51 578 579 #define CARD_SHARE_MODE 0xFD52 579 580 #define CARD_DRIVE_SEL 0xFD53 580 581 #define CARD_STOP 0xFD54
-6
include/linux/mfd/samsung/core.h
··· 14 14 #ifndef __LINUX_MFD_SEC_CORE_H 15 15 #define __LINUX_MFD_SEC_CORE_H 16 16 17 - #define NUM_IRQ_REGS 4 18 - 19 17 enum sec_device_type { 20 18 S5M8751X, 21 19 S5M8763X, ··· 42 44 struct regmap *regmap; 43 45 struct i2c_client *i2c; 44 46 struct i2c_client *rtc; 45 - struct mutex iolock; 46 - struct mutex irqlock; 47 47 48 48 int device_type; 49 49 int irq_base; ··· 49 53 struct regmap_irq_chip_data *irq_data; 50 54 51 55 int ono; 52 - u8 irq_masks_cur[NUM_IRQ_REGS]; 53 - u8 irq_masks_cache[NUM_IRQ_REGS]; 54 56 int type; 55 57 bool wakeup; 56 58 };
+18 -17
include/linux/mfd/ti_am335x_tscadc.h
··· 30 30 #define REG_IDLECONFIG 0x058 31 31 #define REG_CHARGECONFIG 0x05C 32 32 #define REG_CHARGEDELAY 0x060 33 - #define REG_STEPCONFIG(n) (0x64 + ((n - 1) * 8)) 34 - #define REG_STEPDELAY(n) (0x68 + ((n - 1) * 8)) 33 + #define REG_STEPCONFIG(n) (0x64 + ((n) * 8)) 34 + #define REG_STEPDELAY(n) (0x68 + ((n) * 8)) 35 35 #define REG_FIFO0CNT 0xE4 36 36 #define REG_FIFO0THR 0xE8 37 37 #define REG_FIFO1CNT 0xF0 ··· 46 46 /* Step Enable */ 47 47 #define STEPENB_MASK (0x1FFFF << 0) 48 48 #define STEPENB(val) ((val) << 0) 49 - #define STPENB_STEPENB STEPENB(0x1FFFF) 50 - #define STPENB_STEPENB_TC STEPENB(0x1FFF) 51 49 52 50 /* IRQ enable */ 53 51 #define IRQENB_HW_PEN BIT(0) ··· 71 73 #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) 72 74 #define STEPCONFIG_INP_MASK (0xF << 19) 73 75 #define STEPCONFIG_INP(val) ((val) << 19) 74 - #define STEPCONFIG_INP_AN2 STEPCONFIG_INP(2) 75 - #define STEPCONFIG_INP_AN3 STEPCONFIG_INP(3) 76 76 #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) 77 77 #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) 78 78 #define STEPCONFIG_FIFO1 BIT(26) ··· 92 96 #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) 93 97 #define STEPCHARGE_INP_MASK (0xF << 19) 94 98 #define STEPCHARGE_INP(val) ((val) << 19) 95 - #define STEPCHARGE_INP_AN1 STEPCHARGE_INP(1) 96 99 #define STEPCHARGE_RFM_MASK (3 << 23) 97 100 #define STEPCHARGE_RFM(val) ((val) << 23) 98 101 #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) ··· 120 125 121 126 #define TSCADC_CELLS 2 122 127 123 - enum tscadc_cells { 124 - TSC_CELL, 125 - ADC_CELL, 126 - }; 127 - 128 - struct mfd_tscadc_board { 129 - struct tsc_data *tsc_init; 130 - struct adc_data *adc_init; 131 - }; 132 - 133 128 struct ti_tscadc_dev { 134 129 struct device *dev; 135 130 struct regmap *regmap_tscadc; 136 131 void __iomem *tscadc_base; 137 132 int irq; 133 + int used_cells; /* 1-2 */ 134 + int tsc_cell; /* -1 if not used */ 135 + int adc_cell; /* -1 if not used */ 138 136 struct mfd_cell cells[TSCADC_CELLS]; 137 + u32 reg_se_cache; 138 + spinlock_t reg_lock; 139 139 140 140 /* tsc device */ 141 141 struct titsc *tsc; ··· 138 148 /* adc device */ 139 149 struct adc_device *adc; 140 150 }; 151 + 152 + static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) 153 + { 154 + struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data; 155 + 156 + return *tscadc_dev; 157 + } 158 + 159 + void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); 160 + void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); 161 + void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); 141 162 142 163 #endif
+2
include/linux/mfd/wm8994/core.h
··· 29 29 30 30 struct regulator_dev; 31 31 struct regulator_bulk_data; 32 + struct irq_domain; 32 33 33 34 #define WM8994_NUM_GPIO_REGS 11 34 35 #define WM8994_NUM_LDO_REGS 2 ··· 74 73 75 74 int irq; 76 75 struct regmap_irq_chip_data *irq_data; 76 + struct irq_domain *edge_irq; 77 77 78 78 /* Used over suspend/resume */ 79 79 bool suspended;
+5
include/linux/mfd/wm8994/pdata.h
··· 228 228 * lines is mastered. 229 229 */ 230 230 int max_channels_clocked[WM8994_NUM_AIF]; 231 + 232 + /** 233 + * GPIO for the IRQ pin if host only supports edge triggering 234 + */ 235 + int irq_gpio; 231 236 }; 232 237 233 238 #endif
-14
include/linux/platform_data/ti_am335x_adc.h
··· 1 - #ifndef __LINUX_TI_AM335X_ADC_H 2 - #define __LINUX_TI_AM335X_ADC_H 3 - 4 - /** 5 - * struct adc_data ADC Input information 6 - * @adc_channels: Number of analog inputs 7 - * available for ADC. 8 - */ 9 - 10 - struct adc_data { 11 - unsigned int adc_channels; 12 - }; 13 - 14 - #endif