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

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

Pull MFD updates from Lee Jones:
"Core Frameworks:
- Allow all MFD Cell properties to be filled in dynamically at
runtime
- Skip disabled device nodes and continue to look for subsequent
devices

New Device Support:
- Add support for Lunar Lake-M PCI to Intel LPSS PCI
- Add support for Denverton to Intel ICH LPC

New Functionality:
- Add support for Clocks to Texas Instruments TWL* Core
- Add support for Interrupts to STMicroelectronics STM32 Timers

Fix-ups:
- Convert to new devm-* (managed) power-off API
- Remove superfluous code
- Bunch of Device Tree additions, conversions and adaptions
- Simplify obtaining resources (memory, device data) using unified
API helpers
- Trivial coding-style / spelling type clean-ups
- Constify / staticify changes
- Expand or edit on existing documentation
- Convert some Regmap configurations to use the Maple Tree cache
- Apply new __counted_by() annotation to several data structures
containing flexible arrays
- Replace strncpy() with strscpy()

Bug Fixes:
- Remove double put creating reference imbalances
- Ensure headphone/lineout detection gets set when booting with ACPI"

* tag 'mfd-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits)
mfd: lpc_ich: Mark *_gpio_offsets data with const
spmi: rename spmi device lookup helper
spmi: document spmi_device_from_of() refcounting
dt-bindings: mfd: armltd: Move Arm board syscon's to separate schema
mfd: rk8xx: Add support for RK806 power off
mfd: rk8xx: Add support for standard system-power-controller property
dt-bindings: mfd: rk806: Allow system-power-controller property
dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller
dt-bindings: mfd: max8925: Convert to DT schema format
mfd: Use i2c_get_match_data() in a selection of drivers
mfd: Use device_get_match_data() in a bunch of drivers
mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data()
mfd: motorola-cpcap: Drop unnecessary of_match_device() call
mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs
mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL()
mfd: qcom-spmi-pmic: Fix revid implementation
mfd: qcom-spmi-pmic: Fix reference leaks in revid helper
mfd: intel-m10-bmc: Change contact for ABI docs
mfd: max8907: Convert to use maple tree register cache
mfd: max77686: Convert to use maple tree register cache
...

