diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-10-12 09:41:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:18:37 -0400 |
commit | b768d47eb6e467b198351c0344e2e3e49c45c476 (patch) | |
tree | f4c258548bf4e8999742c697cffdca985a02eae7 /drivers/media/IR | |
parent | 4fc215430f6764f3e30bdf86bc2a46ab2e0c4404 (diff) |
[media] IR/streamzap: shorten up some define names for readability
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r-- | drivers/media/IR/streamzap.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/IR/streamzap.c b/drivers/media/IR/streamzap.c index 2cf57e64a80b..623ee2dc198e 100644 --- a/drivers/media/IR/streamzap.c +++ b/drivers/media/IR/streamzap.c | |||
@@ -61,10 +61,10 @@ static struct usb_device_id streamzap_table[] = { | |||
61 | 61 | ||
62 | MODULE_DEVICE_TABLE(usb, streamzap_table); | 62 | MODULE_DEVICE_TABLE(usb, streamzap_table); |
63 | 63 | ||
64 | #define STREAMZAP_PULSE_MASK 0xf0 | 64 | #define SZ_PULSE_MASK 0xf0 |
65 | #define STREAMZAP_SPACE_MASK 0x0f | 65 | #define SZ_SPACE_MASK 0x0f |
66 | #define STREAMZAP_TIMEOUT 0xff | 66 | #define SZ_TIMEOUT 0xff |
67 | #define STREAMZAP_RESOLUTION 256 | 67 | #define SZ_RESOLUTION 256 |
68 | 68 | ||
69 | /* number of samples buffered */ | 69 | /* number of samples buffered */ |
70 | #define SZ_BUF_LEN 128 | 70 | #define SZ_BUF_LEN 128 |
@@ -175,8 +175,8 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
175 | } | 175 | } |
176 | 176 | ||
177 | rawir.pulse = true; | 177 | rawir.pulse = true; |
178 | rawir.duration = ((int) value) * STREAMZAP_RESOLUTION; | 178 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
179 | rawir.duration += STREAMZAP_RESOLUTION / 2; | 179 | rawir.duration += SZ_RESOLUTION / 2; |
180 | sz->sum += rawir.duration; | 180 | sz->sum += rawir.duration; |
181 | rawir.duration *= 1000; | 181 | rawir.duration *= 1000; |
182 | rawir.duration &= IR_MAX_DURATION; | 182 | rawir.duration &= IR_MAX_DURATION; |
@@ -187,7 +187,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
187 | static void sz_push_half_pulse(struct streamzap_ir *sz, | 187 | static void sz_push_half_pulse(struct streamzap_ir *sz, |
188 | unsigned char value) | 188 | unsigned char value) |
189 | { | 189 | { |
190 | sz_push_full_pulse(sz, (value & STREAMZAP_PULSE_MASK) >> 4); | 190 | sz_push_full_pulse(sz, (value & SZ_PULSE_MASK) >> 4); |
191 | } | 191 | } |
192 | 192 | ||
193 | static void sz_push_full_space(struct streamzap_ir *sz, | 193 | static void sz_push_full_space(struct streamzap_ir *sz, |
@@ -196,8 +196,8 @@ static void sz_push_full_space(struct streamzap_ir *sz, | |||
196 | struct ir_raw_event rawir; | 196 | struct ir_raw_event rawir; |
197 | 197 | ||
198 | rawir.pulse = false; | 198 | rawir.pulse = false; |
199 | rawir.duration = ((int) value) * STREAMZAP_RESOLUTION; | 199 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
200 | rawir.duration += STREAMZAP_RESOLUTION / 2; | 200 | rawir.duration += SZ_RESOLUTION / 2; |
201 | sz->sum += rawir.duration; | 201 | sz->sum += rawir.duration; |
202 | rawir.duration *= 1000; | 202 | rawir.duration *= 1000; |
203 | dev_dbg(sz->dev, "s %u\n", rawir.duration); | 203 | dev_dbg(sz->dev, "s %u\n", rawir.duration); |
@@ -207,7 +207,7 @@ static void sz_push_full_space(struct streamzap_ir *sz, | |||
207 | static void sz_push_half_space(struct streamzap_ir *sz, | 207 | static void sz_push_half_space(struct streamzap_ir *sz, |
208 | unsigned long value) | 208 | unsigned long value) |
209 | { | 209 | { |
210 | sz_push_full_space(sz, value & STREAMZAP_SPACE_MASK); | 210 | sz_push_full_space(sz, value & SZ_SPACE_MASK); |
211 | } | 211 | } |
212 | 212 | ||
213 | /** | 213 | /** |
@@ -221,7 +221,7 @@ static void streamzap_callback(struct urb *urb) | |||
221 | struct streamzap_ir *sz; | 221 | struct streamzap_ir *sz; |
222 | unsigned int i; | 222 | unsigned int i; |
223 | int len; | 223 | int len; |
224 | static int timeout = (((STREAMZAP_TIMEOUT * STREAMZAP_RESOLUTION) & | 224 | static int timeout = (((SZ_TIMEOUT * SZ_RESOLUTION) & |
225 | IR_MAX_DURATION) | 0x03000000); | 225 | IR_MAX_DURATION) | 0x03000000); |
226 | 226 | ||
227 | if (!urb) | 227 | if (!urb) |
@@ -250,12 +250,12 @@ static void streamzap_callback(struct urb *urb) | |||
250 | i, (unsigned char)sz->buf_in[i]); | 250 | i, (unsigned char)sz->buf_in[i]); |
251 | switch (sz->decoder_state) { | 251 | switch (sz->decoder_state) { |
252 | case PulseSpace: | 252 | case PulseSpace: |
253 | if ((sz->buf_in[i] & STREAMZAP_PULSE_MASK) == | 253 | if ((sz->buf_in[i] & SZ_PULSE_MASK) == |
254 | STREAMZAP_PULSE_MASK) { | 254 | SZ_PULSE_MASK) { |
255 | sz->decoder_state = FullPulse; | 255 | sz->decoder_state = FullPulse; |
256 | continue; | 256 | continue; |
257 | } else if ((sz->buf_in[i] & STREAMZAP_SPACE_MASK) | 257 | } else if ((sz->buf_in[i] & SZ_SPACE_MASK) |
258 | == STREAMZAP_SPACE_MASK) { | 258 | == SZ_SPACE_MASK) { |
259 | sz_push_half_pulse(sz, sz->buf_in[i]); | 259 | sz_push_half_pulse(sz, sz->buf_in[i]); |
260 | sz->decoder_state = FullSpace; | 260 | sz->decoder_state = FullSpace; |
261 | continue; | 261 | continue; |
@@ -269,7 +269,7 @@ static void streamzap_callback(struct urb *urb) | |||
269 | sz->decoder_state = IgnorePulse; | 269 | sz->decoder_state = IgnorePulse; |
270 | break; | 270 | break; |
271 | case FullSpace: | 271 | case FullSpace: |
272 | if (sz->buf_in[i] == STREAMZAP_TIMEOUT) { | 272 | if (sz->buf_in[i] == SZ_TIMEOUT) { |
273 | struct ir_raw_event rawir; | 273 | struct ir_raw_event rawir; |
274 | 274 | ||
275 | rawir.pulse = false; | 275 | rawir.pulse = false; |
@@ -284,8 +284,8 @@ static void streamzap_callback(struct urb *urb) | |||
284 | sz->decoder_state = PulseSpace; | 284 | sz->decoder_state = PulseSpace; |
285 | break; | 285 | break; |
286 | case IgnorePulse: | 286 | case IgnorePulse: |
287 | if ((sz->buf_in[i] & STREAMZAP_SPACE_MASK) == | 287 | if ((sz->buf_in[i] & SZ_SPACE_MASK) == |
288 | STREAMZAP_SPACE_MASK) { | 288 | SZ_SPACE_MASK) { |
289 | sz->decoder_state = FullSpace; | 289 | sz->decoder_state = FullSpace; |
290 | continue; | 290 | continue; |
291 | } | 291 | } |
@@ -447,8 +447,8 @@ static int __devinit streamzap_probe(struct usb_interface *intf, | |||
447 | #if 0 | 447 | #if 0 |
448 | /* not yet supported, depends on patches from maxim */ | 448 | /* not yet supported, depends on patches from maxim */ |
449 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ | 449 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ |
450 | sz->min_timeout = STREAMZAP_TIMEOUT * STREAMZAP_RESOLUTION * 1000; | 450 | sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; |
451 | sz->max_timeout = STREAMZAP_TIMEOUT * STREAMZAP_RESOLUTION * 1000; | 451 | sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; |
452 | #endif | 452 | #endif |
453 | 453 | ||
454 | do_gettimeofday(&sz->signal_start); | 454 | do_gettimeofday(&sz->signal_start); |