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

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

Pull MFD updates from Lee Jones:
"Updates:
- Add Core, Regulator, Onkey and Battery Charger support for the NXP
PF1550 Power Management IC (PMIC)
- Introduce __SMC_KEY macro to fix GCC 15.2.1 errors in macsmc
- Add board definitions for TQMxCU1-HPCM and TQMxCU2-HPCM to the
tqmx86 driver
- Add support for Broadcom BCM2712 SoC to the bcm2835-pm driver
- Hook up the qnap-mcu-eeprom sub-device to qnap-mcu

Fixes:
- Enable compile testing for the Altera SOCFPGA System Manager driver
- Fix device reference leak in altr_sysmgr_regmap_lookup_by_phandle()
- Reserve the unused second I2C address for DA9063 to prevent
userspace interference
- Fix resource leak in da9055_device_init() by calling
regmap_del_irq_chip() in the error path
- Fix potential IRQ chip conflict when probing multiple MAX77620
devices by using devm_kmemdup for regmap_irq_chip
- Return -EPROBE_DEFER when a syscon devuice is not found to allow
deferred probing
- Update email address for the PF1550 PMIC driver in MAINTAINERS
- Correct file entry for PF1550 MFD driver in MAINTAINERS from
pfd1550.h to pf1550.h
- Calculate checksum on the actual number of received bytes in
qnap-mcu for error messages
- Use -EPROTO instead of -EIO for checksum errors in qnap-mcu
- Add proper error handling for command errors (e.g., "@8", "@9") in
qnap-mcu
- Fix missing irq_domain_remove() in error path of
mt63{58,97}_irq_init()

Cleanups:
- Mark SMC write buffer arguments as const in apple_smc_write(),
apple_smc_rw(), and apple_smc_write_atomic()
- Simplify the error handling path in da9055_device_init() by
removing a redundant mfd_remove_devices() call
- Use regmap_reg_range() and a real one-element array for
pmic_status_range in rohm-bd718x7 for cleaner initialization
- Remove select I2C_K1 from MFD_SPACEMIT_P1 to avoid build failures
when I2C_K1's dependencies are disabled
- Remove unneeded semicolon from ls2k_bmc_recover_pci_data()
- Drop OF dependency for MFD_MAX5970 in Kconfig to allow wider
compile testing and non-OF systems
- Make OF ID table style consistent in simple-mfd-i2c driver
- Update header inclusions in simple-mfd-i2c to follow IWYU (Include
What You Use) principle
- Move checksum verification logic to a separate function in qnap-mcu
- Use chained IRQs for S2MPG10 in the Samsung SEC driver to simplify
interrupt handling
- Drop a stray semicolon from sec-irq.c

Removals:
- Remove the unused TI WL1273 FM radio core driver
- Remove the unused wl1273-core.h header and tidy up its reference in
documentation

Device tree bindings:
- Add Device Tree binding for the NXP PF1550 PMIC
- Add missing GPIO pins and supply properties to the Silergy SY7636A
PMIC binding
- Add interrupt-controller property to the Maxim MAX77705 binding for
sub-device interrupt source determination
- Add Device Tree binding for the Renesas R2A11302FT PMIC
- Allow the wakeup-source property in the Dialog DA9063 binding
- Make interrupt-related properties optional in the TI TPS65910 PMIC
binding
- Document the Qualcomm PMIV0104 PMIC compatible string
- Document the Qualcomm PM7550 PMIC compatible string
- Enable power button subnode for TWL603x in the TI TWL binding
- Convert the Dialog DA9052/53 I2C binding from .txt to .yaml format,
including compatible string fallback and interrupt properties
- Document control-scb and sysreg-scb syscons on pic64gx with
fallback compatibles
- Document sama7g5-sfrbu and sama7d65-sfrbu syscons with fallback to
atmel,sama5d2-sfrbu
- Fix LEDs node schema in fsl,mc13xxx binding by adding led@ child
nodes and missing properties
- Add mt7981-topmisc compatible string to the syscon binding"

* tag 'mfd-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (42 commits)
mfd: sec: Drop a stray semicolon
mfd: qnap-mcu: Hook up the EEPROM sub-device
dt-bindings: mfd: syscon: Add mt7981-topmisc
dt-bindings: mfd: fsl,mc13xxx: Fix LEDs node schema
mfd: mt6358-irq: Fix missing irq_domain_remove() in error path
mfd: mt6397-irq: Fix missing irq_domain_remove() in error path
dt-bindings: mfd: Document syscons falling back to atmel,sama5d2-sfrbu
dt-bindings: mfd: Document control-scb and sysreg-scb on pic64gx
dt-bindings: mfd: Convert dlg,da9052-i2c.txt to yaml format
mfd: sec: Use chained IRQs for s2mpg10
mfd: qnap-mcu: Add proper error handling for command errors
mfd: qnap-mcu: Move checksum verification to its own function
mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum errors
mfd: qnap-mcu: Calculate the checksum on the actual number of bytes received
mfd: simple-mfd-i2c: Don't use "proxy" headers
mfd: simple-mfd-i2c: Make ID table style consistent
mfd: Kconfig: Drop OF dependency on MFD_MAX5970
mfd: ls2kbmc: Remove unneeded semicolon from ls2k_bmc_recover_pci_data()
dt-bindings: mfd: twl: Enable power button also for TWL603X
MAINTAINERS: Adjust file entry in NXP PF1550 PMIC MFD DRIVER
...

