4 * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
6 * Copyright (c) 2011-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_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
{
54 struct v4l2_subdev subdev
;
55 struct media_pad pads
[MSM_CSID_PADS_NUM
];
59 struct camss_clock
*clock
;
61 struct regulator
*vdda
;
62 struct completion reset_complete
;
63 struct csid_testgen_config testgen
;
64 struct csid_phy_config phy
;
65 struct v4l2_mbus_framefmt fmt
[MSM_CSID_PADS_NUM
];
66 struct v4l2_ctrl_handler ctrls
;
67 struct v4l2_ctrl
*testgen_mode
;
72 int msm_csid_subdev_init(struct csid_device
*csid
,
73 const struct resources
*res
, u8 id
);
75 int msm_csid_register_entity(struct csid_device
*csid
,
76 struct v4l2_device
*v4l2_dev
);
78 void msm_csid_unregister_entity(struct csid_device
*csid
);
80 void msm_csid_get_csid_id(struct media_entity
*entity
, u8
*id
);
82 #endif /* QC_MSM_CAMSS_CSID_H */