Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114422
b: refs/heads/master
c: c500c97
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Jiri Kosina committed Oct 14, 2008
1 parent 1d8a9f8 commit 244db25
Show file tree
Hide file tree
Showing 8 changed files with 439 additions and 240 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85cdaf524b7ddab627e7d15405693f2511ef7505
refs/heads/master: c500c9714011edab021591340042787722db9cf0
24 changes: 17 additions & 7 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
hid_parser_reserved
};

if (device->driver->report_fixup)
device->driver->report_fixup(device, start, size);

device->rdesc = kmalloc(size, GFP_KERNEL);
if (device->rdesc == NULL)
return -ENOMEM;
Expand Down Expand Up @@ -1152,15 +1155,20 @@ static int hid_device_probe(struct device *dev)
int ret = 0;

if (!hdev->driver) {
if (hdrv->probe) {
ret = -ENODEV;
id = hid_match_id(hdev, hdrv->id_table);
if (id == NULL)
return -ENODEV;

id = hid_match_id(hdev, hdrv->id_table);
if (id)
ret = hdrv->probe(hdev, id);
hdev->driver = hdrv;
if (hdrv->probe) {
ret = hdrv->probe(hdev, id);
} else { /* default probe */
ret = hid_parse(hdev);
if (!ret)
ret = hid_hw_start(hdev);
}
if (!ret)
hdev->driver = hdrv;
if (ret)
hdev->driver = NULL;
}
return ret;
}
Expand All @@ -1173,6 +1181,8 @@ static int hid_device_remove(struct device *dev)
if (hdrv) {
if (hdrv->remove)
hdrv->remove(hdev);
else /* default remove */
hid_hw_stop(hdev);
hdev->driver = NULL;
}

Expand Down
20 changes: 17 additions & 3 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
if (ret)
goto mapped;

if (device->driver->input_mapping) {
int ret = device->driver->input_mapping(device, hidinput, field,
usage, &bit, &max);
if (ret > 0)
goto mapped;
if (ret < 0)
goto ignore;
}

switch (usage->hid & HID_USAGE_PAGE) {

case HID_UP_UNDEFINED:
Expand Down Expand Up @@ -755,6 +764,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
}

mapped:
if (device->driver->input_mapped && device->driver->input_mapped(device,
hidinput, field, usage, &bit, &max) < 0)
goto ignore;

if (device->quirks & HID_QUIRK_MIGHTYMOUSE) {
if (usage->hid == HID_GD_Z)
map_rel(REL_HWHEEL);
Expand Down Expand Up @@ -961,14 +974,14 @@ static int hidinput_open(struct input_dev *dev)
{
struct hid_device *hid = input_get_drvdata(dev);

return hid->hid_open(hid);
return hid->ll_driver->open(hid);
}

static void hidinput_close(struct input_dev *dev)
{
struct hid_device *hid = input_get_drvdata(dev);

hid->hid_close(hid);
hid->ll_driver->close(hid);
}

/*
Expand Down Expand Up @@ -1019,7 +1032,8 @@ int hidinput_connect(struct hid_device *hid)
}

input_set_drvdata(input_dev, hid);
input_dev->event = hid->hidinput_input_event;
input_dev->event =
hid->ll_driver->hidinput_input_event;
input_dev->open = hidinput_open;
input_dev->close = hidinput_close;
input_dev->setkeycode = hidinput_setkeycode;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static int hidraw_open(struct inode *inode, struct file *file)

dev = hidraw_table[minor];
if (!dev->open++)
dev->hid->hid_open(dev->hid);
dev->hid->ll_driver->open(dev->hid);

out_unlock:
spin_unlock(&minors_lock);
Expand All @@ -207,7 +207,7 @@ static int hidraw_release(struct inode * inode, struct file * file)
dev = hidraw_table[minor];
if (!dev->open--) {
if (list->hidraw->exist)
dev->hid->hid_close(dev->hid);
dev->hid->ll_driver->close(dev->hid);
else
kfree(list->hidraw);
}
Expand Down Expand Up @@ -367,7 +367,7 @@ void hidraw_disconnect(struct hid_device *hid)
device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));

if (hidraw->open) {
hid->hid_close(hid);
hid->ll_driver->close(hid);
wake_up_interruptible(&hidraw->wait);
} else {
kfree(hidraw);
Expand Down
Loading

0 comments on commit 244db25

Please sign in to comment.