提交 5a2e8d9f 编写于 作者: M Marton Nemeth 提交者: Mauro Carvalho Chehab

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: NMarton Nemeth <nm127@freemail.hu>
Signed-off-by: NJean-Francois Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ff75e99c
...@@ -244,6 +244,10 @@ static const struct v4l2_pix_format vga_mode[] = { ...@@ -244,6 +244,10 @@ static const struct v4l2_pix_format vga_mode[] = {
.priv = 0}, .priv = 0},
}; };
#define LOAD_PAGE3 255
#define LOAD_PAGE4 254
#define END_OF_SEQUENCE 0
/* pac 7302 */ /* pac 7302 */
static const __u8 init_7302[] = { static const __u8 init_7302[] = {
/* index,value */ /* index,value */
...@@ -302,7 +306,7 @@ static const __u8 start_7302[] = { ...@@ -302,7 +306,7 @@ static const __u8 start_7302[] = {
0xff, 1, 0x02, /* page 2 */ 0xff, 1, 0x02, /* page 2 */
0x22, 1, 0x00, 0x22, 1, 0x00,
0xff, 1, 0x03, /* page 3 */ 0xff, 1, 0x03, /* page 3 */
0x00, 255, /* load the page 3 */ 0, LOAD_PAGE3, /* load the page 3 */
0x11, 1, 0x01, 0x11, 1, 0x01,
0xff, 1, 0x02, /* page 2 */ 0xff, 1, 0x02, /* page 2 */
0x13, 1, 0x00, 0x13, 1, 0x00,
...@@ -313,7 +317,7 @@ static const __u8 start_7302[] = { ...@@ -313,7 +317,7 @@ static const __u8 start_7302[] = {
0x6e, 1, 0x08, 0x6e, 1, 0x08,
0xff, 1, 0x01, /* page 1 */ 0xff, 1, 0x01, /* page 1 */
0x78, 1, 0x00, 0x78, 1, 0x00,
0, 0 /* end of sequence */ 0, END_OF_SEQUENCE /* end of sequence */
}; };
#define SKIP 0xaa #define SKIP 0xaa
...@@ -379,9 +383,9 @@ static const __u8 start_7311[] = { ...@@ -379,9 +383,9 @@ static const __u8 start_7311[] = {
0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00, 0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00,
0x3f, 0x00, 0x0a, 0x01, 0x00, 0x3f, 0x00, 0x0a, 0x01, 0x00,
0xff, 1, 0x04, /* page 4 */ 0xff, 1, 0x04, /* page 4 */
0x00, 254, /* load the page 4 */ 0, LOAD_PAGE4, /* load the page 4 */
0x11, 1, 0x01, 0x11, 1, 0x01,
0, 0 /* end of sequence */ 0, END_OF_SEQUENCE /* end of sequence */
}; };
/* page 4 - the value SKIP says skip the index - see reg_w_page() */ /* 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,12 +465,12 @@ static void reg_w_var(struct gspca_dev *gspca_dev,
index = *seq++; index = *seq++;
len = *seq++; len = *seq++;
switch (len) { switch (len) {
case 0: case END_OF_SEQUENCE:
return; return;
case 254: case LOAD_PAGE4:
reg_w_page(gspca_dev, page4_7311, sizeof page4_7311); reg_w_page(gspca_dev, page4_7311, sizeof page4_7311);
break; break;
case 255: case LOAD_PAGE3:
reg_w_page(gspca_dev, page3_7302, sizeof page3_7302); reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册