struct platform_device *pdev;
struct platform_device *pdev_sec;
- /* Memory mapped SFR region */
- void __iomem *addr;
-
- /* Spinlock protecting access to the device's registers */
- spinlock_t lock;
-
/* Lock for cross interface checks */
spinlock_t pcm_lock;
/* The clock provider's data */
struct clk *clk_table[3];
struct clk_onecell_data clk_data;
+
+ /* Spinlock protecting member fields below */
+ spinlock_t lock;
+
+ /* Memory mapped SFR region */
+ void __iomem *addr;
+
+ /* A flag indicating the I2S slave mode operation */
+ bool slave_mode;
};
/* Returns true if this is the 'overlay' stereo DAI */
return i2s->drv->id == SAMSUNG_I2S_ID_SECONDARY;
}
-/* If operating in SoC-Slave mode */
-static inline bool is_slave(struct i2s_dai *i2s)
-{
- struct samsung_i2s_priv *priv = i2s->priv;
-
- u32 mod = readl(priv->addr + I2SMOD);
- return (mod & (1 << priv->variant_regs->mss_off)) ? true : false;
-}
-
/* If this interface of the controller is transmitting data */
static inline bool tx_active(struct i2s_dai *i2s)
{
mod &= ~(sdf_mask | lrp_rlow | mod_slave);
mod |= tmp;
writel(mod, priv->addr + I2SMOD);
+ priv->slave_mode = (mod & mod_slave);
spin_unlock_irqrestore(&priv->lock, flags);
pm_runtime_put(dai->dev);
set_rfs(i2s, rfs);
/* Don't bother with PSR in Slave mode */
- if (is_slave(i2s))
+ if (priv->slave_mode)
return 0;
if (!(priv->quirks & QUIRK_NO_MUXPSR)) {