diff options
Diffstat (limited to 'drivers/media/rc/ttusbir.c')
-rw-r--r-- | drivers/media/rc/ttusbir.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index 71f03acabac8..1aee57fd2f32 100644 --- a/drivers/media/rc/ttusbir.c +++ b/drivers/media/rc/ttusbir.c | |||
@@ -121,8 +121,9 @@ static void ttusbir_bulk_complete(struct urb *urb) | |||
121 | */ | 121 | */ |
122 | static void ttusbir_process_ir_data(struct ttusbir *tt, uint8_t *buf) | 122 | static void ttusbir_process_ir_data(struct ttusbir *tt, uint8_t *buf) |
123 | { | 123 | { |
124 | struct ir_raw_event rawir; | ||
124 | unsigned i, v, b; | 125 | unsigned i, v, b; |
125 | DEFINE_IR_RAW_EVENT(rawir); | 126 | bool event = false; |
126 | 127 | ||
127 | init_ir_raw_event(&rawir); | 128 | init_ir_raw_event(&rawir); |
128 | 129 | ||
@@ -132,12 +133,14 @@ static void ttusbir_process_ir_data(struct ttusbir *tt, uint8_t *buf) | |||
132 | case 0xfe: | 133 | case 0xfe: |
133 | rawir.pulse = false; | 134 | rawir.pulse = false; |
134 | rawir.duration = NS_PER_BYTE; | 135 | rawir.duration = NS_PER_BYTE; |
135 | ir_raw_event_store_with_filter(tt->rc, &rawir); | 136 | if (ir_raw_event_store_with_filter(tt->rc, &rawir)) |
137 | event = true; | ||
136 | break; | 138 | break; |
137 | case 0: | 139 | case 0: |
138 | rawir.pulse = true; | 140 | rawir.pulse = true; |
139 | rawir.duration = NS_PER_BYTE; | 141 | rawir.duration = NS_PER_BYTE; |
140 | ir_raw_event_store_with_filter(tt->rc, &rawir); | 142 | if (ir_raw_event_store_with_filter(tt->rc, &rawir)) |
143 | event = true; | ||
141 | break; | 144 | break; |
142 | default: | 145 | default: |
143 | /* one edge per byte */ | 146 | /* one edge per byte */ |
@@ -150,16 +153,20 @@ static void ttusbir_process_ir_data(struct ttusbir *tt, uint8_t *buf) | |||
150 | } | 153 | } |
151 | 154 | ||
152 | rawir.duration = NS_PER_BIT * (8 - b); | 155 | rawir.duration = NS_PER_BIT * (8 - b); |
153 | ir_raw_event_store_with_filter(tt->rc, &rawir); | 156 | if (ir_raw_event_store_with_filter(tt->rc, &rawir)) |
157 | event = true; | ||
154 | 158 | ||
155 | rawir.pulse = !rawir.pulse; | 159 | rawir.pulse = !rawir.pulse; |
156 | rawir.duration = NS_PER_BIT * b; | 160 | rawir.duration = NS_PER_BIT * b; |
157 | ir_raw_event_store_with_filter(tt->rc, &rawir); | 161 | if (ir_raw_event_store_with_filter(tt->rc, &rawir)) |
162 | event = true; | ||
158 | break; | 163 | break; |
159 | } | 164 | } |
160 | } | 165 | } |
161 | 166 | ||
162 | ir_raw_event_handle(tt->rc); | 167 | /* don't wakeup when there's nothing to do */ |
168 | if (event) | ||
169 | ir_raw_event_handle(tt->rc); | ||
163 | } | 170 | } |
164 | 171 | ||
165 | static void ttusbir_urb_complete(struct urb *urb) | 172 | static void ttusbir_urb_complete(struct urb *urb) |