* weird array index in zl10036.c
@ 2009-12-27 13:15 Dan Carpenter
2009-12-27 17:02 ` Matthias Schwarzott
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2009-12-27 13:15 UTC (permalink / raw)
To: linux-media; +Cc: Matthias Schwarzott, Mauro Carvalho Chehab
drivers/media/dvb/frontends/zl10036.c
397 /* could also be one block from reg 2 to 13 and additional 10/11 */
398 u8 zl10036_init_tab[][2] = {
399 { 0x04, 0x00 }, /* 2/3: div=0x400 - arbitrary value */
400 { 0x8b, _RDIV_REG }, /* 4/5: rfg=0 ba=1 bg=1 len=? */
401 /* p0=0 c=0 r=_RDIV_REG */
402 { 0xc0, 0x20 }, /* 6/7: rsd=0 bf=0x10 */
403 { 0xd3, 0x40 }, /* 8/9: from datasheet */
404 { 0xe3, 0x5b }, /* 10/11: lock window level */
405 { 0xf0, 0x28 }, /* 12/13: br=0xa clr=0 tl=0*/
406 { 0xe3, 0xf9 }, /* 10/11: unlock window level */
407 };
408
409 /* invalid values to trigger writing */
410 state->br = 0xff;
411 state->bf = 0xff;
412
413 if (!state->config->rf_loop_enable)
414 zl10036_init_tab[1][2] |= 0x01;
This seems like an off by one error. I think it maybe should say
zl10036_init_tab[1][1] |= 0x01;?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: weird array index in zl10036.c
2009-12-27 13:15 weird array index in zl10036.c Dan Carpenter
@ 2009-12-27 17:02 ` Matthias Schwarzott
2009-12-28 17:48 ` [patch] fix " Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Matthias Schwarzott @ 2009-12-27 17:02 UTC (permalink / raw)
To: linux-media; +Cc: Dan Carpenter, Matthias Schwarzott, Mauro Carvalho Chehab
On Sonntag, 27. Dezember 2009, Dan Carpenter wrote:
> drivers/media/dvb/frontends/zl10036.c
> 397 /* could also be one block from reg 2 to 13 and additional
> 10/11 */ 398 u8 zl10036_init_tab[][2] = {
> 399 { 0x04, 0x00 }, /* 2/3: div=0x400 -
> arbitrary value */ 400 { 0x8b, _RDIV_REG }, /* 4/5:
> rfg=0 ba=1 bg=1 len=? */ 401 /*
> p0=0 c=0 r=_RDIV_REG */ 402 { 0xc0, 0x20 },
> /* 6/7: rsd=0 bf=0x10 */ 403 { 0xd3, 0x40 }, /*
> 8/9: from datasheet */ 404 { 0xe3, 0x5b }, /*
> 10/11: lock window level */ 405 { 0xf0, 0x28 },
> /* 12/13: br=0xa clr=0 tl=0*/ 406 { 0xe3, 0xf9 },
> /* 10/11: unlock window level */ 407 };
> 408
> 409 /* invalid values to trigger writing */
> 410 state->br = 0xff;
> 411 state->bf = 0xff;
> 412
> 413 if (!state->config->rf_loop_enable)
> 414 zl10036_init_tab[1][2] |= 0x01;
>
> This seems like an off by one error. I think it maybe should say
> zl10036_init_tab[1][1] |= 0x01;?
>
Good catch!
But according to the datasheet it should be
zl10036_init_tab[1][0] |= 0x01;
Please submit a patch for it.
Regards
Matthias
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch] fix weird array index in zl10036.c
2009-12-27 17:02 ` Matthias Schwarzott
@ 2009-12-28 17:48 ` Dan Carpenter
2009-12-29 10:08 ` Matthias Schwarzott
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2009-12-28 17:48 UTC (permalink / raw)
To: Matthias Schwarzott
Cc: linux-media, Matthias Schwarzott, Mauro Carvalho Chehab
I was initially concerned about the weird array index (the 2 bumps
into the next row of the array). Matthias Schwarzott look at the
datasheet and it turns out it should be zl10036_init_tab[1][0] |= 0x01;
Signed-off-by: Dan Carpenter <error27@gmail.com>
--- orig/drivers/media/dvb/frontends/zl10036.c 2009-12-28 19:04:51.000000000 +0200
+++ devel/drivers/media/dvb/frontends/zl10036.c 2009-12-28 19:07:18.000000000 +0200
@@ -411,7 +411,7 @@ static int zl10036_init_regs(struct zl10
state->bf = 0xff;
if (!state->config->rf_loop_enable)
- zl10036_init_tab[1][2] |= 0x01;
+ zl10036_init_tab[1][0] |= 0x01;
deb_info("%s\n", __func__);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] fix weird array index in zl10036.c
2009-12-28 17:48 ` [patch] fix " Dan Carpenter
@ 2009-12-29 10:08 ` Matthias Schwarzott
0 siblings, 0 replies; 4+ messages in thread
From: Matthias Schwarzott @ 2009-12-29 10:08 UTC (permalink / raw)
To: linux-media; +Cc: Dan Carpenter, Matthias Schwarzott, Mauro Carvalho Chehab
On Montag, 28. Dezember 2009, Dan Carpenter wrote:
> I was initially concerned about the weird array index (the 2 bumps
> into the next row of the array). Matthias Schwarzott look at the
> datasheet and it turns out it should be zl10036_init_tab[1][0] |= 0x01;
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
It may be better to add "linux/" path component to make it apply easier.
Matthias
>
> --- orig/drivers/media/dvb/frontends/zl10036.c 2009-12-28
> 19:04:51.000000000 +0200 +++
> devel/drivers/media/dvb/frontends/zl10036.c 2009-12-28 19:07:18.000000000
> +0200 @@ -411,7 +411,7 @@ static int zl10036_init_regs(struct zl10
> state->bf = 0xff;
>
> if (!state->config->rf_loop_enable)
> - zl10036_init_tab[1][2] |= 0x01;
> + zl10036_init_tab[1][0] |= 0x01;
>
> deb_info("%s\n", __func__);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-29 10:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-27 13:15 weird array index in zl10036.c Dan Carpenter
2009-12-27 17:02 ` Matthias Schwarzott
2009-12-28 17:48 ` [patch] fix " Dan Carpenter
2009-12-29 10:08 ` Matthias Schwarzott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox