2 * Support for Medifield PNW Camera Imaging ISP subsystem.
4 * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef __ATOMISP_CSI2_H__
22 #define __ATOMISP_CSI2_H__
24 #include <media/v4l2-subdev.h>
25 #include <media/v4l2-ctrls.h>
27 #define CSI2_PAD_SINK 0
28 #define CSI2_PAD_SOURCE 1
29 #define CSI2_PADS_NUM 2
31 #define CSI2_OUTPUT_ISP_SUBDEV (1 << 0)
32 #define CSI2_OUTPUT_MEMORY (1 << 1)
34 struct atomisp_device
;
36 struct atomisp_sub_device
;
38 struct atomisp_mipi_csi2_device
{
39 struct v4l2_subdev subdev
;
40 struct media_pad pads
[CSI2_PADS_NUM
];
41 struct v4l2_mbus_framefmt formats
[CSI2_PADS_NUM
];
43 struct v4l2_ctrl_handler ctrls
;
44 struct atomisp_device
*isp
;
46 u32 output
; /* output direction */
49 int atomisp_csi2_set_ffmt(struct v4l2_subdev
*sd
, struct v4l2_subdev_pad_config
*cfg
,
50 unsigned int which
, uint16_t pad
,
51 struct v4l2_mbus_framefmt
*ffmt
);
52 int atomisp_mipi_csi2_init(struct atomisp_device
*isp
);
53 void atomisp_mipi_csi2_cleanup(struct atomisp_device
*isp
);
54 void atomisp_mipi_csi2_unregister_entities(
55 struct atomisp_mipi_csi2_device
*csi2
);
56 int atomisp_mipi_csi2_register_entities(struct atomisp_mipi_csi2_device
*csi2
,
57 struct v4l2_device
*vdev
);
59 void atomisp_csi2_configure(struct atomisp_sub_device
*asd
);
61 #endif /* __ATOMISP_CSI2_H__ */