aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2019-07-09 20:32:28 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2019-07-14 12:44:14 +0200
commit42954857190b9df16d9d873ecc7f6cc38e013e44 (patch)
tree98c588f629ff534d458eb0884782ea99672d7634 /target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch
parentf1875e902d0afb7d9b9e5285b4fd8da7f6c5e30a (diff)
downloadupstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.gz
upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.bz2
upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.zip
brcm2708: add linux 4.19 support
Boot tested on Raspberry Pi B+ (BCM2708) and Raspberry Pi 2 (BCM2709) Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch')
-rw-r--r--target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch b/target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch
new file mode 100644
index 0000000000..b4cf231397
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.19/950-0432-sound-Fixes-for-audioinjector-octo-under-4.19.patch
@@ -0,0 +1,108 @@
+From 7ed120d6a2733f70a5c8ee15844e1f02aec3f421 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Thu, 21 Mar 2019 11:19:46 +0000
+Subject: [PATCH 432/703] sound: Fixes for audioinjector-octo under 4.19
+
+1. Move the DT alias declaration to the I2C shim in the cases
+where the shim is enabled. This works around a problem caused by a
+4.19 commit [1] that generates DT/OF uevents for I2C drivers.
+
+2. Fix the diagnostics in an error path of the soundcard driver to
+correctly identify the reason for the failure to load.
+
+3. Move the declaration of the clock node in the overlay outside
+the I2C node to avoid warnings.
+
+4. Sort the overlay nodes so that dependencies are only to earlier
+fragments, in an attempt to get runtime dtoverlay application to
+work (it still doesn't...)
+
+See: https://github.com/Audio-Injector/Octo/issues/14
+Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+
+[1] af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
+---
+ .../overlays/audioinjector-addons-overlay.dts | 19 ++++++++++++-------
+ sound/soc/bcm/audioinjector-octo-soundcard.c | 2 +-
+ sound/soc/codecs/cs42xx8-i2c.c | 7 +++++++
+ sound/soc/codecs/cs42xx8.c | 2 ++
+ 4 files changed, 22 insertions(+), 8 deletions(-)
+
+--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts
++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts
+@@ -13,6 +13,17 @@
+ };
+
+ fragment@1 {
++ target-path = "/";
++ __overlay__ {
++ cs42448_mclk: codec-mclk {
++ compatible = "fixed-clock";
++ #clock-cells = <0>;
++ clock-frequency = <49152000>;
++ };
++ };
++ };
++
++ fragment@2 {
+ target = <&i2c1>;
+ __overlay__ {
+ #address-cells = <1>;
+@@ -27,16 +38,10 @@
+ clock-names = "mclk";
+ status = "okay";
+ };
+-
+- cs42448_mclk: codec-mclk {
+- compatible = "fixed-clock";
+- #clock-cells = <0>;
+- clock-frequency = <49152000>;
+- };
+ };
+ };
+
+- fragment@2 {
++ fragment@3 {
+ target = <&sound>;
+ snd: __overlay__ {
+ compatible = "ai,audioinjector-octo-soundcard";
+--- a/sound/soc/bcm/audioinjector-octo-soundcard.c
++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c
+@@ -297,7 +297,7 @@ static int audioinjector_octo_probe(stru
+ dai->codec_name = NULL;
+ dai->codec_of_node = codec_node;
+ } else
+- if (!dai->cpu_of_node) {
++ if (!i2s_node) {
+ dev_err(&pdev->dev,
+ "i2s-controller missing or invalid in DT\n");
+ return -EINVAL;
+--- a/sound/soc/codecs/cs42xx8-i2c.c
++++ b/sound/soc/codecs/cs42xx8-i2c.c
+@@ -45,6 +45,13 @@ static struct i2c_device_id cs42xx8_i2c_
+ };
+ MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id);
+
++const struct of_device_id cs42xx8_of_match[] = {
++ { .compatible = "cirrus,cs42448", .data = &cs42448_data, },
++ { .compatible = "cirrus,cs42888", .data = &cs42888_data, },
++ { /* sentinel */ }
++};
++MODULE_DEVICE_TABLE(of, cs42xx8_of_match);
++
+ static struct i2c_driver cs42xx8_i2c_driver = {
+ .driver = {
+ .name = "cs42xx8",
+--- a/sound/soc/codecs/cs42xx8.c
++++ b/sound/soc/codecs/cs42xx8.c
+@@ -436,8 +436,10 @@ const struct of_device_id cs42xx8_of_mat
+ { .compatible = "cirrus,cs42888", .data = &cs42888_data, },
+ { /* sentinel */ }
+ };
++#if !IS_ENABLED(CONFIG_SND_SOC_CS42XX8_I2C)
+ MODULE_DEVICE_TABLE(of, cs42xx8_of_match);
+ EXPORT_SYMBOL_GPL(cs42xx8_of_match);
++#endif
+
+ int cs42xx8_probe(struct device *dev, struct regmap *regmap)
+ {