diff options
author | Uri Shkolnik <uris@siano-ms.com> | 2009-05-14 15:32:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 18:14:31 -0400 |
commit | 90f944a38c4eb8432b6381fd0b9789f1f4600786 (patch) | |
tree | 24ddd7d72a517b4e71f58b00980142db949968c1 /drivers | |
parent | 3b2d18efd16d444ffd1ec50547ee6f1d66e3b57b (diff) |
V4L/DVB (11815): Siano: bind infra-red component
Add the infra-red to the makefile and declare
the assignment in the cards components.
[mchehab@redhat.com: Fixed a few trivial merge conflicts]
Signed-off-by: Uri Shkolnik <uris@siano-ms.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/siano/Makefile | 2 | ||||
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/siano/sms-cards.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smscoreapi.h | 3 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsir.c | 24 |
5 files changed, 20 insertions, 14 deletions
diff --git a/drivers/media/dvb/siano/Makefile b/drivers/media/dvb/siano/Makefile index 6354a4718e5d..c6644d909433 100644 --- a/drivers/media/dvb/siano/Makefile +++ b/drivers/media/dvb/siano/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | sms1xxx-objs := smscoreapi.o sms-cards.o smsendian.o | 1 | sms1xxx-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o |
2 | 2 | ||
3 | obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o | 3 | obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o |
4 | obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o | 4 | obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o |
diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index 63e4d0ec6583..c35ff1f3f378 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "sms-cards.h" | 20 | #include "sms-cards.h" |
21 | #include "smsir.h" | ||
21 | 22 | ||
22 | static int sms_dbg; | 23 | static int sms_dbg; |
23 | module_param_named(cards_dbg, sms_dbg, int, 0644); | 24 | module_param_named(cards_dbg, sms_dbg, int, 0644); |
diff --git a/drivers/media/dvb/siano/sms-cards.h b/drivers/media/dvb/siano/sms-cards.h index 5bd4fb4d3a42..447481ab58be 100644 --- a/drivers/media/dvb/siano/sms-cards.h +++ b/drivers/media/dvb/siano/sms-cards.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
24 | #include "smscoreapi.h" | 24 | #include "smscoreapi.h" |
25 | #include "smsir.h" | ||
25 | 26 | ||
26 | #define SMS_BOARD_UNKNOWN 0 | 27 | #define SMS_BOARD_UNKNOWN 0 |
27 | #define SMS1XXX_BOARD_SIANO_STELLAR 1 | 28 | #define SMS1XXX_BOARD_SIANO_STELLAR 1 |
@@ -72,6 +73,7 @@ struct sms_board { | |||
72 | enum sms_device_type_st type; | 73 | enum sms_device_type_st type; |
73 | char *name, *fw[DEVICE_MODE_MAX]; | 74 | char *name, *fw[DEVICE_MODE_MAX]; |
74 | struct sms_board_gpio_cfg board_cfg; | 75 | struct sms_board_gpio_cfg board_cfg; |
76 | enum ir_kb_type ir_kb_type; | ||
75 | 77 | ||
76 | /* gpios */ | 78 | /* gpios */ |
77 | int led_power, led_hi, led_lo, lna_ctrl, rf_switch; | 79 | int led_power, led_hi, led_lo, lna_ctrl, rf_switch; |
@@ -79,6 +81,8 @@ struct sms_board { | |||
79 | 81 | ||
80 | struct sms_board *sms_get_board(int id); | 82 | struct sms_board *sms_get_board(int id); |
81 | 83 | ||
84 | extern struct smscore_device_t *coredev; | ||
85 | |||
82 | int sms_board_setup(struct smscore_device_t *coredev); | 86 | int sms_board_setup(struct smscore_device_t *coredev); |
83 | 87 | ||
84 | #define SMS_LED_OFF 0 | 88 | #define SMS_LED_OFF 0 |
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h index 942baaec897e..6e23c5f68088 100644 --- a/drivers/media/dvb/siano/smscoreapi.h +++ b/drivers/media/dvb/siano/smscoreapi.h | |||
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
34 | 34 | ||
35 | #include <asm/page.h> | 35 | #include <asm/page.h> |
36 | 36 | ||
37 | #include "smsir.h" | ||
37 | 38 | ||
38 | #define kmutex_init(_p_) mutex_init(_p_) | 39 | #define kmutex_init(_p_) mutex_init(_p_) |
39 | #define kmutex_lock(_p_) mutex_lock(_p_) | 40 | #define kmutex_lock(_p_) mutex_lock(_p_) |
@@ -167,7 +168,7 @@ struct smscore_device_t { | |||
167 | u32 fw_buf_size; | 168 | u32 fw_buf_size; |
168 | 169 | ||
169 | /* Infrared (IR) */ | 170 | /* Infrared (IR) */ |
170 | /* struct ir_t ir; */ | 171 | struct ir_t ir; |
171 | 172 | ||
172 | int led_state; | 173 | int led_state; |
173 | }; | 174 | }; |
diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c index a5f302c58fdb..e3d776feeaca 100644 --- a/drivers/media/dvb/siano/smsir.c +++ b/drivers/media/dvb/siano/smsir.c | |||
@@ -99,7 +99,7 @@ static void sms_ir_rc5_event(struct smscore_device_t *coredev, | |||
99 | bool toggle_changed; | 99 | bool toggle_changed; |
100 | u16 keycode; | 100 | u16 keycode; |
101 | 101 | ||
102 | sms_info("IR RC5 word: address %d, command %d, toggle %d", | 102 | sms_log("IR RC5 word: address %d, command %d, toggle %d", |
103 | addr, cmd, toggle); | 103 | addr, cmd, toggle); |
104 | 104 | ||
105 | toggle_changed = ir_toggle != toggle; | 105 | toggle_changed = ir_toggle != toggle; |
@@ -118,7 +118,7 @@ static void sms_ir_rc5_event(struct smscore_device_t *coredev, | |||
118 | (keycode != KEY_VOLUMEUP && keycode != KEY_VOLUMEDOWN)) | 118 | (keycode != KEY_VOLUMEUP && keycode != KEY_VOLUMEDOWN)) |
119 | return; /* accept only repeated volume, reject other keys */ | 119 | return; /* accept only repeated volume, reject other keys */ |
120 | 120 | ||
121 | sms_info("kernel input keycode (from ir) %d", keycode); | 121 | sms_log("kernel input keycode (from ir) %d", keycode); |
122 | input_report_key(coredev->ir.input_dev, keycode, 1); | 122 | input_report_key(coredev->ir.input_dev, keycode, 1); |
123 | input_sync(coredev->ir.input_dev); | 123 | input_sync(coredev->ir.input_dev); |
124 | 124 | ||
@@ -147,7 +147,7 @@ static u32 ir_rc5_decode(unsigned int code) | |||
147 | break; | 147 | break; |
148 | case 3: | 148 | case 3: |
149 | /* dprintk(1, "ir-common: ir_rc5_decode(%x) bad code\n", org_code);*/ | 149 | /* dprintk(1, "ir-common: ir_rc5_decode(%x) bad code\n", org_code);*/ |
150 | sms_info("bad code"); | 150 | sms_log("bad code"); |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | } | 153 | } |
@@ -175,7 +175,7 @@ static void sms_rc5_parse_word(struct smscore_device_t *coredev) | |||
175 | RC5_PUSH_BIT(rc5_word, (ir_word>>i)&1, j) | 175 | RC5_PUSH_BIT(rc5_word, (ir_word>>i)&1, j) |
176 | 176 | ||
177 | rc5_word = ir_rc5_decode(rc5_word); | 177 | rc5_word = ir_rc5_decode(rc5_word); |
178 | /* sms_info("temp = 0x%x, rc5_code = 0x%x", ir_word, rc5_word); */ | 178 | /* sms_log("temp = 0x%x, rc5_code = 0x%x", ir_word, rc5_word); */ |
179 | 179 | ||
180 | sms_ir_rc5_event(coredev, | 180 | sms_ir_rc5_event(coredev, |
181 | RC5_TOGGLE(rc5_word), | 181 | RC5_TOGGLE(rc5_word), |
@@ -210,11 +210,11 @@ static void sms_rc5_accumulate_bits(struct smscore_device_t *coredev, | |||
210 | if (ir_pos == RC5_WORD_LEN) | 210 | if (ir_pos == RC5_WORD_LEN) |
211 | sms_rc5_parse_word(coredev); | 211 | sms_rc5_parse_word(coredev); |
212 | else if (ir_pos) /* timeout within a word */ | 212 | else if (ir_pos) /* timeout within a word */ |
213 | sms_info("IR error parsing a word"); | 213 | sms_log("IR error parsing a word"); |
214 | 214 | ||
215 | ir_pos = 0; | 215 | ir_pos = 0; |
216 | ir_word = 0; | 216 | ir_word = 0; |
217 | /* sms_info("timeout %d", time); */ | 217 | /* sms_log("timeout %d", time); */ |
218 | break; | 218 | break; |
219 | } | 219 | } |
220 | /* The time is within the range of this number of bits */ | 220 | /* The time is within the range of this number of bits */ |
@@ -236,7 +236,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len) | |||
236 | int count = len>>2; | 236 | int count = len>>2; |
237 | 237 | ||
238 | samples = (s32 *)buf; | 238 | samples = (s32 *)buf; |
239 | /* sms_info("IR buffer received, length = %d", count);*/ | 239 | /* sms_log("IR buffer received, length = %d", count);*/ |
240 | 240 | ||
241 | for (i = 0; i < count; i++) | 241 | for (i = 0; i < count; i++) |
242 | if (ir_protocol == IR_RC5) | 242 | if (ir_protocol == IR_RC5) |
@@ -248,7 +248,7 @@ int sms_ir_init(struct smscore_device_t *coredev) | |||
248 | { | 248 | { |
249 | struct input_dev *input_dev; | 249 | struct input_dev *input_dev; |
250 | 250 | ||
251 | sms_info("Allocating input device"); | 251 | sms_log("Allocating input device"); |
252 | input_dev = input_allocate_device(); | 252 | input_dev = input_allocate_device(); |
253 | if (!input_dev) { | 253 | if (!input_dev) { |
254 | sms_err("Not enough memory"); | 254 | sms_err("Not enough memory"); |
@@ -261,11 +261,11 @@ int sms_ir_init(struct smscore_device_t *coredev) | |||
261 | coredev->ir.keyboard_layout_map = | 261 | coredev->ir.keyboard_layout_map = |
262 | keyboard_layout_maps[coredev->ir.ir_kb_type]. | 262 | keyboard_layout_maps[coredev->ir.ir_kb_type]. |
263 | keyboard_layout_map; | 263 | keyboard_layout_map; |
264 | sms_info("IR remote keyboard type is %d", coredev->ir.ir_kb_type); | 264 | sms_log("IR remote keyboard type is %d", coredev->ir.ir_kb_type); |
265 | 265 | ||
266 | coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ | 266 | coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ |
267 | coredev->ir.timeout = IR_DEFAULT_TIMEOUT; | 267 | coredev->ir.timeout = IR_DEFAULT_TIMEOUT; |
268 | sms_info("IR port %d, timeout %d ms", | 268 | sms_log("IR port %d, timeout %d ms", |
269 | coredev->ir.controller, coredev->ir.timeout); | 269 | coredev->ir.controller, coredev->ir.timeout); |
270 | 270 | ||
271 | snprintf(coredev->ir.name, | 271 | snprintf(coredev->ir.name, |
@@ -280,7 +280,7 @@ int sms_ir_init(struct smscore_device_t *coredev) | |||
280 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | 280 | input_dev->evbit[0] = BIT_MASK(EV_KEY); |
281 | input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); | 281 | input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); |
282 | 282 | ||
283 | sms_info("Input device (IR) %s is set for key events", input_dev->name); | 283 | sms_log("Input device (IR) %s is set for key events", input_dev->name); |
284 | 284 | ||
285 | if (input_register_device(input_dev)) { | 285 | if (input_register_device(input_dev)) { |
286 | sms_err("Failed to register device"); | 286 | sms_err("Failed to register device"); |
@@ -296,6 +296,6 @@ void sms_ir_exit(struct smscore_device_t *coredev) | |||
296 | if (coredev->ir.input_dev) | 296 | if (coredev->ir.input_dev) |
297 | input_unregister_device(coredev->ir.input_dev); | 297 | input_unregister_device(coredev->ir.input_dev); |
298 | 298 | ||
299 | sms_info(""); | 299 | sms_log(""); |
300 | } | 300 | } |
301 | 301 | ||