4 * Qualcomm MSM Camera Subsystem - CSID Module
6 * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
7 * Copyright (C) 2015-2016 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_CSID_H
19 #define QC_MSM_CAMSS_CSID_H
21 #include <linux/clk.h>
22 #include <media/media-entity.h>
23 #include <media/v4l2-ctrls.h>
24 #include <media/v4l2-device.h>
25 #include <media/v4l2-mediabus.h>
26 #include <media/v4l2-subdev.h>
28 #define MSM_CSID_PAD_SINK 0
29 #define MSM_CSID_PAD_SRC 1
30 #define MSM_CSID_PADS_NUM 2
32 enum csid_payload_mode {
33 CSID_PAYLOAD_MODE_INCREMENTING = 0,
34 CSID_PAYLOAD_MODE_ALTERNATING_55_AA = 1,
35 CSID_PAYLOAD_MODE_ALL_ZEROES = 2,
36 CSID_PAYLOAD_MODE_ALL_ONES = 3,
37 CSID_PAYLOAD_MODE_RANDOM = 4,
38 CSID_PAYLOAD_MODE_USER_SPECIFIED = 5,
41 struct csid_testgen_config {
43 enum csid_payload_mode payload_mode;
46 struct csid_phy_config {
56 struct v4l2_subdev subdev;
57 struct media_pad pads[MSM_CSID_PADS_NUM];
64 struct regulator *vdda;
65 struct completion reset_complete;
66 struct csid_testgen_config testgen;
67 struct csid_phy_config phy;
68 struct v4l2_mbus_framefmt fmt[MSM_CSID_PADS_NUM];
69 struct v4l2_ctrl_handler ctrls;
70 struct v4l2_ctrl *testgen_mode;
75 int msm_csid_subdev_init(struct csid_device *csid, struct camss *camss,
76 struct resources *res, u8 id);
78 int msm_csid_register_entities(struct csid_device *csid,
79 struct v4l2_device *v4l2_dev);
81 void msm_csid_unregister_entities(struct csid_device *csid);
83 #endif /* QC_MSM_CAMSS_CSID_H */