aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c2
-rw-r--r--drivers/media/video/cx23885/cx23888-ir.c32
2 files changed, 25 insertions, 9 deletions
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index d0b1613ede2f..496d751ffdc8 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -170,7 +170,7 @@ static int cx23885_input_ir_start(struct cx23885_dev *dev)
170 * mark is received as low logic level; 170 * mark is received as low logic level;
171 * falling edges are detected as rising edges; etc. 171 * falling edges are detected as rising edges; etc.
172 */ 172 */
173 params.invert = true; 173 params.invert_level = true;
174 break; 174 break;
175 } 175 }
176 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params); 176 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params);
diff --git a/drivers/media/video/cx23885/cx23888-ir.c b/drivers/media/video/cx23885/cx23888-ir.c
index f63d378257a7..28ca90ff223c 100644
--- a/drivers/media/video/cx23885/cx23888-ir.c
+++ b/drivers/media/video/cx23885/cx23888-ir.c
@@ -60,6 +60,8 @@ MODULE_PARM_DESC(ir_888_debug, "enable debug messages [CX23888 IR controller]");
60#define CNTRL_CPL 0x00001000 60#define CNTRL_CPL 0x00001000
61#define CNTRL_LBM 0x00002000 61#define CNTRL_LBM 0x00002000
62#define CNTRL_R 0x00004000 62#define CNTRL_R 0x00004000
63/* CX23888 specific control flag */
64#define CNTRL_IVO 0x00008000
63 65
64#define CX23888_IR_TXCLK_REG 0x170004 66#define CX23888_IR_TXCLK_REG 0x170004
65#define TXCLK_TCD 0x0000FFFF 67#define TXCLK_TCD 0x0000FFFF
@@ -423,6 +425,13 @@ static inline void control_tx_polarity_invert(struct cx23885_dev *dev,
423 invert ? CNTRL_CPL : 0); 425 invert ? CNTRL_CPL : 0);
424} 426}
425 427
428static inline void control_tx_level_invert(struct cx23885_dev *dev,
429 bool invert)
430{
431 cx23888_ir_and_or4(dev, CX23888_IR_CNTRL_REG, ~CNTRL_IVO,
432 invert ? CNTRL_IVO : 0);
433}
434
426/* 435/*
427 * IR Rx & Tx Clock Register helpers 436 * IR Rx & Tx Clock Register helpers
428 */ 437 */
@@ -782,8 +791,8 @@ static int cx23888_ir_rx_s_parameters(struct v4l2_subdev *sd,
782 791
783 control_rx_s_edge_detection(dev, CNTRL_EDG_BOTH); 792 control_rx_s_edge_detection(dev, CNTRL_EDG_BOTH);
784 793
785 o->invert = p->invert; 794 o->invert_level = p->invert_level;
786 atomic_set(&state->rx_invert, p->invert); 795 atomic_set(&state->rx_invert, p->invert_level);
787 796
788 o->interrupt_enable = p->interrupt_enable; 797 o->interrupt_enable = p->interrupt_enable;
789 o->enable = p->enable; 798 o->enable = p->enable;
@@ -894,8 +903,11 @@ static int cx23888_ir_tx_s_parameters(struct v4l2_subdev *sd,
894 /* FIXME - make this dependent on resolution for better performance */ 903 /* FIXME - make this dependent on resolution for better performance */
895 control_tx_irq_watermark(dev, TX_FIFO_HALF_EMPTY); 904 control_tx_irq_watermark(dev, TX_FIFO_HALF_EMPTY);
896 905
897 control_tx_polarity_invert(dev, p->invert); 906 control_tx_polarity_invert(dev, p->invert_carrier_sense);
898 o->invert = p->invert; 907 o->invert_carrier_sense = p->invert_carrier_sense;
908
909 control_tx_level_invert(dev, p->invert_level);
910 o->invert_level = p->invert_level;
899 911
900 o->interrupt_enable = p->interrupt_enable; 912 o->interrupt_enable = p->interrupt_enable;
901 o->enable = p->enable; 913 o->enable = p->enable;
@@ -1025,8 +1037,11 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd)
1025 cntrl & CNTRL_TFE ? "enabled" : "disabled"); 1037 cntrl & CNTRL_TFE ? "enabled" : "disabled");
1026 v4l2_info(sd, "\tFIFO interrupt watermark: %s\n", 1038 v4l2_info(sd, "\tFIFO interrupt watermark: %s\n",
1027 cntrl & CNTRL_TIC ? "not empty" : "half full or less"); 1039 cntrl & CNTRL_TIC ? "not empty" : "half full or less");
1028 v4l2_info(sd, "\tSignal polarity: %s\n", 1040 v4l2_info(sd, "\tOutput pin level inversion %s\n",
1029 cntrl & CNTRL_CPL ? "0:mark 1:space" : "0:space 1:mark"); 1041 cntrl & CNTRL_IVO ? "yes" : "no");
1042 v4l2_info(sd, "\tCarrier polarity: %s\n",
1043 cntrl & CNTRL_CPL ? "space:burst mark:noburst"
1044 : "space:noburst mark:burst");
1030 if (cntrl & CNTRL_MOD) { 1045 if (cntrl & CNTRL_MOD) {
1031 v4l2_info(sd, "\tCarrier (16 clocks): %u Hz\n", 1046 v4l2_info(sd, "\tCarrier (16 clocks): %u Hz\n",
1032 clock_divider_to_carrier_freq(txclk)); 1047 clock_divider_to_carrier_freq(txclk));
@@ -1146,7 +1161,7 @@ static const struct v4l2_subdev_ir_parameters default_rx_params = {
1146 .noise_filter_min_width = 333333, /* ns */ 1161 .noise_filter_min_width = 333333, /* ns */
1147 .carrier_range_lower = 35000, 1162 .carrier_range_lower = 35000,
1148 .carrier_range_upper = 37000, 1163 .carrier_range_upper = 37000,
1149 .invert = false, 1164 .invert_level = false,
1150}; 1165};
1151 1166
1152static const struct v4l2_subdev_ir_parameters default_tx_params = { 1167static const struct v4l2_subdev_ir_parameters default_tx_params = {
@@ -1160,7 +1175,8 @@ static const struct v4l2_subdev_ir_parameters default_tx_params = {
1160 .modulation = true, 1175 .modulation = true,
1161 .carrier_freq = 36000, /* 36 kHz - RC-5 carrier */ 1176 .carrier_freq = 36000, /* 36 kHz - RC-5 carrier */
1162 .duty_cycle = 25, /* 25 % - RC-5 carrier */ 1177 .duty_cycle = 25, /* 25 % - RC-5 carrier */
1163 .invert = false, 1178 .invert_level = false,
1179 .invert_carrier_sense = false,
1164}; 1180};
1165 1181
1166int cx23888_ir_probe(struct cx23885_dev *dev) 1182int cx23888_ir_probe(struct cx23885_dev *dev)