From: Jean Delvare <khali@linux-fr.org>
To: LMML <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
Andy Walls <awalls@radix.net>, Hans Verkuil <hverkuil@xs4all.nl>,
Mike Isely <isely@pobox.com>
Subject: [PATCH 1/8] ir-kbd-i2c: Don't use i2c_client.name for our own needs
Date: Wed, 13 May 2009 21:48:07 +0200 [thread overview]
Message-ID: <20090513214807.5f5707af@hyperion.delvare> (raw)
In-Reply-To: <20090513214559.0f009231@hyperion.delvare>
In the standard device driver binding model, the name field of
struct i2c_client is used to match devices to their drivers, so we
must stop using it for internal purposes. Define a separate field
in struct IR_i2c as a replacement, and use it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
linux/drivers/media/video/cx231xx/cx231xx-input.c | 2 +-
linux/drivers/media/video/em28xx/em28xx-cards.c | 6 +++---
linux/drivers/media/video/em28xx/em28xx-input.c | 2 +-
linux/drivers/media/video/ir-kbd-i2c.c | 5 +++--
linux/drivers/media/video/saa7134/saa7134-input.c | 12 ++++++------
linux/include/media/ir-kbd-i2c.h | 1 +
6 files changed, 15 insertions(+), 13 deletions(-)
--- v4l-dvb.orig/linux/drivers/media/video/cx231xx/cx231xx-input.c 2009-04-24 11:45:21.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/cx231xx/cx231xx-input.c 2009-04-29 14:30:32.000000000 +0200
@@ -37,7 +37,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug
#define i2cdprintk(fmt, arg...) \
if (ir_debug) { \
- printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg); \
+ printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \
}
#define dprintk(fmt, arg...) \
--- v4l-dvb.orig/linux/drivers/media/video/em28xx/em28xx-cards.c 2009-04-24 11:45:21.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/em28xx/em28xx-cards.c 2009-04-29 14:30:32.000000000 +0200
@@ -1948,19 +1948,19 @@ void em28xx_set_ir(struct em28xx *dev, s
case (EM2820_BOARD_TERRATEC_CINERGY_250):
ir->ir_codes = ir_codes_em_terratec;
ir->get_key = em28xx_get_key_terratec;
- snprintf(ir->c.name, sizeof(ir->c.name),
+ snprintf(ir->name, sizeof(ir->name),
"i2c IR (EM28XX Terratec)");
break;
case (EM2820_BOARD_PINNACLE_USB_2):
ir->ir_codes = ir_codes_pinnacle_grey;
ir->get_key = em28xx_get_key_pinnacle_usb_grey;
- snprintf(ir->c.name, sizeof(ir->c.name),
+ snprintf(ir->name, sizeof(ir->name),
"i2c IR (EM28XX Pinnacle PCTV)");
break;
case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
ir->ir_codes = ir_codes_hauppauge_new;
ir->get_key = em28xx_get_key_em_haup;
- snprintf(ir->c.name, sizeof(ir->c.name),
+ snprintf(ir->name, sizeof(ir->name),
"i2c IR (EM2840 Hauppauge)");
break;
case (EM2820_BOARD_MSI_VOX_USB_2):
--- v4l-dvb.orig/linux/drivers/media/video/em28xx/em28xx-input.c 2009-04-24 11:45:21.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/em28xx/em28xx-input.c 2009-04-29 14:30:32.000000000 +0200
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug
#define i2cdprintk(fmt, arg...) \
if (ir_debug) { \
- printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg); \
+ printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \
}
#define dprintk(fmt, arg...) \
--- v4l-dvb.orig/linux/drivers/media/video/ir-kbd-i2c.c 2009-04-24 11:45:21.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/ir-kbd-i2c.c 2009-04-29 14:30:32.000000000 +0200
@@ -346,6 +346,7 @@ static int ir_attach(struct i2c_adapter
ir->c.adapter = adap;
ir->c.addr = addr;
+ snprintf(ir->c.name, sizeof(ir->c.name), "ir-kbd");
i2c_set_clientdata(&ir->c, ir);
@@ -419,7 +420,7 @@ static int ir_attach(struct i2c_adapter
}
/* Sets name */
- snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);
+ snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name);
ir->ir_codes = ir_codes;
/* register i2c device
@@ -444,7 +445,7 @@ static int ir_attach(struct i2c_adapter
/* init + register input device */
ir_input_init(input_dev, &ir->ir, ir_type, ir->ir_codes);
input_dev->id.bustype = BUS_I2C;
- input_dev->name = ir->c.name;
+ input_dev->name = ir->name;
input_dev->phys = ir->phys;
err = input_register_device(ir->input);
--- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-input.c 2009-04-29 14:30:29.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-input.c 2009-04-29 14:30:32.000000000 +0200
@@ -60,7 +60,7 @@ MODULE_PARM_DESC(disable_other_ir, "disa
#define dprintk(fmt, arg...) if (ir_debug) \
printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg)
#define i2cdprintk(fmt, arg...) if (ir_debug) \
- printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg)
+ printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg)
/* Helper functions for RC5 and NEC decoding at GPIO16 or GPIO18 */
static int saa7134_rc5_irq(struct saa7134_dev *dev);
@@ -697,7 +697,7 @@ void saa7134_set_i2c_ir(struct saa7134_d
switch (dev->board) {
case SAA7134_BOARD_PINNACLE_PCTV_110i:
case SAA7134_BOARD_PINNACLE_PCTV_310i:
- snprintf(ir->c.name, sizeof(ir->c.name), "Pinnacle PCTV");
+ snprintf(ir->name, sizeof(ir->name), "Pinnacle PCTV");
if (pinnacle_remote == 0) {
ir->get_key = get_key_pinnacle_color;
ir->ir_codes = ir_codes_pinnacle_color;
@@ -707,17 +707,17 @@ void saa7134_set_i2c_ir(struct saa7134_d
}
break;
case SAA7134_BOARD_UPMOST_PURPLE_TV:
- snprintf(ir->c.name, sizeof(ir->c.name), "Purple TV");
+ snprintf(ir->name, sizeof(ir->name), "Purple TV");
ir->get_key = get_key_purpletv;
ir->ir_codes = ir_codes_purpletv;
break;
case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS:
- snprintf(ir->c.name, sizeof(ir->c.name), "MSI TV@nywhere Plus");
+ snprintf(ir->name, sizeof(ir->name), "MSI TV@nywhere Plus");
ir->get_key = get_key_msi_tvanywhere_plus;
ir->ir_codes = ir_codes_msi_tvanywhere_plus;
break;
case SAA7134_BOARD_HAUPPAUGE_HVR1110:
- snprintf(ir->c.name, sizeof(ir->c.name), "HVR 1110");
+ snprintf(ir->name, sizeof(ir->name), "HVR 1110");
ir->get_key = get_key_hvr1110;
ir->ir_codes = ir_codes_hauppauge_new;
break;
@@ -733,7 +733,7 @@ void saa7134_set_i2c_ir(struct saa7134_d
case SAA7134_BOARD_BEHOLD_M63:
case SAA7134_BOARD_BEHOLD_M6_EXTRA:
case SAA7134_BOARD_BEHOLD_H6:
- snprintf(ir->c.name, sizeof(ir->c.name), "BeholdTV");
+ snprintf(ir->name, sizeof(ir->name), "BeholdTV");
ir->get_key = get_key_beholdm6xx;
ir->ir_codes = ir_codes_behold;
break;
--- v4l-dvb.orig/linux/include/media/ir-kbd-i2c.h 2009-04-24 11:45:21.000000000 +0200
+++ v4l-dvb/linux/include/media/ir-kbd-i2c.h 2009-04-29 14:30:32.000000000 +0200
@@ -15,6 +15,7 @@ struct IR_i2c {
unsigned char old;
struct delayed_work work;
+ char name[32];
char phys[32];
int (*get_key)(struct IR_i2c*, u32*, u32*);
};
--
Jean Delvare
next prev parent reply other threads:[~2009-05-13 19:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 19:45 [PATCH 0/8] ir-kbd-i2c conversion to the new i2c binding model (v3) Jean Delvare
2009-05-13 19:48 ` Jean Delvare [this message]
2009-05-13 19:48 ` [PATCH 2/8] ir-kbd-i2c: Switch to the new-style device binding model Jean Delvare
2009-05-13 19:49 ` [PATCH 3/8] ir-kbd-i2c: Use initialization data Jean Delvare
2009-05-13 19:50 ` [PATCH 4/8] ir-kbd-i2c: Don't assume all IR receivers are supported Jean Delvare
2009-05-13 19:51 ` [PATCH 5/8] saa7134: Simplify handling of IR on MSI TV@nywhere Plus Jean Delvare
2009-05-13 19:52 ` [PATCH 6/8] saa7134: Simplify handling of IR on AVerMedia Cardbus E506R Jean Delvare
2009-05-13 19:55 ` [PATCH 7/8] ivtv: Probe more I2C addresses for IR devices Jean Delvare
2009-05-13 19:56 ` [PATCH 8/8] pvrusb2: Instantiate ir_video I2C device by default Jean Delvare
2009-05-17 21:56 ` Mike Isely
2009-05-14 19:25 ` [PATCH 0/8] ir-kbd-i2c conversion to the new i2c binding model (v3) Oldřich Jedlička
2009-05-14 19:26 ` Jean Delvare
2009-05-17 21:55 ` Mike Isely
2009-05-18 7:18 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090513214807.5f5707af@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=awalls@radix.net \
--cc=hverkuil@xs4all.nl \
--cc=isely@pobox.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox