20
20
#define AMDISP_OV05C10_REMOTE_EP_NAME "ov05c10_isp_4_1_1"
21
21
#define AMD_ISP_PLAT_DRV_NAME "amd-isp4"
22
22
23
+ static const struct software_node isp4_mipi1_endpoint_node ;
24
+ static const struct software_node ov05c10_endpoint_node ;
25
+
23
26
/*
24
27
* AMD ISP platform info definition to initialize sensor
25
28
* specific platform configuration to prepare the amdisp
@@ -42,55 +45,116 @@ struct amdisp_platform {
42
45
struct mutex lock ; /* protects i2c client creation */
43
46
};
44
47
45
- /* Top-level OV05C10 camera node property table */
48
+ /* Root AMD CAMERA SWNODE */
49
+
50
+ /* Root amd camera node definition */
51
+ static const struct software_node amd_camera_node = {
52
+ .name = "amd_camera" ,
53
+ };
54
+
55
+ /* ISP4 SWNODE */
56
+
57
+ /* ISP4 OV05C10 camera node definition */
58
+ static const struct software_node isp4_node = {
59
+ .name = "isp4" ,
60
+ .parent = & amd_camera_node ,
61
+ };
62
+
63
+ /*
64
+ * ISP4 Ports node definition. No properties defined for
65
+ * ports node.
66
+ */
67
+ static const struct software_node isp4_ports = {
68
+ .name = "ports" ,
69
+ .parent = & isp4_node ,
70
+ };
71
+
72
+ /*
73
+ * ISP4 Port node definition. No properties defined for
74
+ * port node.
75
+ */
76
+ static const struct software_node isp4_port_node = {
77
+ .name = "port@0" ,
78
+ .parent = & isp4_ports ,
79
+ };
80
+
81
+ /*
82
+ * ISP4 MIPI1 remote endpoint points to OV05C10 endpoint
83
+ * node.
84
+ */
85
+ static const struct software_node_ref_args isp4_refs [] = {
86
+ SOFTWARE_NODE_REFERENCE (& ov05c10_endpoint_node ),
87
+ };
88
+
89
+ /* ISP4 MIPI1 endpoint node properties table */
90
+ static const struct property_entry isp4_mipi1_endpoint_props [] = {
91
+ PROPERTY_ENTRY_REF_ARRAY ("remote-endpoint" , isp4_refs ),
92
+ { }
93
+ };
94
+
95
+ /* ISP4 MIPI1 endpoint node definition */
96
+ static const struct software_node isp4_mipi1_endpoint_node = {
97
+ .name = "endpoint" ,
98
+ .parent = & isp4_port_node ,
99
+ .properties = isp4_mipi1_endpoint_props ,
100
+ };
101
+
102
+ /* I2C1 SWNODE */
103
+
104
+ /* I2C1 camera node property table */
105
+ static const struct property_entry i2c1_camera_props [] = {
106
+ PROPERTY_ENTRY_U32 ("clock-frequency" , 1 * HZ_PER_MHZ ),
107
+ { }
108
+ };
109
+
110
+ /* I2C1 camera node definition */
111
+ static const struct software_node i2c1_node = {
112
+ .name = "i2c1" ,
113
+ .parent = & amd_camera_node ,
114
+ .properties = i2c1_camera_props ,
115
+ };
116
+
117
+ /* I2C1 camera node property table */
46
118
static const struct property_entry ov05c10_camera_props [] = {
47
119
PROPERTY_ENTRY_U32 ("clock-frequency" , 24 * HZ_PER_MHZ ),
48
120
{ }
49
121
};
50
122
51
- /* Root AMD ISP OV05C10 camera node definition */
52
- static const struct software_node camera_node = {
123
+ /* OV05C10 camera node definition */
124
+ static const struct software_node ov05c10_camera_node = {
53
125
.name = AMDISP_OV05C10_HID ,
126
+ .parent = & i2c1_node ,
54
127
.properties = ov05c10_camera_props ,
55
128
};
56
129
57
130
/*
58
- * AMD ISP OV05C10 Ports node definition. No properties defined for
131
+ * OV05C10 Ports node definition. No properties defined for
59
132
* ports node for OV05C10.
60
133
*/
61
- static const struct software_node ports = {
134
+ static const struct software_node ov05c10_ports = {
62
135
.name = "ports" ,
63
- .parent = & camera_node ,
64
- };
65
-
66
- /*
67
- * AMD ISP OV05C10 Port node definition. No properties defined for
68
- * port node for OV05C10.
69
- */
70
- static const struct software_node port_node = {
71
- .name = "port@" ,
72
- .parent = & ports ,
136
+ .parent = & ov05c10_camera_node ,
73
137
};
74
138
75
139
/*
76
- * Remote endpoint AMD ISP node definition. No properties defined for
77
- * remote endpoint node for OV05C10.
140
+ * OV05C10 Port node definition.
78
141
*/
79
- static const struct software_node remote_ep_isp_node = {
80
- .name = AMDISP_OV05C10_REMOTE_EP_NAME ,
142
+ static const struct software_node ov05c10_port_node = {
143
+ .name = "port@0" ,
144
+ .parent = & ov05c10_ports ,
81
145
};
82
146
83
147
/*
84
- * Remote endpoint reference for isp node included in the
85
- * OV05C10 endpoint .
148
+ * OV05C10 remote endpoint points to ISP4 MIPI1 endpoint
149
+ * node .
86
150
*/
87
151
static const struct software_node_ref_args ov05c10_refs [] = {
88
- SOFTWARE_NODE_REFERENCE (& remote_ep_isp_node ),
152
+ SOFTWARE_NODE_REFERENCE (& isp4_mipi1_endpoint_node ),
89
153
};
90
154
91
155
/* OV05C10 supports one single link frequency */
92
156
static const u64 ov05c10_link_freqs [] = {
93
- 925 * HZ_PER_MHZ ,
157
+ 900 * HZ_PER_MHZ ,
94
158
};
95
159
96
160
/* OV05C10 supports only 2-lane configuration */
@@ -110,27 +174,64 @@ static const struct property_entry ov05c10_endpoint_props[] = {
110
174
{ }
111
175
};
112
176
113
- /* AMD ISP endpoint node definition */
114
- static const struct software_node endpoint_node = {
177
+ /* OV05C10 endpoint node definition */
178
+ static const struct software_node ov05c10_endpoint_node = {
115
179
.name = "endpoint" ,
116
- .parent = & port_node ,
180
+ .parent = & ov05c10_port_node ,
117
181
.properties = ov05c10_endpoint_props ,
118
182
};
119
183
120
184
/*
121
- * AMD ISP swnode graph uses 5 nodes and also its relationship is
122
- * fixed to align with the structure that v4l2 expects for successful
123
- * endpoint fwnode parsing.
185
+ * AMD Camera swnode graph uses 10 nodes and also its relationship is
186
+ * fixed to align with the structure that v4l2 and i2c frameworks expects
187
+ * for successful parsing of fwnodes and its properties with standard names .
124
188
*
125
189
* It is only the node property_entries that will vary for each platform
126
190
* supporting different sensor modules.
191
+ *
192
+ * AMD ISP4 SWNODE GRAPH Structure
193
+ *
194
+ * amd_camera {
195
+ * isp4 {
196
+ * ports {
197
+ * port@0 {
198
+ * isp4_mipi1_ep: endpoint {
199
+ * remote-endpoint = &OMNI5C10_ep;
200
+ * };
201
+ * };
202
+ * };
203
+ * };
204
+ *
205
+ * i2c1 {
206
+ * clock-frequency = 1 MHz;
207
+ * OMNI5C10 {
208
+ * clock-frequency = 24MHz;
209
+ * ports {
210
+ * port@0 {
211
+ * OMNI5C10_ep: endpoint {
212
+ * bus-type = 4;
213
+ * data-lanes = <1 2>;
214
+ * link-frequencies = 900MHz;
215
+ * remote-endpoint = &isp4_mipi1;
216
+ * };
217
+ * };
218
+ * };
219
+ * };
220
+ * };
221
+ * };
222
+ *
127
223
*/
128
- static const struct software_node * ov05c10_nodes [] = {
129
- & camera_node ,
130
- & ports ,
131
- & port_node ,
132
- & endpoint_node ,
133
- & remote_ep_isp_node ,
224
+ static const struct software_node * amd_isp4_nodes [] = {
225
+ & amd_camera_node ,
226
+ & isp4_node ,
227
+ & isp4_ports ,
228
+ & isp4_port_node ,
229
+ & isp4_mipi1_endpoint_node ,
230
+ & i2c1_node ,
231
+ & ov05c10_camera_node ,
232
+ & ov05c10_ports ,
233
+ & ov05c10_port_node ,
234
+ & ov05c10_endpoint_node ,
134
235
NULL
135
236
};
136
237
@@ -140,7 +241,7 @@ static const struct amdisp_platform_info ov05c10_platform_config = {
140
241
.dev_name = "ov05c10" ,
141
242
I2C_BOARD_INFO ("ov05c10" , AMDISP_OV05C10_I2C_ADDR ),
142
243
},
143
- .swnodes = ov05c10_nodes ,
244
+ .swnodes = amd_isp4_nodes ,
144
245
};
145
246
146
247
static const struct acpi_device_id amdisp_sensor_ids [] = {
@@ -232,7 +333,8 @@ static struct amdisp_platform *prepare_amdisp_platform(struct device *dev,
232
333
if (ret )
233
334
return ERR_PTR (ret );
234
335
235
- isp4_platform -> board_info .swnode = src -> swnodes [0 ];
336
+ /* initialize ov05c10_camera_node */
337
+ isp4_platform -> board_info .swnode = src -> swnodes [6 ];
236
338
237
339
return isp4_platform ;
238
340
}
@@ -257,6 +359,7 @@ static int amd_isp_probe(struct platform_device *pdev)
257
359
{
258
360
const struct amdisp_platform_info * pinfo ;
259
361
struct amdisp_platform * isp4_platform ;
362
+ struct acpi_device * adev ;
260
363
int ret ;
261
364
262
365
pinfo = device_get_match_data (& pdev -> dev );
@@ -274,6 +377,10 @@ static int amd_isp_probe(struct platform_device *pdev)
274
377
if (ret )
275
378
goto error_unregister_sw_node ;
276
379
380
+ adev = ACPI_COMPANION (& pdev -> dev );
381
+ /* initialize root amd_camera_node */
382
+ adev -> driver_data = (void * )pinfo -> swnodes [0 ];
383
+
277
384
/* check if adapter is already registered and create i2c client instance */
278
385
i2c_for_each_dev (isp4_platform , try_to_instantiate_i2c_client );
279
386
0 commit comments