aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-07-31 20:57:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:42:56 -0400
commitceb152add687db152d90ba64b54687b3975963cf (patch)
treec835baf20ce8851187c9ec6142d22189d9203cbc /drivers/media/video/cx25840
parent0c82a8fb5a306eac83d536445a77b6523c71d5e4 (diff)
V4L/DVB: cx23885, cx25840: Report IR max pulse width regardless of mod/demod use
Compute and report the maximum IR pulse measurment width, even if we are set to perform carrier modulation or demodulation and the number is fixed by the carrier freq. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-ir.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/media/video/cx25840/cx25840-ir.c b/drivers/media/video/cx25840/cx25840-ir.c
index 308e87e9fae7..326c2554c05c 100644
--- a/drivers/media/video/cx25840/cx25840-ir.c
+++ b/drivers/media/video/cx25840/cx25840-ir.c
@@ -791,12 +791,15 @@ static int cx25840_ir_rx_s_parameters(struct v4l2_subdev *sd,
791 &p->carrier_range_upper); 791 &p->carrier_range_upper);
792 o->carrier_range_lower = p->carrier_range_lower; 792 o->carrier_range_lower = p->carrier_range_lower;
793 o->carrier_range_upper = p->carrier_range_upper; 793 o->carrier_range_upper = p->carrier_range_upper;
794
795 p->max_pulse_width =
796 (u32) pulse_width_count_to_ns(FIFO_RXTX, rxclk_divider);
794 } else { 797 } else {
795 p->max_pulse_width = 798 p->max_pulse_width =
796 rxclk_rx_s_max_pulse_width(c, p->max_pulse_width, 799 rxclk_rx_s_max_pulse_width(c, p->max_pulse_width,
797 &rxclk_divider); 800 &rxclk_divider);
798 o->max_pulse_width = p->max_pulse_width;
799 } 801 }
802 o->max_pulse_width = p->max_pulse_width;
800 atomic_set(&ir_state->rxclk_divider, rxclk_divider); 803 atomic_set(&ir_state->rxclk_divider, rxclk_divider);
801 804
802 p->noise_filter_min_width = 805 p->noise_filter_min_width =
@@ -970,12 +973,15 @@ static int cx25840_ir_tx_s_parameters(struct v4l2_subdev *sd,
970 973
971 p->duty_cycle = cduty_tx_s_duty_cycle(c, p->duty_cycle); 974 p->duty_cycle = cduty_tx_s_duty_cycle(c, p->duty_cycle);
972 o->duty_cycle = p->duty_cycle; 975 o->duty_cycle = p->duty_cycle;
976
977 p->max_pulse_width =
978 (u32) pulse_width_count_to_ns(FIFO_RXTX, txclk_divider);
973 } else { 979 } else {
974 p->max_pulse_width = 980 p->max_pulse_width =
975 txclk_tx_s_max_pulse_width(c, p->max_pulse_width, 981 txclk_tx_s_max_pulse_width(c, p->max_pulse_width,
976 &txclk_divider); 982 &txclk_divider);
977 o->max_pulse_width = p->max_pulse_width;
978 } 983 }
984 o->max_pulse_width = p->max_pulse_width;
979 atomic_set(&ir_state->txclk_divider, txclk_divider); 985 atomic_set(&ir_state->txclk_divider, txclk_divider);
980 986
981 p->resolution = clock_divider_to_resolution(txclk_divider); 987 p->resolution = clock_divider_to_resolution(txclk_divider);
@@ -1094,12 +1100,10 @@ int cx25840_ir_log_status(struct v4l2_subdev *sd)
1094 "-%1d/+%1d, %u to %u Hz\n", i, j, 1100 "-%1d/+%1d, %u to %u Hz\n", i, j,
1095 clock_divider_to_freq(rxclk, 16 + j), 1101 clock_divider_to_freq(rxclk, 16 + j),
1096 clock_divider_to_freq(rxclk, 16 - i)); 1102 clock_divider_to_freq(rxclk, 16 - i));
1097 } else {
1098 v4l2_info(sd, "\tMax measurable pulse width: %u us, "
1099 "%llu ns\n",
1100 pulse_width_count_to_us(FIFO_RXTX, rxclk),
1101 pulse_width_count_to_ns(FIFO_RXTX, rxclk));
1102 } 1103 }
1104 v4l2_info(sd, "\tMax measurable pulse width: %u us, %llu ns\n",
1105 pulse_width_count_to_us(FIFO_RXTX, rxclk),
1106 pulse_width_count_to_ns(FIFO_RXTX, rxclk));
1103 v4l2_info(sd, "\tLow pass filter: %s\n", 1107 v4l2_info(sd, "\tLow pass filter: %s\n",
1104 filtr ? "enabled" : "disabled"); 1108 filtr ? "enabled" : "disabled");
1105 if (filtr) 1109 if (filtr)
@@ -1139,12 +1143,10 @@ int cx25840_ir_log_status(struct v4l2_subdev *sd)
1139 clock_divider_to_carrier_freq(txclk)); 1143 clock_divider_to_carrier_freq(txclk));
1140 v4l2_info(sd, "\tCarrier duty cycle: %2u/16\n", 1144 v4l2_info(sd, "\tCarrier duty cycle: %2u/16\n",
1141 cduty + 1); 1145 cduty + 1);
1142 } else {
1143 v4l2_info(sd, "\tMax pulse width: %u us, "
1144 "%llu ns\n",
1145 pulse_width_count_to_us(FIFO_RXTX, txclk),
1146 pulse_width_count_to_ns(FIFO_RXTX, txclk));
1147 } 1146 }
1147 v4l2_info(sd, "\tMax pulse width: %u us, %llu ns\n",
1148 pulse_width_count_to_us(FIFO_RXTX, txclk),
1149 pulse_width_count_to_ns(FIFO_RXTX, txclk));
1148 v4l2_info(sd, "\tBusy: %s\n", 1150 v4l2_info(sd, "\tBusy: %s\n",
1149 stats & STATS_TBY ? "yes" : "no"); 1151 stats & STATS_TBY ? "yes" : "no");
1150 v4l2_info(sd, "\tFIFO service requested: %s\n", 1152 v4l2_info(sd, "\tFIFO service requested: %s\n",