aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac7311.c
diff options
context:
space:
mode:
authorMarton Nemeth <nm127@freemail.hu>2009-10-04 12:53:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:26 -0500
commit5a2e8d9fc15901d6ee4ec177b3845a84b6b960bd (patch)
tree54e9f3e18cd92e8ced1c2b872e4c26793b4f4960 /drivers/media/video/gspca/pac7311.c
parentff75e99c62bcef8ccd6fb70151ad2b87aa52a165 (diff)
V4L/DVB (13118): gspca - pac7311: remove magic values for END_OF_SEQUENCE and LOAD_PAGE.
Change the magic values 0, 254 and 255 to END_OF_SEQUENCE, LOAD_PAGE4 and LOAD_PAGE3 respectively for better source code readability. Signed-off-by: Marton Nemeth <nm127@freemail.hu> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/pac7311.c')
-rw-r--r--drivers/media/video/gspca/pac7311.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index f05bc800a7cb..418d1a36beb0 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -244,6 +244,10 @@ static const struct v4l2_pix_format vga_mode[] = {
244 .priv = 0}, 244 .priv = 0},
245}; 245};
246 246
247#define LOAD_PAGE3 255
248#define LOAD_PAGE4 254
249#define END_OF_SEQUENCE 0
250
247/* pac 7302 */ 251/* pac 7302 */
248static const __u8 init_7302[] = { 252static const __u8 init_7302[] = {
249/* index,value */ 253/* index,value */
@@ -302,7 +306,7 @@ static const __u8 start_7302[] = {
302 0xff, 1, 0x02, /* page 2 */ 306 0xff, 1, 0x02, /* page 2 */
303 0x22, 1, 0x00, 307 0x22, 1, 0x00,
304 0xff, 1, 0x03, /* page 3 */ 308 0xff, 1, 0x03, /* page 3 */
305 0x00, 255, /* load the page 3 */ 309 0, LOAD_PAGE3, /* load the page 3 */
306 0x11, 1, 0x01, 310 0x11, 1, 0x01,
307 0xff, 1, 0x02, /* page 2 */ 311 0xff, 1, 0x02, /* page 2 */
308 0x13, 1, 0x00, 312 0x13, 1, 0x00,
@@ -313,7 +317,7 @@ static const __u8 start_7302[] = {
313 0x6e, 1, 0x08, 317 0x6e, 1, 0x08,
314 0xff, 1, 0x01, /* page 1 */ 318 0xff, 1, 0x01, /* page 1 */
315 0x78, 1, 0x00, 319 0x78, 1, 0x00,
316 0, 0 /* end of sequence */ 320 0, END_OF_SEQUENCE /* end of sequence */
317}; 321};
318 322
319#define SKIP 0xaa 323#define SKIP 0xaa
@@ -379,9 +383,9 @@ static const __u8 start_7311[] = {
379 0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00, 383 0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00,
380 0x3f, 0x00, 0x0a, 0x01, 0x00, 384 0x3f, 0x00, 0x0a, 0x01, 0x00,
381 0xff, 1, 0x04, /* page 4 */ 385 0xff, 1, 0x04, /* page 4 */
382 0x00, 254, /* load the page 4 */ 386 0, LOAD_PAGE4, /* load the page 4 */
383 0x11, 1, 0x01, 387 0x11, 1, 0x01,
384 0, 0 /* end of sequence */ 388 0, END_OF_SEQUENCE /* end of sequence */
385}; 389};
386 390
387/* page 4 - the value SKIP says skip the index - see reg_w_page() */ 391/* page 4 - the value SKIP says skip the index - see reg_w_page() */
@@ -461,12 +465,12 @@ static void reg_w_var(struct gspca_dev *gspca_dev,
461 index = *seq++; 465 index = *seq++;
462 len = *seq++; 466 len = *seq++;
463 switch (len) { 467 switch (len) {
464 case 0: 468 case END_OF_SEQUENCE:
465 return; 469 return;
466 case 254: 470 case LOAD_PAGE4:
467 reg_w_page(gspca_dev, page4_7311, sizeof page4_7311); 471 reg_w_page(gspca_dev, page4_7311, sizeof page4_7311);
468 break; 472 break;
469 case 255: 473 case LOAD_PAGE3:
470 reg_w_page(gspca_dev, page3_7302, sizeof page3_7302); 474 reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
471 break; 475 break;
472 default: 476 default: