diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-21 19:50:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-21 19:50:31 -0500 |
commit | 13a3cec8443290b082af2a5254562aca247fe591 (patch) | |
tree | 5c873a2c9333be348266234ac5d7101caa1b6d7d /include | |
parent | 973c9f4f49ca96a53bcf6384c4c59ccd26c33906 (diff) | |
parent | 88914bdf8c677ebd7e797adac05e47303fd6ac77 (diff) |
Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (101 commits)
[media] staging/lirc: fix mem leaks and ptr err usage
[media] hdpvr: reduce latency of i2c read/write w/recycled buffer
[media] hdpvr: enable IR part
[media] rc/mceusb: timeout should be in ns, not us
[media] v4l2-device: fix 'use-after-freed' oops
[media] v4l2-dev: don't memset video_device.dev
[media] zoran: use video_device_alloc instead of kmalloc
[media] w9966: zero device state after a detach
[media] v4l: Fix a use-before-set in the control framework
[media] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h
[media] DocBook/v4l: update V4L2 revision and update copyright years
[media] DocBook/v4l: fix validation error in dev-rds.xml
[media] v4l2-ctrls: queryctrl shouldn't attempt to replace V4L2_CID_PRIVATE_BASE IDs
[media] v4l2-ctrls: fix missing 'read-only' check
[media] pvrusb2: Provide more information about IR units to lirc_zilog and ir-kbd-i2c
[media] ir-kbd-i2c: Add back defaults setting for Zilog Z8's at addr 0x71
[media] lirc_zilog: Update TODO.lirc_zilog
[media] lirc_zilog: Add Andy Walls to copyright notice and authors list
[media] lirc_zilog: Remove useless struct i2c_driver.command function
[media] lirc_zilog: Remove unneeded tests for existence of the IR Tx function
...
Diffstat (limited to 'include')
-rw-r--r-- | include/media/mt9v011.h | 17 | ||||
-rw-r--r-- | include/media/rc-core.h | 3 | ||||
-rw-r--r-- | include/media/saa7146.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 13 | ||||
-rw-r--r-- | include/media/v4l2-ctrls.h | 7 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 23 |
6 files changed, 45 insertions, 20 deletions
diff --git a/include/media/mt9v011.h b/include/media/mt9v011.h new file mode 100644 index 000000000000..ea29fc74cd06 --- /dev/null +++ b/include/media/mt9v011.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* mt9v011 sensor | ||
2 | * | ||
3 | * Copyright (C) 2011 Hans Verkuil <hverkuil@xs4all.nl> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __MT9V011_H__ | ||
11 | #define __MT9V011_H__ | ||
12 | |||
13 | struct mt9v011_platform_data { | ||
14 | unsigned xtal; /* Hz */ | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index a23c1fc685a1..2963263f31e2 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
@@ -183,6 +183,9 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | 185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ |
186 | #define US_TO_NS(usec) ((usec) * 1000) | ||
187 | #define MS_TO_US(msec) ((msec) * 1000) | ||
188 | #define MS_TO_NS(msec) ((msec) * 1000 * 1000) | ||
186 | 189 | ||
187 | void ir_raw_event_handle(struct rc_dev *dev); | 190 | void ir_raw_event_handle(struct rc_dev *dev); |
188 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); | 191 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index ac7ce00f39cf..79827143d5ac 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -115,7 +115,7 @@ struct saa7146_dev | |||
115 | 115 | ||
116 | /* different device locks */ | 116 | /* different device locks */ |
117 | spinlock_t slock; | 117 | spinlock_t slock; |
118 | struct mutex lock; | 118 | struct mutex v4l2_lock; |
119 | 119 | ||
120 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ | 120 | unsigned char __iomem *mem; /* pointer to mapped IO memory */ |
121 | u32 revision; /* chip revision; needed for bug-workarounds*/ | 121 | u32 revision; /* chip revision; needed for bug-workarounds*/ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 2d65b35cdab2..a659319e8582 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -138,21 +138,10 @@ struct v4l2_subdev_ops; | |||
138 | 138 | ||
139 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
140 | The client_type argument is the name of the chip that's on the adapter. */ | 140 | The client_type argument is the name of the chip that's on the adapter. */ |
141 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 141 | struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, |
142 | struct i2c_adapter *adapter, const char *client_type, | 142 | struct i2c_adapter *adapter, const char *client_type, |
143 | int irq, void *platform_data, | ||
144 | u8 addr, const unsigned short *probe_addrs); | 143 | u8 addr, const unsigned short *probe_addrs); |
145 | 144 | ||
146 | /* Load an i2c module and return an initialized v4l2_subdev struct. | ||
147 | The client_type argument is the name of the chip that's on the adapter. */ | ||
148 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, | ||
149 | struct i2c_adapter *adapter, const char *client_type, | ||
150 | u8 addr, const unsigned short *probe_addrs) | ||
151 | { | ||
152 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL, | ||
153 | addr, probe_addrs); | ||
154 | } | ||
155 | |||
156 | struct i2c_board_info; | 145 | struct i2c_board_info; |
157 | 146 | ||
158 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 147 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index d69ab4aae032..97d063837b61 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/videodev2.h> | ||
26 | 27 | ||
27 | /* forward references */ | 28 | /* forward references */ |
28 | struct v4l2_ctrl_handler; | 29 | struct v4l2_ctrl_handler; |
@@ -53,8 +54,10 @@ struct v4l2_ctrl_ops { | |||
53 | * @handler: The handler that owns the control. | 54 | * @handler: The handler that owns the control. |
54 | * @cluster: Point to start of cluster array. | 55 | * @cluster: Point to start of cluster array. |
55 | * @ncontrols: Number of controls in cluster array. | 56 | * @ncontrols: Number of controls in cluster array. |
56 | * @has_new: Internal flag: set when there is a valid new value. | ||
57 | * @done: Internal flag: set for each processed control. | 57 | * @done: Internal flag: set for each processed control. |
58 | * @is_new: Set when the user specified a new value for this control. It | ||
59 | * is also set when called from v4l2_ctrl_handler_setup. Drivers | ||
60 | * should never set this flag. | ||
58 | * @is_private: If set, then this control is private to its handler and it | 61 | * @is_private: If set, then this control is private to its handler and it |
59 | * will not be added to any other handlers. Drivers can set | 62 | * will not be added to any other handlers. Drivers can set |
60 | * this flag. | 63 | * this flag. |
@@ -97,9 +100,9 @@ struct v4l2_ctrl { | |||
97 | struct v4l2_ctrl_handler *handler; | 100 | struct v4l2_ctrl_handler *handler; |
98 | struct v4l2_ctrl **cluster; | 101 | struct v4l2_ctrl **cluster; |
99 | unsigned ncontrols; | 102 | unsigned ncontrols; |
100 | unsigned int has_new:1; | ||
101 | unsigned int done:1; | 103 | unsigned int done:1; |
102 | 104 | ||
105 | unsigned int is_new:1; | ||
103 | unsigned int is_private:1; | 106 | unsigned int is_private:1; |
104 | unsigned int is_volatile:1; | 107 | unsigned int is_volatile:1; |
105 | 108 | ||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index b0316a7cf08d..daf1e57d9b26 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -106,10 +106,7 @@ struct v4l2_subdev_io_pin_config { | |||
106 | u8 strength; /* Pin drive strength */ | 106 | u8 strength; /* Pin drive strength */ |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* | 109 | /* |
110 | functions after the v4l2_subdev was registered. It is used to pass | ||
111 | platform data to the subdev which can be used during initialization. | ||
112 | |||
113 | s_io_pin_config: configure one or more chip I/O pins for chips that | 110 | s_io_pin_config: configure one or more chip I/O pins for chips that |
114 | multiplex different internal signal pads out to IO pins. This function | 111 | multiplex different internal signal pads out to IO pins. This function |
115 | takes a pointer to an array of 'n' pin configuration entries, one for | 112 | takes a pointer to an array of 'n' pin configuration entries, one for |
@@ -141,7 +138,6 @@ struct v4l2_subdev_io_pin_config { | |||
141 | struct v4l2_subdev_core_ops { | 138 | struct v4l2_subdev_core_ops { |
142 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 139 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
143 | int (*log_status)(struct v4l2_subdev *sd); | 140 | int (*log_status)(struct v4l2_subdev *sd); |
144 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); | ||
145 | int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, | 141 | int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, |
146 | struct v4l2_subdev_io_pin_config *pincfg); | 142 | struct v4l2_subdev_io_pin_config *pincfg); |
147 | int (*init)(struct v4l2_subdev *sd, u32 val); | 143 | int (*init)(struct v4l2_subdev *sd, u32 val); |
@@ -415,6 +411,21 @@ struct v4l2_subdev_ops { | |||
415 | const struct v4l2_subdev_sensor_ops *sensor; | 411 | const struct v4l2_subdev_sensor_ops *sensor; |
416 | }; | 412 | }; |
417 | 413 | ||
414 | /* | ||
415 | * Internal ops. Never call this from drivers, only the v4l2 framework can call | ||
416 | * these ops. | ||
417 | * | ||
418 | * registered: called when this subdev is registered. When called the v4l2_dev | ||
419 | * field is set to the correct v4l2_device. | ||
420 | * | ||
421 | * unregistered: called when this subdev is unregistered. When called the | ||
422 | * v4l2_dev field is still set to the correct v4l2_device. | ||
423 | */ | ||
424 | struct v4l2_subdev_internal_ops { | ||
425 | int (*registered)(struct v4l2_subdev *sd); | ||
426 | void (*unregistered)(struct v4l2_subdev *sd); | ||
427 | }; | ||
428 | |||
418 | #define V4L2_SUBDEV_NAME_SIZE 32 | 429 | #define V4L2_SUBDEV_NAME_SIZE 32 |
419 | 430 | ||
420 | /* Set this flag if this subdev is a i2c device. */ | 431 | /* Set this flag if this subdev is a i2c device. */ |
@@ -431,6 +442,8 @@ struct v4l2_subdev { | |||
431 | u32 flags; | 442 | u32 flags; |
432 | struct v4l2_device *v4l2_dev; | 443 | struct v4l2_device *v4l2_dev; |
433 | const struct v4l2_subdev_ops *ops; | 444 | const struct v4l2_subdev_ops *ops; |
445 | /* Never call these internal ops from within a driver! */ | ||
446 | const struct v4l2_subdev_internal_ops *internal_ops; | ||
434 | /* The control handler of this subdev. May be NULL. */ | 447 | /* The control handler of this subdev. May be NULL. */ |
435 | struct v4l2_ctrl_handler *ctrl_handler; | 448 | struct v4l2_ctrl_handler *ctrl_handler; |
436 | /* name must be unique */ | 449 | /* name must be unique */ |