abox: bring up the audio
authorlijilai <lijilai@huaqin.com>
Thu, 19 Jul 2018 10:50:03 +0000 (18:50 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:29:36 +0000 (17:29 +0800)
[9609][WING] abox: bring up the audio

Bug:HQ00000000

Workaround:no

Change-Id: I4f7e317bf0dac9365809b1b445676c562e518251
Signed-off-by: Shinhyung Kang<s47.kang@samsung.com>
arch/arm64/boot/dts/exynos/exynos9609-wing.dts
arch/arm64/boot/dts/exynos/exynos9610-pinctrl.dtsi [changed mode: 0644->0755]
sound/soc/samsung/exynos9610_madera.c [changed mode: 0644->0755]

index 4a1df1d78c80ceb240188c27b4a31d2261a20f46..499268a484ef705d71a20eff7c031ac58a8e1795 100755 (executable)
                                        regulator-min-microvolt = <800000>;
                                        regulator-max-microvolt = <1950000>;
                                        regulator-ramp-delay = <12000>;
+                                       regulator-always-on;
                                };
 
                                l43_reg: LDO43 {
                                        regulator-min-microvolt = <800000>;
                                        regulator-max-microvolt = <1300000>;
                                        regulator-ramp-delay = <12000>;
+                                       regulator-always-on;
                                };
                        };
                };
                regulator-always-on;
        };
 
-       pinctrl@11850000 {
-               amp_irq: amp-irq {
-                       samsung,pins ="gpa0-2";
-                       samsung,pin-function = <0xf>;
-                       samsung,pin-pud = <0>;
-               };
-       };
-
        pinctrl@139B0000 {
-               amp_reset: amp-reset {
-                       samsung,pins ="gpg3-3";
-                       samsung,pin-pud = <0>;
-                       samsung,pin-con-pdn =<3>;
-                       samsung,pin-pud-pdn = <0>;
-               };
-
                vdd_on: vdd-on {
                        samsung,pins ="gpg3-4";
                        samsung,pin-function = <1>;
                        samsung,pin-val = <0>;
                        samsung,pin-pud = <1>;
                };
-       };
 
-       pinctrl@139B0000 {
                codec_reset: codec-reset {
                        samsung,pins ="gpg3-2";
                        samsung,pin-pud = <0>;
                        samsung,pin-con-pdn =<3>;
                        samsung,pin-pud-pdn = <0>;
                };
+
+               codec_en: codec_en {
+                       samsung,pins = "gpg1-1";
+                       samsung,pin-function = <1>;
+                       samsung,pin-pud = <3>;
+                       samsung,pin-val = <1>;
+               };
+       };
+
+
+
+       spi_6: spi@13900000 {
+               status = "okay";
+               pinctrl-names = "default";
+               pinctrl-0 = <&spi6_bus &spi6_cs_func>;
+               /*cs-gpios = <&gpp2 3 0>;*/
+               /*gpp2[3]*/
+               /*num-cs = <1>;*/
+
+               cs35l41_left: cs35l41@0 {
+                       compatible = "cirrus,cs35l41";
+                       #sound-dai-cells = <1>;
+                       reg = <0x0>;
+                       spi-max-frequency = <11000000>;
+                       interrupt-parent = <&gpa0>;
+                       interrupts = <2 0 0>;
+                       reset-gpios = <&gpg3 3 0>;
+                       VA-supply = <&l42_reg>;
+                       VP-supply = <&V_SYS>;
+                       cirrus,asp-sdout-hiz = <0x3>;
+
+                       cirrus,gpio-config2 {
+                               cirrus,gpio-src-select = <0x4>;
+                               cirrus,gpio-out-enable;
+                       };
+
+                       controller-data {
+                               /*cs-gpio = <gpm8 0 0>*/
+                               samsung,spi-feedback-delay = <1>;
+                               samsung,spi-chip-select-mode = <0>;
+                       };
+               };
        };
 
-#if 0
        spi_9: spi@13940000 {
                pinctrl-names = "default";
-               pinctrl-0 = <&spi9_bus &spi9_cs_func>;
+               pinctrl-0 = <&spi9_bus &spi9_cs_func  &codec_en>;
                status = "okay";
                cs47l35: cs47l35@0 {
                        compatible = "cirrus,cs47l35";
                        SPKVDD-supply = <&V_SYS>;
 
                        reset-gpios = <&gpg3 2 0>;
-
+                     
                        cirrus,dmic-ref = <0 0 0>;
                        cirrus,inmode = <
                                0 0 0 0 /* IN1 */
                        };
                };
        };
