aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-02-27 05:18:14 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:50:10 -0400
commit6b33e5e7fe03c6577ccbaeeb028ab4ec1f26f2b0 (patch)
treec5e9964c3d4c336248aed6709304f01ec8a90139 /drivers
parentcc2a833590e4bf4920383345cd61bc310ba84af0 (diff)
V4L/DVB: gspca_spca561: Fix LED on rev12a cameras
Fix LED control on rev12a cameras and remove the unneeded sd_stop0 callback function. 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/spca561.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c
index b9c80e2103b9..6346ddc67967 100644
--- a/drivers/media/video/gspca/spca561.c
+++ b/drivers/media/video/gspca/spca561.c
@@ -249,9 +249,9 @@ static const __u16 Pb100_2map8300[][2] = {
249}; 249};
250 250
251static const __u16 spca561_161rev12A_data1[][2] = { 251static const __u16 spca561_161rev12A_data1[][2] = {
252 {0x29, 0x8118}, /* white balance - was 21 */ 252 {0x29, 0x8118}, /* Control register (various enable bits) */
253 {0x08, 0x8114}, /* white balance - was 01 */ 253 {0x08, 0x8114}, /* GPIO: Led off */
254 {0x0e, 0x8112}, /* white balance - was 00 */ 254 {0x0e, 0x8112}, /* 0x0e stream off 0x3e stream on */
255 {0x00, 0x8102}, /* white balance - new */ 255 {0x00, 0x8102}, /* white balance - new */
256 {0x92, 0x8804}, 256 {0x92, 0x8804},
257 {0x04, 0x8802}, /* windows uses 08 */ 257 {0x04, 0x8802}, /* windows uses 08 */
@@ -263,15 +263,11 @@ static const __u16 spca561_161rev12A_data2[][2] = {
263 {0x07, 0x8601}, 263 {0x07, 0x8601},
264 {0x07, 0x8602}, 264 {0x07, 0x8602},
265 {0x04, 0x8501}, 265 {0x04, 0x8501},
266 {0x21, 0x8118},
267 266
268 {0x07, 0x8201}, /* windows uses 02 */ 267 {0x07, 0x8201}, /* windows uses 02 */
269 {0x08, 0x8200}, 268 {0x08, 0x8200},
270 {0x01, 0x8200}, 269 {0x01, 0x8200},
271 270
272 {0x00, 0x8114},
273 {0x01, 0x8114}, /* windows uses 00 */
274
275 {0x90, 0x8604}, 271 {0x90, 0x8604},
276 {0x00, 0x8605}, 272 {0x00, 0x8605},
277 {0xb0, 0x8603}, 273 {0xb0, 0x8603},
@@ -302,6 +298,9 @@ static const __u16 spca561_161rev12A_data2[][2] = {
302 {0xf0, 0x8505}, 298 {0xf0, 0x8505},
303 {0x32, 0x850a}, 299 {0x32, 0x850a},
304/* {0x99, 0x8700}, * - white balance - new (removed) */ 300/* {0x99, 0x8700}, * - white balance - new (removed) */
301 /* HDG we used to do this in stop0, making the init state and the state
302 after a start / stop different, so do this here instead. */
303 {0x29, 0x8118},
305 {} 304 {}
306}; 305};
307 306
@@ -645,6 +644,9 @@ static int sd_start_12a(struct gspca_dev *gspca_dev)
645 setwhite(gspca_dev); 644 setwhite(gspca_dev);
646 setgain(gspca_dev); 645 setgain(gspca_dev);
647 setexposure(gspca_dev); 646 setexposure(gspca_dev);
647
648 /* Led ON (bit 3 -> 0 */
649 reg_w_val(gspca_dev->dev, 0x8114, 0x00);
648 return 0; 650 return 0;
649} 651}
650static int sd_start_72a(struct gspca_dev *gspca_dev) 652static int sd_start_72a(struct gspca_dev *gspca_dev)
@@ -691,26 +693,14 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
691 693
692 if (sd->chip_revision == Rev012A) { 694 if (sd->chip_revision == Rev012A) {
693 reg_w_val(gspca_dev->dev, 0x8112, 0x0e); 695 reg_w_val(gspca_dev->dev, 0x8112, 0x0e);
696 /* Led Off (bit 3 -> 1 */
697 reg_w_val(gspca_dev->dev, 0x8114, 0x08);
694 } else { 698 } else {
695 reg_w_val(gspca_dev->dev, 0x8112, 0x20); 699 reg_w_val(gspca_dev->dev, 0x8112, 0x20);
696/* reg_w_val(gspca_dev->dev, 0x8102, 0x00); ?? */ 700/* reg_w_val(gspca_dev->dev, 0x8102, 0x00); ?? */
697 } 701 }
698} 702}
699 703
700/* called on streamoff with alt 0 and on disconnect */
701static void sd_stop0(struct gspca_dev *gspca_dev)
702{
703 struct sd *sd = (struct sd *) gspca_dev;
704
705 if (!gspca_dev->present)
706 return;
707 if (sd->chip_revision == Rev012A) {
708 reg_w_val(gspca_dev->dev, 0x8118, 0x29);
709 reg_w_val(gspca_dev->dev, 0x8114, 0x08);
710 }
711/* reg_w_val(gspca_dev->dev, 0x8114, 0); */
712}
713
714static void do_autogain(struct gspca_dev *gspca_dev) 704static void do_autogain(struct gspca_dev *gspca_dev)
715{ 705{
716 struct sd *sd = (struct sd *) gspca_dev; 706 struct sd *sd = (struct sd *) gspca_dev;
@@ -1028,7 +1018,6 @@ static const struct sd_desc sd_desc_12a = {
1028 .init = sd_init_12a, 1018 .init = sd_init_12a,
1029 .start = sd_start_12a, 1019 .start = sd_start_12a,
1030 .stopN = sd_stopN, 1020 .stopN = sd_stopN,
1031 .stop0 = sd_stop0,
1032 .pkt_scan = sd_pkt_scan, 1021 .pkt_scan = sd_pkt_scan,
1033}; 1022};
1034static const struct sd_desc sd_desc_72a = { 1023static const struct sd_desc sd_desc_72a = {
@@ -1039,7 +1028,6 @@ static const struct sd_desc sd_desc_72a = {
1039 .init = sd_init_72a, 1028 .init = sd_init_72a,
1040 .start = sd_start_72a, 1029 .start = sd_start_72a,
1041 .stopN = sd_stopN, 1030 .stopN = sd_stopN,
1042 .stop0 = sd_stop0,
1043 .pkt_scan = sd_pkt_scan, 1031 .pkt_scan = sd_pkt_scan,
1044 .dq_callback = do_autogain, 1032 .dq_callback = do_autogain,
1045}; 1033};