aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-input.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
commitc328d54cd4ad120d76284e46dcca6c6cf996154a (patch)
tree104c023be66faa5fce6e0a56c0a6d13c62fd21e5 /drivers/media/video/em28xx/em28xx-input.c
parent346ad4b7fe392571f19314f153db9151dbc1d82b (diff)
parentb0166ab3a6ae6d7af8d9a21a7836154963c69a11 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (452 commits) V4L/DVB (7731): tuner-xc2028: fix signal strength calculus V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwares V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were broken V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800 V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder support V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2 V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failure V4L/DVB (7719): pvrusb2: Implement input selection enforcement V4L/DVB (7718): pvrusb2-dvb: update Kbuild selections V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxx V4L/DVB (7716): pvrusb2: clean up global functions V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__ V4L/DVB (7714): pvrusb2: Fix hang on module removal V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown V4L/DVB (7712): pvrusb2: Close connect/disconnect race V4L/DVB (7711): pvrusb2: Fix race on module unload V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for onair devices ...
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-input.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 10da2fd8d987..bb5807159b8d 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -32,10 +32,12 @@
32 32
33static unsigned int ir_debug; 33static unsigned int ir_debug;
34module_param(ir_debug, int, 0644); 34module_param(ir_debug, int, 0644);
35MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]"); 35MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
36 36
37#define dprintk(fmt, arg...) if (ir_debug) \ 37#define dprintk(fmt, arg...) \
38 printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg) 38 if (ir_debug) { \
39 printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg); \
40 }
39 41
40/* ----------------------------------------------------------------------- */ 42/* ----------------------------------------------------------------------- */
41 43
@@ -44,7 +46,7 @@ int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
44 unsigned char b; 46 unsigned char b;
45 47
46 /* poll IR chip */ 48 /* poll IR chip */
47 if (1 != i2c_master_recv(&ir->c,&b,1)) { 49 if (1 != i2c_master_recv(&ir->c, &b, 1)) {
48 dprintk("read error\n"); 50 dprintk("read error\n");
49 return -EIO; 51 return -EIO;
50 } 52 }
@@ -74,24 +76,25 @@ int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
74 unsigned char code; 76 unsigned char code;
75 77
76 /* poll IR chip */ 78 /* poll IR chip */
77 if (2 != i2c_master_recv(&ir->c,buf,2)) 79 if (2 != i2c_master_recv(&ir->c, buf, 2))
78 return -EIO; 80 return -EIO;
79 81
80 /* Does eliminate repeated parity code */ 82 /* Does eliminate repeated parity code */
81 if (buf[1]==0xff) 83 if (buf[1] == 0xff)
82 return 0; 84 return 0;
83 85
84 ir->old=buf[1]; 86 ir->old = buf[1];
85 87
86 /* Rearranges bits to the right order */ 88 /* Rearranges bits to the right order */
87 code= ((buf[0]&0x01)<<5) | /* 0010 0000 */ 89 code = ((buf[0]&0x01)<<5) | /* 0010 0000 */
88 ((buf[0]&0x02)<<3) | /* 0001 0000 */ 90 ((buf[0]&0x02)<<3) | /* 0001 0000 */
89 ((buf[0]&0x04)<<1) | /* 0000 1000 */ 91 ((buf[0]&0x04)<<1) | /* 0000 1000 */
90 ((buf[0]&0x08)>>1) | /* 0000 0100 */ 92 ((buf[0]&0x08)>>1) | /* 0000 0100 */
91 ((buf[0]&0x10)>>3) | /* 0000 0010 */ 93 ((buf[0]&0x10)>>3) | /* 0000 0010 */
92 ((buf[0]&0x20)>>5); /* 0000 0001 */ 94 ((buf[0]&0x20)>>5); /* 0000 0001 */
93 95
94 dprintk("ir hauppauge (em2840): code=0x%02x (rcv=0x%02x)\n",code,buf[0]); 96 dprintk("ir hauppauge (em2840): code=0x%02x (rcv=0x%02x)\n",
97 code, buf[0]);
95 98
96 /* return key */ 99 /* return key */
97 *ir_key = code; 100 *ir_key = code;
@@ -106,15 +109,14 @@ int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
106 109
107 /* poll IR chip */ 110 /* poll IR chip */
108 111
109 if (3 != i2c_master_recv(&ir->c,buf,3)) { 112 if (3 != i2c_master_recv(&ir->c, buf, 3)) {
110 dprintk("read error\n"); 113 dprintk("read error\n");
111 return -EIO; 114 return -EIO;
112 } 115 }
113 116
114 dprintk("key %02x\n", buf[2]&0x3f); 117 dprintk("key %02x\n", buf[2]&0x3f);
115 if (buf[0]!=0x00){ 118 if (buf[0] != 0x00)
116 return 0; 119 return 0;
117 }
118 120
119 *ir_key = buf[2]&0x3f; 121 *ir_key = buf[2]&0x3f;
120 *ir_raw = buf[2]&0x3f; 122 *ir_raw = buf[2]&0x3f;