aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-23 00:47:29 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-23 00:47:29 -0400
commitbd072111e7319d90a7b8127f91c2806b9a6f279e (patch)
tree1686978814a2387ebfc16f9f5778a7f0caaf319b /include/media
parent24d01c0681bfbc10a99304c48a89ad213d2d7a4b (diff)
parent4be3bd7849165e7efa6b0b35a23d6a3598d97465 (diff)
Merge commit 'v2.6.31-rc4' into next
Diffstat (limited to 'include/media')
-rw-r--r--include/media/adv7343.h23
-rw-r--r--include/media/ir-common.h2
-rw-r--r--include/media/ir-kbd-i2c.h10
-rw-r--r--include/media/soc_camera.h10
-rw-r--r--include/media/tuner.h2
-rw-r--r--include/media/v4l2-chip-ident.h9
-rw-r--r--include/media/v4l2-common.h26
-rw-r--r--include/media/v4l2-device.h23
-rw-r--r--include/media/v4l2-i2c-drv.h5
-rw-r--r--include/media/v4l2-subdev.h12
10 files changed, 116 insertions, 6 deletions
diff --git a/include/media/adv7343.h b/include/media/adv7343.h
new file mode 100644
index 000000000000..d6f8a4e1a1fc
--- /dev/null
+++ b/include/media/adv7343.h
@@ -0,0 +1,23 @@
1/*
2 * ADV7343 header file
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed .as is. WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef ADV7343_H
17#define ADV7343_H
18
19#define ADV7343_COMPOSITE_ID (0)
20#define ADV7343_COMPONENT_ID (1)
21#define ADV7343_SVIDEO_ID (2)
22
23#endif /* End of #ifndef ADV7343_H */
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 7b5b91f60425..9dcb632f6083 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -162,6 +162,8 @@ extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE];
162extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; 162extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
163extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; 163extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE];
164extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; 164extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE];
165extern IR_KEYTAB_TYPE ir_codes_evga_indtube[IR_KEYTAB_SIZE];
166
165#endif 167#endif
166 168
167/* 169/*
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 07963d705400..3ad4ed5402fb 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -7,7 +7,7 @@ struct IR_i2c;
7 7
8struct IR_i2c { 8struct IR_i2c {
9 IR_KEYTAB_TYPE *ir_codes; 9 IR_KEYTAB_TYPE *ir_codes;
10 struct i2c_client c; 10 struct i2c_client *c;
11 struct input_dev *input; 11 struct input_dev *input;
12 struct ir_input_state ir; 12 struct ir_input_state ir;
13 13
@@ -15,7 +15,15 @@ struct IR_i2c {
15 unsigned char old; 15 unsigned char old;
16 16
17 struct delayed_work work; 17 struct delayed_work work;
18 char name[32];
18 char phys[32]; 19 char phys[32];
19 int (*get_key)(struct IR_i2c*, u32*, u32*); 20 int (*get_key)(struct IR_i2c*, u32*, u32*);
20}; 21};
22
23/* Can be passed when instantiating an ir_video i2c device */
24struct IR_i2c_init_data {
25 IR_KEYTAB_TYPE *ir_codes;
26 const char *name;
27 int (*get_key)(struct IR_i2c*, u32*, u32*);
28};
21#endif 29#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 37013688af44..23ecead35e7a 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -60,7 +60,7 @@ struct soc_camera_file {
60 60
61struct soc_camera_host { 61struct soc_camera_host {
62 struct list_head list; 62 struct list_head list;
63 struct device dev; 63 struct device *dev;
64 unsigned char nr; /* Host number */ 64 unsigned char nr; /* Host number */
65 void *priv; 65 void *priv;
66 const char *drv_name; 66 const char *drv_name;
@@ -92,11 +92,16 @@ struct soc_camera_host_ops {
92#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) 92#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3)
93#define SOCAM_SENSOR_INVERT_DATA (1 << 4) 93#define SOCAM_SENSOR_INVERT_DATA (1 << 4)
94 94
95struct i2c_board_info;
96
95struct soc_camera_link { 97struct soc_camera_link {
96 /* Camera bus id, used to match a camera and a bus */ 98 /* Camera bus id, used to match a camera and a bus */
97 int bus_id; 99 int bus_id;
98 /* Per camera SOCAM_SENSOR_* bus flags */ 100 /* Per camera SOCAM_SENSOR_* bus flags */
99 unsigned long flags; 101 unsigned long flags;
102 int i2c_adapter_id;
103 struct i2c_board_info *board_info;
104 const char *module_name;
100 /* Optional callbacks to power on or off and reset the sensor */ 105 /* Optional callbacks to power on or off and reset the sensor */
101 int (*power)(struct device *, int); 106 int (*power)(struct device *, int);
102 int (*reset)(struct device *); 107 int (*reset)(struct device *);
@@ -107,6 +112,7 @@ struct soc_camera_link {
107 */ 112 */
108 int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); 113 int (*set_bus_param)(struct soc_camera_link *, unsigned long flags);
109 unsigned long (*query_bus_param)(struct soc_camera_link *); 114 unsigned long (*query_bus_param)(struct soc_camera_link *);
115 void (*free_bus)(struct soc_camera_link *);
110}; 116};
111 117
112static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) 118static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev)
@@ -116,7 +122,7 @@ static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev)
116 122
117static inline struct soc_camera_host *to_soc_camera_host(struct device *dev) 123static inline struct soc_camera_host *to_soc_camera_host(struct device *dev)
118{ 124{
119 return container_of(dev, struct soc_camera_host, dev); 125 return dev_get_drvdata(dev);
120} 126}
121 127
122extern int soc_camera_host_register(struct soc_camera_host *ici); 128extern int soc_camera_host_register(struct soc_camera_host *ici);
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 7d4e2db78076..cbf97f45fbec 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -124,6 +124,8 @@
124#define TUNER_XC5000 76 /* Xceive Silicon Tuner */ 124#define TUNER_XC5000 76 /* Xceive Silicon Tuner */
125#define TUNER_TCL_MF02GIP_5N 77 /* TCL MF02GIP_5N */ 125#define TUNER_TCL_MF02GIP_5N 77 /* TCL MF02GIP_5N */
126#define TUNER_PHILIPS_FMD1216MEX_MK3 78 126#define TUNER_PHILIPS_FMD1216MEX_MK3 78
127#define TUNER_PHILIPS_FM1216MK5 79
128#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */
127 129
128/* tv card specific */ 130/* tv card specific */
129#define TDA9887_PRESENT (1<<0) 131#define TDA9887_PRESENT (1<<0)
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 1be461a29077..11a4a2d3e364 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -137,6 +137,12 @@ enum {
137 /* module saa7191: just ident 7191 */ 137 /* module saa7191: just ident 7191 */
138 V4L2_IDENT_SAA7191 = 7191, 138 V4L2_IDENT_SAA7191 = 7191,
139 139
140 /* module ths7303: just ident 7303 */
141 V4L2_IDENT_THS7303 = 7303,
142
143 /* module adv7343: just ident 7343 */
144 V4L2_IDENT_ADV7343 = 7343,
145
140 /* module wm8739: just ident 8739 */ 146 /* module wm8739: just ident 8739 */
141 V4L2_IDENT_WM8739 = 8739, 147 V4L2_IDENT_WM8739 = 8739,
142 148
@@ -149,6 +155,9 @@ enum {
149 /* module cafe_ccic, just ident 8801 */ 155 /* module cafe_ccic, just ident 8801 */
150 V4L2_IDENT_CAFE = 8801, 156 V4L2_IDENT_CAFE = 8801,
151 157
158 /* module mt9v011, just ident 8243 */
159 V4L2_IDENT_MT9V011 = 8243,
160
152 /* module tw9910: just ident 9910 */ 161 /* module tw9910: just ident 9910 */
153 V4L2_IDENT_TW9910 = 9910, 162 V4L2_IDENT_TW9910 = 9910,
154 163
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index c48c24e4d0fa..33a18426ab9b 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -153,6 +153,22 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct v4l2_device *v4l2_dev,
153struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev, 153struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
154 struct i2c_adapter *adapter, 154 struct i2c_adapter *adapter,
155 const char *module_name, const char *client_type, u8 addr); 155 const char *module_name, const char *client_type, u8 addr);
156
157/* Load an i2c module and return an initialized v4l2_subdev struct.
158 Only call request_module if module_name != NULL.
159 The client_type argument is the name of the chip that's on the adapter. */
160struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
161 struct i2c_adapter *adapter,
162 const char *module_name, const char *client_type,
163 int irq, void *platform_data,
164 u8 addr, const unsigned short *probe_addrs);
165
166struct i2c_board_info;
167
168struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
169 struct i2c_adapter *adapter, const char *module_name,
170 struct i2c_board_info *info, const unsigned short *probe_addrs);
171
156/* Initialize an v4l2_subdev with data from an i2c_client struct */ 172/* Initialize an v4l2_subdev with data from an i2c_client struct */
157void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, 173void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
158 const struct v4l2_subdev_ops *ops); 174 const struct v4l2_subdev_ops *ops);
@@ -193,4 +209,14 @@ struct v4l2_routing {
193 u32 output; 209 u32 output;
194}; 210};
195 211
212/* ------------------------------------------------------------------------- */
213
214/* Miscellaneous helper functions */
215
216void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
217 unsigned int wmax, unsigned int walign,
218 unsigned int *h, unsigned int hmin,
219 unsigned int hmax, unsigned int halign,
220 unsigned int salign);
221
196#endif /* V4L2_COMMON_H_ */ 222#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 0dd3e8e8653e..5d5d550e63ad 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -30,7 +30,7 @@
30 basic V4L2 device-level support. 30 basic V4L2 device-level support.
31 */ 31 */
32 32
33#define V4L2_DEVICE_NAME_SIZE (BUS_ID_SIZE + 16) 33#define V4L2_DEVICE_NAME_SIZE (20 + 16)
34 34
35struct v4l2_device { 35struct v4l2_device {
36 /* dev->driver_data points to this struct. 36 /* dev->driver_data points to this struct.
@@ -53,10 +53,31 @@ struct v4l2_device {
53 dev may be NULL in rare cases (ISA devices). In that case you 53 dev may be NULL in rare cases (ISA devices). In that case you
54 must fill in the v4l2_dev->name field before calling this function. */ 54 must fill in the v4l2_dev->name field before calling this function. */
55int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); 55int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
56
57/* Optional function to initialize the name field of struct v4l2_device using
58 the driver name and a driver-global atomic_t instance.
59 This function will increment the instance counter and returns the instance
60 value used in the name.
61
62 Example:
63
64 static atomic_t drv_instance = ATOMIC_INIT(0);
65
66 ...
67
68 instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance);
69
70 The first time this is called the name field will be set to foo0 and
71 this function returns 0. If the name ends with a digit (e.g. cx18),
72 then the name will be set to cx18-0 since cx180 looks really odd. */
73int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
74 atomic_t *instance);
75
56/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects. 76/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
57 Since the parent disappears this ensures that v4l2_dev doesn't have an 77 Since the parent disappears this ensures that v4l2_dev doesn't have an
58 invalid parent pointer. */ 78 invalid parent pointer. */
59void v4l2_device_disconnect(struct v4l2_device *v4l2_dev); 79void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
80
60/* Unregister all sub-devices and any other resources related to v4l2_dev. */ 81/* Unregister all sub-devices and any other resources related to v4l2_dev. */
61void v4l2_device_unregister(struct v4l2_device *v4l2_dev); 82void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
62 83
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 10a2882c3cbf..74bf741d1a9b 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -22,7 +22,7 @@
22 */ 22 */
23 23
24/* NOTE: the full version of this header is in the v4l-dvb repository 24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on older kernels as well. 25 * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels.
26 * The version of this header as it appears in the kernel is a stripped 26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it 27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd. 28 * looks a bit odd.
@@ -30,6 +30,9 @@
30 * If you look at the full version then you will understand the reason 30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all 31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver. 32 * the tricky backwards compatibility code in each and every i2c driver.
33 *
34 * If the i2c driver will never be compiled for pre-2.6.26 kernels, then
35 * DO NOT USE this header! Just write it as a regular i2c driver.
33 */ 36 */
34 37
35#ifndef __V4L2_I2C_DRV_H__ 38#ifndef __V4L2_I2C_DRV_H__
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 17856081c809..5dcb36785529 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -79,7 +79,11 @@ struct v4l2_decode_vbi_line {
79 not yet implemented) since ops provide proper type-checking. 79 not yet implemented) since ops provide proper type-checking.
80 */ 80 */
81 81
82/* init: initialize the sensor registors to some sort of reasonable default 82/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*
83 functions after the v4l2_subdev was registered. It is used to pass
84 platform data to the subdev which can be used during initialization.
85
86 init: initialize the sensor registors to some sort of reasonable default
83 values. Do not use for new drivers and should be removed in existing 87 values. Do not use for new drivers and should be removed in existing
84 drivers. 88 drivers.
85 89
@@ -96,6 +100,7 @@ struct v4l2_decode_vbi_line {
96struct v4l2_subdev_core_ops { 100struct v4l2_subdev_core_ops {
97 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 101 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
98 int (*log_status)(struct v4l2_subdev *sd); 102 int (*log_status)(struct v4l2_subdev *sd);
103 int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
99 int (*init)(struct v4l2_subdev *sd, u32 val); 104 int (*init)(struct v4l2_subdev *sd, u32 val);
100 int (*load_fw)(struct v4l2_subdev *sd); 105 int (*load_fw)(struct v4l2_subdev *sd);
101 int (*reset)(struct v4l2_subdev *sd, u32 val); 106 int (*reset)(struct v4l2_subdev *sd, u32 val);
@@ -230,12 +235,16 @@ struct v4l2_subdev_ops {
230 235
231#define V4L2_SUBDEV_NAME_SIZE 32 236#define V4L2_SUBDEV_NAME_SIZE 32
232 237
238/* Set this flag if this subdev is a i2c device. */
239#define V4L2_SUBDEV_FL_IS_I2C (1U << 0)
240
233/* Each instance of a subdev driver should create this struct, either 241/* Each instance of a subdev driver should create this struct, either
234 stand-alone or embedded in a larger struct. 242 stand-alone or embedded in a larger struct.
235 */ 243 */
236struct v4l2_subdev { 244struct v4l2_subdev {
237 struct list_head list; 245 struct list_head list;
238 struct module *owner; 246 struct module *owner;
247 u32 flags;
239 struct v4l2_device *v4l2_dev; 248 struct v4l2_device *v4l2_dev;
240 const struct v4l2_subdev_ops *ops; 249 const struct v4l2_subdev_ops *ops;
241 /* name must be unique */ 250 /* name must be unique */
@@ -264,6 +273,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
264 BUG_ON(!ops || !ops->core); 273 BUG_ON(!ops || !ops->core);
265 sd->ops = ops; 274 sd->ops = ops;
266 sd->v4l2_dev = NULL; 275 sd->v4l2_dev = NULL;
276 sd->flags = 0;
267 sd->name[0] = '\0'; 277 sd->name[0] = '\0';
268 sd->grp_id = 0; 278 sd->grp_id = 0;
269 sd->priv = NULL; 279 sd->priv = NULL;