Merge branch 'odroidg12-4.9.y'

This commit is contained in:
Mauro (mdrjr) Ribeiro
2020-04-21 14:46:36 -03:00
9 changed files with 161 additions and 42 deletions

View File

@@ -5,8 +5,8 @@ on the board).
Required properties:
- compatible : One of "ti,pcm5121", "ti,pcm5122", "ti,pcm5141" or
"ti,pcm5142"
- compatible : One of "ti,pcm5121", "ti,pcm5122", "ti,pcm5141",
"ti,pcm5142" or "ti,pcm5242"
- reg : the I2C address of the device for I2C, the chip select
number for SPI.

View File

@@ -616,11 +616,16 @@
};
/* Audio Related start */
dummy_codec:dummy{
spdif_dit:spdif_dit{
compatible = "linux,spdif-dit";
#sound-dai-cells = <0>;
compatible = "amlogic, aml_dummy_codec";
status = "okay";
};
pcm5102a: pcm5102a {
compatible = "ti,pcm5102a";
#sound-dai-cells = <0>;
status = "disabled";
};
amlogic_codec:t9015{
#sound-dai-cells = <0>;
compatible = "amlogic, aml_codec_T9015";
@@ -628,7 +633,7 @@
is_auge_used = <1>; /* meson or auge chipset used */
tocodec_inout = <0>;
tdmout_index = <2>;
status = "okay";
status = "disabled";
};
audio_effect:eqdrc{
/*eq_enable = <1>;*/
@@ -646,9 +651,10 @@
/* max 0xff, each bit for one channel */
channel_mask = <0x3>;
};
auge_sound {
odroid_hdmi:odroid_hdmi {
compatible = "amlogic, g12a-sound-card";
aml-audio-card,name = "AML-AUGESOUND";
aml-audio-card,name = "ODROID-HDMI";
status = "okay";
/* ODROID-C4: spdif_out GPIOAO_10(J7.2), HDMI out*/
aml-audio-card,dai-link@0 {
@@ -659,12 +665,17 @@
system-clock-frequency = <6144000>;
};
codec {
sound-dai = <&dummy_codec>;
sound-dai = <&spdif_dit>;
};
};
};
odroid_hifi:odroid_hifi {
compatible = "amlogic, g12a-sound-card";
aml-audio-card,name = "ODROID-HIFI";
status = "disabled";
/* ODROID-C4: I2S out(J7)*/
aml-audio-card,dai-link@1 {
aml-audio-card,dai-link@0 {
format = "i2s";
mclk-fs = <256>;
bitclock-master = <&tdmb>;
@@ -678,7 +689,31 @@
system-clock-frequency = <12288000>;
};
codec {
sound-dai = <&dummy_codec>;
sound-dai = <&pcm5102a>;
};
};
};
odroid_hifi2:odroid_hifi2 {
compatible = "amlogic, g12a-sound-card";
aml-audio-card,name = "ODROID-HIFI2";
status = "disabled";
/* ODROID-C4: I2S out(J7)*/
aml-audio-card,dai-link@0 {
format = "i2s";
mclk-fs = <256>;
bitclock-master = <&tdmb>;
frame-master = <&tdmb>;
continuous-clock;
cpu {
sound-dai = <&tdmb>;
dai-tdm-slot-tx-mask = <1 1>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
system-clock-frequency = <12288000>;
};
codec {
sound-dai = <&pcm5242>;
};
};
};
@@ -779,8 +814,8 @@
compatible = "amlogic, sm1-snd-tdmb";
#sound-dai-cells = <0>;
dai-tdm-lane-slot-mask-out = <1 0 0 0>;
dai-tdm-clk-sel = <0>;
clocks = <&clkaudio CLKID_AUDIO_MCLK_A
dai-tdm-clk-sel = <1>;
clocks = <&clkaudio CLKID_AUDIO_MCLK_B
&clkc CLKID_MPLL0>;
clock-names = "mclk", "clk_srcpll";
pinctrl-names = "tdm_pins";
@@ -811,6 +846,69 @@
};
}; /* end of audiobus */
&gpio {
gpio-line-names =
/* GPIOV */
"",
/* GPIOZ */
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
/* GPIOH */
"", "", "", "", "",
"PIN_36", /* GPIOH_5 */
"PIN_26", /* GPIOH_6 */
"PIN_32", /* GPIOH_7 */
"",
/* BOOT */
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
/* GPIOC */
"", "", "", "", "", "", "", "",
/* GPIOA */
"", "", "", "", "", "", "", "",
"", "", "", "", "", "",
"PIN_27", /* GPIOA_14 */
"PIN_28", /* GPIOA_15 */
/* GPIOX */
"PIN_16", /* GPIOX_0 */
"PIN_18", /* GPIOX_1 */
"PIN_22", /* GPIOX_2 */
"PIN_11", /* GPIOX_3 */
"PIN_13", /* GPIOX_4 */
"PIN_7", /* GPIOX_5 */
"PIN_33", /* GPIOX_6 */
"PIN_15", /* GPIOX_7 */
"PIN_19", /* GPIOX_8 */
"PIN_21", /* GPIOX_9 */
"PIN_24", /* GPIOX_10 */
"PIN_23", /* GPIOX_11 */
"PIN_8", /* GPIOX_12 */
"PIN_10", /* GPIOX_13 */
"PIN_29", /* GPIOX_14 */
"PIN_31", /* GPIOX_15 */
"PIN_12", /* GPIOX_16 */
"PIN_3", /* GPIOX_17 */
"PIN_5", /* GPIOX_18 */
"PIN_35"; /* GPIOX_19 */
};
&gpio_ao {
gpio-line-names =
/* GPIOAO */
"", "", "", "",
"PIN_47", /* GPIOAO_4 */
"", "",
"PIN_45", /* GPIOAO_7 */
"PIN_46", /* GPIOAO_8 */
"PIN_44", /* GPIOAO_9 */
"PIN_42", /* GPIOAO_10 */
"",
/* GPIOE */
"", "", "",
/* GPIO_TEST_N */
"";
};
&uart_A {
status = "okay";
};
@@ -900,7 +998,7 @@
}; /* end of pinctrl_aobus */
&spicc0 {
status = "disabled";
status = "okay";
/*
40 Pin Header : MOSI(GPIOX.8->19 Pin), MISO(GPIOX.9->21 Pin),
@@ -924,7 +1022,7 @@
};
spidev@0 {
status = "disabled";
status = "okay";
compatible = "linux,spidev";
/* spi default max clock 100Mhz */
@@ -986,13 +1084,24 @@
};
&i2c2 {
status = "disabled";
pcf8563: rtc@51 {
status = "disabled";
compatible = "nxp,pcf8563";
reg = <0x51>;
};
pcm5242: pcm5242@4c {
compatible = "ti,pcm5242";
reg = <0x4c>;
#sound-dai-cells = <0>;
status = "disabled";
/*
AVDD-supply = <&reg_3v3_analog>;
DVDD-supply = <&reg_1v8>;
CPVDD-supply = <&reg_3v3>;
*/
};
};
&i2c3 {

View File

@@ -22,10 +22,10 @@
serial2 = &uart_B;
serial3 = &uart_C;
serial4 = &uart_AO_B;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
i2c0 = &i2c2;
i2c1 = &i2c3;
i2c2 = &i2c0;
i2c3 = &i2c1;
i2c4 = &i2c_AO;
tsensor0 = &p_tsensor;
tsensor1 = &d_tsensor;
@@ -173,6 +173,14 @@
clock-frequency = <100000>; /* default 100k */
};
&a_uart_pins {
mux {
groups = "uart_tx_a",
"uart_rx_a";
function = "uart_a";
};
};
&usb2_phy_v2 {
status = "okay";
portnum = <2>;

View File

@@ -4523,7 +4523,9 @@ CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
CONFIG_SND_SOC_PCM5102A=y
CONFIG_SND_SOC_PCM512x=y
CONFIG_SND_SOC_PCM512x_I2C=y
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set

View File

@@ -465,9 +465,6 @@ static int set_disp_mode_auto(void)
/* vic_ready got from IP */
enum hdmi_vic vic_ready = hdev->hwop.getstate(
hdev, STAT_VIDEO_VIC, 0);
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
char *now = strstr(hdmitx_device.fmt_attr, "now");
#endif
memset(mode, 0, sizeof(mode));
hdev->ready = 0;
@@ -555,12 +552,6 @@ static int set_disp_mode_auto(void)
else {
/* nothing */
}
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
if (!now)
vic_ready = vic;
#endif
if ((vic_ready != HDMI_Unknown) && (vic_ready == vic)) {
pr_info(SYS "[%s] ALREADY init VIC = %d\n",
__func__, vic);
@@ -598,11 +589,6 @@ static int set_disp_mode_auto(void)
hdmitx_pre_display_init();
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
if (now)
memset(now, ' ', 3);
#endif
hdev->cur_VIC = HDMI_Unknown;
/* if vic is HDMI_Unknown, hdmitx_set_display will disable HDMI */
ret = hdmitx_set_display(hdev, vic);
@@ -683,12 +669,6 @@ ssize_t store_attr(struct device *dev,
hdmitx_device.para->cs = COLORSPACE_YUV420;
else
hdmitx_device.para->cs = COLORSPACE_YUV444;
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
if (strstr(hdmitx_device.fmt_attr, "now"))
set_disp_mode_auto();
#endif
return count;
}
/*aud_mode attr*/

View File

@@ -202,6 +202,12 @@ static void do_aml_restart(enum reboot_mode reboot_mode, const char *cmd)
static void do_aml_poweroff(void)
{
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
if (!board_is_odroidn2())
odroidc4_card_reset();
else
odroidn2_card_reset();
#endif
/* TODO: Add poweroff capability */
__invoke_psci_fn_smc(0x82000042, 1, 0, 0);
__invoke_psci_fn_smc(psci_function_id_poweroff,

View File

@@ -325,7 +325,18 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
ifeq ($(CONFIG_AMLOGIC_MODIFY),y)
ifeq ($(CONFIG_ARCH_MESON64_ODROID_COMMON),y)
quiet_cmd_dtco = DTCO $@
cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -@ -H epapr -O dtb -o $@ -b 0 -@ \
-i $(dir $<) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
$(obj)/%.dtbo: $(src)/%.dts FORCE
$(call if_changed_dep,dtco)
else ifeq ($(CONFIG_AMLOGIC_MODIFY),y)
$(obj)/%.dtbo: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
endif

View File

@@ -1,5 +1,6 @@
menuconfig AMLOGIC_SND_SOC_AUGE
bool "Amlogic Auge ASoC"
select SND_SOC_PCM5102A
default n
help
Say Y or M if you want to add support for codecs attached to

View File

@@ -48,6 +48,7 @@ static const struct i2c_device_id pcm512x_i2c_id[] = {
{ "pcm5122", },
{ "pcm5141", },
{ "pcm5142", },
{ "pcm5242", },
{ }
};
MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id);
@@ -57,6 +58,7 @@ static const struct of_device_id pcm512x_of_match[] = {
{ .compatible = "ti,pcm5122", },
{ .compatible = "ti,pcm5141", },
{ .compatible = "ti,pcm5142", },
{ .compatible = "ti,pcm5242", },
{ }
};
MODULE_DEVICE_TABLE(of, pcm512x_of_match);