Re: [alsa-devel] [PATCH] ASoC: Allow 32bits registers

2009-06-08 Thread Daniel Ribeiro
Em Seg, 2009-06-08 às 10:50 +0100, Mark Brown escreveu:
> On Sun, Jun 07, 2009 at 02:49:11AM -0300, Daniel Ribeiro wrote:
> > Replace the remaining unsigned shorts with unsigned ints.
> > Tested with pcap2 codec (25 bits registers).
> > 
> > Signed-off-by: Daniel Ribeiro 
> 
> Thanks, I've applied this.  Given that the merge window is *very* close
> and this is a fairly high risk change (in that it could affect a lot of
> drivers) I've created a for-2.6.32 branch and applied it there.  I think
> the change is perfectly safe but I'd rather be cautious.

ACK. And no driver on mainline needs >16bits at the moment...

> BTW, there was one unrelated coding style change in there.

Oops, sorry. My 'vim' highlights most coding style mistakes, I changed
it without noticing.

-- 
Daniel Ribeiro


signature.asc
Description: Esta é uma parte de mensagem assinada digitalmente


Re: [alsa-devel] [PATCH] ASoC: Allow 32bits registers

2009-06-08 Thread Mark Brown
On Sun, Jun 07, 2009 at 02:49:11AM -0300, Daniel Ribeiro wrote:
> Replace the remaining unsigned shorts with unsigned ints.
> Tested with pcap2 codec (25 bits registers).
> 
> Signed-off-by: Daniel Ribeiro 

Thanks, I've applied this.  Given that the merge window is *very* close
and this is a fairly high risk change (in that it could affect a lot of
drivers) I've created a for-2.6.32 branch and applied it there.  I think
the change is perfectly safe but I'd rather be cautious.

BTW, there was one unrelated coding style change in there.



[PATCH] ASoC: Allow 32bits registers

2009-06-06 Thread Daniel Ribeiro
Replace the remaining unsigned shorts with unsigned ints.
Tested with pcap2 codec (25 bits registers).

Signed-off-by: Daniel Ribeiro 

---
 include/sound/soc.h  |4 ++--
 sound/soc/soc-core.c |   28 ++--
 sound/soc/soc-dapm.c |   16 
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index a40bc6f..33b7de1 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -212,9 +212,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int 
count,
 
 /* codec register bit access */
 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
-   unsigned short mask, unsigned short value);
+   unsigned int mask, unsigned int value);
 int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
-   unsigned short mask, unsigned short value);
+   unsigned int mask, unsigned int value);
 
 int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
struct snd_ac97_bus_ops *ops, int num);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1cd149b..c9f19d0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1262,10 +1262,10 @@ EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec);
  * Returns 1 for change else 0.
  */
 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
-   unsigned short mask, unsigned short value)
+   unsigned int mask, unsigned int value)
 {
int change;
-   unsigned short old, new;
+   unsigned int old, new;
 
mutex_lock(&io_mutex);
old = snd_soc_read(codec, reg);
@@ -1292,10 +1292,10 @@ EXPORT_SYMBOL_GPL(snd_soc_update_bits);
  * Returns 1 for change else 0.
  */
 int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
-   unsigned short mask, unsigned short value)
+   unsigned int mask, unsigned int value)
 {
int change;
-   unsigned short old, new;
+   unsigned int old, new;
 
mutex_lock(&io_mutex);
old = snd_soc_read(codec, reg);
@@ -1580,7 +1580,7 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
 {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-   unsigned short val, bitmask;
+   unsigned int val, bitmask;
 
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
;
@@ -1609,8 +1609,8 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
 {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-   unsigned short val;
-   unsigned short mask, bitmask;
+   unsigned int val;
+   unsigned int mask, bitmask;
 
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
;
@@ -1646,7 +1646,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol 
*kcontrol,
 {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-   unsigned short reg_val, val, mux;
+   unsigned int reg_val, val, mux;
 
reg_val = snd_soc_read(codec, e->reg);
val = (reg_val >> e->shift_l) & e->mask;
@@ -1685,8 +1685,8 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol 
*kcontrol,
 {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-   unsigned short val;
-   unsigned short mask;
+   unsigned int val;
+   unsigned int mask;
 
if (ucontrol->value.enumerated.item[0] > e->max - 1)
return -EINVAL;
@@ -1846,7 +1846,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
int max = mc->max;
unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert;
-   unsigned short val, val2, val_mask;
+   unsigned int val, val2, val_mask;
 
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
@@ -1912,7 +1912,7 @@ int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol,
unsigned int reg2 = mc->rreg;
unsigned int shift = mc->shift;
int max = mc->max;
-   unsigned int mask = (1value.integer.value[0] =
@@ -1952,7 +1952,7 @@ int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol,
unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert;
int err;
-   unsigned short val, val2, val_mask;
+   unsigned int val, val2, val_mask;
 
val_mask = mask << shift;
val = (ucontrol->value.integer.value[0] & mask);
@@ -2044,7 +2044,7 @@ int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *c