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

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

Pull MFD updates from Lee Jones:
"New Drivers:
- Freescale Touch Screen ADC
- X-Powers AXP PMIC with RSB
- TI TPS65086 Power Management IC (PMIC)

New Device Support:
- Supply device PCI IDs for Intel Broxton

Fix-ups:
- Move to clkdev_create() API; intel_quark_i2c_gpio
- Complete re-write of TI's TPS65912 Power Management IC (PMIC)
- Remove unnecessary function argument; axp20x
- Separate out bus related code; axp20x
- Coding Style changes; axp20x
- Allow more drivers to be compiled as modules
- Work around false positive 'used uninitialised' warning; db8500-prcmu

Bug Fixes:
- Remove do_div(); fsl-imx25-gcq
- Fix driver init when built-in; tps65010
- Fix clock-unregister leak; intel-lpss"

* tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits)
mfd: intel-lpss: Pass I2C configuration via properties on BXT
mfd: imx6sx: Add PCIe register definitions for iomuxc gpr
mfd: ipaq-micro: Use __maybe_unused to hide pm functions
mfd: max77686: Add max77802 to I2C device ID table
mfd: max77686: Export OF module alias information
mfd: max77686: Allow driver to be built as a module
mfd: stmpe: Add the proper PWM resources
mfd: tps65090: Set regmap config reg counts properly
mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled
mfd: as3711: Set regmap config reg counts properly
mfd: rc5t583: Set regmap config reg counts properly
gpio: tps65086: Add GPO driver for the TPS65086 PMIC
mfd: mt6397: Add platform device ID table
mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
mfd: mt6397: Add MT6323 support to MT6397 driver
mfd: mt6397: Add support for different Slave types
mfd: mt6397: int_con and int_status may vary in location
dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC
mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists
mfd: Add documentation for ACT8945A DT bindings
...

