camss.h (b873663bd85fff5e43bcedb5cc5360f2aa992e05) camss.h (9c3e59de6041f84294fbead39c85b5541ac7b361)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * camss.h
4 *
5 * Qualcomm MSM Camera Subsystem - Core
6 *
7 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
8 * Copyright (C) 2015-2018 Linaro Ltd.

--- 9 unchanged lines hidden (view full) ---

18#include <media/media-entity.h>
19#include <linux/device.h>
20
21#include "camss-csid.h"
22#include "camss-csiphy.h"
23#include "camss-ispif.h"
24#include "camss-vfe.h"
25
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * camss.h
4 *
5 * Qualcomm MSM Camera Subsystem - Core
6 *
7 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
8 * Copyright (C) 2015-2018 Linaro Ltd.

--- 9 unchanged lines hidden (view full) ---

18#include <media/media-entity.h>
19#include <linux/device.h>
20
21#include "camss-csid.h"
22#include "camss-csiphy.h"
23#include "camss-ispif.h"
24#include "camss-vfe.h"
25
26#define CAMSS_CSID_NUM 2
27#define CAMSS_CSIPHY_NUM 2
28
29#define to_camss(ptr_module) \
30 container_of(ptr_module, struct camss, ptr_module)
31
32#define to_device(ptr_module) \
33 (to_camss(ptr_module)->dev)
34
35#define module_pointer(ptr_module, index) \
36 ((const struct ptr_module##_device (*)[]) &(ptr_module[-(index)]))
37
38#define to_camss_index(ptr_module, index) \
39 container_of(module_pointer(ptr_module, index), \
40 struct camss, ptr_module)
41
42#define to_device_index(ptr_module, index) \
43 (to_camss_index(ptr_module, index)->dev)
44
26#define to_camss(ptr_module) \
27 container_of(ptr_module, struct camss, ptr_module)
28
29#define to_device(ptr_module) \
30 (to_camss(ptr_module)->dev)
31
32#define module_pointer(ptr_module, index) \
33 ((const struct ptr_module##_device (*)[]) &(ptr_module[-(index)]))
34
35#define to_camss_index(ptr_module, index) \
36 container_of(module_pointer(ptr_module, index), \
37 struct camss, ptr_module)
38
39#define to_device_index(ptr_module, index) \
40 (to_camss_index(ptr_module, index)->dev)
41
45#define CAMSS_RES_MAX 15
42#define CAMSS_RES_MAX 17
46
47struct resources {
48 char *regulator[CAMSS_RES_MAX];
49 char *clock[CAMSS_RES_MAX];
50 u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX];
51 char *reg[CAMSS_RES_MAX];
52 char *interrupt[CAMSS_RES_MAX];
53};
54
55struct resources_ispif {
56 char *clock[CAMSS_RES_MAX];
57 char *clock_for_reset[CAMSS_RES_MAX];
58 char *reg[CAMSS_RES_MAX];
59 char *interrupt;
60};
61
43
44struct resources {
45 char *regulator[CAMSS_RES_MAX];
46 char *clock[CAMSS_RES_MAX];
47 u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX];
48 char *reg[CAMSS_RES_MAX];
49 char *interrupt[CAMSS_RES_MAX];
50};
51
52struct resources_ispif {
53 char *clock[CAMSS_RES_MAX];
54 char *clock_for_reset[CAMSS_RES_MAX];
55 char *reg[CAMSS_RES_MAX];
56 char *interrupt;
57};
58
59enum camss_version {
60 CAMSS_8x16,
61 CAMSS_8x96,
62};
63
62struct camss {
64struct camss {
65 enum camss_version version;
63 struct v4l2_device v4l2_dev;
64 struct v4l2_async_notifier notifier;
65 struct media_device media_dev;
66 struct device *dev;
66 struct v4l2_device v4l2_dev;
67 struct v4l2_async_notifier notifier;
68 struct media_device media_dev;
69 struct device *dev;
67 struct csiphy_device csiphy[CAMSS_CSIPHY_NUM];
68 struct csid_device csid[CAMSS_CSID_NUM];
70 int csiphy_num;
71 struct csiphy_device *csiphy;
72 int csid_num;
73 struct csid_device *csid;
69 struct ispif_device ispif;
74 struct ispif_device ispif;
70 struct vfe_device vfe;
75 int vfe_num;
76 struct vfe_device *vfe;
71 atomic_t ref_count;
72};
73
74struct camss_camera_interface {
75 u8 csiphy_id;
76 struct csiphy_csi2_cfg csi2;
77};
78

--- 20 unchanged lines hidden ---
77 atomic_t ref_count;
78};
79
80struct camss_camera_interface {
81 u8 csiphy_id;
82 struct csiphy_csi2_cfg csi2;
83};
84

--- 20 unchanged lines hidden ---