aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0425-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch
blob: 5277ed5094566c82f5446b3641b09602e1b05292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From e73043d1daa80325acaa769812baa36971b06eda Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 14 Jul 2016 10:40:20 +0100
Subject: [PATCH] config: Add driver for mcp23017 I2C GPIO expander

There is already an overlay for the mcp23017 I2C GPIO expander,
but it does nothing without the required driver module.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 arch/arm/configs/bcm2709_defconfig | 3 ++-
 arch/arm/configs/bcmrpi_defconfig  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/arch/arm/configs/bcm2709_defconfig
+++ b/arch/arm/configs/bcm2709_defconfig
@@ -619,6 +619,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_BCM_VIRT=y
 CONFIG_GPIO_ARIZONA=m
 CONFIG_GPIO_STMPE=y
+CONFIG_GPIO_MCP23S08=m
 CONFIG_W1=m
 CONFIG_W1_MASTER_DS2490=m
 CONFIG_W1_MASTER_DS2482=m
@@ -867,9 +868,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
 CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
 CONFIG_SND_DIGIDAC1_SOUNDCARD=m
-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
 CONFIG_SND_SOC_ADAU1701=m
 CONFIG_SND_SOC_WM8804_I2C=m
--- a/arch/arm/configs/bcmrpi_defconfig
+++ b/arch/arm/configs/bcmrpi_defconfig
@@ -611,6 +611,7 @@ CONFIG_PPS_CLIENT_GPIO=m
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_ARIZONA=m
 CONFIG_GPIO_STMPE=y
+CONFIG_GPIO_MCP23S08=m
 CONFIG_W1=m
 CONFIG_W1_MASTER_DS2490=m
 CONFIG_W1_MASTER_DS2482=m
@@ -859,9 +860,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
 CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
 CONFIG_SND_DIGIDAC1_SOUNDCARD=m
-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
 CONFIG_SND_SOC_ADAU1701=m
 CONFIG_SND_SOC_WM8804_I2C=m
ight">
From 27b7e48055d8d31d8a03dbe7d8d4fccbc3ad7f31 Mon Sep 17 00:00:00 2001
From: gtrainavicius <gtrainavicius@users.noreply.github.com>
Date: Sat, 10 Dec 2016 16:05:25 +0200
Subject: [PATCH] Pisound dynamic overlay (#1760)

Restructuring pisound-overlay.dts, so it can be loaded and unloaded dynamically using dtoverlay.

Print a logline when the kernel module is removed.
---
 arch/arm/boot/dts/overlays/pisound-overlay.dts | 94 ++++++++++++++------------
 sound/soc/bcm/pisound.c                        |  2 +
 2 files changed, 52 insertions(+), 44 deletions(-)

--- a/arch/arm/boot/dts/overlays/pisound-overlay.dts
+++ b/arch/arm/boot/dts/overlays/pisound-overlay.dts
@@ -26,6 +26,54 @@
 	compatible = "brcm,bcm2708";
 
 	fragment@0 {
+		target = <&spi0>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	fragment@1 {
+		target = <&spidev0>;
+		__overlay__ {
+			status = "disabled";
+		};
+	};
+
+	fragment@2 {
+		target = <&spidev1>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	fragment@3 {
+		target = <&spi0>;
+		__overlay__ {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			pisound_spi: pisound_spi@0{
+				compatible = "blokaslabs,pisound-spi";
+				reg = <0>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&spi0_pins>;
+				spi-max-frequency = <1000000>;
+			};
+		};
+	};
+
+	fragment@4 {
+		target-path = "/";
+		__overlay__ {
+			pcm5102a-codec {
+				#sound-dai-cells = <0>;
+				compatible = "ti,pcm5102a";
+				status = "okay";
+			};
+		};
+	};
+
+	fragment@5 {
 		target = <&sound>;
 		__overlay__ {
 			compatible = "blokaslabs,pisound";
@@ -49,7 +97,7 @@
 		};
 	};
 
-	fragment@1 {
+	fragment@6 {
 		target = <&gpio>;
 		__overlay__ {
 			pinctrl-names = "default";
@@ -63,52 +111,10 @@
 		};
 	};
 
-	fragment@2 {
+	fragment@7 {
 		target = <&i2s>;
 		__overlay__ {
 			status = "okay";
 		};
 	};
-
-	fragment@3 {
-		target-path = "/";
-		__overlay__ {
-			pcm5102a-codec {
-				#sound-dai-cells = <0>;
-				compatible = "ti,pcm5102a";
-				status = "okay";
-			};
-		};
-	};
-
-	fragment@4 {
-		target = <&spi0>;
-		__overlay__ {
-			status = "okay";
-
-			spidev@0{
-				status = "disabled";
-			};
-
-			spidev@1{
-				status = "okay";
-			};
-		};
-	};
-
-	fragment@5 {
-		target = <&spi0>;
-		__overlay__ {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			pisound_spi: pisound_spi@0{
-				compatible = "blokaslabs,pisound-spi";
-				reg = <0>;
-				pinctrl-names = "default";
-				pinctrl-0 = <&spi0_pins>;
-				spi-max-frequency = <1000000>;
-			};
-		};
-	};
 };
--- a/sound/soc/bcm/pisound.c
+++ b/sound/soc/bcm/pisound.c
@@ -954,6 +954,8 @@ static int pisnd_probe(struct platform_d
 
 static int pisnd_remove(struct platform_device *pdev)
 {
+	printi("Unloading.\n");
+
 	if (pisnd_kobj) {
 		kobject_put(pisnd_kobj);
 		pisnd_kobj = NULL;