Skip to contentSkip to conversation

rc: Allow specifying properties for i2c IR's

PATCH New Mauro Carvalho Chehab 1 participant 2 messages Nov 11, 2010 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 rc: Allow specifying properties for i2c IR's

Several I2C IR's only provide part of the IR protocol message (in general, they provide only the command part). Due to that, some props fields need to be specified.

drivers/media/video/ir-kbd-i2c.c +3 -1
index aee8943..82834ea 100644
@@ -270,6 +270,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	char *ir_codes = NULL;
 	const char *name = NULL;
+	struct ir_dev_props *props = NULL;
 	u64 ir_type = IR_TYPE_UNKNOWN;
 	struct IR_i2c *ir;
 	struct input_dev *input_dev;
@@ -337,6 +338,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		name = init_data->name;
 		if (init_data->type)
 			ir_type = init_data->type;
+		props = init_data->props;
 
 		if (init_data->polling_interval)
 			ir->polling_interval = init_data->polling_interval;
@@ -388,7 +390,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	input_dev->name       = ir->name;
 	input_dev->phys       = ir->phys;
 
-	err = ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME);
+	err = ir_input_register(ir->input, ir->ir_codes, props, MODULE_NAME);
 	if (err)
 		goto err_out_free;
 
include/media/ir-kbd-i2c.h +2 -0
index 8c37b5e..19ea5fa 100644
@@ -47,5 +47,7 @@ struct IR_i2c_init_data {
 	 */
 	int                    (*get_key)(struct IR_i2c*, u32*, u32*);
 	enum ir_kbd_get_key_fn internal_get_key_func;
+
+	struct ir_dev_props    *props;
 };
 #endif
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 cx231xx: Don't register remote controls twice

In reply to a message not in the archive

There's a bug at cx231xx-input, where it were registering the remote controls twice, one via ir-kbd-i2c and another directly. Fix it by registering it only once.

While here, also fix Kconfig symbol change for IR core dependencies.

drivers/media/video/cx231xx/Kconfig +1 -1
index ab7d5df..d6a2350 100644
@@ -16,7 +16,7 @@ config VIDEO_CX231XX
 
 config VIDEO_CX231XX_RC
 	bool "Conexant cx231xx Remote Controller additional support"
-	depends on VIDEO_IR
+	depends on IR_CORE
 	depends on VIDEO_CX231XX
 	default y
 	---help---
drivers/media/video/cx231xx/cx231xx-input.c +12 -35

86 lines not on this page · raw message

drivers/media/video/cx231xx/cx231xx.h +1 -12
index a09cef4..fcccc9d 100644
@@ -602,17 +602,6 @@ struct cx231xx_tsport {
 	void                       *port_priv;
 };
 
-struct cx231xx_ir_t {
-	struct input_dev *input_dev;
-	char name[40];
-	char phys[32];
-
-	struct ir_dev_props props;
-
-	/* I2C keyboard data */
-	struct IR_i2c_init_data    init_data;
-};
-
 /* main device struct */
 struct cx231xx {
 	/* generic device properties */
@@ -623,7 +612,7 @@ struct cx231xx {
 	struct cx231xx_board board;
 
 	/* For I2C IR support */
-	struct cx231xx_ir_t ir;
+	struct IR_i2c_init_data    init_data;
 
 	unsigned int stream_on:1;	/* Locks streams */
 	unsigned int vbi_stream_on:1;	/* Locks streams for VBI */
Signature · 1 line
1.7.1