Commit 64512468 authored by Mark Brown's avatar Mark Brown

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.
parents e2ff3bd8 08e02fa4
Texas Instruments DaVinci McBSP module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This binding describes the "Multi-channel Buffered Serial Port" (McBSP)
audio interface found in some TI DaVinci processors like the OMAP-L138 or AM180x.
Required properties:
~~~~~~~~~~~~~~~~~~~~
- compatible :
"ti,da850-mcbsp" : for DA850, AM180x and OPAM-L138 platforms
- reg : physical base address and length of the controller memory mapped
region(s).
- reg-names : Should contain:
* "mpu" for the main registers (required).
* "dat" for the data FIFO (optional).
- dmas: three element list of DMA controller phandles, DMA request line and
TC channel ordered triplets.
- dma-names: identifier string for each DMA request line in the dmas property.
These strings correspond 1:1 with the ordered pairs in dmas. The dma
identifiers must be "rx" and "tx".
Optional properties:
~~~~~~~~~~~~~~~~~~~~
- interrupts : Interrupt numbers for McBSP
- interrupt-names : Known interrupt names are "rx" and "tx"
- pinctrl-0: Should specify pin control group used for this controller.
- pinctrl-names: Should contain only one value - "default", for more details
please refer to pinctrl-bindings.txt
Example (AM1808):
~~~~~~~~~~~~~~~~~
mcbsp0: mcbsp@1d10000 {
compatible = "ti,da850-mcbsp";
pinctrl-names = "default";
pinctrl-0 = <&mcbsp0_pins>;
reg = <0x00110000 0x1000>,
<0x00310000 0x1000>;
reg-names = "mpu", "dat";
interrupts = <97 98>;
interrupt-names = "rx", "tx";
dmas = <&edma0 3 1
&edma0 2 1>;
dma-names = "tx", "rx";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/davinci-mcbsp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: McBSP Controller for TI SoCs
maintainers:
- Bastien Curutchet <bastien.curutchet@bootlin.com>
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
enum:
- ti,da850-mcbsp
reg:
minItems: 1
items:
- description: CFG registers
- description: data registers
reg-names:
minItems: 1
items:
- const: mpu
- const: dat
dmas:
items:
- description: transmission DMA channel
- description: reception DMA channel
dma-names:
items:
- const: tx
- const: rx
interrupts:
items:
- description: RX interrupt
- description: TX interrupt
interrupt-names:
items:
- const: rx
- const: tx
clocks:
minItems: 1
items:
- description: functional clock
- description: external input clock for sample rate generator.
clock-names:
minItems: 1
items:
- const: fck
- const: clks
power-domains:
maxItems: 1
"#sound-dai-cells":
const: 0
ti,T1-framing-tx:
$ref: /schemas/types.yaml#/definitions/flag
description:
If the property is present, tx data delay is set to 2 bit clock periods.
McBSP will insert a blank period (high-impedance period) before the first
data bit. This can be used to interface to T1-framing devices.
ti,T1-framing-rx:
$ref: /schemas/types.yaml#/definitions/flag
description:
If the property is present, rx data delay is set to 2 bit clock periods.
McBSP will discard the bit preceding the data stream (called framing bit).
This can be used to interface to T1-framing devices.
required:
- "#sound-dai-cells"
- compatible
- reg
- reg-names
- dmas
- dma-names
- clocks
unevaluatedProperties: false
examples:
- |
mcbsp0@1d10000 {
#sound-dai-cells = <0>;
compatible = "ti,da850-mcbsp";
pinctrl-names = "default";
pinctrl-0 = <&mcbsp0_pins>;
reg = <0x111000 0x1000>,
<0x311000 0x1000>;
reg-names = "mpu", "dat";
interrupts = <97>, <98>;
interrupt-names = "rx", "tx";
dmas = <&edma0 3 1>,
<&edma0 2 1>;
dma-names = "tx", "rx";
clocks = <&psc1 14>;
};
......@@ -25,16 +25,6 @@ struct davinci_mcasp_pdata {
unsigned sram_size_capture;
struct gen_pool *sram_pool;
/*
* If McBSP peripheral gets the clock from an external pin,
* there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
* and MCBSP_CLKS.
* Depending on different hardware connections it is possible
* to use this setting to change the behaviour of McBSP
* driver.
*/
int clk_input_pin;
/*
* This flag works when both clock and FS are outputs for the cpu
* and makes clock more accurate (FS is not symmetrical and the
......@@ -91,11 +81,6 @@ enum {
MCASP_VERSION_OMAP, /* OMAP4/5 */
};
enum mcbsp_clk_input_pin {
MCBSP_CLKR = 0, /* as in DM365 */
MCBSP_CLKS,
};
#define INACTIVE_MODE 0
#define TX_MODE 1
#define RX_MODE 2
......
This diff is collapsed.
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