Commit d731c1a0 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: fsl_esai: Add support for imx8qm" from Shengjiu Wang <shengjiu.wang@nxp.com>:

Add support for imx8qm.

Shengjiu Wang (2):
  ASoC: fsl_esai: introduce SoC specific data
  ASoC: fsl_esai: Add new compatible string for imx8qm

Changes in v2
- drop the 0002 patch in v1, the dma relate limitation should
  be done in dma driver, or define a new DMA API for it.

 .../devicetree/bindings/sound/fsl,esai.txt    |  1 +
 sound/soc/fsl/fsl_esai.c                      | 46 +++++++++++++++----
 2 files changed, 38 insertions(+), 9 deletions(-)

--
2.21.0
parents 93fa0af4 d59628b3
...@@ -12,6 +12,7 @@ Required properties: ...@@ -12,6 +12,7 @@ Required properties:
"fsl,imx35-esai", "fsl,imx35-esai",
"fsl,vf610-esai", "fsl,vf610-esai",
"fsl,imx6ull-esai", "fsl,imx6ull-esai",
"fsl,imx8qm-esai",
- reg : Offset and length of the register set for the device. - reg : Offset and length of the register set for the device.
......
...@@ -21,6 +21,17 @@ ...@@ -21,6 +21,17 @@
SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE) SNDRV_PCM_FMTBIT_S24_LE)
/**
* fsl_esai_soc_data: soc specific data
*
* @imx: for imx platform
* @reset_at_xrun: flags for enable reset operaton
*/
struct fsl_esai_soc_data {
bool imx;
bool reset_at_xrun;
};
/** /**
* fsl_esai: ESAI private data * fsl_esai: ESAI private data
* *
...@@ -33,6 +44,7 @@ ...@@ -33,6 +44,7 @@
* @fsysclk: system clock source to derive HCK, SCK and FS * @fsysclk: system clock source to derive HCK, SCK and FS
* @spbaclk: SPBA clock (optional, depending on SoC design) * @spbaclk: SPBA clock (optional, depending on SoC design)
* @task: tasklet to handle the reset operation * @task: tasklet to handle the reset operation
* @soc: soc specific data
* @lock: spin lock between hw_reset() and trigger() * @lock: spin lock between hw_reset() and trigger()
* @fifo_depth: depth of tx/rx FIFO * @fifo_depth: depth of tx/rx FIFO
* @slot_width: width of each DAI slot * @slot_width: width of each DAI slot
...@@ -44,7 +56,6 @@ ...@@ -44,7 +56,6 @@
* @sck_div: if using PSR/PM dividers for SCKx clock * @sck_div: if using PSR/PM dividers for SCKx clock
* @slave_mode: if fully using DAI slave mode * @slave_mode: if fully using DAI slave mode
* @synchronous: if using tx/rx synchronous mode * @synchronous: if using tx/rx synchronous mode
* @reset_at_xrun: flags for enable reset operaton
* @name: driver name * @name: driver name
*/ */
struct fsl_esai { struct fsl_esai {
...@@ -57,6 +68,7 @@ struct fsl_esai { ...@@ -57,6 +68,7 @@ struct fsl_esai {
struct clk *fsysclk; struct clk *fsysclk;
struct clk *spbaclk; struct clk *spbaclk;
struct tasklet_struct task; struct tasklet_struct task;
const struct fsl_esai_soc_data *soc;
spinlock_t lock; /* Protect hw_reset and trigger */ spinlock_t lock; /* Protect hw_reset and trigger */
u32 fifo_depth; u32 fifo_depth;
u32 slot_width; u32 slot_width;
...@@ -70,10 +82,24 @@ struct fsl_esai { ...@@ -70,10 +82,24 @@ struct fsl_esai {
bool sck_div[2]; bool sck_div[2];
bool slave_mode; bool slave_mode;
bool synchronous; bool synchronous;
bool reset_at_xrun;
char name[32]; char name[32];
}; };
static struct fsl_esai_soc_data fsl_esai_vf610 = {
.imx = false,
.reset_at_xrun = true,
};
static struct fsl_esai_soc_data fsl_esai_imx35 = {
.imx = true,
.reset_at_xrun = true,
};
static struct fsl_esai_soc_data fsl_esai_imx6ull = {
.imx = true,
.reset_at_xrun = false,
};
static irqreturn_t esai_isr(int irq, void *devid) static irqreturn_t esai_isr(int irq, void *devid)
{ {
struct fsl_esai *esai_priv = (struct fsl_esai *)devid; struct fsl_esai *esai_priv = (struct fsl_esai *)devid;
...@@ -85,7 +111,7 @@ static irqreturn_t esai_isr(int irq, void *devid) ...@@ -85,7 +111,7 @@ static irqreturn_t esai_isr(int irq, void *devid)
regmap_read(esai_priv->regmap, REG_ESAI_SAISR, &saisr); regmap_read(esai_priv->regmap, REG_ESAI_SAISR, &saisr);
if ((saisr & (ESAI_SAISR_TUE | ESAI_SAISR_ROE)) && if ((saisr & (ESAI_SAISR_TUE | ESAI_SAISR_ROE)) &&
esai_priv->reset_at_xrun) { esai_priv->soc->reset_at_xrun) {
dev_dbg(&pdev->dev, "reset module for xrun\n"); dev_dbg(&pdev->dev, "reset module for xrun\n");
regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR, regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR,
ESAI_xCR_xEIE_MASK, 0); ESAI_xCR_xEIE_MASK, 0);
...@@ -936,9 +962,11 @@ static int fsl_esai_probe(struct platform_device *pdev) ...@@ -936,9 +962,11 @@ static int fsl_esai_probe(struct platform_device *pdev)
esai_priv->pdev = pdev; esai_priv->pdev = pdev;
snprintf(esai_priv->name, sizeof(esai_priv->name), "%pOFn", np); snprintf(esai_priv->name, sizeof(esai_priv->name), "%pOFn", np);
if (of_device_is_compatible(np, "fsl,vf610-esai") || esai_priv->soc = of_device_get_match_data(&pdev->dev);
of_device_is_compatible(np, "fsl,imx35-esai")) if (!esai_priv->soc) {
esai_priv->reset_at_xrun = true; dev_err(&pdev->dev, "failed to get soc data\n");
return -ENODEV;
}
/* Get the addresses and IRQ */ /* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -1063,9 +1091,9 @@ static int fsl_esai_remove(struct platform_device *pdev) ...@@ -1063,9 +1091,9 @@ static int fsl_esai_remove(struct platform_device *pdev)
} }
static const struct of_device_id fsl_esai_dt_ids[] = { static const struct of_device_id fsl_esai_dt_ids[] = {
{ .compatible = "fsl,imx35-esai", }, { .compatible = "fsl,imx35-esai", .data = &fsl_esai_imx35 },
{ .compatible = "fsl,vf610-esai", }, { .compatible = "fsl,vf610-esai", .data = &fsl_esai_vf610 },
{ .compatible = "fsl,imx6ull-esai", }, { .compatible = "fsl,imx6ull-esai", .data = &fsl_esai_imx6ull },
{} {}
}; };
MODULE_DEVICE_TABLE(of, fsl_esai_dt_ids); MODULE_DEVICE_TABLE(of, fsl_esai_dt_ids);
......
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