diff options
author | David Härdeman <david@hardeman.nu> | 2010-11-19 18:43:12 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:54 -0500 |
commit | edb4c25ca3a7997660500692eca3510eac9726e5 (patch) | |
tree | ae8740fc987f5fcca4779491613e1f8ead761fb7 /drivers/media/video/bt8xx | |
parent | 7c8352d18ddbe37cff8ad71175a11739662ef899 (diff) |
[media] bttv: rename struct card_ir to bttv_ir
bttv_ir is more consistent with all other structs used in the same driver.
Also, clean up the struct to remove commented out members and the work_struct
which is unused.
[mchehab@redhat.com: fix a warning at bttv_rc5_timer_end]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 27 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttvp.h | 31 |
2 files changed, 22 insertions, 36 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index 773ee6a8eed4..c344b626e113 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -49,7 +49,7 @@ module_param(ir_rc5_remote_gap, int, 0644); | |||
49 | 49 | ||
50 | static void ir_handle_key(struct bttv *btv) | 50 | static void ir_handle_key(struct bttv *btv) |
51 | { | 51 | { |
52 | struct card_ir *ir = btv->remote; | 52 | struct bttv_ir *ir = btv->remote; |
53 | u32 gpio,data; | 53 | u32 gpio,data; |
54 | 54 | ||
55 | /* read gpio value */ | 55 | /* read gpio value */ |
@@ -83,7 +83,7 @@ static void ir_handle_key(struct bttv *btv) | |||
83 | 83 | ||
84 | static void ir_enltv_handle_key(struct bttv *btv) | 84 | static void ir_enltv_handle_key(struct bttv *btv) |
85 | { | 85 | { |
86 | struct card_ir *ir = btv->remote; | 86 | struct bttv_ir *ir = btv->remote; |
87 | u32 gpio, data, keyup; | 87 | u32 gpio, data, keyup; |
88 | 88 | ||
89 | /* read gpio value */ | 89 | /* read gpio value */ |
@@ -122,7 +122,7 @@ static void ir_enltv_handle_key(struct bttv *btv) | |||
122 | 122 | ||
123 | void bttv_input_irq(struct bttv *btv) | 123 | void bttv_input_irq(struct bttv *btv) |
124 | { | 124 | { |
125 | struct card_ir *ir = btv->remote; | 125 | struct bttv_ir *ir = btv->remote; |
126 | 126 | ||
127 | if (!ir->polling) | 127 | if (!ir->polling) |
128 | ir_handle_key(btv); | 128 | ir_handle_key(btv); |
@@ -131,7 +131,7 @@ void bttv_input_irq(struct bttv *btv) | |||
131 | static void bttv_input_timer(unsigned long data) | 131 | static void bttv_input_timer(unsigned long data) |
132 | { | 132 | { |
133 | struct bttv *btv = (struct bttv*)data; | 133 | struct bttv *btv = (struct bttv*)data; |
134 | struct card_ir *ir = btv->remote; | 134 | struct bttv_ir *ir = btv->remote; |
135 | 135 | ||
136 | if (btv->c.type == BTTV_BOARD_ENLTV_FM_2) | 136 | if (btv->c.type == BTTV_BOARD_ENLTV_FM_2) |
137 | ir_enltv_handle_key(btv); | 137 | ir_enltv_handle_key(btv); |
@@ -185,9 +185,9 @@ static u32 bttv_rc5_decode(unsigned int code) | |||
185 | return rc5; | 185 | return rc5; |
186 | } | 186 | } |
187 | 187 | ||
188 | void bttv_rc5_timer_end(unsigned long data) | 188 | static void bttv_rc5_timer_end(unsigned long data) |
189 | { | 189 | { |
190 | struct card_ir *ir = (struct card_ir *)data; | 190 | struct bttv_ir *ir = (struct bttv_ir *)data; |
191 | struct timeval tv; | 191 | struct timeval tv; |
192 | unsigned long current_jiffies; | 192 | unsigned long current_jiffies; |
193 | u32 gap; | 193 | u32 gap; |
@@ -206,7 +206,7 @@ void bttv_rc5_timer_end(unsigned long data) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | /* signal we're ready to start a new code */ | 208 | /* signal we're ready to start a new code */ |
209 | ir->active = 0; | 209 | ir->active = false; |
210 | 210 | ||
211 | /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */ | 211 | /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */ |
212 | if (gap < 28000) { | 212 | if (gap < 28000) { |
@@ -242,7 +242,7 @@ void bttv_rc5_timer_end(unsigned long data) | |||
242 | 242 | ||
243 | static int bttv_rc5_irq(struct bttv *btv) | 243 | static int bttv_rc5_irq(struct bttv *btv) |
244 | { | 244 | { |
245 | struct card_ir *ir = btv->remote; | 245 | struct bttv_ir *ir = btv->remote; |
246 | struct timeval tv; | 246 | struct timeval tv; |
247 | u32 gpio; | 247 | u32 gpio; |
248 | u32 gap; | 248 | u32 gap; |
@@ -278,7 +278,7 @@ static int bttv_rc5_irq(struct bttv *btv) | |||
278 | } | 278 | } |
279 | /* starting new code */ | 279 | /* starting new code */ |
280 | } else { | 280 | } else { |
281 | ir->active = 1; | 281 | ir->active = true; |
282 | ir->code = 0; | 282 | ir->code = 0; |
283 | ir->base_time = tv; | 283 | ir->base_time = tv; |
284 | ir->last_bit = 0; | 284 | ir->last_bit = 0; |
@@ -295,7 +295,7 @@ static int bttv_rc5_irq(struct bttv *btv) | |||
295 | 295 | ||
296 | /* ---------------------------------------------------------------------- */ | 296 | /* ---------------------------------------------------------------------- */ |
297 | 297 | ||
298 | static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) | 298 | static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir) |
299 | { | 299 | { |
300 | if (ir->polling) { | 300 | if (ir->polling) { |
301 | setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv); | 301 | setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv); |
@@ -303,9 +303,8 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) | |||
303 | add_timer(&ir->timer); | 303 | add_timer(&ir->timer); |
304 | } else if (ir->rc5_gpio) { | 304 | } else if (ir->rc5_gpio) { |
305 | /* set timer_end for code completion */ | 305 | /* set timer_end for code completion */ |
306 | init_timer(&ir->timer_end); | 306 | setup_timer(&ir->timer_end, bttv_rc5_timer_end, |
307 | ir->timer_end.function = bttv_rc5_timer_end; | 307 | (unsigned long)ir); |
308 | ir->timer_end.data = (unsigned long)ir; | ||
309 | ir->shift_by = 1; | 308 | ir->shift_by = 1; |
310 | ir->start = 3; | 309 | ir->start = 3; |
311 | ir->addr = 0x0; | 310 | ir->addr = 0x0; |
@@ -409,7 +408,7 @@ int __devexit fini_bttv_i2c(struct bttv *btv) | |||
409 | 408 | ||
410 | int bttv_input_init(struct bttv *btv) | 409 | int bttv_input_init(struct bttv *btv) |
411 | { | 410 | { |
412 | struct card_ir *ir; | 411 | struct bttv_ir *ir; |
413 | char *ir_codes = NULL; | 412 | char *ir_codes = NULL; |
414 | struct rc_dev *rc; | 413 | struct rc_dev *rc; |
415 | int err = -ENOMEM; | 414 | int err = -ENOMEM; |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index b71d04d12085..3d5b2bc1d376 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -120,15 +120,12 @@ struct bttv_format { | |||
120 | int hshift,vshift; /* for planar modes */ | 120 | int hshift,vshift; /* for planar modes */ |
121 | }; | 121 | }; |
122 | 122 | ||
123 | struct card_ir { | 123 | struct bttv_ir { |
124 | struct rc_dev *dev; | 124 | struct rc_dev *dev; |
125 | 125 | ||
126 | char name[32]; | 126 | char name[32]; |
127 | char phys[32]; | 127 | char phys[32]; |
128 | #if 0 | 128 | |
129 | int users; | ||
130 | u32 running:1; | ||
131 | #endif | ||
132 | /* Usual gpio signalling */ | 129 | /* Usual gpio signalling */ |
133 | u32 mask_keycode; | 130 | u32 mask_keycode; |
134 | u32 mask_keydown; | 131 | u32 mask_keydown; |
@@ -139,25 +136,15 @@ struct card_ir { | |||
139 | int start; // What should RC5_START() be | 136 | int start; // What should RC5_START() be |
140 | int addr; // What RC5_ADDR() should be. | 137 | int addr; // What RC5_ADDR() should be. |
141 | int rc5_remote_gap; | 138 | int rc5_remote_gap; |
142 | struct work_struct work; | ||
143 | struct timer_list timer; | 139 | struct timer_list timer; |
144 | 140 | ||
145 | /* RC5 gpio */ | 141 | /* RC5 gpio */ |
146 | u32 rc5_gpio; | 142 | u32 rc5_gpio; |
147 | struct timer_list timer_end; /* timer_end for code completion */ | 143 | struct timer_list timer_end; /* timer_end for code completion */ |
148 | u32 last_bit; /* last raw bit seen */ | 144 | u32 last_bit; /* last raw bit seen */ |
149 | u32 code; /* raw code under construction */ | 145 | u32 code; /* raw code under construction */ |
150 | struct timeval base_time; /* time of last seen code */ | 146 | struct timeval base_time; /* time of last seen code */ |
151 | int active; /* building raw code */ | 147 | bool active; /* building raw code */ |
152 | |||
153 | #if 0 | ||
154 | /* NEC decoding */ | ||
155 | u32 nec_gpio; | ||
156 | struct tasklet_struct tlet; | ||
157 | |||
158 | /* IR core raw decoding */ | ||
159 | u32 raw_decode; | ||
160 | #endif | ||
161 | }; | 148 | }; |
162 | 149 | ||
163 | 150 | ||
@@ -408,7 +395,7 @@ struct bttv { | |||
408 | 395 | ||
409 | /* infrared remote */ | 396 | /* infrared remote */ |
410 | int has_remote; | 397 | int has_remote; |
411 | struct card_ir *remote; | 398 | struct bttv_ir *remote; |
412 | 399 | ||
413 | /* I2C remote data */ | 400 | /* I2C remote data */ |
414 | struct IR_i2c_init_data init_data; | 401 | struct IR_i2c_init_data init_data; |