* [PATCH 2/4] [media] em28xx: i2s 5 sample rates is a subset of 3 one.
@ 2013-07-16 23:05 Alban Browaeys
2013-07-18 15:18 ` Frank Schäfer
0 siblings, 1 reply; 3+ messages in thread
From: Alban Browaeys @ 2013-07-16 23:05 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media; +Cc: linux-kernel, Alban Browaeys
As:
EM28XX_CHIPCFG_I2S_3_SAMPRATES 0x20
EM28XX_CHIPCFG_I2S_5_SAMPRATES 0x30
the board chipcfg is 0xf0 thus if 3_SAMPRATES is tested
first and matches while it is a 5_SAMPRATES.
Signed-off-by: Alban Browaeys <prahal@yahoo.com>
---
drivers/media/usb/em28xx/em28xx-core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
index fc157af..3c0c5e9 100644
--- a/drivers/media/usb/em28xx/em28xx-core.c
+++ b/drivers/media/usb/em28xx/em28xx-core.c
@@ -505,13 +505,13 @@ int em28xx_audio_setup(struct em28xx *dev)
dev->audio_mode.has_audio = false;
return 0;
} else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
- EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
- em28xx_info("I2S Audio (3 sample rates)\n");
- dev->audio_mode.i2s_3rates = 1;
- } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
EM28XX_CHIPCFG_I2S_5_SAMPRATES) {
em28xx_info("I2S Audio (5 sample rates)\n");
dev->audio_mode.i2s_5rates = 1;
+ } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
+ EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
+ em28xx_info("I2S Audio (3 sample rates)\n");
+ dev->audio_mode.i2s_3rates = 1;
}
if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] [media] em28xx: i2s 5 sample rates is a subset of 3 one.
2013-07-16 23:05 [PATCH 2/4] [media] em28xx: i2s 5 sample rates is a subset of 3 one Alban Browaeys
@ 2013-07-18 15:18 ` Frank Schäfer
[not found] ` <CAMhY2AXP=B=+Tu90q3tYQKq3Nw8fyR0+Am4OAmusCT-CyoH6Cg@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Frank Schäfer @ 2013-07-18 15:18 UTC (permalink / raw)
To: Alban Browaeys; +Cc: Mauro Carvalho Chehab, linux-media, Alban Browaeys
Am 17.07.2013 01:05, schrieb Alban Browaeys:
> As:
> EM28XX_CHIPCFG_I2S_3_SAMPRATES 0x20
> EM28XX_CHIPCFG_I2S_5_SAMPRATES 0x30
>
> the board chipcfg is 0xf0 thus if 3_SAMPRATES is tested
> first and matches while it is a 5_SAMPRATES.
>
> Signed-off-by: Alban Browaeys <prahal@yahoo.com>
> ---
> drivers/media/usb/em28xx/em28xx-core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
> index fc157af..3c0c5e9 100644
> --- a/drivers/media/usb/em28xx/em28xx-core.c
> +++ b/drivers/media/usb/em28xx/em28xx-core.c
> @@ -505,13 +505,13 @@ int em28xx_audio_setup(struct em28xx *dev)
> dev->audio_mode.has_audio = false;
> return 0;
> } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> - EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
> - em28xx_info("I2S Audio (3 sample rates)\n");
> - dev->audio_mode.i2s_3rates = 1;
> - } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> EM28XX_CHIPCFG_I2S_5_SAMPRATES) {
> em28xx_info("I2S Audio (5 sample rates)\n");
> dev->audio_mode.i2s_5rates = 1;
> + } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> + EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
> + em28xx_info("I2S Audio (3 sample rates)\n");
> + dev->audio_mode.i2s_3rates = 1;
> }
>
> if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) {
What changes ?
If chipcfg is 0xf0, chipcfg & EM28XX_CHIPCFG_AUDIOMASK = 0x30 =
EM28XX_CHIPCFG_I2S_5_SAMPRATES and not 0x20 =
EM28XX_CHIPCFG_I2S_3_SAMPRATES...
Frank
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] [media] em28xx: i2s 5 sample rates is a subset of 3 one.
[not found] ` <CAMhY2AXP=B=+Tu90q3tYQKq3Nw8fyR0+Am4OAmusCT-CyoH6Cg@mail.gmail.com>
@ 2013-07-24 15:33 ` Frank Schäfer
0 siblings, 0 replies; 3+ messages in thread
From: Frank Schäfer @ 2013-07-24 15:33 UTC (permalink / raw)
To: Alban Browaeys; +Cc: m.chehab, Linux Media Mailing List, Alban Browaeys
[2nd try - vger.kernel.org rejects html content]
Please, don't top-post and don't drop any recipients.
Am 24.07.2013 15:40, schrieb Alban Browaeys:
> if 0xf0 , then the if (0x20 == ) else if (0x30 ==) first match 0x20
> succeed and bail out . 0x20 is a subset if 0x30.
(chipcfg & EM28XX_CHIPCFG_AUDIOMASK) = 0x30, and the if - else if
statements compares this with ==.
So how can 0x30 be 0x20 ???
Regards,
Frank
>
>
> 2013/7/18 Frank Schäfer <fschaefer.oss@googlemail.com
> <mailto:fschaefer.oss@googlemail.com>>
>
> Am 17.07.2013 01:05, schrieb Alban Browaeys:
> > As:
> > EM28XX_CHIPCFG_I2S_3_SAMPRATES 0x20
> > EM28XX_CHIPCFG_I2S_5_SAMPRATES 0x30
> >
> > the board chipcfg is 0xf0 thus if 3_SAMPRATES is tested
> > first and matches while it is a 5_SAMPRATES.
> >
> > Signed-off-by: Alban Browaeys <prahal@yahoo.com
> <mailto:prahal@yahoo.com>>
> > ---
> > drivers/media/usb/em28xx/em28xx-core.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/media/usb/em28xx/em28xx-core.c
> b/drivers/media/usb/em28xx/em28xx-core.c
> > index fc157af..3c0c5e9 100644
> > --- a/drivers/media/usb/em28xx/em28xx-core.c
> > +++ b/drivers/media/usb/em28xx/em28xx-core.c
> > @@ -505,13 +505,13 @@ int em28xx_audio_setup(struct em28xx *dev)
> > dev->audio_mode.has_audio = false;
> > return 0;
> > } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> > - EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
> > - em28xx_info("I2S Audio (3 sample rates)\n");
> > - dev->audio_mode.i2s_3rates = 1;
> > - } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> > EM28XX_CHIPCFG_I2S_5_SAMPRATES) {
> > em28xx_info("I2S Audio (5 sample rates)\n");
> > dev->audio_mode.i2s_5rates = 1;
> > + } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) ==
> > + EM28XX_CHIPCFG_I2S_3_SAMPRATES) {
> > + em28xx_info("I2S Audio (3 sample rates)\n");
> > + dev->audio_mode.i2s_3rates = 1;
> > }
> >
> > if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) {
>
> What changes ?
> If chipcfg is 0xf0, chipcfg & EM28XX_CHIPCFG_AUDIOMASK = 0x30 =
> EM28XX_CHIPCFG_I2S_5_SAMPRATES and not 0x20 =
> EM28XX_CHIPCFG_I2S_3_SAMPRATES...
>
> Frank
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-24 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16 23:05 [PATCH 2/4] [media] em28xx: i2s 5 sample rates is a subset of 3 one Alban Browaeys
2013-07-18 15:18 ` Frank Schäfer
[not found] ` <CAMhY2AXP=B=+Tu90q3tYQKq3Nw8fyR0+Am4OAmusCT-CyoH6Cg@mail.gmail.com>
2013-07-24 15:33 ` Frank Schäfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox