Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / media / platform / qcom / camss-8x16 / camss-csiphy.h
blobba87811220654fc7218e366170da7c1ab628e486
1 /*
2 * camss-csiphy.h
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
31 struct csiphy_lane {
32 u8 pos;
33 u8 pol;
36 struct csiphy_lanes_cfg {
37 int num_data;
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 {
47 u8 combo_mode;
48 u8 csid_id;
49 struct csiphy_csi2_cfg *csi2;
52 struct csiphy_device {
53 u8 id;
54 struct v4l2_subdev subdev;
55 struct media_pad pads[MSM_CSIPHY_PADS_NUM];
56 void __iomem *base;
57 void __iomem *base_clk_mux;
58 u32 irq;
59 char irq_name[30];
60 struct camss_clock *clock;
61 int nclocks;
62 u32 timer_clk_rate;
63 struct csiphy_config cfg;
64 struct v4l2_mbus_framefmt fmt[MSM_CSIPHY_PADS_NUM];
67 struct resources;
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 */