Commit 1a512d13 authored by Mark Brown's avatar Mark Brown

Add I2S support for the StarFive JH7110 SoC

Merge series from Xingyu Wu <xingyu.wu@starfivetech.com>:

This patch series adds I2S support for the StarFive JH7110 RISC-V
SoC based on Designware I2S controller. There has three I2S channels
(RX/TX0/TX1) on the JH7110 SoC, one of which is for record(RX) and
two for playback(TX).

The first patch adds support for the StarFive JH7110 SoC in the
Designware I2S bindings.
The second patch adds the ops to get data from platform bus in the
I2S driver.
The third patch adds support for the StarFive JH7110 SoC in
the Designware I2S driver.
The fourth patch fixes the name of I2STX1 pinmux.
The last patch adds device node of I2S RX/TX0/TX1 in JH7110 dts.

This patch series is based on Linux-next(20230818) which is merge
clock, syscon and dma nodes for the StarFive JH7110 SoC.

The series has been tested and works normally on the VisionFive 2
board by plugging an audio expansion board.
parents fd53c16b 52ea7c05
......@@ -17,6 +17,9 @@ properties:
- const: snps,designware-i2s
- enum:
- snps,designware-i2s
- starfive,jh7110-i2stx0
- starfive,jh7110-i2stx1
- starfive,jh7110-i2srx
reg:
maxItems: 1
......@@ -29,15 +32,36 @@ properties:
maxItems: 1
clocks:
description: Sampling rate reference clock
maxItems: 1
items:
- description: Sampling rate reference clock
- description: APB clock
- description: Audio master clock
- description: Inner audio master clock source
- description: External audio master clock source
- description: Bit clock
- description: Left/right channel clock
- description: External bit clock
- description: External left/right channel clock
minItems: 1
clock-names:
const: i2sclk
items:
- const: i2sclk
- const: apb
- const: mclk
- const: mclk_inner
- const: mclk_ext
- const: bclk
- const: lrck
- const: bclk_ext
- const: lrck_ext
minItems: 1
resets:
items:
- description: Optional controller resets
- description: controller reset of Sampling rate
minItems: 1
dmas:
items:
......@@ -51,6 +75,17 @@ properties:
- const: rx
minItems: 1
starfive,syscon:
$ref: /schemas/types.yaml#/definitions/phandle-array
items:
- items:
- description: phandle to System Register Controller sys_syscon node.
- description: I2S-rx enabled control offset of SYS_SYSCONSAIF__SYSCFG register.
- description: I2S-rx enabled control mask
description:
The phandle to System Register Controller syscon node and the I2S-rx(ADC)
enabled control offset and mask of SYS_SYSCONSAIF__SYSCFG register.
allOf:
- $ref: dai-common.yaml#
- if:
......@@ -66,6 +101,73 @@ allOf:
properties:
"#sound-dai-cells":
const: 0
- if:
properties:
compatible:
contains:
const: snps,designware-i2s
then:
properties:
clocks:
maxItems: 1
clock-names:
maxItems: 1
resets:
maxItems: 1
else:
properties:
resets:
minItems: 2
maxItems: 2
- if:
properties:
compatible:
contains:
const: starfive,jh7110-i2stx0
then:
properties:
clocks:
minItems: 5
maxItems: 5
clock-names:
minItems: 5
maxItems: 5
required:
- resets
- if:
properties:
compatible:
contains:
const: starfive,jh7110-i2stx1
then:
properties:
clocks:
minItems: 9
maxItems: 9
clock-names:
minItems: 9
maxItems: 9
required:
- resets
- if:
properties:
compatible:
contains:
const: starfive,jh7110-i2srx
then:
properties:
clocks:
minItems: 9
maxItems: 9
clock-names:
minItems: 9
maxItems: 9
required:
- resets
- starfive,syscon
else:
properties:
starfive,syscon: false
required:
- compatible
......
......@@ -21,6 +21,8 @@ struct i2s_clk_config_data {
u32 sample_rate;
};
struct dw_i2s_dev;
struct i2s_platform_data {
#define DWC_I2S_PLAY (1 << 0)
#define DWC_I2S_RECORD (1 << 1)
......@@ -42,6 +44,7 @@ struct i2s_platform_data {
void *capture_dma_data;
bool (*filter)(struct dma_chan *chan, void *slave);
int (*i2s_clk_cfg)(struct i2s_clk_config_data *config);
int (*i2s_pd_init)(struct dw_i2s_dev *dev);
};
struct i2s_dma_data {
......
This diff is collapsed.
......@@ -123,6 +123,7 @@ struct dw_i2s_dev {
u32 fifo_th;
u32 l_reg;
u32 r_reg;
bool is_jh7110; /* Flag for StarFive JH7110 SoC */
/* data related to DMA transfers b/w i2s and DMAC */
union dw_i2s_snd_dma_data play_dma_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment