Commit 97548ed4c4661502cdfd1aabd5d3876fa4f5cc2e
Committed by
Mauro Carvalho Chehab
1 parent
1651333b09
Exists in
master
and in
39 other branches
[media] media: Links setup
Create the following ioctl and implement it at the media device level to setup links. - MEDIA_IOC_SETUP_LINK: Modify the properties of a given link The only property that can currently be modified is the ENABLED link flag to enable/disable a link. Links marked with the IMMUTABLE link flag can not be enabled or disabled. Enabling or disabling a link has effects on entities' use count. Those changes are automatically propagated through the graph. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 9 changed files with 356 additions and 0 deletions Inline Diff
- Documentation/DocBook/media-entities.tmpl
- Documentation/DocBook/v4l/media-controller.xml
- Documentation/DocBook/v4l/media-ioc-setup-link.xml
- Documentation/media-framework.txt
- drivers/media/media-device.c
- drivers/media/media-entity.c
- include/linux/media.h
- include/media/media-device.h
- include/media/media-entity.h
Documentation/DocBook/media-entities.tmpl
1 | <!-- Generated file! Do not edit. --> | 1 | <!-- Generated file! Do not edit. --> |
2 | 2 | ||
3 | <!-- Functions --> | 3 | <!-- Functions --> |
4 | <!ENTITY func-close "<link linkend='func-close'><function>close()</function></link>"> | 4 | <!ENTITY func-close "<link linkend='func-close'><function>close()</function></link>"> |
5 | <!ENTITY func-ioctl "<link linkend='func-ioctl'><function>ioctl()</function></link>"> | 5 | <!ENTITY func-ioctl "<link linkend='func-ioctl'><function>ioctl()</function></link>"> |
6 | <!ENTITY func-mmap "<link linkend='func-mmap'><function>mmap()</function></link>"> | 6 | <!ENTITY func-mmap "<link linkend='func-mmap'><function>mmap()</function></link>"> |
7 | <!ENTITY func-munmap "<link linkend='func-munmap'><function>munmap()</function></link>"> | 7 | <!ENTITY func-munmap "<link linkend='func-munmap'><function>munmap()</function></link>"> |
8 | <!ENTITY func-open "<link linkend='func-open'><function>open()</function></link>"> | 8 | <!ENTITY func-open "<link linkend='func-open'><function>open()</function></link>"> |
9 | <!ENTITY func-poll "<link linkend='func-poll'><function>poll()</function></link>"> | 9 | <!ENTITY func-poll "<link linkend='func-poll'><function>poll()</function></link>"> |
10 | <!ENTITY func-read "<link linkend='func-read'><function>read()</function></link>"> | 10 | <!ENTITY func-read "<link linkend='func-read'><function>read()</function></link>"> |
11 | <!ENTITY func-select "<link linkend='func-select'><function>select()</function></link>"> | 11 | <!ENTITY func-select "<link linkend='func-select'><function>select()</function></link>"> |
12 | <!ENTITY func-write "<link linkend='func-write'><function>write()</function></link>"> | 12 | <!ENTITY func-write "<link linkend='func-write'><function>write()</function></link>"> |
13 | 13 | ||
14 | <!ENTITY media-func-close "<link linkend='media-func-close'><function>close()</function></link>"> | 14 | <!ENTITY media-func-close "<link linkend='media-func-close'><function>close()</function></link>"> |
15 | <!ENTITY media-func-ioctl "<link linkend='media-func-ioctl'><function>ioctl()</function></link>"> | 15 | <!ENTITY media-func-ioctl "<link linkend='media-func-ioctl'><function>ioctl()</function></link>"> |
16 | <!ENTITY media-func-open "<link linkend='media-func-open'><function>open()</function></link>"> | 16 | <!ENTITY media-func-open "<link linkend='media-func-open'><function>open()</function></link>"> |
17 | 17 | ||
18 | <!-- Ioctls --> | 18 | <!-- Ioctls --> |
19 | <!ENTITY VIDIOC-CROPCAP "<link linkend='vidioc-cropcap'><constant>VIDIOC_CROPCAP</constant></link>"> | 19 | <!ENTITY VIDIOC-CROPCAP "<link linkend='vidioc-cropcap'><constant>VIDIOC_CROPCAP</constant></link>"> |
20 | <!ENTITY VIDIOC-DBG-G-CHIP-IDENT "<link linkend='vidioc-dbg-g-chip-ident'><constant>VIDIOC_DBG_G_CHIP_IDENT</constant></link>"> | 20 | <!ENTITY VIDIOC-DBG-G-CHIP-IDENT "<link linkend='vidioc-dbg-g-chip-ident'><constant>VIDIOC_DBG_G_CHIP_IDENT</constant></link>"> |
21 | <!ENTITY VIDIOC-DBG-G-REGISTER "<link linkend='vidioc-dbg-g-register'><constant>VIDIOC_DBG_G_REGISTER</constant></link>"> | 21 | <!ENTITY VIDIOC-DBG-G-REGISTER "<link linkend='vidioc-dbg-g-register'><constant>VIDIOC_DBG_G_REGISTER</constant></link>"> |
22 | <!ENTITY VIDIOC-DBG-S-REGISTER "<link linkend='vidioc-dbg-g-register'><constant>VIDIOC_DBG_S_REGISTER</constant></link>"> | 22 | <!ENTITY VIDIOC-DBG-S-REGISTER "<link linkend='vidioc-dbg-g-register'><constant>VIDIOC_DBG_S_REGISTER</constant></link>"> |
23 | <!ENTITY VIDIOC-DQBUF "<link linkend='vidioc-qbuf'><constant>VIDIOC_DQBUF</constant></link>"> | 23 | <!ENTITY VIDIOC-DQBUF "<link linkend='vidioc-qbuf'><constant>VIDIOC_DQBUF</constant></link>"> |
24 | <!ENTITY VIDIOC-DQEVENT "<link linkend='vidioc-dqevent'><constant>VIDIOC_DQEVENT</constant></link>"> | 24 | <!ENTITY VIDIOC-DQEVENT "<link linkend='vidioc-dqevent'><constant>VIDIOC_DQEVENT</constant></link>"> |
25 | <!ENTITY VIDIOC-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_ENCODER_CMD</constant></link>"> | 25 | <!ENTITY VIDIOC-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_ENCODER_CMD</constant></link>"> |
26 | <!ENTITY VIDIOC-ENUMAUDIO "<link linkend='vidioc-enumaudio'><constant>VIDIOC_ENUMAUDIO</constant></link>"> | 26 | <!ENTITY VIDIOC-ENUMAUDIO "<link linkend='vidioc-enumaudio'><constant>VIDIOC_ENUMAUDIO</constant></link>"> |
27 | <!ENTITY VIDIOC-ENUMAUDOUT "<link linkend='vidioc-enumaudioout'><constant>VIDIOC_ENUMAUDOUT</constant></link>"> | 27 | <!ENTITY VIDIOC-ENUMAUDOUT "<link linkend='vidioc-enumaudioout'><constant>VIDIOC_ENUMAUDOUT</constant></link>"> |
28 | <!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> | 28 | <!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> |
29 | <!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> | 29 | <!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> |
30 | <!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> | 30 | <!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> |
31 | <!ENTITY VIDIOC-ENUM-DV-PRESETS "<link linkend='vidioc-enum-dv-presets'><constant>VIDIOC_ENUM_DV_PRESETS</constant></link>"> | 31 | <!ENTITY VIDIOC-ENUM-DV-PRESETS "<link linkend='vidioc-enum-dv-presets'><constant>VIDIOC_ENUM_DV_PRESETS</constant></link>"> |
32 | <!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> | 32 | <!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> |
33 | <!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> | 33 | <!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> |
34 | <!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> | 34 | <!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> |
35 | <!ENTITY VIDIOC-G-AUDIO "<link linkend='vidioc-g-audio'><constant>VIDIOC_G_AUDIO</constant></link>"> | 35 | <!ENTITY VIDIOC-G-AUDIO "<link linkend='vidioc-g-audio'><constant>VIDIOC_G_AUDIO</constant></link>"> |
36 | <!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> | 36 | <!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> |
37 | <!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> | 37 | <!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> |
38 | <!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> | 38 | <!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> |
39 | <!ENTITY VIDIOC-G-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_G_DV_PRESET</constant></link>"> | 39 | <!ENTITY VIDIOC-G-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_G_DV_PRESET</constant></link>"> |
40 | <!ENTITY VIDIOC-G-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_G_DV_TIMINGS</constant></link>"> | 40 | <!ENTITY VIDIOC-G-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_G_DV_TIMINGS</constant></link>"> |
41 | <!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> | 41 | <!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> |
42 | <!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> | 42 | <!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> |
43 | <!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> | 43 | <!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> |
44 | <!ENTITY VIDIOC-G-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_G_FMT</constant></link>"> | 44 | <!ENTITY VIDIOC-G-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_G_FMT</constant></link>"> |
45 | <!ENTITY VIDIOC-G-FREQUENCY "<link linkend='vidioc-g-frequency'><constant>VIDIOC_G_FREQUENCY</constant></link>"> | 45 | <!ENTITY VIDIOC-G-FREQUENCY "<link linkend='vidioc-g-frequency'><constant>VIDIOC_G_FREQUENCY</constant></link>"> |
46 | <!ENTITY VIDIOC-G-INPUT "<link linkend='vidioc-g-input'><constant>VIDIOC_G_INPUT</constant></link>"> | 46 | <!ENTITY VIDIOC-G-INPUT "<link linkend='vidioc-g-input'><constant>VIDIOC_G_INPUT</constant></link>"> |
47 | <!ENTITY VIDIOC-G-JPEGCOMP "<link linkend='vidioc-g-jpegcomp'><constant>VIDIOC_G_JPEGCOMP</constant></link>"> | 47 | <!ENTITY VIDIOC-G-JPEGCOMP "<link linkend='vidioc-g-jpegcomp'><constant>VIDIOC_G_JPEGCOMP</constant></link>"> |
48 | <!ENTITY VIDIOC-G-MPEGCOMP "<link linkend=''><constant>VIDIOC_G_MPEGCOMP</constant></link>"> | 48 | <!ENTITY VIDIOC-G-MPEGCOMP "<link linkend=''><constant>VIDIOC_G_MPEGCOMP</constant></link>"> |
49 | <!ENTITY VIDIOC-G-MODULATOR "<link linkend='vidioc-g-modulator'><constant>VIDIOC_G_MODULATOR</constant></link>"> | 49 | <!ENTITY VIDIOC-G-MODULATOR "<link linkend='vidioc-g-modulator'><constant>VIDIOC_G_MODULATOR</constant></link>"> |
50 | <!ENTITY VIDIOC-G-OUTPUT "<link linkend='vidioc-g-output'><constant>VIDIOC_G_OUTPUT</constant></link>"> | 50 | <!ENTITY VIDIOC-G-OUTPUT "<link linkend='vidioc-g-output'><constant>VIDIOC_G_OUTPUT</constant></link>"> |
51 | <!ENTITY VIDIOC-G-PARM "<link linkend='vidioc-g-parm'><constant>VIDIOC_G_PARM</constant></link>"> | 51 | <!ENTITY VIDIOC-G-PARM "<link linkend='vidioc-g-parm'><constant>VIDIOC_G_PARM</constant></link>"> |
52 | <!ENTITY VIDIOC-G-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_G_PRIORITY</constant></link>"> | 52 | <!ENTITY VIDIOC-G-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_G_PRIORITY</constant></link>"> |
53 | <!ENTITY VIDIOC-G-SLICED-VBI-CAP "<link linkend='vidioc-g-sliced-vbi-cap'><constant>VIDIOC_G_SLICED_VBI_CAP</constant></link>"> | 53 | <!ENTITY VIDIOC-G-SLICED-VBI-CAP "<link linkend='vidioc-g-sliced-vbi-cap'><constant>VIDIOC_G_SLICED_VBI_CAP</constant></link>"> |
54 | <!ENTITY VIDIOC-G-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_G_STD</constant></link>"> | 54 | <!ENTITY VIDIOC-G-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_G_STD</constant></link>"> |
55 | <!ENTITY VIDIOC-G-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_G_TUNER</constant></link>"> | 55 | <!ENTITY VIDIOC-G-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_G_TUNER</constant></link>"> |
56 | <!ENTITY VIDIOC-LOG-STATUS "<link linkend='vidioc-log-status'><constant>VIDIOC_LOG_STATUS</constant></link>"> | 56 | <!ENTITY VIDIOC-LOG-STATUS "<link linkend='vidioc-log-status'><constant>VIDIOC_LOG_STATUS</constant></link>"> |
57 | <!ENTITY VIDIOC-OVERLAY "<link linkend='vidioc-overlay'><constant>VIDIOC_OVERLAY</constant></link>"> | 57 | <!ENTITY VIDIOC-OVERLAY "<link linkend='vidioc-overlay'><constant>VIDIOC_OVERLAY</constant></link>"> |
58 | <!ENTITY VIDIOC-QBUF "<link linkend='vidioc-qbuf'><constant>VIDIOC_QBUF</constant></link>"> | 58 | <!ENTITY VIDIOC-QBUF "<link linkend='vidioc-qbuf'><constant>VIDIOC_QBUF</constant></link>"> |
59 | <!ENTITY VIDIOC-QUERYBUF "<link linkend='vidioc-querybuf'><constant>VIDIOC_QUERYBUF</constant></link>"> | 59 | <!ENTITY VIDIOC-QUERYBUF "<link linkend='vidioc-querybuf'><constant>VIDIOC_QUERYBUF</constant></link>"> |
60 | <!ENTITY VIDIOC-QUERYCAP "<link linkend='vidioc-querycap'><constant>VIDIOC_QUERYCAP</constant></link>"> | 60 | <!ENTITY VIDIOC-QUERYCAP "<link linkend='vidioc-querycap'><constant>VIDIOC_QUERYCAP</constant></link>"> |
61 | <!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> | 61 | <!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> |
62 | <!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> | 62 | <!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> |
63 | <!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> | 63 | <!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> |
64 | <!ENTITY VIDIOC-QUERY-DV-PRESET "<link linkend='vidioc-query-dv-preset'><constant>VIDIOC_QUERY_DV_PRESET</constant></link>"> | 64 | <!ENTITY VIDIOC-QUERY-DV-PRESET "<link linkend='vidioc-query-dv-preset'><constant>VIDIOC_QUERY_DV_PRESET</constant></link>"> |
65 | <!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> | 65 | <!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> |
66 | <!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> | 66 | <!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> |
67 | <!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> | 67 | <!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> |
68 | <!ENTITY VIDIOC-SUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_SUBSCRIBE_EVENT</constant></link>"> | 68 | <!ENTITY VIDIOC-SUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_SUBSCRIBE_EVENT</constant></link>"> |
69 | <!ENTITY VIDIOC-S-AUDIO "<link linkend='vidioc-g-audio'><constant>VIDIOC_S_AUDIO</constant></link>"> | 69 | <!ENTITY VIDIOC-S-AUDIO "<link linkend='vidioc-g-audio'><constant>VIDIOC_S_AUDIO</constant></link>"> |
70 | <!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> | 70 | <!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> |
71 | <!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> | 71 | <!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> |
72 | <!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> | 72 | <!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> |
73 | <!ENTITY VIDIOC-S-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_S_DV_PRESET</constant></link>"> | 73 | <!ENTITY VIDIOC-S-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_S_DV_PRESET</constant></link>"> |
74 | <!ENTITY VIDIOC-S-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_S_DV_TIMINGS</constant></link>"> | 74 | <!ENTITY VIDIOC-S-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_S_DV_TIMINGS</constant></link>"> |
75 | <!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> | 75 | <!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> |
76 | <!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> | 76 | <!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> |
77 | <!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> | 77 | <!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> |
78 | <!ENTITY VIDIOC-S-FREQUENCY "<link linkend='vidioc-g-frequency'><constant>VIDIOC_S_FREQUENCY</constant></link>"> | 78 | <!ENTITY VIDIOC-S-FREQUENCY "<link linkend='vidioc-g-frequency'><constant>VIDIOC_S_FREQUENCY</constant></link>"> |
79 | <!ENTITY VIDIOC-S-HW-FREQ-SEEK "<link linkend='vidioc-s-hw-freq-seek'><constant>VIDIOC_S_HW_FREQ_SEEK</constant></link>"> | 79 | <!ENTITY VIDIOC-S-HW-FREQ-SEEK "<link linkend='vidioc-s-hw-freq-seek'><constant>VIDIOC_S_HW_FREQ_SEEK</constant></link>"> |
80 | <!ENTITY VIDIOC-S-INPUT "<link linkend='vidioc-g-input'><constant>VIDIOC_S_INPUT</constant></link>"> | 80 | <!ENTITY VIDIOC-S-INPUT "<link linkend='vidioc-g-input'><constant>VIDIOC_S_INPUT</constant></link>"> |
81 | <!ENTITY VIDIOC-S-JPEGCOMP "<link linkend='vidioc-g-jpegcomp'><constant>VIDIOC_S_JPEGCOMP</constant></link>"> | 81 | <!ENTITY VIDIOC-S-JPEGCOMP "<link linkend='vidioc-g-jpegcomp'><constant>VIDIOC_S_JPEGCOMP</constant></link>"> |
82 | <!ENTITY VIDIOC-S-MPEGCOMP "<link linkend=''><constant>VIDIOC_S_MPEGCOMP</constant></link>"> | 82 | <!ENTITY VIDIOC-S-MPEGCOMP "<link linkend=''><constant>VIDIOC_S_MPEGCOMP</constant></link>"> |
83 | <!ENTITY VIDIOC-S-MODULATOR "<link linkend='vidioc-g-modulator'><constant>VIDIOC_S_MODULATOR</constant></link>"> | 83 | <!ENTITY VIDIOC-S-MODULATOR "<link linkend='vidioc-g-modulator'><constant>VIDIOC_S_MODULATOR</constant></link>"> |
84 | <!ENTITY VIDIOC-S-OUTPUT "<link linkend='vidioc-g-output'><constant>VIDIOC_S_OUTPUT</constant></link>"> | 84 | <!ENTITY VIDIOC-S-OUTPUT "<link linkend='vidioc-g-output'><constant>VIDIOC_S_OUTPUT</constant></link>"> |
85 | <!ENTITY VIDIOC-S-PARM "<link linkend='vidioc-g-parm'><constant>VIDIOC_S_PARM</constant></link>"> | 85 | <!ENTITY VIDIOC-S-PARM "<link linkend='vidioc-g-parm'><constant>VIDIOC_S_PARM</constant></link>"> |
86 | <!ENTITY VIDIOC-S-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_S_PRIORITY</constant></link>"> | 86 | <!ENTITY VIDIOC-S-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_S_PRIORITY</constant></link>"> |
87 | <!ENTITY VIDIOC-S-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_S_STD</constant></link>"> | 87 | <!ENTITY VIDIOC-S-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_S_STD</constant></link>"> |
88 | <!ENTITY VIDIOC-S-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_S_TUNER</constant></link>"> | 88 | <!ENTITY VIDIOC-S-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_S_TUNER</constant></link>"> |
89 | <!ENTITY VIDIOC-TRY-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_TRY_ENCODER_CMD</constant></link>"> | 89 | <!ENTITY VIDIOC-TRY-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_TRY_ENCODER_CMD</constant></link>"> |
90 | <!ENTITY VIDIOC-TRY-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_TRY_EXT_CTRLS</constant></link>"> | 90 | <!ENTITY VIDIOC-TRY-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_TRY_EXT_CTRLS</constant></link>"> |
91 | <!ENTITY VIDIOC-TRY-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_TRY_FMT</constant></link>"> | 91 | <!ENTITY VIDIOC-TRY-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_TRY_FMT</constant></link>"> |
92 | <!ENTITY VIDIOC-UNSUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_UNSUBSCRIBE_EVENT</constant></link>"> | 92 | <!ENTITY VIDIOC-UNSUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_UNSUBSCRIBE_EVENT</constant></link>"> |
93 | 93 | ||
94 | <!ENTITY MEDIA-IOC-DEVICE-INFO "<link linkend='media-ioc-device-info'><constant>MEDIA_IOC_DEVICE_INFO</constant></link>"> | 94 | <!ENTITY MEDIA-IOC-DEVICE-INFO "<link linkend='media-ioc-device-info'><constant>MEDIA_IOC_DEVICE_INFO</constant></link>"> |
95 | <!ENTITY MEDIA-IOC-ENUM-ENTITIES "<link linkend='media-ioc-enum-entities'><constant>MEDIA_IOC_ENUM_ENTITIES</constant></link>"> | 95 | <!ENTITY MEDIA-IOC-ENUM-ENTITIES "<link linkend='media-ioc-enum-entities'><constant>MEDIA_IOC_ENUM_ENTITIES</constant></link>"> |
96 | <!ENTITY MEDIA-IOC-ENUM-LINKS "<link linkend='media-ioc-enum-links'><constant>MEDIA_IOC_ENUM_LINKS</constant></link>"> | 96 | <!ENTITY MEDIA-IOC-ENUM-LINKS "<link linkend='media-ioc-enum-links'><constant>MEDIA_IOC_ENUM_LINKS</constant></link>"> |
97 | <!ENTITY MEDIA-IOC-SETUP-LINK "<link linkend='media-ioc-setup-link'><constant>MEDIA_IOC_SETUP_LINK</constant></link>"> | ||
97 | 98 | ||
98 | <!-- Types --> | 99 | <!-- Types --> |
99 | <!ENTITY v4l2-std-id "<link linkend='v4l2-std-id'>v4l2_std_id</link>"> | 100 | <!ENTITY v4l2-std-id "<link linkend='v4l2-std-id'>v4l2_std_id</link>"> |
100 | 101 | ||
101 | <!-- Enums --> | 102 | <!-- Enums --> |
102 | <!ENTITY v4l2-buf-type "enum <link linkend='v4l2-buf-type'>v4l2_buf_type</link>"> | 103 | <!ENTITY v4l2-buf-type "enum <link linkend='v4l2-buf-type'>v4l2_buf_type</link>"> |
103 | <!ENTITY v4l2-colorspace "enum <link linkend='v4l2-colorspace'>v4l2_colorspace</link>"> | 104 | <!ENTITY v4l2-colorspace "enum <link linkend='v4l2-colorspace'>v4l2_colorspace</link>"> |
104 | <!ENTITY v4l2-ctrl-type "enum <link linkend='v4l2-ctrl-type'>v4l2_ctrl_type</link>"> | 105 | <!ENTITY v4l2-ctrl-type "enum <link linkend='v4l2-ctrl-type'>v4l2_ctrl_type</link>"> |
105 | <!ENTITY v4l2-exposure-auto-type "enum <link linkend='v4l2-exposure-auto-type'>v4l2_exposure_auto_type</link>"> | 106 | <!ENTITY v4l2-exposure-auto-type "enum <link linkend='v4l2-exposure-auto-type'>v4l2_exposure_auto_type</link>"> |
106 | <!ENTITY v4l2-field "enum <link linkend='v4l2-field'>v4l2_field</link>"> | 107 | <!ENTITY v4l2-field "enum <link linkend='v4l2-field'>v4l2_field</link>"> |
107 | <!ENTITY v4l2-frmivaltypes "enum <link linkend='v4l2-frmivaltypes'>v4l2_frmivaltypes</link>"> | 108 | <!ENTITY v4l2-frmivaltypes "enum <link linkend='v4l2-frmivaltypes'>v4l2_frmivaltypes</link>"> |
108 | <!ENTITY v4l2-frmsizetypes "enum <link linkend='v4l2-frmsizetypes'>v4l2_frmsizetypes</link>"> | 109 | <!ENTITY v4l2-frmsizetypes "enum <link linkend='v4l2-frmsizetypes'>v4l2_frmsizetypes</link>"> |
109 | <!ENTITY v4l2-memory "enum <link linkend='v4l2-memory'>v4l2_memory</link>"> | 110 | <!ENTITY v4l2-memory "enum <link linkend='v4l2-memory'>v4l2_memory</link>"> |
110 | <!ENTITY v4l2-mpeg-audio-ac3-bitrate "enum <link linkend='v4l2-mpeg-audio-ac3-bitrate'>v4l2_mpeg_audio_ac3_bitrate</link>"> | 111 | <!ENTITY v4l2-mpeg-audio-ac3-bitrate "enum <link linkend='v4l2-mpeg-audio-ac3-bitrate'>v4l2_mpeg_audio_ac3_bitrate</link>"> |
111 | <!ENTITY v4l2-mpeg-audio-crc "enum <link linkend='v4l2-mpeg-audio-crc'>v4l2_mpeg_audio_crc</link>"> | 112 | <!ENTITY v4l2-mpeg-audio-crc "enum <link linkend='v4l2-mpeg-audio-crc'>v4l2_mpeg_audio_crc</link>"> |
112 | <!ENTITY v4l2-mpeg-audio-emphasis "enum <link linkend='v4l2-mpeg-audio-emphasis'>v4l2_mpeg_audio_emphasis</link>"> | 113 | <!ENTITY v4l2-mpeg-audio-emphasis "enum <link linkend='v4l2-mpeg-audio-emphasis'>v4l2_mpeg_audio_emphasis</link>"> |
113 | <!ENTITY v4l2-mpeg-audio-encoding "enum <link linkend='v4l2-mpeg-audio-encoding'>v4l2_mpeg_audio_encoding</link>"> | 114 | <!ENTITY v4l2-mpeg-audio-encoding "enum <link linkend='v4l2-mpeg-audio-encoding'>v4l2_mpeg_audio_encoding</link>"> |
114 | <!ENTITY v4l2-mpeg-audio-l1-bitrate "enum <link linkend='v4l2-mpeg-audio-l1-bitrate'>v4l2_mpeg_audio_l1_bitrate</link>"> | 115 | <!ENTITY v4l2-mpeg-audio-l1-bitrate "enum <link linkend='v4l2-mpeg-audio-l1-bitrate'>v4l2_mpeg_audio_l1_bitrate</link>"> |
115 | <!ENTITY v4l2-mpeg-audio-l2-bitrate "enum <link linkend='v4l2-mpeg-audio-l2-bitrate'>v4l2_mpeg_audio_l2_bitrate</link>"> | 116 | <!ENTITY v4l2-mpeg-audio-l2-bitrate "enum <link linkend='v4l2-mpeg-audio-l2-bitrate'>v4l2_mpeg_audio_l2_bitrate</link>"> |
116 | <!ENTITY v4l2-mpeg-audio-l3-bitrate "enum <link linkend='v4l2-mpeg-audio-l3-bitrate'>v4l2_mpeg_audio_l3_bitrate</link>"> | 117 | <!ENTITY v4l2-mpeg-audio-l3-bitrate "enum <link linkend='v4l2-mpeg-audio-l3-bitrate'>v4l2_mpeg_audio_l3_bitrate</link>"> |
117 | <!ENTITY v4l2-mpeg-audio-mode "enum <link linkend='v4l2-mpeg-audio-mode'>v4l2_mpeg_audio_mode</link>"> | 118 | <!ENTITY v4l2-mpeg-audio-mode "enum <link linkend='v4l2-mpeg-audio-mode'>v4l2_mpeg_audio_mode</link>"> |
118 | <!ENTITY v4l2-mpeg-audio-mode-extension "enum <link linkend='v4l2-mpeg-audio-mode-extension'>v4l2_mpeg_audio_mode_extension</link>"> | 119 | <!ENTITY v4l2-mpeg-audio-mode-extension "enum <link linkend='v4l2-mpeg-audio-mode-extension'>v4l2_mpeg_audio_mode_extension</link>"> |
119 | <!ENTITY v4l2-mpeg-audio-sampling-freq "enum <link linkend='v4l2-mpeg-audio-sampling-freq'>v4l2_mpeg_audio_sampling_freq</link>"> | 120 | <!ENTITY v4l2-mpeg-audio-sampling-freq "enum <link linkend='v4l2-mpeg-audio-sampling-freq'>v4l2_mpeg_audio_sampling_freq</link>"> |
120 | <!ENTITY chroma-spatial-filter-type "enum <link linkend='chroma-spatial-filter-type'>v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type</link>"> | 121 | <!ENTITY chroma-spatial-filter-type "enum <link linkend='chroma-spatial-filter-type'>v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type</link>"> |
121 | <!ENTITY luma-spatial-filter-type "enum <link linkend='luma-spatial-filter-type'>v4l2_mpeg_cx2341x_video_luma_spatial_filter_type</link>"> | 122 | <!ENTITY luma-spatial-filter-type "enum <link linkend='luma-spatial-filter-type'>v4l2_mpeg_cx2341x_video_luma_spatial_filter_type</link>"> |
122 | <!ENTITY v4l2-mpeg-cx2341x-video-median-filter-type "enum <link linkend='v4l2-mpeg-cx2341x-video-median-filter-type'>v4l2_mpeg_cx2341x_video_median_filter_type</link>"> | 123 | <!ENTITY v4l2-mpeg-cx2341x-video-median-filter-type "enum <link linkend='v4l2-mpeg-cx2341x-video-median-filter-type'>v4l2_mpeg_cx2341x_video_median_filter_type</link>"> |
123 | <!ENTITY v4l2-mpeg-cx2341x-video-spatial-filter-mode "enum <link linkend='v4l2-mpeg-cx2341x-video-spatial-filter-mode'>v4l2_mpeg_cx2341x_video_spatial_filter_mode</link>"> | 124 | <!ENTITY v4l2-mpeg-cx2341x-video-spatial-filter-mode "enum <link linkend='v4l2-mpeg-cx2341x-video-spatial-filter-mode'>v4l2_mpeg_cx2341x_video_spatial_filter_mode</link>"> |
124 | <!ENTITY v4l2-mpeg-cx2341x-video-temporal-filter-mode "enum <link linkend='v4l2-mpeg-cx2341x-video-temporal-filter-mode'>v4l2_mpeg_cx2341x_video_temporal_filter_mode</link>"> | 125 | <!ENTITY v4l2-mpeg-cx2341x-video-temporal-filter-mode "enum <link linkend='v4l2-mpeg-cx2341x-video-temporal-filter-mode'>v4l2_mpeg_cx2341x_video_temporal_filter_mode</link>"> |
125 | <!ENTITY v4l2-mpeg-stream-type "enum <link linkend='v4l2-mpeg-stream-type'>v4l2_mpeg_stream_type</link>"> | 126 | <!ENTITY v4l2-mpeg-stream-type "enum <link linkend='v4l2-mpeg-stream-type'>v4l2_mpeg_stream_type</link>"> |
126 | <!ENTITY v4l2-mpeg-stream-vbi-fmt "enum <link linkend='v4l2-mpeg-stream-vbi-fmt'>v4l2_mpeg_stream_vbi_fmt</link>"> | 127 | <!ENTITY v4l2-mpeg-stream-vbi-fmt "enum <link linkend='v4l2-mpeg-stream-vbi-fmt'>v4l2_mpeg_stream_vbi_fmt</link>"> |
127 | <!ENTITY v4l2-mpeg-video-aspect "enum <link linkend='v4l2-mpeg-video-aspect'>v4l2_mpeg_video_aspect</link>"> | 128 | <!ENTITY v4l2-mpeg-video-aspect "enum <link linkend='v4l2-mpeg-video-aspect'>v4l2_mpeg_video_aspect</link>"> |
128 | <!ENTITY v4l2-mpeg-video-bitrate-mode "enum <link linkend='v4l2-mpeg-video-bitrate-mode'>v4l2_mpeg_video_bitrate_mode</link>"> | 129 | <!ENTITY v4l2-mpeg-video-bitrate-mode "enum <link linkend='v4l2-mpeg-video-bitrate-mode'>v4l2_mpeg_video_bitrate_mode</link>"> |
129 | <!ENTITY v4l2-mpeg-video-encoding "enum <link linkend='v4l2-mpeg-video-encoding'>v4l2_mpeg_video_encoding</link>"> | 130 | <!ENTITY v4l2-mpeg-video-encoding "enum <link linkend='v4l2-mpeg-video-encoding'>v4l2_mpeg_video_encoding</link>"> |
130 | <!ENTITY v4l2-power-line-frequency "enum <link linkend='v4l2-power-line-frequency'>v4l2_power_line_frequency</link>"> | 131 | <!ENTITY v4l2-power-line-frequency "enum <link linkend='v4l2-power-line-frequency'>v4l2_power_line_frequency</link>"> |
131 | <!ENTITY v4l2-priority "enum <link linkend='v4l2-priority'>v4l2_priority</link>"> | 132 | <!ENTITY v4l2-priority "enum <link linkend='v4l2-priority'>v4l2_priority</link>"> |
132 | <!ENTITY v4l2-tuner-type "enum <link linkend='v4l2-tuner-type'>v4l2_tuner_type</link>"> | 133 | <!ENTITY v4l2-tuner-type "enum <link linkend='v4l2-tuner-type'>v4l2_tuner_type</link>"> |
133 | <!ENTITY v4l2-preemphasis "enum <link linkend='v4l2-preemphasis'>v4l2_preemphasis</link>"> | 134 | <!ENTITY v4l2-preemphasis "enum <link linkend='v4l2-preemphasis'>v4l2_preemphasis</link>"> |
134 | 135 | ||
135 | <!-- Structures --> | 136 | <!-- Structures --> |
136 | <!ENTITY v4l2-audio "struct <link linkend='v4l2-audio'>v4l2_audio</link>"> | 137 | <!ENTITY v4l2-audio "struct <link linkend='v4l2-audio'>v4l2_audio</link>"> |
137 | <!ENTITY v4l2-audioout "struct <link linkend='v4l2-audioout'>v4l2_audioout</link>"> | 138 | <!ENTITY v4l2-audioout "struct <link linkend='v4l2-audioout'>v4l2_audioout</link>"> |
138 | <!ENTITY v4l2-bt-timings "struct <link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>"> | 139 | <!ENTITY v4l2-bt-timings "struct <link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>"> |
139 | <!ENTITY v4l2-buffer "struct <link linkend='v4l2-buffer'>v4l2_buffer</link>"> | 140 | <!ENTITY v4l2-buffer "struct <link linkend='v4l2-buffer'>v4l2_buffer</link>"> |
140 | <!ENTITY v4l2-plane "struct <link linkend='v4l2-plane'>v4l2_plane</link>"> | 141 | <!ENTITY v4l2-plane "struct <link linkend='v4l2-plane'>v4l2_plane</link>"> |
141 | <!ENTITY v4l2-capability "struct <link linkend='v4l2-capability'>v4l2_capability</link>"> | 142 | <!ENTITY v4l2-capability "struct <link linkend='v4l2-capability'>v4l2_capability</link>"> |
142 | <!ENTITY v4l2-captureparm "struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> | 143 | <!ENTITY v4l2-captureparm "struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> |
143 | <!ENTITY v4l2-clip "struct <link linkend='v4l2-clip'>v4l2_clip</link>"> | 144 | <!ENTITY v4l2-clip "struct <link linkend='v4l2-clip'>v4l2_clip</link>"> |
144 | <!ENTITY v4l2-control "struct <link linkend='v4l2-control'>v4l2_control</link>"> | 145 | <!ENTITY v4l2-control "struct <link linkend='v4l2-control'>v4l2_control</link>"> |
145 | <!ENTITY v4l2-crop "struct <link linkend='v4l2-crop'>v4l2_crop</link>"> | 146 | <!ENTITY v4l2-crop "struct <link linkend='v4l2-crop'>v4l2_crop</link>"> |
146 | <!ENTITY v4l2-cropcap "struct <link linkend='v4l2-cropcap'>v4l2_cropcap</link>"> | 147 | <!ENTITY v4l2-cropcap "struct <link linkend='v4l2-cropcap'>v4l2_cropcap</link>"> |
147 | <!ENTITY v4l2-dbg-chip-ident "struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> | 148 | <!ENTITY v4l2-dbg-chip-ident "struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> |
148 | <!ENTITY v4l2-dbg-match "struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> | 149 | <!ENTITY v4l2-dbg-match "struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> |
149 | <!ENTITY v4l2-dbg-register "struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> | 150 | <!ENTITY v4l2-dbg-register "struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> |
150 | <!ENTITY v4l2-dv-enum-preset "struct <link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link>"> | 151 | <!ENTITY v4l2-dv-enum-preset "struct <link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link>"> |
151 | <!ENTITY v4l2-dv-preset "struct <link linkend='v4l2-dv-preset'>v4l2_dv_preset</link>"> | 152 | <!ENTITY v4l2-dv-preset "struct <link linkend='v4l2-dv-preset'>v4l2_dv_preset</link>"> |
152 | <!ENTITY v4l2-dv-timings "struct <link linkend='v4l2-dv-timings'>v4l2_dv_timings</link>"> | 153 | <!ENTITY v4l2-dv-timings "struct <link linkend='v4l2-dv-timings'>v4l2_dv_timings</link>"> |
153 | <!ENTITY v4l2-enc-idx "struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> | 154 | <!ENTITY v4l2-enc-idx "struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> |
154 | <!ENTITY v4l2-enc-idx-entry "struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> | 155 | <!ENTITY v4l2-enc-idx-entry "struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> |
155 | <!ENTITY v4l2-encoder-cmd "struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> | 156 | <!ENTITY v4l2-encoder-cmd "struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> |
156 | <!ENTITY v4l2-event "struct <link linkend='v4l2-event'>v4l2_event</link>"> | 157 | <!ENTITY v4l2-event "struct <link linkend='v4l2-event'>v4l2_event</link>"> |
157 | <!ENTITY v4l2-event-subscription "struct <link linkend='v4l2-event-subscription'>v4l2_event_subscription</link>"> | 158 | <!ENTITY v4l2-event-subscription "struct <link linkend='v4l2-event-subscription'>v4l2_event_subscription</link>"> |
158 | <!ENTITY v4l2-event-vsync "struct <link linkend='v4l2-event-vsync'>v4l2_event_vsync</link>"> | 159 | <!ENTITY v4l2-event-vsync "struct <link linkend='v4l2-event-vsync'>v4l2_event_vsync</link>"> |
159 | <!ENTITY v4l2-ext-control "struct <link linkend='v4l2-ext-control'>v4l2_ext_control</link>"> | 160 | <!ENTITY v4l2-ext-control "struct <link linkend='v4l2-ext-control'>v4l2_ext_control</link>"> |
160 | <!ENTITY v4l2-ext-controls "struct <link linkend='v4l2-ext-controls'>v4l2_ext_controls</link>"> | 161 | <!ENTITY v4l2-ext-controls "struct <link linkend='v4l2-ext-controls'>v4l2_ext_controls</link>"> |
161 | <!ENTITY v4l2-fmtdesc "struct <link linkend='v4l2-fmtdesc'>v4l2_fmtdesc</link>"> | 162 | <!ENTITY v4l2-fmtdesc "struct <link linkend='v4l2-fmtdesc'>v4l2_fmtdesc</link>"> |
162 | <!ENTITY v4l2-format "struct <link linkend='v4l2-format'>v4l2_format</link>"> | 163 | <!ENTITY v4l2-format "struct <link linkend='v4l2-format'>v4l2_format</link>"> |
163 | <!ENTITY v4l2-fract "struct <link linkend='v4l2-fract'>v4l2_fract</link>"> | 164 | <!ENTITY v4l2-fract "struct <link linkend='v4l2-fract'>v4l2_fract</link>"> |
164 | <!ENTITY v4l2-framebuffer "struct <link linkend='v4l2-framebuffer'>v4l2_framebuffer</link>"> | 165 | <!ENTITY v4l2-framebuffer "struct <link linkend='v4l2-framebuffer'>v4l2_framebuffer</link>"> |
165 | <!ENTITY v4l2-frequency "struct <link linkend='v4l2-frequency'>v4l2_frequency</link>"> | 166 | <!ENTITY v4l2-frequency "struct <link linkend='v4l2-frequency'>v4l2_frequency</link>"> |
166 | <!ENTITY v4l2-frmival-stepwise "struct <link linkend='v4l2-frmival-stepwise'>v4l2_frmival_stepwise</link>"> | 167 | <!ENTITY v4l2-frmival-stepwise "struct <link linkend='v4l2-frmival-stepwise'>v4l2_frmival_stepwise</link>"> |
167 | <!ENTITY v4l2-frmivalenum "struct <link linkend='v4l2-frmivalenum'>v4l2_frmivalenum</link>"> | 168 | <!ENTITY v4l2-frmivalenum "struct <link linkend='v4l2-frmivalenum'>v4l2_frmivalenum</link>"> |
168 | <!ENTITY v4l2-frmsize-discrete "struct <link linkend='v4l2-frmsize-discrete'>v4l2_frmsize_discrete</link>"> | 169 | <!ENTITY v4l2-frmsize-discrete "struct <link linkend='v4l2-frmsize-discrete'>v4l2_frmsize_discrete</link>"> |
169 | <!ENTITY v4l2-frmsize-stepwise "struct <link linkend='v4l2-frmsize-stepwise'>v4l2_frmsize_stepwise</link>"> | 170 | <!ENTITY v4l2-frmsize-stepwise "struct <link linkend='v4l2-frmsize-stepwise'>v4l2_frmsize_stepwise</link>"> |
170 | <!ENTITY v4l2-frmsizeenum "struct <link linkend='v4l2-frmsizeenum'>v4l2_frmsizeenum</link>"> | 171 | <!ENTITY v4l2-frmsizeenum "struct <link linkend='v4l2-frmsizeenum'>v4l2_frmsizeenum</link>"> |
171 | <!ENTITY v4l2-hw-freq-seek "struct <link linkend='v4l2-hw-freq-seek'>v4l2_hw_freq_seek</link>"> | 172 | <!ENTITY v4l2-hw-freq-seek "struct <link linkend='v4l2-hw-freq-seek'>v4l2_hw_freq_seek</link>"> |
172 | <!ENTITY v4l2-input "struct <link linkend='v4l2-input'>v4l2_input</link>"> | 173 | <!ENTITY v4l2-input "struct <link linkend='v4l2-input'>v4l2_input</link>"> |
173 | <!ENTITY v4l2-jpegcompression "struct <link linkend='v4l2-jpegcompression'>v4l2_jpegcompression</link>"> | 174 | <!ENTITY v4l2-jpegcompression "struct <link linkend='v4l2-jpegcompression'>v4l2_jpegcompression</link>"> |
174 | <!ENTITY v4l2-modulator "struct <link linkend='v4l2-modulator'>v4l2_modulator</link>"> | 175 | <!ENTITY v4l2-modulator "struct <link linkend='v4l2-modulator'>v4l2_modulator</link>"> |
175 | <!ENTITY v4l2-mpeg-vbi-fmt-ivtv "struct <link linkend='v4l2-mpeg-vbi-fmt-ivtv'>v4l2_mpeg_vbi_fmt_ivtv</link>"> | 176 | <!ENTITY v4l2-mpeg-vbi-fmt-ivtv "struct <link linkend='v4l2-mpeg-vbi-fmt-ivtv'>v4l2_mpeg_vbi_fmt_ivtv</link>"> |
176 | <!ENTITY v4l2-output "struct <link linkend='v4l2-output'>v4l2_output</link>"> | 177 | <!ENTITY v4l2-output "struct <link linkend='v4l2-output'>v4l2_output</link>"> |
177 | <!ENTITY v4l2-outputparm "struct <link linkend='v4l2-outputparm'>v4l2_outputparm</link>"> | 178 | <!ENTITY v4l2-outputparm "struct <link linkend='v4l2-outputparm'>v4l2_outputparm</link>"> |
178 | <!ENTITY v4l2-pix-format "struct <link linkend='v4l2-pix-format'>v4l2_pix_format</link>"> | 179 | <!ENTITY v4l2-pix-format "struct <link linkend='v4l2-pix-format'>v4l2_pix_format</link>"> |
179 | <!ENTITY v4l2-pix-format-mplane "struct <link linkend='v4l2-pix-format-mplane'>v4l2_pix_format_mplane</link>"> | 180 | <!ENTITY v4l2-pix-format-mplane "struct <link linkend='v4l2-pix-format-mplane'>v4l2_pix_format_mplane</link>"> |
180 | <!ENTITY v4l2-plane-pix-format "struct <link linkend='v4l2-plane-pix-format'>v4l2_plane_pix_format</link>"> | 181 | <!ENTITY v4l2-plane-pix-format "struct <link linkend='v4l2-plane-pix-format'>v4l2_plane_pix_format</link>"> |
181 | <!ENTITY v4l2-queryctrl "struct <link linkend='v4l2-queryctrl'>v4l2_queryctrl</link>"> | 182 | <!ENTITY v4l2-queryctrl "struct <link linkend='v4l2-queryctrl'>v4l2_queryctrl</link>"> |
182 | <!ENTITY v4l2-querymenu "struct <link linkend='v4l2-querymenu'>v4l2_querymenu</link>"> | 183 | <!ENTITY v4l2-querymenu "struct <link linkend='v4l2-querymenu'>v4l2_querymenu</link>"> |
183 | <!ENTITY v4l2-rect "struct <link linkend='v4l2-rect'>v4l2_rect</link>"> | 184 | <!ENTITY v4l2-rect "struct <link linkend='v4l2-rect'>v4l2_rect</link>"> |
184 | <!ENTITY v4l2-requestbuffers "struct <link linkend='v4l2-requestbuffers'>v4l2_requestbuffers</link>"> | 185 | <!ENTITY v4l2-requestbuffers "struct <link linkend='v4l2-requestbuffers'>v4l2_requestbuffers</link>"> |
185 | <!ENTITY v4l2-sliced-vbi-cap "struct <link linkend='v4l2-sliced-vbi-cap'>v4l2_sliced_vbi_cap</link>"> | 186 | <!ENTITY v4l2-sliced-vbi-cap "struct <link linkend='v4l2-sliced-vbi-cap'>v4l2_sliced_vbi_cap</link>"> |
186 | <!ENTITY v4l2-sliced-vbi-data "struct <link linkend='v4l2-sliced-vbi-data'>v4l2_sliced_vbi_data</link>"> | 187 | <!ENTITY v4l2-sliced-vbi-data "struct <link linkend='v4l2-sliced-vbi-data'>v4l2_sliced_vbi_data</link>"> |
187 | <!ENTITY v4l2-sliced-vbi-format "struct <link linkend='v4l2-sliced-vbi-format'>v4l2_sliced_vbi_format</link>"> | 188 | <!ENTITY v4l2-sliced-vbi-format "struct <link linkend='v4l2-sliced-vbi-format'>v4l2_sliced_vbi_format</link>"> |
188 | <!ENTITY v4l2-standard "struct <link linkend='v4l2-standard'>v4l2_standard</link>"> | 189 | <!ENTITY v4l2-standard "struct <link linkend='v4l2-standard'>v4l2_standard</link>"> |
189 | <!ENTITY v4l2-streamparm "struct <link linkend='v4l2-streamparm'>v4l2_streamparm</link>"> | 190 | <!ENTITY v4l2-streamparm "struct <link linkend='v4l2-streamparm'>v4l2_streamparm</link>"> |
190 | <!ENTITY v4l2-timecode "struct <link linkend='v4l2-timecode'>v4l2_timecode</link>"> | 191 | <!ENTITY v4l2-timecode "struct <link linkend='v4l2-timecode'>v4l2_timecode</link>"> |
191 | <!ENTITY v4l2-tuner "struct <link linkend='v4l2-tuner'>v4l2_tuner</link>"> | 192 | <!ENTITY v4l2-tuner "struct <link linkend='v4l2-tuner'>v4l2_tuner</link>"> |
192 | <!ENTITY v4l2-vbi-format "struct <link linkend='v4l2-vbi-format'>v4l2_vbi_format</link>"> | 193 | <!ENTITY v4l2-vbi-format "struct <link linkend='v4l2-vbi-format'>v4l2_vbi_format</link>"> |
193 | <!ENTITY v4l2-window "struct <link linkend='v4l2-window'>v4l2_window</link>"> | 194 | <!ENTITY v4l2-window "struct <link linkend='v4l2-window'>v4l2_window</link>"> |
194 | 195 | ||
195 | <!ENTITY media-device-info "struct <link linkend='media-device-info'>media_device_info</link>"> | 196 | <!ENTITY media-device-info "struct <link linkend='media-device-info'>media_device_info</link>"> |
196 | <!ENTITY media-entity-desc "struct <link linkend='media-entity-desc'>media_entity_desc</link>"> | 197 | <!ENTITY media-entity-desc "struct <link linkend='media-entity-desc'>media_entity_desc</link>"> |
197 | <!ENTITY media-links-enum "struct <link linkend='media-links-enum'>media_links_enum</link>"> | 198 | <!ENTITY media-links-enum "struct <link linkend='media-links-enum'>media_links_enum</link>"> |
198 | <!ENTITY media-pad-desc "struct <link linkend='media-pad-desc'>media_pad_desc</link>"> | 199 | <!ENTITY media-pad-desc "struct <link linkend='media-pad-desc'>media_pad_desc</link>"> |
199 | <!ENTITY media-link-desc "struct <link linkend='media-link-desc'>media_link_desc</link>"> | 200 | <!ENTITY media-link-desc "struct <link linkend='media-link-desc'>media_link_desc</link>"> |
200 | 201 | ||
201 | <!-- Error Codes --> | 202 | <!-- Error Codes --> |
202 | <!ENTITY EACCES "<errorcode>EACCES</errorcode> error code"> | 203 | <!ENTITY EACCES "<errorcode>EACCES</errorcode> error code"> |
203 | <!ENTITY EAGAIN "<errorcode>EAGAIN</errorcode> error code"> | 204 | <!ENTITY EAGAIN "<errorcode>EAGAIN</errorcode> error code"> |
204 | <!ENTITY EBADF "<errorcode>EBADF</errorcode> error code"> | 205 | <!ENTITY EBADF "<errorcode>EBADF</errorcode> error code"> |
205 | <!ENTITY EBUSY "<errorcode>EBUSY</errorcode> error code"> | 206 | <!ENTITY EBUSY "<errorcode>EBUSY</errorcode> error code"> |
206 | <!ENTITY EFAULT "<errorcode>EFAULT</errorcode> error code"> | 207 | <!ENTITY EFAULT "<errorcode>EFAULT</errorcode> error code"> |
207 | <!ENTITY EIO "<errorcode>EIO</errorcode> error code"> | 208 | <!ENTITY EIO "<errorcode>EIO</errorcode> error code"> |
208 | <!ENTITY EINTR "<errorcode>EINTR</errorcode> error code"> | 209 | <!ENTITY EINTR "<errorcode>EINTR</errorcode> error code"> |
209 | <!ENTITY EINVAL "<errorcode>EINVAL</errorcode> error code"> | 210 | <!ENTITY EINVAL "<errorcode>EINVAL</errorcode> error code"> |
210 | <!ENTITY ENFILE "<errorcode>ENFILE</errorcode> error code"> | 211 | <!ENTITY ENFILE "<errorcode>ENFILE</errorcode> error code"> |
211 | <!ENTITY ENOMEM "<errorcode>ENOMEM</errorcode> error code"> | 212 | <!ENTITY ENOMEM "<errorcode>ENOMEM</errorcode> error code"> |
212 | <!ENTITY ENOSPC "<errorcode>ENOSPC</errorcode> error code"> | 213 | <!ENTITY ENOSPC "<errorcode>ENOSPC</errorcode> error code"> |
213 | <!ENTITY ENOTTY "<errorcode>ENOTTY</errorcode> error code"> | 214 | <!ENTITY ENOTTY "<errorcode>ENOTTY</errorcode> error code"> |
214 | <!ENTITY ENXIO "<errorcode>ENXIO</errorcode> error code"> | 215 | <!ENTITY ENXIO "<errorcode>ENXIO</errorcode> error code"> |
215 | <!ENTITY EMFILE "<errorcode>EMFILE</errorcode> error code"> | 216 | <!ENTITY EMFILE "<errorcode>EMFILE</errorcode> error code"> |
216 | <!ENTITY EPERM "<errorcode>EPERM</errorcode> error code"> | 217 | <!ENTITY EPERM "<errorcode>EPERM</errorcode> error code"> |
217 | <!ENTITY ERANGE "<errorcode>ERANGE</errorcode> error code"> | 218 | <!ENTITY ERANGE "<errorcode>ERANGE</errorcode> error code"> |
218 | 219 | ||
219 | <!-- Subsections --> | 220 | <!-- Subsections --> |
220 | <!ENTITY sub-biblio SYSTEM "v4l/biblio.xml"> | 221 | <!ENTITY sub-biblio SYSTEM "v4l/biblio.xml"> |
221 | <!ENTITY sub-common SYSTEM "v4l/common.xml"> | 222 | <!ENTITY sub-common SYSTEM "v4l/common.xml"> |
222 | <!ENTITY sub-planar-apis SYSTEM "v4l/planar-apis.xml"> | 223 | <!ENTITY sub-planar-apis SYSTEM "v4l/planar-apis.xml"> |
223 | <!ENTITY sub-compat SYSTEM "v4l/compat.xml"> | 224 | <!ENTITY sub-compat SYSTEM "v4l/compat.xml"> |
224 | <!ENTITY sub-controls SYSTEM "v4l/controls.xml"> | 225 | <!ENTITY sub-controls SYSTEM "v4l/controls.xml"> |
225 | <!ENTITY sub-dev-capture SYSTEM "v4l/dev-capture.xml"> | 226 | <!ENTITY sub-dev-capture SYSTEM "v4l/dev-capture.xml"> |
226 | <!ENTITY sub-dev-codec SYSTEM "v4l/dev-codec.xml"> | 227 | <!ENTITY sub-dev-codec SYSTEM "v4l/dev-codec.xml"> |
227 | <!ENTITY sub-dev-event SYSTEM "v4l/dev-event.xml"> | 228 | <!ENTITY sub-dev-event SYSTEM "v4l/dev-event.xml"> |
228 | <!ENTITY sub-dev-effect SYSTEM "v4l/dev-effect.xml"> | 229 | <!ENTITY sub-dev-effect SYSTEM "v4l/dev-effect.xml"> |
229 | <!ENTITY sub-dev-osd SYSTEM "v4l/dev-osd.xml"> | 230 | <!ENTITY sub-dev-osd SYSTEM "v4l/dev-osd.xml"> |
230 | <!ENTITY sub-dev-output SYSTEM "v4l/dev-output.xml"> | 231 | <!ENTITY sub-dev-output SYSTEM "v4l/dev-output.xml"> |
231 | <!ENTITY sub-dev-overlay SYSTEM "v4l/dev-overlay.xml"> | 232 | <!ENTITY sub-dev-overlay SYSTEM "v4l/dev-overlay.xml"> |
232 | <!ENTITY sub-dev-radio SYSTEM "v4l/dev-radio.xml"> | 233 | <!ENTITY sub-dev-radio SYSTEM "v4l/dev-radio.xml"> |
233 | <!ENTITY sub-dev-raw-vbi SYSTEM "v4l/dev-raw-vbi.xml"> | 234 | <!ENTITY sub-dev-raw-vbi SYSTEM "v4l/dev-raw-vbi.xml"> |
234 | <!ENTITY sub-dev-rds SYSTEM "v4l/dev-rds.xml"> | 235 | <!ENTITY sub-dev-rds SYSTEM "v4l/dev-rds.xml"> |
235 | <!ENTITY sub-dev-sliced-vbi SYSTEM "v4l/dev-sliced-vbi.xml"> | 236 | <!ENTITY sub-dev-sliced-vbi SYSTEM "v4l/dev-sliced-vbi.xml"> |
236 | <!ENTITY sub-dev-teletext SYSTEM "v4l/dev-teletext.xml"> | 237 | <!ENTITY sub-dev-teletext SYSTEM "v4l/dev-teletext.xml"> |
237 | <!ENTITY sub-driver SYSTEM "v4l/driver.xml"> | 238 | <!ENTITY sub-driver SYSTEM "v4l/driver.xml"> |
238 | <!ENTITY sub-libv4l SYSTEM "v4l/libv4l.xml"> | 239 | <!ENTITY sub-libv4l SYSTEM "v4l/libv4l.xml"> |
239 | <!ENTITY sub-lirc_device_interface SYSTEM "v4l/lirc_device_interface.xml"> | 240 | <!ENTITY sub-lirc_device_interface SYSTEM "v4l/lirc_device_interface.xml"> |
240 | <!ENTITY sub-remote_controllers SYSTEM "v4l/remote_controllers.xml"> | 241 | <!ENTITY sub-remote_controllers SYSTEM "v4l/remote_controllers.xml"> |
241 | <!ENTITY sub-fdl-appendix SYSTEM "v4l/fdl-appendix.xml"> | 242 | <!ENTITY sub-fdl-appendix SYSTEM "v4l/fdl-appendix.xml"> |
242 | <!ENTITY sub-close SYSTEM "v4l/func-close.xml"> | 243 | <!ENTITY sub-close SYSTEM "v4l/func-close.xml"> |
243 | <!ENTITY sub-ioctl SYSTEM "v4l/func-ioctl.xml"> | 244 | <!ENTITY sub-ioctl SYSTEM "v4l/func-ioctl.xml"> |
244 | <!ENTITY sub-mmap SYSTEM "v4l/func-mmap.xml"> | 245 | <!ENTITY sub-mmap SYSTEM "v4l/func-mmap.xml"> |
245 | <!ENTITY sub-munmap SYSTEM "v4l/func-munmap.xml"> | 246 | <!ENTITY sub-munmap SYSTEM "v4l/func-munmap.xml"> |
246 | <!ENTITY sub-open SYSTEM "v4l/func-open.xml"> | 247 | <!ENTITY sub-open SYSTEM "v4l/func-open.xml"> |
247 | <!ENTITY sub-poll SYSTEM "v4l/func-poll.xml"> | 248 | <!ENTITY sub-poll SYSTEM "v4l/func-poll.xml"> |
248 | <!ENTITY sub-read SYSTEM "v4l/func-read.xml"> | 249 | <!ENTITY sub-read SYSTEM "v4l/func-read.xml"> |
249 | <!ENTITY sub-select SYSTEM "v4l/func-select.xml"> | 250 | <!ENTITY sub-select SYSTEM "v4l/func-select.xml"> |
250 | <!ENTITY sub-write SYSTEM "v4l/func-write.xml"> | 251 | <!ENTITY sub-write SYSTEM "v4l/func-write.xml"> |
251 | <!ENTITY sub-io SYSTEM "v4l/io.xml"> | 252 | <!ENTITY sub-io SYSTEM "v4l/io.xml"> |
252 | <!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml"> | 253 | <!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml"> |
253 | <!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml"> | 254 | <!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml"> |
254 | <!ENTITY sub-nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> | 255 | <!ENTITY sub-nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> |
255 | <!ENTITY sub-nv16 SYSTEM "v4l/pixfmt-nv16.xml"> | 256 | <!ENTITY sub-nv16 SYSTEM "v4l/pixfmt-nv16.xml"> |
256 | <!ENTITY sub-packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> | 257 | <!ENTITY sub-packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> |
257 | <!ENTITY sub-packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> | 258 | <!ENTITY sub-packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> |
258 | <!ENTITY sub-sbggr16 SYSTEM "v4l/pixfmt-sbggr16.xml"> | 259 | <!ENTITY sub-sbggr16 SYSTEM "v4l/pixfmt-sbggr16.xml"> |
259 | <!ENTITY sub-sbggr8 SYSTEM "v4l/pixfmt-sbggr8.xml"> | 260 | <!ENTITY sub-sbggr8 SYSTEM "v4l/pixfmt-sbggr8.xml"> |
260 | <!ENTITY sub-sgbrg8 SYSTEM "v4l/pixfmt-sgbrg8.xml"> | 261 | <!ENTITY sub-sgbrg8 SYSTEM "v4l/pixfmt-sgbrg8.xml"> |
261 | <!ENTITY sub-sgrbg8 SYSTEM "v4l/pixfmt-sgrbg8.xml"> | 262 | <!ENTITY sub-sgrbg8 SYSTEM "v4l/pixfmt-sgrbg8.xml"> |
262 | <!ENTITY sub-uyvy SYSTEM "v4l/pixfmt-uyvy.xml"> | 263 | <!ENTITY sub-uyvy SYSTEM "v4l/pixfmt-uyvy.xml"> |
263 | <!ENTITY sub-vyuy SYSTEM "v4l/pixfmt-vyuy.xml"> | 264 | <!ENTITY sub-vyuy SYSTEM "v4l/pixfmt-vyuy.xml"> |
264 | <!ENTITY sub-y16 SYSTEM "v4l/pixfmt-y16.xml"> | 265 | <!ENTITY sub-y16 SYSTEM "v4l/pixfmt-y16.xml"> |
265 | <!ENTITY sub-y41p SYSTEM "v4l/pixfmt-y41p.xml"> | 266 | <!ENTITY sub-y41p SYSTEM "v4l/pixfmt-y41p.xml"> |
266 | <!ENTITY sub-yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> | 267 | <!ENTITY sub-yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> |
267 | <!ENTITY sub-yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> | 268 | <!ENTITY sub-yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> |
268 | <!ENTITY sub-yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> | 269 | <!ENTITY sub-yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> |
269 | <!ENTITY sub-yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml"> | 270 | <!ENTITY sub-yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml"> |
270 | <!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> | 271 | <!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> |
271 | <!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> | 272 | <!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> |
272 | <!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> | 273 | <!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> |
273 | <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> | 274 | <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> |
274 | <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> | 275 | <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> |
275 | <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml"> | 276 | <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml"> |
276 | <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> | 277 | <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> |
277 | <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> | 278 | <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> |
278 | <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> | 279 | <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> |
279 | <!ENTITY sub-encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> | 280 | <!ENTITY sub-encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> |
280 | <!ENTITY sub-enum-fmt SYSTEM "v4l/vidioc-enum-fmt.xml"> | 281 | <!ENTITY sub-enum-fmt SYSTEM "v4l/vidioc-enum-fmt.xml"> |
281 | <!ENTITY sub-enum-frameintervals SYSTEM "v4l/vidioc-enum-frameintervals.xml"> | 282 | <!ENTITY sub-enum-frameintervals SYSTEM "v4l/vidioc-enum-frameintervals.xml"> |
282 | <!ENTITY sub-enum-framesizes SYSTEM "v4l/vidioc-enum-framesizes.xml"> | 283 | <!ENTITY sub-enum-framesizes SYSTEM "v4l/vidioc-enum-framesizes.xml"> |
283 | <!ENTITY sub-enumaudio SYSTEM "v4l/vidioc-enumaudio.xml"> | 284 | <!ENTITY sub-enumaudio SYSTEM "v4l/vidioc-enumaudio.xml"> |
284 | <!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> | 285 | <!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> |
285 | <!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> | 286 | <!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> |
286 | <!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> | 287 | <!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> |
287 | <!ENTITY sub-enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> | 288 | <!ENTITY sub-enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> |
288 | <!ENTITY sub-g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> | 289 | <!ENTITY sub-g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> |
289 | <!ENTITY sub-query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> | 290 | <!ENTITY sub-query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> |
290 | <!ENTITY sub-g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> | 291 | <!ENTITY sub-g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> |
291 | <!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> | 292 | <!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> |
292 | <!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> | 293 | <!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> |
293 | <!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> | 294 | <!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> |
294 | <!ENTITY sub-dbg-g-chip-ident SYSTEM "v4l/vidioc-dbg-g-chip-ident.xml"> | 295 | <!ENTITY sub-dbg-g-chip-ident SYSTEM "v4l/vidioc-dbg-g-chip-ident.xml"> |
295 | <!ENTITY sub-g-crop SYSTEM "v4l/vidioc-g-crop.xml"> | 296 | <!ENTITY sub-g-crop SYSTEM "v4l/vidioc-g-crop.xml"> |
296 | <!ENTITY sub-g-ctrl SYSTEM "v4l/vidioc-g-ctrl.xml"> | 297 | <!ENTITY sub-g-ctrl SYSTEM "v4l/vidioc-g-ctrl.xml"> |
297 | <!ENTITY sub-g-enc-index SYSTEM "v4l/vidioc-g-enc-index.xml"> | 298 | <!ENTITY sub-g-enc-index SYSTEM "v4l/vidioc-g-enc-index.xml"> |
298 | <!ENTITY sub-g-ext-ctrls SYSTEM "v4l/vidioc-g-ext-ctrls.xml"> | 299 | <!ENTITY sub-g-ext-ctrls SYSTEM "v4l/vidioc-g-ext-ctrls.xml"> |
299 | <!ENTITY sub-g-fbuf SYSTEM "v4l/vidioc-g-fbuf.xml"> | 300 | <!ENTITY sub-g-fbuf SYSTEM "v4l/vidioc-g-fbuf.xml"> |
300 | <!ENTITY sub-g-fmt SYSTEM "v4l/vidioc-g-fmt.xml"> | 301 | <!ENTITY sub-g-fmt SYSTEM "v4l/vidioc-g-fmt.xml"> |
301 | <!ENTITY sub-g-frequency SYSTEM "v4l/vidioc-g-frequency.xml"> | 302 | <!ENTITY sub-g-frequency SYSTEM "v4l/vidioc-g-frequency.xml"> |
302 | <!ENTITY sub-g-input SYSTEM "v4l/vidioc-g-input.xml"> | 303 | <!ENTITY sub-g-input SYSTEM "v4l/vidioc-g-input.xml"> |
303 | <!ENTITY sub-g-jpegcomp SYSTEM "v4l/vidioc-g-jpegcomp.xml"> | 304 | <!ENTITY sub-g-jpegcomp SYSTEM "v4l/vidioc-g-jpegcomp.xml"> |
304 | <!ENTITY sub-g-modulator SYSTEM "v4l/vidioc-g-modulator.xml"> | 305 | <!ENTITY sub-g-modulator SYSTEM "v4l/vidioc-g-modulator.xml"> |
305 | <!ENTITY sub-g-output SYSTEM "v4l/vidioc-g-output.xml"> | 306 | <!ENTITY sub-g-output SYSTEM "v4l/vidioc-g-output.xml"> |
306 | <!ENTITY sub-g-parm SYSTEM "v4l/vidioc-g-parm.xml"> | 307 | <!ENTITY sub-g-parm SYSTEM "v4l/vidioc-g-parm.xml"> |
307 | <!ENTITY sub-g-priority SYSTEM "v4l/vidioc-g-priority.xml"> | 308 | <!ENTITY sub-g-priority SYSTEM "v4l/vidioc-g-priority.xml"> |
308 | <!ENTITY sub-g-sliced-vbi-cap SYSTEM "v4l/vidioc-g-sliced-vbi-cap.xml"> | 309 | <!ENTITY sub-g-sliced-vbi-cap SYSTEM "v4l/vidioc-g-sliced-vbi-cap.xml"> |
309 | <!ENTITY sub-g-std SYSTEM "v4l/vidioc-g-std.xml"> | 310 | <!ENTITY sub-g-std SYSTEM "v4l/vidioc-g-std.xml"> |
310 | <!ENTITY sub-g-tuner SYSTEM "v4l/vidioc-g-tuner.xml"> | 311 | <!ENTITY sub-g-tuner SYSTEM "v4l/vidioc-g-tuner.xml"> |
311 | <!ENTITY sub-log-status SYSTEM "v4l/vidioc-log-status.xml"> | 312 | <!ENTITY sub-log-status SYSTEM "v4l/vidioc-log-status.xml"> |
312 | <!ENTITY sub-overlay SYSTEM "v4l/vidioc-overlay.xml"> | 313 | <!ENTITY sub-overlay SYSTEM "v4l/vidioc-overlay.xml"> |
313 | <!ENTITY sub-qbuf SYSTEM "v4l/vidioc-qbuf.xml"> | 314 | <!ENTITY sub-qbuf SYSTEM "v4l/vidioc-qbuf.xml"> |
314 | <!ENTITY sub-querybuf SYSTEM "v4l/vidioc-querybuf.xml"> | 315 | <!ENTITY sub-querybuf SYSTEM "v4l/vidioc-querybuf.xml"> |
315 | <!ENTITY sub-querycap SYSTEM "v4l/vidioc-querycap.xml"> | 316 | <!ENTITY sub-querycap SYSTEM "v4l/vidioc-querycap.xml"> |
316 | <!ENTITY sub-queryctrl SYSTEM "v4l/vidioc-queryctrl.xml"> | 317 | <!ENTITY sub-queryctrl SYSTEM "v4l/vidioc-queryctrl.xml"> |
317 | <!ENTITY sub-querystd SYSTEM "v4l/vidioc-querystd.xml"> | 318 | <!ENTITY sub-querystd SYSTEM "v4l/vidioc-querystd.xml"> |
318 | <!ENTITY sub-reqbufs SYSTEM "v4l/vidioc-reqbufs.xml"> | 319 | <!ENTITY sub-reqbufs SYSTEM "v4l/vidioc-reqbufs.xml"> |
319 | <!ENTITY sub-s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml"> | 320 | <!ENTITY sub-s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml"> |
320 | <!ENTITY sub-streamon SYSTEM "v4l/vidioc-streamon.xml"> | 321 | <!ENTITY sub-streamon SYSTEM "v4l/vidioc-streamon.xml"> |
321 | <!ENTITY sub-capture-c SYSTEM "v4l/capture.c.xml"> | 322 | <!ENTITY sub-capture-c SYSTEM "v4l/capture.c.xml"> |
322 | <!ENTITY sub-keytable-c SYSTEM "v4l/keytable.c.xml"> | 323 | <!ENTITY sub-keytable-c SYSTEM "v4l/keytable.c.xml"> |
323 | <!ENTITY sub-v4l2grab-c SYSTEM "v4l/v4l2grab.c.xml"> | 324 | <!ENTITY sub-v4l2grab-c SYSTEM "v4l/v4l2grab.c.xml"> |
324 | <!ENTITY sub-videodev2-h SYSTEM "v4l/videodev2.h.xml"> | 325 | <!ENTITY sub-videodev2-h SYSTEM "v4l/videodev2.h.xml"> |
325 | <!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml"> | 326 | <!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml"> |
326 | <!ENTITY sub-dqevent SYSTEM "v4l/vidioc-dqevent.xml"> | 327 | <!ENTITY sub-dqevent SYSTEM "v4l/vidioc-dqevent.xml"> |
327 | <!ENTITY sub-subscribe-event SYSTEM "v4l/vidioc-subscribe-event.xml"> | 328 | <!ENTITY sub-subscribe-event SYSTEM "v4l/vidioc-subscribe-event.xml"> |
328 | <!ENTITY sub-intro SYSTEM "dvb/intro.xml"> | 329 | <!ENTITY sub-intro SYSTEM "dvb/intro.xml"> |
329 | <!ENTITY sub-frontend SYSTEM "dvb/frontend.xml"> | 330 | <!ENTITY sub-frontend SYSTEM "dvb/frontend.xml"> |
330 | <!ENTITY sub-dvbproperty SYSTEM "dvb/dvbproperty.xml"> | 331 | <!ENTITY sub-dvbproperty SYSTEM "dvb/dvbproperty.xml"> |
331 | <!ENTITY sub-demux SYSTEM "dvb/demux.xml"> | 332 | <!ENTITY sub-demux SYSTEM "dvb/demux.xml"> |
332 | <!ENTITY sub-video SYSTEM "dvb/video.xml"> | 333 | <!ENTITY sub-video SYSTEM "dvb/video.xml"> |
333 | <!ENTITY sub-audio SYSTEM "dvb/audio.xml"> | 334 | <!ENTITY sub-audio SYSTEM "dvb/audio.xml"> |
334 | <!ENTITY sub-ca SYSTEM "dvb/ca.xml"> | 335 | <!ENTITY sub-ca SYSTEM "dvb/ca.xml"> |
335 | <!ENTITY sub-net SYSTEM "dvb/net.xml"> | 336 | <!ENTITY sub-net SYSTEM "dvb/net.xml"> |
336 | <!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml"> | 337 | <!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml"> |
337 | <!ENTITY sub-examples SYSTEM "dvb/examples.xml"> | 338 | <!ENTITY sub-examples SYSTEM "dvb/examples.xml"> |
338 | <!ENTITY sub-frontend-h SYSTEM "dvb/frontend.h.xml"> | 339 | <!ENTITY sub-frontend-h SYSTEM "dvb/frontend.h.xml"> |
339 | <!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml"> | 340 | <!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml"> |
340 | <!ENTITY sub-media SYSTEM "media.xml"> | 341 | <!ENTITY sub-media SYSTEM "media.xml"> |
341 | <!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> | 342 | <!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> |
342 | <!ENTITY sub-media-indices SYSTEM "media-indices.tmpl"> | 343 | <!ENTITY sub-media-indices SYSTEM "media-indices.tmpl"> |
343 | 344 | ||
344 | <!ENTITY sub-media-controller SYSTEM "v4l/media-controller.xml"> | 345 | <!ENTITY sub-media-controller SYSTEM "v4l/media-controller.xml"> |
345 | <!ENTITY sub-media-open SYSTEM "v4l/media-func-open.xml"> | 346 | <!ENTITY sub-media-open SYSTEM "v4l/media-func-open.xml"> |
346 | <!ENTITY sub-media-close SYSTEM "v4l/media-func-close.xml"> | 347 | <!ENTITY sub-media-close SYSTEM "v4l/media-func-close.xml"> |
347 | <!ENTITY sub-media-ioctl SYSTEM "v4l/media-func-ioctl.xml"> | 348 | <!ENTITY sub-media-ioctl SYSTEM "v4l/media-func-ioctl.xml"> |
348 | <!ENTITY sub-media-ioc-device-info SYSTEM "v4l/media-ioc-device-info.xml"> | 349 | <!ENTITY sub-media-ioc-device-info SYSTEM "v4l/media-ioc-device-info.xml"> |
349 | <!ENTITY sub-media-ioc-enum-entities SYSTEM "v4l/media-ioc-enum-entities.xml"> | 350 | <!ENTITY sub-media-ioc-enum-entities SYSTEM "v4l/media-ioc-enum-entities.xml"> |
350 | <!ENTITY sub-media-ioc-enum-links SYSTEM "v4l/media-ioc-enum-links.xml"> | 351 | <!ENTITY sub-media-ioc-enum-links SYSTEM "v4l/media-ioc-enum-links.xml"> |
352 | <!ENTITY sub-media-ioc-setup-link SYSTEM "v4l/media-ioc-setup-link.xml"> | ||
351 | 353 | ||
352 | <!-- Function Reference --> | 354 | <!-- Function Reference --> |
353 | <!ENTITY close SYSTEM "v4l/func-close.xml"> | 355 | <!ENTITY close SYSTEM "v4l/func-close.xml"> |
354 | <!ENTITY ioctl SYSTEM "v4l/func-ioctl.xml"> | 356 | <!ENTITY ioctl SYSTEM "v4l/func-ioctl.xml"> |
355 | <!ENTITY mmap SYSTEM "v4l/func-mmap.xml"> | 357 | <!ENTITY mmap SYSTEM "v4l/func-mmap.xml"> |
356 | <!ENTITY munmap SYSTEM "v4l/func-munmap.xml"> | 358 | <!ENTITY munmap SYSTEM "v4l/func-munmap.xml"> |
357 | <!ENTITY open SYSTEM "v4l/func-open.xml"> | 359 | <!ENTITY open SYSTEM "v4l/func-open.xml"> |
358 | <!ENTITY poll SYSTEM "v4l/func-poll.xml"> | 360 | <!ENTITY poll SYSTEM "v4l/func-poll.xml"> |
359 | <!ENTITY read SYSTEM "v4l/func-read.xml"> | 361 | <!ENTITY read SYSTEM "v4l/func-read.xml"> |
360 | <!ENTITY select SYSTEM "v4l/func-select.xml"> | 362 | <!ENTITY select SYSTEM "v4l/func-select.xml"> |
361 | <!ENTITY write SYSTEM "v4l/func-write.xml"> | 363 | <!ENTITY write SYSTEM "v4l/func-write.xml"> |
362 | <!ENTITY grey SYSTEM "v4l/pixfmt-grey.xml"> | 364 | <!ENTITY grey SYSTEM "v4l/pixfmt-grey.xml"> |
363 | <!ENTITY nv12 SYSTEM "v4l/pixfmt-nv12.xml"> | 365 | <!ENTITY nv12 SYSTEM "v4l/pixfmt-nv12.xml"> |
364 | <!ENTITY nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> | 366 | <!ENTITY nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> |
365 | <!ENTITY nv16 SYSTEM "v4l/pixfmt-nv16.xml"> | 367 | <!ENTITY nv16 SYSTEM "v4l/pixfmt-nv16.xml"> |
366 | <!ENTITY packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> | 368 | <!ENTITY packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> |
367 | <!ENTITY packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> | 369 | <!ENTITY packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> |
368 | <!ENTITY sbggr16 SYSTEM "v4l/pixfmt-sbggr16.xml"> | 370 | <!ENTITY sbggr16 SYSTEM "v4l/pixfmt-sbggr16.xml"> |
369 | <!ENTITY sbggr8 SYSTEM "v4l/pixfmt-sbggr8.xml"> | 371 | <!ENTITY sbggr8 SYSTEM "v4l/pixfmt-sbggr8.xml"> |
370 | <!ENTITY sgbrg8 SYSTEM "v4l/pixfmt-sgbrg8.xml"> | 372 | <!ENTITY sgbrg8 SYSTEM "v4l/pixfmt-sgbrg8.xml"> |
371 | <!ENTITY sgrbg8 SYSTEM "v4l/pixfmt-sgrbg8.xml"> | 373 | <!ENTITY sgrbg8 SYSTEM "v4l/pixfmt-sgrbg8.xml"> |
372 | <!ENTITY uyvy SYSTEM "v4l/pixfmt-uyvy.xml"> | 374 | <!ENTITY uyvy SYSTEM "v4l/pixfmt-uyvy.xml"> |
373 | <!ENTITY vyuy SYSTEM "v4l/pixfmt-vyuy.xml"> | 375 | <!ENTITY vyuy SYSTEM "v4l/pixfmt-vyuy.xml"> |
374 | <!ENTITY y16 SYSTEM "v4l/pixfmt-y16.xml"> | 376 | <!ENTITY y16 SYSTEM "v4l/pixfmt-y16.xml"> |
375 | <!ENTITY y41p SYSTEM "v4l/pixfmt-y41p.xml"> | 377 | <!ENTITY y41p SYSTEM "v4l/pixfmt-y41p.xml"> |
376 | <!ENTITY yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> | 378 | <!ENTITY yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> |
377 | <!ENTITY yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> | 379 | <!ENTITY yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> |
378 | <!ENTITY yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> | 380 | <!ENTITY yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> |
379 | <!ENTITY yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml"> | 381 | <!ENTITY yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml"> |
380 | <!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> | 382 | <!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> |
381 | <!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> | 383 | <!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> |
382 | <!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> | 384 | <!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> |
383 | <!ENTITY srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> | 385 | <!ENTITY srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> |
384 | <!ENTITY srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> | 386 | <!ENTITY srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> |
385 | <!ENTITY y10 SYSTEM "v4l/pixfmt-y10.xml"> | 387 | <!ENTITY y10 SYSTEM "v4l/pixfmt-y10.xml"> |
386 | <!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> | 388 | <!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> |
387 | <!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> | 389 | <!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> |
388 | <!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> | 390 | <!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> |
389 | <!ENTITY enum-fmt SYSTEM "v4l/vidioc-enum-fmt.xml"> | 391 | <!ENTITY enum-fmt SYSTEM "v4l/vidioc-enum-fmt.xml"> |
390 | <!ENTITY enum-frameintervals SYSTEM "v4l/vidioc-enum-frameintervals.xml"> | 392 | <!ENTITY enum-frameintervals SYSTEM "v4l/vidioc-enum-frameintervals.xml"> |
391 | <!ENTITY enum-framesizes SYSTEM "v4l/vidioc-enum-framesizes.xml"> | 393 | <!ENTITY enum-framesizes SYSTEM "v4l/vidioc-enum-framesizes.xml"> |
392 | <!ENTITY enumaudio SYSTEM "v4l/vidioc-enumaudio.xml"> | 394 | <!ENTITY enumaudio SYSTEM "v4l/vidioc-enumaudio.xml"> |
393 | <!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> | 395 | <!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> |
394 | <!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> | 396 | <!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> |
395 | <!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> | 397 | <!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> |
396 | <!ENTITY enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> | 398 | <!ENTITY enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> |
397 | <!ENTITY g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> | 399 | <!ENTITY g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> |
398 | <!ENTITY query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> | 400 | <!ENTITY query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> |
399 | <!ENTITY g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> | 401 | <!ENTITY g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> |
400 | <!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> | 402 | <!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> |
401 | <!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> | 403 | <!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> |
402 | <!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> | 404 | <!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> |
403 | <!ENTITY dbg-g-chip-ident SYSTEM "v4l/vidioc-dbg-g-chip-ident.xml"> | 405 | <!ENTITY dbg-g-chip-ident SYSTEM "v4l/vidioc-dbg-g-chip-ident.xml"> |
404 | <!ENTITY g-crop SYSTEM "v4l/vidioc-g-crop.xml"> | 406 | <!ENTITY g-crop SYSTEM "v4l/vidioc-g-crop.xml"> |
405 | <!ENTITY g-ctrl SYSTEM "v4l/vidioc-g-ctrl.xml"> | 407 | <!ENTITY g-ctrl SYSTEM "v4l/vidioc-g-ctrl.xml"> |
406 | <!ENTITY g-enc-index SYSTEM "v4l/vidioc-g-enc-index.xml"> | 408 | <!ENTITY g-enc-index SYSTEM "v4l/vidioc-g-enc-index.xml"> |
407 | <!ENTITY g-ext-ctrls SYSTEM "v4l/vidioc-g-ext-ctrls.xml"> | 409 | <!ENTITY g-ext-ctrls SYSTEM "v4l/vidioc-g-ext-ctrls.xml"> |
408 | <!ENTITY g-fbuf SYSTEM "v4l/vidioc-g-fbuf.xml"> | 410 | <!ENTITY g-fbuf SYSTEM "v4l/vidioc-g-fbuf.xml"> |
409 | <!ENTITY g-fmt SYSTEM "v4l/vidioc-g-fmt.xml"> | 411 | <!ENTITY g-fmt SYSTEM "v4l/vidioc-g-fmt.xml"> |
410 | <!ENTITY g-frequency SYSTEM "v4l/vidioc-g-frequency.xml"> | 412 | <!ENTITY g-frequency SYSTEM "v4l/vidioc-g-frequency.xml"> |
411 | <!ENTITY g-input SYSTEM "v4l/vidioc-g-input.xml"> | 413 | <!ENTITY g-input SYSTEM "v4l/vidioc-g-input.xml"> |
412 | <!ENTITY g-jpegcomp SYSTEM "v4l/vidioc-g-jpegcomp.xml"> | 414 | <!ENTITY g-jpegcomp SYSTEM "v4l/vidioc-g-jpegcomp.xml"> |
413 | <!ENTITY g-modulator SYSTEM "v4l/vidioc-g-modulator.xml"> | 415 | <!ENTITY g-modulator SYSTEM "v4l/vidioc-g-modulator.xml"> |
414 | <!ENTITY g-output SYSTEM "v4l/vidioc-g-output.xml"> | 416 | <!ENTITY g-output SYSTEM "v4l/vidioc-g-output.xml"> |
415 | <!ENTITY g-parm SYSTEM "v4l/vidioc-g-parm.xml"> | 417 | <!ENTITY g-parm SYSTEM "v4l/vidioc-g-parm.xml"> |
416 | <!ENTITY g-priority SYSTEM "v4l/vidioc-g-priority.xml"> | 418 | <!ENTITY g-priority SYSTEM "v4l/vidioc-g-priority.xml"> |
417 | <!ENTITY g-sliced-vbi-cap SYSTEM "v4l/vidioc-g-sliced-vbi-cap.xml"> | 419 | <!ENTITY g-sliced-vbi-cap SYSTEM "v4l/vidioc-g-sliced-vbi-cap.xml"> |
418 | <!ENTITY g-std SYSTEM "v4l/vidioc-g-std.xml"> | 420 | <!ENTITY g-std SYSTEM "v4l/vidioc-g-std.xml"> |
419 | <!ENTITY g-tuner SYSTEM "v4l/vidioc-g-tuner.xml"> | 421 | <!ENTITY g-tuner SYSTEM "v4l/vidioc-g-tuner.xml"> |
420 | <!ENTITY log-status SYSTEM "v4l/vidioc-log-status.xml"> | 422 | <!ENTITY log-status SYSTEM "v4l/vidioc-log-status.xml"> |
421 | <!ENTITY overlay SYSTEM "v4l/vidioc-overlay.xml"> | 423 | <!ENTITY overlay SYSTEM "v4l/vidioc-overlay.xml"> |
422 | <!ENTITY qbuf SYSTEM "v4l/vidioc-qbuf.xml"> | 424 | <!ENTITY qbuf SYSTEM "v4l/vidioc-qbuf.xml"> |
423 | <!ENTITY querybuf SYSTEM "v4l/vidioc-querybuf.xml"> | 425 | <!ENTITY querybuf SYSTEM "v4l/vidioc-querybuf.xml"> |
424 | <!ENTITY querycap SYSTEM "v4l/vidioc-querycap.xml"> | 426 | <!ENTITY querycap SYSTEM "v4l/vidioc-querycap.xml"> |
425 | <!ENTITY queryctrl SYSTEM "v4l/vidioc-queryctrl.xml"> | 427 | <!ENTITY queryctrl SYSTEM "v4l/vidioc-queryctrl.xml"> |
426 | <!ENTITY querystd SYSTEM "v4l/vidioc-querystd.xml"> | 428 | <!ENTITY querystd SYSTEM "v4l/vidioc-querystd.xml"> |
427 | <!ENTITY reqbufs SYSTEM "v4l/vidioc-reqbufs.xml"> | 429 | <!ENTITY reqbufs SYSTEM "v4l/vidioc-reqbufs.xml"> |
428 | <!ENTITY s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml"> | 430 | <!ENTITY s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml"> |
429 | <!ENTITY streamon SYSTEM "v4l/vidioc-streamon.xml"> | 431 | <!ENTITY streamon SYSTEM "v4l/vidioc-streamon.xml"> |
430 | <!ENTITY dqevent SYSTEM "v4l/vidioc-dqevent.xml"> | 432 | <!ENTITY dqevent SYSTEM "v4l/vidioc-dqevent.xml"> |
431 | <!ENTITY subscribe_event SYSTEM "v4l/vidioc-subscribe-event.xml"> | 433 | <!ENTITY subscribe_event SYSTEM "v4l/vidioc-subscribe-event.xml"> |
432 | 434 |
Documentation/DocBook/v4l/media-controller.xml
1 | <partinfo> | 1 | <partinfo> |
2 | <authorgroup> | 2 | <authorgroup> |
3 | <author> | 3 | <author> |
4 | <firstname>Laurent</firstname> | 4 | <firstname>Laurent</firstname> |
5 | <surname>Pinchart</surname> | 5 | <surname>Pinchart</surname> |
6 | <affiliation><address><email>laurent.pinchart@ideasonboard.com</email></address></affiliation> | 6 | <affiliation><address><email>laurent.pinchart@ideasonboard.com</email></address></affiliation> |
7 | <contrib>Initial version.</contrib> | 7 | <contrib>Initial version.</contrib> |
8 | </author> | 8 | </author> |
9 | </authorgroup> | 9 | </authorgroup> |
10 | <copyright> | 10 | <copyright> |
11 | <year>2010</year> | 11 | <year>2010</year> |
12 | <holder>Laurent Pinchart</holder> | 12 | <holder>Laurent Pinchart</holder> |
13 | </copyright> | 13 | </copyright> |
14 | 14 | ||
15 | <revhistory> | 15 | <revhistory> |
16 | <!-- Put document revisions here, newest first. --> | 16 | <!-- Put document revisions here, newest first. --> |
17 | <revision> | 17 | <revision> |
18 | <revnumber>1.0.0</revnumber> | 18 | <revnumber>1.0.0</revnumber> |
19 | <date>2010-11-10</date> | 19 | <date>2010-11-10</date> |
20 | <authorinitials>lp</authorinitials> | 20 | <authorinitials>lp</authorinitials> |
21 | <revremark>Initial revision</revremark> | 21 | <revremark>Initial revision</revremark> |
22 | </revision> | 22 | </revision> |
23 | </revhistory> | 23 | </revhistory> |
24 | </partinfo> | 24 | </partinfo> |
25 | 25 | ||
26 | <title>Media Controller API</title> | 26 | <title>Media Controller API</title> |
27 | 27 | ||
28 | <chapter id="media_controller"> | 28 | <chapter id="media_controller"> |
29 | <title>Media Controller</title> | 29 | <title>Media Controller</title> |
30 | 30 | ||
31 | <section id="media-controller-intro"> | 31 | <section id="media-controller-intro"> |
32 | <title>Introduction</title> | 32 | <title>Introduction</title> |
33 | <para>Media devices increasingly handle multiple related functions. Many USB | 33 | <para>Media devices increasingly handle multiple related functions. Many USB |
34 | cameras include microphones, video capture hardware can also output video, | 34 | cameras include microphones, video capture hardware can also output video, |
35 | or SoC camera interfaces also perform memory-to-memory operations similar to | 35 | or SoC camera interfaces also perform memory-to-memory operations similar to |
36 | video codecs.</para> | 36 | video codecs.</para> |
37 | <para>Independent functions, even when implemented in the same hardware, can | 37 | <para>Independent functions, even when implemented in the same hardware, can |
38 | be modelled as separate devices. A USB camera with a microphone will be | 38 | be modelled as separate devices. A USB camera with a microphone will be |
39 | presented to userspace applications as V4L2 and ALSA capture devices. The | 39 | presented to userspace applications as V4L2 and ALSA capture devices. The |
40 | devices' relationships (when using a webcam, end-users shouldn't have to | 40 | devices' relationships (when using a webcam, end-users shouldn't have to |
41 | manually select the associated USB microphone), while not made available | 41 | manually select the associated USB microphone), while not made available |
42 | directly to applications by the drivers, can usually be retrieved from | 42 | directly to applications by the drivers, can usually be retrieved from |
43 | sysfs.</para> | 43 | sysfs.</para> |
44 | <para>With more and more advanced SoC devices being introduced, the current | 44 | <para>With more and more advanced SoC devices being introduced, the current |
45 | approach will not scale. Device topologies are getting increasingly complex | 45 | approach will not scale. Device topologies are getting increasingly complex |
46 | and can't always be represented by a tree structure. Hardware blocks are | 46 | and can't always be represented by a tree structure. Hardware blocks are |
47 | shared between different functions, creating dependencies between seemingly | 47 | shared between different functions, creating dependencies between seemingly |
48 | unrelated devices.</para> | 48 | unrelated devices.</para> |
49 | <para>Kernel abstraction APIs such as V4L2 and ALSA provide means for | 49 | <para>Kernel abstraction APIs such as V4L2 and ALSA provide means for |
50 | applications to access hardware parameters. As newer hardware expose an | 50 | applications to access hardware parameters. As newer hardware expose an |
51 | increasingly high number of those parameters, drivers need to guess what | 51 | increasingly high number of those parameters, drivers need to guess what |
52 | applications really require based on limited information, thereby | 52 | applications really require based on limited information, thereby |
53 | implementing policies that belong to userspace.</para> | 53 | implementing policies that belong to userspace.</para> |
54 | <para>The media controller API aims at solving those problems.</para> | 54 | <para>The media controller API aims at solving those problems.</para> |
55 | </section> | 55 | </section> |
56 | 56 | ||
57 | <section id="media-controller-model"> | 57 | <section id="media-controller-model"> |
58 | <title>Media device model</title> | 58 | <title>Media device model</title> |
59 | <para>Discovering a device internal topology, and configuring it at runtime, | 59 | <para>Discovering a device internal topology, and configuring it at runtime, |
60 | is one of the goals of the media controller API. To achieve this, hardware | 60 | is one of the goals of the media controller API. To achieve this, hardware |
61 | devices are modelled as an oriented graph of building blocks called entities | 61 | devices are modelled as an oriented graph of building blocks called entities |
62 | connected through pads.</para> | 62 | connected through pads.</para> |
63 | <para>An entity is a basic media hardware or software building block. It can | 63 | <para>An entity is a basic media hardware or software building block. It can |
64 | correspond to a large variety of logical blocks such as physical hardware | 64 | correspond to a large variety of logical blocks such as physical hardware |
65 | devices (CMOS sensor for instance), logical hardware devices (a building | 65 | devices (CMOS sensor for instance), logical hardware devices (a building |
66 | block in a System-on-Chip image processing pipeline), DMA channels or | 66 | block in a System-on-Chip image processing pipeline), DMA channels or |
67 | physical connectors.</para> | 67 | physical connectors.</para> |
68 | <para>A pad is a connection endpoint through which an entity can interact | 68 | <para>A pad is a connection endpoint through which an entity can interact |
69 | with other entities. Data (not restricted to video) produced by an entity | 69 | with other entities. Data (not restricted to video) produced by an entity |
70 | flows from the entity's output to one or more entity inputs. Pads should not | 70 | flows from the entity's output to one or more entity inputs. Pads should not |
71 | be confused with physical pins at chip boundaries.</para> | 71 | be confused with physical pins at chip boundaries.</para> |
72 | <para>A link is a point-to-point oriented connection between two pads, | 72 | <para>A link is a point-to-point oriented connection between two pads, |
73 | either on the same entity or on different entities. Data flows from a source | 73 | either on the same entity or on different entities. Data flows from a source |
74 | pad to a sink pad.</para> | 74 | pad to a sink pad.</para> |
75 | </section> | 75 | </section> |
76 | </chapter> | 76 | </chapter> |
77 | 77 | ||
78 | <appendix id="media-user-func"> | 78 | <appendix id="media-user-func"> |
79 | <title>Function Reference</title> | 79 | <title>Function Reference</title> |
80 | <!-- Keep this alphabetically sorted. --> | 80 | <!-- Keep this alphabetically sorted. --> |
81 | &sub-media-open; | 81 | &sub-media-open; |
82 | &sub-media-close; | 82 | &sub-media-close; |
83 | &sub-media-ioctl; | 83 | &sub-media-ioctl; |
84 | <!-- All ioctls go here. --> | 84 | <!-- All ioctls go here. --> |
85 | &sub-media-ioc-device-info; | 85 | &sub-media-ioc-device-info; |
86 | &sub-media-ioc-enum-entities; | 86 | &sub-media-ioc-enum-entities; |
87 | &sub-media-ioc-enum-links; | 87 | &sub-media-ioc-enum-links; |
88 | &sub-media-ioc-setup-link; | ||
88 | </appendix> | 89 | </appendix> |
89 | 90 |
Documentation/DocBook/v4l/media-ioc-setup-link.xml
File was created | 1 | <refentry id="media-ioc-setup-link"> | |
2 | <refmeta> | ||
3 | <refentrytitle>ioctl MEDIA_IOC_SETUP_LINK</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>MEDIA_IOC_SETUP_LINK</refname> | ||
9 | <refpurpose>Modify the properties of a link</refpurpose> | ||
10 | </refnamediv> | ||
11 | |||
12 | <refsynopsisdiv> | ||
13 | <funcsynopsis> | ||
14 | <funcprototype> | ||
15 | <funcdef>int <function>ioctl</function></funcdef> | ||
16 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
17 | <paramdef>int <parameter>request</parameter></paramdef> | ||
18 | <paramdef>struct media_link_desc *<parameter>argp</parameter></paramdef> | ||
19 | </funcprototype> | ||
20 | </funcsynopsis> | ||
21 | </refsynopsisdiv> | ||
22 | |||
23 | <refsect1> | ||
24 | <title>Arguments</title> | ||
25 | |||
26 | <variablelist> | ||
27 | <varlistentry> | ||
28 | <term><parameter>fd</parameter></term> | ||
29 | <listitem> | ||
30 | <para>File descriptor returned by | ||
31 | <link linkend='media-func-open'><function>open()</function></link>.</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>MEDIA_IOC_ENUM_LINKS</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <para>To change link properties applications fill a &media-link-desc; with | ||
53 | link identification information (source and sink pad) and the new requested | ||
54 | link flags. They then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to | ||
55 | that structure.</para> | ||
56 | <para>The only configurable property is the <constant>ENABLED</constant> | ||
57 | link flag to enable/disable a link. Links marked with the | ||
58 | <constant>IMMUTABLE</constant> link flag can not be enabled or disabled. | ||
59 | </para> | ||
60 | <para>Link configuration has no side effect on other links. If an enabled | ||
61 | link at the sink pad prevents the link from being enabled, the driver | ||
62 | returns with an &EBUSY;.</para> | ||
63 | <para>If the specified link can't be found the driver returns with an | ||
64 | &EINVAL;.</para> | ||
65 | </refsect1> | ||
66 | |||
67 | <refsect1> | ||
68 | &return-value; | ||
69 | |||
70 | <variablelist> | ||
71 | <varlistentry> | ||
72 | <term><errorcode>EBUSY</errorcode></term> | ||
73 | <listitem> | ||
74 | <para>The link properties can't be changed because the link is | ||
75 | currently busy. This can be caused, for instance, by an active media | ||
76 | stream (audio or video) on the link. The ioctl shouldn't be retried if | ||
77 | no other action is performed before to fix the problem.</para> | ||
78 | </listitem> | ||
79 | </varlistentry> | ||
80 | <varlistentry> | ||
81 | <term><errorcode>EINVAL</errorcode></term> | ||
82 | <listitem> | ||
83 | <para>The &media-link-desc; references a non-existing link, or the | ||
84 | link is immutable and an attempt to modify its configuration was made. | ||
85 | </para> | ||
86 | </listitem> | ||
87 | </varlistentry> | ||
88 | </variablelist> | ||
89 | </refsect1> | ||
90 | </refentry> | ||
91 |
Documentation/media-framework.txt
1 | Linux kernel media framework | 1 | Linux kernel media framework |
2 | ============================ | 2 | ============================ |
3 | 3 | ||
4 | This document describes the Linux kernel media framework, its data structures, | 4 | This document describes the Linux kernel media framework, its data structures, |
5 | functions and their usage. | 5 | functions and their usage. |
6 | 6 | ||
7 | 7 | ||
8 | Introduction | 8 | Introduction |
9 | ------------ | 9 | ------------ |
10 | 10 | ||
11 | The media controller API is documented in DocBook format in | 11 | The media controller API is documented in DocBook format in |
12 | Documentation/DocBook/v4l/media-controller.xml. This document will focus on | 12 | Documentation/DocBook/v4l/media-controller.xml. This document will focus on |
13 | the kernel-side implementation of the media framework. | 13 | the kernel-side implementation of the media framework. |
14 | 14 | ||
15 | 15 | ||
16 | Abstract media device model | 16 | Abstract media device model |
17 | --------------------------- | 17 | --------------------------- |
18 | 18 | ||
19 | Discovering a device internal topology, and configuring it at runtime, is one | 19 | Discovering a device internal topology, and configuring it at runtime, is one |
20 | of the goals of the media framework. To achieve this, hardware devices are | 20 | of the goals of the media framework. To achieve this, hardware devices are |
21 | modeled as an oriented graph of building blocks called entities connected | 21 | modeled as an oriented graph of building blocks called entities connected |
22 | through pads. | 22 | through pads. |
23 | 23 | ||
24 | An entity is a basic media hardware building block. It can correspond to | 24 | An entity is a basic media hardware building block. It can correspond to |
25 | a large variety of logical blocks such as physical hardware devices | 25 | a large variety of logical blocks such as physical hardware devices |
26 | (CMOS sensor for instance), logical hardware devices (a building block | 26 | (CMOS sensor for instance), logical hardware devices (a building block |
27 | in a System-on-Chip image processing pipeline), DMA channels or physical | 27 | in a System-on-Chip image processing pipeline), DMA channels or physical |
28 | connectors. | 28 | connectors. |
29 | 29 | ||
30 | A pad is a connection endpoint through which an entity can interact with | 30 | A pad is a connection endpoint through which an entity can interact with |
31 | other entities. Data (not restricted to video) produced by an entity | 31 | other entities. Data (not restricted to video) produced by an entity |
32 | flows from the entity's output to one or more entity inputs. Pads should | 32 | flows from the entity's output to one or more entity inputs. Pads should |
33 | not be confused with physical pins at chip boundaries. | 33 | not be confused with physical pins at chip boundaries. |
34 | 34 | ||
35 | A link is a point-to-point oriented connection between two pads, either | 35 | A link is a point-to-point oriented connection between two pads, either |
36 | on the same entity or on different entities. Data flows from a source | 36 | on the same entity or on different entities. Data flows from a source |
37 | pad to a sink pad. | 37 | pad to a sink pad. |
38 | 38 | ||
39 | 39 | ||
40 | Media device | 40 | Media device |
41 | ------------ | 41 | ------------ |
42 | 42 | ||
43 | A media device is represented by a struct media_device instance, defined in | 43 | A media device is represented by a struct media_device instance, defined in |
44 | include/media/media-device.h. Allocation of the structure is handled by the | 44 | include/media/media-device.h. Allocation of the structure is handled by the |
45 | media device driver, usually by embedding the media_device instance in a | 45 | media device driver, usually by embedding the media_device instance in a |
46 | larger driver-specific structure. | 46 | larger driver-specific structure. |
47 | 47 | ||
48 | Drivers register media device instances by calling | 48 | Drivers register media device instances by calling |
49 | 49 | ||
50 | media_device_register(struct media_device *mdev); | 50 | media_device_register(struct media_device *mdev); |
51 | 51 | ||
52 | The caller is responsible for initializing the media_device structure before | 52 | The caller is responsible for initializing the media_device structure before |
53 | registration. The following fields must be set: | 53 | registration. The following fields must be set: |
54 | 54 | ||
55 | - dev must point to the parent device (usually a pci_dev, usb_interface or | 55 | - dev must point to the parent device (usually a pci_dev, usb_interface or |
56 | platform_device instance). | 56 | platform_device instance). |
57 | 57 | ||
58 | - model must be filled with the device model name as a NUL-terminated UTF-8 | 58 | - model must be filled with the device model name as a NUL-terminated UTF-8 |
59 | string. The device/model revision must not be stored in this field. | 59 | string. The device/model revision must not be stored in this field. |
60 | 60 | ||
61 | The following fields are optional: | 61 | The following fields are optional: |
62 | 62 | ||
63 | - serial is a unique serial number stored as a NUL-terminated ASCII string. | 63 | - serial is a unique serial number stored as a NUL-terminated ASCII string. |
64 | The field is big enough to store a GUID in text form. If the hardware | 64 | The field is big enough to store a GUID in text form. If the hardware |
65 | doesn't provide a unique serial number this field must be left empty. | 65 | doesn't provide a unique serial number this field must be left empty. |
66 | 66 | ||
67 | - bus_info represents the location of the device in the system as a | 67 | - bus_info represents the location of the device in the system as a |
68 | NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to | 68 | NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to |
69 | "PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices, | 69 | "PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices, |
70 | the usb_make_path() function must be used. This field is used by | 70 | the usb_make_path() function must be used. This field is used by |
71 | applications to distinguish between otherwise identical devices that don't | 71 | applications to distinguish between otherwise identical devices that don't |
72 | provide a serial number. | 72 | provide a serial number. |
73 | 73 | ||
74 | - hw_revision is the hardware device revision in a driver-specific format. | 74 | - hw_revision is the hardware device revision in a driver-specific format. |
75 | When possible the revision should be formatted with the KERNEL_VERSION | 75 | When possible the revision should be formatted with the KERNEL_VERSION |
76 | macro. | 76 | macro. |
77 | 77 | ||
78 | - driver_version is formatted with the KERNEL_VERSION macro. The version | 78 | - driver_version is formatted with the KERNEL_VERSION macro. The version |
79 | minor must be incremented when new features are added to the userspace API | 79 | minor must be incremented when new features are added to the userspace API |
80 | without breaking binary compatibility. The version major must be | 80 | without breaking binary compatibility. The version major must be |
81 | incremented when binary compatibility is broken. | 81 | incremented when binary compatibility is broken. |
82 | 82 | ||
83 | Upon successful registration a character device named media[0-9]+ is created. | 83 | Upon successful registration a character device named media[0-9]+ is created. |
84 | The device major and minor numbers are dynamic. The model name is exported as | 84 | The device major and minor numbers are dynamic. The model name is exported as |
85 | a sysfs attribute. | 85 | a sysfs attribute. |
86 | 86 | ||
87 | Drivers unregister media device instances by calling | 87 | Drivers unregister media device instances by calling |
88 | 88 | ||
89 | media_device_unregister(struct media_device *mdev); | 89 | media_device_unregister(struct media_device *mdev); |
90 | 90 | ||
91 | Unregistering a media device that hasn't been registered is *NOT* safe. | 91 | Unregistering a media device that hasn't been registered is *NOT* safe. |
92 | 92 | ||
93 | 93 | ||
94 | Entities, pads and links | 94 | Entities, pads and links |
95 | ------------------------ | 95 | ------------------------ |
96 | 96 | ||
97 | - Entities | 97 | - Entities |
98 | 98 | ||
99 | Entities are represented by a struct media_entity instance, defined in | 99 | Entities are represented by a struct media_entity instance, defined in |
100 | include/media/media-entity.h. The structure is usually embedded into a | 100 | include/media/media-entity.h. The structure is usually embedded into a |
101 | higher-level structure, such as a v4l2_subdev or video_device instance, | 101 | higher-level structure, such as a v4l2_subdev or video_device instance, |
102 | although drivers can allocate entities directly. | 102 | although drivers can allocate entities directly. |
103 | 103 | ||
104 | Drivers initialize entities by calling | 104 | Drivers initialize entities by calling |
105 | 105 | ||
106 | media_entity_init(struct media_entity *entity, u16 num_pads, | 106 | media_entity_init(struct media_entity *entity, u16 num_pads, |
107 | struct media_pad *pads, u16 extra_links); | 107 | struct media_pad *pads, u16 extra_links); |
108 | 108 | ||
109 | The media_entity name, type, flags, revision and group_id fields can be | 109 | The media_entity name, type, flags, revision and group_id fields can be |
110 | initialized before or after calling media_entity_init. Entities embedded in | 110 | initialized before or after calling media_entity_init. Entities embedded in |
111 | higher-level standard structures can have some of those fields set by the | 111 | higher-level standard structures can have some of those fields set by the |
112 | higher-level framework. | 112 | higher-level framework. |
113 | 113 | ||
114 | As the number of pads is known in advance, the pads array is not allocated | 114 | As the number of pads is known in advance, the pads array is not allocated |
115 | dynamically but is managed by the entity driver. Most drivers will embed the | 115 | dynamically but is managed by the entity driver. Most drivers will embed the |
116 | pads array in a driver-specific structure, avoiding dynamic allocation. | 116 | pads array in a driver-specific structure, avoiding dynamic allocation. |
117 | 117 | ||
118 | Drivers must set the direction of every pad in the pads array before calling | 118 | Drivers must set the direction of every pad in the pads array before calling |
119 | media_entity_init. The function will initialize the other pads fields. | 119 | media_entity_init. The function will initialize the other pads fields. |
120 | 120 | ||
121 | Unlike the number of pads, the total number of links isn't always known in | 121 | Unlike the number of pads, the total number of links isn't always known in |
122 | advance by the entity driver. As an initial estimate, media_entity_init | 122 | advance by the entity driver. As an initial estimate, media_entity_init |
123 | pre-allocates a number of links equal to the number of pads plus an optional | 123 | pre-allocates a number of links equal to the number of pads plus an optional |
124 | number of extra links. The links array will be reallocated if it grows beyond | 124 | number of extra links. The links array will be reallocated if it grows beyond |
125 | the initial estimate. | 125 | the initial estimate. |
126 | 126 | ||
127 | Drivers register entities with a media device by calling | 127 | Drivers register entities with a media device by calling |
128 | 128 | ||
129 | media_device_register_entity(struct media_device *mdev, | 129 | media_device_register_entity(struct media_device *mdev, |
130 | struct media_entity *entity); | 130 | struct media_entity *entity); |
131 | 131 | ||
132 | Entities are identified by a unique positive integer ID. Drivers can provide an | 132 | Entities are identified by a unique positive integer ID. Drivers can provide an |
133 | ID by filling the media_entity id field prior to registration, or request the | 133 | ID by filling the media_entity id field prior to registration, or request the |
134 | media controller framework to assign an ID automatically. Drivers that provide | 134 | media controller framework to assign an ID automatically. Drivers that provide |
135 | IDs manually must ensure that all IDs are unique. IDs are not guaranteed to be | 135 | IDs manually must ensure that all IDs are unique. IDs are not guaranteed to be |
136 | contiguous even when they are all assigned automatically by the framework. | 136 | contiguous even when they are all assigned automatically by the framework. |
137 | 137 | ||
138 | Drivers unregister entities by calling | 138 | Drivers unregister entities by calling |
139 | 139 | ||
140 | media_device_unregister_entity(struct media_entity *entity); | 140 | media_device_unregister_entity(struct media_entity *entity); |
141 | 141 | ||
142 | Unregistering an entity will not change the IDs of the other entities, and the | 142 | Unregistering an entity will not change the IDs of the other entities, and the |
143 | ID will never be reused for a newly registered entity. | 143 | ID will never be reused for a newly registered entity. |
144 | 144 | ||
145 | When a media device is unregistered, all its entities are unregistered | 145 | When a media device is unregistered, all its entities are unregistered |
146 | automatically. No manual entities unregistration is then required. | 146 | automatically. No manual entities unregistration is then required. |
147 | 147 | ||
148 | Drivers free resources associated with an entity by calling | 148 | Drivers free resources associated with an entity by calling |
149 | 149 | ||
150 | media_entity_cleanup(struct media_entity *entity); | 150 | media_entity_cleanup(struct media_entity *entity); |
151 | 151 | ||
152 | This function must be called during the cleanup phase after unregistering the | 152 | This function must be called during the cleanup phase after unregistering the |
153 | entity. Note that the media_entity instance itself must be freed explicitly by | 153 | entity. Note that the media_entity instance itself must be freed explicitly by |
154 | the driver if required. | 154 | the driver if required. |
155 | 155 | ||
156 | Entities have flags that describe the entity capabilities and state. | 156 | Entities have flags that describe the entity capabilities and state. |
157 | 157 | ||
158 | MEDIA_ENT_FL_DEFAULT indicates the default entity for a given type. | 158 | MEDIA_ENT_FL_DEFAULT indicates the default entity for a given type. |
159 | This can be used to report the default audio and video devices or the | 159 | This can be used to report the default audio and video devices or the |
160 | default camera sensor. | 160 | default camera sensor. |
161 | 161 | ||
162 | Logical entity groups can be defined by setting the group ID of all member | 162 | Logical entity groups can be defined by setting the group ID of all member |
163 | entities to the same non-zero value. An entity group serves no purpose in the | 163 | entities to the same non-zero value. An entity group serves no purpose in the |
164 | kernel, but is reported to userspace during entities enumeration. The group_id | 164 | kernel, but is reported to userspace during entities enumeration. The group_id |
165 | field belongs to the media device driver and must not by touched by entity | 165 | field belongs to the media device driver and must not by touched by entity |
166 | drivers. | 166 | drivers. |
167 | 167 | ||
168 | Media device drivers should define groups if several entities are logically | 168 | Media device drivers should define groups if several entities are logically |
169 | bound together. Example usages include reporting | 169 | bound together. Example usages include reporting |
170 | 170 | ||
171 | - ALSA, VBI and video nodes that carry the same media stream | 171 | - ALSA, VBI and video nodes that carry the same media stream |
172 | - lens and flash controllers associated with a sensor | 172 | - lens and flash controllers associated with a sensor |
173 | 173 | ||
174 | - Pads | 174 | - Pads |
175 | 175 | ||
176 | Pads are represented by a struct media_pad instance, defined in | 176 | Pads are represented by a struct media_pad instance, defined in |
177 | include/media/media-entity.h. Each entity stores its pads in a pads array | 177 | include/media/media-entity.h. Each entity stores its pads in a pads array |
178 | managed by the entity driver. Drivers usually embed the array in a | 178 | managed by the entity driver. Drivers usually embed the array in a |
179 | driver-specific structure. | 179 | driver-specific structure. |
180 | 180 | ||
181 | Pads are identified by their entity and their 0-based index in the pads array. | 181 | Pads are identified by their entity and their 0-based index in the pads array. |
182 | Both information are stored in the media_pad structure, making the media_pad | 182 | Both information are stored in the media_pad structure, making the media_pad |
183 | pointer the canonical way to store and pass link references. | 183 | pointer the canonical way to store and pass link references. |
184 | 184 | ||
185 | Pads have flags that describe the pad capabilities and state. | 185 | Pads have flags that describe the pad capabilities and state. |
186 | 186 | ||
187 | MEDIA_PAD_FL_SINK indicates that the pad supports sinking data. | 187 | MEDIA_PAD_FL_SINK indicates that the pad supports sinking data. |
188 | MEDIA_PAD_FL_SOURCE indicates that the pad supports sourcing data. | 188 | MEDIA_PAD_FL_SOURCE indicates that the pad supports sourcing data. |
189 | 189 | ||
190 | One and only one of MEDIA_PAD_FL_SINK and MEDIA_PAD_FL_SOURCE must be set for | 190 | One and only one of MEDIA_PAD_FL_SINK and MEDIA_PAD_FL_SOURCE must be set for |
191 | each pad. | 191 | each pad. |
192 | 192 | ||
193 | - Links | 193 | - Links |
194 | 194 | ||
195 | Links are represented by a struct media_link instance, defined in | 195 | Links are represented by a struct media_link instance, defined in |
196 | include/media/media-entity.h. Each entity stores all links originating at or | 196 | include/media/media-entity.h. Each entity stores all links originating at or |
197 | targetting any of its pads in a links array. A given link is thus stored | 197 | targetting any of its pads in a links array. A given link is thus stored |
198 | twice, once in the source entity and once in the target entity. The array is | 198 | twice, once in the source entity and once in the target entity. The array is |
199 | pre-allocated and grows dynamically as needed. | 199 | pre-allocated and grows dynamically as needed. |
200 | 200 | ||
201 | Drivers create links by calling | 201 | Drivers create links by calling |
202 | 202 | ||
203 | media_entity_create_link(struct media_entity *source, u16 source_pad, | 203 | media_entity_create_link(struct media_entity *source, u16 source_pad, |
204 | struct media_entity *sink, u16 sink_pad, | 204 | struct media_entity *sink, u16 sink_pad, |
205 | u32 flags); | 205 | u32 flags); |
206 | 206 | ||
207 | An entry in the link array of each entity is allocated and stores pointers | 207 | An entry in the link array of each entity is allocated and stores pointers |
208 | to source and sink pads. | 208 | to source and sink pads. |
209 | 209 | ||
210 | Links have flags that describe the link capabilities and state. | 210 | Links have flags that describe the link capabilities and state. |
211 | 211 | ||
212 | MEDIA_LNK_FL_ENABLED indicates that the link is enabled and can be used | 212 | MEDIA_LNK_FL_ENABLED indicates that the link is enabled and can be used |
213 | to transfer media data. When two or more links target a sink pad, only | 213 | to transfer media data. When two or more links target a sink pad, only |
214 | one of them can be enabled at a time. | 214 | one of them can be enabled at a time. |
215 | MEDIA_LNK_FL_IMMUTABLE indicates that the link enabled state can't be | 215 | MEDIA_LNK_FL_IMMUTABLE indicates that the link enabled state can't be |
216 | modified at runtime. If MEDIA_LNK_FL_IMMUTABLE is set, then | 216 | modified at runtime. If MEDIA_LNK_FL_IMMUTABLE is set, then |
217 | MEDIA_LNK_FL_ENABLED must also be set since an immutable link is always | 217 | MEDIA_LNK_FL_ENABLED must also be set since an immutable link is always |
218 | enabled. | 218 | enabled. |
219 | 219 | ||
220 | 220 | ||
221 | Graph traversal | 221 | Graph traversal |
222 | --------------- | 222 | --------------- |
223 | 223 | ||
224 | The media framework provides APIs to iterate over entities in a graph. | 224 | The media framework provides APIs to iterate over entities in a graph. |
225 | 225 | ||
226 | To iterate over all entities belonging to a media device, drivers can use the | 226 | To iterate over all entities belonging to a media device, drivers can use the |
227 | media_device_for_each_entity macro, defined in include/media/media-device.h. | 227 | media_device_for_each_entity macro, defined in include/media/media-device.h. |
228 | 228 | ||
229 | struct media_entity *entity; | 229 | struct media_entity *entity; |
230 | 230 | ||
231 | media_device_for_each_entity(entity, mdev) { | 231 | media_device_for_each_entity(entity, mdev) { |
232 | /* entity will point to each entity in turn */ | 232 | /* entity will point to each entity in turn */ |
233 | ... | 233 | ... |
234 | } | 234 | } |
235 | 235 | ||
236 | Drivers might also need to iterate over all entities in a graph that can be | 236 | Drivers might also need to iterate over all entities in a graph that can be |
237 | reached only through enabled links starting at a given entity. The media | 237 | reached only through enabled links starting at a given entity. The media |
238 | framework provides a depth-first graph traversal API for that purpose. | 238 | framework provides a depth-first graph traversal API for that purpose. |
239 | 239 | ||
240 | Note that graphs with cycles (whether directed or undirected) are *NOT* | 240 | Note that graphs with cycles (whether directed or undirected) are *NOT* |
241 | supported by the graph traversal API. To prevent infinite loops, the graph | 241 | supported by the graph traversal API. To prevent infinite loops, the graph |
242 | traversal code limits the maximum depth to MEDIA_ENTITY_ENUM_MAX_DEPTH, | 242 | traversal code limits the maximum depth to MEDIA_ENTITY_ENUM_MAX_DEPTH, |
243 | currently defined as 16. | 243 | currently defined as 16. |
244 | 244 | ||
245 | Drivers initiate a graph traversal by calling | 245 | Drivers initiate a graph traversal by calling |
246 | 246 | ||
247 | media_entity_graph_walk_start(struct media_entity_graph *graph, | 247 | media_entity_graph_walk_start(struct media_entity_graph *graph, |
248 | struct media_entity *entity); | 248 | struct media_entity *entity); |
249 | 249 | ||
250 | The graph structure, provided by the caller, is initialized to start graph | 250 | The graph structure, provided by the caller, is initialized to start graph |
251 | traversal at the given entity. | 251 | traversal at the given entity. |
252 | 252 | ||
253 | Drivers can then retrieve the next entity by calling | 253 | Drivers can then retrieve the next entity by calling |
254 | 254 | ||
255 | media_entity_graph_walk_next(struct media_entity_graph *graph); | 255 | media_entity_graph_walk_next(struct media_entity_graph *graph); |
256 | 256 | ||
257 | When the graph traversal is complete the function will return NULL. | 257 | When the graph traversal is complete the function will return NULL. |
258 | 258 | ||
259 | Graph traversal can be interrupted at any moment. No cleanup function call is | 259 | Graph traversal can be interrupted at any moment. No cleanup function call is |
260 | required and the graph structure can be freed normally. | 260 | required and the graph structure can be freed normally. |
261 | 261 | ||
262 | Helper functions can be used to find a link between two given pads, or a pad | ||
263 | connected to another pad through an enabled link | ||
262 | 264 | ||
265 | media_entity_find_link(struct media_pad *source, | ||
266 | struct media_pad *sink); | ||
267 | |||
268 | media_entity_remote_source(struct media_pad *pad); | ||
269 | |||
270 | Refer to the kerneldoc documentation for more information. | ||
271 | |||
272 | |||
263 | Use count and power handling | 273 | Use count and power handling |
264 | ---------------------------- | 274 | ---------------------------- |
265 | 275 | ||
266 | Due to the wide differences between drivers regarding power management needs, | 276 | Due to the wide differences between drivers regarding power management needs, |
267 | the media controller does not implement power management. However, the | 277 | the media controller does not implement power management. However, the |
268 | media_entity structure includes a use_count field that media drivers can use to | 278 | media_entity structure includes a use_count field that media drivers can use to |
269 | track the number of users of every entity for power management needs. | 279 | track the number of users of every entity for power management needs. |
270 | 280 | ||
271 | The use_count field is owned by media drivers and must not be touched by entity | 281 | The use_count field is owned by media drivers and must not be touched by entity |
272 | drivers. Access to the field must be protected by the media device graph_mutex | 282 | drivers. Access to the field must be protected by the media device graph_mutex |
273 | lock. | 283 | lock. |
284 | |||
285 | |||
286 | Links setup | ||
287 | ----------- | ||
288 | |||
289 | Link properties can be modified at runtime by calling | ||
290 | |||
291 | media_entity_setup_link(struct media_link *link, u32 flags); | ||
292 | |||
293 | The flags argument contains the requested new link flags. | ||
294 | |||
295 | The only configurable property is the ENABLED link flag to enable/disable a | ||
296 | link. Links marked with the IMMUTABLE link flag can not be enabled or disabled. | ||
297 | |||
298 | When a link is enabled or disabled, the media framework calls the | ||
299 | link_setup operation for the two entities at the source and sink of the link, | ||
300 | in that order. If the second link_setup call fails, another link_setup call is | ||
301 | made on the first entity to restore the original link flags. | ||
302 | |||
303 | Media device drivers can be notified of link setup operations by setting the | ||
304 | media_device::link_notify pointer to a callback function. If provided, the | ||
305 | notification callback will be called before enabling and after disabling | ||
306 | links. | ||
307 | |||
308 | Entity drivers must implement the link_setup operation if any of their links | ||
309 | is non-immutable. The operation must either configure the hardware or store | ||
310 | the configuration information to be applied later. | ||
311 | |||
312 | Link configuration must not have any side effect on other links. If an enabled | ||
313 | link at a sink pad prevents another link at the same pad from being disabled, | ||
314 | the link_setup operation must return -EBUSY and can't implicitly disable the | ||
315 | first enabled link. | ||
274 | 316 |
drivers/media/media-device.c
1 | /* | 1 | /* |
2 | * Media device | 2 | * Media device |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
7 | * Sakari Ailus <sakari.ailus@iki.fi> | 7 | * Sakari Ailus <sakari.ailus@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/ioctl.h> | 24 | #include <linux/ioctl.h> |
25 | #include <linux/media.h> | 25 | #include <linux/media.h> |
26 | 26 | ||
27 | #include <media/media-device.h> | 27 | #include <media/media-device.h> |
28 | #include <media/media-devnode.h> | 28 | #include <media/media-devnode.h> |
29 | #include <media/media-entity.h> | 29 | #include <media/media-entity.h> |
30 | 30 | ||
31 | /* ----------------------------------------------------------------------------- | 31 | /* ----------------------------------------------------------------------------- |
32 | * Userspace API | 32 | * Userspace API |
33 | */ | 33 | */ |
34 | 34 | ||
35 | static int media_device_open(struct file *filp) | 35 | static int media_device_open(struct file *filp) |
36 | { | 36 | { |
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static int media_device_close(struct file *filp) | 40 | static int media_device_close(struct file *filp) |
41 | { | 41 | { |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | static int media_device_get_info(struct media_device *dev, | 45 | static int media_device_get_info(struct media_device *dev, |
46 | struct media_device_info __user *__info) | 46 | struct media_device_info __user *__info) |
47 | { | 47 | { |
48 | struct media_device_info info; | 48 | struct media_device_info info; |
49 | 49 | ||
50 | memset(&info, 0, sizeof(info)); | 50 | memset(&info, 0, sizeof(info)); |
51 | 51 | ||
52 | strlcpy(info.driver, dev->dev->driver->name, sizeof(info.driver)); | 52 | strlcpy(info.driver, dev->dev->driver->name, sizeof(info.driver)); |
53 | strlcpy(info.model, dev->model, sizeof(info.model)); | 53 | strlcpy(info.model, dev->model, sizeof(info.model)); |
54 | strlcpy(info.serial, dev->serial, sizeof(info.serial)); | 54 | strlcpy(info.serial, dev->serial, sizeof(info.serial)); |
55 | strlcpy(info.bus_info, dev->bus_info, sizeof(info.bus_info)); | 55 | strlcpy(info.bus_info, dev->bus_info, sizeof(info.bus_info)); |
56 | 56 | ||
57 | info.media_version = MEDIA_API_VERSION; | 57 | info.media_version = MEDIA_API_VERSION; |
58 | info.hw_revision = dev->hw_revision; | 58 | info.hw_revision = dev->hw_revision; |
59 | info.driver_version = dev->driver_version; | 59 | info.driver_version = dev->driver_version; |
60 | 60 | ||
61 | return copy_to_user(__info, &info, sizeof(*__info)); | 61 | return copy_to_user(__info, &info, sizeof(*__info)); |
62 | } | 62 | } |
63 | 63 | ||
64 | static struct media_entity *find_entity(struct media_device *mdev, u32 id) | 64 | static struct media_entity *find_entity(struct media_device *mdev, u32 id) |
65 | { | 65 | { |
66 | struct media_entity *entity; | 66 | struct media_entity *entity; |
67 | int next = id & MEDIA_ENT_ID_FLAG_NEXT; | 67 | int next = id & MEDIA_ENT_ID_FLAG_NEXT; |
68 | 68 | ||
69 | id &= ~MEDIA_ENT_ID_FLAG_NEXT; | 69 | id &= ~MEDIA_ENT_ID_FLAG_NEXT; |
70 | 70 | ||
71 | spin_lock(&mdev->lock); | 71 | spin_lock(&mdev->lock); |
72 | 72 | ||
73 | media_device_for_each_entity(entity, mdev) { | 73 | media_device_for_each_entity(entity, mdev) { |
74 | if ((entity->id == id && !next) || | 74 | if ((entity->id == id && !next) || |
75 | (entity->id > id && next)) { | 75 | (entity->id > id && next)) { |
76 | spin_unlock(&mdev->lock); | 76 | spin_unlock(&mdev->lock); |
77 | return entity; | 77 | return entity; |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | spin_unlock(&mdev->lock); | 81 | spin_unlock(&mdev->lock); |
82 | 82 | ||
83 | return NULL; | 83 | return NULL; |
84 | } | 84 | } |
85 | 85 | ||
86 | static long media_device_enum_entities(struct media_device *mdev, | 86 | static long media_device_enum_entities(struct media_device *mdev, |
87 | struct media_entity_desc __user *uent) | 87 | struct media_entity_desc __user *uent) |
88 | { | 88 | { |
89 | struct media_entity *ent; | 89 | struct media_entity *ent; |
90 | struct media_entity_desc u_ent; | 90 | struct media_entity_desc u_ent; |
91 | 91 | ||
92 | if (copy_from_user(&u_ent.id, &uent->id, sizeof(u_ent.id))) | 92 | if (copy_from_user(&u_ent.id, &uent->id, sizeof(u_ent.id))) |
93 | return -EFAULT; | 93 | return -EFAULT; |
94 | 94 | ||
95 | ent = find_entity(mdev, u_ent.id); | 95 | ent = find_entity(mdev, u_ent.id); |
96 | 96 | ||
97 | if (ent == NULL) | 97 | if (ent == NULL) |
98 | return -EINVAL; | 98 | return -EINVAL; |
99 | 99 | ||
100 | u_ent.id = ent->id; | 100 | u_ent.id = ent->id; |
101 | u_ent.name[0] = '\0'; | 101 | u_ent.name[0] = '\0'; |
102 | if (ent->name) | 102 | if (ent->name) |
103 | strlcpy(u_ent.name, ent->name, sizeof(u_ent.name)); | 103 | strlcpy(u_ent.name, ent->name, sizeof(u_ent.name)); |
104 | u_ent.type = ent->type; | 104 | u_ent.type = ent->type; |
105 | u_ent.revision = ent->revision; | 105 | u_ent.revision = ent->revision; |
106 | u_ent.flags = ent->flags; | 106 | u_ent.flags = ent->flags; |
107 | u_ent.group_id = ent->group_id; | 107 | u_ent.group_id = ent->group_id; |
108 | u_ent.pads = ent->num_pads; | 108 | u_ent.pads = ent->num_pads; |
109 | u_ent.links = ent->num_links - ent->num_backlinks; | 109 | u_ent.links = ent->num_links - ent->num_backlinks; |
110 | u_ent.v4l.major = ent->v4l.major; | 110 | u_ent.v4l.major = ent->v4l.major; |
111 | u_ent.v4l.minor = ent->v4l.minor; | 111 | u_ent.v4l.minor = ent->v4l.minor; |
112 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) | 112 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) |
113 | return -EFAULT; | 113 | return -EFAULT; |
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | static void media_device_kpad_to_upad(const struct media_pad *kpad, | 117 | static void media_device_kpad_to_upad(const struct media_pad *kpad, |
118 | struct media_pad_desc *upad) | 118 | struct media_pad_desc *upad) |
119 | { | 119 | { |
120 | upad->entity = kpad->entity->id; | 120 | upad->entity = kpad->entity->id; |
121 | upad->index = kpad->index; | 121 | upad->index = kpad->index; |
122 | upad->flags = kpad->flags; | 122 | upad->flags = kpad->flags; |
123 | } | 123 | } |
124 | 124 | ||
125 | static long media_device_enum_links(struct media_device *mdev, | 125 | static long media_device_enum_links(struct media_device *mdev, |
126 | struct media_links_enum __user *ulinks) | 126 | struct media_links_enum __user *ulinks) |
127 | { | 127 | { |
128 | struct media_entity *entity; | 128 | struct media_entity *entity; |
129 | struct media_links_enum links; | 129 | struct media_links_enum links; |
130 | 130 | ||
131 | if (copy_from_user(&links, ulinks, sizeof(links))) | 131 | if (copy_from_user(&links, ulinks, sizeof(links))) |
132 | return -EFAULT; | 132 | return -EFAULT; |
133 | 133 | ||
134 | entity = find_entity(mdev, links.entity); | 134 | entity = find_entity(mdev, links.entity); |
135 | if (entity == NULL) | 135 | if (entity == NULL) |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | 137 | ||
138 | if (links.pads) { | 138 | if (links.pads) { |
139 | unsigned int p; | 139 | unsigned int p; |
140 | 140 | ||
141 | for (p = 0; p < entity->num_pads; p++) { | 141 | for (p = 0; p < entity->num_pads; p++) { |
142 | struct media_pad_desc pad; | 142 | struct media_pad_desc pad; |
143 | media_device_kpad_to_upad(&entity->pads[p], &pad); | 143 | media_device_kpad_to_upad(&entity->pads[p], &pad); |
144 | if (copy_to_user(&links.pads[p], &pad, sizeof(pad))) | 144 | if (copy_to_user(&links.pads[p], &pad, sizeof(pad))) |
145 | return -EFAULT; | 145 | return -EFAULT; |
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | if (links.links) { | 149 | if (links.links) { |
150 | struct media_link_desc __user *ulink; | 150 | struct media_link_desc __user *ulink; |
151 | unsigned int l; | 151 | unsigned int l; |
152 | 152 | ||
153 | for (l = 0, ulink = links.links; l < entity->num_links; l++) { | 153 | for (l = 0, ulink = links.links; l < entity->num_links; l++) { |
154 | struct media_link_desc link; | 154 | struct media_link_desc link; |
155 | 155 | ||
156 | /* Ignore backlinks. */ | 156 | /* Ignore backlinks. */ |
157 | if (entity->links[l].source->entity != entity) | 157 | if (entity->links[l].source->entity != entity) |
158 | continue; | 158 | continue; |
159 | 159 | ||
160 | media_device_kpad_to_upad(entity->links[l].source, | 160 | media_device_kpad_to_upad(entity->links[l].source, |
161 | &link.source); | 161 | &link.source); |
162 | media_device_kpad_to_upad(entity->links[l].sink, | 162 | media_device_kpad_to_upad(entity->links[l].sink, |
163 | &link.sink); | 163 | &link.sink); |
164 | link.flags = entity->links[l].flags; | 164 | link.flags = entity->links[l].flags; |
165 | if (copy_to_user(ulink, &link, sizeof(*ulink))) | 165 | if (copy_to_user(ulink, &link, sizeof(*ulink))) |
166 | return -EFAULT; | 166 | return -EFAULT; |
167 | ulink++; | 167 | ulink++; |
168 | } | 168 | } |
169 | } | 169 | } |
170 | if (copy_to_user(ulinks, &links, sizeof(*ulinks))) | 170 | if (copy_to_user(ulinks, &links, sizeof(*ulinks))) |
171 | return -EFAULT; | 171 | return -EFAULT; |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | static long media_device_setup_link(struct media_device *mdev, | ||
176 | struct media_link_desc __user *_ulink) | ||
177 | { | ||
178 | struct media_link *link = NULL; | ||
179 | struct media_link_desc ulink; | ||
180 | struct media_entity *source; | ||
181 | struct media_entity *sink; | ||
182 | int ret; | ||
183 | |||
184 | if (copy_from_user(&ulink, _ulink, sizeof(ulink))) | ||
185 | return -EFAULT; | ||
186 | |||
187 | /* Find the source and sink entities and link. | ||
188 | */ | ||
189 | source = find_entity(mdev, ulink.source.entity); | ||
190 | sink = find_entity(mdev, ulink.sink.entity); | ||
191 | |||
192 | if (source == NULL || sink == NULL) | ||
193 | return -EINVAL; | ||
194 | |||
195 | if (ulink.source.index >= source->num_pads || | ||
196 | ulink.sink.index >= sink->num_pads) | ||
197 | return -EINVAL; | ||
198 | |||
199 | link = media_entity_find_link(&source->pads[ulink.source.index], | ||
200 | &sink->pads[ulink.sink.index]); | ||
201 | if (link == NULL) | ||
202 | return -EINVAL; | ||
203 | |||
204 | /* Setup the link on both entities. */ | ||
205 | ret = __media_entity_setup_link(link, ulink.flags); | ||
206 | |||
207 | if (copy_to_user(_ulink, &ulink, sizeof(ulink))) | ||
208 | return -EFAULT; | ||
209 | |||
210 | return ret; | ||
211 | } | ||
212 | |||
175 | static long media_device_ioctl(struct file *filp, unsigned int cmd, | 213 | static long media_device_ioctl(struct file *filp, unsigned int cmd, |
176 | unsigned long arg) | 214 | unsigned long arg) |
177 | { | 215 | { |
178 | struct media_devnode *devnode = media_devnode_data(filp); | 216 | struct media_devnode *devnode = media_devnode_data(filp); |
179 | struct media_device *dev = to_media_device(devnode); | 217 | struct media_device *dev = to_media_device(devnode); |
180 | long ret; | 218 | long ret; |
181 | 219 | ||
182 | switch (cmd) { | 220 | switch (cmd) { |
183 | case MEDIA_IOC_DEVICE_INFO: | 221 | case MEDIA_IOC_DEVICE_INFO: |
184 | ret = media_device_get_info(dev, | 222 | ret = media_device_get_info(dev, |
185 | (struct media_device_info __user *)arg); | 223 | (struct media_device_info __user *)arg); |
186 | break; | 224 | break; |
187 | 225 | ||
188 | case MEDIA_IOC_ENUM_ENTITIES: | 226 | case MEDIA_IOC_ENUM_ENTITIES: |
189 | ret = media_device_enum_entities(dev, | 227 | ret = media_device_enum_entities(dev, |
190 | (struct media_entity_desc __user *)arg); | 228 | (struct media_entity_desc __user *)arg); |
191 | break; | 229 | break; |
192 | 230 | ||
193 | case MEDIA_IOC_ENUM_LINKS: | 231 | case MEDIA_IOC_ENUM_LINKS: |
194 | mutex_lock(&dev->graph_mutex); | 232 | mutex_lock(&dev->graph_mutex); |
195 | ret = media_device_enum_links(dev, | 233 | ret = media_device_enum_links(dev, |
196 | (struct media_links_enum __user *)arg); | 234 | (struct media_links_enum __user *)arg); |
235 | mutex_unlock(&dev->graph_mutex); | ||
236 | break; | ||
237 | |||
238 | case MEDIA_IOC_SETUP_LINK: | ||
239 | mutex_lock(&dev->graph_mutex); | ||
240 | ret = media_device_setup_link(dev, | ||
241 | (struct media_link_desc __user *)arg); | ||
197 | mutex_unlock(&dev->graph_mutex); | 242 | mutex_unlock(&dev->graph_mutex); |
198 | break; | 243 | break; |
199 | 244 | ||
200 | default: | 245 | default: |
201 | ret = -ENOIOCTLCMD; | 246 | ret = -ENOIOCTLCMD; |
202 | } | 247 | } |
203 | 248 | ||
204 | return ret; | 249 | return ret; |
205 | } | 250 | } |
206 | 251 | ||
207 | static const struct media_file_operations media_device_fops = { | 252 | static const struct media_file_operations media_device_fops = { |
208 | .owner = THIS_MODULE, | 253 | .owner = THIS_MODULE, |
209 | .open = media_device_open, | 254 | .open = media_device_open, |
210 | .ioctl = media_device_ioctl, | 255 | .ioctl = media_device_ioctl, |
211 | .release = media_device_close, | 256 | .release = media_device_close, |
212 | }; | 257 | }; |
213 | 258 | ||
214 | /* ----------------------------------------------------------------------------- | 259 | /* ----------------------------------------------------------------------------- |
215 | * sysfs | 260 | * sysfs |
216 | */ | 261 | */ |
217 | 262 | ||
218 | static ssize_t show_model(struct device *cd, | 263 | static ssize_t show_model(struct device *cd, |
219 | struct device_attribute *attr, char *buf) | 264 | struct device_attribute *attr, char *buf) |
220 | { | 265 | { |
221 | struct media_device *mdev = to_media_device(to_media_devnode(cd)); | 266 | struct media_device *mdev = to_media_device(to_media_devnode(cd)); |
222 | 267 | ||
223 | return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model); | 268 | return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model); |
224 | } | 269 | } |
225 | 270 | ||
226 | static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); | 271 | static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); |
227 | 272 | ||
228 | /* ----------------------------------------------------------------------------- | 273 | /* ----------------------------------------------------------------------------- |
229 | * Registration/unregistration | 274 | * Registration/unregistration |
230 | */ | 275 | */ |
231 | 276 | ||
232 | static void media_device_release(struct media_devnode *mdev) | 277 | static void media_device_release(struct media_devnode *mdev) |
233 | { | 278 | { |
234 | } | 279 | } |
235 | 280 | ||
236 | /** | 281 | /** |
237 | * media_device_register - register a media device | 282 | * media_device_register - register a media device |
238 | * @mdev: The media device | 283 | * @mdev: The media device |
239 | * | 284 | * |
240 | * The caller is responsible for initializing the media device before | 285 | * The caller is responsible for initializing the media device before |
241 | * registration. The following fields must be set: | 286 | * registration. The following fields must be set: |
242 | * | 287 | * |
243 | * - dev must point to the parent device | 288 | * - dev must point to the parent device |
244 | * - model must be filled with the device model name | 289 | * - model must be filled with the device model name |
245 | */ | 290 | */ |
246 | int __must_check media_device_register(struct media_device *mdev) | 291 | int __must_check media_device_register(struct media_device *mdev) |
247 | { | 292 | { |
248 | int ret; | 293 | int ret; |
249 | 294 | ||
250 | if (WARN_ON(mdev->dev == NULL || mdev->model[0] == 0)) | 295 | if (WARN_ON(mdev->dev == NULL || mdev->model[0] == 0)) |
251 | return -EINVAL; | 296 | return -EINVAL; |
252 | 297 | ||
253 | mdev->entity_id = 1; | 298 | mdev->entity_id = 1; |
254 | INIT_LIST_HEAD(&mdev->entities); | 299 | INIT_LIST_HEAD(&mdev->entities); |
255 | spin_lock_init(&mdev->lock); | 300 | spin_lock_init(&mdev->lock); |
256 | mutex_init(&mdev->graph_mutex); | 301 | mutex_init(&mdev->graph_mutex); |
257 | 302 | ||
258 | /* Register the device node. */ | 303 | /* Register the device node. */ |
259 | mdev->devnode.fops = &media_device_fops; | 304 | mdev->devnode.fops = &media_device_fops; |
260 | mdev->devnode.parent = mdev->dev; | 305 | mdev->devnode.parent = mdev->dev; |
261 | mdev->devnode.release = media_device_release; | 306 | mdev->devnode.release = media_device_release; |
262 | ret = media_devnode_register(&mdev->devnode); | 307 | ret = media_devnode_register(&mdev->devnode); |
263 | if (ret < 0) | 308 | if (ret < 0) |
264 | return ret; | 309 | return ret; |
265 | 310 | ||
266 | ret = device_create_file(&mdev->devnode.dev, &dev_attr_model); | 311 | ret = device_create_file(&mdev->devnode.dev, &dev_attr_model); |
267 | if (ret < 0) { | 312 | if (ret < 0) { |
268 | media_devnode_unregister(&mdev->devnode); | 313 | media_devnode_unregister(&mdev->devnode); |
269 | return ret; | 314 | return ret; |
270 | } | 315 | } |
271 | 316 | ||
272 | return 0; | 317 | return 0; |
273 | } | 318 | } |
274 | EXPORT_SYMBOL_GPL(media_device_register); | 319 | EXPORT_SYMBOL_GPL(media_device_register); |
275 | 320 | ||
276 | /** | 321 | /** |
277 | * media_device_unregister - unregister a media device | 322 | * media_device_unregister - unregister a media device |
278 | * @mdev: The media device | 323 | * @mdev: The media device |
279 | * | 324 | * |
280 | */ | 325 | */ |
281 | void media_device_unregister(struct media_device *mdev) | 326 | void media_device_unregister(struct media_device *mdev) |
282 | { | 327 | { |
283 | struct media_entity *entity; | 328 | struct media_entity *entity; |
284 | struct media_entity *next; | 329 | struct media_entity *next; |
285 | 330 | ||
286 | list_for_each_entry_safe(entity, next, &mdev->entities, list) | 331 | list_for_each_entry_safe(entity, next, &mdev->entities, list) |
287 | media_device_unregister_entity(entity); | 332 | media_device_unregister_entity(entity); |
288 | 333 | ||
289 | device_remove_file(&mdev->devnode.dev, &dev_attr_model); | 334 | device_remove_file(&mdev->devnode.dev, &dev_attr_model); |
290 | media_devnode_unregister(&mdev->devnode); | 335 | media_devnode_unregister(&mdev->devnode); |
291 | } | 336 | } |
292 | EXPORT_SYMBOL_GPL(media_device_unregister); | 337 | EXPORT_SYMBOL_GPL(media_device_unregister); |
293 | 338 | ||
294 | /** | 339 | /** |
295 | * media_device_register_entity - Register an entity with a media device | 340 | * media_device_register_entity - Register an entity with a media device |
296 | * @mdev: The media device | 341 | * @mdev: The media device |
297 | * @entity: The entity | 342 | * @entity: The entity |
298 | */ | 343 | */ |
299 | int __must_check media_device_register_entity(struct media_device *mdev, | 344 | int __must_check media_device_register_entity(struct media_device *mdev, |
300 | struct media_entity *entity) | 345 | struct media_entity *entity) |
301 | { | 346 | { |
302 | /* Warn if we apparently re-register an entity */ | 347 | /* Warn if we apparently re-register an entity */ |
303 | WARN_ON(entity->parent != NULL); | 348 | WARN_ON(entity->parent != NULL); |
304 | entity->parent = mdev; | 349 | entity->parent = mdev; |
305 | 350 | ||
306 | spin_lock(&mdev->lock); | 351 | spin_lock(&mdev->lock); |
307 | if (entity->id == 0) | 352 | if (entity->id == 0) |
308 | entity->id = mdev->entity_id++; | 353 | entity->id = mdev->entity_id++; |
309 | else | 354 | else |
310 | mdev->entity_id = max(entity->id + 1, mdev->entity_id); | 355 | mdev->entity_id = max(entity->id + 1, mdev->entity_id); |
311 | list_add_tail(&entity->list, &mdev->entities); | 356 | list_add_tail(&entity->list, &mdev->entities); |
312 | spin_unlock(&mdev->lock); | 357 | spin_unlock(&mdev->lock); |
313 | 358 | ||
314 | return 0; | 359 | return 0; |
315 | } | 360 | } |
316 | EXPORT_SYMBOL_GPL(media_device_register_entity); | 361 | EXPORT_SYMBOL_GPL(media_device_register_entity); |
317 | 362 | ||
318 | /** | 363 | /** |
319 | * media_device_unregister_entity - Unregister an entity | 364 | * media_device_unregister_entity - Unregister an entity |
320 | * @entity: The entity | 365 | * @entity: The entity |
321 | * | 366 | * |
322 | * If the entity has never been registered this function will return | 367 | * If the entity has never been registered this function will return |
323 | * immediately. | 368 | * immediately. |
324 | */ | 369 | */ |
325 | void media_device_unregister_entity(struct media_entity *entity) | 370 | void media_device_unregister_entity(struct media_entity *entity) |
326 | { | 371 | { |
327 | struct media_device *mdev = entity->parent; | 372 | struct media_device *mdev = entity->parent; |
328 | 373 | ||
329 | if (mdev == NULL) | 374 | if (mdev == NULL) |
330 | return; | 375 | return; |
331 | 376 | ||
332 | spin_lock(&mdev->lock); | 377 | spin_lock(&mdev->lock); |
333 | list_del(&entity->list); | 378 | list_del(&entity->list); |
334 | spin_unlock(&mdev->lock); | 379 | spin_unlock(&mdev->lock); |
335 | entity->parent = NULL; | 380 | entity->parent = NULL; |
336 | } | 381 | } |
337 | EXPORT_SYMBOL_GPL(media_device_unregister_entity); | 382 | EXPORT_SYMBOL_GPL(media_device_unregister_entity); |
338 | 383 |
drivers/media/media-entity.c
1 | /* | 1 | /* |
2 | * Media entity | 2 | * Media entity |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
7 | * Sakari Ailus <sakari.ailus@iki.fi> | 7 | * Sakari Ailus <sakari.ailus@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <media/media-entity.h> | 25 | #include <media/media-entity.h> |
26 | #include <media/media-device.h> | 26 | #include <media/media-device.h> |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * media_entity_init - Initialize a media entity | 29 | * media_entity_init - Initialize a media entity |
30 | * | 30 | * |
31 | * @num_pads: Total number of sink and source pads. | 31 | * @num_pads: Total number of sink and source pads. |
32 | * @extra_links: Initial estimate of the number of extra links. | 32 | * @extra_links: Initial estimate of the number of extra links. |
33 | * @pads: Array of 'num_pads' pads. | 33 | * @pads: Array of 'num_pads' pads. |
34 | * | 34 | * |
35 | * The total number of pads is an intrinsic property of entities known by the | 35 | * The total number of pads is an intrinsic property of entities known by the |
36 | * entity driver, while the total number of links depends on hardware design | 36 | * entity driver, while the total number of links depends on hardware design |
37 | * and is an extrinsic property unknown to the entity driver. However, in most | 37 | * and is an extrinsic property unknown to the entity driver. However, in most |
38 | * use cases the entity driver can guess the number of links which can safely | 38 | * use cases the entity driver can guess the number of links which can safely |
39 | * be assumed to be equal to or larger than the number of pads. | 39 | * be assumed to be equal to or larger than the number of pads. |
40 | * | 40 | * |
41 | * For those reasons the links array can be preallocated based on the entity | 41 | * For those reasons the links array can be preallocated based on the entity |
42 | * driver guess and will be reallocated later if extra links need to be | 42 | * driver guess and will be reallocated later if extra links need to be |
43 | * created. | 43 | * created. |
44 | * | 44 | * |
45 | * This function allocates a links array with enough space to hold at least | 45 | * This function allocates a links array with enough space to hold at least |
46 | * 'num_pads' + 'extra_links' elements. The media_entity::max_links field will | 46 | * 'num_pads' + 'extra_links' elements. The media_entity::max_links field will |
47 | * be set to the number of allocated elements. | 47 | * be set to the number of allocated elements. |
48 | * | 48 | * |
49 | * The pads array is managed by the entity driver and passed to | 49 | * The pads array is managed by the entity driver and passed to |
50 | * media_entity_init() where its pointer will be stored in the entity structure. | 50 | * media_entity_init() where its pointer will be stored in the entity structure. |
51 | */ | 51 | */ |
52 | int | 52 | int |
53 | media_entity_init(struct media_entity *entity, u16 num_pads, | 53 | media_entity_init(struct media_entity *entity, u16 num_pads, |
54 | struct media_pad *pads, u16 extra_links) | 54 | struct media_pad *pads, u16 extra_links) |
55 | { | 55 | { |
56 | struct media_link *links; | 56 | struct media_link *links; |
57 | unsigned int max_links = num_pads + extra_links; | 57 | unsigned int max_links = num_pads + extra_links; |
58 | unsigned int i; | 58 | unsigned int i; |
59 | 59 | ||
60 | links = kzalloc(max_links * sizeof(links[0]), GFP_KERNEL); | 60 | links = kzalloc(max_links * sizeof(links[0]), GFP_KERNEL); |
61 | if (links == NULL) | 61 | if (links == NULL) |
62 | return -ENOMEM; | 62 | return -ENOMEM; |
63 | 63 | ||
64 | entity->group_id = 0; | 64 | entity->group_id = 0; |
65 | entity->max_links = max_links; | 65 | entity->max_links = max_links; |
66 | entity->num_links = 0; | 66 | entity->num_links = 0; |
67 | entity->num_backlinks = 0; | 67 | entity->num_backlinks = 0; |
68 | entity->num_pads = num_pads; | 68 | entity->num_pads = num_pads; |
69 | entity->pads = pads; | 69 | entity->pads = pads; |
70 | entity->links = links; | 70 | entity->links = links; |
71 | 71 | ||
72 | for (i = 0; i < num_pads; i++) { | 72 | for (i = 0; i < num_pads; i++) { |
73 | pads[i].entity = entity; | 73 | pads[i].entity = entity; |
74 | pads[i].index = i; | 74 | pads[i].index = i; |
75 | } | 75 | } |
76 | 76 | ||
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | EXPORT_SYMBOL_GPL(media_entity_init); | 79 | EXPORT_SYMBOL_GPL(media_entity_init); |
80 | 80 | ||
81 | void | 81 | void |
82 | media_entity_cleanup(struct media_entity *entity) | 82 | media_entity_cleanup(struct media_entity *entity) |
83 | { | 83 | { |
84 | kfree(entity->links); | 84 | kfree(entity->links); |
85 | } | 85 | } |
86 | EXPORT_SYMBOL_GPL(media_entity_cleanup); | 86 | EXPORT_SYMBOL_GPL(media_entity_cleanup); |
87 | 87 | ||
88 | /* ----------------------------------------------------------------------------- | 88 | /* ----------------------------------------------------------------------------- |
89 | * Graph traversal | 89 | * Graph traversal |
90 | */ | 90 | */ |
91 | 91 | ||
92 | static struct media_entity * | 92 | static struct media_entity * |
93 | media_entity_other(struct media_entity *entity, struct media_link *link) | 93 | media_entity_other(struct media_entity *entity, struct media_link *link) |
94 | { | 94 | { |
95 | if (link->source->entity == entity) | 95 | if (link->source->entity == entity) |
96 | return link->sink->entity; | 96 | return link->sink->entity; |
97 | else | 97 | else |
98 | return link->source->entity; | 98 | return link->source->entity; |
99 | } | 99 | } |
100 | 100 | ||
101 | /* push an entity to traversal stack */ | 101 | /* push an entity to traversal stack */ |
102 | static void stack_push(struct media_entity_graph *graph, | 102 | static void stack_push(struct media_entity_graph *graph, |
103 | struct media_entity *entity) | 103 | struct media_entity *entity) |
104 | { | 104 | { |
105 | if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) { | 105 | if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) { |
106 | WARN_ON(1); | 106 | WARN_ON(1); |
107 | return; | 107 | return; |
108 | } | 108 | } |
109 | graph->top++; | 109 | graph->top++; |
110 | graph->stack[graph->top].link = 0; | 110 | graph->stack[graph->top].link = 0; |
111 | graph->stack[graph->top].entity = entity; | 111 | graph->stack[graph->top].entity = entity; |
112 | } | 112 | } |
113 | 113 | ||
114 | static struct media_entity *stack_pop(struct media_entity_graph *graph) | 114 | static struct media_entity *stack_pop(struct media_entity_graph *graph) |
115 | { | 115 | { |
116 | struct media_entity *entity; | 116 | struct media_entity *entity; |
117 | 117 | ||
118 | entity = graph->stack[graph->top].entity; | 118 | entity = graph->stack[graph->top].entity; |
119 | graph->top--; | 119 | graph->top--; |
120 | 120 | ||
121 | return entity; | 121 | return entity; |
122 | } | 122 | } |
123 | 123 | ||
124 | #define stack_peek(en) ((en)->stack[(en)->top - 1].entity) | 124 | #define stack_peek(en) ((en)->stack[(en)->top - 1].entity) |
125 | #define link_top(en) ((en)->stack[(en)->top].link) | 125 | #define link_top(en) ((en)->stack[(en)->top].link) |
126 | #define stack_top(en) ((en)->stack[(en)->top].entity) | 126 | #define stack_top(en) ((en)->stack[(en)->top].entity) |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * media_entity_graph_walk_start - Start walking the media graph at a given entity | 129 | * media_entity_graph_walk_start - Start walking the media graph at a given entity |
130 | * @graph: Media graph structure that will be used to walk the graph | 130 | * @graph: Media graph structure that will be used to walk the graph |
131 | * @entity: Starting entity | 131 | * @entity: Starting entity |
132 | * | 132 | * |
133 | * This function initializes the graph traversal structure to walk the entities | 133 | * This function initializes the graph traversal structure to walk the entities |
134 | * graph starting at the given entity. The traversal structure must not be | 134 | * graph starting at the given entity. The traversal structure must not be |
135 | * modified by the caller during graph traversal. When done the structure can | 135 | * modified by the caller during graph traversal. When done the structure can |
136 | * safely be freed. | 136 | * safely be freed. |
137 | */ | 137 | */ |
138 | void media_entity_graph_walk_start(struct media_entity_graph *graph, | 138 | void media_entity_graph_walk_start(struct media_entity_graph *graph, |
139 | struct media_entity *entity) | 139 | struct media_entity *entity) |
140 | { | 140 | { |
141 | graph->top = 0; | 141 | graph->top = 0; |
142 | graph->stack[graph->top].entity = NULL; | 142 | graph->stack[graph->top].entity = NULL; |
143 | stack_push(graph, entity); | 143 | stack_push(graph, entity); |
144 | } | 144 | } |
145 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_start); | 145 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_start); |
146 | 146 | ||
147 | /** | 147 | /** |
148 | * media_entity_graph_walk_next - Get the next entity in the graph | 148 | * media_entity_graph_walk_next - Get the next entity in the graph |
149 | * @graph: Media graph structure | 149 | * @graph: Media graph structure |
150 | * | 150 | * |
151 | * Perform a depth-first traversal of the given media entities graph. | 151 | * Perform a depth-first traversal of the given media entities graph. |
152 | * | 152 | * |
153 | * The graph structure must have been previously initialized with a call to | 153 | * The graph structure must have been previously initialized with a call to |
154 | * media_entity_graph_walk_start(). | 154 | * media_entity_graph_walk_start(). |
155 | * | 155 | * |
156 | * Return the next entity in the graph or NULL if the whole graph have been | 156 | * Return the next entity in the graph or NULL if the whole graph have been |
157 | * traversed. | 157 | * traversed. |
158 | */ | 158 | */ |
159 | struct media_entity * | 159 | struct media_entity * |
160 | media_entity_graph_walk_next(struct media_entity_graph *graph) | 160 | media_entity_graph_walk_next(struct media_entity_graph *graph) |
161 | { | 161 | { |
162 | if (stack_top(graph) == NULL) | 162 | if (stack_top(graph) == NULL) |
163 | return NULL; | 163 | return NULL; |
164 | 164 | ||
165 | /* | 165 | /* |
166 | * Depth first search. Push entity to stack and continue from | 166 | * Depth first search. Push entity to stack and continue from |
167 | * top of the stack until no more entities on the level can be | 167 | * top of the stack until no more entities on the level can be |
168 | * found. | 168 | * found. |
169 | */ | 169 | */ |
170 | while (link_top(graph) < stack_top(graph)->num_links) { | 170 | while (link_top(graph) < stack_top(graph)->num_links) { |
171 | struct media_entity *entity = stack_top(graph); | 171 | struct media_entity *entity = stack_top(graph); |
172 | struct media_link *link = &entity->links[link_top(graph)]; | 172 | struct media_link *link = &entity->links[link_top(graph)]; |
173 | struct media_entity *next; | 173 | struct media_entity *next; |
174 | 174 | ||
175 | /* The link is not enabled so we do not follow. */ | 175 | /* The link is not enabled so we do not follow. */ |
176 | if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { | 176 | if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { |
177 | link_top(graph)++; | 177 | link_top(graph)++; |
178 | continue; | 178 | continue; |
179 | } | 179 | } |
180 | 180 | ||
181 | /* Get the entity in the other end of the link . */ | 181 | /* Get the entity in the other end of the link . */ |
182 | next = media_entity_other(entity, link); | 182 | next = media_entity_other(entity, link); |
183 | 183 | ||
184 | /* Was it the entity we came here from? */ | 184 | /* Was it the entity we came here from? */ |
185 | if (next == stack_peek(graph)) { | 185 | if (next == stack_peek(graph)) { |
186 | link_top(graph)++; | 186 | link_top(graph)++; |
187 | continue; | 187 | continue; |
188 | } | 188 | } |
189 | 189 | ||
190 | /* Push the new entity to stack and start over. */ | 190 | /* Push the new entity to stack and start over. */ |
191 | link_top(graph)++; | 191 | link_top(graph)++; |
192 | stack_push(graph, next); | 192 | stack_push(graph, next); |
193 | } | 193 | } |
194 | 194 | ||
195 | return stack_pop(graph); | 195 | return stack_pop(graph); |
196 | } | 196 | } |
197 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_next); | 197 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_next); |
198 | 198 | ||
199 | /* ----------------------------------------------------------------------------- | 199 | /* ----------------------------------------------------------------------------- |
200 | * Module use count | 200 | * Module use count |
201 | */ | 201 | */ |
202 | 202 | ||
203 | /* | 203 | /* |
204 | * media_entity_get - Get a reference to the parent module | 204 | * media_entity_get - Get a reference to the parent module |
205 | * @entity: The entity | 205 | * @entity: The entity |
206 | * | 206 | * |
207 | * Get a reference to the parent media device module. | 207 | * Get a reference to the parent media device module. |
208 | * | 208 | * |
209 | * The function will return immediately if @entity is NULL. | 209 | * The function will return immediately if @entity is NULL. |
210 | * | 210 | * |
211 | * Return a pointer to the entity on success or NULL on failure. | 211 | * Return a pointer to the entity on success or NULL on failure. |
212 | */ | 212 | */ |
213 | struct media_entity *media_entity_get(struct media_entity *entity) | 213 | struct media_entity *media_entity_get(struct media_entity *entity) |
214 | { | 214 | { |
215 | if (entity == NULL) | 215 | if (entity == NULL) |
216 | return NULL; | 216 | return NULL; |
217 | 217 | ||
218 | if (entity->parent->dev && | 218 | if (entity->parent->dev && |
219 | !try_module_get(entity->parent->dev->driver->owner)) | 219 | !try_module_get(entity->parent->dev->driver->owner)) |
220 | return NULL; | 220 | return NULL; |
221 | 221 | ||
222 | return entity; | 222 | return entity; |
223 | } | 223 | } |
224 | EXPORT_SYMBOL_GPL(media_entity_get); | 224 | EXPORT_SYMBOL_GPL(media_entity_get); |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * media_entity_put - Release the reference to the parent module | 227 | * media_entity_put - Release the reference to the parent module |
228 | * @entity: The entity | 228 | * @entity: The entity |
229 | * | 229 | * |
230 | * Release the reference count acquired by media_entity_get(). | 230 | * Release the reference count acquired by media_entity_get(). |
231 | * | 231 | * |
232 | * The function will return immediately if @entity is NULL. | 232 | * The function will return immediately if @entity is NULL. |
233 | */ | 233 | */ |
234 | void media_entity_put(struct media_entity *entity) | 234 | void media_entity_put(struct media_entity *entity) |
235 | { | 235 | { |
236 | if (entity == NULL) | 236 | if (entity == NULL) |
237 | return; | 237 | return; |
238 | 238 | ||
239 | if (entity->parent->dev) | 239 | if (entity->parent->dev) |
240 | module_put(entity->parent->dev->driver->owner); | 240 | module_put(entity->parent->dev->driver->owner); |
241 | } | 241 | } |
242 | EXPORT_SYMBOL_GPL(media_entity_put); | 242 | EXPORT_SYMBOL_GPL(media_entity_put); |
243 | 243 | ||
244 | /* ----------------------------------------------------------------------------- | 244 | /* ----------------------------------------------------------------------------- |
245 | * Links management | 245 | * Links management |
246 | */ | 246 | */ |
247 | 247 | ||
248 | static struct media_link *media_entity_add_link(struct media_entity *entity) | 248 | static struct media_link *media_entity_add_link(struct media_entity *entity) |
249 | { | 249 | { |
250 | if (entity->num_links >= entity->max_links) { | 250 | if (entity->num_links >= entity->max_links) { |
251 | struct media_link *links = entity->links; | 251 | struct media_link *links = entity->links; |
252 | unsigned int max_links = entity->max_links + 2; | 252 | unsigned int max_links = entity->max_links + 2; |
253 | unsigned int i; | 253 | unsigned int i; |
254 | 254 | ||
255 | links = krealloc(links, max_links * sizeof(*links), GFP_KERNEL); | 255 | links = krealloc(links, max_links * sizeof(*links), GFP_KERNEL); |
256 | if (links == NULL) | 256 | if (links == NULL) |
257 | return NULL; | 257 | return NULL; |
258 | 258 | ||
259 | for (i = 0; i < entity->num_links; i++) | 259 | for (i = 0; i < entity->num_links; i++) |
260 | links[i].reverse->reverse = &links[i]; | 260 | links[i].reverse->reverse = &links[i]; |
261 | 261 | ||
262 | entity->max_links = max_links; | 262 | entity->max_links = max_links; |
263 | entity->links = links; | 263 | entity->links = links; |
264 | } | 264 | } |
265 | 265 | ||
266 | return &entity->links[entity->num_links++]; | 266 | return &entity->links[entity->num_links++]; |
267 | } | 267 | } |
268 | 268 | ||
269 | int | 269 | int |
270 | media_entity_create_link(struct media_entity *source, u16 source_pad, | 270 | media_entity_create_link(struct media_entity *source, u16 source_pad, |
271 | struct media_entity *sink, u16 sink_pad, u32 flags) | 271 | struct media_entity *sink, u16 sink_pad, u32 flags) |
272 | { | 272 | { |
273 | struct media_link *link; | 273 | struct media_link *link; |
274 | struct media_link *backlink; | 274 | struct media_link *backlink; |
275 | 275 | ||
276 | BUG_ON(source == NULL || sink == NULL); | 276 | BUG_ON(source == NULL || sink == NULL); |
277 | BUG_ON(source_pad >= source->num_pads); | 277 | BUG_ON(source_pad >= source->num_pads); |
278 | BUG_ON(sink_pad >= sink->num_pads); | 278 | BUG_ON(sink_pad >= sink->num_pads); |
279 | 279 | ||
280 | link = media_entity_add_link(source); | 280 | link = media_entity_add_link(source); |
281 | if (link == NULL) | 281 | if (link == NULL) |
282 | return -ENOMEM; | 282 | return -ENOMEM; |
283 | 283 | ||
284 | link->source = &source->pads[source_pad]; | 284 | link->source = &source->pads[source_pad]; |
285 | link->sink = &sink->pads[sink_pad]; | 285 | link->sink = &sink->pads[sink_pad]; |
286 | link->flags = flags; | 286 | link->flags = flags; |
287 | 287 | ||
288 | /* Create the backlink. Backlinks are used to help graph traversal and | 288 | /* Create the backlink. Backlinks are used to help graph traversal and |
289 | * are not reported to userspace. | 289 | * are not reported to userspace. |
290 | */ | 290 | */ |
291 | backlink = media_entity_add_link(sink); | 291 | backlink = media_entity_add_link(sink); |
292 | if (backlink == NULL) { | 292 | if (backlink == NULL) { |
293 | source->num_links--; | 293 | source->num_links--; |
294 | return -ENOMEM; | 294 | return -ENOMEM; |
295 | } | 295 | } |
296 | 296 | ||
297 | backlink->source = &source->pads[source_pad]; | 297 | backlink->source = &source->pads[source_pad]; |
298 | backlink->sink = &sink->pads[sink_pad]; | 298 | backlink->sink = &sink->pads[sink_pad]; |
299 | backlink->flags = flags; | 299 | backlink->flags = flags; |
300 | 300 | ||
301 | link->reverse = backlink; | 301 | link->reverse = backlink; |
302 | backlink->reverse = link; | 302 | backlink->reverse = link; |
303 | 303 | ||
304 | sink->num_backlinks++; | 304 | sink->num_backlinks++; |
305 | 305 | ||
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | EXPORT_SYMBOL_GPL(media_entity_create_link); | 308 | EXPORT_SYMBOL_GPL(media_entity_create_link); |
309 | |||
310 | static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) | ||
311 | { | ||
312 | const u32 mask = MEDIA_LNK_FL_ENABLED; | ||
313 | int ret; | ||
314 | |||
315 | /* Notify both entities. */ | ||
316 | ret = media_entity_call(link->source->entity, link_setup, | ||
317 | link->source, link->sink, flags); | ||
318 | if (ret < 0 && ret != -ENOIOCTLCMD) | ||
319 | return ret; | ||
320 | |||
321 | ret = media_entity_call(link->sink->entity, link_setup, | ||
322 | link->sink, link->source, flags); | ||
323 | if (ret < 0 && ret != -ENOIOCTLCMD) { | ||
324 | media_entity_call(link->source->entity, link_setup, | ||
325 | link->source, link->sink, link->flags); | ||
326 | return ret; | ||
327 | } | ||
328 | |||
329 | link->flags = (link->flags & ~mask) | (flags & mask); | ||
330 | link->reverse->flags = link->flags; | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * __media_entity_setup_link - Configure a media link | ||
337 | * @link: The link being configured | ||
338 | * @flags: Link configuration flags | ||
339 | * | ||
340 | * The bulk of link setup is handled by the two entities connected through the | ||
341 | * link. This function notifies both entities of the link configuration change. | ||
342 | * | ||
343 | * If the link is immutable or if the current and new configuration are | ||
344 | * identical, return immediately. | ||
345 | * | ||
346 | * The user is expected to hold link->source->parent->mutex. If not, | ||
347 | * media_entity_setup_link() should be used instead. | ||
348 | */ | ||
349 | int __media_entity_setup_link(struct media_link *link, u32 flags) | ||
350 | { | ||
351 | struct media_device *mdev; | ||
352 | struct media_entity *source, *sink; | ||
353 | int ret = -EBUSY; | ||
354 | |||
355 | if (link == NULL) | ||
356 | return -EINVAL; | ||
357 | |||
358 | if (link->flags & MEDIA_LNK_FL_IMMUTABLE) | ||
359 | return link->flags == flags ? 0 : -EINVAL; | ||
360 | |||
361 | if (link->flags == flags) | ||
362 | return 0; | ||
363 | |||
364 | source = link->source->entity; | ||
365 | sink = link->sink->entity; | ||
366 | |||
367 | mdev = source->parent; | ||
368 | |||
369 | if ((flags & MEDIA_LNK_FL_ENABLED) && mdev->link_notify) { | ||
370 | ret = mdev->link_notify(link->source, link->sink, | ||
371 | MEDIA_LNK_FL_ENABLED); | ||
372 | if (ret < 0) | ||
373 | return ret; | ||
374 | } | ||
375 | |||
376 | ret = __media_entity_setup_link_notify(link, flags); | ||
377 | if (ret < 0) | ||
378 | goto err; | ||
379 | |||
380 | if (!(flags & MEDIA_LNK_FL_ENABLED) && mdev->link_notify) | ||
381 | mdev->link_notify(link->source, link->sink, 0); | ||
382 | |||
383 | return 0; | ||
384 | |||
385 | err: | ||
386 | if ((flags & MEDIA_LNK_FL_ENABLED) && mdev->link_notify) | ||
387 | mdev->link_notify(link->source, link->sink, 0); | ||
388 | |||
389 | return ret; | ||
390 | } | ||
391 | |||
392 | int media_entity_setup_link(struct media_link *link, u32 flags) | ||
393 | { | ||
394 | int ret; | ||
395 | |||
396 | mutex_lock(&link->source->entity->parent->graph_mutex); | ||
397 | ret = __media_entity_setup_link(link, flags); | ||
398 | mutex_unlock(&link->source->entity->parent->graph_mutex); | ||
399 | |||
400 | return ret; | ||
401 | } | ||
402 | EXPORT_SYMBOL_GPL(media_entity_setup_link); | ||
403 | |||
404 | /** | ||
405 | * media_entity_find_link - Find a link between two pads | ||
406 | * @source: Source pad | ||
407 | * @sink: Sink pad | ||
408 | * | ||
409 | * Return a pointer to the link between the two entities. If no such link | ||
410 | * exists, return NULL. | ||
411 | */ | ||
412 | struct media_link * | ||
413 | media_entity_find_link(struct media_pad *source, struct media_pad *sink) | ||
414 | { | ||
415 | struct media_link *link; | ||
416 | unsigned int i; | ||
417 | |||
418 | for (i = 0; i < source->entity->num_links; ++i) { | ||
419 | link = &source->entity->links[i]; | ||
420 | |||
421 | if (link->source->entity == source->entity && | ||
422 | link->source->index == source->index && | ||
423 | link->sink->entity == sink->entity && | ||
424 | link->sink->index == sink->index) | ||
425 | return link; | ||
426 | } | ||
427 | |||
428 | return NULL; | ||
429 | } | ||
430 | EXPORT_SYMBOL_GPL(media_entity_find_link); | ||
431 | |||
432 | /** | ||
433 | * media_entity_remote_source - Find the source pad at the remote end of a link | ||
434 | * @pad: Sink pad at the local end of the link | ||
435 | * | ||
436 | * Search for a remote source pad connected to the given sink pad by iterating | ||
437 | * over all links originating or terminating at that pad until an enabled link | ||
438 | * is found. | ||
439 | * | ||
440 | * Return a pointer to the pad at the remote end of the first found enabled | ||
441 | * link, or NULL if no enabled link has been found. | ||
442 | */ | ||
443 | struct media_pad *media_entity_remote_source(struct media_pad *pad) | ||
444 | { | ||
445 | unsigned int i; | ||
446 | |||
447 | for (i = 0; i < pad->entity->num_links; i++) { | ||
448 | struct media_link *link = &pad->entity->links[i]; | ||
449 | |||
450 | if (!(link->flags & MEDIA_LNK_FL_ENABLED)) | ||
451 | continue; | ||
452 | |||
453 | if (link->source == pad) | ||
454 | return link->sink; | ||
455 | |||
456 | if (link->sink == pad) | ||
457 | return link->source; | ||
458 | } | ||
459 | |||
460 | return NULL; | ||
461 | |||
462 | } | ||
463 | EXPORT_SYMBOL_GPL(media_entity_remote_source); | ||
309 | 464 |
include/linux/media.h
1 | /* | 1 | /* |
2 | * Multimedia device API | 2 | * Multimedia device API |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
7 | * Sakari Ailus <sakari.ailus@iki.fi> | 7 | * Sakari Ailus <sakari.ailus@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef __LINUX_MEDIA_H | 23 | #ifndef __LINUX_MEDIA_H |
24 | #define __LINUX_MEDIA_H | 24 | #define __LINUX_MEDIA_H |
25 | 25 | ||
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/version.h> | 28 | #include <linux/version.h> |
29 | 29 | ||
30 | #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0) | 30 | #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0) |
31 | 31 | ||
32 | struct media_device_info { | 32 | struct media_device_info { |
33 | char driver[16]; | 33 | char driver[16]; |
34 | char model[32]; | 34 | char model[32]; |
35 | char serial[40]; | 35 | char serial[40]; |
36 | char bus_info[32]; | 36 | char bus_info[32]; |
37 | __u32 media_version; | 37 | __u32 media_version; |
38 | __u32 hw_revision; | 38 | __u32 hw_revision; |
39 | __u32 driver_version; | 39 | __u32 driver_version; |
40 | __u32 reserved[31]; | 40 | __u32 reserved[31]; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #define MEDIA_ENT_ID_FLAG_NEXT (1 << 31) | 43 | #define MEDIA_ENT_ID_FLAG_NEXT (1 << 31) |
44 | 44 | ||
45 | #define MEDIA_ENT_TYPE_SHIFT 16 | 45 | #define MEDIA_ENT_TYPE_SHIFT 16 |
46 | #define MEDIA_ENT_TYPE_MASK 0x00ff0000 | 46 | #define MEDIA_ENT_TYPE_MASK 0x00ff0000 |
47 | #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff | 47 | #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff |
48 | 48 | ||
49 | #define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT) | 49 | #define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT) |
50 | #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1) | 50 | #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1) |
51 | #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2) | 51 | #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2) |
52 | #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3) | 52 | #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3) |
53 | #define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4) | 53 | #define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4) |
54 | 54 | ||
55 | #define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT) | 55 | #define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT) |
56 | #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1) | 56 | #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1) |
57 | #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2) | 57 | #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2) |
58 | #define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3) | 58 | #define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3) |
59 | 59 | ||
60 | #define MEDIA_ENT_FL_DEFAULT (1 << 0) | 60 | #define MEDIA_ENT_FL_DEFAULT (1 << 0) |
61 | 61 | ||
62 | struct media_entity_desc { | 62 | struct media_entity_desc { |
63 | __u32 id; | 63 | __u32 id; |
64 | char name[32]; | 64 | char name[32]; |
65 | __u32 type; | 65 | __u32 type; |
66 | __u32 revision; | 66 | __u32 revision; |
67 | __u32 flags; | 67 | __u32 flags; |
68 | __u32 group_id; | 68 | __u32 group_id; |
69 | __u16 pads; | 69 | __u16 pads; |
70 | __u16 links; | 70 | __u16 links; |
71 | 71 | ||
72 | __u32 reserved[4]; | 72 | __u32 reserved[4]; |
73 | 73 | ||
74 | union { | 74 | union { |
75 | /* Node specifications */ | 75 | /* Node specifications */ |
76 | struct { | 76 | struct { |
77 | __u32 major; | 77 | __u32 major; |
78 | __u32 minor; | 78 | __u32 minor; |
79 | } v4l; | 79 | } v4l; |
80 | struct { | 80 | struct { |
81 | __u32 major; | 81 | __u32 major; |
82 | __u32 minor; | 82 | __u32 minor; |
83 | } fb; | 83 | } fb; |
84 | struct { | 84 | struct { |
85 | __u32 card; | 85 | __u32 card; |
86 | __u32 device; | 86 | __u32 device; |
87 | __u32 subdevice; | 87 | __u32 subdevice; |
88 | } alsa; | 88 | } alsa; |
89 | int dvb; | 89 | int dvb; |
90 | 90 | ||
91 | /* Sub-device specifications */ | 91 | /* Sub-device specifications */ |
92 | /* Nothing needed yet */ | 92 | /* Nothing needed yet */ |
93 | __u8 raw[184]; | 93 | __u8 raw[184]; |
94 | }; | 94 | }; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | #define MEDIA_PAD_FL_SINK (1 << 0) | 97 | #define MEDIA_PAD_FL_SINK (1 << 0) |
98 | #define MEDIA_PAD_FL_SOURCE (1 << 1) | 98 | #define MEDIA_PAD_FL_SOURCE (1 << 1) |
99 | 99 | ||
100 | struct media_pad_desc { | 100 | struct media_pad_desc { |
101 | __u32 entity; /* entity ID */ | 101 | __u32 entity; /* entity ID */ |
102 | __u16 index; /* pad index */ | 102 | __u16 index; /* pad index */ |
103 | __u32 flags; /* pad flags */ | 103 | __u32 flags; /* pad flags */ |
104 | __u32 reserved[2]; | 104 | __u32 reserved[2]; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | #define MEDIA_LNK_FL_ENABLED (1 << 0) | 107 | #define MEDIA_LNK_FL_ENABLED (1 << 0) |
108 | #define MEDIA_LNK_FL_IMMUTABLE (1 << 1) | 108 | #define MEDIA_LNK_FL_IMMUTABLE (1 << 1) |
109 | 109 | ||
110 | struct media_link_desc { | 110 | struct media_link_desc { |
111 | struct media_pad_desc source; | 111 | struct media_pad_desc source; |
112 | struct media_pad_desc sink; | 112 | struct media_pad_desc sink; |
113 | __u32 flags; | 113 | __u32 flags; |
114 | __u32 reserved[2]; | 114 | __u32 reserved[2]; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | struct media_links_enum { | 117 | struct media_links_enum { |
118 | __u32 entity; | 118 | __u32 entity; |
119 | /* Should have enough room for pads elements */ | 119 | /* Should have enough room for pads elements */ |
120 | struct media_pad_desc __user *pads; | 120 | struct media_pad_desc __user *pads; |
121 | /* Should have enough room for links elements */ | 121 | /* Should have enough room for links elements */ |
122 | struct media_link_desc __user *links; | 122 | struct media_link_desc __user *links; |
123 | __u32 reserved[4]; | 123 | __u32 reserved[4]; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #define MEDIA_IOC_DEVICE_INFO _IOWR('M', 1, struct media_device_info) | 126 | #define MEDIA_IOC_DEVICE_INFO _IOWR('M', 1, struct media_device_info) |
127 | #define MEDIA_IOC_ENUM_ENTITIES _IOWR('M', 2, struct media_entity_desc) | 127 | #define MEDIA_IOC_ENUM_ENTITIES _IOWR('M', 2, struct media_entity_desc) |
128 | #define MEDIA_IOC_ENUM_LINKS _IOWR('M', 3, struct media_links_enum) | 128 | #define MEDIA_IOC_ENUM_LINKS _IOWR('M', 3, struct media_links_enum) |
129 | #define MEDIA_IOC_SETUP_LINK _IOWR('M', 4, struct media_link_desc) | ||
129 | 130 | ||
130 | #endif /* __LINUX_MEDIA_H */ | 131 | #endif /* __LINUX_MEDIA_H */ |
131 | 132 |
include/media/media-device.h
1 | /* | 1 | /* |
2 | * Media device | 2 | * Media device |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
7 | * Sakari Ailus <sakari.ailus@iki.fi> | 7 | * Sakari Ailus <sakari.ailus@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef _MEDIA_DEVICE_H | 23 | #ifndef _MEDIA_DEVICE_H |
24 | #define _MEDIA_DEVICE_H | 24 | #define _MEDIA_DEVICE_H |
25 | 25 | ||
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | 30 | ||
31 | #include <media/media-devnode.h> | 31 | #include <media/media-devnode.h> |
32 | #include <media/media-entity.h> | 32 | #include <media/media-entity.h> |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * struct media_device - Media device | 35 | * struct media_device - Media device |
36 | * @dev: Parent device | 36 | * @dev: Parent device |
37 | * @devnode: Media device node | 37 | * @devnode: Media device node |
38 | * @model: Device model name | 38 | * @model: Device model name |
39 | * @serial: Device serial number (optional) | 39 | * @serial: Device serial number (optional) |
40 | * @bus_info: Unique and stable device location identifier | 40 | * @bus_info: Unique and stable device location identifier |
41 | * @hw_revision: Hardware device revision | 41 | * @hw_revision: Hardware device revision |
42 | * @driver_version: Device driver version | 42 | * @driver_version: Device driver version |
43 | * @entity_id: ID of the next entity to be registered | 43 | * @entity_id: ID of the next entity to be registered |
44 | * @entities: List of registered entities | 44 | * @entities: List of registered entities |
45 | * @lock: Entities list lock | 45 | * @lock: Entities list lock |
46 | * @graph_mutex: Entities graph operation lock | 46 | * @graph_mutex: Entities graph operation lock |
47 | * | 47 | * |
48 | * This structure represents an abstract high-level media device. It allows easy | 48 | * This structure represents an abstract high-level media device. It allows easy |
49 | * access to entities and provides basic media device-level support. The | 49 | * access to entities and provides basic media device-level support. The |
50 | * structure can be allocated directly or embedded in a larger structure. | 50 | * structure can be allocated directly or embedded in a larger structure. |
51 | * | 51 | * |
52 | * The parent @dev is a physical device. It must be set before registering the | 52 | * The parent @dev is a physical device. It must be set before registering the |
53 | * media device. | 53 | * media device. |
54 | * | 54 | * |
55 | * @model is a descriptive model name exported through sysfs. It doesn't have to | 55 | * @model is a descriptive model name exported through sysfs. It doesn't have to |
56 | * be unique. | 56 | * be unique. |
57 | */ | 57 | */ |
58 | struct media_device { | 58 | struct media_device { |
59 | /* dev->driver_data points to this struct. */ | 59 | /* dev->driver_data points to this struct. */ |
60 | struct device *dev; | 60 | struct device *dev; |
61 | struct media_devnode devnode; | 61 | struct media_devnode devnode; |
62 | 62 | ||
63 | char model[32]; | 63 | char model[32]; |
64 | char serial[40]; | 64 | char serial[40]; |
65 | char bus_info[32]; | 65 | char bus_info[32]; |
66 | u32 hw_revision; | 66 | u32 hw_revision; |
67 | u32 driver_version; | 67 | u32 driver_version; |
68 | 68 | ||
69 | u32 entity_id; | 69 | u32 entity_id; |
70 | struct list_head entities; | 70 | struct list_head entities; |
71 | 71 | ||
72 | /* Protects the entities list */ | 72 | /* Protects the entities list */ |
73 | spinlock_t lock; | 73 | spinlock_t lock; |
74 | /* Serializes graph operations. */ | 74 | /* Serializes graph operations. */ |
75 | struct mutex graph_mutex; | 75 | struct mutex graph_mutex; |
76 | |||
77 | int (*link_notify)(struct media_pad *source, | ||
78 | struct media_pad *sink, u32 flags); | ||
76 | }; | 79 | }; |
77 | 80 | ||
78 | /* media_devnode to media_device */ | 81 | /* media_devnode to media_device */ |
79 | #define to_media_device(node) container_of(node, struct media_device, devnode) | 82 | #define to_media_device(node) container_of(node, struct media_device, devnode) |
80 | 83 | ||
81 | int __must_check media_device_register(struct media_device *mdev); | 84 | int __must_check media_device_register(struct media_device *mdev); |
82 | void media_device_unregister(struct media_device *mdev); | 85 | void media_device_unregister(struct media_device *mdev); |
83 | 86 | ||
84 | int __must_check media_device_register_entity(struct media_device *mdev, | 87 | int __must_check media_device_register_entity(struct media_device *mdev, |
85 | struct media_entity *entity); | 88 | struct media_entity *entity); |
86 | void media_device_unregister_entity(struct media_entity *entity); | 89 | void media_device_unregister_entity(struct media_entity *entity); |
87 | 90 | ||
88 | /* Iterate over all entities. */ | 91 | /* Iterate over all entities. */ |
89 | #define media_device_for_each_entity(entity, mdev) \ | 92 | #define media_device_for_each_entity(entity, mdev) \ |
90 | list_for_each_entry(entity, &(mdev)->entities, list) | 93 | list_for_each_entry(entity, &(mdev)->entities, list) |
91 | 94 | ||
92 | #endif | 95 | #endif |
93 | 96 |
include/media/media-entity.h
1 | /* | 1 | /* |
2 | * Media entity | 2 | * Media entity |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
7 | * Sakari Ailus <sakari.ailus@iki.fi> | 7 | * Sakari Ailus <sakari.ailus@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef _MEDIA_ENTITY_H | 23 | #ifndef _MEDIA_ENTITY_H |
24 | #define _MEDIA_ENTITY_H | 24 | #define _MEDIA_ENTITY_H |
25 | 25 | ||
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/media.h> | 27 | #include <linux/media.h> |
28 | 28 | ||
29 | struct media_link { | 29 | struct media_link { |
30 | struct media_pad *source; /* Source pad */ | 30 | struct media_pad *source; /* Source pad */ |
31 | struct media_pad *sink; /* Sink pad */ | 31 | struct media_pad *sink; /* Sink pad */ |
32 | struct media_link *reverse; /* Link in the reverse direction */ | 32 | struct media_link *reverse; /* Link in the reverse direction */ |
33 | unsigned long flags; /* Link flags (MEDIA_LNK_FL_*) */ | 33 | unsigned long flags; /* Link flags (MEDIA_LNK_FL_*) */ |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct media_pad { | 36 | struct media_pad { |
37 | struct media_entity *entity; /* Entity this pad belongs to */ | 37 | struct media_entity *entity; /* Entity this pad belongs to */ |
38 | u16 index; /* Pad index in the entity pads array */ | 38 | u16 index; /* Pad index in the entity pads array */ |
39 | unsigned long flags; /* Pad flags (MEDIA_PAD_FL_*) */ | 39 | unsigned long flags; /* Pad flags (MEDIA_PAD_FL_*) */ |
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct media_entity_operations { | ||
43 | int (*link_setup)(struct media_entity *entity, | ||
44 | const struct media_pad *local, | ||
45 | const struct media_pad *remote, u32 flags); | ||
46 | }; | ||
47 | |||
42 | struct media_entity { | 48 | struct media_entity { |
43 | struct list_head list; | 49 | struct list_head list; |
44 | struct media_device *parent; /* Media device this entity belongs to*/ | 50 | struct media_device *parent; /* Media device this entity belongs to*/ |
45 | u32 id; /* Entity ID, unique in the parent media | 51 | u32 id; /* Entity ID, unique in the parent media |
46 | * device context */ | 52 | * device context */ |
47 | const char *name; /* Entity name */ | 53 | const char *name; /* Entity name */ |
48 | u32 type; /* Entity type (MEDIA_ENT_T_*) */ | 54 | u32 type; /* Entity type (MEDIA_ENT_T_*) */ |
49 | u32 revision; /* Entity revision, driver specific */ | 55 | u32 revision; /* Entity revision, driver specific */ |
50 | unsigned long flags; /* Entity flags (MEDIA_ENT_FL_*) */ | 56 | unsigned long flags; /* Entity flags (MEDIA_ENT_FL_*) */ |
51 | u32 group_id; /* Entity group ID */ | 57 | u32 group_id; /* Entity group ID */ |
52 | 58 | ||
53 | u16 num_pads; /* Number of sink and source pads */ | 59 | u16 num_pads; /* Number of sink and source pads */ |
54 | u16 num_links; /* Number of existing links, both | 60 | u16 num_links; /* Number of existing links, both |
55 | * enabled and disabled */ | 61 | * enabled and disabled */ |
56 | u16 num_backlinks; /* Number of backlinks */ | 62 | u16 num_backlinks; /* Number of backlinks */ |
57 | u16 max_links; /* Maximum number of links */ | 63 | u16 max_links; /* Maximum number of links */ |
58 | 64 | ||
59 | struct media_pad *pads; /* Pads array (num_pads elements) */ | 65 | struct media_pad *pads; /* Pads array (num_pads elements) */ |
60 | struct media_link *links; /* Links array (max_links elements)*/ | 66 | struct media_link *links; /* Links array (max_links elements)*/ |
61 | 67 | ||
68 | const struct media_entity_operations *ops; /* Entity operations */ | ||
69 | |||
62 | /* Reference counts must never be negative, but are signed integers on | 70 | /* Reference counts must never be negative, but are signed integers on |
63 | * purpose: a simple WARN_ON(<0) check can be used to detect reference | 71 | * purpose: a simple WARN_ON(<0) check can be used to detect reference |
64 | * count bugs that would make them negative. | 72 | * count bugs that would make them negative. |
65 | */ | 73 | */ |
66 | int use_count; /* Use count for the entity. */ | 74 | int use_count; /* Use count for the entity. */ |
67 | 75 | ||
68 | union { | 76 | union { |
69 | /* Node specifications */ | 77 | /* Node specifications */ |
70 | struct { | 78 | struct { |
71 | u32 major; | 79 | u32 major; |
72 | u32 minor; | 80 | u32 minor; |
73 | } v4l; | 81 | } v4l; |
74 | struct { | 82 | struct { |
75 | u32 major; | 83 | u32 major; |
76 | u32 minor; | 84 | u32 minor; |
77 | } fb; | 85 | } fb; |
78 | struct { | 86 | struct { |
79 | u32 card; | 87 | u32 card; |
80 | u32 device; | 88 | u32 device; |
81 | u32 subdevice; | 89 | u32 subdevice; |
82 | } alsa; | 90 | } alsa; |
83 | int dvb; | 91 | int dvb; |
84 | 92 | ||
85 | /* Sub-device specifications */ | 93 | /* Sub-device specifications */ |
86 | /* Nothing needed yet */ | 94 | /* Nothing needed yet */ |
87 | }; | 95 | }; |
88 | }; | 96 | }; |
89 | 97 | ||
90 | static inline u32 media_entity_type(struct media_entity *entity) | 98 | static inline u32 media_entity_type(struct media_entity *entity) |
91 | { | 99 | { |
92 | return entity->type & MEDIA_ENT_TYPE_MASK; | 100 | return entity->type & MEDIA_ENT_TYPE_MASK; |
93 | } | 101 | } |
94 | 102 | ||
95 | static inline u32 media_entity_subtype(struct media_entity *entity) | 103 | static inline u32 media_entity_subtype(struct media_entity *entity) |
96 | { | 104 | { |
97 | return entity->type & MEDIA_ENT_SUBTYPE_MASK; | 105 | return entity->type & MEDIA_ENT_SUBTYPE_MASK; |
98 | } | 106 | } |
99 | 107 | ||
100 | #define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 | 108 | #define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 |
101 | 109 | ||
102 | struct media_entity_graph { | 110 | struct media_entity_graph { |
103 | struct { | 111 | struct { |
104 | struct media_entity *entity; | 112 | struct media_entity *entity; |
105 | int link; | 113 | int link; |
106 | } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH]; | 114 | } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH]; |
107 | int top; | 115 | int top; |
108 | }; | 116 | }; |
109 | 117 | ||
110 | int media_entity_init(struct media_entity *entity, u16 num_pads, | 118 | int media_entity_init(struct media_entity *entity, u16 num_pads, |
111 | struct media_pad *pads, u16 extra_links); | 119 | struct media_pad *pads, u16 extra_links); |
112 | void media_entity_cleanup(struct media_entity *entity); | 120 | void media_entity_cleanup(struct media_entity *entity); |
113 | int media_entity_create_link(struct media_entity *source, u16 source_pad, | 121 | int media_entity_create_link(struct media_entity *source, u16 source_pad, |
114 | struct media_entity *sink, u16 sink_pad, u32 flags); | 122 | struct media_entity *sink, u16 sink_pad, u32 flags); |
123 | int __media_entity_setup_link(struct media_link *link, u32 flags); | ||
124 | int media_entity_setup_link(struct media_link *link, u32 flags); | ||
125 | struct media_link *media_entity_find_link(struct media_pad *source, | ||
126 | struct media_pad *sink); | ||
127 | struct media_pad *media_entity_remote_source(struct media_pad *pad); | ||
115 | 128 | ||
116 | struct media_entity *media_entity_get(struct media_entity *entity); | 129 | struct media_entity *media_entity_get(struct media_entity *entity); |
117 | void media_entity_put(struct media_entity *entity); | 130 | void media_entity_put(struct media_entity *entity); |
118 | 131 | ||
119 | void media_entity_graph_walk_start(struct media_entity_graph *graph, | 132 | void media_entity_graph_walk_start(struct media_entity_graph *graph, |
120 | struct media_entity *entity); | 133 | struct media_entity *entity); |
121 | struct media_entity * | 134 | struct media_entity * |
122 | media_entity_graph_walk_next(struct media_entity_graph *graph); | 135 | media_entity_graph_walk_next(struct media_entity_graph *graph); |
136 | |||
137 | #define media_entity_call(entity, operation, args...) \ | ||
138 | (((entity)->ops && (entity)->ops->operation) ? \ | ||
139 | (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD) | ||
123 | 140 | ||
124 | #endif | 141 | #endif |
125 | 142 |