#include <linux/types.h>
#include <linux/input.h>
+#include <media/ir-core.h>
#include "smscoreapi.h"
#include "smsir.h"
int sms_ir_init(struct smscore_device_t *coredev)
{
struct input_dev *input_dev;
+ int board_id = smscore_get_board_id(coredev);
sms_log("Allocating input device");
input_dev = input_allocate_device();
}
coredev->ir.input_dev = input_dev;
- coredev->ir.ir_kb_type =
- sms_get_board(smscore_get_board_id(coredev))->ir_kb_type;
+ coredev->ir.ir_kb_type = sms_get_board(board_id)->ir_kb_type;
coredev->ir.keyboard_layout_map =
keyboard_layout_maps[coredev->ir.ir_kb_type].
keyboard_layout_map;
coredev->ir.controller, coredev->ir.timeout);
snprintf(coredev->ir.name,
- IR_DEV_NAME_MAX_LEN,
- "SMS IR w/kbd type %d",
- coredev->ir.ir_kb_type);
+ sizeof(coredev->ir.name),
+ "SMS IR (%s)",
+ sms_get_board(board_id)->name);
+
+ strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
+ strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys));
+
input_dev->name = coredev->ir.name;
- input_dev->phys = coredev->ir.name;
+ input_dev->phys = coredev->ir.phys;
input_dev->dev.parent = coredev->device;
/* Key press events only */
#include <linux/input.h>
-#define IR_DEV_NAME_MAX_LEN 23 /* "SMS IR kbd type nn\0" */
+#define IR_DEV_NAME_MAX_LEN 40
#define IR_KEYBOARD_LAYOUT_SIZE 64
#define IR_DEFAULT_TIMEOUT 100
struct ir_t {
struct input_dev *input_dev;
enum ir_kb_type ir_kb_type;
- char name[IR_DEV_NAME_MAX_LEN+1];
+ char name[IR_DEV_NAME_MAX_LEN + 1];
+ char phys[32];
u16 *keyboard_layout_map;
u32 timeout;
u32 controller;
params.num_buffers = MAX_BUFFERS;
params.sendrequest_handler = smsusb_sendrequest;
params.context = dev;
- snprintf(params.devpath, sizeof(params.devpath),
- "usb\\%d-%s", dev->udev->bus->busnum, dev->udev->devpath);
+ usb_make_path(dev->udev, params.devpath, sizeof(params.devpath));
/* register in smscore */
rc = smscore_register_device(¶ms, &dev->coredev);