aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-04-25 11:00:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-07 15:12:33 -0400
commitb053c1d0a4430cda924d3aae4ed9e9e7f9655319 (patch)
treed9eab0a88a15b8acdcdc478daa30acc335c7f5b1 /drivers
parenta648e310df9ff088d949befc8d1306264d970826 (diff)
[media] gspca_pac73xx: Remove comments from before the 7302 / 7311 separation
The pac7302 and pac7311 driver still contains some comments from before they were separated, such as marking certain functions 7302 or 7311 only, with the new split drivers these make no sense, remove them. Also removed the empty/unused sd_stop0 function from pac7311.c Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/pac7302.c6
-rw-r--r--drivers/media/video/gspca/pac7311.c40
2 files changed, 11 insertions, 35 deletions
diff --git a/drivers/media/video/gspca/pac7302.c b/drivers/media/video/gspca/pac7302.c
index 856cdd987f42..4f7be66fce45 100644
--- a/drivers/media/video/gspca/pac7302.c
+++ b/drivers/media/video/gspca/pac7302.c
@@ -89,7 +89,6 @@ enum e_ctrl {
89 NCTRLS /* number of controls */ 89 NCTRLS /* number of controls */
90}; 90};
91 91
92/* specific webcam descriptor for pac7302 */
93struct sd { 92struct sd {
94 struct gspca_dev gspca_dev; /* !! must be the first item */ 93 struct gspca_dev gspca_dev; /* !! must be the first item */
95 94
@@ -270,7 +269,6 @@ static const struct v4l2_pix_format vga_mode[] = {
270#define LOAD_PAGE3 255 269#define LOAD_PAGE3 255
271#define END_OF_SEQUENCE 0 270#define END_OF_SEQUENCE 0
272 271
273/* pac 7302 */
274static const u8 init_7302[] = { 272static const u8 init_7302[] = {
275/* index,value */ 273/* index,value */
276 0xff, 0x01, /* page 1 */ 274 0xff, 0x01, /* page 1 */
@@ -509,7 +507,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
509 return 0; 507 return 0;
510} 508}
511 509
512/* This function is used by pac7302 only */
513static void setbrightcont(struct gspca_dev *gspca_dev) 510static void setbrightcont(struct gspca_dev *gspca_dev)
514{ 511{
515 struct sd *sd = (struct sd *) gspca_dev; 512 struct sd *sd = (struct sd *) gspca_dev;
@@ -536,7 +533,6 @@ static void setbrightcont(struct gspca_dev *gspca_dev)
536 reg_w(gspca_dev, 0xdc, 0x01); 533 reg_w(gspca_dev, 0xdc, 0x01);
537} 534}
538 535
539/* This function is used by pac7302 only */
540static void setcolors(struct gspca_dev *gspca_dev) 536static void setcolors(struct gspca_dev *gspca_dev)
541{ 537{
542 struct sd *sd = (struct sd *) gspca_dev; 538 struct sd *sd = (struct sd *) gspca_dev;
@@ -700,8 +696,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
700 setautogain(gspca_dev); 696 setautogain(gspca_dev);
701 sethvflip(gspca_dev); 697 sethvflip(gspca_dev);
702 698
703 /* only resolution 640x480 is supported for pac7302 */
704
705 sd->sof_read = 0; 699 sd->sof_read = 0;
706 atomic_set(&sd->avg_lum, 270 + sd->ctrls[BRIGHTNESS].val); 700 atomic_set(&sd->avg_lum, 270 + sd->ctrls[BRIGHTNESS].val);
707 701
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 1ac111176ffa..6a1ed73a24c6 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -20,31 +20,26 @@
20 */ 20 */
21 21
22/* Some documentation about various registers as determined by trial and error. 22/* Some documentation about various registers as determined by trial and error.
23 When the register addresses differ between the 7202 and the 7311 the 2
24 different addresses are written as 7302addr/7311addr, when one of the 2
25 addresses is a - sign that register description is not valid for the
26 matching IC.
27 23
28 Register page 1: 24 Register page 1:
29 25
30 Address Description 26 Address Description
31 -/0x08 Unknown compressor related, must always be 8 except when not 27 0x08 Unknown compressor related, must always be 8 except when not
32 in 640x480 resolution and page 4 reg 2 <= 3 then set it to 9 ! 28 in 640x480 resolution and page 4 reg 2 <= 3 then set it to 9 !
33 -/0x1b Auto white balance related, bit 0 is AWB enable (inverted) 29 0x1b Auto white balance related, bit 0 is AWB enable (inverted)
34 bits 345 seem to toggle per color gains on/off (inverted) 30 bits 345 seem to toggle per color gains on/off (inverted)
35 0x78 Global control, bit 6 controls the LED (inverted) 31 0x78 Global control, bit 6 controls the LED (inverted)
36 -/0x80 JPEG compression ratio ? Best not touched 32 0x80 JPEG compression ratio ? Best not touched
37 33
38 Register page 3/4: 34 Register page 4:
39 35
40 Address Description 36 Address Description
41 0x02 Clock divider 2-63, fps =~ 60 / val. Must be a multiple of 3 on 37 0x02 Clock divider 2-63, fps =~ 60 / val. Must be a multiple of 3 on
42 the 7302, so one of 3, 6, 9, ..., except when between 6 and 12? 38 the 7302, so one of 3, 6, 9, ..., except when between 6 and 12?
43 -/0x0f Master gain 1-245, low value = high gain 39 0x0f Master gain 1-245, low value = high gain
44 0x10/- Master gain 0-31 40 0x10 Another gain 0-15, limited influence (1-2x gain I guess)
45 -/0x10 Another gain 0-15, limited influence (1-2x gain I guess)
46 0x21 Bitfield: 0-1 unused, 2-3 vflip/hflip, 4-5 unknown, 6-7 unused 41 0x21 Bitfield: 0-1 unused, 2-3 vflip/hflip, 4-5 unknown, 6-7 unused
47 -/0x27 Seems to toggle various gains on / off, Setting bit 7 seems to 42 0x27 Seems to toggle various gains on / off, Setting bit 7 seems to
48 completely disable the analog amplification block. Set to 0x68 43 completely disable the analog amplification block. Set to 0x68
49 for max gain, 0x14 for minimal gain. 44 for max gain, 0x14 for minimal gain.
50*/ 45*/
@@ -60,7 +55,6 @@ MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li");
60MODULE_DESCRIPTION("Pixart PAC7311"); 55MODULE_DESCRIPTION("Pixart PAC7311");
61MODULE_LICENSE("GPL"); 56MODULE_LICENSE("GPL");
62 57
63/* specific webcam descriptor for pac7311 */
64struct sd { 58struct sd {
65 struct gspca_dev gspca_dev; /* !! must be the first item */ 59 struct gspca_dev gspca_dev; /* !! must be the first item */
66 60
@@ -92,7 +86,6 @@ static int sd_setexposure(struct gspca_dev *gspca_dev, __s32 val);
92static int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val); 86static int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val);
93 87
94static const struct ctrl sd_ctrls[] = { 88static const struct ctrl sd_ctrls[] = {
95/* This control is for both the 7302 and the 7311 */
96 { 89 {
97 { 90 {
98 .id = V4L2_CID_CONTRAST, 91 .id = V4L2_CID_CONTRAST,
@@ -108,7 +101,6 @@ static const struct ctrl sd_ctrls[] = {
108 .set = sd_setcontrast, 101 .set = sd_setcontrast,
109 .get = sd_getcontrast, 102 .get = sd_getcontrast,
110 }, 103 },
111/* All controls below are for both the 7302 and the 7311 */
112 { 104 {
113 { 105 {
114 .id = V4L2_CID_GAIN, 106 .id = V4L2_CID_GAIN,
@@ -206,7 +198,6 @@ static const struct v4l2_pix_format vga_mode[] = {
206#define LOAD_PAGE4 254 198#define LOAD_PAGE4 254
207#define END_OF_SEQUENCE 0 199#define END_OF_SEQUENCE 0
208 200
209/* pac 7311 */
210static const __u8 init_7311[] = { 201static const __u8 init_7311[] = {
211 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ 202 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
212 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ 203 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
@@ -392,7 +383,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
392 383
393 cam = &gspca_dev->cam; 384 cam = &gspca_dev->cam;
394 385
395 PDEBUG(D_CONF, "Find Sensor PAC7311");
396 cam->cam_mode = vga_mode; 386 cam->cam_mode = vga_mode;
397 cam->nmodes = ARRAY_SIZE(vga_mode); 387 cam->nmodes = ARRAY_SIZE(vga_mode);
398 388
@@ -405,7 +395,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
405 return 0; 395 return 0;
406} 396}
407 397
408/* This function is used by pac7311 only */
409static void setcontrast(struct gspca_dev *gspca_dev) 398static void setcontrast(struct gspca_dev *gspca_dev)
410{ 399{
411 struct sd *sd = (struct sd *) gspca_dev; 400 struct sd *sd = (struct sd *) gspca_dev;
@@ -438,7 +427,7 @@ static void setexposure(struct gspca_dev *gspca_dev)
438 struct sd *sd = (struct sd *) gspca_dev; 427 struct sd *sd = (struct sd *) gspca_dev;
439 __u8 reg; 428 __u8 reg;
440 429
441 /* register 2 of frame 3/4 contains the clock divider configuring the 430 /* register 2 of page 4 contains the clock divider configuring the
442 no fps according to the formula: 60 / reg. sd->exposure is the 431 no fps according to the formula: 60 / reg. sd->exposure is the
443 desired exposure time in ms. */ 432 desired exposure time in ms. */
444 reg = 120 * sd->exposure / 1000; 433 reg = 120 * sd->exposure / 1000;
@@ -451,7 +440,7 @@ static void setexposure(struct gspca_dev *gspca_dev)
451 reg_w(gspca_dev, 0x02, reg); 440 reg_w(gspca_dev, 0x02, reg);
452 441
453 /* Page 1 register 8 must always be 0x08 except when not in 442 /* Page 1 register 8 must always be 0x08 except when not in
454 640x480 mode and Page3/4 reg 2 <= 3 then it must be 9 */ 443 640x480 mode and page 4 reg 2 <= 3 then it must be 9 */
455 reg_w(gspca_dev, 0xff, 0x01); 444 reg_w(gspca_dev, 0xff, 0x01);
456 if (gspca_dev->cam.cam_mode[(int)gspca_dev->curr_mode].priv && 445 if (gspca_dev->cam.cam_mode[(int)gspca_dev->curr_mode].priv &&
457 reg <= 3) { 446 reg <= 3) {
@@ -499,12 +488,12 @@ static int sd_start(struct gspca_dev *gspca_dev)
499 488
500 /* set correct resolution */ 489 /* set correct resolution */
501 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) { 490 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
502 case 2: /* 160x120 pac7311 */ 491 case 2: /* 160x120 */
503 reg_w(gspca_dev, 0xff, 0x01); 492 reg_w(gspca_dev, 0xff, 0x01);
504 reg_w(gspca_dev, 0x17, 0x20); 493 reg_w(gspca_dev, 0x17, 0x20);
505 reg_w(gspca_dev, 0x87, 0x10); 494 reg_w(gspca_dev, 0x87, 0x10);
506 break; 495 break;
507 case 1: /* 320x240 pac7311 */ 496 case 1: /* 320x240 */
508 reg_w(gspca_dev, 0xff, 0x01); 497 reg_w(gspca_dev, 0xff, 0x01);
509 reg_w(gspca_dev, 0x17, 0x30); 498 reg_w(gspca_dev, 0x17, 0x30);
510 reg_w(gspca_dev, 0x87, 0x11); 499 reg_w(gspca_dev, 0x87, 0x11);
@@ -541,11 +530,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
541 reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ 530 reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */
542} 531}
543 532
544/* called on streamoff with alt 0 and on disconnect for 7311 */
545static void sd_stop0(struct gspca_dev *gspca_dev)
546{
547}
548
549/* Include pac common sof detection functions */ 533/* Include pac common sof detection functions */
550#include "pac_common.h" 534#include "pac_common.h"
551 535
@@ -820,7 +804,6 @@ static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
820} 804}
821#endif 805#endif
822 806
823/* sub-driver description for pac7311 */
824static const struct sd_desc sd_desc = { 807static const struct sd_desc sd_desc = {
825 .name = MODULE_NAME, 808 .name = MODULE_NAME,
826 .ctrls = sd_ctrls, 809 .ctrls = sd_ctrls,
@@ -829,7 +812,6 @@ static const struct sd_desc sd_desc = {
829 .init = sd_init, 812 .init = sd_init,
830 .start = sd_start, 813 .start = sd_start,
831 .stopN = sd_stopN, 814 .stopN = sd_stopN,
832 .stop0 = sd_stop0,
833 .pkt_scan = sd_pkt_scan, 815 .pkt_scan = sd_pkt_scan,
834 .dq_callback = do_autogain, 816 .dq_callback = do_autogain,
835#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) 817#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)