Skip to content

Commit

Permalink
ASoC: fsl_sai: Make res a member of struct fsl_sai
Browse files Browse the repository at this point in the history
The resource info need to be accessed by hw_params()
function for multi fifo case, the start address may
be not the FIFO0. So move it to be a member of
struct fsl_sai.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1655451877-16382-6-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Shengjiu Wang authored and Mark Brown committed Jun 27, 2022
1 parent b4ee8a9 commit cd640ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sound/soc/fsl/fsl_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ static int fsl_sai_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct fsl_sai *sai;
struct regmap *gpr;
struct resource *res;
void __iomem *base;
char tmp[8];
int irq, ret, i;
Expand All @@ -1092,7 +1091,7 @@ static int fsl_sai_probe(struct platform_device *pdev)

sai->is_lsb_first = of_property_read_bool(np, "lsb-first");

base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
base = devm_platform_get_and_ioremap_resource(pdev, 0, &sai->res);
if (IS_ERR(base))
return PTR_ERR(base);

Expand Down Expand Up @@ -1192,8 +1191,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
MCLK_DIR(index));
}

sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0;
sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0;
sai->dma_params_rx.addr = sai->res->start + FSL_SAI_RDR0;
sai->dma_params_tx.addr = sai->res->start + FSL_SAI_TDR0;
sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX;

Expand Down
1 change: 1 addition & 0 deletions sound/soc/fsl/fsl_sai.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ struct fsl_sai {
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;
Expand Down

0 comments on commit cd640ca

Please sign in to comment.