Commit e2e16fa6 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mark Brown

ASoC: samsung: i2s: Move SFR pointer to common driver data structure

The SFR region is common for both DAIs so move related data structure
field from struct i2s_dai to the common driver data structure.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a4cbb465
...@@ -60,8 +60,7 @@ struct samsung_i2s_dai_data { ...@@ -60,8 +60,7 @@ struct samsung_i2s_dai_data {
struct i2s_dai { struct i2s_dai {
/* Platform device for this DAI */ /* Platform device for this DAI */
struct platform_device *pdev; struct platform_device *pdev;
/* Memory mapped SFR region */
void __iomem *addr;
/* Frame Clock */ /* Frame Clock */
unsigned frmclk; unsigned frmclk;
/* /*
...@@ -100,6 +99,9 @@ struct samsung_i2s_priv { ...@@ -100,6 +99,9 @@ struct samsung_i2s_priv {
struct platform_device *pdev; struct platform_device *pdev;
struct platform_device *pdev_sec; struct platform_device *pdev_sec;
/* Memory mapped SFR region */
void __iomem *addr;
/* Spinlock protecting access to the device's registers */ /* Spinlock protecting access to the device's registers */
spinlock_t spinlock; spinlock_t spinlock;
...@@ -143,7 +145,9 @@ static inline bool is_secondary(struct i2s_dai *i2s) ...@@ -143,7 +145,9 @@ static inline bool is_secondary(struct i2s_dai *i2s)
/* If operating in SoC-Slave mode */ /* If operating in SoC-Slave mode */
static inline bool is_slave(struct i2s_dai *i2s) static inline bool is_slave(struct i2s_dai *i2s)
{ {
u32 mod = readl(i2s->addr + I2SMOD); struct samsung_i2s_priv *priv = i2s->priv;
u32 mod = readl(priv->addr + I2SMOD);
return (mod & (1 << i2s->variant_regs->mss_off)) ? true : false; return (mod & (1 << i2s->variant_regs->mss_off)) ? true : false;
} }
...@@ -155,7 +159,7 @@ static inline bool tx_active(struct i2s_dai *i2s) ...@@ -155,7 +159,7 @@ static inline bool tx_active(struct i2s_dai *i2s)
if (!i2s) if (!i2s)
return false; return false;
active = readl(i2s->addr + I2SCON); active = readl(i2s->priv->addr + I2SCON);
if (is_secondary(i2s)) if (is_secondary(i2s))
active &= CON_TXSDMA_ACTIVE; active &= CON_TXSDMA_ACTIVE;
...@@ -193,7 +197,7 @@ static inline bool rx_active(struct i2s_dai *i2s) ...@@ -193,7 +197,7 @@ static inline bool rx_active(struct i2s_dai *i2s)
if (!i2s) if (!i2s)
return false; return false;
active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE; active = readl(i2s->priv->addr + I2SCON) & CON_RXDMA_ACTIVE;
return active ? true : false; return active ? true : false;
} }
...@@ -256,8 +260,10 @@ static inline bool is_manager(struct i2s_dai *i2s) ...@@ -256,8 +260,10 @@ static inline bool is_manager(struct i2s_dai *i2s)
/* Read RCLK of I2S (in multiples of LRCLK) */ /* Read RCLK of I2S (in multiples of LRCLK) */
static inline unsigned get_rfs(struct i2s_dai *i2s) static inline unsigned get_rfs(struct i2s_dai *i2s)
{ {
struct samsung_i2s_priv *priv = i2s->priv;
u32 rfs; u32 rfs;
rfs = readl(i2s->addr + I2SMOD) >> i2s->variant_regs->rfs_off;
rfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->rfs_off;
rfs &= i2s->variant_regs->rfs_mask; rfs &= i2s->variant_regs->rfs_mask;
switch (rfs) { switch (rfs) {
...@@ -275,7 +281,8 @@ static inline unsigned get_rfs(struct i2s_dai *i2s) ...@@ -275,7 +281,8 @@ static inline unsigned get_rfs(struct i2s_dai *i2s)
/* Write RCLK of I2S (in multiples of LRCLK) */ /* Write RCLK of I2S (in multiples of LRCLK) */
static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs)
{ {
u32 mod = readl(i2s->addr + I2SMOD); struct samsung_i2s_priv *priv = i2s->priv;
u32 mod = readl(priv->addr + I2SMOD);
int rfs_shift = i2s->variant_regs->rfs_off; int rfs_shift = i2s->variant_regs->rfs_off;
mod &= ~(i2s->variant_regs->rfs_mask << rfs_shift); mod &= ~(i2s->variant_regs->rfs_mask << rfs_shift);
...@@ -307,14 +314,16 @@ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) ...@@ -307,14 +314,16 @@ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs)
break; break;
} }
writel(mod, i2s->addr + I2SMOD); writel(mod, priv->addr + I2SMOD);
} }
/* Read Bit-Clock of I2S (in multiples of LRCLK) */ /* Read Bit-Clock of I2S (in multiples of LRCLK) */
static inline unsigned get_bfs(struct i2s_dai *i2s) static inline unsigned get_bfs(struct i2s_dai *i2s)
{ {
struct samsung_i2s_priv *priv = i2s->priv;
u32 bfs; u32 bfs;
bfs = readl(i2s->addr + I2SMOD) >> i2s->variant_regs->bfs_off;
bfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->bfs_off;
bfs &= i2s->variant_regs->bfs_mask; bfs &= i2s->variant_regs->bfs_mask;
switch (bfs) { switch (bfs) {
...@@ -333,7 +342,8 @@ static inline unsigned get_bfs(struct i2s_dai *i2s) ...@@ -333,7 +342,8 @@ static inline unsigned get_bfs(struct i2s_dai *i2s)
/* Write Bit-Clock of I2S (in multiples of LRCLK) */ /* Write Bit-Clock of I2S (in multiples of LRCLK) */
static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs)
{ {
u32 mod = readl(i2s->addr + I2SMOD); struct samsung_i2s_priv *priv = i2s->priv;
u32 mod = readl(priv->addr + I2SMOD);
int tdm = i2s->quirks & QUIRK_SUPPORTS_TDM; int tdm = i2s->quirks & QUIRK_SUPPORTS_TDM;
int bfs_shift = i2s->variant_regs->bfs_off; int bfs_shift = i2s->variant_regs->bfs_off;
...@@ -378,13 +388,13 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) ...@@ -378,13 +388,13 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs)
return; return;
} }
writel(mod, i2s->addr + I2SMOD); writel(mod, priv->addr + I2SMOD);
} }
/* Sample-Size */ /* Sample-Size */
static inline int get_blc(struct i2s_dai *i2s) static inline int get_blc(struct i2s_dai *i2s)
{ {
int blc = readl(i2s->addr + I2SMOD); int blc = readl(i2s->priv->addr + I2SMOD);
blc = (blc >> 13) & 0x3; blc = (blc >> 13) & 0x3;
...@@ -398,7 +408,8 @@ static inline int get_blc(struct i2s_dai *i2s) ...@@ -398,7 +408,8 @@ static inline int get_blc(struct i2s_dai *i2s)
/* TX Channel Control */ /* TX Channel Control */
static void i2s_txctrl(struct i2s_dai *i2s, int on) static void i2s_txctrl(struct i2s_dai *i2s, int on)
{ {
void __iomem *addr = i2s->addr; struct samsung_i2s_priv *priv = i2s->priv;
void __iomem *addr = priv->addr;
int txr_off = i2s->variant_regs->txr_off; int txr_off = i2s->variant_regs->txr_off;
u32 con = readl(addr + I2SCON); u32 con = readl(addr + I2SCON);
u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off);
...@@ -448,7 +459,8 @@ static void i2s_txctrl(struct i2s_dai *i2s, int on) ...@@ -448,7 +459,8 @@ static void i2s_txctrl(struct i2s_dai *i2s, int on)
/* RX Channel Control */ /* RX Channel Control */
static void i2s_rxctrl(struct i2s_dai *i2s, int on) static void i2s_rxctrl(struct i2s_dai *i2s, int on)
{ {
void __iomem *addr = i2s->addr; struct samsung_i2s_priv *priv = i2s->priv;
void __iomem *addr = priv->addr;
int txr_off = i2s->variant_regs->txr_off; int txr_off = i2s->variant_regs->txr_off;
u32 con = readl(addr + I2SCON); u32 con = readl(addr + I2SCON);
u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off);
...@@ -485,9 +497,9 @@ static inline void i2s_fifo(struct i2s_dai *i2s, u32 flush) ...@@ -485,9 +497,9 @@ static inline void i2s_fifo(struct i2s_dai *i2s, u32 flush)
return; return;
if (is_secondary(i2s)) if (is_secondary(i2s))
fic = i2s->addr + I2SFICS; fic = i2s->priv->addr + I2SFICS;
else else
fic = i2s->addr + I2SFIC; fic = i2s->priv->addr + I2SFIC;
/* Flush the FIFO */ /* Flush the FIFO */
writel(readl(fic) | flush, fic); writel(readl(fic) | flush, fic);
...@@ -516,7 +528,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, ...@@ -516,7 +528,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs,
pm_runtime_get_sync(dai->dev); pm_runtime_get_sync(dai->dev);
spin_lock_irqsave(i2s->lock, flags); spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD); mod = readl(priv->addr + I2SMOD);
spin_unlock_irqrestore(i2s->lock, flags); spin_unlock_irqrestore(i2s->lock, flags);
switch (clk_id) { switch (clk_id) {
...@@ -613,9 +625,9 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, ...@@ -613,9 +625,9 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs,
} }
spin_lock_irqsave(i2s->lock, flags); spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD); mod = readl(priv->addr + I2SMOD);
mod = (mod & ~mask) | val; mod = (mod & ~mask) | val;
writel(mod, i2s->addr + I2SMOD); writel(mod, priv->addr + I2SMOD);
spin_unlock_irqrestore(i2s->lock, flags); spin_unlock_irqrestore(i2s->lock, flags);
done: done:
pm_runtime_put(dai->dev); pm_runtime_put(dai->dev);
...@@ -698,7 +710,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -698,7 +710,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
pm_runtime_get_sync(dai->dev); pm_runtime_get_sync(dai->dev);
spin_lock_irqsave(i2s->lock, flags); spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD); mod = readl(priv->addr + I2SMOD);
/* /*
* Don't change the I2S mode if any controller is active on this * Don't change the I2S mode if any controller is active on this
* channel. * channel.
...@@ -714,7 +726,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -714,7 +726,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
mod &= ~(sdf_mask | lrp_rlow | mod_slave); mod &= ~(sdf_mask | lrp_rlow | mod_slave);
mod |= tmp; mod |= tmp;
writel(mod, i2s->addr + I2SMOD); writel(mod, priv->addr + I2SMOD);
spin_unlock_irqrestore(i2s->lock, flags); spin_unlock_irqrestore(i2s->lock, flags);
pm_runtime_put(dai->dev); pm_runtime_put(dai->dev);
...@@ -801,9 +813,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -801,9 +813,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
} }
spin_lock_irqsave(i2s->lock, flags); spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD); mod = readl(priv->addr + I2SMOD);
mod = (mod & ~mask) | val; mod = (mod & ~mask) | val;
writel(mod, i2s->addr + I2SMOD); writel(mod, priv->addr + I2SMOD);
spin_unlock_irqrestore(i2s->lock, flags); spin_unlock_irqrestore(i2s->lock, flags);
snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);
...@@ -837,7 +849,7 @@ static int i2s_startup(struct snd_pcm_substream *substream, ...@@ -837,7 +849,7 @@ static int i2s_startup(struct snd_pcm_substream *substream,
i2s->mode |= DAI_MANAGER; i2s->mode |= DAI_MANAGER;
if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR)) if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR))
writel(CON_RSTCLR, i2s->addr + I2SCON); writel(CON_RSTCLR, i2s->priv->addr + I2SCON);
spin_unlock_irqrestore(&lock, flags); spin_unlock_irqrestore(&lock, flags);
...@@ -920,7 +932,7 @@ static int config_setup(struct i2s_dai *i2s) ...@@ -920,7 +932,7 @@ static int config_setup(struct i2s_dai *i2s)
if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { if (!(i2s->quirks & QUIRK_NO_MUXPSR)) {
psr = priv->rclk_srcrate / i2s->frmclk / rfs; psr = priv->rclk_srcrate / i2s->frmclk / rfs;
writel(((psr - 1) << 8) | PSR_PSREN, i2s->addr + I2SPSR); writel(((psr - 1) << 8) | PSR_PSREN, priv->addr + I2SPSR);
dev_dbg(&i2s->pdev->dev, dev_dbg(&i2s->pdev->dev,
"RCLK_SRC=%luHz PSR=%u, RCLK=%dfs, BCLK=%dfs\n", "RCLK_SRC=%luHz PSR=%u, RCLK=%dfs, BCLK=%dfs\n",
priv->rclk_srcrate, psr, rfs, bfs); priv->rclk_srcrate, psr, rfs, bfs);
...@@ -1008,8 +1020,9 @@ static int i2s_set_clkdiv(struct snd_soc_dai *dai, ...@@ -1008,8 +1020,9 @@ static int i2s_set_clkdiv(struct snd_soc_dai *dai,
static snd_pcm_sframes_t static snd_pcm_sframes_t
i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
struct i2s_dai *i2s = to_info(dai); struct i2s_dai *i2s = to_info(dai);
u32 reg = readl(i2s->addr + I2SFIC); u32 reg = readl(priv->addr + I2SFIC);
snd_pcm_sframes_t delay; snd_pcm_sframes_t delay;
const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs; const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs;
...@@ -1018,7 +1031,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) ...@@ -1018,7 +1031,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
delay = FIC_RXCOUNT(reg); delay = FIC_RXCOUNT(reg);
else if (is_secondary(i2s)) else if (is_secondary(i2s))
delay = FICS_TXCOUNT(readl(i2s->addr + I2SFICS)); delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS));
else else
delay = (reg >> i2s_regs->ftx0cnt_off) & 0x7f; delay = (reg >> i2s_regs->ftx0cnt_off) & 0x7f;
...@@ -1042,6 +1055,7 @@ static int i2s_resume(struct snd_soc_dai *dai) ...@@ -1042,6 +1055,7 @@ static int i2s_resume(struct snd_soc_dai *dai)
static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
{ {
struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
struct i2s_dai *i2s = to_info(dai); struct i2s_dai *i2s = to_info(dai);
struct i2s_dai *other = get_other_dai(i2s); struct i2s_dai *other = get_other_dai(i2s);
unsigned long flags; unsigned long flags;
...@@ -1056,10 +1070,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) ...@@ -1056,10 +1070,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
&i2s->dma_capture); &i2s->dma_capture);
if (i2s->quirks & QUIRK_NEED_RSTCLR) if (i2s->quirks & QUIRK_NEED_RSTCLR)
writel(CON_RSTCLR, i2s->addr + I2SCON); writel(CON_RSTCLR, priv->addr + I2SCON);
if (i2s->quirks & QUIRK_SUPPORTS_IDMA) if (i2s->quirks & QUIRK_SUPPORTS_IDMA)
idma_reg_addr_init(i2s->addr, idma_reg_addr_init(priv->addr,
i2s->sec_dai->idma_playback.addr); i2s->sec_dai->idma_playback.addr);
} }
...@@ -1086,6 +1100,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) ...@@ -1086,6 +1100,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
{ {
struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
struct i2s_dai *i2s = to_info(dai); struct i2s_dai *i2s = to_info(dai);
unsigned long flags; unsigned long flags;
...@@ -1094,7 +1109,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) ...@@ -1094,7 +1109,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
if (!is_secondary(i2s)) { if (!is_secondary(i2s)) {
if (i2s->quirks & QUIRK_NEED_RSTCLR) { if (i2s->quirks & QUIRK_NEED_RSTCLR) {
spin_lock_irqsave(i2s->lock, flags); spin_lock_irqsave(i2s->lock, flags);
writel(0, i2s->addr + I2SCON); writel(0, priv->addr + I2SCON);
spin_unlock_irqrestore(i2s->lock, flags); spin_unlock_irqrestore(i2s->lock, flags);
} }
} }
...@@ -1205,11 +1220,10 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, ...@@ -1205,11 +1220,10 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
static int i2s_runtime_suspend(struct device *dev) static int i2s_runtime_suspend(struct device *dev)
{ {
struct samsung_i2s_priv *priv = dev_get_drvdata(dev); struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev);
priv->suspend_i2smod = readl(i2s->addr + I2SMOD); priv->suspend_i2smod = readl(priv->addr + I2SMOD);
priv->suspend_i2scon = readl(i2s->addr + I2SCON); priv->suspend_i2scon = readl(priv->addr + I2SCON);
priv->suspend_i2spsr = readl(i2s->addr + I2SPSR); priv->suspend_i2spsr = readl(priv->addr + I2SPSR);
if (priv->op_clk) if (priv->op_clk)
clk_disable_unprepare(priv->op_clk); clk_disable_unprepare(priv->op_clk);
...@@ -1221,7 +1235,6 @@ static int i2s_runtime_suspend(struct device *dev) ...@@ -1221,7 +1235,6 @@ static int i2s_runtime_suspend(struct device *dev)
static int i2s_runtime_resume(struct device *dev) static int i2s_runtime_resume(struct device *dev)
{ {
struct samsung_i2s_priv *priv = dev_get_drvdata(dev); struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev);
int ret; int ret;
ret = clk_prepare_enable(priv->clk); ret = clk_prepare_enable(priv->clk);
...@@ -1236,9 +1249,9 @@ static int i2s_runtime_resume(struct device *dev) ...@@ -1236,9 +1249,9 @@ static int i2s_runtime_resume(struct device *dev)
} }
} }
writel(priv->suspend_i2scon, i2s->addr + I2SCON); writel(priv->suspend_i2scon, priv->addr + I2SCON);
writel(priv->suspend_i2smod, i2s->addr + I2SMOD); writel(priv->suspend_i2smod, priv->addr + I2SMOD);
writel(priv->suspend_i2spsr, i2s->addr + I2SPSR); writel(priv->suspend_i2spsr, priv->addr + I2SPSR);
return 0; return 0;
} }
...@@ -1296,21 +1309,21 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) ...@@ -1296,21 +1309,21 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv)
if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { if (!(i2s->quirks & QUIRK_NO_MUXPSR)) {
/* Activate the prescaler */ /* Activate the prescaler */
u32 val = readl(i2s->addr + I2SPSR); u32 val = readl(priv->addr + I2SPSR);
writel(val | PSR_PSREN, i2s->addr + I2SPSR); writel(val | PSR_PSREN, priv->addr + I2SPSR);
priv->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev, priv->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev,
i2s_clk_name[CLK_I2S_RCLK_SRC], p_names, i2s_clk_name[CLK_I2S_RCLK_SRC], p_names,
ARRAY_SIZE(p_names), ARRAY_SIZE(p_names),
CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT,
i2s->addr + I2SMOD, reg_info->rclksrc_off, priv->addr + I2SMOD, reg_info->rclksrc_off,
1, 0, i2s->lock); 1, 0, i2s->lock);
priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev,
i2s_clk_name[CLK_I2S_RCLK_PSR], i2s_clk_name[CLK_I2S_RCLK_PSR],
i2s_clk_name[CLK_I2S_RCLK_SRC], i2s_clk_name[CLK_I2S_RCLK_SRC],
CLK_SET_RATE_PARENT, CLK_SET_RATE_PARENT,
i2s->addr + I2SPSR, 8, 6, 0, i2s->lock); priv->addr + I2SPSR, 8, 6, 0, i2s->lock);
p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR]; p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR];
priv->clk_data.clk_num = 2; priv->clk_data.clk_num = 2;
...@@ -1319,7 +1332,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) ...@@ -1319,7 +1332,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv)
priv->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, priv->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev,
i2s_clk_name[CLK_I2S_CDCLK], p_names[0], i2s_clk_name[CLK_I2S_CDCLK], p_names[0],
CLK_SET_RATE_PARENT, CLK_SET_RATE_PARENT,
i2s->addr + I2SMOD, reg_info->cdclkcon_off, priv->addr + I2SMOD, reg_info->cdclkcon_off,
CLK_GATE_SET_TO_DISABLE, i2s->lock); CLK_GATE_SET_TO_DISABLE, i2s->lock);
priv->clk_data.clk_num += 1; priv->clk_data.clk_num += 1;
...@@ -1423,9 +1436,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1423,9 +1436,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pri_dai->addr = devm_ioremap_resource(&pdev->dev, res); priv->addr = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pri_dai->addr)) if (IS_ERR(priv->addr))
return PTR_ERR(pri_dai->addr); return PTR_ERR(priv->addr);
regs_base = res->start; regs_base = res->start;
...@@ -1472,7 +1485,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1472,7 +1485,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
} }
sec_dai->dma_playback.addr_width = 4; sec_dai->dma_playback.addr_width = 4;
sec_dai->addr = pri_dai->addr;
sec_dai->quirks = quirks; sec_dai->quirks = quirks;
sec_dai->idma_playback.addr = idma_addr; sec_dai->idma_playback.addr = idma_addr;
sec_dai->pri_dai = pri_dai; sec_dai->pri_dai = pri_dai;
......
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