Skip to content

Commit

Permalink
arm: p4note: add wm1811 audio (WIP)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Jücker <martin.juecker@gmail.com>
  • Loading branch information
Viciouss committed Jun 18, 2021
1 parent 22d6fa3 commit c1d8e87
Show file tree
Hide file tree
Showing 5 changed files with 581 additions and 0 deletions.
122 changes: 122 additions & 0 deletions arch/arm/boot/dts/exynos4412-p4note.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@
regulator-boot-on;
};

mic_bias_reg: voltage-regulator-5 {
compatible = "regulator-fixed";
regulator-name = "MICBIAS_LDO_2.8V";
pinctrl-names = "default";
pinctrl-0 = <&main_mic_bias>;
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
gpios = <&gpm0 0 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

wm1811_spkvdd: voltage-regulator-6 {
compatible = "regulator-fixed";
regulator-name = "VBATT";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};

wlan_pwrseq: sdhci3-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpm3 5 GPIO_ACTIVE_LOW>;
Expand Down Expand Up @@ -241,6 +260,50 @@
brightness-levels = <0 48 56 64 72 80 96 112 128 144 160 176 192 255>;
default-brightness-level = <12>;
};

sound: sound {
compatible = "samsung,p4note-audio";
model = "p4note";
mic-bias-supply = <&mic_bias_reg>;
lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&lineout_en>;
i2s-controller = <&i2s0>;
audio-codec = <&wm1811>;
samsung,audio-routing =
"HP", "HPOUT1L",
"HP", "HPOUT1R",

"SPK", "SPKOUTLN",
"SPK", "SPKOUTLP",
"SPK", "SPKOUTRN",
"SPK", "SPKOUTRP",

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

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

"HDMI", "LINEOUT1N",
"HDMI", "LINEOUT1P",

/* "IN1LP", "MICBIAS1",
"IN1LN", "MICBIAS1",
"MICBIAS1", "Main Mic", */

"IN1RP", "Sub Mic",
"IN1RN", "Sub Mic",

/* "IN2LP:VXRN", "MICBIAS2",
"MICBIAS2", "Headset Mic", */

"IN2RN", "FM In",
"IN2RP:VXRP", "FM In";

/* "IN2RN", "Third Mic",
"IN2RP:VXRP", "Third Mic"; */
};
};

&adc {
Expand Down Expand Up @@ -367,6 +430,41 @@
};
};

&i2c_4 {
samsung,i2c-sda-delay = <100>;
samsung,i2c-slave-addr = <0x10>;
samsung,i2c-max-bus-freq = <400000>;
pinctrl-0 = <&i2c4_bus>;
pinctrl-names = "default";
status = "okay";

wm1811: audio-codec@1a {
compatible = "wlf,wm1811";
reg = <0x1a>;
clocks = <&pmu_system_controller 0>;
clock-names = "MCLK1";
pinctrl-0 = <&wm1811_ldo>;
pinctrl-names = "default";
gpio-controller;
#gpio-cells = <2>;

AVDD2-supply = <&wm1811_spkvdd>;
DCVDD-supply = <&ldo3_reg>;
CPVDD-supply = <&wm1811_spkvdd>;
DBVDD1-supply = <&ldo3_reg>;
DBVDD2-supply = <&wm1811_spkvdd>;
DBVDD3-supply = <&wm1811_spkvdd>;
SPKVDD1-supply = <&wm1811_spkvdd>;
SPKVDD2-supply = <&wm1811_spkvdd>;

wlf,micbias-cfg = <0x2F 0x27>;
wlf,gpio-cfg = <0x3 0x0 0x0 0x0 0x0 0x0 0x0 0x8000 0x0 0x0 0x0>;
wlf,lineout1-feedback;
wlf,ldo1ena-gpios = <&gpm4 4 GPIO_ACTIVE_HIGH>;
wlf,ldoena-always-driven;
};
};

&i2c_7 {
samsung,i2c-sda-delay = <100>;
samsung,i2c-slave-addr = <0x10>;
Expand Down Expand Up @@ -676,6 +774,12 @@
};
};

&i2s0 {
pinctrl-0 = <&i2s0_bus>;
pinctrl-names = "default";
status = "okay";
};

&mshc_0 {
broken-cd;
non-removable;
Expand Down Expand Up @@ -714,6 +818,12 @@
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

lineout_en: lineout-en {
samsung,pins = "gpj1-2";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

sleep0: sleep-states {
PIN_SLP(gpa0-0, INPUT, NONE);
PIN_SLP(gpa0-1, OUT0, NONE);
Expand Down Expand Up @@ -836,6 +946,12 @@
/* 0 = CP, 1 = AP (serial output) */
};

main_mic_bias: main-mic-bias {
samsung,pins = "gpm0-0";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

led_bl_reset: led-bl-reset {
samsung,pins = "gpm0-1";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
Expand Down Expand Up @@ -866,6 +982,12 @@
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

wm1811_ldo: wm1811-ldo {
samsung,pins = "gpm4-4";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

tsp_reg_gpio_1: tsp-reg-gpio-1 {
samsung,pins = "gpm4-5";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/exynos_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SOC_SAMSUNG=y
CONFIG_SND_SOC_SAMSUNG_SMDK_WM8994=y
CONFIG_SND_SOC_SAMSUNG_P4NOTE_WM1811=y
CONFIG_SND_SOC_SMDK_WM8994_PCM=y
CONFIG_SND_SOC_SNOW=y
CONFIG_SND_SOC_ODROID=y
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,12 @@ config SND_SOC_SAMSUNG_MIDAS_WM1811
help
Say Y if you want to add support for SoC audio on the Midas boards.

config SND_SOC_SAMSUNG_P4NOTE_WM1811
tristate "SoC I2S Audio support for p4note family boards"
depends on SND_SOC_SAMSUNG
select SND_SAMSUNG_I2S
select SND_SOC_WM8994
help
Say Y if you want to add support for SoC audio on the p4note family boards.

endif #SND_SOC_SAMSUNG
2 changes: 2 additions & 0 deletions sound/soc/samsung/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ snd-soc-arndale-objs := arndale.o
snd-soc-tm2-wm5110-objs := tm2_wm5110.o
snd-soc-aries-wm8994-objs := aries_wm8994.o
snd-soc-midas-wm1811-objs := midas_wm1811.o
snd-soc-p4note-wm1811-objs := p4note_wm1811.o

obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
Expand All @@ -68,3 +69,4 @@ obj-$(CONFIG_SND_SOC_ARNDALE) += snd-soc-arndale.o
obj-$(CONFIG_SND_SOC_SAMSUNG_TM2_WM5110) += snd-soc-tm2-wm5110.o
obj-$(CONFIG_SND_SOC_SAMSUNG_ARIES_WM8994) += snd-soc-aries-wm8994.o
obj-$(CONFIG_SND_SOC_SAMSUNG_MIDAS_WM1811) += snd-soc-midas-wm1811.o
obj-$(CONFIG_SND_SOC_SAMSUNG_P4NOTE_WM1811) += snd-soc-p4note-wm1811.o
Loading

0 comments on commit c1d8e87

Please sign in to comment.