Skip to content

Commit b657771

Browse files
gtrainaviciuspopcornmix
authored andcommitted
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.
1 parent 23fc186 commit b657771

File tree

2 files changed

+52
-44
lines changed

2 files changed

+52
-44
lines changed

arch/arm/boot/dts/overlays/pisound-overlay.dts

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,54 @@
2626
compatible = "brcm,bcm2708";
2727

2828
fragment@0 {
29+
target = <&spi0>;
30+
__overlay__ {
31+
status = "okay";
32+
};
33+
};
34+
35+
fragment@1 {
36+
target = <&spidev0>;
37+
__overlay__ {
38+
status = "disabled";
39+
};
40+
};
41+
42+
fragment@2 {
43+
target = <&spidev1>;
44+
__overlay__ {
45+
status = "okay";
46+
};
47+
};
48+
49+
fragment@3 {
50+
target = <&spi0>;
51+
__overlay__ {
52+
#address-cells = <1>;
53+
#size-cells = <0>;
54+
55+
pisound_spi: pisound_spi@0{
56+
compatible = "blokaslabs,pisound-spi";
57+
reg = <0>;
58+
pinctrl-names = "default";
59+
pinctrl-0 = <&spi0_pins>;
60+
spi-max-frequency = <1000000>;
61+
};
62+
};
63+
};
64+
65+
fragment@4 {
66+
target-path = "/";
67+
__overlay__ {
68+
pcm5102a-codec {
69+
#sound-dai-cells = <0>;
70+
compatible = "ti,pcm5102a";
71+
status = "okay";
72+
};
73+
};
74+
};
75+
76+
fragment@5 {
2977
target = <&sound>;
3078
__overlay__ {
3179
compatible = "blokaslabs,pisound";
@@ -49,7 +97,7 @@
4997
};
5098
};
5199

52-
fragment@1 {
100+
fragment@6 {
53101
target = <&gpio>;
54102
__overlay__ {
55103
pinctrl-names = "default";
@@ -63,52 +111,10 @@
63111
};
64112
};
65113

66-
fragment@2 {
114+
fragment@7 {
67115
target = <&i2s>;
68116
__overlay__ {
69117
status = "okay";
70118
};
71119
};
72-
73-
fragment@3 {
74-
target-path = "/";
75-
__overlay__ {
76-
pcm5102a-codec {
77-
#sound-dai-cells = <0>;
78-
compatible = "ti,pcm5102a";
79-
status = "okay";
80-
};
81-
};
82-
};
83-
84-
fragment@4 {
85-
target = <&spi0>;
86-
__overlay__ {
87-
status = "okay";
88-
89-
spidev@0{
90-
status = "disabled";
91-
};
92-
93-
spidev@1{
94-
status = "okay";
95-
};
96-
};
97-
};
98-
99-
fragment@5 {
100-
target = <&spi0>;
101-
__overlay__ {
102-
#address-cells = <1>;
103-
#size-cells = <0>;
104-
105-
pisound_spi: pisound_spi@0{
106-
compatible = "blokaslabs,pisound-spi";
107-
reg = <0>;
108-
pinctrl-names = "default";
109-
pinctrl-0 = <&spi0_pins>;
110-
spi-max-frequency = <1000000>;
111-
};
112-
};
113-
};
114120
};

sound/soc/bcm/pisound.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,8 @@ static int pisnd_probe(struct platform_device *pdev)
954954

955955
static int pisnd_remove(struct platform_device *pdev)
956956
{
957+
printi("Unloading.\n");
958+
957959
if (pisnd_kobj) {
958960
kobject_put(pisnd_kobj);
959961
pisnd_kobj = NULL;

0 commit comments

Comments
 (0)