diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-core.h | 8 | ||||
-rw-r--r-- | include/media/ir-kbd-i2c.h | 2 | ||||
-rw-r--r-- | include/media/lirc.h | 165 | ||||
-rw-r--r-- | include/media/lirc_dev.h | 225 | ||||
-rw-r--r-- | include/media/rc-map.h | 10 | ||||
-rw-r--r-- | include/media/sh_mobile_ceu.h | 3 | ||||
-rw-r--r-- | include/media/sh_mobile_csi2.h | 46 | ||||
-rw-r--r-- | include/media/soc_camera.h | 3 | ||||
-rw-r--r-- | include/media/v4l2-mediabus.h | 13 | ||||
-rw-r--r-- | include/media/videobuf-core.h | 6 | ||||
-rw-r--r-- | include/media/videobuf-dma-sg.h | 39 | ||||
-rw-r--r-- | include/media/videobuf-vmalloc.h | 2 |
12 files changed, 485 insertions, 37 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index ad1303f20e0..513e60dd101 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -47,15 +47,21 @@ enum rc_driver_type { | |||
47 | * is opened. | 47 | * is opened. |
48 | * @close: callback to allow drivers to disable polling/irq when IR input device | 48 | * @close: callback to allow drivers to disable polling/irq when IR input device |
49 | * is opened. | 49 | * is opened. |
50 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
51 | * @s_tx_carrier: set transmit carrier frequency | ||
52 | * @tx_ir: transmit IR | ||
50 | */ | 53 | */ |
51 | struct ir_dev_props { | 54 | struct ir_dev_props { |
52 | enum rc_driver_type driver_type; | 55 | enum rc_driver_type driver_type; |
53 | unsigned long allowed_protos; | 56 | unsigned long allowed_protos; |
54 | u32 scanmask; | 57 | u32 scanmask; |
55 | void *priv; | 58 | void *priv; |
56 | int (*change_protocol)(void *priv, u64 ir_type); | 59 | int (*change_protocol)(void *priv, u64 ir_type); |
57 | int (*open)(void *priv); | 60 | int (*open)(void *priv); |
58 | void (*close)(void *priv); | 61 | void (*close)(void *priv); |
62 | int (*s_tx_mask)(void *priv, u32 mask); | ||
63 | int (*s_tx_carrier)(void *priv, u32 carrier); | ||
64 | int (*tx_ir)(void *priv, int *txbuf, u32 n); | ||
59 | }; | 65 | }; |
60 | 66 | ||
61 | struct ir_input_dev { | 67 | struct ir_input_dev { |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 0506e45c9a4..5e96d7a430b 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -11,7 +11,7 @@ struct IR_i2c { | |||
11 | struct i2c_client *c; | 11 | struct i2c_client *c; |
12 | struct input_dev *input; | 12 | struct input_dev *input; |
13 | struct ir_input_state ir; | 13 | struct ir_input_state ir; |
14 | 14 | u64 ir_type; | |
15 | /* Used to avoid fast repeating */ | 15 | /* Used to avoid fast repeating */ |
16 | unsigned char old; | 16 | unsigned char old; |
17 | 17 | ||
diff --git a/include/media/lirc.h b/include/media/lirc.h new file mode 100644 index 00000000000..42c467c5051 --- /dev/null +++ b/include/media/lirc.h | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * lirc.h - linux infrared remote control header file | ||
3 | * last modified 2010/07/13 by Jarod Wilson | ||
4 | */ | ||
5 | |||
6 | #ifndef _LINUX_LIRC_H | ||
7 | #define _LINUX_LIRC_H | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | #include <linux/ioctl.h> | ||
11 | |||
12 | #define PULSE_BIT 0x01000000 | ||
13 | #define PULSE_MASK 0x00FFFFFF | ||
14 | |||
15 | #define LIRC_MODE2_SPACE 0x00000000 | ||
16 | #define LIRC_MODE2_PULSE 0x01000000 | ||
17 | #define LIRC_MODE2_FREQUENCY 0x02000000 | ||
18 | #define LIRC_MODE2_TIMEOUT 0x03000000 | ||
19 | |||
20 | #define LIRC_VALUE_MASK 0x00FFFFFF | ||
21 | #define LIRC_MODE2_MASK 0xFF000000 | ||
22 | |||
23 | #define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE) | ||
24 | #define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE) | ||
25 | #define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY) | ||
26 | #define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) | ||
27 | |||
28 | #define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK) | ||
29 | #define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK) | ||
30 | |||
31 | #define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE) | ||
32 | #define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE) | ||
33 | #define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY) | ||
34 | #define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) | ||
35 | |||
36 | /* used heavily by lirc userspace */ | ||
37 | #define lirc_t int | ||
38 | |||
39 | /*** lirc compatible hardware features ***/ | ||
40 | |||
41 | #define LIRC_MODE2SEND(x) (x) | ||
42 | #define LIRC_SEND2MODE(x) (x) | ||
43 | #define LIRC_MODE2REC(x) ((x) << 16) | ||
44 | #define LIRC_REC2MODE(x) ((x) >> 16) | ||
45 | |||
46 | #define LIRC_MODE_RAW 0x00000001 | ||
47 | #define LIRC_MODE_PULSE 0x00000002 | ||
48 | #define LIRC_MODE_MODE2 0x00000004 | ||
49 | #define LIRC_MODE_LIRCCODE 0x00000010 | ||
50 | |||
51 | |||
52 | #define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW) | ||
53 | #define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE) | ||
54 | #define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2) | ||
55 | #define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE) | ||
56 | |||
57 | #define LIRC_CAN_SEND_MASK 0x0000003f | ||
58 | |||
59 | #define LIRC_CAN_SET_SEND_CARRIER 0x00000100 | ||
60 | #define LIRC_CAN_SET_SEND_DUTY_CYCLE 0x00000200 | ||
61 | #define LIRC_CAN_SET_TRANSMITTER_MASK 0x00000400 | ||
62 | |||
63 | #define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW) | ||
64 | #define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE) | ||
65 | #define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2) | ||
66 | #define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE) | ||
67 | |||
68 | #define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK) | ||
69 | |||
70 | #define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16) | ||
71 | #define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16) | ||
72 | |||
73 | #define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000 | ||
74 | #define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000 | ||
75 | #define LIRC_CAN_GET_REC_RESOLUTION 0x20000000 | ||
76 | #define LIRC_CAN_SET_REC_TIMEOUT 0x10000000 | ||
77 | #define LIRC_CAN_SET_REC_FILTER 0x08000000 | ||
78 | |||
79 | #define LIRC_CAN_MEASURE_CARRIER 0x02000000 | ||
80 | |||
81 | #define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK) | ||
82 | #define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK) | ||
83 | |||
84 | #define LIRC_CAN_NOTIFY_DECODE 0x01000000 | ||
85 | |||
86 | /*** IOCTL commands for lirc driver ***/ | ||
87 | |||
88 | #define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32) | ||
89 | |||
90 | #define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32) | ||
91 | #define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32) | ||
92 | #define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32) | ||
93 | #define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32) | ||
94 | #define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32) | ||
95 | #define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32) | ||
96 | #define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32) | ||
97 | |||
98 | #define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32) | ||
99 | #define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32) | ||
100 | |||
101 | #define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32) | ||
102 | #define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32) | ||
103 | #define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32) | ||
104 | #define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32) | ||
105 | |||
106 | /* code length in bits, currently only for LIRC_MODE_LIRCCODE */ | ||
107 | #define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32) | ||
108 | |||
109 | #define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32) | ||
110 | #define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32) | ||
111 | /* Note: these can reset the according pulse_width */ | ||
112 | #define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32) | ||
113 | #define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32) | ||
114 | #define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32) | ||
115 | #define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32) | ||
116 | #define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32) | ||
117 | |||
118 | /* | ||
119 | * when a timeout != 0 is set the driver will send a | ||
120 | * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is | ||
121 | * never sent, timeout is disabled by default | ||
122 | */ | ||
123 | #define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32) | ||
124 | |||
125 | /* 1 enables, 0 disables timeout reports in MODE2 */ | ||
126 | #define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32) | ||
127 | |||
128 | /* | ||
129 | * pulses shorter than this are filtered out by hardware (software | ||
130 | * emulation in lirc_dev?) | ||
131 | */ | ||
132 | #define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32) | ||
133 | /* | ||
134 | * spaces shorter than this are filtered out by hardware (software | ||
135 | * emulation in lirc_dev?) | ||
136 | */ | ||
137 | #define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32) | ||
138 | /* | ||
139 | * if filter cannot be set independantly for pulse/space, this should | ||
140 | * be used | ||
141 | */ | ||
142 | #define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32) | ||
143 | |||
144 | /* | ||
145 | * if enabled from the next key press on the driver will send | ||
146 | * LIRC_MODE2_FREQUENCY packets | ||
147 | */ | ||
148 | #define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32) | ||
149 | |||
150 | /* | ||
151 | * to set a range use | ||
152 | * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the | ||
153 | * lower bound first and later | ||
154 | * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound | ||
155 | */ | ||
156 | |||
157 | #define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32) | ||
158 | #define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32) | ||
159 | |||
160 | #define LIRC_NOTIFY_DECODE _IO('i', 0x00000020) | ||
161 | |||
162 | #define LIRC_SETUP_START _IO('i', 0x00000021) | ||
163 | #define LIRC_SETUP_END _IO('i', 0x00000022) | ||
164 | |||
165 | #endif | ||
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h new file mode 100644 index 00000000000..b1f60663cb3 --- /dev/null +++ b/include/media/lirc_dev.h | |||
@@ -0,0 +1,225 @@ | |||
1 | /* | ||
2 | * LIRC base driver | ||
3 | * | ||
4 | * by Artur Lipowski <alipowski@interia.pl> | ||
5 | * This code is licensed under GNU GPL | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_LIRC_DEV_H | ||
10 | #define _LINUX_LIRC_DEV_H | ||
11 | |||
12 | #define MAX_IRCTL_DEVICES 4 | ||
13 | #define BUFLEN 16 | ||
14 | |||
15 | #define mod(n, div) ((n) % (div)) | ||
16 | |||
17 | #include <linux/slab.h> | ||
18 | #include <linux/fs.h> | ||
19 | #include <linux/ioctl.h> | ||
20 | #include <linux/poll.h> | ||
21 | #include <linux/kfifo.h> | ||
22 | #include <media/lirc.h> | ||
23 | |||
24 | struct lirc_buffer { | ||
25 | wait_queue_head_t wait_poll; | ||
26 | spinlock_t fifo_lock; | ||
27 | unsigned int chunk_size; | ||
28 | unsigned int size; /* in chunks */ | ||
29 | /* Using chunks instead of bytes pretends to simplify boundary checking | ||
30 | * And should allow for some performance fine tunning later */ | ||
31 | struct kfifo fifo; | ||
32 | u8 fifo_initialized; | ||
33 | }; | ||
34 | |||
35 | static inline void lirc_buffer_clear(struct lirc_buffer *buf) | ||
36 | { | ||
37 | unsigned long flags; | ||
38 | |||
39 | if (buf->fifo_initialized) { | ||
40 | spin_lock_irqsave(&buf->fifo_lock, flags); | ||
41 | kfifo_reset(&buf->fifo); | ||
42 | spin_unlock_irqrestore(&buf->fifo_lock, flags); | ||
43 | } else | ||
44 | WARN(1, "calling %s on an uninitialized lirc_buffer\n", | ||
45 | __func__); | ||
46 | } | ||
47 | |||
48 | static inline int lirc_buffer_init(struct lirc_buffer *buf, | ||
49 | unsigned int chunk_size, | ||
50 | unsigned int size) | ||
51 | { | ||
52 | int ret; | ||
53 | |||
54 | init_waitqueue_head(&buf->wait_poll); | ||
55 | spin_lock_init(&buf->fifo_lock); | ||
56 | buf->chunk_size = chunk_size; | ||
57 | buf->size = size; | ||
58 | ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); | ||
59 | if (ret == 0) | ||
60 | buf->fifo_initialized = 1; | ||
61 | |||
62 | return ret; | ||
63 | } | ||
64 | |||
65 | static inline void lirc_buffer_free(struct lirc_buffer *buf) | ||
66 | { | ||
67 | if (buf->fifo_initialized) { | ||
68 | kfifo_free(&buf->fifo); | ||
69 | buf->fifo_initialized = 0; | ||
70 | } else | ||
71 | WARN(1, "calling %s on an uninitialized lirc_buffer\n", | ||
72 | __func__); | ||
73 | } | ||
74 | |||
75 | static inline int lirc_buffer_len(struct lirc_buffer *buf) | ||
76 | { | ||
77 | int len; | ||
78 | unsigned long flags; | ||
79 | |||
80 | spin_lock_irqsave(&buf->fifo_lock, flags); | ||
81 | len = kfifo_len(&buf->fifo); | ||
82 | spin_unlock_irqrestore(&buf->fifo_lock, flags); | ||
83 | |||
84 | return len; | ||
85 | } | ||
86 | |||
87 | static inline int lirc_buffer_full(struct lirc_buffer *buf) | ||
88 | { | ||
89 | return lirc_buffer_len(buf) == buf->size * buf->chunk_size; | ||
90 | } | ||
91 | |||
92 | static inline int lirc_buffer_empty(struct lirc_buffer *buf) | ||
93 | { | ||
94 | return !lirc_buffer_len(buf); | ||
95 | } | ||
96 | |||
97 | static inline int lirc_buffer_available(struct lirc_buffer *buf) | ||
98 | { | ||
99 | return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); | ||
100 | } | ||
101 | |||
102 | static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, | ||
103 | unsigned char *dest) | ||
104 | { | ||
105 | unsigned int ret = 0; | ||
106 | |||
107 | if (lirc_buffer_len(buf) >= buf->chunk_size) | ||
108 | ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, | ||
109 | &buf->fifo_lock); | ||
110 | return ret; | ||
111 | |||
112 | } | ||
113 | |||
114 | static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, | ||
115 | unsigned char *orig) | ||
116 | { | ||
117 | unsigned int ret; | ||
118 | |||
119 | ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, | ||
120 | &buf->fifo_lock); | ||
121 | |||
122 | return ret; | ||
123 | } | ||
124 | |||
125 | struct lirc_driver { | ||
126 | char name[40]; | ||
127 | int minor; | ||
128 | unsigned long code_length; | ||
129 | unsigned int buffer_size; /* in chunks holding one code each */ | ||
130 | int sample_rate; | ||
131 | unsigned long features; | ||
132 | |||
133 | unsigned int chunk_size; | ||
134 | |||
135 | void *data; | ||
136 | int min_timeout; | ||
137 | int max_timeout; | ||
138 | int (*add_to_buf) (void *data, struct lirc_buffer *buf); | ||
139 | struct lirc_buffer *rbuf; | ||
140 | int (*set_use_inc) (void *data); | ||
141 | void (*set_use_dec) (void *data); | ||
142 | struct file_operations *fops; | ||
143 | struct device *dev; | ||
144 | struct module *owner; | ||
145 | }; | ||
146 | |||
147 | /* name: | ||
148 | * this string will be used for logs | ||
149 | * | ||
150 | * minor: | ||
151 | * indicates minor device (/dev/lirc) number for registered driver | ||
152 | * if caller fills it with negative value, then the first free minor | ||
153 | * number will be used (if available) | ||
154 | * | ||
155 | * code_length: | ||
156 | * length of the remote control key code expressed in bits | ||
157 | * | ||
158 | * sample_rate: | ||
159 | * | ||
160 | * data: | ||
161 | * it may point to any driver data and this pointer will be passed to | ||
162 | * all callback functions | ||
163 | * | ||
164 | * add_to_buf: | ||
165 | * add_to_buf will be called after specified period of the time or | ||
166 | * triggered by the external event, this behavior depends on value of | ||
167 | * the sample_rate this function will be called in user context. This | ||
168 | * routine should return 0 if data was added to the buffer and | ||
169 | * -ENODATA if none was available. This should add some number of bits | ||
170 | * evenly divisible by code_length to the buffer | ||
171 | * | ||
172 | * rbuf: | ||
173 | * if not NULL, it will be used as a read buffer, you will have to | ||
174 | * write to the buffer by other means, like irq's (see also | ||
175 | * lirc_serial.c). | ||
176 | * | ||
177 | * set_use_inc: | ||
178 | * set_use_inc will be called after device is opened | ||
179 | * | ||
180 | * set_use_dec: | ||
181 | * set_use_dec will be called after device is closed | ||
182 | * | ||
183 | * fops: | ||
184 | * file_operations for drivers which don't fit the current driver model. | ||
185 | * | ||
186 | * Some ioctl's can be directly handled by lirc_dev if the driver's | ||
187 | * ioctl function is NULL or if it returns -ENOIOCTLCMD (see also | ||
188 | * lirc_serial.c). | ||
189 | * | ||
190 | * owner: | ||
191 | * the module owning this struct | ||
192 | * | ||
193 | */ | ||
194 | |||
195 | |||
196 | /* following functions can be called ONLY from user context | ||
197 | * | ||
198 | * returns negative value on error or minor number | ||
199 | * of the registered device if success | ||
200 | * contents of the structure pointed by p is copied | ||
201 | */ | ||
202 | extern int lirc_register_driver(struct lirc_driver *d); | ||
203 | |||
204 | /* returns negative value on error or 0 if success | ||
205 | */ | ||
206 | extern int lirc_unregister_driver(int minor); | ||
207 | |||
208 | /* Returns the private data stored in the lirc_driver | ||
209 | * associated with the given device file pointer. | ||
210 | */ | ||
211 | void *lirc_get_pdata(struct file *file); | ||
212 | |||
213 | /* default file operations | ||
214 | * used by drivers if they override only some operations | ||
215 | */ | ||
216 | int lirc_dev_fop_open(struct inode *inode, struct file *file); | ||
217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); | ||
218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); | ||
219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | ||
220 | ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, | ||
221 | loff_t *ppos); | ||
222 | ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, | ||
223 | loff_t *ppos); | ||
224 | |||
225 | #endif | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index c78e99a435b..9569d0863f8 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -17,8 +17,13 @@ | |||
17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | 17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ |
18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ |
19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
20 | #define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | ||
20 | #define IR_TYPE_OTHER (1u << 31) | 21 | #define IR_TYPE_OTHER (1u << 31) |
21 | 22 | ||
23 | #define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ | ||
24 | IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ | ||
25 | IR_TYPE_OTHER) | ||
26 | |||
22 | struct ir_scancode { | 27 | struct ir_scancode { |
23 | u32 scancode; | 28 | u32 scancode; |
24 | u32 keycode; | 29 | u32 keycode; |
@@ -64,6 +69,8 @@ void rc_map_init(void); | |||
64 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" | 69 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" |
65 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" | 70 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" |
66 | #define RC_MAP_CINERGY "rc-cinergy" | 71 | #define RC_MAP_CINERGY "rc-cinergy" |
72 | #define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" | ||
73 | #define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" | ||
67 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" | 74 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" |
68 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" | 75 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" |
69 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" | 76 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" |
@@ -87,6 +94,7 @@ void rc_map_init(void); | |||
87 | #define RC_MAP_KAIOMY "rc-kaiomy" | 94 | #define RC_MAP_KAIOMY "rc-kaiomy" |
88 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" | 95 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" |
89 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" | 96 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" |
97 | #define RC_MAP_LIRC "rc-lirc" | ||
90 | #define RC_MAP_MANLI "rc-manli" | 98 | #define RC_MAP_MANLI "rc-manli" |
91 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | 99 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" |
92 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" | 100 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" |
@@ -107,6 +115,7 @@ void rc_map_init(void); | |||
107 | #define RC_MAP_PV951 "rc-pv951" | 115 | #define RC_MAP_PV951 "rc-pv951" |
108 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" | 116 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" |
109 | #define RC_MAP_RC5_TV "rc-rc5-tv" | 117 | #define RC_MAP_RC5_TV "rc-rc5-tv" |
118 | #define RC_MAP_RC6_MCE "rc-rc6-mce" | ||
110 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" | 119 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" |
111 | #define RC_MAP_TBS_NEC "rc-tbs-nec" | 120 | #define RC_MAP_TBS_NEC "rc-tbs-nec" |
112 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" | 121 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" |
@@ -116,6 +125,7 @@ void rc_map_init(void); | |||
116 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 125 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
117 | #define RC_MAP_WINFAST "rc-winfast" | 126 | #define RC_MAP_WINFAST "rc-winfast" |
118 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | 127 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" |
128 | |||
119 | /* | 129 | /* |
120 | * Please, do not just append newer Remote Controller names at the end. | 130 | * Please, do not just append newer Remote Controller names at the end. |
121 | * The names should be ordered in alphabetical order | 131 | * The names should be ordered in alphabetical order |
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index b6774783687..80346a6d28a 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -6,8 +6,11 @@ | |||
6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | 6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ |
7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | 7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ |
8 | 8 | ||
9 | struct device; | ||
10 | |||
9 | struct sh_mobile_ceu_info { | 11 | struct sh_mobile_ceu_info { |
10 | unsigned long flags; | 12 | unsigned long flags; |
13 | struct device *csi2_dev; | ||
11 | }; | 14 | }; |
12 | 15 | ||
13 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ | 16 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ |
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h new file mode 100644 index 00000000000..4d261517446 --- /dev/null +++ b/include/media/sh_mobile_csi2.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Driver header for the SH-Mobile MIPI CSI-2 unit | ||
3 | * | ||
4 | * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
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 SH_MIPI_CSI | ||
12 | #define SH_MIPI_CSI | ||
13 | |||
14 | enum sh_csi2_phy { | ||
15 | SH_CSI2_PHY_MAIN, | ||
16 | SH_CSI2_PHY_SUB, | ||
17 | }; | ||
18 | |||
19 | enum sh_csi2_type { | ||
20 | SH_CSI2C, | ||
21 | SH_CSI2I, | ||
22 | }; | ||
23 | |||
24 | #define SH_CSI2_CRC (1 << 0) | ||
25 | #define SH_CSI2_ECC (1 << 1) | ||
26 | |||
27 | struct platform_device; | ||
28 | |||
29 | struct sh_csi2_client_config { | ||
30 | enum sh_csi2_phy phy; | ||
31 | unsigned char lanes; /* bitmask[3:0] */ | ||
32 | unsigned char channel; /* 0..3 */ | ||
33 | struct platform_device *pdev; /* client platform device */ | ||
34 | }; | ||
35 | |||
36 | struct sh_csi2_pdata { | ||
37 | enum sh_csi2_type type; | ||
38 | unsigned int flags; | ||
39 | struct sh_csi2_client_config *clients; | ||
40 | int num_clients; | ||
41 | }; | ||
42 | |||
43 | struct device; | ||
44 | struct v4l2_device; | ||
45 | |||
46 | #endif | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b8289c2f609..2ce957301f7 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -12,12 +12,15 @@ | |||
12 | #ifndef SOC_CAMERA_H | 12 | #ifndef SOC_CAMERA_H |
13 | #define SOC_CAMERA_H | 13 | #define SOC_CAMERA_H |
14 | 14 | ||
15 | #include <linux/device.h> | ||
15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
16 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
17 | #include <linux/videodev2.h> | 18 | #include <linux/videodev2.h> |
18 | #include <media/videobuf-core.h> | 19 | #include <media/videobuf-core.h> |
19 | #include <media/v4l2-device.h> | 20 | #include <media/v4l2-device.h> |
20 | 21 | ||
22 | extern struct bus_type soc_camera_bus_type; | ||
23 | |||
21 | struct soc_camera_device { | 24 | struct soc_camera_device { |
22 | struct list_head list; | 25 | struct list_head list; |
23 | struct device dev; | 26 | struct device dev; |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 865cda7cd61..f0cf2e7def0 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h | |||
@@ -24,10 +24,10 @@ | |||
24 | */ | 24 | */ |
25 | enum v4l2_mbus_pixelcode { | 25 | enum v4l2_mbus_pixelcode { |
26 | V4L2_MBUS_FMT_FIXED = 1, | 26 | V4L2_MBUS_FMT_FIXED = 1, |
27 | V4L2_MBUS_FMT_YUYV8_2X8_LE, | 27 | V4L2_MBUS_FMT_YUYV8_2X8, |
28 | V4L2_MBUS_FMT_YVYU8_2X8_LE, | 28 | V4L2_MBUS_FMT_YVYU8_2X8, |
29 | V4L2_MBUS_FMT_YUYV8_2X8_BE, | 29 | V4L2_MBUS_FMT_UYVY8_2X8, |
30 | V4L2_MBUS_FMT_YVYU8_2X8_BE, | 30 | V4L2_MBUS_FMT_VYUY8_2X8, |
31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | 31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, |
32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | 32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, |
33 | V4L2_MBUS_FMT_RGB565_2X8_LE, | 33 | V4L2_MBUS_FMT_RGB565_2X8_LE, |
@@ -41,6 +41,11 @@ enum v4l2_mbus_pixelcode { | |||
41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | 41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, |
42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | 42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, |
43 | V4L2_MBUS_FMT_SGRBG8_1X8, | 43 | V4L2_MBUS_FMT_SGRBG8_1X8, |
44 | V4L2_MBUS_FMT_SBGGR12_1X12, | ||
45 | V4L2_MBUS_FMT_YUYV8_1_5X8, | ||
46 | V4L2_MBUS_FMT_YVYU8_1_5X8, | ||
47 | V4L2_MBUS_FMT_UYVY8_1_5X8, | ||
48 | V4L2_MBUS_FMT_VYUY8_1_5X8, | ||
44 | }; | 49 | }; |
45 | 50 | ||
46 | /** | 51 | /** |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index f91a736c133..f2c41cebf45 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -54,8 +54,6 @@ struct videobuf_queue; | |||
54 | 54 | ||
55 | struct videobuf_mapping { | 55 | struct videobuf_mapping { |
56 | unsigned int count; | 56 | unsigned int count; |
57 | unsigned long start; | ||
58 | unsigned long end; | ||
59 | struct videobuf_queue *q; | 57 | struct videobuf_queue *q; |
60 | }; | 58 | }; |
61 | 59 | ||
@@ -127,7 +125,7 @@ struct videobuf_queue_ops { | |||
127 | struct videobuf_qtype_ops { | 125 | struct videobuf_qtype_ops { |
128 | u32 magic; | 126 | u32 magic; |
129 | 127 | ||
130 | struct videobuf_buffer *(*alloc)(size_t size); | 128 | struct videobuf_buffer *(*alloc_vb)(size_t size); |
131 | void *(*vaddr) (struct videobuf_buffer *buf); | 129 | void *(*vaddr) (struct videobuf_buffer *buf); |
132 | int (*iolock) (struct videobuf_queue *q, | 130 | int (*iolock) (struct videobuf_queue *q, |
133 | struct videobuf_buffer *vb, | 131 | struct videobuf_buffer *vb, |
@@ -173,7 +171,7 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | |||
173 | int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, | 171 | int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, |
174 | struct v4l2_framebuffer *fbuf); | 172 | struct v4l2_framebuffer *fbuf); |
175 | 173 | ||
176 | struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q); | 174 | struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q); |
177 | 175 | ||
178 | /* Used on videobuf-dvb */ | 176 | /* Used on videobuf-dvb */ |
179 | void *videobuf_queue_to_vaddr(struct videobuf_queue *q, | 177 | void *videobuf_queue_to_vaddr(struct videobuf_queue *q, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index a195f3b9c00..97e07f46a0f 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
@@ -25,23 +25,6 @@ | |||
25 | /* --------------------------------------------------------------------- */ | 25 | /* --------------------------------------------------------------------- */ |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * Return a scatterlist for some page-aligned vmalloc()'ed memory | ||
29 | * block (NULL on errors). Memory for the scatterlist is allocated | ||
30 | * using kmalloc. The caller must free the memory. | ||
31 | */ | ||
32 | struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); | ||
33 | |||
34 | /* | ||
35 | * Return a scatterlist for a an array of userpages (NULL on errors). | ||
36 | * Memory for the scatterlist is allocated using kmalloc. The caller | ||
37 | * must free the memory. | ||
38 | */ | ||
39 | struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages, | ||
40 | int offset); | ||
41 | |||
42 | /* --------------------------------------------------------------------- */ | ||
43 | |||
44 | /* | ||
45 | * A small set of helper functions to manage buffers (both userland | 28 | * A small set of helper functions to manage buffers (both userland |
46 | * and kernel) for DMA. | 29 | * and kernel) for DMA. |
47 | * | 30 | * |
@@ -68,7 +51,7 @@ struct videobuf_dmabuf { | |||
68 | struct page **pages; | 51 | struct page **pages; |
69 | 52 | ||
70 | /* for kernel buffers */ | 53 | /* for kernel buffers */ |
71 | void *vmalloc; | 54 | void *vaddr; |
72 | 55 | ||
73 | /* for overlay buffers (pci-pci dma) */ | 56 | /* for overlay buffers (pci-pci dma) */ |
74 | dma_addr_t bus_addr; | 57 | dma_addr_t bus_addr; |
@@ -87,6 +70,16 @@ struct videobuf_dma_sg_memory { | |||
87 | struct videobuf_dmabuf dma; | 70 | struct videobuf_dmabuf dma; |
88 | }; | 71 | }; |
89 | 72 | ||
73 | /* | ||
74 | * Scatter-gather DMA buffer API. | ||
75 | * | ||
76 | * These functions provide a simple way to create a page list and a | ||
77 | * scatter-gather list from a kernel, userspace of physical address and map the | ||
78 | * memory for DMA operation. | ||
79 | * | ||
80 | * Despite the name, this is totally unrelated to videobuf, except that | ||
81 | * videobuf-dma-sg uses the same API internally. | ||
82 | */ | ||
90 | void videobuf_dma_init(struct videobuf_dmabuf *dma); | 83 | void videobuf_dma_init(struct videobuf_dmabuf *dma); |
91 | int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, | 84 | int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, |
92 | unsigned long data, unsigned long size); | 85 | unsigned long data, unsigned long size); |
@@ -96,8 +89,8 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, | |||
96 | dma_addr_t addr, int nr_pages); | 89 | dma_addr_t addr, int nr_pages); |
97 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | 90 | int videobuf_dma_free(struct videobuf_dmabuf *dma); |
98 | 91 | ||
99 | int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma); | 92 | int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma); |
100 | int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma); | 93 | int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); |
101 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | 94 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); |
102 | 95 | ||
103 | void *videobuf_sg_alloc(size_t size); | 96 | void *videobuf_sg_alloc(size_t size); |
@@ -111,11 +104,5 @@ void videobuf_queue_sg_init(struct videobuf_queue *q, | |||
111 | unsigned int msize, | 104 | unsigned int msize, |
112 | void *priv); | 105 | void *priv); |
113 | 106 | ||
114 | /*FIXME: these variants are used only on *-alsa code, where videobuf is | ||
115 | * used without queue | ||
116 | */ | ||
117 | int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); | ||
118 | int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); | ||
119 | |||
120 | #endif /* _VIDEOBUF_DMA_SG_H */ | 107 | #endif /* _VIDEOBUF_DMA_SG_H */ |
121 | 108 | ||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index 851eb1a2ff2..e19403c18da 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | struct videobuf_vmalloc_memory { | 22 | struct videobuf_vmalloc_memory { |
23 | u32 magic; | 23 | u32 magic; |
24 | 24 | ||
25 | void *vmalloc; | 25 | void *vaddr; |
26 | 26 | ||
27 | /* remap_vmalloc_range seems to need to run | 27 | /* remap_vmalloc_range seems to need to run |
28 | * after mmap() on some cases */ | 28 | * after mmap() on some cases */ |