summaryrefslogtreecommitdiff
path: root/r11_audio_haptics.dtsi
blob: 1e731328dc07cf574c0807bd479cee673277e688 (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
156
157
158
/*
 * Device Tree config for the CS40L25 chip - Haptics actuator
 */

#include <dt-bindings/pinctrl/samsung.h>

&gpa1 {
	#interrupt-cells = <2>;
};

&pinctrl_0 {
	pinctrl-names = "default";
	// IRQ pin is shared between haptics and smart amp and the pinctrl framework
	// does not allow for multiple drivers to own a pin via pinctrl-0, thus the
	// ownership is given directly to pinctrl_0. This will hog the pin as soon as
	// pinmux gets initialized.
	pinctrl-0 = <&audio_haptics_irq>;

	// IRQ pin is shared between haptics and audio
	audio_haptics_irq: audio_haptics-irq {
		// gpio8
		samsung,pins = "gpa1-0";
		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
	};

	haptics_refclk: haptics-refclk {
		samsung,pins = "gpa1-2";
		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
	};
};

&pinctrl_5 {
	// GPIO 95
	smart_amp_rst: smart_amp-rst {
		samsung,pins = "gpg1-1";
		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
		samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
		samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
	};

	// GPIO 106
	haptics_rst: haptics-rst {
		samsung,pins = "gpg7-0";
		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
		samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
		samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
	};
};

// Used to generate 32kHz reference clock for haptics and BT/Wifi devices
&exynos_rtc {
	status = "ok";
	pinctrl-names = "default";
	pinctrl-0 = <&haptics_refclk>;
};

&i2c_2 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "ok";

	dev2_cs40l25: dev2-cs40l25@43 {
		compatible = "cirrus,cs40l25";
		pinctrl-names = "default";
		pinctrl-0 = <&haptics_rst>;
		reset-gpios = <&gpg7 0 GPIO_ACTIVE_HIGH>;
		reg = <0x43>;
		status = "disabled";
		interrupts-extended = <&gpa1 0 IRQ_TYPE_LEVEL_LOW>;

		cirrus,boost-ind-nanohenry = <1000>;
		cirrus,boost-cap-microfarad = <4>;
		cirrus,boost-ipk-milliamp = <4500>;
		cirrus,boost-clab-millivolt = <5000>; /* 5V */
		cirrus,boost-ctl-millivolt = <5000>; /* 5V */
		cirrus,boost-ovp-millivolt = <9000>; /* 9V */

		cirrus,f0-default = <2514000>; /* 153 Hz */
		cirrus,redc-default = <327728>; /* 15 Ohm */
		cirrus,hiber-enable = <1>;

		cirrus,refclk-gpio2;

		cirrus,asp-fmt = <0>;
		cirrus,asp-bclk-freq-hz = <3072000>;
		cirrus,asp-slot-num = <2>;
		cirrus,asp-slot-width = <16>;
		cirrus,asp-samp-width = <16>;
		cirrus,fw-id-remap = <0x1400CB>;
	};
};

&hsi2c_8 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "ok";

	cs35l41: cs35l41@40 {
		#sound-dai-cells = <0>;
		compatible = "cirrus,cs35l41";
		reg = <0x40>;

		pinctrl-names = "default";
		pinctrl-0 = <&smart_amp_rst>;
		reset-gpios = <&gpg1 1 GPIO_ACTIVE_HIGH>;
		interrupts-extended = <&gpa1 0 IRQ_TYPE_LEVEL_LOW>;

		cirrus,boost-peak-milliamp = <1600>;
		cirrus,boost-ind-nanohenry = <1000>;
		cirrus,boost-cap-microfarad = <30>;
		cirrus,boost-ctl-millivolt = <5500>;
		cirrus,hibernate-enable = <1>;

		// Mode 3: Hi-Z during unused slots and while all transmit channels disabled
		cirrus,asp-sdout-hiz = <3>;

		// GPIO/INT pin configuration
		cirrus,gpio-config2 {
			// Mode 2: Open Drain INTB
			cirrus,gpio-src-select = <2>;
		};
	};

	proto1_cs40l25: proto1-cs40l25@43 {
		compatible = "cirrus,cs40l25";
		pinctrl-names = "default";
		pinctrl-0 = <&haptics_rst>;
		reset-gpios = <&gpg7 0 GPIO_ACTIVE_HIGH>;
		reg = <0x43>;
		status = "disabled";
		interrupts-extended = <&gpa1 0 IRQ_TYPE_LEVEL_LOW>;

		cirrus,boost-ind-nanohenry = <1000>;
		cirrus,boost-cap-microfarad = <4>;
		cirrus,boost-ipk-milliamp = <4500>;
		cirrus,boost-clab-millivolt = <5000>; /* 5V */
		cirrus,boost-ctl-millivolt = <5000>; /* 5V */
		cirrus,boost-ovp-millivolt = <9000>; /* 9V */

		cirrus,f0-default = <2514000>; /* 153 Hz */
		cirrus,redc-default = <327728>; /* 15 Ohm */
		cirrus,hiber-enable = <1>;

		cirrus,refclk-gpio2;

		cirrus,asp-fmt = <0>;
		cirrus,asp-bclk-freq-hz = <3072000>;
		cirrus,asp-slot-num = <2>;
		cirrus,asp-slot-width = <16>;
		cirrus,asp-samp-width = <16>;
		cirrus,fw-id-remap = <0x1400CB>;
	};
};