Skip to content

Commit bc47be1

Browse files
gtrainaviciuspopcornmix
authored andcommitted
Adding pisound-micro-overlay.dts
Signed-off-by: Giedrius Trainavičius <giedrius@blokas.io>
1 parent 6646aad commit bc47be1

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
213213
piscreen.dtbo \
214214
piscreen2r.dtbo \
215215
pisound.dtbo \
216+
pisound-micro.dtbo \
216217
pisound-pi5.dtbo \
217218
pitft22.dtbo \
218219
pitft28-capacitive.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,6 +3863,21 @@ Load: dtoverlay=pisound
38633863
Params: <None>
38643864

38653865

3866+
Name: pisound-micro
3867+
Info: Configures the Blokas Labs Pisound Micro card
3868+
Load: dtoverlay=pisound-micro,<param>=<val>
3869+
Params: input-mode 'differential' (default) or 'single-ended'.
3870+
Configures the input pin mode.
3871+
hp-out-mode 'capless-headphone' (default), 'headphone' or
3872+
'line-out'. Configures the HP output mode.
3873+
line-out-mode 'line-out' (default) or 'headphone'. Configures
3874+
the LINE_OUT pins for different impedances.
3875+
mono-out-mode 'line-out' (default) or 'headphone'. Configures
3876+
the MONO_OUT pin mode for different impedances.
3877+
Only available when hp-out-mode is not
3878+
'capless-headphone'.
3879+
3880+
38663881
Name: pisound-pi5
38673882
Info: Pi 5 specific overlay override for Blokas Labs Pisound card, see pisound
38683883
Load: dtoverlay=pisound-pi5
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* Pisound Micro Linux kernel module.
4+
* Copyright (C) 2017-2025 Vilniaus Blokas UAB, https://blokas.io/
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU General Public License
8+
* as published by the Free Software Foundation; version 2 of the
9+
* License.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*/
16+
17+
/dts-v1/;
18+
/plugin/;
19+
20+
#include <dt-bindings/gpio/gpio.h>
21+
#include <dt-bindings/pinctrl/bcm2835.h>
22+
#include <dt-bindings/interrupt-controller/irq.h>
23+
24+
/ {
25+
compatible = "brcm,bcm2835";
26+
27+
fragment@0 {
28+
target = <&gpio>;
29+
__overlay__ {
30+
pisound_micro_pins: pisound_micro_pins {
31+
brcm,pins = <16 26>;
32+
brcm,function = <BCM2835_FSEL_GPIO_IN BCM2835_FSEL_GPIO_IN>;
33+
brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_UP>;
34+
};
35+
};
36+
};
37+
38+
fragment@1 {
39+
target-path = "/";
40+
__overlay__ {
41+
clk_codec: clk-codec {
42+
compatible = "fixed-clock";
43+
#clock-cells = <0>;
44+
clock-frequency = <12000000>;
45+
status = "okay";
46+
};
47+
};
48+
};
49+
50+
fragment@2 {
51+
target = <&i2c_arm>;
52+
__overlay__ {
53+
status = "okay";
54+
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
58+
pisound_micro_ctrl: pisound_micro_ctrl@12 {
59+
compatible = "blokas,upisnd-ctrl";
60+
61+
pinctrl-names = "default";
62+
pinctrl-0 = <&pisound_micro_pins>;
63+
64+
reg = <0x12>;
65+
status = "okay";
66+
67+
interrupt-parent = <&gpio>;
68+
interrupt-controller;
69+
interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
70+
interrupt-names = "data_available";
71+
72+
gpio-controller;
73+
#gpio-cells = <2>;
74+
75+
data_available-gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
76+
reset-gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
77+
};
78+
79+
pisound_micro_codec: upisnd_codec@3b {
80+
#sound-dai-cells = <0>;
81+
compatible = "blokas,upisnd-codec";
82+
reg = <0x3b>;
83+
84+
clock-names = "mclk";
85+
clocks = <&clk_codec>;
86+
87+
// Additional options with default values and alternative values:
88+
89+
//input-mode = "differential"; // Or "single-ended"
90+
91+
//hp-out-mode = "headphone"; // Or "capless-headphone"
92+
// Or "line-out"
93+
94+
//line-out-mode = "line-out"; // Or "headphone"
95+
//mono-out-mode = "line-out"; // Or "headphone"
96+
97+
status = "okay";
98+
};
99+
};
100+
};
101+
102+
fragment@3 {
103+
target = <&sound>;
104+
__overlay__ {
105+
compatible = "blokas,pisound-micro";
106+
codec = <&pisound_micro_codec>;
107+
ctrl = <&pisound_micro_ctrl>;
108+
i2s-controller = <&i2s_clk_consumer>;
109+
status = "okay";
110+
};
111+
};
112+
113+
fragment@4 {
114+
target = <&i2s_clk_consumer>;
115+
__overlay__ {
116+
status = "okay";
117+
};
118+
};
119+
120+
__overrides__ {
121+
input-mode=<&pisound_micro_codec>,"input-mode{single-ended,differential}";
122+
hp-out-mode=<&pisound_micro_codec>,
123+
"hp-out-mode{capless-headphone,headphone,line-out}";
124+
line-out-mode=<&pisound_micro_codec>,"line-out-mode{line-out,headphone}";
125+
mono-out-mode=<&pisound_micro_codec>,"mono-out-mode{line-out,headphone}";
126+
};
127+
128+
__exports__ {
129+
pisound_micro_ctrl;
130+
};
131+
};
132+
133+
/* vim: set ts=8 sw=8 noexpandtab: */

0 commit comments

Comments
 (0)