+1163 -734
+2 -2
Documentation/ABI/testing/sysfs-driver-intel-m10-bmc
··· 17 17 What: /sys/bus/.../drivers/intel-m10-bmc/.../mac_address 18 18 Date: January 2021 19 19 KernelVersion: 5.12 20 - Contact: Russ Weight <russell.h.weight@intel.com> 20 + Contact: Peter Colberg <peter.colberg@intel.com> 21 21 Description: Read only. Returns the first MAC address in a block 22 22 of sequential MAC addresses assigned to the board 23 23 that is managed by the Intel MAX10 BMC. It is stored in ··· 28 28 What: /sys/bus/.../drivers/intel-m10-bmc/.../mac_count 29 29 Date: January 2021 30 30 KernelVersion: 5.12 31 - Contact: Russ Weight <russell.h.weight@intel.com> 31 + Contact: Peter Colberg <peter.colberg@intel.com> 32 32 Description: Read only. Returns the number of sequential MAC 33 33 addresses assigned to the board managed by the Intel 34 34 MAX10 BMC. This value is stored in FLASH and is mirrored
-39
Documentation/devicetree/bindings/arm/arm,integrator.yaml
··· 40 40 items: 41 41 - const: arm,integrator-sp 42 42 43 - core-module@10000000: 44 - type: object 45 - description: the root node in the Integrator platforms must contain 46 - a core module child node. They are always at physical address 47 - 0x10000000 in all the Integrator variants. 48 - properties: 49 - compatible: 50 - items: 51 - - const: arm,core-module-integrator 52 - - const: syscon 53 - - const: simple-mfd 54 - reg: 55 - maxItems: 1 56 - 57 - required: 58 - - compatible 59 - - reg 60 - 61 - patternProperties: 62 - "^syscon@[0-9a-f]+$": 63 - description: All Integrator boards must provide a system controller as a 64 - node in the root of the device tree. 65 - type: object 66 - properties: 67 - compatible: 68 - items: 69 - - enum: 70 - - arm,integrator-ap-syscon 71 - - arm,integrator-cp-syscon 72 - - arm,integrator-sp-syscon 73 - - const: syscon 74 - reg: 75 - maxItems: 1 76 - 77 - required: 78 - - compatible 79 - - reg 80 - 81 - 82 43 required: 83 44 - compatible 84 45 - core-module@10000000
-37
Documentation/devicetree/bindings/arm/arm,realview.yaml
··· 75 75 type: object 76 76 description: All RealView boards must provide a syscon system controller 77 77 node inside the soc node. 78 - properties: 79 - compatible: 80 - oneOf: 81 - - items: 82 - - const: arm,realview-eb11mp-revb-syscon 83 - - const: arm,realview-eb-syscon 84 - - const: syscon 85 - - const: simple-mfd 86 - - items: 87 - - const: arm,realview-eb11mp-revc-syscon 88 - - const: arm,realview-eb-syscon 89 - - const: syscon 90 - - const: simple-mfd 91 - - items: 92 - - const: arm,realview-eb-syscon 93 - - const: syscon 94 - - const: simple-mfd 95 - - items: 96 - - const: arm,realview-pb1176-syscon 97 - - const: syscon 98 - - const: simple-mfd 99 - - items: 100 - - const: arm,realview-pb11mp-syscon 101 - - const: syscon 102 - - const: simple-mfd 103 - - items: 104 - - const: arm,realview-pba8-syscon 105 - - const: syscon 106 - - const: simple-mfd 107 - - items: 108 - - const: arm,realview-pbx-syscon 109 - - const: syscon 110 - - const: simple-mfd 111 - 112 - required: 113 - - compatible 114 - - reg 115 78 116 79 required: 117 80 - compatible
+8 -32
Documentation/devicetree/bindings/arm/arm,versatile.yaml
··· 14 14 with various pluggable interface boards, in essence the Versatile PB version 15 15 is a superset of the Versatile AB version. 16 16 17 + The root node in the Versatile platforms must contain a core module child 18 + node. They are always at physical address 0x10000000 in all the Versatile 19 + variants. 20 + 21 + When fitted with the IB2 Interface Board, the Versatile AB will present an 22 + optional system controller node which controls the extra peripherals on the 23 + interface board. 24 + 17 25 properties: 18 26 $nodename: 19 27 const: '/' ··· 39 31 for ARM926EJ-S. See ARM DUI 0224B. 40 32 items: 41 33 - const: arm,versatile-pb 42 - 43 - core-module@10000000: 44 - type: object 45 - description: the root node in the Versatile platforms must contain 46 - a core module child node. They are always at physical address 47 - 0x10000000 in all the Versatile variants. 48 - properties: 49 - compatible: 50 - items: 51 - - const: arm,core-module-versatile 52 - - const: syscon 53 - - const: simple-mfd 54 - reg: 55 - maxItems: 1 56 - 57 - required: 58 - - compatible 59 - - reg 60 - 61 - patternProperties: 62 - "^syscon@[0-9a-f]+$": 63 - type: object 64 - description: When fitted with the IB2 Interface Board, the Versatile 65 - AB will present an optional system controller node which controls the 66 - extra peripherals on the interface board. 67 - properties: 68 - compatible: 69 - contains: 70 - const: arm,versatile-ib2-syscon 71 - required: 72 - - compatible 73 - - reg 74 34 75 35 required: 76 36 - compatible
+1 -1
Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
··· 1 1 Texas Instruments TWL family (twl4030) pwrbutton module 2 2 3 3 This module is part of the TWL4030. For more details about the whole 4 - chip see Documentation/devicetree/bindings/mfd/twl-family.txt. 4 + chip see Documentation/devicetree/bindings/mfd/ti,twl.yaml. 5 5 6 6 This module provides a simple power button event via an Interrupt. 7 7
-10
Documentation/devicetree/bindings/leds/backlight/max8925-backlight.txt
··· 1 - 88pm860x-backlight bindings 2 - 3 - Optional properties: 4 - - maxim,max8925-dual-string: whether support dual string 5 - 6 - Example: 7 - 8 - backlights { 9 - maxim,max8925-dual-string = <0>; 10 - };
+1 -1
Documentation/devicetree/bindings/leds/register-bit-led.yaml
··· 60 60 - | 61 61 62 62 syscon@10000000 { 63 - compatible = "arm,realview-pb1176-syscon", "syscon"; 63 + compatible = "arm,realview-pb1176-syscon", "syscon", "simple-mfd"; 64 64 reg = <0x10000000 0x1000>; 65 65 #address-cells = <1>; 66 66 #size-cells = <1>;
+67
Documentation/devicetree/bindings/mfd/arm,dev-platforms-syscon.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/arm,dev-platforms-syscon.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Arm Ltd Developer Platforms System Controllers 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + description: 13 + The Arm Ltd Integrator, Realview, and Versatile families of developer 14 + platforms are contain various system controller blocks. Often these blocks 15 + are part of a daughterboard or motherboard module. 16 + 17 + properties: 18 + compatible: 19 + oneOf: 20 + - items: 21 + - enum: 22 + - arm,integrator-ap-syscon 23 + - arm,integrator-cp-syscon 24 + - arm,integrator-sp-syscon 25 + - arm,im-pd1-syscon 26 + - const: syscon 27 + - items: 28 + - enum: 29 + - arm,core-module-integrator 30 + - arm,integrator-ap-syscon 31 + - arm,integrator-cp-syscon 32 + - arm,integrator-sp-syscon 33 + - arm,realview-eb-syscon 34 + - arm,realview-pb1176-syscon 35 + - arm,realview-pb11mp-syscon 36 + - arm,realview-pba8-syscon 37 + - arm,realview-pbx-syscon 38 + - arm,versatile-ib2-syscon 39 + - const: syscon 40 + - const: simple-mfd 41 + - items: 42 + - enum: 43 + - arm,realview-eb11mp-revb-syscon 44 + - arm,realview-eb11mp-revc-syscon 45 + - const: arm,realview-eb-syscon 46 + - const: syscon 47 + - const: simple-mfd 48 + 49 + reg: 50 + maxItems: 1 51 + 52 + ranges: true 53 + 54 + '#address-cells': 55 + const: 1 56 + 57 + '#size-cells': 58 + const: 1 59 + 60 + required: 61 + - compatible 62 + - reg 63 + 64 + additionalProperties: 65 + type: object 66 + 67 + ...
-64
Documentation/devicetree/bindings/mfd/max8925.txt
··· 1 - * Maxim max8925 Power Management IC 2 - 3 - Required parent device properties: 4 - - compatible : "maxim,max8925" 5 - - reg : the I2C slave address for the max8925 chip 6 - - interrupts : IRQ line for the max8925 chip 7 - - interrupt-controller: describes the max8925 as an interrupt 8 - controller (has its own domain) 9 - - #interrupt-cells : should be 1. 10 - - The cell is the max8925 local IRQ number 11 - 12 - Optional parent device properties: 13 - - maxim,tsc-irq: there are 2 IRQ lines for max8925, one is indicated in 14 - interrupts property, the other is indicated here. 15 - 16 - max8925 consists of a large and varied group of sub-devices: 17 - 18 - Device Supply Names Description 19 - ------ ------------ ----------- 20 - max8925-onkey : : On key 21 - max8925-rtc : : RTC 22 - max8925-regulator : : Regulators 23 - max8925-backlight : : Backlight 24 - max8925-touch : : Touchscreen 25 - max8925-power : : Charger 26 - 27 - Example: 28 - 29 - pmic: max8925@3c { 30 - compatible = "maxim,max8925"; 31 - reg = <0x3c>; 32 - interrupts = <1>; 33 - interrupt-parent = <&intcmux4>; 34 - interrupt-controller; 35 - #interrupt-cells = <1>; 36 - maxim,tsc-irq = <0>; 37 - 38 - regulators { 39 - SDV1 { 40 - regulator-min-microvolt = <637500>; 41 - regulator-max-microvolt = <1425000>; 42 - regulator-boot-on; 43 - regulator-always-on; 44 - }; 45 - 46 - LDO1 { 47 - regulator-min-microvolt = <750000>; 48 - regulator-max-microvolt = <3900000>; 49 - regulator-boot-on; 50 - regulator-always-on; 51 - }; 52 - 53 - }; 54 - backlight { 55 - maxim,max8925-dual-string = <0>; 56 - }; 57 - charger { 58 - batt-detect = <0>; 59 - topoff-threshold = <1>; 60 - fast-charge = <7>; 61 - no-temp-support = <0>; 62 - no-insert-detect = <0>; 63 - }; 64 - };
-125
Documentation/devicetree/bindings/mfd/max8998.txt
··· 1 - * Maxim MAX8998, National/TI LP3974 multi-function device 2 - 3 - The Maxim MAX8998 is a multi-function device which includes voltage/current 4 - regulators, real time clock, battery charging controller and several 5 - other sub-blocks. It is interfaced using an I2C interface. Each sub-block 6 - is addressed by the host system using different i2c slave address. 7 - 8 - PMIC sub-block 9 - -------------- 10 - 11 - The PMIC sub-block contains a number of voltage and current regulators, 12 - with controllable parameters and dynamic voltage scaling capability. 13 - In addition, it includes a real time clock and battery charging controller 14 - as well. It is accessible at I2C address 0x66. 15 - 16 - Required properties: 17 - - compatible: Should be one of the following: 18 - - "maxim,max8998" for Maxim MAX8998 19 - - "national,lp3974" or "ti,lp3974" for National/TI LP3974. 20 - - reg: Specifies the i2c slave address of the pmic block. It should be 0x66. 21 - 22 - Optional properties: 23 - - interrupts: Interrupt specifiers for two interrupt sources. 24 - - First interrupt specifier is for main interrupt. 25 - - Second interrupt specifier is for power-on/-off interrupt. 26 - - max8998,pmic-buck1-dvs-gpios: GPIO specifiers for two host gpios used 27 - for buck 1 dvs. The format of the gpio specifier depends on the gpio 28 - controller. 29 - - max8998,pmic-buck2-dvs-gpio: GPIO specifier for host gpio used 30 - for buck 2 dvs. The format of the gpio specifier depends on the gpio 31 - controller. 32 - - max8998,pmic-buck1-default-dvs-idx: Default voltage setting selected from 33 - the possible 4 options selectable by the dvs gpios. The value of this 34 - property should be 0, 1, 2 or 3. If not specified or out of range, 35 - a default value of 0 is taken. 36 - - max8998,pmic-buck2-default-dvs-idx: Default voltage setting selected from 37 - the possible 2 options selectable by the dvs gpios. The value of this 38 - property should be 0 or 1. If not specified or out of range, a default 39 - value of 0 is taken. 40 - - max8998,pmic-buck-voltage-lock: If present, disallows changing of 41 - preprogrammed buck dvfs voltages. 42 - 43 - Additional properties required if max8998,pmic-buck1-dvs-gpios is defined: 44 - - max8998,pmic-buck1-dvs-voltage: An array of 4 voltage values in microvolts 45 - for buck1 regulator that can be selected using dvs gpio. 46 - 47 - Additional properties required if max8998,pmic-buck2-dvs-gpio is defined: 48 - - max8998,pmic-buck2-dvs-voltage: An array of 2 voltage values in microvolts 49 - for buck2 regulator that can be selected using dvs gpio. 50 - 51 - Regulators: All the regulators of MAX8998 to be instantiated shall be 52 - listed in a child node named 'regulators'. Each regulator is represented 53 - by a child node of the 'regulators' node. 54 - 55 - regulator-name { 56 - /* standard regulator bindings here */ 57 - }; 58 - 59 - Following regulators of the MAX8998 PMIC block are supported. Note that 60 - the 'n' in regulator name, as in LDOn or BUCKn, represents the LDO or BUCK 61 - number as described in MAX8998 datasheet. 62 - 63 - - LDOn 64 - - valid values for n are 2 to 17 65 - - Example: LDO2, LDO10, LDO17 66 - - BUCKn 67 - - valid values for n are 1 to 4. 68 - - Example: BUCK1, BUCK2, BUCK3, BUCK4 69 - 70 - - ENVICHG: Battery Charging Current Monitor Output. This is a fixed 71 - voltage type regulator 72 - 73 - - ESAFEOUT1: (ldo19) 74 - - ESAFEOUT2: (ld020) 75 - 76 - - CHARGER: main battery charger current control 77 - 78 - Standard regulator bindings are used inside regulator subnodes. Check 79 - Documentation/devicetree/bindings/regulator/regulator.txt 80 - for more details. 81 - 82 - Example: 83 - 84 - pmic@66 { 85 - compatible = "maxim,max8998-pmic"; 86 - reg = <0x66>; 87 - interrupt-parent = <&wakeup_eint>; 88 - interrupts = <4 0>, <3 0>; 89 - 90 - /* Buck 1 DVS settings */ 91 - max8998,pmic-buck1-default-dvs-idx = <0>; 92 - max8998,pmic-buck1-dvs-gpios = <&gpx0 0 1 0 0>, /* SET1 */ 93 - <&gpx0 1 1 0 0>; /* SET2 */ 94 - max8998,pmic-buck1-dvs-voltage = <1350000>, <1300000>, 95 - <1000000>, <950000>; 96 - 97 - /* Buck 2 DVS settings */ 98 - max8998,pmic-buck2-default-dvs-idx = <0>; 99 - max8998,pmic-buck2-dvs-gpio = <&gpx0 0 3 0 0>; /* SET3 */ 100 - max8998,pmic-buck2-dvs-voltage = <1350000>, <1300000>; 101 - 102 - /* Regulators to instantiate */ 103 - regulators { 104 - ldo2_reg: LDO2 { 105 - regulator-name = "VDD_ALIVE_1.1V"; 106 - regulator-min-microvolt = <1100000>; 107 - regulator-max-microvolt = <1100000>; 108 - regulator-always-on; 109 - }; 110 - 111 - buck1_reg: BUCK1 { 112 - regulator-name = "VDD_ARM_1.2V"; 113 - regulator-min-microvolt = <950000>; 114 - regulator-max-microvolt = <1350000>; 115 - regulator-always-on; 116 - regulator-boot-on; 117 - }; 118 - 119 - charger_reg: CHARGER { 120 - regulator-name = "CHARGER"; 121 - regulator-min-microamp = <90000>; 122 - regulator-max-microamp = <800000>; 123 - }; 124 - }; 125 - };
+5
Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
··· 45 45 patternProperties: 46 46 "^led@[0-3]$": 47 47 $ref: /schemas/leds/common.yaml# 48 + unevaluatedProperties: false 48 49 type: object 50 + 51 + properties: 52 + reg: 53 + maximum: 3 49 54 50 55 additionalProperties: false 51 56
+145
Documentation/devicetree/bindings/mfd/maxim,max8925.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/maxim,max8925.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MAX8925 PMIC from Maxim Integrated. 8 + 9 + maintainers: 10 + - Lee Jones <lee@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + const: maxim,max8925 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + interrupt-controller: true 23 + 24 + "#interrupt-cells": 25 + const: 1 26 + description: 27 + The cell is the IRQ number 28 + 29 + maxim,tsc-irq: 30 + description: second interrupt from max8925 31 + $ref: /schemas/types.yaml#/definitions/uint32 32 + 33 + regulators: 34 + type: object 35 + 36 + patternProperties: 37 + "^SDV[1-3]$|^LDO[1-9]$|^LDO1[0-9]$|^LDO20$": 38 + description: regulator configuration for SDV1-3 and LDO1-20 39 + $ref: /schemas/regulator/regulator.yaml 40 + unevaluatedProperties: false 41 + 42 + additionalProperties: false 43 + 44 + backlight: 45 + type: object 46 + properties: 47 + maxim,max8925-dual-string: 48 + description: set to 1 to support dual string 49 + $ref: /schemas/types.yaml#/definitions/uint32 50 + enum: [0, 1] 51 + default: 0 52 + 53 + additionalProperties: false 54 + 55 + charger: 56 + type: object 57 + properties: 58 + batt-detect: 59 + description: set to 1 if battery detection via ID pin is supported 60 + $ref: /schemas/types.yaml#/definitions/uint32 61 + enum: [0, 1] 62 + default: 0 63 + 64 + topoff-threshold: 65 + description: charging current in topoff mode, configures bits 5-6 in CHG_CNTL1 66 + $ref: /schemas/types.yaml#/definitions/uint32 67 + minimum: 0 68 + maximum: 3 69 + default: 0 70 + 71 + fast-charge: 72 + description: set charging current in fast mode, configures bits 0-3 in CHG_CNTL1 73 + $ref: /schemas/types.yaml#/definitions/uint32 74 + minimum: 0 75 + maximum: 7 76 + default: 0 77 + 78 + no-temp-support: 79 + description: set to 1 if temperature sensing is not supported 80 + $ref: /schemas/types.yaml#/definitions/uint32 81 + enum: [0, 1] 82 + default: 0 83 + 84 + no-insert-detect: 85 + description: set to 1 if AC detection is not supported 86 + $ref: /schemas/types.yaml#/definitions/uint32 87 + enum: [0, 1] 88 + default: 0 89 + 90 + additionalProperties: false 91 + 92 + required: 93 + - compatible 94 + - reg 95 + - interrupts 96 + - interrupt-controller 97 + - "#interrupt-cells" 98 + - regulators 99 + 100 + additionalProperties: false 101 + 102 + examples: 103 + - | 104 + i2c { 105 + #address-cells = <1>; 106 + #size-cells = <0>; 107 + 108 + pmic@3c { 109 + compatible = "maxim,max8925"; 110 + reg = <0x3c>; 111 + interrupts = <1>; 112 + interrupt-parent = <&intcmux4>; 113 + interrupt-controller; 114 + #interrupt-cells = <1>; 115 + maxim,tsc-irq = <0>; 116 + 117 + regulators { 118 + SDV1 { 119 + regulator-min-microvolt = <637500>; 120 + regulator-max-microvolt = <1425000>; 121 + regulator-boot-on; 122 + regulator-always-on; 123 + }; 124 + 125 + LDO1 { 126 + regulator-min-microvolt = <750000>; 127 + regulator-max-microvolt = <3900000>; 128 + regulator-boot-on; 129 + regulator-always-on; 130 + }; 131 + }; 132 + 133 + backlight { 134 + maxim,max8925-dual-string = <0>; 135 + }; 136 + 137 + charger { 138 + batt-detect = <0>; 139 + topoff-threshold = <1>; 140 + fast-charge = <7>; 141 + no-temp-support = <0>; 142 + no-insert-detect = <0>; 143 + }; 144 + }; 145 + };
+324
Documentation/devicetree/bindings/mfd/maxim,max8998.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/maxim,max8998.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX8998, National/TI LP3974 Power Management IC 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzk@kernel.org> 11 + 12 + description: 13 + The Maxim MAX8998 is a Power Management IC which includes voltage/current 14 + regulators, real time clock, battery charging controller and several other 15 + sub-blocks. It is interfaced using an I2C interface. Each sub-block is 16 + addressed by the host system using different i2c slave address. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - maxim,max8998 22 + - national,lp3974 23 + - ti,lp3974 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + interrupts: 29 + minItems: 1 30 + items: 31 + - description: Main interrupt 32 + - description: Power-on/-off interrupt 33 + 34 + max8998,pmic-buck1-dvs-gpios: 35 + maxItems: 2 36 + description: 37 + Two host gpios used for buck1 DVS. 38 + 39 + max8998,pmic-buck2-dvs-gpio: 40 + maxItems: 1 41 + description: 42 + Host gpio used for buck2 DVS. 43 + 44 + max8998,pmic-buck1-default-dvs-idx: 45 + $ref: /schemas/types.yaml#/definitions/uint32 46 + enum: [0, 1, 2, 3] 47 + default: 0 48 + description: 49 + Default voltage setting selected from the possible 4 options selectable 50 + by the DVS gpios. 51 + 52 + max8998,pmic-buck2-default-dvs-idx: 53 + $ref: /schemas/types.yaml#/definitions/uint32 54 + enum: [0, 1] 55 + default: 0 56 + description: 57 + Default voltage setting selected from the possible 2 options selectable 58 + by the DVS GPIOs. 59 + 60 + max8998,pmic-buck-voltage-lock: 61 + type: boolean 62 + description: 63 + If present, disallows changing of preprogrammed buck DVS voltages. 64 + 65 + max8998,pmic-buck1-dvs-voltage: 66 + $ref: /schemas/types.yaml#/definitions/uint32-array 67 + maxItems: 4 68 + description: 69 + Four voltage values in microvolts for buck1 regulator that can be 70 + selected using DVS GPIO. 71 + 72 + max8998,pmic-buck2-dvs-voltage: 73 + $ref: /schemas/types.yaml#/definitions/uint32-array 74 + maxItems: 2 75 + description: 76 + Two voltage values in microvolts for buck2 regulator that can be 77 + selected using DVS GPIO. 78 + 79 + regulators: 80 + type: object 81 + additionalProperties: false 82 + 83 + properties: 84 + CHARGER: 85 + type: object 86 + $ref: /schemas/regulator/regulator.yaml# 87 + unevaluatedProperties: false 88 + description: 89 + CHARGER is main battery charger current control, wrongly represented 90 + as regulator. 91 + 92 + properties: 93 + regulator-min-microamp: 94 + minimum: 90000 95 + maximum: 800000 96 + 97 + regulator-max-microamp: 98 + minimum: 90000 99 + maximum: 800000 100 + 101 + regulator-min-microvolt: false 102 + regulator-max-microvolt: false 103 + 104 + required: 105 + - regulator-name 106 + 107 + patternProperties: 108 + "^(LDO([2-9]|1[0-7])|BUCK[1-4])$": 109 + type: object 110 + $ref: /schemas/regulator/regulator.yaml# 111 + unevaluatedProperties: false 112 + 113 + required: 114 + - regulator-name 115 + 116 + "^(EN32KHz-AP|EN32KHz-CP|ENVICHG|ESAFEOUT[12])$": 117 + type: object 118 + $ref: /schemas/regulator/regulator.yaml# 119 + unevaluatedProperties: false 120 + description: | 121 + EN32KHz-AP and EN32KHz-CP are 32768 Hz clocks, wrongly represented as 122 + regulators. 123 + ENVICHG is a Battery Charging Current Monitor Output. 124 + 125 + properties: 126 + regulator-min-microvolt: false 127 + regulator-max-microvolt: false 128 + 129 + required: 130 + - regulator-name 131 + 132 + dependencies: 133 + max8998,pmic-buck1-dvs-gpios: [ "max8998,pmic-buck1-dvs-voltage" ] 134 + max8998,pmic-buck2-dvs-gpio: [ "max8998,pmic-buck2-dvs-voltage" ] 135 + 136 + required: 137 + - compatible 138 + - reg 139 + - regulators 140 + 141 + additionalProperties: false 142 + 143 + examples: 144 + - | 145 + #include <dt-bindings/gpio/gpio.h> 146 + #include <dt-bindings/interrupt-controller/irq.h> 147 + 148 + i2c { 149 + #address-cells = <1>; 150 + #size-cells = <0>; 151 + 152 + pmic@66 { 153 + compatible = "national,lp3974"; 154 + reg = <0x66>; 155 + interrupts-extended = <&gpx0 7 IRQ_TYPE_LEVEL_LOW>, 156 + <&gpx2 7 IRQ_TYPE_LEVEL_LOW>; 157 + pinctrl-names = "default"; 158 + pinctrl-0 = <&lp3974_irq>; 159 + 160 + max8998,pmic-buck1-default-dvs-idx = <0>; 161 + max8998,pmic-buck1-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>, 162 + <&gpx0 6 GPIO_ACTIVE_HIGH>; 163 + max8998,pmic-buck1-dvs-voltage = <1100000>, <1000000>, 164 + <1100000>, <1000000>; 165 + max8998,pmic-buck2-default-dvs-idx = <0>; 166 + max8998,pmic-buck2-dvs-gpio = <&gpe2 0 GPIO_ACTIVE_HIGH>; 167 + max8998,pmic-buck2-dvs-voltage = <1200000>, <1100000>; 168 + 169 + regulators { 170 + LDO2 { 171 + regulator-name = "VALIVE_1.2V"; 172 + regulator-min-microvolt = <1200000>; 173 + regulator-max-microvolt = <1200000>; 174 + regulator-always-on; 175 + }; 176 + 177 + LDO3 { 178 + regulator-name = "VUSB+MIPI_1.1V"; 179 + regulator-min-microvolt = <1100000>; 180 + regulator-max-microvolt = <1100000>; 181 + regulator-always-on; 182 + }; 183 + 184 + LDO4 { 185 + regulator-name = "VADC_3.3V"; 186 + regulator-min-microvolt = <3300000>; 187 + regulator-max-microvolt = <3300000>; 188 + }; 189 + 190 + LDO5 { 191 + regulator-name = "VTF_2.8V"; 192 + regulator-min-microvolt = <2800000>; 193 + regulator-max-microvolt = <2800000>; 194 + }; 195 + 196 + LDO6 { 197 + regulator-name = "LDO6"; 198 + regulator-min-microvolt = <2000000>; 199 + regulator-max-microvolt = <2000000>; 200 + }; 201 + 202 + LDO7 { 203 + regulator-name = "VLCD+VMIPI_1.8V"; 204 + regulator-min-microvolt = <1800000>; 205 + regulator-max-microvolt = <1800000>; 206 + }; 207 + 208 + LDO8 { 209 + regulator-name = "VUSB+VDAC_3.3V"; 210 + regulator-min-microvolt = <3300000>; 211 + regulator-max-microvolt = <3300000>; 212 + regulator-always-on; 213 + }; 214 + 215 + LDO9 { 216 + regulator-name = "VCC_2.8V"; 217 + regulator-min-microvolt = <2800000>; 218 + regulator-max-microvolt = <2800000>; 219 + regulator-always-on; 220 + }; 221 + 222 + LDO10 { 223 + regulator-name = "VPLL_1.1V"; 224 + regulator-min-microvolt = <1100000>; 225 + regulator-max-microvolt = <1100000>; 226 + regulator-boot-on; 227 + regulator-always-on; 228 + }; 229 + 230 + LDO11 { 231 + regulator-name = "CAM_AF_3.3V"; 232 + regulator-min-microvolt = <3300000>; 233 + regulator-max-microvolt = <3300000>; 234 + }; 235 + 236 + LDO12 { 237 + regulator-name = "PS_2.8V"; 238 + regulator-min-microvolt = <2800000>; 239 + regulator-max-microvolt = <2800000>; 240 + }; 241 + 242 + LDO13 { 243 + regulator-name = "VHIC_1.2V"; 244 + regulator-min-microvolt = <1200000>; 245 + regulator-max-microvolt = <1200000>; 246 + }; 247 + 248 + LDO14 { 249 + regulator-name = "CAM_I_HOST_1.8V"; 250 + regulator-min-microvolt = <1800000>; 251 + regulator-max-microvolt = <1800000>; 252 + }; 253 + 254 + LDO15 { 255 + regulator-name = "CAM_S_DIG+FM33_CORE_1.2V"; 256 + regulator-min-microvolt = <1200000>; 257 + regulator-max-microvolt = <1200000>; 258 + }; 259 + 260 + LDO16 { 261 + regulator-name = "CAM_S_ANA_2.8V"; 262 + regulator-min-microvolt = <2800000>; 263 + regulator-max-microvolt = <2800000>; 264 + }; 265 + 266 + LDO17 { 267 + regulator-name = "VCC_3.0V_LCD"; 268 + regulator-min-microvolt = <3000000>; 269 + regulator-max-microvolt = <3000000>; 270 + }; 271 + 272 + BUCK1 { 273 + regulator-name = "VINT_1.1V"; 274 + regulator-min-microvolt = <750000>; 275 + regulator-max-microvolt = <1500000>; 276 + regulator-boot-on; 277 + regulator-always-on; 278 + }; 279 + 280 + BUCK2 { 281 + regulator-name = "VG3D_1.1V"; 282 + regulator-min-microvolt = <750000>; 283 + regulator-max-microvolt = <1500000>; 284 + regulator-boot-on; 285 + }; 286 + 287 + BUCK3 { 288 + regulator-name = "VCC_1.8V"; 289 + regulator-min-microvolt = <1800000>; 290 + regulator-max-microvolt = <1800000>; 291 + regulator-always-on; 292 + }; 293 + 294 + BUCK4 { 295 + regulator-name = "VMEM_1.2V"; 296 + regulator-min-microvolt = <1200000>; 297 + regulator-max-microvolt = <1200000>; 298 + regulator-always-on; 299 + }; 300 + 301 + EN32KHz-AP { 302 + regulator-name = "32KHz AP"; 303 + regulator-always-on; 304 + }; 305 + 306 + EN32KHz-CP { 307 + regulator-name = "32KHz CP"; 308 + }; 309 + 310 + ENVICHG { 311 + regulator-name = "VICHG"; 312 + }; 313 + 314 + ESAFEOUT1 { 315 + regulator-name = "SAFEOUT1"; 316 + }; 317 + 318 + ESAFEOUT2 { 319 + regulator-name = "SAFEOUT2"; 320 + regulator-boot-on; 321 + }; 322 + }; 323 + }; 324 + };
+2
Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml
··· 40 40 regulators: 41 41 type: object 42 42 $ref: /schemas/regulator/mediatek,mt6357-regulator.yaml 43 + unevaluatedProperties: false 43 44 description: 44 45 List of MT6357 BUCKs and LDOs regulators. 45 46 ··· 60 59 keys: 61 60 type: object 62 61 $ref: /schemas/input/mediatek,pmic-keys.yaml 62 + unevaluatedProperties: false 63 63 description: 64 64 MT6357 power and home keys. 65 65
+3 -1
Documentation/devicetree/bindings/mfd/mt6397.txt
··· 22 22 "mediatek,mt6323" for PMIC MT6323 23 23 "mediatek,mt6331" for PMIC MT6331 and MT6332 24 24 "mediatek,mt6357" for PMIC MT6357 25 - "mediatek,mt6358" for PMIC MT6358 and MT6366 25 + "mediatek,mt6358" for PMIC MT6358 26 26 "mediatek,mt6359" for PMIC MT6359 27 + "mediatek,mt6366", "mediatek,mt6358" for PMIC MT6366 27 28 "mediatek,mt6397" for PMIC MT6397 28 29 29 30 Optional subnodes: ··· 41 40 - compatible: "mediatek,mt6323-regulator" 42 41 see ../regulator/mt6323-regulator.txt 43 42 - compatible: "mediatek,mt6358-regulator" 43 + - compatible: "mediatek,mt6366-regulator", "mediatek-mt6358-regulator" 44 44 see ../regulator/mt6358-regulator.txt 45 45 - compatible: "mediatek,mt6397-regulator" 46 46 see ../regulator/mt6397-regulator.txt
+8 -3
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
··· 58 58 - qcom,pm8350 59 59 - qcom,pm8350b 60 60 - qcom,pm8350c 61 + - qcom,pm8450 61 62 - qcom,pm8550 62 63 - qcom,pm8550b 63 64 - qcom,pm8550ve ··· 169 168 type: object 170 169 $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml# 171 170 171 + "^typec@[0-9a-f]+$": 172 + type: object 173 + $ref: /schemas/usb/qcom,pmic-typec.yaml# 174 + 172 175 "^usb-detect@[0-9a-f]+$": 173 176 type: object 174 177 $ref: /schemas/extcon/qcom,pm8941-misc.yaml# ··· 239 234 interrupt-controller; 240 235 #interrupt-cells = <4>; 241 236 242 - pmi8998_lsid0: pmic@2 { 237 + pmic@2 { 243 238 compatible = "qcom,pmi8998", "qcom,spmi-pmic"; 244 239 reg = <0x2 SPMI_USID>; 245 240 #address-cells = <1>; 246 241 #size-cells = <0>; 247 242 248 - pmi8998_gpio: gpio@c000 { 243 + gpio@c000 { 249 244 compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio"; 250 245 reg = <0xc000>; 251 246 gpio-controller; ··· 330 325 }; 331 326 }; 332 327 333 - pm6150_gpio: gpio@c000 { 328 + gpio@c000 { 334 329 compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio"; 335 330 reg = <0xc000>; 336 331 gpio-controller;
+1
Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
··· 27 27 - qcom,sdm845-tcsr 28 28 - qcom,sdx55-tcsr 29 29 - qcom,sdx65-tcsr 30 + - qcom,sm4450-tcsr 30 31 - qcom,sm8150-tcsr 31 32 - qcom,sm8450-tcsr 32 33 - qcom,tcsr-apq8064
+25 -1
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
··· 43 43 interrupt-controller: true 44 44 45 45 patternProperties: 46 + "gpio@[0-9a-f]+$": 47 + type: object 48 + $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml# 49 + 50 + "keypad@[0-9a-f]+$": 51 + type: object 52 + $ref: /schemas/input/qcom,pm8921-keypad.yaml# 53 + 46 54 "led@[0-9a-f]+$": 47 55 type: object 48 56 $ref: /schemas/leds/qcom,pm8058-led.yaml# 49 57 58 + "mpps@[0-9a-f]+$": 59 + type: object 60 + $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml# 61 + 62 + "pwrkey@[0-9a-f]+$": 63 + type: object 64 + $ref: /schemas/input/qcom,pm8921-pwrkey.yaml# 65 + 50 66 "rtc@[0-9a-f]+$": 51 67 type: object 52 - $ref: ../rtc/qcom-pm8xxx-rtc.yaml 68 + $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml# 69 + 70 + "vibrator@[0-9a-f]+$": 71 + type: object 72 + $ref: /schemas/input/qcom,pm8xxx-vib.yaml# 73 + 74 + "xoadc@[0-9a-f]+$": 75 + type: object 76 + $ref: /schemas/iio/adc/qcom,pm8018-adc.yaml# 53 77 54 78 required: 55 79 - compatible
+4
Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
··· 42 42 43 43 rockchip,system-power-controller: 44 44 type: boolean 45 + deprecated: true 45 46 description: 46 47 Telling whether or not this PMIC is controlling the system power. 48 + 49 + system-power-controller: true 47 50 48 51 wakeup-source: 49 52 type: boolean ··· 83 80 "^(DCDC_REG[1-4]|LDO_REG[1-3])$": 84 81 type: object 85 82 $ref: ../regulator/regulator.yaml# 83 + unevaluatedProperties: false 86 84 unevaluatedProperties: false 87 85 88 86 allOf:
+2
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
··· 29 29 '#gpio-cells': 30 30 const: 2 31 31 32 + system-power-controller: true 33 + 32 34 vcc1-supply: 33 35 description: 34 36 The input supply for dcdc-reg1.
+4
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
··· 37 37 38 38 rockchip,system-power-controller: 39 39 type: boolean 40 + deprecated: true 40 41 description: 41 42 Telling whether or not this PMIC is controlling the system power. 43 + 44 + system-power-controller: true 42 45 43 46 wakeup-source: 44 47 type: boolean ··· 110 107 "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$": 111 108 type: object 112 109 $ref: ../regulator/regulator.yaml# 110 + unevaluatedProperties: false 113 111 unevaluatedProperties: false 114 112 115 113 required:
+5 -1
Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
··· 37 37 38 38 rockchip,system-power-controller: 39 39 type: boolean 40 + deprecated: true 40 41 description: 41 42 Telling whether or not this PMIC is controlling the system power. 43 + 44 + system-power-controller: true 42 45 43 46 wakeup-source: 44 47 type: boolean ··· 89 86 patternProperties: 90 87 "^(LDO_REG[1-9]|DCDC_REG[1-5]|SWITCH_REG[1-2])$": 91 88 type: object 92 - $ref: ../regulator/regulator.yaml# 89 + $ref: /schemas/regulator/regulator.yaml# 90 + unevaluatedProperties: false 93 91 unevaluatedProperties: false 94 92 95 93 allOf:
+3
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
··· 38 38 39 39 rockchip,system-power-controller: 40 40 type: boolean 41 + deprecated: true 41 42 description: 42 43 Telling whether or not this PMIC is controlling the system power. 44 + 45 + system-power-controller: true 43 46 44 47 wakeup-source: 45 48 type: boolean
+4
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
··· 37 37 38 38 rockchip,system-power-controller: 39 39 type: boolean 40 + deprecated: true 40 41 description: 41 42 Telling whether or not this PMIC is controlling the system power. 43 + 44 + system-power-controller: true 42 45 43 46 wakeup-source: 44 47 type: boolean ··· 102 99 "^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$": 103 100 type: object 104 101 $ref: ../regulator/regulator.yaml# 102 + unevaluatedProperties: false 105 103 unevaluatedProperties: false 106 104 107 105 required:
+1 -1
Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml
··· 75 75 unevaluatedProperties: false 76 76 77 77 db8500_varm: 78 - description: The voltage for the ARM Cortex A-9 CPU. 78 + description: The voltage for the ARM Cortex-A9 CPU. 79 79 type: object 80 80 $ref: ../regulator/regulator.yaml# 81 81 unevaluatedProperties: false
+2
Documentation/devicetree/bindings/mfd/syscon.yaml
··· 63 63 - rockchip,px30-qos 64 64 - rockchip,rk3036-qos 65 65 - rockchip,rk3066-qos 66 + - rockchip,rk3128-qos 66 67 - rockchip,rk3228-qos 67 68 - rockchip,rk3288-qos 68 69 - rockchip,rk3368-qos ··· 72 71 - rockchip,rk3588-qos 73 72 - rockchip,rv1126-qos 74 73 - starfive,jh7100-sysmain 74 + - ti,am654-dss-oldi-io-ctrl 75 75 76 76 - const: syscon 77 77
+1
Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml
··· 37 37 "^buck[0123]$": 38 38 type: object 39 39 $ref: /schemas/regulator/regulator.yaml# 40 + unevaluatedProperties: false 40 41 41 42 required: 42 43 - buck0
+1
Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml
··· 41 41 buck3210: 42 42 type: object 43 43 $ref: /schemas/regulator/regulator.yaml# 44 + unevaluatedProperties: false 44 45 45 46 required: 46 47 - buck3210
+1
Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml
··· 47 47 "^buck(10|23)$": 48 48 type: object 49 49 $ref: /schemas/regulator/regulator.yaml# 50 + unevaluatedProperties: false 50 51 51 52 required: 52 53 - buck10
+67
Documentation/devicetree/bindings/mfd/ti,twl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/ti,twl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments TWL family 8 + 9 + maintainers: 10 + - Andreas Kemnade <andreas@kemnade.info> 11 + 12 + description: | 13 + The TWLs are Integrated Power Management Chips. 14 + Some version might contain much more analog function like 15 + USB transceiver or Audio amplifier. 16 + These chips are connected to an i2c bus. 17 + 18 + properties: 19 + compatible: 20 + description: 21 + TWL4030 for integrated power-management/audio CODEC device used in OMAP3 22 + based boards 23 + TWL6030/32 for integrated power-management used in OMAP4 based boards 24 + enum: 25 + - ti,twl4030 26 + - ti,twl6030 27 + - ti,twl6032 28 + 29 + reg: 30 + maxItems: 1 31 + 32 + interrupts: 33 + maxItems: 1 34 + 35 + interrupt-controller: true 36 + 37 + "#interrupt-cells": 38 + const: 1 39 + 40 + "#clock-cells": 41 + const: 1 42 + 43 + additionalProperties: false 44 + 45 + required: 46 + - compatible 47 + - reg 48 + - interrupts 49 + - interrupt-controller 50 + - "#interrupt-cells" 51 + 52 + examples: 53 + - | 54 + i2c { 55 + #address-cells = <1>; 56 + #size-cells = <0>; 57 + 58 + pmic@48 { 59 + compatible = "ti,twl6030"; 60 + reg = <0x48>; 61 + interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */ 62 + interrupt-controller; 63 + #interrupt-cells = <1>; 64 + interrupt-parent = <&gic>; 65 + }; 66 + }; 67 +
-46
Documentation/devicetree/bindings/mfd/twl-family.txt
··· 1 - Texas Instruments TWL family 2 - 3 - The TWLs are Integrated Power Management Chips. 4 - Some version might contain much more analog function like 5 - USB transceiver or Audio amplifier. 6 - These chips are connected to an i2c bus. 7 - 8 - 9 - Required properties: 10 - - compatible : Must be "ti,twl4030"; 11 - For Integrated power-management/audio CODEC device used in OMAP3 12 - based boards 13 - - compatible : Must be "ti,twl6030"; 14 - For Integrated power-management used in OMAP4 based boards 15 - - interrupts : This i2c device has an IRQ line connected to the main SoC 16 - - interrupt-controller : Since the twl support several interrupts internally, 17 - it is considered as an interrupt controller cascaded to the SoC one. 18 - - #interrupt-cells = <1>; 19 - 20 - Optional node: 21 - - Child nodes contain in the twl. The twl family is made of several variants 22 - that support a different number of features. 23 - The children nodes will thus depend of the capability of the variant. 24 - 25 - 26 - Example: 27 - /* 28 - * Integrated Power Management Chip 29 - * https://www.ti.com/lit/ds/symlink/twl6030.pdf 30 - */ 31 - twl@48 { 32 - compatible = "ti,twl6030"; 33 - reg = <0x48>; 34 - interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */ 35 - interrupt-controller; 36 - #interrupt-cells = <1>; 37 - interrupt-parent = <&gic>; 38 - #address-cells = <1>; 39 - #size-cells = <0>; 40 - 41 - twl_rtc { 42 - compatible = "ti,twl_rtc"; 43 - interrupts = <11>; 44 - reg = <0>; 45 - }; 46 - };
+4 -1
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
··· 67 67 properties: 68 68 compatible: 69 69 contains: 70 - const: x-powers,axp305 70 + enum: 71 + - x-powers,axp15060 72 + - x-powers,axp305 73 + - x-powers,axp313a 71 74 72 75 then: 73 76 required:
-18
Documentation/devicetree/bindings/power/supply/max8925_battery.txt
··· 1 - max8925-battery bindings 2 - ~~~~~~~~~~~~~~~~ 3 - 4 - Optional properties : 5 - - batt-detect: whether support battery detect 6 - - topoff-threshold: set charging current in topoff mode 7 - - fast-charge: set charging current in fast mode 8 - - no-temp-support: whether support temperature protection detect 9 - - no-insert-detect: whether support insert detect 10 - 11 - Example: 12 - charger { 13 - batt-detect = <0>; 14 - topoff-threshold = <1>; 15 - fast-charge = <7>; 16 - no-temp-support = <0>; 17 - no-insert-detect = <0>; 18 - };
+1 -1
drivers/i2c/i2c-core.h
··· 29 29 */ 30 30 static inline bool i2c_in_atomic_xfer_mode(void) 31 31 { 32 - return system_state > SYSTEM_RUNNING && irqs_disabled(); 32 + return system_state > SYSTEM_RUNNING && !preemptible(); 33 33 } 34 34 35 35 static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)
+2 -9
drivers/mfd/arizona-i2c.c
··· 22 22 23 23 static int arizona_i2c_probe(struct i2c_client *i2c) 24 24 { 25 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 26 - const void *match_data; 27 25 struct arizona *arizona; 28 26 const struct regmap_config *regmap_config = NULL; 29 - unsigned long type = 0; 27 + unsigned long type; 30 28 int ret; 31 29 32 - match_data = device_get_match_data(&i2c->dev); 33 - if (match_data) 34 - type = (unsigned long)match_data; 35 - else if (id) 36 - type = id->driver_data; 37 - 30 + type = (uintptr_t)i2c_get_match_data(i2c); 38 31 switch (type) { 39 32 case WM5102: 40 33 if (IS_ENABLED(CONFIG_MFD_WM5102))
+3
drivers/mfd/arizona-spi.c
··· 159 159 arizona->pdata.micd_ranges = arizona_micd_aosp_ranges; 160 160 arizona->pdata.num_micd_ranges = ARRAY_SIZE(arizona_micd_aosp_ranges); 161 161 162 + /* Use left headphone speaker for HP vs line-out detection */ 163 + arizona->pdata.hpdet_channel = ARIZONA_ACCDET_MODE_HPL; 164 + 162 165 return 0; 163 166 } 164 167
+1
drivers/mfd/atmel-hlcdc.c
··· 139 139 { .compatible = "atmel,sama5d3-hlcdc" }, 140 140 { .compatible = "atmel,sama5d4-hlcdc" }, 141 141 { .compatible = "microchip,sam9x60-hlcdc" }, 142 + { .compatible = "microchip,sam9x75-xlcdc" }, 142 143 { /* sentinel */ }, 143 144 }; 144 145 MODULE_DEVICE_TABLE(of, atmel_hlcdc_match);
+27 -39
drivers/mfd/axp20x.c
··· 22 22 #include <linux/mfd/axp20x.h> 23 23 #include <linux/mfd/core.h> 24 24 #include <linux/module.h> 25 - #include <linux/of_device.h> 25 + #include <linux/of.h> 26 + #include <linux/property.h> 26 27 #include <linux/reboot.h> 27 28 #include <linux/regmap.h> 28 29 #include <linux/regulator/consumer.h> ··· 1132 1131 int axp20x_match_device(struct axp20x_dev *axp20x) 1133 1132 { 1134 1133 struct device *dev = axp20x->dev; 1135 - const struct acpi_device_id *acpi_id; 1136 - const struct of_device_id *of_id; 1134 + const struct mfd_cell *cells_no_irq = NULL; 1135 + int nr_cells_no_irq = 0; 1137 1136 1138 - if (dev->of_node) { 1139 - of_id = of_match_device(dev->driver->of_match_table, dev); 1140 - if (!of_id) { 1141 - dev_err(dev, "Unable to match OF ID\n"); 1142 - return -ENODEV; 1143 - } 1144 - axp20x->variant = (long)of_id->data; 1145 - } else { 1146 - acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); 1147 - if (!acpi_id || !acpi_id->driver_data) { 1148 - dev_err(dev, "Unable to match ACPI ID and data\n"); 1149 - return -ENODEV; 1150 - } 1151 - axp20x->variant = (long)acpi_id->driver_data; 1152 - } 1153 - 1137 + axp20x->variant = (long)device_get_match_data(dev); 1154 1138 switch (axp20x->variant) { 1155 1139 case AXP152_ID: 1156 1140 axp20x->nr_cells = ARRAY_SIZE(axp152_cells); ··· 1193 1207 * if there is no interrupt line. 1194 1208 */ 1195 1209 if (of_property_read_bool(axp20x->dev->of_node, 1196 - "x-powers,self-working-mode") && 1197 - axp20x->irq > 0) { 1210 + "x-powers,self-working-mode")) { 1198 1211 axp20x->nr_cells = ARRAY_SIZE(axp806_self_working_cells); 1199 1212 axp20x->cells = axp806_self_working_cells; 1200 1213 } else { 1201 1214 axp20x->nr_cells = ARRAY_SIZE(axp806_cells); 1202 1215 axp20x->cells = axp806_cells; 1203 1216 } 1217 + nr_cells_no_irq = ARRAY_SIZE(axp806_cells); 1218 + cells_no_irq = axp806_cells; 1204 1219 axp20x->regmap_cfg = &axp806_regmap_config; 1205 1220 axp20x->regmap_irq_chip = &axp806_regmap_irq_chip; 1206 1221 break; ··· 1225 1238 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; 1226 1239 break; 1227 1240 case AXP15060_ID: 1228 - /* 1229 - * Don't register the power key part if there is no interrupt 1230 - * line. 1231 - * 1232 - * Since most use cases of AXP PMICs are Allwinner SOCs, board 1233 - * designers follow Allwinner's reference design and connects 1234 - * IRQ line to SOC, there's no need for those variants to deal 1235 - * with cases that IRQ isn't connected. However, AXP15660 is 1236 - * used by some other vendors' SOCs that didn't connect IRQ 1237 - * line, we need to deal with this case. 1238 - */ 1239 - if (axp20x->irq > 0) { 1240 - axp20x->nr_cells = ARRAY_SIZE(axp15060_cells); 1241 - axp20x->cells = axp15060_cells; 1242 - } else { 1243 - axp20x->nr_cells = ARRAY_SIZE(axp_regulator_only_cells); 1244 - axp20x->cells = axp_regulator_only_cells; 1245 - } 1241 + axp20x->nr_cells = ARRAY_SIZE(axp15060_cells); 1242 + axp20x->cells = axp15060_cells; 1246 1243 axp20x->regmap_cfg = &axp15060_regmap_config; 1247 1244 axp20x->regmap_irq_chip = &axp15060_regmap_irq_chip; 1248 1245 break; ··· 1234 1263 dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant); 1235 1264 return -EINVAL; 1236 1265 } 1266 + 1267 + /* 1268 + * Use an alternative cell array when no interrupt line is connected, 1269 + * since IRQs are required by some drivers. 1270 + * The default is the safe "regulator-only", as this works fine without 1271 + * an interrupt specified. 1272 + */ 1273 + if (axp20x->irq <= 0) { 1274 + if (cells_no_irq) { 1275 + axp20x->nr_cells = nr_cells_no_irq; 1276 + axp20x->cells = cells_no_irq; 1277 + } else { 1278 + axp20x->nr_cells = ARRAY_SIZE(axp_regulator_only_cells); 1279 + axp20x->cells = axp_regulator_only_cells; 1280 + } 1281 + } 1282 + 1237 1283 dev_info(dev, "AXP20x variant %s found\n", 1238 1284 axp20x_model_names[axp20x->variant]); 1239 1285
+2 -2
drivers/mfd/db8500-prcmu.c
··· 2639 2639 fw_info.version.api_version = (version >> 8) & 0xFF; 2640 2640 fw_info.version.func_version = (version >> 16) & 0xFF; 2641 2641 fw_info.version.errata = (version >> 24) & 0xFF; 2642 - strncpy(fw_info.version.project_name, 2642 + strscpy(fw_info.version.project_name, 2643 2643 fw_project_name(fw_info.version.project), 2644 - PRCMU_FW_PROJECT_NAME_LEN); 2644 + sizeof(fw_info.version.project_name)); 2645 2645 fw_info.valid = true; 2646 2646 pr_info("PRCMU firmware: %s(%d), version %d.%d.%d\n", 2647 2647 fw_info.version.project_name,
-1
drivers/mfd/dln2.c
··· 826 826 dln2_stop_rx_urbs(dln2); 827 827 828 828 out_free: 829 - usb_put_dev(dln2->usb_dev); 830 829 dln2_free(dln2); 831 830 832 831 return ret;
+3 -6
drivers/mfd/hi6421-pmic-core.c
··· 15 15 #include <linux/mfd/core.h> 16 16 #include <linux/mfd/hi6421-pmic.h> 17 17 #include <linux/module.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of.h> 19 19 #include <linux/platform_device.h> 20 + #include <linux/property.h> 20 21 #include <linux/regmap.h> 21 22 22 23 static const struct mfd_cell hi6421_devs[] = { ··· 51 50 static int hi6421_pmic_probe(struct platform_device *pdev) 52 51 { 53 52 struct hi6421_pmic *pmic; 54 - const struct of_device_id *id; 55 53 const struct mfd_cell *subdevs; 56 54 enum hi6421_type type; 57 55 void __iomem *base; 58 56 int n_subdevs, ret; 59 57 60 - id = of_match_device(of_hi6421_pmic_match, &pdev->dev); 61 - if (!id) 62 - return -EINVAL; 63 - type = (uintptr_t)id->data; 58 + type = (uintptr_t)device_get_match_data(&pdev->dev); 64 59 65 60 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); 66 61 if (!pmic)
+13
drivers/mfd/intel-lpss-pci.c
··· 561 561 { PCI_VDEVICE(INTEL, 0xa3e2), (kernel_ulong_t)&spt_i2c_info }, 562 562 { PCI_VDEVICE(INTEL, 0xa3e3), (kernel_ulong_t)&spt_i2c_info }, 563 563 { PCI_VDEVICE(INTEL, 0xa3e6), (kernel_ulong_t)&spt_uart_info }, 564 + /* LNL-M */ 565 + { PCI_VDEVICE(INTEL, 0xa825), (kernel_ulong_t)&bxt_uart_info }, 566 + { PCI_VDEVICE(INTEL, 0xa826), (kernel_ulong_t)&bxt_uart_info }, 567 + { PCI_VDEVICE(INTEL, 0xa827), (kernel_ulong_t)&tgl_info }, 568 + { PCI_VDEVICE(INTEL, 0xa830), (kernel_ulong_t)&tgl_info }, 569 + { PCI_VDEVICE(INTEL, 0xa846), (kernel_ulong_t)&tgl_info }, 570 + { PCI_VDEVICE(INTEL, 0xa850), (kernel_ulong_t)&ehl_i2c_info }, 571 + { PCI_VDEVICE(INTEL, 0xa851), (kernel_ulong_t)&ehl_i2c_info }, 572 + { PCI_VDEVICE(INTEL, 0xa852), (kernel_ulong_t)&bxt_uart_info }, 573 + { PCI_VDEVICE(INTEL, 0xa878), (kernel_ulong_t)&ehl_i2c_info }, 574 + { PCI_VDEVICE(INTEL, 0xa879), (kernel_ulong_t)&ehl_i2c_info }, 575 + { PCI_VDEVICE(INTEL, 0xa87a), (kernel_ulong_t)&ehl_i2c_info }, 576 + { PCI_VDEVICE(INTEL, 0xa87b), (kernel_ulong_t)&ehl_i2c_info }, 564 577 { } 565 578 }; 566 579 MODULE_DEVICE_TABLE(pci, intel_lpss_pci_ids);
+1 -1
drivers/mfd/iqs62x.c
··· 96 96 u8 addr; 97 97 u8 mask; 98 98 u8 len; 99 - u8 data[]; 99 + u8 data[] __counted_by(len); 100 100 }; 101 101 102 102 struct iqs62x_info {
+2 -7
drivers/mfd/lochnagar-i2c.c
··· 15 15 #include <linux/i2c.h> 16 16 #include <linux/lockdep.h> 17 17 #include <linux/mfd/core.h> 18 + #include <linux/mod_devicetable.h> 18 19 #include <linux/mutex.h> 19 - #include <linux/of.h> 20 20 #include <linux/of_platform.h> 21 21 #include <linux/regmap.h> 22 22 ··· 270 270 { 271 271 struct device *dev = &i2c->dev; 272 272 const struct lochnagar_config *config = NULL; 273 - const struct of_device_id *of_id; 274 273 struct lochnagar *lochnagar; 275 274 struct gpio_desc *reset, *present; 276 275 unsigned int val; ··· 281 282 if (!lochnagar) 282 283 return -ENOMEM; 283 284 284 - of_id = of_match_device(lochnagar_of_match, dev); 285 - if (!of_id) 286 - return -EINVAL; 287 - 288 - config = of_id->data; 285 + config = i2c_get_match_data(i2c); 289 286 290 287 lochnagar->dev = dev; 291 288 mutex_init(&lochnagar->analogue_config_lock);
+3 -6
drivers/mfd/lp87565.c
··· 6 6 */ 7 7 8 8 #include <linux/gpio/consumer.h> 9 + #include <linux/i2c.h> 9 10 #include <linux/interrupt.h> 10 11 #include <linux/mfd/core.h> 12 + #include <linux/mod_devicetable.h> 11 13 #include <linux/module.h> 12 - #include <linux/of_device.h> 13 14 #include <linux/regmap.h> 14 15 15 16 #include <linux/mfd/lp87565.h> ··· 47 46 static int lp87565_probe(struct i2c_client *client) 48 47 { 49 48 struct lp87565 *lp87565; 50 - const struct of_device_id *of_id; 51 49 int ret; 52 50 unsigned int otpid; 53 51 ··· 89 89 } 90 90 91 91 lp87565->rev = otpid & LP87565_OTP_REV_OTP_ID; 92 - 93 - of_id = of_match_device(of_lp87565_match_table, &client->dev); 94 - if (of_id) 95 - lp87565->dev_type = (uintptr_t)of_id->data; 92 + lp87565->dev_type = (uintptr_t)i2c_get_match_data(client); 96 93 97 94 i2c_set_clientdata(client, lp87565); 98 95
+103 -24
drivers/mfd/lpc_ich.c
··· 85 85 #define wdt_mem_res(i) wdt_res(ICH_RES_MEM_OFF, i) 86 86 #define wdt_res(b, i) (&wdt_ich_res[(b) + (i)]) 87 87 88 - struct lpc_ich_priv { 89 - int chipset; 90 - 91 - int abase; /* ACPI base */ 92 - int actrl_pbase; /* ACPI control or PMC base */ 93 - int gbase; /* GPIO base */ 94 - int gctrl; /* GPIO control */ 95 - 96 - int abase_save; /* Cached ACPI base value */ 97 - int actrl_pbase_save; /* Cached ACPI control or PMC base value */ 98 - int gctrl_save; /* Cached GPIO control value */ 99 - }; 100 - 101 88 static struct resource wdt_ich_res[] = { 102 89 /* ACPI - TCO */ 103 90 { ··· 131 144 .ignore_resource_conflicts = true, 132 145 }; 133 146 147 + #define INTEL_GPIO_RESOURCE_SIZE 0x1000 148 + 149 + struct lpc_ich_gpio_info { 150 + const char *hid; 151 + const struct mfd_cell *devices; 152 + size_t nr_devices; 153 + struct resource **resources; 154 + size_t nr_resources; 155 + const resource_size_t *offsets; 156 + }; 157 + 134 158 #define APL_GPIO_NORTH 0 135 159 #define APL_GPIO_NORTHWEST 1 136 160 #define APL_GPIO_WEST 2 137 161 #define APL_GPIO_SOUTHWEST 3 162 + 138 163 #define APL_GPIO_NR_DEVICES 4 164 + #define APL_GPIO_NR_RESOURCES 4 139 165 140 166 /* Offset data for Apollo Lake GPIO controllers */ 141 - static resource_size_t apl_gpio_offsets[APL_GPIO_NR_DEVICES] = { 167 + static const resource_size_t apl_gpio_offsets[APL_GPIO_NR_RESOURCES] = { 142 168 [APL_GPIO_NORTH] = 0xc50000, 143 169 [APL_GPIO_NORTHWEST] = 0xc40000, 144 170 [APL_GPIO_WEST] = 0xc70000, 145 171 [APL_GPIO_SOUTHWEST] = 0xc00000, 146 172 }; 147 - 148 - #define APL_GPIO_RESOURCE_SIZE 0x1000 149 173 150 174 #define APL_GPIO_IRQ 14 151 175 ··· 177 179 DEFINE_RES_MEM(0, 0), 178 180 DEFINE_RES_IRQ(APL_GPIO_IRQ), 179 181 }, 182 + }; 183 + 184 + static struct resource *apl_gpio_mem_resources[APL_GPIO_NR_RESOURCES] = { 185 + [APL_GPIO_NORTH] = &apl_gpio_resources[APL_GPIO_NORTH][0], 186 + [APL_GPIO_NORTHWEST] = &apl_gpio_resources[APL_GPIO_NORTHWEST][0], 187 + [APL_GPIO_WEST] = &apl_gpio_resources[APL_GPIO_WEST][0], 188 + [APL_GPIO_SOUTHWEST] = &apl_gpio_resources[APL_GPIO_SOUTHWEST][0], 180 189 }; 181 190 182 191 static const struct mfd_cell apl_gpio_devices[APL_GPIO_NR_DEVICES] = { ··· 215 210 .resources = apl_gpio_resources[APL_GPIO_SOUTHWEST], 216 211 .ignore_resource_conflicts = true, 217 212 }, 213 + }; 214 + 215 + static const struct lpc_ich_gpio_info apl_gpio_info = { 216 + .hid = "INT3452", 217 + .devices = apl_gpio_devices, 218 + .nr_devices = ARRAY_SIZE(apl_gpio_devices), 219 + .resources = apl_gpio_mem_resources, 220 + .nr_resources = ARRAY_SIZE(apl_gpio_mem_resources), 221 + .offsets = apl_gpio_offsets, 222 + }; 223 + 224 + #define DNV_GPIO_NORTH 0 225 + #define DNV_GPIO_SOUTH 1 226 + 227 + #define DNV_GPIO_NR_DEVICES 1 228 + #define DNV_GPIO_NR_RESOURCES 2 229 + 230 + /* Offset data for Denverton GPIO controllers */ 231 + static const resource_size_t dnv_gpio_offsets[DNV_GPIO_NR_RESOURCES] = { 232 + [DNV_GPIO_NORTH] = 0xc20000, 233 + [DNV_GPIO_SOUTH] = 0xc50000, 234 + }; 235 + 236 + #define DNV_GPIO_IRQ 14 237 + 238 + static struct resource dnv_gpio_resources[DNV_GPIO_NR_RESOURCES + 1] = { 239 + [DNV_GPIO_NORTH] = DEFINE_RES_MEM(0, 0), 240 + [DNV_GPIO_SOUTH] = DEFINE_RES_MEM(0, 0), 241 + DEFINE_RES_IRQ(DNV_GPIO_IRQ), 242 + }; 243 + 244 + static struct resource *dnv_gpio_mem_resources[DNV_GPIO_NR_RESOURCES] = { 245 + [DNV_GPIO_NORTH] = &dnv_gpio_resources[DNV_GPIO_NORTH], 246 + [DNV_GPIO_SOUTH] = &dnv_gpio_resources[DNV_GPIO_SOUTH], 247 + }; 248 + 249 + static const struct mfd_cell dnv_gpio_devices[DNV_GPIO_NR_DEVICES] = { 250 + { 251 + .name = "denverton-pinctrl", 252 + .num_resources = ARRAY_SIZE(dnv_gpio_resources), 253 + .resources = dnv_gpio_resources, 254 + .ignore_resource_conflicts = true, 255 + }, 256 + }; 257 + 258 + static const struct lpc_ich_gpio_info dnv_gpio_info = { 259 + .hid = "INTC3000", 260 + .devices = dnv_gpio_devices, 261 + .nr_devices = ARRAY_SIZE(dnv_gpio_devices), 262 + .resources = dnv_gpio_mem_resources, 263 + .nr_resources = ARRAY_SIZE(dnv_gpio_mem_resources), 264 + .offsets = dnv_gpio_offsets, 218 265 }; 219 266 220 267 static struct mfd_cell lpc_ich_spi_cell = { ··· 346 289 LPC_LEWISBURG, /* Lewisburg */ 347 290 LPC_9S, /* 9 Series */ 348 291 LPC_APL, /* Apollo Lake SoC */ 292 + LPC_DNV, /* Denverton SoC */ 349 293 LPC_GLK, /* Gemini Lake SoC */ 350 294 LPC_COUGARMOUNTAIN,/* Cougar Mountain SoC*/ 295 + }; 296 + 297 + struct lpc_ich_priv { 298 + enum lpc_chipsets chipset; 299 + 300 + int abase; /* ACPI base */ 301 + int actrl_pbase; /* ACPI control or PMC base */ 302 + int gbase; /* GPIO base */ 303 + int gctrl; /* GPIO control */ 304 + 305 + int abase_save; /* Cached ACPI base value */ 306 + int actrl_pbase_save; /* Cached ACPI control or PMC base value */ 307 + int gctrl_save; /* Cached GPIO control value */ 351 308 }; 352 309 353 310 static struct lpc_ich_info lpc_chipset_info[] = { ··· 689 618 [LPC_APL] = { 690 619 .name = "Apollo Lake SoC", 691 620 .iTCO_version = 5, 621 + .gpio_info = &apl_gpio_info, 692 622 .spi_type = INTEL_SPI_BXT, 623 + }, 624 + [LPC_DNV] = { 625 + .name = "Denverton SoC", 626 + .gpio_info = &dnv_gpio_info, 693 627 }, 694 628 [LPC_GLK] = { 695 629 .name = "Gemini Lake SoC", ··· 714 638 */ 715 639 static const struct pci_device_id lpc_ich_ids[] = { 716 640 { PCI_VDEVICE(INTEL, 0x0f1c), LPC_BAYTRAIL}, 641 + { PCI_VDEVICE(INTEL, 0x19dc), LPC_DNV}, 717 642 { PCI_VDEVICE(INTEL, 0x1c41), LPC_CPT}, 718 643 { PCI_VDEVICE(INTEL, 0x1c42), LPC_CPTD}, 719 644 { PCI_VDEVICE(INTEL, 0x1c43), LPC_CPTM}, ··· 1233 1156 1234 1157 static int lpc_ich_init_pinctrl(struct pci_dev *dev) 1235 1158 { 1159 + struct lpc_ich_priv *priv = pci_get_drvdata(dev); 1160 + const struct lpc_ich_gpio_info *info = lpc_chipset_info[priv->chipset].gpio_info; 1236 1161 struct resource base; 1237 1162 unsigned int i; 1238 1163 int ret; 1239 1164 1240 1165 /* Check, if GPIO has been exported as an ACPI device */ 1241 - if (acpi_dev_present("INT3452", NULL, -1)) 1166 + if (acpi_dev_present(info->hid, NULL, -1)) 1242 1167 return -EEXIST; 1243 1168 1244 1169 ret = p2sb_bar(dev->bus, 0, &base); 1245 1170 if (ret) 1246 1171 return ret; 1247 1172 1248 - for (i = 0; i < ARRAY_SIZE(apl_gpio_devices); i++) { 1249 - struct resource *mem = &apl_gpio_resources[i][0]; 1250 - resource_size_t offset = apl_gpio_offsets[i]; 1173 + for (i = 0; i < info->nr_resources; i++) { 1174 + struct resource *mem = info->resources[i]; 1175 + resource_size_t offset = info->offsets[i]; 1251 1176 1252 1177 /* Fill MEM resource */ 1253 1178 mem->start = base.start + offset; 1254 - mem->end = base.start + offset + APL_GPIO_RESOURCE_SIZE - 1; 1179 + mem->end = base.start + offset + INTEL_GPIO_RESOURCE_SIZE - 1; 1255 1180 mem->flags = base.flags; 1256 1181 } 1257 1182 1258 - return mfd_add_devices(&dev->dev, 0, apl_gpio_devices, 1259 - ARRAY_SIZE(apl_gpio_devices), NULL, 0, NULL); 1183 + return mfd_add_devices(&dev->dev, 0, info->devices, info->nr_devices, 1184 + NULL, 0, NULL); 1260 1185 } 1261 1186 1262 1187 static bool lpc_ich_byt_set_writeable(void __iomem *base, void *data) ··· 1411 1332 cell_added = true; 1412 1333 } 1413 1334 1414 - if (priv->chipset == LPC_APL) { 1335 + if (lpc_chipset_info[priv->chipset].gpio_info) { 1415 1336 ret = lpc_ich_init_pinctrl(dev); 1416 1337 if (!ret) 1417 1338 cell_added = true;
+1 -8
drivers/mfd/madera-i2c.c
··· 18 18 19 19 static int madera_i2c_probe(struct i2c_client *i2c) 20 20 { 21 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 22 21 struct madera *madera; 23 22 const struct regmap_config *regmap_16bit_config = NULL; 24 23 const struct regmap_config *regmap_32bit_config = NULL; 25 - const void *of_data; 26 24 unsigned long type; 27 25 const char *name; 28 26 int ret; 29 27 30 - of_data = of_device_get_match_data(&i2c->dev); 31 - if (of_data) 32 - type = (unsigned long)of_data; 33 - else 34 - type = id->driver_data; 35 - 28 + type = (uintptr_t)i2c_get_match_data(i2c); 36 29 switch (type) { 37 30 case CS47L15: 38 31 if (IS_ENABLED(CONFIG_MFD_CS47L15)) {
+3 -11
drivers/mfd/max14577.c
··· 9 9 // This driver is based on max8997.c 10 10 11 11 #include <linux/err.h> 12 + #include <linux/i2c.h> 13 + #include <linux/mod_devicetable.h> 12 14 #include <linux/module.h> 13 15 #include <linux/interrupt.h> 14 - #include <linux/of_device.h> 15 16 #include <linux/mfd/core.h> 16 17 #include <linux/mfd/max14577.h> 17 18 #include <linux/mfd/max14577-private.h> ··· 358 357 359 358 static int max14577_i2c_probe(struct i2c_client *i2c) 360 359 { 361 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 362 360 struct max14577 *max14577; 363 361 struct max14577_platform_data *pdata = dev_get_platdata(&i2c->dev); 364 362 struct device_node *np = i2c->dev.of_node; ··· 397 397 return ret; 398 398 } 399 399 400 - if (np) { 401 - const struct of_device_id *of_id; 402 - 403 - of_id = of_match_device(max14577_dt_match, &i2c->dev); 404 - if (of_id) 405 - max14577->dev_type = (uintptr_t)of_id->data; 406 - } else { 407 - max14577->dev_type = id->driver_data; 408 - } 400 + max14577->dev_type = (enum maxim_device_type)i2c_get_match_data(i2c); 409 401 410 402 max14577_print_dev_type(max14577); 411 403
+1 -5
drivers/mfd/max77541.c
··· 162 162 163 163 static int max77541_probe(struct i2c_client *client) 164 164 { 165 - const struct i2c_device_id *id = i2c_client_get_device_id(client); 166 165 struct device *dev = &client->dev; 167 166 struct max77541 *max77541; 168 167 ··· 172 173 i2c_set_clientdata(client, max77541); 173 174 max77541->i2c = client; 174 175 175 - max77541->id = (uintptr_t)device_get_match_data(dev); 176 - if (!max77541->id) 177 - max77541->id = (enum max7754x_ids)id->driver_data; 178 - 176 + max77541->id = (uintptr_t)i2c_get_match_data(client); 179 177 if (!max77541->id) 180 178 return -EINVAL; 181 179
+3 -3
drivers/mfd/max77620.c
··· 172 172 .reg_bits = 8, 173 173 .val_bits = 8, 174 174 .max_register = MAX77620_REG_DVSSD4 + 1, 175 - .cache_type = REGCACHE_RBTREE, 175 + .cache_type = REGCACHE_MAPLE, 176 176 .rd_table = &max77620_readable_table, 177 177 .wr_table = &max77620_writable_table, 178 178 .volatile_table = &max77620_volatile_table, ··· 184 184 .reg_bits = 8, 185 185 .val_bits = 8, 186 186 .max_register = MAX20024_REG_MAX_ADD + 1, 187 - .cache_type = REGCACHE_RBTREE, 187 + .cache_type = REGCACHE_MAPLE, 188 188 .rd_table = &max20024_readable_table, 189 189 .wr_table = &max77620_writable_table, 190 190 .volatile_table = &max77620_volatile_table, ··· 213 213 .reg_bits = 8, 214 214 .val_bits = 8, 215 215 .max_register = MAX77620_REG_CID5 + 1, 216 - .cache_type = REGCACHE_RBTREE, 216 + .cache_type = REGCACHE_MAPLE, 217 217 .rd_table = &max77663_readable_table, 218 218 .wr_table = &max77663_writable_table, 219 219 .volatile_table = &max77620_volatile_table,
+1 -1
drivers/mfd/max77686.c
··· 108 108 .precious_reg = max77802_is_precious_reg, 109 109 .volatile_reg = max77802_is_volatile_reg, 110 110 .name = "max77802-pmic", 111 - .cache_type = REGCACHE_RBTREE, 111 + .cache_type = REGCACHE_MAPLE, 112 112 }; 113 113 114 114 static const struct regmap_irq max77686_irqs[] = {
+2 -2
drivers/mfd/max8907.c
··· 63 63 .precious_reg = max8907_gen_is_precious_reg, 64 64 .writeable_reg = max8907_gen_is_writeable_reg, 65 65 .max_register = MAX8907_REG_LDO20VOUT, 66 - .cache_type = REGCACHE_RBTREE, 66 + .cache_type = REGCACHE_MAPLE, 67 67 }; 68 68 69 69 static bool max8907_rtc_is_volatile_reg(struct device *dev, unsigned int reg) ··· 108 108 .precious_reg = max8907_rtc_is_precious_reg, 109 109 .writeable_reg = max8907_rtc_is_writeable_reg, 110 110 .max_register = MAX8907_REG_MPL_CNTL, 111 - .cache_type = REGCACHE_RBTREE, 111 + .cache_type = REGCACHE_MAPLE, 112 112 }; 113 113 114 114 static const struct regmap_irq max8907_chg_irqs[] = {
+1 -11
drivers/mfd/max8997.c
··· 142 142 return pd; 143 143 } 144 144 145 - static inline unsigned long max8997_i2c_get_driver_data(struct i2c_client *i2c, 146 - const struct i2c_device_id *id) 147 - { 148 - if (i2c->dev.of_node) 149 - return (unsigned long)of_device_get_match_data(&i2c->dev); 150 - 151 - return id->driver_data; 152 - } 153 - 154 145 static int max8997_i2c_probe(struct i2c_client *i2c) 155 146 { 156 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 157 147 struct max8997_dev *max8997; 158 148 struct max8997_platform_data *pdata = dev_get_platdata(&i2c->dev); 159 149 int ret = 0; ··· 156 166 i2c_set_clientdata(i2c, max8997); 157 167 max8997->dev = &i2c->dev; 158 168 max8997->i2c = i2c; 159 - max8997->type = max8997_i2c_get_driver_data(i2c, id); 169 + max8997->type = (uintptr_t)i2c_get_match_data(i2c); 160 170 max8997->irq = i2c->irq; 161 171 162 172 if (IS_ENABLED(CONFIG_OF) && max8997->dev->of_node) {
+1 -11
drivers/mfd/max8998.c
··· 152 152 return pd; 153 153 } 154 154 155 - static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c, 156 - const struct i2c_device_id *id) 157 - { 158 - if (i2c->dev.of_node) 159 - return (unsigned long)of_device_get_match_data(&i2c->dev); 160 - 161 - return id->driver_data; 162 - } 163 - 164 155 static int max8998_i2c_probe(struct i2c_client *i2c) 165 156 { 166 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 167 157 struct max8998_platform_data *pdata = dev_get_platdata(&i2c->dev); 168 158 struct max8998_dev *max8998; 169 159 int ret = 0; ··· 173 183 max8998->dev = &i2c->dev; 174 184 max8998->i2c = i2c; 175 185 max8998->irq = i2c->irq; 176 - max8998->type = max8998_i2c_get_driver_data(i2c, id); 186 + max8998->type = (uintptr_t)i2c_get_match_data(i2c); 177 187 max8998->pdata = pdata; 178 188 if (pdata) { 179 189 max8998->ono = pdata->ono;
+2 -12
drivers/mfd/mc13xxx-spi.c
··· 8 8 */ 9 9 10 10 #include <linux/slab.h> 11 + #include <linux/mod_devicetable.h> 11 12 #include <linux/module.h> 12 13 #include <linux/platform_device.h> 13 14 #include <linux/interrupt.h> 14 15 #include <linux/mfd/core.h> 15 16 #include <linux/mfd/mc13xxx.h> 16 - #include <linux/of.h> 17 - #include <linux/of_device.h> 18 17 #include <linux/err.h> 19 18 #include <linux/spi/spi.h> 20 19 ··· 150 151 return ret; 151 152 } 152 153 153 - if (spi->dev.of_node) { 154 - const struct of_device_id *of_id = 155 - of_match_device(mc13xxx_dt_ids, &spi->dev); 156 - 157 - mc13xxx->variant = of_id->data; 158 - } else { 159 - const struct spi_device_id *id_entry = spi_get_device_id(spi); 160 - 161 - mc13xxx->variant = (void *)id_entry->driver_data; 162 - } 154 + mc13xxx->variant = spi_get_device_match_data(spi); 163 155 164 156 return mc13xxx_common_init(&spi->dev); 165 157 }
+12 -5
drivers/mfd/mfd-core.c
··· 146 146 struct platform_device *pdev; 147 147 struct device_node *np = NULL; 148 148 struct mfd_of_node_entry *of_entry, *tmp; 149 + bool disabled = false; 149 150 int ret = -ENOMEM; 150 151 int platform_id; 151 152 int r; ··· 184 183 if (IS_ENABLED(CONFIG_OF) && parent->of_node && cell->of_compatible) { 185 184 for_each_child_of_node(parent->of_node, np) { 186 185 if (of_device_is_compatible(np, cell->of_compatible)) { 187 - /* Ignore 'disabled' devices error free */ 186 + /* Skip 'disabled' devices */ 188 187 if (!of_device_is_available(np)) { 189 - of_node_put(np); 190 - ret = 0; 191 - goto fail_alias; 188 + disabled = true; 189 + continue; 192 190 } 193 191 194 192 ret = mfd_match_of_node_to_dev(pdev, np, cell); ··· 197 197 if (ret) 198 198 goto fail_alias; 199 199 200 - break; 200 + goto match; 201 201 } 202 202 } 203 203 204 + if (disabled) { 205 + /* Ignore 'disabled' devices error free */ 206 + ret = 0; 207 + goto fail_alias; 208 + } 209 + 210 + match: 204 211 if (!pdev->dev.of_node) 205 212 pr_warn("%s: Failed to locate of_node [id: %d]\n", 206 213 cell->name, platform_id);
+1 -6
drivers/mfd/motorola-cpcap.c
··· 11 11 #include <linux/irq.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/regmap.h> 16 16 #include <linux/sysfs.h> 17 17 ··· 290 290 291 291 static int cpcap_probe(struct spi_device *spi) 292 292 { 293 - const struct of_device_id *match; 294 293 struct cpcap_ddata *cpcap; 295 294 int ret; 296 - 297 - match = of_match_device(cpcap_of_match, &spi->dev); 298 - if (!match) 299 - return -ENODEV; 300 295 301 296 cpcap = devm_kzalloc(&spi->dev, sizeof(*cpcap), GFP_KERNEL); 302 297 if (!cpcap)
+2 -7
drivers/mfd/mxs-lradc.c
··· 16 16 #include <linux/mfd/mxs-lradc.h> 17 17 #include <linux/module.h> 18 18 #include <linux/of.h> 19 - #include <linux/of_device.h> 20 19 #include <linux/platform_device.h> 20 + #include <linux/property.h> 21 21 #include <linux/slab.h> 22 22 23 23 #define ADC_CELL 0 ··· 125 125 126 126 static int mxs_lradc_probe(struct platform_device *pdev) 127 127 { 128 - const struct of_device_id *of_id; 129 128 struct device *dev = &pdev->dev; 130 129 struct device_node *node = dev->of_node; 131 130 struct mxs_lradc *lradc; ··· 137 138 if (!lradc) 138 139 return -ENOMEM; 139 140 140 - of_id = of_match_device(mxs_lradc_dt_ids, &pdev->dev); 141 - if (!of_id) 142 - return -EINVAL; 143 - 144 - lradc->soc = (uintptr_t)of_id->data; 141 + lradc->soc = (enum mxs_lradc_id)device_get_match_data(&pdev->dev); 145 142 146 143 lradc->clk = devm_clk_get(&pdev->dev, NULL); 147 144 if (IS_ERR(lradc->clk)) {
+23 -37
drivers/mfd/palmas.c
··· 296 296 }, 297 297 }; 298 298 299 - static struct regmap_irq_chip palmas_irq_chip = { 299 + static const struct regmap_irq_chip palmas_irq_chip = { 300 300 .name = "palmas", 301 301 .irqs = palmas_irqs, 302 302 .num_irqs = ARRAY_SIZE(palmas_irqs), ··· 309 309 PALMAS_INT1_MASK), 310 310 }; 311 311 312 - static struct regmap_irq_chip tps65917_irq_chip = { 312 + static const struct regmap_irq_chip tps65917_irq_chip = { 313 313 .name = "tps65917", 314 314 .irqs = tps65917_irqs, 315 315 .num_irqs = ARRAY_SIZE(tps65917_irqs), ··· 463 463 __func__, ret); 464 464 } 465 465 466 - static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; 467 - static unsigned int tps659038_features; 468 - 469 466 struct palmas_driver_data { 470 - unsigned int *features; 471 - struct regmap_irq_chip *irq_chip; 467 + unsigned int features; 468 + const struct regmap_irq_chip *irq_chip; 472 469 }; 473 470 474 - static struct palmas_driver_data palmas_data = { 475 - .features = &palmas_features, 471 + static const struct palmas_driver_data palmas_data = { 472 + .features = PALMAS_PMIC_FEATURE_SMPS10_BOOST, 476 473 .irq_chip = &palmas_irq_chip, 477 474 }; 478 475 479 - static struct palmas_driver_data tps659038_data = { 480 - .features = &tps659038_features, 476 + static const struct palmas_driver_data tps659038_data = { 481 477 .irq_chip = &palmas_irq_chip, 482 478 }; 483 479 484 - static struct palmas_driver_data tps65917_data = { 485 - .features = &tps659038_features, 480 + static const struct palmas_driver_data tps65917_data = { 486 481 .irq_chip = &tps65917_irq_chip, 487 482 }; 488 - 489 - static const struct of_device_id of_palmas_match_tbl[] = { 490 - { 491 - .compatible = "ti,palmas", 492 - .data = &palmas_data, 493 - }, 494 - { 495 - .compatible = "ti,tps659038", 496 - .data = &tps659038_data, 497 - }, 498 - { 499 - .compatible = "ti,tps65917", 500 - .data = &tps65917_data, 501 - }, 502 - { }, 503 - }; 504 - MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); 505 483 506 484 static int palmas_i2c_probe(struct i2c_client *i2c) 507 485 { 508 486 struct palmas *palmas; 509 487 struct palmas_platform_data *pdata; 510 - struct palmas_driver_data *driver_data; 488 + const struct palmas_driver_data *driver_data; 511 489 struct device_node *node = i2c->dev.of_node; 512 490 int ret = 0, i; 513 491 unsigned int reg, addr; ··· 513 535 palmas->dev = &i2c->dev; 514 536 palmas->irq = i2c->irq; 515 537 516 - driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev); 517 - palmas->features = *driver_data->features; 538 + driver_data = i2c_get_match_data(i2c); 539 + palmas->features = driver_data->features; 518 540 519 541 for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { 520 542 if (i == 0) ··· 690 712 } 691 713 } 692 714 715 + static const struct of_device_id of_palmas_match_tbl[] = { 716 + { .compatible = "ti,palmas", .data = &palmas_data }, 717 + { .compatible = "ti,tps659038", .data = &tps659038_data }, 718 + { .compatible = "ti,tps65917", .data = &tps65917_data }, 719 + { } 720 + }; 721 + MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); 722 + 693 723 static const struct i2c_device_id palmas_i2c_id[] = { 694 - { "palmas", }, 695 - { "twl6035", }, 696 - { "twl6037", }, 697 - { "tps65913", }, 724 + { "palmas", (kernel_ulong_t)&palmas_data }, 725 + { "twl6035", (kernel_ulong_t)&palmas_data }, 726 + { "twl6037", (kernel_ulong_t)&palmas_data }, 727 + { "tps65913", (kernel_ulong_t)&palmas_data }, 698 728 { /* end */ } 699 729 }; 700 730 MODULE_DEVICE_TABLE(i2c, palmas_i2c_id);
+81 -36
drivers/mfd/qcom-spmi-pmic.c
··· 8 8 #include <linux/gfp.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/module.h> 11 + #include <linux/of.h> 12 + #include <linux/of_device.h> 13 + #include <linux/of_platform.h> 11 14 #include <linux/spmi.h> 12 15 #include <linux/types.h> 13 16 #include <linux/regmap.h> 14 - #include <linux/of_platform.h> 15 17 #include <soc/qcom/qcom-spmi-pmic.h> 16 18 17 19 #define PMIC_REV2 0x101 ··· 31 29 int num_usids; 32 30 struct qcom_spmi_pmic pmic; 33 31 }; 32 + 33 + static DEFINE_MUTEX(pmic_spmi_revid_lock); 34 34 35 35 #define N_USIDS(n) ((void *)n) 36 36 ··· 80 76 * 81 77 * This only supports PMICs with 1 or 2 USIDs. 82 78 */ 83 - static struct spmi_device *qcom_pmic_get_base_usid(struct device *dev) 79 + static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx) 84 80 { 85 - struct spmi_device *sdev; 86 - struct qcom_spmi_dev *ctx; 87 81 struct device_node *spmi_bus; 88 - struct device_node *other_usid = NULL; 82 + struct device_node *child; 89 83 int function_parent_usid, ret; 90 84 u32 pmic_addr; 91 - 92 - sdev = to_spmi_device(dev); 93 - ctx = dev_get_drvdata(&sdev->dev); 94 85 95 86 /* 96 87 * Quick return if the function device is already in the base 97 88 * USID. This will always be hit for PMICs with only 1 USID. 98 89 */ 99 - if (sdev->usid % ctx->num_usids == 0) 90 + if (sdev->usid % ctx->num_usids == 0) { 91 + get_device(&sdev->dev); 100 92 return sdev; 93 + } 101 94 102 95 function_parent_usid = sdev->usid; 103 96 ··· 106 105 * device for USID 2. 107 106 */ 108 107 spmi_bus = of_get_parent(sdev->dev.of_node); 109 - do { 110 - other_usid = of_get_next_child(spmi_bus, other_usid); 111 - 112 - ret = of_property_read_u32_index(other_usid, "reg", 0, &pmic_addr); 113 - if (ret) 114 - return ERR_PTR(ret); 115 - 116 - sdev = spmi_device_from_of(other_usid); 117 - if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) { 118 - if (!sdev) 119 - /* 120 - * If the base USID for this PMIC hasn't probed yet 121 - * but the secondary USID has, then we need to defer 122 - * the function driver so that it will attempt to 123 - * probe again when the base USID is ready. 124 - */ 125 - return ERR_PTR(-EPROBE_DEFER); 126 - return sdev; 108 + sdev = ERR_PTR(-ENODATA); 109 + for_each_child_of_node(spmi_bus, child) { 110 + ret = of_property_read_u32_index(child, "reg", 0, &pmic_addr); 111 + if (ret) { 112 + of_node_put(child); 113 + sdev = ERR_PTR(ret); 114 + break; 127 115 } 128 - } while (other_usid->sibling); 129 116 130 - return ERR_PTR(-ENODATA); 117 + if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) { 118 + sdev = spmi_find_device_by_of_node(child); 119 + if (!sdev) { 120 + /* 121 + * If the base USID for this PMIC hasn't been 122 + * registered yet then we need to defer. 123 + */ 124 + sdev = ERR_PTR(-EPROBE_DEFER); 125 + } 126 + of_node_put(child); 127 + break; 128 + } 129 + } 130 + 131 + of_node_put(spmi_bus); 132 + 133 + return sdev; 134 + } 135 + 136 + static int pmic_spmi_get_base_revid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx) 137 + { 138 + struct qcom_spmi_dev *base_ctx; 139 + struct spmi_device *base; 140 + int ret = 0; 141 + 142 + base = qcom_pmic_get_base_usid(sdev, ctx); 143 + if (IS_ERR(base)) 144 + return PTR_ERR(base); 145 + 146 + /* 147 + * Copy revid info from base device if it has probed and is still 148 + * bound to its driver. 149 + */ 150 + mutex_lock(&pmic_spmi_revid_lock); 151 + base_ctx = spmi_device_get_drvdata(base); 152 + if (!base_ctx) { 153 + ret = -EPROBE_DEFER; 154 + goto out_unlock; 155 + } 156 + memcpy(&ctx->pmic, &base_ctx->pmic, sizeof(ctx->pmic)); 157 + out_unlock: 158 + mutex_unlock(&pmic_spmi_revid_lock); 159 + 160 + put_device(&base->dev); 161 + 162 + return ret; 131 163 } 132 164 133 165 static int pmic_spmi_load_revid(struct regmap *map, struct device *dev, ··· 238 204 if (!of_match_device(pmic_spmi_id_table, dev->parent)) 239 205 return ERR_PTR(-EINVAL); 240 206 241 - sdev = qcom_pmic_get_base_usid(dev->parent); 242 - 243 - if (IS_ERR(sdev)) 244 - return ERR_CAST(sdev); 245 - 207 + sdev = to_spmi_device(dev->parent); 246 208 spmi = dev_get_drvdata(&sdev->dev); 247 209 248 210 return &spmi->pmic; 249 211 } 250 - EXPORT_SYMBOL(qcom_pmic_get); 212 + EXPORT_SYMBOL_GPL(qcom_pmic_get); 251 213 252 214 static const struct regmap_config spmi_regmap_config = { 253 215 .reg_bits = 16, ··· 266 236 if (!ctx) 267 237 return -ENOMEM; 268 238 269 - ctx->num_usids = (uintptr_t)of_device_get_match_data(&sdev->dev); 239 + ctx->num_usids = (uintptr_t)device_get_match_data(&sdev->dev); 270 240 271 241 /* Only the first slave id for a PMIC contains this information */ 272 242 if (sdev->usid % ctx->num_usids == 0) { 273 243 ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic); 274 244 if (ret < 0) 275 245 return ret; 246 + } else { 247 + ret = pmic_spmi_get_base_revid(sdev, ctx); 248 + if (ret) 249 + return ret; 276 250 } 251 + 252 + mutex_lock(&pmic_spmi_revid_lock); 277 253 spmi_device_set_drvdata(sdev, ctx); 254 + mutex_unlock(&pmic_spmi_revid_lock); 278 255 279 256 return devm_of_platform_populate(&sdev->dev); 257 + } 258 + 259 + static void pmic_spmi_remove(struct spmi_device *sdev) 260 + { 261 + mutex_lock(&pmic_spmi_revid_lock); 262 + spmi_device_set_drvdata(sdev, NULL); 263 + mutex_unlock(&pmic_spmi_revid_lock); 280 264 } 281 265 282 266 MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); 283 267 284 268 static struct spmi_driver pmic_spmi_driver = { 285 269 .probe = pmic_spmi_probe, 270 + .remove = pmic_spmi_remove, 286 271 .driver = { 287 272 .name = "pmic-spmi", 288 273 .of_match_table = pmic_spmi_id_table,
+4 -4
drivers/mfd/qcom_rpm.c
··· 7 7 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 + #include <linux/property.h> 11 + #include <linux/of.h> 10 12 #include <linux/of_platform.h> 11 13 #include <linux/io.h> 12 14 #include <linux/interrupt.h> ··· 530 528 531 529 static int qcom_rpm_probe(struct platform_device *pdev) 532 530 { 533 - const struct of_device_id *match; 534 531 struct device_node *syscon_np; 535 532 struct qcom_rpm *rpm; 536 533 u32 fw_version[3]; ··· 571 570 if (irq_wakeup < 0) 572 571 return irq_wakeup; 573 572 574 - match = of_match_device(qcom_rpm_of_match, &pdev->dev); 575 - if (!match) 573 + rpm->data = device_get_match_data(&pdev->dev); 574 + if (!rpm->data) 576 575 return -ENODEV; 577 - rpm->data = match->data; 578 576 579 577 rpm->status_regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 580 578 if (IS_ERR(rpm->status_regs))
+6 -1
drivers/mfd/rk8xx-core.c
··· 525 525 reg = RK805_DEV_CTRL_REG; 526 526 bit = DEV_OFF; 527 527 break; 528 + case RK806_ID: 529 + reg = RK806_SYS_CFG3; 530 + bit = DEV_OFF; 531 + break; 528 532 case RK808_ID: 529 533 reg = RK808_DEVCTRL_REG, 530 534 bit = DEV_OFF_RST; ··· 689 685 if (ret) 690 686 return dev_err_probe(dev, ret, "failed to add MFD devices\n"); 691 687 692 - if (device_property_read_bool(dev, "rockchip,system-power-controller")) { 688 + if (device_property_read_bool(dev, "rockchip,system-power-controller") || 689 + device_property_read_bool(dev, "system-power-controller")) { 693 690 ret = devm_register_sys_off_handler(dev, 694 691 SYS_OFF_MODE_POWER_OFF_PREPARE, SYS_OFF_PRIO_HIGH, 695 692 &rk808_power_off, rk808);
+3 -3
drivers/mfd/rk8xx-i2c.c
··· 80 80 .reg_bits = 8, 81 81 .val_bits = 8, 82 82 .max_register = RK818_USB_CTRL_REG, 83 - .cache_type = REGCACHE_RBTREE, 83 + .cache_type = REGCACHE_MAPLE, 84 84 .volatile_reg = rk808_is_volatile_reg, 85 85 }; 86 86 ··· 88 88 .reg_bits = 8, 89 89 .val_bits = 8, 90 90 .max_register = RK805_OFF_SOURCE_REG, 91 - .cache_type = REGCACHE_RBTREE, 91 + .cache_type = REGCACHE_MAPLE, 92 92 .volatile_reg = rk808_is_volatile_reg, 93 93 }; 94 94 ··· 96 96 .reg_bits = 8, 97 97 .val_bits = 8, 98 98 .max_register = RK808_IO_POL_REG, 99 - .cache_type = REGCACHE_RBTREE, 99 + .cache_type = REGCACHE_MAPLE, 100 100 .volatile_reg = rk808_is_volatile_reg, 101 101 }; 102 102
+2 -9
drivers/mfd/rn5t618.c
··· 13 13 #include <linux/mfd/core.h> 14 14 #include <linux/mfd/rn5t618.h> 15 15 #include <linux/module.h> 16 - #include <linux/of_device.h> 16 + #include <linux/of.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/reboot.h> 19 19 #include <linux/regmap.h> ··· 179 179 180 180 static int rn5t618_i2c_probe(struct i2c_client *i2c) 181 181 { 182 - const struct of_device_id *of_id; 183 182 struct rn5t618 *priv; 184 183 int ret; 185 - 186 - of_id = of_match_device(rn5t618_of_match, &i2c->dev); 187 - if (!of_id) { 188 - dev_err(&i2c->dev, "Failed to find matching DT ID\n"); 189 - return -EINVAL; 190 - } 191 184 192 185 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); 193 186 if (!priv) 194 187 return -ENOMEM; 195 188 196 189 i2c_set_clientdata(i2c, priv); 197 - priv->variant = (long)of_id->data; 190 + priv->variant = (long)i2c_get_match_data(i2c); 198 191 priv->irq = i2c->irq; 199 192 priv->dev = &i2c->dev; 200 193
+46
drivers/mfd/stm32-timers.c
··· 215 215 dma_release_channel(ddata->dma.chans[i]); 216 216 } 217 217 218 + static const char * const stm32_timers_irq_name[STM32_TIMERS_MAX_IRQS] = { 219 + "brk", "up", "trg-com", "cc" 220 + }; 221 + 222 + static int stm32_timers_irq_probe(struct platform_device *pdev, 223 + struct stm32_timers *ddata) 224 + { 225 + int i, ret; 226 + 227 + /* 228 + * STM32 Timer may have either: 229 + * - a unique global interrupt line 230 + * - four dedicated interrupt lines that may be handled separately. 231 + * Optionally get them here, to be used by child devices. 232 + */ 233 + ret = platform_get_irq_byname_optional(pdev, "global"); 234 + if (ret < 0 && ret != -ENXIO) { 235 + return ret; 236 + } else if (ret != -ENXIO) { 237 + ddata->irq[STM32_TIMERS_IRQ_GLOBAL_BRK] = ret; 238 + ddata->nr_irqs = 1; 239 + return 0; 240 + } 241 + 242 + for (i = 0; i < STM32_TIMERS_MAX_IRQS; i++) { 243 + ret = platform_get_irq_byname_optional(pdev, stm32_timers_irq_name[i]); 244 + if (ret < 0 && ret != -ENXIO) { 245 + return ret; 246 + } else if (ret != -ENXIO) { 247 + ddata->irq[i] = ret; 248 + ddata->nr_irqs++; 249 + } 250 + } 251 + 252 + if (ddata->nr_irqs && ddata->nr_irqs != STM32_TIMERS_MAX_IRQS) { 253 + dev_err(&pdev->dev, "Invalid number of IRQs %d\n", ddata->nr_irqs); 254 + return -EINVAL; 255 + } 256 + 257 + return 0; 258 + } 259 + 218 260 static int stm32_timers_probe(struct platform_device *pdev) 219 261 { 220 262 struct device *dev = &pdev->dev; ··· 286 244 return PTR_ERR(ddata->clk); 287 245 288 246 stm32_timers_get_arr_size(ddata); 247 + 248 + ret = stm32_timers_irq_probe(pdev, ddata); 249 + if (ret) 250 + return ret; 289 251 290 252 ret = stm32_timers_dma_probe(dev, ddata); 291 253 if (ret) {
+1 -1
drivers/mfd/tps65086.c
··· 34 34 static const struct regmap_config tps65086_regmap_config = { 35 35 .reg_bits = 8, 36 36 .val_bits = 8, 37 - .cache_type = REGCACHE_RBTREE, 37 + .cache_type = REGCACHE_MAPLE, 38 38 .volatile_table = &tps65086_volatile_table, 39 39 }; 40 40
+1 -1
drivers/mfd/tps65090.c
··· 151 151 .val_bits = 8, 152 152 .max_register = TPS65090_MAX_REG, 153 153 .num_reg_defaults_raw = TPS65090_NUM_REGS, 154 - .cache_type = REGCACHE_RBTREE, 154 + .cache_type = REGCACHE_MAPLE, 155 155 .volatile_reg = is_volatile_reg, 156 156 }; 157 157
+1 -1
drivers/mfd/tps65218.c
··· 127 127 static const struct regmap_config tps65218_regmap_config = { 128 128 .reg_bits = 8, 129 129 .val_bits = 8, 130 - .cache_type = REGCACHE_RBTREE, 130 + .cache_type = REGCACHE_MAPLE, 131 131 .volatile_table = &tps65218_volatile_table, 132 132 }; 133 133
+43 -9
drivers/mfd/tps6586x.c
··· 22 22 #include <linux/err.h> 23 23 #include <linux/i2c.h> 24 24 #include <linux/platform_device.h> 25 + #include <linux/reboot.h> 25 26 #include <linux/regmap.h> 26 27 #include <linux/of.h> 27 28 ··· 30 29 #include <linux/mfd/tps6586x.h> 31 30 32 31 #define TPS6586X_SUPPLYENE 0x14 32 + #define SOFT_RST_BIT BIT(0) 33 33 #define EXITSLREQ_BIT BIT(1) 34 34 #define SLEEP_MODE_BIT BIT(3) 35 35 ··· 456 454 .val_bits = 8, 457 455 .max_register = TPS6586X_MAX_REGISTER, 458 456 .volatile_reg = is_volatile_reg, 459 - .cache_type = REGCACHE_RBTREE, 457 + .cache_type = REGCACHE_MAPLE, 460 458 }; 461 459 462 - static struct device *tps6586x_dev; 463 - static void tps6586x_power_off(void) 460 + static int tps6586x_power_off_handler(struct sys_off_data *data) 464 461 { 465 - if (tps6586x_clr_bits(tps6586x_dev, TPS6586X_SUPPLYENE, EXITSLREQ_BIT)) 466 - return; 462 + int ret; 467 463 468 - tps6586x_set_bits(tps6586x_dev, TPS6586X_SUPPLYENE, SLEEP_MODE_BIT); 464 + /* Put the PMIC into sleep state. This takes at least 20ms. */ 465 + ret = tps6586x_clr_bits(data->dev, TPS6586X_SUPPLYENE, EXITSLREQ_BIT); 466 + if (ret) 467 + return notifier_from_errno(ret); 468 + 469 + ret = tps6586x_set_bits(data->dev, TPS6586X_SUPPLYENE, SLEEP_MODE_BIT); 470 + if (ret) 471 + return notifier_from_errno(ret); 472 + 473 + mdelay(50); 474 + return notifier_from_errno(-ETIME); 475 + } 476 + 477 + static int tps6586x_restart_handler(struct sys_off_data *data) 478 + { 479 + int ret; 480 + 481 + /* Put the PMIC into hard reboot state. This takes at least 20ms. */ 482 + ret = tps6586x_set_bits(data->dev, TPS6586X_SUPPLYENE, SOFT_RST_BIT); 483 + if (ret) 484 + return notifier_from_errno(ret); 485 + 486 + mdelay(50); 487 + return notifier_from_errno(-ETIME); 469 488 } 470 489 471 490 static void tps6586x_print_version(struct i2c_client *client, int version) ··· 582 559 goto err_add_devs; 583 560 } 584 561 585 - if (pdata->pm_off && !pm_power_off) { 586 - tps6586x_dev = &client->dev; 587 - pm_power_off = tps6586x_power_off; 562 + if (pdata->pm_off) { 563 + ret = devm_register_power_off_handler(&client->dev, &tps6586x_power_off_handler, 564 + NULL); 565 + if (ret) { 566 + dev_err(&client->dev, "register power off handler failed: %d\n", ret); 567 + goto err_add_devs; 568 + } 569 + 570 + ret = devm_register_restart_handler(&client->dev, &tps6586x_restart_handler, 571 + NULL); 572 + if (ret) { 573 + dev_err(&client->dev, "register restart handler failed: %d\n", ret); 574 + goto err_add_devs; 575 + } 588 576 } 589 577 590 578 return 0;
+3 -10
drivers/mfd/tps65910.c
··· 19 19 #include <linux/regmap.h> 20 20 #include <linux/mfd/tps65910.h> 21 21 #include <linux/of.h> 22 - #include <linux/of_device.h> 22 + #include <linux/property.h> 23 23 24 24 static const struct resource rtc_resources[] = { 25 25 { ··· 281 281 .val_bits = 8, 282 282 .volatile_reg = is_volatile_reg, 283 283 .max_register = TPS65910_MAX_REGISTER - 1, 284 - .cache_type = REGCACHE_RBTREE, 284 + .cache_type = REGCACHE_MAPLE, 285 285 }; 286 286 287 287 static int tps65910_ck32k_init(struct tps65910 *tps65910, ··· 374 374 struct device_node *np = client->dev.of_node; 375 375 struct tps65910_board *board_info; 376 376 unsigned int prop; 377 - const struct of_device_id *match; 378 377 int ret; 379 378 380 - match = of_match_device(tps65910_of_match, &client->dev); 381 - if (!match) { 382 - dev_err(&client->dev, "Failed to find matching dt id\n"); 383 - return NULL; 384 - } 385 - 386 - *chip_id = (unsigned long)match->data; 379 + *chip_id = (unsigned long)device_get_match_data(&client->dev); 387 380 388 381 board_info = devm_kzalloc(&client->dev, sizeof(*board_info), 389 382 GFP_KERNEL);
+1 -1
drivers/mfd/tps65912-core.c
··· 81 81 const struct regmap_config tps65912_regmap_config = { 82 82 .reg_bits = 8, 83 83 .val_bits = 8, 84 - .cache_type = REGCACHE_RBTREE, 84 + .cache_type = REGCACHE_MAPLE, 85 85 .volatile_table = &tps65912_volatile_table, 86 86 }; 87 87 EXPORT_SYMBOL_GPL(tps65912_regmap_config);
+17 -1
drivers/mfd/twl-core.c
··· 31 31 #include <linux/regulator/machine.h> 32 32 33 33 #include <linux/i2c.h> 34 + 35 + #include <linux/mfd/core.h> 34 36 #include <linux/mfd/twl.h> 35 37 36 38 /* Register descriptions for audio */ ··· 314 312 315 313 .reg_defaults = twl4030_49_defaults, 316 314 .num_reg_defaults = ARRAY_SIZE(twl4030_49_defaults), 317 - .cache_type = REGCACHE_RBTREE, 315 + .cache_type = REGCACHE_MAPLE, 318 316 }, 319 317 { 320 318 /* Address 0x4a */ ··· 692 690 { /* sentinel */ }, 693 691 }; 694 692 693 + static const struct mfd_cell twl6032_cells[] = { 694 + { .name = "twl6032-clk" }, 695 + }; 696 + 695 697 /* NOTE: This driver only handles a single twl4030/tps659x0 chip */ 696 698 static int 697 699 twl_probe(struct i2c_client *client) ··· 840 834 temp |= SMARTREFLEX_ENABLE; 841 835 twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, temp, 842 836 TWL4030_DCDC_GLOBAL_CFG); 837 + } 838 + 839 + if (id->driver_data == (TWL6030_CLASS | TWL6032_SUBCLASS)) { 840 + status = devm_mfd_add_devices(&client->dev, 841 + PLATFORM_DEVID_NONE, 842 + twl6032_cells, 843 + ARRAY_SIZE(twl6032_cells), 844 + NULL, 0, NULL); 845 + if (status < 0) 846 + goto free; 843 847 } 844 848 845 849 status = of_platform_populate(node, NULL, twl_auxdata_lookup,
+3 -6
drivers/mfd/twl4030-power.c
··· 27 27 #include <linux/pm.h> 28 28 #include <linux/mfd/twl.h> 29 29 #include <linux/platform_device.h> 30 + #include <linux/property.h> 30 31 #include <linux/of.h> 31 - #include <linux/of_device.h> 32 32 33 33 #include <asm/mach-types.h> 34 34 ··· 883 883 { 884 884 const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev); 885 885 struct device_node *node = pdev->dev.of_node; 886 - const struct of_device_id *match; 887 886 int err = 0; 888 887 int err2 = 0; 889 888 u8 val; ··· 903 904 return err; 904 905 } 905 906 906 - match = of_match_device(of_match_ptr(twl4030_power_of_match), 907 - &pdev->dev); 908 - if (match && match->data) 909 - pdata = match->data; 907 + if (node) 908 + pdata = device_get_match_data(&pdev->dev); 910 909 911 910 if (pdata) { 912 911 err = twl4030_power_configure_scripts(pdata);
+5 -5
drivers/mfd/twl6030-irq.c
··· 24 24 #include <linux/kthread.h> 25 25 #include <linux/mfd/twl.h> 26 26 #include <linux/platform_device.h> 27 + #include <linux/property.h> 27 28 #include <linux/suspend.h> 28 29 #include <linux/of.h> 29 30 #include <linux/irqdomain.h> 30 - #include <linux/of_device.h> 31 31 32 32 #include "twl-core.h" 33 33 ··· 368 368 int nr_irqs; 369 369 int status; 370 370 u8 mask[3]; 371 - const struct of_device_id *of_id; 371 + const int *irq_tbl; 372 372 373 - of_id = of_match_device(twl6030_of_match, dev); 374 - if (!of_id || !of_id->data) { 373 + irq_tbl = device_get_match_data(dev); 374 + if (!irq_tbl) { 375 375 dev_err(dev, "Unknown TWL device model\n"); 376 376 return -EINVAL; 377 377 } ··· 409 409 410 410 twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier; 411 411 atomic_set(&twl6030_irq->wakeirqs, 0); 412 - twl6030_irq->irq_mapping_tbl = of_id->data; 412 + twl6030_irq->irq_mapping_tbl = irq_tbl; 413 413 414 414 twl6030_irq->irq_domain = 415 415 irq_domain_add_linear(node, nr_irqs,
+1 -1
drivers/mfd/wcd934x.c
··· 112 112 static struct regmap_config wcd934x_regmap_config = { 113 113 .reg_bits = 16, 114 114 .val_bits = 8, 115 - .cache_type = REGCACHE_RBTREE, 115 + .cache_type = REGCACHE_MAPLE, 116 116 .max_register = 0xffff, 117 117 .can_multi_write = true, 118 118 .ranges = wcd934x_ranges,
+4 -12
drivers/mfd/wm831x-i2c.c
··· 15 15 #include <linux/slab.h> 16 16 #include <linux/err.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/regmap.h> 20 19 21 20 #include <linux/mfd/wm831x/core.h> ··· 22 23 23 24 static int wm831x_i2c_probe(struct i2c_client *i2c) 24 25 { 25 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 26 26 struct wm831x_pdata *pdata = dev_get_platdata(&i2c->dev); 27 - const struct of_device_id *of_id; 28 27 struct wm831x *wm831x; 29 28 enum wm831x_parent type; 30 29 int ret; 31 30 32 - if (i2c->dev.of_node) { 33 - of_id = of_match_device(wm831x_of_match, &i2c->dev); 34 - if (!of_id) { 35 - dev_err(&i2c->dev, "Failed to match device\n"); 36 - return -ENODEV; 37 - } 38 - type = (uintptr_t)of_id->data; 39 - } else { 40 - type = (enum wm831x_parent)id->driver_data; 31 + type = (uintptr_t)i2c_get_match_data(i2c); 32 + if (!type) { 33 + dev_err(&i2c->dev, "Failed to match device\n"); 34 + return -ENODEV; 41 35 } 42 36 43 37 wm831x = devm_kzalloc(&i2c->dev, sizeof(struct wm831x), GFP_KERNEL);
+4 -12
drivers/mfd/wm831x-spi.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/init.h> 12 12 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/pm.h> 15 14 #include <linux/spi/spi.h> 16 15 #include <linux/regmap.h> ··· 20 21 static int wm831x_spi_probe(struct spi_device *spi) 21 22 { 22 23 struct wm831x_pdata *pdata = dev_get_platdata(&spi->dev); 23 - const struct spi_device_id *id = spi_get_device_id(spi); 24 - const struct of_device_id *of_id; 25 24 struct wm831x *wm831x; 26 25 enum wm831x_parent type; 27 26 int ret; 28 27 29 - if (spi->dev.of_node) { 30 - of_id = of_match_device(wm831x_of_match, &spi->dev); 31 - if (!of_id) { 32 - dev_err(&spi->dev, "Failed to match device\n"); 33 - return -ENODEV; 34 - } 35 - type = (uintptr_t)of_id->data; 36 - } else { 37 - type = (enum wm831x_parent)id->driver_data; 28 + type = (uintptr_t)spi_get_device_match_data(spi); 29 + if (!type) { 30 + dev_err(&spi->dev, "Failed to match device\n"); 31 + return -ENODEV; 38 32 } 39 33 40 34 wm831x = devm_kzalloc(&spi->dev, sizeof(struct wm831x), GFP_KERNEL);
+1 -10
drivers/mfd/wm8994-core.c
··· 15 15 #include <linux/delay.h> 16 16 #include <linux/mfd/core.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pm_runtime.h> 20 19 #include <linux/regmap.h> 21 20 #include <linux/regulator/consumer.h> ··· 611 612 612 613 static int wm8994_i2c_probe(struct i2c_client *i2c) 613 614 { 614 - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); 615 - const struct of_device_id *of_id; 616 615 struct wm8994 *wm8994; 617 616 int ret; 618 617 ··· 622 625 wm8994->dev = &i2c->dev; 623 626 wm8994->irq = i2c->irq; 624 627 625 - if (i2c->dev.of_node) { 626 - of_id = of_match_device(wm8994_of_match, &i2c->dev); 627 - if (of_id) 628 - wm8994->type = (uintptr_t)of_id->data; 629 - } else { 630 - wm8994->type = id->driver_data; 631 - } 628 + wm8994->type = (enum wm8994_type)i2c_get_match_data(i2c); 632 629 633 630 wm8994->regmap = devm_regmap_init_i2c(i2c, &wm8994_base_regmap_config); 634 631 if (IS_ERR(wm8994->regmap)) {
+6 -3
drivers/spmi/spmi.c
··· 388 388 }; 389 389 390 390 /** 391 - * spmi_device_from_of() - get the associated SPMI device from a device node 391 + * spmi_find_device_by_of_node() - look up an SPMI device from a device node 392 392 * 393 393 * @np: device node 394 394 * 395 + * Takes a reference to the embedded struct device which needs to be dropped 396 + * after use. 397 + * 395 398 * Returns the struct spmi_device associated with a device node or NULL. 396 399 */ 397 - struct spmi_device *spmi_device_from_of(struct device_node *np) 400 + struct spmi_device *spmi_find_device_by_of_node(struct device_node *np) 398 401 { 399 402 struct device *dev = bus_find_device_by_of_node(&spmi_bus_type, np); 400 403 ··· 405 402 return to_spmi_device(dev); 406 403 return NULL; 407 404 } 408 - EXPORT_SYMBOL_GPL(spmi_device_from_of); 405 + EXPORT_SYMBOL_GPL(spmi_find_device_by_of_node); 409 406 410 407 /** 411 408 * spmi_device_alloc() - Allocate a new SPMI device
-6
include/linux/mfd/abx500/ab8500.h
··· 499 499 500 500 void ab8500_override_turn_on_stat(u8 mask, u8 set); 501 501 502 - #ifdef CONFIG_AB8500_DEBUG 503 - extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 504 - void ab8500_dump_all_banks(struct device *dev); 505 - void ab8500_debug_register_interrupt(int line); 506 - #else 507 502 static inline void ab8500_dump_all_banks(struct device *dev) {} 508 503 static inline void ab8500_debug_register_interrupt(int line) {} 509 - #endif 510 504 511 505 #endif /* MFD_AB8500_H */
+1 -1
include/linux/mfd/core.h
··· 92 92 * (above) when matching OF nodes with devices that have identical 93 93 * compatible strings 94 94 */ 95 - const u64 of_reg; 95 + u64 of_reg; 96 96 97 97 /* Set to 'true' to use 'of_reg' (above) - allows for of_reg=0 */ 98 98 bool use_of_reg;
+5 -2
include/linux/mfd/lpc_ich.h
··· 15 15 #define ICH_RES_GPE0 1 16 16 17 17 /* GPIO compatibility */ 18 - enum { 18 + enum lpc_gpio_versions { 19 19 ICH_I3100_GPIO, 20 20 ICH_V5_GPIO, 21 21 ICH_V6_GPIO, ··· 26 26 AVOTON_GPIO, 27 27 }; 28 28 29 + struct lpc_ich_gpio_info; 30 + 29 31 struct lpc_ich_info { 30 32 char name[32]; 31 33 unsigned int iTCO_version; 32 - unsigned int gpio_version; 34 + enum lpc_gpio_versions gpio_version; 33 35 enum intel_spi_type spi_type; 36 + const struct lpc_ich_gpio_info *gpio_info; 34 37 u8 use_gpio; 35 38 }; 36 39
+11
include/linux/mfd/stm32-timers.h
··· 102 102 STM32_TIMERS_MAX_DMAS, 103 103 }; 104 104 105 + /* STM32 Timer may have either a unique global interrupt or 4 interrupt lines */ 106 + enum stm32_timers_irqs { 107 + STM32_TIMERS_IRQ_GLOBAL_BRK, /* global or brk IRQ */ 108 + STM32_TIMERS_IRQ_UP, 109 + STM32_TIMERS_IRQ_TRG_COM, 110 + STM32_TIMERS_IRQ_CC, 111 + STM32_TIMERS_MAX_IRQS, 112 + }; 113 + 105 114 /** 106 115 * struct stm32_timers_dma - STM32 timer DMA handling. 107 116 * @completion: end of DMA transfer completion ··· 132 123 struct regmap *regmap; 133 124 u32 max_arr; 134 125 struct stm32_timers_dma dma; /* Only to be used by the parent */ 126 + unsigned int nr_irqs; 127 + int irq[STM32_TIMERS_MAX_IRQS]; 135 128 }; 136 129 137 130 #if IS_REACHABLE(CONFIG_MFD_STM32_TIMERS)
+3
include/linux/reboot.h
··· 129 129 * @cb_data: User's callback data. 130 130 * @cmd: Command string. Currently used only by the sys-off restart mode, 131 131 * NULL otherwise. 132 + * @dev: Device of the sys-off handler. Only if known (devm_register_*), 133 + * NULL otherwise. 132 134 */ 133 135 struct sys_off_data { 134 136 int mode; 135 137 void *cb_data; 136 138 const char *cmd; 139 + struct device *dev; 137 140 }; 138 141 139 142 struct sys_off_handler *
+1 -1
include/linux/spmi.h
··· 166 166 167 167 struct device_node; 168 168 169 - struct spmi_device *spmi_device_from_of(struct device_node *np); 169 + struct spmi_device *spmi_find_device_by_of_node(struct device_node *np); 170 170 int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf); 171 171 int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf, 172 172 size_t len);
+4
kernel/reboot.c
··· 55 55 enum sys_off_mode mode; 56 56 bool blocking; 57 57 void *list; 58 + struct device *dev; 58 59 }; 59 60 60 61 /* ··· 75 74 void emergency_restart(void) 76 75 { 77 76 kmsg_dump(KMSG_DUMP_EMERG); 77 + system_state = SYSTEM_RESTART; 78 78 machine_emergency_restart(); 79 79 } 80 80 EXPORT_SYMBOL_GPL(emergency_restart); ··· 325 323 data.cb_data = handler->cb_data; 326 324 data.mode = mode; 327 325 data.cmd = cmd; 326 + data.dev = handler->dev; 328 327 329 328 return handler->sys_off_cb(&data); 330 329 } ··· 513 510 handler = register_sys_off_handler(mode, priority, callback, cb_data); 514 511 if (IS_ERR(handler)) 515 512 return PTR_ERR(handler); 513 + handler->dev = dev; 516 514 517 515 return devm_add_action_or_reset(dev, devm_unregister_sys_off_handler, 518 516 handler);