ASoC: Add SPDIF support for Allwinner SoCs
Subsystems (4)
v6 cover ASoC: Add SPDIF support for Allwinner SoCs
From: Marcus Cooper <[email protected]>
This patch set adds support for the Allwinner SPDIF transceiver.
For now just the SPDIF transmitter has been tested on a Mele A2000(A10) and a Itead Ibox(A20).
In order for this patch set to be functional we require an audio clock patch which will be delivered separately. For those that are interested I've pushed the patches here with all the required changes to get SPDIF audio out of the device.
https://github.com/codekipper/linux-sunxi/commits/spdif_delivery
Thanks in advance,
CK
---
Changes since v5:
- fixed warning that had sneaked in.'
Changes since v4:
- corrected indentation issues
- removed old macros
- removed unnecessary enabling of apb clock
Changes since v3:
- removed code required for spdif capture
- added disable/enable of apb clk to suspend/resume.
- removed unnecessary dt checks in probe
- fixed error conditions in probe/resume
- modified pm_runtime functionality and confirmed that driver worked when PM was disabled.
- removed .owner from platform driver
- renamed bindings file
Changes since v2:
- removed sunxi-machine-spdif and replaced with simple audio card
- removed untested compatibilities from device tree documentation
- added pm_runtime and remove shutdown
- removed pll2 as it's the parent of the spdif clock
- rename clk to spdif_clk
- removed enabling of mclk output
- removed interrupts status being cleared as it's not being used
- use default fifo settings for now
- fixed alignments for wrapped lines
Changes since v1:
- Moved sunxi-machine-spdif.c to separate patch
- replaced sunxi in naming scheme with sun4i in the sun4i-spdif driver.
- split tx controller into separate enable/disable functions
- moved setclk and setfmt functionality into hw params
- added support for mono signals.
- cleaned up probe clock set up.
- removed all writes to transmit status registers.
- removed of_id
- removed power management code.
- Added support for more rates.
Marcus Cooper (2):
dt-bindings: sunxi :add sun4i SPDIF transceiver
ASoC: sunxi: Add support for the SPDIF block
.../bindings/sound/sunxi,sun4i-spdif.txt | 39 ++ sound/soc/sunxi/Kconfig | 8 + sound/soc/sunxi/Makefile | 1 + sound/soc/sunxi/sun4i-spdif.c | 550 +++++++++++++++++++++ 4 files changed, 598 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt create mode 100644 sound/soc/sunxi/sun4i-spdif.c
Signature · 1 line
2.7.1
PATCH v6 1/2 dt-bindings: sunxi :add sun4i SPDIF transceiver
From: Marcus Cooper <[email protected]>
Add devicetree bindings for the SPDIF transceiver found on found on Allwinners A10 and A20 SoCs.
--- .../bindings/sound/sunxi,sun4i-spdif.txt | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt
Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt new file +39 -0
@@ -0,0 +1,39 @@ +Allwinner Sony/Philips Digital Interface Format (S/PDIF) Controller + +The Allwinner S/PDIF audio block is a transceiver that allows the +processor to receive and transmit digital audio via an coaxial cable or +a fibre cable. +For now only playback is supported. + +Required properties: + + - compatible : should be one of the following: + - "allwinner,sun4i-a10-spdif": for the Allwinner A10 SoC + + - reg : Offset and length of the register set for the device. + + - interrupts : Contains the spdif interrupt. + + - dmas : Generic dma devicetree binding as described in + Documentation/devicetree/bindings/dma/dma.txt. + + - dma-names : Two dmas have to be defined, "tx" and "rx". + + - clocks : Contains an entry for each entry in clock-names. + + - clock-names : Includes the following entries: + "apb" clock for the spdif bus. + "spdif" clock for spdif controller. + +Example: + +spdif: spdif@01c21000 { + compatible = "allwinner,sun4i-a10-spdif"; + reg = <0x01c21000 0x40>; + interrupts = <13>; + clocks = <&apb0_gates 1>, <&spdif_clk>; + clock-names = "apb", "spdif"; + dmas = <&dma 0 2>, <&dma 0 2>; + dma-names = "rx", "tx"; + status = "okay"; +};
Signature · 1 line
2.7.1
Re: [PATCH v6 1/2] dt-bindings: sunxi :add sun4i SPDIF transceiver
Quoted 6 lines · On Mon, Feb 08, 2016 at 06:09:20PM +0100…
From: Marcus Cooper <[email protected]>
Add devicetree bindings for the SPDIF transceiver found on found on Allwinners A10 and A20 SoCs.
Signed-off-by Marcus Cooper <[email protected]>
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Mark Brown
maintainerRe: [PATCH v6 1/2] dt-bindings: sunxi :add sun4i SPDIF transceiver
In reply to [email protected]Quoted 4 lines · On Mon, Feb 08, 2016 at 06:09:20PM +0100…
From: Marcus Cooper <[email protected]>
Add devicetree bindings for the SPDIF transceiver found on found on Allwinners A10 and A20 SoCs.
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
PATCH v6 2/2 ASoC: sunxi: Add support for the SPDIF block
In reply to [email protected]From: Marcus Cooper <[email protected]>
The sun4i, sun5i and sun7i SoC families have an SPDIF block which is capable of playback and capture.
This patch enables the playback of this block for
the sun4i families.
--- sound/soc/sunxi/Kconfig | 8 + sound/soc/sunxi/Makefile | 1 + sound/soc/sunxi/sun4i-spdif.c | 550 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 559 insertions(+) create mode 100644 sound/soc/sunxi/sun4i-spdif.c
sound/soc/sunxi/Kconfig +8 -0
@@ -8,4 +8,12 @@ config SND_SUN4I_CODEC Select Y or M to add support for the Codec embedded in the Allwinner A10 and affiliated SoCs. +config SND_SUN4I_SPDIF + tristate "Allwinner A10 SPDIF Support" + depends on OF + select SND_SOC_GENERIC_DMAENGINE_PCM + select REGMAP_MMIO + help + Say Y or M to add support for the S/PDIF audio block in the Allwinner + A10 and affiliated SoCs. endmenu
sound/soc/sunxi/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o +obj-$(CONFIG_SND_SUN4I_SPDIF) += sun4i-spdif.o
sound/soc/sunxi/sun4i-spdif.c new file +550 -0
550 lines not on this page · raw message
Signature · 1 line
2.7.1
Re: [PATCH v6 2/2] ASoC: sunxi: Add support for the SPDIF block
Hi,
Sorry for the late reply,
Quoted 9 lines · On Mon, Feb 08, 2016 at 06:09:21PM +0100…
From: Marcus Cooper <[email protected]>
The sun4i, sun5i and sun7i SoC families have an SPDIF block which is capable of playback and capture.
This patch enables the playback of this block for
the sun4i families.Signed-off-by Marcus Cooper <[email protected]>
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Mark Brown
maintainerApplied "ASoC: sunxi: Add support for the SPDIF block" to the asoc tree
In reply to [email protected]The patch
ASoC: sunxi: Add support for the SPDIF block
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
f8260afa444b670016f22f2ba1440d9d2e74dcb6Mon Sep 17 00:00:00 2001
From: Marcus Cooper <[email protected]>
Date: Mon, 8 Feb 2016 18:09:21 +0100
Subject: [PATCH] ASoC: sunxi: Add support for the SPDIF block
The sun4i, sun5i and sun7i SoC families have an SPDIF block which is capable of playback and capture.
This patch enables the playback of this block for
the sun4i families.
--- sound/soc/sunxi/Kconfig | 8 + sound/soc/sunxi/Makefile | 1 + sound/soc/sunxi/sun4i-spdif.c | 550 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 559 insertions(+) create mode 100644 sound/soc/sunxi/sun4i-spdif.c
sound/soc/sunxi/Kconfig +8 -0
@@ -8,4 +8,12 @@ config SND_SUN4I_CODEC Select Y or M to add support for the Codec embedded in the Allwinner A10 and affiliated SoCs. +config SND_SUN4I_SPDIF + tristate "Allwinner A10 SPDIF Support" + depends on OF + select SND_SOC_GENERIC_DMAENGINE_PCM + select REGMAP_MMIO + help + Say Y or M to add support for the S/PDIF audio block in the Allwinner + A10 and affiliated SoCs. endmenu
sound/soc/sunxi/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o +obj-$(CONFIG_SND_SUN4I_SPDIF) += sun4i-spdif.o
sound/soc/sunxi/sun4i-spdif.c new file +550 -0
550 lines not on this page · raw message
Signature · 1 line
2.7.0