ARM: dts: s5pv210: Enable audio on Aries boards
authorJonathan Bakker <xc-racer2@live.ca>
Wed, 2 Sep 2020 00:38:58 +0000 (17:38 -0700)
committerKrzysztof Kozlowski <krzk@kernel.org>
Wed, 2 Sep 2020 20:11:43 +0000 (22:11 +0200)
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>
arch/arm/boot/dts/s5pv210-aries.dtsi
arch/arm/boot/dts/s5pv210-fascinate4g.dts
arch/arm/boot/dts/s5pv210-galaxys.dts

index 822207f63ee0a994f1cf168baa9820381f0e2291..a3f83f668ce1436a9413ef6a0c3f313a38253ec1 100644 (file)
                };
        };
 
+       bt_codec: bt_sco {
+               compatible = "linux,bt-sco";
+               #sound-dai-cells = <0>;
+       };
+
        vibrator_pwr: regulator-fixed-0 {
                compatible = "regulator-fixed";
                regulator-name = "vibrator-en";
        };
 };
 
+&i2s0 {
+       dmas = <&pdma0 9>, <&pdma0 10>, <&pdma0 11>;
+       status = "okay";
+};
+
 &mfc {
        memory-region = <&mfc_left>, <&mfc_right>;
 };
index 65eed01cfced1a7383ba548eda35d9c7fb95f07f..ca064359dd308d778c522c98c68c9b22b68bb8b4 100644 (file)
                        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 {
        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-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);
index 5d10dd67eacc549beddea78b02dc74e9af0202aa..560f830b6f6be69fb84286eac8e88973c609d3c8 100644 (file)
                        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 {
                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>;
                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-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);