diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-10-17 03:42:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:40:37 -0400 |
commit | f89be036eb8db1fd1c152ee40a763f27fe0f0bb7 (patch) | |
tree | 37cd2125801699839f5b25adda1d9b0b56a2241b /drivers/media/video | |
parent | cf0fe08dd7d96f69d61b4aa7726e24a8c705bbe9 (diff) |
V4L/DVB (9287): gspca: Change the name of the multi bytes write function in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/t613.c | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index b561f7c4f06..9c8562f2390 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -390,7 +390,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
390 | NULL, 0, 500); | 390 | NULL, 0, 500); |
391 | } | 391 | } |
392 | 392 | ||
393 | static void i2c_w(struct gspca_dev *gspca_dev, | 393 | static void reg_w_buf(struct gspca_dev *gspca_dev, |
394 | const __u8 *buffer, __u16 len) | 394 | const __u8 *buffer, __u16 len) |
395 | { | 395 | { |
396 | if (len <= USB_BUF_SZ) { | 396 | if (len <= USB_BUF_SZ) { |
@@ -448,7 +448,7 @@ static void other_sensor_init(struct gspca_dev *gspca_dev) | |||
448 | val[3] = *p++; | 448 | val[3] = *p++; |
449 | if (*p == 0) | 449 | if (*p == 0) |
450 | reg_w(gspca_dev, 0x3c80); | 450 | reg_w(gspca_dev, 0x3c80); |
451 | i2c_w(gspca_dev, val, sizeof val); | 451 | reg_w_buf(gspca_dev, val, sizeof val); |
452 | i = 4; | 452 | i = 4; |
453 | while (--i >= 0) { | 453 | while (--i >= 0) { |
454 | msleep(15); | 454 | msleep(15); |
@@ -490,7 +490,7 @@ static void setgamma(struct gspca_dev *gspca_dev) | |||
490 | struct sd *sd = (struct sd *) gspca_dev; | 490 | struct sd *sd = (struct sd *) gspca_dev; |
491 | 491 | ||
492 | PDEBUG(D_CONF, "Gamma: %d", sd->gamma); | 492 | PDEBUG(D_CONF, "Gamma: %d", sd->gamma); |
493 | i2c_w(gspca_dev, gamma_table[sd->gamma], sizeof gamma_table[0]); | 493 | reg_w_buf(gspca_dev, gamma_table[sd->gamma], sizeof gamma_table[0]); |
494 | } | 494 | } |
495 | 495 | ||
496 | /* this function is called at probe and resume time */ | 496 | /* this function is called at probe and resume time */ |
@@ -564,11 +564,11 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
564 | sd->sensor = SENSOR_TAS5130A; | 564 | sd->sensor = SENSOR_TAS5130A; |
565 | } | 565 | } |
566 | 566 | ||
567 | i2c_w(gspca_dev, n1, sizeof n1); | 567 | reg_w_buf(gspca_dev, n1, sizeof n1); |
568 | test_byte = 0; | 568 | test_byte = 0; |
569 | i = 5; | 569 | i = 5; |
570 | while (--i >= 0) { | 570 | while (--i >= 0) { |
571 | i2c_w(gspca_dev, nset, sizeof nset); | 571 | reg_w_buf(gspca_dev, nset, sizeof nset); |
572 | msleep(5); | 572 | msleep(5); |
573 | test_byte = reg_r(gspca_dev, 0x0063); | 573 | test_byte = reg_r(gspca_dev, 0x0063); |
574 | msleep(100); | 574 | msleep(100); |
@@ -580,7 +580,7 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
580 | /* return -EIO; */ | 580 | /* return -EIO; */ |
581 | /*fixme: test - continue */ | 581 | /*fixme: test - continue */ |
582 | } | 582 | } |
583 | i2c_w(gspca_dev, n2, sizeof n2); | 583 | reg_w_buf(gspca_dev, n2, sizeof n2); |
584 | 584 | ||
585 | i = 0; | 585 | i = 0; |
586 | while (read_indexs[i] != 0x00) { | 586 | while (read_indexs[i] != 0x00) { |
@@ -590,37 +590,37 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
590 | i++; | 590 | i++; |
591 | } | 591 | } |
592 | 592 | ||
593 | i2c_w(gspca_dev, n3, sizeof n3); | 593 | reg_w_buf(gspca_dev, n3, sizeof n3); |
594 | i2c_w(gspca_dev, n4, sizeof n4); | 594 | reg_w_buf(gspca_dev, n4, sizeof n4); |
595 | reg_r(gspca_dev, 0x0080); | 595 | reg_r(gspca_dev, 0x0080); |
596 | reg_w(gspca_dev, 0x2c80); | 596 | reg_w(gspca_dev, 0x2c80); |
597 | i2c_w(gspca_dev, nset2, sizeof nset2); | 597 | reg_w_buf(gspca_dev, nset2, sizeof nset2); |
598 | i2c_w(gspca_dev, nset3, sizeof nset3); | 598 | reg_w_buf(gspca_dev, nset3, sizeof nset3); |
599 | i2c_w(gspca_dev, nset4, sizeof nset4); | 599 | reg_w_buf(gspca_dev, nset4, sizeof nset4); |
600 | reg_w(gspca_dev, 0x3880); | 600 | reg_w(gspca_dev, 0x3880); |
601 | reg_w(gspca_dev, 0x3880); | 601 | reg_w(gspca_dev, 0x3880); |
602 | reg_w(gspca_dev, 0x338e); | 602 | reg_w(gspca_dev, 0x338e); |
603 | i2c_w(gspca_dev, nset5, sizeof nset5); | 603 | reg_w_buf(gspca_dev, nset5, sizeof nset5); |
604 | reg_w(gspca_dev, 0x00a9); | 604 | reg_w(gspca_dev, 0x00a9); |
605 | setgamma(gspca_dev); | 605 | setgamma(gspca_dev); |
606 | reg_w(gspca_dev, 0x86bb); | 606 | reg_w(gspca_dev, 0x86bb); |
607 | reg_w(gspca_dev, 0x4aa6); | 607 | reg_w(gspca_dev, 0x4aa6); |
608 | 608 | ||
609 | i2c_w(gspca_dev, missing, sizeof missing); | 609 | reg_w_buf(gspca_dev, missing, sizeof missing); |
610 | 610 | ||
611 | reg_w(gspca_dev, 0x2087); | 611 | reg_w(gspca_dev, 0x2087); |
612 | reg_w(gspca_dev, 0x2088); | 612 | reg_w(gspca_dev, 0x2088); |
613 | reg_w(gspca_dev, 0x2089); | 613 | reg_w(gspca_dev, 0x2089); |
614 | 614 | ||
615 | i2c_w(gspca_dev, nset7, sizeof nset7); | 615 | reg_w_buf(gspca_dev, nset7, sizeof nset7); |
616 | i2c_w(gspca_dev, nset10, sizeof nset10); | 616 | reg_w_buf(gspca_dev, nset10, sizeof nset10); |
617 | i2c_w(gspca_dev, nset8, sizeof nset8); | 617 | reg_w_buf(gspca_dev, nset8, sizeof nset8); |
618 | i2c_w(gspca_dev, nset9, sizeof nset9); | 618 | reg_w_buf(gspca_dev, nset9, sizeof nset9); |
619 | 619 | ||
620 | reg_w(gspca_dev, 0x2880); | 620 | reg_w(gspca_dev, 0x2880); |
621 | i2c_w(gspca_dev, nset2, sizeof nset2); | 621 | reg_w_buf(gspca_dev, nset2, sizeof nset2); |
622 | i2c_w(gspca_dev, nset3, sizeof nset3); | 622 | reg_w_buf(gspca_dev, nset3, sizeof nset3); |
623 | i2c_w(gspca_dev, nset4, sizeof nset4); | 623 | reg_w_buf(gspca_dev, nset4, sizeof nset4); |
624 | 624 | ||
625 | return 0; | 625 | return 0; |
626 | } | 626 | } |
@@ -639,7 +639,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
639 | set6[3] = 0x00 + ((brightness - 7) * 0x10); | 639 | set6[3] = 0x00 + ((brightness - 7) * 0x10); |
640 | } | 640 | } |
641 | 641 | ||
642 | i2c_w(gspca_dev, set6, sizeof set6); | 642 | reg_w_buf(gspca_dev, set6, sizeof set6); |
643 | } | 643 | } |
644 | 644 | ||
645 | static void setflip(struct gspca_dev *gspca_dev) | 645 | static void setflip(struct gspca_dev *gspca_dev) |
@@ -651,14 +651,15 @@ static void setflip(struct gspca_dev *gspca_dev) | |||
651 | if (sd->mirror) | 651 | if (sd->mirror) |
652 | flipcmd[3] = 0x01; | 652 | flipcmd[3] = 0x01; |
653 | 653 | ||
654 | i2c_w(gspca_dev, flipcmd, sizeof flipcmd); | 654 | reg_w_buf(gspca_dev, flipcmd, sizeof flipcmd); |
655 | } | 655 | } |
656 | 656 | ||
657 | static void seteffect(struct gspca_dev *gspca_dev) | 657 | static void seteffect(struct gspca_dev *gspca_dev) |
658 | { | 658 | { |
659 | struct sd *sd = (struct sd *) gspca_dev; | 659 | struct sd *sd = (struct sd *) gspca_dev; |
660 | 660 | ||
661 | i2c_w(gspca_dev, effects_table[sd->effect], sizeof effects_table[0]); | 661 | reg_w_buf(gspca_dev, effects_table[sd->effect], |
662 | sizeof effects_table[0]); | ||
662 | if (sd->effect == 1 || sd->effect == 5) { | 663 | if (sd->effect == 1 || sd->effect == 5) { |
663 | PDEBUG(D_CONF, | 664 | PDEBUG(D_CONF, |
664 | "This effect have been disabled for webcam \"safety\""); | 665 | "This effect have been disabled for webcam \"safety\""); |
@@ -681,7 +682,7 @@ static void setwhitebalance(struct gspca_dev *gspca_dev) | |||
681 | if (sd->whitebalance == 1) | 682 | if (sd->whitebalance == 1) |
682 | white_balance[7] = 0x3c; | 683 | white_balance[7] = 0x3c; |
683 | 684 | ||
684 | i2c_w(gspca_dev, white_balance, sizeof white_balance); | 685 | reg_w_buf(gspca_dev, white_balance, sizeof white_balance); |
685 | } | 686 | } |
686 | 687 | ||
687 | static void setlightfreq(struct gspca_dev *gspca_dev) | 688 | static void setlightfreq(struct gspca_dev *gspca_dev) |
@@ -692,7 +693,7 @@ static void setlightfreq(struct gspca_dev *gspca_dev) | |||
692 | if (sd->freq == 2) /* 60hz */ | 693 | if (sd->freq == 2) /* 60hz */ |
693 | freq[1] = 0x00; | 694 | freq[1] = 0x00; |
694 | 695 | ||
695 | i2c_w(gspca_dev, freq, sizeof freq); | 696 | reg_w_buf(gspca_dev, freq, sizeof freq); |
696 | } | 697 | } |
697 | 698 | ||
698 | static void setcontrast(struct gspca_dev *gspca_dev) | 699 | static void setcontrast(struct gspca_dev *gspca_dev) |
@@ -760,25 +761,25 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
760 | if (sd->sensor == SENSOR_TAS5130A) { | 761 | if (sd->sensor == SENSOR_TAS5130A) { |
761 | i = 0; | 762 | i = 0; |
762 | while (tas5130a_sensor_init[i][0] != 0) { | 763 | while (tas5130a_sensor_init[i][0] != 0) { |
763 | i2c_w(gspca_dev, tas5130a_sensor_init[i], | 764 | reg_w_buf(gspca_dev, tas5130a_sensor_init[i], |
764 | sizeof tas5130a_sensor_init[0]); | 765 | sizeof tas5130a_sensor_init[0]); |
765 | i++; | 766 | i++; |
766 | } | 767 | } |
767 | reg_w(gspca_dev, 0x3c80); | 768 | reg_w(gspca_dev, 0x3c80); |
768 | /* just in case and to keep sync with logs (for mine) */ | 769 | /* just in case and to keep sync with logs (for mine) */ |
769 | i2c_w(gspca_dev, tas5130a_sensor_init[3], | 770 | reg_w_buf(gspca_dev, tas5130a_sensor_init[3], |
770 | sizeof tas5130a_sensor_init[0]); | 771 | sizeof tas5130a_sensor_init[0]); |
771 | reg_w(gspca_dev, 0x3c80); | 772 | reg_w(gspca_dev, 0x3c80); |
772 | } else { | 773 | } else { |
773 | other_sensor_init(gspca_dev); | 774 | other_sensor_init(gspca_dev); |
774 | } | 775 | } |
775 | /* just in case and to keep sync with logs (for mine) */ | 776 | /* just in case and to keep sync with logs (for mine) */ |
776 | i2c_w(gspca_dev, t1, sizeof t1); | 777 | reg_w_buf(gspca_dev, t1, sizeof t1); |
777 | i2c_w(gspca_dev, t2, sizeof t2); | 778 | reg_w_buf(gspca_dev, t2, sizeof t2); |
778 | reg_r(gspca_dev, 0x0012); | 779 | reg_r(gspca_dev, 0x0012); |
779 | i2c_w(gspca_dev, t3, sizeof t3); | 780 | reg_w_buf(gspca_dev, t3, sizeof t3); |
780 | reg_w(gspca_dev, 0x0013); | 781 | reg_w(gspca_dev, 0x0013); |
781 | i2c_w(gspca_dev, t4, sizeof t4); | 782 | reg_w_buf(gspca_dev, t4, sizeof t4); |
782 | /* restart on each start, just in case, sometimes regs goes wrong | 783 | /* restart on each start, just in case, sometimes regs goes wrong |
783 | * when using controls from app */ | 784 | * when using controls from app */ |
784 | setbrightness(gspca_dev); | 785 | setbrightness(gspca_dev); |