Tim Zimmermann | 5c435c1 | 2021-03-18 09:19:56 +0100 | [diff] [blame^] | 1 | Cirrus Logic Madera class audio codecs extcon driver |
| 2 | |
| 3 | The extcon configuration settings are a child node of the parent MFD driver |
| 4 | binding. |
| 5 | See Documentation/devicetree/bindings/mfd/madera.txt |
| 6 | |
| 7 | This node contains one or more child nodes to describe the configuration for |
| 8 | each accessory detect. |
| 9 | |
| 10 | Mandatory properties: |
| 11 | - compatible : must be "cirrus,madera-extcon" |
| 12 | - #address-cells : must be 1 |
| 13 | - #size-cells : must be 0 |
| 14 | |
| 15 | Optional properties: |
| 16 | - cirrus,gpsw : Settings for the general purpose switches, set as per the |
| 17 | SWn_MODE bits in the GP Switch 1 register. If given must be 2 cells. |
| 18 | First cell is the value for the SW1_MODE |
| 19 | Second cell is the value for the SW2_MODE (cs47l90, cs47l91, cs47l92, |
| 20 | cs47l93) |
| 21 | |
| 22 | - cirrus,micd-pol-gpios : GPIO specifier for the GPIO controlling the headset |
| 23 | polarity if one exists. One cell for each child node. |
| 24 | |
| 25 | Child node mandatory properties: |
| 26 | - reg : output number this configuration applies to, must be 1 |
| 27 | |
| 28 | Child node optional properties: |
| 29 | - cirrus,micd-detect-debounce-ms : Additional software microphone detection |
| 30 | debounce specified in milliseconds |
| 31 | |
| 32 | - cirrus,micd-manual-debounce : Additional software button detection |
| 33 | debounce specified as a number |
| 34 | |
| 35 | - cirrus,micd-bias-start-time : Time allowed for MICBIAS to startup prior to |
| 36 | performing microphone detection, specified as per the MICD_BIAS_STARTTIME |
| 37 | bits in the register MIC_DETECT_1 |
| 38 | |
| 39 | - cirrus,micd-rate : Delay between successive microphone detection |
| 40 | measurements, specified as per the MICD_RATE bits in the register |
| 41 | MIC_DETECT_1 |
| 42 | |
| 43 | - cirrus,micd-dbtime : Microphone detection hardware debounce level, specified |
| 44 | as per the MICD_DBTIME bits in the register MIC_DETECT_1 |
| 45 | |
| 46 | - cirrus,micd-timeout-ms : Timeout for microphone detection, specified in |
| 47 | milliseconds |
| 48 | |
| 49 | - cirrus,micd-force-micbias : Force MICBIAS continuously on during microphone |
| 50 | detection and button detection |
| 51 | |
| 52 | - cirrus,micd-software-compare : Use a software comparison to determine mic |
| 53 | presence |
| 54 | |
| 55 | - cirrus,jd-invert : Invert the polarity of the jack detection switch |
| 56 | |
| 57 | - cirrus,jd-use-jd2 : Use JD2 input with JD1 for dual jack detection. |
| 58 | |
| 59 | - cirrus,fixed-hpdet-imp : Do not perform any headphone detection, just use |
| 60 | the fixed value specified here as the headphone impedance. Value is in |
| 61 | hundredths-of-an-ohm (ohms * 100) |
| 62 | |
| 63 | - cirrus,hpdet-ext-res : Impedance of external series resistor on hpdet. |
| 64 | Value is in hundredths-of-an-ohm (ohms * 100) |
| 65 | |
| 66 | - cirrus,hpdet-short-circuit-imp : Specifies the maximum impedance in ohms |
| 67 | that will be considered as a short circuit |
| 68 | |
| 69 | - cirrus,hpdet-channel : Set which channel is used for headphone impedance |
| 70 | measurement. 0 = left, 1 = right |
| 71 | |
| 72 | - cirrus,micd-clamp-mode : Specifies the logic of the micdetect clamp block |
| 73 | |
| 74 | - cirrus,hpd-pins : 4 cells specifying the clamp and sense pins to use. |
| 75 | <clamp_left sense_left clamp_right sense_right> |
| 76 | where clamp_x is the clamp pin for channel x and sense_x is the impedance |
| 77 | sense pin for channel x, as per the HPD_OUT_SEL field of HEADPHONE_DETECT_0 |
| 78 | register. A value >0xFFFF means use the default. |
| 79 | (cs47l90, cs47l91) |
| 80 | |
| 81 | - cirrus,micd-ranges : Microphone detection level and key configuration, this |
| 82 | field can be of variable length but should always be a multiple of 2 cells |
| 83 | long, each two cell group represents one button configuration |
| 84 | The first cell is the maximum impedance for this button in ohms |
| 85 | The second cell the key that should be reported to the input layer |
| 86 | |
| 87 | - cirrus,micd-configs : Headset polarity configurations, variable length but |
| 88 | must be a multiple of 5 cells, each 5-cell group represents one |
| 89 | polarity configuration |
| 90 | first cell is the value of |
| 91 | ACCDET_SRC register field (CS47L15, CS47L35, CS47L85, WM1840), |
| 92 | MICD_SENSE_SEL register field (all other codecs) |
| 93 | second cell is the accessory detection ground as per the MICD_GND_SEL |
| 94 | register field |
| 95 | the third cell is the MICBIAS to be used as per the MICD_BIAS_SRC register |
| 96 | field |
| 97 | fourth cell is the value of the micd-pol-gpio pin, a non-zero value |
| 98 | indicates this should be on |
| 99 | fifth cell is |
| 100 | set to zero (cs47l15, cs47l35, cs47l85, wm1840) |
| 101 | value of HPn_GND_SEL register field (all other codecs) |
| 102 | |
| 103 | - cirrus,init-delay-ms : Add a delay after jack detection (in milliseconds) |
| 104 | |
| 105 | - cirrus,hs-mic: Specify an input to mute during headset button presses: |
| 106 | 1 - IN1L, 2 - IN1R, ..., n - IN[n]R |
| 107 | |
| 108 | - cirrus,moisture-pin : The pin on which the moisture detection should be |
| 109 | run. For (cs47l35, cs47l85, wm1840) this should be set to |
| 110 | MADERA_ACCDET_MODE_HPx, for (cs47l90, cs47l91, cs47l92, cs47l93) this |
| 111 | should be set to MADERA_HPD_SENSE_x. |
| 112 | - cirrus,moisture-imp : The impedance threshold above which a detection will |
| 113 | be considered moisture rather than a valid jack detection. |
| 114 | - cirrus,moisture-debounce : The number of debounce measurements to perform |
| 115 | on the moisture detection. |
| 116 | |
| 117 | Example: |
| 118 | |
| 119 | codec: cs47l85@0 { |
| 120 | compatible = "cirrus,cs47l85"; |
| 121 | |
| 122 | accdet { |
| 123 | compatible = "cirrus,madera-extcon"; |
| 124 | #address-cells = <1>; |
| 125 | #size-cells = <0>; |
| 126 | |
| 127 | cirrus,gpsw = <3 0>; |
| 128 | |
| 129 | cirrus,micd-pol-gpios = <&gpio 0> |
| 130 | |
| 131 | acc@1 { |
| 132 | reg = <1>; |
| 133 | |
| 134 | cirrus,micd-detect-debounce-ms = <10>; |
| 135 | cirrus,micd-bias-start-time = <0x1>; |
| 136 | cirrus,micd-rate = <0x1>; |
| 137 | cirrus,micd-dbtime = <0x1>; |
| 138 | cirrus,micd-timeout-ms = <10>; |
| 139 | cirrus,micd-force-micbias; |
| 140 | cirrus,micd-ranges = < |
| 141 | 11 0x100 |
| 142 | 28 0x101 |
| 143 | 54 0x102 |
| 144 | 100 0x103 |
| 145 | 186 0x104 |
| 146 | 430 0x105 |
| 147 | >; |
| 148 | cirrus,micd-configs = < |
| 149 | 0x1 0 1 0 2 |
| 150 | 0x0 0 2 1 2 |
| 151 | >; |
| 152 | }; |
| 153 | }; |
| 154 | }; |