isp10: rockchip: v0.1.6
[firefly-linux-kernel-4.4.55.git] / drivers / media / platform / rk-isp10 / cif_isp10_img_src_ops.h
1 /*
2  *************************************************************************
3  * Rockchip driver for CIF ISP 1.0
4  * (Based on Intel driver for sofiaxxx)
5  *
6  * Copyright (C) 2015 Intel Mobile Communications GmbH
7  * Copyright (C) 2016 Fuzhou Rockchip Electronics Co., Ltd.
8  *
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *************************************************************************
15  */
16
17 #ifndef _CIF_ISP10_IMG_SRC_OPS_H
18 #define _CIF_ISP10_IMG_SRC_OPS_H
19 #include <linux/platform_data/rk_isp10_platform.h>
20 #include "cif_isp10_img_src_v4l2-subdev.h"
21
22 struct cif_isp10_img_src_ops {
23         void * (*to_img_src)(
24                 CIF_ISP10_PLTFRM_DEVICE dev,
25                 struct pltfrm_soc_cfg *soc_cfg);
26         int (*s_streaming)(
27                 void *img_src,
28                 bool enable);
29         int (*s_power)(
30                 void *img_src,
31                 bool on);
32         int (*enum_strm_fmts)(
33                 void *img_src,
34                 u32 index,
35                 struct cif_isp10_strm_fmt_desc *strm_fmt_desc);
36         int (*s_strm_fmt)(
37                 void *img_src,
38                 struct cif_isp10_strm_fmt *strm_fmt);
39         int (*g_ctrl)(
40                 void *img_src,
41                 int id,
42                 int *val);
43         const char * (*g_name)(
44                 void *img_src);
45         int (*s_ctrl)(
46                 void *img_src,
47                 int id,
48                 int val);
49         int (*s_ext_ctrls)(
50                 void *img_src,
51             struct cif_isp10_img_src_ext_ctrl *ctrl);
52         long (*ioctl)(
53                 void *img_src,
54                 unsigned int cmd,
55                 void *arg);
56 };
57
58 const struct {
59         const char *device_type;
60         struct cif_isp10_img_src_ops ops;
61 } cif_isp10_img_src_ops[] = {
62         {
63                 .device_type = CIF_ISP10_IMG_SRC_V4L2_I2C_SUBDEV,
64                 .ops = {
65                         .to_img_src =
66                                 cif_isp10_img_src_v4l2_i2c_subdev_to_img_src,
67                         .s_streaming =
68                                 cif_isp10_img_src_v4l2_subdev_s_streaming,
69                         .s_power =
70                                 cif_isp10_img_src_v4l2_subdev_s_power,
71                         .enum_strm_fmts =
72                                 cif_isp10_img_src_v4l2_subdev_enum_strm_fmts,
73                         .s_strm_fmt =
74                                 cif_isp10_img_src_v4l2_subdev_s_strm_fmt,
75                         .g_ctrl =
76                                 cif_isp10_img_src_v4l2_subdev_g_ctrl,
77                         .g_name =
78                                 cif_isp10_img_src_v4l2_subdev_g_name,
79                         .s_ctrl =
80                                 cif_isp10_img_src_v4l2_subdev_s_ctrl,
81                         .s_ext_ctrls =
82                                 cif_isp10_img_src_v4l2_subdev_s_ext_ctrls,
83                         .ioctl =
84                                 cif_isp10_img_src_v4l2_subdev_ioctl
85                 }
86         },
87 };
88
89 #endif