[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140702102310.GC410@sirena.org.uk>
Date: Wed, 2 Jul 2014 11:23:10 +0100
From: Mark Brown <broonie@...nel.org>
To: Huang Tao <huangtao@...k-chips.com>
Cc: jianqun <xjq@...k-chips.com>, heiko@...ech.de, lgirdwood@...il.com,
perex@...ex.cz, tiwai@...e.de, grant.likely@...aro.org,
robh+dt@...nel.org, linux-kernel@...r.kernel.org,
alsa-devel@...a-project.org, devicetree@...r.kernel.org,
zhangqing@...k-chips.com, hj@...k-chips.com,
kever.yang@...k-chips.com, zyw@...k-chips.com, yzq@...k-chips.com,
zhenfu.fang@...k-chips.com, cf@...k-chips.com, kfx@...k-chips.com
Subject: Re: [PATCH 2/2] ASoC: add driver for Rockchip RK3xxx I2S controller
On Wed, Jul 02, 2014 at 09:01:49AM +0800, Huang Tao wrote:
> 于 2014年07月02日 01:07, Mark Brown 写道:
> >> +static inline void i2s_writel(struct rk_i2s_dev *i2s, u32 value,
> >> > + unsigned int offset)
> >> > +{
> >> > + writel_relaxed(value, i2s->regs + offset);
> >> > +}
> >> > +
> >> > +static inline u32 i2s_readl(struct rk_i2s_dev *i2s, unsigned int offset)
> >> > +{
> >> > + return readl_relaxed(i2s->regs + offset);
> >> > +}
> > Perhaps use regmap? The main advantage would be the debug
> > infrastructure, though you could also use _update_bits() to reduce the
> > amount of time spent locked.
> Are you sure? This is a I2S driver, we can write the register directly,
> do not through I2C or SPI bus.
> Write a register is only a few instructions on ARM, but write through
> regmap, it may take a long path.
> I think it will just consume CPU power and make the whole thing more
> complex.
> Could you tell me what benefits we can get if use regmap? Or something I
> just missing?
The main thing is the diagnostic infrastructure, plus the cache if you
find you need that for suspend and resume (which you didn't implement
yet) - that's the main reason things use regmap for memory mapped
registers. There is some overhead but it's not *that* big.
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists