Re: HID device question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



*sigh*  It SEEMS to simple.  What's wrong with this?

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/usb.h>

#define USB_VENDOR_ID_MY	0x2495
#define USB_DEVICE_ID_MY	0x0002

static void my_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int rsize)
{
	printk("my_report_fixup called\n");
}

static int my_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
	printk("my_probe called\n");
	return 0;
}

static void my_remove(struct hid_device *hdev)
{
	printk("my_remove called\n");
}

static const struct hid_device_id my_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_MY, USB_DEVICE_ID_MY) },
	{}
};

MODULE_DEVICE_TABLE(hid, my_devices);

static struct hid_driver my_driver = {
	.name = "my",
	.id_table = my_devices,
	.probe = my_probe,
	.remove = my_remove,
	.report_fixup = my_report_fixup,
};

static int __init my_init(void)
{
	printk("my_init called\n");
	return hid_register_driver(&my_driver);
}

static void __exit my_exit(void)
{
	printk("my_exit called\n");
	hid_unregister_driver(&my_driver);
}

module_init(my_init);
module_exit(my_exit);
MODULE_LICENSE("GPL");

I insmod the driver, and I get "my_init called". Then, I insert the device, and it gets assigned to usbhid.
This is on a PC, so I don't THINK it's an endianess problem.

Any ideas?

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux