1
v7:
2
- Due to the patches in https://lore.kernel.org/all/20241217140656.965235-1-quic_vikramsa@quicinc.com/
3
are merged, so rebased below patches to fix the conflict.
4
media: qcom: camss: csiphy-3ph: Remove redundant PHY init sequence control loop
5
media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct
6
media: qcom: camss: Add sm8550 compatible
7
media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct
8
media: qcom: camss: csiphy-3ph: Add Gen2 v2.1.2 two-phase MIPI CSI-2 DPHY support
9
media: qcom: camss: Add support for VFE 780
10
- Add RB for "media: qcom: camss: Add CSID 780 support" - Bryan
11
- Use TAG name for ICC and remove offline HW ICC - Bryan
12
- Remove the logic that moving enable_irq();/disable_irq(); to wm_start()
13
and wm_stop() to make sure no logical change in VFE refactor change.
14
- Update the commit message and title for the TPG change. - Bryan
15
- Link to v6: https://lore.kernel.org/all/20241211140738.3835588-1-quic_depengs@quicinc.com/
16
17
v6:
18
- Add bus type property in dt-binding which will be limited
19
by a latest change
20
https://lore.kernel.org/all/20241209-camss-dphy-v1-0-5f1b6f25ed92@fairphone.com/
21
- Add RB for "media: qcom: camss: Add sm8550 compatible" and
22
"media: qcom: camss: Add support for VFE 780"
23
- Uppercase the hex in csiphy register list - Bryan
24
- Add empty function for csid tpg - Vladimir
25
- Set testgen mode to CSID_PAYLOAD_MODE_DISABLED in subdev init interface
26
- encapsulate the guard __thus__ for new header - Bryan
27
- Add a standalone patch for the platform which doesn't support CSID TPG
28
to make sure new platform driver can set CSID_PAYLOAD_MODE_DISABLED
29
to disable TPG
30
- Update the csid for csid and vfe driver - Bryan
31
- Link to v5: https://lore.kernel.org/all/20241205155538.250743-1-quic_depengs@quicinc.com/
32
33
v5:
34
- Update dt-bindings required items order - Krzysztof
35
- Sort the reg order based on the comments in sc7280 dt-binding - Vladimir
36
- Change the irq type to IRQ_TYPE_EDGE_RISING - Vladimir
37
- Remove the Krzysztof's RB tag from dt-binding patch due to above
38
updates in dt-binding patch
39
- Move regulator from csid resource to csiphy resource - Bryan, Vladimir
40
- Move the change to add default case in vfe_src_pad_code to a
41
standalone patch. - Bryan
42
- Rename csid-gen3 as csid-780 - Bryan
43
- use macros() to bury bit shifts - Bryan
44
- Sort the macros by register offset order - Vladimir
45
- Redefine a macro for rup_aup in csid driver - Vladimir
46
- Remove the unused macros in vfe 780 driver - Vladimir
47
- Add dummy function for unsupported hw_ops in vfe 780
48
driver - Vladimir, Bryan
49
- Use a standalone patch for the callback API of RUP and buf done update
50
- Use a standalone patch to make CSID TPG optional - Vladimir
51
- Link to v4: https://lore.kernel.org/all/20240812144131.369378-1-quic_depengs@quicinc.com/
52
1
v4:
53
v4:
2
- Update dt-bindings based on comments - Krzysztof, bod, Vladimir
54
- Update dt-bindings based on comments - Krzysztof, bod, Vladimir
3
- Move common code into csid core and vfe core driver - bod
55
- Move common code into csid core and vfe core driver - bod
4
- Remove *_relaxed in the csid and vfe drivers - Krzysztof
56
- Remove *_relaxed in the csid and vfe drivers - Krzysztof
5
- Reorganize patches in logical junks, make sure that new added
57
- Reorganize patches in logical junks, make sure that new added
...
...
45
- 2 x VFE Lite, 4 RDI per VFE
97
- 2 x VFE Lite, 4 RDI per VFE
46
- 3 x CSID
98
- 3 x CSID
47
- 2 x CSID Lite
99
- 2 x CSID Lite
48
- 8 x CSI PHY
100
- 8 x CSI PHY
49
101
50
---
51
Bryan O'Donoghue (6):
102
Bryan O'Donoghue (6):
52
media: qcom: camss: csiphy-3ph: Fix trivial indentation fault in
103
media: qcom: camss: csiphy-3ph: Fix trivial indentation fault in
53
defines
104
defines
54
media: qcom: camss: csiphy-3ph: Remove redundant PHY init sequence
105
media: qcom: camss: csiphy-3ph: Remove redundant PHY init sequence
55
control loop
106
control loop
...
...
58
media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field
109
media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field
59
inside csiphy struct
110
inside csiphy struct
60
media: qcom: camss: csiphy-3ph: Use an offset variable to find common
111
media: qcom: camss: csiphy-3ph: Use an offset variable to find common
61
control regs
112
control regs
62
113
63
Depeng Shao (7):
114
Depeng Shao (10):
64
dt-bindings: media: camss: Add qcom,sm8550-camss binding
65
media: qcom: camss: csid: Move common code into csid core
115
media: qcom: camss: csid: Move common code into csid core
66
media: qcom: camss: vfe: Move common code into vfe core
116
media: qcom: camss: vfe: Move common code into vfe core
117
media: qcom: camss: Add callback API for RUP update and buf done
118
media: qcom: camss: Add default case in vfe_src_pad_code
119
media: qcom: camss: csid: Only add TPG v4l2 ctrl if TPG hardware is
120
available
121
dt-bindings: media: camss: Add qcom,sm8550-camss binding
67
media: qcom: camss: Add sm8550 compatible
122
media: qcom: camss: Add sm8550 compatible
68
media: qcom: camss: csiphy-3ph: Add Gen2 v2.1.2 two-phase MIPI CSI-2
123
media: qcom: camss: csiphy-3ph: Add Gen2 v2.1.2 two-phase MIPI CSI-2
69
DPHY support
124
DPHY support
70
media: qcom: camss: Add CSID Gen3 support for sm8550
125
media: qcom: camss: Add CSID 780 support
71
media: qcom: camss: Add support for VFE hardware version Titan 780
126
media: qcom: camss: Add support for VFE 780
72
127
73
.../bindings/media/qcom,sm8550-camss.yaml | 517 ++++++++++++
128
.../bindings/media/qcom,sm8550-camss.yaml | 597 +++++++++++++
74
drivers/media/platform/qcom/camss/Makefile | 2 +
129
drivers/media/platform/qcom/camss/Makefile | 2 +
75
.../platform/qcom/camss/camss-csid-4-1.c | 19 -
130
.../platform/qcom/camss/camss-csid-4-1.c | 19 -
76
.../platform/qcom/camss/camss-csid-4-7.c | 42 -
131
.../platform/qcom/camss/camss-csid-4-7.c | 42 -
132
.../platform/qcom/camss/camss-csid-780.c | 337 ++++++++
133
.../platform/qcom/camss/camss-csid-780.h | 25 +
77
.../platform/qcom/camss/camss-csid-gen2.c | 60 --
134
.../platform/qcom/camss/camss-csid-gen2.c | 60 --
78
.../platform/qcom/camss/camss-csid-gen3.c | 339 ++++++++
135
.../media/platform/qcom/camss/camss-csid.c | 137 ++-
79
.../platform/qcom/camss/camss-csid-gen3.h | 26 +
80
.../media/platform/qcom/camss/camss-csid.c | 123 ++-
81
.../media/platform/qcom/camss/camss-csid.h | 31 +
136
.../media/platform/qcom/camss/camss-csid.h | 31 +
82
.../qcom/camss/camss-csiphy-2ph-1-0.c | 6 +
137
.../qcom/camss/camss-csiphy-2ph-1-0.c | 6 +
83
.../qcom/camss/camss-csiphy-3ph-1-0.c | 796 ++++++++++--------
138
.../qcom/camss/camss-csiphy-3ph-1-0.c | 794 ++++++++++--------
84
.../media/platform/qcom/camss/camss-csiphy.c | 4 +
139
.../media/platform/qcom/camss/camss-csiphy.c | 4 +
85
.../media/platform/qcom/camss/camss-csiphy.h | 2 +
140
.../media/platform/qcom/camss/camss-csiphy.h | 8 +
86
.../media/platform/qcom/camss/camss-vfe-17x.c | 112 +--
141
.../media/platform/qcom/camss/camss-vfe-17x.c | 112 +--
87
.../media/platform/qcom/camss/camss-vfe-4-1.c | 9 -
142
.../media/platform/qcom/camss/camss-vfe-4-1.c | 9 -
88
.../media/platform/qcom/camss/camss-vfe-4-7.c | 11 -
143
.../media/platform/qcom/camss/camss-vfe-4-7.c | 11 -
89
.../media/platform/qcom/camss/camss-vfe-4-8.c | 11 -
144
.../media/platform/qcom/camss/camss-vfe-4-8.c | 11 -
90
.../media/platform/qcom/camss/camss-vfe-480.c | 258 +-----
145
.../media/platform/qcom/camss/camss-vfe-480.c | 274 +-----
91
.../media/platform/qcom/camss/camss-vfe-780.c | 148 ++++
146
.../media/platform/qcom/camss/camss-vfe-780.c | 159 ++++
92
drivers/media/platform/qcom/camss/camss-vfe.c | 301 ++++++-
147
drivers/media/platform/qcom/camss/camss-vfe.c | 274 ++++++
93
drivers/media/platform/qcom/camss/camss-vfe.h | 59 +-
148
drivers/media/platform/qcom/camss/camss-vfe.h | 59 +-
94
drivers/media/platform/qcom/camss/camss.c | 365 ++++++++
149
drivers/media/platform/qcom/camss/camss.c | 359 ++++++++
95
drivers/media/platform/qcom/camss/camss.h | 5 +
150
drivers/media/platform/qcom/camss/camss.h | 4 +
96
23 files changed, 2379 insertions(+), 867 deletions(-)
151
23 files changed, 2464 insertions(+), 870 deletions(-)
97
create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
152
create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
98
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-gen3.c
153
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-780.c
99
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-gen3.h
154
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-780.h
100
create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-780.c
155
create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-780.c
101
156
102
157
103
base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba
158
base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
104
--
159
--
105
2.34.1
160
2.34.1
diff view generated by jsdifflib
1
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
1
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2
2
3
Replace space with tab in define indentations.
3
Replace space with tab in define indentations.
4
4
5
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
7
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
8
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
8
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
9
---
9
---
10
.../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 14 +++++++-------
10
.../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 14 +++++++-------
11
1 file changed, 7 insertions(+), 7 deletions(-)
11
1 file changed, 7 insertions(+), 7 deletions(-)
12
12
13
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
13
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
14
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
15
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
15
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
16
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
16
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
17
@@ -XXX,XX +XXX,XX @@
17
@@ -XXX,XX +XXX,XX @@
18
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID    BIT(1)
18
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID    BIT(1)
19
#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(n)    (0x8b0 + 0x4 * (n))
19
#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(n)    (0x8b0 + 0x4 * (n))
20
20
21
-#define CSIPHY_DEFAULT_PARAMS 0
21
-#define CSIPHY_DEFAULT_PARAMS 0
22
-#define CSIPHY_LANE_ENABLE 1
22
-#define CSIPHY_LANE_ENABLE 1
23
-#define CSIPHY_SETTLE_CNT_LOWER_BYTE 2
23
-#define CSIPHY_SETTLE_CNT_LOWER_BYTE 2
24
-#define CSIPHY_SETTLE_CNT_HIGHER_BYTE 3
24
-#define CSIPHY_SETTLE_CNT_HIGHER_BYTE 3
25
-#define CSIPHY_DNP_PARAMS 4
25
-#define CSIPHY_DNP_PARAMS 4
26
-#define CSIPHY_2PH_REGS 5
26
-#define CSIPHY_2PH_REGS 5
27
-#define CSIPHY_3PH_REGS 6
27
-#define CSIPHY_3PH_REGS 6
28
+#define CSIPHY_DEFAULT_PARAMS        0
28
+#define CSIPHY_DEFAULT_PARAMS        0
29
+#define CSIPHY_LANE_ENABLE        1
29
+#define CSIPHY_LANE_ENABLE        1
30
+#define CSIPHY_SETTLE_CNT_LOWER_BYTE    2
30
+#define CSIPHY_SETTLE_CNT_LOWER_BYTE    2
31
+#define CSIPHY_SETTLE_CNT_HIGHER_BYTE    3
31
+#define CSIPHY_SETTLE_CNT_HIGHER_BYTE    3
32
+#define CSIPHY_DNP_PARAMS        4
32
+#define CSIPHY_DNP_PARAMS        4
33
+#define CSIPHY_2PH_REGS            5
33
+#define CSIPHY_2PH_REGS            5
34
+#define CSIPHY_3PH_REGS            6
34
+#define CSIPHY_3PH_REGS            6
35
35
36
struct csiphy_reg_t {
36
struct csiphy_reg_t {
37
    s32 reg_addr;
37
    s32 reg_addr;
38
--
38
--
39
2.34.1
39
2.34.1
diff view generated by jsdifflib
...
...
23
Reduce the array declaration down to one flat aggregate init and let the
23
Reduce the array declaration down to one flat aggregate init and let the
24
code just step through. As a happy side-effect we can then also handle
24
code just step through. As a happy side-effect we can then also handle
25
odd-number writes as the number of elements in the init sequence will no
25
odd-number writes as the number of elements in the init sequence will no
26
longer have to be evenly divisible.
26
longer have to be evenly divisible.
27
27
28
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
29
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
28
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
30
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
29
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
31
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
30
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
31
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
32
---
32
---
33
.../qcom/camss/camss-csiphy-3ph-1-0.c | 554 +++++++++---------
33
.../qcom/camss/camss-csiphy-3ph-1-0.c | 558 +++++++++---------
34
1 file changed, 261 insertions(+), 293 deletions(-)
34
1 file changed, 263 insertions(+), 295 deletions(-)
35
35
36
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
36
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
37
index XXXXXXX..XXXXXXX 100644
37
index XXXXXXX..XXXXXXX 100644
38
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
38
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
39
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
39
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
...
...
575
-    int i, l, array_size;
575
-    int i, l, array_size;
576
+    int i, array_size;
576
+    int i, array_size;
577
    u32 val;
577
    u32 val;
578
578
579
    switch (csiphy->camss->res->version) {
579
    switch (csiphy->camss->res->version) {
580
    case CAMSS_845:
580
    case CAMSS_7280:
581
-        r = &lane_regs_sdm845[0][0];
581
-        r = &lane_regs_sm8250[0][0];
582
-        array_size = ARRAY_SIZE(lane_regs_sdm845[0]);
582
-        array_size = ARRAY_SIZE(lane_regs_sm8250[0]);
583
+        r = &lane_regs_sdm845[0];
583
+        r = &lane_regs_sm8250[0];
584
+        array_size = ARRAY_SIZE(lane_regs_sdm845);
584
+        array_size = ARRAY_SIZE(lane_regs_sm8250);
585
        break;
585
        break;
586
    case CAMSS_8250:
586
    case CAMSS_8250:
587
-        r = &lane_regs_sm8250[0][0];
587
-        r = &lane_regs_sm8250[0][0];
588
-        array_size = ARRAY_SIZE(lane_regs_sm8250[0]);
588
-        array_size = ARRAY_SIZE(lane_regs_sm8250[0]);
589
+        r = &lane_regs_sm8250[0];
589
+        r = &lane_regs_sm8250[0];
...
...
593
-        r = &lane_regs_sc8280xp[0][0];
593
-        r = &lane_regs_sc8280xp[0][0];
594
-        array_size = ARRAY_SIZE(lane_regs_sc8280xp[0]);
594
-        array_size = ARRAY_SIZE(lane_regs_sc8280xp[0]);
595
+        r = &lane_regs_sc8280xp[0];
595
+        r = &lane_regs_sc8280xp[0];
596
+        array_size = ARRAY_SIZE(lane_regs_sc8280xp);
596
+        array_size = ARRAY_SIZE(lane_regs_sc8280xp);
597
        break;
597
        break;
598
    case CAMSS_845:
599
-        r = &lane_regs_sdm845[0][0];
600
-        array_size = ARRAY_SIZE(lane_regs_sdm845[0]);
601
+        r = &lane_regs_sdm845[0];
602
+        array_size = ARRAY_SIZE(lane_regs_sdm845);
603
        break;
598
    default:
604
    default:
599
        WARN(1, "unknown cspi version\n");
605
        WARN(1, "unknown cspi version\n");
600
        return;
606
        return;
601
    }
607
    }
602
608
...
...
diff view generated by jsdifflib
1
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
1
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2
2
3
The existing structure captures the configuration of CSIPHY lane registers.
3
The existing structure captures the configuration of CSIPHY lane registers.
4
Rename to struct csiphy_lane_regs to reflect.
4
Rename to struct csiphy_lane_regs to reflect.
5
5
6
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
8
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
9
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
9
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
10
---
10
---
11
.../media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 10 +++++-----
11
.../media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 10 +++++-----
12
1 file changed, 5 insertions(+), 5 deletions(-)
12
1 file changed, 5 insertions(+), 5 deletions(-)
13
13
14
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
14
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
15
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
16
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
16
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
17
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
17
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
18
@@ -XXX,XX +XXX,XX @@
18
@@ -XXX,XX +XXX,XX @@
19
#define CSIPHY_2PH_REGS            5
19
#define CSIPHY_2PH_REGS            5
20
#define CSIPHY_3PH_REGS            6
20
#define CSIPHY_3PH_REGS            6
21
21
22
-struct csiphy_reg_t {
22
-struct csiphy_reg_t {
23
+struct csiphy_lane_regs {
23
+struct csiphy_lane_regs {
24
    s32 reg_addr;
24
    s32 reg_addr;
25
    s32 reg_data;
25
    s32 reg_data;
26
    s32 delay;
26
    s32 delay;
27
@@ -XXX,XX +XXX,XX @@ struct csiphy_reg_t {
27
@@ -XXX,XX +XXX,XX @@ struct csiphy_reg_t {
28
28
29
/* GEN2 1.0 2PH */
29
/* GEN2 1.0 2PH */
30
static const struct
30
static const struct
31
-csiphy_reg_t lane_regs_sdm845[] = {
31
-csiphy_reg_t lane_regs_sdm845[] = {
32
+csiphy_lane_regs lane_regs_sdm845[] = {
32
+csiphy_lane_regs lane_regs_sdm845[] = {
33
    {0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
33
    {0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
34
    {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
34
    {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
35
    {0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
35
    {0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
36
@@ -XXX,XX +XXX,XX @@ csiphy_reg_t lane_regs_sdm845[] = {
36
@@ -XXX,XX +XXX,XX @@ csiphy_reg_t lane_regs_sdm845[] = {
37
37
38
/* GEN2 1.1 2PH */
38
/* GEN2 1.1 2PH */
39
static const struct
39
static const struct
40
-csiphy_reg_t lane_regs_sc8280xp[] = {
40
-csiphy_reg_t lane_regs_sc8280xp[] = {
41
+csiphy_lane_regs lane_regs_sc8280xp[] = {
41
+csiphy_lane_regs lane_regs_sc8280xp[] = {
42
    {0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
42
    {0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
43
    {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
43
    {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
44
    {0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
44
    {0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
45
@@ -XXX,XX +XXX,XX @@ csiphy_reg_t lane_regs_sc8280xp[] = {
45
@@ -XXX,XX +XXX,XX @@ csiphy_reg_t lane_regs_sc8280xp[] = {
46
46
47
/* GEN2 1.2.1 2PH */
47
/* GEN2 1.2.1 2PH */
48
static const struct
48
static const struct
49
-csiphy_reg_t lane_regs_sm8250[] = {
49
-csiphy_reg_t lane_regs_sm8250[] = {
50
+csiphy_lane_regs lane_regs_sm8250[] = {
50
+csiphy_lane_regs lane_regs_sm8250[] = {
51
    {0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
51
    {0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
52
    {0x0900, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
52
    {0x0900, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
53
    {0x0908, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
53
    {0x0908, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
54
@@ -XXX,XX +XXX,XX @@ static void csiphy_gen1_config_lanes(struct csiphy_device *csiphy,
54
@@ -XXX,XX +XXX,XX @@ static void csiphy_gen1_config_lanes(struct csiphy_device *csiphy,
55
static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
55
static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
56
                 u8 settle_cnt)
56
                 u8 settle_cnt)
57
{
57
{
58
-    const struct csiphy_reg_t *r;
58
-    const struct csiphy_reg_t *r;
59
+    const struct csiphy_lane_regs *r;
59
+    const struct csiphy_lane_regs *r;
60
    int i, array_size;
60
    int i, array_size;
61
    u32 val;
61
    u32 val;
62
62
63
--
63
--
64
2.34.1
64
2.34.1
diff view generated by jsdifflib
...
...
5
then different platform can reuse the same CSIPHY driver. Later changes
5
then different platform can reuse the same CSIPHY driver. Later changes
6
will enumerate with enabling code.
6
will enumerate with enabling code.
7
7
8
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
8
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
9
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
9
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
10
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
10
---
11
---
11
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c | 6 ++++++
12
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c | 6 ++++++
12
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 6 ++++++
13
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 6 ++++++
13
drivers/media/platform/qcom/camss/camss-csiphy.c | 4 ++++
14
drivers/media/platform/qcom/camss/camss-csiphy.c | 4 ++++
14
drivers/media/platform/qcom/camss/camss-csiphy.h | 1 +
15
drivers/media/platform/qcom/camss/camss-csiphy.h | 1 +
...
...
diff view generated by jsdifflib
...
...
6
Move the existing lane configuration structure to an encapsulating
6
Move the existing lane configuration structure to an encapsulating
7
structure -> struct csiphy_device_regs which is derived from the .data
7
structure -> struct csiphy_device_regs which is derived from the .data
8
field populated at PHY init time, as opposed to calculated at lane
8
field populated at PHY init time, as opposed to calculated at lane
9
configuration.
9
configuration.
10
10
11
Reviewed-by: default avatarVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
11
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
12
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
12
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
13
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
13
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
14
---
14
---
15
.../qcom/camss/camss-csiphy-3ph-1-0.c | 55 ++++++++++++-------
15
.../qcom/camss/camss-csiphy-3ph-1-0.c | 54 ++++++++++---------
16
.../media/platform/qcom/camss/camss-csiphy.h | 1 +
16
.../media/platform/qcom/camss/camss-csiphy.h | 6 +++
17
2 files changed, 36 insertions(+), 20 deletions(-)
17
2 files changed, 36 insertions(+), 24 deletions(-)
18
18
19
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
19
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
20
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
21
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
21
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
22
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
22
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
23
@@ -XXX,XX +XXX,XX @@ struct csiphy_lane_regs {
24
    u32 csiphy_param_type;
25
};
26
27
+struct csiphy_device_regs {
28
+    const struct csiphy_lane_regs *lane_regs;
29
+    int lane_array_size;
30
+};
31
+
32
/* GEN2 1.0 2PH */
33
static const struct
34
csiphy_lane_regs lane_regs_sdm845[] = {
35
@@ -XXX,XX +XXX,XX @@ static void csiphy_gen1_config_lanes(struct csiphy_device *csiphy,
23
@@ -XXX,XX +XXX,XX @@ static void csiphy_gen1_config_lanes(struct csiphy_device *csiphy,
36
static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
24
static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
37
                 u8 settle_cnt)
25
                 u8 settle_cnt)
38
{
26
{
39
-    const struct csiphy_lane_regs *r;
27
-    const struct csiphy_lane_regs *r;
40
-    int i, array_size;
28
-    int i, array_size;
41
+    struct csiphy_device_regs *csiphy_regs = csiphy->data;
29
+    const struct csiphy_lane_regs *r = csiphy->regs->lane_regs;
42
+    const struct csiphy_lane_regs *r = csiphy_regs->lane_regs;
30
+    int i, array_size = csiphy->regs->lane_array_size;
43
+    int i, array_size = csiphy_regs->lane_array_size;
44
    u32 val;
31
    u32 val;
45
32
46
-    switch (csiphy->camss->res->version) {
33
-    switch (csiphy->camss->res->version) {
47
-    case CAMSS_845:
34
-    case CAMSS_7280:
48
-        r = &lane_regs_sdm845[0];
35
-        r = &lane_regs_sm8250[0];
49
-        array_size = ARRAY_SIZE(lane_regs_sdm845);
36
-        array_size = ARRAY_SIZE(lane_regs_sm8250);
50
-        break;
37
-        break;
51
-    case CAMSS_8250:
38
-    case CAMSS_8250:
52
-        r = &lane_regs_sm8250[0];
39
-        r = &lane_regs_sm8250[0];
53
-        array_size = ARRAY_SIZE(lane_regs_sm8250);
40
-        array_size = ARRAY_SIZE(lane_regs_sm8250);
54
-        break;
41
-        break;
55
-    case CAMSS_8280XP:
42
-    case CAMSS_8280XP:
56
-        r = &lane_regs_sc8280xp[0];
43
-        r = &lane_regs_sc8280xp[0];
57
-        array_size = ARRAY_SIZE(lane_regs_sc8280xp);
44
-        array_size = ARRAY_SIZE(lane_regs_sc8280xp);
45
-        break;
46
-    case CAMSS_845:
47
-        r = &lane_regs_sdm845[0];
48
-        array_size = ARRAY_SIZE(lane_regs_sdm845);
58
-        break;
49
-        break;
59
-    default:
50
-    default:
60
-        WARN(1, "unknown cspi version\n");
51
-        WARN(1, "unknown cspi version\n");
61
-        return;
52
-        return;
62
-    }
53
-    }
...
...
73
+
64
+
74
+    regs = devm_kmalloc(dev, sizeof(*regs), GFP_KERNEL);
65
+    regs = devm_kmalloc(dev, sizeof(*regs), GFP_KERNEL);
75
+    if (!regs)
66
+    if (!regs)
76
+        return -ENOMEM;
67
+        return -ENOMEM;
77
+
68
+
78
+    csiphy->data = regs;
69
+    csiphy->regs = regs;
79
+
70
+
80
+    switch (csiphy->camss->res->version) {
71
+    switch (csiphy->camss->res->version) {
81
+    case CAMSS_845:
72
+    case CAMSS_845:
82
+        regs->lane_regs = &lane_regs_sdm845[0];
73
+        regs->lane_regs = &lane_regs_sdm845[0];
83
+        regs->lane_array_size = ARRAY_SIZE(lane_regs_sdm845);
74
+        regs->lane_array_size = ARRAY_SIZE(lane_regs_sdm845);
84
+        break;
75
+        break;
76
+    case CAMSS_7280:
85
+    case CAMSS_8250:
77
+    case CAMSS_8250:
86
+        regs->lane_regs = &lane_regs_sm8250[0];
78
+        regs->lane_regs = &lane_regs_sm8250[0];
87
+        regs->lane_array_size = ARRAY_SIZE(lane_regs_sm8250);
79
+        regs->lane_array_size = ARRAY_SIZE(lane_regs_sm8250);
88
+        break;
80
+        break;
89
+    case CAMSS_8280XP:
81
+    case CAMSS_8280XP:
...
...
100
92
101
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
93
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
102
index XXXXXXX..XXXXXXX 100644
94
index XXXXXXX..XXXXXXX 100644
103
--- a/drivers/media/platform/qcom/camss/camss-csiphy.h
95
--- a/drivers/media/platform/qcom/camss/camss-csiphy.h
104
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
96
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
97
@@ -XXX,XX +XXX,XX @@ struct csiphy_subdev_resources {
98
    const struct csiphy_formats *formats;
99
};
100
101
+struct csiphy_device_regs {
102
+    const struct csiphy_lane_regs *lane_regs;
103
+    int lane_array_size;
104
+};
105
+
106
struct csiphy_device {
107
    struct camss *camss;
108
    u8 id;
105
@@ -XXX,XX +XXX,XX @@ struct csiphy_device {
109
@@ -XXX,XX +XXX,XX @@ struct csiphy_device {
106
    struct csiphy_config cfg;
110
    struct csiphy_config cfg;
107
    struct v4l2_mbus_framefmt fmt[MSM_CSIPHY_PADS_NUM];
111
    struct v4l2_mbus_framefmt fmt[MSM_CSIPHY_PADS_NUM];
108
    const struct csiphy_subdev_resources *res;
112
    const struct csiphy_subdev_resources *res;
109
+    void *data;
113
+    struct csiphy_device_regs *regs;
110
};
114
};
111
115
112
struct camss_subdev_resources;
116
struct camss_subdev_resources;
113
--
117
--
114
2.34.1
118
2.34.1
diff view generated by jsdifflib
...
...
10
'EXT' registers dropped but the lower-order lane config regs at offset 0x00
10
'EXT' registers dropped but the lower-order lane config regs at offset 0x00
11
and up the same as before.
11
and up the same as before.
12
12
13
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
13
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
14
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
14
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
15
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
15
---
16
---
16
.../qcom/camss/camss-csiphy-3ph-1-0.c | 68 ++++++++++++-------
17
.../qcom/camss/camss-csiphy-3ph-1-0.c | 67 ++++++++++++-------
17
1 file changed, 44 insertions(+), 24 deletions(-)
18
.../media/platform/qcom/camss/camss-csiphy.h | 1 +
19
2 files changed, 44 insertions(+), 24 deletions(-)
18
20
19
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
21
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
20
index XXXXXXX..XXXXXXX 100644
22
index XXXXXXX..XXXXXXX 100644
21
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
23
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
22
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
24
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
23
@@ -XXX,XX +XXX,XX @@
25
@@ -XXX,XX +XXX,XX @@
24
#define CSIPHY_3PH_LNn_CSI_LANE_CTRL15(n)    (0x03c + 0x100 * (n))
26
#define CSIPHY_3PH_LNn_CSI_LANE_CTRL15(n)    (0x03c + 0x100 * (n))
25
#define CSIPHY_3PH_LNn_CSI_LANE_CTRL15_SWI_SOT_SYMBOL    0xb8
27
#define CSIPHY_3PH_LNn_CSI_LANE_CTRL15_SWI_SOT_SYMBOL    0xb8
26
28
27
-#define CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(n)    (0x800 + 0x4 * (n))
29
-#define CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(n)    (0x800 + 0x4 * (n))
28
+#define CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(offset, n)    (offset + 0x4 * (n))
30
+#define CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(offset, n)    ((offset) + 0x4 * (n))
29
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE    BIT(7)
31
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE    BIT(7)
30
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B    BIT(0)
32
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B    BIT(0)
31
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID    BIT(1)
33
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID    BIT(1)
32
-#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(n)    (0x8b0 + 0x4 * (n))
34
-#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(n)    (0x8b0 + 0x4 * (n))
33
+#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n)    ((offset + 0xb0) + 0x4 * (n))
35
+#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n)    ((offset) + 0xb0 + 0x4 * (n))
34
36
35
#define CSIPHY_DEFAULT_PARAMS        0
37
#define CSIPHY_DEFAULT_PARAMS        0
36
#define CSIPHY_LANE_ENABLE        1
38
#define CSIPHY_LANE_ENABLE        1
37
@@ -XXX,XX +XXX,XX @@ struct csiphy_lane_regs {
38
struct csiphy_device_regs {
39
    const struct csiphy_lane_regs *lane_regs;
40
    int lane_array_size;
41
+    u32 offset;
42
};
43
44
/* GEN2 1.0 2PH */
45
@@ -XXX,XX +XXX,XX @@ csiphy_lane_regs lane_regs_sm8250[] = {
39
@@ -XXX,XX +XXX,XX @@ csiphy_lane_regs lane_regs_sm8250[] = {
46
static void csiphy_hw_version_read(struct csiphy_device *csiphy,
40
static void csiphy_hw_version_read(struct csiphy_device *csiphy,
47
                 struct device *dev)
41
                 struct device *dev)
48
{
42
{
49
+    struct csiphy_device_regs *regs = csiphy->data;
43
+    struct csiphy_device_regs *regs = csiphy->regs;
50
    u32 hw_version;
44
    u32 hw_version;
51
45
52
-    writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID,
46
-    writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID,
53
-     csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(6));
47
-     csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(6));
54
+    writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID, csiphy->base +
48
+    writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID, csiphy->base +
...
...
72
@@ -XXX,XX +XXX,XX @@ static void csiphy_hw_version_read(struct csiphy_device *csiphy,
66
@@ -XXX,XX +XXX,XX @@ static void csiphy_hw_version_read(struct csiphy_device *csiphy,
73
*/
67
*/
74
static void csiphy_reset(struct csiphy_device *csiphy)
68
static void csiphy_reset(struct csiphy_device *csiphy)
75
{
69
{
76
-    writel_relaxed(0x1, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(0));
70
-    writel_relaxed(0x1, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(0));
77
+    struct csiphy_device_regs *regs = csiphy->data;
71
+    struct csiphy_device_regs *regs = csiphy->regs;
78
+
72
+
79
+    writel_relaxed(0x1, csiphy->base +
73
+    writel_relaxed(0x1, csiphy->base +
80
+         CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0));
74
+         CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0));
81
    usleep_range(5000, 8000);
75
    usleep_range(5000, 8000);
82
-    writel_relaxed(0x0, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(0));
76
-    writel_relaxed(0x0, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(0));
...
...
85
}
79
}
86
80
87
static irqreturn_t csiphy_isr(int irq, void *dev)
81
static irqreturn_t csiphy_isr(int irq, void *dev)
88
{
82
{
89
    struct csiphy_device *csiphy = dev;
83
    struct csiphy_device *csiphy = dev;
90
+    struct csiphy_device_regs *regs = csiphy->data;
84
+    struct csiphy_device_regs *regs = csiphy->regs;
91
    int i;
85
    int i;
92
86
93
    for (i = 0; i < 11; i++) {
87
    for (i = 0; i < 11; i++) {
94
        int c = i + 22;
88
        int c = i + 22;
95
        u8 val = readl_relaxed(csiphy->base +
89
        u8 val = readl_relaxed(csiphy->base +
...
...
119
}
113
}
120
@@ -XXX,XX +XXX,XX @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy,
114
@@ -XXX,XX +XXX,XX @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy,
121
                s64 link_freq, u8 lane_mask)
115
                s64 link_freq, u8 lane_mask)
122
{
116
{
123
    struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg;
117
    struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg;
124
+    struct csiphy_device_regs *regs = csiphy->data;
118
+    struct csiphy_device_regs *regs = csiphy->regs;
125
    u8 settle_cnt;
119
    u8 settle_cnt;
126
    u8 val;
120
    u8 val;
127
    int i;
121
    int i;
128
@@ -XXX,XX +XXX,XX @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy,
122
@@ -XXX,XX +XXX,XX @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy,
129
    for (i = 0; i < c->num_data; i++)
123
    for (i = 0; i < c->num_data; i++)
...
...
163
}
157
}
164
158
165
static void csiphy_lanes_disable(struct csiphy_device *csiphy,
159
static void csiphy_lanes_disable(struct csiphy_device *csiphy,
166
                 struct csiphy_config *cfg)
160
                 struct csiphy_config *cfg)
167
{
161
{
168
+    struct csiphy_device_regs *regs = csiphy->data;
162
+    struct csiphy_device_regs *regs = csiphy->regs;
169
+
163
+
170
    writel_relaxed(0, csiphy->base +
164
    writel_relaxed(0, csiphy->base +
171
-             CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(5));
165
-             CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(5));
172
+             CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 5));
166
+             CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 5));
173
167
...
...
178
172
179
static int csiphy_init(struct csiphy_device *csiphy)
173
static int csiphy_init(struct csiphy_device *csiphy)
180
@@ -XXX,XX +XXX,XX @@ static int csiphy_init(struct csiphy_device *csiphy)
174
@@ -XXX,XX +XXX,XX @@ static int csiphy_init(struct csiphy_device *csiphy)
181
        return -ENOMEM;
175
        return -ENOMEM;
182
176
183
    csiphy->data = regs;
177
    csiphy->regs = regs;
184
+    regs->offset = 0x800;
178
+    regs->offset = 0x800;
185
179
186
    switch (csiphy->camss->res->version) {
180
    switch (csiphy->camss->res->version) {
187
    case CAMSS_845:
181
    case CAMSS_845:
182
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
183
index XXXXXXX..XXXXXXX 100644
184
--- a/drivers/media/platform/qcom/camss/camss-csiphy.h
185
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
186
@@ -XXX,XX +XXX,XX @@ struct csiphy_subdev_resources {
187
struct csiphy_device_regs {
188
    const struct csiphy_lane_regs *lane_regs;
189
    int lane_array_size;
190
+    u32 offset;
191
};
192
193
struct csiphy_device {
188
--
194
--
189
2.34.1
195
2.34.1
diff view generated by jsdifflib
1
The get hw version and src pad code functions can be common code in csid
1
The get hw version and src pad code functions can be common code in csid
2
core file, then the csid driver of different hw version can reuse them,
2
core file, then the csid driver of different hw version can reuse them,
3
rather than adding duplicate code in csid driver for each version.
3
rather than adding duplicate code in csid driver for each version.
4
4
5
Suggested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5
Suggested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
7
---
8
---
8
.../platform/qcom/camss/camss-csid-4-1.c | 19 -----
9
.../platform/qcom/camss/camss-csid-4-1.c | 19 -----
9
.../platform/qcom/camss/camss-csid-4-7.c | 42 ----------
10
.../platform/qcom/camss/camss-csid-4-7.c | 42 ----------
10
.../platform/qcom/camss/camss-csid-gen2.c | 60 ---------------
11
.../platform/qcom/camss/camss-csid-gen2.c | 60 ---------------
11
.../media/platform/qcom/camss/camss-csid.c | 77 +++++++++++++++++++
12
.../media/platform/qcom/camss/camss-csid.c | 77 +++++++++++++++++++
...
...
244
+    hw_version = readl_relaxed(csid->base + CSID_HW_VERSION);
245
+    hw_version = readl_relaxed(csid->base + CSID_HW_VERSION);
245
+    hw_gen = (hw_version >> HW_VERSION_GENERATION) & 0xF;
246
+    hw_gen = (hw_version >> HW_VERSION_GENERATION) & 0xF;
246
+    hw_rev = (hw_version >> HW_VERSION_REVISION) & 0xFFF;
247
+    hw_rev = (hw_version >> HW_VERSION_REVISION) & 0xFFF;
247
+    hw_step = (hw_version >> HW_VERSION_STEPPING) & 0xFFFF;
248
+    hw_step = (hw_version >> HW_VERSION_STEPPING) & 0xFFFF;
248
+    dev_info(csid->camss->dev, "CSID:%d HW Version = %u.%u.%u\n",
249
+    dev_info(csid->camss->dev, "CSID:%d HW Version = %u.%u.%u\n",
249
+        csid->id, hw_gen, hw_rev, hw_step);
250
+         csid->id, hw_gen, hw_rev, hw_step);
250
+
251
+
251
+    return hw_version;
252
+    return hw_version;
252
+}
253
+}
253
+
254
+
254
+/*
255
+/*
...
...
diff view generated by jsdifflib
...
...
3
this also can avoid adding duplicate code for new version supporting.
3
this also can avoid adding duplicate code for new version supporting.
4
4
5
Suggested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5
Suggested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
---
7
---
8
.../media/platform/qcom/camss/camss-vfe-17x.c | 112 +-------
8
.../media/platform/qcom/camss/camss-vfe-17x.c | 112 +------
9
.../media/platform/qcom/camss/camss-vfe-4-1.c | 9 -
9
.../media/platform/qcom/camss/camss-vfe-4-1.c | 9 -
10
.../media/platform/qcom/camss/camss-vfe-4-7.c | 11 -
10
.../media/platform/qcom/camss/camss-vfe-4-7.c | 11 -
11
.../media/platform/qcom/camss/camss-vfe-4-8.c | 11 -
11
.../media/platform/qcom/camss/camss-vfe-4-8.c | 11 -
12
.../media/platform/qcom/camss/camss-vfe-480.c | 258 +----------------
12
.../media/platform/qcom/camss/camss-vfe-480.c | 274 ++----------------
13
drivers/media/platform/qcom/camss/camss-vfe.c | 264 ++++++++++++++++++
13
drivers/media/platform/qcom/camss/camss-vfe.c | 268 +++++++++++++++++
14
drivers/media/platform/qcom/camss/camss-vfe.h | 58 +++-
14
drivers/media/platform/qcom/camss/camss-vfe.h | 58 +++-
15
7 files changed, 340 insertions(+), 383 deletions(-)
15
7 files changed, 361 insertions(+), 382 deletions(-)
16
16
17
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-17x.c b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
17
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-17x.c b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
18
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
19
--- a/drivers/media/platform/qcom/camss/camss-vfe-17x.c
19
--- a/drivers/media/platform/qcom/camss/camss-vfe-17x.c
20
+++ b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
20
+++ b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
...
...
521
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
521
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
522
-
522
-
523
-    vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
523
-    vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
524
-
524
-
525
-    return;
525
-    return;
526
-
526
+static const struct camss_video_ops vfe_video_ops_480 = {
527
+    .queue_buffer = vfe_queue_buffer_v2,
528
+    .flush_buffers = vfe_flush_buffers,
529
+};
530
527
-out_unlock:
531
-out_unlock:
528
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
532
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
529
-}
533
+static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
530
-
534
+{
535
+    vfe->video_ops = vfe_video_ops_480;
536
}
537
531
-/*
538
-/*
532
- * vfe_queue_buffer - Add empty buffer
539
- * vfe_queue_buffer - Add empty buffer
533
- * @vid: Video device structure
540
- * @vid: Video device structure
534
- * @buf: Buffer to be enqueued
541
- * @buf: Buffer to be enqueued
535
- *
542
- *
...
...
538
- *
545
- *
539
- * Return 0 on success or a negative error code otherwise
546
- * Return 0 on success or a negative error code otherwise
540
- */
547
- */
541
-static int vfe_queue_buffer(struct camss_video *vid,
548
-static int vfe_queue_buffer(struct camss_video *vid,
542
-             struct camss_buffer *buf)
549
-             struct camss_buffer *buf)
543
-{
550
+static void vfe_isr_read(struct vfe_device *vfe, u32 *value0, u32 *value1)
551
{
544
-    struct vfe_line *line = container_of(vid, struct vfe_line, video_out);
552
-    struct vfe_line *line = container_of(vid, struct vfe_line, video_out);
545
-    struct vfe_device *vfe = to_vfe(line);
553
-    struct vfe_device *vfe = to_vfe(line);
546
-    struct vfe_output *output;
554
-    struct vfe_output *output;
547
-    unsigned long flags;
555
-    unsigned long flags;
548
-
556
-
...
...
558
-    }
566
-    }
559
-
567
-
560
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
568
-    spin_unlock_irqrestore(&vfe->output_lock, flags);
561
-
569
-
562
-    return 0;
570
-    return 0;
563
-}
571
+    /* nop */
564
-
572
}
565
static const struct camss_video_ops vfe_video_ops_480 = {
573
574
-static const struct camss_video_ops vfe_video_ops_480 = {
566
-    .queue_buffer = vfe_queue_buffer,
575
-    .queue_buffer = vfe_queue_buffer,
567
+    .queue_buffer = vfe_queue_buffer_v2,
576
-    .flush_buffers = vfe_flush_buffers,
568
    .flush_buffers = vfe_flush_buffers,
577
-};
569
};
578
+static void vfe_violation_read(struct vfe_device *vfe)
570
579
+{
571
@@ -XXX,XX +XXX,XX @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
580
+    /* nop */
581
+}
582
583
-static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
584
+static void vfe_buf_done_480(struct vfe_device *vfe, int port_id)
585
{
586
-    vfe->video_ops = vfe_video_ops_480;
587
+    /* nop */
572
}
588
}
573
589
574
const struct vfe_hw_ops vfe_ops_480 = {
590
const struct vfe_hw_ops vfe_ops_480 = {
575
+    .enable_irq = vfe_enable_irq,
591
+    .enable_irq = vfe_enable_irq,
576
    .global_reset = vfe_global_reset,
592
    .global_reset = vfe_global_reset,
577
    .hw_version = vfe_hw_version,
593
    .hw_version = vfe_hw_version,
578
    .isr = vfe_isr,
594
    .isr = vfe_isr,
579
@@ -XXX,XX +XXX,XX @@ const struct vfe_hw_ops vfe_ops_480 = {
595
+    .isr_read = vfe_isr_read,
596
+    .reg_update = vfe_reg_update,
597
+    .reg_update_clear = vfe_reg_update_clear,
598
    .pm_domain_off = vfe_pm_domain_off,
580
    .pm_domain_on = vfe_pm_domain_on,
599
    .pm_domain_on = vfe_pm_domain_on,
581
    .subdev_init = vfe_subdev_init,
600
    .subdev_init = vfe_subdev_init,
582
    .vfe_disable = vfe_disable,
601
    .vfe_disable = vfe_disable,
583
-    .vfe_enable = vfe_enable,
602
-    .vfe_enable = vfe_enable,
584
+    .vfe_enable = vfe_enable_v2,
603
+    .vfe_enable = vfe_enable_v2,
585
    .vfe_halt = vfe_halt,
604
    .vfe_halt = vfe_halt,
605
+    .violation_read = vfe_violation_read,
586
+    .vfe_wm_start = vfe_wm_start,
606
+    .vfe_wm_start = vfe_wm_start,
587
    .vfe_wm_stop = vfe_wm_stop,
607
    .vfe_wm_stop = vfe_wm_stop,
608
+    .vfe_buf_done = vfe_buf_done_480,
588
+    .vfe_wm_update = vfe_wm_update,
609
+    .vfe_wm_update = vfe_wm_update,
589
+    .reg_update = vfe_reg_update,
590
+    .reg_update_clear = vfe_reg_update_clear,
591
};
610
};
592
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
611
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
593
index XXXXXXX..XXXXXXX 100644
612
index XXXXXXX..XXXXXXX 100644
594
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
613
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
595
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
614
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
...
...
635
+ * @wm: Write master id
654
+ * @wm: Write master id
636
+ */
655
+ */
637
+void vfe_buf_done(struct vfe_device *vfe, int wm)
656
+void vfe_buf_done(struct vfe_device *vfe, int wm)
638
+{
657
+{
639
+    struct vfe_line *line = &vfe->line[vfe->wm_output_map[wm]];
658
+    struct vfe_line *line = &vfe->line[vfe->wm_output_map[wm]];
659
+    const struct vfe_hw_ops *ops = vfe->res->hw_ops;
640
+    struct camss_buffer *ready_buf;
660
+    struct camss_buffer *ready_buf;
641
+    struct vfe_output *output;
661
+    struct vfe_output *output;
642
+    unsigned long flags;
662
+    unsigned long flags;
643
+    u32 index;
663
+    u32 index;
644
+    u64 ts = ktime_get_ns();
664
+    u64 ts = ktime_get_ns();
...
...
668
+        index = 1;
688
+        index = 1;
669
+
689
+
670
+    output->buf[index] = vfe_buf_get_pending(output);
690
+    output->buf[index] = vfe_buf_get_pending(output);
671
+
691
+
672
+    if (output->buf[index]) {
692
+    if (output->buf[index]) {
673
+        vfe->res->hw_ops->vfe_wm_update(vfe, output->wm_idx[0],
693
+        ops->vfe_wm_update(vfe, output->wm_idx[0],
674
+                        output->buf[index]->addr[0],
694
+                 output->buf[index]->addr[0],
675
+                        line);
695
+                 line);
676
+        vfe->res->hw_ops->reg_update(vfe, line->id);
696
+        ops->reg_update(vfe, line->id);
677
+    } else
697
+    } else {
678
+        output->gen2.active_num--;
698
+        output->gen2.active_num--;
699
+    }
679
+
700
+
680
+    spin_unlock_irqrestore(&vfe->output_lock, flags);
701
+    spin_unlock_irqrestore(&vfe->output_lock, flags);
681
+
702
+
682
+    vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
703
+    vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
683
+
704
+
...
...
757
+int vfe_queue_buffer_v2(struct camss_video *vid,
778
+int vfe_queue_buffer_v2(struct camss_video *vid,
758
+            struct camss_buffer *buf)
779
+            struct camss_buffer *buf)
759
+{
780
+{
760
+    struct vfe_line *line = container_of(vid, struct vfe_line, video_out);
781
+    struct vfe_line *line = container_of(vid, struct vfe_line, video_out);
761
+    struct vfe_device *vfe = to_vfe(line);
782
+    struct vfe_device *vfe = to_vfe(line);
783
+    const struct vfe_hw_ops *ops = vfe->res->hw_ops;
762
+    struct vfe_output *output;
784
+    struct vfe_output *output;
763
+    unsigned long flags;
785
+    unsigned long flags;
764
+
786
+
765
+    output = &line->output;
787
+    output = &line->output;
766
+
788
+
767
+    spin_lock_irqsave(&vfe->output_lock, flags);
789
+    spin_lock_irqsave(&vfe->output_lock, flags);
768
+
790
+
769
+    if (output->state == VFE_OUTPUT_ON &&
791
+    if (output->state == VFE_OUTPUT_ON &&
770
+        output->gen2.active_num < 2) {
792
+     output->gen2.active_num < 2) {
771
+        output->buf[output->gen2.active_num++] = buf;
793
+        output->buf[output->gen2.active_num++] = buf;
772
+        vfe->res->hw_ops->vfe_wm_update(vfe, output->wm_idx[0],
794
+        ops->vfe_wm_update(vfe, output->wm_idx[0],
773
+                        buf->addr[0], line);
795
+                 buf->addr[0], line);
774
+        vfe->res->hw_ops->reg_update(vfe, line->id);
796
+        ops->reg_update(vfe, line->id);
775
+    } else {
797
+    } else {
776
+        vfe_buf_add_pending(output, buf);
798
+        vfe_buf_add_pending(output, buf);
777
+    }
799
+    }
778
+
800
+
779
+    spin_unlock_irqrestore(&vfe->output_lock, flags);
801
+    spin_unlock_irqrestore(&vfe->output_lock, flags);
...
...
788
+ * Return 0 on success or a negative error code otherwise
810
+ * Return 0 on success or a negative error code otherwise
789
+ */
811
+ */
790
+int vfe_enable_v2(struct vfe_line *line)
812
+int vfe_enable_v2(struct vfe_line *line)
791
+{
813
+{
792
+    struct vfe_device *vfe = to_vfe(line);
814
+    struct vfe_device *vfe = to_vfe(line);
815
+    const struct vfe_hw_ops *ops = vfe->res->hw_ops;
793
+    int ret;
816
+    int ret;
794
+
817
+
795
+    mutex_lock(&vfe->stream_lock);
818
+    mutex_lock(&vfe->stream_lock);
796
+
819
+
797
+    if (vfe->res->hw_ops->enable_irq)
820
+    if (vfe->res->hw_ops->enable_irq)
798
+        vfe->res->hw_ops->enable_irq(vfe);
821
+        ops->enable_irq(vfe);
799
+
822
+
800
+    vfe->stream_count++;
823
+    vfe->stream_count++;
801
+
824
+
802
+    mutex_unlock(&vfe->stream_lock);
825
+    mutex_unlock(&vfe->stream_lock);
803
+
826
+
...
...
diff view generated by jsdifflib
New patch
1
The RUP registers and buf done irq are moved from the IFE to CSID register
2
block on recent CAMSS implementations. Add callbacks structure to wrapper
3
the location change with minimum logic disruption.
1
4
5
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
---
9
.../media/platform/qcom/camss/camss-csid.h | 9 ++++++++
10
drivers/media/platform/qcom/camss/camss.c | 22 +++++++++++++++++++
11
drivers/media/platform/qcom/camss/camss.h | 3 +++
12
3 files changed, 34 insertions(+)
13
14
diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h
15
index XXXXXXX..XXXXXXX 100644
16
--- a/drivers/media/platform/qcom/camss/camss-csid.h
17
+++ b/drivers/media/platform/qcom/camss/camss-csid.h
18
@@ -XXX,XX +XXX,XX @@ struct csid_hw_ops {
19
     * @csid: CSID device
20
     */
21
    void (*subdev_init)(struct csid_device *csid);
22
+
23
+    /*
24
+     * reg_update - receive message from other sub device
25
+     * @csid: CSID device
26
+     * @port_id: Port id
27
+     * @is_clear: Indicate if it is clearing reg update or setting reg update
28
+     */
29
+    void (*reg_update)(struct csid_device *csid, int port_id, bool is_clear);
30
};
31
32
struct csid_subdev_resources {
33
@@ -XXX,XX +XXX,XX @@ struct csid_device {
34
    struct media_pad pads[MSM_CSID_PADS_NUM];
35
    void __iomem *base;
36
    u32 irq;
37
+    u32 reg_update;
38
    char irq_name[30];
39
    struct camss_clock *clock;
40
    int nclocks;
41
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
42
index XXXXXXX..XXXXXXX 100644
43
--- a/drivers/media/platform/qcom/camss/camss.c
44
+++ b/drivers/media/platform/qcom/camss/camss.c
45
@@ -XXX,XX +XXX,XX @@ static int camss_link_entities(struct camss *camss)
46
    return ret;
47
}
48
49
+void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
50
+{
51
+    struct csid_device *csid;
52
+
53
+    if (hw_id < camss->res->csid_num) {
54
+        csid = &camss->csid[hw_id];
55
+
56
+        csid->res->hw_ops->reg_update(csid, port_id, is_clear);
57
+    }
58
+}
59
+
60
+void camss_buf_done(struct camss *camss, int hw_id, int port_id)
61
+{
62
+    struct vfe_device *vfe;
63
+
64
+    if (hw_id < camss->res->vfe_num) {
65
+        vfe = &camss->vfe[hw_id];
66
+
67
+        vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
68
+    }
69
+}
70
+
71
/*
72
* camss_register_entities - Register subdev nodes and create links
73
* @camss: CAMSS device
74
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
75
index XXXXXXX..XXXXXXX 100644
76
--- a/drivers/media/platform/qcom/camss/camss.h
77
+++ b/drivers/media/platform/qcom/camss/camss.h
78
@@ -XXX,XX +XXX,XX @@ void camss_pm_domain_off(struct camss *camss, int id);
79
int camss_vfe_get(struct camss *camss, int id);
80
void camss_vfe_put(struct camss *camss, int id);
81
void camss_delete(struct camss *camss);
82
+void camss_buf_done(struct camss *camss, int hw_id, int port_id);
83
+void camss_reg_update(struct camss *camss, int hw_id,
84
+         int port_id, bool is_clear);
85
86
#endif /* QC_MSM_CAMSS_H */
87
--
88
2.34.1
diff view generated by jsdifflib
New patch
1
Add a default case in vfe_src_pad_code to get rid of a compile
2
warning if a new hw enum is added.
1
3
4
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
5
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
---
7
drivers/media/platform/qcom/camss/camss-vfe.c | 4 ++++
8
1 file changed, 4 insertions(+)
9
10
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
13
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
14
@@ -XXX,XX +XXX,XX @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
15
            return sink_code;
16
        }
17
        break;
18
+    default:
19
+        WARN(1, "Unsupported HW version: %x\n",
20
+         vfe->camss->res->version);
21
+        break;
22
    }
23
    return 0;
24
}
25
--
26
2.34.1
diff view generated by jsdifflib
New patch
1
There is no CSID TPG on some SoCs, so the v4l2 ctrl in CSID driver
2
shouldn't be registered. Checking the supported TPG modes to indicate
3
if the TPG hardware exists or not and only registering v4l2 ctrl for
4
CSID only when the TPG hardware is present.
1
5
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
---
8
.../media/platform/qcom/camss/camss-csid.c | 60 +++++++++++--------
9
1 file changed, 35 insertions(+), 25 deletions(-)
10
11
diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
12
index XXXXXXX..XXXXXXX 100644
13
--- a/drivers/media/platform/qcom/camss/camss-csid.c
14
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
15
@@ -XXX,XX +XXX,XX @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
16
    int ret;
17
18
    if (enable) {
19
-        ret = v4l2_ctrl_handler_setup(&csid->ctrls);
20
-        if (ret < 0) {
21
-            dev_err(csid->camss->dev,
22
-                "could not sync v4l2 controls: %d\n", ret);
23
-            return ret;
24
+        if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED) {
25
+            ret = v4l2_ctrl_handler_setup(&csid->ctrls);
26
+            if (ret < 0) {
27
+                dev_err(csid->camss->dev,
28
+                    "could not sync v4l2 controls: %d\n", ret);
29
+                return ret;
30
+            }
31
        }
32
33
        if (!csid->testgen.enabled &&
34
@@ -XXX,XX +XXX,XX @@ static void csid_try_format(struct csid_device *csid,
35
        break;
36
37
    case MSM_CSID_PAD_SRC:
38
-        if (csid->testgen_mode->cur.val == 0) {
39
+        if (csid->testgen.nmodes == CSID_PAYLOAD_MODE_DISABLED ||
40
+         csid->testgen_mode->cur.val == 0) {
41
            /* Test generator is disabled, */
42
            /* keep pad formats in sync */
43
            u32 code = fmt->code;
44
@@ -XXX,XX +XXX,XX @@ static int csid_enum_mbus_code(struct v4l2_subdev *sd,
45
46
        code->code = csid->res->formats->formats[code->index].code;
47
    } else {
48
-        if (csid->testgen_mode->cur.val == 0) {
49
+        if (csid->testgen.nmodes == CSID_PAYLOAD_MODE_DISABLED ||
50
+         csid->testgen_mode->cur.val == 0) {
51
            struct v4l2_mbus_framefmt *sink_fmt;
52
53
            sink_fmt = __csid_get_format(csid, sd_state,
54
@@ -XXX,XX +XXX,XX @@ static int csid_link_setup(struct media_entity *entity,
55
56
        /* If test generator is enabled */
57
        /* do not allow a link from CSIPHY to CSID */
58
-        if (csid->testgen_mode->cur.val != 0)
59
+        if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED &&
60
+         csid->testgen_mode->cur.val != 0)
61
            return -EBUSY;
62
63
        sd = media_entity_to_v4l2_subdev(remote->entity);
64
@@ -XXX,XX +XXX,XX @@ int msm_csid_register_entity(struct csid_device *csid,
65
         MSM_CSID_NAME, csid->id);
66
    v4l2_set_subdevdata(sd, csid);
67
68
-    ret = v4l2_ctrl_handler_init(&csid->ctrls, 1);
69
-    if (ret < 0) {
70
-        dev_err(dev, "Failed to init ctrl handler: %d\n", ret);
71
-        return ret;
72
-    }
73
+    if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED) {
74
+        ret = v4l2_ctrl_handler_init(&csid->ctrls, 1);
75
+        if (ret < 0) {
76
+            dev_err(dev, "Failed to init ctrl handler: %d\n", ret);
77
+            return ret;
78
+        }
79
80
-    csid->testgen_mode = v4l2_ctrl_new_std_menu_items(&csid->ctrls,
81
-                &csid_ctrl_ops, V4L2_CID_TEST_PATTERN,
82
-                csid->testgen.nmodes, 0, 0,
83
-                csid->testgen.modes);
84
+        csid->testgen_mode =
85
+            v4l2_ctrl_new_std_menu_items(&csid->ctrls,
86
+                         &csid_ctrl_ops, V4L2_CID_TEST_PATTERN,
87
+                         csid->testgen.nmodes, 0, 0,
88
+                         csid->testgen.modes);
89
90
-    if (csid->ctrls.error) {
91
-        dev_err(dev, "Failed to init ctrl: %d\n", csid->ctrls.error);
92
-        ret = csid->ctrls.error;
93
-        goto free_ctrl;
94
-    }
95
+        if (csid->ctrls.error) {
96
+            dev_err(dev, "Failed to init ctrl: %d\n", csid->ctrls.error);
97
+            ret = csid->ctrls.error;
98
+            goto free_ctrl;
99
+        }
100
101
-    csid->subdev.ctrl_handler = &csid->ctrls;
102
+        csid->subdev.ctrl_handler = &csid->ctrls;
103
+    }
104
105
    ret = csid_init_formats(sd, NULL);
106
    if (ret < 0) {
107
@@ -XXX,XX +XXX,XX @@ int msm_csid_register_entity(struct csid_device *csid,
108
media_cleanup:
109
    media_entity_cleanup(&sd->entity);
110
free_ctrl:
111
-    v4l2_ctrl_handler_free(&csid->ctrls);
112
+    if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED)
113
+        v4l2_ctrl_handler_free(&csid->ctrls);
114
115
    return ret;
116
}
117
@@ -XXX,XX +XXX,XX @@ void msm_csid_unregister_entity(struct csid_device *csid)
118
{
119
    v4l2_device_unregister_subdev(&csid->subdev);
120
    media_entity_cleanup(&csid->subdev.entity);
121
-    v4l2_ctrl_handler_free(&csid->ctrls);
122
+    if (csid->testgen.nmodes != CSID_PAYLOAD_MODE_DISABLED)
123
+        v4l2_ctrl_handler_free(&csid->ctrls);
124
}
125
126
inline bool csid_is_lite(struct csid_device *csid)
127
--
128
2.34.1
diff view generated by jsdifflib
...
...
3
3
4
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
4
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
5
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
5
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
---
7
---
8
.../bindings/media/qcom,sm8550-camss.yaml | 517 ++++++++++++++++++
8
.../bindings/media/qcom,sm8550-camss.yaml | 597 ++++++++++++++++++
9
1 file changed, 517 insertions(+)
9
1 file changed, 597 insertions(+)
10
create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
10
create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
11
11
12
diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml b/Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
12
diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml b/Documentation/devicetree/bindings/media/qcom,sm8550-camss.yaml
13
new file mode 100644
13
new file mode 100644
14
index XXXXXXX..XXXXXXX
14
index XXXXXXX..XXXXXXX
...
...
41
+ - const: csid0
41
+ - const: csid0
42
+ - const: csid1
42
+ - const: csid1
43
+ - const: csid2
43
+ - const: csid2
44
+ - const: csid_lite0
44
+ - const: csid_lite0
45
+ - const: csid_lite1
45
+ - const: csid_lite1
46
+ - const: csid_top
46
+ - const: csid_wrapper
47
+ - const: csiphy0
47
+ - const: csiphy0
48
+ - const: csiphy1
48
+ - const: csiphy1
49
+ - const: csiphy2
49
+ - const: csiphy2
50
+ - const: csiphy3
50
+ - const: csiphy3
51
+ - const: csiphy4
51
+ - const: csiphy4
...
...
86
+ - const: csiphy6
86
+ - const: csiphy6
87
+ - const: csiphy6_timer
87
+ - const: csiphy6_timer
88
+ - const: csiphy7
88
+ - const: csiphy7
89
+ - const: csiphy7_timer
89
+ - const: csiphy7_timer
90
+ - const: csiphy_rx
90
+ - const: csiphy_rx
91
+ - const: gcc_axi_hf
91
+ - const: vfe0
92
+ - const: vfe0
92
+ - const: vfe0_fast_ahb
93
+ - const: vfe0_fast_ahb
93
+ - const: vfe1
94
+ - const: vfe1
94
+ - const: vfe1_fast_ahb
95
+ - const: vfe1_fast_ahb
95
+ - const: vfe2
96
+ - const: vfe2
96
+ - const: vfe2_fast_ahb
97
+ - const: vfe2_fast_ahb
97
+ - const: vfe_lite
98
+ - const: vfe_lite
98
+ - const: vfe_lite_ahb
99
+ - const: vfe_lite_ahb
99
+ - const: vfe_lite_cphy_rx
100
+ - const: vfe_lite_cphy_rx
100
+ - const: vfe_lite_csid
101
+ - const: vfe_lite_csid
101
+ - const: gcc_axi_hf
102
+
103
+ interconnects:
104
+ maxItems: 4
105
+
106
+ interconnect-names:
107
+ items:
108
+ - const: ahb
109
+ - const: hf_0_mnoc
110
+ - const: icp_mnoc
111
+ - const: sf_0_mnoc
112
+
102
+
113
+ interrupts:
103
+ interrupts:
114
+ maxItems: 18
104
+ maxItems: 18
115
+
105
+
116
+ interrupt-names:
106
+ interrupt-names:
...
...
132
+ - const: vfe1
122
+ - const: vfe1
133
+ - const: vfe2
123
+ - const: vfe2
134
+ - const: vfe_lite0
124
+ - const: vfe_lite0
135
+ - const: vfe_lite1
125
+ - const: vfe_lite1
136
+
126
+
127
+ interconnects:
128
+ maxItems: 2
129
+
130
+ interconnect-names:
131
+ items:
132
+ - const: ahb
133
+ - const: hf_0_mnoc
134
+
137
+ iommus:
135
+ iommus:
138
+ maxItems: 1
136
+ maxItems: 1
139
+
137
+
140
+ power-domains:
138
+ power-domains:
141
+ items:
139
+ items:
...
...
168
+ properties:
166
+ properties:
169
+ port@0:
167
+ port@0:
170
+ $ref: /schemas/graph.yaml#/$defs/port-base
168
+ $ref: /schemas/graph.yaml#/$defs/port-base
171
+ unevaluatedProperties: false
169
+ unevaluatedProperties: false
172
+ description:
170
+ description:
173
+ Input port for receiving CSI data.
171
+ Input port for receiving CSI data on CSI0.
174
+
172
+
175
+ properties:
173
+ properties:
176
+ endpoint:
174
+ endpoint:
177
+ $ref: video-interfaces.yaml#
175
+ $ref: video-interfaces.yaml#
178
+ unevaluatedProperties: false
176
+ unevaluatedProperties: false
179
+
177
+
180
+ properties:
178
+ properties:
181
+ clock-lanes:
179
+ clock-lanes:
182
+ maxItems: 1
180
+ maxItems: 1
183
+
181
+
184
+ data-lanes:
182
+ data-lanes:
185
+ minItems: 1
183
+ minItems: 1
186
+ maxItems: 4
184
+ maxItems: 4
185
+
186
+ bus-type:
187
+ enum:
188
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
189
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
187
+
190
+
188
+ required:
191
+ required:
189
+ - clock-lanes
192
+ - clock-lanes
190
+ - data-lanes
193
+ - data-lanes
191
+
194
+
192
+ port@1:
195
+ port@1:
193
+ $ref: /schemas/graph.yaml#/$defs/port-base
196
+ $ref: /schemas/graph.yaml#/$defs/port-base
194
+ unevaluatedProperties: false
197
+ unevaluatedProperties: false
195
+ description:
198
+ description:
196
+ Input port for receiving CSI data.
199
+ Input port for receiving CSI data on CSI1.
197
+
200
+
198
+ properties:
201
+ properties:
199
+ endpoint:
202
+ endpoint:
200
+ $ref: video-interfaces.yaml#
203
+ $ref: video-interfaces.yaml#
201
+ unevaluatedProperties: false
204
+ unevaluatedProperties: false
202
+
205
+
203
+ properties:
206
+ properties:
204
+ clock-lanes:
207
+ clock-lanes:
205
+ maxItems: 1
208
+ maxItems: 1
206
+
209
+
207
+ data-lanes:
210
+ data-lanes:
208
+ minItems: 1
211
+ minItems: 1
209
+ maxItems: 4
212
+ maxItems: 4
213
+
214
+ bus-type:
215
+ enum:
216
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
217
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
210
+
218
+
211
+ required:
219
+ required:
212
+ - clock-lanes
220
+ - clock-lanes
213
+ - data-lanes
221
+ - data-lanes
214
+
222
+
215
+ port@2:
223
+ port@2:
216
+ $ref: /schemas/graph.yaml#/$defs/port-base
224
+ $ref: /schemas/graph.yaml#/$defs/port-base
217
+ unevaluatedProperties: false
225
+ unevaluatedProperties: false
218
+ description:
226
+ description:
219
+ Input port for receiving CSI data.
227
+ Input port for receiving CSI data on CSI2.
220
+
228
+
221
+ properties:
229
+ properties:
222
+ endpoint:
230
+ endpoint:
223
+ $ref: video-interfaces.yaml#
231
+ $ref: video-interfaces.yaml#
224
+ unevaluatedProperties: false
232
+ unevaluatedProperties: false
225
+
233
+
226
+ properties:
234
+ properties:
227
+ clock-lanes:
235
+ clock-lanes:
228
+ maxItems: 1
236
+ maxItems: 1
229
+
237
+
230
+ data-lanes:
238
+ data-lanes:
231
+ minItems: 1
239
+ minItems: 1
232
+ maxItems: 4
240
+ maxItems: 4
241
+
242
+ bus-type:
243
+ enum:
244
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
245
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
233
+
246
+
234
+ required:
247
+ required:
235
+ - clock-lanes
248
+ - clock-lanes
236
+ - data-lanes
249
+ - data-lanes
237
+
250
+
238
+ port@3:
251
+ port@3:
239
+ $ref: /schemas/graph.yaml#/$defs/port-base
252
+ $ref: /schemas/graph.yaml#/$defs/port-base
240
+ unevaluatedProperties: false
253
+ unevaluatedProperties: false
241
+ description:
254
+ description:
242
+ Input port for receiving CSI data.
255
+ Input port for receiving CSI data on CSI3.
243
+
256
+
244
+ properties:
257
+ properties:
245
+ endpoint:
258
+ endpoint:
246
+ $ref: video-interfaces.yaml#
259
+ $ref: video-interfaces.yaml#
247
+ unevaluatedProperties: false
260
+ unevaluatedProperties: false
248
+
261
+
249
+ properties:
262
+ properties:
250
+ clock-lanes:
263
+ clock-lanes:
251
+ maxItems: 1
264
+ maxItems: 1
252
+
265
+
253
+ data-lanes:
266
+ data-lanes:
254
+ minItems: 1
267
+ minItems: 1
255
+ maxItems: 4
268
+ maxItems: 4
269
+
270
+ bus-type:
271
+ enum:
272
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
273
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
256
+
274
+
257
+ required:
275
+ required:
258
+ - clock-lanes
276
+ - clock-lanes
259
+ - data-lanes
277
+ - data-lanes
260
+
278
+
261
+ port@4:
279
+ port@4:
262
+ $ref: /schemas/graph.yaml#/$defs/port-base
280
+ $ref: /schemas/graph.yaml#/$defs/port-base
263
+ unevaluatedProperties: false
281
+ unevaluatedProperties: false
264
+ description:
282
+ description:
265
+ Input port for receiving CSI data.
283
+ Input port for receiving CSI data on CSI4.
266
+
284
+
267
+ properties:
285
+ properties:
268
+ endpoint:
286
+ endpoint:
269
+ $ref: video-interfaces.yaml#
287
+ $ref: video-interfaces.yaml#
270
+ unevaluatedProperties: false
288
+ unevaluatedProperties: false
271
+
289
+
272
+ properties:
290
+ properties:
273
+ clock-lanes:
291
+ clock-lanes:
274
+ maxItems: 1
292
+ maxItems: 1
275
+
293
+
276
+ data-lanes:
294
+ data-lanes:
277
+ minItems: 1
295
+ minItems: 1
278
+ maxItems: 4
296
+ maxItems: 4
297
+
298
+ bus-type:
299
+ enum:
300
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
301
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
279
+
302
+
280
+ required:
303
+ required:
281
+ - clock-lanes
304
+ - clock-lanes
282
+ - data-lanes
305
+ - data-lanes
283
+
306
+
284
+ port@5:
307
+ port@5:
285
+ $ref: /schemas/graph.yaml#/$defs/port-base
308
+ $ref: /schemas/graph.yaml#/$defs/port-base
286
+ unevaluatedProperties: false
309
+ unevaluatedProperties: false
287
+ description:
310
+ description:
288
+ Input port for receiving CSI data.
311
+ Input port for receiving CSI data on CSI5.
289
+
312
+
290
+ properties:
313
+ properties:
291
+ endpoint:
314
+ endpoint:
292
+ $ref: video-interfaces.yaml#
315
+ $ref: video-interfaces.yaml#
293
+ unevaluatedProperties: false
316
+ unevaluatedProperties: false
294
+
317
+
295
+ properties:
318
+ properties:
296
+ clock-lanes:
319
+ clock-lanes:
297
+ maxItems: 1
320
+ maxItems: 1
298
+
321
+
299
+ data-lanes:
322
+ data-lanes:
300
+ minItems: 1
323
+ minItems: 1
301
+ maxItems: 4
324
+ maxItems: 4
325
+
326
+ bus-type:
327
+ enum:
328
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
329
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
330
+
331
+ required:
332
+ - clock-lanes
333
+ - data-lanes
334
+
335
+ port@6:
336
+ $ref: /schemas/graph.yaml#/$defs/port-base
337
+ unevaluatedProperties: false
338
+ description:
339
+ Input port for receiving CSI data on CSI6.
340
+
341
+ properties:
342
+ endpoint:
343
+ $ref: video-interfaces.yaml#
344
+ unevaluatedProperties: false
345
+
346
+ properties:
347
+ clock-lanes:
348
+ maxItems: 1
349
+
350
+ data-lanes:
351
+ minItems: 1
352
+ maxItems: 4
353
+
354
+ bus-type:
355
+ enum:
356
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
357
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
358
+
359
+ required:
360
+ - clock-lanes
361
+ - data-lanes
362
+
363
+ port@7:
364
+ $ref: /schemas/graph.yaml#/$defs/port-base
365
+ unevaluatedProperties: false
366
+ description:
367
+ Input port for receiving CSI data on CSI7.
368
+
369
+ properties:
370
+ endpoint:
371
+ $ref: video-interfaces.yaml#
372
+ unevaluatedProperties: false
373
+
374
+ properties:
375
+ clock-lanes:
376
+ maxItems: 1
377
+
378
+ data-lanes:
379
+ minItems: 1
380
+ maxItems: 4
381
+
382
+ bus-type:
383
+ enum:
384
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
385
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
302
+
386
+
303
+ required:
387
+ required:
304
+ - clock-lanes
388
+ - clock-lanes
305
+ - data-lanes
389
+ - data-lanes
306
+
390
+
307
+required:
391
+required:
308
+ - compatible
392
+ - compatible
393
+ - reg
394
+ - reg-names
309
+ - clocks
395
+ - clocks
310
+ - clock-names
396
+ - clock-names
397
+ - interrupts
398
+ - interrupt-names
311
+ - interconnects
399
+ - interconnects
312
+ - interconnect-names
400
+ - interconnect-names
313
+ - interrupts
314
+ - interrupt-names
315
+ - iommus
401
+ - iommus
316
+ - power-domains
402
+ - power-domains
317
+ - power-domain-names
403
+ - power-domain-names
318
+ - reg
319
+ - reg-names
320
+ - vdda-phy-supply
404
+ - vdda-phy-supply
321
+ - vdda-pll-supply
405
+ - vdda-pll-supply
322
+
406
+
323
+additionalProperties: false
407
+additionalProperties: false
324
+
408
+
325
+examples:
409
+examples:
326
+ - |
410
+ - |
327
+ #include <dt-bindings/clock/qcom,rpmh.h>
411
+ #include <dt-bindings/clock/qcom,rpmh.h>
328
+ #include <dt-bindings/clock/qcom,sm8550-camcc.h>
412
+ #include <dt-bindings/clock/qcom,sm8550-camcc.h>
329
+ #include <dt-bindings/clock/qcom,sm8550-gcc.h>
413
+ #include <dt-bindings/clock/qcom,sm8550-gcc.h>
414
+ #include <dt-bindings/interconnect/qcom,icc.h>
330
+ #include <dt-bindings/interconnect/qcom,sm8550-rpmh.h>
415
+ #include <dt-bindings/interconnect/qcom,sm8550-rpmh.h>
331
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
416
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
332
+ #include <dt-bindings/power/qcom-rpmpd.h>
417
+ #include <dt-bindings/power/qcom-rpmpd.h>
333
+
418
+
334
+ soc {
419
+ soc {
335
+ #address-cells = <2>;
420
+ #address-cells = <2>;
336
+ #size-cells = <2>;
421
+ #size-cells = <2>;
337
+
422
+
338
+ camss: camss@ace4000 {
423
+ isp@acb7000 {
339
+ compatible = "qcom,sm8550-camss";
424
+ compatible = "qcom,sm8550-camss";
340
+
425
+
341
+ reg = <0 0x0acb7000 0 0xd00>,
426
+ reg = <0 0x0acb7000 0 0xd00>,
342
+ <0 0x0acb9000 0 0xd00>,
427
+ <0 0x0acb9000 0 0xd00>,
343
+ <0 0x0acbb000 0 0xd00>,
428
+ <0 0x0acbb000 0 0xd00>,
...
...
353
+ <0 0x0acf0000 0 0x2000>,
438
+ <0 0x0acf0000 0 0x2000>,
354
+ <0 0x0acf2000 0 0x2000>,
439
+ <0 0x0acf2000 0 0x2000>,
355
+ <0 0x0ac62000 0 0xf000>,
440
+ <0 0x0ac62000 0 0xf000>,
356
+ <0 0x0ac71000 0 0xf000>,
441
+ <0 0x0ac71000 0 0xf000>,
357
+ <0 0x0ac80000 0 0xf000>,
442
+ <0 0x0ac80000 0 0xf000>,
358
+ <0 0x0accb000 0 0x2800>,
443
+ <0 0x0accb000 0 0x1800>,
359
+ <0 0x0accf000 0 0x2800>;
444
+ <0 0x0accf000 0 0x1800>;
360
+ reg-names = "csid0",
445
+ reg-names = "csid0",
361
+ "csid1",
446
+ "csid1",
362
+ "csid2",
447
+ "csid2",
363
+ "csid_lite0",
448
+ "csid_lite0",
364
+ "csid_lite1",
449
+ "csid_lite1",
365
+ "csid_top",
450
+ "csid_wrapper",
366
+ "csiphy0",
451
+ "csiphy0",
367
+ "csiphy1",
452
+ "csiphy1",
368
+ "csiphy2",
453
+ "csiphy2",
369
+ "csiphy3",
454
+ "csiphy3",
370
+ "csiphy4",
455
+ "csiphy4",
...
...
400
+ <&camcc CAM_CC_CSIPHY6_CLK>,
485
+ <&camcc CAM_CC_CSIPHY6_CLK>,
401
+ <&camcc CAM_CC_CSI6PHYTIMER_CLK>,
486
+ <&camcc CAM_CC_CSI6PHYTIMER_CLK>,
402
+ <&camcc CAM_CC_CSIPHY7_CLK>,
487
+ <&camcc CAM_CC_CSIPHY7_CLK>,
403
+ <&camcc CAM_CC_CSI7PHYTIMER_CLK>,
488
+ <&camcc CAM_CC_CSI7PHYTIMER_CLK>,
404
+ <&camcc CAM_CC_CSID_CSIPHY_RX_CLK>,
489
+ <&camcc CAM_CC_CSID_CSIPHY_RX_CLK>,
490
+ <&gcc GCC_CAMERA_HF_AXI_CLK>,
405
+ <&camcc CAM_CC_IFE_0_CLK>,
491
+ <&camcc CAM_CC_IFE_0_CLK>,
406
+ <&camcc CAM_CC_IFE_0_FAST_AHB_CLK>,
492
+ <&camcc CAM_CC_IFE_0_FAST_AHB_CLK>,
407
+ <&camcc CAM_CC_IFE_1_CLK>,
493
+ <&camcc CAM_CC_IFE_1_CLK>,
408
+ <&camcc CAM_CC_IFE_1_FAST_AHB_CLK>,
494
+ <&camcc CAM_CC_IFE_1_FAST_AHB_CLK>,
409
+ <&camcc CAM_CC_IFE_2_CLK>,
495
+ <&camcc CAM_CC_IFE_2_CLK>,
410
+ <&camcc CAM_CC_IFE_2_FAST_AHB_CLK>,
496
+ <&camcc CAM_CC_IFE_2_FAST_AHB_CLK>,
411
+ <&camcc CAM_CC_IFE_LITE_CLK>,
497
+ <&camcc CAM_CC_IFE_LITE_CLK>,
412
+ <&camcc CAM_CC_IFE_LITE_AHB_CLK>,
498
+ <&camcc CAM_CC_IFE_LITE_AHB_CLK>,
413
+ <&camcc CAM_CC_IFE_LITE_CPHY_RX_CLK>,
499
+ <&camcc CAM_CC_IFE_LITE_CPHY_RX_CLK>,
414
+ <&camcc CAM_CC_IFE_LITE_CSID_CLK>,
500
+ <&camcc CAM_CC_IFE_LITE_CSID_CLK>;
415
+ <&gcc GCC_CAMERA_HF_AXI_CLK>;
416
+
417
+ clock-names = "camnoc_axi",
501
+ clock-names = "camnoc_axi",
418
+ "cpas_ahb",
502
+ "cpas_ahb",
419
+ "cpas_fast_ahb_clk",
503
+ "cpas_fast_ahb_clk",
420
+ "cpas_ife_lite",
504
+ "cpas_ife_lite",
421
+ "cpas_vfe0",
505
+ "cpas_vfe0",
...
...
437
+ "csiphy6",
521
+ "csiphy6",
438
+ "csiphy6_timer",
522
+ "csiphy6_timer",
439
+ "csiphy7",
523
+ "csiphy7",
440
+ "csiphy7_timer",
524
+ "csiphy7_timer",
441
+ "csiphy_rx",
525
+ "csiphy_rx",
526
+ "gcc_axi_hf",
442
+ "vfe0",
527
+ "vfe0",
443
+ "vfe0_fast_ahb",
528
+ "vfe0_fast_ahb",
444
+ "vfe1",
529
+ "vfe1",
445
+ "vfe1_fast_ahb",
530
+ "vfe1_fast_ahb",
446
+ "vfe2",
531
+ "vfe2",
447
+ "vfe2_fast_ahb",
532
+ "vfe2_fast_ahb",
448
+ "vfe_lite",
533
+ "vfe_lite",
449
+ "vfe_lite_ahb",
534
+ "vfe_lite_ahb",
450
+ "vfe_lite_cphy_rx",
535
+ "vfe_lite_cphy_rx",
451
+ "vfe_lite_csid",
536
+ "vfe_lite_csid";
452
+ "gcc_axi_hf";
537
+
453
+
538
+ interrupts = <GIC_SPI 601 IRQ_TYPE_EDGE_RISING>,
454
+ interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_CAMERA_CFG 0>,
539
+ <GIC_SPI 603 IRQ_TYPE_EDGE_RISING>,
455
+ <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>,
540
+ <GIC_SPI 431 IRQ_TYPE_EDGE_RISING>,
456
+ <&mmss_noc MASTER_CAMNOC_ICP 0 &mc_virt SLAVE_EBI1 0>,
541
+ <GIC_SPI 605 IRQ_TYPE_EDGE_RISING>,
457
+ <&mmss_noc MASTER_CAMNOC_SF 0 &mc_virt SLAVE_EBI1 0>;
542
+ <GIC_SPI 376 IRQ_TYPE_EDGE_RISING>,
458
+ interconnect-names = "ahb",
543
+ <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>,
459
+ "hf_0_mnoc",
544
+ <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>,
460
+ "icp_mnoc",
545
+ <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>,
461
+ "sf_0_mnoc";
546
+ <GIC_SPI 448 IRQ_TYPE_EDGE_RISING>,
462
+
547
+ <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>,
463
+ interrupts = <GIC_SPI 601 IRQ_TYPE_LEVEL_HIGH>,
548
+ <GIC_SPI 89 IRQ_TYPE_EDGE_RISING>,
464
+ <GIC_SPI 603 IRQ_TYPE_LEVEL_HIGH>,
549
+ <GIC_SPI 278 IRQ_TYPE_EDGE_RISING>,
465
+ <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH>,
550
+ <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>,
466
+ <GIC_SPI 605 IRQ_TYPE_LEVEL_HIGH>,
551
+ <GIC_SPI 602 IRQ_TYPE_EDGE_RISING>,
467
+ <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>,
552
+ <GIC_SPI 604 IRQ_TYPE_EDGE_RISING>,
468
+ <GIC_SPI 477 IRQ_TYPE_LEVEL_HIGH>,
553
+ <GIC_SPI 688 IRQ_TYPE_EDGE_RISING>,
469
+ <GIC_SPI 478 IRQ_TYPE_LEVEL_HIGH>,
554
+ <GIC_SPI 606 IRQ_TYPE_EDGE_RISING>,
470
+ <GIC_SPI 479 IRQ_TYPE_LEVEL_HIGH>,
555
+ <GIC_SPI 377 IRQ_TYPE_EDGE_RISING>;
471
+ <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
472
+ <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
473
+ <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
474
+ <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
475
+ <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>,
476
+ <GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>,
477
+ <GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
478
+ <GIC_SPI 688 IRQ_TYPE_LEVEL_HIGH>,
479
+ <GIC_SPI 606 IRQ_TYPE_LEVEL_HIGH>,
480
+ <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
481
+
482
+ interrupt-names = "csid0",
556
+ interrupt-names = "csid0",
483
+ "csid1",
557
+ "csid1",
484
+ "csid2",
558
+ "csid2",
485
+ "csid_lite0",
559
+ "csid_lite0",
486
+ "csid_lite1",
560
+ "csid_lite1",
...
...
496
+ "vfe1",
570
+ "vfe1",
497
+ "vfe2",
571
+ "vfe2",
498
+ "vfe_lite0",
572
+ "vfe_lite0",
499
+ "vfe_lite1";
573
+ "vfe_lite1";
500
+
574
+
575
+ interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY
576
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ACTIVE_ONLY>,
577
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
578
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
579
+ interconnect-names = "ahb",
580
+ "hf_0_mnoc";
581
+
501
+ iommus = <&apps_smmu 0x800 0x20>;
582
+ iommus = <&apps_smmu 0x800 0x20>;
502
+
583
+
503
+ power-domains = <&camcc CAM_CC_IFE_0_GDSC>,
584
+ power-domains = <&camcc CAM_CC_IFE_0_GDSC>,
504
+ <&camcc CAM_CC_IFE_1_GDSC>,
585
+ <&camcc CAM_CC_IFE_1_GDSC>,
505
+ <&camcc CAM_CC_IFE_2_GDSC>,
586
+ <&camcc CAM_CC_IFE_2_GDSC>,
506
+ <&camcc CAM_CC_TITAN_TOP_GDSC>;
587
+ <&camcc CAM_CC_TITAN_TOP_GDSC>;
507
+
508
+ power-domain-names = "ife0",
588
+ power-domain-names = "ife0",
509
+ "ife1",
589
+ "ife1",
510
+ "ife2",
590
+ "ife2",
511
+ "top";
591
+ "top";
512
+
592
+
...
...
diff view generated by jsdifflib
1
Add CAMSS_8550 enum, sm8550 compatible and sm8550 camss drvier private
1
Add CAMSS_8550 enum, sm8550 compatible and sm8550 camss drvier private
2
data, the private data just include some basic information now, later
2
data, the private data just include some basic information now, later
3
changes will enumerate with csiphy, csid and vfe resources.
3
changes will enumerate with csiphy, csid and vfe resources.
4
4
5
Also add a default case in vfe_src_pad_code to get rid of a compile
5
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6
warning since a new hw enum is added.
7
8
drivers/media/platform/qcom/camss/camss-vfe.c:291:10: warning:
9
enumeration value 'CAMSS_8550' not handled in switch [-Wswitch]
10
291 | switch (vfe->camss->res->version) {
11
| ^~~~~~~~~~~~~~~~~~~~~~~~
12
13
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
14
---
7
---
15
drivers/media/platform/qcom/camss/camss-vfe.c | 4 +++
8
drivers/media/platform/qcom/camss/camss.c | 22 ++++++++++++++++++++++
16
drivers/media/platform/qcom/camss/camss.c | 32 +++++++++++++++++++
9
drivers/media/platform/qcom/camss/camss.h | 1 +
17
drivers/media/platform/qcom/camss/camss.h | 1 +
10
2 files changed, 23 insertions(+)
18
3 files changed, 37 insertions(+)
19
11
20
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
23
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
24
@@ -XXX,XX +XXX,XX @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
25
            return sink_code;
26
        }
27
        break;
28
+    default:
29
+        WARN(1, "Unsupported HW version: %x\n",
30
+         vfe->camss->res->version);
31
+        break;
32
    }
33
    return 0;
34
}
35
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
12
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
36
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
37
--- a/drivers/media/platform/qcom/camss/camss.c
14
--- a/drivers/media/platform/qcom/camss/camss.c
38
+++ b/drivers/media/platform/qcom/camss/camss.c
15
+++ b/drivers/media/platform/qcom/camss/camss.c
39
@@ -XXX,XX +XXX,XX @@ static const struct resources_icc icc_res_sc8280xp[] = {
16
@@ -XXX,XX +XXX,XX @@ static const struct resources_icc icc_res_sc8280xp[] = {
...
...
49
+    {
26
+    {
50
+        .name = "hf_0_mnoc",
27
+        .name = "hf_0_mnoc",
51
+        .icc_bw_tbl.avg = 2097152,
28
+        .icc_bw_tbl.avg = 2097152,
52
+        .icc_bw_tbl.peak = 2097152,
29
+        .icc_bw_tbl.peak = 2097152,
53
+    },
30
+    },
54
+    {
55
+        .name = "icp_mnoc",
56
+        .icc_bw_tbl.avg = 2097152,
57
+        .icc_bw_tbl.peak = 2097152,
58
+    },
59
+    {
60
+        .name = "sf_0_mnoc",
61
+        .icc_bw_tbl.avg = 2097152,
62
+        .icc_bw_tbl.peak = 2097152,
63
+    },
64
+};
31
+};
65
+
32
+
66
/*
33
/*
67
* camss_add_clock_margin - Add margin to clock frequency rate
34
* camss_add_clock_margin - Add margin to clock frequency rate
68
* @rate: Clock frequency rate
35
* @rate: Clock frequency rate
69
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sc8280xp_resources = {
36
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sc7280_resources = {
70
    .link_entities = camss_link_entities
37
    .link_entities = camss_link_entities
71
};
38
};
72
39
73
+static const struct camss_resources sm8550_resources = {
40
+static const struct camss_resources sm8550_resources = {
74
+    .version = CAMSS_8550,
41
+    .version = CAMSS_8550,
...
...
78
+    .link_entities = camss_link_entities
45
+    .link_entities = camss_link_entities
79
+};
46
+};
80
+
47
+
81
static const struct of_device_id camss_dt_match[] = {
48
static const struct of_device_id camss_dt_match[] = {
82
    { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources },
49
    { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources },
83
    { .compatible = "qcom,msm8996-camss", .data = &msm8996_resources },
50
    { .compatible = "qcom,msm8953-camss", .data = &msm8953_resources },
84
@@ -XXX,XX +XXX,XX @@ static const struct of_device_id camss_dt_match[] = {
51
@@ -XXX,XX +XXX,XX @@ static const struct of_device_id camss_dt_match[] = {
52
    { .compatible = "qcom,sdm660-camss", .data = &sdm660_resources },
85
    { .compatible = "qcom,sdm845-camss", .data = &sdm845_resources },
53
    { .compatible = "qcom,sdm845-camss", .data = &sdm845_resources },
86
    { .compatible = "qcom,sm8250-camss", .data = &sm8250_resources },
54
    { .compatible = "qcom,sm8250-camss", .data = &sm8250_resources },
87
    { .compatible = "qcom,sc8280xp-camss", .data = &sc8280xp_resources },
88
+    { .compatible = "qcom,sm8550-camss", .data = &sm8550_resources },
55
+    { .compatible = "qcom,sm8550-camss", .data = &sm8550_resources },
89
    { }
56
    { }
90
};
57
};
91
58
92
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
59
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
93
index XXXXXXX..XXXXXXX 100644
60
index XXXXXXX..XXXXXXX 100644
94
--- a/drivers/media/platform/qcom/camss/camss.h
61
--- a/drivers/media/platform/qcom/camss/camss.h
95
+++ b/drivers/media/platform/qcom/camss/camss.h
62
+++ b/drivers/media/platform/qcom/camss/camss.h
96
@@ -XXX,XX +XXX,XX @@ enum camss_version {
63
@@ -XXX,XX +XXX,XX @@ enum camss_version {
97
    CAMSS_845,
98
    CAMSS_8250,
64
    CAMSS_8250,
99
    CAMSS_8280XP,
65
    CAMSS_8280XP,
66
    CAMSS_845,
100
+    CAMSS_8550,
67
+    CAMSS_8550,
101
};
68
};
102
69
103
enum icc_count {
70
enum icc_count {
104
--
71
--
105
2.34.1
72
2.34.1
diff view generated by jsdifflib
1
Add a PHY configuration sequence and PHY resource for the sm8550 which
1
Add a PHY configuration sequence and PHY resource for the sm8550 which
2
uses a Qualcomm Gen 2 version 2.1.2 CSI-2 PHY.
2
uses a Qualcomm Gen 2 version 2.1.2 CSI-2 PHY.
3
3
4
The PHY can be configured as two phase or three phase in C-PHY or D-PHY
4
The PHY can be configured as two phase or three phase in C-PHY or D-PHY
5
mode. This configuration supports two-phase D-PHY mode.
5
mode. This configuration supports two-phase D-PHY mode.
6
6
7
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
---
9
---
9
.../qcom/camss/camss-csiphy-3ph-1-0.c | 111 ++++++++++++++++++
10
.../qcom/camss/camss-csiphy-3ph-1-0.c | 111 ++++++++++++++++++
10
drivers/media/platform/qcom/camss/camss.c | 110 +++++++++++++++++
11
drivers/media/platform/qcom/camss/camss.c | 109 +++++++++++++++++
11
2 files changed, 221 insertions(+)
12
2 files changed, 220 insertions(+)
12
13
13
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
14
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
14
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
15
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
16
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
16
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
17
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
...
...
19
};
20
};
20
21
21
+/* GEN2 2.1.2 2PH DPHY mode */
22
+/* GEN2 2.1.2 2PH DPHY mode */
22
+static const struct
23
+static const struct
23
+csiphy_lane_regs lane_regs_sm8550[] = {
24
+csiphy_lane_regs lane_regs_sm8550[] = {
24
+    {0x0E90, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS},
25
+    {0x0E90, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
25
+    {0x0E98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
26
+    {0x0E98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
26
+    {0x0E94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
27
+    {0x0E94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
27
+    {0x00A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
28
+    {0x00A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
28
+    {0x0090, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS},
29
+    {0x0090, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
29
+    {0x0098, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
30
+    {0x0098, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
30
+    {0x0094, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
31
+    {0x0094, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
31
+    {0x0494, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
32
+    {0x0494, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
32
+    {0x04A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
33
+    {0x04A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
33
+    {0x0490, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS},
34
+    {0x0490, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
34
+    {0x0498, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
35
+    {0x0498, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
35
+    {0x0494, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
36
+    {0x0494, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
36
+    {0x0894, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
37
+    {0x0894, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
37
+    {0x08A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
38
+    {0x08A0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
38
+    {0x0890, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS},
39
+    {0x0890, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
39
+    {0x0898, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
40
+    {0x0898, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
40
+    {0x0894, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
41
+    {0x0894, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
41
+    {0x0C94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
42
+    {0x0C94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
42
+    {0x0CA0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
43
+    {0x0CA0, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
43
+    {0x0C90, 0x0f, 0x00, CSIPHY_DEFAULT_PARAMS},
44
+    {0x0C90, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
44
+    {0x0C98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
45
+    {0x0C98, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
45
+    {0x0C94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
46
+    {0x0C94, 0x07, 0x01, CSIPHY_DEFAULT_PARAMS},
46
+    {0x0E30, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
47
+    {0x0E30, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
47
+    {0x0E28, 0x04, 0x00, CSIPHY_DEFAULT_PARAMS},
48
+    {0x0E28, 0x04, 0x00, CSIPHY_DEFAULT_PARAMS},
48
+    {0x0E00, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
49
+    {0x0E00, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
...
...
125
+
126
+
126
static void csiphy_hw_version_read(struct csiphy_device *csiphy,
127
static void csiphy_hw_version_read(struct csiphy_device *csiphy,
127
                 struct device *dev)
128
                 struct device *dev)
128
{
129
{
129
@@ -XXX,XX +XXX,XX @@ static bool csiphy_is_gen2(u32 version)
130
@@ -XXX,XX +XXX,XX @@ static bool csiphy_is_gen2(u32 version)
130
    case CAMSS_845:
131
    case CAMSS_8250:
131
    case CAMSS_8250:
132
    case CAMSS_8280XP:
132
    case CAMSS_8280XP:
133
    case CAMSS_845:
133
+    case CAMSS_8550:
134
+    case CAMSS_8550:
134
        ret = true;
135
        ret = true;
135
        break;
136
        break;
136
    }
137
    }
137
@@ -XXX,XX +XXX,XX @@ static int csiphy_init(struct csiphy_device *csiphy)
138
@@ -XXX,XX +XXX,XX @@ static int csiphy_init(struct csiphy_device *csiphy)
...
...
155
};
156
};
156
157
157
+static const struct camss_subdev_resources csiphy_res_8550[] = {
158
+static const struct camss_subdev_resources csiphy_res_8550[] = {
158
+    /* CSIPHY0 */
159
+    /* CSIPHY0 */
159
+    {
160
+    {
160
+        .regulators = {},
161
+        .regulators = { "vdda-phy", "vdda-pll" },
161
+        .clock = { "csiphy0", "csiphy0_timer" },
162
+        .clock = { "csiphy0", "csiphy0_timer" },
162
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
163
+        .clock_rate = { { 400000000, 480000000 },
163
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
164
+                { 400000000 } },
164
+        .reg = { "csiphy0" },
165
+        .reg = { "csiphy0" },
165
+        .interrupt = { "csiphy0" },
166
+        .interrupt = { "csiphy0" },
166
+        .csiphy = {
167
+        .csiphy = {
167
+            .hw_ops = &csiphy_ops_3ph_1_0,
168
+            .hw_ops = &csiphy_ops_3ph_1_0,
168
+            .formats = &csiphy_formats_sdm845
169
+            .formats = &csiphy_formats_sdm845
169
+        }
170
+        }
170
+    },
171
+    },
171
+    /* CSIPHY1 */
172
+    /* CSIPHY1 */
172
+    {
173
+    {
173
+        .regulators = {},
174
+        .regulators = { "vdda-phy", "vdda-pll" },
174
+        .clock = { "csiphy1", "csiphy1_timer" },
175
+        .clock = { "csiphy1", "csiphy1_timer" },
175
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
176
+        .clock_rate = { { 400000000, 480000000 },
176
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
177
+                { 400000000 } },
177
+        .reg = { "csiphy1" },
178
+        .reg = { "csiphy1" },
178
+        .interrupt = { "csiphy1" },
179
+        .interrupt = { "csiphy1" },
179
+        .csiphy = {
180
+        .csiphy = {
180
+            .hw_ops = &csiphy_ops_3ph_1_0,
181
+            .hw_ops = &csiphy_ops_3ph_1_0,
181
+            .formats = &csiphy_formats_sdm845
182
+            .formats = &csiphy_formats_sdm845
182
+        }
183
+        }
183
+    },
184
+    },
184
+    /* CSIPHY2 */
185
+    /* CSIPHY2 */
185
+    {
186
+    {
186
+        .regulators = {},
187
+        .regulators = { "vdda-phy", "vdda-pll" },
187
+        .clock = { "csiphy2", "csiphy2_timer" },
188
+        .clock = { "csiphy2", "csiphy2_timer" },
188
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
189
+        .clock_rate = { { 400000000, 480000000 },
189
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
190
+                { 400000000 } },
190
+        .reg = { "csiphy2" },
191
+        .reg = { "csiphy2" },
191
+        .interrupt = { "csiphy2" },
192
+        .interrupt = { "csiphy2" },
192
+        .csiphy = {
193
+        .csiphy = {
193
+            .hw_ops = &csiphy_ops_3ph_1_0,
194
+            .hw_ops = &csiphy_ops_3ph_1_0,
194
+            .formats = &csiphy_formats_sdm845
195
+            .formats = &csiphy_formats_sdm845
195
+        }
196
+        }
196
+    },
197
+    },
197
+    /* CSIPHY3 */
198
+    /* CSIPHY3 */
198
+    {
199
+    {
199
+        .regulators = {},
200
+        .regulators = { "vdda-phy", "vdda-pll" },
200
+        .clock = { "csiphy3", "csiphy3_timer" },
201
+        .clock = { "csiphy3", "csiphy3_timer" },
201
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
202
+        .clock_rate = { { 400000000, 480000000 },
202
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
203
+                { 400000000 } },
203
+        .reg = { "csiphy3" },
204
+        .reg = { "csiphy3" },
204
+        .interrupt = { "csiphy3" },
205
+        .interrupt = { "csiphy3" },
205
+        .csiphy = {
206
+        .csiphy = {
206
+            .hw_ops = &csiphy_ops_3ph_1_0,
207
+            .hw_ops = &csiphy_ops_3ph_1_0,
207
+            .formats = &csiphy_formats_sdm845
208
+            .formats = &csiphy_formats_sdm845
208
+        }
209
+        }
209
+    },
210
+    },
210
+    /* CSIPHY4 */
211
+    /* CSIPHY4 */
211
+    {
212
+    {
212
+        .regulators = {},
213
+        .regulators = { "vdda-phy", "vdda-pll" },
213
+        .clock = { "csiphy4", "csiphy4_timer" },
214
+        .clock = { "csiphy4", "csiphy4_timer" },
214
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
215
+        .clock_rate = { { 400000000, 480000000 },
215
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
216
+                { 400000000 } },
216
+        .reg = { "csiphy4" },
217
+        .reg = { "csiphy4" },
217
+        .interrupt = { "csiphy4" },
218
+        .interrupt = { "csiphy4" },
218
+        .csiphy = {
219
+        .csiphy = {
219
+            .hw_ops = &csiphy_ops_3ph_1_0,
220
+            .hw_ops = &csiphy_ops_3ph_1_0,
220
+            .formats = &csiphy_formats_sdm845
221
+            .formats = &csiphy_formats_sdm845
221
+        }
222
+        }
222
+    },
223
+    },
223
+    /* CSIPHY5 */
224
+    /* CSIPHY5 */
224
+    {
225
+    {
225
+        .regulators = {},
226
+        .regulators = { "vdda-phy", "vdda-pll" },
226
+        .clock = { "csiphy5", "csiphy5_timer" },
227
+        .clock = { "csiphy5", "csiphy5_timer" },
227
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
228
+        .clock_rate = { { 400000000, 480000000 },
228
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
229
+                { 400000000 } },
229
+        .reg = { "csiphy5" },
230
+        .reg = { "csiphy5" },
230
+        .interrupt = { "csiphy5" },
231
+        .interrupt = { "csiphy5" },
231
+        .csiphy = {
232
+        .csiphy = {
232
+            .hw_ops = &csiphy_ops_3ph_1_0,
233
+            .hw_ops = &csiphy_ops_3ph_1_0,
233
+            .formats = &csiphy_formats_sdm845
234
+            .formats = &csiphy_formats_sdm845
234
+        }
235
+        }
235
+    },
236
+    },
236
+    /* CSIPHY6 */
237
+    /* CSIPHY6 */
237
+    {
238
+    {
238
+        .regulators = {},
239
+        .regulators = { "vdda-phy", "vdda-pll" },
239
+        .clock = { "csiphy6", "csiphy6_timer" },
240
+        .clock = { "csiphy6", "csiphy6_timer" },
240
+        .clock_rate = { { 300000000, 400000000, 400000000, 400000000, 400000000 },
241
+        .clock_rate = { { 400000000, 480000000 },
241
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
242
+                { 400000000 } },
242
+        .reg = { "csiphy6" },
243
+        .reg = { "csiphy6" },
243
+        .interrupt = { "csiphy6" },
244
+        .interrupt = { "csiphy6" },
244
+        .csiphy = {
245
+        .csiphy = {
245
+            .hw_ops = &csiphy_ops_3ph_1_0,
246
+            .hw_ops = &csiphy_ops_3ph_1_0,
246
+            .formats = &csiphy_formats_sdm845
247
+            .formats = &csiphy_formats_sdm845
247
+        }
248
+        }
248
+    },
249
+    },
249
+    /* CSIPHY7 */
250
+    /* CSIPHY7 */
250
+    {
251
+    {
251
+        .regulators = {},
252
+        .regulators = { "vdda-phy", "vdda-pll" },
252
+        .clock = { "csiphy7", "csiphy7_timer" },
253
+        .clock = { "csiphy7", "csiphy7_timer" },
253
+        .clock_rate = {
254
+        .clock_rate = { { 400000000, 480000000 },
254
+                { 300000000, 400000000, 400000000, 400000000, 400000000 },
255
+                { 400000000 } },
255
+                { 300000000, 400000000, 400000000, 400000000, 400000000 } },
256
+        .reg = { "csiphy7" },
256
+        .reg = { "csiphy7" },
257
+        .interrupt = { "csiphy7" },
257
+        .interrupt = { "csiphy7" },
258
+        .csiphy = {
258
+        .csiphy = {
259
+            .hw_ops = &csiphy_ops_3ph_1_0,
259
+            .hw_ops = &csiphy_ops_3ph_1_0,
260
+            .formats = &csiphy_formats_sdm845
260
+            .formats = &csiphy_formats_sdm845
...
...
263
+};
263
+};
264
+
264
+
265
static const struct resources_icc icc_res_sm8550[] = {
265
static const struct resources_icc icc_res_sm8550[] = {
266
    {
266
    {
267
        .name = "ahb",
267
        .name = "ahb",
268
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sc8280xp_resources = {
268
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sc7280_resources = {
269
static const struct camss_resources sm8550_resources = {
269
static const struct camss_resources sm8550_resources = {
270
    .version = CAMSS_8550,
270
    .version = CAMSS_8550,
271
    .pd_name = "top",
271
    .pd_name = "top",
272
+    .csiphy_res = csiphy_res_8550,
272
+    .csiphy_res = csiphy_res_8550,
273
    .icc_res = icc_res_sm8550,
273
    .icc_res = icc_res_sm8550,
...
...
diff view generated by jsdifflib
1
The CSID in sm8550 is gen3, it has new register offset and new
1
The CSID in sm8550 is version 780, it has new register offset
2
functionality. The buf done irq,register update and reset are
2
and new functionality. The buf done irq, register update and
3
moved to CSID gen3.
3
reset are moved to CSID 780.
4
5
The sm8550 also has a new block is named as CSID top, CSID can
6
connect to VFE or SFE(Sensor Front End), the connection is controlled
7
by CSID top.
8
4
9
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
5
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
10
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
6
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
11
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
12
---
9
---
13
drivers/media/platform/qcom/camss/Makefile | 1 +
10
drivers/media/platform/qcom/camss/Makefile | 1 +
14
.../platform/qcom/camss/camss-csid-gen3.c | 339 ++++++++++++++++++
11
.../platform/qcom/camss/camss-csid-780.c | 337 ++++++++++++++++++
15
.../platform/qcom/camss/camss-csid-gen3.h | 26 ++
12
.../platform/qcom/camss/camss-csid-780.h | 25 ++
16
.../media/platform/qcom/camss/camss-csid.c | 46 ++-
13
.../media/platform/qcom/camss/camss-csid.h | 1 +
17
.../media/platform/qcom/camss/camss-csid.h | 10 +
14
drivers/media/platform/qcom/camss/camss.c | 85 +++++
18
drivers/media/platform/qcom/camss/camss.c | 91 +++++
15
5 files changed, 449 insertions(+)
19
drivers/media/platform/qcom/camss/camss.h | 2 +
16
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-780.c
20
7 files changed, 503 insertions(+), 12 deletions(-)
17
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-780.h
21
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-gen3.c
22
create mode 100644 drivers/media/platform/qcom/camss/camss-csid-gen3.h
23
18
24
diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
19
diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
25
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
26
--- a/drivers/media/platform/qcom/camss/Makefile
21
--- a/drivers/media/platform/qcom/camss/Makefile
27
+++ b/drivers/media/platform/qcom/camss/Makefile
22
+++ b/drivers/media/platform/qcom/camss/Makefile
28
@@ -XXX,XX +XXX,XX @@ qcom-camss-objs += \
23
@@ -XXX,XX +XXX,XX @@ qcom-camss-objs += \
29
        camss-csid-4-1.o \
24
        camss-csid-4-1.o \
30
        camss-csid-4-7.o \
25
        camss-csid-4-7.o \
31
        camss-csid-gen2.o \
26
        camss-csid-gen2.o \
32
+        camss-csid-gen3.o \
27
+        camss-csid-780.o \
33
        camss-csiphy-2ph-1-0.o \
28
        camss-csiphy-2ph-1-0.o \
34
        camss-csiphy-3ph-1-0.o \
29
        camss-csiphy-3ph-1-0.o \
35
        camss-csiphy.o \
30
        camss-csiphy.o \
36
diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
31
diff --git a/drivers/media/platform/qcom/camss/camss-csid-780.c b/drivers/media/platform/qcom/camss/camss-csid-780.c
37
new file mode 100644
32
new file mode 100644
38
index XXXXXXX..XXXXXXX
33
index XXXXXXX..XXXXXXX
39
--- /dev/null
34
--- /dev/null
40
+++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
35
+++ b/drivers/media/platform/qcom/camss/camss-csid-780.c
41
@@ -XXX,XX +XXX,XX @@
36
@@ -XXX,XX +XXX,XX @@
42
+// SPDX-License-Identifier: GPL-2.0
37
+// SPDX-License-Identifier: GPL-2.0
43
+/*
38
+/*
44
+ * camss-csid-gen3.c
45
+ *
46
+ * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
39
+ * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
47
+ *
40
+ *
48
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
41
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
49
+ */
42
+ */
50
+#include <linux/completion.h>
43
+#include <linux/completion.h>
...
...
54
+#include <linux/kernel.h>
47
+#include <linux/kernel.h>
55
+#include <linux/of.h>
48
+#include <linux/of.h>
56
+
49
+
57
+#include "camss.h"
50
+#include "camss.h"
58
+#include "camss-csid.h"
51
+#include "camss-csid.h"
59
+#include "camss-csid-gen3.h"
52
+#include "camss-csid-780.h"
60
+
53
+
61
+#define CSID_TOP_IO_PATH_CFG0(csid)    (0x4 * (csid))
54
+#define CSID_IO_PATH_CFG0(csid)        (0x4 * (csid))
62
+#define        OUTPUT_IFE_EN            0x100
55
+#define        OUTPUT_IFE_EN            0x100
63
+#define        INTERNAL_CSID            1
56
+#define        INTERNAL_CSID            1
64
+
57
+
65
+#define CSID_RST_CFG            0xC
58
+#define CSID_RST_CFG            0xC
66
+#define        RST_MODE            0
59
+#define        RST_MODE            BIT(0)
67
+#define        RST_LOCATION            4
60
+#define        RST_LOCATION            BIT(4)
68
+
61
+
69
+#define CSID_RST_CMD            0x10
62
+#define CSID_RST_CMD            0x10
70
+#define        SELECT_HW_RST            0
63
+#define        SELECT_HW_RST            BIT(0)
71
+#define        SELECT_SW_RST            1
64
+#define        SELECT_IRQ_RST            BIT(2)
72
+#define        SELECT_IRQ_RST            2
65
+
66
+#define CSID_IRQ_CMD            0x14
67
+#define        IRQ_CMD_CLEAR            BIT(0)
68
+
69
+#define CSID_RUP_AUP_CMD        0x18
70
+#define        CSID_RUP_AUP_RDI(rdi)        ((BIT(4) | BIT(20)) << (rdi))
71
+
72
+#define CSID_TOP_IRQ_STATUS        0x7C
73
+#define         TOP_IRQ_STATUS_RESET_DONE    BIT(0)
74
+
75
+#define CSID_TOP_IRQ_MASK        0x80
76
+#define CSID_TOP_IRQ_CLEAR        0x84
77
+#define CSID_TOP_IRQ_SET        0x88
73
+
78
+
74
+#define CSID_CSI2_RX_IRQ_STATUS        0x9C
79
+#define CSID_CSI2_RX_IRQ_STATUS        0x9C
75
+#define CSID_CSI2_RX_IRQ_MASK        0xA0
80
+#define CSID_CSI2_RX_IRQ_MASK        0xA0
76
+#define CSID_CSI2_RX_IRQ_CLEAR        0xA4
81
+#define CSID_CSI2_RX_IRQ_CLEAR        0xA4
77
+#define CSID_CSI2_RX_IRQ_SET        0xA8
82
+#define CSID_CSI2_RX_IRQ_SET        0xA8
78
+
79
+#define CSID_CSI2_RDIN_IRQ_STATUS(rdi)    (0xEC + 0x10 * (rdi))
80
+
81
+#define CSID_CSI2_RDIN_IRQ_CLEAR(rdi)    (0xF4 + 0x10 * (rdi))
82
+#define CSID_CSI2_RDIN_IRQ_SET(rdi)    (0xF8 + 0x10 * (rdi))
83
+
84
+#define CSID_TOP_IRQ_STATUS        0x7C
85
+#define         TOP_IRQ_STATUS_RESET_DONE    0
86
+
87
+#define CSID_TOP_IRQ_MASK        0x80
88
+#define CSID_TOP_IRQ_CLEAR        0x84
89
+#define CSID_TOP_IRQ_SET        0x88
90
+
91
+#define CSID_IRQ_CMD            0x14
92
+#define        IRQ_CMD_CLEAR            0
93
+#define        IRQ_CMD_SET            4
94
+
95
+#define CSID_REG_UPDATE_CMD        0x18
96
+
83
+
97
+#define CSID_BUF_DONE_IRQ_STATUS    0x8C
84
+#define CSID_BUF_DONE_IRQ_STATUS    0x8C
98
+#define        BUF_DONE_IRQ_STATUS_RDI_OFFSET    (csid_is_lite(csid) ? 1 : 14)
85
+#define        BUF_DONE_IRQ_STATUS_RDI_OFFSET    (csid_is_lite(csid) ? 1 : 14)
99
+#define CSID_BUF_DONE_IRQ_MASK        0x90
86
+#define CSID_BUF_DONE_IRQ_MASK        0x90
100
+#define CSID_BUF_DONE_IRQ_CLEAR        0x94
87
+#define CSID_BUF_DONE_IRQ_CLEAR        0x94
101
+#define CSID_BUF_DONE_IRQ_SET        0x98
88
+#define CSID_BUF_DONE_IRQ_SET        0x98
102
+
89
+
103
+#define    CSI2_RX_CFG0_PHY_SEL_BASE_IDX    1
90
+#define CSID_CSI2_RDIN_IRQ_STATUS(rdi)    (0xEC + 0x10 * (rdi))
91
+#define        RUP_DONE_IRQ_STATUS        BIT(23)
92
+
93
+#define CSID_CSI2_RDIN_IRQ_CLEAR(rdi)    (0xF4 + 0x10 * (rdi))
94
+#define CSID_CSI2_RDIN_IRQ_SET(rdi)    (0xF8 + 0x10 * (rdi))
104
+
95
+
105
+#define CSID_CSI2_RX_CFG0        0x200
96
+#define CSID_CSI2_RX_CFG0        0x200
106
+#define        CSI2_RX_CFG0_NUM_ACTIVE_LANES    0
97
+#define        CSI2_RX_CFG0_NUM_ACTIVE_LANES    0
107
+#define        CSI2_RX_CFG0_DL0_INPUT_SEL    4
98
+#define        CSI2_RX_CFG0_DL0_INPUT_SEL    4
108
+#define        CSI2_RX_CFG0_PHY_NUM_SEL    20
99
+#define        CSI2_RX_CFG0_PHY_NUM_SEL    20
109
+
100
+
110
+#define CSID_CSI2_RX_CFG1        0x204
101
+#define CSID_CSI2_RX_CFG1        0x204
111
+#define        CSI2_RX_CFG1_ECC_CORRECTION_EN    0
102
+#define        CSI2_RX_CFG1_ECC_CORRECTION_EN    BIT(0)
112
+#define        CSI2_RX_CFG1_VC_MODE        2
103
+#define        CSI2_RX_CFG1_VC_MODE        BIT(2)
113
+
104
+
114
+#define CSID_RDI_CFG0(rdi)        (0x500 + 0x100 * (rdi))
105
+#define CSID_RDI_CFG0(rdi)        (0x500 + 0x100 * (rdi))
115
+#define        RDI_CFG0_TIMESTAMP_EN        6
106
+#define        RDI_CFG0_TIMESTAMP_EN        BIT(6)
116
+#define        RDI_CFG0_TIMESTAMP_STB_SEL    8
107
+#define        RDI_CFG0_TIMESTAMP_STB_SEL    BIT(8)
117
+#define        RDI_CFG0_DECODE_FORMAT        12
108
+#define        RDI_CFG0_DECODE_FORMAT        12
118
+#define        RDI_CFG0_DT            16
109
+#define        RDI_CFG0_DT            16
119
+#define        RDI_CFG0_VC            22
110
+#define        RDI_CFG0_VC            22
120
+#define        RDI_CFG0_DT_ID            27
111
+#define        RDI_CFG0_DT_ID            27
121
+#define        RDI_CFG0_EN            31
112
+#define        RDI_CFG0_EN            BIT(31)
113
+
114
+#define CSID_RDI_CTRL(rdi)        (0x504 + 0x100 * (rdi))
115
+#define        RDI_CTRL_START_CMD        BIT(0)
122
+
116
+
123
+#define CSID_RDI_CFG1(rdi)        (0x510 + 0x100 * (rdi))
117
+#define CSID_RDI_CFG1(rdi)        (0x510 + 0x100 * (rdi))
124
+#define        RDI_CFG1_DROP_H_EN        5
118
+#define        RDI_CFG1_DROP_H_EN        BIT(5)
125
+#define        RDI_CFG1_DROP_V_EN        6
119
+#define        RDI_CFG1_DROP_V_EN        BIT(6)
126
+#define        RDI_CFG1_CROP_H_EN        7
120
+#define        RDI_CFG1_CROP_H_EN        BIT(7)
127
+#define        RDI_CFG1_CROP_V_EN        8
121
+#define        RDI_CFG1_CROP_V_EN        BIT(8)
128
+#define        RDI_CFG1_PIX_STORE        10
122
+#define        RDI_CFG1_PIX_STORE        BIT(10)
129
+#define        RDI_CFG1_PACKING_FORMAT        15
123
+#define        RDI_CFG1_PACKING_FORMAT_MIPI    BIT(15)
130
+
131
+#define CSID_RDI_CTRL(rdi)        (0x504 + 0x100 * (rdi))
132
+#define        RDI_CTRL_START_CMD        0
133
+
124
+
134
+#define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi)    (0x548 + 0x100 * (rdi))
125
+#define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi)    (0x548 + 0x100 * (rdi))
135
+#define CSID_RDI_IRQ_SUBSAMPLE_PERIOD(rdi)    (0x54C + 0x100 * (rdi))
126
+#define CSID_RDI_IRQ_SUBSAMPLE_PERIOD(rdi)    (0x54C + 0x100 * (rdi))
136
+
127
+
137
+static inline int reg_update_rdi(struct csid_device *csid, int n)
128
+#define CSI2_RX_CFG0_PHY_SEL_BASE_IDX    1
138
+{
139
+    return BIT(n + 4) + BIT(20 + n);
140
+}
141
+#define REG_UPDATE_RDI            reg_update_rdi
142
+
129
+
143
+static void __csid_configure_rx(struct csid_device *csid,
130
+static void __csid_configure_rx(struct csid_device *csid,
144
+                struct csid_phy_config *phy, int vc)
131
+                struct csid_phy_config *phy, int vc)
145
+{
132
+{
146
+    int val;
133
+    int val;
...
...
149
+    val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
136
+    val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
150
+    val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX) << CSI2_RX_CFG0_PHY_NUM_SEL;
137
+    val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX) << CSI2_RX_CFG0_PHY_NUM_SEL;
151
+
138
+
152
+    writel(val, csid->base + CSID_CSI2_RX_CFG0);
139
+    writel(val, csid->base + CSID_CSI2_RX_CFG0);
153
+
140
+
154
+    val = 1 << CSI2_RX_CFG1_ECC_CORRECTION_EN;
141
+    val = CSI2_RX_CFG1_ECC_CORRECTION_EN;
155
+    if (vc > 3)
142
+    if (vc > 3)
156
+        val |= 1 << CSI2_RX_CFG1_VC_MODE;
143
+        val |= CSI2_RX_CFG1_VC_MODE;
144
+
157
+    writel(val, csid->base + CSID_CSI2_RX_CFG1);
145
+    writel(val, csid->base + CSID_CSI2_RX_CFG1);
158
+}
146
+}
159
+
147
+
160
+static void __csid_ctrl_rdi(struct csid_device *csid, int enable, u8 rdi)
148
+static void __csid_ctrl_rdi(struct csid_device *csid, int enable, u8 rdi)
161
+{
149
+{
162
+    int val = 0;
150
+    int val = 0;
163
+
151
+
164
+    if (enable)
152
+    if (enable)
165
+        val = 1 << RDI_CTRL_START_CMD;
153
+        val = RDI_CTRL_START_CMD;
166
+
154
+
167
+    writel(val, csid->base + CSID_RDI_CTRL(rdi));
155
+    writel(val, csid->base + CSID_RDI_CTRL(rdi));
168
+}
156
+}
169
+
157
+
170
+static void __csid_configure_top(struct csid_device *csid)
158
+static void __csid_configure_wrapper(struct csid_device *csid)
171
+{
159
+{
172
+    u32 val;
160
+    u32 val;
173
+
161
+
174
+    /* csid lite doesn't need to configure top register */
162
+    /* csid lite doesn't need to configure top register */
175
+    if (csid->res->is_lite)
163
+    if (csid->res->is_lite)
176
+        return;
164
+        return;
177
+
165
+
178
+    /* CSID top is a new function in Titan780.
179
+     * CSID can connect to VFE & SFE(Sensor Front End).
180
+     * This connection is controlled by CSID top.
181
+     * Only enable VFE path in current driver.
182
+     */
183
+    val = OUTPUT_IFE_EN | INTERNAL_CSID;
166
+    val = OUTPUT_IFE_EN | INTERNAL_CSID;
184
+    writel(val, csid->camss->csid_top_base + CSID_TOP_IO_PATH_CFG0(csid->id));
167
+    writel(val, csid->camss->csid_wrapper_base + CSID_IO_PATH_CFG0(csid->id));
185
+}
168
+}
186
+
169
+
187
+static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 vc)
170
+static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 vc)
188
+{
171
+{
189
+    u32 val;
172
+    u32 val;
...
...
209
+     *
192
+     *
210
+     * CID : VC 3:0 << 2 | DT_ID 1:0
193
+     * CID : VC 3:0 << 2 | DT_ID 1:0
211
+     */
194
+     */
212
+    u8 dt_id = vc & 0x03;
195
+    u8 dt_id = vc & 0x03;
213
+
196
+
214
+    val = 1 << RDI_CFG0_TIMESTAMP_EN;
197
+    val = RDI_CFG0_TIMESTAMP_EN;
215
+    val |= 1 << RDI_CFG0_TIMESTAMP_STB_SEL;
198
+    val |= RDI_CFG0_TIMESTAMP_STB_SEL;
216
+    /* note: for non-RDI path, this should be format->decode_format */
199
+    /* note: for non-RDI path, this should be format->decode_format */
217
+    val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
200
+    val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
218
+    val |= vc << RDI_CFG0_VC;
201
+    val |= vc << RDI_CFG0_VC;
219
+    val |= format->data_type << RDI_CFG0_DT;
202
+    val |= format->data_type << RDI_CFG0_DT;
220
+    val |= dt_id << RDI_CFG0_DT_ID;
203
+    val |= dt_id << RDI_CFG0_DT_ID;
221
+
204
+
222
+    writel(val, csid->base + CSID_RDI_CFG0(vc));
205
+    writel(val, csid->base + CSID_RDI_CFG0(vc));
223
+
206
+
224
+    val = 1 << RDI_CFG1_PACKING_FORMAT;
207
+    val = RDI_CFG1_PACKING_FORMAT_MIPI;
225
+    val |= 1 << RDI_CFG1_PIX_STORE;
208
+    val |= RDI_CFG1_PIX_STORE;
226
+    val |= 1 << RDI_CFG1_DROP_H_EN;
209
+    val |= RDI_CFG1_DROP_H_EN;
227
+    val |= 1 << RDI_CFG1_DROP_V_EN;
210
+    val |= RDI_CFG1_DROP_V_EN;
228
+    val |= 1 << RDI_CFG1_CROP_H_EN;
211
+    val |= RDI_CFG1_CROP_H_EN;
229
+    val |= 1 << RDI_CFG1_CROP_V_EN;
212
+    val |= RDI_CFG1_CROP_V_EN;
230
+
213
+
231
+    writel(val, csid->base + CSID_RDI_CFG1(vc));
214
+    writel(val, csid->base + CSID_RDI_CFG1(vc));
232
+
215
+
233
+    val = 0;
216
+    val = 0;
234
+    writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc));
217
+    writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc));
...
...
240
+    writel(val, csid->base + CSID_RDI_CTRL(vc));
223
+    writel(val, csid->base + CSID_RDI_CTRL(vc));
241
+
224
+
242
+    val = readl(csid->base + CSID_RDI_CFG0(vc));
225
+    val = readl(csid->base + CSID_RDI_CFG0(vc));
243
+
226
+
244
+    if (enable)
227
+    if (enable)
245
+        val |= 1 << RDI_CFG0_EN;
228
+        val |= RDI_CFG0_EN;
246
+    writel(val, csid->base + CSID_RDI_CFG0(vc));
229
+    writel(val, csid->base + CSID_RDI_CFG0(vc));
247
+}
230
+}
248
+
231
+
249
+static void csid_configure_stream(struct csid_device *csid, u8 enable)
232
+static void csid_configure_stream(struct csid_device *csid, u8 enable)
250
+{
233
+{
251
+    u8 i;
234
+    u8 i;
235
+
236
+    __csid_configure_wrapper(csid);
252
+
237
+
253
+    /* Loop through all enabled VCs and configure stream for each */
238
+    /* Loop through all enabled VCs and configure stream for each */
254
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
239
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
255
+        if (csid->phy.en_vc & BIT(i)) {
240
+        if (csid->phy.en_vc & BIT(i)) {
256
+            __csid_configure_top(csid);
257
+            __csid_configure_rdi_stream(csid, enable, i);
241
+            __csid_configure_rdi_stream(csid, enable, i);
258
+            __csid_configure_rx(csid, &csid->phy, i);
242
+            __csid_configure_rx(csid, &csid->phy, i);
259
+            __csid_ctrl_rdi(csid, enable, i);
243
+            __csid_ctrl_rdi(csid, enable, i);
260
+        }
244
+        }
245
+}
246
+
247
+static int csid_configure_testgen_pattern(struct csid_device *csid, s32 val)
248
+{
249
+    return 0;
250
+}
251
+
252
+static void csid_subdev_reg_update(struct csid_device *csid, int port_id, bool clear)
253
+{
254
+    if (clear) {
255
+        csid->reg_update &= ~CSID_RUP_AUP_RDI(port_id);
256
+    } else {
257
+        csid->reg_update |= CSID_RUP_AUP_RDI(port_id);
258
+        writel(csid->reg_update, csid->base + CSID_RUP_AUP_CMD);
259
+    }
261
+}
260
+}
262
+
261
+
263
+/*
262
+/*
264
+ * csid_isr - CSID module interrupt service routine
263
+ * csid_isr - CSID module interrupt service routine
265
+ * @irq: Interrupt line
264
+ * @irq: Interrupt line
...
...
274
+    u8 reset_done;
273
+    u8 reset_done;
275
+    int i;
274
+    int i;
276
+
275
+
277
+    val = readl(csid->base + CSID_TOP_IRQ_STATUS);
276
+    val = readl(csid->base + CSID_TOP_IRQ_STATUS);
278
+    writel(val, csid->base + CSID_TOP_IRQ_CLEAR);
277
+    writel(val, csid->base + CSID_TOP_IRQ_CLEAR);
279
+    reset_done = val & BIT(TOP_IRQ_STATUS_RESET_DONE);
278
+    reset_done = val & TOP_IRQ_STATUS_RESET_DONE;
280
+
279
+
281
+    val = readl(csid->base + CSID_CSI2_RX_IRQ_STATUS);
280
+    val = readl(csid->base + CSID_CSI2_RX_IRQ_STATUS);
282
+    writel(val, csid->base + CSID_CSI2_RX_IRQ_CLEAR);
281
+    writel(val, csid->base + CSID_CSI2_RX_IRQ_CLEAR);
283
+
282
+
284
+    buf_done_val = readl(csid->base + CSID_BUF_DONE_IRQ_STATUS);
283
+    buf_done_val = readl(csid->base + CSID_BUF_DONE_IRQ_STATUS);
...
...
288
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
287
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
289
+        if (csid->phy.en_vc & BIT(i)) {
288
+        if (csid->phy.en_vc & BIT(i)) {
290
+            val = readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i));
289
+            val = readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i));
291
+            writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i));
290
+            writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i));
292
+
291
+
292
+            if (val & RUP_DONE_IRQ_STATUS)
293
+                /* clear the reg update bit */
294
+                csid_subdev_reg_update(csid, i, true);
295
+
293
+            if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i)) {
296
+            if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i)) {
294
+                /* For Titan 780, Buf Done IRQ&REG has been moved to CSID from VFE.
297
+                /*
295
+                 * Once CSID received Buf Done, need notify this event to VFE.
298
+                 * For Titan 780, bus done and RUP IRQ have been moved to
296
+                 * Trigger VFE to handle Buf Done process.
299
+                 * CSID from VFE. Once CSID received bus done, need notify
300
+                 * VFE of this event. Trigger VFE to handle bus done process.
297
+                 */
301
+                 */
298
+                camss_buf_done(csid->camss, csid->id, i);
302
+                camss_buf_done(csid->camss, csid->id, i);
299
+            }
303
+            }
300
+        }
304
+        }
301
+
305
+
302
+    val = 1 << IRQ_CMD_CLEAR;
306
+    val = IRQ_CMD_CLEAR;
303
+    writel(val, csid->base + CSID_IRQ_CMD);
307
+    writel(val, csid->base + CSID_IRQ_CMD);
304
+
308
+
305
+    if (reset_done)
309
+    if (reset_done)
306
+        complete(&csid->reset_complete);
310
+        complete(&csid->reset_complete);
307
+
311
+
...
...
327
+    writel(1, csid->base + CSID_TOP_IRQ_MASK);
331
+    writel(1, csid->base + CSID_TOP_IRQ_MASK);
328
+
332
+
329
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
333
+    for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
330
+        if (csid->phy.en_vc & BIT(i)) {
334
+        if (csid->phy.en_vc & BIT(i)) {
331
+            writel(BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i),
335
+            writel(BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i),
332
+                        csid->base + CSID_BUF_DONE_IRQ_CLEAR);
336
+             csid->base + CSID_BUF_DONE_IRQ_CLEAR);
333
+            writel(0x1 << IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD);
337
+            writel(IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD);
334
+            writel(BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i),
338
+            writel(BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i),
335
+                        csid->base + CSID_BUF_DONE_IRQ_MASK);
339
+             csid->base + CSID_BUF_DONE_IRQ_MASK);
336
+        }
340
+        }
337
+
341
+
338
+    /* preserve registers */
342
+    /* preserve registers */
339
+    val = (0x1 << RST_LOCATION) | (0x1 << RST_MODE);
343
+    val = RST_LOCATION | RST_MODE;
340
+    writel(val, csid->base + CSID_RST_CFG);
344
+    writel(val, csid->base + CSID_RST_CFG);
341
+
345
+
342
+    val = (0x1 << SELECT_HW_RST) | (0x1 << SELECT_IRQ_RST);
346
+    val = SELECT_HW_RST | SELECT_IRQ_RST;
343
+    writel(val, csid->base + CSID_RST_CMD);
347
+    writel(val, csid->base + CSID_RST_CMD);
344
+
348
+
345
+    time = wait_for_completion_timeout(&csid->reset_complete,
349
+    time = wait_for_completion_timeout(&csid->reset_complete,
346
+                     msecs_to_jiffies(CSID_RESET_TIMEOUT_MS));
350
+                     msecs_to_jiffies(CSID_RESET_TIMEOUT_MS));
347
+    if (!time) {
351
+    if (!time) {
...
...
350
+    }
354
+    }
351
+
355
+
352
+    return 0;
356
+    return 0;
353
+}
357
+}
354
+
358
+
355
+static void csid_subdev_reg_update(struct csid_device *csid, int port_id, bool is_clear)
356
+{
357
+    if (is_clear) {
358
+        csid->reg_update &= ~REG_UPDATE_RDI(csid, port_id);
359
+    } else {
360
+        csid->reg_update |= REG_UPDATE_RDI(csid, port_id);
361
+        writel(csid->reg_update, csid->base + CSID_REG_UPDATE_CMD);
362
+    }
363
+}
364
+
365
+static void csid_subdev_init(struct csid_device *csid)
359
+static void csid_subdev_init(struct csid_device *csid)
366
+{
360
+{
367
+    /* nop */
361
+    csid->testgen.nmodes = CSID_PAYLOAD_MODE_DISABLED;
368
+}
362
+}
369
+
363
+
370
+const struct csid_hw_ops csid_ops_gen3 = {
364
+const struct csid_hw_ops csid_ops_780 = {
371
+    /* No testgen pattern hw in csid gen3 HW */
372
+    .configure_testgen_pattern = NULL,
373
+    .configure_stream = csid_configure_stream,
365
+    .configure_stream = csid_configure_stream,
366
+    .configure_testgen_pattern = csid_configure_testgen_pattern,
374
+    .hw_version = csid_hw_version,
367
+    .hw_version = csid_hw_version,
375
+    .isr = csid_isr,
368
+    .isr = csid_isr,
376
+    .reset = csid_reset,
369
+    .reset = csid_reset,
377
+    .src_pad_code = csid_src_pad_code,
370
+    .src_pad_code = csid_src_pad_code,
378
+    .subdev_init = csid_subdev_init,
371
+    .subdev_init = csid_subdev_init,
379
+    .reg_update = csid_subdev_reg_update,
372
+    .reg_update = csid_subdev_reg_update,
380
+};
373
+};
381
diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.h b/drivers/media/platform/qcom/camss/camss-csid-gen3.h
374
diff --git a/drivers/media/platform/qcom/camss/camss-csid-780.h b/drivers/media/platform/qcom/camss/camss-csid-780.h
382
new file mode 100644
375
new file mode 100644
383
index XXXXXXX..XXXXXXX
376
index XXXXXXX..XXXXXXX
384
--- /dev/null
377
--- /dev/null
385
+++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.h
378
+++ b/drivers/media/platform/qcom/camss/camss-csid-780.h
386
@@ -XXX,XX +XXX,XX @@
379
@@ -XXX,XX +XXX,XX @@
387
+/* SPDX-License-Identifier: GPL-2.0 */
380
+/* SPDX-License-Identifier: GPL-2.0 */
388
+/*
381
+/*
389
+ * camss-csid-gen3.h
382
+ * camss-csid-780.h
390
+ *
383
+ *
391
+ * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module Generation 3
384
+ * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module Generation 3
392
+ *
385
+ *
393
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
386
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
394
+ */
387
+ */
395
+#ifndef QC_MSM_CAMSS_CSID_GEN3_H
388
+#ifndef __QC_MSM_CAMSS_CSID_780_H__
396
+#define QC_MSM_CAMSS_CSID_GEN3_H
389
+#define __QC_MSM_CAMSS_CSID_780_H__
397
+
390
+
398
+#define DECODE_FORMAT_UNCOMPRESSED_8_BIT    0x1
391
+#define DECODE_FORMAT_UNCOMPRESSED_8_BIT    0x1
399
+#define DECODE_FORMAT_UNCOMPRESSED_10_BIT    0x2
392
+#define DECODE_FORMAT_UNCOMPRESSED_10_BIT    0x2
400
+#define DECODE_FORMAT_UNCOMPRESSED_12_BIT    0x3
393
+#define DECODE_FORMAT_UNCOMPRESSED_12_BIT    0x3
401
+#define DECODE_FORMAT_UNCOMPRESSED_14_BIT    0x4
394
+#define DECODE_FORMAT_UNCOMPRESSED_14_BIT    0x4
402
+#define DECODE_FORMAT_UNCOMPRESSED_16_BIT    0x5
395
+#define DECODE_FORMAT_UNCOMPRESSED_16_BIT    0x5
403
+#define DECODE_FORMAT_UNCOMPRESSED_20_BIT    0x6
396
+#define DECODE_FORMAT_UNCOMPRESSED_20_BIT    0x6
404
+#define DECODE_FORMAT_UNCOMPRESSED_24_BIT    0x7
397
+#define DECODE_FORMAT_UNCOMPRESSED_24_BIT    0x7
405
+#define DECODE_FORMAT_PAYLOAD_ONLY        0xf
398
+#define DECODE_FORMAT_PAYLOAD_ONLY        0xf
406
+
399
+
407
+
408
+#define PLAIN_FORMAT_PLAIN8    0x0 /* supports DPCM, UNCOMPRESSED_6/8_BIT */
400
+#define PLAIN_FORMAT_PLAIN8    0x0 /* supports DPCM, UNCOMPRESSED_6/8_BIT */
409
+#define PLAIN_FORMAT_PLAIN16    0x1 /* supports DPCM, UNCOMPRESSED_10/16_BIT */
401
+#define PLAIN_FORMAT_PLAIN16    0x1 /* supports DPCM, UNCOMPRESSED_10/16_BIT */
410
+#define PLAIN_FORMAT_PLAIN32    0x2 /* supports UNCOMPRESSED_20_BIT */
402
+#define PLAIN_FORMAT_PLAIN32    0x2 /* supports UNCOMPRESSED_20_BIT */
411
+
403
+
412
+#endif /* QC_MSM_CAMSS_CSID_GEN3_H */
404
+#endif /* __QC_MSM_CAMSS_CSID_780_H__ */
413
diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
414
index XXXXXXX..XXXXXXX 100644
415
--- a/drivers/media/platform/qcom/camss/camss-csid.c
416
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
417
@@ -XXX,XX +XXX,XX @@ static void csid_try_format(struct csid_device *csid,
418
        break;
419
420
    case MSM_CSID_PAD_SRC:
421
-        if (csid->testgen_mode->cur.val == 0) {
422
+        if (!csid->testgen_mode || csid->testgen_mode->cur.val == 0) {
423
            /* Test generator is disabled, */
424
            /* keep pad formats in sync */
425
            u32 code = fmt->code;
426
@@ -XXX,XX +XXX,XX @@ static int csid_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
427
static int csid_set_test_pattern(struct csid_device *csid, s32 value)
428
{
429
    struct csid_testgen_config *tg = &csid->testgen;
430
+    const struct csid_hw_ops *hw_ops = csid->res->hw_ops;
431
432
    /* If CSID is linked to CSIPHY, do not allow to enable test generator */
433
    if (value && media_pad_remote_pad_first(&csid->pads[MSM_CSID_PAD_SINK]))
434
@@ -XXX,XX +XXX,XX @@ static int csid_set_test_pattern(struct csid_device *csid, s32 value)
435
436
    tg->enabled = !!value;
437
438
-    return csid->res->hw_ops->configure_testgen_pattern(csid, value);
439
+    if (hw_ops->configure_testgen_pattern)
440
+        return -EOPNOTSUPP;
441
+    else
442
+        return hw_ops->configure_testgen_pattern(csid, value);
443
}
444
445
/*
446
@@ -XXX,XX +XXX,XX @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
447
        csid->base = devm_platform_ioremap_resource_byname(pdev, res->reg[0]);
448
        if (IS_ERR(csid->base))
449
            return PTR_ERR(csid->base);
450
+
451
+        /* CSID "top" is a new function in new version HW,
452
+         * CSID can connect to VFE & SFE(Sensor Front End).
453
+         * this connection is controlled by CSID "top" registers.
454
+         * There is only one CSID "top" region for all CSIDs.
455
+         */
456
+        if (!csid_is_lite(csid) && res->reg[1] && !camss->csid_top_base) {
457
+            camss->csid_top_base =
458
+                devm_platform_ioremap_resource_byname(pdev, res->reg[1]);
459
+
460
+            if (IS_ERR(camss->csid_top_base))
461
+                return PTR_ERR(camss->csid_top_base);
462
+        }
463
    }
464
465
    /* Interrupt */
466
@@ -XXX,XX +XXX,XX @@ static int csid_link_setup(struct media_entity *entity,
467
468
        /* If test generator is enabled */
469
        /* do not allow a link from CSIPHY to CSID */
470
-        if (csid->testgen_mode->cur.val != 0)
471
+        if (csid->testgen_mode && csid->testgen_mode->cur.val != 0)
472
            return -EBUSY;
473
474
        sd = media_entity_to_v4l2_subdev(remote->entity);
475
@@ -XXX,XX +XXX,XX @@ int msm_csid_register_entity(struct csid_device *csid,
476
        return ret;
477
    }
478
479
-    csid->testgen_mode = v4l2_ctrl_new_std_menu_items(&csid->ctrls,
480
-                &csid_ctrl_ops, V4L2_CID_TEST_PATTERN,
481
-                csid->testgen.nmodes, 0, 0,
482
-                csid->testgen.modes);
483
-
484
-    if (csid->ctrls.error) {
485
-        dev_err(dev, "Failed to init ctrl: %d\n", csid->ctrls.error);
486
-        ret = csid->ctrls.error;
487
-        goto free_ctrl;
488
+    if (csid->res->hw_ops->configure_testgen_pattern) {
489
+        csid->testgen_mode =
490
+            v4l2_ctrl_new_std_menu_items(&csid->ctrls,
491
+                         &csid_ctrl_ops,
492
+                         V4L2_CID_TEST_PATTERN,
493
+                         csid->testgen.nmodes, 0,
494
+                         0, csid->testgen.modes);
495
+
496
+        if (csid->ctrls.error) {
497
+            dev_err(dev, "Failed to init ctrl: %d\n",
498
+                csid->ctrls.error);
499
+            ret = csid->ctrls.error;
500
+            goto free_ctrl;
501
+        }
502
    }
503
504
    csid->subdev.ctrl_handler = &csid->ctrls;
505
diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h
405
diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h
506
index XXXXXXX..XXXXXXX 100644
406
index XXXXXXX..XXXXXXX 100644
507
--- a/drivers/media/platform/qcom/camss/camss-csid.h
407
--- a/drivers/media/platform/qcom/camss/camss-csid.h
508
+++ b/drivers/media/platform/qcom/camss/camss-csid.h
408
+++ b/drivers/media/platform/qcom/camss/camss-csid.h
509
@@ -XXX,XX +XXX,XX @@ struct csid_hw_ops {
510
     * @csid: CSID device
511
     */
512
    void (*subdev_init)(struct csid_device *csid);
513
+
514
+    /*
515
+     * reg_update - receive message from other sub device
516
+     * @csid: CSID device
517
+     * @port_id: Port id
518
+     * @is_clear: Indicate if it is clearing reg update or setting reg update
519
+     */
520
+    void (*reg_update)(struct csid_device *csid, int port_id, bool is_clear);
521
};
522
523
struct csid_subdev_resources {
524
@@ -XXX,XX +XXX,XX @@ struct csid_device {
525
    struct media_pad pads[MSM_CSID_PADS_NUM];
526
    void __iomem *base;
527
    u32 irq;
528
+    u32 reg_update;
529
    char irq_name[30];
530
    struct camss_clock *clock;
531
    int nclocks;
532
@@ -XXX,XX +XXX,XX @@ extern const struct csid_formats csid_formats_gen2;
409
@@ -XXX,XX +XXX,XX @@ extern const struct csid_formats csid_formats_gen2;
533
extern const struct csid_hw_ops csid_ops_4_1;
410
extern const struct csid_hw_ops csid_ops_4_1;
534
extern const struct csid_hw_ops csid_ops_4_7;
411
extern const struct csid_hw_ops csid_ops_4_7;
535
extern const struct csid_hw_ops csid_ops_gen2;
412
extern const struct csid_hw_ops csid_ops_gen2;
536
+extern const struct csid_hw_ops csid_ops_gen3;
413
+extern const struct csid_hw_ops csid_ops_780;
537
414
538
/*
415
/*
539
* csid_is_lite - Check if CSID is CSID lite.
416
* csid_is_lite - Check if CSID is CSID lite.
540
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
417
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
541
index XXXXXXX..XXXXXXX 100644
418
index XXXXXXX..XXXXXXX 100644
542
--- a/drivers/media/platform/qcom/camss/camss.c
419
--- a/drivers/media/platform/qcom/camss/camss.c
543
+++ b/drivers/media/platform/qcom/camss/camss.c
420
+++ b/drivers/media/platform/qcom/camss/camss.c
544
@@ -XXX,XX +XXX,XX @@ static const struct camss_subdev_resources csiphy_res_8550[] = {
421
@@ -XXX,XX +XXX,XX @@ static const struct camss_subdev_resources csiphy_res_8550[] = {
545
    }
422
    }
546
};
423
};
547
424
425
+static const struct resources_wrapper csid_wrapper_res_sm8550 = {
426
+    .reg = "csid_wrapper",
427
+};
428
+
548
+static const struct camss_subdev_resources csid_res_8550[] = {
429
+static const struct camss_subdev_resources csid_res_8550[] = {
549
+    /* CSID0 */
430
+    /* CSID0 */
550
+    {
431
+    {
551
+        .regulators = { "vdda-phy", "vdda-pll" },
432
+        .regulators = {},
552
+        .clock = { "csid", "csiphy_rx" },
433
+        .clock = { "csid", "csiphy_rx" },
553
+        .clock_rate = { { 400000000, 480000000, 480000000, 480000000, 480000000 },
434
+        .clock_rate = { { 400000000, 480000000 },
554
+                { 400000000, 480000000, 480000000, 480000000, 480000000 } },
435
+                { 400000000, 480000000 } },
555
+        .reg = { "csid0", "csid_top" },
436
+        .reg = { "csid0" },
556
+        .interrupt = { "csid0" },
437
+        .interrupt = { "csid0" },
557
+        .csid = {
438
+        .csid = {
558
+            .is_lite = false,
439
+            .is_lite = false,
559
+            .parent_dev_ops = &vfe_parent_dev_ops,
440
+            .parent_dev_ops = &vfe_parent_dev_ops,
560
+            .hw_ops = &csid_ops_gen3,
441
+            .hw_ops = &csid_ops_780,
561
+            .formats = &csid_formats_gen2
442
+            .formats = &csid_formats_gen2
562
+        }
443
+        }
563
+    },
444
+    },
564
+    /* CSID1 */
445
+    /* CSID1 */
565
+    {
446
+    {
566
+        .regulators = { "vdda-phy", "vdda-pll" },
447
+        .regulators = {},
567
+        .clock = { "csid", "csiphy_rx" },
448
+        .clock = { "csid", "csiphy_rx" },
568
+        .clock_rate = { { 400000000, 480000000, 480000000, 480000000, 480000000 },
449
+        .clock_rate = { { 400000000, 480000000 },
569
+                { 400000000, 480000000, 480000000, 480000000, 480000000 } },
450
+                { 400000000, 480000000 } },
570
+        .reg = { "csid1", "csid_top" },
451
+        .reg = { "csid1" },
571
+        .interrupt = { "csid1" },
452
+        .interrupt = { "csid1" },
572
+        .csid = {
453
+        .csid = {
573
+            .is_lite = false,
454
+            .is_lite = false,
574
+            .parent_dev_ops = &vfe_parent_dev_ops,
455
+            .parent_dev_ops = &vfe_parent_dev_ops,
575
+            .hw_ops = &csid_ops_gen3,
456
+            .hw_ops = &csid_ops_780,
576
+            .formats = &csid_formats_gen2
457
+            .formats = &csid_formats_gen2
577
+        }
458
+        }
578
+    },
459
+    },
579
+    /* CSID2 */
460
+    /* CSID2 */
580
+    {
461
+    {
581
+        .regulators = { "vdda-phy", "vdda-pll" },
462
+        .regulators = {},
582
+        .clock = { "csid", "csiphy_rx" },
463
+        .clock = { "csid", "csiphy_rx" },
583
+        .clock_rate = { { 400000000, 480000000, 480000000, 480000000, 480000000 },
464
+        .clock_rate = { { 400000000, 480000000 },
584
+                { 400000000, 480000000, 480000000, 480000000, 480000000 } },
465
+                { 400000000, 480000000 } },
585
+        .reg = { "csid2", "csid_top" },
466
+        .reg = { "csid2" },
586
+        .interrupt = { "csid2" },
467
+        .interrupt = { "csid2" },
587
+        .csid = {
468
+        .csid = {
588
+            .is_lite = false,
469
+            .is_lite = false,
589
+            .parent_dev_ops = &vfe_parent_dev_ops,
470
+            .parent_dev_ops = &vfe_parent_dev_ops,
590
+            .hw_ops = &csid_ops_gen3,
471
+            .hw_ops = &csid_ops_780,
591
+            .formats = &csid_formats_gen2
472
+            .formats = &csid_formats_gen2
592
+        }
473
+        }
593
+    },
474
+    },
594
+    /* CSID3 */
475
+    /* CSID3 */
595
+    {
476
+    {
596
+        .regulators = { "vdda-phy", "vdda-pll" },
477
+        .regulators = {},
597
+        .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
478
+        .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
598
+        .clock_rate = { { 400000000, 480000000, 480000000, 480000000, 480000000 },
479
+        .clock_rate = { { 400000000, 480000000 },
599
+                { 400000000, 480000000, 480000000, 480000000, 480000000 } },
480
+                { 400000000, 480000000 } },
600
+        .reg = { "csid_lite0" },
481
+        .reg = { "csid_lite0" },
601
+        .interrupt = { "csid_lite0" },
482
+        .interrupt = { "csid_lite0" },
602
+        .csid = {
483
+        .csid = {
603
+            .is_lite = true,
484
+            .is_lite = true,
604
+            .parent_dev_ops = &vfe_parent_dev_ops,
485
+            .parent_dev_ops = &vfe_parent_dev_ops,
605
+            .hw_ops = &csid_ops_gen3,
486
+            .hw_ops = &csid_ops_780,
606
+            .formats = &csid_formats_gen2
487
+            .formats = &csid_formats_gen2
607
+        }
488
+        }
608
+    },
489
+    },
609
+    /* CSID4 */
490
+    /* CSID4 */
610
+    {
491
+    {
611
+        .regulators = { "vdda-phy", "vdda-pll" },
492
+        .regulators = {},
612
+        .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
493
+        .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
613
+        .clock_rate = { { 400000000, 480000000, 480000000, 480000000, 480000000 },
494
+        .clock_rate = { { 400000000, 480000000 },
614
+                { 400000000, 480000000, 480000000, 480000000, 480000000 } },
495
+                { 400000000, 480000000 } },
615
+        .reg = { "csid_lite1" },
496
+        .reg = { "csid_lite1" },
616
+        .interrupt = { "csid_lite1" },
497
+        .interrupt = { "csid_lite1" },
617
+        .csid = {
498
+        .csid = {
618
+            .is_lite = true,
499
+            .is_lite = true,
619
+            .parent_dev_ops = &vfe_parent_dev_ops,
500
+            .parent_dev_ops = &vfe_parent_dev_ops,
620
+            .hw_ops = &csid_ops_gen3,
501
+            .hw_ops = &csid_ops_780,
621
+            .formats = &csid_formats_gen2
502
+            .formats = &csid_formats_gen2
622
+        }
503
+        }
623
+    }
504
+    }
624
+};
505
+};
625
+
506
+
626
static const struct resources_icc icc_res_sm8550[] = {
507
static const struct resources_icc icc_res_sm8550[] = {
627
    {
508
    {
628
        .name = "ahb",
509
        .name = "ahb",
629
@@ -XXX,XX +XXX,XX @@ void camss_pm_domain_off(struct camss *camss, int id)
630
    }
631
}
632
633
+void camss_buf_done(struct camss *camss, int hw_id, int port_id)
634
+{
635
+    struct vfe_device *vfe;
636
+
637
+    if (hw_id < camss->res->vfe_num) {
638
+        vfe = &(camss->vfe[hw_id]);
639
+
640
+        vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
641
+    }
642
+}
643
+
644
static int vfe_parent_dev_ops_get(struct camss *camss, int id)
645
{
646
    int ret = -EINVAL;
647
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sm8550_resources = {
510
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sm8550_resources = {
648
    .version = CAMSS_8550,
511
    .version = CAMSS_8550,
649
    .pd_name = "top",
512
    .pd_name = "top",
650
    .csiphy_res = csiphy_res_8550,
513
    .csiphy_res = csiphy_res_8550,
651
+    .csid_res = csid_res_8550,
514
+    .csid_res = csid_res_8550,
515
+    .csid_wrapper_res = &csid_wrapper_res_sm8550,
652
    .icc_res = icc_res_sm8550,
516
    .icc_res = icc_res_sm8550,
653
    .icc_path_num = ARRAY_SIZE(icc_res_sm8550),
517
    .icc_path_num = ARRAY_SIZE(icc_res_sm8550),
654
    .csiphy_num = ARRAY_SIZE(csiphy_res_8550),
518
    .csiphy_num = ARRAY_SIZE(csiphy_res_8550),
655
+    .csid_num = ARRAY_SIZE(csid_res_8550),
519
+    .csid_num = ARRAY_SIZE(csid_res_8550),
656
    .link_entities = camss_link_entities
520
    .link_entities = camss_link_entities
657
};
521
};
658
522
659
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
660
index XXXXXXX..XXXXXXX 100644
661
--- a/drivers/media/platform/qcom/camss/camss.h
662
+++ b/drivers/media/platform/qcom/camss/camss.h
663
@@ -XXX,XX +XXX,XX @@ struct camss {
664
    struct device_link *genpd_link;
665
    struct icc_path *icc_path[ICC_SM8250_COUNT];
666
    const struct camss_resources *res;
667
+    void __iomem *csid_top_base;
668
};
669
670
struct camss_camera_interface {
671
@@ -XXX,XX +XXX,XX @@ void camss_pm_domain_off(struct camss *camss, int id);
672
int camss_vfe_get(struct camss *camss, int id);
673
void camss_vfe_put(struct camss *camss, int id);
674
void camss_delete(struct camss *camss);
675
+void camss_buf_done(struct camss *camss, int hw_id, int port_id);
676
677
#endif /* QC_MSM_CAMSS_H */
678
--
523
--
679
2.34.1
524
2.34.1
diff view generated by jsdifflib
1
Add support for VFE found on SM8550 (Titan 780). This implementation is
1
Add support for VFE found on SM8550 (Titan 780). This implementation is
2
based on the titan 480 implementation. It supports the normal and lite
2
based on the titan 480 implementation. It supports the normal and lite
3
VFE.
3
VFE.
4
4
5
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
5
Co-developed-by: Yongsheng Li <quic_yon@quicinc.com>
6
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
6
Signed-off-by: Yongsheng Li <quic_yon@quicinc.com>
7
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
8
---
9
---
9
drivers/media/platform/qcom/camss/Makefile | 1 +
10
drivers/media/platform/qcom/camss/Makefile | 1 +
10
.../media/platform/qcom/camss/camss-vfe-780.c | 148 ++++++++++++++++++
11
.../media/platform/qcom/camss/camss-vfe-780.c | 159 ++++++++++++++++++
11
drivers/media/platform/qcom/camss/camss-vfe.c | 33 ++--
12
drivers/media/platform/qcom/camss/camss-vfe.c | 2 +
12
drivers/media/platform/qcom/camss/camss-vfe.h | 1 +
13
drivers/media/platform/qcom/camss/camss-vfe.h | 1 +
13
drivers/media/platform/qcom/camss/camss.c | 132 ++++++++++++++++
14
drivers/media/platform/qcom/camss/camss.c | 121 +++++++++++++
14
drivers/media/platform/qcom/camss/camss.h | 2 +
15
5 files changed, 284 insertions(+)
15
6 files changed, 304 insertions(+), 13 deletions(-)
16
create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-780.c
16
create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-780.c
17
17
18
diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
18
diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
19
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
20
--- a/drivers/media/platform/qcom/camss/Makefile
20
--- a/drivers/media/platform/qcom/camss/Makefile
...
...
33
--- /dev/null
33
--- /dev/null
34
+++ b/drivers/media/platform/qcom/camss/camss-vfe-780.c
34
+++ b/drivers/media/platform/qcom/camss/camss-vfe-780.c
35
@@ -XXX,XX +XXX,XX @@
35
@@ -XXX,XX +XXX,XX @@
36
+// SPDX-License-Identifier: GPL-2.0
36
+// SPDX-License-Identifier: GPL-2.0
37
+/*
37
+/*
38
+ * camss-vfe-780.c
39
+ *
40
+ * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module v780 (SM8550)
38
+ * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module v780 (SM8550)
41
+ *
39
+ *
42
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
40
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
43
+ */
41
+ */
44
+
42
+
...
...
62
+#define        WM_CFG_MODE            BIT(16)
60
+#define        WM_CFG_MODE            BIT(16)
63
+#define VFE_BUS_WM_IMAGE_ADDR(n)    (BUS_REG_BASE + 0x204 + (n) * 0x100)
61
+#define VFE_BUS_WM_IMAGE_ADDR(n)    (BUS_REG_BASE + 0x204 + (n) * 0x100)
64
+#define VFE_BUS_WM_FRAME_INCR(n)    (BUS_REG_BASE + 0x208 + (n) * 0x100)
62
+#define VFE_BUS_WM_FRAME_INCR(n)    (BUS_REG_BASE + 0x208 + (n) * 0x100)
65
+#define VFE_BUS_WM_IMAGE_CFG_0(n)    (BUS_REG_BASE + 0x20c + (n) * 0x100)
63
+#define VFE_BUS_WM_IMAGE_CFG_0(n)    (BUS_REG_BASE + 0x20c + (n) * 0x100)
66
+#define        WM_IMAGE_CFG_0_DEFAULT_WIDTH    (0xFFFF)
64
+#define        WM_IMAGE_CFG_0_DEFAULT_WIDTH    (0xFFFF)
67
+#define VFE_BUS_WM_IMAGE_CFG_1(n)    (BUS_REG_BASE + 0x210 + (n) * 0x100)
68
+#define VFE_BUS_WM_IMAGE_CFG_2(n)    (BUS_REG_BASE + 0x214 + (n) * 0x100)
65
+#define VFE_BUS_WM_IMAGE_CFG_2(n)    (BUS_REG_BASE + 0x214 + (n) * 0x100)
69
+#define        WM_IMAGE_CFG_2_DEFAULT_STRIDE    (0xFFFF)
66
+#define        WM_IMAGE_CFG_2_DEFAULT_STRIDE    (0xFFFF)
70
+#define VFE_BUS_WM_PACKER_CFG(n)    (BUS_REG_BASE + 0x218 + (n) * 0x100)
67
+#define VFE_BUS_WM_PACKER_CFG(n)    (BUS_REG_BASE + 0x218 + (n) * 0x100)
71
+#define VFE_BUS_WM_HEADER_ADDR(n)    (BUS_REG_BASE + 0x220 + (n) * 0x100)
72
+#define VFE_BUS_WM_HEADER_INCR(n)    (BUS_REG_BASE + 0x224 + (n) * 0x100)
73
+#define VFE_BUS_WM_HEADER_CFG(n)    (BUS_REG_BASE + 0x228 + (n) * 0x100)
74
+
68
+
75
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PERIOD(n)    (BUS_REG_BASE + 0x230 + (n) * 0x100)
69
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PERIOD(n)    (BUS_REG_BASE + 0x230 + (n) * 0x100)
76
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PATTERN(n)    (BUS_REG_BASE + 0x234 + (n) * 0x100)
70
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PATTERN(n)    (BUS_REG_BASE + 0x234 + (n) * 0x100)
77
+#define VFE_BUS_WM_FRAMEDROP_PERIOD(n)        (BUS_REG_BASE + 0x238 + (n) * 0x100)
71
+#define VFE_BUS_WM_FRAMEDROP_PERIOD(n)        (BUS_REG_BASE + 0x238 + (n) * 0x100)
78
+#define VFE_BUS_WM_FRAMEDROP_PATTERN(n)        (BUS_REG_BASE + 0x23c + (n) * 0x100)
72
+#define VFE_BUS_WM_FRAMEDROP_PATTERN(n)        (BUS_REG_BASE + 0x23c + (n) * 0x100)
79
+
73
+
80
+#define VFE_BUS_WM_MMU_PREFETCH_CFG(n)        (BUS_REG_BASE + 0x260 + (n) * 0x100)
74
+#define VFE_BUS_WM_MMU_PREFETCH_CFG(n)        (BUS_REG_BASE + 0x260 + (n) * 0x100)
81
+#define VFE_BUS_WM_MMU_PREFETCH_MAX_OFFSET(n)    (BUS_REG_BASE + 0x264 + (n) * 0x100)
75
+#define VFE_BUS_WM_MMU_PREFETCH_MAX_OFFSET(n)    (BUS_REG_BASE + 0x264 + (n) * 0x100)
82
+#define VFE_BUS_WM_SYSTEM_CACHE_CFG(n)        (BUS_REG_BASE + 0x268 + (n) * 0x100)
76
+
83
+
77
+/*
84
+/* for titan 780, each bus client is hardcoded to a specific path */
78
+ * Bus client mapping:
79
+ *
80
+ * Full VFE:
81
+ * 23 = RDI0, 24 = RDI1, 25 = RDI2
82
+ *
83
+ * VFE LITE:
84
+ * 0 = RDI0, 1 = RDI1, 2 = RDI3, 4 = RDI4
85
+ */
85
+#define RDI_WM(n)            ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
86
+#define RDI_WM(n)            ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
86
+
87
+
87
+static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
88
+static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
88
+{
89
+{
89
+    struct v4l2_pix_format_mplane *pix =
90
+    struct v4l2_pix_format_mplane *pix =
90
+        &line->video_out.active_fmt.fmt.pix_mp;
91
+        &line->video_out.active_fmt.fmt.pix_mp;
91
+
92
+
92
+    wm = RDI_WM(wm); /* map to actual WM used (from wm=RDI index) */
93
+    wm = RDI_WM(wm);
93
+
94
+
94
+    /* no clock gating at bus input */
95
+    /* no clock gating at bus input */
95
+    writel(WM_CGC_OVERRIDE_ALL, vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
96
+    writel(WM_CGC_OVERRIDE_ALL, vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
96
+
97
+
97
+    writel(0x0, vfe->base + VFE_BUS_WM_TEST_BUS_CTRL);
98
+    writel(0x0, vfe->base + VFE_BUS_WM_TEST_BUS_CTRL);
...
...
116
+    writel(WM_CFG_EN | WM_CFG_MODE, vfe->base + VFE_BUS_WM_CFG(wm));
117
+    writel(WM_CFG_EN | WM_CFG_MODE, vfe->base + VFE_BUS_WM_CFG(wm));
117
+}
118
+}
118
+
119
+
119
+static void vfe_wm_stop(struct vfe_device *vfe, u8 wm)
120
+static void vfe_wm_stop(struct vfe_device *vfe, u8 wm)
120
+{
121
+{
121
+    wm = RDI_WM(wm); /* map to actual WM used (from wm=RDI index) */
122
+    wm = RDI_WM(wm);
122
+    writel(0, vfe->base + VFE_BUS_WM_CFG(wm));
123
+    writel(0, vfe->base + VFE_BUS_WM_CFG(wm));
123
+}
124
+}
124
+
125
+
125
+static void vfe_wm_update(struct vfe_device *vfe, u8 wm, u32 addr,
126
+static void vfe_wm_update(struct vfe_device *vfe, u8 wm, u32 addr,
126
+             struct vfe_line *line)
127
+             struct vfe_line *line)
127
+{
128
+{
128
+    wm = RDI_WM(wm); /* map to actual WM used (from wm=RDI index) */
129
+    wm = RDI_WM(wm);
129
+    writel((addr >> 8) & 0xFFFFFFFF, vfe->base + VFE_BUS_WM_IMAGE_ADDR(wm));
130
+    writel((addr >> 8) & 0xFFFFFFFF, vfe->base + VFE_BUS_WM_IMAGE_ADDR(wm));
130
+
131
+
131
+    dev_dbg(vfe->camss->dev, "%s wm:%d, image buf addr:0x%x\n",
132
+    dev_dbg(vfe->camss->dev, "wm:%d, image buf addr:0x%x\n",
132
+        __func__, wm, addr);
133
+        wm, addr);
133
+}
134
+}
134
+
135
+
135
+static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
136
+static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
136
+{
137
+{
137
+    int port_id = line_id;
138
+    int port_id = line_id;
138
+
139
+
139
+    /* RUP(register update) registers has beem moved to CSID in Titan 780.
140
+     * Notify the event of trigger RUP.
141
+     */
142
+    camss_reg_update(vfe->camss, vfe->id, port_id, false);
140
+    camss_reg_update(vfe->camss, vfe->id, port_id, false);
143
+}
141
+}
144
+
142
+
145
+static inline void vfe_reg_update_clear(struct vfe_device *vfe,
143
+static inline void vfe_reg_update_clear(struct vfe_device *vfe,
146
+                    enum vfe_line_id line_id)
144
+                    enum vfe_line_id line_id)
147
+{
145
+{
148
+    int port_id = line_id;
146
+    int port_id = line_id;
149
+
147
+
150
+    /* RUP(register update) registers has beem moved to CSID in Titan 780.
151
+     * Notify the event of trigger RUP clear.
152
+     */
153
+    camss_reg_update(vfe->camss, vfe->id, port_id, true);
148
+    camss_reg_update(vfe->camss, vfe->id, port_id, true);
154
+}
149
+}
155
+
150
+
156
+static const struct camss_video_ops vfe_video_ops_780 = {
151
+static const struct camss_video_ops vfe_video_ops_780 = {
157
+    .queue_buffer = vfe_queue_buffer_v2,
152
+    .queue_buffer = vfe_queue_buffer_v2,
...
...
161
+static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
156
+static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
162
+{
157
+{
163
+    vfe->video_ops = vfe_video_ops_780;
158
+    vfe->video_ops = vfe_video_ops_780;
164
+}
159
+}
165
+
160
+
161
+static void vfe_global_reset(struct vfe_device *vfe)
162
+{
163
+    vfe_isr_reset_ack(vfe);
164
+}
165
+
166
+static irqreturn_t vfe_isr(int irq, void *dev)
167
+{
168
+    /* nop */
169
+    return IRQ_HANDLED;
170
+}
171
+
172
+static int vfe_halt(struct vfe_device *vfe)
173
+{
174
+    /* rely on vfe_disable_output() to stop the VFE */
175
+    return 0;
176
+}
177
+
166
+const struct vfe_hw_ops vfe_ops_780 = {
178
+const struct vfe_hw_ops vfe_ops_780 = {
167
+    .enable_irq = NULL,
179
+    .global_reset = vfe_global_reset,
168
+    .global_reset = NULL,
169
+    .hw_version = vfe_hw_version,
180
+    .hw_version = vfe_hw_version,
170
+    .isr = NULL,
181
+    .isr = vfe_isr,
171
+    .pm_domain_off = vfe_pm_domain_off,
182
+    .pm_domain_off = vfe_pm_domain_off,
172
+    .pm_domain_on = vfe_pm_domain_on,
183
+    .pm_domain_on = vfe_pm_domain_on,
184
+    .reg_update = vfe_reg_update,
185
+    .reg_update_clear = vfe_reg_update_clear,
173
+    .subdev_init = vfe_subdev_init,
186
+    .subdev_init = vfe_subdev_init,
174
+    .vfe_disable = vfe_disable,
187
+    .vfe_disable = vfe_disable,
175
+    .vfe_enable = vfe_enable_v2,
188
+    .vfe_enable = vfe_enable_v2,
176
+    .vfe_halt = NULL,
189
+    .vfe_halt = vfe_halt,
177
+    .vfe_wm_start = vfe_wm_start,
190
+    .vfe_wm_start = vfe_wm_start,
178
+    .vfe_wm_stop = vfe_wm_stop,
191
+    .vfe_wm_stop = vfe_wm_stop,
179
+    .vfe_buf_done = vfe_buf_done,
192
+    .vfe_buf_done = vfe_buf_done,
180
+    .vfe_wm_update = vfe_wm_update,
193
+    .vfe_wm_update = vfe_wm_update,
181
+    .reg_update = vfe_reg_update,
182
+    .reg_update_clear = vfe_reg_update_clear,
183
+};
194
+};
184
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
195
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
185
index XXXXXXX..XXXXXXX 100644
196
index XXXXXXX..XXXXXXX 100644
186
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
197
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
187
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
198
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
188
@@ -XXX,XX +XXX,XX @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
199
@@ -XXX,XX +XXX,XX @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
189
    case CAMSS_845:
190
    case CAMSS_8250:
200
    case CAMSS_8250:
191
    case CAMSS_8280XP:
201
    case CAMSS_8280XP:
202
    case CAMSS_845:
192
+    case CAMSS_8550:
203
+    case CAMSS_8550:
193
        switch (sink_code) {
204
        switch (sink_code) {
194
        case MEDIA_BUS_FMT_YUYV8_1X16:
205
        case MEDIA_BUS_FMT_YUYV8_1X16:
195
        {
206
        {
196
@@ -XXX,XX +XXX,XX @@ int vfe_reset(struct vfe_device *vfe)
197
{
198
    unsigned long time;
199
200
-    reinit_completion(&vfe->reset_complete);
201
+    if (vfe->res->hw_ops->global_reset) {
202
+        reinit_completion(&vfe->reset_complete);
203
204
-    vfe->res->hw_ops->global_reset(vfe);
205
+        vfe->res->hw_ops->global_reset(vfe);
206
207
-    time = wait_for_completion_timeout(&vfe->reset_complete,
208
-        msecs_to_jiffies(VFE_RESET_TIMEOUT_MS));
209
-    if (!time) {
210
-        dev_err(vfe->camss->dev, "VFE reset timeout\n");
211
-        return -EIO;
212
+        time = wait_for_completion_timeout(&vfe->reset_complete,
213
+            msecs_to_jiffies(VFE_RESET_TIMEOUT_MS));
214
+        if (!time) {
215
+            dev_err(vfe->camss->dev, "VFE reset timeout\n");
216
+            return -EIO;
217
+        }
218
    }
219
220
    return 0;
221
@@ -XXX,XX +XXX,XX @@ void vfe_put(struct vfe_device *vfe)
222
    } else if (vfe->power_count == 1) {
223
        if (vfe->was_streaming) {
224
            vfe->was_streaming = 0;
225
-            vfe->res->hw_ops->vfe_halt(vfe);
226
+            if (vfe->res->hw_ops->vfe_halt)
227
+                vfe->res->hw_ops->vfe_halt(vfe);
228
        }
229
        camss_disable_clocks(vfe->nclocks, vfe->clock);
230
        pm_runtime_put_sync(vfe->camss->dev);
231
@@ -XXX,XX +XXX,XX @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
232
    vfe->irq = ret;
233
    snprintf(vfe->irq_name, sizeof(vfe->irq_name), "%s_%s%d",
234
         dev_name(dev), MSM_VFE_NAME, id);
235
-    ret = devm_request_irq(dev, vfe->irq, vfe->res->hw_ops->isr,
236
-             IRQF_TRIGGER_RISING, vfe->irq_name, vfe);
237
-    if (ret < 0) {
238
-        dev_err(dev, "request_irq failed: %d\n", ret);
239
-        return ret;
240
+    if (vfe->res->hw_ops->isr) {
241
+        ret = devm_request_irq(dev, vfe->irq, vfe->res->hw_ops->isr,
242
+                 IRQF_TRIGGER_RISING, vfe->irq_name, vfe);
243
+        if (ret < 0) {
244
+            dev_err(dev, "request_irq failed: %d\n", ret);
245
+            return ret;
246
+        }
247
    }
248
249
    /* Clocks */
250
@@ -XXX,XX +XXX,XX @@ static int vfe_bpl_align(struct vfe_device *vfe)
207
@@ -XXX,XX +XXX,XX @@ static int vfe_bpl_align(struct vfe_device *vfe)
251
    case CAMSS_845:
252
    case CAMSS_8250:
208
    case CAMSS_8250:
253
    case CAMSS_8280XP:
209
    case CAMSS_8280XP:
210
    case CAMSS_845:
254
+    case CAMSS_8550:
211
+    case CAMSS_8550:
255
        ret = 16;
212
        ret = 16;
256
        break;
213
        break;
257
    default:
214
    default:
258
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h
215
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h
...
...
279
+    /* VFE0 */
236
+    /* VFE0 */
280
+    {
237
+    {
281
+        .regulators = {},
238
+        .regulators = {},
282
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe0_fast_ahb",
239
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe0_fast_ahb",
283
+             "vfe0", "cpas_vfe0", "camnoc_axi" },
240
+             "vfe0", "cpas_vfe0", "camnoc_axi" },
284
+        .clock_rate = { { 0, 0, 0, 0, 0 },
241
+        .clock_rate = { { 0 },
285
+                { 0, 0, 0, 0, 80000000 },
242
+                { 80000000 },
286
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
243
+                { 300000000, 400000000 },
287
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
244
+                { 300000000, 400000000 },
288
+                { 466000000, 594000000, 675000000, 785000000, 785000000 },
245
+                { 466000000, 594000000, 675000000, 785000000 },
289
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
246
+                { 300000000, 400000000 },
290
+                { 300000000, 300000000, 400000000, 400000000, 400000000 } },
247
+                { 300000000, 400000000 } },
291
+        .reg = { "vfe0" },
248
+        .reg = { "vfe0" },
292
+        .interrupt = { "vfe0" },
249
+        .interrupt = { "vfe0" },
293
+        .vfe = {
250
+        .vfe = {
294
+            .line_num = 3,
251
+            .line_num = 3,
295
+            .is_lite = false,
252
+            .is_lite = false,
...
...
303
+    /* VFE1 */
260
+    /* VFE1 */
304
+    {
261
+    {
305
+        .regulators = {},
262
+        .regulators = {},
306
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe1_fast_ahb",
263
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe1_fast_ahb",
307
+             "vfe1", "cpas_vfe1", "camnoc_axi" },
264
+             "vfe1", "cpas_vfe1", "camnoc_axi" },
308
+        .clock_rate = {    { 0, 0, 0, 0, 0 },
265
+        .clock_rate = {    { 0 },
309
+                { 0, 0, 0, 0, 80000000 },
266
+                { 80000000 },
310
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
267
+                { 300000000, 400000000 },
311
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
268
+                { 300000000, 400000000 },
312
+                { 466000000, 594000000, 675000000, 785000000, 785000000 },
269
+                { 466000000, 594000000, 675000000, 785000000 },
313
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
270
+                { 300000000, 400000000 },
314
+                { 300000000, 300000000, 400000000, 400000000, 400000000 } },
271
+                { 300000000, 400000000 } },
315
+        .reg = { "vfe1" },
272
+        .reg = { "vfe1" },
316
+        .interrupt = { "vfe1" },
273
+        .interrupt = { "vfe1" },
317
+        .vfe = {
274
+        .vfe = {
318
+            .line_num = 3,
275
+            .line_num = 3,
319
+            .is_lite = false,
276
+            .is_lite = false,
...
...
327
+    /* VFE2 */
284
+    /* VFE2 */
328
+    {
285
+    {
329
+        .regulators = {},
286
+        .regulators = {},
330
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe2_fast_ahb",
287
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe2_fast_ahb",
331
+             "vfe2", "cpas_vfe2", "camnoc_axi" },
288
+             "vfe2", "cpas_vfe2", "camnoc_axi" },
332
+        .clock_rate = {    { 0, 0, 0, 0, 0 },
289
+        .clock_rate = {    { 0 },
333
+                { 0, 0, 0, 0, 80000000 },
290
+                { 80000000 },
334
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
291
+                { 300000000, 400000000 },
335
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
292
+                { 300000000, 400000000 },
336
+                { 466000000, 594000000, 675000000, 785000000, 785000000 },
293
+                { 466000000, 594000000, 675000000, 785000000 },
337
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
294
+                { 300000000, 400000000 },
338
+                { 300000000, 300000000, 400000000, 400000000, 400000000 } },
295
+                { 300000000, 400000000 } },
339
+        .reg = { "vfe2" },
296
+        .reg = { "vfe2" },
340
+        .interrupt = { "vfe2" },
297
+        .interrupt = { "vfe2" },
341
+        .vfe = {
298
+        .vfe = {
342
+            .line_num = 3,
299
+            .line_num = 3,
343
+            .is_lite = false,
300
+            .is_lite = false,
...
...
351
+    /* VFE3 lite */
308
+    /* VFE3 lite */
352
+    {
309
+    {
353
+        .regulators = {},
310
+        .regulators = {},
354
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe_lite_ahb",
311
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe_lite_ahb",
355
+             "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
312
+             "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
356
+        .clock_rate = {    { 0, 0, 0, 0, 0 },
313
+        .clock_rate = {    { 0 },
357
+                { 0, 0, 0, 0, 80000000 },
314
+                { 80000000 },
358
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
315
+                { 300000000, 400000000 },
359
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
316
+                { 300000000, 400000000 },
360
+                { 400000000, 480000000, 480000000, 480000000, 480000000 },
317
+                { 400000000, 480000000 },
361
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
318
+                { 300000000, 400000000 },
362
+                { 300000000, 300000000, 400000000, 400000000, 400000000 } },
319
+                { 300000000, 400000000 } },
363
+        .reg = { "vfe_lite0" },
320
+        .reg = { "vfe_lite0" },
364
+        .interrupt = { "vfe_lite0" },
321
+        .interrupt = { "vfe_lite0" },
365
+        .vfe = {
322
+        .vfe = {
366
+            .line_num = 4,
323
+            .line_num = 4,
367
+            .is_lite = true,
324
+            .is_lite = true,
...
...
373
+    /* VFE4 lite */
330
+    /* VFE4 lite */
374
+    {
331
+    {
375
+        .regulators = {},
332
+        .regulators = {},
376
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe_lite_ahb",
333
+        .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk", "vfe_lite_ahb",
377
+             "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
334
+             "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
378
+        .clock_rate = {    { 0, 0, 0, 0, 0 },
335
+        .clock_rate = {    { 0 },
379
+                { 0, 0, 0, 0, 80000000 },
336
+                { 80000000 },
380
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
337
+                { 300000000, 400000000 },
381
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
338
+                { 300000000, 400000000 },
382
+                { 400000000, 480000000, 480000000, 480000000, 480000000 },
339
+                { 400000000, 480000000 },
383
+                { 300000000, 300000000, 400000000, 400000000, 400000000 },
340
+                { 300000000, 400000000 },
384
+                { 300000000, 300000000, 400000000, 400000000, 400000000 } },
341
+                { 300000000, 400000000 } },
385
+        .reg = { "vfe_lite1" },
342
+        .reg = { "vfe_lite1" },
386
+        .interrupt = { "vfe_lite1" },
343
+        .interrupt = { "vfe_lite1" },
387
+        .vfe = {
344
+        .vfe = {
388
+            .line_num = 4,
345
+            .line_num = 4,
389
+            .is_lite = true,
346
+            .is_lite = true,
...
...
395
+};
352
+};
396
+
353
+
397
static const struct resources_icc icc_res_sm8550[] = {
354
static const struct resources_icc icc_res_sm8550[] = {
398
    {
355
    {
399
        .name = "ahb",
356
        .name = "ahb",
400
@@ -XXX,XX +XXX,XX @@ void camss_pm_domain_off(struct camss *camss, int id)
401
    }
402
}
403
404
+void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
405
+{
406
+    struct csid_device *csid;
407
+
408
+    if (hw_id < camss->res->csid_num) {
409
+        csid = &(camss->csid[hw_id]);
410
+
411
+        csid->res->hw_ops->reg_update(csid, port_id, is_clear);
412
+    }
413
+}
414
+
415
void camss_buf_done(struct camss *camss, int hw_id, int port_id)
416
{
417
    struct vfe_device *vfe;
418
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sm8550_resources = {
357
@@ -XXX,XX +XXX,XX @@ static const struct camss_resources sm8550_resources = {
419
    .pd_name = "top",
358
    .pd_name = "top",
420
    .csiphy_res = csiphy_res_8550,
359
    .csiphy_res = csiphy_res_8550,
421
    .csid_res = csid_res_8550,
360
    .csid_res = csid_res_8550,
422
+    .vfe_res = vfe_res_8550,
361
+    .vfe_res = vfe_res_8550,
362
    .csid_wrapper_res = &csid_wrapper_res_sm8550,
423
    .icc_res = icc_res_sm8550,
363
    .icc_res = icc_res_sm8550,
424
    .icc_path_num = ARRAY_SIZE(icc_res_sm8550),
364
    .icc_path_num = ARRAY_SIZE(icc_res_sm8550),
425
    .csiphy_num = ARRAY_SIZE(csiphy_res_8550),
365
    .csiphy_num = ARRAY_SIZE(csiphy_res_8550),
426
    .csid_num = ARRAY_SIZE(csid_res_8550),
366
    .csid_num = ARRAY_SIZE(csid_res_8550),
427
+    .vfe_num = ARRAY_SIZE(vfe_res_8550),
367
+    .vfe_num = ARRAY_SIZE(vfe_res_8550),
428
    .link_entities = camss_link_entities
368
    .link_entities = camss_link_entities
429
};
369
};
430
370
431
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
432
index XXXXXXX..XXXXXXX 100644
433
--- a/drivers/media/platform/qcom/camss/camss.h
434
+++ b/drivers/media/platform/qcom/camss/camss.h
435
@@ -XXX,XX +XXX,XX @@ int camss_vfe_get(struct camss *camss, int id);
436
void camss_vfe_put(struct camss *camss, int id);
437
void camss_delete(struct camss *camss);
438
void camss_buf_done(struct camss *camss, int hw_id, int port_id);
439
+void camss_reg_update(struct camss *camss, int hw_id,
440
+         int port_id, bool is_clear);
441
442
#endif /* QC_MSM_CAMSS_H */
443
--
371
--
444
2.34.1
372
2.34.1
diff view generated by jsdifflib