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