* 0 indicates CPU driver is free to choose any value.
*/
unsigned rfs, bfs;
- /* I2S Controller's core clock */
- struct clk *clk;
/* Clock for generating I2S signals */
struct clk *op_clk;
/* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */
struct snd_soc_dai_driver *dai_drv;
int num_dais;
+ /* The I2S controller's core clock */
+ struct clk *clk;
+
/* The clock provider's data */
struct clk *clk_table[3];
struct clk_onecell_data clk_data;
#ifdef CONFIG_PM
static int i2s_runtime_suspend(struct device *dev)
{
+ struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev);
i2s->suspend_i2smod = readl(i2s->addr + I2SMOD);
if (i2s->op_clk)
clk_disable_unprepare(i2s->op_clk);
- clk_disable_unprepare(i2s->clk);
+ clk_disable_unprepare(priv->clk);
return 0;
}
static int i2s_runtime_resume(struct device *dev)
{
+ struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev);
int ret;
- ret = clk_prepare_enable(i2s->clk);
+ ret = clk_prepare_enable(priv->clk);
if (ret)
return ret;
if (i2s->op_clk) {
ret = clk_prepare_enable(i2s->op_clk);
if (ret) {
- clk_disable_unprepare(i2s->clk);
+ clk_disable_unprepare(priv->clk);
return ret;
}
}
regs_base = res->start;
- pri_dai->clk = devm_clk_get(&pdev->dev, "iis");
- if (IS_ERR(pri_dai->clk)) {
+ priv->clk = devm_clk_get(&pdev->dev, "iis");
+ if (IS_ERR(priv->clk)) {
dev_err(&pdev->dev, "Failed to get iis clock\n");
- return PTR_ERR(pri_dai->clk);
+ return PTR_ERR(priv->clk);
}
- ret = clk_prepare_enable(pri_dai->clk);
+ ret = clk_prepare_enable(priv->clk);
if (ret != 0) {
dev_err(&pdev->dev, "failed to enable clock: %d\n", ret);
return ret;
sec_dai->dma_playback.addr_width = 4;
sec_dai->addr = pri_dai->addr;
- sec_dai->clk = pri_dai->clk;
sec_dai->quirks = quirks;
sec_dai->idma_playback.addr = idma_addr;
sec_dai->pri_dai = pri_dai;
err_disable_pm:
pm_runtime_disable(&pdev->dev);
err_disable_clk:
- clk_disable_unprepare(pri_dai->clk);
+ clk_disable_unprepare(priv->clk);
i2s_delete_secondary_device(priv);
return ret;
}
static int samsung_i2s_remove(struct platform_device *pdev)
{
struct samsung_i2s_priv *priv = dev_get_drvdata(&pdev->dev);
- struct i2s_dai *pri_dai = samsung_i2s_get_pri_dai(&pdev->dev);
/* The secondary device has no driver data assigned */
if (!priv)
pm_runtime_disable(&pdev->dev);
i2s_unregister_clock_provider(priv);
- clk_disable_unprepare(pri_dai->clk);
+ clk_disable_unprepare(priv->clk);
pm_runtime_put_noidle(&pdev->dev);
i2s_delete_secondary_device(priv);