+3256 -277
+58
Documentation/devicetree/bindings/iio/adc/fsl,imx25-gcq.txt
··· 1 + Freescale i.MX25 ADC GCQ device 2 + 3 + This is a generic conversion queue device that can convert any of the 4 + analog inputs using the ADC unit of the i.MX25. 5 + 6 + Required properties: 7 + - compatible: Should be "fsl,imx25-gcq". 8 + - reg: Should be the register range of the module. 9 + - interrupts: Should be the interrupt number of the module. 10 + Typically this is <1>. 11 + - interrupt-parent: phandle to the tsadc module of the i.MX25. 12 + - #address-cells: Should be <1> (setting for the subnodes) 13 + - #size-cells: Should be <0> (setting for the subnodes) 14 + 15 + Optional properties: 16 + - vref-ext-supply: The regulator supplying the ADC reference voltage. 17 + Required when at least one subnode uses the this reference. 18 + - vref-xp-supply: The regulator supplying the ADC reference voltage on pin XP. 19 + Required when at least one subnode uses this reference. 20 + - vref-yp-supply: The regulator supplying the ADC reference voltage on pin YP. 21 + Required when at least one subnode uses this reference. 22 + 23 + Sub-nodes: 24 + Optionally you can define subnodes which define the reference voltage 25 + for the analog inputs. 26 + 27 + Required properties for subnodes: 28 + - reg: Should be the number of the analog input. 29 + 0: xp 30 + 1: yp 31 + 2: xn 32 + 3: yn 33 + 4: wiper 34 + 5: inaux0 35 + 6: inaux1 36 + 7: inaux2 37 + Optional properties for subnodes: 38 + - fsl,adc-refp: specifies the positive reference input as defined in 39 + <dt-bindings/iio/adc/fsl-imx25-gcq.h> 40 + - fsl,adc-refn: specifies the negative reference input as defined in 41 + <dt-bindings/iio/adc/fsl-imx25-gcq.h> 42 + 43 + Example: 44 + 45 + adc: adc@50030800 { 46 + compatible = "fsl,imx25-gcq"; 47 + reg = <0x50030800 0x60>; 48 + interrupt-parent = <&tscadc>; 49 + interrupts = <1>; 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + 53 + inaux@5 { 54 + reg = <5>; 55 + fsl,adc-refp = <MX25_ADC_REFP_INT>; 56 + fsl,adc-refn = <MX25_ADC_REFN_NGND>; 57 + }; 58 + };
+35
Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt
··· 1 + Freescale mx25 TS conversion queue module 2 + 3 + mx25 touchscreen conversion queue module which controls the ADC unit of the 4 + mx25 for attached touchscreens. 5 + 6 + Required properties: 7 + - compatible: Should be "fsl,imx25-tcq". 8 + - reg: Memory range of the device. 9 + - interrupts: Should be the interrupt number associated with this module within 10 + the tscadc unit (<0>). 11 + - interrupt-parent: Should be a phandle to the tscadc unit. 12 + - fsl,wires: Should be '<4>' or '<5>' 13 + 14 + Optional properties: 15 + - fsl,pen-debounce-ns: Pen debounce time in nanoseconds. 16 + - fsl,pen-threshold: Pen-down threshold for the touchscreen. This is a value 17 + between 1 and 4096. It is the ratio between the internal reference voltage 18 + and the measured voltage after the plate was precharged. Resistence between 19 + plates and therefore the voltage decreases with pressure so that a smaller 20 + value is equivalent to a higher pressure. 21 + - fsl,settling-time-ns: Settling time in nanoseconds. The settling time is before 22 + the actual touch detection to wait for an even charge distribution in the 23 + plate. 24 + 25 + This device includes two conversion queues which can be added as subnodes. 26 + The first queue is for the touchscreen, the second for general purpose ADC. 27 + 28 + Example: 29 + tsc: tcq@50030400 { 30 + compatible = "fsl,imx25-tcq"; 31 + reg = <0x50030400 0x60>; 32 + interrupt-parent = <&tscadc>; 33 + interrupts = <0>; 34 + fsl,wires = <4>; 35 + };
+76
Documentation/devicetree/bindings/mfd/act8945a.txt
··· 1 + Device-Tree bindings for Active-semi ACT8945A MFD driver 2 + 3 + Required properties: 4 + - compatible: "active-semi,act8945a". 5 + - reg: the I2C slave address for the ACT8945A chip 6 + 7 + The chip exposes two subdevices: 8 + - a regulators: see ../regulator/act8945a-regulator.txt 9 + - a charger: see ../power/act8945a-charger.txt 10 + 11 + Example: 12 + pmic@5b { 13 + compatible = "active-semi,act8945a"; 14 + reg = <0x5b>; 15 + status = "okay"; 16 + 17 + pinctrl-names = "default"; 18 + pinctrl-0 = <&pinctrl_charger_chglev>; 19 + active-semi,chglev-gpio = <&pioA 12 GPIO_ACTIVE_HIGH>; 20 + active-semi,input-voltage-threshold-microvolt = <6600>; 21 + active-semi,precondition-timeout = <40>; 22 + active-semi,total-timeout = <3>; 23 + 24 + active-semi,vsel-high; 25 + 26 + regulators { 27 + vdd_1v35_reg: REG_DCDC1 { 28 + regulator-name = "VDD_1V35"; 29 + regulator-min-microvolt = <1350000>; 30 + regulator-max-microvolt = <1350000>; 31 + regulator-always-on; 32 + }; 33 + 34 + vdd_1v2_reg: REG_DCDC2 { 35 + regulator-name = "VDD_1V2"; 36 + regulator-min-microvolt = <1100000>; 37 + regulator-max-microvolt = <1300000>; 38 + regulator-always-on; 39 + }; 40 + 41 + vdd_3v3_reg: REG_DCDC3 { 42 + regulator-name = "VDD_3V3"; 43 + regulator-min-microvolt = <3300000>; 44 + regulator-max-microvolt = <3300000>; 45 + regulator-always-on; 46 + }; 47 + 48 + vdd_fuse_reg: REG_LDO1 { 49 + regulator-name = "VDD_FUSE"; 50 + regulator-min-microvolt = <2500000>; 51 + regulator-max-microvolt = <2500000>; 52 + regulator-always-on; 53 + }; 54 + 55 + vdd_3v3_lp_reg: REG_LDO2 { 56 + regulator-name = "VDD_3V3_LP"; 57 + regulator-min-microvolt = <3300000>; 58 + regulator-max-microvolt = <3300000>; 59 + regulator-always-on; 60 + }; 61 + 62 + vdd_led_reg: REG_LDO3 { 63 + regulator-name = "VDD_LED"; 64 + regulator-min-microvolt = <3300000>; 65 + regulator-max-microvolt = <3300000>; 66 + regulator-always-on; 67 + }; 68 + 69 + vdd_sdhc_1v8_reg: REG_LDO4 { 70 + regulator-name = "VDD_SDHC_1V8"; 71 + regulator-min-microvolt = <1800000>; 72 + regulator-max-microvolt = <1800000>; 73 + regulator-always-on; 74 + }; 75 + }; 76 + };
+4 -3
Documentation/devicetree/bindings/mfd/axp20x.txt
··· 5 5 axp202 (X-Powers) 6 6 axp209 (X-Powers) 7 7 axp221 (X-Powers) 8 + axp223 (X-Powers) 8 9 9 10 Required properties: 10 11 - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209", 11 - "x-powers,axp221" 12 - - reg: The I2C slave address for the AXP chip 12 + "x-powers,axp221", "x-powers,axp223" 13 + - reg: The I2C slave address or RSB hardware address for the AXP chip 13 14 - interrupt-parent: The parent interrupt controller 14 15 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin 15 16 - interrupt-controller: The PMIC has its own internal IRQs ··· 52 51 LDO4 : LDO : ldo24in-supply : shared supply 53 52 LDO5 : LDO : ldo5in-supply 54 53 55 - AXP221 regulators, type, and corresponding input supply names: 54 + AXP221/AXP223 regulators, type, and corresponding input supply names: 56 55 57 56 Regulator Type Supply Name Notes 58 57 --------- ---- ----------- -----
+47
Documentation/devicetree/bindings/mfd/fsl-imx25-tsadc.txt
··· 1 + Freescale MX25 ADC/TSC MultiFunction Device (MFD) 2 + 3 + This device combines two general purpose conversion queues one used for general 4 + ADC and the other used for touchscreens. 5 + 6 + Required properties: 7 + - compatible: Should be "fsl,imx25-tsadc". 8 + - reg: Start address and size of the memory area of 9 + the device 10 + - interrupts: Interrupt for this device 11 + (See: ../interrupt-controller/interrupts.txt) 12 + - clocks: An 'ipg' clock (See: ../clock/clock-bindings.txt) 13 + - interrupt-controller: This device is an interrupt controller. It 14 + controls the interrupts of both 15 + conversion queues. 16 + - #interrupt-cells: Should be '<1>'. 17 + - #address-cells: Should be '<1>'. 18 + - #size-cells: Should be '<1>'. 19 + 20 + This device includes two conversion queues which can be added as subnodes. 21 + The first queue is for the touchscreen, the second for general purpose ADC. 22 + 23 + Example: 24 + tscadc: tscadc@50030000 { 25 + compatible = "fsl,imx25-tsadc"; 26 + reg = <0x50030000 0xc>; 27 + interrupts = <46>; 28 + clocks = <&clks 119>; 29 + clock-names = "ipg"; 30 + interrupt-controller; 31 + #interrupt-cells = <1>; 32 + #address-cells = <1>; 33 + #size-cells = <1>; 34 + ranges; 35 + 36 + tsc: tcq@50030400 { 37 + compatible = "fsl,imx25-tcq"; 38 + reg = <0x50030400 0x60>; 39 + ... 40 + }; 41 + 42 + adc: gcq@50030800 { 43 + compatible = "fsl,imx25-gcq"; 44 + reg = <0x50030800 0x60>; 45 + ... 46 + }; 47 + };
+6 -4
Documentation/devicetree/bindings/mfd/mt6397.txt
··· 1 - MediaTek MT6397 Multifunction Device Driver 1 + MediaTek MT6397/MT6323 Multifunction Device Driver 2 2 3 - MT6397 is a multifunction device with the following sub modules: 3 + MT6397/MT6323 is a multifunction device with the following sub modules: 4 4 - Regulator 5 5 - RTC 6 6 - Audio codec ··· 8 8 - Clock 9 9 10 10 It is interfaced to host controller using SPI interface by a proprietary hardware 11 - called PMIC wrapper or pwrap. MT6397 MFD is a child device of pwrap. 11 + called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap. 12 12 See the following for pwarp node definitions: 13 13 Documentation/devicetree/bindings/soc/pwrap.txt 14 14 15 15 This document describes the binding for MFD device and its sub module. 16 16 17 17 Required properties: 18 - compatible: "mediatek,mt6397" 18 + compatible: "mediatek,mt6397" or "mediatek,mt6323" 19 19 20 20 Optional subnodes: 21 21 ··· 26 26 Required properties: 27 27 - compatible: "mediatek,mt6397-regulator" 28 28 see Documentation/devicetree/bindings/regulator/mt6397-regulator.txt 29 + - compatible: "mediatek,mt6323-regulator" 30 + see Documentation/devicetree/bindings/regulator/mt6323-regulator.txt 29 31 - codec 30 32 Required properties: 31 33 - compatible: "mediatek,mt6397-codec"
+55
Documentation/devicetree/bindings/mfd/tps65086.txt
··· 1 + * TPS65086 Power Management Integrated Circuit (PMIC) bindings 2 + 3 + Required properties: 4 + - compatible : Should be "ti,tps65086". 5 + - reg : I2C slave address. 6 + - interrupt-parent : Phandle to the parent interrupt controller. 7 + - interrupts : The interrupt line the device is connected to. 8 + - interrupt-controller : Marks the device node as an interrupt controller. 9 + - #interrupt-cells : The number of cells to describe an IRQ, should be 2. 10 + The first cell is the IRQ number. 11 + The second cell is the flags, encoded as trigger 12 + masks from ../interrupt-controller/interrupts.txt. 13 + - gpio-controller : Marks the device node as a GPIO Controller. 14 + - #gpio-cells : Should be two. The first cell is the pin number and 15 + the second cell is used to specify flags. 16 + See ../gpio/gpio.txt for more information. 17 + - regulators: : List of child nodes that specify the regulator 18 + initialization data. Child nodes must be named 19 + after their hardware counterparts: buck[1-6], 20 + ldoa[1-3], swa1, swb[1-2], and vtt. Each child 21 + node is defined using the standard binding for 22 + regulators and the optional regulator properties 23 + defined below. 24 + 25 + Optional regulator properties: 26 + - ti,regulator-step-size-25mv : This is applicable for buck[1,2,6], set this 27 + if the regulator is factory set with a 25mv 28 + step voltage mapping. 29 + - ti,regulator-decay : This is applicable for buck[1-6], set this if 30 + the output needs to decay, default is for 31 + the output to slew down. 32 + 33 + Example: 34 + 35 + pmic: tps65086@5e { 36 + compatible = "ti,tps65086"; 37 + reg = <0x5e>; 38 + interrupt-parent = <&gpio1>; 39 + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; 40 + interrupt-controller; 41 + #interrupt-cells = <2>; 42 + gpio-controller; 43 + #gpio-cells = <2>; 44 + 45 + regulators { 46 + buck1 { 47 + regulator-name = "vcc1"; 48 + regulator-min-microvolt = <1600000>; 49 + regulator-max-microvolt = <1600000>; 50 + regulator-boot-on; 51 + ti,regulator-decay; 52 + ti,regulator-step-size-25mv; 53 + }; 54 + }; 55 + };
+6
drivers/gpio/Kconfig
··· 898 898 ---help--- 899 899 Add support for the GPIO IP in the timberdale FPGA. 900 900 901 + config GPIO_TPS65086 902 + tristate "TI TPS65086 GPO" 903 + depends on MFD_TPS65086 904 + help 905 + This driver supports the GPO on TI TPS65086x PMICs. 906 + 901 907 config GPIO_TPS65218 902 908 tristate "TPS65218 GPIO" 903 909 depends on MFD_TPS65218
+1
drivers/gpio/Makefile
··· 99 99 obj-$(CONFIG_GPIO_TIMBERDALE) += gpio-timberdale.o 100 100 obj-$(CONFIG_GPIO_PALMAS) += gpio-palmas.o 101 101 obj-$(CONFIG_GPIO_TPIC2810) += gpio-tpic2810.o 102 + obj-$(CONFIG_GPIO_TPS65086) += gpio-tps65086.o 102 103 obj-$(CONFIG_GPIO_TPS65218) += gpio-tps65218.o 103 104 obj-$(CONFIG_GPIO_TPS6586X) += gpio-tps6586x.o 104 105 obj-$(CONFIG_GPIO_TPS65910) += gpio-tps65910.o
+139
drivers/gpio/gpio-tps65086.c
··· 1 + /* 2 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 3 + * Andrew F. Davis <afd@ti.com> 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + * 9 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 10 + * kind, whether expressed or implied; without even the implied warranty 11 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License version 2 for more details. 13 + * 14 + * Based on the TPS65912 driver 15 + */ 16 + 17 + #include <linux/gpio.h> 18 + #include <linux/module.h> 19 + #include <linux/platform_device.h> 20 + 21 + #include <linux/mfd/tps65086.h> 22 + 23 + struct tps65086_gpio { 24 + struct gpio_chip chip; 25 + struct tps65086 *tps; 26 + }; 27 + 28 + static int tps65086_gpio_get_direction(struct gpio_chip *chip, 29 + unsigned offset) 30 + { 31 + /* This device is output only */ 32 + return 0; 33 + } 34 + 35 + static int tps65086_gpio_direction_input(struct gpio_chip *chip, 36 + unsigned offset) 37 + { 38 + /* This device is output only */ 39 + return -EINVAL; 40 + } 41 + 42 + static int tps65086_gpio_direction_output(struct gpio_chip *chip, 43 + unsigned offset, int value) 44 + { 45 + struct tps65086_gpio *gpio = gpiochip_get_data(chip); 46 + 47 + /* Set the initial value */ 48 + regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL, 49 + BIT(4 + offset), value ? BIT(4 + offset) : 0); 50 + 51 + return 0; 52 + } 53 + 54 + static int tps65086_gpio_get(struct gpio_chip *chip, unsigned offset) 55 + { 56 + struct tps65086_gpio *gpio = gpiochip_get_data(chip); 57 + int ret, val; 58 + 59 + ret = regmap_read(gpio->tps->regmap, TPS65086_GPOCTRL, &val); 60 + if (ret < 0) 61 + return ret; 62 + 63 + return val & BIT(4 + offset); 64 + } 65 + 66 + static void tps65086_gpio_set(struct gpio_chip *chip, unsigned offset, 67 + int value) 68 + { 69 + struct tps65086_gpio *gpio = gpiochip_get_data(chip); 70 + 71 + regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL, 72 + BIT(4 + offset), value ? BIT(4 + offset) : 0); 73 + } 74 + 75 + static struct gpio_chip template_chip = { 76 + .label = "tps65086-gpio", 77 + .owner = THIS_MODULE, 78 + .get_direction = tps65086_gpio_get_direction, 79 + .direction_input = tps65086_gpio_direction_input, 80 + .direction_output = tps65086_gpio_direction_output, 81 + .get = tps65086_gpio_get, 82 + .set = tps65086_gpio_set, 83 + .base = -1, 84 + .ngpio = 4, 85 + .can_sleep = true, 86 + }; 87 + 88 + static int tps65086_gpio_probe(struct platform_device *pdev) 89 + { 90 + struct tps65086_gpio *gpio; 91 + int ret; 92 + 93 + gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 94 + if (!gpio) 95 + return -ENOMEM; 96 + 97 + platform_set_drvdata(pdev, gpio); 98 + 99 + gpio->tps = dev_get_drvdata(pdev->dev.parent); 100 + gpio->chip = template_chip; 101 + gpio->chip.parent = gpio->tps->dev; 102 + 103 + ret = gpiochip_add_data(&gpio->chip, gpio); 104 + if (ret < 0) { 105 + dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); 106 + return ret; 107 + } 108 + 109 + return 0; 110 + } 111 + 112 + static int tps65086_gpio_remove(struct platform_device *pdev) 113 + { 114 + struct tps65086_gpio *gpio = platform_get_drvdata(pdev); 115 + 116 + gpiochip_remove(&gpio->chip); 117 + 118 + return 0; 119 + } 120 + 121 + static const struct platform_device_id tps65086_gpio_id_table[] = { 122 + { "tps65086-gpio", }, 123 + { /* sentinel */ } 124 + }; 125 + MODULE_DEVICE_TABLE(platform, tps65086_gpio_id_table); 126 + 127 + static struct platform_driver tps65086_gpio_driver = { 128 + .driver = { 129 + .name = "tps65086-gpio", 130 + }, 131 + .probe = tps65086_gpio_probe, 132 + .remove = tps65086_gpio_remove, 133 + .id_table = tps65086_gpio_id_table, 134 + }; 135 + module_platform_driver(tps65086_gpio_driver); 136 + 137 + MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>"); 138 + MODULE_DESCRIPTION("TPS65086 GPIO driver"); 139 + MODULE_LICENSE("GPL v2");
+7
drivers/iio/adc/Kconfig
··· 194 194 To compile this driver as a module, choose M here: the module will be 195 195 called exynos_adc. 196 196 197 + config FSL_MX25_ADC 198 + tristate "Freescale MX25 ADC driver" 199 + depends on MFD_MX25_TSADC 200 + help 201 + Generic Conversion Queue driver used for general purpose ADC in the 202 + MX25. This driver supports single measurements using the MX25 ADC. 203 + 197 204 config HI8435 198 205 tristate "Holt Integrated Circuits HI-8435 threshold detector" 199 206 select IIO_TRIGGERED_EVENT
+1
drivers/iio/adc/Makefile
··· 20 20 obj-$(CONFIG_CC10001_ADC) += cc10001_adc.o 21 21 obj-$(CONFIG_DA9150_GPADC) += da9150-gpadc.o 22 22 obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o 23 + obj-$(CONFIG_FSL_MX25_ADC) += fsl-imx25-gcq.o 23 24 obj-$(CONFIG_HI8435) += hi8435.o 24 25 obj-$(CONFIG_IMX7D_ADC) += imx7d_adc.o 25 26 obj-$(CONFIG_INA2XX_ADC) += ina2xx-adc.o
+417
drivers/iio/adc/fsl-imx25-gcq.c
··· 1 + /* 2 + * Copyright (C) 2014-2015 Pengutronix, Markus Pargmann <mpa@pengutronix.de> 3 + * 4 + * This program is free software; you can redistribute it and/or modify it under 5 + * the terms of the GNU General Public License version 2 as published by the 6 + * Free Software Foundation. 7 + * 8 + * This is the driver for the imx25 GCQ (Generic Conversion Queue) 9 + * connected to the imx25 ADC. 10 + */ 11 + 12 + #include <dt-bindings/iio/adc/fsl-imx25-gcq.h> 13 + #include <linux/clk.h> 14 + #include <linux/iio/iio.h> 15 + #include <linux/interrupt.h> 16 + #include <linux/mfd/imx25-tsadc.h> 17 + #include <linux/module.h> 18 + #include <linux/of.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/regmap.h> 21 + #include <linux/regulator/consumer.h> 22 + 23 + #define MX25_GCQ_TIMEOUT (msecs_to_jiffies(2000)) 24 + 25 + static const char * const driver_name = "mx25-gcq"; 26 + 27 + enum mx25_gcq_cfgs { 28 + MX25_CFG_XP = 0, 29 + MX25_CFG_YP, 30 + MX25_CFG_XN, 31 + MX25_CFG_YN, 32 + MX25_CFG_WIPER, 33 + MX25_CFG_INAUX0, 34 + MX25_CFG_INAUX1, 35 + MX25_CFG_INAUX2, 36 + MX25_NUM_CFGS, 37 + }; 38 + 39 + struct mx25_gcq_priv { 40 + struct regmap *regs; 41 + struct completion completed; 42 + struct clk *clk; 43 + int irq; 44 + struct regulator *vref[4]; 45 + u32 channel_vref_mv[MX25_NUM_CFGS]; 46 + }; 47 + 48 + #define MX25_CQG_CHAN(chan, id) {\ 49 + .type = IIO_VOLTAGE,\ 50 + .indexed = 1,\ 51 + .channel = chan,\ 52 + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 53 + BIT(IIO_CHAN_INFO_SCALE),\ 54 + .datasheet_name = id,\ 55 + } 56 + 57 + static const struct iio_chan_spec mx25_gcq_channels[MX25_NUM_CFGS] = { 58 + MX25_CQG_CHAN(MX25_CFG_XP, "xp"), 59 + MX25_CQG_CHAN(MX25_CFG_YP, "yp"), 60 + MX25_CQG_CHAN(MX25_CFG_XN, "xn"), 61 + MX25_CQG_CHAN(MX25_CFG_YN, "yn"), 62 + MX25_CQG_CHAN(MX25_CFG_WIPER, "wiper"), 63 + MX25_CQG_CHAN(MX25_CFG_INAUX0, "inaux0"), 64 + MX25_CQG_CHAN(MX25_CFG_INAUX1, "inaux1"), 65 + MX25_CQG_CHAN(MX25_CFG_INAUX2, "inaux2"), 66 + }; 67 + 68 + static const char * const mx25_gcq_refp_names[] = { 69 + [MX25_ADC_REFP_YP] = "yp", 70 + [MX25_ADC_REFP_XP] = "xp", 71 + [MX25_ADC_REFP_INT] = "int", 72 + [MX25_ADC_REFP_EXT] = "ext", 73 + }; 74 + 75 + static irqreturn_t mx25_gcq_irq(int irq, void *data) 76 + { 77 + struct mx25_gcq_priv *priv = data; 78 + u32 stats; 79 + 80 + regmap_read(priv->regs, MX25_ADCQ_SR, &stats); 81 + 82 + if (stats & MX25_ADCQ_SR_EOQ) { 83 + regmap_update_bits(priv->regs, MX25_ADCQ_MR, 84 + MX25_ADCQ_MR_EOQ_IRQ, MX25_ADCQ_MR_EOQ_IRQ); 85 + complete(&priv->completed); 86 + } 87 + 88 + /* Disable conversion queue run */ 89 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, 0); 90 + 91 + /* Acknowledge all possible irqs */ 92 + regmap_write(priv->regs, MX25_ADCQ_SR, MX25_ADCQ_SR_FRR | 93 + MX25_ADCQ_SR_FUR | MX25_ADCQ_SR_FOR | 94 + MX25_ADCQ_SR_EOQ | MX25_ADCQ_SR_PD); 95 + 96 + return IRQ_HANDLED; 97 + } 98 + 99 + static int mx25_gcq_get_raw_value(struct device *dev, 100 + struct iio_chan_spec const *chan, 101 + struct mx25_gcq_priv *priv, 102 + int *val) 103 + { 104 + long timeout; 105 + u32 data; 106 + 107 + /* Setup the configuration we want to use */ 108 + regmap_write(priv->regs, MX25_ADCQ_ITEM_7_0, 109 + MX25_ADCQ_ITEM(0, chan->channel)); 110 + 111 + regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_EOQ_IRQ, 0); 112 + 113 + /* Trigger queue for one run */ 114 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, 115 + MX25_ADCQ_CR_FQS); 116 + 117 + timeout = wait_for_completion_interruptible_timeout( 118 + &priv->completed, MX25_GCQ_TIMEOUT); 119 + if (timeout < 0) { 120 + dev_err(dev, "ADC wait for measurement failed\n"); 121 + return timeout; 122 + } else if (timeout == 0) { 123 + dev_err(dev, "ADC timed out\n"); 124 + return -ETIMEDOUT; 125 + } 126 + 127 + regmap_read(priv->regs, MX25_ADCQ_FIFO, &data); 128 + 129 + *val = MX25_ADCQ_FIFO_DATA(data); 130 + 131 + return IIO_VAL_INT; 132 + } 133 + 134 + static int mx25_gcq_read_raw(struct iio_dev *indio_dev, 135 + struct iio_chan_spec const *chan, int *val, 136 + int *val2, long mask) 137 + { 138 + struct mx25_gcq_priv *priv = iio_priv(indio_dev); 139 + int ret; 140 + 141 + switch (mask) { 142 + case IIO_CHAN_INFO_RAW: 143 + mutex_lock(&indio_dev->mlock); 144 + ret = mx25_gcq_get_raw_value(&indio_dev->dev, chan, priv, val); 145 + mutex_unlock(&indio_dev->mlock); 146 + return ret; 147 + 148 + case IIO_CHAN_INFO_SCALE: 149 + *val = priv->channel_vref_mv[chan->channel]; 150 + *val2 = 12; 151 + return IIO_VAL_FRACTIONAL_LOG2; 152 + 153 + default: 154 + return -EINVAL; 155 + } 156 + } 157 + 158 + static const struct iio_info mx25_gcq_iio_info = { 159 + .read_raw = mx25_gcq_read_raw, 160 + }; 161 + 162 + static const struct regmap_config mx25_gcq_regconfig = { 163 + .max_register = 0x5c, 164 + .reg_bits = 32, 165 + .val_bits = 32, 166 + .reg_stride = 4, 167 + }; 168 + 169 + static int mx25_gcq_setup_cfgs(struct platform_device *pdev, 170 + struct mx25_gcq_priv *priv) 171 + { 172 + struct device_node *np = pdev->dev.of_node; 173 + struct device_node *child; 174 + struct device *dev = &pdev->dev; 175 + unsigned int refp_used[4] = {}; 176 + int ret, i; 177 + 178 + /* 179 + * Setup all configurations registers with a default conversion 180 + * configuration for each input 181 + */ 182 + for (i = 0; i < MX25_NUM_CFGS; ++i) 183 + regmap_write(priv->regs, MX25_ADCQ_CFG(i), 184 + MX25_ADCQ_CFG_YPLL_OFF | 185 + MX25_ADCQ_CFG_XNUR_OFF | 186 + MX25_ADCQ_CFG_XPUL_OFF | 187 + MX25_ADCQ_CFG_REFP_INT | 188 + MX25_ADCQ_CFG_IN(i) | 189 + MX25_ADCQ_CFG_REFN_NGND2); 190 + 191 + /* 192 + * First get all regulators to store them in channel_vref_mv if 193 + * necessary. Later we use that information for proper IIO scale 194 + * information. 195 + */ 196 + priv->vref[MX25_ADC_REFP_INT] = NULL; 197 + priv->vref[MX25_ADC_REFP_EXT] = 198 + devm_regulator_get_optional(&pdev->dev, "vref-ext"); 199 + priv->vref[MX25_ADC_REFP_XP] = 200 + devm_regulator_get_optional(&pdev->dev, "vref-xp"); 201 + priv->vref[MX25_ADC_REFP_YP] = 202 + devm_regulator_get_optional(&pdev->dev, "vref-yp"); 203 + 204 + for_each_child_of_node(np, child) { 205 + u32 reg; 206 + u32 refp = MX25_ADCQ_CFG_REFP_INT; 207 + u32 refn = MX25_ADCQ_CFG_REFN_NGND2; 208 + 209 + ret = of_property_read_u32(child, "reg", &reg); 210 + if (ret) { 211 + dev_err(dev, "Failed to get reg property\n"); 212 + return ret; 213 + } 214 + 215 + if (reg >= MX25_NUM_CFGS) { 216 + dev_err(dev, 217 + "reg value is greater than the number of available configuration registers\n"); 218 + return -EINVAL; 219 + } 220 + 221 + of_property_read_u32(child, "fsl,adc-refp", &refp); 222 + of_property_read_u32(child, "fsl,adc-refn", &refn); 223 + 224 + switch (refp) { 225 + case MX25_ADC_REFP_EXT: 226 + case MX25_ADC_REFP_XP: 227 + case MX25_ADC_REFP_YP: 228 + if (IS_ERR(priv->vref[refp])) { 229 + dev_err(dev, "Error, trying to use external voltage reference without a vref-%s regulator.", 230 + mx25_gcq_refp_names[refp]); 231 + return PTR_ERR(priv->vref[refp]); 232 + } 233 + priv->channel_vref_mv[reg] = 234 + regulator_get_voltage(priv->vref[refp]); 235 + /* Conversion from uV to mV */ 236 + priv->channel_vref_mv[reg] /= 1000; 237 + break; 238 + case MX25_ADC_REFP_INT: 239 + priv->channel_vref_mv[reg] = 2500; 240 + break; 241 + default: 242 + dev_err(dev, "Invalid positive reference %d\n", refp); 243 + return -EINVAL; 244 + } 245 + 246 + ++refp_used[refp]; 247 + 248 + /* 249 + * Shift the read values to the correct positions within the 250 + * register. 251 + */ 252 + refp = MX25_ADCQ_CFG_REFP(refp); 253 + refn = MX25_ADCQ_CFG_REFN(refn); 254 + 255 + if ((refp & MX25_ADCQ_CFG_REFP_MASK) != refp) { 256 + dev_err(dev, "Invalid fsl,adc-refp property value\n"); 257 + return -EINVAL; 258 + } 259 + if ((refn & MX25_ADCQ_CFG_REFN_MASK) != refn) { 260 + dev_err(dev, "Invalid fsl,adc-refn property value\n"); 261 + return -EINVAL; 262 + } 263 + 264 + regmap_update_bits(priv->regs, MX25_ADCQ_CFG(reg), 265 + MX25_ADCQ_CFG_REFP_MASK | 266 + MX25_ADCQ_CFG_REFN_MASK, 267 + refp | refn); 268 + } 269 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 270 + MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST, 271 + MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST); 272 + 273 + regmap_write(priv->regs, MX25_ADCQ_CR, 274 + MX25_ADCQ_CR_PDMSK | MX25_ADCQ_CR_QSM_FQS); 275 + 276 + /* Remove unused regulators */ 277 + for (i = 0; i != 4; ++i) { 278 + if (!refp_used[i]) { 279 + if (!IS_ERR_OR_NULL(priv->vref[i])) 280 + devm_regulator_put(priv->vref[i]); 281 + priv->vref[i] = NULL; 282 + } 283 + } 284 + 285 + return 0; 286 + } 287 + 288 + static int mx25_gcq_probe(struct platform_device *pdev) 289 + { 290 + struct iio_dev *indio_dev; 291 + struct mx25_gcq_priv *priv; 292 + struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent); 293 + struct device *dev = &pdev->dev; 294 + struct resource *res; 295 + void __iomem *mem; 296 + int ret; 297 + int i; 298 + 299 + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv)); 300 + if (!indio_dev) 301 + return -ENOMEM; 302 + 303 + priv = iio_priv(indio_dev); 304 + 305 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 306 + mem = devm_ioremap_resource(dev, res); 307 + if (IS_ERR(mem)) 308 + return PTR_ERR(mem); 309 + 310 + priv->regs = devm_regmap_init_mmio(dev, mem, &mx25_gcq_regconfig); 311 + if (IS_ERR(priv->regs)) { 312 + dev_err(dev, "Failed to initialize regmap\n"); 313 + return PTR_ERR(priv->regs); 314 + } 315 + 316 + init_completion(&priv->completed); 317 + 318 + ret = mx25_gcq_setup_cfgs(pdev, priv); 319 + if (ret) 320 + return ret; 321 + 322 + for (i = 0; i != 4; ++i) { 323 + if (!priv->vref[i]) 324 + continue; 325 + 326 + ret = regulator_enable(priv->vref[i]); 327 + if (ret) 328 + goto err_regulator_disable; 329 + } 330 + 331 + priv->clk = tsadc->clk; 332 + ret = clk_prepare_enable(priv->clk); 333 + if (ret) { 334 + dev_err(dev, "Failed to enable clock\n"); 335 + goto err_vref_disable; 336 + } 337 + 338 + priv->irq = platform_get_irq(pdev, 0); 339 + if (priv->irq <= 0) { 340 + dev_err(dev, "Failed to get IRQ\n"); 341 + ret = priv->irq; 342 + if (!ret) 343 + ret = -ENXIO; 344 + goto err_clk_unprepare; 345 + } 346 + 347 + ret = request_irq(priv->irq, mx25_gcq_irq, 0, pdev->name, priv); 348 + if (ret) { 349 + dev_err(dev, "Failed requesting IRQ\n"); 350 + goto err_clk_unprepare; 351 + } 352 + 353 + indio_dev->dev.parent = &pdev->dev; 354 + indio_dev->channels = mx25_gcq_channels; 355 + indio_dev->num_channels = ARRAY_SIZE(mx25_gcq_channels); 356 + indio_dev->info = &mx25_gcq_iio_info; 357 + indio_dev->name = driver_name; 358 + 359 + ret = iio_device_register(indio_dev); 360 + if (ret) { 361 + dev_err(dev, "Failed to register iio device\n"); 362 + goto err_irq_free; 363 + } 364 + 365 + platform_set_drvdata(pdev, indio_dev); 366 + 367 + return 0; 368 + 369 + err_irq_free: 370 + free_irq(priv->irq, priv); 371 + err_clk_unprepare: 372 + clk_disable_unprepare(priv->clk); 373 + err_vref_disable: 374 + i = 4; 375 + err_regulator_disable: 376 + for (; i-- > 0;) { 377 + if (priv->vref[i]) 378 + regulator_disable(priv->vref[i]); 379 + } 380 + return ret; 381 + } 382 + 383 + static int mx25_gcq_remove(struct platform_device *pdev) 384 + { 385 + struct iio_dev *indio_dev = platform_get_drvdata(pdev); 386 + struct mx25_gcq_priv *priv = iio_priv(indio_dev); 387 + int i; 388 + 389 + iio_device_unregister(indio_dev); 390 + free_irq(priv->irq, priv); 391 + clk_disable_unprepare(priv->clk); 392 + for (i = 4; i-- > 0;) { 393 + if (priv->vref[i]) 394 + regulator_disable(priv->vref[i]); 395 + } 396 + 397 + return 0; 398 + } 399 + 400 + static const struct of_device_id mx25_gcq_ids[] = { 401 + { .compatible = "fsl,imx25-gcq", }, 402 + { /* Sentinel */ } 403 + }; 404 + 405 + static struct platform_driver mx25_gcq_driver = { 406 + .driver = { 407 + .name = "mx25-gcq", 408 + .of_match_table = mx25_gcq_ids, 409 + }, 410 + .probe = mx25_gcq_probe, 411 + .remove = mx25_gcq_remove, 412 + }; 413 + module_platform_driver(mx25_gcq_driver); 414 + 415 + MODULE_DESCRIPTION("ADC driver for Freescale mx25"); 416 + MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>"); 417 + MODULE_LICENSE("GPL v2");
+9
drivers/input/touchscreen/Kconfig
··· 833 833 To compile this driver as a module, choose M here: the 834 834 module will be called usbtouchscreen. 835 835 836 + config TOUCHSCREEN_MX25 837 + tristate "Freescale i.MX25 touchscreen input driver" 838 + depends on MFD_MX25_TSADC 839 + help 840 + Enable support for touchscreen connected to your i.MX25. 841 + 842 + To compile this driver as a module, choose M here: the 843 + module will be called fsl-imx25-tcq. 844 + 836 845 config TOUCHSCREEN_MC13783 837 846 tristate "Freescale MC13783 touchscreen input driver" 838 847 depends on MFD_MC13XXX
+1
drivers/input/touchscreen/Makefile
··· 46 46 obj-$(CONFIG_TOUCHSCREEN_IPROC) += bcm_iproc_tsc.o 47 47 obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o 48 48 obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o 49 + obj-$(CONFIG_TOUCHSCREEN_MX25) += fsl-imx25-tcq.o 49 50 obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o 50 51 obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o 51 52 obj-$(CONFIG_TOUCHSCREEN_MELFAS_MIP4) += melfas_mip4.o
+596
drivers/input/touchscreen/fsl-imx25-tcq.c
··· 1 + /* 2 + * Copyright (C) 2014-2015 Pengutronix, Markus Pargmann <mpa@pengutronix.de> 3 + * 4 + * This program is free software; you can redistribute it and/or modify it under 5 + * the terms of the GNU General Public License version 2 as published by the 6 + * Free Software Foundation. 7 + * 8 + * Based on driver from 2011: 9 + * Juergen Beisert, Pengutronix <kernel@pengutronix.de> 10 + * 11 + * This is the driver for the imx25 TCQ (Touchscreen Conversion Queue) 12 + * connected to the imx25 ADC. 13 + */ 14 + 15 + #include <linux/clk.h> 16 + #include <linux/device.h> 17 + #include <linux/input.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/mfd/imx25-tsadc.h> 20 + #include <linux/module.h> 21 + #include <linux/of.h> 22 + #include <linux/platform_device.h> 23 + #include <linux/regmap.h> 24 + 25 + static const char mx25_tcq_name[] = "mx25-tcq"; 26 + 27 + enum mx25_tcq_mode { 28 + MX25_TS_4WIRE, 29 + }; 30 + 31 + struct mx25_tcq_priv { 32 + struct regmap *regs; 33 + struct regmap *core_regs; 34 + struct input_dev *idev; 35 + enum mx25_tcq_mode mode; 36 + unsigned int pen_threshold; 37 + unsigned int sample_count; 38 + unsigned int expected_samples; 39 + unsigned int pen_debounce; 40 + unsigned int settling_time; 41 + struct clk *clk; 42 + int irq; 43 + struct device *dev; 44 + }; 45 + 46 + static struct regmap_config mx25_tcq_regconfig = { 47 + .fast_io = true, 48 + .max_register = 0x5c, 49 + .reg_bits = 32, 50 + .val_bits = 32, 51 + .reg_stride = 4, 52 + }; 53 + 54 + static const struct of_device_id mx25_tcq_ids[] = { 55 + { .compatible = "fsl,imx25-tcq", }, 56 + { /* Sentinel */ } 57 + }; 58 + 59 + #define TSC_4WIRE_PRE_INDEX 0 60 + #define TSC_4WIRE_X_INDEX 1 61 + #define TSC_4WIRE_Y_INDEX 2 62 + #define TSC_4WIRE_POST_INDEX 3 63 + #define TSC_4WIRE_LEAVE 4 64 + 65 + #define MX25_TSC_DEF_THRESHOLD 80 66 + #define TSC_MAX_SAMPLES 16 67 + 68 + #define MX25_TSC_REPEAT_WAIT 14 69 + 70 + enum mx25_adc_configurations { 71 + MX25_CFG_PRECHARGE = 0, 72 + MX25_CFG_TOUCH_DETECT, 73 + MX25_CFG_X_MEASUREMENT, 74 + MX25_CFG_Y_MEASUREMENT, 75 + }; 76 + 77 + #define MX25_PRECHARGE_VALUE (\ 78 + MX25_ADCQ_CFG_YPLL_OFF | \ 79 + MX25_ADCQ_CFG_XNUR_OFF | \ 80 + MX25_ADCQ_CFG_XPUL_HIGH | \ 81 + MX25_ADCQ_CFG_REFP_INT | \ 82 + MX25_ADCQ_CFG_IN_XP | \ 83 + MX25_ADCQ_CFG_REFN_NGND2 | \ 84 + MX25_ADCQ_CFG_IGS) 85 + 86 + #define MX25_TOUCH_DETECT_VALUE (\ 87 + MX25_ADCQ_CFG_YNLR | \ 88 + MX25_ADCQ_CFG_YPLL_OFF | \ 89 + MX25_ADCQ_CFG_XNUR_OFF | \ 90 + MX25_ADCQ_CFG_XPUL_OFF | \ 91 + MX25_ADCQ_CFG_REFP_INT | \ 92 + MX25_ADCQ_CFG_IN_XP | \ 93 + MX25_ADCQ_CFG_REFN_NGND2 | \ 94 + MX25_ADCQ_CFG_PENIACK) 95 + 96 + static void imx25_setup_queue_cfgs(struct mx25_tcq_priv *priv, 97 + unsigned int settling_cnt) 98 + { 99 + u32 precharge_cfg = 100 + MX25_PRECHARGE_VALUE | 101 + MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt); 102 + u32 touch_detect_cfg = 103 + MX25_TOUCH_DETECT_VALUE | 104 + MX25_ADCQ_CFG_NOS(1) | 105 + MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt); 106 + 107 + regmap_write(priv->core_regs, MX25_TSC_TICR, precharge_cfg); 108 + 109 + /* PRECHARGE */ 110 + regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_PRECHARGE), 111 + precharge_cfg); 112 + 113 + /* TOUCH_DETECT */ 114 + regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_TOUCH_DETECT), 115 + touch_detect_cfg); 116 + 117 + /* X Measurement */ 118 + regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_X_MEASUREMENT), 119 + MX25_ADCQ_CFG_YPLL_OFF | 120 + MX25_ADCQ_CFG_XNUR_LOW | 121 + MX25_ADCQ_CFG_XPUL_HIGH | 122 + MX25_ADCQ_CFG_REFP_XP | 123 + MX25_ADCQ_CFG_IN_YP | 124 + MX25_ADCQ_CFG_REFN_XN | 125 + MX25_ADCQ_CFG_NOS(priv->sample_count) | 126 + MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt)); 127 + 128 + /* Y Measurement */ 129 + regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_Y_MEASUREMENT), 130 + MX25_ADCQ_CFG_YNLR | 131 + MX25_ADCQ_CFG_YPLL_HIGH | 132 + MX25_ADCQ_CFG_XNUR_OFF | 133 + MX25_ADCQ_CFG_XPUL_OFF | 134 + MX25_ADCQ_CFG_REFP_YP | 135 + MX25_ADCQ_CFG_IN_XP | 136 + MX25_ADCQ_CFG_REFN_YN | 137 + MX25_ADCQ_CFG_NOS(priv->sample_count) | 138 + MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt)); 139 + 140 + /* Enable the touch detection right now */ 141 + regmap_write(priv->core_regs, MX25_TSC_TICR, touch_detect_cfg | 142 + MX25_ADCQ_CFG_IGS); 143 + } 144 + 145 + static int imx25_setup_queue_4wire(struct mx25_tcq_priv *priv, 146 + unsigned settling_cnt, int *items) 147 + { 148 + imx25_setup_queue_cfgs(priv, settling_cnt); 149 + 150 + /* Setup the conversion queue */ 151 + regmap_write(priv->regs, MX25_ADCQ_ITEM_7_0, 152 + MX25_ADCQ_ITEM(0, MX25_CFG_PRECHARGE) | 153 + MX25_ADCQ_ITEM(1, MX25_CFG_TOUCH_DETECT) | 154 + MX25_ADCQ_ITEM(2, MX25_CFG_X_MEASUREMENT) | 155 + MX25_ADCQ_ITEM(3, MX25_CFG_Y_MEASUREMENT) | 156 + MX25_ADCQ_ITEM(4, MX25_CFG_PRECHARGE) | 157 + MX25_ADCQ_ITEM(5, MX25_CFG_TOUCH_DETECT)); 158 + 159 + /* 160 + * We measure X/Y with 'sample_count' number of samples and execute a 161 + * touch detection twice, with 1 sample each 162 + */ 163 + priv->expected_samples = priv->sample_count * 2 + 2; 164 + *items = 6; 165 + 166 + return 0; 167 + } 168 + 169 + static void mx25_tcq_disable_touch_irq(struct mx25_tcq_priv *priv) 170 + { 171 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_PDMSK, 172 + MX25_ADCQ_CR_PDMSK); 173 + } 174 + 175 + static void mx25_tcq_enable_touch_irq(struct mx25_tcq_priv *priv) 176 + { 177 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_PDMSK, 0); 178 + } 179 + 180 + static void mx25_tcq_disable_fifo_irq(struct mx25_tcq_priv *priv) 181 + { 182 + regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_FDRY_IRQ, 183 + MX25_ADCQ_MR_FDRY_IRQ); 184 + } 185 + 186 + static void mx25_tcq_enable_fifo_irq(struct mx25_tcq_priv *priv) 187 + { 188 + regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_FDRY_IRQ, 0); 189 + } 190 + 191 + static void mx25_tcq_force_queue_start(struct mx25_tcq_priv *priv) 192 + { 193 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 194 + MX25_ADCQ_CR_FQS, 195 + MX25_ADCQ_CR_FQS); 196 + } 197 + 198 + static void mx25_tcq_force_queue_stop(struct mx25_tcq_priv *priv) 199 + { 200 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 201 + MX25_ADCQ_CR_FQS, 0); 202 + } 203 + 204 + static void mx25_tcq_fifo_reset(struct mx25_tcq_priv *priv) 205 + { 206 + u32 tcqcr; 207 + 208 + regmap_read(priv->regs, MX25_ADCQ_CR, &tcqcr); 209 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FRST, 210 + MX25_ADCQ_CR_FRST); 211 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FRST, 0); 212 + regmap_write(priv->regs, MX25_ADCQ_CR, tcqcr); 213 + } 214 + 215 + static void mx25_tcq_re_enable_touch_detection(struct mx25_tcq_priv *priv) 216 + { 217 + /* stop the queue from looping */ 218 + mx25_tcq_force_queue_stop(priv); 219 + 220 + /* for a clean touch detection, preload the X plane */ 221 + regmap_write(priv->core_regs, MX25_TSC_TICR, MX25_PRECHARGE_VALUE); 222 + 223 + /* waste some time now to pre-load the X plate to high voltage */ 224 + mx25_tcq_fifo_reset(priv); 225 + 226 + /* re-enable the detection right now */ 227 + regmap_write(priv->core_regs, MX25_TSC_TICR, 228 + MX25_TOUCH_DETECT_VALUE | MX25_ADCQ_CFG_IGS); 229 + 230 + regmap_update_bits(priv->regs, MX25_ADCQ_SR, MX25_ADCQ_SR_PD, 231 + MX25_ADCQ_SR_PD); 232 + 233 + /* enable the pen down event to be a source for the interrupt */ 234 + regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_PD_IRQ, 0); 235 + 236 + /* lets fire the next IRQ if someone touches the touchscreen */ 237 + mx25_tcq_enable_touch_irq(priv); 238 + } 239 + 240 + static void mx25_tcq_create_event_for_4wire(struct mx25_tcq_priv *priv, 241 + u32 *sample_buf, 242 + unsigned int samples) 243 + { 244 + unsigned int x_pos = 0; 245 + unsigned int y_pos = 0; 246 + unsigned int touch_pre = 0; 247 + unsigned int touch_post = 0; 248 + unsigned int i; 249 + 250 + for (i = 0; i < samples; i++) { 251 + unsigned int index = MX25_ADCQ_FIFO_ID(sample_buf[i]); 252 + unsigned int val = MX25_ADCQ_FIFO_DATA(sample_buf[i]); 253 + 254 + switch (index) { 255 + case 1: 256 + touch_pre = val; 257 + break; 258 + case 2: 259 + x_pos = val; 260 + break; 261 + case 3: 262 + y_pos = val; 263 + break; 264 + case 5: 265 + touch_post = val; 266 + break; 267 + default: 268 + dev_dbg(priv->dev, "Dropped samples because of invalid index %d\n", 269 + index); 270 + return; 271 + } 272 + } 273 + 274 + if (samples != 0) { 275 + /* 276 + * only if both touch measures are below a threshold, 277 + * the position is valid 278 + */ 279 + if (touch_pre < priv->pen_threshold && 280 + touch_post < priv->pen_threshold) { 281 + /* valid samples, generate a report */ 282 + x_pos /= priv->sample_count; 283 + y_pos /= priv->sample_count; 284 + input_report_abs(priv->idev, ABS_X, x_pos); 285 + input_report_abs(priv->idev, ABS_Y, y_pos); 286 + input_report_key(priv->idev, BTN_TOUCH, 1); 287 + input_sync(priv->idev); 288 + 289 + /* get next sample */ 290 + mx25_tcq_enable_fifo_irq(priv); 291 + } else if (touch_pre >= priv->pen_threshold && 292 + touch_post >= priv->pen_threshold) { 293 + /* 294 + * if both samples are invalid, 295 + * generate a release report 296 + */ 297 + input_report_key(priv->idev, BTN_TOUCH, 0); 298 + input_sync(priv->idev); 299 + mx25_tcq_re_enable_touch_detection(priv); 300 + } else { 301 + /* 302 + * if only one of both touch measurements are 303 + * below the threshold, still some bouncing 304 + * happens. Take additional samples in this 305 + * case to be sure 306 + */ 307 + mx25_tcq_enable_fifo_irq(priv); 308 + } 309 + } 310 + } 311 + 312 + static irqreturn_t mx25_tcq_irq_thread(int irq, void *dev_id) 313 + { 314 + struct mx25_tcq_priv *priv = dev_id; 315 + u32 sample_buf[TSC_MAX_SAMPLES]; 316 + unsigned int samples; 317 + u32 stats; 318 + unsigned int i; 319 + 320 + /* 321 + * Check how many samples are available. We always have to read exactly 322 + * sample_count samples from the fifo, or a multiple of sample_count. 323 + * Otherwise we mixup samples into different touch events. 324 + */ 325 + regmap_read(priv->regs, MX25_ADCQ_SR, &stats); 326 + samples = MX25_ADCQ_SR_FDN(stats); 327 + samples -= samples % priv->sample_count; 328 + 329 + if (!samples) 330 + return IRQ_HANDLED; 331 + 332 + for (i = 0; i != samples; ++i) 333 + regmap_read(priv->regs, MX25_ADCQ_FIFO, &sample_buf[i]); 334 + 335 + mx25_tcq_create_event_for_4wire(priv, sample_buf, samples); 336 + 337 + return IRQ_HANDLED; 338 + } 339 + 340 + static irqreturn_t mx25_tcq_irq(int irq, void *dev_id) 341 + { 342 + struct mx25_tcq_priv *priv = dev_id; 343 + u32 stat; 344 + int ret = IRQ_HANDLED; 345 + 346 + regmap_read(priv->regs, MX25_ADCQ_SR, &stat); 347 + 348 + if (stat & (MX25_ADCQ_SR_FRR | MX25_ADCQ_SR_FUR | MX25_ADCQ_SR_FOR)) 349 + mx25_tcq_re_enable_touch_detection(priv); 350 + 351 + if (stat & MX25_ADCQ_SR_PD) { 352 + mx25_tcq_disable_touch_irq(priv); 353 + mx25_tcq_force_queue_start(priv); 354 + mx25_tcq_enable_fifo_irq(priv); 355 + } 356 + 357 + if (stat & MX25_ADCQ_SR_FDRY) { 358 + mx25_tcq_disable_fifo_irq(priv); 359 + ret = IRQ_WAKE_THREAD; 360 + } 361 + 362 + regmap_update_bits(priv->regs, MX25_ADCQ_SR, MX25_ADCQ_SR_FRR | 363 + MX25_ADCQ_SR_FUR | MX25_ADCQ_SR_FOR | 364 + MX25_ADCQ_SR_PD, 365 + MX25_ADCQ_SR_FRR | MX25_ADCQ_SR_FUR | 366 + MX25_ADCQ_SR_FOR | MX25_ADCQ_SR_PD); 367 + 368 + return ret; 369 + } 370 + 371 + /* configure the state machine for a 4-wire touchscreen */ 372 + static int mx25_tcq_init(struct mx25_tcq_priv *priv) 373 + { 374 + u32 tgcr; 375 + unsigned int ipg_div; 376 + unsigned int adc_period; 377 + unsigned int debounce_cnt; 378 + unsigned int settling_cnt; 379 + int itemct; 380 + int error; 381 + 382 + regmap_read(priv->core_regs, MX25_TSC_TGCR, &tgcr); 383 + ipg_div = max_t(unsigned int, 4, MX25_TGCR_GET_ADCCLK(tgcr)); 384 + adc_period = USEC_PER_SEC * ipg_div * 2 + 2; 385 + adc_period /= clk_get_rate(priv->clk) / 1000 + 1; 386 + debounce_cnt = DIV_ROUND_UP(priv->pen_debounce, adc_period * 8) - 1; 387 + settling_cnt = DIV_ROUND_UP(priv->settling_time, adc_period * 8) - 1; 388 + 389 + /* Reset */ 390 + regmap_write(priv->regs, MX25_ADCQ_CR, 391 + MX25_ADCQ_CR_QRST | MX25_ADCQ_CR_FRST); 392 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 393 + MX25_ADCQ_CR_QRST | MX25_ADCQ_CR_FRST, 0); 394 + 395 + /* up to 128 * 8 ADC clocks are possible */ 396 + if (debounce_cnt > 127) 397 + debounce_cnt = 127; 398 + 399 + /* up to 255 * 8 ADC clocks are possible */ 400 + if (settling_cnt > 255) 401 + settling_cnt = 255; 402 + 403 + error = imx25_setup_queue_4wire(priv, settling_cnt, &itemct); 404 + if (error) 405 + return error; 406 + 407 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 408 + MX25_ADCQ_CR_LITEMID_MASK | MX25_ADCQ_CR_WMRK_MASK, 409 + MX25_ADCQ_CR_LITEMID(itemct - 1) | 410 + MX25_ADCQ_CR_WMRK(priv->expected_samples - 1)); 411 + 412 + /* setup debounce count */ 413 + regmap_update_bits(priv->core_regs, MX25_TSC_TGCR, 414 + MX25_TGCR_PDBTIME_MASK, 415 + MX25_TGCR_PDBTIME(debounce_cnt)); 416 + 417 + /* enable debounce */ 418 + regmap_update_bits(priv->core_regs, MX25_TSC_TGCR, MX25_TGCR_PDBEN, 419 + MX25_TGCR_PDBEN); 420 + regmap_update_bits(priv->core_regs, MX25_TSC_TGCR, MX25_TGCR_PDEN, 421 + MX25_TGCR_PDEN); 422 + 423 + /* enable the engine on demand */ 424 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_QSM_MASK, 425 + MX25_ADCQ_CR_QSM_FQS); 426 + 427 + /* Enable repeat and repeat wait */ 428 + regmap_update_bits(priv->regs, MX25_ADCQ_CR, 429 + MX25_ADCQ_CR_RPT | MX25_ADCQ_CR_RWAIT_MASK, 430 + MX25_ADCQ_CR_RPT | 431 + MX25_ADCQ_CR_RWAIT(MX25_TSC_REPEAT_WAIT)); 432 + 433 + return 0; 434 + } 435 + 436 + static int mx25_tcq_parse_dt(struct platform_device *pdev, 437 + struct mx25_tcq_priv *priv) 438 + { 439 + struct device_node *np = pdev->dev.of_node; 440 + u32 wires; 441 + int error; 442 + 443 + /* Setup defaults */ 444 + priv->pen_threshold = 500; 445 + priv->sample_count = 3; 446 + priv->pen_debounce = 1000000; 447 + priv->settling_time = 250000; 448 + 449 + error = of_property_read_u32(np, "fsl,wires", &wires); 450 + if (error) { 451 + dev_err(&pdev->dev, "Failed to find fsl,wires properties\n"); 452 + return error; 453 + } 454 + 455 + if (wires == 4) { 456 + priv->mode = MX25_TS_4WIRE; 457 + } else { 458 + dev_err(&pdev->dev, "%u-wire mode not supported\n", wires); 459 + return -EINVAL; 460 + } 461 + 462 + /* These are optional, we don't care about the return values */ 463 + of_property_read_u32(np, "fsl,pen-threshold", &priv->pen_threshold); 464 + of_property_read_u32(np, "fsl,settling-time-ns", &priv->settling_time); 465 + of_property_read_u32(np, "fsl,pen-debounce-ns", &priv->pen_debounce); 466 + 467 + return 0; 468 + } 469 + 470 + static int mx25_tcq_open(struct input_dev *idev) 471 + { 472 + struct device *dev = &idev->dev; 473 + struct mx25_tcq_priv *priv = dev_get_drvdata(dev); 474 + int error; 475 + 476 + error = clk_prepare_enable(priv->clk); 477 + if (error) { 478 + dev_err(dev, "Failed to enable ipg clock\n"); 479 + return error; 480 + } 481 + 482 + error = mx25_tcq_init(priv); 483 + if (error) { 484 + dev_err(dev, "Failed to init tcq\n"); 485 + clk_disable_unprepare(priv->clk); 486 + return error; 487 + } 488 + 489 + mx25_tcq_re_enable_touch_detection(priv); 490 + 491 + return 0; 492 + } 493 + 494 + static void mx25_tcq_close(struct input_dev *idev) 495 + { 496 + struct mx25_tcq_priv *priv = input_get_drvdata(idev); 497 + 498 + mx25_tcq_force_queue_stop(priv); 499 + mx25_tcq_disable_touch_irq(priv); 500 + mx25_tcq_disable_fifo_irq(priv); 501 + clk_disable_unprepare(priv->clk); 502 + } 503 + 504 + static int mx25_tcq_probe(struct platform_device *pdev) 505 + { 506 + struct device *dev = &pdev->dev; 507 + struct input_dev *idev; 508 + struct mx25_tcq_priv *priv; 509 + struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent); 510 + struct resource *res; 511 + void __iomem *mem; 512 + int error; 513 + 514 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 515 + if (!priv) 516 + return -ENOMEM; 517 + priv->dev = dev; 518 + 519 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 520 + mem = devm_ioremap_resource(dev, res); 521 + if (IS_ERR(mem)) 522 + return PTR_ERR(mem); 523 + 524 + error = mx25_tcq_parse_dt(pdev, priv); 525 + if (error) 526 + return error; 527 + 528 + priv->regs = devm_regmap_init_mmio(dev, mem, &mx25_tcq_regconfig); 529 + if (IS_ERR(priv->regs)) { 530 + dev_err(dev, "Failed to initialize regmap\n"); 531 + return PTR_ERR(priv->regs); 532 + } 533 + 534 + priv->irq = platform_get_irq(pdev, 0); 535 + if (priv->irq <= 0) { 536 + dev_err(dev, "Failed to get IRQ\n"); 537 + return priv->irq; 538 + } 539 + 540 + idev = devm_input_allocate_device(dev); 541 + if (!idev) { 542 + dev_err(dev, "Failed to allocate input device\n"); 543 + return -ENOMEM; 544 + } 545 + 546 + idev->name = mx25_tcq_name; 547 + input_set_capability(idev, EV_KEY, BTN_TOUCH); 548 + input_set_abs_params(idev, ABS_X, 0, 0xfff, 0, 0); 549 + input_set_abs_params(idev, ABS_Y, 0, 0xfff, 0, 0); 550 + 551 + idev->id.bustype = BUS_HOST; 552 + idev->open = mx25_tcq_open; 553 + idev->close = mx25_tcq_close; 554 + 555 + priv->idev = idev; 556 + input_set_drvdata(idev, priv); 557 + 558 + priv->core_regs = tsadc->regs; 559 + if (!priv->core_regs) 560 + return -EINVAL; 561 + 562 + priv->clk = tsadc->clk; 563 + if (!priv->clk) 564 + return -EINVAL; 565 + 566 + platform_set_drvdata(pdev, priv); 567 + 568 + error = devm_request_threaded_irq(dev, priv->irq, mx25_tcq_irq, 569 + mx25_tcq_irq_thread, 0, pdev->name, 570 + priv); 571 + if (error) { 572 + dev_err(dev, "Failed requesting IRQ\n"); 573 + return error; 574 + } 575 + 576 + error = input_register_device(idev); 577 + if (error) { 578 + dev_err(dev, "Failed to register input device\n"); 579 + return error; 580 + } 581 + 582 + return 0; 583 + } 584 + 585 + static struct platform_driver mx25_tcq_driver = { 586 + .driver = { 587 + .name = "mx25-tcq", 588 + .of_match_table = mx25_tcq_ids, 589 + }, 590 + .probe = mx25_tcq_probe, 591 + }; 592 + module_platform_driver(mx25_tcq_driver); 593 + 594 + MODULE_DESCRIPTION("TS input driver for Freescale mx25"); 595 + MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>"); 596 + MODULE_LICENSE("GPL v2");
+63 -17
drivers/mfd/Kconfig
··· 18 18 This is the core driver for CS5535/CS5536 MFD functions. This is 19 19 necessary for using the board's GPIO and MFGPT functionality. 20 20 21 + config MFD_ACT8945A 22 + tristate "Active-semi ACT8945A" 23 + select MFD_CORE 24 + select REGMAP_I2C 25 + depends on I2C && OF 26 + help 27 + Support for the ACT8945A PMIC from Active-semi. This device 28 + features three step-down DC/DC converters and four low-dropout 29 + linear regulators, along with a complete ActivePath battery 30 + charger. 31 + 21 32 config MFD_AS3711 22 33 bool "AMS AS3711" 23 34 select MFD_CORE ··· 102 91 Support for the BCM590xx PMUs from Broadcom 103 92 104 93 config MFD_AXP20X 105 - bool "X-Powers AXP20X" 94 + tristate 106 95 select MFD_CORE 107 - select REGMAP_I2C 108 96 select REGMAP_IRQ 109 - depends on I2C=y 97 + 98 + config MFD_AXP20X_I2C 99 + tristate "X-Powers AXP series PMICs with I2C" 100 + select MFD_AXP20X 101 + select REGMAP_I2C 102 + depends on I2C 110 103 help 111 - If you say Y here you get support for the X-Powers AXP202, AXP209 and 112 - AXP288 power management IC (PMIC). 104 + If you say Y here you get support for the X-Powers AXP series power 105 + management ICs (PMICs) controlled with I2C. 106 + This driver include only the core APIs. You have to select individual 107 + components like regulators or the PEK (Power Enable Key) under the 108 + corresponding menus. 109 + 110 + config MFD_AXP20X_RSB 111 + tristate "X-Powers AXP series PMICs with RSB" 112 + select MFD_AXP20X 113 + depends on SUNXI_RSB 114 + help 115 + If you say Y here you get support for the X-Powers AXP series power 116 + management ICs (PMICs) controlled with RSB. 113 117 This driver include only the core APIs. You have to select individual 114 118 components like regulators or the PEK (Power Enable Key) under the 115 119 corresponding menus. ··· 229 203 select MFD_CORE 230 204 select REGMAP_I2C 231 205 select REGMAP_IRQ 232 - depends on I2C=y 206 + depends on I2C 233 207 help 234 208 Say yes here for support for the Dialog Semiconductor DA9062 PMIC. 235 209 This includes the I2C driver and core APIs. ··· 241 215 select MFD_CORE 242 216 select REGMAP_I2C 243 217 select REGMAP_IRQ 244 - depends on I2C=y 218 + depends on I2C 245 219 help 246 220 Say yes here for support for the Dialog Semiconductor DA9063 PMIC. 247 221 This includes the I2C driver and core APIs. ··· 250 224 251 225 config MFD_DA9150 252 226 tristate "Dialog Semiconductor DA9150 Charger Fuel-Gauge chip" 253 - depends on I2C=y 227 + depends on I2C 254 228 select MFD_CORE 255 229 select REGMAP_I2C 256 230 select REGMAP_IRQ ··· 296 270 select MFD_MC13XXX 297 271 help 298 272 Select this if your MC13xxx is connected via an I2C bus. 273 + 274 + config MFD_MX25_TSADC 275 + tristate "Freescale i.MX25 integrated Touchscreen and ADC unit" 276 + select REGMAP_MMIO 277 + depends on (SOC_IMX25 && OF) || COMPILE_TEST 278 + help 279 + Enable support for the integrated Touchscreen and ADC unit of the 280 + i.MX25 processors. They consist of a conversion queue for general 281 + purpose ADC and a queue for Touchscreens. 299 282 300 283 config MFD_HI6421_PMIC 301 284 tristate "HiSilicon Hi6421 PMU/Codec IC" ··· 480 445 481 446 config MFD_88PM800 482 447 tristate "Marvell 88PM800" 483 - depends on I2C=y 448 + depends on I2C 484 449 select REGMAP_I2C 485 450 select REGMAP_IRQ 486 451 select MFD_CORE ··· 492 457 493 458 config MFD_88PM805 494 459 tristate "Marvell 88PM805" 495 - depends on I2C=y 460 + depends on I2C 496 461 select REGMAP_I2C 497 462 select REGMAP_IRQ 498 463 select MFD_CORE ··· 528 493 of the device. 529 494 530 495 config MFD_MAX77686 531 - bool "Maxim Semiconductor MAX77686/802 PMIC Support" 532 - depends on I2C=y 496 + tristate "Maxim Semiconductor MAX77686/802 PMIC Support" 497 + depends on I2C 533 498 depends on OF 534 499 select MFD_CORE 535 500 select REGMAP_I2C ··· 573 538 config MFD_MAX8907 574 539 tristate "Maxim Semiconductor MAX8907 PMIC Support" 575 540 select MFD_CORE 576 - depends on I2C=y 541 + depends on I2C 577 542 select REGMAP_I2C 578 543 select REGMAP_IRQ 579 544 help ··· 778 743 779 744 config MFD_RT5033 780 745 tristate "Richtek RT5033 Power Management IC" 781 - depends on I2C=y 746 + depends on I2C 782 747 select MFD_CORE 783 748 select REGMAP_I2C 784 749 select REGMAP_IRQ ··· 1141 1106 This driver can also be built as a module. If so, the module 1142 1107 will be called tps6507x. 1143 1108 1109 + config MFD_TPS65086 1110 + tristate "TI TPS65086 Power Management Integrated Chips (PMICs)" 1111 + select REGMAP 1112 + select REGMAP_IRQ 1113 + select REGMAP_I2C 1114 + depends on I2C 1115 + help 1116 + If you say yes here you get support for the TPS65086 series of 1117 + Power Management chips. 1118 + This driver provides common support for accessing the device, 1119 + additional drivers must be enabled in order to use the 1120 + functionality of the device. 1121 + 1144 1122 config TPS65911_COMPARATOR 1145 1123 tristate 1146 1124 ··· 1418 1370 config MFD_ARIZONA_I2C 1419 1371 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with I2C" 1420 1372 select MFD_ARIZONA 1421 - select MFD_CORE 1422 1373 select REGMAP_I2C 1423 1374 depends on I2C 1424 1375 help ··· 1427 1380 config MFD_ARIZONA_SPI 1428 1381 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with SPI" 1429 1382 select MFD_ARIZONA 1430 - select MFD_CORE 1431 1383 select REGMAP_SPI 1432 1384 depends on SPI_MASTER 1433 1385 help 1434 1386 Support for the Cirrus Logic/Wolfson Microelectronics Arizona platform 1435 - audio SoC core functionality controlled via I2C. 1387 + audio SoC core functionality controlled via SPI. 1436 1388 1437 1389 config MFD_CS47L24 1438 1390 bool "Cirrus Logic CS47L24 and WM1831"
+6
drivers/mfd/Makefile
··· 6 6 obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o 7 7 obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o 8 8 obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o 9 + obj-$(CONFIG_MFD_ACT8945A) += act8945a.o 9 10 obj-$(CONFIG_MFD_SM501) += sm501.o 10 11 obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o 11 12 obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o ··· 71 70 obj-$(CONFIG_TPS6105X) += tps6105x.o 72 71 obj-$(CONFIG_TPS65010) += tps65010.o 73 72 obj-$(CONFIG_TPS6507X) += tps6507x.o 73 + obj-$(CONFIG_MFD_TPS65086) += tps65086.o 74 74 obj-$(CONFIG_MFD_TPS65217) += tps65217.o 75 75 obj-$(CONFIG_MFD_TPS65218) += tps65218.o 76 76 obj-$(CONFIG_MFD_TPS65910) += tps65910.o ··· 85 83 obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o 86 84 obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o 87 85 obj-$(CONFIG_TWL6040_CORE) += twl6040.o 86 + 87 + obj-$(CONFIG_MFD_MX25_TSADC) += fsl-imx25-tsadc.o 88 88 89 89 obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o 90 90 obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o ··· 114 110 obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o 115 111 obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o 116 112 obj-$(CONFIG_MFD_AXP20X) += axp20x.o 113 + obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o 114 + obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o 117 115 118 116 obj-$(CONFIG_MFD_LP3943) += lp3943.o 119 117 obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o
+102
drivers/mfd/act8945a.c
··· 1 + /* 2 + * MFD driver for Active-semi ACT8945a PMIC 3 + * 4 + * Copyright (C) 2015 Atmel Corporation. 5 + * 6 + * Author: Wenyou Yang <wenyou.yang@atmel.com> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + */ 13 + 14 + #include <linux/i2c.h> 15 + #include <linux/mfd/core.h> 16 + #include <linux/module.h> 17 + #include <linux/of_device.h> 18 + #include <linux/regmap.h> 19 + 20 + static const struct mfd_cell act8945a_devs[] = { 21 + { 22 + .name = "act8945a-regulator", 23 + }, 24 + { 25 + .name = "act8945a-charger", 26 + }, 27 + }; 28 + 29 + static const struct regmap_config act8945a_regmap_config = { 30 + .reg_bits = 8, 31 + .val_bits = 8, 32 + }; 33 + 34 + static int act8945a_i2c_probe(struct i2c_client *i2c, 35 + const struct i2c_device_id *id) 36 + { 37 + int ret; 38 + struct regmap *regmap; 39 + 40 + regmap = devm_regmap_init_i2c(i2c, &act8945a_regmap_config); 41 + if (IS_ERR(regmap)) { 42 + ret = PTR_ERR(regmap); 43 + dev_err(&i2c->dev, "regmap init failed: %d\n", ret); 44 + return ret; 45 + } 46 + 47 + i2c_set_clientdata(i2c, regmap); 48 + 49 + ret = mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, act8945a_devs, 50 + ARRAY_SIZE(act8945a_devs), NULL, 0, NULL); 51 + if (ret) { 52 + dev_err(&i2c->dev, "Failed to add sub devices\n"); 53 + return ret; 54 + } 55 + 56 + return 0; 57 + } 58 + 59 + static int act8945a_i2c_remove(struct i2c_client *i2c) 60 + { 61 + mfd_remove_devices(&i2c->dev); 62 + 63 + return 0; 64 + } 65 + 66 + static const struct i2c_device_id act8945a_i2c_id[] = { 67 + { "act8945a", 0 }, 68 + {} 69 + }; 70 + MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id); 71 + 72 + static const struct of_device_id act8945a_of_match[] = { 73 + { .compatible = "active-semi,act8945a", }, 74 + {}, 75 + }; 76 + MODULE_DEVICE_TABLE(of, act8945a_of_match); 77 + 78 + static struct i2c_driver act8945a_i2c_driver = { 79 + .driver = { 80 + .name = "act8945a", 81 + .of_match_table = of_match_ptr(act8945a_of_match), 82 + }, 83 + .probe = act8945a_i2c_probe, 84 + .remove = act8945a_i2c_remove, 85 + .id_table = act8945a_i2c_id, 86 + }; 87 + 88 + static int __init act8945a_i2c_init(void) 89 + { 90 + return i2c_add_driver(&act8945a_i2c_driver); 91 + } 92 + subsys_initcall(act8945a_i2c_init); 93 + 94 + static void __exit act8945a_i2c_exit(void) 95 + { 96 + i2c_del_driver(&act8945a_i2c_driver); 97 + } 98 + module_exit(act8945a_i2c_exit); 99 + 100 + MODULE_DESCRIPTION("ACT8945A PMIC multi-function driver"); 101 + MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>"); 102 + MODULE_LICENSE("GPL");
+2 -2
drivers/mfd/as3711.c
··· 108 108 .volatile_reg = as3711_volatile_reg, 109 109 .readable_reg = as3711_readable_reg, 110 110 .precious_reg = as3711_precious_reg, 111 - .max_register = AS3711_MAX_REGS, 112 - .num_reg_defaults_raw = AS3711_MAX_REGS, 111 + .max_register = AS3711_MAX_REG, 112 + .num_reg_defaults_raw = AS3711_NUM_REGS, 113 113 .cache_type = REGCACHE_RBTREE, 114 114 }; 115 115
+104
drivers/mfd/axp20x-i2c.c
··· 1 + /* 2 + * I2C driver for the X-Powers' Power Management ICs 3 + * 4 + * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC 5 + * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature 6 + * as well as configurable GPIOs. 7 + * 8 + * This driver supports the I2C variants. 9 + * 10 + * Copyright (C) 2014 Carlo Caione 11 + * 12 + * Author: Carlo Caione <carlo@caione.org> 13 + * 14 + * This program is free software; you can redistribute it and/or modify 15 + * it under the terms of the GNU General Public License version 2 as 16 + * published by the Free Software Foundation. 17 + */ 18 + 19 + #include <linux/acpi.h> 20 + #include <linux/err.h> 21 + #include <linux/i2c.h> 22 + #include <linux/module.h> 23 + #include <linux/mfd/axp20x.h> 24 + #include <linux/of.h> 25 + #include <linux/regmap.h> 26 + #include <linux/slab.h> 27 + 28 + static int axp20x_i2c_probe(struct i2c_client *i2c, 29 + const struct i2c_device_id *id) 30 + { 31 + struct axp20x_dev *axp20x; 32 + int ret; 33 + 34 + axp20x = devm_kzalloc(&i2c->dev, sizeof(*axp20x), GFP_KERNEL); 35 + if (!axp20x) 36 + return -ENOMEM; 37 + 38 + axp20x->dev = &i2c->dev; 39 + axp20x->irq = i2c->irq; 40 + dev_set_drvdata(axp20x->dev, axp20x); 41 + 42 + ret = axp20x_match_device(axp20x); 43 + if (ret) 44 + return ret; 45 + 46 + axp20x->regmap = devm_regmap_init_i2c(i2c, axp20x->regmap_cfg); 47 + if (IS_ERR(axp20x->regmap)) { 48 + ret = PTR_ERR(axp20x->regmap); 49 + dev_err(&i2c->dev, "regmap init failed: %d\n", ret); 50 + return ret; 51 + } 52 + 53 + return axp20x_device_probe(axp20x); 54 + } 55 + 56 + static int axp20x_i2c_remove(struct i2c_client *i2c) 57 + { 58 + struct axp20x_dev *axp20x = i2c_get_clientdata(i2c); 59 + 60 + return axp20x_device_remove(axp20x); 61 + } 62 + 63 + static const struct of_device_id axp20x_i2c_of_match[] = { 64 + { .compatible = "x-powers,axp152", .data = (void *)AXP152_ID }, 65 + { .compatible = "x-powers,axp202", .data = (void *)AXP202_ID }, 66 + { .compatible = "x-powers,axp209", .data = (void *)AXP209_ID }, 67 + { .compatible = "x-powers,axp221", .data = (void *)AXP221_ID }, 68 + { }, 69 + }; 70 + MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match); 71 + 72 + /* 73 + * This is useless for OF-enabled devices, but it is needed by I2C subsystem 74 + */ 75 + static const struct i2c_device_id axp20x_i2c_id[] = { 76 + { }, 77 + }; 78 + MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id); 79 + 80 + static const struct acpi_device_id axp20x_i2c_acpi_match[] = { 81 + { 82 + .id = "INT33F4", 83 + .driver_data = AXP288_ID, 84 + }, 85 + { }, 86 + }; 87 + MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match); 88 + 89 + static struct i2c_driver axp20x_i2c_driver = { 90 + .driver = { 91 + .name = "axp20x-i2c", 92 + .of_match_table = of_match_ptr(axp20x_i2c_of_match), 93 + .acpi_match_table = ACPI_PTR(axp20x_i2c_acpi_match), 94 + }, 95 + .probe = axp20x_i2c_probe, 96 + .remove = axp20x_i2c_remove, 97 + .id_table = axp20x_i2c_id, 98 + }; 99 + 100 + module_i2c_driver(axp20x_i2c_driver); 101 + 102 + MODULE_DESCRIPTION("PMIC MFD I2C driver for AXP20X"); 103 + MODULE_AUTHOR("Carlo Caione <carlo@caione.org>"); 104 + MODULE_LICENSE("GPL");
+80
drivers/mfd/axp20x-rsb.c
··· 1 + /* 2 + * RSB driver for the X-Powers' Power Management ICs 3 + * 4 + * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC 5 + * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature 6 + * as well as configurable GPIOs. 7 + * 8 + * This driver supports the RSB variants. 9 + * 10 + * Copyright (C) 2015 Chen-Yu Tsai 11 + * 12 + * Author: Chen-Yu Tsai <wens@csie.org> 13 + * 14 + * This program is free software; you can redistribute it and/or modify 15 + * it under the terms of the GNU General Public License version 2 as 16 + * published by the Free Software Foundation. 17 + */ 18 + 19 + #include <linux/acpi.h> 20 + #include <linux/err.h> 21 + #include <linux/mfd/axp20x.h> 22 + #include <linux/module.h> 23 + #include <linux/of.h> 24 + #include <linux/regmap.h> 25 + #include <linux/slab.h> 26 + #include <linux/sunxi-rsb.h> 27 + 28 + static int axp20x_rsb_probe(struct sunxi_rsb_device *rdev) 29 + { 30 + struct axp20x_dev *axp20x; 31 + int ret; 32 + 33 + axp20x = devm_kzalloc(&rdev->dev, sizeof(*axp20x), GFP_KERNEL); 34 + if (!axp20x) 35 + return -ENOMEM; 36 + 37 + axp20x->dev = &rdev->dev; 38 + axp20x->irq = rdev->irq; 39 + dev_set_drvdata(&rdev->dev, axp20x); 40 + 41 + ret = axp20x_match_device(axp20x); 42 + if (ret) 43 + return ret; 44 + 45 + axp20x->regmap = devm_regmap_init_sunxi_rsb(rdev, axp20x->regmap_cfg); 46 + if (IS_ERR(axp20x->regmap)) { 47 + ret = PTR_ERR(axp20x->regmap); 48 + dev_err(&rdev->dev, "regmap init failed: %d\n", ret); 49 + return ret; 50 + } 51 + 52 + return axp20x_device_probe(axp20x); 53 + } 54 + 55 + static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev) 56 + { 57 + struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev); 58 + 59 + return axp20x_device_remove(axp20x); 60 + } 61 + 62 + static const struct of_device_id axp20x_rsb_of_match[] = { 63 + { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, 64 + { }, 65 + }; 66 + MODULE_DEVICE_TABLE(of, axp20x_rsb_of_match); 67 + 68 + static struct sunxi_rsb_driver axp20x_rsb_driver = { 69 + .driver = { 70 + .name = "axp20x-rsb", 71 + .of_match_table = of_match_ptr(axp20x_rsb_of_match), 72 + }, 73 + .probe = axp20x_rsb_probe, 74 + .remove = axp20x_rsb_remove, 75 + }; 76 + module_sunxi_rsb_driver(axp20x_rsb_driver); 77 + 78 + MODULE_DESCRIPTION("PMIC MFD sunXi RSB driver for AXP20X"); 79 + MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); 80 + MODULE_LICENSE("GPL v2");
+25 -80
drivers/mfd/axp20x.c
··· 1 1 /* 2 - * axp20x.c - MFD core driver for the X-Powers' Power Management ICs 2 + * MFD core driver for the X-Powers' Power Management ICs 3 3 * 4 4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC 5 5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature 6 6 * as well as configurable GPIOs. 7 + * 8 + * This file contains the interface independent core functions. 9 + * 10 + * Copyright (C) 2014 Carlo Caione 7 11 * 8 12 * Author: Carlo Caione <carlo@caione.org> 9 13 * ··· 17 13 */ 18 14 19 15 #include <linux/err.h> 20 - #include <linux/i2c.h> 21 16 #include <linux/interrupt.h> 22 17 #include <linux/kernel.h> 23 18 #include <linux/module.h> 24 19 #include <linux/pm_runtime.h> 25 20 #include <linux/regmap.h> 26 - #include <linux/slab.h> 27 21 #include <linux/regulator/consumer.h> 28 22 #include <linux/mfd/axp20x.h> 29 23 #include <linux/mfd/core.h> 30 24 #include <linux/of_device.h> 31 - #include <linux/of_irq.h> 32 25 #include <linux/acpi.h> 33 26 34 27 #define AXP20X_OFF 0x80 ··· 35 34 "AXP202", 36 35 "AXP209", 37 36 "AXP221", 37 + "AXP223", 38 38 "AXP288", 39 39 }; 40 40 ··· 378 376 INIT_REGMAP_IRQ(AXP288, BC_USB_CHNG, 5, 1), 379 377 }; 380 378 381 - static const struct of_device_id axp20x_of_match[] = { 382 - { .compatible = "x-powers,axp152", .data = (void *) AXP152_ID }, 383 - { .compatible = "x-powers,axp202", .data = (void *) AXP202_ID }, 384 - { .compatible = "x-powers,axp209", .data = (void *) AXP209_ID }, 385 - { .compatible = "x-powers,axp221", .data = (void *) AXP221_ID }, 386 - { }, 387 - }; 388 - MODULE_DEVICE_TABLE(of, axp20x_of_match); 389 - 390 - /* 391 - * This is useless for OF-enabled devices, but it is needed by I2C subsystem 392 - */ 393 - static const struct i2c_device_id axp20x_i2c_id[] = { 394 - { }, 395 - }; 396 - MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id); 397 - 398 - static const struct acpi_device_id axp20x_acpi_match[] = { 399 - { 400 - .id = "INT33F4", 401 - .driver_data = AXP288_ID, 402 - }, 403 - { }, 404 - }; 405 - MODULE_DEVICE_TABLE(acpi, axp20x_acpi_match); 406 - 407 379 static const struct regmap_irq_chip axp152_regmap_irq_chip = { 408 380 .name = "axp152_irq_chip", 409 381 .status_base = AXP152_IRQ1_STATE, ··· 582 606 AXP20X_OFF); 583 607 } 584 608 585 - static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev) 609 + int axp20x_match_device(struct axp20x_dev *axp20x) 586 610 { 611 + struct device *dev = axp20x->dev; 587 612 const struct acpi_device_id *acpi_id; 588 613 const struct of_device_id *of_id; 589 614 590 615 if (dev->of_node) { 591 - of_id = of_match_device(axp20x_of_match, dev); 616 + of_id = of_match_device(dev->driver->of_match_table, dev); 592 617 if (!of_id) { 593 618 dev_err(dev, "Unable to match OF ID\n"); 594 619 return -ENODEV; 595 620 } 596 - axp20x->variant = (long) of_id->data; 621 + axp20x->variant = (long)of_id->data; 597 622 } else { 598 623 acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); 599 624 if (!acpi_id || !acpi_id->driver_data) { 600 625 dev_err(dev, "Unable to match ACPI ID and data\n"); 601 626 return -ENODEV; 602 627 } 603 - axp20x->variant = (long) acpi_id->driver_data; 628 + axp20x->variant = (long)acpi_id->driver_data; 604 629 } 605 630 606 631 switch (axp20x->variant) { ··· 619 642 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip; 620 643 break; 621 644 case AXP221_ID: 645 + case AXP223_ID: 622 646 axp20x->nr_cells = ARRAY_SIZE(axp22x_cells); 623 647 axp20x->cells = axp22x_cells; 624 648 axp20x->regmap_cfg = &axp22x_regmap_config; ··· 636 658 return -EINVAL; 637 659 } 638 660 dev_info(dev, "AXP20x variant %s found\n", 639 - axp20x_model_names[axp20x->variant]); 661 + axp20x_model_names[axp20x->variant]); 640 662 641 663 return 0; 642 664 } 665 + EXPORT_SYMBOL(axp20x_match_device); 643 666 644 - static int axp20x_i2c_probe(struct i2c_client *i2c, 645 - const struct i2c_device_id *id) 667 + int axp20x_device_probe(struct axp20x_dev *axp20x) 646 668 { 647 - struct axp20x_dev *axp20x; 648 669 int ret; 649 670 650 - axp20x = devm_kzalloc(&i2c->dev, sizeof(*axp20x), GFP_KERNEL); 651 - if (!axp20x) 652 - return -ENOMEM; 653 - 654 - ret = axp20x_match_device(axp20x, &i2c->dev); 655 - if (ret) 656 - return ret; 657 - 658 - axp20x->i2c_client = i2c; 659 - axp20x->dev = &i2c->dev; 660 - dev_set_drvdata(axp20x->dev, axp20x); 661 - 662 - axp20x->regmap = devm_regmap_init_i2c(i2c, axp20x->regmap_cfg); 663 - if (IS_ERR(axp20x->regmap)) { 664 - ret = PTR_ERR(axp20x->regmap); 665 - dev_err(&i2c->dev, "regmap init failed: %d\n", ret); 666 - return ret; 667 - } 668 - 669 - ret = regmap_add_irq_chip(axp20x->regmap, i2c->irq, 671 + ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq, 670 672 IRQF_ONESHOT | IRQF_SHARED, -1, 671 673 axp20x->regmap_irq_chip, 672 674 &axp20x->regmap_irqc); 673 675 if (ret) { 674 - dev_err(&i2c->dev, "failed to add irq chip: %d\n", ret); 676 + dev_err(axp20x->dev, "failed to add irq chip: %d\n", ret); 675 677 return ret; 676 678 } 677 679 678 680 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells, 679 - axp20x->nr_cells, NULL, 0, NULL); 681 + axp20x->nr_cells, NULL, 0, NULL); 680 682 681 683 if (ret) { 682 - dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret); 683 - regmap_del_irq_chip(i2c->irq, axp20x->regmap_irqc); 684 + dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret); 685 + regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); 684 686 return ret; 685 687 } 686 688 ··· 669 711 pm_power_off = axp20x_power_off; 670 712 } 671 713 672 - dev_info(&i2c->dev, "AXP20X driver loaded\n"); 714 + dev_info(axp20x->dev, "AXP20X driver loaded\n"); 673 715 674 716 return 0; 675 717 } 718 + EXPORT_SYMBOL(axp20x_device_probe); 676 719 677 - static int axp20x_i2c_remove(struct i2c_client *i2c) 720 + int axp20x_device_remove(struct axp20x_dev *axp20x) 678 721 { 679 - struct axp20x_dev *axp20x = i2c_get_clientdata(i2c); 680 - 681 722 if (axp20x == axp20x_pm_power_off) { 682 723 axp20x_pm_power_off = NULL; 683 724 pm_power_off = NULL; 684 725 } 685 726 686 727 mfd_remove_devices(axp20x->dev); 687 - regmap_del_irq_chip(axp20x->i2c_client->irq, axp20x->regmap_irqc); 728 + regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); 688 729 689 730 return 0; 690 731 } 691 - 692 - static struct i2c_driver axp20x_i2c_driver = { 693 - .driver = { 694 - .name = "axp20x", 695 - .of_match_table = of_match_ptr(axp20x_of_match), 696 - .acpi_match_table = ACPI_PTR(axp20x_acpi_match), 697 - }, 698 - .probe = axp20x_i2c_probe, 699 - .remove = axp20x_i2c_remove, 700 - .id_table = axp20x_i2c_id, 701 - }; 702 - 703 - module_i2c_driver(axp20x_i2c_driver); 732 + EXPORT_SYMBOL(axp20x_device_remove); 704 733 705 734 MODULE_DESCRIPTION("PMIC MFD core driver for AXP20X"); 706 735 MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
+1 -9
drivers/mfd/cs47l24-tables.c
··· 227 227 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 228 228 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */ 229 229 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 230 - { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */ 231 - { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */ 232 230 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */ 233 231 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 234 232 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ ··· 243 245 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 244 246 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */ 245 247 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 246 - { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 247 - { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */ 248 248 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */ 249 249 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 250 250 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ ··· 674 678 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */ 675 679 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 676 680 { 0x00000C20, 0x0002 }, /* R3104 - Misc Pad Ctrl 1 */ 677 - { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 681 + { 0x00000C21, 0x0000 }, /* R3105 - Misc Pad Ctrl 2 */ 678 682 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 679 683 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 680 684 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ ··· 854 858 case ARIZONA_FLL1_CONTROL_5: 855 859 case ARIZONA_FLL1_CONTROL_6: 856 860 case ARIZONA_FLL1_CONTROL_7: 857 - case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 858 - case ARIZONA_FLL1_NCO_TEST_0: 859 861 case ARIZONA_FLL1_SYNCHRONISER_1: 860 862 case ARIZONA_FLL1_SYNCHRONISER_2: 861 863 case ARIZONA_FLL1_SYNCHRONISER_3: ··· 870 876 case ARIZONA_FLL2_CONTROL_5: 871 877 case ARIZONA_FLL2_CONTROL_6: 872 878 case ARIZONA_FLL2_CONTROL_7: 873 - case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 874 - case ARIZONA_FLL2_NCO_TEST_0: 875 879 case ARIZONA_FLL2_SYNCHRONISER_1: 876 880 case ARIZONA_FLL2_SYNCHRONISER_2: 877 881 case ARIZONA_FLL2_SYNCHRONISER_3:
+22 -1
drivers/mfd/da9062-core.c
··· 388 388 .range_min = DA9062AA_STATUS_D, 389 389 .range_max = DA9062AA_EVENT_C, 390 390 }, { 391 - .range_min = DA9062AA_CONTROL_F, 391 + .range_min = DA9062AA_CONTROL_A, 392 + .range_max = DA9062AA_CONTROL_B, 393 + }, { 394 + .range_min = DA9062AA_CONTROL_E, 392 395 .range_max = DA9062AA_CONTROL_F, 396 + }, { 397 + .range_min = DA9062AA_BUCK2_CONT, 398 + .range_max = DA9062AA_BUCK4_CONT, 399 + }, { 400 + .range_min = DA9062AA_BUCK3_CONT, 401 + .range_max = DA9062AA_BUCK3_CONT, 402 + }, { 403 + .range_min = DA9062AA_LDO1_CONT, 404 + .range_max = DA9062AA_LDO4_CONT, 405 + }, { 406 + .range_min = DA9062AA_DVC_1, 407 + .range_max = DA9062AA_DVC_1, 393 408 }, { 394 409 .range_min = DA9062AA_COUNT_S, 395 410 .range_max = DA9062AA_SECOND_D, 411 + }, { 412 + .range_min = DA9062AA_SEQ, 413 + .range_max = DA9062AA_SEQ, 414 + }, { 415 + .range_min = DA9062AA_EN_32K, 416 + .range_max = DA9062AA_EN_32K, 396 417 }, 397 418 }; 398 419
+30 -6
drivers/mfd/da9063-i2c.c
··· 74 74 75 75 static const struct regmap_range da9063_ad_volatile_ranges[] = { 76 76 { 77 - .range_min = DA9063_REG_STATUS_A, 77 + .range_min = DA9063_REG_PAGE_CON, 78 78 .range_max = DA9063_REG_EVENT_D, 79 79 }, { 80 - .range_min = DA9063_REG_CONTROL_F, 80 + .range_min = DA9063_REG_CONTROL_A, 81 + .range_max = DA9063_REG_CONTROL_B, 82 + }, { 83 + .range_min = DA9063_REG_CONTROL_E, 81 84 .range_max = DA9063_REG_CONTROL_F, 82 85 }, { 83 - .range_min = DA9063_REG_ADC_MAN, 86 + .range_min = DA9063_REG_BCORE2_CONT, 87 + .range_max = DA9063_REG_LDO11_CONT, 88 + }, { 89 + .range_min = DA9063_REG_DVC_1, 84 90 .range_max = DA9063_REG_ADC_MAN, 85 91 }, { 86 92 .range_min = DA9063_REG_ADC_RES_L, 87 93 .range_max = DA9063_AD_REG_SECOND_D, 94 + }, { 95 + .range_min = DA9063_REG_SEQ, 96 + .range_max = DA9063_REG_SEQ, 97 + }, { 98 + .range_min = DA9063_REG_EN_32K, 99 + .range_max = DA9063_REG_EN_32K, 88 100 }, { 89 101 .range_min = DA9063_AD_REG_MON_REG_5, 90 102 .range_max = DA9063_AD_REG_MON_REG_6, ··· 164 152 165 153 static const struct regmap_range da9063_bb_volatile_ranges[] = { 166 154 { 167 - .range_min = DA9063_REG_STATUS_A, 155 + .range_min = DA9063_REG_PAGE_CON, 168 156 .range_max = DA9063_REG_EVENT_D, 169 157 }, { 170 - .range_min = DA9063_REG_CONTROL_F, 158 + .range_min = DA9063_REG_CONTROL_A, 159 + .range_max = DA9063_REG_CONTROL_B, 160 + }, { 161 + .range_min = DA9063_REG_CONTROL_E, 171 162 .range_max = DA9063_REG_CONTROL_F, 172 163 }, { 173 - .range_min = DA9063_REG_ADC_MAN, 164 + .range_min = DA9063_REG_BCORE2_CONT, 165 + .range_max = DA9063_REG_LDO11_CONT, 166 + }, { 167 + .range_min = DA9063_REG_DVC_1, 174 168 .range_max = DA9063_REG_ADC_MAN, 175 169 }, { 176 170 .range_min = DA9063_REG_ADC_RES_L, 177 171 .range_max = DA9063_BB_REG_SECOND_D, 172 + }, { 173 + .range_min = DA9063_REG_SEQ, 174 + .range_max = DA9063_REG_SEQ, 175 + }, { 176 + .range_min = DA9063_REG_EN_32K, 177 + .range_max = DA9063_REG_EN_32K, 178 178 }, { 179 179 .range_min = DA9063_BB_REG_MON_REG_5, 180 180 .range_max = DA9063_BB_REG_MON_REG_6,
+2 -5
drivers/mfd/db8500-prcmu.c
··· 739 739 if (!div && !requests[clkout]) 740 740 return -EINVAL; 741 741 742 - switch (clkout) { 743 - case 0: 742 + if (clkout == 0) { 744 743 div_mask = PRCM_CLKOCR_CLKODIV0_MASK; 745 744 mask = (PRCM_CLKOCR_CLKODIV0_MASK | PRCM_CLKOCR_CLKOSEL0_MASK); 746 745 bits = ((source << PRCM_CLKOCR_CLKOSEL0_SHIFT) | 747 746 (div << PRCM_CLKOCR_CLKODIV0_SHIFT)); 748 - break; 749 - case 1: 747 + } else { 750 748 div_mask = PRCM_CLKOCR_CLKODIV1_MASK; 751 749 mask = (PRCM_CLKOCR_CLKODIV1_MASK | PRCM_CLKOCR_CLKOSEL1_MASK | 752 750 PRCM_CLKOCR_CLK1TYPE); 753 751 bits = ((source << PRCM_CLKOCR_CLKOSEL1_SHIFT) | 754 752 (div << PRCM_CLKOCR_CLKODIV1_SHIFT)); 755 - break; 756 753 } 757 754 bits &= mask; 758 755
+203
drivers/mfd/fsl-imx25-tsadc.c
··· 1 + /* 2 + * Copyright (C) 2014-2015 Pengutronix, Markus Pargmann <mpa@pengutronix.de> 3 + * 4 + * This program is free software; you can redistribute it and/or modify it under 5 + * the terms of the GNU General Public License version 2 as published by the 6 + * Free Software Foundation. 7 + */ 8 + 9 + #include <linux/clk.h> 10 + #include <linux/interrupt.h> 11 + #include <linux/irqchip/chained_irq.h> 12 + #include <linux/irqdesc.h> 13 + #include <linux/irqdomain.h> 14 + #include <linux/irq.h> 15 + #include <linux/mfd/imx25-tsadc.h> 16 + #include <linux/module.h> 17 + #include <linux/of.h> 18 + #include <linux/of_platform.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/regmap.h> 21 + 22 + static struct regmap_config mx25_tsadc_regmap_config = { 23 + .fast_io = true, 24 + .max_register = 8, 25 + .reg_bits = 32, 26 + .val_bits = 32, 27 + .reg_stride = 4, 28 + }; 29 + 30 + static void mx25_tsadc_irq_handler(struct irq_desc *desc) 31 + { 32 + struct mx25_tsadc *tsadc = irq_desc_get_handler_data(desc); 33 + struct irq_chip *chip = irq_desc_get_chip(desc); 34 + u32 status; 35 + 36 + chained_irq_enter(chip, desc); 37 + 38 + regmap_read(tsadc->regs, MX25_TSC_TGSR, &status); 39 + 40 + if (status & MX25_TGSR_GCQ_INT) 41 + generic_handle_irq(irq_find_mapping(tsadc->domain, 1)); 42 + 43 + if (status & MX25_TGSR_TCQ_INT) 44 + generic_handle_irq(irq_find_mapping(tsadc->domain, 0)); 45 + 46 + chained_irq_exit(chip, desc); 47 + } 48 + 49 + static int mx25_tsadc_domain_map(struct irq_domain *d, unsigned int irq, 50 + irq_hw_number_t hwirq) 51 + { 52 + struct mx25_tsadc *tsadc = d->host_data; 53 + 54 + irq_set_chip_data(irq, tsadc); 55 + irq_set_chip_and_handler(irq, &dummy_irq_chip, 56 + handle_level_irq); 57 + irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE); 58 + 59 + return 0; 60 + } 61 + 62 + static struct irq_domain_ops mx25_tsadc_domain_ops = { 63 + .map = mx25_tsadc_domain_map, 64 + .xlate = irq_domain_xlate_onecell, 65 + }; 66 + 67 + static int mx25_tsadc_setup_irq(struct platform_device *pdev, 68 + struct mx25_tsadc *tsadc) 69 + { 70 + struct device *dev = &pdev->dev; 71 + struct device_node *np = dev->of_node; 72 + int irq; 73 + 74 + irq = platform_get_irq(pdev, 0); 75 + if (irq <= 0) { 76 + dev_err(dev, "Failed to get irq\n"); 77 + return irq; 78 + } 79 + 80 + tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops, 81 + tsadc); 82 + if (!tsadc->domain) { 83 + dev_err(dev, "Failed to add irq domain\n"); 84 + return -ENOMEM; 85 + } 86 + 87 + irq_set_chained_handler(irq, mx25_tsadc_irq_handler); 88 + irq_set_handler_data(irq, tsadc); 89 + 90 + return 0; 91 + } 92 + 93 + static void mx25_tsadc_setup_clk(struct platform_device *pdev, 94 + struct mx25_tsadc *tsadc) 95 + { 96 + unsigned clk_div; 97 + 98 + /* 99 + * According to the datasheet the ADC clock should never 100 + * exceed 1,75 MHz. Base clock is the IPG and the ADC unit uses 101 + * a funny clock divider. To keep the ADC conversion time constant 102 + * adapt the ADC internal clock divider to the IPG clock rate. 103 + */ 104 + 105 + dev_dbg(&pdev->dev, "Found master clock at %lu Hz\n", 106 + clk_get_rate(tsadc->clk)); 107 + 108 + clk_div = DIV_ROUND_UP(clk_get_rate(tsadc->clk), 1750000); 109 + dev_dbg(&pdev->dev, "Setting up ADC clock divider to %u\n", clk_div); 110 + 111 + /* adc clock = IPG clock / (2 * div + 2) */ 112 + clk_div -= 2; 113 + clk_div /= 2; 114 + 115 + /* 116 + * the ADC clock divider changes its behaviour when values below 4 117 + * are used: it is fixed to "/ 10" in this case 118 + */ 119 + clk_div = max_t(unsigned, 4, clk_div); 120 + 121 + dev_dbg(&pdev->dev, "Resulting ADC conversion clock at %lu Hz\n", 122 + clk_get_rate(tsadc->clk) / (2 * clk_div + 2)); 123 + 124 + regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, 125 + MX25_TGCR_ADCCLKCFG(0x1f), 126 + MX25_TGCR_ADCCLKCFG(clk_div)); 127 + } 128 + 129 + static int mx25_tsadc_probe(struct platform_device *pdev) 130 + { 131 + struct device *dev = &pdev->dev; 132 + struct device_node *np = dev->of_node; 133 + struct mx25_tsadc *tsadc; 134 + struct resource *res; 135 + int ret; 136 + void __iomem *iomem; 137 + 138 + tsadc = devm_kzalloc(dev, sizeof(*tsadc), GFP_KERNEL); 139 + if (!tsadc) 140 + return -ENOMEM; 141 + 142 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 143 + iomem = devm_ioremap_resource(dev, res); 144 + if (IS_ERR(iomem)) 145 + return PTR_ERR(iomem); 146 + 147 + tsadc->regs = devm_regmap_init_mmio(dev, iomem, 148 + &mx25_tsadc_regmap_config); 149 + if (IS_ERR(tsadc->regs)) { 150 + dev_err(dev, "Failed to initialize regmap\n"); 151 + return PTR_ERR(tsadc->regs); 152 + } 153 + 154 + tsadc->clk = devm_clk_get(dev, "ipg"); 155 + if (IS_ERR(tsadc->clk)) { 156 + dev_err(dev, "Failed to get ipg clock\n"); 157 + return PTR_ERR(tsadc->clk); 158 + } 159 + 160 + /* setup clock according to the datasheet */ 161 + mx25_tsadc_setup_clk(pdev, tsadc); 162 + 163 + /* Enable clock and reset the component */ 164 + regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_CLK_EN, 165 + MX25_TGCR_CLK_EN); 166 + regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_TSC_RST, 167 + MX25_TGCR_TSC_RST); 168 + 169 + /* Setup powersaving mode, but enable internal reference voltage */ 170 + regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_POWERMODE_MASK, 171 + MX25_TGCR_POWERMODE_SAVE); 172 + regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_INTREFEN, 173 + MX25_TGCR_INTREFEN); 174 + 175 + ret = mx25_tsadc_setup_irq(pdev, tsadc); 176 + if (ret) 177 + return ret; 178 + 179 + platform_set_drvdata(pdev, tsadc); 180 + 181 + of_platform_populate(np, NULL, NULL, dev); 182 + 183 + return 0; 184 + } 185 + 186 + static const struct of_device_id mx25_tsadc_ids[] = { 187 + { .compatible = "fsl,imx25-tsadc" }, 188 + { /* Sentinel */ } 189 + }; 190 + 191 + static struct platform_driver mx25_tsadc_driver = { 192 + .driver = { 193 + .name = "mx25-tsadc", 194 + .of_match_table = of_match_ptr(mx25_tsadc_ids), 195 + }, 196 + .probe = mx25_tsadc_probe, 197 + }; 198 + module_platform_driver(mx25_tsadc_driver); 199 + 200 + MODULE_DESCRIPTION("MFD for ADC/TSC for Freescale mx25"); 201 + MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>"); 202 + MODULE_LICENSE("GPL v2"); 203 + MODULE_ALIAS("platform:mx25-tsadc");
+12
drivers/mfd/intel-lpss-acpi.c
··· 44 44 .clk_rate = 100000000, 45 45 }; 46 46 47 + static struct property_entry bxt_i2c_properties[] = { 48 + PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42), 49 + PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), 50 + PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208), 51 + { }, 52 + }; 53 + 54 + static struct property_set bxt_i2c_pset = { 55 + .properties = bxt_i2c_properties, 56 + }; 57 + 47 58 static const struct intel_lpss_platform_info bxt_i2c_info = { 48 59 .clk_rate = 133000000, 60 + .pset = &bxt_i2c_pset, 49 61 }; 50 62 51 63 static const struct acpi_device_id intel_lpss_acpi_ids[] = {
+30 -1
drivers/mfd/intel-lpss-pci.c
··· 107 107 .pset = &uart_pset, 108 108 }; 109 109 110 + static struct property_entry bxt_i2c_properties[] = { 111 + PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42), 112 + PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), 113 + PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208), 114 + { }, 115 + }; 116 + 117 + static struct property_set bxt_i2c_pset = { 118 + .properties = bxt_i2c_properties, 119 + }; 120 + 110 121 static const struct intel_lpss_platform_info bxt_i2c_info = { 111 122 .clk_rate = 133000000, 123 + .pset = &bxt_i2c_pset, 112 124 }; 113 125 114 126 static const struct pci_device_id intel_lpss_pci_ids[] = { 115 - /* BXT */ 127 + /* BXT A-Step */ 116 128 { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, 117 129 { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info }, 118 130 { PCI_VDEVICE(INTEL, 0x0ab0), (kernel_ulong_t)&bxt_i2c_info }, ··· 140 128 { PCI_VDEVICE(INTEL, 0x0ac4), (kernel_ulong_t)&bxt_info }, 141 129 { PCI_VDEVICE(INTEL, 0x0ac6), (kernel_ulong_t)&bxt_info }, 142 130 { PCI_VDEVICE(INTEL, 0x0aee), (kernel_ulong_t)&bxt_uart_info }, 131 + /* BXT B-Step */ 132 + { PCI_VDEVICE(INTEL, 0x1aac), (kernel_ulong_t)&bxt_i2c_info }, 133 + { PCI_VDEVICE(INTEL, 0x1aae), (kernel_ulong_t)&bxt_i2c_info }, 134 + { PCI_VDEVICE(INTEL, 0x1ab0), (kernel_ulong_t)&bxt_i2c_info }, 135 + { PCI_VDEVICE(INTEL, 0x1ab2), (kernel_ulong_t)&bxt_i2c_info }, 136 + { PCI_VDEVICE(INTEL, 0x1ab4), (kernel_ulong_t)&bxt_i2c_info }, 137 + { PCI_VDEVICE(INTEL, 0x1ab6), (kernel_ulong_t)&bxt_i2c_info }, 138 + { PCI_VDEVICE(INTEL, 0x1ab8), (kernel_ulong_t)&bxt_i2c_info }, 139 + { PCI_VDEVICE(INTEL, 0x1aba), (kernel_ulong_t)&bxt_i2c_info }, 140 + { PCI_VDEVICE(INTEL, 0x1abc), (kernel_ulong_t)&bxt_uart_info }, 141 + { PCI_VDEVICE(INTEL, 0x1abe), (kernel_ulong_t)&bxt_uart_info }, 142 + { PCI_VDEVICE(INTEL, 0x1ac0), (kernel_ulong_t)&bxt_uart_info }, 143 + { PCI_VDEVICE(INTEL, 0x1ac2), (kernel_ulong_t)&bxt_info }, 144 + { PCI_VDEVICE(INTEL, 0x1ac4), (kernel_ulong_t)&bxt_info }, 145 + { PCI_VDEVICE(INTEL, 0x1ac6), (kernel_ulong_t)&bxt_info }, 146 + { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info }, 147 + 143 148 /* APL */ 144 149 { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, 145 150 { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info },
+1
drivers/mfd/intel-lpss.c
··· 453 453 err_remove_ltr: 454 454 intel_lpss_debugfs_remove(lpss); 455 455 intel_lpss_ltr_hide(lpss); 456 + intel_lpss_unregister_clock(lpss); 456 457 457 458 err_clk_register: 458 459 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
+9 -17
drivers/mfd/intel_quark_i2c_gpio.c
··· 52 52 /* The Quark I2C controller source clock */ 53 53 #define INTEL_QUARK_I2C_CLK_HZ 33000000 54 54 55 - #define INTEL_QUARK_I2C_NCLK 1 56 - 57 55 struct intel_quark_mfd { 58 56 struct pci_dev *pdev; 59 57 struct clk *i2c_clk; ··· 126 128 static int intel_quark_register_i2c_clk(struct intel_quark_mfd *quark_mfd) 127 129 { 128 130 struct pci_dev *pdev = quark_mfd->pdev; 129 - struct clk_lookup *i2c_clk_lookup; 130 131 struct clk *i2c_clk; 131 - int ret; 132 - 133 - i2c_clk_lookup = devm_kcalloc(&pdev->dev, INTEL_QUARK_I2C_NCLK, 134 - sizeof(*i2c_clk_lookup), GFP_KERNEL); 135 - if (!i2c_clk_lookup) 136 - return -ENOMEM; 137 - 138 - i2c_clk_lookup[0].dev_id = INTEL_QUARK_I2C_CONTROLLER_CLK; 139 132 140 133 i2c_clk = clk_register_fixed_rate(&pdev->dev, 141 134 INTEL_QUARK_I2C_CONTROLLER_CLK, NULL, 142 135 CLK_IS_ROOT, INTEL_QUARK_I2C_CLK_HZ); 136 + if (IS_ERR(i2c_clk)) 137 + return PTR_ERR(i2c_clk); 143 138 144 - quark_mfd->i2c_clk_lookup = i2c_clk_lookup; 145 139 quark_mfd->i2c_clk = i2c_clk; 140 + quark_mfd->i2c_clk_lookup = clkdev_create(i2c_clk, NULL, 141 + INTEL_QUARK_I2C_CONTROLLER_CLK); 146 142 147 - ret = clk_register_clkdevs(i2c_clk, i2c_clk_lookup, 148 - INTEL_QUARK_I2C_NCLK); 149 - if (ret) 150 - dev_err(&pdev->dev, "Fixed clk register failed: %d\n", ret); 143 + if (!quark_mfd->i2c_clk_lookup) { 144 + dev_err(&pdev->dev, "Fixed clk register failed\n"); 145 + return -ENOMEM; 146 + } 151 147 152 - return ret; 148 + return 0; 153 149 } 154 150 155 151 static void intel_quark_unregister_i2c_clk(struct pci_dev *pdev)
+1 -1
drivers/mfd/ipaq-micro.c
··· 376 376 { .name = "ipaq-micro-leds", }, 377 377 }; 378 378 379 - static int micro_resume(struct device *dev) 379 + static int __maybe_unused micro_resume(struct device *dev) 380 380 { 381 381 struct ipaq_micro *micro = dev_get_drvdata(dev); 382 382
+2
drivers/mfd/max77686.c
··· 169 169 }, 170 170 { }, 171 171 }; 172 + MODULE_DEVICE_TABLE(of, max77686_pmic_dt_match); 172 173 173 174 static int max77686_i2c_probe(struct i2c_client *i2c, 174 175 const struct i2c_device_id *id) ··· 266 265 267 266 static const struct i2c_device_id max77686_i2c_id[] = { 268 267 { "max77686", TYPE_MAX77686 }, 268 + { "max77802", TYPE_MAX77802 }, 269 269 { } 270 270 }; 271 271 MODULE_DEVICE_TABLE(i2c, max77686_i2c_id);
+81 -24
drivers/mfd/mt6397-core.c
··· 19 19 #include <linux/regmap.h> 20 20 #include <linux/mfd/core.h> 21 21 #include <linux/mfd/mt6397/core.h> 22 + #include <linux/mfd/mt6323/core.h> 22 23 #include <linux/mfd/mt6397/registers.h> 24 + #include <linux/mfd/mt6323/registers.h> 23 25 24 26 #define MT6397_RTC_BASE 0xe000 25 27 #define MT6397_RTC_SIZE 0x3e 28 + 29 + #define MT6323_CID_CODE 0x23 30 + #define MT6391_CID_CODE 0x91 31 + #define MT6397_CID_CODE 0x97 26 32 27 33 static const struct resource mt6397_rtc_resources[] = { 28 34 { ··· 40 34 .start = MT6397_IRQ_RTC, 41 35 .end = MT6397_IRQ_RTC, 42 36 .flags = IORESOURCE_IRQ, 37 + }, 38 + }; 39 + 40 + static const struct mfd_cell mt6323_devs[] = { 41 + { 42 + .name = "mt6323-regulator", 43 + .of_compatible = "mediatek,mt6323-regulator" 43 44 }, 44 45 }; 45 46 ··· 82 69 { 83 70 struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); 84 71 85 - regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]); 86 - regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]); 72 + regmap_write(mt6397->regmap, mt6397->int_con[0], 73 + mt6397->irq_masks_cur[0]); 74 + regmap_write(mt6397->regmap, mt6397->int_con[1], 75 + mt6397->irq_masks_cur[1]); 87 76 88 77 mutex_unlock(&mt6397->irqlock); 89 78 } ··· 162 147 { 163 148 struct mt6397_chip *mt6397 = data; 164 149 165 - mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS0, 0); 166 - mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS1, 16); 150 + mt6397_irq_handle_reg(mt6397, mt6397->int_status[0], 0); 151 + mt6397_irq_handle_reg(mt6397, mt6397->int_status[1], 16); 167 152 168 153 return IRQ_HANDLED; 169 154 } ··· 192 177 mutex_init(&mt6397->irqlock); 193 178 194 179 /* Mask all interrupt sources */ 195 - regmap_write(mt6397->regmap, MT6397_INT_CON0, 0x0); 196 - regmap_write(mt6397->regmap, MT6397_INT_CON1, 0x0); 180 + regmap_write(mt6397->regmap, mt6397->int_con[0], 0x0); 181 + regmap_write(mt6397->regmap, mt6397->int_con[1], 0x0); 197 182 198 183 mt6397->irq_domain = irq_domain_add_linear(mt6397->dev->of_node, 199 184 MT6397_IRQ_NR, &mt6397_irq_domain_ops, mt6397); ··· 218 203 { 219 204 struct mt6397_chip *chip = dev_get_drvdata(dev); 220 205 221 - regmap_write(chip->regmap, MT6397_INT_CON0, chip->wake_mask[0]); 222 - regmap_write(chip->regmap, MT6397_INT_CON1, chip->wake_mask[1]); 206 + regmap_write(chip->regmap, chip->int_con[0], chip->wake_mask[0]); 207 + regmap_write(chip->regmap, chip->int_con[1], chip->wake_mask[1]); 223 208 224 209 enable_irq_wake(chip->irq); 225 210 ··· 230 215 { 231 216 struct mt6397_chip *chip = dev_get_drvdata(dev); 232 217 233 - regmap_write(chip->regmap, MT6397_INT_CON0, chip->irq_masks_cur[0]); 234 - regmap_write(chip->regmap, MT6397_INT_CON1, chip->irq_masks_cur[1]); 218 + regmap_write(chip->regmap, chip->int_con[0], chip->irq_masks_cur[0]); 219 + regmap_write(chip->regmap, chip->int_con[1], chip->irq_masks_cur[1]); 235 220 236 221 disable_irq_wake(chip->irq); 237 222 ··· 245 230 static int mt6397_probe(struct platform_device *pdev) 246 231 { 247 232 int ret; 248 - struct mt6397_chip *mt6397; 233 + unsigned int id; 234 + struct mt6397_chip *pmic; 249 235 250 - mt6397 = devm_kzalloc(&pdev->dev, sizeof(*mt6397), GFP_KERNEL); 251 - if (!mt6397) 236 + pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); 237 + if (!pmic) 252 238 return -ENOMEM; 253 239 254 - mt6397->dev = &pdev->dev; 240 + pmic->dev = &pdev->dev; 241 + 255 242 /* 256 243 * mt6397 MFD is child device of soc pmic wrapper. 257 244 * Regmap is set from its parent. 258 245 */ 259 - mt6397->regmap = dev_get_regmap(pdev->dev.parent, NULL); 260 - if (!mt6397->regmap) 246 + pmic->regmap = dev_get_regmap(pdev->dev.parent, NULL); 247 + if (!pmic->regmap) 261 248 return -ENODEV; 262 249 263 - platform_set_drvdata(pdev, mt6397); 250 + platform_set_drvdata(pdev, pmic); 264 251 265 - mt6397->irq = platform_get_irq(pdev, 0); 266 - if (mt6397->irq > 0) { 267 - ret = mt6397_irq_init(mt6397); 252 + ret = regmap_read(pmic->regmap, MT6397_CID, &id); 253 + if (ret) { 254 + dev_err(pmic->dev, "Failed to read chip id: %d\n", ret); 255 + goto fail_irq; 256 + } 257 + 258 + switch (id & 0xff) { 259 + case MT6323_CID_CODE: 260 + pmic->int_con[0] = MT6323_INT_CON0; 261 + pmic->int_con[1] = MT6323_INT_CON1; 262 + pmic->int_status[0] = MT6323_INT_STATUS0; 263 + pmic->int_status[1] = MT6323_INT_STATUS1; 264 + ret = mfd_add_devices(&pdev->dev, -1, mt6323_devs, 265 + ARRAY_SIZE(mt6323_devs), NULL, 0, NULL); 266 + break; 267 + 268 + case MT6397_CID_CODE: 269 + case MT6391_CID_CODE: 270 + pmic->int_con[0] = MT6397_INT_CON0; 271 + pmic->int_con[1] = MT6397_INT_CON1; 272 + pmic->int_status[0] = MT6397_INT_STATUS0; 273 + pmic->int_status[1] = MT6397_INT_STATUS1; 274 + ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs, 275 + ARRAY_SIZE(mt6397_devs), NULL, 0, NULL); 276 + break; 277 + 278 + default: 279 + dev_err(&pdev->dev, "unsupported chip: %d\n", id); 280 + ret = -ENODEV; 281 + break; 282 + } 283 + 284 + pmic->irq = platform_get_irq(pdev, 0); 285 + if (pmic->irq > 0) { 286 + ret = mt6397_irq_init(pmic); 268 287 if (ret) 269 288 return ret; 270 289 } 271 290 272 - ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs, 273 - ARRAY_SIZE(mt6397_devs), NULL, 0, NULL); 274 - if (ret) 291 + fail_irq: 292 + if (ret) { 293 + irq_domain_remove(pmic->irq_domain); 275 294 dev_err(&pdev->dev, "failed to add child devices: %d\n", ret); 295 + } 276 296 277 297 return ret; 278 298 } ··· 321 271 322 272 static const struct of_device_id mt6397_of_match[] = { 323 273 { .compatible = "mediatek,mt6397" }, 274 + { .compatible = "mediatek,mt6323" }, 324 275 { } 325 276 }; 326 277 MODULE_DEVICE_TABLE(of, mt6397_of_match); 278 + 279 + static const struct platform_device_id mt6397_id[] = { 280 + { "mt6397", 0 }, 281 + { }, 282 + }; 283 + MODULE_DEVICE_TABLE(platform, mt6397_id); 327 284 328 285 static struct platform_driver mt6397_driver = { 329 286 .probe = mt6397_probe, ··· 340 283 .of_match_table = of_match_ptr(mt6397_of_match), 341 284 .pm = &mt6397_pm_ops, 342 285 }, 286 + .id_table = mt6397_id, 343 287 }; 344 288 345 289 module_platform_driver(mt6397_driver); ··· 348 290 MODULE_AUTHOR("Flora Fu, MediaTek"); 349 291 MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC"); 350 292 MODULE_LICENSE("GPL"); 351 - MODULE_ALIAS("platform:mt6397");
+2 -2
drivers/mfd/rc5t583.c
··· 241 241 .reg_bits = 8, 242 242 .val_bits = 8, 243 243 .volatile_reg = volatile_reg, 244 - .max_register = RC5T583_MAX_REGS, 245 - .num_reg_defaults_raw = RC5T583_MAX_REGS, 244 + .max_register = RC5T583_MAX_REG, 245 + .num_reg_defaults_raw = RC5T583_NUM_REGS, 246 246 .cache_type = REGCACHE_RBTREE, 247 247 }; 248 248
+35
drivers/mfd/stmpe.c
··· 334 334 }; 335 335 336 336 /* 337 + * PWM (1601, 2401, 2403) 338 + */ 339 + static struct resource stmpe_pwm_resources[] = { 340 + { 341 + .name = "PWM0", 342 + .flags = IORESOURCE_IRQ, 343 + }, 344 + { 345 + .name = "PWM1", 346 + .flags = IORESOURCE_IRQ, 347 + }, 348 + { 349 + .name = "PWM2", 350 + .flags = IORESOURCE_IRQ, 351 + }, 352 + }; 353 + 354 + static const struct mfd_cell stmpe_pwm_cell = { 355 + .name = "stmpe-pwm", 356 + .of_compatible = "st,stmpe-pwm", 357 + .resources = stmpe_pwm_resources, 358 + .num_resources = ARRAY_SIZE(stmpe_pwm_resources), 359 + }; 360 + 361 + /* 337 362 * STMPE801 338 363 */ 339 364 static const u8 stmpe801_regs[] = { ··· 561 536 .cell = &stmpe_keypad_cell, 562 537 .irq = STMPE1601_IRQ_KEYPAD, 563 538 .block = STMPE_BLOCK_KEYPAD, 539 + }, 540 + { 541 + .cell = &stmpe_pwm_cell, 542 + .irq = STMPE1601_IRQ_PWM0, 543 + .block = STMPE_BLOCK_PWM, 564 544 }, 565 545 }; 566 546 ··· 800 770 .cell = &stmpe_keypad_cell, 801 771 .irq = STMPE24XX_IRQ_KEYPAD, 802 772 .block = STMPE_BLOCK_KEYPAD, 773 + }, 774 + { 775 + .cell = &stmpe_pwm_cell, 776 + .irq = STMPE24XX_IRQ_PWM0, 777 + .block = STMPE_BLOCK_PWM, 803 778 }, 804 779 }; 805 780
+13 -6
drivers/mfd/syscon.c
··· 36 36 struct list_head list; 37 37 }; 38 38 39 - static struct regmap_config syscon_regmap_config = { 39 + static const struct regmap_config syscon_regmap_config = { 40 40 .reg_bits = 32, 41 41 .val_bits = 32, 42 42 .reg_stride = 4, ··· 50 50 u32 reg_io_width; 51 51 int ret; 52 52 struct regmap_config syscon_config = syscon_regmap_config; 53 + struct resource res; 53 54 54 55 if (!of_device_is_compatible(np, "syscon")) 55 56 return ERR_PTR(-EINVAL); ··· 59 58 if (!syscon) 60 59 return ERR_PTR(-ENOMEM); 61 60 62 - base = of_iomap(np, 0); 61 + if (of_address_to_resource(np, 0, &res)) { 62 + ret = -ENOMEM; 63 + goto err_map; 64 + } 65 + 66 + base = ioremap(res.start, resource_size(&res)); 63 67 if (!base) { 64 68 ret = -ENOMEM; 65 69 goto err_map; ··· 87 81 88 82 syscon_config.reg_stride = reg_io_width; 89 83 syscon_config.val_bits = reg_io_width * 8; 84 + syscon_config.max_register = resource_size(&res) - reg_io_width; 90 85 91 86 regmap = regmap_init_mmio(NULL, base, &syscon_config); 92 87 if (IS_ERR(regmap)) { ··· 199 192 struct device *dev = &pdev->dev; 200 193 struct syscon_platform_data *pdata = dev_get_platdata(dev); 201 194 struct syscon *syscon; 195 + struct regmap_config syscon_config = syscon_regmap_config; 202 196 struct resource *res; 203 197 void __iomem *base; 204 198 ··· 215 207 if (!base) 216 208 return -ENOMEM; 217 209 218 - syscon_regmap_config.max_register = res->end - res->start - 3; 210 + syscon_config.max_register = res->end - res->start - 3; 219 211 if (pdata) 220 - syscon_regmap_config.name = pdata->label; 221 - syscon->regmap = devm_regmap_init_mmio(dev, base, 222 - &syscon_regmap_config); 212 + syscon_config.name = pdata->label; 213 + syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config); 223 214 if (IS_ERR(syscon->regmap)) { 224 215 dev_err(dev, "regmap init failed\n"); 225 216 return PTR_ERR(syscon->regmap);
+1 -20
drivers/mfd/tps65010.c
··· 1059 1059 1060 1060 static int __init tps_init(void) 1061 1061 { 1062 - u32 tries = 3; 1063 - int status = -ENODEV; 1064 - 1065 - printk(KERN_INFO "%s: version %s\n", DRIVER_NAME, DRIVER_VERSION); 1066 - 1067 - /* some boards have startup glitches */ 1068 - while (tries--) { 1069 - status = i2c_add_driver(&tps65010_driver); 1070 - if (the_tps) 1071 - break; 1072 - i2c_del_driver(&tps65010_driver); 1073 - if (!tries) { 1074 - printk(KERN_ERR "%s: no chip?\n", DRIVER_NAME); 1075 - return -ENODEV; 1076 - } 1077 - pr_debug("%s: re-probe ...\n", DRIVER_NAME); 1078 - msleep(10); 1079 - } 1080 - 1081 - return status; 1062 + return i2c_add_driver(&tps65010_driver); 1082 1063 } 1083 1064 /* NOTE: this MUST be initialized before the other parts of the system 1084 1065 * that rely on it ... but after the i2c bus on which this relies.
+149
drivers/mfd/tps65086.c
··· 1 + /* 2 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 3 + * Andrew F. Davis <afd@ti.com> 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + * 9 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 10 + * kind, whether expressed or implied; without even the implied warranty 11 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License version 2 for more details. 13 + * 14 + * Based on the TPS65912 driver 15 + */ 16 + 17 + #include <linux/i2c.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/mfd/core.h> 20 + #include <linux/module.h> 21 + 22 + #include <linux/mfd/tps65086.h> 23 + 24 + static const struct mfd_cell tps65086_cells[] = { 25 + { .name = "tps65086-regulator", }, 26 + { .name = "tps65086-gpio", }, 27 + }; 28 + 29 + static const struct regmap_range tps65086_yes_ranges[] = { 30 + regmap_reg_range(TPS65086_IRQ, TPS65086_IRQ), 31 + regmap_reg_range(TPS65086_PMICSTAT, TPS65086_SHUTDNSRC), 32 + regmap_reg_range(TPS65086_GPOCTRL, TPS65086_GPOCTRL), 33 + regmap_reg_range(TPS65086_PG_STATUS1, TPS65086_OC_STATUS), 34 + }; 35 + 36 + static const struct regmap_access_table tps65086_volatile_table = { 37 + .yes_ranges = tps65086_yes_ranges, 38 + .n_yes_ranges = ARRAY_SIZE(tps65086_yes_ranges), 39 + }; 40 + 41 + static const struct regmap_config tps65086_regmap_config = { 42 + .reg_bits = 8, 43 + .val_bits = 8, 44 + .cache_type = REGCACHE_RBTREE, 45 + .volatile_table = &tps65086_volatile_table, 46 + }; 47 + 48 + static const struct regmap_irq tps65086_irqs[] = { 49 + REGMAP_IRQ_REG(TPS65086_IRQ_DIETEMP, 0, TPS65086_IRQ_DIETEMP_MASK), 50 + REGMAP_IRQ_REG(TPS65086_IRQ_SHUTDN, 0, TPS65086_IRQ_SHUTDN_MASK), 51 + REGMAP_IRQ_REG(TPS65086_IRQ_FAULT, 0, TPS65086_IRQ_FAULT_MASK), 52 + }; 53 + 54 + static struct regmap_irq_chip tps65086_irq_chip = { 55 + .name = "tps65086", 56 + .status_base = TPS65086_IRQ, 57 + .mask_base = TPS65086_IRQ_MASK, 58 + .ack_base = TPS65086_IRQ, 59 + .init_ack_masked = true, 60 + .num_regs = 1, 61 + .irqs = tps65086_irqs, 62 + .num_irqs = ARRAY_SIZE(tps65086_irqs), 63 + }; 64 + 65 + static const struct of_device_id tps65086_of_match_table[] = { 66 + { .compatible = "ti,tps65086", }, 67 + { /* sentinel */ } 68 + }; 69 + MODULE_DEVICE_TABLE(of, tps65086_of_match_table); 70 + 71 + static int tps65086_probe(struct i2c_client *client, 72 + const struct i2c_device_id *ids) 73 + { 74 + struct tps65086 *tps; 75 + unsigned int version; 76 + int ret; 77 + 78 + tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); 79 + if (!tps) 80 + return -ENOMEM; 81 + 82 + i2c_set_clientdata(client, tps); 83 + tps->dev = &client->dev; 84 + tps->irq = client->irq; 85 + 86 + tps->regmap = devm_regmap_init_i2c(client, &tps65086_regmap_config); 87 + if (IS_ERR(tps->regmap)) { 88 + dev_err(tps->dev, "Failed to initialize register map\n"); 89 + return PTR_ERR(tps->regmap); 90 + } 91 + 92 + ret = regmap_read(tps->regmap, TPS65086_DEVICEID, &version); 93 + if (ret) { 94 + dev_err(tps->dev, "Failed to read revision register\n"); 95 + return ret; 96 + } 97 + 98 + dev_info(tps->dev, "Device: TPS65086%01lX, OTP: %c, Rev: %ld\n", 99 + (version & TPS65086_DEVICEID_PART_MASK), 100 + (char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A', 101 + (version & TPS65086_DEVICEID_REV_MASK) >> 6); 102 + 103 + ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, 104 + &tps65086_irq_chip, &tps->irq_data); 105 + if (ret) { 106 + dev_err(tps->dev, "Failed to register IRQ chip\n"); 107 + return ret; 108 + } 109 + 110 + ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells, 111 + ARRAY_SIZE(tps65086_cells), NULL, 0, 112 + regmap_irq_get_domain(tps->irq_data)); 113 + if (ret) { 114 + regmap_del_irq_chip(tps->irq, tps->irq_data); 115 + return ret; 116 + } 117 + 118 + return 0; 119 + } 120 + 121 + static int tps65086_remove(struct i2c_client *client) 122 + { 123 + struct tps65086 *tps = i2c_get_clientdata(client); 124 + 125 + regmap_del_irq_chip(tps->irq, tps->irq_data); 126 + 127 + return 0; 128 + } 129 + 130 + static const struct i2c_device_id tps65086_id_table[] = { 131 + { "tps65086", 0 }, 132 + { /* sentinel */ } 133 + }; 134 + MODULE_DEVICE_TABLE(i2c, tps65086_id_table); 135 + 136 + static struct i2c_driver tps65086_driver = { 137 + .driver = { 138 + .name = "tps65086", 139 + .of_match_table = tps65086_of_match_table, 140 + }, 141 + .probe = tps65086_probe, 142 + .remove = tps65086_remove, 143 + .id_table = tps65086_id_table, 144 + }; 145 + module_i2c_driver(tps65086_driver); 146 + 147 + MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>"); 148 + MODULE_DESCRIPTION("TPS65086 PMIC Driver"); 149 + MODULE_LICENSE("GPL v2");
+2 -3
drivers/mfd/tps65090.c
··· 30 30 #include <linux/err.h> 31 31 32 32 #define NUM_INT_REG 2 33 - #define TOTAL_NUM_REG 0x18 34 33 35 34 #define TPS65090_INT1_MASK_VAC_STATUS_CHANGE 1 36 35 #define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE 2 ··· 160 161 static const struct regmap_config tps65090_regmap_config = { 161 162 .reg_bits = 8, 162 163 .val_bits = 8, 163 - .max_register = TOTAL_NUM_REG, 164 - .num_reg_defaults_raw = TOTAL_NUM_REG, 164 + .max_register = TPS65090_MAX_REG, 165 + .num_reg_defaults_raw = TPS65090_NUM_REGS, 165 166 .cache_type = REGCACHE_RBTREE, 166 167 .volatile_reg = is_volatile_reg, 167 168 };
+4 -12
drivers/mfd/wm5102-tables.c
··· 297 297 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 298 298 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ 299 299 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 300 - { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */ 301 300 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */ 302 301 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 303 302 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ ··· 313 314 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 314 315 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ 315 316 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 316 - { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 317 317 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */ 318 318 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 319 319 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ ··· 336 338 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 337 339 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 338 340 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ 339 - { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ 341 + { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */ 340 342 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ 341 343 { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */ 342 344 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ ··· 400 402 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 401 403 { 0x00000436, 0x0081 }, /* R1078 - DAC Volume Limit 5R */ 402 404 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 403 - { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 405 + { 0x00000440, 0x0FFF }, /* R1088 - DRE Enable */ 404 406 { 0x00000442, 0x3F0A }, /* R1090 - DRE Control 2 */ 405 407 { 0x00000443, 0xDC1F }, /* R1090 - DRE Control 3 */ 406 408 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ ··· 861 863 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */ 862 864 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 863 865 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 864 - { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 866 + { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */ 865 867 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 866 868 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 867 869 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ ··· 982 984 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ 983 985 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ 984 986 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ 985 - { 0x00000EE3, 0x0400 }, /* R3811 - ASRC_RATE2 */ 987 + { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */ 986 988 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ 987 989 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ 988 990 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ ··· 1060 1062 case ARIZONA_FLL1_CONTROL_4: 1061 1063 case ARIZONA_FLL1_CONTROL_5: 1062 1064 case ARIZONA_FLL1_CONTROL_6: 1063 - case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 1064 - case ARIZONA_FLL1_NCO_TEST_0: 1065 1065 case ARIZONA_FLL1_CONTROL_7: 1066 1066 case ARIZONA_FLL1_SYNCHRONISER_1: 1067 1067 case ARIZONA_FLL1_SYNCHRONISER_2: ··· 1076 1080 case ARIZONA_FLL2_CONTROL_4: 1077 1081 case ARIZONA_FLL2_CONTROL_5: 1078 1082 case ARIZONA_FLL2_CONTROL_6: 1079 - case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 1080 - case ARIZONA_FLL2_NCO_TEST_0: 1081 1083 case ARIZONA_FLL2_CONTROL_7: 1082 1084 case ARIZONA_FLL2_SYNCHRONISER_1: 1083 1085 case ARIZONA_FLL2_SYNCHRONISER_2: ··· 1843 1849 case ARIZONA_HAPTICS_STATUS: 1844 1850 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1845 1851 case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 1846 - case ARIZONA_FLL1_NCO_TEST_0: 1847 - case ARIZONA_FLL2_NCO_TEST_0: 1848 1852 case ARIZONA_DAC_COMP_1: 1849 1853 case ARIZONA_DAC_COMP_2: 1850 1854 case ARIZONA_DAC_COMP_3:
+37 -45
drivers/mfd/wm5110-tables.c
··· 676 676 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ 677 677 { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ 678 678 { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */ 679 - { 0x0000000B, 0x0036 }, /* R11 - Ctrl IF I2C1 CFG 2 */ 680 - { 0x0000000C, 0x0036 }, /* R12 - Ctrl IF I2C2 CFG 2 */ 679 + { 0x0000000B, 0x001A }, /* R11 - Ctrl IF I2C1 CFG 2 */ 680 + { 0x0000000C, 0x001A }, /* R12 - Ctrl IF I2C2 CFG 2 */ 681 681 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ 682 682 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ 683 683 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ ··· 723 723 { 0x00000154, 0x0000 }, /* R340 - Rate Estimator 3 */ 724 724 { 0x00000155, 0x0000 }, /* R341 - Rate Estimator 4 */ 725 725 { 0x00000156, 0x0000 }, /* R342 - Rate Estimator 5 */ 726 - { 0x00000171, 0x0000 }, /* R369 - FLL1 Control 1 */ 726 + { 0x00000171, 0x0002 }, /* R369 - FLL1 Control 1 */ 727 727 { 0x00000172, 0x0008 }, /* R370 - FLL1 Control 2 */ 728 728 { 0x00000173, 0x0018 }, /* R371 - FLL1 Control 3 */ 729 729 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 730 730 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */ 731 731 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 732 - { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */ 733 - { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */ 734 732 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */ 735 733 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 736 734 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ ··· 738 740 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */ 739 741 { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */ 740 742 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */ 741 - { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */ 742 - { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */ 743 + { 0x0000018A, 0x000C }, /* R394 - FLL1 GPIO Clock */ 744 + { 0x00000191, 0x0002 }, /* R401 - FLL2 Control 1 */ 743 745 { 0x00000192, 0x0008 }, /* R402 - FLL2 Control 2 */ 744 746 { 0x00000193, 0x0018 }, /* R403 - FLL2 Control 3 */ 745 747 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 746 748 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */ 747 749 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 748 - { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 749 - { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */ 750 750 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */ 751 751 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 752 752 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ ··· 754 758 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */ 755 759 { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */ 756 760 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */ 757 - { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */ 761 + { 0x000001AA, 0x000C }, /* R426 - FLL2 GPIO Clock */ 758 762 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ 759 763 { 0x00000210, 0x0184 }, /* R528 - LDO1 Control 1 */ 760 764 { 0x00000213, 0x03E4 }, /* R531 - LDO2 Control 1 */ ··· 767 771 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 768 772 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 769 773 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ 770 - { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ 774 + { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */ 771 775 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ 772 - { 0x000002A9, 0x300A }, /* R681 - Mic Detect Level 4 */ 776 + { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */ 773 777 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ 774 778 { 0x000002CB, 0x0000 }, /* R715 - Isolation control */ 775 779 { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ ··· 806 810 { 0x00000409, 0x0022 }, /* R1033 - Output Volume Ramp */ 807 811 { 0x00000410, 0x0080 }, /* R1040 - Output Path Config 1L */ 808 812 { 0x00000411, 0x0180 }, /* R1041 - DAC Digital Volume 1L */ 809 - { 0x00000412, 0x0080 }, /* R1042 - DAC Volume Limit 1L */ 813 + { 0x00000412, 0x0081 }, /* R1042 - DAC Volume Limit 1L */ 810 814 { 0x00000413, 0x0001 }, /* R1043 - Noise Gate Select 1L */ 811 815 { 0x00000414, 0x0080 }, /* R1044 - Output Path Config 1R */ 812 816 { 0x00000415, 0x0180 }, /* R1045 - DAC Digital Volume 1R */ 813 - { 0x00000416, 0x0080 }, /* R1046 - DAC Volume Limit 1R */ 817 + { 0x00000416, 0x0081 }, /* R1046 - DAC Volume Limit 1R */ 814 818 { 0x00000417, 0x0002 }, /* R1047 - Noise Gate Select 1R */ 815 819 { 0x00000418, 0x0080 }, /* R1048 - Output Path Config 2L */ 816 820 { 0x00000419, 0x0180 }, /* R1049 - DAC Digital Volume 2L */ 817 - { 0x0000041A, 0x0080 }, /* R1050 - DAC Volume Limit 2L */ 821 + { 0x0000041A, 0x0081 }, /* R1050 - DAC Volume Limit 2L */ 818 822 { 0x0000041B, 0x0004 }, /* R1051 - Noise Gate Select 2L */ 819 823 { 0x0000041C, 0x0080 }, /* R1052 - Output Path Config 2R */ 820 824 { 0x0000041D, 0x0180 }, /* R1053 - DAC Digital Volume 2R */ 821 - { 0x0000041E, 0x0080 }, /* R1054 - DAC Volume Limit 2R */ 825 + { 0x0000041E, 0x0081 }, /* R1054 - DAC Volume Limit 2R */ 822 826 { 0x0000041F, 0x0008 }, /* R1055 - Noise Gate Select 2R */ 823 827 { 0x00000420, 0x0080 }, /* R1056 - Output Path Config 3L */ 824 828 { 0x00000421, 0x0180 }, /* R1057 - DAC Digital Volume 3L */ 825 - { 0x00000422, 0x0080 }, /* R1058 - DAC Volume Limit 3L */ 829 + { 0x00000422, 0x0081 }, /* R1058 - DAC Volume Limit 3L */ 826 830 { 0x00000423, 0x0010 }, /* R1059 - Noise Gate Select 3L */ 827 831 { 0x00000424, 0x0080 }, /* R1060 - Output Path Config 3R */ 828 832 { 0x00000425, 0x0180 }, /* R1061 - DAC Digital Volume 3R */ 829 - { 0x00000426, 0x0080 }, /* R1062 - DAC Volume Limit 3R */ 833 + { 0x00000426, 0x0081 }, /* R1062 - DAC Volume Limit 3R */ 830 834 { 0x00000427, 0x0020 }, /* R1063 - Noise Gate Select 3R */ 831 835 { 0x00000428, 0x0000 }, /* R1064 - Output Path Config 4L */ 832 836 { 0x00000429, 0x0180 }, /* R1065 - DAC Digital Volume 4L */ 833 - { 0x0000042A, 0x0080 }, /* R1066 - Out Volume 4L */ 837 + { 0x0000042A, 0x0081 }, /* R1066 - Out Volume 4L */ 834 838 { 0x0000042B, 0x0040 }, /* R1067 - Noise Gate Select 4L */ 835 839 { 0x0000042C, 0x0000 }, /* R1068 - Output Path Config 4R */ 836 840 { 0x0000042D, 0x0180 }, /* R1069 - DAC Digital Volume 4R */ 837 - { 0x0000042E, 0x0080 }, /* R1070 - Out Volume 4R */ 841 + { 0x0000042E, 0x0081 }, /* R1070 - Out Volume 4R */ 838 842 { 0x0000042F, 0x0080 }, /* R1071 - Noise Gate Select 4R */ 839 843 { 0x00000430, 0x0000 }, /* R1072 - Output Path Config 5L */ 840 844 { 0x00000431, 0x0180 }, /* R1073 - DAC Digital Volume 5L */ 841 - { 0x00000432, 0x0080 }, /* R1074 - DAC Volume Limit 5L */ 845 + { 0x00000432, 0x0081 }, /* R1074 - DAC Volume Limit 5L */ 842 846 { 0x00000433, 0x0100 }, /* R1075 - Noise Gate Select 5L */ 843 847 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */ 844 848 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 845 - { 0x00000436, 0x0080 }, /* R1078 - DAC Volume Limit 5R */ 849 + { 0x00000436, 0x0081 }, /* R1078 - DAC Volume Limit 5R */ 846 850 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 847 851 { 0x00000438, 0x0000 }, /* R1080 - Output Path Config 6L */ 848 852 { 0x00000439, 0x0180 }, /* R1081 - DAC Digital Volume 6L */ 849 - { 0x0000043A, 0x0080 }, /* R1082 - DAC Volume Limit 6L */ 853 + { 0x0000043A, 0x0081 }, /* R1082 - DAC Volume Limit 6L */ 850 854 { 0x0000043B, 0x0400 }, /* R1083 - Noise Gate Select 6L */ 851 855 { 0x0000043C, 0x0000 }, /* R1084 - Output Path Config 6R */ 852 856 { 0x0000043D, 0x0180 }, /* R1085 - DAC Digital Volume 6R */ 853 - { 0x0000043E, 0x0080 }, /* R1086 - DAC Volume Limit 6R */ 857 + { 0x0000043E, 0x0081 }, /* R1086 - DAC Volume Limit 6R */ 854 858 { 0x0000043F, 0x0800 }, /* R1087 - Noise Gate Select 6R */ 855 - { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 859 + { 0x00000440, 0x003F }, /* R1088 - DRE Enable */ 856 860 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ 857 861 { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */ 858 862 { 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */ ··· 860 864 { 0x00000492, 0x0069 }, /* R1170 - PDM SPK2 CTRL 1 */ 861 865 { 0x00000493, 0x0000 }, /* R1171 - PDM SPK2 CTRL 2 */ 862 866 { 0x000004A0, 0x3480 }, /* R1184 - HP1 Short Circuit Ctrl */ 863 - { 0x000004A1, 0x3480 }, /* R1185 - HP2 Short Circuit Ctrl */ 864 - { 0x000004A2, 0x3480 }, /* R1186 - HP3 Short Circuit Ctrl */ 867 + { 0x000004A1, 0x3400 }, /* R1185 - HP2 Short Circuit Ctrl */ 868 + { 0x000004A2, 0x3400 }, /* R1186 - HP3 Short Circuit Ctrl */ 865 869 { 0x00000500, 0x000C }, /* R1280 - AIF1 BCLK Ctrl */ 866 870 { 0x00000501, 0x0008 }, /* R1281 - AIF1 Tx Pin Ctrl */ 867 871 { 0x00000502, 0x0000 }, /* R1282 - AIF1 Rx Pin Ctrl */ ··· 1479 1483 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 1480 1484 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */ 1481 1485 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 1482 - { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 1486 + { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */ 1483 1487 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 1484 1488 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 1485 1489 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 1486 1490 { 0x00000C25, 0x0000 }, /* R3109 - Misc Pad Ctrl 6 */ 1487 - { 0x00000C30, 0x8282 }, /* R3120 - Misc Pad Ctrl 7 */ 1488 - { 0x00000C31, 0x0082 }, /* R3121 - Misc Pad Ctrl 8 */ 1489 - { 0x00000C32, 0x8282 }, /* R3122 - Misc Pad Ctrl 9 */ 1490 - { 0x00000C33, 0x8282 }, /* R3123 - Misc Pad Ctrl 10 */ 1491 - { 0x00000C34, 0x8282 }, /* R3124 - Misc Pad Ctrl 11 */ 1492 - { 0x00000C35, 0x8282 }, /* R3125 - Misc Pad Ctrl 12 */ 1493 - { 0x00000C36, 0x8282 }, /* R3126 - Misc Pad Ctrl 13 */ 1494 - { 0x00000C37, 0x8282 }, /* R3127 - Misc Pad Ctrl 14 */ 1495 - { 0x00000C38, 0x8282 }, /* R3128 - Misc Pad Ctrl 15 */ 1496 - { 0x00000C39, 0x8282 }, /* R3129 - Misc Pad Ctrl 16 */ 1497 - { 0x00000C3A, 0x8282 }, /* R3130 - Misc Pad Ctrl 17 */ 1498 - { 0x00000C3B, 0x8282 }, /* R3131 - Misc Pad Ctrl 18 */ 1491 + { 0x00000C30, 0x0404 }, /* R3120 - Misc Pad Ctrl 7 */ 1492 + { 0x00000C31, 0x0004 }, /* R3121 - Misc Pad Ctrl 8 */ 1493 + { 0x00000C32, 0x0404 }, /* R3122 - Misc Pad Ctrl 9 */ 1494 + { 0x00000C33, 0x0404 }, /* R3123 - Misc Pad Ctrl 10 */ 1495 + { 0x00000C34, 0x0404 }, /* R3124 - Misc Pad Ctrl 11 */ 1496 + { 0x00000C35, 0x0404 }, /* R3125 - Misc Pad Ctrl 12 */ 1497 + { 0x00000C36, 0x0404 }, /* R3126 - Misc Pad Ctrl 13 */ 1498 + { 0x00000C37, 0x0404 }, /* R3127 - Misc Pad Ctrl 14 */ 1499 + { 0x00000C38, 0x0004 }, /* R3128 - Misc Pad Ctrl 15 */ 1500 + { 0x00000C39, 0x0404 }, /* R3129 - Misc Pad Ctrl 16 */ 1501 + { 0x00000C3A, 0x0404 }, /* R3130 - Misc Pad Ctrl 17 */ 1502 + { 0x00000C3B, 0x0404 }, /* R3131 - Misc Pad Ctrl 18 */ 1499 1503 { 0x00000D08, 0xFFFF }, /* R3336 - Interrupt Status 1 Mask */ 1500 1504 { 0x00000D09, 0xFFFF }, /* R3337 - Interrupt Status 2 Mask */ 1501 1505 { 0x00000D0A, 0xFFFF }, /* R3338 - Interrupt Status 3 Mask */ ··· 1637 1641 { 0x00000F0D, 0x0000 }, /* R3853 - ANC Coefficient */ 1638 1642 { 0x00000F0E, 0x0000 }, /* R3854 - ANC Coefficient */ 1639 1643 { 0x00000F0F, 0x0000 }, /* R3855 - ANC Coefficient */ 1640 - { 0x00000F10, 0x0000 }, /* R3856 - ANC Coefficient */ 1644 + { 0x00000F10, 0x0001 }, /* R3856 - ANC Coefficient */ 1641 1645 { 0x00000F11, 0x0000 }, /* R3857 - ANC Coefficient */ 1642 1646 { 0x00000F12, 0x0000 }, /* R3858 - ANC Coefficient */ 1643 1647 { 0x00000F15, 0x0000 }, /* R3861 - FCL Filter Control */ ··· 1943 1947 case ARIZONA_FLL1_CONTROL_5: 1944 1948 case ARIZONA_FLL1_CONTROL_6: 1945 1949 case ARIZONA_FLL1_CONTROL_7: 1946 - case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 1947 - case ARIZONA_FLL1_NCO_TEST_0: 1948 1950 case ARIZONA_FLL1_SYNCHRONISER_1: 1949 1951 case ARIZONA_FLL1_SYNCHRONISER_2: 1950 1952 case ARIZONA_FLL1_SYNCHRONISER_3: ··· 1959 1965 case ARIZONA_FLL2_CONTROL_5: 1960 1966 case ARIZONA_FLL2_CONTROL_6: 1961 1967 case ARIZONA_FLL2_CONTROL_7: 1962 - case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 1963 - case ARIZONA_FLL2_NCO_TEST_0: 1964 1968 case ARIZONA_FLL2_SYNCHRONISER_1: 1965 1969 case ARIZONA_FLL2_SYNCHRONISER_2: 1966 1970 case ARIZONA_FLL2_SYNCHRONISER_3:
+2 -10
drivers/mfd/wm8998-tables.c
··· 229 229 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 230 230 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ 231 231 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 232 - { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */ 233 - { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */ 234 232 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */ 235 233 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 236 234 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ ··· 245 247 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 246 248 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ 247 249 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 248 - { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 249 - { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */ 250 250 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */ 251 251 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 252 252 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ ··· 316 320 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */ 317 321 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 318 322 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 319 - { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 323 + { 0x00000440, 0x002F }, /* R1088 - DRE Enable */ 320 324 { 0x00000441, 0xC759 }, /* R1089 - DRE Control 1 */ 321 325 { 0x00000442, 0x2A08 }, /* R1089 - DRE Control 2 */ 322 326 { 0x00000443, 0x5CFA }, /* R1089 - DRE Control 3 */ ··· 682 686 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 683 687 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */ 684 688 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 685 - { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 689 + { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */ 686 690 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 687 691 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 688 692 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ ··· 884 888 case ARIZONA_FLL1_CONTROL_5: 885 889 case ARIZONA_FLL1_CONTROL_6: 886 890 case ARIZONA_FLL1_CONTROL_7: 887 - case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 888 - case ARIZONA_FLL1_NCO_TEST_0: 889 891 case ARIZONA_FLL1_SYNCHRONISER_1: 890 892 case ARIZONA_FLL1_SYNCHRONISER_2: 891 893 case ARIZONA_FLL1_SYNCHRONISER_3: ··· 900 906 case ARIZONA_FLL2_CONTROL_5: 901 907 case ARIZONA_FLL2_CONTROL_6: 902 908 case ARIZONA_FLL2_CONTROL_7: 903 - case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 904 - case ARIZONA_FLL2_NCO_TEST_0: 905 909 case ARIZONA_FLL2_SYNCHRONISER_1: 906 910 case ARIZONA_FLL2_SYNCHRONISER_2: 907 911 case ARIZONA_FLL2_SYNCHRONISER_3:
+3
drivers/regulator/axp20x-regulator.c
··· 238 238 step = 75; 239 239 break; 240 240 case AXP221_ID: 241 + case AXP223_ID: 241 242 min = 1800; 242 243 max = 4050; 243 244 def = 3000; ··· 317 316 break; 318 317 319 318 case AXP221_ID: 319 + case AXP223_ID: 320 320 if (id < AXP22X_DCDC1 || id > AXP22X_DCDC5) 321 321 return -EINVAL; 322 322 ··· 356 354 nregulators = AXP20X_REG_ID_MAX; 357 355 break; 358 356 case AXP221_ID: 357 + case AXP223_ID: 359 358 regulators = axp22x_regulators; 360 359 nregulators = AXP22X_REG_ID_MAX; 361 360 break;
+18
include/dt-bindings/iio/adc/fsl-imx25-gcq.h
··· 1 + /* 2 + * This header provides constants for configuring the I.MX25 ADC 3 + */ 4 + 5 + #ifndef _DT_BINDINGS_IIO_ADC_FS_IMX25_GCQ_H 6 + #define _DT_BINDINGS_IIO_ADC_FS_IMX25_GCQ_H 7 + 8 + #define MX25_ADC_REFP_YP 0 /* YP voltage reference */ 9 + #define MX25_ADC_REFP_XP 1 /* XP voltage reference */ 10 + #define MX25_ADC_REFP_EXT 2 /* External voltage reference */ 11 + #define MX25_ADC_REFP_INT 3 /* Internal voltage reference */ 12 + 13 + #define MX25_ADC_REFN_XN 0 /* XN ground reference */ 14 + #define MX25_ADC_REFN_YN 1 /* YN ground reference */ 15 + #define MX25_ADC_REFN_NGND 2 /* Internal ground reference */ 16 + #define MX25_ADC_REFN_NGND2 3 /* External ground reference */ 17 + 18 + #endif
+2 -1
include/linux/mfd/as3711.h
··· 51 51 #define AS3711_ASIC_ID_1 0x90 52 52 #define AS3711_ASIC_ID_2 0x91 53 53 54 - #define AS3711_MAX_REGS 0x92 54 + #define AS3711_MAX_REG AS3711_ASIC_ID_2 55 + #define AS3711_NUM_REGS (AS3711_MAX_REG + 1) 55 56 56 57 /* Regulators */ 57 58 enum {
+33 -1
include/linux/mfd/axp20x.h
··· 18 18 AXP202_ID, 19 19 AXP209_ID, 20 20 AXP221_ID, 21 + AXP223_ID, 21 22 AXP288_ID, 22 23 NR_AXP20X_VARIANTS, 23 24 }; ··· 397 396 398 397 struct axp20x_dev { 399 398 struct device *dev; 400 - struct i2c_client *i2c_client; 399 + int irq; 401 400 struct regmap *regmap; 402 401 struct regmap_irq_chip_data *regmap_irqc; 403 402 long variant; ··· 462 461 463 462 return result; 464 463 } 464 + 465 + /** 466 + * axp20x_match_device(): Setup axp20x variant related fields 467 + * 468 + * @axp20x: axp20x device to setup (.dev field must be set) 469 + * @dev: device associated with this axp20x device 470 + * 471 + * This lets the axp20x core configure the mfd cells and register maps 472 + * for later use. 473 + */ 474 + int axp20x_match_device(struct axp20x_dev *axp20x); 475 + 476 + /** 477 + * axp20x_device_probe(): Probe a configured axp20x device 478 + * 479 + * @axp20x: axp20x device to probe (must be configured) 480 + * 481 + * This function lets the axp20x core register the axp20x mfd devices 482 + * and irqchip. The axp20x device passed in must be fully configured 483 + * with axp20x_match_device, its irq set, and regmap created. 484 + */ 485 + int axp20x_device_probe(struct axp20x_dev *axp20x); 486 + 487 + /** 488 + * axp20x_device_probe(): Remove a axp20x device 489 + * 490 + * @axp20x: axp20x device to remove 491 + * 492 + * This tells the axp20x core to remove the associated mfd devices 493 + */ 494 + int axp20x_device_remove(struct axp20x_dev *axp20x); 465 495 466 496 #endif /* __LINUX_MFD_AXP20X_H */
+1 -1
include/linux/mfd/cros_ec.h
··· 245 245 int cros_ec_register(struct cros_ec_device *ec_dev); 246 246 247 247 /** 248 - * cros_ec_register - Query the protocol version supported by the ChromeOS EC 248 + * cros_ec_query_all - Query the protocol version supported by the ChromeOS EC 249 249 * 250 250 * @ec_dev: Device to register 251 251 * @return 0 if ok, -ve on error
+140
include/linux/mfd/imx25-tsadc.h
··· 1 + #ifndef _LINUX_INCLUDE_MFD_IMX25_TSADC_H_ 2 + #define _LINUX_INCLUDE_MFD_IMX25_TSADC_H_ 3 + 4 + struct regmap; 5 + struct clk; 6 + 7 + struct mx25_tsadc { 8 + struct regmap *regs; 9 + struct irq_domain *domain; 10 + struct clk *clk; 11 + }; 12 + 13 + #define MX25_TSC_TGCR 0x00 14 + #define MX25_TSC_TGSR 0x04 15 + #define MX25_TSC_TICR 0x08 16 + 17 + /* The same register layout for TC and GC queue */ 18 + #define MX25_ADCQ_FIFO 0x00 19 + #define MX25_ADCQ_CR 0x04 20 + #define MX25_ADCQ_SR 0x08 21 + #define MX25_ADCQ_MR 0x0c 22 + #define MX25_ADCQ_ITEM_7_0 0x20 23 + #define MX25_ADCQ_ITEM_15_8 0x24 24 + #define MX25_ADCQ_CFG(n) (0x40 + ((n) * 0x4)) 25 + 26 + #define MX25_ADCQ_MR_MASK 0xffffffff 27 + 28 + /* TGCR */ 29 + #define MX25_TGCR_PDBTIME(x) ((x) << 25) 30 + #define MX25_TGCR_PDBTIME_MASK GENMASK(31, 25) 31 + #define MX25_TGCR_PDBEN BIT(24) 32 + #define MX25_TGCR_PDEN BIT(23) 33 + #define MX25_TGCR_ADCCLKCFG(x) ((x) << 16) 34 + #define MX25_TGCR_GET_ADCCLK(x) (((x) >> 16) & 0x1f) 35 + #define MX25_TGCR_INTREFEN BIT(10) 36 + #define MX25_TGCR_POWERMODE_MASK GENMASK(9, 8) 37 + #define MX25_TGCR_POWERMODE_SAVE (1 << 8) 38 + #define MX25_TGCR_POWERMODE_ON (2 << 8) 39 + #define MX25_TGCR_STLC BIT(5) 40 + #define MX25_TGCR_SLPC BIT(4) 41 + #define MX25_TGCR_FUNC_RST BIT(2) 42 + #define MX25_TGCR_TSC_RST BIT(1) 43 + #define MX25_TGCR_CLK_EN BIT(0) 44 + 45 + /* TGSR */ 46 + #define MX25_TGSR_SLP_INT BIT(2) 47 + #define MX25_TGSR_GCQ_INT BIT(1) 48 + #define MX25_TGSR_TCQ_INT BIT(0) 49 + 50 + /* ADCQ_ITEM_* */ 51 + #define _MX25_ADCQ_ITEM(item, x) ((x) << ((item) * 4)) 52 + #define MX25_ADCQ_ITEM(item, x) ((item) >= 8 ? \ 53 + _MX25_ADCQ_ITEM((item) - 8, (x)) : _MX25_ADCQ_ITEM((item), (x))) 54 + 55 + /* ADCQ_FIFO (TCQFIFO and GCQFIFO) */ 56 + #define MX25_ADCQ_FIFO_DATA(x) (((x) >> 4) & 0xfff) 57 + #define MX25_ADCQ_FIFO_ID(x) ((x) & 0xf) 58 + 59 + /* ADCQ_CR (TCQR and GCQR) */ 60 + #define MX25_ADCQ_CR_PDCFG_LEVEL BIT(19) 61 + #define MX25_ADCQ_CR_PDMSK BIT(18) 62 + #define MX25_ADCQ_CR_FRST BIT(17) 63 + #define MX25_ADCQ_CR_QRST BIT(16) 64 + #define MX25_ADCQ_CR_RWAIT_MASK GENMASK(15, 12) 65 + #define MX25_ADCQ_CR_RWAIT(x) ((x) << 12) 66 + #define MX25_ADCQ_CR_WMRK_MASK GENMASK(11, 8) 67 + #define MX25_ADCQ_CR_WMRK(x) ((x) << 8) 68 + #define MX25_ADCQ_CR_LITEMID_MASK (0xf << 4) 69 + #define MX25_ADCQ_CR_LITEMID(x) ((x) << 4) 70 + #define MX25_ADCQ_CR_RPT BIT(3) 71 + #define MX25_ADCQ_CR_FQS BIT(2) 72 + #define MX25_ADCQ_CR_QSM_MASK GENMASK(1, 0) 73 + #define MX25_ADCQ_CR_QSM_PD 0x1 74 + #define MX25_ADCQ_CR_QSM_FQS 0x2 75 + #define MX25_ADCQ_CR_QSM_FQS_PD 0x3 76 + 77 + /* ADCQ_SR (TCQSR and GCQSR) */ 78 + #define MX25_ADCQ_SR_FDRY BIT(15) 79 + #define MX25_ADCQ_SR_FULL BIT(14) 80 + #define MX25_ADCQ_SR_EMPT BIT(13) 81 + #define MX25_ADCQ_SR_FDN(x) (((x) >> 8) & 0x1f) 82 + #define MX25_ADCQ_SR_FRR BIT(6) 83 + #define MX25_ADCQ_SR_FUR BIT(5) 84 + #define MX25_ADCQ_SR_FOR BIT(4) 85 + #define MX25_ADCQ_SR_EOQ BIT(1) 86 + #define MX25_ADCQ_SR_PD BIT(0) 87 + 88 + /* ADCQ_MR (TCQMR and GCQMR) */ 89 + #define MX25_ADCQ_MR_FDRY_DMA BIT(31) 90 + #define MX25_ADCQ_MR_FER_DMA BIT(22) 91 + #define MX25_ADCQ_MR_FUR_DMA BIT(21) 92 + #define MX25_ADCQ_MR_FOR_DMA BIT(20) 93 + #define MX25_ADCQ_MR_EOQ_DMA BIT(17) 94 + #define MX25_ADCQ_MR_PD_DMA BIT(16) 95 + #define MX25_ADCQ_MR_FDRY_IRQ BIT(15) 96 + #define MX25_ADCQ_MR_FER_IRQ BIT(6) 97 + #define MX25_ADCQ_MR_FUR_IRQ BIT(5) 98 + #define MX25_ADCQ_MR_FOR_IRQ BIT(4) 99 + #define MX25_ADCQ_MR_EOQ_IRQ BIT(1) 100 + #define MX25_ADCQ_MR_PD_IRQ BIT(0) 101 + 102 + /* ADCQ_CFG (TICR, TCC0-7,GCC0-7) */ 103 + #define MX25_ADCQ_CFG_SETTLING_TIME(x) ((x) << 24) 104 + #define MX25_ADCQ_CFG_IGS (1 << 20) 105 + #define MX25_ADCQ_CFG_NOS_MASK GENMASK(19, 16) 106 + #define MX25_ADCQ_CFG_NOS(x) (((x) - 1) << 16) 107 + #define MX25_ADCQ_CFG_WIPER (1 << 15) 108 + #define MX25_ADCQ_CFG_YNLR (1 << 14) 109 + #define MX25_ADCQ_CFG_YPLL_HIGH (0 << 12) 110 + #define MX25_ADCQ_CFG_YPLL_OFF (1 << 12) 111 + #define MX25_ADCQ_CFG_YPLL_LOW (3 << 12) 112 + #define MX25_ADCQ_CFG_XNUR_HIGH (0 << 10) 113 + #define MX25_ADCQ_CFG_XNUR_OFF (1 << 10) 114 + #define MX25_ADCQ_CFG_XNUR_LOW (3 << 10) 115 + #define MX25_ADCQ_CFG_XPUL_HIGH (0 << 9) 116 + #define MX25_ADCQ_CFG_XPUL_OFF (1 << 9) 117 + #define MX25_ADCQ_CFG_REFP(sel) ((sel) << 7) 118 + #define MX25_ADCQ_CFG_REFP_YP MX25_ADCQ_CFG_REFP(0) 119 + #define MX25_ADCQ_CFG_REFP_XP MX25_ADCQ_CFG_REFP(1) 120 + #define MX25_ADCQ_CFG_REFP_EXT MX25_ADCQ_CFG_REFP(2) 121 + #define MX25_ADCQ_CFG_REFP_INT MX25_ADCQ_CFG_REFP(3) 122 + #define MX25_ADCQ_CFG_REFP_MASK GENMASK(8, 7) 123 + #define MX25_ADCQ_CFG_IN(sel) ((sel) << 4) 124 + #define MX25_ADCQ_CFG_IN_XP MX25_ADCQ_CFG_IN(0) 125 + #define MX25_ADCQ_CFG_IN_YP MX25_ADCQ_CFG_IN(1) 126 + #define MX25_ADCQ_CFG_IN_XN MX25_ADCQ_CFG_IN(2) 127 + #define MX25_ADCQ_CFG_IN_YN MX25_ADCQ_CFG_IN(3) 128 + #define MX25_ADCQ_CFG_IN_WIPER MX25_ADCQ_CFG_IN(4) 129 + #define MX25_ADCQ_CFG_IN_AUX0 MX25_ADCQ_CFG_IN(5) 130 + #define MX25_ADCQ_CFG_IN_AUX1 MX25_ADCQ_CFG_IN(6) 131 + #define MX25_ADCQ_CFG_IN_AUX2 MX25_ADCQ_CFG_IN(7) 132 + #define MX25_ADCQ_CFG_REFN(sel) ((sel) << 2) 133 + #define MX25_ADCQ_CFG_REFN_XN MX25_ADCQ_CFG_REFN(0) 134 + #define MX25_ADCQ_CFG_REFN_YN MX25_ADCQ_CFG_REFN(1) 135 + #define MX25_ADCQ_CFG_REFN_NGND MX25_ADCQ_CFG_REFN(2) 136 + #define MX25_ADCQ_CFG_REFN_NGND2 MX25_ADCQ_CFG_REFN(3) 137 + #define MX25_ADCQ_CFG_REFN_MASK GENMASK(3, 2) 138 + #define MX25_ADCQ_CFG_PENIACK (1 << 1) 139 + 140 + #endif /* _LINUX_INCLUDE_MFD_IMX25_TSADC_H_ */
+36
include/linux/mfd/mt6323/core.h
··· 1 + /* 2 + * Copyright (c) 2016 Chen Zhong <chen.zhong@mediatek.com> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __MFD_MT6323_CORE_H__ 10 + #define __MFD_MT6323_CORE_H__ 11 + 12 + enum MT6323_IRQ_STATUS_numbers { 13 + MT6323_IRQ_STATUS_SPKL_AB = 0, 14 + MT6323_IRQ_STATUS_SPKL, 15 + MT6323_IRQ_STATUS_BAT_L, 16 + MT6323_IRQ_STATUS_BAT_H, 17 + MT6323_IRQ_STATUS_WATCHDOG, 18 + MT6323_IRQ_STATUS_PWRKEY, 19 + MT6323_IRQ_STATUS_THR_L, 20 + MT6323_IRQ_STATUS_THR_H, 21 + MT6323_IRQ_STATUS_VBATON_UNDET, 22 + MT6323_IRQ_STATUS_BVALID_DET, 23 + MT6323_IRQ_STATUS_CHRDET, 24 + MT6323_IRQ_STATUS_OV, 25 + MT6323_IRQ_STATUS_LDO = 16, 26 + MT6323_IRQ_STATUS_FCHRKEY, 27 + MT6323_IRQ_STATUS_ACCDET, 28 + MT6323_IRQ_STATUS_AUDIO, 29 + MT6323_IRQ_STATUS_RTC, 30 + MT6323_IRQ_STATUS_VPROC, 31 + MT6323_IRQ_STATUS_VSYS, 32 + MT6323_IRQ_STATUS_VPA, 33 + MT6323_IRQ_STATUS_NR, 34 + }; 35 + 36 + #endif /* __MFD_MT6323_CORE_H__ */
+408
include/linux/mfd/mt6323/registers.h
··· 1 + /* 2 + * Copyright (c) 2016 Chen Zhong <chen.zhong@mediatek.com> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __MFD_MT6323_REGISTERS_H__ 10 + #define __MFD_MT6323_REGISTERS_H__ 11 + 12 + /* PMIC Registers */ 13 + #define MT6323_CHR_CON0 0x0000 14 + #define MT6323_CHR_CON1 0x0002 15 + #define MT6323_CHR_CON2 0x0004 16 + #define MT6323_CHR_CON3 0x0006 17 + #define MT6323_CHR_CON4 0x0008 18 + #define MT6323_CHR_CON5 0x000A 19 + #define MT6323_CHR_CON6 0x000C 20 + #define MT6323_CHR_CON7 0x000E 21 + #define MT6323_CHR_CON8 0x0010 22 + #define MT6323_CHR_CON9 0x0012 23 + #define MT6323_CHR_CON10 0x0014 24 + #define MT6323_CHR_CON11 0x0016 25 + #define MT6323_CHR_CON12 0x0018 26 + #define MT6323_CHR_CON13 0x001A 27 + #define MT6323_CHR_CON14 0x001C 28 + #define MT6323_CHR_CON15 0x001E 29 + #define MT6323_CHR_CON16 0x0020 30 + #define MT6323_CHR_CON17 0x0022 31 + #define MT6323_CHR_CON18 0x0024 32 + #define MT6323_CHR_CON19 0x0026 33 + #define MT6323_CHR_CON20 0x0028 34 + #define MT6323_CHR_CON21 0x002A 35 + #define MT6323_CHR_CON22 0x002C 36 + #define MT6323_CHR_CON23 0x002E 37 + #define MT6323_CHR_CON24 0x0030 38 + #define MT6323_CHR_CON25 0x0032 39 + #define MT6323_CHR_CON26 0x0034 40 + #define MT6323_CHR_CON27 0x0036 41 + #define MT6323_CHR_CON28 0x0038 42 + #define MT6323_CHR_CON29 0x003A 43 + #define MT6323_STRUP_CON0 0x003C 44 + #define MT6323_STRUP_CON2 0x003E 45 + #define MT6323_STRUP_CON3 0x0040 46 + #define MT6323_STRUP_CON4 0x0042 47 + #define MT6323_STRUP_CON5 0x0044 48 + #define MT6323_STRUP_CON6 0x0046 49 + #define MT6323_STRUP_CON7 0x0048 50 + #define MT6323_STRUP_CON8 0x004A 51 + #define MT6323_STRUP_CON9 0x004C 52 + #define MT6323_STRUP_CON10 0x004E 53 + #define MT6323_STRUP_CON11 0x0050 54 + #define MT6323_SPK_CON0 0x0052 55 + #define MT6323_SPK_CON1 0x0054 56 + #define MT6323_SPK_CON2 0x0056 57 + #define MT6323_SPK_CON6 0x005E 58 + #define MT6323_SPK_CON7 0x0060 59 + #define MT6323_SPK_CON8 0x0062 60 + #define MT6323_SPK_CON9 0x0064 61 + #define MT6323_SPK_CON10 0x0066 62 + #define MT6323_SPK_CON11 0x0068 63 + #define MT6323_SPK_CON12 0x006A 64 + #define MT6323_CID 0x0100 65 + #define MT6323_TOP_CKPDN0 0x0102 66 + #define MT6323_TOP_CKPDN0_SET 0x0104 67 + #define MT6323_TOP_CKPDN0_CLR 0x0106 68 + #define MT6323_TOP_CKPDN1 0x0108 69 + #define MT6323_TOP_CKPDN1_SET 0x010A 70 + #define MT6323_TOP_CKPDN1_CLR 0x010C 71 + #define MT6323_TOP_CKPDN2 0x010E 72 + #define MT6323_TOP_CKPDN2_SET 0x0110 73 + #define MT6323_TOP_CKPDN2_CLR 0x0112 74 + #define MT6323_TOP_RST_CON 0x0114 75 + #define MT6323_TOP_RST_CON_SET 0x0116 76 + #define MT6323_TOP_RST_CON_CLR 0x0118 77 + #define MT6323_TOP_RST_MISC 0x011A 78 + #define MT6323_TOP_RST_MISC_SET 0x011C 79 + #define MT6323_TOP_RST_MISC_CLR 0x011E 80 + #define MT6323_TOP_CKCON0 0x0120 81 + #define MT6323_TOP_CKCON0_SET 0x0122 82 + #define MT6323_TOP_CKCON0_CLR 0x0124 83 + #define MT6323_TOP_CKCON1 0x0126 84 + #define MT6323_TOP_CKCON1_SET 0x0128 85 + #define MT6323_TOP_CKCON1_CLR 0x012A 86 + #define MT6323_TOP_CKTST0 0x012C 87 + #define MT6323_TOP_CKTST1 0x012E 88 + #define MT6323_TOP_CKTST2 0x0130 89 + #define MT6323_TEST_OUT 0x0132 90 + #define MT6323_TEST_CON0 0x0134 91 + #define MT6323_TEST_CON1 0x0136 92 + #define MT6323_EN_STATUS0 0x0138 93 + #define MT6323_EN_STATUS1 0x013A 94 + #define MT6323_OCSTATUS0 0x013C 95 + #define MT6323_OCSTATUS1 0x013E 96 + #define MT6323_PGSTATUS 0x0140 97 + #define MT6323_CHRSTATUS 0x0142 98 + #define MT6323_TDSEL_CON 0x0144 99 + #define MT6323_RDSEL_CON 0x0146 100 + #define MT6323_SMT_CON0 0x0148 101 + #define MT6323_SMT_CON1 0x014A 102 + #define MT6323_SMT_CON2 0x014C 103 + #define MT6323_SMT_CON3 0x014E 104 + #define MT6323_SMT_CON4 0x0150 105 + #define MT6323_DRV_CON0 0x0152 106 + #define MT6323_DRV_CON1 0x0154 107 + #define MT6323_DRV_CON2 0x0156 108 + #define MT6323_DRV_CON3 0x0158 109 + #define MT6323_DRV_CON4 0x015A 110 + #define MT6323_SIMLS1_CON 0x015C 111 + #define MT6323_SIMLS2_CON 0x015E 112 + #define MT6323_INT_CON0 0x0160 113 + #define MT6323_INT_CON0_SET 0x0162 114 + #define MT6323_INT_CON0_CLR 0x0164 115 + #define MT6323_INT_CON1 0x0166 116 + #define MT6323_INT_CON1_SET 0x0168 117 + #define MT6323_INT_CON1_CLR 0x016A 118 + #define MT6323_INT_MISC_CON 0x016C 119 + #define MT6323_INT_MISC_CON_SET 0x016E 120 + #define MT6323_INT_MISC_CON_CLR 0x0170 121 + #define MT6323_INT_STATUS0 0x0172 122 + #define MT6323_INT_STATUS1 0x0174 123 + #define MT6323_OC_GEAR_0 0x0176 124 + #define MT6323_OC_GEAR_1 0x0178 125 + #define MT6323_OC_GEAR_2 0x017A 126 + #define MT6323_OC_CTL_VPROC 0x017C 127 + #define MT6323_OC_CTL_VSYS 0x017E 128 + #define MT6323_OC_CTL_VPA 0x0180 129 + #define MT6323_FQMTR_CON0 0x0182 130 + #define MT6323_FQMTR_CON1 0x0184 131 + #define MT6323_FQMTR_CON2 0x0186 132 + #define MT6323_RG_SPI_CON 0x0188 133 + #define MT6323_DEW_DIO_EN 0x018A 134 + #define MT6323_DEW_READ_TEST 0x018C 135 + #define MT6323_DEW_WRITE_TEST 0x018E 136 + #define MT6323_DEW_CRC_SWRST 0x0190 137 + #define MT6323_DEW_CRC_EN 0x0192 138 + #define MT6323_DEW_CRC_VAL 0x0194 139 + #define MT6323_DEW_DBG_MON_SEL 0x0196 140 + #define MT6323_DEW_CIPHER_KEY_SEL 0x0198 141 + #define MT6323_DEW_CIPHER_IV_SEL 0x019A 142 + #define MT6323_DEW_CIPHER_EN 0x019C 143 + #define MT6323_DEW_CIPHER_RDY 0x019E 144 + #define MT6323_DEW_CIPHER_MODE 0x01A0 145 + #define MT6323_DEW_CIPHER_SWRST 0x01A2 146 + #define MT6323_DEW_RDDMY_NO 0x01A4 147 + #define MT6323_DEW_RDATA_DLY_SEL 0x01A6 148 + #define MT6323_BUCK_CON0 0x0200 149 + #define MT6323_BUCK_CON1 0x0202 150 + #define MT6323_BUCK_CON2 0x0204 151 + #define MT6323_BUCK_CON3 0x0206 152 + #define MT6323_BUCK_CON4 0x0208 153 + #define MT6323_BUCK_CON5 0x020A 154 + #define MT6323_VPROC_CON0 0x020C 155 + #define MT6323_VPROC_CON1 0x020E 156 + #define MT6323_VPROC_CON2 0x0210 157 + #define MT6323_VPROC_CON3 0x0212 158 + #define MT6323_VPROC_CON4 0x0214 159 + #define MT6323_VPROC_CON5 0x0216 160 + #define MT6323_VPROC_CON7 0x021A 161 + #define MT6323_VPROC_CON8 0x021C 162 + #define MT6323_VPROC_CON9 0x021E 163 + #define MT6323_VPROC_CON10 0x0220 164 + #define MT6323_VPROC_CON11 0x0222 165 + #define MT6323_VPROC_CON12 0x0224 166 + #define MT6323_VPROC_CON13 0x0226 167 + #define MT6323_VPROC_CON14 0x0228 168 + #define MT6323_VPROC_CON15 0x022A 169 + #define MT6323_VPROC_CON18 0x0230 170 + #define MT6323_VSYS_CON0 0x0232 171 + #define MT6323_VSYS_CON1 0x0234 172 + #define MT6323_VSYS_CON2 0x0236 173 + #define MT6323_VSYS_CON3 0x0238 174 + #define MT6323_VSYS_CON4 0x023A 175 + #define MT6323_VSYS_CON5 0x023C 176 + #define MT6323_VSYS_CON7 0x0240 177 + #define MT6323_VSYS_CON8 0x0242 178 + #define MT6323_VSYS_CON9 0x0244 179 + #define MT6323_VSYS_CON10 0x0246 180 + #define MT6323_VSYS_CON11 0x0248 181 + #define MT6323_VSYS_CON12 0x024A 182 + #define MT6323_VSYS_CON13 0x024C 183 + #define MT6323_VSYS_CON14 0x024E 184 + #define MT6323_VSYS_CON15 0x0250 185 + #define MT6323_VSYS_CON18 0x0256 186 + #define MT6323_VPA_CON0 0x0300 187 + #define MT6323_VPA_CON1 0x0302 188 + #define MT6323_VPA_CON2 0x0304 189 + #define MT6323_VPA_CON3 0x0306 190 + #define MT6323_VPA_CON4 0x0308 191 + #define MT6323_VPA_CON5 0x030A 192 + #define MT6323_VPA_CON7 0x030E 193 + #define MT6323_VPA_CON8 0x0310 194 + #define MT6323_VPA_CON9 0x0312 195 + #define MT6323_VPA_CON10 0x0314 196 + #define MT6323_VPA_CON11 0x0316 197 + #define MT6323_VPA_CON12 0x0318 198 + #define MT6323_VPA_CON14 0x031C 199 + #define MT6323_VPA_CON16 0x0320 200 + #define MT6323_VPA_CON17 0x0322 201 + #define MT6323_VPA_CON18 0x0324 202 + #define MT6323_VPA_CON19 0x0326 203 + #define MT6323_VPA_CON20 0x0328 204 + #define MT6323_BUCK_K_CON0 0x032A 205 + #define MT6323_BUCK_K_CON1 0x032C 206 + #define MT6323_BUCK_K_CON2 0x032E 207 + #define MT6323_ISINK0_CON0 0x0330 208 + #define MT6323_ISINK0_CON1 0x0332 209 + #define MT6323_ISINK0_CON2 0x0334 210 + #define MT6323_ISINK0_CON3 0x0336 211 + #define MT6323_ISINK1_CON0 0x0338 212 + #define MT6323_ISINK1_CON1 0x033A 213 + #define MT6323_ISINK1_CON2 0x033C 214 + #define MT6323_ISINK1_CON3 0x033E 215 + #define MT6323_ISINK2_CON0 0x0340 216 + #define MT6323_ISINK2_CON1 0x0342 217 + #define MT6323_ISINK2_CON2 0x0344 218 + #define MT6323_ISINK2_CON3 0x0346 219 + #define MT6323_ISINK3_CON0 0x0348 220 + #define MT6323_ISINK3_CON1 0x034A 221 + #define MT6323_ISINK3_CON2 0x034C 222 + #define MT6323_ISINK3_CON3 0x034E 223 + #define MT6323_ISINK_ANA0 0x0350 224 + #define MT6323_ISINK_ANA1 0x0352 225 + #define MT6323_ISINK_PHASE_DLY 0x0354 226 + #define MT6323_ISINK_EN_CTRL 0x0356 227 + #define MT6323_ANALDO_CON0 0x0400 228 + #define MT6323_ANALDO_CON1 0x0402 229 + #define MT6323_ANALDO_CON2 0x0404 230 + #define MT6323_ANALDO_CON3 0x0406 231 + #define MT6323_ANALDO_CON4 0x0408 232 + #define MT6323_ANALDO_CON5 0x040A 233 + #define MT6323_ANALDO_CON6 0x040C 234 + #define MT6323_ANALDO_CON7 0x040E 235 + #define MT6323_ANALDO_CON8 0x0410 236 + #define MT6323_ANALDO_CON10 0x0412 237 + #define MT6323_ANALDO_CON15 0x0414 238 + #define MT6323_ANALDO_CON16 0x0416 239 + #define MT6323_ANALDO_CON17 0x0418 240 + #define MT6323_ANALDO_CON18 0x041A 241 + #define MT6323_ANALDO_CON19 0x041C 242 + #define MT6323_ANALDO_CON20 0x041E 243 + #define MT6323_ANALDO_CON21 0x0420 244 + #define MT6323_DIGLDO_CON0 0x0500 245 + #define MT6323_DIGLDO_CON2 0x0502 246 + #define MT6323_DIGLDO_CON3 0x0504 247 + #define MT6323_DIGLDO_CON5 0x0506 248 + #define MT6323_DIGLDO_CON6 0x0508 249 + #define MT6323_DIGLDO_CON7 0x050A 250 + #define MT6323_DIGLDO_CON8 0x050C 251 + #define MT6323_DIGLDO_CON9 0x050E 252 + #define MT6323_DIGLDO_CON10 0x0510 253 + #define MT6323_DIGLDO_CON11 0x0512 254 + #define MT6323_DIGLDO_CON12 0x0514 255 + #define MT6323_DIGLDO_CON13 0x0516 256 + #define MT6323_DIGLDO_CON14 0x0518 257 + #define MT6323_DIGLDO_CON15 0x051A 258 + #define MT6323_DIGLDO_CON16 0x051C 259 + #define MT6323_DIGLDO_CON17 0x051E 260 + #define MT6323_DIGLDO_CON18 0x0520 261 + #define MT6323_DIGLDO_CON19 0x0522 262 + #define MT6323_DIGLDO_CON20 0x0524 263 + #define MT6323_DIGLDO_CON21 0x0526 264 + #define MT6323_DIGLDO_CON23 0x0528 265 + #define MT6323_DIGLDO_CON24 0x052A 266 + #define MT6323_DIGLDO_CON26 0x052C 267 + #define MT6323_DIGLDO_CON27 0x052E 268 + #define MT6323_DIGLDO_CON28 0x0530 269 + #define MT6323_DIGLDO_CON29 0x0532 270 + #define MT6323_DIGLDO_CON30 0x0534 271 + #define MT6323_DIGLDO_CON31 0x0536 272 + #define MT6323_DIGLDO_CON32 0x0538 273 + #define MT6323_DIGLDO_CON33 0x053A 274 + #define MT6323_DIGLDO_CON34 0x053C 275 + #define MT6323_DIGLDO_CON35 0x053E 276 + #define MT6323_DIGLDO_CON36 0x0540 277 + #define MT6323_DIGLDO_CON39 0x0542 278 + #define MT6323_DIGLDO_CON40 0x0544 279 + #define MT6323_DIGLDO_CON41 0x0546 280 + #define MT6323_DIGLDO_CON42 0x0548 281 + #define MT6323_DIGLDO_CON43 0x054A 282 + #define MT6323_DIGLDO_CON44 0x054C 283 + #define MT6323_DIGLDO_CON45 0x054E 284 + #define MT6323_DIGLDO_CON46 0x0550 285 + #define MT6323_DIGLDO_CON47 0x0552 286 + #define MT6323_DIGLDO_CON48 0x0554 287 + #define MT6323_DIGLDO_CON49 0x0556 288 + #define MT6323_DIGLDO_CON50 0x0558 289 + #define MT6323_DIGLDO_CON51 0x055A 290 + #define MT6323_DIGLDO_CON52 0x055C 291 + #define MT6323_DIGLDO_CON53 0x055E 292 + #define MT6323_DIGLDO_CON54 0x0560 293 + #define MT6323_EFUSE_CON0 0x0600 294 + #define MT6323_EFUSE_CON1 0x0602 295 + #define MT6323_EFUSE_CON2 0x0604 296 + #define MT6323_EFUSE_CON3 0x0606 297 + #define MT6323_EFUSE_CON4 0x0608 298 + #define MT6323_EFUSE_CON5 0x060A 299 + #define MT6323_EFUSE_CON6 0x060C 300 + #define MT6323_EFUSE_VAL_0_15 0x060E 301 + #define MT6323_EFUSE_VAL_16_31 0x0610 302 + #define MT6323_EFUSE_VAL_32_47 0x0612 303 + #define MT6323_EFUSE_VAL_48_63 0x0614 304 + #define MT6323_EFUSE_VAL_64_79 0x0616 305 + #define MT6323_EFUSE_VAL_80_95 0x0618 306 + #define MT6323_EFUSE_VAL_96_111 0x061A 307 + #define MT6323_EFUSE_VAL_112_127 0x061C 308 + #define MT6323_EFUSE_VAL_128_143 0x061E 309 + #define MT6323_EFUSE_VAL_144_159 0x0620 310 + #define MT6323_EFUSE_VAL_160_175 0x0622 311 + #define MT6323_EFUSE_VAL_176_191 0x0624 312 + #define MT6323_EFUSE_DOUT_0_15 0x0626 313 + #define MT6323_EFUSE_DOUT_16_31 0x0628 314 + #define MT6323_EFUSE_DOUT_32_47 0x062A 315 + #define MT6323_EFUSE_DOUT_48_63 0x062C 316 + #define MT6323_EFUSE_DOUT_64_79 0x062E 317 + #define MT6323_EFUSE_DOUT_80_95 0x0630 318 + #define MT6323_EFUSE_DOUT_96_111 0x0632 319 + #define MT6323_EFUSE_DOUT_112_127 0x0634 320 + #define MT6323_EFUSE_DOUT_128_143 0x0636 321 + #define MT6323_EFUSE_DOUT_144_159 0x0638 322 + #define MT6323_EFUSE_DOUT_160_175 0x063A 323 + #define MT6323_EFUSE_DOUT_176_191 0x063C 324 + #define MT6323_EFUSE_CON7 0x063E 325 + #define MT6323_EFUSE_CON8 0x0640 326 + #define MT6323_EFUSE_CON9 0x0642 327 + #define MT6323_RTC_MIX_CON0 0x0644 328 + #define MT6323_RTC_MIX_CON1 0x0646 329 + #define MT6323_AUDTOP_CON0 0x0700 330 + #define MT6323_AUDTOP_CON1 0x0702 331 + #define MT6323_AUDTOP_CON2 0x0704 332 + #define MT6323_AUDTOP_CON3 0x0706 333 + #define MT6323_AUDTOP_CON4 0x0708 334 + #define MT6323_AUDTOP_CON5 0x070A 335 + #define MT6323_AUDTOP_CON6 0x070C 336 + #define MT6323_AUDTOP_CON7 0x070E 337 + #define MT6323_AUDTOP_CON8 0x0710 338 + #define MT6323_AUDTOP_CON9 0x0712 339 + #define MT6323_AUXADC_ADC0 0x0714 340 + #define MT6323_AUXADC_ADC1 0x0716 341 + #define MT6323_AUXADC_ADC2 0x0718 342 + #define MT6323_AUXADC_ADC3 0x071A 343 + #define MT6323_AUXADC_ADC4 0x071C 344 + #define MT6323_AUXADC_ADC5 0x071E 345 + #define MT6323_AUXADC_ADC6 0x0720 346 + #define MT6323_AUXADC_ADC7 0x0722 347 + #define MT6323_AUXADC_ADC8 0x0724 348 + #define MT6323_AUXADC_ADC9 0x0726 349 + #define MT6323_AUXADC_ADC10 0x0728 350 + #define MT6323_AUXADC_ADC11 0x072A 351 + #define MT6323_AUXADC_ADC12 0x072C 352 + #define MT6323_AUXADC_ADC13 0x072E 353 + #define MT6323_AUXADC_ADC14 0x0730 354 + #define MT6323_AUXADC_ADC15 0x0732 355 + #define MT6323_AUXADC_ADC16 0x0734 356 + #define MT6323_AUXADC_ADC17 0x0736 357 + #define MT6323_AUXADC_ADC18 0x0738 358 + #define MT6323_AUXADC_ADC19 0x073A 359 + #define MT6323_AUXADC_ADC20 0x073C 360 + #define MT6323_AUXADC_RSV1 0x073E 361 + #define MT6323_AUXADC_RSV2 0x0740 362 + #define MT6323_AUXADC_CON0 0x0742 363 + #define MT6323_AUXADC_CON1 0x0744 364 + #define MT6323_AUXADC_CON2 0x0746 365 + #define MT6323_AUXADC_CON3 0x0748 366 + #define MT6323_AUXADC_CON4 0x074A 367 + #define MT6323_AUXADC_CON5 0x074C 368 + #define MT6323_AUXADC_CON6 0x074E 369 + #define MT6323_AUXADC_CON7 0x0750 370 + #define MT6323_AUXADC_CON8 0x0752 371 + #define MT6323_AUXADC_CON9 0x0754 372 + #define MT6323_AUXADC_CON10 0x0756 373 + #define MT6323_AUXADC_CON11 0x0758 374 + #define MT6323_AUXADC_CON12 0x075A 375 + #define MT6323_AUXADC_CON13 0x075C 376 + #define MT6323_AUXADC_CON14 0x075E 377 + #define MT6323_AUXADC_CON15 0x0760 378 + #define MT6323_AUXADC_CON16 0x0762 379 + #define MT6323_AUXADC_CON17 0x0764 380 + #define MT6323_AUXADC_CON18 0x0766 381 + #define MT6323_AUXADC_CON19 0x0768 382 + #define MT6323_AUXADC_CON20 0x076A 383 + #define MT6323_AUXADC_CON21 0x076C 384 + #define MT6323_AUXADC_CON22 0x076E 385 + #define MT6323_AUXADC_CON23 0x0770 386 + #define MT6323_AUXADC_CON24 0x0772 387 + #define MT6323_AUXADC_CON25 0x0774 388 + #define MT6323_AUXADC_CON26 0x0776 389 + #define MT6323_AUXADC_CON27 0x0778 390 + #define MT6323_ACCDET_CON0 0x077A 391 + #define MT6323_ACCDET_CON1 0x077C 392 + #define MT6323_ACCDET_CON2 0x077E 393 + #define MT6323_ACCDET_CON3 0x0780 394 + #define MT6323_ACCDET_CON4 0x0782 395 + #define MT6323_ACCDET_CON5 0x0784 396 + #define MT6323_ACCDET_CON6 0x0786 397 + #define MT6323_ACCDET_CON7 0x0788 398 + #define MT6323_ACCDET_CON8 0x078A 399 + #define MT6323_ACCDET_CON9 0x078C 400 + #define MT6323_ACCDET_CON10 0x078E 401 + #define MT6323_ACCDET_CON11 0x0790 402 + #define MT6323_ACCDET_CON12 0x0792 403 + #define MT6323_ACCDET_CON13 0x0794 404 + #define MT6323_ACCDET_CON14 0x0796 405 + #define MT6323_ACCDET_CON15 0x0798 406 + #define MT6323_ACCDET_CON16 0x079A 407 + 408 + #endif /* __MFD_MT6323_REGISTERS_H__ */
+2
include/linux/mfd/mt6397/core.h
··· 60 60 u16 wake_mask[2]; 61 61 u16 irq_masks_cur[2]; 62 62 u16 irq_masks_cache[2]; 63 + u16 int_con[2]; 64 + u16 int_status[2]; 63 65 }; 64 66 65 67 #endif /* __MFD_MT6397_CORE_H__ */
+3 -2
include/linux/mfd/rc5t583.h
··· 28 28 #include <linux/types.h> 29 29 #include <linux/regmap.h> 30 30 31 - #define RC5T583_MAX_REGS 0xF8 32 - 33 31 /* Maximum number of main interrupts */ 34 32 #define MAX_MAIN_INTERRUPT 5 35 33 #define RC5T583_MAX_GPEDGE_REG 2 ··· 166 168 #define RC5T583_RTC_AY_DAY 0xF2 167 169 #define RC5T583_RTC_AY_MONTH 0xF3 168 170 #define RC5T583_RTC_AY_YEAR 0xF4 171 + 172 + #define RC5T583_MAX_REG 0xF7 173 + #define RC5T583_NUM_REGS (RC5T583_MAX_REG + 1) 169 174 170 175 /* RICOH_RC5T583 IRQ definitions */ 171 176 enum {
+4 -4
include/linux/mfd/syscon.h
··· 29 29 #else 30 30 static inline struct regmap *syscon_node_to_regmap(struct device_node *np) 31 31 { 32 - return ERR_PTR(-ENOSYS); 32 + return ERR_PTR(-ENOTSUPP); 33 33 } 34 34 35 35 static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s) 36 36 { 37 - return ERR_PTR(-ENOSYS); 37 + return ERR_PTR(-ENOTSUPP); 38 38 } 39 39 40 40 static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s) 41 41 { 42 - return ERR_PTR(-ENOSYS); 42 + return ERR_PTR(-ENOTSUPP); 43 43 } 44 44 45 45 static inline struct regmap *syscon_regmap_lookup_by_phandle( 46 46 struct device_node *np, 47 47 const char *property) 48 48 { 49 - return ERR_PTR(-ENOSYS); 49 + return ERR_PTR(-ENOTSUPP); 50 50 } 51 51 #endif 52 52
+5
include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
··· 422 422 #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_MASK (0x1 << 26) 423 423 #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_ENABLE (0x1 << 26) 424 424 #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_DISABLE (0x0 << 26) 425 + #define IMX6SX_GPR5_PCIE_BTNRST_RESET BIT(19) 425 426 #define IMX6SX_GPR5_CSI1_MUX_CTRL_MASK (0x3 << 4) 426 427 #define IMX6SX_GPR5_CSI1_MUX_CTRL_EXT_PIN (0x0 << 4) 427 428 #define IMX6SX_GPR5_CSI1_MUX_CTRL_CVD (0x1 << 4) ··· 435 434 #define IMX6SX_GPR5_DISP_MUX_DCIC1_LCDIF1 (0x0 << 1) 436 435 #define IMX6SX_GPR5_DISP_MUX_DCIC1_LVDS (0x1 << 1) 437 436 #define IMX6SX_GPR5_DISP_MUX_DCIC1_MASK (0x1 << 1) 437 + 438 + #define IMX6SX_GPR12_PCIE_TEST_POWERDOWN BIT(30) 439 + #define IMX6SX_GPR12_PCIE_RX_EQ_MASK (0x7 << 0) 440 + #define IMX6SX_GPR12_PCIE_RX_EQ_2 (0x2 << 0) 438 441 439 442 /* For imx6ul iomux gpr register field define */ 440 443 #define IMX6UL_GPR1_ENET1_CLK_DIR (0x1 << 17)
+117
include/linux/mfd/tps65086.h
··· 1 + /* 2 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 3 + * Andrew F. Davis <afd@ti.com> 4 + * 5 + * This program is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + * 9 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 10 + * kind, whether expressed or implied; without even the implied warranty 11 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License version 2 for more details. 13 + * 14 + * Based on the TPS65912 driver 15 + */ 16 + 17 + #ifndef __LINUX_MFD_TPS65086_H 18 + #define __LINUX_MFD_TPS65086_H 19 + 20 + #include <linux/device.h> 21 + #include <linux/regmap.h> 22 + 23 + /* List of registers for TPS65086 */ 24 + #define TPS65086_DEVICEID 0x01 25 + #define TPS65086_IRQ 0x02 26 + #define TPS65086_IRQ_MASK 0x03 27 + #define TPS65086_PMICSTAT 0x04 28 + #define TPS65086_SHUTDNSRC 0x05 29 + #define TPS65086_BUCK1CTRL 0x20 30 + #define TPS65086_BUCK2CTRL 0x21 31 + #define TPS65086_BUCK3DECAY 0x22 32 + #define TPS65086_BUCK3VID 0x23 33 + #define TPS65086_BUCK3SLPCTRL 0x24 34 + #define TPS65086_BUCK4CTRL 0x25 35 + #define TPS65086_BUCK5CTRL 0x26 36 + #define TPS65086_BUCK6CTRL 0x27 37 + #define TPS65086_LDOA2CTRL 0x28 38 + #define TPS65086_LDOA3CTRL 0x29 39 + #define TPS65086_DISCHCTRL1 0x40 40 + #define TPS65086_DISCHCTRL2 0x41 41 + #define TPS65086_DISCHCTRL3 0x42 42 + #define TPS65086_PG_DELAY1 0x43 43 + #define TPS65086_FORCESHUTDN 0x91 44 + #define TPS65086_BUCK1SLPCTRL 0x92 45 + #define TPS65086_BUCK2SLPCTRL 0x93 46 + #define TPS65086_BUCK4VID 0x94 47 + #define TPS65086_BUCK4SLPVID 0x95 48 + #define TPS65086_BUCK5VID 0x96 49 + #define TPS65086_BUCK5SLPVID 0x97 50 + #define TPS65086_BUCK6VID 0x98 51 + #define TPS65086_BUCK6SLPVID 0x99 52 + #define TPS65086_LDOA2VID 0x9A 53 + #define TPS65086_LDOA3VID 0x9B 54 + #define TPS65086_BUCK123CTRL 0x9C 55 + #define TPS65086_PG_DELAY2 0x9D 56 + #define TPS65086_PIN_EN_MASK1 0x9E 57 + #define TPS65086_PIN_EN_MASK2 0x9F 58 + #define TPS65086_SWVTT_EN 0x9F 59 + #define TPS65086_PIN_EN_OVR1 0xA0 60 + #define TPS65086_PIN_EN_OVR2 0xA1 61 + #define TPS65086_GPOCTRL 0xA1 62 + #define TPS65086_PWR_FAULT_MASK1 0xA2 63 + #define TPS65086_PWR_FAULT_MASK2 0xA3 64 + #define TPS65086_GPO1PG_CTRL1 0xA4 65 + #define TPS65086_GPO1PG_CTRL2 0xA5 66 + #define TPS65086_GPO4PG_CTRL1 0xA6 67 + #define TPS65086_GPO4PG_CTRL2 0xA7 68 + #define TPS65086_GPO2PG_CTRL1 0xA8 69 + #define TPS65086_GPO2PG_CTRL2 0xA9 70 + #define TPS65086_GPO3PG_CTRL1 0xAA 71 + #define TPS65086_GPO3PG_CTRL2 0xAB 72 + #define TPS65086_LDOA1CTRL 0xAE 73 + #define TPS65086_PG_STATUS1 0xB0 74 + #define TPS65086_PG_STATUS2 0xB1 75 + #define TPS65086_PWR_FAULT_STATUS1 0xB2 76 + #define TPS65086_PWR_FAULT_STATUS2 0xB3 77 + #define TPS65086_TEMPCRIT 0xB4 78 + #define TPS65086_TEMPHOT 0xB5 79 + #define TPS65086_OC_STATUS 0xB6 80 + 81 + /* IRQ Register field definitions */ 82 + #define TPS65086_IRQ_DIETEMP_MASK BIT(0) 83 + #define TPS65086_IRQ_SHUTDN_MASK BIT(3) 84 + #define TPS65086_IRQ_FAULT_MASK BIT(7) 85 + 86 + /* DEVICEID Register field definitions */ 87 + #define TPS65086_DEVICEID_PART_MASK GENMASK(3, 0) 88 + #define TPS65086_DEVICEID_OTP_MASK GENMASK(5, 4) 89 + #define TPS65086_DEVICEID_REV_MASK GENMASK(7, 6) 90 + 91 + /* VID Masks */ 92 + #define BUCK_VID_MASK GENMASK(7, 1) 93 + #define VDOA1_VID_MASK GENMASK(4, 1) 94 + #define VDOA23_VID_MASK GENMASK(3, 0) 95 + 96 + /* Define the TPS65086 IRQ numbers */ 97 + enum tps65086_irqs { 98 + TPS65086_IRQ_DIETEMP, 99 + TPS65086_IRQ_SHUTDN, 100 + TPS65086_IRQ_FAULT, 101 + }; 102 + 103 + /** 104 + * struct tps65086 - state holder for the tps65086 driver 105 + * 106 + * Device data may be used to access the TPS65086 chip 107 + */ 108 + struct tps65086 { 109 + struct device *dev; 110 + struct regmap *regmap; 111 + 112 + /* IRQ Data */ 113 + int irq; 114 + struct regmap_irq_chip_data *irq_data; 115 + }; 116 + 117 + #endif /* __LINUX_MFD_TPS65086_H */
+5
include/linux/mfd/tps65090.h
··· 77 77 #define TPS65090_REG_CG_CTRL5 0x09 78 78 #define TPS65090_REG_CG_STATUS1 0x0a 79 79 #define TPS65090_REG_CG_STATUS2 0x0b 80 + #define TPS65090_REG_AD_OUT1 0x17 81 + #define TPS65090_REG_AD_OUT2 0x18 82 + 83 + #define TPS65090_MAX_REG TPS65090_REG_AD_OUT2 84 + #define TPS65090_NUM_REGS (TPS65090_MAX_REG + 1) 80 85 81 86 struct tps65090 { 82 87 struct device *dev;