summaryrefstree
path: root/kernel/Documentation/devicetree/bindings/extcon/extcon-madera.txt
blob: 7a29a93fb6511d9a887191d6dca79be4dbe8b214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Cirrus Logic Madera class audio codecs extcon driver

The extcon configuration settings are a child node of the parent MFD driver
binding.
See Documentation/devicetree/bindings/mfd/madera.txt

This node contains one or more child nodes to describe the configuration for
each accessory detect.

Mandatory properties:
  - compatible : must be "cirrus,madera-extcon"
  - #address-cells : must be 1
  - #size-cells : must be 0

Optional properties:
  - cirrus,gpsw : Settings for the general purpose switches, set as per the
    SWn_MODE bits in the GP Switch 1 register. If given must be 2 cells.
    First cell is the value for the SW1_MODE
    Second cell is the value for the SW2_MODE (cs47l90, cs47l91, cs47l92,
    cs47l93)

  - cirrus,micd-pol-gpios : GPIO specifier for the GPIO controlling the headset
    polarity if one exists. One cell for each child node.

Child node mandatory properties:
  - reg : output number this configuration applies to, must be 1

Child node optional properties:
  - cirrus,micd-detect-debounce-ms : Additional software microphone detection
    debounce specified in milliseconds

  - cirrus,micd-manual-debounce : Additional software button detection
    debounce specified as a number

  - cirrus,micd-bias-start-time : Time allowed for MICBIAS to startup prior to
    performing microphone detection, specified as per the MICD_BIAS_STARTTIME
    bits in the register MIC_DETECT_1

  - cirrus,micd-rate : Delay between successive microphone detection
    measurements, specified as per the MICD_RATE bits in the register
    MIC_DETECT_1

  - cirrus,micd-dbtime : Microphone detection hardware debounce level, specified
    as per the MICD_DBTIME bits in the register MIC_DETECT_1

  - cirrus,micd-timeout-ms : Timeout for microphone detection, specified in
    milliseconds

  - cirrus,micd-force-micbias : Force MICBIAS continuously on during microphone
    detection and button detection

  - cirrus,micd-software-compare : Use a software comparison to determine mic
    presence

  - cirrus,jd-invert : Invert the polarity of the jack detection switch

  - cirrus,jd-use-jd2 : Use JD2 input with JD1 for dual jack detection.

  - cirrus,fixed-hpdet-imp : Do not perform any headphone detection, just use
    the fixed value specified here as the headphone impedance. Value is in
    hundredths-of-an-ohm (ohms * 100)

  - cirrus,hpdet-ext-res : Impedance of external series resistor on hpdet.
    Value is in hundredths-of-an-ohm (ohms * 100)

  - cirrus,hpdet-short-circuit-imp : Specifies the maximum impedance in ohms
    that will be considered as a short circuit

  - cirrus,hpdet-channel : Set which channel is used for headphone impedance
    measurement. 0 = left, 1 = right

  - cirrus,micd-clamp-mode : Specifies the logic of the micdetect clamp block

  - cirrus,hpd-pins : 4 cells specifying the clamp and sense pins to use.
	<clamp_left sense_left clamp_right sense_right>
    where clamp_x is the clamp pin for channel x and sense_x is the impedance
    sense pin for channel x, as per the HPD_OUT_SEL field of HEADPHONE_DETECT_0
    register. A value >0xFFFF means use the default.
    (cs47l90, cs47l91)

  - cirrus,micd-ranges : Microphone detection level and key configuration, this
    field can be of variable length but should always be a multiple of 2 cells
    long, each two cell group represents one button configuration
    The first cell is the maximum impedance for this button in ohms
    The second cell the key that should be reported to the input layer

  - cirrus,micd-configs : Headset polarity configurations, variable length but
    must be a multiple of 5 cells, each 5-cell group represents one
    polarity configuration
    first cell is the value of
       ACCDET_SRC register field (CS47L15, CS47L35, CS47L85, WM1840),
       MICD_SENSE_SEL register field (all other codecs)
    second cell is the accessory detection ground as per the MICD_GND_SEL
      register field
    the third cell is the MICBIAS to be used as per the MICD_BIAS_SRC register
      field
    fourth cell is the value of the micd-pol-gpio pin, a non-zero value
      indicates this should be on
    fifth cell is
      set to zero (cs47l15, cs47l35, cs47l85, wm1840)
      value of HPn_GND_SEL register field (all other codecs)

  - cirrus,init-delay-ms : Add a delay after jack detection (in milliseconds)

  - cirrus,hs-mic: Specify an input to mute during headset button presses:
    1 - IN1L, 2 - IN1R, ..., n - IN[n]R

  - cirrus,moisture-pin : The pin on which the moisture detection should be
    run. For (cs47l35, cs47l85, wm1840) this should be set to
    MADERA_ACCDET_MODE_HPx, for (cs47l90, cs47l91, cs47l92, cs47l93) this
    should be set to MADERA_HPD_SENSE_x.
  - cirrus,moisture-imp : The impedance threshold above which a detection will
    be considered moisture rather than a valid jack detection.
  - cirrus,moisture-debounce :  The number of debounce measurements to perform
    on the moisture detection.

Example:

codec: cs47l85@0 {
	compatible = "cirrus,cs47l85";

	accdet {
		compatible = "cirrus,madera-extcon";
		#address-cells = <1>;
		#size-cells = <0>;

		cirrus,gpsw = <3 0>;

		cirrus,micd-pol-gpios = <&gpio 0>

		acc@1 {
			reg = <1>;

			cirrus,micd-detect-debounce-ms = <10>;
			cirrus,micd-bias-start-time = <0x1>;
			cirrus,micd-rate = <0x1>;
			cirrus,micd-dbtime = <0x1>;
			cirrus,micd-timeout-ms = <10>;
			cirrus,micd-force-micbias;
			cirrus,micd-ranges = <
				11 0x100
				28 0x101
				54 0x102
				100 0x103
				186 0x104
				430 0x105
			>;
			cirrus,micd-configs = <
				0x1 0 1 0 2
				0x0 0 2 1 2
			>;
		};
	};
};