20
20
21
21
struct video_mcux_csi_config {
22
22
CSI_Type * base ;
23
- const struct device * sensor_dev ;
23
+ const struct device * source_dev ;
24
24
const struct pinctrl_dev_config * pincfg ;
25
25
};
26
26
@@ -144,7 +144,7 @@ static int video_mcux_csi_set_fmt(const struct device *dev, enum video_endpoint_
144
144
return - EIO ;
145
145
}
146
146
147
- if (config -> sensor_dev && video_set_format (config -> sensor_dev , ep , fmt )) {
147
+ if (config -> source_dev && video_set_format (config -> source_dev , ep , fmt )) {
148
148
return - EIO ;
149
149
}
150
150
@@ -160,8 +160,8 @@ static int video_mcux_csi_get_fmt(const struct device *dev, enum video_endpoint_
160
160
return - EINVAL ;
161
161
}
162
162
163
- if (config -> sensor_dev && !video_get_format (config -> sensor_dev , ep , fmt )) {
164
- /* align CSI with sensor fmt */
163
+ if (config -> source_dev && !video_get_format (config -> source_dev , ep , fmt )) {
164
+ /* align CSI with source fmt */
165
165
return video_mcux_csi_set_fmt (dev , ep , fmt );
166
166
}
167
167
@@ -179,7 +179,7 @@ static int video_mcux_csi_stream_start(const struct device *dev)
179
179
return - EIO ;
180
180
}
181
181
182
- if (config -> sensor_dev && video_stream_start (config -> sensor_dev )) {
182
+ if (config -> source_dev && video_stream_start (config -> source_dev )) {
183
183
return - EIO ;
184
184
}
185
185
@@ -192,7 +192,7 @@ static int video_mcux_csi_stream_stop(const struct device *dev)
192
192
struct video_mcux_csi_data * data = dev -> data ;
193
193
status_t ret ;
194
194
195
- if (config -> sensor_dev && video_stream_stop (config -> sensor_dev )) {
195
+ if (config -> source_dev && video_stream_stop (config -> source_dev )) {
196
196
return - EIO ;
197
197
}
198
198
@@ -283,9 +283,9 @@ static inline int video_mcux_csi_set_ctrl(const struct device *dev, unsigned int
283
283
const struct video_mcux_csi_config * config = dev -> config ;
284
284
int ret = - ENOTSUP ;
285
285
286
- /* Forward to sensor dev if any */
287
- if (config -> sensor_dev ) {
288
- ret = video_set_ctrl (config -> sensor_dev , cid , value );
286
+ /* Forward to source dev if any */
287
+ if (config -> source_dev ) {
288
+ ret = video_set_ctrl (config -> source_dev , cid , value );
289
289
}
290
290
291
291
return ret ;
@@ -296,9 +296,9 @@ static inline int video_mcux_csi_get_ctrl(const struct device *dev, unsigned int
296
296
const struct video_mcux_csi_config * config = dev -> config ;
297
297
int ret = - ENOTSUP ;
298
298
299
- /* Forward to sensor dev if any */
300
- if (config -> sensor_dev ) {
301
- ret = video_get_ctrl (config -> sensor_dev , cid , value );
299
+ /* Forward to source dev if any */
300
+ if (config -> source_dev ) {
301
+ ret = video_get_ctrl (config -> source_dev , cid , value );
302
302
}
303
303
304
304
return ret ;
@@ -314,15 +314,15 @@ static int video_mcux_csi_get_caps(const struct device *dev, enum video_endpoint
314
314
return - EINVAL ;
315
315
}
316
316
317
- /* Just forward to sensor dev for now */
318
- if (config -> sensor_dev ) {
319
- err = video_get_caps (config -> sensor_dev , ep , caps );
317
+ /* Just forward to source dev for now */
318
+ if (config -> source_dev ) {
319
+ err = video_get_caps (config -> source_dev , ep , caps );
320
320
}
321
321
322
322
/* NXP MCUX CSI request at least 2 buffer before starting */
323
323
caps -> min_vbuf_count = 2 ;
324
324
325
- /* no sensor dev */
325
+ /* no source dev */
326
326
return err ;
327
327
}
328
328
@@ -344,10 +344,10 @@ static int video_mcux_csi_init(const struct device *dev)
344
344
345
345
CSI_GetDefaultConfig (& data -> csi_config );
346
346
347
- /* check if there is any sensor device (video ctrl device)
347
+ /* check if there is any source device (video ctrl device)
348
348
* the device is not yet initialized so we only check if it exists
349
349
*/
350
- if (config -> sensor_dev == NULL ) {
350
+ if (config -> source_dev == NULL ) {
351
351
return - ENODEV ;
352
352
}
353
353
@@ -396,7 +396,7 @@ PINCTRL_DT_INST_DEFINE(0);
396
396
397
397
static const struct video_mcux_csi_config video_mcux_csi_config_0 = {
398
398
.base = (CSI_Type * )DT_INST_REG_ADDR (0 ),
399
- .sensor_dev = DEVICE_DT_GET (DT_INST_PHANDLE (0 , sensor )),
399
+ .source_dev = DEVICE_DT_GET (DT_INST_PHANDLE (0 , source )),
400
400
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET (0 ),
401
401
};
402
402
0 commit comments