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