Unverified Commit 1fbcc5ab authored by Mark Brown's avatar Mark Brown
Browse files

Add TDM audio on StarFive JH7110

Merge series from Walker Chen <walker.chen@starfivetech.com>:

This patchset adds TDM audio driver for the StarFive JH7110 SoC. The
first patch adds device tree binding for TDM module. The second patch
adds tdm driver support for JH7110 SoC. The last patch adds device tree
node and pins configuration of tdm to JH7110 dts.

The series has been tested on the VisionFive 2 board by plugging an
audio expansion board.

For more information of audio expansion board, you can take a look
at the following webpage:
https://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/
parents 089adf33 fd4762b6
Loading
Loading
Loading
Loading
+98 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/starfive,jh7110-tdm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7110 TDM Controller

description: |
  The TDM Controller is a Time Division Multiplexed audio interface
  integrated in StarFive JH7110 SoC, allowing up to 8 channels of
  audio over a serial interface. The TDM controller can operate both
  in master and slave mode.

maintainers:
  - Walker Chen <walker.chen@starfivetech.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - starfive,jh7110-tdm

  reg:
    maxItems: 1

  clocks:
    items:
      - description: TDM AHB Clock
      - description: TDM APB Clock
      - description: TDM Internal Clock
      - description: TDM Clock
      - description: Inner MCLK
      - description: TDM External Clock

  clock-names:
    items:
      - const: tdm_ahb
      - const: tdm_apb
      - const: tdm_internal
      - const: tdm
      - const: mclk_inner
      - const: tdm_ext

  resets:
    items:
      - description: tdm ahb reset line
      - description: tdm apb reset line
      - description: tdm core reset line

  dmas:
    items:
      - description: RX DMA Channel
      - description: TX DMA Channel

  dma-names:
    items:
      - const: rx
      - const: tx

  "#sound-dai-cells":
    const: 0

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - resets
  - dmas
  - dma-names
  - "#sound-dai-cells"

additionalProperties: false

examples:
  - |
    tdm@10090000 {
        compatible = "starfive,jh7110-tdm";
        reg = <0x10090000 0x1000>;
        clocks = <&syscrg 184>,
                 <&syscrg 185>,
                 <&syscrg 186>,
                 <&syscrg 187>,
                 <&syscrg 17>,
                 <&tdm_ext>;
        clock-names = "tdm_ahb", "tdm_apb",
                      "tdm_internal", "tdm",
                      "mclk_inner", "tdm_ext";
        resets = <&syscrg 105>,
                 <&syscrg 107>,
                 <&syscrg 106>;
        dmas = <&dma 20>, <&dma 21>;
        dma-names = "rx","tx";
        #sound-dai-cells = <0>;
    };
+6 −0
Original line number Diff line number Diff line
@@ -20127,6 +20127,12 @@ F: Documentation/devicetree/bindings/power/starfive*
F:	drivers/soc/starfive/jh71xx_pmu.c
F:	include/dt-bindings/power/starfive,jh7110-pmu.h
STARFIVE JH7110 TDM DRIVER
M:	Walker Chen <walker.chen@starfivetech.com>
S:	Maintained
F:	Documentation/devicetree/bindings/sound/starfive,jh7110-tdm.yaml
F:	sound/soc/starfive/jh7110_tdm.c
STARFIVE SOC DRIVERS
M:	Conor Dooley <conor@kernel.org>
S:	Maintained
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ source "sound/soc/sh/Kconfig"
source "sound/soc/sof/Kconfig"
source "sound/soc/spear/Kconfig"
source "sound/soc/sprd/Kconfig"
source "sound/soc/starfive/Kconfig"
source "sound/soc/sti/Kconfig"
source "sound/soc/stm/Kconfig"
source "sound/soc/sunxi/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ obj-$(CONFIG_SND_SOC) += sh/
obj-$(CONFIG_SND_SOC)	+= sof/
obj-$(CONFIG_SND_SOC)	+= spear/
obj-$(CONFIG_SND_SOC)	+= sprd/
obj-$(CONFIG_SND_SOC)	+= starfive/
obj-$(CONFIG_SND_SOC)	+= sti/
obj-$(CONFIG_SND_SOC)	+= stm/
obj-$(CONFIG_SND_SOC)	+= sunxi/
+15 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config SND_SOC_STARFIVE
	tristate "Audio support for StarFive SoC"
	depends on COMPILE_TEST || ARCH_STARFIVE
	help
	  Say Y or M if you want to add support for codecs attached to
	  the Starfive SoCs' Audio interfaces. You will also need to
	  select the audio interfaces to support below.

config SND_SOC_JH7110_TDM
	tristate "JH7110 TDM device driver"
	depends on HAVE_CLK && SND_SOC_STARFIVE
	select SND_SOC_GENERIC_DMAENGINE_PCM
	help
	  Say Y or M if you want to add support for StarFive TDM driver.
Loading