From ca3a99d2ac6a03500664c53b68402bed317bcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Trainavi=C4=8Dius?= Date: Wed, 19 Mar 2025 19:55:57 +0200 Subject: [PATCH] Adding pisound-micro-overlay.dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Trainavičius --- arch/arm/boot/dts/overlays/Makefile | 1 + arch/arm/boot/dts/overlays/README | 15 ++ .../dts/overlays/pisound-micro-overlay.dts | 133 ++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 arch/arm/boot/dts/overlays/pisound-micro-overlay.dts --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -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 \ --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -3859,6 +3859,21 @@ Load: dtoverlay=pisound Params: +Name: pisound-micro +Info: Configures the Blokas Labs Pisound Micro card +Load: dtoverlay=pisound-micro,= +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 --- /dev/null +++ b/arch/arm/boot/dts/overlays/pisound-micro-overlay.dts @@ -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 +#include +#include + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&gpio>; + __overlay__ { + pisound_micro_pins: pisound_micro_pins { + brcm,pins = <16 26>; + brcm,function = ; + brcm,pull = ; + }; + }; + }; + + 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}"; + 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; + }; +}; + +/* vim: set ts=8 sw=8 noexpandtab: */