From 9ab3fee861d0c4a617af9be6c94b9dc49b79d68c Mon Sep 17 00:00:00 2001 From: shiguangyuan1029 Date: Tue, 18 Feb 2025 15:47:09 +0800 Subject: [PATCH 1/3] dirver: i2s: implement ma1026 support for ACPI --- sound/soc/codecs/Kconfig | 8 ++++---- sound/soc/codecs/Makefile | 4 ++-- sound/soc/codecs/ma1026.c | 20 +++++++++++++------- sound/soc/phytium/Kconfig | 15 ++++++++------- sound/soc/phytium/Makefile | 6 +++--- sound/soc/phytium/pmdk_ma1026.c | 0 6 files changed, 30 insertions(+), 23 deletions(-) mode change 100644 => 100755 sound/soc/codecs/Kconfig mode change 100644 => 100755 sound/soc/codecs/Makefile mode change 100644 => 100755 sound/soc/phytium/Makefile mode change 100644 => 100755 sound/soc/phytium/pmdk_ma1026.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig old mode 100644 new mode 100755 index 11fe420cf3..365deb65c1 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -182,7 +182,6 @@ config SND_SOC_ALL_CODECS imply SND_SOC_SI476X imply SND_SOC_SIMPLE_AMPLIFIER imply SND_SOC_SIRF_AUDIO_CODEC - imply SND_SOC_MA1026 if I2C imply SND_SOC_SPDIF imply SND_SOC_SSM2305 imply SND_SOC_SSM2518 @@ -840,6 +839,10 @@ config SND_SOC_LOCHNAGAR_SC This driver support the sound card functionality of the Cirrus Logic Lochnagar audio development board. +config SND_SOC_MA1026 + tristate "Cubiclattice MA1026 CODEC" + depends on I2C + config SND_SOC_MADERA tristate default y if SND_SOC_CS47L15=y @@ -1257,9 +1260,6 @@ config SND_SOC_SIRF_AUDIO_CODEC tristate "SiRF SoC internal audio codec" select REGMAP_MMIO -config SND_SOC_MA1026 - tristate "Cubiclattice MA1026 CODEC" - config SND_SOC_SPDIF tristate "S/PDIF CODEC" diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile old mode 100644 new mode 100755 index 344f0bf615..ff15be1667 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -105,6 +105,7 @@ snd-soc-l3-objs := l3.o snd-soc-lm4857-objs := lm4857.o snd-soc-lm49453-objs := lm49453.o snd-soc-lochnagar-sc-objs := lochnagar-sc.o +snd-soc-ma1026-objs := ma1026.o snd-soc-madera-objs := madera.o snd-soc-max9759-objs := max9759.o snd-soc-max9768-objs := max9768.o @@ -198,7 +199,6 @@ snd-soc-sigmadsp-i2c-objs := sigmadsp-i2c.o snd-soc-sigmadsp-regmap-objs := sigmadsp-regmap.o snd-soc-si476x-objs := si476x.o snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o -snd-soc-ma1026-objs := ma1026.o snd-soc-spdif-tx-objs := spdif_transmitter.o snd-soc-spdif-rx-objs := spdif_receiver.o snd-soc-ssm2305-objs := ssm2305.o @@ -417,6 +417,7 @@ obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o obj-$(CONFIG_SND_SOC_LM49453) += snd-soc-lm49453.o obj-$(CONFIG_SND_SOC_LOCHNAGAR_SC) += snd-soc-lochnagar-sc.o +obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_MADERA) += snd-soc-madera.o obj-$(CONFIG_SND_SOC_MAX9759) += snd-soc-max9759.o obj-$(CONFIG_SND_SOC_MAX9768) += snd-soc-max9768.o @@ -510,7 +511,6 @@ obj-$(CONFIG_SND_SOC_SIGMADSP_REGMAP) += snd-soc-sigmadsp-regmap.o obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o obj-$(CONFIG_SND_SOC_SIRF_AUDIO_CODEC) += sirf-audio-codec.o -obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_SSM2305) += snd-soc-ssm2305.o obj-$(CONFIG_SND_SOC_SSM2518) += snd-soc-ssm2518.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o diff --git a/sound/soc/codecs/ma1026.c b/sound/soc/codecs/ma1026.c index c3d6ad74f3..a544d6c088 100755 --- a/sound/soc/codecs/ma1026.c +++ b/sound/soc/codecs/ma1026.c @@ -43,7 +43,7 @@ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ snd_soc_component_update_bits(component, reg, mask, val) -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else #define snd_soc_write_ma1026(codec, addr, value) \ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ @@ -56,7 +56,7 @@ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read32(codec, addr); -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read(codec, addr); #endif @@ -185,7 +185,7 @@ static int ma1026_set_bias_level( struct snd_soc_codec *codec, #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) struct snd_soc_component *codec, -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else struct snd_soc_component *codec, #endif enum snd_soc_bias_level level) @@ -1017,6 +1017,11 @@ static void ma1026_i2c_shutdown(struct i2c_client *client) } } +static const struct i2c_device_id ma1026_id[] = { + {"ma1026", 0}, + {} +}; +MODULE_DEVICE_TABLE(i2c, ma1026_id); static const struct of_device_id ma1026_of_match[] = { {.compatible = "Phytium, ma1026", }, @@ -1025,16 +1030,17 @@ static const struct of_device_id ma1026_of_match[] = { MODULE_DEVICE_TABLE(of, ma1026_of_match); -static const struct i2c_device_id ma1026_id[] = { - {"ma1026", 0}, - {} +static const struct acpi_device_id ma1026_acpi_match[] = { + { "MAMA1026", 0}, + { } }; -MODULE_DEVICE_TABLE(i2c, ma1026_id); +MODULE_DEVICE_TABLE(acpi, ma1026_acpi_match); static struct i2c_driver ma1026_i2c_driver = { .driver = { .name = "ma1026", .of_match_table = ma1026_of_match, + .acpi_match_table = ma1026_acpi_match, }, .probe = ma1026_i2c_probe, .remove = ma1026_i2c_remove, diff --git a/sound/soc/phytium/Kconfig b/sound/soc/phytium/Kconfig index fb394641d0..74e3735b9f 100755 --- a/sound/soc/phytium/Kconfig +++ b/sound/soc/phytium/Kconfig @@ -21,6 +21,14 @@ config SND_PMDK_ES8336 Say Y if you want to add Phytium machine support for ES8336 codecs. +config SND_PMDK_MA1026 + tristate "Phytium machine support with MA1026" + depends on I2C && SND_SOC_PHYTIUM_I2S + select SND_SOC_MA1026 + help + Say Y if you want to add Phytium machine support for + MA1026 codecs. + config SND_PMDK_DP tristate "Phytium machine support with DP" depends on I2C && SND_SOC_PHYTIUM_I2S @@ -28,10 +36,3 @@ config SND_PMDK_DP help Say Y if you want to add Phytium machine support for Displayport. - -config SND_PMDK_MA1026 - tristate "Phytium machine support with MA1026" - depends on I2C && SND_SOC_PHYTIUM_I2S - select SND_SOC_MA1026 - help - Say Y if you want to add Phytium machine support for MA1026 \ No newline at end of file diff --git a/sound/soc/phytium/Makefile b/sound/soc/phytium/Makefile old mode 100644 new mode 100755 index 066ffc3116..cc6d8d2961 --- a/sound/soc/phytium/Makefile +++ b/sound/soc/phytium/Makefile @@ -9,8 +9,8 @@ obj-$(CONFIG_SND_PMDK_ES8388) += snd-soc-pmdk-es8388.o snd-soc-pmdk-es8336-objs :=pmdk_es8336.o obj-$(CONFIG_SND_PMDK_ES8336) += snd-soc-pmdk-es8336.o -snd-soc-pmdk-dp-objs :=pmdk_dp.o -obj-$(CONFIG_SND_PMDK_DP) += snd-soc-pmdk-dp.o - snd-soc-pmdk-ma1026-objs :=pmdk_ma1026.o obj-$(CONFIG_SND_PMDK_MA1026) += snd-soc-pmdk-ma1026.o + +snd-soc-pmdk-dp-objs :=pmdk_dp.o +obj-$(CONFIG_SND_PMDK_DP) += snd-soc-pmdk-dp.o diff --git a/sound/soc/phytium/pmdk_ma1026.c b/sound/soc/phytium/pmdk_ma1026.c old mode 100644 new mode 100755 -- Gitee From c05f465d60c85e132becfbc1d81f90a66a6dfcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E5=85=89=E8=BF=9C?= Date: Tue, 18 Feb 2025 08:11:25 +0000 Subject: [PATCH 2/3] Revert "dirver: i2s: implement ma1026 support for ACPI" This reverts commit 9ab3fee861d0c4a617af9be6c94b9dc49b79d68c. --- sound/soc/codecs/Kconfig | 8 ++++---- sound/soc/codecs/Makefile | 4 ++-- sound/soc/codecs/ma1026.c | 20 +++++++------------- sound/soc/phytium/Kconfig | 15 +++++++-------- sound/soc/phytium/Makefile | 6 +++--- sound/soc/phytium/pmdk_ma1026.c | 0 6 files changed, 23 insertions(+), 30 deletions(-) mode change 100755 => 100644 sound/soc/codecs/Kconfig mode change 100755 => 100644 sound/soc/codecs/Makefile mode change 100755 => 100644 sound/soc/phytium/Makefile mode change 100755 => 100644 sound/soc/phytium/pmdk_ma1026.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig old mode 100755 new mode 100644 index 365deb65c1..11fe420cf3 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -182,6 +182,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_SI476X imply SND_SOC_SIMPLE_AMPLIFIER imply SND_SOC_SIRF_AUDIO_CODEC + imply SND_SOC_MA1026 if I2C imply SND_SOC_SPDIF imply SND_SOC_SSM2305 imply SND_SOC_SSM2518 @@ -839,10 +840,6 @@ config SND_SOC_LOCHNAGAR_SC This driver support the sound card functionality of the Cirrus Logic Lochnagar audio development board. -config SND_SOC_MA1026 - tristate "Cubiclattice MA1026 CODEC" - depends on I2C - config SND_SOC_MADERA tristate default y if SND_SOC_CS47L15=y @@ -1260,6 +1257,9 @@ config SND_SOC_SIRF_AUDIO_CODEC tristate "SiRF SoC internal audio codec" select REGMAP_MMIO +config SND_SOC_MA1026 + tristate "Cubiclattice MA1026 CODEC" + config SND_SOC_SPDIF tristate "S/PDIF CODEC" diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile old mode 100755 new mode 100644 index ff15be1667..344f0bf615 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -105,7 +105,6 @@ snd-soc-l3-objs := l3.o snd-soc-lm4857-objs := lm4857.o snd-soc-lm49453-objs := lm49453.o snd-soc-lochnagar-sc-objs := lochnagar-sc.o -snd-soc-ma1026-objs := ma1026.o snd-soc-madera-objs := madera.o snd-soc-max9759-objs := max9759.o snd-soc-max9768-objs := max9768.o @@ -199,6 +198,7 @@ snd-soc-sigmadsp-i2c-objs := sigmadsp-i2c.o snd-soc-sigmadsp-regmap-objs := sigmadsp-regmap.o snd-soc-si476x-objs := si476x.o snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o +snd-soc-ma1026-objs := ma1026.o snd-soc-spdif-tx-objs := spdif_transmitter.o snd-soc-spdif-rx-objs := spdif_receiver.o snd-soc-ssm2305-objs := ssm2305.o @@ -417,7 +417,6 @@ obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o obj-$(CONFIG_SND_SOC_LM49453) += snd-soc-lm49453.o obj-$(CONFIG_SND_SOC_LOCHNAGAR_SC) += snd-soc-lochnagar-sc.o -obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_MADERA) += snd-soc-madera.o obj-$(CONFIG_SND_SOC_MAX9759) += snd-soc-max9759.o obj-$(CONFIG_SND_SOC_MAX9768) += snd-soc-max9768.o @@ -511,6 +510,7 @@ obj-$(CONFIG_SND_SOC_SIGMADSP_REGMAP) += snd-soc-sigmadsp-regmap.o obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o obj-$(CONFIG_SND_SOC_SIRF_AUDIO_CODEC) += sirf-audio-codec.o +obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_SSM2305) += snd-soc-ssm2305.o obj-$(CONFIG_SND_SOC_SSM2518) += snd-soc-ssm2518.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o diff --git a/sound/soc/codecs/ma1026.c b/sound/soc/codecs/ma1026.c index a544d6c088..c3d6ad74f3 100755 --- a/sound/soc/codecs/ma1026.c +++ b/sound/soc/codecs/ma1026.c @@ -43,7 +43,7 @@ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ snd_soc_component_update_bits(component, reg, mask, val) -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) #define snd_soc_write_ma1026(codec, addr, value) \ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ @@ -56,7 +56,7 @@ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read32(codec, addr); -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read(codec, addr); #endif @@ -185,7 +185,7 @@ static int ma1026_set_bias_level( struct snd_soc_codec *codec, #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) struct snd_soc_component *codec, -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) struct snd_soc_component *codec, #endif enum snd_soc_bias_level level) @@ -1017,11 +1017,6 @@ static void ma1026_i2c_shutdown(struct i2c_client *client) } } -static const struct i2c_device_id ma1026_id[] = { - {"ma1026", 0}, - {} -}; -MODULE_DEVICE_TABLE(i2c, ma1026_id); static const struct of_device_id ma1026_of_match[] = { {.compatible = "Phytium, ma1026", }, @@ -1030,17 +1025,16 @@ static const struct of_device_id ma1026_of_match[] = { MODULE_DEVICE_TABLE(of, ma1026_of_match); -static const struct acpi_device_id ma1026_acpi_match[] = { - { "MAMA1026", 0}, - { } +static const struct i2c_device_id ma1026_id[] = { + {"ma1026", 0}, + {} }; -MODULE_DEVICE_TABLE(acpi, ma1026_acpi_match); +MODULE_DEVICE_TABLE(i2c, ma1026_id); static struct i2c_driver ma1026_i2c_driver = { .driver = { .name = "ma1026", .of_match_table = ma1026_of_match, - .acpi_match_table = ma1026_acpi_match, }, .probe = ma1026_i2c_probe, .remove = ma1026_i2c_remove, diff --git a/sound/soc/phytium/Kconfig b/sound/soc/phytium/Kconfig index 74e3735b9f..fb394641d0 100755 --- a/sound/soc/phytium/Kconfig +++ b/sound/soc/phytium/Kconfig @@ -21,14 +21,6 @@ config SND_PMDK_ES8336 Say Y if you want to add Phytium machine support for ES8336 codecs. -config SND_PMDK_MA1026 - tristate "Phytium machine support with MA1026" - depends on I2C && SND_SOC_PHYTIUM_I2S - select SND_SOC_MA1026 - help - Say Y if you want to add Phytium machine support for - MA1026 codecs. - config SND_PMDK_DP tristate "Phytium machine support with DP" depends on I2C && SND_SOC_PHYTIUM_I2S @@ -36,3 +28,10 @@ config SND_PMDK_DP help Say Y if you want to add Phytium machine support for Displayport. + +config SND_PMDK_MA1026 + tristate "Phytium machine support with MA1026" + depends on I2C && SND_SOC_PHYTIUM_I2S + select SND_SOC_MA1026 + help + Say Y if you want to add Phytium machine support for MA1026 \ No newline at end of file diff --git a/sound/soc/phytium/Makefile b/sound/soc/phytium/Makefile old mode 100755 new mode 100644 index cc6d8d2961..066ffc3116 --- a/sound/soc/phytium/Makefile +++ b/sound/soc/phytium/Makefile @@ -9,8 +9,8 @@ obj-$(CONFIG_SND_PMDK_ES8388) += snd-soc-pmdk-es8388.o snd-soc-pmdk-es8336-objs :=pmdk_es8336.o obj-$(CONFIG_SND_PMDK_ES8336) += snd-soc-pmdk-es8336.o -snd-soc-pmdk-ma1026-objs :=pmdk_ma1026.o -obj-$(CONFIG_SND_PMDK_MA1026) += snd-soc-pmdk-ma1026.o - snd-soc-pmdk-dp-objs :=pmdk_dp.o obj-$(CONFIG_SND_PMDK_DP) += snd-soc-pmdk-dp.o + +snd-soc-pmdk-ma1026-objs :=pmdk_ma1026.o +obj-$(CONFIG_SND_PMDK_MA1026) += snd-soc-pmdk-ma1026.o diff --git a/sound/soc/phytium/pmdk_ma1026.c b/sound/soc/phytium/pmdk_ma1026.c old mode 100755 new mode 100644 -- Gitee From 8151db8628849fea18be9bcd3b1c6bcfc7377870 Mon Sep 17 00:00:00 2001 From: shiguangyuan1029 Date: Tue, 18 Feb 2025 16:22:08 +0800 Subject: [PATCH 3/3] dirver: i2s: implement ma1026 support for ACPI --- sound/soc/codecs/Kconfig | 8 ++++---- sound/soc/codecs/Makefile | 4 ++-- sound/soc/codecs/ma1026.c | 20 +++++++++++++------- sound/soc/phytium/Kconfig | 15 ++++++++------- sound/soc/phytium/Makefile | 6 +++--- sound/soc/phytium/pmdk_ma1026.c | 17 +++++------------ 6 files changed, 35 insertions(+), 35 deletions(-) mode change 100644 => 100755 sound/soc/codecs/Kconfig mode change 100644 => 100755 sound/soc/codecs/Makefile mode change 100644 => 100755 sound/soc/phytium/Makefile mode change 100644 => 100755 sound/soc/phytium/pmdk_ma1026.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig old mode 100644 new mode 100755 index 11fe420cf3..365deb65c1 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -182,7 +182,6 @@ config SND_SOC_ALL_CODECS imply SND_SOC_SI476X imply SND_SOC_SIMPLE_AMPLIFIER imply SND_SOC_SIRF_AUDIO_CODEC - imply SND_SOC_MA1026 if I2C imply SND_SOC_SPDIF imply SND_SOC_SSM2305 imply SND_SOC_SSM2518 @@ -840,6 +839,10 @@ config SND_SOC_LOCHNAGAR_SC This driver support the sound card functionality of the Cirrus Logic Lochnagar audio development board. +config SND_SOC_MA1026 + tristate "Cubiclattice MA1026 CODEC" + depends on I2C + config SND_SOC_MADERA tristate default y if SND_SOC_CS47L15=y @@ -1257,9 +1260,6 @@ config SND_SOC_SIRF_AUDIO_CODEC tristate "SiRF SoC internal audio codec" select REGMAP_MMIO -config SND_SOC_MA1026 - tristate "Cubiclattice MA1026 CODEC" - config SND_SOC_SPDIF tristate "S/PDIF CODEC" diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile old mode 100644 new mode 100755 index 344f0bf615..ff15be1667 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -105,6 +105,7 @@ snd-soc-l3-objs := l3.o snd-soc-lm4857-objs := lm4857.o snd-soc-lm49453-objs := lm49453.o snd-soc-lochnagar-sc-objs := lochnagar-sc.o +snd-soc-ma1026-objs := ma1026.o snd-soc-madera-objs := madera.o snd-soc-max9759-objs := max9759.o snd-soc-max9768-objs := max9768.o @@ -198,7 +199,6 @@ snd-soc-sigmadsp-i2c-objs := sigmadsp-i2c.o snd-soc-sigmadsp-regmap-objs := sigmadsp-regmap.o snd-soc-si476x-objs := si476x.o snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o -snd-soc-ma1026-objs := ma1026.o snd-soc-spdif-tx-objs := spdif_transmitter.o snd-soc-spdif-rx-objs := spdif_receiver.o snd-soc-ssm2305-objs := ssm2305.o @@ -417,6 +417,7 @@ obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o obj-$(CONFIG_SND_SOC_LM49453) += snd-soc-lm49453.o obj-$(CONFIG_SND_SOC_LOCHNAGAR_SC) += snd-soc-lochnagar-sc.o +obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_MADERA) += snd-soc-madera.o obj-$(CONFIG_SND_SOC_MAX9759) += snd-soc-max9759.o obj-$(CONFIG_SND_SOC_MAX9768) += snd-soc-max9768.o @@ -510,7 +511,6 @@ obj-$(CONFIG_SND_SOC_SIGMADSP_REGMAP) += snd-soc-sigmadsp-regmap.o obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o obj-$(CONFIG_SND_SOC_SIRF_AUDIO_CODEC) += sirf-audio-codec.o -obj-$(CONFIG_SND_SOC_MA1026) += snd-soc-ma1026.o obj-$(CONFIG_SND_SOC_SSM2305) += snd-soc-ssm2305.o obj-$(CONFIG_SND_SOC_SSM2518) += snd-soc-ssm2518.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o diff --git a/sound/soc/codecs/ma1026.c b/sound/soc/codecs/ma1026.c index c3d6ad74f3..a544d6c088 100755 --- a/sound/soc/codecs/ma1026.c +++ b/sound/soc/codecs/ma1026.c @@ -43,7 +43,7 @@ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ snd_soc_component_update_bits(component, reg, mask, val) -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else #define snd_soc_write_ma1026(codec, addr, value) \ snd_soc_component_write(codec, addr, value); #define snd_soc_update_ma1026(component, reg, mask, val) \ @@ -56,7 +56,7 @@ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read32(codec, addr); -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else #define snd_soc_read_ma1026(codec, addr) \ snd_soc_component_read(codec, addr); #endif @@ -185,7 +185,7 @@ static int ma1026_set_bias_level( struct snd_soc_codec *codec, #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 00, 0)) struct snd_soc_component *codec, -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 00, 0)) +#else struct snd_soc_component *codec, #endif enum snd_soc_bias_level level) @@ -1017,6 +1017,11 @@ static void ma1026_i2c_shutdown(struct i2c_client *client) } } +static const struct i2c_device_id ma1026_id[] = { + {"ma1026", 0}, + {} +}; +MODULE_DEVICE_TABLE(i2c, ma1026_id); static const struct of_device_id ma1026_of_match[] = { {.compatible = "Phytium, ma1026", }, @@ -1025,16 +1030,17 @@ static const struct of_device_id ma1026_of_match[] = { MODULE_DEVICE_TABLE(of, ma1026_of_match); -static const struct i2c_device_id ma1026_id[] = { - {"ma1026", 0}, - {} +static const struct acpi_device_id ma1026_acpi_match[] = { + { "MAMA1026", 0}, + { } }; -MODULE_DEVICE_TABLE(i2c, ma1026_id); +MODULE_DEVICE_TABLE(acpi, ma1026_acpi_match); static struct i2c_driver ma1026_i2c_driver = { .driver = { .name = "ma1026", .of_match_table = ma1026_of_match, + .acpi_match_table = ma1026_acpi_match, }, .probe = ma1026_i2c_probe, .remove = ma1026_i2c_remove, diff --git a/sound/soc/phytium/Kconfig b/sound/soc/phytium/Kconfig index fb394641d0..74e3735b9f 100755 --- a/sound/soc/phytium/Kconfig +++ b/sound/soc/phytium/Kconfig @@ -21,6 +21,14 @@ config SND_PMDK_ES8336 Say Y if you want to add Phytium machine support for ES8336 codecs. +config SND_PMDK_MA1026 + tristate "Phytium machine support with MA1026" + depends on I2C && SND_SOC_PHYTIUM_I2S + select SND_SOC_MA1026 + help + Say Y if you want to add Phytium machine support for + MA1026 codecs. + config SND_PMDK_DP tristate "Phytium machine support with DP" depends on I2C && SND_SOC_PHYTIUM_I2S @@ -28,10 +36,3 @@ config SND_PMDK_DP help Say Y if you want to add Phytium machine support for Displayport. - -config SND_PMDK_MA1026 - tristate "Phytium machine support with MA1026" - depends on I2C && SND_SOC_PHYTIUM_I2S - select SND_SOC_MA1026 - help - Say Y if you want to add Phytium machine support for MA1026 \ No newline at end of file diff --git a/sound/soc/phytium/Makefile b/sound/soc/phytium/Makefile old mode 100644 new mode 100755 index 066ffc3116..cc6d8d2961 --- a/sound/soc/phytium/Makefile +++ b/sound/soc/phytium/Makefile @@ -9,8 +9,8 @@ obj-$(CONFIG_SND_PMDK_ES8388) += snd-soc-pmdk-es8388.o snd-soc-pmdk-es8336-objs :=pmdk_es8336.o obj-$(CONFIG_SND_PMDK_ES8336) += snd-soc-pmdk-es8336.o -snd-soc-pmdk-dp-objs :=pmdk_dp.o -obj-$(CONFIG_SND_PMDK_DP) += snd-soc-pmdk-dp.o - snd-soc-pmdk-ma1026-objs :=pmdk_ma1026.o obj-$(CONFIG_SND_PMDK_MA1026) += snd-soc-pmdk-ma1026.o + +snd-soc-pmdk-dp-objs :=pmdk_dp.o +obj-$(CONFIG_SND_PMDK_DP) += snd-soc-pmdk-dp.o diff --git a/sound/soc/phytium/pmdk_ma1026.c b/sound/soc/phytium/pmdk_ma1026.c old mode 100644 new mode 100755 index 508163b5e4..a63b0fad68 --- a/sound/soc/phytium/pmdk_ma1026.c +++ b/sound/soc/phytium/pmdk_ma1026.c @@ -38,13 +38,13 @@ static const struct snd_soc_dapm_route pmdk_ma1026_audio_map[] = { SND_SOC_DAILINK_DEFS(pmdk_ma1026, DAILINK_COMP_ARRAY(COMP_CPU("phytium-i2s-lsd")), - DAILINK_COMP_ARRAY(COMP_CODEC("i2c-MA1026:00", "ma1026-hifi")), + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-MAMA1026:00", "ma1026-asp")), DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy"))); static struct snd_soc_dai_link pmdk_dai[] = { { - .name = "MA1026 HIFI", - .stream_name = "MA1026 HIFI", + .name = "MA1026 ASP", + .stream_name = "MA1026 ASP", .dai_fmt = PMDK_DAI_FMT, SND_SOC_DAILINK_REG(pmdk_ma1026), }, @@ -55,13 +55,6 @@ static struct snd_soc_card pmdk = { .owner = THIS_MODULE, .dai_link = pmdk_dai, .num_links = ARRAY_SIZE(pmdk_dai), - - .dapm_widgets = pmdk_ma1026_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(pmdk_ma1026_dapm_widgets), - .controls = pmdk_ma1026_controls, - .num_controls = ARRAY_SIZE(pmdk_ma1026_controls), - .dapm_routes = pmdk_ma1026_audio_map, - .num_dapm_routes = ARRAY_SIZE(pmdk_ma1026_audio_map), }; static int pmdk_sound_probe(struct platform_device *pdev) @@ -98,6 +91,6 @@ static struct platform_driver pmdk_sound_driver = { module_platform_driver(pmdk_sound_driver); -MODULE_AUTHOR("harry guo "); -MODULE_DESCRIPTION("ALSA SoC PMDK CL1026"); +MODULE_AUTHOR("Shi Guangyuan "); +MODULE_DESCRIPTION("ALSA SoC PMDK MA1026"); MODULE_LICENSE("GPL"); -- Gitee