diff options
author | Mike Isely <isely@pobox.com> | 2006-06-25 19:04:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-26 23:17:23 -0400 |
commit | c05c0462da0e3aac70ec5316ea500f9a7499cca7 (patch) | |
tree | 2879ef0856de3301cbb4bdc1ada44e433f7100cc /drivers/media | |
parent | 3948199e8aff71b1ebe3c1ff2749f42add17a41e (diff) |
V4L/DVB (4236): Rearrange things in pvrusb2 driver in preparation for using cx2341x module
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-encoder.c | 5 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 19 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 129 |
3 files changed, 83 insertions, 70 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c index f3d2c2b4d512..47c8e0203ce7 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c | |||
@@ -22,8 +22,6 @@ | |||
22 | 22 | ||
23 | #include <linux/device.h> // for linux/firmware.h | 23 | #include <linux/device.h> // for linux/firmware.h |
24 | #include <linux/firmware.h> | 24 | #include <linux/firmware.h> |
25 | #include <linux/videodev2.h> | ||
26 | #include <media/cx2341x.h> | ||
27 | #include "pvrusb2-util.h" | 25 | #include "pvrusb2-util.h" |
28 | #include "pvrusb2-encoder.h" | 26 | #include "pvrusb2-encoder.h" |
29 | #include "pvrusb2-hdw-internal.h" | 27 | #include "pvrusb2-hdw-internal.h" |
@@ -166,6 +164,7 @@ static int pvr2_encoder_cmd(void *ctxt, | |||
166 | u32 rdData[16]; | 164 | u32 rdData[16]; |
167 | struct pvr2_hdw *hdw = (struct pvr2_hdw *)ctxt; | 165 | struct pvr2_hdw *hdw = (struct pvr2_hdw *)ctxt; |
168 | 166 | ||
167 | |||
169 | /* | 168 | /* |
170 | 169 | ||
171 | The encoder seems to speak entirely using blocks 32 bit words. | 170 | The encoder seems to speak entirely using blocks 32 bit words. |
@@ -339,7 +338,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) | |||
339 | is_30fps=0; | 338 | is_30fps=0; |
340 | } | 339 | } |
341 | 340 | ||
342 | pvr2_trace(PVR2_TRACE_ENCODER,"pvr2_encoder_configure"); | 341 | pvr2_trace(PVR2_TRACE_ENCODER,"pvr2_encoder_configure (native)"); |
343 | 342 | ||
344 | /* set stream output port. Some notes here: The ivtv-derived | 343 | /* set stream output port. Some notes here: The ivtv-derived |
345 | encoder documentation says that this command only gets a | 344 | encoder documentation says that this command only gets a |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 217bbe5d5c80..4fd5ca2f6fc9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/mutex.h> | 39 | #include <linux/mutex.h> |
40 | #include "pvrusb2-hdw.h" | 40 | #include "pvrusb2-hdw.h" |
41 | #include "pvrusb2-io.h" | 41 | #include "pvrusb2-io.h" |
42 | #include <media/cx2341x.h> | ||
42 | 43 | ||
43 | /* Legal values for the SRATE state variable */ | 44 | /* Legal values for the SRATE state variable */ |
44 | #define PVR2_CVAL_SRATE_48 0 | 45 | #define PVR2_CVAL_SRATE_48 0 |
@@ -144,6 +145,13 @@ struct pvr2_ctl_info { | |||
144 | }; | 145 | }; |
145 | 146 | ||
146 | 147 | ||
148 | /* Same as pvr2_ctl_info, but includes storage for the control description */ | ||
149 | #define PVR2_CTLD_INFO_DESC_SIZE 32 | ||
150 | struct pvr2_ctld_info { | ||
151 | struct pvr2_ctl_info info; | ||
152 | char desc[PVR2_CTLD_INFO_DESC_SIZE]; | ||
153 | }; | ||
154 | |||
147 | struct pvr2_ctrl { | 155 | struct pvr2_ctrl { |
148 | const struct pvr2_ctl_info *info; | 156 | const struct pvr2_ctl_info *info; |
149 | struct pvr2_hdw *hdw; | 157 | struct pvr2_hdw *hdw; |
@@ -312,6 +320,7 @@ struct pvr2_hdw { | |||
312 | int flag_bilingual; | 320 | int flag_bilingual; |
313 | struct pvr2_audio_stat *audio_stat; | 321 | struct pvr2_audio_stat *audio_stat; |
314 | 322 | ||
323 | |||
315 | /* Control state */ | 324 | /* Control state */ |
316 | #define VCREATE_DATA(lab) int lab##_val; int lab##_dirty | 325 | #define VCREATE_DATA(lab) int lab##_val; int lab##_dirty |
317 | VCREATE_DATA(brightness); | 326 | VCREATE_DATA(brightness); |
@@ -323,6 +332,10 @@ struct pvr2_hdw { | |||
323 | VCREATE_DATA(bass); | 332 | VCREATE_DATA(bass); |
324 | VCREATE_DATA(treble); | 333 | VCREATE_DATA(treble); |
325 | VCREATE_DATA(mute); | 334 | VCREATE_DATA(mute); |
335 | VCREATE_DATA(input); | ||
336 | VCREATE_DATA(audiomode); | ||
337 | VCREATE_DATA(res_hor); | ||
338 | VCREATE_DATA(res_ver); | ||
326 | VCREATE_DATA(srate); | 339 | VCREATE_DATA(srate); |
327 | VCREATE_DATA(audiobitrate); | 340 | VCREATE_DATA(audiobitrate); |
328 | VCREATE_DATA(audiocrc); | 341 | VCREATE_DATA(audiocrc); |
@@ -330,15 +343,13 @@ struct pvr2_hdw { | |||
330 | VCREATE_DATA(vbr); | 343 | VCREATE_DATA(vbr); |
331 | VCREATE_DATA(videobitrate); | 344 | VCREATE_DATA(videobitrate); |
332 | VCREATE_DATA(videopeak); | 345 | VCREATE_DATA(videopeak); |
333 | VCREATE_DATA(input); | ||
334 | VCREATE_DATA(audiomode); | ||
335 | VCREATE_DATA(res_hor); | ||
336 | VCREATE_DATA(res_ver); | ||
337 | VCREATE_DATA(interlace); | 346 | VCREATE_DATA(interlace); |
338 | VCREATE_DATA(audiolayer); | 347 | VCREATE_DATA(audiolayer); |
339 | #undef VCREATE_DATA | 348 | #undef VCREATE_DATA |
340 | 349 | ||
350 | |||
341 | struct pvr2_ctrl *controls; | 351 | struct pvr2_ctrl *controls; |
352 | unsigned int control_cnt; | ||
342 | }; | 353 | }; |
343 | 354 | ||
344 | int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); | 355 | int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index c1a2447d3ef7..e8ea472fe2d0 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/videodev2.h> | 26 | #include <linux/videodev2.h> |
27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
28 | #include <media/cx2341x.h> | ||
29 | #include "pvrusb2.h" | 28 | #include "pvrusb2.h" |
30 | #include "pvrusb2-std.h" | 29 | #include "pvrusb2-std.h" |
31 | #include "pvrusb2-util.h" | 30 | #include "pvrusb2-util.h" |
@@ -131,6 +130,7 @@ MODULE_PARM_DESC(tolerance,"specify stream error tolerance"); | |||
131 | /* size of a firmware chunk */ | 130 | /* size of a firmware chunk */ |
132 | #define FIRMWARE_CHUNK_SIZE 0x2000 | 131 | #define FIRMWARE_CHUNK_SIZE 0x2000 |
133 | 132 | ||
133 | |||
134 | static const char *control_values_srate[] = { | 134 | static const char *control_values_srate[] = { |
135 | [PVR2_CVAL_SRATE_48] = "48KHz", | 135 | [PVR2_CVAL_SRATE_48] = "48KHz", |
136 | [PVR2_CVAL_SRATE_44_1] = "44.1KHz", | 136 | [PVR2_CVAL_SRATE_44_1] = "44.1KHz", |
@@ -467,6 +467,10 @@ VCREATE_FUNCS(balance) | |||
467 | VCREATE_FUNCS(bass) | 467 | VCREATE_FUNCS(bass) |
468 | VCREATE_FUNCS(treble) | 468 | VCREATE_FUNCS(treble) |
469 | VCREATE_FUNCS(mute) | 469 | VCREATE_FUNCS(mute) |
470 | VCREATE_FUNCS(input) | ||
471 | VCREATE_FUNCS(audiomode) | ||
472 | VCREATE_FUNCS(res_hor) | ||
473 | VCREATE_FUNCS(res_ver) | ||
470 | VCREATE_FUNCS(srate) | 474 | VCREATE_FUNCS(srate) |
471 | VCREATE_FUNCS(audiobitrate) | 475 | VCREATE_FUNCS(audiobitrate) |
472 | VCREATE_FUNCS(audiocrc) | 476 | VCREATE_FUNCS(audiocrc) |
@@ -474,10 +478,6 @@ VCREATE_FUNCS(audioemphasis) | |||
474 | VCREATE_FUNCS(vbr) | 478 | VCREATE_FUNCS(vbr) |
475 | VCREATE_FUNCS(videobitrate) | 479 | VCREATE_FUNCS(videobitrate) |
476 | VCREATE_FUNCS(videopeak) | 480 | VCREATE_FUNCS(videopeak) |
477 | VCREATE_FUNCS(input) | ||
478 | VCREATE_FUNCS(audiomode) | ||
479 | VCREATE_FUNCS(res_hor) | ||
480 | VCREATE_FUNCS(res_ver) | ||
481 | VCREATE_FUNCS(interlace) | 481 | VCREATE_FUNCS(interlace) |
482 | VCREATE_FUNCS(audiolayer) | 482 | VCREATE_FUNCS(audiolayer) |
483 | 483 | ||
@@ -550,6 +550,34 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
550 | DEFREF(mute), | 550 | DEFREF(mute), |
551 | DEFINT(0,1), | 551 | DEFINT(0,1), |
552 | },{ | 552 | },{ |
553 | .desc = "Video Source", | ||
554 | .name = "input", | ||
555 | .internal_id = PVR2_CID_INPUT, | ||
556 | .default_value = PVR2_CVAL_INPUT_TV, | ||
557 | DEFREF(input), | ||
558 | DEFENUM(control_values_input), | ||
559 | },{ | ||
560 | .desc = "Audio Mode", | ||
561 | .name = "audio_mode", | ||
562 | .internal_id = PVR2_CID_AUDIOMODE, | ||
563 | .default_value = V4L2_TUNER_MODE_STEREO, | ||
564 | DEFREF(audiomode), | ||
565 | DEFENUM(control_values_audiomode), | ||
566 | },{ | ||
567 | .desc = "Horizontal capture resolution", | ||
568 | .name = "resolution_hor", | ||
569 | .internal_id = PVR2_CID_HRES, | ||
570 | .default_value = 720, | ||
571 | DEFREF(res_hor), | ||
572 | DEFINT(320,720), | ||
573 | },{ | ||
574 | .desc = "Vertical capture resolution", | ||
575 | .name = "resolution_ver", | ||
576 | .internal_id = PVR2_CID_VRES, | ||
577 | .default_value = 480, | ||
578 | DEFREF(res_ver), | ||
579 | DEFINT(200,625), | ||
580 | },{ | ||
553 | .v4l_id = V4L2_CID_PVR_SRATE, | 581 | .v4l_id = V4L2_CID_PVR_SRATE, |
554 | .desc = "Sample rate", | 582 | .desc = "Sample rate", |
555 | .name = "srate", | 583 | .name = "srate", |
@@ -571,12 +599,6 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
571 | DEFREF(audiocrc), | 599 | DEFREF(audiocrc), |
572 | DEFINT(0,1), | 600 | DEFINT(0,1), |
573 | },{ | 601 | },{ |
574 | .desc = "Audio Layer", | ||
575 | .name = "audio_layer", | ||
576 | .default_value = 2, | ||
577 | DEFREF(audiolayer), | ||
578 | DEFINT(0,3), | ||
579 | },{ | ||
580 | .v4l_id = V4L2_CID_PVR_AUDIOEMPHASIS, | 602 | .v4l_id = V4L2_CID_PVR_AUDIOEMPHASIS, |
581 | .desc = "Audio Emphasis", | 603 | .desc = "Audio Emphasis", |
582 | .name = "audio_emphasis", | 604 | .name = "audio_emphasis", |
@@ -584,13 +606,6 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
584 | DEFREF(audioemphasis), | 606 | DEFREF(audioemphasis), |
585 | DEFENUM(control_values_audioemphasis), | 607 | DEFENUM(control_values_audioemphasis), |
586 | },{ | 608 | },{ |
587 | .desc = "Interlace mode", | ||
588 | .name = "interlace", | ||
589 | .internal_id = PVR2_CID_INTERLACE, | ||
590 | .default_value = 0, | ||
591 | DEFREF(interlace), | ||
592 | DEFINT(0,1), | ||
593 | },{ | ||
594 | .v4l_id = V4L2_CID_PVR_VBR, | 609 | .v4l_id = V4L2_CID_PVR_VBR, |
595 | .desc = "Variable video bitrate", | 610 | .desc = "Variable video bitrate", |
596 | .name = "vbr", | 611 | .name = "vbr", |
@@ -612,19 +627,18 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
612 | DEFREF(videopeak), | 627 | DEFREF(videopeak), |
613 | DEFINT(500000,20000000), | 628 | DEFINT(500000,20000000), |
614 | },{ | 629 | },{ |
615 | .desc = "Video Source", | 630 | .desc = "Interlace mode", |
616 | .name = "input", | 631 | .name = "interlace", |
617 | .internal_id = PVR2_CID_INPUT, | 632 | .internal_id = PVR2_CID_INTERLACE, |
618 | .default_value = PVR2_CVAL_INPUT_TV, | 633 | .default_value = 0, |
619 | DEFREF(input), | 634 | DEFREF(interlace), |
620 | DEFENUM(control_values_input), | 635 | DEFINT(0,1), |
621 | },{ | 636 | },{ |
622 | .desc = "Audio Mode", | 637 | .desc = "Audio Layer", |
623 | .name = "audio_mode", | 638 | .name = "audio_layer", |
624 | .internal_id = PVR2_CID_AUDIOMODE, | 639 | .default_value = 2, |
625 | .default_value = V4L2_TUNER_MODE_STEREO, | 640 | DEFREF(audiolayer), |
626 | DEFREF(audiomode), | 641 | DEFINT(0,3), |
627 | DEFENUM(control_values_audiomode), | ||
628 | },{ | 642 | },{ |
629 | .desc = "Tuner Frequency (Hz)", | 643 | .desc = "Tuner Frequency (Hz)", |
630 | .name = "frequency", | 644 | .name = "frequency", |
@@ -654,20 +668,6 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
654 | .get_value = ctrl_channelprog_get, | 668 | .get_value = ctrl_channelprog_get, |
655 | DEFINT(0,FREQTABLE_SIZE), | 669 | DEFINT(0,FREQTABLE_SIZE), |
656 | },{ | 670 | },{ |
657 | .desc = "Horizontal capture resolution", | ||
658 | .name = "resolution_hor", | ||
659 | .internal_id = PVR2_CID_HRES, | ||
660 | .default_value = 720, | ||
661 | DEFREF(res_hor), | ||
662 | DEFINT(320,720), | ||
663 | },{ | ||
664 | .desc = "Vertical capture resolution", | ||
665 | .name = "resolution_ver", | ||
666 | .internal_id = PVR2_CID_VRES, | ||
667 | .default_value = 480, | ||
668 | DEFREF(res_ver), | ||
669 | DEFINT(200,625), | ||
670 | },{ | ||
671 | .desc = "Streaming Enabled", | 671 | .desc = "Streaming Enabled", |
672 | .name = "streaming_enabled", | 672 | .name = "streaming_enabled", |
673 | .get_value = ctrl_streamingenabled_get, | 673 | .get_value = ctrl_streamingenabled_get, |
@@ -731,7 +731,7 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
731 | } | 731 | } |
732 | }; | 732 | }; |
733 | 733 | ||
734 | #define CTRL_COUNT (sizeof(control_defs)/sizeof(control_defs[0])) | 734 | #define CTRLDEF_COUNT (sizeof(control_defs)/sizeof(control_defs[0])) |
735 | 735 | ||
736 | 736 | ||
737 | const char *pvr2_config_get_name(enum pvr2_config cfg) | 737 | const char *pvr2_config_get_name(enum pvr2_config cfg) |
@@ -1508,7 +1508,7 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) | |||
1508 | pvr2_i2c_core_init(hdw); | 1508 | pvr2_i2c_core_init(hdw); |
1509 | if (!pvr2_hdw_dev_ok(hdw)) return; | 1509 | if (!pvr2_hdw_dev_ok(hdw)) return; |
1510 | 1510 | ||
1511 | for (idx = 0; idx < CTRL_COUNT; idx++) { | 1511 | for (idx = 0; idx < CTRLDEF_COUNT; idx++) { |
1512 | cptr = hdw->controls + idx; | 1512 | cptr = hdw->controls + idx; |
1513 | if (cptr->info->skip_init) continue; | 1513 | if (cptr->info->skip_init) continue; |
1514 | if (!cptr->info->set_value) continue; | 1514 | if (!cptr->info->set_value) continue; |
@@ -1665,19 +1665,21 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1665 | if (!hdw) goto fail; | 1665 | if (!hdw) goto fail; |
1666 | memset(hdw,0,sizeof(*hdw)); | 1666 | memset(hdw,0,sizeof(*hdw)); |
1667 | 1667 | ||
1668 | hdw->controls = kmalloc(sizeof(struct pvr2_ctrl) * CTRL_COUNT, | 1668 | hdw->control_cnt = CTRLDEF_COUNT; |
1669 | hdw->controls = kmalloc(sizeof(struct pvr2_ctrl) * hdw->control_cnt, | ||
1669 | GFP_KERNEL); | 1670 | GFP_KERNEL); |
1670 | if (!hdw->controls) goto fail; | 1671 | if (!hdw->controls) goto fail; |
1671 | memset(hdw->controls,0,sizeof(struct pvr2_ctrl) * CTRL_COUNT); | 1672 | memset(hdw->controls,0,sizeof(struct pvr2_ctrl) * hdw->control_cnt); |
1672 | hdw->hdw_type = hdw_type; | 1673 | hdw->hdw_type = hdw_type; |
1673 | 1674 | for (idx = 0; idx < hdw->control_cnt; idx++) { | |
1675 | cptr = hdw->controls + idx; | ||
1676 | cptr->hdw = hdw; | ||
1677 | } | ||
1674 | for (idx = 0; idx < 32; idx++) { | 1678 | for (idx = 0; idx < 32; idx++) { |
1675 | hdw->std_mask_ptrs[idx] = hdw->std_mask_names[idx]; | 1679 | hdw->std_mask_ptrs[idx] = hdw->std_mask_names[idx]; |
1676 | } | 1680 | } |
1677 | 1681 | for (idx = 0; idx < CTRLDEF_COUNT; idx++) { | |
1678 | for (idx = 0; idx < CTRL_COUNT; idx++) { | ||
1679 | cptr = hdw->controls + idx; | 1682 | cptr = hdw->controls + idx; |
1680 | cptr->hdw = hdw; | ||
1681 | cptr->info = control_defs+idx; | 1683 | cptr->info = control_defs+idx; |
1682 | } | 1684 | } |
1683 | 1685 | ||
@@ -1846,7 +1848,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) | |||
1846 | unit_pointers[hdw->unit_number] = 0; | 1848 | unit_pointers[hdw->unit_number] = 0; |
1847 | } | 1849 | } |
1848 | } while (0); up(&pvr2_unit_sem); | 1850 | } while (0); up(&pvr2_unit_sem); |
1849 | kfree(hdw->controls); | 1851 | if (hdw->controls) kfree(hdw->controls); |
1850 | if (hdw->std_defs) kfree(hdw->std_defs); | 1852 | if (hdw->std_defs) kfree(hdw->std_defs); |
1851 | if (hdw->std_enum_names) kfree(hdw->std_enum_names); | 1853 | if (hdw->std_enum_names) kfree(hdw->std_enum_names); |
1852 | kfree(hdw); | 1854 | kfree(hdw); |
@@ -1952,7 +1954,7 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw, | |||
1952 | /* Get the number of defined controls */ | 1954 | /* Get the number of defined controls */ |
1953 | unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) | 1955 | unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) |
1954 | { | 1956 | { |
1955 | return CTRL_COUNT; | 1957 | return hdw->control_cnt; |
1956 | } | 1958 | } |
1957 | 1959 | ||
1958 | 1960 | ||
@@ -1960,7 +1962,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) | |||
1960 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, | 1962 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, |
1961 | unsigned int idx) | 1963 | unsigned int idx) |
1962 | { | 1964 | { |
1963 | if (idx >= CTRL_COUNT) return 0; | 1965 | if (idx >= hdw->control_cnt) return 0; |
1964 | return hdw->controls + idx; | 1966 | return hdw->controls + idx; |
1965 | } | 1967 | } |
1966 | 1968 | ||
@@ -1974,7 +1976,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, | |||
1974 | int i; | 1976 | int i; |
1975 | 1977 | ||
1976 | /* This could be made a lot more efficient, but for now... */ | 1978 | /* This could be made a lot more efficient, but for now... */ |
1977 | for (idx = 0; idx < CTRL_COUNT; idx++) { | 1979 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
1978 | cptr = hdw->controls + idx; | 1980 | cptr = hdw->controls + idx; |
1979 | i = cptr->info->internal_id; | 1981 | i = cptr->info->internal_id; |
1980 | if (i && (i == ctl_id)) return cptr; | 1982 | if (i && (i == ctl_id)) return cptr; |
@@ -1991,7 +1993,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id | |||
1991 | int i; | 1993 | int i; |
1992 | 1994 | ||
1993 | /* This could be made a lot more efficient, but for now... */ | 1995 | /* This could be made a lot more efficient, but for now... */ |
1994 | for (idx = 0; idx < CTRL_COUNT; idx++) { | 1996 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
1995 | cptr = hdw->controls + idx; | 1997 | cptr = hdw->controls + idx; |
1996 | i = cptr->info->v4l_id; | 1998 | i = cptr->info->v4l_id; |
1997 | if (i && (i == ctl_id)) return cptr; | 1999 | if (i && (i == ctl_id)) return cptr; |
@@ -2029,7 +2031,7 @@ int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) | |||
2029 | char buf[100]; | 2031 | char buf[100]; |
2030 | unsigned int bcnt,ccnt; | 2032 | unsigned int bcnt,ccnt; |
2031 | 2033 | ||
2032 | for (idx = 0; idx < CTRL_COUNT; idx++) { | 2034 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
2033 | cptr = hdw->controls + idx; | 2035 | cptr = hdw->controls + idx; |
2034 | if (cptr->info->is_dirty == 0) continue; | 2036 | if (cptr->info->is_dirty == 0) continue; |
2035 | if (!cptr->info->is_dirty(cptr)) continue; | 2037 | if (!cptr->info->is_dirty(cptr)) continue; |
@@ -2080,30 +2082,31 @@ int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) | |||
2080 | } | 2082 | } |
2081 | 2083 | ||
2082 | if (hdw->std_dirty || | 2084 | if (hdw->std_dirty || |
2083 | hdw->res_ver_dirty || | ||
2084 | hdw->res_hor_dirty || | ||
2085 | hdw->interlace_dirty || | 2085 | hdw->interlace_dirty || |
2086 | hdw->vbr_dirty || | 2086 | hdw->vbr_dirty || |
2087 | hdw->videobitrate_dirty || | 2087 | hdw->videobitrate_dirty || |
2088 | hdw->videopeak_dirty || | 2088 | hdw->videopeak_dirty || |
2089 | hdw->audiobitrate_dirty || | 2089 | hdw->audiobitrate_dirty || |
2090 | hdw->srate_dirty || | ||
2091 | hdw->audiolayer_dirty || | 2090 | hdw->audiolayer_dirty || |
2092 | hdw->audiocrc_dirty || | 2091 | hdw->audiocrc_dirty || |
2093 | hdw->audioemphasis_dirty) { | 2092 | hdw->audioemphasis_dirty || |
2093 | hdw->srate_dirty || | ||
2094 | hdw->res_ver_dirty || | ||
2095 | hdw->res_hor_dirty) { | ||
2094 | /* If any of this changes, then the encoder needs to be | 2096 | /* If any of this changes, then the encoder needs to be |
2095 | reconfigured, and we need to reset the stream. */ | 2097 | reconfigured, and we need to reset the stream. */ |
2096 | stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); | 2098 | stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); |
2097 | stale_subsys_mask |= hdw->subsys_stream_mask; | 2099 | stale_subsys_mask |= hdw->subsys_stream_mask; |
2098 | } | 2100 | } |
2099 | 2101 | ||
2102 | |||
2100 | /* Scan i2c core at this point - before we clear all the dirty | 2103 | /* Scan i2c core at this point - before we clear all the dirty |
2101 | bits. Various parts of the i2c core will notice dirty bits as | 2104 | bits. Various parts of the i2c core will notice dirty bits as |
2102 | appropriate and arrange to broadcast or directly send updates to | 2105 | appropriate and arrange to broadcast or directly send updates to |
2103 | the client drivers in order to keep everything in sync */ | 2106 | the client drivers in order to keep everything in sync */ |
2104 | pvr2_i2c_core_check_stale(hdw); | 2107 | pvr2_i2c_core_check_stale(hdw); |
2105 | 2108 | ||
2106 | for (idx = 0; idx < CTRL_COUNT; idx++) { | 2109 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
2107 | cptr = hdw->controls + idx; | 2110 | cptr = hdw->controls + idx; |
2108 | if (!cptr->info->clear_dirty) continue; | 2111 | if (!cptr->info->clear_dirty) continue; |
2109 | cptr->info->clear_dirty(cptr); | 2112 | cptr->info->clear_dirty(cptr); |