-#endif
 
        dummy_audio_codec: audio_codec_dummy {
                status = "okay";
                status = "okay";
        };
 
-#if 0
        sound {
                status = "okay";
                compatible = "samsung,exynos9610-madera";
                        "AIF2 Capture", "OPCLK",
                        "VOUTPUT", "ABOX UAIF0 Playback",
                        "SPEAKER", "Left SPK",
-                       "VOUTPUTCALL", "ABOX UAIF2 Playback",
-                       "ABOX UAIF2 Capture", "VINPUTCALL";
+                       "VOUTPUTCALL", "ABOX SIFS0 Playback",
+                       "ABOX SIFS0 Capture", "VINPUTCALL";
 
                samsung,codec = <&abox &abox_uaif_0 &abox_uaif_1 &abox_uaif_2
-                       &abox_uaif_4 &abox_dsif &abox_spdy &cs35l35_left>;
+                       &abox_uaif_4 &abox_dsif &abox_spdy &cs35l41_left>;
                samsung,prefix = "ABOX", "ABOX", "ABOX", "ABOX",
                        "ABOX", "ABOX", "ABOX", "Left";
                samsung,aux = <&abox_effect &abox_bt>;
                                sound-dai = <&cs47l35 1>;
                        };
                        codec {
-                               sound-dai = <&cs35l35_left 0>;
+                               sound-dai = <&cs35l41_left 0>;
                        };
                };
 
        };
-#endif
 
 #if 0
        fimc_is@144B0000 {
old mode 100644 (file)
new mode 100755 (executable)
index 6103bc2..fbd21ae
                        samsung,pin-val = <0>;
                };
 
+               codec_en: codec_en {
+                       samsung,pins = "gpg1-1";
+                       samsung,pin-function = <1>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-val = <1>;
+               };
+
                /* USI_PERI_CAMI2C_0 */
                hsi2c12_bus: hsi2c12-bus {
                        samsung,pins = "gpc0-0", "gpc0-1";
old mode 100644 (file)
new mode 100755 (executable)
index 6dbb8a7..150e989
@@ -35,7 +35,7 @@
 #define MADERA_BASECLK_44K1    45158400
 
 #define MADERA_AMP_RATE        48000
-#define MADERA_AMP_BCLK        (MADERA_AMP_RATE * 16 * 4)
+#define MADERA_AMP_BCLK        (MADERA_AMP_RATE * 16 * 2)
 
 #define EXYNOS_PMU_PMU_DEBUG_OFFSET    0x0A00
 #define MADERA_DAI_ID                  0x4735
@@ -582,6 +582,7 @@ static void madera_init_debugfs(struct snd_soc_card *card)
 }
 #endif
 
+#if 0
 static int madera_amp_late_probe(struct snd_soc_card *card, int dai)
 {
        struct madera_drvdata *drvdata = card->drvdata;
@@ -623,6 +624,41 @@ static int madera_amp_late_probe(struct snd_soc_card *card, int dai)
 
        return 0;
 }
+#else
+static int madera_amp_late_probe(struct snd_soc_card *card, int dai)
+{
+       struct madera_drvdata *drvdata = card->drvdata;
+       struct snd_soc_pcm_runtime *rtd;
+       struct snd_soc_dai *amp_dai;
+       struct snd_soc_codec *amp;
+       int ret;
+       dev_info(card->dev, "%s\n", __func__);
+
+       if (!dai || !card->dai_link[dai].name)
+               return 0;
+
+       if (!drvdata->opclk.valid) {
+               dev_err(card->dev, "OPCLK required to use speaker amp\n");
+               return -ENOENT;
+       }
+       dev_info(card->dev, "%s: %s\n", __func__, card->dai_link[dai].name);
+
+       rtd = snd_soc_get_pcm_runtime(card, card->dai_link[dai].name);
+       amp_dai = rtd->codec_dai;
+       amp = amp_dai->codec;
+
+       /* using bclk for sysclk*/
+       ret = snd_soc_codec_set_sysclk(amp, 0, 0, MADERA_AMP_BCLK,
+                                    SND_SOC_CLOCK_IN);
+       if (ret != 0) {
+               dev_err(card->dev, "Failed to set amp DAI clock: %d\n", ret);
+               return ret;
+       }
+
+       return 0;
+}
+
+#endif
 
 static int exynos9610_late_probe(struct snd_soc_card *card)
 {