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

Merge tag 'mfd-next-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
"Removed Drivers:
- Remove support for TI TPS80031/TPS80032 PMICs

New Device Support:
- Add support for Magnetic Reader to TI AM335x
- Add support for DA9063_EA to Dialog DA9063
- Add support for SC2730 PMIC to Spreadtrum SC27xx
- Add support for MacBookPro16,2 ICL-N UART Intel LPSS PCI
- Add support for lots of new PMICS in QCom SPMI PMIC
- Add support for ADC to Diolan DLN2

New Functionality:
- Add support for Power Off to Rockchip RK817

Fix-ups:
- Simplify Regmap passing to child devices in hi6421-spmi-pmic
- SPDX licensing updates in ti_am335x_tscadc
- Improve error handling in ti_am335x_tscadc
- Expedite clock search in ti_am335x_tscadc
- Generic simplifications in ti_am335x_tscadc
- Use generic macros/defines in ti_am335x_tscadc
- Remove unused code in ti_am335x_tscadc, cros_ec_dev
- Convert to GPIOD in wcd934x
- Add namespacing in ti_am335x_tscadc
- Restrict compilation to relevant arches in intel_pmt
- Provide better description/documentation in exynos_lpass
- Add SPI device ID table in altera-a10sr, motorola-cpcap,
sprd-sc27xx-spi
- Change IRQ handling in qcom-pm8xxx
- Split out I2C and SPI code in arizona
- Explicitly include used headers in altera-a10sr
- Convert sysfs show() function to in sysfs_emit
- Standardise *_exit() and *_remove() return values in mc13xxx,
stmpe, tps65912
- Trivial (style/spelling/whitespace) fixups in ti_am335x_tscadc,
qcom-spmi-pmic, max77686-private
- Device Tree fix-ups in ti,am3359-tscadc, samsung,s2mps11,
samsung,s2mpa01, samsung,s5m8767, brcm,misc, brcm,cru, syscon,
qcom,tcsr, xylon,logicvc, max77686, x-powers,ac100,
x-powers,axp152, x-powers,axp209-gpio, syscon, qcom,spmi-pmic

Bug Fixes:
- Balance refcounting (get/put) in ti_am335x_tscadc, mfd-core
- Fix IRQ trigger type in sec-irq, max77693, max14577
- Repair off-by-one in altera-sysmgr
- Add explicit 'select MFD_CORE' to MFD_SIMPLE_MFD_I2C"

* tag 'mfd-next-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (95 commits)
mfd: simple-mfd-i2c: Select MFD_CORE to fix build error
mfd: tps80031: Remove driver
mfd: max77686: Correct tab-based alignment of register addresses
mfd: wcd934x: Replace legacy gpio interface for gpiod
dt-bindings: mfd: qcom: pm8xxx: Add pm8018 compatible
mfd: dln2: Add cell for initializing DLN2 ADC
mfd: qcom-spmi-pmic: Add missing PMICs supported by socinfo
mfd: qcom-spmi-pmic: Document ten more PMICs in the binding
mfd: qcom-spmi-pmic: Sort compatibles in the driver
mfd: qcom-spmi-pmic: Sort the compatibles in the binding
mfd: janz-cmoio: Replace snprintf in show functions with sysfs_emit
mfd: altera-a10sr: Include linux/module.h
mfd: tps65912: Make tps65912_device_exit() return void
mfd: stmpe: Make stmpe_remove() return void
mfd: mc13xxx: Make mc13xxx_common_exit() return void
dt-bindings: mfd: syscon: Add samsung,exynosautov9-sysreg compatible
mfd: altera-sysmgr: Fix a mistake caused by resource_size conversion
dt-bindings: gpio: Convert X-Powers AXP209 GPIO binding to a schema
dt-bindings: mfd: syscon: Add rk3368 QoS register compatible
mfd: arizona: Split of_match table into I2C and SPI versions
...

