summaryrefstree
path: root/kernel/Documentation/devicetree/bindings/switch/madera.txt
blob: 59ec52c7be83f17867869c565f12ffce47e4760a (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
155
Cirrus Logic Madera class audio codecs switch driver

The switch configuration settings are a child node of type "cirrus,accdet"
within the parent MFD driver devicetree binding.
See Documentation/devicetree/bindings/mfd/madera.txt

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

Mandatory properties:
  - #address-cells : must be 1
  - #size-cells : must be 0


Child node mandatory properties:
  - reg : output number this configuration applies to, 1=OUT1, 2=OUT2, ...

Child node optional properties:
  - cirrus,micd-pol-gpios : GPIO specifier for the GPIO controlling the headset
    polarity if one exists

  - 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,jd-wake-time : Specifies a length of time that a wake lock will be
    held for during jack detection operations.

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

  - 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 : When this property is set then right channel is used
    for headphone impedance measurement else the left headphone channel is
    used

  - 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.
    (cs47l15, cs47l90, cs47l91, cs47l92, cs47l93)

  - 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 two cell group represents one
    polarity configuration
    first cell is the value of
       ACCDET_SRC register field (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 (cs47l35, cs47l85, wm1840)
      value of HPn_GND_SEL register field (all other codecs)

  - 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) 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.

  - cirrus,init-delay-ms : Add a delay after jack detection in mS
  - cirrus,hs-mic: Specify an input to mute during headset button presses:
    1 - IN1L, 2 - IN1R, ..., n - IN[n]R

Example:

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

	cirrus,accdet {
		#address-cells = <1>;
		#size-cells = <0>;

		acc@1 {
			reg = <1>;

			cirrus,micd-pol-gpios = <&gpio 0>
			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
			>;
			cirrus,fixed-hpdet-imp = <8>;
			cirrus,micd-clamp-mode = <0xb>;
			cirrus,gpsw = <0x3>;
		};
	};
};