From f225e61a67565d788cd4589687cab054dc62c3a0 Mon Sep 17 00:00:00 2001 From: Jamie Coldhill Date: Mon, 19 Sep 2016 23:32:28 +0800 Subject: [PATCH 1/4] Odroid_C2: bump Linux to 3b08361 --- packages/linux/package.mk | 2 +- ...port-HiFi-Shield-2-sound-card-driver.patch | 1439 +++++++++++++++++ ...ly-working-frequecies-and-bit-depths.patch | 44 + 3 files changed, 1484 insertions(+), 1 deletion(-) create mode 100644 projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch create mode 100644 projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch diff --git a/packages/linux/package.mk b/packages/linux/package.mk index fb9b9ed557..833e4b56d6 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -31,7 +31,7 @@ PKG_SHORTDESC="linux26: The Linux kernel 2.6 precompiled kernel binary image and PKG_LONGDESC="This package contains a precompiled kernel image and the modules." case "$LINUX" in hardkernel) - PKG_VERSION="365fa20" + PKG_VERSION="3b08361" PKG_URL="https://github.com/hardkernel/linux/archive/$PKG_VERSION.tar.gz" ;; amlogic-3.10) diff --git a/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch b/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch new file mode 100644 index 0000000000..f0cd741880 --- /dev/null +++ b/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch @@ -0,0 +1,1439 @@ +From 37a2854ffecfec548156a7fb8b2b43467f452abd Mon Sep 17 00:00:00 2001 +From: Jamie Coldhill +Date: Mon, 19 Sep 2016 12:44:56 +0800 +Subject: [PATCH] Revert "odroid-c2:Support HiFi-Shield-2 sound card driver." + +This reverts commit 5bcf1b74aac7ec16eb5bc78f34c6b4ec3fbe7a9e. +--- + .../devicetree/bindings/sound/pcm512x.txt | 52 -- + arch/arm64/boot/dts/meson64_odroidc2.dts | 8 - + arch/arm64/configs/odroidc2_defconfig | 6 +- + sound/soc/aml/m8/Kconfig | 5 - + sound/soc/aml/m8/Makefile | 2 - + sound/soc/aml/m8/odroid_dac2.c | 217 -------- + sound/soc/aml/m8/odroid_dac2.h | 31 -- + sound/soc/codecs/Kconfig | 17 - + sound/soc/codecs/Makefile | 6 - + sound/soc/codecs/pcm512x-i2c.c | 81 --- + sound/soc/codecs/pcm512x-spi.c | 72 --- + sound/soc/codecs/pcm512x.c | 609 --------------------- + sound/soc/codecs/pcm512x.h | 171 ------ + 13 files changed, 1 insertion(+), 1276 deletions(-) + delete mode 100644 Documentation/devicetree/bindings/sound/pcm512x.txt + delete mode 100644 sound/soc/aml/m8/odroid_dac2.c + delete mode 100644 sound/soc/aml/m8/odroid_dac2.h + delete mode 100644 sound/soc/codecs/pcm512x-i2c.c + delete mode 100644 sound/soc/codecs/pcm512x-spi.c + delete mode 100644 sound/soc/codecs/pcm512x.c + delete mode 100644 sound/soc/codecs/pcm512x.h + +diff --git a/Documentation/devicetree/bindings/sound/pcm512x.txt b/Documentation/devicetree/bindings/sound/pcm512x.txt +deleted file mode 100644 +index 3aae3b4..0000000 +--- a/Documentation/devicetree/bindings/sound/pcm512x.txt ++++ /dev/null +@@ -1,52 +0,0 @@ +-PCM512x audio CODECs +- +-These devices support both I2C and SPI (configured with pin strapping +-on the board). +- +-Required properties: +- +- - compatible : One of "ti,pcm5121", "ti,pcm5122", "ti,pcm5141" or +- "ti,pcm5142" +- +- - reg : the I2C address of the device for I2C, the chip select +- number for SPI. +- +- - AVDD-supply, DVDD-supply, and CPVDD-supply : power supplies for the +- device, as covered in bindings/regulator/regulator.txt +- +-Optional properties: +- +- - clocks : A clock specifier for the clock connected as SCLK. If this +- is absent the device will be configured to clock from BCLK. If pll-in +- and pll-out are specified in addition to a clock, the device is +- configured to accept clock input on a specified gpio pin. +- +- - pll-in, pll-out : gpio pins used to connect the pll using <1> +- through <6>. The device will be configured for clock input on the +- given pll-in pin and PLL output on the given pll-out pin. An +- external connection from the pll-out pin to the SCLK pin is assumed. +- +-Examples: +- +- pcm5122: pcm5122@4c { +- compatible = "ti,pcm5122"; +- reg = <0x4c>; +- +- AVDD-supply = <®_3v3_analog>; +- DVDD-supply = <®_1v8>; +- CPVDD-supply = <®_3v3>; +- }; +- +- +- pcm5142: pcm5142@4c { +- compatible = "ti,pcm5142"; +- reg = <0x4c>; +- +- AVDD-supply = <®_3v3_analog>; +- DVDD-supply = <®_1v8>; +- CPVDD-supply = <®_3v3>; +- +- clocks = <&sck>; +- pll-in = <3>; +- pll-out = <6>; +- }; +diff --git a/arch/arm64/boot/dts/meson64_odroidc2.dts b/arch/arm64/boot/dts/meson64_odroidc2.dts +index 48310c9..5f64ee3 100755 +--- a/arch/arm64/boot/dts/meson64_odroidc2.dts ++++ b/arch/arm64/boot/dts/meson64_odroidc2.dts +@@ -647,14 +647,6 @@ + sound-dai = <&pcm5102_codec>; + }; + }; +- +- odroid_dac2{ +- compatible = "sound_card, odroid_dac2"; +- aml,sound_card = "ODROID-DAC2"; +- pinctrl-names = "odroid_i2s"; +- pinctrl-0 = <&audio_pins>; +- status = "okay"; +- }; + /* END OF AUDIO board specific */ + + aml_sensor0: aml-sensor@0 { +diff --git a/arch/arm64/configs/odroidc2_defconfig b/arch/arm64/configs/odroidc2_defconfig +index c9ca9b4..079f956 100644 +--- a/arch/arm64/configs/odroidc2_defconfig ++++ b/arch/arm64/configs/odroidc2_defconfig +@@ -1,6 +1,6 @@ + # + # Automatically generated file; DO NOT EDIT. +-# Linux/arm64 3.14.77 Kernel Configuration ++# Linux/arm64 3.14.65 Kernel Configuration + # + CONFIG_ARM64=y + CONFIG_ARM64_HAS_SG_CHAIN=y +@@ -3285,13 +3285,9 @@ CONFIG_SND_AML_M8_SOC=y + # CONFIG_SND_AML_M8 is not set + CONFIG_SND_ODROID_HDMI=y + CONFIG_SND_ODROID_DAC=m +-CONFIG_SND_ODROID_DAC2=m + # CONFIG_SND_AML_G9TV is not set + CONFIG_SND_SOC_I2C_AND_SPI=y + CONFIG_SND_SOC_PCM5102=m +-CONFIG_SND_SOC_PCM512x=m +-CONFIG_SND_SOC_PCM512x_I2C=m +-# CONFIG_SND_SOC_PCM512x_SPI is not set + # CONFIG_SND_SIMPLE_CARD is not set + # CONFIG_SOUND_PRIME is not set + CONFIG_AC97_BUS=m +diff --git a/sound/soc/aml/m8/Kconfig b/sound/soc/aml/m8/Kconfig +index c1808a4..4adfb7d 100644 +--- a/sound/soc/aml/m8/Kconfig ++++ b/sound/soc/aml/m8/Kconfig +@@ -20,11 +20,6 @@ menuconfig SND_ODROID_DAC + depends on SND_AML_M8_SOC + select SND_SOC_PCM5102 + +-menuconfig SND_ODROID_DAC2 +- tristate "ODROID HiFi-Shield2(pcm5242) Support" +- depends on SND_AML_M8_SOC +- select SND_SOC_PCM512x_I2C +- + menuconfig SND_AML_G9TV + tristate "AML-SND-G9TV Board" + depends on SND_AML_M8_SOC && SWITCH +diff --git a/sound/soc/aml/m8/Makefile b/sound/soc/aml/m8/Makefile +index e7310ed..2ed8755 100644 +--- a/sound/soc/aml/m8/Makefile ++++ b/sound/soc/aml/m8/Makefile +@@ -27,10 +27,8 @@ obj-$(CONFIG_SND_AML_M8) += snd-soc-aml-m8.o + #ODROID Machine support + snd-soc-odroid-hdmi-objs := odroid_hdmi.o + snd-soc-odroid-dac-objs := odroid_dac.o +-snd-soc-odroid-dac2-objs := odroid_dac2.o + obj-$(CONFIG_SND_ODROID_HDMI) += snd-soc-odroid-hdmi.o + obj-$(CONFIG_SND_ODROID_DAC) += snd-soc-odroid-dac.o +-obj-$(CONFIG_SND_ODROID_DAC2) += snd-soc-odroid-dac2.o + + #AML G9TV Machine support + snd-soc-aml-g9tv-objs := aml_g9tv.o +diff --git a/sound/soc/aml/m8/odroid_dac2.c b/sound/soc/aml/m8/odroid_dac2.c +deleted file mode 100644 +index fb8c153..0000000 +--- a/sound/soc/aml/m8/odroid_dac2.c ++++ /dev/null +@@ -1,217 +0,0 @@ +-/* +- * sound/soc/aml/m8/aml_m8.c +- * +- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but WITHOUT +- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +- * more details. +- * +-*/ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-/* #include */ +-#include +-#include +-/* #include */ +-#include +- +-/* #include "aml_i2s_dai.h" */ +-#include "aml_i2s.h" +-#include "odroid_dac2.h" +-#include "aml_audio_hw.h" +-#include +-#include +-#include +-#include +-#include +-#include +-/* extern struct device *spdif_dev; */ +- +-#define DRV_NAME "odroid_dac2" +- +-static int dac2_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params) +-{ +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_dai *codec_dai = rtd->codec_dai; +- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; +- int ret; +- +- /* set codec DAI configuration */ +- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | +- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); +- if (ret < 0) +- return ret; +- +- /* set cpu DAI configuration */ +- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | +- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); +- if (ret < 0) +- return ret; +- +- /* set cpu DAI clock */ +- ret = snd_soc_dai_set_sysclk( +- cpu_dai, 0, params_rate(params)*256, SND_SOC_CLOCK_OUT); +- if (ret < 0) +- return ret; +- return 0; +-} +- +-static struct snd_soc_ops odroid_ops = { +- .hw_params = dac2_hw_params, +-}; +- +-static int dac2_set_bias_level(struct snd_soc_card *card, +- struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) +-{ +- int ret = 0; +- struct dac2_private_data *p_dac2; +- +- p_dac2 = snd_soc_card_get_drvdata(card); +- if (p_dac2->bias_level == (int)level) +- return 0; +- +- p_dac2->bias_level = (int)level; +- return ret; +-} +-static struct snd_soc_dai_link dac2_dai_link[] = { +- { +- .name = "SND_PCM5242", +- .stream_name = "I2S", +- .cpu_dai_name = "I2S", +- .platform_name = "i2s_platform", +- .codec_name = "pcm512x.1-004c", +- .codec_dai_name = "pcm512x-hifi", +- .ops = &odroid_ops, +- }, +-}; +- +-static struct snd_soc_card aml_snd_soc_card = { +- .driver_name = "SOC-Audio", +- .dai_link = &dac2_dai_link[0], +- .num_links = ARRAY_SIZE(dac2_dai_link), +- .set_bias_level = dac2_set_bias_level, +-}; +- +-static int dac2_probe(struct platform_device *pdev) +-{ +- struct snd_soc_card *card = &aml_snd_soc_card; +- struct dac2_private_data *p_dac2; +- int ret = 0; +- +-#ifdef CONFIG_OF +- p_dac2 = devm_kzalloc(&pdev->dev, +- sizeof(struct dac2_private_data), GFP_KERNEL); +- if (!p_dac2) { +- dev_err(&pdev->dev, "Can't allocate dac2_private_data\n"); +- ret = -ENOMEM; +- goto err; +- } +- +- card->dev = &pdev->dev; +- platform_set_drvdata(pdev, card); +- snd_soc_card_set_drvdata(card, p_dac2); +- if (!(pdev->dev.of_node)) { +- dev_err(&pdev->dev, "Must be instantiated using device tree\n"); +- ret = -EINVAL; +- goto err; +- } +- ret = of_property_read_string(pdev->dev.of_node, +- "pinctrl-names", +- &p_dac2->pinctrl_name); +- p_dac2->pin_ctl = +- devm_pinctrl_get_select(&pdev->dev, p_dac2->pinctrl_name); +- +- ret = snd_soc_of_parse_card_name(card, "aml,sound_card"); +- if (ret) +- goto err; +- +- ret = snd_soc_register_card(card); +- if (ret) { +- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", +- ret); +- goto err; +- } +- return 0; +-#endif +- +-err: +- return ret; +-} +- +-static int dac2_remove(struct platform_device *pdev) +-{ +- struct snd_soc_card *card = platform_get_drvdata(pdev); +- struct dac2_private_data *p_dac2; +- +- p_dac2 = snd_soc_card_get_drvdata(card); +- if (p_dac2->pin_ctl) +- devm_pinctrl_put(p_dac2->pin_ctl); +- +- snd_soc_unregister_card(card); +- return 0; +-} +- +-#ifdef CONFIG_USE_OF +-static const struct of_device_id dac2_dt_match[] = { +- { .compatible = "sound_card, odroid_dac2", }, +- {}, +-}; +-#else +-#define dac2_dt_match NULL +-#endif +- +-static struct platform_driver dac2_driver = { +- .probe = dac2_probe, +- .remove = dac2_remove, +- .driver = { +- .name = DRV_NAME, +- .owner = THIS_MODULE, +- .pm = &snd_soc_pm_ops, +- .of_match_table = dac2_dt_match, +- }, +-}; +- +-static int __init dac2_init(void) +-{ +- return platform_driver_register(&dac2_driver); +-} +- +-static void __exit dac2_exit(void) +-{ +- platform_driver_unregister(&dac2_driver); +-} +- +-#ifdef CONFIG_DEFERRED_MODULE_INIT +-deferred_module_init(dac2_init); +-#else +-module_init(dac2_init); +-#endif +-module_exit(dac2_exit); +- +-/* Module information */ +-MODULE_AUTHOR("Hardkernel, Inc."); +-MODULE_DESCRIPTION("ODROID HiFi Shield-2 Asoc driver"); +-MODULE_LICENSE("GPL"); +-MODULE_ALIAS("platform:" DRV_NAME); +diff --git a/sound/soc/aml/m8/odroid_dac2.h b/sound/soc/aml/m8/odroid_dac2.h +deleted file mode 100644 +index d5b830d..0000000 +--- a/sound/soc/aml/m8/odroid_dac2.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/* +- * sound/soc/aml/m8/aml_m8.h +- * +- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but WITHOUT +- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +- * more details. +- * +-*/ +- +-#ifndef AML_M8_H +-#define AML_M8_H +- +-#include +-#include +-struct dac2_private_data { +- int bias_level; +- const char *pinctrl_name; +- struct pinctrl *pin_ctl; +- void *data; +-}; +- +-#endif +- +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index c8b16fb..e9ab5e1 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -135,8 +135,6 @@ config SND_SOC_ALL_CODECS + select SND_SOC_DUMMY_CODEC + select SND_SOC_PCM2BT + select SND_SOC_PCM5102 +- select SND_SOC_PCM512x_I2C if I2C +- select SND_SOC_PCM512x_SPI if SPI_MASTER + help + Normally ASoC codec drivers are only built if a machine driver which + uses them is also built since they are only usable with a machine +@@ -568,18 +566,3 @@ config SND_SOC_PCM2BT + + config SND_SOC_PCM5102 + tristate +- +-config SND_SOC_PCM512x +- tristate +- +-config SND_SOC_PCM512x_I2C +- tristate "Texas Instruments PCM512x CODECs - I2C" +- depends on I2C +- select SND_SOC_PCM512x +- select REGMAP_I2C +- +-config SND_SOC_PCM512x_SPI +- tristate "Texas Instruments PCM512x CODECs - SPI" +- depends on SPI_MASTER +- select SND_SOC_PCM512x +- select REGMAP_SPI +diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile +index 8400601..9e024d9 100644 +--- a/sound/soc/codecs/Makefile ++++ b/sound/soc/codecs/Makefile +@@ -127,9 +127,6 @@ snd-soc-wm-hubs-objs := wm_hubs.o + snd-soc-dummy_codec-objs := dummy_codec.o + snd-soc-pcm2bt-objs := pcm2bt.o + snd-soc-pcm5102-objs := pcm5102.o +-snd-soc-pcm512x-objs := pcm512x.o +-snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o +-snd-soc-pcm512x-spi-objs := pcm512x-spi.o + + # Amp + snd-soc-max9877-objs := max9877.o +@@ -263,9 +260,6 @@ obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o + obj-$(CONFIG_SND_SOC_DUMMY_CODEC) += snd-soc-dummy_codec.o + obj-$(CONFIG_SND_SOC_PCM2BT) += snd-soc-pcm2bt.o + obj-$(CONFIG_SND_SOC_PCM5102) += snd-soc-pcm5102.o +-obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o +-obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o +-obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o + + # Amp + obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o +diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c +deleted file mode 100644 +index 970eb8b..0000000 +--- a/sound/soc/codecs/pcm512x-i2c.c ++++ /dev/null +@@ -1,81 +0,0 @@ +-/* +- * Driver for the PCM512x CODECs +- * +- * Author: Mark Brown +- * Copyright 2014 Linaro Ltd +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +-#include +- +-#include "pcm512x.h" +- +-static int pcm512x_i2c_probe(struct i2c_client *i2c, +- const struct i2c_device_id *id) +-{ +- struct regmap *regmap; +- struct regmap_config config = pcm512x_regmap; +- +- /* msb needs to be set to enable auto-increment of addresses */ +- config.read_flag_mask = 0x80; +- config.write_flag_mask = 0x80; +- +- regmap = devm_regmap_init_i2c(i2c, &config); +- if (IS_ERR(regmap)) +- return PTR_ERR(regmap); +- +- return pcm512x_probe(&i2c->dev, regmap); +-} +- +-static int pcm512x_i2c_remove(struct i2c_client *i2c) +-{ +- pcm512x_remove(&i2c->dev); +- return 0; +-} +- +-static const struct i2c_device_id pcm512x_i2c_id[] = { +- { "pcm5121", }, +- { "pcm5122", }, +- { "pcm5141", }, +- { "pcm5142", }, +- { "pcm5242", }, +- { } +-}; +-MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id); +- +-static const struct of_device_id pcm512x_of_match[] = { +- { .compatible = "ti,pcm5121", }, +- { .compatible = "ti,pcm5122", }, +- { .compatible = "ti,pcm5141", }, +- { .compatible = "ti,pcm5142", }, +- { .compatible = "ti,pcm5242", }, +- { } +-}; +-MODULE_DEVICE_TABLE(of, pcm512x_of_match); +- +-static struct i2c_driver pcm512x_i2c_driver = { +- .probe = pcm512x_i2c_probe, +- .remove = pcm512x_i2c_remove, +- .id_table = pcm512x_i2c_id, +- .driver = { +- .name = "pcm512x", +- .of_match_table = pcm512x_of_match, +- .pm = &pcm512x_pm_ops, +- }, +-}; +- +-module_i2c_driver(pcm512x_i2c_driver); +- +-MODULE_DESCRIPTION("ASoC PCM512x codec driver - I2C"); +-MODULE_AUTHOR("Mark Brown "); +-MODULE_LICENSE("GPL v2"); +diff --git a/sound/soc/codecs/pcm512x-spi.c b/sound/soc/codecs/pcm512x-spi.c +deleted file mode 100644 +index 712ed65..0000000 +--- a/sound/soc/codecs/pcm512x-spi.c ++++ /dev/null +@@ -1,72 +0,0 @@ +-/* +- * Driver for the PCM512x CODECs +- * +- * Author: Mark Brown +- * Copyright 2014 Linaro Ltd +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +-#include +- +-#include "pcm512x.h" +- +-static int pcm512x_spi_probe(struct spi_device *spi) +-{ +- struct regmap *regmap; +- int ret; +- +- regmap = devm_regmap_init_spi(spi, &pcm512x_regmap); +- if (IS_ERR(regmap)) { +- ret = PTR_ERR(regmap); +- return ret; +- } +- +- return pcm512x_probe(&spi->dev, regmap); +-} +- +-static int pcm512x_spi_remove(struct spi_device *spi) +-{ +- pcm512x_remove(&spi->dev); +- return 0; +-} +- +-static const struct spi_device_id pcm512x_spi_id[] = { +- { "pcm5121", }, +- { "pcm5122", }, +- { "pcm5141", }, +- { "pcm5142", }, +- { }, +-}; +-MODULE_DEVICE_TABLE(spi, pcm512x_spi_id); +- +-static const struct of_device_id pcm512x_of_match[] = { +- { .compatible = "ti,pcm5121", }, +- { .compatible = "ti,pcm5122", }, +- { .compatible = "ti,pcm5141", }, +- { .compatible = "ti,pcm5142", }, +- { } +-}; +-MODULE_DEVICE_TABLE(of, pcm512x_of_match); +- +-static struct spi_driver pcm512x_spi_driver = { +- .probe = pcm512x_spi_probe, +- .remove = pcm512x_spi_remove, +- .id_table = pcm512x_spi_id, +- .driver = { +- .name = "pcm512x", +- .of_match_table = pcm512x_of_match, +- .pm = &pcm512x_pm_ops, +- }, +-}; +- +-module_spi_driver(pcm512x_spi_driver); +diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c +deleted file mode 100644 +index 88edd8e..0000000 +--- a/sound/soc/codecs/pcm512x.c ++++ /dev/null +@@ -1,609 +0,0 @@ +-/* +- * Driver for the PCM512x CODECs +- * +- * Author: Mark Brown +- * Copyright 2014 Linaro Ltd +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "pcm512x.h" +- +-struct pcm512x_priv { +- struct regmap *regmap; +- struct clk *sclk; +-}; +- +-static const struct reg_default pcm512x_reg_defaults[] = { +- { PCM512x_RESET, 0x00 }, +- { PCM512x_POWER, 0x00 }, +- { PCM512x_MUTE, 0x00 }, +- { PCM512x_DSP, 0x00 }, +- { PCM512x_PLL_REF, 0x00 }, +- { PCM512x_DAC_ROUTING, 0x11 }, +- { PCM512x_DSP_PROGRAM, 0x01 }, +- { PCM512x_CLKDET, 0x00 }, +- { PCM512x_AUTO_MUTE, 0x00 }, +- { PCM512x_ERROR_DETECT, 0x00 }, +- { PCM512x_DIGITAL_VOLUME_1, 0x00 }, +- { PCM512x_DIGITAL_VOLUME_2, 0x30 }, +- { PCM512x_DIGITAL_VOLUME_3, 0x30 }, +- { PCM512x_DIGITAL_MUTE_1, 0x22 }, +- { PCM512x_DIGITAL_MUTE_2, 0x00 }, +- { PCM512x_DIGITAL_MUTE_3, 0x07 }, +- { PCM512x_OUTPUT_AMPLITUDE, 0x00 }, +- { PCM512x_ANALOG_GAIN_CTRL, 0x00 }, +- { PCM512x_UNDERVOLTAGE_PROT, 0x00 }, +- { PCM512x_ANALOG_MUTE_CTRL, 0x00 }, +- { PCM512x_ANALOG_GAIN_BOOST, 0x00 }, +- { PCM512x_VCOM_CTRL_1, 0x00 }, +- { PCM512x_VCOM_CTRL_2, 0x01 }, +-}; +- +-static bool pcm512x_readable(struct device *dev, unsigned int reg) +-{ +- switch (reg) { +- case PCM512x_RESET: +- case PCM512x_POWER: +- case PCM512x_MUTE: +- case PCM512x_PLL_EN: +- case PCM512x_SPI_MISO_FUNCTION: +- case PCM512x_DSP: +- case PCM512x_GPIO_EN: +- case PCM512x_BCLK_LRCLK_CFG: +- case PCM512x_DSP_GPIO_INPUT: +- case PCM512x_MASTER_MODE: +- case PCM512x_PLL_REF: +- case PCM512x_PLL_COEFF_0: +- case PCM512x_PLL_COEFF_1: +- case PCM512x_PLL_COEFF_2: +- case PCM512x_PLL_COEFF_3: +- case PCM512x_PLL_COEFF_4: +- case PCM512x_DSP_CLKDIV: +- case PCM512x_DAC_CLKDIV: +- case PCM512x_NCP_CLKDIV: +- case PCM512x_OSR_CLKDIV: +- case PCM512x_MASTER_CLKDIV_1: +- case PCM512x_MASTER_CLKDIV_2: +- case PCM512x_FS_SPEED_MODE: +- case PCM512x_IDAC_1: +- case PCM512x_IDAC_2: +- case PCM512x_ERROR_DETECT: +- case PCM512x_I2S_1: +- case PCM512x_I2S_2: +- case PCM512x_DAC_ROUTING: +- case PCM512x_DSP_PROGRAM: +- case PCM512x_CLKDET: +- case PCM512x_AUTO_MUTE: +- case PCM512x_DIGITAL_VOLUME_1: +- case PCM512x_DIGITAL_VOLUME_2: +- case PCM512x_DIGITAL_VOLUME_3: +- case PCM512x_DIGITAL_MUTE_1: +- case PCM512x_DIGITAL_MUTE_2: +- case PCM512x_DIGITAL_MUTE_3: +- case PCM512x_GPIO_OUTPUT_1: +- case PCM512x_GPIO_OUTPUT_2: +- case PCM512x_GPIO_OUTPUT_3: +- case PCM512x_GPIO_OUTPUT_4: +- case PCM512x_GPIO_OUTPUT_5: +- case PCM512x_GPIO_OUTPUT_6: +- case PCM512x_GPIO_CONTROL_1: +- case PCM512x_GPIO_CONTROL_2: +- case PCM512x_OVERFLOW: +- case PCM512x_RATE_DET_1: +- case PCM512x_RATE_DET_2: +- case PCM512x_RATE_DET_3: +- case PCM512x_RATE_DET_4: +- case PCM512x_ANALOG_MUTE_DET: +- case PCM512x_GPIN: +- case PCM512x_DIGITAL_MUTE_DET: +- case PCM512x_OUTPUT_AMPLITUDE: +- case PCM512x_ANALOG_GAIN_CTRL: +- case PCM512x_UNDERVOLTAGE_PROT: +- case PCM512x_ANALOG_MUTE_CTRL: +- case PCM512x_ANALOG_GAIN_BOOST: +- case PCM512x_VCOM_CTRL_1: +- case PCM512x_VCOM_CTRL_2: +- case PCM512x_CRAM_CTRL: +- return true; +- default: +- /* There are 256 raw register addresses */ +- return reg < 0xff; +- } +-} +- +-static bool pcm512x_volatile(struct device *dev, unsigned int reg) +-{ +- switch (reg) { +- case PCM512x_PLL_EN: +- case PCM512x_OVERFLOW: +- case PCM512x_RATE_DET_1: +- case PCM512x_RATE_DET_2: +- case PCM512x_RATE_DET_3: +- case PCM512x_RATE_DET_4: +- case PCM512x_ANALOG_MUTE_DET: +- case PCM512x_GPIN: +- case PCM512x_DIGITAL_MUTE_DET: +- case PCM512x_CRAM_CTRL: +- return true; +- default: +- /* There are 256 raw register addresses */ +- return reg < 0xff; +- } +-} +- +-static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1); +-static const DECLARE_TLV_DB_SCALE(analog_tlv, -600, 600, 0); +-static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0); +- +-static const char * const pcm512x_dsp_program_texts[] = { +- "FIR interpolation with de-emphasis", +- "Low latency IIR with de-emphasis", +- "High attenuation with de-emphasis", +- "Fixed process flow", +- "Ringing-less low latency FIR", +-}; +- +-static const unsigned int pcm512x_dsp_program_values[] = { +- 1, +- 2, +- 3, +- 5, +- 7, +-}; +- +-static SOC_VALUE_ENUM_SINGLE_DECL(pcm512x_dsp_program, +- PCM512x_DSP_PROGRAM, 0, 0x1f, +- pcm512x_dsp_program_texts, +- pcm512x_dsp_program_values); +- +-static const char * const pcm512x_clk_missing_text[] = { +- "1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s" +-}; +- +-static const struct soc_enum pcm512x_clk_missing = +- SOC_ENUM_SINGLE(PCM512x_CLKDET, 0, 8, pcm512x_clk_missing_text); +- +-static const char * const pcm512x_autom_text[] = { +- "21ms", "106ms", "213ms", "533ms", "1.07s", "2.13s", "5.33s", "10.66s" +-}; +- +-static const struct soc_enum pcm512x_autom_l = +- SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATML_SHIFT, 8, +- pcm512x_autom_text); +- +-static const struct soc_enum pcm512x_autom_r = +- SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATMR_SHIFT, 8, +- pcm512x_autom_text); +- +-static const char * const pcm512x_ramp_rate_text[] = { +- "1 sample/update", "2 samples/update", "4 samples/update", +- "Immediate" +-}; +- +-static const struct soc_enum pcm512x_vndf = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNDF_SHIFT, 4, +- pcm512x_ramp_rate_text); +- +-static const struct soc_enum pcm512x_vnuf = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNUF_SHIFT, 4, +- pcm512x_ramp_rate_text); +- +-static const struct soc_enum pcm512x_vedf = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_2, PCM512x_VEDF_SHIFT, 4, +- pcm512x_ramp_rate_text); +- +-static const char * const pcm512x_ramp_step_text[] = { +- "4dB/step", "2dB/step", "1dB/step", "0.5dB/step" +-}; +- +-static const struct soc_enum pcm512x_vnds = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNDS_SHIFT, 4, +- pcm512x_ramp_step_text); +- +-static const struct soc_enum pcm512x_vnus = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNUS_SHIFT, 4, +- pcm512x_ramp_step_text); +- +-static const struct soc_enum pcm512x_veds = +- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_2, PCM512x_VEDS_SHIFT, 4, +- pcm512x_ramp_step_text); +- +-static const struct snd_kcontrol_new pcm512x_controls[] = { +-SOC_DOUBLE_R_TLV("Digital Playback Volume", PCM512x_DIGITAL_VOLUME_2, +- PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), +-SOC_DOUBLE_TLV("Analogue Playback Volume", PCM512x_ANALOG_GAIN_CTRL, +- PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), +-SOC_DOUBLE_TLV("Analogue Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, +- PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv), +-SOC_DOUBLE("Digital Playback Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, +- PCM512x_RQMR_SHIFT, 1, 1), +- +-SOC_SINGLE("Deemphasis Switch", PCM512x_DSP, PCM512x_DEMP_SHIFT, 1, 1), +-SOC_ENUM("DSP Program", pcm512x_dsp_program), +- +-SOC_ENUM("Clock Missing Period", pcm512x_clk_missing), +-SOC_ENUM("Auto Mute Time Left", pcm512x_autom_l), +-SOC_ENUM("Auto Mute Time Right", pcm512x_autom_r), +-SOC_SINGLE("Auto Mute Mono Switch", PCM512x_DIGITAL_MUTE_3, +- PCM512x_ACTL_SHIFT, 1, 0), +-SOC_DOUBLE("Auto Mute Switch", PCM512x_DIGITAL_MUTE_3, PCM512x_AMLE_SHIFT, +- PCM512x_AMLR_SHIFT, 1, 0), +- +-SOC_ENUM("Volume Ramp Down Rate", pcm512x_vndf), +-SOC_ENUM("Volume Ramp Down Step", pcm512x_vnds), +-SOC_ENUM("Volume Ramp Up Rate", pcm512x_vnuf), +-SOC_ENUM("Volume Ramp Up Step", pcm512x_vnus), +-SOC_ENUM("Volume Ramp Down Emergency Rate", pcm512x_vedf), +-SOC_ENUM("Volume Ramp Down Emergency Step", pcm512x_veds), +-}; +- +-static const struct snd_soc_dapm_widget pcm512x_dapm_widgets[] = { +-SND_SOC_DAPM_DAC("DACL", NULL, SND_SOC_NOPM, 0, 0), +-SND_SOC_DAPM_DAC("DACR", NULL, SND_SOC_NOPM, 0, 0), +- +-SND_SOC_DAPM_OUTPUT("OUTL"), +-SND_SOC_DAPM_OUTPUT("OUTR"), +-}; +- +-static const struct snd_soc_dapm_route pcm512x_dapm_routes[] = { +- { "DACL", NULL, "Playback" }, +- { "DACR", NULL, "Playback" }, +- +- { "OUTL", NULL, "DACL" }, +- { "OUTR", NULL, "DACR" }, +-}; +- +-static int pcm512x_set_bias_level(struct snd_soc_codec *codec, +- enum snd_soc_bias_level level) +-{ +- struct pcm512x_priv *pcm512x = dev_get_drvdata(codec->dev); +- int ret; +- +- switch (level) { +- case SND_SOC_BIAS_ON: +- case SND_SOC_BIAS_PREPARE: +- break; +- +- case SND_SOC_BIAS_STANDBY: +- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, +- PCM512x_RQST, 0); +- if (ret != 0) { +- dev_err(codec->dev, "Failed to remove standby: %d\n", +- ret); +- return ret; +- } +- break; +- +- case SND_SOC_BIAS_OFF: +- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, +- PCM512x_RQST, PCM512x_RQST); +- if (ret != 0) { +- dev_err(codec->dev, "Failed to request standby: %d\n", +- ret); +- return ret; +- } +- break; +- } +- +- codec->dapm.bias_level = level; +- +- return 0; +-} +- +-static int pcm512x_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params, +- struct snd_soc_dai *dai) +-{ +- struct snd_soc_codec *codec = dai->codec; +- struct pcm512x_priv *pcm512x = dev_get_drvdata(codec->dev); +- struct regmap *regmap = pcm512x->regmap; +- u8 bck_div, length, fs_speed; +- int ret; +- +- switch (params_format(params)) { +- case SNDRV_PCM_FORMAT_S16_LE: +- length = 0; +- break; +- case SNDRV_PCM_FORMAT_S20_3LE: +- length = 1; +- break; +- case SNDRV_PCM_FORMAT_S24_LE: +- length = 2; +- break; +- case SNDRV_PCM_FORMAT_S32_LE: +- length = 3; +- break; +- default: +- length = 0; +- break; +- } +- +- switch (params_rate(params)) { +- case 8000: +- case 11025: +- case 12000: +- case 16000: +- case 22050: +- case 32000: +- case 44100: +- case 48000: +- bck_div = 255; +- fs_speed = 0; +- break; +- case 88200: +- case 96000: +- bck_div = 255; +- fs_speed = 1; +- break; +- case 192000: +- bck_div = 255; +- fs_speed = 2; +- break; +- case 352800: +- case 384000: +- bck_div = 127; +- fs_speed = 3; +- break; +- default: +- bck_div = 255; +- fs_speed = 0; +- break; +- } +- +- ret = regmap_write(regmap, PCM512x_I2S_1, length); +- if (ret != 0) { +- dev_err(codec->dev, "Failed to I2S Data Format: %d\n", ret); +- goto err; +- } +- +- ret = regmap_write(regmap, PCM512x_FS_SPEED_MODE, fs_speed); +- if (ret != 0) { +- dev_err(codec->dev, "Failed to BCK rate: %d\n", ret); +- goto err; +- } +- +-err: +- return ret; +-} +- +- +-static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) +-{ +- return 0; +-} +- +-static int pcm512x_set_sysclk(struct snd_soc_dai *dai, +- int clk_id, unsigned int freq, int dir) +-{ +- return 0; +-} +- +-static const struct snd_soc_dai_ops pcm512x_dai_ops = { +- .set_sysclk = pcm512x_set_sysclk, +- .hw_params = pcm512x_hw_params, +- .set_fmt = pcm512x_set_fmt, +-}; +- +-static struct snd_soc_dai_driver pcm512x_dai = { +- .name = "pcm512x-hifi", +- .playback = { +- .stream_name = "Playback", +- .channels_min = 2, +- .channels_max = 2, +- .rates = SNDRV_PCM_RATE_8000_384000, +- .formats = SNDRV_PCM_FMTBIT_S16_LE | +- SNDRV_PCM_FMTBIT_S24_LE | +- SNDRV_PCM_FMTBIT_S32_LE +- }, +- .ops = &pcm512x_dai_ops, +-}; +- +-static struct snd_soc_codec_driver pcm512x_codec_driver = { +- .set_bias_level = pcm512x_set_bias_level, +- .idle_bias_off = true, +- +- .controls = pcm512x_controls, +- .num_controls = ARRAY_SIZE(pcm512x_controls), +- .dapm_widgets = pcm512x_dapm_widgets, +- .num_dapm_widgets = ARRAY_SIZE(pcm512x_dapm_widgets), +- .dapm_routes = pcm512x_dapm_routes, +- .num_dapm_routes = ARRAY_SIZE(pcm512x_dapm_routes), +-}; +- +-static const struct regmap_range_cfg pcm512x_range = { +- .name = "Pages", .range_min = PCM512x_VIRT_BASE, +- .range_max = PCM512x_MAX_REGISTER, +- .selector_reg = PCM512x_PAGE, +- .selector_mask = 0xff, +- .window_start = 0, .window_len = 0x100, +-}; +- +-const struct regmap_config pcm512x_regmap = { +- .reg_bits = 8, +- .val_bits = 8, +- +- .readable_reg = pcm512x_readable, +- .volatile_reg = pcm512x_volatile, +- +- .ranges = &pcm512x_range, +- .num_ranges = 1, +- +- .max_register = PCM512x_MAX_REGISTER, +- .reg_defaults = pcm512x_reg_defaults, +- .num_reg_defaults = ARRAY_SIZE(pcm512x_reg_defaults), +- .cache_type = REGCACHE_RBTREE, +-}; +-EXPORT_SYMBOL_GPL(pcm512x_regmap); +- +-int pcm512x_probe(struct device *dev, struct regmap *regmap) +-{ +- struct pcm512x_priv *pcm512x; +- int ret; +- +- pcm512x = devm_kzalloc(dev, sizeof(struct pcm512x_priv), GFP_KERNEL); +- if (!pcm512x) +- return -ENOMEM; +- +- dev_set_drvdata(dev, pcm512x); +- pcm512x->regmap = regmap; +- +- /* Reset the device, verifying I/O in the process for I2C */ +- ret = regmap_write(regmap, PCM512x_RESET, +- PCM512x_RSTM | PCM512x_RSTR); +- if (ret != 0) { +- dev_err(dev, "Failed to reset device: %d\n", ret); +- goto err; +- } +- +- ret = regmap_write(regmap, PCM512x_RESET, 0); +- if (ret != 0) { +- dev_err(dev, "Failed to reset device: %d\n", ret); +- goto err; +- } +- +- pcm512x->sclk = devm_clk_get(dev, NULL); +- if (IS_ERR(pcm512x->sclk)) { +- if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) +- return -EPROBE_DEFER; +- +- dev_info(dev, "No SCLK, using BCLK: %ld\n", +- PTR_ERR(pcm512x->sclk)); +- +- /* Disable reporting of missing SCLK as an error */ +- regmap_update_bits(regmap, PCM512x_ERROR_DETECT, +- PCM512x_IDCH, PCM512x_IDCH); +- +- /* Internal PLL off, master clock switched to SCK */ +- regmap_update_bits(regmap, PCM512x_PLL_EN, +- PCM512x_PLCE, 0); +- +- } else { +- ret = clk_prepare_enable(pcm512x->sclk); +- if (ret != 0) { +- dev_err(dev, "Failed to enable SCLK: %d\n", ret); +- return ret; +- } +- } +- +- /* Default to standby mode */ +- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, +- PCM512x_RQST, PCM512x_RQST); +- if (ret != 0) { +- dev_err(dev, "Failed to request standby: %d\n", +- ret); +- goto err_clk; +- } +- +- pm_runtime_set_active(dev); +- pm_runtime_enable(dev); +- pm_runtime_idle(dev); +- +- ret = snd_soc_register_codec(dev, &pcm512x_codec_driver, +- &pcm512x_dai, 1); +- if (ret != 0) { +- dev_err(dev, "Failed to register CODEC: %d\n", ret); +- goto err_pm; +- } +- +- return 0; +- +-err_pm: +- pm_runtime_disable(dev); +-err_clk: +- if (!IS_ERR(pcm512x->sclk)) +- clk_disable_unprepare(pcm512x->sclk); +-err: +- return ret; +-} +-EXPORT_SYMBOL_GPL(pcm512x_probe); +- +-void pcm512x_remove(struct device *dev) +-{ +- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); +- +- snd_soc_unregister_codec(dev); +- pm_runtime_disable(dev); +- if (!IS_ERR(pcm512x->sclk)) +- clk_disable_unprepare(pcm512x->sclk); +-} +-EXPORT_SYMBOL_GPL(pcm512x_remove); +- +-#ifdef CONFIG_PM_RUNTIME +-static int pcm512x_suspend(struct device *dev) +-{ +- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); +- int ret; +- +- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, +- PCM512x_RQPD, PCM512x_RQPD); +- if (ret != 0) { +- dev_err(dev, "Failed to request power down: %d\n", ret); +- return ret; +- } +- +- if (!IS_ERR(pcm512x->sclk)) +- clk_disable_unprepare(pcm512x->sclk); +- +- return 0; +-} +- +-static int pcm512x_resume(struct device *dev) +-{ +- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); +- int ret; +- +- if (!IS_ERR(pcm512x->sclk)) { +- ret = clk_prepare_enable(pcm512x->sclk); +- if (ret != 0) { +- dev_err(dev, "Failed to enable SCLK: %d\n", ret); +- return ret; +- } +- } +- +- regcache_cache_only(pcm512x->regmap, false); +- ret = regcache_sync(pcm512x->regmap); +- if (ret != 0) { +- dev_err(dev, "Failed to sync cache: %d\n", ret); +- return ret; +- } +- +- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, +- PCM512x_RQPD, 0); +- if (ret != 0) { +- dev_err(dev, "Failed to remove power down: %d\n", ret); +- return ret; +- } +- +- return 0; +-} +-#endif +- +-const struct dev_pm_ops pcm512x_pm_ops = { +- SET_RUNTIME_PM_OPS(pcm512x_suspend, pcm512x_resume, NULL) +-}; +-EXPORT_SYMBOL_GPL(pcm512x_pm_ops); +- +-MODULE_DESCRIPTION("ASoC PCM512x codec driver"); +-MODULE_AUTHOR("Mark Brown "); +-MODULE_LICENSE("GPL v2"); +diff --git a/sound/soc/codecs/pcm512x.h b/sound/soc/codecs/pcm512x.h +deleted file mode 100644 +index 6ee76aa..0000000 +--- a/sound/soc/codecs/pcm512x.h ++++ /dev/null +@@ -1,171 +0,0 @@ +-/* +- * Driver for the PCM512x CODECs +- * +- * Author: Mark Brown +- * Copyright 2014 Linaro Ltd +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#ifndef _SND_SOC_PCM512X +-#define _SND_SOC_PCM512X +- +-#include +-#include +- +-#define PCM512x_VIRT_BASE 0x100 +-#define PCM512x_PAGE_LEN 0x100 +-#define PCM512x_PAGE_BASE(n) (PCM512x_VIRT_BASE + (PCM512x_PAGE_LEN * n)) +- +-#define PCM512x_PAGE 0 +- +-#define PCM512x_RESET (PCM512x_PAGE_BASE(0) + 1) +-#define PCM512x_POWER (PCM512x_PAGE_BASE(0) + 2) +-#define PCM512x_MUTE (PCM512x_PAGE_BASE(0) + 3) +-#define PCM512x_PLL_EN (PCM512x_PAGE_BASE(0) + 4) +-#define PCM512x_SPI_MISO_FUNCTION (PCM512x_PAGE_BASE(0) + 6) +-#define PCM512x_DSP (PCM512x_PAGE_BASE(0) + 7) +-#define PCM512x_GPIO_EN (PCM512x_PAGE_BASE(0) + 8) +-#define PCM512x_BCLK_LRCLK_CFG (PCM512x_PAGE_BASE(0) + 9) +-#define PCM512x_DSP_GPIO_INPUT (PCM512x_PAGE_BASE(0) + 10) +-#define PCM512x_MASTER_MODE (PCM512x_PAGE_BASE(0) + 12) +-#define PCM512x_PLL_REF (PCM512x_PAGE_BASE(0) + 13) +-#define PCM512x_PLL_COEFF_0 (PCM512x_PAGE_BASE(0) + 20) +-#define PCM512x_PLL_COEFF_1 (PCM512x_PAGE_BASE(0) + 21) +-#define PCM512x_PLL_COEFF_2 (PCM512x_PAGE_BASE(0) + 22) +-#define PCM512x_PLL_COEFF_3 (PCM512x_PAGE_BASE(0) + 23) +-#define PCM512x_PLL_COEFF_4 (PCM512x_PAGE_BASE(0) + 24) +-#define PCM512x_DSP_CLKDIV (PCM512x_PAGE_BASE(0) + 27) +-#define PCM512x_DAC_CLKDIV (PCM512x_PAGE_BASE(0) + 28) +-#define PCM512x_NCP_CLKDIV (PCM512x_PAGE_BASE(0) + 29) +-#define PCM512x_OSR_CLKDIV (PCM512x_PAGE_BASE(0) + 30) +-#define PCM512x_MASTER_CLKDIV_1 (PCM512x_PAGE_BASE(0) + 32) +-#define PCM512x_MASTER_CLKDIV_2 (PCM512x_PAGE_BASE(0) + 33) +-#define PCM512x_FS_SPEED_MODE (PCM512x_PAGE_BASE(0) + 34) +-#define PCM512x_IDAC_1 (PCM512x_PAGE_BASE(0) + 35) +-#define PCM512x_IDAC_2 (PCM512x_PAGE_BASE(0) + 36) +-#define PCM512x_ERROR_DETECT (PCM512x_PAGE_BASE(0) + 37) +-#define PCM512x_I2S_1 (PCM512x_PAGE_BASE(0) + 40) +-#define PCM512x_I2S_2 (PCM512x_PAGE_BASE(0) + 41) +-#define PCM512x_DAC_ROUTING (PCM512x_PAGE_BASE(0) + 42) +-#define PCM512x_DSP_PROGRAM (PCM512x_PAGE_BASE(0) + 43) +-#define PCM512x_CLKDET (PCM512x_PAGE_BASE(0) + 44) +-#define PCM512x_AUTO_MUTE (PCM512x_PAGE_BASE(0) + 59) +-#define PCM512x_DIGITAL_VOLUME_1 (PCM512x_PAGE_BASE(0) + 60) +-#define PCM512x_DIGITAL_VOLUME_2 (PCM512x_PAGE_BASE(0) + 61) +-#define PCM512x_DIGITAL_VOLUME_3 (PCM512x_PAGE_BASE(0) + 62) +-#define PCM512x_DIGITAL_MUTE_1 (PCM512x_PAGE_BASE(0) + 63) +-#define PCM512x_DIGITAL_MUTE_2 (PCM512x_PAGE_BASE(0) + 64) +-#define PCM512x_DIGITAL_MUTE_3 (PCM512x_PAGE_BASE(0) + 65) +-#define PCM512x_GPIO_OUTPUT_1 (PCM512x_PAGE_BASE(0) + 80) +-#define PCM512x_GPIO_OUTPUT_2 (PCM512x_PAGE_BASE(0) + 81) +-#define PCM512x_GPIO_OUTPUT_3 (PCM512x_PAGE_BASE(0) + 82) +-#define PCM512x_GPIO_OUTPUT_4 (PCM512x_PAGE_BASE(0) + 83) +-#define PCM512x_GPIO_OUTPUT_5 (PCM512x_PAGE_BASE(0) + 84) +-#define PCM512x_GPIO_OUTPUT_6 (PCM512x_PAGE_BASE(0) + 85) +-#define PCM512x_GPIO_CONTROL_1 (PCM512x_PAGE_BASE(0) + 86) +-#define PCM512x_GPIO_CONTROL_2 (PCM512x_PAGE_BASE(0) + 87) +-#define PCM512x_OVERFLOW (PCM512x_PAGE_BASE(0) + 90) +-#define PCM512x_RATE_DET_1 (PCM512x_PAGE_BASE(0) + 91) +-#define PCM512x_RATE_DET_2 (PCM512x_PAGE_BASE(0) + 92) +-#define PCM512x_RATE_DET_3 (PCM512x_PAGE_BASE(0) + 93) +-#define PCM512x_RATE_DET_4 (PCM512x_PAGE_BASE(0) + 94) +-#define PCM512x_ANALOG_MUTE_DET (PCM512x_PAGE_BASE(0) + 108) +-#define PCM512x_GPIN (PCM512x_PAGE_BASE(0) + 119) +-#define PCM512x_DIGITAL_MUTE_DET (PCM512x_PAGE_BASE(0) + 120) +- +-#define PCM512x_OUTPUT_AMPLITUDE (PCM512x_PAGE_BASE(1) + 1) +-#define PCM512x_ANALOG_GAIN_CTRL (PCM512x_PAGE_BASE(1) + 2) +-#define PCM512x_UNDERVOLTAGE_PROT (PCM512x_PAGE_BASE(1) + 5) +-#define PCM512x_ANALOG_MUTE_CTRL (PCM512x_PAGE_BASE(1) + 6) +-#define PCM512x_ANALOG_GAIN_BOOST (PCM512x_PAGE_BASE(1) + 7) +-#define PCM512x_VCOM_CTRL_1 (PCM512x_PAGE_BASE(1) + 8) +-#define PCM512x_VCOM_CTRL_2 (PCM512x_PAGE_BASE(1) + 9) +- +-#define PCM512x_CRAM_CTRL (PCM512x_PAGE_BASE(44) + 1) +- +-#define PCM512x_MAX_REGISTER (PCM512x_PAGE_BASE(44) + 1) +- +-/* Page 0, Register 1 - reset */ +-#define PCM512x_RSTR (1 << 0) +-#define PCM512x_RSTM (1 << 4) +- +-/* Page 0, Register 2 - power */ +-#define PCM512x_RQPD (1 << 0) +-#define PCM512x_RQPD_SHIFT 0 +-#define PCM512x_RQST (1 << 4) +-#define PCM512x_RQST_SHIFT 4 +- +-/* Page 0, Register 3 - mute */ +-#define PCM512x_RQMR_SHIFT 0 +-#define PCM512x_RQML_SHIFT 4 +- +-/* Page 0, Register 4 - PLL */ +-#define PCM512x_PLCE (1 << 0) +-#define PCM512x_RLCE_SHIFT 0 +-#define PCM512x_PLCK (1 << 4) +-#define PCM512x_PLCK_SHIFT 4 +- +-/* Page 0, Register 7 - DSP */ +-#define PCM512x_SDSL (1 << 0) +-#define PCM512x_SDSL_SHIFT 0 +-#define PCM512x_DEMP (1 << 4) +-#define PCM512x_DEMP_SHIFT 4 +- +-/* Page 0, Register 13 - PLL reference */ +-#define PCM512x_SREF (1 << 4) +- +-/* Page 0, Register 37 - Error detection */ +-#define PCM512x_IPLK (1 << 0) +-#define PCM512x_DCAS (1 << 1) +-#define PCM512x_IDCM (1 << 2) +-#define PCM512x_IDCH (1 << 3) +-#define PCM512x_IDSK (1 << 4) +-#define PCM512x_IDBK (1 << 5) +-#define PCM512x_IDFS (1 << 6) +- +-/* Page 0, Register 42 - DAC routing */ +-#define PCM512x_AUPR_SHIFT 0 +-#define PCM512x_AUPL_SHIFT 4 +- +-/* Page 0, Register 59 - auto mute */ +-#define PCM512x_ATMR_SHIFT 0 +-#define PCM512x_ATML_SHIFT 4 +- +-/* Page 0, Register 63 - ramp rates */ +-#define PCM512x_VNDF_SHIFT 6 +-#define PCM512x_VNDS_SHIFT 4 +-#define PCM512x_VNUF_SHIFT 2 +-#define PCM512x_VNUS_SHIFT 0 +- +-/* Page 0, Register 64 - emergency ramp rates */ +-#define PCM512x_VEDF_SHIFT 6 +-#define PCM512x_VEDS_SHIFT 4 +- +-/* Page 0, Register 65 - Digital mute enables */ +-#define PCM512x_ACTL_SHIFT 2 +-#define PCM512x_AMLE_SHIFT 1 +-#define PCM512x_AMLR_SHIFT 0 +- +-/* Page 1, Register 2 - analog volume control */ +-#define PCM512x_RAGN_SHIFT 0 +-#define PCM512x_LAGN_SHIFT 4 +- +-/* Page 1, Register 7 - analog boost control */ +-#define PCM512x_AGBR_SHIFT 0 +-#define PCM512x_AGBL_SHIFT 4 +- +-extern const struct dev_pm_ops pcm512x_pm_ops; +-extern const struct regmap_config pcm512x_regmap; +- +-int pcm512x_probe(struct device *dev, struct regmap *regmap); +-void pcm512x_remove(struct device *dev); +- +-#endif +-- +1.9.1 + diff --git a/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch b/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch new file mode 100644 index 0000000000..43ba03c43f --- /dev/null +++ b/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch @@ -0,0 +1,44 @@ +From 5b29cd4f629f63a0e594152b49753e36e215ef26 Mon Sep 17 00:00:00 2001 +From: Jamie Coldhill +Date: Fri, 9 Sep 2016 10:33:29 +0800 +Subject: [PATCH] Report only working frequecies and bit depths + +--- + sound/soc/aml/m8/aml_i2s_dai.c | 5 ++--- + sound/soc/aml/m8/aml_spdif_codec.c | 5 ++--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c +index 5dfbaf1..cc6e5b6 100644 +--- a/sound/soc/aml/m8/aml_i2s_dai.c ++++ b/sound/soc/aml/m8/aml_i2s_dai.c +@@ -324,9 +324,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai) + return 0; + } + +-#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) +-#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ +- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) ++#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 ++#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE + + static struct snd_soc_dai_ops aml_dai_i2s_ops = { + .startup = aml_dai_i2s_startup, +diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c +index 5ef287b..85f2833 100644 +--- a/sound/soc/aml/m8/aml_spdif_codec.c ++++ b/sound/soc/aml/m8/aml_spdif_codec.c +@@ -26,9 +26,8 @@ + + #define DRV_NAME "spdif-dit" + +-#define STUB_RATES SNDRV_PCM_RATE_8000_192000 +-#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ +- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) ++#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 ++#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE + + static struct snd_soc_codec_driver soc_codec_spdif_dit; + +-- +1.9.1 From 0cbb8f5a89d8109d58c566228dc522559abbbb7c Mon Sep 17 00:00:00 2001 From: Jamie Coldhill Date: Mon, 19 Sep 2016 23:35:53 +0800 Subject: [PATCH 2/4] Odroid_C2: stop kmsg text before LE logo thx. @kszaq --- projects/Odroid_C2/linux/linux.aarch64.conf | 8 ++++---- projects/Odroid_C2/options | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/Odroid_C2/linux/linux.aarch64.conf b/projects/Odroid_C2/linux/linux.aarch64.conf index b9d248acd7..dc16aea02b 100644 --- a/projects/Odroid_C2/linux/linux.aarch64.conf +++ b/projects/Odroid_C2/linux/linux.aarch64.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 3.14.65 Kernel Configuration +# Linux/arm64 3.14.79 Kernel Configuration # CONFIG_ARM64=y CONFIG_ARM64_HAS_SG_CHAIN=y @@ -2586,8 +2586,8 @@ CONFIG_BACKLIGHT_GENERIC=y # Console display driver support # CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_LOGO is not set # CONFIG_FB_SSD1307 is not set @@ -3819,7 +3819,7 @@ CONFIG_AVERAGE=y # CONFIG_DDR is not set CONFIG_LIBFDT=y CONFIG_OID_REGISTRY=y -CONFIG_FONT_SUPPORT=y +CONFIG_FONT_SUPPORT=m # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y diff --git a/projects/Odroid_C2/options b/projects/Odroid_C2/options index 0ad3465507..9edaf70d71 100644 --- a/projects/Odroid_C2/options +++ b/projects/Odroid_C2/options @@ -91,7 +91,7 @@ KODIPLAYER_DRIVER="libamcodec" # Modules to install in initramfs for early boot - INITRAMFS_MODULES="" + INITRAMFS_MODULES="font softcursor bitblit fbcon" # additional drivers to install: # for a list of additinoal drivers see packages/linux-drivers From 09991a166c097e91292620b35cc2ab8439e9cde3 Mon Sep 17 00:00:00 2001 From: Jamie Coldhill Date: Mon, 19 Sep 2016 23:49:35 +0800 Subject: [PATCH 3/4] Odroid_C2: linux patches update --- ...io-mods-for-HiFi-Shield1-and-usb-DAC.patch | 512 +++++++++++++++++- ...efault-refresh-rate-switching-policy.patch | 25 - ...ly-working-frequecies-and-bit-depths.patch | 45 -- 3 files changed, 500 insertions(+), 82 deletions(-) delete mode 100644 projects/Odroid_C2/patches/linux/linux-005-set-default-refresh-rate-switching-policy.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-007-Audio-Report-only-working-frequecies-and-bit-depths.patch diff --git a/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch b/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch index 8fdb7ddc60..2e2b24dc69 100644 --- a/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch +++ b/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch @@ -1,8 +1,8 @@ -From cc3842d7b5f45dc5c240fd734918242e25aadc9e Mon Sep 17 00:00:00 2001 +From b0bc68d9bfb8d33badd3c0f2f583934219bff120 Mon Sep 17 00:00:00 2001 From: Jamie Coldhill -Date: Fri, 16 Sep 2016 18:46:04 +0800 -Subject: [PATCH] Revert all Odroid custom audio mods for HiFi Shield1 - and usb DAC +Date: Mon, 19 Sep 2016 19:15:16 +0800 +Subject: [PATCH] + Revert.all.Odroid.Specific.Sound.Mods.for.HiFi.Shield.and.usb_dac --- arch/arm64/boot/dts/meson64_odroidc2.dts | 143 ++++++------ @@ -14,21 +14,29 @@ Subject: [PATCH] Revert all Odroid custom audio mods for HiFi Shield1 sound/soc/aml/m8/Makefile | 6 - sound/soc/aml/m8/aml_audio_hw.c | 13 +- sound/soc/aml/m8/aml_audio_hw.h | 2 +- + sound/soc/aml/m8/aml_i2s.c | 83 +++---- + sound/soc/aml/m8/aml_i2s_dai.c | 55 ++--- + sound/soc/aml/m8/aml_m8.c | 2 + sound/soc/aml/m8/aml_spdif_codec.c | 2 +- + sound/soc/aml/m8/aml_spdif_dai.c | 110 +++++++--- + sound/soc/aml/m8/aml_spdif_dai.h | 4 +- sound/soc/aml/m8/odroid_dac.c | 292 ------------------------- sound/soc/aml/m8/odroid_hdmi.c | 262 ---------------------- sound/soc/aml/m8/odroid_hdmi.h | 31 --- sound/soc/codecs/Kconfig | 4 - sound/soc/codecs/Makefile | 2 - sound/soc/codecs/pcm5102.c | 161 -------------- - 16 files changed, 82 insertions(+), 867 deletions(-) + 21 files changed, 222 insertions(+), 981 deletions(-) + mode change 100755 => 100644 arch/arm64/boot/dts/meson64_odroidc2.dts delete mode 100644 sound/soc/aml/m8/odroid_dac.c delete mode 100644 sound/soc/aml/m8/odroid_hdmi.c delete mode 100644 sound/soc/aml/m8/odroid_hdmi.h delete mode 100644 sound/soc/codecs/pcm5102.c diff --git a/arch/arm64/boot/dts/meson64_odroidc2.dts b/arch/arm64/boot/dts/meson64_odroidc2.dts -index 3534b4f..175afd1 100644 +old mode 100755 +new mode 100644 +index 5f64ee3..e95be6a --- a/arch/arm64/boot/dts/meson64_odroidc2.dts +++ b/arch/arm64/boot/dts/meson64_odroidc2.dts @@ -529,21 +529,24 @@ @@ -219,10 +227,10 @@ index 3534b4f..175afd1 100644 }; /* END OF AUDIO board specific */ diff --git a/arch/arm64/configs/odroidc2_defconfig b/arch/arm64/configs/odroidc2_defconfig -index 3dd9aba..380e988 100644 +index 079f956..08de48b 100644 --- a/arch/arm64/configs/odroidc2_defconfig +++ b/arch/arm64/configs/odroidc2_defconfig -@@ -3208,8 +3208,8 @@ CONFIG_SOUND_OSS_CORE_PRECLAIM=y +@@ -3237,8 +3237,8 @@ CONFIG_SOUND_OSS_CORE_PRECLAIM=y CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y @@ -233,7 +241,7 @@ index 3dd9aba..380e988 100644 CONFIG_SND_COMPRESS_OFFLOAD=y CONFIG_SND_JACK=y CONFIG_SND_SEQUENCER=m -@@ -3243,7 +3243,7 @@ CONFIG_SND_DRIVERS=y +@@ -3272,7 +3272,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_AC97_POWER_SAVE is not set CONFIG_SND_SPI=y CONFIG_SND_USB=y @@ -242,7 +250,7 @@ index 3dd9aba..380e988 100644 CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m CONFIG_SND_USB_CAIAQ_INPUT=y -@@ -3253,12 +3253,10 @@ CONFIG_SND_SOC=y +@@ -3282,12 +3282,10 @@ CONFIG_SND_SOC=y # CONFIG_SND_ATMEL_SOC is not set # CONFIG_SND_DESIGNWARE_I2S is not set CONFIG_SND_AML_M8_SOC=y @@ -258,10 +266,10 @@ index 3dd9aba..380e988 100644 # CONFIG_SOUND_PRIME is not set CONFIG_AC97_BUS=m diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -index 78c87f9..fe0e201 100644 +index f53f0e4..e6d04dd 100644 --- a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -@@ -1655,7 +1655,7 @@ static int hdmi_task_handle(void *data) +@@ -1664,7 +1664,7 @@ static int hdmi_task_handle(void *data) INIT_WORK(&hdmitx_device->work_internal_intr, hdmitx_internal_intr_handler); @@ -387,6 +395,289 @@ index d394150..90aee90 100644 void audio_set_spdif_clk_div(void); void audio_enable_ouput(int flag); unsigned int read_i2s_rd_ptr(void); +diff --git a/sound/soc/aml/m8/aml_i2s.c b/sound/soc/aml/m8/aml_i2s.c +index 95ca2e5..64bed25 100644 +--- a/sound/soc/aml/m8/aml_i2s.c ++++ b/sound/soc/aml/m8/aml_i2s.c +@@ -93,17 +93,17 @@ static const struct snd_pcm_hardware aml_i2s_hardware = { + SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + +- .period_bytes_min = 32, ++ .period_bytes_min = 64, + .period_bytes_max = 32 * 1024 * 2, + .periods_min = 2, +- .periods_max = 256, +- .buffer_bytes_max = 32 * 1024 * 2, ++ .periods_max = 1024, ++ .buffer_bytes_max = 128 * 1024 * 2 * 2, + + .rate_min = 8000, +- .rate_max = 384000, +- .channels_min = 1, ++ .rate_max = 48000, ++ .channels_min = 2, + .channels_max = 8, +- .fifo_size = 32, ++ .fifo_size = 0, + }; + + static const struct snd_pcm_hardware aml_i2s_capture = { +@@ -116,7 +116,7 @@ static const struct snd_pcm_hardware aml_i2s_capture = { + .period_bytes_min = 64, + .period_bytes_max = 32 * 1024, + .periods_min = 2, +- .periods_max = 256, ++ .periods_max = 1024, + .buffer_bytes_max = 64 * 1024, + + .rate_min = 8000, +@@ -582,23 +582,6 @@ static int aml_i2s_close(struct snd_pcm_substream *substream) + /* extern void audio_hw_958_enable(unsigned flag); */ + /* extern int kernel_android_50; */ + +-static char *get_hw_buf_ptr(struct snd_pcm_runtime *runtime, +- snd_pcm_uframes_t cur_pos, int align) +-{ +- unsigned int tot_bytes_per_channel = +- frames_to_bytes(runtime, cur_pos) / runtime->channels; +- unsigned int bytes_aligned_per_channel = +- frames_to_bytes(runtime, align / runtime->channels); +- unsigned int hw_base_off = +- tot_bytes_per_channel / bytes_aligned_per_channel; +- unsigned int block_off = +- tot_bytes_per_channel % bytes_aligned_per_channel; +- +- return runtime->dma_area + +- (frames_to_bytes(runtime, align) * hw_base_off) + +- block_off; +-} +- + static int aml_i2s_copy_playback(struct snd_pcm_runtime *runtime, int channel, + snd_pcm_uframes_t pos, + void __user *buf, snd_pcm_uframes_t count, +@@ -629,32 +612,48 @@ static int aml_i2s_copy_playback(struct snd_pcm_runtime *runtime, int channel, + return -EFAULT; + if (access_ok(VERIFY_READ, buf, frames_to_bytes(runtime, count))) { + if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) { ++ + int16_t *tfrom, *to, *left, *right; + tfrom = (int16_t *) ubuf; ++ to = (int16_t *) hwbuf; ++ ++ left = to; ++ right = to + 16; ++ if (pos % align) { ++ pr_info("audio data unligned: pos=%d, n=%d, align=%d\n", ++ (int)pos, n, align); ++ } + +- for (j = 0; j < count; j++) { +- to = (int16_t *) get_hw_buf_ptr(runtime, +- pos + j, +- align); +- left = to; +- right = to + align; +- *left = (*tfrom++); +- *right = (*tfrom++); ++ for (j = 0; j < n; j += 64) { ++ for (i = 0; i < 16; i++) { ++ *left++ = (*tfrom++); ++ *right++ = (*tfrom++); ++ } ++ left += 16; ++ right += 16; + } +- } else if (runtime->format == SNDRV_PCM_FORMAT_S24_LE) { ++ } else if (runtime->format == SNDRV_PCM_FORMAT_S24_LE ++ && I2S_MODE == AIU_I2S_MODE_PCM24) { + int32_t *tfrom, *to, *left, *right; + tfrom = (int32_t *) ubuf; ++ to = (int32_t *) hwbuf; + +- for (j = 0; j < count; j++) { +- to = (int32_t *) get_hw_buf_ptr(runtime, +- pos + j, +- align); +- left = to; +- right = to + align; ++ left = to; ++ right = to + 8; + +- *left = (*tfrom++); +- *right = (*tfrom++); ++ if (pos % align) { ++ pr_info("audio data unaligned: pos=%d, n=%d, align=%d\n", ++ (int)pos, n, align); + } ++ for (j = 0; j < n; j += 64) { ++ for (i = 0; i < 8; i++) { ++ *left++ = (*tfrom++); ++ *right++ = (*tfrom++); ++ } ++ left += 8; ++ right += 8; ++ } ++ + } else if (runtime->format == SNDRV_PCM_FORMAT_S32_LE) { + int32_t *tfrom, *to, *left, *right; + tfrom = (int32_t *) ubuf; +@@ -779,6 +778,8 @@ static int aml_i2s_copy_capture(struct snd_pcm_runtime *runtime, int channel, + left += 8; + right += 8; + } ++ /* clean hw buffer */ ++ memset(hwbuf, 0, n * 2); + } + } + res = copy_to_user(buf, ubuf, n); +diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c +index 7f86c32..5dfbaf1 100644 +--- a/sound/soc/aml/m8/aml_i2s_dai.c ++++ b/sound/soc/aml/m8/aml_i2s_dai.c +@@ -43,7 +43,6 @@ + #include "aml_i2s.h" + #include "aml_audio_hw.h" + #include +-#include + #include "aml_spdif_dai.h" + + struct aml_dai_info dai_info[3] = { {0} }; +@@ -64,7 +63,6 @@ static int i2s_pos_sync; + /* extern int set_i2s_iec958_samesource(int enable); */ + #define DEFAULT_SAMPLERATE 48000 + #define DEFAULT_MCLK_RATIO_SR 256 +-#define MCLK_RATIO_128FS_SR 128 + static int i2sbuf[32 + 16]; + static void aml_i2s_play(void) + { +@@ -138,6 +136,8 @@ static int aml_dai_i2s_startup(struct snd_pcm_substream *substream, + static void aml_dai_i2s_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) + { ++ if (IEC958_mode_codec == 0) ++ aml_spdif_play(); + return; + } + +@@ -164,7 +164,7 @@ static int aml_i2s_set_amclk(struct aml_i2s *i2s, unsigned long rate) + return ret; + } + +- audio_set_i2s_clk_div(i2s->old_samplerate); ++ audio_set_i2s_clk_div(); + + return 0; + } +@@ -219,19 +219,8 @@ static int aml_dai_i2s_trigger(struct snd_pcm_substream *substream, int cmd, + struct snd_soc_dai *dai) + { + struct snd_pcm_runtime *rtd = substream->runtime; +- struct snd_soc_pcm_runtime *prtd = substream->private_data; +- struct snd_soc_dai *codec_dai = prtd->codec_dai; + int *ppp = NULL; +- bool hdmi_out = false; +- + ALSA_TRACE(); +- +- if (!strncmp(codec_dai->name, "dit-hifi", strlen("dit-hifi"))) { +- hdmi_out = true; +- } else { +- hdmi_out = false; +- } +- + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: +@@ -240,16 +229,9 @@ static int aml_dai_i2s_trigger(struct snd_pcm_substream *substream, int cmd, + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + pr_info("aiu i2s playback enable\n"); + audio_out_i2s_enable(1); +- if (hdmi_out) { +- aml_audio_i2s_mute(); +- hdmitx_audio_mute_op(1); +- if (IEC958_mode_codec == 0) { +- pr_info("audio_hw_958_enable 1\n"); +- audio_hw_958_enable(1); +- } +- } else { +- aml_audio_i2s_unmute(); +- hdmitx_audio_mute_op(0); ++ if (IEC958_mode_codec == 0) { ++ pr_info("audio_hw_958_enable 1\n"); ++ audio_hw_958_enable(1); + } + } else { + audio_in_i2s_enable(1); +@@ -289,10 +271,7 @@ static int aml_dai_i2s_hw_params(struct snd_pcm_substream *substream, + srate = params_rate(params); + if (i2s->old_samplerate != srate) { + i2s->old_samplerate = srate; +- if (srate > 192000) +- mclk_rate = srate * MCLK_RATIO_128FS_SR; +- else +- mclk_rate = srate * DEFAULT_MCLK_RATIO_SR; ++ mclk_rate = srate * DEFAULT_MCLK_RATIO_SR; + aml_i2s_set_amclk(i2s, mclk_rate); + } + +@@ -325,25 +304,27 @@ static int aml_dai_set_i2s_sysclk(struct snd_soc_dai *dai, + return 0; + } + +-#ifdef CONFIG_PM + static int aml_dai_i2s_suspend(struct snd_soc_dai *dai) + { +- ALSA_TRACE(); ++ struct aml_i2s *i2s = dev_get_drvdata(dai->dev); ++ ++ if (i2s && i2s->clk_mclk) ++ clk_disable_unprepare(i2s->clk_mclk); ++ + return 0; + } + + static int aml_dai_i2s_resume(struct snd_soc_dai *dai) + { +- ALSA_TRACE(); ++ struct aml_i2s *i2s = dev_get_drvdata(dai->dev); ++ ++ if (i2s && i2s->clk_mclk) ++ clk_prepare_enable(i2s->clk_mclk); ++ + return 0; + } + +-#else /* CONFIG_PM */ +-#define aml_dai_i2s_suspend NULL +-#define aml_dai_i2s_resume NULL +-#endif /* CONFIG_PM */ +- +-#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_384000) ++#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) + #define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ + SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) + +diff --git a/sound/soc/aml/m8/aml_m8.c b/sound/soc/aml/m8/aml_m8.c +index 7744375..2012bba 100644 +--- a/sound/soc/aml/m8/aml_m8.c ++++ b/sound/soc/aml/m8/aml_m8.c +@@ -626,6 +626,7 @@ static int aml_m8_audio_probe(struct platform_device *pdev) + + snd_soc_card_set_drvdata(card, p_aml_audio); + card->dev = dev; ++ platform_set_drvdata(pdev, card); + ret = snd_soc_of_parse_card_name(card, "aml_sound_card,name"); + if (ret < 0) { + dev_err(dev, "no specific snd_soc_card name\n"); +@@ -678,6 +679,7 @@ static struct platform_driver aml_m8_audio_driver = { + .name = DRV_NAME, + .owner = THIS_MODULE, + .of_match_table = amlogic_audio_of_match, ++ .pm = &snd_soc_pm_ops, + }, + .probe = aml_m8_audio_probe, + }; diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c index 73223b1..5ef287b 100644 --- a/sound/soc/aml/m8/aml_spdif_codec.c @@ -400,6 +691,203 @@ index 73223b1..5ef287b 100644 #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) +diff --git a/sound/soc/aml/m8/aml_spdif_dai.c b/sound/soc/aml/m8/aml_spdif_dai.c +index f80c5e9..7b42d2d 100644 +--- a/sound/soc/aml/m8/aml_spdif_dai.c ++++ b/sound/soc/aml/m8/aml_spdif_dai.c +@@ -73,12 +73,15 @@ struct aml_spdif { + int old_samplerate; + }; + struct aml_spdif *spdif_p; +-/* ++unsigned int clk81 = 0; ++EXPORT_SYMBOL(clk81); ++ + static int iec958buf[32 + 16]; +-*/ ++static int old_samplerate = -1; ++ + void aml_spdif_play(void) + { +-#if 0 ++#if 1 + struct _aiu_958_raw_setting_t set; + struct _aiu_958_channel_status_t chstat; + struct snd_pcm_substream substream; +@@ -96,12 +99,28 @@ void aml_spdif_play(void) + set.chan_stat->chstat1_l = 0X200; + set.chan_stat->chstat1_r = 0X200; + audio_hw_958_enable(0); +- if (last_iec_clock != AUDIO_CLK_FREQ_48) { +- ALSA_PRINT("enterd %s,set_clock:%d,sample_rate=%d\n", __func__, +- last_iec_clock, AUDIO_CLK_FREQ_48); +- last_iec_clock = AUDIO_CLK_FREQ_48; +- audio_set_958_clk(AUDIO_CLK_FREQ_48, AUDIO_CLK_256FS); ++ if (old_samplerate != AUDIO_CLK_FREQ_48) { ++ pr_info("enterd %s,set_clock:%d,sample_rate=%d\n", ++ __func__, old_samplerate, AUDIO_CLK_FREQ_48); ++ old_samplerate = AUDIO_CLK_FREQ_48; ++ aml_set_spdif_clk(48000 * 512, 0); ++ } ++ /* Todo, div can be changed, for most case, div = 2 */ ++ /* audio_set_spdif_clk_div(); */ ++ /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ ++ if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || ++ IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { ++ pr_info("set 4x audio clk for 958\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); ++ } else if (0) { ++ pr_info("share the same clock\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); ++ } else { ++ pr_info("set normal 512 fs /4 fs\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); + } ++ /* enable 958 divider */ ++ aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); + audio_util_set_dac_958_format(AUDIO_ALGOUT_DAC_FORMAT_DSP); + memset(iec958buf, 0, sizeof(iec958buf)); + audio_set_958outbuf((virt_to_phys(iec958buf) + 63) & (~63), 128, 0); +@@ -237,7 +256,26 @@ void aml_hw_iec958_init(struct snd_pcm_substream *substream) + runtime->rate, sample_rate); + /* int srate; */ + /* srate = params_rate(params); */ +- aml_set_spdif_clk(runtime->rate * 512, 0); ++ if (old_samplerate != sample_rate) { ++ old_samplerate = sample_rate; ++ aml_set_spdif_clk(runtime->rate * 512, 0); ++ } ++ /* Todo, div can be changed, for most case, div = 2 */ ++ /* audio_set_spdif_clk_div(); */ ++ /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ ++ if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || ++ IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { ++ pr_info("set 4x audio clk for 958\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); ++ } else if (0) { ++ pr_info("share the same clock\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); ++ } else { ++ pr_info("set normal 512 fs /4 fs\n"); ++ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); ++ } ++ /* enable 958 divider */ ++ aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); + audio_util_set_dac_958_format(AUDIO_ALGOUT_DAC_FORMAT_DSP); + /*clear the same source function as new raw data output */ + audio_i2s_958_same_source(0); +@@ -357,7 +395,12 @@ void aml_hw_iec958_init(struct snd_pcm_substream *substream) + aml_write_cbus(AIU_958_CHSTAT_L1, 0x900); + aml_write_cbus(AIU_958_CHSTAT_R0, 0x1902); + aml_write_cbus(AIU_958_CHSTAT_R1, 0x900); +- aout_notifier_call_chain(AOUT_EVENT_RAWDATA_MAT_MLP, substream); ++ if (IEC958_mode_codec == 8) ++ aout_notifier_call_chain(AOUT_EVENT_RAWDATA_DTS_HD_MA, ++ substream); ++ else ++ aout_notifier_call_chain(AOUT_EVENT_RAWDATA_MAT_MLP, ++ substream); + } else { + aout_notifier_call_chain(AOUT_EVENT_IEC_60958_PCM, substream); + } +@@ -508,22 +551,6 @@ int aml_set_spdif_clk(unsigned long rate, bool src_i2s) + } + } + +- /* Todo, div can be changed, for most case, div = 2 */ +- /* audio_set_spdif_clk_div(); */ +- /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ +- if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || +- IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { +- pr_info("set 4x audio clk for 958\n"); +- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); +- } else if (src_i2s) { +- pr_info("share the same clock\n"); +- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); +- } else { +- pr_info("set normal 512 fs /4 fs\n"); +- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); +- } +- /* enable 958 divider */ +- aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); + return 0; + } + +@@ -540,24 +567,27 @@ static int aml_dai_spdif_hw_params(struct snd_pcm_substream *substream, + return 0; + } + +-#ifdef CONFIG_PM + static int aml_dai_spdif_suspend(struct snd_soc_dai *cpu_dai) + { +- ALSA_TRACE(); ++ struct aml_spdif *spdif_priv = dev_get_drvdata(cpu_dai->dev); ++ + aml_spdif_play_stop(); ++ if (spdif_priv && spdif_priv->clk_spdif) ++ clk_disable_unprepare(spdif_priv->clk_spdif); ++ + return 0; + } + + static int aml_dai_spdif_resume(struct snd_soc_dai *cpu_dai) + { +- ALSA_TRACE(); +- aml_spdif_play(); ++ struct aml_spdif *spdif_priv = dev_get_drvdata(cpu_dai->dev); ++ ++ /*aml_spdif_play();*/ ++ if (spdif_priv && spdif_priv->clk_spdif) ++ clk_prepare_enable(spdif_priv->clk_spdif); ++ + return 0; + } +-#else +-#define aml_spdif_suspend NULL +-#define aml_spdif_resume NULL +-#endif + + static struct snd_soc_dai_ops spdif_dai_ops = { + .set_sysclk = aml_dai_spdif_set_sysclk, +@@ -660,6 +690,18 @@ static int aml_dai_spdif_probe(struct platform_device *pdev) + goto err; + } + ++ ret = clk_set_parent(spdif_priv->clk_i958, spdif_priv->clk_mpl1); ++ if (ret) { ++ pr_err("Can't set i958 clk parent: %d\n", ret); ++ return ret; ++ } ++ ++ ret = clk_set_parent(spdif_priv->clk_spdif, spdif_priv->clk_i958); ++ if (ret) { ++ pr_err("Can't set spdif clk parent: %d\n", ret); ++ return ret; ++ } ++ + ret = clk_prepare_enable(spdif_priv->clk_spdif); + if (ret) { + pr_err("Can't enable spdif clock: %d\n", ret); +diff --git a/sound/soc/aml/m8/aml_spdif_dai.h b/sound/soc/aml/m8/aml_spdif_dai.h +index 8fe56ca..fd11637 100644 +--- a/sound/soc/aml/m8/aml_spdif_dai.h ++++ b/sound/soc/aml/m8/aml_spdif_dai.h +@@ -33,7 +33,7 @@ + #define AOUT_EVENT_RAWDATA_MAT_MLP 0xC + #define AOUT_EVENT_RAWDATA_DST 0xD + #define AOUT_EVENT_RAWDATA_WMA_PRO 0xE +- ++#define AOUT_EVENT_RAWDATA_DTS_HD_MA (AOUT_EVENT_RAWDATA_DTS_HD|(1<<8)) + extern unsigned int IEC958_mode_codec; + + /* +@@ -47,5 +47,5 @@ extern unsigned int IEC958_mode_codec; + */ + void aml_hw_iec958_init(struct snd_pcm_substream *substream); + int aml_set_spdif_clk(unsigned long rate, bool src_i2s); +- ++void aml_spdif_play(void); + #endif /* _AML_SPDIF_DAI_H */ diff --git a/sound/soc/aml/m8/odroid_dac.c b/sound/soc/aml/m8/odroid_dac.c deleted file mode 100644 index aaf8fbd..0000000 diff --git a/projects/Odroid_C2/patches/linux/linux-005-set-default-refresh-rate-switching-policy.patch b/projects/Odroid_C2/patches/linux/linux-005-set-default-refresh-rate-switching-policy.patch deleted file mode 100644 index ed4aa2d631..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-005-set-default-refresh-rate-switching-policy.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur a/drivers/amlogic/display/vout/tv_vout.c b/drivers/amlogic/display/vout/tv_vout.c ---- a/drivers/amlogic/display/vout/tv_vout.c 2016-04-06 23:18:37.000000000 -0700 -+++ b/drivers/amlogic/display/vout/tv_vout.c 2016-04-14 02:05:33.041542772 -0700 -@@ -70,8 +70,8 @@ - #ifdef CONFIG_AML_VOUT_FRAMERATE_AUTOMATION - #define DEFAULT_POLICY_FR_AUTO 1 - static enum vmode_e mode_by_user = VMODE_INIT_NULL; --static int fr_auto_policy = DEFAULT_POLICY_FR_AUTO; --static int fr_auto_policy_hold = DEFAULT_POLICY_FR_AUTO; -+static int fr_auto_policy = 0; -+static int fr_auto_policy_hold = 2; - static int fps_playing_flag; - static enum vmode_e fps_target_mode = VMODE_INIT_NULL; - static void policy_framerate_automation_switch_store(char *para); -@@ -1532,8 +1532,8 @@ - } - - #ifdef CONFIG_AML_VOUT_FRAMERATE_AUTOMATION -- sprintf(policy_fr_auto, "%d", DEFAULT_POLICY_FR_AUTO); -- sprintf(policy_fr_auto_switch, "%d", DEFAULT_POLICY_FR_AUTO); -+ sprintf(policy_fr_auto, "%d", 0); -+ sprintf(policy_fr_auto_switch, "%d", 2); - #endif - return 0; - } diff --git a/projects/Odroid_C2/patches/linux/linux-007-Audio-Report-only-working-frequecies-and-bit-depths.patch b/projects/Odroid_C2/patches/linux/linux-007-Audio-Report-only-working-frequecies-and-bit-depths.patch deleted file mode 100644 index 6b50e4e02b..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-007-Audio-Report-only-working-frequecies-and-bit-depths.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 852df2b075af5c13bea74baaf85bbde6c7f351e4 Mon Sep 17 00:00:00 2001 -From: Jamie Coldhill -Date: Fri, 16 Sep 2016 19:15:19 +0800 -Subject: [PATCH] Report only working frequecies and bit depths - ---- - sound/soc/aml/m8/aml_i2s_dai.c | 5 ++--- - sound/soc/aml/m8/aml_spdif_codec.c | 5 ++--- - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c -index 7f86c32..690faf6 100644 ---- a/sound/soc/aml/m8/aml_i2s_dai.c -+++ b/sound/soc/aml/m8/aml_i2s_dai.c -@@ -343,9 +343,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai) - #define aml_dai_i2s_resume NULL - #endif /* CONFIG_PM */ - --#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_384000) --#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - static struct snd_soc_dai_ops aml_dai_i2s_ops = { - .startup = aml_dai_i2s_startup, -diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c -index 5ef287b..85f2833 100644 ---- a/sound/soc/aml/m8/aml_spdif_codec.c -+++ b/sound/soc/aml/m8/aml_spdif_codec.c -@@ -26,9 +26,8 @@ - - #define DRV_NAME "spdif-dit" - --#define STUB_RATES SNDRV_PCM_RATE_8000_192000 --#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - static struct snd_soc_codec_driver soc_codec_spdif_dit; - --- -1.9.1 - From bb44c577365a6d206e3cee30e2d1ceec77fe82bf Mon Sep 17 00:00:00 2001 From: Jamie Coldhill Date: Tue, 20 Sep 2016 00:43:22 +0800 Subject: [PATCH 4/4] linux.conf: add HK RTC Shield & disable TFT Touchscreen --- projects/Odroid_C2/linux/linux.aarch64.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/Odroid_C2/linux/linux.aarch64.conf b/projects/Odroid_C2/linux/linux.aarch64.conf index dc16aea02b..e9ef18f652 100644 --- a/projects/Odroid_C2/linux/linux.aarch64.conf +++ b/projects/Odroid_C2/linux/linux.aarch64.conf @@ -2605,6 +2605,7 @@ CONFIG_MALI_DT=y # CONFIG_MALI_QUIET is not set CONFIG_UMP=y # CONFIG_UMP_DEBUG is not set +# CONFIG_FB_TFT is not set CONFIG_SOUND=y # CONFIG_SOUND_OSS_CORE is not set CONFIG_SND=y @@ -3075,7 +3076,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_X1205 is not set # CONFIG_RTC_DRV_PCF2127 is not set # CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF8563 is not set +CONFIG_RTC_DRV_PCF8563=m # CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_M41T80 is not set # CONFIG_RTC_DRV_BQ32K is not set