aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans de Goede <j.w.r.degoede@hhs.nl>2008-09-03 16:12:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-03 17:37:43 -0400
commit271315a9b4363ed884024022f2cf799344548e8f (patch)
treebc444f5412d0c9093c2a767a29542bfb042cd4c5 /drivers/media
parent8295d99ee5340f1e62b53c8adc979e0789299445 (diff)
V4L/DVB (8830): gspca: Move some probe code to the new init function.
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/pac7311.c15
-rw-r--r--drivers/media/video/gspca/sonixb.c8
2 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 723219d4964e..d4be51843286 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -245,7 +245,7 @@ static struct v4l2_pix_format vga_mode[] = {
245}; 245};
246 246
247/* pac 7302 */ 247/* pac 7302 */
248static const __u8 probe_7302[] = { 248static const __u8 init_7302[] = {
249/* index,value */ 249/* index,value */
250 0xff, 0x01, /* page 1 */ 250 0xff, 0x01, /* page 1 */
251 0x78, 0x00, /* deactivate */ 251 0x78, 0x00, /* deactivate */
@@ -341,7 +341,7 @@ static const __u8 page3_7302[] = {
341}; 341};
342 342
343/* pac 7311 */ 343/* pac 7311 */
344static const __u8 probe_7311[] = { 344static const __u8 init_7311[] = {
345 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ 345 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
346 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ 346 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
347 0x78, 0x44, /* Bit_0=start stream, Bit_6=LED */ 347 0x78, 0x44, /* Bit_0=start stream, Bit_6=LED */
@@ -503,14 +503,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
503 sd->sensor = id->driver_info; 503 sd->sensor = id->driver_info;
504 if (sd->sensor == SENSOR_PAC7302) { 504 if (sd->sensor == SENSOR_PAC7302) {
505 PDEBUG(D_CONF, "Find Sensor PAC7302"); 505 PDEBUG(D_CONF, "Find Sensor PAC7302");
506 reg_w_seq(gspca_dev, probe_7302, sizeof probe_7302);
507
508 cam->cam_mode = &vga_mode[2]; /* only 640x480 */ 506 cam->cam_mode = &vga_mode[2]; /* only 640x480 */
509 cam->nmodes = 1; 507 cam->nmodes = 1;
510 } else { 508 } else {
511 PDEBUG(D_CONF, "Find Sensor PAC7311"); 509 PDEBUG(D_CONF, "Find Sensor PAC7311");
512 reg_w_seq(gspca_dev, probe_7311, sizeof probe_7311);
513
514 cam->cam_mode = vga_mode; 510 cam->cam_mode = vga_mode;
515 cam->nmodes = ARRAY_SIZE(vga_mode); 511 cam->nmodes = ARRAY_SIZE(vga_mode);
516 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) 512 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX)
@@ -669,6 +665,13 @@ static void sethvflip(struct gspca_dev *gspca_dev)
669/* this function is called at probe and resume time */ 665/* this function is called at probe and resume time */
670static int sd_init(struct gspca_dev *gspca_dev) 666static int sd_init(struct gspca_dev *gspca_dev)
671{ 667{
668 struct sd *sd = (struct sd *) gspca_dev;
669
670 if (sd->sensor == SENSOR_PAC7302)
671 reg_w_seq(gspca_dev, init_7302, sizeof init_7302);
672 else
673 reg_w_seq(gspca_dev, init_7311, sizeof init_7311);
674
672 return 0; 675 return 0;
673} 676}
674 677
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 162beb3feadb..602608031247 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -736,7 +736,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
736 struct sd *sd = (struct sd *) gspca_dev; 736 struct sd *sd = (struct sd *) gspca_dev;
737 struct cam *cam; 737 struct cam *cam;
738 int sif = 0; 738 int sif = 0;
739 const __u8 stop = 0x09; /* Disable stream turn of LED */
740 739
741 reg_r(gspca_dev, 0x00); 740 reg_r(gspca_dev, 0x00);
742 if (gspca_dev->usb_buf[0] != 0x10) 741 if (gspca_dev->usb_buf[0] != 0x10)
@@ -773,15 +772,16 @@ static int sd_config(struct gspca_dev *gspca_dev,
773 sd->autogain = AUTOGAIN_DEF; 772 sd->autogain = AUTOGAIN_DEF;
774 sd->freq = FREQ_DEF; 773 sd->freq = FREQ_DEF;
775 774
776 /* Disable stream turn of LED */
777 reg_w(gspca_dev, 0x01, &stop, 1);
778
779 return 0; 775 return 0;
780} 776}
781 777
782/* this function is called at probe and resume time */ 778/* this function is called at probe and resume time */
783static int sd_init(struct gspca_dev *gspca_dev) 779static int sd_init(struct gspca_dev *gspca_dev)
784{ 780{
781 const __u8 stop = 0x09; /* Disable stream turn of LED */
782
783 reg_w(gspca_dev, 0x01, &stop, 1);
784
785 return 0; 785 return 0;
786} 786}
787 787