···11+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/extcon/maxim,max77843.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Maxim MAX77843 MicroUSB and Companion Power Management IC Extcon88+99+maintainers:1010+ - Chanwoo Choi <cw00.choi@samsung.com>1111+ - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>1212+1313+description: |1414+ This is a part of device tree bindings for Maxim MAX77843 MicroUSB1515+ Integrated Circuit (MUIC).1616+1717+ See also Documentation/devicetree/bindings/mfd/maxim,max77843.yaml for1818+ additional information and example.1919+2020+properties:2121+ compatible:2222+ const: maxim,max77843-muic2323+2424+ connector:2525+ $ref: /schemas/connector/usb-connector.yaml#2626+2727+ ports:2828+ $ref: /schemas/graph.yaml#/properties/port2929+ description:3030+ Any connector to the data bus of this controller should be modelled using3131+ the OF graph bindings specified3232+ properties:3333+ port:3434+ $ref: /schemas/graph.yaml#/properties/port3535+3636+required:3737+ - compatible3838+ - connector3939+4040+additionalProperties: false
···11+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/leds/maxim,max77693.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Maxim MAX77693 MicroUSB and Companion Power Management IC LEDs88+99+maintainers:1010+ - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>1111+1212+description: |1313+ This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated1414+ Circuit (MUIC).1515+1616+ There are two LED outputs available - FLED1 and FLED2. Each of them can1717+ control a separate LED or they can be connected together to double the1818+ maximum current for a single connected LED. One LED is represented by one1919+ child node.2020+2121+ See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for2222+ additional information and example.2323+2424+properties:2525+ compatible:2626+ const: maxim,max77693-led2727+2828+ maxim,boost-mode:2929+ description:3030+ In boost mode the device can produce up to 1.2A of total current on both3131+ outputs. The maximum current on each output is reduced to 625mA then. If3232+ not enabled explicitly, boost setting defaults to LEDS_BOOST_FIXED in3333+ case both current sources are used.3434+ See LEDS_BOOST_* in include/dt-bindings/leds/common.h.3535+ $ref: /schemas/types.yaml#/definitions/uint323636+ enum: [0, 1, 2]3737+3838+ maxim,boost-mvout:3939+ description: |4040+ Output voltage of the boost module in millivolts.4141+ Valid values: 3300 - 5500, step by 25 (rounded down)4242+ $ref: /schemas/types.yaml#/definitions/uint324343+ minimum: 33004444+ maximum: 55004545+ default: 33004646+4747+ maxim,mvsys-min:4848+ description: |4949+ Low input voltage level in millivolts. Flash is not fired if chip5050+ estimates that system voltage could drop below this level due to flash5151+ power consumption.5252+ Valid values: 2400 - 3400, step by 33 (rounded down)5353+ $ref: /schemas/types.yaml#/definitions/uint325454+ minimum: 24005555+ maximum: 34005656+ default: 24005757+5858+patternProperties:5959+ "^([a-z]+-)?led[01]?$":6060+ type: object6161+ $ref: common.yaml#6262+ unevaluatedProperties: false6363+6464+ properties:6565+ led-sources:6666+ allOf:6767+ - minItems: 16868+ maxItems: 26969+ items:7070+ minimum: 07171+ maximum: 17272+7373+ led-max-microamp:7474+ description: |7575+ Valid values for a LED connected to one FLED output:7676+ 15625 - 250000, step by 15625 (rounded down)7777+ Valid values for a LED connected to both FLED outputs:7878+ 15625 - 500000, step by 15625 (rounded down)7979+8080+ flash-max-microamp:8181+ description: |8282+ Valid values for a single LED connected to one FLED output8383+ (boost mode must be turned off):8484+ 15625 - 1000000, step by 15625 (rounded down)8585+ Valid values for a single LED connected to both FLED outputs:8686+ 15625 - 1250000, step by 15625 (rounded down)8787+ Valid values for two LEDs case:8888+ 15625 - 625000, step by 15625 (rounded down)8989+9090+ flash-max-timeout-us:9191+ description: |9292+ Valid values: 62500 - 1000000, step by 62500 (rounded down)9393+ minimum: 625009494+ maximum: 10000009595+9696+ required:9797+ - flash-max-microamp9898+ - flash-max-timeout-us9999+ - led-max-microamp100100+ - led-sources101101+102102+required:103103+ - compatible104104+105105+additionalProperties: false
···11-Maxim MAX77693 multi-function device22-33-MAX77693 is a Multifunction device with the following submodules:44-- PMIC,55-- CHARGER,66-- LED,77-- MUIC,88-- HAPTIC99-1010-It is interfaced to host controller using i2c.1111-This document describes the bindings for the mfd device.1212-1313-Required properties:1414-- compatible : Must be "maxim,max77693".1515-- reg : Specifies the i2c slave address of PMIC block.1616-- interrupts : This i2c device has an IRQ line connected to the main SoC.1717-1818-Optional properties:1919-- regulators : The regulators of max77693 have to be instantiated under subnode2020- named "regulators" using the following format.2121-2222- regulators {2323- regulator-compatible = ESAFEOUT1/ESAFEOUT2/CHARGER2424- standard regulator constraints[*].2525- };2626-2727- [*] refer Documentation/devicetree/bindings/regulator/regulator.txt2828-2929-- haptic : The MAX77693 haptic device utilises a PWM controlled motor to provide3030- users with tactile feedback. PWM period and duty-cycle are varied in3131- order to provide the appropriate level of feedback.3232-3333- Required properties:3434- - compatible : Must be "maxim,max77693-haptic"3535- - haptic-supply : power supply for the haptic motor3636- [*] refer Documentation/devicetree/bindings/regulator/regulator.txt3737- - pwms : phandle to the physical PWM(Pulse Width Modulation) device.3838- PWM properties should be named "pwms". And number of cell is different3939- for each pwm device.4040- To get more information, please refer to documentation.4141- [*] refer Documentation/devicetree/bindings/pwm/pwm.txt4242-4343-- charger : Node configuring the charger driver.4444- If present, required properties:4545- - compatible : Must be "maxim,max77693-charger".4646-4747- Optional properties (if not set, defaults will be used):4848- - maxim,constant-microvolt : Battery constant voltage in uV. The charger4949- will operate in fast charge constant current mode till battery voltage5050- reaches this level. Then the charger will switch to fast charge constant5151- voltage mode. Also vsys (system voltage) will be set to this value when5252- DC power is supplied but charger is not enabled.5353- Valid values: 3650000 - 4400000, step by 25000 (rounded down)5454- Default: 42000005555-5656- - maxim,min-system-microvolt : Minimal system voltage in uV.5757- Valid values: 3000000 - 3700000, step by 100000 (rounded down)5858- Default: 36000005959-6060- - maxim,thermal-regulation-celsius : Temperature in Celsius for entering6161- high temperature charging mode. If die temperature exceeds this value6262- the charging current will be reduced by 105 mA/Celsius.6363- Valid values: 70, 85, 100, 1156464- Default: 1006565-6666- - maxim,battery-overcurrent-microamp : Overcurrent protection threshold6767- in uA (current from battery to system).6868- Valid values: 2000000 - 3500000, step by 250000 (rounded down)6969- Default: 35000007070-7171- - maxim,charge-input-threshold-microvolt : Threshold voltage in uV for7272- triggering input voltage regulation loop. If input voltage decreases7373- below this value, the input current will be reduced to reach the7474- threshold voltage.7575- Valid values: 4300000, 4700000, 4800000, 49000007676- Default: 43000007777-7878-- led : the LED submodule device node7979-8080-There are two LED outputs available - FLED1 and FLED2. Each of them can8181-control a separate LED or they can be connected together to double8282-the maximum current for a single connected LED. One LED is represented8383-by one child node.8484-8585-Required properties:8686-- compatible : Must be "maxim,max77693-led".8787-8888-Optional properties:8989-- maxim,boost-mode :9090- In boost mode the device can produce up to 1.2A of total current9191- on both outputs. The maximum current on each output is reduced9292- to 625mA then. If not enabled explicitly, boost setting defaults to9393- LEDS_BOOST_FIXED in case both current sources are used.9494- Possible values:9595- LEDS_BOOST_OFF (0) - no boost,9696- LEDS_BOOST_ADAPTIVE (1) - adaptive mode,9797- LEDS_BOOST_FIXED (2) - fixed mode.9898-- maxim,boost-mvout : Output voltage of the boost module in millivolts.9999- Valid values: 3300 - 5500, step by 25 (rounded down)100100- Default: 3300101101-- maxim,mvsys-min : Low input voltage level in millivolts. Flash is not fired102102- if chip estimates that system voltage could drop below this level due103103- to flash power consumption.104104- Valid values: 2400 - 3400, step by 33 (rounded down)105105- Default: 2400106106-107107-Required properties for the LED child node:108108-- led-sources : see Documentation/devicetree/bindings/leds/common.txt;109109- device current output identifiers: 0 - FLED1, 1 - FLED2110110-- led-max-microamp : see Documentation/devicetree/bindings/leds/common.txt111111- Valid values for a LED connected to one FLED output:112112- 15625 - 250000, step by 15625 (rounded down)113113- Valid values for a LED connected to both FLED outputs:114114- 15625 - 500000, step by 15625 (rounded down)115115-- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt116116- Valid values for a single LED connected to one FLED output117117- (boost mode must be turned off):118118- 15625 - 1000000, step by 15625 (rounded down)119119- Valid values for a single LED connected to both FLED outputs:120120- 15625 - 1250000, step by 15625 (rounded down)121121- Valid values for two LEDs case:122122- 15625 - 625000, step by 15625 (rounded down)123123-- flash-max-timeout-us : see Documentation/devicetree/bindings/leds/common.txt124124- Valid values: 62500 - 1000000, step by 62500 (rounded down)125125-126126-Optional properties for the LED child node:127127-- label : see Documentation/devicetree/bindings/leds/common.txt128128-129129-Optional nodes:130130-- max77693-muic :131131- Node used only by extcon consumers.132132- Required properties:133133- - compatible : "maxim,max77693-muic"134134-135135-Example:136136-#include <dt-bindings/leds/common.h>137137-138138- max77693@66 {139139- compatible = "maxim,max77693";140140- reg = <0x66>;141141- interrupt-parent = <&gpx1>;142142- interrupts = <5 IRQ_TYPE_LEVEL_LOW>;143143-144144- regulators {145145- esafeout@1 {146146- regulator-compatible = "ESAFEOUT1";147147- regulator-name = "ESAFEOUT1";148148- regulator-boot-on;149149- };150150- esafeout@2 {151151- regulator-compatible = "ESAFEOUT2";152152- regulator-name = "ESAFEOUT2";153153- };154154- charger@0 {155155- regulator-compatible = "CHARGER";156156- regulator-name = "CHARGER";157157- regulator-min-microamp = <60000>;158158- regulator-max-microamp = <2580000>;159159- regulator-boot-on;160160- };161161- };162162-163163- haptic {164164- compatible = "maxim,max77693-haptic";165165- haptic-supply = <&haptic_supply>;166166- pwms = <&pwm 0 40000 0>;167167- pwm-names = "haptic";168168- };169169-170170- charger {171171- compatible = "maxim,max77693-charger";172172-173173- maxim,constant-microvolt = <4200000>;174174- maxim,min-system-microvolt = <3600000>;175175- maxim,thermal-regulation-celsius = <75>;176176- maxim,battery-overcurrent-microamp = <3000000>;177177- maxim,charge-input-threshold-microvolt = <4300000>;178178- };179179-180180- led {181181- compatible = "maxim,max77693-led";182182- maxim,boost-mode = <LEDS_BOOST_FIXED>;183183- maxim,boost-mvout = <5000>;184184- maxim,mvsys-min = <2400>;185185-186186- camera_flash: flash-led {187187- label = "max77693-flash";188188- led-sources = <0>, <1>;189189- led-max-microamp = <500000>;190190- flash-max-microamp = <1250000>;191191- flash-max-timeout-us = <1000000>;192192- };193193- };194194- };
···11-Maxim MAX77802 multi-function device22-33-The Maxim MAX77802 is a Power Management IC (PMIC) that contains 10 high44-efficiency Buck regulators, 32 Low-DropOut (LDO) regulators used to power55-up application processors and peripherals, a 2-channel 32kHz clock outputs,66-a Real-Time-Clock (RTC) and a I2C interface to program the individual77-regulators, clocks outputs and the RTC.88-99-Bindings for the built-in 32k clock generator block and1010-regulators are defined in ../clk/maxim,max77802.txt and1111-../regulator/max77802.txt respectively.1212-1313-Required properties:1414-- compatible : Must be "maxim,max77802"1515-- reg : Specifies the I2C slave address of PMIC block.1616-- interrupts : I2C device IRQ line connected to the main SoC.1717-1818-Example:1919-2020- max77802: pmic@9 {2121- compatible = "maxim,max77802";2222- interrupt-parent = <&intc>;2323- interrupts = <26 IRQ_TYPE_NONE>;2424- reg = <0x09>;2525- };
···11+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/power/supply/maxim,max77693.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Maxim MAX77693 MicroUSB and Companion Power Management IC Charger88+99+maintainers:1010+ - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>1111+1212+description: |1313+ This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated1414+ Circuit (MUIC).1515+1616+ See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for1717+ additional information and example.1818+1919+properties:2020+ compatible:2121+ const: maxim,max77693-charger2222+2323+ maxim,constant-microvolt:2424+ description: |2525+ Battery constant voltage in uV. The charger will operate in fast2626+ charge constant current mode till battery voltage reaches this level.2727+ Then the charger will switch to fast charge constant voltage mode.2828+ Also vsys (system voltage) will be set to this value when DC power is2929+ supplied but charger is not enabled.3030+ Valid values: 3650000 - 4400000, step by 25000 (rounded down)3131+ minimum: 36500003232+ maximum: 44000003333+ default: 42000003434+3535+ maxim,min-system-microvolt:3636+ description: |3737+ Minimal system voltage in uV.3838+ enum: [3000000, 3100000, 3200000, 3300000, 3400000, 3500000,3939+ 3600000, 3700000]4040+ default: 36000004141+4242+ maxim,thermal-regulation-celsius:4343+ description: |4444+ Temperature in Celsius for entering high temperature charging mode.4545+ If die temperature exceeds this value the charging current will be4646+ reduced by 105 mA/Celsius.4747+ enum: [70, 85, 100, 115]4848+ default: 1004949+5050+ maxim,battery-overcurrent-microamp:5151+ description: |5252+ Overcurrent protection threshold in uA (current from battery to5353+ system).5454+ Valid values: 2000000 - 3500000, step by 250000 (rounded down)5555+ minimum: 20000005656+ maximum: 35000005757+ default: 35000005858+5959+ maxim,charge-input-threshold-microvolt:6060+ description: |6161+ Threshold voltage in uV for triggering input voltage regulation loop.6262+ If input voltage decreases below this value, the input current will6363+ be reduced to reach the threshold voltage.6464+ enum: [4300000, 4700000, 4800000, 4900000]6565+ default: 43000006666+6767+required:6868+ - compatible6969+7070+additionalProperties: false
···11-Binding for Maxim MAX77802 regulators22-33-This is a part of device tree bindings of MAX77802 multi-function device.44-More information can be found in bindings/mfd/max77802.txt file.55-66-The MAX77802 PMIC has 10 high-efficiency Buck and 32 Low-dropout (LDO)77-regulators that can be controlled over I2C.88-99-Following properties should be present in main device node of the MFD chip.1010-1111-Optional properties:1212-- inb1-supply: The input supply for BUCK11313-- inb2-supply: The input supply for BUCK21414-- inb3-supply: The input supply for BUCK31515-- inb4-supply: The input supply for BUCK41616-- inb5-supply: The input supply for BUCK51717-- inb6-supply: The input supply for BUCK61818-- inb7-supply: The input supply for BUCK71919-- inb8-supply: The input supply for BUCK82020-- inb9-supply: The input supply for BUCK92121-- inb10-supply: The input supply for BUCK102222-- inl1-supply: The input supply for LDO8 and LDO152323-- inl2-supply: The input supply for LDO17, LDO27, LDO30 and LDO352424-- inl3-supply: The input supply for LDO3, LDO5, LDO6 and LDO72525-- inl4-supply: The input supply for LDO10, LDO11, LDO13 and LDO142626-- inl5-supply: The input supply for LDO9 and LDO192727-- inl6-supply: The input supply for LDO4, LDO21, LDO24 and LDO332828-- inl7-supply: The input supply for LDO18, LDO20, LDO28 and LDO292929-- inl9-supply: The input supply for LDO12, LDO23, LDO25, LDO26, LDO32 and LDO343030-- inl10-supply: The input supply for LDO1 and LDO23131-3232-Optional nodes:3333-- regulators : The regulators of max77802 have to be instantiated3434- under subnode named "regulators" using the following format.3535-3636- regulator-name {3737- standard regulator constraints....3838- };3939- refer Documentation/devicetree/bindings/regulator/regulator.txt4040-4141-The regulator node name should be initialized with a string to get matched4242-with their hardware counterparts as follow. The valid names are:4343-4444- -LDOn : for LDOs, where n can lie in ranges 1-15, 17-21, 23-304545- and 32-35.4646- example: LDO1, LDO2, LDO35.4747- -BUCKn : for BUCKs, where n can lie in range 1 to 10.4848- example: BUCK1, BUCK5, BUCK10.4949-5050-The max77802 regulator supports two different operating modes: Normal and Low5151-Power Mode. Some regulators support the modes to be changed at startup or by5252-the consumers during normal operation while others only support to change the5353-mode during system suspend. The standard regulator suspend states binding can5454-be used to configure the regulator operating mode.5555-5656-The regulators that support the standard "regulator-initial-mode" property,5757-changing their mode during normal operation are: LDOs 1, 3, 20 and 21.5858-5959-The possible values for "regulator-initial-mode" and "regulator-mode" are:6060- 1: Normal regulator voltage output mode.6161- 3: Low Power which reduces the quiescent current down to only 1uA6262-6363-The valid modes list is defined in the dt-bindings/regulator/maxim,max77802.h6464-header and can be included by device tree source files.6565-6666-The standard "regulator-mode" property can only be used for regulators that6767-support changing their mode to Low Power Mode during suspend. These regulators6868-are: BUCKs 2-4 and LDOs 1-35. Also, it only takes effect if the regulator has6969-been enabled for the given suspend state using "regulator-on-in-suspend" and7070-has not been disabled for that state using "regulator-off-in-suspend".7171-7272-Example:7373-7474- max77802@9 {7575- compatible = "maxim,max77802";7676- interrupt-parent = <&wakeup_eint>;7777- interrupts = <26 0>;7878- reg = <0x09>;7979- #address-cells = <1>;8080- #size-cells = <0>;8181-8282- inb1-supply = <&parent_reg>;8383-8484- regulators {8585- ldo1_reg: LDO1 {8686- regulator-name = "vdd_1v0";8787- regulator-min-microvolt = <1000000>;8888- regulator-max-microvolt = <1000000>;8989- regulator-always-on;9090- regulator-initial-mode = <MAX77802_OPMODE_LP>;9191- };9292-9393- ldo11_reg: LDO11 {9494- regulator-name = "vdd_ldo11";9595- regulator-min-microvolt = <1900000>;9696- regulator-max-microvolt = <1900000>;9797- regulator-always-on;9898- regulator-state-mem {9999- regulator-on-in-suspend;100100- regulator-mode = <MAX77802_OPMODE_LP>;101101- };102102- };103103-104104- buck1_reg: BUCK1 {105105- regulator-name = "vdd_mif";106106- regulator-min-microvolt = <950000>;107107- regulator-max-microvolt = <1300000>;108108- regulator-always-on;109109- regulator-boot-on;110110- };111111- };
···11+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/regulator/maxim,max77802.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Maxim MAX77802 Power Management IC regulators88+99+maintainers:1010+ - Javier Martinez Canillas <javier@dowhile0.org>1111+ - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>1212+1313+description: |1414+ This is a part of device tree bindings for Maxim MAX77802 Power Management1515+ Integrated Circuit (PMIC).1616+1717+ The Maxim MAX77686 provides 10 high-efficiency Buck and 32 Low-DropOut (LDO)1818+ regulators.1919+2020+ See also Documentation/devicetree/bindings/mfd/maxim,max77802.yaml for2121+ additional information and example.2222+2323+ Certain regulators support "regulator-initial-mode" and "regulator-mode".2424+ The valid modes list is defined in the dt-bindings/regulator/maxim,max77802.h2525+ and their meaning is::2626+ 1 - Normal regulator voltage output mode.2727+ 3 - Low Power which reduces the quiescent current down to only 1uA2828+2929+ The standard "regulator-mode" property can only be used for regulators that3030+ support changing their mode to Low Power Mode during suspend. These3131+ regulators are:: bucks 2-4 and LDOs 1-35. Also, it only takes effect if the3232+ regulator has been enabled for the given suspend state using3333+ "regulator-on-in-suspend" and has not been disabled for that state using3434+ "regulator-off-in-suspend".3535+3636+patternProperties:3737+ # LDO1, LDO3, LDO20, LDO213838+ "^LDO([13]|2[01])$":3939+ type: object4040+ $ref: regulator.yaml#4141+ unevaluatedProperties: false4242+ description:4343+ LDOs supporting the regulator-initial-mode property and changing their4444+ mode during normal operation.4545+4646+ # LDO2, LDO4-15, LDO17-19, LDO23-30, LDO32-354747+ "^LDO([24-9]|1[0-5789]|2[3-9]|3[02345])$":4848+ type: object4949+ $ref: regulator.yaml#5050+ unevaluatedProperties: false5151+ description:5252+ LDOs supporting the regulator-mode property (changing mode to Low Power5353+ Mode during suspend).5454+5555+ properties:5656+ regulator-initial-mode: false5757+5858+ # buck2-45959+ "^BUCK[2-4]$":6060+ type: object6161+ $ref: regulator.yaml#6262+ unevaluatedProperties: false6363+ description:6464+ bucks supporting the regulator-mode property (changing mode to Low Power6565+ Mode during suspend).6666+6767+ properties:6868+ regulator-initial-mode: false6969+7070+ # buck1, buck5-107171+ "^BUCK([15-9]|10)$":7272+ type: object7373+ $ref: regulator.yaml#7474+ unevaluatedProperties: false7575+7676+ properties:7777+ regulator-initial-mode: false7878+7979+ patternProperties:8080+ regulator-state-(standby|mem|disk):8181+ type: object8282+ properties:8383+ regulator-mode: false8484+8585+additionalProperties: false
···8585# The controller specific properties go here.8686allOf:8787 - $ref: cdns,qspi-nor-peripheral-props.yaml#8888+ - $ref: samsung,spi-peripheral-props.yaml#88898990additionalProperties: true
···11-* Samsung SPI Controller22-33-The Samsung SPI controller is used to interface with various devices such as flash44-and display controllers using the SPI communication interface.55-66-Required SoC Specific Properties:77-88-- compatible: should be one of the following.99- - samsung,s3c2443-spi: for s3c2443, s3c2416 and s3c2450 platforms1010- - samsung,s3c6410-spi: for s3c6410 platforms1111- - samsung,s5pv210-spi: for s5pv210 and s5pc110 platforms1212- - samsung,exynos5433-spi: for exynos5433 compatible controllers1313- - samsung,exynos7-spi: for exynos7 platforms <DEPRECATED>1414-1515-- reg: physical base address of the controller and length of memory mapped1616- region.1717-1818-- interrupts: The interrupt number to the cpu. The interrupt specifier format1919- depends on the interrupt controller.2020-2121-- dmas : Two or more DMA channel specifiers following the convention outlined2222- in bindings/dma/dma.txt2323-2424-- dma-names: Names for the dma channels. There must be at least one channel2525- named "tx" for transmit and named "rx" for receive.2626-2727-- clocks: specifies the clock IDs provided to the SPI controller; they are2828- required for interacting with the controller itself, for synchronizing the bus2929- and as I/O clock (the latter is required by exynos5433 and exynos7).3030-3131-- clock-names: string names of the clocks in the 'clocks' property; for all the3232- the devices the names must be "spi", "spi_busclkN" (where N is determined by3333- "samsung,spi-src-clk"), while Exynos5433 should specify a third clock3434- "spi_ioclk" for the I/O clock.3535-3636-Required Board Specific Properties:3737-3838-- #address-cells: should be 1.3939-- #size-cells: should be 0.4040-4141-Optional Board Specific Properties:4242-4343-- samsung,spi-src-clk: If the spi controller includes a internal clock mux to4444- select the clock source for the spi bus clock, this property can be used to4545- indicate the clock to be used for driving the spi bus clock. If not specified,4646- the clock number 0 is used as default.4747-4848-- num-cs: Specifies the number of chip select lines supported. If4949- not specified, the default number of chip select lines is set to 1.5050-5151-- cs-gpios: should specify GPIOs used for chipselects (see spi-bus.txt)5252-5353-- no-cs-readback: the CS line is disconnected, therefore the device should not5454- operate based on CS signalling.5555-5656-SPI Controller specific data in SPI slave nodes:5757-5858-- The spi slave nodes should provide the following information which is required5959- by the spi controller.6060-6161- - samsung,spi-feedback-delay: The sampling phase shift to be applied on the6262- miso line (to account for any lag in the miso line). The following are the6363- valid values.6464-6565- - 0: No phase shift.6666- - 1: 90 degree phase shift sampling.6767- - 2: 180 degree phase shift sampling.6868- - 3: 270 degree phase shift sampling.6969-7070-Aliases:7171-7272-- All the SPI controller nodes should be represented in the aliases node using7373- the following format 'spi{n}' where n is a unique number for the alias.7474-7575-7676-Example:7777-7878-- SoC Specific Portion:7979-8080- spi_0: spi@12d20000 {8181- compatible = "samsung,exynos4210-spi";8282- reg = <0x12d20000 0x100>;8383- interrupts = <0 66 0>;8484- dmas = <&pdma0 58585- &pdma0 4>;8686- dma-names = "tx", "rx";8787- #address-cells = <1>;8888- #size-cells = <0>;8989- };9090-9191-- Board Specific Portion:9292-9393- spi_0: spi@12d20000 {9494- #address-cells = <1>;9595- #size-cells = <0>;9696- pinctrl-names = "default";9797- pinctrl-0 = <&spi0_bus>;9898- cs-gpios = <&gpa2 5 0>;9999-100100- w25q80bw@0 {101101- #address-cells = <1>;102102- #size-cells = <1>;103103- compatible = "w25x80";104104- reg = <0>;105105- spi-max-frequency = <10000>;106106-107107- controller-data {108108- samsung,spi-feedback-delay = <0>;109109- };110110-111111- partition@0 {112112- label = "U-Boot";113113- reg = <0x0 0x40000>;114114- read-only;115115- };116116-117117- partition@40000 {118118- label = "Kernel";119119- reg = <0x40000 0xc0000>;120120- };121121- };122122- };
···849849 additional drivers must be enabled in order to use the functionality850850 of the device.851851852852+config MFD_MAX77714853853+ tristate "Maxim Semiconductor MAX77714 PMIC Support"854854+ depends on I2C855855+ depends on OF || COMPILE_TEST856856+ select MFD_CORE857857+ select REGMAP_I2C858858+ help859859+ Say yes here to add support for Maxim Semiconductor MAX77714.860860+ This is a Power Management IC with 4 buck regulators, 9861861+ low-dropout regulators, 8 GPIOs, RTC, watchdog etc. This driver862862+ provides common support for accessing the device; additional863863+ drivers must be enabled in order to use each functionality of the864864+ device.865865+852866config MFD_MAX77843853867 bool "Maxim Semiconductor MAX77843 PMIC Support"854868 depends on I2C=y
···375375376376config RTC_DRV_MAX77686377377 tristate "Maxim MAX77686"378378- depends on MFD_MAX77686 || MFD_MAX77620 || COMPILE_TEST378378+ depends on MFD_MAX77686 || MFD_MAX77620 || MFD_MAX77714 || COMPILE_TEST379379 help380380 If you say yes here you will get support for the381381 RTC of Maxim MAX77686/MAX77620/MAX77802 PMIC.
+45-30
drivers/rtc/rtc-max77686.c
···19192020#define MAX77686_I2C_ADDR_RTC (0x0C >> 1)2121#define MAX77620_I2C_ADDR_RTC 0x682222+#define MAX77714_I2C_ADDR_RTC 0x482223#define MAX77686_INVALID_I2C_ADDR (-1)23242425/* Define non existing register */···3534#define RTC_UDR_MASK BIT(RTC_UDR_SHIFT)3635#define RTC_RBUDR_SHIFT 43736#define RTC_RBUDR_MASK BIT(RTC_RBUDR_SHIFT)3838-/* RTC Hour register */3939-#define HOUR_PM_SHIFT 64040-#define HOUR_PM_MASK BIT(HOUR_PM_SHIFT)4137/* RTC Alarm Enable */4238#define ALARM_ENABLE_SHIFT 74339#define ALARM_ENABLE_MASK BIT(ALARM_ENABLE_SHIFT)···5557 RTC_WEEKDAY,5658 RTC_MONTH,5759 RTC_YEAR,5858- RTC_DATE,6060+ RTC_MONTHDAY,5961 RTC_NR_TIME6062};61636464+/**6565+ * struct max77686_rtc_driver_data - model-specific configuration6666+ * @delay: Minimum usecs needed for a RTC update6767+ * @mask: Mask used to read RTC registers value6868+ * @map: Registers offset to I2C addresses map6969+ * @alarm_enable_reg: Has a separate alarm enable register?7070+ * @rtc_i2c_addr: I2C address for RTC block7171+ * @rtc_irq_from_platform: RTC interrupt via platform resource7272+ * @alarm_pending_status_reg: Pending alarm status register7373+ * @rtc_irq_chip: RTC IRQ CHIP for regmap7474+ * @regmap_config: regmap configuration for the chip7575+ */6276struct max77686_rtc_driver_data {6363- /* Minimum usecs needed for a RTC update */6477 unsigned long delay;6565- /* Mask used to read RTC registers value */6678 u8 mask;6767- /* Registers offset to I2C addresses map */6879 const unsigned int *map;6969- /* Has a separate alarm enable register? */7080 bool alarm_enable_reg;7171- /* I2C address for RTC block */7281 int rtc_i2c_addr;7373- /* RTC interrupt via platform resource */7482 bool rtc_irq_from_platform;7575- /* Pending alarm status register */7683 int alarm_pending_status_reg;7777- /* RTC IRQ CHIP for regmap */7884 const struct regmap_irq_chip *rtc_irq_chip;7979- /* regmap configuration for the chip */8085 const struct regmap_config *regmap_config;8186};8287···97969897 int rtc_irq;9998 int virq;100100- int rtc_24hr_mode;10199};102100103101enum MAX77686_RTC_OP {···116116 REG_RTC_WEEKDAY,117117 REG_RTC_MONTH,118118 REG_RTC_YEAR,119119- REG_RTC_DATE,119119+ REG_RTC_MONTHDAY,120120 REG_ALARM1_SEC,121121 REG_ALARM1_MIN,122122 REG_ALARM1_HOUR,···147147 [REG_RTC_WEEKDAY] = MAX77686_RTC_WEEKDAY,148148 [REG_RTC_MONTH] = MAX77686_RTC_MONTH,149149 [REG_RTC_YEAR] = MAX77686_RTC_YEAR,150150- [REG_RTC_DATE] = MAX77686_RTC_DATE,150150+ [REG_RTC_MONTHDAY] = MAX77686_RTC_MONTHDAY,151151 [REG_ALARM1_SEC] = MAX77686_ALARM1_SEC,152152 [REG_ALARM1_MIN] = MAX77686_ALARM1_MIN,153153 [REG_ALARM1_HOUR] = MAX77686_ALARM1_HOUR,···201201 .regmap_config = &max77686_rtc_regmap_config,202202};203203204204+static const struct regmap_irq_chip max77714_rtc_irq_chip = {205205+ .name = "max77714-rtc",206206+ .status_base = MAX77686_RTC_INT,207207+ .mask_base = MAX77686_RTC_INTM,208208+ .num_regs = 1,209209+ .irqs = max77686_rtc_irqs,210210+ .num_irqs = ARRAY_SIZE(max77686_rtc_irqs) - 1, /* no WTSR on 77714 */211211+};212212+213213+static const struct max77686_rtc_driver_data max77714_drv_data = {214214+ .delay = 16000,215215+ .mask = 0x7f,216216+ .map = max77686_map,217217+ .alarm_enable_reg = false,218218+ .rtc_irq_from_platform = false,219219+ /* On MAX77714 RTCA1 is BIT 1 of RTCINT (0x00). Not supported by this driver. */220220+ .alarm_pending_status_reg = MAX77686_INVALID_REG,221221+ .rtc_i2c_addr = MAX77714_I2C_ADDR_RTC,222222+ .rtc_irq_chip = &max77714_rtc_irq_chip,223223+ .regmap_config = &max77686_rtc_regmap_config,224224+};225225+204226static const struct regmap_config max77620_rtc_regmap_config = {205227 .reg_bits = 8,206228 .val_bits = 8,···252230 [REG_RTC_WEEKDAY] = MAX77802_RTC_WEEKDAY,253231 [REG_RTC_MONTH] = MAX77802_RTC_MONTH,254232 [REG_RTC_YEAR] = MAX77802_RTC_YEAR,255255- [REG_RTC_DATE] = MAX77802_RTC_DATE,233233+ [REG_RTC_MONTHDAY] = MAX77802_RTC_MONTHDAY,256234 [REG_ALARM1_SEC] = MAX77802_ALARM1_SEC,257235 [REG_ALARM1_MIN] = MAX77802_ALARM1_MIN,258236 [REG_ALARM1_HOUR] = MAX77802_ALARM1_HOUR,···297275298276 tm->tm_sec = data[RTC_SEC] & mask;299277 tm->tm_min = data[RTC_MIN] & mask;300300- if (info->rtc_24hr_mode) {301301- tm->tm_hour = data[RTC_HOUR] & 0x1f;302302- } else {303303- tm->tm_hour = data[RTC_HOUR] & 0x0f;304304- if (data[RTC_HOUR] & HOUR_PM_MASK)305305- tm->tm_hour += 12;306306- }278278+ tm->tm_hour = data[RTC_HOUR] & 0x1f;307279308280 /* Only a single bit is set in data[], so fls() would be equivalent */309281 tm->tm_wday = ffs(data[RTC_WEEKDAY] & mask) - 1;310310- tm->tm_mday = data[RTC_DATE] & 0x1f;282282+ tm->tm_mday = data[RTC_MONTHDAY] & 0x1f;311283 tm->tm_mon = (data[RTC_MONTH] & 0x0f) - 1;312284 tm->tm_year = data[RTC_YEAR] & mask;313285 tm->tm_yday = 0;···322306 data[RTC_MIN] = tm->tm_min;323307 data[RTC_HOUR] = tm->tm_hour;324308 data[RTC_WEEKDAY] = 1 << tm->tm_wday;325325- data[RTC_DATE] = tm->tm_mday;309309+ data[RTC_MONTHDAY] = tm->tm_mday;326310 data[RTC_MONTH] = tm->tm_mon + 1;327311328312 if (info->drv_data->alarm_enable_reg) {···578562 data[RTC_MONTH] |= (1 << ALARM_ENABLE_SHIFT);579563 if (data[RTC_YEAR] & info->drv_data->mask)580564 data[RTC_YEAR] |= (1 << ALARM_ENABLE_SHIFT);581581- if (data[RTC_DATE] & 0x1f)582582- data[RTC_DATE] |= (1 << ALARM_ENABLE_SHIFT);565565+ if (data[RTC_MONTHDAY] & 0x1f)566566+ data[RTC_MONTHDAY] |= (1 << ALARM_ENABLE_SHIFT);583567584568 ret = regmap_bulk_write(info->rtc_regmap, map[REG_ALARM1_SEC],585569 data, ARRAY_SIZE(data));···674658 /* Set RTC control register : Binary mode, 24hour mdoe */675659 data[0] = (1 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);676660 data[1] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);677677-678678- info->rtc_24hr_mode = 1;679661680662 ret = regmap_bulk_write(info->rtc_regmap,681663 info->drv_data->map[REG_RTC_CONTROLM],···866852 { "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data, },867853 { "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data, },868854 { "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data, },855855+ { "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data, },869856 {},870857};871858MODULE_DEVICE_TABLE(platform, rtc_id);
+6-8
drivers/spi/spi-s3c64xx.c
···796796 return ERR_PTR(-EINVAL);797797 }798798799799+ cs = kzalloc(sizeof(*cs), GFP_KERNEL);800800+ if (!cs)801801+ return ERR_PTR(-ENOMEM);802802+799803 data_np = of_get_child_by_name(slave_np, "controller-data");800804 if (!data_np) {801801- dev_err(&spi->dev, "child node 'controller-data' not found\n");802802- return ERR_PTR(-EINVAL);803803- }804804-805805- cs = kzalloc(sizeof(*cs), GFP_KERNEL);806806- if (!cs) {807807- of_node_put(data_np);808808- return ERR_PTR(-ENOMEM);805805+ dev_info(&spi->dev, "feedback delay set to default (0)\n");806806+ return cs;809807 }810808811809 of_property_read_u32(data_np, "samsung,spi-feedback-delay", &fb_delay);
+1-1
drivers/watchdog/Kconfig
···678678679679config MAX77620_WATCHDOG680680 tristate "Maxim Max77620 Watchdog Timer"681681- depends on MFD_MAX77620 || COMPILE_TEST681681+ depends on MFD_MAX77620 || MFD_MAX77714 || COMPILE_TEST682682 select WATCHDOG_CORE683683 help684684 This is the driver for the Max77620 watchdog timer.
+69-16
drivers/watchdog/max77620_wdt.c
···33 * Maxim MAX77620 Watchdog Driver44 *55 * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved.66+ * Copyright (C) 2022 Luca Ceresoli67 *78 * Author: Laxman Dewangan <ldewangan@nvidia.com>99+ * Author: Luca Ceresoli <luca@lucaceresoli.net>810 */9111012#include <linux/err.h>···1513#include <linux/module.h>1614#include <linux/mod_devicetable.h>1715#include <linux/mfd/max77620.h>1616+#include <linux/mfd/max77714.h>1817#include <linux/platform_device.h>1918#include <linux/regmap.h>2019#include <linux/slab.h>···23202421static bool nowayout = WATCHDOG_NOWAYOUT;25222323+/**2424+ * struct max77620_variant - Data specific to a chip variant2525+ * @wdt_info: watchdog descriptor2626+ * @reg_onoff_cnfg2: ONOFF_CNFG2 register offset2727+ * @reg_cnfg_glbl2: CNFG_GLBL2 register offset2828+ * @reg_cnfg_glbl3: CNFG_GLBL3 register offset2929+ * @wdtc_mask: WDTC bit mask in CNFG_GLBL3 (=bits to update to ping the watchdog)3030+ * @bit_wd_rst_wk: WD_RST_WK bit offset within ONOFF_CNFG23131+ * @cnfg_glbl2_cfg_bits: configuration bits to enable in CNFG_GLBL2 register3232+ */3333+struct max77620_variant {3434+ u8 reg_onoff_cnfg2;3535+ u8 reg_cnfg_glbl2;3636+ u8 reg_cnfg_glbl3;3737+ u8 wdtc_mask;3838+ u8 bit_wd_rst_wk;3939+ u8 cnfg_glbl2_cfg_bits;4040+};4141+2642struct max77620_wdt {2743 struct device *dev;2844 struct regmap *rmap;4545+ const struct max77620_variant *drv_data;2946 struct watchdog_device wdt_dev;4747+};4848+4949+static const struct max77620_variant max77620_wdt_data = {5050+ .reg_onoff_cnfg2 = MAX77620_REG_ONOFFCNFG2,5151+ .reg_cnfg_glbl2 = MAX77620_REG_CNFGGLBL2,5252+ .reg_cnfg_glbl3 = MAX77620_REG_CNFGGLBL3,5353+ .wdtc_mask = MAX77620_WDTC_MASK,5454+ .bit_wd_rst_wk = MAX77620_ONOFFCNFG2_WD_RST_WK,5555+ /* Set WDT clear in OFF and sleep mode */5656+ .cnfg_glbl2_cfg_bits = MAX77620_WDTSLPC | MAX77620_WDTOFFC,5757+};5858+5959+static const struct max77620_variant max77714_wdt_data = {6060+ .reg_onoff_cnfg2 = MAX77714_CNFG2_ONOFF,6161+ .reg_cnfg_glbl2 = MAX77714_CNFG_GLBL2,6262+ .reg_cnfg_glbl3 = MAX77714_CNFG_GLBL3,6363+ .wdtc_mask = MAX77714_WDTC,6464+ .bit_wd_rst_wk = MAX77714_WD_RST_WK,6565+ /* Set WDT clear in sleep mode (there is no WDTOFFC on MAX77714) */6666+ .cnfg_glbl2_cfg_bits = MAX77714_WDTSLPC,3067};31683269static int max77620_wdt_start(struct watchdog_device *wdt_dev)3370{3471 struct max77620_wdt *wdt = watchdog_get_drvdata(wdt_dev);35723636- return regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL2,7373+ return regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl2,3774 MAX77620_WDTEN, MAX77620_WDTEN);3875}3976···8138{8239 struct max77620_wdt *wdt = watchdog_get_drvdata(wdt_dev);83408484- return regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL2,4141+ return regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl2,8542 MAX77620_WDTEN, 0);8643}8744···8946{9047 struct max77620_wdt *wdt = watchdog_get_drvdata(wdt_dev);91489292- return regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL3,9393- MAX77620_WDTC_MASK, 0x1);4949+ return regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl3,5050+ wdt->drv_data->wdtc_mask, 0x1);9451}95529653static int max77620_wdt_set_timeout(struct watchdog_device *wdt_dev,···12380 break;12481 }12582126126- ret = regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL3,127127- MAX77620_WDTC_MASK, 0x1);8383+ /*8484+ * "If the value of TWD needs to be changed, clear the system8585+ * watchdog timer first [...], then change the value of TWD."8686+ * (MAX77714 datasheet but applies to MAX77620 too)8787+ */8888+ ret = regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl3,8989+ wdt->drv_data->wdtc_mask, 0x1);12890 if (ret < 0)12991 return ret;13092131131- ret = regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL2,9393+ ret = regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl2,13294 MAX77620_TWD_MASK, regval);13395 if (ret < 0)13496 return ret;···157109158110static int max77620_wdt_probe(struct platform_device *pdev)159111{112112+ const struct platform_device_id *id = platform_get_device_id(pdev);160113 struct device *dev = &pdev->dev;161114 struct max77620_wdt *wdt;162115 struct watchdog_device *wdt_dev;···169120 return -ENOMEM;170121171122 wdt->dev = dev;123123+ wdt->drv_data = (const struct max77620_variant *) id->driver_data;124124+172125 wdt->rmap = dev_get_regmap(dev->parent, NULL);173126 if (!wdt->rmap) {174127 dev_err(wdt->dev, "Failed to get parent regmap\n");···187136 platform_set_drvdata(pdev, wdt);188137189138 /* Enable WD_RST_WK - WDT expire results in a restart */190190- ret = regmap_update_bits(wdt->rmap, MAX77620_REG_ONOFFCNFG2,191191- MAX77620_ONOFFCNFG2_WD_RST_WK,192192- MAX77620_ONOFFCNFG2_WD_RST_WK);139139+ ret = regmap_update_bits(wdt->rmap, wdt->drv_data->reg_onoff_cnfg2,140140+ wdt->drv_data->bit_wd_rst_wk,141141+ wdt->drv_data->bit_wd_rst_wk);193142 if (ret < 0) {194143 dev_err(wdt->dev, "Failed to set WD_RST_WK: %d\n", ret);195144 return ret;196145 }197146198198- /* Set WDT clear in OFF and sleep mode */199199- ret = regmap_update_bits(wdt->rmap, MAX77620_REG_CNFGGLBL2,200200- MAX77620_WDTOFFC | MAX77620_WDTSLPC,201201- MAX77620_WDTOFFC | MAX77620_WDTSLPC);147147+ /* Set the "auto WDT clear" bits available on the chip */148148+ ret = regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl2,149149+ wdt->drv_data->cnfg_glbl2_cfg_bits,150150+ wdt->drv_data->cnfg_glbl2_cfg_bits);202151 if (ret < 0) {203152 dev_err(wdt->dev, "Failed to set WDT OFF mode: %d\n", ret);204153 return ret;205154 }206155207156 /* Check if WDT running and if yes then set flags properly */208208- ret = regmap_read(wdt->rmap, MAX77620_REG_CNFGGLBL2, ®val);157157+ ret = regmap_read(wdt->rmap, wdt->drv_data->reg_cnfg_glbl2, ®val);209158 if (ret < 0) {210159 dev_err(wdt->dev, "Failed to read WDT CFG register: %d\n", ret);211160 return ret;···237186}238187239188static const struct platform_device_id max77620_wdt_devtype[] = {240240- { .name = "max77620-watchdog", },189189+ { "max77620-watchdog", (kernel_ulong_t)&max77620_wdt_data },190190+ { "max77714-watchdog", (kernel_ulong_t)&max77714_wdt_data },241191 { },242192};243193MODULE_DEVICE_TABLE(platform, max77620_wdt_devtype);···260208 "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");261209262210MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");211211+MODULE_AUTHOR("Luca Ceresoli <luca@lucaceresoli.net>");263212MODULE_LICENSE("GPL v2");