aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/siano/smsdvb.c127
-rw-r--r--drivers/media/video/davinci/isif.c1
-rw-r--r--drivers/media/video/uvc/uvc_video.c14
3 files changed, 128 insertions, 14 deletions
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c
index 654685c9303e..aa77e54a8fae 100644
--- a/drivers/media/dvb/siano/smsdvb.c
+++ b/drivers/media/dvb/siano/smsdvb.c
@@ -49,9 +49,6 @@ struct smsdvb_client_t {
49 49
50 struct completion tune_done; 50 struct completion tune_done;
51 51
52 /* todo: save freq/band instead whole struct */
53 struct dtv_frontend_properties fe_params;
54
55 struct SMSHOSTLIB_STATISTICS_DVB_S sms_stat_dvb; 52 struct SMSHOSTLIB_STATISTICS_DVB_S sms_stat_dvb;
56 int event_fe_state; 53 int event_fe_state;
57 int event_unc_state; 54 int event_unc_state;
@@ -744,12 +741,124 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe)
744 struct dtv_frontend_properties *fep = &fe->dtv_property_cache; 741 struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
745 struct smsdvb_client_t *client = 742 struct smsdvb_client_t *client =
746 container_of(fe, struct smsdvb_client_t, frontend); 743 container_of(fe, struct smsdvb_client_t, frontend);
744 struct smscore_device_t *coredev = client->coredev;
745 struct TRANSMISSION_STATISTICS_S *td =
746 &client->sms_stat_dvb.TransmissionData;
747 747
748 sms_debug(""); 748 switch (smscore_get_device_mode(coredev)) {
749 case DEVICE_MODE_DVBT:
750 case DEVICE_MODE_DVBT_BDA:
751 fep->frequency = td->Frequency;
752
753 switch (td->Bandwidth) {
754 case 6:
755 fep->bandwidth_hz = 6000000;
756 break;
757 case 7:
758 fep->bandwidth_hz = 7000000;
759 break;
760 case 8:
761 fep->bandwidth_hz = 8000000;
762 break;
763 }
764
765 switch (td->TransmissionMode) {
766 case 2:
767 fep->transmission_mode = TRANSMISSION_MODE_2K;
768 break;
769 case 8:
770 fep->transmission_mode = TRANSMISSION_MODE_8K;
771 }
772
773 switch (td->GuardInterval) {
774 case 0:
775 fep->guard_interval = GUARD_INTERVAL_1_32;
776 break;
777 case 1:
778 fep->guard_interval = GUARD_INTERVAL_1_16;
779 break;
780 case 2:
781 fep->guard_interval = GUARD_INTERVAL_1_8;
782 break;
783 case 3:
784 fep->guard_interval = GUARD_INTERVAL_1_4;
785 break;
786 }
787
788 switch (td->CodeRate) {
789 case 0:
790 fep->code_rate_HP = FEC_1_2;
791 break;
792 case 1:
793 fep->code_rate_HP = FEC_2_3;
794 break;
795 case 2:
796 fep->code_rate_HP = FEC_3_4;
797 break;
798 case 3:
799 fep->code_rate_HP = FEC_5_6;
800 break;
801 case 4:
802 fep->code_rate_HP = FEC_7_8;
803 break;
804 }
805
806 switch (td->LPCodeRate) {
807 case 0:
808 fep->code_rate_LP = FEC_1_2;
809 break;
810 case 1:
811 fep->code_rate_LP = FEC_2_3;
812 break;
813 case 2:
814 fep->code_rate_LP = FEC_3_4;
815 break;
816 case 3:
817 fep->code_rate_LP = FEC_5_6;
818 break;
819 case 4:
820 fep->code_rate_LP = FEC_7_8;
821 break;
822 }
823
824 switch (td->Constellation) {
825 case 0:
826 fep->modulation = QPSK;
827 break;
828 case 1:
829 fep->modulation = QAM_16;
830 break;
831 case 2:
832 fep->modulation = QAM_64;
833 break;
834 }
835
836 switch (td->Hierarchy) {
837 case 0:
838 fep->hierarchy = HIERARCHY_NONE;
839 break;
840 case 1:
841 fep->hierarchy = HIERARCHY_1;
842 break;
843 case 2:
844 fep->hierarchy = HIERARCHY_2;
845 break;
846 case 3:
847 fep->hierarchy = HIERARCHY_4;
848 break;
849 }
749 850
750 /* todo: */ 851 fep->inversion = INVERSION_AUTO;
751 memcpy(fep, &client->fe_params, 852 break;
752 sizeof(struct dtv_frontend_properties)); 853 case DEVICE_MODE_ISDBT:
854 case DEVICE_MODE_ISDBT_BDA:
855 fep->frequency = td->Frequency;
856 fep->bandwidth_hz = 6000000;
857 /* todo: retrive the other parameters */
858 break;
859 default:
860 return -EINVAL;
861 }
753 862
754 return 0; 863 return 0;
755} 864}
@@ -872,11 +981,11 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
872 switch (smscore_get_device_mode(coredev)) { 981 switch (smscore_get_device_mode(coredev)) {
873 case DEVICE_MODE_DVBT: 982 case DEVICE_MODE_DVBT:
874 case DEVICE_MODE_DVBT_BDA: 983 case DEVICE_MODE_DVBT_BDA:
875 smsdvb_fe_ops.delsys[0] = SYS_DVBT; 984 client->frontend.ops.delsys[0] = SYS_DVBT;
876 break; 985 break;
877 case DEVICE_MODE_ISDBT: 986 case DEVICE_MODE_ISDBT:
878 case DEVICE_MODE_ISDBT_BDA: 987 case DEVICE_MODE_ISDBT_BDA:
879 smsdvb_fe_ops.delsys[0] = SYS_ISDBT; 988 client->frontend.ops.delsys[0] = SYS_ISDBT;
880 break; 989 break;
881 } 990 }
882 991
diff --git a/drivers/media/video/davinci/isif.c b/drivers/media/video/davinci/isif.c
index 1e63852374be..5278fe7d6d0c 100644
--- a/drivers/media/video/davinci/isif.c
+++ b/drivers/media/video/davinci/isif.c
@@ -34,6 +34,7 @@
34#include <linux/videodev2.h> 34#include <linux/videodev2.h>
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/err.h> 36#include <linux/err.h>
37#include <linux/module.h>
37 38
38#include <mach/mux.h> 39#include <mach/mux.h>
39 40
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index c7e69b8f81c9..4a44f9a1bae0 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -611,9 +611,11 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
611 delta_stc = buf->pts - (1UL << 31); 611 delta_stc = buf->pts - (1UL << 31);
612 x1 = first->dev_stc - delta_stc; 612 x1 = first->dev_stc - delta_stc;
613 x2 = last->dev_stc - delta_stc; 613 x2 = last->dev_stc - delta_stc;
614 if (x1 == x2)
615 goto done;
616
614 y1 = (first->dev_sof + 2048) << 16; 617 y1 = (first->dev_sof + 2048) << 16;
615 y2 = (last->dev_sof + 2048) << 16; 618 y2 = (last->dev_sof + 2048) << 16;
616
617 if (y2 < y1) 619 if (y2 < y1)
618 y2 += 2048 << 16; 620 y2 += 2048 << 16;
619 621
@@ -631,14 +633,16 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
631 x1, x2, y1, y2, clock->sof_offset); 633 x1, x2, y1, y2, clock->sof_offset);
632 634
633 /* Second step, SOF to host clock conversion. */ 635 /* Second step, SOF to host clock conversion. */
634 ts = timespec_sub(last->host_ts, first->host_ts);
635 x1 = (uvc_video_clock_host_sof(first) + 2048) << 16; 636 x1 = (uvc_video_clock_host_sof(first) + 2048) << 16;
636 x2 = (uvc_video_clock_host_sof(last) + 2048) << 16; 637 x2 = (uvc_video_clock_host_sof(last) + 2048) << 16;
637 y1 = NSEC_PER_SEC;
638 y2 = (ts.tv_sec + 1) * NSEC_PER_SEC + ts.tv_nsec;
639
640 if (x2 < x1) 638 if (x2 < x1)
641 x2 += 2048 << 16; 639 x2 += 2048 << 16;
640 if (x1 == x2)
641 goto done;
642
643 ts = timespec_sub(last->host_ts, first->host_ts);
644 y1 = NSEC_PER_SEC;
645 y2 = (ts.tv_sec + 1) * NSEC_PER_SEC + ts.tv_nsec;
642 646
643 /* Interpolated and host SOF timestamps can wrap around at slightly 647 /* Interpolated and host SOF timestamps can wrap around at slightly
644 * different times. Handle this by adding or removing 2048 to or from 648 * different times. Handle this by adding or removing 2048 to or from