diff mbox

[RFC,5/5] ARM: tegra: nyan: specify gpio-audio-jack device

Message ID 1432332563-15447-6-git-send-email-dgreid@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Dylan Reid May 22, 2015, 10:09 p.m. UTC
Model the audio jack as a headset jack using the new gpio-audio-jack
device.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 arch/arm/boot/dts/tegra124-nyan.dtsi | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi b/arch/arm/boot/dts/tegra124-nyan.dtsi
index a9aec23..ec33110 100644
--- a/arch/arm/boot/dts/tegra124-nyan.dtsi
+++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
@@ -1,4 +1,5 @@ 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/audio-jack-events.h>
 #include "tegra124.dtsi"
 
 / {
@@ -661,6 +662,23 @@ 
 		};
 	};
 
+	audio_jack: gpio-audio-jack {
+		compatible = "gpio-audio-jack";
+		gpio-audio-jack,jack-name = "Headset Jack";
+		gpio-audio-jack,sw-det-gpios =
+				<&gpio TEGRA_GPIO(I, 7) GPIO_ACTIVE_HIGH>,
+				<&gpio TEGRA_GPIO(R, 7) GPIO_ACTIVE_LOW>;
+		gpio-audio-jack,gpio-names =
+				"Headphones",
+				"Mic Jack";
+		gpio-audio-jack,report-masks =
+				<JACK_HEADPHONE>,
+				<JACK_MICROPHONE>;
+		gpio-audio-jack,debounce-times =
+				<150>,
+				<150>;
+	};
+
 	sound {
 		nvidia,audio-routing =
 			"Headphones", "HPR",
@@ -674,15 +692,13 @@ 
 
 		nvidia,i2s-controller = <&tegra_i2s1>;
 		nvidia,audio-codec = <&acodec>;
+		nvidia,headset-dev = <&audio_jack>;
 
 		clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
 			 <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
 			 <&tegra_car TEGRA124_CLK_EXTERN1>;
 		clock-names = "pll_a", "pll_a_out0", "mclk";
 
-		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(I, 7) GPIO_ACTIVE_HIGH>;
-		nvidia,mic-det-gpios =
-				<&gpio TEGRA_GPIO(R, 7) GPIO_ACTIVE_HIGH>;
 	};
 
 	gpio-restart {