Skip to content

Commit 6451246

Browse files
committed
ASoC: ti: davinci-i2s: Add features to McBSP
Merge series from Bastien Curutchet <bastien.curutchet@bootlin.com>: This series aims to add some features to McBSP driver. Convert bindings from .txt to .yaml. Add possibility to use an external clock as sample rate generator's input. Add handling of new formats (TDM, S24_LE, BP_FC). Enable the detection of unexpected frame pulses. Set the clock free-running mode according to SND_SOC_DAIFMT_[GATED/CONT] configuration in DAI format. Add ti,T1-framing[tx/rx] properties in DT. They allow to set the data delay to two bit-clock periods. This has been tested on a platform designed off of the DAVINCI/OMAP-L138 connected to 3 daisy-chained AD7767. An external clock drives the sample rate generator through the CLKS pin. The hardware I have only allowed me to test acquisition side of McBSP. It is connected to a 6 channels TDM and acts as Bit clock provider and Frame clock consumer.
2 parents e2ff3bd + 08e02fa commit 6451246

4 files changed

Lines changed: 333 additions & 123 deletions

File tree

Documentation/devicetree/bindings/sound/davinci-mcbsp.txt

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/davinci-mcbsp.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: McBSP Controller for TI SoCs
8+
9+
maintainers:
10+
- Bastien Curutchet <bastien.curutchet@bootlin.com>
11+
12+
allOf:
13+
- $ref: dai-common.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- ti,da850-mcbsp
19+
20+
reg:
21+
minItems: 1
22+
items:
23+
- description: CFG registers
24+
- description: data registers
25+
26+
reg-names:
27+
minItems: 1
28+
items:
29+
- const: mpu
30+
- const: dat
31+
32+
dmas:
33+
items:
34+
- description: transmission DMA channel
35+
- description: reception DMA channel
36+
37+
dma-names:
38+
items:
39+
- const: tx
40+
- const: rx
41+
42+
interrupts:
43+
items:
44+
- description: RX interrupt
45+
- description: TX interrupt
46+
47+
interrupt-names:
48+
items:
49+
- const: rx
50+
- const: tx
51+
52+
clocks:
53+
minItems: 1
54+
items:
55+
- description: functional clock
56+
- description: external input clock for sample rate generator.
57+
58+
clock-names:
59+
minItems: 1
60+
items:
61+
- const: fck
62+
- const: clks
63+
64+
power-domains:
65+
maxItems: 1
66+
67+
"#sound-dai-cells":
68+
const: 0
69+
70+
ti,T1-framing-tx:
71+
$ref: /schemas/types.yaml#/definitions/flag
72+
description:
73+
If the property is present, tx data delay is set to 2 bit clock periods.
74+
McBSP will insert a blank period (high-impedance period) before the first
75+
data bit. This can be used to interface to T1-framing devices.
76+
77+
ti,T1-framing-rx:
78+
$ref: /schemas/types.yaml#/definitions/flag
79+
description:
80+
If the property is present, rx data delay is set to 2 bit clock periods.
81+
McBSP will discard the bit preceding the data stream (called framing bit).
82+
This can be used to interface to T1-framing devices.
83+
84+
required:
85+
- "#sound-dai-cells"
86+
- compatible
87+
- reg
88+
- reg-names
89+
- dmas
90+
- dma-names
91+
- clocks
92+
93+
unevaluatedProperties: false
94+
95+
examples:
96+
- |
97+
mcbsp0@1d10000 {
98+
#sound-dai-cells = <0>;
99+
compatible = "ti,da850-mcbsp";
100+
pinctrl-names = "default";
101+
pinctrl-0 = <&mcbsp0_pins>;
102+
103+
reg = <0x111000 0x1000>,
104+
<0x311000 0x1000>;
105+
reg-names = "mpu", "dat";
106+
interrupts = <97>, <98>;
107+
interrupt-names = "rx", "tx";
108+
dmas = <&edma0 3 1>,
109+
<&edma0 2 1>;
110+
dma-names = "tx", "rx";
111+
112+
clocks = <&psc1 14>;
113+
};

include/linux/platform_data/davinci_asp.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ struct davinci_mcasp_pdata {
2525
unsigned sram_size_capture;
2626
struct gen_pool *sram_pool;
2727

28-
/*
29-
* If McBSP peripheral gets the clock from an external pin,
30-
* there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
31-
* and MCBSP_CLKS.
32-
* Depending on different hardware connections it is possible
33-
* to use this setting to change the behaviour of McBSP
34-
* driver.
35-
*/
36-
int clk_input_pin;
37-
3828
/*
3929
* This flag works when both clock and FS are outputs for the cpu
4030
* and makes clock more accurate (FS is not symmetrical and the
@@ -91,11 +81,6 @@ enum {
9181
MCASP_VERSION_OMAP, /* OMAP4/5 */
9282
};
9383

94-
enum mcbsp_clk_input_pin {
95-
MCBSP_CLKR = 0, /* as in DM365 */
96-
MCBSP_CLKS,
97-
};
98-
9984
#define INACTIVE_MODE 0
10085
#define TX_MODE 1
10186
#define RX_MODE 2

0 commit comments

Comments
 (0)