Samsung's S2MU005 PMIC includes subdevices for a charger, an MUIC (Micro USB Interface Controller), and flash and RGB LED controllers. Add the compatible and documentation for the S2MU005 PMIC. Also, add an example for nodes for supported sub-devices, i.e. MUIC, flash LEDs, and RGB LEDs. Charger sub-device uses the node of the parent.
Unified · Split
| @@ -0,0 +1,120 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause | ||
| 2 | %YAML 1.2 | ||
| 3 | --- | ||
| 4 | $id: http://devicetree.org/schemas/mfd/samsung,s2mu005-pmic.yaml# | ||
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
| 6 | |||
| 7 | title: Samsung S2MU005 Power Management IC | ||
| 8 | |||
| 9 | maintainers: | ||
| 10 | - Kaustabh Chakraborty <kauschluss@disroot.org> | ||
| 11 | |||
| 12 | description: | | ||
| 13 | The S2MU005 is a companion power management IC which includes subdevices for | ||
| 14 | a charger controller, an MUIC (Micro USB Interface Controller), and flash and | ||
| 15 | RGB LED controllers. | ||
| 16 | |||
| 17 | allOf: | ||
| 18 | - $ref: /schemas/power/supply/power-supply.yaml# | ||
| 19 | |||
| 20 | properties: | ||
| 21 | compatible: | ||
| 22 | const: samsung,s2mu005-pmic | ||
| 23 | |||
| 24 | flash: | ||
| 25 | $ref: /schemas/leds/samsung,s2mu005-flash.yaml# | ||
| 26 | description: | ||
| 27 | Child node describing flash LEDs. | ||
| 28 | |||
| 29 | interrupts: | ||
| 30 | maxItems: 1 | ||
| 31 | |||
| 32 | muic: | ||
| 33 | $ref: /schemas/extcon/samsung,s2mu005-muic.yaml# | ||
| 34 | description: | ||
| 35 | Child node describing MUIC device. | ||
| 36 | |||
| 37 | multi-led: | ||
| 38 | type: object | ||
| 39 | |||
| 40 | allOf: | ||
| 41 | - $ref: /schemas/leds/leds-class-multicolor.yaml# | ||
| 42 | |||
| 43 | properties: | ||
| 44 | compatible: | ||
| 45 | const: samsung,s2mu005-rgb | ||
| 46 | |||
| 47 | required: | ||
| 48 | - compatible | ||
| 49 | |||
| 50 | unevaluatedProperties: false | ||
| 51 | |||
| 52 | reg: | ||
| 53 | maxItems: 1 | ||
| 54 | |||
| 55 | required: | ||
| 56 | - compatible | ||
| 57 | - reg | ||
| 58 | |||
| 59 | unevaluatedProperties: false | ||
| 60 | |||
| 61 | examples: | ||
| 62 | - | | ||
| 63 | #include <dt-bindings/interrupt-controller/irq.h> | ||
| 64 | #include <dt-bindings/leds/common.h> | ||
| 65 | |||
| 66 | i2c { | ||
| 67 | #address-cells = <1>; | ||
| 68 | #size-cells = <0>; | ||
| 69 | |||
| 70 | pmic@3d { | ||
| 71 | compatible = "samsung,s2mu005-pmic"; | ||
| 72 | reg = <0x3d>; | ||
| 73 | interrupt-parent = <&gpa2>; | ||
| 74 | interrupts = <7 IRQ_TYPE_LEVEL_LOW>; | ||
| 75 | |||
| 76 | monitored-battery = <&battery>; | ||
| 77 | |||
| 78 | flash { | ||
| 79 | compatible = "samsung,s2mu005-flash"; | ||
| 80 | #address-cells = <1>; | ||
| 81 | #size-cells = <0>; | ||
| 82 | |||
| 83 | led@0 { | ||
| 84 | reg = <0>; | ||
| 85 | color = <LED_COLOR_ID_WHITE>; | ||
| 86 | function = LED_FUNCTION_FLASH; | ||
| 87 | }; | ||
| 88 | |||
| 89 | led@1 { | ||
| 90 | reg = <1>; | ||
| 91 | color = <LED_COLOR_ID_WHITE>; | ||
| 92 | function = LED_FUNCTION_FLASH; | ||
| 93 | function-enumerator = <1>; | ||
| 94 | }; | ||
| 95 | }; | ||
| 96 | |||
| 97 | muic { | ||
| 98 | compatible = "samsung,s2mu005-muic"; | ||
| 99 | |||
| 100 | connector { | ||
| 101 | compatible = "usb-b-connector"; | ||
| 102 | label = "micro-USB"; | ||
| 103 | type = "micro"; | ||
| 104 | }; | ||
| 105 | |||
| 106 | port { | ||
| 107 | muic_to_usb: endpoint { | ||
| 108 | remote-endpoint = <&usb_to_muic>; | ||
| 109 | }; | ||
| 110 | }; | ||
| 111 | }; | ||
| 112 | |||
| 113 | multi-led { | ||
| 114 | compatible = "samsung,s2mu005-rgb"; | ||
| 115 | color = <LED_COLOR_ID_RGB>; | ||
| 116 | function = LED_FUNCTION_INDICATOR; | ||
| 117 | linux,default-trigger = "pattern"; | ||
| 118 | }; | ||
| 119 | }; | ||
| 120 | }; | ||