aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c48
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c1
-rw-r--r--include/media/v4l2-subdev.h1
4 files changed, 45 insertions, 9 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 385ecd58f1c..796f12d59da 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1347,30 +1347,59 @@ static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
1347} 1347}
1348#endif 1348#endif
1349 1349
1350static int cx25840_s_audio_stream(struct v4l2_subdev *sd, int enable)
1351{
1352 struct cx25840_state *state = to_state(sd);
1353 struct i2c_client *client = v4l2_get_subdevdata(sd);
1354 u8 v;
1355
1356 if (is_cx2583x(state) || is_cx2388x(state) || is_cx231xx(state))
1357 return 0;
1358
1359 v4l_dbg(1, cx25840_debug, client, "%s audio output\n",
1360 enable ? "enable" : "disable");
1361
1362 if (enable) {
1363 v = cx25840_read(client, 0x115) | 0x80;
1364 cx25840_write(client, 0x115, v);
1365 v = cx25840_read(client, 0x116) | 0x03;
1366 cx25840_write(client, 0x116, v);
1367 } else {
1368 v = cx25840_read(client, 0x115) & ~(0x80);
1369 cx25840_write(client, 0x115, v);
1370 v = cx25840_read(client, 0x116) & ~(0x03);
1371 cx25840_write(client, 0x116, v);
1372 }
1373 return 0;
1374}
1375
1350static int cx25840_s_stream(struct v4l2_subdev *sd, int enable) 1376static int cx25840_s_stream(struct v4l2_subdev *sd, int enable)
1351{ 1377{
1352 struct cx25840_state *state = to_state(sd); 1378 struct cx25840_state *state = to_state(sd);
1353 struct i2c_client *client = v4l2_get_subdevdata(sd); 1379 struct i2c_client *client = v4l2_get_subdevdata(sd);
1380 u8 v;
1354 1381
1355 v4l_dbg(1, cx25840_debug, client, "%s output\n", 1382 v4l_dbg(1, cx25840_debug, client, "%s video output\n",
1356 enable ? "enable" : "disable"); 1383 enable ? "enable" : "disable");
1357 if (enable) { 1384 if (enable) {
1358 if (is_cx2388x(state) || is_cx231xx(state)) { 1385 if (is_cx2388x(state) || is_cx231xx(state)) {
1359 u8 v = (cx25840_read(client, 0x421) | 0x0b); 1386 v = cx25840_read(client, 0x421) | 0x0b;
1360 cx25840_write(client, 0x421, v); 1387 cx25840_write(client, 0x421, v);
1361 } else { 1388 } else {
1362 cx25840_write(client, 0x115, 1389 v = cx25840_read(client, 0x115) | 0x0c;
1363 is_cx2583x(state) ? 0x0c : 0x8c); 1390 cx25840_write(client, 0x115, v);
1364 cx25840_write(client, 0x116, 1391 v = cx25840_read(client, 0x116) | 0x04;
1365 is_cx2583x(state) ? 0x04 : 0x07); 1392 cx25840_write(client, 0x116, v);
1366 } 1393 }
1367 } else { 1394 } else {
1368 if (is_cx2388x(state) || is_cx231xx(state)) { 1395 if (is_cx2388x(state) || is_cx231xx(state)) {
1369 u8 v = cx25840_read(client, 0x421) & ~(0x0b); 1396 v = cx25840_read(client, 0x421) & ~(0x0b);
1370 cx25840_write(client, 0x421, v); 1397 cx25840_write(client, 0x421, v);
1371 } else { 1398 } else {
1372 cx25840_write(client, 0x115, 0x00); 1399 v = cx25840_read(client, 0x115) & ~(0x0c);
1373 cx25840_write(client, 0x116, 0x00); 1400 cx25840_write(client, 0x115, v);
1401 v = cx25840_read(client, 0x116) & ~(0x04);
1402 cx25840_write(client, 0x116, v);
1374 } 1403 }
1375 } 1404 }
1376 return 0; 1405 return 0;
@@ -1601,6 +1630,7 @@ static const struct v4l2_subdev_tuner_ops cx25840_tuner_ops = {
1601static const struct v4l2_subdev_audio_ops cx25840_audio_ops = { 1630static const struct v4l2_subdev_audio_ops cx25840_audio_ops = {
1602 .s_clock_freq = cx25840_s_clock_freq, 1631 .s_clock_freq = cx25840_s_clock_freq,
1603 .s_routing = cx25840_s_audio_routing, 1632 .s_routing = cx25840_s_audio_routing,
1633 .s_stream = cx25840_s_audio_stream,
1604}; 1634};
1605 1635
1606static const struct v4l2_subdev_video_ops cx25840_video_ops = { 1636static const struct v4l2_subdev_video_ops cx25840_video_ops = {
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index e12c6022373..2f90dd255cd 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -577,10 +577,14 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
577 clear_bit(IVTV_F_I_EOS, &itv->i_flags); 577 clear_bit(IVTV_F_I_EOS, &itv->i_flags);
578 578
579 /* Initialize Digitizer for Capture */ 579 /* Initialize Digitizer for Capture */
580 /* Avoid tinny audio problem - ensure audio clocks are going */
581 v4l2_subdev_call(itv->sd_audio, audio, s_stream, 1);
582 /* Avoid unpredictable PCI bus hang - disable video clocks */
580 v4l2_subdev_call(itv->sd_video, video, s_stream, 0); 583 v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
581 ivtv_msleep_timeout(300, 1); 584 ivtv_msleep_timeout(300, 1);
582 ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0); 585 ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
583 v4l2_subdev_call(itv->sd_video, video, s_stream, 1); 586 v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
587 ivtv_msleep_timeout(300, 1);
584 } 588 }
585 589
586 /* begin_capture */ 590 /* begin_capture */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 1bbdab08fe0..ad9ed51f7b9 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1705,6 +1705,7 @@ static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl)
1705 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 stream=%s", 1705 pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 stream=%s",
1706 (enablefl ? "on" : "off")); 1706 (enablefl ? "on" : "off"));
1707 v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl); 1707 v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl);
1708 v4l2_device_call_all(&hdw->v4l2_dev, 0, audio, s_stream, enablefl);
1708 if (hdw->decoder_client_id) { 1709 if (hdw->decoder_client_id) {
1709 /* We get here if the encoder has been noticed. Otherwise 1710 /* We get here if the encoder has been noticed. Otherwise
1710 we'll issue a warning to the user (which should 1711 we'll issue a warning to the user (which should
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 9ba99cd39ee..2bcdca0a57f 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -180,6 +180,7 @@ struct v4l2_subdev_audio_ops {
180 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 180 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
181 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 181 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
182 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 182 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
183 int (*s_stream)(struct v4l2_subdev *sd, int enable);
183}; 184};
184 185
185/* 186/*