Commit 6ed91f5b authored by Mark Brown's avatar Mark Brown

Add PDM/DSD/dataline configuration support

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Support PDM format and DSD format.
Add new dts property to configure dataline. The SAI has multiple
successive FIFO registers, but in some use
case the required dataline/FIFOs are not successive.
parents 1e0ec034 e3f4e5b1
......@@ -49,6 +49,14 @@ Required properties:
receive data by following their own bit clocks and
frame sync clocks separately.
- fsl,dataline : configure the dataline. it has 3 value for each configuration
first one means the type: I2S(1) or PDM(2)
second one is dataline mask for 'rx'
third one is dataline mask for 'tx'.
for example: fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
it means I2S type rx mask is 0xff, tx mask is 0xff, PDM type
rx mask is 0xff, tx mask is 0x11 (dataline 1 and 4 enabled).
Optional properties:
- big-endian : Boolean property, required if all the SAI
......
This diff is collapsed.
......@@ -11,7 +11,10 @@
#define FSL_SAI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)
SNDRV_PCM_FMTBIT_S32_LE |\
SNDRV_PCM_FMTBIT_DSD_U8 |\
SNDRV_PCM_FMTBIT_DSD_U16_LE |\
SNDRV_PCM_FMTBIT_DSD_U32_LE)
/* SAI Register Map Register */
#define FSL_SAI_VERID 0x00 /* SAI Version ID Register */
......@@ -215,6 +218,13 @@
#define PMQOS_CPU_LATENCY BIT(0)
/* Max number of dataline */
#define FSL_SAI_DL_NUM (8)
/* default dataline type is zero */
#define FSL_SAI_DL_DEFAULT (0)
#define FSL_SAI_DL_I2S BIT(0)
#define FSL_SAI_DL_PDM BIT(1)
struct fsl_sai_soc_data {
bool use_imx_pcm;
bool use_edma;
......@@ -250,16 +260,28 @@ struct fsl_sai_param {
u32 dataline;
};
struct fsl_sai_dl_cfg {
unsigned int type;
unsigned int pins[2];
unsigned int mask[2];
unsigned int start_off[2];
unsigned int next_off[2];
};
struct fsl_sai {
struct platform_device *pdev;
struct regmap *regmap;
struct clk *bus_clk;
struct clk *mclk_clk[FSL_SAI_MCLK_MAX];
struct resource *res;
bool is_consumer_mode;
bool is_lsb_first;
bool is_dsp_mode;
bool is_pdm_mode;
bool synchronous[2];
struct fsl_sai_dl_cfg *dl_cfg;
unsigned int dl_cfg_cnt;
unsigned int mclk_id[2];
unsigned int mclk_streams;
......@@ -274,6 +296,8 @@ struct fsl_sai {
struct fsl_sai_verid verid;
struct fsl_sai_param param;
struct pm_qos_request pm_qos_req;
struct pinctrl *pinctrl;
struct pinctrl_state *pins_state;
};
#define TX 1
......
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