static void cx23885_input_process_raw_rc5(struct cx23885_dev *dev)
{
- struct card_ir *ir_input = dev->ir_input;
+ struct cx23885_ir_input *ir_input = dev->ir_input;
unsigned int code, command;
u32 rc5;
u32 ns_pulse)
{
const int rc5_quarterbit_ns = 444444; /* 32 cycles/36 kHz/2 = 444 us */
- struct card_ir *ir_input = dev->ir_input;
+ struct cx23885_ir_input *ir_input = dev->ir_input;
int i, level, quarterbits, halfbits;
if (!ir_input->active) {
static void cx23885_input_process_pulse_widths_rc5(struct cx23885_dev *dev,
bool add_eom)
{
- struct card_ir *ir_input = dev->ir_input;
+ struct cx23885_ir_input *ir_input = dev->ir_input;
struct ir_input_state *ir_input_state = &ir_input->ir;
u32 ns_pulse[RC5_HALF_BITS+1];
static void cx23885_input_ir_start(struct cx23885_dev *dev)
{
- struct card_ir *ir_input = dev->ir_input;
+ struct cx23885_ir_input *ir_input = dev->ir_input;
struct ir_input_state *ir_input_state = &ir_input->ir;
struct v4l2_subdev_ir_parameters params;
static void cx23885_input_ir_stop(struct cx23885_dev *dev)
{
- struct card_ir *ir_input = dev->ir_input;
+ struct cx23885_ir_input *ir_input = dev->ir_input;
struct v4l2_subdev_ir_parameters params;
if (dev->sd_ir == NULL)
int cx23885_input_init(struct cx23885_dev *dev)
{
- struct card_ir *ir;
+ struct cx23885_ir_input *ir;
struct input_dev *input_dev;
char *ir_codes = NULL;
int ir_type, ir_addr, ir_start;
ir->start = ir_start;
/* init input device */
- snprintf(ir->name, sizeof(ir->name), "cx23885 IR (%s)",
- cx23885_boards[dev->board].name);
- snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci));
+ ir->name = kasprintf(GFP_KERNEL, "cx23885 IR (%s)",
+ cx23885_boards[dev->board].name);
+ ir->phys = kasprintf(GFP_KERNEL, "pci-%s/ir0", pci_name(dev->pci));
ret = ir_input_init(input_dev, &ir->ir, ir_type);
if (ret < 0)
cx23885_input_ir_stop(dev);
dev->ir_input = NULL;
err_out_free:
+ kfree(ir->phys);
+ kfree(ir->name);
kfree(ir);
return ret;
}
if (dev->ir_input == NULL)
return;
ir_input_unregister(dev->ir_input->dev);
+ kfree(dev->ir_input->phys);
+ kfree(dev->ir_input->name);
kfree(dev->ir_input);
dev->ir_input = NULL;
}
#include <media/tveeprom.h>
#include <media/videobuf-dma-sg.h>
#include <media/videobuf-dvb.h>
+#include <media/ir-common.h>
#include "btcx-risc.h"
#include "cx23885-reg.h"
void *port_priv;
};
+struct cx23885_ir_input {
+ struct input_dev *dev;
+ struct ir_input_state ir;
+ char *name;
+ char *phys;
+
+ int start;
+ int addr;
+ int rc5_key_timeout;
+ struct timer_list timer_keyup;
+ u32 last_rc5;
+ u32 last_bit;
+ u32 code;
+ int active;
+};
+
struct cx23885_dev {
atomic_t refcount;
struct v4l2_device v4l2_dev;
struct work_struct ir_tx_work;
unsigned long ir_tx_notifications;
- struct card_ir *ir_input;
+ struct cx23885_ir_input *ir_input;
atomic_t ir_input_stopping;
/* V4l */