Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ axis Axis Communications AB
bananapi BIPAI KEJI LIMITED
bhf Beckhoff Automation GmbH & Co. KG
bitmain Bitmain Technologies
blokas Vilniaus Blokas UAB
blokaslabs Vilniaus Blokas UAB
boe BOE Technology Group Co., Ltd.
bosch Bosch Sensortec GmbH
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/vendor-prefixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ patternProperties:
description: Shenzhen BigTree Tech Co., LTD
"^bitmain,.*":
description: Bitmain Technologies
"^blokaslabs,.*":
"^blokas(labs)?,.*":
description: Vilniaus Blokas UAB
"^blutek,.*":
description: BluTek Power
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
piscreen.dtbo \
piscreen2r.dtbo \
pisound.dtbo \
pisound-micro.dtbo \
pisound-pi5.dtbo \
pitft22.dtbo \
pitft28-capacitive.dtbo \
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -3859,6 +3859,21 @@ Load: dtoverlay=pisound
Params: <None>


Name: pisound-micro
Info: Configures the Blokas Labs Pisound Micro card
Load: dtoverlay=pisound-micro,<param>=<val>
Params: input-mode 'differential' (default) or 'single-ended'.
Configures the input pin mode.
hp-out-mode 'capless-headphone' (default), 'headphone' or
'line-out'. Configures the HP output mode.
line-out-mode 'line-out' (default) or 'headphone'. Configures
the LINE_OUT pins for different impedances.
mono-out-mode 'line-out' (default) or 'headphone'. Configures
the MONO_OUT pin mode for different impedances.
Only available when hp-out-mode is not
'capless-headphone'.


Name: pisound-pi5
Info: Pi 5 specific overlay override for Blokas Labs Pisound card, see pisound
Load: dtoverlay=pisound-pi5
Expand Down
133 changes: 133 additions & 0 deletions arch/arm/boot/dts/overlays/pisound-micro-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Pisound Micro Linux kernel module.
* Copyright (C) 2017-2025 Vilniaus Blokas UAB, https://blokas.io/
*
* 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; version 2 of the
* License.
*
* 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.
*/

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/bcm2835.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
compatible = "brcm,bcm2835";

fragment@0 {
target = <&gpio>;
__overlay__ {
pisound_micro_pins: pisound_micro_pins {
brcm,pins = <16 26>;
brcm,function = <BCM2835_FSEL_GPIO_IN BCM2835_FSEL_GPIO_IN>;
brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_UP>;
};
};
};

fragment@1 {
target-path = "/";
__overlay__ {
clk_codec: clk-codec {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12000000>;
status = "okay";
};
};
};

fragment@2 {
target = <&i2c_arm>;
__overlay__ {
status = "okay";

#address-cells = <1>;
#size-cells = <0>;

pisound_micro_ctrl: pisound_micro_ctrl@12 {
compatible = "blokas,upisnd-ctrl";

pinctrl-names = "default";
pinctrl-0 = <&pisound_micro_pins>;

reg = <0x12>;
status = "okay";

interrupt-parent = <&gpio>;
interrupt-controller;
interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "data_available";

gpio-controller;
#gpio-cells = <2>;

data_available-gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};

pisound_micro_codec: upisnd_codec@3b {
#sound-dai-cells = <0>;
compatible = "blokas,upisnd-codec";
reg = <0x3b>;

clock-names = "mclk";
clocks = <&clk_codec>;

// Additional options with default values and alternative values:

//input-mode = "differential"; // Or "single-ended"

//hp-out-mode = "headphone"; // Or "capless-headphone"
// Or "line-out"

//line-out-mode = "line-out"; // Or "headphone"
//mono-out-mode = "line-out"; // Or "headphone"

status = "okay";
};
};
};

fragment@3 {
target = <&sound>;
__overlay__ {
compatible = "blokas,pisound-micro";
codec = <&pisound_micro_codec>;
ctrl = <&pisound_micro_ctrl>;
i2s-controller = <&i2s_clk_consumer>;
status = "okay";
};
};

fragment@4 {
target = <&i2s_clk_consumer>;
__overlay__ {
status = "okay";
};
};

__overrides__ {
input-mode=<&pisound_micro_codec>,"input-mode{single-ended,differential}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice use of lookup tables for input validation.

hp-out-mode=<&pisound_micro_codec>,
"hp-out-mode{capless-headphone,headphone,line-out}";
line-out-mode=<&pisound_micro_codec>,"line-out-mode{line-out,headphone}";
mono-out-mode=<&pisound_micro_codec>,"mono-out-mode{line-out,headphone}";
};

__exports__ {
pisound_micro_ctrl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you plan to use the label outside the overlay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an example how rotary-encoder driver could be used with that:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
	compatible = "brcm,bcm2835";

	fragment@0 {
		target-path = "/";
		__overlay__ {
			rotary_encoder@0 {
				compatible = "rotary-encoder";
				gpios = <&pisound_micro_ctrl 0 GPIO_ACTIVE_LOW>, <&pisound_micro_ctrl 1 GPIO_ACTIVE_LOW>;
				linux,axis = <0>;
				rotary-encoder,encoding = "binary";
				rotary-encoder,rollover;
			};
		};
	};
};

};
};

/* vim: set ts=8 sw=8 noexpandtab: */
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_PIMIDI=m
CONFIG_SND_PISOUND_MICRO=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_PIMIDI=m
CONFIG_SND_PISOUND_MICRO=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_PIMIDI=m
CONFIG_SND_PISOUND_MICRO=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_PIMIDI=m
CONFIG_SND_PISOUND_MICRO=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@ CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_PIMIDI=m
CONFIG_SND_PISOUND_MICRO=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
Expand Down
9 changes: 9 additions & 0 deletions sound/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,13 @@
To compile this driver as a module, choose M here: the module
will be called snd-pimidi.

config SND_PISOUND_MICRO

Check failure on line 276 in sound/drivers/Kconfig

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please write a help paragraph that fully describes the config symbol
tristate "Pisound Micro driver"
depends on SND_SEQUENCER && CRC8
help
Say Y here to include support for Blokas Pisound Micro.

To compile this driver as modules, choose M here: the modules
will be called snd-soc-upisnd-ctrl and snd-soc-upisnd-codec.

endif # SND_DRIVERS
2 changes: 1 addition & 1 deletion sound/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ obj-$(CONFIG_SND_MTS64) += snd-mts64.o
obj-$(CONFIG_SND_PIMIDI) += snd-pimidi.o
obj-$(CONFIG_SND_PORTMAN2X4) += snd-portman2x4.o

obj-$(CONFIG_SND) += opl3/ opl4/ mpu401/ vx/ pcsp/
obj-$(CONFIG_SND) += opl3/ opl4/ mpu401/ vx/ pcsp/ upisnd/
23 changes: 23 additions & 0 deletions sound/drivers/upisnd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Pisound Micro Linux kernel module.
# Copyright (C) 2017-2025 Vilniaus Blokas UAB, https://blokas.io/
#
# 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; version 2 of the
# License.
#
# 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 $(shell pwd)/Makefile.dev

ifdef M
-include $(M)/Makefile.dev
endif

obj-$(CONFIG_SND_PISOUND_MICRO) := snd-soc-upisnd-ctrl.o snd-soc-upisnd-codec.o
snd-soc-upisnd-ctrl-objs := upisnd_module.o upisnd_ctrl.o upisnd_comm.o upisnd_sound.o upisnd_midi.o upisnd_pins.o upisnd_gpio.o upisnd_sysfs.o upisnd_utils.o
snd-soc-upisnd-codec-objs := upisnd_codec.o
Loading
Loading