aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-10 18:21:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 06:51:47 -0400
commit5c3b87435b291efb260aec37fdbe397859e550c5 (patch)
tree03c877ae54bc725cf570a3783b859bd629f1bb48
parent9671045f4ce7a9e5eedc669a6921aeec26bd095e (diff)
[media] siano: Fix bandwidth report
It was expected that the bandwidth would be following the defines at smscoreapi.h. However, this doesn't work. Instead, this field brings just the bandwidth in MHz. Convert it to Hertz. It should be noticed that, on ISDB, using the _EX request, the field TuneBW seems to show the value that matches the bandwidth code. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/siano/smsdvb-main.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
index 632a250a42cf..d83896bb98fd 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -43,18 +43,6 @@ module_param_named(debug, sms_dbg, int, 0644);
43MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); 43MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))");
44 44
45 45
46u32 sms_to_bw_table[] = {
47 [BW_8_MHZ] = 8000000,
48 [BW_7_MHZ] = 7000000,
49 [BW_6_MHZ] = 6000000,
50 [BW_5_MHZ] = 5000000,
51 [BW_2_MHZ] = 2000000,
52 [BW_1_5_MHZ] = 1500000,
53 [BW_ISDBT_1SEG] = 6000000,
54 [BW_ISDBT_3SEG] = 6000000,
55 [BW_ISDBT_13SEG] = 6000000,
56};
57
58u32 sms_to_guard_interval_table[] = { 46u32 sms_to_guard_interval_table[] = {
59 [0] = GUARD_INTERVAL_1_32, 47 [0] = GUARD_INTERVAL_1_32,
60 [1] = GUARD_INTERVAL_1_16, 48 [1] = GUARD_INTERVAL_1_16,
@@ -204,6 +192,10 @@ static inline int sms_to_status(u32 is_demod_locked, u32 is_rf_locked)
204 return 0; 192 return 0;
205} 193}
206 194
195static inline u32 sms_to_bw(u32 value)
196{
197 return value * 1000000;
198}
207 199
208#define convert_from_table(value, table, defval) ({ \ 200#define convert_from_table(value, table, defval) ({ \
209 u32 __ret; \ 201 u32 __ret; \
@@ -214,9 +206,6 @@ static inline int sms_to_status(u32 is_demod_locked, u32 is_rf_locked)
214 __ret; \ 206 __ret; \
215}) 207})
216 208
217#define sms_to_bw(value) \
218 convert_from_table(value, sms_to_bw_table, 0);
219
220#define sms_to_guard_interval(value) \ 209#define sms_to_guard_interval(value) \
221 convert_from_table(value, sms_to_guard_interval_table, \ 210 convert_from_table(value, sms_to_guard_interval_table, \
222 GUARD_INTERVAL_AUTO); 211 GUARD_INTERVAL_AUTO);