4 * Qualcomm MSM Camera Subsystem - ISPIF (ISP Interface) Module
6 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
7 * Copyright (C) 2015-2017 Linaro Ltd.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 and
11 * only version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 #ifndef QC_MSM_CAMSS_ISPIF_H
19 #define QC_MSM_CAMSS_ISPIF_H
21 #include <linux/clk.h>
22 #include <media/media-entity.h>
23 #include <media/v4l2-device.h>
24 #include <media/v4l2-subdev.h>
26 /* Number of ISPIF lines - same as number of CSID hardware modules */
27 #define MSM_ISPIF_LINE_NUM 2
29 #define MSM_ISPIF_PAD_SINK 0
30 #define MSM_ISPIF_PAD_SRC 1
31 #define MSM_ISPIF_PADS_NUM 2
33 #define MSM_ISPIF_VFE_NUM 1
43 struct ispif_intf_cmd_reg
{
52 enum ispif_intf interface
;
53 struct v4l2_subdev subdev
;
54 struct media_pad pads
[MSM_ISPIF_PADS_NUM
];
55 struct v4l2_mbus_framefmt fmt
[MSM_ISPIF_PADS_NUM
];
60 void __iomem
*base_clk_mux
;
63 struct camss_clock
*clock
;
65 struct camss_clock
*clock_for_reset
;
66 int nclocks_for_reset
;
67 struct completion reset_complete
;
69 struct mutex power_lock
;
70 struct ispif_intf_cmd_reg intf_cmd
[MSM_ISPIF_VFE_NUM
];
71 struct mutex config_lock
;
72 struct ispif_line line
[MSM_ISPIF_LINE_NUM
];
75 struct resources_ispif
;
77 int msm_ispif_subdev_init(struct ispif_device
*ispif
,
78 const struct resources_ispif
*res
);
80 int msm_ispif_register_entities(struct ispif_device
*ispif
,
81 struct v4l2_device
*v4l2_dev
);
83 void msm_ispif_unregister_entities(struct ispif_device
*ispif
);
85 #endif /* QC_MSM_CAMSS_ISPIF_H */