+2149 -2229
+2 -2
Documentation/devicetree/bindings/clock/maxim,max77686.txt
··· 49 49 max77686: max77686@9 { 50 50 compatible = "maxim,max77686"; 51 51 interrupt-parent = <&wakeup_eint>; 52 - interrupts = <26 0>; 52 + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 53 53 reg = <0x09>; 54 54 #clock-cells = <1>; 55 55 ··· 74 74 max77802: max77802@9 { 75 75 compatible = "maxim,max77802"; 76 76 interrupt-parent = <&wakeup_eint>; 77 - interrupts = <26 0>; 77 + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 78 78 reg = <0x09>; 79 79 #clock-cells = <1>; 80 80
-75
Documentation/devicetree/bindings/gpio/gpio-axp209.txt
··· 1 - AXP209 GPIO & pinctrl controller 2 - 3 - This driver follows the usual GPIO bindings found in 4 - Documentation/devicetree/bindings/gpio/gpio.txt 5 - 6 - This driver follows the usual pinctrl bindings found in 7 - Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt 8 - 9 - This driver employs the per-pin muxing pattern. 10 - 11 - Required properties: 12 - - compatible: Should be one of: 13 - - "x-powers,axp209-gpio" 14 - - "x-powers,axp813-gpio" 15 - - #gpio-cells: Should be two. The first cell is the pin number and the 16 - second is the GPIO flags. 17 - - gpio-controller: Marks the device node as a GPIO controller. 18 - 19 - This node must be a subnode of the axp20x PMIC, documented in 20 - Documentation/devicetree/bindings/mfd/axp20x.txt 21 - 22 - Example: 23 - 24 - axp209: pmic@34 { 25 - compatible = "x-powers,axp209"; 26 - reg = <0x34>; 27 - interrupt-parent = <&nmi_intc>; 28 - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 29 - interrupt-controller; 30 - #interrupt-cells = <1>; 31 - 32 - axp_gpio: gpio { 33 - compatible = "x-powers,axp209-gpio"; 34 - gpio-controller; 35 - #gpio-cells = <2>; 36 - }; 37 - }; 38 - 39 - The GPIOs can be muxed to other functions and therefore, must be a subnode of 40 - axp_gpio. 41 - 42 - Example: 43 - 44 - &axp_gpio { 45 - gpio0_adc: gpio0-adc { 46 - pins = "GPIO0"; 47 - function = "adc"; 48 - }; 49 - }; 50 - 51 - &example_node { 52 - pinctrl-names = "default"; 53 - pinctrl-0 = <&gpio0_adc>; 54 - }; 55 - 56 - GPIOs and their functions 57 - ------------------------- 58 - 59 - Each GPIO is independent from the other (i.e. GPIO0 in gpio_in function does 60 - not force GPIO1 and GPIO2 to be in gpio_in function as well). 61 - 62 - axp209 63 - ------ 64 - GPIO | Functions 65 - ------------------------ 66 - GPIO0 | gpio_in, gpio_out, ldo, adc 67 - GPIO1 | gpio_in, gpio_out, ldo, adc 68 - GPIO2 | gpio_in, gpio_out 69 - 70 - axp813 71 - ------ 72 - GPIO | Functions 73 - ------------------------ 74 - GPIO0 | gpio_in, gpio_out, ldo, adc 75 - GPIO1 | gpio_in, gpio_out, ldo
+55
Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/gpio/x-powers,axp209-gpio.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: X-Powers AXP209 GPIO Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + 12 + properties: 13 + "#gpio-cells": 14 + const: 2 15 + description: > 16 + The first cell is the pin number and the second is the GPIO flags. 17 + 18 + compatible: 19 + oneOf: 20 + - enum: 21 + - x-powers,axp209-gpio 22 + - x-powers,axp813-gpio 23 + - items: 24 + - const: x-powers,axp803-gpio 25 + - const: x-powers,axp813-gpio 26 + 27 + gpio-controller: true 28 + 29 + patternProperties: 30 + "^.*-pins?$": 31 + $ref: /schemas/pinctrl/pinmux-node.yaml# 32 + 33 + properties: 34 + pins: 35 + items: 36 + enum: 37 + - GPIO0 38 + - GPIO1 39 + - GPIO2 40 + 41 + function: 42 + enum: 43 + - adc 44 + - ldo 45 + - gpio_in 46 + - gpio_out 47 + 48 + required: 49 + - compatible 50 + - "#gpio-cells" 51 + - gpio-controller 52 + 53 + additionalProperties: false 54 + 55 + ...
+1 -1
Documentation/devicetree/bindings/i2c/allwinner,sun6i-a31-p2wi.yaml
··· 55 55 #size-cells = <0>; 56 56 57 57 axp221: pmic@68 { 58 - compatible = "x-powers,axp221"; 58 + /* compatible = "x-powers,axp221"; */ 59 59 reg = <0x68>; 60 60 }; 61 61 };
+70
Documentation/devicetree/bindings/iio/adc/ti,am3359-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/ti,am3359-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI AM3359 ADC 8 + 9 + maintainers: 10 + - Miquel Raynal <miquel.raynal@bootlin.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - ti,am3359-adc 16 + - ti,am4372-adc 17 + 18 + '#io-channel-cells': 19 + const: 1 20 + 21 + ti,adc-channels: 22 + description: List of analog inputs available for ADC. AIN0 = 0, AIN1 = 1 and 23 + so on until AIN7 = 7. 24 + $ref: /schemas/types.yaml#/definitions/uint32-array 25 + minItems: 1 26 + maxItems: 8 27 + 28 + ti,chan-step-opendelay: 29 + description: List of open delays for each channel of ADC in the order of 30 + ti,adc-channels. The value corresponds to the number of ADC clock cycles 31 + to wait after applying the step configuration registers and before sending 32 + the start of ADC conversion. Maximum value is 0x3FFFF. 33 + $ref: /schemas/types.yaml#/definitions/uint32-array 34 + minItems: 1 35 + maxItems: 8 36 + 37 + ti,chan-step-sampledelay: 38 + description: List of sample delays for each channel of ADC in the order of 39 + ti,adc-channels. The value corresponds to the number of ADC clock cycles 40 + to sample (to hold start of conversion high). Maximum value is 0xFF. 41 + $ref: /schemas/types.yaml#/definitions/uint32-array 42 + minItems: 1 43 + maxItems: 8 44 + 45 + ti,chan-step-avg: 46 + description: Number of averages to be performed for each channel of ADC. If 47 + average is 16 (this is also the maximum) then input is sampled 16 times 48 + and averaged to get more accurate value. This increases the time taken by 49 + ADC to generate a sample. Maximum value is 16. 50 + $ref: /schemas/types.yaml#/definitions/uint32-array 51 + minItems: 1 52 + maxItems: 8 53 + 54 + required: 55 + - compatible 56 + - '#io-channel-cells' 57 + - ti,adc-channels 58 + 59 + additionalProperties: false 60 + 61 + examples: 62 + - | 63 + adc { 64 + compatible = "ti,am3359-adc"; 65 + #io-channel-cells = <1>; 66 + ti,adc-channels = <4 5 6 7>; 67 + ti,chan-step-opendelay = <0x098 0x3ffff 0x098 0x0>; 68 + ti,chan-step-sampledelay = <0xff 0x0 0xf 0x0>; 69 + ti,chan-step-avg = <16 2 4 8>; 70 + };
+76
Documentation/devicetree/bindings/input/touchscreen/ti,am3359-tsc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/touchscreen/ti,am3359-tsc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI AM3359 Touchscreen controller 8 + 9 + maintainers: 10 + - Miquel Raynal <miquel.raynal@bootlin.com> 11 + 12 + properties: 13 + compatible: 14 + const: ti,am3359-tsc 15 + 16 + ti,wires: 17 + description: Wires refer to application modes i.e. 4/5/8 wire touchscreen 18 + support on the platform. 19 + $ref: /schemas/types.yaml#/definitions/uint32 20 + enum: [4, 5, 8] 21 + 22 + ti,x-plate-resistance: 23 + description: X plate resistance 24 + $ref: /schemas/types.yaml#/definitions/uint32 25 + 26 + ti,coordinate-readouts: 27 + description: The sequencer supports a total of 16 programmable steps. Each 28 + step is used to read a single coordinate. A single readout is enough but 29 + multiple reads can increase the quality. A value of 5 means, 5 reads for 30 + X, 5 for Y and 2 for Z (always). This utilises 12 of the 16 software steps 31 + available. The remaining 4 can be used by the ADC. 32 + $ref: /schemas/types.yaml#/definitions/uint32 33 + minimum: 1 34 + maximum: 6 35 + 36 + ti,wire-config: 37 + description: Different boards could have a different order for connecting 38 + wires on touchscreen. We need to provide an 8-bit number where the 39 + first four bits represent the analog lines and the next 4 bits represent 40 + positive/negative terminal on that input line. Notations to represent the 41 + input lines and terminals respectively are as follows, AIN0 = 0, AIN1 = 1 42 + and so on until AIN7 = 7. XP = 0, XN = 1, YP = 2, YN = 3. 43 + $ref: /schemas/types.yaml#/definitions/uint32-array 44 + minItems: 4 45 + maxItems: 8 46 + 47 + ti,charge-delay: 48 + description: Length of touch screen charge delay step in terms of ADC clock 49 + cycles. Charge delay value should be large in order to avoid false pen-up 50 + events. This value effects the overall sampling speed, hence need to be 51 + kept as low as possible, while avoiding false pen-up event. Start from a 52 + lower value, say 0x400, and increase value until false pen-up events are 53 + avoided. The pen-up detection happens immediately after the charge step, 54 + so this does in fact function as a hardware knob for adjusting the amount 55 + of "settling time". 56 + $ref: /schemas/types.yaml#/definitions/uint32 57 + 58 + required: 59 + - compatible 60 + - ti,wires 61 + - ti,x-plate-resistance 62 + - ti,coordinate-readouts 63 + - ti,wire-config 64 + 65 + additionalProperties: false 66 + 67 + examples: 68 + - | 69 + tsc { 70 + compatible = "ti,am3359-tsc"; 71 + ti,wires = <4>; 72 + ti,x-plate-resistance = <200>; 73 + ti,coordinate-readouts = <5>; 74 + ti,wire-config = <0x00 0x11 0x22 0x33>; 75 + ti,charge-delay = <0x400>; 76 + };
-91
Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
··· 1 - * TI - TSC ADC (Touschscreen and analog digital converter) 2 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 - 4 - Required properties: 5 - - mfd 6 - compatible: Should be 7 - "ti,am3359-tscadc" for AM335x/AM437x SoCs 8 - "ti,am654-tscadc", "ti,am3359-tscadc" for AM654 SoCs 9 - - child "tsc" 10 - compatible: Should be "ti,am3359-tsc". 11 - ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen 12 - support on the platform. 13 - ti,x-plate-resistance: X plate resistance 14 - ti,coordinate-readouts: The sequencer supports a total of 16 15 - programmable steps each step is used to 16 - read a single coordinate. A single 17 - readout is enough but multiple reads can 18 - increase the quality. 19 - A value of 5 means, 5 reads for X, 5 for 20 - Y and 2 for Z (always). This utilises 12 21 - of the 16 software steps available. The 22 - remaining 4 can be used by the ADC. 23 - ti,wire-config: Different boards could have a different order for 24 - connecting wires on touchscreen. We need to provide an 25 - 8 bit number where in the 1st four bits represent the 26 - analog lines and the next 4 bits represent positive/ 27 - negative terminal on that input line. Notations to 28 - represent the input lines and terminals resoectively 29 - is as follows: 30 - AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7. 31 - XP = 0, XN = 1, YP = 2, YN = 3. 32 - - child "adc" 33 - compatible: Should be 34 - "ti,am3359-adc" for AM335x/AM437x SoCs 35 - "ti,am654-adc", "ti,am3359-adc" for AM654 SoCs 36 - ti,adc-channels: List of analog inputs available for ADC. 37 - AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7. 38 - 39 - Optional properties: 40 - - child "tsc" 41 - ti,charge-delay: Length of touch screen charge delay step in terms of 42 - ADC clock cycles. Charge delay value should be large 43 - in order to avoid false pen-up events. This value 44 - effects the overall sampling speed, hence need to be 45 - kept as low as possible, while avoiding false pen-up 46 - event. Start from a lower value, say 0x400, and 47 - increase value until false pen-up events are avoided. 48 - The pen-up detection happens immediately after the 49 - charge step, so this does in fact function as a 50 - hardware knob for adjusting the amount of "settling 51 - time". 52 - 53 - - child "adc" 54 - ti,chan-step-opendelay: List of open delays for each channel of 55 - ADC in the order of ti,adc-channels. The 56 - value corresponds to the number of ADC 57 - clock cycles to wait after applying the 58 - step configuration registers and before 59 - sending the start of ADC conversion. 60 - Maximum value is 0x3FFFF. 61 - ti,chan-step-sampledelay: List of sample delays for each channel 62 - of ADC in the order of ti,adc-channels. 63 - The value corresponds to the number of 64 - ADC clock cycles to sample (to hold 65 - start of conversion high). 66 - Maximum value is 0xFF. 67 - ti,chan-step-avg: Number of averages to be performed for each 68 - channel of ADC. If average is 16 then input 69 - is sampled 16 times and averaged to get more 70 - accurate value. This increases the time taken 71 - by ADC to generate a sample. Valid range is 0 72 - average to 16 averages. Maximum value is 16. 73 - 74 - Example: 75 - tscadc: tscadc@44e0d000 { 76 - compatible = "ti,am3359-tscadc"; 77 - tsc { 78 - ti,wires = <4>; 79 - ti,x-plate-resistance = <200>; 80 - ti,coordiante-readouts = <5>; 81 - ti,wire-config = <0x00 0x11 0x22 0x33>; 82 - ti,charge-delay = <0x400>; 83 - }; 84 - 85 - adc { 86 - ti,adc-channels = <4 5 6 7>; 87 - ti,chan-step-opendelay = <0x098 0x3ffff 0x098 0x0>; 88 - ti,chan-step-sampledelay = <0xff 0x0 0xf 0x0>; 89 - ti,chan-step-avg = <16 2 4 8>; 90 - }; 91 - }
-50
Documentation/devicetree/bindings/mfd/ac100.txt
··· 1 - X-Powers AC100 Codec/RTC IC Device Tree bindings 2 - 3 - AC100 is a audio codec and RTC subsystem combo IC. The 2 parts are 4 - separated, including power supplies and interrupt lines, but share 5 - a common register address space and host interface. 6 - 7 - Required properties: 8 - - compatible: "x-powers,ac100" 9 - - reg: The I2C slave address or RSB hardware address for the chip 10 - - sub-nodes: 11 - - codec 12 - - compatible: "x-powers,ac100-codec" 13 - - interrupts: SoC NMI / GPIO interrupt connected to the 14 - IRQ_AUDIO pin 15 - - #clock-cells: Shall be 0 16 - - clock-output-names: "4M_adda" 17 - 18 - - see clock/clock-bindings.txt for common clock bindings 19 - 20 - - rtc 21 - - compatible: "x-powers,ac100-rtc" 22 - - clocks: A phandle to the codec's "4M_adda" clock 23 - - #clock-cells: Shall be 1 24 - - clock-output-names: "cko1_rtc", "cko2_rtc", "cko3_rtc" 25 - 26 - - see clock/clock-bindings.txt for common clock bindings 27 - 28 - Example: 29 - 30 - ac100: codec@e89 { 31 - compatible = "x-powers,ac100"; 32 - reg = <0xe89>; 33 - 34 - ac100_codec: codec { 35 - compatible = "x-powers,ac100-codec"; 36 - interrupt-parent = <&r_pio>; 37 - interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */ 38 - #clock-cells = <0>; 39 - clock-output-names = "4M_adda"; 40 - }; 41 - 42 - ac100_rtc: rtc { 43 - compatible = "x-powers,ac100-rtc"; 44 - interrupt-parent = <&nmi_intc>; 45 - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 46 - clocks = <&ac100_codec>; 47 - #clock-cells = <1>; 48 - clock-output-names = "cko1_rtc", "cko2_rtc", "cko3_rtc"; 49 - }; 50 - };
-273
Documentation/devicetree/bindings/mfd/axp20x.txt
··· 1 - AXP family PMIC device tree bindings 2 - 3 - The axp20x family current members : 4 - axp152 (X-Powers) 5 - axp202 (X-Powers) 6 - axp209 (X-Powers) 7 - axp221 (X-Powers) 8 - axp223 (X-Powers) 9 - axp803 (X-Powers) 10 - axp806 (X-Powers) 11 - axp809 (X-Powers) 12 - axp813 (X-Powers) 13 - 14 - The AXP813 is 2 chips packaged into 1. The 2 chips do not share anything 15 - other than the packaging. Pins are routed separately. As such they should 16 - be treated as separate entities. The other half is an AC100 RTC/codec 17 - combo chip. Please see ./ac100.txt for its bindings. 18 - 19 - Required properties: 20 - - compatible: should be one of: 21 - * "x-powers,axp152" 22 - * "x-powers,axp202" 23 - * "x-powers,axp209" 24 - * "x-powers,axp221" 25 - * "x-powers,axp223" 26 - * "x-powers,axp803" 27 - * "x-powers,axp806" 28 - * "x-powers,axp805", "x-powers,axp806" 29 - * "x-powers,axp305", "x-powers,axp805", "x-powers,axp806" 30 - * "x-powers,axp809" 31 - * "x-powers,axp813" 32 - - reg: The I2C slave address or RSB hardware address for the AXP chip 33 - - interrupt-controller: The PMIC has its own internal IRQs 34 - - #interrupt-cells: Should be set to 1 35 - 36 - Supported common regulator properties, see ../regulator/regulator.txt for 37 - more information: 38 - - regulator-ramp-delay: sets the ramp up delay in uV/us 39 - AXP20x/DCDC2: 1600, 800 40 - AXP20x/LDO3: 1600, 800 41 - - regulator-soft-start: enable the output at the lowest possible voltage and 42 - only then set the desired voltage 43 - AXP20x/LDO3: software-based implementation 44 - 45 - Optional properties: 46 - - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin 47 - - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz 48 - AXP152/20X: range: 750-1875, Default: 1.5 MHz 49 - AXP22X/8XX: range: 1800-4050, Default: 3 MHz 50 - 51 - - x-powers,drive-vbus-en: boolean, set this when the N_VBUSEN pin is 52 - used as an output pin to control an external 53 - regulator to drive the OTG VBus, rather then 54 - as an input pin which signals whether the 55 - board is driving OTG VBus or not. 56 - (axp221 / axp223 / axp803/ axp813 only) 57 - 58 - - x-powers,self-working-mode and 59 - x-powers,master-mode: Boolean (axp806 only). Set either of these when the 60 - PMIC is wired for self-working mode or master mode. 61 - If neither is set then slave mode is assumed. 62 - This corresponds to how the MODESET pin is wired. 63 - 64 - - <input>-supply: a phandle to the regulator supply node. May be omitted if 65 - inputs are unregulated, such as using the IPSOUT output 66 - from the PMIC. 67 - 68 - - regulators: A node that houses a sub-node for each regulator. Regulators 69 - not used but preferred to be managed by the OS should be 70 - listed as well. 71 - See Documentation/devicetree/bindings/regulator/regulator.txt 72 - for more information on standard regulator bindings. 73 - 74 - Optional properties for DCDC regulators: 75 - - x-powers,dcdc-workmode: 1 for PWM mode, 0 for AUTO (PWM/PFM) mode 76 - Default: Current hardware setting 77 - The DCDC regulators work in a mixed PWM/PFM mode, 78 - using PFM under light loads and switching to PWM 79 - for heavier loads. Forcing PWM mode trades efficiency 80 - under light loads for lower output noise. This 81 - probably makes sense for HiFi audio related 82 - applications that aren't battery constrained. 83 - 84 - AXP202/AXP209 regulators, type, and corresponding input supply names: 85 - 86 - Regulator Type Supply Name Notes 87 - --------- ---- ----------- ----- 88 - DCDC2 : DC-DC buck : vin2-supply 89 - DCDC3 : DC-DC buck : vin3-supply 90 - LDO1 : LDO : acin-supply : always on 91 - LDO2 : LDO : ldo24in-supply : shared supply 92 - LDO3 : LDO : ldo3in-supply 93 - LDO4 : LDO : ldo24in-supply : shared supply 94 - LDO5 : LDO : ldo5in-supply 95 - 96 - AXP221/AXP223 regulators, type, and corresponding input supply names: 97 - 98 - Regulator Type Supply Name Notes 99 - --------- ---- ----------- ----- 100 - DCDC1 : DC-DC buck : vin1-supply 101 - DCDC2 : DC-DC buck : vin2-supply 102 - DCDC3 : DC-DC buck : vin3-supply 103 - DCDC4 : DC-DC buck : vin4-supply 104 - DCDC5 : DC-DC buck : vin5-supply 105 - DC1SW : On/Off Switch : : DCDC1 secondary output 106 - DC5LDO : LDO : : input from DCDC5 107 - ALDO1 : LDO : aldoin-supply : shared supply 108 - ALDO2 : LDO : aldoin-supply : shared supply 109 - ALDO3 : LDO : aldoin-supply : shared supply 110 - DLDO1 : LDO : dldoin-supply : shared supply 111 - DLDO2 : LDO : dldoin-supply : shared supply 112 - DLDO3 : LDO : dldoin-supply : shared supply 113 - DLDO4 : LDO : dldoin-supply : shared supply 114 - ELDO1 : LDO : eldoin-supply : shared supply 115 - ELDO2 : LDO : eldoin-supply : shared supply 116 - ELDO3 : LDO : eldoin-supply : shared supply 117 - LDO_IO0 : LDO : ips-supply : GPIO 0 118 - LDO_IO1 : LDO : ips-supply : GPIO 1 119 - RTC_LDO : LDO : ips-supply : always on 120 - DRIVEVBUS : Enable output : drivevbus-supply : external regulator 121 - 122 - AXP803 regulators, type, and corresponding input supply names: 123 - 124 - Regulator Type Supply Name Notes 125 - --------- ---- ----------- ----- 126 - DCDC1 : DC-DC buck : vin1-supply 127 - DCDC2 : DC-DC buck : vin2-supply : poly-phase capable 128 - DCDC3 : DC-DC buck : vin3-supply : poly-phase capable 129 - DCDC4 : DC-DC buck : vin4-supply 130 - DCDC5 : DC-DC buck : vin5-supply : poly-phase capable 131 - DCDC6 : DC-DC buck : vin6-supply : poly-phase capable 132 - DC1SW : On/Off Switch : : DCDC1 secondary output 133 - ALDO1 : LDO : aldoin-supply : shared supply 134 - ALDO2 : LDO : aldoin-supply : shared supply 135 - ALDO3 : LDO : aldoin-supply : shared supply 136 - DLDO1 : LDO : dldoin-supply : shared supply 137 - DLDO2 : LDO : dldoin-supply : shared supply 138 - DLDO3 : LDO : dldoin-supply : shared supply 139 - DLDO4 : LDO : dldoin-supply : shared supply 140 - ELDO1 : LDO : eldoin-supply : shared supply 141 - ELDO2 : LDO : eldoin-supply : shared supply 142 - ELDO3 : LDO : eldoin-supply : shared supply 143 - FLDO1 : LDO : fldoin-supply : shared supply 144 - FLDO2 : LDO : fldoin-supply : shared supply 145 - LDO_IO0 : LDO : ips-supply : GPIO 0 146 - LDO_IO1 : LDO : ips-supply : GPIO 1 147 - RTC_LDO : LDO : ips-supply : always on 148 - DRIVEVBUS : Enable output : drivevbus-supply : external regulator 149 - 150 - AXP806 regulators, type, and corresponding input supply names: 151 - 152 - Regulator Type Supply Name Notes 153 - --------- ---- ----------- ----- 154 - DCDCA : DC-DC buck : vina-supply : poly-phase capable 155 - DCDCB : DC-DC buck : vinb-supply : poly-phase capable 156 - DCDCC : DC-DC buck : vinc-supply : poly-phase capable 157 - DCDCD : DC-DC buck : vind-supply : poly-phase capable 158 - DCDCE : DC-DC buck : vine-supply : poly-phase capable 159 - ALDO1 : LDO : aldoin-supply : shared supply 160 - ALDO2 : LDO : aldoin-supply : shared supply 161 - ALDO3 : LDO : aldoin-supply : shared supply 162 - BLDO1 : LDO : bldoin-supply : shared supply 163 - BLDO2 : LDO : bldoin-supply : shared supply 164 - BLDO3 : LDO : bldoin-supply : shared supply 165 - BLDO4 : LDO : bldoin-supply : shared supply 166 - CLDO1 : LDO : cldoin-supply : shared supply 167 - CLDO2 : LDO : cldoin-supply : shared supply 168 - CLDO3 : LDO : cldoin-supply : shared supply 169 - SW : On/Off Switch : swin-supply 170 - 171 - Additionally, the AXP806 DC-DC regulators support poly-phase arrangements 172 - for higher output current. The possible groupings are: A+B, A+B+C, D+E. 173 - 174 - AXP809 regulators, type, and corresponding input supply names: 175 - 176 - Regulator Type Supply Name Notes 177 - --------- ---- ----------- ----- 178 - DCDC1 : DC-DC buck : vin1-supply 179 - DCDC2 : DC-DC buck : vin2-supply 180 - DCDC3 : DC-DC buck : vin3-supply 181 - DCDC4 : DC-DC buck : vin4-supply 182 - DCDC5 : DC-DC buck : vin5-supply 183 - DC1SW : On/Off Switch : : DCDC1 secondary output 184 - DC5LDO : LDO : : input from DCDC5 185 - ALDO1 : LDO : aldoin-supply : shared supply 186 - ALDO2 : LDO : aldoin-supply : shared supply 187 - ALDO3 : LDO : aldoin-supply : shared supply 188 - DLDO1 : LDO : dldoin-supply : shared supply 189 - DLDO2 : LDO : dldoin-supply : shared supply 190 - ELDO1 : LDO : eldoin-supply : shared supply 191 - ELDO2 : LDO : eldoin-supply : shared supply 192 - ELDO3 : LDO : eldoin-supply : shared supply 193 - LDO_IO0 : LDO : ips-supply : GPIO 0 194 - LDO_IO1 : LDO : ips-supply : GPIO 1 195 - RTC_LDO : LDO : ips-supply : always on 196 - SW : On/Off Switch : swin-supply 197 - 198 - AXP813 regulators, type, and corresponding input supply names: 199 - 200 - Regulator Type Supply Name Notes 201 - --------- ---- ----------- ----- 202 - DCDC1 : DC-DC buck : vin1-supply 203 - DCDC2 : DC-DC buck : vin2-supply : poly-phase capable 204 - DCDC3 : DC-DC buck : vin3-supply : poly-phase capable 205 - DCDC4 : DC-DC buck : vin4-supply 206 - DCDC5 : DC-DC buck : vin5-supply : poly-phase capable 207 - DCDC6 : DC-DC buck : vin6-supply : poly-phase capable 208 - DCDC7 : DC-DC buck : vin7-supply 209 - ALDO1 : LDO : aldoin-supply : shared supply 210 - ALDO2 : LDO : aldoin-supply : shared supply 211 - ALDO3 : LDO : aldoin-supply : shared supply 212 - DLDO1 : LDO : dldoin-supply : shared supply 213 - DLDO2 : LDO : dldoin-supply : shared supply 214 - DLDO3 : LDO : dldoin-supply : shared supply 215 - DLDO4 : LDO : dldoin-supply : shared supply 216 - ELDO1 : LDO : eldoin-supply : shared supply 217 - ELDO2 : LDO : eldoin-supply : shared supply 218 - ELDO3 : LDO : eldoin-supply : shared supply 219 - FLDO1 : LDO : fldoin-supply : shared supply 220 - FLDO2 : LDO : fldoin-supply : shared supply 221 - FLDO3 : LDO : fldoin-supply : shared supply 222 - LDO_IO0 : LDO : ips-supply : GPIO 0 223 - LDO_IO1 : LDO : ips-supply : GPIO 1 224 - RTC_LDO : LDO : ips-supply : always on 225 - SW : On/Off Switch : swin-supply 226 - DRIVEVBUS : Enable output : drivevbus-supply : external regulator 227 - 228 - Example: 229 - 230 - axp209: pmic@34 { 231 - compatible = "x-powers,axp209"; 232 - reg = <0x34>; 233 - interrupt-parent = <&nmi_intc>; 234 - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 235 - interrupt-controller; 236 - #interrupt-cells = <1>; 237 - 238 - regulators { 239 - x-powers,dcdc-freq = <1500>; 240 - 241 - vdd_cpu: dcdc2 { 242 - regulator-always-on; 243 - regulator-min-microvolt = <1000000>; 244 - regulator-max-microvolt = <1450000>; 245 - regulator-name = "vdd-cpu"; 246 - }; 247 - 248 - vdd_int_dll: dcdc3 { 249 - regulator-always-on; 250 - regulator-min-microvolt = <1000000>; 251 - regulator-max-microvolt = <1400000>; 252 - regulator-name = "vdd-int-dll"; 253 - }; 254 - 255 - vdd_rtc: ldo1 { 256 - regulator-always-on; 257 - regulator-min-microvolt = <1200000>; 258 - regulator-max-microvolt = <1400000>; 259 - regulator-name = "vdd-rtc"; 260 - }; 261 - 262 - avcc: ldo2 { 263 - regulator-always-on; 264 - regulator-min-microvolt = <2700000>; 265 - regulator-max-microvolt = <3300000>; 266 - regulator-name = "avcc"; 267 - }; 268 - 269 - ldo3 { 270 - /* unused but preferred to be managed by OS */ 271 - }; 272 - }; 273 - };
+21
Documentation/devicetree/bindings/mfd/brcm,cru.yaml
··· 36 36 '^clock-controller@[a-f0-9]+$': 37 37 $ref: ../clock/brcm,iproc-clocks.yaml 38 38 39 + '^phy@[a-f0-9]+$': 40 + $ref: ../phy/bcm-ns-usb2-phy.yaml 41 + 39 42 '^pin-controller@[a-f0-9]+$': 40 43 $ref: ../pinctrl/brcm,ns-pinmux.yaml 44 + 45 + '^syscon@[a-f0-9]+$': 46 + $ref: syscon.yaml 41 47 42 48 '^thermal@[a-f0-9]+$': 43 49 $ref: ../thermal/brcm,ns-thermal.yaml ··· 55 49 56 50 examples: 57 51 - | 52 + #include <dt-bindings/clock/bcm-nsp.h> 58 53 cru-bus@1800c100 { 59 54 compatible = "brcm,ns-cru", "simple-mfd"; 60 55 reg = <0x1800c100 0x1d0>; ··· 78 71 clocks = <&osc>; 79 72 clock-output-names = "genpll", "phy", "ethernetclk", "usbclk", 80 73 "iprocfast", "sata1", "sata2"; 74 + }; 75 + 76 + phy@164 { 77 + compatible = "brcm,ns-usb2-phy"; 78 + reg = <0x164 0x4>; 79 + brcm,syscon-clkset = <&clkset>; 80 + clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>; 81 + clock-names = "phy-ref-clk"; 82 + #phy-cells = <0>; 83 + }; 84 + 85 + clkset: syscon@180 { 86 + compatible = "brcm,cru-clkset", "syscon"; 87 + reg = <0x180 0x4>; 81 88 }; 82 89 83 90 pin-controller@1c0 {
+60
Documentation/devicetree/bindings/mfd/brcm,misc.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,misc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom's MISC block 8 + 9 + maintainers: 10 + - Rafał Miłecki <rafal@milecki.pl> 11 + 12 + description: | 13 + Broadcom's MISC is a hardware block used on some SoCs (e.g. bcm63xx and 14 + bcm4908). It's used to implement some simple functions like a watchdog, PCIe 15 + reset, UniMAC control and more. 16 + 17 + properties: 18 + compatible: 19 + items: 20 + - const: brcm,misc 21 + - const: simple-mfd 22 + 23 + reg: 24 + description: MISC block registers 25 + 26 + ranges: true 27 + 28 + "#address-cells": 29 + const: 1 30 + 31 + "#size-cells": 32 + const: 1 33 + 34 + patternProperties: 35 + '^reset-controller@[a-f0-9]+$': 36 + $ref: ../reset/brcm,bcm4908-misc-pcie-reset.yaml 37 + 38 + additionalProperties: false 39 + 40 + required: 41 + - reg 42 + - '#address-cells' 43 + - '#size-cells' 44 + 45 + examples: 46 + - | 47 + misc@ff802600 { 48 + compatible = "brcm,misc", "simple-mfd"; 49 + reg = <0xff802600 0xe4>; 50 + 51 + #address-cells = <1>; 52 + #size-cells = <1>; 53 + ranges = <0x0 0x0 0xe4>; 54 + 55 + reset-controller@44 { 56 + compatible = "brcm,bcm4908-misc-pcie-reset"; 57 + reg = <0x44 0x4>; 58 + #reset-cells = <1>; 59 + }; 60 + };
+2 -2
Documentation/devicetree/bindings/mfd/max14577.txt
··· 71 71 compatible = "maxim,max14577"; 72 72 reg = <0x25>; 73 73 interrupt-parent = <&gpx1>; 74 - interrupts = <5 IRQ_TYPE_NONE>; 74 + interrupts = <5 IRQ_TYPE_LEVEL_LOW>; 75 75 76 76 muic: max14577-muic { 77 77 compatible = "maxim,max14577-muic"; ··· 106 106 compatible = "maxim,max77836"; 107 107 reg = <0x25>; 108 108 interrupt-parent = <&gpx1>; 109 - interrupts = <5 IRQ_TYPE_NONE>; 109 + interrupts = <5 IRQ_TYPE_LEVEL_LOW>; 110 110 111 111 muic: max77836-muic { 112 112 compatible = "maxim,max77836-muic";
+1 -1
Documentation/devicetree/bindings/mfd/max77686.txt
··· 21 21 max77686: pmic@9 { 22 22 compatible = "maxim,max77686"; 23 23 interrupt-parent = <&wakeup_eint>; 24 - interrupts = <26 0>; 24 + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 25 25 reg = <0x09>; 26 26 };
+1 -1
Documentation/devicetree/bindings/mfd/max77693.txt
··· 139 139 compatible = "maxim,max77693"; 140 140 reg = <0x66>; 141 141 interrupt-parent = <&gpx1>; 142 - interrupts = <5 2>; 142 + interrupts = <5 IRQ_TYPE_LEVEL_LOW>; 143 143 144 144 regulators { 145 145 esafeout@1 {
+30 -21
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
··· 15 15 16 16 Required properties: 17 17 - compatible: Should contain one of: 18 - "qcom,pm8941", 19 - "qcom,pm8841", 20 - "qcom,pma8084", 21 - "qcom,pm8019", 22 - "qcom,pm8226", 23 - "qcom,pm8110", 24 - "qcom,pma8084", 25 - "qcom,pmi8962", 26 - "qcom,pmd9635", 27 - "qcom,pm8994", 28 - "qcom,pmi8994", 29 - "qcom,pm8916", 30 - "qcom,pm8004", 31 - "qcom,pm8909", 32 - "qcom,pm8950", 33 - "qcom,pmi8950", 34 - "qcom,pm8998", 35 - "qcom,pmi8998", 36 - "qcom,pm8005", 37 - "qcom,pm8350c", 38 - "qcom,pmk8350", 18 + "qcom,pm660", 19 + "qcom,pm660l", 39 20 "qcom,pm7325", 21 + "qcom,pm8004", 22 + "qcom,pm8005", 23 + "qcom,pm8019", 24 + "qcom,pm8028", 25 + "qcom,pm8110", 26 + "qcom,pm8150", 27 + "qcom,pm8150b", 28 + "qcom,pm8150c", 29 + "qcom,pm8150l", 30 + "qcom,pm8226", 31 + "qcom,pm8350c", 32 + "qcom,pm8841", 33 + "qcom,pm8901", 34 + "qcom,pm8909", 35 + "qcom,pm8916", 36 + "qcom,pm8941", 37 + "qcom,pm8950", 38 + "qcom,pm8994", 39 + "qcom,pm8998", 40 + "qcom,pma8084", 41 + "qcom,pmd9635", 42 + "qcom,pmi8950", 43 + "qcom,pmi8962", 44 + "qcom,pmi8994", 45 + "qcom,pmi8998", 46 + "qcom,pmk8002", 47 + "qcom,pmk8350", 40 48 "qcom,pmr735a", 49 + "qcom,smb2351", 41 50 or generalized "qcom,spmi-pmic". 42 51 - reg: Specifies the SPMI USID slave address for this device. 43 52 For more information see:
+1
Documentation/devicetree/bindings/mfd/qcom,tcsr.txt
··· 6 6 7 7 Required properties: 8 8 - compatible: Should contain: 9 + "qcom,tcsr-ipq6018", "syscon", "simple-mfd" for IPQ6018 9 10 "qcom,tcsr-ipq8064", "syscon" for IPQ8064 10 11 "qcom,tcsr-apq8064", "syscon" for APQ8064 11 12 "qcom,tcsr-msm8660", "syscon" for MSM8660
+1
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
··· 16 16 properties: 17 17 compatible: 18 18 enum: 19 + - qcom,pm8018 19 20 - qcom,pm8058 20 21 - qcom,pm8821 21 22 - qcom,pm8921
+91
Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/samsung,s2mpa01.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung S2MPA01 Power Management IC 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> 11 + 12 + description: | 13 + This is a part of device tree bindings for S2M and S5M family of Power 14 + Management IC (PMIC). 15 + 16 + The Samsung S2MPA01 is a Power Management IC which includes voltage 17 + and current regulators, RTC, clock outputs and other sub-blocks. 18 + 19 + properties: 20 + compatible: 21 + const: samsung,s2mpa01-pmic 22 + 23 + interrupts: 24 + maxItems: 1 25 + 26 + reg: 27 + maxItems: 1 28 + 29 + regulators: 30 + $ref: ../regulator/samsung,s2mpa01.yaml 31 + description: 32 + List of child nodes that specify the regulators. 33 + 34 + wakeup-source: true 35 + 36 + required: 37 + - compatible 38 + - reg 39 + - regulators 40 + 41 + additionalProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/interrupt-controller/irq.h> 46 + 47 + i2c { 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + 51 + pmic@66 { 52 + compatible = "samsung,s2mpa01-pmic"; 53 + reg = <0x66>; 54 + 55 + regulators { 56 + ldo1_reg: LDO1 { 57 + regulator-name = "VDD_ALIVE"; 58 + regulator-min-microvolt = <1000000>; 59 + regulator-max-microvolt = <1000000>; 60 + }; 61 + 62 + ldo2_reg: LDO2 { 63 + regulator-name = "VDDQ_MMC2"; 64 + regulator-min-microvolt = <2800000>; 65 + regulator-max-microvolt = <2800000>; 66 + regulator-always-on; 67 + }; 68 + 69 + // ... 70 + 71 + buck1_reg: BUCK1 { 72 + regulator-name = "vdd_mif"; 73 + regulator-min-microvolt = <950000>; 74 + regulator-max-microvolt = <1350000>; 75 + regulator-always-on; 76 + regulator-boot-on; 77 + }; 78 + 79 + buck2_reg: BUCK2 { 80 + regulator-name = "vdd_arm"; 81 + regulator-min-microvolt = <950000>; 82 + regulator-max-microvolt = <1350000>; 83 + regulator-always-on; 84 + regulator-boot-on; 85 + regulator-ramp-delay = <50000>; 86 + }; 87 + 88 + // ... 89 + }; 90 + }; 91 + };
+267
Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/samsung,s2mps11.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung S2MPS11/13/14/15 and S2MPU02 Power Management IC 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> 11 + 12 + description: | 13 + This is a part of device tree bindings for S2M and S5M family of Power 14 + Management IC (PMIC). 15 + 16 + The Samsung S2MPS11/13/14/15 and S2MPU02 is a family of Power Management IC 17 + which include voltage and current regulators, RTC, clock outputs and other 18 + sub-blocks. 19 + 20 + properties: 21 + compatible: 22 + enum: 23 + - samsung,s2mps11-pmic 24 + - samsung,s2mps13-pmic 25 + - samsung,s2mps14-pmic 26 + - samsung,s2mps15-pmic 27 + - samsung,s2mpu02-pmic 28 + 29 + clocks: 30 + $ref: ../clock/samsung,s2mps11.yaml 31 + description: 32 + Child node describing clock provider. 33 + 34 + interrupts: 35 + maxItems: 1 36 + 37 + reg: 38 + maxItems: 1 39 + 40 + regulators: 41 + type: object 42 + description: 43 + List of child nodes that specify the regulators. 44 + 45 + samsung,s2mps11-acokb-ground: 46 + description: | 47 + Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so 48 + the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the 49 + power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes 50 + low, the rising ACOKB will trigger power off. 51 + type: boolean 52 + 53 + samsung,s2mps11-wrstbi-ground: 54 + description: | 55 + Indicates that WRSTBI pin of PMIC is pulled down. When the system is 56 + suspended it will always go down thus triggerring unwanted buck warm 57 + reset (setting buck voltages to default values). 58 + type: boolean 59 + 60 + wakeup-source: true 61 + 62 + required: 63 + - compatible 64 + - reg 65 + - regulators 66 + 67 + additionalProperties: false 68 + 69 + allOf: 70 + - if: 71 + properties: 72 + compatible: 73 + contains: 74 + const: samsung,s2mps11-pmic 75 + then: 76 + properties: 77 + regulators: 78 + $ref: ../regulator/samsung,s2mps11.yaml 79 + samsung,s2mps11-wrstbi-ground: false 80 + 81 + - if: 82 + properties: 83 + compatible: 84 + contains: 85 + const: samsung,s2mps13-pmic 86 + then: 87 + properties: 88 + regulators: 89 + $ref: ../regulator/samsung,s2mps13.yaml 90 + samsung,s2mps11-acokb-ground: false 91 + 92 + - if: 93 + properties: 94 + compatible: 95 + contains: 96 + const: samsung,s2mps14-pmic 97 + then: 98 + properties: 99 + regulators: 100 + $ref: ../regulator/samsung,s2mps14.yaml 101 + samsung,s2mps11-acokb-ground: false 102 + samsung,s2mps11-wrstbi-ground: false 103 + 104 + - if: 105 + properties: 106 + compatible: 107 + contains: 108 + const: samsung,s2mps15-pmic 109 + then: 110 + properties: 111 + regulators: 112 + $ref: ../regulator/samsung,s2mps15.yaml 113 + samsung,s2mps11-acokb-ground: false 114 + samsung,s2mps11-wrstbi-ground: false 115 + 116 + - if: 117 + properties: 118 + compatible: 119 + contains: 120 + const: samsung,s2mpu02-pmic 121 + then: 122 + properties: 123 + regulators: 124 + $ref: ../regulator/samsung,s2mpu02.yaml 125 + samsung,s2mps11-acokb-ground: false 126 + samsung,s2mps11-wrstbi-ground: false 127 + 128 + examples: 129 + - | 130 + #include <dt-bindings/interrupt-controller/irq.h> 131 + 132 + i2c { 133 + #address-cells = <1>; 134 + #size-cells = <0>; 135 + 136 + pmic@66 { 137 + compatible = "samsung,s2mps11-pmic"; 138 + reg = <0x66>; 139 + 140 + interrupt-parent = <&gpx0>; 141 + interrupts = <4 IRQ_TYPE_LEVEL_LOW>; 142 + pinctrl-names = "default"; 143 + pinctrl-0 = <&s2mps11_irq>; 144 + samsung,s2mps11-acokb-ground; 145 + wakeup-source; 146 + 147 + clocks { 148 + compatible = "samsung,s2mps11-clk"; 149 + #clock-cells = <1>; 150 + clock-output-names = "s2mps11_ap", "s2mps11_cp", "s2mps11_bt"; 151 + }; 152 + 153 + regulators { 154 + LDO1 { 155 + regulator-name = "vdd_ldo1"; 156 + regulator-min-microvolt = <1000000>; 157 + regulator-max-microvolt = <1000000>; 158 + regulator-always-on; 159 + }; 160 + 161 + LDO4 { 162 + regulator-name = "vdd_adc"; 163 + regulator-min-microvolt = <1800000>; 164 + regulator-max-microvolt = <1800000>; 165 + 166 + regulator-state-mem { 167 + regulator-off-in-suspend; 168 + }; 169 + }; 170 + 171 + // .... 172 + 173 + BUCK1 { 174 + regulator-name = "vdd_mif"; 175 + regulator-min-microvolt = <800000>; 176 + regulator-max-microvolt = <1300000>; 177 + regulator-always-on; 178 + regulator-boot-on; 179 + 180 + regulator-state-mem { 181 + regulator-off-in-suspend; 182 + }; 183 + }; 184 + 185 + BUCK2 { 186 + regulator-name = "vdd_arm"; 187 + regulator-min-microvolt = <800000>; 188 + regulator-max-microvolt = <1500000>; 189 + regulator-always-on; 190 + regulator-boot-on; 191 + regulator-coupled-with = <&buck3_reg>; 192 + regulator-coupled-max-spread = <300000>; 193 + 194 + regulator-state-mem { 195 + regulator-off-in-suspend; 196 + }; 197 + }; 198 + 199 + BUCK3 { 200 + regulator-name = "vdd_int"; 201 + regulator-min-microvolt = <800000>; 202 + regulator-max-microvolt = <1400000>; 203 + regulator-always-on; 204 + regulator-boot-on; 205 + regulator-coupled-with = <&buck2_reg>; 206 + regulator-coupled-max-spread = <300000>; 207 + 208 + regulator-state-mem { 209 + regulator-off-in-suspend; 210 + }; 211 + }; 212 + 213 + // ... 214 + }; 215 + }; 216 + }; 217 + 218 + - | 219 + #include <dt-bindings/interrupt-controller/irq.h> 220 + 221 + i2c { 222 + #address-cells = <1>; 223 + #size-cells = <0>; 224 + 225 + pmic@66 { 226 + compatible = "samsung,s2mps14-pmic"; 227 + reg = <0x66>; 228 + 229 + interrupt-parent = <&gpx0>; 230 + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; 231 + wakeup-source; 232 + 233 + clocks { 234 + compatible = "samsung,s2mps14-clk"; 235 + #clock-cells = <1>; 236 + clock-output-names = "s2mps14_ap", "unused", "s2mps14_bt"; 237 + }; 238 + 239 + regulators { 240 + LDO1 { 241 + regulator-name = "VLDO1_1.0V"; 242 + regulator-min-microvolt = <1000000>; 243 + regulator-max-microvolt = <1000000>; 244 + regulator-always-on; 245 + 246 + regulator-state-mem { 247 + regulator-on-in-suspend; 248 + }; 249 + }; 250 + 251 + // ... 252 + 253 + BUCK1 { 254 + regulator-name = "VBUCK1_1.0V"; 255 + regulator-min-microvolt = <800000>; 256 + regulator-max-microvolt = <1000000>; 257 + regulator-always-on; 258 + 259 + regulator-state-mem { 260 + regulator-off-in-suspend; 261 + }; 262 + }; 263 + 264 + // ... 265 + }; 266 + }; 267 + };
+307
Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/samsung,s5m8767.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung S5M8767 Power Management IC 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> 11 + 12 + description: | 13 + This is a part of device tree bindings for S2M and S5M family of Power 14 + Management IC (PMIC). 15 + 16 + The Samsung S5M8767 is a Power Management IC which includes voltage 17 + and current regulators, RTC, clock outputs and other sub-blocks. 18 + 19 + properties: 20 + compatible: 21 + const: samsung,s5m8767-pmic 22 + 23 + clocks: 24 + $ref: ../clock/samsung,s2mps11.yaml 25 + description: 26 + Child node describing clock provider. 27 + 28 + interrupts: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + regulators: 35 + $ref: ../regulator/samsung,s5m8767.yaml 36 + description: 37 + List of child nodes that specify the regulators. 38 + 39 + s5m8767,pmic-buck2-dvs-voltage: 40 + $ref: /schemas/types.yaml#/definitions/uint32-array 41 + minItems: 8 42 + maxItems: 8 43 + description: | 44 + A set of 8 voltage values in micro-volt (uV) units for buck2 when 45 + changing voltage using gpio dvs. 46 + 47 + s5m8767,pmic-buck3-dvs-voltage: 48 + $ref: /schemas/types.yaml#/definitions/uint32-array 49 + minItems: 8 50 + maxItems: 8 51 + description: | 52 + A set of 8 voltage values in micro-volt (uV) units for buck3 when 53 + changing voltage using gpio dvs. 54 + 55 + s5m8767,pmic-buck4-dvs-voltage: 56 + $ref: /schemas/types.yaml#/definitions/uint32-array 57 + minItems: 8 58 + maxItems: 8 59 + description: | 60 + A set of 8 voltage values in micro-volt (uV) units for buck4 when 61 + changing voltage using gpio dvs. 62 + 63 + s5m8767,pmic-buck-ds-gpios: 64 + minItems: 3 65 + maxItems: 3 66 + description: | 67 + GPIO specifiers for three host gpio's used for selecting GPIO DVS lines. 68 + It is one-to-one mapped to dvs gpio lines. 69 + 70 + s5m8767,pmic-buck2-uses-gpio-dvs: 71 + type: boolean 72 + description: buck2 can be controlled by gpio dvs. 73 + 74 + s5m8767,pmic-buck3-uses-gpio-dvs: 75 + type: boolean 76 + description: buck3 can be controlled by gpio dvs. 77 + 78 + s5m8767,pmic-buck4-uses-gpio-dvs: 79 + type: boolean 80 + description: buck4 can be controlled by gpio dvs. 81 + 82 + s5m8767,pmic-buck-default-dvs-idx: 83 + $ref: /schemas/types.yaml#/definitions/uint32-array 84 + minimum: 0 85 + maximum: 7 86 + default: 0 87 + description: | 88 + Default voltage setting selected from the possible 8 options selectable 89 + by the dvs gpios. The value of this property should be between 0 and 7. 90 + If not specified or if out of range, the default value of this property 91 + is set to 0. 92 + 93 + s5m8767,pmic-buck-dvs-gpios: 94 + minItems: 3 95 + maxItems: 3 96 + description: | 97 + GPIO specifiers for three host gpio's used for dvs. 98 + 99 + vinb1-supply: 100 + description: Power supply for buck1 101 + vinb2-supply: 102 + description: Power supply for buck2 103 + vinb3-supply: 104 + description: Power supply for buck3 105 + vinb4-supply: 106 + description: Power supply for buck4 107 + vinb5-supply: 108 + description: Power supply for buck5 109 + vinb6-supply: 110 + description: Power supply for buck6 111 + vinb7-supply: 112 + description: Power supply for buck7 113 + vinb8-supply: 114 + description: Power supply for buck8 115 + vinb9-supply: 116 + description: Power supply for buck9 117 + 118 + vinl1-supply: 119 + description: Power supply for LDO3, LDO10, LDO26, LDO27 120 + vinl2-supply: 121 + description: Power supply for LDO13, LDO16, LDO25, LDO28 122 + vinl3-supply: 123 + description: Power supply for LDO11, LDO14 124 + vinl4-supply: 125 + description: Power supply for LDO4, LDO9 126 + vinl5-supply: 127 + description: Power supply for LDO12, LDO17, LDO19, LDO23 128 + vinl6-supply: 129 + description: Power supply for LDO18, LDO20, LDO21, LDO24 130 + vinl7-supply: 131 + description: Power supply for LDO5, LDO22 132 + vinl8-supply: 133 + description: Power supply for LDO1, LDO6, LDO7, LDO8, LDO15 134 + vinl9-supply: 135 + description: Power supply for LDO2 136 + 137 + wakeup-source: true 138 + 139 + required: 140 + - compatible 141 + - reg 142 + - regulators 143 + - s5m8767,pmic-buck-ds-gpios 144 + 145 + dependencies: 146 + s5m8767,pmic-buck2-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ] 147 + s5m8767,pmic-buck3-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ] 148 + s5m8767,pmic-buck4-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ] 149 + s5m8767,pmic-buck2-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck2-dvs-voltage' ] 150 + s5m8767,pmic-buck3-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck3-dvs-voltage' ] 151 + s5m8767,pmic-buck4-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck4-dvs-voltage' ] 152 + 153 + additionalProperties: false 154 + 155 + allOf: 156 + - if: 157 + required: 158 + - s5m8767,pmic-buck2-uses-gpio-dvs 159 + then: 160 + properties: 161 + s5m8767,pmic-buck3-uses-gpio-dvs: false 162 + s5m8767,pmic-buck4-uses-gpio-dvs: false 163 + 164 + - if: 165 + required: 166 + - s5m8767,pmic-buck3-uses-gpio-dvs 167 + then: 168 + properties: 169 + s5m8767,pmic-buck2-uses-gpio-dvs: false 170 + s5m8767,pmic-buck4-uses-gpio-dvs: false 171 + 172 + - if: 173 + required: 174 + - s5m8767,pmic-buck4-uses-gpio-dvs 175 + then: 176 + properties: 177 + s5m8767,pmic-buck2-uses-gpio-dvs: false 178 + s5m8767,pmic-buck3-uses-gpio-dvs: false 179 + 180 + examples: 181 + - | 182 + #include <dt-bindings/gpio/gpio.h> 183 + #include <dt-bindings/interrupt-controller/irq.h> 184 + 185 + i2c { 186 + #address-cells = <1>; 187 + #size-cells = <0>; 188 + 189 + pmic@66 { 190 + compatible = "samsung,s5m8767-pmic"; 191 + reg = <0x66>; 192 + 193 + interrupt-parent = <&gpx3>; 194 + interrupts = <2 IRQ_TYPE_LEVEL_LOW>; 195 + pinctrl-names = "default"; 196 + pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>; 197 + wakeup-source; 198 + 199 + s5m8767,pmic-buck-default-dvs-idx = <3>; 200 + s5m8767,pmic-buck2-uses-gpio-dvs; 201 + 202 + s5m8767,pmic-buck-dvs-gpios = <&gpd1 0 GPIO_ACTIVE_LOW>, 203 + <&gpd1 1 GPIO_ACTIVE_LOW>, 204 + <&gpd1 2 GPIO_ACTIVE_LOW>; 205 + 206 + s5m8767,pmic-buck-ds-gpios = <&gpx2 3 GPIO_ACTIVE_LOW>, 207 + <&gpx2 4 GPIO_ACTIVE_LOW>, 208 + <&gpx2 5 GPIO_ACTIVE_LOW>; 209 + 210 + s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>, 211 + <1250000>, <1200000>, 212 + <1150000>, <1100000>, 213 + <1000000>, <950000>; 214 + 215 + s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>, 216 + <1100000>, <1100000>, 217 + <1000000>, <1000000>, 218 + <1000000>, <1000000>; 219 + 220 + s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>, 221 + <1200000>, <1200000>, 222 + <1200000>, <1200000>, 223 + <1200000>, <1200000>; 224 + 225 + clocks { 226 + compatible = "samsung,s5m8767-clk"; 227 + #clock-cells = <1>; 228 + clock-output-names = "en32khz_ap", "en32khz_cp", "en32khz_bt"; 229 + }; 230 + 231 + regulators { 232 + LDO1 { 233 + regulator-name = "VDD_ALIVE"; 234 + regulator-min-microvolt = <1100000>; 235 + regulator-max-microvolt = <1100000>; 236 + regulator-always-on; 237 + regulator-boot-on; 238 + op_mode = <1>; /* Normal Mode */ 239 + }; 240 + 241 + // ... 242 + 243 + BUCK1 { 244 + regulator-name = "VDD_MIF"; 245 + regulator-min-microvolt = <950000>; 246 + regulator-max-microvolt = <1100000>; 247 + regulator-always-on; 248 + regulator-boot-on; 249 + op_mode = <1>; /* Normal Mode */ 250 + }; 251 + 252 + BUCK2 { 253 + regulator-name = "VDD_ARM"; 254 + regulator-min-microvolt = <900000>; 255 + regulator-max-microvolt = <1350000>; 256 + regulator-always-on; 257 + regulator-boot-on; 258 + op_mode = <1>; /* Normal Mode */ 259 + }; 260 + 261 + // ... 262 + }; 263 + }; 264 + }; 265 + 266 + - | 267 + #include <dt-bindings/gpio/gpio.h> 268 + #include <dt-bindings/interrupt-controller/irq.h> 269 + 270 + i2c { 271 + #address-cells = <1>; 272 + #size-cells = <0>; 273 + 274 + pmic@66 { 275 + compatible = "samsung,s5m8767-pmic"; 276 + reg = <0x66>; 277 + 278 + interrupt-parent = <&gpx3>; 279 + interrupts = <2 IRQ_TYPE_LEVEL_LOW>; 280 + pinctrl-names = "default"; 281 + pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>; 282 + wakeup-source; 283 + 284 + s5m8767,pmic-buck-ds-gpios = <&gpx2 3 GPIO_ACTIVE_LOW>, 285 + <&gpx2 4 GPIO_ACTIVE_LOW>, 286 + <&gpx2 5 GPIO_ACTIVE_LOW>; 287 + 288 + clocks { 289 + compatible = "samsung,s5m8767-clk"; 290 + #clock-cells = <1>; 291 + clock-output-names = "en32khz_ap", "en32khz_cp", "en32khz_bt"; 292 + }; 293 + 294 + regulators { 295 + LDO1 { 296 + regulator-name = "VDD_ALIVE"; 297 + regulator-min-microvolt = <1100000>; 298 + regulator-max-microvolt = <1100000>; 299 + regulator-always-on; 300 + regulator-boot-on; 301 + op_mode = <1>; /* Normal Mode */ 302 + }; 303 + 304 + // ... 305 + }; 306 + }; 307 + };
-86
Documentation/devicetree/bindings/mfd/samsung,sec-core.txt
··· 1 - Binding for Samsung S2M and S5M family multi-function device 2 - ============================================================ 3 - 4 - This is a part of device tree bindings for S2M and S5M family multi-function 5 - devices. 6 - 7 - The Samsung S2MPA01, S2MPS11/13/14/15, S2MPU02 and S5M8767 is a family 8 - of multi-function devices which include voltage and current regulators, RTC, 9 - charger controller, clock outputs and other sub-blocks. It is interfaced 10 - to the host controller using an I2C interface. Each sub-block is usually 11 - addressed by the host system using different I2C slave addresses. 12 - 13 - 14 - This document describes bindings for main device node. Optional sub-blocks 15 - must be a sub-nodes to it. Bindings for them can be found in: 16 - - bindings/regulator/samsung,s2mpa01.txt 17 - - bindings/regulator/samsung,s2mps11.txt 18 - - bindings/regulator/samsung,s5m8767.txt 19 - - bindings/clock/samsung,s2mps11.txt 20 - 21 - 22 - Required properties: 23 - - compatible: Should be one of the following 24 - - "samsung,s2mpa01-pmic", 25 - - "samsung,s2mps11-pmic", 26 - - "samsung,s2mps13-pmic", 27 - - "samsung,s2mps14-pmic", 28 - - "samsung,s2mps15-pmic", 29 - - "samsung,s2mpu02-pmic", 30 - - "samsung,s5m8767-pmic". 31 - - reg: Specifies the I2C slave address of the pmic block. It should be 0x66. 32 - 33 - Optional properties: 34 - - interrupts: Interrupt specifiers for interrupt sources. 35 - - samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled 36 - down. When the system is suspended it will always go down thus triggerring 37 - unwanted buck warm reset (setting buck voltages to default values). 38 - - samsung,s2mps11-acokb-ground: Indicates that ACOKB pin of S2MPS11 PMIC is 39 - connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1 40 - register to turn off the power. Usually the ACOKB is pulled up to VBATT so 41 - when PWRHOLD pin goes low, the rising ACOKB will trigger power off. 42 - 43 - Example: 44 - 45 - s2mps11_pmic@66 { 46 - compatible = "samsung,s2mps11-pmic"; 47 - reg = <0x66>; 48 - 49 - s2m_osc: clocks { 50 - compatible = "samsung,s2mps11-clk"; 51 - #clock-cells = <1>; 52 - clock-output-names = "xx", "yy", "zz"; 53 - }; 54 - 55 - regulators { 56 - ldo1_reg: LDO1 { 57 - regulator-name = "VDD_ABB_3.3V"; 58 - regulator-min-microvolt = <3300000>; 59 - regulator-max-microvolt = <3300000>; 60 - }; 61 - 62 - ldo2_reg: LDO2 { 63 - regulator-name = "VDD_ALIVE_1.1V"; 64 - regulator-min-microvolt = <1100000>; 65 - regulator-max-microvolt = <1100000>; 66 - regulator-always-on; 67 - }; 68 - 69 - buck1_reg: BUCK1 { 70 - regulator-name = "vdd_mif"; 71 - regulator-min-microvolt = <950000>; 72 - regulator-max-microvolt = <1350000>; 73 - regulator-always-on; 74 - regulator-boot-on; 75 - }; 76 - 77 - buck2_reg: BUCK2 { 78 - regulator-name = "vdd_arm"; 79 - regulator-min-microvolt = <950000>; 80 - regulator-max-microvolt = <1350000>; 81 - regulator-always-on; 82 - regulator-boot-on; 83 - regulator-ramp-delay = <50000>; 84 - }; 85 - }; 86 - };
+3
Documentation/devicetree/bindings/mfd/syscon.yaml
··· 38 38 - allwinner,sun8i-h3-system-controller 39 39 - allwinner,sun8i-v3s-system-controller 40 40 - allwinner,sun50i-a64-system-controller 41 + - brcm,cru-clkset 41 42 - hisilicon,dsa-subctrl 42 43 - hisilicon,hi6220-sramctrl 43 44 - hisilicon,pcie-sas-subctrl ··· 50 49 - rockchip,rk3066-qos 51 50 - rockchip,rk3228-qos 52 51 - rockchip,rk3288-qos 52 + - rockchip,rk3368-qos 53 53 - rockchip,rk3399-qos 54 54 - rockchip,rk3568-qos 55 55 - samsung,exynos3-sysreg 56 56 - samsung,exynos4-sysreg 57 57 - samsung,exynos5-sysreg 58 58 - samsung,exynos5433-sysreg 59 + - samsung,exynosautov9-sysreg 59 60 60 61 - const: syscon 61 62
+84
Documentation/devicetree/bindings/mfd/ti,am3359-tscadc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/ti,am3359-tscadc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI AM3359 Touchscreen controller/ADC 8 + 9 + maintainers: 10 + - Miquel Raynal <miquel.raynal@bootlin.com> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - const: ti,am3359-tscadc 16 + - items: 17 + - const: ti,am654-tscadc 18 + - const: ti,am3359-tscadc 19 + - const: ti,am4372-magadc 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + clocks: 28 + maxItems: 1 29 + 30 + clock-names: 31 + const: fck 32 + 33 + dmas: 34 + items: 35 + - description: DMA controller phandle and request line for FIFO0 36 + - description: DMA controller phandle and request line for FIFO1 37 + 38 + dma-names: 39 + items: 40 + - const: fifo0 41 + - const: fifo1 42 + 43 + adc: 44 + type: object 45 + description: ADC child 46 + 47 + tsc: 48 + type: object 49 + description: Touchscreen controller child 50 + 51 + mag: 52 + type: object 53 + description: Magnetic reader 54 + 55 + required: 56 + - compatible 57 + - reg 58 + - interrupts 59 + - clocks 60 + - clock-names 61 + - dmas 62 + - dma-names 63 + 64 + additionalProperties: false 65 + 66 + examples: 67 + - | 68 + #include <dt-bindings/interrupt-controller/arm-gic.h> 69 + 70 + tscadc@0 { 71 + compatible = "ti,am3359-tscadc"; 72 + reg = <0x0 0x1000>; 73 + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; 74 + clocks = <&adc_tsc_fck>; 75 + clock-names = "fck"; 76 + dmas = <&edma 53 0>, <&edma 57 0>; 77 + dma-names = "fifo0", "fifo1"; 78 + 79 + tsc { 80 + }; 81 + 82 + adc { 83 + }; 84 + };
+116
Documentation/devicetree/bindings/mfd/x-powers,ac100.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/mfd/x-powers,ac100.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: X-Powers AC100 Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + 12 + properties: 13 + compatible: 14 + const: x-powers,ac100 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + codec: 20 + type: object 21 + 22 + properties: 23 + "#clock-cells": 24 + const: 0 25 + 26 + compatible: 27 + const: x-powers,ac100-codec 28 + 29 + interrupts: 30 + maxItems: 1 31 + 32 + clock-output-names: 33 + maxItems: 1 34 + description: > 35 + Name of the 4M_adda clock exposed by the codec 36 + 37 + required: 38 + - "#clock-cells" 39 + - compatible 40 + - interrupts 41 + - clock-output-names 42 + 43 + additionalProperties: false 44 + 45 + rtc: 46 + type: object 47 + 48 + properties: 49 + "#clock-cells": 50 + const: 1 51 + 52 + compatible: 53 + const: x-powers,ac100-rtc 54 + 55 + interrupts: 56 + maxItems: 1 57 + 58 + clocks: 59 + maxItems: 1 60 + description: > 61 + A phandle to the codec's "4M_adda" clock 62 + 63 + clock-output-names: 64 + maxItems: 3 65 + description: > 66 + Name of the cko1, cko2 and cko3 clocks exposed by the codec 67 + 68 + required: 69 + - "#clock-cells" 70 + - compatible 71 + - interrupts 72 + - clocks 73 + - clock-output-names 74 + 75 + additionalProperties: false 76 + 77 + required: 78 + - compatible 79 + - reg 80 + - codec 81 + - rtc 82 + 83 + additionalProperties: false 84 + 85 + examples: 86 + - | 87 + #include <dt-bindings/interrupt-controller/irq.h> 88 + 89 + rsb { 90 + #address-cells = <1>; 91 + #size-cells = <0>; 92 + 93 + codec@e89 { 94 + compatible = "x-powers,ac100"; 95 + reg = <0xe89>; 96 + 97 + ac100_codec: codec { 98 + compatible = "x-powers,ac100-codec"; 99 + interrupt-parent = <&r_pio>; 100 + interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */ 101 + #clock-cells = <0>; 102 + clock-output-names = "4M_adda"; 103 + }; 104 + 105 + ac100_rtc: rtc { 106 + compatible = "x-powers,ac100-rtc"; 107 + interrupt-parent = <&nmi_intc>; 108 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 109 + clocks = <&ac100_codec>; 110 + #clock-cells = <1>; 111 + clock-output-names = "cko1_rtc", "cko2_rtc", "cko3_rtc"; 112 + }; 113 + }; 114 + }; 115 + 116 + ...
+400
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/x-powers,axp152.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: X-Powers AXP PMIC Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + 12 + allOf: 13 + - if: 14 + properties: 15 + compatible: 16 + contains: 17 + enum: 18 + - x-powers,axp152 19 + - x-powers,axp202 20 + - x-powers,axp209 21 + 22 + then: 23 + properties: 24 + regulators: 25 + properties: 26 + x-powers,dcdc-freq: 27 + minimum: 750 28 + maximum: 1875 29 + default: 1500 30 + 31 + else: 32 + properties: 33 + regulators: 34 + properties: 35 + x-powers,dcdc-freq: 36 + minimum: 1800 37 + maximum: 4050 38 + default: 3000 39 + 40 + - if: 41 + properties: 42 + compatible: 43 + contains: 44 + enum: 45 + - x-powers,axp152 46 + - x-powers,axp202 47 + - x-powers,axp209 48 + 49 + then: 50 + not: 51 + required: 52 + - x-powers,drive-vbus-en 53 + 54 + - if: 55 + not: 56 + properties: 57 + compatible: 58 + contains: 59 + const: x-powers,axp806 60 + 61 + then: 62 + allOf: 63 + - not: 64 + required: 65 + - x-powers,self-working-mode 66 + 67 + - not: 68 + required: 69 + - x-powers,master-mode 70 + 71 + - if: 72 + not: 73 + properties: 74 + compatible: 75 + contains: 76 + const: x-powers,axp305 77 + 78 + then: 79 + required: 80 + - interrupts 81 + 82 + properties: 83 + compatible: 84 + oneOf: 85 + - enum: 86 + - x-powers,axp152 87 + - x-powers,axp202 88 + - x-powers,axp209 89 + - x-powers,axp221 90 + - x-powers,axp223 91 + - x-powers,axp803 92 + - x-powers,axp806 93 + - x-powers,axp809 94 + - x-powers,axp813 95 + - items: 96 + - const: x-powers,axp805 97 + - const: x-powers,axp806 98 + - items: 99 + - const: x-powers,axp305 100 + - const: x-powers,axp805 101 + - const: x-powers,axp806 102 + - items: 103 + - const: x-powers,axp818 104 + - const: x-powers,axp813 105 + 106 + reg: 107 + maxItems: 1 108 + 109 + interrupts: 110 + maxItems: 1 111 + 112 + interrupt-controller: true 113 + 114 + "#interrupt-cells": 115 + const: 1 116 + 117 + x-powers,drive-vbus-en: 118 + type: boolean 119 + description: > 120 + Set this when the N_VBUSEN pin is used as an output pin to control an 121 + external regulator to drive the OTG VBus, rather then as an input pin 122 + which signals whether the board is driving OTG VBus or not. 123 + 124 + x-powers,self-working-mode: 125 + type: boolean 126 + description: > 127 + Set this when the PMIC is wired for self-working mode through the MODESET 128 + pin. 129 + 130 + x-powers,master-mode: 131 + type: boolean 132 + description: > 133 + Set this when the PMIC is wired for master mode through the MODESET pin. 134 + 135 + vin1-supply: 136 + description: > 137 + DCDC1 power supply node, if present. 138 + 139 + vin2-supply: 140 + description: > 141 + DCDC2 power supply node, if present. 142 + 143 + vin3-supply: 144 + description: > 145 + DCDC3 power supply node, if present. 146 + 147 + vin4-supply: 148 + description: > 149 + DCDC4 power supply node, if present. 150 + 151 + vin5-supply: 152 + description: > 153 + DCDC5 power supply node, if present. 154 + 155 + vin6-supply: 156 + description: > 157 + DCDC6 power supply node, if present. 158 + 159 + vin7-supply: 160 + description: > 161 + DCDC7 power supply node, if present. 162 + 163 + vina-supply: 164 + description: > 165 + DCDCA power supply node, if present. 166 + 167 + vinb-supply: 168 + description: > 169 + DCDCB power supply node, if present. 170 + 171 + vinc-supply: 172 + description: > 173 + DCDCC power supply node, if present. 174 + 175 + vind-supply: 176 + description: > 177 + DCDCD power supply node, if present. 178 + 179 + vine-supply: 180 + description: > 181 + DCDCE power supply node, if present. 182 + 183 + acin-supply: 184 + description: > 185 + LDO1 power supply node, if present. 186 + 187 + ldo24in-supply: 188 + description: > 189 + LDO2 and LDO4 power supply node, if present. 190 + 191 + ldo3in-supply: 192 + description: > 193 + LDO3 power supply node, if present. 194 + 195 + ldo5in-supply: 196 + description: > 197 + LDO5 power supply node, if present. 198 + 199 + aldoin-supply: 200 + description: > 201 + ALDO* power supply node, if present. 202 + 203 + bldoin-supply: 204 + description: > 205 + BLDO* power supply node, if present. 206 + 207 + cldoin-supply: 208 + description: > 209 + CLDO* power supply node, if present. 210 + 211 + dldoin-supply: 212 + description: > 213 + DLDO* power supply node, if present. 214 + 215 + eldoin-supply: 216 + description: > 217 + ELDO* power supply node, if present. 218 + 219 + fldoin-supply: 220 + description: > 221 + FLDO* power supply node, if present. 222 + 223 + ips-supply: 224 + description: > 225 + LDO_IO0, LDO_IO1 and RTC_LDO power supply node, if present. 226 + 227 + drivevbus-supply: 228 + description: > 229 + DRIVEVBUS power supply node, if present. 230 + 231 + swin-supply: 232 + description: > 233 + SW power supply node, if present. 234 + 235 + adc: 236 + $ref: /schemas/iio/adc/x-powers,axp209-adc.yaml# 237 + 238 + gpio: 239 + $ref: /schemas/gpio/x-powers,axp209-gpio.yaml# 240 + 241 + ac-power: 242 + $ref: /schemas/power/supply/x-powers,axp20x-ac-power-supply.yaml# 243 + 244 + battery-power: 245 + $ref: /schemas/power/supply/x-powers,axp20x-battery-power-supply.yaml# 246 + 247 + usb-power: 248 + $ref: /schemas/power/supply/x-powers,axp20x-usb-power-supply.yaml# 249 + 250 + regulators: 251 + type: object 252 + 253 + properties: 254 + x-powers,dcdc-freq: 255 + $ref: /schemas/types.yaml#/definitions/uint32 256 + description: > 257 + Defines the work frequency of DC-DC in kHz. 258 + 259 + patternProperties: 260 + "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|drivevbus|dc5ldo)$": 261 + $ref: /schemas/regulator/regulator.yaml# 262 + type: object 263 + 264 + properties: 265 + regulator-ramp-delay: 266 + description: > 267 + Only 800 and 1600 are valid for the DCDC2 and LDO3 regulators on 268 + the AXP209. 269 + 270 + regulator-soft-start: 271 + description: > 272 + Only valid for the LDO3 regulator. 273 + 274 + x-powers,dcdc-workmode: 275 + $ref: /schemas/types.yaml#/definitions/uint32 276 + enum: [0, 1] 277 + description: > 278 + Only valid for DCDC regulators. Setup 1 for PWM mode, 0 279 + for AUTO (PWM/PFM) mode. The DCDC regulators work in a 280 + mixed PWM/PFM mode, using PFM under light loads and 281 + switching to PWM for heavier loads. Forcing PWM mode 282 + trades efficiency under light loads for lower output 283 + noise. This probably makes sense for HiFi audio related 284 + applications that aren't battery constrained. 285 + 286 + additionalProperties: false 287 + 288 + required: 289 + - compatible 290 + - reg 291 + - "#interrupt-cells" 292 + - interrupt-controller 293 + 294 + additionalProperties: false 295 + 296 + examples: 297 + - | 298 + i2c0 { 299 + #address-cells = <1>; 300 + #size-cells = <0>; 301 + 302 + pmic@30 { 303 + compatible = "x-powers,axp152"; 304 + reg = <0x30>; 305 + interrupts = <0>; 306 + interrupt-controller; 307 + #interrupt-cells = <1>; 308 + }; 309 + }; 310 + 311 + - | 312 + #include <dt-bindings/interrupt-controller/irq.h> 313 + 314 + i2c0 { 315 + #address-cells = <1>; 316 + #size-cells = <0>; 317 + 318 + pmic@34 { 319 + compatible = "x-powers,axp209"; 320 + reg = <0x34>; 321 + interrupt-parent = <&nmi_intc>; 322 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 323 + interrupt-controller; 324 + #interrupt-cells = <1>; 325 + 326 + ac_power_supply: ac-power { 327 + compatible = "x-powers,axp202-ac-power-supply"; 328 + }; 329 + 330 + axp_adc: adc { 331 + compatible = "x-powers,axp209-adc"; 332 + #io-channel-cells = <1>; 333 + }; 334 + 335 + axp_gpio: gpio { 336 + compatible = "x-powers,axp209-gpio"; 337 + gpio-controller; 338 + #gpio-cells = <2>; 339 + 340 + gpio0-adc-pin { 341 + pins = "GPIO0"; 342 + function = "adc"; 343 + }; 344 + }; 345 + 346 + battery_power_supply: battery-power { 347 + compatible = "x-powers,axp209-battery-power-supply"; 348 + }; 349 + 350 + regulators { 351 + /* Default work frequency for buck regulators */ 352 + x-powers,dcdc-freq = <1500>; 353 + 354 + reg_dcdc2: dcdc2 { 355 + regulator-always-on; 356 + regulator-min-microvolt = <1000000>; 357 + regulator-max-microvolt = <1450000>; 358 + regulator-name = "vdd-cpu"; 359 + }; 360 + 361 + reg_dcdc3: dcdc3 { 362 + regulator-always-on; 363 + regulator-min-microvolt = <1000000>; 364 + regulator-max-microvolt = <1400000>; 365 + regulator-name = "vdd-int-dll"; 366 + }; 367 + 368 + reg_ldo1: ldo1 { 369 + /* LDO1 is a fixed output regulator */ 370 + regulator-always-on; 371 + regulator-min-microvolt = <1300000>; 372 + regulator-max-microvolt = <1300000>; 373 + regulator-name = "vdd-rtc"; 374 + }; 375 + 376 + reg_ldo2: ldo2 { 377 + regulator-always-on; 378 + regulator-min-microvolt = <3000000>; 379 + regulator-max-microvolt = <3000000>; 380 + regulator-name = "avcc"; 381 + }; 382 + 383 + reg_ldo3: ldo3 { 384 + regulator-name = "ldo3"; 385 + }; 386 + 387 + reg_ldo4: ldo4 { 388 + regulator-name = "ldo4"; 389 + }; 390 + 391 + reg_ldo5: ldo5 { 392 + regulator-name = "ldo5"; 393 + }; 394 + }; 395 + 396 + usb_power_supply: usb-power { 397 + compatible = "x-powers,axp202-usb-power-supply"; 398 + }; 399 + }; 400 + };
+3
Documentation/devicetree/bindings/mfd/xylon,logicvc.yaml
··· 46 46 "^gpio@[0-9a-f]+$": 47 47 $ref: /schemas/gpio/xylon,logicvc-gpio.yaml# 48 48 49 + "^display@[0-9a-f]+$": 50 + $ref: /schemas/display/xylon,logicvc-display.yaml# 51 + 49 52 required: 50 53 - compatible 51 54 - reg
+1 -1
Documentation/devicetree/bindings/regulator/max77686.txt
··· 43 43 max77686: pmic@9 { 44 44 compatible = "maxim,max77686"; 45 45 interrupt-parent = <&wakeup_eint>; 46 - interrupts = <26 IRQ_TYPE_NONE>; 46 + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 47 47 reg = <0x09>; 48 48 49 49 voltage-regulators {
+2 -1
MAINTAINERS
··· 16755 16755 L: linux-samsung-soc@vger.kernel.org 16756 16756 S: Supported 16757 16757 F: Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml 16758 - F: Documentation/devicetree/bindings/mfd/samsung,sec-core.txt 16758 + F: Documentation/devicetree/bindings/mfd/samsung,s2m*.yaml 16759 + F: Documentation/devicetree/bindings/mfd/samsung,s5m*.yaml 16759 16760 F: Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml 16760 16761 F: Documentation/devicetree/bindings/regulator/samsung,s5m*.yaml 16761 16762 F: drivers/clk/clk-s2mps11.c
+1
drivers/clk/ti/clk-43xx.c
··· 116 116 { AM4_L3S_VPFE0_CLKCTRL, NULL, CLKF_SW_SUP, "l3_gclk" }, 117 117 { AM4_L3S_VPFE1_CLKCTRL, NULL, CLKF_SW_SUP, "l3_gclk" }, 118 118 { AM4_L3S_GPMC_CLKCTRL, NULL, CLKF_SW_SUP, "l3s_gclk" }, 119 + { AM4_L3S_ADC1_CLKCTRL, NULL, CLKF_SW_SUP, "l3s_gclk" }, 119 120 { AM4_L3S_MCASP0_CLKCTRL, NULL, CLKF_SW_SUP, "mcasp0_fck" }, 120 121 { AM4_L3S_MCASP1_CLKCTRL, NULL, CLKF_SW_SUP, "mcasp1_fck" }, 121 122 { AM4_L3S_MMC3_CLKCTRL, NULL, CLKF_SW_SUP, "mmc_clk" },
+130 -90
drivers/iio/adc/ti_am335x_adc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 1 2 /* 2 3 * TI ADC MFD driver 3 4 * 4 5 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License as 8 - * published by the Free Software Foundation version 2. 9 - * 10 - * This program is distributed "as is" WITHOUT ANY WARRANTY of any 11 - * kind, whether express or implied; without even the implied warranty 12 - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 6 */ 15 7 16 8 #include <linux/kernel.h> ··· 17 25 #include <linux/of_device.h> 18 26 #include <linux/iio/machine.h> 19 27 #include <linux/iio/driver.h> 28 + #include <linux/iopoll.h> 20 29 21 30 #include <linux/mfd/ti_am335x_tscadc.h> 22 31 #include <linux/iio/buffer.h> ··· 58 65 } 59 66 60 67 static void tiadc_writel(struct tiadc_device *adc, unsigned int reg, 61 - unsigned int val) 68 + unsigned int val) 62 69 { 63 70 writel(val, adc->mfd_tscadc->tscadc_base + reg); 64 71 } ··· 73 80 } 74 81 75 82 static u32 get_adc_chan_step_mask(struct tiadc_device *adc_dev, 76 - struct iio_chan_spec const *chan) 83 + struct iio_chan_spec const *chan) 77 84 { 78 85 int i; 79 86 ··· 95 102 return 1 << adc_dev->channel_step[chan]; 96 103 } 97 104 105 + static int tiadc_wait_idle(struct tiadc_device *adc_dev) 106 + { 107 + u32 val; 108 + 109 + return readl_poll_timeout(adc_dev->mfd_tscadc->tscadc_base + REG_ADCFSM, 110 + val, !(val & SEQ_STATUS), 10, 111 + IDLE_TIMEOUT_MS * 1000 * adc_dev->channels); 112 + } 113 + 98 114 static void tiadc_step_config(struct iio_dev *indio_dev) 99 115 { 100 116 struct tiadc_device *adc_dev = iio_priv(indio_dev); 101 - struct device *dev = adc_dev->mfd_tscadc->dev; 102 117 unsigned int stepconfig; 103 118 int i, steps = 0; 104 119 ··· 119 118 * Channel would represent which analog input 120 119 * needs to be given to ADC to digitalize data. 121 120 */ 122 - 123 - 124 121 for (i = 0; i < adc_dev->channels; i++) { 125 122 int chan; 126 123 127 124 chan = adc_dev->channel_line[i]; 128 125 129 - if (adc_dev->step_avg[i] > STEPCONFIG_AVG_16) { 130 - dev_warn(dev, "chan %d step_avg truncating to %d\n", 131 - chan, STEPCONFIG_AVG_16); 132 - adc_dev->step_avg[i] = STEPCONFIG_AVG_16; 133 - } 134 - 135 126 if (adc_dev->step_avg[i]) 136 - stepconfig = 137 - STEPCONFIG_AVG(ffs(adc_dev->step_avg[i]) - 1) | 138 - STEPCONFIG_FIFO1; 127 + stepconfig = STEPCONFIG_AVG(ffs(adc_dev->step_avg[i]) - 1) | 128 + STEPCONFIG_FIFO1; 139 129 else 140 130 stepconfig = STEPCONFIG_FIFO1; 141 131 ··· 134 142 stepconfig |= STEPCONFIG_MODE_SWCNT; 135 143 136 144 tiadc_writel(adc_dev, REG_STEPCONFIG(steps), 137 - stepconfig | STEPCONFIG_INP(chan) | 138 - STEPCONFIG_INM_ADCREFM | 139 - STEPCONFIG_RFP_VREFP | 140 - STEPCONFIG_RFM_VREFN); 141 - 142 - if (adc_dev->open_delay[i] > STEPDELAY_OPEN_MASK) { 143 - dev_warn(dev, "chan %d open delay truncating to 0x3FFFF\n", 144 - chan); 145 - adc_dev->open_delay[i] = STEPDELAY_OPEN_MASK; 146 - } 147 - 148 - if (adc_dev->sample_delay[i] > 0xFF) { 149 - dev_warn(dev, "chan %d sample delay truncating to 0xFF\n", 150 - chan); 151 - adc_dev->sample_delay[i] = 0xFF; 152 - } 145 + stepconfig | STEPCONFIG_INP(chan) | 146 + STEPCONFIG_INM_ADCREFM | STEPCONFIG_RFP_VREFP | 147 + STEPCONFIG_RFM_VREFN); 153 148 154 149 tiadc_writel(adc_dev, REG_STEPDELAY(steps), 155 - STEPDELAY_OPEN(adc_dev->open_delay[i]) | 156 - STEPDELAY_SAMPLE(adc_dev->sample_delay[i])); 150 + STEPDELAY_OPEN(adc_dev->open_delay[i]) | 151 + STEPDELAY_SAMPLE(adc_dev->sample_delay[i])); 157 152 158 153 adc_dev->channel_step[i] = steps; 159 154 steps++; ··· 163 184 if (status & IRQENB_FIFO1OVRRUN) { 164 185 /* FIFO Overrun. Clear flag. Disable/Enable ADC to recover */ 165 186 config = tiadc_readl(adc_dev, REG_CTRL); 166 - config &= ~(CNTRLREG_TSCSSENB); 187 + config &= ~(CNTRLREG_SSENB); 167 188 tiadc_writel(adc_dev, REG_CTRL, config); 168 - tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN 169 - | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); 189 + tiadc_writel(adc_dev, REG_IRQSTATUS, 190 + IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW | 191 + IRQENB_FIFO1THRES); 170 192 171 - /* wait for idle state. 193 + /* 194 + * Wait for the idle state. 172 195 * ADC needs to finish the current conversion 173 196 * before disabling the module 174 197 */ ··· 178 197 adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM); 179 198 } while (adc_fsm != 0x10 && count++ < 100); 180 199 181 - tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); 200 + tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_SSENB)); 182 201 return IRQ_HANDLED; 183 202 } else if (status & IRQENB_FIFO1THRES) { 184 203 /* Disable irq and wake worker thread */ ··· 198 217 199 218 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); 200 219 for (k = 0; k < fifo1count; k = k + i) { 201 - for (i = 0; i < (indio_dev->scan_bytes)/2; i++) { 220 + for (i = 0; i < indio_dev->scan_bytes / 2; i++) { 202 221 read = tiadc_readl(adc_dev, REG_FIFO1); 203 222 data[i] = read & FIFOREAD_DATA_MASK; 204 223 } 205 - iio_push_to_buffers(indio_dev, (u8 *) data); 224 + iio_push_to_buffers(indio_dev, (u8 *)data); 206 225 } 207 226 208 227 tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1THRES); ··· 235 254 struct dma_async_tx_descriptor *desc; 236 255 237 256 dma->current_period = 0; /* We start to fill period 0 */ 257 + 238 258 /* 239 259 * Make the fifo thresh as the multiple of total number of 240 260 * channels enabled, so make sure that cyclic DMA period ··· 245 263 */ 246 264 dma->fifo_thresh = rounddown(FIFO1_THRESHOLD + 1, 247 265 adc_dev->total_ch_enabled) - 1; 266 + 248 267 /* Make sure that period length is multiple of fifo thresh level */ 249 268 dma->period_size = rounddown(DMA_BUFFER_SIZE / 2, 250 - (dma->fifo_thresh + 1) * sizeof(u16)); 269 + (dma->fifo_thresh + 1) * sizeof(u16)); 251 270 252 271 dma->conf.src_maxburst = dma->fifo_thresh + 1; 253 272 dmaengine_slave_config(dma->chan, &dma->conf); ··· 278 295 { 279 296 struct tiadc_device *adc_dev = iio_priv(indio_dev); 280 297 int i, fifo1count; 298 + int ret; 281 299 282 - tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES | 283 - IRQENB_FIFO1OVRRUN | 284 - IRQENB_FIFO1UNDRFLW)); 300 + ret = tiadc_wait_idle(adc_dev); 301 + if (ret) 302 + return ret; 303 + 304 + tiadc_writel(adc_dev, REG_IRQCLR, 305 + IRQENB_FIFO1THRES | IRQENB_FIFO1OVRRUN | 306 + IRQENB_FIFO1UNDRFLW); 285 307 286 308 /* Flush FIFO. Needed in corner cases in simultaneous tsc/adc use */ 287 309 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); ··· 316 328 317 329 am335x_tsc_se_set_cache(adc_dev->mfd_tscadc, enb); 318 330 319 - tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1THRES 320 - | IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW); 331 + tiadc_writel(adc_dev, REG_IRQSTATUS, 332 + IRQENB_FIFO1THRES | IRQENB_FIFO1OVRRUN | 333 + IRQENB_FIFO1UNDRFLW); 321 334 322 335 irq_enable = IRQENB_FIFO1OVRRUN; 323 336 if (!dma->chan) ··· 334 345 struct tiadc_dma *dma = &adc_dev->dma; 335 346 int fifo1count, i; 336 347 337 - tiadc_writel(adc_dev, REG_IRQCLR, (IRQENB_FIFO1THRES | 338 - IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW)); 348 + tiadc_writel(adc_dev, REG_IRQCLR, 349 + IRQENB_FIFO1THRES | IRQENB_FIFO1OVRRUN | 350 + IRQENB_FIFO1UNDRFLW); 339 351 am335x_tsc_se_clr(adc_dev->mfd_tscadc, adc_dev->buffer_en_ch_steps); 340 352 adc_dev->buffer_en_ch_steps = 0; 341 353 adc_dev->total_ch_enabled = 0; ··· 368 378 }; 369 379 370 380 static int tiadc_iio_buffered_hardware_setup(struct device *dev, 371 - struct iio_dev *indio_dev, 372 - irqreturn_t (*pollfunc_bh)(int irq, void *p), 373 - irqreturn_t (*pollfunc_th)(int irq, void *p), 374 - int irq, 375 - unsigned long flags, 376 - const struct iio_buffer_setup_ops *setup_ops) 381 + struct iio_dev *indio_dev, 382 + irqreturn_t (*pollfunc_bh)(int irq, void *p), 383 + irqreturn_t (*pollfunc_th)(int irq, void *p), 384 + int irq, unsigned long flags, 385 + const struct iio_buffer_setup_ops *setup_ops) 377 386 { 378 387 int ret; 379 388 ··· 383 394 return ret; 384 395 385 396 return devm_request_threaded_irq(dev, irq, pollfunc_th, pollfunc_bh, 386 - flags, indio_dev->name, indio_dev); 397 + flags, indio_dev->name, indio_dev); 387 398 } 388 399 389 400 static const char * const chan_name_ain[] = { ··· 408 419 indio_dev->num_channels = channels; 409 420 chan_array = devm_kcalloc(dev, channels, sizeof(*chan_array), 410 421 GFP_KERNEL); 411 - if (chan_array == NULL) 422 + if (!chan_array) 412 423 return -ENOMEM; 413 424 414 425 chan = chan_array; 415 426 for (i = 0; i < channels; i++, chan++) { 416 - 417 427 chan->type = IIO_VOLTAGE; 418 428 chan->indexed = 1; 419 429 chan->channel = adc_dev->channel_line[i]; 420 430 chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW); 431 + chan->info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE); 421 432 chan->datasheet_name = chan_name_ain[chan->channel]; 422 433 chan->scan_index = i; 423 434 chan->scan_type.sign = 'u'; ··· 431 442 } 432 443 433 444 static int tiadc_read_raw(struct iio_dev *indio_dev, 434 - struct iio_chan_spec const *chan, 435 - int *val, int *val2, long mask) 445 + struct iio_chan_spec const *chan, int *val, int *val2, 446 + long mask) 436 447 { 437 448 struct tiadc_device *adc_dev = iio_priv(indio_dev); 438 - int ret = IIO_VAL_INT; 439 449 int i, map_val; 440 450 unsigned int fifo1count, read, stepid; 441 451 bool found = false; 442 452 u32 step_en; 443 453 unsigned long timeout; 454 + int ret; 455 + 456 + switch (mask) { 457 + case IIO_CHAN_INFO_RAW: 458 + break; 459 + case IIO_CHAN_INFO_SCALE: 460 + switch (chan->type) { 461 + case IIO_VOLTAGE: 462 + *val = 1800; 463 + *val2 = chan->scan_type.realbits; 464 + return IIO_VAL_FRACTIONAL_LOG2; 465 + default: 466 + return -EINVAL; 467 + } 468 + break; 469 + default: 470 + return -EINVAL; 471 + } 444 472 445 473 if (iio_buffer_enabled(indio_dev)) 446 474 return -EBUSY; ··· 467 461 return -EINVAL; 468 462 469 463 mutex_lock(&adc_dev->fifo1_lock); 464 + 465 + ret = tiadc_wait_idle(adc_dev); 466 + if (ret) 467 + goto err_unlock; 468 + 470 469 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); 471 470 while (fifo1count--) 472 471 tiadc_readl(adc_dev, REG_FIFO1); 473 472 474 473 am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en); 475 474 476 - timeout = jiffies + msecs_to_jiffies 477 - (IDLE_TIMEOUT * adc_dev->channels); 478 475 /* Wait for Fifo threshold interrupt */ 476 + timeout = jiffies + msecs_to_jiffies(IDLE_TIMEOUT_MS * adc_dev->channels); 479 477 while (1) { 480 478 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); 481 479 if (fifo1count) ··· 491 481 goto err_unlock; 492 482 } 493 483 } 484 + 494 485 map_val = adc_dev->channel_step[chan->scan_index]; 495 486 496 487 /* ··· 509 498 if (stepid == map_val) { 510 499 read = read & FIFOREAD_DATA_MASK; 511 500 found = true; 512 - *val = (u16) read; 501 + *val = (u16)read; 513 502 } 514 503 } 504 + 515 505 am335x_tsc_se_adc_done(adc_dev->mfd_tscadc); 516 506 517 507 if (!found) 518 - ret = -EBUSY; 508 + ret = -EBUSY; 519 509 520 510 err_unlock: 521 511 mutex_unlock(&adc_dev->fifo1_lock); 522 - return ret; 512 + return ret ? ret : IIO_VAL_INT; 523 513 } 524 514 525 515 static const struct iio_info tiadc_info = { ··· 557 545 goto err; 558 546 559 547 return 0; 548 + 560 549 err: 561 550 dma_release_channel(dma->chan); 562 551 return -ENOMEM; ··· 571 558 const __be32 *cur; 572 559 int channels = 0; 573 560 u32 val; 561 + int i; 574 562 575 563 of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) { 576 564 adc_dev->channel_line[channels] = val; ··· 584 570 channels++; 585 571 } 586 572 573 + adc_dev->channels = channels; 574 + 587 575 of_property_read_u32_array(node, "ti,chan-step-avg", 588 576 adc_dev->step_avg, channels); 589 577 of_property_read_u32_array(node, "ti,chan-step-opendelay", ··· 593 577 of_property_read_u32_array(node, "ti,chan-step-sampledelay", 594 578 adc_dev->sample_delay, channels); 595 579 596 - adc_dev->channels = channels; 580 + for (i = 0; i < adc_dev->channels; i++) { 581 + int chan; 582 + 583 + chan = adc_dev->channel_line[i]; 584 + 585 + if (adc_dev->step_avg[i] > STEPCONFIG_AVG_16) { 586 + dev_warn(&pdev->dev, 587 + "chan %d: wrong step avg, truncated to %ld\n", 588 + chan, STEPCONFIG_AVG_16); 589 + adc_dev->step_avg[i] = STEPCONFIG_AVG_16; 590 + } 591 + 592 + if (adc_dev->open_delay[i] > STEPCONFIG_MAX_OPENDLY) { 593 + dev_warn(&pdev->dev, 594 + "chan %d: wrong open delay, truncated to 0x%lX\n", 595 + chan, STEPCONFIG_MAX_OPENDLY); 596 + adc_dev->open_delay[i] = STEPCONFIG_MAX_OPENDLY; 597 + } 598 + 599 + if (adc_dev->sample_delay[i] > STEPCONFIG_MAX_SAMPLE) { 600 + dev_warn(&pdev->dev, 601 + "chan %d: wrong sample delay, truncated to 0x%lX\n", 602 + chan, STEPCONFIG_MAX_SAMPLE); 603 + adc_dev->sample_delay[i] = STEPCONFIG_MAX_SAMPLE; 604 + } 605 + } 606 + 597 607 return 0; 598 608 } 599 609 ··· 636 594 } 637 595 638 596 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); 639 - if (indio_dev == NULL) { 597 + if (!indio_dev) { 640 598 dev_err(&pdev->dev, "failed to allocate iio device\n"); 641 599 return -ENOMEM; 642 600 } ··· 658 616 return err; 659 617 660 618 err = tiadc_iio_buffered_hardware_setup(&pdev->dev, indio_dev, 661 - &tiadc_worker_h, 662 - &tiadc_irq_h, 663 - adc_dev->mfd_tscadc->irq, 664 - IRQF_SHARED, 665 - &tiadc_buffer_setup_ops); 666 - 619 + &tiadc_worker_h, 620 + &tiadc_irq_h, 621 + adc_dev->mfd_tscadc->irq, 622 + IRQF_SHARED, 623 + &tiadc_buffer_setup_ops); 667 624 if (err) 668 - goto err_free_channels; 625 + return err; 669 626 670 627 err = iio_device_register(indio_dev); 671 628 if (err) 672 - goto err_buffer_unregister; 629 + return err; 673 630 674 631 platform_set_drvdata(pdev, indio_dev); 675 632 ··· 680 639 681 640 err_dma: 682 641 iio_device_unregister(indio_dev); 683 - err_buffer_unregister: 684 - err_free_channels: 642 + 685 643 return err; 686 644 } 687 645 ··· 711 671 unsigned int idle; 712 672 713 673 idle = tiadc_readl(adc_dev, REG_CTRL); 714 - idle &= ~(CNTRLREG_TSCSSENB); 715 - tiadc_writel(adc_dev, REG_CTRL, (idle | 716 - CNTRLREG_POWERDOWN)); 674 + idle &= ~(CNTRLREG_SSENB); 675 + tiadc_writel(adc_dev, REG_CTRL, idle | CNTRLREG_POWERDOWN); 717 676 718 677 return 0; 719 678 } ··· 725 686 726 687 /* Make sure ADC is powered up */ 727 688 restore = tiadc_readl(adc_dev, REG_CTRL); 728 - restore &= ~(CNTRLREG_POWERDOWN); 689 + restore &= ~CNTRLREG_POWERDOWN; 729 690 tiadc_writel(adc_dev, REG_CTRL, restore); 730 691 731 692 tiadc_step_config(indio_dev); 732 693 am335x_tsc_se_set_cache(adc_dev->mfd_tscadc, 733 - adc_dev->buffer_en_ch_steps); 694 + adc_dev->buffer_en_ch_steps); 734 695 return 0; 735 696 } 736 697 ··· 738 699 739 700 static const struct of_device_id ti_adc_dt_ids[] = { 740 701 { .compatible = "ti,am3359-adc", }, 702 + { .compatible = "ti,am4372-adc", }, 741 703 { } 742 704 }; 743 705 MODULE_DEVICE_TABLE(of, ti_adc_dt_ids);
+6 -17
drivers/mfd/Kconfig
··· 93 93 bool "Analog Devices ADP5520/01 MFD PMIC Core Support" 94 94 depends on I2C=y 95 95 help 96 - Say yes here to add support for Analog Devices AD5520 and ADP5501, 96 + Say yes here to add support for Analog Devices ADP5520 and ADP5501, 97 97 Multifunction Power Management IC. This includes 98 98 the I2C driver and the core APIs _only_, you have to select 99 99 individual components like LCD backlight, LEDs, GPIOs and Kepad ··· 417 417 select REGMAP_MMIO 418 418 help 419 419 Select this option to enable support for Samsung Exynos Low Power 420 - Audio Subsystem. 420 + Audio Subsystem present on some of Samsung Exynos 421 + SoCs (e.g. Exynos5433). 422 + Choose Y here only if you build for such Samsung SoC. 421 423 422 424 config MFD_GATEWORKS_GSC 423 425 tristate "Gateworks System Controller" ··· 694 692 695 693 config MFD_INTEL_PMT 696 694 tristate "Intel Platform Monitoring Technology (PMT) support" 697 - depends on PCI 695 + depends on X86 && PCI 698 696 select MFD_CORE 699 697 help 700 698 The Intel Platform Monitoring Technology (PMT) is an interface that ··· 1196 1194 config MFD_SIMPLE_MFD_I2C 1197 1195 tristate 1198 1196 depends on I2C 1197 + select MFD_CORE 1199 1198 select REGMAP_I2C 1200 1199 help 1201 1200 This driver creates a single register map with the intention for it ··· 1624 1621 help 1625 1622 If you say yes here you get support for the TPS65912 series of 1626 1623 PM chips with SPI interface. 1627 - 1628 - config MFD_TPS80031 1629 - bool "TI TPS80031/TPS80032 Power Management chips" 1630 - depends on I2C=y 1631 - select MFD_CORE 1632 - select REGMAP_I2C 1633 - select REGMAP_IRQ 1634 - help 1635 - If you say yes here you get support for the Texas Instruments 1636 - TPS80031/ TPS80032 Fully Integrated Power Management with Power 1637 - Path and Battery Charger. The device provides five configurable 1638 - step-down converters, 11 general purpose LDOs, USB OTG Module, 1639 - ADC, RTC, 2 PWM, System Voltage Regulator/Battery Charger with 1640 - Power Path from USB, 32K clock generator. 1641 1624 1642 1625 config TWL4030_CORE 1643 1626 bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-1
drivers/mfd/Makefile
··· 105 105 obj-$(CONFIG_MFD_TPS65912) += tps65912-core.o 106 106 obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o 107 107 obj-$(CONFIG_MFD_TPS65912_SPI) += tps65912-spi.o 108 - obj-$(CONFIG_MFD_TPS80031) += tps80031.o 109 108 obj-$(CONFIG_MENELAUS) += menelaus.o 110 109 111 110 obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
+9
drivers/mfd/altera-a10sr.c
··· 14 14 #include <linux/mfd/altera-a10sr.h> 15 15 #include <linux/mfd/core.h> 16 16 #include <linux/init.h> 17 + #include <linux/module.h> 17 18 #include <linux/of.h> 18 19 #include <linux/spi/spi.h> 19 20 ··· 151 150 { .compatible = "altr,a10sr" }, 152 151 { }, 153 152 }; 153 + MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match); 154 + 155 + static const struct spi_device_id altr_a10sr_spi_ids[] = { 156 + { .name = "a10sr" }, 157 + { }, 158 + }; 159 + MODULE_DEVICE_TABLE(spi, altr_a10sr_spi_ids); 154 160 155 161 static struct spi_driver altr_a10sr_spi_driver = { 156 162 .probe = altr_a10sr_spi_probe, ··· 165 157 .name = "altr_a10sr", 166 158 .of_match_table = of_match_ptr(altr_a10sr_spi_of_match), 167 159 }, 160 + .id_table = altr_a10sr_spi_ids, 168 161 }; 169 162 builtin_driver(altr_a10sr_spi_driver, spi_register_driver)
+1 -1
drivers/mfd/altera-sysmgr.c
··· 153 153 if (!base) 154 154 return -ENOMEM; 155 155 156 - sysmgr_config.max_register = resource_size(res) - 3; 156 + sysmgr_config.max_register = resource_size(res) - 4; 157 157 regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config); 158 158 } 159 159
-13
drivers/mfd/arizona-core.c
··· 845 845 846 846 return 0; 847 847 } 848 - 849 - const struct of_device_id arizona_of_match[] = { 850 - { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, 851 - { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, 852 - { .compatible = "wlf,wm8280", .data = (void *)WM8280 }, 853 - { .compatible = "wlf,wm8997", .data = (void *)WM8997 }, 854 - { .compatible = "wlf,wm8998", .data = (void *)WM8998 }, 855 - { .compatible = "wlf,wm1814", .data = (void *)WM1814 }, 856 - { .compatible = "wlf,wm1831", .data = (void *)WM1831 }, 857 - { .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 }, 858 - {}, 859 - }; 860 - EXPORT_SYMBOL_GPL(arizona_of_match); 861 848 #else 862 849 static inline int arizona_of_get_core_pdata(struct arizona *arizona) 863 850 {
+13 -1
drivers/mfd/arizona-i2c.c
··· 104 104 }; 105 105 MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); 106 106 107 + #ifdef CONFIG_OF 108 + const struct of_device_id arizona_i2c_of_match[] = { 109 + { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, 110 + { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, 111 + { .compatible = "wlf,wm8280", .data = (void *)WM8280 }, 112 + { .compatible = "wlf,wm8997", .data = (void *)WM8997 }, 113 + { .compatible = "wlf,wm8998", .data = (void *)WM8998 }, 114 + { .compatible = "wlf,wm1814", .data = (void *)WM1814 }, 115 + {}, 116 + }; 117 + #endif 118 + 107 119 static struct i2c_driver arizona_i2c_driver = { 108 120 .driver = { 109 121 .name = "arizona", 110 122 .pm = &arizona_pm_ops, 111 - .of_match_table = of_match_ptr(arizona_of_match), 123 + .of_match_table = of_match_ptr(arizona_i2c_of_match), 112 124 }, 113 125 .probe = arizona_i2c_probe, 114 126 .remove = arizona_i2c_remove,
+12 -1
drivers/mfd/arizona-spi.c
··· 225 225 }; 226 226 MODULE_DEVICE_TABLE(spi, arizona_spi_ids); 227 227 228 + #ifdef CONFIG_OF 229 + const struct of_device_id arizona_spi_of_match[] = { 230 + { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, 231 + { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, 232 + { .compatible = "wlf,wm8280", .data = (void *)WM8280 }, 233 + { .compatible = "wlf,wm1831", .data = (void *)WM1831 }, 234 + { .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 }, 235 + {}, 236 + }; 237 + #endif 238 + 228 239 static struct spi_driver arizona_spi_driver = { 229 240 .driver = { 230 241 .name = "arizona", 231 242 .pm = &arizona_pm_ops, 232 - .of_match_table = of_match_ptr(arizona_of_match), 243 + .of_match_table = of_match_ptr(arizona_spi_of_match), 233 244 .acpi_match_table = ACPI_PTR(arizona_acpi_match), 234 245 }, 235 246 .probe = arizona_spi_probe,
-2
drivers/mfd/arizona.h
··· 28 28 29 29 extern const struct dev_pm_ops arizona_pm_ops; 30 30 31 - extern const struct of_device_id arizona_of_match[]; 32 - 33 31 extern const struct regmap_irq_chip wm5102_aod; 34 32 extern const struct regmap_irq_chip wm5102_irq; 35 33
-1
drivers/mfd/cros_ec_dev.c
··· 326 326 module_init(cros_ec_dev_init); 327 327 module_exit(cros_ec_dev_exit); 328 328 329 - MODULE_ALIAS("platform:" DRV_NAME); 330 329 MODULE_AUTHOR("Bill Richardson <wfrichar@chromium.org>"); 331 330 MODULE_DESCRIPTION("Userspace interface to the Chrome OS Embedded Controller"); 332 331 MODULE_VERSION("1.0");
+2
drivers/mfd/da9063-i2c.c
··· 391 391 &da9063_bb_da_volatile_table; 392 392 break; 393 393 case PMIC_DA9063_DA: 394 + case PMIC_DA9063_EA: 394 395 da9063_regmap_config.rd_table = 395 396 &da9063_da_readable_table; 396 397 da9063_regmap_config.wr_table = ··· 417 416 &da9063l_bb_da_volatile_table; 418 417 break; 419 418 case PMIC_DA9063_DA: 419 + case PMIC_DA9063_EA: 420 420 da9063_regmap_config.rd_table = 421 421 &da9063l_da_readable_table; 422 422 da9063_regmap_config.wr_table =
+18
drivers/mfd/dln2.c
··· 50 50 DLN2_HANDLE_GPIO, 51 51 DLN2_HANDLE_I2C, 52 52 DLN2_HANDLE_SPI, 53 + DLN2_HANDLE_ADC, 53 54 DLN2_HANDLES 54 55 }; 55 56 ··· 654 653 DLN2_ACPI_MATCH_GPIO = 0, 655 654 DLN2_ACPI_MATCH_I2C = 1, 656 655 DLN2_ACPI_MATCH_SPI = 2, 656 + DLN2_ACPI_MATCH_ADC = 3, 657 657 }; 658 658 659 659 static struct dln2_platform_data dln2_pdata_gpio = { ··· 685 683 .adr = DLN2_ACPI_MATCH_SPI, 686 684 }; 687 685 686 + /* Only one ADC port supported */ 687 + static struct dln2_platform_data dln2_pdata_adc = { 688 + .handle = DLN2_HANDLE_ADC, 689 + .port = 0, 690 + }; 691 + 692 + static struct mfd_cell_acpi_match dln2_acpi_match_adc = { 693 + .adr = DLN2_ACPI_MATCH_ADC, 694 + }; 695 + 688 696 static const struct mfd_cell dln2_devs[] = { 689 697 { 690 698 .name = "dln2-gpio", ··· 712 700 .name = "dln2-spi", 713 701 .acpi_match = &dln2_acpi_match_spi, 714 702 .platform_data = &dln2_pdata_spi, 703 + .pdata_size = sizeof(struct dln2_platform_data), 704 + }, 705 + { 706 + .name = "dln2-adc", 707 + .acpi_match = &dln2_acpi_match_adc, 708 + .platform_data = &dln2_pdata_adc, 715 709 .pdata_size = sizeof(struct dln2_platform_data), 716 710 }, 717 711 };
+5 -11
drivers/mfd/hi6421-spmi-pmic.c
··· 8 8 */ 9 9 10 10 #include <linux/mfd/core.h> 11 - #include <linux/mfd/hi6421-spmi-pmic.h> 12 11 #include <linux/module.h> 13 12 #include <linux/platform_device.h> 14 13 #include <linux/regmap.h> ··· 29 30 static int hi6421_spmi_pmic_probe(struct spmi_device *sdev) 30 31 { 31 32 struct device *dev = &sdev->dev; 33 + struct regmap *regmap; 32 34 int ret; 33 - struct hi6421_spmi_pmic *ddata; 34 - ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); 35 - if (!ddata) 36 - return -ENOMEM; 37 35 38 - ddata->regmap = devm_regmap_init_spmi_ext(sdev, &regmap_config); 39 - if (IS_ERR(ddata->regmap)) 40 - return PTR_ERR(ddata->regmap); 36 + regmap = devm_regmap_init_spmi_ext(sdev, &regmap_config); 37 + if (IS_ERR(regmap)) 38 + return PTR_ERR(regmap); 41 39 42 - ddata->dev = dev; 43 - 44 - dev_set_drvdata(&sdev->dev, ddata); 40 + dev_set_drvdata(&sdev->dev, regmap); 45 41 46 42 ret = devm_mfd_add_devices(&sdev->dev, PLATFORM_DEVID_NONE, 47 43 hi6421v600_devs, ARRAY_SIZE(hi6421v600_devs),
+2
drivers/mfd/intel-lpss-pci.c
··· 253 253 { PCI_VDEVICE(INTEL, 0x34ea), (kernel_ulong_t)&bxt_i2c_info }, 254 254 { PCI_VDEVICE(INTEL, 0x34eb), (kernel_ulong_t)&bxt_i2c_info }, 255 255 { PCI_VDEVICE(INTEL, 0x34fb), (kernel_ulong_t)&spt_info }, 256 + /* ICL-N */ 257 + { PCI_VDEVICE(INTEL, 0x38a8), (kernel_ulong_t)&bxt_uart_info }, 256 258 /* TGL-H */ 257 259 { PCI_VDEVICE(INTEL, 0x43a7), (kernel_ulong_t)&bxt_uart_info }, 258 260 { PCI_VDEVICE(INTEL, 0x43a8), (kernel_ulong_t)&bxt_uart_info },
+1 -1
drivers/mfd/janz-cmodio.c
··· 154 154 { 155 155 struct cmodio_device *priv = dev_get_drvdata(dev); 156 156 157 - return snprintf(buf, PAGE_SIZE, "%x\n", priv->hex); 157 + return sysfs_emit(buf, "%x\n", priv->hex); 158 158 } 159 159 160 160 static DEVICE_ATTR_RO(modulbus_number);
+3 -3
drivers/mfd/max14577.c
··· 332 332 } 333 333 334 334 ret = regmap_add_irq_chip(max14577->regmap_pmic, max14577->irq, 335 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_SHARED, 335 + IRQF_ONESHOT | IRQF_SHARED, 336 336 0, &max77836_pmic_irq_chip, 337 337 &max14577->irq_data_pmic); 338 338 if (ret != 0) { ··· 418 418 irq_chip = &max77836_muic_irq_chip; 419 419 mfd_devs = max77836_devs; 420 420 mfd_devs_size = ARRAY_SIZE(max77836_devs); 421 - irq_flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_SHARED; 421 + irq_flags = IRQF_ONESHOT | IRQF_SHARED; 422 422 break; 423 423 case MAXIM_DEVICE_TYPE_MAX14577: 424 424 default: 425 425 irq_chip = &max14577_irq_chip; 426 426 mfd_devs = max14577_devs; 427 427 mfd_devs_size = ARRAY_SIZE(max14577_devs); 428 - irq_flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; 428 + irq_flags = IRQF_ONESHOT; 429 429 break; 430 430 } 431 431
+1 -2
drivers/mfd/max77686.c
··· 209 209 210 210 ret = devm_regmap_add_irq_chip(&i2c->dev, max77686->regmap, 211 211 max77686->irq, 212 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | 213 - IRQF_SHARED, 0, irq_chip, 212 + IRQF_ONESHOT | IRQF_SHARED, 0, irq_chip, 214 213 &max77686->irq_data); 215 214 if (ret < 0) { 216 215 dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret);
+4 -8
drivers/mfd/max77693.c
··· 222 222 } 223 223 224 224 ret = regmap_add_irq_chip(max77693->regmap, max77693->irq, 225 - IRQF_ONESHOT | IRQF_SHARED | 226 - IRQF_TRIGGER_FALLING, 0, 225 + IRQF_ONESHOT | IRQF_SHARED, 0, 227 226 &max77693_led_irq_chip, 228 227 &max77693->irq_data_led); 229 228 if (ret) { ··· 231 232 } 232 233 233 234 ret = regmap_add_irq_chip(max77693->regmap, max77693->irq, 234 - IRQF_ONESHOT | IRQF_SHARED | 235 - IRQF_TRIGGER_FALLING, 0, 235 + IRQF_ONESHOT | IRQF_SHARED, 0, 236 236 &max77693_topsys_irq_chip, 237 237 &max77693->irq_data_topsys); 238 238 if (ret) { ··· 240 242 } 241 243 242 244 ret = regmap_add_irq_chip(max77693->regmap, max77693->irq, 243 - IRQF_ONESHOT | IRQF_SHARED | 244 - IRQF_TRIGGER_FALLING, 0, 245 + IRQF_ONESHOT | IRQF_SHARED, 0, 245 246 &max77693_charger_irq_chip, 246 247 &max77693->irq_data_chg); 247 248 if (ret) { ··· 249 252 } 250 253 251 254 ret = regmap_add_irq_chip(max77693->regmap_muic, max77693->irq, 252 - IRQF_ONESHOT | IRQF_SHARED | 253 - IRQF_TRIGGER_FALLING, 0, 255 + IRQF_ONESHOT | IRQF_SHARED, 0, 254 256 &max77693_muic_irq_chip, 255 257 &max77693->irq_data_muic); 256 258 if (ret) {
+1 -3
drivers/mfd/mc13xxx-core.c
··· 496 496 } 497 497 EXPORT_SYMBOL_GPL(mc13xxx_common_init); 498 498 499 - int mc13xxx_common_exit(struct device *dev) 499 + void mc13xxx_common_exit(struct device *dev) 500 500 { 501 501 struct mc13xxx *mc13xxx = dev_get_drvdata(dev); 502 502 503 503 mfd_remove_devices(dev); 504 504 regmap_del_irq_chip(mc13xxx->irq, mc13xxx->irq_data); 505 505 mutex_destroy(&mc13xxx->lock); 506 - 507 - return 0; 508 506 } 509 507 EXPORT_SYMBOL_GPL(mc13xxx_common_exit); 510 508
+2 -1
drivers/mfd/mc13xxx-i2c.c
··· 87 87 88 88 static int mc13xxx_i2c_remove(struct i2c_client *client) 89 89 { 90 - return mc13xxx_common_exit(&client->dev); 90 + mc13xxx_common_exit(&client->dev); 91 + return 0; 91 92 } 92 93 93 94 static struct i2c_driver mc13xxx_i2c_driver = {
+2 -1
drivers/mfd/mc13xxx-spi.c
··· 168 168 169 169 static int mc13xxx_spi_remove(struct spi_device *spi) 170 170 { 171 - return mc13xxx_common_exit(&spi->dev); 171 + mc13xxx_common_exit(&spi->dev); 172 + return 0; 172 173 } 173 174 174 175 static struct spi_driver mc13xxx_spi_driver = {
+1 -1
drivers/mfd/mc13xxx.h
··· 44 44 }; 45 45 46 46 int mc13xxx_common_init(struct device *dev); 47 - int mc13xxx_common_exit(struct device *dev); 47 + void mc13xxx_common_exit(struct device *dev); 48 48 49 49 #endif /* __DRIVERS_MFD_MC13XXX_H */
+2
drivers/mfd/mfd-core.c
··· 198 198 if (of_device_is_compatible(np, cell->of_compatible)) { 199 199 /* Ignore 'disabled' devices error free */ 200 200 if (!of_device_is_available(np)) { 201 + of_node_put(np); 201 202 ret = 0; 202 203 goto fail_alias; 203 204 } ··· 206 205 ret = mfd_match_of_node_to_dev(pdev, np, cell); 207 206 if (ret == -EAGAIN) 208 207 continue; 208 + of_node_put(np); 209 209 if (ret) 210 210 goto fail_alias; 211 211
+8
drivers/mfd/motorola-cpcap.c
··· 202 202 }; 203 203 MODULE_DEVICE_TABLE(of, cpcap_of_match); 204 204 205 + static const struct spi_device_id cpcap_spi_ids[] = { 206 + { .name = "cpcap", }, 207 + { .name = "6556002", }, 208 + {}, 209 + }; 210 + MODULE_DEVICE_TABLE(spi, cpcap_spi_ids); 211 + 205 212 static const struct regmap_config cpcap_regmap_config = { 206 213 .reg_bits = 16, 207 214 .reg_stride = 4, ··· 349 342 .pm = &cpcap_pm, 350 343 }, 351 344 .probe = cpcap_probe, 345 + .id_table = cpcap_spi_ids, 352 346 }; 353 347 module_spi_driver(cpcap_driver); 354 348
+16 -23
drivers/mfd/qcom-pm8xxx.c
··· 65 65 struct pm_irq_data { 66 66 int num_irqs; 67 67 struct irq_chip *irq_chip; 68 - void (*irq_handler)(struct irq_desc *desc); 68 + irq_handler_t irq_handler; 69 69 }; 70 70 71 71 struct pm_irq_chip { ··· 169 169 return ret; 170 170 } 171 171 172 - static void pm8xxx_irq_handler(struct irq_desc *desc) 172 + static irqreturn_t pm8xxx_irq_handler(int irq, void *data) 173 173 { 174 - struct pm_irq_chip *chip = irq_desc_get_handler_data(desc); 175 - struct irq_chip *irq_chip = irq_desc_get_chip(desc); 174 + struct pm_irq_chip *chip = data; 176 175 unsigned int root; 177 176 int i, ret, masters = 0; 178 - 179 - chained_irq_enter(irq_chip, desc); 180 177 181 178 ret = regmap_read(chip->regmap, SSBI_REG_ADDR_IRQ_ROOT, &root); 182 179 if (ret) { 183 180 pr_err("Can't read root status ret=%d\n", ret); 184 - return; 181 + return IRQ_NONE; 185 182 } 186 183 187 184 /* on pm8xxx series masters start from bit 1 of the root */ ··· 189 192 if (masters & (1 << i)) 190 193 pm8xxx_irq_master_handler(chip, i); 191 194 192 - chained_irq_exit(irq_chip, desc); 195 + return IRQ_HANDLED; 193 196 } 194 197 195 198 static void pm8821_irq_block_handler(struct pm_irq_chip *chip, ··· 227 230 pm8821_irq_block_handler(chip, master, block); 228 231 } 229 232 230 - static void pm8821_irq_handler(struct irq_desc *desc) 233 + static irqreturn_t pm8821_irq_handler(int irq, void *data) 231 234 { 232 - struct pm_irq_chip *chip = irq_desc_get_handler_data(desc); 233 - struct irq_chip *irq_chip = irq_desc_get_chip(desc); 235 + struct pm_irq_chip *chip = data; 234 236 unsigned int master; 235 237 int ret; 236 238 237 - chained_irq_enter(irq_chip, desc); 238 239 ret = regmap_read(chip->regmap, 239 240 PM8821_SSBI_REG_ADDR_IRQ_MASTER0, &master); 240 241 if (ret) { 241 242 pr_err("Failed to read master 0 ret=%d\n", ret); 242 - goto done; 243 + return IRQ_NONE; 243 244 } 244 245 245 246 /* bits 1 through 7 marks the first 7 blocks in master 0 */ ··· 246 251 247 252 /* bit 0 marks if master 1 contains any bits */ 248 253 if (!(master & BIT(0))) 249 - goto done; 254 + return IRQ_NONE; 250 255 251 256 ret = regmap_read(chip->regmap, 252 257 PM8821_SSBI_REG_ADDR_IRQ_MASTER1, &master); 253 258 if (ret) { 254 259 pr_err("Failed to read master 1 ret=%d\n", ret); 255 - goto done; 260 + return IRQ_NONE; 256 261 } 257 262 258 263 pm8821_irq_master_handler(chip, 1, master); 259 264 260 - done: 261 - chained_irq_exit(irq_chip, desc); 265 + return IRQ_HANDLED; 262 266 } 263 267 264 268 static void pm8xxx_irq_mask_ack(struct irq_data *d) ··· 568 574 if (!chip->irqdomain) 569 575 return -ENODEV; 570 576 571 - irq_set_chained_handler_and_data(irq, data->irq_handler, chip); 577 + rc = devm_request_irq(&pdev->dev, irq, data->irq_handler, 0, dev_name(&pdev->dev), chip); 578 + if (rc) 579 + return rc; 580 + 572 581 irq_set_irq_wake(irq, 1); 573 582 574 583 rc = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); 575 - if (rc) { 576 - irq_set_chained_handler_and_data(irq, NULL, NULL); 584 + if (rc) 577 585 irq_domain_remove(chip->irqdomain); 578 - } 579 586 580 587 return rc; 581 588 } ··· 589 594 590 595 static int pm8xxx_remove(struct platform_device *pdev) 591 596 { 592 - int irq = platform_get_irq(pdev, 0); 593 597 struct pm_irq_chip *chip = platform_get_drvdata(pdev); 594 598 595 599 device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child); 596 - irq_set_chained_handler_and_data(irq, NULL, NULL); 597 600 irq_domain_remove(chip->irqdomain); 598 601 599 602 return 0;
+37 -20
drivers/mfd/qcom-spmi-pmic.c
··· 31 31 #define PM8916_SUBTYPE 0x0b 32 32 #define PM8004_SUBTYPE 0x0c 33 33 #define PM8909_SUBTYPE 0x0d 34 + #define PM8028_SUBTYPE 0x0e 35 + #define PM8901_SUBTYPE 0x0f 34 36 #define PM8950_SUBTYPE 0x10 35 37 #define PMI8950_SUBTYPE 0x11 36 38 #define PM8998_SUBTYPE 0x14 ··· 40 38 #define PM8005_SUBTYPE 0x18 41 39 #define PM660L_SUBTYPE 0x1A 42 40 #define PM660_SUBTYPE 0x1B 41 + #define PM8150_SUBTYPE 0x1E 42 + #define PM8150L_SUBTYPE 0x1f 43 + #define PM8150B_SUBTYPE 0x20 44 + #define PMK8002_SUBTYPE 0x21 45 + #define PM8009_SUBTYPE 0x24 46 + #define PM8150C_SUBTYPE 0x26 47 + #define SMB2351_SUBTYPE 0x29 43 48 44 49 static const struct of_device_id pmic_spmi_id_table[] = { 45 - { .compatible = "qcom,spmi-pmic", .data = (void *)COMMON_SUBTYPE }, 46 - { .compatible = "qcom,pm8941", .data = (void *)PM8941_SUBTYPE }, 47 - { .compatible = "qcom,pm8841", .data = (void *)PM8841_SUBTYPE }, 48 - { .compatible = "qcom,pm8019", .data = (void *)PM8019_SUBTYPE }, 49 - { .compatible = "qcom,pm8226", .data = (void *)PM8226_SUBTYPE }, 50 - { .compatible = "qcom,pm8110", .data = (void *)PM8110_SUBTYPE }, 51 - { .compatible = "qcom,pma8084", .data = (void *)PMA8084_SUBTYPE }, 52 - { .compatible = "qcom,pmi8962", .data = (void *)PMI8962_SUBTYPE }, 53 - { .compatible = "qcom,pmd9635", .data = (void *)PMD9635_SUBTYPE }, 54 - { .compatible = "qcom,pm8994", .data = (void *)PM8994_SUBTYPE }, 55 - { .compatible = "qcom,pmi8994", .data = (void *)PMI8994_SUBTYPE }, 56 - { .compatible = "qcom,pm8916", .data = (void *)PM8916_SUBTYPE }, 57 - { .compatible = "qcom,pm8004", .data = (void *)PM8004_SUBTYPE }, 58 - { .compatible = "qcom,pm8909", .data = (void *)PM8909_SUBTYPE }, 59 - { .compatible = "qcom,pm8950", .data = (void *)PM8950_SUBTYPE }, 60 - { .compatible = "qcom,pmi8950", .data = (void *)PMI8950_SUBTYPE }, 61 - { .compatible = "qcom,pm8998", .data = (void *)PM8998_SUBTYPE }, 62 - { .compatible = "qcom,pmi8998", .data = (void *)PMI8998_SUBTYPE }, 63 - { .compatible = "qcom,pm8005", .data = (void *)PM8005_SUBTYPE }, 64 - { .compatible = "qcom,pm660l", .data = (void *)PM660L_SUBTYPE }, 65 50 { .compatible = "qcom,pm660", .data = (void *)PM660_SUBTYPE }, 51 + { .compatible = "qcom,pm660l", .data = (void *)PM660L_SUBTYPE }, 52 + { .compatible = "qcom,pm8004", .data = (void *)PM8004_SUBTYPE }, 53 + { .compatible = "qcom,pm8005", .data = (void *)PM8005_SUBTYPE }, 54 + { .compatible = "qcom,pm8019", .data = (void *)PM8019_SUBTYPE }, 55 + { .compatible = "qcom,pm8028", .data = (void *)PM8028_SUBTYPE }, 56 + { .compatible = "qcom,pm8110", .data = (void *)PM8110_SUBTYPE }, 57 + { .compatible = "qcom,pm8150", .data = (void *)PM8150_SUBTYPE }, 58 + { .compatible = "qcom,pm8150b", .data = (void *)PM8150B_SUBTYPE }, 59 + { .compatible = "qcom,pm8150c", .data = (void *)PM8150C_SUBTYPE }, 60 + { .compatible = "qcom,pm8150l", .data = (void *)PM8150L_SUBTYPE }, 61 + { .compatible = "qcom,pm8226", .data = (void *)PM8226_SUBTYPE }, 62 + { .compatible = "qcom,pm8841", .data = (void *)PM8841_SUBTYPE }, 63 + { .compatible = "qcom,pm8901", .data = (void *)PM8901_SUBTYPE }, 64 + { .compatible = "qcom,pm8909", .data = (void *)PM8909_SUBTYPE }, 65 + { .compatible = "qcom,pm8916", .data = (void *)PM8916_SUBTYPE }, 66 + { .compatible = "qcom,pm8941", .data = (void *)PM8941_SUBTYPE }, 67 + { .compatible = "qcom,pm8950", .data = (void *)PM8950_SUBTYPE }, 68 + { .compatible = "qcom,pm8994", .data = (void *)PM8994_SUBTYPE }, 69 + { .compatible = "qcom,pm8998", .data = (void *)PM8998_SUBTYPE }, 70 + { .compatible = "qcom,pma8084", .data = (void *)PMA8084_SUBTYPE }, 71 + { .compatible = "qcom,pmd9635", .data = (void *)PMD9635_SUBTYPE }, 72 + { .compatible = "qcom,pmi8950", .data = (void *)PMI8950_SUBTYPE }, 73 + { .compatible = "qcom,pmi8962", .data = (void *)PMI8962_SUBTYPE }, 74 + { .compatible = "qcom,pmi8994", .data = (void *)PMI8994_SUBTYPE }, 75 + { .compatible = "qcom,pmi8998", .data = (void *)PMI8998_SUBTYPE }, 76 + { .compatible = "qcom,pmk8002", .data = (void *)PMK8002_SUBTYPE }, 77 + { .compatible = "qcom,smb2351", .data = (void *)SMB2351_SUBTYPE }, 78 + { .compatible = "qcom,spmi-pmic", .data = (void *)COMMON_SUBTYPE }, 66 79 { } 67 80 }; 68 81
+4
drivers/mfd/rk808.c
··· 543 543 reg = RK808_DEVCTRL_REG, 544 544 bit = DEV_OFF_RST; 545 545 break; 546 + case RK817_ID: 547 + reg = RK817_SYS_CFG(3); 548 + bit = DEV_OFF; 549 + break; 546 550 case RK818_ID: 547 551 reg = RK818_DEVCTRL_REG; 548 552 bit = DEV_OFF;
+1 -2
drivers/mfd/sec-irq.c
··· 479 479 } 480 480 481 481 ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, 482 - sec_pmic->irq, 483 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 482 + sec_pmic->irq, IRQF_ONESHOT, 484 483 0, sec_irq_chip, &sec_pmic->irq_data); 485 484 if (ret != 0) { 486 485 dev_err(sec_pmic->dev, "Failed to register IRQ chip: %d\n", ret);
+17
drivers/mfd/sprd-sc27xx-spi.c
··· 18 18 #define SPRD_PMIC_INT_RAW_STATUS 0x4 19 19 #define SPRD_PMIC_INT_EN 0x8 20 20 21 + #define SPRD_SC2730_IRQ_BASE 0x80 22 + #define SPRD_SC2730_IRQ_NUMS 10 23 + #define SPRD_SC2730_CHG_DET 0x1b9c 21 24 #define SPRD_SC2731_IRQ_BASE 0x140 22 25 #define SPRD_SC2731_IRQ_NUMS 16 23 26 #define SPRD_SC2731_CHG_DET 0xedc ··· 55 52 * base address and irq number, we should save irq number and irq base 56 53 * in the device data structure. 57 54 */ 55 + static const struct sprd_pmic_data sc2730_data = { 56 + .irq_base = SPRD_SC2730_IRQ_BASE, 57 + .num_irqs = SPRD_SC2730_IRQ_NUMS, 58 + .charger_det = SPRD_SC2730_CHG_DET, 59 + }; 60 + 58 61 static const struct sprd_pmic_data sc2731_data = { 59 62 .irq_base = SPRD_SC2731_IRQ_BASE, 60 63 .num_irqs = SPRD_SC2731_IRQ_NUMS, ··· 241 232 242 233 static const struct of_device_id sprd_pmic_match[] = { 243 234 { .compatible = "sprd,sc2731", .data = &sc2731_data }, 235 + { .compatible = "sprd,sc2730", .data = &sc2730_data }, 244 236 {}, 245 237 }; 246 238 MODULE_DEVICE_TABLE(of, sprd_pmic_match); 239 + 240 + static const struct spi_device_id sprd_pmic_spi_ids[] = { 241 + { .name = "sc2731", .driver_data = (unsigned long)&sc2731_data }, 242 + {}, 243 + }; 244 + MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids); 247 245 248 246 static struct spi_driver sprd_pmic_driver = { 249 247 .driver = { ··· 259 243 .pm = &sprd_pmic_pm_ops, 260 244 }, 261 245 .probe = sprd_pmic_probe, 246 + .id_table = sprd_pmic_spi_ids, 262 247 }; 263 248 264 249 static int __init sprd_pmic_init(void)
+3 -1
drivers/mfd/stmpe-i2c.c
··· 95 95 { 96 96 struct stmpe *stmpe = dev_get_drvdata(&i2c->dev); 97 97 98 - return stmpe_remove(stmpe); 98 + stmpe_remove(stmpe); 99 + 100 + return 0; 99 101 } 100 102 101 103 static const struct i2c_device_id stmpe_i2c_id[] = {
+3 -1
drivers/mfd/stmpe-spi.c
··· 106 106 { 107 107 struct stmpe *stmpe = spi_get_drvdata(spi); 108 108 109 - return stmpe_remove(stmpe); 109 + stmpe_remove(stmpe); 110 + 111 + return 0; 110 112 } 111 113 112 114 static const struct of_device_id stmpe_spi_of_match[] = {
+1 -3
drivers/mfd/stmpe.c
··· 1496 1496 return ret; 1497 1497 } 1498 1498 1499 - int stmpe_remove(struct stmpe *stmpe) 1499 + void stmpe_remove(struct stmpe *stmpe) 1500 1500 { 1501 1501 if (!IS_ERR(stmpe->vio)) 1502 1502 regulator_disable(stmpe->vio); ··· 1506 1506 __stmpe_disable(stmpe, STMPE_BLOCK_ADC); 1507 1507 1508 1508 mfd_remove_devices(stmpe->dev); 1509 - 1510 - return 0; 1511 1509 } 1512 1510 1513 1511 #ifdef CONFIG_PM
+1 -1
drivers/mfd/stmpe.h
··· 98 98 }; 99 99 100 100 int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum); 101 - int stmpe_remove(struct stmpe *stmpe); 101 + void stmpe_remove(struct stmpe *stmpe); 102 102 103 103 #define STMPE_ICR_LSB_HIGH (1 << 2) 104 104 #define STMPE_ICR_LSB_EDGE (1 << 1)
+149 -124
drivers/mfd/ti_am335x_tscadc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 1 2 /* 2 3 * TI Touch Screen / ADC MFD driver 3 4 * 4 5 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License as 8 - * published by the Free Software Foundation version 2. 9 - * 10 - * This program is distributed "as is" WITHOUT ANY WARRANTY of any 11 - * kind, whether express or implied; without even the implied warranty 12 - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 6 */ 15 7 16 8 #include <linux/module.h> ··· 105 113 { 106 114 unsigned int idleconfig; 107 115 108 - idleconfig = STEPCONFIG_YNN | STEPCONFIG_INM_ADCREFM | 109 - STEPCONFIG_INP_ADCREFM | STEPCONFIG_YPN; 116 + idleconfig = STEPCONFIG_INM_ADCREFM | STEPCONFIG_INP_ADCREFM; 117 + if (ti_adc_with_touchscreen(tscadc)) 118 + idleconfig |= STEPCONFIG_YNN | STEPCONFIG_YPN; 110 119 111 120 regmap_write(tscadc->regmap, REG_IDLECONFIG, idleconfig); 112 121 } 113 122 114 123 static int ti_tscadc_probe(struct platform_device *pdev) 115 124 { 116 - struct ti_tscadc_dev *tscadc; 117 - struct resource *res; 118 - struct clk *clk; 119 - struct device_node *node; 120 - struct mfd_cell *cell; 121 - struct property *prop; 122 - const __be32 *cur; 123 - u32 val; 124 - int err, ctrl; 125 - int clock_rate; 126 - int tsc_wires = 0, adc_channels = 0, total_channels; 127 - int readouts = 0; 128 - 129 - if (!pdev->dev.of_node) { 130 - dev_err(&pdev->dev, "Could not find valid DT data.\n"); 131 - return -EINVAL; 132 - } 133 - 134 - node = of_get_child_by_name(pdev->dev.of_node, "tsc"); 135 - of_property_read_u32(node, "ti,wires", &tsc_wires); 136 - of_property_read_u32(node, "ti,coordiante-readouts", &readouts); 137 - 138 - node = of_get_child_by_name(pdev->dev.of_node, "adc"); 139 - of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) { 140 - adc_channels++; 141 - if (val > 7) { 142 - dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n", 143 - val); 144 - return -EINVAL; 145 - } 146 - } 147 - total_channels = tsc_wires + adc_channels; 148 - if (total_channels > 8) { 149 - dev_err(&pdev->dev, "Number of i/p channels more than 8\n"); 150 - return -EINVAL; 151 - } 152 - if (total_channels == 0) { 153 - dev_err(&pdev->dev, "Need atleast one channel.\n"); 154 - return -EINVAL; 155 - } 156 - 157 - if (readouts * 2 + 2 + adc_channels > 16) { 158 - dev_err(&pdev->dev, "Too many step configurations requested\n"); 159 - return -EINVAL; 160 - } 125 + struct ti_tscadc_dev *tscadc; 126 + struct resource *res; 127 + struct clk *clk; 128 + struct device_node *node; 129 + struct mfd_cell *cell; 130 + struct property *prop; 131 + const __be32 *cur; 132 + bool use_tsc = false, use_mag = false; 133 + u32 val; 134 + int err; 135 + int tscmag_wires = 0, adc_channels = 0, cell_idx = 0, total_channels; 136 + int readouts = 0, mag_tracks = 0; 161 137 162 138 /* Allocate memory for device */ 163 139 tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL); ··· 134 174 135 175 tscadc->dev = &pdev->dev; 136 176 177 + if (!pdev->dev.of_node) { 178 + dev_err(&pdev->dev, "Could not find valid DT data.\n"); 179 + return -EINVAL; 180 + } 181 + 182 + tscadc->data = of_device_get_match_data(&pdev->dev); 183 + 184 + if (ti_adc_with_touchscreen(tscadc)) { 185 + node = of_get_child_by_name(pdev->dev.of_node, "tsc"); 186 + of_property_read_u32(node, "ti,wires", &tscmag_wires); 187 + err = of_property_read_u32(node, "ti,coordinate-readouts", 188 + &readouts); 189 + if (err < 0) 190 + of_property_read_u32(node, "ti,coordiante-readouts", 191 + &readouts); 192 + 193 + of_node_put(node); 194 + 195 + if (tscmag_wires) 196 + use_tsc = true; 197 + } else { 198 + /* 199 + * When adding support for the magnetic stripe reader, here is 200 + * the place to look for the number of tracks used from device 201 + * tree. Let's default to 0 for now. 202 + */ 203 + mag_tracks = 0; 204 + tscmag_wires = mag_tracks * 2; 205 + if (tscmag_wires) 206 + use_mag = true; 207 + } 208 + 209 + node = of_get_child_by_name(pdev->dev.of_node, "adc"); 210 + of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) { 211 + adc_channels++; 212 + if (val > 7) { 213 + dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n", 214 + val); 215 + of_node_put(node); 216 + return -EINVAL; 217 + } 218 + } 219 + 220 + of_node_put(node); 221 + 222 + total_channels = tscmag_wires + adc_channels; 223 + if (total_channels > 8) { 224 + dev_err(&pdev->dev, "Number of i/p channels more than 8\n"); 225 + return -EINVAL; 226 + } 227 + 228 + if (total_channels == 0) { 229 + dev_err(&pdev->dev, "Need at least one channel.\n"); 230 + return -EINVAL; 231 + } 232 + 233 + if (use_tsc && (readouts * 2 + 2 + adc_channels > 16)) { 234 + dev_err(&pdev->dev, "Too many step configurations requested\n"); 235 + return -EINVAL; 236 + } 237 + 137 238 err = platform_get_irq(pdev, 0); 138 239 if (err < 0) 139 - goto ret; 240 + return err; 140 241 else 141 242 tscadc->irq = err; 142 243 ··· 208 187 209 188 tscadc->tscadc_phys_base = res->start; 210 189 tscadc->regmap = devm_regmap_init_mmio(&pdev->dev, 211 - tscadc->tscadc_base, &tscadc_regmap_config); 190 + tscadc->tscadc_base, 191 + &tscadc_regmap_config); 212 192 if (IS_ERR(tscadc->regmap)) { 213 193 dev_err(&pdev->dev, "regmap init failed\n"); 214 - err = PTR_ERR(tscadc->regmap); 215 - goto ret; 194 + return PTR_ERR(tscadc->regmap); 216 195 } 217 196 218 197 spin_lock_init(&tscadc->reg_lock); ··· 222 201 pm_runtime_get_sync(&pdev->dev); 223 202 224 203 /* 225 - * The TSC_ADC_Subsystem has 2 clock domains 226 - * OCP_CLK and ADC_CLK. 227 - * The ADC clock is expected to run at target of 3MHz, 228 - * and expected to capture 12-bit data at a rate of 200 KSPS. 229 - * The TSC_ADC_SS controller design assumes the OCP clock is 230 - * at least 6x faster than the ADC clock. 204 + * The TSC_ADC_Subsystem has 2 clock domains: OCP_CLK and ADC_CLK. 205 + * ADCs produce a 12-bit sample every 15 ADC_CLK cycles. 206 + * am33xx ADCs expect to capture 200ksps. 207 + * am47xx ADCs expect to capture 867ksps. 208 + * We need ADC clocks respectively running at 3MHz and 13MHz. 209 + * These frequencies are valid since TSC_ADC_SS controller design 210 + * assumes the OCP clock is at least 6x faster than the ADC clock. 231 211 */ 232 - clk = devm_clk_get(&pdev->dev, "adc_tsc_fck"); 212 + clk = devm_clk_get(&pdev->dev, NULL); 233 213 if (IS_ERR(clk)) { 234 - dev_err(&pdev->dev, "failed to get TSC fck\n"); 214 + dev_err(&pdev->dev, "failed to get fck\n"); 235 215 err = PTR_ERR(clk); 236 216 goto err_disable_clk; 237 217 } 238 - clock_rate = clk_get_rate(clk); 239 - tscadc->clk_div = clock_rate / ADC_CLK; 240 218 241 - /* TSCADC_CLKDIV needs to be configured to the value minus 1 */ 242 - tscadc->clk_div--; 219 + tscadc->clk_div = (clk_get_rate(clk) / tscadc->data->target_clk_rate) - 1; 243 220 regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); 244 221 245 - /* Set the control register bits */ 246 - ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 247 - regmap_write(tscadc->regmap, REG_CTRL, ctrl); 248 - 249 - /* Set register bits for Idle Config Mode */ 250 - if (tsc_wires > 0) { 251 - tscadc->tsc_wires = tsc_wires; 252 - if (tsc_wires == 5) 253 - ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; 254 - else 255 - ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 256 - tscadc_idle_config(tscadc); 222 + /* 223 + * Set the control register bits. tscadc->ctrl stores the configuration 224 + * of the CTRL register but not the subsystem enable bit which must be 225 + * added manually when timely. 226 + */ 227 + tscadc->ctrl = CNTRLREG_STEPID; 228 + if (ti_adc_with_touchscreen(tscadc)) { 229 + tscadc->ctrl |= CNTRLREG_TSC_STEPCONFIGWRT; 230 + if (use_tsc) { 231 + tscadc->ctrl |= CNTRLREG_TSC_ENB; 232 + if (tscmag_wires == 5) 233 + tscadc->ctrl |= CNTRLREG_TSC_5WIRE; 234 + else 235 + tscadc->ctrl |= CNTRLREG_TSC_4WIRE; 236 + } 237 + } else { 238 + tscadc->ctrl |= CNTRLREG_MAG_PREAMP_PWRDOWN | 239 + CNTRLREG_MAG_PREAMP_BYPASS; 257 240 } 241 + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl); 242 + 243 + tscadc_idle_config(tscadc); 258 244 259 245 /* Enable the TSC module enable bit */ 260 - ctrl |= CNTRLREG_TSCSSENB; 261 - regmap_write(tscadc->regmap, REG_CTRL, ctrl); 246 + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); 262 247 263 - tscadc->used_cells = 0; 264 - tscadc->tsc_cell = -1; 265 - tscadc->adc_cell = -1; 266 - 267 - /* TSC Cell */ 268 - if (tsc_wires > 0) { 269 - tscadc->tsc_cell = tscadc->used_cells; 270 - cell = &tscadc->cells[tscadc->used_cells++]; 271 - cell->name = "TI-am335x-tsc"; 272 - cell->of_compatible = "ti,am3359-tsc"; 248 + /* TSC or MAG Cell */ 249 + if (use_tsc || use_mag) { 250 + cell = &tscadc->cells[cell_idx++]; 251 + cell->name = tscadc->data->secondary_feature_name; 252 + cell->of_compatible = tscadc->data->secondary_feature_compatible; 273 253 cell->platform_data = &tscadc; 274 254 cell->pdata_size = sizeof(tscadc); 275 255 } 276 256 277 257 /* ADC Cell */ 278 258 if (adc_channels > 0) { 279 - tscadc->adc_cell = tscadc->used_cells; 280 - cell = &tscadc->cells[tscadc->used_cells++]; 281 - cell->name = "TI-am335x-adc"; 282 - cell->of_compatible = "ti,am3359-adc"; 259 + cell = &tscadc->cells[cell_idx++]; 260 + cell->name = tscadc->data->adc_feature_name; 261 + cell->of_compatible = tscadc->data->adc_feature_compatible; 283 262 cell->platform_data = &tscadc; 284 263 cell->pdata_size = sizeof(tscadc); 285 264 } 286 265 287 266 err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, 288 - tscadc->cells, tscadc->used_cells, NULL, 289 - 0, NULL); 267 + tscadc->cells, cell_idx, NULL, 0, NULL); 290 268 if (err < 0) 291 269 goto err_disable_clk; 292 270 ··· 295 275 err_disable_clk: 296 276 pm_runtime_put_sync(&pdev->dev); 297 277 pm_runtime_disable(&pdev->dev); 298 - ret: 278 + 299 279 return err; 300 280 } 301 281 302 282 static int ti_tscadc_remove(struct platform_device *pdev) 303 283 { 304 - struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev); 284 + struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev); 305 285 306 286 regmap_write(tscadc->regmap, REG_SE, 0x00); 307 287 ··· 320 300 321 301 static int __maybe_unused tscadc_suspend(struct device *dev) 322 302 { 323 - struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 303 + struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 324 304 325 305 regmap_write(tscadc->regmap, REG_SE, 0x00); 326 306 if (device_for_each_child(dev, NULL, ti_tscadc_can_wakeup)) { ··· 328 308 329 309 regmap_read(tscadc->regmap, REG_CTRL, &ctrl); 330 310 ctrl &= ~(CNTRLREG_POWERDOWN); 331 - ctrl |= CNTRLREG_TSCSSENB; 311 + ctrl |= CNTRLREG_SSENB; 332 312 regmap_write(tscadc->regmap, REG_CTRL, ctrl); 333 313 } 334 314 pm_runtime_put_sync(dev); ··· 338 318 339 319 static int __maybe_unused tscadc_resume(struct device *dev) 340 320 { 341 - struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 342 - u32 ctrl; 321 + struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 343 322 344 323 pm_runtime_get_sync(dev); 345 324 346 - /* context restore */ 347 - ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 348 - regmap_write(tscadc->regmap, REG_CTRL, ctrl); 349 - 350 - if (tscadc->tsc_cell != -1) { 351 - if (tscadc->tsc_wires == 5) 352 - ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; 353 - else 354 - ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 355 - tscadc_idle_config(tscadc); 356 - } 357 - ctrl |= CNTRLREG_TSCSSENB; 358 - regmap_write(tscadc->regmap, REG_CTRL, ctrl); 359 - 360 325 regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); 326 + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl); 327 + tscadc_idle_config(tscadc); 328 + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); 361 329 362 330 return 0; 363 331 } 364 332 365 333 static SIMPLE_DEV_PM_OPS(tscadc_pm_ops, tscadc_suspend, tscadc_resume); 366 334 335 + static const struct ti_tscadc_data tscdata = { 336 + .adc_feature_name = "TI-am335x-adc", 337 + .adc_feature_compatible = "ti,am3359-adc", 338 + .secondary_feature_name = "TI-am335x-tsc", 339 + .secondary_feature_compatible = "ti,am3359-tsc", 340 + .target_clk_rate = TSC_ADC_CLK, 341 + }; 342 + 343 + static const struct ti_tscadc_data magdata = { 344 + .adc_feature_name = "TI-am43xx-adc", 345 + .adc_feature_compatible = "ti,am4372-adc", 346 + .secondary_feature_name = "TI-am43xx-mag", 347 + .secondary_feature_compatible = "ti,am4372-mag", 348 + .target_clk_rate = MAG_ADC_CLK, 349 + }; 350 + 367 351 static const struct of_device_id ti_tscadc_dt_ids[] = { 368 - { .compatible = "ti,am3359-tscadc", }, 352 + { .compatible = "ti,am3359-tscadc", .data = &tscdata }, 353 + { .compatible = "ti,am4372-magadc", .data = &magdata }, 369 354 { } 370 355 }; 371 356 MODULE_DEVICE_TABLE(of, ti_tscadc_dt_ids); ··· 388 363 389 364 module_platform_driver(ti_tscadc_driver); 390 365 391 - MODULE_DESCRIPTION("TI touchscreen / ADC MFD controller driver"); 366 + MODULE_DESCRIPTION("TI touchscreen/magnetic stripe reader/ADC MFD controller driver"); 392 367 MODULE_AUTHOR("Rachna Patil <rachna@ti.com>"); 393 368 MODULE_LICENSE("GPL");
+1 -3
drivers/mfd/tps65912-core.c
··· 115 115 } 116 116 EXPORT_SYMBOL_GPL(tps65912_device_init); 117 117 118 - int tps65912_device_exit(struct tps65912 *tps) 118 + void tps65912_device_exit(struct tps65912 *tps) 119 119 { 120 120 regmap_del_irq_chip(tps->irq, tps->irq_data); 121 - 122 - return 0; 123 121 } 124 122 EXPORT_SYMBOL_GPL(tps65912_device_exit); 125 123
+3 -1
drivers/mfd/tps65912-i2c.c
··· 55 55 { 56 56 struct tps65912 *tps = i2c_get_clientdata(client); 57 57 58 - return tps65912_device_exit(tps); 58 + tps65912_device_exit(tps); 59 + 60 + return 0; 59 61 } 60 62 61 63 static const struct i2c_device_id tps65912_i2c_id_table[] = {
+3 -1
drivers/mfd/tps65912-spi.c
··· 54 54 { 55 55 struct tps65912 *tps = spi_get_drvdata(spi); 56 56 57 - return tps65912_device_exit(tps); 57 + tps65912_device_exit(tps); 58 + 59 + return 0; 58 60 } 59 61 60 62 static const struct spi_device_id tps65912_spi_id_table[] = {
-526
drivers/mfd/tps80031.c
··· 1 - /* 2 - * tps80031.c -- TI TPS80031/TPS80032 mfd core driver. 3 - * 4 - * MFD core driver for TI TPS80031/TPS80032 Fully Integrated 5 - * Power Management with Power Path and Battery Charger 6 - * 7 - * Copyright (c) 2012, NVIDIA Corporation. 8 - * 9 - * Author: Laxman Dewangan <ldewangan@nvidia.com> 10 - * 11 - * This program is free software; you can redistribute it and/or 12 - * modify it under the terms of the GNU General Public License as 13 - * published by the Free Software Foundation version 2. 14 - * 15 - * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind, 16 - * whether express or implied; without even the implied warranty of 17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 - * General Public License for more details. 19 - * 20 - * You should have received a copy of the GNU General Public License 21 - * along with this program; if not, write to the Free Software 22 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 23 - * 02111-1307, USA 24 - */ 25 - 26 - #include <linux/err.h> 27 - #include <linux/i2c.h> 28 - #include <linux/init.h> 29 - #include <linux/interrupt.h> 30 - #include <linux/irq.h> 31 - #include <linux/mfd/core.h> 32 - #include <linux/mfd/tps80031.h> 33 - #include <linux/pm.h> 34 - #include <linux/regmap.h> 35 - #include <linux/slab.h> 36 - 37 - static const struct resource tps80031_rtc_resources[] = { 38 - DEFINE_RES_IRQ(TPS80031_INT_RTC_ALARM), 39 - }; 40 - 41 - /* TPS80031 sub mfd devices */ 42 - static const struct mfd_cell tps80031_cell[] = { 43 - { 44 - .name = "tps80031-pmic", 45 - }, 46 - { 47 - .name = "tps80031-clock", 48 - }, 49 - { 50 - .name = "tps80031-rtc", 51 - .num_resources = ARRAY_SIZE(tps80031_rtc_resources), 52 - .resources = tps80031_rtc_resources, 53 - }, 54 - { 55 - .name = "tps80031-gpadc", 56 - }, 57 - { 58 - .name = "tps80031-fuel-gauge", 59 - }, 60 - { 61 - .name = "tps80031-charger", 62 - }, 63 - }; 64 - 65 - static int tps80031_slave_address[TPS80031_NUM_SLAVES] = { 66 - TPS80031_I2C_ID0_ADDR, 67 - TPS80031_I2C_ID1_ADDR, 68 - TPS80031_I2C_ID2_ADDR, 69 - TPS80031_I2C_ID3_ADDR, 70 - }; 71 - 72 - struct tps80031_pupd_data { 73 - u8 reg; 74 - u8 pullup_bit; 75 - u8 pulldown_bit; 76 - }; 77 - 78 - #define TPS80031_IRQ(_reg, _mask) \ 79 - { \ 80 - .reg_offset = (TPS80031_INT_MSK_LINE_##_reg) - \ 81 - TPS80031_INT_MSK_LINE_A, \ 82 - .mask = BIT(_mask), \ 83 - } 84 - 85 - static const struct regmap_irq tps80031_main_irqs[] = { 86 - [TPS80031_INT_PWRON] = TPS80031_IRQ(A, 0), 87 - [TPS80031_INT_RPWRON] = TPS80031_IRQ(A, 1), 88 - [TPS80031_INT_SYS_VLOW] = TPS80031_IRQ(A, 2), 89 - [TPS80031_INT_RTC_ALARM] = TPS80031_IRQ(A, 3), 90 - [TPS80031_INT_RTC_PERIOD] = TPS80031_IRQ(A, 4), 91 - [TPS80031_INT_HOT_DIE] = TPS80031_IRQ(A, 5), 92 - [TPS80031_INT_VXX_SHORT] = TPS80031_IRQ(A, 6), 93 - [TPS80031_INT_SPDURATION] = TPS80031_IRQ(A, 7), 94 - [TPS80031_INT_WATCHDOG] = TPS80031_IRQ(B, 0), 95 - [TPS80031_INT_BAT] = TPS80031_IRQ(B, 1), 96 - [TPS80031_INT_SIM] = TPS80031_IRQ(B, 2), 97 - [TPS80031_INT_MMC] = TPS80031_IRQ(B, 3), 98 - [TPS80031_INT_RES] = TPS80031_IRQ(B, 4), 99 - [TPS80031_INT_GPADC_RT] = TPS80031_IRQ(B, 5), 100 - [TPS80031_INT_GPADC_SW2_EOC] = TPS80031_IRQ(B, 6), 101 - [TPS80031_INT_CC_AUTOCAL] = TPS80031_IRQ(B, 7), 102 - [TPS80031_INT_ID_WKUP] = TPS80031_IRQ(C, 0), 103 - [TPS80031_INT_VBUSS_WKUP] = TPS80031_IRQ(C, 1), 104 - [TPS80031_INT_ID] = TPS80031_IRQ(C, 2), 105 - [TPS80031_INT_VBUS] = TPS80031_IRQ(C, 3), 106 - [TPS80031_INT_CHRG_CTRL] = TPS80031_IRQ(C, 4), 107 - [TPS80031_INT_EXT_CHRG] = TPS80031_IRQ(C, 5), 108 - [TPS80031_INT_INT_CHRG] = TPS80031_IRQ(C, 6), 109 - [TPS80031_INT_RES2] = TPS80031_IRQ(C, 7), 110 - }; 111 - 112 - static struct regmap_irq_chip tps80031_irq_chip = { 113 - .name = "tps80031", 114 - .irqs = tps80031_main_irqs, 115 - .num_irqs = ARRAY_SIZE(tps80031_main_irqs), 116 - .num_regs = 3, 117 - .status_base = TPS80031_INT_STS_A, 118 - .mask_base = TPS80031_INT_MSK_LINE_A, 119 - }; 120 - 121 - #define PUPD_DATA(_reg, _pulldown_bit, _pullup_bit) \ 122 - { \ 123 - .reg = TPS80031_CFG_INPUT_PUPD##_reg, \ 124 - .pulldown_bit = _pulldown_bit, \ 125 - .pullup_bit = _pullup_bit, \ 126 - } 127 - 128 - static const struct tps80031_pupd_data tps80031_pupds[] = { 129 - [TPS80031_PREQ1] = PUPD_DATA(1, BIT(0), BIT(1)), 130 - [TPS80031_PREQ2A] = PUPD_DATA(1, BIT(2), BIT(3)), 131 - [TPS80031_PREQ2B] = PUPD_DATA(1, BIT(4), BIT(5)), 132 - [TPS80031_PREQ2C] = PUPD_DATA(1, BIT(6), BIT(7)), 133 - [TPS80031_PREQ3] = PUPD_DATA(2, BIT(0), BIT(1)), 134 - [TPS80031_NRES_WARM] = PUPD_DATA(2, 0, BIT(2)), 135 - [TPS80031_PWM_FORCE] = PUPD_DATA(2, BIT(5), 0), 136 - [TPS80031_CHRG_EXT_CHRG_STATZ] = PUPD_DATA(2, 0, BIT(6)), 137 - [TPS80031_SIM] = PUPD_DATA(3, BIT(0), BIT(1)), 138 - [TPS80031_MMC] = PUPD_DATA(3, BIT(2), BIT(3)), 139 - [TPS80031_GPADC_START] = PUPD_DATA(3, BIT(4), 0), 140 - [TPS80031_DVSI2C_SCL] = PUPD_DATA(4, 0, BIT(0)), 141 - [TPS80031_DVSI2C_SDA] = PUPD_DATA(4, 0, BIT(1)), 142 - [TPS80031_CTLI2C_SCL] = PUPD_DATA(4, 0, BIT(2)), 143 - [TPS80031_CTLI2C_SDA] = PUPD_DATA(4, 0, BIT(3)), 144 - }; 145 - static struct tps80031 *tps80031_power_off_dev; 146 - 147 - int tps80031_ext_power_req_config(struct device *dev, 148 - unsigned long ext_ctrl_flag, int preq_bit, 149 - int state_reg_add, int trans_reg_add) 150 - { 151 - u8 res_ass_reg = 0; 152 - int preq_mask_bit = 0; 153 - int ret; 154 - 155 - if (!(ext_ctrl_flag & TPS80031_EXT_PWR_REQ)) 156 - return 0; 157 - 158 - if (ext_ctrl_flag & TPS80031_PWR_REQ_INPUT_PREQ1) { 159 - res_ass_reg = TPS80031_PREQ1_RES_ASS_A + (preq_bit >> 3); 160 - preq_mask_bit = 5; 161 - } else if (ext_ctrl_flag & TPS80031_PWR_REQ_INPUT_PREQ2) { 162 - res_ass_reg = TPS80031_PREQ2_RES_ASS_A + (preq_bit >> 3); 163 - preq_mask_bit = 6; 164 - } else if (ext_ctrl_flag & TPS80031_PWR_REQ_INPUT_PREQ3) { 165 - res_ass_reg = TPS80031_PREQ3_RES_ASS_A + (preq_bit >> 3); 166 - preq_mask_bit = 7; 167 - } 168 - 169 - /* Configure REQ_ASS registers */ 170 - ret = tps80031_set_bits(dev, TPS80031_SLAVE_ID1, res_ass_reg, 171 - BIT(preq_bit & 0x7)); 172 - if (ret < 0) { 173 - dev_err(dev, "reg 0x%02x setbit failed, err = %d\n", 174 - res_ass_reg, ret); 175 - return ret; 176 - } 177 - 178 - /* Unmask the PREQ */ 179 - ret = tps80031_clr_bits(dev, TPS80031_SLAVE_ID1, 180 - TPS80031_PHOENIX_MSK_TRANSITION, BIT(preq_mask_bit)); 181 - if (ret < 0) { 182 - dev_err(dev, "reg 0x%02x clrbit failed, err = %d\n", 183 - TPS80031_PHOENIX_MSK_TRANSITION, ret); 184 - return ret; 185 - } 186 - 187 - /* Switch regulator control to resource now */ 188 - if (ext_ctrl_flag & (TPS80031_PWR_REQ_INPUT_PREQ2 | 189 - TPS80031_PWR_REQ_INPUT_PREQ3)) { 190 - ret = tps80031_update(dev, TPS80031_SLAVE_ID1, state_reg_add, 191 - 0x0, TPS80031_STATE_MASK); 192 - if (ret < 0) 193 - dev_err(dev, "reg 0x%02x update failed, err = %d\n", 194 - state_reg_add, ret); 195 - } else { 196 - ret = tps80031_update(dev, TPS80031_SLAVE_ID1, trans_reg_add, 197 - TPS80031_TRANS_SLEEP_OFF, 198 - TPS80031_TRANS_SLEEP_MASK); 199 - if (ret < 0) 200 - dev_err(dev, "reg 0x%02x update failed, err = %d\n", 201 - trans_reg_add, ret); 202 - } 203 - return ret; 204 - } 205 - EXPORT_SYMBOL_GPL(tps80031_ext_power_req_config); 206 - 207 - static void tps80031_power_off(void) 208 - { 209 - dev_info(tps80031_power_off_dev->dev, "switching off PMU\n"); 210 - tps80031_write(tps80031_power_off_dev->dev, TPS80031_SLAVE_ID1, 211 - TPS80031_PHOENIX_DEV_ON, TPS80031_DEVOFF); 212 - } 213 - 214 - static void tps80031_pupd_init(struct tps80031 *tps80031, 215 - struct tps80031_platform_data *pdata) 216 - { 217 - struct tps80031_pupd_init_data *pupd_init_data = pdata->pupd_init_data; 218 - int data_size = pdata->pupd_init_data_size; 219 - int i; 220 - 221 - for (i = 0; i < data_size; ++i) { 222 - struct tps80031_pupd_init_data *pupd_init = &pupd_init_data[i]; 223 - const struct tps80031_pupd_data *pupd = 224 - &tps80031_pupds[pupd_init->input_pin]; 225 - u8 update_value = 0; 226 - u8 update_mask = pupd->pulldown_bit | pupd->pullup_bit; 227 - 228 - if (pupd_init->setting == TPS80031_PUPD_PULLDOWN) 229 - update_value = pupd->pulldown_bit; 230 - else if (pupd_init->setting == TPS80031_PUPD_PULLUP) 231 - update_value = pupd->pullup_bit; 232 - 233 - tps80031_update(tps80031->dev, TPS80031_SLAVE_ID1, pupd->reg, 234 - update_value, update_mask); 235 - } 236 - } 237 - 238 - static int tps80031_init_ext_control(struct tps80031 *tps80031, 239 - struct tps80031_platform_data *pdata) 240 - { 241 - struct device *dev = tps80031->dev; 242 - int ret; 243 - int i; 244 - 245 - /* Clear all external control for this rail */ 246 - for (i = 0; i < 9; ++i) { 247 - ret = tps80031_write(dev, TPS80031_SLAVE_ID1, 248 - TPS80031_PREQ1_RES_ASS_A + i, 0); 249 - if (ret < 0) { 250 - dev_err(dev, "reg 0x%02x write failed, err = %d\n", 251 - TPS80031_PREQ1_RES_ASS_A + i, ret); 252 - return ret; 253 - } 254 - } 255 - 256 - /* Mask the PREQ */ 257 - ret = tps80031_set_bits(dev, TPS80031_SLAVE_ID1, 258 - TPS80031_PHOENIX_MSK_TRANSITION, 0x7 << 5); 259 - if (ret < 0) { 260 - dev_err(dev, "reg 0x%02x set_bits failed, err = %d\n", 261 - TPS80031_PHOENIX_MSK_TRANSITION, ret); 262 - return ret; 263 - } 264 - return ret; 265 - } 266 - 267 - static int tps80031_irq_init(struct tps80031 *tps80031, int irq, int irq_base) 268 - { 269 - struct device *dev = tps80031->dev; 270 - int i, ret; 271 - 272 - /* 273 - * The MASK register used for updating status register when 274 - * interrupt occurs and LINE register used to pass the status 275 - * to actual interrupt line. As per datasheet: 276 - * When INT_MSK_LINE [i] is set to 1, the associated interrupt 277 - * number i is INT line masked, which means that no interrupt is 278 - * generated on the INT line. 279 - * When INT_MSK_LINE [i] is set to 0, the associated interrupt 280 - * number i is line enabled: An interrupt is generated on the 281 - * INT line. 282 - * In any case, the INT_STS [i] status bit may or may not be updated, 283 - * only linked to the INT_MSK_STS [i] configuration register bit. 284 - * 285 - * When INT_MSK_STS [i] is set to 1, the associated interrupt number 286 - * i is status masked, which means that no interrupt is stored in 287 - * the INT_STS[i] status bit. Note that no interrupt number i is 288 - * generated on the INT line, even if the INT_MSK_LINE [i] register 289 - * bit is set to 0. 290 - * When INT_MSK_STS [i] is set to 0, the associated interrupt number i 291 - * is status enabled: An interrupt status is updated in the INT_STS [i] 292 - * register. The interrupt may or may not be generated on the INT line, 293 - * depending on the INT_MSK_LINE [i] configuration register bit. 294 - */ 295 - for (i = 0; i < 3; i++) 296 - tps80031_write(dev, TPS80031_SLAVE_ID2, 297 - TPS80031_INT_MSK_STS_A + i, 0x00); 298 - 299 - ret = regmap_add_irq_chip(tps80031->regmap[TPS80031_SLAVE_ID2], irq, 300 - IRQF_ONESHOT, irq_base, 301 - &tps80031_irq_chip, &tps80031->irq_data); 302 - if (ret < 0) { 303 - dev_err(dev, "add irq failed, err = %d\n", ret); 304 - return ret; 305 - } 306 - return ret; 307 - } 308 - 309 - static bool rd_wr_reg_id0(struct device *dev, unsigned int reg) 310 - { 311 - switch (reg) { 312 - case TPS80031_SMPS1_CFG_FORCE ... TPS80031_SMPS2_CFG_VOLTAGE: 313 - return true; 314 - default: 315 - return false; 316 - } 317 - } 318 - 319 - static bool rd_wr_reg_id1(struct device *dev, unsigned int reg) 320 - { 321 - switch (reg) { 322 - case TPS80031_SECONDS_REG ... TPS80031_RTC_RESET_STATUS_REG: 323 - case TPS80031_VALIDITY0 ... TPS80031_VALIDITY7: 324 - case TPS80031_PHOENIX_START_CONDITION ... TPS80031_KEY_PRESS_DUR_CFG: 325 - case TPS80031_SMPS4_CFG_TRANS ... TPS80031_SMPS3_CFG_VOLTAGE: 326 - case TPS80031_BROADCAST_ADDR_ALL ... TPS80031_BROADCAST_ADDR_CLK_RST: 327 - case TPS80031_VANA_CFG_TRANS ... TPS80031_LDO7_CFG_VOLTAGE: 328 - case TPS80031_REGEN1_CFG_TRANS ... TPS80031_TMP_CFG_STATE: 329 - case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C: 330 - case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING: 331 - case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD: 332 - case TPS80031_BACKUP_REG: 333 - return true; 334 - default: 335 - return false; 336 - } 337 - } 338 - 339 - static bool is_volatile_reg_id1(struct device *dev, unsigned int reg) 340 - { 341 - switch (reg) { 342 - case TPS80031_SMPS4_CFG_TRANS ... TPS80031_SMPS3_CFG_VOLTAGE: 343 - case TPS80031_VANA_CFG_TRANS ... TPS80031_LDO7_CFG_VOLTAGE: 344 - case TPS80031_REGEN1_CFG_TRANS ... TPS80031_TMP_CFG_STATE: 345 - case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C: 346 - case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING: 347 - case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD: 348 - return true; 349 - default: 350 - return false; 351 - } 352 - } 353 - 354 - static bool rd_wr_reg_id2(struct device *dev, unsigned int reg) 355 - { 356 - switch (reg) { 357 - case TPS80031_USB_VENDOR_ID_LSB ... TPS80031_USB_OTG_REVISION: 358 - case TPS80031_GPADC_CTRL ... TPS80031_CTRL_P1: 359 - case TPS80031_RTCH0_LSB ... TPS80031_GPCH0_MSB: 360 - case TPS80031_TOGGLE1 ... TPS80031_VIBMODE: 361 - case TPS80031_PWM1ON ... TPS80031_PWM2OFF: 362 - case TPS80031_FG_REG_00 ... TPS80031_FG_REG_11: 363 - case TPS80031_INT_STS_A ... TPS80031_INT_MSK_STS_C: 364 - case TPS80031_CONTROLLER_CTRL2 ... TPS80031_LED_PWM_CTRL2: 365 - return true; 366 - default: 367 - return false; 368 - } 369 - } 370 - 371 - static bool rd_wr_reg_id3(struct device *dev, unsigned int reg) 372 - { 373 - switch (reg) { 374 - case TPS80031_GPADC_TRIM0 ... TPS80031_GPADC_TRIM18: 375 - return true; 376 - default: 377 - return false; 378 - } 379 - } 380 - 381 - static const struct regmap_config tps80031_regmap_configs[] = { 382 - { 383 - .reg_bits = 8, 384 - .val_bits = 8, 385 - .writeable_reg = rd_wr_reg_id0, 386 - .readable_reg = rd_wr_reg_id0, 387 - .max_register = TPS80031_MAX_REGISTER, 388 - }, 389 - { 390 - .reg_bits = 8, 391 - .val_bits = 8, 392 - .writeable_reg = rd_wr_reg_id1, 393 - .readable_reg = rd_wr_reg_id1, 394 - .volatile_reg = is_volatile_reg_id1, 395 - .max_register = TPS80031_MAX_REGISTER, 396 - }, 397 - { 398 - .reg_bits = 8, 399 - .val_bits = 8, 400 - .writeable_reg = rd_wr_reg_id2, 401 - .readable_reg = rd_wr_reg_id2, 402 - .max_register = TPS80031_MAX_REGISTER, 403 - }, 404 - { 405 - .reg_bits = 8, 406 - .val_bits = 8, 407 - .writeable_reg = rd_wr_reg_id3, 408 - .readable_reg = rd_wr_reg_id3, 409 - .max_register = TPS80031_MAX_REGISTER, 410 - }, 411 - }; 412 - 413 - static int tps80031_probe(struct i2c_client *client, 414 - const struct i2c_device_id *id) 415 - { 416 - struct tps80031_platform_data *pdata = dev_get_platdata(&client->dev); 417 - struct tps80031 *tps80031; 418 - int ret; 419 - uint8_t es_version; 420 - uint8_t ep_ver; 421 - int i; 422 - 423 - if (!pdata) { 424 - dev_err(&client->dev, "tps80031 requires platform data\n"); 425 - return -EINVAL; 426 - } 427 - 428 - tps80031 = devm_kzalloc(&client->dev, sizeof(*tps80031), GFP_KERNEL); 429 - if (!tps80031) 430 - return -ENOMEM; 431 - 432 - for (i = 0; i < TPS80031_NUM_SLAVES; i++) { 433 - if (tps80031_slave_address[i] == client->addr) 434 - tps80031->clients[i] = client; 435 - else 436 - tps80031->clients[i] = devm_i2c_new_dummy_device(&client->dev, 437 - client->adapter, tps80031_slave_address[i]); 438 - if (IS_ERR(tps80031->clients[i])) { 439 - dev_err(&client->dev, "can't attach client %d\n", i); 440 - return PTR_ERR(tps80031->clients[i]); 441 - } 442 - 443 - i2c_set_clientdata(tps80031->clients[i], tps80031); 444 - tps80031->regmap[i] = devm_regmap_init_i2c(tps80031->clients[i], 445 - &tps80031_regmap_configs[i]); 446 - if (IS_ERR(tps80031->regmap[i])) { 447 - ret = PTR_ERR(tps80031->regmap[i]); 448 - dev_err(&client->dev, 449 - "regmap %d init failed, err %d\n", i, ret); 450 - return ret; 451 - } 452 - } 453 - 454 - ret = tps80031_read(&client->dev, TPS80031_SLAVE_ID3, 455 - TPS80031_JTAGVERNUM, &es_version); 456 - if (ret < 0) { 457 - dev_err(&client->dev, 458 - "Silicon version number read failed: %d\n", ret); 459 - return ret; 460 - } 461 - 462 - ret = tps80031_read(&client->dev, TPS80031_SLAVE_ID3, 463 - TPS80031_EPROM_REV, &ep_ver); 464 - if (ret < 0) { 465 - dev_err(&client->dev, 466 - "Silicon eeprom version read failed: %d\n", ret); 467 - return ret; 468 - } 469 - 470 - dev_info(&client->dev, "ES version 0x%02x and EPROM version 0x%02x\n", 471 - es_version, ep_ver); 472 - tps80031->es_version = es_version; 473 - tps80031->dev = &client->dev; 474 - i2c_set_clientdata(client, tps80031); 475 - tps80031->chip_info = id->driver_data; 476 - 477 - ret = tps80031_irq_init(tps80031, client->irq, pdata->irq_base); 478 - if (ret) { 479 - dev_err(&client->dev, "IRQ init failed: %d\n", ret); 480 - return ret; 481 - } 482 - 483 - tps80031_pupd_init(tps80031, pdata); 484 - 485 - tps80031_init_ext_control(tps80031, pdata); 486 - 487 - ret = mfd_add_devices(tps80031->dev, -1, 488 - tps80031_cell, ARRAY_SIZE(tps80031_cell), 489 - NULL, 0, 490 - regmap_irq_get_domain(tps80031->irq_data)); 491 - if (ret < 0) { 492 - dev_err(&client->dev, "mfd_add_devices failed: %d\n", ret); 493 - goto fail_mfd_add; 494 - } 495 - 496 - if (pdata->use_power_off && !pm_power_off) { 497 - tps80031_power_off_dev = tps80031; 498 - pm_power_off = tps80031_power_off; 499 - } 500 - return 0; 501 - 502 - fail_mfd_add: 503 - regmap_del_irq_chip(client->irq, tps80031->irq_data); 504 - return ret; 505 - } 506 - 507 - static const struct i2c_device_id tps80031_id_table[] = { 508 - { "tps80031", TPS80031 }, 509 - { "tps80032", TPS80032 }, 510 - { } 511 - }; 512 - 513 - static struct i2c_driver tps80031_driver = { 514 - .driver = { 515 - .name = "tps80031", 516 - .suppress_bind_attrs = true, 517 - }, 518 - .probe = tps80031_probe, 519 - .id_table = tps80031_id_table, 520 - }; 521 - 522 - static int __init tps80031_init(void) 523 - { 524 - return i2c_add_driver(&tps80031_driver); 525 - } 526 - subsys_initcall(tps80031_init);
+9 -12
drivers/mfd/wcd934x.c
··· 2 2 // Copyright (c) 2019, Linaro Limited 3 3 4 4 #include <linux/clk.h> 5 - #include <linux/gpio.h> 5 + #include <linux/gpio/consumer.h> 6 6 #include <linux/interrupt.h> 7 7 #include <linux/kernel.h> 8 8 #include <linux/mfd/core.h> 9 9 #include <linux/mfd/wcd934x/registers.h> 10 10 #include <linux/mfd/wcd934x/wcd934x.h> 11 11 #include <linux/module.h> 12 - #include <linux/of_gpio.h> 13 12 #include <linux/of.h> 14 13 #include <linux/of_irq.h> 15 14 #include <linux/platform_device.h> ··· 209 210 struct device *dev = &sdev->dev; 210 211 struct device_node *np = dev->of_node; 211 212 struct wcd934x_ddata *ddata; 212 - int reset_gpio, ret; 213 + struct gpio_desc *reset_gpio; 214 + int ret; 213 215 214 216 ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); 215 217 if (!ddata) ··· 220 220 if (ddata->irq < 0) 221 221 return dev_err_probe(ddata->dev, ddata->irq, 222 222 "Failed to get IRQ\n"); 223 - 224 - reset_gpio = of_get_named_gpio(np, "reset-gpios", 0); 225 - if (reset_gpio < 0) { 226 - dev_err(dev, "Failed to get reset gpio: err = %d\n", 227 - reset_gpio); 228 - return reset_gpio; 229 - } 230 223 231 224 ddata->extclk = devm_clk_get(dev, "extclk"); 232 225 if (IS_ERR(ddata->extclk)) { ··· 251 258 * SYS_RST_N shouldn't be pulled high during this time 252 259 */ 253 260 usleep_range(600, 650); 254 - gpio_direction_output(reset_gpio, 0); 261 + reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); 262 + if (IS_ERR(reset_gpio)) { 263 + return dev_err_probe(dev, PTR_ERR(reset_gpio), 264 + "Failed to get reset gpio: err = %ld\n", PTR_ERR(reset_gpio)); 265 + } 255 266 msleep(20); 256 - gpio_set_value(reset_gpio, 1); 267 + gpiod_set_value(reset_gpio, 1); 257 268 msleep(20); 258 269 259 270 ddata->dev = dev;
+4 -5
drivers/misc/hi6421v600-irq.c
··· 10 10 #include <linux/bitops.h> 11 11 #include <linux/interrupt.h> 12 12 #include <linux/irq.h> 13 - #include <linux/mfd/hi6421-spmi-pmic.h> 14 13 #include <linux/module.h> 15 14 #include <linux/of_gpio.h> 16 15 #include <linux/platform_device.h> ··· 219 220 struct platform_device *pmic_pdev; 220 221 struct device *dev = &pdev->dev; 221 222 struct hi6421v600_irq *priv; 222 - struct hi6421_spmi_pmic *pmic; 223 + struct regmap *regmap; 223 224 unsigned int virq; 224 225 int i, ret; 225 226 ··· 228 229 * which should first set drvdata. If this doesn't happen, hit 229 230 * a warn on and return. 230 231 */ 231 - pmic = dev_get_drvdata(pmic_dev); 232 - if (WARN_ON(!pmic)) 232 + regmap = dev_get_drvdata(pmic_dev); 233 + if (WARN_ON(!regmap)) 233 234 return -ENODEV; 234 235 235 236 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 237 238 return -ENOMEM; 238 239 239 240 priv->dev = dev; 240 - priv->regmap = pmic->regmap; 241 + priv->regmap = regmap; 241 242 242 243 spin_lock_init(&priv->lock); 243 244
+5 -5
drivers/regulator/hi6421v600-regulator.c
··· 9 9 // Guodong Xu <guodong.xu@linaro.org> 10 10 11 11 #include <linux/delay.h> 12 - #include <linux/mfd/hi6421-spmi-pmic.h> 13 12 #include <linux/module.h> 13 + #include <linux/of.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/regmap.h> 16 16 #include <linux/regulator/driver.h> ··· 237 237 struct hi6421_spmi_reg_priv *priv; 238 238 struct hi6421_spmi_reg_info *info; 239 239 struct device *dev = &pdev->dev; 240 - struct hi6421_spmi_pmic *pmic; 240 + struct regmap *regmap; 241 241 struct regulator_dev *rdev; 242 242 int i; 243 243 ··· 246 246 * which should first set drvdata. If this doesn't happen, hit 247 247 * a warn on and return. 248 248 */ 249 - pmic = dev_get_drvdata(pmic_dev); 250 - if (WARN_ON(!pmic)) 249 + regmap = dev_get_drvdata(pmic_dev); 250 + if (WARN_ON(!regmap)) 251 251 return -ENODEV; 252 252 253 253 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 261 261 262 262 config.dev = pdev->dev.parent; 263 263 config.driver_data = priv; 264 - config.regmap = pmic->regmap; 264 + config.regmap = regmap; 265 265 266 266 rdev = devm_regulator_register(dev, &info->desc, &config); 267 267 if (IS_ERR(rdev)) {
+1
include/dt-bindings/clock/am4.h
··· 158 158 #define AM4_L3S_VPFE0_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x68) 159 159 #define AM4_L3S_VPFE1_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x70) 160 160 #define AM4_L3S_GPMC_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x220) 161 + #define AM4_L3S_ADC1_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x230) 161 162 #define AM4_L3S_MCASP0_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x238) 162 163 #define AM4_L3S_MCASP1_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x240) 163 164 #define AM4_L3S_MMC3_CLKCTRL AM4_L3S_CLKCTRL_INDEX(0x248)
+1
include/linux/mfd/da9063/core.h
··· 36 36 PMIC_DA9063_BB = 0x5, 37 37 PMIC_DA9063_CA = 0x6, 38 38 PMIC_DA9063_DA = 0x7, 39 + PMIC_DA9063_EA = 0x8, 39 40 }; 40 41 41 42 /* Interrupts */
-25
include/linux/mfd/hi6421-spmi-pmic.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Header file for device driver Hi6421 PMIC 4 - * 5 - * Copyright (c) 2013 Linaro Ltd. 6 - * Copyright (C) 2011 Hisilicon. 7 - * Copyright (c) 2020-2021 Huawei Technologies Co., Ltd 8 - * 9 - * Guodong Xu <guodong.xu@linaro.org> 10 - */ 11 - 12 - #ifndef __HISI_PMIC_H 13 - #define __HISI_PMIC_H 14 - 15 - #include <linux/irqdomain.h> 16 - #include <linux/regmap.h> 17 - 18 - struct hi6421_spmi_pmic { 19 - struct resource *res; 20 - struct device *dev; 21 - void __iomem *regs; 22 - struct regmap *regmap; 23 - }; 24 - 25 - #endif /* __HISI_PMIC_H */
+13 -13
include/linux/mfd/max77686-private.h
··· 133 133 /* Reserved: 0x7A-0x7D */ 134 134 135 135 MAX77686_REG_BBAT_CHG = 0x7E, 136 - MAX77686_REG_32KHZ = 0x7F, 136 + MAX77686_REG_32KHZ = 0x7F, 137 137 138 138 MAX77686_REG_PMIC_END = 0x80, 139 139 }; 140 140 141 141 enum max77686_rtc_reg { 142 - MAX77686_RTC_INT = 0x00, 143 - MAX77686_RTC_INTM = 0x01, 142 + MAX77686_RTC_INT = 0x00, 143 + MAX77686_RTC_INTM = 0x01, 144 144 MAX77686_RTC_CONTROLM = 0x02, 145 145 MAX77686_RTC_CONTROL = 0x03, 146 146 MAX77686_RTC_UPDATE0 = 0x04, 147 147 /* Reserved: 0x5 */ 148 148 MAX77686_WTSR_SMPL_CNTL = 0x06, 149 - MAX77686_RTC_SEC = 0x07, 150 - MAX77686_RTC_MIN = 0x08, 151 - MAX77686_RTC_HOUR = 0x09, 149 + MAX77686_RTC_SEC = 0x07, 150 + MAX77686_RTC_MIN = 0x08, 151 + MAX77686_RTC_HOUR = 0x09, 152 152 MAX77686_RTC_WEEKDAY = 0x0A, 153 - MAX77686_RTC_MONTH = 0x0B, 154 - MAX77686_RTC_YEAR = 0x0C, 155 - MAX77686_RTC_DATE = 0x0D, 156 - MAX77686_ALARM1_SEC = 0x0E, 157 - MAX77686_ALARM1_MIN = 0x0F, 153 + MAX77686_RTC_MONTH = 0x0B, 154 + MAX77686_RTC_YEAR = 0x0C, 155 + MAX77686_RTC_DATE = 0x0D, 156 + MAX77686_ALARM1_SEC = 0x0E, 157 + MAX77686_ALARM1_MIN = 0x0F, 158 158 MAX77686_ALARM1_HOUR = 0x10, 159 159 MAX77686_ALARM1_WEEKDAY = 0x11, 160 160 MAX77686_ALARM1_MONTH = 0x12, 161 161 MAX77686_ALARM1_YEAR = 0x13, 162 162 MAX77686_ALARM1_DATE = 0x14, 163 - MAX77686_ALARM2_SEC = 0x15, 164 - MAX77686_ALARM2_MIN = 0x16, 163 + MAX77686_ALARM2_SEC = 0x15, 164 + MAX77686_ALARM2_MIN = 0x16, 165 165 MAX77686_ALARM2_HOUR = 0x17, 166 166 MAX77686_ALARM2_WEEKDAY = 0x18, 167 167 MAX77686_ALARM2_MONTH = 0x19,
+57 -62
include/linux/mfd/ti_am335x_tscadc.h
··· 1 - #ifndef __LINUX_TI_AM335X_TSCADC_MFD_H 2 - #define __LINUX_TI_AM335X_TSCADC_MFD_H 3 - 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 4 2 /* 5 3 * TI Touch Screen / ADC MFD driver 6 4 * 7 5 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ 8 - * 9 - * This program is free software; you can redistribute it and/or 10 - * modify it under the terms of the GNU General Public License as 11 - * published by the Free Software Foundation version 2. 12 - * 13 - * This program is distributed "as is" WITHOUT ANY WARRANTY of any 14 - * kind, whether express or implied; without even the implied warranty 15 - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 6 */ 18 7 8 + #ifndef __LINUX_TI_AM335X_TSCADC_MFD_H 9 + #define __LINUX_TI_AM335X_TSCADC_MFD_H 10 + 11 + #include <linux/bitfield.h> 19 12 #include <linux/mfd/core.h> 13 + #include <linux/units.h> 20 14 21 15 #define REG_RAWIRQSTATUS 0x024 22 16 #define REG_IRQSTATUS 0x028 ··· 40 46 /* IRQ wakeup enable */ 41 47 #define IRQWKUP_ENB BIT(0) 42 48 43 - /* Step Enable */ 44 - #define STEPENB_MASK (0x1FFFF << 0) 45 - #define STEPENB(val) ((val) << 0) 46 - #define ENB(val) (1 << (val)) 47 - #define STPENB_STEPENB STEPENB(0x1FFFF) 48 - #define STPENB_STEPENB_TC STEPENB(0x1FFF) 49 - 50 49 /* IRQ enable */ 51 50 #define IRQENB_HW_PEN BIT(0) 52 51 #define IRQENB_EOS BIT(1) ··· 52 65 #define IRQENB_PENUP BIT(9) 53 66 54 67 /* Step Configuration */ 55 - #define STEPCONFIG_MODE_MASK (3 << 0) 56 - #define STEPCONFIG_MODE(val) ((val) << 0) 68 + #define STEPCONFIG_MODE(val) FIELD_PREP(GENMASK(1, 0), (val)) 57 69 #define STEPCONFIG_MODE_SWCNT STEPCONFIG_MODE(1) 58 70 #define STEPCONFIG_MODE_HWSYNC STEPCONFIG_MODE(2) 59 - #define STEPCONFIG_AVG_MASK (7 << 2) 60 - #define STEPCONFIG_AVG(val) ((val) << 2) 71 + #define STEPCONFIG_AVG(val) FIELD_PREP(GENMASK(4, 2), (val)) 61 72 #define STEPCONFIG_AVG_16 STEPCONFIG_AVG(4) 62 73 #define STEPCONFIG_XPP BIT(5) 63 74 #define STEPCONFIG_XNN BIT(6) ··· 63 78 #define STEPCONFIG_YNN BIT(8) 64 79 #define STEPCONFIG_XNP BIT(9) 65 80 #define STEPCONFIG_YPN BIT(10) 66 - #define STEPCONFIG_RFP(val) ((val) << 12) 67 - #define STEPCONFIG_RFP_VREFP (0x3 << 12) 68 - #define STEPCONFIG_INM_MASK (0xF << 15) 69 - #define STEPCONFIG_INM(val) ((val) << 15) 81 + #define STEPCONFIG_RFP(val) FIELD_PREP(GENMASK(13, 12), (val)) 82 + #define STEPCONFIG_RFP_VREFP STEPCONFIG_RFP(3) 83 + #define STEPCONFIG_INM(val) FIELD_PREP(GENMASK(18, 15), (val)) 70 84 #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) 71 - #define STEPCONFIG_INP_MASK (0xF << 19) 72 - #define STEPCONFIG_INP(val) ((val) << 19) 85 + #define STEPCONFIG_INP(val) FIELD_PREP(GENMASK(22, 19), (val)) 73 86 #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) 74 87 #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) 75 88 #define STEPCONFIG_FIFO1 BIT(26) 76 - #define STEPCONFIG_RFM(val) ((val) << 23) 77 - #define STEPCONFIG_RFM_VREFN (0x3 << 23) 89 + #define STEPCONFIG_RFM(val) FIELD_PREP(GENMASK(24, 23), (val)) 90 + #define STEPCONFIG_RFM_VREFN STEPCONFIG_RFM(3) 78 91 79 92 /* Delay register */ 80 - #define STEPDELAY_OPEN_MASK (0x3FFFF << 0) 81 - #define STEPDELAY_OPEN(val) ((val) << 0) 93 + #define STEPDELAY_OPEN(val) FIELD_PREP(GENMASK(17, 0), (val)) 82 94 #define STEPCONFIG_OPENDLY STEPDELAY_OPEN(0x098) 83 - #define STEPDELAY_SAMPLE_MASK (0xFF << 24) 84 - #define STEPDELAY_SAMPLE(val) ((val) << 24) 95 + #define STEPCONFIG_MAX_OPENDLY GENMASK(17, 0) 96 + #define STEPDELAY_SAMPLE(val) FIELD_PREP(GENMASK(31, 24), (val)) 85 97 #define STEPCONFIG_SAMPLEDLY STEPDELAY_SAMPLE(0) 98 + #define STEPCONFIG_MAX_SAMPLE GENMASK(7, 0) 86 99 87 100 /* Charge Config */ 88 - #define STEPCHARGE_RFP_MASK (7 << 12) 89 - #define STEPCHARGE_RFP(val) ((val) << 12) 101 + #define STEPCHARGE_RFP(val) FIELD_PREP(GENMASK(14, 12), (val)) 90 102 #define STEPCHARGE_RFP_XPUL STEPCHARGE_RFP(1) 91 - #define STEPCHARGE_INM_MASK (0xF << 15) 92 - #define STEPCHARGE_INM(val) ((val) << 15) 103 + #define STEPCHARGE_INM(val) FIELD_PREP(GENMASK(18, 15), (val)) 93 104 #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) 94 - #define STEPCHARGE_INP_MASK (0xF << 19) 95 - #define STEPCHARGE_INP(val) ((val) << 19) 96 - #define STEPCHARGE_RFM_MASK (3 << 23) 97 - #define STEPCHARGE_RFM(val) ((val) << 23) 105 + #define STEPCHARGE_INP(val) FIELD_PREP(GENMASK(22, 19), (val)) 106 + #define STEPCHARGE_RFM(val) FIELD_PREP(GENMASK(24, 23), (val)) 98 107 #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) 99 108 100 109 /* Charge delay */ 101 - #define CHARGEDLY_OPEN_MASK (0x3FFFF << 0) 102 - #define CHARGEDLY_OPEN(val) ((val) << 0) 110 + #define CHARGEDLY_OPEN(val) FIELD_PREP(GENMASK(17, 0), (val)) 103 111 #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(0x400) 104 112 105 113 /* Control register */ 106 - #define CNTRLREG_TSCSSENB BIT(0) 114 + #define CNTRLREG_SSENB BIT(0) 107 115 #define CNTRLREG_STEPID BIT(1) 108 - #define CNTRLREG_STEPCONFIGWRT BIT(2) 116 + #define CNTRLREG_TSC_STEPCONFIGWRT BIT(2) 109 117 #define CNTRLREG_POWERDOWN BIT(4) 110 - #define CNTRLREG_AFE_CTRL_MASK (3 << 5) 111 - #define CNTRLREG_AFE_CTRL(val) ((val) << 5) 112 - #define CNTRLREG_4WIRE CNTRLREG_AFE_CTRL(1) 113 - #define CNTRLREG_5WIRE CNTRLREG_AFE_CTRL(2) 114 - #define CNTRLREG_8WIRE CNTRLREG_AFE_CTRL(3) 115 - #define CNTRLREG_TSCENB BIT(7) 118 + #define CNTRLREG_TSC_AFE_CTRL(val) FIELD_PREP(GENMASK(6, 5), (val)) 119 + #define CNTRLREG_TSC_4WIRE CNTRLREG_TSC_AFE_CTRL(1) 120 + #define CNTRLREG_TSC_5WIRE CNTRLREG_TSC_AFE_CTRL(2) 121 + #define CNTRLREG_TSC_8WIRE CNTRLREG_TSC_AFE_CTRL(3) 122 + #define CNTRLREG_TSC_ENB BIT(7) 123 + 124 + /*Control registers bitfields for MAGADC IP */ 125 + #define CNTRLREG_MAGADCENB BIT(0) 126 + #define CNTRLREG_MAG_PREAMP_PWRDOWN BIT(5) 127 + #define CNTRLREG_MAG_PREAMP_BYPASS BIT(6) 116 128 117 129 /* FIFO READ Register */ 118 - #define FIFOREAD_DATA_MASK (0xfff << 0) 119 - #define FIFOREAD_CHNLID_MASK (0xf << 16) 130 + #define FIFOREAD_DATA_MASK GENMASK(11, 0) 131 + #define FIFOREAD_CHNLID_MASK GENMASK(19, 16) 120 132 121 133 /* DMA ENABLE/CLEAR Register */ 122 134 #define DMA_FIFO0 BIT(0) 123 135 #define DMA_FIFO1 BIT(1) 124 136 125 137 /* Sequencer Status */ 126 - #define SEQ_STATUS BIT(5) 138 + #define SEQ_STATUS BIT(5) 127 139 #define CHARGE_STEP 0x11 128 140 129 - #define ADC_CLK 3000000 141 + #define TSC_ADC_CLK (3 * HZ_PER_MHZ) 142 + #define MAG_ADC_CLK (13 * HZ_PER_MHZ) 130 143 #define TOTAL_STEPS 16 131 144 #define TOTAL_CHANNELS 8 132 145 #define FIFO1_THRESHOLD 19 ··· 141 158 * 142 159 * max processing time: 266431 * 308ns = 83ms(approx) 143 160 */ 144 - #define IDLE_TIMEOUT 83 /* milliseconds */ 161 + #define IDLE_TIMEOUT_MS 83 /* milliseconds */ 145 162 146 163 #define TSCADC_CELLS 2 164 + 165 + struct ti_tscadc_data { 166 + char *adc_feature_name; 167 + char *adc_feature_compatible; 168 + char *secondary_feature_name; 169 + char *secondary_feature_compatible; 170 + unsigned int target_clk_rate; 171 + }; 147 172 148 173 struct ti_tscadc_dev { 149 174 struct device *dev; 150 175 struct regmap *regmap; 151 176 void __iomem *tscadc_base; 152 177 phys_addr_t tscadc_phys_base; 178 + const struct ti_tscadc_data *data; 153 179 int irq; 154 - int used_cells; /* 1-2 */ 155 - int tsc_wires; 156 - int tsc_cell; /* -1 if not used */ 157 - int adc_cell; /* -1 if not used */ 158 180 struct mfd_cell cells[TSCADC_CELLS]; 181 + u32 ctrl; 159 182 u32 reg_se_cache; 160 183 bool adc_waiting; 161 184 bool adc_in_use; ··· 181 192 struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data; 182 193 183 194 return *tscadc_dev; 195 + } 196 + 197 + static inline bool ti_adc_with_touchscreen(struct ti_tscadc_dev *tscadc) 198 + { 199 + return of_device_is_compatible(tscadc->dev->of_node, 200 + "ti,am3359-tscadc"); 184 201 } 185 202 186 203 void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val);
+1 -1
include/linux/mfd/tps65912.h
··· 322 322 extern const struct regmap_config tps65912_regmap_config; 323 323 324 324 int tps65912_device_init(struct tps65912 *tps); 325 - int tps65912_device_exit(struct tps65912 *tps); 325 + void tps65912_device_exit(struct tps65912 *tps); 326 326 327 327 #endif /* __LINUX_MFD_TPS65912_H */
-637
include/linux/mfd/tps80031.h
··· 1 - /* 2 - * tps80031.h -- TI TPS80031 and TI TPS80032 PMIC driver. 3 - * 4 - * Copyright (c) 2012, NVIDIA Corporation. 5 - * 6 - * Author: Laxman Dewangan <ldewangan@nvidia.com> 7 - * 8 - * This program is free software; you can redistribute it and/or 9 - * modify it under the terms of the GNU General Public License as 10 - * published by the Free Software Foundation version 2. 11 - * 12 - * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind, 13 - * whether express or implied; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 - * General Public License for more details. 16 - * 17 - * You should have received a copy of the GNU General Public License 18 - * along with this program; if not, write to the Free Software 19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 - * 02111-1307, USA 21 - */ 22 - 23 - #ifndef __LINUX_MFD_TPS80031_H 24 - #define __LINUX_MFD_TPS80031_H 25 - 26 - #include <linux/device.h> 27 - #include <linux/regmap.h> 28 - 29 - /* Pull-ups/Pull-downs */ 30 - #define TPS80031_CFG_INPUT_PUPD1 0xF0 31 - #define TPS80031_CFG_INPUT_PUPD2 0xF1 32 - #define TPS80031_CFG_INPUT_PUPD3 0xF2 33 - #define TPS80031_CFG_INPUT_PUPD4 0xF3 34 - #define TPS80031_CFG_LDO_PD1 0xF4 35 - #define TPS80031_CFG_LDO_PD2 0xF5 36 - #define TPS80031_CFG_SMPS_PD 0xF6 37 - 38 - /* Real Time Clock */ 39 - #define TPS80031_SECONDS_REG 0x00 40 - #define TPS80031_MINUTES_REG 0x01 41 - #define TPS80031_HOURS_REG 0x02 42 - #define TPS80031_DAYS_REG 0x03 43 - #define TPS80031_MONTHS_REG 0x04 44 - #define TPS80031_YEARS_REG 0x05 45 - #define TPS80031_WEEKS_REG 0x06 46 - #define TPS80031_ALARM_SECONDS_REG 0x08 47 - #define TPS80031_ALARM_MINUTES_REG 0x09 48 - #define TPS80031_ALARM_HOURS_REG 0x0A 49 - #define TPS80031_ALARM_DAYS_REG 0x0B 50 - #define TPS80031_ALARM_MONTHS_REG 0x0C 51 - #define TPS80031_ALARM_YEARS_REG 0x0D 52 - #define TPS80031_RTC_CTRL_REG 0x10 53 - #define TPS80031_RTC_STATUS_REG 0x11 54 - #define TPS80031_RTC_INTERRUPTS_REG 0x12 55 - #define TPS80031_RTC_COMP_LSB_REG 0x13 56 - #define TPS80031_RTC_COMP_MSB_REG 0x14 57 - #define TPS80031_RTC_RESET_STATUS_REG 0x16 58 - 59 - /*PMC Master Module */ 60 - #define TPS80031_PHOENIX_START_CONDITION 0x1F 61 - #define TPS80031_PHOENIX_MSK_TRANSITION 0x20 62 - #define TPS80031_STS_HW_CONDITIONS 0x21 63 - #define TPS80031_PHOENIX_LAST_TURNOFF_STS 0x22 64 - #define TPS80031_VSYSMIN_LO_THRESHOLD 0x23 65 - #define TPS80031_VSYSMIN_HI_THRESHOLD 0x24 66 - #define TPS80031_PHOENIX_DEV_ON 0x25 67 - #define TPS80031_STS_PWR_GRP_STATE 0x27 68 - #define TPS80031_PH_CFG_VSYSLOW 0x28 69 - #define TPS80031_PH_STS_BOOT 0x29 70 - #define TPS80031_PHOENIX_SENS_TRANSITION 0x2A 71 - #define TPS80031_PHOENIX_SEQ_CFG 0x2B 72 - #define TPS80031_PRIMARY_WATCHDOG_CFG 0X2C 73 - #define TPS80031_KEY_PRESS_DUR_CFG 0X2D 74 - #define TPS80031_SMPS_LDO_SHORT_STS 0x2E 75 - 76 - /* PMC Slave Module - Broadcast */ 77 - #define TPS80031_BROADCAST_ADDR_ALL 0x31 78 - #define TPS80031_BROADCAST_ADDR_REF 0x32 79 - #define TPS80031_BROADCAST_ADDR_PROV 0x33 80 - #define TPS80031_BROADCAST_ADDR_CLK_RST 0x34 81 - 82 - /* PMC Slave Module SMPS Regulators */ 83 - #define TPS80031_SMPS4_CFG_TRANS 0x41 84 - #define TPS80031_SMPS4_CFG_STATE 0x42 85 - #define TPS80031_SMPS4_CFG_VOLTAGE 0x44 86 - #define TPS80031_VIO_CFG_TRANS 0x47 87 - #define TPS80031_VIO_CFG_STATE 0x48 88 - #define TPS80031_VIO_CFG_FORCE 0x49 89 - #define TPS80031_VIO_CFG_VOLTAGE 0x4A 90 - #define TPS80031_VIO_CFG_STEP 0x48 91 - #define TPS80031_SMPS1_CFG_TRANS 0x53 92 - #define TPS80031_SMPS1_CFG_STATE 0x54 93 - #define TPS80031_SMPS1_CFG_FORCE 0x55 94 - #define TPS80031_SMPS1_CFG_VOLTAGE 0x56 95 - #define TPS80031_SMPS1_CFG_STEP 0x57 96 - #define TPS80031_SMPS2_CFG_TRANS 0x59 97 - #define TPS80031_SMPS2_CFG_STATE 0x5A 98 - #define TPS80031_SMPS2_CFG_FORCE 0x5B 99 - #define TPS80031_SMPS2_CFG_VOLTAGE 0x5C 100 - #define TPS80031_SMPS2_CFG_STEP 0x5D 101 - #define TPS80031_SMPS3_CFG_TRANS 0x65 102 - #define TPS80031_SMPS3_CFG_STATE 0x66 103 - #define TPS80031_SMPS3_CFG_VOLTAGE 0x68 104 - 105 - /* PMC Slave Module LDO Regulators */ 106 - #define TPS80031_VANA_CFG_TRANS 0x81 107 - #define TPS80031_VANA_CFG_STATE 0x82 108 - #define TPS80031_VANA_CFG_VOLTAGE 0x83 109 - #define TPS80031_LDO2_CFG_TRANS 0x85 110 - #define TPS80031_LDO2_CFG_STATE 0x86 111 - #define TPS80031_LDO2_CFG_VOLTAGE 0x87 112 - #define TPS80031_LDO4_CFG_TRANS 0x89 113 - #define TPS80031_LDO4_CFG_STATE 0x8A 114 - #define TPS80031_LDO4_CFG_VOLTAGE 0x8B 115 - #define TPS80031_LDO3_CFG_TRANS 0x8D 116 - #define TPS80031_LDO3_CFG_STATE 0x8E 117 - #define TPS80031_LDO3_CFG_VOLTAGE 0x8F 118 - #define TPS80031_LDO6_CFG_TRANS 0x91 119 - #define TPS80031_LDO6_CFG_STATE 0x92 120 - #define TPS80031_LDO6_CFG_VOLTAGE 0x93 121 - #define TPS80031_LDOLN_CFG_TRANS 0x95 122 - #define TPS80031_LDOLN_CFG_STATE 0x96 123 - #define TPS80031_LDOLN_CFG_VOLTAGE 0x97 124 - #define TPS80031_LDO5_CFG_TRANS 0x99 125 - #define TPS80031_LDO5_CFG_STATE 0x9A 126 - #define TPS80031_LDO5_CFG_VOLTAGE 0x9B 127 - #define TPS80031_LDO1_CFG_TRANS 0x9D 128 - #define TPS80031_LDO1_CFG_STATE 0x9E 129 - #define TPS80031_LDO1_CFG_VOLTAGE 0x9F 130 - #define TPS80031_LDOUSB_CFG_TRANS 0xA1 131 - #define TPS80031_LDOUSB_CFG_STATE 0xA2 132 - #define TPS80031_LDOUSB_CFG_VOLTAGE 0xA3 133 - #define TPS80031_LDO7_CFG_TRANS 0xA5 134 - #define TPS80031_LDO7_CFG_STATE 0xA6 135 - #define TPS80031_LDO7_CFG_VOLTAGE 0xA7 136 - 137 - /* PMC Slave Module External Control */ 138 - #define TPS80031_REGEN1_CFG_TRANS 0xAE 139 - #define TPS80031_REGEN1_CFG_STATE 0xAF 140 - #define TPS80031_REGEN2_CFG_TRANS 0xB1 141 - #define TPS80031_REGEN2_CFG_STATE 0xB2 142 - #define TPS80031_SYSEN_CFG_TRANS 0xB4 143 - #define TPS80031_SYSEN_CFG_STATE 0xB5 144 - 145 - /* PMC Slave Module Internal Control */ 146 - #define TPS80031_NRESPWRON_CFG_TRANS 0xB7 147 - #define TPS80031_NRESPWRON_CFG_STATE 0xB8 148 - #define TPS80031_CLK32KAO_CFG_TRANS 0xBA 149 - #define TPS80031_CLK32KAO_CFG_STATE 0xBB 150 - #define TPS80031_CLK32KG_CFG_TRANS 0xBD 151 - #define TPS80031_CLK32KG_CFG_STATE 0xBE 152 - #define TPS80031_CLK32KAUDIO_CFG_TRANS 0xC0 153 - #define TPS80031_CLK32KAUDIO_CFG_STATE 0xC1 154 - #define TPS80031_VRTC_CFG_TRANS 0xC3 155 - #define TPS80031_VRTC_CFG_STATE 0xC4 156 - #define TPS80031_BIAS_CFG_TRANS 0xC6 157 - #define TPS80031_BIAS_CFG_STATE 0xC7 158 - #define TPS80031_VSYSMIN_HI_CFG_TRANS 0xC9 159 - #define TPS80031_VSYSMIN_HI_CFG_STATE 0xCA 160 - #define TPS80031_RC6MHZ_CFG_TRANS 0xCC 161 - #define TPS80031_RC6MHZ_CFG_STATE 0xCD 162 - #define TPS80031_TMP_CFG_TRANS 0xCF 163 - #define TPS80031_TMP_CFG_STATE 0xD0 164 - 165 - /* PMC Slave Module resources assignment */ 166 - #define TPS80031_PREQ1_RES_ASS_A 0xD7 167 - #define TPS80031_PREQ1_RES_ASS_B 0xD8 168 - #define TPS80031_PREQ1_RES_ASS_C 0xD9 169 - #define TPS80031_PREQ2_RES_ASS_A 0xDA 170 - #define TPS80031_PREQ2_RES_ASS_B 0xDB 171 - #define TPS80031_PREQ2_RES_ASS_C 0xDC 172 - #define TPS80031_PREQ3_RES_ASS_A 0xDD 173 - #define TPS80031_PREQ3_RES_ASS_B 0xDE 174 - #define TPS80031_PREQ3_RES_ASS_C 0xDF 175 - 176 - /* PMC Slave Module Miscellaneous */ 177 - #define TPS80031_SMPS_OFFSET 0xE0 178 - #define TPS80031_SMPS_MULT 0xE3 179 - #define TPS80031_MISC1 0xE4 180 - #define TPS80031_MISC2 0xE5 181 - #define TPS80031_BBSPOR_CFG 0xE6 182 - #define TPS80031_TMP_CFG 0xE7 183 - 184 - /* Battery Charging Controller and Indicator LED */ 185 - #define TPS80031_CONTROLLER_CTRL2 0xDA 186 - #define TPS80031_CONTROLLER_VSEL_COMP 0xDB 187 - #define TPS80031_CHARGERUSB_VSYSREG 0xDC 188 - #define TPS80031_CHARGERUSB_VICHRG_PC 0xDD 189 - #define TPS80031_LINEAR_CHRG_STS 0xDE 190 - #define TPS80031_CONTROLLER_INT_MASK 0xE0 191 - #define TPS80031_CONTROLLER_CTRL1 0xE1 192 - #define TPS80031_CONTROLLER_WDG 0xE2 193 - #define TPS80031_CONTROLLER_STAT1 0xE3 194 - #define TPS80031_CHARGERUSB_INT_STATUS 0xE4 195 - #define TPS80031_CHARGERUSB_INT_MASK 0xE5 196 - #define TPS80031_CHARGERUSB_STATUS_INT1 0xE6 197 - #define TPS80031_CHARGERUSB_STATUS_INT2 0xE7 198 - #define TPS80031_CHARGERUSB_CTRL1 0xE8 199 - #define TPS80031_CHARGERUSB_CTRL2 0xE9 200 - #define TPS80031_CHARGERUSB_CTRL3 0xEA 201 - #define TPS80031_CHARGERUSB_STAT1 0xEB 202 - #define TPS80031_CHARGERUSB_VOREG 0xEC 203 - #define TPS80031_CHARGERUSB_VICHRG 0xED 204 - #define TPS80031_CHARGERUSB_CINLIMIT 0xEE 205 - #define TPS80031_CHARGERUSB_CTRLLIMIT1 0xEF 206 - #define TPS80031_CHARGERUSB_CTRLLIMIT2 0xF0 207 - #define TPS80031_LED_PWM_CTRL1 0xF4 208 - #define TPS80031_LED_PWM_CTRL2 0xF5 209 - 210 - /* USB On-The-Go */ 211 - #define TPS80031_BACKUP_REG 0xFA 212 - #define TPS80031_USB_VENDOR_ID_LSB 0x00 213 - #define TPS80031_USB_VENDOR_ID_MSB 0x01 214 - #define TPS80031_USB_PRODUCT_ID_LSB 0x02 215 - #define TPS80031_USB_PRODUCT_ID_MSB 0x03 216 - #define TPS80031_USB_VBUS_CTRL_SET 0x04 217 - #define TPS80031_USB_VBUS_CTRL_CLR 0x05 218 - #define TPS80031_USB_ID_CTRL_SET 0x06 219 - #define TPS80031_USB_ID_CTRL_CLR 0x07 220 - #define TPS80031_USB_VBUS_INT_SRC 0x08 221 - #define TPS80031_USB_VBUS_INT_LATCH_SET 0x09 222 - #define TPS80031_USB_VBUS_INT_LATCH_CLR 0x0A 223 - #define TPS80031_USB_VBUS_INT_EN_LO_SET 0x0B 224 - #define TPS80031_USB_VBUS_INT_EN_LO_CLR 0x0C 225 - #define TPS80031_USB_VBUS_INT_EN_HI_SET 0x0D 226 - #define TPS80031_USB_VBUS_INT_EN_HI_CLR 0x0E 227 - #define TPS80031_USB_ID_INT_SRC 0x0F 228 - #define TPS80031_USB_ID_INT_LATCH_SET 0x10 229 - #define TPS80031_USB_ID_INT_LATCH_CLR 0x11 230 - #define TPS80031_USB_ID_INT_EN_LO_SET 0x12 231 - #define TPS80031_USB_ID_INT_EN_LO_CLR 0x13 232 - #define TPS80031_USB_ID_INT_EN_HI_SET 0x14 233 - #define TPS80031_USB_ID_INT_EN_HI_CLR 0x15 234 - #define TPS80031_USB_OTG_ADP_CTRL 0x16 235 - #define TPS80031_USB_OTG_ADP_HIGH 0x17 236 - #define TPS80031_USB_OTG_ADP_LOW 0x18 237 - #define TPS80031_USB_OTG_ADP_RISE 0x19 238 - #define TPS80031_USB_OTG_REVISION 0x1A 239 - 240 - /* Gas Gauge */ 241 - #define TPS80031_FG_REG_00 0xC0 242 - #define TPS80031_FG_REG_01 0xC1 243 - #define TPS80031_FG_REG_02 0xC2 244 - #define TPS80031_FG_REG_03 0xC3 245 - #define TPS80031_FG_REG_04 0xC4 246 - #define TPS80031_FG_REG_05 0xC5 247 - #define TPS80031_FG_REG_06 0xC6 248 - #define TPS80031_FG_REG_07 0xC7 249 - #define TPS80031_FG_REG_08 0xC8 250 - #define TPS80031_FG_REG_09 0xC9 251 - #define TPS80031_FG_REG_10 0xCA 252 - #define TPS80031_FG_REG_11 0xCB 253 - 254 - /* General Purpose ADC */ 255 - #define TPS80031_GPADC_CTRL 0x2E 256 - #define TPS80031_GPADC_CTRL2 0x2F 257 - #define TPS80031_RTSELECT_LSB 0x32 258 - #define TPS80031_RTSELECT_ISB 0x33 259 - #define TPS80031_RTSELECT_MSB 0x34 260 - #define TPS80031_GPSELECT_ISB 0x35 261 - #define TPS80031_CTRL_P1 0x36 262 - #define TPS80031_RTCH0_LSB 0x37 263 - #define TPS80031_RTCH0_MSB 0x38 264 - #define TPS80031_RTCH1_LSB 0x39 265 - #define TPS80031_RTCH1_MSB 0x3A 266 - #define TPS80031_GPCH0_LSB 0x3B 267 - #define TPS80031_GPCH0_MSB 0x3C 268 - 269 - /* SIM, MMC and Battery Detection */ 270 - #define TPS80031_SIMDEBOUNCING 0xEB 271 - #define TPS80031_SIMCTRL 0xEC 272 - #define TPS80031_MMCDEBOUNCING 0xED 273 - #define TPS80031_MMCCTRL 0xEE 274 - #define TPS80031_BATDEBOUNCING 0xEF 275 - 276 - /* Vibrator Driver and PWMs */ 277 - #define TPS80031_VIBCTRL 0x9B 278 - #define TPS80031_VIBMODE 0x9C 279 - #define TPS80031_PWM1ON 0xBA 280 - #define TPS80031_PWM1OFF 0xBB 281 - #define TPS80031_PWM2ON 0xBD 282 - #define TPS80031_PWM2OFF 0xBE 283 - 284 - /* Control Interface */ 285 - #define TPS80031_INT_STS_A 0xD0 286 - #define TPS80031_INT_STS_B 0xD1 287 - #define TPS80031_INT_STS_C 0xD2 288 - #define TPS80031_INT_MSK_LINE_A 0xD3 289 - #define TPS80031_INT_MSK_LINE_B 0xD4 290 - #define TPS80031_INT_MSK_LINE_C 0xD5 291 - #define TPS80031_INT_MSK_STS_A 0xD6 292 - #define TPS80031_INT_MSK_STS_B 0xD7 293 - #define TPS80031_INT_MSK_STS_C 0xD8 294 - #define TPS80031_TOGGLE1 0x90 295 - #define TPS80031_TOGGLE2 0x91 296 - #define TPS80031_TOGGLE3 0x92 297 - #define TPS80031_PWDNSTATUS1 0x93 298 - #define TPS80031_PWDNSTATUS2 0x94 299 - #define TPS80031_VALIDITY0 0x17 300 - #define TPS80031_VALIDITY1 0x18 301 - #define TPS80031_VALIDITY2 0x19 302 - #define TPS80031_VALIDITY3 0x1A 303 - #define TPS80031_VALIDITY4 0x1B 304 - #define TPS80031_VALIDITY5 0x1C 305 - #define TPS80031_VALIDITY6 0x1D 306 - #define TPS80031_VALIDITY7 0x1E 307 - 308 - /* Version number related register */ 309 - #define TPS80031_JTAGVERNUM 0x87 310 - #define TPS80031_EPROM_REV 0xDF 311 - 312 - /* GPADC Trimming Bits. */ 313 - #define TPS80031_GPADC_TRIM0 0xCC 314 - #define TPS80031_GPADC_TRIM1 0xCD 315 - #define TPS80031_GPADC_TRIM2 0xCE 316 - #define TPS80031_GPADC_TRIM3 0xCF 317 - #define TPS80031_GPADC_TRIM4 0xD0 318 - #define TPS80031_GPADC_TRIM5 0xD1 319 - #define TPS80031_GPADC_TRIM6 0xD2 320 - #define TPS80031_GPADC_TRIM7 0xD3 321 - #define TPS80031_GPADC_TRIM8 0xD4 322 - #define TPS80031_GPADC_TRIM9 0xD5 323 - #define TPS80031_GPADC_TRIM10 0xD6 324 - #define TPS80031_GPADC_TRIM11 0xD7 325 - #define TPS80031_GPADC_TRIM12 0xD8 326 - #define TPS80031_GPADC_TRIM13 0xD9 327 - #define TPS80031_GPADC_TRIM14 0xDA 328 - #define TPS80031_GPADC_TRIM15 0xDB 329 - #define TPS80031_GPADC_TRIM16 0xDC 330 - #define TPS80031_GPADC_TRIM17 0xDD 331 - #define TPS80031_GPADC_TRIM18 0xDE 332 - 333 - /* TPS80031_CONTROLLER_STAT1 bit fields */ 334 - #define TPS80031_CONTROLLER_STAT1_BAT_TEMP 0 335 - #define TPS80031_CONTROLLER_STAT1_BAT_REMOVED 1 336 - #define TPS80031_CONTROLLER_STAT1_VBUS_DET 2 337 - #define TPS80031_CONTROLLER_STAT1_VAC_DET 3 338 - #define TPS80031_CONTROLLER_STAT1_FAULT_WDG 4 339 - #define TPS80031_CONTROLLER_STAT1_LINCH_GATED 6 340 - /* TPS80031_CONTROLLER_INT_MASK bit filed */ 341 - #define TPS80031_CONTROLLER_INT_MASK_MVAC_DET 0 342 - #define TPS80031_CONTROLLER_INT_MASK_MVBUS_DET 1 343 - #define TPS80031_CONTROLLER_INT_MASK_MBAT_TEMP 2 344 - #define TPS80031_CONTROLLER_INT_MASK_MFAULT_WDG 3 345 - #define TPS80031_CONTROLLER_INT_MASK_MBAT_REMOVED 4 346 - #define TPS80031_CONTROLLER_INT_MASK_MLINCH_GATED 5 347 - 348 - #define TPS80031_CHARGE_CONTROL_SUB_INT_MASK 0x3F 349 - 350 - /* TPS80031_PHOENIX_DEV_ON bit field */ 351 - #define TPS80031_DEVOFF 0x1 352 - 353 - #define TPS80031_EXT_CONTROL_CFG_TRANS 0 354 - #define TPS80031_EXT_CONTROL_CFG_STATE 1 355 - 356 - /* State register field */ 357 - #define TPS80031_STATE_OFF 0x00 358 - #define TPS80031_STATE_ON 0x01 359 - #define TPS80031_STATE_MASK 0x03 360 - 361 - /* Trans register field */ 362 - #define TPS80031_TRANS_ACTIVE_OFF 0x00 363 - #define TPS80031_TRANS_ACTIVE_ON 0x01 364 - #define TPS80031_TRANS_ACTIVE_MASK 0x03 365 - #define TPS80031_TRANS_SLEEP_OFF 0x00 366 - #define TPS80031_TRANS_SLEEP_ON 0x04 367 - #define TPS80031_TRANS_SLEEP_MASK 0x0C 368 - #define TPS80031_TRANS_OFF_OFF 0x00 369 - #define TPS80031_TRANS_OFF_ACTIVE 0x10 370 - #define TPS80031_TRANS_OFF_MASK 0x30 371 - 372 - #define TPS80031_EXT_PWR_REQ (TPS80031_PWR_REQ_INPUT_PREQ1 | \ 373 - TPS80031_PWR_REQ_INPUT_PREQ2 | \ 374 - TPS80031_PWR_REQ_INPUT_PREQ3) 375 - 376 - /* TPS80031_BBSPOR_CFG bit field */ 377 - #define TPS80031_BBSPOR_CHG_EN 0x8 378 - #define TPS80031_MAX_REGISTER 0xFF 379 - 380 - struct i2c_client; 381 - 382 - /* Supported chips */ 383 - enum chips { 384 - TPS80031 = 0x00000001, 385 - TPS80032 = 0x00000002, 386 - }; 387 - 388 - enum { 389 - TPS80031_INT_PWRON, 390 - TPS80031_INT_RPWRON, 391 - TPS80031_INT_SYS_VLOW, 392 - TPS80031_INT_RTC_ALARM, 393 - TPS80031_INT_RTC_PERIOD, 394 - TPS80031_INT_HOT_DIE, 395 - TPS80031_INT_VXX_SHORT, 396 - TPS80031_INT_SPDURATION, 397 - TPS80031_INT_WATCHDOG, 398 - TPS80031_INT_BAT, 399 - TPS80031_INT_SIM, 400 - TPS80031_INT_MMC, 401 - TPS80031_INT_RES, 402 - TPS80031_INT_GPADC_RT, 403 - TPS80031_INT_GPADC_SW2_EOC, 404 - TPS80031_INT_CC_AUTOCAL, 405 - TPS80031_INT_ID_WKUP, 406 - TPS80031_INT_VBUSS_WKUP, 407 - TPS80031_INT_ID, 408 - TPS80031_INT_VBUS, 409 - TPS80031_INT_CHRG_CTRL, 410 - TPS80031_INT_EXT_CHRG, 411 - TPS80031_INT_INT_CHRG, 412 - TPS80031_INT_RES2, 413 - TPS80031_INT_BAT_TEMP_OVRANGE, 414 - TPS80031_INT_BAT_REMOVED, 415 - TPS80031_INT_VBUS_DET, 416 - TPS80031_INT_VAC_DET, 417 - TPS80031_INT_FAULT_WDG, 418 - TPS80031_INT_LINCH_GATED, 419 - 420 - /* Last interrupt id to get the end number */ 421 - TPS80031_INT_NR, 422 - }; 423 - 424 - /* TPS80031 Slave IDs */ 425 - #define TPS80031_NUM_SLAVES 4 426 - #define TPS80031_SLAVE_ID0 0 427 - #define TPS80031_SLAVE_ID1 1 428 - #define TPS80031_SLAVE_ID2 2 429 - #define TPS80031_SLAVE_ID3 3 430 - 431 - /* TPS80031 I2C addresses */ 432 - #define TPS80031_I2C_ID0_ADDR 0x12 433 - #define TPS80031_I2C_ID1_ADDR 0x48 434 - #define TPS80031_I2C_ID2_ADDR 0x49 435 - #define TPS80031_I2C_ID3_ADDR 0x4A 436 - 437 - enum { 438 - TPS80031_REGULATOR_VIO, 439 - TPS80031_REGULATOR_SMPS1, 440 - TPS80031_REGULATOR_SMPS2, 441 - TPS80031_REGULATOR_SMPS3, 442 - TPS80031_REGULATOR_SMPS4, 443 - TPS80031_REGULATOR_VANA, 444 - TPS80031_REGULATOR_LDO1, 445 - TPS80031_REGULATOR_LDO2, 446 - TPS80031_REGULATOR_LDO3, 447 - TPS80031_REGULATOR_LDO4, 448 - TPS80031_REGULATOR_LDO5, 449 - TPS80031_REGULATOR_LDO6, 450 - TPS80031_REGULATOR_LDO7, 451 - TPS80031_REGULATOR_LDOLN, 452 - TPS80031_REGULATOR_LDOUSB, 453 - TPS80031_REGULATOR_VBUS, 454 - TPS80031_REGULATOR_REGEN1, 455 - TPS80031_REGULATOR_REGEN2, 456 - TPS80031_REGULATOR_SYSEN, 457 - TPS80031_REGULATOR_MAX, 458 - }; 459 - 460 - /* Different configurations for the rails */ 461 - enum { 462 - /* USBLDO input selection */ 463 - TPS80031_USBLDO_INPUT_VSYS = 0x00000001, 464 - TPS80031_USBLDO_INPUT_PMID = 0x00000002, 465 - 466 - /* LDO3 output mode */ 467 - TPS80031_LDO3_OUTPUT_VIB = 0x00000004, 468 - 469 - /* VBUS configuration */ 470 - TPS80031_VBUS_DISCHRG_EN_PDN = 0x00000004, 471 - TPS80031_VBUS_SW_ONLY = 0x00000008, 472 - TPS80031_VBUS_SW_N_ID = 0x00000010, 473 - }; 474 - 475 - /* External controls requests */ 476 - enum tps80031_ext_control { 477 - TPS80031_PWR_REQ_INPUT_NONE = 0x00000000, 478 - TPS80031_PWR_REQ_INPUT_PREQ1 = 0x00000001, 479 - TPS80031_PWR_REQ_INPUT_PREQ2 = 0x00000002, 480 - TPS80031_PWR_REQ_INPUT_PREQ3 = 0x00000004, 481 - TPS80031_PWR_OFF_ON_SLEEP = 0x00000008, 482 - TPS80031_PWR_ON_ON_SLEEP = 0x00000010, 483 - }; 484 - 485 - enum tps80031_pupd_pins { 486 - TPS80031_PREQ1 = 0, 487 - TPS80031_PREQ2A, 488 - TPS80031_PREQ2B, 489 - TPS80031_PREQ2C, 490 - TPS80031_PREQ3, 491 - TPS80031_NRES_WARM, 492 - TPS80031_PWM_FORCE, 493 - TPS80031_CHRG_EXT_CHRG_STATZ, 494 - TPS80031_SIM, 495 - TPS80031_MMC, 496 - TPS80031_GPADC_START, 497 - TPS80031_DVSI2C_SCL, 498 - TPS80031_DVSI2C_SDA, 499 - TPS80031_CTLI2C_SCL, 500 - TPS80031_CTLI2C_SDA, 501 - }; 502 - 503 - enum tps80031_pupd_settings { 504 - TPS80031_PUPD_NORMAL, 505 - TPS80031_PUPD_PULLDOWN, 506 - TPS80031_PUPD_PULLUP, 507 - }; 508 - 509 - struct tps80031 { 510 - struct device *dev; 511 - unsigned long chip_info; 512 - int es_version; 513 - struct i2c_client *clients[TPS80031_NUM_SLAVES]; 514 - struct regmap *regmap[TPS80031_NUM_SLAVES]; 515 - struct regmap_irq_chip_data *irq_data; 516 - }; 517 - 518 - struct tps80031_pupd_init_data { 519 - int input_pin; 520 - int setting; 521 - }; 522 - 523 - /* 524 - * struct tps80031_regulator_platform_data - tps80031 regulator platform data. 525 - * 526 - * @reg_init_data: The regulator init data. 527 - * @ext_ctrl_flag: External control flag for sleep/power request control. 528 - * @config_flags: Configuration flag to configure the rails. 529 - * It should be ORed of config enums. 530 - */ 531 - 532 - struct tps80031_regulator_platform_data { 533 - struct regulator_init_data *reg_init_data; 534 - unsigned int ext_ctrl_flag; 535 - unsigned int config_flags; 536 - }; 537 - 538 - struct tps80031_platform_data { 539 - int irq_base; 540 - bool use_power_off; 541 - struct tps80031_pupd_init_data *pupd_init_data; 542 - int pupd_init_data_size; 543 - struct tps80031_regulator_platform_data 544 - *regulator_pdata[TPS80031_REGULATOR_MAX]; 545 - }; 546 - 547 - static inline int tps80031_write(struct device *dev, int sid, 548 - int reg, uint8_t val) 549 - { 550 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 551 - 552 - return regmap_write(tps80031->regmap[sid], reg, val); 553 - } 554 - 555 - static inline int tps80031_writes(struct device *dev, int sid, int reg, 556 - int len, uint8_t *val) 557 - { 558 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 559 - 560 - return regmap_bulk_write(tps80031->regmap[sid], reg, val, len); 561 - } 562 - 563 - static inline int tps80031_read(struct device *dev, int sid, 564 - int reg, uint8_t *val) 565 - { 566 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 567 - unsigned int ival; 568 - int ret; 569 - 570 - ret = regmap_read(tps80031->regmap[sid], reg, &ival); 571 - if (ret < 0) { 572 - dev_err(dev, "failed reading from reg 0x%02x\n", reg); 573 - return ret; 574 - } 575 - 576 - *val = ival; 577 - return ret; 578 - } 579 - 580 - static inline int tps80031_reads(struct device *dev, int sid, 581 - int reg, int len, uint8_t *val) 582 - { 583 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 584 - 585 - return regmap_bulk_read(tps80031->regmap[sid], reg, val, len); 586 - } 587 - 588 - static inline int tps80031_set_bits(struct device *dev, int sid, 589 - int reg, uint8_t bit_mask) 590 - { 591 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 592 - 593 - return regmap_update_bits(tps80031->regmap[sid], reg, 594 - bit_mask, bit_mask); 595 - } 596 - 597 - static inline int tps80031_clr_bits(struct device *dev, int sid, 598 - int reg, uint8_t bit_mask) 599 - { 600 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 601 - 602 - return regmap_update_bits(tps80031->regmap[sid], reg, bit_mask, 0); 603 - } 604 - 605 - static inline int tps80031_update(struct device *dev, int sid, 606 - int reg, uint8_t val, uint8_t mask) 607 - { 608 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 609 - 610 - return regmap_update_bits(tps80031->regmap[sid], reg, mask, val); 611 - } 612 - 613 - static inline unsigned long tps80031_get_chip_info(struct device *dev) 614 - { 615 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 616 - 617 - return tps80031->chip_info; 618 - } 619 - 620 - static inline int tps80031_get_pmu_version(struct device *dev) 621 - { 622 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 623 - 624 - return tps80031->es_version; 625 - } 626 - 627 - static inline int tps80031_irq_get_virq(struct device *dev, int irq) 628 - { 629 - struct tps80031 *tps80031 = dev_get_drvdata(dev); 630 - 631 - return regmap_irq_get_virq(tps80031->irq_data, irq); 632 - } 633 - 634 - extern int tps80031_ext_power_req_config(struct device *dev, 635 - unsigned long ext_ctrl_flag, int preq_bit, 636 - int state_reg_add, int trans_reg_add); 637 - #endif /*__LINUX_MFD_TPS80031_H */