]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/staging/media/davinci_vpfe/vpfe.h
Linux 5.3-rc4
[linux.git] / drivers / staging / media / davinci_vpfe / vpfe.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2012 Texas Instruments Inc
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation version 2.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * Contributors:
15  *      Manjunath Hadli <manjunath.hadli@ti.com>
16  *      Prabhakar Lad <prabhakar.lad@ti.com>
17  */
18
19 #ifndef _VPFE_H
20 #define _VPFE_H
21
22 #ifdef __KERNEL__
23 #include <linux/v4l2-subdev.h>
24 #include <linux/clk.h>
25 #include <linux/i2c.h>
26
27 #include <media/davinci/vpfe_types.h>
28
29 #define CAPTURE_DRV_NAME        "vpfe-capture"
30
31 struct vpfe_route {
32         __u32 input;
33         __u32 output;
34 };
35
36 enum vpfe_subdev_id {
37         VPFE_SUBDEV_TVP5146 = 1,
38         VPFE_SUBDEV_MT9T031 = 2,
39         VPFE_SUBDEV_TVP7002 = 3,
40         VPFE_SUBDEV_MT9P031 = 4,
41 };
42
43 struct vpfe_ext_subdev_info {
44         /* v4l2 subdev */
45         struct v4l2_subdev *subdev;
46         /* Sub device module name */
47         char module_name[32];
48         /* Sub device group id */
49         int grp_id;
50         /* Number of inputs supported */
51         int num_inputs;
52         /* inputs available at the sub device */
53         struct v4l2_input *inputs;
54         /* Sub dev routing information for each input */
55         struct vpfe_route *routes;
56         /* ccdc bus/interface configuration */
57         struct vpfe_hw_if_param ccdc_if_params;
58         /* i2c subdevice board info */
59         struct i2c_board_info board_info;
60         /* Is this a camera sub device ? */
61         unsigned is_camera:1;
62         /* check if sub dev supports routing */
63         unsigned can_route:1;
64         /* registered ? */
65         unsigned registered:1;
66 };
67
68 struct vpfe_config {
69         /* Number of sub devices connected to vpfe */
70         int num_subdevs;
71         /* information about each subdev */
72         struct vpfe_ext_subdev_info *sub_devs;
73         /* evm card info */
74         char *card_name;
75         /* setup function for the input path */
76         int (*setup_input)(enum vpfe_subdev_id id);
77         /* number of clocks */
78         int num_clocks;
79         /* clocks used for vpfe capture */
80         char *clocks[];
81 };
82 #endif
83 #endif