diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 5 | ||||
-rw-r--r-- | include/linux/gpio_mouse.h | 61 | ||||
-rw-r--r-- | include/linux/input.h | 20 | ||||
-rw-r--r-- | include/linux/ioprio.h | 6 | ||||
-rw-r--r-- | include/linux/usb.h | 16 |
5 files changed, 91 insertions, 17 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index db5b00a792f5..fae138bd2207 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -868,11 +868,6 @@ void kblockd_flush_work(struct work_struct *work); | |||
868 | */ | 868 | */ |
869 | #define buffer_heads_over_limit 0 | 869 | #define buffer_heads_over_limit 0 |
870 | 870 | ||
871 | static inline long blk_congestion_wait(int rw, long timeout) | ||
872 | { | ||
873 | return io_schedule_timeout(timeout); | ||
874 | } | ||
875 | |||
876 | static inline long nr_blockdev_pages(void) | 871 | static inline long nr_blockdev_pages(void) |
877 | { | 872 | { |
878 | return 0; | 873 | return 0; |
diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h new file mode 100644 index 000000000000..44ed7aa14d85 --- /dev/null +++ b/include/linux/gpio_mouse.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Driver for simulating a mouse on GPIO lines. | ||
3 | * | ||
4 | * Copyright (C) 2007 Atmel Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef _GPIO_MOUSE_H | ||
12 | #define _GPIO_MOUSE_H | ||
13 | |||
14 | #define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00 | ||
15 | #define GPIO_MOUSE_POLARITY_ACT_LOW 0x01 | ||
16 | |||
17 | #define GPIO_MOUSE_PIN_UP 0 | ||
18 | #define GPIO_MOUSE_PIN_DOWN 1 | ||
19 | #define GPIO_MOUSE_PIN_LEFT 2 | ||
20 | #define GPIO_MOUSE_PIN_RIGHT 3 | ||
21 | #define GPIO_MOUSE_PIN_BLEFT 4 | ||
22 | #define GPIO_MOUSE_PIN_BMIDDLE 5 | ||
23 | #define GPIO_MOUSE_PIN_BRIGHT 6 | ||
24 | #define GPIO_MOUSE_PIN_MAX 7 | ||
25 | |||
26 | /** | ||
27 | * struct gpio_mouse_platform_data | ||
28 | * @scan_ms: integer in ms specifying the scan periode. | ||
29 | * @polarity: Pin polarity, active high or low. | ||
30 | * @up: GPIO line for up value. | ||
31 | * @down: GPIO line for down value. | ||
32 | * @left: GPIO line for left value. | ||
33 | * @right: GPIO line for right value. | ||
34 | * @bleft: GPIO line for left button. | ||
35 | * @bmiddle: GPIO line for middle button. | ||
36 | * @bright: GPIO line for right button. | ||
37 | * | ||
38 | * This struct must be added to the platform_device in the board code. | ||
39 | * It is used by the gpio_mouse driver to setup GPIO lines and to | ||
40 | * calculate mouse movement. | ||
41 | */ | ||
42 | struct gpio_mouse_platform_data { | ||
43 | int scan_ms; | ||
44 | int polarity; | ||
45 | |||
46 | union { | ||
47 | struct { | ||
48 | int up; | ||
49 | int down; | ||
50 | int left; | ||
51 | int right; | ||
52 | |||
53 | int bleft; | ||
54 | int bmiddle; | ||
55 | int bright; | ||
56 | }; | ||
57 | int pins[GPIO_MOUSE_PIN_MAX]; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | #endif /* _GPIO_MOUSE_H */ | ||
diff --git a/include/linux/input.h b/include/linux/input.h index d8521c72f69f..18c98b543030 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -981,15 +981,15 @@ struct input_dev { | |||
981 | struct mutex mutex; /* serializes open and close operations */ | 981 | struct mutex mutex; /* serializes open and close operations */ |
982 | unsigned int users; | 982 | unsigned int users; |
983 | 983 | ||
984 | struct class_device cdev; | 984 | struct device dev; |
985 | union { /* temporarily so while we switching to struct device */ | 985 | union { /* temporarily so while we switching to struct device */ |
986 | struct device *parent; | 986 | struct device *dev; |
987 | } dev; | 987 | } cdev; |
988 | 988 | ||
989 | struct list_head h_list; | 989 | struct list_head h_list; |
990 | struct list_head node; | 990 | struct list_head node; |
991 | }; | 991 | }; |
992 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | 992 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
993 | 993 | ||
994 | /* | 994 | /* |
995 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines | 995 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines |
@@ -1096,22 +1096,22 @@ struct input_handle { | |||
1096 | struct list_head h_node; | 1096 | struct list_head h_node; |
1097 | }; | 1097 | }; |
1098 | 1098 | ||
1099 | #define to_dev(n) container_of(n,struct input_dev,node) | 1099 | #define to_dev(n) container_of(n, struct input_dev, node) |
1100 | #define to_handler(n) container_of(n,struct input_handler,node) | 1100 | #define to_handler(n) container_of(n, struct input_handler, node) |
1101 | #define to_handle(n) container_of(n,struct input_handle,d_node) | 1101 | #define to_handle(n) container_of(n, struct input_handle, d_node) |
1102 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) | 1102 | #define to_handle_h(n) container_of(n, struct input_handle, h_node) |
1103 | 1103 | ||
1104 | struct input_dev *input_allocate_device(void); | 1104 | struct input_dev *input_allocate_device(void); |
1105 | void input_free_device(struct input_dev *dev); | 1105 | void input_free_device(struct input_dev *dev); |
1106 | 1106 | ||
1107 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1107 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
1108 | { | 1108 | { |
1109 | return to_input_dev(class_device_get(&dev->cdev)); | 1109 | return to_input_dev(get_device(&dev->dev)); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | static inline void input_put_device(struct input_dev *dev) | 1112 | static inline void input_put_device(struct input_dev *dev) |
1113 | { | 1113 | { |
1114 | class_device_put(&dev->cdev); | 1114 | put_device(&dev->dev); |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | static inline void *input_get_drvdata(struct input_dev *dev) | 1117 | static inline void *input_get_drvdata(struct input_dev *dev) |
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 8e2042b9d471..2eaa142cd061 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
@@ -47,8 +47,10 @@ enum { | |||
47 | #define IOPRIO_NORM (4) | 47 | #define IOPRIO_NORM (4) |
48 | static inline int task_ioprio(struct task_struct *task) | 48 | static inline int task_ioprio(struct task_struct *task) |
49 | { | 49 | { |
50 | WARN_ON(!ioprio_valid(task->ioprio)); | 50 | if (ioprio_valid(task->ioprio)) |
51 | return IOPRIO_PRIO_DATA(task->ioprio); | 51 | return IOPRIO_PRIO_DATA(task->ioprio); |
52 | |||
53 | return IOPRIO_NORM; | ||
52 | } | 54 | } |
53 | 55 | ||
54 | static inline int task_nice_ioprio(struct task_struct *task) | 56 | static inline int task_nice_ioprio(struct task_struct *task) |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 94bd38a6d947..56aa2ee21f1b 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -729,6 +729,22 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | 729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) |
730 | 730 | ||
731 | /** | 731 | /** |
732 | * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb | ||
733 | * device with a specific interface protocol | ||
734 | * @vend: the 16 bit USB Vendor ID | ||
735 | * @prod: the 16 bit USB Product ID | ||
736 | * @pr: bInterfaceProtocol value | ||
737 | * | ||
738 | * This macro is used to create a struct usb_device_id that matches a | ||
739 | * specific interface protocol of devices. | ||
740 | */ | ||
741 | #define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \ | ||
742 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ | ||
743 | .idVendor = (vend), \ | ||
744 | .idProduct = (prod), \ | ||
745 | .bInterfaceProtocol = (pr) | ||
746 | |||
747 | /** | ||
732 | * USB_DEVICE_INFO - macro used to describe a class of usb devices | 748 | * USB_DEVICE_INFO - macro used to describe a class of usb devices |
733 | * @cl: bDeviceClass value | 749 | * @cl: bDeviceClass value |
734 | * @sc: bDeviceSubClass value | 750 | * @sc: bDeviceSubClass value |