+583 -821
+1
.mailmap
··· 696 696 Sam Protsenko <semen.protsenko@linaro.org> 697 697 Sam Protsenko <semen.protsenko@linaro.org> <semen.protsenko@globallogic.com> 698 698 Sam Ravnborg <sam@mars.ravnborg.org> 699 + Samuel Kayode <samkay014@gmail.com> <samuel.kayode@savoirfairelinux.com> 699 700 Sankeerth Billakanti <quic_sbillaka@quicinc.com> <sbillaka@codeaurora.org> 700 701 Santosh Shilimkar <santosh.shilimkar@oracle.org> 701 702 Santosh Shilimkar <ssantosh@kernel.org>
-1
Documentation/admin-guide/media/radio-cardlist.rst
··· 30 30 radio-timb Enable the Timberdale radio driver 31 31 radio-trust Trust FM radio card 32 32 radio-typhoon Typhoon Radio (a.k.a. EcoRadio) 33 - radio-wl1273 Texas Instruments WL1273 I2C FM Radio 34 33 fm_drv ISA radio devices 35 34 fm_drv ISA radio devices 36 35 radio-zoltrix Zoltrix Radio
-67
Documentation/devicetree/bindings/mfd/da9052-i2c.txt
··· 1 - * Dialog DA9052/53 Power Management Integrated Circuit (PMIC) 2 - 3 - Required properties: 4 - - compatible : Should be "dlg,da9052", "dlg,da9053-aa", 5 - "dlg,da9053-ab", or "dlg,da9053-bb" 6 - 7 - Optional properties: 8 - - dlg,tsi-as-adc : Boolean, if set the X+, X-, Y+, Y- touchscreen 9 - input lines are used as general purpose analogue 10 - input. 11 - - tsiref-supply: Phandle to the regulator, which provides the reference 12 - voltage for the TSIREF pin. Must be provided when the 13 - touchscreen pins are used for ADC purposes. 14 - 15 - Sub-nodes: 16 - - regulators : Contain the regulator nodes. The DA9052/53 regulators are 17 - bound using their names as listed below: 18 - 19 - buck1 : regulator BUCK CORE 20 - buck2 : regulator BUCK PRO 21 - buck3 : regulator BUCK MEM 22 - buck4 : regulator BUCK PERI 23 - ldo1 : regulator LDO1 24 - ldo2 : regulator LDO2 25 - ldo3 : regulator LDO3 26 - ldo4 : regulator LDO4 27 - ldo5 : regulator LDO5 28 - ldo6 : regulator LDO6 29 - ldo7 : regulator LDO7 30 - ldo8 : regulator LDO8 31 - ldo9 : regulator LDO9 32 - ldo10 : regulator LDO10 33 - 34 - The bindings details of individual regulator device can be found in: 35 - Documentation/devicetree/bindings/regulator/regulator.txt 36 - 37 - Examples: 38 - 39 - i2c@63fc8000 { /* I2C1 */ 40 - 41 - pmic: dialog@48 { 42 - compatible = "dlg,da9053-aa"; 43 - reg = <0x48>; 44 - 45 - regulators { 46 - buck1 { 47 - regulator-min-microvolt = <500000>; 48 - regulator-max-microvolt = <2075000>; 49 - }; 50 - 51 - buck2 { 52 - regulator-min-microvolt = <500000>; 53 - regulator-max-microvolt = <2075000>; 54 - }; 55 - 56 - buck3 { 57 - regulator-min-microvolt = <925000>; 58 - regulator-max-microvolt = <2500000>; 59 - }; 60 - 61 - buck4 { 62 - regulator-min-microvolt = <925000>; 63 - regulator-max-microvolt = <2500000>; 64 - }; 65 - }; 66 - }; 67 - };
+89
Documentation/devicetree/bindings/mfd/dlg,da9052.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/dlg,da9052.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Dialog DA9052/53 Power Management Integrated Circuit (PMIC) 8 + 9 + maintainers: 10 + - Frank Li <Frank.Li@nxp.com> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - enum: 16 + - dlg,da9053-aa 17 + - dlg,da9053-ab 18 + - dlg,da9053-bb 19 + - dlg,da9053-bc 20 + - dlg,da9052 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + dlg,tsi-as-adc: 29 + type: boolean 30 + description: 31 + if set the X+, X-, Y+, Y- touchscreen input lines are used as general 32 + purpose analogue input. 33 + 34 + tsiref-supply: 35 + description: The reference voltage for the TSIREF pin. 36 + 37 + regulators: 38 + type: object 39 + additionalProperties: false 40 + 41 + patternProperties: 42 + "^(ldo([1-9]|10)|buck[1-4])$": 43 + type: object 44 + $ref: /schemas/regulator/regulator.yaml# 45 + unevaluatedProperties: false 46 + 47 + required: 48 + - compatible 49 + - reg 50 + - regulators 51 + 52 + allOf: 53 + - $ref: /schemas/spi/spi-peripheral-props.yaml# 54 + 55 + unevaluatedProperties: false 56 + 57 + examples: 58 + - | 59 + i2c { 60 + #address-cells = <1>; 61 + #size-cells = <0>; 62 + 63 + pmic@48 { 64 + compatible = "dlg,da9053-aa"; 65 + reg = <0x48>; 66 + 67 + regulators { 68 + buck1 { 69 + regulator-min-microvolt = <500000>; 70 + regulator-max-microvolt = <2075000>; 71 + }; 72 + 73 + buck2 { 74 + regulator-min-microvolt = <500000>; 75 + regulator-max-microvolt = <2075000>; 76 + }; 77 + 78 + buck3 { 79 + regulator-min-microvolt = <925000>; 80 + regulator-max-microvolt = <2500000>; 81 + }; 82 + 83 + buck4 { 84 + regulator-min-microvolt = <925000>; 85 + regulator-max-microvolt = <2500000>; 86 + }; 87 + }; 88 + }; 89 + };
+2
Documentation/devicetree/bindings/mfd/dlg,da9063.yaml
··· 81 81 watchdog: 82 82 $ref: /schemas/watchdog/dlg,da9062-watchdog.yaml 83 83 84 + wakeup-source: true 85 + 84 86 patternProperties: 85 87 "^(.+-hog(-[0-9]+)?)$": 86 88 type: object
+42 -30
Documentation/devicetree/bindings/mfd/fsl,mc13xxx.yaml
··· 93 93 94 94 leds: 95 95 type: object 96 - $ref: /schemas/leds/common.yaml# 96 + additionalProperties: false 97 97 98 98 properties: 99 - reg: 100 - description: | 101 - One of 102 - MC13783 LED IDs 103 - 0: Main display 104 - 1: AUX display 105 - 2: Keypad 106 - 3: Red 1 107 - 4: Green 1 108 - 5: Blue 1 109 - 6: Red 2 110 - 7: Green 2 111 - 8: Blue 2 112 - 9: Red 3 113 - 10: Green 3 114 - 11: Blue 3 99 + '#address-cells': 100 + const: 1 115 101 116 - MC13892 LED IDs 117 - 0: Main display 118 - 1: AUX display 119 - 2: Keypad 120 - 3: Red 121 - 4: Green 122 - 5: Blue 123 - 124 - MC34708 LED IDs 125 - 0: Charger Red 126 - 1: Charger Green 127 - maxItems: 1 102 + '#size-cells': 103 + const: 0 128 104 129 105 led-control: 130 106 $ref: /schemas/types.yaml#/definitions/uint32-array 131 107 description: | 132 108 Setting for LED-Control register array length depends on model, 133 109 mc13783: 6, mc13892: 4, mc34708: 1 110 + 111 + patternProperties: 112 + '^led@[0-9a-b]$': 113 + $ref: /schemas/leds/common.yaml# 114 + unevaluatedProperties: false 115 + 116 + properties: 117 + reg: 118 + description: | 119 + One of 120 + MC13783 LED IDs 121 + 0: Main display 122 + 1: AUX display 123 + 2: Keypad 124 + 3: Red 1 125 + 4: Green 1 126 + 5: Blue 1 127 + 6: Red 2 128 + 7: Green 2 129 + 8: Blue 2 130 + 9: Red 3 131 + 10: Green 3 132 + 11: Blue 3 133 + 134 + MC13892 LED IDs 135 + 0: Main display 136 + 1: AUX display 137 + 2: Keypad 138 + 3: Red 139 + 4: Green 140 + 5: Blue 141 + 142 + MC34708 LED IDs 143 + 0: Charger Red 144 + 1: Charger Green 145 + maxItems: 1 134 146 135 147 regulators: 136 148 type: object ··· 274 262 #size-cells = <0>; 275 263 led-control = <0x000 0x000 0x0e0 0x000>; 276 264 277 - sysled@3 { 265 + led@3 { 278 266 reg = <3>; 279 267 label = "system:red:live"; 280 268 linux,default-trigger = "heartbeat";
+14
Documentation/devicetree/bindings/mfd/maxim,max77705.yaml
··· 26 26 interrupts: 27 27 maxItems: 1 28 28 29 + interrupt-controller: 30 + description: 31 + The driver implements an interrupt controller for the sub devices. 32 + The interrupt number mapping is as follows 33 + 0 - charger 34 + 1 - topsys 35 + 2 - fuelgauge 36 + 3 - usb type-c management block. 37 + 38 + '#interrupt-cells': 39 + const: 1 40 + 29 41 haptic: 30 42 type: object 31 43 additionalProperties: false ··· 130 118 pmic@66 { 131 119 compatible = "maxim,max77705"; 132 120 reg = <0x66>; 121 + #interrupt-cells = <1>; 133 122 interrupt-parent = <&pm8998_gpios>; 134 123 interrupts = <11 IRQ_TYPE_LEVEL_LOW>; 124 + interrupt-controller; 135 125 pinctrl-0 = <&chg_int_default>; 136 126 pinctrl-names = "default"; 137 127
+2
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
··· 43 43 - qcom,pm7250b 44 44 - qcom,pm7550ba 45 45 - qcom,pm7325 46 + - qcom,pm7550 46 47 - qcom,pm8004 47 48 - qcom,pm8005 48 49 - qcom,pm8009 ··· 85 84 - qcom,pmi8994 86 85 - qcom,pmi8998 87 86 - qcom,pmih0108 87 + - qcom,pmiv0104 88 88 - qcom,pmk8002 89 89 - qcom,pmk8350 90 90 - qcom,pmk8550
+58
Documentation/devicetree/bindings/mfd/renesas,r2a11302ft.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/renesas,r2a11302ft.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas R2A11302FT Power Supply ICs for R-Car 8 + 9 + maintainers: 10 + - Wolfram Sang <wsa+renesas@sang-engineering.com> 11 + 12 + description: | 13 + The Renesas R2A11302FT PMIC is used with Renesas R-Car Gen1/Gen2 14 + based SoCs. 15 + 16 + FIXME: The binding is incomplete and resembles the information gathered 17 + so far. 18 + 19 + properties: 20 + compatible: 21 + const: renesas,r2a11302ft 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + spi-max-frequency: 27 + maximum: 6000000 28 + 29 + spi-cpol: true 30 + 31 + spi-cpha: true 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - spi-cpol 37 + - spi-cpha 38 + 39 + allOf: 40 + - $ref: /schemas/spi/spi-peripheral-props.yaml# 41 + 42 + unevaluatedProperties: false 43 + 44 + examples: 45 + - | 46 + spi { 47 + #address-cells = <1>; 48 + #size-cells = <0>; 49 + 50 + pmic@0 { 51 + compatible = "renesas,r2a11302ft"; 52 + reg = <0>; 53 + spi-max-frequency = <6000000>; 54 + spi-cpol; 55 + spi-cpha; 56 + }; 57 + }; 58 + ...
+11
Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
··· 32 32 Specifying the power good GPIOs. 33 33 maxItems: 1 34 34 35 + enable-gpios: 36 + maxItems: 1 37 + 38 + vcom-en-gpios: 39 + maxItems: 1 40 + 41 + vin-supply: 42 + description: 43 + Supply for the whole chip. Some vendor kernels and devicetrees 44 + declare this as a non-existing GPIO named "pwrall". 45 + 35 46 regulators: 36 47 type: object 37 48
+121 -105
Documentation/devicetree/bindings/mfd/syscon.yaml
··· 85 85 - mediatek,mt2701-pctl-a-syscfg 86 86 - mediatek,mt2712-pctl-a-syscfg 87 87 - mediatek,mt6397-pctl-pmic-syscfg 88 + - mediatek,mt7981-topmisc 88 89 - mediatek,mt7988-topmisc 89 90 - mediatek,mt8135-pctl-a-syscfg 90 91 - mediatek,mt8135-pctl-b-syscfg ··· 134 133 135 134 properties: 136 135 compatible: 137 - items: 138 - - enum: 139 - - airoha,en7581-pbus-csr 140 - - al,alpine-sysfabric-service 141 - - allwinner,sun8i-a83t-system-controller 142 - - allwinner,sun8i-h3-system-controller 143 - - allwinner,sun8i-v3s-system-controller 144 - - allwinner,sun50i-a64-system-controller 145 - - altr,l3regs 146 - - altr,sdr-ctl 147 - - amd,pensando-elba-syscon 148 - - amlogic,meson-mx-assist 149 - - amlogic,meson-mx-bootrom 150 - - amlogic,meson8-analog-top 151 - - amlogic,meson8b-analog-top 152 - - amlogic,meson8-pmu 153 - - amlogic,meson8b-pmu 154 - - apm,merlin-poweroff-mailbox 155 - - apm,mustang-poweroff-mailbox 156 - - apm,xgene-csw 157 - - apm,xgene-efuse 158 - - apm,xgene-mcb 159 - - apm,xgene-rb 160 - - apm,xgene-scu 161 - - atmel,sama5d2-sfrbu 162 - - atmel,sama5d3-nfc-io 163 - - atmel,sama5d3-sfrbu 164 - - atmel,sama5d4-sfrbu 165 - - axis,artpec6-syscon 166 - - brcm,cru-clkset 167 - - brcm,sr-cdru 168 - - brcm,sr-mhb 169 - - cirrus,ep7209-syscon1 170 - - cirrus,ep7209-syscon2 171 - - cirrus,ep7209-syscon3 172 - - cnxt,cx92755-uc 173 - - freecom,fsg-cs2-system-controller 174 - - fsl,imx93-aonmix-ns-syscfg 175 - - fsl,imx93-wakeupmix-syscfg 176 - - fsl,ls1088a-reset 177 - - fsl,vf610-anatop 178 - - fsl,vf610-mscm-cpucfg 179 - - hisilicon,dsa-subctrl 180 - - hisilicon,hi6220-sramctrl 181 - - hisilicon,hip04-ppe 182 - - hisilicon,pcie-sas-subctrl 183 - - hisilicon,peri-subctrl 184 - - hpe,gxp-sysreg 185 - - loongson,ls1b-syscon 186 - - loongson,ls1c-syscon 187 - - lsi,axxia-syscon 188 - - marvell,armada-3700-cpu-misc 189 - - marvell,armada-3700-nb-pm 190 - - marvell,armada-3700-avs 191 - - marvell,armada-3700-usb2-host-device-misc 192 - - marvell,armada-3700-usb2-host-misc 193 - - marvell,dove-global-config 194 - - mediatek,mt2701-pctl-a-syscfg 195 - - mediatek,mt2712-pctl-a-syscfg 196 - - mediatek,mt6397-pctl-pmic-syscfg 197 - - mediatek,mt7988-topmisc 198 - - mediatek,mt8135-pctl-a-syscfg 199 - - mediatek,mt8135-pctl-b-syscfg 200 - - mediatek,mt8173-pctl-a-syscfg 201 - - mediatek,mt8365-infracfg-nao 202 - - mediatek,mt8365-syscfg 203 - - microchip,lan966x-cpu-syscon 204 - - microchip,mpfs-control-scb 205 - - microchip,mpfs-sysreg-scb 206 - - microchip,sam9x60-sfr 207 - - microchip,sama7d65-ddr3phy 208 - - microchip,sama7d65-sfrbu 209 - - microchip,sama7g5-ddr3phy 210 - - mscc,ocelot-cpu-syscon 211 - - mstar,msc313-pmsleep 212 - - nuvoton,ma35d1-sys 213 - - nuvoton,wpcm450-shm 214 - - qcom,apq8064-mmss-sfpb 215 - - qcom,apq8064-sps-sic 216 - - rockchip,px30-qos 217 - - rockchip,rk3036-qos 218 - - rockchip,rk3066-qos 219 - - rockchip,rk3128-qos 220 - - rockchip,rk3228-qos 221 - - rockchip,rk3288-qos 222 - - rockchip,rk3368-qos 223 - - rockchip,rk3399-qos 224 - - rockchip,rk3528-qos 225 - - rockchip,rk3562-qos 226 - - rockchip,rk3568-qos 227 - - rockchip,rk3576-qos 228 - - rockchip,rk3588-qos 229 - - rockchip,rv1126-qos 230 - - st,spear1340-misc 231 - - stericsson,nomadik-pmu 232 - - starfive,jh7100-sysmain 233 - - ti,am62-opp-efuse-table 234 - - ti,am62-usb-phy-ctrl 235 - - ti,am625-dss-oldi-io-ctrl 236 - - ti,am62p-cpsw-mac-efuse 237 - - ti,am654-dss-oldi-io-ctrl 238 - - ti,j784s4-acspcie-proxy-ctrl 239 - - ti,j784s4-pcie-ctrl 240 - - ti,keystone-pllctrl 241 - - const: syscon 136 + oneOf: 137 + - items: 138 + - enum: 139 + - airoha,en7581-pbus-csr 140 + - al,alpine-sysfabric-service 141 + - allwinner,sun8i-a83t-system-controller 142 + - allwinner,sun8i-h3-system-controller 143 + - allwinner,sun8i-v3s-system-controller 144 + - allwinner,sun50i-a64-system-controller 145 + - altr,l3regs 146 + - altr,sdr-ctl 147 + - amd,pensando-elba-syscon 148 + - amlogic,meson-mx-assist 149 + - amlogic,meson-mx-bootrom 150 + - amlogic,meson8-analog-top 151 + - amlogic,meson8b-analog-top 152 + - amlogic,meson8-pmu 153 + - amlogic,meson8b-pmu 154 + - apm,merlin-poweroff-mailbox 155 + - apm,mustang-poweroff-mailbox 156 + - apm,xgene-csw 157 + - apm,xgene-efuse 158 + - apm,xgene-mcb 159 + - apm,xgene-rb 160 + - apm,xgene-scu 161 + - atmel,sama5d2-sfrbu 162 + - atmel,sama5d3-nfc-io 163 + - atmel,sama5d3-sfrbu 164 + - atmel,sama5d4-sfrbu 165 + - axis,artpec6-syscon 166 + - brcm,cru-clkset 167 + - brcm,sr-cdru 168 + - brcm,sr-mhb 169 + - cirrus,ep7209-syscon1 170 + - cirrus,ep7209-syscon2 171 + - cirrus,ep7209-syscon3 172 + - cnxt,cx92755-uc 173 + - freecom,fsg-cs2-system-controller 174 + - fsl,imx93-aonmix-ns-syscfg 175 + - fsl,imx93-wakeupmix-syscfg 176 + - fsl,ls1088a-reset 177 + - fsl,vf610-anatop 178 + - fsl,vf610-mscm-cpucfg 179 + - hisilicon,dsa-subctrl 180 + - hisilicon,hi6220-sramctrl 181 + - hisilicon,hip04-ppe 182 + - hisilicon,pcie-sas-subctrl 183 + - hisilicon,peri-subctrl 184 + - hpe,gxp-sysreg 185 + - loongson,ls1b-syscon 186 + - loongson,ls1c-syscon 187 + - lsi,axxia-syscon 188 + - marvell,armada-3700-cpu-misc 189 + - marvell,armada-3700-nb-pm 190 + - marvell,armada-3700-avs 191 + - marvell,armada-3700-usb2-host-device-misc 192 + - marvell,armada-3700-usb2-host-misc 193 + - marvell,dove-global-config 194 + - mediatek,mt2701-pctl-a-syscfg 195 + - mediatek,mt2712-pctl-a-syscfg 196 + - mediatek,mt6397-pctl-pmic-syscfg 197 + - mediatek,mt7988-topmisc 198 + - mediatek,mt8135-pctl-a-syscfg 199 + - mediatek,mt8135-pctl-b-syscfg 200 + - mediatek,mt8173-pctl-a-syscfg 201 + - mediatek,mt8365-infracfg-nao 202 + - mediatek,mt8365-syscfg 203 + - microchip,lan966x-cpu-syscon 204 + - microchip,mpfs-control-scb 205 + - microchip,mpfs-sysreg-scb 206 + - microchip,sam9x60-sfr 207 + - microchip,sama7d65-ddr3phy 208 + - microchip,sama7d65-sfrbu 209 + - microchip,sama7g5-ddr3phy 210 + - mscc,ocelot-cpu-syscon 211 + - mstar,msc313-pmsleep 212 + - nuvoton,ma35d1-sys 213 + - nuvoton,wpcm450-shm 214 + - qcom,apq8064-mmss-sfpb 215 + - qcom,apq8064-sps-sic 216 + - rockchip,px30-qos 217 + - rockchip,rk3036-qos 218 + - rockchip,rk3066-qos 219 + - rockchip,rk3128-qos 220 + - rockchip,rk3228-qos 221 + - rockchip,rk3288-qos 222 + - rockchip,rk3368-qos 223 + - rockchip,rk3399-qos 224 + - rockchip,rk3528-qos 225 + - rockchip,rk3562-qos 226 + - rockchip,rk3568-qos 227 + - rockchip,rk3576-qos 228 + - rockchip,rk3588-qos 229 + - rockchip,rv1126-qos 230 + - st,spear1340-misc 231 + - stericsson,nomadik-pmu 232 + - starfive,jh7100-sysmain 233 + - ti,am62-opp-efuse-table 234 + - ti,am62-usb-phy-ctrl 235 + - ti,am625-dss-oldi-io-ctrl 236 + - ti,am62p-cpsw-mac-efuse 237 + - ti,am654-dss-oldi-io-ctrl 238 + - ti,j784s4-acspcie-proxy-ctrl 239 + - ti,j784s4-pcie-ctrl 240 + - ti,keystone-pllctrl 241 + - const: syscon 242 + - items: 243 + - enum: 244 + - microchip,sama7g5-sfrbu 245 + - microchip,sama7d65-sfrbu 246 + - const: atmel,sama5d2-sfrbu 247 + - const: syscon 248 + - items: 249 + - const: microchip,pic64gx-control-scb 250 + - const: microchip,mpfs-control-scb 251 + - const: syscon 252 + - items: 253 + - const: microchip,pic64gx-sysreg-scb 254 + - const: microchip,mpfs-sysreg-scb 255 + - const: syscon 242 256 243 257 reg: 244 258 maxItems: 1
-3
Documentation/devicetree/bindings/mfd/ti,tps65910.yaml
··· 166 166 required: 167 167 - compatible 168 168 - reg 169 - - interrupts 170 - - interrupt-controller 171 - - '#interrupt-cells' 172 169 - gpio-controller 173 170 - '#gpio-cells' 174 171 - regulators
+34 -6
Documentation/devicetree/bindings/mfd/ti,twl.yaml
··· 55 55 56 56 gpadc: false 57 57 58 + pwrbutton: 59 + properties: 60 + compatible: 61 + const: ti,twl4030-pwrbutton 62 + interrupts: 63 + items: 64 + - items: 65 + const: 8 66 + 58 67 usb-comparator: false 59 68 60 69 - if: ··· 104 95 compatible: 105 96 const: ti,twl6030-gpadc 106 97 107 - pwrbutton: false 98 + pwrbutton: 99 + properties: 100 + compatible: 101 + const: ti,twl6030-pwrbutton 102 + interrupts: 103 + items: 104 + - items: 105 + const: 0 108 106 109 107 madc: false 110 108 ··· 162 146 compatible: 163 147 const: ti,twl6032-gpadc 164 148 165 - pwrbutton: false 149 + pwrbutton: 150 + properties: 151 + compatible: 152 + const: ti,twl6030-pwrbutton 153 + interrupts: 154 + items: 155 + - items: 156 + const: 0 166 157 167 158 madc: false 168 159 ··· 249 226 250 227 properties: 251 228 compatible: 252 - const: ti,twl4030-pwrbutton 229 + enum: 230 + - ti,twl4030-pwrbutton 231 + - ti,twl6030-pwrbutton 253 232 interrupts: 254 - items: 255 - - items: 256 - const: 8 233 + maxItems: 1 257 234 258 235 watchdog: 259 236 type: object ··· 480 457 compatible = "ti,twl6030-gpadc"; 481 458 interrupts = <6>; 482 459 #io-channel-cells = <1>; 460 + }; 461 + 462 + pwrbutton { 463 + compatible = "ti,twl6030-pwrbutton"; 464 + interrupts = <0>; 483 465 }; 484 466 485 467 rtc {
+2 -2
MAINTAINERS
··· 18742 18742 F: drivers/regulator/pf530x-regulator.c 18743 18743 18744 18744 NXP PF1550 PMIC MFD DRIVER 18745 - M: Samuel Kayode <samuel.kayode@savoirfairelinux.com> 18745 + M: Samuel Kayode <samkay014@gmail.com> 18746 18746 L: imx@lists.linux.dev 18747 18747 S: Maintained 18748 18748 F: Documentation/devicetree/bindings/mfd/nxp,pf1550.yaml ··· 18750 18750 F: drivers/mfd/pf1550.c 18751 18751 F: drivers/power/supply/pf1550-charger.c 18752 18752 F: drivers/regulator/pf1550-regulator.c 18753 - F: include/linux/mfd/pfd1550.h 18753 + F: include/linux/mfd/pf1550.h 18754 18754 18755 18755 NXP PF8100/PF8121A/PF8200 PMIC REGULATOR DEVICE DRIVER 18756 18756 M: Jagan Teki <jagan@amarulasolutions.com>
+3 -13
drivers/mfd/Kconfig
··· 45 45 46 46 config MFD_ALTERA_SYSMGR 47 47 bool "Altera SOCFPGA System Manager" 48 - depends on ARCH_INTEL_SOCFPGA && OF 48 + depends on ARCH_INTEL_SOCFPGA || COMPILE_TEST 49 + depends on OF 49 50 select MFD_SYSCON 50 51 help 51 52 Select this to get System Manager support for all Altera branded ··· 896 895 897 896 config MFD_MAX5970 898 897 tristate "Maxim 5970/5978 power switch and monitor" 899 - depends on I2C && OF 898 + depends on I2C 900 899 select MFD_SIMPLE_MFD_I2C 901 900 help 902 901 This driver controls a Maxim 5970/5978 switch via I2C bus. ··· 1275 1274 tristate "SpacemiT P1 PMIC" 1276 1275 depends on ARCH_SPACEMIT || COMPILE_TEST 1277 1276 depends on I2C 1278 - select I2C_K1 1279 1277 select MFD_SIMPLE_MFD_I2C 1280 1278 help 1281 1279 This option supports the I2C-based SpacemiT P1 PMIC, which ··· 2001 2001 regulators, Dual slot memory card transceivers, real-time clock 2002 2002 and other features that are often used in portable devices like 2003 2003 cell phones and PDAs. 2004 - 2005 - config MFD_WL1273_CORE 2006 - tristate "TI WL1273 FM radio" 2007 - depends on I2C 2008 - select MFD_CORE 2009 - default n 2010 - help 2011 - This is the core driver for the TI WL1273 FM radio. This MFD 2012 - driver connects the radio-wl1273 V4L2 module and the wl1273 2013 - audio codec. 2014 2004 2015 2005 config MFD_LM3533 2016 2006 tristate "TI/National Semiconductor LM3533 Lighting Power chip"
-1
drivers/mfd/Makefile
··· 207 207 obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o 208 208 obj-$(CONFIG_MFD_TPS6586X) += tps6586x.o 209 209 obj-$(CONFIG_MFD_VX855) += vx855.o 210 - obj-$(CONFIG_MFD_WL1273_CORE) += wl1273-core.o 211 210 212 211 si476x-core-y := si476x-cmd.o si476x-prop.o si476x-i2c.o 213 212 obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o
+2
drivers/mfd/altera-sysmgr.c
··· 117 117 118 118 sysmgr = dev_get_drvdata(dev); 119 119 120 + put_device(dev); 121 + 120 122 return sysmgr->regmap; 121 123 } 122 124 EXPORT_SYMBOL_GPL(altr_sysmgr_regmap_lookup_by_phandle);
+1
drivers/mfd/bcm2835-pm.c
··· 108 108 { .compatible = "brcm,bcm2835-pm-wdt", }, 109 109 { .compatible = "brcm,bcm2835-pm", }, 110 110 { .compatible = "brcm,bcm2711-pm", }, 111 + { .compatible = "brcm,bcm2712-pm", }, 111 112 {}, 112 113 }; 113 114 MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
+1 -1
drivers/mfd/da9055-core.c
··· 387 387 return 0; 388 388 389 389 err: 390 - mfd_remove_devices(da9055->dev); 390 + regmap_del_irq_chip(da9055->chip_irq, da9055->irq_data); 391 391 return ret; 392 392 } 393 393
+3
drivers/mfd/da9063-i2c.c
··· 469 469 } 470 470 } 471 471 472 + /* Reserve our unused second address so userspace won't interfere */ 473 + devm_i2c_new_dummy_device(&i2c->dev, i2c->adapter, i2c->addr + 1); 474 + 472 475 return da9063_device_init(da9063, i2c->irq); 473 476 } 474 477
+1 -1
drivers/mfd/ls2k-bmc-core.c
··· 265 265 if (!ls2k_bmc_bar0_addr_is_set(parent)) 266 266 break; 267 267 mdelay(1); 268 - }; 268 + } 269 269 270 270 if (i == 0) 271 271 return false;
+3 -3
drivers/mfd/macsmc.c
··· 173 173 } 174 174 EXPORT_SYMBOL(apple_smc_read); 175 175 176 - int apple_smc_write(struct apple_smc *smc, smc_key key, void *buf, size_t size) 176 + int apple_smc_write(struct apple_smc *smc, smc_key key, const void *buf, size_t size) 177 177 { 178 178 guard(mutex)(&smc->mutex); 179 179 ··· 181 181 } 182 182 EXPORT_SYMBOL(apple_smc_write); 183 183 184 - int apple_smc_rw(struct apple_smc *smc, smc_key key, void *wbuf, size_t wsize, 184 + int apple_smc_rw(struct apple_smc *smc, smc_key key, const void *wbuf, size_t wsize, 185 185 void *rbuf, size_t rsize) 186 186 { 187 187 guard(mutex)(&smc->mutex); ··· 239 239 } 240 240 EXPORT_SYMBOL(apple_smc_enter_atomic); 241 241 242 - int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, void *buf, size_t size) 242 + int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf, size_t size) 243 243 { 244 244 guard(spinlock_irqsave)(&smc->lock); 245 245 u8 result;
+11 -4
drivers/mfd/max77620.c
··· 254 254 return ret; 255 255 } 256 256 257 - static struct regmap_irq_chip max77620_top_irq_chip = { 257 + static const struct regmap_irq_chip max77620_top_irq_chip = { 258 258 .name = "max77620-top", 259 259 .irqs = max77620_top_irqs, 260 260 .num_irqs = ARRAY_SIZE(max77620_top_irqs), ··· 498 498 const struct i2c_device_id *id = i2c_client_get_device_id(client); 499 499 const struct regmap_config *rmap_config; 500 500 struct max77620_chip *chip; 501 + struct regmap_irq_chip *chip_desc; 501 502 const struct mfd_cell *mfd_cells; 502 503 int n_mfd_cells; 503 504 bool pm_off; ··· 509 508 return -ENOMEM; 510 509 511 510 i2c_set_clientdata(client, chip); 511 + 512 + chip_desc = devm_kmemdup(&client->dev, &max77620_top_irq_chip, 513 + sizeof(max77620_top_irq_chip), 514 + GFP_KERNEL); 515 + if (!chip_desc) 516 + return -ENOMEM; 517 + chip_desc->irq_drv_data = chip; 518 + 512 519 chip->dev = &client->dev; 513 520 chip->chip_irq = client->irq; 514 521 chip->chip_id = (enum max77620_chip_id)id->driver_data; ··· 553 544 if (ret < 0) 554 545 return ret; 555 546 556 - max77620_top_irq_chip.irq_drv_data = chip; 557 547 ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq, 558 548 IRQF_ONESHOT | IRQF_SHARED, 0, 559 - &max77620_top_irq_chip, 560 - &chip->top_irq_data); 549 + chip_desc, &chip->top_irq_data); 561 550 if (ret < 0) { 562 551 dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret); 563 552 return ret;
+1
drivers/mfd/mt6358-irq.c
··· 285 285 if (ret) { 286 286 dev_err(chip->dev, "Failed to register IRQ=%d, ret=%d\n", 287 287 chip->irq, ret); 288 + irq_domain_remove(chip->irq_domain); 288 289 return ret; 289 290 } 290 291
+1
drivers/mfd/mt6397-irq.c
··· 229 229 if (ret) { 230 230 dev_err(chip->dev, "failed to register irq=%d; err: %d\n", 231 231 chip->irq, ret); 232 + irq_domain_remove(chip->irq_domain); 232 233 return ret; 233 234 } 234 235
+75 -5
drivers/mfd/qnap-mcu.c
··· 19 19 /* The longest command found so far is 5 bytes long */ 20 20 #define QNAP_MCU_MAX_CMD_SIZE 5 21 21 #define QNAP_MCU_MAX_DATA_SIZE 36 22 + #define QNAP_MCU_ERROR_SIZE 2 22 23 #define QNAP_MCU_CHECKSUM_SIZE 1 23 24 24 25 #define QNAP_MCU_RX_BUFFER_SIZE \ ··· 79 78 return csum; 80 79 } 81 80 81 + static bool qnap_mcu_verify_checksum(const u8 *buf, size_t size) 82 + { 83 + u8 crc = qnap_mcu_csum(buf, size - QNAP_MCU_CHECKSUM_SIZE); 84 + 85 + return crc == buf[size - QNAP_MCU_CHECKSUM_SIZE]; 86 + } 87 + 82 88 static int qnap_mcu_write(struct qnap_mcu *mcu, const u8 *data, u8 data_size) 83 89 { 84 90 unsigned char tx[QNAP_MCU_TX_BUFFER_SIZE]; ··· 102 94 serdev_device_write_flush(mcu->serdev); 103 95 104 96 return serdev_device_write(mcu->serdev, tx, length, HZ); 97 + } 98 + 99 + static bool qnap_mcu_is_error_msg(size_t size) 100 + { 101 + return (size == QNAP_MCU_ERROR_SIZE + QNAP_MCU_CHECKSUM_SIZE); 102 + } 103 + 104 + static bool qnap_mcu_reply_is_generic_error(unsigned char *buf, size_t size) 105 + { 106 + if (!qnap_mcu_is_error_msg(size)) 107 + return false; 108 + 109 + if (buf[0] == '@' && buf[1] == '9') 110 + return true; 111 + 112 + return false; 113 + } 114 + 115 + static bool qnap_mcu_reply_is_checksum_error(unsigned char *buf, size_t size) 116 + { 117 + if (!qnap_mcu_is_error_msg(size)) 118 + return false; 119 + 120 + if (buf[0] == '@' && buf[1] == '8') 121 + return true; 122 + 123 + return false; 124 + } 125 + 126 + static bool qnap_mcu_reply_is_any_error(struct qnap_mcu *mcu, unsigned char *buf, size_t size) 127 + { 128 + if (qnap_mcu_reply_is_generic_error(buf, size)) { 129 + dev_err(&mcu->serdev->dev, "Controller sent generic error response\n"); 130 + return true; 131 + } 132 + 133 + if (qnap_mcu_reply_is_checksum_error(buf, size)) { 134 + dev_err(&mcu->serdev->dev, "Controller received invalid checksum for the command\n"); 135 + return true; 136 + } 137 + 138 + return false; 105 139 } 106 140 107 141 static size_t qnap_mcu_receive_buf(struct serdev_device *serdev, const u8 *buf, size_t size) ··· 180 130 } 181 131 182 132 /* 133 + * We received everything the uart had to offer for now. 134 + * This could mean that either the uart will send more in a 2nd 135 + * receive run, or that the MCU cut the reply short because it 136 + * sent an error code instead of the expected reply. 137 + * 138 + * So check if the received data has the correct size for an error 139 + * reply and if it matches, is an actual error code. 140 + */ 141 + if (qnap_mcu_is_error_msg(reply->received) && 142 + qnap_mcu_verify_checksum(reply->data, reply->received) && 143 + qnap_mcu_reply_is_any_error(mcu, reply->data, reply->received)) { 144 + /* The reply was an error code, we're done */ 145 + reply->length = 0; 146 + 147 + complete(&reply->done); 148 + } 149 + 150 + /* 183 151 * The only way to get out of the above loop and end up here 184 152 * is through consuming all of the supplied data, so here we 185 153 * report that we processed it all. ··· 218 150 size_t length = reply_data_size + QNAP_MCU_CHECKSUM_SIZE; 219 151 struct qnap_mcu_reply *reply = &mcu->reply; 220 152 int ret = 0; 221 - u8 crc; 222 153 223 154 if (length > sizeof(rx)) { 224 155 dev_err(&mcu->serdev->dev, "expected data too big for receive buffer"); ··· 242 175 return -ETIMEDOUT; 243 176 } 244 177 245 - crc = qnap_mcu_csum(rx, reply_data_size); 246 - if (crc != rx[reply_data_size]) { 247 - dev_err(&mcu->serdev->dev, "Invalid Checksum received\n"); 248 - return -EIO; 178 + if (!qnap_mcu_verify_checksum(rx, reply->received)) { 179 + dev_err(&mcu->serdev->dev, "Invalid Checksum received from controller\n"); 180 + return -EPROTO; 249 181 } 182 + 183 + if (qnap_mcu_reply_is_any_error(mcu, rx, reply->received)) 184 + return -EPROTO; 250 185 251 186 memcpy(reply_data, rx, reply_data_size); 252 187 ··· 333 264 }; 334 265 335 266 static struct mfd_cell qnap_mcu_cells[] = { 267 + { .name = "qnap-mcu-eeprom", }, 336 268 { .name = "qnap-mcu-input", }, 337 269 { .name = "qnap-mcu-leds", }, 338 270 { .name = "qnap-mcu-hwmon", }
+4 -5
drivers/mfd/rohm-bd718x7.c
··· 72 72 .init_ack_masked = true, 73 73 }; 74 74 75 - static const struct regmap_range pmic_status_range = { 76 - .range_min = BD718XX_REG_IRQ, 77 - .range_max = BD718XX_REG_POW_STATE, 75 + static const struct regmap_range pmic_status_range[] = { 76 + regmap_reg_range(BD718XX_REG_IRQ, BD718XX_REG_POW_STATE), 78 77 }; 79 78 80 79 static const struct regmap_access_table volatile_regs = { 81 - .yes_ranges = &pmic_status_range, 82 - .n_yes_ranges = 1, 80 + .yes_ranges = &pmic_status_range[0], 81 + .n_yes_ranges = ARRAY_SIZE(pmic_status_range), 83 82 }; 84 83 85 84 static const struct regmap_config bd718xx_regmap_config = {
+1 -22
drivers/mfd/sec-acpm.c
··· 325 325 return regmap; 326 326 } 327 327 328 - static void sec_pmic_acpm_mask_common_irqs(void *regmap_common) 329 - { 330 - regmap_write(regmap_common, S2MPG10_COMMON_INT_MASK, S2MPG10_COMMON_INT_SRC); 331 - } 332 - 333 328 static int sec_pmic_acpm_probe(struct platform_device *pdev) 334 329 { 335 330 struct regmap *regmap_common, *regmap_pmic, *regmap; ··· 355 360 shared_ctx->speedy_channel = pdata->speedy_channel; 356 361 357 362 regmap_common = sec_pmic_acpm_regmap_init(dev, shared_ctx, SEC_PMIC_ACPM_ACCESSTYPE_COMMON, 358 - pdata->regmap_cfg_common, false); 363 + pdata->regmap_cfg_common, true); 359 364 if (IS_ERR(regmap_common)) 360 365 return PTR_ERR(regmap_common); 361 - 362 - /* Mask all interrupts from 'common' block, until successful init */ 363 - ret = regmap_write(regmap_common, S2MPG10_COMMON_INT_MASK, S2MPG10_COMMON_INT_SRC); 364 - if (ret) 365 - return dev_err_probe(dev, ret, "failed to mask common block interrupts\n"); 366 366 367 367 regmap_pmic = sec_pmic_acpm_regmap_init(dev, shared_ctx, SEC_PMIC_ACPM_ACCESSTYPE_PMIC, 368 368 pdata->regmap_cfg_pmic, false); ··· 380 390 381 391 if (device_property_read_bool(dev, "wakeup-source")) 382 392 devm_device_init_wakeup(dev); 383 - 384 - /* Unmask PMIC interrupt from 'common' block, now that everything is in place. */ 385 - ret = regmap_clear_bits(regmap_common, S2MPG10_COMMON_INT_MASK, 386 - S2MPG10_COMMON_INT_SRC_PMIC); 387 - if (ret) 388 - return dev_err_probe(dev, ret, "failed to unmask PMIC interrupt\n"); 389 - 390 - /* Mask all interrupts from 'common' block on shutdown */ 391 - ret = devm_add_action_or_reset(dev, sec_pmic_acpm_mask_common_irqs, regmap_common); 392 - if (ret) 393 - return ret; 394 393 395 394 return 0; 396 395 }
+70 -3
drivers/mfd/sec-irq.c
··· 20 20 #include "sec-core.h" 21 21 22 22 static const struct regmap_irq s2mpg10_irqs[] = { 23 + REGMAP_IRQ_REG(S2MPG10_COMMON_IRQ_PMIC, 0, S2MPG10_COMMON_INT_SRC_PMIC), 24 + /* No documentation or other reference for remaining bits */ 25 + REGMAP_IRQ_REG(S2MPG10_COMMON_IRQ_UNUSED, 0, GENMASK(7, 1)), 26 + }; 27 + 28 + static const struct regmap_irq s2mpg10_pmic_irqs[] = { 23 29 REGMAP_IRQ_REG(S2MPG10_IRQ_PWRONF, 0, S2MPG10_IRQ_PWRONF_MASK), 24 30 REGMAP_IRQ_REG(S2MPG10_IRQ_PWRONR, 0, S2MPG10_IRQ_PWRONR_MASK), 25 31 REGMAP_IRQ_REG(S2MPG10_IRQ_JIGONBF, 0, S2MPG10_IRQ_JIGONBF_MASK), ··· 189 183 /* All S2MPG10 interrupt sources are read-only and don't require clearing */ 190 184 static const struct regmap_irq_chip s2mpg10_irq_chip = { 191 185 .name = "s2mpg10", 186 + .status_base = S2MPG10_COMMON_INT, 187 + .mask_base = S2MPG10_COMMON_INT_MASK, 188 + .num_regs = 1, 192 189 .irqs = s2mpg10_irqs, 193 190 .num_irqs = ARRAY_SIZE(s2mpg10_irqs), 194 - .num_regs = 6, 191 + }; 192 + 193 + static const struct regmap_irq_chip s2mpg10_irq_chip_pmic = { 194 + .name = "s2mpg10-pmic", 195 195 .status_base = S2MPG10_PMIC_INT1, 196 196 .mask_base = S2MPG10_PMIC_INT1M, 197 + .num_regs = 6, 198 + .irqs = s2mpg10_pmic_irqs, 199 + .num_irqs = ARRAY_SIZE(s2mpg10_pmic_irqs), 197 200 }; 198 201 199 202 static const struct regmap_irq_chip s2mps11_irq_chip = { ··· 268 253 .ack_base = S5M8767_REG_INT1, 269 254 }; 270 255 256 + static int s2mpg1x_add_chained_irq_chip(struct device *dev, struct regmap *regmap, int pirq, 257 + struct regmap_irq_chip_data *parent, 258 + const struct regmap_irq_chip *chip, 259 + struct regmap_irq_chip_data **data) 260 + { 261 + int irq, ret; 262 + 263 + irq = regmap_irq_get_virq(parent, pirq); 264 + if (irq < 0) 265 + return dev_err_probe(dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n", pirq, 266 + chip->name); 267 + 268 + ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT | IRQF_SHARED, 0, chip, data); 269 + if (ret) 270 + return dev_err_probe(dev, ret, "Failed to add %s IRQ chip\n", chip->name); 271 + 272 + return 0; 273 + } 274 + 275 + static int sec_irq_init_s2mpg1x(struct sec_pmic_dev *sec_pmic) 276 + { 277 + const struct regmap_irq_chip *irq_chip, *chained_irq_chip; 278 + struct regmap_irq_chip_data *irq_data; 279 + struct regmap *regmap_common; 280 + int chained_pirq; 281 + int ret; 282 + 283 + switch (sec_pmic->device_type) { 284 + case S2MPG10: 285 + irq_chip = &s2mpg10_irq_chip; 286 + chained_irq_chip = &s2mpg10_irq_chip_pmic; 287 + chained_pirq = S2MPG10_COMMON_IRQ_PMIC; 288 + break; 289 + default: 290 + return dev_err_probe(sec_pmic->dev, -EINVAL, "Unsupported device type %d\n", 291 + sec_pmic->device_type); 292 + } 293 + 294 + regmap_common = dev_get_regmap(sec_pmic->dev, "common"); 295 + if (!regmap_common) 296 + return dev_err_probe(sec_pmic->dev, -EINVAL, "No 'common' regmap %d\n", 297 + sec_pmic->device_type); 298 + 299 + ret = devm_regmap_add_irq_chip(sec_pmic->dev, regmap_common, sec_pmic->irq, IRQF_ONESHOT, 0, 300 + irq_chip, &irq_data); 301 + if (ret) 302 + return dev_err_probe(sec_pmic->dev, ret, "Failed to add %s IRQ chip\n", 303 + irq_chip->name); 304 + 305 + return s2mpg1x_add_chained_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, chained_pirq, 306 + irq_data, chained_irq_chip, &sec_pmic->irq_data); 307 + } 308 + 271 309 int sec_irq_init(struct sec_pmic_dev *sec_pmic) 272 310 { 273 311 const struct regmap_irq_chip *sec_irq_chip; ··· 336 268 sec_irq_chip = &s2mps14_irq_chip; 337 269 break; 338 270 case S2MPG10: 339 - sec_irq_chip = &s2mpg10_irq_chip; 340 - break; 271 + return sec_irq_init_s2mpg1x(sec_pmic); 341 272 case S2MPS11X: 342 273 sec_irq_chip = &s2mps11_irq_chip; 343 274 break;
+12 -6
drivers/mfd/simple-mfd-i2c.c
··· 15 15 * will be subsequently registered. 16 16 */ 17 17 18 + #include <linux/array_size.h> 19 + #include <linux/dev_printk.h> 20 + #include <linux/err.h> 18 21 #include <linux/i2c.h> 19 - #include <linux/kernel.h> 20 22 #include <linux/mfd/core.h> 23 + #include <linux/mod_devicetable.h> 21 24 #include <linux/module.h> 22 25 #include <linux/of_platform.h> 26 + #include <linux/platform_device.h> 27 + #include <linux/property.h> 23 28 #include <linux/regmap.h> 29 + #include <linux/stddef.h> 24 30 25 31 #include "simple-mfd-i2c.h" 26 32 ··· 120 114 { .compatible = "fsl,lx2160aqds-fpga" }, 121 115 { .compatible = "fsl,lx2160ardb-fpga" }, 122 116 { .compatible = "kontron,sl28cpld" }, 123 - { .compatible = "maxim,max5970", .data = &maxim_max5970}, 124 - { .compatible = "maxim,max5978", .data = &maxim_max5970}, 125 - { .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705}, 126 - { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a}, 127 - { .compatible = "spacemit,p1", .data = &spacemit_p1, }, 117 + { .compatible = "maxim,max5970", .data = &maxim_max5970 }, 118 + { .compatible = "maxim,max5978", .data = &maxim_max5970 }, 119 + { .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705 }, 120 + { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a }, 121 + { .compatible = "spacemit,p1", .data = &spacemit_p1 }, 128 122 {} 129 123 }; 130 124 MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);
+1 -1
drivers/mfd/syscon.c
··· 183 183 if (create_regmap) 184 184 syscon = of_syscon_register(np, check_res); 185 185 else 186 - syscon = ERR_PTR(-EINVAL); 186 + syscon = ERR_PTR(-EPROBE_DEFER); 187 187 } 188 188 mutex_unlock(&syscon_list_lock); 189 189
+8
drivers/mfd/tqmx86.c
··· 43 43 #define TQMX86_REG_BOARD_ID_E40C2 15 44 44 #define TQMX86_REG_BOARD_ID_130UC 16 45 45 #define TQMX86_REG_BOARD_ID_E41S 19 46 + #define TQMX86_REG_BOARD_ID_CU1_HPCM 24 47 + #define TQMX86_REG_BOARD_ID_CU2_HPCM 25 46 48 #define TQMX86_REG_BOARD_REV 0x01 47 49 #define TQMX86_REG_IO_EXT_INT 0x06 48 50 #define TQMX86_REG_IO_EXT_INT_NONE 0 ··· 167 165 return "TQMx130UC"; 168 166 case TQMX86_REG_BOARD_ID_E41S: 169 167 return "TQMxE41S"; 168 + case TQMX86_REG_BOARD_ID_CU1_HPCM: 169 + return "TQMxCU1-HPCM"; 170 + case TQMX86_REG_BOARD_ID_CU2_HPCM: 171 + return "TQMxCU2-HPCM"; 170 172 default: 171 173 return "Unknown"; 172 174 } ··· 191 185 case TQMX86_REG_BOARD_ID_E40C2: 192 186 case TQMX86_REG_BOARD_ID_130UC: 193 187 case TQMX86_REG_BOARD_ID_E41S: 188 + case TQMX86_REG_BOARD_ID_CU1_HPCM: 189 + case TQMX86_REG_BOARD_ID_CU2_HPCM: 194 190 return 24000; 195 191 case TQMX86_REG_BOARD_ID_E39MS: 196 192 case TQMX86_REG_BOARD_ID_E39C1:
-262
drivers/mfd/wl1273-core.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * MFD driver for wl1273 FM radio and audio codec submodules. 4 - * 5 - * Copyright (C) 2011 Nokia Corporation 6 - * Author: Matti Aaltonen <matti.j.aaltonen@nokia.com> 7 - */ 8 - 9 - #include <linux/mfd/wl1273-core.h> 10 - #include <linux/slab.h> 11 - #include <linux/module.h> 12 - 13 - #define DRIVER_DESC "WL1273 FM Radio Core" 14 - 15 - static const struct i2c_device_id wl1273_driver_id_table[] = { 16 - { WL1273_FM_DRIVER_NAME }, 17 - { } 18 - }; 19 - MODULE_DEVICE_TABLE(i2c, wl1273_driver_id_table); 20 - 21 - static int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value) 22 - { 23 - struct i2c_client *client = core->client; 24 - u8 b[2]; 25 - int r; 26 - 27 - r = i2c_smbus_read_i2c_block_data(client, reg, sizeof(b), b); 28 - if (r != 2) { 29 - dev_err(&client->dev, "%s: Read: %d fails.\n", __func__, reg); 30 - return -EREMOTEIO; 31 - } 32 - 33 - *value = (u16)b[0] << 8 | b[1]; 34 - 35 - return 0; 36 - } 37 - 38 - static int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param) 39 - { 40 - struct i2c_client *client = core->client; 41 - u8 buf[] = { (param >> 8) & 0xff, param & 0xff }; 42 - int r; 43 - 44 - r = i2c_smbus_write_i2c_block_data(client, cmd, sizeof(buf), buf); 45 - if (r) { 46 - dev_err(&client->dev, "%s: Cmd: %d fails.\n", __func__, cmd); 47 - return r; 48 - } 49 - 50 - return 0; 51 - } 52 - 53 - static int wl1273_fm_write_data(struct wl1273_core *core, u8 *data, u16 len) 54 - { 55 - struct i2c_client *client = core->client; 56 - struct i2c_msg msg; 57 - int r; 58 - 59 - msg.addr = client->addr; 60 - msg.flags = 0; 61 - msg.buf = data; 62 - msg.len = len; 63 - 64 - r = i2c_transfer(client->adapter, &msg, 1); 65 - if (r != 1) { 66 - dev_err(&client->dev, "%s: write error.\n", __func__); 67 - return -EREMOTEIO; 68 - } 69 - 70 - return 0; 71 - } 72 - 73 - /** 74 - * wl1273_fm_set_audio() - Set audio mode. 75 - * @core: A pointer to the device struct. 76 - * @new_mode: The new audio mode. 77 - * 78 - * Audio modes are WL1273_AUDIO_DIGITAL and WL1273_AUDIO_ANALOG. 79 - */ 80 - static int wl1273_fm_set_audio(struct wl1273_core *core, unsigned int new_mode) 81 - { 82 - int r = 0; 83 - 84 - if (core->mode == WL1273_MODE_OFF || 85 - core->mode == WL1273_MODE_SUSPENDED) 86 - return -EPERM; 87 - 88 - if (core->mode == WL1273_MODE_RX && new_mode == WL1273_AUDIO_DIGITAL) { 89 - r = wl1273_fm_write_cmd(core, WL1273_PCM_MODE_SET, 90 - WL1273_PCM_DEF_MODE); 91 - if (r) 92 - goto out; 93 - 94 - r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, 95 - core->i2s_mode); 96 - if (r) 97 - goto out; 98 - 99 - r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE, 100 - WL1273_AUDIO_ENABLE_I2S); 101 - if (r) 102 - goto out; 103 - 104 - } else if (core->mode == WL1273_MODE_RX && 105 - new_mode == WL1273_AUDIO_ANALOG) { 106 - r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE, 107 - WL1273_AUDIO_ENABLE_ANALOG); 108 - if (r) 109 - goto out; 110 - 111 - } else if (core->mode == WL1273_MODE_TX && 112 - new_mode == WL1273_AUDIO_DIGITAL) { 113 - r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, 114 - core->i2s_mode); 115 - if (r) 116 - goto out; 117 - 118 - r = wl1273_fm_write_cmd(core, WL1273_AUDIO_IO_SET, 119 - WL1273_AUDIO_IO_SET_I2S); 120 - if (r) 121 - goto out; 122 - 123 - } else if (core->mode == WL1273_MODE_TX && 124 - new_mode == WL1273_AUDIO_ANALOG) { 125 - r = wl1273_fm_write_cmd(core, WL1273_AUDIO_IO_SET, 126 - WL1273_AUDIO_IO_SET_ANALOG); 127 - if (r) 128 - goto out; 129 - } 130 - 131 - core->audio_mode = new_mode; 132 - out: 133 - return r; 134 - } 135 - 136 - /** 137 - * wl1273_fm_set_volume() - Set volume. 138 - * @core: A pointer to the device struct. 139 - * @volume: The new volume value. 140 - */ 141 - static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume) 142 - { 143 - int r; 144 - 145 - if (volume > WL1273_MAX_VOLUME) 146 - return -EINVAL; 147 - 148 - if (core->volume == volume) 149 - return 0; 150 - 151 - r = wl1273_fm_write_cmd(core, WL1273_VOLUME_SET, volume); 152 - if (r) 153 - return r; 154 - 155 - core->volume = volume; 156 - return 0; 157 - } 158 - 159 - static int wl1273_core_probe(struct i2c_client *client) 160 - { 161 - struct wl1273_fm_platform_data *pdata = dev_get_platdata(&client->dev); 162 - struct wl1273_core *core; 163 - struct mfd_cell *cell; 164 - int children = 0; 165 - int r = 0; 166 - 167 - dev_dbg(&client->dev, "%s\n", __func__); 168 - 169 - if (!pdata) { 170 - dev_err(&client->dev, "No platform data.\n"); 171 - return -EINVAL; 172 - } 173 - 174 - if (!(pdata->children & WL1273_RADIO_CHILD)) { 175 - dev_err(&client->dev, "Cannot function without radio child.\n"); 176 - return -EINVAL; 177 - } 178 - 179 - core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL); 180 - if (!core) 181 - return -ENOMEM; 182 - 183 - core->pdata = pdata; 184 - core->client = client; 185 - mutex_init(&core->lock); 186 - 187 - i2c_set_clientdata(client, core); 188 - 189 - dev_dbg(&client->dev, "%s: Have V4L2.\n", __func__); 190 - 191 - cell = &core->cells[children]; 192 - cell->name = "wl1273_fm_radio"; 193 - cell->platform_data = &core; 194 - cell->pdata_size = sizeof(core); 195 - children++; 196 - 197 - core->read = wl1273_fm_read_reg; 198 - core->write = wl1273_fm_write_cmd; 199 - core->write_data = wl1273_fm_write_data; 200 - core->set_audio = wl1273_fm_set_audio; 201 - core->set_volume = wl1273_fm_set_volume; 202 - 203 - if (pdata->children & WL1273_CODEC_CHILD) { 204 - cell = &core->cells[children]; 205 - 206 - dev_dbg(&client->dev, "%s: Have codec.\n", __func__); 207 - cell->name = "wl1273-codec"; 208 - cell->platform_data = &core; 209 - cell->pdata_size = sizeof(core); 210 - children++; 211 - } 212 - 213 - dev_dbg(&client->dev, "%s: number of children: %d.\n", 214 - __func__, children); 215 - 216 - r = devm_mfd_add_devices(&client->dev, -1, core->cells, 217 - children, NULL, 0, NULL); 218 - if (r) 219 - goto err; 220 - 221 - return 0; 222 - 223 - err: 224 - pdata->free_resources(); 225 - 226 - dev_dbg(&client->dev, "%s\n", __func__); 227 - 228 - return r; 229 - } 230 - 231 - static struct i2c_driver wl1273_core_driver = { 232 - .driver = { 233 - .name = WL1273_FM_DRIVER_NAME, 234 - }, 235 - .probe = wl1273_core_probe, 236 - .id_table = wl1273_driver_id_table, 237 - }; 238 - 239 - static int __init wl1273_core_init(void) 240 - { 241 - int r; 242 - 243 - r = i2c_add_driver(&wl1273_core_driver); 244 - if (r) { 245 - pr_err(WL1273_FM_DRIVER_NAME 246 - ": driver registration failed\n"); 247 - return r; 248 - } 249 - 250 - return r; 251 - } 252 - 253 - static void __exit wl1273_core_exit(void) 254 - { 255 - i2c_del_driver(&wl1273_core_driver); 256 - } 257 - late_initcall(wl1273_core_init); 258 - module_exit(wl1273_core_exit); 259 - 260 - MODULE_AUTHOR("Matti Aaltonen <matti.j.aaltonen@nokia.com>"); 261 - MODULE_DESCRIPTION(DRIVER_DESC); 262 - MODULE_LICENSE("GPL");
+3 -3
include/linux/mfd/macsmc.h
··· 150 150 * 151 151 * Return: Zero on success, negative errno on error 152 152 */ 153 - int apple_smc_write(struct apple_smc *smc, smc_key key, void *buf, size_t size); 153 + int apple_smc_write(struct apple_smc *smc, smc_key key, const void *buf, size_t size); 154 154 155 155 /** 156 156 * apple_smc_enter_atomic - Enter atomic mode to be able to use apple_smc_write_atomic ··· 177 177 * 178 178 * Return: Zero on success, negative errno on error 179 179 */ 180 - int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, void *buf, size_t size); 180 + int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf, size_t size); 181 181 182 182 /** 183 183 * apple_smc_rw - Write and then read using the given SMC key ··· 190 190 * 191 191 * Return: Zero on success, negative errno on error 192 192 */ 193 - int apple_smc_rw(struct apple_smc *smc, smc_key key, void *wbuf, size_t wsize, 193 + int apple_smc_rw(struct apple_smc *smc, smc_key key, const void *wbuf, size_t wsize, 194 194 void *rbuf, size_t rsize); 195 195 196 196 /**
+6
include/linux/mfd/samsung/irq.h
··· 57 57 #define S2MPA01_IRQ_B24_TSD_MASK (1 << 4) 58 58 #define S2MPA01_IRQ_B35_TSD_MASK (1 << 5) 59 59 60 + enum s2mpg10_common_irq { 61 + /* Top-level (common) block */ 62 + S2MPG10_COMMON_IRQ_PMIC, 63 + S2MPG10_COMMON_IRQ_UNUSED, 64 + }; 65 + 60 66 enum s2mpg10_irq { 61 67 /* PMIC */ 62 68 S2MPG10_IRQ_PWRONF,
-277
include/linux/mfd/wl1273-core.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * include/linux/mfd/wl1273-core.h 4 - * 5 - * Some definitions for the wl1273 radio receiver/transmitter chip. 6 - * 7 - * Copyright (C) 2010 Nokia Corporation 8 - * Author: Matti J. Aaltonen <matti.j.aaltonen@nokia.com> 9 - */ 10 - 11 - #ifndef WL1273_CORE_H 12 - #define WL1273_CORE_H 13 - 14 - #include <linux/i2c.h> 15 - #include <linux/mfd/core.h> 16 - 17 - #define WL1273_FM_DRIVER_NAME "wl1273-fm" 18 - #define RX71_FM_I2C_ADDR 0x22 19 - 20 - #define WL1273_STEREO_GET 0 21 - #define WL1273_RSSI_LVL_GET 1 22 - #define WL1273_IF_COUNT_GET 2 23 - #define WL1273_FLAG_GET 3 24 - #define WL1273_RDS_SYNC_GET 4 25 - #define WL1273_RDS_DATA_GET 5 26 - #define WL1273_FREQ_SET 10 27 - #define WL1273_AF_FREQ_SET 11 28 - #define WL1273_MOST_MODE_SET 12 29 - #define WL1273_MOST_BLEND_SET 13 30 - #define WL1273_DEMPH_MODE_SET 14 31 - #define WL1273_SEARCH_LVL_SET 15 32 - #define WL1273_BAND_SET 16 33 - #define WL1273_MUTE_STATUS_SET 17 34 - #define WL1273_RDS_PAUSE_LVL_SET 18 35 - #define WL1273_RDS_PAUSE_DUR_SET 19 36 - #define WL1273_RDS_MEM_SET 20 37 - #define WL1273_RDS_BLK_B_SET 21 38 - #define WL1273_RDS_MSK_B_SET 22 39 - #define WL1273_RDS_PI_MASK_SET 23 40 - #define WL1273_RDS_PI_SET 24 41 - #define WL1273_RDS_SYSTEM_SET 25 42 - #define WL1273_INT_MASK_SET 26 43 - #define WL1273_SEARCH_DIR_SET 27 44 - #define WL1273_VOLUME_SET 28 45 - #define WL1273_AUDIO_ENABLE 29 46 - #define WL1273_PCM_MODE_SET 30 47 - #define WL1273_I2S_MODE_CONFIG_SET 31 48 - #define WL1273_POWER_SET 32 49 - #define WL1273_INTX_CONFIG_SET 33 50 - #define WL1273_PULL_EN_SET 34 51 - #define WL1273_HILO_SET 35 52 - #define WL1273_SWITCH2FREF 36 53 - #define WL1273_FREQ_DRIFT_REPORT 37 54 - 55 - #define WL1273_PCE_GET 40 56 - #define WL1273_FIRM_VER_GET 41 57 - #define WL1273_ASIC_VER_GET 42 58 - #define WL1273_ASIC_ID_GET 43 59 - #define WL1273_MAN_ID_GET 44 60 - #define WL1273_TUNER_MODE_SET 45 61 - #define WL1273_STOP_SEARCH 46 62 - #define WL1273_RDS_CNTRL_SET 47 63 - 64 - #define WL1273_WRITE_HARDWARE_REG 100 65 - #define WL1273_CODE_DOWNLOAD 101 66 - #define WL1273_RESET 102 67 - 68 - #define WL1273_FM_POWER_MODE 254 69 - #define WL1273_FM_INTERRUPT 255 70 - 71 - /* Transmitter API */ 72 - 73 - #define WL1273_CHANL_SET 55 74 - #define WL1273_SCAN_SPACING_SET 56 75 - #define WL1273_REF_SET 57 76 - #define WL1273_POWER_ENB_SET 90 77 - #define WL1273_POWER_ATT_SET 58 78 - #define WL1273_POWER_LEV_SET 59 79 - #define WL1273_AUDIO_DEV_SET 60 80 - #define WL1273_PILOT_DEV_SET 61 81 - #define WL1273_RDS_DEV_SET 62 82 - #define WL1273_PUPD_SET 91 83 - #define WL1273_AUDIO_IO_SET 63 84 - #define WL1273_PREMPH_SET 64 85 - #define WL1273_MONO_SET 66 86 - #define WL1273_MUTE 92 87 - #define WL1273_MPX_LMT_ENABLE 67 88 - #define WL1273_PI_SET 93 89 - #define WL1273_ECC_SET 69 90 - #define WL1273_PTY 70 91 - #define WL1273_AF 71 92 - #define WL1273_DISPLAY_MODE 74 93 - #define WL1273_RDS_REP_SET 77 94 - #define WL1273_RDS_CONFIG_DATA_SET 98 95 - #define WL1273_RDS_DATA_SET 99 96 - #define WL1273_RDS_DATA_ENB 94 97 - #define WL1273_TA_SET 78 98 - #define WL1273_TP_SET 79 99 - #define WL1273_DI_SET 80 100 - #define WL1273_MS_SET 81 101 - #define WL1273_PS_SCROLL_SPEED 82 102 - #define WL1273_TX_AUDIO_LEVEL_TEST 96 103 - #define WL1273_TX_AUDIO_LEVEL_TEST_THRESHOLD 73 104 - #define WL1273_TX_AUDIO_INPUT_LEVEL_RANGE_SET 54 105 - #define WL1273_RX_ANTENNA_SELECT 87 106 - #define WL1273_I2C_DEV_ADDR_SET 86 107 - #define WL1273_REF_ERR_CALIB_PARAM_SET 88 108 - #define WL1273_REF_ERR_CALIB_PERIODICITY_SET 89 109 - #define WL1273_SOC_INT_TRIGGER 52 110 - #define WL1273_SOC_AUDIO_PATH_SET 83 111 - #define WL1273_SOC_PCMI_OVERRIDE 84 112 - #define WL1273_SOC_I2S_OVERRIDE 85 113 - #define WL1273_RSSI_BLOCK_SCAN_FREQ_SET 95 114 - #define WL1273_RSSI_BLOCK_SCAN_START 97 115 - #define WL1273_RSSI_BLOCK_SCAN_DATA_GET 5 116 - #define WL1273_READ_FMANT_TUNE_VALUE 104 117 - 118 - #define WL1273_RDS_OFF 0 119 - #define WL1273_RDS_ON 1 120 - #define WL1273_RDS_RESET 2 121 - 122 - #define WL1273_AUDIO_DIGITAL 0 123 - #define WL1273_AUDIO_ANALOG 1 124 - 125 - #define WL1273_MODE_RX BIT(0) 126 - #define WL1273_MODE_TX BIT(1) 127 - #define WL1273_MODE_OFF BIT(2) 128 - #define WL1273_MODE_SUSPENDED BIT(3) 129 - 130 - #define WL1273_RADIO_CHILD BIT(0) 131 - #define WL1273_CODEC_CHILD BIT(1) 132 - 133 - #define WL1273_RX_MONO 1 134 - #define WL1273_RX_STEREO 0 135 - #define WL1273_TX_MONO 0 136 - #define WL1273_TX_STEREO 1 137 - 138 - #define WL1273_MAX_VOLUME 0xffff 139 - #define WL1273_DEFAULT_VOLUME 0x78b8 140 - 141 - /* I2S protocol, left channel first, data width 16 bits */ 142 - #define WL1273_PCM_DEF_MODE 0x00 143 - 144 - /* Rx */ 145 - #define WL1273_AUDIO_ENABLE_I2S BIT(0) 146 - #define WL1273_AUDIO_ENABLE_ANALOG BIT(1) 147 - 148 - /* Tx */ 149 - #define WL1273_AUDIO_IO_SET_ANALOG 0 150 - #define WL1273_AUDIO_IO_SET_I2S 1 151 - 152 - #define WL1273_PUPD_SET_OFF 0x00 153 - #define WL1273_PUPD_SET_ON 0x01 154 - #define WL1273_PUPD_SET_RETENTION 0x10 155 - 156 - /* I2S mode */ 157 - #define WL1273_IS2_WIDTH_32 0x0 158 - #define WL1273_IS2_WIDTH_40 0x1 159 - #define WL1273_IS2_WIDTH_22_23 0x2 160 - #define WL1273_IS2_WIDTH_23_22 0x3 161 - #define WL1273_IS2_WIDTH_48 0x4 162 - #define WL1273_IS2_WIDTH_50 0x5 163 - #define WL1273_IS2_WIDTH_60 0x6 164 - #define WL1273_IS2_WIDTH_64 0x7 165 - #define WL1273_IS2_WIDTH_80 0x8 166 - #define WL1273_IS2_WIDTH_96 0x9 167 - #define WL1273_IS2_WIDTH_128 0xa 168 - #define WL1273_IS2_WIDTH 0xf 169 - 170 - #define WL1273_IS2_FORMAT_STD (0x0 << 4) 171 - #define WL1273_IS2_FORMAT_LEFT (0x1 << 4) 172 - #define WL1273_IS2_FORMAT_RIGHT (0x2 << 4) 173 - #define WL1273_IS2_FORMAT_USER (0x3 << 4) 174 - 175 - #define WL1273_IS2_MASTER (0x0 << 6) 176 - #define WL1273_IS2_SLAVEW (0x1 << 6) 177 - 178 - #define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7) 179 - #define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7) 180 - 181 - #define WL1273_IS2_SDOWS_RR (0x0 << 8) 182 - #define WL1273_IS2_SDOWS_RF (0x1 << 8) 183 - #define WL1273_IS2_SDOWS_FR (0x2 << 8) 184 - #define WL1273_IS2_SDOWS_FF (0x3 << 8) 185 - 186 - #define WL1273_IS2_TRI_OPT (0x0 << 10) 187 - #define WL1273_IS2_TRI_ALWAYS (0x1 << 10) 188 - 189 - #define WL1273_IS2_RATE_48K (0x0 << 12) 190 - #define WL1273_IS2_RATE_44_1K (0x1 << 12) 191 - #define WL1273_IS2_RATE_32K (0x2 << 12) 192 - #define WL1273_IS2_RATE_22_05K (0x4 << 12) 193 - #define WL1273_IS2_RATE_16K (0x5 << 12) 194 - #define WL1273_IS2_RATE_12K (0x8 << 12) 195 - #define WL1273_IS2_RATE_11_025 (0x9 << 12) 196 - #define WL1273_IS2_RATE_8K (0xa << 12) 197 - #define WL1273_IS2_RATE (0xf << 12) 198 - 199 - #define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \ 200 - WL1273_IS2_FORMAT_STD | \ 201 - WL1273_IS2_MASTER | \ 202 - WL1273_IS2_TRI_AFTER_SENDING | \ 203 - WL1273_IS2_SDOWS_RR | \ 204 - WL1273_IS2_TRI_OPT | \ 205 - WL1273_IS2_RATE_48K) 206 - 207 - #define SCHAR_MIN (-128) 208 - #define SCHAR_MAX 127 209 - 210 - #define WL1273_FR_EVENT BIT(0) 211 - #define WL1273_BL_EVENT BIT(1) 212 - #define WL1273_RDS_EVENT BIT(2) 213 - #define WL1273_BBLK_EVENT BIT(3) 214 - #define WL1273_LSYNC_EVENT BIT(4) 215 - #define WL1273_LEV_EVENT BIT(5) 216 - #define WL1273_IFFR_EVENT BIT(6) 217 - #define WL1273_PI_EVENT BIT(7) 218 - #define WL1273_PD_EVENT BIT(8) 219 - #define WL1273_STIC_EVENT BIT(9) 220 - #define WL1273_MAL_EVENT BIT(10) 221 - #define WL1273_POW_ENB_EVENT BIT(11) 222 - #define WL1273_SCAN_OVER_EVENT BIT(12) 223 - #define WL1273_ERROR_EVENT BIT(13) 224 - 225 - #define TUNER_MODE_STOP_SEARCH 0 226 - #define TUNER_MODE_PRESET 1 227 - #define TUNER_MODE_AUTO_SEEK 2 228 - #define TUNER_MODE_AF 3 229 - #define TUNER_MODE_AUTO_SEEK_PI 4 230 - #define TUNER_MODE_AUTO_SEEK_BULK 5 231 - 232 - #define RDS_BLOCK_SIZE 3 233 - 234 - struct wl1273_fm_platform_data { 235 - int (*request_resources) (struct i2c_client *client); 236 - void (*free_resources) (void); 237 - void (*enable) (void); 238 - void (*disable) (void); 239 - 240 - u8 forbidden_modes; 241 - unsigned int children; 242 - }; 243 - 244 - #define WL1273_FM_CORE_CELLS 2 245 - 246 - #define WL1273_BAND_OTHER 0 247 - #define WL1273_BAND_JAPAN 1 248 - 249 - #define WL1273_BAND_JAPAN_LOW 76000 250 - #define WL1273_BAND_JAPAN_HIGH 90000 251 - #define WL1273_BAND_OTHER_LOW 87500 252 - #define WL1273_BAND_OTHER_HIGH 108000 253 - 254 - #define WL1273_BAND_TX_LOW 76000 255 - #define WL1273_BAND_TX_HIGH 108000 256 - 257 - struct wl1273_core { 258 - struct mfd_cell cells[WL1273_FM_CORE_CELLS]; 259 - struct wl1273_fm_platform_data *pdata; 260 - 261 - unsigned int mode; 262 - unsigned int i2s_mode; 263 - unsigned int volume; 264 - unsigned int audio_mode; 265 - unsigned int channel_number; 266 - struct mutex lock; /* for serializing fm radio operations */ 267 - 268 - struct i2c_client *client; 269 - 270 - int (*read)(struct wl1273_core *core, u8, u16 *); 271 - int (*write)(struct wl1273_core *core, u8, u16); 272 - int (*write_data)(struct wl1273_core *core, u8 *, u16); 273 - int (*set_audio)(struct wl1273_core *core, unsigned int); 274 - int (*set_volume)(struct wl1273_core *core, unsigned int); 275 - }; 276 - 277 - #endif /* ifndef WL1273_CORE_H */