* [PATCH 1/2] ASoC: soc-cache: Fix indentation issues
@ 2011-03-28 10:34 Dimitris Papastamos
0 siblings, 0 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2011-03-28 10:34 UTC (permalink / raw)
To: Mark Brown, lrg; +Cc: alsa-devel, patches
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-cache.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 1210a6f..22c0b95 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -93,13 +93,13 @@ static unsigned int do_hw_read(struct snd_soc_codec *codec, unsigned int reg)
}
static unsigned int snd_soc_4_12_read(struct snd_soc_codec *codec,
- unsigned int reg)
+ unsigned int reg)
{
return do_hw_read(codec, reg);
}
static int snd_soc_4_12_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
+ unsigned int value)
{
u8 data[2];
@@ -111,7 +111,7 @@ static int snd_soc_4_12_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_4_12_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[2];
@@ -209,7 +209,7 @@ static unsigned int snd_soc_8_16_read(struct snd_soc_codec *codec,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_8_16_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[3];
@@ -257,7 +257,7 @@ static unsigned int do_i2c_read(struct snd_soc_codec *codec,
#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
static unsigned int snd_soc_8_8_read_i2c(struct snd_soc_codec *codec,
- unsigned int r)
+ unsigned int r)
{
u8 reg = r;
u8 data;
@@ -307,13 +307,13 @@ static unsigned int snd_soc_16_8_read_i2c(struct snd_soc_codec *codec,
#endif
static unsigned int snd_soc_16_8_read(struct snd_soc_codec *codec,
- unsigned int reg)
+ unsigned int reg)
{
return do_hw_read(codec, reg);
}
static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
+ unsigned int value)
{
u8 data[3];
@@ -327,7 +327,7 @@ static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_16_8_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[3];
@@ -379,7 +379,7 @@ static int snd_soc_16_16_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_16_16_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[4];
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 1/2] ASoC: soc-cache: Fix indentation issues
@ 2011-03-28 10:39 Dimitris Papastamos
2011-03-28 10:39 ` [PATCH 2/2] ASoC: soc-cache: Warn on syncing any non-writable registers Dimitris Papastamos
2011-03-30 21:14 ` [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2011-03-28 10:39 UTC (permalink / raw)
To: Mark Brown, lrg; +Cc: alsa-devel, patches
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-cache.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 1210a6f..22c0b95 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -93,13 +93,13 @@ static unsigned int do_hw_read(struct snd_soc_codec *codec, unsigned int reg)
}
static unsigned int snd_soc_4_12_read(struct snd_soc_codec *codec,
- unsigned int reg)
+ unsigned int reg)
{
return do_hw_read(codec, reg);
}
static int snd_soc_4_12_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
+ unsigned int value)
{
u8 data[2];
@@ -111,7 +111,7 @@ static int snd_soc_4_12_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_4_12_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[2];
@@ -209,7 +209,7 @@ static unsigned int snd_soc_8_16_read(struct snd_soc_codec *codec,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_8_16_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[3];
@@ -257,7 +257,7 @@ static unsigned int do_i2c_read(struct snd_soc_codec *codec,
#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
static unsigned int snd_soc_8_8_read_i2c(struct snd_soc_codec *codec,
- unsigned int r)
+ unsigned int r)
{
u8 reg = r;
u8 data;
@@ -307,13 +307,13 @@ static unsigned int snd_soc_16_8_read_i2c(struct snd_soc_codec *codec,
#endif
static unsigned int snd_soc_16_8_read(struct snd_soc_codec *codec,
- unsigned int reg)
+ unsigned int reg)
{
return do_hw_read(codec, reg);
}
static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
+ unsigned int value)
{
u8 data[3];
@@ -327,7 +327,7 @@ static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_16_8_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[3];
@@ -379,7 +379,7 @@ static int snd_soc_16_16_write(struct snd_soc_codec *codec, unsigned int reg,
#if defined(CONFIG_SPI_MASTER)
static int snd_soc_16_16_spi_write(void *control_data, const char *data,
- int len)
+ int len)
{
u8 msg[4];
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ASoC: soc-cache: Warn on syncing any non-writable registers
2011-03-28 10:39 [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Dimitris Papastamos
@ 2011-03-28 10:39 ` Dimitris Papastamos
2011-03-30 21:14 ` [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2011-03-28 10:39 UTC (permalink / raw)
To: Mark Brown, lrg; +Cc: alsa-devel, patches
When syncing the cache, if the driver has given us a writable_register()
callback, use it to check if we are syncing a non-writable register
and if so warn the user.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-cache.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 22c0b95..22b0990 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -661,6 +661,8 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec)
rbnode = rb_entry(node, struct snd_soc_rbtree_node, node);
if (rbnode->value == rbnode->defval)
continue;
+ WARN_ON(codec->writable_register &&
+ codec->writable_register(codec, rbnode->reg));
ret = snd_soc_cache_read(codec, rbnode->reg, &val);
if (ret)
return ret;
@@ -921,6 +923,8 @@ static int snd_soc_lzo_cache_sync(struct snd_soc_codec *codec)
lzo_blocks = codec->reg_cache;
for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) {
+ WARN_ON(codec->writable_register &&
+ codec->writable_register(codec, i));
ret = snd_soc_cache_read(codec, i, &val);
if (ret)
return ret;
@@ -1179,6 +1183,8 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
codec_drv = codec->driver;
for (i = 0; i < codec_drv->reg_cache_size; ++i) {
+ WARN_ON(codec->writable_register &&
+ codec->writable_register(codec, i));
ret = snd_soc_cache_read(codec, i, &val);
if (ret)
return ret;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: soc-cache: Fix indentation issues
[not found] <1301308745-18074-1-git-send-email-dp@opensource.wolfsonmicro.com>
@ 2011-03-30 12:34 ` Liam Girdwood
0 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-03-30 12:34 UTC (permalink / raw)
To: dp@opensource.wolfsonmicro.com
Cc: alsa-devel@alsa-project.org, Mark Brown,
patches@opensource.wolfsonmicro.com
On 28/03/11 11:39, dp@opensource.wolfsonmicro.com wrote:
> From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
All
Acked-by: Liam Girdwood <lrg@ti.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: soc-cache: Fix indentation issues
2011-03-28 10:39 [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Dimitris Papastamos
2011-03-28 10:39 ` [PATCH 2/2] ASoC: soc-cache: Warn on syncing any non-writable registers Dimitris Papastamos
@ 2011-03-30 21:14 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-03-30 21:14 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, patches, lrg
On Mon, Mar 28, 2011 at 11:39:14AM +0100, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Applied both, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-30 21:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 10:39 [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Dimitris Papastamos
2011-03-28 10:39 ` [PATCH 2/2] ASoC: soc-cache: Warn on syncing any non-writable registers Dimitris Papastamos
2011-03-30 21:14 ` [PATCH 1/2] ASoC: soc-cache: Fix indentation issues Mark Brown
[not found] <1301308745-18074-1-git-send-email-dp@opensource.wolfsonmicro.com>
2011-03-30 12:34 ` Liam Girdwood
-- strict thread matches above, loose matches on Subject: below --
2011-03-28 10:34 Dimitris Papastamos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).