1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
7 * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
8 * Copyright (C) 2015-2018 Linaro Ltd.
10 #ifndef QC_MSM_CAMSS_CSID_H
11 #define QC_MSM_CAMSS_CSID_H
13 #include <linux/clk.h>
14 #include <media/media-entity.h>
15 #include <media/v4l2-ctrls.h>
16 #include <media/v4l2-device.h>
17 #include <media/v4l2-mediabus.h>
18 #include <media/v4l2-subdev.h>
20 #define MSM_CSID_PAD_SINK 0
21 #define MSM_CSID_PAD_SRC 1
22 #define MSM_CSID_PADS_NUM 2
24 enum csid_payload_mode
{
25 CSID_PAYLOAD_MODE_INCREMENTING
= 0,
26 CSID_PAYLOAD_MODE_ALTERNATING_55_AA
= 1,
27 CSID_PAYLOAD_MODE_ALL_ZEROES
= 2,
28 CSID_PAYLOAD_MODE_ALL_ONES
= 3,
29 CSID_PAYLOAD_MODE_RANDOM
= 4,
30 CSID_PAYLOAD_MODE_USER_SPECIFIED
= 5,
33 struct csid_testgen_config
{
35 enum csid_payload_mode payload_mode
;
38 struct csid_phy_config
{
47 struct v4l2_subdev subdev
;
48 struct media_pad pads
[MSM_CSID_PADS_NUM
];
52 struct camss_clock
*clock
;
54 struct regulator
*vdda
;
55 struct completion reset_complete
;
56 struct csid_testgen_config testgen
;
57 struct csid_phy_config phy
;
58 struct v4l2_mbus_framefmt fmt
[MSM_CSID_PADS_NUM
];
59 struct v4l2_ctrl_handler ctrls
;
60 struct v4l2_ctrl
*testgen_mode
;
61 const struct csid_format
*formats
;
62 unsigned int nformats
;
67 int msm_csid_subdev_init(struct camss
*camss
, struct csid_device
*csid
,
68 const struct resources
*res
, u8 id
);
70 int msm_csid_register_entity(struct csid_device
*csid
,
71 struct v4l2_device
*v4l2_dev
);
73 void msm_csid_unregister_entity(struct csid_device
*csid
);
75 void msm_csid_get_csid_id(struct media_entity
*entity
, u8
*id
);
77 #endif /* QC_MSM_CAMSS_CSID_H */