4 * Qualcomm MSM Camera Subsystem - CSIPHY Module
6 * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
7 * Copyright (C) 2016-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_CSIPHY_H
19 #define QC_MSM_CAMSS_CSIPHY_H
21 #include <linux/clk.h>
22 #include <media/media-entity.h>
23 #include <media/v4l2-device.h>
24 #include <media/v4l2-mediabus.h>
25 #include <media/v4l2-subdev.h>
27 #define MSM_CSIPHY_PAD_SINK 0
28 #define MSM_CSIPHY_PAD_SRC 1
29 #define MSM_CSIPHY_PADS_NUM 2
36 struct csiphy_lanes_cfg
{
38 struct csiphy_lane
*data
;
39 struct csiphy_lane clk
;
42 struct csiphy_csi2_cfg
{
43 struct csiphy_lanes_cfg lane_cfg
;
46 struct csiphy_config
{
49 struct csiphy_csi2_cfg
*csi2
;
52 struct csiphy_device
{
54 struct v4l2_subdev subdev
;
55 struct media_pad pads
[MSM_CSIPHY_PADS_NUM
];
57 void __iomem
*base_clk_mux
;
60 struct camss_clock
*clock
;
63 struct csiphy_config cfg
;
64 struct v4l2_mbus_framefmt fmt
[MSM_CSIPHY_PADS_NUM
];
69 int msm_csiphy_subdev_init(struct csiphy_device
*csiphy
,
70 const struct resources
*res
, u8 id
);
72 int msm_csiphy_register_entity(struct csiphy_device
*csiphy
,
73 struct v4l2_device
*v4l2_dev
);
75 void msm_csiphy_unregister_entity(struct csiphy_device
*csiphy
);
77 #endif /* QC_MSM_CAMSS_CSIPHY_H */