Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
/drivers/timer/cc13x2_cc26x2_rtc_timer.c @vanti
/drivers/usb/ @jfischer-phytec-iot @finikorg
/drivers/usb/device/usb_dc_stm32.c @ydamigos @loicpoulain
/drivers/video/ @loicpoulain
/drivers/i2c/i2c_ll_stm32* @ldts @ydamigos
/drivers/i2c/i2c_rv32m1_lpi2c* @henrikbrixandersen
/drivers/i2c/*sam0* @Sizurka
Expand Down
24 changes: 24 additions & 0 deletions boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ arduino_i2c: &i2c1 {};

&i2c1 {
status = "okay";

mt9m114@48 {
compatible = "aptina,mt9m114";
reg = <0x48>;
label = "MT9M114";
status = "okay";

port {
mt9m114_ep_out: endpoint {
remote-endpoint = <&csi_ep_in>;
Copy link
Contributor

@agansari agansari Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks redundant, there is the same definition in CSI, is it necessary?

Copy link
Contributor Author

@loicpoulain loicpoulain Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the 'official' way to link two devices though it's is currently not handled by the Zephyr devicetree parser, I expect it will be later...

FYI: example on linux: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/media/video-interfaces.txt

};
};
};
};

&uart1 {
Expand All @@ -101,3 +114,14 @@ arduino_i2c: &i2c1 {};
&usbd1 {
status = "okay";
};

&csi {
status = "okay";
sensor-label = "MT9M114";

port {
csi_ep_in: endpoint {
remote-endpoint = <&mt9m114_ep_out>;
};
};
};
1 change: 1 addition & 0 deletions boards/arm/mimxrt1064_evk/mimxrt1064_evk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ supported:
- pwm
- usb_device
- counter
- video
16 changes: 16 additions & 0 deletions boards/arm/mimxrt1064_evk/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,22 @@ static int mimxrt1064_evk_init(struct device *dev)
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_09_FLEXPWM2_PWMA03, 0);
#endif

#ifdef CONFIG_VIDEO_MCUX_CSI
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_04_GPIO1_IO04, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_04_CSI_PIXCLK, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_05_CSI_MCLK, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_06_CSI_VSYNC, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_07_CSI_HSYNC, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_08_CSI_DATA09, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_09_CSI_DATA08, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_10_CSI_DATA07, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_11_CSI_DATA06, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_12_CSI_DATA05, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_13_CSI_DATA04, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_14_CSI_DATA03, 0);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_15_CSI_DATA02, 0);
#endif

return 0;
}

Expand Down
1 change: 1 addition & 0 deletions doc/reference/peripherals/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Peripherals
spi.rst
uart.rst
watchdog.rst
video.rst
60 changes: 60 additions & 0 deletions doc/reference/peripherals/video.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. _video:


Video
#####

The video driver API offers a generic interface to video devices.

Basic Operation
***************

Video Device
============

A video device is the abstraction of a hardware or software video function,
which can produce, process, consume or transform video data. The video API is
designed to offer flexible way to create, handle and combine various video
devices.

Endpoint
========

Each video device can have one or more endpoints. Output endpoints configure
video output function and generate data. Input endpoints configure video input
function and consume data.

Video Buffer
============

A video buffer provides the transport mechanism for the data. There is no
particular requirement on the content. The requirement for the content is
defined by the endpoint format. A video buffer can be queued to a device
endpoint for filling (input ep) or consuming (output ep) operation, once
the operation is achieved, buffer can be dequeued for post-processing,
release or reuse.

Controls
========

A video control is accessed and identified by a CID (control identifier). It
represents a video control property. Different devices will have different
controls available which can be generic, related to a device class or vendor
specific. The set/get control functions provide a generic scalable interface
to handle and create controls.

Configuration Options
*********************

Related configuration options:

* :option:`CONFIG_VIDEO`

API Reference
*************

.. doxygengroup:: video_interface
:project: Zephyr

.. doxygengroup:: video_controls
:project: Zephyr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the images in the ppt/presentation in this document (or the sample documentation) as an example of how-to and/or your design intention.

1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ add_subdirectory_if_kconfig(hwinfo)
add_subdirectory_if_kconfig(espi)
add_subdirectory_if_kconfig(ps2)
add_subdirectory_if_kconfig(kscan)
add_subdirectory_if_kconfig(video)

add_subdirectory_ifdef(CONFIG_FLASH_HAS_DRIVER_ENABLED flash)
add_subdirectory_ifdef(CONFIG_SERIAL_HAS_DRIVER serial)
Expand Down
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ source "drivers/ps2/Kconfig"

source "drivers/kscan/Kconfig"

source "drivers/video/Kconfig"

endmenu
9 changes: 9 additions & 0 deletions drivers/video/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(video_common.c)

zephyr_library_sources_ifdef(CONFIG_VIDEO_MCUX_CSI video_mcux_csi.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_SW_GENERATOR video_sw_generator.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_MT9M114 mt9m114.c)
37 changes: 37 additions & 0 deletions drivers/video/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Kconfig - VIDEO driver configuration options

#
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

#
# VIDEO Drivers
#
menuconfig VIDEO
bool "VIDEO hardware support"
help
Enable support for the VIDEO.

if VIDEO

config VIDEO_BUFFER_POOL_SZ_MAX
int "Size of the largest buffer in the video pool"
default 1048576

config VIDEO_BUFFER_POOL_NUM_MAX
int "Number of maximum sized buffer in the video pool"
default 2

config VIDEO_BUFFER_POOL_ALIGN
int "Alignment of the video pool’s buffer"
default 64

source "drivers/video/Kconfig.mcux_csi"

source "drivers/video/Kconfig.sw_generator"

source "drivers/video/Kconfig.mt9m114"

endif # VIDEO
11 changes: 11 additions & 0 deletions drivers/video/Kconfig.mcux_csi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Kconfig - NXP MCUX CSI driver configuration options

#
# Copyright (c) 2019, Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig VIDEO_MCUX_CSI
bool "NXP MCUX CMOS Sensor Interface (CSI) driver"
depends on HAS_MCUX_CSI
13 changes: 13 additions & 0 deletions drivers/video/Kconfig.mt9m114
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Kconfig - MT9m114

#
# Copyright (c) 2016 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig VIDEO_MT9M114
bool "MT9M114 Aptina CMOS digital image sensor"
depends on I2C
help
Enable driver for MT9M114 CMOS digital image sensor device.
12 changes: 12 additions & 0 deletions drivers/video/Kconfig.sw_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Kconfig - MT9m114

#
# Copyright (c) 2016 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig VIDEO_SW_GENERATOR
bool "Video Software Generator"
help
Enable video pattern generator (for testing purpose).
Loading