Skip to content

Commit

Permalink
ARM: dts: s5pv210: Enable audio on Aries boards
Browse files Browse the repository at this point in the history
[ Upstream commit cd972fe ]

Both the Galaxy S and the Fascinate4G have a WM8994 codec, but they
differ slightly in their jack detection and micbias configuration.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
xc-racer99 authored and gregkh committed Nov 5, 2020
1 parent fb4139a commit 9723770
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/arm/boot/dts/s5pv210-aries.dtsi
Expand Up @@ -47,6 +47,11 @@
};
};

bt_codec: bt_sco {
compatible = "linux,bt-sco";
#sound-dai-cells = <0>;
};

vibrator_pwr: regulator-fixed-0 {
compatible = "regulator-fixed";
regulator-name = "vibrator-en";
Expand Down Expand Up @@ -624,6 +629,11 @@
};
};

&i2s0 {
dmas = <&pdma0 9>, <&pdma0 10>, <&pdma0 11>;
status = "okay";
};

&mfc {
memory-region = <&mfc_left>, <&mfc_right>;
};
Expand Down
98 changes: 98 additions & 0 deletions arch/arm/boot/dts/s5pv210-fascinate4g.dts
Expand Up @@ -35,6 +35,80 @@
linux,code = <KEY_VOLUMEUP>;
};
};

headset_micbias_reg: regulator-fixed-3 {
compatible = "regulator-fixed";
regulator-name = "Headset_Micbias";
gpio = <&gpj2 5 GPIO_ACTIVE_HIGH>;
enable-active-high;

pinctrl-names = "default";
pinctrl-0 = <&headset_micbias_ena>;
};

main_micbias_reg: regulator-fixed-4 {
compatible = "regulator-fixed";
regulator-name = "Main_Micbias";
gpio = <&gpj4 2 GPIO_ACTIVE_HIGH>;
enable-active-high;

pinctrl-names = "default";
pinctrl-0 = <&main_micbias_ena>;
};

sound {
compatible = "samsung,fascinate4g-wm8994";

model = "Fascinate4G";

extcon = <&fsa9480>;

main-micbias-supply = <&main_micbias_reg>;
headset-micbias-supply = <&headset_micbias_reg>;

earpath-sel-gpios = <&gpj2 6 GPIO_ACTIVE_HIGH>;

io-channels = <&adc 3>;
io-channel-names = "headset-detect";
headset-detect-gpios = <&gph0 6 GPIO_ACTIVE_HIGH>;
headset-key-gpios = <&gph3 6 GPIO_ACTIVE_HIGH>;

samsung,audio-routing =
"HP", "HPOUT1L",
"HP", "HPOUT1R",

"SPK", "SPKOUTLN",
"SPK", "SPKOUTLP",

"RCV", "HPOUT2N",
"RCV", "HPOUT2P",

"LINE", "LINEOUT2N",
"LINE", "LINEOUT2P",

"IN1LP", "Main Mic",
"IN1LN", "Main Mic",

"IN1RP", "Headset Mic",
"IN1RN", "Headset Mic",

"Modem Out", "Modem TX",
"Modem RX", "Modem In",

"Bluetooth SPK", "TX",
"RX", "Bluetooth Mic";

pinctrl-names = "default";
pinctrl-0 = <&headset_det &earpath_sel>;

cpu {
sound-dai = <&i2s0>, <&bt_codec>;
};

codec {
sound-dai = <&wm8994>;
};
};
};

&fg {
Expand All @@ -51,13 +125,37 @@
pinctrl-names = "default";
pinctrl-0 = <&sleep_cfg>;

headset_det: headset-det {
samsung,pins = "gph0-6", "gph3-6";
samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
};

fg_irq: fg-irq {
samsung,pins = "gph3-3";
samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

headset_micbias_ena: headset-micbias-ena {
samsung,pins = "gpj2-5";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

earpath_sel: earpath-sel {
samsung,pins = "gpj2-6";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

main_micbias_ena: main-micbias-ena {
samsung,pins = "gpj4-2";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

/* Based on vendor kernel v2.6.35.7 */
sleep_cfg: sleep-cfg {
PIN_SLP(gpa0-0, PREV, NONE);
Expand Down
85 changes: 85 additions & 0 deletions arch/arm/boot/dts/s5pv210-galaxys.dts
Expand Up @@ -72,6 +72,73 @@
pinctrl-0 = <&fm_irq &fm_rst>;
};
};

micbias_reg: regulator-fixed-3 {
compatible = "regulator-fixed";
regulator-name = "MICBIAS";
gpio = <&gpj4 2 GPIO_ACTIVE_HIGH>;
enable-active-high;

pinctrl-names = "default";
pinctrl-0 = <&micbias_reg_ena>;
};

sound {
compatible = "samsung,aries-wm8994";

model = "Aries";

extcon = <&fsa9480>;

main-micbias-supply = <&micbias_reg>;
headset-micbias-supply = <&micbias_reg>;

earpath-sel-gpios = <&gpj2 6 GPIO_ACTIVE_HIGH>;

io-channels = <&adc 3>;
io-channel-names = "headset-detect";
headset-detect-gpios = <&gph0 6 GPIO_ACTIVE_LOW>;
headset-key-gpios = <&gph3 6 GPIO_ACTIVE_HIGH>;

samsung,audio-routing =
"HP", "HPOUT1L",
"HP", "HPOUT1R",

"SPK", "SPKOUTLN",
"SPK", "SPKOUTLP",

"RCV", "HPOUT2N",
"RCV", "HPOUT2P",

"LINE", "LINEOUT2N",
"LINE", "LINEOUT2P",

"IN1LP", "Main Mic",
"IN1LN", "Main Mic",

"IN1RP", "Headset Mic",
"IN1RN", "Headset Mic",

"IN2LN", "FM In",
"IN2RN", "FM In",

"Modem Out", "Modem TX",
"Modem RX", "Modem In",

"Bluetooth SPK", "TX",
"RX", "Bluetooth Mic";

pinctrl-names = "default";
pinctrl-0 = <&headset_det &earpath_sel>;

cpu {
sound-dai = <&i2s0>, <&bt_codec>;
};

codec {
sound-dai = <&wm8994>;
};
};
};

&aliases {
Expand All @@ -88,6 +155,12 @@
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

headset_det: headset-det {
samsung,pins = "gph0-6", "gph3-6";
samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
};

fm_irq: fm-irq {
samsung,pins = "gpj2-4";
samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
Expand All @@ -102,13 +175,25 @@
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

earpath_sel: earpath-sel {
samsung,pins = "gpj2-6";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

massmemory_en: massmemory-en {
samsung,pins = "gpj2-7";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

micbias_reg_ena: micbias-reg-ena {
samsung,pins = "gpj4-2";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

/* Based on CyanogenMod 3.0.101 kernel */
sleep_cfg: sleep-cfg {
PIN_SLP(gpa0-0, PREV, NONE);
Expand Down

0 comments on commit 9723770

Please sign in to comment.