aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/device-drivers.tmpl58
-rw-r--r--Documentation/DocBook/media/v4l/fdl-appendix.xml2
-rw-r--r--Documentation/DocBook/media/v4l/lirc_device_interface.xml2
-rw-r--r--Documentation/Makefile.sphinx3
-rw-r--r--Documentation/conf.py13
-rw-r--r--Documentation/dvb/README.dvb-usb232
-rw-r--r--Documentation/dvb/avermedia.txt301
-rw-r--r--Documentation/dvb/bt8xx.txt98
-rw-r--r--Documentation/dvb/contributors.txt96
-rw-r--r--Documentation/dvb/readme.txt62
-rw-r--r--Documentation/dvb/technisat.txt78
-rw-r--r--Documentation/dvb/ttusb-dec.txt45
-rw-r--r--Documentation/index.rst4
-rw-r--r--Documentation/media/Makefile60
-rw-r--r--Documentation/media/audio.h.rst.exceptions20
-rw-r--r--Documentation/media/ca.h.rst.exceptions24
-rw-r--r--Documentation/media/cec.h.rst.exceptions492
-rw-r--r--Documentation/media/dmx.h.rst.exceptions63
-rw-r--r--Documentation/media/dvb-drivers/avermedia.rst267
-rw-r--r--Documentation/media/dvb-drivers/bt8xx.rst122
-rw-r--r--Documentation/media/dvb-drivers/cards.rst (renamed from Documentation/dvb/cards.txt)71
-rw-r--r--Documentation/media/dvb-drivers/ci.rst (renamed from Documentation/dvb/ci.txt)186
-rw-r--r--Documentation/media/dvb-drivers/contributors.rst129
-rw-r--r--Documentation/media/dvb-drivers/dvb-usb.rst355
-rw-r--r--Documentation/media/dvb-drivers/faq.rst (renamed from Documentation/dvb/faq.txt)18
-rw-r--r--Documentation/media/dvb-drivers/index.rst42
-rw-r--r--Documentation/media/dvb-drivers/intro.rst21
-rw-r--r--Documentation/media/dvb-drivers/lmedm04.rst (renamed from Documentation/dvb/lmedm04.txt)72
-rw-r--r--Documentation/media/dvb-drivers/opera-firmware.rst (renamed from Documentation/dvb/opera-firmware.txt)14
-rw-r--r--Documentation/media/dvb-drivers/technisat.rst98
-rw-r--r--Documentation/media/dvb-drivers/ttusb-dec.rst43
-rw-r--r--Documentation/media/dvb-drivers/udev.rst (renamed from Documentation/dvb/udev.txt)31
-rw-r--r--Documentation/media/frontend.h.rst.exceptions47
-rw-r--r--Documentation/media/intro.rst46
-rw-r--r--Documentation/media/kapi/dtv-core.rst132
-rw-r--r--Documentation/media/kapi/mc-core.rst263
-rw-r--r--Documentation/media/kapi/rc-core.rst14
-rw-r--r--Documentation/media/kapi/v4l2-clocks.rst29
-rw-r--r--Documentation/media/kapi/v4l2-common.rst6
-rw-r--r--Documentation/media/kapi/v4l2-controls.rst (renamed from Documentation/video4linux/v4l2-controls.txt)162
-rw-r--r--Documentation/media/kapi/v4l2-core.rst26
-rw-r--r--Documentation/media/kapi/v4l2-dev.rst363
-rw-r--r--Documentation/media/kapi/v4l2-device.rst144
-rw-r--r--Documentation/media/kapi/v4l2-dv-timings.rst4
-rw-r--r--Documentation/media/kapi/v4l2-event.rst137
-rw-r--r--Documentation/media/kapi/v4l2-fh.rst139
-rw-r--r--Documentation/media/kapi/v4l2-flash-led-class.rst4
-rw-r--r--Documentation/media/kapi/v4l2-intro.rst74
-rw-r--r--Documentation/media/kapi/v4l2-mc.rst4
-rw-r--r--Documentation/media/kapi/v4l2-mediabus.rst4
-rw-r--r--Documentation/media/kapi/v4l2-mem2mem.rst4
-rw-r--r--Documentation/media/kapi/v4l2-of.rst3
-rw-r--r--Documentation/media/kapi/v4l2-rect.rst4
-rw-r--r--Documentation/media/kapi/v4l2-subdev.rst445
-rw-r--r--Documentation/media/kapi/v4l2-tuner.rst6
-rw-r--r--Documentation/media/kapi/v4l2-tveeprom.rst4
-rw-r--r--Documentation/media/kapi/v4l2-videobuf.rst (renamed from Documentation/video4linux/videobuf)53
-rw-r--r--Documentation/media/kapi/v4l2-videobuf2.rst10
-rw-r--r--Documentation/media/lirc.h.rst.exceptions43
-rw-r--r--Documentation/media/media.h.rst.exceptions30
-rw-r--r--Documentation/media/media_api_files/typical_media_device.pdfbin0 -> 134268 bytes
-rw-r--r--Documentation/media/media_api_files/typical_media_device.svg28
-rw-r--r--Documentation/media/media_kapi.rst34
-rw-r--r--Documentation/media/media_uapi.rst31
-rw-r--r--Documentation/media/net.h.rst.exceptions11
-rw-r--r--Documentation/media/uapi/cec/cec-api.rst43
-rw-r--r--Documentation/media/uapi/cec/cec-func-close.rst49
-rw-r--r--Documentation/media/uapi/cec/cec-func-ioctl.rst68
-rw-r--r--Documentation/media/uapi/cec/cec-func-open.rst80
-rw-r--r--Documentation/media/uapi/cec/cec-func-poll.rst70
-rw-r--r--Documentation/media/uapi/cec/cec-funcs.rst21
-rw-r--r--Documentation/media/uapi/cec/cec-header.rst10
-rw-r--r--Documentation/media/uapi/cec/cec-intro.rst31
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst165
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst436
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst82
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-dqevent.rst231
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-g-mode.rst295
-rw-r--r--Documentation/media/uapi/cec/cec-ioc-receive.rst360
-rw-r--r--Documentation/media/uapi/dvb/audio-bilingual-channel-select.rst64
-rw-r--r--Documentation/media/uapi/dvb/audio-channel-select.rst63
-rw-r--r--Documentation/media/uapi/dvb/audio-clear-buffer.rst54
-rw-r--r--Documentation/media/uapi/dvb/audio-continue.rst54
-rw-r--r--Documentation/media/uapi/dvb/audio-fclose.rst54
-rw-r--r--Documentation/media/uapi/dvb/audio-fopen.rst104
-rw-r--r--Documentation/media/uapi/dvb/audio-fwrite.rst82
-rw-r--r--Documentation/media/uapi/dvb/audio-get-capabilities.rst60
-rw-r--r--Documentation/media/uapi/dvb/audio-get-pts.rst69
-rw-r--r--Documentation/media/uapi/dvb/audio-get-status.rst60
-rw-r--r--Documentation/media/uapi/dvb/audio-pause.rst55
-rw-r--r--Documentation/media/uapi/dvb/audio-play.rst54
-rw-r--r--Documentation/media/uapi/dvb/audio-select-source.rst62
-rw-r--r--Documentation/media/uapi/dvb/audio-set-attributes.rst71
-rw-r--r--Documentation/media/uapi/dvb/audio-set-av-sync.rst70
-rw-r--r--Documentation/media/uapi/dvb/audio-set-bypass-mode.rst74
-rw-r--r--Documentation/media/uapi/dvb/audio-set-ext-id.rst71
-rw-r--r--Documentation/media/uapi/dvb/audio-set-id.rst65
-rw-r--r--Documentation/media/uapi/dvb/audio-set-karaoke.rst70
-rw-r--r--Documentation/media/uapi/dvb/audio-set-mixer.rst59
-rw-r--r--Documentation/media/uapi/dvb/audio-set-mute.rst74
-rw-r--r--Documentation/media/uapi/dvb/audio-set-streamtype.rst74
-rw-r--r--Documentation/media/uapi/dvb/audio-stop.rst54
-rw-r--r--Documentation/media/uapi/dvb/audio.rst26
-rw-r--r--Documentation/media/uapi/dvb/audio_data_types.rst176
-rw-r--r--Documentation/media/uapi/dvb/audio_function_calls.rst34
-rw-r--r--Documentation/media/uapi/dvb/audio_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/ca-fclose.rst54
-rw-r--r--Documentation/media/uapi/dvb/ca-fopen.rst109
-rw-r--r--Documentation/media/uapi/dvb/ca-get-cap.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-get-descr-info.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-get-msg.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-get-slot-info.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-reset.rst53
-rw-r--r--Documentation/media/uapi/dvb/ca-send-msg.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-set-descr.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca-set-pid.rst59
-rw-r--r--Documentation/media/uapi/dvb/ca.rst18
-rw-r--r--Documentation/media/uapi/dvb/ca_data_types.rst110
-rw-r--r--Documentation/media/uapi/dvb/ca_function_calls.rst21
-rw-r--r--Documentation/media/uapi/dvb/ca_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/demux.rst18
-rw-r--r--Documentation/media/uapi/dvb/dmx-add-pid.rst61
-rw-r--r--Documentation/media/uapi/dvb/dmx-fclose.rst55
-rw-r--r--Documentation/media/uapi/dvb/dmx-fopen.rst108
-rw-r--r--Documentation/media/uapi/dvb/dmx-fread.rst108
-rw-r--r--Documentation/media/uapi/dvb/dmx-fwrite.rst89
-rw-r--r--Documentation/media/uapi/dvb/dmx-get-caps.rst59
-rw-r--r--Documentation/media/uapi/dvb/dmx-get-event.rst76
-rw-r--r--Documentation/media/uapi/dvb/dmx-get-pes-pids.rst59
-rw-r--r--Documentation/media/uapi/dvb/dmx-get-stc.rst77
-rw-r--r--Documentation/media/uapi/dvb/dmx-remove-pid.rst62
-rw-r--r--Documentation/media/uapi/dvb/dmx-set-buffer-size.rst62
-rw-r--r--Documentation/media/uapi/dvb/dmx-set-filter.rst68
-rw-r--r--Documentation/media/uapi/dvb/dmx-set-pes-filter.rst78
-rw-r--r--Documentation/media/uapi/dvb/dmx-set-source.rst59
-rw-r--r--Documentation/media/uapi/dvb/dmx-start.rst77
-rw-r--r--Documentation/media/uapi/dvb/dmx-stop.rst55
-rw-r--r--Documentation/media/uapi/dvb/dmx_fcalls.rst27
-rw-r--r--Documentation/media/uapi/dvb/dmx_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/dmx_types.rst242
-rw-r--r--Documentation/media/uapi/dvb/dtv-fe-stats.rst17
-rw-r--r--Documentation/media/uapi/dvb/dtv-properties.rst15
-rw-r--r--Documentation/media/uapi/dvb/dtv-property.rst31
-rw-r--r--Documentation/media/uapi/dvb/dtv-stats.rst18
-rw-r--r--Documentation/media/uapi/dvb/dvb-fe-read-status.rst23
-rw-r--r--Documentation/media/uapi/dvb/dvb-frontend-event.rst15
-rw-r--r--Documentation/media/uapi/dvb/dvb-frontend-parameters.rst119
-rw-r--r--Documentation/media/uapi/dvb/dvbapi.rst102
-rw-r--r--Documentation/media/uapi/dvb/dvbproperty-006.rst12
-rw-r--r--Documentation/media/uapi/dvb/dvbproperty.rst116
-rw-r--r--Documentation/media/uapi/dvb/examples.rst380
-rw-r--r--Documentation/media/uapi/dvb/fe-bandwidth-t.rst77
-rw-r--r--Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst83
-rw-r--r--Documentation/media/uapi/dvb/fe-diseqc-reset-overload.rst45
-rw-r--r--Documentation/media/uapi/dvb/fe-diseqc-send-burst.rst84
-rw-r--r--Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst73
-rw-r--r--Documentation/media/uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst55
-rw-r--r--Documentation/media/uapi/dvb/fe-enable-high-lnb-voltage.rst52
-rw-r--r--Documentation/media/uapi/dvb/fe-get-event.rst87
-rw-r--r--Documentation/media/uapi/dvb/fe-get-frontend.rst74
-rw-r--r--Documentation/media/uapi/dvb/fe-get-info.rst428
-rw-r--r--Documentation/media/uapi/dvb/fe-get-property.rst68
-rw-r--r--Documentation/media/uapi/dvb/fe-read-ber.rst60
-rw-r--r--Documentation/media/uapi/dvb/fe-read-signal-strength.rst63
-rw-r--r--Documentation/media/uapi/dvb/fe-read-snr.rst61
-rw-r--r--Documentation/media/uapi/dvb/fe-read-status.rst135
-rw-r--r--Documentation/media/uapi/dvb/fe-read-uncorrected-blocks.rst65
-rw-r--r--Documentation/media/uapi/dvb/fe-set-frontend-tune-mode.rst55
-rw-r--r--Documentation/media/uapi/dvb/fe-set-frontend.rst79
-rw-r--r--Documentation/media/uapi/dvb/fe-set-tone.rst91
-rw-r--r--Documentation/media/uapi/dvb/fe-set-voltage.rst63
-rw-r--r--Documentation/media/uapi/dvb/fe-type-t.rst91
-rw-r--r--Documentation/media/uapi/dvb/fe_property_parameters.rst1979
-rw-r--r--Documentation/media/uapi/dvb/frontend-property-cable-systems.rst75
-rw-r--r--Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst103
-rw-r--r--Documentation/media/uapi/dvb/frontend-property-terrestrial-systems.rst294
-rw-r--r--Documentation/media/uapi/dvb/frontend-stat-properties.rst245
-rw-r--r--Documentation/media/uapi/dvb/frontend.rst51
-rw-r--r--Documentation/media/uapi/dvb/frontend_f_close.rst48
-rw-r--r--Documentation/media/uapi/dvb/frontend_f_open.rst102
-rw-r--r--Documentation/media/uapi/dvb/frontend_fcalls.rst24
-rw-r--r--Documentation/media/uapi/dvb/frontend_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/frontend_legacy_api.rst38
-rw-r--r--Documentation/media/uapi/dvb/frontend_legacy_dvbv3_api.rst18
-rw-r--r--Documentation/media/uapi/dvb/intro.rst172
-rw-r--r--Documentation/media/uapi/dvb/intro_files/dvbstb.pdfbin0 -> 1881 bytes
-rw-r--r--Documentation/media/uapi/dvb/intro_files/dvbstb.pngbin0 -> 22655 bytes
-rw-r--r--Documentation/media/uapi/dvb/legacy_dvb_apis.rst20
-rw-r--r--Documentation/media/uapi/dvb/net-add-if.rst91
-rw-r--r--Documentation/media/uapi/dvb/net-get-if.rst50
-rw-r--r--Documentation/media/uapi/dvb/net-remove-if.rst46
-rw-r--r--Documentation/media/uapi/dvb/net.rst40
-rw-r--r--Documentation/media/uapi/dvb/net_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/query-dvb-frontend-info.rst13
-rw-r--r--Documentation/media/uapi/dvb/video-clear-buffer.rst54
-rw-r--r--Documentation/media/uapi/dvb/video-command.rst66
-rw-r--r--Documentation/media/uapi/dvb/video-continue.rst57
-rw-r--r--Documentation/media/uapi/dvb/video-fast-forward.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-fclose.rst54
-rw-r--r--Documentation/media/uapi/dvb/video-fopen.rst112
-rw-r--r--Documentation/media/uapi/dvb/video-freeze.rst61
-rw-r--r--Documentation/media/uapi/dvb/video-fwrite.rst82
-rw-r--r--Documentation/media/uapi/dvb/video-get-capabilities.rst61
-rw-r--r--Documentation/media/uapi/dvb/video-get-event.rst88
-rw-r--r--Documentation/media/uapi/dvb/video-get-frame-count.rst65
-rw-r--r--Documentation/media/uapi/dvb/video-get-frame-rate.rst59
-rw-r--r--Documentation/media/uapi/dvb/video-get-navi.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-get-pts.rst69
-rw-r--r--Documentation/media/uapi/dvb/video-get-size.rst59
-rw-r--r--Documentation/media/uapi/dvb/video-get-status.rst60
-rw-r--r--Documentation/media/uapi/dvb/video-play.rst57
-rw-r--r--Documentation/media/uapi/dvb/video-select-source.rst65
-rw-r--r--Documentation/media/uapi/dvb/video-set-attributes.rst75
-rw-r--r--Documentation/media/uapi/dvb/video-set-blank.rst64
-rw-r--r--Documentation/media/uapi/dvb/video-set-display-format.rst60
-rw-r--r--Documentation/media/uapi/dvb/video-set-format.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-set-highlight.rst60
-rw-r--r--Documentation/media/uapi/dvb/video-set-id.rst73
-rw-r--r--Documentation/media/uapi/dvb/video-set-spu-palette.rst72
-rw-r--r--Documentation/media/uapi/dvb/video-set-spu.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-set-streamtype.rst61
-rw-r--r--Documentation/media/uapi/dvb/video-set-system.rst75
-rw-r--r--Documentation/media/uapi/dvb/video-slowmotion.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-stillpicture.rst61
-rw-r--r--Documentation/media/uapi/dvb/video-stop.rst74
-rw-r--r--Documentation/media/uapi/dvb/video-try-command.rst66
-rw-r--r--Documentation/media/uapi/dvb/video.rst35
-rw-r--r--Documentation/media/uapi/dvb/video_function_calls.rst43
-rw-r--r--Documentation/media/uapi/dvb/video_h.rst9
-rw-r--r--Documentation/media/uapi/dvb/video_types.rst379
-rw-r--r--Documentation/media/uapi/fdl-appendix.rst471
-rw-r--r--Documentation/media/uapi/gen-errors.rst103
-rw-r--r--Documentation/media/uapi/mediactl/media-controller-intro.rst33
-rw-r--r--Documentation/media/uapi/mediactl/media-controller-model.rst35
-rw-r--r--Documentation/media/uapi/mediactl/media-controller.rst52
-rw-r--r--Documentation/media/uapi/mediactl/media-func-close.rst47
-rw-r--r--Documentation/media/uapi/mediactl/media-func-ioctl.rst67
-rw-r--r--Documentation/media/uapi/mediactl/media-func-open.rst69
-rw-r--r--Documentation/media/uapi/mediactl/media-funcs.rst18
-rw-r--r--Documentation/media/uapi/mediactl/media-header.rst10
-rw-r--r--Documentation/media/uapi/mediactl/media-ioc-device-info.rst142
-rw-r--r--Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst199
-rw-r--r--Documentation/media/uapi/mediactl/media-ioc-enum-links.rst170
-rw-r--r--Documentation/media/uapi/mediactl/media-ioc-g-topology.rst377
-rw-r--r--Documentation/media/uapi/mediactl/media-ioc-setup-link.rst68
-rw-r--r--Documentation/media/uapi/mediactl/media-types.rst606
-rw-r--r--Documentation/media/uapi/rc/keytable.c.rst176
-rw-r--r--Documentation/media/uapi/rc/lirc-dev-intro.rst62
-rw-r--r--Documentation/media/uapi/rc/lirc-dev.rst14
-rw-r--r--Documentation/media/uapi/rc/lirc-func.rst28
-rw-r--r--Documentation/media/uapi/rc/lirc-get-features.rst181
-rw-r--r--Documentation/media/uapi/rc/lirc-get-length.rst45
-rw-r--r--Documentation/media/uapi/rc/lirc-get-rec-mode.rst45
-rw-r--r--Documentation/media/uapi/rc/lirc-get-rec-resolution.rst49
-rw-r--r--Documentation/media/uapi/rc/lirc-get-send-mode.rst45
-rw-r--r--Documentation/media/uapi/rc/lirc-get-timeout.rst55
-rw-r--r--Documentation/media/uapi/rc/lirc-header.rst10
-rw-r--r--Documentation/media/uapi/rc/lirc-read.rst62
-rw-r--r--Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst48
-rw-r--r--Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst49
-rw-r--r--Documentation/media/uapi/rc/lirc-set-rec-carrier.rst48
-rw-r--r--Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst49
-rw-r--r--Documentation/media/uapi/rc/lirc-set-rec-timeout.rst52
-rw-r--r--Documentation/media/uapi/rc/lirc-set-send-carrier.rst43
-rw-r--r--Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst49
-rw-r--r--Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst53
-rw-r--r--Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst56
-rw-r--r--Documentation/media/uapi/rc/lirc-write.rst58
-rw-r--r--Documentation/media/uapi/rc/rc-intro.rst24
-rw-r--r--Documentation/media/uapi/rc/rc-sysfs-nodes.rst143
-rw-r--r--Documentation/media/uapi/rc/rc-table-change.rst18
-rw-r--r--Documentation/media/uapi/rc/rc-tables.rst757
-rw-r--r--Documentation/media/uapi/rc/remote_controllers.rst49
-rw-r--r--Documentation/media/uapi/v4l/app-pri.rst30
-rw-r--r--Documentation/media/uapi/v4l/async.rst9
-rw-r--r--Documentation/media/uapi/v4l/audio.rst95
-rw-r--r--Documentation/media/uapi/v4l/biblio.rst391
-rw-r--r--Documentation/media/uapi/v4l/buffer.rst982
-rw-r--r--Documentation/media/uapi/v4l/capture-example.rst13
-rw-r--r--Documentation/media/uapi/v4l/capture.c.rst664
-rw-r--r--Documentation/media/uapi/v4l/colorspaces.rst163
-rw-r--r--Documentation/media/uapi/v4l/common-defs.rst13
-rw-r--r--Documentation/media/uapi/v4l/common.rst46
-rw-r--r--Documentation/media/uapi/v4l/compat.rst18
-rw-r--r--Documentation/media/uapi/v4l/control.rst538
-rw-r--r--Documentation/media/uapi/v4l/crop.rst303
-rw-r--r--Documentation/media/uapi/v4l/crop_files/crop.gifbin0 -> 5967 bytes
-rw-r--r--Documentation/media/uapi/v4l/crop_files/crop.pdfbin0 -> 5846 bytes
-rw-r--r--Documentation/media/uapi/v4l/depth-formats.rst15
-rw-r--r--Documentation/media/uapi/v4l/dev-capture.rst104
-rw-r--r--Documentation/media/uapi/v4l/dev-codec.rst34
-rw-r--r--Documentation/media/uapi/v4l/dev-effect.rst21
-rw-r--r--Documentation/media/uapi/v4l/dev-event.rst47
-rw-r--r--Documentation/media/uapi/v4l/dev-osd.rst148
-rw-r--r--Documentation/media/uapi/v4l/dev-output.rst101
-rw-r--r--Documentation/media/uapi/v4l/dev-overlay.rst317
-rw-r--r--Documentation/media/uapi/v4l/dev-radio.rst52
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi.rst350
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.gifbin0 -> 4741 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdfbin0 -> 3395 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.gifbin0 -> 5095 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdfbin0 -> 3683 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.gifbin0 -> 2400 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdfbin0 -> 7405 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-rds.rst255
-rw-r--r--Documentation/media/uapi/v4l/dev-sdr.rst120
-rw-r--r--Documentation/media/uapi/v4l/dev-sliced-vbi.rst822
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev.rst491
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdfbin0 -> 20276 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pngbin0 -> 12130 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdfbin0 -> 20729 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg63
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdfbin0 -> 46311 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg163
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdfbin0 -> 36714 bytes
-rw-r--r--Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg116
-rw-r--r--Documentation/media/uapi/v4l/dev-teletext.rst34
-rw-r--r--Documentation/media/uapi/v4l/devices.rst26
-rw-r--r--Documentation/media/uapi/v4l/diff-v4l.rst954
-rw-r--r--Documentation/media/uapi/v4l/dmabuf.rst162
-rw-r--r--Documentation/media/uapi/v4l/driver.rst9
-rw-r--r--Documentation/media/uapi/v4l/dv-timings.rst38
-rw-r--r--Documentation/media/uapi/v4l/extended-controls.rst4531
-rw-r--r--Documentation/media/uapi/v4l/field-order.rst205
-rw-r--r--Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.gifbin0 -> 25430 bytes
-rw-r--r--Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdfbin0 -> 9185 bytes
-rw-r--r--Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.gifbin0 -> 25323 bytes
-rw-r--r--Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdfbin0 -> 9173 bytes
-rw-r--r--Documentation/media/uapi/v4l/format.rst92
-rw-r--r--Documentation/media/uapi/v4l/func-close.rst49
-rw-r--r--Documentation/media/uapi/v4l/func-ioctl.rst62
-rw-r--r--Documentation/media/uapi/v4l/func-mmap.rst139
-rw-r--r--Documentation/media/uapi/v4l/func-munmap.rst58
-rw-r--r--Documentation/media/uapi/v4l/func-open.rst83
-rw-r--r--Documentation/media/uapi/v4l/func-poll.rst116
-rw-r--r--Documentation/media/uapi/v4l/func-read.rst131
-rw-r--r--Documentation/media/uapi/v4l/func-select.rst106
-rw-r--r--Documentation/media/uapi/v4l/func-write.rst82
-rw-r--r--Documentation/media/uapi/v4l/hist-v4l2.rst1480
-rw-r--r--Documentation/media/uapi/v4l/io.rst51
-rw-r--r--Documentation/media/uapi/v4l/libv4l-introduction.rst169
-rw-r--r--Documentation/media/uapi/v4l/libv4l.rst13
-rw-r--r--Documentation/media/uapi/v4l/mmap.rst285
-rw-r--r--Documentation/media/uapi/v4l/open.rst158
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-002.rst196
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-003.rst166
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-004.rst51
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-006.rst288
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-007.rst896
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-008.rst32
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-013.rst129
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-grey.rst77
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-indexed.rst73
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-m420.rst219
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv12.rst221
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv12m.rst238
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv12mt.rst62
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gifbin0 -> 2108 bytes
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gifbin0 -> 6858 bytes
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv16.rst270
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv16m.rst277
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-nv24.rst171
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst1469
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst316
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-reserved.rst360
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-rgb.rst23
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sbggr16.rst114
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sbggr8.rst81
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sdr-cs08.rst43
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sdr-cs14le.rst48
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sdr-cu08.rst43
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sdr-cu16le.rst47
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sdr-ru12le.rst38
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sgbrg8.rst81
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-sgrbg8.rst81
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb10.rst120
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb10alaw8.rst26
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb10dpcm8.rst28
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb10p.rst103
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb12.rst121
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-srggb8.rst81
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-uv8.rst76
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-uyvy.rst197
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-vyuy.rst195
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y10.rst110
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y10b.rst45
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y12.rst110
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y12i.rst44
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y16-be.rst112
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y16.rst112
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y41p.rst274
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-y8i.rst111
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv410.rst208
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv411p.rst214
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv420.rst239
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv420m.rst254
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv422m.rst258
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv422p.rst240
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuv444m.rst266
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yuyv.rst205
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-yvyu.rst195
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-z16.rst111
-rw-r--r--Documentation/media/uapi/v4l/pixfmt.rst35
-rw-r--r--Documentation/media/uapi/v4l/planar-apis.rst61
-rw-r--r--Documentation/media/uapi/v4l/querycap.rst34
-rw-r--r--Documentation/media/uapi/v4l/rw.rst47
-rw-r--r--Documentation/media/uapi/v4l/sdr-formats.rst19
-rw-r--r--Documentation/media/uapi/v4l/selection-api-002.rst28
-rw-r--r--Documentation/media/uapi/v4l/selection-api-003.rst20
-rw-r--r--Documentation/media/uapi/v4l/selection-api-003_files/selection.pngbin0 -> 11716 bytes
-rw-r--r--Documentation/media/uapi/v4l/selection-api-004.rst137
-rw-r--r--Documentation/media/uapi/v4l/selection-api-005.rst34
-rw-r--r--Documentation/media/uapi/v4l/selection-api-006.rst84
-rw-r--r--Documentation/media/uapi/v4l/selection-api.rst16
-rw-r--r--Documentation/media/uapi/v4l/selections-common.rst23
-rw-r--r--Documentation/media/uapi/v4l/standard.rst183
-rw-r--r--Documentation/media/uapi/v4l/streaming-par.rst33
-rw-r--r--Documentation/media/uapi/v4l/subdev-formats.rst11688
-rw-r--r--Documentation/media/uapi/v4l/subdev-formats_files/bayer.pngbin0 -> 9725 bytes
-rw-r--r--Documentation/media/uapi/v4l/tuner.rst83
-rw-r--r--Documentation/media/uapi/v4l/user-func.rst81
-rw-r--r--Documentation/media/uapi/v4l/userp.rst119
-rw-r--r--Documentation/media/uapi/v4l/v4l2-selection-flags.rst71
-rw-r--r--Documentation/media/uapi/v4l/v4l2-selection-targets.rst135
-rw-r--r--Documentation/media/uapi/v4l/v4l2.rst398
-rw-r--r--Documentation/media/uapi/v4l/v4l2grab-example.rst17
-rw-r--r--Documentation/media/uapi/v4l/v4l2grab.c.rst169
-rw-r--r--Documentation/media/uapi/v4l/video.rst67
-rw-r--r--Documentation/media/uapi/v4l/videodev.rst9
-rw-r--r--Documentation/media/uapi/v4l/vidioc-create-bufs.rst146
-rw-r--r--Documentation/media/uapi/v4l/vidioc-cropcap.rst167
-rw-r--r--Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst204
-rw-r--r--Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst209
-rw-r--r--Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst271
-rw-r--r--Documentation/media/uapi/v4l/vidioc-dqevent.rst573
-rw-r--r--Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst252
-rw-r--r--Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst195
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst121
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-fmt.rst166
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst270
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst291
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst192
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enumaudio.rst56
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enumaudioout.rst59
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enuminput.rst367
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enumoutput.rst222
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enumstd.rst442
-rw-r--r--Documentation/media/uapi/v4l/vidioc-expbuf.rst197
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-audio.rst162
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-audioout.rst122
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-crop.rst113
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-ctrl.rst105
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst417
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-edid.rst160
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-enc-index.rst210
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst492
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-fbuf.rst500
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-fmt.rst188
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-frequency.rst123
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-input.rst62
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst184
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-modulator.rst257
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-output.rst64
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-parm.rst349
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-priority.rst117
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-selection.rst209
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.pngbin0 -> 3313 bytes
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst276
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-std.rst68
-rw-r--r--Documentation/media/uapi/v4l/vidioc-g-tuner.rst717
-rw-r--r--Documentation/media/uapi/v4l/vidioc-log-status.rst46
-rw-r--r--Documentation/media/uapi/v4l/vidioc-overlay.rst55
-rw-r--r--Documentation/media/uapi/v4l/vidioc-prepare-buf.rst62
-rw-r--r--Documentation/media/uapi/v4l/vidioc-qbuf.rst151
-rw-r--r--Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst83
-rw-r--r--Documentation/media/uapi/v4l/vidioc-querybuf.rst81
-rw-r--r--Documentation/media/uapi/v4l/vidioc-querycap.rst434
-rw-r--r--Documentation/media/uapi/v4l/vidioc-queryctrl.rst785
-rw-r--r--Documentation/media/uapi/v4l/vidioc-querystd.rst66
-rw-r--r--Documentation/media/uapi/v4l/vidioc-reqbufs.rst125
-rw-r--r--Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst179
-rw-r--r--Documentation/media/uapi/v4l/vidioc-streamon.rst103
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst153
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-size.rst162
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst115
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst136
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst171
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst122
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst144
-rw-r--r--Documentation/media/uapi/v4l/vidioc-subscribe-event.rst138
-rw-r--r--Documentation/media/uapi/v4l/yuv-formats.rst55
-rw-r--r--Documentation/media/v4l-drivers/au0828-cardlist.rst11
-rw-r--r--Documentation/media/v4l-drivers/bttv-cardlist.rst172
-rw-r--r--Documentation/media/v4l-drivers/bttv.rst1923
-rw-r--r--Documentation/media/v4l-drivers/cafe_ccic.rst (renamed from Documentation/video4linux/cafe_ccic)24
-rw-r--r--Documentation/media/v4l-drivers/cardlist.rst18
-rw-r--r--Documentation/media/v4l-drivers/cpia2.rst190
-rw-r--r--Documentation/media/v4l-drivers/cx18.rst (renamed from Documentation/video4linux/cx18.txt)7
-rw-r--r--Documentation/media/v4l-drivers/cx2341x.rst3858
-rw-r--r--Documentation/media/v4l-drivers/cx23885-cardlist.rst62
-rw-r--r--Documentation/media/v4l-drivers/cx88-cardlist.rst96
-rw-r--r--Documentation/media/v4l-drivers/cx88.rst163
-rw-r--r--Documentation/media/v4l-drivers/davinci-vpbe.rst (renamed from Documentation/video4linux/README.davinci-vpbe)32
-rw-r--r--Documentation/media/v4l-drivers/em28xx-cardlist.rst105
-rw-r--r--Documentation/media/v4l-drivers/fimc.rst (renamed from Documentation/video4linux/fimc.txt)105
-rw-r--r--Documentation/media/v4l-drivers/fourcc.rst (renamed from Documentation/video4linux/4CCs.txt)20
-rw-r--r--Documentation/media/v4l-drivers/gspca-cardlist.rst (renamed from Documentation/video4linux/gspca.txt)16
-rw-r--r--Documentation/media/v4l-drivers/index.rst58
-rw-r--r--Documentation/media/v4l-drivers/ivtv-cardlist.rst29
-rw-r--r--Documentation/media/v4l-drivers/ivtv.rst217
-rw-r--r--Documentation/media/v4l-drivers/meye.rst (renamed from Documentation/video4linux/meye.txt)103
-rw-r--r--Documentation/media/v4l-drivers/omap3isp.rst (renamed from Documentation/video4linux/omap3isp.txt)135
-rw-r--r--Documentation/media/v4l-drivers/omap4_camera.rst (renamed from Documentation/video4linux/omap4_camera.txt)28
-rw-r--r--Documentation/media/v4l-drivers/pvrusb2.rst (renamed from Documentation/video4linux/README.pvrusb2)164
-rw-r--r--Documentation/media/v4l-drivers/pxa_camera.rst192
-rw-r--r--Documentation/media/v4l-drivers/radiotrack.rst166
-rw-r--r--Documentation/media/v4l-drivers/saa7134-cardlist.rst202
-rw-r--r--Documentation/media/v4l-drivers/saa7134.rst113
-rw-r--r--Documentation/media/v4l-drivers/saa7164-cardlist.rst19
-rw-r--r--Documentation/media/v4l-drivers/sh_mobile_ceu_camera.rst (renamed from Documentation/video4linux/sh_mobile_ceu_camera.txt)57
-rw-r--r--Documentation/media/v4l-drivers/si470x.rst (renamed from Documentation/video4linux/si470x.txt)74
-rw-r--r--Documentation/media/v4l-drivers/si4713.rst190
-rw-r--r--Documentation/media/v4l-drivers/si476x.rst150
-rw-r--r--Documentation/media/v4l-drivers/soc-camera.rst (renamed from Documentation/video4linux/soc-camera.txt)41
-rw-r--r--Documentation/media/v4l-drivers/tm6000-cardlist.rst21
-rw-r--r--Documentation/media/v4l-drivers/tuner-cardlist.rst96
-rw-r--r--Documentation/media/v4l-drivers/tuners.rst131
-rw-r--r--Documentation/media/v4l-drivers/usbvision-cardlist.rst72
-rw-r--r--Documentation/media/v4l-drivers/uvcvideo.rst (renamed from Documentation/video4linux/uvcvideo.txt)48
-rw-r--r--Documentation/media/v4l-drivers/v4l-with-ir.rst73
-rw-r--r--Documentation/media/v4l-drivers/vivid.rst (renamed from Documentation/video4linux/vivid.txt)667
-rw-r--r--Documentation/media/v4l-drivers/zoran.rst (renamed from Documentation/video4linux/Zoran)307
-rw-r--r--Documentation/media/v4l-drivers/zr364xx.rst (renamed from Documentation/video4linux/zr364xx.txt)89
-rw-r--r--Documentation/media/video.h.rst.exceptions40
-rw-r--r--Documentation/media/videodev2.h.rst.exceptions535
-rw-r--r--Documentation/sphinx-static/theme_overrides.css58
-rwxr-xr-xDocumentation/sphinx/kernel_include.py183
-rwxr-xr-xDocumentation/sphinx/parse-headers.pl321
-rw-r--r--Documentation/video4linux/API.html27
-rw-r--r--Documentation/video4linux/CARDLIST.au08286
-rw-r--r--Documentation/video4linux/CARDLIST.bttv167
-rw-r--r--Documentation/video4linux/CARDLIST.cx2388557
-rw-r--r--Documentation/video4linux/CARDLIST.cx8891
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx100
-rw-r--r--Documentation/video4linux/CARDLIST.ivtv24
-rw-r--r--Documentation/video4linux/CARDLIST.saa7134197
-rw-r--r--Documentation/video4linux/CARDLIST.saa716414
-rw-r--r--Documentation/video4linux/CARDLIST.tm600016
-rw-r--r--Documentation/video4linux/CARDLIST.tuner91
-rw-r--r--Documentation/video4linux/CARDLIST.usbvision67
-rw-r--r--Documentation/video4linux/README.cpia2130
-rw-r--r--Documentation/video4linux/README.cx8867
-rw-r--r--Documentation/video4linux/README.ir72
-rw-r--r--Documentation/video4linux/README.ivtv186
-rw-r--r--Documentation/video4linux/README.saa713482
-rw-r--r--Documentation/video4linux/bttv/CONTRIBUTORS25
-rw-r--r--Documentation/video4linux/bttv/Cards960
-rw-r--r--Documentation/video4linux/bttv/ICs37
-rw-r--r--Documentation/video4linux/bttv/Insmod-options172
-rw-r--r--Documentation/video4linux/bttv/MAKEDEV27
-rw-r--r--Documentation/video4linux/bttv/Modprobe.conf11
-rw-r--r--Documentation/video4linux/bttv/Modules.conf14
-rw-r--r--Documentation/video4linux/bttv/PROBLEMS62
-rw-r--r--Documentation/video4linux/bttv/README90
-rw-r--r--Documentation/video4linux/bttv/README.WINVIEW33
-rw-r--r--Documentation/video4linux/bttv/README.freeze74
-rw-r--r--Documentation/video4linux/bttv/README.quirks83
-rw-r--r--Documentation/video4linux/bttv/Sound-FAQ148
-rw-r--r--Documentation/video4linux/bttv/Specs3
-rw-r--r--Documentation/video4linux/bttv/THANKS24
-rw-r--r--Documentation/video4linux/bttv/Tuners115
-rw-r--r--Documentation/video4linux/cpia2_overview.txt38
-rw-r--r--Documentation/video4linux/cx2341x/README.hm12120
-rw-r--r--Documentation/video4linux/cx2341x/README.vbi45
-rw-r--r--Documentation/video4linux/cx2341x/fw-calling.txt69
-rw-r--r--Documentation/video4linux/cx2341x/fw-decoder-api.txt297
-rw-r--r--Documentation/video4linux/cx2341x/fw-decoder-regs.txt817
-rw-r--r--Documentation/video4linux/cx2341x/fw-dma.txt96
-rw-r--r--Documentation/video4linux/cx2341x/fw-encoder-api.txt709
-rw-r--r--Documentation/video4linux/cx2341x/fw-memory.txt139
-rw-r--r--Documentation/video4linux/cx2341x/fw-osd-api.txt350
-rw-r--r--Documentation/video4linux/cx2341x/fw-upload.txt49
-rw-r--r--Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt54
-rw-r--r--Documentation/video4linux/hauppauge-wintv-cx88-ir.txt54
-rw-r--r--Documentation/video4linux/lifeview.txt42
-rw-r--r--Documentation/video4linux/not-in-cx2388x-datasheet.txt41
-rw-r--r--Documentation/video4linux/pxa_camera.txt174
-rw-r--r--Documentation/video4linux/radiotrack.txt147
-rw-r--r--Documentation/video4linux/si4713.txt176
-rw-r--r--Documentation/video4linux/si476x.txt187
-rw-r--r--Documentation/video4linux/v4l2-framework.txt1160
-rw-r--r--drivers/media/dvb-core/demux.h165
-rw-r--r--drivers/media/dvb-core/dvb_frontend.h53
-rw-r--r--drivers/media/dvb-core/dvb_math.h7
-rw-r--r--drivers/media/dvb-core/dvb_ringbuffer.h15
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c34
-rw-r--r--drivers/media/v4l2-core/v4l2-subdev.c10
-rw-r--r--include/media/lirc_dev.h2
-rw-r--r--include/media/media-device.h255
-rw-r--r--include/media/media-entity.h89
-rw-r--r--include/media/rc-core.h45
-rw-r--r--include/media/rc-map.h17
-rw-r--r--include/media/tuner-types.h8
-rw-r--r--include/media/tveeprom.h18
-rw-r--r--include/media/v4l2-async.h39
-rw-r--r--include/media/v4l2-common.h92
-rw-r--r--include/media/v4l2-ctrls.h369
-rw-r--r--include/media/v4l2-dev.h364
-rw-r--r--include/media/v4l2-device.h198
-rw-r--r--include/media/v4l2-dv-timings.h2
-rw-r--r--include/media/v4l2-event.h125
-rw-r--r--include/media/v4l2-fh.h128
-rw-r--r--include/media/v4l2-ioctl.h266
-rw-r--r--include/media/v4l2-mc.h13
-rw-r--r--include/media/v4l2-subdev.h576
-rw-r--r--include/media/videobuf2-core.h74
-rw-r--r--include/uapi/linux/lirc.h39
-rwxr-xr-xscripts/extract_xc3028.pl (renamed from Documentation/video4linux/extract_xc3028.pl)0
-rwxr-xr-xscripts/get_dvb_firmware (renamed from Documentation/dvb/get_dvb_firmware)0
619 files changed, 88276 insertions, 10988 deletions
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index 58af32b01b90..7febdeb08159 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -247,64 +247,6 @@ X!Isound/sound_firmware.c
247--> 247-->
248 </chapter> 248 </chapter>
249 249
250 <chapter id="mediadev">
251 <title>Media Devices</title>
252
253 <sect1><title>Video2Linux devices</title>
254!Iinclude/media/tuner.h
255!Iinclude/media/tuner-types.h
256!Iinclude/media/tveeprom.h
257!Iinclude/media/v4l2-async.h
258!Iinclude/media/v4l2-ctrls.h
259!Iinclude/media/v4l2-dv-timings.h
260!Iinclude/media/v4l2-event.h
261!Iinclude/media/v4l2-flash-led-class.h
262!Iinclude/media/v4l2-mc.h
263!Iinclude/media/v4l2-mediabus.h
264!Iinclude/media/v4l2-mem2mem.h
265!Iinclude/media/v4l2-of.h
266!Iinclude/media/v4l2-rect.h
267!Iinclude/media/v4l2-subdev.h
268!Iinclude/media/videobuf2-core.h
269!Iinclude/media/videobuf2-v4l2.h
270!Iinclude/media/videobuf2-memops.h
271 </sect1>
272 <sect1><title>Digital TV (DVB) devices</title>
273 <sect1><title>Digital TV Common functions</title>
274!Idrivers/media/dvb-core/dvb_math.h
275!Idrivers/media/dvb-core/dvb_ringbuffer.h
276!Idrivers/media/dvb-core/dvbdev.h
277 </sect1>
278 <sect1><title>Digital TV Frontend kABI</title>
279!Pdrivers/media/dvb-core/dvb_frontend.h Digital TV Frontend
280!Idrivers/media/dvb-core/dvb_frontend.h
281 </sect1>
282 <sect1><title>Digital TV Demux kABI</title>
283!Pdrivers/media/dvb-core/demux.h Digital TV Demux
284 <sect1><title>Demux Callback API</title>
285!Pdrivers/media/dvb-core/demux.h Demux Callback
286 </sect1>
287!Idrivers/media/dvb-core/demux.h
288 </sect1>
289 <sect1><title>Digital TV Conditional Access kABI</title>
290!Idrivers/media/dvb-core/dvb_ca_en50221.h
291 </sect1>
292 </sect1>
293 <sect1><title>Remote Controller devices</title>
294!Iinclude/media/rc-core.h
295!Iinclude/media/lirc_dev.h
296 </sect1>
297 <sect1><title>Media Controller devices</title>
298!Pinclude/media/media-device.h Media Controller
299!Iinclude/media/media-device.h
300!Iinclude/media/media-devnode.h
301!Iinclude/media/media-entity.h
302 </sect1>
303 <sect1><title>Consumer Electronics Control devices</title>
304!Iinclude/media/cec-edid.h
305 </sect1>
306
307 </chapter>
308 250
309 <chapter id="uart16x50"> 251 <chapter id="uart16x50">
310 <title>16x50 UART Driver</title> 252 <title>16x50 UART Driver</title>
diff --git a/Documentation/DocBook/media/v4l/fdl-appendix.xml b/Documentation/DocBook/media/v4l/fdl-appendix.xml
index ae22394ba997..71299a3897c4 100644
--- a/Documentation/DocBook/media/v4l/fdl-appendix.xml
+++ b/Documentation/DocBook/media/v4l/fdl-appendix.xml
@@ -526,7 +526,7 @@
526 526
527 <para> 527 <para>
528 You may extract a single document from such a collection, and 528 You may extract a single document from such a collection, and
529 dispbibute it individually under this License, provided you 529 distribute it individually under this License, provided you
530 insert a copy of this License into the extracted document, and 530 insert a copy of this License into the extracted document, and
531 follow this License in all other respects regarding verbatim 531 follow this License in all other respects regarding verbatim
532 copying of that document. 532 copying of that document.
diff --git a/Documentation/DocBook/media/v4l/lirc_device_interface.xml b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
index 71f9dbb81ec7..f53ad58027a7 100644
--- a/Documentation/DocBook/media/v4l/lirc_device_interface.xml
+++ b/Documentation/DocBook/media/v4l/lirc_device_interface.xml
@@ -114,7 +114,7 @@ on working with the default settings initially.</para>
114 <para>Some receiver have maximum resolution which is defined by internal 114 <para>Some receiver have maximum resolution which is defined by internal
115 sample rate or data format limitations. E.g. it's common that signals can 115 sample rate or data format limitations. E.g. it's common that signals can
116 only be reported in 50 microsecond steps. This integer value is used by 116 only be reported in 50 microsecond steps. This integer value is used by
117 lircd to automatically adjust the aeps tolerance value in the lircd 117 lircd to automatically adjust the steps tolerance value in the lircd
118 config file.</para> 118 config file.</para>
119 </listitem> 119 </listitem>
120 </varlistentry> 120 </varlistentry>
diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index d8d13c92a178..fd565e1f1368 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -38,9 +38,10 @@ ALLSPHINXOPTS = -D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) -d $(B
38I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 38I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
39 39
40quiet_cmd_sphinx = SPHINX $@ 40quiet_cmd_sphinx = SPHINX $@
41 cmd_sphinx = $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2 41 cmd_sphinx = BUILDDIR=$(BUILDDIR) $(SPHINXBUILD) -b $2 $(ALLSPHINXOPTS) $(BUILDDIR)/$2
42 42
43htmldocs: 43htmldocs:
44 $(MAKE) BUILDDIR=$(BUILDDIR) -f $(srctree)/Documentation/media/Makefile $@
44 $(call cmd,sphinx,html) 45 $(call cmd,sphinx,html)
45 46
46pdfdocs: 47pdfdocs:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 792b6338ef19..96b7aa66c89c 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,7 +28,7 @@ sys.path.insert(0, os.path.abspath('sphinx'))
28# Add any Sphinx extension module names here, as strings. They can be 28# Add any Sphinx extension module names here, as strings. They can be
29# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 29# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30# ones. 30# ones.
31extensions = ['kernel-doc', 'rstFlatTable'] 31extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
32 32
33# Gracefully handle missing rst2pdf. 33# Gracefully handle missing rst2pdf.
34try: 34try:
@@ -176,7 +176,14 @@ except ImportError:
176# Add any paths that contain custom static files (such as style sheets) here, 176# Add any paths that contain custom static files (such as style sheets) here,
177# relative to this directory. They are copied after the builtin static files, 177# relative to this directory. They are copied after the builtin static files,
178# so a file named "default.css" will overwrite the builtin "default.css". 178# so a file named "default.css" will overwrite the builtin "default.css".
179#html_static_path = ['_static'] 179
180html_static_path = ['sphinx-static']
181
182html_context = {
183 'css_files': [
184 '_static/theme_overrides.css',
185 ],
186}
180 187
181# Add any extra paths that contain custom files (such as robots.txt or 188# Add any extra paths that contain custom files (such as robots.txt or
182# .htaccess) here, relative to this directory. These files are copied 189# .htaccess) here, relative to this directory. These files are copied
@@ -404,7 +411,7 @@ epub_exclude_files = ['search.html']
404# multiple PDF files here actually tries to get the cross-referencing right 411# multiple PDF files here actually tries to get the cross-referencing right
405# *between* PDF files. 412# *between* PDF files.
406pdf_documents = [ 413pdf_documents = [
407 ('index', u'Kernel', u'Kernel', u'J. Random Bozo'), 414 ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'),
408] 415]
409 416
410# kernel-doc extension configuration for running Sphinx directly (e.g. by Read 417# kernel-doc extension configuration for running Sphinx directly (e.g. by Read
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb
deleted file mode 100644
index 6f4b12f7b844..000000000000
--- a/Documentation/dvb/README.dvb-usb
+++ /dev/null
@@ -1,232 +0,0 @@
1Documentation for dvb-usb-framework module and its devices
2
3Idea behind the dvb-usb-framework
4=================================
5
6In March 2005 I got the new Twinhan USB2.0 DVB-T device. They provided specs and a firmware.
7
8Quite keen I wanted to put the driver (with some quirks of course) into dibusb.
9After reading some specs and doing some USB snooping, it realized, that the
10dibusb-driver would be a complete mess afterwards. So I decided to do it in a
11different way: With the help of a dvb-usb-framework.
12
13The framework provides generic functions (mostly kernel API calls), such as:
14
15- Transport Stream URB handling in conjunction with dvb-demux-feed-control
16 (bulk and isoc are supported)
17- registering the device for the DVB-API
18- registering an I2C-adapter if applicable
19- remote-control/input-device handling
20- firmware requesting and loading (currently just for the Cypress USB
21 controllers)
22- other functions/methods which can be shared by several drivers (such as
23 functions for bulk-control-commands)
24- TODO: a I2C-chunker. It creates device-specific chunks of register-accesses
25 depending on length of a register and the number of values that can be
26 multi-written and multi-read.
27
28The source code of the particular DVB USB devices does just the communication
29with the device via the bus. The connection between the DVB-API-functionality
30is done via callbacks, assigned in a static device-description (struct
31dvb_usb_device) each device-driver has to have.
32
33For an example have a look in drivers/media/usb/dvb-usb/vp7045*.
34
35Objective is to migrate all the usb-devices (dibusb, cinergyT2, maybe the
36ttusb; flexcop-usb already benefits from the generic flexcop-device) to use
37the dvb-usb-lib.
38
39TODO: dynamic enabling and disabling of the pid-filter in regard to number of
40feeds requested.
41
42Supported devices
43========================
44
45See the LinuxTV DVB Wiki at www.linuxtv.org for a complete list of
46cards/drivers/firmwares:
47
48https://linuxtv.org/wiki/index.php/DVB_USB
49
500. History & News:
51 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)
52 2005-05-30 - added basic isochronous support to the dvb-usb-framework
53 added support for Conexant Hybrid reference design and Nebula DigiTV USB
54 2005-04-17 - all dibusb devices ported to make use of the dvb-usb-framework
55 2005-04-02 - re-enabled and improved remote control code.
56 2005-03-31 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb.
57 2005-03-30 - first commit of the dvb-usb-module based on the dibusb-source. First device is a new driver for the
58 TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.
59
60 (change from dvb-dibusb to dvb-usb)
61 2005-03-28 - added support for the AVerMedia AverTV DVB-T USB2.0 device (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia)
62 2005-03-14 - added support for the Typhoon/Yakumo/HAMA DVB-T mobile USB2.0
63 2005-02-11 - added support for the KWorld/ADSTech Instant DVB-T USB2.0. Thanks a lot to Joachim von Caron
64 2005-02-02 - added support for the Hauppauge Win-TV Nova-T USB2
65 2005-01-31 - distorted streaming is gone for USB1.1 devices
66 2005-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb
67 - first almost working version for HanfTek UMT-010
68 - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-010
69 2005-01-10 - refactoring completed, now everything is very delightful
70 - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a
71 Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.
72 2004-12-29 - after several days of struggling around bug of no returning URBs fixed.
73 2004-12-26 - refactored the dibusb-driver, splitted into separate files
74 - i2c-probing enabled
75 2004-12-06 - possibility for demod i2c-address probing
76 - new usb IDs (Compro, Artec)
77 2004-11-23 - merged changes from DiB3000MC_ver2.1
78 - revised the debugging
79 - possibility to deliver the complete TS for USB2.0
80 2004-11-21 - first working version of the dib3000mc/p frontend driver.
81 2004-11-12 - added additional remote control keys. Thanks to Uwe Hanke.
82 2004-11-07 - added remote control support. Thanks to David Matthews.
83 2004-11-05 - added support for a new devices (Grandtec/Avermedia/Artec)
84 - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD
85 - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems
86 better settled there (added xfer_ops-struct)
87 - created a common files for frontends (mc/p/mb)
88 2004-09-28 - added support for a new device (Unknown, vendor ID is Hyper-Paltek)
89 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks
90 to Amaury Demol for reporting
91 - changed usb TS transfer method (several urbs, stopping transfer
92 before setting a new pid)
93 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks
94 to Christian Motschke for reporting
95 2004-09-05 - released the dibusb device and dib3000mb-frontend driver
96
97 (old news for vp7041.c)
98 2004-07-15 - found out, by accident, that the device has a TUA6010XS for
99 PLL
100 2004-07-12 - figured out, that the driver should also work with the
101 CTS Portable (Chinese Television System)
102 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working
103 properly with firmware extracted from 2.422
104 - #if for 2.6.4 (dvb), compile issue
105 - changed firmware handling, see vp7041.txt sec 1.1
106 2004-07-02 - some tuner modifications, v0.1, cleanups, first public
107 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything
108 runs fine now
109 2004-06-27 - able to watch and switching channels (pre-alpha)
110 - no section filtering yet
111 2004-06-06 - first TS received, but kernel oops :/
112 2004-05-14 - firmware loader is working
113 2004-05-11 - start writing the driver
114
1151. How to use?
1161.1. Firmware
117
118Most of the USB drivers need to download a firmware to the device before start
119working.
120
121Have a look at the Wikipage for the DVB-USB-drivers to find out, which firmware
122you need for your device:
123
124https://linuxtv.org/wiki/index.php/DVB_USB
125
1261.2. Compiling
127
128Since the driver is in the linux kernel, activating the driver in
129your favorite config-environment should sufficient. I recommend
130to compile the driver as module. Hotplug does the rest.
131
132If you use dvb-kernel enter the build-2.6 directory run 'make' and 'insmod.sh
133load' afterwards.
134
1351.3. Loading the drivers
136
137Hotplug is able to load the driver, when it is needed (because you plugged
138in the device).
139
140If you want to enable debug output, you have to load the driver manually and
141from within the dvb-kernel cvs repository.
142
143first have a look, which debug level are available:
144
145modinfo dvb-usb
146modinfo dvb-usb-vp7045
147etc.
148
149modprobe dvb-usb debug=<level>
150modprobe dvb-usb-vp7045 debug=<level>
151etc.
152
153should do the trick.
154
155When the driver is loaded successfully, the firmware file was in
156the right place and the device is connected, the "Power"-LED should be
157turned on.
158
159At this point you should be able to start a dvb-capable application. I'm use
160(t|s)zap, mplayer and dvbscan to test the basics. VDR-xine provides the
161long-term test scenario.
162
1632. Known problems and bugs
164
165- Don't remove the USB device while running an DVB application, your system
166 will go crazy or die most likely.
167
1682.1. Adding support for devices
169
170TODO
171
1722.2. USB1.1 Bandwidth limitation
173
174A lot of the currently supported devices are USB1.1 and thus they have a
175maximum bandwidth of about 5-6 MBit/s when connected to a USB2.0 hub.
176This is not enough for receiving the complete transport stream of a
177DVB-T channel (which is about 16 MBit/s). Normally this is not a
178problem, if you only want to watch TV (this does not apply for HDTV),
179but watching a channel while recording another channel on the same
180frequency simply does not work very well. This applies to all USB1.1
181DVB-T devices, not just the dvb-usb-devices)
182
183The bug, where the TS is distorted by a heavy usage of the device is gone
184definitely. All dvb-usb-devices I was using (Twinhan, Kworld, DiBcom) are
185working like charm now with VDR. Sometimes I even was able to record a channel
186and watch another one.
187
1882.3. Comments
189
190Patches, comments and suggestions are very very welcome.
191
1923. Acknowledgements
193 Amaury Demol (Amaury.Demol@parrot.com) and Francois Kanounnikoff from DiBcom for
194 providing specs, code and help, on which the dvb-dibusb, dib3000mb and
195 dib3000mc are based.
196
197 David Matthews for identifying a new device type (Artec T1 with AN2235)
198 and for extending dibusb with remote control event handling. Thank you.
199
200 Alex Woods for frequently answering question about usb and dvb
201 stuff, a big thank you.
202
203 Bernd Wagner for helping with huge bug reports and discussions.
204
205 Gunnar Wittich and Joachim von Caron for their trust for providing
206 root-shells on their machines to implement support for new devices.
207
208 Allan Third and Michael Hutchinson for their help to write the Nebula
209 digitv-driver.
210
211 Glen Harris for bringing up, that there is a new dibusb-device and Jiun-Kuei
212 Jung from AVerMedia who kindly provided a special firmware to get the device
213 up and running in Linux.
214
215 Jennifer Chen, Jeff and Jack from Twinhan for kindly supporting by
216 writing the vp7045-driver.
217
218 Steve Chang from WideView for providing information for new devices and
219 firmware files.
220
221 Michael Paxton for submitting remote control keymaps.
222
223 Some guys on the linux-dvb mailing list for encouraging me.
224
225 Peter Schildmann >peter.schildmann-nospam-at-web.de< for his
226 user-level firmware loader, which saves a lot of time
227 (when writing the vp7041 driver)
228
229 Ulf Hermenau for helping me out with traditional chinese.
230
231 André Smoktun and Christian Frömmel for supporting me with
232 hardware and listening to my problems very patiently.
diff --git a/Documentation/dvb/avermedia.txt b/Documentation/dvb/avermedia.txt
deleted file mode 100644
index e44c009ac6c5..000000000000
--- a/Documentation/dvb/avermedia.txt
+++ /dev/null
@@ -1,301 +0,0 @@
1HOWTO: Get An Avermedia DVB-T working under Linux
2 ______________________________________________
3
4 Table of Contents
5 Assumptions and Introduction
6 The Avermedia DVB-T
7 Getting the card going
8 Receiving DVB-T in Australia
9 Known Limitations
10 Further Update
11
12Assumptions and Introduction
13
14 It is assumed that the reader understands the basic structure
15 of the Linux Kernel DVB drivers and the general principles of
16 Digital TV.
17
18 One significant difference between Digital TV and Analogue TV
19 that the unwary (like myself) should consider is that,
20 although the component structure of budget DVB-T cards are
21 substantially similar to Analogue TV cards, they function in
22 substantially different ways.
23
24 The purpose of an Analogue TV is to receive and display an
25 Analogue Television signal. An Analogue TV signal (otherwise
26 known as composite video) is an analogue encoding of a
27 sequence of image frames (25 per second) rasterised using an
28 interlacing technique. Interlacing takes two fields to
29 represent one frame. Computers today are at their best when
30 dealing with digital signals, not analogue signals and a
31 composite video signal is about as far removed from a digital
32 data stream as you can get. Therefore, an Analogue TV card for
33 a PC has the following purpose:
34
35 * Tune the receiver to receive a broadcast signal
36 * demodulate the broadcast signal
37 * demultiplex the analogue video signal and analogue audio
38 signal (note some countries employ a digital audio signal
39 embedded within the modulated composite analogue signal -
40 NICAM.)
41 * digitize the analogue video signal and make the resulting
42 datastream available to the data bus.
43
44 The digital datastream from an Analogue TV card is generated
45 by circuitry on the card and is often presented uncompressed.
46 For a PAL TV signal encoded at a resolution of 768x576 24-bit
47 color pixels over 25 frames per second - a fair amount of data
48 is generated and must be processed by the PC before it can be
49 displayed on the video monitor screen. Some Analogue TV cards
50 for PCs have onboard MPEG2 encoders which permit the raw
51 digital data stream to be presented to the PC in an encoded
52 and compressed form - similar to the form that is used in
53 Digital TV.
54
55 The purpose of a simple budget digital TV card (DVB-T,C or S)
56 is to simply:
57
58 * Tune the received to receive a broadcast signal.
59 * Extract the encoded digital datastream from the broadcast
60 signal.
61 * Make the encoded digital datastream (MPEG2) available to
62 the data bus.
63
64 The significant difference between the two is that the tuner
65 on the analogue TV card spits out an Analogue signal, whereas
66 the tuner on the digital TV card spits out a compressed
67 encoded digital datastream. As the signal is already
68 digitised, it is trivial to pass this datastream to the PC
69 databus with minimal additional processing and then extract
70 the digital video and audio datastreams passing them to the
71 appropriate software or hardware for decoding and viewing.
72 _________________________________________________________
73
74The Avermedia DVB-T
75
76 The Avermedia DVB-T is a budget PCI DVB card. It has 3 inputs:
77
78 * RF Tuner Input
79 * Composite Video Input (RCA Jack)
80 * SVIDEO Input (Mini-DIN)
81
82 The RF Tuner Input is the input to the tuner module of the
83 card. The Tuner is otherwise known as the "Frontend" . The
84 Frontend of the Avermedia DVB-T is a Microtune 7202D. A timely
85 post to the linux-dvb mailing list ascertained that the
86 Microtune 7202D is supported by the sp887x driver which is
87 found in the dvb-hw CVS module.
88
89 The DVB-T card is based around the BT878 chip which is a very
90 common multimedia bridge and often found on Analogue TV cards.
91 There is no on-board MPEG2 decoder, which means that all MPEG2
92 decoding must be done in software, or if you have one, on an
93 MPEG2 hardware decoding card or chipset.
94 _________________________________________________________
95
96Getting the card going
97
98 In order to fire up the card, it is necessary to load a number
99 of modules from the DVB driver set. Prior to this it will have
100 been necessary to download these drivers from the linuxtv CVS
101 server and compile them successfully.
102
103 Depending on the card's feature set, the Device Driver API for
104 DVB under Linux will expose some of the following device files
105 in the /dev tree:
106
107 * /dev/dvb/adapter0/audio0
108 * /dev/dvb/adapter0/ca0
109 * /dev/dvb/adapter0/demux0
110 * /dev/dvb/adapter0/dvr0
111 * /dev/dvb/adapter0/frontend0
112 * /dev/dvb/adapter0/net0
113 * /dev/dvb/adapter0/osd0
114 * /dev/dvb/adapter0/video0
115
116 The primary device nodes that we are interested in (at this
117 stage) for the Avermedia DVB-T are:
118
119 * /dev/dvb/adapter0/dvr0
120 * /dev/dvb/adapter0/frontend0
121
122 The dvr0 device node is used to read the MPEG2 Data Stream and
123 the frontend0 node is used to tune the frontend tuner module.
124
125 At this stage, it has not been able to ascertain the
126 functionality of the remaining device nodes in respect of the
127 Avermedia DVBT. However, full functionality in respect of
128 tuning, receiving and supplying the MPEG2 data stream is
129 possible with the currently available versions of the driver.
130 It may be possible that additional functionality is available
131 from the card (i.e. viewing the additional analogue inputs
132 that the card presents), but this has not been tested yet. If
133 I get around to this, I'll update the document with whatever I
134 find.
135
136 To power up the card, load the following modules in the
137 following order:
138
139 * modprobe bttv (normally loaded automatically)
140 * modprobe dvb-bt8xx (or place dvb-bt8xx in /etc/modules)
141
142 Insertion of these modules into the running kernel will
143 activate the appropriate DVB device nodes. It is then possible
144 to start accessing the card with utilities such as scan, tzap,
145 dvbstream etc.
146
147 The frontend module sp887x.o, requires an external firmware.
148 Please use the command "get_dvb_firmware sp887x" to download
149 it. Then copy it to /usr/lib/hotplug/firmware or /lib/firmware/
150 (depending on configuration of firmware hotplug).
151
152Receiving DVB-T in Australia
153
154 I have no experience of DVB-T in other countries other than
155 Australia, so I will attempt to explain how it works here in
156 Melbourne and how this affects the configuration of the DVB-T
157 card.
158
159 The Digital Broadcasting Australia website has a Reception
160 locatortool which provides information on transponder channels
161 and frequencies. My local transmitter happens to be Mount
162 Dandenong.
163
164 The frequencies broadcast by Mount Dandenong are:
165
166 Table 1. Transponder Frequencies Mount Dandenong, Vic, Aus.
167 Broadcaster Channel Frequency
168 ABC VHF 12 226.5 MHz
169 TEN VHF 11 219.5 MHz
170 NINE VHF 8 191.625 MHz
171 SEVEN VHF 6 177.5 MHz
172 SBS UHF 29 536.5 MHz
173
174 The Scan utility has a set of compiled-in defaults for various
175 countries and regions, but if they do not suit, or if you have
176 a pre-compiled scan binary, you can specify a data file on the
177 command line which contains the transponder frequencies. Here
178 is a sample file for the above channel transponders:
179# Data file for DVB scan program
180#
181# C Frequency SymbolRate FEC QAM
182# S Frequency Polarisation SymbolRate FEC
183# T Frequency Bandwidth FEC FEC2 QAM Mode Guard Hier
184T 226500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
185T 191625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
186T 219500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
187T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
188T 536500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
189
190 The defaults for the transponder frequency and other
191 modulation parameters were obtained from www.dba.org.au.
192
193 When Scan runs, it will output channels.conf information for
194 any channel's transponders which the card's frontend can lock
195 onto. (i.e. any whose signal is strong enough at your
196 antenna).
197
198 Here's my channels.conf file for anyone who's interested:
199ABC HDTV:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
200:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2307:0:560
201ABC TV Melbourne:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_
2024:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:65
2030:561
204ABC TV 2:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
205:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:562
206ABC TV 3:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
207:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:563
208ABC TV 4:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
209:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:564
210ABC DiG Radio:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:Q
211AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:2311:56
2126
213TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
214_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:158
2155
216TEN Digital 1:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
217AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
218586
219TEN Digital 2:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
220AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
221587
222TEN Digital 3:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
223AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
224588
225TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
226_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:158
2279
228TEN Digital 4:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
229AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
230590
231TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
232_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:159
2331
234TEN HD:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:T
235RANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:0:1592
236TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
237_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:159
2383
239Nine Digital:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QA
240M_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:513:660:10
24172
242Nine Digital HD:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2
243:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:0:1
244073
245Nine Guide:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_
24664:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:670:1074
2477 Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_6
2484:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1328
2497 Digital 1:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
250_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1329
2517 Digital 2:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
252_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1330
2537 Digital 3:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
254_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1331
2557 HD Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QA
256M_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:833:834:133
2572
2587 Program Guide:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3
259:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:865:866:
2601334
261SBS HD:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:T
262RANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:102:103:784
263SBS DIGITAL 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:Q
264AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:161:81:785
265SBS DIGITAL 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:Q
266AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:162:83:786
267SBS EPG:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:
268TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:163:85:787
269SBS RADIO 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
270_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:201:798
271SBS RADIO 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
272_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:202:799
273 _________________________________________________________
274
275Known Limitations
276
277 At present I can say with confidence that the frontend tunes
278 via /dev/dvb/adapter{x}/frontend0 and supplies an MPEG2 stream
279 via /dev/dvb/adapter{x}/dvr0. I have not tested the
280 functionality of any other part of the card yet. I will do so
281 over time and update this document.
282
283 There are some limitations in the i2c layer due to a returned
284 error message inconsistency. Although this generates errors in
285 dmesg and the system logs, it does not appear to affect the
286 ability of the frontend to function correctly.
287 _________________________________________________________
288
289Further Update
290
291 dvbstream and VideoLAN Client on windows works a treat with
292 DVB, in fact this is currently serving as my main way of
293 viewing DVB-T at the moment. Additionally, VLC is happily
294 decoding HDTV signals, although the PC is dropping the odd
295 frame here and there - I assume due to processing capability -
296 as all the decoding is being done under windows in software.
297
298 Many thanks to Nigel Pearson for the updates to this document
299 since the recent revision of the driver.
300
301 February 14th 2006
diff --git a/Documentation/dvb/bt8xx.txt b/Documentation/dvb/bt8xx.txt
deleted file mode 100644
index b7b1d1b1da46..000000000000
--- a/Documentation/dvb/bt8xx.txt
+++ /dev/null
@@ -1,98 +0,0 @@
1How to get the bt8xx cards working
2==================================
3
41) General information
5======================
6
7This class of cards has a bt878a as the PCI interface, and require the bttv driver
8for accessing the i2c bus and the gpio pins of the bt8xx chipset.
9Please see Documentation/dvb/cards.txt => o Cards based on the Conexant Bt8xx PCI bridge:
10
11Compiling kernel please enable:
12a.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "Enable Video for Linux API 1 (DEPRECATED)"
13b.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "Video Capture Adapters" => "BT848 Video For Linux"
14c.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" => "DVB for Linux" "DVB Core Support" "Bt8xx based PCI Cards"
15
16Please use the following options with care as deselection of drivers which are in fact necessary
17may result in DVB devices that cannot be tuned due to lack of driver support:
18You can save RAM by deselecting every frontend module that your DVB card does not need.
19
20First please remove the static dependency of DVB card drivers on all frontend modules for all possible card variants by enabling:
21d.) "Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
22 => "DVB for Linux" "DVB Core Support" "Load and attach frontend modules as needed"
23
24If you know the frontend driver that your card needs please enable:
25e.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
26 => "DVB for Linux" "DVB Core Support" "Customise DVB Frontends" => "Customise the frontend modules to build"
27 Then please select your card-specific frontend module.
28
292) Loading Modules
30==================
31
32Regular case: If the bttv driver detects a bt8xx-based DVB card, all frontend and backend modules will be loaded automatically.
33Exceptions are:
34- Old TwinHan DST cards or clones with or without CA slot and not containing an Eeprom.
35People running udev please see Documentation/dvb/udev.txt.
36
37In the following cases overriding the PCI type detection for dvb-bt8xx might be necessary:
38
392a) Running TwinHan and Clones
40------------------------------
41
42 $ modprobe bttv card=113
43 $ modprobe dst
44
45Useful parameters for verbosity level and debugging the dst module:
46
47verbose=0: messages are disabled
48 1: only error messages are displayed
49 2: notifications are displayed
50 3: other useful messages are displayed
51 4: debug setting
52dst_addons=0: card is a free to air (FTA) card only
53 0x20: card has a conditional access slot for scrambled channels
54
55The autodetected values are determined by the cards' "response string".
56In your logs see f. ex.: dst_get_device_id: Recognize [DSTMCI].
57For bug reports please send in a complete log with verbose=4 activated.
58Please also see Documentation/dvb/ci.txt.
59
602b) Running multiple cards
61--------------------------
62
63Examples of card ID's:
64
65Pinnacle PCTV Sat: 94
66Nebula Electronics Digi TV: 104
67pcHDTV HD-2000 TV: 112
68Twinhan DST and clones: 113
69Avermedia AverTV DVB-T 771: 123
70Avermedia AverTV DVB-T 761: 124
71DViCO FusionHDTV DVB-T Lite: 128
72DViCO FusionHDTV 5 Lite: 135
73
74Notice: The order of the card ID should be uprising:
75Example:
76 $ modprobe bttv card=113 card=135
77
78For a full list of card ID's please see Documentation/video4linux/CARDLIST.bttv.
79In case of further problems please subscribe and send questions to the mailing list: linux-dvb@linuxtv.org.
80
812c) Probing the cards with broken PCI subsystem ID
82--------------------------------------------------
83There are some TwinHan cards that the EEPROM has become corrupted for some
84reason. The cards do not have correct PCI subsystem ID. But we can force
85probing the cards with broken PCI subsystem ID
86
87 $ echo 109e 0878 $subvendor $subdevice > \
88 /sys/bus/pci/drivers/bt878/new_id
89
90109e: PCI_VENDOR_ID_BROOKTREE
910878: PCI_DEVICE_ID_BROOKTREE_878
92
93Authors: Richard Walker,
94 Jamie Honan,
95 Michael Hunold,
96 Manu Abraham,
97 Uwe Bugla,
98 Michael Krufky
diff --git a/Documentation/dvb/contributors.txt b/Documentation/dvb/contributors.txt
deleted file mode 100644
index 731a009723c7..000000000000
--- a/Documentation/dvb/contributors.txt
+++ /dev/null
@@ -1,96 +0,0 @@
1Thanks go to the following people for patches and contributions:
2
3Michael Hunold <m.hunold@gmx.de>
4 for the initial saa7146 driver and its recent overhaul
5
6Christian Theiss
7 for his work on the initial Linux DVB driver
8
9Marcus Metzler <mocm@metzlerbros.de>
10Ralph Metzler <rjkm@metzlerbros.de>
11 for their continuing work on the DVB driver
12
13Michael Holzt <kju@debian.org>
14 for his contributions to the dvb-net driver
15
16Diego Picciani <d.picciani@novacomp.it>
17 for CyberLogin for Linux which allows logging onto EON
18 (in case you are wondering where CyberLogin is, EON changed its login
19 procedure and CyberLogin is no longer used.)
20
21Martin Schaller <martin@smurf.franken.de>
22 for patching the cable card decoder driver
23
24Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
25 for various fixes regarding tuning, OSD and CI stuff and his work on VDR
26
27Steve Brown <sbrown@cortland.com>
28 for his AFC kernel thread
29
30Christoph Martin <martin@uni-mainz.de>
31 for his LIRC infrared handler
32
33Andreas Oberritter <obi@linuxtv.org>
34Dennis Noermann <dennis.noermann@noernet.de>
35Felix Domke <tmbinc@elitedvb.net>
36Florian Schirmer <jolt@tuxbox.org>
37Ronny Strutz <3des@elitedvb.de>
38Wolfram Joost <dbox2@frokaschwei.de>
39...and all the other dbox2 people
40 for many bugfixes in the generic DVB Core, frontend drivers and
41 their work on the dbox2 port of the DVB driver
42
43Oliver Endriss <o.endriss@gmx.de>
44 for many bugfixes
45
46Andrew de Quincey <adq_dvb@lidskialf.net>
47 for the tda1004x frontend driver, and various bugfixes
48
49Peter Schildmann <peter.schildmann@web.de>
50 for the driver for the Technisat SkyStar2 PCI DVB card
51
52Vadim Catana <skystar@moldova.cc>
53Roberto Ragusa <r.ragusa@libero.it>
54Augusto Cardoso <augusto@carhil.net>
55 for all the work for the FlexCopII chipset by B2C2,Inc.
56
57Davor Emard <emard@softhome.net>
58 for his work on the budget drivers, the demux code,
59 the module unloading problems, ...
60
61Hans-Frieder Vogt <hfvogt@arcor.de>
62 for his work on calculating and checking the crc's for the
63 TechnoTrend/Hauppauge DEC driver firmware
64
65Michael Dreher <michael@5dot1.de>
66Andreas 'randy' Weinberger
67 for the support of the Fujitsu-Siemens Activy budget DVB-S
68
69Kenneth Aafløy <ke-aa@frisurf.no>
70 for adding support for Typhoon DVB-S budget card
71
72Ernst Peinlich <e.peinlich@inode.at>
73 for tuning/DiSEqC support for the DEC 3000-s
74
75Peter Beutner <p.beutner@gmx.net>
76 for the IR code for the ttusb-dec driver
77
78Wilson Michaels <wilsonmichaels@earthlink.net>
79 for the lgdt330x frontend driver, and various bugfixes
80
81Michael Krufky <mkrufky@linuxtv.org>
82 for maintaining v4l/dvb inter-tree dependencies
83
84Taylor Jacob <rtjacob@earthlink.net>
85 for the nxt2002 frontend driver
86
87Jean-Francois Thibert <jeanfrancois@sagetv.com>
88 for the nxt2004 frontend driver
89
90Kirk Lapray <kirk.lapray@gmail.com>
91 for the or51211 and or51132 frontend drivers, and
92 for merging the nxt2002 and nxt2004 modules into a
93 single nxt200x frontend driver.
94
95(If you think you should be in this list, but you are not, drop a
96 line to the DVB mailing list)
diff --git a/Documentation/dvb/readme.txt b/Documentation/dvb/readme.txt
deleted file mode 100644
index 89965041a266..000000000000
--- a/Documentation/dvb/readme.txt
+++ /dev/null
@@ -1,62 +0,0 @@
1Linux Digital Video Broadcast (DVB) subsystem
2=============================================
3
4The main development site and CVS repository for these
5drivers is https://linuxtv.org.
6
7The developer mailing list linux-dvb is also hosted there,
8see https://linuxtv.org/lists.php. Please check
9the archive https://linuxtv.org/pipermail/linux-dvb/
10and the Wiki https://linuxtv.org/wiki/
11before asking newbie questions on the list.
12
13API documentation, utilities and test/example programs
14are available as part of the old driver package for Linux 2.4
15(linuxtv-dvb-1.0.x.tar.gz), or from CVS (module DVB).
16We plan to split this into separate packages, but it's not
17been done yet.
18
19https://linuxtv.org/downloads/
20
21What's inside this directory:
22
23"avermedia.txt"
24contains detailed information about the
25Avermedia DVB-T cards. See also "bt8xx.txt".
26
27"bt8xx.txt"
28contains detailed information about the
29various bt8xx based "budget" DVB cards.
30
31"cards.txt"
32contains a list of supported hardware.
33
34"ci.txt"
35contains detailed information about the
36CI module as part from TwinHan cards and Clones.
37
38"contributors.txt"
39is the who-is-who of DVB development.
40
41"faq.txt"
42contains frequently asked questions and their answers.
43
44"get_dvb_firmware"
45script to download and extract firmware for those devices
46that require it.
47
48"ttusb-dec.txt"
49contains detailed information about the
50TT DEC2000/DEC3000 USB DVB hardware.
51
52"udev.txt"
53how to get DVB and udev up and running.
54
55"README.dvb-usb"
56contains detailed information about the DVB USB cards.
57
58"README.flexcop"
59contains detailed information about the
60Technisat- and Flexcop B2C2 drivers.
61
62Good luck and have fun!
diff --git a/Documentation/dvb/technisat.txt b/Documentation/dvb/technisat.txt
deleted file mode 100644
index f0cc4f2d8365..000000000000
--- a/Documentation/dvb/technisat.txt
+++ /dev/null
@@ -1,78 +0,0 @@
1How to set up the Technisat/B2C2 Flexcop devices
2================================================
3
41) Find out what device you have
5================================
6
7Important Notice: The driver does NOT support Technisat USB 2 devices!
8
9First start your linux box with a shipped kernel:
10lspci -vvv for a PCI device (lsusb -vvv for an USB device) will show you for example:
1102:0b.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip /
12 Technisat SkyStar2 DVB card (rev 02)
13
14dmesg | grep frontend may show you for example:
15DVB: registering frontend 0 (Conexant CX24123/CX24109)...
16
172) Kernel compilation:
18======================
19
20If the Flexcop / Technisat is the only DVB / TV / Radio device in your box
21 get rid of unnecessary modules and check this one:
22"Multimedia support" => "Customise analog and hybrid tuner modules to build"
23In this directory uncheck every driver which is activated there
24 (except "Simple tuner support" for ATSC 3rd generation only -> see case 9 please).
25
26Then please activate:
272a) Main module part:
28"Multimedia support" => "DVB/ATSC adapters"
29 => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters"
30
31a.) => "Technisat/B2C2 Air/Sky/Cable2PC PCI" (PCI card) or
32b.) => "Technisat/B2C2 Air/Sky/Cable2PC USB" (USB 1.1 adapter)
33 and for troubleshooting purposes:
34c.) => "Enable debug for the B2C2 FlexCop drivers"
35
362b) Frontend / Tuner / Demodulator module part:
37"Multimedia support" => "DVB/ATSC adapters"
38 => "Customise the frontend modules to build" "Customise DVB frontends" =>
39
401.) SkyStar DVB-S Revision 2.3:
41a.) => "Zarlink VP310/MT312/ZL10313 based"
42b.) => "Generic I2C PLL based tuners"
43
442.) SkyStar DVB-S Revision 2.6:
45a.) => "ST STV0299 based"
46b.) => "Generic I2C PLL based tuners"
47
483.) SkyStar DVB-S Revision 2.7:
49a.) => "Samsung S5H1420 based"
50b.) => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS"
51c.) => "ISL6421 SEC controller"
52
534.) SkyStar DVB-S Revision 2.8:
54a.) => "Conexant CX24123 based"
55b.) => "Conexant CX24113/CX24128 tuner for DVB-S/DSS"
56c.) => "ISL6421 SEC controller"
57
585.) AirStar DVB-T card:
59a.) => "Zarlink MT352 based"
60b.) => "Generic I2C PLL based tuners"
61
626.) CableStar DVB-C card:
63a.) => "ST STV0297 based"
64b.) => "Generic I2C PLL based tuners"
65
667.) AirStar ATSC card 1st generation:
67a.) => "Broadcom BCM3510"
68
698.) AirStar ATSC card 2nd generation:
70a.) => "NxtWave Communications NXT2002/NXT2004 based"
71b.) => "Generic I2C PLL based tuners"
72
739.) AirStar ATSC card 3rd generation:
74a.) => "LG Electronics LGDT3302/LGDT3303 based"
75b.) "Multimedia support" => "Customise analog and hybrid tuner modules to build"
76 => "Simple tuner support"
77
78Author: Uwe Bugla <uwe.bugla@gmx.de> August 2009
diff --git a/Documentation/dvb/ttusb-dec.txt b/Documentation/dvb/ttusb-dec.txt
deleted file mode 100644
index b2f271cd784b..000000000000
--- a/Documentation/dvb/ttusb-dec.txt
+++ /dev/null
@@ -1,45 +0,0 @@
1TechnoTrend/Hauppauge DEC USB Driver
2====================================
3
4Driver Status
5-------------
6
7Supported:
8 DEC2000-t
9 DEC2450-t
10 DEC3000-s
11 Linux Kernels 2.4 and 2.6
12 Video Streaming
13 Audio Streaming
14 Section Filters
15 Channel Zapping
16 Hotplug firmware loader under 2.6 kernels
17
18To Do:
19 Tuner status information
20 DVB network interface
21 Streaming video PC->DEC
22 Conax support for 2450-t
23
24Getting the Firmware
25--------------------
26To download the firmware, use the following commands:
27"get_dvb_firmware dec2000t"
28"get_dvb_firmware dec2540t"
29"get_dvb_firmware dec3000s"
30
31
32Compilation Notes for 2.4 kernels
33---------------------------------
34For 2.4 kernels the firmware for the DECs is compiled into the driver itself.
35
36Copy the three files downloaded above into the build-2.4 directory.
37
38
39Hotplug Firmware Loading for 2.6 kernels
40----------------------------------------
41For 2.6 kernels the firmware is loaded at the point that the driver module is
42loaded. See linux/Documentation/dvb/firmware.txt for more information.
43
44Copy the three files downloaded above into the /usr/lib/hotplug/firmware or
45/lib/firmware directory (depending on configuration of firmware hotplug).
diff --git a/Documentation/index.rst b/Documentation/index.rst
index f92854f01773..43c722f15292 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -14,6 +14,10 @@ Contents:
14 :maxdepth: 2 14 :maxdepth: 2
15 15
16 kernel-documentation 16 kernel-documentation
17 media/media_uapi
18 media/media_kapi
19 media/dvb-drivers/index
20 media/v4l-drivers/index
17 21
18Indices and tables 22Indices and tables
19================== 23==================
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
new file mode 100644
index 000000000000..39e2d766dbe3
--- /dev/null
+++ b/Documentation/media/Makefile
@@ -0,0 +1,60 @@
1# Generate the *.h.rst files from uAPI headers
2
3PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
4UAPI = $(srctree)/include/uapi/linux
5KAPI = $(srctree)/include/linux
6SRC_DIR=$(srctree)/Documentation/media
7
8FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
9 videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
10
11TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
12
13htmldocs: $(BUILDDIR) ${TARGETS}
14
15$(BUILDDIR):
16 $(Q)mkdir -p $@
17
18# Rule to convert a .h file to inline RST documentation
19
20gen_rst = \
21 echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
22 ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
23
24quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
25 ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
26
27silent_gen_rst = ${gen_rst}
28
29$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
30 @$($(quiet)gen_rst)
31
32$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
33 @$($(quiet)gen_rst)
34
35$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
36 @$($(quiet)gen_rst)
37
38$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
39 @$($(quiet)gen_rst)
40
41$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
42 @$($(quiet)gen_rst)
43
44$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
45 @$($(quiet)gen_rst)
46
47$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
48 @$($(quiet)gen_rst)
49
50$(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
51 @$($(quiet)gen_rst)
52
53$(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
54 @$($(quiet)gen_rst)
55
56$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
57 @$($(quiet)gen_rst)
58
59cleandocs:
60 -rm ${TARGETS}
diff --git a/Documentation/media/audio.h.rst.exceptions b/Documentation/media/audio.h.rst.exceptions
new file mode 100644
index 000000000000..8330edcd906d
--- /dev/null
+++ b/Documentation/media/audio.h.rst.exceptions
@@ -0,0 +1,20 @@
1# Ignore header name
2ignore define _DVBAUDIO_H_
3
4# Typedef pointing to structs
5replace typedef audio_karaoke_t audio-karaoke
6
7# Undocumented audio caps, as this is a deprecated API anyway
8ignore define AUDIO_CAP_DTS
9ignore define AUDIO_CAP_LPCM
10ignore define AUDIO_CAP_MP1
11ignore define AUDIO_CAP_MP2
12ignore define AUDIO_CAP_MP3
13ignore define AUDIO_CAP_AAC
14ignore define AUDIO_CAP_OGG
15ignore define AUDIO_CAP_SDDS
16ignore define AUDIO_CAP_AC3
17
18# some typedefs should point to struct/enums
19replace typedef audio_mixer_t audio-mixer
20replace typedef audio_status_t audio-status
diff --git a/Documentation/media/ca.h.rst.exceptions b/Documentation/media/ca.h.rst.exceptions
new file mode 100644
index 000000000000..09c13be67527
--- /dev/null
+++ b/Documentation/media/ca.h.rst.exceptions
@@ -0,0 +1,24 @@
1# Ignore header name
2ignore define _DVBCA_H_
3
4# struct ca_slot_info defines
5replace define CA_CI ca-slot-info
6replace define CA_CI_LINK ca-slot-info
7replace define CA_CI_PHYS ca-slot-info
8replace define CA_DESCR ca-slot-info
9replace define CA_SC ca-slot-info
10replace define CA_CI_MODULE_PRESENT ca-slot-info
11replace define CA_CI_MODULE_READY ca-slot-info
12
13# struct ca_descr_info defines
14replace define CA_ECD ca-descr-info
15replace define CA_NDS ca-descr-info
16replace define CA_DSS ca-descr-info
17
18# some typedefs should point to struct/enums
19replace typedef ca_pid_t ca-pid
20replace typedef ca_slot_info_t ca-slot-info
21replace typedef ca_descr_info_t ca-descr-info
22replace typedef ca_caps_t ca-caps
23replace typedef ca_msg_t ca-msg
24replace typedef ca_descr_t ca-descr
diff --git a/Documentation/media/cec.h.rst.exceptions b/Documentation/media/cec.h.rst.exceptions
new file mode 100644
index 000000000000..b79339433718
--- /dev/null
+++ b/Documentation/media/cec.h.rst.exceptions
@@ -0,0 +1,492 @@
1# Ignore header name
2ignore define _CEC_UAPI_H
3
4# Rename some symbols, to avoid namespace conflicts
5replace struct cec_event_state_change cec-event-state-change_s
6replace struct cec_event_lost_msgs cec-event-lost-msgs_s
7replace enum cec_mode_initiator cec-mode-initiator_e
8replace enum cec_mode_follower cec-mode-follower_e
9
10# define macros to ignore
11
12ignore define CEC_MAX_MSG_SIZE
13ignore define CEC_MAX_LOG_ADDRS
14
15ignore define CEC_LOG_ADDR_MASK_TV
16ignore define CEC_LOG_ADDR_MASK_RECORD
17ignore define CEC_LOG_ADDR_MASK_TUNER
18ignore define CEC_LOG_ADDR_MASK_PLAYBACK
19ignore define CEC_LOG_ADDR_MASK_AUDIOSYSTEM
20ignore define CEC_LOG_ADDR_MASK_BACKUP
21ignore define CEC_LOG_ADDR_MASK_SPECIFIC
22ignore define CEC_LOG_ADDR_MASK_UNREGISTERED
23
24# Shouldn't them be documented?
25ignore define CEC_LOG_ADDR_INVALID
26ignore define CEC_PHYS_ADDR_INVALID
27
28ignore define CEC_VENDOR_ID_NONE
29
30ignore define CEC_MODE_INITIATOR_MSK
31ignore define CEC_MODE_FOLLOWER_MSK
32
33ignore define CEC_EVENT_FL_INITIAL_STATE
34
35# Part of CEC 2.0 spec - shouldn't be documented too?
36ignore define CEC_LOG_ADDR_TV
37ignore define CEC_LOG_ADDR_RECORD_1
38ignore define CEC_LOG_ADDR_RECORD_2
39ignore define CEC_LOG_ADDR_TUNER_1
40ignore define CEC_LOG_ADDR_PLAYBACK_1
41ignore define CEC_LOG_ADDR_AUDIOSYSTEM
42ignore define CEC_LOG_ADDR_TUNER_2
43ignore define CEC_LOG_ADDR_TUNER_3
44ignore define CEC_LOG_ADDR_PLAYBACK_2
45ignore define CEC_LOG_ADDR_RECORD_3
46ignore define CEC_LOG_ADDR_TUNER_4
47ignore define CEC_LOG_ADDR_PLAYBACK_3
48ignore define CEC_LOG_ADDR_BACKUP_1
49ignore define CEC_LOG_ADDR_BACKUP_2
50ignore define CEC_LOG_ADDR_SPECIFIC
51ignore define CEC_LOG_ADDR_UNREGISTERED
52ignore define CEC_LOG_ADDR_BROADCAST
53
54# IMHO, those should also be documented
55
56ignore define CEC_MSG_ACTIVE_SOURCE
57ignore define CEC_MSG_IMAGE_VIEW_ON
58ignore define CEC_MSG_TEXT_VIEW_ON
59
60ignore define CEC_MSG_INACTIVE_SOURCE
61ignore define CEC_MSG_REQUEST_ACTIVE_SOURCE
62ignore define CEC_MSG_ROUTING_CHANGE
63ignore define CEC_MSG_ROUTING_INFORMATION
64ignore define CEC_MSG_SET_STREAM_PATH
65
66ignore define CEC_MSG_STANDBY
67
68ignore define CEC_MSG_RECORD_OFF
69ignore define CEC_MSG_RECORD_ON
70
71ignore define CEC_OP_RECORD_SRC_OWN
72ignore define CEC_OP_RECORD_SRC_DIGITAL
73ignore define CEC_OP_RECORD_SRC_ANALOG
74ignore define CEC_OP_RECORD_SRC_EXT_PLUG
75ignore define CEC_OP_RECORD_SRC_EXT_PHYS_ADDR
76
77ignore define CEC_OP_SERVICE_ID_METHOD_BY_DIG_ID
78ignore define CEC_OP_SERVICE_ID_METHOD_BY_CHANNEL
79
80ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_GEN
81ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_GEN
82ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_GEN
83ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_BS
84ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_CS
85ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_T
86ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_CABLE
87ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_SAT
88ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_T
89ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_C
90ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S
91ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S2
92ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_T
93
94ignore define CEC_OP_ANA_BCAST_TYPE_CABLE
95ignore define CEC_OP_ANA_BCAST_TYPE_SATELLITE
96ignore define CEC_OP_ANA_BCAST_TYPE_TERRESTRIAL
97
98ignore define CEC_OP_BCAST_SYSTEM_PAL_BG
99ignore define CEC_OP_BCAST_SYSTEM_SECAM_LQ
100ignore define CEC_OP_BCAST_SYSTEM_PAL_M
101ignore define CEC_OP_BCAST_SYSTEM_NTSC_M
102ignore define CEC_OP_BCAST_SYSTEM_PAL_I
103ignore define CEC_OP_BCAST_SYSTEM_SECAM_DK
104ignore define CEC_OP_BCAST_SYSTEM_SECAM_BG
105ignore define CEC_OP_BCAST_SYSTEM_SECAM_L
106ignore define CEC_OP_BCAST_SYSTEM_PAL_DK
107ignore define CEC_OP_BCAST_SYSTEM_OTHER
108
109ignore define CEC_OP_CHANNEL_NUMBER_FMT_1_PART
110ignore define CEC_OP_CHANNEL_NUMBER_FMT_2_PART
111
112ignore define CEC_MSG_RECORD_STATUS
113
114ignore define CEC_OP_RECORD_STATUS_CUR_SRC
115ignore define CEC_OP_RECORD_STATUS_DIG_SERVICE
116ignore define CEC_OP_RECORD_STATUS_ANA_SERVICE
117ignore define CEC_OP_RECORD_STATUS_EXT_INPUT
118ignore define CEC_OP_RECORD_STATUS_NO_DIG_SERVICE
119ignore define CEC_OP_RECORD_STATUS_NO_ANA_SERVICE
120ignore define CEC_OP_RECORD_STATUS_NO_SERVICE
121ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PLUG
122ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PHYS_ADDR
123ignore define CEC_OP_RECORD_STATUS_UNSUP_CA
124ignore define CEC_OP_RECORD_STATUS_NO_CA_ENTITLEMENTS
125ignore define CEC_OP_RECORD_STATUS_CANT_COPY_SRC
126ignore define CEC_OP_RECORD_STATUS_NO_MORE_COPIES
127ignore define CEC_OP_RECORD_STATUS_NO_MEDIA
128ignore define CEC_OP_RECORD_STATUS_PLAYING
129ignore define CEC_OP_RECORD_STATUS_ALREADY_RECORDING
130ignore define CEC_OP_RECORD_STATUS_MEDIA_PROT
131ignore define CEC_OP_RECORD_STATUS_NO_SIGNAL
132ignore define CEC_OP_RECORD_STATUS_MEDIA_PROBLEM
133ignore define CEC_OP_RECORD_STATUS_NO_SPACE
134ignore define CEC_OP_RECORD_STATUS_PARENTAL_LOCK
135ignore define CEC_OP_RECORD_STATUS_TERMINATED_OK
136ignore define CEC_OP_RECORD_STATUS_ALREADY_TERM
137ignore define CEC_OP_RECORD_STATUS_OTHER
138
139ignore define CEC_MSG_RECORD_TV_SCREEN
140
141ignore define CEC_MSG_CLEAR_ANALOGUE_TIMER
142
143ignore define CEC_OP_REC_SEQ_SUNDAY
144ignore define CEC_OP_REC_SEQ_MONDAY
145ignore define CEC_OP_REC_SEQ_TUESDAY
146ignore define CEC_OP_REC_SEQ_WEDNESDAY
147ignore define CEC_OP_REC_SEQ_THURSDAY
148ignore define CEC_OP_REC_SEQ_FRIDAY
149ignore define CEC_OP_REC_SEQ_SATERDAY
150ignore define CEC_OP_REC_SEQ_ONCE_ONLY
151
152ignore define CEC_MSG_CLEAR_DIGITAL_TIMER
153
154ignore define CEC_MSG_CLEAR_EXT_TIMER
155
156ignore define CEC_OP_EXT_SRC_PLUG
157ignore define CEC_OP_EXT_SRC_PHYS_ADDR
158
159ignore define CEC_MSG_SET_ANALOGUE_TIMER
160ignore define CEC_MSG_SET_DIGITAL_TIMER
161ignore define CEC_MSG_SET_EXT_TIMER
162
163ignore define CEC_MSG_SET_TIMER_PROGRAM_TITLE
164ignore define CEC_MSG_TIMER_CLEARED_STATUS
165
166ignore define CEC_OP_TIMER_CLR_STAT_RECORDING
167ignore define CEC_OP_TIMER_CLR_STAT_NO_MATCHING
168ignore define CEC_OP_TIMER_CLR_STAT_NO_INFO
169ignore define CEC_OP_TIMER_CLR_STAT_CLEARED
170
171ignore define CEC_MSG_TIMER_STATUS
172
173ignore define CEC_OP_TIMER_OVERLAP_WARNING_NO_OVERLAP
174ignore define CEC_OP_TIMER_OVERLAP_WARNING_OVERLAP
175
176ignore define CEC_OP_MEDIA_INFO_UNPROT_MEDIA
177ignore define CEC_OP_MEDIA_INFO_PROT_MEDIA
178ignore define CEC_OP_MEDIA_INFO_NO_MEDIA
179
180ignore define CEC_OP_PROG_IND_NOT_PROGRAMMED
181ignore define CEC_OP_PROG_IND_PROGRAMMED
182
183ignore define CEC_OP_PROG_INFO_ENOUGH_SPACE
184ignore define CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE
185ignore define CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE
186ignore define CEC_OP_PROG_INFO_NONE_AVAILABLE
187
188ignore define CEC_OP_PROG_ERROR_NO_FREE_TIMER
189ignore define CEC_OP_PROG_ERROR_DATE_OUT_OF_RANGE
190ignore define CEC_OP_PROG_ERROR_REC_SEQ_ERROR
191ignore define CEC_OP_PROG_ERROR_INV_EXT_PLUG
192ignore define CEC_OP_PROG_ERROR_INV_EXT_PHYS_ADDR
193ignore define CEC_OP_PROG_ERROR_CA_UNSUPP
194ignore define CEC_OP_PROG_ERROR_INSUF_CA_ENTITLEMENTS
195ignore define CEC_OP_PROG_ERROR_RESOLUTION_UNSUPP
196ignore define CEC_OP_PROG_ERROR_PARENTAL_LOCK
197ignore define CEC_OP_PROG_ERROR_CLOCK_FAILURE
198ignore define CEC_OP_PROG_ERROR_DUPLICATE
199
200ignore define CEC_MSG_CEC_VERSION
201
202ignore define CEC_OP_CEC_VERSION_1_3A
203ignore define CEC_OP_CEC_VERSION_1_4
204ignore define CEC_OP_CEC_VERSION_2_0
205
206ignore define CEC_MSG_GET_CEC_VERSION
207ignore define CEC_MSG_GIVE_PHYSICAL_ADDR
208ignore define CEC_MSG_GET_MENU_LANGUAGE
209ignore define CEC_MSG_REPORT_PHYSICAL_ADDR
210
211ignore define CEC_OP_PRIM_DEVTYPE_TV
212ignore define CEC_OP_PRIM_DEVTYPE_RECORD
213ignore define CEC_OP_PRIM_DEVTYPE_TUNER
214ignore define CEC_OP_PRIM_DEVTYPE_PLAYBACK
215ignore define CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM
216ignore define CEC_OP_PRIM_DEVTYPE_SWITCH
217ignore define CEC_OP_PRIM_DEVTYPE_PROCESSOR
218
219ignore define CEC_MSG_SET_MENU_LANGUAGE
220ignore define CEC_MSG_REPORT_FEATURES
221
222ignore define CEC_OP_ALL_DEVTYPE_TV
223ignore define CEC_OP_ALL_DEVTYPE_RECORD
224ignore define CEC_OP_ALL_DEVTYPE_TUNER
225ignore define CEC_OP_ALL_DEVTYPE_PLAYBACK
226ignore define CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM
227ignore define CEC_OP_ALL_DEVTYPE_SWITCH
228
229ignore define CEC_OP_FEAT_EXT
230
231ignore define CEC_OP_FEAT_RC_TV_PROFILE_NONE
232ignore define CEC_OP_FEAT_RC_TV_PROFILE_1
233ignore define CEC_OP_FEAT_RC_TV_PROFILE_2
234ignore define CEC_OP_FEAT_RC_TV_PROFILE_3
235ignore define CEC_OP_FEAT_RC_TV_PROFILE_4
236ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_ROOT_MENU
237ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_SETUP_MENU
238ignore define CEC_OP_FEAT_RC_SRC_HAS_CONTENTS_MENU
239ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_TOP_MENU
240ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_CONTEXT_MENU
241
242ignore define CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN
243ignore define CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING
244ignore define CEC_OP_FEAT_DEV_HAS_DECK_CONTROL
245ignore define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE
246ignore define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX
247ignore define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX
248
249ignore define CEC_MSG_GIVE_FEATURES
250
251ignore define CEC_MSG_DECK_CONTROL
252
253ignore define CEC_OP_DECK_CTL_MODE_SKIP_FWD
254ignore define CEC_OP_DECK_CTL_MODE_SKIP_REV
255ignore define CEC_OP_DECK_CTL_MODE_STOP
256ignore define CEC_OP_DECK_CTL_MODE_EJECT
257
258ignore define CEC_MSG_DECK_STATUS
259
260ignore define CEC_OP_DECK_INFO_PLAY
261ignore define CEC_OP_DECK_INFO_RECORD
262ignore define CEC_OP_DECK_INFO_PLAY_REV
263ignore define CEC_OP_DECK_INFO_STILL
264ignore define CEC_OP_DECK_INFO_SLOW
265ignore define CEC_OP_DECK_INFO_SLOW_REV
266ignore define CEC_OP_DECK_INFO_FAST_FWD
267ignore define CEC_OP_DECK_INFO_FAST_REV
268ignore define CEC_OP_DECK_INFO_NO_MEDIA
269ignore define CEC_OP_DECK_INFO_STOP
270ignore define CEC_OP_DECK_INFO_SKIP_FWD
271ignore define CEC_OP_DECK_INFO_SKIP_REV
272ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_FWD
273ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_REV
274ignore define CEC_OP_DECK_INFO_OTHER
275
276ignore define CEC_MSG_GIVE_DECK_STATUS
277
278ignore define CEC_OP_STATUS_REQ_ON
279ignore define CEC_OP_STATUS_REQ_OFF
280ignore define CEC_OP_STATUS_REQ_ONCE
281
282ignore define CEC_MSG_PLAY
283
284ignore define CEC_OP_PLAY_MODE_PLAY_FWD
285ignore define CEC_OP_PLAY_MODE_PLAY_REV
286ignore define CEC_OP_PLAY_MODE_PLAY_STILL
287ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MIN
288ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MED
289ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MAX
290ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MIN
291ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MED
292ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MAX
293ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MIN
294ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MED
295ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MAX
296ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MIN
297ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MED
298ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MAX
299
300ignore define CEC_MSG_GIVE_TUNER_DEVICE_STATUS
301ignore define CEC_MSG_SELECT_ANALOGUE_SERVICE
302ignore define CEC_MSG_SELECT_DIGITAL_SERVICE
303ignore define CEC_MSG_TUNER_DEVICE_STATUS
304
305ignore define CEC_OP_REC_FLAG_USED
306ignore define CEC_OP_REC_FLAG_NOT_USED
307
308ignore define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL
309ignore define CEC_OP_TUNER_DISPLAY_INFO_NONE
310ignore define CEC_OP_TUNER_DISPLAY_INFO_ANALOGUE
311
312ignore define CEC_MSG_TUNER_STEP_DECREMENT
313ignore define CEC_MSG_TUNER_STEP_INCREMENT
314
315ignore define CEC_MSG_DEVICE_VENDOR_ID
316ignore define CEC_MSG_GIVE_DEVICE_VENDOR_ID
317ignore define CEC_MSG_VENDOR_COMMAND
318ignore define CEC_MSG_VENDOR_COMMAND_WITH_ID
319ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN
320ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_UP
321
322ignore define CEC_MSG_SET_OSD_STRING
323
324ignore define CEC_OP_DISP_CTL_DEFAULT
325ignore define CEC_OP_DISP_CTL_UNTIL_CLEARED
326ignore define CEC_OP_DISP_CTL_CLEAR
327
328ignore define CEC_MSG_GIVE_OSD_NAME
329ignore define CEC_MSG_SET_OSD_NAME
330
331ignore define CEC_MSG_MENU_REQUEST
332
333ignore define CEC_OP_MENU_REQUEST_ACTIVATE
334ignore define CEC_OP_MENU_REQUEST_DEACTIVATE
335ignore define CEC_OP_MENU_REQUEST_QUERY
336
337ignore define CEC_MSG_MENU_STATUS
338
339ignore define CEC_OP_MENU_STATE_ACTIVATED
340ignore define CEC_OP_MENU_STATE_DEACTIVATED
341
342ignore define CEC_MSG_USER_CONTROL_PRESSED
343
344ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL
345ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA
346ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE
347ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_T
348ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_CABLE
349ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_SAT
350ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL
351ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_T
352ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_CABLE
353ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_SAT
354ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT
355ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT2
356ignore define CEC_OP_UI_BCAST_TYPE_IP
357
358ignore define CEC_OP_UI_SND_PRES_CTL_DUAL_MONO
359ignore define CEC_OP_UI_SND_PRES_CTL_KARAOKE
360ignore define CEC_OP_UI_SND_PRES_CTL_DOWNMIX
361ignore define CEC_OP_UI_SND_PRES_CTL_REVERB
362ignore define CEC_OP_UI_SND_PRES_CTL_EQUALIZER
363ignore define CEC_OP_UI_SND_PRES_CTL_BASS_UP
364ignore define CEC_OP_UI_SND_PRES_CTL_BASS_NEUTRAL
365ignore define CEC_OP_UI_SND_PRES_CTL_BASS_DOWN
366ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_UP
367ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_NEUTRAL
368ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_DOWN
369
370ignore define CEC_MSG_USER_CONTROL_RELEASED
371
372ignore define CEC_MSG_GIVE_DEVICE_POWER_STATUS
373ignore define CEC_MSG_REPORT_POWER_STATUS
374
375ignore define CEC_OP_POWER_STATUS_ON
376ignore define CEC_OP_POWER_STATUS_STANDBY
377ignore define CEC_OP_POWER_STATUS_TO_ON
378ignore define CEC_OP_POWER_STATUS_TO_STANDBY
379
380ignore define CEC_MSG_FEATURE_ABORT
381
382ignore define CEC_OP_ABORT_UNRECOGNIZED_OP
383ignore define CEC_OP_ABORT_INCORRECT_MODE
384ignore define CEC_OP_ABORT_NO_SOURCE
385ignore define CEC_OP_ABORT_INVALID_OP
386ignore define CEC_OP_ABORT_REFUSED
387ignore define CEC_OP_ABORT_UNDETERMINED
388
389ignore define CEC_MSG_ABORT
390
391ignore define CEC_MSG_GIVE_AUDIO_STATUS
392ignore define CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS
393ignore define CEC_MSG_REPORT_AUDIO_STATUS
394
395ignore define CEC_OP_AUD_MUTE_STATUS_OFF
396ignore define CEC_OP_AUD_MUTE_STATUS_ON
397
398ignore define CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR
399ignore define CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR
400ignore define CEC_MSG_SET_SYSTEM_AUDIO_MODE
401
402ignore define CEC_OP_SYS_AUD_STATUS_OFF
403ignore define CEC_OP_SYS_AUD_STATUS_ON
404
405ignore define CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST
406ignore define CEC_MSG_SYSTEM_AUDIO_MODE_STATUS
407
408ignore define CEC_OP_AUD_FMT_ID_CEA861
409ignore define CEC_OP_AUD_FMT_ID_CEA861_CXT
410
411ignore define CEC_MSG_SET_AUDIO_RATE
412
413ignore define CEC_OP_AUD_RATE_OFF
414ignore define CEC_OP_AUD_RATE_WIDE_STD
415ignore define CEC_OP_AUD_RATE_WIDE_FAST
416ignore define CEC_OP_AUD_RATE_WIDE_SLOW
417ignore define CEC_OP_AUD_RATE_NARROW_STD
418ignore define CEC_OP_AUD_RATE_NARROW_FAST
419ignore define CEC_OP_AUD_RATE_NARROW_SLOW
420
421ignore define CEC_MSG_INITIATE_ARC
422ignore define CEC_MSG_REPORT_ARC_INITIATED
423ignore define CEC_MSG_REPORT_ARC_TERMINATED
424ignore define CEC_MSG_REQUEST_ARC_INITIATION
425ignore define CEC_MSG_REQUEST_ARC_TERMINATION
426ignore define CEC_MSG_TERMINATE_ARC
427
428ignore define CEC_MSG_REQUEST_CURRENT_LATENCY
429ignore define CEC_MSG_REPORT_CURRENT_LATENCY
430
431ignore define CEC_OP_LOW_LATENCY_MODE_OFF
432ignore define CEC_OP_LOW_LATENCY_MODE_ON
433
434ignore define CEC_OP_AUD_OUT_COMPENSATED_NA
435ignore define CEC_OP_AUD_OUT_COMPENSATED_DELAY
436ignore define CEC_OP_AUD_OUT_COMPENSATED_NO_DELAY
437ignore define CEC_OP_AUD_OUT_COMPENSATED_PARTIAL_DELAY
438
439ignore define CEC_MSG_CDC_MESSAGE
440
441ignore define CEC_MSG_CDC_HEC_INQUIRE_STATE
442ignore define CEC_MSG_CDC_HEC_REPORT_STATE
443
444ignore define CEC_OP_HEC_FUNC_STATE_NOT_SUPPORTED
445ignore define CEC_OP_HEC_FUNC_STATE_INACTIVE
446ignore define CEC_OP_HEC_FUNC_STATE_ACTIVE
447ignore define CEC_OP_HEC_FUNC_STATE_ACTIVATION_FIELD
448
449ignore define CEC_OP_HOST_FUNC_STATE_NOT_SUPPORTED
450ignore define CEC_OP_HOST_FUNC_STATE_INACTIVE
451ignore define CEC_OP_HOST_FUNC_STATE_ACTIVE
452
453ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_NOT_SUPPORTED
454ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_INACTIVE
455ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_ACTIVE
456
457ignore define CEC_OP_CDC_ERROR_CODE_NONE
458ignore define CEC_OP_CDC_ERROR_CODE_CAP_UNSUPPORTED
459ignore define CEC_OP_CDC_ERROR_CODE_WRONG_STATE
460ignore define CEC_OP_CDC_ERROR_CODE_OTHER
461
462ignore define CEC_OP_HEC_SUPPORT_NO
463ignore define CEC_OP_HEC_SUPPORT_YES
464
465ignore define CEC_OP_HEC_ACTIVATION_ON
466ignore define CEC_OP_HEC_ACTIVATION_OFF
467
468ignore define CEC_MSG_CDC_HEC_SET_STATE_ADJACENT
469ignore define CEC_MSG_CDC_HEC_SET_STATE
470
471ignore define CEC_OP_HEC_SET_STATE_DEACTIVATE
472ignore define CEC_OP_HEC_SET_STATE_ACTIVATE
473
474ignore define CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION
475ignore define CEC_MSG_CDC_HEC_NOTIFY_ALIVE
476ignore define CEC_MSG_CDC_HEC_DISCOVER
477
478ignore define CEC_MSG_CDC_HPD_SET_STATE
479
480ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE
481ignore define CEC_OP_HPD_STATE_CP_EDID_ENABLE
482ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE_ENABLE
483ignore define CEC_OP_HPD_STATE_EDID_DISABLE
484ignore define CEC_OP_HPD_STATE_EDID_ENABLE
485ignore define CEC_OP_HPD_STATE_EDID_DISABLE_ENABLE
486ignore define CEC_MSG_CDC_HPD_REPORT_STATE
487
488ignore define CEC_OP_HPD_ERROR_NONE
489ignore define CEC_OP_HPD_ERROR_INITIATOR_NOT_CAPABLE
490ignore define CEC_OP_HPD_ERROR_INITIATOR_WRONG_STATE
491ignore define CEC_OP_HPD_ERROR_OTHER
492ignore define CEC_OP_HPD_ERROR_NONE_NO_VIDEO
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/dmx.h.rst.exceptions
new file mode 100644
index 000000000000..8200653839d2
--- /dev/null
+++ b/Documentation/media/dmx.h.rst.exceptions
@@ -0,0 +1,63 @@
1# Ignore header name
2ignore define _UAPI_DVBDMX_H_
3
4# Ignore limit constants
5ignore define DMX_FILTER_SIZE
6
7# dmx-pes-type-t enum symbols
8replace enum dmx_ts_pes dmx-pes-type-t
9replace symbol DMX_PES_AUDIO0 dmx-pes-type-t
10replace symbol DMX_PES_VIDEO0 dmx-pes-type-t
11replace symbol DMX_PES_TELETEXT0 dmx-pes-type-t
12replace symbol DMX_PES_SUBTITLE0 dmx-pes-type-t
13replace symbol DMX_PES_PCR0 dmx-pes-type-t
14replace symbol DMX_PES_AUDIO1 dmx-pes-type-t
15replace symbol DMX_PES_VIDEO1 dmx-pes-type-t
16replace symbol DMX_PES_TELETEXT1 dmx-pes-type-t
17replace symbol DMX_PES_SUBTITLE1 dmx-pes-type-t
18replace symbol DMX_PES_PCR1 dmx-pes-type-t
19replace symbol DMX_PES_AUDIO2 dmx-pes-type-t
20replace symbol DMX_PES_VIDEO2 dmx-pes-type-t
21replace symbol DMX_PES_TELETEXT2 dmx-pes-type-t
22replace symbol DMX_PES_SUBTITLE2 dmx-pes-type-t
23replace symbol DMX_PES_PCR2 dmx-pes-type-t
24replace symbol DMX_PES_AUDIO3 dmx-pes-type-t
25replace symbol DMX_PES_VIDEO3 dmx-pes-type-t
26replace symbol DMX_PES_TELETEXT3 dmx-pes-type-t
27replace symbol DMX_PES_SUBTITLE3 dmx-pes-type-t
28replace symbol DMX_PES_PCR3 dmx-pes-type-t
29replace symbol DMX_PES_OTHER dmx-pes-type-t
30
31# Ignore obsolete symbols
32ignore define DMX_PES_AUDIO
33ignore define DMX_PES_VIDEO
34ignore define DMX_PES_TELETEXT
35ignore define DMX_PES_SUBTITLE
36ignore define DMX_PES_PCR
37
38# dmx_input_t symbols
39replace enum dmx_input dmx-input-t
40replace symbol DMX_IN_FRONTEND dmx-input-t
41replace symbol DMX_IN_DVR dmx-input-t
42
43# dmx_source_t symbols
44replace enum dmx_source dmx-source-t
45replace symbol DMX_SOURCE_FRONT0 dmx-source-t
46replace symbol DMX_SOURCE_FRONT1 dmx-source-t
47replace symbol DMX_SOURCE_FRONT2 dmx-source-t
48replace symbol DMX_SOURCE_FRONT3 dmx-source-t
49replace symbol DMX_SOURCE_DVR0 dmx-source-t
50replace symbol DMX_SOURCE_DVR1 dmx-source-t
51replace symbol DMX_SOURCE_DVR2 dmx-source-t
52replace symbol DMX_SOURCE_DVR3 dmx-source-t
53
54
55# Flags for struct dmx_sct_filter_params
56replace define DMX_CHECK_CRC dmx-sct-filter-params
57replace define DMX_ONESHOT dmx-sct-filter-params
58replace define DMX_IMMEDIATE_START dmx-sct-filter-params
59replace define DMX_KERNEL_CLIENT dmx-sct-filter-params
60
61# some typedefs should point to struct/enums
62replace typedef dmx_caps_t dmx-caps
63replace typedef dmx_filter_t dmx-filter
diff --git a/Documentation/media/dvb-drivers/avermedia.rst b/Documentation/media/dvb-drivers/avermedia.rst
new file mode 100644
index 000000000000..49cd9c935307
--- /dev/null
+++ b/Documentation/media/dvb-drivers/avermedia.rst
@@ -0,0 +1,267 @@
1HOWTO: Get An Avermedia DVB-T working under Linux
2-------------------------------------------------
3
4February 14th 2006
5
6.. note::
7
8 This documentation is outdated. Please check at the DVB wiki
9 at https://linuxtv.org/wiki for more updated info.
10
11 There's a section there specific for Avermedia boards at:
12 https://linuxtv.org/wiki/index.php/AVerMedia
13
14
15Assumptions and Introduction
16~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
18It is assumed that the reader understands the basic structure
19of the Linux Kernel DVB drivers and the general principles of
20Digital TV.
21
22One significant difference between Digital TV and Analogue TV
23that the unwary (like myself) should consider is that,
24although the component structure of budget DVB-T cards are
25substantially similar to Analogue TV cards, they function in
26substantially different ways.
27
28The purpose of an Analogue TV is to receive and display an
29Analogue Television signal. An Analogue TV signal (otherwise
30known as composite video) is an analogue encoding of a
31sequence of image frames (25 per second) rasterised using an
32interlacing technique. Interlacing takes two fields to
33represent one frame. Computers today are at their best when
34dealing with digital signals, not analogue signals and a
35composite video signal is about as far removed from a digital
36data stream as you can get. Therefore, an Analogue TV card for
37a PC has the following purpose:
38
39* Tune the receiver to receive a broadcast signal
40* demodulate the broadcast signal
41* demultiplex the analogue video signal and analogue audio
42 signal. **NOTE:** some countries employ a digital audio signal
43 embedded within the modulated composite analogue signal -
44 NICAM.)
45* digitize the analogue video signal and make the resulting
46 datastream available to the data bus.
47
48The digital datastream from an Analogue TV card is generated
49by circuitry on the card and is often presented uncompressed.
50For a PAL TV signal encoded at a resolution of 768x576 24-bit
51color pixels over 25 frames per second - a fair amount of data
52is generated and must be processed by the PC before it can be
53displayed on the video monitor screen. Some Analogue TV cards
54for PCs have onboard MPEG2 encoders which permit the raw
55digital data stream to be presented to the PC in an encoded
56and compressed form - similar to the form that is used in
57Digital TV.
58
59The purpose of a simple budget digital TV card (DVB-T,C or S)
60is to simply:
61
62* Tune the received to receive a broadcast signal.
63* Extract the encoded digital datastream from the broadcast
64 signal.
65* Make the encoded digital datastream (MPEG2) available to
66 the data bus.
67
68The significant difference between the two is that the tuner
69on the analogue TV card spits out an Analogue signal, whereas
70the tuner on the digital TV card spits out a compressed
71encoded digital datastream. As the signal is already
72digitised, it is trivial to pass this datastream to the PC
73databus with minimal additional processing and then extract
74the digital video and audio datastreams passing them to the
75appropriate software or hardware for decoding and viewing.
76
77The Avermedia DVB-T
78~~~~~~~~~~~~~~~~~~~
79
80The Avermedia DVB-T is a budget PCI DVB card. It has 3 inputs:
81
82* RF Tuner Input
83* Composite Video Input (RCA Jack)
84* SVIDEO Input (Mini-DIN)
85
86The RF Tuner Input is the input to the tuner module of the
87card. The Tuner is otherwise known as the "Frontend" . The
88Frontend of the Avermedia DVB-T is a Microtune 7202D. A timely
89post to the linux-dvb mailing list ascertained that the
90Microtune 7202D is supported by the sp887x driver which is
91found in the dvb-hw CVS module.
92
93The DVB-T card is based around the BT878 chip which is a very
94common multimedia bridge and often found on Analogue TV cards.
95There is no on-board MPEG2 decoder, which means that all MPEG2
96decoding must be done in software, or if you have one, on an
97MPEG2 hardware decoding card or chipset.
98
99
100Getting the card going
101~~~~~~~~~~~~~~~~~~~~~~
102
103In order to fire up the card, it is necessary to load a number
104of modules from the DVB driver set. Prior to this it will have
105been necessary to download these drivers from the linuxtv CVS
106server and compile them successfully.
107
108Depending on the card's feature set, the Device Driver API for
109DVB under Linux will expose some of the following device files
110in the /dev tree:
111
112* /dev/dvb/adapter0/audio0
113* /dev/dvb/adapter0/ca0
114* /dev/dvb/adapter0/demux0
115* /dev/dvb/adapter0/dvr0
116* /dev/dvb/adapter0/frontend0
117* /dev/dvb/adapter0/net0
118* /dev/dvb/adapter0/osd0
119* /dev/dvb/adapter0/video0
120
121The primary device nodes that we are interested in (at this
122stage) for the Avermedia DVB-T are:
123
124* /dev/dvb/adapter0/dvr0
125* /dev/dvb/adapter0/frontend0
126
127The dvr0 device node is used to read the MPEG2 Data Stream and
128the frontend0 node is used to tune the frontend tuner module.
129
130At this stage, it has not been able to ascertain the
131functionality of the remaining device nodes in respect of the
132Avermedia DVBT. However, full functionality in respect of
133tuning, receiving and supplying the MPEG2 data stream is
134possible with the currently available versions of the driver.
135It may be possible that additional functionality is available
136from the card (i.e. viewing the additional analogue inputs
137that the card presents), but this has not been tested yet. If
138I get around to this, I'll update the document with whatever I
139find.
140
141To power up the card, load the following modules in the
142following order:
143
144* modprobe bttv (normally loaded automatically)
145* modprobe dvb-bt8xx (or place dvb-bt8xx in /etc/modules)
146
147Insertion of these modules into the running kernel will
148activate the appropriate DVB device nodes. It is then possible
149to start accessing the card with utilities such as scan, tzap,
150dvbstream etc.
151
152The frontend module sp887x.o, requires an external firmware.
153Please use the command "get_dvb_firmware sp887x" to download
154it. Then copy it to /usr/lib/hotplug/firmware or /lib/firmware/
155(depending on configuration of firmware hotplug).
156
157Receiving DVB-T in Australia
158~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159
160I have no experience of DVB-T in other countries other than
161Australia, so I will attempt to explain how it works here in
162Melbourne and how this affects the configuration of the DVB-T
163card.
164
165The Digital Broadcasting Australia website has a Reception
166locatortool which provides information on transponder channels
167and frequencies. My local transmitter happens to be Mount
168Dandenong.
169
170The frequencies broadcast by Mount Dandenong are:
171
172Table 1. Transponder Frequencies Mount Dandenong, Vic, Aus.
173Broadcaster Channel Frequency
174ABC VHF 12 226.5 MHz
175TEN VHF 11 219.5 MHz
176NINE VHF 8 191.625 MHz
177SEVEN VHF 6 177.5 MHz
178SBS UHF 29 536.5 MHz
179
180The Scan utility has a set of compiled-in defaults for various
181countries and regions, but if they do not suit, or if you have
182a pre-compiled scan binary, you can specify a data file on the
183command line which contains the transponder frequencies. Here
184is a sample file for the above channel transponders:
185
186::
187
188 # Data file for DVB scan program
189 #
190 # C Frequency SymbolRate FEC QAM
191 # S Frequency Polarisation SymbolRate FEC
192 # T Frequency Bandwidth FEC FEC2 QAM Mode Guard Hier
193 T 226500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
194 T 191625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
195 T 219500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
196 T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
197 T 536500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
198
199The defaults for the transponder frequency and other
200modulation parameters were obtained from www.dba.org.au.
201
202When Scan runs, it will output channels.conf information for
203any channel's transponders which the card's frontend can lock
204onto. (i.e. any whose signal is strong enough at your
205antenna).
206
207Here's my channels.conf file for anyone who's interested:
208
209::
210
211 ABC HDTV:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2307:0:560
212 ABC TV Melbourne:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:561
213 ABC TV 2:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:562
214 ABC TV 3:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:563
215 ABC TV 4:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:564
216 ABC DiG Radio:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:2311:566
217 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1585
218 TEN Digital 1:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1586
219 TEN Digital 2:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1587
220 TEN Digital 3:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1588
221 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1589
222 TEN Digital 4:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1590
223 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1591
224 TEN HD:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:0:1592
225 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1593
226 Nine Digital:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:513:660:1072
227 Nine Digital HD:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:0:1073
228 Nine Guide:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:670:1074
229 7 Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1328
230 7 Digital 1:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1329
231 7 Digital 2:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1330
232 7 Digital 3:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1331
233 7 HD Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:833:834:1332
234 7 Program Guide:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:865:866:1334
235 SBS HD:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:102:103:784
236 SBS DIGITAL 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:161:81:785
237 SBS DIGITAL 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:162:83:786
238 SBS EPG:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:163:85:787
239 SBS RADIO 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:201:798
240 SBS RADIO 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:202:799
241
242Known Limitations
243~~~~~~~~~~~~~~~~~
244
245At present I can say with confidence that the frontend tunes
246via /dev/dvb/adapter{x}/frontend0 and supplies an MPEG2 stream
247via /dev/dvb/adapter{x}/dvr0. I have not tested the
248functionality of any other part of the card yet. I will do so
249over time and update this document.
250
251There are some limitations in the i2c layer due to a returned
252error message inconsistency. Although this generates errors in
253dmesg and the system logs, it does not appear to affect the
254ability of the frontend to function correctly.
255
256Further Update
257~~~~~~~~~~~~~~
258
259dvbstream and VideoLAN Client on windows works a treat with
260DVB, in fact this is currently serving as my main way of
261viewing DVB-T at the moment. Additionally, VLC is happily
262decoding HDTV signals, although the PC is dropping the odd
263frame here and there - I assume due to processing capability -
264as all the decoding is being done under windows in software.
265
266Many thanks to Nigel Pearson for the updates to this document
267since the recent revision of the driver.
diff --git a/Documentation/media/dvb-drivers/bt8xx.rst b/Documentation/media/dvb-drivers/bt8xx.rst
new file mode 100644
index 000000000000..b43958b7340c
--- /dev/null
+++ b/Documentation/media/dvb-drivers/bt8xx.rst
@@ -0,0 +1,122 @@
1How to get the bt8xx cards working
2==================================
3
4Authors: Richard Walker,
5 Jamie Honan,
6 Michael Hunold,
7 Manu Abraham,
8 Uwe Bugla,
9 Michael Krufky
10
11.. note::
12
13 This documentation is outdated. Please check at the DVB wiki
14 at https://linuxtv.org/wiki for more updated info.
15
16General information
17-------------------
18
19This class of cards has a bt878a as the PCI interface, and require the bttv driver
20for accessing the i2c bus and the gpio pins of the bt8xx chipset.
21Please see Documentation/dvb/cards.txt => o Cards based on the Conexant Bt8xx PCI bridge:
22
23Compiling kernel please enable:
24
25#) ``Device drivers`` => ``Multimedia devices`` => ``Video For Linux`` => ``Enable Video for Linux API 1 (DEPRECATED)``
26#) ``Device drivers`` => ``Multimedia devices`` => ``Video For Linux`` => ``Video Capture Adapters`` => ``BT848 Video For Linux``
27#) ``Device drivers`` => ``Multimedia devices`` => ``Digital Video Broadcasting Devices`` => ``DVB for Linux`` ``DVB Core Support`` ``Bt8xx based PCI Cards``
28
29 Please use the following options with care as deselection of drivers which are in fact necessary may result in DVB devices that cannot be tuned due to lack of driver support:
30 You can save RAM by deselecting every frontend module that your DVB card does not need.
31
32 First please remove the static dependency of DVB card drivers on all frontend modules for all possible card variants by enabling:
33
34#) ``Device drivers`` => ``Multimedia devices`` => ``Digital Video Broadcasting Devices`` => ``DVB for Linux`` ``DVB Core Support`` ``Load and attach frontend modules as needed``
35
36 If you know the frontend driver that your card needs please enable:
37
38#) ``Device drivers`` => ``Multimedia devices`` => ``Digital Video Broadcasting Devices`` => ``DVB for Linux`` ``DVB Core Support`` ``Customise DVB Frontends`` => ``Customise the frontend modules to build``
39
40 Then please select your card-specific frontend module.
41
42Loading Modules
43---------------
44
45Regular case: If the bttv driver detects a bt8xx-based DVB card, all frontend and backend modules will be loaded automatically.
46Exceptions are:
47- Old TwinHan DST cards or clones with or without CA slot and not containing an Eeprom.
48People running udev please see Documentation/dvb/udev.txt.
49
50In the following cases overriding the PCI type detection for dvb-bt8xx might be necessary:
51
52Running TwinHan and Clones
53~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55.. code-block:: none
56
57 $ modprobe bttv card=113
58 $ modprobe dst
59
60Useful parameters for verbosity level and debugging the dst module:
61
62.. code-block:: none
63
64 verbose=0: messages are disabled
65 1: only error messages are displayed
66 2: notifications are displayed
67 3: other useful messages are displayed
68 4: debug setting
69 dst_addons=0: card is a free to air (FTA) card only
70 0x20: card has a conditional access slot for scrambled channels
71
72The autodetected values are determined by the cards' "response string".
73In your logs see f. ex.: dst_get_device_id: Recognize [DSTMCI].
74For bug reports please send in a complete log with verbose=4 activated.
75Please also see Documentation/dvb/ci.txt.
76
77Running multiple cards
78~~~~~~~~~~~~~~~~~~~~~~
79
80Examples of card ID's:
81
82.. code-block:: none
83
84 Pinnacle PCTV Sat: 94
85 Nebula Electronics Digi TV: 104
86 pcHDTV HD-2000 TV: 112
87 Twinhan DST and clones: 113
88 Avermedia AverTV DVB-T 771: 123
89 Avermedia AverTV DVB-T 761: 124
90 DViCO FusionHDTV DVB-T Lite: 128
91 DViCO FusionHDTV 5 Lite: 135
92
93.. note::
94
95 The order of the card ID should be uprising:
96
97 Example:
98
99 .. code-block:: none
100
101 $ modprobe bttv card=113 card=135
102
103For a full list of card ID's please see Documentation/video4linux/CARDLIST.bttv.
104In case of further problems please subscribe and send questions to the mailing list: linux-dvb@linuxtv.org.
105
106Probing the cards with broken PCI subsystem ID
107~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
109There are some TwinHan cards that the EEPROM has become corrupted for some
110reason. The cards do not have correct PCI subsystem ID. But we can force
111probing the cards with broken PCI subsystem ID
112
113.. code-block:: none
114
115 $ echo 109e 0878 $subvendor $subdevice > \
116 /sys/bus/pci/drivers/bt878/new_id
117
118.. code-block:: none
119
120 109e: PCI_VENDOR_ID_BROOKTREE
121 0878: PCI_DEVICE_ID_BROOKTREE_878
122
diff --git a/Documentation/dvb/cards.txt b/Documentation/media/dvb-drivers/cards.rst
index 97709e9a3076..177cbeb2b561 100644
--- a/Documentation/dvb/cards.txt
+++ b/Documentation/media/dvb-drivers/cards.rst
@@ -1,23 +1,36 @@
1Hardware supported by the linuxtv.org DVB drivers 1Hardware supported by the linuxtv.org DVB drivers
2================================================= 2=================================================
3 3
4 Generally, the DVB hardware manufacturers frequently change the 4.. note::
5 frontends (i.e. tuner / demodulator units) used, usually without
6 changing the product name, revision number or specs. Some cards
7 are also available in versions with different frontends for
8 DVB-S/DVB-C/DVB-T. Thus the frontend drivers are listed separately.
9 5
10 Note 1: There is no guarantee that every frontend driver works 6 This documentation is outdated. Please check at the DVB wiki
11 out of the box with every card, because of different wiring. 7 at https://linuxtv.org/wiki for more updated info.
12 8
13 Note 2: The demodulator chips can be used with a variety of 9 Please look at
14 tuner/PLL chips, and not all combinations are supported. Often 10 https://linuxtv.org/wiki/index.php/Hardware_Device_Information
15 the demodulator and tuner/PLL chip are inside a metal box for 11 for an updated list of supported cards.
16 shielding, and the whole metal box has its own part number.
17 12
13Generally, the DVB hardware manufacturers frequently change the
14frontends (i.e. tuner / demodulator units) used, usually without
15changing the product name, revision number or specs. Some cards
16are also available in versions with different frontends for
17DVB-S/DVB-C/DVB-T. Thus the frontend drivers are listed separately.
18
19.. note::
20
21 #) There is no guarantee that every frontend driver works
22 out of the box with every card, because of different wiring.
23
24 #) The demodulator chips can be used with a variety of
25 tuner/PLL chips, and not all combinations are supported. Often
26 the demodulator and tuner/PLL chip are inside a metal box for
27 shielding, and the whole metal box has its own part number.
28
29
30- Frontends drivers:
18 31
19o Frontends drivers:
20 - dvb_dummy_fe: for testing... 32 - dvb_dummy_fe: for testing...
33
21 DVB-S: 34 DVB-S:
22 - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993) 35 - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993)
23 - cx24110 : Conexant HM1221/HM1811 (cx24110 or cx24106 demod, cx24108 PLL) 36 - cx24110 : Conexant HM1221/HM1811 (cx24110 or cx24106 demod, cx24108 PLL)
@@ -26,21 +39,23 @@ o Frontends drivers:
26 - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL), 39 - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL),
27 LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), 40 LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL),
28 Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB, Technisat Sky2Pc with bios Rev. 2.6 41 Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB, Technisat Sky2Pc with bios Rev. 2.6
42
29 DVB-C: 43 DVB-C:
30 - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL) 44 - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL)
31 - at76c651 : Atmel AT76c651(B) with DAT7021 PLL 45 - at76c651 : Atmel AT76c651(B) with DAT7021 PLL
46
32 DVB-T: 47 DVB-T:
33 - alps_tdlb7 : Alps TDLB7 (sp8870 demodulator, sp5659 PLL) 48 - alps_tdlb7 : Alps TDLB7 (sp8870 demodulator, sp5659 PLL)
34 - alps_tdmb7 : Alps TDMB7 (cx22700 demodulator) 49 - alps_tdmb7 : Alps TDMB7 (cx22700 demodulator)
35 - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL 50 - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL
36 - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL) 51 - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL)
37 - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL), 52 - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL), Comtech DVBT-6k07 (SP5730 PLL), (NxtWave Communications NXT6000 demodulator)
38 Comtech DVBT-6k07 (SP5730 PLL)
39 (NxtWave Communications NXT6000 demodulator)
40 - sp887x : Microtune 7202D 53 - sp887x : Microtune 7202D
41 - dib3000mb : DiBcom 3000-MB demodulator 54 - dib3000mb : DiBcom 3000-MB demodulator
55
42 DVB-S/C/T: 56 DVB-S/C/T:
43 - dst : TwinHan DST Frontend 57 - dst : TwinHan DST Frontend
58
44 ATSC: 59 ATSC:
45 - nxt200x : Nxtwave NXT2002 & NXT2004 60 - nxt200x : Nxtwave NXT2002 & NXT2004
46 - or51211 : or51211 based (pcHDTV HD2000 card) 61 - or51211 : or51211 based (pcHDTV HD2000 card)
@@ -49,10 +64,10 @@ o Frontends drivers:
49 - lgdt330x : LG Electronics DT3302 & DT3303 64 - lgdt330x : LG Electronics DT3302 & DT3303
50 65
51 66
52o Cards based on the Phillips saa7146 multimedia PCI bridge chip: 67- Cards based on the Phillips saa7146 multimedia PCI bridge chip:
68
53 - TI AV7110 based cards (i.e. with hardware MPEG decoder): 69 - TI AV7110 based cards (i.e. with hardware MPEG decoder):
54 - Siemens/Technotrend/Hauppauge PCI DVB card revision 1.1, 1.3, 1.5, 1.6, 2.1 70 - Siemens/Technotrend/Hauppauge PCI DVB card revision 1.1, 1.3, 1.5, 1.6, 2.1 (aka Hauppauge Nexus)
55 (aka Hauppauge Nexus)
56 - "budget" cards (i.e. without hardware MPEG decoder): 71 - "budget" cards (i.e. without hardware MPEG decoder):
57 - Technotrend Budget / Hauppauge WinTV-Nova PCI Cards 72 - Technotrend Budget / Hauppauge WinTV-Nova PCI Cards
58 - SATELCO Multimedia PCI 73 - SATELCO Multimedia PCI
@@ -60,10 +75,12 @@ o Cards based on the Phillips saa7146 multimedia PCI bridge chip:
60 - Typhoon DVB-S budget 75 - Typhoon DVB-S budget
61 - Fujitsu-Siemens Activy DVB-S budget card 76 - Fujitsu-Siemens Activy DVB-S budget card
62 77
63o Cards based on the B2C2 Inc. FlexCopII/IIb/III: 78- Cards based on the B2C2 Inc. FlexCopII/IIb/III:
79
64 - Technisat SkyStar2 PCI DVB card revision 2.3, 2.6B, 2.6C 80 - Technisat SkyStar2 PCI DVB card revision 2.3, 2.6B, 2.6C
65 81
66o Cards based on the Conexant Bt8xx PCI bridge: 82- Cards based on the Conexant Bt8xx PCI bridge:
83
67 - Pinnacle PCTV Sat DVB 84 - Pinnacle PCTV Sat DVB
68 - Nebula Electronics DigiTV 85 - Nebula Electronics DigiTV
69 - TwinHan DST 86 - TwinHan DST
@@ -73,11 +90,13 @@ o Cards based on the Conexant Bt8xx PCI bridge:
73 - DViCO FusionHDTV DVB-T Lite 90 - DViCO FusionHDTV DVB-T Lite
74 - DViCO FusionHDTV5 Lite 91 - DViCO FusionHDTV5 Lite
75 92
76o Technotrend / Hauppauge DVB USB devices: 93- Technotrend / Hauppauge DVB USB devices:
94
77 - Nova USB 95 - Nova USB
78 - DEC 2000-T, 3000-S, 2540-T 96 - DEC 2000-T, 3000-S, 2540-T
79 97
80o DiBcom DVB-T USB based devices: 98- DiBcom DVB-T USB based devices:
99
81 - Twinhan VisionPlus VisionDTV USB-Ter DVB-T Device 100 - Twinhan VisionPlus VisionDTV USB-Ter DVB-T Device
82 - HAMA DVB-T USB device 101 - HAMA DVB-T USB device
83 - CTS Portable (Chinese Television System) 102 - CTS Portable (Chinese Television System)
@@ -92,9 +111,10 @@ o DiBcom DVB-T USB based devices:
92 - Yakumo DVB-T mobile USB2.0 111 - Yakumo DVB-T mobile USB2.0
93 - DiBcom USB2.0 DVB-T reference device (non-public) 112 - DiBcom USB2.0 DVB-T reference device (non-public)
94 113
95o Experimental support for the analog module of the Siemens DVB-C PCI card 114- Experimental support for the analog module of the Siemens DVB-C PCI card
115
116- Cards based on the Conexant cx2388x PCI bridge:
96 117
97o Cards based on the Conexant cx2388x PCI bridge:
98 - ADS Tech Instant TV DVB-T PCI 118 - ADS Tech Instant TV DVB-T PCI
99 - ATI HDTV Wonder 119 - ATI HDTV Wonder
100 - digitalnow DNTV Live! DVB-T 120 - digitalnow DNTV Live! DVB-T
@@ -109,7 +129,8 @@ o Cards based on the Conexant cx2388x PCI bridge:
109 - TerraTec Cinergy 1400 DVB-T 129 - TerraTec Cinergy 1400 DVB-T
110 - WinFast DTV1000-T 130 - WinFast DTV1000-T
111 131
112o Cards based on the Phillips saa7134 PCI bridge: 132- Cards based on the Phillips saa7134 PCI bridge:
133
113 - Medion 7134 134 - Medion 7134
114 - Pinnacle PCTV 300i DVB-T + PAL 135 - Pinnacle PCTV 300i DVB-T + PAL
115 - LifeView FlyDVB-T DUO 136 - LifeView FlyDVB-T DUO
diff --git a/Documentation/dvb/ci.txt b/Documentation/media/dvb-drivers/ci.rst
index 6c3bda50f7dc..8124bf5ce5ef 100644
--- a/Documentation/dvb/ci.txt
+++ b/Documentation/media/dvb-drivers/ci.rst
@@ -1,52 +1,68 @@
1* For the user 1Digital TV Conditional Access Interface (CI API)
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2================================================
3NOTE: This document describes the usage of the high level CI API as 3
4
5.. note::
6
7 This documentation is outdated.
8
9This document describes the usage of the high level CI API as
4in accordance to the Linux DVB API. This is a not a documentation for the, 10in accordance to the Linux DVB API. This is a not a documentation for the,
5existing low level CI API. 11existing low level CI API.
6~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 12
8To utilize the High Level CI capabilities, 13.. note::
14
15 For the Twinhan/Twinhan clones, the dst_ca module handles the CI
16 hardware handling.This module is loaded automatically if a CI
17 (Common Interface, that holds the CAM (Conditional Access Module)
18 is detected.
9 19
10(1*) This point is valid only for the Twinhan/clones 20ca_zap
11 For the Twinhan/Twinhan clones, the dst_ca module handles the CI 21~~~~~~
12 hardware handling.This module is loaded automatically if a CI
13 (Common Interface, that holds the CAM (Conditional Access Module)
14 is detected.
15 22
16(2) one requires a userspace application, ca_zap. This small userland 23An userspace application, like ``ca_zap`` is required to handle encrypted
17 application is in charge of sending the descrambling related information 24MPEG-TS streams.
18 to the CAM. 25
26The ``ca_zap`` userland application is in charge of sending the
27descrambling related information to the Conditional Access Module (CAM).
19 28
20This application requires the following to function properly as of now. 29This application requires the following to function properly as of now.
21 30
22 (a) Tune to a valid channel, with szap. 31a) Tune to a valid channel, with szap.
23 eg: $ szap -c channels.conf -r "TMC" -x 32
33 eg: $ szap -c channels.conf -r "TMC" -x
34
35b) a channels.conf containing a valid PMT PID
36
37 eg: TMC:11996:h:0:27500:278:512:650:321
38
39 here 278 is a valid PMT PID. the rest of the values are the
40 same ones that szap uses.
24 41
25 (b) a channels.conf containing a valid PMT PID 42c) after running a szap, you have to run ca_zap, for the
26 eg: TMC:11996:h:0:27500:278:512:650:321 43 descrambler to function,
27 44
28 here 278 is a valid PMT PID. the rest of the values are the 45 eg: $ ca_zap channels.conf "TMC"
29 same ones that szap uses.
30 46
31 (c) after running a szap, you have to run ca_zap, for the 47d) Hopefully enjoy your favourite subscribed channel as you do with
32 descrambler to function, 48 a FTA card.
33 eg: $ ca_zap channels.conf "TMC"
34 49
35 (d) Hopefully enjoy your favourite subscribed channel as you do with 50.. note::
36 a FTA card.
37 51
38(3) Currently ca_zap, and dst_test, both are meant for demonstration 52 Currently ca_zap, and dst_test, both are meant for demonstration
39 purposes only, they can become full fledged applications if necessary. 53 purposes only, they can become full fledged applications if necessary.
40 54
41 55
42* Cards that fall in this category 56Cards that fall in this category
43~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
44At present the cards that fall in this category are the Twinhan and its 59At present the cards that fall in this category are the Twinhan and its
45clones, these cards are available as VVMER, Tomato, Hercules, Orange and 60clones, these cards are available as VVMER, Tomato, Hercules, Orange and
46so on. 61so on.
47 62
48* CI modules that are supported 63CI modules that are supported
49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 64~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
50The CI module support is largely dependent upon the firmware on the cards 66The CI module support is largely dependent upon the firmware on the cards
51Some cards do support almost all of the available CI modules. There is 67Some cards do support almost all of the available CI modules. There is
52nothing much that can be done in order to make additional CI modules 68nothing much that can be done in order to make additional CI modules
@@ -58,11 +74,12 @@ Modules that have been tested by this driver at present are
58(2) Viaccess from SCM 74(2) Viaccess from SCM
59(3) Dragoncam 75(3) Dragoncam
60 76
61* The High level CI API 77The High level CI API
62~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78~~~~~~~~~~~~~~~~~~~~~
79
80For the programmer
81^^^^^^^^^^^^^^^^^^
63 82
64* For the programmer
65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66With the High Level CI approach any new card with almost any random 83With the High Level CI approach any new card with almost any random
67architecture can be implemented with this style, the definitions 84architecture can be implemented with this style, the definitions
68inside the switch statement can be easily adapted for any card, thereby 85inside the switch statement can be easily adapted for any card, thereby
@@ -74,29 +91,30 @@ array to/from the CI ioctls as defined in the Linux DVB API. No changes
74have been made in the API to accommodate this feature. 91have been made in the API to accommodate this feature.
75 92
76 93
77* Why the need for another CI interface ? 94Why the need for another CI interface?
78~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96
79This is one of the most commonly asked question. Well a nice question. 97This is one of the most commonly asked question. Well a nice question.
80Strictly speaking this is not a new interface. 98Strictly speaking this is not a new interface.
81 99
82The CI interface is defined in the DVB API in ca.h as 100The CI interface is defined in the DVB API in ca.h as:
83
84typedef struct ca_slot_info {
85 int num; /* slot number */
86 101
87 int type; /* CA interface this slot supports */ 102.. code-block:: c
88#define CA_CI 1 /* CI high level interface */
89#define CA_CI_LINK 2 /* CI link layer level interface */
90#define CA_CI_PHYS 4 /* CI physical layer level interface */
91#define CA_DESCR 8 /* built-in descrambler */
92#define CA_SC 128 /* simple smart card interface */
93 103
94 unsigned int flags; 104 typedef struct ca_slot_info {
95#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ 105 int num; /* slot number */
96#define CA_CI_MODULE_READY 2
97} ca_slot_info_t;
98 106
107 int type; /* CA interface this slot supports */
108 #define CA_CI 1 /* CI high level interface */
109 #define CA_CI_LINK 2 /* CI link layer level interface */
110 #define CA_CI_PHYS 4 /* CI physical layer level interface */
111 #define CA_DESCR 8 /* built-in descrambler */
112 #define CA_SC 128 /* simple smart card interface */
99 113
114 unsigned int flags;
115 #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
116 #define CA_CI_MODULE_READY 2
117 } ca_slot_info_t;
100 118
101This CI interface follows the CI high level interface, which is not 119This CI interface follows the CI high level interface, which is not
102implemented by most applications. Hence this area is revisited. 120implemented by most applications. Hence this area is revisited.
@@ -113,7 +131,6 @@ means that no session management, link layer or a transport layer do
113exist in this case in the application to driver communication. It is 131exist in this case in the application to driver communication. It is
114as simple as that. The driver/hardware has to take care of that. 132as simple as that. The driver/hardware has to take care of that.
115 133
116
117With this High Level CI interface, the interface can be defined with the 134With this High Level CI interface, the interface can be defined with the
118regular ioctls. 135regular ioctls.
119 136
@@ -129,34 +146,36 @@ All these ioctls are also valid for the High level CI interface
129#define CA_SET_PID _IOW('o', 135, ca_pid_t) 146#define CA_SET_PID _IOW('o', 135, ca_pid_t)
130 147
131 148
132On querying the device, the device yields information thus 149On querying the device, the device yields information thus:
150
151.. code-block:: none
133 152
134CA_GET_SLOT_INFO 153 CA_GET_SLOT_INFO
135---------------------------- 154 ----------------------------
136Command = [info] 155 Command = [info]
137APP: Number=[1] 156 APP: Number=[1]
138APP: Type=[1] 157 APP: Type=[1]
139APP: flags=[1] 158 APP: flags=[1]
140APP: CI High level interface 159 APP: CI High level interface
141APP: CA/CI Module Present 160 APP: CA/CI Module Present
142 161
143CA_GET_CAP 162 CA_GET_CAP
144---------------------------- 163 ----------------------------
145Command = [caps] 164 Command = [caps]
146APP: Slots=[1] 165 APP: Slots=[1]
147APP: Type=[1] 166 APP: Type=[1]
148APP: Descrambler keys=[16] 167 APP: Descrambler keys=[16]
149APP: Type=[1] 168 APP: Type=[1]
150 169
151CA_SEND_MSG 170 CA_SEND_MSG
152---------------------------- 171 ----------------------------
153Descriptors(Program Level)=[ 09 06 06 04 05 50 ff f1] 172 Descriptors(Program Level)=[ 09 06 06 04 05 50 ff f1]
154Found CA descriptor @ program level 173 Found CA descriptor @ program level
155 174
156(20) ES type=[2] ES pid=[201] ES length =[0 (0x0)] 175 (20) ES type=[2] ES pid=[201] ES length =[0 (0x0)]
157(25) ES type=[4] ES pid=[301] ES length =[0 (0x0)] 176 (25) ES type=[4] ES pid=[301] ES length =[0 (0x0)]
158ca_message length is 25 (0x19) bytes 177 ca_message length is 25 (0x19) bytes
159EN50221 CA MSG=[ 9f 80 32 19 03 01 2d d1 f0 08 01 09 06 06 04 05 50 ff f1 02 e0 c9 00 00 04 e1 2d 00 00] 178 EN50221 CA MSG=[ 9f 80 32 19 03 01 2d d1 f0 08 01 09 06 06 04 05 50 ff f1 02 e0 c9 00 00 04 e1 2d 00 00]
160 179
161 180
162Not all ioctl's are implemented in the driver from the API, the other 181Not all ioctl's are implemented in the driver from the API, the other
@@ -164,21 +183,20 @@ features of the hardware that cannot be implemented by the API are achieved
164using the CA_GET_MSG and CA_SEND_MSG ioctls. An EN50221 style wrapper is 183using the CA_GET_MSG and CA_SEND_MSG ioctls. An EN50221 style wrapper is
165used to exchange the data to maintain compatibility with other hardware. 184used to exchange the data to maintain compatibility with other hardware.
166 185
186.. code-block:: c
167 187
168/* a message to/from a CI-CAM */ 188 /* a message to/from a CI-CAM */
169typedef struct ca_msg { 189 typedef struct ca_msg {
170 unsigned int index; 190 unsigned int index;
171 unsigned int type; 191 unsigned int type;
172 unsigned int length; 192 unsigned int length;
173 unsigned char msg[256]; 193 unsigned char msg[256];
174} ca_msg_t; 194 } ca_msg_t;
175 195
176 196
177The flow of data can be described thus, 197The flow of data can be described thus,
178 198
179 199.. code-block:: none
180
181
182 200
183 App (User) 201 App (User)
184 ----- 202 -----
diff --git a/Documentation/media/dvb-drivers/contributors.rst b/Documentation/media/dvb-drivers/contributors.rst
new file mode 100644
index 000000000000..5949753008ae
--- /dev/null
+++ b/Documentation/media/dvb-drivers/contributors.rst
@@ -0,0 +1,129 @@
1Contributors
2============
3
4.. note::
5
6 This documentation is outdated. There are several other DVB contributors
7 that aren't listed below.
8
9Thanks go to the following people for patches and contributions:
10
11- Michael Hunold <m.hunold@gmx.de>
12
13 - for the initial saa7146 driver and its recent overhaul
14
15- Christian Theiss
16
17 - for his work on the initial Linux DVB driver
18
19- Marcus Metzler <mocm@metzlerbros.de> and
20 Ralph Metzler <rjkm@metzlerbros.de>
21
22 - for their continuing work on the DVB driver
23
24- Michael Holzt <kju@debian.org>
25
26 - for his contributions to the dvb-net driver
27
28- Diego Picciani <d.picciani@novacomp.it>
29
30 - for CyberLogin for Linux which allows logging onto EON
31 (in case you are wondering where CyberLogin is, EON changed its login
32 procedure and CyberLogin is no longer used.)
33
34- Martin Schaller <martin@smurf.franken.de>
35
36 - for patching the cable card decoder driver
37
38- Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
39
40 - for various fixes regarding tuning, OSD and CI stuff and his work on VDR
41
42- Steve Brown <sbrown@cortland.com>
43
44 - for his AFC kernel thread
45
46- Christoph Martin <martin@uni-mainz.de>
47
48 - for his LIRC infrared handler
49
50- Andreas Oberritter <obi@linuxtv.org>,
51 Dennis Noermann <dennis.noermann@noernet.de>,
52 Felix Domke <tmbinc@elitedvb.net>,
53 Florian Schirmer <jolt@tuxbox.org>,
54 Ronny Strutz <3des@elitedvb.de>,
55 Wolfram Joost <dbox2@frokaschwei.de>
56 and all the other dbox2 people
57
58 - for many bugfixes in the generic DVB Core, frontend drivers and
59 their work on the dbox2 port of the DVB driver
60
61- Oliver Endriss <o.endriss@gmx.de>
62
63 - for many bugfixes
64
65- Andrew de Quincey <adq_dvb@lidskialf.net>
66
67 - for the tda1004x frontend driver, and various bugfixes
68
69- Peter Schildmann <peter.schildmann@web.de>
70
71 - for the driver for the Technisat SkyStar2 PCI DVB card
72
73- Vadim Catana <skystar@moldova.cc>,
74 Roberto Ragusa <r.ragusa@libero.it> and
75 Augusto Cardoso <augusto@carhil.net>
76
77 - for all the work for the FlexCopII chipset by B2C2,Inc.
78
79- Davor Emard <emard@softhome.net>
80
81 - for his work on the budget drivers, the demux code,
82 the module unloading problems, ...
83
84- Hans-Frieder Vogt <hfvogt@arcor.de>
85
86 - for his work on calculating and checking the crc's for the
87 TechnoTrend/Hauppauge DEC driver firmware
88
89- Michael Dreher <michael@5dot1.de> and
90 Andreas 'randy' Weinberger
91
92 - for the support of the Fujitsu-Siemens Activy budget DVB-S
93
94- Kenneth Aafløy <ke-aa@frisurf.no>
95
96 - for adding support for Typhoon DVB-S budget card
97
98- Ernst Peinlich <e.peinlich@inode.at>
99
100 - for tuning/DiSEqC support for the DEC 3000-s
101
102- Peter Beutner <p.beutner@gmx.net>
103
104 - for the IR code for the ttusb-dec driver
105
106- Wilson Michaels <wilsonmichaels@earthlink.net>
107
108 - for the lgdt330x frontend driver, and various bugfixes
109
110- Michael Krufky <mkrufky@linuxtv.org>
111
112 - for maintaining v4l/dvb inter-tree dependencies
113
114- Taylor Jacob <rtjacob@earthlink.net>
115
116 - for the nxt2002 frontend driver
117
118- Jean-Francois Thibert <jeanfrancois@sagetv.com>
119
120 - for the nxt2004 frontend driver
121
122- Kirk Lapray <kirk.lapray@gmail.com>
123
124 - for the or51211 and or51132 frontend drivers, and
125 for merging the nxt2002 and nxt2004 modules into a
126 single nxt200x frontend driver.
127
128(If you think you should be in this list, but you are not, drop a
129line to the DVB mailing list)
diff --git a/Documentation/media/dvb-drivers/dvb-usb.rst b/Documentation/media/dvb-drivers/dvb-usb.rst
new file mode 100644
index 000000000000..eec99cd07a30
--- /dev/null
+++ b/Documentation/media/dvb-drivers/dvb-usb.rst
@@ -0,0 +1,355 @@
1Idea behind the dvb-usb-framework
2=================================
3
4.. note::
5
6 #) This documentation is outdated. Please check at the DVB wiki
7 at https://linuxtv.org/wiki for more updated info.
8
9 #) **deprecated:** Newer DVB USB drivers should use the dvb-usb-v2 framework.
10
11In March 2005 I got the new Twinhan USB2.0 DVB-T device. They provided specs
12and a firmware.
13
14Quite keen I wanted to put the driver (with some quirks of course) into dibusb.
15After reading some specs and doing some USB snooping, it realized, that the
16dibusb-driver would be a complete mess afterwards. So I decided to do it in a
17different way: With the help of a dvb-usb-framework.
18
19The framework provides generic functions (mostly kernel API calls), such as:
20
21- Transport Stream URB handling in conjunction with dvb-demux-feed-control
22 (bulk and isoc are supported)
23- registering the device for the DVB-API
24- registering an I2C-adapter if applicable
25- remote-control/input-device handling
26- firmware requesting and loading (currently just for the Cypress USB
27 controllers)
28- other functions/methods which can be shared by several drivers (such as
29 functions for bulk-control-commands)
30- TODO: a I2C-chunker. It creates device-specific chunks of register-accesses
31 depending on length of a register and the number of values that can be
32 multi-written and multi-read.
33
34The source code of the particular DVB USB devices does just the communication
35with the device via the bus. The connection between the DVB-API-functionality
36is done via callbacks, assigned in a static device-description (struct
37dvb_usb_device) each device-driver has to have.
38
39For an example have a look in drivers/media/usb/dvb-usb/vp7045*.
40
41Objective is to migrate all the usb-devices (dibusb, cinergyT2, maybe the
42ttusb; flexcop-usb already benefits from the generic flexcop-device) to use
43the dvb-usb-lib.
44
45TODO: dynamic enabling and disabling of the pid-filter in regard to number of
46feeds requested.
47
48Supported devices
49-----------------
50
51See the LinuxTV DVB Wiki at https://linuxtv.org for a complete list of
52cards/drivers/firmwares:
53https://linuxtv.org/wiki/index.php/DVB_USB
54
550. History & News:
56
57 2005-06-30
58
59 - added support for WideView WT-220U (Thanks to Steve Chang)
60
61 2005-05-30
62
63 - added basic isochronous support to the dvb-usb-framework
64 - added support for Conexant Hybrid reference design and Nebula
65 DigiTV USB
66
67 2005-04-17
68
69 - all dibusb devices ported to make use of the dvb-usb-framework
70
71 2005-04-02
72
73 - re-enabled and improved remote control code.
74
75 2005-03-31
76
77 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb.
78
79 2005-03-30
80
81 - first commit of the dvb-usb-module based on the dibusb-source.
82 First device is a new driver for the
83 TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.
84 - (change from dvb-dibusb to dvb-usb)
85
86 2005-03-28
87
88 - added support for the AVerMedia AverTV DVB-T USB2.0 device
89 (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia)
90
91 2005-03-14
92
93 - added support for the Typhoon/Yakumo/HAMA DVB-T mobile USB2.0
94
95 2005-02-11
96
97 - added support for the KWorld/ADSTech Instant DVB-T USB2.0.
98 Thanks a lot to Joachim von Caron
99
100 2005-02-02
101 - added support for the Hauppauge Win-TV Nova-T USB2
102
103 2005-01-31
104 - distorted streaming is gone for USB1.1 devices
105
106 2005-01-13
107
108 - moved the mirrored pid_filter_table back to dvb-dibusb
109 first almost working version for HanfTek UMT-010
110 found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-010
111
112 2005-01-10
113
114 - refactoring completed, now everything is very delightful
115
116 - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a
117 Panasonic Tuner assembled). Tunerprobing implemented.
118 Thanks a lot to Gunnar Wittich.
119
120 2004-12-29
121
122 - after several days of struggling around bug of no returning URBs fixed.
123
124 2004-12-26
125
126 - refactored the dibusb-driver, splitted into separate files
127 - i2c-probing enabled
128
129 2004-12-06
130
131 - possibility for demod i2c-address probing
132 - new usb IDs (Compro, Artec)
133
134 2004-11-23
135
136 - merged changes from DiB3000MC_ver2.1
137 - revised the debugging
138 - possibility to deliver the complete TS for USB2.0
139
140 2004-11-21
141
142 - first working version of the dib3000mc/p frontend driver.
143
144 2004-11-12
145
146 - added additional remote control keys. Thanks to Uwe Hanke.
147
148 2004-11-07
149
150 - added remote control support. Thanks to David Matthews.
151
152 2004-11-05
153
154 - added support for a new devices (Grandtec/Avermedia/Artec)
155 - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD
156 - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems
157 better settled there (added xfer_ops-struct)
158 - created a common files for frontends (mc/p/mb)
159
160 2004-09-28
161
162 - added support for a new device (Unknown, vendor ID is Hyper-Paltek)
163
164 2004-09-20
165
166 - added support for a new device (Compro DVB-U2000), thanks
167 to Amaury Demol for reporting
168 - changed usb TS transfer method (several urbs, stopping transfer
169 before setting a new pid)
170
171 2004-09-13
172
173 - added support for a new device (Artec T1 USB TVBOX), thanks
174 to Christian Motschke for reporting
175
176 2004-09-05
177
178 - released the dibusb device and dib3000mb-frontend driver
179 (old news for vp7041.c)
180
181 2004-07-15
182
183 - found out, by accident, that the device has a TUA6010XS for PLL
184
185 2004-07-12
186
187 - figured out, that the driver should also work with the
188 CTS Portable (Chinese Television System)
189
190 2004-07-08
191
192 - firmware-extraction-2.422-problem solved, driver is now working
193 properly with firmware extracted from 2.422
194 - #if for 2.6.4 (dvb), compile issue
195 - changed firmware handling, see vp7041.txt sec 1.1
196
197 2004-07-02
198
199 - some tuner modifications, v0.1, cleanups, first public
200
201 2004-06-28
202
203 - now using the dvb_dmx_swfilter_packets, everything runs fine now
204
205 2004-06-27
206
207 - able to watch and switching channels (pre-alpha)
208 - no section filtering yet
209
210 2004-06-06
211
212 - first TS received, but kernel oops :/
213
214 2004-05-14
215
216 - firmware loader is working
217
218 2004-05-11
219
220 - start writing the driver
221
222How to use?
223-----------
224
225Firmware
226~~~~~~~~
227
228Most of the USB drivers need to download a firmware to the device before start
229working.
230
231Have a look at the Wikipage for the DVB-USB-drivers to find out, which firmware
232you need for your device:
233
234https://linuxtv.org/wiki/index.php/DVB_USB
235
236Compiling
237~~~~~~~~~
238
239Since the driver is in the linux kernel, activating the driver in
240your favorite config-environment should sufficient. I recommend
241to compile the driver as module. Hotplug does the rest.
242
243If you use dvb-kernel enter the build-2.6 directory run 'make' and 'insmod.sh
244load' afterwards.
245
246Loading the drivers
247~~~~~~~~~~~~~~~~~~~
248
249Hotplug is able to load the driver, when it is needed (because you plugged
250in the device).
251
252If you want to enable debug output, you have to load the driver manually and
253from within the dvb-kernel cvs repository.
254
255first have a look, which debug level are available:
256
257.. code-block:: none
258
259 # modinfo dvb-usb
260 # modinfo dvb-usb-vp7045
261
262 etc.
263
264.. code-block:: none
265
266 modprobe dvb-usb debug=<level>
267 modprobe dvb-usb-vp7045 debug=<level>
268 etc.
269
270should do the trick.
271
272When the driver is loaded successfully, the firmware file was in
273the right place and the device is connected, the "Power"-LED should be
274turned on.
275
276At this point you should be able to start a dvb-capable application. I'm use
277(t|s)zap, mplayer and dvbscan to test the basics. VDR-xine provides the
278long-term test scenario.
279
280Known problems and bugs
281-----------------------
282
283- Don't remove the USB device while running an DVB application, your system
284 will go crazy or die most likely.
285
286Adding support for devices
287~~~~~~~~~~~~~~~~~~~~~~~~~~
288
289TODO
290
291USB1.1 Bandwidth limitation
292~~~~~~~~~~~~~~~~~~~~~~~~~~~
293
294A lot of the currently supported devices are USB1.1 and thus they have a
295maximum bandwidth of about 5-6 MBit/s when connected to a USB2.0 hub.
296This is not enough for receiving the complete transport stream of a
297DVB-T channel (which is about 16 MBit/s). Normally this is not a
298problem, if you only want to watch TV (this does not apply for HDTV),
299but watching a channel while recording another channel on the same
300frequency simply does not work very well. This applies to all USB1.1
301DVB-T devices, not just the dvb-usb-devices)
302
303The bug, where the TS is distorted by a heavy usage of the device is gone
304definitely. All dvb-usb-devices I was using (Twinhan, Kworld, DiBcom) are
305working like charm now with VDR. Sometimes I even was able to record a channel
306and watch another one.
307
308Comments
309~~~~~~~~
310
311Patches, comments and suggestions are very very welcome.
312
3133. Acknowledgements
314-------------------
315
316 Amaury Demol (Amaury.Demol@parrot.com) and Francois Kanounnikoff from DiBcom for
317 providing specs, code and help, on which the dvb-dibusb, dib3000mb and
318 dib3000mc are based.
319
320 David Matthews for identifying a new device type (Artec T1 with AN2235)
321 and for extending dibusb with remote control event handling. Thank you.
322
323 Alex Woods for frequently answering question about usb and dvb
324 stuff, a big thank you.
325
326 Bernd Wagner for helping with huge bug reports and discussions.
327
328 Gunnar Wittich and Joachim von Caron for their trust for providing
329 root-shells on their machines to implement support for new devices.
330
331 Allan Third and Michael Hutchinson for their help to write the Nebula
332 digitv-driver.
333
334 Glen Harris for bringing up, that there is a new dibusb-device and Jiun-Kuei
335 Jung from AVerMedia who kindly provided a special firmware to get the device
336 up and running in Linux.
337
338 Jennifer Chen, Jeff and Jack from Twinhan for kindly supporting by
339 writing the vp7045-driver.
340
341 Steve Chang from WideView for providing information for new devices and
342 firmware files.
343
344 Michael Paxton for submitting remote control keymaps.
345
346 Some guys on the linux-dvb mailing list for encouraging me.
347
348 Peter Schildmann >peter.schildmann-nospam-at-web.de< for his
349 user-level firmware loader, which saves a lot of time
350 (when writing the vp7041 driver)
351
352 Ulf Hermenau for helping me out with traditional chinese.
353
354 André Smoktun and Christian Frömmel for supporting me with
355 hardware and listening to my problems very patiently.
diff --git a/Documentation/dvb/faq.txt b/Documentation/media/dvb-drivers/faq.rst
index a0be92012877..a8593d3792fa 100644
--- a/Documentation/dvb/faq.txt
+++ b/Documentation/media/dvb-drivers/faq.rst
@@ -1,3 +1,11 @@
1FAQ
2===
3
4.. note::
5
6 This documentation is outdated. Please check at the DVB wiki
7 at https://linuxtv.org/wiki for more updated info.
8
1Some very frequently asked questions about linuxtv-dvb 9Some very frequently asked questions about linuxtv-dvb
2 10
31. The signal seems to die a few seconds after tuning. 111. The signal seems to die a few seconds after tuning.
@@ -71,8 +79,7 @@ Some very frequently asked questions about linuxtv-dvb
71 http://www.dbox2.info/ 79 http://www.dbox2.info/
72 LinuxDVB on the dBox2 80 LinuxDVB on the dBox2
73 81
74 http://www.tuxbox.org/ 82 http://www.tuxbox.org/ and http://cvs.tuxbox.org/
75 http://cvs.tuxbox.org/
76 the TuxBox CVS many interesting DVB applications and the dBox2 83 the TuxBox CVS many interesting DVB applications and the dBox2
77 DVB source 84 DVB source
78 85
@@ -85,8 +92,7 @@ Some very frequently asked questions about linuxtv-dvb
85 http://mplayerhq.hu/ 92 http://mplayerhq.hu/
86 mplayer 93 mplayer
87 94
88 http://xine.sourceforge.net/ 95 http://xine.sourceforge.net/ and http://xinehq.de/
89 http://xinehq.de/
90 xine 96 xine
91 97
92 http://www.mythtv.org/ 98 http://www.mythtv.org/
@@ -125,6 +131,9 @@ Some very frequently asked questions about linuxtv-dvb
125 Check your routes if they include the multicast address range. 131 Check your routes if they include the multicast address range.
126 Additionally make sure that "source validation by reversed path 132 Additionally make sure that "source validation by reversed path
127 lookup" is disabled: 133 lookup" is disabled:
134
135.. code-block:: none
136
128 $ "echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter" 137 $ "echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter"
129 138
1307. What the hell are all those modules that need to be loaded? 1397. What the hell are all those modules that need to be loaded?
@@ -156,4 +165,3 @@ Some very frequently asked questions about linuxtv-dvb
156 - dvb-ttpci: The main driver for AV7110 based, full-featured 165 - dvb-ttpci: The main driver for AV7110 based, full-featured
157 DVB-S/C/T cards 166 DVB-S/C/T cards
158 167
159eof
diff --git a/Documentation/media/dvb-drivers/index.rst b/Documentation/media/dvb-drivers/index.rst
new file mode 100644
index 000000000000..ea0da6d63299
--- /dev/null
+++ b/Documentation/media/dvb-drivers/index.rst
@@ -0,0 +1,42 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5##############################################
6Linux Digital TV driver-specific documentation
7##############################################
8
9**Copyright** |copy| 2001-2016 : LinuxTV Developers
10
11This documentation is free software; you can redistribute it and/or modify it
12under the terms of the GNU General Public License as published by the Free
13Software Foundation version 2 of the License.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18more details.
19
20For more details see the file COPYING in the source distribution of Linux.
21
22.. class:: toc-title
23
24 Table of Contents
25
26.. toctree::
27 :maxdepth: 5
28 :numbered:
29
30 intro
31 avermedia
32 bt8xx
33 cards
34 ci
35 dvb-usb
36 faq
37 lmedm04
38 opera-firmware
39 technisat
40 ttusb-dec
41 udev
42 contributors
diff --git a/Documentation/media/dvb-drivers/intro.rst b/Documentation/media/dvb-drivers/intro.rst
new file mode 100644
index 000000000000..7681835ea76d
--- /dev/null
+++ b/Documentation/media/dvb-drivers/intro.rst
@@ -0,0 +1,21 @@
1Introdution
2===========
3
4The main development site and GIT repository for these
5drivers is https://linuxtv.org.
6
7The DVB mailing list linux-dvb is hosted at vger. Please see
8http://vger.kernel.org/vger-lists.html#linux-media for details.
9
10There are also some other old lists hosted at https://linuxtv.org/lists.php. Please check the archive https://linuxtv.org/pipermail/linux-dvb/.
11
12The media subsystem Wiki is hosted at https://linuxtv.org/wiki/.
13Please check it before asking newbie questions on the list.
14
15API documentation is documented at the Kernel. You'll also find useful
16documentation at: https://linuxtv.org/docs.php.
17
18You may also find useful material at https://linuxtv.org/downloads/.
19
20In order to get firmware from proprietary drivers, there's a script at
21the kernel tree, at scripts/get_dvb_firmware.
diff --git a/Documentation/dvb/lmedm04.txt b/Documentation/media/dvb-drivers/lmedm04.rst
index f4b720a14675..e8913d4481a0 100644
--- a/Documentation/dvb/lmedm04.txt
+++ b/Documentation/media/dvb-drivers/lmedm04.rst
@@ -1,7 +1,10 @@
1Firmware files for lmedm04 cards
2================================
3
1To extract firmware for the DM04/QQBOX you need to copy the 4To extract firmware for the DM04/QQBOX you need to copy the
2following file(s) to this directory. 5following file(s) to this directory.
3 6
4for DM04+/QQBOX LME2510C (Sharp 7395 Tuner) 7For DM04+/QQBOX LME2510C (Sharp 7395 Tuner)
5------------------------------------------- 8-------------------------------------------
6 9
7The Sharp 7395 driver can be found in windows/system32/drivers 10The Sharp 7395 driver can be found in windows/system32/drivers
@@ -9,38 +12,43 @@ The Sharp 7395 driver can be found in windows/system32/drivers
9US2A0D.sys (dated 17 Mar 2009) 12US2A0D.sys (dated 17 Mar 2009)
10 13
11 14
12and run 15and run:
13./get_dvb_firmware lme2510c_s7395 16
17.. code-block:: none
18
19 scripts/get_dvb_firmware lme2510c_s7395
14 20
15 will produce 21will produce dvb-usb-lme2510c-s7395.fw
16 dvb-usb-lme2510c-s7395.fw
17 22
18An alternative but older firmware can be found on the driver 23An alternative but older firmware can be found on the driver
19disk DVB-S_EN_3.5A in BDADriver/driver 24disk DVB-S_EN_3.5A in BDADriver/driver
20 25
21LMEBDA_DVBS7395C.sys (dated 18 Jan 2008) 26LMEBDA_DVBS7395C.sys (dated 18 Jan 2008)
22 27
23and run 28and run:
24./get_dvb_firmware lme2510c_s7395_old
25 29
26 will produce 30.. code-block:: none
27 dvb-usb-lme2510c-s7395.fw
28 31
29-------------------------------------------------------------------- 32 ./get_dvb_firmware lme2510c_s7395_old
33
34will produce dvb-usb-lme2510c-s7395.fw
30 35
31The LG firmware can be found on the driver 36The LG firmware can be found on the driver
32disk DM04+_5.1A[LG] in BDADriver/driver 37disk DM04+_5.1A[LG] in BDADriver/driver
33 38
34for DM04 LME2510 (LG Tuner) 39For DM04 LME2510 (LG Tuner)
35--------------------------- 40---------------------------
36 41
37LMEBDA_DVBS.sys (dated 13 Nov 2007) 42LMEBDA_DVBS.sys (dated 13 Nov 2007)
38 43
39and run 44and run:
40./get_dvb_firmware lme2510_lg 45
41 46
42 will produce 47.. code-block:: none
43 dvb-usb-lme2510-lg.fw 48
49 ./get_dvb_firmware lme2510_lg
50
51will produce dvb-usb-lme2510-lg.fw
44 52
45 53
46Other LG firmware can be extracted manually from US280D.sys 54Other LG firmware can be extracted manually from US280D.sys
@@ -48,34 +56,50 @@ only found in windows/system32/drivers
48 56
49dd if=US280D.sys ibs=1 skip=42360 count=3924 of=dvb-usb-lme2510-lg.fw 57dd if=US280D.sys ibs=1 skip=42360 count=3924 of=dvb-usb-lme2510-lg.fw
50 58
51for DM04 LME2510C (LG Tuner) 59For DM04 LME2510C (LG Tuner)
52--------------------------- 60----------------------------
53 61
54dd if=US280D.sys ibs=1 skip=35200 count=3850 of=dvb-usb-lme2510c-lg.fw 62.. code-block:: none
63
64 dd if=US280D.sys ibs=1 skip=35200 count=3850 of=dvb-usb-lme2510c-lg.fw
55 65
56---------------------------------------------------------------------
57 66
58The Sharp 0194 tuner driver can be found in windows/system32/drivers 67The Sharp 0194 tuner driver can be found in windows/system32/drivers
59 68
60US290D.sys (dated 09 Apr 2009) 69US290D.sys (dated 09 Apr 2009)
61 70
62For LME2510 71For LME2510
63dd if=US290D.sys ibs=1 skip=36856 count=3976 of=dvb-usb-lme2510-s0194.fw 72-----------
73
74.. code-block:: none
75
76 dd if=US290D.sys ibs=1 skip=36856 count=3976 of=dvb-usb-lme2510-s0194.fw
64 77
65 78
66For LME2510C 79For LME2510C
67dd if=US290D.sys ibs=1 skip=33152 count=3697 of=dvb-usb-lme2510c-s0194.fw 80------------
81
82
83.. code-block:: none
84
85 dd if=US290D.sys ibs=1 skip=33152 count=3697 of=dvb-usb-lme2510c-s0194.fw
68 86
69---------------------------------------------------------------------
70 87
71The m88rs2000 tuner driver can be found in windows/system32/drivers 88The m88rs2000 tuner driver can be found in windows/system32/drivers
72 89
73US2B0D.sys (dated 29 Jun 2010) 90US2B0D.sys (dated 29 Jun 2010)
74 91
75dd if=US2B0D.sys ibs=1 skip=34432 count=3871 of=dvb-usb-lme2510c-rs2000.fw 92
93.. code-block:: none
94
95 dd if=US2B0D.sys ibs=1 skip=34432 count=3871 of=dvb-usb-lme2510c-rs2000.fw
76 96
77We need to modify id of rs2000 firmware or it will warm boot id 3344:1120. 97We need to modify id of rs2000 firmware or it will warm boot id 3344:1120.
78 98
79echo -ne \\xF0\\x22 | dd conv=notrunc bs=1 count=2 seek=266 of=dvb-usb-lme2510c-rs2000.fw 99
100.. code-block:: none
101
102
103 echo -ne \\xF0\\x22 | dd conv=notrunc bs=1 count=2 seek=266 of=dvb-usb-lme2510c-rs2000.fw
80 104
81Copy the firmware file(s) to /lib/firmware 105Copy the firmware file(s) to /lib/firmware
diff --git a/Documentation/dvb/opera-firmware.txt b/Documentation/media/dvb-drivers/opera-firmware.rst
index fb6683188ef7..41236b43c124 100644
--- a/Documentation/dvb/opera-firmware.txt
+++ b/Documentation/media/dvb-drivers/opera-firmware.rst
@@ -1,3 +1,8 @@
1Opera firmware
2==============
3
4Author: Marco Gittler <g.marco@freenet.de>
5
1To extract the firmware for the Opera DVB-S1 USB-Box 6To extract the firmware for the Opera DVB-S1 USB-Box
2you need to copy the files: 7you need to copy the files:
3 8
@@ -6,9 +11,11 @@ you need to copy the files:
6 11
7from the windriver disk into this directory. 12from the windriver disk into this directory.
8 13
9Then run 14Then run:
15
16.. code-block:: none
10 17
11./get_dvb_firmware opera1 18 scripts/get_dvb_firmware opera1
12 19
13and after that you have 2 files: 20and after that you have 2 files:
14 21
@@ -22,6 +29,3 @@ Copy them into /lib/firmware/ .
22After that the driver can load the firmware 29After that the driver can load the firmware
23(if you have enabled firmware loading 30(if you have enabled firmware loading
24in kernel config and have hotplug running). 31in kernel config and have hotplug running).
25
26
27Marco Gittler <g.marco@freenet.de>
diff --git a/Documentation/media/dvb-drivers/technisat.rst b/Documentation/media/dvb-drivers/technisat.rst
new file mode 100644
index 000000000000..f80f4ecc1560
--- /dev/null
+++ b/Documentation/media/dvb-drivers/technisat.rst
@@ -0,0 +1,98 @@
1How to set up the Technisat/B2C2 Flexcop devices
2================================================
3
4.. note::
5
6 This documentation is outdated.
7
8Author: Uwe Bugla <uwe.bugla@gmx.de> August 2009
9
10Find out what device you have
11-----------------------------
12
13Important Notice: The driver does NOT support Technisat USB 2 devices!
14
15First start your linux box with a shipped kernel:
16
17.. code-block:: none
18
19 lspci -vvv for a PCI device (lsusb -vvv for an USB device) will show you for example:
20 02:0b.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip /
21 Technisat SkyStar2 DVB card (rev 02)
22
23 dmesg | grep frontend may show you for example:
24 DVB: registering frontend 0 (Conexant CX24123/CX24109)...
25
26Kernel compilation:
27-------------------
28
29If the Flexcop / Technisat is the only DVB / TV / Radio device in your box
30get rid of unnecessary modules and check this one:
31
32``Multimedia support`` => ``Customise analog and hybrid tuner modules to build``
33
34In this directory uncheck every driver which is activated there
35(except ``Simple tuner support`` for ATSC 3rd generation only -> see case 9 please).
36
37Then please activate:
38
39- Main module part:
40
41 ``Multimedia support`` => ``DVB/ATSC adapters`` => ``Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters``
42
43 #) => ``Technisat/B2C2 Air/Sky/Cable2PC PCI`` (PCI card) or
44 #) => ``Technisat/B2C2 Air/Sky/Cable2PC USB`` (USB 1.1 adapter)
45 and for troubleshooting purposes:
46 #) => ``Enable debug for the B2C2 FlexCop drivers``
47
48- Frontend / Tuner / Demodulator module part:
49
50 ``Multimedia support`` => ``DVB/ATSC adapters``
51 => ``Customise the frontend modules to build`` ``Customise DVB frontends`` =>
52
53 - SkyStar DVB-S Revision 2.3:
54
55 #) => ``Zarlink VP310/MT312/ZL10313 based``
56 #) => ``Generic I2C PLL based tuners``
57
58 - SkyStar DVB-S Revision 2.6:
59
60 #) => ``ST STV0299 based``
61 #) => ``Generic I2C PLL based tuners``
62
63 - SkyStar DVB-S Revision 2.7:
64
65 #) => ``Samsung S5H1420 based``
66 #) => ``Integrant ITD1000 Zero IF tuner for DVB-S/DSS``
67 #) => ``ISL6421 SEC controller``
68
69 - SkyStar DVB-S Revision 2.8:
70
71 #) => ``Conexant CX24123 based``
72 #) => ``Conexant CX24113/CX24128 tuner for DVB-S/DSS``
73 #) => ``ISL6421 SEC controller``
74
75 - AirStar DVB-T card:
76
77 #) => ``Zarlink MT352 based``
78 #) => ``Generic I2C PLL based tuners``
79
80 - CableStar DVB-C card:
81
82 #) => ``ST STV0297 based``
83 #) => ``Generic I2C PLL based tuners``
84
85 - AirStar ATSC card 1st generation:
86
87 #) => ``Broadcom BCM3510``
88
89 - AirStar ATSC card 2nd generation:
90
91 #) => ``NxtWave Communications NXT2002/NXT2004 based``
92 #) => ``Generic I2C PLL based tuners``
93
94 - AirStar ATSC card 3rd generation:
95
96 #) => ``LG Electronics LGDT3302/LGDT3303 based``
97 #) ``Multimedia support`` => ``Customise analog and hybrid tuner modules to build`` => ``Simple tuner support``
98
diff --git a/Documentation/media/dvb-drivers/ttusb-dec.rst b/Documentation/media/dvb-drivers/ttusb-dec.rst
new file mode 100644
index 000000000000..84fc2199dc29
--- /dev/null
+++ b/Documentation/media/dvb-drivers/ttusb-dec.rst
@@ -0,0 +1,43 @@
1TechnoTrend/Hauppauge DEC USB Driver
2====================================
3
4Driver Status
5-------------
6
7Supported:
8
9 - DEC2000-t
10 - DEC2450-t
11 - DEC3000-s
12 - Video Streaming
13 - Audio Streaming
14 - Section Filters
15 - Channel Zapping
16 - Hotplug firmware loader
17
18To Do:
19
20 - Tuner status information
21 - DVB network interface
22 - Streaming video PC->DEC
23 - Conax support for 2450-t
24
25Getting the Firmware
26--------------------
27To download the firmware, use the following commands:
28
29.. code-block:: none
30
31 scripts/get_dvb_firmware dec2000t
32 scripts/get_dvb_firmware dec2540t
33 scripts/get_dvb_firmware dec3000s
34
35
36Hotplug Firmware Loading
37------------------------
38
39Since 2.6 kernels, the firmware is loaded at the point that the driver module
40is loaded.
41
42Copy the three files downloaded above into the /usr/lib/hotplug/firmware or
43/lib/firmware directory (depending on configuration of firmware hotplug).
diff --git a/Documentation/dvb/udev.txt b/Documentation/media/dvb-drivers/udev.rst
index 412305b7c557..7d7d5d82108a 100644
--- a/Documentation/dvb/udev.txt
+++ b/Documentation/media/dvb-drivers/udev.rst
@@ -1,9 +1,22 @@
1UDEV rules for DVB
2==================
3
4.. note::
5
6 #) This documentation is outdated. Udev on modern distributions auto-detect
7 the DVB devices.
8
9 #) **TODO:** change this document to explain how to make DVB devices
10 persistent, as, when a machine has multiple devices, they may be detected
11 on different orders, which could cause apps that relies on the device
12 numbers to fail.
13
1The DVB subsystem currently registers to the sysfs subsystem using the 14The DVB subsystem currently registers to the sysfs subsystem using the
2"class_simple" interface. 15"class_simple" interface.
3 16
4This means that only the basic information like module loading parameters 17This means that only the basic information like module loading parameters
5are presented through sysfs. Other things that might be interesting are 18are presented through sysfs. Other things that might be interesting are
6currently *not* available. 19currently **not** available.
7 20
8Nevertheless it's now possible to add proper udev rules so that the 21Nevertheless it's now possible to add proper udev rules so that the
9DVB device nodes are created automatically. 22DVB device nodes are created automatically.
@@ -21,10 +34,11 @@ The script should be called "dvb.sh" and should be placed into a script
21dir where udev can execute it, most likely /etc/udev/scripts/ 34dir where udev can execute it, most likely /etc/udev/scripts/
22 35
23So, create a new file /etc/udev/scripts/dvb.sh and add the following: 36So, create a new file /etc/udev/scripts/dvb.sh and add the following:
24------------------------------schnipp------------------------------------------------ 37
25#!/bin/sh 38.. code-block:: none
26/bin/echo $1 | /bin/sed -e 's,dvb\([0-9]\)\.\([^0-9]*\)\([0-9]\),dvb/adapter\1/\2\3,' 39
27------------------------------schnipp------------------------------------------------ 40 #!/bin/sh
41 /bin/echo $1 | /bin/sed -e 's,dvb\([0-9]\)\.\([^0-9]*\)\([0-9]\),dvb/adapter\1/\2\3,'
28 42
29Don't forget to make the script executable with "chmod". 43Don't forget to make the script executable with "chmod".
30 44
@@ -34,9 +48,10 @@ directory for rule files. The main udev configuration file /etc/udev/udev.conf
34will tell you the directory where the rules are, most likely it's /etc/udev/rules.d/ 48will tell you the directory where the rules are, most likely it's /etc/udev/rules.d/
35 49
36Create a new rule file in that directory called "dvb.rule" and add the following line: 50Create a new rule file in that directory called "dvb.rule" and add the following line:
37------------------------------schnipp------------------------------------------------ 51
38KERNEL="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c" 52.. code-block:: none
39------------------------------schnipp------------------------------------------------ 53
54 KERNEL="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c"
40 55
41If you want more control over the device nodes (for example a special group membership) 56If you want more control over the device nodes (for example a special group membership)
42have a look at "man udev". 57have a look at "man udev".
diff --git a/Documentation/media/frontend.h.rst.exceptions b/Documentation/media/frontend.h.rst.exceptions
new file mode 100644
index 000000000000..60f2cbb92656
--- /dev/null
+++ b/Documentation/media/frontend.h.rst.exceptions
@@ -0,0 +1,47 @@
1# Ignore header name
2ignore define _DVBFRONTEND_H_
3
4# Group layer A-C symbols together
5replace define DTV_ISDBT_LAYERA_FEC dtv-isdbt-layer-fec
6replace define DTV_ISDBT_LAYERB_FEC dtv-isdbt-layer-fec
7replace define DTV_ISDBT_LAYERC_FEC dtv-isdbt-layer-fec
8replace define DTV_ISDBT_LAYERA_MODULATION dtv-isdbt-layer-modulation
9replace define DTV_ISDBT_LAYERB_MODULATION dtv-isdbt-layer-modulation
10replace define DTV_ISDBT_LAYERC_MODULATION dtv-isdbt-layer-modulation
11replace define DTV_ISDBT_LAYERA_SEGMENT_COUNT dtv-isdbt-layer-segment-count
12replace define DTV_ISDBT_LAYERB_SEGMENT_COUNT dtv-isdbt-layer-segment-count
13replace define DTV_ISDBT_LAYERC_SEGMENT_COUNT dtv-isdbt-layer-segment-count
14replace define DTV_ISDBT_LAYERA_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
15replace define DTV_ISDBT_LAYERB_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
16replace define DTV_ISDBT_LAYERC_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
17
18# Ignore legacy defines
19ignore define DTV_ISDBS_TS_ID_LEGACY
20ignore define SYS_DVBC_ANNEX_AC
21ignore define SYS_DMBTH
22
23# Ignore limits
24ignore define DTV_MAX_COMMAND
25ignore define MAX_DTV_STATS
26ignore define DTV_IOCTL_MAX_MSGS
27
28# Stats enum is documented altogether
29replace enum fecap_scale_params frontend-stat-properties
30replace symbol FE_SCALE_COUNTER frontend-stat-properties
31replace symbol FE_SCALE_DECIBEL frontend-stat-properties
32replace symbol FE_SCALE_NOT_AVAILABLE frontend-stat-properties
33replace symbol FE_SCALE_RELATIVE frontend-stat-properties
34
35# the same reference is used for both get and set ioctls
36replace ioctl FE_SET_PROPERTY FE_GET_PROPERTY
37
38# Ignore struct used only internally at Kernel
39ignore struct dtv_cmds_h
40
41# Typedefs that use the enum reference
42replace typedef fe_sec_voltage_t fe-sec-voltage
43
44# Replaces for flag constants
45replace define FE_TUNE_MODE_ONESHOT fe_set_frontend_tune_mode
46replace define LNA_AUTO dtv-lna
47replace define NO_STREAM_ID_FILTER dtv-stream-id
diff --git a/Documentation/media/intro.rst b/Documentation/media/intro.rst
new file mode 100644
index 000000000000..be90bda5b3f3
--- /dev/null
+++ b/Documentation/media/intro.rst
@@ -0,0 +1,46 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3============
4Introduction
5============
6
7This document covers the Linux Kernel to Userspace API's used by video
8and radio streaming devices, including video cameras, analog and digital
9TV receiver cards, AM/FM receiver cards, Software Defined Radio (SDR),
10streaming capture and output devices, codec devices and remote controllers.
11
12A typical media device hardware is shown at :ref:`typical_media_device`.
13
14.. _typical_media_device:
15
16.. figure:: media_api_files/typical_media_device.*
17 :alt: typical_media_device.svg
18 :align: center
19
20 Typical Media Device
21
22The media infrastructure API was designed to control such devices. It is
23divided into five parts.
24
251. The :ref:`first part <v4l2spec>` covers radio, video capture and output,
26 cameras, analog TV devices and codecs.
27
282. The :ref:`second part <dvbapi>` covers the API used for digital TV and
29 Internet reception via one of the several digital tv standards. While it is
30 called as DVB API, in fact it covers several different video standards
31 including DVB-T/T2, DVB-S/S2, DVB-C, ATSC, ISDB-T, ISDB-S, DTMB, etc. The
32 complete list of supported standards can be found at
33 :ref:`fe-delivery-system-t`.
34
353. The :ref:`third part <remote_controllers>` covers the Remote Controller API.
36
374. The :ref:`fourth part <media_controller>` covers the Media Controller API.
38
395. The :ref:`fifth part <cec>` covers the CEC (Consumer Electronics Control) API.
40
41It should also be noted that a media device may also have audio components, like
42mixers, PCM capture, PCM playback, etc, which are controlled via ALSA API. For
43additional information and for the latest development code, see:
44`https://linuxtv.org <https://linuxtv.org>`__. For discussing improvements,
45reporting troubles, sending new drivers, etc, please mail to: `Linux Media
46Mailing List (LMML) <http://vger.kernel.org/vger-lists.html#linux-media>`__.
diff --git a/Documentation/media/kapi/dtv-core.rst b/Documentation/media/kapi/dtv-core.rst
new file mode 100644
index 000000000000..dd96e846fef9
--- /dev/null
+++ b/Documentation/media/kapi/dtv-core.rst
@@ -0,0 +1,132 @@
1Digital TV (DVB) devices
2------------------------
3
4Digital TV Common functions
5---------------------------
6
7.. kernel-doc:: drivers/media/dvb-core/dvb_math.h
8
9.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
10
11.. kernel-doc:: drivers/media/dvb-core/dvbdev.h
12
13
14
15.. kernel-doc:: drivers/media/dvb-core/dvb_math.h
16 :export: drivers/media/dvb-core/dvb_math.c
17
18.. kernel-doc:: drivers/media/dvb-core/dvbdev.h
19 :export: drivers/media/dvb-core/dvbdev.c
20
21
22
23Digital TV Frontend kABI
24------------------------
25
26Digital TV Frontend
27~~~~~~~~~~~~~~~~~~~
28
29The Digital TV Frontend kABI defines a driver-internal interface for
30registering low-level, hardware specific driver to a hardware independent
31frontend layer. It is only of interest for Digital TV device driver writers.
32The header file for this API is named dvb_frontend.h and located in
33drivers/media/dvb-core.
34
35Before using the Digital TV frontend core, the bridge driver should attach
36the frontend demod, tuner and SEC devices and call
37:c:func:`dvb_register_frontend()`,
38in order to register the new frontend at the subsystem. At device
39detach/removal, the bridge driver should call
40:c:func:`dvb_unregister_frontend()` to
41remove the frontend from the core and then :c:func:`dvb_frontend_detach()`
42to free the memory allocated by the frontend drivers.
43
44The drivers should also call :c:func:`dvb_frontend_suspend()` as part of
45their handler for the :c:type:`device_driver`.\ ``suspend()``, and
46:c:func:`dvb_frontend_resume()` as
47part of their handler for :c:type:`device_driver`.\ ``resume()``.
48
49A few other optional functions are provided to handle some special cases.
50
51.. kernel-doc:: drivers/media/dvb-core/dvb_frontend.h
52
53
54Digital TV Demux kABI
55---------------------
56
57Digital TV Demux
58~~~~~~~~~~~~~~~~
59
60The Kernel Digital TV Demux kABI defines a driver-internal interface for
61registering low-level, hardware specific driver to a hardware independent
62demux layer. It is only of interest for Digital TV device driver writers.
63The header file for this kABI is named demux.h and located in
64drivers/media/dvb-core.
65
66The demux kABI should be implemented for each demux in the system. It is
67used to select the TS source of a demux and to manage the demux resources.
68When the demux client allocates a resource via the demux kABI, it receives
69a pointer to the kABI of that resource.
70
71Each demux receives its TS input from a DVB front-end or from memory, as
72set via this demux kABI. In a system with more than one front-end, the kABI
73can be used to select one of the DVB front-ends as a TS source for a demux,
74unless this is fixed in the HW platform.
75
76The demux kABI only controls front-ends regarding to their connections with
77demuxes; the kABI used to set the other front-end parameters, such as
78tuning, are devined via the Digital TV Frontend kABI.
79
80The functions that implement the abstract interface demux should be defined
81static or module private and registered to the Demux core for external
82access. It is not necessary to implement every function in the struct
83&dmx_demux. For example, a demux interface might support Section filtering,
84but not PES filtering. The kABI client is expected to check the value of any
85function pointer before calling the function: the value of ``NULL`` means
86that the function is not available.
87
88Whenever the functions of the demux API modify shared data, the
89possibilities of lost update and race condition problems should be
90addressed, e.g. by protecting parts of code with mutexes.
91
92Note that functions called from a bottom half context must not sleep.
93Even a simple memory allocation without using ``GFP_ATOMIC`` can result in a
94kernel thread being put to sleep if swapping is needed. For example, the
95Linux Kernel calls the functions of a network device interface from a
96bottom half context. Thus, if a demux kABI function is called from network
97device code, the function must not sleep.
98
99
100
101Demux Callback API
102------------------
103
104Demux Callback
105~~~~~~~~~~~~~~
106
107This kernel-space API comprises the callback functions that deliver filtered
108data to the demux client. Unlike the other DVB kABIs, these functions are
109provided by the client and called from the demux code.
110
111The function pointers of this abstract interface are not packed into a
112structure as in the other demux APIs, because the callback functions are
113registered and used independent of each other. As an example, it is possible
114for the API client to provide several callback functions for receiving TS
115packets and no callbacks for PES packets or sections.
116
117The functions that implement the callback API need not be re-entrant: when
118a demux driver calls one of these functions, the driver is not allowed to
119call the function again before the original call returns. If a callback is
120triggered by a hardware interrupt, it is recommended to use the Linux
121bottom half mechanism or start a tasklet instead of making the callback
122function call directly from a hardware interrupt.
123
124This mechanism is implemented by :c:func:`dmx_ts_cb()` and :cpp:func:`dmx_section_cb()`
125callbacks.
126
127.. kernel-doc:: drivers/media/dvb-core/demux.h
128
129Digital TV Conditional Access kABI
130----------------------------------
131
132.. kernel-doc:: drivers/media/dvb-core/dvb_ca_en50221.h
diff --git a/Documentation/media/kapi/mc-core.rst b/Documentation/media/kapi/mc-core.rst
new file mode 100644
index 000000000000..569cfc4f01cd
--- /dev/null
+++ b/Documentation/media/kapi/mc-core.rst
@@ -0,0 +1,263 @@
1Media Controller devices
2------------------------
3
4Media Controller
5~~~~~~~~~~~~~~~~
6
7The media controller userspace API is documented in
8:ref:`the Media Controller uAPI book <media_controller>`. This document focus
9on the kernel-side implementation of the media framework.
10
11Abstract media device model
12^^^^^^^^^^^^^^^^^^^^^^^^^^^
13
14Discovering a device internal topology, and configuring it at runtime, is one
15of the goals of the media framework. To achieve this, hardware devices are
16modelled as an oriented graph of building blocks called entities connected
17through pads.
18
19An entity is a basic media hardware building block. It can correspond to
20a large variety of logical blocks such as physical hardware devices
21(CMOS sensor for instance), logical hardware devices (a building block
22in a System-on-Chip image processing pipeline), DMA channels or physical
23connectors.
24
25A pad is a connection endpoint through which an entity can interact with
26other entities. Data (not restricted to video) produced by an entity
27flows from the entity's output to one or more entity inputs. Pads should
28not be confused with physical pins at chip boundaries.
29
30A link is a point-to-point oriented connection between two pads, either
31on the same entity or on different entities. Data flows from a source
32pad to a sink pad.
33
34Media device
35^^^^^^^^^^^^
36
37A media device is represented by a :c:type:`struct media_device <media_device>`
38instance, defined in ``include/media/media-device.h``.
39Allocation of the structure is handled by the media device driver, usually by
40embedding the :c:type:`media_device` instance in a larger driver-specific
41structure.
42
43Drivers register media device instances by calling
44:c:func:`__media_device_register()` via the macro ``media_device_register()``
45and unregistered by calling :c:func:`media_device_unregister()`.
46
47Entities
48^^^^^^^^
49
50Entities are represented by a :c:type:`struct media_entity <media_entity>`
51instance, defined in ``include/media/media-entity.h``. The structure is usually
52embedded into a higher-level structure, such as
53:c:type:`v4l2_subdev` or :c:type:`video_device`
54instances, although drivers can allocate entities directly.
55
56Drivers initialize entity pads by calling
57:c:func:`media_entity_pads_init()`.
58
59Drivers register entities with a media device by calling
60:c:func:`media_device_register_entity()`
61and unregistred by calling
62:c:func:`media_device_unregister_entity()`.
63
64Interfaces
65^^^^^^^^^^
66
67Interfaces are represented by a
68:c:type:`struct media_interface <media_interface>` instance, defined in
69``include/media/media-entity.h``. Currently, only one type of interface is
70defined: a device node. Such interfaces are represented by a
71:c:type:`struct media_intf_devnode <media_intf_devnode>`.
72
73Drivers initialize and create device node interfaces by calling
74:c:func:`media_devnode_create()`
75and remove them by calling:
76:c:func:`media_devnode_remove()`.
77
78Pads
79^^^^
80Pads are represented by a :c:type:`struct media_pad <media_pad>` instance,
81defined in ``include/media/media-entity.h``. Each entity stores its pads in
82a pads array managed by the entity driver. Drivers usually embed the array in
83a driver-specific structure.
84
85Pads are identified by their entity and their 0-based index in the pads
86array.
87
88Both information are stored in the :c:type:`struct media_pad`, making the
89:c:type:`media_pad` pointer the canonical way to store and pass link references.
90
91Pads have flags that describe the pad capabilities and state.
92
93``MEDIA_PAD_FL_SINK`` indicates that the pad supports sinking data.
94``MEDIA_PAD_FL_SOURCE`` indicates that the pad supports sourcing data.
95
96.. note::
97
98 One and only one of ``MEDIA_PAD_FL_SINK`` or ``MEDIA_PAD_FL_SOURCE`` must
99 be set for each pad.
100
101Links
102^^^^^
103
104Links are represented by a :c:type:`struct media_link <media_link>` instance,
105defined in ``include/media/media-entity.h``. There are two types of links:
106
107**1. pad to pad links**:
108
109Associate two entities via their PADs. Each entity has a list that points
110to all links originating at or targeting any of its pads.
111A given link is thus stored twice, once in the source entity and once in
112the target entity.
113
114Drivers create pad to pad links by calling:
115:c:func:`media_create_pad_link()` and remove with
116:c:func:`media_entity_remove_links()`.
117
118**2. interface to entity links**:
119
120Associate one interface to a Link.
121
122Drivers create interface to entity links by calling:
123:c:func:`media_create_intf_link()` and remove with
124:c:func:`media_remove_intf_links()`.
125
126.. note::
127
128 Links can only be created after having both ends already created.
129
130Links have flags that describe the link capabilities and state. The
131valid values are described at :c:func:`media_create_pad_link()` and
132:c:func:`media_create_intf_link()`.
133
134Graph traversal
135^^^^^^^^^^^^^^^
136
137The media framework provides APIs to iterate over entities in a graph.
138
139To iterate over all entities belonging to a media device, drivers can use
140the media_device_for_each_entity macro, defined in
141``include/media/media-device.h``.
142
143.. code-block:: c
144
145 struct media_entity *entity;
146
147 media_device_for_each_entity(entity, mdev) {
148 // entity will point to each entity in turn
149 ...
150 }
151
152Drivers might also need to iterate over all entities in a graph that can be
153reached only through enabled links starting at a given entity. The media
154framework provides a depth-first graph traversal API for that purpose.
155
156.. note::
157
158 Graphs with cycles (whether directed or undirected) are **NOT**
159 supported by the graph traversal API. To prevent infinite loops, the graph
160 traversal code limits the maximum depth to ``MEDIA_ENTITY_ENUM_MAX_DEPTH``,
161 currently defined as 16.
162
163Drivers initiate a graph traversal by calling
164:c:func:`media_entity_graph_walk_start()`
165
166The graph structure, provided by the caller, is initialized to start graph
167traversal at the given entity.
168
169Drivers can then retrieve the next entity by calling
170:c:func:`media_entity_graph_walk_next()`
171
172When the graph traversal is complete the function will return ``NULL``.
173
174Graph traversal can be interrupted at any moment. No cleanup function call
175is required and the graph structure can be freed normally.
176
177Helper functions can be used to find a link between two given pads, or a pad
178connected to another pad through an enabled link
179:c:func:`media_entity_find_link()` and
180:c:func:`media_entity_remote_pad()`.
181
182Use count and power handling
183^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184
185Due to the wide differences between drivers regarding power management
186needs, the media controller does not implement power management. However,
187the :c:type:`struct media_entity <media_entity>` includes a ``use_count``
188field that media drivers
189can use to track the number of users of every entity for power management
190needs.
191
192The :c:type:`media_entity<media_entity>`.\ ``use_count`` field is owned by
193media drivers and must not be
194touched by entity drivers. Access to the field must be protected by the
195:c:type:`media_device`.\ ``graph_mutex`` lock.
196
197Links setup
198^^^^^^^^^^^
199
200Link properties can be modified at runtime by calling
201:c:func:`media_entity_setup_link()`.
202
203Pipelines and media streams
204^^^^^^^^^^^^^^^^^^^^^^^^^^^
205
206When starting streaming, drivers must notify all entities in the pipeline to
207prevent link states from being modified during streaming by calling
208:c:func:`media_entity_pipeline_start()`.
209
210The function will mark all entities connected to the given entity through
211enabled links, either directly or indirectly, as streaming.
212
213The :c:type:`struct media_pipeline <media_pipeline>` instance pointed to by
214the pipe argument will be stored in every entity in the pipeline.
215Drivers should embed the :c:type:`struct media_pipeline <media_pipeline>`
216in higher-level pipeline structures and can then access the
217pipeline through the :c:type:`struct media_entity <media_entity>`
218pipe field.
219
220Calls to :c:func:`media_entity_pipeline_start()` can be nested.
221The pipeline pointer must be identical for all nested calls to the function.
222
223:c:func:`media_entity_pipeline_start()` may return an error. In that case,
224it will clean up any of the changes it did by itself.
225
226When stopping the stream, drivers must notify the entities with
227:c:func:`media_entity_pipeline_stop()`.
228
229If multiple calls to :c:func:`media_entity_pipeline_start()` have been
230made the same number of :c:func:`media_entity_pipeline_stop()` calls
231are required to stop streaming.
232The :c:type:`media_entity`.\ ``pipe`` field is reset to ``NULL`` on the last
233nested stop call.
234
235Link configuration will fail with ``-EBUSY`` by default if either end of the
236link is a streaming entity. Links that can be modified while streaming must
237be marked with the ``MEDIA_LNK_FL_DYNAMIC`` flag.
238
239If other operations need to be disallowed on streaming entities (such as
240changing entities configuration parameters) drivers can explicitly check the
241media_entity stream_count field to find out if an entity is streaming. This
242operation must be done with the media_device graph_mutex held.
243
244Link validation
245^^^^^^^^^^^^^^^
246
247Link validation is performed by :c:func:`media_entity_pipeline_start()`
248for any entity which has sink pads in the pipeline. The
249:c:type:`media_entity`.\ ``link_validate()`` callback is used for that
250purpose. In ``link_validate()`` callback, entity driver should check
251that the properties of the source pad of the connected entity and its own
252sink pad match. It is up to the type of the entity (and in the end, the
253properties of the hardware) what matching actually means.
254
255Subsystems should facilitate link validation by providing subsystem specific
256helper functions to provide easy access for commonly needed information, and
257in the end provide a way to use driver-specific callbacks.
258
259.. kernel-doc:: include/media/media-device.h
260
261.. kernel-doc:: include/media/media-devnode.h
262
263.. kernel-doc:: include/media/media-entity.h
diff --git a/Documentation/media/kapi/rc-core.rst b/Documentation/media/kapi/rc-core.rst
new file mode 100644
index 000000000000..a45895886257
--- /dev/null
+++ b/Documentation/media/kapi/rc-core.rst
@@ -0,0 +1,14 @@
1Remote Controller devices
2-------------------------
3
4Remote Controller core
5~~~~~~~~~~~~~~~~~~~~~~
6
7.. kernel-doc:: include/media/rc-core.h
8
9.. kernel-doc:: include/media/rc-map.h
10
11LIRC
12~~~~
13
14.. kernel-doc:: include/media/lirc_dev.h
diff --git a/Documentation/media/kapi/v4l2-clocks.rst b/Documentation/media/kapi/v4l2-clocks.rst
new file mode 100644
index 000000000000..b8a895860a8a
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-clocks.rst
@@ -0,0 +1,29 @@
1V4L2 clocks
2-----------
3
4.. attention::
5
6 This is a temporary API and it shall be replaced by the generic
7 clock API, when the latter becomes widely available.
8
9Many subdevices, like camera sensors, TV decoders and encoders, need a clock
10signal to be supplied by the system. Often this clock is supplied by the
11respective bridge device. The Linux kernel provides a Common Clock Framework for
12this purpose. However, it is not (yet) available on all architectures. Besides,
13the nature of the multi-functional (clock, data + synchronisation, I2C control)
14connection of subdevices to the system might impose special requirements on the
15clock API usage. E.g. V4L2 has to support clock provider driver unregistration
16while a subdevice driver is holding a reference to the clock. For these reasons
17a V4L2 clock helper API has been developed and is provided to bridge and
18subdevice drivers.
19
20The API consists of two parts: two functions to register and unregister a V4L2
21clock source: v4l2_clk_register() and v4l2_clk_unregister() and calls to control
22a clock object, similar to the respective generic clock API calls:
23v4l2_clk_get(), v4l2_clk_put(), v4l2_clk_enable(), v4l2_clk_disable(),
24v4l2_clk_get_rate(), and v4l2_clk_set_rate(). Clock suppliers have to provide
25clock operations that will be called when clock users invoke respective API
26methods.
27
28It is expected that once the CCF becomes available on all relevant
29architectures this API will be removed.
diff --git a/Documentation/media/kapi/v4l2-common.rst b/Documentation/media/kapi/v4l2-common.rst
new file mode 100644
index 000000000000..525d804871ff
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-common.rst
@@ -0,0 +1,6 @@
1V4L2 common functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-common.h
5
6.. kernel-doc:: include/media/v4l2-ioctl.h
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/media/kapi/v4l2-controls.rst
index f930b80e9111..07a179eeb2fb 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/media/kapi/v4l2-controls.rst
@@ -1,5 +1,8 @@
1V4L2 Controls
2=============
3
1Introduction 4Introduction
2============ 5------------
3 6
4The V4L2 control API seems simple enough, but quickly becomes very hard to 7The V4L2 control API seems simple enough, but quickly becomes very hard to
5implement correctly in drivers. But much of the code needed to handle controls 8implement correctly in drivers. But much of the code needed to handle controls
@@ -26,7 +29,7 @@ for V4L2 drivers and struct v4l2_subdev for sub-device drivers.
26 29
27 30
28Objects in the framework 31Objects in the framework
29======================== 32------------------------
30 33
31There are two main objects: 34There are two main objects:
32 35
@@ -39,12 +42,14 @@ controls, possibly to controls owned by other handlers.
39 42
40 43
41Basic usage for V4L2 and sub-device drivers 44Basic usage for V4L2 and sub-device drivers
42=========================================== 45-------------------------------------------
43 46
441) Prepare the driver: 471) Prepare the driver:
45 48
461.1) Add the handler to your driver's top-level struct: 491.1) Add the handler to your driver's top-level struct:
47 50
51.. code-block:: none
52
48 struct foo_dev { 53 struct foo_dev {
49 ... 54 ...
50 struct v4l2_ctrl_handler ctrl_handler; 55 struct v4l2_ctrl_handler ctrl_handler;
@@ -55,16 +60,20 @@ Basic usage for V4L2 and sub-device drivers
55 60
561.2) Initialize the handler: 611.2) Initialize the handler:
57 62
63.. code-block:: none
64
58 v4l2_ctrl_handler_init(&foo->ctrl_handler, nr_of_controls); 65 v4l2_ctrl_handler_init(&foo->ctrl_handler, nr_of_controls);
59 66
60 The second argument is a hint telling the function how many controls this 67The second argument is a hint telling the function how many controls this
61 handler is expected to handle. It will allocate a hashtable based on this 68handler is expected to handle. It will allocate a hashtable based on this
62 information. It is a hint only. 69information. It is a hint only.
63 70
641.3) Hook the control handler into the driver: 711.3) Hook the control handler into the driver:
65 72
661.3.1) For V4L2 drivers do this: 731.3.1) For V4L2 drivers do this:
67 74
75.. code-block:: none
76
68 struct foo_dev { 77 struct foo_dev {
69 ... 78 ...
70 struct v4l2_device v4l2_dev; 79 struct v4l2_device v4l2_dev;
@@ -75,15 +84,17 @@ Basic usage for V4L2 and sub-device drivers
75 84
76 foo->v4l2_dev.ctrl_handler = &foo->ctrl_handler; 85 foo->v4l2_dev.ctrl_handler = &foo->ctrl_handler;
77 86
78 Where foo->v4l2_dev is of type struct v4l2_device. 87Where foo->v4l2_dev is of type struct v4l2_device.
79 88
80 Finally, remove all control functions from your v4l2_ioctl_ops (if any): 89Finally, remove all control functions from your v4l2_ioctl_ops (if any):
81 vidioc_queryctrl, vidioc_query_ext_ctrl, vidioc_querymenu, vidioc_g_ctrl, 90vidioc_queryctrl, vidioc_query_ext_ctrl, vidioc_querymenu, vidioc_g_ctrl,
82 vidioc_s_ctrl, vidioc_g_ext_ctrls, vidioc_try_ext_ctrls and vidioc_s_ext_ctrls. 91vidioc_s_ctrl, vidioc_g_ext_ctrls, vidioc_try_ext_ctrls and vidioc_s_ext_ctrls.
83 Those are now no longer needed. 92Those are now no longer needed.
84 93
851.3.2) For sub-device drivers do this: 941.3.2) For sub-device drivers do this:
86 95
96.. code-block:: none
97
87 struct foo_dev { 98 struct foo_dev {
88 ... 99 ...
89 struct v4l2_subdev sd; 100 struct v4l2_subdev sd;
@@ -94,10 +105,12 @@ Basic usage for V4L2 and sub-device drivers
94 105
95 foo->sd.ctrl_handler = &foo->ctrl_handler; 106 foo->sd.ctrl_handler = &foo->ctrl_handler;
96 107
97 Where foo->sd is of type struct v4l2_subdev. 108Where foo->sd is of type struct v4l2_subdev.
98 109
991.4) Clean up the handler at the end: 1101.4) Clean up the handler at the end:
100 111
112.. code-block:: none
113
101 v4l2_ctrl_handler_free(&foo->ctrl_handler); 114 v4l2_ctrl_handler_free(&foo->ctrl_handler);
102 115
103 116
@@ -105,12 +118,16 @@ Basic usage for V4L2 and sub-device drivers
105 118
106You add non-menu controls by calling v4l2_ctrl_new_std: 119You add non-menu controls by calling v4l2_ctrl_new_std:
107 120
121.. code-block:: none
122
108 struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, 123 struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
109 const struct v4l2_ctrl_ops *ops, 124 const struct v4l2_ctrl_ops *ops,
110 u32 id, s32 min, s32 max, u32 step, s32 def); 125 u32 id, s32 min, s32 max, u32 step, s32 def);
111 126
112Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu: 127Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu:
113 128
129.. code-block:: none
130
114 struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, 131 struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
115 const struct v4l2_ctrl_ops *ops, 132 const struct v4l2_ctrl_ops *ops,
116 u32 id, s32 max, s32 skip_mask, s32 def); 133 u32 id, s32 max, s32 skip_mask, s32 def);
@@ -118,6 +135,8 @@ Menu and integer menu controls are added by calling v4l2_ctrl_new_std_menu:
118Menu controls with a driver specific menu are added by calling 135Menu controls with a driver specific menu are added by calling
119v4l2_ctrl_new_std_menu_items: 136v4l2_ctrl_new_std_menu_items:
120 137
138.. code-block:: none
139
121 struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items( 140 struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(
122 struct v4l2_ctrl_handler *hdl, 141 struct v4l2_ctrl_handler *hdl,
123 const struct v4l2_ctrl_ops *ops, u32 id, s32 max, 142 const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
@@ -126,12 +145,16 @@ v4l2_ctrl_new_std_menu_items:
126Integer menu controls with a driver specific menu can be added by calling 145Integer menu controls with a driver specific menu can be added by calling
127v4l2_ctrl_new_int_menu: 146v4l2_ctrl_new_int_menu:
128 147
148.. code-block:: none
149
129 struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, 150 struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
130 const struct v4l2_ctrl_ops *ops, 151 const struct v4l2_ctrl_ops *ops,
131 u32 id, s32 max, s32 def, const s64 *qmenu_int); 152 u32 id, s32 max, s32 def, const s64 *qmenu_int);
132 153
133These functions are typically called right after the v4l2_ctrl_handler_init: 154These functions are typically called right after the v4l2_ctrl_handler_init:
134 155
156.. code-block:: none
157
135 static const s64 exp_bias_qmenu[] = { 158 static const s64 exp_bias_qmenu[] = {
136 -2, -1, 0, 1, 2 159 -2, -1, 0, 1, 2
137 }; 160 };
@@ -208,6 +231,8 @@ a bit faster that way.
208 231
2093) Optionally force initial control setup: 2323) Optionally force initial control setup:
210 233
234.. code-block:: none
235
211 v4l2_ctrl_handler_setup(&foo->ctrl_handler); 236 v4l2_ctrl_handler_setup(&foo->ctrl_handler);
212 237
213This will call s_ctrl for all controls unconditionally. Effectively this 238This will call s_ctrl for all controls unconditionally. Effectively this
@@ -217,12 +242,16 @@ the hardware are in sync.
217 242
2184) Finally: implement the v4l2_ctrl_ops 2434) Finally: implement the v4l2_ctrl_ops
219 244
245.. code-block:: none
246
220 static const struct v4l2_ctrl_ops foo_ctrl_ops = { 247 static const struct v4l2_ctrl_ops foo_ctrl_ops = {
221 .s_ctrl = foo_s_ctrl, 248 .s_ctrl = foo_s_ctrl,
222 }; 249 };
223 250
224Usually all you need is s_ctrl: 251Usually all you need is s_ctrl:
225 252
253.. code-block:: none
254
226 static int foo_s_ctrl(struct v4l2_ctrl *ctrl) 255 static int foo_s_ctrl(struct v4l2_ctrl *ctrl)
227 { 256 {
228 struct foo *state = container_of(ctrl->handler, struct foo, ctrl_handler); 257 struct foo *state = container_of(ctrl->handler, struct foo, ctrl_handler);
@@ -247,16 +276,14 @@ to do any validation of control values, or implement QUERYCTRL, QUERY_EXT_CTRL
247and QUERYMENU. And G/S_CTRL as well as G/TRY/S_EXT_CTRLS are automatically supported. 276and QUERYMENU. And G/S_CTRL as well as G/TRY/S_EXT_CTRLS are automatically supported.
248 277
249 278
250============================================================================== 279.. note::
251
252The remainder of this document deals with more advanced topics and scenarios.
253In practice the basic usage as described above is sufficient for most drivers.
254 280
255=============================================================================== 281 The remainder sections deal with more advanced controls topics and scenarios.
282 In practice the basic usage as described above is sufficient for most drivers.
256 283
257 284
258Inheriting Controls 285Inheriting Controls
259=================== 286-------------------
260 287
261When a sub-device is registered with a V4L2 driver by calling 288When a sub-device is registered with a V4L2 driver by calling
262v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev 289v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev
@@ -271,21 +298,25 @@ of v4l2_device.
271 298
272 299
273Accessing Control Values 300Accessing Control Values
274======================== 301------------------------
275 302
276The following union is used inside the control framework to access control 303The following union is used inside the control framework to access control
277values: 304values:
278 305
279union v4l2_ctrl_ptr { 306.. code-block:: none
280 s32 *p_s32; 307
281 s64 *p_s64; 308 union v4l2_ctrl_ptr {
282 char *p_char; 309 s32 *p_s32;
283 void *p; 310 s64 *p_s64;
284}; 311 char *p_char;
312 void *p;
313 };
285 314
286The v4l2_ctrl struct contains these fields that can be used to access both 315The v4l2_ctrl struct contains these fields that can be used to access both
287current and new values: 316current and new values:
288 317
318.. code-block:: none
319
289 s32 val; 320 s32 val;
290 struct { 321 struct {
291 s32 val; 322 s32 val;
@@ -297,6 +328,8 @@ current and new values:
297 328
298If the control has a simple s32 type type, then: 329If the control has a simple s32 type type, then:
299 330
331.. code-block:: none
332
300 &ctrl->val == ctrl->p_new.p_s32 333 &ctrl->val == ctrl->p_new.p_s32
301 &ctrl->cur.val == ctrl->p_cur.p_s32 334 &ctrl->cur.val == ctrl->p_cur.p_s32
302 335
@@ -319,6 +352,8 @@ exception is for controls that return a volatile register such as a signal
319strength read-out that changes continuously. In that case you will need to 352strength read-out that changes continuously. In that case you will need to
320implement g_volatile_ctrl like this: 353implement g_volatile_ctrl like this:
321 354
355.. code-block:: none
356
322 static int foo_g_volatile_ctrl(struct v4l2_ctrl *ctrl) 357 static int foo_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
323 { 358 {
324 switch (ctrl->id) { 359 switch (ctrl->id) {
@@ -335,6 +370,8 @@ changes.
335 370
336To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE: 371To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE:
337 372
373.. code-block:: none
374
338 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); 375 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);
339 if (ctrl) 376 if (ctrl)
340 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; 377 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
@@ -354,6 +391,8 @@ not to introduce deadlocks.
354Outside of the control ops you have to go through to helper functions to get 391Outside of the control ops you have to go through to helper functions to get
355or set a single control value safely in your driver: 392or set a single control value safely in your driver:
356 393
394.. code-block:: none
395
357 s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); 396 s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
358 int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); 397 int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
359 398
@@ -363,6 +402,8 @@ will result in a deadlock since these helpers lock the handler as well.
363 402
364You can also take the handler lock yourself: 403You can also take the handler lock yourself:
365 404
405.. code-block:: none
406
366 mutex_lock(&state->ctrl_handler.lock); 407 mutex_lock(&state->ctrl_handler.lock);
367 pr_info("String value is '%s'\n", ctrl1->p_cur.p_char); 408 pr_info("String value is '%s'\n", ctrl1->p_cur.p_char);
368 pr_info("Integer value is '%s'\n", ctrl2->cur.val); 409 pr_info("Integer value is '%s'\n", ctrl2->cur.val);
@@ -370,10 +411,12 @@ You can also take the handler lock yourself:
370 411
371 412
372Menu Controls 413Menu Controls
373============= 414-------------
374 415
375The v4l2_ctrl struct contains this union: 416The v4l2_ctrl struct contains this union:
376 417
418.. code-block:: none
419
377 union { 420 union {
378 u32 step; 421 u32 step;
379 u32 menu_skip_mask; 422 u32 menu_skip_mask;
@@ -396,10 +439,12 @@ control, or by calling v4l2_ctrl_new_std_menu().
396 439
397 440
398Custom Controls 441Custom Controls
399=============== 442---------------
400 443
401Driver specific controls can be created using v4l2_ctrl_new_custom(): 444Driver specific controls can be created using v4l2_ctrl_new_custom():
402 445
446.. code-block:: none
447
403 static const struct v4l2_ctrl_config ctrl_filter = { 448 static const struct v4l2_ctrl_config ctrl_filter = {
404 .ops = &ctrl_custom_ops, 449 .ops = &ctrl_custom_ops,
405 .id = V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER, 450 .id = V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER,
@@ -422,7 +467,7 @@ control and will fill in the name, type and flags fields accordingly.
422 467
423 468
424Active and Grabbed Controls 469Active and Grabbed Controls
425=========================== 470---------------------------
426 471
427If you get more complex relationships between controls, then you may have to 472If you get more complex relationships between controls, then you may have to
428activate and deactivate controls. For example, if the Chroma AGC control is 473activate and deactivate controls. For example, if the Chroma AGC control is
@@ -446,16 +491,18 @@ starts or stops streaming.
446 491
447 492
448Control Clusters 493Control Clusters
449================ 494----------------
450 495
451By default all controls are independent from the others. But in more 496By default all controls are independent from the others. But in more
452complex scenarios you can get dependencies from one control to another. 497complex scenarios you can get dependencies from one control to another.
453In that case you need to 'cluster' them: 498In that case you need to 'cluster' them:
454 499
500.. code-block:: none
501
455 struct foo { 502 struct foo {
456 struct v4l2_ctrl_handler ctrl_handler; 503 struct v4l2_ctrl_handler ctrl_handler;
457#define AUDIO_CL_VOLUME (0) 504 #define AUDIO_CL_VOLUME (0)
458#define AUDIO_CL_MUTE (1) 505 #define AUDIO_CL_MUTE (1)
459 struct v4l2_ctrl *audio_cluster[2]; 506 struct v4l2_ctrl *audio_cluster[2];
460 ... 507 ...
461 }; 508 };
@@ -474,6 +521,8 @@ composite control. Similar to how a 'struct' works in C.
474So when s_ctrl is called with V4L2_CID_AUDIO_VOLUME as argument, you should set 521So when s_ctrl is called with V4L2_CID_AUDIO_VOLUME as argument, you should set
475all two controls belonging to the audio_cluster: 522all two controls belonging to the audio_cluster:
476 523
524.. code-block:: none
525
477 static int foo_s_ctrl(struct v4l2_ctrl *ctrl) 526 static int foo_s_ctrl(struct v4l2_ctrl *ctrl)
478 { 527 {
479 struct foo *state = container_of(ctrl->handler, struct foo, ctrl_handler); 528 struct foo *state = container_of(ctrl->handler, struct foo, ctrl_handler);
@@ -494,12 +543,16 @@ all two controls belonging to the audio_cluster:
494 543
495In the example above the following are equivalent for the VOLUME case: 544In the example above the following are equivalent for the VOLUME case:
496 545
546.. code-block:: none
547
497 ctrl == ctrl->cluster[AUDIO_CL_VOLUME] == state->audio_cluster[AUDIO_CL_VOLUME] 548 ctrl == ctrl->cluster[AUDIO_CL_VOLUME] == state->audio_cluster[AUDIO_CL_VOLUME]
498 ctrl->cluster[AUDIO_CL_MUTE] == state->audio_cluster[AUDIO_CL_MUTE] 549 ctrl->cluster[AUDIO_CL_MUTE] == state->audio_cluster[AUDIO_CL_MUTE]
499 550
500In practice using cluster arrays like this becomes very tiresome. So instead 551In practice using cluster arrays like this becomes very tiresome. So instead
501the following equivalent method is used: 552the following equivalent method is used:
502 553
554.. code-block:: none
555
503 struct { 556 struct {
504 /* audio cluster */ 557 /* audio cluster */
505 struct v4l2_ctrl *volume; 558 struct v4l2_ctrl *volume;
@@ -510,6 +563,8 @@ The anonymous struct is used to clearly 'cluster' these two control pointers,
510but it serves no other purpose. The effect is the same as creating an 563but it serves no other purpose. The effect is the same as creating an
511array with two control pointers. So you can just do: 564array with two control pointers. So you can just do:
512 565
566.. code-block:: none
567
513 state->volume = v4l2_ctrl_new_std(&state->ctrl_handler, ...); 568 state->volume = v4l2_ctrl_new_std(&state->ctrl_handler, ...);
514 state->mute = v4l2_ctrl_new_std(&state->ctrl_handler, ...); 569 state->mute = v4l2_ctrl_new_std(&state->ctrl_handler, ...);
515 v4l2_ctrl_cluster(2, &state->volume); 570 v4l2_ctrl_cluster(2, &state->volume);
@@ -539,7 +594,7 @@ The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup().
539 594
540 595
541Handling autogain/gain-type Controls with Auto Clusters 596Handling autogain/gain-type Controls with Auto Clusters
542======================================================= 597-------------------------------------------------------
543 598
544A common type of control cluster is one that handles 'auto-foo/foo'-type 599A common type of control cluster is one that handles 'auto-foo/foo'-type
545controls. Typical examples are autogain/gain, autoexposure/exposure, 600controls. Typical examples are autogain/gain, autoexposure/exposure,
@@ -564,8 +619,10 @@ changing that control affects the control flags of the manual controls.
564In order to simplify this a special variation of v4l2_ctrl_cluster was 619In order to simplify this a special variation of v4l2_ctrl_cluster was
565introduced: 620introduced:
566 621
567void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, 622.. code-block:: none
568 u8 manual_val, bool set_volatile); 623
624 void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
625 u8 manual_val, bool set_volatile);
569 626
570The first two arguments are identical to v4l2_ctrl_cluster. The third argument 627The first two arguments are identical to v4l2_ctrl_cluster. The third argument
571tells the framework which value switches the cluster into manual mode. The 628tells the framework which value switches the cluster into manual mode. The
@@ -582,7 +639,7 @@ flag and volatile handling.
582 639
583 640
584VIDIOC_LOG_STATUS Support 641VIDIOC_LOG_STATUS Support
585========================= 642-------------------------
586 643
587This ioctl allow you to dump the current status of a driver to the kernel log. 644This ioctl allow you to dump the current status of a driver to the kernel log.
588The v4l2_ctrl_handler_log_status(ctrl_handler, prefix) can be used to dump the 645The v4l2_ctrl_handler_log_status(ctrl_handler, prefix) can be used to dump the
@@ -592,7 +649,7 @@ for you.
592 649
593 650
594Different Handlers for Different Video Nodes 651Different Handlers for Different Video Nodes
595============================================ 652--------------------------------------------
596 653
597Usually the V4L2 driver has just one control handler that is global for 654Usually the V4L2 driver has just one control handler that is global for
598all video nodes. But you can also specify different control handlers for 655all video nodes. But you can also specify different control handlers for
@@ -617,6 +674,8 @@ of another handler (e.g. for a video device node), then you should first add
617the controls to the first handler, add the other controls to the second 674the controls to the first handler, add the other controls to the second
618handler and finally add the first handler to the second. For example: 675handler and finally add the first handler to the second. For example:
619 676
677.. code-block:: none
678
620 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_VOLUME, ...); 679 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_VOLUME, ...);
621 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...); 680 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...);
622 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...); 681 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...);
@@ -629,6 +688,8 @@ all controls.
629 688
630Or you can add specific controls to a handler: 689Or you can add specific controls to a handler:
631 690
691.. code-block:: none
692
632 volume = v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_AUDIO_VOLUME, ...); 693 volume = v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_AUDIO_VOLUME, ...);
633 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_BRIGHTNESS, ...); 694 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_BRIGHTNESS, ...);
634 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_CONTRAST, ...); 695 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_CONTRAST, ...);
@@ -636,6 +697,8 @@ Or you can add specific controls to a handler:
636What you should not do is make two identical controls for two handlers. 697What you should not do is make two identical controls for two handlers.
637For example: 698For example:
638 699
700.. code-block:: none
701
639 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...); 702 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...);
640 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_AUDIO_MUTE, ...); 703 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_AUDIO_MUTE, ...);
641 704
@@ -645,7 +708,7 @@ can twiddle.
645 708
646 709
647Finding Controls 710Finding Controls
648================ 711----------------
649 712
650Normally you have created the controls yourself and you can store the struct 713Normally you have created the controls yourself and you can store the struct
651v4l2_ctrl pointer into your own struct. 714v4l2_ctrl pointer into your own struct.
@@ -655,6 +718,8 @@ not own. For example, if you have to find a volume control from a subdev.
655 718
656You can do that by calling v4l2_ctrl_find: 719You can do that by calling v4l2_ctrl_find:
657 720
721.. code-block:: none
722
658 struct v4l2_ctrl *volume; 723 struct v4l2_ctrl *volume;
659 724
660 volume = v4l2_ctrl_find(sd->ctrl_handler, V4L2_CID_AUDIO_VOLUME); 725 volume = v4l2_ctrl_find(sd->ctrl_handler, V4L2_CID_AUDIO_VOLUME);
@@ -662,6 +727,8 @@ You can do that by calling v4l2_ctrl_find:
662Since v4l2_ctrl_find will lock the handler you have to be careful where you 727Since v4l2_ctrl_find will lock the handler you have to be careful where you
663use it. For example, this is not a good idea: 728use it. For example, this is not a good idea:
664 729
730.. code-block:: none
731
665 struct v4l2_ctrl_handler ctrl_handler; 732 struct v4l2_ctrl_handler ctrl_handler;
666 733
667 v4l2_ctrl_new_std(&ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...); 734 v4l2_ctrl_new_std(&ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...);
@@ -669,6 +736,8 @@ use it. For example, this is not a good idea:
669 736
670...and in video_ops.s_ctrl: 737...and in video_ops.s_ctrl:
671 738
739.. code-block:: none
740
672 case V4L2_CID_BRIGHTNESS: 741 case V4L2_CID_BRIGHTNESS:
673 contrast = v4l2_find_ctrl(&ctrl_handler, V4L2_CID_CONTRAST); 742 contrast = v4l2_find_ctrl(&ctrl_handler, V4L2_CID_CONTRAST);
674 ... 743 ...
@@ -680,7 +749,7 @@ It is recommended not to use this function from inside the control ops.
680 749
681 750
682Inheriting Controls 751Inheriting Controls
683=================== 752-------------------
684 753
685When one control handler is added to another using v4l2_ctrl_add_handler, then 754When one control handler is added to another using v4l2_ctrl_add_handler, then
686by default all controls from one are merged to the other. But a subdev might 755by default all controls from one are merged to the other. But a subdev might
@@ -689,6 +758,8 @@ not when it is used in consumer-level hardware. In that case you want to keep
689those low-level controls local to the subdev. You can do this by simply 758those low-level controls local to the subdev. You can do this by simply
690setting the 'is_private' flag of the control to 1: 759setting the 'is_private' flag of the control to 1:
691 760
761.. code-block:: none
762
692 static const struct v4l2_ctrl_config ctrl_private = { 763 static const struct v4l2_ctrl_config ctrl_private = {
693 .ops = &ctrl_custom_ops, 764 .ops = &ctrl_custom_ops,
694 .id = V4L2_CID_..., 765 .id = V4L2_CID_...,
@@ -705,7 +776,7 @@ These controls will now be skipped when v4l2_ctrl_add_handler is called.
705 776
706 777
707V4L2_CTRL_TYPE_CTRL_CLASS Controls 778V4L2_CTRL_TYPE_CTRL_CLASS Controls
708================================== 779----------------------------------
709 780
710Controls of this type can be used by GUIs to get the name of the control class. 781Controls of this type can be used by GUIs to get the name of the control class.
711A fully featured GUI can make a dialog with multiple tabs with each tab 782A fully featured GUI can make a dialog with multiple tabs with each tab
@@ -718,14 +789,16 @@ class is added.
718 789
719 790
720Adding Notify Callbacks 791Adding Notify Callbacks
721======================= 792-----------------------
722 793
723Sometimes the platform or bridge driver needs to be notified when a control 794Sometimes the platform or bridge driver needs to be notified when a control
724from a sub-device driver changes. You can set a notify callback by calling 795from a sub-device driver changes. You can set a notify callback by calling
725this function: 796this function:
726 797
727void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, 798.. code-block:: none
728 void (*notify)(struct v4l2_ctrl *ctrl, void *priv), void *priv); 799
800 void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl,
801 void (*notify)(struct v4l2_ctrl *ctrl, void *priv), void *priv);
729 802
730Whenever the give control changes value the notify callback will be called 803Whenever the give control changes value the notify callback will be called
731with a pointer to the control and the priv pointer that was passed with 804with a pointer to the control and the priv pointer that was passed with
@@ -734,3 +807,8 @@ notify function is called.
734 807
735There can be only one notify function per control handler. Any attempt 808There can be only one notify function per control handler. Any attempt
736to set another notify function will cause a WARN_ON. 809to set another notify function will cause a WARN_ON.
810
811v4l2_ctrl functions and data structures
812---------------------------------------
813
814.. kernel-doc:: include/media/v4l2-ctrls.h
diff --git a/Documentation/media/kapi/v4l2-core.rst b/Documentation/media/kapi/v4l2-core.rst
new file mode 100644
index 000000000000..e9677150ed99
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-core.rst
@@ -0,0 +1,26 @@
1Video2Linux devices
2-------------------
3
4.. toctree::
5 :maxdepth: 1
6
7 v4l2-intro
8 v4l2-dev
9 v4l2-device
10 v4l2-fh
11 v4l2-subdev
12 v4l2-event
13 v4l2-controls
14 v4l2-videobuf
15 v4l2-videobuf2
16 v4l2-clocks
17 v4l2-dv-timings
18 v4l2-flash-led-class
19 v4l2-mc
20 v4l2-mediabus
21 v4l2-mem2mem
22 v4l2-of
23 v4l2-rect
24 v4l2-tuner
25 v4l2-common
26 v4l2-tveeprom
diff --git a/Documentation/media/kapi/v4l2-dev.rst b/Documentation/media/kapi/v4l2-dev.rst
new file mode 100644
index 000000000000..cdfcf0bc78be
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-dev.rst
@@ -0,0 +1,363 @@
1Video device' s internal representation
2=======================================
3
4The actual device nodes in the ``/dev`` directory are created using the
5:c:type:`video_device` struct (``v4l2-dev.h``). This struct can either be
6allocated dynamically or embedded in a larger struct.
7
8To allocate it dynamically use :c:func:`video_device_alloc`:
9
10.. code-block:: c
11
12 struct video_device *vdev = video_device_alloc();
13
14 if (vdev == NULL)
15 return -ENOMEM;
16
17 vdev->release = video_device_release;
18
19If you embed it in a larger struct, then you must set the ``release()``
20callback to your own function:
21
22.. code-block:: c
23
24 struct video_device *vdev = &my_vdev->vdev;
25
26 vdev->release = my_vdev_release;
27
28The ``release()`` callback must be set and it is called when the last user
29of the video device exits.
30
31The default :c:func:`video_device_release` callback currently
32just calls ``kfree`` to free the allocated memory.
33
34There is also a ::c:func:`video_device_release_empty` function that does
35nothing (is empty) and should be used if the struct is embedded and there
36is nothing to do when it is released.
37
38You should also set these fields of :c:type:`video_device`:
39
40- :c:type:`video_device`->v4l2_dev: must be set to the :c:type:`v4l2_device`
41 parent device.
42
43- :c:type:`video_device`->name: set to something descriptive and unique.
44
45- :c:type:`video_device`->vfl_dir: set this to ``VFL_DIR_RX`` for capture
46 devices (``VFL_DIR_RX`` has value 0, so this is normally already the
47 default), set to ``VFL_DIR_TX`` for output devices and ``VFL_DIR_M2M`` for mem2mem (codec) devices.
48
49- :c:type:`video_device`->fops: set to the :c:type:`v4l2_file_operations`
50 struct.
51
52- :c:type:`video_device`->ioctl_ops: if you use the :c:type:`v4l2_ioctl_ops`
53 to simplify ioctl maintenance (highly recommended to use this and it might
54 become compulsory in the future!), then set this to your
55 :c:type:`v4l2_ioctl_ops` struct. The :c:type:`video_device`->vfl_type and
56 :c:type:`video_device`->vfl_dir fields are used to disable ops that do not
57 match the type/dir combination. E.g. VBI ops are disabled for non-VBI nodes,
58 and output ops are disabled for a capture device. This makes it possible to
59 provide just one :c:type:`v4l2_ioctl_ops struct` for both vbi and
60 video nodes.
61
62- :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the
63 locking in the driver. Otherwise you give it a pointer to a struct
64 ``mutex_lock`` and before the :c:type:`video_device`->unlocked_ioctl
65 file operation is called this lock will be taken by the core and released
66 afterwards. See the next section for more details.
67
68- :c:type:`video_device`->queue: a pointer to the struct :c:type:`vb2_queue`
69 associated with this device node.
70 If queue is not ``NULL``, and queue->lock is not ``NULL``, then queue->lock
71 is used for the queuing ioctls (``VIDIOC_REQBUFS``, ``CREATE_BUFS``,
72 ``QBUF``, ``DQBUF``, ``QUERYBUF``, ``PREPARE_BUF``, ``STREAMON`` and
73 ``STREAMOFF``) instead of the lock above.
74 That way the :ref:`vb2 <vb2_framework>` queuing framework does not have
75 to wait for other ioctls. This queue pointer is also used by the
76 :ref:`vb2 <vb2_framework>` helper functions to check for
77 queuing ownership (i.e. is the filehandle calling it allowed to do the
78 operation).
79
80- :c:type:`video_device`->prio: keeps track of the priorities. Used to
81 implement ``VIDIOC_G_PRIORITY`` and ``VIDIOC_S_PRIORITY``.
82 If left to ``NULL``, then it will use the struct :c:type:`v4l2_prio_state`
83 in :c:type:`v4l2_device`. If you want to have a separate priority state per
84 (group of) device node(s), then you can point it to your own struct
85 :c:type:`v4l2_prio_state`.
86
87- :c:type:`video_device`->dev_parent: you only set this if v4l2_device was
88 registered with ``NULL`` as the parent ``device`` struct. This only happens
89 in cases where one hardware device has multiple PCI devices that all share
90 the same :c:type:`v4l2_device` core.
91
92 The cx88 driver is an example of this: one core :c:type:`v4l2_device` struct,
93 but it is used by both a raw video PCI device (cx8800) and a MPEG PCI device
94 (cx8802). Since the :c:type:`v4l2_device` cannot be associated with two PCI
95 devices at the same time it is setup without a parent device. But when the
96 struct :c:type:`video_device` is initialized you **do** know which parent
97 PCI device to use and so you set ``dev_device`` to the correct PCI device.
98
99If you use :c:type:`v4l2_ioctl_ops`, then you should set
100:c:type:`video_device`->unlocked_ioctl to :c:func:`video_ioctl2` in your
101:c:type:`v4l2_file_operations` struct.
102
103In some cases you want to tell the core that a function you had specified in
104your :c:type:`v4l2_ioctl_ops` should be ignored. You can mark such ioctls by
105calling this function before :c:func:`video_register_device` is called:
106
107 :c:func:`v4l2_disable_ioctl <v4l2_disable_ioctl>`
108 (:c:type:`vdev <video_device>`, cmd).
109
110This tends to be needed if based on external factors (e.g. which card is
111being used) you want to turns off certain features in :c:type:`v4l2_ioctl_ops`
112without having to make a new struct.
113
114The :c:type:`v4l2_file_operations` struct is a subset of file_operations.
115The main difference is that the inode argument is omitted since it is never
116used.
117
118If integration with the media framework is needed, you must initialize the
119:c:type:`media_entity` struct embedded in the :c:type:`video_device` struct
120(entity field) by calling :c:func:`media_entity_pads_init`:
121
122.. code-block:: c
123
124 struct media_pad *pad = &my_vdev->pad;
125 int err;
126
127 err = media_entity_pads_init(&vdev->entity, 1, pad);
128
129The pads array must have been previously initialized. There is no need to
130manually set the struct media_entity type and name fields.
131
132A reference to the entity will be automatically acquired/released when the
133video device is opened/closed.
134
135ioctls and locking
136------------------
137
138The V4L core provides optional locking services. The main service is the
139lock field in struct :c:type:`video_device`, which is a pointer to a mutex.
140If you set this pointer, then that will be used by unlocked_ioctl to
141serialize all ioctls.
142
143If you are using the :ref:`videobuf2 framework <vb2_framework>`, then there
144is a second lock that you can set: :c:type:`video_device`->queue->lock. If
145set, then this lock will be used instead of :c:type:`video_device`->lock
146to serialize all queuing ioctls (see the previous section
147for the full list of those ioctls).
148
149The advantage of using a different lock for the queuing ioctls is that for some
150drivers (particularly USB drivers) certain commands such as setting controls
151can take a long time, so you want to use a separate lock for the buffer queuing
152ioctls. That way your ``VIDIOC_DQBUF`` doesn't stall because the driver is busy
153changing the e.g. exposure of the webcam.
154
155Of course, you can always do all the locking yourself by leaving both lock
156pointers at ``NULL``.
157
158If you use the old :ref:`videobuf framework <vb_framework>` then you must
159pass the :c:type:`video_device`->lock to the videobuf queue initialize
160function: if videobuf has to wait for a frame to arrive, then it will
161temporarily unlock the lock and relock it afterwards. If your driver also
162waits in the code, then you should do the same to allow other
163processes to access the device node while the first process is waiting for
164something.
165
166In the case of :ref:`videobuf2 <vb2_framework>` you will need to implement the
167``wait_prepare()`` and ``wait_finish()`` callbacks to unlock/lock if applicable.
168If you use the ``queue->lock`` pointer, then you can use the helper functions
169:c:func:`vb2_ops_wait_prepare` and :cpp:func:`vb2_ops_wait_finish`.
170
171The implementation of a hotplug disconnect should also take the lock from
172:c:type:`video_device` before calling v4l2_device_disconnect. If you are also
173using :c:type:`video_device`->queue->lock, then you have to first lock
174:c:type:`video_device`->queue->lock followed by :c:type:`video_device`->lock.
175That way you can be sure no ioctl is running when you call
176:c:type:`v4l2_device_disconnect`.
177
178Video device registration
179-------------------------
180
181Next you register the video device with :c:func:`video_register_device`.
182This will create the character device for you.
183
184.. code-block:: c
185
186 err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
187 if (err) {
188 video_device_release(vdev); /* or kfree(my_vdev); */
189 return err;
190 }
191
192If the :c:type:`v4l2_device` parent device has a not ``NULL`` mdev field,
193the video device entity will be automatically registered with the media
194device.
195
196Which device is registered depends on the type argument. The following
197types exist:
198
199- ``VFL_TYPE_GRABBER``: ``/dev/videoX`` for video input/output devices
200- ``VFL_TYPE_VBI``: ``/dev/vbiX`` for vertical blank data (i.e. closed captions, teletext)
201- ``VFL_TYPE_RADIO``: ``/dev/radioX`` for radio tuners
202- ``VFL_TYPE_SDR``: ``/dev/swradioX`` for Software Defined Radio tuners
203
204The last argument gives you a certain amount of control over the device
205device node number used (i.e. the X in ``videoX``). Normally you will pass -1
206to let the v4l2 framework pick the first free number. But sometimes users
207want to select a specific node number. It is common that drivers allow
208the user to select a specific device node number through a driver module
209option. That number is then passed to this function and video_register_device
210will attempt to select that device node number. If that number was already
211in use, then the next free device node number will be selected and it
212will send a warning to the kernel log.
213
214Another use-case is if a driver creates many devices. In that case it can
215be useful to place different video devices in separate ranges. For example,
216video capture devices start at 0, video output devices start at 16.
217So you can use the last argument to specify a minimum device node number
218and the v4l2 framework will try to pick the first free number that is equal
219or higher to what you passed. If that fails, then it will just pick the
220first free number.
221
222Since in this case you do not care about a warning about not being able
223to select the specified device node number, you can call the function
224:c:func:`video_register_device_no_warn` instead.
225
226Whenever a device node is created some attributes are also created for you.
227If you look in ``/sys/class/video4linux`` you see the devices. Go into e.g.
228``video0`` and you will see 'name', 'dev_debug' and 'index' attributes. The
229'name' attribute is the 'name' field of the video_device struct. The
230'dev_debug' attribute can be used to enable core debugging. See the next
231section for more detailed information on this.
232
233The 'index' attribute is the index of the device node: for each call to
234:c:func:`video_register_device()` the index is just increased by 1. The
235first video device node you register always starts with index 0.
236
237Users can setup udev rules that utilize the index attribute to make fancy
238device names (e.g. '``mpegX``' for MPEG video capture device nodes).
239
240After the device was successfully registered, then you can use these fields:
241
242- :c:type:`video_device`->vfl_type: the device type passed to
243 :c:func:`video_register_device`.
244- :c:type:`video_device`->minor: the assigned device minor number.
245- :c:type:`video_device`->num: the device node number (i.e. the X in
246 ``videoX``).
247- :c:type:`video_device`->index: the device index number.
248
249If the registration failed, then you need to call
250:c:func:`video_device_release` to free the allocated :c:type:`video_device`
251struct, or free your own struct if the :c:type:`video_device` was embedded in
252it. The ``vdev->release()`` callback will never be called if the registration
253failed, nor should you ever attempt to unregister the device if the
254registration failed.
255
256video device debugging
257----------------------
258
259The 'dev_debug' attribute that is created for each video, vbi, radio or swradio
260device in ``/sys/class/video4linux/<devX>/`` allows you to enable logging of
261file operations.
262
263It is a bitmask and the following bits can be set:
264
265
266===== ================================================================
267Mask Description
268===== ================================================================
2690x01 Log the ioctl name and error code. VIDIOC_(D)QBUF ioctls are
270 only logged if bit 0x08 is also set.
2710x02 Log the ioctl name arguments and error code. VIDIOC_(D)QBUF
272 ioctls are
273 only logged if bit 0x08 is also set.
2740x04 Log the file operations open, release, read, write, mmap and
275 get_unmapped_area. The read and write operations are only
276 logged if bit 0x08 is also set.
2770x08 Log the read and write file operations and the VIDIOC_QBUF and
278 VIDIOC_DQBUF ioctls.
2790x10 Log the poll file operation.
280===== ================================================================
281
282Video device cleanup
283--------------------
284
285When the video device nodes have to be removed, either during the unload
286of the driver or because the USB device was disconnected, then you should
287unregister them with:
288
289 :c:func:`video_unregister_device`
290 (:c:type:`vdev <video_device>`);
291
292This will remove the device nodes from sysfs (causing udev to remove them
293from ``/dev``).
294
295After :c:func:`video_unregister_device` returns no new opens can be done.
296However, in the case of USB devices some application might still have one of
297these device nodes open. So after the unregister all file operations (except
298release, of course) will return an error as well.
299
300When the last user of the video device node exits, then the ``vdev->release()``
301callback is called and you can do the final cleanup there.
302
303Don't forget to cleanup the media entity associated with the video device if
304it has been initialized:
305
306 :c:func:`media_entity_cleanup <media_entity_cleanup>`
307 (&vdev->entity);
308
309This can be done from the release callback.
310
311
312helper functions
313----------------
314
315There are a few useful helper functions:
316
317- file and :c:type:`video_device` private data
318
319You can set/get driver private data in the video_device struct using:
320
321 :c:func:`video_get_drvdata <video_get_drvdata>`
322 (:c:type:`vdev <video_device>`);
323
324 :c:func:`video_set_drvdata <video_set_drvdata>`
325 (:c:type:`vdev <video_device>`);
326
327Note that you can safely call :c:func:`video_set_drvdata` before calling
328:c:func:`video_register_device`.
329
330And this function:
331
332 :c:func:`video_devdata <video_devdata>`
333 (struct file \*file);
334
335returns the video_device belonging to the file struct.
336
337The :c:func:`video_devdata` function combines :cpp:func:`video_get_drvdata`
338with :c:func:`video_devdata`:
339
340 :c:func:`video_drvdata <video_drvdata>`
341 (struct file \*file);
342
343You can go from a :c:type:`video_device` struct to the v4l2_device struct using:
344
345.. code-block:: c
346
347 struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
348
349- Device node name
350
351The :c:type:`video_device` node kernel name can be retrieved using:
352
353 :c:func:`video_device_node_name <video_device_node_name>`
354 (:c:type:`vdev <video_device>`);
355
356The name is used as a hint by userspace tools such as udev. The function
357should be used where possible instead of accessing the video_device::num and
358video_device::minor fields.
359
360video_device functions and data structures
361------------------------------------------
362
363.. kernel-doc:: include/media/v4l2-dev.h
diff --git a/Documentation/media/kapi/v4l2-device.rst b/Documentation/media/kapi/v4l2-device.rst
new file mode 100644
index 000000000000..6c58bbbaa66f
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-device.rst
@@ -0,0 +1,144 @@
1V4L2 device instance
2--------------------
3
4Each device instance is represented by a struct :c:type:`v4l2_device`.
5Very simple devices can just allocate this struct, but most of the time you
6would embed this struct inside a larger struct.
7
8You must register the device instance by calling:
9
10 :c:func:`v4l2_device_register <v4l2_device_register>`
11 (dev, :c:type:`v4l2_dev <v4l2_device>`).
12
13Registration will initialize the :c:type:`v4l2_device` struct. If the
14dev->driver_data field is ``NULL``, it will be linked to
15:c:type:`v4l2_dev <v4l2_device>` argument.
16
17Drivers that want integration with the media device framework need to set
18dev->driver_data manually to point to the driver-specific device structure
19that embed the struct :c:type:`v4l2_device` instance. This is achieved by a
20``dev_set_drvdata()`` call before registering the V4L2 device instance.
21They must also set the struct :c:type:`v4l2_device` mdev field to point to a
22properly initialized and registered :c:type:`media_device` instance.
23
24If :c:type:`v4l2_dev <v4l2_device>`\ ->name is empty then it will be set to a
25value derived from dev (driver name followed by the bus_id, to be precise).
26If you set it up before calling :c:func:`v4l2_device_register` then it will
27be untouched. If dev is ``NULL``, then you **must** setup
28:c:type:`v4l2_dev <v4l2_device>`\ ->name before calling
29:c:func:`v4l2_device_register`.
30
31You can use :c:func:`v4l2_device_set_name` to set the name based on a driver
32name and a driver-global atomic_t instance. This will generate names like
33``ivtv0``, ``ivtv1``, etc. If the name ends with a digit, then it will insert
34a dash: ``cx18-0``, ``cx18-1``, etc. This function returns the instance number.
35
36The first ``dev`` argument is normally the ``struct device`` pointer of a
37``pci_dev``, ``usb_interface`` or ``platform_device``. It is rare for dev to
38be ``NULL``, but it happens with ISA devices or when one device creates
39multiple PCI devices, thus making it impossible to associate
40:c:type:`v4l2_dev <v4l2_device>` with a particular parent.
41
42You can also supply a ``notify()`` callback that can be called by sub-devices
43to notify you of events. Whether you need to set this depends on the
44sub-device. Any notifications a sub-device supports must be defined in a header
45in ``include/media/subdevice.h``.
46
47V4L2 devices are unregistered by calling:
48
49 :c:func:`v4l2_device_unregister`
50 (:c:type:`v4l2_dev <v4l2_device>`).
51
52If the dev->driver_data field points to :c:type:`v4l2_dev <v4l2_device>`,
53it will be reset to ``NULL``. Unregistering will also automatically unregister
54all subdevs from the device.
55
56If you have a hotpluggable device (e.g. a USB device), then when a disconnect
57happens the parent device becomes invalid. Since :c:type:`v4l2_device` has a
58pointer to that parent device it has to be cleared as well to mark that the
59parent is gone. To do this call:
60
61 :c:func:`v4l2_device_disconnect`
62 (:c:type:`v4l2_dev <v4l2_device>`).
63
64This does *not* unregister the subdevs, so you still need to call the
65:c:func:`v4l2_device_unregister` function for that. If your driver is not
66hotpluggable, then there is no need to call :c:func:`v4l2_device_disconnect`.
67
68Sometimes you need to iterate over all devices registered by a specific
69driver. This is usually the case if multiple device drivers use the same
70hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv
71hardware. The same is true for alsa drivers for example.
72
73You can iterate over all registered devices as follows:
74
75.. code-block:: c
76
77 static int callback(struct device *dev, void *p)
78 {
79 struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
80
81 /* test if this device was inited */
82 if (v4l2_dev == NULL)
83 return 0;
84 ...
85 return 0;
86 }
87
88 int iterate(void *p)
89 {
90 struct device_driver *drv;
91 int err;
92
93 /* Find driver 'ivtv' on the PCI bus.
94 pci_bus_type is a global. For USB busses use usb_bus_type. */
95 drv = driver_find("ivtv", &pci_bus_type);
96 /* iterate over all ivtv device instances */
97 err = driver_for_each_device(drv, NULL, p, callback);
98 put_driver(drv);
99 return err;
100 }
101
102Sometimes you need to keep a running counter of the device instance. This is
103commonly used to map a device instance to an index of a module option array.
104
105The recommended approach is as follows:
106
107.. code-block:: c
108
109 static atomic_t drv_instance = ATOMIC_INIT(0);
110
111 static int drv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
112 {
113 ...
114 state->instance = atomic_inc_return(&drv_instance) - 1;
115 }
116
117If you have multiple device nodes then it can be difficult to know when it is
118safe to unregister :c:type:`v4l2_device` for hotpluggable devices. For this
119purpose :c:type:`v4l2_device` has refcounting support. The refcount is
120increased whenever :c:func:`video_register_device` is called and it is
121decreased whenever that device node is released. When the refcount reaches
122zero, then the :c:type:`v4l2_device` release() callback is called. You can
123do your final cleanup there.
124
125If other device nodes (e.g. ALSA) are created, then you can increase and
126decrease the refcount manually as well by calling:
127
128 :c:func:`v4l2_device_get`
129 (:c:type:`v4l2_dev <v4l2_device>`).
130
131or:
132
133 :c:func:`v4l2_device_put`
134 (:c:type:`v4l2_dev <v4l2_device>`).
135
136Since the initial refcount is 1 you also need to call
137:c:func:`v4l2_device_put` in the ``disconnect()`` callback (for USB devices)
138or in the ``remove()`` callback (for e.g. PCI devices), otherwise the refcount
139will never reach 0.
140
141v4l2_device functions and data structures
142^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
144.. kernel-doc:: include/media/v4l2-device.h
diff --git a/Documentation/media/kapi/v4l2-dv-timings.rst b/Documentation/media/kapi/v4l2-dv-timings.rst
new file mode 100644
index 000000000000..55274329d229
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-dv-timings.rst
@@ -0,0 +1,4 @@
1V4L2 DV Timings functions
2^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-dv-timings.h
diff --git a/Documentation/media/kapi/v4l2-event.rst b/Documentation/media/kapi/v4l2-event.rst
new file mode 100644
index 000000000000..f962686a7b63
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-event.rst
@@ -0,0 +1,137 @@
1
2V4L2 events
3-----------
4
5The V4L2 events provide a generic way to pass events to user space.
6The driver must use :c:type:`v4l2_fh` to be able to support V4L2 events.
7
8Events are defined by a type and an optional ID. The ID may refer to a V4L2
9object such as a control ID. If unused, then the ID is 0.
10
11When the user subscribes to an event the driver will allocate a number of
12kevent structs for that event. So every (type, ID) event tuple will have
13its own set of kevent structs. This guarantees that if a driver is generating
14lots of events of one type in a short time, then that will not overwrite
15events of another type.
16
17But if you get more events of one type than the number of kevents that were
18reserved, then the oldest event will be dropped and the new one added.
19
20Furthermore, the internal struct :c:type:`v4l2_subscribed_event` has
21``merge()`` and ``replace()`` callbacks which drivers can set. These
22callbacks are called when a new event is raised and there is no more room.
23The ``replace()`` callback allows you to replace the payload of the old event
24with that of the new event, merging any relevant data from the old payload
25into the new payload that replaces it. It is called when this event type has
26only one kevent struct allocated. The ``merge()`` callback allows you to merge
27the oldest event payload into that of the second-oldest event payload. It is
28called when there are two or more kevent structs allocated.
29
30This way no status information is lost, just the intermediate steps leading
31up to that state.
32
33A good example of these ``replace``/``merge`` callbacks is in v4l2-event.c:
34``ctrls_replace()`` and ``ctrls_merge()`` callbacks for the control event.
35
36.. note::
37 these callbacks can be called from interrupt context, so they must
38 be fast.
39
40In order to queue events to video device, drivers should call:
41
42 :c:func:`v4l2_event_queue <v4l2_event_queue>`
43 (:c:type:`vdev <video_device>`, :ref:`ev <v4l2-event>`)
44
45The driver's only responsibility is to fill in the type and the data fields.
46The other fields will be filled in by V4L2.
47
48Event subscription
49~~~~~~~~~~~~~~~~~~
50
51Subscribing to an event is via:
52
53 :c:func:`v4l2_event_subscribe <v4l2_event_subscribe>`
54 (:c:type:`fh <v4l2_fh>`, :ref:`sub <v4l2-event-subscription>` ,
55 elems, :c:type:`ops <v4l2_subscribed_event_ops>`)
56
57
58This function is used to implement :c:type:`video_device`->
59:c:type:`ioctl_ops <v4l2_ioctl_ops>`-> ``vidioc_subscribe_event``,
60but the driver must check first if the driver is able to produce events
61with specified event id, and then should call
62:c:func:`v4l2_event_subscribe` to subscribe the event.
63
64The elems argument is the size of the event queue for this event. If it is 0,
65then the framework will fill in a default value (this depends on the event
66type).
67
68The ops argument allows the driver to specify a number of callbacks:
69
70======== ==============================================================
71Callback Description
72======== ==============================================================
73add called when a new listener gets added (subscribing to the same
74 event twice will only cause this callback to get called once)
75del called when a listener stops listening
76replace replace event 'old' with event 'new'.
77merge merge event 'old' into event 'new'.
78======== ==============================================================
79
80All 4 callbacks are optional, if you don't want to specify any callbacks
81the ops argument itself maybe ``NULL``.
82
83Unsubscribing an event
84~~~~~~~~~~~~~~~~~~~~~~
85
86Unsubscribing to an event is via:
87
88 :c:func:`v4l2_event_unsubscribe <v4l2_event_unsubscribe>`
89 (:c:type:`fh <v4l2_fh>`, :ref:`sub <v4l2-event-subscription>`)
90
91This function is used to implement :c:type:`video_device`->
92:c:type:`ioctl_ops <v4l2_ioctl_ops>`-> ``vidioc_unsubscribe_event``.
93A driver may call :c:func:`v4l2_event_unsubscribe` directly unless it
94wants to be involved in unsubscription process.
95
96The special type ``V4L2_EVENT_ALL`` may be used to unsubscribe all events. The
97drivers may want to handle this in a special way.
98
99Check if there's a pending event
100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
102Checking if there's a pending event is via:
103
104 :c:func:`v4l2_event_pending <v4l2_event_pending>`
105 (:c:type:`fh <v4l2_fh>`)
106
107
108This function returns the number of pending events. Useful when implementing
109poll.
110
111How events work
112~~~~~~~~~~~~~~~
113
114Events are delivered to user space through the poll system call. The driver
115can use :c:type:`v4l2_fh`->wait (a wait_queue_head_t) as the argument for
116``poll_wait()``.
117
118There are standard and private events. New standard events must use the
119smallest available event type. The drivers must allocate their events from
120their own class starting from class base. Class base is
121``V4L2_EVENT_PRIVATE_START`` + n * 1000 where n is the lowest available number.
122The first event type in the class is reserved for future use, so the first
123available event type is 'class base + 1'.
124
125An example on how the V4L2 events may be used can be found in the OMAP
1263 ISP driver (``drivers/media/platform/omap3isp``).
127
128A subdev can directly send an event to the :c:type:`v4l2_device` notify
129function with ``V4L2_DEVICE_NOTIFY_EVENT``. This allows the bridge to map
130the subdev that sends the event to the video node(s) associated with the
131subdev that need to be informed about such an event.
132
133V4L2 event functions and data structures
134^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135
136.. kernel-doc:: include/media/v4l2-event.h
137
diff --git a/Documentation/media/kapi/v4l2-fh.rst b/Documentation/media/kapi/v4l2-fh.rst
new file mode 100644
index 000000000000..9e87d5ca3e4a
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-fh.rst
@@ -0,0 +1,139 @@
1V4L2 File handlers
2------------------
3
4struct :c:type:`v4l2_fh` provides a way to easily keep file handle specific
5data that is used by the V4L2 framework.
6
7.. attention::
8 New drivers must use struct :c:type:`v4l2_fh`
9 since it is also used to implement priority handling
10 (:ref:`VIDIOC_G_PRIORITY`).
11
12The users of :c:type:`v4l2_fh` (in the V4L2 framework, not the driver) know
13whether a driver uses :c:type:`v4l2_fh` as its ``file->private_data`` pointer
14by testing the ``V4L2_FL_USES_V4L2_FH`` bit in :c:type:`video_device`->flags.
15This bit is set whenever :c:func:`v4l2_fh_init` is called.
16
17struct :c:type:`v4l2_fh` is allocated as a part of the driver's own file handle
18structure and ``file->private_data`` is set to it in the driver's ``open()``
19function by the driver.
20
21In many cases the struct :c:type:`v4l2_fh` will be embedded in a larger
22structure. In that case you should call:
23
24#) :c:func:`v4l2_fh_init` and :cpp:func:`v4l2_fh_add` in ``open()``
25#) :c:func:`v4l2_fh_del` and :cpp:func:`v4l2_fh_exit` in ``release()``
26
27Drivers can extract their own file handle structure by using the container_of
28macro.
29
30Example:
31
32.. code-block:: c
33
34 struct my_fh {
35 int blah;
36 struct v4l2_fh fh;
37 };
38
39 ...
40
41 int my_open(struct file *file)
42 {
43 struct my_fh *my_fh;
44 struct video_device *vfd;
45 int ret;
46
47 ...
48
49 my_fh = kzalloc(sizeof(*my_fh), GFP_KERNEL);
50
51 ...
52
53 v4l2_fh_init(&my_fh->fh, vfd);
54
55 ...
56
57 file->private_data = &my_fh->fh;
58 v4l2_fh_add(&my_fh->fh);
59 return 0;
60 }
61
62 int my_release(struct file *file)
63 {
64 struct v4l2_fh *fh = file->private_data;
65 struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
66
67 ...
68 v4l2_fh_del(&my_fh->fh);
69 v4l2_fh_exit(&my_fh->fh);
70 kfree(my_fh);
71 return 0;
72 }
73
74Below is a short description of the :c:type:`v4l2_fh` functions used:
75
76:c:func:`v4l2_fh_init <v4l2_fh_init>`
77(:c:type:`fh <v4l2_fh>`, :c:type:`vdev <video_device>`)
78
79
80- Initialise the file handle. This **MUST** be performed in the driver's
81 :c:type:`v4l2_file_operations`->open() handler.
82
83
84:c:func:`v4l2_fh_add <v4l2_fh_add>`
85(:c:type:`fh <v4l2_fh>`)
86
87- Add a :c:type:`v4l2_fh` to :c:type:`video_device` file handle list.
88 Must be called once the file handle is completely initialized.
89
90:c:func:`v4l2_fh_del <v4l2_fh_del>`
91(:c:type:`fh <v4l2_fh>`)
92
93- Unassociate the file handle from :c:type:`video_device`. The file handle
94 exit function may now be called.
95
96:c:func:`v4l2_fh_exit <v4l2_fh_exit>`
97(:c:type:`fh <v4l2_fh>`)
98
99- Uninitialise the file handle. After uninitialisation the :c:type:`v4l2_fh`
100 memory can be freed.
101
102
103If struct :c:type:`v4l2_fh` is not embedded, then you can use these helper functions:
104
105:c:func:`v4l2_fh_open <v4l2_fh_open>`
106(struct file \*filp)
107
108- This allocates a struct :c:type:`v4l2_fh`, initializes it and adds it to
109 the struct :c:type:`video_device` associated with the file struct.
110
111:c:func:`v4l2_fh_release <v4l2_fh_release>`
112(struct file \*filp)
113
114- This deletes it from the struct :c:type:`video_device` associated with the
115 file struct, uninitialised the :c:type:`v4l2_fh` and frees it.
116
117These two functions can be plugged into the v4l2_file_operation's ``open()``
118and ``release()`` ops.
119
120Several drivers need to do something when the first file handle is opened and
121when the last file handle closes. Two helper functions were added to check
122whether the :c:type:`v4l2_fh` struct is the only open filehandle of the
123associated device node:
124
125:c:func:`v4l2_fh_is_singular <v4l2_fh_is_singular>`
126(:c:type:`fh <v4l2_fh>`)
127
128- Returns 1 if the file handle is the only open file handle, else 0.
129
130:c:func:`v4l2_fh_is_singular_file <v4l2_fh_is_singular_file>`
131(struct file \*filp)
132
133- Same, but it calls v4l2_fh_is_singular with filp->private_data.
134
135
136V4L2 fh functions and data structures
137^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138
139.. kernel-doc:: include/media/v4l2-fh.h
diff --git a/Documentation/media/kapi/v4l2-flash-led-class.rst b/Documentation/media/kapi/v4l2-flash-led-class.rst
new file mode 100644
index 000000000000..20798bdac387
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-flash-led-class.rst
@@ -0,0 +1,4 @@
1V4L2 flash functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-flash-led-class.h
diff --git a/Documentation/media/kapi/v4l2-intro.rst b/Documentation/media/kapi/v4l2-intro.rst
new file mode 100644
index 000000000000..e614d8d4ca1c
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-intro.rst
@@ -0,0 +1,74 @@
1Introduction
2------------
3
4The V4L2 drivers tend to be very complex due to the complexity of the
5hardware: most devices have multiple ICs, export multiple device nodes in
6/dev, and create also non-V4L2 devices such as DVB, ALSA, FB, I2C and input
7(IR) devices.
8
9Especially the fact that V4L2 drivers have to setup supporting ICs to
10do audio/video muxing/encoding/decoding makes it more complex than most.
11Usually these ICs are connected to the main bridge driver through one or
12more I2C busses, but other busses can also be used. Such devices are
13called 'sub-devices'.
14
15For a long time the framework was limited to the video_device struct for
16creating V4L device nodes and video_buf for handling the video buffers
17(note that this document does not discuss the video_buf framework).
18
19This meant that all drivers had to do the setup of device instances and
20connecting to sub-devices themselves. Some of this is quite complicated
21to do right and many drivers never did do it correctly.
22
23There is also a lot of common code that could never be refactored due to
24the lack of a framework.
25
26So this framework sets up the basic building blocks that all drivers
27need and this same framework should make it much easier to refactor
28common code into utility functions shared by all drivers.
29
30A good example to look at as a reference is the v4l2-pci-skeleton.c
31source that is available in samples/v4l/. It is a skeleton driver for
32a PCI capture card, and demonstrates how to use the V4L2 driver
33framework. It can be used as a template for real PCI video capture driver.
34
35Structure of a V4L driver
36-------------------------
37
38All drivers have the following structure:
39
401) A struct for each device instance containing the device state.
41
422) A way of initializing and commanding sub-devices (if any).
43
443) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX and /dev/radioX)
45 and keeping track of device-node specific data.
46
474) Filehandle-specific structs containing per-filehandle data;
48
495) video buffer handling.
50
51This is a rough schematic of how it all relates:
52
53.. code-block:: none
54
55 device instances
56 |
57 +-sub-device instances
58 |
59 \-V4L2 device nodes
60 |
61 \-filehandle instances
62
63
64Structure of the V4L2 framework
65-------------------------------
66
67The framework closely resembles the driver structure: it has a v4l2_device
68struct for the device instance data, a v4l2_subdev struct to refer to
69sub-device instances, the video_device struct stores V4L2 device node data
70and the v4l2_fh struct keeps track of filehandle instances.
71
72The V4L2 framework also optionally integrates with the media framework. If a
73driver sets the struct v4l2_device mdev field, sub-devices and video nodes
74will automatically appear in the media framework as entities.
diff --git a/Documentation/media/kapi/v4l2-mc.rst b/Documentation/media/kapi/v4l2-mc.rst
new file mode 100644
index 000000000000..8af347013490
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-mc.rst
@@ -0,0 +1,4 @@
1V4L2 Media Controller functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-mc.h
diff --git a/Documentation/media/kapi/v4l2-mediabus.rst b/Documentation/media/kapi/v4l2-mediabus.rst
new file mode 100644
index 000000000000..e64131906d11
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-mediabus.rst
@@ -0,0 +1,4 @@
1V4L2 Media Bus functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-mediabus.h
diff --git a/Documentation/media/kapi/v4l2-mem2mem.rst b/Documentation/media/kapi/v4l2-mem2mem.rst
new file mode 100644
index 000000000000..5536b4a71e51
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-mem2mem.rst
@@ -0,0 +1,4 @@
1V4L2 Memory to Memory functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-mem2mem.h
diff --git a/Documentation/media/kapi/v4l2-of.rst b/Documentation/media/kapi/v4l2-of.rst
new file mode 100644
index 000000000000..1ddf76b00944
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-of.rst
@@ -0,0 +1,3 @@
1V4L2 Open Firmware kAPI
2^^^^^^^^^^^^^^^^^^^^^^^
3.. kernel-doc:: include/media/v4l2-of.h
diff --git a/Documentation/media/kapi/v4l2-rect.rst b/Documentation/media/kapi/v4l2-rect.rst
new file mode 100644
index 000000000000..8df5067ad57d
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-rect.rst
@@ -0,0 +1,4 @@
1V4L2 rect helper functions
2^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/v4l2-rect.h
diff --git a/Documentation/media/kapi/v4l2-subdev.rst b/Documentation/media/kapi/v4l2-subdev.rst
new file mode 100644
index 000000000000..d767b61e9842
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-subdev.rst
@@ -0,0 +1,445 @@
1V4L2 sub-devices
2----------------
3
4Many drivers need to communicate with sub-devices. These devices can do all
5sort of tasks, but most commonly they handle audio and/or video muxing,
6encoding or decoding. For webcams common sub-devices are sensors and camera
7controllers.
8
9Usually these are I2C devices, but not necessarily. In order to provide the
10driver with a consistent interface to these sub-devices the
11:c:type:`v4l2_subdev` struct (v4l2-subdev.h) was created.
12
13Each sub-device driver must have a :c:type:`v4l2_subdev` struct. This struct
14can be stand-alone for simple sub-devices or it might be embedded in a larger
15struct if more state information needs to be stored. Usually there is a
16low-level device struct (e.g. ``i2c_client``) that contains the device data as
17setup by the kernel. It is recommended to store that pointer in the private
18data of :c:type:`v4l2_subdev` using :c:func:`v4l2_set_subdevdata`. That makes
19it easy to go from a :c:type:`v4l2_subdev` to the actual low-level bus-specific
20device data.
21
22You also need a way to go from the low-level struct to :c:type:`v4l2_subdev`.
23For the common i2c_client struct the i2c_set_clientdata() call is used to store
24a :c:type:`v4l2_subdev` pointer, for other busses you may have to use other
25methods.
26
27Bridges might also need to store per-subdev private data, such as a pointer to
28bridge-specific per-subdev private data. The :c:type:`v4l2_subdev` structure
29provides host private data for that purpose that can be accessed with
30:c:func:`v4l2_get_subdev_hostdata` and :cpp:func:`v4l2_set_subdev_hostdata`.
31
32From the bridge driver perspective, you load the sub-device module and somehow
33obtain the :c:type:`v4l2_subdev` pointer. For i2c devices this is easy: you call
34``i2c_get_clientdata()``. For other busses something similar needs to be done.
35Helper functions exists for sub-devices on an I2C bus that do most of this
36tricky work for you.
37
38Each :c:type:`v4l2_subdev` contains function pointers that sub-device drivers
39can implement (or leave ``NULL`` if it is not applicable). Since sub-devices can
40do so many different things and you do not want to end up with a huge ops struct
41of which only a handful of ops are commonly implemented, the function pointers
42are sorted according to category and each category has its own ops struct.
43
44The top-level ops struct contains pointers to the category ops structs, which
45may be NULL if the subdev driver does not support anything from that category.
46
47It looks like this:
48
49.. code-block:: c
50
51 struct v4l2_subdev_core_ops {
52 int (*log_status)(struct v4l2_subdev *sd);
53 int (*init)(struct v4l2_subdev *sd, u32 val);
54 ...
55 };
56
57 struct v4l2_subdev_tuner_ops {
58 ...
59 };
60
61 struct v4l2_subdev_audio_ops {
62 ...
63 };
64
65 struct v4l2_subdev_video_ops {
66 ...
67 };
68
69 struct v4l2_subdev_pad_ops {
70 ...
71 };
72
73 struct v4l2_subdev_ops {
74 const struct v4l2_subdev_core_ops *core;
75 const struct v4l2_subdev_tuner_ops *tuner;
76 const struct v4l2_subdev_audio_ops *audio;
77 const struct v4l2_subdev_video_ops *video;
78 const struct v4l2_subdev_pad_ops *video;
79 };
80
81The core ops are common to all subdevs, the other categories are implemented
82depending on the sub-device. E.g. a video device is unlikely to support the
83audio ops and vice versa.
84
85This setup limits the number of function pointers while still making it easy
86to add new ops and categories.
87
88A sub-device driver initializes the :c:type:`v4l2_subdev` struct using:
89
90 :c:func:`v4l2_subdev_init <v4l2_subdev_init>`
91 (:c:type:`sd <v4l2_subdev>`, &\ :c:type:`ops <v4l2_subdev_ops>`).
92
93
94Afterwards you need to initialize :c:type:`sd <v4l2_subdev>`->name with a
95unique name and set the module owner. This is done for you if you use the
96i2c helper functions.
97
98If integration with the media framework is needed, you must initialize the
99:c:type:`media_entity` struct embedded in the :c:type:`v4l2_subdev` struct
100(entity field) by calling :c:func:`media_entity_pads_init`, if the entity has
101pads:
102
103.. code-block:: c
104
105 struct media_pad *pads = &my_sd->pads;
106 int err;
107
108 err = media_entity_pads_init(&sd->entity, npads, pads);
109
110The pads array must have been previously initialized. There is no need to
111manually set the struct :c:type:`media_entity` function and name fields, but the
112revision field must be initialized if needed.
113
114A reference to the entity will be automatically acquired/released when the
115subdev device node (if any) is opened/closed.
116
117Don't forget to cleanup the media entity before the sub-device is destroyed:
118
119.. code-block:: c
120
121 media_entity_cleanup(&sd->entity);
122
123If the subdev driver intends to process video and integrate with the media
124framework, it must implement format related functionality using
125:c:type:`v4l2_subdev_pad_ops` instead of :c:type:`v4l2_subdev_video_ops`.
126
127In that case, the subdev driver may set the link_validate field to provide
128its own link validation function. The link validation function is called for
129every link in the pipeline where both of the ends of the links are V4L2
130sub-devices. The driver is still responsible for validating the correctness
131of the format configuration between sub-devices and video nodes.
132
133If link_validate op is not set, the default function
134:c:func:`v4l2_subdev_link_validate_default` is used instead. This function
135ensures that width, height and the media bus pixel code are equal on both source
136and sink of the link. Subdev drivers are also free to use this function to
137perform the checks mentioned above in addition to their own checks.
138
139There are currently two ways to register subdevices with the V4L2 core. The
140first (traditional) possibility is to have subdevices registered by bridge
141drivers. This can be done when the bridge driver has the complete information
142about subdevices connected to it and knows exactly when to register them. This
143is typically the case for internal subdevices, like video data processing units
144within SoCs or complex PCI(e) boards, camera sensors in USB cameras or connected
145to SoCs, which pass information about them to bridge drivers, usually in their
146platform data.
147
148There are however also situations where subdevices have to be registered
149asynchronously to bridge devices. An example of such a configuration is a Device
150Tree based system where information about subdevices is made available to the
151system independently from the bridge devices, e.g. when subdevices are defined
152in DT as I2C device nodes. The API used in this second case is described further
153below.
154
155Using one or the other registration method only affects the probing process, the
156run-time bridge-subdevice interaction is in both cases the same.
157
158In the synchronous case a device (bridge) driver needs to register the
159:c:type:`v4l2_subdev` with the v4l2_device:
160
161 :c:func:`v4l2_device_register_subdev <v4l2_device_register_subdev>`
162 (:c:type:`v4l2_dev <v4l2_device>`, :c:type:`sd <v4l2_subdev>`).
163
164This can fail if the subdev module disappeared before it could be registered.
165After this function was called successfully the subdev->dev field points to
166the :c:type:`v4l2_device`.
167
168If the v4l2_device parent device has a non-NULL mdev field, the sub-device
169entity will be automatically registered with the media device.
170
171You can unregister a sub-device using:
172
173 :c:func:`v4l2_device_unregister_subdev <v4l2_device_unregister_subdev>`
174 (:c:type:`sd <v4l2_subdev>`).
175
176
177Afterwards the subdev module can be unloaded and
178:c:type:`sd <v4l2_subdev>`->dev == ``NULL``.
179
180You can call an ops function either directly:
181
182.. code-block:: c
183
184 err = sd->ops->core->g_std(sd, &norm);
185
186but it is better and easier to use this macro:
187
188.. code-block:: c
189
190 err = v4l2_subdev_call(sd, core, g_std, &norm);
191
192The macro will to the right ``NULL`` pointer checks and returns ``-ENODEV``
193if :c:type:`sd <v4l2_subdev>` is ``NULL``, ``-ENOIOCTLCMD`` if either
194:c:type:`sd <v4l2_subdev>`->core or :c:type:`sd <v4l2_subdev>`->core->g_std is ``NULL``, or the actual result of the
195:c:type:`sd <v4l2_subdev>`->ops->core->g_std ops.
196
197It is also possible to call all or a subset of the sub-devices:
198
199.. code-block:: c
200
201 v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
202
203Any subdev that does not support this ops is skipped and error results are
204ignored. If you want to check for errors use this:
205
206.. code-block:: c
207
208 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
209
210Any error except ``-ENOIOCTLCMD`` will exit the loop with that error. If no
211errors (except ``-ENOIOCTLCMD``) occurred, then 0 is returned.
212
213The second argument to both calls is a group ID. If 0, then all subdevs are
214called. If non-zero, then only those whose group ID match that value will
215be called. Before a bridge driver registers a subdev it can set
216:c:type:`sd <v4l2_subdev>`->grp_id to whatever value it wants (it's 0 by
217default). This value is owned by the bridge driver and the sub-device driver
218will never modify or use it.
219
220The group ID gives the bridge driver more control how callbacks are called.
221For example, there may be multiple audio chips on a board, each capable of
222changing the volume. But usually only one will actually be used when the
223user want to change the volume. You can set the group ID for that subdev to
224e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling
225``v4l2_device_call_all()``. That ensures that it will only go to the subdev
226that needs it.
227
228If the sub-device needs to notify its v4l2_device parent of an event, then
229it can call ``v4l2_subdev_notify(sd, notification, arg)``. This macro checks
230whether there is a ``notify()`` callback defined and returns ``-ENODEV`` if not.
231Otherwise the result of the ``notify()`` call is returned.
232
233The advantage of using :c:type:`v4l2_subdev` is that it is a generic struct and
234does not contain any knowledge about the underlying hardware. So a driver might
235contain several subdevs that use an I2C bus, but also a subdev that is
236controlled through GPIO pins. This distinction is only relevant when setting
237up the device, but once the subdev is registered it is completely transparent.
238
239In the asynchronous case subdevice probing can be invoked independently of the
240bridge driver availability. The subdevice driver then has to verify whether all
241the requirements for a successful probing are satisfied. This can include a
242check for a master clock availability. If any of the conditions aren't satisfied
243the driver might decide to return ``-EPROBE_DEFER`` to request further reprobing
244attempts. Once all conditions are met the subdevice shall be registered using
245the :c:func:`v4l2_async_register_subdev` function. Unregistration is
246performed using the :c:func:`v4l2_async_unregister_subdev` call. Subdevices
247registered this way are stored in a global list of subdevices, ready to be
248picked up by bridge drivers.
249
250Bridge drivers in turn have to register a notifier object with an array of
251subdevice descriptors that the bridge device needs for its operation. This is
252performed using the :c:func:`v4l2_async_notifier_register` call. To
253unregister the notifier the driver has to call
254:c:func:`v4l2_async_notifier_unregister`. The former of the two functions
255takes two arguments: a pointer to struct :c:type:`v4l2_device` and a pointer to
256struct :c:type:`v4l2_async_notifier`. The latter contains a pointer to an array
257of pointers to subdevice descriptors of type struct :c:type:`v4l2_async_subdev`
258type. The V4L2 core will then use these descriptors to match asynchronously
259registered
260subdevices to them. If a match is detected the ``.bound()`` notifier callback
261is called. After all subdevices have been located the .complete() callback is
262called. When a subdevice is removed from the system the .unbind() method is
263called. All three callbacks are optional.
264
265V4L2 sub-device userspace API
266-----------------------------
267
268Beside exposing a kernel API through the :c:type:`v4l2_subdev_ops` structure,
269V4L2 sub-devices can also be controlled directly by userspace applications.
270
271Device nodes named ``v4l-subdev``\ *X* can be created in ``/dev`` to access
272sub-devices directly. If a sub-device supports direct userspace configuration
273it must set the ``V4L2_SUBDEV_FL_HAS_DEVNODE`` flag before being registered.
274
275After registering sub-devices, the :c:type:`v4l2_device` driver can create
276device nodes for all registered sub-devices marked with
277``V4L2_SUBDEV_FL_HAS_DEVNODE`` by calling
278:c:func:`v4l2_device_register_subdev_nodes`. Those device nodes will be
279automatically removed when sub-devices are unregistered.
280
281The device node handles a subset of the V4L2 API.
282
283``VIDIOC_QUERYCTRL``,
284``VIDIOC_QUERYMENU``,
285``VIDIOC_G_CTRL``,
286``VIDIOC_S_CTRL``,
287``VIDIOC_G_EXT_CTRLS``,
288``VIDIOC_S_EXT_CTRLS`` and
289``VIDIOC_TRY_EXT_CTRLS``:
290
291 The controls ioctls are identical to the ones defined in V4L2. They
292 behave identically, with the only exception that they deal only with
293 controls implemented in the sub-device. Depending on the driver, those
294 controls can be also be accessed through one (or several) V4L2 device
295 nodes.
296
297``VIDIOC_DQEVENT``,
298``VIDIOC_SUBSCRIBE_EVENT`` and
299``VIDIOC_UNSUBSCRIBE_EVENT``
300
301 The events ioctls are identical to the ones defined in V4L2. They
302 behave identically, with the only exception that they deal only with
303 events generated by the sub-device. Depending on the driver, those
304 events can also be reported by one (or several) V4L2 device nodes.
305
306 Sub-device drivers that want to use events need to set the
307 ``V4L2_SUBDEV_USES_EVENTS`` :c:type:`v4l2_subdev`.flags and initialize
308 :c:type:`v4l2_subdev`.nevents to events queue depth before registering
309 the sub-device. After registration events can be queued as usual on the
310 :c:type:`v4l2_subdev`.devnode device node.
311
312 To properly support events, the ``poll()`` file operation is also
313 implemented.
314
315Private ioctls
316
317 All ioctls not in the above list are passed directly to the sub-device
318 driver through the core::ioctl operation.
319
320
321I2C sub-device drivers
322----------------------
323
324Since these drivers are so common, special helper functions are available to
325ease the use of these drivers (``v4l2-common.h``).
326
327The recommended method of adding :c:type:`v4l2_subdev` support to an I2C driver
328is to embed the :c:type:`v4l2_subdev` struct into the state struct that is
329created for each I2C device instance. Very simple devices have no state
330struct and in that case you can just create a :c:type:`v4l2_subdev` directly.
331
332A typical state struct would look like this (where 'chipname' is replaced by
333the name of the chip):
334
335.. code-block:: c
336
337 struct chipname_state {
338 struct v4l2_subdev sd;
339 ... /* additional state fields */
340 };
341
342Initialize the :c:type:`v4l2_subdev` struct as follows:
343
344.. code-block:: c
345
346 v4l2_i2c_subdev_init(&state->sd, client, subdev_ops);
347
348This function will fill in all the fields of :c:type:`v4l2_subdev` ensure that
349the :c:type:`v4l2_subdev` and i2c_client both point to one another.
350
351You should also add a helper inline function to go from a :c:type:`v4l2_subdev`
352pointer to a chipname_state struct:
353
354.. code-block:: c
355
356 static inline struct chipname_state *to_state(struct v4l2_subdev *sd)
357 {
358 return container_of(sd, struct chipname_state, sd);
359 }
360
361Use this to go from the :c:type:`v4l2_subdev` struct to the ``i2c_client``
362struct:
363
364.. code-block:: c
365
366 struct i2c_client *client = v4l2_get_subdevdata(sd);
367
368And this to go from an ``i2c_client`` to a :c:type:`v4l2_subdev` struct:
369
370.. code-block:: c
371
372 struct v4l2_subdev *sd = i2c_get_clientdata(client);
373
374Make sure to call
375:c:func:`v4l2_device_unregister_subdev`\ (:c:type:`sd <v4l2_subdev>`)
376when the ``remove()`` callback is called. This will unregister the sub-device
377from the bridge driver. It is safe to call this even if the sub-device was
378never registered.
379
380You need to do this because when the bridge driver destroys the i2c adapter
381the ``remove()`` callbacks are called of the i2c devices on that adapter.
382After that the corresponding v4l2_subdev structures are invalid, so they
383have to be unregistered first. Calling
384:c:func:`v4l2_device_unregister_subdev`\ (:c:type:`sd <v4l2_subdev>`)
385from the ``remove()`` callback ensures that this is always done correctly.
386
387
388The bridge driver also has some helper functions it can use:
389
390.. code-block:: c
391
392 struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter,
393 "module_foo", "chipid", 0x36, NULL);
394
395This loads the given module (can be ``NULL`` if no module needs to be loaded)
396and calls :c:func:`i2c_new_device` with the given ``i2c_adapter`` and
397chip/address arguments. If all goes well, then it registers the subdev with
398the v4l2_device.
399
400You can also use the last argument of :c:func:`v4l2_i2c_new_subdev` to pass
401an array of possible I2C addresses that it should probe. These probe addresses
402are only used if the previous argument is 0. A non-zero argument means that you
403know the exact i2c address so in that case no probing will take place.
404
405Both functions return ``NULL`` if something went wrong.
406
407Note that the chipid you pass to :c:func:`v4l2_i2c_new_subdev` is usually
408the same as the module name. It allows you to specify a chip variant, e.g.
409"saa7114" or "saa7115". In general though the i2c driver autodetects this.
410The use of chipid is something that needs to be looked at more closely at a
411later date. It differs between i2c drivers and as such can be confusing.
412To see which chip variants are supported you can look in the i2c driver code
413for the i2c_device_id table. This lists all the possibilities.
414
415There are two more helper functions:
416
417:c:func:`v4l2_i2c_new_subdev_cfg`: this function adds new irq and
418platform_data arguments and has both 'addr' and 'probed_addrs' arguments:
419if addr is not 0 then that will be used (non-probing variant), otherwise the
420probed_addrs are probed.
421
422For example: this will probe for address 0x10:
423
424.. code-block:: c
425
426 struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
427 "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
428
429:c:func:`v4l2_i2c_new_subdev_board` uses an :c:type:`i2c_board_info` struct
430which is passed to the i2c driver and replaces the irq, platform_data and addr
431arguments.
432
433If the subdev supports the s_config core ops, then that op is called with
434the irq and platform_data arguments after the subdev was setup.
435
436The older :c:func:`v4l2_i2c_new_subdev` and
437:c:func:`v4l2_i2c_new_probed_subdev` functions will call ``s_config`` as
438well, but with irq set to 0 and platform_data set to ``NULL``.
439
440V4L2 sub-device functions and data structures
441---------------------------------------------
442
443.. kernel-doc:: include/media/v4l2-subdev.h
444
445.. kernel-doc:: include/media/v4l2-async.h
diff --git a/Documentation/media/kapi/v4l2-tuner.rst b/Documentation/media/kapi/v4l2-tuner.rst
new file mode 100644
index 000000000000..86e894639651
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-tuner.rst
@@ -0,0 +1,6 @@
1Tuner functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/tuner.h
5
6.. kernel-doc:: include/media/tuner-types.h
diff --git a/Documentation/media/kapi/v4l2-tveeprom.rst b/Documentation/media/kapi/v4l2-tveeprom.rst
new file mode 100644
index 000000000000..33422cb26aa7
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-tveeprom.rst
@@ -0,0 +1,4 @@
1Hauppauge TV EEPROM functions and data structures
2^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4.. kernel-doc:: include/media/tveeprom.h
diff --git a/Documentation/video4linux/videobuf b/Documentation/media/kapi/v4l2-videobuf.rst
index 3ffe9e960b6f..54adfd772d28 100644
--- a/Documentation/video4linux/videobuf
+++ b/Documentation/media/kapi/v4l2-videobuf.rst
@@ -1,7 +1,20 @@
1An introduction to the videobuf layer 1.. _vb_framework:
2Jonathan Corbet <corbet@lwn.net> 2
3Videobuf Framework
4==================
5
6Author: Jonathan Corbet <corbet@lwn.net>
7
3Current as of 2.6.33 8Current as of 2.6.33
4 9
10.. note::
11
12 The videobuf framework was deprecated in favor of videobuf2. Shouldn't
13 be used on new drivers.
14
15Introduction
16------------
17
5The videobuf layer functions as a sort of glue layer between a V4L2 driver 18The videobuf layer functions as a sort of glue layer between a V4L2 driver
6and user space. It handles the allocation and management of buffers for 19and user space. It handles the allocation and management of buffers for
7the storage of video frames. There is a set of functions which can be used 20the storage of video frames. There is a set of functions which can be used
@@ -14,6 +27,7 @@ author, but the payback comes in the form of reduced code in the driver and
14a consistent implementation of the V4L2 user-space API. 27a consistent implementation of the V4L2 user-space API.
15 28
16Buffer types 29Buffer types
30------------
17 31
18Not all video devices use the same kind of buffers. In fact, there are (at 32Not all video devices use the same kind of buffers. In fact, there are (at
19least) three common variations: 33least) three common variations:
@@ -48,10 +62,13 @@ the kernel and a description of this technique is currently beyond the
48scope of this document.] 62scope of this document.]
49 63
50Data structures, callbacks, and initialization 64Data structures, callbacks, and initialization
65----------------------------------------------
51 66
52Depending on which type of buffers are being used, the driver should 67Depending on which type of buffers are being used, the driver should
53include one of the following files: 68include one of the following files:
54 69
70.. code-block:: none
71
55 <media/videobuf-dma-sg.h> /* Physically scattered */ 72 <media/videobuf-dma-sg.h> /* Physically scattered */
56 <media/videobuf-vmalloc.h> /* vmalloc() buffers */ 73 <media/videobuf-vmalloc.h> /* vmalloc() buffers */
57 <media/videobuf-dma-contig.h> /* Physically contiguous */ 74 <media/videobuf-dma-contig.h> /* Physically contiguous */
@@ -65,6 +82,8 @@ the queue.
65The next step is to write four simple callbacks to help videobuf deal with 82The next step is to write four simple callbacks to help videobuf deal with
66the management of buffers: 83the management of buffers:
67 84
85.. code-block:: none
86
68 struct videobuf_queue_ops { 87 struct videobuf_queue_ops {
69 int (*buf_setup)(struct videobuf_queue *q, 88 int (*buf_setup)(struct videobuf_queue *q,
70 unsigned int *count, unsigned int *size); 89 unsigned int *count, unsigned int *size);
@@ -91,6 +110,8 @@ passed to buf_prepare(), which should set the buffer's size, width, height,
91and field fields properly. If the buffer's state field is 110and field fields properly. If the buffer's state field is
92VIDEOBUF_NEEDS_INIT, the driver should pass it to: 111VIDEOBUF_NEEDS_INIT, the driver should pass it to:
93 112
113.. code-block:: none
114
94 int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, 115 int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
95 struct v4l2_framebuffer *fbuf); 116 struct v4l2_framebuffer *fbuf);
96 117
@@ -110,6 +131,8 @@ Finally, buf_release() is called when a buffer is no longer intended to be
110used. The driver should ensure that there is no I/O active on the buffer, 131used. The driver should ensure that there is no I/O active on the buffer,
111then pass it to the appropriate free routine(s): 132then pass it to the appropriate free routine(s):
112 133
134.. code-block:: none
135
113 /* Scatter/gather drivers */ 136 /* Scatter/gather drivers */
114 int videobuf_dma_unmap(struct videobuf_queue *q, 137 int videobuf_dma_unmap(struct videobuf_queue *q,
115 struct videobuf_dmabuf *dma); 138 struct videobuf_dmabuf *dma);
@@ -124,6 +147,8 @@ then pass it to the appropriate free routine(s):
124 147
125One way to ensure that a buffer is no longer under I/O is to pass it to: 148One way to ensure that a buffer is no longer under I/O is to pass it to:
126 149
150.. code-block:: none
151
127 int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); 152 int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
128 153
129Here, vb is the buffer, non_blocking indicates whether non-blocking I/O 154Here, vb is the buffer, non_blocking indicates whether non-blocking I/O
@@ -131,12 +156,15 @@ should be used (it should be zero in the buf_release() case), and intr
131controls whether an interruptible wait is used. 156controls whether an interruptible wait is used.
132 157
133File operations 158File operations
159---------------
134 160
135At this point, much of the work is done; much of the rest is slipping 161At this point, much of the work is done; much of the rest is slipping
136videobuf calls into the implementation of the other driver callbacks. The 162videobuf calls into the implementation of the other driver callbacks. The
137first step is in the open() function, which must initialize the 163first step is in the open() function, which must initialize the
138videobuf queue. The function to use depends on the type of buffer used: 164videobuf queue. The function to use depends on the type of buffer used:
139 165
166.. code-block:: none
167
140 void videobuf_queue_sg_init(struct videobuf_queue *q, 168 void videobuf_queue_sg_init(struct videobuf_queue *q,
141 struct videobuf_queue_ops *ops, 169 struct videobuf_queue_ops *ops,
142 struct device *dev, 170 struct device *dev,
@@ -182,6 +210,8 @@ applications have a chance of working with the device. Videobuf makes it
182easy to do that with the same code. To implement read(), the driver need 210easy to do that with the same code. To implement read(), the driver need
183only make a call to one of: 211only make a call to one of:
184 212
213.. code-block:: none
214
185 ssize_t videobuf_read_one(struct videobuf_queue *q, 215 ssize_t videobuf_read_one(struct videobuf_queue *q,
186 char __user *data, size_t count, 216 char __user *data, size_t count,
187 loff_t *ppos, int nonblocking); 217 loff_t *ppos, int nonblocking);
@@ -201,6 +231,8 @@ anticipation of another read() call happening in the near future).
201 231
202The poll() function can usually be implemented with a direct call to: 232The poll() function can usually be implemented with a direct call to:
203 233
234.. code-block:: none
235
204 unsigned int videobuf_poll_stream(struct file *file, 236 unsigned int videobuf_poll_stream(struct file *file,
205 struct videobuf_queue *q, 237 struct videobuf_queue *q,
206 poll_table *wait); 238 poll_table *wait);
@@ -213,6 +245,8 @@ the mmap() system call to enable user space to access the data. In many
213V4L2 drivers, the often-complex mmap() implementation simplifies to a 245V4L2 drivers, the often-complex mmap() implementation simplifies to a
214single call to: 246single call to:
215 247
248.. code-block:: none
249
216 int videobuf_mmap_mapper(struct videobuf_queue *q, 250 int videobuf_mmap_mapper(struct videobuf_queue *q,
217 struct vm_area_struct *vma); 251 struct vm_area_struct *vma);
218 252
@@ -220,6 +254,8 @@ Everything else is handled by the videobuf code.
220 254
221The release() function requires two separate videobuf calls: 255The release() function requires two separate videobuf calls:
222 256
257.. code-block:: none
258
223 void videobuf_stop(struct videobuf_queue *q); 259 void videobuf_stop(struct videobuf_queue *q);
224 int videobuf_mmap_free(struct videobuf_queue *q); 260 int videobuf_mmap_free(struct videobuf_queue *q);
225 261
@@ -233,12 +269,15 @@ buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully
233ignores its return value. 269ignores its return value.
234 270
235ioctl() operations 271ioctl() operations
272------------------
236 273
237The V4L2 API includes a very long list of driver callbacks to respond to 274The V4L2 API includes a very long list of driver callbacks to respond to
238the many ioctl() commands made available to user space. A number of these 275the many ioctl() commands made available to user space. A number of these
239- those associated with streaming I/O - turn almost directly into videobuf 276- those associated with streaming I/O - turn almost directly into videobuf
240calls. The relevant helper functions are: 277calls. The relevant helper functions are:
241 278
279.. code-block:: none
280
242 int videobuf_reqbufs(struct videobuf_queue *q, 281 int videobuf_reqbufs(struct videobuf_queue *q,
243 struct v4l2_requestbuffers *req); 282 struct v4l2_requestbuffers *req);
244 int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b); 283 int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b);
@@ -259,6 +298,7 @@ complex, of course, since they will also need to deal with starting and
259stopping the capture engine. 298stopping the capture engine.
260 299
261Buffer allocation 300Buffer allocation
301-----------------
262 302
263Thus far, we have talked about buffers, but have not looked at how they are 303Thus far, we have talked about buffers, but have not looked at how they are
264allocated. The scatter/gather case is the most complex on this front. For 304allocated. The scatter/gather case is the most complex on this front. For
@@ -272,11 +312,15 @@ If the driver needs to do its own memory allocation, it should be done in
272the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The 312the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The
273first step is a call to: 313first step is a call to:
274 314
315.. code-block:: none
316
275 struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); 317 struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
276 318
277The returned videobuf_dmabuf structure (defined in 319The returned videobuf_dmabuf structure (defined in
278<media/videobuf-dma-sg.h>) includes a couple of relevant fields: 320<media/videobuf-dma-sg.h>) includes a couple of relevant fields:
279 321
322.. code-block:: none
323
280 struct scatterlist *sglist; 324 struct scatterlist *sglist;
281 int sglen; 325 int sglen;
282 326
@@ -300,6 +344,7 @@ kernel drivers, or those contained within huge pages, will work with these
300drivers. 344drivers.
301 345
302Filling the buffers 346Filling the buffers
347-------------------
303 348
304The final part of a videobuf implementation has no direct callback - it's 349The final part of a videobuf implementation has no direct callback - it's
305the portion of the code which actually puts frame data into the buffers, 350the portion of the code which actually puts frame data into the buffers,
@@ -331,10 +376,14 @@ For scatter/gather drivers, the needed memory pointers will be found in the
331scatterlist structure described above. Drivers using the vmalloc() method 376scatterlist structure described above. Drivers using the vmalloc() method
332can get a memory pointer with: 377can get a memory pointer with:
333 378
379.. code-block:: none
380
334 void *videobuf_to_vmalloc(struct videobuf_buffer *buf); 381 void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
335 382
336For contiguous DMA drivers, the function to use is: 383For contiguous DMA drivers, the function to use is:
337 384
385.. code-block:: none
386
338 dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); 387 dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
339 388
340The contiguous DMA API goes out of its way to hide the kernel-space address 389The contiguous DMA API goes out of its way to hide the kernel-space address
diff --git a/Documentation/media/kapi/v4l2-videobuf2.rst b/Documentation/media/kapi/v4l2-videobuf2.rst
new file mode 100644
index 000000000000..3c4cb1e7e05f
--- /dev/null
+++ b/Documentation/media/kapi/v4l2-videobuf2.rst
@@ -0,0 +1,10 @@
1.. _vb2_framework:
2
3V4L2 videobuf2 functions and data structures
4^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5
6.. kernel-doc:: include/media/videobuf2-core.h
7
8.. kernel-doc:: include/media/videobuf2-v4l2.h
9
10.. kernel-doc:: include/media/videobuf2-memops.h
diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/lirc.h.rst.exceptions
new file mode 100644
index 000000000000..246c850151d7
--- /dev/null
+++ b/Documentation/media/lirc.h.rst.exceptions
@@ -0,0 +1,43 @@
1# Ignore header name
2ignore define _LINUX_LIRC_H
3
4# Ignore helper macros
5
6ignore define lirc_t
7
8ignore define LIRC_SPACE
9ignore define LIRC_PULSE
10ignore define LIRC_FREQUENCY
11ignore define LIRC_TIMEOUT
12ignore define LIRC_VALUE
13ignore define LIRC_MODE2
14ignore define LIRC_IS_SPACE
15ignore define LIRC_IS_PULSE
16ignore define LIRC_IS_FREQUENCY
17ignore define LIRC_IS_TIMEOUT
18
19ignore define LIRC_MODE2SEND
20ignore define LIRC_SEND2MODE
21ignore define LIRC_MODE2REC
22ignore define LIRC_REC2MODE
23
24ignore define LIRC_CAN_SEND
25ignore define LIRC_CAN_REC
26
27ignore define LIRC_CAN_SEND_MASK
28ignore define LIRC_CAN_REC_MASK
29ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
30
31# Undocumented macros
32
33ignore define PULSE_BIT
34ignore define PULSE_MASK
35
36ignore define LIRC_MODE2_SPACE
37ignore define LIRC_MODE2_PULSE
38ignore define LIRC_MODE2_TIMEOUT
39
40ignore define LIRC_VALUE_MASK
41ignore define LIRC_MODE2_MASK
42
43ignore define LIRC_MODE_RAW
diff --git a/Documentation/media/media.h.rst.exceptions b/Documentation/media/media.h.rst.exceptions
new file mode 100644
index 000000000000..83d7f7c722fb
--- /dev/null
+++ b/Documentation/media/media.h.rst.exceptions
@@ -0,0 +1,30 @@
1# Ignore header name
2ignore define __LINUX_MEDIA_H
3
4# Ignore macros
5ignore define MEDIA_API_VERSION
6ignore define MEDIA_ENT_F_BASE
7ignore define MEDIA_ENT_F_OLD_BASE
8ignore define MEDIA_ENT_F_OLD_SUBDEV_BASE
9ignore define MEDIA_INTF_T_DVB_BASE
10ignore define MEDIA_INTF_T_V4L_BASE
11ignore define MEDIA_INTF_T_ALSA_BASE
12
13#ignore legacy entity type macros
14ignore define MEDIA_ENT_TYPE_SHIFT
15ignore define MEDIA_ENT_TYPE_MASK
16ignore define MEDIA_ENT_SUBTYPE_MASK
17ignore define MEDIA_ENT_T_DEVNODE_UNKNOWN
18ignore define MEDIA_ENT_T_DEVNODE
19ignore define MEDIA_ENT_T_DEVNODE_V4L
20ignore define MEDIA_ENT_T_DEVNODE_FB
21ignore define MEDIA_ENT_T_DEVNODE_ALSA
22ignore define MEDIA_ENT_T_DEVNODE_DVB
23ignore define MEDIA_ENT_T_UNKNOWN
24ignore define MEDIA_ENT_T_V4L2_VIDEO
25ignore define MEDIA_ENT_T_V4L2_SUBDEV
26ignore define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
27ignore define MEDIA_ENT_T_V4L2_SUBDEV_FLASH
28ignore define MEDIA_ENT_T_V4L2_SUBDEV_LENS
29ignore define MEDIA_ENT_T_V4L2_SUBDEV_DECODER
30ignore define MEDIA_ENT_T_V4L2_SUBDEV_TUNER
diff --git a/Documentation/media/media_api_files/typical_media_device.pdf b/Documentation/media/media_api_files/typical_media_device.pdf
new file mode 100644
index 000000000000..eb3045813815
--- /dev/null
+++ b/Documentation/media/media_api_files/typical_media_device.pdf
Binary files differ
diff --git a/Documentation/media/media_api_files/typical_media_device.svg b/Documentation/media/media_api_files/typical_media_device.svg
new file mode 100644
index 000000000000..f0c82f72c4b6
--- /dev/null
+++ b/Documentation/media/media_api_files/typical_media_device.svg
@@ -0,0 +1,28 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<svg stroke-linejoin="round" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" clip-path="url(#a)" xml:space="preserve" fill-rule="evenodd" height="178.78mm" viewBox="0 0 24285.662 17877.829" width="251.99mm" version="1.2" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" preserveAspectRatio="xMidYMid" stroke-width="28.222"><defs><clipPath id="a" clipPathUnits="userSpaceOnUse"><rect y="0" x="0" width="28000" height="21000"/></clipPath></defs><g transform="matrix(1.004 0 0 1 -2185.6 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#fcf" d="m12231 4800c-516 0-1031 515-1031 1031v4124c0 516 515 1032 1031 1032h8538c516 0 1032-516 1032-1032v-4124c0-516-516-1031-1032-1031h-8538z"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#ffc" d="m3595 15607c-293 0-585 292-585 585v2340c0 293 292 586 585 586h3275c293 0 586-293 586-586v-2340c0-293-293-585-586-585h-3275z"/></g><g transform="translate(-2197.3 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#e6e6e6" d="m2663 2186c-461 0-922 461-922 922v11169c0 461 461 923 922 923h3692c461 0 922-462 922-923v-11169c0-461-461-922-922-922h-3692z"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#ff8080" d="m4461 8602h-2260v-1086h4520v1086h-2260z"/><path fill="none" d="m4461 8602h-2260v-1086h4520v1086h-2260z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="8275" x="2579" class="TextPosition"><tspan fill="#000000">Audio decoder</tspan></tspan></tspan></text>
3</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#ff8080" d="m4461 11772h-2260v-1270h4520v1270h-2260z"/><path fill="none" d="m4461 11772h-2260v-1270h4520v1270h-2260z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="11353" x="2617" class="TextPosition"><tspan fill="#000000">Video decoder</tspan></tspan></tspan></text>
4</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#ff8080" d="m4453 10217h-2269v-1224h4537v1224h-2268z"/><path fill="none" d="m4453 10217h-2269v-1224h4537v1224h-2268z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="9821" x="2571" class="TextPosition"><tspan fill="#000000">Audio encoder</tspan></tspan></tspan></text>
5</g><g transform="translate(-2140.9 -2468.2)" class="com.sun.star.drawing.RectangleShape"><path fill="#cfc" d="m15711 12832h-3810v-1281h7620v1281h-3810z"/><path fill="none" d="m15711 12832h-3810v-1281h7620v1281h-3810z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="12407" x="12377" class="TextPosition"><tspan fill="#000000">Button Key/IR input logic</tspan></tspan></tspan></text>
6</g><g transform="translate(-2140.9 -2411.8)" class="com.sun.star.drawing.RectangleShape"><path fill="#cfe7f5" d="m14169 14572h-2268v-1412h4536v1412h-2268z"/><path fill="none" d="m14169 14572h-2268v-1412h4536v1412h-2268z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="14082" x="12882" class="TextPosition"><tspan fill="#000000">EEPROM</tspan></tspan></tspan></text>
7</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#fc9" d="m5140 17662h-1563v-1715h3126v1715h-1563z"/><path fill="none" d="m5140 17662h-1563v-1715h3126v1715h-1563z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="17020" x="4276" class="TextPosition"><tspan fill="#000000">Sensor</tspan></tspan></tspan></text>
8</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6719 8030 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z"/><path fill="none" d="m6719 8030 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6719 9612 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z"/><path fill="none" d="m6719 9612 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6721 11100 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m6721 11100 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2411.8)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9962 13854 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m9962 13854 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2468.2)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9962 12163 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m9962 12163 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9962 17158 670-353v176h2028v-176l671 353-671 354v-177h-2028v177l-670-354z"/><path fill="none" d="m9962 17158 670-353v176h2028v-176l671 353-671 354v-177h-2028v177l-670-354z" stroke="#3465af"/></g><g transform="matrix(0 .83339 -1.0005 0 30268 -5276.3)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m23229 12779 1009-978 1009 978h-505v2959h505l-1009 979-1009-979h504v-2959h-504z"/><path fill="none" d="m23229 12779 1009-978 1009 978h-505v2959h505l-1009 979-1009-979h504v-2959h-504z" stroke="#3465af"/></g><g transform="translate(-9973.6 -666.6)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="706px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="15832" x="24341" class="TextPosition" transform="matrix(0,-1,1,0,8509,40173)"><tspan fill="#000000">System Bus</tspan></tspan></tspan></text>
9</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#cff" d="m13151 9262h-1250v-875h2499v875h-1249z"/><path fill="none" d="m13151 9262h-1250v-875h2499v875h-1249z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="9040" x="12215" class="TextPosition"><tspan fill="#000000">Demux</tspan></tspan></tspan></text>
10</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9996 8765 373-357v178h1130v-178l374 357-374 358v-179h-1130v179l-373-358z"/><path fill="none" d="m9996 8765 373-357v178h1130v-178l374 357-374 358v-179h-1130v179l-373-358z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9996 7378 373-358v179h1130v-179l374 358-374 358v-179h-1130v179l-373-358z"/><path fill="none" d="m9996 7378 373-358v179h1130v-179l374 358-374 358v-179h-1130v179l-373-358z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#cff" d="m16322 7992h-4421v-1270h8841v1270h-4420z"/><path fill="none" d="m16322 7992h-4421v-1270h8841v1270h-4420z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="7573" x="12786" class="TextPosition"><tspan fill="#000000">Conditional Access Module</tspan></tspan></tspan></text>
11</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#ff8080" d="m4445 13287h-2269v-1224h4537v1224h-2268z"/><path fill="none" d="m4445 13287h-2269v-1224h4537v1224h-2268z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="12891" x="2601" class="TextPosition"><tspan fill="#000000">Video encoder</tspan></tspan></tspan></text>
12</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6721 12634 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m6721 12634 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m20791 7545 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m20791 7545 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2028 -2186)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="14478" x="1990" class="TextPosition"><tspan fill="#000000">Radio / Analog TV</tspan></tspan></tspan></text>
13</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="700" class="TextParagraph"><tspan y="10724" x="14956" class="TextPosition"><tspan fill="#000000">Digital TV</tspan></tspan></tspan></text>
14</g><g transform="translate(-8970.5 -1395.8)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="494px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="19167" x="14724" class="TextPosition"><tspan fill="#000000">PS.: picture is not complete: other blocks may be present</tspan></tspan></tspan></text>
15</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="18561" x="4199" class="TextPosition"><tspan fill="#000000">Webcam</tspan></tspan></tspan></text>
16</g><g transform="translate(-2140.9 -2468.2)" class="com.sun.star.drawing.RectangleShape"><path fill="#f90" d="m14552 16372h-2650v-1412h5299v1412h-2649z"/><path fill="none" d="m14552 16372h-2650v-1412h5299v1412h-2649z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="15882" x="12265" class="TextPosition"><tspan fill="#000000">Processing blocks</tspan></tspan></tspan></text>
17</g><g transform="translate(-2140.9 -2468.2)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9962 15654 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z"/><path fill="none" d="m9962 15654 385-353v176h1166v-176l386 353-386 354v-177h-1166v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6702 16954 397-353v176h1201v-176l398 353-398 354v-177h-1201v177l-397-354z"/><path fill="none" d="m6702 16954 397-353v176h1201v-176l398 353-398 354v-177h-1201v177l-397-354z" stroke="#3465af"/></g><g transform="translate(-2479.5 -2186)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="8792" x="22850" class="TextPosition"><tspan fill="#000000">Smartcard</tspan></tspan></tspan></text>
18</g><g transform="matrix(1.0048 0 0 1 -2207.4 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#fcf" d="m2766 2600c-333 0-666 333-666 666v2668c0 333 333 666 666 666h18368c333 0 667-333 667-666v-2668c0-333-334-666-667-666h-18368z"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#ff8080" d="m5121 5155h-1614v-1816h3227v1816h-1613z"/><path fill="none" d="m5121 5155h-1614v-1816h3227v1816h-1613z" stroke="#3465af"/><text font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextShape"><tspan class="TextParagraph"><tspan y="4111" x="4374" class="TextPosition"><tspan fill="#000000">Tuner</tspan></tspan></tspan><tspan class="TextParagraph"><tspan y="4814" x="4151" class="TextPosition"><tspan fill="#000000">FM/TV</tspan></tspan></tspan></text>
19</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#ff8080" d="m2902 3702c0 111 40 202 88 202h530c48 0 89-91 89-202 0-110-41-202-89-202h-530c-48 0-88 92-88 202z"/><path fill="none" d="m2902 3702c0 111 40 202 88 202h530c48 0 89-91 89-202 0-110-41-202-89-202h-530c-48 0-88 92-88 202z" stroke="#3465af"/><path fill="#ffb3b3" d="m2902 3702c0 111 40 202 88 202s88-91 88-202c0-110-40-202-88-202s-88 92-88 202z"/><path fill="none" d="m2902 3702c0 111 40 202 88 202s88-91 88-202c0-110-40-202-88-202s-88 92-88 202z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#ff8080" d="m2903 4267c0 110 40 202 88 202h530c48 0 89-92 89-202s-41-203-89-203h-530c-48 0-88 93-88 203z"/><path fill="none" d="m2903 4267c0 110 40 202 88 202h530c48 0 89-92 89-202s-41-203-89-203h-530c-48 0-88 93-88 203z" stroke="#3465af"/><path fill="#ffb3b3" d="m2903 4267c0 110 40 202 88 202s88-92 88-202-40-203-88-203-88 93-88 203z"/><path fill="none" d="m2903 4267c0 110 40 202 88 202s88-92 88-202-40-203-88-203-88 93-88 203z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m6719 4196 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z"/><path fill="none" d="m6719 4196 385-353v176h1167v-176l386 353-386 354v-177h-1167v177l-385-354z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9979 4150 402-368v184h1217v-184l403 368-403 369v-185h-1217v185l-402-369z"/><path fill="none" d="m9979 4150 402-368v184h1217v-184l403 368-403 369v-185h-1217v185l-402-369z" stroke="#3465af"/></g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.RectangleShape"><path fill="#cff" d="m16500 6189h-4500v-1389h9e3v1389h-4500z"/><path fill="none" d="m16500 6189h-4500v-1389h9e3v1389h-4500z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="5710" x="12051" class="TextPosition"><tspan fill="#000000">Satellite Equipment Control (SEC)</tspan></tspan></tspan></text>
20</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#cff" d="m13400 4600h-1400v-1e3h2800v1e3h-1400z"/><path fill="none" d="m13400 4600h-1400v-1e3h2800v1e3h-1400z" stroke="#3465af"/><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="4316" x="12465" class="TextPosition"><tspan fill="#000000">Demod</tspan></tspan></tspan></text>
21</g><g transform="translate(-2140.9 -2186)" class="com.sun.star.drawing.CustomShape"><path fill="#729fcf" d="m9979 5451 402-368v184h1217v-184l403 368-403 369v-185h-1217v185l-402-369z"/><path fill="none" d="m9979 5451 402-368v184h1217v-184l403 368-403 369v-185h-1217v185l-402-369z" stroke="#3465af"/></g><path fill="#ff9" d="m7855.1 9099v7302h-1270v-14605h1270v7303z"/><path fill="none" d="m7855.1 9099v7302h-1270v-14605h1270v7303z" stroke="#3465af"/><text y="-6640.4663" x="-20770.572" transform="rotate(-90)" class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="7409.5396" x="-11193.634" class="TextPosition" transform="matrix(0,-1,1,0,-4473,23627)"><tspan fill="#000000">I2C Bus (control bus)</tspan></tspan></tspan></text>
22<g transform="translate(-2197.3 -2186)" class="com.sun.star.drawing.TextShape"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="3278" x="9391" class="TextPosition"><tspan fill="#000000">Digital TV Frontend</tspan></tspan></tspan></text>
23</g><g transform="matrix(1.015 0 0 .99994 -2233.3 -2185.7)" class="com.sun.star.drawing.CustomShape"><g stroke="#3465af" fill="none"><path d="m3e3 2800c-18 0-35 1-53 3"/><path d="m2915 2808c-17 3-35 7-52 12"/><path d="m2832 2830c-16 6-33 12-49 20"/><path d="m2754 2864c-15 8-31 17-46 27"/><path d="m2681 2909c-14 10-28 21-42 32"/><path d="m2614 2962c-13 12-26 24-38 37"/><path d="m2554 3023c-11 13-22 27-33 41"/><path d="m2502 3091c-10 14-19 29-28 45"/><path d="m2459 3164c-8 16-15 32-22 49"/><path d="m2426 3243c-5 17-10 34-14 51"/><path d="m2406 3326c-3 18-5 35-6 53"/><path d="m2400 3411v53"/><path d="m2400 3497v53"/><path d="m2400 3582v53"/><path d="m2400 3668v53"/><path d="m2400 3753v53"/><path d="m2400 3839v53"/><path d="m2400 3924v53"/><path d="m2400 4009v54"/><path d="m2400 4095v53"/><path d="m2400 4180v53"/><path d="m2400 4266v53"/><path d="m2400 4351v53"/><path d="m2400 4437v53"/><path d="m2400 4522v53"/><path d="m2400 4607v54"/><path d="m2400 4693v53"/><path d="m2400 4778v53"/><path d="m2400 4864v53"/><path d="m2400 4949v53"/><path d="m2400 5035v53"/><path d="m2400 5120v53"/><path d="m2400 5205v54"/><path d="m2400 5291v53"/><path d="m2400 5376v53"/><path d="m2400 5462v53"/><path d="m2400 5547v53"/><path d="m2400 5633v53"/><path d="m2400 5718v53"/><path d="m2400 5803c0 18 1 36 3 53"/><path d="m2408 5888c4 18 8 35 13 52"/><path d="m2431 5971c6 16 13 33 20 49"/><path d="m2466 6049c8 15 17 31 27 46"/><path d="m2511 6122c10 14 21 28 32 42"/><path d="m2564 6188c12 13 25 26 38 38"/><path d="m2626 6248c13 11 27 23 41 33"/><path d="m2694 6300c14 10 29 19 45 27"/><path d="m2768 6343c15 7 32 15 48 21"/><path d="m2847 6375c17 5 34 10 51 14"/><path d="m2930 6395c17 2 35 4 53 5"/><path d="m3015 6400h53"/><path d="m3100 6400h53"/><path d="m3186 6400h53"/><path d="m3271 6400h53"/><path d="m3357 6400h53"/><path d="m3442 6400h53"/><path d="m3527 6400h54"/><path d="m3613 6400h53"/><path d="m3698 6400h53"/><path d="m3784 6400h53"/><path d="m3869 6400h53"/><path d="m3955 6400h53"/><path d="m4040 6400h53"/><path d="m4125 6400h54"/><path d="m4211 6400h53"/><path d="m4296 6400h53"/><path d="m4382 6400h53"/><path d="m4467 6400h53"/><path d="m4553 6400h53"/><path d="m4638 6400h53"/><path d="m4723 6400h54"/><path d="m4809 6400h53"/><path d="m4894 6400h53"/><path d="m4980 6400h53"/><path d="m5065 6400h53"/><path d="m5151 6400h53"/><path d="m5236 6400h53"/><path d="m5322 6400h53"/><path d="m5407 6400h53"/><path d="m5492 6400h53"/><path d="m5578 6400h53"/><path d="m5663 6400h53"/><path d="m5749 6400h53"/><path d="m5834 6400h53"/><path d="m5920 6400h53"/><path d="m6005 6400h53"/><path d="m6090 6400h53"/><path d="m6176 6400h53"/><path d="m6261 6400h53"/><path d="m6347 6400h53"/><path d="m6432 6400h53"/><path d="m6518 6400h53"/><path d="m6603 6400h53"/><path d="m6688 6400h54"/><path d="m6774 6400h53"/><path d="m6859 6400h53"/><path d="m6945 6400h53"/><path d="m7030 6400h53"/><path d="m7116 6400h53"/><path d="m7201 6400h53"/><path d="m7286 6400h54"/><path d="m7372 6400h53"/><path d="m7457 6400h53"/><path d="m7543 6400h53"/><path d="m7628 6400h53"/><path d="m7714 6400h53"/><path d="m7799 6400h53"/><path d="m7884 6400h54"/><path d="m7970 6400h53"/><path d="m8055 6400h53"/><path d="m8141 6400h53"/><path d="m8226 6400h53"/><path d="m8312 6400h53"/><path d="m8397 6400h53"/><path d="m8482 6400h54"/><path d="m8568 6400h53"/><path d="m8653 6400h53"/><path d="m8739 6400h53"/><path d="m8824 6400h53"/><path d="m8910 6400h53"/><path d="m8995 6400h53"/><path d="m9081 6400h53"/><path d="m9166 6400h53"/><path d="m9251 6400h53"/><path d="m9337 6400h53"/><path d="m9422 6400h53"/><path d="m9508 6400h53"/><path d="m9593 6400h53"/><path d="m9679 6400h53"/><path d="m9764 6400h53"/><path d="m9849 6400h53"/><path d="m9935 6400h53"/><path d="m10020 6400h53"/><path d="m10106 6400h53"/><path d="m10191 6400h53"/><path d="m10277 6400h53"/><path d="m10362 6400h53"/><path d="m10447 6400h53"/><path d="m10533 6400h53"/><path d="m10618 6400h53"/><path d="m10704 6400h53"/><path d="m10789 6400h53"/><path d="m10875 6400h53"/><path d="m10960 6400h53"/><path d="m11045 6400h54"/><path d="m11131 6400h53"/><path d="m11216 6400h53"/><path d="m11302 6400h53"/><path d="m11387 6400h53"/><path d="m11473 6400h53"/><path d="m11558 6400h53"/><path d="m11643 6400h54"/><path d="m11729 6400h53"/><path d="m11814 6400h53"/><path d="m11900 6400h53"/><path d="m11985 6400h53"/><path d="m12071 6400h53"/><path d="m12156 6400h53"/><path d="m12241 6400h54"/><path d="m12327 6400h53"/><path d="m12412 6400h53"/><path d="m12498 6400h53"/><path d="m12583 6400h53"/><path d="m12669 6400h53"/><path d="m12754 6400h53"/><path d="m12839 6400h54"/><path d="m12925 6400h53"/><path d="m13010 6400h53"/><path d="m13096 6400h53"/><path d="m13181 6400h53"/><path d="m13267 6400h53"/><path d="m13352 6400h53"/><path d="m13438 6400h53"/><path d="m13523 6400h53"/><path d="m13608 6400h53"/><path d="m13694 6400h53"/><path d="m13779 6400h53"/><path d="m13865 6400h53"/><path d="m13950 6400h53"/><path d="m14036 6400h53"/><path d="m14121 6400h53"/><path d="m14206 6400h53"/><path d="m14292 6400h53"/><path d="m14377 6400h53"/><path d="m14463 6400h53"/><path d="m14548 6400h53"/><path d="m14634 6400h53"/><path d="m14719 6400h53"/><path d="m14804 6400h54"/><path d="m14890 6400h53"/><path d="m14975 6400h53"/><path d="m15061 6400h53"/><path d="m15146 6400h53"/><path d="m15232 6400h53"/><path d="m15317 6400h53"/><path d="m15402 6400h54"/><path d="m15488 6400h53"/><path d="m15573 6400h53"/><path d="m15659 6400h53"/><path d="m15744 6400h53"/><path d="m15830 6400h53"/><path d="m15915 6400h53"/><path d="m16000 6400h54"/><path d="m16086 6400h53"/><path d="m16171 6400h53"/><path d="m16257 6400h53"/><path d="m16342 6400h53"/><path d="m16428 6400h53"/><path d="m16513 6400h53"/><path d="m16598 6400h54"/><path d="m16684 6400h53"/><path d="m16769 6400h53"/><path d="m16855 6400h53"/><path d="m16940 6400h53"/><path d="m17026 6400h53"/><path d="m17111 6400h53"/><path d="m17196 6400h54"/><path d="m17282 6400h53"/><path d="m17367 6400h53"/><path d="m17453 6400h53"/><path d="m17538 6400h53"/><path d="m17624 6400h53"/><path d="m17709 6400h53"/><path d="m17795 6400h53"/><path d="m17880 6400h53"/><path d="m17965 6400h53"/><path d="m18051 6400h53"/><path d="m18136 6400h53"/><path d="m18222 6400h53"/><path d="m18307 6400h53"/><path d="m18393 6400h53"/><path d="m18478 6400h53"/><path d="m18563 6400h53"/><path d="m18649 6400h53"/><path d="m18734 6400h53"/><path d="m18820 6400h53"/><path d="m18905 6400h53"/><path d="m18991 6400h53"/><path d="m19076 6400h53"/><path d="m19161 6400h54"/><path d="m19247 6400h53"/><path d="m19332 6400h53"/><path d="m19418 6400h53"/><path d="m19503 6400h53"/><path d="m19589 6400h53"/><path d="m19674 6400h53"/><path d="m19759 6400h54"/><path d="m19845 6400h53"/><path d="m19930 6400h53"/><path d="m20016 6400h53"/><path d="m20101 6400h53"/><path d="m20187 6400h53"/><path d="m20272 6400h53"/><path d="m20357 6400h54"/><path d="m20443 6400h53"/><path d="m20528 6400h53"/><path d="m20614 6400c17-1 35-2 53-5"/><path d="m20699 6390c17-4 34-9 51-14"/><path d="m20781 6365c16-6 32-13 48-21"/><path d="m20858 6329c15-8 31-17 45-27"/><path d="m20930 6283c14-10 28-21 42-32"/><path d="m20996 6229c13-12 25-25 37-38"/><path d="m21055 6167c11-14 22-28 33-42"/><path d="m21106 6098c10-15 19-30 27-45"/><path d="m21148 6024c7-16 14-33 20-49"/><path d="m21179 5944c5-17 9-34 13-51"/><path d="m21197 5861c2-18 4-35 4-53"/><path d="m21201 5776v-54"/><path d="m21201 5690v-53"/><path d="m21201 5605v-53"/><path d="m21201 5519v-53"/><path d="m21201 5434v-53"/><path d="m21201 5348v-53"/><path d="m21201 5263v-53"/><path d="m21201 5178v-54"/><path d="m21201 5092v-53"/><path d="m21201 5007v-53"/><path d="m21201 4921v-53"/><path d="m21201 4836v-53"/><path d="m21201 4750v-53"/><path d="m21201 4665v-53"/><path d="m21201 4579v-53"/><path d="m21201 4494v-53"/><path d="m21201 4409v-53"/><path d="m21201 4323v-53"/><path d="m21201 4238v-53"/><path d="m21201 4152v-53"/><path d="m21201 4067v-53"/><path d="m21201 3981v-53"/><path d="m21201 3896v-53"/><path d="m21201 3811v-53"/><path d="m21201 3725v-53"/><path d="m21201 3640v-53"/><path d="m21201 3554v-53"/><path d="m21201 3469v-53"/><path d="m21201 3383c-1-17-3-35-5-52"/><path d="m21190 3299c-4-17-8-35-14-51"/><path d="m21165 3217c-6-16-13-33-21-49"/><path d="m21129 3140c-9-16-18-31-28-46"/><path d="m21082 3068c-10-14-21-28-33-42"/><path d="m21027 3002c-12-13-24-25-37-37"/><path d="m20965 2944c-14-12-28-22-42-33"/><path d="m20896 2893c-15-9-30-18-46-27"/><path d="m20821 2852c-16-8-32-14-49-20"/><path d="m20741 2821c-17-5-34-9-51-12"/><path d="m20658 2804c-18-3-35-4-53-4"/><path d="m20573 2800h-53"/><path d="m20487 2800h-53"/><path d="m20402 2800h-53"/><path d="m20316 2800h-53"/><path d="m20231 2800h-53"/><path d="m20146 2800h-54"/><path d="m20060 2800h-53"/><path d="m19975 2800h-53"/><path d="m19889 2800h-53"/><path d="m19804 2800h-53"/><path d="m19718 2800h-53"/><path d="m19633 2800h-53"/><path d="m19548 2800h-54"/><path d="m19462 2800h-53"/><path d="m19377 2800h-53"/><path d="m19291 2800h-53"/><path d="m19206 2800h-53"/><path d="m19120 2800h-53"/><path d="m19035 2800h-53"/><path d="m18950 2800h-54"/><path d="m18864 2800h-53"/><path d="m18779 2800h-53"/><path d="m18693 2800h-53"/><path d="m18608 2800h-53"/><path d="m18522 2800h-53"/><path d="m18437 2800h-53"/><path d="m18352 2800h-54"/><path d="m18266 2800h-53"/><path d="m18181 2800h-53"/><path d="m18095 2800h-53"/><path d="m18010 2800h-53"/><path d="m17924 2800h-53"/><path d="m17839 2800h-53"/><path d="m17753 2800h-53"/><path d="m17668 2800h-53"/><path d="m17583 2800h-53"/><path d="m17497 2800h-53"/><path d="m17412 2800h-53"/><path d="m17326 2800h-53"/><path d="m17241 2800h-53"/><path d="m17155 2800h-53"/><path d="m17070 2800h-53"/><path d="m16985 2800h-53"/><path d="m16899 2800h-53"/><path d="m16814 2800h-53"/><path d="m16728 2800h-53"/><path d="m16643 2800h-53"/><path d="m16557 2800h-53"/><path d="m16472 2800h-53"/><path d="m16387 2800h-54"/><path d="m16301 2800h-53"/><path d="m16216 2800h-53"/><path d="m16130 2800h-53"/><path d="m16045 2800h-53"/><path d="m15959 2800h-53"/><path d="m15874 2800h-53"/><path d="m15789 2800h-54"/><path d="m15703 2800h-53"/><path d="m15618 2800h-53"/><path d="m15532 2800h-53"/><path d="m15447 2800h-53"/><path d="m15361 2800h-53"/><path d="m15276 2800h-53"/><path d="m15191 2800h-54"/><path d="m15105 2800h-53"/><path d="m15020 2800h-53"/><path d="m14934 2800h-53"/><path d="m14849 2800h-53"/><path d="m14763 2800h-53"/><path d="m14678 2800h-53"/><path d="m14593 2800h-54"/><path d="m14507 2800h-53"/><path d="m14422 2800h-53"/><path d="m14336 2800h-53"/><path d="m14251 2800h-53"/><path d="m14165 2800h-53"/><path d="m14080 2800h-53"/><path d="m13994 2800h-53"/><path d="m13909 2800h-53"/><path d="m13824 2800h-53"/><path d="m13738 2800h-53"/><path d="m13653 2800h-53"/><path d="m13567 2800h-53"/><path d="m13482 2800h-53"/><path d="m13396 2800h-53"/><path d="m13311 2800h-53"/><path d="m13226 2800h-53"/><path d="m13140 2800h-53"/><path d="m13055 2800h-53"/><path d="m12969 2800h-53"/><path d="m12884 2800h-53"/><path d="m12798 2800h-53"/><path d="m12713 2800h-53"/><path d="m12628 2800h-53"/><path d="m12542 2800h-53"/><path d="m12457 2800h-53"/><path d="m12371 2800h-53"/><path d="m12286 2800h-53"/><path d="m12200 2800h-53"/><path d="m12115 2800h-53"/><path d="m12030 2800h-54"/><path d="m11944 2800h-53"/><path d="m11859 2800h-53"/><path d="m11773 2800h-53"/><path d="m11688 2800h-53"/><path d="m11602 2800h-53"/><path d="m11517 2800h-53"/><path d="m11432 2800h-54"/><path d="m11346 2800h-53"/><path d="m11261 2800h-53"/><path d="m11175 2800h-53"/><path d="m11090 2800h-53"/><path d="m11004 2800h-53"/><path d="m10919 2800h-53"/><path d="m10834 2800h-54"/><path d="m10748 2800h-53"/><path d="m10663 2800h-53"/><path d="m10577 2800h-53"/><path d="m10492 2800h-53"/><path d="m10406 2800h-53"/><path d="m10321 2800h-53"/><path d="m10236 2800h-54"/><path d="m10150 2800h-53"/><path d="m10065 2800h-53"/><path d="m9979 2800h-53"/><path d="m9894 2800h-53"/><path d="m9808 2800h-53"/><path d="m9723 2800h-53"/><path d="m9637 2800h-53"/><path d="m9552 2800h-53"/><path d="m9467 2800h-53"/><path d="m9381 2800h-53"/><path d="m9296 2800h-53"/><path d="m9210 2800h-53"/><path d="m9125 2800h-53"/><path d="m9039 2800h-53"/><path d="m8954 2800h-53"/><path d="m8869 2800h-53"/><path d="m8783 2800h-53"/><path d="m8698 2800h-53"/><path d="m8612 2800h-53"/><path d="m8527 2800h-53"/><path d="m8441 2800h-53"/><path d="m8356 2800h-53"/><path d="m8271 2800h-54"/><path d="m8185 2800h-53"/><path d="m8100 2800h-53"/><path d="m8014 2800h-53"/><path d="m7929 2800h-53"/><path d="m7843 2800h-53"/><path d="m7758 2800h-53"/><path d="m7673 2800h-54"/><path d="m7587 2800h-53"/><path d="m7502 2800h-53"/><path d="m7416 2800h-53"/><path d="m7331 2800h-53"/><path d="m7245 2800h-53"/><path d="m7160 2800h-53"/><path d="m7075 2800h-54"/><path d="m6989 2800h-53"/><path d="m6904 2800h-53"/><path d="m6818 2800h-53"/><path d="m6733 2800h-53"/><path d="m6647 2800h-53"/><path d="m6562 2800h-53"/><path d="m6477 2800h-54"/><path d="m6391 2800h-53"/><path d="m6306 2800h-53"/><path d="m6220 2800h-53"/><path d="m6135 2800h-53"/><path d="m6049 2800h-53"/><path d="m5964 2800h-53"/><path d="m5879 2800h-54"/><path d="m5793 2800h-53"/><path d="m5708 2800h-53"/><path d="m5622 2800h-53"/><path d="m5537 2800h-53"/><path d="m5451 2800h-53"/><path d="m5366 2800h-53"/><path d="m5280 2800h-53"/><path d="m5195 2800h-53"/><path d="m5110 2800h-53"/><path d="m5024 2800h-53"/><path d="m4939 2800h-53"/><path d="m4853 2800h-53"/><path d="m4768 2800h-53"/><path d="m4682 2800h-53"/><path d="m4597 2800h-53"/><path d="m4512 2800h-53"/><path d="m4426 2800h-53"/><path d="m4341 2800h-53"/><path d="m4255 2800h-53"/><path d="m4170 2800h-53"/><path d="m4084 2800h-53"/><path d="m3999 2800h-53"/><path d="m3914 2800h-54"/><path d="m3828 2800h-53"/><path d="m3743 2800h-53"/><path d="m3657 2800h-53"/><path d="m3572 2800h-53"/><path d="m3486 2800h-53"/><path d="m3401 2800h-53"/><path d="m3316 2800h-54"/><path d="m3230 2800h-53"/><path d="m3145 2800h-53"/><path d="m3059 2800h-53"/></g></g><g transform="translate(-2197.3 -2186)"><rect height="1100.7" width="1213.6" y="6917.1" x="23255" fill="#f3e777"/><path fill="#ca4677" d="m22802 7700.4v-405.46l150.7-169.16c82.886-93.039 170.53-186.62 194.77-207.96l44.069-38.798 783.23-0.086 783.23-0.086v613.5 613.5h-978-978v-405.46zm1027.7 136.98v-78.372l-169.91 4.925-169.91 4.9249-5.09 45.854c-8.249 74.303 46.711 101.04 207.69 101.04h137.21v-78.372zm235.86-262.94 4.495-341.31 207.2-8.6408 207.2-8.6408 5.144-46.443c9.596-86.615-41.863-102.05-322.02-96.607l-246.71 4.7956-4.438 419.08-4.439 419.08h74.537 74.538l4.494-341.31zm391.3 313.72c26.41-19.286 36.255-41.399 32.697-73.447l-5.09-45.854h-174.05-174.05l-5.38 48.984c-9.97 90.771 0.993 97.91 150.36 97.91 99.305 0 148.27-7.6982 175.52-27.594zm-627.16-274.84v-77.768h-174.05-174.05v66.246c0 36.436 4.973 71.431 11.051 77.768 6.078 6.3366 84.401 11.521 174.05 11.521h163v-77.768zm659.89-4.9154 5.125-74.042-179.18 4.9155-179.18 4.9155-5.38 48.984c-10.473 95.348-2.259 99.57 183.28 94.197l170.2-4.9284 5.125-74.042zm-659.89-237.63v-78.372l-169.91 4.925-169.91 4.925-5.097 73.447-5.097 73.447h175 175v-78.372zm659.86 4.925-5.097-73.447h-174.05-174.05l-5.38 48.984c-10.289 93.673-2.146 97.91 188.15 97.91h175.52l-5.097-73.447zm-659.86-228.98v-77.768h-137.21c-97.358 0-147.91 7.8138-174.05 26.902-34.952 25.523-49.645 92.242-25.79 117.11 6.078 6.3366 84.401 11.521 174.05 11.521h163v-77.768z"/></g><g transform="matrix(.84874 0 0 .76147 2408.1 3615.3)"><rect height="3076.2" width="2734.3" y="13264" x="19249" fill="#6076b3"/><g stroke-linejoin="round" fill-rule="evenodd" stroke-width="28.222" fill="#e0ee2c"><rect y="13369" width="356.65" x="18937" height="180.95"/><rect y="13708" width="356.65" x="18937" height="180.95"/><rect y="14048" width="356.65" x="18937" height="180.95"/><rect y="14387" width="356.65" x="18937" height="180.95"/><rect y="14726" width="356.65" x="18937" height="180.95"/><rect y="15066" width="356.65" x="18937" height="180.95"/><rect y="15405" width="356.65" x="18937" height="180.95"/><rect y="15744" width="356.65" x="18937" height="180.95"/><rect y="16083" width="356.65" x="18937" height="180.95"/><rect y="13324" width="356.65" x="21939" height="180.95"/><rect y="13663" width="356.65" x="21939" height="180.95"/><rect y="14002" width="356.65" x="21939" height="180.95"/><rect y="14342" width="356.65" x="21939" height="180.95"/><rect y="14681" width="356.65" x="21939" height="180.95"/><rect y="15020" width="356.65" x="21939" height="180.95"/><rect y="15360" width="356.65" x="21939" height="180.95"/><rect y="15699" width="356.65" x="21939" height="180.95"/><rect y="16038" width="356.65" x="21939" height="180.95"/></g><g stroke-linejoin="round" fill-rule="evenodd" transform="matrix(.98702 0 0 .90336 -2675 7020.8)" class="com.sun.star.drawing.TextShape" stroke-width="28.222"><text class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"/></text>
24<text style="word-spacing:0px;letter-spacing:0px" xml:space="preserve" font-size="1128.9px" y="9042.0264" x="22439.668" font-family="Sans" line-height="125%" fill="#000000"><tspan y="9042.0264" x="22439.668">CPU</tspan></text>
25</g></g><g stroke-linejoin="round" fill-rule="evenodd" transform="translate(-11752 543.6)" class="com.sun.star.drawing.TextShape" stroke-width="28.222"><text class="TextShape"><tspan font-size="706px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="15832" x="24341" class="TextPosition" transform="matrix(0,-1,1,0,8509,40173)"><tspan fill="#000000">PCI, USB, SPI, I2C, ...</tspan></tspan></tspan></text>
26</g><g stroke-linejoin="round" fill-rule="evenodd" transform="translate(-655.31 963.83)" class="com.sun.star.drawing.RectangleShape" stroke-width="28.222"><g transform="matrix(.49166 0 0 1.0059 6045.6 -82.24)"><path fill="#cfe7f5" d="m14169 14572h-2268v-1412h4536v1412h-2268z"/><path fill="none" d="m14169 14572h-2268v-1412h4536v1412h-2268z" stroke="#3465af"/></g><text y="-395.11282" x="-790.22229" class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="13686.9" x="12091.779" class="TextPosition"><tspan fill="#000000">Bridge</tspan></tspan></tspan></text>
27<text y="338.66486" x="-846.66675" class="TextShape"><tspan font-size="635px" font-family="&apos;Times New Roman&apos;, serif" font-weight="400" class="TextParagraph"><tspan y="14420.677" x="12035.335" class="TextPosition"><tspan fill="#000000"> DMA</tspan></tspan></tspan></text>
28</g></svg>
diff --git a/Documentation/media/media_kapi.rst b/Documentation/media/media_kapi.rst
new file mode 100644
index 000000000000..b71e8e8048ca
--- /dev/null
+++ b/Documentation/media/media_kapi.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5===================================
6Media subsystem kernel internal API
7===================================
8
9**Copyright** |copy| 2009-2016 : LinuxTV Developers
10
11This documentation is free software; you can redistribute it and/or modify it
12under the terms of the GNU General Public License as published by the Free
13Software Foundation; either version 2 of the License, or (at your option) any
14later version.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19more details.
20
21For more details see the file COPYING in the source distribution of Linux.
22
23.. class:: toc-title
24
25 Table of Contents
26
27.. toctree::
28 :maxdepth: 5
29 :numbered:
30
31 kapi/v4l2-core
32 kapi/dtv-core
33 kapi/rc-core
34 kapi/mc-core
diff --git a/Documentation/media/media_uapi.rst b/Documentation/media/media_uapi.rst
new file mode 100644
index 000000000000..fd8ebe002cd2
--- /dev/null
+++ b/Documentation/media/media_uapi.rst
@@ -0,0 +1,31 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5########################################
6Linux Media Infrastructure userspace API
7########################################
8
9**Copyright** |copy| 2009-2016 : LinuxTV Developers
10
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU Free Documentation License, Version 1.1 or
13any later version published by the Free Software Foundation. A copy of
14the license is included in the chapter entitled "GNU Free Documentation
15License".
16
17.. class:: toc-title
18
19 Table of Contents
20
21.. toctree::
22 :maxdepth: 1
23
24 intro
25 uapi/v4l/v4l2
26 uapi/dvb/dvbapi
27 uapi/rc/remote_controllers
28 uapi/mediactl/media-controller
29 uapi/cec/cec-api
30 uapi/gen-errors
31 uapi/fdl-appendix
diff --git a/Documentation/media/net.h.rst.exceptions b/Documentation/media/net.h.rst.exceptions
new file mode 100644
index 000000000000..30a267483aa9
--- /dev/null
+++ b/Documentation/media/net.h.rst.exceptions
@@ -0,0 +1,11 @@
1# Ignore header name
2ignore define _DVBNET_H_
3
4# Ignore old ioctls/structs
5ignore ioctl __NET_ADD_IF_OLD
6ignore ioctl __NET_GET_IF_OLD
7ignore struct __dvb_net_if_old
8
9# Macros used at struct dvb_net_if
10replace define DVB_NET_FEEDTYPE_MPE dvb-net-if
11replace define DVB_NET_FEEDTYPE_ULE dvb-net-if
diff --git a/Documentation/media/uapi/cec/cec-api.rst b/Documentation/media/uapi/cec/cec-api.rst
new file mode 100644
index 000000000000..bb018709970c
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-api.rst
@@ -0,0 +1,43 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5.. _cec:
6
7#########################################
8Part V - Consumer Electronics Control API
9#########################################
10
11This part describes the CEC: Consumer Electronics Control
12
13.. class:: toc-title
14
15 Table of Contents
16
17.. toctree::
18 :maxdepth: 5
19 :numbered:
20
21 cec-intro
22 cec-funcs
23 cec-header
24
25
26**********************
27Revision and Copyright
28**********************
29Authors:
30
31- Verkuil, Hans <hans.verkuil@cisco.com>
32
33 - Initial version.
34
35**Copyright** |copy| 2016 : Hans Verkuil
36
37****************
38Revision History
39****************
40
41:revision: 1.0.0 / 2016-03-17 (*hv*)
42
43Initial revision
diff --git a/Documentation/media/uapi/cec/cec-func-close.rst b/Documentation/media/uapi/cec/cec-func-close.rst
new file mode 100644
index 000000000000..bb94e4358910
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec-func-close:
4
5***********
6cec close()
7***********
8
9Name
10====
11
12cec-close - Close a cec device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: int close( int fd )
24
25Arguments
26=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
31
32Description
33===========
34
35.. note:: This documents the proposed CEC API. This API is not yet finalized
36 and is currently only available as a staging kernel module.
37
38Closes the cec device. Resources associated with the file descriptor are
39freed. The device configuration remain unchanged.
40
41
42Return Value
43============
44
45:c:func:`close()` returns 0 on success. On error, -1 is returned, and
46``errno`` is set appropriately. Possible error codes are:
47
48``EBADF``
49 ``fd`` is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/cec/cec-func-ioctl.rst b/Documentation/media/uapi/cec/cec-func-ioctl.rst
new file mode 100644
index 000000000000..d0279e6d2734
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-func-ioctl.rst
@@ -0,0 +1,68 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec-func-ioctl:
4
5***********
6cec ioctl()
7***********
8
9Name
10====
11
12cec-ioctl - Control a cec device
13
14Synopsis
15========
16
17.. code-block:: c
18
19 #include <sys/ioctl.h>
20
21
22.. cpp:function:: int ioctl( int fd, int request, void *argp )
23
24Arguments
25=========
26
27``fd``
28 File descriptor returned by :ref:`open() <func-open>`.
29
30``request``
31 CEC ioctl request code as defined in the cec.h header file, for
32 example :ref:`CEC_ADAP_G_CAPS`.
33
34``argp``
35 Pointer to a request-specific structure.
36
37
38Description
39===========
40
41.. note:: This documents the proposed CEC API. This API is not yet finalized
42 and is currently only available as a staging kernel module.
43
44The :c:func:`ioctl()` function manipulates cec device parameters. The
45argument ``fd`` must be an open file descriptor.
46
47The ioctl ``request`` code specifies the cec function to be called. It
48has encoded in it whether the argument is an input, output or read/write
49parameter, and the size of the argument ``argp`` in bytes.
50
51Macros and structures definitions specifying cec ioctl requests and
52their parameters are located in the cec.h header file. All cec ioctl
53requests, their respective function and parameters are specified in
54:ref:`cec-user-func`.
55
56
57Return Value
58============
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
63
64Request-specific error codes are listed in the individual requests
65descriptions.
66
67When an ioctl that takes an output or read/write parameter fails, the
68parameter remains unmodified.
diff --git a/Documentation/media/uapi/cec/cec-func-open.rst b/Documentation/media/uapi/cec/cec-func-open.rst
new file mode 100644
index 000000000000..38fd7e0cfccd
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-func-open.rst
@@ -0,0 +1,80 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec-func-open:
4
5**********
6cec open()
7**********
8
9Name
10====
11
12cec-open - Open a cec device
13
14Synopsis
15========
16
17.. code-block:: c
18
19 #include <fcntl.h>
20
21
22.. cpp:function:: int open( const char *device_name, int flags )
23
24
25Arguments
26=========
27
28``device_name``
29 Device to be opened.
30
31``flags``
32 Open flags. Access mode must be ``O_RDWR``.
33
34 When the ``O_NONBLOCK`` flag is given, the
35 :ref:`CEC_RECEIVE <CEC_RECEIVE>` and :ref:`CEC_DQEVENT <CEC_DQEVENT>` ioctls
36 will return the ``EAGAIN`` error code when no message or event is available, and
37 ioctls :ref:`CEC_TRANSMIT <CEC_TRANSMIT>`,
38 :ref:`CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` and
39 :ref:`CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
40 all return 0.
41
42 Other flags have no effect.
43
44
45Description
46===========
47
48.. note:: This documents the proposed CEC API. This API is not yet finalized
49 and is currently only available as a staging kernel module.
50
51To open a cec device applications call :c:func:`open()` with the
52desired device name. The function has no side effects; the device
53configuration remain unchanged.
54
55When the device is opened in read-only mode, attempts to modify its
56configuration will result in an error, and ``errno`` will be set to
57EBADF.
58
59
60Return Value
61============
62
63:c:func:`open()` returns the new file descriptor on success. On error,
64-1 is returned, and ``errno`` is set appropriately. Possible error codes
65include:
66
67``EACCES``
68 The requested access to the file is not allowed.
69
70``EMFILE``
71 The process already has the maximum number of files open.
72
73``ENFILE``
74 The system limit on the total number of open files has been reached.
75
76``ENOMEM``
77 Insufficient kernel memory was available.
78
79``ENXIO``
80 No device corresponding to this device special file exists.
diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst b/Documentation/media/uapi/cec/cec-func-poll.rst
new file mode 100644
index 000000000000..fcab65f6d6b8
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-func-poll.rst
@@ -0,0 +1,70 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec-func-poll:
4
5**********
6cec poll()
7**********
8
9Name
10====
11
12cec-poll - Wait for some event on a file descriptor
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <sys/poll.h>
21
22
23.. cpp:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
24
25Arguments
26=========
27
28
29Description
30===========
31
32.. note:: This documents the proposed CEC API. This API is not yet finalized
33 and is currently only available as a staging kernel module.
34
35With the :c:func:`poll()` function applications can wait for CEC
36events.
37
38On success :c:func:`poll()` returns the number of file descriptors
39that have been selected (that is, file descriptors for which the
40``revents`` field of the respective :c:type:`struct pollfd` structure
41is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
42the ``revents`` field if there are messages in the receive queue. If the
43transmit queue has room for new messages, the ``POLLOUT`` and
44``POLLWRNORM`` flags are set. If there are events in the event queue,
45then the ``POLLPRI`` flag is set. When the function timed out it returns
46a value of zero, on failure it returns -1 and the ``errno`` variable is
47set appropriately.
48
49For more details see the :c:func:`poll()` manual page.
50
51
52Return Value
53============
54
55On success, :c:func:`poll()` returns the number structures which have
56non-zero ``revents`` fields, or zero if the call timed out. On error -1
57is returned, and the ``errno`` variable is set appropriately:
58
59``EBADF``
60 One or more of the ``ufds`` members specify an invalid file
61 descriptor.
62
63``EFAULT``
64 ``ufds`` references an inaccessible memory area.
65
66``EINTR``
67 The call was interrupted by a signal.
68
69``EINVAL``
70 The ``nfds`` argument is greater than ``OPEN_MAX``.
diff --git a/Documentation/media/uapi/cec/cec-funcs.rst b/Documentation/media/uapi/cec/cec-funcs.rst
new file mode 100644
index 000000000000..5b7630f2e076
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-funcs.rst
@@ -0,0 +1,21 @@
1.. _cec-user-func:
2
3******************
4Function Reference
5******************
6
7
8.. toctree::
9 :maxdepth: 1
10 :numbered:
11
12 cec-func-open
13 cec-func-close
14 cec-func-ioctl
15 cec-func-poll
16 cec-ioc-adap-g-caps
17 cec-ioc-adap-g-log-addrs
18 cec-ioc-adap-g-phys-addr
19 cec-ioc-dqevent
20 cec-ioc-g-mode
21 cec-ioc-receive
diff --git a/Documentation/media/uapi/cec/cec-header.rst b/Documentation/media/uapi/cec/cec-header.rst
new file mode 100644
index 000000000000..d5a9a2828274
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-header.rst
@@ -0,0 +1,10 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _cec_header:
4
5***************
6CEC Header File
7***************
8
9.. kernel-include:: $BUILDDIR/cec.h.rst
10
diff --git a/Documentation/media/uapi/cec/cec-intro.rst b/Documentation/media/uapi/cec/cec-intro.rst
new file mode 100644
index 000000000000..afa76f26fdde
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-intro.rst
@@ -0,0 +1,31 @@
1.. _cec-intro:
2
3Introduction
4============
5
6.. note:: This documents the proposed CEC API. This API is not yet finalized
7 and is currently only available as a staging kernel module.
8
9HDMI connectors provide a single pin for use by the Consumer Electronics
10Control protocol. This protocol allows different devices connected by an
11HDMI cable to communicate. The protocol for CEC version 1.4 is defined
12in supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return
13Channel) of the HDMI 1.4a (:ref:`hdmi`) specification and the
14extensions added to CEC version 2.0 are defined in chapter 11 of the
15HDMI 2.0 (:ref:`hdmi2`) specification.
16
17The bitrate is very slow (effectively no more than 36 bytes per second)
18and is based on the ancient AV.link protocol used in old SCART
19connectors. The protocol closely resembles a crazy Rube Goldberg
20contraption and is an unholy mix of low and high level messages. Some
21messages, especially those part of the HEAC protocol layered on top of
22CEC, need to be handled by the kernel, others can be handled either by
23the kernel or by userspace.
24
25In addition, CEC can be implemented in HDMI receivers, transmitters and
26in USB devices that have an HDMI input and an HDMI output and that
27control just the CEC pin.
28
29Drivers that support CEC will create a CEC device node (/dev/cecX) to
30give userspace access to the CEC adapter. The
31:ref:`CEC_ADAP_G_CAPS` ioctl will tell userspace what it is allowed to do.
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
new file mode 100644
index 000000000000..eaedc63186e6
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
@@ -0,0 +1,165 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_ADAP_G_CAPS:
4
5*********************
6ioctl CEC_ADAP_G_CAPS
7*********************
8
9Name
10====
11
12CEC_ADAP_G_CAPS - Query device capabilities
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, struct cec_caps *argp )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by :ref:`open() <cec-func-open>`.
24
25``request``
26 CEC_ADAP_G_CAPS
27
28``argp``
29
30
31Description
32===========
33
34.. note:: This documents the proposed CEC API. This API is not yet finalized
35 and is currently only available as a staging kernel module.
36
37All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
38device information, applications call the ioctl with a pointer to a
39struct :ref:`cec_caps <cec-caps>`. The driver fills the structure and
40returns the information to the application. The ioctl never fails.
41
42
43.. _cec-caps:
44
45.. flat-table:: struct cec_caps
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 16
49
50
51 - .. row 1
52
53 - char
54
55 - ``driver[32]``
56
57 - The name of the cec adapter driver.
58
59 - .. row 2
60
61 - char
62
63 - ``name[32]``
64
65 - The name of this CEC adapter. The combination ``driver`` and
66 ``name`` must be unique.
67
68 - .. row 3
69
70 - __u32
71
72 - ``capabilities``
73
74 - The capabilities of the CEC adapter, see
75 :ref:`cec-capabilities`.
76
77 - .. row 4
78
79 - __u32
80
81 - ``version``
82
83 - CEC Framework API version, formatted with the ``KERNEL_VERSION()``
84 macro.
85
86
87
88.. _cec-capabilities:
89
90.. flat-table:: CEC Capabilities Flags
91 :header-rows: 0
92 :stub-columns: 0
93 :widths: 3 1 8
94
95
96 - .. _`CEC-CAP-PHYS-ADDR`:
97
98 - ``CEC_CAP_PHYS_ADDR``
99
100 - 0x00000001
101
102 - Userspace has to configure the physical address by calling
103 :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`. If
104 this capability isn't set, then setting the physical address is
105 handled by the kernel whenever the EDID is set (for an HDMI
106 receiver) or read (for an HDMI transmitter).
107
108 - .. _`CEC-CAP-LOG-ADDRS`:
109
110 - ``CEC_CAP_LOG_ADDRS``
111
112 - 0x00000002
113
114 - Userspace has to configure the logical addresses by calling
115 :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`. If
116 this capability isn't set, then the kernel will have configured
117 this.
118
119 - .. _`CEC-CAP-TRANSMIT`:
120
121 - ``CEC_CAP_TRANSMIT``
122
123 - 0x00000004
124
125 - Userspace can transmit CEC messages by calling
126 :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. This implies that
127 userspace can be a follower as well, since being able to transmit
128 messages is a prerequisite of becoming a follower. If this
129 capability isn't set, then the kernel will handle all CEC
130 transmits and process all CEC messages it receives.
131
132 - .. _`CEC-CAP-PASSTHROUGH`:
133
134 - ``CEC_CAP_PASSTHROUGH``
135
136 - 0x00000008
137
138 - Userspace can use the passthrough mode by calling
139 :ref:`ioctl CEC_S_MODE <CEC_S_MODE>`.
140
141 - .. _`CEC-CAP-RC`:
142
143 - ``CEC_CAP_RC``
144
145 - 0x00000010
146
147 - This adapter supports the remote control protocol.
148
149 - .. _`CEC-CAP-MONITOR-ALL`:
150
151 - ``CEC_CAP_MONITOR_ALL``
152
153 - 0x00000020
154
155 - The CEC hardware can monitor all messages, not just directed and
156 broadcast messages.
157
158
159
160Return Value
161============
162
163On success 0 is returned, on error -1 and the ``errno`` variable is set
164appropriately. The generic error codes are described at the
165:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
new file mode 100644
index 000000000000..04ee90099676
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -0,0 +1,436 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_ADAP_LOG_ADDRS:
4.. _CEC_ADAP_G_LOG_ADDRS:
5.. _CEC_ADAP_S_LOG_ADDRS:
6
7****************************************************
8ioctls CEC_ADAP_G_LOG_ADDRS and CEC_ADAP_S_LOG_ADDRS
9****************************************************
10
11Name
12====
13
14CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS - Get or set the logical addresses
15
16
17Synopsis
18========
19
20.. cpp:function:: int ioctl( int fd, int request, struct cec_log_addrs *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <cec-func-open>`.
28
29``request``
30 CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS
31
32``argp``
33
34
35Description
36===========
37
38.. note:: This documents the proposed CEC API. This API is not yet finalized
39 and is currently only available as a staging kernel module.
40
41To query the current CEC logical addresses, applications call
42:ref:`ioctl CEC_ADAP_G_LOG_ADDRS <CEC_ADAP_G_LOG_ADDRS>` with a pointer to a
43:c:type:`struct cec_log_addrs` where the driver stores the logical addresses.
44
45To set new logical addresses, applications fill in
46:c:type:`struct cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
47with a pointer to this struct. The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
48is only available if ``CEC_CAP_LOG_ADDRS`` is set (the ``ENOTTY`` error code is
49returned otherwise). The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
50can only be called by a file descriptor in initiator mode (see :ref:`CEC_S_MODE`), if not
51the ``EBUSY`` error code will be returned.
52
53To clear existing logical addresses set ``num_log_addrs`` to 0. All other fields
54will be ignored in that case. The adapter will go to the unconfigured state.
55
56If the physical address is valid (see :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`),
57then this ioctl will block until all requested logical
58addresses have been claimed. If the file descriptor is in non-blocking mode then it will
59not wait for the logical addresses to be claimed, instead it just returns 0.
60
61A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` event is sent when the
62logical addresses are claimed or cleared.
63
64Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>` when
65logical address types are already defined will return with error ``EBUSY``.
66
67
68.. _cec-log-addrs:
69
70.. flat-table:: struct cec_log_addrs
71 :header-rows: 0
72 :stub-columns: 0
73 :widths: 1 1 16
74
75
76 - .. row 1
77
78 - __u8
79
80 - ``log_addr[CEC_MAX_LOG_ADDRS]``
81
82 - The actual logical addresses that were claimed. This is set by the
83 driver. If no logical address could be claimed, then it is set to
84 ``CEC_LOG_ADDR_INVALID``. If this adapter is Unregistered, then
85 ``log_addr[0]`` is set to 0xf and all others to
86 ``CEC_LOG_ADDR_INVALID``.
87
88 - .. row 2
89
90 - __u16
91
92 - ``log_addr_mask``
93
94 - The bitmask of all logical addresses this adapter has claimed. If
95 this adapter is Unregistered then ``log_addr_mask`` sets bit 15
96 and clears all other bits. If this adapter is not configured at
97 all, then ``log_addr_mask`` is set to 0. Set by the driver.
98
99 - .. row 3
100
101 - __u8
102
103 - ``cec_version``
104
105 - The CEC version that this adapter shall use. See
106 :ref:`cec-versions`. Used to implement the
107 ``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages.
108 Note that :ref:`CEC_OP_CEC_VERSION_1_3A <CEC-OP-CEC-VERSION-1-3A>` is not allowed by the CEC
109 framework.
110
111 - .. row 4
112
113 - __u8
114
115 - ``num_log_addrs``
116
117 - Number of logical addresses to set up. Must be ≤
118 ``available_log_addrs`` as returned by
119 :ref:`CEC_ADAP_G_CAPS`. All arrays in
120 this structure are only filled up to index
121 ``available_log_addrs``-1. The remaining array elements will be
122 ignored. Note that the CEC 2.0 standard allows for a maximum of 2
123 logical addresses, although some hardware has support for more.
124 ``CEC_MAX_LOG_ADDRS`` is 4. The driver will return the actual
125 number of logical addresses it could claim, which may be less than
126 what was requested. If this field is set to 0, then the CEC
127 adapter shall clear all claimed logical addresses and all other
128 fields will be ignored.
129
130 - .. row 5
131
132 - __u32
133
134 - ``vendor_id``
135
136 - The vendor ID is a 24-bit number that identifies the specific
137 vendor or entity. Based on this ID vendor specific commands may be
138 defined. If you do not want a vendor ID then set it to
139 ``CEC_VENDOR_ID_NONE``.
140
141 - .. row 6
142
143 - __u32
144
145 - ``flags``
146
147 - Flags. No flags are defined yet, so set this to 0.
148
149 - .. row 7
150
151 - char
152
153 - ``osd_name[15]``
154
155 - The On-Screen Display name as is returned by the
156 ``CEC_MSG_SET_OSD_NAME`` message.
157
158 - .. row 8
159
160 - __u8
161
162 - ``primary_device_type[CEC_MAX_LOG_ADDRS]``
163
164 - Primary device type for each logical address. See
165 :ref:`cec-prim-dev-types` for possible types.
166
167 - .. row 9
168
169 - __u8
170
171 - ``log_addr_type[CEC_MAX_LOG_ADDRS]``
172
173 - Logical address types. See :ref:`cec-log-addr-types` for
174 possible types. The driver will update this with the actual
175 logical address type that it claimed (e.g. it may have to fallback
176 to :ref:`CEC_LOG_ADDR_TYPE_UNREGISTERED <CEC-LOG-ADDR-TYPE-UNREGISTERED>`).
177
178 - .. row 10
179
180 - __u8
181
182 - ``all_device_types[CEC_MAX_LOG_ADDRS]``
183
184 - CEC 2.0 specific: the bit mask of all device types. See
185 :ref:`cec-all-dev-types-flags`. It is used in the CEC 2.0
186 ``CEC_MSG_REPORT_FEATURES`` message. For CEC 1.4 you can either leave
187 this field to 0, or fill it in according to the CEC 2.0 guidelines to
188 give the CEC framework more information about the device type, even
189 though the framework won't use it directly in the CEC message.
190
191 - .. row 11
192
193 - __u8
194
195 - ``features[CEC_MAX_LOG_ADDRS][12]``
196
197 - Features for each logical address. It is used in the CEC 2.0
198 ``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the
199 RC Profile and the Device Features. For CEC 1.4 you can either leave
200 this field to all 0, or fill it in according to the CEC 2.0 guidelines to
201 give the CEC framework more information about the device type, even
202 though the framework won't use it directly in the CEC message.
203
204.. _cec-versions:
205
206.. flat-table:: CEC Versions
207 :header-rows: 0
208 :stub-columns: 0
209 :widths: 3 1 4
210
211
212 - .. _`CEC-OP-CEC-VERSION-1-3A`:
213
214 - ``CEC_OP_CEC_VERSION_1_3A``
215
216 - 4
217
218 - CEC version according to the HDMI 1.3a standard.
219
220 - .. _`CEC-OP-CEC-VERSION-1-4B`:
221
222 - ``CEC_OP_CEC_VERSION_1_4B``
223
224 - 5
225
226 - CEC version according to the HDMI 1.4b standard.
227
228 - .. _`CEC-OP-CEC-VERSION-2-0`:
229
230 - ``CEC_OP_CEC_VERSION_2_0``
231
232 - 6
233
234 - CEC version according to the HDMI 2.0 standard.
235
236
237
238.. _cec-prim-dev-types:
239
240.. flat-table:: CEC Primary Device Types
241 :header-rows: 0
242 :stub-columns: 0
243 :widths: 3 1 4
244
245
246 - .. _`CEC-OP-PRIM-DEVTYPE-TV`:
247
248 - ``CEC_OP_PRIM_DEVTYPE_TV``
249
250 - 0
251
252 - Use for a TV.
253
254 - .. _`CEC-OP-PRIM-DEVTYPE-RECORD`:
255
256 - ``CEC_OP_PRIM_DEVTYPE_RECORD``
257
258 - 1
259
260 - Use for a recording device.
261
262 - .. _`CEC-OP-PRIM-DEVTYPE-TUNER`:
263
264 - ``CEC_OP_PRIM_DEVTYPE_TUNER``
265
266 - 3
267
268 - Use for a device with a tuner.
269
270 - .. _`CEC-OP-PRIM-DEVTYPE-PLAYBACK`:
271
272 - ``CEC_OP_PRIM_DEVTYPE_PLAYBACK``
273
274 - 4
275
276 - Use for a playback device.
277
278 - .. _`CEC-OP-PRIM-DEVTYPE-AUDIOSYSTEM`:
279
280 - ``CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM``
281
282 - 5
283
284 - Use for an audio system (e.g. an audio/video receiver).
285
286 - .. _`CEC-OP-PRIM-DEVTYPE-SWITCH`:
287
288 - ``CEC_OP_PRIM_DEVTYPE_SWITCH``
289
290 - 6
291
292 - Use for a CEC switch.
293
294 - .. _`CEC-OP-PRIM-DEVTYPE-VIDEOPROC`:
295
296 - ``CEC_OP_PRIM_DEVTYPE_VIDEOPROC``
297
298 - 7
299
300 - Use for a video processor device.
301
302
303
304.. _cec-log-addr-types:
305
306.. flat-table:: CEC Logical Address Types
307 :header-rows: 0
308 :stub-columns: 0
309 :widths: 3 1 16
310
311
312 - .. _`CEC-LOG-ADDR-TYPE-TV`:
313
314 - ``CEC_LOG_ADDR_TYPE_TV``
315
316 - 0
317
318 - Use for a TV.
319
320 - .. _`CEC-LOG-ADDR-TYPE-RECORD`:
321
322 - ``CEC_LOG_ADDR_TYPE_RECORD``
323
324 - 1
325
326 - Use for a recording device.
327
328 - .. _`CEC-LOG-ADDR-TYPE-TUNER`:
329
330 - ``CEC_LOG_ADDR_TYPE_TUNER``
331
332 - 2
333
334 - Use for a tuner device.
335
336 - .. _`CEC-LOG-ADDR-TYPE-PLAYBACK`:
337
338 - ``CEC_LOG_ADDR_TYPE_PLAYBACK``
339
340 - 3
341
342 - Use for a playback device.
343
344 - .. _`CEC-LOG-ADDR-TYPE-AUDIOSYSTEM`:
345
346 - ``CEC_LOG_ADDR_TYPE_AUDIOSYSTEM``
347
348 - 4
349
350 - Use for an audio system device.
351
352 - .. _`CEC-LOG-ADDR-TYPE-SPECIFIC`:
353
354 - ``CEC_LOG_ADDR_TYPE_SPECIFIC``
355
356 - 5
357
358 - Use for a second TV or for a video processor device.
359
360 - .. _`CEC-LOG-ADDR-TYPE-UNREGISTERED`:
361
362 - ``CEC_LOG_ADDR_TYPE_UNREGISTERED``
363
364 - 6
365
366 - Use this if you just want to remain unregistered. Used for pure
367 CEC switches or CDC-only devices (CDC: Capability Discovery and
368 Control).
369
370
371
372.. _cec-all-dev-types-flags:
373
374.. flat-table:: CEC All Device Types Flags
375 :header-rows: 0
376 :stub-columns: 0
377 :widths: 3 1 4
378
379
380 - .. _`CEC-OP-ALL-DEVTYPE-TV`:
381
382 - ``CEC_OP_ALL_DEVTYPE_TV``
383
384 - 0x80
385
386 - This supports the TV type.
387
388 - .. _`CEC-OP-ALL-DEVTYPE-RECORD`:
389
390 - ``CEC_OP_ALL_DEVTYPE_RECORD``
391
392 - 0x40
393
394 - This supports the Recording type.
395
396 - .. _`CEC-OP-ALL-DEVTYPE-TUNER`:
397
398 - ``CEC_OP_ALL_DEVTYPE_TUNER``
399
400 - 0x20
401
402 - This supports the Tuner type.
403
404 - .. _`CEC-OP-ALL-DEVTYPE-PLAYBACK`:
405
406 - ``CEC_OP_ALL_DEVTYPE_PLAYBACK``
407
408 - 0x10
409
410 - This supports the Playback type.
411
412 - .. _`CEC-OP-ALL-DEVTYPE-AUDIOSYSTEM`:
413
414 - ``CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM``
415
416 - 0x08
417
418 - This supports the Audio System type.
419
420 - .. _`CEC-OP-ALL-DEVTYPE-SWITCH`:
421
422 - ``CEC_OP_ALL_DEVTYPE_SWITCH``
423
424 - 0x04
425
426 - This supports the CEC Switch or Video Processing type.
427
428
429
430Return Value
431============
432
433On success 0 is returned, on error -1 and the ``errno`` variable is set
434appropriately. The generic error codes are described at the
435:ref:`Generic Error Codes <gen-errors>` chapter.
436
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst b/Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst
new file mode 100644
index 000000000000..b955d044b334
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst
@@ -0,0 +1,82 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_ADAP_PHYS_ADDR:
4.. _CEC_ADAP_G_PHYS_ADDR:
5.. _CEC_ADAP_S_PHYS_ADDR:
6
7****************************************************
8ioctls CEC_ADAP_G_PHYS_ADDR and CEC_ADAP_S_PHYS_ADDR
9****************************************************
10
11Name
12====
13
14CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR - Get or set the physical address
15
16
17Synopsis
18========
19
20.. cpp:function:: int ioctl( int fd, int request, __u16 *argp )
21
22Arguments
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <cec-func-open>`.
27
28``request``
29 CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR
30
31``argp``
32
33
34Description
35===========
36
37.. note:: This documents the proposed CEC API. This API is not yet finalized
38 and is currently only available as a staging kernel module.
39
40To query the current physical address applications call
41:ref:`ioctl CEC_ADAP_G_PHYS_ADDR <CEC_ADAP_G_PHYS_ADDR>` with a pointer to a __u16 where the
42driver stores the physical address.
43
44To set a new physical address applications store the physical address in
45a __u16 and call :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` with a pointer to
46this integer. The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` is only available if
47``CEC_CAP_PHYS_ADDR`` is set (the ``ENOTTY`` error code will be returned
48otherwise). The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can only be called
49by a file descriptor in initiator mode (see :ref:`CEC_S_MODE`), if not
50the ``EBUSY`` error code will be returned.
51
52To clear an existing physical address use ``CEC_PHYS_ADDR_INVALID``.
53The adapter will go to the unconfigured state.
54
55If logical address types have been defined (see :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`),
56then this ioctl will block until all
57requested logical addresses have been claimed. If the file descriptor is in non-blocking mode
58then it will not wait for the logical addresses to be claimed, instead it just returns 0.
59
60A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` event is sent when the physical address
61changes.
62
63The physical address is a 16-bit number where each group of 4 bits
64represent a digit of the physical address a.b.c.d where the most
65significant 4 bits represent 'a'. The CEC root device (usually the TV)
66has address 0.0.0.0. Every device that is hooked up to an input of the
67TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in
68turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep
69is supported. The physical address a device shall use is stored in the
70EDID of the sink.
71
72For example, the EDID for each HDMI input of the TV will have a
73different physical address of the form a.0.0.0 that the sources will
74read out and use as their physical address.
75
76
77Return Value
78============
79
80On success 0 is returned, on error -1 and the ``errno`` variable is set
81appropriately. The generic error codes are described at the
82:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
new file mode 100644
index 000000000000..7a6d6d00ce19
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -0,0 +1,231 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_DQEVENT:
4
5*****************
6ioctl CEC_DQEVENT
7*****************
8
9Name
10====
11
12CEC_DQEVENT - Dequeue a CEC event
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct cec_event *argp )
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by :ref:`open() <cec-func-open>`.
25
26``request``
27 CEC_DQEVENT
28
29``argp``
30
31
32Description
33===========
34
35.. note:: This documents the proposed CEC API. This API is not yet finalized
36 and is currently only available as a staging kernel module.
37
38CEC devices can send asynchronous events. These can be retrieved by
39calling :ref:`ioctl CEC_DQEVENT <CEC_DQEVENT>`. If the file descriptor is in
40non-blocking mode and no event is pending, then it will return -1 and
41set errno to the ``EAGAIN`` error code.
42
43The internal event queues are per-filehandle and per-event type. If
44there is no more room in a queue then the last event is overwritten with
45the new one. This means that intermediate results can be thrown away but
46that the latest event is always available. This also means that is it
47possible to read two successive events that have the same value (e.g.
48two :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` events with
49the same state). In that case the intermediate state changes were lost but
50it is guaranteed that the state did change in between the two events.
51
52
53.. _cec-event-state-change_s:
54
55.. flat-table:: struct cec_event_state_change
56 :header-rows: 0
57 :stub-columns: 0
58 :widths: 1 1 8
59
60
61 - .. row 1
62
63 - __u16
64
65 - ``phys_addr``
66
67 - The current physical address.
68
69 - .. row 2
70
71 - __u16
72
73 - ``log_addr_mask``
74
75 - The current set of claimed logical addresses.
76
77
78
79.. _cec-event-lost-msgs_s:
80
81.. flat-table:: struct cec_event_lost_msgs
82 :header-rows: 0
83 :stub-columns: 0
84 :widths: 1 1 16
85
86
87 - .. row 1
88
89 - __u32
90
91 - ``lost_msgs``
92
93 - Set to the number of lost messages since the filehandle was opened
94 or since the last time this event was dequeued for this
95 filehandle. The messages lost are the oldest messages. So when a
96 new message arrives and there is no more room, then the oldest
97 message is discarded to make room for the new one. The internal
98 size of the message queue guarantees that all messages received in
99 the last two seconds will be stored. Since messages should be
100 replied to within a second according to the CEC specification,
101 this is more than enough.
102
103
104
105.. _cec-event:
106
107.. flat-table:: struct cec_event
108 :header-rows: 0
109 :stub-columns: 0
110 :widths: 1 1 1 8
111
112
113 - .. row 1
114
115 - __u64
116
117 - ``ts``
118
119 - Timestamp of the event in ns.
120 The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
121 the same clock from userspace use :c:func:`clock_gettime(2)`.
122
123 -
124
125 - .. row 2
126
127 - __u32
128
129 - ``event``
130
131 - The CEC event type, see :ref:`cec-events`.
132
133 -
134
135 - .. row 3
136
137 - __u32
138
139 - ``flags``
140
141 - Event flags, see :ref:`cec-event-flags`.
142
143 -
144
145 - .. row 4
146
147 - union
148
149 - (anonymous)
150
151 -
152 -
153
154 - .. row 5
155
156 -
157 - struct cec_event_state_change
158
159 - ``state_change``
160
161 - The new adapter state as sent by the :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>`
162 event.
163
164 - .. row 6
165
166 -
167 - struct cec_event_lost_msgs
168
169 - ``lost_msgs``
170
171 - The number of lost messages as sent by the :ref:`CEC_EVENT_LOST_MSGS <CEC-EVENT-LOST-MSGS>`
172 event.
173
174
175
176.. _cec-events:
177
178.. flat-table:: CEC Events Types
179 :header-rows: 0
180 :stub-columns: 0
181 :widths: 3 1 16
182
183
184 - .. _`CEC-EVENT-STATE-CHANGE`:
185
186 - ``CEC_EVENT_STATE_CHANGE``
187
188 - 1
189
190 - Generated when the CEC Adapter's state changes. When open() is
191 called an initial event will be generated for that filehandle with
192 the CEC Adapter's state at that time.
193
194 - .. _`CEC-EVENT-LOST-MSGS`:
195
196 - ``CEC_EVENT_LOST_MSGS``
197
198 - 2
199
200 - Generated if one or more CEC messages were lost because the
201 application didn't dequeue CEC messages fast enough.
202
203
204
205.. _cec-event-flags:
206
207.. flat-table:: CEC Event Flags
208 :header-rows: 0
209 :stub-columns: 0
210 :widths: 3 1 8
211
212
213 - .. _`CEC-EVENT-FL-INITIAL-VALUE`:
214
215 - ``CEC_EVENT_FL_INITIAL_VALUE``
216
217 - 1
218
219 - Set for the initial events that are generated when the device is
220 opened. See the table above for which events do this. This allows
221 applications to learn the initial state of the CEC adapter at
222 open() time.
223
224
225
226Return Value
227============
228
229On success 0 is returned, on error -1 and the ``errno`` variable is set
230appropriately. The generic error codes are described at the
231:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/cec/cec-ioc-g-mode.rst b/Documentation/media/uapi/cec/cec-ioc-g-mode.rst
new file mode 100644
index 000000000000..f0084d892db6
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-g-mode.rst
@@ -0,0 +1,295 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_MODE:
4.. _CEC_G_MODE:
5.. _CEC_S_MODE:
6
7********************************
8ioctls CEC_G_MODE and CEC_S_MODE
9********************************
10
11CEC_G_MODE, CEC_S_MODE - Get or set exclusive use of the CEC adapter
12
13Synopsis
14========
15
16.. cpp:function:: int ioctl( int fd, int request, __u32 *argp )
17
18Arguments
19=========
20
21``fd``
22 File descriptor returned by :ref:`open() <cec-func-open>`.
23
24``request``
25 CEC_G_MODE, CEC_S_MODE
26
27``argp``
28
29
30Description
31===========
32
33.. note:: This documents the proposed CEC API. This API is not yet finalized
34 and is currently only available as a staging kernel module.
35
36By default any filehandle can use :ref:`CEC_TRANSMIT`, but in order to prevent
37applications from stepping on each others toes it must be possible to
38obtain exclusive access to the CEC adapter. This ioctl sets the
39filehandle to initiator and/or follower mode which can be exclusive
40depending on the chosen mode. The initiator is the filehandle that is
41used to initiate messages, i.e. it commands other CEC devices. The
42follower is the filehandle that receives messages sent to the CEC
43adapter and processes them. The same filehandle can be both initiator
44and follower, or this role can be taken by two different filehandles.
45
46When a CEC message is received, then the CEC framework will decide how
47it will be processed. If the message is a reply to an earlier
48transmitted message, then the reply is sent back to the filehandle that
49is waiting for it. In addition the CEC framework will process it.
50
51If the message is not a reply, then the CEC framework will process it
52first. If there is no follower, then the message is just discarded and a
53feature abort is sent back to the initiator if the framework couldn't
54process it. If there is a follower, then the message is passed on to the
55follower who will use :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>` to dequeue
56the new message. The framework expects the follower to make the right
57decisions.
58
59The CEC framework will process core messages unless requested otherwise
60by the follower. The follower can enable the passthrough mode. In that
61case, the CEC framework will pass on most core messages without
62processing them and the follower will have to implement those messages.
63There are some messages that the core will always process, regardless of
64the passthrough mode. See :ref:`cec-core-processing` for details.
65
66If there is no initiator, then any CEC filehandle can use
67:ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. If there is an exclusive
68initiator then only that initiator can call
69:ref:`CEC_TRANSMIT`. The follower can of course
70always call :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`.
71
72Available initiator modes are:
73
74
75.. _cec-mode-initiator_e:
76
77.. flat-table:: Initiator Modes
78 :header-rows: 0
79 :stub-columns: 0
80 :widths: 3 1 16
81
82
83 - .. _`CEC-MODE-NO-INITIATOR`:
84
85 - ``CEC_MODE_NO_INITIATOR``
86
87 - 0x0
88
89 - This is not an initiator, i.e. it cannot transmit CEC messages or
90 make any other changes to the CEC adapter.
91
92 - .. _`CEC-MODE-INITIATOR`:
93
94 - ``CEC_MODE_INITIATOR``
95
96 - 0x1
97
98 - This is an initiator (the default when the device is opened) and
99 it can transmit CEC messages and make changes to the CEC adapter,
100 unless there is an exclusive initiator.
101
102 - .. _`CEC-MODE-EXCL-INITIATOR`:
103
104 - ``CEC_MODE_EXCL_INITIATOR``
105
106 - 0x2
107
108 - This is an exclusive initiator and this file descriptor is the
109 only one that can transmit CEC messages and make changes to the
110 CEC adapter. If someone else is already the exclusive initiator
111 then an attempt to become one will return the ``EBUSY`` error code
112 error.
113
114
115Available follower modes are:
116
117
118.. _cec-mode-follower_e:
119
120.. flat-table:: Follower Modes
121 :header-rows: 0
122 :stub-columns: 0
123 :widths: 3 1 16
124
125
126 - .. _`CEC-MODE-NO-FOLLOWER`:
127
128 - ``CEC_MODE_NO_FOLLOWER``
129
130 - 0x00
131
132 - This is not a follower (the default when the device is opened).
133
134 - .. _`CEC-MODE-FOLLOWER`:
135
136 - ``CEC_MODE_FOLLOWER``
137
138 - 0x10
139
140 - This is a follower and it will receive CEC messages unless there
141 is an exclusive follower. You cannot become a follower if
142 :ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>` is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`
143 was specified, the ``EINVAL`` error code is returned in that case.
144
145 - .. _`CEC-MODE-EXCL-FOLLOWER`:
146
147 - ``CEC_MODE_EXCL_FOLLOWER``
148
149 - 0x20
150
151 - This is an exclusive follower and only this file descriptor will
152 receive CEC messages for processing. If someone else is already
153 the exclusive follower then an attempt to become one will return
154 the ``EBUSY`` error code. You cannot become a follower if
155 :ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>` is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`
156 was specified, the ``EINVAL`` error code is returned in that case.
157
158 - .. _`CEC-MODE-EXCL-FOLLOWER-PASSTHRU`:
159
160 - ``CEC_MODE_EXCL_FOLLOWER_PASSTHRU``
161
162 - 0x30
163
164 - This is an exclusive follower and only this file descriptor will
165 receive CEC messages for processing. In addition it will put the
166 CEC device into passthrough mode, allowing the exclusive follower
167 to handle most core messages instead of relying on the CEC
168 framework for that. If someone else is already the exclusive
169 follower then an attempt to become one will return the ``EBUSY`` error
170 code. You cannot become a follower if :ref:`CEC_CAP_TRANSMIT <CEC-CAP-TRANSMIT>`
171 is not set or if :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>` was specified,
172 the ``EINVAL`` error code is returned in that case.
173
174 - .. _`CEC-MODE-MONITOR`:
175
176 - ``CEC_MODE_MONITOR``
177
178 - 0xe0
179
180 - Put the file descriptor into monitor mode. Can only be used in
181 combination with :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`, otherwise EINVAL error
182 code will be returned. In monitor mode all messages this CEC
183 device transmits and all messages it receives (both broadcast
184 messages and directed messages for one its logical addresses) will
185 be reported. This is very useful for debugging. This is only
186 allowed if the process has the ``CAP_NET_ADMIN`` capability. If
187 that is not set, then the ``EPERM`` error code is returned.
188
189 - .. _`CEC-MODE-MONITOR-ALL`:
190
191 - ``CEC_MODE_MONITOR_ALL``
192
193 - 0xf0
194
195 - Put the file descriptor into 'monitor all' mode. Can only be used
196 in combination with :ref:`CEC_MODE_NO_INITIATOR <CEC-MODE-NO-INITIATOR>`, otherwise
197 the ``EINVAL`` error code will be returned. In 'monitor all' mode all messages
198 this CEC device transmits and all messages it receives, including
199 directed messages for other CEC devices will be reported. This is
200 very useful for debugging, but not all devices support this. This
201 mode requires that the :ref:`CEC_CAP_MONITOR_ALL <CEC-CAP-MONITOR-ALL>` capability is set,
202 otherwise the ``EINVAL`` error code is returned. This is only allowed if
203 the process has the ``CAP_NET_ADMIN`` capability. If that is not
204 set, then the ``EPERM`` error code is returned.
205
206
207Core message processing details:
208
209
210.. _cec-core-processing:
211
212.. flat-table:: Core Message Processing
213 :header-rows: 0
214 :stub-columns: 0
215 :widths: 1 8
216
217
218 - .. _`CEC-MSG-GET-CEC-VERSION`:
219
220 - ``CEC_MSG_GET_CEC_VERSION``
221
222 - When in passthrough mode this message has to be handled by
223 userspace, otherwise the core will return the CEC version that was
224 set with :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`.
225
226 - .. _`CEC-MSG-GIVE-DEVICE-VENDOR-ID`:
227
228 - ``CEC_MSG_GIVE_DEVICE_VENDOR_ID``
229
230 - When in passthrough mode this message has to be handled by
231 userspace, otherwise the core will return the vendor ID that was
232 set with :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`.
233
234 - .. _`CEC-MSG-ABORT`:
235
236 - ``CEC_MSG_ABORT``
237
238 - When in passthrough mode this message has to be handled by
239 userspace, otherwise the core will return a feature refused
240 message as per the specification.
241
242 - .. _`CEC-MSG-GIVE-PHYSICAL-ADDR`:
243
244 - ``CEC_MSG_GIVE_PHYSICAL_ADDR``
245
246 - When in passthrough mode this message has to be handled by
247 userspace, otherwise the core will report the current physical
248 address.
249
250 - .. _`CEC-MSG-GIVE-OSD-NAME`:
251
252 - ``CEC_MSG_GIVE_OSD_NAME``
253
254 - When in passthrough mode this message has to be handled by
255 userspace, otherwise the core will report the current OSD name as
256 was set with :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`.
257
258 - .. _`CEC-MSG-GIVE-FEATURES`:
259
260 - ``CEC_MSG_GIVE_FEATURES``
261
262 - When in passthrough mode this message has to be handled by
263 userspace, otherwise the core will report the current features as
264 was set with :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
265 or the message is ignored if the CEC version was older than 2.0.
266
267 - .. _`CEC-MSG-USER-CONTROL-PRESSED`:
268
269 - ``CEC_MSG_USER_CONTROL_PRESSED``
270
271 - If :ref:`CEC_CAP_RC <CEC-CAP-RC>` is set, then generate a remote control key
272 press. This message is always passed on to userspace.
273
274 - .. _`CEC-MSG-USER-CONTROL-RELEASED`:
275
276 - ``CEC_MSG_USER_CONTROL_RELEASED``
277
278 - If :ref:`CEC_CAP_RC <CEC-CAP-RC>` is set, then generate a remote control key
279 release. This message is always passed on to userspace.
280
281 - .. _`CEC-MSG-REPORT-PHYSICAL-ADDR`:
282
283 - ``CEC_MSG_REPORT_PHYSICAL_ADDR``
284
285 - The CEC framework will make note of the reported physical address
286 and then just pass the message on to userspace.
287
288
289
290Return Value
291============
292
293On success 0 is returned, on error -1 and the ``errno`` variable is set
294appropriately. The generic error codes are described at the
295:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst b/Documentation/media/uapi/cec/cec-ioc-receive.rst
new file mode 100644
index 000000000000..ae5a39ade45f
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -0,0 +1,360 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CEC_TRANSMIT:
4.. _CEC_RECEIVE:
5
6***********************************
7ioctls CEC_RECEIVE and CEC_TRANSMIT
8***********************************
9
10Name
11====
12
13CEC_RECEIVE, CEC_TRANSMIT - Receive or transmit a CEC message
14
15
16Synopsis
17========
18
19.. cpp:function:: int ioctl( int fd, int request, struct cec_msg *argp )
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <cec-func-open>`.
26
27``request``
28 CEC_RECEIVE, CEC_TRANSMIT
29
30``argp``
31
32
33Description
34===========
35
36.. note:: This documents the proposed CEC API. This API is not yet finalized
37 and is currently only available as a staging kernel module.
38
39To receive a CEC message the application has to fill in the
40``timeout`` field of :c:type:`struct cec_msg` and pass it to :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
41If the file descriptor is in non-blocking mode and there are no received
42messages pending, then it will return -1 and set errno to the ``EAGAIN``
43error code. If the file descriptor is in blocking mode and ``timeout``
44is non-zero and no message arrived within ``timeout`` milliseconds, then
45it will return -1 and set errno to the ``ETIMEDOUT`` error code.
46
47A received message can be:
48
491. a message received from another CEC device (the ``sequence`` field will
50 be 0).
512. the result of an earlier non-blocking transmit (the ``sequence`` field will
52 be non-zero).
53
54To send a CEC message the application has to fill in the
55:c:type:`struct cec_msg` and pass it to
56:ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. The :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` is only available if
57``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit
58queue, then it will return -1 and set errno to the ``EBUSY`` error code.
59The transmit queue has enough room for 18 messages (about 1 second worth
60of 2-byte messages). Note that the CEC kernel framework will also reply
61to core messages (see :ref:cec-core-processing), so it is not a good
62idea to fully fill up the transmit queue.
63
64If the file descriptor is in non-blocking mode then the transmit will
65return 0 and the result of the transmit will be available via
66:ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>` once the transmit has finished
67(including waiting for a reply, if requested).
68
69The ``sequence`` field is filled in for every transmit and this can be
70checked against the received messages to find the corresponding transmit
71result.
72
73
74.. _cec-msg:
75
76.. flat-table:: struct cec_msg
77 :header-rows: 0
78 :stub-columns: 0
79 :widths: 1 1 16
80
81
82 - .. row 1
83
84 - __u64
85
86 - ``tx_ts``
87
88 - Timestamp in ns of when the last byte of the message was transmitted.
89 The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
90 the same clock from userspace use :c:func:`clock_gettime(2)`.
91
92 - .. row 2
93
94 - __u64
95
96 - ``rx_ts``
97
98 - Timestamp in ns of when the last byte of the message was received.
99 The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
100 the same clock from userspace use :c:func:`clock_gettime(2)`.
101
102 - .. row 3
103
104 - __u32
105
106 - ``len``
107
108 - The length of the message. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` this is filled in
109 by the application. The driver will fill this in for
110 :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` it will be
111 filled in by the driver with the length of the reply message if ``reply`` was set.
112
113 - .. row 4
114
115 - __u32
116
117 - ``timeout``
118
119 - The timeout in milliseconds. This is the time the device will wait
120 for a message to be received before timing out. If it is set to 0,
121 then it will wait indefinitely when it is called by :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
122 If it is 0 and it is called by :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`,
123 then it will be replaced by 1000 if the ``reply`` is non-zero or
124 ignored if ``reply`` is 0.
125
126 - .. row 5
127
128 - __u32
129
130 - ``sequence``
131
132 - A non-zero sequence number is automatically assigned by the CEC framework
133 for all transmitted messages. It is used by the CEC framework when it queues
134 the transmit result (when transmit was called in non-blocking mode). This
135 allows the application to associate the received message with the original
136 transmit.
137
138 - .. row 6
139
140 - __u32
141
142 - ``flags``
143
144 - Flags. No flags are defined yet, so set this to 0.
145
146 - .. row 7
147
148 - __u8
149
150 - ``tx_status``
151
152 - The status bits of the transmitted message. See
153 :ref:`cec-tx-status` for the possible status values. It is 0 if
154 this messages was received, not transmitted.
155
156 - .. row 8
157
158 - __u8
159
160 - ``msg[16]``
161
162 - The message payload. For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` this is filled in by the
163 application. The driver will fill this in for :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
164 For :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` it will be filled in by the driver with
165 the payload of the reply message if ``timeout`` was set.
166
167 - .. row 8
168
169 - __u8
170
171 - ``reply``
172
173 - Wait until this message is replied. If ``reply`` is 0 and the
174 ``timeout`` is 0, then don't wait for a reply but return after
175 transmitting the message. Ignored by :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
176 The case where ``reply`` is 0 (this is the opcode for the Feature Abort
177 message) and ``timeout`` is non-zero is specifically allowed to make it
178 possible to send a message and wait up to ``timeout`` milliseconds for a
179 Feature Abort reply. In this case ``rx_status`` will either be set
180 to :ref:`CEC_RX_STATUS_TIMEOUT <CEC-RX-STATUS-TIMEOUT>` or
181 :ref:`CEC_RX_STATUS_FEATURE_ABORT <CEC-RX-STATUS-FEATURE-ABORT>`.
182
183 - .. row 9
184
185 - __u8
186
187 - ``rx_status``
188
189 - The status bits of the received message. See
190 :ref:`cec-rx-status` for the possible status values. It is 0 if
191 this message was transmitted, not received, unless this is the
192 reply to a transmitted message. In that case both ``rx_status``
193 and ``tx_status`` are set.
194
195 - .. row 10
196
197 - __u8
198
199 - ``tx_status``
200
201 - The status bits of the transmitted message. See
202 :ref:`cec-tx-status` for the possible status values. It is 0 if
203 this messages was received, not transmitted.
204
205 - .. row 11
206
207 - __u8
208
209 - ``tx_arb_lost_cnt``
210
211 - A counter of the number of transmit attempts that resulted in the
212 Arbitration Lost error. This is only set if the hardware supports
213 this, otherwise it is always 0. This counter is only valid if the
214 :ref:`CEC_TX_STATUS_ARB_LOST <CEC-TX-STATUS-ARB-LOST>` status bit is set.
215
216 - .. row 12
217
218 - __u8
219
220 - ``tx_nack_cnt``
221
222 - A counter of the number of transmit attempts that resulted in the
223 Not Acknowledged error. This is only set if the hardware supports
224 this, otherwise it is always 0. This counter is only valid if the
225 :ref:`CEC_TX_STATUS_NACK <CEC-TX-STATUS-NACK>` status bit is set.
226
227 - .. row 13
228
229 - __u8
230
231 - ``tx_low_drive_cnt``
232
233 - A counter of the number of transmit attempts that resulted in the
234 Arbitration Lost error. This is only set if the hardware supports
235 this, otherwise it is always 0. This counter is only valid if the
236 :ref:`CEC_TX_STATUS_LOW_DRIVE <CEC-TX-STATUS-LOW-DRIVE>` status bit is set.
237
238 - .. row 14
239
240 - __u8
241
242 - ``tx_error_cnt``
243
244 - A counter of the number of transmit errors other than Arbitration
245 Lost or Not Acknowledged. This is only set if the hardware
246 supports this, otherwise it is always 0. This counter is only
247 valid if the :ref:`CEC_TX_STATUS_ERROR <CEC-TX-STATUS-ERROR>` status bit is set.
248
249
250
251.. _cec-tx-status:
252
253.. flat-table:: CEC Transmit Status
254 :header-rows: 0
255 :stub-columns: 0
256 :widths: 3 1 16
257
258
259 - .. _`CEC-TX-STATUS-OK`:
260
261 - ``CEC_TX_STATUS_OK``
262
263 - 0x01
264
265 - The message was transmitted successfully. This is mutually
266 exclusive with :ref:`CEC_TX_STATUS_MAX_RETRIES <CEC-TX-STATUS-MAX-RETRIES>`. Other bits can still
267 be set if earlier attempts met with failure before the transmit
268 was eventually successful.
269
270 - .. _`CEC-TX-STATUS-ARB-LOST`:
271
272 - ``CEC_TX_STATUS_ARB_LOST``
273
274 - 0x02
275
276 - CEC line arbitration was lost.
277
278 - .. _`CEC-TX-STATUS-NACK`:
279
280 - ``CEC_TX_STATUS_NACK``
281
282 - 0x04
283
284 - Message was not acknowledged.
285
286 - .. _`CEC-TX-STATUS-LOW-DRIVE`:
287
288 - ``CEC_TX_STATUS_LOW_DRIVE``
289
290 - 0x08
291
292 - Low drive was detected on the CEC bus. This indicates that a
293 follower detected an error on the bus and requests a
294 retransmission.
295
296 - .. _`CEC-TX-STATUS-ERROR`:
297
298 - ``CEC_TX_STATUS_ERROR``
299
300 - 0x10
301
302 - Some error occurred. This is used for any errors that do not fit
303 the previous two, either because the hardware could not tell which
304 error occurred, or because the hardware tested for other
305 conditions besides those two.
306
307 - .. _`CEC-TX-STATUS-MAX-RETRIES`:
308
309 - ``CEC_TX_STATUS_MAX_RETRIES``
310
311 - 0x20
312
313 - The transmit failed after one or more retries. This status bit is
314 mutually exclusive with :ref:`CEC_TX_STATUS_OK <CEC-TX-STATUS-OK>`. Other bits can still
315 be set to explain which failures were seen.
316
317
318
319.. _cec-rx-status:
320
321.. flat-table:: CEC Receive Status
322 :header-rows: 0
323 :stub-columns: 0
324 :widths: 3 1 16
325
326
327 - .. _`CEC-RX-STATUS-OK`:
328
329 - ``CEC_RX_STATUS_OK``
330
331 - 0x01
332
333 - The message was received successfully.
334
335 - .. _`CEC-RX-STATUS-TIMEOUT`:
336
337 - ``CEC_RX_STATUS_TIMEOUT``
338
339 - 0x02
340
341 - The reply to an earlier transmitted message timed out.
342
343 - .. _`CEC-RX-STATUS-FEATURE-ABORT`:
344
345 - ``CEC_RX_STATUS_FEATURE_ABORT``
346
347 - 0x04
348
349 - The message was received successfully but the reply was
350 ``CEC_MSG_FEATURE_ABORT``. This status is only set if this message
351 was the reply to an earlier transmitted message.
352
353
354
355Return Value
356============
357
358On success 0 is returned, on error -1 and the ``errno`` variable is set
359appropriately. The generic error codes are described at the
360:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-bilingual-channel-select.rst b/Documentation/media/uapi/dvb/audio-bilingual-channel-select.rst
new file mode 100644
index 000000000000..dbe20ff38e83
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-bilingual-channel-select.rst
@@ -0,0 +1,64 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_BILINGUAL_CHANNEL_SELECT:
4
5==============================
6AUDIO_BILINGUAL_CHANNEL_SELECT
7==============================
8
9Name
10----
11
12AUDIO_BILINGUAL_CHANNEL_SELECT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_BILINGUAL_CHANNEL_SELECT for this command.
40
41 - .. row 3
42
43 - audio_channel_select_t ch
44
45 - Select the output format of the audio (mono left/right, stereo).
46
47
48Description
49-----------
50
51This ioctl is obsolete. Do not use in new drivers. It has been replaced
52by the V4L2 ``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK`` control
53for MPEG decoders controlled through V4L2.
54
55This ioctl call asks the Audio Device to select the requested channel
56for bilingual streams if possible.
57
58
59Return Value
60------------
61
62On success 0 is returned, on error -1 and the ``errno`` variable is set
63appropriately. The generic error codes are described at the
64:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-channel-select.rst b/Documentation/media/uapi/dvb/audio-channel-select.rst
new file mode 100644
index 000000000000..69df4c0f2fb2
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-channel-select.rst
@@ -0,0 +1,63 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_CHANNEL_SELECT:
4
5====================
6AUDIO_CHANNEL_SELECT
7====================
8
9Name
10----
11
12AUDIO_CHANNEL_SELECT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_CHANNEL_SELECT, audio_channel_select_t)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_CHANNEL_SELECT for this command.
40
41 - .. row 3
42
43 - audio_channel_select_t ch
44
45 - Select the output format of the audio (mono left/right, stereo).
46
47
48Description
49-----------
50
51This ioctl is for DVB devices only. To control a V4L2 decoder use the
52V4L2 ``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK`` control instead.
53
54This ioctl call asks the Audio Device to select the requested channel if
55possible.
56
57
58Return Value
59------------
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-clear-buffer.rst b/Documentation/media/uapi/dvb/audio-clear-buffer.rst
new file mode 100644
index 000000000000..a3dec29bdc69
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-clear-buffer.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_CLEAR_BUFFER:
4
5==================
6AUDIO_CLEAR_BUFFER
7==================
8
9Name
10----
11
12AUDIO_CLEAR_BUFFER
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_CLEAR_BUFFER)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_CLEAR_BUFFER for this command.
40
41
42Description
43-----------
44
45This ioctl call asks the Audio Device to clear all software and hardware
46buffers of the audio decoder device.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-continue.rst b/Documentation/media/uapi/dvb/audio-continue.rst
new file mode 100644
index 000000000000..053627dd61e7
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-continue.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_CONTINUE:
4
5==============
6AUDIO_CONTINUE
7==============
8
9Name
10----
11
12AUDIO_CONTINUE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_CONTINUE)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_CONTINUE for this command.
40
41
42Description
43-----------
44
45This ioctl restarts the decoding and playing process previously paused
46with AUDIO_PAUSE command.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-fclose.rst b/Documentation/media/uapi/dvb/audio-fclose.rst
new file mode 100644
index 000000000000..e5d4225cd9d7
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-fclose.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_fclose:
4
5=================
6DVB audio close()
7=================
8
9Name
10----
11
12DVB audio close()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int close(int fd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35
36Description
37-----------
38
39This system call closes a previously opened audio device.
40
41
42Return Value
43------------
44
45.. flat-table::
46 :header-rows: 0
47 :stub-columns: 0
48
49
50 - .. row 1
51
52 - ``EBADF``
53
54 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/audio-fopen.rst b/Documentation/media/uapi/dvb/audio-fopen.rst
new file mode 100644
index 000000000000..ec3b23aa79b3
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-fopen.rst
@@ -0,0 +1,104 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_fopen:
4
5================
6DVB audio open()
7================
8
9Name
10----
11
12DVB audio open()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int open(const char *deviceName, int flags)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - const char \*deviceName
32
33 - Name of specific audio device.
34
35 - .. row 2
36
37 - int flags
38
39 - A bit-wise OR of the following flags:
40
41 - .. row 3
42
43 -
44 - O_RDONLY read-only access
45
46 - .. row 4
47
48 -
49 - O_RDWR read/write access
50
51 - .. row 5
52
53 -
54 - O_NONBLOCK open in non-blocking mode
55
56 - .. row 6
57
58 -
59 - (blocking mode is the default)
60
61
62Description
63-----------
64
65This system call opens a named audio device (e.g.
66/dev/dvb/adapter0/audio0) for subsequent use. When an open() call has
67succeeded, the device will be ready for use. The significance of
68blocking or non-blocking mode is described in the documentation for
69functions where there is a difference. It does not affect the semantics
70of the open() call itself. A device opened in blocking mode can later be
71put into non-blocking mode (and vice versa) using the F_SETFL command
72of the fcntl system call. This is a standard system call, documented in
73the Linux manual page for fcntl. Only one user can open the Audio Device
74in O_RDWR mode. All other attempts to open the device in this mode will
75fail, and an error code will be returned. If the Audio Device is opened
76in O_RDONLY mode, the only ioctl call that can be used is
77AUDIO_GET_STATUS. All other call will return with an error code.
78
79
80Return Value
81------------
82
83.. flat-table::
84 :header-rows: 0
85 :stub-columns: 0
86
87
88 - .. row 1
89
90 - ``ENODEV``
91
92 - Device driver not loaded/available.
93
94 - .. row 2
95
96 - ``EBUSY``
97
98 - Device or resource busy.
99
100 - .. row 3
101
102 - ``EINVAL``
103
104 - Invalid argument.
diff --git a/Documentation/media/uapi/dvb/audio-fwrite.rst b/Documentation/media/uapi/dvb/audio-fwrite.rst
new file mode 100644
index 000000000000..ca95b9be0c2a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-fwrite.rst
@@ -0,0 +1,82 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_fwrite:
4
5=================
6DVB audio write()
7=================
8
9Name
10----
11
12DVB audio write()
13
14
15Synopsis
16--------
17
18.. cpp:function:: size_t write(int fd, const void *buf, size_t count)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - void \*buf
38
39 - Pointer to the buffer containing the PES data.
40
41 - .. row 3
42
43 - size_t count
44
45 - Size of buf.
46
47
48Description
49-----------
50
51This system call can only be used if AUDIO_SOURCE_MEMORY is selected
52in the ioctl call AUDIO_SELECT_SOURCE. The data provided shall be in
53PES format. If O_NONBLOCK is not specified the function will block
54until buffer space is available. The amount of data to be transferred is
55implied by count.
56
57
58Return Value
59------------
60
61.. flat-table::
62 :header-rows: 0
63 :stub-columns: 0
64
65
66 - .. row 1
67
68 - ``EPERM``
69
70 - Mode AUDIO_SOURCE_MEMORY not selected.
71
72 - .. row 2
73
74 - ``ENOMEM``
75
76 - Attempted to write more data than the internal buffer can hold.
77
78 - .. row 3
79
80 - ``EBADF``
81
82 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/audio-get-capabilities.rst b/Documentation/media/uapi/dvb/audio-get-capabilities.rst
new file mode 100644
index 000000000000..e274a8d53785
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-get-capabilities.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_GET_CAPABILITIES:
4
5======================
6AUDIO_GET_CAPABILITIES
7======================
8
9Name
10----
11
12AUDIO_GET_CAPABILITIES
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_GET_CAPABILITIES, unsigned int *cap)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_GET_CAPABILITIES for this command.
40
41 - .. row 3
42
43 - unsigned int \*cap
44
45 - Returns a bit array of supported sound formats.
46
47
48Description
49-----------
50
51This ioctl call asks the Audio Device to tell us about the decoding
52capabilities of the audio hardware.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-get-pts.rst b/Documentation/media/uapi/dvb/audio-get-pts.rst
new file mode 100644
index 000000000000..5f875508b833
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-get-pts.rst
@@ -0,0 +1,69 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_GET_PTS:
4
5=============
6AUDIO_GET_PTS
7=============
8
9Name
10----
11
12AUDIO_GET_PTS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_GET_PTS, __u64 *pts)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_GET_PTS for this command.
40
41 - .. row 3
42
43 - __u64 \*pts
44
45 - Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 /
46 ISO/IEC 13818-1.
47
48 The PTS should belong to the currently played frame if possible,
49 but may also be a value close to it like the PTS of the last
50 decoded frame or the last PTS extracted by the PES parser.
51
52
53Description
54-----------
55
56This ioctl is obsolete. Do not use in new drivers. If you need this
57functionality, then please contact the linux-media mailing list
58(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__).
59
60This ioctl call asks the Audio Device to return the current PTS
61timestamp.
62
63
64Return Value
65------------
66
67On success 0 is returned, on error -1 and the ``errno`` variable is set
68appropriately. The generic error codes are described at the
69:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-get-status.rst b/Documentation/media/uapi/dvb/audio-get-status.rst
new file mode 100644
index 000000000000..cbd822773d85
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-get-status.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_GET_STATUS:
4
5================
6AUDIO_GET_STATUS
7================
8
9Name
10----
11
12AUDIO_GET_STATUS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_GET_STATUS, struct audio_status *status)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_GET_STATUS for this command.
40
41 - .. row 3
42
43 - struct audio_status \*status
44
45 - Returns the current state of Audio Device.
46
47
48Description
49-----------
50
51This ioctl call asks the Audio Device to return the current state of the
52Audio Device.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-pause.rst b/Documentation/media/uapi/dvb/audio-pause.rst
new file mode 100644
index 000000000000..9ca263e90c6c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-pause.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_PAUSE:
4
5===========
6AUDIO_PAUSE
7===========
8
9Name
10----
11
12AUDIO_PAUSE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_PAUSE)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_PAUSE for this command.
40
41
42Description
43-----------
44
45This ioctl call suspends the audio stream being played. Decoding and
46playing are paused. It is then possible to restart again decoding and
47playing process of the audio stream using AUDIO_CONTINUE command.
48
49
50Return Value
51------------
52
53On success 0 is returned, on error -1 and the ``errno`` variable is set
54appropriately. The generic error codes are described at the
55:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-play.rst b/Documentation/media/uapi/dvb/audio-play.rst
new file mode 100644
index 000000000000..db4d7203acc5
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-play.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_PLAY:
4
5==========
6AUDIO_PLAY
7==========
8
9Name
10----
11
12AUDIO_PLAY
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_PLAY)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_PLAY for this command.
40
41
42Description
43-----------
44
45This ioctl call asks the Audio Device to start playing an audio stream
46from the selected source.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-select-source.rst b/Documentation/media/uapi/dvb/audio-select-source.rst
new file mode 100644
index 000000000000..b806d806a46f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-select-source.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SELECT_SOURCE:
4
5===================
6AUDIO_SELECT_SOURCE
7===================
8
9Name
10----
11
12AUDIO_SELECT_SOURCE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SELECT_SOURCE, audio_stream_source_t source)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SELECT_SOURCE for this command.
40
41 - .. row 3
42
43 - audio_stream_source_t source
44
45 - Indicates the source that shall be used for the Audio stream.
46
47
48Description
49-----------
50
51This ioctl call informs the audio device which source shall be used for
52the input data. The possible sources are demux or memory. If
53AUDIO_SOURCE_MEMORY is selected, the data is fed to the Audio Device
54through the write command.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-attributes.rst b/Documentation/media/uapi/dvb/audio-set-attributes.rst
new file mode 100644
index 000000000000..18667cea2cdf
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-attributes.rst
@@ -0,0 +1,71 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_ATTRIBUTES:
4
5====================
6AUDIO_SET_ATTRIBUTES
7====================
8
9Name
10----
11
12AUDIO_SET_ATTRIBUTES
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = AUDIO_SET_ATTRIBUTES, audio_attributes_t attr )
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_ATTRIBUTES for this command.
40
41 - .. row 3
42
43 - audio_attributes_t attr
44
45 - audio attributes according to section ??
46
47
48Description
49-----------
50
51This ioctl is intended for DVD playback and allows you to set certain
52information about the audio stream.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62.. flat-table::
63 :header-rows: 0
64 :stub-columns: 0
65
66
67 - .. row 1
68
69 - ``EINVAL``
70
71 - attr is not a valid or supported attribute setting.
diff --git a/Documentation/media/uapi/dvb/audio-set-av-sync.rst b/Documentation/media/uapi/dvb/audio-set-av-sync.rst
new file mode 100644
index 000000000000..6f7e26fa4cd1
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-av-sync.rst
@@ -0,0 +1,70 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_AV_SYNC:
4
5=================
6AUDIO_SET_AV_SYNC
7=================
8
9Name
10----
11
12AUDIO_SET_AV_SYNC
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SET_AV_SYNC, boolean state)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_AV_SYNC for this command.
40
41 - .. row 3
42
43 - boolean state
44
45 - Tells the DVB subsystem if A/V synchronization shall be ON or OFF.
46
47 - .. row 4
48
49 -
50 - TRUE AV-sync ON
51
52 - .. row 5
53
54 -
55 - FALSE AV-sync OFF
56
57
58Description
59-----------
60
61This ioctl call asks the Audio Device to turn ON or OFF A/V
62synchronization.
63
64
65Return Value
66------------
67
68On success 0 is returned, on error -1 and the ``errno`` variable is set
69appropriately. The generic error codes are described at the
70:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-bypass-mode.rst b/Documentation/media/uapi/dvb/audio-set-bypass-mode.rst
new file mode 100644
index 000000000000..30bcaca14c3f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-bypass-mode.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_BYPASS_MODE:
4
5=====================
6AUDIO_SET_BYPASS_MODE
7=====================
8
9Name
10----
11
12AUDIO_SET_BYPASS_MODE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SET_BYPASS_MODE, boolean mode)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_BYPASS_MODE for this command.
40
41 - .. row 3
42
43 - boolean mode
44
45 - Enables or disables the decoding of the current Audio stream in
46 the DVB subsystem.
47
48 - .. row 4
49
50 -
51 - TRUE Bypass is disabled
52
53 - .. row 5
54
55 -
56 - FALSE Bypass is enabled
57
58
59Description
60-----------
61
62This ioctl call asks the Audio Device to bypass the Audio decoder and
63forward the stream without decoding. This mode shall be used if streams
64that can’t be handled by the DVB system shall be decoded. Dolby
65DigitalTM streams are automatically forwarded by the DVB subsystem if
66the hardware can handle it.
67
68
69Return Value
70------------
71
72On success 0 is returned, on error -1 and the ``errno`` variable is set
73appropriately. The generic error codes are described at the
74:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-ext-id.rst b/Documentation/media/uapi/dvb/audio-set-ext-id.rst
new file mode 100644
index 000000000000..049414db8ef6
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-ext-id.rst
@@ -0,0 +1,71 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_EXT_ID:
4
5================
6AUDIO_SET_EXT_ID
7================
8
9Name
10----
11
12AUDIO_SET_EXT_ID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = AUDIO_SET_EXT_ID, int id)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_EXT_ID for this command.
40
41 - .. row 3
42
43 - int id
44
45 - audio sub_stream_id
46
47
48Description
49-----------
50
51This ioctl can be used to set the extension id for MPEG streams in DVD
52playback. Only the first 3 bits are recognized.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62.. flat-table::
63 :header-rows: 0
64 :stub-columns: 0
65
66
67 - .. row 1
68
69 - ``EINVAL``
70
71 - id is not a valid id.
diff --git a/Documentation/media/uapi/dvb/audio-set-id.rst b/Documentation/media/uapi/dvb/audio-set-id.rst
new file mode 100644
index 000000000000..a664dc1955cb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-id.rst
@@ -0,0 +1,65 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_ID:
4
5============
6AUDIO_SET_ID
7============
8
9Name
10----
11
12AUDIO_SET_ID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SET_ID, int id)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_ID for this command.
40
41 - .. row 3
42
43 - int id
44
45 - audio sub-stream id
46
47
48Description
49-----------
50
51This ioctl selects which sub-stream is to be decoded if a program or
52system stream is sent to the video device. If no audio stream type is
53set the id has to be in [0xC0,0xDF] for MPEG sound, in [0x80,0x87] for
54AC3 and in [0xA0,0xA7] for LPCM. More specifications may follow for
55other stream types. If the stream type is set the id just specifies the
56substream id of the audio stream and only the first 5 bits are
57recognized.
58
59
60Return Value
61------------
62
63On success 0 is returned, on error -1 and the ``errno`` variable is set
64appropriately. The generic error codes are described at the
65:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-karaoke.rst b/Documentation/media/uapi/dvb/audio-set-karaoke.rst
new file mode 100644
index 000000000000..b55f8380b9cd
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-karaoke.rst
@@ -0,0 +1,70 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_KARAOKE:
4
5=================
6AUDIO_SET_KARAOKE
7=================
8
9Name
10----
11
12AUDIO_SET_KARAOKE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = AUDIO_SET_KARAOKE, audio_karaoke_t *karaoke)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_KARAOKE for this command.
40
41 - .. row 3
42
43 - audio_karaoke_t \*karaoke
44
45 - karaoke settings according to section ??.
46
47
48Description
49-----------
50
51This ioctl allows one to set the mixer settings for a karaoke DVD.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61.. flat-table::
62 :header-rows: 0
63 :stub-columns: 0
64
65
66 - .. row 1
67
68 - ``EINVAL``
69
70 - karaoke is not a valid or supported karaoke setting.
diff --git a/Documentation/media/uapi/dvb/audio-set-mixer.rst b/Documentation/media/uapi/dvb/audio-set-mixer.rst
new file mode 100644
index 000000000000..67821729c2b6
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-mixer.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_MIXER:
4
5===============
6AUDIO_SET_MIXER
7===============
8
9Name
10----
11
12AUDIO_SET_MIXER
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SET_MIXER, audio_mixer_t *mix)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_ID for this command.
40
41 - .. row 3
42
43 - audio_mixer_t \*mix
44
45 - mixer settings.
46
47
48Description
49-----------
50
51This ioctl lets you adjust the mixer settings of the audio decoder.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-mute.rst b/Documentation/media/uapi/dvb/audio-set-mute.rst
new file mode 100644
index 000000000000..ebaba95ee278
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-mute.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_MUTE:
4
5==============
6AUDIO_SET_MUTE
7==============
8
9Name
10----
11
12AUDIO_SET_MUTE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_SET_MUTE, boolean state)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_MUTE for this command.
40
41 - .. row 3
42
43 - boolean state
44
45 - Indicates if audio device shall mute or not.
46
47 - .. row 4
48
49 -
50 - TRUE Audio Mute
51
52 - .. row 5
53
54 -
55 - FALSE Audio Un-mute
56
57
58Description
59-----------
60
61This ioctl is for DVB devices only. To control a V4L2 decoder use the
62V4L2 :ref:`VIDIOC_DECODER_CMD` with the
63``V4L2_DEC_CMD_START_MUTE_AUDIO`` flag instead.
64
65This ioctl call asks the audio device to mute the stream that is
66currently being played.
67
68
69Return Value
70------------
71
72On success 0 is returned, on error -1 and the ``errno`` variable is set
73appropriately. The generic error codes are described at the
74:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio-set-streamtype.rst b/Documentation/media/uapi/dvb/audio-set-streamtype.rst
new file mode 100644
index 000000000000..dfb9a6c00d88
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-set-streamtype.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_SET_STREAMTYPE:
4
5====================
6AUDIO_SET_STREAMTYPE
7====================
8
9Name
10----
11
12AUDIO_SET_STREAMTYPE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = AUDIO_SET_STREAMTYPE, int type)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_SET_STREAMTYPE for this command.
40
41 - .. row 3
42
43 - int type
44
45 - stream type
46
47
48Description
49-----------
50
51This ioctl tells the driver which kind of audio stream to expect. This
52is useful if the stream offers several audio sub-streams like LPCM and
53AC3.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EINVAL``
73
74 - type is not a valid or supported stream type.
diff --git a/Documentation/media/uapi/dvb/audio-stop.rst b/Documentation/media/uapi/dvb/audio-stop.rst
new file mode 100644
index 000000000000..449127e3f2aa
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio-stop.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _AUDIO_STOP:
4
5==========
6AUDIO_STOP
7==========
8
9Name
10----
11
12AUDIO_STOP
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = AUDIO_STOP)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals AUDIO_STOP for this command.
40
41
42Description
43-----------
44
45This ioctl call asks the Audio Device to stop playing the current
46stream.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/audio.rst b/Documentation/media/uapi/dvb/audio.rst
new file mode 100644
index 000000000000..155622185ea4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio.rst
@@ -0,0 +1,26 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_audio:
4
5################
6DVB Audio Device
7################
8The DVB audio device controls the MPEG2 audio decoder of the DVB
9hardware. It can be accessed through ``/dev/dvb/adapter?/audio?``. Data
10types and and ioctl definitions can be accessed by including
11``linux/dvb/audio.h`` in your application.
12
13Please note that some DVB cards don’t have their own MPEG decoder, which
14results in the omission of the audio and video device.
15
16These ioctls were also used by V4L2 to control MPEG decoders implemented
17in V4L2. The use of these ioctls for that purpose has been made obsolete
18and proper V4L2 ioctls or controls have been created to replace that
19functionality.
20
21
22.. toctree::
23 :maxdepth: 1
24
25 audio_data_types
26 audio_function_calls
diff --git a/Documentation/media/uapi/dvb/audio_data_types.rst b/Documentation/media/uapi/dvb/audio_data_types.rst
new file mode 100644
index 000000000000..4a53127eb13a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio_data_types.rst
@@ -0,0 +1,176 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_data_types:
4
5****************
6Audio Data Types
7****************
8
9This section describes the structures, data types and defines used when
10talking to the audio device.
11
12
13.. _audio-stream-source-t:
14
15audio_stream_source_t
16=====================
17
18The audio stream source is set through the AUDIO_SELECT_SOURCE call
19and can take the following values, depending on whether we are replaying
20from an internal (demux) or external (user write) source.
21
22
23.. code-block:: c
24
25 typedef enum {
26 AUDIO_SOURCE_DEMUX,
27 AUDIO_SOURCE_MEMORY
28 } audio_stream_source_t;
29
30AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the
31frontend or the DVR device) as the source of the video stream. If
32AUDIO_SOURCE_MEMORY is selected the stream comes from the application
33through the ``write()`` system call.
34
35
36.. _audio-play-state-t:
37
38audio_play_state_t
39==================
40
41The following values can be returned by the AUDIO_GET_STATUS call
42representing the state of audio playback.
43
44
45.. code-block:: c
46
47 typedef enum {
48 AUDIO_STOPPED,
49 AUDIO_PLAYING,
50 AUDIO_PAUSED
51 } audio_play_state_t;
52
53
54.. _audio-channel-select-t:
55
56audio_channel_select_t
57======================
58
59The audio channel selected via AUDIO_CHANNEL_SELECT is determined by
60the following values.
61
62
63.. code-block:: c
64
65 typedef enum {
66 AUDIO_STEREO,
67 AUDIO_MONO_LEFT,
68 AUDIO_MONO_RIGHT,
69 AUDIO_MONO,
70 AUDIO_STEREO_SWAPPED
71 } audio_channel_select_t;
72
73
74.. _audio-status:
75
76struct audio_status
77===================
78
79The AUDIO_GET_STATUS call returns the following structure informing
80about various states of the playback operation.
81
82
83.. code-block:: c
84
85 typedef struct audio_status {
86 boolean AV_sync_state;
87 boolean mute_state;
88 audio_play_state_t play_state;
89 audio_stream_source_t stream_source;
90 audio_channel_select_t channel_select;
91 boolean bypass_mode;
92 audio_mixer_t mixer_state;
93 } audio_status_t;
94
95
96.. _audio-mixer:
97
98struct audio_mixer
99==================
100
101The following structure is used by the AUDIO_SET_MIXER call to set the
102audio volume.
103
104
105.. code-block:: c
106
107 typedef struct audio_mixer {
108 unsigned int volume_left;
109 unsigned int volume_right;
110 } audio_mixer_t;
111
112
113.. _audio_encodings:
114
115audio encodings
116===============
117
118A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the
119following bits set according to the hardwares capabilities.
120
121
122.. code-block:: c
123
124 #define AUDIO_CAP_DTS 1
125 #define AUDIO_CAP_LPCM 2
126 #define AUDIO_CAP_MP1 4
127 #define AUDIO_CAP_MP2 8
128 #define AUDIO_CAP_MP3 16
129 #define AUDIO_CAP_AAC 32
130 #define AUDIO_CAP_OGG 64
131 #define AUDIO_CAP_SDDS 128
132 #define AUDIO_CAP_AC3 256
133
134
135.. _audio-karaoke:
136
137struct audio_karaoke
138====================
139
140The ioctl AUDIO_SET_KARAOKE uses the following format:
141
142
143.. code-block:: c
144
145 typedef
146 struct audio_karaoke {
147 int vocal1;
148 int vocal2;
149 int melody;
150 } audio_karaoke_t;
151
152If Vocal1 or Vocal2 are non-zero, they get mixed into left and right t
153at 70% each. If both, Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed
154into the left channel and Vocal2 into the right channel at 100% each. Ff
155Melody is non-zero, the melody channel gets mixed into left and right.
156
157
158.. _audio-attributes-t:
159
160audio attributes
161================
162
163The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
164
165
166.. code-block:: c
167
168 typedef uint16_t audio_attributes_t;
169 /* bits: descr. */
170 /* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
171 /* 12 multichannel extension */
172 /* 11-10 audio type (0=not spec, 1=language included) */
173 /* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
174 /* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
175 /* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
176 /* 2- 0 number of audio channels (n+1 channels) */
diff --git a/Documentation/media/uapi/dvb/audio_function_calls.rst b/Documentation/media/uapi/dvb/audio_function_calls.rst
new file mode 100644
index 000000000000..0bb56f0cfed4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio_function_calls.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_function_calls:
4
5********************
6Audio Function Calls
7********************
8
9.. toctree::
10 :maxdepth: 1
11
12 audio-fopen
13 audio-fclose
14 audio-fwrite
15 audio-stop
16 audio-play
17 audio-pause
18 audio-continue
19 audio-select-source
20 audio-set-mute
21 audio-set-av-sync
22 audio-set-bypass-mode
23 audio-channel-select
24 audio-bilingual-channel-select
25 audio-get-pts
26 audio-get-status
27 audio-get-capabilities
28 audio-clear-buffer
29 audio-set-id
30 audio-set-mixer
31 audio-set-streamtype
32 audio-set-ext-id
33 audio-set-attributes
34 audio-set-karaoke
diff --git a/Documentation/media/uapi/dvb/audio_h.rst b/Documentation/media/uapi/dvb/audio_h.rst
new file mode 100644
index 000000000000..e00c3010fdf9
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio_h:
4
5*********************
6DVB Audio Header File
7*********************
8
9.. kernel-include:: $BUILDDIR/audio.h.rst
diff --git a/Documentation/media/uapi/dvb/ca-fclose.rst b/Documentation/media/uapi/dvb/ca-fclose.rst
new file mode 100644
index 000000000000..16d7a1e76193
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-fclose.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ca_fclose:
4
5==============
6DVB CA close()
7==============
8
9Name
10----
11
12DVB CA close()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int close(int fd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35
36Description
37-----------
38
39This system call closes a previously opened audio device.
40
41
42Return Value
43------------
44
45.. flat-table::
46 :header-rows: 0
47 :stub-columns: 0
48
49
50 - .. row 1
51
52 - ``EBADF``
53
54 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/ca-fopen.rst b/Documentation/media/uapi/dvb/ca-fopen.rst
new file mode 100644
index 000000000000..f284461cce20
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-fopen.rst
@@ -0,0 +1,109 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ca_fopen:
4
5=============
6DVB CA open()
7=============
8
9Name
10----
11
12DVB CA open()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int open(const char *deviceName, int flags)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - const char \*deviceName
32
33 - Name of specific video device.
34
35 - .. row 2
36
37 - int flags
38
39 - A bit-wise OR of the following flags:
40
41 - .. row 3
42
43 -
44 - O_RDONLY read-only access
45
46 - .. row 4
47
48 -
49 - O_RDWR read/write access
50
51 - .. row 5
52
53 -
54 - O_NONBLOCK open in non-blocking mode
55
56 - .. row 6
57
58 -
59 - (blocking mode is the default)
60
61
62Description
63-----------
64
65This system call opens a named ca device (e.g. /dev/ost/ca) for
66subsequent use.
67
68When an open() call has succeeded, the device will be ready for use. The
69significance of blocking or non-blocking mode is described in the
70documentation for functions where there is a difference. It does not
71affect the semantics of the open() call itself. A device opened in
72blocking mode can later be put into non-blocking mode (and vice versa)
73using the F_SETFL command of the fcntl system call. This is a standard
74system call, documented in the Linux manual page for fcntl. Only one
75user can open the CA Device in O_RDWR mode. All other attempts to open
76the device in this mode will fail, and an error code will be returned.
77
78
79Return Value
80------------
81
82.. flat-table::
83 :header-rows: 0
84 :stub-columns: 0
85
86
87 - .. row 1
88
89 - ``ENODEV``
90
91 - Device driver not loaded/available.
92
93 - .. row 2
94
95 - ``EINTERNAL``
96
97 - Internal error.
98
99 - .. row 3
100
101 - ``EBUSY``
102
103 - Device or resource busy.
104
105 - .. row 4
106
107 - ``EINVAL``
108
109 - Invalid argument.
diff --git a/Documentation/media/uapi/dvb/ca-get-cap.rst b/Documentation/media/uapi/dvb/ca-get-cap.rst
new file mode 100644
index 000000000000..891fbf2d9a84
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-get-cap.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_GET_CAP:
4
5==========
6CA_GET_CAP
7==========
8
9Name
10----
11
12CA_GET_CAP
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_GET_CAP, ca_caps_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_GET_CAP for this command.
40
41 - .. row 3
42
43 - ca_caps_t *
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-get-descr-info.rst b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
new file mode 100644
index 000000000000..cf8e8242db66
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_GET_DESCR_INFO:
4
5=================
6CA_GET_DESCR_INFO
7=================
8
9Name
10----
11
12CA_GET_DESCR_INFO
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_GET_DESCR_INFO, ca_descr_info_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_GET_DESCR_INFO for this command.
40
41 - .. row 3
42
43 - ca_descr_info_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-get-msg.rst b/Documentation/media/uapi/dvb/ca-get-msg.rst
new file mode 100644
index 000000000000..56004d5ea3ab
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-get-msg.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_GET_MSG:
4
5==========
6CA_GET_MSG
7==========
8
9Name
10----
11
12CA_GET_MSG
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_GET_MSG, ca_msg_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_GET_MSG for this command.
40
41 - .. row 3
42
43 - ca_msg_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-get-slot-info.rst b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
new file mode 100644
index 000000000000..9fea28ccad0f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_GET_SLOT_INFO:
4
5================
6CA_GET_SLOT_INFO
7================
8
9Name
10----
11
12CA_GET_SLOT_INFO
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_GET_SLOT_INFO, ca_slot_info_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_GET_SLOT_INFO for this command.
40
41 - .. row 3
42
43 - ca_slot_info_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-reset.rst b/Documentation/media/uapi/dvb/ca-reset.rst
new file mode 100644
index 000000000000..d5a50088fc2d
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-reset.rst
@@ -0,0 +1,53 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_RESET:
4
5========
6CA_RESET
7========
8
9Name
10----
11
12CA_RESET
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_RESET)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_RESET for this command.
40
41
42Description
43-----------
44
45This ioctl is undocumented. Documentation is welcome.
46
47
48Return Value
49------------
50
51On success 0 is returned, on error -1 and the ``errno`` variable is set
52appropriately. The generic error codes are described at the
53:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-send-msg.rst b/Documentation/media/uapi/dvb/ca-send-msg.rst
new file mode 100644
index 000000000000..18974e61e788
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-send-msg.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_SEND_MSG:
4
5===========
6CA_SEND_MSG
7===========
8
9Name
10----
11
12CA_SEND_MSG
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_SEND_MSG, ca_msg_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_SEND_MSG for this command.
40
41 - .. row 3
42
43 - ca_msg_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-set-descr.rst b/Documentation/media/uapi/dvb/ca-set-descr.rst
new file mode 100644
index 000000000000..293e6da5059f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-set-descr.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_SET_DESCR:
4
5============
6CA_SET_DESCR
7============
8
9Name
10----
11
12CA_SET_DESCR
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_SET_DESCR, ca_descr_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_SET_DESCR for this command.
40
41 - .. row 3
42
43 - ca_descr_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca-set-pid.rst b/Documentation/media/uapi/dvb/ca-set-pid.rst
new file mode 100644
index 000000000000..5afa2fae3206
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca-set-pid.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _CA_SET_PID:
4
5==========
6CA_SET_PID
7==========
8
9Name
10----
11
12CA_SET_PID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = CA_SET_PID, ca_pid_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals CA_SET_PID for this command.
40
41 - .. row 3
42
43 - ca_pid_t \*
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/ca.rst b/Documentation/media/uapi/dvb/ca.rst
new file mode 100644
index 000000000000..14b14abda1ae
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_ca:
4
5#############
6DVB CA Device
7#############
8The DVB CA device controls the conditional access hardware. It can be
9accessed through ``/dev/dvb/adapter?/ca?``. Data types and and ioctl
10definitions can be accessed by including ``linux/dvb/ca.h`` in your
11application.
12
13
14.. toctree::
15 :maxdepth: 1
16
17 ca_data_types
18 ca_function_calls
diff --git a/Documentation/media/uapi/dvb/ca_data_types.rst b/Documentation/media/uapi/dvb/ca_data_types.rst
new file mode 100644
index 000000000000..025f910ae945
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca_data_types.rst
@@ -0,0 +1,110 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ca_data_types:
4
5*************
6CA Data Types
7*************
8
9
10.. _ca-slot-info:
11
12ca_slot_info_t
13==============
14
15
16.. code-block:: c
17
18 typedef struct ca_slot_info {
19 int num; /* slot number */
20
21 int type; /* CA interface this slot supports */
22 #define CA_CI 1 /* CI high level interface */
23 #define CA_CI_LINK 2 /* CI link layer level interface */
24 #define CA_CI_PHYS 4 /* CI physical layer level interface */
25 #define CA_DESCR 8 /* built-in descrambler */
26 #define CA_SC 128 /* simple smart card interface */
27
28 unsigned int flags;
29 #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
30 #define CA_CI_MODULE_READY 2
31 } ca_slot_info_t;
32
33
34.. _ca-descr-info:
35
36ca_descr_info_t
37===============
38
39
40.. code-block:: c
41
42 typedef struct ca_descr_info {
43 unsigned int num; /* number of available descramblers (keys) */
44 unsigned int type; /* type of supported scrambling system */
45 #define CA_ECD 1
46 #define CA_NDS 2
47 #define CA_DSS 4
48 } ca_descr_info_t;
49
50
51.. _ca-caps:
52
53ca_caps_t
54=========
55
56
57.. code-block:: c
58
59 typedef struct ca_caps {
60 unsigned int slot_num; /* total number of CA card and module slots */
61 unsigned int slot_type; /* OR of all supported types */
62 unsigned int descr_num; /* total number of descrambler slots (keys) */
63 unsigned int descr_type;/* OR of all supported types */
64 } ca_cap_t;
65
66
67.. _ca-msg:
68
69ca_msg_t
70========
71
72
73.. code-block:: c
74
75 /* a message to/from a CI-CAM */
76 typedef struct ca_msg {
77 unsigned int index;
78 unsigned int type;
79 unsigned int length;
80 unsigned char msg[256];
81 } ca_msg_t;
82
83
84.. _ca-descr:
85
86ca_descr_t
87==========
88
89
90.. code-block:: c
91
92 typedef struct ca_descr {
93 unsigned int index;
94 unsigned int parity;
95 unsigned char cw[8];
96 } ca_descr_t;
97
98
99.. _ca-pid:
100
101ca-pid
102======
103
104
105.. code-block:: c
106
107 typedef struct ca_pid {
108 unsigned int pid;
109 int index; /* -1 == disable*/
110 } ca_pid_t;
diff --git a/Documentation/media/uapi/dvb/ca_function_calls.rst b/Documentation/media/uapi/dvb/ca_function_calls.rst
new file mode 100644
index 000000000000..c085a0ebbc05
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca_function_calls.rst
@@ -0,0 +1,21 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ca_function_calls:
4
5*****************
6CA Function Calls
7*****************
8
9.. toctree::
10 :maxdepth: 1
11
12 ca-fopen
13 ca-fclose
14 ca-reset
15 ca-get-cap
16 ca-get-slot-info
17 ca-get-descr-info
18 ca-get-msg
19 ca-send-msg
20 ca-set-descr
21 ca-set-pid
diff --git a/Documentation/media/uapi/dvb/ca_h.rst b/Documentation/media/uapi/dvb/ca_h.rst
new file mode 100644
index 000000000000..f513592ef529
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ca_h:
4
5**********************************
6DVB Conditional Access Header File
7**********************************
8
9.. kernel-include:: $BUILDDIR/ca.h.rst
diff --git a/Documentation/media/uapi/dvb/demux.rst b/Documentation/media/uapi/dvb/demux.rst
new file mode 100644
index 000000000000..b12b5a2dac94
--- /dev/null
+++ b/Documentation/media/uapi/dvb/demux.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_demux:
4
5################
6DVB Demux Device
7################
8The DVB demux device controls the filters of the DVB hardware/software.
9It can be accessed through ``/dev/adapter?/demux?``. Data types and and
10ioctl definitions can be accessed by including ``linux/dvb/dmx.h`` in
11your application.
12
13
14.. toctree::
15 :maxdepth: 1
16
17 dmx_types
18 dmx_fcalls
diff --git a/Documentation/media/uapi/dvb/dmx-add-pid.rst b/Documentation/media/uapi/dvb/dmx-add-pid.rst
new file mode 100644
index 000000000000..6343035653ac
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-add-pid.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_ADD_PID:
4
5===========
6DMX_ADD_PID
7===========
8
9Name
10----
11
12DMX_ADD_PID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = DMX_ADD_PID, __u16 *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_ADD_PID for this command.
40
41 - .. row 3
42
43 - __u16 *
44
45 - PID number to be filtered.
46
47
48Description
49-----------
50
51This ioctl call allows to add multiple PIDs to a transport stream filter
52previously set up with DMX_SET_PES_FILTER and output equal to
53DMX_OUT_TSDEMUX_TAP.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-fclose.rst b/Documentation/media/uapi/dvb/dmx-fclose.rst
new file mode 100644
index 000000000000..f54c2a1220c1
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-fclose.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fclose:
4
5=================
6DVB demux close()
7=================
8
9Name
10----
11
12DVB demux close()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int close(int fd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35
36Description
37-----------
38
39This system call deactivates and deallocates a filter that was
40previously allocated via the open() call.
41
42
43Return Value
44------------
45
46.. flat-table::
47 :header-rows: 0
48 :stub-columns: 0
49
50
51 - .. row 1
52
53 - ``EBADF``
54
55 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/dmx-fopen.rst b/Documentation/media/uapi/dvb/dmx-fopen.rst
new file mode 100644
index 000000000000..76dbb42713ad
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-fopen.rst
@@ -0,0 +1,108 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fopen:
4
5================
6DVB demux open()
7================
8
9Name
10----
11
12DVB demux open()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int open(const char *deviceName, int flags)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - const char \*deviceName
32
33 - Name of demux device.
34
35 - .. row 2
36
37 - int flags
38
39 - A bit-wise OR of the following flags:
40
41 - .. row 3
42
43 -
44 - O_RDWR read/write access
45
46 - .. row 4
47
48 -
49 - O_NONBLOCK open in non-blocking mode
50
51 - .. row 5
52
53 -
54 - (blocking mode is the default)
55
56
57Description
58-----------
59
60This system call, used with a device name of /dev/dvb/adapter0/demux0,
61allocates a new filter and returns a handle which can be used for
62subsequent control of that filter. This call has to be made for each
63filter to be used, i.e. every returned file descriptor is a reference to
64a single filter. /dev/dvb/adapter0/dvr0 is a logical device to be used
65for retrieving Transport Streams for digital video recording. When
66reading from this device a transport stream containing the packets from
67all PES filters set in the corresponding demux device
68(/dev/dvb/adapter0/demux0) having the output set to DMX_OUT_TS_TAP. A
69recorded Transport Stream is replayed by writing to this device.
70
71The significance of blocking or non-blocking mode is described in the
72documentation for functions where there is a difference. It does not
73affect the semantics of the open() call itself. A device opened in
74blocking mode can later be put into non-blocking mode (and vice versa)
75using the F_SETFL command of the fcntl system call.
76
77
78Return Value
79------------
80
81.. flat-table::
82 :header-rows: 0
83 :stub-columns: 0
84
85
86 - .. row 1
87
88 - ``ENODEV``
89
90 - Device driver not loaded/available.
91
92 - .. row 2
93
94 - ``EINVAL``
95
96 - Invalid argument.
97
98 - .. row 3
99
100 - ``EMFILE``
101
102 - “Too many open files”, i.e. no more filters available.
103
104 - .. row 4
105
106 - ``ENOMEM``
107
108 - The driver failed to allocate enough memory.
diff --git a/Documentation/media/uapi/dvb/dmx-fread.rst b/Documentation/media/uapi/dvb/dmx-fread.rst
new file mode 100644
index 000000000000..d25b19e4f696
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-fread.rst
@@ -0,0 +1,108 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fread:
4
5================
6DVB demux read()
7================
8
9Name
10----
11
12DVB demux read()
13
14
15Synopsis
16--------
17
18.. cpp:function:: size_t read(int fd, void *buf, size_t count)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - void \*buf
38
39 - Pointer to the buffer to be used for returned filtered data.
40
41 - .. row 3
42
43 - size_t count
44
45 - Size of buf.
46
47
48Description
49-----------
50
51This system call returns filtered data, which might be section or PES
52data. The filtered data is transferred from the driver’s internal
53circular buffer to buf. The maximum amount of data to be transferred is
54implied by count.
55
56
57Return Value
58------------
59
60.. flat-table::
61 :header-rows: 0
62 :stub-columns: 0
63
64
65 - .. row 1
66
67 - ``EWOULDBLOCK``
68
69 - No data to return and O_NONBLOCK was specified.
70
71 - .. row 2
72
73 - ``EBADF``
74
75 - fd is not a valid open file descriptor.
76
77 - .. row 3
78
79 - ``ECRC``
80
81 - Last section had a CRC error - no data returned. The buffer is
82 flushed.
83
84 - .. row 4
85
86 - ``EOVERFLOW``
87
88 -
89
90 - .. row 5
91
92 -
93 - The filtered data was not read from the buffer in due time,
94 resulting in non-read data being lost. The buffer is flushed.
95
96 - .. row 6
97
98 - ``ETIMEDOUT``
99
100 - The section was not loaded within the stated timeout period. See
101 ioctl DMX_SET_FILTER for how to set a timeout.
102
103 - .. row 7
104
105 - ``EFAULT``
106
107 - The driver failed to write to the callers buffer due to an invalid
108 \*buf pointer.
diff --git a/Documentation/media/uapi/dvb/dmx-fwrite.rst b/Documentation/media/uapi/dvb/dmx-fwrite.rst
new file mode 100644
index 000000000000..9efd81a1b5c8
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-fwrite.rst
@@ -0,0 +1,89 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fwrite:
4
5=================
6DVB demux write()
7=================
8
9Name
10----
11
12DVB demux write()
13
14
15Synopsis
16--------
17
18.. cpp:function:: ssize_t write(int fd, const void *buf, size_t count)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - void \*buf
38
39 - Pointer to the buffer containing the Transport Stream.
40
41 - .. row 3
42
43 - size_t count
44
45 - Size of buf.
46
47
48Description
49-----------
50
51This system call is only provided by the logical device
52/dev/dvb/adapter0/dvr0, associated with the physical demux device that
53provides the actual DVR functionality. It is used for replay of a
54digitally recorded Transport Stream. Matching filters have to be defined
55in the corresponding physical demux device, /dev/dvb/adapter0/demux0.
56The amount of data to be transferred is implied by count.
57
58
59Return Value
60------------
61
62.. flat-table::
63 :header-rows: 0
64 :stub-columns: 0
65
66
67 - .. row 1
68
69 - ``EWOULDBLOCK``
70
71 - No data was written. This might happen if O_NONBLOCK was
72 specified and there is no more buffer space available (if
73 O_NONBLOCK is not specified the function will block until buffer
74 space is available).
75
76 - .. row 2
77
78 - ``EBUSY``
79
80 - This error code indicates that there are conflicting requests. The
81 corresponding demux device is setup to receive data from the
82 front- end. Make sure that these filters are stopped and that the
83 filters with input set to DMX_IN_DVR are started.
84
85 - .. row 3
86
87 - ``EBADF``
88
89 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/dmx-get-caps.rst b/Documentation/media/uapi/dvb/dmx-get-caps.rst
new file mode 100644
index 000000000000..d0549eb7fbd3
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-get-caps.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_GET_CAPS:
4
5============
6DMX_GET_CAPS
7============
8
9Name
10----
11
12DMX_GET_CAPS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = DMX_GET_CAPS, dmx_caps_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_GET_CAPS for this command.
40
41 - .. row 3
42
43 - dmx_caps_t *
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-get-event.rst b/Documentation/media/uapi/dvb/dmx-get-event.rst
new file mode 100644
index 000000000000..6a7550c63bb5
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-get-event.rst
@@ -0,0 +1,76 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_GET_EVENT:
4
5=============
6DMX_GET_EVENT
7=============
8
9Name
10----
11
12DMX_GET_EVENT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_GET_EVENT, struct dmx_event *ev)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_GET_EVENT for this command.
40
41 - .. row 3
42
43 - struct dmx_event \*ev
44
45 - Pointer to the location where the event is to be stored.
46
47
48Description
49-----------
50
51This ioctl call returns an event if available. If an event is not
52available, the behavior depends on whether the device is in blocking or
53non-blocking mode. In the latter case, the call fails immediately with
54errno set to ``EWOULDBLOCK``. In the former case, the call blocks until an
55event becomes available.
56
57
58Return Value
59------------
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
64
65
66
67.. flat-table::
68 :header-rows: 0
69 :stub-columns: 0
70
71
72 - .. row 1
73
74 - ``EWOULDBLOCK``
75
76 - There is no event pending, and the device is in non-blocking mode.
diff --git a/Documentation/media/uapi/dvb/dmx-get-pes-pids.rst b/Documentation/media/uapi/dvb/dmx-get-pes-pids.rst
new file mode 100644
index 000000000000..ba5d30c913c8
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-get-pes-pids.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_GET_PES_PIDS:
4
5================
6DMX_GET_PES_PIDS
7================
8
9Name
10----
11
12DMX_GET_PES_PIDS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = DMX_GET_PES_PIDS, __u16[5])
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_GET_PES_PIDS for this command.
40
41 - .. row 3
42
43 - __u16[5]
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-get-stc.rst b/Documentation/media/uapi/dvb/dmx-get-stc.rst
new file mode 100644
index 000000000000..bd477bb67082
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-get-stc.rst
@@ -0,0 +1,77 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_GET_STC:
4
5===========
6DMX_GET_STC
7===========
8
9Name
10----
11
12DMX_GET_STC
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_GET_STC, struct dmx_stc *stc)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_GET_STC for this command.
40
41 - .. row 3
42
43 - struct dmx_stc \*stc
44
45 - Pointer to the location where the stc is to be stored.
46
47
48Description
49-----------
50
51This ioctl call returns the current value of the system time counter
52(which is driven by a PES filter of type DMX_PES_PCR). Some hardware
53supports more than one STC, so you must specify which one by setting the
54num field of stc before the ioctl (range 0...n). The result is returned
55in form of a ratio with a 64 bit numerator and a 32 bit denominator, so
56the real 90kHz STC value is stc->stc / stc->base .
57
58
59Return Value
60------------
61
62On success 0 is returned, on error -1 and the ``errno`` variable is set
63appropriately. The generic error codes are described at the
64:ref:`Generic Error Codes <gen-errors>` chapter.
65
66
67
68.. flat-table::
69 :header-rows: 0
70 :stub-columns: 0
71
72
73 - .. row 1
74
75 - ``EINVAL``
76
77 - Invalid stc number.
diff --git a/Documentation/media/uapi/dvb/dmx-remove-pid.rst b/Documentation/media/uapi/dvb/dmx-remove-pid.rst
new file mode 100644
index 000000000000..c8f038b40074
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-remove-pid.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_REMOVE_PID:
4
5==============
6DMX_REMOVE_PID
7==============
8
9Name
10----
11
12DMX_REMOVE_PID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = DMX_REMOVE_PID, __u16 *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_REMOVE_PID for this command.
40
41 - .. row 3
42
43 - __u16 *
44
45 - PID of the PES filter to be removed.
46
47
48Description
49-----------
50
51This ioctl call allows to remove a PID when multiple PIDs are set on a
52transport stream filter, e. g. a filter previously set up with output
53equal to DMX_OUT_TSDEMUX_TAP, created via either
54DMX_SET_PES_FILTER or DMX_ADD_PID.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-set-buffer-size.rst b/Documentation/media/uapi/dvb/dmx-set-buffer-size.rst
new file mode 100644
index 000000000000..8ae48cf39cda
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-set-buffer-size.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_SET_BUFFER_SIZE:
4
5===================
6DMX_SET_BUFFER_SIZE
7===================
8
9Name
10----
11
12DMX_SET_BUFFER_SIZE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_SET_BUFFER_SIZE, unsigned long size)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_SET_BUFFER_SIZE for this command.
40
41 - .. row 3
42
43 - unsigned long size
44
45 - Size of circular buffer.
46
47
48Description
49-----------
50
51This ioctl call is used to set the size of the circular buffer used for
52filtered data. The default size is two maximum sized sections, i.e. if
53this function is not called a buffer size of 2 \* 4096 bytes will be
54used.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-set-filter.rst b/Documentation/media/uapi/dvb/dmx-set-filter.rst
new file mode 100644
index 000000000000..8c929fa9b98c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-set-filter.rst
@@ -0,0 +1,68 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_SET_FILTER:
4
5==============
6DMX_SET_FILTER
7==============
8
9Name
10----
11
12DMX_SET_FILTER
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_SET_FILTER, struct dmx_sct_filter_params *params)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_SET_FILTER for this command.
40
41 - .. row 3
42
43 - struct dmx_sct_filter_params \*params
44
45 - Pointer to structure containing filter parameters.
46
47
48Description
49-----------
50
51This ioctl call sets up a filter according to the filter and mask
52parameters provided. A timeout may be defined stating number of seconds
53to wait for a section to be loaded. A value of 0 means that no timeout
54should be applied. Finally there is a flag field where it is possible to
55state whether a section should be CRC-checked, whether the filter should
56be a ”one-shot” filter, i.e. if the filtering operation should be
57stopped after the first section is received, and whether the filtering
58operation should be started immediately (without waiting for a
59DMX_START ioctl call). If a filter was previously set-up, this filter
60will be canceled, and the receive buffer will be flushed.
61
62
63Return Value
64------------
65
66On success 0 is returned, on error -1 and the ``errno`` variable is set
67appropriately. The generic error codes are described at the
68:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst b/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst
new file mode 100644
index 000000000000..addc321011ce
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst
@@ -0,0 +1,78 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_SET_PES_FILTER:
4
5==================
6DMX_SET_PES_FILTER
7==================
8
9Name
10----
11
12DMX_SET_PES_FILTER
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_SET_PES_FILTER, struct dmx_pes_filter_params *params)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_SET_PES_FILTER for this command.
40
41 - .. row 3
42
43 - struct dmx_pes_filter_params \*params
44
45 - Pointer to structure containing filter parameters.
46
47
48Description
49-----------
50
51This ioctl call sets up a PES filter according to the parameters
52provided. By a PES filter is meant a filter that is based just on the
53packet identifier (PID), i.e. no PES header or payload filtering
54capability is supported.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
63
64
65
66.. flat-table::
67 :header-rows: 0
68 :stub-columns: 0
69
70
71 - .. row 1
72
73 - ``EBUSY``
74
75 - This error code indicates that there are conflicting requests.
76 There are active filters filtering data from another input source.
77 Make sure that these filters are stopped before starting this
78 filter.
diff --git a/Documentation/media/uapi/dvb/dmx-set-source.rst b/Documentation/media/uapi/dvb/dmx-set-source.rst
new file mode 100644
index 000000000000..99a8d5c82756
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-set-source.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_SET_SOURCE:
4
5==============
6DMX_SET_SOURCE
7==============
8
9Name
10----
11
12DMX_SET_SOURCE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = DMX_SET_SOURCE, dmx_source_t *)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_SET_SOURCE for this command.
40
41 - .. row 3
42
43 - dmx_source_t *
44
45 - Undocumented.
46
47
48Description
49-----------
50
51This ioctl is undocumented. Documentation is welcome.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx-start.rst b/Documentation/media/uapi/dvb/dmx-start.rst
new file mode 100644
index 000000000000..9835d1e78400
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-start.rst
@@ -0,0 +1,77 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_START:
4
5=========
6DMX_START
7=========
8
9Name
10----
11
12DMX_START
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_START)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_START for this command.
40
41
42Description
43-----------
44
45This ioctl call is used to start the actual filtering operation defined
46via the ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
55
56
57
58.. flat-table::
59 :header-rows: 0
60 :stub-columns: 0
61
62
63 - .. row 1
64
65 - ``EINVAL``
66
67 - Invalid argument, i.e. no filtering parameters provided via the
68 DMX_SET_FILTER or DMX_SET_PES_FILTER functions.
69
70 - .. row 2
71
72 - ``EBUSY``
73
74 - This error code indicates that there are conflicting requests.
75 There are active filters filtering data from another input source.
76 Make sure that these filters are stopped before starting this
77 filter.
diff --git a/Documentation/media/uapi/dvb/dmx-stop.rst b/Documentation/media/uapi/dvb/dmx-stop.rst
new file mode 100644
index 000000000000..7e4bf09fc83e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx-stop.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _DMX_STOP:
4
5========
6DMX_STOP
7========
8
9Name
10----
11
12DMX_STOP
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl( int fd, int request = DMX_STOP)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals DMX_STOP for this command.
40
41
42Description
43-----------
44
45This ioctl call is used to stop the actual filtering operation defined
46via the ioctl calls DMX_SET_FILTER or DMX_SET_PES_FILTER and
47started via the DMX_START command.
48
49
50Return Value
51------------
52
53On success 0 is returned, on error -1 and the ``errno`` variable is set
54appropriately. The generic error codes are described at the
55:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/dmx_fcalls.rst b/Documentation/media/uapi/dvb/dmx_fcalls.rst
new file mode 100644
index 000000000000..77a1554d9834
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx_fcalls.rst
@@ -0,0 +1,27 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_fcalls:
4
5********************
6Demux Function Calls
7********************
8
9.. toctree::
10 :maxdepth: 1
11
12 dmx-fopen
13 dmx-fclose
14 dmx-fread
15 dmx-fwrite
16 dmx-start
17 dmx-stop
18 dmx-set-filter
19 dmx-set-pes-filter
20 dmx-set-buffer-size
21 dmx-get-event
22 dmx-get-stc
23 dmx-get-pes-pids
24 dmx-get-caps
25 dmx-set-source
26 dmx-add-pid
27 dmx-remove-pid
diff --git a/Documentation/media/uapi/dvb/dmx_h.rst b/Documentation/media/uapi/dvb/dmx_h.rst
new file mode 100644
index 000000000000..4fd1704a0833
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_h:
4
5*********************
6DVB Demux Header File
7*********************
8
9.. kernel-include:: $BUILDDIR/dmx.h.rst
diff --git a/Documentation/media/uapi/dvb/dmx_types.rst b/Documentation/media/uapi/dvb/dmx_types.rst
new file mode 100644
index 000000000000..7a8900af2680
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx_types.rst
@@ -0,0 +1,242 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmx_types:
4
5****************
6Demux Data Types
7****************
8
9
10.. _dmx-output-t:
11
12Output for the demux
13====================
14
15
16.. _dmx-output:
17
18.. flat-table:: enum dmx_output
19 :header-rows: 1
20 :stub-columns: 0
21
22
23 - .. row 1
24
25 - ID
26
27 - Description
28
29 - .. row 2
30
31 - .. _DMX-OUT-DECODER:
32
33 DMX_OUT_DECODER
34
35 - Streaming directly to decoder.
36
37 - .. row 3
38
39 - .. _DMX-OUT-TAP:
40
41 DMX_OUT_TAP
42
43 - Output going to a memory buffer (to be retrieved via the read
44 command). Delivers the stream output to the demux device on which
45 the ioctl is called.
46
47 - .. row 4
48
49 - .. _DMX-OUT-TS-TAP:
50
51 DMX_OUT_TS_TAP
52
53 - Output multiplexed into a new TS (to be retrieved by reading from
54 the logical DVR device). Routes output to the logical DVR device
55 ``/dev/dvb/adapter?/dvr?``, which delivers a TS multiplexed from
56 all filters for which ``DMX_OUT_TS_TAP`` was specified.
57
58 - .. row 5
59
60 - .. _DMX-OUT-TSDEMUX-TAP:
61
62 DMX_OUT_TSDEMUX_TAP
63
64 - Like :ref:`DMX_OUT_TS_TAP <DMX-OUT-TS-TAP>` but retrieved
65 from the DMX device.
66
67
68
69.. _dmx-input-t:
70
71dmx_input_t
72===========
73
74
75.. code-block:: c
76
77 typedef enum
78 {
79 DMX_IN_FRONTEND, /* Input from a front-end device. */
80 DMX_IN_DVR /* Input from the logical DVR device. */
81 } dmx_input_t;
82
83
84.. _dmx-pes-type-t:
85
86dmx_pes_type_t
87==============
88
89
90.. code-block:: c
91
92 typedef enum
93 {
94 DMX_PES_AUDIO0,
95 DMX_PES_VIDEO0,
96 DMX_PES_TELETEXT0,
97 DMX_PES_SUBTITLE0,
98 DMX_PES_PCR0,
99
100 DMX_PES_AUDIO1,
101 DMX_PES_VIDEO1,
102 DMX_PES_TELETEXT1,
103 DMX_PES_SUBTITLE1,
104 DMX_PES_PCR1,
105
106 DMX_PES_AUDIO2,
107 DMX_PES_VIDEO2,
108 DMX_PES_TELETEXT2,
109 DMX_PES_SUBTITLE2,
110 DMX_PES_PCR2,
111
112 DMX_PES_AUDIO3,
113 DMX_PES_VIDEO3,
114 DMX_PES_TELETEXT3,
115 DMX_PES_SUBTITLE3,
116 DMX_PES_PCR3,
117
118 DMX_PES_OTHER
119 } dmx_pes_type_t;
120
121
122.. _dmx-filter:
123
124struct dmx_filter
125=================
126
127
128.. code-block:: c
129
130 typedef struct dmx_filter
131 {
132 __u8 filter[DMX_FILTER_SIZE];
133 __u8 mask[DMX_FILTER_SIZE];
134 __u8 mode[DMX_FILTER_SIZE];
135 } dmx_filter_t;
136
137
138.. _dmx-sct-filter-params:
139
140struct dmx_sct_filter_params
141============================
142
143
144.. code-block:: c
145
146 struct dmx_sct_filter_params
147 {
148 __u16 pid;
149 dmx_filter_t filter;
150 __u32 timeout;
151 __u32 flags;
152 #define DMX_CHECK_CRC 1
153 #define DMX_ONESHOT 2
154 #define DMX_IMMEDIATE_START 4
155 #define DMX_KERNEL_CLIENT 0x8000
156 };
157
158
159.. _dmx-pes-filter-params:
160
161struct dmx_pes_filter_params
162============================
163
164
165.. code-block:: c
166
167 struct dmx_pes_filter_params
168 {
169 __u16 pid;
170 dmx_input_t input;
171 dmx_output_t output;
172 dmx_pes_type_t pes_type;
173 __u32 flags;
174 };
175
176
177.. _dmx-event:
178
179struct dmx_event
180================
181
182
183.. code-block:: c
184
185 struct dmx_event
186 {
187 dmx_event_t event;
188 time_t timeStamp;
189 union
190 {
191 dmx_scrambling_status_t scrambling;
192 } u;
193 };
194
195
196.. _dmx-stc:
197
198struct dmx_stc
199==============
200
201
202.. code-block:: c
203
204 struct dmx_stc {
205 unsigned int num; /* input : which STC? 0..N */
206 unsigned int base; /* output: divisor for stc to get 90 kHz clock */
207 __u64 stc; /* output: stc in 'base'*90 kHz units */
208 };
209
210
211.. _dmx-caps:
212
213struct dmx_caps
214===============
215
216
217.. code-block:: c
218
219 typedef struct dmx_caps {
220 __u32 caps;
221 int num_decoders;
222 } dmx_caps_t;
223
224
225.. _dmx-source-t:
226
227enum dmx_source_t
228=================
229
230
231.. code-block:: c
232
233 typedef enum {
234 DMX_SOURCE_FRONT0 = 0,
235 DMX_SOURCE_FRONT1,
236 DMX_SOURCE_FRONT2,
237 DMX_SOURCE_FRONT3,
238 DMX_SOURCE_DVR0 = 16,
239 DMX_SOURCE_DVR1,
240 DMX_SOURCE_DVR2,
241 DMX_SOURCE_DVR3
242 } dmx_source_t;
diff --git a/Documentation/media/uapi/dvb/dtv-fe-stats.rst b/Documentation/media/uapi/dvb/dtv-fe-stats.rst
new file mode 100644
index 000000000000..7c105e2ab27e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dtv-fe-stats.rst
@@ -0,0 +1,17 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dtv-fe-stats:
4
5*******************
6struct dtv_fe_stats
7*******************
8
9
10.. code-block:: c
11
12 #define MAX_DTV_STATS 4
13
14 struct dtv_fe_stats {
15 __u8 len;
16 struct dtv_stats stat[MAX_DTV_STATS];
17 } __packed;
diff --git a/Documentation/media/uapi/dvb/dtv-properties.rst b/Documentation/media/uapi/dvb/dtv-properties.rst
new file mode 100644
index 000000000000..c13be5de4302
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dtv-properties.rst
@@ -0,0 +1,15 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dtv-properties:
4
5*********************
6struct dtv_properties
7*********************
8
9
10.. code-block:: c
11
12 struct dtv_properties {
13 __u32 num;
14 struct dtv_property *props;
15 };
diff --git a/Documentation/media/uapi/dvb/dtv-property.rst b/Documentation/media/uapi/dvb/dtv-property.rst
new file mode 100644
index 000000000000..5073a49def2a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dtv-property.rst
@@ -0,0 +1,31 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dtv-property:
4
5*******************
6struct dtv_property
7*******************
8
9
10.. code-block:: c
11
12 /* Reserved fields should be set to 0 */
13
14 struct dtv_property {
15 __u32 cmd;
16 __u32 reserved[3];
17 union {
18 __u32 data;
19 struct dtv_fe_stats st;
20 struct {
21 __u8 data[32];
22 __u32 len;
23 __u32 reserved1[3];
24 void *reserved2;
25 } buffer;
26 } u;
27 int result;
28 } __attribute__ ((packed));
29
30 /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
31 #define DTV_IOCTL_MAX_MSGS 64
diff --git a/Documentation/media/uapi/dvb/dtv-stats.rst b/Documentation/media/uapi/dvb/dtv-stats.rst
new file mode 100644
index 000000000000..2cfdca00f164
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dtv-stats.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dtv-stats:
4
5****************
6struct dtv_stats
7****************
8
9
10.. code-block:: c
11
12 struct dtv_stats {
13 __u8 scale; /* enum fecap_scale_params type */
14 union {
15 __u64 uvalue; /* for counters and relative scales */
16 __s64 svalue; /* for 1/1000 dB measures */
17 };
18 } __packed;
diff --git a/Documentation/media/uapi/dvb/dvb-fe-read-status.rst b/Documentation/media/uapi/dvb/dvb-fe-read-status.rst
new file mode 100644
index 000000000000..fcffaa7e1463
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvb-fe-read-status.rst
@@ -0,0 +1,23 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb-fe-read-status:
4
5***************************************
6Querying frontend status and statistics
7***************************************
8
9Once :ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` is called, the
10frontend will run a kernel thread that will periodically check for the
11tuner lock status and provide statistics about the quality of the
12signal.
13
14The information about the frontend tuner locking status can be queried
15using :ref:`FE_READ_STATUS`.
16
17Signal statistics are provided via
18:ref:`FE_GET_PROPERTY`.
19
20.. note:: Most statistics require the demodulator to be fully locked
21 (e. g. with FE_HAS_LOCK bit set). See
22 :ref:`Frontend statistics indicators <frontend-stat-properties>` for
23 more details.
diff --git a/Documentation/media/uapi/dvb/dvb-frontend-event.rst b/Documentation/media/uapi/dvb/dvb-frontend-event.rst
new file mode 100644
index 000000000000..78e72feaa178
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvb-frontend-event.rst
@@ -0,0 +1,15 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb-frontend-event:
4
5***************
6frontend events
7***************
8
9
10.. code-block:: c
11
12 struct dvb_frontend_event {
13 fe_status_t status;
14 struct dvb_frontend_parameters parameters;
15 };
diff --git a/Documentation/media/uapi/dvb/dvb-frontend-parameters.rst b/Documentation/media/uapi/dvb/dvb-frontend-parameters.rst
new file mode 100644
index 000000000000..16cb581d5cff
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvb-frontend-parameters.rst
@@ -0,0 +1,119 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb-frontend-parameters:
4
5*******************
6frontend parameters
7*******************
8
9The kind of parameters passed to the frontend device for tuning depend
10on the kind of hardware you are using.
11
12The struct ``dvb_frontend_parameters`` uses an union with specific
13per-system parameters. However, as newer delivery systems required more
14data, the structure size weren't enough to fit, and just extending its
15size would break the existing applications. So, those parameters were
16replaced by the usage of
17:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
18ioctl's. The new API is flexible enough to add new parameters to
19existing delivery systems, and to add newer delivery systems.
20
21So, newer applications should use
22:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
23instead, in order to be able to support the newer System Delivery like
24DVB-S2, DVB-T2, DVB-C2, ISDB, etc.
25
26All kinds of parameters are combined as an union in the
27FrontendParameters structure:
28
29
30.. code-block:: c
31
32 struct dvb_frontend_parameters {
33 uint32_t frequency; /* (absolute) frequency in Hz for QAM/OFDM */
34 /* intermediate frequency in kHz for QPSK */
35 fe_spectral_inversion_t inversion;
36 union {
37 struct dvb_qpsk_parameters qpsk;
38 struct dvb_qam_parameters qam;
39 struct dvb_ofdm_parameters ofdm;
40 struct dvb_vsb_parameters vsb;
41 } u;
42 };
43
44In the case of QPSK frontends the ``frequency`` field specifies the
45intermediate frequency, i.e. the offset which is effectively added to
46the local oscillator frequency (LOF) of the LNB. The intermediate
47frequency has to be specified in units of kHz. For QAM and OFDM
48frontends the ``frequency`` specifies the absolute frequency and is
49given in Hz.
50
51
52.. _dvb-qpsk-parameters:
53
54QPSK parameters
55===============
56
57For satellite QPSK frontends you have to use the ``dvb_qpsk_parameters``
58structure:
59
60
61.. code-block:: c
62
63 struct dvb_qpsk_parameters {
64 uint32_t symbol_rate; /* symbol rate in Symbols per second */
65 fe_code_rate_t fec_inner; /* forward error correction (see above) */
66 };
67
68
69.. _dvb-qam-parameters:
70
71QAM parameters
72==============
73
74for cable QAM frontend you use the ``dvb_qam_parameters`` structure:
75
76
77.. code-block:: c
78
79 struct dvb_qam_parameters {
80 uint32_t symbol_rate; /* symbol rate in Symbols per second */
81 fe_code_rate_t fec_inner; /* forward error correction (see above) */
82 fe_modulation_t modulation; /* modulation type (see above) */
83 };
84
85
86.. _dvb-vsb-parameters:
87
88VSB parameters
89==============
90
91ATSC frontends are supported by the ``dvb_vsb_parameters`` structure:
92
93
94.. code-block:: c
95
96 struct dvb_vsb_parameters {
97 fe_modulation_t modulation; /* modulation type (see above) */
98 };
99
100
101.. _dvb-ofdm-parameters:
102
103OFDM parameters
104===============
105
106DVB-T frontends are supported by the ``dvb_ofdm_parameters`` structure:
107
108
109.. code-block:: c
110
111 struct dvb_ofdm_parameters {
112 fe_bandwidth_t bandwidth;
113 fe_code_rate_t code_rate_HP; /* high priority stream code rate */
114 fe_code_rate_t code_rate_LP; /* low priority stream code rate */
115 fe_modulation_t constellation; /* modulation type (see above) */
116 fe_transmit_mode_t transmission_mode;
117 fe_guard_interval_t guard_interval;
118 fe_hierarchy_t hierarchy_information;
119 };
diff --git a/Documentation/media/uapi/dvb/dvbapi.rst b/Documentation/media/uapi/dvb/dvbapi.rst
new file mode 100644
index 000000000000..48e61aba741e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvbapi.rst
@@ -0,0 +1,102 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5.. _dvbapi:
6
7########################
8Part II - Digital TV API
9########################
10
11.. note:: This API is also known as **DVB API**, although it is generic
12 enough to support all digital TV standards.
13
14**Version 5.10**
15
16.. class:: toc-title
17
18 Table of Contents
19
20.. toctree::
21 :maxdepth: 5
22 :numbered:
23
24 intro
25 frontend
26 demux
27 ca
28 net
29 legacy_dvb_apis
30 examples
31 audio_h
32 ca_h
33 dmx_h
34 frontend_h
35 net_h
36 video_h
37
38
39**********************
40Revision and Copyright
41**********************
42
43Authors:
44
45- J. K. Metzler, Ralph <rjkm@metzlerbros.de>
46
47 - Original author of the DVB API documentation.
48
49- O. C. Metzler, Marcus <rjkm@metzlerbros.de>
50
51 - Original author of the DVB API documentation.
52
53- Carvalho Chehab, Mauro <m.chehab@kernel.org>
54
55 - Ported document to Docbook XML, addition of DVBv5 API, documentation gaps fix.
56
57**Copyright** |copy| 2002-2003 : Convergence GmbH
58
59**Copyright** |copy| 2009-2016 : Mauro Carvalho Chehab
60
61****************
62Revision History
63****************
64
65:revision: 2.1.0 / 2015-05-29 (*mcc*)
66
67DocBook improvements and cleanups, in order to document the system calls
68on a more standard way and provide more description about the current
69DVB API.
70
71:revision: 2.0.4 / 2011-05-06 (*mcc*)
72
73Add more information about DVB APIv5, better describing the frontend
74GET/SET props ioctl's.
75
76
77:revision: 2.0.3 / 2010-07-03 (*mcc*)
78
79Add some frontend capabilities flags, present on kernel, but missing at
80the specs.
81
82
83:revision: 2.0.2 / 2009-10-25 (*mcc*)
84
85documents FE_SET_FRONTEND_TUNE_MODE and
86FE_DISHETWORK_SEND_LEGACY_CMD ioctls.
87
88
89:revision: 2.0.1 / 2009-09-16 (*mcc*)
90
91Added ISDB-T test originally written by Patrick Boettcher
92
93
94:revision: 2.0.0 / 2009-09-06 (*mcc*)
95
96Conversion from LaTex to DocBook XML. The contents is the same as the
97original LaTex version.
98
99
100:revision: 1.0.0 / 2003-07-24 (*rjkm*)
101
102Initial revision on LaTEX.
diff --git a/Documentation/media/uapi/dvb/dvbproperty-006.rst b/Documentation/media/uapi/dvb/dvbproperty-006.rst
new file mode 100644
index 000000000000..3343a0f306fe
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvbproperty-006.rst
@@ -0,0 +1,12 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3**************
4Property types
5**************
6
7On :ref:`FE_GET_PROPERTY and FE_SET_PROPERTY <FE_GET_PROPERTY>`,
8the actual action is determined by the dtv_property cmd/data pairs.
9With one single ioctl, is possible to get/set up to 64 properties. The
10actual meaning of each property is described on the next sections.
11
12The available frontend property types are shown on the next section.
diff --git a/Documentation/media/uapi/dvb/dvbproperty.rst b/Documentation/media/uapi/dvb/dvbproperty.rst
new file mode 100644
index 000000000000..cd0511b06c2c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dvbproperty.rst
@@ -0,0 +1,116 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend-properties:
4
5DVB Frontend properties
6=======================
7
8Tuning into a Digital TV physical channel and starting decoding it
9requires changing a set of parameters, in order to control the tuner,
10the demodulator, the Linear Low-noise Amplifier (LNA) and to set the
11antenna subsystem via Satellite Equipment Control (SEC), on satellite
12systems. The actual parameters are specific to each particular digital
13TV standards, and may change as the digital TV specs evolves.
14
15In the past, the strategy used was to have a union with the parameters
16needed to tune for DVB-S, DVB-C, DVB-T and ATSC delivery systems grouped
17there. The problem is that, as the second generation standards appeared,
18those structs were not big enough to contain the additional parameters.
19Also, the union didn't have any space left to be expanded without
20breaking userspace. So, the decision was to deprecate the legacy
21union/struct based approach, in favor of a properties set approach.
22
23.. note:: On Linux DVB API version 3, setting a frontend were done via
24 :ref:`struct dvb_frontend_parameters <dvb-frontend-parameters>`.
25 This got replaced on version 5 (also called "S2API", as this API were
26 added originally_enabled to provide support for DVB-S2), because the
27 old API has a very limited support to new standards and new hardware.
28 This section describes the new and recommended way to set the frontend,
29 with suppports all digital TV delivery systems.
30
31Example: with the properties based approach, in order to set the tuner
32to a DVB-C channel at 651 kHz, modulated with 256-QAM, FEC 3/4 and
33symbol rate of 5.217 Mbauds, those properties should be sent to
34:ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` ioctl:
35
36- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` =
37 SYS_DVBC_ANNEX_A
38
39- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>` = 651000000
40
41- :ref:`DTV_MODULATION <DTV-MODULATION>` = QAM_256
42
43- :ref:`DTV_INVERSION <DTV-INVERSION>` = INVERSION_AUTO
44
45- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>` = 5217000
46
47- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>` = FEC_3_4
48
49- :ref:`DTV_TUNE <DTV-TUNE>`
50
51The code that would that would do the above is show in
52:ref:`dtv-prop-example`.
53
54.. _dtv-prop-example:
55
56Example: Setting digital TV frontend properties
57===============================================
58
59.. code-block:: c
60
61 #include <stdio.h>
62 #include <fcntl.h>
63 #include <sys/ioctl.h>
64 #include <linux/dvb/frontend.h>
65
66 static struct dtv_property props[] = {
67 { .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A },
68 { .cmd = DTV_FREQUENCY, .u.data = 651000000 },
69 { .cmd = DTV_MODULATION, .u.data = QAM_256 },
70 { .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO },
71 { .cmd = DTV_SYMBOL_RATE, .u.data = 5217000 },
72 { .cmd = DTV_INNER_FEC, .u.data = FEC_3_4 },
73 { .cmd = DTV_TUNE }
74 };
75
76 static struct dtv_properties dtv_prop = {
77 .num = 6, .props = props
78 };
79
80 int main(void)
81 {
82 int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR);
83
84 if (!fd) {
85 perror ("open");
86 return -1;
87 }
88 if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) {
89 perror("ioctl");
90 return -1;
91 }
92 printf("Frontend set\\n");
93 return 0;
94 }
95
96.. attention:: While it is possible to directly call the Kernel code like the
97 above example, it is strongly recommended to use
98 `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
99 provides abstraction to work with the supported digital TV standards and
100 provides methods for usual operations like program scanning and to
101 read/write channel descriptor files.
102
103
104.. toctree::
105 :maxdepth: 1
106
107 dtv-stats
108 dtv-fe-stats
109 dtv-property
110 dtv-properties
111 dvbproperty-006
112 fe_property_parameters
113 frontend-stat-properties
114 frontend-property-terrestrial-systems
115 frontend-property-cable-systems
116 frontend-property-satellite-systems
diff --git a/Documentation/media/uapi/dvb/examples.rst b/Documentation/media/uapi/dvb/examples.rst
new file mode 100644
index 000000000000..bf0a8617de92
--- /dev/null
+++ b/Documentation/media/uapi/dvb/examples.rst
@@ -0,0 +1,380 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_examples:
4
5********
6Examples
7********
8
9In this section we would like to present some examples for using the DVB
10API.
11
12..note:: This section is out of date, and the code below won't even
13 compile. Please refer to the
14 `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__ for
15 updated/recommended examples.
16
17
18.. _tuning:
19
20Example: Tuning
21===============
22
23We will start with a generic tuning subroutine that uses the frontend
24and SEC, as well as the demux devices. The example is given for QPSK
25tuners, but can easily be adjusted for QAM.
26
27
28.. code-block:: c
29
30 #include <sys/ioctl.h>
31 #include <stdio.h>
32 #include <stdint.h>
33 #include <sys/types.h>
34 #include <sys/stat.h>
35 #include <fcntl.h>
36 #include <time.h>
37 #include <unistd.h>
38
39 #include <linux/dvb/dmx.h>
40 #include <linux/dvb/frontend.h>
41 #include <linux/dvb/sec.h>
42 #include <sys/poll.h>
43
44 #define DMX "/dev/dvb/adapter0/demux1"
45 #define FRONT "/dev/dvb/adapter0/frontend1"
46 #define SEC "/dev/dvb/adapter0/sec1"
47
48 /* routine for checking if we have a signal and other status information*/
49 int FEReadStatus(int fd, fe_status_t *stat)
50 {
51 int ans;
52
53 if ( (ans = ioctl(fd,FE_READ_STATUS,stat) < 0)){
54 perror("FE READ STATUS: ");
55 return -1;
56 }
57
58 if (*stat & FE_HAS_POWER)
59 printf("FE HAS POWER\\n");
60
61 if (*stat & FE_HAS_SIGNAL)
62 printf("FE HAS SIGNAL\\n");
63
64 if (*stat & FE_SPECTRUM_INV)
65 printf("SPEKTRUM INV\\n");
66
67 return 0;
68 }
69
70
71 /* tune qpsk */
72 /* freq: frequency of transponder */
73 /* vpid, apid, tpid: PIDs of video, audio and teletext TS packets */
74 /* diseqc: DiSEqC address of the used LNB */
75 /* pol: Polarisation */
76 /* srate: Symbol Rate */
77 /* fec. FEC */
78 /* lnb_lof1: local frequency of lower LNB band */
79 /* lnb_lof2: local frequency of upper LNB band */
80 /* lnb_slof: switch frequency of LNB */
81
82 int set_qpsk_channel(int freq, int vpid, int apid, int tpid,
83 int diseqc, int pol, int srate, int fec, int lnb_lof1,
84 int lnb_lof2, int lnb_slof)
85 {
86 struct secCommand scmd;
87 struct secCmdSequence scmds;
88 struct dmx_pes_filter_params pesFilterParams;
89 FrontendParameters frp;
90 struct pollfd pfd[1];
91 FrontendEvent event;
92 int demux1, demux2, demux3, front;
93
94 frequency = (uint32_t) freq;
95 symbolrate = (uint32_t) srate;
96
97 if((front = open(FRONT,O_RDWR)) < 0){
98 perror("FRONTEND DEVICE: ");
99 return -1;
100 }
101
102 if((sec = open(SEC,O_RDWR)) < 0){
103 perror("SEC DEVICE: ");
104 return -1;
105 }
106
107 if (demux1 < 0){
108 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
109 < 0){
110 perror("DEMUX DEVICE: ");
111 return -1;
112 }
113 }
114
115 if (demux2 < 0){
116 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
117 < 0){
118 perror("DEMUX DEVICE: ");
119 return -1;
120 }
121 }
122
123 if (demux3 < 0){
124 if ((demux3=open(DMX, O_RDWR|O_NONBLOCK))
125 < 0){
126 perror("DEMUX DEVICE: ");
127 return -1;
128 }
129 }
130
131 if (freq < lnb_slof) {
132 frp.Frequency = (freq - lnb_lof1);
133 scmds.continuousTone = SEC_TONE_OFF;
134 } else {
135 frp.Frequency = (freq - lnb_lof2);
136 scmds.continuousTone = SEC_TONE_ON;
137 }
138 frp.Inversion = INVERSION_AUTO;
139 if (pol) scmds.voltage = SEC_VOLTAGE_18;
140 else scmds.voltage = SEC_VOLTAGE_13;
141
142 scmd.type=0;
143 scmd.u.diseqc.addr=0x10;
144 scmd.u.diseqc.cmd=0x38;
145 scmd.u.diseqc.numParams=1;
146 scmd.u.diseqc.params[0] = 0xF0 | ((diseqc * 4) & 0x0F) |
147 (scmds.continuousTone == SEC_TONE_ON ? 1 : 0) |
148 (scmds.voltage==SEC_VOLTAGE_18 ? 2 : 0);
149
150 scmds.miniCommand=SEC_MINI_NONE;
151 scmds.numCommands=1;
152 scmds.commands=&scmd;
153 if (ioctl(sec, SEC_SEND_SEQUENCE, &scmds) < 0){
154 perror("SEC SEND: ");
155 return -1;
156 }
157
158 if (ioctl(sec, SEC_SEND_SEQUENCE, &scmds) < 0){
159 perror("SEC SEND: ");
160 return -1;
161 }
162
163 frp.u.qpsk.SymbolRate = srate;
164 frp.u.qpsk.FEC_inner = fec;
165
166 if (ioctl(front, FE_SET_FRONTEND, &frp) < 0){
167 perror("QPSK TUNE: ");
168 return -1;
169 }
170
171 pfd[0].fd = front;
172 pfd[0].events = POLLIN;
173
174 if (poll(pfd,1,3000)){
175 if (pfd[0].revents & POLLIN){
176 printf("Getting QPSK event\\n");
177 if ( ioctl(front, FE_GET_EVENT, &event)
178
179 == -EOVERFLOW){
180 perror("qpsk get event");
181 return -1;
182 }
183 printf("Received ");
184 switch(event.type){
185 case FE_UNEXPECTED_EV:
186 printf("unexpected event\\n");
187 return -1;
188 case FE_FAILURE_EV:
189 printf("failure event\\n");
190 return -1;
191
192 case FE_COMPLETION_EV:
193 printf("completion event\\n");
194 }
195 }
196 }
197
198
199 pesFilterParams.pid = vpid;
200 pesFilterParams.input = DMX_IN_FRONTEND;
201 pesFilterParams.output = DMX_OUT_DECODER;
202 pesFilterParams.pes_type = DMX_PES_VIDEO;
203 pesFilterParams.flags = DMX_IMMEDIATE_START;
204 if (ioctl(demux1, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
205 perror("set_vpid");
206 return -1;
207 }
208
209 pesFilterParams.pid = apid;
210 pesFilterParams.input = DMX_IN_FRONTEND;
211 pesFilterParams.output = DMX_OUT_DECODER;
212 pesFilterParams.pes_type = DMX_PES_AUDIO;
213 pesFilterParams.flags = DMX_IMMEDIATE_START;
214 if (ioctl(demux2, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
215 perror("set_apid");
216 return -1;
217 }
218
219 pesFilterParams.pid = tpid;
220 pesFilterParams.input = DMX_IN_FRONTEND;
221 pesFilterParams.output = DMX_OUT_DECODER;
222 pesFilterParams.pes_type = DMX_PES_TELETEXT;
223 pesFilterParams.flags = DMX_IMMEDIATE_START;
224 if (ioctl(demux3, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
225 perror("set_tpid");
226 return -1;
227 }
228
229 return has_signal(fds);
230 }
231
232The program assumes that you are using a universal LNB and a standard
233DiSEqC switch with up to 4 addresses. Of course, you could build in some
234more checking if tuning was successful and maybe try to repeat the
235tuning process. Depending on the external hardware, i.e. LNB and DiSEqC
236switch, and weather conditions this may be necessary.
237
238
239.. _the_dvr_device:
240
241Example: The DVR device
242========================
243
244The following program code shows how to use the DVR device for
245recording.
246
247
248.. code-block:: c
249
250 #include <sys/ioctl.h>
251 #include <stdio.h>
252 #include <stdint.h>
253 #include <sys/types.h>
254 #include <sys/stat.h>
255 #include <fcntl.h>
256 #include <time.h>
257 #include <unistd.h>
258
259 #include <linux/dvb/dmx.h>
260 #include <linux/dvb/video.h>
261 #include <sys/poll.h>
262 #define DVR "/dev/dvb/adapter0/dvr1"
263 #define AUDIO "/dev/dvb/adapter0/audio1"
264 #define VIDEO "/dev/dvb/adapter0/video1"
265
266 #define BUFFY (188*20)
267 #define MAX_LENGTH (1024*1024*5) /* record 5MB */
268
269
270 /* switch the demuxes to recording, assuming the transponder is tuned */
271
272 /* demux1, demux2: file descriptor of video and audio filters */
273 /* vpid, apid: PIDs of video and audio channels */
274
275 int switch_to_record(int demux1, int demux2, uint16_t vpid, uint16_t apid)
276 {
277 struct dmx_pes_filter_params pesFilterParams;
278
279 if (demux1 < 0){
280 if ((demux1=open(DMX, O_RDWR|O_NONBLOCK))
281 < 0){
282 perror("DEMUX DEVICE: ");
283 return -1;
284 }
285 }
286
287 if (demux2 < 0){
288 if ((demux2=open(DMX, O_RDWR|O_NONBLOCK))
289 < 0){
290 perror("DEMUX DEVICE: ");
291 return -1;
292 }
293 }
294
295 pesFilterParams.pid = vpid;
296 pesFilterParams.input = DMX_IN_FRONTEND;
297 pesFilterParams.output = DMX_OUT_TS_TAP;
298 pesFilterParams.pes_type = DMX_PES_VIDEO;
299 pesFilterParams.flags = DMX_IMMEDIATE_START;
300 if (ioctl(demux1, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
301 perror("DEMUX DEVICE");
302 return -1;
303 }
304 pesFilterParams.pid = apid;
305 pesFilterParams.input = DMX_IN_FRONTEND;
306 pesFilterParams.output = DMX_OUT_TS_TAP;
307 pesFilterParams.pes_type = DMX_PES_AUDIO;
308 pesFilterParams.flags = DMX_IMMEDIATE_START;
309 if (ioctl(demux2, DMX_SET_PES_FILTER, &pesFilterParams) < 0){
310 perror("DEMUX DEVICE");
311 return -1;
312 }
313 return 0;
314 }
315
316 /* start recording MAX_LENGTH , assuming the transponder is tuned */
317
318 /* demux1, demux2: file descriptor of video and audio filters */
319 /* vpid, apid: PIDs of video and audio channels */
320 int record_dvr(int demux1, int demux2, uint16_t vpid, uint16_t apid)
321 {
322 int i;
323 int len;
324 int written;
325 uint8_t buf[BUFFY];
326 uint64_t length;
327 struct pollfd pfd[1];
328 int dvr, dvr_out;
329
330 /* open dvr device */
331 if ((dvr = open(DVR, O_RDONLY|O_NONBLOCK)) < 0){
332 perror("DVR DEVICE");
333 return -1;
334 }
335
336 /* switch video and audio demuxes to dvr */
337 printf ("Switching dvr on\\n");
338 i = switch_to_record(demux1, demux2, vpid, apid);
339 printf("finished: ");
340
341 printf("Recording %2.0f MB of test file in TS format\\n",
342 MAX_LENGTH/(1024.0*1024.0));
343 length = 0;
344
345 /* open output file */
346 if ((dvr_out = open(DVR_FILE,O_WRONLY|O_CREAT
347 |O_TRUNC, S_IRUSR|S_IWUSR
348 |S_IRGRP|S_IWGRP|S_IROTH|
349 S_IWOTH)) < 0){
350 perror("Can't open file for dvr test");
351 return -1;
352 }
353
354 pfd[0].fd = dvr;
355 pfd[0].events = POLLIN;
356
357 /* poll for dvr data and write to file */
358 while (length < MAX_LENGTH ) {
359 if (poll(pfd,1,1)){
360 if (pfd[0].revents & POLLIN){
361 len = read(dvr, buf, BUFFY);
362 if (len < 0){
363 perror("recording");
364 return -1;
365 }
366 if (len > 0){
367 written = 0;
368 while (written < len)
369 written +=
370 write (dvr_out,
371 buf, len);
372 length += len;
373 printf("written %2.0f MB\\r",
374 length/1024./1024.);
375 }
376 }
377 }
378 }
379 return 0;
380 }
diff --git a/Documentation/media/uapi/dvb/fe-bandwidth-t.rst b/Documentation/media/uapi/dvb/fe-bandwidth-t.rst
new file mode 100644
index 000000000000..8edaf1a8fbc8
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-bandwidth-t.rst
@@ -0,0 +1,77 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _fe-bandwidth-t:
4
5******************
6Frontend bandwidth
7******************
8
9
10.. _fe-bandwidth:
11
12.. flat-table:: enum fe_bandwidth
13 :header-rows: 1
14 :stub-columns: 0
15
16
17 - .. row 1
18
19 - ID
20
21 - Description
22
23 - .. row 2
24
25 - .. _BANDWIDTH-AUTO:
26
27 ``BANDWIDTH_AUTO``
28
29 - Autodetect bandwidth (if supported)
30
31 - .. row 3
32
33 - .. _BANDWIDTH-1-712-MHZ:
34
35 ``BANDWIDTH_1_712_MHZ``
36
37 - 1.712 MHz
38
39 - .. row 4
40
41 - .. _BANDWIDTH-5-MHZ:
42
43 ``BANDWIDTH_5_MHZ``
44
45 - 5 MHz
46
47 - .. row 5
48
49 - .. _BANDWIDTH-6-MHZ:
50
51 ``BANDWIDTH_6_MHZ``
52
53 - 6 MHz
54
55 - .. row 6
56
57 - .. _BANDWIDTH-7-MHZ:
58
59 ``BANDWIDTH_7_MHZ``
60
61 - 7 MHz
62
63 - .. row 7
64
65 - .. _BANDWIDTH-8-MHZ:
66
67 ``BANDWIDTH_8_MHZ``
68
69 - 8 MHz
70
71 - .. row 8
72
73 - .. _BANDWIDTH-10-MHZ:
74
75 ``BANDWIDTH_10_MHZ``
76
77 - 10 MHz
diff --git a/Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst b/Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst
new file mode 100644
index 000000000000..7bd02ac7bff4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst
@@ -0,0 +1,83 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_DISEQC_RECV_SLAVE_REPLY:
4
5********************************
6ioctl FE_DISEQC_RECV_SLAVE_REPLY
7********************************
8
9Name
10====
11
12FE_DISEQC_RECV_SLAVE_REPLY - Receives reply from a DiSEqC 2.0 command
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dvb_diseqc_slave_reply *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_DISEQC_RECV_SLAVE_REPLY
29
30``argp``
31 pointer to struct
32 :ref:`dvb_diseqc_slave_reply <dvb-diseqc-slave-reply>`
33
34
35Description
36===========
37
38Receives reply from a DiSEqC 2.0 command.
39
40.. _dvb-diseqc-slave-reply:
41
42struct dvb_diseqc_slave_reply
43-----------------------------
44
45.. flat-table:: struct dvb_diseqc_slave_reply
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2
49
50
51 - .. row 1
52
53 - uint8_t
54
55 - msg[4]
56
57 - DiSEqC message (framing, data[3])
58
59 - .. row 2
60
61 - uint8_t
62
63 - msg_len
64
65 - Length of the DiSEqC message. Valid values are 0 to 4, where 0
66 means no msg
67
68 - .. row 3
69
70 - int
71
72 - timeout
73
74 - Return from ioctl after timeout ms with errorcode when no message
75 was received
76
77
78Return Value
79============
80
81On success 0 is returned, on error -1 and the ``errno`` variable is set
82appropriately. The generic error codes are described at the
83:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-diseqc-reset-overload.rst b/Documentation/media/uapi/dvb/fe-diseqc-reset-overload.rst
new file mode 100644
index 000000000000..cab157054c13
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-diseqc-reset-overload.rst
@@ -0,0 +1,45 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_DISEQC_RESET_OVERLOAD:
4
5******************************
6ioctl FE_DISEQC_RESET_OVERLOAD
7******************************
8
9Name
10====
11
12FE_DISEQC_RESET_OVERLOAD - Restores the power to the antenna subsystem, if it was powered off due - to power overload.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, NULL )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_DISEQC_RESET_OVERLOAD
29
30
31Description
32===========
33
34If the bus has been automatically powered off due to power overload,
35this ioctl call restores the power to the bus. The call requires
36read/write access to the device. This call has no effect if the device
37is manually powered off. Not all DVB adapters support this ioctl.
38
39
40Return Value
41============
42
43On success 0 is returned, on error -1 and the ``errno`` variable is set
44appropriately. The generic error codes are described at the
45:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-diseqc-send-burst.rst b/Documentation/media/uapi/dvb/fe-diseqc-send-burst.rst
new file mode 100644
index 000000000000..9b476545ef89
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-diseqc-send-burst.rst
@@ -0,0 +1,84 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_DISEQC_SEND_BURST:
4
5**************************
6ioctl FE_DISEQC_SEND_BURST
7**************************
8
9Name
10====
11
12FE_DISEQC_SEND_BURST - Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite selection.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, enum fe_sec_mini_cmd *tone )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_DISEQC_SEND_BURST
29
30``tone``
31 pointer to enum :ref:`fe_sec_mini_cmd <fe-sec-mini-cmd>`
32
33
34Description
35===========
36
37This ioctl is used to set the generation of a 22kHz tone burst for mini
38DiSEqC satellite selection for 2x1 switches. This call requires
39read/write permissions.
40
41It provides support for what's specified at
42`Digital Satellite Equipment Control (DiSEqC) - Simple "ToneBurst" Detection Circuit specification. <http://www.eutelsat.com/files/contributed/satellites/pdf/Diseqc/associated%20docs/simple_tone_burst_detec.pdf>`__
43
44.. _fe-sec-mini-cmd-t:
45
46enum fe_sec_mini_cmd
47====================
48
49.. _fe-sec-mini-cmd:
50
51.. flat-table:: enum fe_sec_mini_cmd
52 :header-rows: 1
53 :stub-columns: 0
54
55
56 - .. row 1
57
58 - ID
59
60 - Description
61
62 - .. row 2
63
64 - .. _SEC-MINI-A:
65
66 ``SEC_MINI_A``
67
68 - Sends a mini-DiSEqC 22kHz '0' Tone Burst to select satellite-A
69
70 - .. row 3
71
72 - .. _SEC-MINI-B:
73
74 ``SEC_MINI_B``
75
76 - Sends a mini-DiSEqC 22kHz '1' Data Burst to select satellite-B
77
78
79Return Value
80============
81
82On success 0 is returned, on error -1 and the ``errno`` variable is set
83appropriately. The generic error codes are described at the
84:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst b/Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst
new file mode 100644
index 000000000000..58a5e6ac10bd
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst
@@ -0,0 +1,73 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_DISEQC_SEND_MASTER_CMD:
4
5*******************************
6ioctl FE_DISEQC_SEND_MASTER_CMD
7*******************************
8
9Name
10====
11
12FE_DISEQC_SEND_MASTER_CMD - Sends a DiSEqC command
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dvb_diseqc_master_cmd *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_DISEQC_SEND_MASTER_CMD
29
30``argp``
31 pointer to struct
32 :ref:`dvb_diseqc_master_cmd <dvb-diseqc-master-cmd>`
33
34
35Description
36===========
37
38Sends a DiSEqC command to the antenna subsystem.
39
40.. _dvb-diseqc-master-cmd:
41
42struct dvb_diseqc_master_cmd
43============================
44
45.. flat-table:: struct dvb_diseqc_master_cmd
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2
49
50
51 - .. row 1
52
53 - uint8_t
54
55 - msg[6]
56
57 - DiSEqC message (framing, address, command, data[3])
58
59 - .. row 2
60
61 - uint8_t
62
63 - msg_len
64
65 - Length of the DiSEqC message. Valid values are 3 to 6
66
67Return Value
68============
69
70On success 0 is returned, on error -1 and the ``errno`` variable is set
71appropriately. The generic error codes are described at the
72:ref:`Generic Error Codes <gen-errors>` chapter.
73
diff --git a/Documentation/media/uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst b/Documentation/media/uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst
new file mode 100644
index 000000000000..d47e9dbf558a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_DISHNETWORK_SEND_LEGACY_CMD:
4
5******************************
6FE_DISHNETWORK_SEND_LEGACY_CMD
7******************************
8
9Name
10====
11
12FE_DISHNETWORK_SEND_LEGACY_CMD
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl(int fd, int request = FE_DISHNETWORK_SEND_LEGACY_CMD, unsigned long cmd)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - unsigned long cmd
32
33 - sends the specified raw cmd to the dish via DISEqC.
34
35
36Description
37===========
38
39.. warning::
40 This is a very obscure legacy command, used only at stv0299
41 driver. Should not be used on newer drivers.
42
43It provides a non-standard method for selecting Diseqc voltage on the
44frontend, for Dish Network legacy switches.
45
46As support for this ioctl were added in 2004, this means that such
47dishes were already legacy in 2004.
48
49
50Return Value
51============
52
53On success 0 is returned, on error -1 and the ``errno`` variable is set
54appropriately. The generic error codes are described at the
55:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-enable-high-lnb-voltage.rst b/Documentation/media/uapi/dvb/fe-enable-high-lnb-voltage.rst
new file mode 100644
index 000000000000..de99bf5fbf0e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-enable-high-lnb-voltage.rst
@@ -0,0 +1,52 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_ENABLE_HIGH_LNB_VOLTAGE:
4
5********************************
6ioctl FE_ENABLE_HIGH_LNB_VOLTAGE
7********************************
8
9Name
10====
11
12FE_ENABLE_HIGH_LNB_VOLTAGE - Select output DC level between normal LNBf voltages or higher LNBf - voltages.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, unsigned int high )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_ENABLE_HIGH_LNB_VOLTAGE
29
30``high``
31 Valid flags:
32
33 - 0 - normal 13V and 18V.
34
35 - >0 - enables slightly higher voltages instead of 13/18V, in order
36 to compensate for long antenna cables.
37
38
39Description
40===========
41
42Select output DC level between normal LNBf voltages or higher LNBf
43voltages between 0 (normal) or a value grater than 0 for higher
44voltages.
45
46
47Return Value
48============
49
50On success 0 is returned, on error -1 and the ``errno`` variable is set
51appropriately. The generic error codes are described at the
52:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-get-event.rst b/Documentation/media/uapi/dvb/fe-get-event.rst
new file mode 100644
index 000000000000..ffa3d04c6bd4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-get-event.rst
@@ -0,0 +1,87 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_GET_EVENT:
4
5************
6FE_GET_EVENT
7************
8
9Name
10====
11
12FE_GET_EVENT
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl(int fd, int request = QPSK_GET_EVENT, struct dvb_frontend_event *ev)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals :ref:`FE_GET_EVENT` for this command.
40
41 - .. row 3
42
43 - struct dvb_frontend_event \*ev
44
45 - Points to the location where the event,
46
47 - .. row 4
48
49 -
50 - if any, is to be stored.
51
52
53Description
54===========
55
56This ioctl call returns a frontend event if available. If an event is
57not available, the behavior depends on whether the device is in blocking
58or non-blocking mode. In the latter case, the call fails immediately
59with errno set to ``EWOULDBLOCK``. In the former case, the call blocks until
60an event becomes available.
61
62
63Return Value
64============
65
66On success 0 is returned, on error -1 and the ``errno`` variable is set
67appropriately. The generic error codes are described at the
68:ref:`Generic Error Codes <gen-errors>` chapter.
69
70
71
72.. flat-table::
73 :header-rows: 0
74 :stub-columns: 0
75
76
77 - .. row 1
78
79 - ``EWOULDBLOCK``
80
81 - There is no event pending, and the device is in non-blocking mode.
82
83 - .. row 2
84
85 - ``EOVERFLOW``
86
87 - Overflow in event queue - one or more events were lost.
diff --git a/Documentation/media/uapi/dvb/fe-get-frontend.rst b/Documentation/media/uapi/dvb/fe-get-frontend.rst
new file mode 100644
index 000000000000..5d2df808df18
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-get-frontend.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_GET_FRONTEND:
4
5***************
6FE_GET_FRONTEND
7***************
8
9Name
10====
11
12FE_GET_FRONTEND
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl(int fd, int request = FE_GET_FRONTEND, struct dvb_frontend_parameters *p)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals :ref:`FE_SET_FRONTEND` for this
40 command.
41
42 - .. row 3
43
44 - struct dvb_frontend_parameters \*p
45
46 - Points to parameters for tuning operation.
47
48
49Description
50===========
51
52This ioctl call queries the currently effective frontend parameters. For
53this command, read-only access to the device is sufficient.
54
55
56Return Value
57============
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EINVAL``
73
74 - Maximum supported symbol rate reached.
diff --git a/Documentation/media/uapi/dvb/fe-get-info.rst b/Documentation/media/uapi/dvb/fe-get-info.rst
new file mode 100644
index 000000000000..bb6c32e47ce8
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-get-info.rst
@@ -0,0 +1,428 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_GET_INFO:
4
5*****************
6ioctl FE_GET_INFO
7*****************
8
9Name
10====
11
12FE_GET_INFO - Query DVB frontend capabilities and returns information about the - front-end. This call only requires read-only access to the device
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dvb_frontend_info *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_GET_INFO
29
30``argp``
31 pointer to struct struct
32 :ref:`dvb_frontend_info <dvb-frontend-info>`
33
34
35Description
36===========
37
38All DVB frontend devices support the ``FE_GET_INFO`` ioctl. It is used
39to identify kernel devices compatible with this specification and to
40obtain information about driver and hardware capabilities. The ioctl
41takes a pointer to dvb_frontend_info which is filled by the driver.
42When the driver is not compatible with this specification the ioctl
43returns an error.
44
45.. _dvb-frontend-info:
46
47struct dvb_frontend_info
48========================
49
50.. flat-table:: struct dvb_frontend_info
51 :header-rows: 0
52 :stub-columns: 0
53 :widths: 1 1 2
54
55
56 - .. row 1
57
58 - char
59
60 - name[128]
61
62 - Name of the frontend
63
64 - .. row 2
65
66 - fe_type_t
67
68 - type
69
70 - **DEPRECATED**. DVBv3 type. Should not be used on modern programs,
71 as a frontend may have more than one type. So, the DVBv5 API
72 should be used instead to enumerate and select the frontend type.
73
74 - .. row 3
75
76 - uint32_t
77
78 - frequency_min
79
80 - Minimal frequency supported by the frontend
81
82 - .. row 4
83
84 - uint32_t
85
86 - frequency_max
87
88 - Maximal frequency supported by the frontend
89
90 - .. row 5
91
92 - uint32_t
93
94 - frequency_stepsize
95
96 - Frequency step - all frequencies are multiple of this value
97
98 - .. row 6
99
100 - uint32_t
101
102 - frequency_tolerance
103
104 - Tolerance of the frequency
105
106 - .. row 7
107
108 - uint32_t
109
110 - symbol_rate_min
111
112 - Minimal symbol rate (for Cable/Satellite systems), in bauds
113
114 - .. row 8
115
116 - uint32_t
117
118 - symbol_rate_max
119
120 - Maximal symbol rate (for Cable/Satellite systems), in bauds
121
122 - .. row 9
123
124 - uint32_t
125
126 - symbol_rate_tolerance
127
128 - Maximal symbol rate tolerance, in ppm
129
130 - .. row 10
131
132 - uint32_t
133
134 - notifier_delay
135
136 - **DEPRECATED**. Not used by any driver.
137
138 - .. row 11
139
140 - enum :ref:`fe_caps <fe-caps>`
141
142 - caps
143
144 - Capabilities supported by the frontend
145
146
147.. note:: The frequencies are specified in Hz for Terrestrial and Cable
148 systems. They're specified in kHz for Satellite systems
149
150
151.. _fe-caps-t:
152
153frontend capabilities
154=====================
155
156Capabilities describe what a frontend can do. Some capabilities are
157supported only on some specific frontend types.
158
159
160.. _fe-caps:
161
162.. flat-table:: enum fe_caps
163 :header-rows: 1
164 :stub-columns: 0
165
166
167 - .. row 1
168
169 - ID
170
171 - Description
172
173 - .. row 2
174
175 - .. _FE-IS-STUPID:
176
177 ``FE_IS_STUPID``
178
179 - There's something wrong at the frontend, and it can't report its
180 capabilities
181
182 - .. row 3
183
184 - .. _FE-CAN-INVERSION-AUTO:
185
186 ``FE_CAN_INVERSION_AUTO``
187
188 - The frontend is capable of auto-detecting inversion
189
190 - .. row 4
191
192 - .. _FE-CAN-FEC-1-2:
193
194 ``FE_CAN_FEC_1_2``
195
196 - The frontend supports FEC 1/2
197
198 - .. row 5
199
200 - .. _FE-CAN-FEC-2-3:
201
202 ``FE_CAN_FEC_2_3``
203
204 - The frontend supports FEC 2/3
205
206 - .. row 6
207
208 - .. _FE-CAN-FEC-3-4:
209
210 ``FE_CAN_FEC_3_4``
211
212 - The frontend supports FEC 3/4
213
214 - .. row 7
215
216 - .. _FE-CAN-FEC-4-5:
217
218 ``FE_CAN_FEC_4_5``
219
220 - The frontend supports FEC 4/5
221
222 - .. row 8
223
224 - .. _FE-CAN-FEC-5-6:
225
226 ``FE_CAN_FEC_5_6``
227
228 - The frontend supports FEC 5/6
229
230 - .. row 9
231
232 - .. _FE-CAN-FEC-6-7:
233
234 ``FE_CAN_FEC_6_7``
235
236 - The frontend supports FEC 6/7
237
238 - .. row 10
239
240 - .. _FE-CAN-FEC-7-8:
241
242 ``FE_CAN_FEC_7_8``
243
244 - The frontend supports FEC 7/8
245
246 - .. row 11
247
248 - .. _FE-CAN-FEC-8-9:
249
250 ``FE_CAN_FEC_8_9``
251
252 - The frontend supports FEC 8/9
253
254 - .. row 12
255
256 - .. _FE-CAN-FEC-AUTO:
257
258 ``FE_CAN_FEC_AUTO``
259
260 - The frontend can autodetect FEC.
261
262 - .. row 13
263
264 - .. _FE-CAN-QPSK:
265
266 ``FE_CAN_QPSK``
267
268 - The frontend supports QPSK modulation
269
270 - .. row 14
271
272 - .. _FE-CAN-QAM-16:
273
274 ``FE_CAN_QAM_16``
275
276 - The frontend supports 16-QAM modulation
277
278 - .. row 15
279
280 - .. _FE-CAN-QAM-32:
281
282 ``FE_CAN_QAM_32``
283
284 - The frontend supports 32-QAM modulation
285
286 - .. row 16
287
288 - .. _FE-CAN-QAM-64:
289
290 ``FE_CAN_QAM_64``
291
292 - The frontend supports 64-QAM modulation
293
294 - .. row 17
295
296 - .. _FE-CAN-QAM-128:
297
298 ``FE_CAN_QAM_128``
299
300 - The frontend supports 128-QAM modulation
301
302 - .. row 18
303
304 - .. _FE-CAN-QAM-256:
305
306 ``FE_CAN_QAM_256``
307
308 - The frontend supports 256-QAM modulation
309
310 - .. row 19
311
312 - .. _FE-CAN-QAM-AUTO:
313
314 ``FE_CAN_QAM_AUTO``
315
316 - The frontend can autodetect modulation
317
318 - .. row 20
319
320 - .. _FE-CAN-TRANSMISSION-MODE-AUTO:
321
322 ``FE_CAN_TRANSMISSION_MODE_AUTO``
323
324 - The frontend can autodetect the transmission mode
325
326 - .. row 21
327
328 - .. _FE-CAN-BANDWIDTH-AUTO:
329
330 ``FE_CAN_BANDWIDTH_AUTO``
331
332 - The frontend can autodetect the bandwidth
333
334 - .. row 22
335
336 - .. _FE-CAN-GUARD-INTERVAL-AUTO:
337
338 ``FE_CAN_GUARD_INTERVAL_AUTO``
339
340 - The frontend can autodetect the guard interval
341
342 - .. row 23
343
344 - .. _FE-CAN-HIERARCHY-AUTO:
345
346 ``FE_CAN_HIERARCHY_AUTO``
347
348 - The frontend can autodetect hierarch
349
350 - .. row 24
351
352 - .. _FE-CAN-8VSB:
353
354 ``FE_CAN_8VSB``
355
356 - The frontend supports 8-VSB modulation
357
358 - .. row 25
359
360 - .. _FE-CAN-16VSB:
361
362 ``FE_CAN_16VSB``
363
364 - The frontend supports 16-VSB modulation
365
366 - .. row 26
367
368 - .. _FE-HAS-EXTENDED-CAPS:
369
370 ``FE_HAS_EXTENDED_CAPS``
371
372 - Currently, unused
373
374 - .. row 27
375
376 - .. _FE-CAN-MULTISTREAM:
377
378 ``FE_CAN_MULTISTREAM``
379
380 - The frontend supports multistream filtering
381
382 - .. row 28
383
384 - .. _FE-CAN-TURBO-FEC:
385
386 ``FE_CAN_TURBO_FEC``
387
388 - The frontend supports turbo FEC modulation
389
390 - .. row 29
391
392 - .. _FE-CAN-2G-MODULATION:
393
394 ``FE_CAN_2G_MODULATION``
395
396 - The frontend supports "2nd generation modulation" (DVB-S2/T2)>
397
398 - .. row 30
399
400 - .. _FE-NEEDS-BENDING:
401
402 ``FE_NEEDS_BENDING``
403
404 - Not supported anymore, don't use it
405
406 - .. row 31
407
408 - .. _FE-CAN-RECOVER:
409
410 ``FE_CAN_RECOVER``
411
412 - The frontend can recover from a cable unplug automatically
413
414 - .. row 32
415
416 - .. _FE-CAN-MUTE-TS:
417
418 ``FE_CAN_MUTE_TS``
419
420 - The frontend can stop spurious TS data output
421
422
423Return Value
424============
425
426On success 0 is returned, on error -1 and the ``errno`` variable is set
427appropriately. The generic error codes are described at the
428:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-get-property.rst b/Documentation/media/uapi/dvb/fe-get-property.rst
new file mode 100644
index 000000000000..749daafe6b21
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-get-property.rst
@@ -0,0 +1,68 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_GET_PROPERTY:
4
5**************************************
6ioctl FE_SET_PROPERTY, FE_GET_PROPERTY
7**************************************
8
9Name
10====
11
12FE_SET_PROPERTY - FE_GET_PROPERTY - FE_SET_PROPERTY sets one or more frontend properties. - FE_GET_PROPERTY returns one or more frontend properties.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dtv_properties *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_PROPERTY, FE_GET_PROPERTY
29
30``argp``
31 pointer to struct :ref:`dtv_properties <dtv-properties>`
32
33
34Description
35===========
36
37All DVB frontend devices support the ``FE_SET_PROPERTY`` and
38``FE_GET_PROPERTY`` ioctls. The supported properties and statistics
39depends on the delivery system and on the device:
40
41- ``FE_SET_PROPERTY:``
42
43 - This ioctl is used to set one or more frontend properties.
44
45 - This is the basic command to request the frontend to tune into
46 some frequency and to start decoding the digital TV signal.
47
48 - This call requires read/write access to the device.
49
50 - At return, the values are updated to reflect the actual parameters
51 used.
52
53- ``FE_GET_PROPERTY:``
54
55 - This ioctl is used to get properties and statistics from the
56 frontend.
57
58 - No properties are changed, and statistics aren't reset.
59
60 - This call only requires read-only access to the device.
61
62
63Return Value
64============
65
66On success 0 is returned, on error -1 and the ``errno`` variable is set
67appropriately. The generic error codes are described at the
68:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-read-ber.rst b/Documentation/media/uapi/dvb/fe-read-ber.rst
new file mode 100644
index 000000000000..c2b5b417f5fb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-read-ber.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_READ_BER:
4
5***********
6FE_READ_BER
7***********
8
9Name
10====
11
12FE_READ_BER
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl(int fd, int request = FE_READ_BER, uint32_t *ber)
18
19
20Arguments
21=========
22
23.. flat-table::
24 :header-rows: 0
25 :stub-columns: 0
26
27
28 - .. row 1
29
30 - int fd
31
32 - File descriptor returned by a previous call to open().
33
34 - .. row 2
35
36 - int request
37
38 - Equals :ref:`FE_READ_BER` for this command.
39
40 - .. row 3
41
42 - uint32_t \*ber
43
44 - The bit error rate is stored into \*ber.
45
46
47Description
48===========
49
50This ioctl call returns the bit error rate for the signal currently
51received/demodulated by the front-end. For this command, read-only
52access to the device is sufficient.
53
54
55Return Value
56============
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-read-signal-strength.rst b/Documentation/media/uapi/dvb/fe-read-signal-strength.rst
new file mode 100644
index 000000000000..0cdee2effc97
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-read-signal-strength.rst
@@ -0,0 +1,63 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_READ_SIGNAL_STRENGTH:
4
5***********************
6FE_READ_SIGNAL_STRENGTH
7***********************
8
9Name
10====
11
12FE_READ_SIGNAL_STRENGTH
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request = FE_READ_SIGNAL_STRENGTH, uint16_t *strength)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals
40 :ref:`FE_READ_SIGNAL_STRENGTH`
41 for this command.
42
43 - .. row 3
44
45 - uint16_t \*strength
46
47 - The signal strength value is stored into \*strength.
48
49
50Description
51===========
52
53This ioctl call returns the signal strength value for the signal
54currently received by the front-end. For this command, read-only access
55to the device is sufficient.
56
57
58Return Value
59============
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-read-snr.rst b/Documentation/media/uapi/dvb/fe-read-snr.rst
new file mode 100644
index 000000000000..5394f9ae90f4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-read-snr.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_READ_SNR:
4
5***********
6FE_READ_SNR
7***********
8
9Name
10====
11
12FE_READ_SNR
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl(int fd, int request = FE_READ_SNR, int16_t *snr)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals :ref:`FE_READ_SNR` for this command.
40
41 - .. row 3
42
43 - uint16_t \*snr
44
45 - The signal-to-noise ratio is stored into \*snr.
46
47
48Description
49===========
50
51This ioctl call returns the signal-to-noise ratio for the signal
52currently received by the front-end. For this command, read-only access
53to the device is sufficient.
54
55
56Return Value
57============
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-read-status.rst b/Documentation/media/uapi/dvb/fe-read-status.rst
new file mode 100644
index 000000000000..624ed9d06488
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-read-status.rst
@@ -0,0 +1,135 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_READ_STATUS:
4
5********************
6ioctl FE_READ_STATUS
7********************
8
9Name
10====
11
12FE_READ_STATUS - Returns status information about the front-end. This call only requires - read-only access to the device
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, unsigned int *status )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_READ_STATUS
29
30``status``
31 pointer to a bitmask integer filled with the values defined by enum
32 :ref:`fe_status <fe-status>`.
33
34
35Description
36===========
37
38All DVB frontend devices support the ``FE_READ_STATUS`` ioctl. It is
39used to check about the locking status of the frontend after being
40tuned. The ioctl takes a pointer to an integer where the status will be
41written.
42
43.. note:: The size of status is actually sizeof(enum fe_status), with
44 varies according with the architecture. This needs to be fixed in the
45 future.
46
47
48.. _fe-status-t:
49
50int fe_status
51=============
52
53The fe_status parameter is used to indicate the current state and/or
54state changes of the frontend hardware. It is produced using the enum
55:ref:`fe_status <fe-status>` values on a bitmask
56
57
58.. _fe-status:
59
60.. flat-table:: enum fe_status
61 :header-rows: 1
62 :stub-columns: 0
63
64
65 - .. row 1
66
67 - ID
68
69 - Description
70
71 - .. row 2
72
73 - .. _FE-HAS-SIGNAL:
74
75 ``FE_HAS_SIGNAL``
76
77 - The frontend has found something above the noise level
78
79 - .. row 3
80
81 - .. _FE-HAS-CARRIER:
82
83 ``FE_HAS_CARRIER``
84
85 - The frontend has found a DVB signal
86
87 - .. row 4
88
89 - .. _FE-HAS-VITERBI:
90
91 ``FE_HAS_VITERBI``
92
93 - The frontend FEC inner coding (Viterbi, LDPC or other inner code)
94 is stable
95
96 - .. row 5
97
98 - .. _FE-HAS-SYNC:
99
100 ``FE_HAS_SYNC``
101
102 - Synchronization bytes was found
103
104 - .. row 6
105
106 - .. _FE-HAS-LOCK:
107
108 ``FE_HAS_LOCK``
109
110 - The DVB were locked and everything is working
111
112 - .. row 7
113
114 - .. _FE-TIMEDOUT:
115
116 ``FE_TIMEDOUT``
117
118 - no lock within the last about 2 seconds
119
120 - .. row 8
121
122 - .. _FE-REINIT:
123
124 ``FE_REINIT``
125
126 - The frontend was reinitialized, application is recommended to
127 reset DiSEqC, tone and parameters
128
129
130Return Value
131============
132
133On success 0 is returned, on error -1 and the ``errno`` variable is set
134appropriately. The generic error codes are described at the
135:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-read-uncorrected-blocks.rst b/Documentation/media/uapi/dvb/fe-read-uncorrected-blocks.rst
new file mode 100644
index 000000000000..5c29c058dfdc
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-read-uncorrected-blocks.rst
@@ -0,0 +1,65 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_READ_UNCORRECTED_BLOCKS:
4
5**************************
6FE_READ_UNCORRECTED_BLOCKS
7**************************
8
9Name
10====
11
12FE_READ_UNCORRECTED_BLOCKS
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request =FE_READ_UNCORRECTED_BLOCKS, uint32_t *ublocks)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals
40 :ref:`FE_READ_UNCORRECTED_BLOCKS`
41 for this command.
42
43 - .. row 3
44
45 - uint32_t \*ublocks
46
47 - The total number of uncorrected blocks seen by the driver so far.
48
49
50Description
51===========
52
53This ioctl call returns the number of uncorrected blocks detected by the
54device driver during its lifetime. For meaningful measurements, the
55increment in block count during a specific time interval should be
56calculated. For this command, read-only access to the device is
57sufficient.
58
59
60Return Value
61============
62
63On success 0 is returned, on error -1 and the ``errno`` variable is set
64appropriately. The generic error codes are described at the
65:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-set-frontend-tune-mode.rst b/Documentation/media/uapi/dvb/fe-set-frontend-tune-mode.rst
new file mode 100644
index 000000000000..411abcf4de58
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-set-frontend-tune-mode.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_SET_FRONTEND_TUNE_MODE:
4
5*******************************
6ioctl FE_SET_FRONTEND_TUNE_MODE
7*******************************
8
9Name
10====
11
12FE_SET_FRONTEND_TUNE_MODE - Allow setting tuner mode flags to the frontend.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, unsigned int flags )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_FRONTEND_TUNE_MODE
29
30``flags``
31 Valid flags:
32
33 - 0 - normal tune mode
34
35 - FE_TUNE_MODE_ONESHOT - When set, this flag will disable any
36 zigzagging or other "normal" tuning behaviour. Additionally,
37 there will be no automatic monitoring of the lock status, and
38 hence no frontend events will be generated. If a frontend device
39 is closed, this flag will be automatically turned off when the
40 device is reopened read-write.
41
42
43Description
44===========
45
46Allow setting tuner mode flags to the frontend, between 0 (normal) or
47FE_TUNE_MODE_ONESHOT mode
48
49
50Return Value
51============
52
53On success 0 is returned, on error -1 and the ``errno`` variable is set
54appropriately. The generic error codes are described at the
55:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-set-frontend.rst b/Documentation/media/uapi/dvb/fe-set-frontend.rst
new file mode 100644
index 000000000000..7cb70c38d534
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-set-frontend.rst
@@ -0,0 +1,79 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_SET_FRONTEND:
4
5***************
6FE_SET_FRONTEND
7***************
8
9Name
10====
11
12FE_SET_FRONTEND
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl(int fd, int request = FE_SET_FRONTEND, struct dvb_frontend_parameters *p)
19
20
21Arguments
22=========
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals :ref:`FE_SET_FRONTEND` for this
40 command.
41
42 - .. row 3
43
44 - struct dvb_frontend_parameters \*p
45
46 - Points to parameters for tuning operation.
47
48
49Description
50===========
51
52This ioctl call starts a tuning operation using specified parameters.
53The result of this call will be successful if the parameters were valid
54and the tuning could be initiated. The result of the tuning operation in
55itself, however, will arrive asynchronously as an event (see
56documentation for :ref:`FE_GET_EVENT` and
57FrontendEvent.) If a new :ref:`FE_SET_FRONTEND`
58operation is initiated before the previous one was completed, the
59previous operation will be aborted in favor of the new one. This command
60requires read/write access to the device.
61
62
63Return Value
64============
65
66On success 0 is returned, on error -1 and the ``errno`` variable is set
67appropriately. The generic error codes are described at the
68:ref:`Generic Error Codes <gen-errors>` chapter.
69
70.. flat-table::
71 :header-rows: 0
72 :stub-columns: 0
73
74
75 - .. row 1
76
77 - ``EINVAL``
78
79 - Maximum supported symbol rate reached.
diff --git a/Documentation/media/uapi/dvb/fe-set-tone.rst b/Documentation/media/uapi/dvb/fe-set-tone.rst
new file mode 100644
index 000000000000..545e2afba2c0
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-set-tone.rst
@@ -0,0 +1,91 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_SET_TONE:
4
5*****************
6ioctl FE_SET_TONE
7*****************
8
9Name
10====
11
12FE_SET_TONE - Sets/resets the generation of the continuous 22kHz tone.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, enum fe_sec_tone_mode *tone )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_TONE
29
30``tone``
31 pointer to enum :ref:`fe_sec_tone_mode <fe-sec-tone-mode>`
32
33
34Description
35===========
36
37This ioctl is used to set the generation of the continuous 22kHz tone.
38This call requires read/write permissions.
39
40Usually, satellite antenna subsystems require that the digital TV device
41to send a 22kHz tone in order to select between high/low band on some
42dual-band LNBf. It is also used to send signals to DiSEqC equipment, but
43this is done using the DiSEqC ioctls.
44
45.. attention:: If more than one device is connected to the same antenna,
46 setting a tone may interfere on other devices, as they may lose the
47 capability of selecting the band. So, it is recommended that applications
48 would change to SEC_TONE_OFF when the device is not used.
49
50.. _fe-sec-tone-mode-t:
51
52enum fe_sec_tone_mode
53=====================
54
55.. _fe-sec-tone-mode:
56
57.. flat-table:: enum fe_sec_tone_mode
58 :header-rows: 1
59 :stub-columns: 0
60
61
62 - .. row 1
63
64 - ID
65
66 - Description
67
68 - .. row 2
69
70 - .. _SEC-TONE-ON:
71
72 ``SEC_TONE_ON``
73
74 - Sends a 22kHz tone burst to the antenna
75
76 - .. row 3
77
78 - .. _SEC-TONE-OFF:
79
80 ``SEC_TONE_OFF``
81
82 - Don't send a 22kHz tone to the antenna (except if the
83 FE_DISEQC_* ioctls are called)
84
85
86Return Value
87============
88
89On success 0 is returned, on error -1 and the ``errno`` variable is set
90appropriately. The generic error codes are described at the
91:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-set-voltage.rst b/Documentation/media/uapi/dvb/fe-set-voltage.rst
new file mode 100644
index 000000000000..2b19086b660a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-set-voltage.rst
@@ -0,0 +1,63 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _FE_SET_VOLTAGE:
4
5********************
6ioctl FE_SET_VOLTAGE
7********************
8
9Name
10====
11
12FE_SET_VOLTAGE - Allow setting the DC level sent to the antenna subsystem.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, enum fe_sec_voltage *voltage )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_VOLTAGE
29
30``voltage``
31 pointer to enum :ref:`fe_sec_voltage <fe-sec-voltage>`
32
33 Valid values are described at enum
34 :ref:`fe_sec_voltage <fe-sec-voltage>`.
35
36
37Description
38===========
39
40This ioctl allows to set the DC voltage level sent through the antenna
41cable to 13V, 18V or off.
42
43Usually, a satellite antenna subsystems require that the digital TV
44device to send a DC voltage to feed power to the LNBf. Depending on the
45LNBf type, the polarization or the intermediate frequency (IF) of the
46LNBf can controlled by the voltage level. Other devices (for example,
47the ones that implement DISEqC and multipoint LNBf's don't need to
48control the voltage level, provided that either 13V or 18V is sent to
49power up the LNBf.
50
51.. attention:: if more than one device is connected to the same antenna,
52 setting a voltage level may interfere on other devices, as they may lose
53 the capability of setting polarization or IF. So, on those cases, setting
54 the voltage to SEC_VOLTAGE_OFF while the device is not is used is
55 recommended.
56
57
58Return Value
59============
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/fe-type-t.rst b/Documentation/media/uapi/dvb/fe-type-t.rst
new file mode 100644
index 000000000000..8ca762b42e4d
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe-type-t.rst
@@ -0,0 +1,91 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _fe-type-t:
4
5*************
6Frontend type
7*************
8
9For historical reasons, frontend types are named by the type of
10modulation used in transmission. The fontend types are given by
11fe_type_t type, defined as:
12
13
14.. _fe-type:
15
16.. flat-table:: Frontend types
17 :header-rows: 1
18 :stub-columns: 0
19 :widths: 3 1 4
20
21
22 - .. row 1
23
24 - fe_type
25
26 - Description
27
28 - :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` equivalent
29 type
30
31 - .. row 2
32
33 - .. _FE-QPSK:
34
35 ``FE_QPSK``
36
37 - For DVB-S standard
38
39 - ``SYS_DVBS``
40
41 - .. row 3
42
43 - .. _FE-QAM:
44
45 ``FE_QAM``
46
47 - For DVB-C annex A standard
48
49 - ``SYS_DVBC_ANNEX_A``
50
51 - .. row 4
52
53 - .. _FE-OFDM:
54
55 ``FE_OFDM``
56
57 - For DVB-T standard
58
59 - ``SYS_DVBT``
60
61 - .. row 5
62
63 - .. _FE-ATSC:
64
65 ``FE_ATSC``
66
67 - For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used
68 in US.
69
70 - ``SYS_ATSC`` (terrestrial) or ``SYS_DVBC_ANNEX_B`` (cable)
71
72
73Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described
74at the above, as they're supported via the new
75:ref:`FE_GET_PROPERTY/FE_GET_SET_PROPERTY <FE_GET_PROPERTY>`
76ioctl's, using the :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
77parameter.
78
79In the old days, struct :ref:`dvb_frontend_info <dvb-frontend-info>`
80used to contain ``fe_type_t`` field to indicate the delivery systems,
81filled with either FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC. While this
82is still filled to keep backward compatibility, the usage of this field
83is deprecated, as it can report just one delivery system, but some
84devices support multiple delivery systems. Please use
85:ref:`DTV_ENUM_DELSYS <DTV-ENUM-DELSYS>` instead.
86
87On devices that support multiple delivery systems, struct
88:ref:`dvb_frontend_info <dvb-frontend-info>`::``fe_type_t`` is
89filled with the currently standard, as selected by the last call to
90:ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` using the
91:ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` property.
diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst b/Documentation/media/uapi/dvb/fe_property_parameters.rst
new file mode 100644
index 000000000000..f776d62523da
--- /dev/null
+++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst
@@ -0,0 +1,1979 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _fe_property_parameters:
4
5******************************
6Digital TV property parameters
7******************************
8
9
10.. _DTV-UNDEFINED:
11
12DTV_UNDEFINED
13=============
14
15Used internally. A GET/SET operation for it won't change or return
16anything.
17
18
19.. _DTV-TUNE:
20
21DTV_TUNE
22========
23
24Interpret the cache of data, build either a traditional frontend
25tunerequest so we can pass validation in the ``FE_SET_FRONTEND`` ioctl.
26
27
28.. _DTV-CLEAR:
29
30DTV_CLEAR
31=========
32
33Reset a cache of data specific to the frontend here. This does not
34effect hardware.
35
36
37.. _DTV-FREQUENCY:
38
39DTV_FREQUENCY
40=============
41
42Frequency of the digital TV transponder/channel.
43
44.. note::
45
46 #. For satellite delivery systems, the frequency is in kHz.
47
48 #. For cable and terrestrial delivery systems, the frequency is in
49 Hz.
50
51 #. On most delivery systems, the frequency is the center frequency
52 of the transponder/channel. The exception is for ISDB-T, where
53 the main carrier has a 1/7 offset from the center.
54
55 #. For ISDB-T, the channels are usually transmitted with an offset of
56 about 143kHz. E.g. a valid frequency could be 474,143 kHz. The
57 stepping is bound to the bandwidth of the channel which is
58 typically 6MHz.
59
60 #. In ISDB-Tsb, the channel consists of only one or three segments the
61 frequency step is 429kHz, 3*429 respectively.
62
63
64.. _DTV-MODULATION:
65
66DTV_MODULATION
67==============
68
69Specifies the frontend modulation type for delivery systems that
70supports more than one modulation type. The modulation can be one of the
71types defined by enum :ref:`fe_modulation <fe-modulation>`.
72
73
74.. _fe-modulation-t:
75
76Modulation property
77-------------------
78
79Most of the digital TV standards currently offers more than one possible
80modulation (sometimes called as "constellation" on some standards). This
81enum contains the values used by the Kernel. Please note that not all
82modulations are supported by a given standard.
83
84
85.. _fe-modulation:
86
87.. flat-table:: enum fe_modulation
88 :header-rows: 1
89 :stub-columns: 0
90
91
92 - .. row 1
93
94 - ID
95
96 - Description
97
98 - .. row 2
99
100 - .. _QPSK:
101
102 ``QPSK``
103
104 - QPSK modulation
105
106 - .. row 3
107
108 - .. _QAM-16:
109
110 ``QAM_16``
111
112 - 16-QAM modulation
113
114 - .. row 4
115
116 - .. _QAM-32:
117
118 ``QAM_32``
119
120 - 32-QAM modulation
121
122 - .. row 5
123
124 - .. _QAM-64:
125
126 ``QAM_64``
127
128 - 64-QAM modulation
129
130 - .. row 6
131
132 - .. _QAM-128:
133
134 ``QAM_128``
135
136 - 128-QAM modulation
137
138 - .. row 7
139
140 - .. _QAM-256:
141
142 ``QAM_256``
143
144 - 256-QAM modulation
145
146 - .. row 8
147
148 - .. _QAM-AUTO:
149
150 ``QAM_AUTO``
151
152 - Autodetect QAM modulation
153
154 - .. row 9
155
156 - .. _VSB-8:
157
158 ``VSB_8``
159
160 - 8-VSB modulation
161
162 - .. row 10
163
164 - .. _VSB-16:
165
166 ``VSB_16``
167
168 - 16-VSB modulation
169
170 - .. row 11
171
172 - .. _PSK-8:
173
174 ``PSK_8``
175
176 - 8-PSK modulation
177
178 - .. row 12
179
180 - .. _APSK-16:
181
182 ``APSK_16``
183
184 - 16-APSK modulation
185
186 - .. row 13
187
188 - .. _APSK-32:
189
190 ``APSK_32``
191
192 - 32-APSK modulation
193
194 - .. row 14
195
196 - .. _DQPSK:
197
198 ``DQPSK``
199
200 - DQPSK modulation
201
202 - .. row 15
203
204 - .. _QAM-4-NR:
205
206 ``QAM_4_NR``
207
208 - 4-QAM-NR modulation
209
210
211
212.. _DTV-BANDWIDTH-HZ:
213
214DTV_BANDWIDTH_HZ
215================
216
217Bandwidth for the channel, in HZ.
218
219Possible values: ``1712000``, ``5000000``, ``6000000``, ``7000000``,
220``8000000``, ``10000000``.
221
222.. note::
223
224 #. DVB-T supports 6, 7 and 8MHz.
225
226 #. DVB-T2 supports 1.172, 5, 6, 7, 8 and 10MHz.
227
228 #. ISDB-T supports 5MHz, 6MHz, 7MHz and 8MHz, although most
229 places use 6MHz.
230
231 #. On DVB-C and DVB-S/S2, the bandwidth depends on the symbol rate.
232 So, the Kernel will silently ignore setting :ref:`DTV-BANDWIDTH-HZ`.
233
234 #. For DVB-C and DVB-S/S2, the Kernel will return an estimation of the
235 bandwidth, calculated from :ref:`DTV-SYMBOL-RATE` and from
236 the rolloff, with is fixed for DVB-C and DVB-S.
237
238 #. For DVB-S2, the bandwidth estimation will use :ref:`DTV-ROLLOFF`.
239
240 #. For ISDB-Tsb, it can vary depending on the number of connected
241 segments.
242
243 #. Bandwidth in ISDB-Tsb can be easily derived from other parameters
244 (DTV_ISDBT_SB_SEGMENT_IDX, DTV_ISDBT_SB_SEGMENT_COUNT).
245
246
247.. _DTV-INVERSION:
248
249DTV_INVERSION
250=============
251
252Specifies if the frontend should do spectral inversion or not.
253
254
255.. _fe-spectral-inversion-t:
256
257enum fe_modulation: Frontend spectral inversion
258-----------------------------------------------
259
260This parameter indicates if spectral inversion should be presumed or
261not. In the automatic setting (``INVERSION_AUTO``) the hardware will try
262to figure out the correct setting by itself. If the hardware doesn't
263support, the DVB core will try to lock at the carrier first with
264inversion off. If it fails, it will try to enable inversion.
265
266
267.. _fe-spectral-inversion:
268
269.. flat-table:: enum fe_modulation
270 :header-rows: 1
271 :stub-columns: 0
272
273
274 - .. row 1
275
276 - ID
277
278 - Description
279
280 - .. row 2
281
282 - .. _INVERSION-OFF:
283
284 ``INVERSION_OFF``
285
286 - Don't do spectral band inversion.
287
288 - .. row 3
289
290 - .. _INVERSION-ON:
291
292 ``INVERSION_ON``
293
294 - Do spectral band inversion.
295
296 - .. row 4
297
298 - .. _INVERSION-AUTO:
299
300 ``INVERSION_AUTO``
301
302 - Autodetect spectral band inversion.
303
304
305
306.. _DTV-DISEQC-MASTER:
307
308DTV_DISEQC_MASTER
309=================
310
311Currently not implemented.
312
313
314.. _DTV-SYMBOL-RATE:
315
316DTV_SYMBOL_RATE
317===============
318
319Digital TV symbol rate, in bauds (symbols/second). Used on cable
320standards.
321
322
323.. _DTV-INNER-FEC:
324
325DTV_INNER_FEC
326=============
327
328Used cable/satellite transmissions. The acceptable values are:
329
330
331.. _fe-code-rate-t:
332
333enum fe_code_rate: type of the Forward Error Correction.
334--------------------------------------------------------
335
336
337.. _fe-code-rate:
338
339.. flat-table:: enum fe_code_rate
340 :header-rows: 1
341 :stub-columns: 0
342
343
344 - .. row 1
345
346 - ID
347
348 - Description
349
350 - .. row 2
351
352 - .. _FEC-NONE:
353
354 ``FEC_NONE``
355
356 - No Forward Error Correction Code
357
358 - .. row 3
359
360 - .. _FEC-AUTO:
361
362 ``FEC_AUTO``
363
364 - Autodetect Error Correction Code
365
366 - .. row 4
367
368 - .. _FEC-1-2:
369
370 ``FEC_1_2``
371
372 - Forward Error Correction Code 1/2
373
374 - .. row 5
375
376 - .. _FEC-2-3:
377
378 ``FEC_2_3``
379
380 - Forward Error Correction Code 2/3
381
382 - .. row 6
383
384 - .. _FEC-3-4:
385
386 ``FEC_3_4``
387
388 - Forward Error Correction Code 3/4
389
390 - .. row 7
391
392 - .. _FEC-4-5:
393
394 ``FEC_4_5``
395
396 - Forward Error Correction Code 4/5
397
398 - .. row 8
399
400 - .. _FEC-5-6:
401
402 ``FEC_5_6``
403
404 - Forward Error Correction Code 5/6
405
406 - .. row 9
407
408 - .. _FEC-6-7:
409
410 ``FEC_6_7``
411
412 - Forward Error Correction Code 6/7
413
414 - .. row 10
415
416 - .. _FEC-7-8:
417
418 ``FEC_7_8``
419
420 - Forward Error Correction Code 7/8
421
422 - .. row 11
423
424 - .. _FEC-8-9:
425
426 ``FEC_8_9``
427
428 - Forward Error Correction Code 8/9
429
430 - .. row 12
431
432 - .. _FEC-9-10:
433
434 ``FEC_9_10``
435
436 - Forward Error Correction Code 9/10
437
438 - .. row 13
439
440 - .. _FEC-2-5:
441
442 ``FEC_2_5``
443
444 - Forward Error Correction Code 2/5
445
446 - .. row 14
447
448 - .. _FEC-3-5:
449
450 ``FEC_3_5``
451
452 - Forward Error Correction Code 3/5
453
454
455
456.. _DTV-VOLTAGE:
457
458DTV_VOLTAGE
459===========
460
461The voltage is usually used with non-DiSEqC capable LNBs to switch the
462polarzation (horizontal/vertical). When using DiSEqC epuipment this
463voltage has to be switched consistently to the DiSEqC commands as
464described in the DiSEqC spec.
465
466
467.. _fe-sec-voltage:
468
469.. flat-table:: enum fe_sec_voltage
470 :header-rows: 1
471 :stub-columns: 0
472
473
474 - .. row 1
475
476 - ID
477
478 - Description
479
480 - .. row 2
481
482 - .. _SEC-VOLTAGE-13:
483
484 ``SEC_VOLTAGE_13``
485
486 - Set DC voltage level to 13V
487
488 - .. row 3
489
490 - .. _SEC-VOLTAGE-18:
491
492 ``SEC_VOLTAGE_18``
493
494 - Set DC voltage level to 18V
495
496 - .. row 4
497
498 - .. _SEC-VOLTAGE-OFF:
499
500 ``SEC_VOLTAGE_OFF``
501
502 - Don't send any voltage to the antenna
503
504
505
506.. _DTV-TONE:
507
508DTV_TONE
509========
510
511Currently not used.
512
513
514.. _DTV-PILOT:
515
516DTV_PILOT
517=========
518
519Sets DVB-S2 pilot
520
521
522.. _fe-pilot-t:
523
524fe_pilot type
525-------------
526
527
528.. _fe-pilot:
529
530.. flat-table:: enum fe_pilot
531 :header-rows: 1
532 :stub-columns: 0
533
534
535 - .. row 1
536
537 - ID
538
539 - Description
540
541 - .. row 2
542
543 - .. _PILOT-ON:
544
545 ``PILOT_ON``
546
547 - Pilot tones enabled
548
549 - .. row 3
550
551 - .. _PILOT-OFF:
552
553 ``PILOT_OFF``
554
555 - Pilot tones disabled
556
557 - .. row 4
558
559 - .. _PILOT-AUTO:
560
561 ``PILOT_AUTO``
562
563 - Autodetect pilot tones
564
565
566
567.. _DTV-ROLLOFF:
568
569DTV_ROLLOFF
570===========
571
572Sets DVB-S2 rolloff
573
574
575.. _fe-rolloff-t:
576
577fe_rolloff type
578---------------
579
580
581.. _fe-rolloff:
582
583.. flat-table:: enum fe_rolloff
584 :header-rows: 1
585 :stub-columns: 0
586
587
588 - .. row 1
589
590 - ID
591
592 - Description
593
594 - .. row 2
595
596 - .. _ROLLOFF-35:
597
598 ``ROLLOFF_35``
599
600 - Roloff factor: α=35%
601
602 - .. row 3
603
604 - .. _ROLLOFF-20:
605
606 ``ROLLOFF_20``
607
608 - Roloff factor: α=20%
609
610 - .. row 4
611
612 - .. _ROLLOFF-25:
613
614 ``ROLLOFF_25``
615
616 - Roloff factor: α=25%
617
618 - .. row 5
619
620 - .. _ROLLOFF-AUTO:
621
622 ``ROLLOFF_AUTO``
623
624 - Auto-detect the roloff factor.
625
626
627
628.. _DTV-DISEQC-SLAVE-REPLY:
629
630DTV_DISEQC_SLAVE_REPLY
631======================
632
633Currently not implemented.
634
635
636.. _DTV-FE-CAPABILITY-COUNT:
637
638DTV_FE_CAPABILITY_COUNT
639=======================
640
641Currently not implemented.
642
643
644.. _DTV-FE-CAPABILITY:
645
646DTV_FE_CAPABILITY
647=================
648
649Currently not implemented.
650
651
652.. _DTV-DELIVERY-SYSTEM:
653
654DTV_DELIVERY_SYSTEM
655===================
656
657Specifies the type of Delivery system
658
659
660.. _fe-delivery-system-t:
661
662fe_delivery_system type
663-----------------------
664
665Possible values:
666
667
668.. _fe-delivery-system:
669
670.. flat-table:: enum fe_delivery_system
671 :header-rows: 1
672 :stub-columns: 0
673
674
675 - .. row 1
676
677 - ID
678
679 - Description
680
681 - .. row 2
682
683 - .. _SYS-UNDEFINED:
684
685 ``SYS_UNDEFINED``
686
687 - Undefined standard. Generally, indicates an error
688
689 - .. row 3
690
691 - .. _SYS-DVBC-ANNEX-A:
692
693 ``SYS_DVBC_ANNEX_A``
694
695 - Cable TV: DVB-C following ITU-T J.83 Annex A spec
696
697 - .. row 4
698
699 - .. _SYS-DVBC-ANNEX-B:
700
701 ``SYS_DVBC_ANNEX_B``
702
703 - Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
704
705 - .. row 5
706
707 - .. _SYS-DVBC-ANNEX-C:
708
709 ``SYS_DVBC_ANNEX_C``
710
711 - Cable TV: DVB-C following ITU-T J.83 Annex C spec
712
713 - .. row 6
714
715 - .. _SYS-ISDBC:
716
717 ``SYS_ISDBC``
718
719 - Cable TV: ISDB-C (no drivers yet)
720
721 - .. row 7
722
723 - .. _SYS-DVBT:
724
725 ``SYS_DVBT``
726
727 - Terrestral TV: DVB-T
728
729 - .. row 8
730
731 - .. _SYS-DVBT2:
732
733 ``SYS_DVBT2``
734
735 - Terrestral TV: DVB-T2
736
737 - .. row 9
738
739 - .. _SYS-ISDBT:
740
741 ``SYS_ISDBT``
742
743 - Terrestral TV: ISDB-T
744
745 - .. row 10
746
747 - .. _SYS-ATSC:
748
749 ``SYS_ATSC``
750
751 - Terrestral TV: ATSC
752
753 - .. row 11
754
755 - .. _SYS-ATSCMH:
756
757 ``SYS_ATSCMH``
758
759 - Terrestral TV (mobile): ATSC-M/H
760
761 - .. row 12
762
763 - .. _SYS-DTMB:
764
765 ``SYS_DTMB``
766
767 - Terrestrial TV: DTMB
768
769 - .. row 13
770
771 - .. _SYS-DVBS:
772
773 ``SYS_DVBS``
774
775 - Satellite TV: DVB-S
776
777 - .. row 14
778
779 - .. _SYS-DVBS2:
780
781 ``SYS_DVBS2``
782
783 - Satellite TV: DVB-S2
784
785 - .. row 15
786
787 - .. _SYS-TURBO:
788
789 ``SYS_TURBO``
790
791 - Satellite TV: DVB-S Turbo
792
793 - .. row 16
794
795 - .. _SYS-ISDBS:
796
797 ``SYS_ISDBS``
798
799 - Satellite TV: ISDB-S
800
801 - .. row 17
802
803 - .. _SYS-DAB:
804
805 ``SYS_DAB``
806
807 - Digital audio: DAB (not fully supported)
808
809 - .. row 18
810
811 - .. _SYS-DSS:
812
813 ``SYS_DSS``
814
815 - Satellite TV:"DSS (not fully supported)
816
817 - .. row 19
818
819 - .. _SYS-CMMB:
820
821 ``SYS_CMMB``
822
823 - Terrestral TV (mobile):CMMB (not fully supported)
824
825 - .. row 20
826
827 - .. _SYS-DVBH:
828
829 ``SYS_DVBH``
830
831 - Terrestral TV (mobile): DVB-H (standard deprecated)
832
833
834
835.. _DTV-ISDBT-PARTIAL-RECEPTION:
836
837DTV_ISDBT_PARTIAL_RECEPTION
838===========================
839
840If ``DTV_ISDBT_SOUND_BROADCASTING`` is '0' this bit-field represents
841whether the channel is in partial reception mode or not.
842
843If '1' ``DTV_ISDBT_LAYERA_*`` values are assigned to the center segment
844and ``DTV_ISDBT_LAYERA_SEGMENT_COUNT`` has to be '1'.
845
846If in addition ``DTV_ISDBT_SOUND_BROADCASTING`` is '1'
847``DTV_ISDBT_PARTIAL_RECEPTION`` represents whether this ISDB-Tsb channel
848is consisting of one segment and layer or three segments and two layers.
849
850Possible values: 0, 1, -1 (AUTO)
851
852
853.. _DTV-ISDBT-SOUND-BROADCASTING:
854
855DTV_ISDBT_SOUND_BROADCASTING
856============================
857
858This field represents whether the other DTV_ISDBT_*-parameters are
859referring to an ISDB-T and an ISDB-Tsb channel. (See also
860``DTV_ISDBT_PARTIAL_RECEPTION``).
861
862Possible values: 0, 1, -1 (AUTO)
863
864
865.. _DTV-ISDBT-SB-SUBCHANNEL-ID:
866
867DTV_ISDBT_SB_SUBCHANNEL_ID
868==========================
869
870This field only applies if ``DTV_ISDBT_SOUND_BROADCASTING`` is '1'.
871
872(Note of the author: This might not be the correct description of the
873``SUBCHANNEL-ID`` in all details, but it is my understanding of the
874technical background needed to program a device)
875
876An ISDB-Tsb channel (1 or 3 segments) can be broadcasted alone or in a
877set of connected ISDB-Tsb channels. In this set of channels every
878channel can be received independently. The number of connected ISDB-Tsb
879segment can vary, e.g. depending on the frequency spectrum bandwidth
880available.
881
882Example: Assume 8 ISDB-Tsb connected segments are broadcasted. The
883broadcaster has several possibilities to put those channels in the air:
884Assuming a normal 13-segment ISDB-T spectrum he can align the 8 segments
885from position 1-8 to 5-13 or anything in between.
886
887The underlying layer of segments are subchannels: each segment is
888consisting of several subchannels with a predefined IDs. A sub-channel
889is used to help the demodulator to synchronize on the channel.
890
891An ISDB-T channel is always centered over all sub-channels. As for the
892example above, in ISDB-Tsb it is no longer as simple as that.
893
894``The DTV_ISDBT_SB_SUBCHANNEL_ID`` parameter is used to give the
895sub-channel ID of the segment to be demodulated.
896
897Possible values: 0 .. 41, -1 (AUTO)
898
899
900.. _DTV-ISDBT-SB-SEGMENT-IDX:
901
902DTV_ISDBT_SB_SEGMENT_IDX
903========================
904
905This field only applies if ``DTV_ISDBT_SOUND_BROADCASTING`` is '1'.
906
907``DTV_ISDBT_SB_SEGMENT_IDX`` gives the index of the segment to be
908demodulated for an ISDB-Tsb channel where several of them are
909transmitted in the connected manner.
910
911Possible values: 0 .. ``DTV_ISDBT_SB_SEGMENT_COUNT`` - 1
912
913Note: This value cannot be determined by an automatic channel search.
914
915
916.. _DTV-ISDBT-SB-SEGMENT-COUNT:
917
918DTV_ISDBT_SB_SEGMENT_COUNT
919==========================
920
921This field only applies if ``DTV_ISDBT_SOUND_BROADCASTING`` is '1'.
922
923``DTV_ISDBT_SB_SEGMENT_COUNT`` gives the total count of connected
924ISDB-Tsb channels.
925
926Possible values: 1 .. 13
927
928Note: This value cannot be determined by an automatic channel search.
929
930
931.. _isdb-hierq-layers:
932
933DTV-ISDBT-LAYER[A-C] parameters
934===============================
935
936ISDB-T channels can be coded hierarchically. As opposed to DVB-T in
937ISDB-T hierarchical layers can be decoded simultaneously. For that
938reason a ISDB-T demodulator has 3 Viterbi and 3 Reed-Solomon decoders.
939
940ISDB-T has 3 hierarchical layers which each can use a part of the
941available segments. The total number of segments over all layers has to
94213 in ISDB-T.
943
944There are 3 parameter sets, for Layers A, B and C.
945
946
947.. _DTV-ISDBT-LAYER-ENABLED:
948
949DTV_ISDBT_LAYER_ENABLED
950-----------------------
951
952Hierarchical reception in ISDB-T is achieved by enabling or disabling
953layers in the decoding process. Setting all bits of
954``DTV_ISDBT_LAYER_ENABLED`` to '1' forces all layers (if applicable) to
955be demodulated. This is the default.
956
957If the channel is in the partial reception mode
958(``DTV_ISDBT_PARTIAL_RECEPTION`` = 1) the central segment can be decoded
959independently of the other 12 segments. In that mode layer A has to have
960a ``SEGMENT_COUNT`` of 1.
961
962In ISDB-Tsb only layer A is used, it can be 1 or 3 in ISDB-Tsb according
963to ``DTV_ISDBT_PARTIAL_RECEPTION``. ``SEGMENT_COUNT`` must be filled
964accordingly.
965
966Only the values of the first 3 bits are used. Other bits will be silently ignored:
967
968``DTV_ISDBT_LAYER_ENABLED`` bit 0: layer A enabled
969
970``DTV_ISDBT_LAYER_ENABLED`` bit 1: layer B enabled
971
972``DTV_ISDBT_LAYER_ENABLED`` bit 2: layer C enabled
973
974``DTV_ISDBT_LAYER_ENABLED`` bits 3-31: unused
975
976
977.. _DTV-ISDBT-LAYER-FEC:
978
979DTV_ISDBT_LAYER[A-C]_FEC
980------------------------
981
982Possible values: ``FEC_AUTO``, ``FEC_1_2``, ``FEC_2_3``, ``FEC_3_4``,
983``FEC_5_6``, ``FEC_7_8``
984
985
986.. _DTV-ISDBT-LAYER-MODULATION:
987
988DTV_ISDBT_LAYER[A-C]_MODULATION
989-------------------------------
990
991Possible values: ``QAM_AUTO``, QP\ ``SK, QAM_16``, ``QAM_64``, ``DQPSK``
992
993Note: If layer C is ``DQPSK`` layer B has to be ``DQPSK``. If layer B is
994``DQPSK`` and ``DTV_ISDBT_PARTIAL_RECEPTION``\ =0 layer has to be
995``DQPSK``.
996
997
998.. _DTV-ISDBT-LAYER-SEGMENT-COUNT:
999
1000DTV_ISDBT_LAYER[A-C]_SEGMENT_COUNT
1001----------------------------------
1002
1003Possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1 (AUTO)
1004
1005Note: Truth table for ``DTV_ISDBT_SOUND_BROADCASTING`` and
1006``DTV_ISDBT_PARTIAL_RECEPTION`` and ``LAYER[A-C]_SEGMENT_COUNT``
1007
1008
1009.. _isdbt-layer_seg-cnt-table:
1010
1011.. flat-table::
1012 :header-rows: 0
1013 :stub-columns: 0
1014
1015
1016 - .. row 1
1017
1018 - PR
1019
1020 - SB
1021
1022 - Layer A width
1023
1024 - Layer B width
1025
1026 - Layer C width
1027
1028 - total width
1029
1030 - .. row 2
1031
1032 - 0
1033
1034 - 0
1035
1036 - 1 .. 13
1037
1038 - 1 .. 13
1039
1040 - 1 .. 13
1041
1042 - 13
1043
1044 - .. row 3
1045
1046 - 1
1047
1048 - 0
1049
1050 - 1
1051
1052 - 1 .. 13
1053
1054 - 1 .. 13
1055
1056 - 13
1057
1058 - .. row 4
1059
1060 - 0
1061
1062 - 1
1063
1064 - 1
1065
1066 - 0
1067
1068 - 0
1069
1070 - 1
1071
1072 - .. row 5
1073
1074 - 1
1075
1076 - 1
1077
1078 - 1
1079
1080 - 2
1081
1082 - 0
1083
1084 - 13
1085
1086
1087
1088.. _DTV-ISDBT-LAYER-TIME-INTERLEAVING:
1089
1090DTV_ISDBT_LAYER[A-C]_TIME_INTERLEAVING
1091--------------------------------------
1092
1093Valid values: 0, 1, 2, 4, -1 (AUTO)
1094
1095when DTV_ISDBT_SOUND_BROADCASTING is active, value 8 is also valid.
1096
1097Note: The real time interleaving length depends on the mode (fft-size).
1098The values here are referring to what can be found in the
1099TMCC-structure, as shown in the table below.
1100
1101
1102.. _isdbt-layer-interleaving-table:
1103
1104.. flat-table::
1105 :header-rows: 0
1106 :stub-columns: 0
1107
1108
1109 - .. row 1
1110
1111 - ``DTV_ISDBT_LAYER[A-C]_TIME_INTERLEAVING``
1112
1113 - Mode 1 (2K FFT)
1114
1115 - Mode 2 (4K FFT)
1116
1117 - Mode 3 (8K FFT)
1118
1119 - .. row 2
1120
1121 - 0
1122
1123 - 0
1124
1125 - 0
1126
1127 - 0
1128
1129 - .. row 3
1130
1131 - 1
1132
1133 - 4
1134
1135 - 2
1136
1137 - 1
1138
1139 - .. row 4
1140
1141 - 2
1142
1143 - 8
1144
1145 - 4
1146
1147 - 2
1148
1149 - .. row 5
1150
1151 - 4
1152
1153 - 16
1154
1155 - 8
1156
1157 - 4
1158
1159
1160
1161.. _DTV-ATSCMH-FIC-VER:
1162
1163DTV_ATSCMH_FIC_VER
1164------------------
1165
1166Version number of the FIC (Fast Information Channel) signaling data.
1167
1168FIC is used for relaying information to allow rapid service acquisition
1169by the receiver.
1170
1171Possible values: 0, 1, 2, 3, ..., 30, 31
1172
1173
1174.. _DTV-ATSCMH-PARADE-ID:
1175
1176DTV_ATSCMH_PARADE_ID
1177--------------------
1178
1179Parade identification number
1180
1181A parade is a collection of up to eight MH groups, conveying one or two
1182ensembles.
1183
1184Possible values: 0, 1, 2, 3, ..., 126, 127
1185
1186
1187.. _DTV-ATSCMH-NOG:
1188
1189DTV_ATSCMH_NOG
1190--------------
1191
1192Number of MH groups per MH subframe for a designated parade.
1193
1194Possible values: 1, 2, 3, 4, 5, 6, 7, 8
1195
1196
1197.. _DTV-ATSCMH-TNOG:
1198
1199DTV_ATSCMH_TNOG
1200---------------
1201
1202Total number of MH groups including all MH groups belonging to all MH
1203parades in one MH subframe.
1204
1205Possible values: 0, 1, 2, 3, ..., 30, 31
1206
1207
1208.. _DTV-ATSCMH-SGN:
1209
1210DTV_ATSCMH_SGN
1211--------------
1212
1213Start group number.
1214
1215Possible values: 0, 1, 2, 3, ..., 14, 15
1216
1217
1218.. _DTV-ATSCMH-PRC:
1219
1220DTV_ATSCMH_PRC
1221--------------
1222
1223Parade repetition cycle.
1224
1225Possible values: 1, 2, 3, 4, 5, 6, 7, 8
1226
1227
1228.. _DTV-ATSCMH-RS-FRAME-MODE:
1229
1230DTV_ATSCMH_RS_FRAME_MODE
1231------------------------
1232
1233Reed Solomon (RS) frame mode.
1234
1235Possible values are:
1236
1237
1238.. _atscmh-rs-frame-mode:
1239
1240.. flat-table:: enum atscmh_rs_frame_mode
1241 :header-rows: 1
1242 :stub-columns: 0
1243
1244
1245 - .. row 1
1246
1247 - ID
1248
1249 - Description
1250
1251 - .. row 2
1252
1253 - .. _ATSCMH-RSFRAME-PRI-ONLY:
1254
1255 ``ATSCMH_RSFRAME_PRI_ONLY``
1256
1257 - Single Frame: There is only a primary RS Frame for all Group
1258 Regions.
1259
1260 - .. row 3
1261
1262 - .. _ATSCMH-RSFRAME-PRI-SEC:
1263
1264 ``ATSCMH_RSFRAME_PRI_SEC``
1265
1266 - Dual Frame: There are two separate RS Frames: Primary RS Frame for
1267 Group Region A and B and Secondary RS Frame for Group Region C and
1268 D.
1269
1270
1271
1272.. _DTV-ATSCMH-RS-FRAME-ENSEMBLE:
1273
1274DTV_ATSCMH_RS_FRAME_ENSEMBLE
1275----------------------------
1276
1277Reed Solomon(RS) frame ensemble.
1278
1279Possible values are:
1280
1281
1282.. _atscmh-rs-frame-ensemble:
1283
1284.. flat-table:: enum atscmh_rs_frame_ensemble
1285 :header-rows: 1
1286 :stub-columns: 0
1287
1288
1289 - .. row 1
1290
1291 - ID
1292
1293 - Description
1294
1295 - .. row 2
1296
1297 - .. _ATSCMH-RSFRAME-ENS-PRI:
1298
1299 ``ATSCMH_RSFRAME_ENS_PRI``
1300
1301 - Primary Ensemble.
1302
1303 - .. row 3
1304
1305 - .. _ATSCMH-RSFRAME-ENS-SEC:
1306
1307 ``AATSCMH_RSFRAME_PRI_SEC``
1308
1309 - Secondary Ensemble.
1310
1311 - .. row 4
1312
1313 - .. _ATSCMH-RSFRAME-RES:
1314
1315 ``AATSCMH_RSFRAME_RES``
1316
1317 - Reserved. Shouldn't be used.
1318
1319
1320
1321.. _DTV-ATSCMH-RS-CODE-MODE-PRI:
1322
1323DTV_ATSCMH_RS_CODE_MODE_PRI
1324---------------------------
1325
1326Reed Solomon (RS) code mode (primary).
1327
1328Possible values are:
1329
1330
1331.. _atscmh-rs-code-mode:
1332
1333.. flat-table:: enum atscmh_rs_code_mode
1334 :header-rows: 1
1335 :stub-columns: 0
1336
1337
1338 - .. row 1
1339
1340 - ID
1341
1342 - Description
1343
1344 - .. row 2
1345
1346 - .. _ATSCMH-RSCODE-211-187:
1347
1348 ``ATSCMH_RSCODE_211_187``
1349
1350 - Reed Solomon code (211,187).
1351
1352 - .. row 3
1353
1354 - .. _ATSCMH-RSCODE-223-187:
1355
1356 ``ATSCMH_RSCODE_223_187``
1357
1358 - Reed Solomon code (223,187).
1359
1360 - .. row 4
1361
1362 - .. _ATSCMH-RSCODE-235-187:
1363
1364 ``ATSCMH_RSCODE_235_187``
1365
1366 - Reed Solomon code (235,187).
1367
1368 - .. row 5
1369
1370 - .. _ATSCMH-RSCODE-RES:
1371
1372 ``ATSCMH_RSCODE_RES``
1373
1374 - Reserved. Shouldn't be used.
1375
1376
1377
1378.. _DTV-ATSCMH-RS-CODE-MODE-SEC:
1379
1380DTV_ATSCMH_RS_CODE_MODE_SEC
1381---------------------------
1382
1383Reed Solomon (RS) code mode (secondary).
1384
1385Possible values are the same as documented on enum
1386:ref:`atscmh_rs_code_mode <atscmh-rs-code-mode>`:
1387
1388
1389.. _DTV-ATSCMH-SCCC-BLOCK-MODE:
1390
1391DTV_ATSCMH_SCCC_BLOCK_MODE
1392--------------------------
1393
1394Series Concatenated Convolutional Code Block Mode.
1395
1396Possible values are:
1397
1398
1399.. _atscmh-sccc-block-mode:
1400
1401.. flat-table:: enum atscmh_scc_block_mode
1402 :header-rows: 1
1403 :stub-columns: 0
1404
1405
1406 - .. row 1
1407
1408 - ID
1409
1410 - Description
1411
1412 - .. row 2
1413
1414 - .. _ATSCMH-SCCC-BLK-SEP:
1415
1416 ``ATSCMH_SCCC_BLK_SEP``
1417
1418 - Separate SCCC: the SCCC outer code mode shall be set independently
1419 for each Group Region (A, B, C, D)
1420
1421 - .. row 3
1422
1423 - .. _ATSCMH-SCCC-BLK-COMB:
1424
1425 ``ATSCMH_SCCC_BLK_COMB``
1426
1427 - Combined SCCC: all four Regions shall have the same SCCC outer
1428 code mode.
1429
1430 - .. row 4
1431
1432 - .. _ATSCMH-SCCC-BLK-RES:
1433
1434 ``ATSCMH_SCCC_BLK_RES``
1435
1436 - Reserved. Shouldn't be used.
1437
1438
1439
1440.. _DTV-ATSCMH-SCCC-CODE-MODE-A:
1441
1442DTV_ATSCMH_SCCC_CODE_MODE_A
1443---------------------------
1444
1445Series Concatenated Convolutional Code Rate.
1446
1447Possible values are:
1448
1449
1450.. _atscmh-sccc-code-mode:
1451
1452.. flat-table:: enum atscmh_sccc_code_mode
1453 :header-rows: 1
1454 :stub-columns: 0
1455
1456
1457 - .. row 1
1458
1459 - ID
1460
1461 - Description
1462
1463 - .. row 2
1464
1465 - .. _ATSCMH-SCCC-CODE-HLF:
1466
1467 ``ATSCMH_SCCC_CODE_HLF``
1468
1469 - The outer code rate of a SCCC Block is 1/2 rate.
1470
1471 - .. row 3
1472
1473 - .. _ATSCMH-SCCC-CODE-QTR:
1474
1475 ``ATSCMH_SCCC_CODE_QTR``
1476
1477 - The outer code rate of a SCCC Block is 1/4 rate.
1478
1479 - .. row 4
1480
1481 - .. _ATSCMH-SCCC-CODE-RES:
1482
1483 ``ATSCMH_SCCC_CODE_RES``
1484
1485 - to be documented.
1486
1487
1488
1489.. _DTV-ATSCMH-SCCC-CODE-MODE-B:
1490
1491DTV_ATSCMH_SCCC_CODE_MODE_B
1492---------------------------
1493
1494Series Concatenated Convolutional Code Rate.
1495
1496Possible values are the same as documented on enum
1497:ref:`atscmh_sccc_code_mode <atscmh-sccc-code-mode>`.
1498
1499
1500.. _DTV-ATSCMH-SCCC-CODE-MODE-C:
1501
1502DTV_ATSCMH_SCCC_CODE_MODE_C
1503---------------------------
1504
1505Series Concatenated Convolutional Code Rate.
1506
1507Possible values are the same as documented on enum
1508:ref:`atscmh_sccc_code_mode <atscmh-sccc-code-mode>`.
1509
1510
1511.. _DTV-ATSCMH-SCCC-CODE-MODE-D:
1512
1513DTV_ATSCMH_SCCC_CODE_MODE_D
1514---------------------------
1515
1516Series Concatenated Convolutional Code Rate.
1517
1518Possible values are the same as documented on enum
1519:ref:`atscmh_sccc_code_mode <atscmh-sccc-code-mode>`.
1520
1521
1522.. _DTV-API-VERSION:
1523
1524DTV_API_VERSION
1525===============
1526
1527Returns the major/minor version of the DVB API
1528
1529
1530.. _DTV-CODE-RATE-HP:
1531
1532DTV_CODE_RATE_HP
1533================
1534
1535Used on terrestrial transmissions. The acceptable values are the ones
1536described at :ref:`fe_transmit_mode_t <fe-transmit-mode-t>`.
1537
1538
1539.. _DTV-CODE-RATE-LP:
1540
1541DTV_CODE_RATE_LP
1542================
1543
1544Used on terrestrial transmissions. The acceptable values are the ones
1545described at :ref:`fe_transmit_mode_t <fe-transmit-mode-t>`.
1546
1547
1548.. _DTV-GUARD-INTERVAL:
1549
1550DTV_GUARD_INTERVAL
1551==================
1552
1553Possible values are:
1554
1555
1556.. _fe-guard-interval-t:
1557
1558Modulation guard interval
1559-------------------------
1560
1561
1562.. _fe-guard-interval:
1563
1564.. flat-table:: enum fe_guard_interval
1565 :header-rows: 1
1566 :stub-columns: 0
1567
1568
1569 - .. row 1
1570
1571 - ID
1572
1573 - Description
1574
1575 - .. row 2
1576
1577 - .. _GUARD-INTERVAL-AUTO:
1578
1579 ``GUARD_INTERVAL_AUTO``
1580
1581 - Autodetect the guard interval
1582
1583 - .. row 3
1584
1585 - .. _GUARD-INTERVAL-1-128:
1586
1587 ``GUARD_INTERVAL_1_128``
1588
1589 - Guard interval 1/128
1590
1591 - .. row 4
1592
1593 - .. _GUARD-INTERVAL-1-32:
1594
1595 ``GUARD_INTERVAL_1_32``
1596
1597 - Guard interval 1/32
1598
1599 - .. row 5
1600
1601 - .. _GUARD-INTERVAL-1-16:
1602
1603 ``GUARD_INTERVAL_1_16``
1604
1605 - Guard interval 1/16
1606
1607 - .. row 6
1608
1609 - .. _GUARD-INTERVAL-1-8:
1610
1611 ``GUARD_INTERVAL_1_8``
1612
1613 - Guard interval 1/8
1614
1615 - .. row 7
1616
1617 - .. _GUARD-INTERVAL-1-4:
1618
1619 ``GUARD_INTERVAL_1_4``
1620
1621 - Guard interval 1/4
1622
1623 - .. row 8
1624
1625 - .. _GUARD-INTERVAL-19-128:
1626
1627 ``GUARD_INTERVAL_19_128``
1628
1629 - Guard interval 19/128
1630
1631 - .. row 9
1632
1633 - .. _GUARD-INTERVAL-19-256:
1634
1635 ``GUARD_INTERVAL_19_256``
1636
1637 - Guard interval 19/256
1638
1639 - .. row 10
1640
1641 - .. _GUARD-INTERVAL-PN420:
1642
1643 ``GUARD_INTERVAL_PN420``
1644
1645 - PN length 420 (1/4)
1646
1647 - .. row 11
1648
1649 - .. _GUARD-INTERVAL-PN595:
1650
1651 ``GUARD_INTERVAL_PN595``
1652
1653 - PN length 595 (1/6)
1654
1655 - .. row 12
1656
1657 - .. _GUARD-INTERVAL-PN945:
1658
1659 ``GUARD_INTERVAL_PN945``
1660
1661 - PN length 945 (1/9)
1662
1663
1664Notes:
1665
16661) If ``DTV_GUARD_INTERVAL`` is set the ``GUARD_INTERVAL_AUTO`` the
1667hardware will try to find the correct guard interval (if capable) and
1668will use TMCC to fill in the missing parameters.
1669
16702) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at
1671present
1672
16733) DTMB specifies PN420, PN595 and PN945.
1674
1675
1676.. _DTV-TRANSMISSION-MODE:
1677
1678DTV_TRANSMISSION_MODE
1679=====================
1680
1681Specifies the number of carriers used by the standard. This is used only
1682on OFTM-based standards, e. g. DVB-T/T2, ISDB-T, DTMB
1683
1684
1685.. _fe-transmit-mode-t:
1686
1687enum fe_transmit_mode: Number of carriers per channel
1688-----------------------------------------------------
1689
1690
1691.. _fe-transmit-mode:
1692
1693.. flat-table:: enum fe_transmit_mode
1694 :header-rows: 1
1695 :stub-columns: 0
1696
1697
1698 - .. row 1
1699
1700 - ID
1701
1702 - Description
1703
1704 - .. row 2
1705
1706 - .. _TRANSMISSION-MODE-AUTO:
1707
1708 ``TRANSMISSION_MODE_AUTO``
1709
1710 - Autodetect transmission mode. The hardware will try to find the
1711 correct FFT-size (if capable) to fill in the missing parameters.
1712
1713 - .. row 3
1714
1715 - .. _TRANSMISSION-MODE-1K:
1716
1717 ``TRANSMISSION_MODE_1K``
1718
1719 - Transmission mode 1K
1720
1721 - .. row 4
1722
1723 - .. _TRANSMISSION-MODE-2K:
1724
1725 ``TRANSMISSION_MODE_2K``
1726
1727 - Transmission mode 2K
1728
1729 - .. row 5
1730
1731 - .. _TRANSMISSION-MODE-8K:
1732
1733 ``TRANSMISSION_MODE_8K``
1734
1735 - Transmission mode 8K
1736
1737 - .. row 6
1738
1739 - .. _TRANSMISSION-MODE-4K:
1740
1741 ``TRANSMISSION_MODE_4K``
1742
1743 - Transmission mode 4K
1744
1745 - .. row 7
1746
1747 - .. _TRANSMISSION-MODE-16K:
1748
1749 ``TRANSMISSION_MODE_16K``
1750
1751 - Transmission mode 16K
1752
1753 - .. row 8
1754
1755 - .. _TRANSMISSION-MODE-32K:
1756
1757 ``TRANSMISSION_MODE_32K``
1758
1759 - Transmission mode 32K
1760
1761 - .. row 9
1762
1763 - .. _TRANSMISSION-MODE-C1:
1764
1765 ``TRANSMISSION_MODE_C1``
1766
1767 - Single Carrier (C=1) transmission mode (DTMB)
1768
1769 - .. row 10
1770
1771 - .. _TRANSMISSION-MODE-C3780:
1772
1773 ``TRANSMISSION_MODE_C3780``
1774
1775 - Multi Carrier (C=3780) transmission mode (DTMB)
1776
1777
1778Notes:
1779
17801) ISDB-T supports three carrier/symbol-size: 8K, 4K, 2K. It is called
1781'mode' in the standard: Mode 1 is 2K, mode 2 is 4K, mode 3 is 8K
1782
17832) If ``DTV_TRANSMISSION_MODE`` is set the ``TRANSMISSION_MODE_AUTO``
1784the hardware will try to find the correct FFT-size (if capable) and will
1785use TMCC to fill in the missing parameters.
1786
17873) DVB-T specifies 2K and 8K as valid sizes.
1788
17894) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.
1790
17915) DTMB specifies C1 and C3780.
1792
1793
1794.. _DTV-HIERARCHY:
1795
1796DTV_HIERARCHY
1797=============
1798
1799Frontend hierarchy
1800
1801
1802.. _fe-hierarchy-t:
1803
1804Frontend hierarchy
1805------------------
1806
1807
1808.. _fe-hierarchy:
1809
1810.. flat-table:: enum fe_hierarchy
1811 :header-rows: 1
1812 :stub-columns: 0
1813
1814
1815 - .. row 1
1816
1817 - ID
1818
1819 - Description
1820
1821 - .. row 2
1822
1823 - .. _HIERARCHY-NONE:
1824
1825 ``HIERARCHY_NONE``
1826
1827 - No hierarchy
1828
1829 - .. row 3
1830
1831 - .. _HIERARCHY-AUTO:
1832
1833 ``HIERARCHY_AUTO``
1834
1835 - Autodetect hierarchy (if supported)
1836
1837 - .. row 4
1838
1839 - .. _HIERARCHY-1:
1840
1841 ``HIERARCHY_1``
1842
1843 - Hierarchy 1
1844
1845 - .. row 5
1846
1847 - .. _HIERARCHY-2:
1848
1849 ``HIERARCHY_2``
1850
1851 - Hierarchy 2
1852
1853 - .. row 6
1854
1855 - .. _HIERARCHY-4:
1856
1857 ``HIERARCHY_4``
1858
1859 - Hierarchy 4
1860
1861
1862
1863.. _DTV-STREAM-ID:
1864
1865DTV_STREAM_ID
1866=============
1867
1868DVB-S2, DVB-T2 and ISDB-S support the transmission of several streams on
1869a single transport stream. This property enables the DVB driver to
1870handle substream filtering, when supported by the hardware. By default,
1871substream filtering is disabled.
1872
1873For DVB-S2 and DVB-T2, the valid substream id range is from 0 to 255.
1874
1875For ISDB, the valid substream id range is from 1 to 65535.
1876
1877To disable it, you should use the special macro NO_STREAM_ID_FILTER.
1878
1879Note: any value outside the id range also disables filtering.
1880
1881
1882.. _DTV-DVBT2-PLP-ID-LEGACY:
1883
1884DTV_DVBT2_PLP_ID_LEGACY
1885=======================
1886
1887Obsolete, replaced with DTV_STREAM_ID.
1888
1889
1890.. _DTV-ENUM-DELSYS:
1891
1892DTV_ENUM_DELSYS
1893===============
1894
1895A Multi standard frontend needs to advertise the delivery systems
1896provided. Applications need to enumerate the provided delivery systems,
1897before using any other operation with the frontend. Prior to it's
1898introduction, FE_GET_INFO was used to determine a frontend type. A
1899frontend which provides more than a single delivery system,
1900FE_GET_INFO doesn't help much. Applications which intends to use a
1901multistandard frontend must enumerate the delivery systems associated
1902with it, rather than trying to use FE_GET_INFO. In the case of a
1903legacy frontend, the result is just the same as with FE_GET_INFO, but
1904in a more structured format
1905
1906
1907.. _DTV-INTERLEAVING:
1908
1909DTV_INTERLEAVING
1910================
1911
1912Time interleaving to be used. Currently, used only on DTMB.
1913
1914
1915.. _fe-interleaving:
1916
1917.. flat-table:: enum fe_interleaving
1918 :header-rows: 1
1919 :stub-columns: 0
1920
1921
1922 - .. row 1
1923
1924 - ID
1925
1926 - Description
1927
1928 - .. row 2
1929
1930 - .. _INTERLEAVING-NONE:
1931
1932 ``INTERLEAVING_NONE``
1933
1934 - No interleaving.
1935
1936 - .. row 3
1937
1938 - .. _INTERLEAVING-AUTO:
1939
1940 ``INTERLEAVING_AUTO``
1941
1942 - Auto-detect interleaving.
1943
1944 - .. row 4
1945
1946 - .. _INTERLEAVING-240:
1947
1948 ``INTERLEAVING_240``
1949
1950 - Interleaving of 240 symbols.
1951
1952 - .. row 5
1953
1954 - .. _INTERLEAVING-720:
1955
1956 ``INTERLEAVING_720``
1957
1958 - Interleaving of 720 symbols.
1959
1960
1961
1962.. _DTV-LNA:
1963
1964DTV_LNA
1965=======
1966
1967Low-noise amplifier.
1968
1969Hardware might offer controllable LNA which can be set manually using
1970that parameter. Usually LNA could be found only from terrestrial devices
1971if at all.
1972
1973Possible values: 0, 1, LNA_AUTO
1974
19750, LNA off
1976
19771, LNA on
1978
1979use the special macro LNA_AUTO to set LNA auto
diff --git a/Documentation/media/uapi/dvb/frontend-property-cable-systems.rst b/Documentation/media/uapi/dvb/frontend-property-cable-systems.rst
new file mode 100644
index 000000000000..bf2328627af5
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend-property-cable-systems.rst
@@ -0,0 +1,75 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend-property-cable-systems:
4
5*****************************************
6Properties used on cable delivery systems
7*****************************************
8
9
10.. _dvbc-params:
11
12DVB-C delivery system
13=====================
14
15The DVB-C Annex-A is the widely used cable standard. Transmission uses
16QAM modulation.
17
18The DVB-C Annex-C is optimized for 6MHz, and is used in Japan. It
19supports a subset of the Annex A modulation types, and a roll-off of
200.13, instead of 0.15
21
22The following parameters are valid for DVB-C Annex A/C:
23
24- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
25
26- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
27
28- :ref:`DTV_TUNE <DTV-TUNE>`
29
30- :ref:`DTV_CLEAR <DTV-CLEAR>`
31
32- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
33
34- :ref:`DTV_MODULATION <DTV-MODULATION>`
35
36- :ref:`DTV_INVERSION <DTV-INVERSION>`
37
38- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
39
40- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
41
42- :ref:`DTV_LNA <DTV-LNA>`
43
44In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
45are also valid.
46
47
48.. _dvbc-annex-b-params:
49
50DVB-C Annex B delivery system
51=============================
52
53The DVB-C Annex-B is only used on a few Countries like the United
54States.
55
56The following parameters are valid for DVB-C Annex B:
57
58- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
59
60- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
61
62- :ref:`DTV_TUNE <DTV-TUNE>`
63
64- :ref:`DTV_CLEAR <DTV-CLEAR>`
65
66- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
67
68- :ref:`DTV_MODULATION <DTV-MODULATION>`
69
70- :ref:`DTV_INVERSION <DTV-INVERSION>`
71
72- :ref:`DTV_LNA <DTV-LNA>`
73
74In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
75are also valid.
diff --git a/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst b/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst
new file mode 100644
index 000000000000..1f40399c68ff
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst
@@ -0,0 +1,103 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend-property-satellite-systems:
4
5*********************************************
6Properties used on satellite delivery systems
7*********************************************
8
9
10.. _dvbs-params:
11
12DVB-S delivery system
13=====================
14
15The following parameters are valid for DVB-S:
16
17- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
18
19- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
20
21- :ref:`DTV_TUNE <DTV-TUNE>`
22
23- :ref:`DTV_CLEAR <DTV-CLEAR>`
24
25- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
26
27- :ref:`DTV_INVERSION <DTV-INVERSION>`
28
29- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
30
31- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
32
33- :ref:`DTV_VOLTAGE <DTV-VOLTAGE>`
34
35- :ref:`DTV_TONE <DTV-TONE>`
36
37In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
38are also valid.
39
40Future implementations might add those two missing parameters:
41
42- :ref:`DTV_DISEQC_MASTER <DTV-DISEQC-MASTER>`
43
44- :ref:`DTV_DISEQC_SLAVE_REPLY <DTV-DISEQC-SLAVE-REPLY>`
45
46
47.. _dvbs2-params:
48
49DVB-S2 delivery system
50======================
51
52In addition to all parameters valid for DVB-S, DVB-S2 supports the
53following parameters:
54
55- :ref:`DTV_MODULATION <DTV-MODULATION>`
56
57- :ref:`DTV_PILOT <DTV-PILOT>`
58
59- :ref:`DTV_ROLLOFF <DTV-ROLLOFF>`
60
61- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
62
63In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
64are also valid.
65
66
67.. _turbo-params:
68
69Turbo code delivery system
70==========================
71
72In addition to all parameters valid for DVB-S, turbo code supports the
73following parameters:
74
75- :ref:`DTV_MODULATION <DTV-MODULATION>`
76
77
78.. _isdbs-params:
79
80ISDB-S delivery system
81======================
82
83The following parameters are valid for ISDB-S:
84
85- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
86
87- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
88
89- :ref:`DTV_TUNE <DTV-TUNE>`
90
91- :ref:`DTV_CLEAR <DTV-CLEAR>`
92
93- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
94
95- :ref:`DTV_INVERSION <DTV-INVERSION>`
96
97- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
98
99- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
100
101- :ref:`DTV_VOLTAGE <DTV-VOLTAGE>`
102
103- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
diff --git a/Documentation/media/uapi/dvb/frontend-property-terrestrial-systems.rst b/Documentation/media/uapi/dvb/frontend-property-terrestrial-systems.rst
new file mode 100644
index 000000000000..dbc717cad9ee
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend-property-terrestrial-systems.rst
@@ -0,0 +1,294 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend-property-terrestrial-systems:
4
5***********************************************
6Properties used on terrestrial delivery systems
7***********************************************
8
9
10.. _dvbt-params:
11
12DVB-T delivery system
13=====================
14
15The following parameters are valid for DVB-T:
16
17- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
18
19- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
20
21- :ref:`DTV_TUNE <DTV-TUNE>`
22
23- :ref:`DTV_CLEAR <DTV-CLEAR>`
24
25- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
26
27- :ref:`DTV_MODULATION <DTV-MODULATION>`
28
29- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
30
31- :ref:`DTV_INVERSION <DTV-INVERSION>`
32
33- :ref:`DTV_CODE_RATE_HP <DTV-CODE-RATE-HP>`
34
35- :ref:`DTV_CODE_RATE_LP <DTV-CODE-RATE-LP>`
36
37- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
38
39- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
40
41- :ref:`DTV_HIERARCHY <DTV-HIERARCHY>`
42
43- :ref:`DTV_LNA <DTV-LNA>`
44
45In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
46are also valid.
47
48
49.. _dvbt2-params:
50
51DVB-T2 delivery system
52======================
53
54DVB-T2 support is currently in the early stages of development, so
55expect that this section maygrow and become more detailed with time.
56
57The following parameters are valid for DVB-T2:
58
59- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
60
61- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
62
63- :ref:`DTV_TUNE <DTV-TUNE>`
64
65- :ref:`DTV_CLEAR <DTV-CLEAR>`
66
67- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
68
69- :ref:`DTV_MODULATION <DTV-MODULATION>`
70
71- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
72
73- :ref:`DTV_INVERSION <DTV-INVERSION>`
74
75- :ref:`DTV_CODE_RATE_HP <DTV-CODE-RATE-HP>`
76
77- :ref:`DTV_CODE_RATE_LP <DTV-CODE-RATE-LP>`
78
79- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
80
81- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
82
83- :ref:`DTV_HIERARCHY <DTV-HIERARCHY>`
84
85- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
86
87- :ref:`DTV_LNA <DTV-LNA>`
88
89In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
90are also valid.
91
92
93.. _isdbt:
94
95ISDB-T delivery system
96======================
97
98This ISDB-T/ISDB-Tsb API extension should reflect all information needed
99to tune any ISDB-T/ISDB-Tsb hardware. Of course it is possible that some
100very sophisticated devices won't need certain parameters to tune.
101
102The information given here should help application writers to know how
103to handle ISDB-T and ISDB-Tsb hardware using the Linux DVB-API.
104
105The details given here about ISDB-T and ISDB-Tsb are just enough to
106basically show the dependencies between the needed parameter values, but
107surely some information is left out. For more detailed information see
108the following documents:
109
110ARIB STD-B31 - "Transmission System for Digital Terrestrial Television
111Broadcasting" and
112
113ARIB TR-B14 - "Operational Guidelines for Digital Terrestrial Television
114Broadcasting".
115
116In order to understand the ISDB specific parameters, one has to have
117some knowledge the channel structure in ISDB-T and ISDB-Tsb. I.e. it has
118to be known to the reader that an ISDB-T channel consists of 13
119segments, that it can have up to 3 layer sharing those segments, and
120things like that.
121
122The following parameters are valid for ISDB-T:
123
124- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
125
126- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
127
128- :ref:`DTV_TUNE <DTV-TUNE>`
129
130- :ref:`DTV_CLEAR <DTV-CLEAR>`
131
132- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
133
134- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
135
136- :ref:`DTV_INVERSION <DTV-INVERSION>`
137
138- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
139
140- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
141
142- :ref:`DTV_ISDBT_LAYER_ENABLED <DTV-ISDBT-LAYER-ENABLED>`
143
144- :ref:`DTV_ISDBT_PARTIAL_RECEPTION <DTV-ISDBT-PARTIAL-RECEPTION>`
145
146- :ref:`DTV_ISDBT_SOUND_BROADCASTING <DTV-ISDBT-SOUND-BROADCASTING>`
147
148- :ref:`DTV_ISDBT_SB_SUBCHANNEL_ID <DTV-ISDBT-SB-SUBCHANNEL-ID>`
149
150- :ref:`DTV_ISDBT_SB_SEGMENT_IDX <DTV-ISDBT-SB-SEGMENT-IDX>`
151
152- :ref:`DTV_ISDBT_SB_SEGMENT_COUNT <DTV-ISDBT-SB-SEGMENT-COUNT>`
153
154- :ref:`DTV_ISDBT_LAYERA_FEC <DTV-ISDBT-LAYER-FEC>`
155
156- :ref:`DTV_ISDBT_LAYERA_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
157
158- :ref:`DTV_ISDBT_LAYERA_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
159
160- :ref:`DTV_ISDBT_LAYERA_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
161
162- :ref:`DTV_ISDBT_LAYERB_FEC <DTV-ISDBT-LAYER-FEC>`
163
164- :ref:`DTV_ISDBT_LAYERB_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
165
166- :ref:`DTV_ISDBT_LAYERB_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
167
168- :ref:`DTV_ISDBT_LAYERB_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
169
170- :ref:`DTV_ISDBT_LAYERC_FEC <DTV-ISDBT-LAYER-FEC>`
171
172- :ref:`DTV_ISDBT_LAYERC_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
173
174- :ref:`DTV_ISDBT_LAYERC_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
175
176- :ref:`DTV_ISDBT_LAYERC_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
177
178In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
179are also valid.
180
181
182.. _atsc-params:
183
184ATSC delivery system
185====================
186
187The following parameters are valid for ATSC:
188
189- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
190
191- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
192
193- :ref:`DTV_TUNE <DTV-TUNE>`
194
195- :ref:`DTV_CLEAR <DTV-CLEAR>`
196
197- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
198
199- :ref:`DTV_MODULATION <DTV-MODULATION>`
200
201- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
202
203In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
204are also valid.
205
206
207.. _atscmh-params:
208
209ATSC-MH delivery system
210=======================
211
212The following parameters are valid for ATSC-MH:
213
214- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
215
216- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
217
218- :ref:`DTV_TUNE <DTV-TUNE>`
219
220- :ref:`DTV_CLEAR <DTV-CLEAR>`
221
222- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
223
224- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
225
226- :ref:`DTV_ATSCMH_FIC_VER <DTV-ATSCMH-FIC-VER>`
227
228- :ref:`DTV_ATSCMH_PARADE_ID <DTV-ATSCMH-PARADE-ID>`
229
230- :ref:`DTV_ATSCMH_NOG <DTV-ATSCMH-NOG>`
231
232- :ref:`DTV_ATSCMH_TNOG <DTV-ATSCMH-TNOG>`
233
234- :ref:`DTV_ATSCMH_SGN <DTV-ATSCMH-SGN>`
235
236- :ref:`DTV_ATSCMH_PRC <DTV-ATSCMH-PRC>`
237
238- :ref:`DTV_ATSCMH_RS_FRAME_MODE <DTV-ATSCMH-RS-FRAME-MODE>`
239
240- :ref:`DTV_ATSCMH_RS_FRAME_ENSEMBLE <DTV-ATSCMH-RS-FRAME-ENSEMBLE>`
241
242- :ref:`DTV_ATSCMH_RS_CODE_MODE_PRI <DTV-ATSCMH-RS-CODE-MODE-PRI>`
243
244- :ref:`DTV_ATSCMH_RS_CODE_MODE_SEC <DTV-ATSCMH-RS-CODE-MODE-SEC>`
245
246- :ref:`DTV_ATSCMH_SCCC_BLOCK_MODE <DTV-ATSCMH-SCCC-BLOCK-MODE>`
247
248- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_A <DTV-ATSCMH-SCCC-CODE-MODE-A>`
249
250- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_B <DTV-ATSCMH-SCCC-CODE-MODE-B>`
251
252- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_C <DTV-ATSCMH-SCCC-CODE-MODE-C>`
253
254- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_D <DTV-ATSCMH-SCCC-CODE-MODE-D>`
255
256In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
257are also valid.
258
259
260.. _dtmb-params:
261
262DTMB delivery system
263====================
264
265The following parameters are valid for DTMB:
266
267- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
268
269- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
270
271- :ref:`DTV_TUNE <DTV-TUNE>`
272
273- :ref:`DTV_CLEAR <DTV-CLEAR>`
274
275- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
276
277- :ref:`DTV_MODULATION <DTV-MODULATION>`
278
279- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
280
281- :ref:`DTV_INVERSION <DTV-INVERSION>`
282
283- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
284
285- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
286
287- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
288
289- :ref:`DTV_INTERLEAVING <DTV-INTERLEAVING>`
290
291- :ref:`DTV_LNA <DTV-LNA>`
292
293In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
294are also valid.
diff --git a/Documentation/media/uapi/dvb/frontend-stat-properties.rst b/Documentation/media/uapi/dvb/frontend-stat-properties.rst
new file mode 100644
index 000000000000..0fc4aaa304ff
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend-stat-properties.rst
@@ -0,0 +1,245 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend-stat-properties:
4
5******************************
6Frontend statistics indicators
7******************************
8
9The values are returned via ``dtv_property.stat``. If the property is
10supported, ``dtv_property.stat.len`` is bigger than zero.
11
12For most delivery systems, ``dtv_property.stat.len`` will be 1 if the
13stats is supported, and the properties will return a single value for
14each parameter.
15
16It should be noted, however, that new OFDM delivery systems like ISDB
17can use different modulation types for each group of carriers. On such
18standards, up to 3 groups of statistics can be provided, and
19``dtv_property.stat.len`` is updated to reflect the "global" metrics,
20plus one metric per each carrier group (called "layer" on ISDB).
21
22So, in order to be consistent with other delivery systems, the first
23value at :ref:`dtv_property.stat.dtv_stats <dtv-stats>` array refers
24to the global metric. The other elements of the array represent each
25layer, starting from layer A(index 1), layer B (index 2) and so on.
26
27The number of filled elements are stored at ``dtv_property.stat.len``.
28
29Each element of the ``dtv_property.stat.dtv_stats`` array consists on
30two elements:
31
32- ``svalue`` or ``uvalue``, where ``svalue`` is for signed values of
33 the measure (dB measures) and ``uvalue`` is for unsigned values
34 (counters, relative scale)
35
36- ``scale`` - Scale for the value. It can be:
37
38 - ``FE_SCALE_NOT_AVAILABLE`` - The parameter is supported by the
39 frontend, but it was not possible to collect it (could be a
40 transitory or permanent condition)
41
42 - ``FE_SCALE_DECIBEL`` - parameter is a signed value, measured in
43 1/1000 dB
44
45 - ``FE_SCALE_RELATIVE`` - parameter is a unsigned value, where 0
46 means 0% and 65535 means 100%.
47
48 - ``FE_SCALE_COUNTER`` - parameter is a unsigned value that counts
49 the occurrence of an event, like bit error, block error, or lapsed
50 time.
51
52
53.. _DTV-STAT-SIGNAL-STRENGTH:
54
55DTV_STAT_SIGNAL_STRENGTH
56========================
57
58Indicates the signal strength level at the analog part of the tuner or
59of the demod.
60
61Possible scales for this metric are:
62
63- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
64 measurement was not complete yet.
65
66- ``FE_SCALE_DECIBEL`` - signal strength is in 0.001 dBm units, power
67 measured in miliwatts. This value is generally negative.
68
69- ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
70 measurement for power (actually, 0 to 65535).
71
72
73.. _DTV-STAT-CNR:
74
75DTV_STAT_CNR
76============
77
78Indicates the Signal to Noise ratio for the main carrier.
79
80Possible scales for this metric are:
81
82- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
83 measurement was not complete yet.
84
85- ``FE_SCALE_DECIBEL`` - Signal/Noise ratio is in 0.001 dB units.
86
87- ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
88 measurement for Signal/Noise (actually, 0 to 65535).
89
90
91.. _DTV-STAT-PRE-ERROR-BIT-COUNT:
92
93DTV_STAT_PRE_ERROR_BIT_COUNT
94============================
95
96Measures the number of bit errors before the forward error correction
97(FEC) on the inner coding block (before Viterbi, LDPC or other inner
98code).
99
100This measure is taken during the same interval as
101``DTV_STAT_PRE_TOTAL_BIT_COUNT``.
102
103In order to get the BER (Bit Error Rate) measurement, it should be
104divided by
105:ref:`DTV_STAT_PRE_TOTAL_BIT_COUNT <DTV-STAT-PRE-TOTAL-BIT-COUNT>`.
106
107This measurement is monotonically increased, as the frontend gets more
108bit count measurements. The frontend may reset it when a
109channel/transponder is tuned.
110
111Possible scales for this metric are:
112
113- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
114 measurement was not complete yet.
115
116- ``FE_SCALE_COUNTER`` - Number of error bits counted before the inner
117 coding.
118
119
120.. _DTV-STAT-PRE-TOTAL-BIT-COUNT:
121
122DTV_STAT_PRE_TOTAL_BIT_COUNT
123============================
124
125Measures the amount of bits received before the inner code block, during
126the same period as
127:ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`
128measurement was taken.
129
130It should be noted that this measurement can be smaller than the total
131amount of bits on the transport stream, as the frontend may need to
132manually restart the measurement, losing some data between each
133measurement interval.
134
135This measurement is monotonically increased, as the frontend gets more
136bit count measurements. The frontend may reset it when a
137channel/transponder is tuned.
138
139Possible scales for this metric are:
140
141- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
142 measurement was not complete yet.
143
144- ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
145 :ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`.
146
147
148.. _DTV-STAT-POST-ERROR-BIT-COUNT:
149
150DTV_STAT_POST_ERROR_BIT_COUNT
151=============================
152
153Measures the number of bit errors after the forward error correction
154(FEC) done by inner code block (after Viterbi, LDPC or other inner
155code).
156
157This measure is taken during the same interval as
158``DTV_STAT_POST_TOTAL_BIT_COUNT``.
159
160In order to get the BER (Bit Error Rate) measurement, it should be
161divided by
162:ref:`DTV_STAT_POST_TOTAL_BIT_COUNT <DTV-STAT-POST-TOTAL-BIT-COUNT>`.
163
164This measurement is monotonically increased, as the frontend gets more
165bit count measurements. The frontend may reset it when a
166channel/transponder is tuned.
167
168Possible scales for this metric are:
169
170- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
171 measurement was not complete yet.
172
173- ``FE_SCALE_COUNTER`` - Number of error bits counted after the inner
174 coding.
175
176
177.. _DTV-STAT-POST-TOTAL-BIT-COUNT:
178
179DTV_STAT_POST_TOTAL_BIT_COUNT
180=============================
181
182Measures the amount of bits received after the inner coding, during the
183same period as
184:ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`
185measurement was taken.
186
187It should be noted that this measurement can be smaller than the total
188amount of bits on the transport stream, as the frontend may need to
189manually restart the measurement, losing some data between each
190measurement interval.
191
192This measurement is monotonically increased, as the frontend gets more
193bit count measurements. The frontend may reset it when a
194channel/transponder is tuned.
195
196Possible scales for this metric are:
197
198- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
199 measurement was not complete yet.
200
201- ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
202 :ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`.
203
204
205.. _DTV-STAT-ERROR-BLOCK-COUNT:
206
207DTV_STAT_ERROR_BLOCK_COUNT
208==========================
209
210Measures the number of block errors after the outer forward error
211correction coding (after Reed-Solomon or other outer code).
212
213This measurement is monotonically increased, as the frontend gets more
214bit count measurements. The frontend may reset it when a
215channel/transponder is tuned.
216
217Possible scales for this metric are:
218
219- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
220 measurement was not complete yet.
221
222- ``FE_SCALE_COUNTER`` - Number of error blocks counted after the outer
223 coding.
224
225
226.. _DTV-STAT-TOTAL-BLOCK-COUNT:
227
228DTV-STAT_TOTAL_BLOCK_COUNT
229==========================
230
231Measures the total number of blocks received during the same period as
232:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`
233measurement was taken.
234
235It can be used to calculate the PER indicator, by dividing
236:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>` by
237:ref:`DTV-STAT-TOTAL-BLOCK-COUNT`.
238
239Possible scales for this metric are:
240
241- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
242 measurement was not complete yet.
243
244- ``FE_SCALE_COUNTER`` - Number of blocks counted while measuring
245 :ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`.
diff --git a/Documentation/media/uapi/dvb/frontend.rst b/Documentation/media/uapi/dvb/frontend.rst
new file mode 100644
index 000000000000..48c5cd487ce7
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend.rst
@@ -0,0 +1,51 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_frontend:
4
5################
6DVB Frontend API
7################
8The DVB frontend API was designed to support three types of delivery
9systems:
10
11- Terrestrial systems: DVB-T, DVB-T2, ATSC, ATSC M/H, ISDB-T, DVB-H,
12 DTMB, CMMB
13
14- Cable systems: DVB-C Annex A/C, ClearQAM (DVB-C Annex B), ISDB-C
15
16- Satellite systems: DVB-S, DVB-S2, DVB Turbo, ISDB-S, DSS
17
18The DVB frontend controls several sub-devices including:
19
20- Tuner
21
22- Digital TV demodulator
23
24- Low noise amplifier (LNA)
25
26- Satellite Equipment Control (SEC) hardware (only for Satellite).
27
28The frontend can be accessed through ``/dev/dvb/adapter?/frontend?``.
29Data types and ioctl definitions can be accessed by including
30``linux/dvb/frontend.h`` in your application.
31
32.. note:: Transmission via the internet (DVB-IP) is not yet handled by this
33 API but a future extension is possible.
34
35On Satellite systems, the API support for the Satellite Equipment
36Control (SEC) allows to power control and to send/receive signals to
37control the antenna subsystem, selecting the polarization and choosing
38the Intermediate Frequency IF) of the Low Noise Block Converter Feed
39Horn (LNBf). It supports the DiSEqC and V-SEC protocols. The DiSEqC
40(digital SEC) specification is available at
41`Eutelsat <http://www.eutelsat.com/satellites/4_5_5.html>`__.
42
43
44.. toctree::
45 :maxdepth: 1
46
47 query-dvb-frontend-info
48 dvb-fe-read-status
49 dvbproperty
50 frontend_fcalls
51 frontend_legacy_dvbv3_api
diff --git a/Documentation/media/uapi/dvb/frontend_f_close.rst b/Documentation/media/uapi/dvb/frontend_f_close.rst
new file mode 100644
index 000000000000..5cce9262084c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_f_close.rst
@@ -0,0 +1,48 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_f_close:
4
5********************
6DVB frontend close()
7********************
8
9Name
10====
11
12fe-close - Close a frontend device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: int close( int fd )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32
33Description
34===========
35
36This system call closes a previously opened front-end device. After
37closing a front-end device, its corresponding hardware might be powered
38down automatically.
39
40
41Return Value
42============
43
44The function returns 0 on success, -1 on failure and the ``errno`` is
45set appropriately. Possible error codes:
46
47EBADF
48 ``fd`` is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/frontend_f_open.rst b/Documentation/media/uapi/dvb/frontend_f_open.rst
new file mode 100644
index 000000000000..e0c55345f524
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_f_open.rst
@@ -0,0 +1,102 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_f_open:
4
5*******************
6DVB frontend open()
7*******************
8
9Name
10====
11
12fe-open - Open a frontend device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <fcntl.h>
21
22
23.. cpp:function:: int open( const char *device_name, int flags )
24
25
26Arguments
27=========
28
29``device_name``
30 Device to be opened.
31
32``flags``
33 Open flags. Access can either be ``O_RDWR`` or ``O_RDONLY``.
34
35 Multiple opens are allowed with ``O_RDONLY``. In this mode, only
36 query and read ioctls are allowed.
37
38 Only one open is allowed in ``O_RDWR``. In this mode, all ioctls are
39 allowed.
40
41 When the ``O_NONBLOCK`` flag is given, the system calls may return
42 ``EAGAIN`` error code when no data is available or when the device
43 driver is temporarily busy.
44
45 Other flags have no effect.
46
47
48Description
49===========
50
51This system call opens a named frontend device
52(``/dev/dvb/adapter?/frontend?``) for subsequent use. Usually the first
53thing to do after a successful open is to find out the frontend type
54with :ref:`FE_GET_INFO`.
55
56The device can be opened in read-only mode, which only allows monitoring
57of device status and statistics, or read/write mode, which allows any
58kind of use (e.g. performing tuning operations.)
59
60In a system with multiple front-ends, it is usually the case that
61multiple devices cannot be open in read/write mode simultaneously. As
62long as a front-end device is opened in read/write mode, other open()
63calls in read/write mode will either fail or block, depending on whether
64non-blocking or blocking mode was specified. A front-end device opened
65in blocking mode can later be put into non-blocking mode (and vice
66versa) using the F_SETFL command of the fcntl system call. This is a
67standard system call, documented in the Linux manual page for fcntl.
68When an open() call has succeeded, the device will be ready for use in
69the specified mode. This implies that the corresponding hardware is
70powered up, and that other front-ends may have been powered down to make
71that possible.
72
73
74Return Value
75============
76
77On success :ref:`open() <frontend_f_open>` returns the new file descriptor.
78On error, -1 is returned, and the ``errno`` variable is set appropriately.
79
80Possible error codes are:
81
82EACCES
83 The caller has no permission to access the device.
84
85EBUSY
86 The the device driver is already in use.
87
88ENXIO
89 No device corresponding to this device special file exists.
90
91ENOMEM
92 Not enough kernel memory was available to complete the request.
93
94EMFILE
95 The process already has the maximum number of files open.
96
97ENFILE
98 The limit on the total number of files open on the system has been
99 reached.
100
101ENODEV
102 The device got removed.
diff --git a/Documentation/media/uapi/dvb/frontend_fcalls.rst b/Documentation/media/uapi/dvb/frontend_fcalls.rst
new file mode 100644
index 000000000000..b03f9cab6d5a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_fcalls.rst
@@ -0,0 +1,24 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_fcalls:
4
5#######################
6Frontend Function Calls
7#######################
8
9.. toctree::
10 :maxdepth: 1
11
12 frontend_f_open
13 frontend_f_close
14 fe-get-info
15 fe-read-status
16 fe-get-property
17 fe-diseqc-reset-overload
18 fe-diseqc-send-master-cmd
19 fe-diseqc-recv-slave-reply
20 fe-diseqc-send-burst
21 fe-set-tone
22 fe-set-voltage
23 fe-enable-high-lnb-voltage
24 fe-set-frontend-tune-mode
diff --git a/Documentation/media/uapi/dvb/frontend_h.rst b/Documentation/media/uapi/dvb/frontend_h.rst
new file mode 100644
index 000000000000..15fca04d1c32
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_h:
4
5************************
6DVB Frontend Header File
7************************
8
9.. kernel-include:: $BUILDDIR/frontend.h.rst
diff --git a/Documentation/media/uapi/dvb/frontend_legacy_api.rst b/Documentation/media/uapi/dvb/frontend_legacy_api.rst
new file mode 100644
index 000000000000..759833d3eaa4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_legacy_api.rst
@@ -0,0 +1,38 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_legacy_types:
4
5Frontend Legacy Data Types
6==========================
7
8
9.. toctree::
10 :maxdepth: 1
11
12 fe-type-t
13 fe-bandwidth-t
14 dvb-frontend-parameters
15 dvb-frontend-event
16
17
18.. _frontend_legacy_fcalls:
19
20Frontend Legacy Function Calls
21==============================
22
23Those functions are defined at DVB version 3. The support is kept in the
24kernel due to compatibility issues only. Their usage is strongly not
25recommended
26
27
28.. toctree::
29 :maxdepth: 1
30
31 fe-read-ber
32 fe-read-snr
33 fe-read-signal-strength
34 fe-read-uncorrected-blocks
35 fe-set-frontend
36 fe-get-frontend
37 fe-get-event
38 fe-dishnetwork-send-legacy-cmd
diff --git a/Documentation/media/uapi/dvb/frontend_legacy_dvbv3_api.rst b/Documentation/media/uapi/dvb/frontend_legacy_dvbv3_api.rst
new file mode 100644
index 000000000000..7d4a091b7d7f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend_legacy_dvbv3_api.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _frontend_legacy_dvbv3_api:
4
5****************************************
6DVB Frontend legacy API (a. k. a. DVBv3)
7****************************************
8
9The usage of this API is deprecated, as it doesn't support all digital
10TV standards, doesn't provide good statistics measurements and provides
11incomplete information. This is kept only to support legacy
12applications.
13
14
15.. toctree::
16 :maxdepth: 1
17
18 frontend_legacy_api
diff --git a/Documentation/media/uapi/dvb/intro.rst b/Documentation/media/uapi/dvb/intro.rst
new file mode 100644
index 000000000000..b61081d00a9f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/intro.rst
@@ -0,0 +1,172 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_introdution:
4
5************
6Introduction
7************
8
9
10.. _requisites:
11
12What you need to know
13=====================
14
15The reader of this document is required to have some knowledge in the
16area of digital video broadcasting (DVB) and should be familiar with
17part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e
18you should know what a program/transport stream (PS/TS) is and what is
19meant by a packetized elementary stream (PES) or an I-frame.
20
21Various DVB standards documents are available from http://www.dvb.org
22and/or http://www.etsi.org.
23
24It is also necessary to know how to access unix/linux devices and how to
25use ioctl calls. This also includes the knowledge of C or C++.
26
27
28.. _history:
29
30History
31=======
32
33The first API for DVB cards we used at Convergence in late 1999 was an
34extension of the Video4Linux API which was primarily developed for frame
35grabber cards. As such it was not really well suited to be used for DVB
36cards and their new features like recording MPEG streams and filtering
37several section and PES data streams at the same time.
38
39In early 2000, we were approached by Nokia with a proposal for a new
40standard Linux DVB API. As a commitment to the development of terminals
41based on open standards, Nokia and Convergence made it available to all
42Linux developers and published it on https://linuxtv.org in September
432000. Convergence is the maintainer of the Linux DVB API. Together with
44the LinuxTV community (i.e. you, the reader of this document), the Linux
45DVB API will be constantly reviewed and improved. With the Linux driver
46for the Siemens/Hauppauge DVB PCI card Convergence provides a first
47implementation of the Linux DVB API.
48
49
50.. _overview:
51
52Overview
53========
54
55
56.. _stb_components:
57
58.. figure:: intro_files/dvbstb.*
59 :alt: dvbstb.pdf / dvbstb.png
60 :align: center
61
62 Components of a DVB card/STB
63
64A DVB PCI card or DVB set-top-box (STB) usually consists of the
65following main hardware components:
66
67- Frontend consisting of tuner and DVB demodulator
68
69 Here the raw signal reaches the DVB hardware from a satellite dish or
70 antenna or directly from cable. The frontend down-converts and
71 demodulates this signal into an MPEG transport stream (TS). In case
72 of a satellite frontend, this includes a facility for satellite
73 equipment control (SEC), which allows control of LNB polarization,
74 multi feed switches or dish rotors.
75
76- Conditional Access (CA) hardware like CI adapters and smartcard slots
77
78 The complete TS is passed through the CA hardware. Programs to which
79 the user has access (controlled by the smart card) are decoded in
80 real time and re-inserted into the TS.
81
82- Demultiplexer which filters the incoming DVB stream
83
84 The demultiplexer splits the TS into its components like audio and
85 video streams. Besides usually several of such audio and video
86 streams it also contains data streams with information about the
87 programs offered in this or other streams of the same provider.
88
89- MPEG2 audio and video decoder
90
91 The main targets of the demultiplexer are the MPEG2 audio and video
92 decoders. After decoding they pass on the uncompressed audio and
93 video to the computer screen or (through a PAL/NTSC encoder) to a TV
94 set.
95
96:ref:`stb_components` shows a crude schematic of the control and data
97flow between those components.
98
99On a DVB PCI card not all of these have to be present since some
100functionality can be provided by the main CPU of the PC (e.g. MPEG
101picture and sound decoding) or is not needed (e.g. for data-only uses
102like “internet over satellite”). Also not every card or STB provides
103conditional access hardware.
104
105
106.. _dvb_devices:
107
108Linux DVB Devices
109=================
110
111The Linux DVB API lets you control these hardware components through
112currently six Unix-style character devices for video, audio, frontend,
113demux, CA and IP-over-DVB networking. The video and audio devices
114control the MPEG2 decoder hardware, the frontend device the tuner and
115the DVB demodulator. The demux device gives you control over the PES and
116section filters of the hardware. If the hardware does not support
117filtering these filters can be implemented in software. Finally, the CA
118device controls all the conditional access capabilities of the hardware.
119It can depend on the individual security requirements of the platform,
120if and how many of the CA functions are made available to the
121application through this device.
122
123All devices can be found in the ``/dev`` tree under ``/dev/dvb``. The
124individual devices are called:
125
126- ``/dev/dvb/adapterN/audioM``,
127
128- ``/dev/dvb/adapterN/videoM``,
129
130- ``/dev/dvb/adapterN/frontendM``,
131
132- ``/dev/dvb/adapterN/netM``,
133
134- ``/dev/dvb/adapterN/demuxM``,
135
136- ``/dev/dvb/adapterN/dvrM``,
137
138- ``/dev/dvb/adapterN/caM``,
139
140where N enumerates the DVB PCI cards in a system starting from 0, and M
141enumerates the devices of each type within each adapter, starting
142from 0, too. We will omit the “ ``/dev/dvb/adapterN/``\ ” in the further
143discussion of these devices.
144
145More details about the data structures and function calls of all the
146devices are described in the following chapters.
147
148
149.. _include_files:
150
151API include files
152=================
153
154For each of the DVB devices a corresponding include file exists. The DVB
155API include files should be included in application sources with a
156partial path like:
157
158
159.. code-block:: c
160
161 #include <linux/dvb/ca.h>
162
163 #include <linux/dvb/dmx.h>
164
165 #include <linux/dvb/frontend.h>
166
167 #include <linux/dvb/net.h>
168
169
170To enable applications to support different API version, an additional
171include file ``linux/dvb/version.h`` exists, which defines the constant
172``DVB_API_VERSION``. This document describes ``DVB_API_VERSION 5.10``.
diff --git a/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf b/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf
new file mode 100644
index 000000000000..0fa75d90c3eb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf
Binary files differ
diff --git a/Documentation/media/uapi/dvb/intro_files/dvbstb.png b/Documentation/media/uapi/dvb/intro_files/dvbstb.png
new file mode 100644
index 000000000000..9b8f372e7afd
--- /dev/null
+++ b/Documentation/media/uapi/dvb/intro_files/dvbstb.png
Binary files differ
diff --git a/Documentation/media/uapi/dvb/legacy_dvb_apis.rst b/Documentation/media/uapi/dvb/legacy_dvb_apis.rst
new file mode 100644
index 000000000000..2957f5a988b0
--- /dev/null
+++ b/Documentation/media/uapi/dvb/legacy_dvb_apis.rst
@@ -0,0 +1,20 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _legacy_dvb_apis:
4
5*******************
6DVB Deprecated APIs
7*******************
8
9The APIs described here are kept only for historical reasons. There's
10just one driver for a very legacy hardware that uses this API. No modern
11drivers should use it. Instead, audio and video should be using the V4L2
12and ALSA APIs, and the pipelines should be set using the Media
13Controller API
14
15
16.. toctree::
17 :maxdepth: 1
18
19 video
20 audio
diff --git a/Documentation/media/uapi/dvb/net-add-if.rst b/Documentation/media/uapi/dvb/net-add-if.rst
new file mode 100644
index 000000000000..2b990d0e0fe1
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net-add-if.rst
@@ -0,0 +1,91 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _NET_ADD_IF:
4
5****************
6ioctl NET_ADD_IF
7****************
8
9Name
10====
11
12NET_ADD_IF - Creates a new network interface for a given Packet ID.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dvb_net_if *net_if )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_TONE
29
30``net_if``
31 pointer to struct :ref:`dvb_net_if <dvb-net-if>`
32
33
34Description
35===========
36
37The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
38contains a TCP/IP traffic, the type of encapsulation to be used (MPE or
39ULE) and the interface number for the new interface to be created. When
40the system call successfully returns, a new virtual network interface is
41created.
42
43The struct :ref:`dvb_net_if <dvb-net-if>`::ifnum field will be
44filled with the number of the created interface.
45
46
47.. _dvb-net-if-t:
48
49struct dvb_net_if description
50=============================
51
52.. _dvb-net-if:
53
54.. flat-table:: struct dvb_net_if
55 :header-rows: 1
56 :stub-columns: 0
57
58
59 - .. row 1
60
61 - ID
62
63 - Description
64
65 - .. row 2
66
67 - pid
68
69 - Packet ID (PID) of the MPEG-TS that contains data
70
71 - .. row 3
72
73 - ifnum
74
75 - number of the DVB interface.
76
77 - .. row 4
78
79 - feedtype
80
81 - Encapsulation type of the feed. It can be:
82 ``DVB_NET_FEEDTYPE_MPE`` for MPE encoding or
83 ``DVB_NET_FEEDTYPE_ULE`` for ULE encoding.
84
85
86Return Value
87============
88
89On success 0 is returned, on error -1 and the ``errno`` variable is set
90appropriately. The generic error codes are described at the
91:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/net-get-if.rst b/Documentation/media/uapi/dvb/net-get-if.rst
new file mode 100644
index 000000000000..92b884143ccd
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net-get-if.rst
@@ -0,0 +1,50 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _NET_GET_IF:
4
5****************
6ioctl NET_GET_IF
7****************
8
9Name
10====
11
12NET_GET_IF - Read the configuration data of an interface created via - :ref:`NET_ADD_IF <net>`.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct dvb_net_if *net_if )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_TONE
29
30``net_if``
31 pointer to struct :ref:`dvb_net_if <dvb-net-if>`
32
33
34Description
35===========
36
37The NET_GET_IF ioctl uses the interface number given by the struct
38:ref:`dvb_net_if <dvb-net-if>`::ifnum field and fills the content of
39struct :ref:`dvb_net_if <dvb-net-if>` with the packet ID and
40encapsulation type used on such interface. If the interface was not
41created yet with :ref:`NET_ADD_IF <net>`, it will return -1 and fill
42the ``errno`` with ``EINVAL`` error code.
43
44
45Return Value
46============
47
48On success 0 is returned, on error -1 and the ``errno`` variable is set
49appropriately. The generic error codes are described at the
50:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/net-remove-if.rst b/Documentation/media/uapi/dvb/net-remove-if.rst
new file mode 100644
index 000000000000..d374c1d63d06
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net-remove-if.rst
@@ -0,0 +1,46 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _NET_REMOVE_IF:
4
5*******************
6ioctl NET_REMOVE_IF
7*******************
8
9Name
10====
11
12NET_REMOVE_IF - Removes a network interface.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, int ifnum )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27``request``
28 FE_SET_TONE
29
30``net_if``
31 number of the interface to be removed
32
33
34Description
35===========
36
37The NET_REMOVE_IF ioctl deletes an interface previously created via
38:ref:`NET_ADD_IF <net>`.
39
40
41Return Value
42============
43
44On success 0 is returned, on error -1 and the ``errno`` variable is set
45appropriately. The generic error codes are described at the
46:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/net.rst b/Documentation/media/uapi/dvb/net.rst
new file mode 100644
index 000000000000..eca42dd53261
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net.rst
@@ -0,0 +1,40 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _net:
4
5###############
6DVB Network API
7###############
8The DVB net device controls the mapping of data packages that are part
9of a transport stream to be mapped into a virtual network interface,
10visible through the standard Linux network protocol stack.
11
12Currently, two encapsulations are supported:
13
14- `Multi Protocol Encapsulation (MPE) <http://en.wikipedia.org/wiki/Multiprotocol_Encapsulation>`__
15
16- `Ultra Lightweight Encapsulation (ULE) <http://en.wikipedia.org/wiki/Unidirectional_Lightweight_Encapsulation>`__
17
18In order to create the Linux virtual network interfaces, an application
19needs to tell to the Kernel what are the PIDs and the encapsulation
20types that are present on the transport stream. This is done through
21``/dev/dvb/adapter?/net?`` device node. The data will be available via
22virtual ``dvb?_?`` network interfaces, and will be controlled/routed via
23the standard ip tools (like ip, route, netstat, ifconfig, etc).
24
25Data types and and ioctl definitions are defined via ``linux/dvb/net.h``
26header.
27
28
29.. _net_fcalls:
30
31######################
32DVB net Function Calls
33######################
34
35.. toctree::
36 :maxdepth: 1
37
38 net-add-if
39 net-remove-if
40 net-get-if
diff --git a/Documentation/media/uapi/dvb/net_h.rst b/Documentation/media/uapi/dvb/net_h.rst
new file mode 100644
index 000000000000..7bcf5ba9d1eb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _net_h:
4
5***********************
6DVB Network Header File
7***********************
8
9.. kernel-include:: $BUILDDIR/net.h.rst
diff --git a/Documentation/media/uapi/dvb/query-dvb-frontend-info.rst b/Documentation/media/uapi/dvb/query-dvb-frontend-info.rst
new file mode 100644
index 000000000000..81cd9b92a36c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/query-dvb-frontend-info.rst
@@ -0,0 +1,13 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _query-dvb-frontend-info:
4
5*****************************
6Querying frontend information
7*****************************
8
9Usually, the first thing to do when the frontend is opened is to check
10the frontend capabilities. This is done using
11:ref:`FE_GET_INFO`. This ioctl will enumerate the
12DVB API version and other characteristics about the frontend, and can be
13opened either in read only or read/write mode.
diff --git a/Documentation/media/uapi/dvb/video-clear-buffer.rst b/Documentation/media/uapi/dvb/video-clear-buffer.rst
new file mode 100644
index 000000000000..7c85aa06f013
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-clear-buffer.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_CLEAR_BUFFER:
4
5==================
6VIDEO_CLEAR_BUFFER
7==================
8
9Name
10----
11
12VIDEO_CLEAR_BUFFER
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_CLEAR_BUFFER)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_CLEAR_BUFFER for this command.
40
41
42Description
43-----------
44
45This ioctl call clears all video buffers in the driver and in the
46decoder hardware.
47
48
49Return Value
50------------
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-command.rst b/Documentation/media/uapi/dvb/video-command.rst
new file mode 100644
index 000000000000..b1634f722cbd
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-command.rst
@@ -0,0 +1,66 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_COMMAND:
4
5=============
6VIDEO_COMMAND
7=============
8
9Name
10----
11
12VIDEO_COMMAND
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_COMMAND, struct video_command *cmd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_COMMAND for this command.
40
41 - .. row 3
42
43 - struct video_command \*cmd
44
45 - Commands the decoder.
46
47
48Description
49-----------
50
51This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
52this ioctl has been replaced by the
53:ref:`VIDIOC_DECODER_CMD` ioctl.
54
55This ioctl commands the decoder. The ``video_command`` struct is a
56subset of the ``v4l2_decoder_cmd`` struct, so refer to the
57:ref:`VIDIOC_DECODER_CMD` documentation for
58more information.
59
60
61Return Value
62------------
63
64On success 0 is returned, on error -1 and the ``errno`` variable is set
65appropriately. The generic error codes are described at the
66:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-continue.rst b/Documentation/media/uapi/dvb/video-continue.rst
new file mode 100644
index 000000000000..c5acc094986f
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-continue.rst
@@ -0,0 +1,57 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_CONTINUE:
4
5==============
6VIDEO_CONTINUE
7==============
8
9Name
10----
11
12VIDEO_CONTINUE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_CONTINUE)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_CONTINUE for this command.
40
41
42Description
43-----------
44
45This ioctl is for DVB devices only. To control a V4L2 decoder use the
46V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
47
48This ioctl call restarts decoding and playing processes of the video
49stream which was played before a call to VIDEO_FREEZE was made.
50
51
52Return Value
53------------
54
55On success 0 is returned, on error -1 and the ``errno`` variable is set
56appropriately. The generic error codes are described at the
57:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-fast-forward.rst b/Documentation/media/uapi/dvb/video-fast-forward.rst
new file mode 100644
index 000000000000..db338e9f5379
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-fast-forward.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_FAST_FORWARD:
4
5==================
6VIDEO_FAST_FORWARD
7==================
8
9Name
10----
11
12VIDEO_FAST_FORWARD
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_FAST_FORWARD, int nFrames)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_FAST_FORWARD for this command.
40
41 - .. row 3
42
43 - int nFrames
44
45 - The number of frames to skip.
46
47
48Description
49-----------
50
51This ioctl call asks the Video Device to skip decoding of N number of
52I-frames. This call can only be used if VIDEO_SOURCE_MEMORY is
53selected.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EPERM``
73
74 - Mode VIDEO_SOURCE_MEMORY not selected.
diff --git a/Documentation/media/uapi/dvb/video-fclose.rst b/Documentation/media/uapi/dvb/video-fclose.rst
new file mode 100644
index 000000000000..ebeaade0c351
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-fclose.rst
@@ -0,0 +1,54 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_fclose:
4
5=================
6dvb video close()
7=================
8
9Name
10----
11
12dvb video close()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int close(int fd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35
36Description
37-----------
38
39This system call closes a previously opened video device.
40
41
42Return Value
43------------
44
45.. flat-table::
46 :header-rows: 0
47 :stub-columns: 0
48
49
50 - .. row 1
51
52 - ``EBADF``
53
54 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/video-fopen.rst b/Documentation/media/uapi/dvb/video-fopen.rst
new file mode 100644
index 000000000000..9e5471557b83
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-fopen.rst
@@ -0,0 +1,112 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_fopen:
4
5================
6dvb video open()
7================
8
9Name
10----
11
12dvb video open()
13
14
15Synopsis
16--------
17
18.. cpp:function:: int open(const char *deviceName, int flags)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - const char \*deviceName
32
33 - Name of specific video device.
34
35 - .. row 2
36
37 - int flags
38
39 - A bit-wise OR of the following flags:
40
41 - .. row 3
42
43 -
44 - O_RDONLY read-only access
45
46 - .. row 4
47
48 -
49 - O_RDWR read/write access
50
51 - .. row 5
52
53 -
54 - O_NONBLOCK open in non-blocking mode
55
56 - .. row 6
57
58 -
59 - (blocking mode is the default)
60
61
62Description
63-----------
64
65This system call opens a named video device (e.g.
66/dev/dvb/adapter0/video0) for subsequent use.
67
68When an open() call has succeeded, the device will be ready for use. The
69significance of blocking or non-blocking mode is described in the
70documentation for functions where there is a difference. It does not
71affect the semantics of the open() call itself. A device opened in
72blocking mode can later be put into non-blocking mode (and vice versa)
73using the F_SETFL command of the fcntl system call. This is a standard
74system call, documented in the Linux manual page for fcntl. Only one
75user can open the Video Device in O_RDWR mode. All other attempts to
76open the device in this mode will fail, and an error-code will be
77returned. If the Video Device is opened in O_RDONLY mode, the only
78ioctl call that can be used is VIDEO_GET_STATUS. All other call will
79return an error code.
80
81
82Return Value
83------------
84
85.. flat-table::
86 :header-rows: 0
87 :stub-columns: 0
88
89
90 - .. row 1
91
92 - ``ENODEV``
93
94 - Device driver not loaded/available.
95
96 - .. row 2
97
98 - ``EINTERNAL``
99
100 - Internal error.
101
102 - .. row 3
103
104 - ``EBUSY``
105
106 - Device or resource busy.
107
108 - .. row 4
109
110 - ``EINVAL``
111
112 - Invalid argument.
diff --git a/Documentation/media/uapi/dvb/video-freeze.rst b/Documentation/media/uapi/dvb/video-freeze.rst
new file mode 100644
index 000000000000..d3d0dc31281a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-freeze.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_FREEZE:
4
5============
6VIDEO_FREEZE
7============
8
9Name
10----
11
12VIDEO_FREEZE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_FREEZE)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_FREEZE for this command.
40
41
42Description
43-----------
44
45This ioctl is for DVB devices only. To control a V4L2 decoder use the
46V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
47
48This ioctl call suspends the live video stream being played. Decoding
49and playing are frozen. It is then possible to restart the decoding and
50playing process of the video stream using the VIDEO_CONTINUE command.
51If VIDEO_SOURCE_MEMORY is selected in the ioctl call
52VIDEO_SELECT_SOURCE, the DVB subsystem will not decode any more data
53until the ioctl call VIDEO_CONTINUE or VIDEO_PLAY is performed.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-fwrite.rst b/Documentation/media/uapi/dvb/video-fwrite.rst
new file mode 100644
index 000000000000..045038f4181e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-fwrite.rst
@@ -0,0 +1,82 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_fwrite:
4
5=================
6dvb video write()
7=================
8
9Name
10----
11
12dvb video write()
13
14
15Synopsis
16--------
17
18.. cpp:function:: size_t write(int fd, const void *buf, size_t count)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - void \*buf
38
39 - Pointer to the buffer containing the PES data.
40
41 - .. row 3
42
43 - size_t count
44
45 - Size of buf.
46
47
48Description
49-----------
50
51This system call can only be used if VIDEO_SOURCE_MEMORY is selected
52in the ioctl call VIDEO_SELECT_SOURCE. The data provided shall be in
53PES format, unless the capability allows other formats. If O_NONBLOCK
54is not specified the function will block until buffer space is
55available. The amount of data to be transferred is implied by count.
56
57
58Return Value
59------------
60
61.. flat-table::
62 :header-rows: 0
63 :stub-columns: 0
64
65
66 - .. row 1
67
68 - ``EPERM``
69
70 - Mode VIDEO_SOURCE_MEMORY not selected.
71
72 - .. row 2
73
74 - ``ENOMEM``
75
76 - Attempted to write more data than the internal buffer can hold.
77
78 - .. row 3
79
80 - ``EBADF``
81
82 - fd is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/dvb/video-get-capabilities.rst b/Documentation/media/uapi/dvb/video-get-capabilities.rst
new file mode 100644
index 000000000000..94cbbba478a8
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-capabilities.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_CAPABILITIES:
4
5======================
6VIDEO_GET_CAPABILITIES
7======================
8
9Name
10----
11
12VIDEO_GET_CAPABILITIES
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_GET_CAPABILITIES, unsigned int *cap)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_CAPABILITIES for this command.
40
41 - .. row 3
42
43 - unsigned int \*cap
44
45 - Pointer to a location where to store the capability information.
46
47
48Description
49-----------
50
51This ioctl call asks the video device about its decoding capabilities.
52On success it returns and integer which has bits set according to the
53defines in section ??.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-get-event.rst b/Documentation/media/uapi/dvb/video-get-event.rst
new file mode 100644
index 000000000000..a1484a226518
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-event.rst
@@ -0,0 +1,88 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_EVENT:
4
5===============
6VIDEO_GET_EVENT
7===============
8
9Name
10----
11
12VIDEO_GET_EVENT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_GET_EVENT, struct video_event *ev)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_EVENT for this command.
40
41 - .. row 3
42
43 - struct video_event \*ev
44
45 - Points to the location where the event, if any, is to be stored.
46
47
48Description
49-----------
50
51This ioctl is for DVB devices only. To get events from a V4L2 decoder
52use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
53
54This ioctl call returns an event of type video_event if available. If
55an event is not available, the behavior depends on whether the device is
56in blocking or non-blocking mode. In the latter case, the call fails
57immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
58blocks until an event becomes available. The standard Linux poll()
59and/or select() system calls can be used with the device file descriptor
60to watch for new events. For select(), the file descriptor should be
61included in the exceptfds argument, and for poll(), POLLPRI should be
62specified as the wake-up condition. Read-only permissions are sufficient
63for this ioctl call.
64
65
66Return Value
67------------
68
69On success 0 is returned, on error -1 and the ``errno`` variable is set
70appropriately. The generic error codes are described at the
71:ref:`Generic Error Codes <gen-errors>` chapter.
72
73.. flat-table::
74 :header-rows: 0
75 :stub-columns: 0
76
77
78 - .. row 1
79
80 - ``EWOULDBLOCK``
81
82 - There is no event pending, and the device is in non-blocking mode.
83
84 - .. row 2
85
86 - ``EOVERFLOW``
87
88 - Overflow in event queue - one or more events were lost.
diff --git a/Documentation/media/uapi/dvb/video-get-frame-count.rst b/Documentation/media/uapi/dvb/video-get-frame-count.rst
new file mode 100644
index 000000000000..4ff100c2ee95
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-frame-count.rst
@@ -0,0 +1,65 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_FRAME_COUNT:
4
5=====================
6VIDEO_GET_FRAME_COUNT
7=====================
8
9Name
10----
11
12VIDEO_GET_FRAME_COUNT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_GET_FRAME_COUNT, __u64 *pts)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_FRAME_COUNT for this command.
40
41 - .. row 3
42
43 - __u64 \*pts
44
45 - Returns the number of frames displayed since the decoder was
46 started.
47
48
49Description
50-----------
51
52This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
53this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_FRAME``
54control.
55
56This ioctl call asks the Video Device to return the number of displayed
57frames since the decoder was started.
58
59
60Return Value
61------------
62
63On success 0 is returned, on error -1 and the ``errno`` variable is set
64appropriately. The generic error codes are described at the
65:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-get-frame-rate.rst b/Documentation/media/uapi/dvb/video-get-frame-rate.rst
new file mode 100644
index 000000000000..131def962305
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-frame-rate.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_FRAME_RATE:
4
5====================
6VIDEO_GET_FRAME_RATE
7====================
8
9Name
10----
11
12VIDEO_GET_FRAME_RATE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_GET_FRAME_RATE, unsigned int *rate)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_FRAME_RATE for this command.
40
41 - .. row 3
42
43 - unsigned int \*rate
44
45 - Returns the framerate in number of frames per 1000 seconds.
46
47
48Description
49-----------
50
51This ioctl call asks the Video Device to return the current framerate.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-get-navi.rst b/Documentation/media/uapi/dvb/video-get-navi.rst
new file mode 100644
index 000000000000..6c3034fe5fa2
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-navi.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_NAVI:
4
5==============
6VIDEO_GET_NAVI
7==============
8
9Name
10----
11
12VIDEO_GET_NAVI
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_GET_NAVI , video_navi_pack_t *navipack)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_NAVI for this command.
40
41 - .. row 3
42
43 - video_navi_pack_t \*navipack
44
45 - PCI or DSI pack (private stream 2) according to section ??.
46
47
48Description
49-----------
50
51This ioctl returns navigational information from the DVD stream. This is
52especially needed if an encoded stream has to be decoded by the
53hardware.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EFAULT``
73
74 - driver is not able to return navigational information
diff --git a/Documentation/media/uapi/dvb/video-get-pts.rst b/Documentation/media/uapi/dvb/video-get-pts.rst
new file mode 100644
index 000000000000..082612243bbb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-pts.rst
@@ -0,0 +1,69 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_PTS:
4
5=============
6VIDEO_GET_PTS
7=============
8
9Name
10----
11
12VIDEO_GET_PTS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_GET_PTS, __u64 *pts)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_PTS for this command.
40
41 - .. row 3
42
43 - __u64 \*pts
44
45 - Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 /
46 ISO/IEC 13818-1.
47
48 The PTS should belong to the currently played frame if possible,
49 but may also be a value close to it like the PTS of the last
50 decoded frame or the last PTS extracted by the PES parser.
51
52
53Description
54-----------
55
56This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
57this ioctl has been replaced by the ``V4L2_CID_MPEG_VIDEO_DEC_PTS``
58control.
59
60This ioctl call asks the Video Device to return the current PTS
61timestamp.
62
63
64Return Value
65------------
66
67On success 0 is returned, on error -1 and the ``errno`` variable is set
68appropriately. The generic error codes are described at the
69:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-get-size.rst b/Documentation/media/uapi/dvb/video-get-size.rst
new file mode 100644
index 000000000000..c75e3c47c471
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-size.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_SIZE:
4
5==============
6VIDEO_GET_SIZE
7==============
8
9Name
10----
11
12VIDEO_GET_SIZE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_GET_SIZE, video_size_t *size)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_SIZE for this command.
40
41 - .. row 3
42
43 - video_size_t \*size
44
45 - Returns the size and aspect ratio.
46
47
48Description
49-----------
50
51This ioctl returns the size and aspect ratio.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-get-status.rst b/Documentation/media/uapi/dvb/video-get-status.rst
new file mode 100644
index 000000000000..ab9c2236df7e
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-get-status.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_STATUS:
4
5================
6VIDEO_GET_STATUS
7================
8
9Name
10----
11
12VIDEO_GET_STATUS
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_GET_STATUS, struct video_status *status)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_GET_STATUS for this command.
40
41 - .. row 3
42
43 - struct video_status \*status
44
45 - Returns the current status of the Video Device.
46
47
48Description
49-----------
50
51This ioctl call asks the Video Device to return the current status of
52the device.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-play.rst b/Documentation/media/uapi/dvb/video-play.rst
new file mode 100644
index 000000000000..943c4b755372
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-play.rst
@@ -0,0 +1,57 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_PLAY:
4
5==========
6VIDEO_PLAY
7==========
8
9Name
10----
11
12VIDEO_PLAY
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_PLAY)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_PLAY for this command.
40
41
42Description
43-----------
44
45This ioctl is for DVB devices only. To control a V4L2 decoder use the
46V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
47
48This ioctl call asks the Video Device to start playing a video stream
49from the selected source.
50
51
52Return Value
53------------
54
55On success 0 is returned, on error -1 and the ``errno`` variable is set
56appropriately. The generic error codes are described at the
57:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-select-source.rst b/Documentation/media/uapi/dvb/video-select-source.rst
new file mode 100644
index 000000000000..0ee0d03dbeb2
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-select-source.rst
@@ -0,0 +1,65 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SELECT_SOURCE:
4
5===================
6VIDEO_SELECT_SOURCE
7===================
8
9Name
10----
11
12VIDEO_SELECT_SOURCE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SELECT_SOURCE, video_stream_source_t source)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SELECT_SOURCE for this command.
40
41 - .. row 3
42
43 - video_stream_source_t source
44
45 - Indicates which source shall be used for the Video stream.
46
47
48Description
49-----------
50
51This ioctl is for DVB devices only. This ioctl was also supported by the
52V4L2 ivtv driver, but that has been replaced by the ivtv-specific
53``IVTV_IOC_PASSTHROUGH_MODE`` ioctl.
54
55This ioctl call informs the video device which source shall be used for
56the input data. The possible sources are demux or memory. If memory is
57selected, the data is fed to the video device through the write command.
58
59
60Return Value
61------------
62
63On success 0 is returned, on error -1 and the ``errno`` variable is set
64appropriately. The generic error codes are described at the
65:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-set-attributes.rst b/Documentation/media/uapi/dvb/video-set-attributes.rst
new file mode 100644
index 000000000000..326c5c876e80
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-attributes.rst
@@ -0,0 +1,75 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_ATTRIBUTES:
4
5====================
6VIDEO_SET_ATTRIBUTES
7====================
8
9Name
10----
11
12VIDEO_SET_ATTRIBUTES
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE ,video_attributes_t vattr)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_ATTRIBUTE for this command.
40
41 - .. row 3
42
43 - video_attributes_t vattr
44
45 - video attributes according to section ??.
46
47
48Description
49-----------
50
51This ioctl is intended for DVD playback and allows you to set certain
52information about the stream. Some hardware may not need this
53information, but the call also tells the hardware to prepare for DVD
54playback.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
63
64
65
66.. flat-table::
67 :header-rows: 0
68 :stub-columns: 0
69
70
71 - .. row 1
72
73 - ``EINVAL``
74
75 - input is not a valid attribute setting.
diff --git a/Documentation/media/uapi/dvb/video-set-blank.rst b/Documentation/media/uapi/dvb/video-set-blank.rst
new file mode 100644
index 000000000000..142ea8817380
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-blank.rst
@@ -0,0 +1,64 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_BLANK:
4
5===============
6VIDEO_SET_BLANK
7===============
8
9Name
10----
11
12VIDEO_SET_BLANK
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_BLANK, boolean mode)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_BLANK for this command.
40
41 - .. row 3
42
43 - boolean mode
44
45 - TRUE: Blank screen when stop.
46
47 - .. row 4
48
49 -
50 - FALSE: Show last decoded frame.
51
52
53Description
54-----------
55
56This ioctl call asks the Video Device to blank out the picture.
57
58
59Return Value
60------------
61
62On success 0 is returned, on error -1 and the ``errno`` variable is set
63appropriately. The generic error codes are described at the
64:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-set-display-format.rst b/Documentation/media/uapi/dvb/video-set-display-format.rst
new file mode 100644
index 000000000000..2061ab064977
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-display-format.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_DISPLAY_FORMAT:
4
5========================
6VIDEO_SET_DISPLAY_FORMAT
7========================
8
9Name
10----
11
12VIDEO_SET_DISPLAY_FORMAT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_DISPLAY_FORMAT, video_display_format_t format)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_DISPLAY_FORMAT for this command.
40
41 - .. row 3
42
43 - video_display_format_t format
44
45 - Selects the video format to be used.
46
47
48Description
49-----------
50
51This ioctl call asks the Video Device to select the video format to be
52applied by the MPEG chip on the video.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-set-format.rst b/Documentation/media/uapi/dvb/video-set-format.rst
new file mode 100644
index 000000000000..53d66ec462ca
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-format.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_FORMAT:
4
5================
6VIDEO_SET_FORMAT
7================
8
9Name
10----
11
12VIDEO_SET_FORMAT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_FORMAT, video_format_t format)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_FORMAT for this command.
40
41 - .. row 3
42
43 - video_format_t format
44
45 - video format of TV as defined in section ??.
46
47
48Description
49-----------
50
51This ioctl sets the screen format (aspect ratio) of the connected output
52device (TV) so that the output of the decoder can be adjusted
53accordingly.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EINVAL``
73
74 - format is not a valid video format.
diff --git a/Documentation/media/uapi/dvb/video-set-highlight.rst b/Documentation/media/uapi/dvb/video-set-highlight.rst
new file mode 100644
index 000000000000..374f5d895b4d
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-highlight.rst
@@ -0,0 +1,60 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_HIGHLIGHT:
4
5===================
6VIDEO_SET_HIGHLIGHT
7===================
8
9Name
10----
11
12VIDEO_SET_HIGHLIGHT
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT ,video_highlight_t *vhilite)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_HIGHLIGHT for this command.
40
41 - .. row 3
42
43 - video_highlight_t \*vhilite
44
45 - SPU Highlight information according to section ??.
46
47
48Description
49-----------
50
51This ioctl sets the SPU highlight information for the menu access of a
52DVD.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-set-id.rst b/Documentation/media/uapi/dvb/video-set-id.rst
new file mode 100644
index 000000000000..9c002d5399ad
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-id.rst
@@ -0,0 +1,73 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_ID:
4
5============
6VIDEO_SET_ID
7============
8
9Name
10----
11
12VIDEO_SET_ID
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_SET_ID, int id)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_ID for this command.
40
41 - .. row 3
42
43 - int id
44
45 - video sub-stream id
46
47
48Description
49-----------
50
51This ioctl selects which sub-stream is to be decoded if a program or
52system stream is sent to the video device.
53
54
55Return Value
56------------
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62
63
64.. flat-table::
65 :header-rows: 0
66 :stub-columns: 0
67
68
69 - .. row 1
70
71 - ``EINVAL``
72
73 - Invalid sub-stream id.
diff --git a/Documentation/media/uapi/dvb/video-set-spu-palette.rst b/Documentation/media/uapi/dvb/video-set-spu-palette.rst
new file mode 100644
index 000000000000..4b80b6f56219
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-spu-palette.rst
@@ -0,0 +1,72 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_SPU_PALETTE:
4
5=====================
6VIDEO_SET_SPU_PALETTE
7=====================
8
9Name
10----
11
12VIDEO_SET_SPU_PALETTE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE, video_spu_palette_t *palette )
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_SPU_PALETTE for this command.
40
41 - .. row 3
42
43 - video_spu_palette_t \*palette
44
45 - SPU palette according to section ??.
46
47
48Description
49-----------
50
51This ioctl sets the SPU color palette.
52
53
54Return Value
55------------
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61
62
63.. flat-table::
64 :header-rows: 0
65 :stub-columns: 0
66
67
68 - .. row 1
69
70 - ``EINVAL``
71
72 - input is not a valid palette or driver doesn’t handle SPU.
diff --git a/Documentation/media/uapi/dvb/video-set-spu.rst b/Documentation/media/uapi/dvb/video-set-spu.rst
new file mode 100644
index 000000000000..a6f6924f10c4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-spu.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_SPU:
4
5=============
6VIDEO_SET_SPU
7=============
8
9Name
10----
11
12VIDEO_SET_SPU
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_SPU , video_spu_t *spu)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_SPU for this command.
40
41 - .. row 3
42
43 - video_spu_t \*spu
44
45 - SPU decoding (de)activation and subid setting according to section
46 ??.
47
48
49Description
50-----------
51
52This ioctl activates or deactivates SPU decoding in a DVD input stream.
53It can only be used, if the driver is able to handle a DVD stream.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EINVAL``
73
74 - input is not a valid spu setting or driver cannot handle SPU.
diff --git a/Documentation/media/uapi/dvb/video-set-streamtype.rst b/Documentation/media/uapi/dvb/video-set-streamtype.rst
new file mode 100644
index 000000000000..75b2e7a6e829
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-streamtype.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_STREAMTYPE:
4
5====================
6VIDEO_SET_STREAMTYPE
7====================
8
9Name
10----
11
12VIDEO_SET_STREAMTYPE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_STREAMTYPE, int type)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_STREAMTYPE for this command.
40
41 - .. row 3
42
43 - int type
44
45 - stream type
46
47
48Description
49-----------
50
51This ioctl tells the driver which kind of stream to expect being written
52to it. If this call is not used the default of video PES is used. Some
53drivers might not support this call and always expect PES.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-set-system.rst b/Documentation/media/uapi/dvb/video-set-system.rst
new file mode 100644
index 000000000000..9ae0df1f5813
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-set-system.rst
@@ -0,0 +1,75 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SET_SYSTEM:
4
5================
6VIDEO_SET_SYSTEM
7================
8
9Name
10----
11
12VIDEO_SET_SYSTEM
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SET_SYSTEM , video_system_t system)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SET_FORMAT for this command.
40
41 - .. row 3
42
43 - video_system_t system
44
45 - video system of TV output.
46
47
48Description
49-----------
50
51This ioctl sets the television output format. The format (see section
52??) may vary from the color format of the displayed MPEG stream. If the
53hardware is not able to display the requested format the call will
54return an error.
55
56
57Return Value
58------------
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
63
64
65
66.. flat-table::
67 :header-rows: 0
68 :stub-columns: 0
69
70
71 - .. row 1
72
73 - ``EINVAL``
74
75 - system is not a valid or supported video system.
diff --git a/Documentation/media/uapi/dvb/video-slowmotion.rst b/Documentation/media/uapi/dvb/video-slowmotion.rst
new file mode 100644
index 000000000000..905712844f6a
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-slowmotion.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_SLOWMOTION:
4
5================
6VIDEO_SLOWMOTION
7================
8
9Name
10----
11
12VIDEO_SLOWMOTION
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_SLOWMOTION, int nFrames)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_SLOWMOTION for this command.
40
41 - .. row 3
42
43 - int nFrames
44
45 - The number of times to repeat each frame.
46
47
48Description
49-----------
50
51This ioctl call asks the video device to repeat decoding frames N number
52of times. This call can only be used if VIDEO_SOURCE_MEMORY is
53selected.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63
64
65.. flat-table::
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - ``EPERM``
73
74 - Mode VIDEO_SOURCE_MEMORY not selected.
diff --git a/Documentation/media/uapi/dvb/video-stillpicture.rst b/Documentation/media/uapi/dvb/video-stillpicture.rst
new file mode 100644
index 000000000000..ed3a2f53b998
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-stillpicture.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_STILLPICTURE:
4
5==================
6VIDEO_STILLPICTURE
7==================
8
9Name
10----
11
12VIDEO_STILLPICTURE
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_STILLPICTURE, struct video_still_picture *sp)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_STILLPICTURE for this command.
40
41 - .. row 3
42
43 - struct video_still_picture \*sp
44
45 - Pointer to a location where an I-frame and size is stored.
46
47
48Description
49-----------
50
51This ioctl call asks the Video Device to display a still picture
52(I-frame). The input data shall contain an I-frame. If the pointer is
53NULL, then the current displayed still picture is blanked.
54
55
56Return Value
57------------
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-stop.rst b/Documentation/media/uapi/dvb/video-stop.rst
new file mode 100644
index 000000000000..ad8d59e06004
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-stop.rst
@@ -0,0 +1,74 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_STOP:
4
5==========
6VIDEO_STOP
7==========
8
9Name
10----
11
12VIDEO_STOP
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(fd, int request = VIDEO_STOP, boolean mode)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_STOP for this command.
40
41 - .. row 3
42
43 - Boolean mode
44
45 - Indicates how the screen shall be handled.
46
47 - .. row 4
48
49 -
50 - TRUE: Blank screen when stop.
51
52 - .. row 5
53
54 -
55 - FALSE: Show last decoded frame.
56
57
58Description
59-----------
60
61This ioctl is for DVB devices only. To control a V4L2 decoder use the
62V4L2 :ref:`VIDIOC_DECODER_CMD` instead.
63
64This ioctl call asks the Video Device to stop playing the current
65stream. Depending on the input parameter, the screen can be blanked out
66or displaying the last decoded frame.
67
68
69Return Value
70------------
71
72On success 0 is returned, on error -1 and the ``errno`` variable is set
73appropriately. The generic error codes are described at the
74:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video-try-command.rst b/Documentation/media/uapi/dvb/video-try-command.rst
new file mode 100644
index 000000000000..df96c2d7fc6b
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video-try-command.rst
@@ -0,0 +1,66 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_TRY_COMMAND:
4
5=================
6VIDEO_TRY_COMMAND
7=================
8
9Name
10----
11
12VIDEO_TRY_COMMAND
13
14
15Synopsis
16--------
17
18.. cpp:function:: int ioctl(int fd, int request = VIDEO_TRY_COMMAND, struct video_command *cmd)
19
20
21Arguments
22---------
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27
28
29 - .. row 1
30
31 - int fd
32
33 - File descriptor returned by a previous call to open().
34
35 - .. row 2
36
37 - int request
38
39 - Equals VIDEO_TRY_COMMAND for this command.
40
41 - .. row 3
42
43 - struct video_command \*cmd
44
45 - Try a decoder command.
46
47
48Description
49-----------
50
51This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders
52this ioctl has been replaced by the
53:ref:`VIDIOC_TRY_DECODER_CMD <VIDIOC_DECODER_CMD>` ioctl.
54
55This ioctl tries a decoder command. The ``video_command`` struct is a
56subset of the ``v4l2_decoder_cmd`` struct, so refer to the
57:ref:`VIDIOC_TRY_DECODER_CMD <VIDIOC_DECODER_CMD>` documentation
58for more information.
59
60
61Return Value
62------------
63
64On success 0 is returned, on error -1 and the ``errno`` variable is set
65appropriately. The generic error codes are described at the
66:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/dvb/video.rst b/Documentation/media/uapi/dvb/video.rst
new file mode 100644
index 000000000000..60d43fb7ce22
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video.rst
@@ -0,0 +1,35 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dvb_video:
4
5################
6DVB Video Device
7################
8The DVB video device controls the MPEG2 video decoder of the DVB
9hardware. It can be accessed through **/dev/dvb/adapter0/video0**. Data
10types and and ioctl definitions can be accessed by including
11**linux/dvb/video.h** in your application.
12
13Note that the DVB video device only controls decoding of the MPEG video
14stream, not its presentation on the TV or computer screen. On PCs this
15is typically handled by an associated video4linux device, e.g.
16**/dev/video**, which allows scaling and defining output windows.
17
18Some DVB cards don’t have their own MPEG decoder, which results in the
19omission of the audio and video device as well as the video4linux
20device.
21
22The ioctls that deal with SPUs (sub picture units) and navigation
23packets are only supported on some MPEG decoders made for DVD playback.
24
25These ioctls were also used by V4L2 to control MPEG decoders implemented
26in V4L2. The use of these ioctls for that purpose has been made obsolete
27and proper V4L2 ioctls or controls have been created to replace that
28functionality.
29
30
31.. toctree::
32 :maxdepth: 1
33
34 video_types
35 video_function_calls
diff --git a/Documentation/media/uapi/dvb/video_function_calls.rst b/Documentation/media/uapi/dvb/video_function_calls.rst
new file mode 100644
index 000000000000..68588ac7fecb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video_function_calls.rst
@@ -0,0 +1,43 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_function_calls:
4
5********************
6Video Function Calls
7********************
8
9.. toctree::
10 :maxdepth: 1
11
12 video-fopen
13 video-fclose
14 video-fwrite
15 video-stop
16 video-play
17 video-freeze
18 video-continue
19 video-select-source
20 video-set-blank
21 video-get-status
22 video-get-frame-count
23 video-get-pts
24 video-get-frame-rate
25 video-get-event
26 video-command
27 video-try-command
28 video-get-size
29 video-set-display-format
30 video-stillpicture
31 video-fast-forward
32 video-slowmotion
33 video-get-capabilities
34 video-set-id
35 video-clear-buffer
36 video-set-streamtype
37 video-set-format
38 video-set-system
39 video-set-highlight
40 video-set-spu
41 video-set-spu-palette
42 video-get-navi
43 video-set-attributes
diff --git a/Documentation/media/uapi/dvb/video_h.rst b/Documentation/media/uapi/dvb/video_h.rst
new file mode 100644
index 000000000000..3f39b0c4879c
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video_h.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_h:
4
5*********************
6DVB Video Header File
7*********************
8
9.. kernel-include:: $BUILDDIR/video.h.rst
diff --git a/Documentation/media/uapi/dvb/video_types.rst b/Documentation/media/uapi/dvb/video_types.rst
new file mode 100644
index 000000000000..671f365ceeb4
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video_types.rst
@@ -0,0 +1,379 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video_types:
4
5****************
6Video Data Types
7****************
8
9
10.. _video-format-t:
11
12video_format_t
13==============
14
15The ``video_format_t`` data type defined by
16
17
18.. code-block:: c
19
20 typedef enum {
21 VIDEO_FORMAT_4_3, /* Select 4:3 format */
22 VIDEO_FORMAT_16_9, /* Select 16:9 format. */
23 VIDEO_FORMAT_221_1 /* 2.21:1 */
24 } video_format_t;
25
26is used in the VIDEO_SET_FORMAT function (??) to tell the driver which
27aspect ratio the output hardware (e.g. TV) has. It is also used in the
28data structures video_status (??) returned by VIDEO_GET_STATUS (??)
29and video_event (??) returned by VIDEO_GET_EVENT (??) which report
30about the display format of the current video stream.
31
32
33.. _video-displayformat-t:
34
35video_displayformat_t
36=====================
37
38In case the display format of the video stream and of the display
39hardware differ the application has to specify how to handle the
40cropping of the picture. This can be done using the
41VIDEO_SET_DISPLAY_FORMAT call (??) which accepts
42
43
44.. code-block:: c
45
46 typedef enum {
47 VIDEO_PAN_SCAN, /* use pan and scan format */
48 VIDEO_LETTER_BOX, /* use letterbox format */
49 VIDEO_CENTER_CUT_OUT /* use center cut out format */
50 } video_displayformat_t;
51
52as argument.
53
54
55.. _video-stream-source-t:
56
57video_stream_source_t
58=====================
59
60The video stream source is set through the VIDEO_SELECT_SOURCE call
61and can take the following values, depending on whether we are replaying
62from an internal (demuxer) or external (user write) source.
63
64
65.. code-block:: c
66
67 typedef enum {
68 VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
69 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
70 comes from the user through the write
71 system call */
72 } video_stream_source_t;
73
74VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the
75frontend or the DVR device) as the source of the video stream. If
76VIDEO_SOURCE_MEMORY is selected the stream comes from the application
77through the **write()** system call.
78
79
80.. _video-play-state-t:
81
82video_play_state_t
83==================
84
85The following values can be returned by the VIDEO_GET_STATUS call
86representing the state of video playback.
87
88
89.. code-block:: c
90
91 typedef enum {
92 VIDEO_STOPPED, /* Video is stopped */
93 VIDEO_PLAYING, /* Video is currently playing */
94 VIDEO_FREEZED /* Video is freezed */
95 } video_play_state_t;
96
97
98.. _video-command:
99
100struct video_command
101====================
102
103The structure must be zeroed before use by the application This ensures
104it can be extended safely in the future.
105
106
107.. code-block:: c
108
109 struct video_command {
110 __u32 cmd;
111 __u32 flags;
112 union {
113 struct {
114 __u64 pts;
115 } stop;
116
117 struct {
118 /* 0 or 1000 specifies normal speed,
119 1 specifies forward single stepping,
120 -1 specifies backward single stepping,
121 >>1: playback at speed/1000 of the normal speed,
122 <-1: reverse playback at (-speed/1000) of the normal speed. */
123 __s32 speed;
124 __u32 format;
125 } play;
126
127 struct {
128 __u32 data[16];
129 } raw;
130 };
131 };
132
133
134.. _video-size-t:
135
136video_size_t
137============
138
139
140.. code-block:: c
141
142 typedef struct {
143 int w;
144 int h;
145 video_format_t aspect_ratio;
146 } video_size_t;
147
148
149.. _video-event:
150
151struct video_event
152==================
153
154The following is the structure of a video event as it is returned by the
155VIDEO_GET_EVENT call.
156
157
158.. code-block:: c
159
160 struct video_event {
161 __s32 type;
162 #define VIDEO_EVENT_SIZE_CHANGED 1
163 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
164 #define VIDEO_EVENT_DECODER_STOPPED 3
165 #define VIDEO_EVENT_VSYNC 4
166 __kernel_time_t timestamp;
167 union {
168 video_size_t size;
169 unsigned int frame_rate; /* in frames per 1000sec */
170 unsigned char vsync_field; /* unknown/odd/even/progressive */
171 } u;
172 };
173
174
175.. _video-status:
176
177struct video_status
178===================
179
180The VIDEO_GET_STATUS call returns the following structure informing
181about various states of the playback operation.
182
183
184.. code-block:: c
185
186 struct video_status {
187 int video_blank; /* blank video on freeze? */
188 video_play_state_t play_state; /* current state of playback */
189 video_stream_source_t stream_source; /* current source (demux/memory) */
190 video_format_t video_format; /* current aspect ratio of stream */
191 video_displayformat_t display_format;/* selected cropping mode */
192 };
193
194If video_blank is set video will be blanked out if the channel is
195changed or if playback is stopped. Otherwise, the last picture will be
196displayed. play_state indicates if the video is currently frozen,
197stopped, or being played back. The stream_source corresponds to the
198seleted source for the video stream. It can come either from the
199demultiplexer or from memory. The video_format indicates the aspect
200ratio (one of 4:3 or 16:9) of the currently played video stream.
201Finally, display_format corresponds to the selected cropping mode in
202case the source video format is not the same as the format of the output
203device.
204
205
206.. _video-still-picture:
207
208struct video_still_picture
209==========================
210
211An I-frame displayed via the VIDEO_STILLPICTURE call is passed on
212within the following structure.
213
214
215.. code-block:: c
216
217 /* pointer to and size of a single iframe in memory */
218 struct video_still_picture {
219 char *iFrame; /* pointer to a single iframe in memory */
220 int32_t size;
221 };
222
223
224.. _video_caps:
225
226video capabilities
227==================
228
229A call to VIDEO_GET_CAPABILITIES returns an unsigned integer with the
230following bits set according to the hardwares capabilities.
231
232
233.. code-block:: c
234
235 /* bit definitions for capabilities: */
236 /* can the hardware decode MPEG1 and/or MPEG2? */
237 #define VIDEO_CAP_MPEG1 1
238 #define VIDEO_CAP_MPEG2 2
239 /* can you send a system and/or program stream to video device?
240 (you still have to open the video and the audio device but only
241 send the stream to the video device) */
242 #define VIDEO_CAP_SYS 4
243 #define VIDEO_CAP_PROG 8
244 /* can the driver also handle SPU, NAVI and CSS encoded data?
245 (CSS API is not present yet) */
246 #define VIDEO_CAP_SPU 16
247 #define VIDEO_CAP_NAVI 32
248 #define VIDEO_CAP_CSS 64
249
250
251.. _video-system:
252
253video_system_t
254==============
255
256A call to VIDEO_SET_SYSTEM sets the desired video system for TV
257output. The following system types can be set:
258
259
260.. code-block:: c
261
262 typedef enum {
263 VIDEO_SYSTEM_PAL,
264 VIDEO_SYSTEM_NTSC,
265 VIDEO_SYSTEM_PALN,
266 VIDEO_SYSTEM_PALNc,
267 VIDEO_SYSTEM_PALM,
268 VIDEO_SYSTEM_NTSC60,
269 VIDEO_SYSTEM_PAL60,
270 VIDEO_SYSTEM_PALM60
271 } video_system_t;
272
273
274.. _video-highlight:
275
276struct video_highlight
277======================
278
279Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight
280information. The call expects the following format for that information:
281
282
283.. code-block:: c
284
285 typedef
286 struct video_highlight {
287 boolean active; /* 1=show highlight, 0=hide highlight */
288 uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
289 /* 3- 0 Background pixel contrast */
290 uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
291 /* 3- 0 Emphasis pixel-1 contrast */
292 uint8_t color1; /* 7- 4 Pattern pixel color */
293 /* 3- 0 Background pixel color */
294 uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
295 /* 3- 0 Emphasis pixel-1 color */
296 uint32_t ypos; /* 23-22 auto action mode */
297 /* 21-12 start y */
298 /* 9- 0 end y */
299 uint32_t xpos; /* 23-22 button color number */
300 /* 21-12 start x */
301 /* 9- 0 end x */
302 } video_highlight_t;
303
304
305.. _video-spu:
306
307struct video_spu
308================
309
310Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according
311to the following format:
312
313
314.. code-block:: c
315
316 typedef
317 struct video_spu {
318 boolean active;
319 int stream_id;
320 } video_spu_t;
321
322
323.. _video-spu-palette:
324
325struct video_spu_palette
326========================
327
328The following structure is used to set the SPU palette by calling
329VIDEO_SPU_PALETTE:
330
331
332.. code-block:: c
333
334 typedef
335 struct video_spu_palette {
336 int length;
337 uint8_t *palette;
338 } video_spu_palette_t;
339
340
341.. _video-navi-pack:
342
343struct video_navi_pack
344======================
345
346In order to get the navigational data the following structure has to be
347passed to the ioctl VIDEO_GET_NAVI:
348
349
350.. code-block:: c
351
352 typedef
353 struct video_navi_pack {
354 int length; /* 0 ... 1024 */
355 uint8_t data[1024];
356 } video_navi_pack_t;
357
358
359.. _video-attributes-t:
360
361video_attributes_t
362==================
363
364The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
365
366
367.. code-block:: c
368
369 typedef uint16_t video_attributes_t;
370 /* bits: descr. */
371 /* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
372 /* 13-12 TV system (0=525/60, 1=625/50) */
373 /* 11-10 Aspect ratio (0=4:3, 3=16:9) */
374 /* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
375 /* 7 line 21-1 data present in GOP (1=yes, 0=no) */
376 /* 6 line 21-2 data present in GOP (1=yes, 0=no) */
377 /* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
378 /* 2 source letterboxed (1=yes, 0=no) */
379 /* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
diff --git a/Documentation/media/uapi/fdl-appendix.rst b/Documentation/media/uapi/fdl-appendix.rst
new file mode 100644
index 000000000000..fd475180fed8
--- /dev/null
+++ b/Documentation/media/uapi/fdl-appendix.rst
@@ -0,0 +1,471 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _fdl:
4
5******************************
6GNU Free Documentation License
7******************************
8
9
10.. _fdl-preamble:
11
120. PREAMBLE
13===========
14
15The purpose of this License is to make a manual, textbook, or other
16written document “free” in the sense of freedom: to assure everyone the
17effective freedom to copy and redistribute it, with or without modifying
18it, either commercially or noncommercially. Secondarily, this License
19preserves for the author and publisher a way to get credit for their
20work, while not being considered responsible for modifications made by
21others.
22
23This License is a kind of “copyleft”, which means that derivative works
24of the document must themselves be free in the same sense. It
25complements the GNU General Public License, which is a copyleft license
26designed for free software.
27
28We have designed this License in order to use it for manuals for free
29software, because free software needs free documentation: a free program
30should come with manuals providing the same freedoms that the software
31does. But this License is not limited to software manuals; it can be
32used for any textual work, regardless of subject matter or whether it is
33published as a printed book. We recommend this License principally for
34works whose purpose is instruction or reference.
35
36
37.. _fdl-section1:
38
391. APPLICABILITY AND DEFINITIONS
40================================
41
42
43.. _fdl-document:
44
45This License applies to any manual or other work that contains a notice
46placed by the copyright holder saying it can be distributed under the
47terms of this License. The “Document”, below, refers to any such manual
48or work. Any member of the public is a licensee, and is addressed as
49“you”.
50
51
52.. _fdl-modified:
53
54A “Modified Version” of the Document means any work containing the
55Document or a portion of it, either copied verbatim, or with
56modifications and/or translated into another language.
57
58
59.. _fdl-secondary:
60
61A “Secondary Section” is a named appendix or a front-matter section of
62the :ref:`Document <fdl-document>` that deals exclusively with the
63relationship of the publishers or authors of the Document to the
64Document's overall subject (or to related matters) and contains nothing
65that could fall directly within that overall subject. (For example, if
66the Document is in part a textbook of mathematics, a Secondary Section
67may not explain any mathematics.) The relationship could be a matter of
68historical connection with the subject or with related matters, or of
69legal, commercial, philosophical, ethical or political position
70regarding them.
71
72
73.. _fdl-invariant:
74
75The “Invariant Sections” are certain
76:ref:`Secondary Sections <fdl-secondary>` whose titles are designated,
77as being those of Invariant Sections, in the notice that says that the
78:ref:`Document <fdl-document>` is released under this License.
79
80
81.. _fdl-cover-texts:
82
83The “Cover Texts” are certain short passages of text that are listed, as
84Front-Cover Texts or Back-Cover Texts, in the notice that says that the
85:ref:`Document <fdl-document>` is released under this License.
86
87
88.. _fdl-transparent:
89
90A “Transparent” copy of the :ref:`Document <fdl-document>` means a
91machine-readable copy, represented in a format whose specification is
92available to the general public, whose contents can be viewed and edited
93directly and straightforwardly with generic text editors or (for images
94composed of pixels) generic paint programs or (for drawings) some widely
95available drawing editor, and that is suitable for input to text
96formatters or for automatic translation to a variety of formats suitable
97for input to text formatters. A copy made in an otherwise Transparent
98file format whose markup has been designed to thwart or discourage
99subsequent modification by readers is not Transparent. A copy that is
100not “Transparent” is called “Opaque”.
101
102Examples of suitable formats for Transparent copies include plain ASCII
103without markup, Texinfo input format, LaTeX input format, SGML or XML
104using a publicly available DTD, and standard-conforming simple HTML
105designed for human modification. Opaque formats include PostScript, PDF,
106proprietary formats that can be read and edited only by proprietary word
107processors, SGML or XML for which the DTD and/or processing tools are
108not generally available, and the machine-generated HTML produced by some
109word processors for output purposes only.
110
111
112.. _fdl-title-page:
113
114The “Title Page” means, for a printed book, the title page itself, plus
115such following pages as are needed to hold, legibly, the material this
116License requires to appear in the title page. For works in formats which
117do not have any title page as such, “Title Page” means the text near the
118most prominent appearance of the work's title, preceding the beginning
119of the body of the text.
120
121
122.. _fdl-section2:
123
1242. VERBATIM COPYING
125===================
126
127You may copy and distribute the :ref:`Document <fdl-document>` in any
128medium, either commercially or noncommercially, provided that this
129License, the copyright notices, and the license notice saying this
130License applies to the Document are reproduced in all copies, and that
131you add no other conditions whatsoever to those of this License. You may
132not use technical measures to obstruct or control the reading or further
133copying of the copies you make or distribute. However, you may accept
134compensation in exchange for copies. If you distribute a large enough
135number of copies you must also follow the conditions in
136:ref:`section 3 <fdl-section3>`.
137
138You may also lend copies, under the same conditions stated above, and
139you may publicly display copies.
140
141
142.. _fdl-section3:
143
1443. COPYING IN QUANTITY
145======================
146
147If you publish printed copies of the :ref:`Document <fdl-document>`
148numbering more than 100, and the Document's license notice requires
149:ref:`Cover Texts <fdl-cover-texts>`, you must enclose the copies in
150covers that carry, clearly and legibly, all these Cover Texts:
151Front-Cover Texts on the front cover, and Back-Cover Texts on the back
152cover. Both covers must also clearly and legibly identify you as the
153publisher of these copies. The front cover must present the full title
154with all words of the title equally prominent and visible. You may add
155other material on the covers in addition. Copying with changes limited
156to the covers, as long as they preserve the title of the
157:ref:`Document <fdl-document>` and satisfy these conditions, can be
158treated as verbatim copying in other respects.
159
160If the required texts for either cover are too voluminous to fit
161legibly, you should put the first ones listed (as many as fit
162reasonably) on the actual cover, and continue the rest onto adjacent
163pages.
164
165If you publish or distribute :ref:`Opaque <fdl-transparent>` copies of
166the :ref:`Document <fdl-document>` numbering more than 100, you must
167either include a machine-readable :ref:`Transparent <fdl-transparent>`
168copy along with each Opaque copy, or state in or with each Opaque copy a
169publicly-accessible computer-network location containing a complete
170Transparent copy of the Document, free of added material, which the
171general network-using public has access to download anonymously at no
172charge using public-standard network protocols. If you use the latter
173option, you must take reasonably prudent steps, when you begin
174distribution of Opaque copies in quantity, to ensure that this
175Transparent copy will remain thus accessible at the stated location
176until at least one year after the last time you distribute an Opaque
177copy (directly or through your agents or retailers) of that edition to
178the public.
179
180It is requested, but not required, that you contact the authors of the
181:ref:`Document <fdl-document>` well before redistributing any large
182number of copies, to give them a chance to provide you with an updated
183version of the Document.
184
185
186.. _fdl-section4:
187
1884. MODIFICATIONS
189================
190
191You may copy and distribute a :ref:`Modified Version <fdl-modified>`
192of the :ref:`Document <fdl-document>` under the conditions of sections
193:ref:`2 <fdl-section2>` and :ref:`3 <fdl-section3>` above, provided
194that you release the Modified Version under precisely this License, with
195the Modified Version filling the role of the Document, thus licensing
196distribution and modification of the Modified Version to whoever
197possesses a copy of it. In addition, you must do these things in the
198Modified Version:
199
200- **A.**
201 Use in the :ref:`Title Page <fdl-title-page>` (and on the covers,
202 if any) a title distinct from that of the
203 :ref:`Document <fdl-document>`, and from those of previous versions
204 (which should, if there were any, be listed in the History section of
205 the Document). You may use the same title as a previous version if
206 the original publisher of that version gives permission.
207
208- **B.**
209 List on the :ref:`Title Page <fdl-title-page>`, as authors, one or
210 more persons or entities responsible for authorship of the
211 modifications in the :ref:`Modified Version <fdl-modified>`,
212 together with at least five of the principal authors of the
213 :ref:`Document <fdl-document>` (all of its principal authors, if it
214 has less than five).
215
216- **C.**
217 State on the :ref:`Title Page <fdl-title-page>` the name of the
218 publisher of the :ref:`Modified Version <fdl-modified>`, as the
219 publisher.
220
221- **D.**
222 Preserve all the copyright notices of the
223 :ref:`Document <fdl-document>`.
224
225- **E.**
226 Add an appropriate copyright notice for your modifications adjacent
227 to the other copyright notices.
228
229- **F.**
230 Include, immediately after the copyright notices, a license notice
231 giving the public permission to use the
232 :ref:`Modified Version <fdl-modified>` under the terms of this
233 License, in the form shown in the Addendum below.
234
235- **G.**
236 Preserve in that license notice the full lists of
237 :ref:`Invariant Sections <fdl-invariant>` and required
238 :ref:`Cover Texts <fdl-cover-texts>` given in the
239 :ref:`Document's <fdl-document>` license notice.
240
241- **H.**
242 Include an unaltered copy of this License.
243
244- **I.**
245 Preserve the section entitled “History”, and its title, and add to it
246 an item stating at least the title, year, new authors, and publisher
247 of the :ref:`Modified Version <fdl-modified>` as given on the
248 :ref:`Title Page <fdl-title-page>`. If there is no section entitled
249 “History” in the :ref:`Document <fdl-document>`, create one stating
250 the title, year, authors, and publisher of the Document as given on
251 its Title Page, then add an item describing the Modified Version as
252 stated in the previous sentence.
253
254- **J.**
255 Preserve the network location, if any, given in the
256 :ref:`Document <fdl-document>` for public access to a
257 :ref:`Transparent <fdl-transparent>` copy of the Document, and
258 likewise the network locations given in the Document for previous
259 versions it was based on. These may be placed in the “History”
260 section. You may omit a network location for a work that was
261 published at least four years before the Document itself, or if the
262 original publisher of the version it refers to gives permission.
263
264- **K.**
265 In any section entitled “Acknowledgements” or “Dedications”, preserve
266 the section's title, and preserve in the section all the substance
267 and tone of each of the contributor acknowledgements and/or
268 dedications given therein.
269
270- **L.**
271 Preserve all the :ref:`Invariant Sections <fdl-invariant>` of the
272 :ref:`Document <fdl-document>`, unaltered in their text and in
273 their titles. Section numbers or the equivalent are not considered
274 part of the section titles.
275
276- **M.**
277 Delete any section entitled “Endorsements”. Such a section may not be
278 included in the :ref:`Modified Version <fdl-modified>`.
279
280- **N.**
281 Do not retitle any existing section as “Endorsements” or to conflict
282 in title with any :ref:`Invariant Section <fdl-invariant>`.
283
284If the :ref:`Modified Version <fdl-modified>` includes new
285front-matter sections or appendices that qualify as
286:ref:`Secondary Sections <fdl-secondary>` and contain no material
287copied from the Document, you may at your option designate some or all
288of these sections as invariant. To do this, add their titles to the list
289of :ref:`Invariant Sections <fdl-invariant>` in the Modified Version's
290license notice. These titles must be distinct from any other section
291titles.
292
293You may add a section entitled “Endorsements”, provided it contains
294nothing but endorsements of your
295:ref:`Modified Version <fdl-modified>` by various parties--for
296example, statements of peer review or that the text has been approved by
297an organization as the authoritative definition of a standard.
298
299You may add a passage of up to five words as a
300:ref:`Front-Cover Text <fdl-cover-texts>`, and a passage of up to 25
301words as a :ref:`Back-Cover Text <fdl-cover-texts>`, to the end of the
302list of :ref:`Cover Texts <fdl-cover-texts>` in the
303:ref:`Modified Version <fdl-modified>`. Only one passage of
304Front-Cover Text and one of Back-Cover Text may be added by (or through
305arrangements made by) any one entity. If the
306:ref:`Document <fdl-document>` already includes a cover text for the
307same cover, previously added by you or by arrangement made by the same
308entity you are acting on behalf of, you may not add another; but you may
309replace the old one, on explicit permission from the previous publisher
310that added the old one.
311
312The author(s) and publisher(s) of the :ref:`Document <fdl-document>`
313do not by this License give permission to use their names for publicity
314for or to assert or imply endorsement of any
315:ref:`Modified Version <fdl-modified>`.
316
317
318.. _fdl-section5:
319
3205. COMBINING DOCUMENTS
321======================
322
323You may combine the :ref:`Document <fdl-document>` with other
324documents released under this License, under the terms defined in
325:ref:`section 4 <fdl-section4>` above for modified versions, provided
326that you include in the combination all of the
327:ref:`Invariant Sections <fdl-invariant>` of all of the original
328documents, unmodified, and list them all as Invariant Sections of your
329combined work in its license notice.
330
331The combined work need only contain one copy of this License, and
332multiple identical :ref:`Invariant Sections <fdl-invariant>` may be
333replaced with a single copy. If there are multiple Invariant Sections
334with the same name but different contents, make the title of each such
335section unique by adding at the end of it, in parentheses, the name of
336the original author or publisher of that section if known, or else a
337unique number. Make the same adjustment to the section titles in the
338list of Invariant Sections in the license notice of the combined work.
339
340In the combination, you must combine any sections entitled “History” in
341the various original documents, forming one section entitled “History”;
342likewise combine any sections entitled “Acknowledgements”, and any
343sections entitled “Dedications”. You must delete all sections entitled
344“Endorsements.”
345
346
347.. _fdl-section6:
348
3496. COLLECTIONS OF DOCUMENTS
350===========================
351
352You may make a collection consisting of the
353:ref:`Document <fdl-document>` and other documents released under this
354License, and replace the individual copies of this License in the
355various documents with a single copy that is included in the collection,
356provided that you follow the rules of this License for verbatim copying
357of each of the documents in all other respects.
358
359You may extract a single document from such a collection, and dispbibute
360it individually under this License, provided you insert a copy of this
361License into the extracted document, and follow this License in all
362other respects regarding verbatim copying of that document.
363
364
365.. _fdl-section7:
366
3677. AGGREGATION WITH INDEPENDENT WORKS
368=====================================
369
370A compilation of the :ref:`Document <fdl-document>` or its derivatives
371with other separate and independent documents or works, in or on a
372volume of a storage or distribution medium, does not as a whole count as
373a :ref:`Modified Version <fdl-modified>` of the Document, provided no
374compilation copyright is claimed for the compilation. Such a compilation
375is called an “aggregate”, and this License does not apply to the other
376self-contained works thus compiled with the Document , on account of
377their being thus compiled, if they are not themselves derivative works
378of the Document. If the :ref:`Cover Text <fdl-cover-texts>`
379requirement of :ref:`section 3 <fdl-section3>` is applicable to these
380copies of the Document, then if the Document is less than one quarter of
381the entire aggregate, the Document's Cover Texts may be placed on covers
382that surround only the Document within the aggregate. Otherwise they
383must appear on covers around the whole aggregate.
384
385
386.. _fdl-section8:
387
3888. TRANSLATION
389==============
390
391Translation is considered a kind of modification, so you may distribute
392translations of the :ref:`Document <fdl-document>` under the terms of
393:ref:`section 4 <fdl-section4>`. Replacing
394:ref:`Invariant Sections <fdl-invariant>` with translations requires
395special permission from their copyright holders, but you may include
396translations of some or all Invariant Sections in addition to the
397original versions of these Invariant Sections. You may include a
398translation of this License provided that you also include the original
399English version of this License. In case of a disagreement between the
400translation and the original English version of this License, the
401original English version will prevail.
402
403
404.. _fdl-section9:
405
4069. TERMINATION
407==============
408
409You may not copy, modify, sublicense, or distribute the
410:ref:`Document <fdl-document>` except as expressly provided for under
411this License. Any other attempt to copy, modify, sublicense or
412distribute the Document is void, and will automatically terminate your
413rights under this License. However, parties who have received copies, or
414rights, from you under this License will not have their licenses
415terminated so long as such parties remain in full compliance.
416
417
418.. _fdl-section10:
419
42010. FUTURE REVISIONS OF THIS LICENSE
421====================================
422
423The `Free Software Foundation <http://www.gnu.org/fsf/fsf.html>`__
424may publish new, revised versions of the GNU Free Documentation License
425from time to time. Such new versions will be similar in spirit to the
426present version, but may differ in detail to address new problems or
427concerns. See
428`http://www.gnu.org/copyleft/ <http://www.gnu.org/copyleft>`__.
429
430Each version of the License is given a distinguishing version number. If
431the :ref:`Document <fdl-document>` specifies that a particular
432numbered version of this License “or any later version” applies to it,
433you have the option of following the terms and conditions either of that
434specified version or of any later version that has been published (not
435as a draft) by the Free Software Foundation. If the Document does not
436specify a version number of this License, you may choose any version
437ever published (not as a draft) by the Free Software Foundation.
438
439
440.. _fdl-using:
441
442Addendum
443========
444
445To use this License in a document you have written, include a copy of
446the License in the document and put the following copyright and license
447notices just after the title page:
448
449 Copyright © YEAR YOUR NAME.
450
451 Permission is granted to copy, distribute and/or modify this
452 document under the terms of the GNU Free Documentation License,
453 Version 1.1 or any later version published by the Free Software
454 Foundation; with the :ref:`Invariant Sections <fdl-invariant>`
455 being LIST THEIR TITLES, with the
456 :ref:`Front-Cover Texts <fdl-cover-texts>` being LIST, and with
457 the :ref:`Back-Cover Texts <fdl-cover-texts>` being LIST. A copy
458 of the license is included in the section entitled “GNU Free
459 Documentation License”.
460
461If you have no :ref:`Invariant Sections <fdl-invariant>`, write “with
462no Invariant Sections” instead of saying which ones are invariant. If
463you have no :ref:`Front-Cover Texts <fdl-cover-texts>`, write “no
464Front-Cover Texts” instead of “Front-Cover Texts being LIST”; likewise
465for :ref:`Back-Cover Texts <fdl-cover-texts>`.
466
467If your document contains nontrivial examples of program code, we
468recommend releasing these examples in parallel under your choice of free
469software license, such as the
470`GNU General Public License <http://www.gnu.org/copyleft/gpl.html>`__,
471to permit their use in free software.
diff --git a/Documentation/media/uapi/gen-errors.rst b/Documentation/media/uapi/gen-errors.rst
new file mode 100644
index 000000000000..d6b0cfd00a3f
--- /dev/null
+++ b/Documentation/media/uapi/gen-errors.rst
@@ -0,0 +1,103 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _gen_errors:
4
5*******************
6Generic Error Codes
7*******************
8
9
10.. _gen-errors:
11
12.. flat-table:: Generic error codes
13 :header-rows: 0
14 :stub-columns: 0
15 :widths: 1 16
16
17
18 - .. row 1
19
20 - ``EAGAIN`` (aka ``EWOULDBLOCK``)
21
22 - The ioctl can't be handled because the device is in state where it
23 can't perform it. This could happen for example in case where
24 device is sleeping and ioctl is performed to query statistics. It
25 is also returned when the ioctl would need to wait for an event,
26 but the device was opened in non-blocking mode.
27
28 - .. row 2
29
30 - ``EBADF``
31
32 - The file descriptor is not a valid.
33
34 - .. row 3
35
36 - ``EBUSY``
37
38 - The ioctl can't be handled because the device is busy. This is
39 typically return while device is streaming, and an ioctl tried to
40 change something that would affect the stream, or would require
41 the usage of a hardware resource that was already allocated. The
42 ioctl must not be retried without performing another action to fix
43 the problem first (typically: stop the stream before retrying).
44
45 - .. row 4
46
47 - ``EFAULT``
48
49 - There was a failure while copying data from/to userspace, probably
50 caused by an invalid pointer reference.
51
52 - .. row 5
53
54 - ``EINVAL``
55
56 - One or more of the ioctl parameters are invalid or out of the
57 allowed range. This is a widely used error code. See the
58 individual ioctl requests for specific causes.
59
60 - .. row 6
61
62 - ``ENODEV``
63
64 - Device not found or was removed.
65
66 - .. row 7
67
68 - ``ENOMEM``
69
70 - There's not enough memory to handle the desired operation.
71
72 - .. row 8
73
74 - ``ENOTTY``
75
76 - The ioctl is not supported by the driver, actually meaning that
77 the required functionality is not available, or the file
78 descriptor is not for a media device.
79
80 - .. row 9
81
82 - ``ENOSPC``
83
84 - On USB devices, the stream ioctl's can return this error, meaning
85 that this request would overcommit the usb bandwidth reserved for
86 periodic transfers (up to 80% of the USB bandwidth).
87
88 - .. row 10
89
90 - ``EPERM``
91
92 - Permission denied. Can be returned if the device needs write
93 permission, or some special capabilities is needed (e. g. root)
94
95.. note::
96
97 #. This list is not exaustive; ioctls may return other error codes.
98 Since errors may have side effects such as a driver reset,
99 applications should abort on unexpected errors, or otherwise
100 assume that the device is in a bad state.
101
102 #. Request-specific error codes are listed in the individual
103 requests descriptions.
diff --git a/Documentation/media/uapi/mediactl/media-controller-intro.rst b/Documentation/media/uapi/mediactl/media-controller-intro.rst
new file mode 100644
index 000000000000..3e776c0d8276
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-controller-intro.rst
@@ -0,0 +1,33 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-controller-intro:
4
5Introduction
6============
7
8Media devices increasingly handle multiple related functions. Many USB
9cameras include microphones, video capture hardware can also output
10video, or SoC camera interfaces also perform memory-to-memory operations
11similar to video codecs.
12
13Independent functions, even when implemented in the same hardware, can
14be modelled as separate devices. A USB camera with a microphone will be
15presented to userspace applications as V4L2 and ALSA capture devices.
16The devices' relationships (when using a webcam, end-users shouldn't
17have to manually select the associated USB microphone), while not made
18available directly to applications by the drivers, can usually be
19retrieved from sysfs.
20
21With more and more advanced SoC devices being introduced, the current
22approach will not scale. Device topologies are getting increasingly
23complex and can't always be represented by a tree structure. Hardware
24blocks are shared between different functions, creating dependencies
25between seemingly unrelated devices.
26
27Kernel abstraction APIs such as V4L2 and ALSA provide means for
28applications to access hardware parameters. As newer hardware expose an
29increasingly high number of those parameters, drivers need to guess what
30applications really require based on limited information, thereby
31implementing policies that belong to userspace.
32
33The media controller API aims at solving those problems.
diff --git a/Documentation/media/uapi/mediactl/media-controller-model.rst b/Documentation/media/uapi/mediactl/media-controller-model.rst
new file mode 100644
index 000000000000..558273cf9570
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-controller-model.rst
@@ -0,0 +1,35 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-controller-model:
4
5Media device model
6==================
7
8Discovering a device internal topology, and configuring it at runtime,
9is one of the goals of the media controller API. To achieve this,
10hardware devices and Linux Kernel interfaces are modelled as graph
11objects on an oriented graph. The object types that constitute the graph
12are:
13
14- An **entity** is a basic media hardware or software building block.
15 It can correspond to a large variety of logical blocks such as
16 physical hardware devices (CMOS sensor for instance), logical
17 hardware devices (a building block in a System-on-Chip image
18 processing pipeline), DMA channels or physical connectors.
19
20- An **interface** is a graph representation of a Linux Kernel
21 userspace API interface, like a device node or a sysfs file that
22 controls one or more entities in the graph.
23
24- A **pad** is a data connection endpoint through which an entity can
25 interact with other entities. Data (not restricted to video) produced
26 by an entity flows from the entity's output to one or more entity
27 inputs. Pads should not be confused with physical pins at chip
28 boundaries.
29
30- A **data link** is a point-to-point oriented connection between two
31 pads, either on the same entity or on different entities. Data flows
32 from a source pad to a sink pad.
33
34- An **interface link** is a point-to-point bidirectional control
35 connection between a Linux Kernel interface and an entity.
diff --git a/Documentation/media/uapi/mediactl/media-controller.rst b/Documentation/media/uapi/mediactl/media-controller.rst
new file mode 100644
index 000000000000..7ae38d48969e
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-controller.rst
@@ -0,0 +1,52 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5.. _media_controller:
6
7##############################
8Part IV - Media Controller API
9##############################
10
11.. class:: toc-title
12
13 Table of Contents
14
15.. toctree::
16 :maxdepth: 5
17 :numbered:
18
19 media-controller-intro
20 media-controller-model
21 media-types
22 media-funcs
23 media-header
24
25
26**********************
27Revision and Copyright
28**********************
29
30Authors:
31
32- Pinchart, Laurent <laurent.pinchart@ideasonboard.com>
33
34 - Initial version.
35
36- Carvalho Chehab, Mauro <mchehab@kernel.org>
37
38 - MEDIA_IOC_G_TOPOLOGY documentation and documentation improvements.
39
40**Copyright** |copy| 2010 : Laurent Pinchart
41
42**Copyright** |copy| 2015-2016 : Mauro Carvalho Chehab
43
44****************
45Revision History
46****************
47
48:revision: 1.1.0 / 2015-12-12 (*mcc*)
49
50:revision: 1.0.0 / 2010-11-10 (*lp*)
51
52Initial revision
diff --git a/Documentation/media/uapi/mediactl/media-func-close.rst b/Documentation/media/uapi/mediactl/media-func-close.rst
new file mode 100644
index 000000000000..39ef70ac8656
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-func-close.rst
@@ -0,0 +1,47 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-func-close:
4
5*************
6media close()
7*************
8
9Name
10====
11
12media-close - Close a media device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: int close( int fd )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32
33Description
34===========
35
36Closes the media device. Resources associated with the file descriptor
37are freed. The device configuration remain unchanged.
38
39
40Return Value
41============
42
43:ref:`close() <media-func-close>` returns 0 on success. On error, -1 is returned, and
44``errno`` is set appropriately. Possible error codes are:
45
46EBADF
47 ``fd`` is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/mediactl/media-func-ioctl.rst b/Documentation/media/uapi/mediactl/media-func-ioctl.rst
new file mode 100644
index 000000000000..9d1b23133edf
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-func-ioctl.rst
@@ -0,0 +1,67 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-func-ioctl:
4
5*************
6media ioctl()
7*************
8
9Name
10====
11
12media-ioctl - Control a media device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <sys/ioctl.h>
21
22
23.. cpp:function:: int ioctl( int fd, int request, void *argp )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32``request``
33 Media ioctl request code as defined in the media.h header file, for
34 example MEDIA_IOC_SETUP_LINK.
35
36``argp``
37 Pointer to a request-specific structure.
38
39
40Description
41===========
42
43The :ref:`ioctl() <media-func-ioctl>` function manipulates media device
44parameters. The argument ``fd`` must be an open file descriptor.
45
46The ioctl ``request`` code specifies the media function to be called. It
47has encoded in it whether the argument is an input, output or read/write
48parameter, and the size of the argument ``argp`` in bytes.
49
50Macros and structures definitions specifying media ioctl requests and
51their parameters are located in the media.h header file. All media ioctl
52requests, their respective function and parameters are specified in
53:ref:`media-user-func`.
54
55
56Return Value
57============
58
59On success 0 is returned, on error -1 and the ``errno`` variable is set
60appropriately. The generic error codes are described at the
61:ref:`Generic Error Codes <gen-errors>` chapter.
62
63Request-specific error codes are listed in the individual requests
64descriptions.
65
66When an ioctl that takes an output or read/write parameter fails, the
67parameter remains unmodified.
diff --git a/Documentation/media/uapi/mediactl/media-func-open.rst b/Documentation/media/uapi/mediactl/media-func-open.rst
new file mode 100644
index 000000000000..2b2ecd85b995
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-func-open.rst
@@ -0,0 +1,69 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-func-open:
4
5************
6media open()
7************
8
9Name
10====
11
12media-open - Open a media device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <fcntl.h>
21
22
23.. cpp:function:: int open( const char *device_name, int flags )
24
25
26Arguments
27=========
28
29``device_name``
30 Device to be opened.
31
32``flags``
33 Open flags. Access mode must be either ``O_RDONLY`` or ``O_RDWR``.
34 Other flags have no effect.
35
36
37Description
38===========
39
40To open a media device applications call :ref:`open() <media-func-open>` with the
41desired device name. The function has no side effects; the device
42configuration remain unchanged.
43
44When the device is opened in read-only mode, attempts to modify its
45configuration will result in an error, and ``errno`` will be set to
46EBADF.
47
48
49Return Value
50============
51
52:ref:`open() <func-open>` returns the new file descriptor on success. On error,
53-1 is returned, and ``errno`` is set appropriately. Possible error codes
54are:
55
56EACCES
57 The requested access to the file is not allowed.
58
59EMFILE
60 The process already has the maximum number of files open.
61
62ENFILE
63 The system limit on the total number of open files has been reached.
64
65ENOMEM
66 Insufficient kernel memory was available.
67
68ENXIO
69 No device corresponding to this device special file exists.
diff --git a/Documentation/media/uapi/mediactl/media-funcs.rst b/Documentation/media/uapi/mediactl/media-funcs.rst
new file mode 100644
index 000000000000..076856501cdb
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-funcs.rst
@@ -0,0 +1,18 @@
1.. _media-user-func:
2
3******************
4Function Reference
5******************
6
7
8.. toctree::
9 :maxdepth: 1
10
11 media-func-open
12 media-func-close
13 media-func-ioctl
14 media-ioc-device-info
15 media-ioc-g-topology
16 media-ioc-enum-entities
17 media-ioc-enum-links
18 media-ioc-setup-link
diff --git a/Documentation/media/uapi/mediactl/media-header.rst b/Documentation/media/uapi/mediactl/media-header.rst
new file mode 100644
index 000000000000..96f7b0155e5a
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-header.rst
@@ -0,0 +1,10 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_header:
4
5****************************
6Media Controller Header File
7****************************
8
9.. kernel-include:: $BUILDDIR/media.h.rst
10
diff --git a/Documentation/media/uapi/mediactl/media-ioc-device-info.rst b/Documentation/media/uapi/mediactl/media-ioc-device-info.rst
new file mode 100644
index 000000000000..467d82cbb81e
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-ioc-device-info.rst
@@ -0,0 +1,142 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_ioc_device_info:
4
5***************************
6ioctl MEDIA_IOC_DEVICE_INFO
7***************************
8
9Name
10====
11
12MEDIA_IOC_DEVICE_INFO - Query device information
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct media_device_info *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_DEVICE_INFO
29
30``argp``
31
32
33Description
34===========
35
36All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
37query device information, applications call the ioctl with a pointer to
38a struct :ref:`media_device_info <media-device-info>`. The driver
39fills the structure and returns the information to the application. The
40ioctl never fails.
41
42
43.. _media-device-info:
44
45.. flat-table:: struct media_device_info
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2
49
50
51 - .. row 1
52
53 - char
54
55 - ``driver``\ [16]
56
57 - Name of the driver implementing the media API as a NUL-terminated
58 ASCII string. The driver version is stored in the
59 ``driver_version`` field.
60
61 Driver specific applications can use this information to verify
62 the driver identity. It is also useful to work around known bugs,
63 or to identify drivers in error reports.
64
65 - .. row 2
66
67 - char
68
69 - ``model``\ [32]
70
71 - Device model name as a NUL-terminated UTF-8 string. The device
72 version is stored in the ``device_version`` field and is not be
73 appended to the model name.
74
75 - .. row 3
76
77 - char
78
79 - ``serial``\ [40]
80
81 - Serial number as a NUL-terminated ASCII string.
82
83 - .. row 4
84
85 - char
86
87 - ``bus_info``\ [32]
88
89 - Location of the device in the system as a NUL-terminated ASCII
90 string. This includes the bus type name (PCI, USB, ...) and a
91 bus-specific identifier.
92
93 - .. row 5
94
95 - __u32
96
97 - ``media_version``
98
99 - Media API version, formatted with the ``KERNEL_VERSION()`` macro.
100
101 - .. row 6
102
103 - __u32
104
105 - ``hw_revision``
106
107 - Hardware device revision in a driver-specific format.
108
109 - .. row 7
110
111 - __u32
112
113 - ``driver_version``
114
115 - Media device driver version, formatted with the
116 ``KERNEL_VERSION()`` macro. Together with the ``driver`` field
117 this identifies a particular driver.
118
119 - .. row 8
120
121 - __u32
122
123 - ``reserved``\ [31]
124
125 - Reserved for future extensions. Drivers and applications must set
126 this array to zero.
127
128
129The ``serial`` and ``bus_info`` fields can be used to distinguish
130between multiple instances of otherwise identical hardware. The serial
131number takes precedence when provided and can be assumed to be unique.
132If the serial number is an empty string, the ``bus_info`` field can be
133used instead. The ``bus_info`` field is guaranteed to be unique, but can
134vary across reboots or device unplug/replug.
135
136
137Return Value
138============
139
140On success 0 is returned, on error -1 and the ``errno`` variable is set
141appropriately. The generic error codes are described at the
142:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst b/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst
new file mode 100644
index 000000000000..12d4b25d5b94
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst
@@ -0,0 +1,199 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_ioc_enum_entities:
4
5*****************************
6ioctl MEDIA_IOC_ENUM_ENTITIES
7*****************************
8
9Name
10====
11
12MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct media_entity_desc *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_ENUM_ENTITIES
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of an entity, applications set the id field of a
37struct :ref:`media_entity_desc <media-entity-desc>` structure and
38call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this
39structure. The driver fills the rest of the structure or returns an
40EINVAL error code when the id is invalid.
41
42.. _media-ent-id-flag-next:
43
44Entities can be enumerated by or'ing the id with the
45``MEDIA_ENT_ID_FLAG_NEXT`` flag. The driver will return information
46about the entity with the smallest id strictly larger than the requested
47one ('next entity'), or the ``EINVAL`` error code if there is none.
48
49Entity IDs can be non-contiguous. Applications must *not* try to
50enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing
51id's until they get an error.
52
53
54.. _media-entity-desc:
55
56.. flat-table:: struct media_entity_desc
57 :header-rows: 0
58 :stub-columns: 0
59 :widths: 1 1 1 1 8
60
61
62 - .. row 1
63
64 - __u32
65
66 - ``id``
67
68 -
69 -
70 - Entity id, set by the application. When the id is or'ed with
71 ``MEDIA_ENT_ID_FLAG_NEXT``, the driver clears the flag and returns
72 the first entity with a larger id.
73
74 - .. row 2
75
76 - char
77
78 - ``name``\ [32]
79
80 -
81 -
82 - Entity name as an UTF-8 NULL-terminated string.
83
84 - .. row 3
85
86 - __u32
87
88 - ``type``
89
90 -
91 -
92 - Entity type, see :ref:`media-entity-type` for details.
93
94 - .. row 4
95
96 - __u32
97
98 - ``revision``
99
100 -
101 -
102 - Entity revision. Always zero (obsolete)
103
104 - .. row 5
105
106 - __u32
107
108 - ``flags``
109
110 -
111 -
112 - Entity flags, see :ref:`media-entity-flag` for details.
113
114 - .. row 6
115
116 - __u32
117
118 - ``group_id``
119
120 -
121 -
122 - Entity group ID. Always zero (obsolete)
123
124 - .. row 7
125
126 - __u16
127
128 - ``pads``
129
130 -
131 -
132 - Number of pads
133
134 - .. row 8
135
136 - __u16
137
138 - ``links``
139
140 -
141 -
142 - Total number of outbound links. Inbound links are not counted in
143 this field.
144
145 - .. row 9
146
147 - union
148
149 - .. row 10
150
151 -
152 - struct
153
154 - ``dev``
155
156 -
157 - Valid for (sub-)devices that create a single device node.
158
159 - .. row 11
160
161 -
162 -
163 - __u32
164
165 - ``major``
166
167 - Device node major number.
168
169 - .. row 12
170
171 -
172 -
173 - __u32
174
175 - ``minor``
176
177 - Device node minor number.
178
179 - .. row 13
180
181 -
182 - __u8
183
184 - ``raw``\ [184]
185
186 -
187 -
188
189
190Return Value
191============
192
193On success 0 is returned, on error -1 and the ``errno`` variable is set
194appropriately. The generic error codes are described at the
195:ref:`Generic Error Codes <gen-errors>` chapter.
196
197EINVAL
198 The struct :ref:`media_entity_desc <media-entity-desc>` ``id``
199 references a non-existing entity.
diff --git a/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst b/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst
new file mode 100644
index 000000000000..87443b1ce42d
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst
@@ -0,0 +1,170 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_ioc_enum_links:
4
5**************************
6ioctl MEDIA_IOC_ENUM_LINKS
7**************************
8
9Name
10====
11
12MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a given entity
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct media_links_enum *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_ENUM_LINKS
29
30``argp``
31
32
33Description
34===========
35
36To enumerate pads and/or links for a given entity, applications set the
37entity field of a struct :ref:`media_links_enum <media-links-enum>`
38structure and initialize the struct
39:ref:`media_pad_desc <media-pad-desc>` and struct
40:ref:`media_link_desc <media-link-desc>` structure arrays pointed by
41the ``pads`` and ``links`` fields. They then call the
42MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure.
43
44If the ``pads`` field is not NULL, the driver fills the ``pads`` array
45with information about the entity's pads. The array must have enough
46room to store all the entity's pads. The number of pads can be retrieved
47with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
48
49If the ``links`` field is not NULL, the driver fills the ``links`` array
50with information about the entity's outbound links. The array must have
51enough room to store all the entity's outbound links. The number of
52outbound links can be retrieved with :ref:`MEDIA_IOC_ENUM_ENTITIES`.
53
54Only forward links that originate at one of the entity's source pads are
55returned during the enumeration process.
56
57
58.. _media-links-enum:
59
60.. flat-table:: struct media_links_enum
61 :header-rows: 0
62 :stub-columns: 0
63 :widths: 1 1 2
64
65
66 - .. row 1
67
68 - __u32
69
70 - ``entity``
71
72 - Entity id, set by the application.
73
74 - .. row 2
75
76 - struct :ref:`media_pad_desc <media-pad-desc>`
77
78 - \*\ ``pads``
79
80 - Pointer to a pads array allocated by the application. Ignored if
81 NULL.
82
83 - .. row 3
84
85 - struct :ref:`media_link_desc <media-link-desc>`
86
87 - \*\ ``links``
88
89 - Pointer to a links array allocated by the application. Ignored if
90 NULL.
91
92
93
94.. _media-pad-desc:
95
96.. flat-table:: struct media_pad_desc
97 :header-rows: 0
98 :stub-columns: 0
99 :widths: 1 1 2
100
101
102 - .. row 1
103
104 - __u32
105
106 - ``entity``
107
108 - ID of the entity this pad belongs to.
109
110 - .. row 2
111
112 - __u16
113
114 - ``index``
115
116 - 0-based pad index.
117
118 - .. row 3
119
120 - __u32
121
122 - ``flags``
123
124 - Pad flags, see :ref:`media-pad-flag` for more details.
125
126
127
128.. _media-link-desc:
129
130.. flat-table:: struct media_link_desc
131 :header-rows: 0
132 :stub-columns: 0
133 :widths: 1 1 2
134
135
136 - .. row 1
137
138 - struct :ref:`media_pad_desc <media-pad-desc>`
139
140 - ``source``
141
142 - Pad at the origin of this link.
143
144 - .. row 2
145
146 - struct :ref:`media_pad_desc <media-pad-desc>`
147
148 - ``sink``
149
150 - Pad at the target of this link.
151
152 - .. row 3
153
154 - __u32
155
156 - ``flags``
157
158 - Link flags, see :ref:`media-link-flag` for more details.
159
160
161Return Value
162============
163
164On success 0 is returned, on error -1 and the ``errno`` variable is set
165appropriately. The generic error codes are described at the
166:ref:`Generic Error Codes <gen-errors>` chapter.
167
168EINVAL
169 The struct :ref:`media_links_enum <media-links-enum>` ``id``
170 references a non-existing entity.
diff --git a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
new file mode 100644
index 000000000000..2e382cc7762c
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
@@ -0,0 +1,377 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_ioc_g_topology:
4
5**************************
6ioctl MEDIA_IOC_G_TOPOLOGY
7**************************
8
9Name
10====
11
12MEDIA_IOC_G_TOPOLOGY - Enumerate the graph topology and graph element properties
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct media_v2_topology *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_G_TOPOLOGY
29
30``argp``
31
32
33Description
34===========
35
36The typical usage of this ioctl is to call it twice. On the first call,
37the structure defined at struct
38:ref:`media_v2_topology <media-v2-topology>` should be zeroed. At
39return, if no errors happen, this ioctl will return the
40``topology_version`` and the total number of entities, interfaces, pads
41and links.
42
43Before the second call, the userspace should allocate arrays to store
44the graph elements that are desired, putting the pointers to them at the
45ptr_entities, ptr_interfaces, ptr_links and/or ptr_pads, keeping the
46other values untouched.
47
48If the ``topology_version`` remains the same, the ioctl should fill the
49desired arrays with the media graph elements.
50
51
52.. _media-v2-topology:
53
54.. flat-table:: struct media_v2_topology
55 :header-rows: 0
56 :stub-columns: 0
57 :widths: 1 2 8
58
59
60 - .. row 1
61
62 - __u64
63
64 - ``topology_version``
65
66 - Version of the media graph topology. When the graph is created,
67 this field starts with zero. Every time a graph element is added
68 or removed, this field is incremented.
69
70 - .. row 2
71
72 - __u64
73
74 - ``num_entities``
75
76 - Number of entities in the graph
77
78 - .. row 3
79
80 - __u64
81
82 - ``ptr_entities``
83
84 - A pointer to a memory area where the entities array will be
85 stored, converted to a 64-bits integer. It can be zero. if zero,
86 the ioctl won't store the entities. It will just update
87 ``num_entities``
88
89 - .. row 4
90
91 - __u64
92
93 - ``num_interfaces``
94
95 - Number of interfaces in the graph
96
97 - .. row 5
98
99 - __u64
100
101 - ``ptr_interfaces``
102
103 - A pointer to a memory area where the interfaces array will be
104 stored, converted to a 64-bits integer. It can be zero. if zero,
105 the ioctl won't store the interfaces. It will just update
106 ``num_interfaces``
107
108 - .. row 6
109
110 - __u64
111
112 - ``num_pads``
113
114 - Total number of pads in the graph
115
116 - .. row 7
117
118 - __u64
119
120 - ``ptr_pads``
121
122 - A pointer to a memory area where the pads array will be stored,
123 converted to a 64-bits integer. It can be zero. if zero, the ioctl
124 won't store the pads. It will just update ``num_pads``
125
126 - .. row 8
127
128 - __u64
129
130 - ``num_links``
131
132 - Total number of data and interface links in the graph
133
134 - .. row 9
135
136 - __u64
137
138 - ``ptr_links``
139
140 - A pointer to a memory area where the links array will be stored,
141 converted to a 64-bits integer. It can be zero. if zero, the ioctl
142 won't store the links. It will just update ``num_links``
143
144
145
146.. _media-v2-entity:
147
148.. flat-table:: struct media_v2_entity
149 :header-rows: 0
150 :stub-columns: 0
151 :widths: 1 2 8
152
153
154 - .. row 1
155
156 - __u32
157
158 - ``id``
159
160 - Unique ID for the entity.
161
162 - .. row 2
163
164 - char
165
166 - ``name``\ [64]
167
168 - Entity name as an UTF-8 NULL-terminated string.
169
170 - .. row 3
171
172 - __u32
173
174 - ``function``
175
176 - Entity main function, see :ref:`media-entity-type` for details.
177
178 - .. row 4
179
180 - __u32
181
182 - ``reserved``\ [12]
183
184 - Reserved for future extensions. Drivers and applications must set
185 this array to zero.
186
187
188
189.. _media-v2-interface:
190
191.. flat-table:: struct media_v2_interface
192 :header-rows: 0
193 :stub-columns: 0
194 :widths: 1 2 8
195
196 - .. row 1
197
198 - __u32
199
200 - ``id``
201
202 - Unique ID for the interface.
203
204 - .. row 2
205
206 - __u32
207
208 - ``intf_type``
209
210 - Interface type, see :ref:`media-intf-type` for details.
211
212 - .. row 3
213
214 - __u32
215
216 - ``flags``
217
218 - Interface flags. Currently unused.
219
220 - .. row 4
221
222 - __u32
223
224 - ``reserved``\ [9]
225
226 - Reserved for future extensions. Drivers and applications must set
227 this array to zero.
228
229 - .. row 5
230
231 - struct media_v2_intf_devnode
232
233 - ``devnode``
234
235 - Used only for device node interfaces. See
236 :ref:`media-v2-intf-devnode` for details..
237
238
239
240.. _media-v2-intf-devnode:
241
242.. flat-table:: struct media_v2_interface
243 :header-rows: 0
244 :stub-columns: 0
245 :widths: 1 2 8
246
247
248 - .. row 1
249
250 - __u32
251
252 - ``major``
253
254 - Device node major number.
255
256 - .. row 2
257
258 - __u32
259
260 - ``minor``
261
262 - Device node minor number.
263
264
265
266.. _media-v2-pad:
267
268.. flat-table:: struct media_v2_pad
269 :header-rows: 0
270 :stub-columns: 0
271 :widths: 1 2 8
272
273
274 - .. row 1
275
276 - __u32
277
278 - ``id``
279
280 - Unique ID for the pad.
281
282 - .. row 2
283
284 - __u32
285
286 - ``entity_id``
287
288 - Unique ID for the entity where this pad belongs.
289
290 - .. row 3
291
292 - __u32
293
294 - ``flags``
295
296 - Pad flags, see :ref:`media-pad-flag` for more details.
297
298 - .. row 4
299
300 - __u32
301
302 - ``reserved``\ [9]
303
304 - Reserved for future extensions. Drivers and applications must set
305 this array to zero.
306
307
308
309.. _media-v2-link:
310
311.. flat-table:: struct media_v2_pad
312 :header-rows: 0
313 :stub-columns: 0
314 :widths: 1 2 8
315
316
317 - .. row 1
318
319 - __u32
320
321 - ``id``
322
323 - Unique ID for the pad.
324
325 - .. row 2
326
327 - __u32
328
329 - ``source_id``
330
331 - On pad to pad links: unique ID for the source pad.
332
333 On interface to entity links: unique ID for the interface.
334
335 - .. row 3
336
337 - __u32
338
339 - ``sink_id``
340
341 - On pad to pad links: unique ID for the sink pad.
342
343 On interface to entity links: unique ID for the entity.
344
345 - .. row 4
346
347 - __u32
348
349 - ``flags``
350
351 - Link flags, see :ref:`media-link-flag` for more details.
352
353 - .. row 5
354
355 - __u32
356
357 - ``reserved``\ [5]
358
359 - Reserved for future extensions. Drivers and applications must set
360 this array to zero.
361
362
363Return Value
364============
365
366On success 0 is returned, on error -1 and the ``errno`` variable is set
367appropriately. The generic error codes are described at the
368:ref:`Generic Error Codes <gen-errors>` chapter.
369
370ENOSPC
371 This is returned when either one or more of the num_entities,
372 num_interfaces, num_links or num_pads are non-zero and are
373 smaller than the actual number of elements inside the graph. This
374 may happen if the ``topology_version`` changed when compared to the
375 last time this ioctl was called. Userspace should usually free the
376 area for the pointers, zero the struct elements and call this ioctl
377 again.
diff --git a/Documentation/media/uapi/mediactl/media-ioc-setup-link.rst b/Documentation/media/uapi/mediactl/media-ioc-setup-link.rst
new file mode 100644
index 000000000000..e02fe23de9de
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-ioc-setup-link.rst
@@ -0,0 +1,68 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media_ioc_setup_link:
4
5**************************
6ioctl MEDIA_IOC_SETUP_LINK
7**************************
8
9Name
10====
11
12MEDIA_IOC_SETUP_LINK - Modify the properties of a link
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct media_link_desc *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_SETUP_LINK
29
30``argp``
31
32
33Description
34===========
35
36To change link properties applications fill a struct
37:ref:`media_link_desc <media-link-desc>` with link identification
38information (source and sink pad) and the new requested link flags. They
39then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
40structure.
41
42The only configurable property is the ``ENABLED`` link flag to
43enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can
44not be enabled or disabled.
45
46Link configuration has no side effect on other links. If an enabled link
47at the sink pad prevents the link from being enabled, the driver returns
48with an ``EBUSY`` error code.
49
50Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled
51while streaming media data. Attempting to enable or disable a streaming
52non-dynamic link will return an ``EBUSY`` error code.
53
54If the specified link can't be found the driver returns with an ``EINVAL``
55error code.
56
57
58Return Value
59============
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
64
65EINVAL
66 The struct :ref:`media_link_desc <media-link-desc>` references a
67 non-existing link, or the link is immutable and an attempt to modify
68 its configuration was made.
diff --git a/Documentation/media/uapi/mediactl/media-types.rst b/Documentation/media/uapi/mediactl/media-types.rst
new file mode 100644
index 000000000000..c77717b236ce
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media-types.rst
@@ -0,0 +1,606 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-controller-types:
4
5Types and flags used to represent the media graph elements
6==========================================================
7
8
9.. _media-entity-type:
10
11.. flat-table:: Media entity types
12 :header-rows: 0
13 :stub-columns: 0
14
15
16 - .. row 1
17
18 .. _MEDIA-ENT-F-UNKNOWN:
19 .. _MEDIA-ENT-F-V4L2-SUBDEV-UNKNOWN:
20
21 - ``MEDIA_ENT_F_UNKNOWN`` and ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``
22
23 - Unknown entity. That generally indicates that a driver didn't
24 initialize properly the entity, with is a Kernel bug
25
26 - .. row 2
27
28 .. _MEDIA-ENT-F-IO-V4L:
29
30 - ``MEDIA_ENT_F_IO_V4L``
31
32 - Data streaming input and/or output entity.
33
34 - .. row 3
35
36 .. _MEDIA-ENT-F-IO-VBI:
37
38 - ``MEDIA_ENT_F_IO_VBI``
39
40 - V4L VBI streaming input or output entity
41
42 - .. row 4
43
44 .. _MEDIA-ENT-F-IO-SWRADIO:
45
46 - ``MEDIA_ENT_F_IO_SWRADIO``
47
48 - V4L Software Digital Radio (SDR) streaming input or output entity
49
50 - .. row 5
51
52 .. _MEDIA-ENT-F-IO-DTV:
53
54 - ``MEDIA_ENT_F_IO_DTV``
55
56 - DVB Digital TV streaming input or output entity
57
58 - .. row 6
59
60 .. _MEDIA-ENT-F-DTV-DEMOD:
61
62 - ``MEDIA_ENT_F_DTV_DEMOD``
63
64 - Digital TV demodulator entity.
65
66 - .. row 7
67
68 .. _MEDIA-ENT-F-TS-DEMUX:
69
70 - ``MEDIA_ENT_F_TS_DEMUX``
71
72 - MPEG Transport stream demux entity. Could be implemented on
73 hardware or in Kernelspace by the Linux DVB subsystem.
74
75 - .. row 8
76
77 .. _MEDIA-ENT-F-DTV-CA:
78
79 - ``MEDIA_ENT_F_DTV_CA``
80
81 - Digital TV Conditional Access module (CAM) entity
82
83 - .. row 9
84
85 .. _MEDIA-ENT-F-DTV-NET-DECAP:
86
87 - ``MEDIA_ENT_F_DTV_NET_DECAP``
88
89 - Digital TV network ULE/MLE desencapsulation entity. Could be
90 implemented on hardware or in Kernelspace
91
92 - .. row 10
93
94 .. _MEDIA-ENT-F-CONN-RF:
95
96 - ``MEDIA_ENT_F_CONN_RF``
97
98 - Connector for a Radio Frequency (RF) signal.
99
100 - .. row 11
101
102 .. _MEDIA-ENT-F-CONN-SVIDEO:
103
104 - ``MEDIA_ENT_F_CONN_SVIDEO``
105
106 - Connector for a S-Video signal.
107
108 - .. row 12
109
110 .. _MEDIA-ENT-F-CONN-COMPOSITE:
111
112 - ``MEDIA_ENT_F_CONN_COMPOSITE``
113
114 - Connector for a RGB composite signal.
115
116 - .. row 13
117
118 .. _MEDIA-ENT-F-CAM-SENSOR:
119
120 - ``MEDIA_ENT_F_CAM_SENSOR``
121
122 - Camera video sensor entity.
123
124 - .. row 14
125
126 .. _MEDIA-ENT-F-FLASH:
127
128 - ``MEDIA_ENT_F_FLASH``
129
130 - Flash controller entity.
131
132 - .. row 15
133
134 .. _MEDIA-ENT-F-LENS:
135
136 - ``MEDIA_ENT_F_LENS``
137
138 - Lens controller entity.
139
140 - .. row 16
141
142 .. _MEDIA-ENT-F-ATV-DECODER:
143
144 - ``MEDIA_ENT_F_ATV_DECODER``
145
146 - Analog video decoder, the basic function of the video decoder is
147 to accept analogue video from a wide variety of sources such as
148 broadcast, DVD players, cameras and video cassette recorders, in
149 either NTSC, PAL, SECAM or HD format, separating the stream into
150 its component parts, luminance and chrominance, and output it in
151 some digital video standard, with appropriate timing signals.
152
153 - .. row 17
154
155 .. _MEDIA-ENT-F-TUNER:
156
157 - ``MEDIA_ENT_F_TUNER``
158
159 - Digital TV, analog TV, radio and/or software radio tuner, with
160 consists on a PLL tuning stage that converts radio frequency (RF)
161 signal into an Intermediate Frequency (IF). Modern tuners have
162 internally IF-PLL decoders for audio and video, but older models
163 have those stages implemented on separate entities.
164
165 - .. row 18
166
167 .. _MEDIA-ENT-F-IF-VID-DECODER:
168
169 - ``MEDIA_ENT_F_IF_VID_DECODER``
170
171 - IF-PLL video decoder. It receives the IF from a PLL and decodes
172 the analog TV video signal. This is commonly found on some very
173 old analog tuners, like Philips MK3 designs. They all contain a
174 tda9887 (or some software compatible similar chip, like tda9885).
175 Those devices use a different I2C address than the tuner PLL.
176
177 - .. row 19
178
179 .. _MEDIA-ENT-F-IF-AUD-DECODER:
180
181 - ``MEDIA_ENT_F_IF_AUD_DECODER``
182
183 - IF-PLL sound decoder. It receives the IF from a PLL and decodes
184 the analog TV audio signal. This is commonly found on some very
185 old analog hardware, like Micronas msp3400, Philips tda9840,
186 tda985x, etc. Those devices use a different I2C address than the
187 tuner PLL and should be controlled together with the IF-PLL video
188 decoder.
189
190 - .. row 20
191
192 .. _MEDIA-ENT-F-AUDIO-CAPTURE:
193
194 - ``MEDIA_ENT_F_AUDIO_CAPTURE``
195
196 - Audio Capture Function Entity.
197
198 - .. row 21
199
200 .. _MEDIA-ENT-F-AUDIO-PLAYBACK:
201
202 - ``MEDIA_ENT_F_AUDIO_PLAYBACK``
203
204 - Audio Playback Function Entity.
205
206 - .. row 22
207
208 .. _MEDIA-ENT-F-AUDIO-MIXER:
209
210 - ``MEDIA_ENT_F_AUDIO_MIXER``
211
212 - Audio Mixer Function Entity.
213
214 - .. row 23
215
216 .. _MEDIA-ENT-F-PROC-VIDEO-COMPOSER:
217
218 - ``MEDIA_ENT_F_PROC_VIDEO_COMPOSER``
219
220 - Video composer (blender). An entity capable of video
221 composing must have at least two sink pads and one source
222 pad, and composes input video frames onto output video
223 frames. Composition can be performed using alpha blending,
224 color keying, raster operations (ROP), stitching or any other
225 means.
226
227 - .. row 24
228
229 .. _MEDIA-ENT-F-PROC-VIDEO-PIXEL-FORMATTER:
230
231 - ``MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER``
232
233 - Video pixel formatter. An entity capable of pixel formatting
234 must have at least one sink pad and one source pad. Read
235 pixel formatters read pixels from memory and perform a subset
236 of unpacking, cropping, color keying, alpha multiplication
237 and pixel encoding conversion. Write pixel formatters perform
238 a subset of dithering, pixel encoding conversion and packing
239 and write pixels to memory.
240
241 - .. row 25
242
243 .. _MEDIA-ENT-F-PROC-VIDEO-PIXEL-ENC-CONV:
244
245 - ``MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV``
246
247 - Video pixel encoding converter. An entity capable of pixel
248 enconding conversion must have at least one sink pad and one
249 source pad, and convert the encoding of pixels received on
250 its sink pad(s) to a different encoding output on its source
251 pad(s). Pixel encoding conversion includes but isn't limited
252 to RGB to/from HSV, RGB to/from YUV and CFA (Bayer) to RGB
253 conversions.
254
255 - .. row 26
256
257 .. _MEDIA-ENT-F-PROC-VIDEO-LUT:
258
259 - ``MEDIA_ENT_F_PROC_VIDEO_LUT``
260
261 - Video look-up table. An entity capable of video lookup table
262 processing must have one sink pad and one source pad. It uses
263 the values of the pixels received on its sink pad to look up
264 entries in internal tables and output them on its source pad.
265 The lookup processing can be performed on all components
266 separately or combine them for multi-dimensional table
267 lookups.
268
269 - .. row 27
270
271 .. _MEDIA-ENT-F-PROC-VIDEO-SCALER:
272
273 - ``MEDIA_ENT_F_PROC_VIDEO_SCALER``
274
275 - Video scaler. An entity capable of video scaling must have
276 at least one sink pad and one source pad, and scale the
277 video frame(s) received on its sink pad(s) to a different
278 resolution output on its source pad(s). The range of
279 supported scaling ratios is entity-specific and can differ
280 between the horizontal and vertical directions (in particular
281 scaling can be supported in one direction only). Binning and
282 skipping are considered as scaling.
283
284 - .. row 28
285
286 .. _MEDIA-ENT-F-PROC-VIDEO-STATISTICS:
287
288 - ``MEDIA_ENT_F_PROC_VIDEO_STATISTICS``
289
290 - Video statistics computation (histogram, 3A, ...). An entity
291 capable of statistics computation must have one sink pad and
292 one source pad. It computes statistics over the frames
293 received on its sink pad and outputs the statistics data on
294 its source pad.
295
296
297.. _media-entity-flag:
298
299.. flat-table:: Media entity flags
300 :header-rows: 0
301 :stub-columns: 0
302
303
304 - .. row 1
305
306 .. _MEDIA-ENT-FL-DEFAULT:
307
308 - ``MEDIA_ENT_FL_DEFAULT``
309
310 - Default entity for its type. Used to discover the default audio,
311 VBI and video devices, the default camera sensor, ...
312
313 - .. row 2
314
315 .. _MEDIA-ENT-FL-CONNECTOR:
316
317 - ``MEDIA_ENT_FL_CONNECTOR``
318
319 - The entity represents a data conector
320
321
322
323.. _media-intf-type:
324
325.. flat-table:: Media interface types
326 :header-rows: 0
327 :stub-columns: 0
328
329
330 - .. row 1
331
332 .. _MEDIA-INTF-T-DVB-FE:
333
334 - ``MEDIA_INTF_T_DVB_FE``
335
336 - Device node interface for the Digital TV frontend
337
338 - typically, /dev/dvb/adapter?/frontend?
339
340 - .. row 2
341
342 .. _MEDIA-INTF-T-DVB-DEMUX:
343
344 - ``MEDIA_INTF_T_DVB_DEMUX``
345
346 - Device node interface for the Digital TV demux
347
348 - typically, /dev/dvb/adapter?/demux?
349
350 - .. row 3
351
352 .. _MEDIA-INTF-T-DVB-DVR:
353
354 - ``MEDIA_INTF_T_DVB_DVR``
355
356 - Device node interface for the Digital TV DVR
357
358 - typically, /dev/dvb/adapter?/dvr?
359
360 - .. row 4
361
362 .. _MEDIA-INTF-T-DVB-CA:
363
364 - ``MEDIA_INTF_T_DVB_CA``
365
366 - Device node interface for the Digital TV Conditional Access
367
368 - typically, /dev/dvb/adapter?/ca?
369
370 - .. row 5
371
372 .. _MEDIA-INTF-T-DVB-NET:
373
374 - ``MEDIA_INTF_T_DVB_NET``
375
376 - Device node interface for the Digital TV network control
377
378 - typically, /dev/dvb/adapter?/net?
379
380 - .. row 6
381
382 .. _MEDIA-INTF-T-V4L-VIDEO:
383
384 - ``MEDIA_INTF_T_V4L_VIDEO``
385
386 - Device node interface for video (V4L)
387
388 - typically, /dev/video?
389
390 - .. row 7
391
392 .. _MEDIA-INTF-T-V4L-VBI:
393
394 - ``MEDIA_INTF_T_V4L_VBI``
395
396 - Device node interface for VBI (V4L)
397
398 - typically, /dev/vbi?
399
400 - .. row 8
401
402 .. _MEDIA-INTF-T-V4L-RADIO:
403
404 - ``MEDIA_INTF_T_V4L_RADIO``
405
406 - Device node interface for radio (V4L)
407
408 - typically, /dev/vbi?
409
410 - .. row 9
411
412 .. _MEDIA-INTF-T-V4L-SUBDEV:
413
414 - ``MEDIA_INTF_T_V4L_SUBDEV``
415
416 - Device node interface for a V4L subdevice
417
418 - typically, /dev/v4l-subdev?
419
420 - .. row 10
421
422 .. _MEDIA-INTF-T-V4L-SWRADIO:
423
424 - ``MEDIA_INTF_T_V4L_SWRADIO``
425
426 - Device node interface for Software Defined Radio (V4L)
427
428 - typically, /dev/swradio?
429
430 - .. row 11
431
432 .. _MEDIA-INTF-T-ALSA-PCM-CAPTURE:
433
434 - ``MEDIA_INTF_T_ALSA_PCM_CAPTURE``
435
436 - Device node interface for ALSA PCM Capture
437
438 - typically, /dev/snd/pcmC?D?c
439
440 - .. row 12
441
442 .. _MEDIA-INTF-T-ALSA-PCM-PLAYBACK:
443
444 - ``MEDIA_INTF_T_ALSA_PCM_PLAYBACK``
445
446 - Device node interface for ALSA PCM Playback
447
448 - typically, /dev/snd/pcmC?D?p
449
450 - .. row 13
451
452 .. _MEDIA-INTF-T-ALSA-CONTROL:
453
454 - ``MEDIA_INTF_T_ALSA_CONTROL``
455
456 - Device node interface for ALSA Control
457
458 - typically, /dev/snd/controlC?
459
460 - .. row 14
461
462 .. _MEDIA-INTF-T-ALSA-COMPRESS:
463
464 - ``MEDIA_INTF_T_ALSA_COMPRESS``
465
466 - Device node interface for ALSA Compress
467
468 - typically, /dev/snd/compr?
469
470 - .. row 15
471
472 .. _MEDIA-INTF-T-ALSA-RAWMIDI:
473
474 - ``MEDIA_INTF_T_ALSA_RAWMIDI``
475
476 - Device node interface for ALSA Raw MIDI
477
478 - typically, /dev/snd/midi?
479
480 - .. row 16
481
482 .. _MEDIA-INTF-T-ALSA-HWDEP:
483
484 - ``MEDIA_INTF_T_ALSA_HWDEP``
485
486 - Device node interface for ALSA Hardware Dependent
487
488 - typically, /dev/snd/hwC?D?
489
490 - .. row 17
491
492 .. _MEDIA-INTF-T-ALSA-SEQUENCER:
493
494 - ``MEDIA_INTF_T_ALSA_SEQUENCER``
495
496 - Device node interface for ALSA Sequencer
497
498 - typically, /dev/snd/seq
499
500 - .. row 18
501
502 .. _MEDIA-INTF-T-ALSA-TIMER:
503
504 - ``MEDIA_INTF_T_ALSA_TIMER``
505
506 - Device node interface for ALSA Timer
507
508 - typically, /dev/snd/timer
509
510
511
512.. _media-pad-flag:
513
514.. flat-table:: Media pad flags
515 :header-rows: 0
516 :stub-columns: 0
517
518
519 - .. row 1
520
521 .. _MEDIA-PAD-FL-SINK:
522
523 - ``MEDIA_PAD_FL_SINK``
524
525 - Input pad, relative to the entity. Input pads sink data and are
526 targets of links.
527
528 - .. row 2
529
530 .. _MEDIA-PAD-FL-SOURCE:
531
532 - ``MEDIA_PAD_FL_SOURCE``
533
534 - Output pad, relative to the entity. Output pads source data and
535 are origins of links.
536
537 - .. row 3
538
539 .. _MEDIA-PAD-FL-MUST-CONNECT:
540
541 - ``MEDIA_PAD_FL_MUST_CONNECT``
542
543 - If this flag is set and the pad is linked to any other pad, then
544 at least one of those links must be enabled for the entity to be
545 able to stream. There could be temporary reasons (e.g. device
546 configuration dependent) for the pad to need enabled links even
547 when this flag isn't set; the absence of the flag doesn't imply
548 there is none.
549
550
551One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``
552must be set for every pad.
553
554
555.. _media-link-flag:
556
557.. flat-table:: Media link flags
558 :header-rows: 0
559 :stub-columns: 0
560
561
562 - .. row 1
563
564 .. _MEDIA-LNK-FL-ENABLED:
565
566 - ``MEDIA_LNK_FL_ENABLED``
567
568 - The link is enabled and can be used to transfer media data. When
569 two or more links target a sink pad, only one of them can be
570 enabled at a time.
571
572 - .. row 2
573
574 .. _MEDIA-LNK-FL-IMMUTABLE:
575
576 - ``MEDIA_LNK_FL_IMMUTABLE``
577
578 - The link enabled state can't be modified at runtime. An immutable
579 link is always enabled.
580
581 - .. row 3
582
583 .. _MEDIA-LNK-FL-DYNAMIC:
584
585 - ``MEDIA_LNK_FL_DYNAMIC``
586
587 - The link enabled state can be modified during streaming. This flag
588 is set by drivers and is read-only for applications.
589
590 - .. row 4
591
592 .. _MEDIA-LNK-FL-LINK-TYPE:
593
594 - ``MEDIA_LNK_FL_LINK_TYPE``
595
596 - This is a bitmask that defines the type of the link. Currently,
597 two types of links are supported:
598
599 .. _MEDIA-LNK-FL-DATA-LINK:
600
601 ``MEDIA_LNK_FL_DATA_LINK`` if the link is between two pads
602
603 .. _MEDIA-LNK-FL-INTERFACE-LINK:
604
605 ``MEDIA_LNK_FL_INTERFACE_LINK`` if the link is between an
606 interface and an entity
diff --git a/Documentation/media/uapi/rc/keytable.c.rst b/Documentation/media/uapi/rc/keytable.c.rst
new file mode 100644
index 000000000000..e6ce1e3f5a78
--- /dev/null
+++ b/Documentation/media/uapi/rc/keytable.c.rst
@@ -0,0 +1,176 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3file: uapi/v4l/keytable.c
4=========================
5
6.. code-block:: c
7
8 /* keytable.c - This program allows checking/replacing keys at IR
9
10 Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@infradead.org>
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20 */
21
22 #include <ctype.h>
23 #include <errno.h>
24 #include <fcntl.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <linux/input.h>
29 #include <sys/ioctl.h>
30
31 #include "parse.h"
32
33 void prtcode (int *codes)
34 {
35 struct parse_key *p;
36
37 for (p=keynames;p->name!=NULL;p++) {
38 if (p->value == (unsigned)codes[1]) {
39 printf("scancode 0x%04x = %s (0x%02x)\\n", codes[0], p->name, codes[1]);
40 return;
41 }
42 }
43
44 if (isprint (codes[1]))
45 printf("scancode %d = '%c' (0x%02x)\\n", codes[0], codes[1], codes[1]);
46 else
47 printf("scancode %d = 0x%02x\\n", codes[0], codes[1]);
48 }
49
50 int parse_code(char *string)
51 {
52 struct parse_key *p;
53
54 for (p=keynames;p->name!=NULL;p++) {
55 if (!strcasecmp(p->name, string)) {
56 return p->value;
57 }
58 }
59 return -1;
60 }
61
62 int main (int argc, char *argv[])
63 {
64 int fd;
65 unsigned int i, j;
66 int codes[2];
67
68 if (argc<2 || argc>4) {
69 printf ("usage: %s <device> to get table; or\\n"
70 " %s <device> <scancode> <keycode>\\n"
71 " %s <device> <keycode_file>n",*argv,*argv,*argv);
72 return -1;
73 }
74
75 if ((fd = open(argv[1], O_RDONLY)) < 0) {
76 perror("Couldn't open input device");
77 return(-1);
78 }
79
80 if (argc==4) {
81 int value;
82
83 value=parse_code(argv[3]);
84
85 if (value==-1) {
86 value = strtol(argv[3], NULL, 0);
87 if (errno)
88 perror("value");
89 }
90
91 codes [0] = (unsigned) strtol(argv[2], NULL, 0);
92 codes [1] = (unsigned) value;
93
94 if(ioctl(fd, EVIOCSKEYCODE, codes))
95 perror ("EVIOCSKEYCODE");
96
97 if(ioctl(fd, EVIOCGKEYCODE, codes)==0)
98 prtcode(codes);
99 return 0;
100 }
101
102 if (argc==3) {
103 FILE *fin;
104 int value;
105 char *scancode, *keycode, s[2048];
106
107 fin=fopen(argv[2],"r");
108 if (fin==NULL) {
109 perror ("opening keycode file");
110 return -1;
111 }
112
113 /* Clears old table */
114 for (j = 0; j < 256; j++) {
115 for (i = 0; i < 256; i++) {
116 codes[0] = (j << 8) | i;
117 codes[1] = KEY_RESERVED;
118 ioctl(fd, EVIOCSKEYCODE, codes);
119 }
120 }
121
122 while (fgets(s,sizeof(s),fin)) {
123 scancode=strtok(s,"\\n\\t =:");
124 if (!scancode) {
125 perror ("parsing input file scancode");
126 return -1;
127 }
128 if (!strcasecmp(scancode, "scancode")) {
129 scancode = strtok(NULL,"\\n\\t =:");
130 if (!scancode) {
131 perror ("parsing input file scancode");
132 return -1;
133 }
134 }
135
136 keycode=strtok(NULL,"\\n\\t =:(");
137 if (!keycode) {
138 perror ("parsing input file keycode");
139 return -1;
140 }
141
142 // printf ("parsing %s=%s:", scancode, keycode);
143 value=parse_code(keycode);
144 // printf ("\\tvalue=%d\\n",value);
145
146 if (value==-1) {
147 value = strtol(keycode, NULL, 0);
148 if (errno)
149 perror("value");
150 }
151
152 codes [0] = (unsigned) strtol(scancode, NULL, 0);
153 codes [1] = (unsigned) value;
154
155 // printf("\\t%04x=%04x\\n",codes[0], codes[1]);
156 if(ioctl(fd, EVIOCSKEYCODE, codes)) {
157 fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]);
158 perror ("EVIOCSKEYCODE");
159 }
160
161 if(ioctl(fd, EVIOCGKEYCODE, codes)==0)
162 prtcode(codes);
163 }
164 return 0;
165 }
166
167 /* Get scancode table */
168 for (j = 0; j < 256; j++) {
169 for (i = 0; i < 256; i++) {
170 codes[0] = (j << 8) | i;
171 if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes[1] != KEY_RESERVED)
172 prtcode(codes);
173 }
174 }
175 return 0;
176 }
diff --git a/Documentation/media/uapi/rc/lirc-dev-intro.rst b/Documentation/media/uapi/rc/lirc-dev-intro.rst
new file mode 100644
index 000000000000..ef97e40f2fd8
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-dev-intro.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_dev_intro:
4
5************
6Introduction
7************
8
9The LIRC device interface is a bi-directional interface for transporting
10raw IR data between userspace and kernelspace. Fundamentally, it is just
11a chardev (/dev/lircX, for X = 0, 1, 2, ...), with a number of standard
12struct file_operations defined on it. With respect to transporting raw
13IR data to and fro, the essential fops are read, write and ioctl.
14
15Example dmesg output upon a driver registering w/LIRC:
16
17.. code-block:: none
18
19 $ dmesg |grep lirc_dev
20 lirc_dev: IR Remote Control driver registered, major 248
21 rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0
22
23What you should see for a chardev:
24
25.. code-block:: none
26
27 $ ls -l /dev/lirc*
28 crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0
29
30**********
31LIRC modes
32**********
33
34LIRC supports some modes of receiving and sending IR codes, as shown
35on the following table.
36
37.. _lirc-mode-mode2:
38
39``LIRC_MODE_MODE2``
40
41 The driver returns a sequence of pulse and space codes to userspace.
42
43 This mode is used only for IR receive.
44
45.. _lirc-mode-lirccode:
46
47``LIRC_MODE_LIRCCODE``
48
49 The IR signal is decoded internally by the receiver. The LIRC interface
50 returns the scancode as an integer value. This is the usual mode used
51 by several TV media cards.
52
53 This mode is used only for IR receive.
54
55.. _lirc-mode-pulse:
56
57``LIRC_MODE_PULSE``
58
59 On puse mode, a sequence of pulse/space integer values are written to the
60 lirc device using :Ref:`lirc-write`.
61
62 This mode is used only for IR send.
diff --git a/Documentation/media/uapi/rc/lirc-dev.rst b/Documentation/media/uapi/rc/lirc-dev.rst
new file mode 100644
index 000000000000..03cde25f5859
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-dev.rst
@@ -0,0 +1,14 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_dev:
4
5LIRC Device Interface
6=====================
7
8
9.. toctree::
10 :maxdepth: 1
11
12 lirc-dev-intro
13 lirc-func
14 lirc-header
diff --git a/Documentation/media/uapi/rc/lirc-func.rst b/Documentation/media/uapi/rc/lirc-func.rst
new file mode 100644
index 000000000000..9b5a772ec96c
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-func.rst
@@ -0,0 +1,28 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_func:
4
5LIRC Function Reference
6=======================
7
8
9.. toctree::
10 :maxdepth: 1
11
12 lirc-read
13 lirc-write
14 lirc-get-features
15 lirc-get-send-mode
16 lirc-get-rec-mode
17 lirc-get-rec-resolution
18 lirc-set-send-duty-cycle
19 lirc-get-timeout
20 lirc-set-rec-timeout
21 lirc-get-length
22 lirc-set-rec-carrier
23 lirc-set-rec-carrier-range
24 lirc-set-send-carrier
25 lirc-set-transmitter-mask
26 lirc-set-rec-timeout-reports
27 lirc-set-measure-carrier-mode
28 lirc-set-wideband-receiver
diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst b/Documentation/media/uapi/rc/lirc-get-features.rst
new file mode 100644
index 000000000000..e763ebfb2cb1
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -0,0 +1,181 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_features:
4
5***********************
6ioctl LIRC_GET_FEATURES
7***********************
8
9Name
10====
11
12LIRC_GET_FEATURES - Get the underlying hardware device's features
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *features)
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_GET_FEATURES
27
28``features``
29 Bitmask with the LIRC features.
30
31
32Description
33===========
34
35
36Get the underlying hardware device's features. If a driver does not
37announce support of certain features, calling of the corresponding ioctls
38is undefined.
39
40LIRC features
41=============
42
43.. _LIRC-CAN-REC-RAW:
44
45``LIRC_CAN_REC_RAW``
46
47 Unused. Kept just to avoid breaking uAPI.
48
49.. _LIRC-CAN-REC-PULSE:
50
51``LIRC_CAN_REC_PULSE``
52
53 The driver is capable of receiving using
54 :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>`.
55
56.. _LIRC-CAN-REC-MODE2:
57
58``LIRC_CAN_REC_MODE2``
59
60 The driver is capable of receiving using
61 :ref:`LIRC_MODE_MODE2 <lirc-mode-MODE2>`.
62
63.. _LIRC-CAN-REC-LIRCCODE:
64
65``LIRC_CAN_REC_LIRCCODE``
66
67 The driver is capable of receiving using
68 :ref:`LIRC_MODE_LIRCCODE <lirc-mode-LIRCCODE>`.
69
70.. _LIRC-CAN-SET-SEND-CARRIER:
71
72``LIRC_CAN_SET_SEND_CARRIER``
73
74 The driver supports changing the modulation frequency via
75 :ref:`ioctl LIRC_SET_SEND_CARRIER <LIRC_SET_SEND_CARRIER>`.
76
77.. _LIRC-CAN-SET-SEND-DUTY-CYCLE:
78
79``LIRC_CAN_SET_SEND_DUTY_CYCLE``
80
81 The driver supports changing the duty cycle using
82 :ref:`ioctl LIRC_SET_SEND_DUTY_CYCLE <LIRC_SET_SEND_DUTY_CYCLE>`.
83
84.. _LIRC-CAN-SET-TRANSMITTER-MASK:
85
86``LIRC_CAN_SET_TRANSMITTER_MASK``
87
88 The driver supports changing the active transmitter(s) using
89 :ref:`ioctl LIRC_SET_TRANSMITTER_MASK <LIRC_SET_TRANSMITTER_MASK>`.
90
91.. _LIRC-CAN-SET-REC-CARRIER:
92
93``LIRC_CAN_SET_REC_CARRIER``
94
95 The driver supports setting the receive carrier frequency using
96 :ref:`ioctl LIRC_SET_REC_CARRIER <LIRC_SET_REC_CARRIER>`.
97
98.. _LIRC-CAN-SET-REC-DUTY-CYCLE-RANGE:
99
100``LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE``
101
102 Unused. Kept just to avoid breaking uAPI.
103
104.. _LIRC-CAN-SET-REC-CARRIER-RANGE:
105
106``LIRC_CAN_SET_REC_CARRIER_RANGE``
107
108 The driver supports
109 :ref:`ioctl LIRC_SET_REC_CARRIER_RANGE <LIRC_SET_REC_CARRIER_RANGE>`.
110
111.. _LIRC-CAN-GET-REC-RESOLUTION:
112
113``LIRC_CAN_GET_REC_RESOLUTION``
114
115 The driver supports
116 :ref:`ioctl LIRC_GET_REC_RESOLUTION <LIRC_GET_REC_RESOLUTION>`.
117
118.. _LIRC-CAN-SET-REC-TIMEOUT:
119
120``LIRC_CAN_SET_REC_TIMEOUT``
121
122 The driver supports
123 :ref:`ioctl LIRC_SET_REC_TIMEOUT <LIRC_SET_REC_TIMEOUT>`.
124
125.. _LIRC-CAN-SET-REC-FILTER:
126
127``LIRC_CAN_SET_REC_FILTER``
128
129 Unused. Kept just to avoid breaking uAPI.
130
131.. _LIRC-CAN-MEASURE-CARRIER:
132
133``LIRC_CAN_MEASURE_CARRIER``
134
135 The driver supports measuring of the modulation frequency using
136 :ref:`ioctl LIRC_SET_MEASURE_CARRIER_MODE <LIRC_SET_MEASURE_CARRIER_MODE>`.
137
138.. _LIRC-CAN-USE-WIDEBAND-RECEIVER:
139
140``LIRC_CAN_USE_WIDEBAND_RECEIVER``
141
142 The driver supports learning mode using
143 :ref:`ioctl LIRC_SET_WIDEBAND_RECEIVER <LIRC_SET_WIDEBAND_RECEIVER>`.
144
145.. _LIRC-CAN-NOTIFY-DECODE:
146
147``LIRC_CAN_NOTIFY_DECODE``
148
149 Unused. Kept just to avoid breaking uAPI.
150
151.. _LIRC-CAN-SEND-RAW:
152
153``LIRC_CAN_SEND_RAW``
154
155 Unused. Kept just to avoid breaking uAPI.
156
157.. _LIRC-CAN-SEND-PULSE:
158
159``LIRC_CAN_SEND_PULSE``
160
161 The driver supports sending using :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>`.
162
163.. _LIRC-CAN-SEND-MODE2:
164
165``LIRC_CAN_SEND_MODE2``
166
167 The driver supports sending using :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`.
168
169.. _LIRC-CAN-SEND-LIRCCODE:
170
171``LIRC_CAN_SEND_LIRCCODE``
172
173 The driver supports sending codes (also called as IR blasting or IR TX).
174
175
176Return Value
177============
178
179On success 0 is returned, on error -1 and the ``errno`` variable is set
180appropriately. The generic error codes are described at the
181:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-get-length.rst b/Documentation/media/uapi/rc/lirc-get-length.rst
new file mode 100644
index 000000000000..d11c3d3f2c06
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-length.rst
@@ -0,0 +1,45 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_length:
4
5*********************
6ioctl LIRC_GET_LENGTH
7*********************
8
9Name
10====
11
12LIRC_GET_LENGTH - Retrieves the code length in bits.
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *length )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_GET_LENGTH
27
28``length``
29 length, in bits
30
31
32Description
33===========
34
35Retrieves the code length in bits (only for ``LIRC-MODE-LIRCCODE``).
36Reads on the device must be done in blocks matching the bit count.
37The bit could should be rounded up so that it matches full bytes.
38
39
40Return Value
41============
42
43On success 0 is returned, on error -1 and the ``errno`` variable is set
44appropriately. The generic error codes are described at the
45:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
new file mode 100644
index 000000000000..586860c36791
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
@@ -0,0 +1,45 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_rec_mode:
4.. _lirc_set_rec_mode:
5
6**********************************************
7ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
8**********************************************
9
10Name
11====
12
13LIRC_GET_REC_MODE/LIRC_GET_REC_MODE - Get/set supported receive modes.
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 rx_modes)
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_GET_REC_MODE or LIRC_GET_REC_MODE
28
29``rx_modes``
30 Bitmask with the supported transmit modes.
31
32Description
33===========
34
35Get/set supported receive modes. Only :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`
36and :ref:`LIRC_MODE_LIRCCODE <lirc-mode-lirccode>` are supported for IR
37receive.
38
39
40Return Value
41============
42
43On success 0 is returned, on error -1 and the ``errno`` variable is set
44appropriately. The generic error codes are described at the
45:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
new file mode 100644
index 000000000000..6ef1723878b4
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_rec_resolution:
4
5*****************************
6ioctl LIRC_GET_REC_RESOLUTION
7*****************************
8
9Name
10====
11
12LIRC_GET_REC_RESOLUTION - Obtain the value of receive resolution, in microseconds.
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *microseconds)
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_GET_REC_RESOLUTION
27
28``microseconds``
29 Resolution, in microseconds.
30
31
32Description
33===========
34
35Some receivers have maximum resolution which is defined by internal
36sample rate or data format limitations. E.g. it's common that
37signals can only be reported in 50 microsecond steps.
38
39This ioctl returns the integer value with such resolution, with can be
40used by userspace applications like lircd to automatically adjust the
41tolerance value.
42
43
44Return Value
45============
46
47On success 0 is returned, on error -1 and the ``errno`` variable is set
48appropriately. The generic error codes are described at the
49:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-get-send-mode.rst b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
new file mode 100644
index 000000000000..3e1d96122ff2
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
@@ -0,0 +1,45 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_send_mode:
4.. _lirc_set_send_mode:
5
6************************************************
7ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
8************************************************
9
10Name
11====
12
13LIRC_GET_SEND_MODE/LIRC_SET_SEND_MODE - Get/set supported transmit mode.
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 *tx_modes )
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_GET_SEND_MODE
28
29``tx_modes``
30 Bitmask with the supported transmit modes.
31
32
33Description
34===========
35
36Get/set supported transmit mode.
37
38Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` is supported by for IR send.
39
40Return Value
41============
42
43On success 0 is returned, on error -1 and the ``errno`` variable is set
44appropriately. The generic error codes are described at the
45:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-get-timeout.rst b/Documentation/media/uapi/rc/lirc-get-timeout.rst
new file mode 100644
index 000000000000..6b8238f1f30e
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-timeout.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_get_min_timeout:
4.. _lirc_get_max_timeout:
5
6****************************************************
7ioctls LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT
8****************************************************
9
10Name
11====
12
13LIRC_GET_MIN_TIMEOUT / LIRC_GET_MAX_TIMEOUT - Obtain the possible timeout
14range for IR receive.
15
16Synopsis
17========
18
19.. cpp:function:: int ioctl( int fd, int request, __u32 *timeout)
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by open().
26
27``request``
28 LIRC_GET_MIN_TIMEOUT or LIRC_GET_MAX_TIMEOUT
29
30``timeout``
31 Timeout, in microseconds.
32
33
34Description
35===========
36
37Some devices have internal timers that can be used to detect when
38there's no IR activity for a long time. This can help lircd in
39detecting that a IR signal is finished and can speed up the decoding
40process. Returns an integer value with the minimum/maximum timeout
41that can be set.
42
43.. note::
44
45 Some devices have a fixed timeout, in that case
46 both ioctls will return the same value even though the timeout
47 cannot be changed via :ref:`LIRC_SET_REC_TIMEOUT`.
48
49
50Return Value
51============
52
53On success 0 is returned, on error -1 and the ``errno`` variable is set
54appropriately. The generic error codes are described at the
55:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-header.rst b/Documentation/media/uapi/rc/lirc-header.rst
new file mode 100644
index 000000000000..487fe00e5517
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-header.rst
@@ -0,0 +1,10 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_header:
4
5****************
6LIRC Header File
7****************
8
9.. kernel-include:: $BUILDDIR/lirc.h.rst
10
diff --git a/Documentation/media/uapi/rc/lirc-read.rst b/Documentation/media/uapi/rc/lirc-read.rst
new file mode 100644
index 000000000000..8d4e9b6e507d
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-read.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc-read:
4
5***********
6LIRC read()
7***********
8
9Name
10====
11
12lirc-read - Read from a LIRC device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t read( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by ``open()``.
31
32``buf``
33``count``
34
35
36Description
37===========
38
39:ref:`read() <lirc-read>` attempts to read up to ``count`` bytes from file
40descriptor ``fd`` into the buffer starting at ``buf``. If ``count`` is zero,
41:ref:`read() <lirc-read>` returns zero and has no other results. If ``count``
42is greater than ``SSIZE_MAX``, the result is unspecified.
43
44The lircd userspace daemon reads raw IR data from the LIRC chardev. The
45exact format of the data depends on what modes a driver supports, and
46what mode has been selected. lircd obtains supported modes and sets the
47active mode via the ioctl interface, detailed at :ref:`lirc_func`.
48The generally preferred mode for receive is
49:ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`, in which packets containing an
50int value describing an IR signal are read from the chardev.
51
52See also
53`http://www.lirc.org/html/technical.html <http://www.lirc.org/html/technical.html>`__
54for more info.
55
56Return Value
57============
58
59On success, the number of bytes read is returned. It is not an error if
60this number is smaller than the number of bytes requested, or the amount
61of data required for one frame. On error, -1 is returned, and the ``errno``
62variable is set appropriately.
diff --git a/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst b/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
new file mode 100644
index 000000000000..e145d9d1902d
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
@@ -0,0 +1,48 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_measure_carrier_mode:
4
5***********************************
6ioctl LIRC_SET_MEASURE_CARRIER_MODE
7***********************************
8
9Name
10====
11
12LIRC_SET_MEASURE_CARRIER_MODE - enable or disable measure mode
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_SET_MEASURE_CARRIER_MODE
27
28``enable``
29 enable = 1 means enable measure mode, enable = 0 means disable measure
30 mode.
31
32
33Description
34===========
35
36.. _lirc-mode2-frequency:
37
38Enable or disable measure mode. If enabled, from the next key
39press on, the driver will send ``LIRC_MODE2_FREQUENCY`` packets. By
40default this should be turned off.
41
42
43Return Value
44============
45
46On success 0 is returned, on error -1 and the ``errno`` variable is set
47appropriately. The generic error codes are described at the
48:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst b/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
new file mode 100644
index 000000000000..7cce9c8ba361
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_rec_carrier_range:
4
5********************************
6ioctl LIRC_SET_REC_CARRIER_RANGE
7********************************
8
9Name
10====
11
12LIRC_SET_REC_CARRIER_RANGE - Set lower bond of the carrier used to modulate
13IR receive.
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 *frequency )
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_SET_REC_CARRIER_RANGE
28
29``frequency``
30 Frequency of the carrier that modulates PWM data, in Hz.
31
32Description
33===========
34
35This ioctl sets the upper range of carrier frequency that will be recognized
36by the IR receiver.
37
38.. note::
39
40 To set a range use :ref:`LIRC_SET_REC_CARRIER_RANGE
41 <LIRC_SET_REC_CARRIER_RANGE>` with the lower bound first and later call
42 :ref:`LIRC_SET_REC_CARRIER <LIRC_SET_REC_CARRIER>` with the upper bound.
43
44Return Value
45============
46
47On success 0 is returned, on error -1 and the ``errno`` variable is set
48appropriately. The generic error codes are described at the
49:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst b/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
new file mode 100644
index 000000000000..17ddb4723caa
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
@@ -0,0 +1,48 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_rec_carrier:
4
5**************************
6ioctl LIRC_SET_REC_CARRIER
7**************************
8
9Name
10====
11
12LIRC_SET_REC_CARRIER - Set carrier used to modulate IR receive.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 *frequency )
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_SET_REC_CARRIER
28
29``frequency``
30 Frequency of the carrier that modulates PWM data, in Hz.
31
32Description
33===========
34
35Set receive carrier used to modulate IR PWM pulses and spaces.
36
37.. note::
38
39 If called together with :ref:`LIRC_SET_REC_CARRIER_RANGE`, this ioctl
40 sets the upper bound frequency that will be recognized by the device.
41
42
43Return Value
44============
45
46On success 0 is returned, on error -1 and the ``errno`` variable is set
47appropriately. The generic error codes are described at the
48:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst b/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
new file mode 100644
index 000000000000..0c7f85d0ce3b
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_rec_timeout_reports:
4
5**********************************
6ioctl LIRC_SET_REC_TIMEOUT_REPORTS
7**********************************
8
9Name
10====
11
12LIRC_SET_REC_TIMEOUT_REPORTS - enable or disable timeout reports for IR receive
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_SET_REC_TIMEOUT_REPORTS
27
28``enable``
29 enable = 1 means enable timeout report, enable = 0 means disable timeout
30 reports.
31
32
33Description
34===========
35
36Enable or disable timeout reports for IR receive. By default, timeout reports
37should be turned off.
38
39.. note::
40
41 This ioctl is only valid for :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`.
42
43
44Return Value
45============
46
47On success 0 is returned, on error -1 and the ``errno`` variable is set
48appropriately. The generic error codes are described at the
49:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst b/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
new file mode 100644
index 000000000000..ffc88f9fcd52
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
@@ -0,0 +1,52 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_rec_timeout:
4
5**************************
6ioctl LIRC_SET_REC_TIMEOUT
7**************************
8
9Name
10====
11
12LIRC_SET_REC_TIMEOUT - sets the integer value for IR inactivity timeout.
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *timeout )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_SET_REC_TIMEOUT
27
28``timeout``
29 Timeout, in microseconds.
30
31
32Description
33===========
34
35Sets the integer value for IR inactivity timeout.
36
37If supported by the hardware, setting it to 0 disables all hardware timeouts
38and data should be reported as soon as possible. If the exact value
39cannot be set, then the next possible value _greater_ than the
40given value should be set.
41
42.. note::
43
44 The range of supported timeout is given by :ref:`LIRC_GET_MIN_TIMEOUT`.
45
46
47Return Value
48============
49
50On success 0 is returned, on error -1 and the ``errno`` variable is set
51appropriately. The generic error codes are described at the
52:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-send-carrier.rst b/Documentation/media/uapi/rc/lirc-set-send-carrier.rst
new file mode 100644
index 000000000000..4314d4c86ced
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-send-carrier.rst
@@ -0,0 +1,43 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_send_carrier:
4
5***************************
6ioctl LIRC_SET_SEND_CARRIER
7***************************
8
9Name
10====
11
12LIRC_SET_SEND_CARRIER - Set send carrier used to modulate IR TX.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 *frequency )
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_SET_SEND_CARRIER
28
29``frequency``
30 Frequency of the carrier to be modulated, in Hz.
31
32Description
33===========
34
35Set send carrier used to modulate IR PWM pulses and spaces.
36
37
38Return Value
39============
40
41On success 0 is returned, on error -1 and the ``errno`` variable is set
42appropriately. The generic error codes are described at the
43:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst b/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
new file mode 100644
index 000000000000..48e7bb15fb69
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_send_duty_cycle:
4
5******************************
6ioctl LIRC_SET_SEND_DUTY_CYCLE
7******************************
8
9Name
10====
11
12LIRC_SET_SEND_DUTY_CYCLE - Set the duty cycle of the carrier signal for
13IR transmit.
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, __u32 *duty_cycle)
19
20Arguments
21=========
22
23``fd``
24 File descriptor returned by open().
25
26``request``
27 LIRC_SET_SEND_DUTY_CYCLE
28
29``duty_cycle``
30 Duty cicle, describing the pulse width in percent (from 1 to 99) of
31 the total cycle. Values 0 and 100 are reserved.
32
33
34Description
35===========
36
37Get/set the duty cycle of the carrier signal for IR transmit.
38
39Currently, no special meaning is defined for 0 or 100, but this
40could be used to switch off carrier generation in the future, so
41these values should be reserved.
42
43
44Return Value
45============
46
47On success 0 is returned, on error -1 and the ``errno`` variable is set
48appropriately. The generic error codes are described at the
49:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst b/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
new file mode 100644
index 000000000000..2b35e21b9bb9
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
@@ -0,0 +1,53 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_transmitter_mask:
4
5*******************************
6ioctl LIRC_SET_TRANSMITTER_MASK
7*******************************
8
9Name
10====
11
12LIRC_SET_TRANSMITTER_MASK - Enables send codes on a given set of transmitters
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *mask )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_SET_TRANSMITTER_MASK
27
28``mask``
29 Mask with channels to enable tx. Channel 0 is the least significant bit.
30
31
32Description
33===========
34
35Some IR TX devices have multiple output channels, in such case,
36:ref:`LIRC_CAN_SET_TRANSMITTER_MASK <LIRC-CAN-SET-TRANSMITTER-MASK>` is
37returned via :ref:`LIRC_GET_FEATURES` and this ioctl sets what channels will
38send IR codes.
39
40This ioctl enables the given set of transmitters. The first transmitter is
41encoded by the least significant bit and so on.
42
43When an invalid bit mask is given, i.e. a bit is set, even though the device
44does not have so many transitters, then this ioctl returns the number of
45available transitters and does nothing otherwise.
46
47
48Return Value
49============
50
51On success 0 is returned, on error -1 and the ``errno`` variable is set
52appropriately. The generic error codes are described at the
53:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst b/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
new file mode 100644
index 000000000000..cffb01fd1042
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
@@ -0,0 +1,56 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc_set_wideband_receiver:
4
5********************************
6ioctl LIRC_SET_WIDEBAND_RECEIVER
7********************************
8
9Name
10====
11
12LIRC_SET_WIDEBAND_RECEIVER - enable wide band receiver.
13
14Synopsis
15========
16
17.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by open().
24
25``request``
26 LIRC_SET_WIDEBAND_RECEIVER
27
28``enable``
29 enable = 1 means enable wideband receiver, enable = 0 means disable
30 wideband receiver.
31
32
33Description
34===========
35
36Some receivers are equipped with special wide band receiver which is
37intended to be used to learn output of existing remote. This ioctl
38allows enabling or disabling it.
39
40This might be useful of receivers that have otherwise narrow band receiver
41that prevents them to be used with some remotes. Wide band receiver might
42also be more precise. On the other hand its disadvantage it usually
43reduced range of reception.
44
45.. note:: Wide band receiver might be implictly enabled if you enable
46 carrier reports. In that case it will be disabled as soon as you disable
47 carrier reports. Trying to disable wide band receiver while carrier
48 reports are active will do nothing.
49
50
51Return Value
52============
53
54On success 0 is returned, on error -1 and the ``errno`` variable is set
55appropriately. The generic error codes are described at the
56:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/lirc-write.rst b/Documentation/media/uapi/rc/lirc-write.rst
new file mode 100644
index 000000000000..dcba3b1bee6e
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-write.rst
@@ -0,0 +1,58 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _lirc-write:
4
5************
6LIRC write()
7************
8
9Name
10====
11
12lirc-write - Write to a LIRC device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t write( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by ``open()``.
31
32``buf``
33``count``
34
35
36Description
37===========
38
39:ref:`write() <lirc-write>` writes up to ``count`` bytes to the device
40referenced by the file descriptor ``fd`` from the buffer starting at
41``buf``.
42
43The data written to the chardev is a pulse/space sequence of integer
44values. Pulses and spaces are only marked implicitly by their position.
45The data must start and end with a pulse, therefore, the data must
46always include an uneven number of samples. The write function must
47block until the data has been transmitted by the hardware. If more data
48is provided than the hardware can send, the driver returns ``EINVAL``.
49
50
51Return Value
52============
53
54On success, the number of bytes read is returned. It is not an error if
55this number is smaller than the number of bytes requested, or the amount
56of data required for one frame. On error, -1 is returned, and the ``errno``
57variable is set appropriately. The generic error codes are described at the
58:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/rc/rc-intro.rst b/Documentation/media/uapi/rc/rc-intro.rst
new file mode 100644
index 000000000000..3707c29d37ed
--- /dev/null
+++ b/Documentation/media/uapi/rc/rc-intro.rst
@@ -0,0 +1,24 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _Remote_controllers_Intro:
4
5************
6Introduction
7************
8
9Currently, most analog and digital devices have a Infrared input for
10remote controllers. Each manufacturer has their own type of control. It
11is not rare for the same manufacturer to ship different types of
12controls, depending on the device.
13
14A Remote Controller interface is mapped as a normal evdev/input
15interface, just like a keyboard or a mouse. So, it uses all ioctls
16already defined for any other input devices.
17
18However, remove controllers are more flexible than a normal input
19device, as the IR receiver (and/or transmitter) can be used in
20conjunction with a wide variety of different IR remotes.
21
22In order to allow flexibility, the Remote Controller subsystem allows
23controlling the RC-specific attributes via
24:ref:`the sysfs class nodes <remote_controllers_sysfs_nodes>`.
diff --git a/Documentation/media/uapi/rc/rc-sysfs-nodes.rst b/Documentation/media/uapi/rc/rc-sysfs-nodes.rst
new file mode 100644
index 000000000000..6fb944fe21fd
--- /dev/null
+++ b/Documentation/media/uapi/rc/rc-sysfs-nodes.rst
@@ -0,0 +1,143 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _remote_controllers_sysfs_nodes:
4
5*******************************
6Remote Controller's sysfs nodes
7*******************************
8
9As defined at ``Documentation/ABI/testing/sysfs-class-rc``, those are
10the sysfs nodes that control the Remote Controllers:
11
12
13.. _sys_class_rc:
14
15/sys/class/rc/
16==============
17
18The ``/sys/class/rc/`` class sub-directory belongs to the Remote
19Controller core and provides a sysfs interface for configuring infrared
20remote controller receivers.
21
22
23.. _sys_class_rc_rcN:
24
25/sys/class/rc/rcN/
26==================
27
28A ``/sys/class/rc/rcN`` directory is created for each remote control
29receiver device where N is the number of the receiver.
30
31
32.. _sys_class_rc_rcN_protocols:
33
34/sys/class/rc/rcN/protocols
35===========================
36
37Reading this file returns a list of available protocols, something like:
38
39``rc5 [rc6] nec jvc [sony]``
40
41Enabled protocols are shown in [] brackets.
42
43Writing "+proto" will add a protocol to the list of enabled protocols.
44
45Writing "-proto" will remove a protocol from the list of enabled
46protocols.
47
48Writing "proto" will enable only "proto".
49
50Writing "none" will disable all protocols.
51
52Write fails with ``EINVAL`` if an invalid protocol combination or unknown
53protocol name is used.
54
55
56.. _sys_class_rc_rcN_filter:
57
58/sys/class/rc/rcN/filter
59========================
60
61Sets the scancode filter expected value.
62
63Use in combination with ``/sys/class/rc/rcN/filter_mask`` to set the
64expected value of the bits set in the filter mask. If the hardware
65supports it then scancodes which do not match the filter will be
66ignored. Otherwise the write will fail with an error.
67
68This value may be reset to 0 if the current protocol is altered.
69
70
71.. _sys_class_rc_rcN_filter_mask:
72
73/sys/class/rc/rcN/filter_mask
74=============================
75
76Sets the scancode filter mask of bits to compare. Use in combination
77with ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which
78should be compared against the expected value. A value of 0 disables the
79filter to allow all valid scancodes to be processed.
80
81If the hardware supports it then scancodes which do not match the filter
82will be ignored. Otherwise the write will fail with an error.
83
84This value may be reset to 0 if the current protocol is altered.
85
86
87.. _sys_class_rc_rcN_wakeup_protocols:
88
89/sys/class/rc/rcN/wakeup_protocols
90==================================
91
92Reading this file returns a list of available protocols to use for the
93wakeup filter, something like:
94
95``rc5 rc6 nec jvc [sony]``
96
97The enabled wakeup protocol is shown in [] brackets.
98
99Writing "+proto" will add a protocol to the list of enabled wakeup
100protocols.
101
102Writing "-proto" will remove a protocol from the list of enabled wakeup
103protocols.
104
105Writing "proto" will use "proto" for wakeup events.
106
107Writing "none" will disable wakeup.
108
109Write fails with ``EINVAL`` if an invalid protocol combination or unknown
110protocol name is used, or if wakeup is not supported by the hardware.
111
112
113.. _sys_class_rc_rcN_wakeup_filter:
114
115/sys/class/rc/rcN/wakeup_filter
116===============================
117
118Sets the scancode wakeup filter expected value. Use in combination with
119``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of
120the bits set in the wakeup filter mask to trigger a system wake event.
121
122If the hardware supports it and wakeup_filter_mask is not 0 then
123scancodes which match the filter will wake the system from e.g. suspend
124to RAM or power off. Otherwise the write will fail with an error.
125
126This value may be reset to 0 if the wakeup protocol is altered.
127
128
129.. _sys_class_rc_rcN_wakeup_filter_mask:
130
131/sys/class/rc/rcN/wakeup_filter_mask
132====================================
133
134Sets the scancode wakeup filter mask of bits to compare. Use in
135combination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of
136the scancode which should be compared against the expected value to
137trigger a system wake event.
138
139If the hardware supports it and wakeup_filter_mask is not 0 then
140scancodes which match the filter will wake the system from e.g. suspend
141to RAM or power off. Otherwise the write will fail with an error.
142
143This value may be reset to 0 if the wakeup protocol is altered.
diff --git a/Documentation/media/uapi/rc/rc-table-change.rst b/Documentation/media/uapi/rc/rc-table-change.rst
new file mode 100644
index 000000000000..d604896bca87
--- /dev/null
+++ b/Documentation/media/uapi/rc/rc-table-change.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _Remote_controllers_table_change:
4
5*******************************************
6Changing default Remote Controller mappings
7*******************************************
8
9The event interface provides two ioctls to be used against the
10/dev/input/event device, to allow changing the default keymapping.
11
12This program demonstrates how to replace the keymap tables.
13
14
15.. toctree::
16 :maxdepth: 1
17
18 keytable.c
diff --git a/Documentation/media/uapi/rc/rc-tables.rst b/Documentation/media/uapi/rc/rc-tables.rst
new file mode 100644
index 000000000000..0bb16c4af27d
--- /dev/null
+++ b/Documentation/media/uapi/rc/rc-tables.rst
@@ -0,0 +1,757 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _Remote_controllers_tables:
4
5************************
6Remote controller tables
7************************
8
9Unfortunately, for several years, there was no effort to create uniform
10IR keycodes for different devices. This caused the same IR keyname to be
11mapped completely differently on different IR devices. This resulted
12that the same IR keyname to be mapped completely different on different
13IR's. Due to that, V4L2 API now specifies a standard for mapping Media
14keys on IR.
15
16This standard should be used by both V4L/DVB drivers and userspace
17applications
18
19The modules register the remote as keyboard within the linux input
20layer. This means that the IR key strokes will look like normal keyboard
21key strokes (if CONFIG_INPUT_KEYBOARD is enabled). Using the event
22devices (CONFIG_INPUT_EVDEV) it is possible for applications to access
23the remote via /dev/input/event devices.
24
25
26.. _rc_standard_keymap:
27
28.. flat-table:: IR default keymapping
29 :header-rows: 0
30 :stub-columns: 0
31 :widths: 1 1 2
32
33
34 - .. row 1
35
36 - Key code
37
38 - Meaning
39
40 - Key examples on IR
41
42 - .. row 2
43
44 - **Numeric keys**
45
46 - .. row 3
47
48 - ``KEY_0``
49
50 - Keyboard digit 0
51
52 - 0
53
54 - .. row 4
55
56 - ``KEY_1``
57
58 - Keyboard digit 1
59
60 - 1
61
62 - .. row 5
63
64 - ``KEY_2``
65
66 - Keyboard digit 2
67
68 - 2
69
70 - .. row 6
71
72 - ``KEY_3``
73
74 - Keyboard digit 3
75
76 - 3
77
78 - .. row 7
79
80 - ``KEY_4``
81
82 - Keyboard digit 4
83
84 - 4
85
86 - .. row 8
87
88 - ``KEY_5``
89
90 - Keyboard digit 5
91
92 - 5
93
94 - .. row 9
95
96 - ``KEY_6``
97
98 - Keyboard digit 6
99
100 - 6
101
102 - .. row 10
103
104 - ``KEY_7``
105
106 - Keyboard digit 7
107
108 - 7
109
110 - .. row 11
111
112 - ``KEY_8``
113
114 - Keyboard digit 8
115
116 - 8
117
118 - .. row 12
119
120 - ``KEY_9``
121
122 - Keyboard digit 9
123
124 - 9
125
126 - .. row 13
127
128 - **Movie play control**
129
130 - .. row 14
131
132 - ``KEY_FORWARD``
133
134 - Instantly advance in time
135
136 - >> / FORWARD
137
138 - .. row 15
139
140 - ``KEY_BACK``
141
142 - Instantly go back in time
143
144 - <<< / BACK
145
146 - .. row 16
147
148 - ``KEY_FASTFORWARD``
149
150 - Play movie faster
151
152 - >>> / FORWARD
153
154 - .. row 17
155
156 - ``KEY_REWIND``
157
158 - Play movie back
159
160 - REWIND / BACKWARD
161
162 - .. row 18
163
164 - ``KEY_NEXT``
165
166 - Select next chapter / sub-chapter / interval
167
168 - NEXT / SKIP
169
170 - .. row 19
171
172 - ``KEY_PREVIOUS``
173
174 - Select previous chapter / sub-chapter / interval
175
176 - << / PREV / PREVIOUS
177
178 - .. row 20
179
180 - ``KEY_AGAIN``
181
182 - Repeat the video or a video interval
183
184 - REPEAT / LOOP / RECALL
185
186 - .. row 21
187
188 - ``KEY_PAUSE``
189
190 - Pause sroweam
191
192 - PAUSE / FREEZE
193
194 - .. row 22
195
196 - ``KEY_PLAY``
197
198 - Play movie at the normal timeshift
199
200 - NORMAL TIMESHIFT / LIVE / >
201
202 - .. row 23
203
204 - ``KEY_PLAYPAUSE``
205
206 - Alternate between play and pause
207
208 - PLAY / PAUSE
209
210 - .. row 24
211
212 - ``KEY_STOP``
213
214 - Stop sroweam
215
216 - STOP
217
218 - .. row 25
219
220 - ``KEY_RECORD``
221
222 - Start/stop recording sroweam
223
224 - CAPTURE / REC / RECORD/PAUSE
225
226 - .. row 26
227
228 - ``KEY_CAMERA``
229
230 - Take a picture of the image
231
232 - CAMERA ICON / CAPTURE / SNAPSHOT
233
234 - .. row 27
235
236 - ``KEY_SHUFFLE``
237
238 - Enable shuffle mode
239
240 - SHUFFLE
241
242 - .. row 28
243
244 - ``KEY_TIME``
245
246 - Activate time shift mode
247
248 - TIME SHIFT
249
250 - .. row 29
251
252 - ``KEY_TITLE``
253
254 - Allow changing the chapter
255
256 - CHAPTER
257
258 - .. row 30
259
260 - ``KEY_SUBTITLE``
261
262 - Allow changing the subtitle
263
264 - SUBTITLE
265
266 - .. row 31
267
268 - **Image control**
269
270 - .. row 32
271
272 - ``KEY_BRIGHTNESSDOWN``
273
274 - Decrease Brightness
275
276 - BRIGHTNESS DECREASE
277
278 - .. row 33
279
280 - ``KEY_BRIGHTNESSUP``
281
282 - Increase Brightness
283
284 - BRIGHTNESS INCREASE
285
286 - .. row 34
287
288 - ``KEY_ANGLE``
289
290 - Switch video camera angle (on videos with more than one angle
291 stored)
292
293 - ANGLE / SWAP
294
295 - .. row 35
296
297 - ``KEY_EPG``
298
299 - Open the Elecrowonic Play Guide (EPG)
300
301 - EPG / GUIDE
302
303 - .. row 36
304
305 - ``KEY_TEXT``
306
307 - Activate/change closed caption mode
308
309 - CLOSED CAPTION/TELETEXT / DVD TEXT / TELETEXT / TTX
310
311 - .. row 37
312
313 - **Audio control**
314
315 - .. row 38
316
317 - ``KEY_AUDIO``
318
319 - Change audio source
320
321 - AUDIO SOURCE / AUDIO / MUSIC
322
323 - .. row 39
324
325 - ``KEY_MUTE``
326
327 - Mute/unmute audio
328
329 - MUTE / DEMUTE / UNMUTE
330
331 - .. row 40
332
333 - ``KEY_VOLUMEDOWN``
334
335 - Decrease volume
336
337 - VOLUME- / VOLUME DOWN
338
339 - .. row 41
340
341 - ``KEY_VOLUMEUP``
342
343 - Increase volume
344
345 - VOLUME+ / VOLUME UP
346
347 - .. row 42
348
349 - ``KEY_MODE``
350
351 - Change sound mode
352
353 - MONO/STEREO
354
355 - .. row 43
356
357 - ``KEY_LANGUAGE``
358
359 - Select Language
360
361 - 1ST / 2ND LANGUAGE / DVD LANG / MTS/SAP / MTS SEL
362
363 - .. row 44
364
365 - **Channel control**
366
367 - .. row 45
368
369 - ``KEY_CHANNEL``
370
371 - Go to the next favorite channel
372
373 - ALT / CHANNEL / CH SURFING / SURF / FAV
374
375 - .. row 46
376
377 - ``KEY_CHANNELDOWN``
378
379 - Decrease channel sequencially
380
381 - CHANNEL - / CHANNEL DOWN / DOWN
382
383 - .. row 47
384
385 - ``KEY_CHANNELUP``
386
387 - Increase channel sequencially
388
389 - CHANNEL + / CHANNEL UP / UP
390
391 - .. row 48
392
393 - ``KEY_DIGITS``
394
395 - Use more than one digit for channel
396
397 - PLUS / 100/ 1xx / xxx / -/-- / Single Double Triple Digit
398
399 - .. row 49
400
401 - ``KEY_SEARCH``
402
403 - Start channel autoscan
404
405 - SCAN / AUTOSCAN
406
407 - .. row 50
408
409 - **Colored keys**
410
411 - .. row 51
412
413 - ``KEY_BLUE``
414
415 - IR Blue key
416
417 - BLUE
418
419 - .. row 52
420
421 - ``KEY_GREEN``
422
423 - IR Green Key
424
425 - GREEN
426
427 - .. row 53
428
429 - ``KEY_RED``
430
431 - IR Red key
432
433 - RED
434
435 - .. row 54
436
437 - ``KEY_YELLOW``
438
439 - IR Yellow key
440
441 - YELLOW
442
443 - .. row 55
444
445 - **Media selection**
446
447 - .. row 56
448
449 - ``KEY_CD``
450
451 - Change input source to Compact Disc
452
453 - CD
454
455 - .. row 57
456
457 - ``KEY_DVD``
458
459 - Change input to DVD
460
461 - DVD / DVD MENU
462
463 - .. row 58
464
465 - ``KEY_EJECTCLOSECD``
466
467 - Open/close the CD/DVD player
468
469 - -> ) / CLOSE / OPEN
470
471 - .. row 59
472
473 - ``KEY_MEDIA``
474
475 - Turn on/off Media application
476
477 - PC/TV / TURN ON/OFF APP
478
479 - .. row 60
480
481 - ``KEY_PC``
482
483 - Selects from TV to PC
484
485 - PC
486
487 - .. row 61
488
489 - ``KEY_RADIO``
490
491 - Put into AM/FM radio mode
492
493 - RADIO / TV/FM / TV/RADIO / FM / FM/RADIO
494
495 - .. row 62
496
497 - ``KEY_TV``
498
499 - Select tv mode
500
501 - TV / LIVE TV
502
503 - .. row 63
504
505 - ``KEY_TV2``
506
507 - Select Cable mode
508
509 - AIR/CBL
510
511 - .. row 64
512
513 - ``KEY_VCR``
514
515 - Select VCR mode
516
517 - VCR MODE / DTR
518
519 - .. row 65
520
521 - ``KEY_VIDEO``
522
523 - Alternate between input modes
524
525 - SOURCE / SELECT / DISPLAY / SWITCH INPUTS / VIDEO
526
527 - .. row 66
528
529 - **Power control**
530
531 - .. row 67
532
533 - ``KEY_POWER``
534
535 - Turn on/off computer
536
537 - SYSTEM POWER / COMPUTER POWER
538
539 - .. row 68
540
541 - ``KEY_POWER2``
542
543 - Turn on/off application
544
545 - TV ON/OFF / POWER
546
547 - .. row 69
548
549 - ``KEY_SLEEP``
550
551 - Activate sleep timer
552
553 - SLEEP / SLEEP TIMER
554
555 - .. row 70
556
557 - ``KEY_SUSPEND``
558
559 - Put computer into suspend mode
560
561 - STANDBY / SUSPEND
562
563 - .. row 71
564
565 - **Window control**
566
567 - .. row 72
568
569 - ``KEY_CLEAR``
570
571 - Stop sroweam and return to default input video/audio
572
573 - CLEAR / RESET / BOSS KEY
574
575 - .. row 73
576
577 - ``KEY_CYCLEWINDOWS``
578
579 - Minimize windows and move to the next one
580
581 - ALT-TAB / MINIMIZE / DESKTOP
582
583 - .. row 74
584
585 - ``KEY_FAVORITES``
586
587 - Open the favorites sroweam window
588
589 - TV WALL / Favorites
590
591 - .. row 75
592
593 - ``KEY_MENU``
594
595 - Call application menu
596
597 - 2ND CONTROLS (USA: MENU) / DVD/MENU / SHOW/HIDE CTRL
598
599 - .. row 76
600
601 - ``KEY_NEW``
602
603 - Open/Close Picture in Picture
604
605 - PIP
606
607 - .. row 77
608
609 - ``KEY_OK``
610
611 - Send a confirmation code to application
612
613 - OK / ENTER / RETURN
614
615 - .. row 78
616
617 - ``KEY_SCREEN``
618
619 - Select screen aspect ratio
620
621 - 4:3 16:9 SELECT
622
623 - .. row 79
624
625 - ``KEY_ZOOM``
626
627 - Put device into zoom/full screen mode
628
629 - ZOOM / FULL SCREEN / ZOOM+ / HIDE PANNEL / SWITCH
630
631 - .. row 80
632
633 - **Navigation keys**
634
635 - .. row 81
636
637 - ``KEY_ESC``
638
639 - Cancel current operation
640
641 - CANCEL / BACK
642
643 - .. row 82
644
645 - ``KEY_HELP``
646
647 - Open a Help window
648
649 - HELP
650
651 - .. row 83
652
653 - ``KEY_HOMEPAGE``
654
655 - Navigate to Homepage
656
657 - HOME
658
659 - .. row 84
660
661 - ``KEY_INFO``
662
663 - Open On Screen Display
664
665 - DISPLAY INFORMATION / OSD
666
667 - .. row 85
668
669 - ``KEY_WWW``
670
671 - Open the default browser
672
673 - WEB
674
675 - .. row 86
676
677 - ``KEY_UP``
678
679 - Up key
680
681 - UP
682
683 - .. row 87
684
685 - ``KEY_DOWN``
686
687 - Down key
688
689 - DOWN
690
691 - .. row 88
692
693 - ``KEY_LEFT``
694
695 - Left key
696
697 - LEFT
698
699 - .. row 89
700
701 - ``KEY_RIGHT``
702
703 - Right key
704
705 - RIGHT
706
707 - .. row 90
708
709 - **Miscellaneous keys**
710
711 - .. row 91
712
713 - ``KEY_DOT``
714
715 - Return a dot
716
717 - .
718
719 - .. row 92
720
721 - ``KEY_FN``
722
723 - Select a function
724
725 - FUNCTION
726
727
728It should be noted that, sometimes, there some fundamental missing keys
729at some cheaper IR's. Due to that, it is recommended to:
730
731
732.. _rc_keymap_notes:
733
734.. flat-table:: Notes
735 :header-rows: 0
736 :stub-columns: 0
737
738
739 - .. row 1
740
741 - On simpler IR's, without separate channel keys, you need to map UP
742 as ``KEY_CHANNELUP``
743
744 - .. row 2
745
746 - On simpler IR's, without separate channel keys, you need to map
747 DOWN as ``KEY_CHANNELDOWN``
748
749 - .. row 3
750
751 - On simpler IR's, without separate volume keys, you need to map
752 LEFT as ``KEY_VOLUMEDOWN``
753
754 - .. row 4
755
756 - On simpler IR's, without separate volume keys, you need to map
757 RIGHT as ``KEY_VOLUMEUP``
diff --git a/Documentation/media/uapi/rc/remote_controllers.rst b/Documentation/media/uapi/rc/remote_controllers.rst
new file mode 100644
index 000000000000..3e25cc9f65e0
--- /dev/null
+++ b/Documentation/media/uapi/rc/remote_controllers.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5.. _remote_controllers:
6
7################################
8Part III - Remote Controller API
9################################
10
11.. class:: toc-title
12
13 Table of Contents
14
15.. toctree::
16 :maxdepth: 5
17 :numbered:
18
19 rc-intro
20 rc-sysfs-nodes
21 rc-tables
22 rc-table-change
23 lirc-dev
24
25
26**********************
27Revision and Copyright
28**********************
29
30Authors:
31
32- Carvalho Chehab, Mauro <mchehab@kernel.org>
33
34 - Initial version.
35
36**Copyright** |copy| 2009-2016 : Mauro Carvalho Chehab
37
38****************
39Revision History
40****************
41
42:revision: 3.15 / 2014-02-06 (*mcc*)
43
44Added the interface description and the RC sysfs class description.
45
46
47:revision: 1.0 / 2009-09-06 (*mcc*)
48
49Initial revision
diff --git a/Documentation/media/uapi/v4l/app-pri.rst b/Documentation/media/uapi/v4l/app-pri.rst
new file mode 100644
index 000000000000..a8c41a7ec396
--- /dev/null
+++ b/Documentation/media/uapi/v4l/app-pri.rst
@@ -0,0 +1,30 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _app-pri:
4
5********************
6Application Priority
7********************
8
9When multiple applications share a device it may be desirable to assign
10them different priorities. Contrary to the traditional "rm -rf /" school
11of thought a video recording application could for example block other
12applications from changing video controls or switching the current TV
13channel. Another objective is to permit low priority applications
14working in background, which can be preempted by user controlled
15applications and automatically regain control of the device at a later
16time.
17
18Since these features cannot be implemented entirely in user space V4L2
19defines the :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` and
20:ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctls to request and
21query the access priority associate with a file descriptor. Opening a
22device assigns a medium priority, compatible with earlier versions of
23V4L2 and drivers not supporting these ioctls. Applications requiring a
24different priority will usually call :ref:`VIDIOC_S_PRIORITY
25<VIDIOC_G_PRIORITY>` after verifying the device with the
26:ref:`VIDIOC_QUERYCAP` ioctl.
27
28Ioctls changing driver properties, such as
29:ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>`, return an ``EBUSY`` error code
30after another application obtained higher priority.
diff --git a/Documentation/media/uapi/v4l/async.rst b/Documentation/media/uapi/v4l/async.rst
new file mode 100644
index 000000000000..5affc0adb95b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/async.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _async:
4
5****************
6Asynchronous I/O
7****************
8
9This method is not defined yet.
diff --git a/Documentation/media/uapi/v4l/audio.rst b/Documentation/media/uapi/v4l/audio.rst
new file mode 100644
index 000000000000..4dd11345866c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/audio.rst
@@ -0,0 +1,95 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _audio:
4
5************************
6Audio Inputs and Outputs
7************************
8
9Audio inputs and outputs are physical connectors of a device. Video
10capture devices have inputs, output devices have outputs, zero or more
11each. Radio devices have no audio inputs or outputs. They have exactly
12one tuner which in fact *is* an audio source, but this API associates
13tuners with video inputs or outputs only, and radio devices have none of
14these. [#f1]_ A connector on a TV card to loop back the received audio
15signal to a sound card is not considered an audio output.
16
17Audio and video inputs and outputs are associated. Selecting a video
18source also selects an audio source. This is most evident when the video
19and audio source is a tuner. Further audio connectors can combine with
20more than one video input or output. Assumed two composite video inputs
21and two audio inputs exist, there may be up to four valid combinations.
22The relation of video and audio connectors is defined in the
23``audioset`` field of the respective struct
24:ref:`v4l2_input <v4l2-input>` or struct
25:ref:`v4l2_output <v4l2-output>`, where each bit represents the index
26number, starting at zero, of one audio input or output.
27
28To learn about the number and attributes of the available inputs and
29outputs applications can enumerate them with the
30:ref:`VIDIOC_ENUMAUDIO` and
31:ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` ioctl, respectively.
32The struct :ref:`v4l2_audio <v4l2-audio>` returned by the
33:ref:`VIDIOC_ENUMAUDIO` ioctl also contains signal
34:status information applicable when the current audio input is queried.
35
36The :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` and
37:ref:`VIDIOC_G_AUDOUT <VIDIOC_G_AUDOUT>` ioctls report the current
38audio input and output, respectively.
39
40.. note:: Note that, unlike :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
41 :ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` these ioctls return a
42 structure as :ref:`VIDIOC_ENUMAUDIO` and
43 :ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` do, not just an index.
44
45To select an audio input and change its properties applications call the
46:ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` ioctl. To select an audio
47output (which presently has no changeable properties) applications call
48the :ref:`VIDIOC_S_AUDOUT <VIDIOC_G_AUDOUT>` ioctl.
49
50Drivers must implement all audio input ioctls when the device has
51multiple selectable audio inputs, all audio output ioctls when the
52device has multiple selectable audio outputs. When the device has any
53audio inputs or outputs the driver must set the ``V4L2_CAP_AUDIO`` flag
54in the struct :ref:`v4l2_capability <v4l2-capability>` returned by
55the :ref:`VIDIOC_QUERYCAP` ioctl.
56
57
58Example: Information about the current audio input
59==================================================
60
61.. code-block:: c
62
63 struct v4l2_audio audio;
64
65 memset(&audio, 0, sizeof(audio));
66
67 if (-1 == ioctl(fd, VIDIOC_G_AUDIO, &audio)) {
68 perror("VIDIOC_G_AUDIO");
69 exit(EXIT_FAILURE);
70 }
71
72 printf("Current input: %s\\n", audio.name);
73
74
75Example: Switching to the first audio input
76===========================================
77
78.. code-block:: c
79
80 struct v4l2_audio audio;
81
82 memset(&audio, 0, sizeof(audio)); /* clear audio.mode, audio.reserved */
83
84 audio.index = 0;
85
86 if (-1 == ioctl(fd, VIDIOC_S_AUDIO, &audio)) {
87 perror("VIDIOC_S_AUDIO");
88 exit(EXIT_FAILURE);
89 }
90
91.. [#f1]
92 Actually struct :ref:`v4l2_audio <v4l2-audio>` ought to have a
93 ``tuner`` field like struct :ref:`v4l2_input <v4l2-input>`, not
94 only making the API more consistent but also permitting radio devices
95 with multiple tuners.
diff --git a/Documentation/media/uapi/v4l/biblio.rst b/Documentation/media/uapi/v4l/biblio.rst
new file mode 100644
index 000000000000..1cedcfc04327
--- /dev/null
+++ b/Documentation/media/uapi/v4l/biblio.rst
@@ -0,0 +1,391 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3**********
4References
5**********
6
7
8.. _cea608:
9
10CEA 608-E
11=========
12
13
14:title: CEA-608-E R-2014 "Line 21 Data Services"
15
16:author: Consumer Electronics Association (http://www.ce.org)
17
18.. _en300294:
19
20EN 300 294
21==========
22
23
24:title: EN 300 294 "625-line television Wide Screen Signalling (WSS)"
25
26:author: European Telecommunication Standards Institute (http://www.etsi.org)
27
28.. _ets300231:
29
30ETS 300 231
31===========
32
33
34:title: ETS 300 231 "Specification of the domestic video Programme Delivery Control system (PDC)"
35
36:author: European Telecommunication Standards Institute (http://www.etsi.org)
37
38.. _ets300706:
39
40ETS 300 706
41===========
42
43
44:title: ETS 300 706 "Enhanced Teletext specification"
45
46:author: European Telecommunication Standards Institute (http://www.etsi.org)
47
48.. _mpeg2part1:
49
50ISO 13818-1
51===========
52
53
54:title: ITU-T Rec. H.222.0 | ISO/IEC 13818-1 "Information technology — Generic coding of moving pictures and associated audio information: Systems"
55
56:author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch)
57
58.. _mpeg2part2:
59
60ISO 13818-2
61===========
62
63
64:title: ITU-T Rec. H.262 | ISO/IEC 13818-2 "Information technology — Generic coding of moving pictures and associated audio information: Video"
65
66:author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch)
67
68.. _itu470:
69
70ITU BT.470
71==========
72
73
74:title: ITU-R Recommendation BT.470-6 "Conventional Television Systems"
75
76:author: International Telecommunication Union (http://www.itu.ch)
77
78.. _itu601:
79
80ITU BT.601
81==========
82
83
84:title: ITU-R Recommendation BT.601-5 "Studio Encoding Parameters of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios"
85
86:author: International Telecommunication Union (http://www.itu.ch)
87
88.. _itu653:
89
90ITU BT.653
91==========
92
93
94:title: ITU-R Recommendation BT.653-3 "Teletext systems"
95
96:author: International Telecommunication Union (http://www.itu.ch)
97
98.. _itu709:
99
100ITU BT.709
101==========
102
103
104:title: ITU-R Recommendation BT.709-5 "Parameter values for the HDTV standards for production and international programme exchange"
105
106:author: International Telecommunication Union (http://www.itu.ch)
107
108.. _itu1119:
109
110ITU BT.1119
111===========
112
113
114:title: ITU-R Recommendation BT.1119 "625-line television Wide Screen Signalling (WSS)"
115
116:author: International Telecommunication Union (http://www.itu.ch)
117
118.. _jfif:
119
120JFIF
121====
122
123
124:title: JPEG File Interchange Format
125:subtitle: Version 1.02
126
127:author: Independent JPEG Group (http://www.ijg.org)
128
129.. _itu-t81:
130
131ITU-T.81
132========
133
134
135:title: ITU-T Recommendation T.81 "Information Technology — Digital Compression and Coding of Continous-Tone Still Images — Requirements and Guidelines"
136
137:author: International Telecommunication Union (http://www.itu.int)
138
139.. _w3c-jpeg-jfif:
140
141W3C JPEG JFIF
142=============
143
144
145:title: JPEG JFIF
146
147:author: The World Wide Web Consortium (http://www.w3.org)
148
149.. _smpte12m:
150
151SMPTE 12M
152=========
153
154
155:title: SMPTE 12M-1999 "Television, Audio and Film - Time and Control Code"
156
157:author: Society of Motion Picture and Television Engineers (http://www.smpte.org)
158
159.. _smpte170m:
160
161SMPTE 170M
162==========
163
164
165:title: SMPTE 170M-1999 "Television - Composite Analog Video Signal - NTSC for Studio Applications"
166
167:author: Society of Motion Picture and Television Engineers (http://www.smpte.org)
168
169.. _smpte240m:
170
171SMPTE 240M
172==========
173
174
175:title: SMPTE 240M-1999 "Television - Signal Parameters - 1125-Line High-Definition Production"
176
177:author: Society of Motion Picture and Television Engineers (http://www.smpte.org)
178
179.. _smpte431:
180
181SMPTE RP 431-2
182==============
183
184
185:title: SMPTE RP 431-2:2011 "D-Cinema Quality - Reference Projector and Environment"
186
187:author: Society of Motion Picture and Television Engineers (http://www.smpte.org)
188
189.. _smpte2084:
190
191SMPTE ST 2084
192=============
193
194
195:title: SMPTE ST 2084:2014 "High Dynamic Range Electro-Optical Transfer Function of Master Reference Displays"
196
197:author: Society of Motion Picture and Television Engineers (http://www.smpte.org)
198
199.. _srgb:
200
201sRGB
202====
203
204
205:title: IEC 61966-2-1 ed1.0 "Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB"
206
207:author: International Electrotechnical Commission (http://www.iec.ch)
208
209.. _sycc:
210
211sYCC
212====
213
214
215:title: IEC 61966-2-1-am1 ed1.0 "Amendment 1 - Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB"
216
217:author: International Electrotechnical Commission (http://www.iec.ch)
218
219.. _xvycc:
220
221xvYCC
222=====
223
224
225:title: IEC 61966-2-4 ed1.0 "Multimedia systems and equipment - Colour measurement and management - Part 2-4: Colour management - Extended-gamut YCC colour space for video applications - xvYCC"
226
227:author: International Electrotechnical Commission (http://www.iec.ch)
228
229.. _adobergb:
230
231AdobeRGB
232========
233
234
235:title: Adobe© RGB (1998) Color Image Encoding Version 2005-05
236
237:author: Adobe Systems Incorporated (http://www.adobe.com)
238
239.. _oprgb:
240
241opRGB
242=====
243
244
245:title: IEC 61966-2-5 "Multimedia systems and equipment - Colour measurement and management - Part 2-5: Colour management - Optional RGB colour space - opRGB"
246
247:author: International Electrotechnical Commission (http://www.iec.ch)
248
249.. _itu2020:
250
251ITU BT.2020
252===========
253
254
255:title: ITU-R Recommendation BT.2020 (08/2012) "Parameter values for ultra-high definition television systems for production and international programme exchange"
256
257:author: International Telecommunication Union (http://www.itu.ch)
258
259.. _tech3213:
260
261EBU Tech 3213
262=============
263
264
265:title: E.B.U. Standard for Chromaticity Tolerances for Studio Monitors"
266
267:author: European Broadcast Union (http://www.ebu.ch)
268
269.. _iec62106:
270
271IEC 62106
272=========
273
274
275:title: Specification of the radio data system (RDS) for VHF/FM sound broadcasting in the frequency range from 87,5 to 108,0 MHz
276
277:author: International Electrotechnical Commission (http://www.iec.ch)
278
279.. _nrsc4:
280
281NRSC-4-B
282========
283
284
285:title: NRSC-4-B: United States RBDS Standard
286
287:author: National Radio Systems Committee (http://www.nrscstandards.org)
288
289.. _iso12232:
290
291ISO 12232:2006
292==============
293
294
295:title: Photography — Digital still cameras — Determination of exposure index, ISO speed ratings, standard output sensitivity, and recommended exposure index
296
297:author: International Organization for Standardization (http://www.iso.org)
298
299.. _cea861:
300
301CEA-861-E
302=========
303
304
305:title: A DTV Profile for Uncompressed High Speed Digital Interfaces
306
307:author: Consumer Electronics Association (http://www.ce.org)
308
309.. _vesadmt:
310
311VESA DMT
312========
313
314
315:title: VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)
316
317:author: Video Electronics Standards Association (http://www.vesa.org)
318
319.. _vesaedid:
320
321EDID
322====
323
324
325:title: VESA Enhanced Extended Display Identification Data Standard
326:subtitle: Release A, Revision 2
327
328:author: Video Electronics Standards Association (http://www.vesa.org)
329
330.. _hdcp:
331
332HDCP
333====
334
335
336:title: High-bandwidth Digital Content Protection System
337:subtitle: Revision 1.3
338
339:author: Digital Content Protection LLC (http://www.digital-cp.com)
340
341.. _hdmi:
342
343HDMI
344====
345
346
347:title: High-Definition Multimedia Interface
348:subtitle: Specification Version 1.4a
349
350:author: HDMI Licensing LLC (http://www.hdmi.org)
351
352.. _hdmi2:
353
354HDMI2
355=====
356
357:title: High-Definition Multimedia Interface
358:subtitle: Specification Version 2.0
359
360:author: HDMI Licensing LLC (http://www.hdmi.org)
361
362.. _dp:
363
364DP
365==
366
367
368:title: VESA DisplayPort Standard
369:subtitle: Version 1, Revision 2
370
371:author: Video Electronics Standards Association (http://www.vesa.org)
372
373.. _poynton:
374
375poynton
376=======
377
378
379:title: Digital Video and HDTV, Algorithms and Interfaces
380
381:author: Charles Poynton
382
383.. _colimg:
384
385colimg
386======
387
388
389:title: Color Imaging: Fundamentals and Applications
390
391:author: Erik Reinhard et al.
diff --git a/Documentation/media/uapi/v4l/buffer.rst b/Documentation/media/uapi/v4l/buffer.rst
new file mode 100644
index 000000000000..5deb4a46f992
--- /dev/null
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -0,0 +1,982 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _buffer:
4
5*******
6Buffers
7*******
8
9A buffer contains data exchanged by application and driver using one of
10the Streaming I/O methods. In the multi-planar API, the data is held in
11planes, while the buffer structure acts as a container for the planes.
12Only pointers to buffers (planes) are exchanged, the data itself is not
13copied. These pointers, together with meta-information like timestamps
14or field parity, are stored in a struct :ref:`struct v4l2_buffer <v4l2-buffer>`,
15argument to the :ref:`VIDIOC_QUERYBUF`,
16:ref:`VIDIOC_QBUF` and
17:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. In the multi-planar API,
18some plane-specific members of struct :ref:`struct v4l2_buffer <v4l2-buffer>`,
19such as pointers and sizes for each plane, are stored in struct
20:ref:`struct v4l2_plane <v4l2-plane>` instead. In that case, struct
21:ref:`struct v4l2_buffer <v4l2-buffer>` contains an array of plane structures.
22
23Dequeued video buffers come with timestamps. The driver decides at which
24part of the frame and with which clock the timestamp is taken. Please
25see flags in the masks ``V4L2_BUF_FLAG_TIMESTAMP_MASK`` and
26``V4L2_BUF_FLAG_TSTAMP_SRC_MASK`` in :ref:`buffer-flags`. These flags
27are always valid and constant across all buffers during the whole video
28stream. Changes in these flags may take place as a side effect of
29:ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` or
30:ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` however. The
31``V4L2_BUF_FLAG_TIMESTAMP_COPY`` timestamp type which is used by e.g. on
32mem-to-mem devices is an exception to the rule: the timestamp source
33flags are copied from the OUTPUT video buffer to the CAPTURE video
34buffer.
35
36
37.. _v4l2-buffer:
38
39struct v4l2_buffer
40==================
41
42.. flat-table:: struct v4l2_buffer
43 :header-rows: 0
44 :stub-columns: 0
45 :widths: 1 1 1 2
46
47
48 - .. row 1
49
50 - __u32
51
52 - ``index``
53
54 -
55 - Number of the buffer, set by the application except when calling
56 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, then it is set by the
57 driver. This field can range from zero to the number of buffers
58 allocated with the :ref:`VIDIOC_REQBUFS` ioctl
59 (struct :ref:`v4l2_requestbuffers <v4l2-requestbuffers>`
60 ``count``), plus any buffers allocated with
61 :ref:`VIDIOC_CREATE_BUFS` minus one.
62
63 - .. row 2
64
65 - __u32
66
67 - ``type``
68
69 -
70 - Type of the buffer, same as struct
71 :ref:`v4l2_format <v4l2-format>` ``type`` or struct
72 :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``, set
73 by the application. See :ref:`v4l2-buf-type`
74
75 - .. row 3
76
77 - __u32
78
79 - ``bytesused``
80
81 -
82 - The number of bytes occupied by the data in the buffer. It depends
83 on the negotiated data format and may change with each buffer for
84 compressed variable size data like JPEG images. Drivers must set
85 this field when ``type`` refers to a capture stream, applications
86 when it refers to an output stream. If the application sets this
87 to 0 for an output stream, then ``bytesused`` will be set to the
88 size of the buffer (see the ``length`` field of this struct) by
89 the driver. For multiplanar formats this field is ignored and the
90 ``planes`` pointer is used instead.
91
92 - .. row 4
93
94 - __u32
95
96 - ``flags``
97
98 -
99 - Flags set by the application or driver, see :ref:`buffer-flags`.
100
101 - .. row 5
102
103 - __u32
104
105 - ``field``
106
107 -
108 - Indicates the field order of the image in the buffer, see
109 :ref:`v4l2-field`. This field is not used when the buffer
110 contains VBI data. Drivers must set it when ``type`` refers to a
111 capture stream, applications when it refers to an output stream.
112
113 - .. row 6
114
115 - struct timeval
116
117 - ``timestamp``
118
119 -
120 - For capture streams this is time when the first data byte was
121 captured, as returned by the :c:func:`clock_gettime()` function
122 for the relevant clock id; see ``V4L2_BUF_FLAG_TIMESTAMP_*`` in
123 :ref:`buffer-flags`. For output streams the driver stores the
124 time at which the last data byte was actually sent out in the
125 ``timestamp`` field. This permits applications to monitor the
126 drift between the video and system clock. For output streams that
127 use ``V4L2_BUF_FLAG_TIMESTAMP_COPY`` the application has to fill
128 in the timestamp which will be copied by the driver to the capture
129 stream.
130
131 - .. row 7
132
133 - struct :ref:`v4l2_timecode <v4l2-timecode>`
134
135 - ``timecode``
136
137 -
138 - When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
139 ``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
140 structure contains a frame timecode. In
141 :ref:`V4L2_FIELD_ALTERNATE <v4l2-field>` mode the top and
142 bottom field contain the same timecode. Timecodes are intended to
143 help video editing and are typically recorded on video tapes, but
144 also embedded in compressed formats like MPEG. This field is
145 independent of the ``timestamp`` and ``sequence`` fields.
146
147 - .. row 8
148
149 - __u32
150
151 - ``sequence``
152
153 -
154 - Set by the driver, counting the frames (not fields!) in sequence.
155 This field is set for both input and output devices.
156
157 - .. row 9
158
159 - :cspan:`3`
160
161 In :ref:`V4L2_FIELD_ALTERNATE <v4l2-field>` mode the top and
162 bottom field have the same sequence number. The count starts at
163 zero and includes dropped or repeated frames. A dropped frame was
164 received by an input device but could not be stored due to lack of
165 free buffer space. A repeated frame was displayed again by an
166 output device because the application did not pass new data in
167 time.
168
169 .. note:: This may count the frames received e.g. over USB, without
170 taking into account the frames dropped by the remote hardware due
171 to limited compression throughput or bus bandwidth. These devices
172 identify by not enumerating any video standards, see
173 :ref:`standard`.
174
175 - .. row 10
176
177 - __u32
178
179 - ``memory``
180
181 -
182 - This field must be set by applications and/or drivers in
183 accordance with the selected I/O method. See :ref:`v4l2-memory`
184
185 - .. row 11
186
187 - union
188
189 - ``m``
190
191 - .. row 12
192
193 -
194 - __u32
195
196 - ``offset``
197
198 - For the single-planar API and when ``memory`` is
199 ``V4L2_MEMORY_MMAP`` this is the offset of the buffer from the
200 start of the device memory. The value is returned by the driver
201 and apart of serving as parameter to the
202 :ref:`mmap() <func-mmap>` function not useful for applications.
203 See :ref:`mmap` for details
204
205 - .. row 13
206
207 -
208 - unsigned long
209
210 - ``userptr``
211
212 - For the single-planar API and when ``memory`` is
213 ``V4L2_MEMORY_USERPTR`` this is a pointer to the buffer (casted to
214 unsigned long type) in virtual memory, set by the application. See
215 :ref:`userp` for details.
216
217 - .. row 14
218
219 -
220 - struct v4l2_plane
221
222 - ``*planes``
223
224 - When using the multi-planar API, contains a userspace pointer to
225 an array of struct :ref:`v4l2_plane <v4l2-plane>`. The size of
226 the array should be put in the ``length`` field of this
227 :ref:`struct v4l2_buffer <v4l2-buffer>` structure.
228
229 - .. row 15
230
231 -
232 - int
233
234 - ``fd``
235
236 - For the single-plane API and when ``memory`` is
237 ``V4L2_MEMORY_DMABUF`` this is the file descriptor associated with
238 a DMABUF buffer.
239
240 - .. row 16
241
242 - __u32
243
244 - ``length``
245
246 -
247 - Size of the buffer (not the payload) in bytes for the
248 single-planar API. This is set by the driver based on the calls to
249 :ref:`VIDIOC_REQBUFS` and/or
250 :ref:`VIDIOC_CREATE_BUFS`. For the
251 multi-planar API the application sets this to the number of
252 elements in the ``planes`` array. The driver will fill in the
253 actual number of valid elements in that array.
254
255 - .. row 17
256
257 - __u32
258
259 - ``reserved2``
260
261 -
262 - A place holder for future extensions. Drivers and applications
263 must set this to 0.
264
265 - .. row 18
266
267 - __u32
268
269 - ``reserved``
270
271 -
272 - A place holder for future extensions. Drivers and applications
273 must set this to 0.
274
275
276
277.. _v4l2-plane:
278
279struct v4l2_plane
280=================
281
282.. flat-table::
283 :header-rows: 0
284 :stub-columns: 0
285 :widths: 1 1 1 2
286
287
288 - .. row 1
289
290 - __u32
291
292 - ``bytesused``
293
294 -
295 - The number of bytes occupied by data in the plane (its payload).
296 Drivers must set this field when ``type`` refers to a capture
297 stream, applications when it refers to an output stream. If the
298 application sets this to 0 for an output stream, then
299 ``bytesused`` will be set to the size of the plane (see the
300 ``length`` field of this struct) by the driver.
301
302 .. note:: Note that the actual image data starts at ``data_offset``
303 which may not be 0.
304
305 - .. row 2
306
307 - __u32
308
309 - ``length``
310
311 -
312 - Size in bytes of the plane (not its payload). This is set by the
313 driver based on the calls to
314 :ref:`VIDIOC_REQBUFS` and/or
315 :ref:`VIDIOC_CREATE_BUFS`.
316
317 - .. row 3
318
319 - union
320
321 - ``m``
322
323 -
324 -
325
326 - .. row 4
327
328 -
329 - __u32
330
331 - ``mem_offset``
332
333 - When the memory type in the containing struct
334 :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_MMAP``, this
335 is the value that should be passed to :ref:`mmap() <func-mmap>`,
336 similar to the ``offset`` field in struct
337 :ref:`v4l2_buffer <v4l2-buffer>`.
338
339 - .. row 5
340
341 -
342 - unsigned long
343
344 - ``userptr``
345
346 - When the memory type in the containing struct
347 :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_USERPTR``,
348 this is a userspace pointer to the memory allocated for this plane
349 by an application.
350
351 - .. row 6
352
353 -
354 - int
355
356 - ``fd``
357
358 - When the memory type in the containing struct
359 :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_DMABUF``,
360 this is a file descriptor associated with a DMABUF buffer, similar
361 to the ``fd`` field in struct :ref:`v4l2_buffer <v4l2-buffer>`.
362
363 - .. row 7
364
365 - __u32
366
367 - ``data_offset``
368
369 -
370 - Offset in bytes to video data in the plane. Drivers must set this
371 field when ``type`` refers to a capture stream, applications when
372 it refers to an output stream.
373
374 .. note:: That data_offset is included in ``bytesused``. So the
375 size of the image in the plane is ``bytesused``-``data_offset``
376 at offset ``data_offset`` from the start of the plane.
377
378 - .. row 8
379
380 - __u32
381
382 - ``reserved[11]``
383
384 -
385 - Reserved for future use. Should be zeroed by drivers and
386 applications.
387
388
389
390.. _v4l2-buf-type:
391
392enum v4l2_buf_type
393==================
394
395.. flat-table::
396 :header-rows: 0
397 :stub-columns: 0
398 :widths: 3 1 4
399
400
401 - .. row 1
402
403 - ``V4L2_BUF_TYPE_VIDEO_CAPTURE``
404
405 - 1
406
407 - Buffer of a single-planar video capture stream, see
408 :ref:`capture`.
409
410 - .. row 2
411
412 - ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``
413
414 - 9
415
416 - Buffer of a multi-planar video capture stream, see
417 :ref:`capture`.
418
419 - .. row 3
420
421 - ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
422
423 - 2
424
425 - Buffer of a single-planar video output stream, see
426 :ref:`output`.
427
428 - .. row 4
429
430 - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``
431
432 - 10
433
434 - Buffer of a multi-planar video output stream, see :ref:`output`.
435
436 - .. row 5
437
438 - ``V4L2_BUF_TYPE_VIDEO_OVERLAY``
439
440 - 3
441
442 - Buffer for video overlay, see :ref:`overlay`.
443
444 - .. row 6
445
446 - ``V4L2_BUF_TYPE_VBI_CAPTURE``
447
448 - 4
449
450 - Buffer of a raw VBI capture stream, see :ref:`raw-vbi`.
451
452 - .. row 7
453
454 - ``V4L2_BUF_TYPE_VBI_OUTPUT``
455
456 - 5
457
458 - Buffer of a raw VBI output stream, see :ref:`raw-vbi`.
459
460 - .. row 8
461
462 - ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE``
463
464 - 6
465
466 - Buffer of a sliced VBI capture stream, see :ref:`sliced`.
467
468 - .. row 9
469
470 - ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``
471
472 - 7
473
474 - Buffer of a sliced VBI output stream, see :ref:`sliced`.
475
476 - .. row 10
477
478 - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``
479
480 - 8
481
482 - Buffer for video output overlay (OSD), see :ref:`osd`.
483
484 - .. row 11
485
486 - ``V4L2_BUF_TYPE_SDR_CAPTURE``
487
488 - 11
489
490 - Buffer for Software Defined Radio (SDR) capture stream, see
491 :ref:`sdr`.
492
493 - .. row 12
494
495 - ``V4L2_BUF_TYPE_SDR_OUTPUT``
496
497 - 12
498
499 - Buffer for Software Defined Radio (SDR) output stream, see
500 :ref:`sdr`.
501
502
503
504.. _buffer-flags:
505
506Buffer Flags
507============
508
509.. flat-table::
510 :header-rows: 0
511 :stub-columns: 0
512 :widths: 3 1 4
513
514
515 - .. _`V4L2-BUF-FLAG-MAPPED`:
516
517 - ``V4L2_BUF_FLAG_MAPPED``
518
519 - 0x00000001
520
521 - The buffer resides in device memory and has been mapped into the
522 application's address space, see :ref:`mmap` for details.
523 Drivers set or clear this flag when the
524 :ref:`VIDIOC_QUERYBUF`,
525 :ref:`VIDIOC_QBUF` or
526 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called. Set by the
527 driver.
528
529 - .. _`V4L2-BUF-FLAG-QUEUED`:
530
531 - ``V4L2_BUF_FLAG_QUEUED``
532
533 - 0x00000002
534
535 - Internally drivers maintain two buffer queues, an incoming and
536 outgoing queue. When this flag is set, the buffer is currently on
537 the incoming queue. It automatically moves to the outgoing queue
538 after the buffer has been filled (capture devices) or displayed
539 (output devices). Drivers set or clear this flag when the
540 ``VIDIOC_QUERYBUF`` ioctl is called. After (successful) calling
541 the ``VIDIOC_QBUF``\ ioctl it is always set and after
542 ``VIDIOC_DQBUF`` always cleared.
543
544 - .. _`V4L2-BUF-FLAG-DONE`:
545
546 - ``V4L2_BUF_FLAG_DONE``
547
548 - 0x00000004
549
550 - When this flag is set, the buffer is currently on the outgoing
551 queue, ready to be dequeued from the driver. Drivers set or clear
552 this flag when the ``VIDIOC_QUERYBUF`` ioctl is called. After
553 calling the ``VIDIOC_QBUF`` or ``VIDIOC_DQBUF`` it is always
554 cleared. Of course a buffer cannot be on both queues at the same
555 time, the ``V4L2_BUF_FLAG_QUEUED`` and ``V4L2_BUF_FLAG_DONE`` flag
556 are mutually exclusive. They can be both cleared however, then the
557 buffer is in "dequeued" state, in the application domain so to
558 say.
559
560 - .. _`V4L2-BUF-FLAG-ERROR`:
561
562 - ``V4L2_BUF_FLAG_ERROR``
563
564 - 0x00000040
565
566 - When this flag is set, the buffer has been dequeued successfully,
567 although the data might have been corrupted. This is recoverable,
568 streaming may continue as normal and the buffer may be reused
569 normally. Drivers set this flag when the ``VIDIOC_DQBUF`` ioctl is
570 called.
571
572 - .. _`V4L2-BUF-FLAG-KEYFRAME`:
573
574 - ``V4L2_BUF_FLAG_KEYFRAME``
575
576 - 0x00000008
577
578 - Drivers set or clear this flag when calling the ``VIDIOC_DQBUF``
579 ioctl. It may be set by video capture devices when the buffer
580 contains a compressed image which is a key frame (or field), i. e.
581 can be decompressed on its own. Also known as an I-frame.
582 Applications can set this bit when ``type`` refers to an output
583 stream.
584
585 - .. _`V4L2-BUF-FLAG-PFRAME`:
586
587 - ``V4L2_BUF_FLAG_PFRAME``
588
589 - 0x00000010
590
591 - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags predicted frames
592 or fields which contain only differences to a previous key frame.
593 Applications can set this bit when ``type`` refers to an output
594 stream.
595
596 - .. _`V4L2-BUF-FLAG-BFRAME`:
597
598 - ``V4L2_BUF_FLAG_BFRAME``
599
600 - 0x00000020
601
602 - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags a bi-directional
603 predicted frame or field which contains only the differences
604 between the current frame and both the preceding and following key
605 frames to specify its content. Applications can set this bit when
606 ``type`` refers to an output stream.
607
608 - .. _`V4L2-BUF-FLAG-TIMECODE`:
609
610 - ``V4L2_BUF_FLAG_TIMECODE``
611
612 - 0x00000100
613
614 - The ``timecode`` field is valid. Drivers set or clear this flag
615 when the ``VIDIOC_DQBUF`` ioctl is called. Applications can set
616 this bit and the corresponding ``timecode`` structure when
617 ``type`` refers to an output stream.
618
619 - .. _`V4L2-BUF-FLAG-PREPARED`:
620
621 - ``V4L2_BUF_FLAG_PREPARED``
622
623 - 0x00000400
624
625 - The buffer has been prepared for I/O and can be queued by the
626 application. Drivers set or clear this flag when the
627 :ref:`VIDIOC_QUERYBUF`,
628 :ref:`VIDIOC_PREPARE_BUF <VIDIOC_QBUF>`,
629 :ref:`VIDIOC_QBUF` or
630 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called.
631
632 - .. _`V4L2-BUF-FLAG-NO-CACHE-INVALIDATE`:
633
634 - ``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE``
635
636 - 0x00000800
637
638 - Caches do not have to be invalidated for this buffer. Typically
639 applications shall use this flag if the data captured in the
640 buffer is not going to be touched by the CPU, instead the buffer
641 will, probably, be passed on to a DMA-capable hardware unit for
642 further processing or output.
643
644 - .. _`V4L2-BUF-FLAG-NO-CACHE-CLEAN`:
645
646 - ``V4L2_BUF_FLAG_NO_CACHE_CLEAN``
647
648 - 0x00001000
649
650 - Caches do not have to be cleaned for this buffer. Typically
651 applications shall use this flag for output buffers if the data in
652 this buffer has not been created by the CPU but by some
653 DMA-capable unit, in which case caches have not been used.
654
655 - .. _`V4L2-BUF-FLAG-LAST`:
656
657 - ``V4L2_BUF_FLAG_LAST``
658
659 - 0x00100000
660
661 - Last buffer produced by the hardware. mem2mem codec drivers set
662 this flag on the capture queue for the last buffer when the
663 :ref:`VIDIOC_QUERYBUF` or
664 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called. Due to
665 hardware limitations, the last buffer may be empty. In this case
666 the driver will set the ``bytesused`` field to 0, regardless of
667 the format. Any Any subsequent call to the
668 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
669 but return an ``EPIPE`` error code.
670
671 - .. _`V4L2-BUF-FLAG-TIMESTAMP-MASK`:
672
673 - ``V4L2_BUF_FLAG_TIMESTAMP_MASK``
674
675 - 0x0000e000
676
677 - Mask for timestamp types below. To test the timestamp type, mask
678 out bits not belonging to timestamp type by performing a logical
679 and operation with buffer flags and timestamp mask.
680
681 - .. _`V4L2-BUF-FLAG-TIMESTAMP-UNKNOWN`:
682
683 - ``V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN``
684
685 - 0x00000000
686
687 - Unknown timestamp type. This type is used by drivers before Linux
688 3.9 and may be either monotonic (see below) or realtime (wall
689 clock). Monotonic clock has been favoured in embedded systems
690 whereas most of the drivers use the realtime clock. Either kinds
691 of timestamps are available in user space via
692 :c:func:`clock_gettime(2)` using clock IDs ``CLOCK_MONOTONIC``
693 and ``CLOCK_REALTIME``, respectively.
694
695 - .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
696
697 - ``V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC``
698
699 - 0x00002000
700
701 - The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
702 clock. To access the same clock outside V4L2, use
703 :c:func:`clock_gettime(2)`.
704
705 - .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
706
707 - ``V4L2_BUF_FLAG_TIMESTAMP_COPY``
708
709 - 0x00004000
710
711 - The CAPTURE buffer timestamp has been taken from the corresponding
712 OUTPUT buffer. This flag applies only to mem2mem devices.
713
714 - .. _`V4L2-BUF-FLAG-TSTAMP-SRC-MASK`:
715
716 - ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK``
717
718 - 0x00070000
719
720 - Mask for timestamp sources below. The timestamp source defines the
721 point of time the timestamp is taken in relation to the frame.
722 Logical 'and' operation between the ``flags`` field and
723 ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK`` produces the value of the
724 timestamp source. Applications must set the timestamp source when
725 ``type`` refers to an output stream and
726 ``V4L2_BUF_FLAG_TIMESTAMP_COPY`` is set.
727
728 - .. _`V4L2-BUF-FLAG-TSTAMP-SRC-EOF`:
729
730 - ``V4L2_BUF_FLAG_TSTAMP_SRC_EOF``
731
732 - 0x00000000
733
734 - End Of Frame. The buffer timestamp has been taken when the last
735 pixel of the frame has been received or the last pixel of the
736 frame has been transmitted. In practice, software generated
737 timestamps will typically be read from the clock a small amount of
738 time after the last pixel has been received or transmitten,
739 depending on the system and other activity in it.
740
741 - .. _`V4L2-BUF-FLAG-TSTAMP-SRC-SOE`:
742
743 - ``V4L2_BUF_FLAG_TSTAMP_SRC_SOE``
744
745 - 0x00010000
746
747 - Start Of Exposure. The buffer timestamp has been taken when the
748 exposure of the frame has begun. This is only valid for the
749 ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` buffer type.
750
751
752
753.. _v4l2-memory:
754
755enum v4l2_memory
756================
757
758.. flat-table::
759 :header-rows: 0
760 :stub-columns: 0
761 :widths: 3 1 4
762
763
764 - .. row 1
765
766 - ``V4L2_MEMORY_MMAP``
767
768 - 1
769
770 - The buffer is used for :ref:`memory mapping <mmap>` I/O.
771
772 - .. row 2
773
774 - ``V4L2_MEMORY_USERPTR``
775
776 - 2
777
778 - The buffer is used for :ref:`user pointer <userp>` I/O.
779
780 - .. row 3
781
782 - ``V4L2_MEMORY_OVERLAY``
783
784 - 3
785
786 - [to do]
787
788 - .. row 4
789
790 - ``V4L2_MEMORY_DMABUF``
791
792 - 4
793
794 - The buffer is used for :ref:`DMA shared buffer <dmabuf>` I/O.
795
796
797
798Timecodes
799=========
800
801The :ref:`struct v4l2_timecode <v4l2-timecode>` structure is designed to hold a
802:ref:`smpte12m` or similar timecode. (struct
803:c:type:`struct timeval` timestamps are stored in struct
804:ref:`v4l2_buffer <v4l2-buffer>` field ``timestamp``.)
805
806
807.. _v4l2-timecode:
808
809struct v4l2_timecode
810--------------------
811
812.. flat-table::
813 :header-rows: 0
814 :stub-columns: 0
815 :widths: 1 1 2
816
817
818 - .. row 1
819
820 - __u32
821
822 - ``type``
823
824 - Frame rate the timecodes are based on, see :ref:`timecode-type`.
825
826 - .. row 2
827
828 - __u32
829
830 - ``flags``
831
832 - Timecode flags, see :ref:`timecode-flags`.
833
834 - .. row 3
835
836 - __u8
837
838 - ``frames``
839
840 - Frame count, 0 ... 23/24/29/49/59, depending on the type of
841 timecode.
842
843 - .. row 4
844
845 - __u8
846
847 - ``seconds``
848
849 - Seconds count, 0 ... 59. This is a binary, not BCD number.
850
851 - .. row 5
852
853 - __u8
854
855 - ``minutes``
856
857 - Minutes count, 0 ... 59. This is a binary, not BCD number.
858
859 - .. row 6
860
861 - __u8
862
863 - ``hours``
864
865 - Hours count, 0 ... 29. This is a binary, not BCD number.
866
867 - .. row 7
868
869 - __u8
870
871 - ``userbits``\ [4]
872
873 - The "user group" bits from the timecode.
874
875
876
877.. _timecode-type:
878
879Timecode Types
880--------------
881
882.. flat-table::
883 :header-rows: 0
884 :stub-columns: 0
885 :widths: 3 1 4
886
887
888 - .. row 1
889
890 - ``V4L2_TC_TYPE_24FPS``
891
892 - 1
893
894 - 24 frames per second, i. e. film.
895
896 - .. row 2
897
898 - ``V4L2_TC_TYPE_25FPS``
899
900 - 2
901
902 - 25 frames per second, i. e. PAL or SECAM video.
903
904 - .. row 3
905
906 - ``V4L2_TC_TYPE_30FPS``
907
908 - 3
909
910 - 30 frames per second, i. e. NTSC video.
911
912 - .. row 4
913
914 - ``V4L2_TC_TYPE_50FPS``
915
916 - 4
917
918 -
919
920 - .. row 5
921
922 - ``V4L2_TC_TYPE_60FPS``
923
924 - 5
925
926 -
927
928
929
930.. _timecode-flags:
931
932Timecode Flags
933--------------
934
935.. flat-table::
936 :header-rows: 0
937 :stub-columns: 0
938 :widths: 3 1 4
939
940
941 - .. row 1
942
943 - ``V4L2_TC_FLAG_DROPFRAME``
944
945 - 0x0001
946
947 - Indicates "drop frame" semantics for counting frames in 29.97 fps
948 material. When set, frame numbers 0 and 1 at the start of each
949 minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the
950 count.
951
952 - .. row 2
953
954 - ``V4L2_TC_FLAG_COLORFRAME``
955
956 - 0x0002
957
958 - The "color frame" flag.
959
960 - .. row 3
961
962 - ``V4L2_TC_USERBITS_field``
963
964 - 0x000C
965
966 - Field mask for the "binary group flags".
967
968 - .. row 4
969
970 - ``V4L2_TC_USERBITS_USERDEFINED``
971
972 - 0x0000
973
974 - Unspecified format.
975
976 - .. row 5
977
978 - ``V4L2_TC_USERBITS_8BITCHARS``
979
980 - 0x0008
981
982 - 8-bit ISO characters.
diff --git a/Documentation/media/uapi/v4l/capture-example.rst b/Documentation/media/uapi/v4l/capture-example.rst
new file mode 100644
index 000000000000..ac1cd057e25b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/capture-example.rst
@@ -0,0 +1,13 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _capture-example:
4
5*********************
6Video Capture Example
7*********************
8
9
10.. toctree::
11 :maxdepth: 1
12
13 capture.c
diff --git a/Documentation/media/uapi/v4l/capture.c.rst b/Documentation/media/uapi/v4l/capture.c.rst
new file mode 100644
index 000000000000..56525a0fb2fa
--- /dev/null
+++ b/Documentation/media/uapi/v4l/capture.c.rst
@@ -0,0 +1,664 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3file: media/v4l/capture.c
4=========================
5
6.. code-block:: c
7
8 /*
9 * V4L2 video capture example
10 *
11 * This program can be used and distributed without restrictions.
12 *
13 * This program is provided with the V4L2 API
14 * see https://linuxtv.org/docs.php for more information
15 */
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <assert.h>
21
22 #include <getopt.h> /* getopt_long() */
23
24 #include <fcntl.h> /* low-level i/o */
25 #include <unistd.h>
26 #include <errno.h>
27 #include <sys/stat.h>
28 #include <sys/types.h>
29 #include <sys/time.h>
30 #include <sys/mman.h>
31 #include <sys/ioctl.h>
32
33 #include <linux/videodev2.h>
34
35 #define CLEAR(x) memset(&(x), 0, sizeof(x))
36
37 enum io_method {
38 IO_METHOD_READ,
39 IO_METHOD_MMAP,
40 IO_METHOD_USERPTR,
41 };
42
43 struct buffer {
44 void *start;
45 size_t length;
46 };
47
48 static char *dev_name;
49 static enum io_method io = IO_METHOD_MMAP;
50 static int fd = -1;
51 struct buffer *buffers;
52 static unsigned int n_buffers;
53 static int out_buf;
54 static int force_format;
55 static int frame_count = 70;
56
57 static void errno_exit(const char *s)
58 {
59 fprintf(stderr, "%s error %d, %s\\n", s, errno, strerror(errno));
60 exit(EXIT_FAILURE);
61 }
62
63 static int xioctl(int fh, int request, void *arg)
64 {
65 int r;
66
67 do {
68 r = ioctl(fh, request, arg);
69 } while (-1 == r && EINTR == errno);
70
71 return r;
72 }
73
74 static void process_image(const void *p, int size)
75 {
76 if (out_buf)
77 fwrite(p, size, 1, stdout);
78
79 fflush(stderr);
80 fprintf(stderr, ".");
81 fflush(stdout);
82 }
83
84 static int read_frame(void)
85 {
86 struct v4l2_buffer buf;
87 unsigned int i;
88
89 switch (io) {
90 case IO_METHOD_READ:
91 if (-1 == read(fd, buffers[0].start, buffers[0].length)) {
92 switch (errno) {
93 case EAGAIN:
94 return 0;
95
96 case EIO:
97 /* Could ignore EIO, see spec. */
98
99 /* fall through */
100
101 default:
102 errno_exit("read");
103 }
104 }
105
106 process_image(buffers[0].start, buffers[0].length);
107 break;
108
109 case IO_METHOD_MMAP:
110 CLEAR(buf);
111
112 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
113 buf.memory = V4L2_MEMORY_MMAP;
114
115 if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
116 switch (errno) {
117 case EAGAIN:
118 return 0;
119
120 case EIO:
121 /* Could ignore EIO, see spec. */
122
123 /* fall through */
124
125 default:
126 errno_exit("VIDIOC_DQBUF");
127 }
128 }
129
130 assert(buf.index < n_buffers);
131
132 process_image(buffers[buf.index].start, buf.bytesused);
133
134 if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
135 errno_exit("VIDIOC_QBUF");
136 break;
137
138 case IO_METHOD_USERPTR:
139 CLEAR(buf);
140
141 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
142 buf.memory = V4L2_MEMORY_USERPTR;
143
144 if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
145 switch (errno) {
146 case EAGAIN:
147 return 0;
148
149 case EIO:
150 /* Could ignore EIO, see spec. */
151
152 /* fall through */
153
154 default:
155 errno_exit("VIDIOC_DQBUF");
156 }
157 }
158
159 for (i = 0; i < n_buffers; ++i)
160 if (buf.m.userptr == (unsigned long)buffers[i].start
161 && buf.length == buffers[i].length)
162 break;
163
164 assert(i < n_buffers);
165
166 process_image((void *)buf.m.userptr, buf.bytesused);
167
168 if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
169 errno_exit("VIDIOC_QBUF");
170 break;
171 }
172
173 return 1;
174 }
175
176 static void mainloop(void)
177 {
178 unsigned int count;
179
180 count = frame_count;
181
182 while (count-- > 0) {
183 for (;;) {
184 fd_set fds;
185 struct timeval tv;
186 int r;
187
188 FD_ZERO(&fds);
189 FD_SET(fd, &fds);
190
191 /* Timeout. */
192 tv.tv_sec = 2;
193 tv.tv_usec = 0;
194
195 r = select(fd + 1, &fds, NULL, NULL, &tv);
196
197 if (-1 == r) {
198 if (EINTR == errno)
199 continue;
200 errno_exit("select");
201 }
202
203 if (0 == r) {
204 fprintf(stderr, "select timeout\\n");
205 exit(EXIT_FAILURE);
206 }
207
208 if (read_frame())
209 break;
210 /* EAGAIN - continue select loop. */
211 }
212 }
213 }
214
215 static void stop_capturing(void)
216 {
217 enum v4l2_buf_type type;
218
219 switch (io) {
220 case IO_METHOD_READ:
221 /* Nothing to do. */
222 break;
223
224 case IO_METHOD_MMAP:
225 case IO_METHOD_USERPTR:
226 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
227 if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &type))
228 errno_exit("VIDIOC_STREAMOFF");
229 break;
230 }
231 }
232
233 static void start_capturing(void)
234 {
235 unsigned int i;
236 enum v4l2_buf_type type;
237
238 switch (io) {
239 case IO_METHOD_READ:
240 /* Nothing to do. */
241 break;
242
243 case IO_METHOD_MMAP:
244 for (i = 0; i < n_buffers; ++i) {
245 struct v4l2_buffer buf;
246
247 CLEAR(buf);
248 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
249 buf.memory = V4L2_MEMORY_MMAP;
250 buf.index = i;
251
252 if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
253 errno_exit("VIDIOC_QBUF");
254 }
255 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
256 if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
257 errno_exit("VIDIOC_STREAMON");
258 break;
259
260 case IO_METHOD_USERPTR:
261 for (i = 0; i < n_buffers; ++i) {
262 struct v4l2_buffer buf;
263
264 CLEAR(buf);
265 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
266 buf.memory = V4L2_MEMORY_USERPTR;
267 buf.index = i;
268 buf.m.userptr = (unsigned long)buffers[i].start;
269 buf.length = buffers[i].length;
270
271 if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
272 errno_exit("VIDIOC_QBUF");
273 }
274 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
275 if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
276 errno_exit("VIDIOC_STREAMON");
277 break;
278 }
279 }
280
281 static void uninit_device(void)
282 {
283 unsigned int i;
284
285 switch (io) {
286 case IO_METHOD_READ:
287 free(buffers[0].start);
288 break;
289
290 case IO_METHOD_MMAP:
291 for (i = 0; i < n_buffers; ++i)
292 if (-1 == munmap(buffers[i].start, buffers[i].length))
293 errno_exit("munmap");
294 break;
295
296 case IO_METHOD_USERPTR:
297 for (i = 0; i < n_buffers; ++i)
298 free(buffers[i].start);
299 break;
300 }
301
302 free(buffers);
303 }
304
305 static void init_read(unsigned int buffer_size)
306 {
307 buffers = calloc(1, sizeof(*buffers));
308
309 if (!buffers) {
310 fprintf(stderr, "Out of memory\\n");
311 exit(EXIT_FAILURE);
312 }
313
314 buffers[0].length = buffer_size;
315 buffers[0].start = malloc(buffer_size);
316
317 if (!buffers[0].start) {
318 fprintf(stderr, "Out of memory\\n");
319 exit(EXIT_FAILURE);
320 }
321 }
322
323 static void init_mmap(void)
324 {
325 struct v4l2_requestbuffers req;
326
327 CLEAR(req);
328
329 req.count = 4;
330 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
331 req.memory = V4L2_MEMORY_MMAP;
332
333 if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
334 if (EINVAL == errno) {
335 fprintf(stderr, "%s does not support "
336 "memory mappingn", dev_name);
337 exit(EXIT_FAILURE);
338 } else {
339 errno_exit("VIDIOC_REQBUFS");
340 }
341 }
342
343 if (req.count < 2) {
344 fprintf(stderr, "Insufficient buffer memory on %s\\n",
345 dev_name);
346 exit(EXIT_FAILURE);
347 }
348
349 buffers = calloc(req.count, sizeof(*buffers));
350
351 if (!buffers) {
352 fprintf(stderr, "Out of memory\\n");
353 exit(EXIT_FAILURE);
354 }
355
356 for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
357 struct v4l2_buffer buf;
358
359 CLEAR(buf);
360
361 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
362 buf.memory = V4L2_MEMORY_MMAP;
363 buf.index = n_buffers;
364
365 if (-1 == xioctl(fd, VIDIOC_QUERYBUF, &buf))
366 errno_exit("VIDIOC_QUERYBUF");
367
368 buffers[n_buffers].length = buf.length;
369 buffers[n_buffers].start =
370 mmap(NULL /* start anywhere */,
371 buf.length,
372 PROT_READ | PROT_WRITE /* required */,
373 MAP_SHARED /* recommended */,
374 fd, buf.m.offset);
375
376 if (MAP_FAILED == buffers[n_buffers].start)
377 errno_exit("mmap");
378 }
379 }
380
381 static void init_userp(unsigned int buffer_size)
382 {
383 struct v4l2_requestbuffers req;
384
385 CLEAR(req);
386
387 req.count = 4;
388 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
389 req.memory = V4L2_MEMORY_USERPTR;
390
391 if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
392 if (EINVAL == errno) {
393 fprintf(stderr, "%s does not support "
394 "user pointer i/on", dev_name);
395 exit(EXIT_FAILURE);
396 } else {
397 errno_exit("VIDIOC_REQBUFS");
398 }
399 }
400
401 buffers = calloc(4, sizeof(*buffers));
402
403 if (!buffers) {
404 fprintf(stderr, "Out of memory\\n");
405 exit(EXIT_FAILURE);
406 }
407
408 for (n_buffers = 0; n_buffers < 4; ++n_buffers) {
409 buffers[n_buffers].length = buffer_size;
410 buffers[n_buffers].start = malloc(buffer_size);
411
412 if (!buffers[n_buffers].start) {
413 fprintf(stderr, "Out of memory\\n");
414 exit(EXIT_FAILURE);
415 }
416 }
417 }
418
419 static void init_device(void)
420 {
421 struct v4l2_capability cap;
422 struct v4l2_cropcap cropcap;
423 struct v4l2_crop crop;
424 struct v4l2_format fmt;
425 unsigned int min;
426
427 if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &cap)) {
428 if (EINVAL == errno) {
429 fprintf(stderr, "%s is no V4L2 device\\n",
430 dev_name);
431 exit(EXIT_FAILURE);
432 } else {
433 errno_exit("VIDIOC_QUERYCAP");
434 }
435 }
436
437 if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
438 fprintf(stderr, "%s is no video capture device\\n",
439 dev_name);
440 exit(EXIT_FAILURE);
441 }
442
443 switch (io) {
444 case IO_METHOD_READ:
445 if (!(cap.capabilities & V4L2_CAP_READWRITE)) {
446 fprintf(stderr, "%s does not support read i/o\\n",
447 dev_name);
448 exit(EXIT_FAILURE);
449 }
450 break;
451
452 case IO_METHOD_MMAP:
453 case IO_METHOD_USERPTR:
454 if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
455 fprintf(stderr, "%s does not support streaming i/o\\n",
456 dev_name);
457 exit(EXIT_FAILURE);
458 }
459 break;
460 }
461
462
463 /* Select video input, video standard and tune here. */
464
465
466 CLEAR(cropcap);
467
468 cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
469
470 if (0 == xioctl(fd, VIDIOC_CROPCAP, &cropcap)) {
471 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
472 crop.c = cropcap.defrect; /* reset to default */
473
474 if (-1 == xioctl(fd, VIDIOC_S_CROP, &crop)) {
475 switch (errno) {
476 case EINVAL:
477 /* Cropping not supported. */
478 break;
479 default:
480 /* Errors ignored. */
481 break;
482 }
483 }
484 } else {
485 /* Errors ignored. */
486 }
487
488
489 CLEAR(fmt);
490
491 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
492 if (force_format) {
493 fmt.fmt.pix.width = 640;
494 fmt.fmt.pix.height = 480;
495 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
496 fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
497
498 if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt))
499 errno_exit("VIDIOC_S_FMT");
500
501 /* Note VIDIOC_S_FMT may change width and height. */
502 } else {
503 /* Preserve original settings as set by v4l2-ctl for example */
504 if (-1 == xioctl(fd, VIDIOC_G_FMT, &fmt))
505 errno_exit("VIDIOC_G_FMT");
506 }
507
508 /* Buggy driver paranoia. */
509 min = fmt.fmt.pix.width * 2;
510 if (fmt.fmt.pix.bytesperline < min)
511 fmt.fmt.pix.bytesperline = min;
512 min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
513 if (fmt.fmt.pix.sizeimage < min)
514 fmt.fmt.pix.sizeimage = min;
515
516 switch (io) {
517 case IO_METHOD_READ:
518 init_read(fmt.fmt.pix.sizeimage);
519 break;
520
521 case IO_METHOD_MMAP:
522 init_mmap();
523 break;
524
525 case IO_METHOD_USERPTR:
526 init_userp(fmt.fmt.pix.sizeimage);
527 break;
528 }
529 }
530
531 static void close_device(void)
532 {
533 if (-1 == close(fd))
534 errno_exit("close");
535
536 fd = -1;
537 }
538
539 static void open_device(void)
540 {
541 struct stat st;
542
543 if (-1 == stat(dev_name, &st)) {
544 fprintf(stderr, "Cannot identify '%s': %d, %s\\n",
545 dev_name, errno, strerror(errno));
546 exit(EXIT_FAILURE);
547 }
548
549 if (!S_ISCHR(st.st_mode)) {
550 fprintf(stderr, "%s is no devicen", dev_name);
551 exit(EXIT_FAILURE);
552 }
553
554 fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
555
556 if (-1 == fd) {
557 fprintf(stderr, "Cannot open '%s': %d, %s\\n",
558 dev_name, errno, strerror(errno));
559 exit(EXIT_FAILURE);
560 }
561 }
562
563 static void usage(FILE *fp, int argc, char **argv)
564 {
565 fprintf(fp,
566 "Usage: %s [options]\\n\\n"
567 "Version 1.3\\n"
568 "Options:\\n"
569 "-d | --device name Video device name [%s]n"
570 "-h | --help Print this messagen"
571 "-m | --mmap Use memory mapped buffers [default]n"
572 "-r | --read Use read() callsn"
573 "-u | --userp Use application allocated buffersn"
574 "-o | --output Outputs stream to stdoutn"
575 "-f | --format Force format to 640x480 YUYVn"
576 "-c | --count Number of frames to grab [%i]n"
577 "",
578 argv[0], dev_name, frame_count);
579 }
580
581 static const char short_options[] = "d:hmruofc:";
582
583 static const struct option
584 long_options[] = {
585 { "device", required_argument, NULL, 'd' },
586 { "help", no_argument, NULL, 'h' },
587 { "mmap", no_argument, NULL, 'm' },
588 { "read", no_argument, NULL, 'r' },
589 { "userp", no_argument, NULL, 'u' },
590 { "output", no_argument, NULL, 'o' },
591 { "format", no_argument, NULL, 'f' },
592 { "count", required_argument, NULL, 'c' },
593 { 0, 0, 0, 0 }
594 };
595
596 int main(int argc, char **argv)
597 {
598 dev_name = "/dev/video0";
599
600 for (;;) {
601 int idx;
602 int c;
603
604 c = getopt_long(argc, argv,
605 short_options, long_options, &idx);
606
607 if (-1 == c)
608 break;
609
610 switch (c) {
611 case 0: /* getopt_long() flag */
612 break;
613
614 case 'd':
615 dev_name = optarg;
616 break;
617
618 case 'h':
619 usage(stdout, argc, argv);
620 exit(EXIT_SUCCESS);
621
622 case 'm':
623 io = IO_METHOD_MMAP;
624 break;
625
626 case 'r':
627 io = IO_METHOD_READ;
628 break;
629
630 case 'u':
631 io = IO_METHOD_USERPTR;
632 break;
633
634 case 'o':
635 out_buf++;
636 break;
637
638 case 'f':
639 force_format++;
640 break;
641
642 case 'c':
643 errno = 0;
644 frame_count = strtol(optarg, NULL, 0);
645 if (errno)
646 errno_exit(optarg);
647 break;
648
649 default:
650 usage(stderr, argc, argv);
651 exit(EXIT_FAILURE);
652 }
653 }
654
655 open_device();
656 init_device();
657 start_capturing();
658 mainloop();
659 stop_capturing();
660 uninit_device();
661 close_device();
662 fprintf(stderr, "\\n");
663 return 0;
664 }
diff --git a/Documentation/media/uapi/v4l/colorspaces.rst b/Documentation/media/uapi/v4l/colorspaces.rst
new file mode 100644
index 000000000000..322eb94c1d44
--- /dev/null
+++ b/Documentation/media/uapi/v4l/colorspaces.rst
@@ -0,0 +1,163 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _colorspaces:
4
5***********
6Colorspaces
7***********
8
9'Color' is a very complex concept and depends on physics, chemistry and
10biology. Just because you have three numbers that describe the 'red',
11'green' and 'blue' components of the color of a pixel does not mean that
12you can accurately display that color. A colorspace defines what it
13actually *means* to have an RGB value of e.g. (255, 0, 0). That is,
14which color should be reproduced on the screen in a perfectly calibrated
15environment.
16
17In order to do that we first need to have a good definition of color,
18i.e. some way to uniquely and unambiguously define a color so that
19someone else can reproduce it. Human color vision is trichromatic since
20the human eye has color receptors that are sensitive to three different
21wavelengths of light. Hence the need to use three numbers to describe
22color. Be glad you are not a mantis shrimp as those are sensitive to 12
23different wavelengths, so instead of RGB we would be using the
24ABCDEFGHIJKL colorspace...
25
26Color exists only in the eye and brain and is the result of how strongly
27color receptors are stimulated. This is based on the Spectral Power
28Distribution (SPD) which is a graph showing the intensity (radiant
29power) of the light at wavelengths covering the visible spectrum as it
30enters the eye. The science of colorimetry is about the relationship
31between the SPD and color as perceived by the human brain.
32
33Since the human eye has only three color receptors it is perfectly
34possible that different SPDs will result in the same stimulation of
35those receptors and are perceived as the same color, even though the SPD
36of the light is different.
37
38In the 1920s experiments were devised to determine the relationship
39between SPDs and the perceived color and that resulted in the CIE 1931
40standard that defines spectral weighting functions that model the
41perception of color. Specifically that standard defines functions that
42can take an SPD and calculate the stimulus for each color receptor.
43After some further mathematical transforms these stimuli are known as
44the *CIE XYZ tristimulus* values and these X, Y and Z values describe a
45color as perceived by a human unambiguously. These X, Y and Z values are
46all in the range [0…1].
47
48The Y value in the CIE XYZ colorspace corresponds to luminance. Often
49the CIE XYZ colorspace is transformed to the normalized CIE xyY
50colorspace:
51
52x = X / (X + Y + Z)
53
54y = Y / (X + Y + Z)
55
56The x and y values are the chromaticity coordinates and can be used to
57define a color without the luminance component Y. It is very confusing
58to have such similar names for these colorspaces. Just be aware that if
59colors are specified with lower case 'x' and 'y', then the CIE xyY
60colorspace is used. Upper case 'X' and 'Y' refer to the CIE XYZ
61colorspace. Also, y has nothing to do with luminance. Together x and y
62specify a color, and Y the luminance. That is really all you need to
63remember from a practical point of view. At the end of this section you
64will find reading resources that go into much more detail if you are
65interested.
66
67A monitor or TV will reproduce colors by emitting light at three
68different wavelengths, the combination of which will stimulate the color
69receptors in the eye and thus cause the perception of color.
70Historically these wavelengths were defined by the red, green and blue
71phosphors used in the displays. These *color primaries* are part of what
72defines a colorspace.
73
74Different display devices will have different primaries and some
75primaries are more suitable for some display technologies than others.
76This has resulted in a variety of colorspaces that are used for
77different display technologies or uses. To define a colorspace you need
78to define the three color primaries (these are typically defined as x, y
79chromaticity coordinates from the CIE xyY colorspace) but also the white
80reference: that is the color obtained when all three primaries are at
81maximum power. This determines the relative power or energy of the
82primaries. This is usually chosen to be close to daylight which has been
83defined as the CIE D65 Illuminant.
84
85To recapitulate: the CIE XYZ colorspace uniquely identifies colors.
86Other colorspaces are defined by three chromaticity coordinates defined
87in the CIE xyY colorspace. Based on those a 3x3 matrix can be
88constructed that transforms CIE XYZ colors to colors in the new
89colorspace.
90
91Both the CIE XYZ and the RGB colorspace that are derived from the
92specific chromaticity primaries are linear colorspaces. But neither the
93eye, nor display technology is linear. Doubling the values of all
94components in the linear colorspace will not be perceived as twice the
95intensity of the color. So each colorspace also defines a transfer
96function that takes a linear color component value and transforms it to
97the non-linear component value, which is a closer match to the
98non-linear performance of both the eye and displays. Linear component
99values are denoted RGB, non-linear are denoted as R'G'B'. In general
100colors used in graphics are all R'G'B', except in openGL which uses
101linear RGB. Special care should be taken when dealing with openGL to
102provide linear RGB colors or to use the built-in openGL support to apply
103the inverse transfer function.
104
105The final piece that defines a colorspace is a function that transforms
106non-linear R'G'B' to non-linear Y'CbCr. This function is determined by
107the so-called luma coefficients. There may be multiple possible Y'CbCr
108encodings allowed for the same colorspace. Many encodings of color
109prefer to use luma (Y') and chroma (CbCr) instead of R'G'B'. Since the
110human eye is more sensitive to differences in luminance than in color
111this encoding allows one to reduce the amount of color information
112compared to the luma data. Note that the luma (Y') is unrelated to the Y
113in the CIE XYZ colorspace. Also note that Y'CbCr is often called YCbCr
114or YUV even though these are strictly speaking wrong.
115
116Sometimes people confuse Y'CbCr as being a colorspace. This is not
117correct, it is just an encoding of an R'G'B' color into luma and chroma
118values. The underlying colorspace that is associated with the R'G'B'
119color is also associated with the Y'CbCr color.
120
121The final step is how the RGB, R'G'B' or Y'CbCr values are quantized.
122The CIE XYZ colorspace where X, Y and Z are in the range [0…1] describes
123all colors that humans can perceive, but the transform to another
124colorspace will produce colors that are outside the [0…1] range. Once
125clamped to the [0…1] range those colors can no longer be reproduced in
126that colorspace. This clamping is what reduces the extent or gamut of
127the colorspace. How the range of [0…1] is translated to integer values
128in the range of [0…255] (or higher, depending on the color depth) is
129called the quantization. This is *not* part of the colorspace
130definition. In practice RGB or R'G'B' values are full range, i.e. they
131use the full [0…255] range. Y'CbCr values on the other hand are limited
132range with Y' using [16…235] and Cb and Cr using [16…240].
133
134Unfortunately, in some cases limited range RGB is also used where the
135components use the range [16…235]. And full range Y'CbCr also exists
136using the [0…255] range.
137
138In order to correctly interpret a color you need to know the
139quantization range, whether it is R'G'B' or Y'CbCr, the used Y'CbCr
140encoding and the colorspace. From that information you can calculate the
141corresponding CIE XYZ color and map that again to whatever colorspace
142your display device uses.
143
144The colorspace definition itself consists of the three chromaticity
145primaries, the white reference chromaticity, a transfer function and the
146luma coefficients needed to transform R'G'B' to Y'CbCr. While some
147colorspace standards correctly define all four, quite often the
148colorspace standard only defines some, and you have to rely on other
149standards for the missing pieces. The fact that colorspaces are often a
150mix of different standards also led to very confusing naming conventions
151where the name of a standard was used to name a colorspace when in fact
152that standard was part of various other colorspaces as well.
153
154If you want to read more about colors and colorspaces, then the
155following resources are useful: :ref:`poynton` is a good practical
156book for video engineers, :ref:`colimg` has a much broader scope and
157describes many more aspects of color (physics, chemistry, biology,
158etc.). The
159`http://www.brucelindbloom.com <http://www.brucelindbloom.com>`__
160website is an excellent resource, especially with respect to the
161mathematics behind colorspace conversions. The wikipedia
162`CIE 1931 colorspace <http://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space>`__
163article is also very useful.
diff --git a/Documentation/media/uapi/v4l/common-defs.rst b/Documentation/media/uapi/v4l/common-defs.rst
new file mode 100644
index 000000000000..39058216b630
--- /dev/null
+++ b/Documentation/media/uapi/v4l/common-defs.rst
@@ -0,0 +1,13 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _common-defs:
4
5******************************************************
6Common definitions for V4L2 and V4L2 subdev interfaces
7******************************************************
8
9
10.. toctree::
11 :maxdepth: 1
12
13 selections-common
diff --git a/Documentation/media/uapi/v4l/common.rst b/Documentation/media/uapi/v4l/common.rst
new file mode 100644
index 000000000000..13f2ed3fc5a6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/common.rst
@@ -0,0 +1,46 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _common:
4
5###################
6Common API Elements
7###################
8Programming a V4L2 device consists of these steps:
9
10- Opening the device
11
12- Changing device properties, selecting a video and audio input, video
13 standard, picture brightness a. o.
14
15- Negotiating a data format
16
17- Negotiating an input/output method
18
19- The actual input/output loop
20
21- Closing the device
22
23In practice most steps are optional and can be executed out of order. It
24depends on the V4L2 device type, you can read about the details in
25:ref:`devices`. In this chapter we will discuss the basic concepts
26applicable to all devices.
27
28
29.. toctree::
30 :maxdepth: 1
31
32 open
33 querycap
34 app-pri
35 video
36 audio
37 tuner
38 standard
39 dv-timings
40 control
41 extended-controls
42 format
43 planar-apis
44 crop
45 selection-api
46 streaming-par
diff --git a/Documentation/media/uapi/v4l/compat.rst b/Documentation/media/uapi/v4l/compat.rst
new file mode 100644
index 000000000000..8b5e1cebd8f4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/compat.rst
@@ -0,0 +1,18 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _compat:
4
5*******
6Changes
7*******
8
9The following chapters document the evolution of the V4L2 API, errata or
10extensions. They are also intended to help application and driver
11writers to port or update their code.
12
13
14.. toctree::
15 :maxdepth: 1
16
17 diff-v4l
18 hist-v4l2
diff --git a/Documentation/media/uapi/v4l/control.rst b/Documentation/media/uapi/v4l/control.rst
new file mode 100644
index 000000000000..10ab53dd3163
--- /dev/null
+++ b/Documentation/media/uapi/v4l/control.rst
@@ -0,0 +1,538 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _control:
4
5*************
6User Controls
7*************
8
9Devices typically have a number of user-settable controls such as
10brightness, saturation and so on, which would be presented to the user
11on a graphical user interface. But, different devices will have
12different controls available, and furthermore, the range of possible
13values, and the default value will vary from device to device. The
14control ioctls provide the information and a mechanism to create a nice
15user interface for these controls that will work correctly with any
16device.
17
18All controls are accessed using an ID value. V4L2 defines several IDs
19for specific purposes. Drivers can also implement their own custom
20controls using ``V4L2_CID_PRIVATE_BASE`` [#f1]_ and higher values. The
21pre-defined control IDs have the prefix ``V4L2_CID_``, and are listed in
22:ref:`control-id`. The ID is used when querying the attributes of a
23control, and when getting or setting the current value.
24
25Generally applications should present controls to the user without
26assumptions about their purpose. Each control comes with a name string
27the user is supposed to understand. When the purpose is non-intuitive
28the driver writer should provide a user manual, a user interface plug-in
29or a driver specific panel application. Predefined IDs were introduced
30to change a few controls programmatically, for example to mute a device
31during a channel switch.
32
33Drivers may enumerate different controls after switching the current
34video input or output, tuner or modulator, or audio input or output.
35Different in the sense of other bounds, another default and current
36value, step size or other menu items. A control with a certain *custom*
37ID can also change name and type.
38
39If a control is not applicable to the current configuration of the
40device (for example, it doesn't apply to the current video input)
41drivers set the ``V4L2_CTRL_FLAG_INACTIVE`` flag.
42
43Control values are stored globally, they do not change when switching
44except to stay within the reported bounds. They also do not change e. g.
45when the device is opened or closed, when the tuner radio frequency is
46changed or generally never without application request.
47
48V4L2 specifies an event mechanism to notify applications when controls
49change value (see
50:ref:`VIDIOC_SUBSCRIBE_EVENT`, event
51``V4L2_EVENT_CTRL``), panel applications might want to make use of that
52in order to always reflect the correct control value.
53
54All controls use machine endianness.
55
56
57.. _control-id:
58
59Control IDs
60===========
61
62``V4L2_CID_BASE``
63 First predefined ID, equal to ``V4L2_CID_BRIGHTNESS``.
64
65``V4L2_CID_USER_BASE``
66 Synonym of ``V4L2_CID_BASE``.
67
68``V4L2_CID_BRIGHTNESS`` ``(integer)``
69 Picture brightness, or more precisely, the black level.
70
71``V4L2_CID_CONTRAST`` ``(integer)``
72 Picture contrast or luma gain.
73
74``V4L2_CID_SATURATION`` ``(integer)``
75 Picture color saturation or chroma gain.
76
77``V4L2_CID_HUE`` ``(integer)``
78 Hue or color balance.
79
80``V4L2_CID_AUDIO_VOLUME`` ``(integer)``
81 Overall audio volume. Note some drivers also provide an OSS or ALSA
82 mixer interface.
83
84``V4L2_CID_AUDIO_BALANCE`` ``(integer)``
85 Audio stereo balance. Minimum corresponds to all the way left,
86 maximum to right.
87
88``V4L2_CID_AUDIO_BASS`` ``(integer)``
89 Audio bass adjustment.
90
91``V4L2_CID_AUDIO_TREBLE`` ``(integer)``
92 Audio treble adjustment.
93
94``V4L2_CID_AUDIO_MUTE`` ``(boolean)``
95 Mute audio, i. e. set the volume to zero, however without affecting
96 ``V4L2_CID_AUDIO_VOLUME``. Like ALSA drivers, V4L2 drivers must mute
97 at load time to avoid excessive noise. Actually the entire device
98 should be reset to a low power consumption state.
99
100``V4L2_CID_AUDIO_LOUDNESS`` ``(boolean)``
101 Loudness mode (bass boost).
102
103``V4L2_CID_BLACK_LEVEL`` ``(integer)``
104 Another name for brightness (not a synonym of
105 ``V4L2_CID_BRIGHTNESS``). This control is deprecated and should not
106 be used in new drivers and applications.
107
108``V4L2_CID_AUTO_WHITE_BALANCE`` ``(boolean)``
109 Automatic white balance (cameras).
110
111``V4L2_CID_DO_WHITE_BALANCE`` ``(button)``
112 This is an action control. When set (the value is ignored), the
113 device will do a white balance and then hold the current setting.
114 Contrast this with the boolean ``V4L2_CID_AUTO_WHITE_BALANCE``,
115 which, when activated, keeps adjusting the white balance.
116
117``V4L2_CID_RED_BALANCE`` ``(integer)``
118 Red chroma balance.
119
120``V4L2_CID_BLUE_BALANCE`` ``(integer)``
121 Blue chroma balance.
122
123``V4L2_CID_GAMMA`` ``(integer)``
124 Gamma adjust.
125
126``V4L2_CID_WHITENESS`` ``(integer)``
127 Whiteness for grey-scale devices. This is a synonym for
128 ``V4L2_CID_GAMMA``. This control is deprecated and should not be
129 used in new drivers and applications.
130
131``V4L2_CID_EXPOSURE`` ``(integer)``
132 Exposure (cameras). [Unit?]
133
134``V4L2_CID_AUTOGAIN`` ``(boolean)``
135 Automatic gain/exposure control.
136
137``V4L2_CID_GAIN`` ``(integer)``
138 Gain control.
139
140``V4L2_CID_HFLIP`` ``(boolean)``
141 Mirror the picture horizontally.
142
143``V4L2_CID_VFLIP`` ``(boolean)``
144 Mirror the picture vertically.
145
146.. _v4l2-power-line-frequency:
147
148``V4L2_CID_POWER_LINE_FREQUENCY`` ``(enum)``
149 Enables a power line frequency filter to avoid flicker. Possible
150 values for ``enum v4l2_power_line_frequency`` are:
151 ``V4L2_CID_POWER_LINE_FREQUENCY_DISABLED`` (0),
152 ``V4L2_CID_POWER_LINE_FREQUENCY_50HZ`` (1),
153 ``V4L2_CID_POWER_LINE_FREQUENCY_60HZ`` (2) and
154 ``V4L2_CID_POWER_LINE_FREQUENCY_AUTO`` (3).
155
156``V4L2_CID_HUE_AUTO`` ``(boolean)``
157 Enables automatic hue control by the device. The effect of setting
158 ``V4L2_CID_HUE`` while automatic hue control is enabled is
159 undefined, drivers should ignore such request.
160
161``V4L2_CID_WHITE_BALANCE_TEMPERATURE`` ``(integer)``
162 This control specifies the white balance settings as a color
163 temperature in Kelvin. A driver should have a minimum of 2800
164 (incandescent) to 6500 (daylight). For more information about color
165 temperature see
166 `Wikipedia <http://en.wikipedia.org/wiki/Color_temperature>`__.
167
168``V4L2_CID_SHARPNESS`` ``(integer)``
169 Adjusts the sharpness filters in a camera. The minimum value
170 disables the filters, higher values give a sharper picture.
171
172``V4L2_CID_BACKLIGHT_COMPENSATION`` ``(integer)``
173 Adjusts the backlight compensation in a camera. The minimum value
174 disables backlight compensation.
175
176``V4L2_CID_CHROMA_AGC`` ``(boolean)``
177 Chroma automatic gain control.
178
179``V4L2_CID_CHROMA_GAIN`` ``(integer)``
180 Adjusts the Chroma gain control (for use when chroma AGC is
181 disabled).
182
183``V4L2_CID_COLOR_KILLER`` ``(boolean)``
184 Enable the color killer (i. e. force a black & white image in case
185 of a weak video signal).
186
187.. _v4l2-colorfx:
188
189``V4L2_CID_COLORFX`` ``(enum)``
190 Selects a color effect. The following values are defined:
191
192
193
194.. flat-table::
195 :header-rows: 0
196 :stub-columns: 0
197
198
199 - .. row 1
200
201 - ``V4L2_COLORFX_NONE``
202
203 - Color effect is disabled.
204
205 - .. row 2
206
207 - ``V4L2_COLORFX_ANTIQUE``
208
209 - An aging (old photo) effect.
210
211 - .. row 3
212
213 - ``V4L2_COLORFX_ART_FREEZE``
214
215 - Frost color effect.
216
217 - .. row 4
218
219 - ``V4L2_COLORFX_AQUA``
220
221 - Water color, cool tone.
222
223 - .. row 5
224
225 - ``V4L2_COLORFX_BW``
226
227 - Black and white.
228
229 - .. row 6
230
231 - ``V4L2_COLORFX_EMBOSS``
232
233 - Emboss, the highlights and shadows replace light/dark boundaries
234 and low contrast areas are set to a gray background.
235
236 - .. row 7
237
238 - ``V4L2_COLORFX_GRASS_GREEN``
239
240 - Grass green.
241
242 - .. row 8
243
244 - ``V4L2_COLORFX_NEGATIVE``
245
246 - Negative.
247
248 - .. row 9
249
250 - ``V4L2_COLORFX_SEPIA``
251
252 - Sepia tone.
253
254 - .. row 10
255
256 - ``V4L2_COLORFX_SKETCH``
257
258 - Sketch.
259
260 - .. row 11
261
262 - ``V4L2_COLORFX_SKIN_WHITEN``
263
264 - Skin whiten.
265
266 - .. row 12
267
268 - ``V4L2_COLORFX_SKY_BLUE``
269
270 - Sky blue.
271
272 - .. row 13
273
274 - ``V4L2_COLORFX_SOLARIZATION``
275
276 - Solarization, the image is partially reversed in tone, only color
277 values above or below a certain threshold are inverted.
278
279 - .. row 14
280
281 - ``V4L2_COLORFX_SILHOUETTE``
282
283 - Silhouette (outline).
284
285 - .. row 15
286
287 - ``V4L2_COLORFX_VIVID``
288
289 - Vivid colors.
290
291 - .. row 16
292
293 - ``V4L2_COLORFX_SET_CBCR``
294
295 - The Cb and Cr chroma components are replaced by fixed coefficients
296 determined by ``V4L2_CID_COLORFX_CBCR`` control.
297
298
299
300``V4L2_CID_COLORFX_CBCR`` ``(integer)``
301 Determines the Cb and Cr coefficients for ``V4L2_COLORFX_SET_CBCR``
302 color effect. Bits [7:0] of the supplied 32 bit value are
303 interpreted as Cr component, bits [15:8] as Cb component and bits
304 [31:16] must be zero.
305
306``V4L2_CID_AUTOBRIGHTNESS`` ``(boolean)``
307 Enable Automatic Brightness.
308
309``V4L2_CID_ROTATE`` ``(integer)``
310 Rotates the image by specified angle. Common angles are 90, 270 and
311 180. Rotating the image to 90 and 270 will reverse the height and
312 width of the display window. It is necessary to set the new height
313 and width of the picture using the
314 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl according to the
315 rotation angle selected.
316
317``V4L2_CID_BG_COLOR`` ``(integer)``
318 Sets the background color on the current output device. Background
319 color needs to be specified in the RGB24 format. The supplied 32 bit
320 value is interpreted as bits 0-7 Red color information, bits 8-15
321 Green color information, bits 16-23 Blue color information and bits
322 24-31 must be zero.
323
324``V4L2_CID_ILLUMINATORS_1 V4L2_CID_ILLUMINATORS_2`` ``(boolean)``
325 Switch on or off the illuminator 1 or 2 of the device (usually a
326 microscope).
327
328``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE`` ``(integer)``
329 This is a read-only control that can be read by the application and
330 used as a hint to determine the number of CAPTURE buffers to pass to
331 REQBUFS. The value is the minimum number of CAPTURE buffers that is
332 necessary for hardware to work.
333
334``V4L2_CID_MIN_BUFFERS_FOR_OUTPUT`` ``(integer)``
335 This is a read-only control that can be read by the application and
336 used as a hint to determine the number of OUTPUT buffers to pass to
337 REQBUFS. The value is the minimum number of OUTPUT buffers that is
338 necessary for hardware to work.
339
340.. _v4l2-alpha-component:
341
342``V4L2_CID_ALPHA_COMPONENT`` ``(integer)``
343 Sets the alpha color component. When a capture device (or capture
344 queue of a mem-to-mem device) produces a frame format that includes
345 an alpha component (e.g.
346 :ref:`packed RGB image formats <rgb-formats>`) and the alpha value
347 is not defined by the device or the mem-to-mem input data this
348 control lets you select the alpha component value of all pixels.
349 When an output device (or output queue of a mem-to-mem device)
350 consumes a frame format that doesn't include an alpha component and
351 the device supports alpha channel processing this control lets you
352 set the alpha component value of all pixels for further processing
353 in the device.
354
355``V4L2_CID_LASTP1``
356 End of the predefined control IDs (currently
357 ``V4L2_CID_ALPHA_COMPONENT`` + 1).
358
359``V4L2_CID_PRIVATE_BASE``
360 ID of the first custom (driver specific) control. Applications
361 depending on particular custom controls should check the driver name
362 and version, see :ref:`querycap`.
363
364Applications can enumerate the available controls with the
365:ref:`VIDIOC_QUERYCTRL` and
366:ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>` ioctls, get and set a
367control value with the :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
368:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls. Drivers must implement
369``VIDIOC_QUERYCTRL``, ``VIDIOC_G_CTRL`` and ``VIDIOC_S_CTRL`` when the
370device has one or more controls, ``VIDIOC_QUERYMENU`` when it has one or
371more menu type controls.
372
373
374.. _enum_all_controls:
375
376Example: Enumerating all user controls
377======================================
378
379.. code-block:: c
380
381
382 struct v4l2_queryctrl queryctrl;
383 struct v4l2_querymenu querymenu;
384
385 static void enumerate_menu(void)
386 {
387 printf(" Menu items:\\n");
388
389 memset(&querymenu, 0, sizeof(querymenu));
390 querymenu.id = queryctrl.id;
391
392 for (querymenu.index = queryctrl.minimum;
393 querymenu.index <= queryctrl.maximum;
394 querymenu.index++) {
395 if (0 == ioctl(fd, VIDIOC_QUERYMENU, &querymenu)) {
396 printf(" %s\\n", querymenu.name);
397 }
398 }
399 }
400
401 memset(&queryctrl, 0, sizeof(queryctrl));
402
403 for (queryctrl.id = V4L2_CID_BASE;
404 queryctrl.id < V4L2_CID_LASTP1;
405 queryctrl.id++) {
406 if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl)) {
407 if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
408 continue;
409
410 printf("Control %s\\n", queryctrl.name);
411
412 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
413 enumerate_menu();
414 } else {
415 if (errno == EINVAL)
416 continue;
417
418 perror("VIDIOC_QUERYCTRL");
419 exit(EXIT_FAILURE);
420 }
421 }
422
423 for (queryctrl.id = V4L2_CID_PRIVATE_BASE;;
424 queryctrl.id++) {
425 if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl)) {
426 if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
427 continue;
428
429 printf("Control %s\\n", queryctrl.name);
430
431 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
432 enumerate_menu();
433 } else {
434 if (errno == EINVAL)
435 break;
436
437 perror("VIDIOC_QUERYCTRL");
438 exit(EXIT_FAILURE);
439 }
440 }
441
442
443Example: Enumerating all user controls (alternative)
444====================================================
445
446.. code-block:: c
447
448 memset(&queryctrl, 0, sizeof(queryctrl));
449
450 queryctrl.id = V4L2_CTRL_CLASS_USER | V4L2_CTRL_FLAG_NEXT_CTRL;
451 while (0 == ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl)) {
452 if (V4L2_CTRL_ID2CLASS(queryctrl.id) != V4L2_CTRL_CLASS_USER)
453 break;
454 if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
455 continue;
456
457 printf("Control %s\\n", queryctrl.name);
458
459 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
460 enumerate_menu();
461
462 queryctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
463 }
464 if (errno != EINVAL) {
465 perror("VIDIOC_QUERYCTRL");
466 exit(EXIT_FAILURE);
467 }
468
469Example: Changing controls
470==========================
471
472.. code-block:: c
473
474 struct v4l2_queryctrl queryctrl;
475 struct v4l2_control control;
476
477 memset(&queryctrl, 0, sizeof(queryctrl));
478 queryctrl.id = V4L2_CID_BRIGHTNESS;
479
480 if (-1 == ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl)) {
481 if (errno != EINVAL) {
482 perror("VIDIOC_QUERYCTRL");
483 exit(EXIT_FAILURE);
484 } else {
485 printf("V4L2_CID_BRIGHTNESS is not supportedn");
486 }
487 } else if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
488 printf("V4L2_CID_BRIGHTNESS is not supportedn");
489 } else {
490 memset(&control, 0, sizeof (control));
491 control.id = V4L2_CID_BRIGHTNESS;
492 control.value = queryctrl.default_value;
493
494 if (-1 == ioctl(fd, VIDIOC_S_CTRL, &control)) {
495 perror("VIDIOC_S_CTRL");
496 exit(EXIT_FAILURE);
497 }
498 }
499
500 memset(&control, 0, sizeof(control));
501 control.id = V4L2_CID_CONTRAST;
502
503 if (0 == ioctl(fd, VIDIOC_G_CTRL, &control)) {
504 control.value += 1;
505
506 /* The driver may clamp the value or return ERANGE, ignored here */
507
508 if (-1 == ioctl(fd, VIDIOC_S_CTRL, &control)
509 && errno != ERANGE) {
510 perror("VIDIOC_S_CTRL");
511 exit(EXIT_FAILURE);
512 }
513 /* Ignore if V4L2_CID_CONTRAST is unsupported */
514 } else if (errno != EINVAL) {
515 perror("VIDIOC_G_CTRL");
516 exit(EXIT_FAILURE);
517 }
518
519 control.id = V4L2_CID_AUDIO_MUTE;
520 control.value = 1; /* silence */
521
522 /* Errors ignored */
523 ioctl(fd, VIDIOC_S_CTRL, &control);
524
525.. [#f1]
526 The use of ``V4L2_CID_PRIVATE_BASE`` is problematic because different
527 drivers may use the same ``V4L2_CID_PRIVATE_BASE`` ID for different
528 controls. This makes it hard to programatically set such controls
529 since the meaning of the control with that ID is driver dependent. In
530 order to resolve this drivers use unique IDs and the
531 ``V4L2_CID_PRIVATE_BASE`` IDs are mapped to those unique IDs by the
532 kernel. Consider these ``V4L2_CID_PRIVATE_BASE`` IDs as aliases to
533 the real IDs.
534
535 Many applications today still use the ``V4L2_CID_PRIVATE_BASE`` IDs
536 instead of using :ref:`VIDIOC_QUERYCTRL` with
537 the ``V4L2_CTRL_FLAG_NEXT_CTRL`` flag to enumerate all IDs, so
538 support for ``V4L2_CID_PRIVATE_BASE`` is still around.
diff --git a/Documentation/media/uapi/v4l/crop.rst b/Documentation/media/uapi/v4l/crop.rst
new file mode 100644
index 000000000000..0913822347af
--- /dev/null
+++ b/Documentation/media/uapi/v4l/crop.rst
@@ -0,0 +1,303 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _crop:
4
5*************************************
6Image Cropping, Insertion and Scaling
7*************************************
8
9Some video capture devices can sample a subsection of the picture and
10shrink or enlarge it to an image of arbitrary size. We call these
11abilities cropping and scaling. Some video output devices can scale an
12image up or down and insert it at an arbitrary scan line and horizontal
13offset into a video signal.
14
15Applications can use the following API to select an area in the video
16signal, query the default area and the hardware limits.
17
18.. note:: Despite their name, the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>`,
19 :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP
20 <VIDIOC_G_CROP>` ioctls apply to input as well as output devices.
21
22Scaling requires a source and a target. On a video capture or overlay
23device the source is the video signal, and the cropping ioctls determine
24the area actually sampled. The target are images read by the application
25or overlaid onto the graphics screen. Their size (and position for an
26overlay) is negotiated with the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
27and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls.
28
29On a video output device the source are the images passed in by the
30application, and their size is again negotiated with the
31:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
32ioctls, or may be encoded in a compressed video stream. The target is
33the video signal, and the cropping ioctls determine the area where the
34images are inserted.
35
36Source and target rectangles are defined even if the device does not
37support scaling or the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and
38:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctls. Their size (and position
39where applicable) will be fixed in this case.
40
41.. note:: All capture and output devices must support the
42 :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl such that applications
43 can determine if scaling takes place.
44
45
46Cropping Structures
47===================
48
49
50.. _crop-scale:
51
52.. figure:: crop_files/crop.*
53 :alt: crop.pdf / crop.gif
54 :align: center
55
56 Image Cropping, Insertion and Scaling
57
58 The cropping, insertion and scaling process
59
60
61
62For capture devices the coordinates of the top left corner, width and
63height of the area which can be sampled is given by the ``bounds``
64substructure of the struct :ref:`v4l2_cropcap <v4l2-cropcap>` returned
65by the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl. To support a wide
66range of hardware this specification does not define an origin or units.
67However by convention drivers should horizontally count unscaled samples
68relative to 0H (the leading edge of the horizontal sync pulse, see
69:ref:`vbi-hsync`). Vertically ITU-R line numbers of the first field
70(see ITU R-525 line numbering for :ref:`525 lines <vbi-525>` and for
71:ref:`625 lines <vbi-625>`), multiplied by two if the driver
72can capture both fields.
73
74The top left corner, width and height of the source rectangle, that is
75the area actually sampled, is given by struct
76:ref:`v4l2_crop <v4l2-crop>` using the same coordinate system as
77struct :ref:`v4l2_cropcap <v4l2-cropcap>`. Applications can use the
78:ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>`
79ioctls to get and set this rectangle. It must lie completely within the
80capture boundaries and the driver may further adjust the requested size
81and/or position according to hardware limitations.
82
83Each capture device has a default source rectangle, given by the
84``defrect`` substructure of struct
85:ref:`v4l2_cropcap <v4l2-cropcap>`. The center of this rectangle
86shall align with the center of the active picture area of the video
87signal, and cover what the driver writer considers the complete picture.
88Drivers shall reset the source rectangle to the default when the driver
89is first loaded, but not later.
90
91For output devices these structures and ioctls are used accordingly,
92defining the *target* rectangle where the images will be inserted into
93the video signal.
94
95
96Scaling Adjustments
97===================
98
99Video hardware can have various cropping, insertion and scaling
100limitations. It may only scale up or down, support only discrete scaling
101factors, or have different scaling abilities in horizontal and vertical
102direction. Also it may not support scaling at all. At the same time the
103struct :ref:`v4l2_crop <v4l2-crop>` rectangle may have to be aligned,
104and both the source and target rectangles may have arbitrary upper and
105lower size limits. In particular the maximum ``width`` and ``height`` in
106struct :ref:`v4l2_crop <v4l2-crop>` may be smaller than the struct
107:ref:`v4l2_cropcap <v4l2-cropcap>`. ``bounds`` area. Therefore, as
108usual, drivers are expected to adjust the requested parameters and
109return the actual values selected.
110
111Applications can change the source or the target rectangle first, as
112they may prefer a particular image size or a certain area in the video
113signal. If the driver has to adjust both to satisfy hardware
114limitations, the last requested rectangle shall take priority, and the
115driver should preferably adjust the opposite one. The
116:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl however shall not change
117the driver state and therefore only adjust the requested rectangle.
118
119Suppose scaling on a video capture device is restricted to a factor 1:1
120or 2:1 in either direction and the target image size must be a multiple
121of 16 × 16 pixels. The source cropping rectangle is set to defaults,
122which are also the upper limit in this example, of 640 × 400 pixels at
123offset 0, 0. An application requests an image size of 300 × 225 pixels,
124assuming video will be scaled down from the "full picture" accordingly.
125The driver sets the image size to the closest possible values 304 × 224,
126then chooses the cropping rectangle closest to the requested size, that
127is 608 × 224 (224 × 2:1 would exceed the limit 400). The offset 0, 0 is
128still valid, thus unmodified. Given the default cropping rectangle
129reported by :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` the application can
130easily propose another offset to center the cropping rectangle.
131
132Now the application may insist on covering an area using a picture
133aspect ratio closer to the original request, so it asks for a cropping
134rectangle of 608 × 456 pixels. The present scaling factors limit
135cropping to 640 × 384, so the driver returns the cropping size 608 × 384
136and adjusts the image size to closest possible 304 × 192.
137
138
139Examples
140========
141
142Source and target rectangles shall remain unchanged across closing and
143reopening a device, such that piping data into or out of a device will
144work without special preparations. More advanced applications should
145ensure the parameters are suitable before starting I/O.
146
147.. note:: On the next two examples, a video capture device is assumed;
148 change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
149
150Example: Resetting the cropping parameters
151==========================================
152
153.. code-block:: c
154
155 struct v4l2_cropcap cropcap;
156 struct v4l2_crop crop;
157
158 memset (&cropcap, 0, sizeof (cropcap));
159 cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
160
161 if (-1 == ioctl (fd, VIDIOC_CROPCAP, &cropcap)) {
162 perror ("VIDIOC_CROPCAP");
163 exit (EXIT_FAILURE);
164 }
165
166 memset (&crop, 0, sizeof (crop));
167 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
168 crop.c = cropcap.defrect;
169
170 /* Ignore if cropping is not supported (EINVAL). */
171
172 if (-1 == ioctl (fd, VIDIOC_S_CROP, &crop)
173 && errno != EINVAL) {
174 perror ("VIDIOC_S_CROP");
175 exit (EXIT_FAILURE);
176 }
177
178
179Example: Simple downscaling
180===========================
181
182.. code-block:: c
183
184 struct v4l2_cropcap cropcap;
185 struct v4l2_format format;
186
187 reset_cropping_parameters ();
188
189 /* Scale down to 1/4 size of full picture. */
190
191 memset (&format, 0, sizeof (format)); /* defaults */
192
193 format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
194
195 format.fmt.pix.width = cropcap.defrect.width >> 1;
196 format.fmt.pix.height = cropcap.defrect.height >> 1;
197 format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
198
199 if (-1 == ioctl (fd, VIDIOC_S_FMT, &format)) {
200 perror ("VIDIOC_S_FORMAT");
201 exit (EXIT_FAILURE);
202 }
203
204 /* We could check the actual image size now, the actual scaling factor
205 or if the driver can scale at all. */
206
207Example: Selecting an output area
208=================================
209
210.. note:: This example assumes an output device.
211
212.. code-block:: c
213
214 struct v4l2_cropcap cropcap;
215 struct v4l2_crop crop;
216
217 memset (&cropcap, 0, sizeof (cropcap));
218 cropcap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
219
220 if (-1 == ioctl (fd, VIDIOC_CROPCAP;, &cropcap)) {
221 perror ("VIDIOC_CROPCAP");
222 exit (EXIT_FAILURE);
223 }
224
225 memset (&crop, 0, sizeof (crop));
226
227 crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
228 crop.c = cropcap.defrect;
229
230 /* Scale the width and height to 50 % of their original size
231 and center the output. */
232
233 crop.c.width /= 2;
234 crop.c.height /= 2;
235 crop.c.left += crop.c.width / 2;
236 crop.c.top += crop.c.height / 2;
237
238 /* Ignore if cropping is not supported (EINVAL). */
239
240 if (-1 == ioctl (fd, VIDIOC_S_CROP, &crop)
241 && errno != EINVAL) {
242 perror ("VIDIOC_S_CROP");
243 exit (EXIT_FAILURE);
244 }
245
246Example: Current scaling factor and pixel aspect
247================================================
248
249.. note:: This example assumes a video capture device.
250
251.. code-block:: c
252
253 struct v4l2_cropcap cropcap;
254 struct v4l2_crop crop;
255 struct v4l2_format format;
256 double hscale, vscale;
257 double aspect;
258 int dwidth, dheight;
259
260 memset (&cropcap, 0, sizeof (cropcap));
261 cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
262
263 if (-1 == ioctl (fd, VIDIOC_CROPCAP, &cropcap)) {
264 perror ("VIDIOC_CROPCAP");
265 exit (EXIT_FAILURE);
266 }
267
268 memset (&crop, 0, sizeof (crop));
269 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
270
271 if (-1 == ioctl (fd, VIDIOC_G_CROP, &crop)) {
272 if (errno != EINVAL) {
273 perror ("VIDIOC_G_CROP");
274 exit (EXIT_FAILURE);
275 }
276
277 /* Cropping not supported. */
278 crop.c = cropcap.defrect;
279 }
280
281 memset (&format, 0, sizeof (format));
282 format.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
283
284 if (-1 == ioctl (fd, VIDIOC_G_FMT, &format)) {
285 perror ("VIDIOC_G_FMT");
286 exit (EXIT_FAILURE);
287 }
288
289 /* The scaling applied by the driver. */
290
291 hscale = format.fmt.pix.width / (double) crop.c.width;
292 vscale = format.fmt.pix.height / (double) crop.c.height;
293
294 aspect = cropcap.pixelaspect.numerator /
295 (double) cropcap.pixelaspect.denominator;
296 aspect = aspect * hscale / vscale;
297
298 /* Devices following ITU-R BT.601 do not capture
299 square pixels. For playback on a computer monitor
300 we should scale the images to this size. */
301
302 dwidth = format.fmt.pix.width / aspect;
303 dheight = format.fmt.pix.height;
diff --git a/Documentation/media/uapi/v4l/crop_files/crop.gif b/Documentation/media/uapi/v4l/crop_files/crop.gif
new file mode 100644
index 000000000000..3b9e7d836d4b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/crop_files/crop.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/crop_files/crop.pdf b/Documentation/media/uapi/v4l/crop_files/crop.pdf
new file mode 100644
index 000000000000..c9fb81cd32f3
--- /dev/null
+++ b/Documentation/media/uapi/v4l/crop_files/crop.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/depth-formats.rst b/Documentation/media/uapi/v4l/depth-formats.rst
new file mode 100644
index 000000000000..82f183870aae
--- /dev/null
+++ b/Documentation/media/uapi/v4l/depth-formats.rst
@@ -0,0 +1,15 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _depth-formats:
4
5*************
6Depth Formats
7*************
8
9Depth data provides distance to points, mapped onto the image plane
10
11
12.. toctree::
13 :maxdepth: 1
14
15 pixfmt-z16
diff --git a/Documentation/media/uapi/v4l/dev-capture.rst b/Documentation/media/uapi/v4l/dev-capture.rst
new file mode 100644
index 000000000000..8d049471e1c2
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-capture.rst
@@ -0,0 +1,104 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _capture:
4
5***********************
6Video Capture Interface
7***********************
8
9Video capture devices sample an analog video signal and store the
10digitized images in memory. Today nearly all devices can capture at full
1125 or 30 frames/second. With this interface applications can control the
12capture process and move images from the driver into user space.
13
14Conventionally V4L2 video capture devices are accessed through character
15device special files named ``/dev/video`` and ``/dev/video0`` to
16``/dev/video63`` with major number 81 and minor numbers 0 to 63.
17``/dev/video`` is typically a symbolic link to the preferred video
18device.
19
20.. note:: The same device file names are used for video output devices.
21
22
23Querying Capabilities
24=====================
25
26Devices supporting the video capture interface set the
27``V4L2_CAP_VIDEO_CAPTURE`` or ``V4L2_CAP_VIDEO_CAPTURE_MPLANE`` flag in
28the ``capabilities`` field of struct
29:ref:`v4l2_capability <v4l2-capability>` returned by the
30:ref:`VIDIOC_QUERYCAP` ioctl. As secondary device
31functions they may also support the :ref:`video overlay <overlay>`
32(``V4L2_CAP_VIDEO_OVERLAY``) and the :ref:`raw VBI capture <raw-vbi>`
33(``V4L2_CAP_VBI_CAPTURE``) interface. At least one of the read/write or
34streaming I/O methods must be supported. Tuners and audio inputs are
35optional.
36
37
38Supplemental Functions
39======================
40
41Video capture devices shall support :ref:`audio input <audio>`,
42:ref:`tuner`, :ref:`controls <control>`,
43:ref:`cropping and scaling <crop>` and
44:ref:`streaming parameter <streaming-par>` ioctls as needed. The
45:ref:`video input <video>` and :ref:`video standard <standard>`
46ioctls must be supported by all video capture devices.
47
48
49Image Format Negotiation
50========================
51
52The result of a capture operation is determined by cropping and image
53format parameters. The former select an area of the video picture to
54capture, the latter how images are stored in memory, i. e. in RGB or YUV
55format, the number of bits per pixel or width and height. Together they
56also define how images are scaled in the process.
57
58As usual these parameters are *not* reset at :ref:`open() <func-open>`
59time to permit Unix tool chains, programming a device and then reading
60from it as if it was a plain file. Well written V4L2 applications ensure
61they really get what they want, including cropping and scaling.
62
63Cropping initialization at minimum requires to reset the parameters to
64defaults. An example is given in :ref:`crop`.
65
66To query the current image format applications set the ``type`` field of
67a struct :ref:`v4l2_format <v4l2-format>` to
68``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or
69``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and call the
70:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer to this
71structure. Drivers fill the struct
72:ref:`v4l2_pix_format <v4l2-pix-format>` ``pix`` or the struct
73:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` ``pix_mp``
74member of the ``fmt`` union.
75
76To request different parameters applications set the ``type`` field of a
77struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
78fields of the struct :ref:`v4l2_pix_format <v4l2-pix-format>`
79``vbi`` member of the ``fmt`` union, or better just modify the results
80of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
81ioctl with a pointer to this structure. Drivers may adjust the
82parameters and finally return the actual parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
83does.
84
85Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl
86can be used to learn about hardware limitations without disabling I/O or
87possibly time consuming hardware preparations.
88
89The contents of struct :ref:`v4l2_pix_format <v4l2-pix-format>` and
90struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` are
91discussed in :ref:`pixfmt`. See also the specification of the
92:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctls for
93details. Video capture devices must implement both the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
94and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, even if :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ignores all
95requests and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does.
96:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` is optional.
97
98
99Reading Images
100==============
101
102A video capture device may support the ::ref:`read() function <func-read>`
103and/or streaming (:ref:`memory mapping <func-mmap>` or
104:ref:`user pointer <userp>`) I/O. See :ref:`io` for details.
diff --git a/Documentation/media/uapi/v4l/dev-codec.rst b/Documentation/media/uapi/v4l/dev-codec.rst
new file mode 100644
index 000000000000..dfb20328e34d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-codec.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _codec:
4
5***************
6Codec Interface
7***************
8
9A V4L2 codec can compress, decompress, transform, or otherwise convert
10video data from one format into another format, in memory. Typically
11such devices are memory-to-memory devices (i.e. devices with the
12``V4L2_CAP_VIDEO_M2M`` or ``V4L2_CAP_VIDEO_M2M_MPLANE`` capability set).
13
14A memory-to-memory video node acts just like a normal video node, but it
15supports both output (sending frames from memory to the codec hardware)
16and capture (receiving the processed frames from the codec hardware into
17memory) stream I/O. An application will have to setup the stream I/O for
18both sides and finally call :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
19for both capture and output to start the codec.
20
21Video compression codecs use the MPEG controls to setup their codec
22parameters
23
24.. note:: The MPEG controls actually support many more codecs than
25 just MPEG. See :ref:`mpeg-controls`.
26
27Memory-to-memory devices can often be used as a shared resource: you can
28open the video node multiple times, each application setting up their
29own codec properties that are local to the file handle, and each can use
30it independently from the others. The driver will arbitrate access to
31the codec and reprogram it whenever another file handler gets access.
32This is different from the usual video node behavior where the video
33properties are global to the device (i.e. changing something through one
34file handle is visible through another file handle).
diff --git a/Documentation/media/uapi/v4l/dev-effect.rst b/Documentation/media/uapi/v4l/dev-effect.rst
new file mode 100644
index 000000000000..b946cc9e1064
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-effect.rst
@@ -0,0 +1,21 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _effect:
4
5************************
6Effect Devices Interface
7************************
8
9.. note::
10 This interface has been be suspended from the V4L2 API.
11 The implementation for such effects should be done
12 via mem2mem devices.
13
14A V4L2 video effect device can do image effects, filtering, or combine
15two or more images or image streams. For example video transitions or
16wipes. Applications send data to be processed and receive the result
17data either with :ref:`read() <func-read>` and
18:ref:`write() <func-write>` functions, or through the streaming I/O
19mechanism.
20
21[to do]
diff --git a/Documentation/media/uapi/v4l/dev-event.rst b/Documentation/media/uapi/v4l/dev-event.rst
new file mode 100644
index 000000000000..a06ec4d65359
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-event.rst
@@ -0,0 +1,47 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _event:
4
5***************
6Event Interface
7***************
8
9The V4L2 event interface provides a means for a user to get immediately
10notified on certain conditions taking place on a device. This might
11include start of frame or loss of signal events, for example. Changes in
12the value or state of a V4L2 control can also be reported through
13events.
14
15To receive events, the events the user is interested in first must be
16subscribed using the
17:ref:`VIDIOC_SUBSCRIBE_EVENT` ioctl. Once
18an event is subscribed, the events of subscribed types are dequeueable
19using the :ref:`VIDIOC_DQEVENT` ioctl. Events may be
20unsubscribed using VIDIOC_UNSUBSCRIBE_EVENT ioctl. The special event
21type V4L2_EVENT_ALL may be used to unsubscribe all the events the
22driver supports.
23
24The event subscriptions and event queues are specific to file handles.
25Subscribing an event on one file handle does not affect other file
26handles.
27
28The information on dequeueable events is obtained by using select or
29poll system calls on video devices. The V4L2 events use POLLPRI events
30on poll system call and exceptions on select system call.
31
32Starting with kernel 3.1 certain guarantees can be given with regards to
33events:
34
351. Each subscribed event has its own internal dedicated event queue.
36 This means that flooding of one event type will not interfere with
37 other event types.
38
392. If the internal event queue for a particular subscribed event becomes
40 full, then the oldest event in that queue will be dropped.
41
423. Where applicable, certain event types can ensure that the payload of
43 the oldest event that is about to be dropped will be merged with the
44 payload of the next oldest event. Thus ensuring that no information
45 is lost, but only an intermediate step leading up to that
46 information. See the documentation for the event you want to
47 subscribe to whether this is applicable for that event or not.
diff --git a/Documentation/media/uapi/v4l/dev-osd.rst b/Documentation/media/uapi/v4l/dev-osd.rst
new file mode 100644
index 000000000000..fadda131f020
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-osd.rst
@@ -0,0 +1,148 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _osd:
4
5******************************
6Video Output Overlay Interface
7******************************
8
9**Also known as On-Screen Display (OSD)**
10
11Some video output devices can overlay a framebuffer image onto the
12outgoing video signal. Applications can set up such an overlay using
13this interface, which borrows structures and ioctls of the
14:ref:`Video Overlay <overlay>` interface.
15
16The OSD function is accessible through the same character special file
17as the :ref:`Video Output <capture>` function.
18
19.. note:: The default function of such a ``/dev/video`` device is video
20 capturing or output. The OSD function is only available after calling
21 the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
22
23
24Querying Capabilities
25=====================
26
27Devices supporting the *Video Output Overlay* interface set the
28``V4L2_CAP_VIDEO_OUTPUT_OVERLAY`` flag in the ``capabilities`` field of
29struct :ref:`v4l2_capability <v4l2-capability>` returned by the
30:ref:`VIDIOC_QUERYCAP` ioctl.
31
32
33Framebuffer
34===========
35
36Contrary to the *Video Overlay* interface the framebuffer is normally
37implemented on the TV card and not the graphics card. On Linux it is
38accessible as a framebuffer device (``/dev/fbN``). Given a V4L2 device,
39applications can find the corresponding framebuffer device by calling
40the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` ioctl. It returns, amongst
41other information, the physical address of the framebuffer in the
42``base`` field of struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`.
43The framebuffer device ioctl ``FBIOGET_FSCREENINFO`` returns the same
44address in the ``smem_start`` field of struct
45:c:type:`struct fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
46ioctl and struct :c:type:`struct fb_fix_screeninfo` are defined in
47the ``linux/fb.h`` header file.
48
49The width and height of the framebuffer depends on the current video
50standard. A V4L2 driver may reject attempts to change the video standard
51(or any other ioctl which would imply a framebuffer size change) with an
52``EBUSY`` error code until all applications closed the framebuffer device.
53
54Example: Finding a framebuffer device for OSD
55---------------------------------------------
56
57.. code-block:: c
58
59 #include <linux/fb.h>
60
61 struct v4l2_framebuffer fbuf;
62 unsigned int i;
63 int fb_fd;
64
65 if (-1 == ioctl(fd, VIDIOC_G_FBUF, &fbuf)) {
66 perror("VIDIOC_G_FBUF");
67 exit(EXIT_FAILURE);
68 }
69
70 for (i = 0; i < 30; i++) {
71 char dev_name[16];
72 struct fb_fix_screeninfo si;
73
74 snprintf(dev_name, sizeof(dev_name), "/dev/fb%u", i);
75
76 fb_fd = open(dev_name, O_RDWR);
77 if (-1 == fb_fd) {
78 switch (errno) {
79 case ENOENT: /* no such file */
80 case ENXIO: /* no driver */
81 continue;
82
83 default:
84 perror("open");
85 exit(EXIT_FAILURE);
86 }
87 }
88
89 if (0 == ioctl(fb_fd, FBIOGET_FSCREENINFO, &si)) {
90 if (si.smem_start == (unsigned long)fbuf.base)
91 break;
92 } else {
93 /* Apparently not a framebuffer device. */
94 }
95
96 close(fb_fd);
97 fb_fd = -1;
98 }
99
100 /* fb_fd is the file descriptor of the framebuffer device
101 for the video output overlay, or -1 if no device was found. */
102
103
104Overlay Window and Scaling
105==========================
106
107The overlay is controlled by source and target rectangles. The source
108rectangle selects a subsection of the framebuffer image to be overlaid,
109the target rectangle an area in the outgoing video signal where the
110image will appear. Drivers may or may not support scaling, and arbitrary
111sizes and positions of these rectangles. Further drivers may support any
112(or none) of the clipping/blending methods defined for the
113:ref:`Video Overlay <overlay>` interface.
114
115A struct :ref:`v4l2_window <v4l2-window>` defines the size of the
116source rectangle, its position in the framebuffer and the
117clipping/blending method to be used for the overlay. To get the current
118parameters applications set the ``type`` field of a struct
119:ref:`v4l2_format <v4l2-format>` to
120``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY`` and call the
121:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
122:ref:`struct v4l2_window <v4l2-window>` substructure named ``win``. It is not
123possible to retrieve a previously programmed clipping list or bitmap.
124
125To program the source rectangle applications set the ``type`` field of a
126struct :ref:`v4l2_format <v4l2-format>` to
127``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``, initialize the ``win``
128substructure and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
129The driver adjusts the parameters against hardware limits and returns
130the actual parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does. Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`,
131the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl can be used to learn
132about driver capabilities without actually changing driver state. Unlike
133:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` this also works after the overlay has been enabled.
134
135A struct :ref:`v4l2_crop <v4l2-crop>` defines the size and position
136of the target rectangle. The scaling factor of the overlay is implied by
137the width and height given in struct :ref:`v4l2_window <v4l2-window>`
138and struct :ref:`v4l2_crop <v4l2-crop>`. The cropping API applies to
139*Video Output* and *Video Output Overlay* devices in the same way as to
140*Video Capture* and *Video Overlay* devices, merely reversing the
141direction of the data flow. For more information see :ref:`crop`.
142
143
144Enabling Overlay
145================
146
147There is no V4L2 ioctl to enable or disable the overlay, however the
148framebuffer interface of the driver may support the ``FBIOBLANK`` ioctl.
diff --git a/Documentation/media/uapi/v4l/dev-output.rst b/Documentation/media/uapi/v4l/dev-output.rst
new file mode 100644
index 000000000000..4f1123a0b40d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-output.rst
@@ -0,0 +1,101 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _output:
4
5**********************
6Video Output Interface
7**********************
8
9Video output devices encode stills or image sequences as analog video
10signal. With this interface applications can control the encoding
11process and move images from user space to the driver.
12
13Conventionally V4L2 video output devices are accessed through character
14device special files named ``/dev/video`` and ``/dev/video0`` to
15``/dev/video63`` with major number 81 and minor numbers 0 to 63.
16``/dev/video`` is typically a symbolic link to the preferred video
17device.
18
19..note:: The same device file names are used also for video capture devices.
20
21
22Querying Capabilities
23=====================
24
25Devices supporting the video output interface set the
26``V4L2_CAP_VIDEO_OUTPUT`` or ``V4L2_CAP_VIDEO_OUTPUT_MPLANE`` flag in
27the ``capabilities`` field of struct
28:ref:`v4l2_capability <v4l2-capability>` returned by the
29:ref:`VIDIOC_QUERYCAP` ioctl. As secondary device
30functions they may also support the :ref:`raw VBI output <raw-vbi>`
31(``V4L2_CAP_VBI_OUTPUT``) interface. At least one of the read/write or
32streaming I/O methods must be supported. Modulators and audio outputs
33are optional.
34
35
36Supplemental Functions
37======================
38
39Video output devices shall support :ref:`audio output <audio>`,
40:ref:`modulator <tuner>`, :ref:`controls <control>`,
41:ref:`cropping and scaling <crop>` and
42:ref:`streaming parameter <streaming-par>` ioctls as needed. The
43:ref:`video output <video>` and :ref:`video standard <standard>`
44ioctls must be supported by all video output devices.
45
46
47Image Format Negotiation
48========================
49
50The output is determined by cropping and image format parameters. The
51former select an area of the video picture where the image will appear,
52the latter how images are stored in memory, i. e. in RGB or YUV format,
53the number of bits per pixel or width and height. Together they also
54define how images are scaled in the process.
55
56As usual these parameters are *not* reset at :ref:`open() <func-open>`
57time to permit Unix tool chains, programming a device and then writing
58to it as if it was a plain file. Well written V4L2 applications ensure
59they really get what they want, including cropping and scaling.
60
61Cropping initialization at minimum requires to reset the parameters to
62defaults. An example is given in :ref:`crop`.
63
64To query the current image format applications set the ``type`` field of
65a struct :ref:`v4l2_format <v4l2-format>` to
66``V4L2_BUF_TYPE_VIDEO_OUTPUT`` or ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``
67and call the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer
68to this structure. Drivers fill the struct
69:ref:`v4l2_pix_format <v4l2-pix-format>` ``pix`` or the struct
70:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` ``pix_mp``
71member of the ``fmt`` union.
72
73To request different parameters applications set the ``type`` field of a
74struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
75fields of the struct :ref:`v4l2_pix_format <v4l2-pix-format>`
76``vbi`` member of the ``fmt`` union, or better just modify the results
77of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
78ioctl with a pointer to this structure. Drivers may adjust the
79parameters and finally return the actual parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
80does.
81
82Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl
83can be used to learn about hardware limitations without disabling I/O or
84possibly time consuming hardware preparations.
85
86The contents of struct :ref:`v4l2_pix_format <v4l2-pix-format>` and
87struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` are
88discussed in :ref:`pixfmt`. See also the specification of the
89:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctls for
90details. Video output devices must implement both the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
91and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, even if :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ignores all
92requests and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does.
93:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` is optional.
94
95
96Writing Images
97==============
98
99A video output device may support the :ref:`write() function <rw>`
100and/or streaming (:ref:`memory mapping <mmap>` or
101:ref:`user pointer <userp>`) I/O. See :ref:`io` for details.
diff --git a/Documentation/media/uapi/v4l/dev-overlay.rst b/Documentation/media/uapi/v4l/dev-overlay.rst
new file mode 100644
index 000000000000..92b4471b0c6e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-overlay.rst
@@ -0,0 +1,317 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _overlay:
4
5***********************
6Video Overlay Interface
7***********************
8
9**Also known as Framebuffer Overlay or Previewing.**
10
11Video overlay devices have the ability to genlock (TV-)video into the
12(VGA-)video signal of a graphics card, or to store captured images
13directly in video memory of a graphics card, typically with clipping.
14This can be considerable more efficient than capturing images and
15displaying them by other means. In the old days when only nuclear power
16plants needed cooling towers this used to be the only way to put live
17video into a window.
18
19Video overlay devices are accessed through the same character special
20files as :ref:`video capture <capture>` devices.
21
22.. note:: The default function of a ``/dev/video`` device is video
23 capturing. The overlay function is only available after calling
24 the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
25
26The driver may support simultaneous overlay and capturing using the
27read/write and streaming I/O methods. If so, operation at the nominal
28frame rate of the video standard is not guaranteed. Frames may be
29directed away from overlay to capture, or one field may be used for
30overlay and the other for capture if the capture parameters permit this.
31
32Applications should use different file descriptors for capturing and
33overlay. This must be supported by all drivers capable of simultaneous
34capturing and overlay. Optionally these drivers may also permit
35capturing and overlay with a single file descriptor for compatibility
36with V4L and earlier versions of V4L2. [#f1]_
37
38
39Querying Capabilities
40=====================
41
42Devices supporting the video overlay interface set the
43``V4L2_CAP_VIDEO_OVERLAY`` flag in the ``capabilities`` field of struct
44:ref:`v4l2_capability <v4l2-capability>` returned by the
45:ref:`VIDIOC_QUERYCAP` ioctl. The overlay I/O
46method specified below must be supported. Tuners and audio inputs are
47optional.
48
49
50Supplemental Functions
51======================
52
53Video overlay devices shall support :ref:`audio input <audio>`,
54:ref:`tuner`, :ref:`controls <control>`,
55:ref:`cropping and scaling <crop>` and
56:ref:`streaming parameter <streaming-par>` ioctls as needed. The
57:ref:`video input <video>` and :ref:`video standard <standard>`
58ioctls must be supported by all video overlay devices.
59
60
61Setup
62=====
63
64Before overlay can commence applications must program the driver with
65frame buffer parameters, namely the address and size of the frame buffer
66and the image format, for example RGB 5:6:5. The
67:ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` and
68:ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctls are available to get and
69set these parameters, respectively. The :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctl is
70privileged because it allows to set up DMA into physical memory,
71bypassing the memory protection mechanisms of the kernel. Only the
72superuser can change the frame buffer address and size. Users are not
73supposed to run TV applications as root or with SUID bit set. A small
74helper application with suitable privileges should query the graphics
75system and program the V4L2 driver at the appropriate time.
76
77Some devices add the video overlay to the output signal of the graphics
78card. In this case the frame buffer is not modified by the video device,
79and the frame buffer address and pixel format are not needed by the
80driver. The :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctl is not privileged. An application
81can check for this type of device by calling the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`
82ioctl.
83
84A driver may support any (or none) of five clipping/blending methods:
85
861. Chroma-keying displays the overlaid image only where pixels in the
87 primary graphics surface assume a certain color.
88
892. A bitmap can be specified where each bit corresponds to a pixel in
90 the overlaid image. When the bit is set, the corresponding video
91 pixel is displayed, otherwise a pixel of the graphics surface.
92
933. A list of clipping rectangles can be specified. In these regions *no*
94 video is displayed, so the graphics surface can be seen here.
95
964. The framebuffer has an alpha channel that can be used to clip or
97 blend the framebuffer with the video.
98
995. A global alpha value can be specified to blend the framebuffer
100 contents with video images.
101
102When simultaneous capturing and overlay is supported and the hardware
103prohibits different image and frame buffer formats, the format requested
104first takes precedence. The attempt to capture
105(:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`) or overlay
106(:ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`) may fail with an ``EBUSY`` error
107code or return accordingly modified parameters..
108
109
110Overlay Window
111==============
112
113The overlaid image is determined by cropping and overlay window
114parameters. The former select an area of the video picture to capture,
115the latter how images are overlaid and clipped. Cropping initialization
116at minimum requires to reset the parameters to defaults. An example is
117given in :ref:`crop`.
118
119The overlay window is described by a struct
120:ref:`v4l2_window <v4l2-window>`. It defines the size of the image,
121its position over the graphics surface and the clipping to be applied.
122To get the current parameters applications set the ``type`` field of a
123struct :ref:`v4l2_format <v4l2-format>` to
124``V4L2_BUF_TYPE_VIDEO_OVERLAY`` and call the
125:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
126:ref:`struct v4l2_window <v4l2-window>` substructure named ``win``. It is not
127possible to retrieve a previously programmed clipping list or bitmap.
128
129To program the overlay window applications set the ``type`` field of a
130struct :ref:`v4l2_format <v4l2-format>` to
131``V4L2_BUF_TYPE_VIDEO_OVERLAY``, initialize the ``win`` substructure and
132call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. The driver
133adjusts the parameters against hardware limits and returns the actual
134parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does. Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, the
135:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl can be used to learn
136about driver capabilities without actually changing driver state. Unlike
137:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` this also works after the overlay has been enabled.
138
139The scaling factor of the overlaid image is implied by the width and
140height given in struct :ref:`v4l2_window <v4l2-window>` and the size
141of the cropping rectangle. For more information see :ref:`crop`.
142
143When simultaneous capturing and overlay is supported and the hardware
144prohibits different image and window sizes, the size requested first
145takes precedence. The attempt to capture or overlay as well
146(:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`) may fail with an ``EBUSY`` error
147code or return accordingly modified parameters.
148
149
150.. _v4l2-window:
151
152struct v4l2_window
153------------------
154
155``struct v4l2_rect w``
156 Size and position of the window relative to the top, left corner of
157 the frame buffer defined with
158 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`. The window can extend the
159 frame buffer width and height, the ``x`` and ``y`` coordinates can
160 be negative, and it can lie completely outside the frame buffer. The
161 driver clips the window accordingly, or if that is not possible,
162 modifies its size and/or position.
163
164``enum v4l2_field field``
165 Applications set this field to determine which video field shall be
166 overlaid, typically one of ``V4L2_FIELD_ANY`` (0),
167 ``V4L2_FIELD_TOP``, ``V4L2_FIELD_BOTTOM`` or
168 ``V4L2_FIELD_INTERLACED``. Drivers may have to choose a different
169 field order and return the actual setting here.
170
171``__u32 chromakey``
172 When chroma-keying has been negotiated with
173 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` applications set this field
174 to the desired pixel value for the chroma key. The format is the
175 same as the pixel format of the framebuffer (struct
176 :ref:`v4l2_framebuffer <v4l2-framebuffer>` ``fmt.pixelformat``
177 field), with bytes in host order. E. g. for
178 :ref:`V4L2_PIX_FMT_BGR24 <V4L2-PIX-FMT-BGR32>` the value should
179 be 0xRRGGBB on a little endian, 0xBBGGRR on a big endian host.
180
181``struct v4l2_clip * clips``
182 When chroma-keying has *not* been negotiated and
183 :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` indicated this capability,
184 applications can set this field to point to an array of clipping
185 rectangles.
186
187 Like the window coordinates w, clipping rectangles are defined
188 relative to the top, left corner of the frame buffer. However
189 clipping rectangles must not extend the frame buffer width and
190 height, and they must not overlap. If possible applications
191 should merge adjacent rectangles. Whether this must create
192 x-y or y-x bands, or the order of rectangles, is not defined. When
193 clip lists are not supported the driver ignores this field. Its
194 contents after calling :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
195 are undefined.
196
197``__u32 clipcount``
198 When the application set the ``clips`` field, this field must
199 contain the number of clipping rectangles in the list. When clip
200 lists are not supported the driver ignores this field, its contents
201 after calling :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` are undefined. When clip lists are
202 supported but no clipping is desired this field must be set to zero.
203
204``void * bitmap``
205 When chroma-keying has *not* been negotiated and
206 :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` indicated this capability,
207 applications can set this field to point to a clipping bit mask.
208
209It must be of the same size as the window, ``w.width`` and ``w.height``.
210Each bit corresponds to a pixel in the overlaid image, which is
211displayed only when the bit is *set*. Pixel coordinates translate to
212bits like:
213
214
215.. code-block:: c
216
217 ((__u8 *) bitmap)[w.width * y + x / 8] & (1 << (x & 7))
218
219where ``0`` ≤ x < ``w.width`` and ``0`` ≤ y <``w.height``. [#f2]_
220
221When a clipping bit mask is not supported the driver ignores this field,
222its contents after calling :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` are
223undefined. When a bit mask is supported but no clipping is desired this
224field must be set to ``NULL``.
225
226Applications need not create a clip list or bit mask. When they pass
227both, or despite negotiating chroma-keying, the results are undefined.
228Regardless of the chosen method, the clipping abilities of the hardware
229may be limited in quantity or quality. The results when these limits are
230exceeded are undefined. [#f3]_
231
232``__u8 global_alpha``
233 The global alpha value used to blend the framebuffer with video
234 images, if global alpha blending has been negotiated
235 (``V4L2_FBUF_FLAG_GLOBAL_ALPHA``, see
236 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`,
237 :ref:`framebuffer-flags`).
238
239 .. note:: This field was added in Linux 2.6.23, extending the
240 structure. However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>`
241 ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>`
242 parent structure with padding bytes at the end, are not affected.
243
244
245.. _v4l2-clip:
246
247struct v4l2_clip [#f4]_
248-----------------------
249
250``struct v4l2_rect c``
251 Coordinates of the clipping rectangle, relative to the top, left
252 corner of the frame buffer. Only window pixels *outside* all
253 clipping rectangles are displayed.
254
255``struct v4l2_clip * next``
256 Pointer to the next clipping rectangle, ``NULL`` when this is the last
257 rectangle. Drivers ignore this field, it cannot be used to pass a
258 linked list of clipping rectangles.
259
260
261.. _v4l2-rect:
262
263struct v4l2_rect
264----------------
265
266``__s32 left``
267 Horizontal offset of the top, left corner of the rectangle, in
268 pixels.
269
270``__s32 top``
271 Vertical offset of the top, left corner of the rectangle, in pixels.
272 Offsets increase to the right and down.
273
274``__u32 width``
275 Width of the rectangle, in pixels.
276
277``__u32 height``
278 Height of the rectangle, in pixels.
279
280
281Enabling Overlay
282================
283
284To start or stop the frame buffer overlay applications call the
285:ref:`VIDIOC_OVERLAY` ioctl.
286
287.. [#f1]
288 A common application of two file descriptors is the XFree86
289 :ref:`Xv/V4L <xvideo>` interface driver and a V4L2 application.
290 While the X server controls video overlay, the application can take
291 advantage of memory mapping and DMA.
292
293 In the opinion of the designers of this API, no driver writer taking
294 the efforts to support simultaneous capturing and overlay will
295 restrict this ability by requiring a single file descriptor, as in
296 V4L and earlier versions of V4L2. Making this optional means
297 applications depending on two file descriptors need backup routines
298 to be compatible with all drivers, which is considerable more work
299 than using two fds in applications which do not. Also two fd's fit
300 the general concept of one file descriptor for each logical stream.
301 Hence as a complexity trade-off drivers *must* support two file
302 descriptors and *may* support single fd operation.
303
304.. [#f2]
305 Should we require ``w.width`` to be a multiple of eight?
306
307.. [#f3]
308 When the image is written into frame buffer memory it will be
309 undesirable if the driver clips out less pixels than expected,
310 because the application and graphics system are not aware these
311 regions need to be refreshed. The driver should clip out more pixels
312 or not write the image at all.
313
314.. [#f4]
315 The X Window system defines "regions" which are vectors of ``struct
316 BoxRec { short x1, y1, x2, y2; }`` with ``width = x2 - x1`` and
317 ``height = y2 - y1``, so one cannot pass X11 clip lists directly.
diff --git a/Documentation/media/uapi/v4l/dev-radio.rst b/Documentation/media/uapi/v4l/dev-radio.rst
new file mode 100644
index 000000000000..5ff7cded2591
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-radio.rst
@@ -0,0 +1,52 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _radio:
4
5***************
6Radio Interface
7***************
8
9This interface is intended for AM and FM (analog) radio receivers and
10transmitters.
11
12Conventionally V4L2 radio devices are accessed through character device
13special files named ``/dev/radio`` and ``/dev/radio0`` to
14``/dev/radio63`` with major number 81 and minor numbers 64 to 127.
15
16
17Querying Capabilities
18=====================
19
20Devices supporting the radio interface set the ``V4L2_CAP_RADIO`` and
21``V4L2_CAP_TUNER`` or ``V4L2_CAP_MODULATOR`` flag in the
22``capabilities`` field of struct
23:ref:`v4l2_capability <v4l2-capability>` returned by the
24:ref:`VIDIOC_QUERYCAP` ioctl. Other combinations of
25capability flags are reserved for future extensions.
26
27
28Supplemental Functions
29======================
30
31Radio devices can support :ref:`controls <control>`, and must support
32the :ref:`tuner or modulator <tuner>` ioctls.
33
34They do not support the video input or output, audio input or output,
35video standard, cropping and scaling, compression and streaming
36parameter, or overlay ioctls. All other ioctls and I/O methods are
37reserved for future extensions.
38
39
40Programming
41===========
42
43Radio devices may have a couple audio controls (as discussed in
44:ref:`control`) such as a volume control, possibly custom controls.
45Further all radio devices have one tuner or modulator (these are
46discussed in :ref:`tuner`) with index number zero to select the radio
47frequency and to determine if a monaural or FM stereo program is
48received/emitted. Drivers switch automatically between AM and FM
49depending on the selected frequency. The
50:ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` or
51:ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` ioctl reports the
52supported frequency range.
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi.rst b/Documentation/media/uapi/v4l/dev-raw-vbi.rst
new file mode 100644
index 000000000000..d5a4b3530b69
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi.rst
@@ -0,0 +1,350 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _raw-vbi:
4
5**********************
6Raw VBI Data Interface
7**********************
8
9VBI is an abbreviation of Vertical Blanking Interval, a gap in the
10sequence of lines of an analog video signal. During VBI no picture
11information is transmitted, allowing some time while the electron beam
12of a cathode ray tube TV returns to the top of the screen. Using an
13oscilloscope you will find here the vertical synchronization pulses and
14short data packages ASK modulated [#f1]_ onto the video signal. These are
15transmissions of services such as Teletext or Closed Caption.
16
17Subject of this interface type is raw VBI data, as sampled off a video
18signal, or to be added to a signal for output. The data format is
19similar to uncompressed video images, a number of lines times a number
20of samples per line, we call this a VBI image.
21
22Conventionally V4L2 VBI devices are accessed through character device
23special files named ``/dev/vbi`` and ``/dev/vbi0`` to ``/dev/vbi31``
24with major number 81 and minor numbers 224 to 255. ``/dev/vbi`` is
25typically a symbolic link to the preferred VBI device. This convention
26applies to both input and output devices.
27
28To address the problems of finding related video and VBI devices VBI
29capturing and output is also available as device function under
30``/dev/video``. To capture or output raw VBI data with these devices
31applications must call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
32Accessed as ``/dev/vbi``, raw VBI capturing or output is the default
33device function.
34
35
36Querying Capabilities
37=====================
38
39Devices supporting the raw VBI capturing or output API set the
40``V4L2_CAP_VBI_CAPTURE`` or ``V4L2_CAP_VBI_OUTPUT`` flags, respectively,
41in the ``capabilities`` field of struct
42:ref:`v4l2_capability <v4l2-capability>` returned by the
43:ref:`VIDIOC_QUERYCAP` ioctl. At least one of the
44read/write, streaming or asynchronous I/O methods must be supported. VBI
45devices may or may not have a tuner or modulator.
46
47
48Supplemental Functions
49======================
50
51VBI devices shall support :ref:`video input or output <video>`,
52:ref:`tuner or modulator <tuner>`, and :ref:`controls <control>`
53ioctls as needed. The :ref:`video standard <standard>` ioctls provide
54information vital to program a VBI device, therefore must be supported.
55
56
57Raw VBI Format Negotiation
58==========================
59
60Raw VBI sampling abilities can vary, in particular the sampling
61frequency. To properly interpret the data V4L2 specifies an ioctl to
62query the sampling parameters. Moreover, to allow for some flexibility
63applications can also suggest different parameters.
64
65As usual these parameters are *not* reset at :ref:`open() <func-open>`
66time to permit Unix tool chains, programming a device and then reading
67from it as if it was a plain file. Well written V4L2 applications should
68always ensure they really get what they want, requesting reasonable
69parameters and then checking if the actual parameters are suitable.
70
71To query the current raw VBI capture parameters applications set the
72``type`` field of a struct :ref:`v4l2_format <v4l2-format>` to
73``V4L2_BUF_TYPE_VBI_CAPTURE`` or ``V4L2_BUF_TYPE_VBI_OUTPUT``, and call
74the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer to this
75structure. Drivers fill the struct
76:ref:`v4l2_vbi_format <v4l2-vbi-format>` ``vbi`` member of the
77``fmt`` union.
78
79To request different parameters applications set the ``type`` field of a
80struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
81fields of the struct :ref:`v4l2_vbi_format <v4l2-vbi-format>`
82``vbi`` member of the ``fmt`` union, or better just modify the results
83of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
84ioctl with a pointer to this structure. Drivers return an ``EINVAL`` error
85code only when the given parameters are ambiguous, otherwise they modify
86the parameters according to the hardware capabilities and return the
87actual parameters. When the driver allocates resources at this point, it
88may return an ``EBUSY`` error code to indicate the returned parameters are
89valid but the required resources are currently not available. That may
90happen for instance when the video and VBI areas to capture would
91overlap, or when the driver supports multiple opens and another process
92already requested VBI capturing or output. Anyway, applications must
93expect other resource allocation points which may return ``EBUSY``, at the
94:ref:`VIDIOC_STREAMON` ioctl and the first :ref:`read() <func-read>`
95, :ref:`write() <func-write>` and :ref:`select() <func-select>` calls.
96
97VBI devices must implement both the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
98:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, even if :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ignores all requests
99and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does.
100:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` is optional.
101
102
103.. _v4l2-vbi-format:
104
105.. flat-table:: struct v4l2_vbi_format
106 :header-rows: 0
107 :stub-columns: 0
108 :widths: 1 1 2
109
110
111 - .. row 1
112
113 - __u32
114
115 - ``sampling_rate``
116
117 - Samples per second, i. e. unit 1 Hz.
118
119 - .. row 2
120
121 - __u32
122
123 - ``offset``
124
125 - Horizontal offset of the VBI image, relative to the leading edge
126 of the line synchronization pulse and counted in samples: The
127 first sample in the VBI image will be located ``offset`` /
128 ``sampling_rate`` seconds following the leading edge. See also
129 :ref:`vbi-hsync`.
130
131 - .. row 3
132
133 - __u32
134
135 - ``samples_per_line``
136
137 -
138
139 - .. row 4
140
141 - __u32
142
143 - ``sample_format``
144
145 - Defines the sample format as in :ref:`pixfmt`, a
146 four-character-code. [#f2]_ Usually this is ``V4L2_PIX_FMT_GREY``,
147 i. e. each sample consists of 8 bits with lower values oriented
148 towards the black level. Do not assume any other correlation of
149 values with the signal level. For example, the MSB does not
150 necessarily indicate if the signal is 'high' or 'low' because 128
151 may not be the mean value of the signal. Drivers shall not convert
152 the sample format by software.
153
154 - .. row 5
155
156 - __u32
157
158 - ``start``\ [#f2]_
159
160 - This is the scanning system line number associated with the first
161 line of the VBI image, of the first and the second field
162 respectively. See :ref:`vbi-525` and :ref:`vbi-625` for valid
163 values. The ``V4L2_VBI_ITU_525_F1_START``,
164 ``V4L2_VBI_ITU_525_F2_START``, ``V4L2_VBI_ITU_625_F1_START`` and
165 ``V4L2_VBI_ITU_625_F2_START`` defines give the start line numbers
166 for each field for each 525 or 625 line format as a convenience.
167 Don't forget that ITU line numbering starts at 1, not 0. VBI input
168 drivers can return start values 0 if the hardware cannot reliable
169 identify scanning lines, VBI acquisition may not require this
170 information.
171
172 - .. row 6
173
174 - __u32
175
176 - ``count``\ [#f2]_
177
178 - The number of lines in the first and second field image,
179 respectively.
180
181 - .. row 7
182
183 - :cspan:`2`
184
185 Drivers should be as flexibility as possible. For example, it may
186 be possible to extend or move the VBI capture window down to the
187 picture area, implementing a 'full field mode' to capture data
188 service transmissions embedded in the picture.
189
190 An application can set the first or second ``count`` value to zero
191 if no data is required from the respective field; ``count``\ [1]
192 if the scanning system is progressive, i. e. not interlaced. The
193 corresponding start value shall be ignored by the application and
194 driver. Anyway, drivers may not support single field capturing and
195 return both count values non-zero.
196
197 Both ``count`` values set to zero, or line numbers outside the
198 bounds depicted in :ref:`vbi-525` and :ref:`vbi-625`, or a
199 field image covering lines of two fields, are invalid and shall
200 not be returned by the driver.
201
202 To initialize the ``start`` and ``count`` fields, applications
203 must first determine the current video standard selection. The
204 :ref:`v4l2_std_id <v4l2-std-id>` or the ``framelines`` field
205 of struct :ref:`v4l2_standard <v4l2-standard>` can be evaluated
206 for this purpose.
207
208 - .. row 8
209
210 - __u32
211
212 - ``flags``
213
214 - See :ref:`vbifmt-flags` below. Currently only drivers set flags,
215 applications must set this field to zero.
216
217 - .. row 9
218
219 - __u32
220
221 - ``reserved``\ [#f2]_
222
223 - This array is reserved for future extensions. Drivers and
224 applications must set it to zero.
225
226
227
228.. _vbifmt-flags:
229
230.. flat-table:: Raw VBI Format Flags
231 :header-rows: 0
232 :stub-columns: 0
233 :widths: 3 1 4
234
235
236 - .. row 1
237
238 - ``V4L2_VBI_UNSYNC``
239
240 - 0x0001
241
242 - This flag indicates hardware which does not properly distinguish
243 between fields. Normally the VBI image stores the first field
244 (lower scanning line numbers) first in memory. This may be a top
245 or bottom field depending on the video standard. When this flag is
246 set the first or second field may be stored first, however the
247 fields are still in correct temporal order with the older field
248 first in memory. [#f3]_
249
250 - .. row 2
251
252 - ``V4L2_VBI_INTERLACED``
253
254 - 0x0002
255
256 - By default the two field images will be passed sequentially; all
257 lines of the first field followed by all lines of the second field
258 (compare :ref:`field-order` ``V4L2_FIELD_SEQ_TB`` and
259 ``V4L2_FIELD_SEQ_BT``, whether the top or bottom field is first in
260 memory depends on the video standard). When this flag is set, the
261 two fields are interlaced (cf. ``V4L2_FIELD_INTERLACED``). The
262 first line of the first field followed by the first line of the
263 second field, then the two second lines, and so on. Such a layout
264 may be necessary when the hardware has been programmed to capture
265 or output interlaced video images and is unable to separate the
266 fields for VBI capturing at the same time. For simplicity setting
267 this flag implies that both ``count`` values are equal and
268 non-zero.
269
270
271
272.. _vbi-hsync:
273
274.. figure:: dev-raw-vbi_files/vbi_hsync.*
275 :alt: vbi_hsync.pdf / vbi_hsync.gif
276 :align: center
277
278 **Figure 4.1. Line synchronization**
279
280
281.. _vbi-525:
282
283.. figure:: dev-raw-vbi_files/vbi_525.*
284 :alt: vbi_525.pdf / vbi_525.gif
285 :align: center
286
287 **Figure 4.2. ITU-R 525 line numbering (M/NTSC and M/PAL)**
288
289
290
291.. _vbi-625:
292
293.. figure:: dev-raw-vbi_files/vbi_625.*
294 :alt: vbi_625.pdf / vbi_625.gif
295 :align: center
296
297 **Figure 4.3. ITU-R 625 line numbering**
298
299
300
301Remember the VBI image format depends on the selected video standard,
302therefore the application must choose a new standard or query the
303current standard first. Attempts to read or write data ahead of format
304negotiation, or after switching the video standard which may invalidate
305the negotiated VBI parameters, should be refused by the driver. A format
306change during active I/O is not permitted.
307
308
309Reading and writing VBI images
310==============================
311
312To assure synchronization with the field number and easier
313implementation, the smallest unit of data passed at a time is one frame,
314consisting of two fields of VBI images immediately following in memory.
315
316The total size of a frame computes as follows:
317
318
319.. code-block:: c
320
321 (count[0] + count[1]) * samples_per_line * sample size in bytes
322
323The sample size is most likely always one byte, applications must check
324the ``sample_format`` field though, to function properly with other
325drivers.
326
327A VBI device may support :ref:`read/write <rw>` and/or streaming
328(:ref:`memory mapping <mmap>` or :ref:`user pointer <userp>`) I/O.
329The latter bears the possibility of synchronizing video and VBI data by
330using buffer timestamps.
331
332Remember the :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` ioctl and the
333first :ref:`read() <func-read>`, :ref:`write() <func-write>` and
334:ref:`select() <func-select>` call can be resource allocation
335points returning an ``EBUSY`` error code if the required hardware resources
336are temporarily unavailable, for example the device is already in use by
337another process.
338
339.. [#f1]
340 ASK: Amplitude-Shift Keying. A high signal level represents a '1'
341 bit, a low level a '0' bit.
342
343.. [#f2]
344 A few devices may be unable to sample VBI data at all but can extend
345 the video capture window to the VBI region.
346
347.. [#f3]
348 Most VBI services transmit on both fields, but some have different
349 semantics depending on the field number. These cannot be reliable
350 decoded or encoded when ``V4L2_VBI_UNSYNC`` is set.
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.gif b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.gif
new file mode 100644
index 000000000000..5580b690d504
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf
new file mode 100644
index 000000000000..9e72c25b208d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.gif b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.gif
new file mode 100644
index 000000000000..34e3251983c4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf
new file mode 100644
index 000000000000..765235e33a4d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.gif b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.gif
new file mode 100644
index 000000000000..b02434d3b356
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf
new file mode 100644
index 000000000000..200b668189bf
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-rds.rst b/Documentation/media/uapi/v4l/dev-rds.rst
new file mode 100644
index 000000000000..cd6ad63cb90b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-rds.rst
@@ -0,0 +1,255 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _rds:
4
5*************
6RDS Interface
7*************
8
9The Radio Data System transmits supplementary information in binary
10format, for example the station name or travel information, on an
11inaudible audio subcarrier of a radio program. This interface is aimed
12at devices capable of receiving and/or transmitting RDS information.
13
14For more information see the core RDS standard :ref:`iec62106` and the
15RBDS standard :ref:`nrsc4`.
16
17.. note:: Note that the RBDS standard as is used in the USA is almost
18 identical to the RDS standard. Any RDS decoder/encoder can also handle
19 RBDS. Only some of the fields have slightly different meanings. See the
20 RBDS standard for more information.
21
22The RBDS standard also specifies support for MMBS (Modified Mobile
23Search). This is a proprietary format which seems to be discontinued.
24The RDS interface does not support this format. Should support for MMBS
25(or the so-called 'E blocks' in general) be needed, then please contact
26the linux-media mailing list:
27`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
28
29
30Querying Capabilities
31=====================
32
33Devices supporting the RDS capturing API set the
34``V4L2_CAP_RDS_CAPTURE`` flag in the ``capabilities`` field of struct
35:ref:`v4l2_capability <v4l2-capability>` returned by the
36:ref:`VIDIOC_QUERYCAP` ioctl. Any tuner that
37supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
38``capability`` field of struct :ref:`v4l2_tuner <v4l2-tuner>`. If the
39driver only passes RDS blocks without interpreting the data the
40``V4L2_TUNER_CAP_RDS_BLOCK_IO`` flag has to be set, see
41:ref:`Reading RDS data <reading-rds-data>`. For future use the flag
42``V4L2_TUNER_CAP_RDS_CONTROLS`` has also been defined. However, a driver
43for a radio tuner with this capability does not yet exist, so if you are
44planning to write such a driver you should discuss this on the
45linux-media mailing list:
46`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
47
48Whether an RDS signal is present can be detected by looking at the
49``rxsubchans`` field of struct :ref:`v4l2_tuner <v4l2-tuner>`: the
50``V4L2_TUNER_SUB_RDS`` will be set if RDS data was detected.
51
52Devices supporting the RDS output API set the ``V4L2_CAP_RDS_OUTPUT``
53flag in the ``capabilities`` field of struct
54:ref:`v4l2_capability <v4l2-capability>` returned by the
55:ref:`VIDIOC_QUERYCAP` ioctl. Any modulator that
56supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
57``capability`` field of struct
58:ref:`v4l2_modulator <v4l2-modulator>`. In order to enable the RDS
59transmission one must set the ``V4L2_TUNER_SUB_RDS`` bit in the
60``txsubchans`` field of struct
61:ref:`v4l2_modulator <v4l2-modulator>`. If the driver only passes RDS
62blocks without interpreting the data the ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
63flag has to be set. If the tuner is capable of handling RDS entities
64like program identification codes and radio text, the flag
65``V4L2_TUNER_CAP_RDS_CONTROLS`` should be set, see
66:ref:`Writing RDS data <writing-rds-data>` and
67:ref:`FM Transmitter Control Reference <fm-tx-controls>`.
68
69
70.. _reading-rds-data:
71
72Reading RDS data
73================
74
75RDS data can be read from the radio device with the
76:ref:`read() <func-read>` function. The data is packed in groups of
77three bytes.
78
79
80.. _writing-rds-data:
81
82Writing RDS data
83================
84
85RDS data can be written to the radio device with the
86:ref:`write() <func-write>` function. The data is packed in groups of
87three bytes, as follows:
88
89
90RDS datastructures
91==================
92
93
94.. _v4l2-rds-data:
95
96.. flat-table:: struct v4l2_rds_data
97 :header-rows: 0
98 :stub-columns: 0
99 :widths: 1 1 5
100
101
102 - .. row 1
103
104 - __u8
105
106 - ``lsb``
107
108 - Least Significant Byte of RDS Block
109
110 - .. row 2
111
112 - __u8
113
114 - ``msb``
115
116 - Most Significant Byte of RDS Block
117
118 - .. row 3
119
120 - __u8
121
122 - ``block``
123
124 - Block description
125
126
127
128.. _v4l2-rds-block:
129
130.. flat-table:: Block description
131 :header-rows: 0
132 :stub-columns: 0
133 :widths: 1 5
134
135
136 - .. row 1
137
138 - Bits 0-2
139
140 - Block (aka offset) of the received data.
141
142 - .. row 2
143
144 - Bits 3-5
145
146 - Deprecated. Currently identical to bits 0-2. Do not use these
147 bits.
148
149 - .. row 3
150
151 - Bit 6
152
153 - Corrected bit. Indicates that an error was corrected for this data
154 block.
155
156 - .. row 4
157
158 - Bit 7
159
160 - Error bit. Indicates that an uncorrectable error occurred during
161 reception of this block.
162
163
164
165.. _v4l2-rds-block-codes:
166
167.. flat-table:: Block defines
168 :header-rows: 0
169 :stub-columns: 0
170 :widths: 1 1 1 5
171
172
173 - .. row 1
174
175 - V4L2_RDS_BLOCK_MSK
176
177 -
178 - 7
179
180 - Mask for bits 0-2 to get the block ID.
181
182 - .. row 2
183
184 - V4L2_RDS_BLOCK_A
185
186 -
187 - 0
188
189 - Block A.
190
191 - .. row 3
192
193 - V4L2_RDS_BLOCK_B
194
195 -
196 - 1
197
198 - Block B.
199
200 - .. row 4
201
202 - V4L2_RDS_BLOCK_C
203
204 -
205 - 2
206
207 - Block C.
208
209 - .. row 5
210
211 - V4L2_RDS_BLOCK_D
212
213 -
214 - 3
215
216 - Block D.
217
218 - .. row 6
219
220 - V4L2_RDS_BLOCK_C_ALT
221
222 -
223 - 4
224
225 - Block C'.
226
227 - .. row 7
228
229 - V4L2_RDS_BLOCK_INVALID
230
231 - read-only
232
233 - 7
234
235 - An invalid block.
236
237 - .. row 8
238
239 - V4L2_RDS_BLOCK_CORRECTED
240
241 - read-only
242
243 - 0x40
244
245 - A bit error was detected but corrected.
246
247 - .. row 9
248
249 - V4L2_RDS_BLOCK_ERROR
250
251 - read-only
252
253 - 0x80
254
255 - An uncorrectable error occurred.
diff --git a/Documentation/media/uapi/v4l/dev-sdr.rst b/Documentation/media/uapi/v4l/dev-sdr.rst
new file mode 100644
index 000000000000..fc4053f957fb
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-sdr.rst
@@ -0,0 +1,120 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _sdr:
4
5**************************************
6Software Defined Radio Interface (SDR)
7**************************************
8
9SDR is an abbreviation of Software Defined Radio, the radio device which
10uses application software for modulation or demodulation. This interface
11is intended for controlling and data streaming of such devices.
12
13SDR devices are accessed through character device special files named
14``/dev/swradio0`` to ``/dev/swradio255`` with major number 81 and
15dynamically allocated minor numbers 0 to 255.
16
17
18Querying Capabilities
19=====================
20
21Devices supporting the SDR receiver interface set the
22``V4L2_CAP_SDR_CAPTURE`` and ``V4L2_CAP_TUNER`` flag in the
23``capabilities`` field of struct
24:ref:`v4l2_capability <v4l2-capability>` returned by the
25:ref:`VIDIOC_QUERYCAP` ioctl. That flag means the
26device has an Analog to Digital Converter (ADC), which is a mandatory
27element for the SDR receiver.
28
29Devices supporting the SDR transmitter interface set the
30``V4L2_CAP_SDR_OUTPUT`` and ``V4L2_CAP_MODULATOR`` flag in the
31``capabilities`` field of struct
32:ref:`v4l2_capability <v4l2-capability>` returned by the
33:ref:`VIDIOC_QUERYCAP` ioctl. That flag means the
34device has an Digital to Analog Converter (DAC), which is a mandatory
35element for the SDR transmitter.
36
37At least one of the read/write, streaming or asynchronous I/O methods
38must be supported.
39
40
41Supplemental Functions
42======================
43
44SDR devices can support :ref:`controls <control>`, and must support
45the :ref:`tuner` ioctls. Tuner ioctls are used for setting the
46ADC/DAC sampling rate (sampling frequency) and the possible radio
47frequency (RF).
48
49The ``V4L2_TUNER_SDR`` tuner type is used for setting SDR device ADC/DAC
50frequency, and the ``V4L2_TUNER_RF`` tuner type is used for setting
51radio frequency. The tuner index of the RF tuner (if any) must always
52follow the SDR tuner index. Normally the SDR tuner is #0 and the RF
53tuner is #1.
54
55The :ref:`VIDIOC_S_HW_FREQ_SEEK` ioctl is
56not supported.
57
58
59Data Format Negotiation
60=======================
61
62The SDR device uses the :ref:`format` ioctls to select the
63capture and output format. Both the sampling resolution and the data
64streaming format are bound to that selectable format. In addition to the
65basic :ref:`format` ioctls, the
66:ref:`VIDIOC_ENUM_FMT` ioctl must be supported as
67well.
68
69To use the :ref:`format` ioctls applications set the ``type``
70field of a struct :ref:`v4l2_format <v4l2-format>` to
71``V4L2_BUF_TYPE_SDR_CAPTURE`` or ``V4L2_BUF_TYPE_SDR_OUTPUT`` and use
72the struct :ref:`v4l2_sdr_format <v4l2-sdr-format>` ``sdr`` member
73of the ``fmt`` union as needed per the desired operation. Currently
74there is two fields, ``pixelformat`` and ``buffersize``, of struct
75struct :ref:`v4l2_sdr_format <v4l2-sdr-format>` which are used.
76Content of the ``pixelformat`` is V4L2 FourCC code of the data format.
77The ``buffersize`` field is maximum buffer size in bytes required for
78data transfer, set by the driver in order to inform application.
79
80
81.. _v4l2-sdr-format:
82
83.. flat-table:: struct v4l2_sdr_format
84 :header-rows: 0
85 :stub-columns: 0
86 :widths: 1 1 2
87
88
89 - .. row 1
90
91 - __u32
92
93 - ``pixelformat``
94
95 - The data format or type of compression, set by the application.
96 This is a little endian
97 :ref:`four character code <v4l2-fourcc>`. V4L2 defines SDR
98 formats in :ref:`sdr-formats`.
99
100 - .. row 2
101
102 - __u32
103
104 - ``buffersize``
105
106 - Maximum size in bytes required for data. Value is set by the
107 driver.
108
109 - .. row 3
110
111 - __u8
112
113 - ``reserved[24]``
114
115 - This array is reserved for future extensions. Drivers and
116 applications must set it to zero.
117
118
119An SDR device may support :ref:`read/write <rw>` and/or streaming
120(:ref:`memory mapping <mmap>` or :ref:`user pointer <userp>`) I/O.
diff --git a/Documentation/media/uapi/v4l/dev-sliced-vbi.rst b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
new file mode 100644
index 000000000000..ec52a825f4d6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
@@ -0,0 +1,822 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _sliced:
4
5*************************
6Sliced VBI Data Interface
7*************************
8
9VBI stands for Vertical Blanking Interval, a gap in the sequence of
10lines of an analog video signal. During VBI no picture information is
11transmitted, allowing some time while the electron beam of a cathode ray
12tube TV returns to the top of the screen.
13
14Sliced VBI devices use hardware to demodulate data transmitted in the
15VBI. V4L2 drivers shall *not* do this by software, see also the
16:ref:`raw VBI interface <raw-vbi>`. The data is passed as short
17packets of fixed size, covering one scan line each. The number of
18packets per video frame is variable.
19
20Sliced VBI capture and output devices are accessed through the same
21character special files as raw VBI devices. When a driver supports both
22interfaces, the default function of a ``/dev/vbi`` device is *raw* VBI
23capturing or output, and the sliced VBI function is only available after
24calling the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as defined
25below. Likewise a ``/dev/video`` device may support the sliced VBI API,
26however the default function here is video capturing or output.
27Different file descriptors must be used to pass raw and sliced VBI data
28simultaneously, if this is supported by the driver.
29
30
31Querying Capabilities
32=====================
33
34Devices supporting the sliced VBI capturing or output API set the
35``V4L2_CAP_SLICED_VBI_CAPTURE`` or ``V4L2_CAP_SLICED_VBI_OUTPUT`` flag
36respectively, in the ``capabilities`` field of struct
37:ref:`v4l2_capability <v4l2-capability>` returned by the
38:ref:`VIDIOC_QUERYCAP` ioctl. At least one of the
39read/write, streaming or asynchronous :ref:`I/O methods <io>` must be
40supported. Sliced VBI devices may have a tuner or modulator.
41
42
43Supplemental Functions
44======================
45
46Sliced VBI devices shall support :ref:`video input or output <video>`
47and :ref:`tuner or modulator <tuner>` ioctls if they have these
48capabilities, and they may support :ref:`control` ioctls.
49The :ref:`video standard <standard>` ioctls provide information vital
50to program a sliced VBI device, therefore must be supported.
51
52
53.. _sliced-vbi-format-negotitation:
54
55Sliced VBI Format Negotiation
56=============================
57
58To find out which data services are supported by the hardware
59applications can call the
60:ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl.
61All drivers implementing the sliced VBI interface must support this
62ioctl. The results may differ from those of the
63:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl when the number of VBI
64lines the hardware can capture or output per frame, or the number of
65services it can identify on a given line are limited. For example on PAL
66line 16 the hardware may be able to look for a VPS or Teletext signal,
67but not both at the same time.
68
69To determine the currently selected services applications set the
70``type`` field of struct :ref:`v4l2_format <v4l2-format>` to
71``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
72``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``, and the
73:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl fills the ``fmt.sliced``
74member, a struct
75:ref:`v4l2_sliced_vbi_format <v4l2-sliced-vbi-format>`.
76
77Applications can request different parameters by initializing or
78modifying the ``fmt.sliced`` member and calling the
79:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl with a pointer to the
80:ref:`struct v4l2_format <v4l2-format>` structure.
81
82The sliced VBI API is more complicated than the raw VBI API because the
83hardware must be told which VBI service to expect on each scan line. Not
84all services may be supported by the hardware on all lines (this is
85especially true for VBI output where Teletext is often unsupported and
86other services can only be inserted in one specific line). In many
87cases, however, it is sufficient to just set the ``service_set`` field
88to the required services and let the driver fill the ``service_lines``
89array according to hardware capabilities. Only if more precise control
90is needed should the programmer set the ``service_lines`` array
91explicitly.
92
93The :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl modifies the parameters
94according to hardware capabilities. When the driver allocates resources
95at this point, it may return an ``EBUSY`` error code if the required
96resources are temporarily unavailable. Other resource allocation points
97which may return ``EBUSY`` can be the
98:ref:`VIDIOC_STREAMON` ioctl and the first
99:ref:`read() <func-read>`, :ref:`write() <func-write>` and
100:ref:`select() <func-select>` call.
101
102
103.. _v4l2-sliced-vbi-format:
104
105struct v4l2_sliced_vbi_format
106-----------------------------
107
108.. flat-table::
109 :header-rows: 0
110 :stub-columns: 0
111 :widths: 3 3 2 2 2
112
113
114 - .. row 1
115
116 - __u32
117
118 - ``service_set``
119
120 - :cspan:`2`
121
122 If ``service_set`` is non-zero when passed with
123 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` or
124 :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`, the ``service_lines``
125 array will be filled by the driver according to the services
126 specified in this field. For example, if ``service_set`` is
127 initialized with ``V4L2_SLICED_TELETEXT_B | V4L2_SLICED_WSS_625``,
128 a driver for the cx25840 video decoder sets lines 7-22 of both
129 fields [#f1]_ to ``V4L2_SLICED_TELETEXT_B`` and line 23 of the first
130 field to ``V4L2_SLICED_WSS_625``. If ``service_set`` is set to
131 zero, then the values of ``service_lines`` will be used instead.
132
133 On return the driver sets this field to the union of all elements
134 of the returned ``service_lines`` array. It may contain less
135 services than requested, perhaps just one, if the hardware cannot
136 handle more services simultaneously. It may be empty (zero) if
137 none of the requested services are supported by the hardware.
138
139 - .. row 2
140
141 - __u16
142
143 - ``service_lines``\ [2][24]
144
145 - :cspan:`2`
146
147 Applications initialize this array with sets of data services the
148 driver shall look for or insert on the respective scan line.
149 Subject to hardware capabilities drivers return the requested set,
150 a subset, which may be just a single service, or an empty set.
151 When the hardware cannot handle multiple services on the same line
152 the driver shall choose one. No assumptions can be made on which
153 service the driver chooses.
154
155 Data services are defined in :ref:`vbi-services2`. Array indices
156 map to ITU-R line numbers (see also :ref:`vbi-525` and
157 :ref:`vbi-625`) as follows:
158
159 - .. row 3
160
161 -
162 -
163 - Element
164
165 - 525 line systems
166
167 - 625 line systems
168
169 - .. row 4
170
171 -
172 -
173 - ``service_lines``\ [0][1]
174
175 - 1
176
177 - 1
178
179 - .. row 5
180
181 -
182 -
183 - ``service_lines``\ [0][23]
184
185 - 23
186
187 - 23
188
189 - .. row 6
190
191 -
192 -
193 - ``service_lines``\ [1][1]
194
195 - 264
196
197 - 314
198
199 - .. row 7
200
201 -
202 -
203 - ``service_lines``\ [1][23]
204
205 - 286
206
207 - 336
208
209 - .. row 8
210
211 -
212 -
213 - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
214 ``service_lines``\ [1][0] to zero. The
215 ``V4L2_VBI_ITU_525_F1_START``, ``V4L2_VBI_ITU_525_F2_START``,
216 ``V4L2_VBI_ITU_625_F1_START`` and ``V4L2_VBI_ITU_625_F2_START``
217 defines give the start line numbers for each field for each 525 or
218 625 line format as a convenience. Don't forget that ITU line
219 numbering starts at 1, not 0.
220
221 - .. row 9
222
223 - __u32
224
225 - ``io_size``
226
227 - :cspan:`2` Maximum number of bytes passed by one
228 :ref:`read() <func-read>` or :ref:`write() <func-write>` call,
229 and the buffer size in bytes for the
230 :ref:`VIDIOC_QBUF` and
231 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. Drivers set this field
232 to the size of struct
233 :ref:`v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` times the
234 number of non-zero elements in the returned ``service_lines``
235 array (that is the number of lines potentially carrying data).
236
237 - .. row 10
238
239 - __u32
240
241 - ``reserved``\ [2]
242
243 - :cspan:`2` This array is reserved for future extensions.
244 Applications and drivers must set it to zero.
245
246
247
248.. _vbi-services2:
249
250Sliced VBI services
251-------------------
252
253.. flat-table::
254 :header-rows: 1
255 :stub-columns: 0
256 :widths: 2 1 1 2 2
257
258
259 - .. row 1
260
261 - Symbol
262
263 - Value
264
265 - Reference
266
267 - Lines, usually
268
269 - Payload
270
271 - .. row 2
272
273 - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
274
275 - 0x0001
276
277 - :ref:`ets300706`, :ref:`itu653`
278
279 - PAL/SECAM line 7-22, 320-335 (second field 7-22)
280
281 - Last 42 of the 45 byte Teletext packet, that is without clock
282 run-in and framing code, lsb first transmitted.
283
284 - .. row 3
285
286 - ``V4L2_SLICED_VPS``
287
288 - 0x0400
289
290 - :ref:`ets300231`
291
292 - PAL line 16
293
294 - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
295 first transmitted.
296
297 - .. row 4
298
299 - ``V4L2_SLICED_CAPTION_525``
300
301 - 0x1000
302
303 - :ref:`cea608`
304
305 - NTSC line 21, 284 (second field 21)
306
307 - Two bytes in transmission order, including parity bit, lsb first
308 transmitted.
309
310 - .. row 5
311
312 - ``V4L2_SLICED_WSS_625``
313
314 - 0x4000
315
316 - :ref:`itu1119`, :ref:`en300294`
317
318 - PAL/SECAM line 23
319
320 -
321
322 ::
323
324 Byte 0 1
325 msb lsb msb lsb
326 Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
327
328 - .. row 6
329
330 - ``V4L2_SLICED_VBI_525``
331
332 - 0x1000
333
334 - :cspan:`2` Set of services applicable to 525 line systems.
335
336 - .. row 7
337
338 - ``V4L2_SLICED_VBI_625``
339
340 - 0x4401
341
342 - :cspan:`2` Set of services applicable to 625 line systems.
343
344
345Drivers may return an ``EINVAL`` error code when applications attempt to
346read or write data without prior format negotiation, after switching the
347video standard (which may invalidate the negotiated VBI parameters) and
348after switching the video input (which may change the video standard as
349a side effect). The :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl may
350return an ``EBUSY`` error code when applications attempt to change the
351format while i/o is in progress (between a
352:ref:`VIDIOC_STREAMON` and
353:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` call, and after the first
354:ref:`read() <func-read>` or :ref:`write() <func-write>` call).
355
356
357Reading and writing sliced VBI data
358===================================
359
360A single :ref:`read() <func-read>` or :ref:`write() <func-write>`
361call must pass all data belonging to one video frame. That is an array
362of :ref:`struct v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` structures with one or
363more elements and a total size not exceeding ``io_size`` bytes. Likewise
364in streaming I/O mode one buffer of ``io_size`` bytes must contain data
365of one video frame. The ``id`` of unused
366:ref:`struct v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` elements must be zero.
367
368
369.. _v4l2-sliced-vbi-data:
370
371struct v4l2_sliced_vbi_data
372---------------------------
373
374.. flat-table::
375 :header-rows: 0
376 :stub-columns: 0
377 :widths: 3 1 4
378
379
380 - .. row 1
381
382 - __u32
383
384 - ``id``
385
386 - A flag from :ref:`vbi-services` identifying the type of data in
387 this packet. Only a single bit must be set. When the ``id`` of a
388 captured packet is zero, the packet is empty and the contents of
389 other fields are undefined. Applications shall ignore empty
390 packets. When the ``id`` of a packet for output is zero the
391 contents of the ``data`` field are undefined and the driver must
392 no longer insert data on the requested ``field`` and ``line``.
393
394 - .. row 2
395
396 - __u32
397
398 - ``field``
399
400 - The video field number this data has been captured from, or shall
401 be inserted at. ``0`` for the first field, ``1`` for the second
402 field.
403
404 - .. row 3
405
406 - __u32
407
408 - ``line``
409
410 - The field (as opposed to frame) line number this data has been
411 captured from, or shall be inserted at. See :ref:`vbi-525` and
412 :ref:`vbi-625` for valid values. Sliced VBI capture devices can
413 set the line number of all packets to ``0`` if the hardware cannot
414 reliably identify scan lines. The field number must always be
415 valid.
416
417 - .. row 4
418
419 - __u32
420
421 - ``reserved``
422
423 - This field is reserved for future extensions. Applications and
424 drivers must set it to zero.
425
426 - .. row 5
427
428 - __u8
429
430 - ``data``\ [48]
431
432 - The packet payload. See :ref:`vbi-services` for the contents and
433 number of bytes passed for each data type. The contents of padding
434 bytes at the end of this array are undefined, drivers and
435 applications shall ignore them.
436
437
438Packets are always passed in ascending line number order, without
439duplicate line numbers. The :ref:`write() <func-write>` function and
440the :ref:`VIDIOC_QBUF` ioctl must return an ``EINVAL``
441error code when applications violate this rule. They must also return an
442EINVAL error code when applications pass an incorrect field or line
443number, or a combination of ``field``, ``line`` and ``id`` which has not
444been negotiated with the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` or
445:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. When the line numbers are
446unknown the driver must pass the packets in transmitted order. The
447driver can insert empty packets with ``id`` set to zero anywhere in the
448packet array.
449
450To assure synchronization and to distinguish from frame dropping, when a
451captured frame does not carry any of the requested data services drivers
452must pass one or more empty packets. When an application fails to pass
453VBI data in time for output, the driver must output the last VPS and WSS
454packet again, and disable the output of Closed Caption and Teletext
455data, or output data which is ignored by Closed Caption and Teletext
456decoders.
457
458A sliced VBI device may support :ref:`read/write <rw>` and/or
459streaming (:ref:`memory mapping <mmap>` and/or
460:ref:`user pointer <userp>`) I/O. The latter bears the possibility of
461synchronizing video and VBI data by using buffer timestamps.
462
463
464Sliced VBI Data in MPEG Streams
465===============================
466
467If a device can produce an MPEG output stream, it may be capable of
468providing
469:ref:`negotiated sliced VBI services <sliced-vbi-format-negotitation>`
470as data embedded in the MPEG stream. Users or applications control this
471sliced VBI data insertion with the
472:ref:`V4L2_CID_MPEG_STREAM_VBI_FMT <v4l2-mpeg-stream-vbi-fmt>`
473control.
474
475If the driver does not provide the
476:ref:`V4L2_CID_MPEG_STREAM_VBI_FMT <v4l2-mpeg-stream-vbi-fmt>`
477control, or only allows that control to be set to
478:ref:`V4L2_MPEG_STREAM_VBI_FMT_NONE <v4l2-mpeg-stream-vbi-fmt>`,
479then the device cannot embed sliced VBI data in the MPEG stream.
480
481The
482:ref:`V4L2_CID_MPEG_STREAM_VBI_FMT <v4l2-mpeg-stream-vbi-fmt>`
483control does not implicitly set the device driver to capture nor cease
484capturing sliced VBI data. The control only indicates to embed sliced
485VBI data in the MPEG stream, if an application has negotiated sliced VBI
486service be captured.
487
488It may also be the case that a device can embed sliced VBI data in only
489certain types of MPEG streams: for example in an MPEG-2 PS but not an
490MPEG-2 TS. In this situation, if sliced VBI data insertion is requested,
491the sliced VBI data will be embedded in MPEG stream types when
492supported, and silently omitted from MPEG stream types where sliced VBI
493data insertion is not supported by the device.
494
495The following subsections specify the format of the embedded sliced VBI
496data.
497
498
499MPEG Stream Embedded, Sliced VBI Data Format: NONE
500--------------------------------------------------
501
502The
503:ref:`V4L2_MPEG_STREAM_VBI_FMT_NONE <v4l2-mpeg-stream-vbi-fmt>`
504embedded sliced VBI format shall be interpreted by drivers as a control
505to cease embedding sliced VBI data in MPEG streams. Neither the device
506nor driver shall insert "empty" embedded sliced VBI data packets in the
507MPEG stream when this format is set. No MPEG stream data structures are
508specified for this format.
509
510
511MPEG Stream Embedded, Sliced VBI Data Format: IVTV
512--------------------------------------------------
513
514The
515:ref:`V4L2_MPEG_STREAM_VBI_FMT_IVTV <v4l2-mpeg-stream-vbi-fmt>`
516embedded sliced VBI format, when supported, indicates to the driver to
517embed up to 36 lines of sliced VBI data per frame in an MPEG-2 *Private
518Stream 1 PES* packet encapsulated in an MPEG-2 *Program Pack* in the
519MPEG stream.
520
521*Historical context*: This format specification originates from a
522custom, embedded, sliced VBI data format used by the ``ivtv`` driver.
523This format has already been informally specified in the kernel sources
524in the file ``Documentation/video4linux/cx2341x/README.vbi`` . The
525maximum size of the payload and other aspects of this format are driven
526by the CX23415 MPEG decoder's capabilities and limitations with respect
527to extracting, decoding, and displaying sliced VBI data embedded within
528an MPEG stream.
529
530This format's use is *not* exclusive to the ``ivtv`` driver *nor*
531exclusive to CX2341x devices, as the sliced VBI data packet insertion
532into the MPEG stream is implemented in driver software. At least the
533``cx18`` driver provides sliced VBI data insertion into an MPEG-2 PS in
534this format as well.
535
536The following definitions specify the payload of the MPEG-2 *Private
537Stream 1 PES* packets that contain sliced VBI data when
538:ref:`V4L2_MPEG_STREAM_VBI_FMT_IVTV <v4l2-mpeg-stream-vbi-fmt>`
539is set. (The MPEG-2 *Private Stream 1 PES* packet header and
540encapsulating MPEG-2 *Program Pack* header are not detailed here. Please
541refer to the MPEG-2 specifications for details on those packet headers.)
542
543The payload of the MPEG-2 *Private Stream 1 PES* packets that contain
544sliced VBI data is specified by struct
545:ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>`. The
546payload is variable length, depending on the actual number of lines of
547sliced VBI data present in a video frame. The payload may be padded at
548the end with unspecified fill bytes to align the end of the payload to a
5494-byte boundary. The payload shall never exceed 1552 bytes (2 fields
550with 18 lines/field with 43 bytes of data/line and a 4 byte magic
551number).
552
553
554.. _v4l2-mpeg-vbi-fmt-ivtv:
555
556struct v4l2_mpeg_vbi_fmt_ivtv
557-----------------------------
558
559.. flat-table::
560 :header-rows: 0
561 :stub-columns: 0
562 :widths: 1 1 1 2
563
564
565 - .. row 1
566
567 - __u8
568
569 - ``magic``\ [4]
570
571 -
572 - A "magic" constant from :ref:`v4l2-mpeg-vbi-fmt-ivtv-magic` that
573 indicates this is a valid sliced VBI data payload and also
574 indicates which member of the anonymous union, ``itv0`` or
575 ``ITV0``, to use for the payload data.
576
577 - .. row 2
578
579 - union
580
581 - (anonymous)
582
583 - .. row 3
584
585 -
586 - struct :ref:`v4l2_mpeg_vbi_itv0 <v4l2-mpeg-vbi-itv0>`
587
588 - ``itv0``
589
590 - The primary form of the sliced VBI data payload that contains
591 anywhere from 1 to 35 lines of sliced VBI data. Line masks are
592 provided in this form of the payload indicating which VBI lines
593 are provided.
594
595 - .. row 4
596
597 -
598 - struct :ref:`v4l2_mpeg_vbi_ITV0 <v4l2-mpeg-vbi-itv0-1>`
599
600 - ``ITV0``
601
602 - An alternate form of the sliced VBI data payload used when 36
603 lines of sliced VBI data are present. No line masks are provided
604 in this form of the payload; all valid line mask bits are
605 implcitly set.
606
607
608
609.. _v4l2-mpeg-vbi-fmt-ivtv-magic:
610
611Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
612-------------------------------------------------------------
613
614.. flat-table::
615 :header-rows: 1
616 :stub-columns: 0
617 :widths: 3 1 4
618
619
620 - .. row 1
621
622 - Defined Symbol
623
624 - Value
625
626 - Description
627
628 - .. row 2
629
630 - ``V4L2_MPEG_VBI_IVTV_MAGIC0``
631
632 - "itv0"
633
634 - Indicates the ``itv0`` member of the union in struct
635 :ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>` is
636 valid.
637
638 - .. row 3
639
640 - ``V4L2_MPEG_VBI_IVTV_MAGIC1``
641
642 - "ITV0"
643
644 - Indicates the ``ITV0`` member of the union in struct
645 :ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>` is
646 valid and that 36 lines of sliced VBI data are present.
647
648
649
650.. _v4l2-mpeg-vbi-itv0:
651
652struct v4l2_mpeg_vbi_itv0
653-------------------------
654
655.. flat-table::
656 :header-rows: 0
657 :stub-columns: 0
658 :widths: 1 1 2
659
660
661 - .. row 1
662
663 - __le32
664
665 - ``linemask``\ [2]
666
667 - Bitmasks indicating the VBI service lines present. These
668 ``linemask`` values are stored in little endian byte order in the
669 MPEG stream. Some reference ``linemask`` bit positions with their
670 corresponding VBI line number and video field are given below.
671 b\ :sub:`0` indicates the least significant bit of a ``linemask``
672 value:
673
674
675
676 ::
677
678 linemask[0] b0: line 6 first field
679 linemask[0] b17: line 23 first field
680 linemask[0] b18: line 6 second field
681 linemask[0] b31: line 19 second field
682 linemask[1] b0: line 20 second field
683 linemask[1] b3: line 23 second field
684 linemask[1] b4-b31: unused and set to 0
685
686 - .. row 2
687
688 - struct
689 :ref:`v4l2_mpeg_vbi_itv0_line <v4l2-mpeg-vbi-itv0-line>`
690
691 - ``line``\ [35]
692
693 - This is a variable length array that holds from 1 to 35 lines of
694 sliced VBI data. The sliced VBI data lines present correspond to
695 the bits set in the ``linemask`` array, starting from b\ :sub:`0`
696 of ``linemask``\ [0] up through b\ :sub:`31` of ``linemask``\ [0],
697 and from b\ :sub:`0` of ``linemask``\ [1] up through b\ :sub:`3` of
698 ``linemask``\ [1]. ``line``\ [0] corresponds to the first bit
699 found set in the ``linemask`` array, ``line``\ [1] corresponds to
700 the second bit found set in the ``linemask`` array, etc. If no
701 ``linemask`` array bits are set, then ``line``\ [0] may contain
702 one line of unspecified data that should be ignored by
703 applications.
704
705
706
707.. _v4l2-mpeg-vbi-itv0-1:
708
709struct v4l2_mpeg_vbi_ITV0
710-------------------------
711
712.. flat-table::
713 :header-rows: 0
714 :stub-columns: 0
715 :widths: 1 1 2
716
717
718 - .. row 1
719
720 - struct
721 :ref:`v4l2_mpeg_vbi_itv0_line <v4l2-mpeg-vbi-itv0-line>`
722
723 - ``line``\ [36]
724
725 - A fixed length array of 36 lines of sliced VBI data. ``line``\ [0]
726 through ``line``\ [17] correspond to lines 6 through 23 of the
727 first field. ``line``\ [18] through ``line``\ [35] corresponds to
728 lines 6 through 23 of the second field.
729
730
731
732.. _v4l2-mpeg-vbi-itv0-line:
733
734struct v4l2_mpeg_vbi_itv0_line
735------------------------------
736
737.. flat-table::
738 :header-rows: 0
739 :stub-columns: 0
740 :widths: 1 1 2
741
742
743 - .. row 1
744
745 - __u8
746
747 - ``id``
748
749 - A line identifier value from
750 :ref:`ITV0-Line-Identifier-Constants` that indicates the type of
751 sliced VBI data stored on this line.
752
753 - .. row 2
754
755 - __u8
756
757 - ``data``\ [42]
758
759 - The sliced VBI data for the line.
760
761
762
763.. _ITV0-Line-Identifier-Constants:
764
765Line Identifiers for struct v4l2_mpeg_vbi_itv0_line id field
766------------------------------------------------------------
767
768.. flat-table::
769 :header-rows: 1
770 :stub-columns: 0
771 :widths: 3 1 4
772
773
774 - .. row 1
775
776 - Defined Symbol
777
778 - Value
779
780 - Description
781
782 - .. row 2
783
784 - ``V4L2_MPEG_VBI_IVTV_TELETEXT_B``
785
786 - 1
787
788 - Refer to :ref:`Sliced VBI services <vbi-services2>` for a
789 description of the line payload.
790
791 - .. row 3
792
793 - ``V4L2_MPEG_VBI_IVTV_CAPTION_525``
794
795 - 4
796
797 - Refer to :ref:`Sliced VBI services <vbi-services2>` for a
798 description of the line payload.
799
800 - .. row 4
801
802 - ``V4L2_MPEG_VBI_IVTV_WSS_625``
803
804 - 5
805
806 - Refer to :ref:`Sliced VBI services <vbi-services2>` for a
807 description of the line payload.
808
809 - .. row 5
810
811 - ``V4L2_MPEG_VBI_IVTV_VPS``
812
813 - 7
814
815 - Refer to :ref:`Sliced VBI services <vbi-services2>` for a
816 description of the line payload.
817
818
819
820.. [#f1]
821 According to :ref:`ETS 300 706 <ets300706>` lines 6-22 of the first
822 field and lines 5-22 of the second field may carry Teletext data.
diff --git a/Documentation/media/uapi/v4l/dev-subdev.rst b/Documentation/media/uapi/v4l/dev-subdev.rst
new file mode 100644
index 000000000000..5a112eb7a245
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev.rst
@@ -0,0 +1,491 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _subdev:
4
5********************
6Sub-device Interface
7********************
8
9The complex nature of V4L2 devices, where hardware is often made of
10several integrated circuits that need to interact with each other in a
11controlled way, leads to complex V4L2 drivers. The drivers usually
12reflect the hardware model in software, and model the different hardware
13components as software blocks called sub-devices.
14
15V4L2 sub-devices are usually kernel-only objects. If the V4L2 driver
16implements the media device API, they will automatically inherit from
17media entities. Applications will be able to enumerate the sub-devices
18and discover the hardware topology using the media entities, pads and
19links enumeration API.
20
21In addition to make sub-devices discoverable, drivers can also choose to
22make them directly configurable by applications. When both the
23sub-device driver and the V4L2 device driver support this, sub-devices
24will feature a character device node on which ioctls can be called to
25
26- query, read and write sub-devices controls
27
28- subscribe and unsubscribe to events and retrieve them
29
30- negotiate image formats on individual pads
31
32Sub-device character device nodes, conventionally named
33``/dev/v4l-subdev*``, use major number 81.
34
35
36Controls
37========
38
39Most V4L2 controls are implemented by sub-device hardware. Drivers
40usually merge all controls and expose them through video device nodes.
41Applications can control all sub-devices through a single interface.
42
43Complex devices sometimes implement the same control in different pieces
44of hardware. This situation is common in embedded platforms, where both
45sensors and image processing hardware implement identical functions,
46such as contrast adjustment, white balance or faulty pixels correction.
47As the V4L2 controls API doesn't support several identical controls in a
48single device, all but one of the identical controls are hidden.
49
50Applications can access those hidden controls through the sub-device
51node with the V4L2 control API described in :ref:`control`. The ioctls
52behave identically as when issued on V4L2 device nodes, with the
53exception that they deal only with controls implemented in the
54sub-device.
55
56Depending on the driver, those controls might also be exposed through
57one (or several) V4L2 device nodes.
58
59
60Events
61======
62
63V4L2 sub-devices can notify applications of events as described in
64:ref:`event`. The API behaves identically as when used on V4L2 device
65nodes, with the exception that it only deals with events generated by
66the sub-device. Depending on the driver, those events might also be
67reported on one (or several) V4L2 device nodes.
68
69
70.. _pad-level-formats:
71
72Pad-level Formats
73=================
74
75.. warning::
76
77 Pad-level formats are only applicable to very complex devices that
78 need to expose low-level format configuration to user space. Generic
79 V4L2 applications do *not* need to use the API described in this
80 section.
81
82.. note::
83
84 For the purpose of this section, the term *format* means the
85 combination of media bus data format, frame width and frame height.
86
87Image formats are typically negotiated on video capture and output
88devices using the format and
89:ref:`selection <VIDIOC_SUBDEV_G_SELECTION>` ioctls. The driver is
90responsible for configuring every block in the video pipeline according
91to the requested format at the pipeline input and/or output.
92
93For complex devices, such as often found in embedded systems, identical
94image sizes at the output of a pipeline can be achieved using different
95hardware configurations. One such example is shown on
96:ref:`pipeline-scaling`, where image scaling can be performed on both
97the video sensor and the host image processing hardware.
98
99
100.. _pipeline-scaling:
101
102.. figure:: dev-subdev_files/pipeline.*
103 :alt: pipeline.pdf / pipeline.png
104 :align: center
105
106 Image Format Negotiation on Pipelines
107
108 High quality and high speed pipeline configuration
109
110
111
112The sensor scaler is usually of less quality than the host scaler, but
113scaling on the sensor is required to achieve higher frame rates.
114Depending on the use case (quality vs. speed), the pipeline must be
115configured differently. Applications need to configure the formats at
116every point in the pipeline explicitly.
117
118Drivers that implement the :ref:`media API <media-controller-intro>`
119can expose pad-level image format configuration to applications. When
120they do, applications can use the
121:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and
122:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls. to
123negotiate formats on a per-pad basis.
124
125Applications are responsible for configuring coherent parameters on the
126whole pipeline and making sure that connected pads have compatible
127formats. The pipeline is checked for formats mismatch at
128:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` time, and an ``EPIPE`` error
129code is then returned if the configuration is invalid.
130
131Pad-level image format configuration support can be tested by calling
132the :ref:`VIDIOC_SUBDEV_G_FMT` ioctl on pad
1330. If the driver returns an ``EINVAL`` error code pad-level format
134configuration is not supported by the sub-device.
135
136
137Format Negotiation
138------------------
139
140Acceptable formats on pads can (and usually do) depend on a number of
141external parameters, such as formats on other pads, active links, or
142even controls. Finding a combination of formats on all pads in a video
143pipeline, acceptable to both application and driver, can't rely on
144formats enumeration only. A format negotiation mechanism is required.
145
146Central to the format negotiation mechanism are the get/set format
147operations. When called with the ``which`` argument set to
148:ref:`V4L2_SUBDEV_FORMAT_TRY <VIDIOC_SUBDEV_G_FMT>`, the
149:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and
150:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls operate on
151a set of formats parameters that are not connected to the hardware
152configuration. Modifying those 'try' formats leaves the device state
153untouched (this applies to both the software state stored in the driver
154and the hardware state stored in the device itself).
155
156While not kept as part of the device state, try formats are stored in
157the sub-device file handles. A
158:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` call will return
159the last try format set *on the same sub-device file handle*. Several
160applications querying the same sub-device at the same time will thus not
161interact with each other.
162
163To find out whether a particular format is supported by the device,
164applications use the
165:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctl. Drivers
166verify and, if needed, change the requested ``format`` based on device
167requirements and return the possibly modified value. Applications can
168then choose to try a different format or accept the returned value and
169continue.
170
171Formats returned by the driver during a negotiation iteration are
172guaranteed to be supported by the device. In particular, drivers
173guarantee that a returned format will not be further changed if passed
174to an :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` call as-is
175(as long as external parameters, such as formats on other pads or links'
176configuration are not changed).
177
178Drivers automatically propagate formats inside sub-devices. When a try
179or active format is set on a pad, corresponding formats on other pads of
180the same sub-device can be modified by the driver. Drivers are free to
181modify formats as required by the device. However, they should comply
182with the following rules when possible:
183
184- Formats should be propagated from sink pads to source pads. Modifying
185 a format on a source pad should not modify the format on any sink
186 pad.
187
188- Sub-devices that scale frames using variable scaling factors should
189 reset the scale factors to default values when sink pads formats are
190 modified. If the 1:1 scaling ratio is supported, this means that
191 source pads formats should be reset to the sink pads formats.
192
193Formats are not propagated across links, as that would involve
194propagating them from one sub-device file handle to another.
195Applications must then take care to configure both ends of every link
196explicitly with compatible formats. Identical formats on the two ends of
197a link are guaranteed to be compatible. Drivers are free to accept
198different formats matching device requirements as being compatible.
199
200:ref:`sample-pipeline-config` shows a sample configuration sequence
201for the pipeline described in :ref:`pipeline-scaling` (table columns
202list entity names and pad numbers).
203
204
205.. _sample-pipeline-config:
206
207.. flat-table:: Sample Pipeline Configuration
208 :header-rows: 1
209 :stub-columns: 0
210
211
212 - .. row 1
213
214 -
215 - Sensor/0 format
216
217 - Frontend/0 format
218
219 - Frontend/1 format
220
221 - Scaler/0 format
222
223 - Scaler/0 compose selection rectangle
224
225 - Scaler/1 format
226
227 - .. row 2
228
229 - Initial state
230
231 - 2048x1536/SGRBG8_1X8
232
233 - (default)
234
235 - (default)
236
237 - (default)
238
239 - (default)
240
241 - (default)
242
243 - .. row 3
244
245 - Configure frontend sink format
246
247 - 2048x1536/SGRBG8_1X8
248
249 - *2048x1536/SGRBG8_1X8*
250
251 - *2046x1534/SGRBG8_1X8*
252
253 - (default)
254
255 - (default)
256
257 - (default)
258
259 - .. row 4
260
261 - Configure scaler sink format
262
263 - 2048x1536/SGRBG8_1X8
264
265 - 2048x1536/SGRBG8_1X8
266
267 - 2046x1534/SGRBG8_1X8
268
269 - *2046x1534/SGRBG8_1X8*
270
271 - *0,0/2046x1534*
272
273 - *2046x1534/SGRBG8_1X8*
274
275 - .. row 5
276
277 - Configure scaler sink compose selection
278
279 - 2048x1536/SGRBG8_1X8
280
281 - 2048x1536/SGRBG8_1X8
282
283 - 2046x1534/SGRBG8_1X8
284
285 - 2046x1534/SGRBG8_1X8
286
287 - *0,0/1280x960*
288
289 - *1280x960/SGRBG8_1X8*
290
291
292
2931. Initial state. The sensor source pad format is set to its native 3MP
294 size and V4L2_MBUS_FMT_SGRBG8_1X8 media bus code. Formats on the
295 host frontend and scaler sink and source pads have the default
296 values, as well as the compose rectangle on the scaler's sink pad.
297
2982. The application configures the frontend sink pad format's size to
299 2048x1536 and its media bus code to V4L2_MBUS_FMT_SGRBG_1X8. The
300 driver propagates the format to the frontend source pad.
301
3023. The application configures the scaler sink pad format's size to
303 2046x1534 and the media bus code to V4L2_MBUS_FMT_SGRBG_1X8 to
304 match the frontend source size and media bus code. The media bus code
305 on the sink pad is set to V4L2_MBUS_FMT_SGRBG_1X8. The driver
306 propagates the size to the compose selection rectangle on the
307 scaler's sink pad, and the format to the scaler source pad.
308
3094. The application configures the size of the compose selection
310 rectangle of the scaler's sink pad 1280x960. The driver propagates
311 the size to the scaler's source pad format.
312
313When satisfied with the try results, applications can set the active
314formats by setting the ``which`` argument to
315``V4L2_SUBDEV_FORMAT_ACTIVE``. Active formats are changed exactly as try
316formats by drivers. To avoid modifying the hardware state during format
317negotiation, applications should negotiate try formats first and then
318modify the active settings using the try formats returned during the
319last negotiation iteration. This guarantees that the active format will
320be applied as-is by the driver without being modified.
321
322
323.. _v4l2-subdev-selections:
324
325Selections: cropping, scaling and composition
326---------------------------------------------
327
328Many sub-devices support cropping frames on their input or output pads
329(or possible even on both). Cropping is used to select the area of
330interest in an image, typically on an image sensor or a video decoder.
331It can also be used as part of digital zoom implementations to select
332the area of the image that will be scaled up.
333
334Crop settings are defined by a crop rectangle and represented in a
335struct :ref:`v4l2_rect <v4l2-rect>` by the coordinates of the top
336left corner and the rectangle size. Both the coordinates and sizes are
337expressed in pixels.
338
339As for pad formats, drivers store try and active rectangles for the
340selection targets :ref:`v4l2-selections-common`.
341
342On sink pads, cropping is applied relative to the current pad format.
343The pad format represents the image size as received by the sub-device
344from the previous block in the pipeline, and the crop rectangle
345represents the sub-image that will be transmitted further inside the
346sub-device for processing.
347
348The scaling operation changes the size of the image by scaling it to new
349dimensions. The scaling ratio isn't specified explicitly, but is implied
350from the original and scaled image sizes. Both sizes are represented by
351struct :ref:`v4l2_rect <v4l2-rect>`.
352
353Scaling support is optional. When supported by a subdev, the crop
354rectangle on the subdev's sink pad is scaled to the size configured
355using the
356:ref:`VIDIOC_SUBDEV_S_SELECTION <VIDIOC_SUBDEV_G_SELECTION>` IOCTL
357using ``V4L2_SEL_TGT_COMPOSE`` selection target on the same pad. If the
358subdev supports scaling but not composing, the top and left values are
359not used and must always be set to zero.
360
361On source pads, cropping is similar to sink pads, with the exception
362that the source size from which the cropping is performed, is the
363COMPOSE rectangle on the sink pad. In both sink and source pads, the
364crop rectangle must be entirely contained inside the source image size
365for the crop operation.
366
367The drivers should always use the closest possible rectangle the user
368requests on all selection targets, unless specifically told otherwise.
369``V4L2_SEL_FLAG_GE`` and ``V4L2_SEL_FLAG_LE`` flags may be used to round
370the image size either up or down. :ref:`v4l2-selection-flags`
371
372
373Types of selection targets
374--------------------------
375
376
377Actual targets
378^^^^^^^^^^^^^^
379
380Actual targets (without a postfix) reflect the actual hardware
381configuration at any point of time. There is a BOUNDS target
382corresponding to every actual target.
383
384
385BOUNDS targets
386^^^^^^^^^^^^^^
387
388BOUNDS targets is the smallest rectangle that contains all valid actual
389rectangles. It may not be possible to set the actual rectangle as large
390as the BOUNDS rectangle, however. This may be because e.g. a sensor's
391pixel array is not rectangular but cross-shaped or round. The maximum
392size may also be smaller than the BOUNDS rectangle.
393
394
395Order of configuration and format propagation
396---------------------------------------------
397
398Inside subdevs, the order of image processing steps will always be from
399the sink pad towards the source pad. This is also reflected in the order
400in which the configuration must be performed by the user: the changes
401made will be propagated to any subsequent stages. If this behaviour is
402not desired, the user must set ``V4L2_SEL_FLAG_KEEP_CONFIG`` flag. This
403flag causes no propagation of the changes are allowed in any
404circumstances. This may also cause the accessed rectangle to be adjusted
405by the driver, depending on the properties of the underlying hardware.
406
407The coordinates to a step always refer to the actual size of the
408previous step. The exception to this rule is the source compose
409rectangle, which refers to the sink compose bounds rectangle --- if it
410is supported by the hardware.
411
4121. Sink pad format. The user configures the sink pad format. This format
413 defines the parameters of the image the entity receives through the
414 pad for further processing.
415
4162. Sink pad actual crop selection. The sink pad crop defines the crop
417 performed to the sink pad format.
418
4193. Sink pad actual compose selection. The size of the sink pad compose
420 rectangle defines the scaling ratio compared to the size of the sink
421 pad crop rectangle. The location of the compose rectangle specifies
422 the location of the actual sink compose rectangle in the sink compose
423 bounds rectangle.
424
4254. Source pad actual crop selection. Crop on the source pad defines crop
426 performed to the image in the sink compose bounds rectangle.
427
4285. Source pad format. The source pad format defines the output pixel
429 format of the subdev, as well as the other parameters with the
430 exception of the image width and height. Width and height are defined
431 by the size of the source pad actual crop selection.
432
433Accessing any of the above rectangles not supported by the subdev will
434return ``EINVAL``. Any rectangle referring to a previous unsupported
435rectangle coordinates will instead refer to the previous supported
436rectangle. For example, if sink crop is not supported, the compose
437selection will refer to the sink pad format dimensions instead.
438
439
440.. _subdev-image-processing-crop:
441
442.. figure:: dev-subdev_files/subdev-image-processing-crop.*
443 :alt: subdev-image-processing-crop.svg
444 :align: center
445
446 **Figure 4.5. Image processing in subdevs: simple crop example**
447
448In the above example, the subdev supports cropping on its sink pad. To
449configure it, the user sets the media bus format on the subdev's sink
450pad. Now the actual crop rectangle can be set on the sink pad --- the
451location and size of this rectangle reflect the location and size of a
452rectangle to be cropped from the sink format. The size of the sink crop
453rectangle will also be the size of the format of the subdev's source
454pad.
455
456
457.. _subdev-image-processing-scaling-multi-source:
458
459.. figure:: dev-subdev_files/subdev-image-processing-scaling-multi-source.*
460 :alt: subdev-image-processing-scaling-multi-source.svg
461 :align: center
462
463 **Figure 4.6. Image processing in subdevs: scaling with multiple sources**
464
465In this example, the subdev is capable of first cropping, then scaling
466and finally cropping for two source pads individually from the resulting
467scaled image. The location of the scaled image in the cropped image is
468ignored in sink compose target. Both of the locations of the source crop
469rectangles refer to the sink scaling rectangle, independently cropping
470an area at location specified by the source crop rectangle from it.
471
472
473.. _subdev-image-processing-full:
474
475.. figure:: dev-subdev_files/subdev-image-processing-full.*
476 :alt: subdev-image-processing-full.svg
477 :align: center
478
479 **Figure 4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources**
480
481The subdev driver supports two sink pads and two source pads. The images
482from both of the sink pads are individually cropped, then scaled and
483further composed on the composition bounds rectangle. From that, two
484independent streams are cropped and sent out of the subdev from the
485source pads.
486
487
488.. toctree::
489 :maxdepth: 1
490
491 subdev-formats
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf
new file mode 100644
index 000000000000..ee3e37f04b6a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.png b/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.png
new file mode 100644
index 000000000000..f19b86c2c24d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.png
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf
new file mode 100644
index 000000000000..29a806f839b4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg
new file mode 100644
index 000000000000..18b0f5de9ed2
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg
@@ -0,0 +1,63 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
3<svg width="43cm" height="10cm" viewBox="-194 128 844 196" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="-8" y="130" width="469.774" height="193"/>
5 <g>
6 <rect style="fill: #ffffff" x="4.5" y="189" width="159" height="104"/>
7 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a52a2a" x="4.5" y="189" width="159" height="104"/>
8 </g>
9 <g>
10 <rect style="fill: #ffffff" x="63.5" y="211" width="94" height="77"/>
11 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x="63.5" y="211" width="94" height="77"/>
12 </g>
13 <text style="fill: #0000ff;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="74.5" y="227.75">
14 <tspan x="74.5" y="227.75">sink</tspan>
15 <tspan x="74.5" y="243.75">crop</tspan>
16 <tspan x="74.5" y="259.75">selection</tspan>
17 </text>
18 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="29.5" y="158">
19 <tspan x="29.5" y="158"></tspan>
20 </text>
21 <text style="fill: #a52a2a;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="8.53836" y="157.914">
22 <tspan x="8.53836" y="157.914">sink media</tspan>
23 <tspan x="8.53836" y="173.914">bus format</tspan>
24 </text>
25 <text style="fill: #8b6914;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="349.774" y="155">
26 <tspan x="349.774" y="155">source media</tspan>
27 <tspan x="349.774" y="171">bus format</tspan>
28 </text>
29 <g>
30 <rect style="fill: #ffffff" x="350.488" y="190.834" width="93.2863" height="75.166"/>
31 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #8b6914" x="350.488" y="190.834" width="93.2863" height="75.166"/>
32 </g>
33 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="350.488" y1="266" x2="63.5" y2="288"/>
34 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="350.488" y1="190.834" x2="63.5" y2="211"/>
35 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="443.774" y1="266" x2="157.5" y2="288"/>
36 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="443.774" y1="190.834" x2="157.5" y2="211"/>
37 <g>
38 <ellipse style="fill: #ffffff" cx="473.1" cy="219.984" rx="8.5" ry="8.5"/>
39 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="473.1" cy="219.984" rx="8.5" ry="8.5"/>
40 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="473.1" cy="219.984" rx="8.5" ry="8.5"/>
41 </g>
42 <g>
43 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="481.6" y1="219.984" x2="637.934" y2="220.012"/>
44 <polygon style="fill: #000000" points="645.434,220.014 635.433,225.012 637.934,220.012 635.435,215.012 "/>
45 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="645.434,220.014 635.433,225.012 637.934,220.012 635.435,215.012 "/>
46 </g>
47 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="506.908" y="209.8">
48 <tspan x="506.908" y="209.8">pad 1 (source)</tspan>
49 </text>
50 <g>
51 <ellipse style="fill: #ffffff" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
52 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
53 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
54 </g>
55 <g>
56 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="-192.398" y1="241.8" x2="-38.6343" y2="241.529"/>
57 <polygon style="fill: #000000" points="-31.1343,241.516 -41.1254,246.534 -38.6343,241.529 -41.1431,236.534 "/>
58 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="-31.1343,241.516 -41.1254,246.534 -38.6343,241.529 -41.1431,236.534 "/>
59 </g>
60 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="-147.858" y="229.8">
61 <tspan x="-147.858" y="229.8">pad 0 (sink)</tspan>
62 </text>
63</svg>
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf
new file mode 100644
index 000000000000..b78a8e8f6b35
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg
new file mode 100644
index 000000000000..3322cf4c0093
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg
@@ -0,0 +1,163 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
3<svg width="59cm" height="18cm" viewBox="-186 71 1178 346" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4 <g>
5 <rect style="fill: #ffffff" x="318.9" y="129" width="208.1" height="249"/>
6 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff765a" x="318.9" y="129" width="208.1" height="249"/>
7 </g>
8 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="-2" y="73" width="806" height="343"/>
9 <g>
10 <ellipse style="fill: #ffffff" cx="-12.5" cy="166.712" rx="8.5" ry="8.5"/>
11 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-12.5" cy="166.712" rx="8.5" ry="8.5"/>
12 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-12.5" cy="166.712" rx="8.5" ry="8.5"/>
13 </g>
14 <g>
15 <ellipse style="fill: #ffffff" cx="815.232" cy="205.184" rx="8.5" ry="8.5"/>
16 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="815.232" cy="205.184" rx="8.5" ry="8.5"/>
17 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="815.232" cy="205.184" rx="8.5" ry="8.5"/>
18 </g>
19 <g>
20 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="-184.5" y1="167" x2="-30.7361" y2="166.729"/>
21 <polygon style="fill: #000000" points="-23.2361,166.716 -33.2272,171.734 -30.7361,166.729 -33.2449,161.734 "/>
22 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="-23.2361,166.716 -33.2272,171.734 -30.7361,166.729 -33.2449,161.734 "/>
23 </g>
24 <g>
25 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="823.732" y1="205.184" x2="980.066" y2="205.212"/>
26 <polygon style="fill: #000000" points="987.566,205.214 977.565,210.212 980.066,205.212 977.567,200.212 "/>
27 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="987.566,205.214 977.565,210.212 980.066,205.212 977.567,200.212 "/>
28 </g>
29 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="-139.96" y="155">
30 <tspan x="-139.96" y="155">pad 0 (sink)</tspan>
31 </text>
32 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="849.04" y="195">
33 <tspan x="849.04" y="195">pad 2 (source)</tspan>
34 </text>
35 <g>
36 <rect style="fill: #ffffff" x="5.5" y="120" width="159" height="104"/>
37 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a52a2a" x="5.5" y="120" width="159" height="104"/>
38 </g>
39 <g>
40 <rect style="fill: #ffffff" x="62.5" y="136" width="94" height="77"/>
41 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x="62.5" y="136" width="94" height="77"/>
42 </g>
43 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="30.5" y="89">
44 <tspan x="30.5" y="89"></tspan>
45 </text>
46 <text style="fill: #a52a2a;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="9.53836" y="88.9138">
47 <tspan x="9.53836" y="88.9138">sink media</tspan>
48 <tspan x="9.53836" y="104.914">bus format</tspan>
49 </text>
50 <g>
51 <rect style="fill: #ffffff" x="333.644" y="185.65" width="165.2" height="172.478"/>
52 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #00ff00" x="333.644" y="185.65" width="165.2" height="172.478"/>
53 </g>
54 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="333.644" y1="358.128" x2="62.5" y2="213"/>
55 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="333.644" y1="185.65" x2="62.5" y2="136"/>
56 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="498.844" y1="358.128" x2="156.5" y2="213"/>
57 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="498.844" y1="185.65" x2="156.5" y2="136"/>
58 <text style="fill: #00ff00;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="334.704" y="149.442">
59 <tspan x="334.704" y="149.442">sink compose</tspan>
60 <tspan x="334.704" y="165.442">selection (scaling)</tspan>
61 </text>
62 <g>
63 <rect style="fill: #ffffff" x="409.322" y="194.565" width="100.186" height="71.4523"/>
64 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x="409.322" y="194.565" width="100.186" height="71.4523"/>
65 </g>
66 <text style="fill: #8b6914;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="689.5" y="105.128">
67 <tspan x="689.5" y="105.128">source media</tspan>
68 <tspan x="689.5" y="121.128">bus format</tspan>
69 </text>
70 <g>
71 <rect style="fill: #ffffff" x="688.488" y="173.834" width="100.186" height="71.4523"/>
72 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #8b6914" x="688.488" y="173.834" width="100.186" height="71.4523"/>
73 </g>
74 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="688.488" y1="245.286" x2="409.322" y2="266.018"/>
75 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="688.488" y1="173.834" x2="409.322" y2="194.565"/>
76 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="788.674" y1="245.286" x2="509.508" y2="266.018"/>
77 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="788.674" y1="173.834" x2="509.508" y2="194.565"/>
78 <text style="fill: #ff765a;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="325" y="103">
79 <tspan x="325" y="103">sink compose</tspan>
80 <tspan x="325" y="119">bounds selection</tspan>
81 </text>
82 <g>
83 <ellipse style="fill: #ffffff" cx="-12.0982" cy="341.512" rx="8.5" ry="8.5"/>
84 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-12.0982" cy="341.512" rx="8.5" ry="8.5"/>
85 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-12.0982" cy="341.512" rx="8.5" ry="8.5"/>
86 </g>
87 <g>
88 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="-184.098" y1="341.8" x2="-30.3343" y2="341.529"/>
89 <polygon style="fill: #000000" points="-22.8343,341.516 -32.8254,346.534 -30.3343,341.529 -32.8431,336.534 "/>
90 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="-22.8343,341.516 -32.8254,346.534 -30.3343,341.529 -32.8431,336.534 "/>
91 </g>
92 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="-139" y="329">
93 <tspan x="-139" y="329">pad 1 (sink)</tspan>
94 </text>
95 <g>
96 <rect style="fill: #ffffff" x="7.80824" y="292.8" width="112.092" height="82.2"/>
97 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a52a2a" x="7.80824" y="292.8" width="112.092" height="82.2"/>
98 </g>
99 <g>
100 <rect style="fill: #ffffff" x="52.9" y="314.8" width="58.1" height="50.2"/>
101 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x="52.9" y="314.8" width="58.1" height="50.2"/>
102 </g>
103 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="31.9" y="259.8">
104 <tspan x="31.9" y="259.8"></tspan>
105 </text>
106 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="358.9" y1="251.9" x2="52.9" y2="314.8"/>
107 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="358.9" y1="316" x2="52.9" y2="365"/>
108 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="434" y1="316" x2="111" y2="365"/>
109 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="434" y1="251.9" x2="111" y2="314.8"/>
110 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #00ff00" x="358.9" y="251.9" width="75.1" height="64.1"/>
111 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x="443.262" y="284.466" width="64.738" height="48.534"/>
112 <g>
113 <rect style="fill: #ffffff" x="693.428" y="324.734" width="63.572" height="49.266"/>
114 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #8b6914" x="693.428" y="324.734" width="63.572" height="49.266"/>
115 </g>
116 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="693.428" y1="374" x2="443.262" y2="333"/>
117 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="693.428" y1="324.734" x2="443.262" y2="284.466"/>
118 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="757" y1="374" x2="508" y2="333"/>
119 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="757" y1="324.734" x2="508" y2="284.466"/>
120 <g>
121 <ellipse style="fill: #ffffff" cx="815.44" cy="343.984" rx="8.5" ry="8.5"/>
122 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="815.44" cy="343.984" rx="8.5" ry="8.5"/>
123 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="815.44" cy="343.984" rx="8.5" ry="8.5"/>
124 </g>
125 <g>
126 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="823.94" y1="343.984" x2="980.274" y2="344.012"/>
127 <polygon style="fill: #000000" points="987.774,344.014 977.773,349.012 980.274,344.012 977.775,339.012 "/>
128 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="987.774,344.014 977.773,349.012 980.274,344.012 977.775,339.012 "/>
129 </g>
130 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="849.248" y="333.8">
131 <tspan x="849.248" y="333.8">pad 3 (source)</tspan>
132 </text>
133 <text style="fill: #0000ff;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="197" y="91">
134 <tspan x="197" y="91">sink</tspan>
135 <tspan x="197" y="107">crop</tspan>
136 <tspan x="197" y="123">selection</tspan>
137 </text>
138 <text style="fill: #a020f0;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="553" y="95">
139 <tspan x="553" y="95">source</tspan>
140 <tspan x="553" y="111">crop</tspan>
141 <tspan x="553" y="127">selection</tspan>
142 </text>
143 <g>
144 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x1="211" y1="132" x2="166.21" y2="135.287"/>
145 <polygon style="fill: #0000ff" points="158.73,135.836 168.337,130.118 166.21,135.287 169.069,140.091 "/>
146 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" points="158.73,135.836 168.337,130.118 166.21,135.287 169.069,140.091 "/>
147 </g>
148 <g>
149 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x1="209" y1="131" x2="115.581" y2="306.209"/>
150 <polygon style="fill: #0000ff" points="112.052,312.827 112.345,301.65 115.581,306.209 121.169,306.355 "/>
151 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" points="112.052,312.827 112.345,301.65 115.581,306.209 121.169,306.355 "/>
152 </g>
153 <g>
154 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x1="550.492" y1="133.214" x2="514.916" y2="186.469"/>
155 <polygon style="fill: #a020f0" points="510.75,192.706 512.147,181.613 514.916,186.469 520.463,187.168 "/>
156 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" points="510.75,192.706 512.147,181.613 514.916,186.469 520.463,187.168 "/>
157 </g>
158 <g>
159 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x1="550.072" y1="133.787" x2="510.618" y2="275.089"/>
160 <polygon style="fill: #a020f0" points="508.601,282.312 506.475,271.336 510.618,275.089 516.106,274.025 "/>
161 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" points="508.601,282.312 506.475,271.336 510.618,275.089 516.106,274.025 "/>
162 </g>
163</svg>
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf
new file mode 100644
index 000000000000..8f7a95b6eb4d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg
new file mode 100644
index 000000000000..2340c0f8bc92
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg
@@ -0,0 +1,116 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
3<svg width="59cm" height="17cm" viewBox="-194 128 1179 330" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="-8" y="130" width="806" height="327"/>
5 <g>
6 <rect style="fill: #ffffff" x="4.5" y="189" width="159" height="104"/>
7 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a52a2a" x="4.5" y="189" width="159" height="104"/>
8 </g>
9 <g>
10 <rect style="fill: #ffffff" x="49.5" y="204" width="94" height="77"/>
11 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #0000ff" x="49.5" y="204" width="94" height="77"/>
12 </g>
13 <text style="fill: #0000ff;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="60" y="224">
14 <tspan x="60" y="224">sink</tspan>
15 <tspan x="60" y="240">crop</tspan>
16 <tspan x="60" y="256">selection</tspan>
17 </text>
18 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="29.5" y="158">
19 <tspan x="29.5" y="158"></tspan>
20 </text>
21 <text style="fill: #a52a2a;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="8.53836" y="157.914">
22 <tspan x="8.53836" y="157.914">sink media</tspan>
23 <tspan x="8.53836" y="173.914">bus format</tspan>
24 </text>
25 <g>
26 <rect style="fill: #ffffff" x="333.644" y="185.65" width="165.2" height="172.478"/>
27 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #00ff00" x="333.644" y="185.65" width="165.2" height="172.478"/>
28 </g>
29 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="333.644" y1="358.128" x2="49.5" y2="281"/>
30 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="333.644" y1="185.65" x2="49.5" y2="204"/>
31 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="498.844" y1="358.128" x2="143.5" y2="281"/>
32 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="498.844" y1="185.65" x2="143.5" y2="204"/>
33 <text style="fill: #00ff00;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="334.704" y="149.442">
34 <tspan x="334.704" y="149.442">sink compose</tspan>
35 <tspan x="334.704" y="165.442">selection (scaling)</tspan>
36 </text>
37 <g>
38 <rect style="fill: #ffffff" x="382.322" y="199.565" width="100.186" height="71.4523"/>
39 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x="382.322" y="199.565" width="100.186" height="71.4523"/>
40 </g>
41 <text style="fill: #a020f0;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="543.322" y="149.442">
42 <tspan x="543.322" y="149.442">source</tspan>
43 <tspan x="543.322" y="165.442">crop</tspan>
44 <tspan x="543.322" y="181.442">selection</tspan>
45 </text>
46 <text style="fill: #8b6914;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="691.5" y="157.128">
47 <tspan x="691.5" y="157.128">source media</tspan>
48 <tspan x="691.5" y="173.128">bus format</tspan>
49 </text>
50 <g>
51 <rect style="fill: #ffffff" x="690.488" y="225.834" width="100.186" height="71.4523"/>
52 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #8b6914" x="690.488" y="225.834" width="100.186" height="71.4523"/>
53 </g>
54 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="690.488" y1="297.286" x2="382.322" y2="271.018"/>
55 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="690.488" y1="225.834" x2="382.322" y2="199.565"/>
56 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="790.674" y1="297.286" x2="482.508" y2="271.018"/>
57 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="790.674" y1="225.834" x2="482.508" y2="199.565"/>
58 <g>
59 <ellipse style="fill: #ffffff" cx="808.1" cy="249.984" rx="8.5" ry="8.5"/>
60 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="808.1" cy="249.984" rx="8.5" ry="8.5"/>
61 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="808.1" cy="249.984" rx="8.5" ry="8.5"/>
62 </g>
63 <g>
64 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="816.6" y1="249.984" x2="972.934" y2="250.012"/>
65 <polygon style="fill: #000000" points="980.434,250.014 970.433,255.012 972.934,250.012 970.435,245.012 "/>
66 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="980.434,250.014 970.433,255.012 972.934,250.012 970.435,245.012 "/>
67 </g>
68 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="841.908" y="239.8">
69 <tspan x="841.908" y="239.8">pad 1 (source)</tspan>
70 </text>
71 <g>
72 <ellipse style="fill: #ffffff" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
73 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
74 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="-20.3982" cy="241.512" rx="8.5" ry="8.5"/>
75 </g>
76 <g>
77 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="-192.398" y1="241.8" x2="-38.6343" y2="241.529"/>
78 <polygon style="fill: #000000" points="-31.1343,241.516 -41.1254,246.534 -38.6343,241.529 -41.1431,236.534 "/>
79 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="-31.1343,241.516 -41.1254,246.534 -38.6343,241.529 -41.1431,236.534 "/>
80 </g>
81 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="-147.858" y="229.8">
82 <tspan x="-147.858" y="229.8">pad 0 (sink)</tspan>
83 </text>
84 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x="389.822" y="276.666" width="100.186" height="71.4523"/>
85 <g>
86 <rect style="fill: #ffffff" x="689.988" y="345.934" width="100.186" height="71.4523"/>
87 <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #8b6914" x="689.988" y="345.934" width="100.186" height="71.4523"/>
88 </g>
89 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="689.988" y1="417.386" x2="389.822" y2="348.118"/>
90 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="689.988" y1="345.934" x2="389.822" y2="276.666"/>
91 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="790.174" y1="417.386" x2="490.008" y2="348.118"/>
92 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #e60505" x1="790.174" y1="345.934" x2="490.008" y2="276.666"/>
93 <g>
94 <ellipse style="fill: #ffffff" cx="805.6" cy="384.084" rx="8.5" ry="8.5"/>
95 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="805.6" cy="384.084" rx="8.5" ry="8.5"/>
96 <ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="805.6" cy="384.084" rx="8.5" ry="8.5"/>
97 </g>
98 <g>
99 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x1="814.1" y1="384.084" x2="970.434" y2="384.112"/>
100 <polygon style="fill: #000000" points="977.934,384.114 967.933,389.112 970.434,384.112 967.935,379.112 "/>
101 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="977.934,384.114 967.933,389.112 970.434,384.112 967.935,379.112 "/>
102 </g>
103 <text style="fill: #000000;text-anchor:start;font-size:12.8;font-family:sanserif;font-style:normal;font-weight:normal" x="839.408" y="373.9">
104 <tspan x="839.408" y="373.9">pad 2 (source)</tspan>
105 </text>
106 <g>
107 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x1="546" y1="191" x2="492.157" y2="198.263"/>
108 <polygon style="fill: #a020f0" points="484.724,199.266 493.966,192.974 492.157,198.263 495.303,202.884 "/>
109 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" points="484.724,199.266 493.966,192.974 492.157,198.263 495.303,202.884 "/>
110 </g>
111 <g>
112 <line style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" x1="546.908" y1="190.725" x2="495.383" y2="268.548"/>
113 <polygon style="fill: #a020f0" points="491.242,274.802 492.594,263.703 495.383,268.548 500.932,269.224 "/>
114 <polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #a020f0" points="491.242,274.802 492.594,263.703 495.383,268.548 500.932,269.224 "/>
115 </g>
116</svg>
diff --git a/Documentation/media/uapi/v4l/dev-teletext.rst b/Documentation/media/uapi/v4l/dev-teletext.rst
new file mode 100644
index 000000000000..2648f6b37ea3
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-teletext.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _ttx:
4
5******************
6Teletext Interface
7******************
8
9This interface was aimed at devices receiving and demodulating Teletext
10data [:ref:`ets300706`, :ref:`itu653`], evaluating the Teletext
11packages and storing formatted pages in cache memory. Such devices are
12usually implemented as microcontrollers with serial interface
13(I:sup:`2`\ C) and could be found on old TV cards, dedicated Teletext
14decoding cards and home-brew devices connected to the PC parallel port.
15
16The Teletext API was designed by Martin Buck. It was defined in the
17kernel header file ``linux/videotext.h``, the specification is available
18from
19`ftp://ftp.gwdg.de/pub/linux/misc/videotext/ <ftp://ftp.gwdg.de/pub/linux/misc/videotext/>`__.
20(Videotext is the name of the German public television Teletext
21service.)
22
23Eventually the Teletext API was integrated into the V4L API with
24character device file names ``/dev/vtx0`` to ``/dev/vtx31``, device
25major number 81, minor numbers 192 to 223.
26
27However, teletext decoders were quickly replaced by more generic VBI
28demodulators and those dedicated teletext decoders no longer exist. For
29many years the vtx devices were still around, even though nobody used
30them. So the decision was made to finally remove support for the
31Teletext API in kernel 2.6.37.
32
33Modern devices all use the :ref:`raw <raw-vbi>` or
34:ref:`sliced` VBI API.
diff --git a/Documentation/media/uapi/v4l/devices.rst b/Documentation/media/uapi/v4l/devices.rst
new file mode 100644
index 000000000000..aed0ce11d1f8
--- /dev/null
+++ b/Documentation/media/uapi/v4l/devices.rst
@@ -0,0 +1,26 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _devices:
4
5**********
6Interfaces
7**********
8
9
10.. toctree::
11 :maxdepth: 1
12
13 dev-capture
14 dev-overlay
15 dev-output
16 dev-osd
17 dev-codec
18 dev-effect
19 dev-raw-vbi
20 dev-sliced-vbi
21 dev-teletext
22 dev-radio
23 dev-rds
24 dev-sdr
25 dev-event
26 dev-subdev
diff --git a/Documentation/media/uapi/v4l/diff-v4l.rst b/Documentation/media/uapi/v4l/diff-v4l.rst
new file mode 100644
index 000000000000..e1e034df514c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/diff-v4l.rst
@@ -0,0 +1,954 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _diff-v4l:
4
5********************************
6Differences between V4L and V4L2
7********************************
8
9The Video For Linux API was first introduced in Linux 2.1 to unify and
10replace various TV and radio device related interfaces, developed
11independently by driver writers in prior years. Starting with Linux 2.5
12the much improved V4L2 API replaces the V4L API. The support for the old
13V4L calls were removed from Kernel, but the library :ref:`libv4l`
14supports the conversion of a V4L API system call into a V4L2 one.
15
16
17Opening and Closing Devices
18===========================
19
20For compatibility reasons the character device file names recommended
21for V4L2 video capture, overlay, radio and raw vbi capture devices did
22not change from those used by V4L. They are listed in :ref:`devices`
23and below in :ref:`v4l-dev`.
24
25The teletext devices (minor range 192-223) have been removed in V4L2 and
26no longer exist. There is no hardware available anymore for handling
27pure teletext. Instead raw or sliced VBI is used.
28
29The V4L ``videodev`` module automatically assigns minor numbers to
30drivers in load order, depending on the registered device type. We
31recommend that V4L2 drivers by default register devices with the same
32numbers, but the system administrator can assign arbitrary minor numbers
33using driver module options. The major device number remains 81.
34
35
36.. _v4l-dev:
37
38.. flat-table:: V4L Device Types, Names and Numbers
39 :header-rows: 1
40 :stub-columns: 0
41
42
43 - .. row 1
44
45 - Device Type
46
47 - File Name
48
49 - Minor Numbers
50
51 - .. row 2
52
53 - Video capture and overlay
54
55 - ``/dev/video`` and ``/dev/bttv0``\ [#f1]_, ``/dev/video0`` to
56 ``/dev/video63``
57
58 - 0-63
59
60 - .. row 3
61
62 - Radio receiver
63
64 - ``/dev/radio``\ [#f2]_, ``/dev/radio0`` to ``/dev/radio63``
65
66 - 64-127
67
68 - .. row 4
69
70 - Raw VBI capture
71
72 - ``/dev/vbi``, ``/dev/vbi0`` to ``/dev/vbi31``
73
74 - 224-255
75
76
77V4L prohibits (or used to prohibit) multiple opens of a device file.
78V4L2 drivers *may* support multiple opens, see :ref:`open` for details
79and consequences.
80
81V4L drivers respond to V4L2 ioctls with an ``EINVAL`` error code.
82
83
84Querying Capabilities
85=====================
86
87The V4L ``VIDIOCGCAP`` ioctl is equivalent to V4L2's
88:ref:`VIDIOC_QUERYCAP`.
89
90The ``name`` field in struct :c:type:`struct video_capability` became
91``card`` in struct :ref:`v4l2_capability <v4l2-capability>`, ``type``
92was replaced by ``capabilities``. Note V4L2 does not distinguish between
93device types like this, better think of basic video input, video output
94and radio devices supporting a set of related functions like video
95capturing, video overlay and VBI capturing. See :ref:`open` for an
96introduction.
97
98
99
100.. flat-table::
101 :header-rows: 1
102 :stub-columns: 0
103
104
105 - .. row 1
106
107 - struct :c:type:`struct video_capability` ``type``
108
109 - struct :ref:`v4l2_capability <v4l2-capability>`
110 ``capabilities`` flags
111
112 - Purpose
113
114 - .. row 2
115
116 - ``VID_TYPE_CAPTURE``
117
118 - ``V4L2_CAP_VIDEO_CAPTURE``
119
120 - The :ref:`video capture <capture>` interface is supported.
121
122 - .. row 3
123
124 - ``VID_TYPE_TUNER``
125
126 - ``V4L2_CAP_TUNER``
127
128 - The device has a :ref:`tuner or modulator <tuner>`.
129
130 - .. row 4
131
132 - ``VID_TYPE_TELETEXT``
133
134 - ``V4L2_CAP_VBI_CAPTURE``
135
136 - The :ref:`raw VBI capture <raw-vbi>` interface is supported.
137
138 - .. row 5
139
140 - ``VID_TYPE_OVERLAY``
141
142 - ``V4L2_CAP_VIDEO_OVERLAY``
143
144 - The :ref:`video overlay <overlay>` interface is supported.
145
146 - .. row 6
147
148 - ``VID_TYPE_CHROMAKEY``
149
150 - ``V4L2_FBUF_CAP_CHROMAKEY`` in field ``capability`` of struct
151 :ref:`v4l2_framebuffer <v4l2-framebuffer>`
152
153 - Whether chromakey overlay is supported. For more information on
154 overlay see :ref:`overlay`.
155
156 - .. row 7
157
158 - ``VID_TYPE_CLIPPING``
159
160 - ``V4L2_FBUF_CAP_LIST_CLIPPING`` and
161 ``V4L2_FBUF_CAP_BITMAP_CLIPPING`` in field ``capability`` of
162 struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`
163
164 - Whether clipping the overlaid image is supported, see
165 :ref:`overlay`.
166
167 - .. row 8
168
169 - ``VID_TYPE_FRAMERAM``
170
171 - ``V4L2_FBUF_CAP_EXTERNOVERLAY`` *not set* in field ``capability``
172 of struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`
173
174 - Whether overlay overwrites frame buffer memory, see
175 :ref:`overlay`.
176
177 - .. row 9
178
179 - ``VID_TYPE_SCALES``
180
181 - ``-``
182
183 - This flag indicates if the hardware can scale images. The V4L2 API
184 implies the scale factor by setting the cropping dimensions and
185 image size with the :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` and
186 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, respectively. The
187 driver returns the closest sizes possible. For more information on
188 cropping and scaling see :ref:`crop`.
189
190 - .. row 10
191
192 - ``VID_TYPE_MONOCHROME``
193
194 - ``-``
195
196 - Applications can enumerate the supported image formats with the
197 :ref:`VIDIOC_ENUM_FMT` ioctl to determine if
198 the device supports grey scale capturing only. For more
199 information on image formats see :ref:`pixfmt`.
200
201 - .. row 11
202
203 - ``VID_TYPE_SUBCAPTURE``
204
205 - ``-``
206
207 - Applications can call the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>`
208 ioctl to determine if the device supports capturing a subsection
209 of the full picture ("cropping" in V4L2). If not, the ioctl
210 returns the ``EINVAL`` error code. For more information on cropping
211 and scaling see :ref:`crop`.
212
213 - .. row 12
214
215 - ``VID_TYPE_MPEG_DECODER``
216
217 - ``-``
218
219 - Applications can enumerate the supported image formats with the
220 :ref:`VIDIOC_ENUM_FMT` ioctl to determine if
221 the device supports MPEG streams.
222
223 - .. row 13
224
225 - ``VID_TYPE_MPEG_ENCODER``
226
227 - ``-``
228
229 - See above.
230
231 - .. row 14
232
233 - ``VID_TYPE_MJPEG_DECODER``
234
235 - ``-``
236
237 - See above.
238
239 - .. row 15
240
241 - ``VID_TYPE_MJPEG_ENCODER``
242
243 - ``-``
244
245 - See above.
246
247
248The ``audios`` field was replaced by ``capabilities`` flag
249``V4L2_CAP_AUDIO``, indicating *if* the device has any audio inputs or
250outputs. To determine their number applications can enumerate audio
251inputs with the :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` ioctl. The
252audio ioctls are described in :ref:`audio`.
253
254The ``maxwidth``, ``maxheight``, ``minwidth`` and ``minheight`` fields
255were removed. Calling the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` or
256:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl with the desired
257dimensions returns the closest size possible, taking into account the
258current video standard, cropping and scaling limitations.
259
260
261Video Sources
262=============
263
264V4L provides the ``VIDIOCGCHAN`` and ``VIDIOCSCHAN`` ioctl using struct
265:c:type:`struct video_channel` to enumerate the video inputs of a V4L
266device. The equivalent V4L2 ioctls are
267:ref:`VIDIOC_ENUMINPUT`,
268:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
269:ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` using struct
270:ref:`v4l2_input <v4l2-input>` as discussed in :ref:`video`.
271
272The ``channel`` field counting inputs was renamed to ``index``, the
273video input types were renamed as follows:
274
275
276
277.. flat-table::
278 :header-rows: 1
279 :stub-columns: 0
280
281
282 - .. row 1
283
284 - struct :c:type:`struct video_channel` ``type``
285
286 - struct :ref:`v4l2_input <v4l2-input>` ``type``
287
288 - .. row 2
289
290 - ``VIDEO_TYPE_TV``
291
292 - ``V4L2_INPUT_TYPE_TUNER``
293
294 - .. row 3
295
296 - ``VIDEO_TYPE_CAMERA``
297
298 - ``V4L2_INPUT_TYPE_CAMERA``
299
300
301Unlike the ``tuners`` field expressing the number of tuners of this
302input, V4L2 assumes each video input is connected to at most one tuner.
303However a tuner can have more than one input, i. e. RF connectors, and a
304device can have multiple tuners. The index number of the tuner
305associated with the input, if any, is stored in field ``tuner`` of
306struct :ref:`v4l2_input <v4l2-input>`. Enumeration of tuners is
307discussed in :ref:`tuner`.
308
309The redundant ``VIDEO_VC_TUNER`` flag was dropped. Video inputs
310associated with a tuner are of type ``V4L2_INPUT_TYPE_TUNER``. The
311``VIDEO_VC_AUDIO`` flag was replaced by the ``audioset`` field. V4L2
312considers devices with up to 32 audio inputs. Each set bit in the
313``audioset`` field represents one audio input this video input combines
314with. For information about audio inputs and how to switch between them
315see :ref:`audio`.
316
317The ``norm`` field describing the supported video standards was replaced
318by ``std``. The V4L specification mentions a flag ``VIDEO_VC_NORM``
319indicating whether the standard can be changed. This flag was a later
320addition together with the ``norm`` field and has been removed in the
321meantime. V4L2 has a similar, albeit more comprehensive approach to
322video standards, see :ref:`standard` for more information.
323
324
325Tuning
326======
327
328The V4L ``VIDIOCGTUNER`` and ``VIDIOCSTUNER`` ioctl and struct
329:c:type:`struct video_tuner` can be used to enumerate the tuners of a
330V4L TV or radio device. The equivalent V4L2 ioctls are
331:ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
332:ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` using struct
333:ref:`v4l2_tuner <v4l2-tuner>`. Tuners are covered in :ref:`tuner`.
334
335The ``tuner`` field counting tuners was renamed to ``index``. The fields
336``name``, ``rangelow`` and ``rangehigh`` remained unchanged.
337
338The ``VIDEO_TUNER_PAL``, ``VIDEO_TUNER_NTSC`` and ``VIDEO_TUNER_SECAM``
339flags indicating the supported video standards were dropped. This
340information is now contained in the associated struct
341:ref:`v4l2_input <v4l2-input>`. No replacement exists for the
342``VIDEO_TUNER_NORM`` flag indicating whether the video standard can be
343switched. The ``mode`` field to select a different video standard was
344replaced by a whole new set of ioctls and structures described in
345:ref:`standard`. Due to its ubiquity it should be mentioned the BTTV
346driver supports several standards in addition to the regular
347``VIDEO_MODE_PAL`` (0), ``VIDEO_MODE_NTSC``, ``VIDEO_MODE_SECAM`` and
348``VIDEO_MODE_AUTO`` (3). Namely N/PAL Argentina, M/PAL, N/PAL, and NTSC
349Japan with numbers 3-6 (sic).
350
351The ``VIDEO_TUNER_STEREO_ON`` flag indicating stereo reception became
352``V4L2_TUNER_SUB_STEREO`` in field ``rxsubchans``. This field also
353permits the detection of monaural and bilingual audio, see the
354definition of struct :ref:`v4l2_tuner <v4l2-tuner>` for details.
355Presently no replacement exists for the ``VIDEO_TUNER_RDS_ON`` and
356``VIDEO_TUNER_MBS_ON`` flags.
357
358The ``VIDEO_TUNER_LOW`` flag was renamed to ``V4L2_TUNER_CAP_LOW`` in
359the struct :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field.
360
361The ``VIDIOCGFREQ`` and ``VIDIOCSFREQ`` ioctl to change the tuner
362frequency where renamed to
363:ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
364:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>`. They take a pointer
365to a struct :ref:`v4l2_frequency <v4l2-frequency>` instead of an
366unsigned long integer.
367
368
369.. _v4l-image-properties:
370
371Image Properties
372================
373
374V4L2 has no equivalent of the ``VIDIOCGPICT`` and ``VIDIOCSPICT`` ioctl
375and struct :c:type:`struct video_picture`. The following fields where
376replaced by V4L2 controls accessible with the
377:ref:`VIDIOC_QUERYCTRL`,
378:ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
379:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls:
380
381
382
383.. flat-table::
384 :header-rows: 1
385 :stub-columns: 0
386
387
388 - .. row 1
389
390 - struct :c:type:`struct video_picture`
391
392 - V4L2 Control ID
393
394 - .. row 2
395
396 - ``brightness``
397
398 - ``V4L2_CID_BRIGHTNESS``
399
400 - .. row 3
401
402 - ``hue``
403
404 - ``V4L2_CID_HUE``
405
406 - .. row 4
407
408 - ``colour``
409
410 - ``V4L2_CID_SATURATION``
411
412 - .. row 5
413
414 - ``contrast``
415
416 - ``V4L2_CID_CONTRAST``
417
418 - .. row 6
419
420 - ``whiteness``
421
422 - ``V4L2_CID_WHITENESS``
423
424
425The V4L picture controls are assumed to range from 0 to 65535 with no
426particular reset value. The V4L2 API permits arbitrary limits and
427defaults which can be queried with the
428:ref:`VIDIOC_QUERYCTRL` ioctl. For general
429information about controls see :ref:`control`.
430
431The ``depth`` (average number of bits per pixel) of a video image is
432implied by the selected image format. V4L2 does not explicitly provide
433such information assuming applications recognizing the format are aware
434of the image depth and others need not know. The ``palette`` field moved
435into the struct :ref:`v4l2_pix_format <v4l2-pix-format>`:
436
437
438
439.. flat-table::
440 :header-rows: 1
441 :stub-columns: 0
442
443
444 - .. row 1
445
446 - struct :c:type:`struct video_picture` ``palette``
447
448 - struct :ref:`v4l2_pix_format <v4l2-pix-format>` ``pixfmt``
449
450 - .. row 2
451
452 - ``VIDEO_PALETTE_GREY``
453
454 - :ref:`V4L2_PIX_FMT_GREY <V4L2-PIX-FMT-GREY>`
455
456 - .. row 3
457
458 - ``VIDEO_PALETTE_HI240``
459
460 - :ref:`V4L2_PIX_FMT_HI240 <pixfmt-reserved>` [#f3]_
461
462 - .. row 4
463
464 - ``VIDEO_PALETTE_RGB565``
465
466 - :ref:`V4L2_PIX_FMT_RGB565 <pixfmt-rgb>`
467
468 - .. row 5
469
470 - ``VIDEO_PALETTE_RGB555``
471
472 - :ref:`V4L2_PIX_FMT_RGB555 <pixfmt-rgb>`
473
474 - .. row 6
475
476 - ``VIDEO_PALETTE_RGB24``
477
478 - :ref:`V4L2_PIX_FMT_BGR24 <pixfmt-rgb>`
479
480 - .. row 7
481
482 - ``VIDEO_PALETTE_RGB32``
483
484 - :ref:`V4L2_PIX_FMT_BGR32 <pixfmt-rgb>` [#f4]_
485
486 - .. row 8
487
488 - ``VIDEO_PALETTE_YUV422``
489
490 - :ref:`V4L2_PIX_FMT_YUYV <V4L2-PIX-FMT-YUYV>`
491
492 - .. row 9
493
494 - ``VIDEO_PALETTE_YUYV``\ [#f5]_
495
496 - :ref:`V4L2_PIX_FMT_YUYV <V4L2-PIX-FMT-YUYV>`
497
498 - .. row 10
499
500 - ``VIDEO_PALETTE_UYVY``
501
502 - :ref:`V4L2_PIX_FMT_UYVY <V4L2-PIX-FMT-UYVY>`
503
504 - .. row 11
505
506 - ``VIDEO_PALETTE_YUV420``
507
508 - None
509
510 - .. row 12
511
512 - ``VIDEO_PALETTE_YUV411``
513
514 - :ref:`V4L2_PIX_FMT_Y41P <V4L2-PIX-FMT-Y41P>` [#f6]_
515
516 - .. row 13
517
518 - ``VIDEO_PALETTE_RAW``
519
520 - None [#f7]_
521
522 - .. row 14
523
524 - ``VIDEO_PALETTE_YUV422P``
525
526 - :ref:`V4L2_PIX_FMT_YUV422P <V4L2-PIX-FMT-YUV422P>`
527
528 - .. row 15
529
530 - ``VIDEO_PALETTE_YUV411P``
531
532 - :ref:`V4L2_PIX_FMT_YUV411P <V4L2-PIX-FMT-YUV411P>` [#f8]_
533
534 - .. row 16
535
536 - ``VIDEO_PALETTE_YUV420P``
537
538 - :ref:`V4L2_PIX_FMT_YVU420 <V4L2-PIX-FMT-YVU420>`
539
540 - .. row 17
541
542 - ``VIDEO_PALETTE_YUV410P``
543
544 - :ref:`V4L2_PIX_FMT_YVU410 <V4L2-PIX-FMT-YVU410>`
545
546
547V4L2 image formats are defined in :ref:`pixfmt`. The image format can
548be selected with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
549
550
551Audio
552=====
553
554The ``VIDIOCGAUDIO`` and ``VIDIOCSAUDIO`` ioctl and struct
555:c:type:`struct video_audio` are used to enumerate the audio inputs
556of a V4L device. The equivalent V4L2 ioctls are
557:ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` and
558:ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` using struct
559:ref:`v4l2_audio <v4l2-audio>` as discussed in :ref:`audio`.
560
561The ``audio`` "channel number" field counting audio inputs was renamed
562to ``index``.
563
564On ``VIDIOCSAUDIO`` the ``mode`` field selects *one* of the
565``VIDEO_SOUND_MONO``, ``VIDEO_SOUND_STEREO``, ``VIDEO_SOUND_LANG1`` or
566``VIDEO_SOUND_LANG2`` audio demodulation modes. When the current audio
567standard is BTSC ``VIDEO_SOUND_LANG2`` refers to SAP and
568``VIDEO_SOUND_LANG1`` is meaningless. Also undocumented in the V4L
569specification, there is no way to query the selected mode. On
570``VIDIOCGAUDIO`` the driver returns the *actually received* audio
571programmes in this field. In the V4L2 API this information is stored in
572the struct :ref:`v4l2_tuner <v4l2-tuner>` ``rxsubchans`` and
573``audmode`` fields, respectively. See :ref:`tuner` for more
574information on tuners. Related to audio modes struct
575:ref:`v4l2_audio <v4l2-audio>` also reports if this is a mono or
576stereo input, regardless if the source is a tuner.
577
578The following fields where replaced by V4L2 controls accessible with the
579:ref:`VIDIOC_QUERYCTRL`,
580:ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
581:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls:
582
583
584
585.. flat-table::
586 :header-rows: 1
587 :stub-columns: 0
588
589
590 - .. row 1
591
592 - struct :c:type:`struct video_audio`
593
594 - V4L2 Control ID
595
596 - .. row 2
597
598 - ``volume``
599
600 - ``V4L2_CID_AUDIO_VOLUME``
601
602 - .. row 3
603
604 - ``bass``
605
606 - ``V4L2_CID_AUDIO_BASS``
607
608 - .. row 4
609
610 - ``treble``
611
612 - ``V4L2_CID_AUDIO_TREBLE``
613
614 - .. row 5
615
616 - ``balance``
617
618 - ``V4L2_CID_AUDIO_BALANCE``
619
620
621To determine which of these controls are supported by a driver V4L
622provides the ``flags`` ``VIDEO_AUDIO_VOLUME``, ``VIDEO_AUDIO_BASS``,
623``VIDEO_AUDIO_TREBLE`` and ``VIDEO_AUDIO_BALANCE``. In the V4L2 API the
624:ref:`VIDIOC_QUERYCTRL` ioctl reports if the
625respective control is supported. Accordingly the ``VIDEO_AUDIO_MUTABLE``
626and ``VIDEO_AUDIO_MUTE`` flags where replaced by the boolean
627``V4L2_CID_AUDIO_MUTE`` control.
628
629All V4L2 controls have a ``step`` attribute replacing the struct
630:c:type:`struct video_audio` ``step`` field. The V4L audio controls
631are assumed to range from 0 to 65535 with no particular reset value. The
632V4L2 API permits arbitrary limits and defaults which can be queried with
633the :ref:`VIDIOC_QUERYCTRL` ioctl. For general
634information about controls see :ref:`control`.
635
636
637Frame Buffer Overlay
638====================
639
640The V4L2 ioctls equivalent to ``VIDIOCGFBUF`` and ``VIDIOCSFBUF`` are
641:ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` and
642:ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`. The ``base`` field of struct
643:c:type:`struct video_buffer` remained unchanged, except V4L2 defines
644a flag to indicate non-destructive overlays instead of a ``NULL``
645pointer. All other fields moved into the struct
646:ref:`v4l2_pix_format <v4l2-pix-format>` ``fmt`` substructure of
647struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`. The ``depth``
648field was replaced by ``pixelformat``. See :ref:`pixfmt-rgb` for a
649list of RGB formats and their respective color depths.
650
651Instead of the special ioctls ``VIDIOCGWIN`` and ``VIDIOCSWIN`` V4L2
652uses the general-purpose data format negotiation ioctls
653:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
654:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`. They take a pointer to a struct
655:ref:`v4l2_format <v4l2-format>` as argument. Here the ``win`` member
656of the ``fmt`` union is used, a struct
657:ref:`v4l2_window <v4l2-window>`.
658
659The ``x``, ``y``, ``width`` and ``height`` fields of struct
660:c:type:`struct video_window` moved into struct
661:ref:`v4l2_rect <v4l2-rect>` substructure ``w`` of struct
662:c:type:`struct v4l2_window`. The ``chromakey``, ``clips``, and
663``clipcount`` fields remained unchanged. Struct
664:c:type:`struct video_clip` was renamed to struct
665:ref:`v4l2_clip <v4l2-clip>`, also containing a struct
666:c:type:`struct v4l2_rect`, but the semantics are still the same.
667
668The ``VIDEO_WINDOW_INTERLACE`` flag was dropped. Instead applications
669must set the ``field`` field to ``V4L2_FIELD_ANY`` or
670``V4L2_FIELD_INTERLACED``. The ``VIDEO_WINDOW_CHROMAKEY`` flag moved
671into struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`, under the new
672name ``V4L2_FBUF_FLAG_CHROMAKEY``.
673
674In V4L, storing a bitmap pointer in ``clips`` and setting ``clipcount``
675to ``VIDEO_CLIP_BITMAP`` (-1) requests bitmap clipping, using a fixed
676size bitmap of 1024 × 625 bits. Struct :c:type:`struct v4l2_window`
677has a separate ``bitmap`` pointer field for this purpose and the bitmap
678size is determined by ``w.width`` and ``w.height``.
679
680The ``VIDIOCCAPTURE`` ioctl to enable or disable overlay was renamed to
681:ref:`VIDIOC_OVERLAY`.
682
683
684Cropping
685========
686
687To capture only a subsection of the full picture V4L defines the
688``VIDIOCGCAPTURE`` and ``VIDIOCSCAPTURE`` ioctls using struct
689:c:type:`struct video_capture`. The equivalent V4L2 ioctls are
690:ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and
691:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` using struct
692:ref:`v4l2_crop <v4l2-crop>`, and the related
693:ref:`VIDIOC_CROPCAP` ioctl. This is a rather
694complex matter, see :ref:`crop` for details.
695
696The ``x``, ``y``, ``width`` and ``height`` fields moved into struct
697:ref:`v4l2_rect <v4l2-rect>` substructure ``c`` of struct
698:c:type:`struct v4l2_crop`. The ``decimation`` field was dropped. In
699the V4L2 API the scaling factor is implied by the size of the cropping
700rectangle and the size of the captured or overlaid image.
701
702The ``VIDEO_CAPTURE_ODD`` and ``VIDEO_CAPTURE_EVEN`` flags to capture
703only the odd or even field, respectively, were replaced by
704``V4L2_FIELD_TOP`` and ``V4L2_FIELD_BOTTOM`` in the field named
705``field`` of struct :ref:`v4l2_pix_format <v4l2-pix-format>` and
706struct :ref:`v4l2_window <v4l2-window>`. These structures are used to
707select a capture or overlay format with the
708:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
709
710
711Reading Images, Memory Mapping
712==============================
713
714
715Capturing using the read method
716-------------------------------
717
718There is no essential difference between reading images from a V4L or
719V4L2 device using the :ref:`read() <func-read>` function, however V4L2
720drivers are not required to support this I/O method. Applications can
721determine if the function is available with the
722:ref:`VIDIOC_QUERYCAP` ioctl. All V4L2 devices
723exchanging data with applications must support the
724:ref:`select() <func-select>` and :ref:`poll() <func-poll>`
725functions.
726
727To select an image format and size, V4L provides the ``VIDIOCSPICT`` and
728``VIDIOCSWIN`` ioctls. V4L2 uses the general-purpose data format
729negotiation ioctls :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
730:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`. They take a pointer to a struct
731:ref:`v4l2_format <v4l2-format>` as argument, here the struct
732:ref:`v4l2_pix_format <v4l2-pix-format>` named ``pix`` of its
733``fmt`` union is used.
734
735For more information about the V4L2 read interface see :ref:`rw`.
736
737
738Capturing using memory mapping
739------------------------------
740
741Applications can read from V4L devices by mapping buffers in device
742memory, or more often just buffers allocated in DMA-able system memory,
743into their address space. This avoids the data copying overhead of the
744read method. V4L2 supports memory mapping as well, with a few
745differences.
746
747
748
749.. flat-table::
750 :header-rows: 1
751 :stub-columns: 0
752
753
754 - .. row 1
755
756 - V4L
757
758 - V4L2
759
760 - .. row 2
761
762 -
763 - The image format must be selected before buffers are allocated,
764 with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. When no
765 format is selected the driver may use the last, possibly by
766 another application requested format.
767
768 - .. row 3
769
770 - Applications cannot change the number of buffers. The it is built
771 into the driver, unless it has a module option to change the
772 number when the driver module is loaded.
773
774 - The :ref:`VIDIOC_REQBUFS` ioctl allocates the
775 desired number of buffers, this is a required step in the
776 initialization sequence.
777
778 - .. row 4
779
780 - Drivers map all buffers as one contiguous range of memory. The
781 ``VIDIOCGMBUF`` ioctl is available to query the number of buffers,
782 the offset of each buffer from the start of the virtual file, and
783 the overall amount of memory used, which can be used as arguments
784 for the :ref:`mmap() <func-mmap>` function.
785
786 - Buffers are individually mapped. The offset and size of each
787 buffer can be determined with the
788 :ref:`VIDIOC_QUERYBUF` ioctl.
789
790 - .. row 5
791
792 - The ``VIDIOCMCAPTURE`` ioctl prepares a buffer for capturing. It
793 also determines the image format for this buffer. The ioctl
794 returns immediately, eventually with an ``EAGAIN`` error code if no
795 video signal had been detected. When the driver supports more than
796 one buffer applications can call the ioctl multiple times and thus
797 have multiple outstanding capture requests.
798
799 The ``VIDIOCSYNC`` ioctl suspends execution until a particular
800 buffer has been filled.
801
802 - Drivers maintain an incoming and outgoing queue.
803 :ref:`VIDIOC_QBUF` enqueues any empty buffer into
804 the incoming queue. Filled buffers are dequeued from the outgoing
805 queue with the :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. To wait
806 until filled buffers become available this function,
807 :ref:`select() <func-select>` or :ref:`poll() <func-poll>` can
808 be used. The :ref:`VIDIOC_STREAMON` ioctl
809 must be called once after enqueuing one or more buffers to start
810 capturing. Its counterpart
811 :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` stops capturing and
812 dequeues all buffers from both queues. Applications can query the
813 signal status, if known, with the
814 :ref:`VIDIOC_ENUMINPUT` ioctl.
815
816
817For a more in-depth discussion of memory mapping and examples, see
818:ref:`mmap`.
819
820
821Reading Raw VBI Data
822====================
823
824Originally the V4L API did not specify a raw VBI capture interface, only
825the device file ``/dev/vbi`` was reserved for this purpose. The only
826driver supporting this interface was the BTTV driver, de-facto defining
827the V4L VBI interface. Reading from the device yields a raw VBI image
828with the following parameters:
829
830
831
832.. flat-table::
833 :header-rows: 1
834 :stub-columns: 0
835
836
837 - .. row 1
838
839 - struct :ref:`v4l2_vbi_format <v4l2-vbi-format>`
840
841 - V4L, BTTV driver
842
843 - .. row 2
844
845 - sampling_rate
846
847 - 28636363 Hz NTSC (or any other 525-line standard); 35468950 Hz PAL
848 and SECAM (625-line standards)
849
850 - .. row 3
851
852 - offset
853
854 - ?
855
856 - .. row 4
857
858 - samples_per_line
859
860 - 2048
861
862 - .. row 5
863
864 - sample_format
865
866 - V4L2_PIX_FMT_GREY. The last four bytes (a machine endianness
867 integer) contain a frame counter.
868
869 - .. row 6
870
871 - start[]
872
873 - 10, 273 NTSC; 22, 335 PAL and SECAM
874
875 - .. row 7
876
877 - count[]
878
879 - 16, 16 [#f9]_
880
881 - .. row 8
882
883 - flags
884
885 - 0
886
887
888Undocumented in the V4L specification, in Linux 2.3 the
889``VIDIOCGVBIFMT`` and ``VIDIOCSVBIFMT`` ioctls using struct
890:c:type:`struct vbi_format` were added to determine the VBI image
891parameters. These ioctls are only partially compatible with the V4L2 VBI
892interface specified in :ref:`raw-vbi`.
893
894An ``offset`` field does not exist, ``sample_format`` is supposed to be
895``VIDEO_PALETTE_RAW``, equivalent to ``V4L2_PIX_FMT_GREY``. The
896remaining fields are probably equivalent to struct
897:ref:`v4l2_vbi_format <v4l2-vbi-format>`.
898
899Apparently only the Zoran (ZR 36120) driver implements these ioctls. The
900semantics differ from those specified for V4L2 in two ways. The
901parameters are reset on :ref:`open() <func-open>` and
902``VIDIOCSVBIFMT`` always returns an ``EINVAL`` error code if the parameters
903are invalid.
904
905
906Miscellaneous
907=============
908
909V4L2 has no equivalent of the ``VIDIOCGUNIT`` ioctl. Applications can
910find the VBI device associated with a video capture device (or vice
911versa) by reopening the device and requesting VBI data. For details see
912:ref:`open`.
913
914No replacement exists for ``VIDIOCKEY``, and the V4L functions for
915microcode programming. A new interface for MPEG compression and playback
916devices is documented in :ref:`extended-controls`.
917
918.. [#f1]
919 According to Documentation/devices.txt these should be symbolic links
920 to ``/dev/video0``. Note the original bttv interface is not
921 compatible with V4L or V4L2.
922
923.. [#f2]
924 According to ``Documentation/devices.txt`` a symbolic link to
925 ``/dev/radio0``.
926
927.. [#f3]
928 This is a custom format used by the BTTV driver, not one of the V4L2
929 standard formats.
930
931.. [#f4]
932 Presumably all V4L RGB formats are little-endian, although some
933 drivers might interpret them according to machine endianness. V4L2
934 defines little-endian, big-endian and red/blue swapped variants. For
935 details see :ref:`pixfmt-rgb`.
936
937.. [#f5]
938 ``VIDEO_PALETTE_YUV422`` and ``VIDEO_PALETTE_YUYV`` are the same
939 formats. Some V4L drivers respond to one, some to the other.
940
941.. [#f6]
942 Not to be confused with ``V4L2_PIX_FMT_YUV411P``, which is a planar
943 format.
944
945.. [#f7]
946 V4L explains this as: "RAW capture (BT848)"
947
948.. [#f8]
949 Not to be confused with ``V4L2_PIX_FMT_Y41P``, which is a packed
950 format.
951
952.. [#f9]
953 Old driver versions used different values, eventually the custom
954 ``BTTV_VBISIZE`` ioctl was added to query the correct values.
diff --git a/Documentation/media/uapi/v4l/dmabuf.rst b/Documentation/media/uapi/v4l/dmabuf.rst
new file mode 100644
index 000000000000..675768f7c66a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dmabuf.rst
@@ -0,0 +1,162 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dmabuf:
4
5************************************
6Streaming I/O (DMA buffer importing)
7************************************
8
9The DMABUF framework provides a generic method for sharing buffers
10between multiple devices. Device drivers that support DMABUF can export
11a DMA buffer to userspace as a file descriptor (known as the exporter
12role), import a DMA buffer from userspace using a file descriptor
13previously exported for a different or the same device (known as the
14importer role), or both. This section describes the DMABUF importer role
15API in V4L2.
16
17Refer to :ref:`DMABUF exporting <VIDIOC_EXPBUF>` for details about
18exporting V4L2 buffers as DMABUF file descriptors.
19
20Input and output devices support the streaming I/O method when the
21``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
22:ref:`v4l2_capability <v4l2-capability>` returned by the
23:ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>` ioctl is set. Whether
24importing DMA buffers through DMABUF file descriptors is supported is
25determined by calling the :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
26ioctl with the memory type set to ``V4L2_MEMORY_DMABUF``.
27
28This I/O method is dedicated to sharing DMA buffers between different
29devices, which may be V4L devices or other video-related devices (e.g.
30DRM). Buffers (planes) are allocated by a driver on behalf of an
31application. Next, these buffers are exported to the application as file
32descriptors using an API which is specific for an allocator driver. Only
33such file descriptor are exchanged. The descriptors and meta-information
34are passed in struct :ref:`v4l2_buffer <v4l2-buffer>` (or in struct
35:ref:`v4l2_plane <v4l2-plane>` in the multi-planar API case). The
36driver must be switched into DMABUF I/O mode by calling the
37:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>` with the desired buffer type.
38
39
40Example: Initiating streaming I/O with DMABUF file descriptors
41==============================================================
42
43.. code-block:: c
44
45 struct v4l2_requestbuffers reqbuf;
46
47 memset(&reqbuf, 0, sizeof (reqbuf));
48 reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
49 reqbuf.memory = V4L2_MEMORY_DMABUF;
50 reqbuf.count = 1;
51
52 if (ioctl(fd, VIDIOC_REQBUFS, &reqbuf) == -1) {
53 if (errno == EINVAL)
54 printf("Video capturing or DMABUF streaming is not supported\\n");
55 else
56 perror("VIDIOC_REQBUFS");
57
58 exit(EXIT_FAILURE);
59 }
60
61The buffer (plane) file descriptor is passed on the fly with the
62:ref:`VIDIOC_QBUF <VIDIOC_QBUF>` ioctl. In case of multiplanar
63buffers, every plane can be associated with a different DMABUF
64descriptor. Although buffers are commonly cycled, applications can pass
65a different DMABUF descriptor at each :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` call.
66
67Example: Queueing DMABUF using single plane API
68===============================================
69
70.. code-block:: c
71
72 int buffer_queue(int v4lfd, int index, int dmafd)
73 {
74 struct v4l2_buffer buf;
75
76 memset(&buf, 0, sizeof buf);
77 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
78 buf.memory = V4L2_MEMORY_DMABUF;
79 buf.index = index;
80 buf.m.fd = dmafd;
81
82 if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) {
83 perror("VIDIOC_QBUF");
84 return -1;
85 }
86
87 return 0;
88 }
89
90Example 3.6. Queueing DMABUF using multi plane API
91==================================================
92
93.. code-block:: c
94
95 int buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes)
96 {
97 struct v4l2_buffer buf;
98 struct v4l2_plane planes[VIDEO_MAX_PLANES];
99 int i;
100
101 memset(&buf, 0, sizeof buf);
102 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
103 buf.memory = V4L2_MEMORY_DMABUF;
104 buf.index = index;
105 buf.m.planes = planes;
106 buf.length = n_planes;
107
108 memset(&planes, 0, sizeof planes);
109
110 for (i = 0; i < n_planes; ++i)
111 buf.m.planes[i].m.fd = dmafd[i];
112
113 if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) {
114 perror("VIDIOC_QBUF");
115 return -1;
116 }
117
118 return 0;
119 }
120
121Captured or displayed buffers are dequeued with the
122:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. The driver can unlock the
123buffer at any time between the completion of the DMA and this ioctl. The
124memory is also unlocked when
125:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` is called,
126:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, or when the device is closed.
127
128For capturing applications it is customary to enqueue a number of empty
129buffers, to start capturing and enter the read loop. Here the
130application waits until a filled buffer can be dequeued, and re-enqueues
131the buffer when the data is no longer needed. Output applications fill
132and enqueue buffers, when enough buffers are stacked up output is
133started. In the write loop, when the application runs out of free
134buffers it must wait until an empty buffer can be dequeued and reused.
135Two methods exist to suspend execution of the application until one or
136more buffers can be dequeued. By default :ref:`VIDIOC_DQBUF
137<VIDIOC_QBUF>` blocks when no buffer is in the outgoing queue. When the
138``O_NONBLOCK`` flag was given to the :ref:`open() <func-open>` function,
139:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` returns immediately with an ``EAGAIN``
140error code when no buffer is available. The
141:ref:`select() <func-select>` and :ref:`poll() <func-poll>`
142functions are always available.
143
144To start and stop capturing or displaying applications call the
145:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and
146:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls.
147
148.. note::
149
150 :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
151 both queues and unlocks all buffers as a side effect. Since there is no
152 notion of doing anything "now" on a multitasking system, if an
153 application needs to synchronize with another event it should examine
154 the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
155 outputted buffers.
156
157Drivers implementing DMABUF importing I/O must support the
158:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`,
159:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_STREAMON
160<VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls,
161and the :ref:`select() <func-select>` and :ref:`poll() <func-poll>`
162functions.
diff --git a/Documentation/media/uapi/v4l/driver.rst b/Documentation/media/uapi/v4l/driver.rst
new file mode 100644
index 000000000000..2319b383f0a4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/driver.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _driver:
4
5***********************
6V4L2 Driver Programming
7***********************
8
9to do
diff --git a/Documentation/media/uapi/v4l/dv-timings.rst b/Documentation/media/uapi/v4l/dv-timings.rst
new file mode 100644
index 000000000000..415a0c4e2ccb
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dv-timings.rst
@@ -0,0 +1,38 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _dv-timings:
4
5**************************
6Digital Video (DV) Timings
7**************************
8
9The video standards discussed so far have been dealing with Analog TV
10and the corresponding video timings. Today there are many more different
11hardware interfaces such as High Definition TV interfaces (HDMI), VGA,
12DVI connectors etc., that carry video signals and there is a need to
13extend the API to select the video timings for these interfaces. Since
14it is not possible to extend the :ref:`v4l2_std_id <v4l2-std-id>`
15due to the limited bits available, a new set of ioctls was added to
16set/get video timings at the input and output.
17
18These ioctls deal with the detailed digital video timings that define
19each video format. This includes parameters such as the active video
20width and height, signal polarities, frontporches, backporches, sync
21widths etc. The ``linux/v4l2-dv-timings.h`` header can be used to get
22the timings of the formats in the :ref:`cea861` and :ref:`vesadmt`
23standards.
24
25To enumerate and query the attributes of the DV timings supported by a
26device applications use the
27:ref:`VIDIOC_ENUM_DV_TIMINGS` and
28:ref:`VIDIOC_DV_TIMINGS_CAP` ioctls. To set
29DV timings for the device applications use the
30:ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl and to get
31current DV timings they use the
32:ref:`VIDIOC_G_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl. To detect
33the DV timings as seen by the video receiver applications use the
34:ref:`VIDIOC_QUERY_DV_TIMINGS` ioctl.
35
36Applications can make use of the :ref:`input-capabilities` and
37:ref:`output-capabilities` flags to determine whether the digital
38video ioctls can be used with the given input or output.
diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
new file mode 100644
index 000000000000..71071d73747d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -0,0 +1,4531 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _extended-controls:
4
5*****************
6Extended Controls
7*****************
8
9
10Introduction
11============
12
13The control mechanism as originally designed was meant to be used for
14user settings (brightness, saturation, etc). However, it turned out to
15be a very useful model for implementing more complicated driver APIs
16where each driver implements only a subset of a larger API.
17
18The MPEG encoding API was the driving force behind designing and
19implementing this extended control mechanism: the MPEG standard is quite
20large and the currently supported hardware MPEG encoders each only
21implement a subset of this standard. Further more, many parameters
22relating to how the video is encoded into an MPEG stream are specific to
23the MPEG encoding chip since the MPEG standard only defines the format
24of the resulting MPEG stream, not how the video is actually encoded into
25that format.
26
27Unfortunately, the original control API lacked some features needed for
28these new uses and so it was extended into the (not terribly originally
29named) extended control API.
30
31Even though the MPEG encoding API was the first effort to use the
32Extended Control API, nowadays there are also other classes of Extended
33Controls, such as Camera Controls and FM Transmitter Controls. The
34Extended Controls API as well as all Extended Controls classes are
35described in the following text.
36
37
38The Extended Control API
39========================
40
41Three new ioctls are available:
42:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`,
43:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and
44:ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`. These ioctls act
45on arrays of controls (as opposed to the
46:ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
47:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls that act on a single
48control). This is needed since it is often required to atomically change
49several controls at once.
50
51Each of the new ioctls expects a pointer to a struct
52:ref:`v4l2_ext_controls <v4l2-ext-controls>`. This structure
53contains a pointer to the control array, a count of the number of
54controls in that array and a control class. Control classes are used to
55group similar controls into a single class. For example, control class
56``V4L2_CTRL_CLASS_USER`` contains all user controls (i. e. all controls
57that can also be set using the old :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>`
58ioctl). Control class ``V4L2_CTRL_CLASS_MPEG`` contains all controls
59relating to MPEG encoding, etc.
60
61All controls in the control array must belong to the specified control
62class. An error is returned if this is not the case.
63
64It is also possible to use an empty control array (``count`` == 0) to check
65whether the specified control class is supported.
66
67The control array is a struct
68:ref:`v4l2_ext_control <v4l2-ext-control>` array. The
69:ref:`struct v4l2_ext_control <v4l2-ext-control>` structure is very similar to
70struct :ref:`v4l2_control <v4l2-control>`, except for the fact that
71it also allows for 64-bit values and pointers to be passed.
72
73Since the struct :ref:`v4l2_ext_control <v4l2-ext-control>` supports
74pointers it is now also possible to have controls with compound types
75such as N-dimensional arrays and/or structures. You need to specify the
76``V4L2_CTRL_FLAG_NEXT_COMPOUND`` when enumerating controls to actually
77be able to see such compound controls. In other words, these controls
78with compound types should only be used programmatically.
79
80Since such compound controls need to expose more information about
81themselves than is possible with
82:ref:`VIDIOC_QUERYCTRL` the
83:ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>` ioctl was added. In
84particular, this ioctl gives the dimensions of the N-dimensional array
85if this control consists of more than one element.
86
87.. note::
88
89 #. It is important to realize that due to the flexibility of controls it is
90 necessary to check whether the control you want to set actually is
91 supported in the driver and what the valid range of values is. So use
92 the :ref:`VIDIOC_QUERYCTRL` (or :ref:`VIDIOC_QUERY_EXT_CTRL
93 <VIDIOC_QUERYCTRL>`) and :ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>`
94 ioctls to check this.
95
96 #. It is possible that some of the menu indices in a control of
97 type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU``
98 will return an error). A good example is the list of supported MPEG
99 audio bitrates. Some drivers only support one or two bitrates, others
100 support a wider range.
101
102All controls use machine endianness.
103
104
105Enumerating Extended Controls
106=============================
107
108The recommended way to enumerate over the extended controls is by using
109:ref:`VIDIOC_QUERYCTRL` in combination with the
110``V4L2_CTRL_FLAG_NEXT_CTRL`` flag:
111
112
113.. code-block:: c
114
115 struct v4l2_queryctrl qctrl;
116
117 qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
118 while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) {
119 /* ... */
120 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
121 }
122
123The initial control ID is set to 0 ORed with the
124``V4L2_CTRL_FLAG_NEXT_CTRL`` flag. The ``VIDIOC_QUERYCTRL`` ioctl will
125return the first control with a higher ID than the specified one. When
126no such controls are found an error is returned.
127
128If you want to get all controls within a specific control class, then
129you can set the initial ``qctrl.id`` value to the control class and add
130an extra check to break out of the loop when a control of another
131control class is found:
132
133
134.. code-block:: c
135
136 qctrl.id = V4L2_CTRL_CLASS_MPEG | V4L2_CTRL_FLAG_NEXT_CTRL;
137 while (0 == ioctl(fd, VIDIOC_QUERYCTRL, &qctrl)) {
138 if (V4L2_CTRL_ID2CLASS(qctrl.id) != V4L2_CTRL_CLASS_MPEG)
139 break;
140 /* ... */
141 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
142 }
143
144The 32-bit ``qctrl.id`` value is subdivided into three bit ranges: the
145top 4 bits are reserved for flags (e. g. ``V4L2_CTRL_FLAG_NEXT_CTRL``)
146and are not actually part of the ID. The remaining 28 bits form the
147control ID, of which the most significant 12 bits define the control
148class and the least significant 16 bits identify the control within the
149control class. It is guaranteed that these last 16 bits are always
150non-zero for controls. The range of 0x1000 and up are reserved for
151driver-specific controls. The macro ``V4L2_CTRL_ID2CLASS(id)`` returns
152the control class ID based on a control ID.
153
154If the driver does not support extended controls, then
155``VIDIOC_QUERYCTRL`` will fail when used in combination with
156``V4L2_CTRL_FLAG_NEXT_CTRL``. In that case the old method of enumerating
157control should be used (see :ref:`enum_all_controls`). But if it is
158supported, then it is guaranteed to enumerate over all controls,
159including driver-private controls.
160
161
162Creating Control Panels
163=======================
164
165It is possible to create control panels for a graphical user interface
166where the user can select the various controls. Basically you will have
167to iterate over all controls using the method described above. Each
168control class starts with a control of type
169``V4L2_CTRL_TYPE_CTRL_CLASS``. ``VIDIOC_QUERYCTRL`` will return the name
170of this control class which can be used as the title of a tab page
171within a control panel.
172
173The flags field of struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` also
174contains hints on the behavior of the control. See the
175:ref:`VIDIOC_QUERYCTRL` documentation for more
176details.
177
178
179.. _mpeg-controls:
180
181Codec Control Reference
182=======================
183
184Below all controls within the Codec control class are described. First
185the generic controls, then controls specific for certain hardware.
186
187.. note:: These controls are applicable to all codecs and not just MPEG. The
188 defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls
189 were originally made for MPEG codecs and later extended to cover all
190 encoding formats.
191
192
193Generic Codec Controls
194----------------------
195
196
197.. _mpeg-control-id:
198
199Codec Control IDs
200^^^^^^^^^^^^^^^^^
201
202``V4L2_CID_MPEG_CLASS (class)``
203 The Codec class descriptor. Calling
204 :ref:`VIDIOC_QUERYCTRL` for this control will
205 return a description of this control class. This description can be
206 used as the caption of a Tab page in a GUI, for example.
207
208.. _v4l2-mpeg-stream-type:
209
210``V4L2_CID_MPEG_STREAM_TYPE (enum v4l2_mpeg_stream_type)``
211 The MPEG-1, -2 or -4 output stream type. One cannot assume anything
212 here. Each hardware MPEG encoder tends to support different subsets
213 of the available MPEG stream types. This control is specific to
214 multiplexed MPEG streams. The currently defined stream types are:
215
216
217
218.. flat-table::
219 :header-rows: 0
220 :stub-columns: 0
221
222
223 - .. row 1
224
225 - ``V4L2_MPEG_STREAM_TYPE_MPEG2_PS``
226
227 - MPEG-2 program stream
228
229 - .. row 2
230
231 - ``V4L2_MPEG_STREAM_TYPE_MPEG2_TS``
232
233 - MPEG-2 transport stream
234
235 - .. row 3
236
237 - ``V4L2_MPEG_STREAM_TYPE_MPEG1_SS``
238
239 - MPEG-1 system stream
240
241 - .. row 4
242
243 - ``V4L2_MPEG_STREAM_TYPE_MPEG2_DVD``
244
245 - MPEG-2 DVD-compatible stream
246
247 - .. row 5
248
249 - ``V4L2_MPEG_STREAM_TYPE_MPEG1_VCD``
250
251 - MPEG-1 VCD-compatible stream
252
253 - .. row 6
254
255 - ``V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD``
256
257 - MPEG-2 SVCD-compatible stream
258
259
260
261``V4L2_CID_MPEG_STREAM_PID_PMT (integer)``
262 Program Map Table Packet ID for the MPEG transport stream (default
263 16)
264
265``V4L2_CID_MPEG_STREAM_PID_AUDIO (integer)``
266 Audio Packet ID for the MPEG transport stream (default 256)
267
268``V4L2_CID_MPEG_STREAM_PID_VIDEO (integer)``
269 Video Packet ID for the MPEG transport stream (default 260)
270
271``V4L2_CID_MPEG_STREAM_PID_PCR (integer)``
272 Packet ID for the MPEG transport stream carrying PCR fields (default
273 259)
274
275``V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (integer)``
276 Audio ID for MPEG PES
277
278``V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (integer)``
279 Video ID for MPEG PES
280
281.. _v4l2-mpeg-stream-vbi-fmt:
282
283``V4L2_CID_MPEG_STREAM_VBI_FMT (enum v4l2_mpeg_stream_vbi_fmt)``
284 Some cards can embed VBI data (e. g. Closed Caption, Teletext) into
285 the MPEG stream. This control selects whether VBI data should be
286 embedded, and if so, what embedding method should be used. The list
287 of possible VBI formats depends on the driver. The currently defined
288 VBI format types are:
289
290
291
292.. flat-table::
293 :header-rows: 0
294 :stub-columns: 0
295
296
297 - .. row 1
298
299 - ``V4L2_MPEG_STREAM_VBI_FMT_NONE``
300
301 - No VBI in the MPEG stream
302
303 - .. row 2
304
305 - ``V4L2_MPEG_STREAM_VBI_FMT_IVTV``
306
307 - VBI in private packets, IVTV format (documented in the kernel
308 sources in the file
309 ``Documentation/video4linux/cx2341x/README.vbi``)
310
311
312
313.. _v4l2-mpeg-audio-sampling-freq:
314
315``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (enum v4l2_mpeg_audio_sampling_freq)``
316 MPEG Audio sampling frequency. Possible values are:
317
318
319
320.. flat-table::
321 :header-rows: 0
322 :stub-columns: 0
323
324
325 - .. row 1
326
327 - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100``
328
329 - 44.1 kHz
330
331 - .. row 2
332
333 - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000``
334
335 - 48 kHz
336
337 - .. row 3
338
339 - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000``
340
341 - 32 kHz
342
343
344
345.. _v4l2-mpeg-audio-encoding:
346
347``V4L2_CID_MPEG_AUDIO_ENCODING (enum v4l2_mpeg_audio_encoding)``
348 MPEG Audio encoding. This control is specific to multiplexed MPEG
349 streams. Possible values are:
350
351
352
353.. flat-table::
354 :header-rows: 0
355 :stub-columns: 0
356
357
358 - .. row 1
359
360 - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_1``
361
362 - MPEG-1/2 Layer I encoding
363
364 - .. row 2
365
366 - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_2``
367
368 - MPEG-1/2 Layer II encoding
369
370 - .. row 3
371
372 - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_3``
373
374 - MPEG-1/2 Layer III encoding
375
376 - .. row 4
377
378 - ``V4L2_MPEG_AUDIO_ENCODING_AAC``
379
380 - MPEG-2/4 AAC (Advanced Audio Coding)
381
382 - .. row 5
383
384 - ``V4L2_MPEG_AUDIO_ENCODING_AC3``
385
386 - AC-3 aka ATSC A/52 encoding
387
388
389
390.. _v4l2-mpeg-audio-l1-bitrate:
391
392``V4L2_CID_MPEG_AUDIO_L1_BITRATE (enum v4l2_mpeg_audio_l1_bitrate)``
393 MPEG-1/2 Layer I bitrate. Possible values are:
394
395
396
397.. flat-table::
398 :header-rows: 0
399 :stub-columns: 0
400
401
402 - .. row 1
403
404 - ``V4L2_MPEG_AUDIO_L1_BITRATE_32K``
405
406 - 32 kbit/s
407
408 - .. row 2
409
410 - ``V4L2_MPEG_AUDIO_L1_BITRATE_64K``
411
412 - 64 kbit/s
413
414 - .. row 3
415
416 - ``V4L2_MPEG_AUDIO_L1_BITRATE_96K``
417
418 - 96 kbit/s
419
420 - .. row 4
421
422 - ``V4L2_MPEG_AUDIO_L1_BITRATE_128K``
423
424 - 128 kbit/s
425
426 - .. row 5
427
428 - ``V4L2_MPEG_AUDIO_L1_BITRATE_160K``
429
430 - 160 kbit/s
431
432 - .. row 6
433
434 - ``V4L2_MPEG_AUDIO_L1_BITRATE_192K``
435
436 - 192 kbit/s
437
438 - .. row 7
439
440 - ``V4L2_MPEG_AUDIO_L1_BITRATE_224K``
441
442 - 224 kbit/s
443
444 - .. row 8
445
446 - ``V4L2_MPEG_AUDIO_L1_BITRATE_256K``
447
448 - 256 kbit/s
449
450 - .. row 9
451
452 - ``V4L2_MPEG_AUDIO_L1_BITRATE_288K``
453
454 - 288 kbit/s
455
456 - .. row 10
457
458 - ``V4L2_MPEG_AUDIO_L1_BITRATE_320K``
459
460 - 320 kbit/s
461
462 - .. row 11
463
464 - ``V4L2_MPEG_AUDIO_L1_BITRATE_352K``
465
466 - 352 kbit/s
467
468 - .. row 12
469
470 - ``V4L2_MPEG_AUDIO_L1_BITRATE_384K``
471
472 - 384 kbit/s
473
474 - .. row 13
475
476 - ``V4L2_MPEG_AUDIO_L1_BITRATE_416K``
477
478 - 416 kbit/s
479
480 - .. row 14
481
482 - ``V4L2_MPEG_AUDIO_L1_BITRATE_448K``
483
484 - 448 kbit/s
485
486
487
488.. _v4l2-mpeg-audio-l2-bitrate:
489
490``V4L2_CID_MPEG_AUDIO_L2_BITRATE (enum v4l2_mpeg_audio_l2_bitrate)``
491 MPEG-1/2 Layer II bitrate. Possible values are:
492
493
494
495.. flat-table::
496 :header-rows: 0
497 :stub-columns: 0
498
499
500 - .. row 1
501
502 - ``V4L2_MPEG_AUDIO_L2_BITRATE_32K``
503
504 - 32 kbit/s
505
506 - .. row 2
507
508 - ``V4L2_MPEG_AUDIO_L2_BITRATE_48K``
509
510 - 48 kbit/s
511
512 - .. row 3
513
514 - ``V4L2_MPEG_AUDIO_L2_BITRATE_56K``
515
516 - 56 kbit/s
517
518 - .. row 4
519
520 - ``V4L2_MPEG_AUDIO_L2_BITRATE_64K``
521
522 - 64 kbit/s
523
524 - .. row 5
525
526 - ``V4L2_MPEG_AUDIO_L2_BITRATE_80K``
527
528 - 80 kbit/s
529
530 - .. row 6
531
532 - ``V4L2_MPEG_AUDIO_L2_BITRATE_96K``
533
534 - 96 kbit/s
535
536 - .. row 7
537
538 - ``V4L2_MPEG_AUDIO_L2_BITRATE_112K``
539
540 - 112 kbit/s
541
542 - .. row 8
543
544 - ``V4L2_MPEG_AUDIO_L2_BITRATE_128K``
545
546 - 128 kbit/s
547
548 - .. row 9
549
550 - ``V4L2_MPEG_AUDIO_L2_BITRATE_160K``
551
552 - 160 kbit/s
553
554 - .. row 10
555
556 - ``V4L2_MPEG_AUDIO_L2_BITRATE_192K``
557
558 - 192 kbit/s
559
560 - .. row 11
561
562 - ``V4L2_MPEG_AUDIO_L2_BITRATE_224K``
563
564 - 224 kbit/s
565
566 - .. row 12
567
568 - ``V4L2_MPEG_AUDIO_L2_BITRATE_256K``
569
570 - 256 kbit/s
571
572 - .. row 13
573
574 - ``V4L2_MPEG_AUDIO_L2_BITRATE_320K``
575
576 - 320 kbit/s
577
578 - .. row 14
579
580 - ``V4L2_MPEG_AUDIO_L2_BITRATE_384K``
581
582 - 384 kbit/s
583
584
585
586.. _v4l2-mpeg-audio-l3-bitrate:
587
588``V4L2_CID_MPEG_AUDIO_L3_BITRATE (enum v4l2_mpeg_audio_l3_bitrate)``
589 MPEG-1/2 Layer III bitrate. Possible values are:
590
591
592
593.. flat-table::
594 :header-rows: 0
595 :stub-columns: 0
596
597
598 - .. row 1
599
600 - ``V4L2_MPEG_AUDIO_L3_BITRATE_32K``
601
602 - 32 kbit/s
603
604 - .. row 2
605
606 - ``V4L2_MPEG_AUDIO_L3_BITRATE_40K``
607
608 - 40 kbit/s
609
610 - .. row 3
611
612 - ``V4L2_MPEG_AUDIO_L3_BITRATE_48K``
613
614 - 48 kbit/s
615
616 - .. row 4
617
618 - ``V4L2_MPEG_AUDIO_L3_BITRATE_56K``
619
620 - 56 kbit/s
621
622 - .. row 5
623
624 - ``V4L2_MPEG_AUDIO_L3_BITRATE_64K``
625
626 - 64 kbit/s
627
628 - .. row 6
629
630 - ``V4L2_MPEG_AUDIO_L3_BITRATE_80K``
631
632 - 80 kbit/s
633
634 - .. row 7
635
636 - ``V4L2_MPEG_AUDIO_L3_BITRATE_96K``
637
638 - 96 kbit/s
639
640 - .. row 8
641
642 - ``V4L2_MPEG_AUDIO_L3_BITRATE_112K``
643
644 - 112 kbit/s
645
646 - .. row 9
647
648 - ``V4L2_MPEG_AUDIO_L3_BITRATE_128K``
649
650 - 128 kbit/s
651
652 - .. row 10
653
654 - ``V4L2_MPEG_AUDIO_L3_BITRATE_160K``
655
656 - 160 kbit/s
657
658 - .. row 11
659
660 - ``V4L2_MPEG_AUDIO_L3_BITRATE_192K``
661
662 - 192 kbit/s
663
664 - .. row 12
665
666 - ``V4L2_MPEG_AUDIO_L3_BITRATE_224K``
667
668 - 224 kbit/s
669
670 - .. row 13
671
672 - ``V4L2_MPEG_AUDIO_L3_BITRATE_256K``
673
674 - 256 kbit/s
675
676 - .. row 14
677
678 - ``V4L2_MPEG_AUDIO_L3_BITRATE_320K``
679
680 - 320 kbit/s
681
682
683
684``V4L2_CID_MPEG_AUDIO_AAC_BITRATE (integer)``
685 AAC bitrate in bits per second.
686
687.. _v4l2-mpeg-audio-ac3-bitrate:
688
689``V4L2_CID_MPEG_AUDIO_AC3_BITRATE (enum v4l2_mpeg_audio_ac3_bitrate)``
690 AC-3 bitrate. Possible values are:
691
692
693
694.. flat-table::
695 :header-rows: 0
696 :stub-columns: 0
697
698
699 - .. row 1
700
701 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_32K``
702
703 - 32 kbit/s
704
705 - .. row 2
706
707 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_40K``
708
709 - 40 kbit/s
710
711 - .. row 3
712
713 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_48K``
714
715 - 48 kbit/s
716
717 - .. row 4
718
719 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_56K``
720
721 - 56 kbit/s
722
723 - .. row 5
724
725 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_64K``
726
727 - 64 kbit/s
728
729 - .. row 6
730
731 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_80K``
732
733 - 80 kbit/s
734
735 - .. row 7
736
737 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_96K``
738
739 - 96 kbit/s
740
741 - .. row 8
742
743 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_112K``
744
745 - 112 kbit/s
746
747 - .. row 9
748
749 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_128K``
750
751 - 128 kbit/s
752
753 - .. row 10
754
755 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_160K``
756
757 - 160 kbit/s
758
759 - .. row 11
760
761 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_192K``
762
763 - 192 kbit/s
764
765 - .. row 12
766
767 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_224K``
768
769 - 224 kbit/s
770
771 - .. row 13
772
773 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_256K``
774
775 - 256 kbit/s
776
777 - .. row 14
778
779 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_320K``
780
781 - 320 kbit/s
782
783 - .. row 15
784
785 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_384K``
786
787 - 384 kbit/s
788
789 - .. row 16
790
791 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_448K``
792
793 - 448 kbit/s
794
795 - .. row 17
796
797 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_512K``
798
799 - 512 kbit/s
800
801 - .. row 18
802
803 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_576K``
804
805 - 576 kbit/s
806
807 - .. row 19
808
809 - ``V4L2_MPEG_AUDIO_AC3_BITRATE_640K``
810
811 - 640 kbit/s
812
813
814
815.. _v4l2-mpeg-audio-mode:
816
817``V4L2_CID_MPEG_AUDIO_MODE (enum v4l2_mpeg_audio_mode)``
818 MPEG Audio mode. Possible values are:
819
820
821
822.. flat-table::
823 :header-rows: 0
824 :stub-columns: 0
825
826
827 - .. row 1
828
829 - ``V4L2_MPEG_AUDIO_MODE_STEREO``
830
831 - Stereo
832
833 - .. row 2
834
835 - ``V4L2_MPEG_AUDIO_MODE_JOINT_STEREO``
836
837 - Joint Stereo
838
839 - .. row 3
840
841 - ``V4L2_MPEG_AUDIO_MODE_DUAL``
842
843 - Bilingual
844
845 - .. row 4
846
847 - ``V4L2_MPEG_AUDIO_MODE_MONO``
848
849 - Mono
850
851
852
853.. _v4l2-mpeg-audio-mode-extension:
854
855``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (enum v4l2_mpeg_audio_mode_extension)``
856 Joint Stereo audio mode extension. In Layer I and II they indicate
857 which subbands are in intensity stereo. All other subbands are coded
858 in stereo. Layer III is not (yet) supported. Possible values are:
859
860
861
862.. flat-table::
863 :header-rows: 0
864 :stub-columns: 0
865
866
867 - .. row 1
868
869 - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4``
870
871 - Subbands 4-31 in intensity stereo
872
873 - .. row 2
874
875 - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8``
876
877 - Subbands 8-31 in intensity stereo
878
879 - .. row 3
880
881 - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12``
882
883 - Subbands 12-31 in intensity stereo
884
885 - .. row 4
886
887 - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16``
888
889 - Subbands 16-31 in intensity stereo
890
891
892
893.. _v4l2-mpeg-audio-emphasis:
894
895``V4L2_CID_MPEG_AUDIO_EMPHASIS (enum v4l2_mpeg_audio_emphasis)``
896 Audio Emphasis. Possible values are:
897
898
899
900.. flat-table::
901 :header-rows: 0
902 :stub-columns: 0
903
904
905 - .. row 1
906
907 - ``V4L2_MPEG_AUDIO_EMPHASIS_NONE``
908
909 - None
910
911 - .. row 2
912
913 - ``V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS``
914
915 - 50/15 microsecond emphasis
916
917 - .. row 3
918
919 - ``V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17``
920
921 - CCITT J.17
922
923
924
925.. _v4l2-mpeg-audio-crc:
926
927``V4L2_CID_MPEG_AUDIO_CRC (enum v4l2_mpeg_audio_crc)``
928 CRC method. Possible values are:
929
930
931
932.. flat-table::
933 :header-rows: 0
934 :stub-columns: 0
935
936
937 - .. row 1
938
939 - ``V4L2_MPEG_AUDIO_CRC_NONE``
940
941 - None
942
943 - .. row 2
944
945 - ``V4L2_MPEG_AUDIO_CRC_CRC16``
946
947 - 16 bit parity check
948
949
950
951``V4L2_CID_MPEG_AUDIO_MUTE (boolean)``
952 Mutes the audio when capturing. This is not done by muting audio
953 hardware, which can still produce a slight hiss, but in the encoder
954 itself, guaranteeing a fixed and reproducible audio bitstream. 0 =
955 unmuted, 1 = muted.
956
957.. _v4l2-mpeg-audio-dec-playback:
958
959``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (enum v4l2_mpeg_audio_dec_playback)``
960 Determines how monolingual audio should be played back. Possible
961 values are:
962
963
964
965.. flat-table::
966 :header-rows: 0
967 :stub-columns: 0
968
969
970 - .. row 1
971
972 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO``
973
974 - Automatically determines the best playback mode.
975
976 - .. row 2
977
978 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO``
979
980 - Stereo playback.
981
982 - .. row 3
983
984 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT``
985
986 - Left channel playback.
987
988 - .. row 4
989
990 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT``
991
992 - Right channel playback.
993
994 - .. row 5
995
996 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO``
997
998 - Mono playback.
999
1000 - .. row 6
1001
1002 - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO``
1003
1004 - Stereo playback with swapped left and right channels.
1005
1006
1007
1008.. _v4l2-mpeg-audio-dec-multilingual-playback:
1009
1010``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (enum v4l2_mpeg_audio_dec_playback)``
1011 Determines how multilingual audio should be played back.
1012
1013.. _v4l2-mpeg-video-encoding:
1014
1015``V4L2_CID_MPEG_VIDEO_ENCODING (enum v4l2_mpeg_video_encoding)``
1016 MPEG Video encoding method. This control is specific to multiplexed
1017 MPEG streams. Possible values are:
1018
1019
1020
1021.. flat-table::
1022 :header-rows: 0
1023 :stub-columns: 0
1024
1025
1026 - .. row 1
1027
1028 - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_1``
1029
1030 - MPEG-1 Video encoding
1031
1032 - .. row 2
1033
1034 - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_2``
1035
1036 - MPEG-2 Video encoding
1037
1038 - .. row 3
1039
1040 - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC``
1041
1042 - MPEG-4 AVC (H.264) Video encoding
1043
1044
1045
1046.. _v4l2-mpeg-video-aspect:
1047
1048``V4L2_CID_MPEG_VIDEO_ASPECT (enum v4l2_mpeg_video_aspect)``
1049 Video aspect. Possible values are:
1050
1051
1052
1053.. flat-table::
1054 :header-rows: 0
1055 :stub-columns: 0
1056
1057
1058 - .. row 1
1059
1060 - ``V4L2_MPEG_VIDEO_ASPECT_1x1``
1061
1062 - .. row 2
1063
1064 - ``V4L2_MPEG_VIDEO_ASPECT_4x3``
1065
1066 - .. row 3
1067
1068 - ``V4L2_MPEG_VIDEO_ASPECT_16x9``
1069
1070 - .. row 4
1071
1072 - ``V4L2_MPEG_VIDEO_ASPECT_221x100``
1073
1074
1075
1076``V4L2_CID_MPEG_VIDEO_B_FRAMES (integer)``
1077 Number of B-Frames (default 2)
1078
1079``V4L2_CID_MPEG_VIDEO_GOP_SIZE (integer)``
1080 GOP size (default 12)
1081
1082``V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (boolean)``
1083 GOP closure (default 1)
1084
1085``V4L2_CID_MPEG_VIDEO_PULLDOWN (boolean)``
1086 Enable 3:2 pulldown (default 0)
1087
1088.. _v4l2-mpeg-video-bitrate-mode:
1089
1090``V4L2_CID_MPEG_VIDEO_BITRATE_MODE (enum v4l2_mpeg_video_bitrate_mode)``
1091 Video bitrate mode. Possible values are:
1092
1093
1094
1095.. flat-table::
1096 :header-rows: 0
1097 :stub-columns: 0
1098
1099
1100 - .. row 1
1101
1102 - ``V4L2_MPEG_VIDEO_BITRATE_MODE_VBR``
1103
1104 - Variable bitrate
1105
1106 - .. row 2
1107
1108 - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CBR``
1109
1110 - Constant bitrate
1111
1112
1113
1114``V4L2_CID_MPEG_VIDEO_BITRATE (integer)``
1115 Video bitrate in bits per second.
1116
1117``V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (integer)``
1118 Peak video bitrate in bits per second. Must be larger or equal to
1119 the average video bitrate. It is ignored if the video bitrate mode
1120 is set to constant bitrate.
1121
1122``V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (integer)``
1123 For every captured frame, skip this many subsequent frames (default
1124 0).
1125
1126``V4L2_CID_MPEG_VIDEO_MUTE (boolean)``
1127 "Mutes" the video to a fixed color when capturing. This is useful
1128 for testing, to produce a fixed video bitstream. 0 = unmuted, 1 =
1129 muted.
1130
1131``V4L2_CID_MPEG_VIDEO_MUTE_YUV (integer)``
1132 Sets the "mute" color of the video. The supplied 32-bit integer is
1133 interpreted as follows (bit 0 = least significant bit):
1134
1135
1136
1137.. flat-table::
1138 :header-rows: 0
1139 :stub-columns: 0
1140
1141
1142 - .. row 1
1143
1144 - Bit 0:7
1145
1146 - V chrominance information
1147
1148 - .. row 2
1149
1150 - Bit 8:15
1151
1152 - U chrominance information
1153
1154 - .. row 3
1155
1156 - Bit 16:23
1157
1158 - Y luminance information
1159
1160 - .. row 4
1161
1162 - Bit 24:31
1163
1164 - Must be zero.
1165
1166
1167
1168.. _v4l2-mpeg-video-dec-pts:
1169
1170``V4L2_CID_MPEG_VIDEO_DEC_PTS (integer64)``
1171 This read-only control returns the 33-bit video Presentation Time
1172 Stamp as defined in ITU T-REC-H.222.0 and ISO/IEC 13818-1 of the
1173 currently displayed frame. This is the same PTS as is used in
1174 :ref:`VIDIOC_DECODER_CMD`.
1175
1176.. _v4l2-mpeg-video-dec-frame:
1177
1178``V4L2_CID_MPEG_VIDEO_DEC_FRAME (integer64)``
1179 This read-only control returns the frame counter of the frame that
1180 is currently displayed (decoded). This value is reset to 0 whenever
1181 the decoder is started.
1182
1183``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)``
1184 If enabled the decoder expects to receive a single slice per buffer,
1185 otherwise the decoder expects a single frame in per buffer.
1186 Applicable to the decoder, all codecs.
1187
1188``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)``
1189 Enable writing sample aspect ratio in the Video Usability
1190 Information. Applicable to the H264 encoder.
1191
1192.. _v4l2-mpeg-video-h264-vui-sar-idc:
1193
1194``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (enum v4l2_mpeg_video_h264_vui_sar_idc)``
1195 VUI sample aspect ratio indicator for H.264 encoding. The value is
1196 defined in the table E-1 in the standard. Applicable to the H264
1197 encoder.
1198
1199
1200
1201.. flat-table::
1202 :header-rows: 0
1203 :stub-columns: 0
1204
1205
1206 - .. row 1
1207
1208 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED``
1209
1210 - Unspecified
1211
1212 - .. row 2
1213
1214 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1``
1215
1216 - 1x1
1217
1218 - .. row 3
1219
1220 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11``
1221
1222 - 12x11
1223
1224 - .. row 4
1225
1226 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11``
1227
1228 - 10x11
1229
1230 - .. row 5
1231
1232 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11``
1233
1234 - 16x11
1235
1236 - .. row 6
1237
1238 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33``
1239
1240 - 40x33
1241
1242 - .. row 7
1243
1244 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11``
1245
1246 - 24x11
1247
1248 - .. row 8
1249
1250 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11``
1251
1252 - 20x11
1253
1254 - .. row 9
1255
1256 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11``
1257
1258 - 32x11
1259
1260 - .. row 10
1261
1262 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33``
1263
1264 - 80x33
1265
1266 - .. row 11
1267
1268 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11``
1269
1270 - 18x11
1271
1272 - .. row 12
1273
1274 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11``
1275
1276 - 15x11
1277
1278 - .. row 13
1279
1280 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33``
1281
1282 - 64x33
1283
1284 - .. row 14
1285
1286 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99``
1287
1288 - 160x99
1289
1290 - .. row 15
1291
1292 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3``
1293
1294 - 4x3
1295
1296 - .. row 16
1297
1298 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2``
1299
1300 - 3x2
1301
1302 - .. row 17
1303
1304 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1``
1305
1306 - 2x1
1307
1308 - .. row 18
1309
1310 - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED``
1311
1312 - Extended SAR
1313
1314
1315
1316``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (integer)``
1317 Extended sample aspect ratio width for H.264 VUI encoding.
1318 Applicable to the H264 encoder.
1319
1320``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (integer)``
1321 Extended sample aspect ratio height for H.264 VUI encoding.
1322 Applicable to the H264 encoder.
1323
1324.. _v4l2-mpeg-video-h264-level:
1325
1326``V4L2_CID_MPEG_VIDEO_H264_LEVEL (enum v4l2_mpeg_video_h264_level)``
1327 The level information for the H264 video elementary stream.
1328 Applicable to the H264 encoder. Possible values are:
1329
1330
1331
1332.. flat-table::
1333 :header-rows: 0
1334 :stub-columns: 0
1335
1336
1337 - .. row 1
1338
1339 - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_0``
1340
1341 - Level 1.0
1342
1343 - .. row 2
1344
1345 - ``V4L2_MPEG_VIDEO_H264_LEVEL_1B``
1346
1347 - Level 1B
1348
1349 - .. row 3
1350
1351 - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_1``
1352
1353 - Level 1.1
1354
1355 - .. row 4
1356
1357 - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_2``
1358
1359 - Level 1.2
1360
1361 - .. row 5
1362
1363 - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_3``
1364
1365 - Level 1.3
1366
1367 - .. row 6
1368
1369 - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_0``
1370
1371 - Level 2.0
1372
1373 - .. row 7
1374
1375 - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_1``
1376
1377 - Level 2.1
1378
1379 - .. row 8
1380
1381 - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_2``
1382
1383 - Level 2.2
1384
1385 - .. row 9
1386
1387 - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_0``
1388
1389 - Level 3.0
1390
1391 - .. row 10
1392
1393 - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_1``
1394
1395 - Level 3.1
1396
1397 - .. row 11
1398
1399 - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_2``
1400
1401 - Level 3.2
1402
1403 - .. row 12
1404
1405 - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_0``
1406
1407 - Level 4.0
1408
1409 - .. row 13
1410
1411 - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_1``
1412
1413 - Level 4.1
1414
1415 - .. row 14
1416
1417 - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_2``
1418
1419 - Level 4.2
1420
1421 - .. row 15
1422
1423 - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_0``
1424
1425 - Level 5.0
1426
1427 - .. row 16
1428
1429 - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_1``
1430
1431 - Level 5.1
1432
1433
1434
1435.. _v4l2-mpeg-video-mpeg4-level:
1436
1437``V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (enum v4l2_mpeg_video_mpeg4_level)``
1438 The level information for the MPEG4 elementary stream. Applicable to
1439 the MPEG4 encoder. Possible values are:
1440
1441
1442
1443.. flat-table::
1444 :header-rows: 0
1445 :stub-columns: 0
1446
1447
1448 - .. row 1
1449
1450 - ``V4L2_MPEG_VIDEO_LEVEL_0``
1451
1452 - Level 0
1453
1454 - .. row 2
1455
1456 - ``V4L2_MPEG_VIDEO_LEVEL_0B``
1457
1458 - Level 0b
1459
1460 - .. row 3
1461
1462 - ``V4L2_MPEG_VIDEO_LEVEL_1``
1463
1464 - Level 1
1465
1466 - .. row 4
1467
1468 - ``V4L2_MPEG_VIDEO_LEVEL_2``
1469
1470 - Level 2
1471
1472 - .. row 5
1473
1474 - ``V4L2_MPEG_VIDEO_LEVEL_3``
1475
1476 - Level 3
1477
1478 - .. row 6
1479
1480 - ``V4L2_MPEG_VIDEO_LEVEL_3B``
1481
1482 - Level 3b
1483
1484 - .. row 7
1485
1486 - ``V4L2_MPEG_VIDEO_LEVEL_4``
1487
1488 - Level 4
1489
1490 - .. row 8
1491
1492 - ``V4L2_MPEG_VIDEO_LEVEL_5``
1493
1494 - Level 5
1495
1496
1497
1498.. _v4l2-mpeg-video-h264-profile:
1499
1500``V4L2_CID_MPEG_VIDEO_H264_PROFILE (enum v4l2_mpeg_video_h264_profile)``
1501 The profile information for H264. Applicable to the H264 encoder.
1502 Possible values are:
1503
1504
1505
1506.. flat-table::
1507 :header-rows: 0
1508 :stub-columns: 0
1509
1510
1511 - .. row 1
1512
1513 - ``V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE``
1514
1515 - Baseline profile
1516
1517 - .. row 2
1518
1519 - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE``
1520
1521 - Constrained Baseline profile
1522
1523 - .. row 3
1524
1525 - ``V4L2_MPEG_VIDEO_H264_PROFILE_MAIN``
1526
1527 - Main profile
1528
1529 - .. row 4
1530
1531 - ``V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED``
1532
1533 - Extended profile
1534
1535 - .. row 5
1536
1537 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH``
1538
1539 - High profile
1540
1541 - .. row 6
1542
1543 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10``
1544
1545 - High 10 profile
1546
1547 - .. row 7
1548
1549 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422``
1550
1551 - High 422 profile
1552
1553 - .. row 8
1554
1555 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE``
1556
1557 - High 444 Predictive profile
1558
1559 - .. row 9
1560
1561 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA``
1562
1563 - High 10 Intra profile
1564
1565 - .. row 10
1566
1567 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA``
1568
1569 - High 422 Intra profile
1570
1571 - .. row 11
1572
1573 - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA``
1574
1575 - High 444 Intra profile
1576
1577 - .. row 12
1578
1579 - ``V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA``
1580
1581 - CAVLC 444 Intra profile
1582
1583 - .. row 13
1584
1585 - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE``
1586
1587 - Scalable Baseline profile
1588
1589 - .. row 14
1590
1591 - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH``
1592
1593 - Scalable High profile
1594
1595 - .. row 15
1596
1597 - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA``
1598
1599 - Scalable High Intra profile
1600
1601 - .. row 16
1602
1603 - ``V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH``
1604
1605 - Stereo High profile
1606
1607 - .. row 17
1608
1609 - ``V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH``
1610
1611 - Multiview High profile
1612
1613
1614
1615.. _v4l2-mpeg-video-mpeg4-profile:
1616
1617``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (enum v4l2_mpeg_video_mpeg4_profile)``
1618 The profile information for MPEG4. Applicable to the MPEG4 encoder.
1619 Possible values are:
1620
1621
1622
1623.. flat-table::
1624 :header-rows: 0
1625 :stub-columns: 0
1626
1627
1628 - .. row 1
1629
1630 - ``V4L2_MPEG_VIDEO_PROFILE_SIMPLE``
1631
1632 - Simple profile
1633
1634 - .. row 2
1635
1636 - ``V4L2_MPEG_VIDEO_PROFILE_ADVANCED_SIMPLE``
1637
1638 - Advanced Simple profile
1639
1640 - .. row 3
1641
1642 - ``V4L2_MPEG_VIDEO_PROFILE_CORE``
1643
1644 - Core profile
1645
1646 - .. row 4
1647
1648 - ``V4L2_MPEG_VIDEO_PROFILE_SIMPLE_SCALABLE``
1649
1650 - Simple Scalable profile
1651
1652 - .. row 5
1653
1654 - ``V4L2_MPEG_VIDEO_PROFILE_ADVANCED_CODING_EFFICIENCY``
1655
1656 -
1657
1658
1659
1660``V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (integer)``
1661 The maximum number of reference pictures used for encoding.
1662 Applicable to the encoder.
1663
1664.. _v4l2-mpeg-video-multi-slice-mode:
1665
1666``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (enum v4l2_mpeg_video_multi_slice_mode)``
1667 Determines how the encoder should handle division of frame into
1668 slices. Applicable to the encoder. Possible values are:
1669
1670
1671
1672.. flat-table::
1673 :header-rows: 0
1674 :stub-columns: 0
1675
1676
1677 - .. row 1
1678
1679 - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE``
1680
1681 - Single slice per frame.
1682
1683 - .. row 2
1684
1685 - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``
1686
1687 - Multiple slices with set maximum number of macroblocks per slice.
1688
1689 - .. row 3
1690
1691 - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``
1692
1693 - Multiple slice with set maximum size in bytes per slice.
1694
1695
1696
1697``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (integer)``
1698 The maximum number of macroblocks in a slice. Used when
1699 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1700 ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``. Applicable to the
1701 encoder.
1702
1703``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (integer)``
1704 The maximum size of a slice in bytes. Used when
1705 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1706 ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``. Applicable to the
1707 encoder.
1708
1709.. _v4l2-mpeg-video-h264-loop-filter-mode:
1710
1711``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (enum v4l2_mpeg_video_h264_loop_filter_mode)``
1712 Loop filter mode for H264 encoder. Possible values are:
1713
1714
1715
1716.. flat-table::
1717 :header-rows: 0
1718 :stub-columns: 0
1719
1720
1721 - .. row 1
1722
1723 - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED``
1724
1725 - Loop filter is enabled.
1726
1727 - .. row 2
1728
1729 - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED``
1730
1731 - Loop filter is disabled.
1732
1733 - .. row 3
1734
1735 - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
1736
1737 - Loop filter is disabled at the slice boundary.
1738
1739
1740
1741``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (integer)``
1742 Loop filter alpha coefficient, defined in the H264 standard.
1743 Applicable to the H264 encoder.
1744
1745``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (integer)``
1746 Loop filter beta coefficient, defined in the H264 standard.
1747 Applicable to the H264 encoder.
1748
1749.. _v4l2-mpeg-video-h264-entropy-mode:
1750
1751``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (enum v4l2_mpeg_video_h264_entropy_mode)``
1752 Entropy coding mode for H264 - CABAC/CAVALC. Applicable to the H264
1753 encoder. Possible values are:
1754
1755
1756
1757.. flat-table::
1758 :header-rows: 0
1759 :stub-columns: 0
1760
1761
1762 - .. row 1
1763
1764 - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC``
1765
1766 - Use CAVLC entropy coding.
1767
1768 - .. row 2
1769
1770 - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC``
1771
1772 - Use CABAC entropy coding.
1773
1774
1775
1776``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
1777 Enable 8X8 transform for H264. Applicable to the H264 encoder.
1778
1779``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
1780 Cyclic intra macroblock refresh. This is the number of continuous
1781 macroblocks refreshed every frame. Each frame a successive set of
1782 macroblocks is refreshed until the cycle completes and starts from
1783 the top of the frame. Applicable to H264, H263 and MPEG4 encoder.
1784
1785``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)``
1786 Frame level rate control enable. If this control is disabled then
1787 the quantization parameter for each frame type is constant and set
1788 with appropriate controls (e.g.
1789 ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP``). If frame rate control is
1790 enabled then quantization parameter is adjusted to meet the chosen
1791 bitrate. Minimum and maximum value for the quantization parameter
1792 can be set with appropriate controls (e.g.
1793 ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP``). Applicable to encoders.
1794
1795``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (boolean)``
1796 Macroblock level rate control enable. Applicable to the MPEG4 and
1797 H264 encoders.
1798
1799``V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (boolean)``
1800 Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4
1801 encoder.
1802
1803``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (integer)``
1804 Quantization parameter for an I frame for H263. Valid range: from 1
1805 to 31.
1806
1807``V4L2_CID_MPEG_VIDEO_H263_MIN_QP (integer)``
1808 Minimum quantization parameter for H263. Valid range: from 1 to 31.
1809
1810``V4L2_CID_MPEG_VIDEO_H263_MAX_QP (integer)``
1811 Maximum quantization parameter for H263. Valid range: from 1 to 31.
1812
1813``V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (integer)``
1814 Quantization parameter for an P frame for H263. Valid range: from 1
1815 to 31.
1816
1817``V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (integer)``
1818 Quantization parameter for an B frame for H263. Valid range: from 1
1819 to 31.
1820
1821``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (integer)``
1822 Quantization parameter for an I frame for H264. Valid range: from 0
1823 to 51.
1824
1825``V4L2_CID_MPEG_VIDEO_H264_MIN_QP (integer)``
1826 Minimum quantization parameter for H264. Valid range: from 0 to 51.
1827
1828``V4L2_CID_MPEG_VIDEO_H264_MAX_QP (integer)``
1829 Maximum quantization parameter for H264. Valid range: from 0 to 51.
1830
1831``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (integer)``
1832 Quantization parameter for an P frame for H264. Valid range: from 0
1833 to 51.
1834
1835``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (integer)``
1836 Quantization parameter for an B frame for H264. Valid range: from 0
1837 to 51.
1838
1839``V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (integer)``
1840 Quantization parameter for an I frame for MPEG4. Valid range: from 1
1841 to 31.
1842
1843``V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (integer)``
1844 Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.
1845
1846``V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (integer)``
1847 Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.
1848
1849``V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (integer)``
1850 Quantization parameter for an P frame for MPEG4. Valid range: from 1
1851 to 31.
1852
1853``V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (integer)``
1854 Quantization parameter for an B frame for MPEG4. Valid range: from 1
1855 to 31.
1856
1857``V4L2_CID_MPEG_VIDEO_VBV_SIZE (integer)``
1858 The Video Buffer Verifier size in kilobytes, it is used as a
1859 limitation of frame skip. The VBV is defined in the standard as a
1860 mean to verify that the produced stream will be successfully
1861 decoded. The standard describes it as "Part of a hypothetical
1862 decoder that is conceptually connected to the output of the encoder.
1863 Its purpose is to provide a constraint on the variability of the
1864 data rate that an encoder or editing process may produce.".
1865 Applicable to the MPEG1, MPEG2, MPEG4 encoders.
1866
1867.. _v4l2-mpeg-video-vbv-delay:
1868
1869``V4L2_CID_MPEG_VIDEO_VBV_DELAY (integer)``
1870 Sets the initial delay in milliseconds for VBV buffer control.
1871
1872.. _v4l2-mpeg-video-hor-search-range:
1873
1874``V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (integer)``
1875 Horizontal search range defines maximum horizontal search area in
1876 pixels to search and match for the present Macroblock (MB) in the
1877 reference picture. This V4L2 control macro is used to set horizontal
1878 search range for motion estimation module in video encoder.
1879
1880.. _v4l2-mpeg-video-vert-search-range:
1881
1882``V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (integer)``
1883 Vertical search range defines maximum vertical search area in pixels
1884 to search and match for the present Macroblock (MB) in the reference
1885 picture. This V4L2 control macro is used to set vertical search
1886 range for motion estimation module in video encoder.
1887
1888.. _v4l2-mpeg-video-force-key-frame:
1889
1890``V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (button)``
1891 Force a key frame for the next queued buffer. Applicable to
1892 encoders. This is a general, codec-agnostic keyframe control.
1893
1894``V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (integer)``
1895 The Coded Picture Buffer size in kilobytes, it is used as a
1896 limitation of frame skip. The CPB is defined in the H264 standard as
1897 a mean to verify that the produced stream will be successfully
1898 decoded. Applicable to the H264 encoder.
1899
1900``V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (integer)``
1901 Period between I-frames in the open GOP for H264. In case of an open
1902 GOP this is the period between two I-frames. The period between IDR
1903 (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE
1904 control. An IDR frame, which stands for Instantaneous Decoding
1905 Refresh is an I-frame after which no prior frames are referenced.
1906 This means that a stream can be restarted from an IDR frame without
1907 the need to store or decode any previous frames. Applicable to the
1908 H264 encoder.
1909
1910.. _v4l2-mpeg-video-header-mode:
1911
1912``V4L2_CID_MPEG_VIDEO_HEADER_MODE (enum v4l2_mpeg_video_header_mode)``
1913 Determines whether the header is returned as the first buffer or is
1914 it returned together with the first frame. Applicable to encoders.
1915 Possible values are:
1916
1917
1918
1919.. flat-table::
1920 :header-rows: 0
1921 :stub-columns: 0
1922
1923
1924 - .. row 1
1925
1926 - ``V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE``
1927
1928 - The stream header is returned separately in the first buffer.
1929
1930 - .. row 2
1931
1932 - ``V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME``
1933
1934 - The stream header is returned together with the first encoded
1935 frame.
1936
1937
1938
1939``V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (boolean)``
1940 Repeat the video sequence headers. Repeating these headers makes
1941 random access to the video stream easier. Applicable to the MPEG1, 2
1942 and 4 encoder.
1943
1944``V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (boolean)``
1945 Enabled the deblocking post processing filter for MPEG4 decoder.
1946 Applicable to the MPEG4 decoder.
1947
1948``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (integer)``
1949 vop_time_increment_resolution value for MPEG4. Applicable to the
1950 MPEG4 encoder.
1951
1952``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (integer)``
1953 vop_time_increment value for MPEG4. Applicable to the MPEG4
1954 encoder.
1955
1956``V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (boolean)``
1957 Enable generation of frame packing supplemental enhancement
1958 information in the encoded bitstream. The frame packing SEI message
1959 contains the arrangement of L and R planes for 3D viewing.
1960 Applicable to the H264 encoder.
1961
1962``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (boolean)``
1963 Sets current frame as frame0 in frame packing SEI. Applicable to the
1964 H264 encoder.
1965
1966.. _v4l2-mpeg-video-h264-sei-fp-arrangement-type:
1967
1968``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (enum v4l2_mpeg_video_h264_sei_fp_arrangement_type)``
1969 Frame packing arrangement type for H264 SEI. Applicable to the H264
1970 encoder. Possible values are:
1971
1972
1973
1974.. flat-table::
1975 :header-rows: 0
1976 :stub-columns: 0
1977
1978
1979 - .. row 1
1980
1981 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD``
1982
1983 - Pixels are alternatively from L and R.
1984
1985 - .. row 2
1986
1987 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN``
1988
1989 - L and R are interlaced by column.
1990
1991 - .. row 3
1992
1993 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW``
1994
1995 - L and R are interlaced by row.
1996
1997 - .. row 4
1998
1999 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE``
2000
2001 - L is on the left, R on the right.
2002
2003 - .. row 5
2004
2005 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM``
2006
2007 - L is on top, R on bottom.
2008
2009 - .. row 6
2010
2011 - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL``
2012
2013 - One view per frame.
2014
2015
2016
2017``V4L2_CID_MPEG_VIDEO_H264_FMO (boolean)``
2018 Enables flexible macroblock ordering in the encoded bitstream. It is
2019 a technique used for restructuring the ordering of macroblocks in
2020 pictures. Applicable to the H264 encoder.
2021
2022.. _v4l2-mpeg-video-h264-fmo-map-type:
2023
2024``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (enum v4l2_mpeg_video_h264_fmo_map_type)``
2025 When using FMO, the map type divides the image in different scan
2026 patterns of macroblocks. Applicable to the H264 encoder. Possible
2027 values are:
2028
2029
2030
2031.. flat-table::
2032 :header-rows: 0
2033 :stub-columns: 0
2034
2035
2036 - .. row 1
2037
2038 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES``
2039
2040 - Slices are interleaved one after other with macroblocks in run
2041 length order.
2042
2043 - .. row 2
2044
2045 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES``
2046
2047 - Scatters the macroblocks based on a mathematical function known to
2048 both encoder and decoder.
2049
2050 - .. row 3
2051
2052 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER``
2053
2054 - Macroblocks arranged in rectangular areas or regions of interest.
2055
2056 - .. row 4
2057
2058 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT``
2059
2060 - Slice groups grow in a cyclic way from centre to outwards.
2061
2062 - .. row 5
2063
2064 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN``
2065
2066 - Slice groups grow in raster scan pattern from left to right.
2067
2068 - .. row 6
2069
2070 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN``
2071
2072 - Slice groups grow in wipe scan pattern from top to bottom.
2073
2074 - .. row 7
2075
2076 - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT``
2077
2078 - User defined map type.
2079
2080
2081
2082``V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (integer)``
2083 Number of slice groups in FMO. Applicable to the H264 encoder.
2084
2085.. _v4l2-mpeg-video-h264-fmo-change-direction:
2086
2087``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (enum v4l2_mpeg_video_h264_fmo_change_dir)``
2088 Specifies a direction of the slice group change for raster and wipe
2089 maps. Applicable to the H264 encoder. Possible values are:
2090
2091
2092
2093.. flat-table::
2094 :header-rows: 0
2095 :stub-columns: 0
2096
2097
2098 - .. row 1
2099
2100 - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT``
2101
2102 - Raster scan or wipe right.
2103
2104 - .. row 2
2105
2106 - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT``
2107
2108 - Reverse raster scan or wipe left.
2109
2110
2111
2112``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (integer)``
2113 Specifies the size of the first slice group for raster and wipe map.
2114 Applicable to the H264 encoder.
2115
2116``V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (integer)``
2117 Specifies the number of consecutive macroblocks for the interleaved
2118 map. Applicable to the H264 encoder.
2119
2120``V4L2_CID_MPEG_VIDEO_H264_ASO (boolean)``
2121 Enables arbitrary slice ordering in encoded bitstream. Applicable to
2122 the H264 encoder.
2123
2124``V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (integer)``
2125 Specifies the slice order in ASO. Applicable to the H264 encoder.
2126 The supplied 32-bit integer is interpreted as follows (bit 0 = least
2127 significant bit):
2128
2129
2130
2131.. flat-table::
2132 :header-rows: 0
2133 :stub-columns: 0
2134
2135
2136 - .. row 1
2137
2138 - Bit 0:15
2139
2140 - Slice ID
2141
2142 - .. row 2
2143
2144 - Bit 16:32
2145
2146 - Slice position or order
2147
2148
2149
2150``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (boolean)``
2151 Enables H264 hierarchical coding. Applicable to the H264 encoder.
2152
2153.. _v4l2-mpeg-video-h264-hierarchical-coding-type:
2154
2155``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (enum v4l2_mpeg_video_h264_hierarchical_coding_type)``
2156 Specifies the hierarchical coding type. Applicable to the H264
2157 encoder. Possible values are:
2158
2159
2160
2161.. flat-table::
2162 :header-rows: 0
2163 :stub-columns: 0
2164
2165
2166 - .. row 1
2167
2168 - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B``
2169
2170 - Hierarchical B coding.
2171
2172 - .. row 2
2173
2174 - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P``
2175
2176 - Hierarchical P coding.
2177
2178
2179
2180``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (integer)``
2181 Specifies the number of hierarchical coding layers. Applicable to
2182 the H264 encoder.
2183
2184``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (integer)``
2185 Specifies a user defined QP for each layer. Applicable to the H264
2186 encoder. The supplied 32-bit integer is interpreted as follows (bit
2187 0 = least significant bit):
2188
2189
2190
2191.. flat-table::
2192 :header-rows: 0
2193 :stub-columns: 0
2194
2195
2196 - .. row 1
2197
2198 - Bit 0:15
2199
2200 - QP value
2201
2202 - .. row 2
2203
2204 - Bit 16:32
2205
2206 - Layer number
2207
2208
2209
2210
2211MFC 5.1 MPEG Controls
2212---------------------
2213
2214The following MPEG class controls deal with MPEG decoding and encoding
2215settings that are specific to the Multi Format Codec 5.1 device present
2216in the S5P family of SoCs by Samsung.
2217
2218
2219.. _mfc51-control-id:
2220
2221MFC 5.1 Control IDs
2222^^^^^^^^^^^^^^^^^^^
2223
2224``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (boolean)``
2225 If the display delay is enabled then the decoder is forced to return
2226 a CAPTURE buffer (decoded frame) after processing a certain number
2227 of OUTPUT buffers. The delay can be set through
2228 ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY``. This
2229 feature can be used for example for generating thumbnails of videos.
2230 Applicable to the H264 decoder.
2231
2232``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (integer)``
2233 Display delay value for H264 decoder. The decoder is forced to
2234 return a decoded frame after the set 'display delay' number of
2235 frames. If this number is low it may result in frames returned out
2236 of dispaly order, in addition the hardware may still be using the
2237 returned buffer as a reference picture for subsequent frames.
2238
2239``V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (integer)``
2240 The number of reference pictures used for encoding a P picture.
2241 Applicable to the H264 encoder.
2242
2243``V4L2_CID_MPEG_MFC51_VIDEO_PADDING (boolean)``
2244 Padding enable in the encoder - use a color instead of repeating
2245 border pixels. Applicable to encoders.
2246
2247``V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (integer)``
2248 Padding color in the encoder. Applicable to encoders. The supplied
2249 32-bit integer is interpreted as follows (bit 0 = least significant
2250 bit):
2251
2252
2253
2254.. flat-table::
2255 :header-rows: 0
2256 :stub-columns: 0
2257
2258
2259 - .. row 1
2260
2261 - Bit 0:7
2262
2263 - V chrominance information
2264
2265 - .. row 2
2266
2267 - Bit 8:15
2268
2269 - U chrominance information
2270
2271 - .. row 3
2272
2273 - Bit 16:23
2274
2275 - Y luminance information
2276
2277 - .. row 4
2278
2279 - Bit 24:31
2280
2281 - Must be zero.
2282
2283
2284
2285``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)``
2286 Reaction coefficient for MFC rate control. Applicable to encoders.
2287
2288 .. note::
2289
2290 #. Valid only when the frame level RC is enabled.
2291
2292 #. For tight CBR, this field must be small (ex. 2 ~ 10). For
2293 VBR, this field must be large (ex. 100 ~ 1000).
2294
2295 #. It is not recommended to use the greater number than
2296 FRAME_RATE * (10^9 / BIT_RATE).
2297
2298``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)``
2299 Adaptive rate control for dark region. Valid only when H.264 and
2300 macroblock level RC is enabled
2301 (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2302 encoder.
2303
2304``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (boolean)``
2305 Adaptive rate control for smooth region. Valid only when H.264 and
2306 macroblock level RC is enabled
2307 (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2308 encoder.
2309
2310``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (boolean)``
2311 Adaptive rate control for static region. Valid only when H.264 and
2312 macroblock level RC is enabled
2313 (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2314 encoder.
2315
2316``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (boolean)``
2317 Adaptive rate control for activity region. Valid only when H.264 and
2318 macroblock level RC is enabled
2319 (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2320 encoder.
2321
2322.. _v4l2-mpeg-mfc51-video-frame-skip-mode:
2323
2324``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (enum v4l2_mpeg_mfc51_video_frame_skip_mode)``
2325 Indicates in what conditions the encoder should skip frames. If
2326 encoding a frame would cause the encoded stream to be larger then a
2327 chosen data limit then the frame will be skipped. Possible values
2328 are:
2329
2330
2331
2332.. flat-table::
2333 :header-rows: 0
2334 :stub-columns: 0
2335
2336
2337 - .. row 1
2338
2339 - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED``
2340
2341 - Frame skip mode is disabled.
2342
2343 - .. row 2
2344
2345 - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT``
2346
2347 - Frame skip mode enabled and buffer limit is set by the chosen
2348 level and is defined by the standard.
2349
2350 - .. row 3
2351
2352 - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_BUF_LIMIT``
2353
2354 - Frame skip mode enabled and buffer limit is set by the VBV
2355 (MPEG1/2/4) or CPB (H264) buffer size control.
2356
2357
2358
2359``V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (integer)``
2360 Enable rate-control with fixed target bit. If this setting is
2361 enabled, then the rate control logic of the encoder will calculate
2362 the average bitrate for a GOP and keep it below or equal the set
2363 bitrate target. Otherwise the rate control logic calculates the
2364 overall average bitrate for the stream and keeps it below or equal
2365 to the set bitrate. In the first case the average bitrate for the
2366 whole stream will be smaller then the set bitrate. This is caused
2367 because the average is calculated for smaller number of frames, on
2368 the other hand enabling this setting will ensure that the stream
2369 will meet tight bandwidth constraints. Applicable to encoders.
2370
2371.. _v4l2-mpeg-mfc51-video-force-frame-type:
2372
2373``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (enum v4l2_mpeg_mfc51_video_force_frame_type)``
2374 Force a frame type for the next queued buffer. Applicable to
2375 encoders. Possible values are:
2376
2377
2378
2379.. flat-table::
2380 :header-rows: 0
2381 :stub-columns: 0
2382
2383
2384 - .. row 1
2385
2386 - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED``
2387
2388 - Forcing a specific frame type disabled.
2389
2390 - .. row 2
2391
2392 - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME``
2393
2394 - Force an I-frame.
2395
2396 - .. row 3
2397
2398 - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED``
2399
2400 - Force a non-coded frame.
2401
2402
2403
2404
2405CX2341x MPEG Controls
2406---------------------
2407
2408The following MPEG class controls deal with MPEG encoding settings that
2409are specific to the Conexant CX23415 and CX23416 MPEG encoding chips.
2410
2411
2412.. _cx2341x-control-id:
2413
2414CX2341x Control IDs
2415^^^^^^^^^^^^^^^^^^^
2416
2417.. _v4l2-mpeg-cx2341x-video-spatial-filter-mode:
2418
2419``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (enum v4l2_mpeg_cx2341x_video_spatial_filter_mode)``
2420 Sets the Spatial Filter mode (default ``MANUAL``). Possible values
2421 are:
2422
2423
2424
2425.. flat-table::
2426 :header-rows: 0
2427 :stub-columns: 0
2428
2429
2430 - .. row 1
2431
2432 - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL``
2433
2434 - Choose the filter manually
2435
2436 - .. row 2
2437
2438 - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO``
2439
2440 - Choose the filter automatically
2441
2442
2443
2444``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (integer (0-15))``
2445 The setting for the Spatial Filter. 0 = off, 15 = maximum. (Default
2446 is 0.)
2447
2448.. _luma-spatial-filter-type:
2449
2450``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type)``
2451 Select the algorithm to use for the Luma Spatial Filter (default
2452 ``1D_HOR``). Possible values:
2453
2454
2455
2456.. flat-table::
2457 :header-rows: 0
2458 :stub-columns: 0
2459
2460
2461 - .. row 1
2462
2463 - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF``
2464
2465 - No filter
2466
2467 - .. row 2
2468
2469 - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR``
2470
2471 - One-dimensional horizontal
2472
2473 - .. row 3
2474
2475 - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT``
2476
2477 - One-dimensional vertical
2478
2479 - .. row 4
2480
2481 - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE``
2482
2483 - Two-dimensional separable
2484
2485 - .. row 5
2486
2487 - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE``
2488
2489 - Two-dimensional symmetrical non-separable
2490
2491
2492
2493.. _chroma-spatial-filter-type:
2494
2495``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type)``
2496 Select the algorithm for the Chroma Spatial Filter (default
2497 ``1D_HOR``). Possible values are:
2498
2499
2500
2501.. flat-table::
2502 :header-rows: 0
2503 :stub-columns: 0
2504
2505
2506 - .. row 1
2507
2508 - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF``
2509
2510 - No filter
2511
2512 - .. row 2
2513
2514 - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR``
2515
2516 - One-dimensional horizontal
2517
2518
2519
2520.. _v4l2-mpeg-cx2341x-video-temporal-filter-mode:
2521
2522``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (enum v4l2_mpeg_cx2341x_video_temporal_filter_mode)``
2523 Sets the Temporal Filter mode (default ``MANUAL``). Possible values
2524 are:
2525
2526
2527
2528.. flat-table::
2529 :header-rows: 0
2530 :stub-columns: 0
2531
2532
2533 - .. row 1
2534
2535 - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL``
2536
2537 - Choose the filter manually
2538
2539 - .. row 2
2540
2541 - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO``
2542
2543 - Choose the filter automatically
2544
2545
2546
2547``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (integer (0-31))``
2548 The setting for the Temporal Filter. 0 = off, 31 = maximum. (Default
2549 is 8 for full-scale capturing and 0 for scaled capturing.)
2550
2551.. _v4l2-mpeg-cx2341x-video-median-filter-type:
2552
2553``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_median_filter_type)``
2554 Median Filter Type (default ``OFF``). Possible values are:
2555
2556
2557
2558.. flat-table::
2559 :header-rows: 0
2560 :stub-columns: 0
2561
2562
2563 - .. row 1
2564
2565 - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF``
2566
2567 - No filter
2568
2569 - .. row 2
2570
2571 - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR``
2572
2573 - Horizontal filter
2574
2575 - .. row 3
2576
2577 - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT``
2578
2579 - Vertical filter
2580
2581 - .. row 4
2582
2583 - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT``
2584
2585 - Horizontal and vertical filter
2586
2587 - .. row 5
2588
2589 - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG``
2590
2591 - Diagonal filter
2592
2593
2594
2595``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2596 Threshold above which the luminance median filter is enabled
2597 (default 0)
2598
2599``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (integer (0-255))``
2600 Threshold below which the luminance median filter is enabled
2601 (default 255)
2602
2603``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2604 Threshold above which the chroma median filter is enabled (default
2605 0)
2606
2607``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (integer (0-255))``
2608 Threshold below which the chroma median filter is enabled (default
2609 255)
2610
2611``V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (boolean)``
2612 The CX2341X MPEG encoder can insert one empty MPEG-2 PES packet into
2613 the stream between every four video frames. The packet size is 2048
2614 bytes, including the packet_start_code_prefix and stream_id
2615 fields. The stream_id is 0xBF (private stream 2). The payload
2616 consists of 0x00 bytes, to be filled in by the application. 0 = do
2617 not insert, 1 = insert packets.
2618
2619
2620VPX Control Reference
2621---------------------
2622
2623The VPX controls include controls for encoding parameters of VPx video
2624codec.
2625
2626
2627.. _vpx-control-id:
2628
2629VPX Control IDs
2630^^^^^^^^^^^^^^^
2631
2632.. _v4l2-vpx-num-partitions:
2633
2634``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (enum v4l2_vp8_num_partitions)``
2635 The number of token partitions to use in VP8 encoder. Possible
2636 values are:
2637
2638
2639
2640.. flat-table::
2641 :header-rows: 0
2642 :stub-columns: 0
2643
2644
2645 - .. row 1
2646
2647 - ``V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION``
2648
2649 - 1 coefficient partition
2650
2651 - .. row 2
2652
2653 - ``V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS``
2654
2655 - 2 coefficient partitions
2656
2657 - .. row 3
2658
2659 - ``V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS``
2660
2661 - 4 coefficient partitions
2662
2663 - .. row 4
2664
2665 - ``V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS``
2666
2667 - 8 coefficient partitions
2668
2669
2670
2671``V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (boolean)``
2672 Setting this prevents intra 4x4 mode in the intra mode decision.
2673
2674.. _v4l2-vpx-num-ref-frames:
2675
2676``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (enum v4l2_vp8_num_ref_frames)``
2677 The number of reference pictures for encoding P frames. Possible
2678 values are:
2679
2680
2681
2682.. flat-table::
2683 :header-rows: 0
2684 :stub-columns: 0
2685
2686
2687 - .. row 1
2688
2689 - ``V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME``
2690
2691 - Last encoded frame will be searched
2692
2693 - .. row 2
2694
2695 - ``V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME``
2696
2697 - Two frames will be searched among the last encoded frame, the
2698 golden frame and the alternate reference (altref) frame. The
2699 encoder implementation will decide which two are chosen.
2700
2701 - .. row 3
2702
2703 - ``V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME``
2704
2705 - The last encoded frame, the golden frame and the altref frame will
2706 be searched.
2707
2708
2709
2710``V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (integer)``
2711 Indicates the loop filter level. The adjustment of the loop filter
2712 level is done via a delta value against a baseline loop filter
2713 value.
2714
2715``V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (integer)``
2716 This parameter affects the loop filter. Anything above zero weakens
2717 the deblocking effect on the loop filter.
2718
2719``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (integer)``
2720 Sets the refresh period for the golden frame. The period is defined
2721 in number of frames. For a value of 'n', every nth frame starting
2722 from the first key frame will be taken as a golden frame. For eg.
2723 for encoding sequence of 0, 1, 2, 3, 4, 5, 6, 7 where the golden
2724 frame refresh period is set as 4, the frames 0, 4, 8 etc will be
2725 taken as the golden frames as frame 0 is always a key frame.
2726
2727.. _v4l2-vpx-golden-frame-sel:
2728
2729``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (enum v4l2_vp8_golden_frame_sel)``
2730 Selects the golden frame for encoding. Possible values are:
2731
2732
2733
2734.. flat-table::
2735 :header-rows: 0
2736 :stub-columns: 0
2737
2738
2739 - .. row 1
2740
2741 - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV``
2742
2743 - Use the (n-2)th frame as a golden frame, current frame index being
2744 'n'.
2745
2746 - .. row 2
2747
2748 - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD``
2749
2750 - Use the previous specific frame indicated by
2751 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD as a
2752 golden frame.
2753
2754
2755
2756``V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (integer)``
2757 Minimum quantization parameter for VP8.
2758
2759``V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (integer)``
2760 Maximum quantization parameter for VP8.
2761
2762``V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (integer)``
2763 Quantization parameter for an I frame for VP8.
2764
2765``V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (integer)``
2766 Quantization parameter for a P frame for VP8.
2767
2768``V4L2_CID_MPEG_VIDEO_VPX_PROFILE (integer)``
2769 Select the desired profile for VPx encoder. Acceptable values are 0,
2770 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
2771
2772
2773.. _camera-controls:
2774
2775Camera Control Reference
2776========================
2777
2778The Camera class includes controls for mechanical (or equivalent
2779digital) features of a device such as controllable lenses or sensors.
2780
2781
2782.. _camera-control-id:
2783
2784Camera Control IDs
2785------------------
2786
2787``V4L2_CID_CAMERA_CLASS (class)``
2788 The Camera class descriptor. Calling
2789 :ref:`VIDIOC_QUERYCTRL` for this control will
2790 return a description of this control class.
2791
2792.. _v4l2-exposure-auto-type:
2793
2794``V4L2_CID_EXPOSURE_AUTO (enum v4l2_exposure_auto_type)``
2795 Enables automatic adjustments of the exposure time and/or iris
2796 aperture. The effect of manual changes of the exposure time or iris
2797 aperture while these features are enabled is undefined, drivers
2798 should ignore such requests. Possible values are:
2799
2800
2801
2802.. flat-table::
2803 :header-rows: 0
2804 :stub-columns: 0
2805
2806
2807 - .. row 1
2808
2809 - ``V4L2_EXPOSURE_AUTO``
2810
2811 - Automatic exposure time, automatic iris aperture.
2812
2813 - .. row 2
2814
2815 - ``V4L2_EXPOSURE_MANUAL``
2816
2817 - Manual exposure time, manual iris.
2818
2819 - .. row 3
2820
2821 - ``V4L2_EXPOSURE_SHUTTER_PRIORITY``
2822
2823 - Manual exposure time, auto iris.
2824
2825 - .. row 4
2826
2827 - ``V4L2_EXPOSURE_APERTURE_PRIORITY``
2828
2829 - Auto exposure time, manual iris.
2830
2831
2832
2833``V4L2_CID_EXPOSURE_ABSOLUTE (integer)``
2834 Determines the exposure time of the camera sensor. The exposure time
2835 is limited by the frame interval. Drivers should interpret the
2836 values as 100 µs units, where the value 1 stands for 1/10000th of a
2837 second, 10000 for 1 second and 100000 for 10 seconds.
2838
2839``V4L2_CID_EXPOSURE_AUTO_PRIORITY (boolean)``
2840 When ``V4L2_CID_EXPOSURE_AUTO`` is set to ``AUTO`` or
2841 ``APERTURE_PRIORITY``, this control determines if the device may
2842 dynamically vary the frame rate. By default this feature is disabled
2843 (0) and the frame rate must remain constant.
2844
2845``V4L2_CID_EXPOSURE_BIAS (integer menu)``
2846 Determines the automatic exposure compensation, it is effective only
2847 when ``V4L2_CID_EXPOSURE_AUTO`` control is set to ``AUTO``,
2848 ``SHUTTER_PRIORITY`` or ``APERTURE_PRIORITY``. It is expressed in
2849 terms of EV, drivers should interpret the values as 0.001 EV units,
2850 where the value 1000 stands for +1 EV.
2851
2852 Increasing the exposure compensation value is equivalent to
2853 decreasing the exposure value (EV) and will increase the amount of
2854 light at the image sensor. The camera performs the exposure
2855 compensation by adjusting absolute exposure time and/or aperture.
2856
2857.. _v4l2-exposure-metering:
2858
2859``V4L2_CID_EXPOSURE_METERING (enum v4l2_exposure_metering)``
2860 Determines how the camera measures the amount of light available for
2861 the frame exposure. Possible values are:
2862
2863
2864
2865.. flat-table::
2866 :header-rows: 0
2867 :stub-columns: 0
2868
2869
2870 - .. row 1
2871
2872 - ``V4L2_EXPOSURE_METERING_AVERAGE``
2873
2874 - Use the light information coming from the entire frame and average
2875 giving no weighting to any particular portion of the metered area.
2876
2877 - .. row 2
2878
2879 - ``V4L2_EXPOSURE_METERING_CENTER_WEIGHTED``
2880
2881 - Average the light information coming from the entire frame giving
2882 priority to the center of the metered area.
2883
2884 - .. row 3
2885
2886 - ``V4L2_EXPOSURE_METERING_SPOT``
2887
2888 - Measure only very small area at the center of the frame.
2889
2890 - .. row 4
2891
2892 - ``V4L2_EXPOSURE_METERING_MATRIX``
2893
2894 - A multi-zone metering. The light intensity is measured in several
2895 points of the frame and the results are combined. The algorithm of
2896 the zones selection and their significance in calculating the
2897 final value is device dependent.
2898
2899
2900
2901``V4L2_CID_PAN_RELATIVE (integer)``
2902 This control turns the camera horizontally by the specified amount.
2903 The unit is undefined. A positive value moves the camera to the
2904 right (clockwise when viewed from above), a negative value to the
2905 left. A value of zero does not cause motion. This is a write-only
2906 control.
2907
2908``V4L2_CID_TILT_RELATIVE (integer)``
2909 This control turns the camera vertically by the specified amount.
2910 The unit is undefined. A positive value moves the camera up, a
2911 negative value down. A value of zero does not cause motion. This is
2912 a write-only control.
2913
2914``V4L2_CID_PAN_RESET (button)``
2915 When this control is set, the camera moves horizontally to the
2916 default position.
2917
2918``V4L2_CID_TILT_RESET (button)``
2919 When this control is set, the camera moves vertically to the default
2920 position.
2921
2922``V4L2_CID_PAN_ABSOLUTE (integer)``
2923 This control turns the camera horizontally to the specified
2924 position. Positive values move the camera to the right (clockwise
2925 when viewed from above), negative values to the left. Drivers should
2926 interpret the values as arc seconds, with valid values between -180
2927 * 3600 and +180 * 3600 inclusive.
2928
2929``V4L2_CID_TILT_ABSOLUTE (integer)``
2930 This control turns the camera vertically to the specified position.
2931 Positive values move the camera up, negative values down. Drivers
2932 should interpret the values as arc seconds, with valid values
2933 between -180 * 3600 and +180 * 3600 inclusive.
2934
2935``V4L2_CID_FOCUS_ABSOLUTE (integer)``
2936 This control sets the focal point of the camera to the specified
2937 position. The unit is undefined. Positive values set the focus
2938 closer to the camera, negative values towards infinity.
2939
2940``V4L2_CID_FOCUS_RELATIVE (integer)``
2941 This control moves the focal point of the camera by the specified
2942 amount. The unit is undefined. Positive values move the focus closer
2943 to the camera, negative values towards infinity. This is a
2944 write-only control.
2945
2946``V4L2_CID_FOCUS_AUTO (boolean)``
2947 Enables continuous automatic focus adjustments. The effect of manual
2948 focus adjustments while this feature is enabled is undefined,
2949 drivers should ignore such requests.
2950
2951``V4L2_CID_AUTO_FOCUS_START (button)``
2952 Starts single auto focus process. The effect of setting this control
2953 when ``V4L2_CID_FOCUS_AUTO`` is set to ``TRUE`` (1) is undefined,
2954 drivers should ignore such requests.
2955
2956``V4L2_CID_AUTO_FOCUS_STOP (button)``
2957 Aborts automatic focusing started with ``V4L2_CID_AUTO_FOCUS_START``
2958 control. It is effective only when the continuous autofocus is
2959 disabled, that is when ``V4L2_CID_FOCUS_AUTO`` control is set to
2960 ``FALSE`` (0).
2961
2962.. _v4l2-auto-focus-status:
2963
2964``V4L2_CID_AUTO_FOCUS_STATUS (bitmask)``
2965 The automatic focus status. This is a read-only control.
2966
2967 Setting ``V4L2_LOCK_FOCUS`` lock bit of the ``V4L2_CID_3A_LOCK``
2968 control may stop updates of the ``V4L2_CID_AUTO_FOCUS_STATUS``
2969 control value.
2970
2971
2972
2973.. flat-table::
2974 :header-rows: 0
2975 :stub-columns: 0
2976
2977
2978 - .. row 1
2979
2980 - ``V4L2_AUTO_FOCUS_STATUS_IDLE``
2981
2982 - Automatic focus is not active.
2983
2984 - .. row 2
2985
2986 - ``V4L2_AUTO_FOCUS_STATUS_BUSY``
2987
2988 - Automatic focusing is in progress.
2989
2990 - .. row 3
2991
2992 - ``V4L2_AUTO_FOCUS_STATUS_REACHED``
2993
2994 - Focus has been reached.
2995
2996 - .. row 4
2997
2998 - ``V4L2_AUTO_FOCUS_STATUS_FAILED``
2999
3000 - Automatic focus has failed, the driver will not transition from
3001 this state until another action is performed by an application.
3002
3003
3004
3005.. _v4l2-auto-focus-range:
3006
3007``V4L2_CID_AUTO_FOCUS_RANGE (enum v4l2_auto_focus_range)``
3008 Determines auto focus distance range for which lens may be adjusted.
3009
3010
3011
3012.. flat-table::
3013 :header-rows: 0
3014 :stub-columns: 0
3015
3016
3017 - .. row 1
3018
3019 - ``V4L2_AUTO_FOCUS_RANGE_AUTO``
3020
3021 - The camera automatically selects the focus range.
3022
3023 - .. row 2
3024
3025 - ``V4L2_AUTO_FOCUS_RANGE_NORMAL``
3026
3027 - Normal distance range, limited for best automatic focus
3028 performance.
3029
3030 - .. row 3
3031
3032 - ``V4L2_AUTO_FOCUS_RANGE_MACRO``
3033
3034 - Macro (close-up) auto focus. The camera will use its minimum
3035 possible distance for auto focus.
3036
3037 - .. row 4
3038
3039 - ``V4L2_AUTO_FOCUS_RANGE_INFINITY``
3040
3041 - The lens is set to focus on an object at infinite distance.
3042
3043
3044
3045``V4L2_CID_ZOOM_ABSOLUTE (integer)``
3046 Specify the objective lens focal length as an absolute value. The
3047 zoom unit is driver-specific and its value should be a positive
3048 integer.
3049
3050``V4L2_CID_ZOOM_RELATIVE (integer)``
3051 Specify the objective lens focal length relatively to the current
3052 value. Positive values move the zoom lens group towards the
3053 telephoto direction, negative values towards the wide-angle
3054 direction. The zoom unit is driver-specific. This is a write-only
3055 control.
3056
3057``V4L2_CID_ZOOM_CONTINUOUS (integer)``
3058 Move the objective lens group at the specified speed until it
3059 reaches physical device limits or until an explicit request to stop
3060 the movement. A positive value moves the zoom lens group towards the
3061 telephoto direction. A value of zero stops the zoom lens group
3062 movement. A negative value moves the zoom lens group towards the
3063 wide-angle direction. The zoom speed unit is driver-specific.
3064
3065``V4L2_CID_IRIS_ABSOLUTE (integer)``
3066 This control sets the camera's aperture to the specified value. The
3067 unit is undefined. Larger values open the iris wider, smaller values
3068 close it.
3069
3070``V4L2_CID_IRIS_RELATIVE (integer)``
3071 This control modifies the camera's aperture by the specified amount.
3072 The unit is undefined. Positive values open the iris one step
3073 further, negative values close it one step further. This is a
3074 write-only control.
3075
3076``V4L2_CID_PRIVACY (boolean)``
3077 Prevent video from being acquired by the camera. When this control
3078 is set to ``TRUE`` (1), no image can be captured by the camera.
3079 Common means to enforce privacy are mechanical obturation of the
3080 sensor and firmware image processing, but the device is not
3081 restricted to these methods. Devices that implement the privacy
3082 control must support read access and may support write access.
3083
3084``V4L2_CID_BAND_STOP_FILTER (integer)``
3085 Switch the band-stop filter of a camera sensor on or off, or specify
3086 its strength. Such band-stop filters can be used, for example, to
3087 filter out the fluorescent light component.
3088
3089.. _v4l2-auto-n-preset-white-balance:
3090
3091``V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (enum v4l2_auto_n_preset_white_balance)``
3092 Sets white balance to automatic, manual or a preset. The presets
3093 determine color temperature of the light as a hint to the camera for
3094 white balance adjustments resulting in most accurate color
3095 representation. The following white balance presets are listed in
3096 order of increasing color temperature.
3097
3098
3099
3100.. flat-table::
3101 :header-rows: 0
3102 :stub-columns: 0
3103
3104
3105 - .. row 1
3106
3107 - ``V4L2_WHITE_BALANCE_MANUAL``
3108
3109 - Manual white balance.
3110
3111 - .. row 2
3112
3113 - ``V4L2_WHITE_BALANCE_AUTO``
3114
3115 - Automatic white balance adjustments.
3116
3117 - .. row 3
3118
3119 - ``V4L2_WHITE_BALANCE_INCANDESCENT``
3120
3121 - White balance setting for incandescent (tungsten) lighting. It
3122 generally cools down the colors and corresponds approximately to
3123 2500...3500 K color temperature range.
3124
3125 - .. row 4
3126
3127 - ``V4L2_WHITE_BALANCE_FLUORESCENT``
3128
3129 - White balance preset for fluorescent lighting. It corresponds
3130 approximately to 4000...5000 K color temperature.
3131
3132 - .. row 5
3133
3134 - ``V4L2_WHITE_BALANCE_FLUORESCENT_H``
3135
3136 - With this setting the camera will compensate for fluorescent H
3137 lighting.
3138
3139 - .. row 6
3140
3141 - ``V4L2_WHITE_BALANCE_HORIZON``
3142
3143 - White balance setting for horizon daylight. It corresponds
3144 approximately to 5000 K color temperature.
3145
3146 - .. row 7
3147
3148 - ``V4L2_WHITE_BALANCE_DAYLIGHT``
3149
3150 - White balance preset for daylight (with clear sky). It corresponds
3151 approximately to 5000...6500 K color temperature.
3152
3153 - .. row 8
3154
3155 - ``V4L2_WHITE_BALANCE_FLASH``
3156
3157 - With this setting the camera will compensate for the flash light.
3158 It slightly warms up the colors and corresponds roughly to
3159 5000...5500 K color temperature.
3160
3161 - .. row 9
3162
3163 - ``V4L2_WHITE_BALANCE_CLOUDY``
3164
3165 - White balance preset for moderately overcast sky. This option
3166 corresponds approximately to 6500...8000 K color temperature
3167 range.
3168
3169 - .. row 10
3170
3171 - ``V4L2_WHITE_BALANCE_SHADE``
3172
3173 - White balance preset for shade or heavily overcast sky. It
3174 corresponds approximately to 9000...10000 K color temperature.
3175
3176
3177
3178.. _v4l2-wide-dynamic-range:
3179
3180``V4L2_CID_WIDE_DYNAMIC_RANGE (boolean)``
3181 Enables or disables the camera's wide dynamic range feature. This
3182 feature allows to obtain clear images in situations where intensity
3183 of the illumination varies significantly throughout the scene, i.e.
3184 there are simultaneously very dark and very bright areas. It is most
3185 commonly realized in cameras by combining two subsequent frames with
3186 different exposure times. [#f1]_
3187
3188.. _v4l2-image-stabilization:
3189
3190``V4L2_CID_IMAGE_STABILIZATION (boolean)``
3191 Enables or disables image stabilization.
3192
3193``V4L2_CID_ISO_SENSITIVITY (integer menu)``
3194 Determines ISO equivalent of an image sensor indicating the sensor's
3195 sensitivity to light. The numbers are expressed in arithmetic scale,
3196 as per :ref:`iso12232` standard, where doubling the sensor
3197 sensitivity is represented by doubling the numerical ISO value.
3198 Applications should interpret the values as standard ISO values
3199 multiplied by 1000, e.g. control value 800 stands for ISO 0.8.
3200 Drivers will usually support only a subset of standard ISO values.
3201 The effect of setting this control while the
3202 ``V4L2_CID_ISO_SENSITIVITY_AUTO`` control is set to a value other
3203 than ``V4L2_CID_ISO_SENSITIVITY_MANUAL`` is undefined, drivers
3204 should ignore such requests.
3205
3206.. _v4l2-iso-sensitivity-auto-type:
3207
3208``V4L2_CID_ISO_SENSITIVITY_AUTO (enum v4l2_iso_sensitivity_type)``
3209 Enables or disables automatic ISO sensitivity adjustments.
3210
3211
3212
3213.. flat-table::
3214 :header-rows: 0
3215 :stub-columns: 0
3216
3217
3218 - .. row 1
3219
3220 - ``V4L2_CID_ISO_SENSITIVITY_MANUAL``
3221
3222 - Manual ISO sensitivity.
3223
3224 - .. row 2
3225
3226 - ``V4L2_CID_ISO_SENSITIVITY_AUTO``
3227
3228 - Automatic ISO sensitivity adjustments.
3229
3230
3231
3232.. _v4l2-scene-mode:
3233
3234``V4L2_CID_SCENE_MODE (enum v4l2_scene_mode)``
3235 This control allows to select scene programs as the camera automatic
3236 modes optimized for common shooting scenes. Within these modes the
3237 camera determines best exposure, aperture, focusing, light metering,
3238 white balance and equivalent sensitivity. The controls of those
3239 parameters are influenced by the scene mode control. An exact
3240 behavior in each mode is subject to the camera specification.
3241
3242 When the scene mode feature is not used, this control should be set
3243 to ``V4L2_SCENE_MODE_NONE`` to make sure the other possibly related
3244 controls are accessible. The following scene programs are defined:
3245
3246
3247
3248.. flat-table::
3249 :header-rows: 0
3250 :stub-columns: 0
3251
3252
3253 - .. row 1
3254
3255 - ``V4L2_SCENE_MODE_NONE``
3256
3257 - The scene mode feature is disabled.
3258
3259 - .. row 2
3260
3261 - ``V4L2_SCENE_MODE_BACKLIGHT``
3262
3263 - Backlight. Compensates for dark shadows when light is coming from
3264 behind a subject, also by automatically turning on the flash.
3265
3266 - .. row 3
3267
3268 - ``V4L2_SCENE_MODE_BEACH_SNOW``
3269
3270 - Beach and snow. This mode compensates for all-white or bright
3271 scenes, which tend to look gray and low contrast, when camera's
3272 automatic exposure is based on an average scene brightness. To
3273 compensate, this mode automatically slightly overexposes the
3274 frames. The white balance may also be adjusted to compensate for
3275 the fact that reflected snow looks bluish rather than white.
3276
3277 - .. row 4
3278
3279 - ``V4L2_SCENE_MODE_CANDLELIGHT``
3280
3281 - Candle light. The camera generally raises the ISO sensitivity and
3282 lowers the shutter speed. This mode compensates for relatively
3283 close subject in the scene. The flash is disabled in order to
3284 preserve the ambiance of the light.
3285
3286 - .. row 5
3287
3288 - ``V4L2_SCENE_MODE_DAWN_DUSK``
3289
3290 - Dawn and dusk. Preserves the colors seen in low natural light
3291 before dusk and after down. The camera may turn off the flash, and
3292 automatically focus at infinity. It will usually boost saturation
3293 and lower the shutter speed.
3294
3295 - .. row 6
3296
3297 - ``V4L2_SCENE_MODE_FALL_COLORS``
3298
3299 - Fall colors. Increases saturation and adjusts white balance for
3300 color enhancement. Pictures of autumn leaves get saturated reds
3301 and yellows.
3302
3303 - .. row 7
3304
3305 - ``V4L2_SCENE_MODE_FIREWORKS``
3306
3307 - Fireworks. Long exposure times are used to capture the expanding
3308 burst of light from a firework. The camera may invoke image
3309 stabilization.
3310
3311 - .. row 8
3312
3313 - ``V4L2_SCENE_MODE_LANDSCAPE``
3314
3315 - Landscape. The camera may choose a small aperture to provide deep
3316 depth of field and long exposure duration to help capture detail
3317 in dim light conditions. The focus is fixed at infinity. Suitable
3318 for distant and wide scenery.
3319
3320 - .. row 9
3321
3322 - ``V4L2_SCENE_MODE_NIGHT``
3323
3324 - Night, also known as Night Landscape. Designed for low light
3325 conditions, it preserves detail in the dark areas without blowing
3326 out bright objects. The camera generally sets itself to a
3327 medium-to-high ISO sensitivity, with a relatively long exposure
3328 time, and turns flash off. As such, there will be increased image
3329 noise and the possibility of blurred image.
3330
3331 - .. row 10
3332
3333 - ``V4L2_SCENE_MODE_PARTY_INDOOR``
3334
3335 - Party and indoor. Designed to capture indoor scenes that are lit
3336 by indoor background lighting as well as the flash. The camera
3337 usually increases ISO sensitivity, and adjusts exposure for the
3338 low light conditions.
3339
3340 - .. row 11
3341
3342 - ``V4L2_SCENE_MODE_PORTRAIT``
3343
3344 - Portrait. The camera adjusts the aperture so that the depth of
3345 field is reduced, which helps to isolate the subject against a
3346 smooth background. Most cameras recognize the presence of faces in
3347 the scene and focus on them. The color hue is adjusted to enhance
3348 skin tones. The intensity of the flash is often reduced.
3349
3350 - .. row 12
3351
3352 - ``V4L2_SCENE_MODE_SPORTS``
3353
3354 - Sports. Significantly increases ISO and uses a fast shutter speed
3355 to freeze motion of rapidly-moving subjects. Increased image noise
3356 may be seen in this mode.
3357
3358 - .. row 13
3359
3360 - ``V4L2_SCENE_MODE_SUNSET``
3361
3362 - Sunset. Preserves deep hues seen in sunsets and sunrises. It bumps
3363 up the saturation.
3364
3365 - .. row 14
3366
3367 - ``V4L2_SCENE_MODE_TEXT``
3368
3369 - Text. It applies extra contrast and sharpness, it is typically a
3370 black-and-white mode optimized for readability. Automatic focus
3371 may be switched to close-up mode and this setting may also involve
3372 some lens-distortion correction.
3373
3374
3375
3376``V4L2_CID_3A_LOCK (bitmask)``
3377 This control locks or unlocks the automatic focus, exposure and
3378 white balance. The automatic adjustments can be paused independently
3379 by setting the corresponding lock bit to 1. The camera then retains
3380 the settings until the lock bit is cleared. The following lock bits
3381 are defined:
3382
3383 When a given algorithm is not enabled, drivers should ignore
3384 requests to lock it and should return no error. An example might be
3385 an application setting bit ``V4L2_LOCK_WHITE_BALANCE`` when the
3386 ``V4L2_CID_AUTO_WHITE_BALANCE`` control is set to ``FALSE``. The
3387 value of this control may be changed by exposure, white balance or
3388 focus controls.
3389
3390
3391
3392.. flat-table::
3393 :header-rows: 0
3394 :stub-columns: 0
3395
3396
3397 - .. row 1
3398
3399 - ``V4L2_LOCK_EXPOSURE``
3400
3401 - Automatic exposure adjustments lock.
3402
3403 - .. row 2
3404
3405 - ``V4L2_LOCK_WHITE_BALANCE``
3406
3407 - Automatic white balance adjustments lock.
3408
3409 - .. row 3
3410
3411 - ``V4L2_LOCK_FOCUS``
3412
3413 - Automatic focus lock.
3414
3415
3416
3417``V4L2_CID_PAN_SPEED (integer)``
3418 This control turns the camera horizontally at the specific speed.
3419 The unit is undefined. A positive value moves the camera to the
3420 right (clockwise when viewed from above), a negative value to the
3421 left. A value of zero stops the motion if one is in progress and has
3422 no effect otherwise.
3423
3424``V4L2_CID_TILT_SPEED (integer)``
3425 This control turns the camera vertically at the specified speed. The
3426 unit is undefined. A positive value moves the camera up, a negative
3427 value down. A value of zero stops the motion if one is in progress
3428 and has no effect otherwise.
3429
3430
3431.. _fm-tx-controls:
3432
3433FM Transmitter Control Reference
3434================================
3435
3436The FM Transmitter (FM_TX) class includes controls for common features
3437of FM transmissions capable devices. Currently this class includes
3438parameters for audio compression, pilot tone generation, audio deviation
3439limiter, RDS transmission and tuning power features.
3440
3441
3442.. _fm-tx-control-id:
3443
3444FM_TX Control IDs
3445-----------------
3446
3447``V4L2_CID_FM_TX_CLASS (class)``
3448 The FM_TX class descriptor. Calling
3449 :ref:`VIDIOC_QUERYCTRL` for this control will
3450 return a description of this control class.
3451
3452``V4L2_CID_RDS_TX_DEVIATION (integer)``
3453 Configures RDS signal frequency deviation level in Hz. The range and
3454 step are driver-specific.
3455
3456``V4L2_CID_RDS_TX_PI (integer)``
3457 Sets the RDS Programme Identification field for transmission.
3458
3459``V4L2_CID_RDS_TX_PTY (integer)``
3460 Sets the RDS Programme Type field for transmission. This encodes up
3461 to 31 pre-defined programme types.
3462
3463``V4L2_CID_RDS_TX_PS_NAME (string)``
3464 Sets the Programme Service name (PS_NAME) for transmission. It is
3465 intended for static display on a receiver. It is the primary aid to
3466 listeners in programme service identification and selection. In
3467 Annex E of :ref:`iec62106`, the RDS specification, there is a full
3468 description of the correct character encoding for Programme Service
3469 name strings. Also from RDS specification, PS is usually a single
3470 eight character text. However, it is also possible to find receivers
3471 which can scroll strings sized as 8 x N characters. So, this control
3472 must be configured with steps of 8 characters. The result is it must
3473 always contain a string with size multiple of 8.
3474
3475``V4L2_CID_RDS_TX_RADIO_TEXT (string)``
3476 Sets the Radio Text info for transmission. It is a textual
3477 description of what is being broadcasted. RDS Radio Text can be
3478 applied when broadcaster wishes to transmit longer PS names,
3479 programme-related information or any other text. In these cases,
3480 RadioText should be used in addition to ``V4L2_CID_RDS_TX_PS_NAME``.
3481 The encoding for Radio Text strings is also fully described in Annex
3482 E of :ref:`iec62106`. The length of Radio Text strings depends on
3483 which RDS Block is being used to transmit it, either 32 (2A block)
3484 or 64 (2B block). However, it is also possible to find receivers
3485 which can scroll strings sized as 32 x N or 64 x N characters. So,
3486 this control must be configured with steps of 32 or 64 characters.
3487 The result is it must always contain a string with size multiple of
3488 32 or 64.
3489
3490``V4L2_CID_RDS_TX_MONO_STEREO (boolean)``
3491 Sets the Mono/Stereo bit of the Decoder Identification code. If set,
3492 then the audio was recorded as stereo.
3493
3494``V4L2_CID_RDS_TX_ARTIFICIAL_HEAD (boolean)``
3495 Sets the
3496 `Artificial Head <http://en.wikipedia.org/wiki/Artificial_head>`__
3497 bit of the Decoder Identification code. If set, then the audio was
3498 recorded using an artificial head.
3499
3500``V4L2_CID_RDS_TX_COMPRESSED (boolean)``
3501 Sets the Compressed bit of the Decoder Identification code. If set,
3502 then the audio is compressed.
3503
3504``V4L2_CID_RDS_TX_DYNAMIC_PTY (boolean)``
3505 Sets the Dynamic PTY bit of the Decoder Identification code. If set,
3506 then the PTY code is dynamically switched.
3507
3508``V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT (boolean)``
3509 If set, then a traffic announcement is in progress.
3510
3511``V4L2_CID_RDS_TX_TRAFFIC_PROGRAM (boolean)``
3512 If set, then the tuned programme carries traffic announcements.
3513
3514``V4L2_CID_RDS_TX_MUSIC_SPEECH (boolean)``
3515 If set, then this channel broadcasts music. If cleared, then it
3516 broadcasts speech. If the transmitter doesn't make this distinction,
3517 then it should be set.
3518
3519``V4L2_CID_RDS_TX_ALT_FREQS_ENABLE (boolean)``
3520 If set, then transmit alternate frequencies.
3521
3522``V4L2_CID_RDS_TX_ALT_FREQS (__u32 array)``
3523 The alternate frequencies in kHz units. The RDS standard allows for
3524 up to 25 frequencies to be defined. Drivers may support fewer
3525 frequencies so check the array size.
3526
3527``V4L2_CID_AUDIO_LIMITER_ENABLED (boolean)``
3528 Enables or disables the audio deviation limiter feature. The limiter
3529 is useful when trying to maximize the audio volume, minimize
3530 receiver-generated distortion and prevent overmodulation.
3531
3532``V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (integer)``
3533 Sets the audio deviation limiter feature release time. Unit is in
3534 useconds. Step and range are driver-specific.
3535
3536``V4L2_CID_AUDIO_LIMITER_DEVIATION (integer)``
3537 Configures audio frequency deviation level in Hz. The range and step
3538 are driver-specific.
3539
3540``V4L2_CID_AUDIO_COMPRESSION_ENABLED (boolean)``
3541 Enables or disables the audio compression feature. This feature
3542 amplifies signals below the threshold by a fixed gain and compresses
3543 audio signals above the threshold by the ratio of Threshold/(Gain +
3544 Threshold).
3545
3546``V4L2_CID_AUDIO_COMPRESSION_GAIN (integer)``
3547 Sets the gain for audio compression feature. It is a dB value. The
3548 range and step are driver-specific.
3549
3550``V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (integer)``
3551 Sets the threshold level for audio compression freature. It is a dB
3552 value. The range and step are driver-specific.
3553
3554``V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (integer)``
3555 Sets the attack time for audio compression feature. It is a useconds
3556 value. The range and step are driver-specific.
3557
3558``V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (integer)``
3559 Sets the release time for audio compression feature. It is a
3560 useconds value. The range and step are driver-specific.
3561
3562``V4L2_CID_PILOT_TONE_ENABLED (boolean)``
3563 Enables or disables the pilot tone generation feature.
3564
3565``V4L2_CID_PILOT_TONE_DEVIATION (integer)``
3566 Configures pilot tone frequency deviation level. Unit is in Hz. The
3567 range and step are driver-specific.
3568
3569``V4L2_CID_PILOT_TONE_FREQUENCY (integer)``
3570 Configures pilot tone frequency value. Unit is in Hz. The range and
3571 step are driver-specific.
3572
3573``V4L2_CID_TUNE_PREEMPHASIS (enum v4l2_preemphasis)``
3574 Configures the pre-emphasis value for broadcasting. A pre-emphasis
3575 filter is applied to the broadcast to accentuate the high audio
3576 frequencies. Depending on the region, a time constant of either 50
3577 or 75 useconds is used. The enum v4l2_preemphasis defines possible
3578 values for pre-emphasis. Here they are:
3579
3580
3581
3582.. flat-table::
3583 :header-rows: 0
3584 :stub-columns: 0
3585
3586
3587 - .. row 1
3588
3589 - ``V4L2_PREEMPHASIS_DISABLED``
3590
3591 - No pre-emphasis is applied.
3592
3593 - .. row 2
3594
3595 - ``V4L2_PREEMPHASIS_50_uS``
3596
3597 - A pre-emphasis of 50 uS is used.
3598
3599 - .. row 3
3600
3601 - ``V4L2_PREEMPHASIS_75_uS``
3602
3603 - A pre-emphasis of 75 uS is used.
3604
3605
3606
3607``V4L2_CID_TUNE_POWER_LEVEL (integer)``
3608 Sets the output power level for signal transmission. Unit is in
3609 dBuV. Range and step are driver-specific.
3610
3611``V4L2_CID_TUNE_ANTENNA_CAPACITOR (integer)``
3612 This selects the value of antenna tuning capacitor manually or
3613 automatically if set to zero. Unit, range and step are
3614 driver-specific.
3615
3616For more details about RDS specification, refer to :ref:`iec62106`
3617document, from CENELEC.
3618
3619
3620.. _flash-controls:
3621
3622Flash Control Reference
3623=======================
3624
3625The V4L2 flash controls are intended to provide generic access to flash
3626controller devices. Flash controller devices are typically used in
3627digital cameras.
3628
3629The interface can support both LED and xenon flash devices. As of
3630writing this, there is no xenon flash driver using this interface.
3631
3632
3633.. _flash-controls-use-cases:
3634
3635Supported use cases
3636-------------------
3637
3638
3639Unsynchronised LED flash (software strobe)
3640^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3641
3642Unsynchronised LED flash is controlled directly by the host as the
3643sensor. The flash must be enabled by the host before the exposure of the
3644image starts and disabled once it ends. The host is fully responsible
3645for the timing of the flash.
3646
3647Example of such device: Nokia N900.
3648
3649
3650Synchronised LED flash (hardware strobe)
3651^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3652
3653The synchronised LED flash is pre-programmed by the host (power and
3654timeout) but controlled by the sensor through a strobe signal from the
3655sensor to the flash.
3656
3657The sensor controls the flash duration and timing. This information
3658typically must be made available to the sensor.
3659
3660
3661LED flash as torch
3662^^^^^^^^^^^^^^^^^^
3663
3664LED flash may be used as torch in conjunction with another use case
3665involving camera or individually.
3666
3667
3668.. _flash-control-id:
3669
3670Flash Control IDs
3671"""""""""""""""""
3672
3673``V4L2_CID_FLASH_CLASS (class)``
3674 The FLASH class descriptor.
3675
3676``V4L2_CID_FLASH_LED_MODE (menu)``
3677 Defines the mode of the flash LED, the high-power white LED attached
3678 to the flash controller. Setting this control may not be possible in
3679 presence of some faults. See V4L2_CID_FLASH_FAULT.
3680
3681
3682
3683.. flat-table::
3684 :header-rows: 0
3685 :stub-columns: 0
3686
3687
3688 - .. row 1
3689
3690 - ``V4L2_FLASH_LED_MODE_NONE``
3691
3692 - Off.
3693
3694 - .. row 2
3695
3696 - ``V4L2_FLASH_LED_MODE_FLASH``
3697
3698 - Flash mode.
3699
3700 - .. row 3
3701
3702 - ``V4L2_FLASH_LED_MODE_TORCH``
3703
3704 - Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.
3705
3706
3707
3708``V4L2_CID_FLASH_STROBE_SOURCE (menu)``
3709 Defines the source of the flash LED strobe.
3710
3711
3712
3713.. flat-table::
3714 :header-rows: 0
3715 :stub-columns: 0
3716
3717
3718 - .. row 1
3719
3720 - ``V4L2_FLASH_STROBE_SOURCE_SOFTWARE``
3721
3722 - The flash strobe is triggered by using the
3723 V4L2_CID_FLASH_STROBE control.
3724
3725 - .. row 2
3726
3727 - ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL``
3728
3729 - The flash strobe is triggered by an external source. Typically
3730 this is a sensor, which makes it possible to synchronises the
3731 flash strobe start to exposure start.
3732
3733
3734
3735``V4L2_CID_FLASH_STROBE (button)``
3736 Strobe flash. Valid when V4L2_CID_FLASH_LED_MODE is set to
3737 V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
3738 is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
3739 control may not be possible in presence of some faults. See
3740 V4L2_CID_FLASH_FAULT.
3741
3742``V4L2_CID_FLASH_STROBE_STOP (button)``
3743 Stop flash strobe immediately.
3744
3745``V4L2_CID_FLASH_STROBE_STATUS (boolean)``
3746 Strobe status: whether the flash is strobing at the moment or not.
3747 This is a read-only control.
3748
3749``V4L2_CID_FLASH_TIMEOUT (integer)``
3750 Hardware timeout for flash. The flash strobe is stopped after this
3751 period of time has passed from the start of the strobe.
3752
3753``V4L2_CID_FLASH_INTENSITY (integer)``
3754 Intensity of the flash strobe when the flash LED is in flash mode
3755 (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps (mA)
3756 if possible.
3757
3758``V4L2_CID_FLASH_TORCH_INTENSITY (integer)``
3759 Intensity of the flash LED in torch mode
3760 (V4L2_FLASH_LED_MODE_TORCH). The unit should be milliamps (mA)
3761 if possible. Setting this control may not be possible in presence of
3762 some faults. See V4L2_CID_FLASH_FAULT.
3763
3764``V4L2_CID_FLASH_INDICATOR_INTENSITY (integer)``
3765 Intensity of the indicator LED. The indicator LED may be fully
3766 independent of the flash LED. The unit should be microamps (uA) if
3767 possible.
3768
3769``V4L2_CID_FLASH_FAULT (bitmask)``
3770 Faults related to the flash. The faults tell about specific problems
3771 in the flash chip itself or the LEDs attached to it. Faults may
3772 prevent further use of some of the flash controls. In particular,
3773 V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
3774 if the fault affects the flash LED. Exactly which faults have such
3775 an effect is chip dependent. Reading the faults resets the control
3776 and returns the chip to a usable state if possible.
3777
3778
3779
3780.. flat-table::
3781 :header-rows: 0
3782 :stub-columns: 0
3783
3784
3785 - .. row 1
3786
3787 - ``V4L2_FLASH_FAULT_OVER_VOLTAGE``
3788
3789 - Flash controller voltage to the flash LED has exceeded the limit
3790 specific to the flash controller.
3791
3792 - .. row 2
3793
3794 - ``V4L2_FLASH_FAULT_TIMEOUT``
3795
3796 - The flash strobe was still on when the timeout set by the user ---
3797 V4L2_CID_FLASH_TIMEOUT control --- has expired. Not all flash
3798 controllers may set this in all such conditions.
3799
3800 - .. row 3
3801
3802 - ``V4L2_FLASH_FAULT_OVER_TEMPERATURE``
3803
3804 - The flash controller has overheated.
3805
3806 - .. row 4
3807
3808 - ``V4L2_FLASH_FAULT_SHORT_CIRCUIT``
3809
3810 - The short circuit protection of the flash controller has been
3811 triggered.
3812
3813 - .. row 5
3814
3815 - ``V4L2_FLASH_FAULT_OVER_CURRENT``
3816
3817 - Current in the LED power supply has exceeded the limit specific to
3818 the flash controller.
3819
3820 - .. row 6
3821
3822 - ``V4L2_FLASH_FAULT_INDICATOR``
3823
3824 - The flash controller has detected a short or open circuit
3825 condition on the indicator LED.
3826
3827 - .. row 7
3828
3829 - ``V4L2_FLASH_FAULT_UNDER_VOLTAGE``
3830
3831 - Flash controller voltage to the flash LED has been below the
3832 minimum limit specific to the flash controller.
3833
3834 - .. row 8
3835
3836 - ``V4L2_FLASH_FAULT_INPUT_VOLTAGE``
3837
3838 - The input voltage of the flash controller is below the limit under
3839 which strobing the flash at full current will not be possible.The
3840 condition persists until this flag is no longer set.
3841
3842 - .. row 9
3843
3844 - ``V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE``
3845
3846 - The temperature of the LED has exceeded its allowed upper limit.
3847
3848
3849
3850``V4L2_CID_FLASH_CHARGE (boolean)``
3851 Enable or disable charging of the xenon flash capacitor.
3852
3853``V4L2_CID_FLASH_READY (boolean)``
3854 Is the flash ready to strobe? Xenon flashes require their capacitors
3855 charged before strobing. LED flashes often require a cooldown period
3856 after strobe during which another strobe will not be possible. This
3857 is a read-only control.
3858
3859
3860.. _jpeg-controls:
3861
3862JPEG Control Reference
3863======================
3864
3865The JPEG class includes controls for common features of JPEG encoders
3866and decoders. Currently it includes features for codecs implementing
3867progressive baseline DCT compression process with Huffman entrophy
3868coding.
3869
3870
3871.. _jpeg-control-id:
3872
3873JPEG Control IDs
3874----------------
3875
3876``V4L2_CID_JPEG_CLASS (class)``
3877 The JPEG class descriptor. Calling
3878 :ref:`VIDIOC_QUERYCTRL` for this control will
3879 return a description of this control class.
3880
3881``V4L2_CID_JPEG_CHROMA_SUBSAMPLING (menu)``
3882 The chroma subsampling factors describe how each component of an
3883 input image is sampled, in respect to maximum sample rate in each
3884 spatial dimension. See :ref:`itu-t81`, clause A.1.1. for more
3885 details. The ``V4L2_CID_JPEG_CHROMA_SUBSAMPLING`` control determines
3886 how Cb and Cr components are downsampled after coverting an input
3887 image from RGB to Y'CbCr color space.
3888
3889
3890
3891.. flat-table::
3892 :header-rows: 0
3893 :stub-columns: 0
3894
3895
3896 - .. row 1
3897
3898 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_444``
3899
3900 - No chroma subsampling, each pixel has Y, Cr and Cb values.
3901
3902 - .. row 2
3903
3904 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_422``
3905
3906 - Horizontally subsample Cr, Cb components by a factor of 2.
3907
3908 - .. row 3
3909
3910 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_420``
3911
3912 - Subsample Cr, Cb components horizontally and vertically by 2.
3913
3914 - .. row 4
3915
3916 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_411``
3917
3918 - Horizontally subsample Cr, Cb components by a factor of 4.
3919
3920 - .. row 5
3921
3922 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_410``
3923
3924 - Subsample Cr, Cb components horizontally by 4 and vertically by 2.
3925
3926 - .. row 6
3927
3928 - ``V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY``
3929
3930 - Use only luminance component.
3931
3932
3933
3934``V4L2_CID_JPEG_RESTART_INTERVAL (integer)``
3935 The restart interval determines an interval of inserting RSTm
3936 markers (m = 0..7). The purpose of these markers is to additionally
3937 reinitialize the encoder process, in order to process blocks of an
3938 image independently. For the lossy compression processes the restart
3939 interval unit is MCU (Minimum Coded Unit) and its value is contained
3940 in DRI (Define Restart Interval) marker. If
3941 ``V4L2_CID_JPEG_RESTART_INTERVAL`` control is set to 0, DRI and RSTm
3942 markers will not be inserted.
3943
3944.. _jpeg-quality-control:
3945
3946``V4L2_CID_JPEG_COMPRESSION_QUALITY (integer)``
3947 ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control determines trade-off
3948 between image quality and size. It provides simpler method for
3949 applications to control image quality, without a need for direct
3950 reconfiguration of luminance and chrominance quantization tables. In
3951 cases where a driver uses quantization tables configured directly by
3952 an application, using interfaces defined elsewhere,
3953 ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control should be set by
3954 driver to 0.
3955
3956 The value range of this control is driver-specific. Only positive,
3957 non-zero values are meaningful. The recommended range is 1 - 100,
3958 where larger values correspond to better image quality.
3959
3960.. _jpeg-active-marker-control:
3961
3962``V4L2_CID_JPEG_ACTIVE_MARKER (bitmask)``
3963 Specify which JPEG markers are included in compressed stream. This
3964 control is valid only for encoders.
3965
3966
3967
3968.. flat-table::
3969 :header-rows: 0
3970 :stub-columns: 0
3971
3972
3973 - .. row 1
3974
3975 - ``V4L2_JPEG_ACTIVE_MARKER_APP0``
3976
3977 - Application data segment APP\ :sub:`0`.
3978
3979 - .. row 2
3980
3981 - ``V4L2_JPEG_ACTIVE_MARKER_APP1``
3982
3983 - Application data segment APP\ :sub:`1`.
3984
3985 - .. row 3
3986
3987 - ``V4L2_JPEG_ACTIVE_MARKER_COM``
3988
3989 - Comment segment.
3990
3991 - .. row 4
3992
3993 - ``V4L2_JPEG_ACTIVE_MARKER_DQT``
3994
3995 - Quantization tables segment.
3996
3997 - .. row 5
3998
3999 - ``V4L2_JPEG_ACTIVE_MARKER_DHT``
4000
4001 - Huffman tables segment.
4002
4003
4004
4005For more details about JPEG specification, refer to :ref:`itu-t81`,
4006:ref:`jfif`, :ref:`w3c-jpeg-jfif`.
4007
4008
4009.. _image-source-controls:
4010
4011Image Source Control Reference
4012==============================
4013
4014The Image Source control class is intended for low-level control of
4015image source devices such as image sensors. The devices feature an
4016analogue to digital converter and a bus transmitter to transmit the
4017image data out of the device.
4018
4019
4020.. _image-source-control-id:
4021
4022Image Source Control IDs
4023------------------------
4024
4025``V4L2_CID_IMAGE_SOURCE_CLASS (class)``
4026 The IMAGE_SOURCE class descriptor.
4027
4028``V4L2_CID_VBLANK (integer)``
4029 Vertical blanking. The idle period after every frame during which no
4030 image data is produced. The unit of vertical blanking is a line.
4031 Every line has length of the image width plus horizontal blanking at
4032 the pixel rate defined by ``V4L2_CID_PIXEL_RATE`` control in the
4033 same sub-device.
4034
4035``V4L2_CID_HBLANK (integer)``
4036 Horizontal blanking. The idle period after every line of image data
4037 during which no image data is produced. The unit of horizontal
4038 blanking is pixels.
4039
4040``V4L2_CID_ANALOGUE_GAIN (integer)``
4041 Analogue gain is gain affecting all colour components in the pixel
4042 matrix. The gain operation is performed in the analogue domain
4043 before A/D conversion.
4044
4045``V4L2_CID_TEST_PATTERN_RED (integer)``
4046 Test pattern red colour component.
4047
4048``V4L2_CID_TEST_PATTERN_GREENR (integer)``
4049 Test pattern green (next to red) colour component.
4050
4051``V4L2_CID_TEST_PATTERN_BLUE (integer)``
4052 Test pattern blue colour component.
4053
4054``V4L2_CID_TEST_PATTERN_GREENB (integer)``
4055 Test pattern green (next to blue) colour component.
4056
4057
4058.. _image-process-controls:
4059
4060Image Process Control Reference
4061===============================
4062
4063The Image Process control class is intended for low-level control of
4064image processing functions. Unlike ``V4L2_CID_IMAGE_SOURCE_CLASS``, the
4065controls in this class affect processing the image, and do not control
4066capturing of it.
4067
4068
4069.. _image-process-control-id:
4070
4071Image Process Control IDs
4072-------------------------
4073
4074``V4L2_CID_IMAGE_PROC_CLASS (class)``
4075 The IMAGE_PROC class descriptor.
4076
4077``V4L2_CID_LINK_FREQ (integer menu)``
4078 Data bus frequency. Together with the media bus pixel code, bus type
4079 (clock cycles per sample), the data bus frequency defines the pixel
4080 rate (``V4L2_CID_PIXEL_RATE``) in the pixel array (or possibly
4081 elsewhere, if the device is not an image sensor). The frame rate can
4082 be calculated from the pixel clock, image width and height and
4083 horizontal and vertical blanking. While the pixel rate control may
4084 be defined elsewhere than in the subdev containing the pixel array,
4085 the frame rate cannot be obtained from that information. This is
4086 because only on the pixel array it can be assumed that the vertical
4087 and horizontal blanking information is exact: no other blanking is
4088 allowed in the pixel array. The selection of frame rate is performed
4089 by selecting the desired horizontal and vertical blanking. The unit
4090 of this control is Hz.
4091
4092``V4L2_CID_PIXEL_RATE (64-bit integer)``
4093 Pixel rate in the source pads of the subdev. This control is
4094 read-only and its unit is pixels / second.
4095
4096``V4L2_CID_TEST_PATTERN (menu)``
4097 Some capture/display/sensor devices have the capability to generate
4098 test pattern images. These hardware specific test patterns can be
4099 used to test if a device is working properly.
4100
4101
4102.. _dv-controls:
4103
4104Digital Video Control Reference
4105===============================
4106
4107The Digital Video control class is intended to control receivers and
4108transmitters for `VGA <http://en.wikipedia.org/wiki/Vga>`__,
4109`DVI <http://en.wikipedia.org/wiki/Digital_Visual_Interface>`__
4110(Digital Visual Interface), HDMI (:ref:`hdmi`) and DisplayPort
4111(:ref:`dp`). These controls are generally expected to be private to
4112the receiver or transmitter subdevice that implements them, so they are
4113only exposed on the ``/dev/v4l-subdev*`` device node.
4114
4115.. note::
4116
4117 Note that these devices can have multiple input or output pads which are
4118 hooked up to e.g. HDMI connectors. Even though the subdevice will
4119 receive or transmit video from/to only one of those pads, the other pads
4120 can still be active when it comes to EDID (Extended Display
4121 Identification Data, :ref:`vesaedid`) and HDCP (High-bandwidth Digital
4122 Content Protection System, :ref:`hdcp`) processing, allowing the
4123 device to do the fairly slow EDID/HDCP handling in advance. This allows
4124 for quick switching between connectors.
4125
4126These pads appear in several of the controls in this section as
4127bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad
41281, etc. The maximum value of the control is the set of valid pads.
4129
4130
4131.. _dv-control-id:
4132
4133Digital Video Control IDs
4134-------------------------
4135
4136``V4L2_CID_DV_CLASS (class)``
4137 The Digital Video class descriptor.
4138
4139``V4L2_CID_DV_TX_HOTPLUG (bitmask)``
4140 Many connectors have a hotplug pin which is high if EDID information
4141 is available from the source. This control shows the state of the
4142 hotplug pin as seen by the transmitter. Each bit corresponds to an
4143 output pad on the transmitter. If an output pad does not have an
4144 associated hotplug pin, then the bit for that pad will be 0. This
4145 read-only control is applicable to DVI-D, HDMI and DisplayPort
4146 connectors.
4147
4148``V4L2_CID_DV_TX_RXSENSE (bitmask)``
4149 Rx Sense is the detection of pull-ups on the TMDS clock lines. This
4150 normally means that the sink has left/entered standby (i.e. the
4151 transmitter can sense that the receiver is ready to receive video).
4152 Each bit corresponds to an output pad on the transmitter. If an
4153 output pad does not have an associated Rx Sense, then the bit for
4154 that pad will be 0. This read-only control is applicable to DVI-D
4155 and HDMI devices.
4156
4157``V4L2_CID_DV_TX_EDID_PRESENT (bitmask)``
4158 When the transmitter sees the hotplug signal from the receiver it
4159 will attempt to read the EDID. If set, then the transmitter has read
4160 at least the first block (= 128 bytes). Each bit corresponds to an
4161 output pad on the transmitter. If an output pad does not support
4162 EDIDs, then the bit for that pad will be 0. This read-only control
4163 is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4164
4165``V4L2_CID_DV_TX_MODE (enum v4l2_dv_tx_mode)``
4166 HDMI transmitters can transmit in DVI-D mode (just video) or in HDMI
4167 mode (video + audio + auxiliary data). This control selects which
4168 mode to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
4169 This control is applicable to HDMI connectors.
4170
4171``V4L2_CID_DV_TX_RGB_RANGE (enum v4l2_dv_rgb_range)``
4172 Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
4173 follows the RGB quantization range specified in the standard for the
4174 video interface (ie. :ref:`cea861` for HDMI).
4175 V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
4176 standard to be compatible with sinks that have not implemented the
4177 standard correctly (unfortunately quite common for HDMI and DVI-D).
4178 Full range allows all possible values to be used whereas limited
4179 range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
4180 the number of bits per component. This control is applicable to VGA,
4181 DVI-A/D, HDMI and DisplayPort connectors.
4182
4183``V4L2_CID_DV_TX_IT_CONTENT_TYPE (enum v4l2_dv_it_content_type)``
4184 Configures the IT Content Type of the transmitted video. This
4185 information is sent over HDMI and DisplayPort connectors as part of
4186 the AVI InfoFrame. The term 'IT Content' is used for content that
4187 originates from a computer as opposed to content from a TV broadcast
4188 or an analog source. The enum v4l2_dv_it_content_type defines
4189 the possible content types:
4190
4191
4192
4193.. flat-table::
4194 :header-rows: 0
4195 :stub-columns: 0
4196
4197
4198 - .. row 1
4199
4200 - ``V4L2_DV_IT_CONTENT_TYPE_GRAPHICS``
4201
4202 - Graphics content. Pixel data should be passed unfiltered and
4203 without analog reconstruction.
4204
4205 - .. row 2
4206
4207 - ``V4L2_DV_IT_CONTENT_TYPE_PHOTO``
4208
4209 - Photo content. The content is derived from digital still pictures.
4210 The content should be passed through with minimal scaling and
4211 picture enhancements.
4212
4213 - .. row 3
4214
4215 - ``V4L2_DV_IT_CONTENT_TYPE_CINEMA``
4216
4217 - Cinema content.
4218
4219 - .. row 4
4220
4221 - ``V4L2_DV_IT_CONTENT_TYPE_GAME``
4222
4223 - Game content. Audio and video latency should be minimized.
4224
4225 - .. row 5
4226
4227 - ``V4L2_DV_IT_CONTENT_TYPE_NO_ITC``
4228
4229 - No IT Content information is available and the ITC bit in the AVI
4230 InfoFrame is set to 0.
4231
4232
4233
4234``V4L2_CID_DV_RX_POWER_PRESENT (bitmask)``
4235 Detects whether the receiver receives power from the source (e.g.
4236 HDMI carries 5V on one of the pins). This is often used to power an
4237 eeprom which contains EDID information, such that the source can
4238 read the EDID even if the sink is in standby/power off. Each bit
4239 corresponds to an input pad on the transmitter. If an input pad
4240 cannot detect whether power is present, then the bit for that pad
4241 will be 0. This read-only control is applicable to DVI-D, HDMI and
4242 DisplayPort connectors.
4243
4244``V4L2_CID_DV_RX_RGB_RANGE (enum v4l2_dv_rgb_range)``
4245 Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
4246 follows the RGB quantization range specified in the standard for the
4247 video interface (ie. :ref:`cea861` for HDMI).
4248 V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
4249 standard to be compatible with sources that have not implemented the
4250 standard correctly (unfortunately quite common for HDMI and DVI-D).
4251 Full range allows all possible values to be used whereas limited
4252 range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
4253 the number of bits per component. This control is applicable to VGA,
4254 DVI-A/D, HDMI and DisplayPort connectors.
4255
4256``V4L2_CID_DV_RX_IT_CONTENT_TYPE (enum v4l2_dv_it_content_type)``
4257 Reads the IT Content Type of the received video. This information is
4258 sent over HDMI and DisplayPort connectors as part of the AVI
4259 InfoFrame. The term 'IT Content' is used for content that originates
4260 from a computer as opposed to content from a TV broadcast or an
4261 analog source. See ``V4L2_CID_DV_TX_IT_CONTENT_TYPE`` for the
4262 available content types.
4263
4264
4265.. _fm-rx-controls:
4266
4267FM Receiver Control Reference
4268=============================
4269
4270The FM Receiver (FM_RX) class includes controls for common features of
4271FM Reception capable devices.
4272
4273
4274.. _fm-rx-control-id:
4275
4276FM_RX Control IDs
4277-----------------
4278
4279``V4L2_CID_FM_RX_CLASS (class)``
4280 The FM_RX class descriptor. Calling
4281 :ref:`VIDIOC_QUERYCTRL` for this control will
4282 return a description of this control class.
4283
4284``V4L2_CID_RDS_RECEPTION (boolean)``
4285 Enables/disables RDS reception by the radio tuner
4286
4287``V4L2_CID_RDS_RX_PTY (integer)``
4288 Gets RDS Programme Type field. This encodes up to 31 pre-defined
4289 programme types.
4290
4291``V4L2_CID_RDS_RX_PS_NAME (string)``
4292 Gets the Programme Service name (PS_NAME). It is intended for
4293 static display on a receiver. It is the primary aid to listeners in
4294 programme service identification and selection. In Annex E of
4295 :ref:`iec62106`, the RDS specification, there is a full
4296 description of the correct character encoding for Programme Service
4297 name strings. Also from RDS specification, PS is usually a single
4298 eight character text. However, it is also possible to find receivers
4299 which can scroll strings sized as 8 x N characters. So, this control
4300 must be configured with steps of 8 characters. The result is it must
4301 always contain a string with size multiple of 8.
4302
4303``V4L2_CID_RDS_RX_RADIO_TEXT (string)``
4304 Gets the Radio Text info. It is a textual description of what is
4305 being broadcasted. RDS Radio Text can be applied when broadcaster
4306 wishes to transmit longer PS names, programme-related information or
4307 any other text. In these cases, RadioText can be used in addition to
4308 ``V4L2_CID_RDS_RX_PS_NAME``. The encoding for Radio Text strings is
4309 also fully described in Annex E of :ref:`iec62106`. The length of
4310 Radio Text strings depends on which RDS Block is being used to
4311 transmit it, either 32 (2A block) or 64 (2B block). However, it is
4312 also possible to find receivers which can scroll strings sized as 32
4313 x N or 64 x N characters. So, this control must be configured with
4314 steps of 32 or 64 characters. The result is it must always contain a
4315 string with size multiple of 32 or 64.
4316
4317``V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT (boolean)``
4318 If set, then a traffic announcement is in progress.
4319
4320``V4L2_CID_RDS_RX_TRAFFIC_PROGRAM (boolean)``
4321 If set, then the tuned programme carries traffic announcements.
4322
4323``V4L2_CID_RDS_RX_MUSIC_SPEECH (boolean)``
4324 If set, then this channel broadcasts music. If cleared, then it
4325 broadcasts speech. If the transmitter doesn't make this distinction,
4326 then it will be set.
4327
4328``V4L2_CID_TUNE_DEEMPHASIS (enum v4l2_deemphasis)``
4329 Configures the de-emphasis value for reception. A de-emphasis filter
4330 is applied to the broadcast to accentuate the high audio
4331 frequencies. Depending on the region, a time constant of either 50
4332 or 75 useconds is used. The enum v4l2_deemphasis defines possible
4333 values for de-emphasis. Here they are:
4334
4335
4336
4337.. flat-table::
4338 :header-rows: 0
4339 :stub-columns: 0
4340
4341
4342 - .. row 1
4343
4344 - ``V4L2_DEEMPHASIS_DISABLED``
4345
4346 - No de-emphasis is applied.
4347
4348 - .. row 2
4349
4350 - ``V4L2_DEEMPHASIS_50_uS``
4351
4352 - A de-emphasis of 50 uS is used.
4353
4354 - .. row 3
4355
4356 - ``V4L2_DEEMPHASIS_75_uS``
4357
4358 - A de-emphasis of 75 uS is used.
4359
4360
4361
4362
4363.. _detect-controls:
4364
4365Detect Control Reference
4366========================
4367
4368The Detect class includes controls for common features of various motion
4369or object detection capable devices.
4370
4371
4372.. _detect-control-id:
4373
4374Detect Control IDs
4375------------------
4376
4377``V4L2_CID_DETECT_CLASS (class)``
4378 The Detect class descriptor. Calling
4379 :ref:`VIDIOC_QUERYCTRL` for this control will
4380 return a description of this control class.
4381
4382``V4L2_CID_DETECT_MD_MODE (menu)``
4383 Sets the motion detection mode.
4384
4385
4386
4387.. flat-table::
4388 :header-rows: 0
4389 :stub-columns: 0
4390
4391
4392 - .. row 1
4393
4394 - ``V4L2_DETECT_MD_MODE_DISABLED``
4395
4396 - Disable motion detection.
4397
4398 - .. row 2
4399
4400 - ``V4L2_DETECT_MD_MODE_GLOBAL``
4401
4402 - Use a single motion detection threshold.
4403
4404 - .. row 3
4405
4406 - ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID``
4407
4408 - The image is divided into a grid, each cell with its own motion
4409 detection threshold. These thresholds are set through the
4410 ``V4L2_CID_DETECT_MD_THRESHOLD_GRID`` matrix control.
4411
4412 - .. row 4
4413
4414 - ``V4L2_DETECT_MD_MODE_REGION_GRID``
4415
4416 - The image is divided into a grid, each cell with its own region
4417 value that specifies which per-region motion detection thresholds
4418 should be used. Each region has its own thresholds. How these
4419 per-region thresholds are set up is driver-specific. The region
4420 values for the grid are set through the
4421 ``V4L2_CID_DETECT_MD_REGION_GRID`` matrix control.
4422
4423
4424
4425``V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD (integer)``
4426 Sets the global motion detection threshold to be used with the
4427 ``V4L2_DETECT_MD_MODE_GLOBAL`` motion detection mode.
4428
4429``V4L2_CID_DETECT_MD_THRESHOLD_GRID (__u16 matrix)``
4430 Sets the motion detection thresholds for each cell in the grid. To
4431 be used with the ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID`` motion
4432 detection mode. Matrix element (0, 0) represents the cell at the
4433 top-left of the grid.
4434
4435``V4L2_CID_DETECT_MD_REGION_GRID (__u8 matrix)``
4436 Sets the motion detection region value for each cell in the grid. To
4437 be used with the ``V4L2_DETECT_MD_MODE_REGION_GRID`` motion
4438 detection mode. Matrix element (0, 0) represents the cell at the
4439 top-left of the grid.
4440
4441
4442.. _rf-tuner-controls:
4443
4444RF Tuner Control Reference
4445==========================
4446
4447The RF Tuner (RF_TUNER) class includes controls for common features of
4448devices having RF tuner.
4449
4450In this context, RF tuner is radio receiver circuit between antenna and
4451demodulator. It receives radio frequency (RF) from the antenna and
4452converts that received signal to lower intermediate frequency (IF) or
4453baseband frequency (BB). Tuners that could do baseband output are often
4454called Zero-IF tuners. Older tuners were typically simple PLL tuners
4455inside a metal box, whilst newer ones are highly integrated chips
4456without a metal box "silicon tuners". These controls are mostly
4457applicable for new feature rich silicon tuners, just because older
4458tuners does not have much adjustable features.
4459
4460For more information about RF tuners see
4461`Tuner (radio) <http://en.wikipedia.org/wiki/Tuner_%28radio%29>`__
4462and `RF front end <http://en.wikipedia.org/wiki/RF_front_end>`__
4463from Wikipedia.
4464
4465
4466.. _rf-tuner-control-id:
4467
4468RF_TUNER Control IDs
4469--------------------
4470
4471``V4L2_CID_RF_TUNER_CLASS (class)``
4472 The RF_TUNER class descriptor. Calling
4473 :ref:`VIDIOC_QUERYCTRL` for this control will
4474 return a description of this control class.
4475
4476``V4L2_CID_RF_TUNER_BANDWIDTH_AUTO (boolean)``
4477 Enables/disables tuner radio channel bandwidth configuration. In
4478 automatic mode bandwidth configuration is performed by the driver.
4479
4480``V4L2_CID_RF_TUNER_BANDWIDTH (integer)``
4481 Filter(s) on tuner signal path are used to filter signal according
4482 to receiving party needs. Driver configures filters to fulfill
4483 desired bandwidth requirement. Used when
4484 V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not set. Unit is in Hz. The
4485 range and step are driver-specific.
4486
4487``V4L2_CID_RF_TUNER_LNA_GAIN_AUTO (boolean)``
4488 Enables/disables LNA automatic gain control (AGC)
4489
4490``V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO (boolean)``
4491 Enables/disables mixer automatic gain control (AGC)
4492
4493``V4L2_CID_RF_TUNER_IF_GAIN_AUTO (boolean)``
4494 Enables/disables IF automatic gain control (AGC)
4495
4496``V4L2_CID_RF_TUNER_RF_GAIN (integer)``
4497 The RF amplifier is the very first amplifier on the receiver signal
4498 path, just right after the antenna input. The difference between the
4499 LNA gain and the RF gain in this document is that the LNA gain is
4500 integrated in the tuner chip while the RF gain is a separate chip.
4501 There may be both RF and LNA gain controls in the same device. The
4502 range and step are driver-specific.
4503
4504``V4L2_CID_RF_TUNER_LNA_GAIN (integer)``
4505 LNA (low noise amplifier) gain is first gain stage on the RF tuner
4506 signal path. It is located very close to tuner antenna input. Used
4507 when ``V4L2_CID_RF_TUNER_LNA_GAIN_AUTO`` is not set. See
4508 ``V4L2_CID_RF_TUNER_RF_GAIN`` to understand how RF gain and LNA gain
4509 differs from the each others. The range and step are
4510 driver-specific.
4511
4512``V4L2_CID_RF_TUNER_MIXER_GAIN (integer)``
4513 Mixer gain is second gain stage on the RF tuner signal path. It is
4514 located inside mixer block, where RF signal is down-converted by the
4515 mixer. Used when ``V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO`` is not set.
4516 The range and step are driver-specific.
4517
4518``V4L2_CID_RF_TUNER_IF_GAIN (integer)``
4519 IF gain is last gain stage on the RF tuner signal path. It is
4520 located on output of RF tuner. It controls signal level of
4521 intermediate frequency output or baseband output. Used when
4522 ``V4L2_CID_RF_TUNER_IF_GAIN_AUTO`` is not set. The range and step
4523 are driver-specific.
4524
4525``V4L2_CID_RF_TUNER_PLL_LOCK (boolean)``
4526 Is synthesizer PLL locked? RF tuner is receiving given frequency
4527 when that control is set. This is a read-only control.
4528
4529.. [#f1]
4530 This control may be changed to a menu control in the future, if more
4531 options are required.
diff --git a/Documentation/media/uapi/v4l/field-order.rst b/Documentation/media/uapi/v4l/field-order.rst
new file mode 100644
index 000000000000..979fedbb2bda
--- /dev/null
+++ b/Documentation/media/uapi/v4l/field-order.rst
@@ -0,0 +1,205 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _field-order:
4
5***********
6Field Order
7***********
8
9We have to distinguish between progressive and interlaced video.
10Progressive video transmits all lines of a video image sequentially.
11Interlaced video divides an image into two fields, containing only the
12odd and even lines of the image, respectively. Alternating the so called
13odd and even field are transmitted, and due to a small delay between
14fields a cathode ray TV displays the lines interleaved, yielding the
15original frame. This curious technique was invented because at refresh
16rates similar to film the image would fade out too quickly. Transmitting
17fields reduces the flicker without the necessity of doubling the frame
18rate and with it the bandwidth required for each channel.
19
20It is important to understand a video camera does not expose one frame
21at a time, merely transmitting the frames separated into fields. The
22fields are in fact captured at two different instances in time. An
23object on screen may well move between one field and the next. For
24applications analysing motion it is of paramount importance to recognize
25which field of a frame is older, the *temporal order*.
26
27When the driver provides or accepts images field by field rather than
28interleaved, it is also important applications understand how the fields
29combine to frames. We distinguish between top (aka odd) and bottom (aka
30even) fields, the *spatial order*: The first line of the top field is
31the first line of an interlaced frame, the first line of the bottom
32field is the second line of that frame.
33
34However because fields were captured one after the other, arguing
35whether a frame commences with the top or bottom field is pointless. Any
36two successive top and bottom, or bottom and top fields yield a valid
37frame. Only when the source was progressive to begin with, e. g. when
38transferring film to video, two fields may come from the same frame,
39creating a natural order.
40
41Counter to intuition the top field is not necessarily the older field.
42Whether the older field contains the top or bottom lines is a convention
43determined by the video standard. Hence the distinction between temporal
44and spatial order of fields. The diagrams below should make this
45clearer.
46
47All video capture and output devices must report the current field
48order. Some drivers may permit the selection of a different order, to
49this end applications initialize the ``field`` field of struct
50:ref:`v4l2_pix_format <v4l2-pix-format>` before calling the
51:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. If this is not desired it
52should have the value ``V4L2_FIELD_ANY`` (0).
53
54
55.. _v4l2-field:
56
57enum v4l2_field
58===============
59
60.. flat-table::
61 :header-rows: 0
62 :stub-columns: 0
63 :widths: 3 1 4
64
65
66 - .. row 1
67
68 - ``V4L2_FIELD_ANY``
69
70 - 0
71
72 - Applications request this field order when any one of the
73 ``V4L2_FIELD_NONE``, ``V4L2_FIELD_TOP``, ``V4L2_FIELD_BOTTOM``, or
74 ``V4L2_FIELD_INTERLACED`` formats is acceptable. Drivers choose
75 depending on hardware capabilities or e. g. the requested image
76 size, and return the actual field order. Drivers must never return
77 ``V4L2_FIELD_ANY``. If multiple field orders are possible the
78 driver must choose one of the possible field orders during
79 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` or
80 :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`. struct
81 :ref:`v4l2_buffer <v4l2-buffer>` ``field`` can never be
82 ``V4L2_FIELD_ANY``.
83
84 - .. row 2
85
86 - ``V4L2_FIELD_NONE``
87
88 - 1
89
90 - Images are in progressive format, not interlaced. The driver may
91 also indicate this order when it cannot distinguish between
92 ``V4L2_FIELD_TOP`` and ``V4L2_FIELD_BOTTOM``.
93
94 - .. row 3
95
96 - ``V4L2_FIELD_TOP``
97
98 - 2
99
100 - Images consist of the top (aka odd) field only.
101
102 - .. row 4
103
104 - ``V4L2_FIELD_BOTTOM``
105
106 - 3
107
108 - Images consist of the bottom (aka even) field only. Applications
109 may wish to prevent a device from capturing interlaced images
110 because they will have "comb" or "feathering" artefacts around
111 moving objects.
112
113 - .. row 5
114
115 - ``V4L2_FIELD_INTERLACED``
116
117 - 4
118
119 - Images contain both fields, interleaved line by line. The temporal
120 order of the fields (whether the top or bottom field is first
121 transmitted) depends on the current video standard. M/NTSC
122 transmits the bottom field first, all other standards the top
123 field first.
124
125 - .. row 6
126
127 - ``V4L2_FIELD_SEQ_TB``
128
129 - 5
130
131 - Images contain both fields, the top field lines are stored first
132 in memory, immediately followed by the bottom field lines. Fields
133 are always stored in temporal order, the older one first in
134 memory. Image sizes refer to the frame, not fields.
135
136 - .. row 7
137
138 - ``V4L2_FIELD_SEQ_BT``
139
140 - 6
141
142 - Images contain both fields, the bottom field lines are stored
143 first in memory, immediately followed by the top field lines.
144 Fields are always stored in temporal order, the older one first in
145 memory. Image sizes refer to the frame, not fields.
146
147 - .. row 8
148
149 - ``V4L2_FIELD_ALTERNATE``
150
151 - 7
152
153 - The two fields of a frame are passed in separate buffers, in
154 temporal order, i. e. the older one first. To indicate the field
155 parity (whether the current field is a top or bottom field) the
156 driver or application, depending on data direction, must set
157 struct :ref:`v4l2_buffer <v4l2-buffer>` ``field`` to
158 ``V4L2_FIELD_TOP`` or ``V4L2_FIELD_BOTTOM``. Any two successive
159 fields pair to build a frame. If fields are successive, without
160 any dropped fields between them (fields can drop individually),
161 can be determined from the struct
162 :ref:`v4l2_buffer <v4l2-buffer>` ``sequence`` field. This
163 format cannot be selected when using the read/write I/O method
164 since there is no way to communicate if a field was a top or
165 bottom field.
166
167 - .. row 9
168
169 - ``V4L2_FIELD_INTERLACED_TB``
170
171 - 8
172
173 - Images contain both fields, interleaved line by line, top field
174 first. The top field is transmitted first.
175
176 - .. row 10
177
178 - ``V4L2_FIELD_INTERLACED_BT``
179
180 - 9
181
182 - Images contain both fields, interleaved line by line, top field
183 first. The bottom field is transmitted first.
184
185
186
187.. _fieldseq-tb:
188
189Field Order, Top Field First Transmitted
190========================================
191
192.. figure:: field-order_files/fieldseq_tb.*
193 :alt: fieldseq_tb.pdf / fieldseq_tb.gif
194 :align: center
195
196
197.. _fieldseq-bt:
198
199Field Order, Bottom Field First Transmitted
200===========================================
201
202.. figure:: field-order_files/fieldseq_bt.*
203 :alt: fieldseq_bt.pdf / fieldseq_bt.gif
204 :align: center
205
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.gif b/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.gif
new file mode 100644
index 000000000000..60e8569a76c9
--- /dev/null
+++ b/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf b/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf
new file mode 100644
index 000000000000..26598b23f80d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.gif b/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.gif
new file mode 100644
index 000000000000..718492f1cfc7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf b/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf
new file mode 100644
index 000000000000..4965b22ddb3a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf
Binary files differ
diff --git a/Documentation/media/uapi/v4l/format.rst b/Documentation/media/uapi/v4l/format.rst
new file mode 100644
index 000000000000..7c73278849ca
--- /dev/null
+++ b/Documentation/media/uapi/v4l/format.rst
@@ -0,0 +1,92 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _format:
4
5************
6Data Formats
7************
8
9
10Data Format Negotiation
11=======================
12
13Different devices exchange different kinds of data with applications,
14for example video images, raw or sliced VBI data, RDS datagrams. Even
15within one kind many different formats are possible, in particular an
16abundance of image formats. Although drivers must provide a default and
17the selection persists across closing and reopening a device,
18applications should always negotiate a data format before engaging in
19data exchange. Negotiation means the application asks for a particular
20format and the driver selects and reports the best the hardware can do
21to satisfy the request. Of course applications can also just query the
22current selection.
23
24A single mechanism exists to negotiate all data formats using the
25aggregate struct :ref:`v4l2_format <v4l2-format>` and the
26:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
27:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls. Additionally the
28:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl can be used to examine
29what the hardware *could* do, without actually selecting a new data
30format. The data formats supported by the V4L2 API are covered in the
31respective device section in :ref:`devices`. For a closer look at
32image formats see :ref:`pixfmt`.
33
34The :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl is a major turning-point in the
35initialization sequence. Prior to this point multiple panel applications
36can access the same device concurrently to select the current input,
37change controls or modify other properties. The first :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
38assigns a logical stream (video data, VBI data etc.) exclusively to one
39file descriptor.
40
41Exclusive means no other application, more precisely no other file
42descriptor, can grab this stream or change device properties
43inconsistent with the negotiated parameters. A video standard change for
44example, when the new standard uses a different number of scan lines,
45can invalidate the selected image format. Therefore only the file
46descriptor owning the stream can make invalidating changes. Accordingly
47multiple file descriptors which grabbed different logical streams
48prevent each other from interfering with their settings. When for
49example video overlay is about to start or already in progress,
50simultaneous video capturing may be restricted to the same cropping and
51image size.
52
53When applications omit the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl its locking side
54effects are implied by the next step, the selection of an I/O method
55with the :ref:`VIDIOC_REQBUFS` ioctl or implicit
56with the first :ref:`read() <func-read>` or
57:ref:`write() <func-write>` call.
58
59Generally only one logical stream can be assigned to a file descriptor,
60the exception being drivers permitting simultaneous video capturing and
61overlay using the same file descriptor for compatibility with V4L and
62earlier versions of V4L2. Switching the logical stream or returning into
63"panel mode" is possible by closing and reopening the device. Drivers
64*may* support a switch using :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`.
65
66All drivers exchanging data with applications must support the
67:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. Implementation of the
68:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` is highly recommended but optional.
69
70
71Image Format Enumeration
72========================
73
74Apart of the generic format negotiation functions a special ioctl to
75enumerate all image formats supported by video capture, overlay or
76output devices is available. [#f1]_
77
78The :ref:`VIDIOC_ENUM_FMT` ioctl must be supported
79by all drivers exchanging image data with applications.
80
81 **Important**
82
83 Drivers are not supposed to convert image formats in kernel space.
84 They must enumerate only formats directly supported by the hardware.
85 If necessary driver writers should publish an example conversion
86 routine or library for integration into applications.
87
88.. [#f1]
89 Enumerating formats an application has no a-priori knowledge of
90 (otherwise it could explicitly ask for them and need not enumerate)
91 seems useless, but there are applications serving as proxy between
92 drivers and the actual video applications for which this is useful.
diff --git a/Documentation/media/uapi/v4l/func-close.rst b/Documentation/media/uapi/v4l/func-close.rst
new file mode 100644
index 000000000000..926a2ccc32e5
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-close.rst
@@ -0,0 +1,49 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-close:
4
5************
6V4L2 close()
7************
8
9Name
10====
11
12v4l2-close - Close a V4L2 device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: int close( int fd )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32
33Description
34===========
35
36Closes the device. Any I/O in progress is terminated and resources
37associated with the file descriptor are freed. However data format
38parameters, current input or output, control values or other properties
39remain unchanged.
40
41
42Return Value
43============
44
45The function returns 0 on success, -1 on failure and the ``errno`` is
46set appropriately. Possible error codes:
47
48EBADF
49 ``fd`` is not a valid open file descriptor.
diff --git a/Documentation/media/uapi/v4l/func-ioctl.rst b/Documentation/media/uapi/v4l/func-ioctl.rst
new file mode 100644
index 000000000000..5632f48fce1b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-ioctl.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-ioctl:
4
5************
6V4L2 ioctl()
7************
8
9Name
10====
11
12v4l2-ioctl - Program a V4L2 device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <sys/ioctl.h>
21
22
23.. cpp:function:: int ioctl( int fd, int request, void *argp )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32``request``
33 V4L2 ioctl request code as defined in the ``videodev2.h`` header
34 file, for example VIDIOC_QUERYCAP.
35
36``argp``
37 Pointer to a function parameter, usually a structure.
38
39
40Description
41===========
42
43The :ref:`ioctl() <func-ioctl>` function is used to program V4L2 devices. The
44argument ``fd`` must be an open file descriptor. An ioctl ``request``
45has encoded in it whether the argument is an input, output or read/write
46parameter, and the size of the argument ``argp`` in bytes. Macros and
47defines specifying V4L2 ioctl requests are located in the
48``videodev2.h`` header file. Applications should use their own copy, not
49include the version in the kernel sources on the system they compile on.
50All V4L2 ioctl requests, their respective function and parameters are
51specified in :ref:`user-func`.
52
53
54Return Value
55============
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61When an ioctl that takes an output or read/write parameter fails, the
62parameter remains unmodified.
diff --git a/Documentation/media/uapi/v4l/func-mmap.rst b/Documentation/media/uapi/v4l/func-mmap.rst
new file mode 100644
index 000000000000..c156fb7b7422
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-mmap.rst
@@ -0,0 +1,139 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-mmap:
4
5***********
6V4L2 mmap()
7***********
8
9Name
10====
11
12v4l2-mmap - Map device memory into application address space
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21 #include <sys/mman.h>
22
23
24.. cpp:function:: void *mmap( void *start, size_t length, int prot, int flags, int fd, off_t offset )
25
26
27Arguments
28=========
29
30``start``
31 Map the buffer to this address in the application's address space.
32 When the ``MAP_FIXED`` flag is specified, ``start`` must be a
33 multiple of the pagesize and mmap will fail when the specified
34 address cannot be used. Use of this option is discouraged;
35 applications should just specify a ``NULL`` pointer here.
36
37``length``
38 Length of the memory area to map. This must be the same value as
39 returned by the driver in the struct
40 :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the
41 single-planar API, and the same value as returned by the driver in
42 the struct :ref:`v4l2_plane <v4l2-plane>` ``length`` field for
43 the multi-planar API.
44
45``prot``
46 The ``prot`` argument describes the desired memory protection.
47 Regardless of the device type and the direction of data exchange it
48 should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read
49 and write access to image buffers. Drivers should support at least
50 this combination of flags.
51
52 .. note::
53
54 #. The Linux ``videobuf`` kernel module, which is used by some
55 drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the
56 driver does not support the desired protection, the
57 :ref:`mmap() <func-mmap>` function fails.
58
59 #. Device memory accesses (e. g. the memory on a graphics card
60 with video capturing hardware) may incur a performance penalty
61 compared to main memory accesses, or reads may be significantly
62 slower than writes or vice versa. Other I/O methods may be more
63 efficient in such case.
64
65``flags``
66 The ``flags`` parameter specifies the type of the mapped object,
67 mapping options and whether modifications made to the mapped copy of
68 the page are private to the process or are to be shared with other
69 references.
70
71 ``MAP_FIXED`` requests that the driver selects no other address than
72 the one specified. If the specified address cannot be used,
73 :ref:`mmap() <func-mmap>` will fail. If ``MAP_FIXED`` is specified,
74 ``start`` must be a multiple of the pagesize. Use of this option is
75 discouraged.
76
77 One of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set.
78 ``MAP_SHARED`` allows applications to share the mapped memory with
79 other (e. g. child-) processes.
80
81 .. note:: The Linux ``videobuf`` module which is used by some
82 drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests
83 copy-on-write semantics. V4L2 applications should not set the
84 ``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON``
85 flags.
86
87``fd``
88 File descriptor returned by :ref:`open() <func-open>`.
89
90``offset``
91 Offset of the buffer in device memory. This must be the same value
92 as returned by the driver in the struct
93 :ref:`v4l2_buffer <v4l2-buffer>` ``m`` union ``offset`` field for
94 the single-planar API, and the same value as returned by the driver
95 in the struct :ref:`v4l2_plane <v4l2-plane>` ``m`` union
96 ``mem_offset`` field for the multi-planar API.
97
98
99Description
100===========
101
102The :ref:`mmap() <func-mmap>` function asks to map ``length`` bytes starting at
103``offset`` in the memory of the device specified by ``fd`` into the
104application address space, preferably at address ``start``. This latter
105address is a hint only, and is usually specified as 0.
106
107Suitable length and offset parameters are queried with the
108:ref:`VIDIOC_QUERYBUF` ioctl. Buffers must be
109allocated with the :ref:`VIDIOC_REQBUFS` ioctl
110before they can be queried.
111
112To unmap buffers the :ref:`munmap() <func-munmap>` function is used.
113
114
115Return Value
116============
117
118On success :ref:`mmap() <func-mmap>` returns a pointer to the mapped buffer. On
119error ``MAP_FAILED`` (-1) is returned, and the ``errno`` variable is set
120appropriately. Possible error codes are:
121
122EBADF
123 ``fd`` is not a valid file descriptor.
124
125EACCES
126 ``fd`` is not open for reading and writing.
127
128EINVAL
129 The ``start`` or ``length`` or ``offset`` are not suitable. (E. g.
130 they are too large, or not aligned on a ``PAGESIZE`` boundary.)
131
132 The ``flags`` or ``prot`` value is not supported.
133
134 No buffers have been allocated with the
135 :ref:`VIDIOC_REQBUFS` ioctl.
136
137ENOMEM
138 Not enough physical or virtual memory was available to complete the
139 request.
diff --git a/Documentation/media/uapi/v4l/func-munmap.rst b/Documentation/media/uapi/v4l/func-munmap.rst
new file mode 100644
index 000000000000..c29c03f21279
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-munmap.rst
@@ -0,0 +1,58 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-munmap:
4
5*************
6V4L2 munmap()
7*************
8
9Name
10====
11
12v4l2-munmap - Unmap device memory
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21 #include <sys/mman.h>
22
23
24.. cpp:function:: int munmap( void *start, size_t length )
25
26
27Arguments
28=========
29
30``start``
31 Address of the mapped buffer as returned by the
32 :ref:`mmap() <func-mmap>` function.
33
34``length``
35 Length of the mapped buffer. This must be the same value as given to
36 :ref:`mmap() <func-mmap>` and returned by the driver in the struct
37 :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the
38 single-planar API and in the struct
39 :ref:`v4l2_plane <v4l2-plane>` ``length`` field for the
40 multi-planar API.
41
42
43Description
44===========
45
46Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped
47buffer and frees it, if possible.
48
49
50Return Value
51============
52
53On success :ref:`munmap() <func-munmap>` returns 0, on failure -1 and the
54``errno`` variable is set appropriately:
55
56EINVAL
57 The ``start`` or ``length`` is incorrect, or no buffers have been
58 mapped yet.
diff --git a/Documentation/media/uapi/v4l/func-open.rst b/Documentation/media/uapi/v4l/func-open.rst
new file mode 100644
index 000000000000..06bcadc269a4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-open.rst
@@ -0,0 +1,83 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-open:
4
5***********
6V4L2 open()
7***********
8
9Name
10====
11
12v4l2-open - Open a V4L2 device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <fcntl.h>
21
22
23.. cpp:function:: int open( const char *device_name, int flags )
24
25
26Arguments
27=========
28
29``device_name``
30 Device to be opened.
31
32``flags``
33 Open flags. Access mode must be ``O_RDWR``. This is just a
34 technicality, input devices still support only reading and output
35 devices only writing.
36
37 When the ``O_NONBLOCK`` flag is given, the :ref:`read() <func-read>`
38 function and the :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will
39 return the ``EAGAIN`` error code when no data is available or no
40 buffer is in the driver outgoing queue, otherwise these functions
41 block until data becomes available. All V4L2 drivers exchanging data
42 with applications must support the ``O_NONBLOCK`` flag.
43
44 Other flags have no effect.
45
46
47Description
48===========
49
50To open a V4L2 device applications call :ref:`open() <func-open>` with the
51desired device name. This function has no side effects; all data format
52parameters, current input or output, control values or other properties
53remain unchanged. At the first :ref:`open() <func-open>` call after loading the
54driver they will be reset to default values, drivers are never in an
55undefined state.
56
57
58Return Value
59============
60
61On success :ref:`open() <func-open>` returns the new file descriptor. On error
62-1 is returned, and the ``errno`` variable is set appropriately.
63Possible error codes are:
64
65EACCES
66 The caller has no permission to access the device.
67
68EBUSY
69 The driver does not support multiple opens and the device is already
70 in use.
71
72ENXIO
73 No device corresponding to this device special file exists.
74
75ENOMEM
76 Not enough kernel memory was available to complete the request.
77
78EMFILE
79 The process already has the maximum number of files open.
80
81ENFILE
82 The limit on the total number of files open on the system has been
83 reached.
diff --git a/Documentation/media/uapi/v4l/func-poll.rst b/Documentation/media/uapi/v4l/func-poll.rst
new file mode 100644
index 000000000000..e6ceb712b783
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-poll.rst
@@ -0,0 +1,116 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-poll:
4
5***********
6V4L2 poll()
7***********
8
9Name
10====
11
12v4l2-poll - Wait for some event on a file descriptor
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <sys/poll.h>
21
22
23.. cpp:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
24
25
26Arguments
27=========
28
29
30
31Description
32===========
33
34With the :ref:`poll() <func-poll>` function applications can suspend execution
35until the driver has captured data or is ready to accept data for
36output.
37
38When streaming I/O has been negotiated this function waits until a
39buffer has been filled by the capture device and can be dequeued with
40the :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. For output devices this
41function waits until the device is ready to accept a new buffer to be
42queued up with the :ref:`VIDIOC_QBUF` ioctl for
43display. When buffers are already in the outgoing queue of the driver
44(capture) or the incoming queue isn't full (display) the function
45returns immediately.
46
47On success :ref:`poll() <func-poll>` returns the number of file descriptors
48that have been selected (that is, file descriptors for which the
49``revents`` field of the respective :c:func:`struct pollfd` structure
50is non-zero). Capture devices set the ``POLLIN`` and ``POLLRDNORM``
51flags in the ``revents`` field, output devices the ``POLLOUT`` and
52``POLLWRNORM`` flags. When the function timed out it returns a value of
53zero, on failure it returns -1 and the ``errno`` variable is set
54appropriately. When the application did not call
55:ref:`VIDIOC_STREAMON` the :ref:`poll() <func-poll>`
56function succeeds, but sets the ``POLLERR`` flag in the ``revents``
57field. When the application has called
58:ref:`VIDIOC_STREAMON` for a capture device but
59hasn't yet called :ref:`VIDIOC_QBUF`, the
60:ref:`poll() <func-poll>` function succeeds and sets the ``POLLERR`` flag in
61the ``revents`` field. For output devices this same situation will cause
62:ref:`poll() <func-poll>` to succeed as well, but it sets the ``POLLOUT`` and
63``POLLWRNORM`` flags in the ``revents`` field.
64
65If an event occurred (see :ref:`VIDIOC_DQEVENT`)
66then ``POLLPRI`` will be set in the ``revents`` field and
67:ref:`poll() <func-poll>` will return.
68
69When use of the :ref:`read() <func-read>` function has been negotiated and the
70driver does not capture yet, the :ref:`poll() <func-poll>` function starts
71capturing. When that fails it returns a ``POLLERR`` as above. Otherwise
72it waits until data has been captured and can be read. When the driver
73captures continuously (as opposed to, for example, still images) the
74function may return immediately.
75
76When use of the :ref:`write() <func-write>` function has been negotiated and the
77driver does not stream yet, the :ref:`poll() <func-poll>` function starts
78streaming. When that fails it returns a ``POLLERR`` as above. Otherwise
79it waits until the driver is ready for a non-blocking
80:ref:`write() <func-write>` call.
81
82If the caller is only interested in events (just ``POLLPRI`` is set in
83the ``events`` field), then :ref:`poll() <func-poll>` will *not* start
84streaming if the driver does not stream yet. This makes it possible to
85just poll for events and not for buffers.
86
87All drivers implementing the :ref:`read() <func-read>` or :ref:`write() <func-write>`
88function or streaming I/O must also support the :ref:`poll() <func-poll>`
89function.
90
91For more details see the :ref:`poll() <func-poll>` manual page.
92
93
94Return Value
95============
96
97On success, :ref:`poll() <func-poll>` returns the number structures which have
98non-zero ``revents`` fields, or zero if the call timed out. On error -1
99is returned, and the ``errno`` variable is set appropriately:
100
101EBADF
102 One or more of the ``ufds`` members specify an invalid file
103 descriptor.
104
105EBUSY
106 The driver does not support multiple read or write streams and the
107 device is already in use.
108
109EFAULT
110 ``ufds`` references an inaccessible memory area.
111
112EINTR
113 The call was interrupted by a signal.
114
115EINVAL
116 The ``nfds`` argument is greater than ``OPEN_MAX``.
diff --git a/Documentation/media/uapi/v4l/func-read.rst b/Documentation/media/uapi/v4l/func-read.rst
new file mode 100644
index 000000000000..9a2aa5210233
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-read.rst
@@ -0,0 +1,131 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-read:
4
5***********
6V4L2 read()
7***********
8
9Name
10====
11
12v4l2-read - Read from a V4L2 device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t read( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32``buf``
33``count``
34
35
36Description
37===========
38
39:ref:`read() <func-read>` attempts to read up to ``count`` bytes from file
40descriptor ``fd`` into the buffer starting at ``buf``. The layout of the
41data in the buffer is discussed in the respective device interface
42section, see ##. If ``count`` is zero, :ref:`read() <func-read>` returns zero
43and has no other results. If ``count`` is greater than ``SSIZE_MAX``,
44the result is unspecified. Regardless of the ``count`` value each
45:ref:`read() <func-read>` call will provide at most one frame (two fields)
46worth of data.
47
48By default :ref:`read() <func-read>` blocks until data becomes available. When
49the ``O_NONBLOCK`` flag was given to the :ref:`open() <func-open>`
50function it returns immediately with an ``EAGAIN`` error code when no data
51is available. The :ref:`select() <func-select>` or
52:ref:`poll() <func-poll>` functions can always be used to suspend
53execution until data becomes available. All drivers supporting the
54:ref:`read() <func-read>` function must also support :ref:`select() <func-select>` and
55:ref:`poll() <func-poll>`.
56
57Drivers can implement read functionality in different ways, using a
58single or multiple buffers and discarding the oldest or newest frames
59once the internal buffers are filled.
60
61:ref:`read() <func-read>` never returns a "snapshot" of a buffer being filled.
62Using a single buffer the driver will stop capturing when the
63application starts reading the buffer until the read is finished. Thus
64only the period of the vertical blanking interval is available for
65reading, or the capture rate must fall below the nominal frame rate of
66the video standard.
67
68The behavior of :ref:`read() <func-read>` when called during the active picture
69period or the vertical blanking separating the top and bottom field
70depends on the discarding policy. A driver discarding the oldest frames
71keeps capturing into an internal buffer, continuously overwriting the
72previously, not read frame, and returns the frame being received at the
73time of the :ref:`read() <func-read>` call as soon as it is complete.
74
75A driver discarding the newest frames stops capturing until the next
76:ref:`read() <func-read>` call. The frame being received at :ref:`read() <func-read>`
77time is discarded, returning the following frame instead. Again this
78implies a reduction of the capture rate to one half or less of the
79nominal frame rate. An example of this model is the video read mode of
80the bttv driver, initiating a DMA to user memory when :ref:`read() <func-read>`
81is called and returning when the DMA finished.
82
83In the multiple buffer model drivers maintain a ring of internal
84buffers, automatically advancing to the next free buffer. This allows
85continuous capturing when the application can empty the buffers fast
86enough. Again, the behavior when the driver runs out of free buffers
87depends on the discarding policy.
88
89Applications can get and set the number of buffers used internally by
90the driver with the :ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and
91:ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctls. They are optional,
92however. The discarding policy is not reported and cannot be changed.
93For minimum requirements see :ref:`devices`.
94
95
96Return Value
97============
98
99On success, the number of bytes read is returned. It is not an error if
100this number is smaller than the number of bytes requested, or the amount
101of data required for one frame. This may happen for example because
102:ref:`read() <func-read>` was interrupted by a signal. On error, -1 is
103returned, and the ``errno`` variable is set appropriately. In this case
104the next read will start at the beginning of a new frame. Possible error
105codes are:
106
107EAGAIN
108 Non-blocking I/O has been selected using O_NONBLOCK and no data was
109 immediately available for reading.
110
111EBADF
112 ``fd`` is not a valid file descriptor or is not open for reading, or
113 the process already has the maximum number of files open.
114
115EBUSY
116 The driver does not support multiple read streams and the device is
117 already in use.
118
119EFAULT
120 ``buf`` references an inaccessible memory area.
121
122EINTR
123 The call was interrupted by a signal before any data was read.
124
125EIO
126 I/O error. This indicates some hardware problem or a failure to
127 communicate with a remote device (USB camera etc.).
128
129EINVAL
130 The :ref:`read() <func-read>` function is not supported by this driver, not
131 on this device, or generally not on this type of device.
diff --git a/Documentation/media/uapi/v4l/func-select.rst b/Documentation/media/uapi/v4l/func-select.rst
new file mode 100644
index 000000000000..7798384ae396
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-select.rst
@@ -0,0 +1,106 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-select:
4
5*************
6V4L2 select()
7*************
8
9Name
10====
11
12v4l2-select - Synchronous I/O multiplexing
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <sys/time.h>
21 #include <sys/types.h>
22 #include <unistd.h>
23
24
25.. cpp:function:: int select( int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout )
26
27
28Arguments
29=========
30
31
32
33Description
34===========
35
36With the :ref:`select() <func-select>` function applications can suspend
37execution until the driver has captured data or is ready to accept data
38for output.
39
40When streaming I/O has been negotiated this function waits until a
41buffer has been filled or displayed and can be dequeued with the
42:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. When buffers are already in
43the outgoing queue of the driver the function returns immediately.
44
45On success :ref:`select() <func-select>` returns the total number of bits set in
46:c:func:`struct fd_set`. When the function timed out it returns
47a value of zero. On failure it returns -1 and the ``errno`` variable is
48set appropriately. When the application did not call
49:ref:`VIDIOC_QBUF` or
50:ref:`VIDIOC_STREAMON` yet the :ref:`select() <func-select>`
51function succeeds, setting the bit of the file descriptor in ``readfds``
52or ``writefds``, but subsequent :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`
53calls will fail. [#f1]_
54
55When use of the :ref:`read() <func-read>` function has been negotiated and the
56driver does not capture yet, the :ref:`select() <func-select>` function starts
57capturing. When that fails, :ref:`select() <func-select>` returns successful and
58a subsequent :ref:`read() <func-read>` call, which also attempts to start
59capturing, will return an appropriate error code. When the driver
60captures continuously (as opposed to, for example, still images) and
61data is already available the :ref:`select() <func-select>` function returns
62immediately.
63
64When use of the :ref:`write() <func-write>` function has been negotiated the
65:ref:`select() <func-select>` function just waits until the driver is ready for a
66non-blocking :ref:`write() <func-write>` call.
67
68All drivers implementing the :ref:`read() <func-read>` or :ref:`write() <func-write>`
69function or streaming I/O must also support the :ref:`select() <func-select>`
70function.
71
72For more details see the :ref:`select() <func-select>` manual page.
73
74
75Return Value
76============
77
78On success, :ref:`select() <func-select>` returns the number of descriptors
79contained in the three returned descriptor sets, which will be zero if
80the timeout expired. On error -1 is returned, and the ``errno`` variable
81is set appropriately; the sets and ``timeout`` are undefined. Possible
82error codes are:
83
84EBADF
85 One or more of the file descriptor sets specified a file descriptor
86 that is not open.
87
88EBUSY
89 The driver does not support multiple read or write streams and the
90 device is already in use.
91
92EFAULT
93 The ``readfds``, ``writefds``, ``exceptfds`` or ``timeout`` pointer
94 references an inaccessible memory area.
95
96EINTR
97 The call was interrupted by a signal.
98
99EINVAL
100 The ``nfds`` argument is less than zero or greater than
101 ``FD_SETSIZE``.
102
103.. [#f1]
104 The Linux kernel implements :ref:`select() <func-select>` like the
105 :ref:`poll() <func-poll>` function, but :ref:`select() <func-select>` cannot
106 return a ``POLLERR``.
diff --git a/Documentation/media/uapi/v4l/func-write.rst b/Documentation/media/uapi/v4l/func-write.rst
new file mode 100644
index 000000000000..a3bc9b26fe56
--- /dev/null
+++ b/Documentation/media/uapi/v4l/func-write.rst
@@ -0,0 +1,82 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-write:
4
5************
6V4L2 write()
7************
8
9Name
10====
11
12v4l2-write - Write to a V4L2 device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t write( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by :ref:`open() <func-open>`.
31
32``buf``
33``count``
34
35
36Description
37===========
38
39:ref:`write() <func-write>` writes up to ``count`` bytes to the device
40referenced by the file descriptor ``fd`` from the buffer starting at
41``buf``. When the hardware outputs are not active yet, this function
42enables them. When ``count`` is zero, :ref:`write() <func-write>` returns 0
43without any other effect.
44
45When the application does not provide more data in time, the previous
46video frame, raw VBI image, sliced VPS or WSS data is displayed again.
47Sliced Teletext or Closed Caption data is not repeated, the driver
48inserts a blank line instead.
49
50
51Return Value
52============
53
54On success, the number of bytes written are returned. Zero indicates
55nothing was written. On error, -1 is returned, and the ``errno``
56variable is set appropriately. In this case the next write will start at
57the beginning of a new frame. Possible error codes are:
58
59EAGAIN
60 Non-blocking I/O has been selected using the
61 :ref:`O_NONBLOCK <func-open>` flag and no buffer space was
62 available to write the data immediately.
63
64EBADF
65 ``fd`` is not a valid file descriptor or is not open for writing.
66
67EBUSY
68 The driver does not support multiple write streams and the device is
69 already in use.
70
71EFAULT
72 ``buf`` references an inaccessible memory area.
73
74EINTR
75 The call was interrupted by a signal before any data was written.
76
77EIO
78 I/O error. This indicates some hardware problem.
79
80EINVAL
81 The :ref:`write() <func-write>` function is not supported by this driver,
82 not on this device, or generally not on this type of device.
diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst b/Documentation/media/uapi/v4l/hist-v4l2.rst
new file mode 100644
index 000000000000..3ba1c0c2df1a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -0,0 +1,1480 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _hist-v4l2:
4
5***********************
6Changes of the V4L2 API
7***********************
8
9Soon after the V4L API was added to the kernel it was criticised as too
10inflexible. In August 1998 Bill Dirks proposed a number of improvements
11and began to work on documentation, example drivers and applications.
12With the help of other volunteers this eventually became the V4L2 API,
13not just an extension but a replacement for the V4L API. However it took
14another four years and two stable kernel releases until the new API was
15finally accepted for inclusion into the kernel in its present form.
16
17
18Early Versions
19==============
20
211998-08-20: First version.
22
231998-08-27: The :ref:`select() <func-select>` function was introduced.
24
251998-09-10: New video standard interface.
26
271998-09-18: The ``VIDIOC_NONCAP`` ioctl was replaced by the otherwise
28meaningless ``O_TRUNC`` :ref:`open() <func-open>` flag, and the
29aliases ``O_NONCAP`` and ``O_NOIO`` were defined. Applications can set
30this flag if they intend to access controls only, as opposed to capture
31applications which need exclusive access. The ``VIDEO_STD_XXX``
32identifiers are now ordinals instead of flags, and the
33:c:func:`video_std_construct()` helper function takes id and
34transmission arguments.
35
361998-09-28: Revamped video standard. Made video controls individually
37enumerable.
38
391998-10-02: The ``id`` field was removed from struct
40:c:type:`struct video_standard` and the color subcarrier fields were
41renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
42renamed to :ref:`VIDIOC_ENUMSTD`,
43:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` to
44:ref:`VIDIOC_ENUMINPUT`. A first draft of the
45Codec API was released.
46
471998-11-08: Many minor changes. Most symbols have been renamed. Some
48material changes to struct :ref:`v4l2_capability <v4l2-capability>`.
49
501998-11-12: The read/write directon of some ioctls was misdefined.
51
521998-11-14: ``V4L2_PIX_FMT_RGB24`` changed to ``V4L2_PIX_FMT_BGR24``,
53and ``V4L2_PIX_FMT_RGB32`` changed to ``V4L2_PIX_FMT_BGR32``. Audio
54controls are now accessible with the
55:ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
56:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls under names starting
57with ``V4L2_CID_AUDIO``. The ``V4L2_MAJOR`` define was removed from
58``videodev.h`` since it was only used once in the ``videodev`` kernel
59module. The ``YUV422`` and ``YUV411`` planar image formats were added.
60
611998-11-28: A few ioctl symbols changed. Interfaces for codecs and video
62output devices were added.
63
641999-01-14: A raw VBI capture interface was added.
65
661999-01-19: The ``VIDIOC_NEXTBUF`` ioctl was removed.
67
68
69V4L2 Version 0.16 1999-01-31
70============================
71
721999-01-27: There is now one QBUF ioctl, VIDIOC_QWBUF and VIDIOC_QRBUF
73are gone. VIDIOC_QBUF takes a v4l2_buffer as a parameter. Added
74digital zoom (cropping) controls.
75
76
77V4L2 Version 0.18 1999-03-16
78============================
79
80Added a v4l to V4L2 ioctl compatibility layer to videodev.c. Driver
81writers, this changes how you implement your ioctl handler. See the
82Driver Writer's Guide. Added some more control id codes.
83
84
85V4L2 Version 0.19 1999-06-05
86============================
87
881999-03-18: Fill in the category and catname fields of v4l2_queryctrl
89objects before passing them to the driver. Required a minor change to
90the VIDIOC_QUERYCTRL handlers in the sample drivers.
91
921999-03-31: Better compatibility for v4l memory capture ioctls. Requires
93changes to drivers to fully support new compatibility features, see
94Driver Writer's Guide and v4l2cap.c. Added new control IDs:
95V4L2_CID_HFLIP, _VFLIP. Changed V4L2_PIX_FMT_YUV422P to _YUV422P,
96and _YUV411P to _YUV411P.
97
981999-04-04: Added a few more control IDs.
99
1001999-04-07: Added the button control type.
101
1021999-05-02: Fixed a typo in videodev.h, and added the
103V4L2_CTRL_FLAG_GRAYED (later V4L2_CTRL_FLAG_GRABBED) flag.
104
1051999-05-20: Definition of VIDIOC_G_CTRL was wrong causing a
106malfunction of this ioctl.
107
1081999-06-05: Changed the value of V4L2_CID_WHITENESS.
109
110
111V4L2 Version 0.20 (1999-09-10)
112==============================
113
114Version 0.20 introduced a number of changes which were *not backward
115compatible* with 0.19 and earlier versions. Purpose of these changes was
116to simplify the API, while making it more extensible and following
117common Linux driver API conventions.
118
1191. Some typos in ``V4L2_FMT_FLAG`` symbols were fixed. struct
120 :ref:`v4l2_clip <v4l2-clip>` was changed for compatibility with
121 v4l. (1999-08-30)
122
1232. ``V4L2_TUNER_SUB_LANG1`` was added. (1999-09-05)
124
1253. All ioctl() commands that used an integer argument now take a pointer
126 to an integer. Where it makes sense, ioctls will return the actual
127 new value in the integer pointed to by the argument, a common
128 convention in the V4L2 API. The affected ioctls are: VIDIOC_PREVIEW,
129 VIDIOC_STREAMON, VIDIOC_STREAMOFF, VIDIOC_S_FREQ,
130 VIDIOC_S_INPUT, VIDIOC_S_OUTPUT, VIDIOC_S_EFFECT. For example
131
132
133 .. code-block:: c
134
135 err = ioctl (fd, VIDIOC_XXX, V4L2_XXX);
136
137 becomes
138
139
140 .. code-block:: c
141
142 int a = V4L2_XXX; err = ioctl(fd, VIDIOC_XXX, &a);
143
1444. All the different get- and set-format commands were swept into one
145 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
146 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl taking a union and a
147 type field selecting the union member as parameter. Purpose is to
148 simplify the API by eliminating several ioctls and to allow new and
149 driver private data streams without adding new ioctls.
150
151 This change obsoletes the following ioctls: ``VIDIOC_S_INFMT``,
152 ``VIDIOC_G_INFMT``, ``VIDIOC_S_OUTFMT``, ``VIDIOC_G_OUTFMT``,
153 ``VIDIOC_S_VBIFMT`` and ``VIDIOC_G_VBIFMT``. The image format
154 structure :c:type:`struct v4l2_format` was renamed to struct
155 :ref:`v4l2_pix_format <v4l2-pix-format>`, while struct
156 :ref:`v4l2_format <v4l2-format>` is now the envelopping structure
157 for all format negotiations.
158
1595. Similar to the changes above, the ``VIDIOC_G_PARM`` and
160 ``VIDIOC_S_PARM`` ioctls were merged with ``VIDIOC_G_OUTPARM`` and
161 ``VIDIOC_S_OUTPARM``. A ``type`` field in the new struct
162 :ref:`v4l2_streamparm <v4l2-streamparm>` selects the respective
163 union member.
164
165 This change obsoletes the ``VIDIOC_G_OUTPARM`` and
166 ``VIDIOC_S_OUTPARM`` ioctls.
167
1686. Control enumeration was simplified, and two new control flags were
169 introduced and one dropped. The ``catname`` field was replaced by a
170 ``group`` field.
171
172 Drivers can now flag unsupported and temporarily unavailable controls
173 with ``V4L2_CTRL_FLAG_DISABLED`` and ``V4L2_CTRL_FLAG_GRABBED``
174 respectively. The ``group`` name indicates a possibly narrower
175 classification than the ``category``. In other words, there may be
176 multiple groups within a category. Controls within a group would
177 typically be drawn within a group box. Controls in different
178 categories might have a greater separation, or may even appear in
179 separate windows.
180
1817. The struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` was
182 changed to a 64 bit integer, containing the sampling or output time
183 of the frame in nanoseconds. Additionally timestamps will be in
184 absolute system time, not starting from zero at the beginning of a
185 stream. The data type name for timestamps is stamp_t, defined as a
186 signed 64-bit integer. Output devices should not send a buffer out
187 until the time in the timestamp field has arrived. I would like to
188 follow SGI's lead, and adopt a multimedia timestamping system like
189 their UST (Unadjusted System Time). See
190 http://web.archive.org/web/\*/http://reality.sgi.com
191 /cpirazzi_engr/lg/time/intro.html. UST uses timestamps that are
192 64-bit signed integers (not struct timeval's) and given in nanosecond
193 units. The UST clock starts at zero when the system is booted and
194 runs continuously and uniformly. It takes a little over 292 years for
195 UST to overflow. There is no way to set the UST clock. The regular
196 Linux time-of-day clock can be changed periodically, which would
197 cause errors if it were being used for timestamping a multimedia
198 stream. A real UST style clock will require some support in the
199 kernel that is not there yet. But in anticipation, I will change the
200 timestamp field to a 64-bit integer, and I will change the
201 v4l2_masterclock_gettime() function (used only by drivers) to
202 return a 64-bit integer.
203
2048. A ``sequence`` field was added to struct
205 :ref:`v4l2_buffer <v4l2-buffer>`. The ``sequence`` field counts
206 captured frames, it is ignored by output devices. When a capture
207 driver drops a frame, the sequence number of that frame is skipped.
208
209
210V4L2 Version 0.20 incremental changes
211=====================================
212
2131999-12-23: In struct :ref:`v4l2_vbi_format <v4l2-vbi-format>` the
214``reserved1`` field became ``offset``. Previously drivers were required
215to clear the ``reserved1`` field.
216
2172000-01-13: The ``V4L2_FMT_FLAG_NOT_INTERLACED`` flag was added.
218
2192000-07-31: The ``linux/poll.h`` header is now included by
220``videodev.h`` for compatibility with the original ``videodev.h`` file.
221
2222000-11-20: ``V4L2_TYPE_VBI_OUTPUT`` and ``V4L2_PIX_FMT_Y41P`` were
223added.
224
2252000-11-25: ``V4L2_TYPE_VBI_INPUT`` was added.
226
2272000-12-04: A couple typos in symbol names were fixed.
228
2292001-01-18: To avoid namespace conflicts the ``fourcc`` macro defined in
230the ``videodev.h`` header file was renamed to ``v4l2_fourcc``.
231
2322001-01-25: A possible driver-level compatibility problem between the
233``videodev.h`` file in Linux 2.4.0 and the ``videodev.h`` file included
234in the ``videodevX`` patch was fixed. Users of an earlier version of
235``videodevX`` on Linux 2.4.0 should recompile their V4L and V4L2
236drivers.
237
2382001-01-26: A possible kernel-level incompatibility between the
239``videodev.h`` file in the ``videodevX`` patch and the ``videodev.h``
240file in Linux 2.2.x with devfs patches applied was fixed.
241
2422001-03-02: Certain V4L ioctls which pass data in both direction
243although they are defined with read-only parameter, did not work
244correctly through the backward compatibility layer. [Solution?]
245
2462001-04-13: Big endian 16-bit RGB formats were added.
247
2482001-09-17: New YUV formats and the
249:ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
250:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctls were added.
251(The old ``VIDIOC_G_FREQ`` and ``VIDIOC_S_FREQ`` ioctls did not take
252multiple tuners into account.)
253
2542000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
255compatibility* as the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
256:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls may fail now if the struct
257:c:type:`struct v4l2_fmt` ``type`` field does not contain
258``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
259:ref:`v4l2_vbi_format <v4l2-vbi-format>` ``offset`` field the
260ambiguous phrase "rising edge" was changed to "leading edge".
261
262
263V4L2 Version 0.20 2000-11-23
264============================
265
266A number of changes were made to the raw VBI interface.
267
2681. Figures clarifying the line numbering scheme were added to the V4L2
269 API specification. The ``start``\ [0] and ``start``\ [1] fields no
270 longer count line numbers beginning at zero. Rationale: a) The
271 previous definition was unclear. b) The ``start``\ [] values are
272 ordinal numbers. c) There is no point in inventing a new line
273 numbering scheme. We now use line number as defined by ITU-R, period.
274 Compatibility: Add one to the start values. Applications depending on
275 the previous semantics may not function correctly.
276
2772. The restriction "count[0] > 0 and count[1] > 0" has been relaxed to
278 "(count[0] + count[1]) > 0". Rationale: Drivers may allocate
279 resources at scan line granularity and some data services are
280 transmitted only on the first field. The comment that both ``count``
281 values will usually be equal is misleading and pointless and has been
282 removed. This change *breaks compatibility* with earlier versions:
283 Drivers may return ``EINVAL``, applications may not function correctly.
284
2853. Drivers are again permitted to return negative (unknown) start values
286 as proposed earlier. Why this feature was dropped is unclear. This
287 change may *break compatibility* with applications depending on the
288 start values being positive. The use of ``EBUSY`` and ``EINVAL``
289 error codes with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl was
290 clarified. The ``EBUSY`` error code was finally documented, and the
291 ``reserved2`` field which was previously mentioned only in the
292 ``videodev.h`` header file.
293
2944. New buffer types ``V4L2_TYPE_VBI_INPUT`` and ``V4L2_TYPE_VBI_OUTPUT``
295 were added. The former is an alias for the old ``V4L2_TYPE_VBI``, the
296 latter was missing in the ``videodev.h`` file.
297
298
299V4L2 Version 0.20 2002-07-25
300============================
301
302Added sliced VBI interface proposal.
303
304
305V4L2 in Linux 2.5.46, 2002-10
306=============================
307
308Around October-November 2002, prior to an announced feature freeze of
309Linux 2.5, the API was revised, drawing from experience with V4L2 0.20.
310This unnamed version was finally merged into Linux 2.5.46.
311
3121. As specified in :ref:`related`, drivers must make related device
313 functions available under all minor device numbers.
314
3152. The :ref:`open() <func-open>` function requires access mode
316 ``O_RDWR`` regardless of the device type. All V4L2 drivers
317 exchanging data with applications must support the ``O_NONBLOCK``
318 flag. The ``O_NOIO`` flag, a V4L2 symbol which aliased the
319 meaningless ``O_TRUNC`` to indicate accesses without data exchange
320 (panel applications) was dropped. Drivers must stay in "panel mode"
321 until the application attempts to initiate a data exchange, see
322 :ref:`open`.
323
3243. The struct :ref:`v4l2_capability <v4l2-capability>` changed
325 dramatically. Note that also the size of the structure changed,
326 which is encoded in the ioctl request code, thus older V4L2 devices
327 will respond with an ``EINVAL`` error code to the new
328 :ref:`VIDIOC_QUERYCAP` ioctl.
329
330 There are new fields to identify the driver, a new RDS device
331 function ``V4L2_CAP_RDS_CAPTURE``, the ``V4L2_CAP_AUDIO`` flag
332 indicates if the device has any audio connectors, another I/O
333 capability ``V4L2_CAP_ASYNCIO`` can be flagged. In response to these
334 changes the ``type`` field became a bit set and was merged into the
335 ``flags`` field. ``V4L2_FLAG_TUNER`` was renamed to
336 ``V4L2_CAP_TUNER``, ``V4L2_CAP_VIDEO_OVERLAY`` replaced
337 ``V4L2_FLAG_PREVIEW`` and ``V4L2_CAP_VBI_CAPTURE`` and
338 ``V4L2_CAP_VBI_OUTPUT`` replaced ``V4L2_FLAG_DATA_SERVICE``.
339 ``V4L2_FLAG_READ`` and ``V4L2_FLAG_WRITE`` were merged into
340 ``V4L2_CAP_READWRITE``.
341
342 The redundant fields ``inputs``, ``outputs`` and ``audios`` were
343 removed. These properties can be determined as described in
344 :ref:`video` and :ref:`audio`.
345
346 The somewhat volatile and therefore barely useful fields
347 ``maxwidth``, ``maxheight``, ``minwidth``, ``minheight``,
348 ``maxframerate`` were removed. This information is available as
349 described in :ref:`format` and :ref:`standard`.
350
351 ``V4L2_FLAG_SELECT`` was removed. We believe the select() function
352 is important enough to require support of it in all V4L2 drivers
353 exchanging data with applications. The redundant
354 ``V4L2_FLAG_MONOCHROME`` flag was removed, this information is
355 available as described in :ref:`format`.
356
3574. In struct :ref:`v4l2_input <v4l2-input>` the ``assoc_audio``
358 field and the ``capability`` field and its only flag
359 ``V4L2_INPUT_CAP_AUDIO`` was replaced by the new ``audioset`` field.
360 Instead of linking one video input to one audio input this field
361 reports all audio inputs this video input combines with.
362
363 New fields are ``tuner`` (reversing the former link from tuners to
364 video inputs), ``std`` and ``status``.
365
366 Accordingly struct :ref:`v4l2_output <v4l2-output>` lost its
367 ``capability`` and ``assoc_audio`` fields. ``audioset``,
368 ``modulator`` and ``std`` where added instead.
369
3705. The struct :ref:`v4l2_audio <v4l2-audio>` field ``audio`` was
371 renamed to ``index``, for consistency with other structures. A new
372 capability flag ``V4L2_AUDCAP_STEREO`` was added to indicated if the
373 audio input in question supports stereo sound.
374 ``V4L2_AUDCAP_EFFECTS`` and the corresponding ``V4L2_AUDMODE`` flags
375 where removed. This can be easily implemented using controls.
376 (However the same applies to AVL which is still there.)
377
378 Again for consistency the struct
379 :ref:`v4l2_audioout <v4l2-audioout>` field ``audio`` was renamed
380 to ``index``.
381
3826. The struct :ref:`v4l2_tuner <v4l2-tuner>` ``input`` field was
383 replaced by an ``index`` field, permitting devices with multiple
384 tuners. The link between video inputs and tuners is now reversed,
385 inputs point to their tuner. The ``std`` substructure became a
386 simple set (more about this below) and moved into struct
387 :ref:`v4l2_input <v4l2-input>`. A ``type`` field was added.
388
389 Accordingly in struct :ref:`v4l2_modulator <v4l2-modulator>` the
390 ``output`` was replaced by an ``index`` field.
391
392 In struct :ref:`v4l2_frequency <v4l2-frequency>` the ``port``
393 field was replaced by a ``tuner`` field containing the respective
394 tuner or modulator index number. A tuner ``type`` field was added
395 and the ``reserved`` field became larger for future extensions
396 (satellite tuners in particular).
397
3987. The idea of completely transparent video standards was dropped.
399 Experience showed that applications must be able to work with video
400 standards beyond presenting the user a menu. Instead of enumerating
401 supported standards with an ioctl applications can now refer to
402 standards by :ref:`v4l2_std_id <v4l2-std-id>` and symbols
403 defined in the ``videodev2.h`` header file. For details see
404 :ref:`standard`. The :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and
405 :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` now take a pointer to this
406 type as argument. :ref:`VIDIOC_QUERYSTD` was
407 added to autodetect the received standard, if the hardware has this
408 capability. In struct :ref:`v4l2_standard <v4l2-standard>` an
409 ``index`` field was added for
410 :ref:`VIDIOC_ENUMSTD`. A
411 :ref:`v4l2_std_id <v4l2-std-id>` field named ``id`` was added as
412 machine readable identifier, also replacing the ``transmission``
413 field. The misleading ``framerate`` field was renamed to
414 ``frameperiod``. The now obsolete ``colorstandard`` information,
415 originally needed to distguish between variations of standards, were
416 removed.
417
418 Struct :c:type:`struct v4l2_enumstd` ceased to be.
419 :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
420 struct :ref:`v4l2_standard <v4l2-standard>` directly. The
421 information which standards are supported by a particular video
422 input or output moved into struct :ref:`v4l2_input <v4l2-input>`
423 and struct :ref:`v4l2_output <v4l2-output>` fields named ``std``,
424 respectively.
425
4268. The struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` fields
427 ``category`` and ``group`` did not catch on and/or were not
428 implemented as expected and therefore removed.
429
4309. The :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl was added to
431 negotiate data formats as with
432 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, but without the overhead of
433 programming the hardware and regardless of I/O in progress.
434
435 In struct :ref:`v4l2_format <v4l2-format>` the ``fmt`` union was
436 extended to contain struct :ref:`v4l2_window <v4l2-window>`. All
437 image format negotiations are now possible with ``VIDIOC_G_FMT``,
438 ``VIDIOC_S_FMT`` and ``VIDIOC_TRY_FMT``; ioctl. The ``VIDIOC_G_WIN``
439 and ``VIDIOC_S_WIN`` ioctls to prepare for a video overlay were
440 removed. The ``type`` field changed to type enum
441 :ref:`v4l2_buf_type <v4l2-buf-type>` and the buffer type names
442 changed as follows.
443
444
445
446 .. flat-table::
447 :header-rows: 1
448 :stub-columns: 0
449
450
451 - .. row 1
452
453 - Old defines
454
455 - enum :ref:`v4l2_buf_type <v4l2-buf-type>`
456
457 - .. row 2
458
459 - ``V4L2_BUF_TYPE_CAPTURE``
460
461 - ``V4L2_BUF_TYPE_VIDEO_CAPTURE``
462
463 - .. row 3
464
465 - ``V4L2_BUF_TYPE_CODECIN``
466
467 - Omitted for now
468
469 - .. row 4
470
471 - ``V4L2_BUF_TYPE_CODECOUT``
472
473 - Omitted for now
474
475 - .. row 5
476
477 - ``V4L2_BUF_TYPE_EFFECTSIN``
478
479 - Omitted for now
480
481 - .. row 6
482
483 - ``V4L2_BUF_TYPE_EFFECTSIN2``
484
485 - Omitted for now
486
487 - .. row 7
488
489 - ``V4L2_BUF_TYPE_EFFECTSOUT``
490
491 - Omitted for now
492
493 - .. row 8
494
495 - ``V4L2_BUF_TYPE_VIDEOOUT``
496
497 - ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
498
499 - .. row 9
500
501 - ``-``
502
503 - ``V4L2_BUF_TYPE_VIDEO_OVERLAY``
504
505 - .. row 10
506
507 - ``-``
508
509 - ``V4L2_BUF_TYPE_VBI_CAPTURE``
510
511 - .. row 11
512
513 - ``-``
514
515 - ``V4L2_BUF_TYPE_VBI_OUTPUT``
516
517 - .. row 12
518
519 - ``-``
520
521 - ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE``
522
523 - .. row 13
524
525 - ``-``
526
527 - ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``
528
529 - .. row 14
530
531 - ``V4L2_BUF_TYPE_PRIVATE_BASE``
532
533 - ``V4L2_BUF_TYPE_PRIVATE`` (but this is deprecated)
534
535
53610. In struct :ref:`v4l2_fmtdesc <v4l2-fmtdesc>` a enum
537 :ref:`v4l2_buf_type <v4l2-buf-type>` field named ``type`` was
538 added as in struct :ref:`v4l2_format <v4l2-format>`. The
539 ``VIDIOC_ENUM_FBUFFMT`` ioctl is no longer needed and was removed.
540 These calls can be replaced by
541 :ref:`VIDIOC_ENUM_FMT` with type
542 ``V4L2_BUF_TYPE_VIDEO_OVERLAY``.
543
54411. In struct :ref:`v4l2_pix_format <v4l2-pix-format>` the ``depth``
545 field was removed, assuming applications which recognize the format
546 by its four-character-code already know the color depth, and others
547 do not care about it. The same rationale lead to the removal of the
548 ``V4L2_FMT_FLAG_COMPRESSED`` flag. The
549 ``V4L2_FMT_FLAG_SWCONVECOMPRESSED`` flag was removed because drivers
550 are not supposed to convert images in kernel space. A user library
551 of conversion functions should be provided instead. The
552 ``V4L2_FMT_FLAG_BYTESPERLINE`` flag was redundant. Applications can
553 set the ``bytesperline`` field to zero to get a reasonable default.
554 Since the remaining flags were replaced as well, the ``flags`` field
555 itself was removed.
556
557 The interlace flags were replaced by a enum
558 :ref:`v4l2_field <v4l2-field>` value in a newly added ``field``
559 field.
560
561
562
563 .. flat-table::
564 :header-rows: 1
565 :stub-columns: 0
566
567
568 - .. row 1
569
570 - Old flag
571
572 - enum :ref:`v4l2_field <v4l2-field>`
573
574 - .. row 2
575
576 - ``V4L2_FMT_FLAG_NOT_INTERLACED``
577
578 - ?
579
580 - .. row 3
581
582 - ``V4L2_FMT_FLAG_INTERLACED`` = ``V4L2_FMT_FLAG_COMBINED``
583
584 - ``V4L2_FIELD_INTERLACED``
585
586 - .. row 4
587
588 - ``V4L2_FMT_FLAG_TOPFIELD`` = ``V4L2_FMT_FLAG_ODDFIELD``
589
590 - ``V4L2_FIELD_TOP``
591
592 - .. row 5
593
594 - ``V4L2_FMT_FLAG_BOTFIELD`` = ``V4L2_FMT_FLAG_EVENFIELD``
595
596 - ``V4L2_FIELD_BOTTOM``
597
598 - .. row 6
599
600 - ``-``
601
602 - ``V4L2_FIELD_SEQ_TB``
603
604 - .. row 7
605
606 - ``-``
607
608 - ``V4L2_FIELD_SEQ_BT``
609
610 - .. row 8
611
612 - ``-``
613
614 - ``V4L2_FIELD_ALTERNATE``
615
616
617 The color space flags were replaced by a enum
618 :ref:`v4l2_colorspace <v4l2-colorspace>` value in a newly added
619 ``colorspace`` field, where one of ``V4L2_COLORSPACE_SMPTE170M``,
620 ``V4L2_COLORSPACE_BT878``, ``V4L2_COLORSPACE_470_SYSTEM_M`` or
621 ``V4L2_COLORSPACE_470_SYSTEM_BG`` replaces ``V4L2_FMT_CS_601YUV``.
622
62312. In struct :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` the
624 ``type`` field was properly defined as enum
625 :ref:`v4l2_buf_type <v4l2-buf-type>`. Buffer types changed as
626 mentioned above. A new ``memory`` field of type enum
627 :ref:`v4l2_memory <v4l2-memory>` was added to distinguish between
628 I/O methods using buffers allocated by the driver or the
629 application. See :ref:`io` for details.
630
63113. In struct :ref:`v4l2_buffer <v4l2-buffer>` the ``type`` field was
632 properly defined as enum :ref:`v4l2_buf_type <v4l2-buf-type>`.
633 Buffer types changed as mentioned above. A ``field`` field of type
634 enum :ref:`v4l2_field <v4l2-field>` was added to indicate if a
635 buffer contains a top or bottom field. The old field flags were
636 removed. Since no unadjusted system time clock was added to the
637 kernel as planned, the ``timestamp`` field changed back from type
638 stamp_t, an unsigned 64 bit integer expressing the sample time in
639 nanoseconds, to struct :c:type:`struct timeval`. With the addition
640 of a second memory mapping method the ``offset`` field moved into
641 union ``m``, and a new ``memory`` field of type enum
642 :ref:`v4l2_memory <v4l2-memory>` was added to distinguish between
643 I/O methods. See :ref:`io` for details.
644
645 The ``V4L2_BUF_REQ_CONTIG`` flag was used by the V4L compatibility
646 layer, after changes to this code it was no longer needed. The
647 ``V4L2_BUF_ATTR_DEVICEMEM`` flag would indicate if the buffer was
648 indeed allocated in device memory rather than DMA-able system
649 memory. It was barely useful and so was removed.
650
65114. In struct :ref:`v4l2_framebuffer <v4l2-framebuffer>` the
652 ``base[3]`` array anticipating double- and triple-buffering in
653 off-screen video memory, however without defining a synchronization
654 mechanism, was replaced by a single pointer. The
655 ``V4L2_FBUF_CAP_SCALEUP`` and ``V4L2_FBUF_CAP_SCALEDOWN`` flags were
656 removed. Applications can determine this capability more accurately
657 using the new cropping and scaling interface. The
658 ``V4L2_FBUF_CAP_CLIPPING`` flag was replaced by
659 ``V4L2_FBUF_CAP_LIST_CLIPPING`` and
660 ``V4L2_FBUF_CAP_BITMAP_CLIPPING``.
661
66215. In struct :ref:`v4l2_clip <v4l2-clip>` the ``x``, ``y``,
663 ``width`` and ``height`` field moved into a ``c`` substructure of
664 type struct :ref:`v4l2_rect <v4l2-rect>`. The ``x`` and ``y``
665 fields were renamed to ``left`` and ``top``, i. e. offsets to a
666 context dependent origin.
667
66816. In struct :ref:`v4l2_window <v4l2-window>` the ``x``, ``y``,
669 ``width`` and ``height`` field moved into a ``w`` substructure as
670 above. A ``field`` field of type %v4l2-field; was added to
671 distinguish between field and frame (interlaced) overlay.
672
67317. The digital zoom interface, including struct
674 :c:type:`struct v4l2_zoomcap`, struct
675 :c:type:`struct v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
676 ``V4L2_ZOOM_WHILESTREAMING`` was replaced by a new cropping and
677 scaling interface. The previously unused struct
678 :c:type:`struct v4l2_cropcap` and :c:type:`struct v4l2_crop`
679 where redefined for this purpose. See :ref:`crop` for details.
680
68118. In struct :ref:`v4l2_vbi_format <v4l2-vbi-format>` the
682 ``SAMPLE_FORMAT`` field now contains a four-character-code as used
683 to identify video image formats and ``V4L2_PIX_FMT_GREY`` replaces
684 the ``V4L2_VBI_SF_UBYTE`` define. The ``reserved`` field was
685 extended.
686
68719. In struct :ref:`v4l2_captureparm <v4l2-captureparm>` the type of
688 the ``timeperframe`` field changed from unsigned long to struct
689 :ref:`v4l2_fract <v4l2-fract>`. This allows the accurate
690 expression of multiples of the NTSC-M frame rate 30000 / 1001. A new
691 field ``readbuffers`` was added to control the driver behaviour in
692 read I/O mode.
693
694 Similar changes were made to struct
695 :ref:`v4l2_outputparm <v4l2-outputparm>`.
696
69720. The struct :c:type:`struct v4l2_performance` and
698 ``VIDIOC_G_PERF`` ioctl were dropped. Except when using the
699 :ref:`read/write I/O method <rw>`, which is limited anyway, this
700 information is already available to applications.
701
70221. The example transformation from RGB to YCbCr color space in the old
703 V4L2 documentation was inaccurate, this has been corrected in
704 :ref:`pixfmt`.
705
706
707V4L2 2003-06-19
708===============
709
7101. A new capability flag ``V4L2_CAP_RADIO`` was added for radio devices.
711 Prior to this change radio devices would identify solely by having
712 exactly one tuner whose type field reads ``V4L2_TUNER_RADIO``.
713
7142. An optional driver access priority mechanism was added, see
715 :ref:`app-pri` for details.
716
7173. The audio input and output interface was found to be incomplete.
718
719 Previously the :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` ioctl would
720 enumerate the available audio inputs. An ioctl to determine the
721 current audio input, if more than one combines with the current video
722 input, did not exist. So ``VIDIOC_G_AUDIO`` was renamed to
723 ``VIDIOC_G_AUDIO_OLD``, this ioctl was removed on Kernel 2.6.39. The
724 :ref:`VIDIOC_ENUMAUDIO` ioctl was added to
725 enumerate audio inputs, while
726 :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` now reports the current
727 audio input.
728
729 The same changes were made to
730 :ref:`VIDIOC_G_AUDOUT <VIDIOC_G_AUDOUT>` and
731 :ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>`.
732
733 Until further the "videodev" module will automatically translate
734 between the old and new ioctls, but drivers and applications must be
735 updated to successfully compile again.
736
7374. The :ref:`VIDIOC_OVERLAY` ioctl was incorrectly
738 defined with write-read parameter. It was changed to write-only,
739 while the write-read version was renamed to ``VIDIOC_OVERLAY_OLD``.
740 The old ioctl was removed on Kernel 2.6.39. Until further the
741 "videodev" kernel module will automatically translate to the new
742 version, so drivers must be recompiled, but not applications.
743
7445. :ref:`overlay` incorrectly stated that clipping rectangles define
745 regions where the video can be seen. Correct is that clipping
746 rectangles define regions where *no* video shall be displayed and so
747 the graphics surface can be seen.
748
7496. The :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` and
750 :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls were defined with
751 write-only parameter, inconsistent with other ioctls modifying their
752 argument. They were changed to write-read, while a ``_OLD`` suffix
753 was added to the write-only versions. The old ioctls were removed on
754 Kernel 2.6.39. Drivers and applications assuming a constant parameter
755 need an update.
756
757
758V4L2 2003-11-05
759===============
760
7611. In :ref:`pixfmt-rgb` the following pixel formats were incorrectly
762 transferred from Bill Dirks' V4L2 specification. Descriptions below
763 refer to bytes in memory, in ascending address order.
764
765
766
767 .. flat-table::
768 :header-rows: 1
769 :stub-columns: 0
770
771
772 - .. row 1
773
774 - Symbol
775
776 - In this document prior to revision 0.5
777
778 - Corrected
779
780 - .. row 2
781
782 - ``V4L2_PIX_FMT_RGB24``
783
784 - B, G, R
785
786 - R, G, B
787
788 - .. row 3
789
790 - ``V4L2_PIX_FMT_BGR24``
791
792 - R, G, B
793
794 - B, G, R
795
796 - .. row 4
797
798 - ``V4L2_PIX_FMT_RGB32``
799
800 - B, G, R, X
801
802 - R, G, B, X
803
804 - .. row 5
805
806 - ``V4L2_PIX_FMT_BGR32``
807
808 - R, G, B, X
809
810 - B, G, R, X
811
812
813 The ``V4L2_PIX_FMT_BGR24`` example was always correct.
814
815 In :ref:`v4l-image-properties` the mapping of the V4L
816 ``VIDEO_PALETTE_RGB24`` and ``VIDEO_PALETTE_RGB32`` formats to V4L2
817 pixel formats was accordingly corrected.
818
8192. Unrelated to the fixes above, drivers may still interpret some V4L2
820 RGB pixel formats differently. These issues have yet to be addressed,
821 for details see :ref:`pixfmt-rgb`.
822
823
824V4L2 in Linux 2.6.6, 2004-05-09
825===============================
826
8271. The :ref:`VIDIOC_CROPCAP` ioctl was incorrectly
828 defined with read-only parameter. It is now defined as write-read
829 ioctl, while the read-only version was renamed to
830 ``VIDIOC_CROPCAP_OLD``. The old ioctl was removed on Kernel 2.6.39.
831
832
833V4L2 in Linux 2.6.8
834===================
835
8361. A new field ``input`` (former ``reserved[0]``) was added to the
837 struct :ref:`v4l2_buffer <v4l2-buffer>` structure. Purpose of this
838 field is to alternate between video inputs (e. g. cameras) in step
839 with the video capturing process. This function must be enabled with
840 the new ``V4L2_BUF_FLAG_INPUT`` flag. The ``flags`` field is no
841 longer read-only.
842
843
844V4L2 spec erratum 2004-08-01
845============================
846
8471. The return value of the :ref:`func-open` function was incorrectly
848 documented.
849
8502. Audio output ioctls end in -AUDOUT, not -AUDIOOUT.
851
8523. In the Current Audio Input example the ``VIDIOC_G_AUDIO`` ioctl took
853 the wrong argument.
854
8554. The documentation of the :ref:`VIDIOC_QBUF` and
856 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctls did not mention the
857 struct :ref:`v4l2_buffer <v4l2-buffer>` ``memory`` field. It was
858 also missing from examples. Also on the ``VIDIOC_DQBUF`` page the ``EIO``
859 error code was not documented.
860
861
862V4L2 in Linux 2.6.14
863====================
864
8651. A new sliced VBI interface was added. It is documented in
866 :ref:`sliced` and replaces the interface first proposed in V4L2
867 specification 0.8.
868
869
870V4L2 in Linux 2.6.15
871====================
872
8731. The :ref:`VIDIOC_LOG_STATUS` ioctl was added.
874
8752. New video standards ``V4L2_STD_NTSC_443``, ``V4L2_STD_SECAM_LC``,
876 ``V4L2_STD_SECAM_DK`` (a set of SECAM D, K and K1), and
877 ``V4L2_STD_ATSC`` (a set of ``V4L2_STD_ATSC_8_VSB`` and
878 ``V4L2_STD_ATSC_16_VSB``) were defined. Note the ``V4L2_STD_525_60``
879 set now includes ``V4L2_STD_NTSC_443``. See also
880 :ref:`v4l2-std-id`.
881
8823. The ``VIDIOC_G_COMP`` and ``VIDIOC_S_COMP`` ioctl were renamed to
883 ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` respectively. Their
884 argument was replaced by a struct
885 :c:type:`struct v4l2_mpeg_compression` pointer. (The
886 ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls where removed
887 in Linux 2.6.25.)
888
889
890V4L2 spec erratum 2005-11-27
891============================
892
893The capture example in :ref:`capture-example` called the
894:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctl without checking if
895cropping is supported. In the video standard selection example in
896:ref:`standard` the :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` call used
897the wrong argument type.
898
899
900V4L2 spec erratum 2006-01-10
901============================
902
9031. The ``V4L2_IN_ST_COLOR_KILL`` flag in struct
904 :ref:`v4l2_input <v4l2-input>` not only indicates if the color
905 killer is enabled, but also if it is active. (The color killer
906 disables color decoding when it detects no color in the video signal
907 to improve the image quality.)
908
9092. :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` is a write-read ioctl, not
910 write-only as stated on its reference page. The ioctl changed in 2003
911 as noted above.
912
913
914V4L2 spec erratum 2006-02-03
915============================
916
9171. In struct :ref:`v4l2_captureparm <v4l2-captureparm>` and struct
918 :ref:`v4l2_outputparm <v4l2-outputparm>` the ``timeperframe``
919 field gives the time in seconds, not microseconds.
920
921
922V4L2 spec erratum 2006-02-04
923============================
924
9251. The ``clips`` field in struct :ref:`v4l2_window <v4l2-window>`
926 must point to an array of struct :ref:`v4l2_clip <v4l2-clip>`, not
927 a linked list, because drivers ignore the struct
928 :c:type:`struct v4l2_clip`. ``next`` pointer.
929
930
931V4L2 in Linux 2.6.17
932====================
933
9341. New video standard macros were added: ``V4L2_STD_NTSC_M_KR`` (NTSC M
935 South Korea), and the sets ``V4L2_STD_MN``, ``V4L2_STD_B``,
936 ``V4L2_STD_GH`` and ``V4L2_STD_DK``. The ``V4L2_STD_NTSC`` and
937 ``V4L2_STD_SECAM`` sets now include ``V4L2_STD_NTSC_M_KR`` and
938 ``V4L2_STD_SECAM_LC`` respectively.
939
9402. A new ``V4L2_TUNER_MODE_LANG1_LANG2`` was defined to record both
941 languages of a bilingual program. The use of
942 ``V4L2_TUNER_MODE_STEREO`` for this purpose is deprecated now. See
943 the :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` section for details.
944
945
946V4L2 spec erratum 2006-09-23 (Draft 0.15)
947=========================================
948
9491. In various places ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` and
950 ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT`` of the sliced VBI interface were
951 not mentioned along with other buffer types.
952
9532. In :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` it was clarified that the struct
954 :ref:`v4l2_audio <v4l2-audio>` ``mode`` field is a flags field.
955
9563. :ref:`VIDIOC_QUERYCAP` did not mention the sliced VBI and radio
957 capability flags.
958
9594. In :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` it was clarified that applications
960 must initialize the tuner ``type`` field of struct
961 :ref:`v4l2_frequency <v4l2-frequency>` before calling
962 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>`.
963
9645. The ``reserved`` array in struct
965 :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` has 2 elements,
966 not 32.
967
9686. In :ref:`output` and :ref:`raw-vbi` the device file names
969 ``/dev/vout`` which never caught on were replaced by ``/dev/video``.
970
9717. With Linux 2.6.15 the possible range for VBI device minor numbers was
972 extended from 224-239 to 224-255. Accordingly device file names
973 ``/dev/vbi0`` to ``/dev/vbi31`` are possible now.
974
975
976V4L2 in Linux 2.6.18
977====================
978
9791. New ioctls :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`,
980 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and
981 :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` were added, a
982 flag to skip unsupported controls with
983 :ref:`VIDIOC_QUERYCTRL`, new control types
984 ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_TYPE_CTRL_CLASS``
985 (:ref:`v4l2-ctrl-type`), and new control flags
986 ``V4L2_CTRL_FLAG_READ_ONLY``, ``V4L2_CTRL_FLAG_UPDATE``,
987 ``V4L2_CTRL_FLAG_INACTIVE`` and ``V4L2_CTRL_FLAG_SLIDER``
988 (:ref:`control-flags`). See :ref:`extended-controls` for details.
989
990
991V4L2 in Linux 2.6.19
992====================
993
9941. In struct :ref:`v4l2_sliced_vbi_cap <v4l2-sliced-vbi-cap>` a
995 buffer type field was added replacing a reserved field. Note on
996 architectures where the size of enum types differs from int types the
997 size of the structure changed. The
998 :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl
999 was redefined from being read-only to write-read. Applications must
1000 initialize the type field and clear the reserved fields now. These
1001 changes may *break the compatibility* with older drivers and
1002 applications.
1003
10042. The ioctls :ref:`VIDIOC_ENUM_FRAMESIZES`
1005 and
1006 :ref:`VIDIOC_ENUM_FRAMEINTERVALS`
1007 were added.
1008
10093. A new pixel format ``V4L2_PIX_FMT_RGB444`` (:ref:`rgb-formats`) was
1010 added.
1011
1012
1013V4L2 spec erratum 2006-10-12 (Draft 0.17)
1014=========================================
1015
10161. ``V4L2_PIX_FMT_HM12`` (:ref:`reserved-formats`) is a YUV 4:2:0, not
1017 4:2:2 format.
1018
1019
1020V4L2 in Linux 2.6.21
1021====================
1022
10231. The ``videodev2.h`` header file is now dual licensed under GNU
1024 General Public License version two or later, and under a 3-clause
1025 BSD-style license.
1026
1027
1028V4L2 in Linux 2.6.22
1029====================
1030
10311. Two new field orders ``V4L2_FIELD_INTERLACED_TB`` and
1032 ``V4L2_FIELD_INTERLACED_BT`` were added. See :ref:`v4l2-field` for
1033 details.
1034
10352. Three new clipping/blending methods with a global or straight or
1036 inverted local alpha value were added to the video overlay interface.
1037 See the description of the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`
1038 and :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctls for details.
1039
1040 A new ``global_alpha`` field was added to
1041 :ref:`v4l2_window <v4l2-window>`, extending the structure. This
1042 may *break compatibility* with applications using a struct
1043 :c:type:`struct v4l2_window` directly. However the
1044 :ref:`VIDIOC_G/S/TRY_FMT <VIDIOC_G_FMT>` ioctls, which take a
1045 pointer to a :ref:`v4l2_format <v4l2-format>` parent structure
1046 with padding bytes at the end, are not affected.
1047
10483. The format of the ``chromakey`` field in struct
1049 :ref:`v4l2_window <v4l2-window>` changed from "host order RGB32"
1050 to a pixel value in the same format as the framebuffer. This may
1051 *break compatibility* with existing applications. Drivers supporting
1052 the "host order RGB32" format are not known.
1053
1054
1055V4L2 in Linux 2.6.24
1056====================
1057
10581. The pixel formats ``V4L2_PIX_FMT_PAL8``, ``V4L2_PIX_FMT_YUV444``,
1059 ``V4L2_PIX_FMT_YUV555``, ``V4L2_PIX_FMT_YUV565`` and
1060 ``V4L2_PIX_FMT_YUV32`` were added.
1061
1062
1063V4L2 in Linux 2.6.25
1064====================
1065
10661. The pixel formats :ref:`V4L2_PIX_FMT_Y16 <V4L2-PIX-FMT-Y16>` and
1067 :ref:`V4L2_PIX_FMT_SBGGR16 <V4L2-PIX-FMT-SBGGR16>` were added.
1068
10692. New :ref:`controls <control>` ``V4L2_CID_POWER_LINE_FREQUENCY``,
1070 ``V4L2_CID_HUE_AUTO``, ``V4L2_CID_WHITE_BALANCE_TEMPERATURE``,
1071 ``V4L2_CID_SHARPNESS`` and ``V4L2_CID_BACKLIGHT_COMPENSATION`` were
1072 added. The controls ``V4L2_CID_BLACK_LEVEL``, ``V4L2_CID_WHITENESS``,
1073 ``V4L2_CID_HCENTER`` and ``V4L2_CID_VCENTER`` were deprecated.
1074
10753. A :ref:`Camera controls class <camera-controls>` was added, with
1076 the new controls ``V4L2_CID_EXPOSURE_AUTO``,
1077 ``V4L2_CID_EXPOSURE_ABSOLUTE``, ``V4L2_CID_EXPOSURE_AUTO_PRIORITY``,
1078 ``V4L2_CID_PAN_RELATIVE``, ``V4L2_CID_TILT_RELATIVE``,
1079 ``V4L2_CID_PAN_RESET``, ``V4L2_CID_TILT_RESET``,
1080 ``V4L2_CID_PAN_ABSOLUTE``, ``V4L2_CID_TILT_ABSOLUTE``,
1081 ``V4L2_CID_FOCUS_ABSOLUTE``, ``V4L2_CID_FOCUS_RELATIVE`` and
1082 ``V4L2_CID_FOCUS_AUTO``.
1083
10844. The ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls, which
1085 were superseded by the :ref:`extended controls <extended-controls>`
1086 interface in Linux 2.6.18, where finally removed from the
1087 ``videodev2.h`` header file.
1088
1089
1090V4L2 in Linux 2.6.26
1091====================
1092
10931. The pixel formats ``V4L2_PIX_FMT_Y16`` and ``V4L2_PIX_FMT_SBGGR16``
1094 were added.
1095
10962. Added user controls ``V4L2_CID_CHROMA_AGC`` and
1097 ``V4L2_CID_COLOR_KILLER``.
1098
1099
1100V4L2 in Linux 2.6.27
1101====================
1102
11031. The :ref:`VIDIOC_S_HW_FREQ_SEEK` ioctl
1104 and the ``V4L2_CAP_HW_FREQ_SEEK`` capability were added.
1105
11062. The pixel formats ``V4L2_PIX_FMT_YVYU``, ``V4L2_PIX_FMT_PCA501``,
1107 ``V4L2_PIX_FMT_PCA505``, ``V4L2_PIX_FMT_PCA508``,
1108 ``V4L2_PIX_FMT_PCA561``, ``V4L2_PIX_FMT_SGBRG8``,
1109 ``V4L2_PIX_FMT_PAC207`` and ``V4L2_PIX_FMT_PJPG`` were added.
1110
1111
1112V4L2 in Linux 2.6.28
1113====================
1114
11151. Added ``V4L2_MPEG_AUDIO_ENCODING_AAC`` and
1116 ``V4L2_MPEG_AUDIO_ENCODING_AC3`` MPEG audio encodings.
1117
11182. Added ``V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC`` MPEG video encoding.
1119
11203. The pixel formats ``V4L2_PIX_FMT_SGRBG10`` and
1121 ``V4L2_PIX_FMT_SGRBG10DPCM8`` were added.
1122
1123
1124V4L2 in Linux 2.6.29
1125====================
1126
11271. The ``VIDIOC_G_CHIP_IDENT`` ioctl was renamed to
1128 ``VIDIOC_G_CHIP_IDENT_OLD`` and ``VIDIOC_DBG_G_CHIP_IDENT`` was
1129 introduced in its place. The old struct
1130 :c:type:`struct v4l2_chip_ident` was renamed to
1131 :c:type:`struct v4l2_chip_ident_old`.
1132
11332. The pixel formats ``V4L2_PIX_FMT_VYUY``, ``V4L2_PIX_FMT_NV16`` and
1134 ``V4L2_PIX_FMT_NV61`` were added.
1135
11363. Added camera controls ``V4L2_CID_ZOOM_ABSOLUTE``,
1137 ``V4L2_CID_ZOOM_RELATIVE``, ``V4L2_CID_ZOOM_CONTINUOUS`` and
1138 ``V4L2_CID_PRIVACY``.
1139
1140
1141V4L2 in Linux 2.6.30
1142====================
1143
11441. New control flag ``V4L2_CTRL_FLAG_WRITE_ONLY`` was added.
1145
11462. New control ``V4L2_CID_COLORFX`` was added.
1147
1148
1149V4L2 in Linux 2.6.32
1150====================
1151
11521. In order to be easier to compare a V4L2 API and a kernel version, now
1153 V4L2 API is numbered using the Linux Kernel version numeration.
1154
11552. Finalized the RDS capture API. See :ref:`rds` for more information.
1156
11573. Added new capabilities for modulators and RDS encoders.
1158
11594. Add description for libv4l API.
1160
11615. Added support for string controls via new type
1162 ``V4L2_CTRL_TYPE_STRING``.
1163
11646. Added ``V4L2_CID_BAND_STOP_FILTER`` documentation.
1165
11667. Added FM Modulator (FM TX) Extended Control Class:
1167 ``V4L2_CTRL_CLASS_FM_TX`` and their Control IDs.
1168
11698. Added FM Receiver (FM RX) Extended Control Class:
1170 ``V4L2_CTRL_CLASS_FM_RX`` and their Control IDs.
1171
11729. Added Remote Controller chapter, describing the default Remote
1173 Controller mapping for media devices.
1174
1175
1176V4L2 in Linux 2.6.33
1177====================
1178
11791. Added support for Digital Video timings in order to support HDTV
1180 receivers and transmitters.
1181
1182
1183V4L2 in Linux 2.6.34
1184====================
1185
11861. Added ``V4L2_CID_IRIS_ABSOLUTE`` and ``V4L2_CID_IRIS_RELATIVE``
1187 controls to the :ref:`Camera controls class <camera-controls>`.
1188
1189
1190V4L2 in Linux 2.6.37
1191====================
1192
11931. Remove the vtx (videotext/teletext) API. This API was no longer used
1194 and no hardware exists to verify the API. Nor were any userspace
1195 applications found that used it. It was originally scheduled for
1196 removal in 2.6.35.
1197
1198
1199V4L2 in Linux 2.6.39
1200====================
1201
12021. The old VIDIOC_*_OLD symbols and V4L1 support were removed.
1203
12042. Multi-planar API added. Does not affect the compatibility of current
1205 drivers and applications. See :ref:`multi-planar API <planar-apis>`
1206 for details.
1207
1208
1209V4L2 in Linux 3.1
1210=================
1211
12121. VIDIOC_QUERYCAP now returns a per-subsystem version instead of a
1213 per-driver one.
1214
1215 Standardize an error code for invalid ioctl.
1216
1217 Added V4L2_CTRL_TYPE_BITMASK.
1218
1219
1220V4L2 in Linux 3.2
1221=================
1222
12231. V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to
1224 userspace.
1225
12262. Add selection API for extended control over cropping and composing.
1227 Does not affect the compatibility of current drivers and
1228 applications. See :ref:`selection API <selection-api>` for details.
1229
1230
1231V4L2 in Linux 3.3
1232=================
1233
12341. Added ``V4L2_CID_ALPHA_COMPONENT`` control to the
1235 :ref:`User controls class <control>`.
1236
12372. Added the device_caps field to struct v4l2_capabilities and added
1238 the new V4L2_CAP_DEVICE_CAPS capability.
1239
1240
1241V4L2 in Linux 3.4
1242=================
1243
12441. Added :ref:`JPEG compression control class <jpeg-controls>`.
1245
12462. Extended the DV Timings API:
1247 :ref:`VIDIOC_ENUM_DV_TIMINGS`,
1248 :ref:`VIDIOC_QUERY_DV_TIMINGS` and
1249 :ref:`VIDIOC_DV_TIMINGS_CAP`.
1250
1251
1252V4L2 in Linux 3.5
1253=================
1254
12551. Added integer menus, the new type will be
1256 V4L2_CTRL_TYPE_INTEGER_MENU.
1257
12582. Added selection API for V4L2 subdev interface:
1259 :ref:`VIDIOC_SUBDEV_G_SELECTION` and
1260 :ref:`VIDIOC_SUBDEV_S_SELECTION <VIDIOC_SUBDEV_G_SELECTION>`.
1261
12623. Added ``V4L2_COLORFX_ANTIQUE``, ``V4L2_COLORFX_ART_FREEZE``,
1263 ``V4L2_COLORFX_AQUA``, ``V4L2_COLORFX_SILHOUETTE``,
1264 ``V4L2_COLORFX_SOLARIZATION``, ``V4L2_COLORFX_VIVID`` and
1265 ``V4L2_COLORFX_ARBITRARY_CBCR`` menu items to the
1266 ``V4L2_CID_COLORFX`` control.
1267
12684. Added ``V4L2_CID_COLORFX_CBCR`` control.
1269
12705. Added camera controls ``V4L2_CID_AUTO_EXPOSURE_BIAS``,
1271 ``V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE``,
1272 ``V4L2_CID_IMAGE_STABILIZATION``, ``V4L2_CID_ISO_SENSITIVITY``,
1273 ``V4L2_CID_ISO_SENSITIVITY_AUTO``, ``V4L2_CID_EXPOSURE_METERING``,
1274 ``V4L2_CID_SCENE_MODE``, ``V4L2_CID_3A_LOCK``,
1275 ``V4L2_CID_AUTO_FOCUS_START``, ``V4L2_CID_AUTO_FOCUS_STOP``,
1276 ``V4L2_CID_AUTO_FOCUS_STATUS`` and ``V4L2_CID_AUTO_FOCUS_RANGE``.
1277
1278
1279V4L2 in Linux 3.6
1280=================
1281
12821. Replaced ``input`` in :c:type:`struct v4l2_buffer` by
1283 ``reserved2`` and removed ``V4L2_BUF_FLAG_INPUT``.
1284
12852. Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE
1286 capabilities.
1287
12883. Added support for frequency band enumerations:
1289 :ref:`VIDIOC_ENUM_FREQ_BANDS`.
1290
1291
1292V4L2 in Linux 3.9
1293=================
1294
12951. Added timestamp types to ``flags`` field in
1296 :c:type:`struct v4l2_buffer`. See :ref:`buffer-flags`.
1297
12982. Added ``V4L2_EVENT_CTRL_CH_RANGE`` control event changes flag. See
1299 :ref:`ctrl-changes-flags`.
1300
1301
1302V4L2 in Linux 3.10
1303==================
1304
13051. Removed obsolete and unused DV_PRESET ioctls VIDIOC_G_DV_PRESET,
1306 VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and
1307 VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output
1308 capability flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS.
1309
13102. Added new debugging ioctl
1311 :ref:`VIDIOC_DBG_G_CHIP_INFO`.
1312
1313
1314V4L2 in Linux 3.11
1315==================
1316
13171. Remove obsolete ``VIDIOC_DBG_G_CHIP_IDENT`` ioctl.
1318
1319
1320V4L2 in Linux 3.14
1321==================
1322
13231. In struct :c:type:`struct v4l2_rect`, the type of ``width`` and
1324 ``height`` fields changed from _s32 to _u32.
1325
1326
1327V4L2 in Linux 3.15
1328==================
1329
13301. Added Software Defined Radio (SDR) Interface.
1331
1332
1333V4L2 in Linux 3.16
1334==================
1335
13361. Added event V4L2_EVENT_SOURCE_CHANGE.
1337
1338
1339V4L2 in Linux 3.17
1340==================
1341
13421. Extended struct :ref:`v4l2_pix_format <v4l2-pix-format>`. Added
1343 format flags.
1344
13452. Added compound control types and
1346 :ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>`.
1347
1348
1349V4L2 in Linux 3.18
1350==================
1351
13521. Added ``V4L2_CID_PAN_SPEED`` and ``V4L2_CID_TILT_SPEED`` camera
1353 controls.
1354
1355
1356V4L2 in Linux 3.19
1357==================
1358
13591. Rewrote Colorspace chapter, added new enum
1360 :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>` and enum
1361 :ref:`v4l2_quantization <v4l2-quantization>` fields to struct
1362 :ref:`v4l2_pix_format <v4l2-pix-format>`, struct
1363 :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` and
1364 struct :ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`.
1365
1366
1367V4L2 in Linux 4.4
1368=================
1369
13701. Renamed ``V4L2_TUNER_ADC`` to ``V4L2_TUNER_SDR``. The use of
1371 ``V4L2_TUNER_ADC`` is deprecated now.
1372
13732. Added ``V4L2_CID_RF_TUNER_RF_GAIN`` RF Tuner control.
1374
13753. Added transmitter support for Software Defined Radio (SDR) Interface.
1376
1377
1378.. _other:
1379
1380Relation of V4L2 to other Linux multimedia APIs
1381===============================================
1382
1383
1384.. _xvideo:
1385
1386X Video Extension
1387-----------------
1388
1389The X Video Extension (abbreviated XVideo or just Xv) is an extension of
1390the X Window system, implemented for example by the XFree86 project. Its
1391scope is similar to V4L2, an API to video capture and output devices for
1392X clients. Xv allows applications to display live video in a window,
1393send window contents to a TV output, and capture or output still images
1394in XPixmaps [#f1]_. With their implementation XFree86 makes the extension
1395available across many operating systems and architectures.
1396
1397Because the driver is embedded into the X server Xv has a number of
1398advantages over the V4L2 :ref:`video overlay interface <overlay>`. The
1399driver can easily determine the overlay target, i. e. visible graphics
1400memory or off-screen buffers for a destructive overlay. It can program
1401the RAMDAC for a non-destructive overlay, scaling or color-keying, or
1402the clipping functions of the video capture hardware, always in sync
1403with drawing operations or windows moving or changing their stacking
1404order.
1405
1406To combine the advantages of Xv and V4L a special Xv driver exists in
1407XFree86 and XOrg, just programming any overlay capable Video4Linux
1408device it finds. To enable it ``/etc/X11/XF86Config`` must contain these
1409lines:
1410
1411::
1412
1413 Section "Module"
1414 Load "v4l"
1415 EndSection
1416
1417As of XFree86 4.2 this driver still supports only V4L ioctls, however it
1418should work just fine with all V4L2 devices through the V4L2
1419backward-compatibility layer. Since V4L2 permits multiple opens it is
1420possible (if supported by the V4L2 driver) to capture video while an X
1421client requested video overlay. Restrictions of simultaneous capturing
1422and overlay are discussed in :ref:`overlay` apply.
1423
1424Only marginally related to V4L2, XFree86 extended Xv to support hardware
1425YUV to RGB conversion and scaling for faster video playback, and added
1426an interface to MPEG-2 decoding hardware. This API is useful to display
1427images captured with V4L2 devices.
1428
1429
1430Digital Video
1431-------------
1432
1433V4L2 does not support digital terrestrial, cable or satellite broadcast.
1434A separate project aiming at digital receivers exists. You can find its
1435homepage at `https://linuxtv.org <https://linuxtv.org>`__. The Linux
1436DVB API has no connection to the V4L2 API except that drivers for hybrid
1437hardware may support both.
1438
1439
1440Audio Interfaces
1441----------------
1442
1443[to do - OSS/ALSA]
1444
1445
1446.. _experimental:
1447
1448Experimental API Elements
1449=========================
1450
1451The following V4L2 API elements are currently experimental and may
1452change in the future.
1453
1454- :ref:`VIDIOC_DBG_G_REGISTER` and
1455 :ref:`VIDIOC_DBG_S_REGISTER <VIDIOC_DBG_G_REGISTER>` ioctls.
1456
1457- :ref:`VIDIOC_DBG_G_CHIP_INFO` ioctl.
1458
1459
1460.. _obsolete:
1461
1462Obsolete API Elements
1463=====================
1464
1465The following V4L2 API elements were superseded by new interfaces and
1466should not be implemented in new drivers.
1467
1468- ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls. Use Extended
1469 Controls, :ref:`extended-controls`.
1470
1471- VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET,
1472 VIDIOC_ENUM_DV_PRESETS and VIDIOC_QUERY_DV_PRESET ioctls. Use
1473 the DV Timings API (:ref:`dv-timings`).
1474
1475- ``VIDIOC_SUBDEV_G_CROP`` and ``VIDIOC_SUBDEV_S_CROP`` ioctls. Use
1476 ``VIDIOC_SUBDEV_G_SELECTION`` and ``VIDIOC_SUBDEV_S_SELECTION``,
1477 :ref:`VIDIOC_SUBDEV_G_SELECTION`.
1478
1479.. [#f1]
1480 This is not implemented in XFree86.
diff --git a/Documentation/media/uapi/v4l/io.rst b/Documentation/media/uapi/v4l/io.rst
new file mode 100644
index 000000000000..94b38a10ee65
--- /dev/null
+++ b/Documentation/media/uapi/v4l/io.rst
@@ -0,0 +1,51 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _io:
4
5############
6Input/Output
7############
8The V4L2 API defines several different methods to read from or write to
9a device. All drivers exchanging data with applications must support at
10least one of them.
11
12The classic I/O method using the :ref:`read() <func-read>` and
13:ref:`write() <func-write>` function is automatically selected after opening a
14V4L2 device. When the driver does not support this method attempts to
15read or write will fail at any time.
16
17Other methods must be negotiated. To select the streaming I/O method
18with memory mapped or user buffers applications call the
19:ref:`VIDIOC_REQBUFS` ioctl. The asynchronous I/O
20method is not defined yet.
21
22Video overlay can be considered another I/O method, although the
23application does not directly receive the image data. It is selected by
24initiating video overlay with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
25ioctl. For more information see :ref:`overlay`.
26
27Generally exactly one I/O method, including overlay, is associated with
28each file descriptor. The only exceptions are applications not
29exchanging data with a driver ("panel applications", see :ref:`open`)
30and drivers permitting simultaneous video capturing and overlay using
31the same file descriptor, for compatibility with V4L and earlier
32versions of V4L2.
33
34:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_REQBUFS` would permit this to some
35degree, but for simplicity drivers need not support switching the I/O
36method (after first switching away from read/write) other than by
37closing and reopening the device.
38
39The following sections describe the various I/O methods in more detail.
40
41
42.. toctree::
43 :maxdepth: 1
44
45 rw
46 mmap
47 userp
48 dmabuf
49 async
50 buffer
51 field-order
diff --git a/Documentation/media/uapi/v4l/libv4l-introduction.rst b/Documentation/media/uapi/v4l/libv4l-introduction.rst
new file mode 100644
index 000000000000..61d085f9f105
--- /dev/null
+++ b/Documentation/media/uapi/v4l/libv4l-introduction.rst
@@ -0,0 +1,169 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _libv4l-introduction:
4
5************
6Introduction
7************
8
9libv4l is a collection of libraries which adds a thin abstraction layer
10on top of video4linux2 devices. The purpose of this (thin) layer is to
11make it easy for application writers to support a wide variety of
12devices without having to write separate code for different devices in
13the same class.
14
15An example of using libv4l is provided by
16:ref:`v4l2grab <v4l2grab-example>`.
17
18libv4l consists of 3 different libraries:
19
20
21libv4lconvert
22=============
23
24libv4lconvert is a library that converts several different pixelformats
25found in V4L2 drivers into a few common RGB and YUY formats.
26
27It currently accepts the following V4L2 driver formats:
28:ref:`V4L2_PIX_FMT_BGR24 <V4L2-PIX-FMT-BGR24>`,
29:ref:`V4L2_PIX_FMT_HM12 <V4L2-PIX-FMT-HM12>`,
30:ref:`V4L2_PIX_FMT_JPEG <V4L2-PIX-FMT-JPEG>`,
31:ref:`V4L2_PIX_FMT_MJPEG <V4L2-PIX-FMT-MJPEG>`,
32:ref:`V4L2_PIX_FMT_MR97310A <V4L2-PIX-FMT-MR97310A>`,
33:ref:`V4L2_PIX_FMT_OV511 <V4L2-PIX-FMT-OV511>`,
34:ref:`V4L2_PIX_FMT_OV518 <V4L2-PIX-FMT-OV518>`,
35:ref:`V4L2_PIX_FMT_PAC207 <V4L2-PIX-FMT-PAC207>`,
36:ref:`V4L2_PIX_FMT_PJPG <V4L2-PIX-FMT-PJPG>`,
37:ref:`V4L2_PIX_FMT_RGB24 <V4L2-PIX-FMT-RGB24>`,
38:ref:`V4L2_PIX_FMT_SBGGR8 <V4L2-PIX-FMT-SBGGR8>`,
39:ref:`V4L2_PIX_FMT_SGBRG8 <V4L2-PIX-FMT-SGBRG8>`,
40:ref:`V4L2_PIX_FMT_SGRBG8 <V4L2-PIX-FMT-SGRBG8>`,
41:ref:`V4L2_PIX_FMT_SN9C10X <V4L2-PIX-FMT-SN9C10X>`,
42:ref:`V4L2_PIX_FMT_SN9C20X_I420 <V4L2-PIX-FMT-SN9C20X-I420>`,
43:ref:`V4L2_PIX_FMT_SPCA501 <V4L2-PIX-FMT-SPCA501>`,
44:ref:`V4L2_PIX_FMT_SPCA505 <V4L2-PIX-FMT-SPCA505>`,
45:ref:`V4L2_PIX_FMT_SPCA508 <V4L2-PIX-FMT-SPCA508>`,
46:ref:`V4L2_PIX_FMT_SPCA561 <V4L2-PIX-FMT-SPCA561>`,
47:ref:`V4L2_PIX_FMT_SQ905C <V4L2-PIX-FMT-SQ905C>`,
48:ref:`V4L2_PIX_FMT_SRGGB8 <V4L2-PIX-FMT-SRGGB8>`,
49:ref:`V4L2_PIX_FMT_UYVY <V4L2-PIX-FMT-UYVY>`,
50:ref:`V4L2_PIX_FMT_YUV420 <V4L2-PIX-FMT-YUV420>`,
51:ref:`V4L2_PIX_FMT_YUYV <V4L2-PIX-FMT-YUYV>`,
52:ref:`V4L2_PIX_FMT_YVU420 <V4L2-PIX-FMT-YVU420>`, and
53:ref:`V4L2_PIX_FMT_YVYU <V4L2-PIX-FMT-YVYU>`.
54
55Later on libv4lconvert was expanded to also be able to do various video
56processing functions to improve webcam video quality. The video
57processing is split in to 2 parts: libv4lconvert/control and
58libv4lconvert/processing.
59
60The control part is used to offer video controls which can be used to
61control the video processing functions made available by
62libv4lconvert/processing. These controls are stored application wide
63(until reboot) by using a persistent shared memory object.
64
65libv4lconvert/processing offers the actual video processing
66functionality.
67
68
69libv4l1
70=======
71
72This library offers functions that can be used to quickly make v4l1
73applications work with v4l2 devices. These functions work exactly like
74the normal open/close/etc, except that libv4l1 does full emulation of
75the v4l1 api on top of v4l2 drivers, in case of v4l1 drivers it will
76just pass calls through.
77
78Since those functions are emulations of the old V4L1 API, it shouldn't
79be used for new applications.
80
81
82libv4l2
83=======
84
85This library should be used for all modern V4L2 applications.
86
87It provides handles to call V4L2 open/ioctl/close/poll methods. Instead
88of just providing the raw output of the device, it enhances the calls in
89the sense that it will use libv4lconvert to provide more video formats
90and to enhance the image quality.
91
92In most cases, libv4l2 just passes the calls directly through to the
93v4l2 driver, intercepting the calls to
94:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`,
95:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`,
96:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`,
97:ref:`VIDIOC_ENUM_FRAMESIZES <VIDIOC_ENUM_FRAMESIZES>` and
98:ref:`VIDIOC_ENUM_FRAMEINTERVALS <VIDIOC_ENUM_FRAMEINTERVALS>` in
99order to emulate the formats
100:ref:`V4L2_PIX_FMT_BGR24 <V4L2-PIX-FMT-BGR24>`,
101:ref:`V4L2_PIX_FMT_RGB24 <V4L2-PIX-FMT-RGB24>`,
102:ref:`V4L2_PIX_FMT_YUV420 <V4L2-PIX-FMT-YUV420>`, and
103:ref:`V4L2_PIX_FMT_YVU420 <V4L2-PIX-FMT-YVU420>`, if they aren't
104available in the driver. :ref:`VIDIOC_ENUM_FMT <VIDIOC_ENUM_FMT>`
105keeps enumerating the hardware supported formats, plus the emulated
106formats offered by libv4l at the end.
107
108
109.. _libv4l-ops:
110
111Libv4l device control functions
112-------------------------------
113
114The common file operation methods are provided by libv4l.
115
116Those functions operate just like glibc
117open/close/dup/ioctl/read/mmap/munmap:
118
119- :c:type:`int v4l2_open(const char *file, int oflag, ...)` - operates like the
120 standard :ref:`open() <func-open>` function.
121
122- :c:type:`int v4l2_close(int fd)` - operates like the standard
123 :ref:`close() <func-close>` function.
124
125- :c:type:`int v4l2_dup(int fd)` - operates like the standard dup() function,
126 duplicating a file handler.
127
128- :c:type:`int v4l2_ioctl (int fd, unsigned long int request, ...)` - operates
129 like the standard :ref:`ioctl() <func-ioctl>` function.
130
131- :c:type:`int v4l2_read (int fd, void* buffer, size_t n)` - operates like the
132 standard :ref:`read() <func-read>` function.
133
134- :c:type:`void v4l2_mmap(void *start, size_t length, int prot, int flags, int
135 fd, int64_t offset);` - operates like the standard
136 :ref:`mmap() <func-mmap>` function.
137
138- :c:type:`int v4l2_munmap(void *_start, size_t length);` - operates like the
139 standard :ref:`munmap() <func-munmap>` function.
140
141Those functions provide additional control:
142
143- :c:type:`int v4l2_fd_open(int fd, int v4l2_flags)` - opens an already opened
144 fd for further use through v4l2lib and possibly modify libv4l2's
145 default behavior through the v4l2_flags argument. Currently,
146 v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable format
147 conversion.
148
149- :c:type:`int v4l2_set_control(int fd, int cid, int value)` - This function
150 takes a value of 0 - 65535, and then scales that range to the actual
151 range of the given v4l control id, and then if the cid exists and is
152 not locked sets the cid to the scaled value.
153
154- :c:type:`int v4l2_get_control(int fd, int cid)` - This function returns a
155 value of 0 - 65535, scaled to from the actual range of the given v4l
156 control id. when the cid does not exist, could not be accessed for
157 some reason, or some error occurred 0 is returned.
158
159
160v4l1compat.so wrapper library
161=============================
162
163This library intercepts calls to open/close/ioctl/mmap/mmunmap
164operations and redirects them to the libv4l counterparts, by using
165LD_PRELOAD=/usr/lib/v4l1compat.so. It also emulates V4L1 calls via V4L2
166API.
167
168It allows usage of binary legacy applications that still don't use
169libv4l.
diff --git a/Documentation/media/uapi/v4l/libv4l.rst b/Documentation/media/uapi/v4l/libv4l.rst
new file mode 100644
index 000000000000..332c1d42688b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/libv4l.rst
@@ -0,0 +1,13 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _libv4l:
4
5************************
6Libv4l Userspace Library
7************************
8
9
10.. toctree::
11 :maxdepth: 1
12
13 libv4l-introduction
diff --git a/Documentation/media/uapi/v4l/mmap.rst b/Documentation/media/uapi/v4l/mmap.rst
new file mode 100644
index 000000000000..7ad5d5e76163
--- /dev/null
+++ b/Documentation/media/uapi/v4l/mmap.rst
@@ -0,0 +1,285 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _mmap:
4
5******************************
6Streaming I/O (Memory Mapping)
7******************************
8
9Input and output devices support this I/O method when the
10``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
11:ref:`v4l2_capability <v4l2-capability>` returned by the
12:ref:`VIDIOC_QUERYCAP` ioctl is set. There are two
13streaming methods, to determine if the memory mapping flavor is
14supported applications must call the :ref:`VIDIOC_REQBUFS` ioctl
15with the memory type set to ``V4L2_MEMORY_MMAP``.
16
17Streaming is an I/O method where only pointers to buffers are exchanged
18between application and driver, the data itself is not copied. Memory
19mapping is primarily intended to map buffers in device memory into the
20application's address space. Device memory can be for example the video
21memory on a graphics card with a video capture add-on. However, being
22the most efficient I/O method available for a long time, many other
23drivers support streaming as well, allocating buffers in DMA-able main
24memory.
25
26A driver can support many sets of buffers. Each set is identified by a
27unique buffer type value. The sets are independent and each set can hold
28a different type of data. To access different sets at the same time
29different file descriptors must be used. [#f1]_
30
31To allocate device buffers applications call the
32:ref:`VIDIOC_REQBUFS` ioctl with the desired number
33of buffers and buffer type, for example ``V4L2_BUF_TYPE_VIDEO_CAPTURE``.
34This ioctl can also be used to change the number of buffers or to free
35the allocated memory, provided none of the buffers are still mapped.
36
37Before applications can access the buffers they must map them into their
38address space with the :ref:`mmap() <func-mmap>` function. The
39location of the buffers in device memory can be determined with the
40:ref:`VIDIOC_QUERYBUF` ioctl. In the single-planar
41API case, the ``m.offset`` and ``length`` returned in a struct
42:ref:`v4l2_buffer <v4l2-buffer>` are passed as sixth and second
43parameter to the :ref:`mmap() <func-mmap>` function. When using the
44multi-planar API, struct :ref:`v4l2_buffer <v4l2-buffer>` contains an
45array of struct :ref:`v4l2_plane <v4l2-plane>` structures, each
46containing its own ``m.offset`` and ``length``. When using the
47multi-planar API, every plane of every buffer has to be mapped
48separately, so the number of calls to :ref:`mmap() <func-mmap>` should
49be equal to number of buffers times number of planes in each buffer. The
50offset and length values must not be modified. Remember, the buffers are
51allocated in physical memory, as opposed to virtual memory, which can be
52swapped out to disk. Applications should free the buffers as soon as
53possible with the :ref:`munmap() <func-munmap>` function.
54
55Example: Mapping buffers in the single-planar API
56=================================================
57
58.. code-block:: c
59
60 struct v4l2_requestbuffers reqbuf;
61 struct {
62 void *start;
63 size_t length;
64 } *buffers;
65 unsigned int i;
66
67 memset(&reqbuf, 0, sizeof(reqbuf));
68 reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
69 reqbuf.memory = V4L2_MEMORY_MMAP;
70 reqbuf.count = 20;
71
72 if (-1 == ioctl (fd, VIDIOC_REQBUFS, &reqbuf)) {
73 if (errno == EINVAL)
74 printf("Video capturing or mmap-streaming is not supported\\n");
75 else
76 perror("VIDIOC_REQBUFS");
77
78 exit(EXIT_FAILURE);
79 }
80
81 /* We want at least five buffers. */
82
83 if (reqbuf.count < 5) {
84 /* You may need to free the buffers here. */
85 printf("Not enough buffer memory\\n");
86 exit(EXIT_FAILURE);
87 }
88
89 buffers = calloc(reqbuf.count, sizeof(*buffers));
90 assert(buffers != NULL);
91
92 for (i = 0; i < reqbuf.count; i++) {
93 struct v4l2_buffer buffer;
94
95 memset(&buffer, 0, sizeof(buffer));
96 buffer.type = reqbuf.type;
97 buffer.memory = V4L2_MEMORY_MMAP;
98 buffer.index = i;
99
100 if (-1 == ioctl (fd, VIDIOC_QUERYBUF, &buffer)) {
101 perror("VIDIOC_QUERYBUF");
102 exit(EXIT_FAILURE);
103 }
104
105 buffers[i].length = buffer.length; /* remember for munmap() */
106
107 buffers[i].start = mmap(NULL, buffer.length,
108 PROT_READ | PROT_WRITE, /* recommended */
109 MAP_SHARED, /* recommended */
110 fd, buffer.m.offset);
111
112 if (MAP_FAILED == buffers[i].start) {
113 /* If you do not exit here you should unmap() and free()
114 the buffers mapped so far. */
115 perror("mmap");
116 exit(EXIT_FAILURE);
117 }
118 }
119
120 /* Cleanup. */
121
122 for (i = 0; i < reqbuf.count; i++)
123 munmap(buffers[i].start, buffers[i].length);
124
125
126Example: Mapping buffers in the multi-planar API
127================================================
128
129.. code-block:: c
130
131 struct v4l2_requestbuffers reqbuf;
132 /* Our current format uses 3 planes per buffer */
133 #define FMT_NUM_PLANES = 3
134
135 struct {
136 void *start[FMT_NUM_PLANES];
137 size_t length[FMT_NUM_PLANES];
138 } *buffers;
139 unsigned int i, j;
140
141 memset(&reqbuf, 0, sizeof(reqbuf));
142 reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
143 reqbuf.memory = V4L2_MEMORY_MMAP;
144 reqbuf.count = 20;
145
146 if (ioctl(fd, VIDIOC_REQBUFS, &reqbuf) < 0) {
147 if (errno == EINVAL)
148 printf("Video capturing or mmap-streaming is not supported\\n");
149 else
150 perror("VIDIOC_REQBUFS");
151
152 exit(EXIT_FAILURE);
153 }
154
155 /* We want at least five buffers. */
156
157 if (reqbuf.count < 5) {
158 /* You may need to free the buffers here. */
159 printf("Not enough buffer memory\\n");
160 exit(EXIT_FAILURE);
161 }
162
163 buffers = calloc(reqbuf.count, sizeof(*buffers));
164 assert(buffers != NULL);
165
166 for (i = 0; i < reqbuf.count; i++) {
167 struct v4l2_buffer buffer;
168 struct v4l2_plane planes[FMT_NUM_PLANES];
169
170 memset(&buffer, 0, sizeof(buffer));
171 buffer.type = reqbuf.type;
172 buffer.memory = V4L2_MEMORY_MMAP;
173 buffer.index = i;
174 /* length in struct v4l2_buffer in multi-planar API stores the size
175 * of planes array. */
176 buffer.length = FMT_NUM_PLANES;
177 buffer.m.planes = planes;
178
179 if (ioctl(fd, VIDIOC_QUERYBUF, &buffer) < 0) {
180 perror("VIDIOC_QUERYBUF");
181 exit(EXIT_FAILURE);
182 }
183
184 /* Every plane has to be mapped separately */
185 for (j = 0; j < FMT_NUM_PLANES; j++) {
186 buffers[i].length[j] = buffer.m.planes[j].length; /* remember for munmap() */
187
188 buffers[i].start[j] = mmap(NULL, buffer.m.planes[j].length,
189 PROT_READ | PROT_WRITE, /* recommended */
190 MAP_SHARED, /* recommended */
191 fd, buffer.m.planes[j].m.offset);
192
193 if (MAP_FAILED == buffers[i].start[j]) {
194 /* If you do not exit here you should unmap() and free()
195 the buffers and planes mapped so far. */
196 perror("mmap");
197 exit(EXIT_FAILURE);
198 }
199 }
200 }
201
202 /* Cleanup. */
203
204 for (i = 0; i < reqbuf.count; i++)
205 for (j = 0; j < FMT_NUM_PLANES; j++)
206 munmap(buffers[i].start[j], buffers[i].length[j]);
207
208Conceptually streaming drivers maintain two buffer queues, an incoming
209and an outgoing queue. They separate the synchronous capture or output
210operation locked to a video clock from the application which is subject
211to random disk or network delays and preemption by other processes,
212thereby reducing the probability of data loss. The queues are organized
213as FIFOs, buffers will be output in the order enqueued in the incoming
214FIFO, and were captured in the order dequeued from the outgoing FIFO.
215
216The driver may require a minimum number of buffers enqueued at all times
217to function, apart of this no limit exists on the number of buffers
218applications can enqueue in advance, or dequeue and process. They can
219also enqueue in a different order than buffers have been dequeued, and
220the driver can *fill* enqueued *empty* buffers in any order. [#f2]_ The
221index number of a buffer (struct :ref:`v4l2_buffer <v4l2-buffer>`
222``index``) plays no role here, it only identifies the buffer.
223
224Initially all mapped buffers are in dequeued state, inaccessible by the
225driver. For capturing applications it is customary to first enqueue all
226mapped buffers, then to start capturing and enter the read loop. Here
227the application waits until a filled buffer can be dequeued, and
228re-enqueues the buffer when the data is no longer needed. Output
229applications fill and enqueue buffers, when enough buffers are stacked
230up the output is started with :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`.
231In the write loop, when the application runs out of free buffers, it
232must wait until an empty buffer can be dequeued and reused.
233
234To enqueue and dequeue a buffer applications use the :ref:`VIDIOC_QBUF`
235and :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. The status of a buffer
236being mapped, enqueued, full or empty can be determined at any time
237using the :ref:`VIDIOC_QUERYBUF` ioctl. Two methods exist to suspend
238execution of the application until one or more buffers can be dequeued.
239By default :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` blocks when no buffer is
240in the outgoing queue. When the ``O_NONBLOCK`` flag was given to the
241:ref:`open() <func-open>` function, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`
242returns immediately with an ``EAGAIN`` error code when no buffer is
243available. The :ref:`select() <func-select>` or :ref:`poll()
244<func-poll>` functions are always available.
245
246To start and stop capturing or output applications call the
247:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMOFF
248<VIDIOC_STREAMON>` ioctl.
249
250.. note:::ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
251 removes all buffers from both queues as a side effect. Since there is
252 no notion of doing anything "now" on a multitasking system, if an
253 application needs to synchronize with another event it should examine
254 the struct ::ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured
255 or outputted buffers.
256
257Drivers implementing memory mapping I/O must support the
258:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QUERYBUF
259<VIDIOC_QUERYBUF>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF
260<VIDIOC_QBUF>`, :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
261and :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls, the :ref:`mmap()
262<func-mmap>`, :ref:`munmap() <func-munmap>`, :ref:`select()
263<func-select>` and :ref:`poll() <func-poll>` function. [#f3]_
264
265[capture example]
266
267.. [#f1]
268 One could use one file descriptor and set the buffer type field
269 accordingly when calling :ref:`VIDIOC_QBUF` etc.,
270 but it makes the :ref:`select() <func-select>` function ambiguous. We also
271 like the clean approach of one file descriptor per logical stream.
272 Video overlay for example is also a logical stream, although the CPU
273 is not needed for continuous operation.
274
275.. [#f2]
276 Random enqueue order permits applications processing images out of
277 order (such as video codecs) to return buffers earlier, reducing the
278 probability of data loss. Random fill order allows drivers to reuse
279 buffers on a LIFO-basis, taking advantage of caches holding
280 scatter-gather lists and the like.
281
282.. [#f3]
283 At the driver level :ref:`select() <func-select>` and :ref:`poll() <func-poll>` are
284 the same, and :ref:`select() <func-select>` is too important to be optional.
285 The rest should be evident.
diff --git a/Documentation/media/uapi/v4l/open.rst b/Documentation/media/uapi/v4l/open.rst
new file mode 100644
index 000000000000..afd116edb40d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/open.rst
@@ -0,0 +1,158 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _open:
4
5***************************
6Opening and Closing Devices
7***************************
8
9
10Device Naming
11=============
12
13V4L2 drivers are implemented as kernel modules, loaded manually by the
14system administrator or automatically when a device is first discovered.
15The driver modules plug into the "videodev" kernel module. It provides
16helper functions and a common application interface specified in this
17document.
18
19Each driver thus loaded registers one or more device nodes with major
20number 81 and a minor number between 0 and 255. Minor numbers are
21allocated dynamically unless the kernel is compiled with the kernel
22option CONFIG_VIDEO_FIXED_MINOR_RANGES. In that case minor numbers
23are allocated in ranges depending on the device node type (video, radio,
24etc.).
25
26Many drivers support "video_nr", "radio_nr" or "vbi_nr" module
27options to select specific video/radio/vbi node numbers. This allows the
28user to request that the device node is named e.g. /dev/video5 instead
29of leaving it to chance. When the driver supports multiple devices of
30the same type more than one device node number can be assigned,
31separated by commas:
32
33.. code-block:: none
34
35 # modprobe mydriver video_nr=0,1 radio_nr=0,1
36
37In ``/etc/modules.conf`` this may be written as:
38
39::
40
41 options mydriver video_nr=0,1 radio_nr=0,1
42
43When no device node number is given as module option the driver supplies
44a default.
45
46Normally udev will create the device nodes in /dev automatically for
47you. If udev is not installed, then you need to enable the
48CONFIG_VIDEO_FIXED_MINOR_RANGES kernel option in order to be able to
49correctly relate a minor number to a device node number. I.e., you need
50to be certain that minor number 5 maps to device node name video5. With
51this kernel option different device types have different minor number
52ranges. These ranges are listed in :ref:`devices`.
53
54The creation of character special files (with mknod) is a privileged
55operation and devices cannot be opened by major and minor number. That
56means applications cannot *reliable* scan for loaded or installed
57drivers. The user must enter a device name, or the application can try
58the conventional device names.
59
60
61.. _related:
62
63Related Devices
64===============
65
66Devices can support several functions. For example video capturing, VBI
67capturing and radio support.
68
69The V4L2 API creates different nodes for each of these functions.
70
71The V4L2 API was designed with the idea that one device node could
72support all functions. However, in practice this never worked: this
73'feature' was never used by applications and many drivers did not
74support it and if they did it was certainly never tested. In addition,
75switching a device node between different functions only works when
76using the streaming I/O API, not with the
77:ref:`read() <func-read>`/\ :ref:`write() <func-write>` API.
78
79Today each device node supports just one function.
80
81Besides video input or output the hardware may also support audio
82sampling or playback. If so, these functions are implemented as ALSA PCM
83devices with optional ALSA audio mixer devices.
84
85One problem with all these devices is that the V4L2 API makes no
86provisions to find these related devices. Some really complex devices
87use the Media Controller (see :ref:`media_controller`) which can be
88used for this purpose. But most drivers do not use it, and while some
89code exists that uses sysfs to discover related devices (see
90libmedia_dev in the
91`v4l-utils <http://git.linuxtv.org/cgit.cgi/v4l-utils.git/>`__ git
92repository), there is no library yet that can provide a single API
93towards both Media Controller-based devices and devices that do not use
94the Media Controller. If you want to work on this please write to the
95linux-media mailing list:
96`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
97
98
99Multiple Opens
100==============
101
102V4L2 devices can be opened more than once. [#f1]_ When this is supported
103by the driver, users can for example start a "panel" application to
104change controls like brightness or audio volume, while another
105application captures video and audio. In other words, panel applications
106are comparable to an ALSA audio mixer application. Just opening a V4L2
107device should not change the state of the device. [#f2]_
108
109Once an application has allocated the memory buffers needed for
110streaming data (by calling the :ref:`VIDIOC_REQBUFS`
111or :ref:`VIDIOC_CREATE_BUFS` ioctls, or
112implicitly by calling the :ref:`read() <func-read>` or
113:ref:`write() <func-write>` functions) that application (filehandle)
114becomes the owner of the device. It is no longer allowed to make changes
115that would affect the buffer sizes (e.g. by calling the
116:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl) and other applications are
117no longer allowed to allocate buffers or start or stop streaming. The
118EBUSY error code will be returned instead.
119
120Merely opening a V4L2 device does not grant exclusive access. [#f3]_
121Initiating data exchange however assigns the right to read or write the
122requested type of data, and to change related properties, to this file
123descriptor. Applications can request additional access privileges using
124the priority mechanism described in :ref:`app-pri`.
125
126
127Shared Data Streams
128===================
129
130V4L2 drivers should not support multiple applications reading or writing
131the same data stream on a device by copying buffers, time multiplexing
132or similar means. This is better handled by a proxy application in user
133space.
134
135
136Functions
137=========
138
139To open and close V4L2 devices applications use the
140:ref:`open() <func-open>` and :ref:`close() <func-close>` function,
141respectively. Devices are programmed using the
142:ref:`ioctl() <func-ioctl>` function as explained in the following
143sections.
144
145.. [#f1]
146 There are still some old and obscure drivers that have not been
147 updated to allow for multiple opens. This implies that for such
148 drivers :ref:`open() <func-open>` can return an ``EBUSY`` error code
149 when the device is already in use.
150
151.. [#f2]
152 Unfortunately, opening a radio device often switches the state of the
153 device to radio mode in many drivers. This behavior should be fixed
154 eventually as it violates the V4L2 specification.
155
156.. [#f3]
157 Drivers could recognize the ``O_EXCL`` open flag. Presently this is
158 not required, so applications cannot know if it really works.
diff --git a/Documentation/media/uapi/v4l/pixfmt-002.rst b/Documentation/media/uapi/v4l/pixfmt-002.rst
new file mode 100644
index 000000000000..fae9b2d40a85
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-002.rst
@@ -0,0 +1,196 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3******************************
4Single-planar format structure
5******************************
6
7
8.. _v4l2-pix-format:
9
10.. flat-table:: struct v4l2_pix_format
11 :header-rows: 0
12 :stub-columns: 0
13 :widths: 1 1 2
14
15
16 - .. row 1
17
18 - __u32
19
20 - ``width``
21
22 - Image width in pixels.
23
24 - .. row 2
25
26 - __u32
27
28 - ``height``
29
30 - Image height in pixels. If ``field`` is one of ``V4L2_FIELD_TOP``,
31 ``V4L2_FIELD_BOTTOM`` or ``V4L2_FIELD_ALTERNATE`` then height
32 refers to the number of lines in the field, otherwise it refers to
33 the number of lines in the frame (which is twice the field height
34 for interlaced formats).
35
36 - .. row 3
37
38 - :cspan:`2` Applications set these fields to request an image
39 size, drivers return the closest possible values. In case of
40 planar formats the ``width`` and ``height`` applies to the largest
41 plane. To avoid ambiguities drivers must return values rounded up
42 to a multiple of the scale factor of any smaller planes. For
43 example when the image format is YUV 4:2:0, ``width`` and
44 ``height`` must be multiples of two.
45
46 - .. row 4
47
48 - __u32
49
50 - ``pixelformat``
51
52 - The pixel format or type of compression, set by the application.
53 This is a little endian
54 :ref:`four character code <v4l2-fourcc>`. V4L2 defines standard
55 RGB formats in :ref:`rgb-formats`, YUV formats in
56 :ref:`yuv-formats`, and reserved codes in
57 :ref:`reserved-formats`
58
59 - .. row 5
60
61 - enum :ref:`v4l2_field <v4l2-field>`
62
63 - ``field``
64
65 - Video images are typically interlaced. Applications can request to
66 capture or output only the top or bottom field, or both fields
67 interlaced or sequentially stored in one buffer or alternating in
68 separate buffers. Drivers return the actual field order selected.
69 For more details on fields see :ref:`field-order`.
70
71 - .. row 6
72
73 - __u32
74
75 - ``bytesperline``
76
77 - Distance in bytes between the leftmost pixels in two adjacent
78 lines.
79
80 - .. row 7
81
82 - :cspan:`2`
83
84 Both applications and drivers can set this field to request
85 padding bytes at the end of each line. Drivers however may ignore
86 the value requested by the application, returning ``width`` times
87 bytes per pixel or a larger value required by the hardware. That
88 implies applications can just set this field to zero to get a
89 reasonable default.
90
91 Video hardware may access padding bytes, therefore they must
92 reside in accessible memory. Consider cases where padding bytes
93 after the last line of an image cross a system page boundary.
94 Input devices may write padding bytes, the value is undefined.
95 Output devices ignore the contents of padding bytes.
96
97 When the image format is planar the ``bytesperline`` value applies
98 to the first plane and is divided by the same factor as the
99 ``width`` field for the other planes. For example the Cb and Cr
100 planes of a YUV 4:2:0 image have half as many padding bytes
101 following each line as the Y plane. To avoid ambiguities drivers
102 must return a ``bytesperline`` value rounded up to a multiple of
103 the scale factor.
104
105 For compressed formats the ``bytesperline`` value makes no sense.
106 Applications and drivers must set this to 0 in that case.
107
108 - .. row 8
109
110 - __u32
111
112 - ``sizeimage``
113
114 - Size in bytes of the buffer to hold a complete image, set by the
115 driver. Usually this is ``bytesperline`` times ``height``. When
116 the image consists of variable length compressed data this is the
117 maximum number of bytes required to hold an image.
118
119 - .. row 9
120
121 - enum :ref:`v4l2_colorspace <v4l2-colorspace>`
122
123 - ``colorspace``
124
125 - This information supplements the ``pixelformat`` and must be set
126 by the driver for capture streams and by the application for
127 output streams, see :ref:`colorspaces`.
128
129 - .. row 10
130
131 - __u32
132
133 - ``priv``
134
135 - This field indicates whether the remaining fields of the
136 :ref:`struct v4l2_pix_format <v4l2-pix-format>` structure, also called the
137 extended fields, are valid. When set to
138 ``V4L2_PIX_FMT_PRIV_MAGIC``, it indicates that the extended fields
139 have been correctly initialized. When set to any other value it
140 indicates that the extended fields contain undefined values.
141
142 Applications that wish to use the pixel format extended fields
143 must first ensure that the feature is supported by querying the
144 device for the :ref:`V4L2_CAP_EXT_PIX_FORMAT <querycap>`
145 capability. If the capability isn't set the pixel format extended
146 fields are not supported and using the extended fields will lead
147 to undefined results.
148
149 To use the extended fields, applications must set the ``priv``
150 field to ``V4L2_PIX_FMT_PRIV_MAGIC``, initialize all the extended
151 fields and zero the unused bytes of the
152 :ref:`struct v4l2_format <v4l2-format>` ``raw_data`` field.
153
154 When the ``priv`` field isn't set to ``V4L2_PIX_FMT_PRIV_MAGIC``
155 drivers must act as if all the extended fields were set to zero.
156 On return drivers must set the ``priv`` field to
157 ``V4L2_PIX_FMT_PRIV_MAGIC`` and all the extended fields to
158 applicable values.
159
160 - .. row 11
161
162 - __u32
163
164 - ``flags``
165
166 - Flags set by the application or driver, see :ref:`format-flags`.
167
168 - .. row 12
169
170 - enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
171
172 - ``ycbcr_enc``
173
174 - This information supplements the ``colorspace`` and must be set by
175 the driver for capture streams and by the application for output
176 streams, see :ref:`colorspaces`.
177
178 - .. row 13
179
180 - enum :ref:`v4l2_quantization <v4l2-quantization>`
181
182 - ``quantization``
183
184 - This information supplements the ``colorspace`` and must be set by
185 the driver for capture streams and by the application for output
186 streams, see :ref:`colorspaces`.
187
188 - .. row 14
189
190 - enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
191
192 - ``xfer_func``
193
194 - This information supplements the ``colorspace`` and must be set by
195 the driver for capture streams and by the application for output
196 streams, see :ref:`colorspaces`.
diff --git a/Documentation/media/uapi/v4l/pixfmt-003.rst b/Documentation/media/uapi/v4l/pixfmt-003.rst
new file mode 100644
index 000000000000..25c54872fbe1
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-003.rst
@@ -0,0 +1,166 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3******************************
4Multi-planar format structures
5******************************
6
7The :ref:`struct v4l2_plane_pix_format <v4l2-plane-pix-format>` structures define size
8and layout for each of the planes in a multi-planar format. The
9:ref:`struct v4l2_pix_format_mplane <v4l2-pix-format-mplane>` structure contains
10information common to all planes (such as image width and height) and an
11array of :ref:`struct v4l2_plane_pix_format <v4l2-plane-pix-format>` structures,
12describing all planes of that format.
13
14
15.. _v4l2-plane-pix-format:
16
17.. flat-table:: struct v4l2_plane_pix_format
18 :header-rows: 0
19 :stub-columns: 0
20 :widths: 1 1 2
21
22
23 - .. row 1
24
25 - __u32
26
27 - ``sizeimage``
28
29 - Maximum size in bytes required for image data in this plane.
30
31 - .. row 2
32
33 - __u32
34
35 - ``bytesperline``
36
37 - Distance in bytes between the leftmost pixels in two adjacent
38 lines. See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
39
40 - .. row 3
41
42 - __u16
43
44 - ``reserved[6]``
45
46 - Reserved for future extensions. Should be zeroed by drivers and
47 applications.
48
49
50
51.. _v4l2-pix-format-mplane:
52
53.. flat-table:: struct v4l2_pix_format_mplane
54 :header-rows: 0
55 :stub-columns: 0
56 :widths: 1 1 2
57
58
59 - .. row 1
60
61 - __u32
62
63 - ``width``
64
65 - Image width in pixels. See struct
66 :ref:`v4l2_pix_format <v4l2-pix-format>`.
67
68 - .. row 2
69
70 - __u32
71
72 - ``height``
73
74 - Image height in pixels. See struct
75 :ref:`v4l2_pix_format <v4l2-pix-format>`.
76
77 - .. row 3
78
79 - __u32
80
81 - ``pixelformat``
82
83 - The pixel format. Both single- and multi-planar four character
84 codes can be used.
85
86 - .. row 4
87
88 - enum :ref:`v4l2_field <v4l2-field>`
89
90 - ``field``
91
92 - See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
93
94 - .. row 5
95
96 - enum :ref:`v4l2_colorspace <v4l2-colorspace>`
97
98 - ``colorspace``
99
100 - See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
101
102 - .. row 6
103
104 - struct :ref:`v4l2_plane_pix_format <v4l2-plane-pix-format>`
105
106 - ``plane_fmt[VIDEO_MAX_PLANES]``
107
108 - An array of structures describing format of each plane this pixel
109 format consists of. The number of valid entries in this array has
110 to be put in the ``num_planes`` field.
111
112 - .. row 7
113
114 - __u8
115
116 - ``num_planes``
117
118 - Number of planes (i.e. separate memory buffers) for this format
119 and the number of valid entries in the ``plane_fmt`` array.
120
121 - .. row 8
122
123 - __u8
124
125 - ``flags``
126
127 - Flags set by the application or driver, see :ref:`format-flags`.
128
129 - .. row 9
130
131 - enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
132
133 - ``ycbcr_enc``
134
135 - This information supplements the ``colorspace`` and must be set by
136 the driver for capture streams and by the application for output
137 streams, see :ref:`colorspaces`.
138
139 - .. row 10
140
141 - enum :ref:`v4l2_quantization <v4l2-quantization>`
142
143 - ``quantization``
144
145 - This information supplements the ``colorspace`` and must be set by
146 the driver for capture streams and by the application for output
147 streams, see :ref:`colorspaces`.
148
149 - .. row 11
150
151 - enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
152
153 - ``xfer_func``
154
155 - This information supplements the ``colorspace`` and must be set by
156 the driver for capture streams and by the application for output
157 streams, see :ref:`colorspaces`.
158
159 - .. row 12
160
161 - __u8
162
163 - ``reserved[7]``
164
165 - Reserved for future extensions. Should be zeroed by drivers and
166 applications.
diff --git a/Documentation/media/uapi/v4l/pixfmt-004.rst b/Documentation/media/uapi/v4l/pixfmt-004.rst
new file mode 100644
index 000000000000..4bc116aa8193
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-004.rst
@@ -0,0 +1,51 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3**********************
4Standard Image Formats
5**********************
6
7In order to exchange images between drivers and applications, it is
8necessary to have standard image data formats which both sides will
9interpret the same way. V4L2 includes several such formats, and this
10section is intended to be an unambiguous specification of the standard
11image data formats in V4L2.
12
13V4L2 drivers are not limited to these formats, however. Driver-specific
14formats are possible. In that case the application may depend on a codec
15to convert images to one of the standard formats when needed. But the
16data can still be stored and retrieved in the proprietary format. For
17example, a device may support a proprietary compressed format.
18Applications can still capture and save the data in the compressed
19format, saving much disk space, and later use a codec to convert the
20images to the X Windows screen format when the video is to be displayed.
21
22Even so, ultimately, some standard formats are needed, so the V4L2
23specification would not be complete without well-defined standard
24formats.
25
26The V4L2 standard formats are mainly uncompressed formats. The pixels
27are always arranged in memory from left to right, and from top to
28bottom. The first byte of data in the image buffer is always for the
29leftmost pixel of the topmost row. Following that is the pixel
30immediately to its right, and so on until the end of the top row of
31pixels. Following the rightmost pixel of the row there may be zero or
32more bytes of padding to guarantee that each row of pixel data has a
33certain alignment. Following the pad bytes, if any, is data for the
34leftmost pixel of the second row from the top, and so on. The last row
35has just as many pad bytes after it as the other rows.
36
37In V4L2 each format has an identifier which looks like ``PIX_FMT_XXX``,
38defined in the :ref:`videodev2.h <videodev>` header file. These
39identifiers represent
40:ref:`four character (FourCC) codes <v4l2-fourcc>` which are also
41listed below, however they are not the same as those used in the Windows
42world.
43
44For some formats, data is stored in separate, discontiguous memory
45buffers. Those formats are identified by a separate set of FourCC codes
46and are referred to as "multi-planar formats". For example, a
47:ref:`YUV422 <V4L2-PIX-FMT-YUV422M>` frame is normally stored in one
48memory buffer, but it can also be placed in two or three separate
49buffers, with Y component in one buffer and CbCr components in another
50in the 2-planar version or with each component in its own buffer in the
513-planar case. Those sub-buffers are referred to as "*planes*".
diff --git a/Documentation/media/uapi/v4l/pixfmt-006.rst b/Documentation/media/uapi/v4l/pixfmt-006.rst
new file mode 100644
index 000000000000..987b9a8a9eb4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-006.rst
@@ -0,0 +1,288 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3****************************
4Defining Colorspaces in V4L2
5****************************
6
7In V4L2 colorspaces are defined by four values. The first is the
8colorspace identifier (enum :ref:`v4l2_colorspace <v4l2-colorspace>`)
9which defines the chromaticities, the default transfer function, the
10default Y'CbCr encoding and the default quantization method. The second
11is the transfer function identifier (enum
12:ref:`v4l2_xfer_func <v4l2-xfer-func>`) to specify non-standard
13transfer functions. The third is the Y'CbCr encoding identifier (enum
14:ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`) to specify
15non-standard Y'CbCr encodings and the fourth is the quantization
16identifier (enum :ref:`v4l2_quantization <v4l2-quantization>`) to
17specify non-standard quantization methods. Most of the time only the
18colorspace field of struct :ref:`v4l2_pix_format <v4l2-pix-format>`
19or struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>`
20needs to be filled in.
21
22.. note:: The default R'G'B' quantization is full range for all
23 colorspaces except for BT.2020 which uses limited range R'G'B'
24 quantization.
25
26
27.. _v4l2-colorspace:
28
29.. flat-table:: V4L2 Colorspaces
30 :header-rows: 1
31 :stub-columns: 0
32
33
34 - .. row 1
35
36 - Identifier
37
38 - Details
39
40 - .. row 2
41
42 - ``V4L2_COLORSPACE_DEFAULT``
43
44 - The default colorspace. This can be used by applications to let
45 the driver fill in the colorspace.
46
47 - .. row 3
48
49 - ``V4L2_COLORSPACE_SMPTE170M``
50
51 - See :ref:`col-smpte-170m`.
52
53 - .. row 4
54
55 - ``V4L2_COLORSPACE_REC709``
56
57 - See :ref:`col-rec709`.
58
59 - .. row 5
60
61 - ``V4L2_COLORSPACE_SRGB``
62
63 - See :ref:`col-srgb`.
64
65 - .. row 6
66
67 - ``V4L2_COLORSPACE_ADOBERGB``
68
69 - See :ref:`col-adobergb`.
70
71 - .. row 7
72
73 - ``V4L2_COLORSPACE_BT2020``
74
75 - See :ref:`col-bt2020`.
76
77 - .. row 8
78
79 - ``V4L2_COLORSPACE_DCI_P3``
80
81 - See :ref:`col-dcip3`.
82
83 - .. row 9
84
85 - ``V4L2_COLORSPACE_SMPTE240M``
86
87 - See :ref:`col-smpte-240m`.
88
89 - .. row 10
90
91 - ``V4L2_COLORSPACE_470_SYSTEM_M``
92
93 - See :ref:`col-sysm`.
94
95 - .. row 11
96
97 - ``V4L2_COLORSPACE_470_SYSTEM_BG``
98
99 - See :ref:`col-sysbg`.
100
101 - .. row 12
102
103 - ``V4L2_COLORSPACE_JPEG``
104
105 - See :ref:`col-jpeg`.
106
107 - .. row 13
108
109 - ``V4L2_COLORSPACE_RAW``
110
111 - The raw colorspace. This is used for raw image capture where the
112 image is minimally processed and is using the internal colorspace
113 of the device. The software that processes an image using this
114 'colorspace' will have to know the internals of the capture
115 device.
116
117
118
119.. _v4l2-xfer-func:
120
121.. flat-table:: V4L2 Transfer Function
122 :header-rows: 1
123 :stub-columns: 0
124
125
126 - .. row 1
127
128 - Identifier
129
130 - Details
131
132 - .. row 2
133
134 - ``V4L2_XFER_FUNC_DEFAULT``
135
136 - Use the default transfer function as defined by the colorspace.
137
138 - .. row 3
139
140 - ``V4L2_XFER_FUNC_709``
141
142 - Use the Rec. 709 transfer function.
143
144 - .. row 4
145
146 - ``V4L2_XFER_FUNC_SRGB``
147
148 - Use the sRGB transfer function.
149
150 - .. row 5
151
152 - ``V4L2_XFER_FUNC_ADOBERGB``
153
154 - Use the AdobeRGB transfer function.
155
156 - .. row 6
157
158 - ``V4L2_XFER_FUNC_SMPTE240M``
159
160 - Use the SMPTE 240M transfer function.
161
162 - .. row 7
163
164 - ``V4L2_XFER_FUNC_NONE``
165
166 - Do not use a transfer function (i.e. use linear RGB values).
167
168 - .. row 8
169
170 - ``V4L2_XFER_FUNC_DCI_P3``
171
172 - Use the DCI-P3 transfer function.
173
174 - .. row 9
175
176 - ``V4L2_XFER_FUNC_SMPTE2084``
177
178 - Use the SMPTE 2084 transfer function.
179
180
181
182.. _v4l2-ycbcr-encoding:
183
184.. flat-table:: V4L2 Y'CbCr Encodings
185 :header-rows: 1
186 :stub-columns: 0
187
188
189 - .. row 1
190
191 - Identifier
192
193 - Details
194
195 - .. row 2
196
197 - ``V4L2_YCBCR_ENC_DEFAULT``
198
199 - Use the default Y'CbCr encoding as defined by the colorspace.
200
201 - .. row 3
202
203 - ``V4L2_YCBCR_ENC_601``
204
205 - Use the BT.601 Y'CbCr encoding.
206
207 - .. row 4
208
209 - ``V4L2_YCBCR_ENC_709``
210
211 - Use the Rec. 709 Y'CbCr encoding.
212
213 - .. row 5
214
215 - ``V4L2_YCBCR_ENC_XV601``
216
217 - Use the extended gamut xvYCC BT.601 encoding.
218
219 - .. row 6
220
221 - ``V4L2_YCBCR_ENC_XV709``
222
223 - Use the extended gamut xvYCC Rec. 709 encoding.
224
225 - .. row 7
226
227 - ``V4L2_YCBCR_ENC_SYCC``
228
229 - Use the extended gamut sYCC encoding.
230
231 - .. row 8
232
233 - ``V4L2_YCBCR_ENC_BT2020``
234
235 - Use the default non-constant luminance BT.2020 Y'CbCr encoding.
236
237 - .. row 9
238
239 - ``V4L2_YCBCR_ENC_BT2020_CONST_LUM``
240
241 - Use the constant luminance BT.2020 Yc'CbcCrc encoding.
242
243 - .. row 10
244
245 - ``V4L2_YCBCR_ENC_SMPTE_240M``
246
247 - Use the SMPTE 240M Y'CbCr encoding.
248
249
250
251.. _v4l2-quantization:
252
253.. flat-table:: V4L2 Quantization Methods
254 :header-rows: 1
255 :stub-columns: 0
256
257
258 - .. row 1
259
260 - Identifier
261
262 - Details
263
264 - .. row 2
265
266 - ``V4L2_QUANTIZATION_DEFAULT``
267
268 - Use the default quantization encoding as defined by the
269 colorspace. This is always full range for R'G'B' (except for the
270 BT.2020 colorspace) and usually limited range for Y'CbCr.
271
272 - .. row 3
273
274 - ``V4L2_QUANTIZATION_FULL_RANGE``
275
276 - Use the full range quantization encoding. I.e. the range [0…1] is
277 mapped to [0…255] (with possible clipping to [1…254] to avoid the
278 0x00 and 0xff values). Cb and Cr are mapped from [-0.5…0.5] to
279 [0…255] (with possible clipping to [1…254] to avoid the 0x00 and
280 0xff values).
281
282 - .. row 4
283
284 - ``V4L2_QUANTIZATION_LIM_RANGE``
285
286 - Use the limited range quantization encoding. I.e. the range [0…1]
287 is mapped to [16…235]. Cb and Cr are mapped from [-0.5…0.5] to
288 [16…240].
diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
new file mode 100644
index 000000000000..8c946b0c63a0
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -0,0 +1,896 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3********************************
4Detailed Colorspace Descriptions
5********************************
6
7
8.. _col-smpte-170m:
9
10Colorspace SMPTE 170M (V4L2_COLORSPACE_SMPTE170M)
11=================================================
12
13The :ref:`smpte170m` standard defines the colorspace used by NTSC and
14PAL and by SDTV in general. The default transfer function is
15``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
16``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
17range. The chromaticities of the primary colors and the white reference
18are:
19
20
21
22.. flat-table:: SMPTE 170M Chromaticities
23 :header-rows: 1
24 :stub-columns: 0
25 :widths: 1 1 2
26
27
28 - .. row 1
29
30 - Color
31
32 - x
33
34 - y
35
36 - .. row 2
37
38 - Red
39
40 - 0.630
41
42 - 0.340
43
44 - .. row 3
45
46 - Green
47
48 - 0.310
49
50 - 0.595
51
52 - .. row 4
53
54 - Blue
55
56 - 0.155
57
58 - 0.070
59
60 - .. row 5
61
62 - White Reference (D65)
63
64 - 0.3127
65
66 - 0.3290
67
68
69The red, green and blue chromaticities are also often referred to as the
70SMPTE C set, so this colorspace is sometimes called SMPTE C as well.
71
72The transfer function defined for SMPTE 170M is the same as the one
73defined in Rec. 709.
74
75 L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018
76
77 L' = 4.5L for -0.018 < L < 0.018
78
79 L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018
80
81Inverse Transfer function:
82
83 L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081
84
85 L = L' / 4.5 for -0.081 < L' < 0.081
86
87 L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081
88
89The luminance (Y') and color difference (Cb and Cr) are obtained with
90the following ``V4L2_YCBCR_ENC_601`` encoding:
91
92 Y' = 0.299R' + 0.587G' + 0.114B'
93
94 Cb = -0.169R' - 0.331G' + 0.5B'
95
96 Cr = 0.5R' - 0.419G' - 0.081B'
97
98Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
99[-0.5…0.5]. This conversion to Y'CbCr is identical to the one defined in
100the :ref:`itu601` standard and this colorspace is sometimes called
101BT.601 as well, even though BT.601 does not mention any color primaries.
102
103The default quantization is limited range, but full range is possible
104although rarely seen.
105
106
107.. _col-rec709:
108
109Colorspace Rec. 709 (V4L2_COLORSPACE_REC709)
110============================================
111
112The :ref:`itu709` standard defines the colorspace used by HDTV in
113general. The default transfer function is ``V4L2_XFER_FUNC_709``. The
114default Y'CbCr encoding is ``V4L2_YCBCR_ENC_709``. The default Y'CbCr
115quantization is limited range. The chromaticities of the primary colors
116and the white reference are:
117
118
119
120.. flat-table:: Rec. 709 Chromaticities
121 :header-rows: 1
122 :stub-columns: 0
123 :widths: 1 1 2
124
125
126 - .. row 1
127
128 - Color
129
130 - x
131
132 - y
133
134 - .. row 2
135
136 - Red
137
138 - 0.640
139
140 - 0.330
141
142 - .. row 3
143
144 - Green
145
146 - 0.300
147
148 - 0.600
149
150 - .. row 4
151
152 - Blue
153
154 - 0.150
155
156 - 0.060
157
158 - .. row 5
159
160 - White Reference (D65)
161
162 - 0.3127
163
164 - 0.3290
165
166
167The full name of this standard is Rec. ITU-R BT.709-5.
168
169Transfer function. Normally L is in the range [0…1], but for the
170extended gamut xvYCC encoding values outside that range are allowed.
171
172 L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018
173
174 L' = 4.5L for -0.018 < L < 0.018
175
176 L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018
177
178Inverse Transfer function:
179
180 L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081
181
182 L = L' / 4.5 for -0.081 < L' < 0.081
183
184 L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081
185
186The luminance (Y') and color difference (Cb and Cr) are obtained with
187the following ``V4L2_YCBCR_ENC_709`` encoding:
188
189 Y' = 0.2126R' + 0.7152G' + 0.0722B'
190
191 Cb = -0.1146R' - 0.3854G' + 0.5B'
192
193 Cr = 0.5R' - 0.4542G' - 0.0458B'
194
195Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
196[-0.5…0.5].
197
198The default quantization is limited range, but full range is possible
199although rarely seen.
200
201The ``V4L2_YCBCR_ENC_709`` encoding described above is the default for
202this colorspace, but it can be overridden with ``V4L2_YCBCR_ENC_601``,
203in which case the BT.601 Y'CbCr encoding is used.
204
205Two additional extended gamut Y'CbCr encodings are also possible with
206this colorspace:
207
208The xvYCC 709 encoding (``V4L2_YCBCR_ENC_XV709``, :ref:`xvycc`) is
209similar to the Rec. 709 encoding, but it allows for R', G' and B' values
210that are outside the range [0…1]. The resulting Y', Cb and Cr values are
211scaled and offset:
212
213 Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256)
214
215 Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B')
216
217 Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B')
218
219The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is
220similar to the BT.601 encoding, but it allows for R', G' and B' values
221that are outside the range [0…1]. The resulting Y', Cb and Cr values are
222scaled and offset:
223
224 Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256)
225
226 Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B')
227
228 Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B')
229
230Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
231[-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be
232used by selecting ``V4L2_YCBCR_ENC_XV709`` or ``V4L2_YCBCR_ENC_XV601``.
233The xvYCC encodings always use full range quantization.
234
235
236.. _col-srgb:
237
238Colorspace sRGB (V4L2_COLORSPACE_SRGB)
239======================================
240
241The :ref:`srgb` standard defines the colorspace used by most webcams
242and computer graphics. The default transfer function is
243``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
244``V4L2_YCBCR_ENC_SYCC``. The default Y'CbCr quantization is full range.
245The chromaticities of the primary colors and the white reference are:
246
247
248
249.. flat-table:: sRGB Chromaticities
250 :header-rows: 1
251 :stub-columns: 0
252 :widths: 1 1 2
253
254
255 - .. row 1
256
257 - Color
258
259 - x
260
261 - y
262
263 - .. row 2
264
265 - Red
266
267 - 0.640
268
269 - 0.330
270
271 - .. row 3
272
273 - Green
274
275 - 0.300
276
277 - 0.600
278
279 - .. row 4
280
281 - Blue
282
283 - 0.150
284
285 - 0.060
286
287 - .. row 5
288
289 - White Reference (D65)
290
291 - 0.3127
292
293 - 0.3290
294
295
296These chromaticities are identical to the Rec. 709 colorspace.
297
298Transfer function. Note that negative values for L are only used by the
299Y'CbCr conversion.
300
301 L' = -1.055(-L) :sup:`1/2.4` + 0.055 for L < -0.0031308
302
303 L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308
304
305 L' = 1.055L :sup:`1/2.4` - 0.055 for 0.0031308 < L ≤ 1
306
307Inverse Transfer function:
308
309 L = -((-L' + 0.055) / 1.055) :sup:`2.4` for L' < -0.04045
310
311 L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045
312
313 L = ((L' + 0.055) / 1.055) :sup:`2.4` for L' > 0.04045
314
315The luminance (Y') and color difference (Cb and Cr) are obtained with
316the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by
317:ref:`sycc`:
318
319 Y' = 0.2990R' + 0.5870G' + 0.1140B'
320
321 Cb = -0.1687R' - 0.3313G' + 0.5B'
322
323 Cr = 0.5R' - 0.4187G' - 0.0813B'
324
325Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
326[-0.5…0.5]. The ``V4L2_YCBCR_ENC_SYCC`` quantization is always full
327range. Although this Y'CbCr encoding looks very similar to the
328``V4L2_YCBCR_ENC_XV601`` encoding, it is not. The
329``V4L2_YCBCR_ENC_XV601`` scales and offsets the Y'CbCr values before
330quantization, but this encoding does not do that.
331
332
333.. _col-adobergb:
334
335Colorspace Adobe RGB (V4L2_COLORSPACE_ADOBERGB)
336===============================================
337
338The :ref:`adobergb` standard defines the colorspace used by computer
339graphics that use the AdobeRGB colorspace. This is also known as the
340:ref:`oprgb` standard. The default transfer function is
341``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
342``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
343range. The chromaticities of the primary colors and the white reference
344are:
345
346
347
348.. flat-table:: Adobe RGB Chromaticities
349 :header-rows: 1
350 :stub-columns: 0
351 :widths: 1 1 2
352
353
354 - .. row 1
355
356 - Color
357
358 - x
359
360 - y
361
362 - .. row 2
363
364 - Red
365
366 - 0.6400
367
368 - 0.3300
369
370 - .. row 3
371
372 - Green
373
374 - 0.2100
375
376 - 0.7100
377
378 - .. row 4
379
380 - Blue
381
382 - 0.1500
383
384 - 0.0600
385
386 - .. row 5
387
388 - White Reference (D65)
389
390 - 0.3127
391
392 - 0.3290
393
394
395
396Transfer function:
397
398 L' = L :sup:`1/2.19921875`
399
400Inverse Transfer function:
401
402 L = L' :sup:`2.19921875`
403
404The luminance (Y') and color difference (Cb and Cr) are obtained with
405the following ``V4L2_YCBCR_ENC_601`` encoding:
406
407 Y' = 0.299R' + 0.587G' + 0.114B'
408
409 Cb = -0.169R' - 0.331G' + 0.5B'
410
411 Cr = 0.5R' - 0.419G' - 0.081B'
412
413Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
414[-0.5…0.5]. This transform is identical to one defined in SMPTE
415170M/BT.601. The Y'CbCr quantization is limited range.
416
417
418.. _col-bt2020:
419
420Colorspace BT.2020 (V4L2_COLORSPACE_BT2020)
421===========================================
422
423The :ref:`itu2020` standard defines the colorspace used by Ultra-high
424definition television (UHDTV). The default transfer function is
425``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
426``V4L2_YCBCR_ENC_BT2020``. The default R'G'B' quantization is limited
427range (!), and so is the default Y'CbCr quantization. The chromaticities
428of the primary colors and the white reference are:
429
430
431
432.. flat-table:: BT.2020 Chromaticities
433 :header-rows: 1
434 :stub-columns: 0
435 :widths: 1 1 2
436
437
438 - .. row 1
439
440 - Color
441
442 - x
443
444 - y
445
446 - .. row 2
447
448 - Red
449
450 - 0.708
451
452 - 0.292
453
454 - .. row 3
455
456 - Green
457
458 - 0.170
459
460 - 0.797
461
462 - .. row 4
463
464 - Blue
465
466 - 0.131
467
468 - 0.046
469
470 - .. row 5
471
472 - White Reference (D65)
473
474 - 0.3127
475
476 - 0.3290
477
478
479
480Transfer function (same as Rec. 709):
481
482 L' = 4.5L for 0 ≤ L < 0.018
483
484 L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1
485
486Inverse Transfer function:
487
488 L = L' / 4.5 for L' < 0.081
489
490 L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081
491
492The luminance (Y') and color difference (Cb and Cr) are obtained with
493the following ``V4L2_YCBCR_ENC_BT2020`` encoding:
494
495 Y' = 0.2627R' + 0.6780G' + 0.0593B'
496
497 Cb = -0.1396R' - 0.3604G' + 0.5B'
498
499 Cr = 0.5R' - 0.4598G' - 0.0402B'
500
501Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
502[-0.5…0.5]. The Y'CbCr quantization is limited range.
503
504There is also an alternate constant luminance R'G'B' to Yc'CbcCrc
505(``V4L2_YCBCR_ENC_BT2020_CONST_LUM``) encoding:
506
507Luma:
508
509 Yc' = (0.2627R + 0.6780G + 0.0593B)'
510
511B' - Yc' ≤ 0:
512
513 Cbc = (B' - Yc') / 1.9404
514
515B' - Yc' > 0:
516
517 Cbc = (B' - Yc') / 1.5816
518
519R' - Yc' ≤ 0:
520
521 Crc = (R' - Y') / 1.7184
522
523R' - Yc' > 0:
524
525 Crc = (R' - Y') / 0.9936
526
527Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
528range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range.
529
530
531.. _col-dcip3:
532
533Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
534==========================================
535
536The :ref:`smpte431` standard defines the colorspace used by cinema
537projectors that use the DCI-P3 colorspace. The default transfer function
538is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
539``V4L2_YCBCR_ENC_709``.
540
541.. note:: Note that this colorspace does not specify a
542 Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
543 default Y'CbCr encoding was picked because it is the HDTV encoding. The
544 default Y'CbCr quantization is limited range. The chromaticities of the
545 primary colors and the white reference are:
546
547
548
549.. flat-table:: DCI-P3 Chromaticities
550 :header-rows: 1
551 :stub-columns: 0
552 :widths: 1 1 2
553
554
555 - .. row 1
556
557 - Color
558
559 - x
560
561 - y
562
563 - .. row 2
564
565 - Red
566
567 - 0.6800
568
569 - 0.3200
570
571 - .. row 3
572
573 - Green
574
575 - 0.2650
576
577 - 0.6900
578
579 - .. row 4
580
581 - Blue
582
583 - 0.1500
584
585 - 0.0600
586
587 - .. row 5
588
589 - White Reference
590
591 - 0.3140
592
593 - 0.3510
594
595
596
597Transfer function:
598
599 L' = L :sup:`1/2.6`
600
601Inverse Transfer function:
602
603 L = L' :sup:`2.6`
604
605Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709.
606
607
608.. _col-smpte-240m:
609
610Colorspace SMPTE 240M (V4L2_COLORSPACE_SMPTE240M)
611=================================================
612
613The :ref:`smpte240m` standard was an interim standard used during the
614early days of HDTV (1988-1998). It has been superseded by Rec. 709. The
615default transfer function is ``V4L2_XFER_FUNC_SMPTE240M``. The default
616Y'CbCr encoding is ``V4L2_YCBCR_ENC_SMPTE240M``. The default Y'CbCr
617quantization is limited range. The chromaticities of the primary colors
618and the white reference are:
619
620
621
622.. flat-table:: SMPTE 240M Chromaticities
623 :header-rows: 1
624 :stub-columns: 0
625 :widths: 1 1 2
626
627
628 - .. row 1
629
630 - Color
631
632 - x
633
634 - y
635
636 - .. row 2
637
638 - Red
639
640 - 0.630
641
642 - 0.340
643
644 - .. row 3
645
646 - Green
647
648 - 0.310
649
650 - 0.595
651
652 - .. row 4
653
654 - Blue
655
656 - 0.155
657
658 - 0.070
659
660 - .. row 5
661
662 - White Reference (D65)
663
664 - 0.3127
665
666 - 0.3290
667
668
669These chromaticities are identical to the SMPTE 170M colorspace.
670
671Transfer function:
672
673 L' = 4L for 0 ≤ L < 0.0228
674
675 L' = 1.1115L :sup:`0.45` - 0.1115 for 0.0228 ≤ L ≤ 1
676
677Inverse Transfer function:
678
679 L = L' / 4 for 0 ≤ L' < 0.0913
680
681 L = ((L' + 0.1115) / 1.1115) :sup:`1/0.45` for L' ≥ 0.0913
682
683The luminance (Y') and color difference (Cb and Cr) are obtained with
684the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding:
685
686 Y' = 0.2122R' + 0.7013G' + 0.0865B'
687
688 Cb = -0.1161R' - 0.3839G' + 0.5B'
689
690 Cr = 0.5R' - 0.4451G' - 0.0549B'
691
692Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
693range [-0.5…0.5]. The Y'CbCr quantization is limited range.
694
695
696.. _col-sysm:
697
698Colorspace NTSC 1953 (V4L2_COLORSPACE_470_SYSTEM_M)
699===================================================
700
701This standard defines the colorspace used by NTSC in 1953. In practice
702this colorspace is obsolete and SMPTE 170M should be used instead. The
703default transfer function is ``V4L2_XFER_FUNC_709``. The default Y'CbCr
704encoding is ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is
705limited range. The chromaticities of the primary colors and the white
706reference are:
707
708
709
710.. flat-table:: NTSC 1953 Chromaticities
711 :header-rows: 1
712 :stub-columns: 0
713 :widths: 1 1 2
714
715
716 - .. row 1
717
718 - Color
719
720 - x
721
722 - y
723
724 - .. row 2
725
726 - Red
727
728 - 0.67
729
730 - 0.33
731
732 - .. row 3
733
734 - Green
735
736 - 0.21
737
738 - 0.71
739
740 - .. row 4
741
742 - Blue
743
744 - 0.14
745
746 - 0.08
747
748 - .. row 5
749
750 - White Reference (C)
751
752 - 0.310
753
754 - 0.316
755
756
757.. note:: This colorspace uses Illuminant C instead of D65 as the white
758 reference. To correctly convert an image in this colorspace to another
759 that uses D65 you need to apply a chromatic adaptation algorithm such as
760 the Bradford method.
761
762The transfer function was never properly defined for NTSC 1953. The Rec.
763709 transfer function is recommended in the literature:
764
765 L' = 4.5L for 0 ≤ L < 0.018
766
767 L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1
768
769Inverse Transfer function:
770
771 L = L' / 4.5 for L' < 0.081
772
773 L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081
774
775The luminance (Y') and color difference (Cb and Cr) are obtained with
776the following ``V4L2_YCBCR_ENC_601`` encoding:
777
778 Y' = 0.299R' + 0.587G' + 0.114B'
779
780 Cb = -0.169R' - 0.331G' + 0.5B'
781
782 Cr = 0.5R' - 0.419G' - 0.081B'
783
784Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
785[-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
786identical to one defined in SMPTE 170M/BT.601.
787
788
789.. _col-sysbg:
790
791Colorspace EBU Tech. 3213 (V4L2_COLORSPACE_470_SYSTEM_BG)
792=========================================================
793
794The :ref:`tech3213` standard defines the colorspace used by PAL/SECAM
795in 1975. In practice this colorspace is obsolete and SMPTE 170M should
796be used instead. The default transfer function is
797``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
798``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
799range. The chromaticities of the primary colors and the white reference
800are:
801
802
803
804.. flat-table:: EBU Tech. 3213 Chromaticities
805 :header-rows: 1
806 :stub-columns: 0
807 :widths: 1 1 2
808
809
810 - .. row 1
811
812 - Color
813
814 - x
815
816 - y
817
818 - .. row 2
819
820 - Red
821
822 - 0.64
823
824 - 0.33
825
826 - .. row 3
827
828 - Green
829
830 - 0.29
831
832 - 0.60
833
834 - .. row 4
835
836 - Blue
837
838 - 0.15
839
840 - 0.06
841
842 - .. row 5
843
844 - White Reference (D65)
845
846 - 0.3127
847
848 - 0.3290
849
850
851
852The transfer function was never properly defined for this colorspace.
853The Rec. 709 transfer function is recommended in the literature:
854
855 L' = 4.5L for 0 ≤ L < 0.018
856
857 L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1
858
859Inverse Transfer function:
860
861 L = L' / 4.5 for L' < 0.081
862
863 L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081
864
865The luminance (Y') and color difference (Cb and Cr) are obtained with
866the following ``V4L2_YCBCR_ENC_601`` encoding:
867
868 Y' = 0.299R' + 0.587G' + 0.114B'
869
870 Cb = -0.169R' - 0.331G' + 0.5B'
871
872 Cr = 0.5R' - 0.419G' - 0.081B'
873
874Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
875[-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
876identical to one defined in SMPTE 170M/BT.601.
877
878
879.. _col-jpeg:
880
881Colorspace JPEG (V4L2_COLORSPACE_JPEG)
882======================================
883
884This colorspace defines the colorspace used by most (Motion-)JPEG
885formats. The chromaticities of the primary colors and the white
886reference are identical to sRGB. The transfer function use is
887``V4L2_XFER_FUNC_SRGB``. The Y'CbCr encoding is ``V4L2_YCBCR_ENC_601``
888with full range quantization where Y' is scaled to [0…255] and Cb/Cr are
889scaled to [-128…128] and then clipped to [-128…127].
890
891.. note:: The JPEG standard does not actually store colorspace
892 information. So if something other than sRGB is used, then the driver
893 will have to set that information explicitly. Effectively
894 ``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for
895 ``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and
896 ``V4L2_QUANTIZATION_FULL_RANGE``.
diff --git a/Documentation/media/uapi/v4l/pixfmt-008.rst b/Documentation/media/uapi/v4l/pixfmt-008.rst
new file mode 100644
index 000000000000..4bec79784bdd
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-008.rst
@@ -0,0 +1,32 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3***************************************
4Detailed Transfer Function Descriptions
5***************************************
6
7
8.. _xf-smpte-2084:
9
10Transfer Function SMPTE 2084 (V4L2_XFER_FUNC_SMPTE2084)
11=======================================================
12
13The :ref:`smpte2084` standard defines the transfer function used by
14High Dynamic Range content.
15
16Constants:
17 m1 = (2610 / 4096) / 4
18
19 m2 = (2523 / 4096) * 128
20
21 c1 = 3424 / 4096
22
23 c2 = (2413 / 4096) * 32
24
25 c3 = (2392 / 4096) * 32
26
27Transfer function:
28 L' = ((c1 + c2 * L\ :sup:`m1`) / (1 + c3 * L\ :sup:`m1`))\ :sup:`m2`
29
30Inverse Transfer function:
31 L = (max(L':sup:`1/m2` - c1, 0) / (c2 - c3 *
32 L'\ :sup:`1/m2`))\ :sup:`1/m1`
diff --git a/Documentation/media/uapi/v4l/pixfmt-013.rst b/Documentation/media/uapi/v4l/pixfmt-013.rst
new file mode 100644
index 000000000000..475f6e6fe785
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-013.rst
@@ -0,0 +1,129 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3******************
4Compressed Formats
5******************
6
7
8.. _compressed-formats:
9
10.. flat-table:: Compressed Image Formats
11 :header-rows: 1
12 :stub-columns: 0
13 :widths: 3 1 4
14
15
16 - .. row 1
17
18 - Identifier
19
20 - Code
21
22 - Details
23
24 - .. _V4L2-PIX-FMT-JPEG:
25
26 - ``V4L2_PIX_FMT_JPEG``
27
28 - 'JPEG'
29
30 - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
31 :ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
32
33 - .. _V4L2-PIX-FMT-MPEG:
34
35 - ``V4L2_PIX_FMT_MPEG``
36
37 - 'MPEG'
38
39 - MPEG multiplexed stream. The actual format is determined by
40 extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
41 :ref:`mpeg-control-id`.
42
43 - .. _V4L2-PIX-FMT-H264:
44
45 - ``V4L2_PIX_FMT_H264``
46
47 - 'H264'
48
49 - H264 video elementary stream with start codes.
50
51 - .. _V4L2-PIX-FMT-H264-NO-SC:
52
53 - ``V4L2_PIX_FMT_H264_NO_SC``
54
55 - 'AVC1'
56
57 - H264 video elementary stream without start codes.
58
59 - .. _V4L2-PIX-FMT-H264-MVC:
60
61 - ``V4L2_PIX_FMT_H264_MVC``
62
63 - 'M264'
64
65 - H264 MVC video elementary stream.
66
67 - .. _V4L2-PIX-FMT-H263:
68
69 - ``V4L2_PIX_FMT_H263``
70
71 - 'H263'
72
73 - H263 video elementary stream.
74
75 - .. _V4L2-PIX-FMT-MPEG1:
76
77 - ``V4L2_PIX_FMT_MPEG1``
78
79 - 'MPG1'
80
81 - MPEG1 video elementary stream.
82
83 - .. _V4L2-PIX-FMT-MPEG2:
84
85 - ``V4L2_PIX_FMT_MPEG2``
86
87 - 'MPG2'
88
89 - MPEG2 video elementary stream.
90
91 - .. _V4L2-PIX-FMT-MPEG4:
92
93 - ``V4L2_PIX_FMT_MPEG4``
94
95 - 'MPG4'
96
97 - MPEG4 video elementary stream.
98
99 - .. _V4L2-PIX-FMT-XVID:
100
101 - ``V4L2_PIX_FMT_XVID``
102
103 - 'XVID'
104
105 - Xvid video elementary stream.
106
107 - .. _V4L2-PIX-FMT-VC1-ANNEX-G:
108
109 - ``V4L2_PIX_FMT_VC1_ANNEX_G``
110
111 - 'VC1G'
112
113 - VC1, SMPTE 421M Annex G compliant stream.
114
115 - .. _V4L2-PIX-FMT-VC1-ANNEX-L:
116
117 - ``V4L2_PIX_FMT_VC1_ANNEX_L``
118
119 - 'VC1L'
120
121 - VC1, SMPTE 421M Annex L compliant stream.
122
123 - .. _V4L2-PIX-FMT-VP8:
124
125 - ``V4L2_PIX_FMT_VP8``
126
127 - 'VP80'
128
129 - VP8 video elementary stream.
diff --git a/Documentation/media/uapi/v4l/pixfmt-grey.rst b/Documentation/media/uapi/v4l/pixfmt-grey.rst
new file mode 100644
index 000000000000..761d783d4989
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-grey.rst
@@ -0,0 +1,77 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-GREY:
4
5**************************
6V4L2_PIX_FMT_GREY ('GREY')
7**************************
8
9*man V4L2_PIX_FMT_GREY(2)*
10
11Grey-scale image
12
13
14Description
15===========
16
17This is a grey-scale image. It is really a degenerate Y'CbCr format
18which simply contains no Cb or Cr data.
19
20**Byte Order.**
21Each cell is one byte.
22
23
24
25.. flat-table::
26 :header-rows: 0
27 :stub-columns: 0
28 :widths: 2 1 1 1 1
29
30
31 - .. row 1
32
33 - start + 0:
34
35 - Y'\ :sub:`00`
36
37 - Y'\ :sub:`01`
38
39 - Y'\ :sub:`02`
40
41 - Y'\ :sub:`03`
42
43 - .. row 2
44
45 - start + 4:
46
47 - Y'\ :sub:`10`
48
49 - Y'\ :sub:`11`
50
51 - Y'\ :sub:`12`
52
53 - Y'\ :sub:`13`
54
55 - .. row 3
56
57 - start + 8:
58
59 - Y'\ :sub:`20`
60
61 - Y'\ :sub:`21`
62
63 - Y'\ :sub:`22`
64
65 - Y'\ :sub:`23`
66
67 - .. row 4
68
69 - start + 12:
70
71 - Y'\ :sub:`30`
72
73 - Y'\ :sub:`31`
74
75 - Y'\ :sub:`32`
76
77 - Y'\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-indexed.rst b/Documentation/media/uapi/v4l/pixfmt-indexed.rst
new file mode 100644
index 000000000000..99a780fe6b61
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-indexed.rst
@@ -0,0 +1,73 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _pixfmt-indexed:
4
5**************
6Indexed Format
7**************
8
9In this format each pixel is represented by an 8 bit index into a 256
10entry ARGB palette. It is intended for
11:ref:`Video Output Overlays <osd>` only. There are no ioctls to access
12the palette, this must be done with ioctls of the Linux framebuffer API.
13
14
15
16.. flat-table:: Indexed Image Format
17 :header-rows: 2
18 :stub-columns: 0
19
20
21 - .. row 1
22
23 - Identifier
24
25 - Code
26
27 -
28 - :cspan:`7` Byte 0
29
30 - .. row 2
31
32 -
33 -
34 - Bit
35
36 - 7
37
38 - 6
39
40 - 5
41
42 - 4
43
44 - 3
45
46 - 2
47
48 - 1
49
50 - 0
51
52 - .. _V4L2-PIX-FMT-PAL8:
53
54 - ``V4L2_PIX_FMT_PAL8``
55
56 - 'PAL8'
57
58 -
59 - i\ :sub:`7`
60
61 - i\ :sub:`6`
62
63 - i\ :sub:`5`
64
65 - i\ :sub:`4`
66
67 - i\ :sub:`3`
68
69 - i\ :sub:`2`
70
71 - i\ :sub:`1`
72
73 - i\ :sub:`0`
diff --git a/Documentation/media/uapi/v4l/pixfmt-m420.rst b/Documentation/media/uapi/v4l/pixfmt-m420.rst
new file mode 100644
index 000000000000..4c5b2969c039
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-m420.rst
@@ -0,0 +1,219 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-M420:
4
5**************************
6V4L2_PIX_FMT_M420 ('M420')
7**************************
8
9*man V4L2_PIX_FMT_M420(2)*
10
11Format with ½ horizontal and vertical chroma resolution, also known as
12YUV 4:2:0. Hybrid plane line-interleaved layout.
13
14
15Description
16===========
17
18M420 is a YUV format with ½ horizontal and vertical chroma subsampling
19(YUV 4:2:0). Pixels are organized as interleaved luma and chroma planes.
20Two lines of luma data are followed by one line of chroma data.
21
22The luma plane has one byte per pixel. The chroma plane contains
23interleaved CbCr pixels subsampled by ½ in the horizontal and vertical
24directions. Each CbCr pair belongs to four pixels. For example,
25Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
26Y'\ :sub:`10`, Y'\ :sub:`11`.
27
28All line lengths are identical: if the Y lines include pad bytes so do
29the CbCr lines.
30
31**Byte Order.**
32Each cell is one byte.
33
34
35
36.. flat-table::
37 :header-rows: 0
38 :stub-columns: 0
39 :widths: 2 1 1 1 1
40
41
42 - .. row 1
43
44 - start + 0:
45
46 - Y'\ :sub:`00`
47
48 - Y'\ :sub:`01`
49
50 - Y'\ :sub:`02`
51
52 - Y'\ :sub:`03`
53
54 - .. row 2
55
56 - start + 4:
57
58 - Y'\ :sub:`10`
59
60 - Y'\ :sub:`11`
61
62 - Y'\ :sub:`12`
63
64 - Y'\ :sub:`13`
65
66 - .. row 3
67
68 - start + 8:
69
70 - Cb\ :sub:`00`
71
72 - Cr\ :sub:`00`
73
74 - Cb\ :sub:`01`
75
76 - Cr\ :sub:`01`
77
78 - .. row 4
79
80 - start + 16:
81
82 - Y'\ :sub:`20`
83
84 - Y'\ :sub:`21`
85
86 - Y'\ :sub:`22`
87
88 - Y'\ :sub:`23`
89
90 - .. row 5
91
92 - start + 20:
93
94 - Y'\ :sub:`30`
95
96 - Y'\ :sub:`31`
97
98 - Y'\ :sub:`32`
99
100 - Y'\ :sub:`33`
101
102 - .. row 6
103
104 - start + 24:
105
106 - Cb\ :sub:`10`
107
108 - Cr\ :sub:`10`
109
110 - Cb\ :sub:`11`
111
112 - Cr\ :sub:`11`
113
114
115**Color Sample Location..**
116
117
118
119.. flat-table::
120 :header-rows: 0
121 :stub-columns: 0
122
123
124 - .. row 1
125
126 -
127 - 0
128
129 -
130 - 1
131
132 - 2
133
134 -
135 - 3
136
137 - .. row 2
138
139 - 0
140
141 - Y
142
143 -
144 - Y
145
146 - Y
147
148 -
149 - Y
150
151 - .. row 3
152
153 -
154 -
155 - C
156
157 -
158 -
159 - C
160
161 -
162
163 - .. row 4
164
165 - 1
166
167 - Y
168
169 -
170 - Y
171
172 - Y
173
174 -
175 - Y
176
177 - .. row 5
178
179 -
180
181 - .. row 6
182
183 - 2
184
185 - Y
186
187 -
188 - Y
189
190 - Y
191
192 -
193 - Y
194
195 - .. row 7
196
197 -
198 -
199 - C
200
201 -
202 -
203 - C
204
205 -
206
207 - .. row 8
208
209 - 3
210
211 - Y
212
213 -
214 - Y
215
216 - Y
217
218 -
219 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12.rst b/Documentation/media/uapi/v4l/pixfmt-nv12.rst
new file mode 100644
index 000000000000..cf59b28f75b7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12.rst
@@ -0,0 +1,221 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV12:
4.. _V4L2-PIX-FMT-NV21:
5
6******************************************************
7V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')
8******************************************************
9
10*man V4L2_PIX_FMT_NV12(2)*
11
12V4L2_PIX_FMT_NV21
13Formats with ½ horizontal and vertical chroma resolution, also known as
14YUV 4:2:0. One luminance and one chrominance plane with alternating
15chroma samples as opposed to ``V4L2_PIX_FMT_YVU420``
16
17
18Description
19===========
20
21These are two-plane versions of the YUV 4:2:0 format. The three
22components are separated into two sub-images or planes. The Y plane is
23first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_NV12``, a
24combined CbCr plane immediately follows the Y plane in memory. The CbCr
25plane is the same width, in bytes, as the Y plane (and of the image),
26but is half as tall in pixels. Each CbCr pair belongs to four pixels.
27For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
28Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`. ``V4L2_PIX_FMT_NV21`` is
29the same except the Cb and Cr bytes are swapped, the CrCb plane starts
30with a Cr byte.
31
32If the Y plane has pad bytes after each row, then the CbCr plane has as
33many pad bytes after its rows.
34
35**Byte Order.**
36Each cell is one byte.
37
38
39
40.. flat-table::
41 :header-rows: 0
42 :stub-columns: 0
43 :widths: 2 1 1 1 1
44
45
46 - .. row 1
47
48 - start + 0:
49
50 - Y'\ :sub:`00`
51
52 - Y'\ :sub:`01`
53
54 - Y'\ :sub:`02`
55
56 - Y'\ :sub:`03`
57
58 - .. row 2
59
60 - start + 4:
61
62 - Y'\ :sub:`10`
63
64 - Y'\ :sub:`11`
65
66 - Y'\ :sub:`12`
67
68 - Y'\ :sub:`13`
69
70 - .. row 3
71
72 - start + 8:
73
74 - Y'\ :sub:`20`
75
76 - Y'\ :sub:`21`
77
78 - Y'\ :sub:`22`
79
80 - Y'\ :sub:`23`
81
82 - .. row 4
83
84 - start + 12:
85
86 - Y'\ :sub:`30`
87
88 - Y'\ :sub:`31`
89
90 - Y'\ :sub:`32`
91
92 - Y'\ :sub:`33`
93
94 - .. row 5
95
96 - start + 16:
97
98 - Cb\ :sub:`00`
99
100 - Cr\ :sub:`00`
101
102 - Cb\ :sub:`01`
103
104 - Cr\ :sub:`01`
105
106 - .. row 6
107
108 - start + 20:
109
110 - Cb\ :sub:`10`
111
112 - Cr\ :sub:`10`
113
114 - Cb\ :sub:`11`
115
116 - Cr\ :sub:`11`
117
118
119**Color Sample Location..**
120
121.. flat-table::
122 :header-rows: 0
123 :stub-columns: 0
124
125
126 - .. row 1
127
128 -
129 - 0
130
131 -
132 - 1
133
134 - 2
135
136 -
137 - 3
138
139 - .. row 2
140
141 - 0
142
143 - Y
144
145 -
146 - Y
147
148 - Y
149
150 -
151 - Y
152
153 - .. row 3
154
155 -
156 -
157 - C
158
159 -
160 -
161 - C
162
163 -
164
165 - .. row 4
166
167 - 1
168
169 - Y
170 -
171
172 - Y
173
174 - Y
175
176 -
177 - Y
178
179 - .. row 5
180
181 -
182
183 - .. row 6
184
185 - 2
186
187 - Y
188 -
189
190 - Y
191
192 - Y
193
194 -
195 - Y
196
197 - .. row 7
198
199 -
200 -
201 - C
202
203 -
204 -
205 - C
206
207 -
208
209 - .. row 8
210
211 - 3
212
213 - Y
214
215 -
216 - Y
217
218 - Y
219
220 -
221 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12m.rst b/Documentation/media/uapi/v4l/pixfmt-nv12m.rst
new file mode 100644
index 000000000000..a4e7eaeccea8
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12m.rst
@@ -0,0 +1,238 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV12M:
4.. _v4l2-pix-fmt-nv12mt-16x16:
5.. _V4L2-PIX-FMT-NV21M:
6
7***********************************************************************************
8V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16
9***********************************************************************************
10
11*man V4L2_PIX_FMT_NV12M(2)*
12
13V4L2_PIX_FMT_NV21M
14V4L2_PIX_FMT_NV12MT_16X16
15Variation of ``V4L2_PIX_FMT_NV12`` and ``V4L2_PIX_FMT_NV21`` with planes
16non contiguous in memory.
17
18
19Description
20===========
21
22This is a multi-planar, two-plane version of the YUV 4:2:0 format. The
23three components are separated into two sub-images or planes.
24``V4L2_PIX_FMT_NV12M`` differs from ``V4L2_PIX_FMT_NV12`` in that the
25two planes are non-contiguous in memory, i.e. the chroma plane do not
26necessarily immediately follows the luma plane. The luminance data
27occupies the first plane. The Y plane has one byte per pixel. In the
28second plane there is a chrominance data with alternating chroma
29samples. The CbCr plane is the same width, in bytes, as the Y plane (and
30of the image), but is half as tall in pixels. Each CbCr pair belongs to
31four pixels. For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to
32Y'\ :sub:`00`, Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`.
33``V4L2_PIX_FMT_NV12MT_16X16`` is the tiled version of
34``V4L2_PIX_FMT_NV12M`` with 16x16 macroblock tiles. Here pixels are
35arranged in 16x16 2D tiles and tiles are arranged in linear order in
36memory. ``V4L2_PIX_FMT_NV21M`` is the same as ``V4L2_PIX_FMT_NV12M``
37except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr
38byte.
39
40``V4L2_PIX_FMT_NV12M`` is intended to be used only in drivers and
41applications that support the multi-planar API, described in
42:ref:`planar-apis`.
43
44If the Y plane has pad bytes after each row, then the CbCr plane has as
45many pad bytes after its rows.
46
47**Byte Order.**
48Each cell is one byte.
49
50.. flat-table::
51 :header-rows: 0
52 :stub-columns: 0
53 :widths: 2 1 1 1 1
54
55
56 - .. row 1
57
58 - start0 + 0:
59
60 - Y'\ :sub:`00`
61
62 - Y'\ :sub:`01`
63
64 - Y'\ :sub:`02`
65
66 - Y'\ :sub:`03`
67
68 - .. row 2
69
70 - start0 + 4:
71
72 - Y'\ :sub:`10`
73
74 - Y'\ :sub:`11`
75
76 - Y'\ :sub:`12`
77
78 - Y'\ :sub:`13`
79
80 - .. row 3
81
82 - start0 + 8:
83
84 - Y'\ :sub:`20`
85
86 - Y'\ :sub:`21`
87
88 - Y'\ :sub:`22`
89
90 - Y'\ :sub:`23`
91
92 - .. row 4
93
94 - start0 + 12:
95
96 - Y'\ :sub:`30`
97
98 - Y'\ :sub:`31`
99
100 - Y'\ :sub:`32`
101
102 - Y'\ :sub:`33`
103
104 - .. row 5
105
106 -
107
108 - .. row 6
109
110 - start1 + 0:
111
112 - Cb\ :sub:`00`
113
114 - Cr\ :sub:`00`
115
116 - Cb\ :sub:`01`
117
118 - Cr\ :sub:`01`
119
120 - .. row 7
121
122 - start1 + 4:
123
124 - Cb\ :sub:`10`
125
126 - Cr\ :sub:`10`
127
128 - Cb\ :sub:`11`
129
130 - Cr\ :sub:`11`
131
132
133**Color Sample Location..**
134
135
136
137.. flat-table::
138 :header-rows: 0
139 :stub-columns: 0
140
141
142 - .. row 1
143
144 -
145 - 0
146
147 -
148 - 1
149
150 - 2
151
152 -
153 - 3
154
155 - .. row 2
156
157 - 0
158
159 - Y
160
161 -
162 - Y
163
164 - Y
165
166 -
167 - Y
168
169 - .. row 3
170
171 -
172 -
173 - C
174
175 -
176 -
177 - C
178
179 -
180
181 - .. row 4
182
183 - 1
184
185 - Y
186
187 -
188 - Y
189
190 - Y
191
192 -
193 - Y
194
195 - .. row 5
196
197 -
198
199 - .. row 6
200
201 - 2
202
203 - Y
204
205 -
206 - Y
207
208 - Y
209
210 -
211 - Y
212
213 - .. row 7
214
215 -
216 -
217 - C
218
219 -
220 -
221 -
222 - C
223
224 -
225
226 - .. row 8
227
228 - 3
229
230 - Y
231
232 -
233 - Y
234
235 - Y
236
237 -
238 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
new file mode 100644
index 000000000000..6198941bb814
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV12MT:
4
5****************************
6V4L2_PIX_FMT_NV12MT ('TM12')
7****************************
8
9*man V4L2_PIX_FMT_NV12MT(2)*
10
11Formats with ½ horizontal and vertical chroma resolution. This format
12has two planes - one for luminance and one for chrominance. Chroma
13samples are interleaved. The difference to ``V4L2_PIX_FMT_NV12`` is the
14memory layout. Pixels are grouped in macroblocks of 64x32 size. The
15order of macroblocks in memory is also not standard.
16
17
18Description
19===========
20
21This is the two-plane versions of the YUV 4:2:0 format where data is
22grouped into 64x32 macroblocks. The three components are separated into
23two sub-images or planes. The Y plane has one byte per pixel and pixels
24are grouped into 64x32 macroblocks. The CbCr plane has the same width,
25in bytes, as the Y plane (and the image), but is half as tall in pixels.
26The chroma plane is also grouped into 64x32 macroblocks.
27
28Width of the buffer has to be aligned to the multiple of 128, and height
29alignment is 32. Every four adjacent buffers - two horizontally and two
30vertically are grouped together and are located in memory in Z or
31flipped Z order.
32
33Layout of macroblocks in memory is presented in the following figure.
34
35
36.. _nv12mt:
37
38.. figure:: pixfmt-nv12mt_files/nv12mt.*
39 :alt: nv12mt.gif
40 :align: center
41
42 V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
43
44The requirement that width is multiple of 128 is implemented because,
45the Z shape cannot be cut in half horizontally. In case the vertical
46resolution of macroblocks is odd then the last row of macroblocks is
47arranged in a linear order.
48
49In case of chroma the layout is identical. Cb and Cr samples are
50interleaved. Height of the buffer is aligned to 32.
51
52
53.. _nv12mt_ex:
54
55.. figure:: pixfmt-nv12mt_files/nv12mt_example.*
56 :alt: nv12mt_example.gif
57 :align: center
58
59 Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
60
61Memory layout of macroblocks of ``V4L2_PIX_FMT_NV12MT`` format in most
62extreme case.
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
new file mode 100644
index 000000000000..ef2d4cf8367b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif
new file mode 100644
index 000000000000..df81d68108ee
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif
Binary files differ
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv16.rst b/Documentation/media/uapi/v4l/pixfmt-nv16.rst
new file mode 100644
index 000000000000..88aa7617f7cf
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv16.rst
@@ -0,0 +1,270 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV16:
4.. _V4L2-PIX-FMT-NV61:
5
6******************************************************
7V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')
8******************************************************
9
10*man V4L2_PIX_FMT_NV16(2)*
11
12V4L2_PIX_FMT_NV61
13Formats with ½ horizontal chroma resolution, also known as YUV 4:2:2.
14One luminance and one chrominance plane with alternating chroma samples
15as opposed to ``V4L2_PIX_FMT_YVU420``
16
17
18Description
19===========
20
21These are two-plane versions of the YUV 4:2:2 format. The three
22components are separated into two sub-images or planes. The Y plane is
23first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_NV16``, a
24combined CbCr plane immediately follows the Y plane in memory. The CbCr
25plane is the same width and height, in bytes, as the Y plane (and of the
26image). Each CbCr pair belongs to two pixels. For example,
27Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`.
28``V4L2_PIX_FMT_NV61`` is the same except the Cb and Cr bytes are
29swapped, the CrCb plane starts with a Cr byte.
30
31If the Y plane has pad bytes after each row, then the CbCr plane has as
32many pad bytes after its rows.
33
34**Byte Order.**
35Each cell is one byte.
36
37
38
39.. flat-table::
40 :header-rows: 0
41 :stub-columns: 0
42 :widths: 2 1 1 1 1
43
44
45 - .. row 1
46
47 - start + 0:
48
49 - Y'\ :sub:`00`
50
51 - Y'\ :sub:`01`
52
53 - Y'\ :sub:`02`
54
55 - Y'\ :sub:`03`
56
57 - .. row 2
58
59 - start + 4:
60
61 - Y'\ :sub:`10`
62
63 - Y'\ :sub:`11`
64
65 - Y'\ :sub:`12`
66
67 - Y'\ :sub:`13`
68
69 - .. row 3
70
71 - start + 8:
72
73 - Y'\ :sub:`20`
74
75 - Y'\ :sub:`21`
76
77 - Y'\ :sub:`22`
78
79 - Y'\ :sub:`23`
80
81 - .. row 4
82
83 - start + 12:
84
85 - Y'\ :sub:`30`
86
87 - Y'\ :sub:`31`
88
89 - Y'\ :sub:`32`
90
91 - Y'\ :sub:`33`
92
93 - .. row 5
94
95 - start + 16:
96
97 - Cb\ :sub:`00`
98
99 - Cr\ :sub:`00`
100
101 - Cb\ :sub:`01`
102
103 - Cr\ :sub:`01`
104
105 - .. row 6
106
107 - start + 20:
108
109 - Cb\ :sub:`10`
110
111 - Cr\ :sub:`10`
112
113 - Cb\ :sub:`11`
114
115 - Cr\ :sub:`11`
116
117 - .. row 7
118
119 - start + 24:
120
121 - Cb\ :sub:`20`
122
123 - Cr\ :sub:`20`
124
125 - Cb\ :sub:`21`
126
127 - Cr\ :sub:`21`
128
129 - .. row 8
130
131 - start + 28:
132
133 - Cb\ :sub:`30`
134
135 - Cr\ :sub:`30`
136
137 - Cb\ :sub:`31`
138
139 - Cr\ :sub:`31`
140
141
142**Color Sample Location..**
143
144
145
146.. flat-table::
147 :header-rows: 0
148 :stub-columns: 0
149
150
151 - .. row 1
152
153 -
154 - 0
155
156 -
157 - 1
158
159 - 2
160
161 -
162 - 3
163
164 - .. row 2
165
166 - 0
167
168 - Y
169
170 -
171 - Y
172
173 - Y
174
175 -
176 - Y
177
178 - .. row 3
179
180 -
181 -
182 - C
183
184 -
185 -
186 - C
187
188 -
189
190 - .. row 4
191
192 - 1
193
194 - Y
195
196 -
197 - Y
198
199 - Y
200
201 -
202 - Y
203
204 - .. row 5
205
206 -
207 -
208 - C
209
210 -
211 -
212 - C
213
214 -
215
216 - .. row 6
217
218 -
219
220 - .. row 7
221
222 - 2
223
224 - Y
225
226 -
227 - Y
228
229 - Y
230
231 -
232 - Y
233
234 - .. row 8
235
236 -
237 -
238 - C
239
240 -
241 -
242 - C
243
244 -
245
246 - .. row 9
247
248 - 3
249
250 - Y
251
252 -
253 - Y
254
255 - Y
256
257 -
258 - Y
259
260 - .. row 10
261
262 -
263 -
264 - C
265
266 -
267 -
268 - C
269
270 -
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv16m.rst b/Documentation/media/uapi/v4l/pixfmt-nv16m.rst
new file mode 100644
index 000000000000..b7ee068f491c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv16m.rst
@@ -0,0 +1,277 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV16M:
4.. _v4l2-pix-fmt-nv61m:
5
6********************************************************
7V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')
8********************************************************
9
10*man V4L2_PIX_FMT_NV16M(2)*
11
12V4L2_PIX_FMT_NV61M
13Variation of ``V4L2_PIX_FMT_NV16`` and ``V4L2_PIX_FMT_NV61`` with planes
14non contiguous in memory.
15
16
17Description
18===========
19
20This is a multi-planar, two-plane version of the YUV 4:2:2 format. The
21three components are separated into two sub-images or planes.
22``V4L2_PIX_FMT_NV16M`` differs from ``V4L2_PIX_FMT_NV16`` in that the
23two planes are non-contiguous in memory, i.e. the chroma plane does not
24necessarily immediately follow the luma plane. The luminance data
25occupies the first plane. The Y plane has one byte per pixel. In the
26second plane there is chrominance data with alternating chroma samples.
27The CbCr plane is the same width and height, in bytes, as the Y plane.
28Each CbCr pair belongs to two pixels. For example,
29Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`.
30``V4L2_PIX_FMT_NV61M`` is the same as ``V4L2_PIX_FMT_NV16M`` except the
31Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.
32
33``V4L2_PIX_FMT_NV16M`` and ``V4L2_PIX_FMT_NV61M`` are intended to be
34used only in drivers and applications that support the multi-planar API,
35described in :ref:`planar-apis`.
36
37**Byte Order.**
38Each cell is one byte.
39
40
41
42.. flat-table::
43 :header-rows: 0
44 :stub-columns: 0
45 :widths: 2 1 1 1 1
46
47
48 - .. row 1
49
50 - start0 + 0:
51
52 - Y'\ :sub:`00`
53
54 - Y'\ :sub:`01`
55
56 - Y'\ :sub:`02`
57
58 - Y'\ :sub:`03`
59
60 - .. row 2
61
62 - start0 + 4:
63
64 - Y'\ :sub:`10`
65
66 - Y'\ :sub:`11`
67
68 - Y'\ :sub:`12`
69
70 - Y'\ :sub:`13`
71
72 - .. row 3
73
74 - start0 + 8:
75
76 - Y'\ :sub:`20`
77
78 - Y'\ :sub:`21`
79
80 - Y'\ :sub:`22`
81
82 - Y'\ :sub:`23`
83
84 - .. row 4
85
86 - start0 + 12:
87
88 - Y'\ :sub:`30`
89
90 - Y'\ :sub:`31`
91
92 - Y'\ :sub:`32`
93
94 - Y'\ :sub:`33`
95
96 - .. row 5
97
98 -
99
100 - .. row 6
101
102 - start1 + 0:
103
104 - Cb\ :sub:`00`
105
106 - Cr\ :sub:`00`
107
108 - Cb\ :sub:`02`
109
110 - Cr\ :sub:`02`
111
112 - .. row 7
113
114 - start1 + 4:
115
116 - Cb\ :sub:`10`
117
118 - Cr\ :sub:`10`
119
120 - Cb\ :sub:`12`
121
122 - Cr\ :sub:`12`
123
124 - .. row 8
125
126 - start1 + 8:
127
128 - Cb\ :sub:`20`
129
130 - Cr\ :sub:`20`
131
132 - Cb\ :sub:`22`
133
134 - Cr\ :sub:`22`
135
136 - .. row 9
137
138 - start1 + 12:
139
140 - Cb\ :sub:`30`
141
142 - Cr\ :sub:`30`
143
144 - Cb\ :sub:`32`
145
146 - Cr\ :sub:`32`
147
148
149**Color Sample Location..**
150
151
152
153.. flat-table::
154 :header-rows: 0
155 :stub-columns: 0
156
157
158 - .. row 1
159
160 -
161 - 0
162
163 -
164 - 1
165
166 - 2
167
168 -
169 - 3
170
171 - .. row 2
172
173 - 0
174
175 - Y
176
177 -
178 - Y
179
180 - Y
181
182 -
183 - Y
184
185 - .. row 3
186
187 -
188 -
189 - C
190
191 -
192 -
193 - C
194
195 -
196
197 - .. row 4
198
199 - 1
200
201 - Y
202
203 -
204 - Y
205
206 - Y
207
208 -
209 - Y
210
211 - .. row 5
212
213 -
214 -
215 - C
216
217 -
218 -
219 - C
220
221 -
222
223 - .. row 6
224
225 -
226
227 - .. row 7
228
229 - 2
230
231 - Y
232
233 -
234 - Y
235
236 - Y
237
238 -
239 - Y
240
241 - .. row 8
242
243 -
244 -
245 - C
246
247 -
248 -
249 - C
250
251 -
252
253 - .. row 9
254
255 - 3
256
257 - Y
258
259 -
260 - Y
261
262 - Y
263
264 -
265 - Y
266
267 - .. row 10
268
269 -
270 -
271 - C
272
273 -
274 -
275 - C
276
277 -
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv24.rst b/Documentation/media/uapi/v4l/pixfmt-nv24.rst
new file mode 100644
index 000000000000..db98f476446e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-nv24.rst
@@ -0,0 +1,171 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV24:
4.. _V4L2-PIX-FMT-NV42:
5
6******************************************************
7V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42')
8******************************************************
9
10*man V4L2_PIX_FMT_NV24(2)*
11
12V4L2_PIX_FMT_NV42
13Formats with full horizontal and vertical chroma resolutions, also known
14as YUV 4:4:4. One luminance and one chrominance plane with alternating
15chroma samples as opposed to ``V4L2_PIX_FMT_YVU420``
16
17
18Description
19===========
20
21These are two-plane versions of the YUV 4:4:4 format. The three
22components are separated into two sub-images or planes. The Y plane is
23first, with each Y sample stored in one byte per pixel. For
24``V4L2_PIX_FMT_NV24``, a combined CbCr plane immediately follows the Y
25plane in memory. The CbCr plane has the same width and height, in
26pixels, as the Y plane (and the image). Each line contains one CbCr pair
27per pixel, with each Cb and Cr sample stored in one byte.
28``V4L2_PIX_FMT_NV42`` is the same except that the Cb and Cr samples are
29swapped, the CrCb plane starts with a Cr sample.
30
31If the Y plane has pad bytes after each row, then the CbCr plane has
32twice as many pad bytes after its rows.
33
34**Byte Order.**
35Each cell is one byte.
36
37
38
39.. flat-table::
40 :header-rows: 0
41 :stub-columns: 0
42 :widths: 2 1 1 1 1 1 1 1 1
43
44
45 - .. row 1
46
47 - start + 0:
48
49 - Y'\ :sub:`00`
50
51 - Y'\ :sub:`01`
52
53 - Y'\ :sub:`02`
54
55 - Y'\ :sub:`03`
56
57 - .. row 2
58
59 - start + 4:
60
61 - Y'\ :sub:`10`
62
63 - Y'\ :sub:`11`
64
65 - Y'\ :sub:`12`
66
67 - Y'\ :sub:`13`
68
69 - .. row 3
70
71 - start + 8:
72
73 - Y'\ :sub:`20`
74
75 - Y'\ :sub:`21`
76
77 - Y'\ :sub:`22`
78
79 - Y'\ :sub:`23`
80
81 - .. row 4
82
83 - start + 12:
84
85 - Y'\ :sub:`30`
86
87 - Y'\ :sub:`31`
88
89 - Y'\ :sub:`32`
90
91 - Y'\ :sub:`33`
92
93 - .. row 5
94
95 - start + 16:
96
97 - Cb\ :sub:`00`
98
99 - Cr\ :sub:`00`
100
101 - Cb\ :sub:`01`
102
103 - Cr\ :sub:`01`
104
105 - Cb\ :sub:`02`
106
107 - Cr\ :sub:`02`
108
109 - Cb\ :sub:`03`
110
111 - Cr\ :sub:`03`
112
113 - .. row 6
114
115 - start + 24:
116
117 - Cb\ :sub:`10`
118
119 - Cr\ :sub:`10`
120
121 - Cb\ :sub:`11`
122
123 - Cr\ :sub:`11`
124
125 - Cb\ :sub:`12`
126
127 - Cr\ :sub:`12`
128
129 - Cb\ :sub:`13`
130
131 - Cr\ :sub:`13`
132
133 - .. row 7
134
135 - start + 32:
136
137 - Cb\ :sub:`20`
138
139 - Cr\ :sub:`20`
140
141 - Cb\ :sub:`21`
142
143 - Cr\ :sub:`21`
144
145 - Cb\ :sub:`22`
146
147 - Cr\ :sub:`22`
148
149 - Cb\ :sub:`23`
150
151 - Cr\ :sub:`23`
152
153 - .. row 8
154
155 - start + 40:
156
157 - Cb\ :sub:`30`
158
159 - Cr\ :sub:`30`
160
161 - Cb\ :sub:`31`
162
163 - Cr\ :sub:`31`
164
165 - Cb\ :sub:`32`
166
167 - Cr\ :sub:`32`
168
169 - Cb\ :sub:`33`
170
171 - Cr\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
new file mode 100644
index 000000000000..c7aa2e91ac78
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
@@ -0,0 +1,1469 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _packed-rgb:
4
5******************
6Packed RGB formats
7******************
8
9*man Packed RGB formats(2)*
10
11Packed RGB formats
12
13
14Description
15===========
16
17These formats are designed to match the pixel formats of typical PC
18graphics frame buffers. They occupy 8, 16, 24 or 32 bits per pixel.
19These are all packed-pixel formats, meaning all the data for a pixel lie
20next to each other in memory.
21
22
23.. _rgb-formats:
24
25.. flat-table:: Packed RGB Image Formats
26 :header-rows: 2
27 :stub-columns: 0
28
29
30 - .. row 1
31
32 - Identifier
33
34 - Code
35
36 -
37 - :cspan:`7` Byte 0 in memory
38
39 - :cspan:`7` Byte 1
40
41 - :cspan:`7` Byte 2
42
43 - :cspan:`7` Byte 3
44
45 - .. row 2
46
47 -
48 -
49 - Bit
50
51 - 7
52
53 - 6
54
55 - 5
56
57 - 4
58
59 - 3
60
61 - 2
62
63 - 1
64
65 - 0
66
67 -
68 - 7
69
70 - 6
71
72 - 5
73
74 - 4
75
76 - 3
77
78 - 2
79
80 - 1
81
82 - 0
83
84 -
85 - 7
86
87 - 6
88
89 - 5
90
91 - 4
92
93 - 3
94
95 - 2
96
97 - 1
98
99 - 0
100
101 -
102 - 7
103
104 - 6
105
106 - 5
107
108 - 4
109
110 - 3
111
112 - 2
113
114 - 1
115
116 - 0
117
118 - .. _V4L2-PIX-FMT-RGB332:
119
120 - ``V4L2_PIX_FMT_RGB332``
121
122 - 'RGB1'
123
124 -
125 - r\ :sub:`2`
126
127 - r\ :sub:`1`
128
129 - r\ :sub:`0`
130
131 - g\ :sub:`2`
132
133 - g\ :sub:`1`
134
135 - g\ :sub:`0`
136
137 - b\ :sub:`1`
138
139 - b\ :sub:`0`
140
141 - .. _V4L2-PIX-FMT-ARGB444:
142
143 - ``V4L2_PIX_FMT_ARGB444``
144
145 - 'AR12'
146
147 -
148 - g\ :sub:`3`
149
150 - g\ :sub:`2`
151
152 - g\ :sub:`1`
153
154 - g\ :sub:`0`
155
156 - b\ :sub:`3`
157
158 - b\ :sub:`2`
159
160 - b\ :sub:`1`
161
162 - b\ :sub:`0`
163
164 -
165 - a\ :sub:`3`
166
167 - a\ :sub:`2`
168
169 - a\ :sub:`1`
170
171 - a\ :sub:`0`
172
173 - r\ :sub:`3`
174
175 - r\ :sub:`2`
176
177 - r\ :sub:`1`
178
179 - r\ :sub:`0`
180
181 - .. _V4L2-PIX-FMT-XRGB444:
182
183 - ``V4L2_PIX_FMT_XRGB444``
184
185 - 'XR12'
186
187 -
188 - g\ :sub:`3`
189
190 - g\ :sub:`2`
191
192 - g\ :sub:`1`
193
194 - g\ :sub:`0`
195
196 - b\ :sub:`3`
197
198 - b\ :sub:`2`
199
200 - b\ :sub:`1`
201
202 - b\ :sub:`0`
203
204 -
205 - -
206
207 - -
208
209 - -
210
211 - -
212
213 - r\ :sub:`3`
214
215 - r\ :sub:`2`
216
217 - r\ :sub:`1`
218
219 - r\ :sub:`0`
220
221 - .. _V4L2-PIX-FMT-ARGB555:
222
223 - ``V4L2_PIX_FMT_ARGB555``
224
225 - 'AR15'
226
227 -
228 - g\ :sub:`2`
229
230 - g\ :sub:`1`
231
232 - g\ :sub:`0`
233
234 - b\ :sub:`4`
235
236 - b\ :sub:`3`
237
238 - b\ :sub:`2`
239
240 - b\ :sub:`1`
241
242 - b\ :sub:`0`
243
244 -
245 - a
246
247 - r\ :sub:`4`
248
249 - r\ :sub:`3`
250
251 - r\ :sub:`2`
252
253 - r\ :sub:`1`
254
255 - r\ :sub:`0`
256
257 - g\ :sub:`4`
258
259 - g\ :sub:`3`
260
261 - .. _V4L2-PIX-FMT-XRGB555:
262
263 - ``V4L2_PIX_FMT_XRGB555``
264
265 - 'XR15'
266
267 -
268 - g\ :sub:`2`
269
270 - g\ :sub:`1`
271
272 - g\ :sub:`0`
273
274 - b\ :sub:`4`
275
276 - b\ :sub:`3`
277
278 - b\ :sub:`2`
279
280 - b\ :sub:`1`
281
282 - b\ :sub:`0`
283
284 -
285 - -
286
287 - r\ :sub:`4`
288
289 - r\ :sub:`3`
290
291 - r\ :sub:`2`
292
293 - r\ :sub:`1`
294
295 - r\ :sub:`0`
296
297 - g\ :sub:`4`
298
299 - g\ :sub:`3`
300
301 - .. _V4L2-PIX-FMT-RGB565:
302
303 - ``V4L2_PIX_FMT_RGB565``
304
305 - 'RGBP'
306
307 -
308 - g\ :sub:`2`
309
310 - g\ :sub:`1`
311
312 - g\ :sub:`0`
313
314 - b\ :sub:`4`
315
316 - b\ :sub:`3`
317
318 - b\ :sub:`2`
319
320 - b\ :sub:`1`
321
322 - b\ :sub:`0`
323
324 -
325 - r\ :sub:`4`
326
327 - r\ :sub:`3`
328
329 - r\ :sub:`2`
330
331 - r\ :sub:`1`
332
333 - r\ :sub:`0`
334
335 - g\ :sub:`5`
336
337 - g\ :sub:`4`
338
339 - g\ :sub:`3`
340
341 - .. _V4L2-PIX-FMT-ARGB555X:
342
343 - ``V4L2_PIX_FMT_ARGB555X``
344
345 - 'AR15' | (1 << 31)
346
347 -
348 - a
349
350 - r\ :sub:`4`
351
352 - r\ :sub:`3`
353
354 - r\ :sub:`2`
355
356 - r\ :sub:`1`
357
358 - r\ :sub:`0`
359
360 - g\ :sub:`4`
361
362 - g\ :sub:`3`
363
364 -
365 - g\ :sub:`2`
366
367 - g\ :sub:`1`
368
369 - g\ :sub:`0`
370
371 - b\ :sub:`4`
372
373 - b\ :sub:`3`
374
375 - b\ :sub:`2`
376
377 - b\ :sub:`1`
378
379 - b\ :sub:`0`
380
381 - .. _V4L2-PIX-FMT-XRGB555X:
382
383 - ``V4L2_PIX_FMT_XRGB555X``
384
385 - 'XR15' | (1 << 31)
386
387 -
388 - -
389
390 - r\ :sub:`4`
391
392 - r\ :sub:`3`
393
394 - r\ :sub:`2`
395
396 - r\ :sub:`1`
397
398 - r\ :sub:`0`
399
400 - g\ :sub:`4`
401
402 - g\ :sub:`3`
403
404 -
405 - g\ :sub:`2`
406
407 - g\ :sub:`1`
408
409 - g\ :sub:`0`
410
411 - b\ :sub:`4`
412
413 - b\ :sub:`3`
414
415 - b\ :sub:`2`
416
417 - b\ :sub:`1`
418
419 - b\ :sub:`0`
420
421 - .. _V4L2-PIX-FMT-RGB565X:
422
423 - ``V4L2_PIX_FMT_RGB565X``
424
425 - 'RGBR'
426
427 -
428 - r\ :sub:`4`
429
430 - r\ :sub:`3`
431
432 - r\ :sub:`2`
433
434 - r\ :sub:`1`
435
436 - r\ :sub:`0`
437
438 - g\ :sub:`5`
439
440 - g\ :sub:`4`
441
442 - g\ :sub:`3`
443
444 -
445 - g\ :sub:`2`
446
447 - g\ :sub:`1`
448
449 - g\ :sub:`0`
450
451 - b\ :sub:`4`
452
453 - b\ :sub:`3`
454
455 - b\ :sub:`2`
456
457 - b\ :sub:`1`
458
459 - b\ :sub:`0`
460
461 - .. _V4L2-PIX-FMT-BGR24:
462
463 - ``V4L2_PIX_FMT_BGR24``
464
465 - 'BGR3'
466
467 -
468 - b\ :sub:`7`
469
470 - b\ :sub:`6`
471
472 - b\ :sub:`5`
473
474 - b\ :sub:`4`
475
476 - b\ :sub:`3`
477
478 - b\ :sub:`2`
479
480 - b\ :sub:`1`
481
482 - b\ :sub:`0`
483
484 -
485 - g\ :sub:`7`
486
487 - g\ :sub:`6`
488
489 - g\ :sub:`5`
490
491 - g\ :sub:`4`
492
493 - g\ :sub:`3`
494
495 - g\ :sub:`2`
496
497 - g\ :sub:`1`
498
499 - g\ :sub:`0`
500
501 -
502 - r\ :sub:`7`
503
504 - r\ :sub:`6`
505
506 - r\ :sub:`5`
507
508 - r\ :sub:`4`
509
510 - r\ :sub:`3`
511
512 - r\ :sub:`2`
513
514 - r\ :sub:`1`
515
516 - r\ :sub:`0`
517
518 - .. _V4L2-PIX-FMT-RGB24:
519
520 - ``V4L2_PIX_FMT_RGB24``
521
522 - 'RGB3'
523
524 -
525 - r\ :sub:`7`
526
527 - r\ :sub:`6`
528
529 - r\ :sub:`5`
530
531 - r\ :sub:`4`
532
533 - r\ :sub:`3`
534
535 - r\ :sub:`2`
536
537 - r\ :sub:`1`
538
539 - r\ :sub:`0`
540
541 -
542 - g\ :sub:`7`
543
544 - g\ :sub:`6`
545
546 - g\ :sub:`5`
547
548 - g\ :sub:`4`
549
550 - g\ :sub:`3`
551
552 - g\ :sub:`2`
553
554 - g\ :sub:`1`
555
556 - g\ :sub:`0`
557
558 -
559 - b\ :sub:`7`
560
561 - b\ :sub:`6`
562
563 - b\ :sub:`5`
564
565 - b\ :sub:`4`
566
567 - b\ :sub:`3`
568
569 - b\ :sub:`2`
570
571 - b\ :sub:`1`
572
573 - b\ :sub:`0`
574
575 - .. _V4L2-PIX-FMT-BGR666:
576
577 - ``V4L2_PIX_FMT_BGR666``
578
579 - 'BGRH'
580
581 -
582 - b\ :sub:`5`
583
584 - b\ :sub:`4`
585
586 - b\ :sub:`3`
587
588 - b\ :sub:`2`
589
590 - b\ :sub:`1`
591
592 - b\ :sub:`0`
593
594 - g\ :sub:`5`
595
596 - g\ :sub:`4`
597
598 -
599 - g\ :sub:`3`
600
601 - g\ :sub:`2`
602
603 - g\ :sub:`1`
604
605 - g\ :sub:`0`
606
607 - r\ :sub:`5`
608
609 - r\ :sub:`4`
610
611 - r\ :sub:`3`
612
613 - r\ :sub:`2`
614
615 -
616 - r\ :sub:`1`
617
618 - r\ :sub:`0`
619
620 - -
621
622 - -
623
624 - -
625
626 - -
627
628 - -
629
630 - -
631
632 -
633 - -
634
635 - -
636
637 - -
638
639 - -
640
641 - -
642
643 - -
644
645 - -
646
647 - -
648
649 - .. _V4L2-PIX-FMT-ABGR32:
650
651 - ``V4L2_PIX_FMT_ABGR32``
652
653 - 'AR24'
654
655 -
656 - b\ :sub:`7`
657
658 - b\ :sub:`6`
659
660 - b\ :sub:`5`
661
662 - b\ :sub:`4`
663
664 - b\ :sub:`3`
665
666 - b\ :sub:`2`
667
668 - b\ :sub:`1`
669
670 - b\ :sub:`0`
671
672 -
673 - g\ :sub:`7`
674
675 - g\ :sub:`6`
676
677 - g\ :sub:`5`
678
679 - g\ :sub:`4`
680
681 - g\ :sub:`3`
682
683 - g\ :sub:`2`
684
685 - g\ :sub:`1`
686
687 - g\ :sub:`0`
688
689 -
690 - r\ :sub:`7`
691
692 - r\ :sub:`6`
693
694 - r\ :sub:`5`
695
696 - r\ :sub:`4`
697
698 - r\ :sub:`3`
699
700 - r\ :sub:`2`
701
702 - r\ :sub:`1`
703
704 - r\ :sub:`0`
705
706 -
707 - a\ :sub:`7`
708
709 - a\ :sub:`6`
710
711 - a\ :sub:`5`
712
713 - a\ :sub:`4`
714
715 - a\ :sub:`3`
716
717 - a\ :sub:`2`
718
719 - a\ :sub:`1`
720
721 - a\ :sub:`0`
722
723 - .. _V4L2-PIX-FMT-XBGR32:
724
725 - ``V4L2_PIX_FMT_XBGR32``
726
727 - 'XR24'
728
729 -
730 - b\ :sub:`7`
731
732 - b\ :sub:`6`
733
734 - b\ :sub:`5`
735
736 - b\ :sub:`4`
737
738 - b\ :sub:`3`
739
740 - b\ :sub:`2`
741
742 - b\ :sub:`1`
743
744 - b\ :sub:`0`
745
746 -
747 - g\ :sub:`7`
748
749 - g\ :sub:`6`
750
751 - g\ :sub:`5`
752
753 - g\ :sub:`4`
754
755 - g\ :sub:`3`
756
757 - g\ :sub:`2`
758
759 - g\ :sub:`1`
760
761 - g\ :sub:`0`
762
763 -
764 - r\ :sub:`7`
765
766 - r\ :sub:`6`
767
768 - r\ :sub:`5`
769
770 - r\ :sub:`4`
771
772 - r\ :sub:`3`
773
774 - r\ :sub:`2`
775
776 - r\ :sub:`1`
777
778 - r\ :sub:`0`
779
780 -
781 - -
782
783 - -
784
785 - -
786
787 - -
788
789 - -
790
791 - -
792
793 - -
794
795 - -
796
797 - .. _V4L2-PIX-FMT-ARGB32:
798
799 - ``V4L2_PIX_FMT_ARGB32``
800
801 - 'BA24'
802
803 -
804 - a\ :sub:`7`
805
806 - a\ :sub:`6`
807
808 - a\ :sub:`5`
809
810 - a\ :sub:`4`
811
812 - a\ :sub:`3`
813
814 - a\ :sub:`2`
815
816 - a\ :sub:`1`
817
818 - a\ :sub:`0`
819
820 -
821 - r\ :sub:`7`
822
823 - r\ :sub:`6`
824
825 - r\ :sub:`5`
826
827 - r\ :sub:`4`
828
829 - r\ :sub:`3`
830
831 - r\ :sub:`2`
832
833 - r\ :sub:`1`
834
835 - r\ :sub:`0`
836
837 -
838 - g\ :sub:`7`
839
840 - g\ :sub:`6`
841
842 - g\ :sub:`5`
843
844 - g\ :sub:`4`
845
846 - g\ :sub:`3`
847
848 - g\ :sub:`2`
849
850 - g\ :sub:`1`
851
852 - g\ :sub:`0`
853
854 -
855 - b\ :sub:`7`
856
857 - b\ :sub:`6`
858
859 - b\ :sub:`5`
860
861 - b\ :sub:`4`
862
863 - b\ :sub:`3`
864
865 - b\ :sub:`2`
866
867 - b\ :sub:`1`
868
869 - b\ :sub:`0`
870
871 - .. _V4L2-PIX-FMT-XRGB32:
872
873 - ``V4L2_PIX_FMT_XRGB32``
874
875 - 'BX24'
876
877 -
878 - -
879
880 - -
881
882 - -
883
884 - -
885
886 - -
887
888 - -
889
890 - -
891
892 - -
893
894 -
895 - r\ :sub:`7`
896
897 - r\ :sub:`6`
898
899 - r\ :sub:`5`
900
901 - r\ :sub:`4`
902
903 - r\ :sub:`3`
904
905 - r\ :sub:`2`
906
907 - r\ :sub:`1`
908
909 - r\ :sub:`0`
910
911 -
912 - g\ :sub:`7`
913
914 - g\ :sub:`6`
915
916 - g\ :sub:`5`
917
918 - g\ :sub:`4`
919
920 - g\ :sub:`3`
921
922 - g\ :sub:`2`
923
924 - g\ :sub:`1`
925
926 - g\ :sub:`0`
927
928 -
929 - b\ :sub:`7`
930
931 - b\ :sub:`6`
932
933 - b\ :sub:`5`
934
935 - b\ :sub:`4`
936
937 - b\ :sub:`3`
938
939 - b\ :sub:`2`
940
941 - b\ :sub:`1`
942
943 - b\ :sub:`0`
944
945
946Bit 7 is the most significant bit.
947
948The usage and value of the alpha bits (a) in the ARGB and ABGR formats
949(collectively referred to as alpha formats) depend on the device type
950and hardware operation. :ref:`Capture <capture>` devices (including
951capture queues of mem-to-mem devices) fill the alpha component in
952memory. When the device outputs an alpha channel the alpha component
953will have a meaningful value. Otherwise, when the device doesn't output
954an alpha channel but can set the alpha bit to a user-configurable value,
955the :ref:`V4L2_CID_ALPHA_COMPONENT <v4l2-alpha-component>` control
956is used to specify that alpha value, and the alpha component of all
957pixels will be set to the value specified by that control. Otherwise a
958corresponding format without an alpha component (XRGB or XBGR) must be
959used instead of an alpha format.
960
961:ref:`Output <output>` devices (including output queues of mem-to-mem
962devices and :ref:`video output overlay <osd>` devices) read the alpha
963component from memory. When the device processes the alpha channel the
964alpha component must be filled with meaningful values by applications.
965Otherwise a corresponding format without an alpha component (XRGB or
966XBGR) must be used instead of an alpha format.
967
968The XRGB and XBGR formats contain undefined bits (-). Applications,
969devices and drivers must ignore those bits, for both
970:ref:`capture` and :ref:`output` devices.
971
972**Byte Order.**
973Each cell is one byte.
974
975
976
977.. flat-table::
978 :header-rows: 0
979 :stub-columns: 0
980 :widths: 2 1 1 1 1 1 1 1 1 1 1 1 1
981
982
983 - .. row 1
984
985 - start + 0:
986
987 - B\ :sub:`00`
988
989 - G\ :sub:`00`
990
991 - R\ :sub:`00`
992
993 - B\ :sub:`01`
994
995 - G\ :sub:`01`
996
997 - R\ :sub:`01`
998
999 - B\ :sub:`02`
1000
1001 - G\ :sub:`02`
1002
1003 - R\ :sub:`02`
1004
1005 - B\ :sub:`03`
1006
1007 - G\ :sub:`03`
1008
1009 - R\ :sub:`03`
1010
1011 - .. row 2
1012
1013 - start + 12:
1014
1015 - B\ :sub:`10`
1016
1017 - G\ :sub:`10`
1018
1019 - R\ :sub:`10`
1020
1021 - B\ :sub:`11`
1022
1023 - G\ :sub:`11`
1024
1025 - R\ :sub:`11`
1026
1027 - B\ :sub:`12`
1028
1029 - G\ :sub:`12`
1030
1031 - R\ :sub:`12`
1032
1033 - B\ :sub:`13`
1034
1035 - G\ :sub:`13`
1036
1037 - R\ :sub:`13`
1038
1039 - .. row 3
1040
1041 - start + 24:
1042
1043 - B\ :sub:`20`
1044
1045 - G\ :sub:`20`
1046
1047 - R\ :sub:`20`
1048
1049 - B\ :sub:`21`
1050
1051 - G\ :sub:`21`
1052
1053 - R\ :sub:`21`
1054
1055 - B\ :sub:`22`
1056
1057 - G\ :sub:`22`
1058
1059 - R\ :sub:`22`
1060
1061 - B\ :sub:`23`
1062
1063 - G\ :sub:`23`
1064
1065 - R\ :sub:`23`
1066
1067 - .. row 4
1068
1069 - start + 36:
1070
1071 - B\ :sub:`30`
1072
1073 - G\ :sub:`30`
1074
1075 - R\ :sub:`30`
1076
1077 - B\ :sub:`31`
1078
1079 - G\ :sub:`31`
1080
1081 - R\ :sub:`31`
1082
1083 - B\ :sub:`32`
1084
1085 - G\ :sub:`32`
1086
1087 - R\ :sub:`32`
1088
1089 - B\ :sub:`33`
1090
1091 - G\ :sub:`33`
1092
1093 - R\ :sub:`33`
1094
1095
1096Formats defined in :ref:`rgb-formats-deprecated` are deprecated and
1097must not be used by new drivers. They are documented here for reference.
1098The meaning of their alpha bits (a) is ill-defined and interpreted as in
1099either the corresponding ARGB or XRGB format, depending on the driver.
1100
1101
1102.. _rgb-formats-deprecated:
1103
1104.. flat-table:: Deprecated Packed RGB Image Formats
1105 :header-rows: 2
1106 :stub-columns: 0
1107
1108
1109 - .. row 1
1110
1111 - Identifier
1112
1113 - Code
1114
1115 -
1116 - :cspan:`7` Byte 0 in memory
1117
1118 - :cspan:`7` Byte 1
1119
1120 - :cspan:`7` Byte 2
1121
1122 - :cspan:`7` Byte 3
1123
1124 - .. row 2
1125
1126 -
1127 -
1128 - Bit
1129
1130 - 7
1131
1132 - 6
1133
1134 - 5
1135
1136 - 4
1137
1138 - 3
1139
1140 - 2
1141
1142 - 1
1143
1144 - 0
1145
1146 -
1147 - 7
1148
1149 - 6
1150
1151 - 5
1152
1153 - 4
1154
1155 - 3
1156
1157 - 2
1158
1159 - 1
1160
1161 - 0
1162
1163 -
1164 - 7
1165
1166 - 6
1167
1168 - 5
1169
1170 - 4
1171
1172 - 3
1173
1174 - 2
1175
1176 - 1
1177
1178 - 0
1179
1180 -
1181 - 7
1182
1183 - 6
1184
1185 - 5
1186
1187 - 4
1188
1189 - 3
1190
1191 - 2
1192
1193 - 1
1194
1195 - 0
1196
1197 - .. _V4L2-PIX-FMT-RGB444:
1198
1199 - ``V4L2_PIX_FMT_RGB444``
1200
1201 - 'R444'
1202
1203 -
1204 - g\ :sub:`3`
1205
1206 - g\ :sub:`2`
1207
1208 - g\ :sub:`1`
1209
1210 - g\ :sub:`0`
1211
1212 - b\ :sub:`3`
1213
1214 - b\ :sub:`2`
1215
1216 - b\ :sub:`1`
1217
1218 - b\ :sub:`0`
1219
1220 -
1221 - a\ :sub:`3`
1222
1223 - a\ :sub:`2`
1224
1225 - a\ :sub:`1`
1226
1227 - a\ :sub:`0`
1228
1229 - r\ :sub:`3`
1230
1231 - r\ :sub:`2`
1232
1233 - r\ :sub:`1`
1234
1235 - r\ :sub:`0`
1236
1237 - .. _V4L2-PIX-FMT-RGB555:
1238
1239 - ``V4L2_PIX_FMT_RGB555``
1240
1241 - 'RGBO'
1242
1243 -
1244 - g\ :sub:`2`
1245
1246 - g\ :sub:`1`
1247
1248 - g\ :sub:`0`
1249
1250 - b\ :sub:`4`
1251
1252 - b\ :sub:`3`
1253
1254 - b\ :sub:`2`
1255
1256 - b\ :sub:`1`
1257
1258 - b\ :sub:`0`
1259
1260 -
1261 - a
1262
1263 - r\ :sub:`4`
1264
1265 - r\ :sub:`3`
1266
1267 - r\ :sub:`2`
1268
1269 - r\ :sub:`1`
1270
1271 - r\ :sub:`0`
1272
1273 - g\ :sub:`4`
1274
1275 - g\ :sub:`3`
1276
1277 - .. _V4L2-PIX-FMT-RGB555X:
1278
1279 - ``V4L2_PIX_FMT_RGB555X``
1280
1281 - 'RGBQ'
1282
1283 -
1284 - a
1285
1286 - r\ :sub:`4`
1287
1288 - r\ :sub:`3`
1289
1290 - r\ :sub:`2`
1291
1292 - r\ :sub:`1`
1293
1294 - r\ :sub:`0`
1295
1296 - g\ :sub:`4`
1297
1298 - g\ :sub:`3`
1299
1300 -
1301 - g\ :sub:`2`
1302
1303 - g\ :sub:`1`
1304
1305 - g\ :sub:`0`
1306
1307 - b\ :sub:`4`
1308
1309 - b\ :sub:`3`
1310
1311 - b\ :sub:`2`
1312
1313 - b\ :sub:`1`
1314
1315 - b\ :sub:`0`
1316
1317 - .. _V4L2-PIX-FMT-BGR32:
1318
1319 - ``V4L2_PIX_FMT_BGR32``
1320
1321 - 'BGR4'
1322
1323 -
1324 - b\ :sub:`7`
1325
1326 - b\ :sub:`6`
1327
1328 - b\ :sub:`5`
1329
1330 - b\ :sub:`4`
1331
1332 - b\ :sub:`3`
1333
1334 - b\ :sub:`2`
1335
1336 - b\ :sub:`1`
1337
1338 - b\ :sub:`0`
1339
1340 -
1341 - g\ :sub:`7`
1342
1343 - g\ :sub:`6`
1344
1345 - g\ :sub:`5`
1346
1347 - g\ :sub:`4`
1348
1349 - g\ :sub:`3`
1350
1351 - g\ :sub:`2`
1352
1353 - g\ :sub:`1`
1354
1355 - g\ :sub:`0`
1356
1357 -
1358 - r\ :sub:`7`
1359
1360 - r\ :sub:`6`
1361
1362 - r\ :sub:`5`
1363
1364 - r\ :sub:`4`
1365
1366 - r\ :sub:`3`
1367
1368 - r\ :sub:`2`
1369
1370 - r\ :sub:`1`
1371
1372 - r\ :sub:`0`
1373
1374 -
1375 - a\ :sub:`7`
1376
1377 - a\ :sub:`6`
1378
1379 - a\ :sub:`5`
1380
1381 - a\ :sub:`4`
1382
1383 - a\ :sub:`3`
1384
1385 - a\ :sub:`2`
1386
1387 - a\ :sub:`1`
1388
1389 - a\ :sub:`0`
1390
1391 - .. _V4L2-PIX-FMT-RGB32:
1392
1393 - ``V4L2_PIX_FMT_RGB32``
1394
1395 - 'RGB4'
1396
1397 -
1398 - a\ :sub:`7`
1399
1400 - a\ :sub:`6`
1401
1402 - a\ :sub:`5`
1403
1404 - a\ :sub:`4`
1405
1406 - a\ :sub:`3`
1407
1408 - a\ :sub:`2`
1409
1410 - a\ :sub:`1`
1411
1412 - a\ :sub:`0`
1413
1414 -
1415 - r\ :sub:`7`
1416
1417 - r\ :sub:`6`
1418
1419 - r\ :sub:`5`
1420
1421 - r\ :sub:`4`
1422
1423 - r\ :sub:`3`
1424
1425 - r\ :sub:`2`
1426
1427 - r\ :sub:`1`
1428
1429 - r\ :sub:`0`
1430
1431 -
1432 - g\ :sub:`7`
1433
1434 - g\ :sub:`6`
1435
1436 - g\ :sub:`5`
1437
1438 - g\ :sub:`4`
1439
1440 - g\ :sub:`3`
1441
1442 - g\ :sub:`2`
1443
1444 - g\ :sub:`1`
1445
1446 - g\ :sub:`0`
1447
1448 -
1449 - b\ :sub:`7`
1450
1451 - b\ :sub:`6`
1452
1453 - b\ :sub:`5`
1454
1455 - b\ :sub:`4`
1456
1457 - b\ :sub:`3`
1458
1459 - b\ :sub:`2`
1460
1461 - b\ :sub:`1`
1462
1463 - b\ :sub:`0`
1464
1465
1466A test utility to determine which RGB formats a driver actually supports
1467is available from the LinuxTV v4l-dvb repository. See
1468`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
1469instructions.
diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst b/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst
new file mode 100644
index 000000000000..54716455f453
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst
@@ -0,0 +1,316 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _packed-yuv:
4
5******************
6Packed YUV formats
7******************
8
9*man Packed YUV formats(2)*
10
11Packed YUV formats
12
13
14Description
15===========
16
17Similar to the packed RGB formats these formats store the Y, Cb and Cr
18component of each pixel in one 16 or 32 bit word.
19
20
21
22.. flat-table:: Packed YUV Image Formats
23 :header-rows: 2
24 :stub-columns: 0
25
26
27 - .. row 1
28
29 - Identifier
30
31 - Code
32
33 -
34 - :cspan:`7` Byte 0 in memory
35
36 -
37 - :cspan:`7` Byte 1
38
39 -
40 - :cspan:`7` Byte 2
41
42 -
43 - :cspan:`7` Byte 3
44
45 - .. row 2
46
47 -
48 -
49 - Bit
50
51 - 7
52
53 - 6
54
55 - 5
56
57 - 4
58
59 - 3
60
61 - 2
62
63 - 1
64
65 - 0
66
67 -
68 - 7
69
70 - 6
71
72 - 5
73
74 - 4
75
76 - 3
77
78 - 2
79
80 - 1
81
82 - 0
83
84 -
85 - 7
86
87 - 6
88
89 - 5
90
91 - 4
92
93 - 3
94
95 - 2
96
97 - 1
98
99 - 0
100
101 -
102 - 7
103
104 - 6
105
106 - 5
107
108 - 4
109
110 - 3
111
112 - 2
113
114 - 1
115
116 - 0
117
118 - .. _V4L2-PIX-FMT-YUV444:
119
120 - ``V4L2_PIX_FMT_YUV444``
121
122 - 'Y444'
123
124 -
125 - Cb\ :sub:`3`
126
127 - Cb\ :sub:`2`
128
129 - Cb\ :sub:`1`
130
131 - Cb\ :sub:`0`
132
133 - Cr\ :sub:`3`
134
135 - Cr\ :sub:`2`
136
137 - Cr\ :sub:`1`
138
139 - Cr\ :sub:`0`
140
141 -
142 - a\ :sub:`3`
143
144 - a\ :sub:`2`
145
146 - a\ :sub:`1`
147
148 - a\ :sub:`0`
149
150 - Y'\ :sub:`3`
151
152 - Y'\ :sub:`2`
153
154 - Y'\ :sub:`1`
155
156 - Y'\ :sub:`0`
157
158 - .. _V4L2-PIX-FMT-YUV555:
159
160 - ``V4L2_PIX_FMT_YUV555``
161
162 - 'YUVO'
163
164 -
165 - Cb\ :sub:`2`
166
167 - Cb\ :sub:`1`
168
169 - Cb\ :sub:`0`
170
171 - Cr\ :sub:`4`
172
173 - Cr\ :sub:`3`
174
175 - Cr\ :sub:`2`
176
177 - Cr\ :sub:`1`
178
179 - Cr\ :sub:`0`
180
181 -
182 - a
183
184 - Y'\ :sub:`4`
185
186 - Y'\ :sub:`3`
187
188 - Y'\ :sub:`2`
189
190 - Y'\ :sub:`1`
191
192 - Y'\ :sub:`0`
193
194 - Cb\ :sub:`4`
195
196 - Cb\ :sub:`3`
197
198 - .. _V4L2-PIX-FMT-YUV565:
199
200 - ``V4L2_PIX_FMT_YUV565``
201
202 - 'YUVP'
203
204 -
205 - Cb\ :sub:`2`
206
207 - Cb\ :sub:`1`
208
209 - Cb\ :sub:`0`
210
211 - Cr\ :sub:`4`
212
213 - Cr\ :sub:`3`
214
215 - Cr\ :sub:`2`
216
217 - Cr\ :sub:`1`
218
219 - Cr\ :sub:`0`
220
221 -
222 - Y'\ :sub:`4`
223
224 - Y'\ :sub:`3`
225
226 - Y'\ :sub:`2`
227
228 - Y'\ :sub:`1`
229
230 - Y'\ :sub:`0`
231
232 - Cb\ :sub:`5`
233
234 - Cb\ :sub:`4`
235
236 - Cb\ :sub:`3`
237
238 - .. _V4L2-PIX-FMT-YUV32:
239
240 - ``V4L2_PIX_FMT_YUV32``
241
242 - 'YUV4'
243
244 -
245 - a\ :sub:`7`
246
247 - a\ :sub:`6`
248
249 - a\ :sub:`5`
250
251 - a\ :sub:`4`
252
253 - a\ :sub:`3`
254
255 - a\ :sub:`2`
256
257 - a\ :sub:`1`
258
259 - a\ :sub:`0`
260
261 -
262 - Y'\ :sub:`7`
263
264 - Y'\ :sub:`6`
265
266 - Y'\ :sub:`5`
267
268 - Y'\ :sub:`4`
269
270 - Y'\ :sub:`3`
271
272 - Y'\ :sub:`2`
273
274 - Y'\ :sub:`1`
275
276 - Y'\ :sub:`0`
277
278 -
279 - Cb\ :sub:`7`
280
281 - Cb\ :sub:`6`
282
283 - Cb\ :sub:`5`
284
285 - Cb\ :sub:`4`
286
287 - Cb\ :sub:`3`
288
289 - Cb\ :sub:`2`
290
291 - Cb\ :sub:`1`
292
293 - Cb\ :sub:`0`
294
295 -
296 - Cr\ :sub:`7`
297
298 - Cr\ :sub:`6`
299
300 - Cr\ :sub:`5`
301
302 - Cr\ :sub:`4`
303
304 - Cr\ :sub:`3`
305
306 - Cr\ :sub:`2`
307
308 - Cr\ :sub:`1`
309
310 - Cr\ :sub:`0`
311
312
313Bit 7 is the most significant bit. The value of a = alpha bits is
314undefined when reading from the driver, ignored when writing to the
315driver, except when alpha blending has been negotiated for a
316:ref:`Video Overlay <overlay>` or :ref:`Video Output Overlay <osd>`.
diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
new file mode 100644
index 000000000000..9a5704baf9fe
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
@@ -0,0 +1,360 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _pixfmt-reserved:
4
5***************************
6Reserved Format Identifiers
7***************************
8
9These formats are not defined by this specification, they are just
10listed for reference and to avoid naming conflicts. If you want to
11register your own format, send an e-mail to the linux-media mailing list
12`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__
13for inclusion in the ``videodev2.h`` file. If you want to share your
14format with other developers add a link to your documentation and send a
15copy to the linux-media mailing list for inclusion in this section. If
16you think your format should be listed in a standard format section
17please make a proposal on the linux-media mailing list.
18
19
20.. _reserved-formats:
21
22.. flat-table:: Reserved Image Formats
23 :header-rows: 1
24 :stub-columns: 0
25 :widths: 3 1 4
26
27
28 - .. row 1
29
30 - Identifier
31
32 - Code
33
34 - Details
35
36 - .. _V4L2-PIX-FMT-DV:
37
38 - ``V4L2_PIX_FMT_DV``
39
40 - 'dvsd'
41
42 - unknown
43
44 - .. _V4L2-PIX-FMT-ET61X251:
45
46 - ``V4L2_PIX_FMT_ET61X251``
47
48 - 'E625'
49
50 - Compressed format of the ET61X251 driver.
51
52 - .. _V4L2-PIX-FMT-HI240:
53
54 - ``V4L2_PIX_FMT_HI240``
55
56 - 'HI24'
57
58 - 8 bit RGB format used by the BTTV driver.
59
60 - .. _V4L2-PIX-FMT-HM12:
61
62 - ``V4L2_PIX_FMT_HM12``
63
64 - 'HM12'
65
66 - YUV 4:2:0 format used by the IVTV driver,
67 `http://www.ivtvdriver.org/ <http://www.ivtvdriver.org/>`__
68
69 The format is documented in the kernel sources in the file
70 ``Documentation/video4linux/cx2341x/README.hm12``
71
72 - .. _V4L2-PIX-FMT-CPIA1:
73
74 - ``V4L2_PIX_FMT_CPIA1``
75
76 - 'CPIA'
77
78 - YUV format used by the gspca cpia1 driver.
79
80 - .. _V4L2-PIX-FMT-JPGL:
81
82 - ``V4L2_PIX_FMT_JPGL``
83
84 - 'JPGL'
85
86 - JPEG-Light format (Pegasus Lossless JPEG) used in Divio webcams NW
87 80x.
88
89 - .. _V4L2-PIX-FMT-SPCA501:
90
91 - ``V4L2_PIX_FMT_SPCA501``
92
93 - 'S501'
94
95 - YUYV per line used by the gspca driver.
96
97 - .. _V4L2-PIX-FMT-SPCA505:
98
99 - ``V4L2_PIX_FMT_SPCA505``
100
101 - 'S505'
102
103 - YYUV per line used by the gspca driver.
104
105 - .. _V4L2-PIX-FMT-SPCA508:
106
107 - ``V4L2_PIX_FMT_SPCA508``
108
109 - 'S508'
110
111 - YUVY per line used by the gspca driver.
112
113 - .. _V4L2-PIX-FMT-SPCA561:
114
115 - ``V4L2_PIX_FMT_SPCA561``
116
117 - 'S561'
118
119 - Compressed GBRG Bayer format used by the gspca driver.
120
121 - .. _V4L2-PIX-FMT-PAC207:
122
123 - ``V4L2_PIX_FMT_PAC207``
124
125 - 'P207'
126
127 - Compressed BGGR Bayer format used by the gspca driver.
128
129 - .. _V4L2-PIX-FMT-MR97310A:
130
131 - ``V4L2_PIX_FMT_MR97310A``
132
133 - 'M310'
134
135 - Compressed BGGR Bayer format used by the gspca driver.
136
137 - .. _V4L2-PIX-FMT-JL2005BCD:
138
139 - ``V4L2_PIX_FMT_JL2005BCD``
140
141 - 'JL20'
142
143 - JPEG compressed RGGB Bayer format used by the gspca driver.
144
145 - .. _V4L2-PIX-FMT-OV511:
146
147 - ``V4L2_PIX_FMT_OV511``
148
149 - 'O511'
150
151 - OV511 JPEG format used by the gspca driver.
152
153 - .. _V4L2-PIX-FMT-OV518:
154
155 - ``V4L2_PIX_FMT_OV518``
156
157 - 'O518'
158
159 - OV518 JPEG format used by the gspca driver.
160
161 - .. _V4L2-PIX-FMT-PJPG:
162
163 - ``V4L2_PIX_FMT_PJPG``
164
165 - 'PJPG'
166
167 - Pixart 73xx JPEG format used by the gspca driver.
168
169 - .. _V4L2-PIX-FMT-SE401:
170
171 - ``V4L2_PIX_FMT_SE401``
172
173 - 'S401'
174
175 - Compressed RGB format used by the gspca se401 driver
176
177 - .. _V4L2-PIX-FMT-SQ905C:
178
179 - ``V4L2_PIX_FMT_SQ905C``
180
181 - '905C'
182
183 - Compressed RGGB bayer format used by the gspca driver.
184
185 - .. _V4L2-PIX-FMT-MJPEG:
186
187 - ``V4L2_PIX_FMT_MJPEG``
188
189 - 'MJPG'
190
191 - Compressed format used by the Zoran driver
192
193 - .. _V4L2-PIX-FMT-PWC1:
194
195 - ``V4L2_PIX_FMT_PWC1``
196
197 - 'PWC1'
198
199 - Compressed format of the PWC driver.
200
201 - .. _V4L2-PIX-FMT-PWC2:
202
203 - ``V4L2_PIX_FMT_PWC2``
204
205 - 'PWC2'
206
207 - Compressed format of the PWC driver.
208
209 - .. _V4L2-PIX-FMT-SN9C10X:
210
211 - ``V4L2_PIX_FMT_SN9C10X``
212
213 - 'S910'
214
215 - Compressed format of the SN9C102 driver.
216
217 - .. _V4L2-PIX-FMT-SN9C20X-I420:
218
219 - ``V4L2_PIX_FMT_SN9C20X_I420``
220
221 - 'S920'
222
223 - YUV 4:2:0 format of the gspca sn9c20x driver.
224
225 - .. _V4L2-PIX-FMT-SN9C2028:
226
227 - ``V4L2_PIX_FMT_SN9C2028``
228
229 - 'SONX'
230
231 - Compressed GBRG bayer format of the gspca sn9c2028 driver.
232
233 - .. _V4L2-PIX-FMT-STV0680:
234
235 - ``V4L2_PIX_FMT_STV0680``
236
237 - 'S680'
238
239 - Bayer format of the gspca stv0680 driver.
240
241 - .. _V4L2-PIX-FMT-WNVA:
242
243 - ``V4L2_PIX_FMT_WNVA``
244
245 - 'WNVA'
246
247 - Used by the Winnov Videum driver,
248 `http://www.thedirks.org/winnov/ <http://www.thedirks.org/winnov/>`__
249
250 - .. _V4L2-PIX-FMT-TM6000:
251
252 - ``V4L2_PIX_FMT_TM6000``
253
254 - 'TM60'
255
256 - Used by Trident tm6000
257
258 - .. _V4L2-PIX-FMT-CIT-YYVYUY:
259
260 - ``V4L2_PIX_FMT_CIT_YYVYUY``
261
262 - 'CITV'
263
264 - Used by xirlink CIT, found at IBM webcams.
265
266 Uses one line of Y then 1 line of VYUY
267
268 - .. _V4L2-PIX-FMT-KONICA420:
269
270 - ``V4L2_PIX_FMT_KONICA420``
271
272 - 'KONI'
273
274 - Used by Konica webcams.
275
276 YUV420 planar in blocks of 256 pixels.
277
278 - .. _V4L2-PIX-FMT-YYUV:
279
280 - ``V4L2_PIX_FMT_YYUV``
281
282 - 'YYUV'
283
284 - unknown
285
286 - .. _V4L2-PIX-FMT-Y4:
287
288 - ``V4L2_PIX_FMT_Y4``
289
290 - 'Y04 '
291
292 - Old 4-bit greyscale format. Only the most significant 4 bits of
293 each byte are used, the other bits are set to 0.
294
295 - .. _V4L2-PIX-FMT-Y6:
296
297 - ``V4L2_PIX_FMT_Y6``
298
299 - 'Y06 '
300
301 - Old 6-bit greyscale format. Only the most significant 6 bits of
302 each byte are used, the other bits are set to 0.
303
304 - .. _V4L2-PIX-FMT-S5C-UYVY-JPG:
305
306 - ``V4L2_PIX_FMT_S5C_UYVY_JPG``
307
308 - 'S5CI'
309
310 - Two-planar format used by Samsung S5C73MX cameras. The first plane
311 contains interleaved JPEG and UYVY image data, followed by meta
312 data in form of an array of offsets to the UYVY data blocks. The
313 actual pointer array follows immediately the interleaved JPEG/UYVY
314 data, the number of entries in this array equals the height of the
315 UYVY image. Each entry is a 4-byte unsigned integer in big endian
316 order and it's an offset to a single pixel line of the UYVY image.
317 The first plane can start either with JPEG or UYVY data chunk. The
318 size of a single UYVY block equals the UYVY image's width
319 multiplied by 2. The size of a JPEG chunk depends on the image and
320 can vary with each line.
321
322 The second plane, at an offset of 4084 bytes, contains a 4-byte
323 offset to the pointer array in the first plane. This offset is
324 followed by a 4-byte value indicating size of the pointer array.
325 All numbers in the second plane are also in big endian order.
326 Remaining data in the second plane is undefined. The information
327 in the second plane allows to easily find location of the pointer
328 array, which can be different for each frame. The size of the
329 pointer array is constant for given UYVY image height.
330
331 In order to extract UYVY and JPEG frames an application can
332 initially set a data pointer to the start of first plane and then
333 add an offset from the first entry of the pointers table. Such a
334 pointer indicates start of an UYVY image pixel line. Whole UYVY
335 line can be copied to a separate buffer. These steps should be
336 repeated for each line, i.e. the number of entries in the pointer
337 array. Anything what's in between the UYVY lines is JPEG data and
338 should be concatenated to form the JPEG stream.
339
340
341
342.. _format-flags:
343
344.. flat-table:: Format Flags
345 :header-rows: 0
346 :stub-columns: 0
347 :widths: 3 1 4
348
349
350 - .. row 1
351
352 - ``V4L2_PIX_FMT_FLAG_PREMUL_ALPHA``
353
354 - 0x00000001
355
356 - The color values are premultiplied by the alpha channel value. For
357 example, if a light blue pixel with 50% transparency was described
358 by RGBA values (128, 192, 255, 128), the same pixel described with
359 premultiplied colors would be described by RGBA values (64, 96,
360 128, 128)
diff --git a/Documentation/media/uapi/v4l/pixfmt-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-rgb.rst
new file mode 100644
index 000000000000..4b3651cc0a96
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-rgb.rst
@@ -0,0 +1,23 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _pixfmt-rgb:
4
5***********
6RGB Formats
7***********
8
9
10.. toctree::
11 :maxdepth: 1
12
13 pixfmt-packed-rgb
14 pixfmt-sbggr8
15 pixfmt-sgbrg8
16 pixfmt-sgrbg8
17 pixfmt-srggb8
18 pixfmt-sbggr16
19 pixfmt-srggb10
20 pixfmt-srggb10p
21 pixfmt-srggb10alaw8
22 pixfmt-srggb10dpcm8
23 pixfmt-srggb12
diff --git a/Documentation/media/uapi/v4l/pixfmt-sbggr16.rst b/Documentation/media/uapi/v4l/pixfmt-sbggr16.rst
new file mode 100644
index 000000000000..14446ed7f650
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sbggr16.rst
@@ -0,0 +1,114 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SBGGR16:
4
5*****************************
6V4L2_PIX_FMT_SBGGR16 ('BYR2')
7*****************************
8
9*man V4L2_PIX_FMT_SBGGR16(2)*
10
11Bayer RGB format
12
13
14Description
15===========
16
17This format is similar to
18:ref:`V4L2_PIX_FMT_SBGGR8 <V4L2-PIX-FMT-SBGGR8>`, except each pixel
19has a depth of 16 bits. The least significant byte is stored at lower
20memory addresses (little-endian).
21
22..note:: The actual sampling precision may be lower than 16 bits,
23 for example 10 bits per pixel with values in tange 0 to 1023.
24
25**Byte Order.**
26Each cell is one byte.
27
28
29
30.. flat-table::
31 :header-rows: 0
32 :stub-columns: 0
33 :widths: 2 1 1 1 1 1 1 1 1
34
35
36 - .. row 1
37
38 - start + 0:
39
40 - B\ :sub:`00low`
41
42 - B\ :sub:`00high`
43
44 - G\ :sub:`01low`
45
46 - G\ :sub:`01high`
47
48 - B\ :sub:`02low`
49
50 - B\ :sub:`02high`
51
52 - G\ :sub:`03low`
53
54 - G\ :sub:`03high`
55
56 - .. row 2
57
58 - start + 8:
59
60 - G\ :sub:`10low`
61
62 - G\ :sub:`10high`
63
64 - R\ :sub:`11low`
65
66 - R\ :sub:`11high`
67
68 - G\ :sub:`12low`
69
70 - G\ :sub:`12high`
71
72 - R\ :sub:`13low`
73
74 - R\ :sub:`13high`
75
76 - .. row 3
77
78 - start + 16:
79
80 - B\ :sub:`20low`
81
82 - B\ :sub:`20high`
83
84 - G\ :sub:`21low`
85
86 - G\ :sub:`21high`
87
88 - B\ :sub:`22low`
89
90 - B\ :sub:`22high`
91
92 - G\ :sub:`23low`
93
94 - G\ :sub:`23high`
95
96 - .. row 4
97
98 - start + 24:
99
100 - G\ :sub:`30low`
101
102 - G\ :sub:`30high`
103
104 - R\ :sub:`31low`
105
106 - R\ :sub:`31high`
107
108 - G\ :sub:`32low`
109
110 - G\ :sub:`32high`
111
112 - R\ :sub:`33low`
113
114 - R\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sbggr8.rst b/Documentation/media/uapi/v4l/pixfmt-sbggr8.rst
new file mode 100644
index 000000000000..db4c523f49a9
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sbggr8.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SBGGR8:
4
5****************************
6V4L2_PIX_FMT_SBGGR8 ('BA81')
7****************************
8
9*man V4L2_PIX_FMT_SBGGR8(2)*
10
11Bayer RGB format
12
13
14Description
15===========
16
17This is commonly the native format of digital cameras, reflecting the
18arrangement of sensors on the CCD device. Only one red, green or blue
19value is given for each pixel. Missing components must be interpolated
20from neighbouring pixels. From left to right the first row consists of a
21blue and green value, the second row of a green and red value. This
22scheme repeats to the right and down for every two columns and rows.
23
24**Byte Order.**
25Each cell is one byte.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1
33
34
35 - .. row 1
36
37 - start + 0:
38
39 - B\ :sub:`00`
40
41 - G\ :sub:`01`
42
43 - B\ :sub:`02`
44
45 - G\ :sub:`03`
46
47 - .. row 2
48
49 - start + 4:
50
51 - G\ :sub:`10`
52
53 - R\ :sub:`11`
54
55 - G\ :sub:`12`
56
57 - R\ :sub:`13`
58
59 - .. row 3
60
61 - start + 8:
62
63 - B\ :sub:`20`
64
65 - G\ :sub:`21`
66
67 - B\ :sub:`22`
68
69 - G\ :sub:`23`
70
71 - .. row 4
72
73 - start + 12:
74
75 - G\ :sub:`30`
76
77 - R\ :sub:`31`
78
79 - G\ :sub:`32`
80
81 - R\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-cs08.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-cs08.rst
new file mode 100644
index 000000000000..2736275d080f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-cs08.rst
@@ -0,0 +1,43 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-sdr-fmt-cs8:
4
5*************************
6V4L2_SDR_FMT_CS8 ('CS08')
7*************************
8
9*man V4L2_SDR_FMT_CS8(2)*
10
11Complex signed 8-bit IQ sample
12
13
14Description
15===========
16
17This format contains sequence of complex number samples. Each complex
18number consist two parts, called In-phase and Quadrature (IQ). Both I
19and Q are represented as a 8 bit signed number. I value comes first and
20Q value after that.
21
22**Byte Order.**
23Each cell is one byte.
24
25
26
27.. flat-table::
28 :header-rows: 0
29 :stub-columns: 0
30 :widths: 2 1
31
32
33 - .. row 1
34
35 - start + 0:
36
37 - I'\ :sub:`0`
38
39 - .. row 2
40
41 - start + 1:
42
43 - Q'\ :sub:`0`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-cs14le.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-cs14le.rst
new file mode 100644
index 000000000000..bfe5804bd84e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-cs14le.rst
@@ -0,0 +1,48 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-SDR-FMT-CS14LE:
4
5****************************
6V4L2_SDR_FMT_CS14LE ('CS14')
7****************************
8
9*man V4L2_SDR_FMT_CS14LE(2)*
10
11Complex signed 14-bit little endian IQ sample
12
13
14Description
15===========
16
17This format contains sequence of complex number samples. Each complex
18number consist two parts, called In-phase and Quadrature (IQ). Both I
19and Q are represented as a 14 bit signed little endian number. I value
20comes first and Q value after that. 14 bit value is stored in 16 bit
21space with unused high bits padded with 0.
22
23**Byte Order.**
24Each cell is one byte.
25
26
27
28.. flat-table::
29 :header-rows: 0
30 :stub-columns: 0
31 :widths: 2 1 1
32
33
34 - .. row 1
35
36 - start + 0:
37
38 - I'\ :sub:`0[7:0]`
39
40 - I'\ :sub:`0[13:8]`
41
42 - .. row 2
43
44 - start + 2:
45
46 - Q'\ :sub:`0[7:0]`
47
48 - Q'\ :sub:`0[13:8]`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-cu08.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-cu08.rst
new file mode 100644
index 000000000000..68ad1717f6d7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-cu08.rst
@@ -0,0 +1,43 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-sdr-fmt-cu8:
4
5*************************
6V4L2_SDR_FMT_CU8 ('CU08')
7*************************
8
9*man V4L2_SDR_FMT_CU8(2)*
10
11Complex unsigned 8-bit IQ sample
12
13
14Description
15===========
16
17This format contains sequence of complex number samples. Each complex
18number consist two parts, called In-phase and Quadrature (IQ). Both I
19and Q are represented as a 8 bit unsigned number. I value comes first
20and Q value after that.
21
22**Byte Order.**
23Each cell is one byte.
24
25
26
27.. flat-table::
28 :header-rows: 0
29 :stub-columns: 0
30 :widths: 2 1
31
32
33 - .. row 1
34
35 - start + 0:
36
37 - I'\ :sub:`0`
38
39 - .. row 2
40
41 - start + 1:
42
43 - Q'\ :sub:`0`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-cu16le.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-cu16le.rst
new file mode 100644
index 000000000000..2a1c0d4924a1
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-cu16le.rst
@@ -0,0 +1,47 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-SDR-FMT-CU16LE:
4
5****************************
6V4L2_SDR_FMT_CU16LE ('CU16')
7****************************
8
9*man V4L2_SDR_FMT_CU16LE(2)*
10
11Complex unsigned 16-bit little endian IQ sample
12
13
14Description
15===========
16
17This format contains sequence of complex number samples. Each complex
18number consist two parts, called In-phase and Quadrature (IQ). Both I
19and Q are represented as a 16 bit unsigned little endian number. I value
20comes first and Q value after that.
21
22**Byte Order.**
23Each cell is one byte.
24
25
26
27.. flat-table::
28 :header-rows: 0
29 :stub-columns: 0
30 :widths: 2 1 1
31
32
33 - .. row 1
34
35 - start + 0:
36
37 - I'\ :sub:`0[7:0]`
38
39 - I'\ :sub:`0[15:8]`
40
41 - .. row 2
42
43 - start + 2:
44
45 - Q'\ :sub:`0[7:0]`
46
47 - Q'\ :sub:`0[15:8]`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-ru12le.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-ru12le.rst
new file mode 100644
index 000000000000..378581b27d4a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-ru12le.rst
@@ -0,0 +1,38 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-SDR-FMT-RU12LE:
4
5****************************
6V4L2_SDR_FMT_RU12LE ('RU12')
7****************************
8
9*man V4L2_SDR_FMT_RU12LE(2)*
10
11Real unsigned 12-bit little endian sample
12
13
14Description
15===========
16
17This format contains sequence of real number samples. Each sample is
18represented as a 12 bit unsigned little endian number. Sample is stored
19in 16 bit space with unused high bits padded with 0.
20
21**Byte Order.**
22Each cell is one byte.
23
24
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - I'\ :sub:`0[7:0]`
37
38 - I'\ :sub:`0[11:8]`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sgbrg8.rst b/Documentation/media/uapi/v4l/pixfmt-sgbrg8.rst
new file mode 100644
index 000000000000..6345c24d86f3
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sgbrg8.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SGBRG8:
4
5****************************
6V4L2_PIX_FMT_SGBRG8 ('GBRG')
7****************************
8
9*man V4L2_PIX_FMT_SGBRG8(2)*
10
11Bayer RGB format
12
13
14Description
15===========
16
17This is commonly the native format of digital cameras, reflecting the
18arrangement of sensors on the CCD device. Only one red, green or blue
19value is given for each pixel. Missing components must be interpolated
20from neighbouring pixels. From left to right the first row consists of a
21green and blue value, the second row of a red and green value. This
22scheme repeats to the right and down for every two columns and rows.
23
24**Byte Order.**
25Each cell is one byte.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1
33
34
35 - .. row 1
36
37 - start + 0:
38
39 - G\ :sub:`00`
40
41 - B\ :sub:`01`
42
43 - G\ :sub:`02`
44
45 - B\ :sub:`03`
46
47 - .. row 2
48
49 - start + 4:
50
51 - R\ :sub:`10`
52
53 - G\ :sub:`11`
54
55 - R\ :sub:`12`
56
57 - G\ :sub:`13`
58
59 - .. row 3
60
61 - start + 8:
62
63 - G\ :sub:`20`
64
65 - B\ :sub:`21`
66
67 - G\ :sub:`22`
68
69 - B\ :sub:`23`
70
71 - .. row 4
72
73 - start + 12:
74
75 - R\ :sub:`30`
76
77 - G\ :sub:`31`
78
79 - R\ :sub:`32`
80
81 - G\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-sgrbg8.rst b/Documentation/media/uapi/v4l/pixfmt-sgrbg8.rst
new file mode 100644
index 000000000000..51b7b8ef7519
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sgrbg8.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SGRBG8:
4
5****************************
6V4L2_PIX_FMT_SGRBG8 ('GRBG')
7****************************
8
9*man V4L2_PIX_FMT_SGRBG8(2)*
10
11Bayer RGB format
12
13
14Description
15===========
16
17This is commonly the native format of digital cameras, reflecting the
18arrangement of sensors on the CCD device. Only one red, green or blue
19value is given for each pixel. Missing components must be interpolated
20from neighbouring pixels. From left to right the first row consists of a
21green and blue value, the second row of a red and green value. This
22scheme repeats to the right and down for every two columns and rows.
23
24**Byte Order.**
25Each cell is one byte.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1
33
34
35 - .. row 1
36
37 - start + 0:
38
39 - G\ :sub:`00`
40
41 - R\ :sub:`01`
42
43 - G\ :sub:`02`
44
45 - R\ :sub:`03`
46
47 - .. row 2
48
49 - start + 4:
50
51 - B\ :sub:`10`
52
53 - G\ :sub:`11`
54
55 - B\ :sub:`12`
56
57 - G\ :sub:`13`
58
59 - .. row 3
60
61 - start + 8:
62
63 - G\ :sub:`20`
64
65 - R\ :sub:`21`
66
67 - G\ :sub:`22`
68
69 - R\ :sub:`23`
70
71 - .. row 4
72
73 - start + 12:
74
75 - B\ :sub:`30`
76
77 - G\ :sub:`31`
78
79 - B\ :sub:`32`
80
81 - G\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb10.rst b/Documentation/media/uapi/v4l/pixfmt-srggb10.rst
new file mode 100644
index 000000000000..44a49563917c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb10.rst
@@ -0,0 +1,120 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SRGGB10:
4.. _v4l2-pix-fmt-sbggr10:
5.. _v4l2-pix-fmt-sgbrg10:
6.. _v4l2-pix-fmt-sgrbg10:
7
8***************************************************************************************************************************
9V4L2_PIX_FMT_SRGGB10 ('RG10'), V4L2_PIX_FMT_SGRBG10 ('BA10'), V4L2_PIX_FMT_SGBRG10 ('GB10'), V4L2_PIX_FMT_SBGGR10 ('BG10'),
10***************************************************************************************************************************
11
12*man V4L2_PIX_FMT_SRGGB10(2)*
13
14V4L2_PIX_FMT_SGRBG10
15V4L2_PIX_FMT_SGBRG10
16V4L2_PIX_FMT_SBGGR10
1710-bit Bayer formats expanded to 16 bits
18
19
20Description
21===========
22
23These four pixel formats are raw sRGB / Bayer formats with 10 bits per
24colour. Each colour component is stored in a 16-bit word, with 6 unused
25high bits filled with zeros. Each n-pixel row contains n/2 green samples
26and n/2 blue or red samples, with alternating red and blue rows. Bytes
27are stored in memory in little endian order. They are conventionally
28described as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example
29of one of these formats
30
31**Byte Order.**
32Each cell is one byte, high 6 bits in high bytes are 0.
33
34
35
36.. flat-table::
37 :header-rows: 0
38 :stub-columns: 0
39 :widths: 2 1 1 1 1 1 1 1 1
40
41
42 - .. row 1
43
44 - start + 0:
45
46 - B\ :sub:`00low`
47
48 - B\ :sub:`00high`
49
50 - G\ :sub:`01low`
51
52 - G\ :sub:`01high`
53
54 - B\ :sub:`02low`
55
56 - B\ :sub:`02high`
57
58 - G\ :sub:`03low`
59
60 - G\ :sub:`03high`
61
62 - .. row 2
63
64 - start + 8:
65
66 - G\ :sub:`10low`
67
68 - G\ :sub:`10high`
69
70 - R\ :sub:`11low`
71
72 - R\ :sub:`11high`
73
74 - G\ :sub:`12low`
75
76 - G\ :sub:`12high`
77
78 - R\ :sub:`13low`
79
80 - R\ :sub:`13high`
81
82 - .. row 3
83
84 - start + 16:
85
86 - B\ :sub:`20low`
87
88 - B\ :sub:`20high`
89
90 - G\ :sub:`21low`
91
92 - G\ :sub:`21high`
93
94 - B\ :sub:`22low`
95
96 - B\ :sub:`22high`
97
98 - G\ :sub:`23low`
99
100 - G\ :sub:`23high`
101
102 - .. row 4
103
104 - start + 24:
105
106 - G\ :sub:`30low`
107
108 - G\ :sub:`30high`
109
110 - R\ :sub:`31low`
111
112 - R\ :sub:`31high`
113
114 - G\ :sub:`32low`
115
116 - G\ :sub:`32high`
117
118 - R\ :sub:`33low`
119
120 - R\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb10alaw8.rst b/Documentation/media/uapi/v4l/pixfmt-srggb10alaw8.rst
new file mode 100644
index 000000000000..68bae0cb764c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb10alaw8.rst
@@ -0,0 +1,26 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SBGGR10ALAW8:
4.. _v4l2-pix-fmt-sgbrg10alaw8:
5.. _v4l2-pix-fmt-sgrbg10alaw8:
6.. _v4l2-pix-fmt-srggb10alaw8:
7
8***********************************************************************************************************************************************
9V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'), V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'), V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'), V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
10***********************************************************************************************************************************************
11
12*man V4L2_PIX_FMT_SBGGR10ALAW8(2)*
13
14V4L2_PIX_FMT_SGBRG10ALAW8
15V4L2_PIX_FMT_SGRBG10ALAW8
16V4L2_PIX_FMT_SRGGB10ALAW8
1710-bit Bayer formats compressed to 8 bits
18
19
20Description
21===========
22
23These four pixel formats are raw sRGB / Bayer formats with 10 bits per
24color compressed to 8 bits each, using the A-LAW algorithm. Each color
25component consumes 8 bits of memory. In other respects this format is
26similar to :ref:`V4L2-PIX-FMT-SRGGB8`.
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb10dpcm8.rst b/Documentation/media/uapi/v4l/pixfmt-srggb10dpcm8.rst
new file mode 100644
index 000000000000..5e041d02eff0
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb10dpcm8.rst
@@ -0,0 +1,28 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SBGGR10DPCM8:
4.. _v4l2-pix-fmt-sgbrg10dpcm8:
5.. _v4l2-pix-fmt-sgrbg10dpcm8:
6.. _v4l2-pix-fmt-srggb10dpcm8:
7
8
9***********************************************************************************************************************************************
10V4L2_PIX_FMT_SBGGR10DPCM8 ('bBA8'), V4L2_PIX_FMT_SGBRG10DPCM8 ('bGA8'), V4L2_PIX_FMT_SGRBG10DPCM8 ('BD10'), V4L2_PIX_FMT_SRGGB10DPCM8 ('bRA8'),
11***********************************************************************************************************************************************
12
13*man V4L2_PIX_FMT_SBGGR10DPCM8(2)*
14
15V4L2_PIX_FMT_SGBRG10DPCM8
16V4L2_PIX_FMT_SGRBG10DPCM8
17V4L2_PIX_FMT_SRGGB10DPCM8
1810-bit Bayer formats compressed to 8 bits
19
20
21Description
22===========
23
24These four pixel formats are raw sRGB / Bayer formats with 10 bits per
25colour compressed to 8 bits each, using DPCM compression. DPCM,
26differential pulse-code modulation, is lossy. Each colour component
27consumes 8 bits of memory. In other respects this format is similar to
28:ref:`V4L2-PIX-FMT-SRGGB10`.
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb10p.rst b/Documentation/media/uapi/v4l/pixfmt-srggb10p.rst
new file mode 100644
index 000000000000..d71368f69087
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb10p.rst
@@ -0,0 +1,103 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SRGGB10P:
4.. _v4l2-pix-fmt-sbggr10p:
5.. _v4l2-pix-fmt-sgbrg10p:
6.. _v4l2-pix-fmt-sgrbg10p:
7
8*******************************************************************************************************************************
9V4L2_PIX_FMT_SRGGB10P ('pRAA'), V4L2_PIX_FMT_SGRBG10P ('pgAA'), V4L2_PIX_FMT_SGBRG10P ('pGAA'), V4L2_PIX_FMT_SBGGR10P ('pBAA'),
10*******************************************************************************************************************************
11
12*man V4L2_PIX_FMT_SRGGB10P(2)*
13
14V4L2_PIX_FMT_SGRBG10P
15V4L2_PIX_FMT_SGBRG10P
16V4L2_PIX_FMT_SBGGR10P
1710-bit packed Bayer formats
18
19
20Description
21===========
22
23These four pixel formats are packed raw sRGB / Bayer formats with 10
24bits per colour. Every four consecutive colour components are packed
25into 5 bytes. Each of the first 4 bytes contain the 8 high order bits of
26the pixels, and the fifth byte contains the two least significants bits
27of each pixel, in the same order.
28
29Each n-pixel row contains n/2 green samples and n/2 blue or red samples,
30with alternating green-red and green-blue rows. They are conventionally
31described as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example
32of one of these formats:
33
34**Byte Order.**
35Each cell is one byte.
36
37
38
39.. flat-table::
40 :header-rows: 0
41 :stub-columns: 0
42 :widths: 2 1 1 1 1 1
43
44
45 - .. row 1
46
47 - start + 0:
48
49 - B\ :sub:`00high`
50
51 - G\ :sub:`01high`
52
53 - B\ :sub:`02high`
54
55 - G\ :sub:`03high`
56
57 - B\ :sub:`00low`\ (bits 7--6) G\ :sub:`01low`\ (bits 5--4)
58 B\ :sub:`02low`\ (bits 3--2) G\ :sub:`03low`\ (bits 1--0)
59
60 - .. row 2
61
62 - start + 5:
63
64 - G\ :sub:`10high`
65
66 - R\ :sub:`11high`
67
68 - G\ :sub:`12high`
69
70 - R\ :sub:`13high`
71
72 - G\ :sub:`10low`\ (bits 7--6) R\ :sub:`11low`\ (bits 5--4)
73 G\ :sub:`12low`\ (bits 3--2) R\ :sub:`13low`\ (bits 1--0)
74
75 - .. row 3
76
77 - start + 10:
78
79 - B\ :sub:`20high`
80
81 - G\ :sub:`21high`
82
83 - B\ :sub:`22high`
84
85 - G\ :sub:`23high`
86
87 - B\ :sub:`20low`\ (bits 7--6) G\ :sub:`21low`\ (bits 5--4)
88 B\ :sub:`22low`\ (bits 3--2) G\ :sub:`23low`\ (bits 1--0)
89
90 - .. row 4
91
92 - start + 15:
93
94 - G\ :sub:`30high`
95
96 - R\ :sub:`31high`
97
98 - G\ :sub:`32high`
99
100 - R\ :sub:`33high`
101
102 - G\ :sub:`30low`\ (bits 7--6) R\ :sub:`31low`\ (bits 5--4)
103 G\ :sub:`32low`\ (bits 3--2) R\ :sub:`33low`\ (bits 1--0)
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb12.rst b/Documentation/media/uapi/v4l/pixfmt-srggb12.rst
new file mode 100644
index 000000000000..f5303ab9e79c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb12.rst
@@ -0,0 +1,121 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SRGGB12:
4.. _v4l2-pix-fmt-sbggr12:
5.. _v4l2-pix-fmt-sgbrg12:
6.. _v4l2-pix-fmt-sgrbg12:
7
8
9***************************************************************************************************************************
10V4L2_PIX_FMT_SRGGB12 ('RG12'), V4L2_PIX_FMT_SGRBG12 ('BA12'), V4L2_PIX_FMT_SGBRG12 ('GB12'), V4L2_PIX_FMT_SBGGR12 ('BG12'),
11***************************************************************************************************************************
12
13*man V4L2_PIX_FMT_SRGGB12(2)*
14
15V4L2_PIX_FMT_SGRBG12
16V4L2_PIX_FMT_SGBRG12
17V4L2_PIX_FMT_SBGGR12
1812-bit Bayer formats expanded to 16 bits
19
20
21Description
22===========
23
24These four pixel formats are raw sRGB / Bayer formats with 12 bits per
25colour. Each colour component is stored in a 16-bit word, with 4 unused
26high bits filled with zeros. Each n-pixel row contains n/2 green samples
27and n/2 blue or red samples, with alternating red and blue rows. Bytes
28are stored in memory in little endian order. They are conventionally
29described as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example
30of one of these formats
31
32**Byte Order.**
33Each cell is one byte, high 6 bits in high bytes are 0.
34
35
36
37.. flat-table::
38 :header-rows: 0
39 :stub-columns: 0
40 :widths: 2 1 1 1 1 1 1 1 1
41
42
43 - .. row 1
44
45 - start + 0:
46
47 - B\ :sub:`00low`
48
49 - B\ :sub:`00high`
50
51 - G\ :sub:`01low`
52
53 - G\ :sub:`01high`
54
55 - B\ :sub:`02low`
56
57 - B\ :sub:`02high`
58
59 - G\ :sub:`03low`
60
61 - G\ :sub:`03high`
62
63 - .. row 2
64
65 - start + 8:
66
67 - G\ :sub:`10low`
68
69 - G\ :sub:`10high`
70
71 - R\ :sub:`11low`
72
73 - R\ :sub:`11high`
74
75 - G\ :sub:`12low`
76
77 - G\ :sub:`12high`
78
79 - R\ :sub:`13low`
80
81 - R\ :sub:`13high`
82
83 - .. row 3
84
85 - start + 16:
86
87 - B\ :sub:`20low`
88
89 - B\ :sub:`20high`
90
91 - G\ :sub:`21low`
92
93 - G\ :sub:`21high`
94
95 - B\ :sub:`22low`
96
97 - B\ :sub:`22high`
98
99 - G\ :sub:`23low`
100
101 - G\ :sub:`23high`
102
103 - .. row 4
104
105 - start + 24:
106
107 - G\ :sub:`30low`
108
109 - G\ :sub:`30high`
110
111 - R\ :sub:`31low`
112
113 - R\ :sub:`31high`
114
115 - G\ :sub:`32low`
116
117 - G\ :sub:`32high`
118
119 - R\ :sub:`33low`
120
121 - R\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb8.rst b/Documentation/media/uapi/v4l/pixfmt-srggb8.rst
new file mode 100644
index 000000000000..e88de4c48d47
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-srggb8.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-SRGGB8:
4
5****************************
6V4L2_PIX_FMT_SRGGB8 ('RGGB')
7****************************
8
9*man V4L2_PIX_FMT_SRGGB8(2)*
10
11Bayer RGB format
12
13
14Description
15===========
16
17This is commonly the native format of digital cameras, reflecting the
18arrangement of sensors on the CCD device. Only one red, green or blue
19value is given for each pixel. Missing components must be interpolated
20from neighbouring pixels. From left to right the first row consists of a
21red and green value, the second row of a green and blue value. This
22scheme repeats to the right and down for every two columns and rows.
23
24**Byte Order.**
25Each cell is one byte.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1
33
34
35 - .. row 1
36
37 - start + 0:
38
39 - R\ :sub:`00`
40
41 - G\ :sub:`01`
42
43 - R\ :sub:`02`
44
45 - G\ :sub:`03`
46
47 - .. row 2
48
49 - start + 4:
50
51 - G\ :sub:`10`
52
53 - B\ :sub:`11`
54
55 - G\ :sub:`12`
56
57 - B\ :sub:`13`
58
59 - .. row 3
60
61 - start + 8:
62
63 - R\ :sub:`20`
64
65 - G\ :sub:`21`
66
67 - R\ :sub:`22`
68
69 - G\ :sub:`23`
70
71 - .. row 4
72
73 - start + 12:
74
75 - G\ :sub:`30`
76
77 - B\ :sub:`31`
78
79 - G\ :sub:`32`
80
81 - B\ :sub:`33`
diff --git a/Documentation/media/uapi/v4l/pixfmt-uv8.rst b/Documentation/media/uapi/v4l/pixfmt-uv8.rst
new file mode 100644
index 000000000000..fa8f7ee9fee1
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-uv8.rst
@@ -0,0 +1,76 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-UV8:
4
5************************
6V4L2_PIX_FMT_UV8 ('UV8')
7************************
8
9*man V4L2_PIX_FMT_UV8(2)*
10
11UV plane interleaved
12
13
14Description
15===========
16
17In this format there is no Y plane, Only CbCr plane. ie (UV interleaved)
18
19**Byte Order.**
20Each cell is one byte.
21
22
23
24.. flat-table::
25 :header-rows: 0
26 :stub-columns: 0
27 :widths: 2 1 1 1 1
28
29
30 - .. row 1
31
32 - start + 0:
33
34 - Cb\ :sub:`00`
35
36 - Cr\ :sub:`00`
37
38 - Cb\ :sub:`01`
39
40 - Cr\ :sub:`01`
41
42 - .. row 2
43
44 - start + 4:
45
46 - Cb\ :sub:`10`
47
48 - Cr\ :sub:`10`
49
50 - Cb\ :sub:`11`
51
52 - Cr\ :sub:`11`
53
54 - .. row 3
55
56 - start + 8:
57
58 - Cb\ :sub:`20`
59
60 - Cr\ :sub:`20`
61
62 - Cb\ :sub:`21`
63
64 - Cr\ :sub:`21`
65
66 - .. row 4
67
68 - start + 12:
69
70 - Cb\ :sub:`30`
71
72 - Cr\ :sub:`30`
73
74 - Cb\ :sub:`31`
75
76 - Cr\ :sub:`31`
diff --git a/Documentation/media/uapi/v4l/pixfmt-uyvy.rst b/Documentation/media/uapi/v4l/pixfmt-uyvy.rst
new file mode 100644
index 000000000000..87b0081d44ee
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-uyvy.rst
@@ -0,0 +1,197 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-UYVY:
4
5**************************
6V4L2_PIX_FMT_UYVY ('UYVY')
7**************************
8
9*man V4L2_PIX_FMT_UYVY(2)*
10
11Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
12memory
13
14
15Description
16===========
17
18In this format each four bytes is two pixels. Each four bytes is two
19Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr
20belong to both pixels. As you can see, the Cr and Cb components have
21half the horizontal resolution of the Y component.
22
23**Byte Order.**
24Each cell is one byte.
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1 1 1 1 1 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - Cb\ :sub:`00`
37
38 - Y'\ :sub:`00`
39
40 - Cr\ :sub:`00`
41
42 - Y'\ :sub:`01`
43
44 - Cb\ :sub:`01`
45
46 - Y'\ :sub:`02`
47
48 - Cr\ :sub:`01`
49
50 - Y'\ :sub:`03`
51
52 - .. row 2
53
54 - start + 8:
55
56 - Cb\ :sub:`10`
57
58 - Y'\ :sub:`10`
59
60 - Cr\ :sub:`10`
61
62 - Y'\ :sub:`11`
63
64 - Cb\ :sub:`11`
65
66 - Y'\ :sub:`12`
67
68 - Cr\ :sub:`11`
69
70 - Y'\ :sub:`13`
71
72 - .. row 3
73
74 - start + 16:
75
76 - Cb\ :sub:`20`
77
78 - Y'\ :sub:`20`
79
80 - Cr\ :sub:`20`
81
82 - Y'\ :sub:`21`
83
84 - Cb\ :sub:`21`
85
86 - Y'\ :sub:`22`
87
88 - Cr\ :sub:`21`
89
90 - Y'\ :sub:`23`
91
92 - .. row 4
93
94 - start + 24:
95
96 - Cb\ :sub:`30`
97
98 - Y'\ :sub:`30`
99
100 - Cr\ :sub:`30`
101
102 - Y'\ :sub:`31`
103
104 - Cb\ :sub:`31`
105
106 - Y'\ :sub:`32`
107
108 - Cr\ :sub:`31`
109
110 - Y'\ :sub:`33`
111
112
113**Color Sample Location..**
114
115
116
117.. flat-table::
118 :header-rows: 0
119 :stub-columns: 0
120
121
122 - .. row 1
123
124 -
125 - 0
126
127 -
128 - 1
129
130 - 2
131
132 -
133 - 3
134
135 - .. row 2
136
137 - 0
138
139 - Y
140
141 - C
142
143 - Y
144
145 - Y
146
147 - C
148
149 - Y
150
151 - .. row 3
152
153 - 1
154
155 - Y
156
157 - C
158
159 - Y
160
161 - Y
162
163 - C
164
165 - Y
166
167 - .. row 4
168
169 - 2
170
171 - Y
172
173 - C
174
175 - Y
176
177 - Y
178
179 - C
180
181 - Y
182
183 - .. row 5
184
185 - 3
186
187 - Y
188
189 - C
190
191 - Y
192
193 - Y
194
195 - C
196
197 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-vyuy.rst b/Documentation/media/uapi/v4l/pixfmt-vyuy.rst
new file mode 100644
index 000000000000..5d8f99f173b6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-vyuy.rst
@@ -0,0 +1,195 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-VYUY:
4
5**************************
6V4L2_PIX_FMT_VYUY ('VYUY')
7**************************
8
9*man V4L2_PIX_FMT_VYUY(2)*
10
11Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
12memory
13
14
15Description
16===========
17
18In this format each four bytes is two pixels. Each four bytes is two
19Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr
20belong to both pixels. As you can see, the Cr and Cb components have
21half the horizontal resolution of the Y component.
22
23**Byte Order.**
24Each cell is one byte.
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1 1 1 1 1 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - Cr\ :sub:`00`
37
38 - Y'\ :sub:`00`
39
40 - Cb\ :sub:`00`
41
42 - Y'\ :sub:`01`
43
44 - Cr\ :sub:`01`
45
46 - Y'\ :sub:`02`
47
48 - Cb\ :sub:`01`
49
50 - Y'\ :sub:`03`
51
52 - .. row 2
53
54 - start + 8:
55
56 - Cr\ :sub:`10`
57
58 - Y'\ :sub:`10`
59
60 - Cb\ :sub:`10`
61
62 - Y'\ :sub:`11`
63
64 - Cr\ :sub:`11`
65
66 - Y'\ :sub:`12`
67
68 - Cb\ :sub:`11`
69
70 - Y'\ :sub:`13`
71
72 - .. row 3
73
74 - start + 16:
75
76 - Cr\ :sub:`20`
77
78 - Y'\ :sub:`20`
79
80 - Cb\ :sub:`20`
81
82 - Y'\ :sub:`21`
83
84 - Cr\ :sub:`21`
85
86 - Y'\ :sub:`22`
87
88 - Cb\ :sub:`21`
89
90 - Y'\ :sub:`23`
91
92 - .. row 4
93
94 - start + 24:
95
96 - Cr\ :sub:`30`
97
98 - Y'\ :sub:`30`
99
100 - Cb\ :sub:`30`
101
102 - Y'\ :sub:`31`
103
104 - Cr\ :sub:`31`
105
106 - Y'\ :sub:`32`
107
108 - Cb\ :sub:`31`
109
110 - Y'\ :sub:`33`
111
112
113**Color Sample Location..**
114
115.. flat-table::
116 :header-rows: 0
117 :stub-columns: 0
118
119
120 - .. row 1
121
122 -
123 - 0
124
125 -
126 - 1
127
128 -
129 - 2
130
131 - 3
132
133 - .. row 2
134
135 - 0
136
137 - Y
138
139 - C
140
141 - Y
142
143 - Y
144
145 - C
146
147 - Y
148
149 - .. row 3
150
151 - 1
152
153 - Y
154
155 - C
156
157 - Y
158
159 - Y
160
161 - C
162
163 - Y
164
165 - .. row 4
166
167 - 2
168
169 - Y
170
171 - C
172
173 - Y
174
175 - Y
176
177 - C
178
179 - Y
180
181 - .. row 5
182
183 - 3
184
185 - Y
186
187 - C
188
189 - Y
190
191 - Y
192
193 - C
194
195 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-y10.rst b/Documentation/media/uapi/v4l/pixfmt-y10.rst
new file mode 100644
index 000000000000..d22f77138289
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y10.rst
@@ -0,0 +1,110 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y10:
4
5*************************
6V4L2_PIX_FMT_Y10 ('Y10 ')
7*************************
8
9*man V4L2_PIX_FMT_Y10(2)*
10
11Grey-scale image
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 10 bits per pixel. Pixels are
18stored in 16-bit words with unused high bits padded with 0. The least
19significant byte is stored at lower memory addresses (little-endian).
20
21**Byte Order.**
22Each cell is one byte.
23
24
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1 1 1 1 1 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - Y'\ :sub:`00low`
37
38 - Y'\ :sub:`00high`
39
40 - Y'\ :sub:`01low`
41
42 - Y'\ :sub:`01high`
43
44 - Y'\ :sub:`02low`
45
46 - Y'\ :sub:`02high`
47
48 - Y'\ :sub:`03low`
49
50 - Y'\ :sub:`03high`
51
52 - .. row 2
53
54 - start + 8:
55
56 - Y'\ :sub:`10low`
57
58 - Y'\ :sub:`10high`
59
60 - Y'\ :sub:`11low`
61
62 - Y'\ :sub:`11high`
63
64 - Y'\ :sub:`12low`
65
66 - Y'\ :sub:`12high`
67
68 - Y'\ :sub:`13low`
69
70 - Y'\ :sub:`13high`
71
72 - .. row 3
73
74 - start + 16:
75
76 - Y'\ :sub:`20low`
77
78 - Y'\ :sub:`20high`
79
80 - Y'\ :sub:`21low`
81
82 - Y'\ :sub:`21high`
83
84 - Y'\ :sub:`22low`
85
86 - Y'\ :sub:`22high`
87
88 - Y'\ :sub:`23low`
89
90 - Y'\ :sub:`23high`
91
92 - .. row 4
93
94 - start + 24:
95
96 - Y'\ :sub:`30low`
97
98 - Y'\ :sub:`30high`
99
100 - Y'\ :sub:`31low`
101
102 - Y'\ :sub:`31high`
103
104 - Y'\ :sub:`32low`
105
106 - Y'\ :sub:`32high`
107
108 - Y'\ :sub:`33low`
109
110 - Y'\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y10b.rst b/Documentation/media/uapi/v4l/pixfmt-y10b.rst
new file mode 100644
index 000000000000..5b50cd61e654
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y10b.rst
@@ -0,0 +1,45 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y10BPACK:
4
5******************************
6V4L2_PIX_FMT_Y10BPACK ('Y10B')
7******************************
8
9*man V4L2_PIX_FMT_Y10BPACK(2)*
10
11Grey-scale image as a bit-packed array
12
13
14Description
15===========
16
17This is a packed grey-scale image format with a depth of 10 bits per
18pixel. Pixels are stored in a bit-packed array of 10bit bits per pixel,
19with no padding between them and with the most significant bits coming
20first from the left.
21
22**Bit-packed representation.**
23
24pixels cross the byte boundary and have a ratio of 5 bytes for each 4
25pixels.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1
33
34
35 - .. row 1
36
37 - Y'\ :sub:`00[9:2]`
38
39 - Y'\ :sub:`00[1:0]`\ Y'\ :sub:`01[9:4]`
40
41 - Y'\ :sub:`01[3:0]`\ Y'\ :sub:`02[9:6]`
42
43 - Y'\ :sub:`02[5:0]`\ Y'\ :sub:`03[9:8]`
44
45 - Y'\ :sub:`03[7:0]`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y12.rst b/Documentation/media/uapi/v4l/pixfmt-y12.rst
new file mode 100644
index 000000000000..7729bcbf3350
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y12.rst
@@ -0,0 +1,110 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y12:
4
5*************************
6V4L2_PIX_FMT_Y12 ('Y12 ')
7*************************
8
9*man V4L2_PIX_FMT_Y12(2)*
10
11Grey-scale image
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 12 bits per pixel. Pixels are
18stored in 16-bit words with unused high bits padded with 0. The least
19significant byte is stored at lower memory addresses (little-endian).
20
21**Byte Order.**
22Each cell is one byte.
23
24
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1 1 1 1 1 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - Y'\ :sub:`00low`
37
38 - Y'\ :sub:`00high`
39
40 - Y'\ :sub:`01low`
41
42 - Y'\ :sub:`01high`
43
44 - Y'\ :sub:`02low`
45
46 - Y'\ :sub:`02high`
47
48 - Y'\ :sub:`03low`
49
50 - Y'\ :sub:`03high`
51
52 - .. row 2
53
54 - start + 8:
55
56 - Y'\ :sub:`10low`
57
58 - Y'\ :sub:`10high`
59
60 - Y'\ :sub:`11low`
61
62 - Y'\ :sub:`11high`
63
64 - Y'\ :sub:`12low`
65
66 - Y'\ :sub:`12high`
67
68 - Y'\ :sub:`13low`
69
70 - Y'\ :sub:`13high`
71
72 - .. row 3
73
74 - start + 16:
75
76 - Y'\ :sub:`20low`
77
78 - Y'\ :sub:`20high`
79
80 - Y'\ :sub:`21low`
81
82 - Y'\ :sub:`21high`
83
84 - Y'\ :sub:`22low`
85
86 - Y'\ :sub:`22high`
87
88 - Y'\ :sub:`23low`
89
90 - Y'\ :sub:`23high`
91
92 - .. row 4
93
94 - start + 24:
95
96 - Y'\ :sub:`30low`
97
98 - Y'\ :sub:`30high`
99
100 - Y'\ :sub:`31low`
101
102 - Y'\ :sub:`31high`
103
104 - Y'\ :sub:`32low`
105
106 - Y'\ :sub:`32high`
107
108 - Y'\ :sub:`33low`
109
110 - Y'\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y12i.rst b/Documentation/media/uapi/v4l/pixfmt-y12i.rst
new file mode 100644
index 000000000000..8967e8c33b47
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y12i.rst
@@ -0,0 +1,44 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y12I:
4
5**************************
6V4L2_PIX_FMT_Y12I ('Y12I')
7**************************
8
9*man V4L2_PIX_FMT_Y12I(2)*
10
11Interleaved grey-scale image, e.g. from a stereo-pair
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 12 bits per pixel, but with
18pixels from 2 sources interleaved and bit-packed. Each pixel is stored
19in a 24-bit word in the little-endian order. On a little-endian machine
20these pixels can be deinterlaced using
21
22.. code-block:: c
23
24 __u8 *buf;
25 left0 = 0xfff & *(__u16 *)buf;
26 right0 = *(__u16 *)(buf + 1) >> 4;
27
28**Bit-packed representation.**
29pixels cross the byte boundary and have a ratio of 3 bytes for each
30interleaved pixel.
31
32.. flat-table::
33 :header-rows: 0
34 :stub-columns: 0
35 :widths: 2 1 1
36
37
38 - .. row 1
39
40 - Y'\ :sub:`0left[7:0]`
41
42 - Y'\ :sub:`0right[3:0]`\ Y'\ :sub:`0left[11:8]`
43
44 - Y'\ :sub:`0right[11:4]`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y16-be.rst b/Documentation/media/uapi/v4l/pixfmt-y16-be.rst
new file mode 100644
index 000000000000..37fa099c16a6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y16-be.rst
@@ -0,0 +1,112 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y16-BE:
4
5****************************************
6V4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 << 31))
7****************************************
8
9*man V4L2_PIX_FMT_Y16_BE(2)*
10
11Grey-scale image
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 16 bits per pixel. The most
18significant byte is stored at lower memory addresses (big-endian).
19
20.. note:: Tthe actual sampling precision may be lower than 16 bits, for
21 example 10 bits per pixel with values in range 0 to 1023.
22
23**Byte Order.**
24Each cell is one byte.
25
26
27
28.. flat-table::
29 :header-rows: 0
30 :stub-columns: 0
31 :widths: 2 1 1 1 1 1 1 1 1
32
33
34 - .. row 1
35
36 - start + 0:
37
38 - Y'\ :sub:`00high`
39
40 - Y'\ :sub:`00low`
41
42 - Y'\ :sub:`01high`
43
44 - Y'\ :sub:`01low`
45
46 - Y'\ :sub:`02high`
47
48 - Y'\ :sub:`02low`
49
50 - Y'\ :sub:`03high`
51
52 - Y'\ :sub:`03low`
53
54 - .. row 2
55
56 - start + 8:
57
58 - Y'\ :sub:`10high`
59
60 - Y'\ :sub:`10low`
61
62 - Y'\ :sub:`11high`
63
64 - Y'\ :sub:`11low`
65
66 - Y'\ :sub:`12high`
67
68 - Y'\ :sub:`12low`
69
70 - Y'\ :sub:`13high`
71
72 - Y'\ :sub:`13low`
73
74 - .. row 3
75
76 - start + 16:
77
78 - Y'\ :sub:`20high`
79
80 - Y'\ :sub:`20low`
81
82 - Y'\ :sub:`21high`
83
84 - Y'\ :sub:`21low`
85
86 - Y'\ :sub:`22high`
87
88 - Y'\ :sub:`22low`
89
90 - Y'\ :sub:`23high`
91
92 - Y'\ :sub:`23low`
93
94 - .. row 4
95
96 - start + 24:
97
98 - Y'\ :sub:`30high`
99
100 - Y'\ :sub:`30low`
101
102 - Y'\ :sub:`31high`
103
104 - Y'\ :sub:`31low`
105
106 - Y'\ :sub:`32high`
107
108 - Y'\ :sub:`32low`
109
110 - Y'\ :sub:`33high`
111
112 - Y'\ :sub:`33low`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y16.rst b/Documentation/media/uapi/v4l/pixfmt-y16.rst
new file mode 100644
index 000000000000..4c41c042188b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y16.rst
@@ -0,0 +1,112 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y16:
4
5*************************
6V4L2_PIX_FMT_Y16 ('Y16 ')
7*************************
8
9*man V4L2_PIX_FMT_Y16(2)*
10
11Grey-scale image
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 16 bits per pixel. The least
18significant byte is stored at lower memory addresses (little-endian).
19
20.. note:: The actual sampling precision may be lower than 16 bits, for
21 example 10 bits per pixel with values in range 0 to 1023.
22
23**Byte Order.**
24Each cell is one byte.
25
26
27
28.. flat-table::
29 :header-rows: 0
30 :stub-columns: 0
31 :widths: 2 1 1 1 1 1 1 1 1
32
33
34 - .. row 1
35
36 - start + 0:
37
38 - Y'\ :sub:`00low`
39
40 - Y'\ :sub:`00high`
41
42 - Y'\ :sub:`01low`
43
44 - Y'\ :sub:`01high`
45
46 - Y'\ :sub:`02low`
47
48 - Y'\ :sub:`02high`
49
50 - Y'\ :sub:`03low`
51
52 - Y'\ :sub:`03high`
53
54 - .. row 2
55
56 - start + 8:
57
58 - Y'\ :sub:`10low`
59
60 - Y'\ :sub:`10high`
61
62 - Y'\ :sub:`11low`
63
64 - Y'\ :sub:`11high`
65
66 - Y'\ :sub:`12low`
67
68 - Y'\ :sub:`12high`
69
70 - Y'\ :sub:`13low`
71
72 - Y'\ :sub:`13high`
73
74 - .. row 3
75
76 - start + 16:
77
78 - Y'\ :sub:`20low`
79
80 - Y'\ :sub:`20high`
81
82 - Y'\ :sub:`21low`
83
84 - Y'\ :sub:`21high`
85
86 - Y'\ :sub:`22low`
87
88 - Y'\ :sub:`22high`
89
90 - Y'\ :sub:`23low`
91
92 - Y'\ :sub:`23high`
93
94 - .. row 4
95
96 - start + 24:
97
98 - Y'\ :sub:`30low`
99
100 - Y'\ :sub:`30high`
101
102 - Y'\ :sub:`31low`
103
104 - Y'\ :sub:`31high`
105
106 - Y'\ :sub:`32low`
107
108 - Y'\ :sub:`32high`
109
110 - Y'\ :sub:`33low`
111
112 - Y'\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt-y41p.rst b/Documentation/media/uapi/v4l/pixfmt-y41p.rst
new file mode 100644
index 000000000000..4760174a4668
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y41p.rst
@@ -0,0 +1,274 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y41P:
4
5**************************
6V4L2_PIX_FMT_Y41P ('Y41P')
7**************************
8
9*man V4L2_PIX_FMT_Y41P(2)*
10
11Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1
12
13
14Description
15===========
16
17In this format each 12 bytes is eight pixels. In the twelve bytes are
18two CbCr pairs and eight Y's. The first CbCr pair goes with the first
19four Y's, and the second CbCr pair goes with the other four Y's. The Cb
20and Cr components have one fourth the horizontal resolution of the Y
21component.
22
23Do not confuse this format with
24:ref:`V4L2_PIX_FMT_YUV411P <V4L2-PIX-FMT-YUV411P>`. Y41P is derived
25from "YUV 4:1:1 *packed*", while YUV411P stands for "YUV 4:1:1
26*planar*".
27
28**Byte Order.**
29Each cell is one byte.
30
31
32
33.. flat-table::
34 :header-rows: 0
35 :stub-columns: 0
36 :widths: 2 1 1 1 1 1 1 1 1 1 1 1 1
37
38
39 - .. row 1
40
41 - start + 0:
42
43 - Cb\ :sub:`00`
44
45 - Y'\ :sub:`00`
46
47 - Cr\ :sub:`00`
48
49 - Y'\ :sub:`01`
50
51 - Cb\ :sub:`01`
52
53 - Y'\ :sub:`02`
54
55 - Cr\ :sub:`01`
56
57 - Y'\ :sub:`03`
58
59 - Y'\ :sub:`04`
60
61 - Y'\ :sub:`05`
62
63 - Y'\ :sub:`06`
64
65 - Y'\ :sub:`07`
66
67 - .. row 2
68
69 - start + 12:
70
71 - Cb\ :sub:`10`
72
73 - Y'\ :sub:`10`
74
75 - Cr\ :sub:`10`
76
77 - Y'\ :sub:`11`
78
79 - Cb\ :sub:`11`
80
81 - Y'\ :sub:`12`
82
83 - Cr\ :sub:`11`
84
85 - Y'\ :sub:`13`
86
87 - Y'\ :sub:`14`
88
89 - Y'\ :sub:`15`
90
91 - Y'\ :sub:`16`
92
93 - Y'\ :sub:`17`
94
95 - .. row 3
96
97 - start + 24:
98
99 - Cb\ :sub:`20`
100
101 - Y'\ :sub:`20`
102
103 - Cr\ :sub:`20`
104
105 - Y'\ :sub:`21`
106
107 - Cb\ :sub:`21`
108
109 - Y'\ :sub:`22`
110
111 - Cr\ :sub:`21`
112
113 - Y'\ :sub:`23`
114
115 - Y'\ :sub:`24`
116
117 - Y'\ :sub:`25`
118
119 - Y'\ :sub:`26`
120
121 - Y'\ :sub:`27`
122
123 - .. row 4
124
125 - start + 36:
126
127 - Cb\ :sub:`30`
128
129 - Y'\ :sub:`30`
130
131 - Cr\ :sub:`30`
132
133 - Y'\ :sub:`31`
134
135 - Cb\ :sub:`31`
136
137 - Y'\ :sub:`32`
138
139 - Cr\ :sub:`31`
140
141 - Y'\ :sub:`33`
142
143 - Y'\ :sub:`34`
144
145 - Y'\ :sub:`35`
146
147 - Y'\ :sub:`36`
148
149 - Y'\ :sub:`37`
150
151
152**Color Sample Location..**
153
154.. flat-table::
155 :header-rows: 0
156 :stub-columns: 0
157
158
159 - .. row 1
160
161 -
162 - 0
163
164 - 1
165
166 -
167 - 2
168
169 - 3
170
171 - 4
172
173 - 5
174
175 -
176 - 6
177
178 - 7
179
180 - .. row 2
181
182 - 0
183
184 - Y
185
186 - Y
187
188 - C
189
190 - Y
191
192 - Y
193
194 - Y
195
196 - Y
197
198 - C
199
200 - Y
201
202 - Y
203
204 - .. row 3
205
206 - 1
207
208 - Y
209
210 - Y
211
212 - C
213
214 - Y
215
216 - Y
217
218 - Y
219
220 - Y
221
222 - C
223
224 - Y
225
226 - Y
227
228 - .. row 4
229
230 - 2
231
232 - Y
233
234 - Y
235
236 - C
237
238 - Y
239
240 - Y
241
242 - Y
243
244 - Y
245
246 - C
247
248 - Y
249
250 - Y
251
252 - .. row 5
253
254 - 3
255
256 - Y
257
258 - Y
259
260 - C
261
262 - Y
263
264 - Y
265
266 - Y
267
268 - Y
269
270 - C
271
272 - Y
273
274 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-y8i.rst b/Documentation/media/uapi/v4l/pixfmt-y8i.rst
new file mode 100644
index 000000000000..7fa16ee85ab7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-y8i.rst
@@ -0,0 +1,111 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Y8I:
4
5*************************
6V4L2_PIX_FMT_Y8I ('Y8I ')
7*************************
8
9*man V4L2_PIX_FMT_Y8I(2)*
10
11Interleaved grey-scale image, e.g. from a stereo-pair
12
13
14Description
15===========
16
17This is a grey-scale image with a depth of 8 bits per pixel, but with
18pixels from 2 sources interleaved. Each pixel is stored in a 16-bit
19word. E.g. the R200 RealSense camera stores pixel from the left sensor
20in lower and from the right sensor in the higher 8 bits.
21
22**Byte Order.**
23Each cell is one byte.
24
25
26
27.. flat-table::
28 :header-rows: 0
29 :stub-columns: 0
30 :widths: 2 1 1 1 1 1 1 1 1
31
32
33 - .. row 1
34
35 - start + 0:
36
37 - Y'\ :sub:`00left`
38
39 - Y'\ :sub:`00right`
40
41 - Y'\ :sub:`01left`
42
43 - Y'\ :sub:`01right`
44
45 - Y'\ :sub:`02left`
46
47 - Y'\ :sub:`02right`
48
49 - Y'\ :sub:`03left`
50
51 - Y'\ :sub:`03right`
52
53 - .. row 2
54
55 - start + 8:
56
57 - Y'\ :sub:`10left`
58
59 - Y'\ :sub:`10right`
60
61 - Y'\ :sub:`11left`
62
63 - Y'\ :sub:`11right`
64
65 - Y'\ :sub:`12left`
66
67 - Y'\ :sub:`12right`
68
69 - Y'\ :sub:`13left`
70
71 - Y'\ :sub:`13right`
72
73 - .. row 3
74
75 - start + 16:
76
77 - Y'\ :sub:`20left`
78
79 - Y'\ :sub:`20right`
80
81 - Y'\ :sub:`21left`
82
83 - Y'\ :sub:`21right`
84
85 - Y'\ :sub:`22left`
86
87 - Y'\ :sub:`22right`
88
89 - Y'\ :sub:`23left`
90
91 - Y'\ :sub:`23right`
92
93 - .. row 4
94
95 - start + 24:
96
97 - Y'\ :sub:`30left`
98
99 - Y'\ :sub:`30right`
100
101 - Y'\ :sub:`31left`
102
103 - Y'\ :sub:`31right`
104
105 - Y'\ :sub:`32left`
106
107 - Y'\ :sub:`32right`
108
109 - Y'\ :sub:`33left`
110
111 - Y'\ :sub:`33right`
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv410.rst b/Documentation/media/uapi/v4l/pixfmt-yuv410.rst
new file mode 100644
index 000000000000..8a5d1a2ee005
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv410.rst
@@ -0,0 +1,208 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YVU410:
4.. _v4l2-pix-fmt-yuv410:
5
6**********************************************************
7V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')
8**********************************************************
9
10*man V4L2_PIX_FMT_YVU410(2)*
11
12V4L2_PIX_FMT_YUV410
13Planar formats with ¼ horizontal and vertical chroma resolution, also
14known as YUV 4:1:0
15
16
17Description
18===========
19
20These are planar formats, as opposed to a packed format. The three
21components are separated into three sub-images or planes. The Y plane is
22first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_YVU410``,
23the Cr plane immediately follows the Y plane in memory. The Cr plane is
24¼ the width and ¼ the height of the Y plane (and of the image). Each Cr
25belongs to 16 pixels, a four-by-four square of the image. Following the
26Cr plane is the Cb plane, just like the Cr plane.
27``V4L2_PIX_FMT_YUV410`` is the same, except the Cb plane comes first,
28then the Cr plane.
29
30If the Y plane has pad bytes after each row, then the Cr and Cb planes
31have ¼ as many pad bytes after their rows. In other words, four Cx rows
32(including padding) are exactly as long as one Y row (including
33padding).
34
35**Byte Order.**
36Each cell is one byte.
37
38
39
40.. flat-table::
41 :header-rows: 0
42 :stub-columns: 0
43 :widths: 2 1 1 1 1
44
45
46 - .. row 1
47
48 - start + 0:
49
50 - Y'\ :sub:`00`
51
52 - Y'\ :sub:`01`
53
54 - Y'\ :sub:`02`
55
56 - Y'\ :sub:`03`
57
58 - .. row 2
59
60 - start + 4:
61
62 - Y'\ :sub:`10`
63
64 - Y'\ :sub:`11`
65
66 - Y'\ :sub:`12`
67
68 - Y'\ :sub:`13`
69
70 - .. row 3
71
72 - start + 8:
73
74 - Y'\ :sub:`20`
75
76 - Y'\ :sub:`21`
77
78 - Y'\ :sub:`22`
79
80 - Y'\ :sub:`23`
81
82 - .. row 4
83
84 - start + 12:
85
86 - Y'\ :sub:`30`
87
88 - Y'\ :sub:`31`
89
90 - Y'\ :sub:`32`
91
92 - Y'\ :sub:`33`
93
94 - .. row 5
95
96 - start + 16:
97
98 - Cr\ :sub:`00`
99
100 - .. row 6
101
102 - start + 17:
103
104 - Cb\ :sub:`00`
105
106
107**Color Sample Location..**
108
109
110
111.. flat-table::
112 :header-rows: 0
113 :stub-columns: 0
114
115
116 - .. row 1
117
118 -
119 - 0
120
121 -
122 - 1
123
124 -
125 - 2
126
127 -
128 - 3
129
130 - .. row 2
131
132 - 0
133
134 - Y
135
136 -
137 - Y
138
139 -
140 - Y
141
142 -
143 - Y
144
145 - .. row 3
146
147 -
148
149 - .. row 4
150
151 - 1
152
153 - Y
154
155 -
156 - Y
157
158 -
159 - Y
160
161 -
162 - Y
163
164 - .. row 5
165
166 -
167 -
168 -
169 -
170 - C
171
172 -
173 -
174 -
175
176 - .. row 6
177
178 - 2
179
180 - Y
181
182 -
183 - Y
184
185 -
186 - Y
187
188 -
189 - Y
190
191 - .. row 7
192
193 -
194
195 - .. row 8
196
197 - 3
198
199 - Y
200
201 -
202 - Y
203
204 -
205 - Y
206
207 -
208 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv411p.rst b/Documentation/media/uapi/v4l/pixfmt-yuv411p.rst
new file mode 100644
index 000000000000..f85e3f388cbe
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv411p.rst
@@ -0,0 +1,214 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUV411P:
4
5*****************************
6V4L2_PIX_FMT_YUV411P ('411P')
7*****************************
8
9*man V4L2_PIX_FMT_YUV411P(2)*
10
11Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1.
12Planar layout as opposed to ``V4L2_PIX_FMT_Y41P``
13
14
15Description
16===========
17
18This format is not commonly used. This is a planar format similar to the
194:2:2 planar format except with half as many chroma. The three
20components are separated into three sub-images or planes. The Y plane is
21first. The Y plane has one byte per pixel. The Cb plane immediately
22follows the Y plane in memory. The Cb plane is ¼ the width of the Y
23plane (and of the image). Each Cb belongs to 4 pixels all on the same
24row. For example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
25Y'\ :sub:`02` and Y'\ :sub:`03`. Following the Cb plane is the Cr plane,
26just like the Cb plane.
27
28If the Y plane has pad bytes after each row, then the Cr and Cb planes
29have ¼ as many pad bytes after their rows. In other words, four C x rows
30(including padding) is exactly as long as one Y row (including padding).
31
32**Byte Order.**
33Each cell is one byte.
34
35
36.. flat-table::
37 :header-rows: 0
38 :stub-columns: 0
39 :widths: 2 1 1 1 1
40
41
42 - .. row 1
43
44 - start + 0:
45
46 - Y'\ :sub:`00`
47
48 - Y'\ :sub:`01`
49
50 - Y'\ :sub:`02`
51
52 - Y'\ :sub:`03`
53
54 - .. row 2
55
56 - start + 4:
57
58 - Y'\ :sub:`10`
59
60 - Y'\ :sub:`11`
61
62 - Y'\ :sub:`12`
63
64 - Y'\ :sub:`13`
65
66 - .. row 3
67
68 - start + 8:
69
70 - Y'\ :sub:`20`
71
72 - Y'\ :sub:`21`
73
74 - Y'\ :sub:`22`
75
76 - Y'\ :sub:`23`
77
78 - .. row 4
79
80 - start + 12:
81
82 - Y'\ :sub:`30`
83
84 - Y'\ :sub:`31`
85
86 - Y'\ :sub:`32`
87
88 - Y'\ :sub:`33`
89
90 - .. row 5
91
92 - start + 16:
93
94 - Cb\ :sub:`00`
95
96 - .. row 6
97
98 - start + 17:
99
100 - Cb\ :sub:`10`
101
102 - .. row 7
103
104 - start + 18:
105
106 - Cb\ :sub:`20`
107
108 - .. row 8
109
110 - start + 19:
111
112 - Cb\ :sub:`30`
113
114 - .. row 9
115
116 - start + 20:
117
118 - Cr\ :sub:`00`
119
120 - .. row 10
121
122 - start + 21:
123
124 - Cr\ :sub:`10`
125
126 - .. row 11
127
128 - start + 22:
129
130 - Cr\ :sub:`20`
131
132 - .. row 12
133
134 - start + 23:
135
136 - Cr\ :sub:`30`
137
138
139**Color Sample Location..**
140
141
142
143.. flat-table::
144 :header-rows: 0
145 :stub-columns: 0
146
147
148 - .. row 1
149
150 -
151 - 0
152
153 - 1
154
155 -
156 - 2
157
158 - 3
159
160 - .. row 2
161
162 - 0
163
164 - Y
165
166 - Y
167
168 - C
169
170 - Y
171
172 - Y
173
174 - .. row 3
175
176 - 1
177
178 - Y
179
180 - Y
181
182 - C
183
184 - Y
185
186 - Y
187
188 - .. row 4
189
190 - 2
191
192 - Y
193
194 - Y
195
196 - C
197
198 - Y
199
200 - Y
201
202 - .. row 5
203
204 - 3
205
206 - Y
207
208 - Y
209
210 - C
211
212 - Y
213
214 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv420.rst b/Documentation/media/uapi/v4l/pixfmt-yuv420.rst
new file mode 100644
index 000000000000..b22e64c14f67
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv420.rst
@@ -0,0 +1,239 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YVU420:
4.. _V4L2-PIX-FMT-YUV420:
5
6**********************************************************
7V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')
8**********************************************************
9
10*man V4L2_PIX_FMT_YVU420(2)*
11
12V4L2_PIX_FMT_YUV420
13Planar formats with ½ horizontal and vertical chroma resolution, also
14known as YUV 4:2:0
15
16
17Description
18===========
19
20These are planar formats, as opposed to a packed format. The three
21components are separated into three sub- images or planes. The Y plane
22is first. The Y plane has one byte per pixel. For
23``V4L2_PIX_FMT_YVU420``, the Cr plane immediately follows the Y plane in
24memory. The Cr plane is half the width and half the height of the Y
25plane (and of the image). Each Cr belongs to four pixels, a two-by-two
26square of the image. For example, Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
27Y'\ :sub:`01`, Y'\ :sub:`10`, and Y'\ :sub:`11`. Following the Cr plane
28is the Cb plane, just like the Cr plane. ``V4L2_PIX_FMT_YUV420`` is the
29same except the Cb plane comes first, then the Cr plane.
30
31If the Y plane has pad bytes after each row, then the Cr and Cb planes
32have half as many pad bytes after their rows. In other words, two Cx
33rows (including padding) is exactly as long as one Y row (including
34padding).
35
36**Byte Order.**
37Each cell is one byte.
38
39
40
41.. flat-table::
42 :header-rows: 0
43 :stub-columns: 0
44 :widths: 2 1 1 1 1
45
46
47 - .. row 1
48
49 - start + 0:
50
51 - Y'\ :sub:`00`
52
53 - Y'\ :sub:`01`
54
55 - Y'\ :sub:`02`
56
57 - Y'\ :sub:`03`
58
59 - .. row 2
60
61 - start + 4:
62
63 - Y'\ :sub:`10`
64
65 - Y'\ :sub:`11`
66
67 - Y'\ :sub:`12`
68
69 - Y'\ :sub:`13`
70
71 - .. row 3
72
73 - start + 8:
74
75 - Y'\ :sub:`20`
76
77 - Y'\ :sub:`21`
78
79 - Y'\ :sub:`22`
80
81 - Y'\ :sub:`23`
82
83 - .. row 4
84
85 - start + 12:
86
87 - Y'\ :sub:`30`
88
89 - Y'\ :sub:`31`
90
91 - Y'\ :sub:`32`
92
93 - Y'\ :sub:`33`
94
95 - .. row 5
96
97 - start + 16:
98
99 - Cr\ :sub:`00`
100
101 - Cr\ :sub:`01`
102
103 - .. row 6
104
105 - start + 18:
106
107 - Cr\ :sub:`10`
108
109 - Cr\ :sub:`11`
110
111 - .. row 7
112
113 - start + 20:
114
115 - Cb\ :sub:`00`
116
117 - Cb\ :sub:`01`
118
119 - .. row 8
120
121 - start + 22:
122
123 - Cb\ :sub:`10`
124
125 - Cb\ :sub:`11`
126
127
128**Color Sample Location..**
129
130
131
132.. flat-table::
133 :header-rows: 0
134 :stub-columns: 0
135
136
137 - .. row 1
138
139 -
140 - 0
141
142 -
143 - 1
144
145 -
146 - 2
147
148 -
149 - 3
150
151 - .. row 2
152
153 - 0
154
155 - Y
156
157 -
158 - Y
159
160 -
161 - Y
162
163 -
164 - Y
165
166 - .. row 3
167
168 -
169 -
170 - C
171
172 -
173 -
174 -
175 - C
176
177 -
178
179 - .. row 4
180
181 - 1
182
183 - Y
184
185 -
186 - Y
187
188 -
189 - Y
190
191 -
192 - Y
193
194 - .. row 5
195
196 -
197
198 - .. row 6
199
200 - 2
201
202 - Y
203
204 -
205 - Y
206
207 -
208 - Y
209
210 -
211 - Y
212
213 - .. row 7
214
215 -
216 -
217 - C
218
219 -
220 -
221 -
222 - C
223
224 -
225
226 - .. row 8
227
228 - 3
229
230 - Y
231
232 -
233 - Y
234
235 -
236 - Y
237
238 -
239 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv420m.rst b/Documentation/media/uapi/v4l/pixfmt-yuv420m.rst
new file mode 100644
index 000000000000..4dab85090d7d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv420m.rst
@@ -0,0 +1,254 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUV420M:
4.. _v4l2-pix-fmt-yvu420m:
5
6************************************************************
7V4L2_PIX_FMT_YUV420M ('YM12'), V4L2_PIX_FMT_YVU420M ('YM21')
8************************************************************
9
10*man V4L2_PIX_FMT_YUV420M(2)*
11
12V4L2_PIX_FMT_YVU420M
13Variation of ``V4L2_PIX_FMT_YUV420`` and ``V4L2_PIX_FMT_YVU420`` with
14planes non contiguous in memory.
15
16
17Description
18===========
19
20This is a multi-planar format, as opposed to a packed format. The three
21components are separated into three sub-images or planes.
22
23The Y plane is first. The Y plane has one byte per pixel. For
24``V4L2_PIX_FMT_YUV420M`` the Cb data constitutes the second plane which
25is half the width and half the height of the Y plane (and of the image).
26Each Cb belongs to four pixels, a two-by-two square of the image. For
27example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
28Y'\ :sub:`10`, and Y'\ :sub:`11`. The Cr data, just like the Cb plane,
29is in the third plane.
30
31``V4L2_PIX_FMT_YVU420M`` is the same except the Cr data is stored in the
32second plane and the Cb data in the third plane.
33
34If the Y plane has pad bytes after each row, then the Cb and Cr planes
35have half as many pad bytes after their rows. In other words, two Cx
36rows (including padding) is exactly as long as one Y row (including
37padding).
38
39``V4L2_PIX_FMT_YUV420M`` and ``V4L2_PIX_FMT_YVU420M`` are intended to be
40used only in drivers and applications that support the multi-planar API,
41described in :ref:`planar-apis`.
42
43**Byte Order.**
44Each cell is one byte.
45
46
47
48.. flat-table::
49 :header-rows: 0
50 :stub-columns: 0
51 :widths: 2 1 1 1 1
52
53
54 - .. row 1
55
56 - start0 + 0:
57
58 - Y'\ :sub:`00`
59
60 - Y'\ :sub:`01`
61
62 - Y'\ :sub:`02`
63
64 - Y'\ :sub:`03`
65
66 - .. row 2
67
68 - start0 + 4:
69
70 - Y'\ :sub:`10`
71
72 - Y'\ :sub:`11`
73
74 - Y'\ :sub:`12`
75
76 - Y'\ :sub:`13`
77
78 - .. row 3
79
80 - start0 + 8:
81
82 - Y'\ :sub:`20`
83
84 - Y'\ :sub:`21`
85
86 - Y'\ :sub:`22`
87
88 - Y'\ :sub:`23`
89
90 - .. row 4
91
92 - start0 + 12:
93
94 - Y'\ :sub:`30`
95
96 - Y'\ :sub:`31`
97
98 - Y'\ :sub:`32`
99
100 - Y'\ :sub:`33`
101
102 - .. row 5
103
104 -
105
106 - .. row 6
107
108 - start1 + 0:
109
110 - Cb\ :sub:`00`
111
112 - Cb\ :sub:`01`
113
114 - .. row 7
115
116 - start1 + 2:
117
118 - Cb\ :sub:`10`
119
120 - Cb\ :sub:`11`
121
122 - .. row 8
123
124 -
125
126 - .. row 9
127
128 - start2 + 0:
129
130 - Cr\ :sub:`00`
131
132 - Cr\ :sub:`01`
133
134 - .. row 10
135
136 - start2 + 2:
137
138 - Cr\ :sub:`10`
139
140 - Cr\ :sub:`11`
141
142
143**Color Sample Location..**
144
145
146
147.. flat-table::
148 :header-rows: 0
149 :stub-columns: 0
150
151
152 - .. row 1
153
154 -
155 - 0
156
157 -
158 - 1
159
160 -
161 - 2
162
163 -
164 - 3
165
166 - .. row 2
167
168 - 0
169
170 - Y
171
172 -
173 - Y
174
175 -
176 - Y
177
178 -
179 - Y
180
181 - .. row 3
182
183 -
184 -
185 - C
186
187 -
188 -
189 -
190 - C
191
192 -
193
194 - .. row 4
195
196 - 1
197
198 - Y
199
200 -
201 - Y
202
203 -
204 - Y
205
206 -
207 - Y
208
209 - .. row 5
210
211 -
212
213 - .. row 6
214
215 - 2
216
217 - Y
218
219 -
220 - Y
221
222 -
223 - Y
224
225 -
226 - Y
227
228 - .. row 7
229
230 -
231 -
232 - C
233
234 -
235 -
236 -
237 - C
238
239 -
240
241 - .. row 8
242
243 - 3
244
245 - Y
246
247 -
248 - Y
249
250 -
251 - Y
252
253 -
254 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv422m.rst b/Documentation/media/uapi/v4l/pixfmt-yuv422m.rst
new file mode 100644
index 000000000000..ccb67284133a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv422m.rst
@@ -0,0 +1,258 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUV422M:
4.. _v4l2-pix-fmt-yvu422m:
5
6************************************************************
7V4L2_PIX_FMT_YUV422M ('YM16'), V4L2_PIX_FMT_YVU422M ('YM61')
8************************************************************
9
10*man V4L2_PIX_FMT_YUV422M(2)*
11
12V4L2_PIX_FMT_YVU422M
13Planar formats with ½ horizontal resolution, also known as YUV and YVU
144:2:2
15
16
17Description
18===========
19
20This is a multi-planar format, as opposed to a packed format. The three
21components are separated into three sub-images or planes.
22
23The Y plane is first. The Y plane has one byte per pixel. For
24``V4L2_PIX_FMT_YUV422M`` the Cb data constitutes the second plane which
25is half the width of the Y plane (and of the image). Each Cb belongs to
26two pixels. For example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`,
27Y'\ :sub:`01`. The Cr data, just like the Cb plane, is in the third
28plane.
29
30``V4L2_PIX_FMT_YVU422M`` is the same except the Cr data is stored in the
31second plane and the Cb data in the third plane.
32
33If the Y plane has pad bytes after each row, then the Cb and Cr planes
34have half as many pad bytes after their rows. In other words, two Cx
35rows (including padding) is exactly as long as one Y row (including
36padding).
37
38``V4L2_PIX_FMT_YUV422M`` and ``V4L2_PIX_FMT_YVU422M`` are intended to be
39used only in drivers and applications that support the multi-planar API,
40described in :ref:`planar-apis`.
41
42**Byte Order.**
43Each cell is one byte.
44
45
46
47.. flat-table::
48 :header-rows: 0
49 :stub-columns: 0
50 :widths: 2 1 1 1 1
51
52
53 - .. row 1
54
55 - start0 + 0:
56
57 - Y'\ :sub:`00`
58
59 - Y'\ :sub:`01`
60
61 - Y'\ :sub:`02`
62
63 - Y'\ :sub:`03`
64
65 - .. row 2
66
67 - start0 + 4:
68
69 - Y'\ :sub:`10`
70
71 - Y'\ :sub:`11`
72
73 - Y'\ :sub:`12`
74
75 - Y'\ :sub:`13`
76
77 - .. row 3
78
79 - start0 + 8:
80
81 - Y'\ :sub:`20`
82
83 - Y'\ :sub:`21`
84
85 - Y'\ :sub:`22`
86
87 - Y'\ :sub:`23`
88
89 - .. row 4
90
91 - start0 + 12:
92
93 - Y'\ :sub:`30`
94
95 - Y'\ :sub:`31`
96
97 - Y'\ :sub:`32`
98
99 - Y'\ :sub:`33`
100
101 - .. row 5
102
103 -
104
105 - .. row 6
106
107 - start1 + 0:
108
109 - Cb\ :sub:`00`
110
111 - Cb\ :sub:`01`
112
113 - .. row 7
114
115 - start1 + 2:
116
117 - Cb\ :sub:`10`
118
119 - Cb\ :sub:`11`
120
121 - .. row 8
122
123 - start1 + 4:
124
125 - Cb\ :sub:`20`
126
127 - Cb\ :sub:`21`
128
129 - .. row 9
130
131 - start1 + 6:
132
133 - Cb\ :sub:`30`
134
135 - Cb\ :sub:`31`
136
137 - .. row 10
138
139 -
140
141 - .. row 11
142
143 - start2 + 0:
144
145 - Cr\ :sub:`00`
146
147 - Cr\ :sub:`01`
148
149 - .. row 12
150
151 - start2 + 2:
152
153 - Cr\ :sub:`10`
154
155 - Cr\ :sub:`11`
156
157 - .. row 13
158
159 - start2 + 4:
160
161 - Cr\ :sub:`20`
162
163 - Cr\ :sub:`21`
164
165 - .. row 14
166
167 - start2 + 6:
168
169 - Cr\ :sub:`30`
170
171 - Cr\ :sub:`31`
172
173
174**Color Sample Location..**
175
176
177
178.. flat-table::
179 :header-rows: 0
180 :stub-columns: 0
181
182
183 - .. row 1
184
185 -
186 - 0
187
188 -
189 - 1
190
191 - 2
192
193 -
194 - 3
195
196 - .. row 2
197
198 - 0
199
200 - Y
201
202 - C
203
204 - Y
205
206 - Y
207
208 - C
209
210 - Y
211
212 - .. row 3
213
214 - 1
215
216 - Y
217
218 - C
219
220 - Y
221
222 - Y
223
224 - C
225
226 - Y
227
228 - .. row 4
229
230 - 2
231
232 - Y
233
234 - C
235
236 - Y
237
238 - Y
239
240 - C
241
242 - Y
243
244 - .. row 5
245
246 - 3
247
248 - Y
249
250 - C
251
252 - Y
253
254 - Y
255
256 - C
257
258 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv422p.rst b/Documentation/media/uapi/v4l/pixfmt-yuv422p.rst
new file mode 100644
index 000000000000..9f34762adf18
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv422p.rst
@@ -0,0 +1,240 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUV422P:
4
5*****************************
6V4L2_PIX_FMT_YUV422P ('422P')
7*****************************
8
9*man V4L2_PIX_FMT_YUV422P(2)*
10
11Format with ½ horizontal chroma resolution, also known as YUV 4:2:2.
12Planar layout as opposed to ``V4L2_PIX_FMT_YUYV``
13
14
15Description
16===========
17
18This format is not commonly used. This is a planar version of the YUYV
19format. The three components are separated into three sub-images or
20planes. The Y plane is first. The Y plane has one byte per pixel. The Cb
21plane immediately follows the Y plane in memory. The Cb plane is half
22the width of the Y plane (and of the image). Each Cb belongs to two
23pixels. For example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`,
24Y'\ :sub:`01`. Following the Cb plane is the Cr plane, just like the Cb
25plane.
26
27If the Y plane has pad bytes after each row, then the Cr and Cb planes
28have half as many pad bytes after their rows. In other words, two Cx
29rows (including padding) is exactly as long as one Y row (including
30padding).
31
32**Byte Order.**
33Each cell is one byte.
34
35
36
37.. flat-table::
38 :header-rows: 0
39 :stub-columns: 0
40 :widths: 2 1 1 1 1
41
42
43 - .. row 1
44
45 - start + 0:
46
47 - Y'\ :sub:`00`
48
49 - Y'\ :sub:`01`
50
51 - Y'\ :sub:`02`
52
53 - Y'\ :sub:`03`
54
55 - .. row 2
56
57 - start + 4:
58
59 - Y'\ :sub:`10`
60
61 - Y'\ :sub:`11`
62
63 - Y'\ :sub:`12`
64
65 - Y'\ :sub:`13`
66
67 - .. row 3
68
69 - start + 8:
70
71 - Y'\ :sub:`20`
72
73 - Y'\ :sub:`21`
74
75 - Y'\ :sub:`22`
76
77 - Y'\ :sub:`23`
78
79 - .. row 4
80
81 - start + 12:
82
83 - Y'\ :sub:`30`
84
85 - Y'\ :sub:`31`
86
87 - Y'\ :sub:`32`
88
89 - Y'\ :sub:`33`
90
91 - .. row 5
92
93 - start + 16:
94
95 - Cb\ :sub:`00`
96
97 - Cb\ :sub:`01`
98
99 - .. row 6
100
101 - start + 18:
102
103 - Cb\ :sub:`10`
104
105 - Cb\ :sub:`11`
106
107 - .. row 7
108
109 - start + 20:
110
111 - Cb\ :sub:`20`
112
113 - Cb\ :sub:`21`
114
115 - .. row 8
116
117 - start + 22:
118
119 - Cb\ :sub:`30`
120
121 - Cb\ :sub:`31`
122
123 - .. row 9
124
125 - start + 24:
126
127 - Cr\ :sub:`00`
128
129 - Cr\ :sub:`01`
130
131 - .. row 10
132
133 - start + 26:
134
135 - Cr\ :sub:`10`
136
137 - Cr\ :sub:`11`
138
139 - .. row 11
140
141 - start + 28:
142
143 - Cr\ :sub:`20`
144
145 - Cr\ :sub:`21`
146
147 - .. row 12
148
149 - start + 30:
150
151 - Cr\ :sub:`30`
152
153 - Cr\ :sub:`31`
154
155
156**Color Sample Location..**
157
158
159
160.. flat-table::
161 :header-rows: 0
162 :stub-columns: 0
163
164
165 - .. row 1
166
167 -
168 - 0
169
170 -
171 - 1
172
173 - 2
174
175 -
176 - 3
177
178 - .. row 2
179
180 - 0
181
182 - Y
183
184 - C
185
186 - Y
187
188 - Y
189
190 - C
191
192 - Y
193
194 - .. row 3
195
196 - 1
197
198 - Y
199
200 - C
201
202 - Y
203
204 - Y
205
206 - C
207
208 - Y
209
210 - .. row 4
211
212 - 2
213
214 - Y
215
216 - C
217
218 - Y
219
220 - Y
221
222 - C
223
224 - Y
225
226 - .. row 5
227
228 - 3
229
230 - Y
231
232 - C
233
234 - Y
235
236 - Y
237
238 - C
239
240 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuv444m.rst b/Documentation/media/uapi/v4l/pixfmt-yuv444m.rst
new file mode 100644
index 000000000000..04f34508b934
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuv444m.rst
@@ -0,0 +1,266 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUV444M:
4.. _v4l2-pix-fmt-yvu444m:
5
6************************************************************
7V4L2_PIX_FMT_YUV444M ('YM24'), V4L2_PIX_FMT_YVU444M ('YM42')
8************************************************************
9
10*man V4L2_PIX_FMT_YUV444M(2)*
11
12V4L2_PIX_FMT_YVU444M
13Planar formats with full horizontal resolution, also known as YUV and
14YVU 4:4:4
15
16
17Description
18===========
19
20This is a multi-planar format, as opposed to a packed format. The three
21components are separated into three sub-images or planes.
22
23The Y plane is first. The Y plane has one byte per pixel. For
24``V4L2_PIX_FMT_YUV444M`` the Cb data constitutes the second plane which
25is the same width and height as the Y plane (and as the image). The Cr
26data, just like the Cb plane, is in the third plane.
27
28``V4L2_PIX_FMT_YVU444M`` is the same except the Cr data is stored in the
29second plane and the Cb data in the third plane.
30
31If the Y plane has pad bytes after each row, then the Cb and Cr planes
32have the same number of pad bytes after their rows.
33
34``V4L2_PIX_FMT_YUV444M`` and ``V4L2_PIX_FMT_YUV444M`` are intended to be
35used only in drivers and applications that support the multi-planar API,
36described in :ref:`planar-apis`.
37
38**Byte Order.**
39Each cell is one byte.
40
41.. flat-table::
42 :header-rows: 0
43 :stub-columns: 0
44 :widths: 2 1 1 1 1
45
46
47 - .. row 1
48
49 - start0 + 0:
50
51 - Y'\ :sub:`00`
52
53 - Y'\ :sub:`01`
54
55 - Y'\ :sub:`02`
56
57 - Y'\ :sub:`03`
58
59 - .. row 2
60
61 - start0 + 4:
62
63 - Y'\ :sub:`10`
64
65 - Y'\ :sub:`11`
66
67 - Y'\ :sub:`12`
68
69 - Y'\ :sub:`13`
70
71 - .. row 3
72
73 - start0 + 8:
74
75 - Y'\ :sub:`20`
76
77 - Y'\ :sub:`21`
78
79 - Y'\ :sub:`22`
80
81 - Y'\ :sub:`23`
82
83 - .. row 4
84
85 - start0 + 12:
86
87 - Y'\ :sub:`30`
88
89 - Y'\ :sub:`31`
90
91 - Y'\ :sub:`32`
92
93 - Y'\ :sub:`33`
94
95 - .. row 5
96
97 -
98
99 - .. row 6
100
101 - start1 + 0:
102
103 - Cb\ :sub:`00`
104
105 - Cb\ :sub:`01`
106
107 - Cb\ :sub:`02`
108
109 - Cb\ :sub:`03`
110
111 - .. row 7
112
113 - start1 + 4:
114
115 - Cb\ :sub:`10`
116
117 - Cb\ :sub:`11`
118
119 - Cb\ :sub:`12`
120
121 - Cb\ :sub:`13`
122
123 - .. row 8
124
125 - start1 + 8:
126
127 - Cb\ :sub:`20`
128
129 - Cb\ :sub:`21`
130
131 - Cb\ :sub:`22`
132
133 - Cb\ :sub:`23`
134
135 - .. row 9
136
137 - start1 + 12:
138
139 - Cb\ :sub:`20`
140
141 - Cb\ :sub:`21`
142
143 - Cb\ :sub:`32`
144
145 - Cb\ :sub:`33`
146
147 - .. row 10
148
149 -
150
151 - .. row 11
152
153 - start2 + 0:
154
155 - Cr\ :sub:`00`
156
157 - Cr\ :sub:`01`
158
159 - Cr\ :sub:`02`
160
161 - Cr\ :sub:`03`
162
163 - .. row 12
164
165 - start2 + 4:
166
167 - Cr\ :sub:`10`
168
169 - Cr\ :sub:`11`
170
171 - Cr\ :sub:`12`
172
173 - Cr\ :sub:`13`
174
175 - .. row 13
176
177 - start2 + 8:
178
179 - Cr\ :sub:`20`
180
181 - Cr\ :sub:`21`
182
183 - Cr\ :sub:`22`
184
185 - Cr\ :sub:`23`
186
187 - .. row 14
188
189 - start2 + 12:
190
191 - Cr\ :sub:`30`
192
193 - Cr\ :sub:`31`
194
195 - Cr\ :sub:`32`
196
197 - Cr\ :sub:`33`
198
199
200**Color Sample Location..**
201
202
203
204.. flat-table::
205 :header-rows: 0
206 :stub-columns: 0
207
208
209 - .. row 1
210
211 -
212 - 0
213
214 - 1
215
216 - 2
217
218 - 3
219
220 - .. row 2
221
222 - 0
223
224 - YC
225
226 - YC
227
228 - YC
229
230 - YC
231
232 - .. row 3
233
234 - 1
235
236 - YC
237
238 - YC
239
240 - YC
241
242 - YC
243
244 - .. row 4
245
246 - 2
247
248 - YC
249
250 - YC
251
252 - YC
253
254 - YC
255
256 - .. row 5
257
258 - 3
259
260 - YC
261
262 - YC
263
264 - YC
265
266 - YC
diff --git a/Documentation/media/uapi/v4l/pixfmt-yuyv.rst b/Documentation/media/uapi/v4l/pixfmt-yuyv.rst
new file mode 100644
index 000000000000..52917dfa9261
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yuyv.rst
@@ -0,0 +1,205 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YUYV:
4
5**************************
6V4L2_PIX_FMT_YUYV ('YUYV')
7**************************
8
9*man V4L2_PIX_FMT_YUYV(2)*
10
11Packed format with ½ horizontal chroma resolution, also known as YUV
124:2:2
13
14
15Description
16===========
17
18In this format each four bytes is two pixels. Each four bytes is two
19Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr
20belong to both pixels. As you can see, the Cr and Cb components have
21half the horizontal resolution of the Y component. ``V4L2_PIX_FMT_YUYV``
22is known in the Windows environment as YUY2.
23
24**Byte Order.**
25Each cell is one byte.
26
27
28
29.. flat-table::
30 :header-rows: 0
31 :stub-columns: 0
32 :widths: 2 1 1 1 1 1 1 1 1
33
34
35 - .. row 1
36
37 - start + 0:
38
39 - Y'\ :sub:`00`
40
41 - Cb\ :sub:`00`
42
43 - Y'\ :sub:`01`
44
45 - Cr\ :sub:`00`
46
47 - Y'\ :sub:`02`
48
49 - Cb\ :sub:`01`
50
51 - Y'\ :sub:`03`
52
53 - Cr\ :sub:`01`
54
55 - .. row 2
56
57 - start + 8:
58
59 - Y'\ :sub:`10`
60
61 - Cb\ :sub:`10`
62
63 - Y'\ :sub:`11`
64
65 - Cr\ :sub:`10`
66
67 - Y'\ :sub:`12`
68
69 - Cb\ :sub:`11`
70
71 - Y'\ :sub:`13`
72
73 - Cr\ :sub:`11`
74
75 - .. row 3
76
77 - start + 16:
78
79 - Y'\ :sub:`20`
80
81 - Cb\ :sub:`20`
82
83 - Y'\ :sub:`21`
84
85 - Cr\ :sub:`20`
86
87 - Y'\ :sub:`22`
88
89 - Cb\ :sub:`21`
90
91 - Y'\ :sub:`23`
92
93 - Cr\ :sub:`21`
94
95 - .. row 4
96
97 - start + 24:
98
99 - Y'\ :sub:`30`
100
101 - Cb\ :sub:`30`
102
103 - Y'\ :sub:`31`
104
105 - Cr\ :sub:`30`
106
107 - Y'\ :sub:`32`
108
109 - Cb\ :sub:`31`
110
111 - Y'\ :sub:`33`
112
113 - Cr\ :sub:`31`
114
115
116**Color Sample Location..**
117
118
119
120.. flat-table::
121 :header-rows: 0
122 :stub-columns: 0
123
124
125 - .. row 1
126
127 -
128 - 0
129
130 -
131 - 1
132
133 -
134 - 2
135
136 -
137 - 3
138
139 - .. row 2
140
141 - 0
142
143 - Y
144
145 - C
146
147 - Y
148
149 -
150 - Y
151
152 - C
153
154 - Y
155
156 - .. row 3
157
158 - 1
159
160 - Y
161
162 - C
163
164 - Y
165
166 -
167 - Y
168
169 - C
170
171 - Y
172
173 - .. row 4
174
175 - 2
176
177 - Y
178
179 - C
180
181 - Y
182
183 -
184 - Y
185
186 - C
187
188 - Y
189
190 - .. row 5
191
192 - 3
193
194 - Y
195
196 - C
197
198 - Y
199
200 -
201 - Y
202
203 - C
204
205 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-yvyu.rst b/Documentation/media/uapi/v4l/pixfmt-yvyu.rst
new file mode 100644
index 000000000000..e466052b68b2
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-yvyu.rst
@@ -0,0 +1,195 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-YVYU:
4
5**************************
6V4L2_PIX_FMT_YVYU ('YVYU')
7**************************
8
9*man V4L2_PIX_FMT_YVYU(2)*
10
11Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
12memory
13
14
15Description
16===========
17
18In this format each four bytes is two pixels. Each four bytes is two
19Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr
20belong to both pixels. As you can see, the Cr and Cb components have
21half the horizontal resolution of the Y component.
22
23**Byte Order.**
24Each cell is one byte.
25
26.. flat-table::
27 :header-rows: 0
28 :stub-columns: 0
29 :widths: 2 1 1 1 1 1 1 1 1
30
31
32 - .. row 1
33
34 - start + 0:
35
36 - Y'\ :sub:`00`
37
38 - Cr\ :sub:`00`
39
40 - Y'\ :sub:`01`
41
42 - Cb\ :sub:`00`
43
44 - Y'\ :sub:`02`
45
46 - Cr\ :sub:`01`
47
48 - Y'\ :sub:`03`
49
50 - Cb\ :sub:`01`
51
52 - .. row 2
53
54 - start + 8:
55
56 - Y'\ :sub:`10`
57
58 - Cr\ :sub:`10`
59
60 - Y'\ :sub:`11`
61
62 - Cb\ :sub:`10`
63
64 - Y'\ :sub:`12`
65
66 - Cr\ :sub:`11`
67
68 - Y'\ :sub:`13`
69
70 - Cb\ :sub:`11`
71
72 - .. row 3
73
74 - start + 16:
75
76 - Y'\ :sub:`20`
77
78 - Cr\ :sub:`20`
79
80 - Y'\ :sub:`21`
81
82 - Cb\ :sub:`20`
83
84 - Y'\ :sub:`22`
85
86 - Cr\ :sub:`21`
87
88 - Y'\ :sub:`23`
89
90 - Cb\ :sub:`21`
91
92 - .. row 4
93
94 - start + 24:
95
96 - Y'\ :sub:`30`
97
98 - Cr\ :sub:`30`
99
100 - Y'\ :sub:`31`
101
102 - Cb\ :sub:`30`
103
104 - Y'\ :sub:`32`
105
106 - Cr\ :sub:`31`
107
108 - Y'\ :sub:`33`
109
110 - Cb\ :sub:`31`
111
112
113**Color Sample Location..**
114
115.. flat-table::
116 :header-rows: 0
117 :stub-columns: 0
118
119
120 - .. row 1
121
122 -
123 - 0
124
125 -
126 - 1
127
128 - 2
129
130 -
131 - 3
132
133 - .. row 2
134
135 - 0
136
137 - Y
138
139 - C
140
141 - Y
142
143 - Y
144
145 - C
146
147 - Y
148
149 - .. row 3
150
151 - 1
152
153 - Y
154
155 - C
156
157 - Y
158
159 - Y
160
161 - C
162
163 - Y
164
165 - .. row 4
166
167 - 2
168
169 - Y
170
171 - C
172
173 - Y
174
175 - Y
176
177 - C
178
179 - Y
180
181 - .. row 5
182
183 - 3
184
185 - Y
186
187 - C
188
189 - Y
190
191 - Y
192
193 - C
194
195 - Y
diff --git a/Documentation/media/uapi/v4l/pixfmt-z16.rst b/Documentation/media/uapi/v4l/pixfmt-z16.rst
new file mode 100644
index 000000000000..4ebc561d0480
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-z16.rst
@@ -0,0 +1,111 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-Z16:
4
5*************************
6V4L2_PIX_FMT_Z16 ('Z16 ')
7*************************
8
9*man V4L2_PIX_FMT_Z16(2)*
10
1116-bit depth data with distance values at each pixel
12
13
14Description
15===========
16
17This is a 16-bit format, representing depth data. Each pixel is a
18distance to the respective point in the image coordinates. Distance unit
19can vary and has to be negotiated with the device separately. Each pixel
20is stored in a 16-bit word in the little endian byte order.
21
22**Byte Order.**
23Each cell is one byte.
24
25
26
27.. flat-table::
28 :header-rows: 0
29 :stub-columns: 0
30 :widths: 2 1 1 1 1 1 1 1 1
31
32
33 - .. row 1
34
35 - start + 0:
36
37 - Z\ :sub:`00low`
38
39 - Z\ :sub:`00high`
40
41 - Z\ :sub:`01low`
42
43 - Z\ :sub:`01high`
44
45 - Z\ :sub:`02low`
46
47 - Z\ :sub:`02high`
48
49 - Z\ :sub:`03low`
50
51 - Z\ :sub:`03high`
52
53 - .. row 2
54
55 - start + 8:
56
57 - Z\ :sub:`10low`
58
59 - Z\ :sub:`10high`
60
61 - Z\ :sub:`11low`
62
63 - Z\ :sub:`11high`
64
65 - Z\ :sub:`12low`
66
67 - Z\ :sub:`12high`
68
69 - Z\ :sub:`13low`
70
71 - Z\ :sub:`13high`
72
73 - .. row 3
74
75 - start + 16:
76
77 - Z\ :sub:`20low`
78
79 - Z\ :sub:`20high`
80
81 - Z\ :sub:`21low`
82
83 - Z\ :sub:`21high`
84
85 - Z\ :sub:`22low`
86
87 - Z\ :sub:`22high`
88
89 - Z\ :sub:`23low`
90
91 - Z\ :sub:`23high`
92
93 - .. row 4
94
95 - start + 24:
96
97 - Z\ :sub:`30low`
98
99 - Z\ :sub:`30high`
100
101 - Z\ :sub:`31low`
102
103 - Z\ :sub:`31high`
104
105 - Z\ :sub:`32low`
106
107 - Z\ :sub:`32high`
108
109 - Z\ :sub:`33low`
110
111 - Z\ :sub:`33high`
diff --git a/Documentation/media/uapi/v4l/pixfmt.rst b/Documentation/media/uapi/v4l/pixfmt.rst
new file mode 100644
index 000000000000..81222a99f7ce
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt.rst
@@ -0,0 +1,35 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _pixfmt:
4
5#############
6Image Formats
7#############
8The V4L2 API was primarily designed for devices exchanging image data
9with applications. The :ref:`struct v4l2_pix_format <v4l2-pix-format>` and
10:ref:`struct v4l2_pix_format_mplane <v4l2-pix-format-mplane>` structures define the
11format and layout of an image in memory. The former is used with the
12single-planar API, while the latter is used with the multi-planar
13version (see :ref:`planar-apis`). Image formats are negotiated with
14the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. (The explanations here
15focus on video capturing and output, for overlay frame buffer formats
16see also :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`.)
17
18
19.. toctree::
20 :maxdepth: 1
21
22 pixfmt-002
23 pixfmt-003
24 pixfmt-004
25 colorspaces
26 pixfmt-006
27 pixfmt-007
28 pixfmt-008
29 pixfmt-indexed
30 pixfmt-rgb
31 yuv-formats
32 depth-formats
33 pixfmt-013
34 sdr-formats
35 pixfmt-reserved
diff --git a/Documentation/media/uapi/v4l/planar-apis.rst b/Documentation/media/uapi/v4l/planar-apis.rst
new file mode 100644
index 000000000000..5fe2e1188230
--- /dev/null
+++ b/Documentation/media/uapi/v4l/planar-apis.rst
@@ -0,0 +1,61 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _planar-apis:
4
5*****************************
6Single- and multi-planar APIs
7*****************************
8
9Some devices require data for each input or output video frame to be
10placed in discontiguous memory buffers. In such cases, one video frame
11has to be addressed using more than one memory address, i.e. one pointer
12per "plane". A plane is a sub-buffer of the current frame. For examples
13of such formats see :ref:`pixfmt`.
14
15Initially, V4L2 API did not support multi-planar buffers and a set of
16extensions has been introduced to handle them. Those extensions
17constitute what is being referred to as the "multi-planar API".
18
19Some of the V4L2 API calls and structures are interpreted differently,
20depending on whether single- or multi-planar API is being used. An
21application can choose whether to use one or the other by passing a
22corresponding buffer type to its ioctl calls. Multi-planar versions of
23buffer types are suffixed with an ``_MPLANE`` string. For a list of
24available multi-planar buffer types see enum
25:ref:`v4l2_buf_type <v4l2-buf-type>`.
26
27
28Multi-planar formats
29====================
30
31Multi-planar API introduces new multi-planar formats. Those formats use
32a separate set of FourCC codes. It is important to distinguish between
33the multi-planar API and a multi-planar format. Multi-planar API calls
34can handle all single-planar formats as well (as long as they are passed
35in multi-planar API structures), while the single-planar API cannot
36handle multi-planar formats.
37
38
39Calls that distinguish between single and multi-planar APIs
40===========================================================
41
42:ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>`
43 Two additional multi-planar capabilities are added. They can be set
44 together with non-multi-planar ones for devices that handle both
45 single- and multi-planar formats.
46
47:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
48 New structures for describing multi-planar formats are added: struct
49 :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` and
50 struct :ref:`v4l2_plane_pix_format <v4l2-plane-pix-format>`.
51 Drivers may define new multi-planar formats, which have distinct
52 FourCC codes from the existing single-planar ones.
53
54:ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>`
55 A new struct :ref:`v4l2_plane <v4l2-plane>` structure for
56 describing planes is added. Arrays of this structure are passed in
57 the new ``m.planes`` field of struct
58 :ref:`v4l2_buffer <v4l2-buffer>`.
59
60:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
61 Will allocate multi-planar buffers as requested.
diff --git a/Documentation/media/uapi/v4l/querycap.rst b/Documentation/media/uapi/v4l/querycap.rst
new file mode 100644
index 000000000000..c19cce7a816f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/querycap.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _querycap:
4
5*********************
6Querying Capabilities
7*********************
8
9Because V4L2 covers a wide variety of devices not all aspects of the API
10are equally applicable to all types of devices. Furthermore devices of
11the same type have different capabilities and this specification permits
12the omission of a few complicated and less important parts of the API.
13
14The :ref:`VIDIOC_QUERYCAP` ioctl is available to
15check if the kernel device is compatible with this specification, and to
16query the :ref:`functions <devices>` and :ref:`I/O methods <io>`
17supported by the device.
18
19Starting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
20will return the V4L2 API version used by the driver, with generally
21matches the Kernel version. There's no need of using
22:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
23is supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
24provide support for an ioctl.
25
26Other features can be queried by calling the respective ioctl, for
27example :ref:`VIDIOC_ENUMINPUT` to learn about the
28number, types and names of video connectors on the device. Although
29abstraction is a major objective of this API, the
30:ref:`VIDIOC_QUERYCAP` ioctl also allows driver
31specific applications to reliably identify the driver.
32
33All V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
34Applications should always call this ioctl after opening the device.
diff --git a/Documentation/media/uapi/v4l/rw.rst b/Documentation/media/uapi/v4l/rw.rst
new file mode 100644
index 000000000000..dcac379c484f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/rw.rst
@@ -0,0 +1,47 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _rw:
4
5**********
6Read/Write
7**********
8
9Input and output devices support the :ref:`read() <func-read>` and
10:ref:`write() <func-write>` function, respectively, when the
11``V4L2_CAP_READWRITE`` flag in the ``capabilities`` field of struct
12:ref:`v4l2_capability <v4l2-capability>` returned by the
13:ref:`VIDIOC_QUERYCAP` ioctl is set.
14
15Drivers may need the CPU to copy the data, but they may also support DMA
16to or from user memory, so this I/O method is not necessarily less
17efficient than other methods merely exchanging buffer pointers. It is
18considered inferior though because no meta-information like frame
19counters or timestamps are passed. This information is necessary to
20recognize frame dropping and to synchronize with other data streams.
21However this is also the simplest I/O method, requiring little or no
22setup to exchange data. It permits command line stunts like this (the
23vidctrl tool is fictitious):
24
25
26.. code-block:: none
27
28 $ vidctrl /dev/video --input=0 --format=YUYV --size=352x288
29 $ dd if=/dev/video of=myimage.422 bs=202752 count=1
30
31To read from the device applications use the :ref:`read() <func-read>`
32function, to write the :ref:`write() <func-write>` function. Drivers
33must implement one I/O method if they exchange data with applications,
34but it need not be this. [#f1]_ When reading or writing is supported, the
35driver must also support the :ref:`select() <func-select>` and
36:ref:`poll() <func-poll>` function. [#f2]_
37
38.. [#f1]
39 It would be desirable if applications could depend on drivers
40 supporting all I/O interfaces, but as much as the complex memory
41 mapping I/O can be inadequate for some devices we have no reason to
42 require this interface, which is most useful for simple applications
43 capturing still images.
44
45.. [#f2]
46 At the driver level :ref:`select() <func-select>` and :ref:`poll() <func-poll>` are
47 the same, and :ref:`select() <func-select>` is too important to be optional.
diff --git a/Documentation/media/uapi/v4l/sdr-formats.rst b/Documentation/media/uapi/v4l/sdr-formats.rst
new file mode 100644
index 000000000000..f863c08f1add
--- /dev/null
+++ b/Documentation/media/uapi/v4l/sdr-formats.rst
@@ -0,0 +1,19 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _sdr-formats:
4
5***********
6SDR Formats
7***********
8
9These formats are used for :ref:`SDR <sdr>` interface only.
10
11
12.. toctree::
13 :maxdepth: 1
14
15 pixfmt-sdr-cu08
16 pixfmt-sdr-cu16le
17 pixfmt-sdr-cs08
18 pixfmt-sdr-cs14le
19 pixfmt-sdr-ru12le
diff --git a/Documentation/media/uapi/v4l/selection-api-002.rst b/Documentation/media/uapi/v4l/selection-api-002.rst
new file mode 100644
index 000000000000..09ca93f91bf7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-002.rst
@@ -0,0 +1,28 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3************
4Introduction
5************
6
7Some video capture devices can sample a subsection of a picture and
8shrink or enlarge it to an image of arbitrary size. Next, the devices
9can insert the image into larger one. Some video output devices can crop
10part of an input image, scale it up or down and insert it at an
11arbitrary scan line and horizontal offset into a video signal. We call
12these abilities cropping, scaling and composing.
13
14On a video *capture* device the source is a video signal, and the
15cropping target determine the area actually sampled. The sink is an
16image stored in a memory buffer. The composing area specifies which part
17of the buffer is actually written to by the hardware.
18
19On a video *output* device the source is an image in a memory buffer,
20and the cropping target is a part of an image to be shown on a display.
21The sink is the display or the graphics screen. The application may
22select the part of display where the image should be displayed. The size
23and position of such a window is controlled by the compose target.
24
25Rectangles for all cropping and composing targets are defined even if
26the device does supports neither cropping nor composing. Their size and
27position will be fixed in such a case. If the device does not support
28scaling then the cropping and composing rectangles have the same size.
diff --git a/Documentation/media/uapi/v4l/selection-api-003.rst b/Documentation/media/uapi/v4l/selection-api-003.rst
new file mode 100644
index 000000000000..15cb3b79f12c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-003.rst
@@ -0,0 +1,20 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3*****************
4Selection targets
5*****************
6
7
8.. _sel-targets-capture:
9
10.. figure:: selection-api-003_files/selection.*
11 :alt: selection.png
12 :align: center
13
14 Cropping and composing targets
15
16 Targets used by a cropping, composing and scaling process
17
18
19
20See :ref:`v4l2-selection-targets` for more information.
diff --git a/Documentation/media/uapi/v4l/selection-api-003_files/selection.png b/Documentation/media/uapi/v4l/selection-api-003_files/selection.png
new file mode 100644
index 000000000000..bfc523eae570
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-003_files/selection.png
Binary files differ
diff --git a/Documentation/media/uapi/v4l/selection-api-004.rst b/Documentation/media/uapi/v4l/selection-api-004.rst
new file mode 100644
index 000000000000..d782cd5b2117
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-004.rst
@@ -0,0 +1,137 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3*************
4Configuration
5*************
6
7Applications can use the :ref:`selection API <VIDIOC_G_SELECTION>` to
8select an area in a video signal or a buffer, and to query for default
9settings and hardware limits.
10
11Video hardware can have various cropping, composing and scaling
12limitations. It may only scale up or down, support only discrete scaling
13factors, or have different scaling abilities in the horizontal and
14vertical directions. Also it may not support scaling at all. At the same
15time the cropping/composing rectangles may have to be aligned, and both
16the source and the sink may have arbitrary upper and lower size limits.
17Therefore, as usual, drivers are expected to adjust the requested
18parameters and return the actual values selected. An application can
19control the rounding behaviour using
20:ref:`constraint flags <v4l2-selection-flags>`.
21
22
23Configuration of video capture
24==============================
25
26See figure :ref:`sel-targets-capture` for examples of the selection
27targets available for a video capture device. It is recommended to
28configure the cropping targets before to the composing targets.
29
30The range of coordinates of the top left corner, width and height of
31areas that can be sampled is given by the ``V4L2_SEL_TGT_CROP_BOUNDS``
32target. It is recommended for the driver developers to put the top/left
33corner at position ``(0,0)``. The rectangle's coordinates are expressed
34in pixels.
35
36The top left corner, width and height of the source rectangle, that is
37the area actually sampled, is given by the ``V4L2_SEL_TGT_CROP`` target.
38It uses the same coordinate system as ``V4L2_SEL_TGT_CROP_BOUNDS``. The
39active cropping area must lie completely inside the capture boundaries.
40The driver may further adjust the requested size and/or position
41according to hardware limitations.
42
43Each capture device has a default source rectangle, given by the
44``V4L2_SEL_TGT_CROP_DEFAULT`` target. This rectangle shall over what the
45driver writer considers the complete picture. Drivers shall set the
46active crop rectangle to the default when the driver is first loaded,
47but not later.
48
49The composing targets refer to a memory buffer. The limits of composing
50coordinates are obtained using ``V4L2_SEL_TGT_COMPOSE_BOUNDS``. All
51coordinates are expressed in pixels. The rectangle's top/left corner
52must be located at position ``(0,0)``. The width and height are equal to
53the image size set by :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`.
54
55The part of a buffer into which the image is inserted by the hardware is
56controlled by the ``V4L2_SEL_TGT_COMPOSE`` target. The rectangle's
57coordinates are also expressed in the same coordinate system as the
58bounds rectangle. The composing rectangle must lie completely inside
59bounds rectangle. The driver must adjust the composing rectangle to fit
60to the bounding limits. Moreover, the driver can perform other
61adjustments according to hardware limitations. The application can
62control rounding behaviour using
63:ref:`constraint flags <v4l2-selection-flags>`.
64
65For capture devices the default composing rectangle is queried using
66``V4L2_SEL_TGT_COMPOSE_DEFAULT``. It is usually equal to the bounding
67rectangle.
68
69The part of a buffer that is modified by the hardware is given by
70``V4L2_SEL_TGT_COMPOSE_PADDED``. It contains all pixels defined using
71``V4L2_SEL_TGT_COMPOSE`` plus all padding data modified by hardware
72during insertion process. All pixels outside this rectangle *must not*
73be changed by the hardware. The content of pixels that lie inside the
74padded area but outside active area is undefined. The application can
75use the padded and active rectangles to detect where the rubbish pixels
76are located and remove them if needed.
77
78
79Configuration of video output
80=============================
81
82For output devices targets and ioctls are used similarly to the video
83capture case. The *composing* rectangle refers to the insertion of an
84image into a video signal. The cropping rectangles refer to a memory
85buffer. It is recommended to configure the composing targets before to
86the cropping targets.
87
88The cropping targets refer to the memory buffer that contains an image
89to be inserted into a video signal or graphical screen. The limits of
90cropping coordinates are obtained using ``V4L2_SEL_TGT_CROP_BOUNDS``.
91All coordinates are expressed in pixels. The top/left corner is always
92point ``(0,0)``. The width and height is equal to the image size
93specified using :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
94
95The top left corner, width and height of the source rectangle, that is
96the area from which image date are processed by the hardware, is given
97by the ``V4L2_SEL_TGT_CROP``. Its coordinates are expressed in in the
98same coordinate system as the bounds rectangle. The active cropping area
99must lie completely inside the crop boundaries and the driver may
100further adjust the requested size and/or position according to hardware
101limitations.
102
103For output devices the default cropping rectangle is queried using
104``V4L2_SEL_TGT_CROP_DEFAULT``. It is usually equal to the bounding
105rectangle.
106
107The part of a video signal or graphics display where the image is
108inserted by the hardware is controlled by ``V4L2_SEL_TGT_COMPOSE``
109target. The rectangle's coordinates are expressed in pixels. The
110composing rectangle must lie completely inside the bounds rectangle. The
111driver must adjust the area to fit to the bounding limits. Moreover, the
112driver can perform other adjustments according to hardware limitations.
113
114The device has a default composing rectangle, given by the
115``V4L2_SEL_TGT_COMPOSE_DEFAULT`` target. This rectangle shall cover what
116the driver writer considers the complete picture. It is recommended for
117the driver developers to put the top/left corner at position ``(0,0)``.
118Drivers shall set the active composing rectangle to the default one when
119the driver is first loaded.
120
121The devices may introduce additional content to video signal other than
122an image from memory buffers. It includes borders around an image.
123However, such a padded area is driver-dependent feature not covered by
124this document. Driver developers are encouraged to keep padded rectangle
125equal to active one. The padded target is accessed by the
126``V4L2_SEL_TGT_COMPOSE_PADDED`` identifier. It must contain all pixels
127from the ``V4L2_SEL_TGT_COMPOSE`` target.
128
129
130Scaling control
131===============
132
133An application can detect if scaling is performed by comparing the width
134and the height of rectangles obtained using ``V4L2_SEL_TGT_CROP`` and
135``V4L2_SEL_TGT_COMPOSE`` targets. If these are not equal then the
136scaling is applied. The application can compute the scaling ratios using
137these values.
diff --git a/Documentation/media/uapi/v4l/selection-api-005.rst b/Documentation/media/uapi/v4l/selection-api-005.rst
new file mode 100644
index 000000000000..94731a13efdb
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-005.rst
@@ -0,0 +1,34 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3********************************
4Comparison with old cropping API
5********************************
6
7The selection API was introduced to cope with deficiencies of previous
8:ref:`API <crop>`, that was designed to control simple capture
9devices. Later the cropping API was adopted by video output drivers. The
10ioctls are used to select a part of the display were the video signal is
11inserted. It should be considered as an API abuse because the described
12operation is actually the composing. The selection API makes a clear
13distinction between composing and cropping operations by setting the
14appropriate targets. The V4L2 API lacks any support for composing to and
15cropping from an image inside a memory buffer. The application could
16configure a capture device to fill only a part of an image by abusing
17V4L2 API. Cropping a smaller image from a larger one is achieved by
18setting the field ``bytesperline`` at struct
19:ref:`v4l2_pix_format <v4l2-pix-format>`.
20Introducing an image offsets could be done by modifying field ``m_userptr``
21at struct
22:ref:`v4l2_buffer <v4l2-buffer>` before calling
23:ref:`VIDIOC_QBUF`. Those operations should be avoided because they are not
24portable (endianness), and do not work for macroblock and Bayer formats
25and mmap buffers. The selection API deals with configuration of buffer
26cropping/composing in a clear, intuitive and portable way. Next, with
27the selection API the concepts of the padded target and constraints
28flags are introduced. Finally, struct :ref:`v4l2_crop <v4l2-crop>`
29and struct :ref:`v4l2_cropcap <v4l2-cropcap>` have no reserved
30fields. Therefore there is no way to extend their functionality. The new
31struct :ref:`v4l2_selection <v4l2-selection>` provides a lot of place
32for future extensions. Driver developers are encouraged to implement
33only selection API. The former cropping API would be simulated using the
34new one.
diff --git a/Documentation/media/uapi/v4l/selection-api-006.rst b/Documentation/media/uapi/v4l/selection-api-006.rst
new file mode 100644
index 000000000000..67e0e9aed9e8
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-006.rst
@@ -0,0 +1,84 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3********
4Examples
5********
6
7(A video capture device is assumed; change
8``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other devices; change target to
9``V4L2_SEL_TGT_COMPOSE_*`` family to configure composing area)
10
11Example: Resetting the cropping parameters
12==========================================
13
14.. code-block:: c
15
16 struct v4l2_selection sel = {
17 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
18 .target = V4L2_SEL_TGT_CROP_DEFAULT,
19 };
20 ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
21 if (ret)
22 exit(-1);
23 sel.target = V4L2_SEL_TGT_CROP;
24 ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
25 if (ret)
26 exit(-1);
27
28Setting a composing area on output of size of *at most* half of limit
29placed at a center of a display.
30
31Example: Simple downscaling
32===========================
33
34.. code-block:: c
35
36 struct v4l2_selection sel = {
37 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
38 .target = V4L2_SEL_TGT_COMPOSE_BOUNDS,
39 };
40 struct v4l2_rect r;
41
42 ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
43 if (ret)
44 exit(-1);
45 /* setting smaller compose rectangle */
46 r.width = sel.r.width / 2;
47 r.height = sel.r.height / 2;
48 r.left = sel.r.width / 4;
49 r.top = sel.r.height / 4;
50 sel.r = r;
51 sel.target = V4L2_SEL_TGT_COMPOSE;
52 sel.flags = V4L2_SEL_FLAG_LE;
53 ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
54 if (ret)
55 exit(-1);
56
57A video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
58for other devices
59
60Example: Querying for scaling factors
61=====================================
62
63.. code-block:: c
64
65 struct v4l2_selection compose = {
66 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
67 .target = V4L2_SEL_TGT_COMPOSE,
68 };
69 struct v4l2_selection crop = {
70 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
71 .target = V4L2_SEL_TGT_CROP,
72 };
73 double hscale, vscale;
74
75 ret = ioctl(fd, VIDIOC_G_SELECTION, &compose);
76 if (ret)
77 exit(-1);
78 ret = ioctl(fd, VIDIOC_G_SELECTION, &crop);
79 if (ret)
80 exit(-1);
81
82 /* computing scaling factors */
83 hscale = (double)compose.r.width / crop.r.width;
84 vscale = (double)compose.r.height / crop.r.height;
diff --git a/Documentation/media/uapi/v4l/selection-api.rst b/Documentation/media/uapi/v4l/selection-api.rst
new file mode 100644
index 000000000000..81ea52d785b9
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api.rst
@@ -0,0 +1,16 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _selection-api:
4
5API for cropping, composing and scaling
6=======================================
7
8
9.. toctree::
10 :maxdepth: 1
11
12 selection-api-002
13 selection-api-003
14 selection-api-004
15 selection-api-005
16 selection-api-006
diff --git a/Documentation/media/uapi/v4l/selections-common.rst b/Documentation/media/uapi/v4l/selections-common.rst
new file mode 100644
index 000000000000..69dbce4e6e47
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selections-common.rst
@@ -0,0 +1,23 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-selections-common:
4
5Common selection definitions
6============================
7
8While the :ref:`V4L2 selection API <selection-api>` and
9:ref:`V4L2 subdev selection APIs <v4l2-subdev-selections>` are very
10similar, there's one fundamental difference between the two. On
11sub-device API, the selection rectangle refers to the media bus format,
12and is bound to a sub-device's pad. On the V4L2 interface the selection
13rectangles refer to the in-memory pixel format.
14
15This section defines the common definitions of the selection interfaces
16on the two APIs.
17
18
19.. toctree::
20 :maxdepth: 1
21
22 v4l2-selection-targets
23 v4l2-selection-flags
diff --git a/Documentation/media/uapi/v4l/standard.rst b/Documentation/media/uapi/v4l/standard.rst
new file mode 100644
index 000000000000..c4f678f545ec
--- /dev/null
+++ b/Documentation/media/uapi/v4l/standard.rst
@@ -0,0 +1,183 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _standard:
4
5***************
6Video Standards
7***************
8
9Video devices typically support one or more different video standards or
10variations of standards. Each video input and output may support another
11set of standards. This set is reported by the ``std`` field of struct
12:ref:`v4l2_input <v4l2-input>` and struct
13:ref:`v4l2_output <v4l2-output>` returned by the
14:ref:`VIDIOC_ENUMINPUT` and
15:ref:`VIDIOC_ENUMOUTPUT` ioctls, respectively.
16
17V4L2 defines one bit for each analog video standard currently in use
18worldwide, and sets aside bits for driver defined standards, e. g.
19hybrid standards to watch NTSC video tapes on PAL TVs and vice versa.
20Applications can use the predefined bits to select a particular
21standard, although presenting the user a menu of supported standards is
22preferred. To enumerate and query the attributes of the supported
23standards applications use the :ref:`VIDIOC_ENUMSTD`
24ioctl.
25
26Many of the defined standards are actually just variations of a few
27major standards. The hardware may in fact not distinguish between them,
28or do so internal and switch automatically. Therefore enumerated
29standards also contain sets of one or more standard bits.
30
31Assume a hypothetic tuner capable of demodulating B/PAL, G/PAL and I/PAL
32signals. The first enumerated standard is a set of B and G/PAL, switched
33automatically depending on the selected radio frequency in UHF or VHF
34band. Enumeration gives a "PAL-B/G" or "PAL-I" choice. Similar a
35Composite input may collapse standards, enumerating "PAL-B/G/H/I",
36"NTSC-M" and "SECAM-D/K". [#f1]_
37
38To query and select the standard used by the current video input or
39output applications call the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and
40:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctl, respectively. The
41*received* standard can be sensed with the
42:ref:`VIDIOC_QUERYSTD` ioctl.
43
44..note:: The parameter of all these ioctls is a pointer to a
45 :ref:`v4l2_std_id <v4l2-std-id>` type (a standard set), *not* an
46 index into the standard enumeration. Drivers must implement all video
47 standard ioctls when the device has one or more video inputs or outputs.
48
49Special rules apply to devices such as USB cameras where the notion of
50video standards makes little sense. More generally for any capture or
51output device which is:
52
53- incapable of capturing fields or frames at the nominal rate of the
54 video standard, or
55
56- that does not support the video standard formats at all.
57
58Here the driver shall set the ``std`` field of struct
59:ref:`v4l2_input <v4l2-input>` and struct
60:ref:`v4l2_output <v4l2-output>` to zero and the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`,
61:ref:`VIDIOC_S_STD <VIDIOC_G_STD>`, :ref:`VIDIOC_QUERYSTD` and :ref:`VIDIOC_ENUMSTD` ioctls
62shall return the ``ENOTTY`` error code or the ``EINVAL`` error code.
63
64Applications can make use of the :ref:`input-capabilities` and
65:ref:`output-capabilities` flags to determine whether the video
66standard ioctls can be used with the given input or output.
67
68Example: Information about the current video standard
69=====================================================
70
71.. code-block:: c
72
73 v4l2_std_id std_id;
74 struct v4l2_standard standard;
75
76 if (-1 == ioctl(fd, VIDIOC_G_STD, &std_id)) {
77 /* Note when VIDIOC_ENUMSTD always returns ENOTTY this
78 is no video device or it falls under the USB exception,
79 and VIDIOC_G_STD returning ENOTTY is no error. */
80
81 perror("VIDIOC_G_STD");
82 exit(EXIT_FAILURE);
83 }
84
85 memset(&standard, 0, sizeof(standard));
86 standard.index = 0;
87
88 while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) {
89 if (standard.id & std_id) {
90 printf("Current video standard: %s\\n", standard.name);
91 exit(EXIT_SUCCESS);
92 }
93
94 standard.index++;
95 }
96
97 /* EINVAL indicates the end of the enumeration, which cannot be
98 empty unless this device falls under the USB exception. */
99
100 if (errno == EINVAL || standard.index == 0) {
101 perror("VIDIOC_ENUMSTD");
102 exit(EXIT_FAILURE);
103 }
104
105Example: Listing the video standards supported by the current input
106===================================================================
107
108.. code-block:: c
109
110 struct v4l2_input input;
111 struct v4l2_standard standard;
112
113 memset(&input, 0, sizeof(input));
114
115 if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) {
116 perror("VIDIOC_G_INPUT");
117 exit(EXIT_FAILURE);
118 }
119
120 if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) {
121 perror("VIDIOC_ENUM_INPUT");
122 exit(EXIT_FAILURE);
123 }
124
125 printf("Current input %s supports:\\n", input.name);
126
127 memset(&standard, 0, sizeof(standard));
128 standard.index = 0;
129
130 while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) {
131 if (standard.id & input.std)
132 printf("%s\\n", standard.name);
133
134 standard.index++;
135 }
136
137 /* EINVAL indicates the end of the enumeration, which cannot be
138 empty unless this device falls under the USB exception. */
139
140 if (errno != EINVAL || standard.index == 0) {
141 perror("VIDIOC_ENUMSTD");
142 exit(EXIT_FAILURE);
143 }
144
145Example: Selecting a new video standard
146=======================================
147
148.. code-block:: c
149
150 struct v4l2_input input;
151 v4l2_std_id std_id;
152
153 memset(&input, 0, sizeof(input));
154
155 if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) {
156 perror("VIDIOC_G_INPUT");
157 exit(EXIT_FAILURE);
158 }
159
160 if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) {
161 perror("VIDIOC_ENUM_INPUT");
162 exit(EXIT_FAILURE);
163 }
164
165 if (0 == (input.std & V4L2_STD_PAL_BG)) {
166 fprintf(stderr, "Oops. B/G PAL is not supported.\\n");
167 exit(EXIT_FAILURE);
168 }
169
170 /* Note this is also supposed to work when only B
171 or G/PAL is supported. */
172
173 std_id = V4L2_STD_PAL_BG;
174
175 if (-1 == ioctl(fd, VIDIOC_S_STD, &std_id)) {
176 perror("VIDIOC_S_STD");
177 exit(EXIT_FAILURE);
178 }
179
180.. [#f1]
181 Some users are already confused by technical terms PAL, NTSC and
182 SECAM. There is no point asking them to distinguish between B, G, D,
183 or K when the software or hardware can do that automatically.
diff --git a/Documentation/media/uapi/v4l/streaming-par.rst b/Documentation/media/uapi/v4l/streaming-par.rst
new file mode 100644
index 000000000000..b07b0f0b35d4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/streaming-par.rst
@@ -0,0 +1,33 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _streaming-par:
4
5********************
6Streaming Parameters
7********************
8
9Streaming parameters are intended to optimize the video capture process
10as well as I/O. Presently applications can request a high quality
11capture mode with the :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl.
12
13The current video standard determines a nominal number of frames per
14second. If less than this number of frames is to be captured or output,
15applications can request frame skipping or duplicating on the driver
16side. This is especially useful when using the
17:ref:`read() <func-read>` or :ref:`write() <func-write>`, which are
18not augmented by timestamps or sequence counters, and to avoid
19unnecessary data copying.
20
21Finally these ioctls can be used to determine the number of buffers used
22internally by a driver in read/write mode. For implications see the
23section discussing the :ref:`read() <func-read>` function.
24
25To get and set the streaming parameters applications call the
26:ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and
27:ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take
28a pointer to a struct :ref:`v4l2_streamparm <v4l2-streamparm>`, which
29contains a union holding separate parameters for input and output
30devices.
31
32These ioctls are optional, drivers need not implement them. If so, they
33return the ``EINVAL`` error code.
diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst b/Documentation/media/uapi/v4l/subdev-formats.rst
new file mode 100644
index 000000000000..6dbb27b09c34
--- /dev/null
+++ b/Documentation/media/uapi/v4l/subdev-formats.rst
@@ -0,0 +1,11688 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-mbus-format:
4
5Media Bus Formats
6=================
7
8
9.. _v4l2-mbus-framefmt:
10
11.. flat-table:: struct v4l2_mbus_framefmt
12 :header-rows: 0
13 :stub-columns: 0
14 :widths: 1 1 2
15
16
17 - .. row 1
18
19 - __u32
20
21 - ``width``
22
23 - Image width, in pixels.
24
25 - .. row 2
26
27 - __u32
28
29 - ``height``
30
31 - Image height, in pixels.
32
33 - .. row 3
34
35 - __u32
36
37 - ``code``
38
39 - Format code, from enum
40 :ref:`v4l2_mbus_pixelcode <v4l2-mbus-pixelcode>`.
41
42 - .. row 4
43
44 - __u32
45
46 - ``field``
47
48 - Field order, from enum :ref:`v4l2_field <v4l2-field>`. See
49 :ref:`field-order` for details.
50
51 - .. row 5
52
53 - __u32
54
55 - ``colorspace``
56
57 - Image colorspace, from enum
58 :ref:`v4l2_colorspace <v4l2-colorspace>`. See
59 :ref:`colorspaces` for details.
60
61 - .. row 6
62
63 - enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
64
65 - ``ycbcr_enc``
66
67 - This information supplements the ``colorspace`` and must be set by
68 the driver for capture streams and by the application for output
69 streams, see :ref:`colorspaces`.
70
71 - .. row 7
72
73 - enum :ref:`v4l2_quantization <v4l2-quantization>`
74
75 - ``quantization``
76
77 - This information supplements the ``colorspace`` and must be set by
78 the driver for capture streams and by the application for output
79 streams, see :ref:`colorspaces`.
80
81 - .. row 8
82
83 - enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
84
85 - ``xfer_func``
86
87 - This information supplements the ``colorspace`` and must be set by
88 the driver for capture streams and by the application for output
89 streams, see :ref:`colorspaces`.
90
91 - .. row 9
92
93 - __u16
94
95 - ``reserved``\ [11]
96
97 - Reserved for future extensions. Applications and drivers must set
98 the array to zero.
99
100
101
102.. _v4l2-mbus-pixelcode:
103
104Media Bus Pixel Codes
105---------------------
106
107The media bus pixel codes describe image formats as flowing over
108physical busses (both between separate physical components and inside
109SoC devices). This should not be confused with the V4L2 pixel formats
110that describe, using four character codes, image formats as stored in
111memory.
112
113While there is a relationship between image formats on busses and image
114formats in memory (a raw Bayer image won't be magically converted to
115JPEG just by storing it to memory), there is no one-to-one
116correspondance between them.
117
118
119Packed RGB Formats
120^^^^^^^^^^^^^^^^^^
121
122Those formats transfer pixel data as red, green and blue components. The
123format code is made of the following information.
124
125- The red, green and blue components order code, as encoded in a pixel
126 sample. Possible values are RGB and BGR.
127
128- The number of bits per component, for each component. The values can
129 be different for all components. Common values are 555 and 565.
130
131- The number of bus samples per pixel. Pixels that are wider than the
132 bus width must be transferred in multiple samples. Common values are
133 1 and 2.
134
135- The bus width.
136
137- For formats where the total number of bits per pixel is smaller than
138 the number of bus samples per pixel times the bus width, a padding
139 value stating if the bytes are padded in their most high order bits
140 (PADHI) or low order bits (PADLO). A "C" prefix is used for
141 component-wise padding in the most high order bits (CPADHI) or low
142 order bits (CPADLO) of each separate component.
143
144- For formats where the number of bus samples per pixel is larger than
145 1, an endianness value stating if the pixel is transferred MSB first
146 (BE) or LSB first (LE).
147
148For instance, a format where pixels are encoded as 5-bits red, 5-bits
149green and 5-bit blue values padded on the high bit, transferred as 2
1508-bit samples per pixel with the most significant bits (padding, red and
151half of the green value) transferred first will be named
152``MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE``.
153
154The following tables list existing packed RGB formats.
155
156
157.. _v4l2-mbus-pixelcode-rgb:
158
159.. flat-table:: RGB formats
160 :header-rows: 2
161 :stub-columns: 0
162
163
164 - .. row 1
165
166 - Identifier
167
168 - Code
169
170 -
171 - :cspan:`31` Data organization
172
173 - .. row 2
174
175 -
176 -
177 - Bit
178
179 - 31
180
181 - 30
182
183 - 29
184
185 - 28
186
187 - 27
188
189 - 26
190
191 - 25
192
193 - 24
194
195 - 23
196
197 - 22
198
199 - 21
200
201 - 20
202
203 - 19
204
205 - 18
206
207 - 17
208
209 - 16
210
211 - 15
212
213 - 14
214
215 - 13
216
217 - 12
218
219 - 11
220
221 - 10
222
223 - 9
224
225 - 8
226
227 - 7
228
229 - 6
230
231 - 5
232
233 - 4
234
235 - 3
236
237 - 2
238
239 - 1
240
241 - 0
242
243 - .. _MEDIA-BUS-FMT-RGB444-1X12:
244
245 - MEDIA_BUS_FMT_RGB444_1X12
246
247 - 0x1016
248
249 -
250 - -
251
252 - -
253
254 - -
255
256 - -
257
258 - -
259
260 - -
261
262 - -
263
264 - -
265
266 - -
267
268 - -
269
270 - -
271
272 - -
273
274 - -
275
276 - -
277
278 - -
279
280 - -
281
282 - -
283
284 - -
285
286 - -
287
288 - -
289
290 - r\ :sub:`3`
291
292 - r\ :sub:`2`
293
294 - r\ :sub:`1`
295
296 - r\ :sub:`0`
297
298 - g\ :sub:`3`
299
300 - g\ :sub:`2`
301
302 - g\ :sub:`1`
303
304 - g\ :sub:`0`
305
306 - b\ :sub:`3`
307
308 - b\ :sub:`2`
309
310 - b\ :sub:`1`
311
312 - b\ :sub:`0`
313
314 - .. _MEDIA-BUS-FMT-RGB444-2X8-PADHI-BE:
315
316 - MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE
317
318 - 0x1001
319
320 -
321 - -
322
323 - -
324
325 - -
326
327 - -
328
329 - -
330
331 - -
332
333 - -
334
335 - -
336
337 - -
338
339 - -
340
341 - -
342
343 - -
344
345 - -
346
347 - -
348
349 - -
350
351 - -
352
353 - -
354
355 - -
356
357 - -
358
359 - -
360
361 - -
362
363 - -
364
365 - -
366
367 - -
368
369 - 0
370
371 - 0
372
373 - 0
374
375 - 0
376
377 - r\ :sub:`3`
378
379 - r\ :sub:`2`
380
381 - r\ :sub:`1`
382
383 - r\ :sub:`0`
384
385 - .. row 5
386
387 -
388 -
389 -
390 - -
391
392 - -
393
394 - -
395
396 - -
397
398 - -
399
400 - -
401
402 - -
403
404 - -
405
406 - -
407
408 - -
409
410 - -
411
412 - -
413
414 - -
415
416 - -
417
418 - -
419
420 - -
421
422 - -
423
424 - -
425
426 - -
427
428 - -
429
430 - -
431
432 - -
433
434 - -
435
436 - -
437
438 - g\ :sub:`3`
439
440 - g\ :sub:`2`
441
442 - g\ :sub:`1`
443
444 - g\ :sub:`0`
445
446 - b\ :sub:`3`
447
448 - b\ :sub:`2`
449
450 - b\ :sub:`1`
451
452 - b\ :sub:`0`
453
454 - .. _MEDIA-BUS-FMT-RGB444-2X8-PADHI-LE:
455
456 - MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE
457
458 - 0x1002
459
460 -
461 - -
462
463 - -
464
465 - -
466
467 - -
468
469 - -
470
471 - -
472
473 - -
474
475 - -
476
477 - -
478
479 - -
480
481 - -
482
483 - -
484
485 - -
486
487 - -
488
489 - -
490
491 - -
492
493 - -
494
495 - -
496
497 - -
498
499 - -
500
501 - -
502
503 - -
504
505 - -
506
507 - -
508
509 - g\ :sub:`3`
510
511 - g\ :sub:`2`
512
513 - g\ :sub:`1`
514
515 - g\ :sub:`0`
516
517 - b\ :sub:`3`
518
519 - b\ :sub:`2`
520
521 - b\ :sub:`1`
522
523 - b\ :sub:`0`
524
525 - .. row 7
526
527 -
528 -
529 -
530 - -
531
532 - -
533
534 - -
535
536 - -
537
538 - -
539
540 - -
541
542 - -
543
544 - -
545
546 - -
547
548 - -
549
550 - -
551
552 - -
553
554 - -
555
556 - -
557
558 - -
559
560 - -
561
562 - -
563
564 - -
565
566 - -
567
568 - -
569
570 - -
571
572 - -
573
574 - -
575
576 - -
577
578 - 0
579
580 - 0
581
582 - 0
583
584 - 0
585
586 - r\ :sub:`3`
587
588 - r\ :sub:`2`
589
590 - r\ :sub:`1`
591
592 - r\ :sub:`0`
593
594 - .. _MEDIA-BUS-FMT-RGB555-2X8-PADHI-BE:
595
596 - MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE
597
598 - 0x1003
599
600 -
601 - -
602
603 - -
604
605 - -
606
607 - -
608
609 - -
610
611 - -
612
613 - -
614
615 - -
616
617 - -
618
619 - -
620
621 - -
622
623 - -
624
625 - -
626
627 - -
628
629 - -
630
631 - -
632
633 - -
634
635 - -
636
637 - -
638
639 - -
640
641 - -
642
643 - -
644
645 - -
646
647 - -
648
649 - 0
650
651 - r\ :sub:`4`
652
653 - r\ :sub:`3`
654
655 - r\ :sub:`2`
656
657 - r\ :sub:`1`
658
659 - r\ :sub:`0`
660
661 - g\ :sub:`4`
662
663 - g\ :sub:`3`
664
665 - .. row 9
666
667 -
668 -
669 -
670 - -
671
672 - -
673
674 - -
675
676 - -
677
678 - -
679
680 - -
681
682 - -
683
684 - -
685
686 - -
687
688 - -
689
690 - -
691
692 - -
693
694 - -
695
696 - -
697
698 - -
699
700 - -
701
702 - -
703
704 - -
705
706 - -
707
708 - -
709
710 - -
711
712 - -
713
714 - -
715
716 - -
717
718 - g\ :sub:`2`
719
720 - g\ :sub:`1`
721
722 - g\ :sub:`0`
723
724 - b\ :sub:`4`
725
726 - b\ :sub:`3`
727
728 - b\ :sub:`2`
729
730 - b\ :sub:`1`
731
732 - b\ :sub:`0`
733
734 - .. _MEDIA-BUS-FMT-RGB555-2X8-PADHI-LE:
735
736 - MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE
737
738 - 0x1004
739
740 -
741 - -
742
743 - -
744
745 - -
746
747 - -
748
749 - -
750
751 - -
752
753 - -
754
755 - -
756
757 - -
758
759 - -
760
761 - -
762
763 - -
764
765 - -
766
767 - -
768
769 - -
770
771 - -
772
773 - -
774
775 - -
776
777 - -
778
779 - -
780
781 - -
782
783 - -
784
785 - -
786
787 - -
788
789 - g\ :sub:`2`
790
791 - g\ :sub:`1`
792
793 - g\ :sub:`0`
794
795 - b\ :sub:`4`
796
797 - b\ :sub:`3`
798
799 - b\ :sub:`2`
800
801 - b\ :sub:`1`
802
803 - b\ :sub:`0`
804
805 - .. row 11
806
807 -
808 -
809 -
810 - -
811
812 - -
813
814 - -
815
816 - -
817
818 - -
819
820 - -
821
822 - -
823
824 - -
825
826 - -
827
828 - -
829
830 - -
831
832 - -
833
834 - -
835
836 - -
837
838 - -
839
840 - -
841
842 - -
843
844 - -
845
846 - -
847
848 - -
849
850 - -
851
852 - -
853
854 - -
855
856 - -
857
858 - 0
859
860 - r\ :sub:`4`
861
862 - r\ :sub:`3`
863
864 - r\ :sub:`2`
865
866 - r\ :sub:`1`
867
868 - r\ :sub:`0`
869
870 - g\ :sub:`4`
871
872 - g\ :sub:`3`
873
874 - .. _MEDIA-BUS-FMT-RGB565-1X16:
875
876 - MEDIA_BUS_FMT_RGB565_1X16
877
878 - 0x1017
879
880 -
881 - -
882
883 - -
884
885 - -
886
887 - -
888
889 - -
890
891 - -
892
893 - -
894
895 - -
896
897 - -
898
899 - -
900
901 - -
902
903 - -
904
905 - -
906
907 - -
908
909 - -
910
911 - -
912
913 - r\ :sub:`4`
914
915 - r\ :sub:`3`
916
917 - r\ :sub:`2`
918
919 - r\ :sub:`1`
920
921 - r\ :sub:`0`
922
923 - g\ :sub:`5`
924
925 - g\ :sub:`4`
926
927 - g\ :sub:`3`
928
929 - g\ :sub:`2`
930
931 - g\ :sub:`1`
932
933 - g\ :sub:`0`
934
935 - b\ :sub:`4`
936
937 - b\ :sub:`3`
938
939 - b\ :sub:`2`
940
941 - b\ :sub:`1`
942
943 - b\ :sub:`0`
944
945 - .. _MEDIA-BUS-FMT-BGR565-2X8-BE:
946
947 - MEDIA_BUS_FMT_BGR565_2X8_BE
948
949 - 0x1005
950
951 -
952 - -
953
954 - -
955
956 - -
957
958 - -
959
960 - -
961
962 - -
963
964 - -
965
966 - -
967
968 - -
969
970 - -
971
972 - -
973
974 - -
975
976 - -
977
978 - -
979
980 - -
981
982 - -
983
984 - -
985
986 - -
987
988 - -
989
990 - -
991
992 - -
993
994 - -
995
996 - -
997
998 - -
999
1000 - b\ :sub:`4`
1001
1002 - b\ :sub:`3`
1003
1004 - b\ :sub:`2`
1005
1006 - b\ :sub:`1`
1007
1008 - b\ :sub:`0`
1009
1010 - g\ :sub:`5`
1011
1012 - g\ :sub:`4`
1013
1014 - g\ :sub:`3`
1015
1016 - .. row 14
1017
1018 -
1019 -
1020 -
1021 - -
1022
1023 - -
1024
1025 - -
1026
1027 - -
1028
1029 - -
1030
1031 - -
1032
1033 - -
1034
1035 - -
1036
1037 - -
1038
1039 - -
1040
1041 - -
1042
1043 - -
1044
1045 - -
1046
1047 - -
1048
1049 - -
1050
1051 - -
1052
1053 - -
1054
1055 - -
1056
1057 - -
1058
1059 - -
1060
1061 - -
1062
1063 - -
1064
1065 - -
1066
1067 - -
1068
1069 - g\ :sub:`2`
1070
1071 - g\ :sub:`1`
1072
1073 - g\ :sub:`0`
1074
1075 - r\ :sub:`4`
1076
1077 - r\ :sub:`3`
1078
1079 - r\ :sub:`2`
1080
1081 - r\ :sub:`1`
1082
1083 - r\ :sub:`0`
1084
1085 - .. _MEDIA-BUS-FMT-BGR565-2X8-LE:
1086
1087 - MEDIA_BUS_FMT_BGR565_2X8_LE
1088
1089 - 0x1006
1090
1091 -
1092 - -
1093
1094 - -
1095
1096 - -
1097
1098 - -
1099
1100 - -
1101
1102 - -
1103
1104 - -
1105
1106 - -
1107
1108 - -
1109
1110 - -
1111
1112 - -
1113
1114 - -
1115
1116 - -
1117
1118 - -
1119
1120 - -
1121
1122 - -
1123
1124 - -
1125
1126 - -
1127
1128 - -
1129
1130 - -
1131
1132 - -
1133
1134 - -
1135
1136 - -
1137
1138 - -
1139
1140 - g\ :sub:`2`
1141
1142 - g\ :sub:`1`
1143
1144 - g\ :sub:`0`
1145
1146 - r\ :sub:`4`
1147
1148 - r\ :sub:`3`
1149
1150 - r\ :sub:`2`
1151
1152 - r\ :sub:`1`
1153
1154 - r\ :sub:`0`
1155
1156 - .. row 16
1157
1158 -
1159 -
1160 -
1161 - -
1162
1163 - -
1164
1165 - -
1166
1167 - -
1168
1169 - -
1170
1171 - -
1172
1173 - -
1174
1175 - -
1176
1177 - -
1178
1179 - -
1180
1181 - -
1182
1183 - -
1184
1185 - -
1186
1187 - -
1188
1189 - -
1190
1191 - -
1192
1193 - -
1194
1195 - -
1196
1197 - -
1198
1199 - -
1200
1201 - -
1202
1203 - -
1204
1205 - -
1206
1207 - -
1208
1209 - b\ :sub:`4`
1210
1211 - b\ :sub:`3`
1212
1213 - b\ :sub:`2`
1214
1215 - b\ :sub:`1`
1216
1217 - b\ :sub:`0`
1218
1219 - g\ :sub:`5`
1220
1221 - g\ :sub:`4`
1222
1223 - g\ :sub:`3`
1224
1225 - .. _MEDIA-BUS-FMT-RGB565-2X8-BE:
1226
1227 - MEDIA_BUS_FMT_RGB565_2X8_BE
1228
1229 - 0x1007
1230
1231 -
1232 - -
1233
1234 - -
1235
1236 - -
1237
1238 - -
1239
1240 - -
1241
1242 - -
1243
1244 - -
1245
1246 - -
1247
1248 - -
1249
1250 - -
1251
1252 - -
1253
1254 - -
1255
1256 - -
1257
1258 - -
1259
1260 - -
1261
1262 - -
1263
1264 - -
1265
1266 - -
1267
1268 - -
1269
1270 - -
1271
1272 - -
1273
1274 - -
1275
1276 - -
1277
1278 - -
1279
1280 - r\ :sub:`4`
1281
1282 - r\ :sub:`3`
1283
1284 - r\ :sub:`2`
1285
1286 - r\ :sub:`1`
1287
1288 - r\ :sub:`0`
1289
1290 - g\ :sub:`5`
1291
1292 - g\ :sub:`4`
1293
1294 - g\ :sub:`3`
1295
1296 - .. row 18
1297
1298 -
1299 -
1300 -
1301 - -
1302
1303 - -
1304
1305 - -
1306
1307 - -
1308
1309 - -
1310
1311 - -
1312
1313 - -
1314
1315 - -
1316
1317 - -
1318
1319 - -
1320
1321 - -
1322
1323 - -
1324
1325 - -
1326
1327 - -
1328
1329 - -
1330
1331 - -
1332
1333 - -
1334
1335 - -
1336
1337 - -
1338
1339 - -
1340
1341 - -
1342
1343 - -
1344
1345 - -
1346
1347 - -
1348
1349 - g\ :sub:`2`
1350
1351 - g\ :sub:`1`
1352
1353 - g\ :sub:`0`
1354
1355 - b\ :sub:`4`
1356
1357 - b\ :sub:`3`
1358
1359 - b\ :sub:`2`
1360
1361 - b\ :sub:`1`
1362
1363 - b\ :sub:`0`
1364
1365 - .. _MEDIA-BUS-FMT-RGB565-2X8-LE:
1366
1367 - MEDIA_BUS_FMT_RGB565_2X8_LE
1368
1369 - 0x1008
1370
1371 -
1372 - -
1373
1374 - -
1375
1376 - -
1377
1378 - -
1379
1380 - -
1381
1382 - -
1383
1384 - -
1385
1386 - -
1387
1388 - -
1389
1390 - -
1391
1392 - -
1393
1394 - -
1395
1396 - -
1397
1398 - -
1399
1400 - -
1401
1402 - -
1403
1404 - -
1405
1406 - -
1407
1408 - -
1409
1410 - -
1411
1412 - -
1413
1414 - -
1415
1416 - -
1417
1418 - -
1419
1420 - g\ :sub:`2`
1421
1422 - g\ :sub:`1`
1423
1424 - g\ :sub:`0`
1425
1426 - b\ :sub:`4`
1427
1428 - b\ :sub:`3`
1429
1430 - b\ :sub:`2`
1431
1432 - b\ :sub:`1`
1433
1434 - b\ :sub:`0`
1435
1436 - .. row 20
1437
1438 -
1439 -
1440 -
1441 - -
1442
1443 - -
1444
1445 - -
1446
1447 - -
1448
1449 - -
1450
1451 - -
1452
1453 - -
1454
1455 - -
1456
1457 - -
1458
1459 - -
1460
1461 - -
1462
1463 - -
1464
1465 - -
1466
1467 - -
1468
1469 - -
1470
1471 - -
1472
1473 - -
1474
1475 - -
1476
1477 - -
1478
1479 - -
1480
1481 - -
1482
1483 - -
1484
1485 - -
1486
1487 - -
1488
1489 - r\ :sub:`4`
1490
1491 - r\ :sub:`3`
1492
1493 - r\ :sub:`2`
1494
1495 - r\ :sub:`1`
1496
1497 - r\ :sub:`0`
1498
1499 - g\ :sub:`5`
1500
1501 - g\ :sub:`4`
1502
1503 - g\ :sub:`3`
1504
1505 - .. _MEDIA-BUS-FMT-RGB666-1X18:
1506
1507 - MEDIA_BUS_FMT_RGB666_1X18
1508
1509 - 0x1009
1510
1511 -
1512 - -
1513
1514 - -
1515
1516 - -
1517
1518 - -
1519
1520 - -
1521
1522 - -
1523
1524 - -
1525
1526 - -
1527
1528 - -
1529
1530 - -
1531
1532 - -
1533
1534 - -
1535
1536 - -
1537
1538 - -
1539
1540 - r\ :sub:`5`
1541
1542 - r\ :sub:`4`
1543
1544 - r\ :sub:`3`
1545
1546 - r\ :sub:`2`
1547
1548 - r\ :sub:`1`
1549
1550 - r\ :sub:`0`
1551
1552 - g\ :sub:`5`
1553
1554 - g\ :sub:`4`
1555
1556 - g\ :sub:`3`
1557
1558 - g\ :sub:`2`
1559
1560 - g\ :sub:`1`
1561
1562 - g\ :sub:`0`
1563
1564 - b\ :sub:`5`
1565
1566 - b\ :sub:`4`
1567
1568 - b\ :sub:`3`
1569
1570 - b\ :sub:`2`
1571
1572 - b\ :sub:`1`
1573
1574 - b\ :sub:`0`
1575
1576 - .. _MEDIA-BUS-FMT-RBG888-1X24:
1577
1578 - MEDIA_BUS_FMT_RBG888_1X24
1579
1580 - 0x100e
1581
1582 -
1583 - -
1584
1585 - -
1586
1587 - -
1588
1589 - -
1590
1591 - -
1592
1593 - -
1594
1595 - -
1596
1597 - -
1598
1599 - r\ :sub:`7`
1600
1601 - r\ :sub:`6`
1602
1603 - r\ :sub:`5`
1604
1605 - r\ :sub:`4`
1606
1607 - r\ :sub:`3`
1608
1609 - r\ :sub:`2`
1610
1611 - r\ :sub:`1`
1612
1613 - r\ :sub:`0`
1614
1615 - b\ :sub:`7`
1616
1617 - b\ :sub:`6`
1618
1619 - b\ :sub:`5`
1620
1621 - b\ :sub:`4`
1622
1623 - b\ :sub:`3`
1624
1625 - b\ :sub:`2`
1626
1627 - b\ :sub:`1`
1628
1629 - b\ :sub:`0`
1630
1631 - g\ :sub:`7`
1632
1633 - g\ :sub:`6`
1634
1635 - g\ :sub:`5`
1636
1637 - g\ :sub:`4`
1638
1639 - g\ :sub:`3`
1640
1641 - g\ :sub:`2`
1642
1643 - g\ :sub:`1`
1644
1645 - g\ :sub:`0`
1646
1647 - .. _MEDIA-BUS-FMT-RGB666-1X24_CPADHI:
1648
1649 - MEDIA_BUS_FMT_RGB666_1X24_CPADHI
1650
1651 - 0x1015
1652
1653 -
1654 - -
1655
1656 - -
1657
1658 - -
1659
1660 - -
1661
1662 - -
1663
1664 - -
1665
1666 - -
1667
1668 - -
1669
1670 - 0
1671
1672 - 0
1673
1674 - r\ :sub:`5`
1675
1676 - r\ :sub:`4`
1677
1678 - r\ :sub:`3`
1679
1680 - r\ :sub:`2`
1681
1682 - r\ :sub:`1`
1683
1684 - r\ :sub:`0`
1685
1686 - 0
1687
1688 - 0
1689
1690 - g\ :sub:`5`
1691
1692 - g\ :sub:`4`
1693
1694 - g\ :sub:`3`
1695
1696 - g\ :sub:`2`
1697
1698 - g\ :sub:`1`
1699
1700 - g\ :sub:`0`
1701
1702 - 0
1703
1704 - 0
1705
1706 - b\ :sub:`5`
1707
1708 - b\ :sub:`4`
1709
1710 - b\ :sub:`3`
1711
1712 - b\ :sub:`2`
1713
1714 - b\ :sub:`1`
1715
1716 - b\ :sub:`0`
1717
1718 - .. _MEDIA-BUS-FMT-BGR888-1X24:
1719
1720 - MEDIA_BUS_FMT_BGR888_1X24
1721
1722 - 0x1013
1723
1724 -
1725 - -
1726
1727 - -
1728
1729 - -
1730
1731 - -
1732
1733 - -
1734
1735 - -
1736
1737 - -
1738
1739 - -
1740
1741 - b\ :sub:`7`
1742
1743 - b\ :sub:`6`
1744
1745 - b\ :sub:`5`
1746
1747 - b\ :sub:`4`
1748
1749 - b\ :sub:`3`
1750
1751 - b\ :sub:`2`
1752
1753 - b\ :sub:`1`
1754
1755 - b\ :sub:`0`
1756
1757 - g\ :sub:`7`
1758
1759 - g\ :sub:`6`
1760
1761 - g\ :sub:`5`
1762
1763 - g\ :sub:`4`
1764
1765 - g\ :sub:`3`
1766
1767 - g\ :sub:`2`
1768
1769 - g\ :sub:`1`
1770
1771 - g\ :sub:`0`
1772
1773 - r\ :sub:`7`
1774
1775 - r\ :sub:`6`
1776
1777 - r\ :sub:`5`
1778
1779 - r\ :sub:`4`
1780
1781 - r\ :sub:`3`
1782
1783 - r\ :sub:`2`
1784
1785 - r\ :sub:`1`
1786
1787 - r\ :sub:`0`
1788
1789 - .. _MEDIA-BUS-FMT-GBR888-1X24:
1790
1791 - MEDIA_BUS_FMT_GBR888_1X24
1792
1793 - 0x1014
1794
1795 -
1796 - -
1797
1798 - -
1799
1800 - -
1801
1802 - -
1803
1804 - -
1805
1806 - -
1807
1808 - -
1809
1810 - -
1811
1812 - g\ :sub:`7`
1813
1814 - g\ :sub:`6`
1815
1816 - g\ :sub:`5`
1817
1818 - g\ :sub:`4`
1819
1820 - g\ :sub:`3`
1821
1822 - g\ :sub:`2`
1823
1824 - g\ :sub:`1`
1825
1826 - g\ :sub:`0`
1827
1828 - b\ :sub:`7`
1829
1830 - b\ :sub:`6`
1831
1832 - b\ :sub:`5`
1833
1834 - b\ :sub:`4`
1835
1836 - b\ :sub:`3`
1837
1838 - b\ :sub:`2`
1839
1840 - b\ :sub:`1`
1841
1842 - b\ :sub:`0`
1843
1844 - r\ :sub:`7`
1845
1846 - r\ :sub:`6`
1847
1848 - r\ :sub:`5`
1849
1850 - r\ :sub:`4`
1851
1852 - r\ :sub:`3`
1853
1854 - r\ :sub:`2`
1855
1856 - r\ :sub:`1`
1857
1858 - r\ :sub:`0`
1859
1860 - .. _MEDIA-BUS-FMT-RGB888-1X24:
1861
1862 - MEDIA_BUS_FMT_RGB888_1X24
1863
1864 - 0x100a
1865
1866 -
1867 - -
1868
1869 - -
1870
1871 - -
1872
1873 - -
1874
1875 - -
1876
1877 - -
1878
1879 - -
1880
1881 - -
1882
1883 - r\ :sub:`7`
1884
1885 - r\ :sub:`6`
1886
1887 - r\ :sub:`5`
1888
1889 - r\ :sub:`4`
1890
1891 - r\ :sub:`3`
1892
1893 - r\ :sub:`2`
1894
1895 - r\ :sub:`1`
1896
1897 - r\ :sub:`0`
1898
1899 - g\ :sub:`7`
1900
1901 - g\ :sub:`6`
1902
1903 - g\ :sub:`5`
1904
1905 - g\ :sub:`4`
1906
1907 - g\ :sub:`3`
1908
1909 - g\ :sub:`2`
1910
1911 - g\ :sub:`1`
1912
1913 - g\ :sub:`0`
1914
1915 - b\ :sub:`7`
1916
1917 - b\ :sub:`6`
1918
1919 - b\ :sub:`5`
1920
1921 - b\ :sub:`4`
1922
1923 - b\ :sub:`3`
1924
1925 - b\ :sub:`2`
1926
1927 - b\ :sub:`1`
1928
1929 - b\ :sub:`0`
1930
1931 - .. _MEDIA-BUS-FMT-RGB888-2X12-BE:
1932
1933 - MEDIA_BUS_FMT_RGB888_2X12_BE
1934
1935 - 0x100b
1936
1937 -
1938 - -
1939
1940 - -
1941
1942 - -
1943
1944 - -
1945
1946 - -
1947
1948 - -
1949
1950 - -
1951
1952 - -
1953
1954 - -
1955
1956 - -
1957
1958 - -
1959
1960 - -
1961
1962 - -
1963
1964 - -
1965
1966 - -
1967
1968 - -
1969
1970 - -
1971
1972 - -
1973
1974 - -
1975
1976 - -
1977
1978 - r\ :sub:`7`
1979
1980 - r\ :sub:`6`
1981
1982 - r\ :sub:`5`
1983
1984 - r\ :sub:`4`
1985
1986 - r\ :sub:`3`
1987
1988 - r\ :sub:`2`
1989
1990 - r\ :sub:`1`
1991
1992 - r\ :sub:`0`
1993
1994 - g\ :sub:`7`
1995
1996 - g\ :sub:`6`
1997
1998 - g\ :sub:`5`
1999
2000 - g\ :sub:`4`
2001
2002 - .. row 28
2003
2004 -
2005 -
2006 -
2007 - -
2008
2009 - -
2010
2011 - -
2012
2013 - -
2014
2015 - -
2016
2017 - -
2018
2019 - -
2020
2021 - -
2022
2023 - -
2024
2025 - -
2026
2027 - -
2028
2029 - -
2030
2031 - -
2032
2033 - -
2034
2035 - -
2036
2037 - -
2038
2039 - -
2040
2041 - -
2042
2043 - -
2044
2045 - -
2046
2047 - g\ :sub:`3`
2048
2049 - g\ :sub:`2`
2050
2051 - g\ :sub:`1`
2052
2053 - g\ :sub:`0`
2054
2055 - b\ :sub:`7`
2056
2057 - b\ :sub:`6`
2058
2059 - b\ :sub:`5`
2060
2061 - b\ :sub:`4`
2062
2063 - b\ :sub:`3`
2064
2065 - b\ :sub:`2`
2066
2067 - b\ :sub:`1`
2068
2069 - b\ :sub:`0`
2070
2071 - .. _MEDIA-BUS-FMT-RGB888-2X12-LE:
2072
2073 - MEDIA_BUS_FMT_RGB888_2X12_LE
2074
2075 - 0x100c
2076
2077 -
2078 - -
2079
2080 - -
2081
2082 - -
2083
2084 - -
2085
2086 - -
2087
2088 - -
2089
2090 - -
2091
2092 - -
2093
2094 - -
2095
2096 - -
2097
2098 - -
2099
2100 - -
2101
2102 - -
2103
2104 - -
2105
2106 - -
2107
2108 - -
2109
2110 - -
2111
2112 - -
2113
2114 - -
2115
2116 - -
2117
2118 - g\ :sub:`3`
2119
2120 - g\ :sub:`2`
2121
2122 - g\ :sub:`1`
2123
2124 - g\ :sub:`0`
2125
2126 - b\ :sub:`7`
2127
2128 - b\ :sub:`6`
2129
2130 - b\ :sub:`5`
2131
2132 - b\ :sub:`4`
2133
2134 - b\ :sub:`3`
2135
2136 - b\ :sub:`2`
2137
2138 - b\ :sub:`1`
2139
2140 - b\ :sub:`0`
2141
2142 - .. row 30
2143
2144 -
2145 -
2146 -
2147 - -
2148
2149 - -
2150
2151 - -
2152
2153 - -
2154
2155 - -
2156
2157 - -
2158
2159 - -
2160
2161 - -
2162
2163 - -
2164
2165 - -
2166
2167 - -
2168
2169 - -
2170
2171 - -
2172
2173 - -
2174
2175 - -
2176
2177 - -
2178
2179 - -
2180
2181 - -
2182
2183 - -
2184
2185 - -
2186
2187 - r\ :sub:`7`
2188
2189 - r\ :sub:`6`
2190
2191 - r\ :sub:`5`
2192
2193 - r\ :sub:`4`
2194
2195 - r\ :sub:`3`
2196
2197 - r\ :sub:`2`
2198
2199 - r\ :sub:`1`
2200
2201 - r\ :sub:`0`
2202
2203 - g\ :sub:`7`
2204
2205 - g\ :sub:`6`
2206
2207 - g\ :sub:`5`
2208
2209 - g\ :sub:`4`
2210
2211 - .. _MEDIA-BUS-FMT-ARGB888-1X32:
2212
2213 - MEDIA_BUS_FMT_ARGB888_1X32
2214
2215 - 0x100d
2216
2217 -
2218 - a\ :sub:`7`
2219
2220 - a\ :sub:`6`
2221
2222 - a\ :sub:`5`
2223
2224 - a\ :sub:`4`
2225
2226 - a\ :sub:`3`
2227
2228 - a\ :sub:`2`
2229
2230 - a\ :sub:`1`
2231
2232 - a\ :sub:`0`
2233
2234 - r\ :sub:`7`
2235
2236 - r\ :sub:`6`
2237
2238 - r\ :sub:`5`
2239
2240 - r\ :sub:`4`
2241
2242 - r\ :sub:`3`
2243
2244 - r\ :sub:`2`
2245
2246 - r\ :sub:`1`
2247
2248 - r\ :sub:`0`
2249
2250 - g\ :sub:`7`
2251
2252 - g\ :sub:`6`
2253
2254 - g\ :sub:`5`
2255
2256 - g\ :sub:`4`
2257
2258 - g\ :sub:`3`
2259
2260 - g\ :sub:`2`
2261
2262 - g\ :sub:`1`
2263
2264 - g\ :sub:`0`
2265
2266 - b\ :sub:`7`
2267
2268 - b\ :sub:`6`
2269
2270 - b\ :sub:`5`
2271
2272 - b\ :sub:`4`
2273
2274 - b\ :sub:`3`
2275
2276 - b\ :sub:`2`
2277
2278 - b\ :sub:`1`
2279
2280 - b\ :sub:`0`
2281
2282 - .. _MEDIA-BUS-FMT-RGB888-1X32-PADHI:
2283
2284 - MEDIA_BUS_FMT_RGB888_1X32_PADHI
2285
2286 - 0x100f
2287
2288 -
2289 - 0
2290
2291 - 0
2292
2293 - 0
2294
2295 - 0
2296
2297 - 0
2298
2299 - 0
2300
2301 - 0
2302
2303 - 0
2304
2305 - r\ :sub:`7`
2306
2307 - r\ :sub:`6`
2308
2309 - r\ :sub:`5`
2310
2311 - r\ :sub:`4`
2312
2313 - r\ :sub:`3`
2314
2315 - r\ :sub:`2`
2316
2317 - r\ :sub:`1`
2318
2319 - r\ :sub:`0`
2320
2321 - g\ :sub:`7`
2322
2323 - g\ :sub:`6`
2324
2325 - g\ :sub:`5`
2326
2327 - g\ :sub:`4`
2328
2329 - g\ :sub:`3`
2330
2331 - g\ :sub:`2`
2332
2333 - g\ :sub:`1`
2334
2335 - g\ :sub:`0`
2336
2337 - b\ :sub:`7`
2338
2339 - b\ :sub:`6`
2340
2341 - b\ :sub:`5`
2342
2343 - b\ :sub:`4`
2344
2345 - b\ :sub:`3`
2346
2347 - b\ :sub:`2`
2348
2349 - b\ :sub:`1`
2350
2351 - b\ :sub:`0`
2352
2353
2354On LVDS buses, usually each sample is transferred serialized in seven
2355time slots per pixel clock, on three (18-bit) or four (24-bit)
2356differential data pairs at the same time. The remaining bits are used
2357for control signals as defined by SPWG/PSWG/VESA or JEIDA standards. The
235824-bit RGB format serialized in seven time slots on four lanes using
2359JEIDA defined bit mapping will be named
2360``MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA``, for example.
2361
2362
2363.. _v4l2-mbus-pixelcode-rgb-lvds:
2364
2365.. flat-table:: LVDS RGB formats
2366 :header-rows: 2
2367 :stub-columns: 0
2368
2369
2370 - .. row 1
2371
2372 - Identifier
2373
2374 - Code
2375
2376 -
2377 -
2378 - :cspan:`3` Data organization
2379
2380 - .. row 2
2381
2382 -
2383 -
2384 - Timeslot
2385
2386 - Lane
2387
2388 - 3
2389
2390 - 2
2391
2392 - 1
2393
2394 - 0
2395
2396 - .. _MEDIA-BUS-FMT-RGB666-1X7X3-SPWG:
2397
2398 - MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
2399
2400 - 0x1010
2401
2402 - 0
2403
2404 -
2405 - -
2406
2407 - d
2408
2409 - b\ :sub:`1`
2410
2411 - g\ :sub:`0`
2412
2413 - .. row 4
2414
2415 -
2416 -
2417 - 1
2418
2419 -
2420 - -
2421
2422 - d
2423
2424 - b\ :sub:`0`
2425
2426 - r\ :sub:`5`
2427
2428 - .. row 5
2429
2430 -
2431 -
2432 - 2
2433
2434 -
2435 - -
2436
2437 - d
2438
2439 - g\ :sub:`5`
2440
2441 - r\ :sub:`4`
2442
2443 - .. row 6
2444
2445 -
2446 -
2447 - 3
2448
2449 -
2450 - -
2451
2452 - b\ :sub:`5`
2453
2454 - g\ :sub:`4`
2455
2456 - r\ :sub:`3`
2457
2458 - .. row 7
2459
2460 -
2461 -
2462 - 4
2463
2464 -
2465 - -
2466
2467 - b\ :sub:`4`
2468
2469 - g\ :sub:`3`
2470
2471 - r\ :sub:`2`
2472
2473 - .. row 8
2474
2475 -
2476 -
2477 - 5
2478
2479 -
2480 - -
2481
2482 - b\ :sub:`3`
2483
2484 - g\ :sub:`2`
2485
2486 - r\ :sub:`1`
2487
2488 - .. row 9
2489
2490 -
2491 -
2492 - 6
2493
2494 -
2495 - -
2496
2497 - b\ :sub:`2`
2498
2499 - g\ :sub:`1`
2500
2501 - r\ :sub:`0`
2502
2503 - .. _MEDIA-BUS-FMT-RGB888-1X7X4-SPWG:
2504
2505 - MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
2506
2507 - 0x1011
2508
2509 - 0
2510
2511 -
2512 - d
2513
2514 - d
2515
2516 - b\ :sub:`1`
2517
2518 - g\ :sub:`0`
2519
2520 - .. row 11
2521
2522 -
2523 -
2524 - 1
2525
2526 -
2527 - b\ :sub:`7`
2528
2529 - d
2530
2531 - b\ :sub:`0`
2532
2533 - r\ :sub:`5`
2534
2535 - .. row 12
2536
2537 -
2538 -
2539 - 2
2540
2541 -
2542 - b\ :sub:`6`
2543
2544 - d
2545
2546 - g\ :sub:`5`
2547
2548 - r\ :sub:`4`
2549
2550 - .. row 13
2551
2552 -
2553 -
2554 - 3
2555
2556 -
2557 - g\ :sub:`7`
2558
2559 - b\ :sub:`5`
2560
2561 - g\ :sub:`4`
2562
2563 - r\ :sub:`3`
2564
2565 - .. row 14
2566
2567 -
2568 -
2569 - 4
2570
2571 -
2572 - g\ :sub:`6`
2573
2574 - b\ :sub:`4`
2575
2576 - g\ :sub:`3`
2577
2578 - r\ :sub:`2`
2579
2580 - .. row 15
2581
2582 -
2583 -
2584 - 5
2585
2586 -
2587 - r\ :sub:`7`
2588
2589 - b\ :sub:`3`
2590
2591 - g\ :sub:`2`
2592
2593 - r\ :sub:`1`
2594
2595 - .. row 16
2596
2597 -
2598 -
2599 - 6
2600
2601 -
2602 - r\ :sub:`6`
2603
2604 - b\ :sub:`2`
2605
2606 - g\ :sub:`1`
2607
2608 - r\ :sub:`0`
2609
2610 - .. _MEDIA-BUS-FMT-RGB888-1X7X4-JEIDA:
2611
2612 - MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
2613
2614 - 0x1012
2615
2616 - 0
2617
2618 -
2619 - d
2620
2621 - d
2622
2623 - b\ :sub:`3`
2624
2625 - g\ :sub:`2`
2626
2627 - .. row 18
2628
2629 -
2630 -
2631 - 1
2632
2633 -
2634 - b\ :sub:`1`
2635
2636 - d
2637
2638 - b\ :sub:`2`
2639
2640 - r\ :sub:`7`
2641
2642 - .. row 19
2643
2644 -
2645 -
2646 - 2
2647
2648 -
2649 - b\ :sub:`0`
2650
2651 - d
2652
2653 - g\ :sub:`7`
2654
2655 - r\ :sub:`6`
2656
2657 - .. row 20
2658
2659 -
2660 -
2661 - 3
2662
2663 -
2664 - g\ :sub:`1`
2665
2666 - b\ :sub:`7`
2667
2668 - g\ :sub:`6`
2669
2670 - r\ :sub:`5`
2671
2672 - .. row 21
2673
2674 -
2675 -
2676 - 4
2677
2678 -
2679 - g\ :sub:`0`
2680
2681 - b\ :sub:`6`
2682
2683 - g\ :sub:`5`
2684
2685 - r\ :sub:`4`
2686
2687 - .. row 22
2688
2689 -
2690 -
2691 - 5
2692
2693 -
2694 - r\ :sub:`1`
2695
2696 - b\ :sub:`5`
2697
2698 - g\ :sub:`4`
2699
2700 - r\ :sub:`3`
2701
2702 - .. row 23
2703
2704 -
2705 -
2706 - 6
2707
2708 -
2709 - r\ :sub:`0`
2710
2711 - b\ :sub:`4`
2712
2713 - g\ :sub:`3`
2714
2715 - r\ :sub:`2`
2716
2717
2718
2719Bayer Formats
2720^^^^^^^^^^^^^
2721
2722Those formats transfer pixel data as red, green and blue components. The
2723format code is made of the following information.
2724
2725- The red, green and blue components order code, as encoded in a pixel
2726 sample. The possible values are shown in :ref:`bayer-patterns`.
2727
2728- The number of bits per pixel component. All components are
2729 transferred on the same number of bits. Common values are 8, 10 and
2730 12.
2731
2732- The compression (optional). If the pixel components are ALAW- or
2733 DPCM-compressed, a mention of the compression scheme and the number
2734 of bits per compressed pixel component.
2735
2736- The number of bus samples per pixel. Pixels that are wider than the
2737 bus width must be transferred in multiple samples. Common values are
2738 1 and 2.
2739
2740- The bus width.
2741
2742- For formats where the total number of bits per pixel is smaller than
2743 the number of bus samples per pixel times the bus width, a padding
2744 value stating if the bytes are padded in their most high order bits
2745 (PADHI) or low order bits (PADLO).
2746
2747- For formats where the number of bus samples per pixel is larger than
2748 1, an endianness value stating if the pixel is transferred MSB first
2749 (BE) or LSB first (LE).
2750
2751For instance, a format with uncompressed 10-bit Bayer components
2752arranged in a red, green, green, blue pattern transferred as 2 8-bit
2753samples per pixel with the least significant bits transferred first will
2754be named ``MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE``.
2755
2756
2757.. _bayer-patterns:
2758
2759.. figure:: subdev-formats_files/bayer.*
2760 :alt: bayer.png
2761 :align: center
2762
2763 **Figure 4.8 Bayer Patterns**
2764
2765
2766
2767The following table lists existing packed Bayer formats. The data
2768organization is given as an example for the first pixel only.
2769
2770
2771.. _v4l2-mbus-pixelcode-bayer:
2772
2773.. flat-table:: Bayer Formats
2774 :header-rows: 2
2775 :stub-columns: 0
2776
2777
2778 - .. row 1
2779
2780 - Identifier
2781
2782 - Code
2783
2784 -
2785 - :cspan:`11` Data organization
2786
2787 - .. row 2
2788
2789 -
2790 -
2791 - Bit
2792
2793 - 11
2794
2795 - 10
2796
2797 - 9
2798
2799 - 8
2800
2801 - 7
2802
2803 - 6
2804
2805 - 5
2806
2807 - 4
2808
2809 - 3
2810
2811 - 2
2812
2813 - 1
2814
2815 - 0
2816
2817 - .. _MEDIA-BUS-FMT-SBGGR8-1X8:
2818
2819 - MEDIA_BUS_FMT_SBGGR8_1X8
2820
2821 - 0x3001
2822
2823 -
2824 - -
2825
2826 - -
2827
2828 - -
2829
2830 - -
2831
2832 - b\ :sub:`7`
2833
2834 - b\ :sub:`6`
2835
2836 - b\ :sub:`5`
2837
2838 - b\ :sub:`4`
2839
2840 - b\ :sub:`3`
2841
2842 - b\ :sub:`2`
2843
2844 - b\ :sub:`1`
2845
2846 - b\ :sub:`0`
2847
2848 - .. _MEDIA-BUS-FMT-SGBRG8-1X8:
2849
2850 - MEDIA_BUS_FMT_SGBRG8_1X8
2851
2852 - 0x3013
2853
2854 -
2855 - -
2856
2857 - -
2858
2859 - -
2860
2861 - -
2862
2863 - g\ :sub:`7`
2864
2865 - g\ :sub:`6`
2866
2867 - g\ :sub:`5`
2868
2869 - g\ :sub:`4`
2870
2871 - g\ :sub:`3`
2872
2873 - g\ :sub:`2`
2874
2875 - g\ :sub:`1`
2876
2877 - g\ :sub:`0`
2878
2879 - .. _MEDIA-BUS-FMT-SGRBG8-1X8:
2880
2881 - MEDIA_BUS_FMT_SGRBG8_1X8
2882
2883 - 0x3002
2884
2885 -
2886 - -
2887
2888 - -
2889
2890 - -
2891
2892 - -
2893
2894 - g\ :sub:`7`
2895
2896 - g\ :sub:`6`
2897
2898 - g\ :sub:`5`
2899
2900 - g\ :sub:`4`
2901
2902 - g\ :sub:`3`
2903
2904 - g\ :sub:`2`
2905
2906 - g\ :sub:`1`
2907
2908 - g\ :sub:`0`
2909
2910 - .. _MEDIA-BUS-FMT-SRGGB8-1X8:
2911
2912 - MEDIA_BUS_FMT_SRGGB8_1X8
2913
2914 - 0x3014
2915
2916 -
2917 - -
2918
2919 - -
2920
2921 - -
2922
2923 - -
2924
2925 - r\ :sub:`7`
2926
2927 - r\ :sub:`6`
2928
2929 - r\ :sub:`5`
2930
2931 - r\ :sub:`4`
2932
2933 - r\ :sub:`3`
2934
2935 - r\ :sub:`2`
2936
2937 - r\ :sub:`1`
2938
2939 - r\ :sub:`0`
2940
2941 - .. _MEDIA-BUS-FMT-SBGGR10-ALAW8-1X8:
2942
2943 - MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8
2944
2945 - 0x3015
2946
2947 -
2948 - -
2949
2950 - -
2951
2952 - -
2953
2954 - -
2955
2956 - b\ :sub:`7`
2957
2958 - b\ :sub:`6`
2959
2960 - b\ :sub:`5`
2961
2962 - b\ :sub:`4`
2963
2964 - b\ :sub:`3`
2965
2966 - b\ :sub:`2`
2967
2968 - b\ :sub:`1`
2969
2970 - b\ :sub:`0`
2971
2972 - .. _MEDIA-BUS-FMT-SGBRG10-ALAW8-1X8:
2973
2974 - MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8
2975
2976 - 0x3016
2977
2978 -
2979 - -
2980
2981 - -
2982
2983 - -
2984
2985 - -
2986
2987 - g\ :sub:`7`
2988
2989 - g\ :sub:`6`
2990
2991 - g\ :sub:`5`
2992
2993 - g\ :sub:`4`
2994
2995 - g\ :sub:`3`
2996
2997 - g\ :sub:`2`
2998
2999 - g\ :sub:`1`
3000
3001 - g\ :sub:`0`
3002
3003 - .. _MEDIA-BUS-FMT-SGRBG10-ALAW8-1X8:
3004
3005 - MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8
3006
3007 - 0x3017
3008
3009 -
3010 - -
3011
3012 - -
3013
3014 - -
3015
3016 - -
3017
3018 - g\ :sub:`7`
3019
3020 - g\ :sub:`6`
3021
3022 - g\ :sub:`5`
3023
3024 - g\ :sub:`4`
3025
3026 - g\ :sub:`3`
3027
3028 - g\ :sub:`2`
3029
3030 - g\ :sub:`1`
3031
3032 - g\ :sub:`0`
3033
3034 - .. _MEDIA-BUS-FMT-SRGGB10-ALAW8-1X8:
3035
3036 - MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8
3037
3038 - 0x3018
3039
3040 -
3041 - -
3042
3043 - -
3044
3045 - -
3046
3047 - -
3048
3049 - r\ :sub:`7`
3050
3051 - r\ :sub:`6`
3052
3053 - r\ :sub:`5`
3054
3055 - r\ :sub:`4`
3056
3057 - r\ :sub:`3`
3058
3059 - r\ :sub:`2`
3060
3061 - r\ :sub:`1`
3062
3063 - r\ :sub:`0`
3064
3065 - .. _MEDIA-BUS-FMT-SBGGR10-DPCM8-1X8:
3066
3067 - MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8
3068
3069 - 0x300b
3070
3071 -
3072 - -
3073
3074 - -
3075
3076 - -
3077
3078 - -
3079
3080 - b\ :sub:`7`
3081
3082 - b\ :sub:`6`
3083
3084 - b\ :sub:`5`
3085
3086 - b\ :sub:`4`
3087
3088 - b\ :sub:`3`
3089
3090 - b\ :sub:`2`
3091
3092 - b\ :sub:`1`
3093
3094 - b\ :sub:`0`
3095
3096 - .. _MEDIA-BUS-FMT-SGBRG10-DPCM8-1X8:
3097
3098 - MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8
3099
3100 - 0x300c
3101
3102 -
3103 - -
3104
3105 - -
3106
3107 - -
3108
3109 - -
3110
3111 - g\ :sub:`7`
3112
3113 - g\ :sub:`6`
3114
3115 - g\ :sub:`5`
3116
3117 - g\ :sub:`4`
3118
3119 - g\ :sub:`3`
3120
3121 - g\ :sub:`2`
3122
3123 - g\ :sub:`1`
3124
3125 - g\ :sub:`0`
3126
3127 - .. _MEDIA-BUS-FMT-SGRBG10-DPCM8-1X8:
3128
3129 - MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8
3130
3131 - 0x3009
3132
3133 -
3134 - -
3135
3136 - -
3137
3138 - -
3139
3140 - -
3141
3142 - g\ :sub:`7`
3143
3144 - g\ :sub:`6`
3145
3146 - g\ :sub:`5`
3147
3148 - g\ :sub:`4`
3149
3150 - g\ :sub:`3`
3151
3152 - g\ :sub:`2`
3153
3154 - g\ :sub:`1`
3155
3156 - g\ :sub:`0`
3157
3158 - .. _MEDIA-BUS-FMT-SRGGB10-DPCM8-1X8:
3159
3160 - MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8
3161
3162 - 0x300d
3163
3164 -
3165 - -
3166
3167 - -
3168
3169 - -
3170
3171 - -
3172
3173 - r\ :sub:`7`
3174
3175 - r\ :sub:`6`
3176
3177 - r\ :sub:`5`
3178
3179 - r\ :sub:`4`
3180
3181 - r\ :sub:`3`
3182
3183 - r\ :sub:`2`
3184
3185 - r\ :sub:`1`
3186
3187 - r\ :sub:`0`
3188
3189 - .. _MEDIA-BUS-FMT-SBGGR10-2X8-PADHI-BE:
3190
3191 - MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE
3192
3193 - 0x3003
3194
3195 -
3196 - -
3197
3198 - -
3199
3200 - -
3201
3202 - -
3203
3204 - 0
3205
3206 - 0
3207
3208 - 0
3209
3210 - 0
3211
3212 - 0
3213
3214 - 0
3215
3216 - b\ :sub:`9`
3217
3218 - b\ :sub:`8`
3219
3220 - .. row 16
3221
3222 -
3223 -
3224 -
3225 - -
3226
3227 - -
3228
3229 - -
3230
3231 - -
3232
3233 - b\ :sub:`7`
3234
3235 - b\ :sub:`6`
3236
3237 - b\ :sub:`5`
3238
3239 - b\ :sub:`4`
3240
3241 - b\ :sub:`3`
3242
3243 - b\ :sub:`2`
3244
3245 - b\ :sub:`1`
3246
3247 - b\ :sub:`0`
3248
3249 - .. _MEDIA-BUS-FMT-SBGGR10-2X8-PADHI-LE:
3250
3251 - MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE
3252
3253 - 0x3004
3254
3255 -
3256 - -
3257
3258 - -
3259
3260 - -
3261
3262 - -
3263
3264 - b\ :sub:`7`
3265
3266 - b\ :sub:`6`
3267
3268 - b\ :sub:`5`
3269
3270 - b\ :sub:`4`
3271
3272 - b\ :sub:`3`
3273
3274 - b\ :sub:`2`
3275
3276 - b\ :sub:`1`
3277
3278 - b\ :sub:`0`
3279
3280 - .. row 18
3281
3282 -
3283 -
3284 -
3285 - -
3286
3287 - -
3288
3289 - -
3290
3291 - -
3292
3293 - 0
3294
3295 - 0
3296
3297 - 0
3298
3299 - 0
3300
3301 - 0
3302
3303 - 0
3304
3305 - b\ :sub:`9`
3306
3307 - b\ :sub:`8`
3308
3309 - .. _MEDIA-BUS-FMT-SBGGR10-2X8-PADLO-BE:
3310
3311 - MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE
3312
3313 - 0x3005
3314
3315 -
3316 - -
3317
3318 - -
3319
3320 - -
3321
3322 - -
3323
3324 - b\ :sub:`9`
3325
3326 - b\ :sub:`8`
3327
3328 - b\ :sub:`7`
3329
3330 - b\ :sub:`6`
3331
3332 - b\ :sub:`5`
3333
3334 - b\ :sub:`4`
3335
3336 - b\ :sub:`3`
3337
3338 - b\ :sub:`2`
3339
3340 - .. row 20
3341
3342 -
3343 -
3344 -
3345 - -
3346
3347 - -
3348
3349 - -
3350
3351 - -
3352
3353 - b\ :sub:`1`
3354
3355 - b\ :sub:`0`
3356
3357 - 0
3358
3359 - 0
3360
3361 - 0
3362
3363 - 0
3364
3365 - 0
3366
3367 - 0
3368
3369 - .. _MEDIA-BUS-FMT-SBGGR10-2X8-PADLO-LE:
3370
3371 - MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE
3372
3373 - 0x3006
3374
3375 -
3376 - -
3377
3378 - -
3379
3380 - -
3381
3382 - -
3383
3384 - b\ :sub:`1`
3385
3386 - b\ :sub:`0`
3387
3388 - 0
3389
3390 - 0
3391
3392 - 0
3393
3394 - 0
3395
3396 - 0
3397
3398 - 0
3399
3400 - .. row 22
3401
3402 -
3403 -
3404 -
3405 - -
3406
3407 - -
3408
3409 - -
3410
3411 - -
3412
3413 - b\ :sub:`9`
3414
3415 - b\ :sub:`8`
3416
3417 - b\ :sub:`7`
3418
3419 - b\ :sub:`6`
3420
3421 - b\ :sub:`5`
3422
3423 - b\ :sub:`4`
3424
3425 - b\ :sub:`3`
3426
3427 - b\ :sub:`2`
3428
3429 - .. _MEDIA-BUS-FMT-SBGGR10-1X10:
3430
3431 - MEDIA_BUS_FMT_SBGGR10_1X10
3432
3433 - 0x3007
3434
3435 -
3436 - -
3437
3438 - -
3439
3440 - b\ :sub:`9`
3441
3442 - b\ :sub:`8`
3443
3444 - b\ :sub:`7`
3445
3446 - b\ :sub:`6`
3447
3448 - b\ :sub:`5`
3449
3450 - b\ :sub:`4`
3451
3452 - b\ :sub:`3`
3453
3454 - b\ :sub:`2`
3455
3456 - b\ :sub:`1`
3457
3458 - b\ :sub:`0`
3459
3460 - .. _MEDIA-BUS-FMT-SGBRG10-1X10:
3461
3462 - MEDIA_BUS_FMT_SGBRG10_1X10
3463
3464 - 0x300e
3465
3466 -
3467 - -
3468
3469 - -
3470
3471 - g\ :sub:`9`
3472
3473 - g\ :sub:`8`
3474
3475 - g\ :sub:`7`
3476
3477 - g\ :sub:`6`
3478
3479 - g\ :sub:`5`
3480
3481 - g\ :sub:`4`
3482
3483 - g\ :sub:`3`
3484
3485 - g\ :sub:`2`
3486
3487 - g\ :sub:`1`
3488
3489 - g\ :sub:`0`
3490
3491 - .. _MEDIA-BUS-FMT-SGRBG10-1X10:
3492
3493 - MEDIA_BUS_FMT_SGRBG10_1X10
3494
3495 - 0x300a
3496
3497 -
3498 - -
3499
3500 - -
3501
3502 - g\ :sub:`9`
3503
3504 - g\ :sub:`8`
3505
3506 - g\ :sub:`7`
3507
3508 - g\ :sub:`6`
3509
3510 - g\ :sub:`5`
3511
3512 - g\ :sub:`4`
3513
3514 - g\ :sub:`3`
3515
3516 - g\ :sub:`2`
3517
3518 - g\ :sub:`1`
3519
3520 - g\ :sub:`0`
3521
3522 - .. _MEDIA-BUS-FMT-SRGGB10-1X10:
3523
3524 - MEDIA_BUS_FMT_SRGGB10_1X10
3525
3526 - 0x300f
3527
3528 -
3529 - -
3530
3531 - -
3532
3533 - r\ :sub:`9`
3534
3535 - r\ :sub:`8`
3536
3537 - r\ :sub:`7`
3538
3539 - r\ :sub:`6`
3540
3541 - r\ :sub:`5`
3542
3543 - r\ :sub:`4`
3544
3545 - r\ :sub:`3`
3546
3547 - r\ :sub:`2`
3548
3549 - r\ :sub:`1`
3550
3551 - r\ :sub:`0`
3552
3553 - .. _MEDIA-BUS-FMT-SBGGR12-1X12:
3554
3555 - MEDIA_BUS_FMT_SBGGR12_1X12
3556
3557 - 0x3008
3558
3559 -
3560 - b\ :sub:`11`
3561
3562 - b\ :sub:`10`
3563
3564 - b\ :sub:`9`
3565
3566 - b\ :sub:`8`
3567
3568 - b\ :sub:`7`
3569
3570 - b\ :sub:`6`
3571
3572 - b\ :sub:`5`
3573
3574 - b\ :sub:`4`
3575
3576 - b\ :sub:`3`
3577
3578 - b\ :sub:`2`
3579
3580 - b\ :sub:`1`
3581
3582 - b\ :sub:`0`
3583
3584 - .. _MEDIA-BUS-FMT-SGBRG12-1X12:
3585
3586 - MEDIA_BUS_FMT_SGBRG12_1X12
3587
3588 - 0x3010
3589
3590 -
3591 - g\ :sub:`11`
3592
3593 - g\ :sub:`10`
3594
3595 - g\ :sub:`9`
3596
3597 - g\ :sub:`8`
3598
3599 - g\ :sub:`7`
3600
3601 - g\ :sub:`6`
3602
3603 - g\ :sub:`5`
3604
3605 - g\ :sub:`4`
3606
3607 - g\ :sub:`3`
3608
3609 - g\ :sub:`2`
3610
3611 - g\ :sub:`1`
3612
3613 - g\ :sub:`0`
3614
3615 - .. _MEDIA-BUS-FMT-SGRBG12-1X12:
3616
3617 - MEDIA_BUS_FMT_SGRBG12_1X12
3618
3619 - 0x3011
3620
3621 -
3622 - g\ :sub:`11`
3623
3624 - g\ :sub:`10`
3625
3626 - g\ :sub:`9`
3627
3628 - g\ :sub:`8`
3629
3630 - g\ :sub:`7`
3631
3632 - g\ :sub:`6`
3633
3634 - g\ :sub:`5`
3635
3636 - g\ :sub:`4`
3637
3638 - g\ :sub:`3`
3639
3640 - g\ :sub:`2`
3641
3642 - g\ :sub:`1`
3643
3644 - g\ :sub:`0`
3645
3646 - .. _MEDIA-BUS-FMT-SRGGB12-1X12:
3647
3648 - MEDIA_BUS_FMT_SRGGB12_1X12
3649
3650 - 0x3012
3651
3652 -
3653 - r\ :sub:`11`
3654
3655 - r\ :sub:`10`
3656
3657 - r\ :sub:`9`
3658
3659 - r\ :sub:`8`
3660
3661 - r\ :sub:`7`
3662
3663 - r\ :sub:`6`
3664
3665 - r\ :sub:`5`
3666
3667 - r\ :sub:`4`
3668
3669 - r\ :sub:`3`
3670
3671 - r\ :sub:`2`
3672
3673 - r\ :sub:`1`
3674
3675 - r\ :sub:`0`
3676
3677
3678
3679Packed YUV Formats
3680^^^^^^^^^^^^^^^^^^
3681
3682Those data formats transfer pixel data as (possibly downsampled) Y, U
3683and V components. Some formats include dummy bits in some of their
3684samples and are collectively referred to as "YDYC" (Y-Dummy-Y-Chroma)
3685formats. One cannot rely on the values of these dummy bits as those are
3686undefined.
3687
3688The format code is made of the following information.
3689
3690- The Y, U and V components order code, as transferred on the bus.
3691 Possible values are YUYV, UYVY, YVYU and VYUY for formats with no
3692 dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC
3693 formats.
3694
3695- The number of bits per pixel component. All components are
3696 transferred on the same number of bits. Common values are 8, 10 and
3697 12.
3698
3699- The number of bus samples per pixel. Pixels that are wider than the
3700 bus width must be transferred in multiple samples. Common values are
3701 1, 1.5 (encoded as 1_5) and 2.
3702
3703- The bus width. When the bus width is larger than the number of bits
3704 per pixel component, several components are packed in a single bus
3705 sample. The components are ordered as specified by the order code,
3706 with components on the left of the code transferred in the high order
3707 bits. Common values are 8 and 16.
3708
3709For instance, a format where pixels are encoded as 8-bit YUV values
3710downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in
3711the U, Y, V, Y order will be named ``MEDIA_BUS_FMT_UYVY8_2X8``.
3712
3713:ref:`v4l2-mbus-pixelcode-yuv8` lists existing packed YUV formats and
3714describes the organization of each pixel data in each sample. When a
3715format pattern is split across multiple samples each of the samples in
3716the pattern is described.
3717
3718The role of each bit transferred over the bus is identified by one of
3719the following codes.
3720
3721- y\ :sub:`x` for luma component bit number x
3722
3723- u\ :sub:`x` for blue chroma component bit number x
3724
3725- v\ :sub:`x` for red chroma component bit number x
3726
3727- a\ :sub:`x` for alpha component bit number x
3728
3729- - for non-available bits (for positions higher than the bus width)
3730
3731- d for dummy bits
3732
3733
3734.. _v4l2-mbus-pixelcode-yuv8:
3735
3736.. flat-table:: YUV Formats
3737 :header-rows: 2
3738 :stub-columns: 0
3739
3740
3741 - .. row 1
3742
3743 - Identifier
3744
3745 - Code
3746
3747 -
3748 - :cspan:`31` Data organization
3749
3750 - .. row 2
3751
3752 -
3753 -
3754 - Bit
3755
3756 - 31
3757
3758 - 30
3759
3760 - 29
3761
3762 - 28
3763
3764 - 27
3765
3766 - 26
3767
3768 - 25
3769
3770 - 24
3771
3772 - 23
3773
3774 - 22
3775
3776 - 21
3777
3778 - 10
3779
3780 - 19
3781
3782 - 18
3783
3784 - 17
3785
3786 - 16
3787
3788 - 15
3789
3790 - 14
3791
3792 - 13
3793
3794 - 12
3795
3796 - 11
3797
3798 - 10
3799
3800 - 9
3801
3802 - 8
3803
3804 - 7
3805
3806 - 6
3807
3808 - 5
3809
3810 - 4
3811
3812 - 3
3813
3814 - 2
3815
3816 - 1
3817
3818 - 0
3819
3820 - .. _MEDIA-BUS-FMT-Y8-1X8:
3821
3822 - MEDIA_BUS_FMT_Y8_1X8
3823
3824 - 0x2001
3825
3826 -
3827 - -
3828
3829 - -
3830
3831 - -
3832
3833 - -
3834
3835 - -
3836
3837 - -
3838
3839 - -
3840
3841 - -
3842
3843 - -
3844
3845 - -
3846
3847 - -
3848
3849 - -
3850
3851 - -
3852
3853 - -
3854
3855 - -
3856
3857 - -
3858
3859 - -
3860
3861 - -
3862
3863 - -
3864
3865 - -
3866
3867 - -
3868
3869 - -
3870
3871 - -
3872
3873 - -
3874
3875 - y\ :sub:`7`
3876
3877 - y\ :sub:`6`
3878
3879 - y\ :sub:`5`
3880
3881 - y\ :sub:`4`
3882
3883 - y\ :sub:`3`
3884
3885 - y\ :sub:`2`
3886
3887 - y\ :sub:`1`
3888
3889 - y\ :sub:`0`
3890
3891 - .. _MEDIA-BUS-FMT-UV8-1X8:
3892
3893 - MEDIA_BUS_FMT_UV8_1X8
3894
3895 - 0x2015
3896
3897 -
3898 - -
3899
3900 - -
3901
3902 - -
3903
3904 - -
3905
3906 - -
3907
3908 - -
3909
3910 - -
3911
3912 - -
3913
3914 - -
3915
3916 - -
3917
3918 - -
3919
3920 - -
3921
3922 - -
3923
3924 - -
3925
3926 - -
3927
3928 - -
3929
3930 - -
3931
3932 - -
3933
3934 - -
3935
3936 - -
3937
3938 - -
3939
3940 - -
3941
3942 - -
3943
3944 - -
3945
3946 - u\ :sub:`7`
3947
3948 - u\ :sub:`6`
3949
3950 - u\ :sub:`5`
3951
3952 - u\ :sub:`4`
3953
3954 - u\ :sub:`3`
3955
3956 - u\ :sub:`2`
3957
3958 - u\ :sub:`1`
3959
3960 - u\ :sub:`0`
3961
3962 - .. row 5
3963
3964 -
3965 -
3966 -
3967 - -
3968
3969 - -
3970
3971 - -
3972
3973 - -
3974
3975 - -
3976
3977 - -
3978
3979 - -
3980
3981 - -
3982
3983 - -
3984
3985 - -
3986
3987 - -
3988
3989 - -
3990
3991 - -
3992
3993 - -
3994
3995 - -
3996
3997 - -
3998
3999 - -
4000
4001 - -
4002
4003 - -
4004
4005 - -
4006
4007 - -
4008
4009 - -
4010
4011 - -
4012
4013 - -
4014
4015 - v\ :sub:`7`
4016
4017 - v\ :sub:`6`
4018
4019 - v\ :sub:`5`
4020
4021 - v\ :sub:`4`
4022
4023 - v\ :sub:`3`
4024
4025 - v\ :sub:`2`
4026
4027 - v\ :sub:`1`
4028
4029 - v\ :sub:`0`
4030
4031 - .. _MEDIA-BUS-FMT-UYVY8-1_5X8:
4032
4033 - MEDIA_BUS_FMT_UYVY8_1_5X8
4034
4035 - 0x2002
4036
4037 -
4038 - -
4039
4040 - -
4041
4042 - -
4043
4044 - -
4045
4046 - -
4047
4048 - -
4049
4050 - -
4051
4052 - -
4053
4054 - -
4055
4056 - -
4057
4058 - -
4059
4060 - -
4061
4062 - -
4063
4064 - -
4065
4066 - -
4067
4068 - -
4069
4070 - -
4071
4072 - -
4073
4074 - -
4075
4076 - -
4077
4078 - -
4079
4080 - -
4081
4082 - -
4083
4084 - -
4085
4086 - u\ :sub:`7`
4087
4088 - u\ :sub:`6`
4089
4090 - u\ :sub:`5`
4091
4092 - u\ :sub:`4`
4093
4094 - u\ :sub:`3`
4095
4096 - u\ :sub:`2`
4097
4098 - u\ :sub:`1`
4099
4100 - u\ :sub:`0`
4101
4102 - .. row 7
4103
4104 -
4105 -
4106 -
4107 - -
4108
4109 - -
4110
4111 - -
4112
4113 - -
4114
4115 - -
4116
4117 - -
4118
4119 - -
4120
4121 - -
4122
4123 - -
4124
4125 - -
4126
4127 - -
4128
4129 - -
4130
4131 - -
4132
4133 - -
4134
4135 - -
4136
4137 - -
4138
4139 - -
4140
4141 - -
4142
4143 - -
4144
4145 - -
4146
4147 - -
4148
4149 - -
4150
4151 - -
4152
4153 - -
4154
4155 - y\ :sub:`7`
4156
4157 - y\ :sub:`6`
4158
4159 - y\ :sub:`5`
4160
4161 - y\ :sub:`4`
4162
4163 - y\ :sub:`3`
4164
4165 - y\ :sub:`2`
4166
4167 - y\ :sub:`1`
4168
4169 - y\ :sub:`0`
4170
4171 - .. row 8
4172
4173 -
4174 -
4175 -
4176 - -
4177
4178 - -
4179
4180 - -
4181
4182 - -
4183
4184 - -
4185
4186 - -
4187
4188 - -
4189
4190 - -
4191
4192 - -
4193
4194 - -
4195
4196 - -
4197
4198 - -
4199
4200 - -
4201
4202 - -
4203
4204 - -
4205
4206 - -
4207
4208 - -
4209
4210 - -
4211
4212 - -
4213
4214 - -
4215
4216 - -
4217
4218 - -
4219
4220 - -
4221
4222 - -
4223
4224 - y\ :sub:`7`
4225
4226 - y\ :sub:`6`
4227
4228 - y\ :sub:`5`
4229
4230 - y\ :sub:`4`
4231
4232 - y\ :sub:`3`
4233
4234 - y\ :sub:`2`
4235
4236 - y\ :sub:`1`
4237
4238 - y\ :sub:`0`
4239
4240 - .. row 9
4241
4242 -
4243 -
4244 -
4245 - -
4246
4247 - -
4248
4249 - -
4250
4251 - -
4252
4253 - -
4254
4255 - -
4256
4257 - -
4258
4259 - -
4260
4261 - -
4262
4263 - -
4264
4265 - -
4266
4267 - -
4268
4269 - -
4270
4271 - -
4272
4273 - -
4274
4275 - -
4276
4277 - -
4278
4279 - -
4280
4281 - -
4282
4283 - -
4284
4285 - -
4286
4287 - -
4288
4289 - -
4290
4291 - -
4292
4293 - v\ :sub:`7`
4294
4295 - v\ :sub:`6`
4296
4297 - v\ :sub:`5`
4298
4299 - v\ :sub:`4`
4300
4301 - v\ :sub:`3`
4302
4303 - v\ :sub:`2`
4304
4305 - v\ :sub:`1`
4306
4307 - v\ :sub:`0`
4308
4309 - .. row 10
4310
4311 -
4312 -
4313 -
4314 - -
4315
4316 - -
4317
4318 - -
4319
4320 - -
4321
4322 - -
4323
4324 - -
4325
4326 - -
4327
4328 - -
4329
4330 - -
4331
4332 - -
4333
4334 - -
4335
4336 - -
4337
4338 - -
4339
4340 - -
4341
4342 - -
4343
4344 - -
4345
4346 - -
4347
4348 - -
4349
4350 - -
4351
4352 - -
4353
4354 - -
4355
4356 - -
4357
4358 - -
4359
4360 - -
4361
4362 - y\ :sub:`7`
4363
4364 - y\ :sub:`6`
4365
4366 - y\ :sub:`5`
4367
4368 - y\ :sub:`4`
4369
4370 - y\ :sub:`3`
4371
4372 - y\ :sub:`2`
4373
4374 - y\ :sub:`1`
4375
4376 - y\ :sub:`0`
4377
4378 - .. row 11
4379
4380 -
4381 -
4382 -
4383 - -
4384
4385 - -
4386
4387 - -
4388
4389 - -
4390
4391 - -
4392
4393 - -
4394
4395 - -
4396
4397 - -
4398
4399 - -
4400
4401 - -
4402
4403 - -
4404
4405 - -
4406
4407 - -
4408
4409 - -
4410
4411 - -
4412
4413 - -
4414
4415 - -
4416
4417 - -
4418
4419 - -
4420
4421 - -
4422
4423 - -
4424
4425 - -
4426
4427 - -
4428
4429 - -
4430
4431 - y\ :sub:`7`
4432
4433 - y\ :sub:`6`
4434
4435 - y\ :sub:`5`
4436
4437 - y\ :sub:`4`
4438
4439 - y\ :sub:`3`
4440
4441 - y\ :sub:`2`
4442
4443 - y\ :sub:`1`
4444
4445 - y\ :sub:`0`
4446
4447 - .. _MEDIA-BUS-FMT-VYUY8-1_5X8:
4448
4449 - MEDIA_BUS_FMT_VYUY8_1_5X8
4450
4451 - 0x2003
4452
4453 -
4454 - -
4455
4456 - -
4457
4458 - -
4459
4460 - -
4461
4462 - -
4463
4464 - -
4465
4466 - -
4467
4468 - -
4469
4470 - -
4471
4472 - -
4473
4474 - -
4475
4476 - -
4477
4478 - -
4479
4480 - -
4481
4482 - -
4483
4484 - -
4485
4486 - -
4487
4488 - -
4489
4490 - -
4491
4492 - -
4493
4494 - -
4495
4496 - -
4497
4498 - -
4499
4500 - -
4501
4502 - v\ :sub:`7`
4503
4504 - v\ :sub:`6`
4505
4506 - v\ :sub:`5`
4507
4508 - v\ :sub:`4`
4509
4510 - v\ :sub:`3`
4511
4512 - v\ :sub:`2`
4513
4514 - v\ :sub:`1`
4515
4516 - v\ :sub:`0`
4517
4518 - .. row 13
4519
4520 -
4521 -
4522 -
4523 - -
4524
4525 - -
4526
4527 - -
4528
4529 - -
4530
4531 - -
4532
4533 - -
4534
4535 - -
4536
4537 - -
4538
4539 - -
4540
4541 - -
4542
4543 - -
4544
4545 - -
4546
4547 - -
4548
4549 - -
4550
4551 - -
4552
4553 - -
4554
4555 - -
4556
4557 - -
4558
4559 - -
4560
4561 - -
4562
4563 - -
4564
4565 - -
4566
4567 - -
4568
4569 - -
4570
4571 - y\ :sub:`7`
4572
4573 - y\ :sub:`6`
4574
4575 - y\ :sub:`5`
4576
4577 - y\ :sub:`4`
4578
4579 - y\ :sub:`3`
4580
4581 - y\ :sub:`2`
4582
4583 - y\ :sub:`1`
4584
4585 - y\ :sub:`0`
4586
4587 - .. row 14
4588
4589 -
4590 -
4591 -
4592 - -
4593
4594 - -
4595
4596 - -
4597
4598 - -
4599
4600 - -
4601
4602 - -
4603
4604 - -
4605
4606 - -
4607
4608 - -
4609
4610 - -
4611
4612 - -
4613
4614 - -
4615
4616 - -
4617
4618 - -
4619
4620 - -
4621
4622 - -
4623
4624 - -
4625
4626 - -
4627
4628 - -
4629
4630 - -
4631
4632 - -
4633
4634 - -
4635
4636 - -
4637
4638 - -
4639
4640 - y\ :sub:`7`
4641
4642 - y\ :sub:`6`
4643
4644 - y\ :sub:`5`
4645
4646 - y\ :sub:`4`
4647
4648 - y\ :sub:`3`
4649
4650 - y\ :sub:`2`
4651
4652 - y\ :sub:`1`
4653
4654 - y\ :sub:`0`
4655
4656 - .. row 15
4657
4658 -
4659 -
4660 -
4661 - -
4662
4663 - -
4664
4665 - -
4666
4667 - -
4668
4669 - -
4670
4671 - -
4672
4673 - -
4674
4675 - -
4676
4677 - -
4678
4679 - -
4680
4681 - -
4682
4683 - -
4684
4685 - -
4686
4687 - -
4688
4689 - -
4690
4691 - -
4692
4693 - -
4694
4695 - -
4696
4697 - -
4698
4699 - -
4700
4701 - -
4702
4703 - -
4704
4705 - -
4706
4707 - -
4708
4709 - u\ :sub:`7`
4710
4711 - u\ :sub:`6`
4712
4713 - u\ :sub:`5`
4714
4715 - u\ :sub:`4`
4716
4717 - u\ :sub:`3`
4718
4719 - u\ :sub:`2`
4720
4721 - u\ :sub:`1`
4722
4723 - u\ :sub:`0`
4724
4725 - .. row 16
4726
4727 -
4728 -
4729 -
4730 - -
4731
4732 - -
4733
4734 - -
4735
4736 - -
4737
4738 - -
4739
4740 - -
4741
4742 - -
4743
4744 - -
4745
4746 - -
4747
4748 - -
4749
4750 - -
4751
4752 - -
4753
4754 - -
4755
4756 - -
4757
4758 - -
4759
4760 - -
4761
4762 - -
4763
4764 - -
4765
4766 - -
4767
4768 - -
4769
4770 - -
4771
4772 - -
4773
4774 - -
4775
4776 - -
4777
4778 - y\ :sub:`7`
4779
4780 - y\ :sub:`6`
4781
4782 - y\ :sub:`5`
4783
4784 - y\ :sub:`4`
4785
4786 - y\ :sub:`3`
4787
4788 - y\ :sub:`2`
4789
4790 - y\ :sub:`1`
4791
4792 - y\ :sub:`0`
4793
4794 - .. row 17
4795
4796 -
4797 -
4798 -
4799 - -
4800
4801 - -
4802
4803 - -
4804
4805 - -
4806
4807 - -
4808
4809 - -
4810
4811 - -
4812
4813 - -
4814
4815 - -
4816
4817 - -
4818
4819 - -
4820
4821 - -
4822
4823 - -
4824
4825 - -
4826
4827 - -
4828
4829 - -
4830
4831 - -
4832
4833 - -
4834
4835 - -
4836
4837 - -
4838
4839 - -
4840
4841 - -
4842
4843 - -
4844
4845 - -
4846
4847 - y\ :sub:`7`
4848
4849 - y\ :sub:`6`
4850
4851 - y\ :sub:`5`
4852
4853 - y\ :sub:`4`
4854
4855 - y\ :sub:`3`
4856
4857 - y\ :sub:`2`
4858
4859 - y\ :sub:`1`
4860
4861 - y\ :sub:`0`
4862
4863 - .. _MEDIA-BUS-FMT-YUYV8-1_5X8:
4864
4865 - MEDIA_BUS_FMT_YUYV8_1_5X8
4866
4867 - 0x2004
4868
4869 -
4870 - -
4871
4872 - -
4873
4874 - -
4875
4876 - -
4877
4878 - -
4879
4880 - -
4881
4882 - -
4883
4884 - -
4885
4886 - -
4887
4888 - -
4889
4890 - -
4891
4892 - -
4893
4894 - -
4895
4896 - -
4897
4898 - -
4899
4900 - -
4901
4902 - -
4903
4904 - -
4905
4906 - -
4907
4908 - -
4909
4910 - -
4911
4912 - -
4913
4914 - -
4915
4916 - -
4917
4918 - y\ :sub:`7`
4919
4920 - y\ :sub:`6`
4921
4922 - y\ :sub:`5`
4923
4924 - y\ :sub:`4`
4925
4926 - y\ :sub:`3`
4927
4928 - y\ :sub:`2`
4929
4930 - y\ :sub:`1`
4931
4932 - y\ :sub:`0`
4933
4934 - .. row 19
4935
4936 -
4937 -
4938 -
4939 - -
4940
4941 - -
4942
4943 - -
4944
4945 - -
4946
4947 - -
4948
4949 - -
4950
4951 - -
4952
4953 - -
4954
4955 - -
4956
4957 - -
4958
4959 - -
4960
4961 - -
4962
4963 - -
4964
4965 - -
4966
4967 - -
4968
4969 - -
4970
4971 - -
4972
4973 - -
4974
4975 - -
4976
4977 - -
4978
4979 - -
4980
4981 - -
4982
4983 - -
4984
4985 - -
4986
4987 - y\ :sub:`7`
4988
4989 - y\ :sub:`6`
4990
4991 - y\ :sub:`5`
4992
4993 - y\ :sub:`4`
4994
4995 - y\ :sub:`3`
4996
4997 - y\ :sub:`2`
4998
4999 - y\ :sub:`1`
5000
5001 - y\ :sub:`0`
5002
5003 - .. row 20
5004
5005 -
5006 -
5007 -
5008 - -
5009
5010 - -
5011
5012 - -
5013
5014 - -
5015
5016 - -
5017
5018 - -
5019
5020 - -
5021
5022 - -
5023
5024 - -
5025
5026 - -
5027
5028 - -
5029
5030 - -
5031
5032 - -
5033
5034 - -
5035
5036 - -
5037
5038 - -
5039
5040 - -
5041
5042 - -
5043
5044 - -
5045
5046 - -
5047
5048 - -
5049
5050 - -
5051
5052 - -
5053
5054 - -
5055
5056 - u\ :sub:`7`
5057
5058 - u\ :sub:`6`
5059
5060 - u\ :sub:`5`
5061
5062 - u\ :sub:`4`
5063
5064 - u\ :sub:`3`
5065
5066 - u\ :sub:`2`
5067
5068 - u\ :sub:`1`
5069
5070 - u\ :sub:`0`
5071
5072 - .. row 21
5073
5074 -
5075 -
5076 -
5077 - -
5078
5079 - -
5080
5081 - -
5082
5083 - -
5084
5085 - -
5086
5087 - -
5088
5089 - -
5090
5091 - -
5092
5093 - -
5094
5095 - -
5096
5097 - -
5098
5099 - -
5100
5101 - -
5102
5103 - -
5104
5105 - -
5106
5107 - -
5108
5109 - -
5110
5111 - -
5112
5113 - -
5114
5115 - -
5116
5117 - -
5118
5119 - -
5120
5121 - -
5122
5123 - -
5124
5125 - y\ :sub:`7`
5126
5127 - y\ :sub:`6`
5128
5129 - y\ :sub:`5`
5130
5131 - y\ :sub:`4`
5132
5133 - y\ :sub:`3`
5134
5135 - y\ :sub:`2`
5136
5137 - y\ :sub:`1`
5138
5139 - y\ :sub:`0`
5140
5141 - .. row 22
5142
5143 -
5144 -
5145 -
5146 - -
5147
5148 - -
5149
5150 - -
5151
5152 - -
5153
5154 - -
5155
5156 - -
5157
5158 - -
5159
5160 - -
5161
5162 - -
5163
5164 - -
5165
5166 - -
5167
5168 - -
5169
5170 - -
5171
5172 - -
5173
5174 - -
5175
5176 - -
5177
5178 - -
5179
5180 - -
5181
5182 - -
5183
5184 - -
5185
5186 - -
5187
5188 - -
5189
5190 - -
5191
5192 - -
5193
5194 - y\ :sub:`7`
5195
5196 - y\ :sub:`6`
5197
5198 - y\ :sub:`5`
5199
5200 - y\ :sub:`4`
5201
5202 - y\ :sub:`3`
5203
5204 - y\ :sub:`2`
5205
5206 - y\ :sub:`1`
5207
5208 - y\ :sub:`0`
5209
5210 - .. row 23
5211
5212 -
5213 -
5214 -
5215 - -
5216
5217 - -
5218
5219 - -
5220
5221 - -
5222
5223 - -
5224
5225 - -
5226
5227 - -
5228
5229 - -
5230
5231 - -
5232
5233 - -
5234
5235 - -
5236
5237 - -
5238
5239 - -
5240
5241 - -
5242
5243 - -
5244
5245 - -
5246
5247 - -
5248
5249 - -
5250
5251 - -
5252
5253 - -
5254
5255 - -
5256
5257 - -
5258
5259 - -
5260
5261 - -
5262
5263 - v\ :sub:`7`
5264
5265 - v\ :sub:`6`
5266
5267 - v\ :sub:`5`
5268
5269 - v\ :sub:`4`
5270
5271 - v\ :sub:`3`
5272
5273 - v\ :sub:`2`
5274
5275 - v\ :sub:`1`
5276
5277 - v\ :sub:`0`
5278
5279 - .. _MEDIA-BUS-FMT-YVYU8-1_5X8:
5280
5281 - MEDIA_BUS_FMT_YVYU8_1_5X8
5282
5283 - 0x2005
5284
5285 -
5286 - -
5287
5288 - -
5289
5290 - -
5291
5292 - -
5293
5294 - -
5295
5296 - -
5297
5298 - -
5299
5300 - -
5301
5302 - -
5303
5304 - -
5305
5306 - -
5307
5308 - -
5309
5310 - -
5311
5312 - -
5313
5314 - -
5315
5316 - -
5317
5318 - -
5319
5320 - -
5321
5322 - -
5323
5324 - -
5325
5326 - -
5327
5328 - -
5329
5330 - -
5331
5332 - -
5333
5334 - y\ :sub:`7`
5335
5336 - y\ :sub:`6`
5337
5338 - y\ :sub:`5`
5339
5340 - y\ :sub:`4`
5341
5342 - y\ :sub:`3`
5343
5344 - y\ :sub:`2`
5345
5346 - y\ :sub:`1`
5347
5348 - y\ :sub:`0`
5349
5350 - .. row 25
5351
5352 -
5353 -
5354 -
5355 - -
5356
5357 - -
5358
5359 - -
5360
5361 - -
5362
5363 - -
5364
5365 - -
5366
5367 - -
5368
5369 - -
5370
5371 - -
5372
5373 - -
5374
5375 - -
5376
5377 - -
5378
5379 - -
5380
5381 - -
5382
5383 - -
5384
5385 - -
5386
5387 - -
5388
5389 - -
5390
5391 - -
5392
5393 - -
5394
5395 - -
5396
5397 - -
5398
5399 - -
5400
5401 - -
5402
5403 - y\ :sub:`7`
5404
5405 - y\ :sub:`6`
5406
5407 - y\ :sub:`5`
5408
5409 - y\ :sub:`4`
5410
5411 - y\ :sub:`3`
5412
5413 - y\ :sub:`2`
5414
5415 - y\ :sub:`1`
5416
5417 - y\ :sub:`0`
5418
5419 - .. row 26
5420
5421 -
5422 -
5423 -
5424 - -
5425
5426 - -
5427
5428 - -
5429
5430 - -
5431
5432 - -
5433
5434 - -
5435
5436 - -
5437
5438 - -
5439
5440 - -
5441
5442 - -
5443
5444 - -
5445
5446 - -
5447
5448 - -
5449
5450 - -
5451
5452 - -
5453
5454 - -
5455
5456 - -
5457
5458 - -
5459
5460 - -
5461
5462 - -
5463
5464 - -
5465
5466 - -
5467
5468 - -
5469
5470 - -
5471
5472 - v\ :sub:`7`
5473
5474 - v\ :sub:`6`
5475
5476 - v\ :sub:`5`
5477
5478 - v\ :sub:`4`
5479
5480 - v\ :sub:`3`
5481
5482 - v\ :sub:`2`
5483
5484 - v\ :sub:`1`
5485
5486 - v\ :sub:`0`
5487
5488 - .. row 27
5489
5490 -
5491 -
5492 -
5493 - -
5494
5495 - -
5496
5497 - -
5498
5499 - -
5500
5501 - -
5502
5503 - -
5504
5505 - -
5506
5507 - -
5508
5509 - -
5510
5511 - -
5512
5513 - -
5514
5515 - -
5516
5517 - -
5518
5519 - -
5520
5521 - -
5522
5523 - -
5524
5525 - -
5526
5527 - -
5528
5529 - -
5530
5531 - -
5532
5533 - -
5534
5535 - -
5536
5537 - -
5538
5539 - -
5540
5541 - y\ :sub:`7`
5542
5543 - y\ :sub:`6`
5544
5545 - y\ :sub:`5`
5546
5547 - y\ :sub:`4`
5548
5549 - y\ :sub:`3`
5550
5551 - y\ :sub:`2`
5552
5553 - y\ :sub:`1`
5554
5555 - y\ :sub:`0`
5556
5557 - .. row 28
5558
5559 -
5560 -
5561 -
5562 - -
5563
5564 - -
5565
5566 - -
5567
5568 - -
5569
5570 - -
5571
5572 - -
5573
5574 - -
5575
5576 - -
5577
5578 - -
5579
5580 - -
5581
5582 - -
5583
5584 - -
5585
5586 - -
5587
5588 - -
5589
5590 - -
5591
5592 - -
5593
5594 - -
5595
5596 - -
5597
5598 - -
5599
5600 - -
5601
5602 - -
5603
5604 - -
5605
5606 - -
5607
5608 - -
5609
5610 - y\ :sub:`7`
5611
5612 - y\ :sub:`6`
5613
5614 - y\ :sub:`5`
5615
5616 - y\ :sub:`4`
5617
5618 - y\ :sub:`3`
5619
5620 - y\ :sub:`2`
5621
5622 - y\ :sub:`1`
5623
5624 - y\ :sub:`0`
5625
5626 - .. row 29
5627
5628 -
5629 -
5630 -
5631 - -
5632
5633 - -
5634
5635 - -
5636
5637 - -
5638
5639 - -
5640
5641 - -
5642
5643 - -
5644
5645 - -
5646
5647 - -
5648
5649 - -
5650
5651 - -
5652
5653 - -
5654
5655 - -
5656
5657 - -
5658
5659 - -
5660
5661 - -
5662
5663 - -
5664
5665 - -
5666
5667 - -
5668
5669 - -
5670
5671 - -
5672
5673 - -
5674
5675 - -
5676
5677 - -
5678
5679 - u\ :sub:`7`
5680
5681 - u\ :sub:`6`
5682
5683 - u\ :sub:`5`
5684
5685 - u\ :sub:`4`
5686
5687 - u\ :sub:`3`
5688
5689 - u\ :sub:`2`
5690
5691 - u\ :sub:`1`
5692
5693 - u\ :sub:`0`
5694
5695 - .. _MEDIA-BUS-FMT-UYVY8-2X8:
5696
5697 - MEDIA_BUS_FMT_UYVY8_2X8
5698
5699 - 0x2006
5700
5701 -
5702 - -
5703
5704 - -
5705
5706 - -
5707
5708 - -
5709
5710 - -
5711
5712 - -
5713
5714 - -
5715
5716 - -
5717
5718 - -
5719
5720 - -
5721
5722 - -
5723
5724 - -
5725
5726 - -
5727
5728 - -
5729
5730 - -
5731
5732 - -
5733
5734 - -
5735
5736 - -
5737
5738 - -
5739
5740 - -
5741
5742 - -
5743
5744 - -
5745
5746 - -
5747
5748 - -
5749
5750 - u\ :sub:`7`
5751
5752 - u\ :sub:`6`
5753
5754 - u\ :sub:`5`
5755
5756 - u\ :sub:`4`
5757
5758 - u\ :sub:`3`
5759
5760 - u\ :sub:`2`
5761
5762 - u\ :sub:`1`
5763
5764 - u\ :sub:`0`
5765
5766 - .. row 31
5767
5768 -
5769 -
5770 -
5771 - -
5772
5773 - -
5774
5775 - -
5776
5777 - -
5778
5779 - -
5780
5781 - -
5782
5783 - -
5784
5785 - -
5786
5787 - -
5788
5789 - -
5790
5791 - -
5792
5793 - -
5794
5795 - -
5796
5797 - -
5798
5799 - -
5800
5801 - -
5802
5803 - -
5804
5805 - -
5806
5807 - -
5808
5809 - -
5810
5811 - -
5812
5813 - -
5814
5815 - -
5816
5817 - -
5818
5819 - y\ :sub:`7`
5820
5821 - y\ :sub:`6`
5822
5823 - y\ :sub:`5`
5824
5825 - y\ :sub:`4`
5826
5827 - y\ :sub:`3`
5828
5829 - y\ :sub:`2`
5830
5831 - y\ :sub:`1`
5832
5833 - y\ :sub:`0`
5834
5835 - .. row 32
5836
5837 -
5838 -
5839 -
5840 - -
5841
5842 - -
5843
5844 - -
5845
5846 - -
5847
5848 - -
5849
5850 - -
5851
5852 - -
5853
5854 - -
5855
5856 - -
5857
5858 - -
5859
5860 - -
5861
5862 - -
5863
5864 - -
5865
5866 - -
5867
5868 - -
5869
5870 - -
5871
5872 - -
5873
5874 - -
5875
5876 - -
5877
5878 - -
5879
5880 - -
5881
5882 - -
5883
5884 - -
5885
5886 - -
5887
5888 - v\ :sub:`7`
5889
5890 - v\ :sub:`6`
5891
5892 - v\ :sub:`5`
5893
5894 - v\ :sub:`4`
5895
5896 - v\ :sub:`3`
5897
5898 - v\ :sub:`2`
5899
5900 - v\ :sub:`1`
5901
5902 - v\ :sub:`0`
5903
5904 - .. row 33
5905
5906 -
5907 -
5908 -
5909 - -
5910
5911 - -
5912
5913 - -
5914
5915 - -
5916
5917 - -
5918
5919 - -
5920
5921 - -
5922
5923 - -
5924
5925 - -
5926
5927 - -
5928
5929 - -
5930
5931 - -
5932
5933 - -
5934
5935 - -
5936
5937 - -
5938
5939 - -
5940
5941 - -
5942
5943 - -
5944
5945 - -
5946
5947 - -
5948
5949 - -
5950
5951 - -
5952
5953 - -
5954
5955 - -
5956
5957 - y\ :sub:`7`
5958
5959 - y\ :sub:`6`
5960
5961 - y\ :sub:`5`
5962
5963 - y\ :sub:`4`
5964
5965 - y\ :sub:`3`
5966
5967 - y\ :sub:`2`
5968
5969 - y\ :sub:`1`
5970
5971 - y\ :sub:`0`
5972
5973 - .. _MEDIA-BUS-FMT-VYUY8-2X8:
5974
5975 - MEDIA_BUS_FMT_VYUY8_2X8
5976
5977 - 0x2007
5978
5979 -
5980 - -
5981
5982 - -
5983
5984 - -
5985
5986 - -
5987
5988 - -
5989
5990 - -
5991
5992 - -
5993
5994 - -
5995
5996 - -
5997
5998 - -
5999
6000 - -
6001
6002 - -
6003
6004 - -
6005
6006 - -
6007
6008 - -
6009
6010 - -
6011
6012 - -
6013
6014 - -
6015
6016 - -
6017
6018 - -
6019
6020 - -
6021
6022 - -
6023
6024 - -
6025
6026 - -
6027
6028 - v\ :sub:`7`
6029
6030 - v\ :sub:`6`
6031
6032 - v\ :sub:`5`
6033
6034 - v\ :sub:`4`
6035
6036 - v\ :sub:`3`
6037
6038 - v\ :sub:`2`
6039
6040 - v\ :sub:`1`
6041
6042 - v\ :sub:`0`
6043
6044 - .. row 35
6045
6046 -
6047 -
6048 -
6049 - -
6050
6051 - -
6052
6053 - -
6054
6055 - -
6056
6057 - -
6058
6059 - -
6060
6061 - -
6062
6063 - -
6064
6065 - -
6066
6067 - -
6068
6069 - -
6070
6071 - -
6072
6073 - -
6074
6075 - -
6076
6077 - -
6078
6079 - -
6080
6081 - -
6082
6083 - -
6084
6085 - -
6086
6087 - -
6088
6089 - -
6090
6091 - -
6092
6093 - -
6094
6095 - -
6096
6097 - y\ :sub:`7`
6098
6099 - y\ :sub:`6`
6100
6101 - y\ :sub:`5`
6102
6103 - y\ :sub:`4`
6104
6105 - y\ :sub:`3`
6106
6107 - y\ :sub:`2`
6108
6109 - y\ :sub:`1`
6110
6111 - y\ :sub:`0`
6112
6113 - .. row 36
6114
6115 -
6116 -
6117 -
6118 - -
6119
6120 - -
6121
6122 - -
6123
6124 - -
6125
6126 - -
6127
6128 - -
6129
6130 - -
6131
6132 - -
6133
6134 - -
6135
6136 - -
6137
6138 - -
6139
6140 - -
6141
6142 - -
6143
6144 - -
6145
6146 - -
6147
6148 - -
6149
6150 - -
6151
6152 - -
6153
6154 - -
6155
6156 - -
6157
6158 - -
6159
6160 - -
6161
6162 - -
6163
6164 - -
6165
6166 - u\ :sub:`7`
6167
6168 - u\ :sub:`6`
6169
6170 - u\ :sub:`5`
6171
6172 - u\ :sub:`4`
6173
6174 - u\ :sub:`3`
6175
6176 - u\ :sub:`2`
6177
6178 - u\ :sub:`1`
6179
6180 - u\ :sub:`0`
6181
6182 - .. row 37
6183
6184 -
6185 -
6186 -
6187 - -
6188
6189 - -
6190
6191 - -
6192
6193 - -
6194
6195 - -
6196
6197 - -
6198
6199 - -
6200
6201 - -
6202
6203 - -
6204
6205 - -
6206
6207 - -
6208
6209 - -
6210
6211 - -
6212
6213 - -
6214
6215 - -
6216
6217 - -
6218
6219 - -
6220
6221 - -
6222
6223 - -
6224
6225 - -
6226
6227 - -
6228
6229 - -
6230
6231 - -
6232
6233 - -
6234
6235 - y\ :sub:`7`
6236
6237 - y\ :sub:`6`
6238
6239 - y\ :sub:`5`
6240
6241 - y\ :sub:`4`
6242
6243 - y\ :sub:`3`
6244
6245 - y\ :sub:`2`
6246
6247 - y\ :sub:`1`
6248
6249 - y\ :sub:`0`
6250
6251 - .. _MEDIA-BUS-FMT-YUYV8-2X8:
6252
6253 - MEDIA_BUS_FMT_YUYV8_2X8
6254
6255 - 0x2008
6256
6257 -
6258 - -
6259
6260 - -
6261
6262 - -
6263
6264 - -
6265
6266 - -
6267
6268 - -
6269
6270 - -
6271
6272 - -
6273
6274 - -
6275
6276 - -
6277
6278 - -
6279
6280 - -
6281
6282 - -
6283
6284 - -
6285
6286 - -
6287
6288 - -
6289
6290 - -
6291
6292 - -
6293
6294 - -
6295
6296 - -
6297
6298 - -
6299
6300 - -
6301
6302 - -
6303
6304 - -
6305
6306 - y\ :sub:`7`
6307
6308 - y\ :sub:`6`
6309
6310 - y\ :sub:`5`
6311
6312 - y\ :sub:`4`
6313
6314 - y\ :sub:`3`
6315
6316 - y\ :sub:`2`
6317
6318 - y\ :sub:`1`
6319
6320 - y\ :sub:`0`
6321
6322 - .. row 39
6323
6324 -
6325 -
6326 -
6327 - -
6328
6329 - -
6330
6331 - -
6332
6333 - -
6334
6335 - -
6336
6337 - -
6338
6339 - -
6340
6341 - -
6342
6343 - -
6344
6345 - -
6346
6347 - -
6348
6349 - -
6350
6351 - -
6352
6353 - -
6354
6355 - -
6356
6357 - -
6358
6359 - -
6360
6361 - -
6362
6363 - -
6364
6365 - -
6366
6367 - -
6368
6369 - -
6370
6371 - -
6372
6373 - -
6374
6375 - u\ :sub:`7`
6376
6377 - u\ :sub:`6`
6378
6379 - u\ :sub:`5`
6380
6381 - u\ :sub:`4`
6382
6383 - u\ :sub:`3`
6384
6385 - u\ :sub:`2`
6386
6387 - u\ :sub:`1`
6388
6389 - u\ :sub:`0`
6390
6391 - .. row 40
6392
6393 -
6394 -
6395 -
6396 - -
6397
6398 - -
6399
6400 - -
6401
6402 - -
6403
6404 - -
6405
6406 - -
6407
6408 - -
6409
6410 - -
6411
6412 - -
6413
6414 - -
6415
6416 - -
6417
6418 - -
6419
6420 - -
6421
6422 - -
6423
6424 - -
6425
6426 - -
6427
6428 - -
6429
6430 - -
6431
6432 - -
6433
6434 - -
6435
6436 - -
6437
6438 - -
6439
6440 - -
6441
6442 - -
6443
6444 - y\ :sub:`7`
6445
6446 - y\ :sub:`6`
6447
6448 - y\ :sub:`5`
6449
6450 - y\ :sub:`4`
6451
6452 - y\ :sub:`3`
6453
6454 - y\ :sub:`2`
6455
6456 - y\ :sub:`1`
6457
6458 - y\ :sub:`0`
6459
6460 - .. row 41
6461
6462 -
6463 -
6464 -
6465 - -
6466
6467 - -
6468
6469 - -
6470
6471 - -
6472
6473 - -
6474
6475 - -
6476
6477 - -
6478
6479 - -
6480
6481 - -
6482
6483 - -
6484
6485 - -
6486
6487 - -
6488
6489 - -
6490
6491 - -
6492
6493 - -
6494
6495 - -
6496
6497 - -
6498
6499 - -
6500
6501 - -
6502
6503 - -
6504
6505 - -
6506
6507 - -
6508
6509 - -
6510
6511 - -
6512
6513 - v\ :sub:`7`
6514
6515 - v\ :sub:`6`
6516
6517 - v\ :sub:`5`
6518
6519 - v\ :sub:`4`
6520
6521 - v\ :sub:`3`
6522
6523 - v\ :sub:`2`
6524
6525 - v\ :sub:`1`
6526
6527 - v\ :sub:`0`
6528
6529 - .. _MEDIA-BUS-FMT-YVYU8-2X8:
6530
6531 - MEDIA_BUS_FMT_YVYU8_2X8
6532
6533 - 0x2009
6534
6535 -
6536 - -
6537
6538 - -
6539
6540 - -
6541
6542 - -
6543
6544 - -
6545
6546 - -
6547
6548 - -
6549
6550 - -
6551
6552 - -
6553
6554 - -
6555
6556 - -
6557
6558 - -
6559
6560 - -
6561
6562 - -
6563
6564 - -
6565
6566 - -
6567
6568 - -
6569
6570 - -
6571
6572 - -
6573
6574 - -
6575
6576 - -
6577
6578 - -
6579
6580 - -
6581
6582 - -
6583
6584 - y\ :sub:`7`
6585
6586 - y\ :sub:`6`
6587
6588 - y\ :sub:`5`
6589
6590 - y\ :sub:`4`
6591
6592 - y\ :sub:`3`
6593
6594 - y\ :sub:`2`
6595
6596 - y\ :sub:`1`
6597
6598 - y\ :sub:`0`
6599
6600 - .. row 43
6601
6602 -
6603 -
6604 -
6605 - -
6606
6607 - -
6608
6609 - -
6610
6611 - -
6612
6613 - -
6614
6615 - -
6616
6617 - -
6618
6619 - -
6620
6621 - -
6622
6623 - -
6624
6625 - -
6626
6627 - -
6628
6629 - -
6630
6631 - -
6632
6633 - -
6634
6635 - -
6636
6637 - -
6638
6639 - -
6640
6641 - -
6642
6643 - -
6644
6645 - -
6646
6647 - -
6648
6649 - -
6650
6651 - -
6652
6653 - v\ :sub:`7`
6654
6655 - v\ :sub:`6`
6656
6657 - v\ :sub:`5`
6658
6659 - v\ :sub:`4`
6660
6661 - v\ :sub:`3`
6662
6663 - v\ :sub:`2`
6664
6665 - v\ :sub:`1`
6666
6667 - v\ :sub:`0`
6668
6669 - .. row 44
6670
6671 -
6672 -
6673 -
6674 - -
6675
6676 - -
6677
6678 - -
6679
6680 - -
6681
6682 - -
6683
6684 - -
6685
6686 - -
6687
6688 - -
6689
6690 - -
6691
6692 - -
6693
6694 - -
6695
6696 - -
6697
6698 - -
6699
6700 - -
6701
6702 - -
6703
6704 - -
6705
6706 - -
6707
6708 - -
6709
6710 - -
6711
6712 - -
6713
6714 - -
6715
6716 - -
6717
6718 - -
6719
6720 - -
6721
6722 - y\ :sub:`7`
6723
6724 - y\ :sub:`6`
6725
6726 - y\ :sub:`5`
6727
6728 - y\ :sub:`4`
6729
6730 - y\ :sub:`3`
6731
6732 - y\ :sub:`2`
6733
6734 - y\ :sub:`1`
6735
6736 - y\ :sub:`0`
6737
6738 - .. row 45
6739
6740 -
6741 -
6742 -
6743 - -
6744
6745 - -
6746
6747 - -
6748
6749 - -
6750
6751 - -
6752
6753 - -
6754
6755 - -
6756
6757 - -
6758
6759 - -
6760
6761 - -
6762
6763 - -
6764
6765 - -
6766
6767 - -
6768
6769 - -
6770
6771 - -
6772
6773 - -
6774
6775 - -
6776
6777 - -
6778
6779 - -
6780
6781 - -
6782
6783 - -
6784
6785 - -
6786
6787 - -
6788
6789 - -
6790
6791 - u\ :sub:`7`
6792
6793 - u\ :sub:`6`
6794
6795 - u\ :sub:`5`
6796
6797 - u\ :sub:`4`
6798
6799 - u\ :sub:`3`
6800
6801 - u\ :sub:`2`
6802
6803 - u\ :sub:`1`
6804
6805 - u\ :sub:`0`
6806
6807 - .. _MEDIA-BUS-FMT-Y10-1X10:
6808
6809 - MEDIA_BUS_FMT_Y10_1X10
6810
6811 - 0x200a
6812
6813 -
6814 - -
6815
6816 - -
6817
6818 - -
6819
6820 - -
6821
6822 - -
6823
6824 - -
6825
6826 - -
6827
6828 - -
6829
6830 - -
6831
6832 - -
6833
6834 - -
6835
6836 - -
6837
6838 - -
6839
6840 - -
6841
6842 - -
6843
6844 - -
6845
6846 - -
6847
6848 - -
6849
6850 - -
6851
6852 - -
6853
6854 - -
6855
6856 - -
6857
6858 - y\ :sub:`9`
6859
6860 - y\ :sub:`8`
6861
6862 - y\ :sub:`7`
6863
6864 - y\ :sub:`6`
6865
6866 - y\ :sub:`5`
6867
6868 - y\ :sub:`4`
6869
6870 - y\ :sub:`3`
6871
6872 - y\ :sub:`2`
6873
6874 - y\ :sub:`1`
6875
6876 - y\ :sub:`0`
6877
6878 - .. _MEDIA-BUS-FMT-UYVY10-2X10:
6879
6880 - MEDIA_BUS_FMT_UYVY10_2X10
6881
6882 - 0x2018
6883
6884 -
6885 - -
6886
6887 - -
6888
6889 - -
6890
6891 - -
6892
6893 - -
6894
6895 - -
6896
6897 - -
6898
6899 - -
6900
6901 - -
6902
6903 - -
6904
6905 - -
6906
6907 - -
6908
6909 - -
6910
6911 - -
6912
6913 - -
6914
6915 - -
6916
6917 - -
6918
6919 - -
6920
6921 - -
6922
6923 - -
6924
6925 - -
6926
6927 - -
6928
6929 - u\ :sub:`9`
6930
6931 - u\ :sub:`8`
6932
6933 - u\ :sub:`7`
6934
6935 - u\ :sub:`6`
6936
6937 - u\ :sub:`5`
6938
6939 - u\ :sub:`4`
6940
6941 - u\ :sub:`3`
6942
6943 - u\ :sub:`2`
6944
6945 - u\ :sub:`1`
6946
6947 - u\ :sub:`0`
6948
6949 - .. row 48
6950
6951 -
6952 -
6953 -
6954 - -
6955
6956 - -
6957
6958 - -
6959
6960 - -
6961
6962 - -
6963
6964 - -
6965
6966 - -
6967
6968 - -
6969
6970 - -
6971
6972 - -
6973
6974 - -
6975
6976 - -
6977
6978 - -
6979
6980 - -
6981
6982 - -
6983
6984 - -
6985
6986 - -
6987
6988 - -
6989
6990 - -
6991
6992 - -
6993
6994 - -
6995
6996 - -
6997
6998 - y\ :sub:`9`
6999
7000 - y\ :sub:`8`
7001
7002 - y\ :sub:`7`
7003
7004 - y\ :sub:`6`
7005
7006 - y\ :sub:`5`
7007
7008 - y\ :sub:`4`
7009
7010 - y\ :sub:`3`
7011
7012 - y\ :sub:`2`
7013
7014 - y\ :sub:`1`
7015
7016 - y\ :sub:`0`
7017
7018 - .. row 49
7019
7020 -
7021 -
7022 -
7023 - -
7024
7025 - -
7026
7027 - -
7028
7029 - -
7030
7031 - -
7032
7033 - -
7034
7035 - -
7036
7037 - -
7038
7039 - -
7040
7041 - -
7042
7043 - -
7044
7045 - -
7046
7047 - -
7048
7049 - -
7050
7051 - -
7052
7053 - -
7054
7055 - -
7056
7057 - -
7058
7059 - -
7060
7061 - -
7062
7063 - -
7064
7065 - -
7066
7067 - v\ :sub:`9`
7068
7069 - v\ :sub:`8`
7070
7071 - v\ :sub:`7`
7072
7073 - v\ :sub:`6`
7074
7075 - v\ :sub:`5`
7076
7077 - v\ :sub:`4`
7078
7079 - v\ :sub:`3`
7080
7081 - v\ :sub:`2`
7082
7083 - v\ :sub:`1`
7084
7085 - v\ :sub:`0`
7086
7087 - .. row 50
7088
7089 -
7090 -
7091 -
7092 - -
7093
7094 - -
7095
7096 - -
7097
7098 - -
7099
7100 - -
7101
7102 - -
7103
7104 - -
7105
7106 - -
7107
7108 - -
7109
7110 - -
7111
7112 - -
7113
7114 - -
7115
7116 - -
7117
7118 - -
7119
7120 - -
7121
7122 - -
7123
7124 - -
7125
7126 - -
7127
7128 - -
7129
7130 - -
7131
7132 - -
7133
7134 - -
7135
7136 - y\ :sub:`9`
7137
7138 - y\ :sub:`8`
7139
7140 - y\ :sub:`7`
7141
7142 - y\ :sub:`6`
7143
7144 - y\ :sub:`5`
7145
7146 - y\ :sub:`4`
7147
7148 - y\ :sub:`3`
7149
7150 - y\ :sub:`2`
7151
7152 - y\ :sub:`1`
7153
7154 - y\ :sub:`0`
7155
7156 - .. _MEDIA-BUS-FMT-VYUY10-2X10:
7157
7158 - MEDIA_BUS_FMT_VYUY10_2X10
7159
7160 - 0x2019
7161
7162 -
7163 - -
7164
7165 - -
7166
7167 - -
7168
7169 - -
7170
7171 - -
7172
7173 - -
7174
7175 - -
7176
7177 - -
7178
7179 - -
7180
7181 - -
7182
7183 - -
7184
7185 - -
7186
7187 - -
7188
7189 - -
7190
7191 - -
7192
7193 - -
7194
7195 - -
7196
7197 - -
7198
7199 - -
7200
7201 - -
7202
7203 - -
7204
7205 - -
7206
7207 - v\ :sub:`9`
7208
7209 - v\ :sub:`8`
7210
7211 - v\ :sub:`7`
7212
7213 - v\ :sub:`6`
7214
7215 - v\ :sub:`5`
7216
7217 - v\ :sub:`4`
7218
7219 - v\ :sub:`3`
7220
7221 - v\ :sub:`2`
7222
7223 - v\ :sub:`1`
7224
7225 - v\ :sub:`0`
7226
7227 - .. row 52
7228
7229 -
7230 -
7231 -
7232 - -
7233
7234 - -
7235
7236 - -
7237
7238 - -
7239
7240 - -
7241
7242 - -
7243
7244 - -
7245
7246 - -
7247
7248 - -
7249
7250 - -
7251
7252 - -
7253
7254 - -
7255
7256 - -
7257
7258 - -
7259
7260 - -
7261
7262 - -
7263
7264 - -
7265
7266 - -
7267
7268 - -
7269
7270 - -
7271
7272 - -
7273
7274 - -
7275
7276 - y\ :sub:`9`
7277
7278 - y\ :sub:`8`
7279
7280 - y\ :sub:`7`
7281
7282 - y\ :sub:`6`
7283
7284 - y\ :sub:`5`
7285
7286 - y\ :sub:`4`
7287
7288 - y\ :sub:`3`
7289
7290 - y\ :sub:`2`
7291
7292 - y\ :sub:`1`
7293
7294 - y\ :sub:`0`
7295
7296 - .. row 53
7297
7298 -
7299 -
7300 -
7301 - -
7302
7303 - -
7304
7305 - -
7306
7307 - -
7308
7309 - -
7310
7311 - -
7312
7313 - -
7314
7315 - -
7316
7317 - -
7318
7319 - -
7320
7321 - -
7322
7323 - -
7324
7325 - -
7326
7327 - -
7328
7329 - -
7330
7331 - -
7332
7333 - -
7334
7335 - -
7336
7337 - -
7338
7339 - -
7340
7341 - -
7342
7343 - -
7344
7345 - u\ :sub:`9`
7346
7347 - u\ :sub:`8`
7348
7349 - u\ :sub:`7`
7350
7351 - u\ :sub:`6`
7352
7353 - u\ :sub:`5`
7354
7355 - u\ :sub:`4`
7356
7357 - u\ :sub:`3`
7358
7359 - u\ :sub:`2`
7360
7361 - u\ :sub:`1`
7362
7363 - u\ :sub:`0`
7364
7365 - .. row 54
7366
7367 -
7368 -
7369 -
7370 - -
7371
7372 - -
7373
7374 - -
7375
7376 - -
7377
7378 - -
7379
7380 - -
7381
7382 - -
7383
7384 - -
7385
7386 - -
7387
7388 - -
7389
7390 - -
7391
7392 - -
7393
7394 - -
7395
7396 - -
7397
7398 - -
7399
7400 - -
7401
7402 - -
7403
7404 - -
7405
7406 - -
7407
7408 - -
7409
7410 - -
7411
7412 - -
7413
7414 - y\ :sub:`9`
7415
7416 - y\ :sub:`8`
7417
7418 - y\ :sub:`7`
7419
7420 - y\ :sub:`6`
7421
7422 - y\ :sub:`5`
7423
7424 - y\ :sub:`4`
7425
7426 - y\ :sub:`3`
7427
7428 - y\ :sub:`2`
7429
7430 - y\ :sub:`1`
7431
7432 - y\ :sub:`0`
7433
7434 - .. _MEDIA-BUS-FMT-YUYV10-2X10:
7435
7436 - MEDIA_BUS_FMT_YUYV10_2X10
7437
7438 - 0x200b
7439
7440 -
7441 - -
7442
7443 - -
7444
7445 - -
7446
7447 - -
7448
7449 - -
7450
7451 - -
7452
7453 - -
7454
7455 - -
7456
7457 - -
7458
7459 - -
7460
7461 - -
7462
7463 - -
7464
7465 - -
7466
7467 - -
7468
7469 - -
7470
7471 - -
7472
7473 - -
7474
7475 - -
7476
7477 - -
7478
7479 - -
7480
7481 - -
7482
7483 - -
7484
7485 - y\ :sub:`9`
7486
7487 - y\ :sub:`8`
7488
7489 - y\ :sub:`7`
7490
7491 - y\ :sub:`6`
7492
7493 - y\ :sub:`5`
7494
7495 - y\ :sub:`4`
7496
7497 - y\ :sub:`3`
7498
7499 - y\ :sub:`2`
7500
7501 - y\ :sub:`1`
7502
7503 - y\ :sub:`0`
7504
7505 - .. row 56
7506
7507 -
7508 -
7509 -
7510 - -
7511
7512 - -
7513
7514 - -
7515
7516 - -
7517
7518 - -
7519
7520 - -
7521
7522 - -
7523
7524 - -
7525
7526 - -
7527
7528 - -
7529
7530 - -
7531
7532 - -
7533
7534 - -
7535
7536 - -
7537
7538 - -
7539
7540 - -
7541
7542 - -
7543
7544 - -
7545
7546 - -
7547
7548 - -
7549
7550 - -
7551
7552 - -
7553
7554 - u\ :sub:`9`
7555
7556 - u\ :sub:`8`
7557
7558 - u\ :sub:`7`
7559
7560 - u\ :sub:`6`
7561
7562 - u\ :sub:`5`
7563
7564 - u\ :sub:`4`
7565
7566 - u\ :sub:`3`
7567
7568 - u\ :sub:`2`
7569
7570 - u\ :sub:`1`
7571
7572 - u\ :sub:`0`
7573
7574 - .. row 57
7575
7576 -
7577 -
7578 -
7579 - -
7580
7581 - -
7582
7583 - -
7584
7585 - -
7586
7587 - -
7588
7589 - -
7590
7591 - -
7592
7593 - -
7594
7595 - -
7596
7597 - -
7598
7599 - -
7600
7601 - -
7602
7603 - -
7604
7605 - -
7606
7607 - -
7608
7609 - -
7610
7611 - -
7612
7613 - -
7614
7615 - -
7616
7617 - -
7618
7619 - -
7620
7621 - -
7622
7623 - y\ :sub:`9`
7624
7625 - y\ :sub:`8`
7626
7627 - y\ :sub:`7`
7628
7629 - y\ :sub:`6`
7630
7631 - y\ :sub:`5`
7632
7633 - y\ :sub:`4`
7634
7635 - y\ :sub:`3`
7636
7637 - y\ :sub:`2`
7638
7639 - y\ :sub:`1`
7640
7641 - y\ :sub:`0`
7642
7643 - .. row 58
7644
7645 -
7646 -
7647 -
7648 - -
7649
7650 - -
7651
7652 - -
7653
7654 - -
7655
7656 - -
7657
7658 - -
7659
7660 - -
7661
7662 - -
7663
7664 - -
7665
7666 - -
7667
7668 - -
7669
7670 - -
7671
7672 - -
7673
7674 - -
7675
7676 - -
7677
7678 - -
7679
7680 - -
7681
7682 - -
7683
7684 - -
7685
7686 - -
7687
7688 - -
7689
7690 - -
7691
7692 - v\ :sub:`9`
7693
7694 - v\ :sub:`8`
7695
7696 - v\ :sub:`7`
7697
7698 - v\ :sub:`6`
7699
7700 - v\ :sub:`5`
7701
7702 - v\ :sub:`4`
7703
7704 - v\ :sub:`3`
7705
7706 - v\ :sub:`2`
7707
7708 - v\ :sub:`1`
7709
7710 - v\ :sub:`0`
7711
7712 - .. _MEDIA-BUS-FMT-YVYU10-2X10:
7713
7714 - MEDIA_BUS_FMT_YVYU10_2X10
7715
7716 - 0x200c
7717
7718 -
7719 - -
7720
7721 - -
7722
7723 - -
7724
7725 - -
7726
7727 - -
7728
7729 - -
7730
7731 - -
7732
7733 - -
7734
7735 - -
7736
7737 - -
7738
7739 - -
7740
7741 - -
7742
7743 - -
7744
7745 - -
7746
7747 - -
7748
7749 - -
7750
7751 - -
7752
7753 - -
7754
7755 - -
7756
7757 - -
7758
7759 - -
7760
7761 - -
7762
7763 - y\ :sub:`9`
7764
7765 - y\ :sub:`8`
7766
7767 - y\ :sub:`7`
7768
7769 - y\ :sub:`6`
7770
7771 - y\ :sub:`5`
7772
7773 - y\ :sub:`4`
7774
7775 - y\ :sub:`3`
7776
7777 - y\ :sub:`2`
7778
7779 - y\ :sub:`1`
7780
7781 - y\ :sub:`0`
7782
7783 - .. row 60
7784
7785 -
7786 -
7787 -
7788 - -
7789
7790 - -
7791
7792 - -
7793
7794 - -
7795
7796 - -
7797
7798 - -
7799
7800 - -
7801
7802 - -
7803
7804 - -
7805
7806 - -
7807
7808 - -
7809
7810 - -
7811
7812 - -
7813
7814 - -
7815
7816 - -
7817
7818 - -
7819
7820 - -
7821
7822 - -
7823
7824 - -
7825
7826 - -
7827
7828 - -
7829
7830 - -
7831
7832 - v\ :sub:`9`
7833
7834 - v\ :sub:`8`
7835
7836 - v\ :sub:`7`
7837
7838 - v\ :sub:`6`
7839
7840 - v\ :sub:`5`
7841
7842 - v\ :sub:`4`
7843
7844 - v\ :sub:`3`
7845
7846 - v\ :sub:`2`
7847
7848 - v\ :sub:`1`
7849
7850 - v\ :sub:`0`
7851
7852 - .. row 61
7853
7854 -
7855 -
7856 -
7857 - -
7858
7859 - -
7860
7861 - -
7862
7863 - -
7864
7865 - -
7866
7867 - -
7868
7869 - -
7870
7871 - -
7872
7873 - -
7874
7875 - -
7876
7877 - -
7878
7879 - -
7880
7881 - -
7882
7883 - -
7884
7885 - -
7886
7887 - -
7888
7889 - -
7890
7891 - -
7892
7893 - -
7894
7895 - -
7896
7897 - -
7898
7899 - -
7900
7901 - y\ :sub:`9`
7902
7903 - y\ :sub:`8`
7904
7905 - y\ :sub:`7`
7906
7907 - y\ :sub:`6`
7908
7909 - y\ :sub:`5`
7910
7911 - y\ :sub:`4`
7912
7913 - y\ :sub:`3`
7914
7915 - y\ :sub:`2`
7916
7917 - y\ :sub:`1`
7918
7919 - y\ :sub:`0`
7920
7921 - .. row 62
7922
7923 -
7924 -
7925 -
7926 - -
7927
7928 - -
7929
7930 - -
7931
7932 - -
7933
7934 - -
7935
7936 - -
7937
7938 - -
7939
7940 - -
7941
7942 - -
7943
7944 - -
7945
7946 - -
7947
7948 - -
7949
7950 - -
7951
7952 - -
7953
7954 - -
7955
7956 - -
7957
7958 - -
7959
7960 - -
7961
7962 - -
7963
7964 - -
7965
7966 - -
7967
7968 - -
7969
7970 - u\ :sub:`9`
7971
7972 - u\ :sub:`8`
7973
7974 - u\ :sub:`7`
7975
7976 - u\ :sub:`6`
7977
7978 - u\ :sub:`5`
7979
7980 - u\ :sub:`4`
7981
7982 - u\ :sub:`3`
7983
7984 - u\ :sub:`2`
7985
7986 - u\ :sub:`1`
7987
7988 - u\ :sub:`0`
7989
7990 - .. _MEDIA-BUS-FMT-Y12-1X12:
7991
7992 - MEDIA_BUS_FMT_Y12_1X12
7993
7994 - 0x2013
7995
7996 -
7997 - -
7998
7999 - -
8000
8001 - -
8002
8003 - -
8004
8005 - -
8006
8007 - -
8008
8009 - -
8010
8011 - -
8012
8013 - -
8014
8015 - -
8016
8017 - -
8018
8019 - -
8020
8021 - -
8022
8023 - -
8024
8025 - -
8026
8027 - -
8028
8029 - -
8030
8031 - -
8032
8033 - -
8034
8035 - -
8036
8037 - y\ :sub:`11`
8038
8039 - y\ :sub:`10`
8040
8041 - y\ :sub:`9`
8042
8043 - y\ :sub:`8`
8044
8045 - y\ :sub:`7`
8046
8047 - y\ :sub:`6`
8048
8049 - y\ :sub:`5`
8050
8051 - y\ :sub:`4`
8052
8053 - y\ :sub:`3`
8054
8055 - y\ :sub:`2`
8056
8057 - y\ :sub:`1`
8058
8059 - y\ :sub:`0`
8060
8061 - .. _MEDIA-BUS-FMT-UYVY12-2X12:
8062
8063 - MEDIA_BUS_FMT_UYVY12_2X12
8064
8065 - 0x201c
8066
8067 -
8068 - -
8069
8070 - -
8071
8072 - -
8073
8074 - -
8075
8076 - -
8077
8078 - -
8079
8080 - -
8081
8082 - -
8083
8084 - -
8085
8086 - -
8087
8088 - -
8089
8090 - -
8091
8092 - -
8093
8094 - -
8095
8096 - -
8097
8098 - -
8099
8100 - -
8101
8102 - -
8103
8104 - -
8105
8106 - -
8107
8108 - u\ :sub:`11`
8109
8110 - u\ :sub:`10`
8111
8112 - u\ :sub:`9`
8113
8114 - u\ :sub:`8`
8115
8116 - u\ :sub:`7`
8117
8118 - u\ :sub:`6`
8119
8120 - u\ :sub:`5`
8121
8122 - u\ :sub:`4`
8123
8124 - u\ :sub:`3`
8125
8126 - u\ :sub:`2`
8127
8128 - u\ :sub:`1`
8129
8130 - u\ :sub:`0`
8131
8132 - .. row 65
8133
8134 -
8135 -
8136 -
8137 - -
8138
8139 - -
8140
8141 - -
8142
8143 - -
8144
8145 - -
8146
8147 - -
8148
8149 - -
8150
8151 - -
8152
8153 - -
8154
8155 - -
8156
8157 - -
8158
8159 - -
8160
8161 - -
8162
8163 - -
8164
8165 - -
8166
8167 - -
8168
8169 - -
8170
8171 - -
8172
8173 - -
8174
8175 - -
8176
8177 - y\ :sub:`11`
8178
8179 - y\ :sub:`10`
8180
8181 - y\ :sub:`9`
8182
8183 - y\ :sub:`8`
8184
8185 - y\ :sub:`7`
8186
8187 - y\ :sub:`6`
8188
8189 - y\ :sub:`5`
8190
8191 - y\ :sub:`4`
8192
8193 - y\ :sub:`3`
8194
8195 - y\ :sub:`2`
8196
8197 - y\ :sub:`1`
8198
8199 - y\ :sub:`0`
8200
8201 - .. row 66
8202
8203 -
8204 -
8205 -
8206 - -
8207
8208 - -
8209
8210 - -
8211
8212 - -
8213
8214 - -
8215
8216 - -
8217
8218 - -
8219
8220 - -
8221
8222 - -
8223
8224 - -
8225
8226 - -
8227
8228 - -
8229
8230 - -
8231
8232 - -
8233
8234 - -
8235
8236 - -
8237
8238 - -
8239
8240 - -
8241
8242 - -
8243
8244 - -
8245
8246 - v\ :sub:`11`
8247
8248 - v\ :sub:`10`
8249
8250 - v\ :sub:`9`
8251
8252 - v\ :sub:`8`
8253
8254 - v\ :sub:`7`
8255
8256 - v\ :sub:`6`
8257
8258 - v\ :sub:`5`
8259
8260 - v\ :sub:`4`
8261
8262 - v\ :sub:`3`
8263
8264 - v\ :sub:`2`
8265
8266 - v\ :sub:`1`
8267
8268 - v\ :sub:`0`
8269
8270 - .. row 67
8271
8272 -
8273 -
8274 -
8275 - -
8276
8277 - -
8278
8279 - -
8280
8281 - -
8282
8283 - -
8284
8285 - -
8286
8287 - -
8288
8289 - -
8290
8291 - -
8292
8293 - -
8294
8295 - -
8296
8297 - -
8298
8299 - -
8300
8301 - -
8302
8303 - -
8304
8305 - -
8306
8307 - -
8308
8309 - -
8310
8311 - -
8312
8313 - -
8314
8315 - y\ :sub:`11`
8316
8317 - y\ :sub:`10`
8318
8319 - y\ :sub:`9`
8320
8321 - y\ :sub:`8`
8322
8323 - y\ :sub:`7`
8324
8325 - y\ :sub:`6`
8326
8327 - y\ :sub:`5`
8328
8329 - y\ :sub:`4`
8330
8331 - y\ :sub:`3`
8332
8333 - y\ :sub:`2`
8334
8335 - y\ :sub:`1`
8336
8337 - y\ :sub:`0`
8338
8339 - .. _MEDIA-BUS-FMT-VYUY12-2X12:
8340
8341 - MEDIA_BUS_FMT_VYUY12_2X12
8342
8343 - 0x201d
8344
8345 -
8346 - -
8347
8348 - -
8349
8350 - -
8351
8352 - -
8353
8354 - -
8355
8356 - -
8357
8358 - -
8359
8360 - -
8361
8362 - -
8363
8364 - -
8365
8366 - -
8367
8368 - -
8369
8370 - -
8371
8372 - -
8373
8374 - -
8375
8376 - -
8377
8378 - -
8379
8380 - -
8381
8382 - -
8383
8384 - -
8385
8386 - v\ :sub:`11`
8387
8388 - v\ :sub:`10`
8389
8390 - v\ :sub:`9`
8391
8392 - v\ :sub:`8`
8393
8394 - v\ :sub:`7`
8395
8396 - v\ :sub:`6`
8397
8398 - v\ :sub:`5`
8399
8400 - v\ :sub:`4`
8401
8402 - v\ :sub:`3`
8403
8404 - v\ :sub:`2`
8405
8406 - v\ :sub:`1`
8407
8408 - v\ :sub:`0`
8409
8410 - .. row 69
8411
8412 -
8413 -
8414 -
8415 - -
8416
8417 - -
8418
8419 - -
8420
8421 - -
8422
8423 - -
8424
8425 - -
8426
8427 - -
8428
8429 - -
8430
8431 - -
8432
8433 - -
8434
8435 - -
8436
8437 - -
8438
8439 - -
8440
8441 - -
8442
8443 - -
8444
8445 - -
8446
8447 - -
8448
8449 - -
8450
8451 - -
8452
8453 - -
8454
8455 - y\ :sub:`11`
8456
8457 - y\ :sub:`10`
8458
8459 - y\ :sub:`9`
8460
8461 - y\ :sub:`8`
8462
8463 - y\ :sub:`7`
8464
8465 - y\ :sub:`6`
8466
8467 - y\ :sub:`5`
8468
8469 - y\ :sub:`4`
8470
8471 - y\ :sub:`3`
8472
8473 - y\ :sub:`2`
8474
8475 - y\ :sub:`1`
8476
8477 - y\ :sub:`0`
8478
8479 - .. row 70
8480
8481 -
8482 -
8483 -
8484 - -
8485
8486 - -
8487
8488 - -
8489
8490 - -
8491
8492 - -
8493
8494 - -
8495
8496 - -
8497
8498 - -
8499
8500 - -
8501
8502 - -
8503
8504 - -
8505
8506 - -
8507
8508 - -
8509
8510 - -
8511
8512 - -
8513
8514 - -
8515
8516 - -
8517
8518 - -
8519
8520 - -
8521
8522 - -
8523
8524 - u\ :sub:`11`
8525
8526 - u\ :sub:`10`
8527
8528 - u\ :sub:`9`
8529
8530 - u\ :sub:`8`
8531
8532 - u\ :sub:`7`
8533
8534 - u\ :sub:`6`
8535
8536 - u\ :sub:`5`
8537
8538 - u\ :sub:`4`
8539
8540 - u\ :sub:`3`
8541
8542 - u\ :sub:`2`
8543
8544 - u\ :sub:`1`
8545
8546 - u\ :sub:`0`
8547
8548 - .. row 71
8549
8550 -
8551 -
8552 -
8553 - -
8554
8555 - -
8556
8557 - -
8558
8559 - -
8560
8561 - -
8562
8563 - -
8564
8565 - -
8566
8567 - -
8568
8569 - -
8570
8571 - -
8572
8573 - -
8574
8575 - -
8576
8577 - -
8578
8579 - -
8580
8581 - -
8582
8583 - -
8584
8585 - -
8586
8587 - -
8588
8589 - -
8590
8591 - -
8592
8593 - y\ :sub:`11`
8594
8595 - y\ :sub:`10`
8596
8597 - y\ :sub:`9`
8598
8599 - y\ :sub:`8`
8600
8601 - y\ :sub:`7`
8602
8603 - y\ :sub:`6`
8604
8605 - y\ :sub:`5`
8606
8607 - y\ :sub:`4`
8608
8609 - y\ :sub:`3`
8610
8611 - y\ :sub:`2`
8612
8613 - y\ :sub:`1`
8614
8615 - y\ :sub:`0`
8616
8617 - .. _MEDIA-BUS-FMT-YUYV12-2X12:
8618
8619 - MEDIA_BUS_FMT_YUYV12_2X12
8620
8621 - 0x201e
8622
8623 -
8624 - -
8625
8626 - -
8627
8628 - -
8629
8630 - -
8631
8632 - -
8633
8634 - -
8635
8636 - -
8637
8638 - -
8639
8640 - -
8641
8642 - -
8643
8644 - -
8645
8646 - -
8647
8648 - -
8649
8650 - -
8651
8652 - -
8653
8654 - -
8655
8656 - -
8657
8658 - -
8659
8660 - -
8661
8662 - -
8663
8664 - y\ :sub:`11`
8665
8666 - y\ :sub:`10`
8667
8668 - y\ :sub:`9`
8669
8670 - y\ :sub:`8`
8671
8672 - y\ :sub:`7`
8673
8674 - y\ :sub:`6`
8675
8676 - y\ :sub:`5`
8677
8678 - y\ :sub:`4`
8679
8680 - y\ :sub:`3`
8681
8682 - y\ :sub:`2`
8683
8684 - y\ :sub:`1`
8685
8686 - y\ :sub:`0`
8687
8688 - .. row 73
8689
8690 -
8691 -
8692 -
8693 - -
8694
8695 - -
8696
8697 - -
8698
8699 - -
8700
8701 - -
8702
8703 - -
8704
8705 - -
8706
8707 - -
8708
8709 - -
8710
8711 - -
8712
8713 - -
8714
8715 - -
8716
8717 - -
8718
8719 - -
8720
8721 - -
8722
8723 - -
8724
8725 - -
8726
8727 - -
8728
8729 - -
8730
8731 - -
8732
8733 - u\ :sub:`11`
8734
8735 - u\ :sub:`10`
8736
8737 - u\ :sub:`9`
8738
8739 - u\ :sub:`8`
8740
8741 - u\ :sub:`7`
8742
8743 - u\ :sub:`6`
8744
8745 - u\ :sub:`5`
8746
8747 - u\ :sub:`4`
8748
8749 - u\ :sub:`3`
8750
8751 - u\ :sub:`2`
8752
8753 - u\ :sub:`1`
8754
8755 - u\ :sub:`0`
8756
8757 - .. row 74
8758
8759 -
8760 -
8761 -
8762 - -
8763
8764 - -
8765
8766 - -
8767
8768 - -
8769
8770 - -
8771
8772 - -
8773
8774 - -
8775
8776 - -
8777
8778 - -
8779
8780 - -
8781
8782 - -
8783
8784 - -
8785
8786 - -
8787
8788 - -
8789
8790 - -
8791
8792 - -
8793
8794 - -
8795
8796 - -
8797
8798 - -
8799
8800 - -
8801
8802 - y\ :sub:`11`
8803
8804 - y\ :sub:`10`
8805
8806 - y\ :sub:`9`
8807
8808 - y\ :sub:`8`
8809
8810 - y\ :sub:`7`
8811
8812 - y\ :sub:`6`
8813
8814 - y\ :sub:`5`
8815
8816 - y\ :sub:`4`
8817
8818 - y\ :sub:`3`
8819
8820 - y\ :sub:`2`
8821
8822 - y\ :sub:`1`
8823
8824 - y\ :sub:`0`
8825
8826 - .. row 75
8827
8828 -
8829 -
8830 -
8831 - -
8832
8833 - -
8834
8835 - -
8836
8837 - -
8838
8839 - -
8840
8841 - -
8842
8843 - -
8844
8845 - -
8846
8847 - -
8848
8849 - -
8850
8851 - -
8852
8853 - -
8854
8855 - -
8856
8857 - -
8858
8859 - -
8860
8861 - -
8862
8863 - -
8864
8865 - -
8866
8867 - -
8868
8869 - -
8870
8871 - v\ :sub:`11`
8872
8873 - v\ :sub:`10`
8874
8875 - v\ :sub:`9`
8876
8877 - v\ :sub:`8`
8878
8879 - v\ :sub:`7`
8880
8881 - v\ :sub:`6`
8882
8883 - v\ :sub:`5`
8884
8885 - v\ :sub:`4`
8886
8887 - v\ :sub:`3`
8888
8889 - v\ :sub:`2`
8890
8891 - v\ :sub:`1`
8892
8893 - v\ :sub:`0`
8894
8895 - .. _MEDIA-BUS-FMT-YVYU12-2X12:
8896
8897 - MEDIA_BUS_FMT_YVYU12_2X12
8898
8899 - 0x201f
8900
8901 -
8902 - -
8903
8904 - -
8905
8906 - -
8907
8908 - -
8909
8910 - -
8911
8912 - -
8913
8914 - -
8915
8916 - -
8917
8918 - -
8919
8920 - -
8921
8922 - -
8923
8924 - -
8925
8926 - -
8927
8928 - -
8929
8930 - -
8931
8932 - -
8933
8934 - -
8935
8936 - -
8937
8938 - -
8939
8940 - -
8941
8942 - y\ :sub:`11`
8943
8944 - y\ :sub:`10`
8945
8946 - y\ :sub:`9`
8947
8948 - y\ :sub:`8`
8949
8950 - y\ :sub:`7`
8951
8952 - y\ :sub:`6`
8953
8954 - y\ :sub:`5`
8955
8956 - y\ :sub:`4`
8957
8958 - y\ :sub:`3`
8959
8960 - y\ :sub:`2`
8961
8962 - y\ :sub:`1`
8963
8964 - y\ :sub:`0`
8965
8966 - .. row 77
8967
8968 -
8969 -
8970 -
8971 - -
8972
8973 - -
8974
8975 - -
8976
8977 - -
8978
8979 - -
8980
8981 - -
8982
8983 - -
8984
8985 - -
8986
8987 - -
8988
8989 - -
8990
8991 - -
8992
8993 - -
8994
8995 - -
8996
8997 - -
8998
8999 - -
9000
9001 - -
9002
9003 - -
9004
9005 - -
9006
9007 - -
9008
9009 - -
9010
9011 - v\ :sub:`11`
9012
9013 - v\ :sub:`10`
9014
9015 - v\ :sub:`9`
9016
9017 - v\ :sub:`8`
9018
9019 - v\ :sub:`7`
9020
9021 - v\ :sub:`6`
9022
9023 - v\ :sub:`5`
9024
9025 - v\ :sub:`4`
9026
9027 - v\ :sub:`3`
9028
9029 - v\ :sub:`2`
9030
9031 - v\ :sub:`1`
9032
9033 - v\ :sub:`0`
9034
9035 - .. row 78
9036
9037 -
9038 -
9039 -
9040 - -
9041
9042 - -
9043
9044 - -
9045
9046 - -
9047
9048 - -
9049
9050 - -
9051
9052 - -
9053
9054 - -
9055
9056 - -
9057
9058 - -
9059
9060 - -
9061
9062 - -
9063
9064 - -
9065
9066 - -
9067
9068 - -
9069
9070 - -
9071
9072 - -
9073
9074 - -
9075
9076 - -
9077
9078 - -
9079
9080 - y\ :sub:`11`
9081
9082 - y\ :sub:`10`
9083
9084 - y\ :sub:`9`
9085
9086 - y\ :sub:`8`
9087
9088 - y\ :sub:`7`
9089
9090 - y\ :sub:`6`
9091
9092 - y\ :sub:`5`
9093
9094 - y\ :sub:`4`
9095
9096 - y\ :sub:`3`
9097
9098 - y\ :sub:`2`
9099
9100 - y\ :sub:`1`
9101
9102 - y\ :sub:`0`
9103
9104 - .. row 79
9105
9106 -
9107 -
9108 -
9109 - -
9110
9111 - -
9112
9113 - -
9114
9115 - -
9116
9117 - -
9118
9119 - -
9120
9121 - -
9122
9123 - -
9124
9125 - -
9126
9127 - -
9128
9129 - -
9130
9131 - -
9132
9133 - -
9134
9135 - -
9136
9137 - -
9138
9139 - -
9140
9141 - -
9142
9143 - -
9144
9145 - -
9146
9147 - -
9148
9149 - u\ :sub:`11`
9150
9151 - u\ :sub:`10`
9152
9153 - u\ :sub:`9`
9154
9155 - u\ :sub:`8`
9156
9157 - u\ :sub:`7`
9158
9159 - u\ :sub:`6`
9160
9161 - u\ :sub:`5`
9162
9163 - u\ :sub:`4`
9164
9165 - u\ :sub:`3`
9166
9167 - u\ :sub:`2`
9168
9169 - u\ :sub:`1`
9170
9171 - u\ :sub:`0`
9172
9173 - .. _MEDIA-BUS-FMT-UYVY8-1X16:
9174
9175 - MEDIA_BUS_FMT_UYVY8_1X16
9176
9177 - 0x200f
9178
9179 -
9180 - -
9181
9182 - -
9183
9184 - -
9185
9186 - -
9187
9188 - -
9189
9190 - -
9191
9192 - -
9193
9194 - -
9195
9196 - -
9197
9198 - -
9199
9200 - -
9201
9202 - -
9203
9204 - -
9205
9206 - -
9207
9208 - -
9209
9210 - -
9211
9212 - u\ :sub:`7`
9213
9214 - u\ :sub:`6`
9215
9216 - u\ :sub:`5`
9217
9218 - u\ :sub:`4`
9219
9220 - u\ :sub:`3`
9221
9222 - u\ :sub:`2`
9223
9224 - u\ :sub:`1`
9225
9226 - u\ :sub:`0`
9227
9228 - y\ :sub:`7`
9229
9230 - y\ :sub:`6`
9231
9232 - y\ :sub:`5`
9233
9234 - y\ :sub:`4`
9235
9236 - y\ :sub:`3`
9237
9238 - y\ :sub:`2`
9239
9240 - y\ :sub:`1`
9241
9242 - y\ :sub:`0`
9243
9244 - .. row 81
9245
9246 -
9247 -
9248 -
9249 - -
9250
9251 - -
9252
9253 - -
9254
9255 - -
9256
9257 - -
9258
9259 - -
9260
9261 - -
9262
9263 - -
9264
9265 - -
9266
9267 - -
9268
9269 - -
9270
9271 - -
9272
9273 - -
9274
9275 - -
9276
9277 - -
9278
9279 - -
9280
9281 - v\ :sub:`7`
9282
9283 - v\ :sub:`6`
9284
9285 - v\ :sub:`5`
9286
9287 - v\ :sub:`4`
9288
9289 - v\ :sub:`3`
9290
9291 - v\ :sub:`2`
9292
9293 - v\ :sub:`1`
9294
9295 - v\ :sub:`0`
9296
9297 - y\ :sub:`7`
9298
9299 - y\ :sub:`6`
9300
9301 - y\ :sub:`5`
9302
9303 - y\ :sub:`4`
9304
9305 - y\ :sub:`3`
9306
9307 - y\ :sub:`2`
9308
9309 - y\ :sub:`1`
9310
9311 - y\ :sub:`0`
9312
9313 - .. _MEDIA-BUS-FMT-VYUY8-1X16:
9314
9315 - MEDIA_BUS_FMT_VYUY8_1X16
9316
9317 - 0x2010
9318
9319 -
9320 - -
9321
9322 - -
9323
9324 - -
9325
9326 - -
9327
9328 - -
9329
9330 - -
9331
9332 - -
9333
9334 - -
9335
9336 - -
9337
9338 - -
9339
9340 - -
9341
9342 - -
9343
9344 - -
9345
9346 - -
9347
9348 - -
9349
9350 - -
9351
9352 - v\ :sub:`7`
9353
9354 - v\ :sub:`6`
9355
9356 - v\ :sub:`5`
9357
9358 - v\ :sub:`4`
9359
9360 - v\ :sub:`3`
9361
9362 - v\ :sub:`2`
9363
9364 - v\ :sub:`1`
9365
9366 - v\ :sub:`0`
9367
9368 - y\ :sub:`7`
9369
9370 - y\ :sub:`6`
9371
9372 - y\ :sub:`5`
9373
9374 - y\ :sub:`4`
9375
9376 - y\ :sub:`3`
9377
9378 - y\ :sub:`2`
9379
9380 - y\ :sub:`1`
9381
9382 - y\ :sub:`0`
9383
9384 - .. row 83
9385
9386 -
9387 -
9388 -
9389 - -
9390
9391 - -
9392
9393 - -
9394
9395 - -
9396
9397 - -
9398
9399 - -
9400
9401 - -
9402
9403 - -
9404
9405 - -
9406
9407 - -
9408
9409 - -
9410
9411 - -
9412
9413 - -
9414
9415 - -
9416
9417 - -
9418
9419 - -
9420
9421 - u\ :sub:`7`
9422
9423 - u\ :sub:`6`
9424
9425 - u\ :sub:`5`
9426
9427 - u\ :sub:`4`
9428
9429 - u\ :sub:`3`
9430
9431 - u\ :sub:`2`
9432
9433 - u\ :sub:`1`
9434
9435 - u\ :sub:`0`
9436
9437 - y\ :sub:`7`
9438
9439 - y\ :sub:`6`
9440
9441 - y\ :sub:`5`
9442
9443 - y\ :sub:`4`
9444
9445 - y\ :sub:`3`
9446
9447 - y\ :sub:`2`
9448
9449 - y\ :sub:`1`
9450
9451 - y\ :sub:`0`
9452
9453 - .. _MEDIA-BUS-FMT-YUYV8-1X16:
9454
9455 - MEDIA_BUS_FMT_YUYV8_1X16
9456
9457 - 0x2011
9458
9459 -
9460 - -
9461
9462 - -
9463
9464 - -
9465
9466 - -
9467
9468 - -
9469
9470 - -
9471
9472 - -
9473
9474 - -
9475
9476 - -
9477
9478 - -
9479
9480 - -
9481
9482 - -
9483
9484 - -
9485
9486 - -
9487
9488 - -
9489
9490 - -
9491
9492 - y\ :sub:`7`
9493
9494 - y\ :sub:`6`
9495
9496 - y\ :sub:`5`
9497
9498 - y\ :sub:`4`
9499
9500 - y\ :sub:`3`
9501
9502 - y\ :sub:`2`
9503
9504 - y\ :sub:`1`
9505
9506 - y\ :sub:`0`
9507
9508 - u\ :sub:`7`
9509
9510 - u\ :sub:`6`
9511
9512 - u\ :sub:`5`
9513
9514 - u\ :sub:`4`
9515
9516 - u\ :sub:`3`
9517
9518 - u\ :sub:`2`
9519
9520 - u\ :sub:`1`
9521
9522 - u\ :sub:`0`
9523
9524 - .. row 85
9525
9526 -
9527 -
9528 -
9529 - -
9530
9531 - -
9532
9533 - -
9534
9535 - -
9536
9537 - -
9538
9539 - -
9540
9541 - -
9542
9543 - -
9544
9545 - -
9546
9547 - -
9548
9549 - -
9550
9551 - -
9552
9553 - -
9554
9555 - -
9556
9557 - -
9558
9559 - -
9560
9561 - y\ :sub:`7`
9562
9563 - y\ :sub:`6`
9564
9565 - y\ :sub:`5`
9566
9567 - y\ :sub:`4`
9568
9569 - y\ :sub:`3`
9570
9571 - y\ :sub:`2`
9572
9573 - y\ :sub:`1`
9574
9575 - y\ :sub:`0`
9576
9577 - v\ :sub:`7`
9578
9579 - v\ :sub:`6`
9580
9581 - v\ :sub:`5`
9582
9583 - v\ :sub:`4`
9584
9585 - v\ :sub:`3`
9586
9587 - v\ :sub:`2`
9588
9589 - v\ :sub:`1`
9590
9591 - v\ :sub:`0`
9592
9593 - .. _MEDIA-BUS-FMT-YVYU8-1X16:
9594
9595 - MEDIA_BUS_FMT_YVYU8_1X16
9596
9597 - 0x2012
9598
9599 -
9600 - -
9601
9602 - -
9603
9604 - -
9605
9606 - -
9607
9608 - -
9609
9610 - -
9611
9612 - -
9613
9614 - -
9615
9616 - -
9617
9618 - -
9619
9620 - -
9621
9622 - -
9623
9624 - -
9625
9626 - -
9627
9628 - -
9629
9630 - -
9631
9632 - y\ :sub:`7`
9633
9634 - y\ :sub:`6`
9635
9636 - y\ :sub:`5`
9637
9638 - y\ :sub:`4`
9639
9640 - y\ :sub:`3`
9641
9642 - y\ :sub:`2`
9643
9644 - y\ :sub:`1`
9645
9646 - y\ :sub:`0`
9647
9648 - v\ :sub:`7`
9649
9650 - v\ :sub:`6`
9651
9652 - v\ :sub:`5`
9653
9654 - v\ :sub:`4`
9655
9656 - v\ :sub:`3`
9657
9658 - v\ :sub:`2`
9659
9660 - v\ :sub:`1`
9661
9662 - v\ :sub:`0`
9663
9664 - .. row 87
9665
9666 -
9667 -
9668 -
9669 - -
9670
9671 - -
9672
9673 - -
9674
9675 - -
9676
9677 - -
9678
9679 - -
9680
9681 - -
9682
9683 - -
9684
9685 - -
9686
9687 - -
9688
9689 - -
9690
9691 - -
9692
9693 - -
9694
9695 - -
9696
9697 - -
9698
9699 - -
9700
9701 - y\ :sub:`7`
9702
9703 - y\ :sub:`6`
9704
9705 - y\ :sub:`5`
9706
9707 - y\ :sub:`4`
9708
9709 - y\ :sub:`3`
9710
9711 - y\ :sub:`2`
9712
9713 - y\ :sub:`1`
9714
9715 - y\ :sub:`0`
9716
9717 - u\ :sub:`7`
9718
9719 - u\ :sub:`6`
9720
9721 - u\ :sub:`5`
9722
9723 - u\ :sub:`4`
9724
9725 - u\ :sub:`3`
9726
9727 - u\ :sub:`2`
9728
9729 - u\ :sub:`1`
9730
9731 - u\ :sub:`0`
9732
9733 - .. _MEDIA-BUS-FMT-YDYUYDYV8-1X16:
9734
9735 - MEDIA_BUS_FMT_YDYUYDYV8_1X16
9736
9737 - 0x2014
9738
9739 -
9740 - -
9741
9742 - -
9743
9744 - -
9745
9746 - -
9747
9748 - -
9749
9750 - -
9751
9752 - -
9753
9754 - -
9755
9756 - -
9757
9758 - -
9759
9760 - -
9761
9762 - -
9763
9764 - -
9765
9766 - -
9767
9768 - -
9769
9770 - -
9771
9772 - y\ :sub:`7`
9773
9774 - y\ :sub:`6`
9775
9776 - y\ :sub:`5`
9777
9778 - y\ :sub:`4`
9779
9780 - y\ :sub:`3`
9781
9782 - y\ :sub:`2`
9783
9784 - y\ :sub:`1`
9785
9786 - y\ :sub:`0`
9787
9788 - d
9789
9790 - d
9791
9792 - d
9793
9794 - d
9795
9796 - d
9797
9798 - d
9799
9800 - d
9801
9802 - d
9803
9804 - .. row 89
9805
9806 -
9807 -
9808 -
9809 - -
9810
9811 - -
9812
9813 - -
9814
9815 - -
9816
9817 - -
9818
9819 - -
9820
9821 - -
9822
9823 - -
9824
9825 - -
9826
9827 - -
9828
9829 - -
9830
9831 - -
9832
9833 - -
9834
9835 - -
9836
9837 - -
9838
9839 - -
9840
9841 - y\ :sub:`7`
9842
9843 - y\ :sub:`6`
9844
9845 - y\ :sub:`5`
9846
9847 - y\ :sub:`4`
9848
9849 - y\ :sub:`3`
9850
9851 - y\ :sub:`2`
9852
9853 - y\ :sub:`1`
9854
9855 - y\ :sub:`0`
9856
9857 - u\ :sub:`7`
9858
9859 - u\ :sub:`6`
9860
9861 - u\ :sub:`5`
9862
9863 - u\ :sub:`4`
9864
9865 - u\ :sub:`3`
9866
9867 - u\ :sub:`2`
9868
9869 - u\ :sub:`1`
9870
9871 - u\ :sub:`0`
9872
9873 - .. row 90
9874
9875 -
9876 -
9877 -
9878 - -
9879
9880 - -
9881
9882 - -
9883
9884 - -
9885
9886 - -
9887
9888 - -
9889
9890 - -
9891
9892 - -
9893
9894 - -
9895
9896 - -
9897
9898 - -
9899
9900 - -
9901
9902 - -
9903
9904 - -
9905
9906 - -
9907
9908 - -
9909
9910 - y\ :sub:`7`
9911
9912 - y\ :sub:`6`
9913
9914 - y\ :sub:`5`
9915
9916 - y\ :sub:`4`
9917
9918 - y\ :sub:`3`
9919
9920 - y\ :sub:`2`
9921
9922 - y\ :sub:`1`
9923
9924 - y\ :sub:`0`
9925
9926 - d
9927
9928 - d
9929
9930 - d
9931
9932 - d
9933
9934 - d
9935
9936 - d
9937
9938 - d
9939
9940 - d
9941
9942 - .. row 91
9943
9944 -
9945 -
9946 -
9947 - -
9948
9949 - -
9950
9951 - -
9952
9953 - -
9954
9955 - -
9956
9957 - -
9958
9959 - -
9960
9961 - -
9962
9963 - -
9964
9965 - -
9966
9967 - -
9968
9969 - -
9970
9971 - -
9972
9973 - -
9974
9975 - -
9976
9977 - -
9978
9979 - y\ :sub:`7`
9980
9981 - y\ :sub:`6`
9982
9983 - y\ :sub:`5`
9984
9985 - y\ :sub:`4`
9986
9987 - y\ :sub:`3`
9988
9989 - y\ :sub:`2`
9990
9991 - y\ :sub:`1`
9992
9993 - y\ :sub:`0`
9994
9995 - v\ :sub:`7`
9996
9997 - v\ :sub:`6`
9998
9999 - v\ :sub:`5`
10000
10001 - v\ :sub:`4`
10002
10003 - v\ :sub:`3`
10004
10005 - v\ :sub:`2`
10006
10007 - v\ :sub:`1`
10008
10009 - v\ :sub:`0`
10010
10011 - .. _MEDIA-BUS-FMT-UYVY10-1X20:
10012
10013 - MEDIA_BUS_FMT_UYVY10_1X20
10014
10015 - 0x201a
10016
10017 -
10018 - -
10019
10020 - -
10021
10022 - -
10023
10024 - -
10025
10026 - -
10027
10028 - -
10029
10030 - -
10031
10032 - -
10033
10034 - -
10035
10036 - -
10037
10038 - -
10039
10040 - -
10041
10042 - u\ :sub:`9`
10043
10044 - u\ :sub:`8`
10045
10046 - u\ :sub:`7`
10047
10048 - u\ :sub:`6`
10049
10050 - u\ :sub:`5`
10051
10052 - u\ :sub:`4`
10053
10054 - u\ :sub:`3`
10055
10056 - u\ :sub:`2`
10057
10058 - u\ :sub:`1`
10059
10060 - u\ :sub:`0`
10061
10062 - y\ :sub:`9`
10063
10064 - y\ :sub:`8`
10065
10066 - y\ :sub:`7`
10067
10068 - y\ :sub:`6`
10069
10070 - y\ :sub:`5`
10071
10072 - y\ :sub:`4`
10073
10074 - y\ :sub:`3`
10075
10076 - y\ :sub:`2`
10077
10078 - y\ :sub:`1`
10079
10080 - y\ :sub:`0`
10081
10082 - .. row 93
10083
10084 -
10085 -
10086 -
10087 - -
10088
10089 - -
10090
10091 - -
10092
10093 - -
10094
10095 - -
10096
10097 - -
10098
10099 - -
10100
10101 - -
10102
10103 - -
10104
10105 - -
10106
10107 - -
10108
10109 - -
10110
10111 - v\ :sub:`9`
10112
10113 - v\ :sub:`8`
10114
10115 - v\ :sub:`7`
10116
10117 - v\ :sub:`6`
10118
10119 - v\ :sub:`5`
10120
10121 - v\ :sub:`4`
10122
10123 - v\ :sub:`3`
10124
10125 - v\ :sub:`2`
10126
10127 - v\ :sub:`1`
10128
10129 - v\ :sub:`0`
10130
10131 - y\ :sub:`9`
10132
10133 - y\ :sub:`8`
10134
10135 - y\ :sub:`7`
10136
10137 - y\ :sub:`6`
10138
10139 - y\ :sub:`5`
10140
10141 - y\ :sub:`4`
10142
10143 - y\ :sub:`3`
10144
10145 - y\ :sub:`2`
10146
10147 - y\ :sub:`1`
10148
10149 - y\ :sub:`0`
10150
10151 - .. _MEDIA-BUS-FMT-VYUY10-1X20:
10152
10153 - MEDIA_BUS_FMT_VYUY10_1X20
10154
10155 - 0x201b
10156
10157 -
10158 - -
10159
10160 - -
10161
10162 - -
10163
10164 - -
10165
10166 - -
10167
10168 - -
10169
10170 - -
10171
10172 - -
10173
10174 - -
10175
10176 - -
10177
10178 - -
10179
10180 - -
10181
10182 - v\ :sub:`9`
10183
10184 - v\ :sub:`8`
10185
10186 - v\ :sub:`7`
10187
10188 - v\ :sub:`6`
10189
10190 - v\ :sub:`5`
10191
10192 - v\ :sub:`4`
10193
10194 - v\ :sub:`3`
10195
10196 - v\ :sub:`2`
10197
10198 - v\ :sub:`1`
10199
10200 - v\ :sub:`0`
10201
10202 - y\ :sub:`9`
10203
10204 - y\ :sub:`8`
10205
10206 - y\ :sub:`7`
10207
10208 - y\ :sub:`6`
10209
10210 - y\ :sub:`5`
10211
10212 - y\ :sub:`4`
10213
10214 - y\ :sub:`3`
10215
10216 - y\ :sub:`2`
10217
10218 - y\ :sub:`1`
10219
10220 - y\ :sub:`0`
10221
10222 - .. row 95
10223
10224 -
10225 -
10226 -
10227 - -
10228
10229 - -
10230
10231 - -
10232
10233 - -
10234
10235 - -
10236
10237 - -
10238
10239 - -
10240
10241 - -
10242
10243 - -
10244
10245 - -
10246
10247 - -
10248
10249 - -
10250
10251 - u\ :sub:`9`
10252
10253 - u\ :sub:`8`
10254
10255 - u\ :sub:`7`
10256
10257 - u\ :sub:`6`
10258
10259 - u\ :sub:`5`
10260
10261 - u\ :sub:`4`
10262
10263 - u\ :sub:`3`
10264
10265 - u\ :sub:`2`
10266
10267 - u\ :sub:`1`
10268
10269 - u\ :sub:`0`
10270
10271 - y\ :sub:`9`
10272
10273 - y\ :sub:`8`
10274
10275 - y\ :sub:`7`
10276
10277 - y\ :sub:`6`
10278
10279 - y\ :sub:`5`
10280
10281 - y\ :sub:`4`
10282
10283 - y\ :sub:`3`
10284
10285 - y\ :sub:`2`
10286
10287 - y\ :sub:`1`
10288
10289 - y\ :sub:`0`
10290
10291 - .. _MEDIA-BUS-FMT-YUYV10-1X20:
10292
10293 - MEDIA_BUS_FMT_YUYV10_1X20
10294
10295 - 0x200d
10296
10297 -
10298 - -
10299
10300 - -
10301
10302 - -
10303
10304 - -
10305
10306 - -
10307
10308 - -
10309
10310 - -
10311
10312 - -
10313
10314 - -
10315
10316 - -
10317
10318 - -
10319
10320 - -
10321
10322 - y\ :sub:`9`
10323
10324 - y\ :sub:`8`
10325
10326 - y\ :sub:`7`
10327
10328 - y\ :sub:`6`
10329
10330 - y\ :sub:`5`
10331
10332 - y\ :sub:`4`
10333
10334 - y\ :sub:`3`
10335
10336 - y\ :sub:`2`
10337
10338 - y\ :sub:`1`
10339
10340 - y\ :sub:`0`
10341
10342 - u\ :sub:`9`
10343
10344 - u\ :sub:`8`
10345
10346 - u\ :sub:`7`
10347
10348 - u\ :sub:`6`
10349
10350 - u\ :sub:`5`
10351
10352 - u\ :sub:`4`
10353
10354 - u\ :sub:`3`
10355
10356 - u\ :sub:`2`
10357
10358 - u\ :sub:`1`
10359
10360 - u\ :sub:`0`
10361
10362 - .. row 97
10363
10364 -
10365 -
10366 -
10367 - -
10368
10369 - -
10370
10371 - -
10372
10373 - -
10374
10375 - -
10376
10377 - -
10378
10379 - -
10380
10381 - -
10382
10383 - -
10384
10385 - -
10386
10387 - -
10388
10389 - -
10390
10391 - y\ :sub:`9`
10392
10393 - y\ :sub:`8`
10394
10395 - y\ :sub:`7`
10396
10397 - y\ :sub:`6`
10398
10399 - y\ :sub:`5`
10400
10401 - y\ :sub:`4`
10402
10403 - y\ :sub:`3`
10404
10405 - y\ :sub:`2`
10406
10407 - y\ :sub:`1`
10408
10409 - y\ :sub:`0`
10410
10411 - v\ :sub:`9`
10412
10413 - v\ :sub:`8`
10414
10415 - v\ :sub:`7`
10416
10417 - v\ :sub:`6`
10418
10419 - v\ :sub:`5`
10420
10421 - v\ :sub:`4`
10422
10423 - v\ :sub:`3`
10424
10425 - v\ :sub:`2`
10426
10427 - v\ :sub:`1`
10428
10429 - v\ :sub:`0`
10430
10431 - .. _MEDIA-BUS-FMT-YVYU10-1X20:
10432
10433 - MEDIA_BUS_FMT_YVYU10_1X20
10434
10435 - 0x200e
10436
10437 -
10438 - -
10439
10440 - -
10441
10442 - -
10443
10444 - -
10445
10446 - -
10447
10448 - -
10449
10450 - -
10451
10452 - -
10453
10454 - -
10455
10456 - -
10457
10458 - -
10459
10460 - -
10461
10462 - y\ :sub:`9`
10463
10464 - y\ :sub:`8`
10465
10466 - y\ :sub:`7`
10467
10468 - y\ :sub:`6`
10469
10470 - y\ :sub:`5`
10471
10472 - y\ :sub:`4`
10473
10474 - y\ :sub:`3`
10475
10476 - y\ :sub:`2`
10477
10478 - y\ :sub:`1`
10479
10480 - y\ :sub:`0`
10481
10482 - v\ :sub:`9`
10483
10484 - v\ :sub:`8`
10485
10486 - v\ :sub:`7`
10487
10488 - v\ :sub:`6`
10489
10490 - v\ :sub:`5`
10491
10492 - v\ :sub:`4`
10493
10494 - v\ :sub:`3`
10495
10496 - v\ :sub:`2`
10497
10498 - v\ :sub:`1`
10499
10500 - v\ :sub:`0`
10501
10502 - .. row 99
10503
10504 -
10505 -
10506 -
10507 - -
10508
10509 - -
10510
10511 - -
10512
10513 - -
10514
10515 - -
10516
10517 - -
10518
10519 - -
10520
10521 - -
10522
10523 - -
10524
10525 - -
10526
10527 - -
10528
10529 - -
10530
10531 - y\ :sub:`9`
10532
10533 - y\ :sub:`8`
10534
10535 - y\ :sub:`7`
10536
10537 - y\ :sub:`6`
10538
10539 - y\ :sub:`5`
10540
10541 - y\ :sub:`4`
10542
10543 - y\ :sub:`3`
10544
10545 - y\ :sub:`2`
10546
10547 - y\ :sub:`1`
10548
10549 - y\ :sub:`0`
10550
10551 - u\ :sub:`9`
10552
10553 - u\ :sub:`8`
10554
10555 - u\ :sub:`7`
10556
10557 - u\ :sub:`6`
10558
10559 - u\ :sub:`5`
10560
10561 - u\ :sub:`4`
10562
10563 - u\ :sub:`3`
10564
10565 - u\ :sub:`2`
10566
10567 - u\ :sub:`1`
10568
10569 - u\ :sub:`0`
10570
10571 - .. _MEDIA-BUS-FMT-VUY8-1X24:
10572
10573 - MEDIA_BUS_FMT_VUY8_1X24
10574
10575 - 0x201a
10576
10577 -
10578 - -
10579
10580 - -
10581
10582 - -
10583
10584 - -
10585
10586 - -
10587
10588 - -
10589
10590 - -
10591
10592 - -
10593
10594 - v\ :sub:`7`
10595
10596 - v\ :sub:`6`
10597
10598 - v\ :sub:`5`
10599
10600 - v\ :sub:`4`
10601
10602 - v\ :sub:`3`
10603
10604 - v\ :sub:`2`
10605
10606 - v\ :sub:`1`
10607
10608 - v\ :sub:`0`
10609
10610 - u\ :sub:`7`
10611
10612 - u\ :sub:`6`
10613
10614 - u\ :sub:`5`
10615
10616 - u\ :sub:`4`
10617
10618 - u\ :sub:`3`
10619
10620 - u\ :sub:`2`
10621
10622 - u\ :sub:`1`
10623
10624 - u\ :sub:`0`
10625
10626 - y\ :sub:`7`
10627
10628 - y\ :sub:`6`
10629
10630 - y\ :sub:`5`
10631
10632 - y\ :sub:`4`
10633
10634 - y\ :sub:`3`
10635
10636 - y\ :sub:`2`
10637
10638 - y\ :sub:`1`
10639
10640 - y\ :sub:`0`
10641
10642 - .. _MEDIA-BUS-FMT-YUV8-1X24:
10643
10644 - MEDIA_BUS_FMT_YUV8_1X24
10645
10646 - 0x2025
10647
10648 -
10649 - -
10650
10651 - -
10652
10653 - -
10654
10655 - -
10656
10657 - -
10658
10659 - -
10660
10661 - -
10662
10663 - -
10664
10665 - y\ :sub:`7`
10666
10667 - y\ :sub:`6`
10668
10669 - y\ :sub:`5`
10670
10671 - y\ :sub:`4`
10672
10673 - y\ :sub:`3`
10674
10675 - y\ :sub:`2`
10676
10677 - y\ :sub:`1`
10678
10679 - y\ :sub:`0`
10680
10681 - u\ :sub:`7`
10682
10683 - u\ :sub:`6`
10684
10685 - u\ :sub:`5`
10686
10687 - u\ :sub:`4`
10688
10689 - u\ :sub:`3`
10690
10691 - u\ :sub:`2`
10692
10693 - u\ :sub:`1`
10694
10695 - u\ :sub:`0`
10696
10697 - v\ :sub:`7`
10698
10699 - v\ :sub:`6`
10700
10701 - v\ :sub:`5`
10702
10703 - v\ :sub:`4`
10704
10705 - v\ :sub:`3`
10706
10707 - v\ :sub:`2`
10708
10709 - v\ :sub:`1`
10710
10711 - v\ :sub:`0`
10712
10713 - .. _MEDIA-BUS-FMT-UYVY12-1X24:
10714
10715 - MEDIA_BUS_FMT_UYVY12_1X24
10716
10717 - 0x2020
10718
10719 -
10720 - -
10721
10722 - -
10723
10724 - -
10725
10726 - -
10727
10728 - -
10729
10730 - -
10731
10732 - -
10733
10734 - -
10735
10736 - u\ :sub:`11`
10737
10738 - u\ :sub:`10`
10739
10740 - u\ :sub:`9`
10741
10742 - u\ :sub:`8`
10743
10744 - u\ :sub:`7`
10745
10746 - u\ :sub:`6`
10747
10748 - u\ :sub:`5`
10749
10750 - u\ :sub:`4`
10751
10752 - u\ :sub:`3`
10753
10754 - u\ :sub:`2`
10755
10756 - u\ :sub:`1`
10757
10758 - u\ :sub:`0`
10759
10760 - y\ :sub:`11`
10761
10762 - y\ :sub:`10`
10763
10764 - y\ :sub:`9`
10765
10766 - y\ :sub:`8`
10767
10768 - y\ :sub:`7`
10769
10770 - y\ :sub:`6`
10771
10772 - y\ :sub:`5`
10773
10774 - y\ :sub:`4`
10775
10776 - y\ :sub:`3`
10777
10778 - y\ :sub:`2`
10779
10780 - y\ :sub:`1`
10781
10782 - y\ :sub:`0`
10783
10784 - .. row 103
10785
10786 -
10787 -
10788 -
10789 - -
10790
10791 - -
10792
10793 - -
10794
10795 - -
10796
10797 - -
10798
10799 - -
10800
10801 - -
10802
10803 - -
10804
10805 - v\ :sub:`11`
10806
10807 - v\ :sub:`10`
10808
10809 - v\ :sub:`9`
10810
10811 - v\ :sub:`8`
10812
10813 - v\ :sub:`7`
10814
10815 - v\ :sub:`6`
10816
10817 - v\ :sub:`5`
10818
10819 - v\ :sub:`4`
10820
10821 - v\ :sub:`3`
10822
10823 - v\ :sub:`2`
10824
10825 - v\ :sub:`1`
10826
10827 - v\ :sub:`0`
10828
10829 - y\ :sub:`11`
10830
10831 - y\ :sub:`10`
10832
10833 - y\ :sub:`9`
10834
10835 - y\ :sub:`8`
10836
10837 - y\ :sub:`7`
10838
10839 - y\ :sub:`6`
10840
10841 - y\ :sub:`5`
10842
10843 - y\ :sub:`4`
10844
10845 - y\ :sub:`3`
10846
10847 - y\ :sub:`2`
10848
10849 - y\ :sub:`1`
10850
10851 - y\ :sub:`0`
10852
10853 - .. _MEDIA-BUS-FMT-VYUY12-1X24:
10854
10855 - MEDIA_BUS_FMT_VYUY12_1X24
10856
10857 - 0x2021
10858
10859 -
10860 - -
10861
10862 - -
10863
10864 - -
10865
10866 - -
10867
10868 - -
10869
10870 - -
10871
10872 - -
10873
10874 - -
10875
10876 - v\ :sub:`11`
10877
10878 - v\ :sub:`10`
10879
10880 - v\ :sub:`9`
10881
10882 - v\ :sub:`8`
10883
10884 - v\ :sub:`7`
10885
10886 - v\ :sub:`6`
10887
10888 - v\ :sub:`5`
10889
10890 - v\ :sub:`4`
10891
10892 - v\ :sub:`3`
10893
10894 - v\ :sub:`2`
10895
10896 - v\ :sub:`1`
10897
10898 - v\ :sub:`0`
10899
10900 - y\ :sub:`11`
10901
10902 - y\ :sub:`10`
10903
10904 - y\ :sub:`9`
10905
10906 - y\ :sub:`8`
10907
10908 - y\ :sub:`7`
10909
10910 - y\ :sub:`6`
10911
10912 - y\ :sub:`5`
10913
10914 - y\ :sub:`4`
10915
10916 - y\ :sub:`3`
10917
10918 - y\ :sub:`2`
10919
10920 - y\ :sub:`1`
10921
10922 - y\ :sub:`0`
10923
10924 - .. row 105
10925
10926 -
10927 -
10928 -
10929 - -
10930
10931 - -
10932
10933 - -
10934
10935 - -
10936
10937 - -
10938
10939 - -
10940
10941 - -
10942
10943 - -
10944
10945 - u\ :sub:`11`
10946
10947 - u\ :sub:`10`
10948
10949 - u\ :sub:`9`
10950
10951 - u\ :sub:`8`
10952
10953 - u\ :sub:`7`
10954
10955 - u\ :sub:`6`
10956
10957 - u\ :sub:`5`
10958
10959 - u\ :sub:`4`
10960
10961 - u\ :sub:`3`
10962
10963 - u\ :sub:`2`
10964
10965 - u\ :sub:`1`
10966
10967 - u\ :sub:`0`
10968
10969 - y\ :sub:`11`
10970
10971 - y\ :sub:`10`
10972
10973 - y\ :sub:`9`
10974
10975 - y\ :sub:`8`
10976
10977 - y\ :sub:`7`
10978
10979 - y\ :sub:`6`
10980
10981 - y\ :sub:`5`
10982
10983 - y\ :sub:`4`
10984
10985 - y\ :sub:`3`
10986
10987 - y\ :sub:`2`
10988
10989 - y\ :sub:`1`
10990
10991 - y\ :sub:`0`
10992
10993 - .. _MEDIA-BUS-FMT-YUYV12-1X24:
10994
10995 - MEDIA_BUS_FMT_YUYV12_1X24
10996
10997 - 0x2022
10998
10999 -
11000 - -
11001
11002 - -
11003
11004 - -
11005
11006 - -
11007
11008 - -
11009
11010 - -
11011
11012 - -
11013
11014 - -
11015
11016 - y\ :sub:`11`
11017
11018 - y\ :sub:`10`
11019
11020 - y\ :sub:`9`
11021
11022 - y\ :sub:`8`
11023
11024 - y\ :sub:`7`
11025
11026 - y\ :sub:`6`
11027
11028 - y\ :sub:`5`
11029
11030 - y\ :sub:`4`
11031
11032 - y\ :sub:`3`
11033
11034 - y\ :sub:`2`
11035
11036 - y\ :sub:`1`
11037
11038 - y\ :sub:`0`
11039
11040 - u\ :sub:`11`
11041
11042 - u\ :sub:`10`
11043
11044 - u\ :sub:`9`
11045
11046 - u\ :sub:`8`
11047
11048 - u\ :sub:`7`
11049
11050 - u\ :sub:`6`
11051
11052 - u\ :sub:`5`
11053
11054 - u\ :sub:`4`
11055
11056 - u\ :sub:`3`
11057
11058 - u\ :sub:`2`
11059
11060 - u\ :sub:`1`
11061
11062 - u\ :sub:`0`
11063
11064 - .. row 107
11065
11066 -
11067 -
11068 -
11069 - -
11070
11071 - -
11072
11073 - -
11074
11075 - -
11076
11077 - -
11078
11079 - -
11080
11081 - -
11082
11083 - -
11084
11085 - y\ :sub:`11`
11086
11087 - y\ :sub:`10`
11088
11089 - y\ :sub:`9`
11090
11091 - y\ :sub:`8`
11092
11093 - y\ :sub:`7`
11094
11095 - y\ :sub:`6`
11096
11097 - y\ :sub:`5`
11098
11099 - y\ :sub:`4`
11100
11101 - y\ :sub:`3`
11102
11103 - y\ :sub:`2`
11104
11105 - y\ :sub:`1`
11106
11107 - y\ :sub:`0`
11108
11109 - v\ :sub:`11`
11110
11111 - v\ :sub:`10`
11112
11113 - v\ :sub:`9`
11114
11115 - v\ :sub:`8`
11116
11117 - v\ :sub:`7`
11118
11119 - v\ :sub:`6`
11120
11121 - v\ :sub:`5`
11122
11123 - v\ :sub:`4`
11124
11125 - v\ :sub:`3`
11126
11127 - v\ :sub:`2`
11128
11129 - v\ :sub:`1`
11130
11131 - v\ :sub:`0`
11132
11133 - .. _MEDIA-BUS-FMT-YVYU12-1X24:
11134
11135 - MEDIA_BUS_FMT_YVYU12_1X24
11136
11137 - 0x2023
11138
11139 -
11140 - -
11141
11142 - -
11143
11144 - -
11145
11146 - -
11147
11148 - -
11149
11150 - -
11151
11152 - -
11153
11154 - -
11155
11156 - y\ :sub:`11`
11157
11158 - y\ :sub:`10`
11159
11160 - y\ :sub:`9`
11161
11162 - y\ :sub:`8`
11163
11164 - y\ :sub:`7`
11165
11166 - y\ :sub:`6`
11167
11168 - y\ :sub:`5`
11169
11170 - y\ :sub:`4`
11171
11172 - y\ :sub:`3`
11173
11174 - y\ :sub:`2`
11175
11176 - y\ :sub:`1`
11177
11178 - y\ :sub:`0`
11179
11180 - v\ :sub:`11`
11181
11182 - v\ :sub:`10`
11183
11184 - v\ :sub:`9`
11185
11186 - v\ :sub:`8`
11187
11188 - v\ :sub:`7`
11189
11190 - v\ :sub:`6`
11191
11192 - v\ :sub:`5`
11193
11194 - v\ :sub:`4`
11195
11196 - v\ :sub:`3`
11197
11198 - v\ :sub:`2`
11199
11200 - v\ :sub:`1`
11201
11202 - v\ :sub:`0`
11203
11204 - .. row 109
11205
11206 -
11207 -
11208 -
11209 - -
11210
11211 - -
11212
11213 - -
11214
11215 - -
11216
11217 - -
11218
11219 - -
11220
11221 - -
11222
11223 - -
11224
11225 - y\ :sub:`11`
11226
11227 - y\ :sub:`10`
11228
11229 - y\ :sub:`9`
11230
11231 - y\ :sub:`8`
11232
11233 - y\ :sub:`7`
11234
11235 - y\ :sub:`6`
11236
11237 - y\ :sub:`5`
11238
11239 - y\ :sub:`4`
11240
11241 - y\ :sub:`3`
11242
11243 - y\ :sub:`2`
11244
11245 - y\ :sub:`1`
11246
11247 - y\ :sub:`0`
11248
11249 - u\ :sub:`11`
11250
11251 - u\ :sub:`10`
11252
11253 - u\ :sub:`9`
11254
11255 - u\ :sub:`8`
11256
11257 - u\ :sub:`7`
11258
11259 - u\ :sub:`6`
11260
11261 - u\ :sub:`5`
11262
11263 - u\ :sub:`4`
11264
11265 - u\ :sub:`3`
11266
11267 - u\ :sub:`2`
11268
11269 - u\ :sub:`1`
11270
11271 - u\ :sub:`0`
11272
11273 - .. _MEDIA-BUS-FMT-YUV10-1X30:
11274
11275 - MEDIA_BUS_FMT_YUV10_1X30
11276
11277 - 0x2016
11278
11279 -
11280 - -
11281
11282 - -
11283
11284 - y\ :sub:`9`
11285
11286 - y\ :sub:`8`
11287
11288 - y\ :sub:`7`
11289
11290 - y\ :sub:`6`
11291
11292 - y\ :sub:`5`
11293
11294 - y\ :sub:`4`
11295
11296 - y\ :sub:`3`
11297
11298 - y\ :sub:`2`
11299
11300 - y\ :sub:`1`
11301
11302 - y\ :sub:`0`
11303
11304 - u\ :sub:`9`
11305
11306 - u\ :sub:`8`
11307
11308 - u\ :sub:`7`
11309
11310 - u\ :sub:`6`
11311
11312 - u\ :sub:`5`
11313
11314 - u\ :sub:`4`
11315
11316 - u\ :sub:`3`
11317
11318 - u\ :sub:`2`
11319
11320 - u\ :sub:`1`
11321
11322 - u\ :sub:`0`
11323
11324 - v\ :sub:`9`
11325
11326 - v\ :sub:`8`
11327
11328 - v\ :sub:`7`
11329
11330 - v\ :sub:`6`
11331
11332 - v\ :sub:`5`
11333
11334 - v\ :sub:`4`
11335
11336 - v\ :sub:`3`
11337
11338 - v\ :sub:`2`
11339
11340 - v\ :sub:`1`
11341
11342 - v\ :sub:`0`
11343
11344 - .. _MEDIA-BUS-FMT-AYUV8-1X32:
11345
11346 - MEDIA_BUS_FMT_AYUV8_1X32
11347
11348 - 0x2017
11349
11350 -
11351 - a\ :sub:`7`
11352
11353 - a\ :sub:`6`
11354
11355 - a\ :sub:`5`
11356
11357 - a\ :sub:`4`
11358
11359 - a\ :sub:`3`
11360
11361 - a\ :sub:`2`
11362
11363 - a\ :sub:`1`
11364
11365 - a\ :sub:`0`
11366
11367 - y\ :sub:`7`
11368
11369 - y\ :sub:`6`
11370
11371 - y\ :sub:`5`
11372
11373 - y\ :sub:`4`
11374
11375 - y\ :sub:`3`
11376
11377 - y\ :sub:`2`
11378
11379 - y\ :sub:`1`
11380
11381 - y\ :sub:`0`
11382
11383 - u\ :sub:`7`
11384
11385 - u\ :sub:`6`
11386
11387 - u\ :sub:`5`
11388
11389 - u\ :sub:`4`
11390
11391 - u\ :sub:`3`
11392
11393 - u\ :sub:`2`
11394
11395 - u\ :sub:`1`
11396
11397 - u\ :sub:`0`
11398
11399 - v\ :sub:`7`
11400
11401 - v\ :sub:`6`
11402
11403 - v\ :sub:`5`
11404
11405 - v\ :sub:`4`
11406
11407 - v\ :sub:`3`
11408
11409 - v\ :sub:`2`
11410
11411 - v\ :sub:`1`
11412
11413 - v\ :sub:`0`
11414
11415
11416
11417HSV/HSL Formats
11418^^^^^^^^^^^^^^^
11419
11420Those formats transfer pixel data as RGB values in a
11421cylindrical-coordinate system using Hue-Saturation-Value or
11422Hue-Saturation-Lightness components. The format code is made of the
11423following information.
11424
11425- The hue, saturation, value or lightness and optional alpha components
11426 order code, as encoded in a pixel sample. The only currently
11427 supported value is AHSV.
11428
11429- The number of bits per component, for each component. The values can
11430 be different for all components. The only currently supported value
11431 is 8888.
11432
11433- The number of bus samples per pixel. Pixels that are wider than the
11434 bus width must be transferred in multiple samples. The only currently
11435 supported value is 1.
11436
11437- The bus width.
11438
11439- For formats where the total number of bits per pixel is smaller than
11440 the number of bus samples per pixel times the bus width, a padding
11441 value stating if the bytes are padded in their most high order bits
11442 (PADHI) or low order bits (PADLO).
11443
11444- For formats where the number of bus samples per pixel is larger than
11445 1, an endianness value stating if the pixel is transferred MSB first
11446 (BE) or LSB first (LE).
11447
11448The following table lists existing HSV/HSL formats.
11449
11450
11451.. _v4l2-mbus-pixelcode-hsv:
11452
11453.. flat-table:: HSV/HSL formats
11454 :header-rows: 2
11455 :stub-columns: 0
11456
11457
11458 - .. row 1
11459
11460 - Identifier
11461
11462 - Code
11463
11464 -
11465 - :cspan:`31` Data organization
11466
11467 - .. row 2
11468
11469 -
11470 -
11471 - Bit
11472
11473 - 31
11474
11475 - 30
11476
11477 - 29
11478
11479 - 28
11480
11481 - 27
11482
11483 - 26
11484
11485 - 25
11486
11487 - 24
11488
11489 - 23
11490
11491 - 22
11492
11493 - 21
11494
11495 - 20
11496
11497 - 19
11498
11499 - 18
11500
11501 - 17
11502
11503 - 16
11504
11505 - 15
11506
11507 - 14
11508
11509 - 13
11510
11511 - 12
11512
11513 - 11
11514
11515 - 10
11516
11517 - 9
11518
11519 - 8
11520
11521 - 7
11522
11523 - 6
11524
11525 - 5
11526
11527 - 4
11528
11529 - 3
11530
11531 - 2
11532
11533 - 1
11534
11535 - 0
11536
11537 - .. _MEDIA-BUS-FMT-AHSV8888-1X32:
11538
11539 - MEDIA_BUS_FMT_AHSV8888_1X32
11540
11541 - 0x6001
11542
11543 -
11544 - a\ :sub:`7`
11545
11546 - a\ :sub:`6`
11547
11548 - a\ :sub:`5`
11549
11550 - a\ :sub:`4`
11551
11552 - a\ :sub:`3`
11553
11554 - a\ :sub:`2`
11555
11556 - a\ :sub:`1`
11557
11558 - a\ :sub:`0`
11559
11560 - h\ :sub:`7`
11561
11562 - h\ :sub:`6`
11563
11564 - h\ :sub:`5`
11565
11566 - h\ :sub:`4`
11567
11568 - h\ :sub:`3`
11569
11570 - h\ :sub:`2`
11571
11572 - h\ :sub:`1`
11573
11574 - h\ :sub:`0`
11575
11576 - s\ :sub:`7`
11577
11578 - s\ :sub:`6`
11579
11580 - s\ :sub:`5`
11581
11582 - s\ :sub:`4`
11583
11584 - s\ :sub:`3`
11585
11586 - s\ :sub:`2`
11587
11588 - s\ :sub:`1`
11589
11590 - s\ :sub:`0`
11591
11592 - v\ :sub:`7`
11593
11594 - v\ :sub:`6`
11595
11596 - v\ :sub:`5`
11597
11598 - v\ :sub:`4`
11599
11600 - v\ :sub:`3`
11601
11602 - v\ :sub:`2`
11603
11604 - v\ :sub:`1`
11605
11606 - v\ :sub:`0`
11607
11608
11609
11610JPEG Compressed Formats
11611^^^^^^^^^^^^^^^^^^^^^^^
11612
11613Those data formats consist of an ordered sequence of 8-bit bytes
11614obtained from JPEG compression process. Additionally to the ``_JPEG``
11615postfix the format code is made of the following information.
11616
11617- The number of bus samples per entropy encoded byte.
11618
11619- The bus width.
11620
11621For instance, for a JPEG baseline process and an 8-bit bus width the
11622format will be named ``MEDIA_BUS_FMT_JPEG_1X8``.
11623
11624The following table lists existing JPEG compressed formats.
11625
11626
11627.. _v4l2-mbus-pixelcode-jpeg:
11628
11629.. flat-table:: JPEG Formats
11630 :header-rows: 1
11631 :stub-columns: 0
11632
11633
11634 - .. row 1
11635
11636 - Identifier
11637
11638 - Code
11639
11640 - Remarks
11641
11642 - .. _MEDIA-BUS-FMT-JPEG-1X8:
11643
11644 - MEDIA_BUS_FMT_JPEG_1X8
11645
11646 - 0x4001
11647
11648 - Besides of its usage for the parallel bus this format is
11649 recommended for transmission of JPEG data over MIPI CSI bus using
11650 the User Defined 8-bit Data types.
11651
11652
11653
11654.. _v4l2-mbus-vendor-spec-fmts:
11655
11656Vendor and Device Specific Formats
11657^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11658
11659This section lists complex data formats that are either vendor or device
11660specific.
11661
11662The following table lists the existing vendor and device specific
11663formats.
11664
11665
11666.. _v4l2-mbus-pixelcode-vendor-specific:
11667
11668.. flat-table:: Vendor and device specific formats
11669 :header-rows: 1
11670 :stub-columns: 0
11671
11672
11673 - .. row 1
11674
11675 - Identifier
11676
11677 - Code
11678
11679 - Comments
11680
11681 - .. _MEDIA-BUS-FMT-S5C-UYVY-JPEG-1X8:
11682
11683 - MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8
11684
11685 - 0x5001
11686
11687 - Interleaved raw UYVY and JPEG image format with embedded meta-data
11688 used by Samsung S3C73MX camera sensors.
diff --git a/Documentation/media/uapi/v4l/subdev-formats_files/bayer.png b/Documentation/media/uapi/v4l/subdev-formats_files/bayer.png
new file mode 100644
index 000000000000..9b15fb22e817
--- /dev/null
+++ b/Documentation/media/uapi/v4l/subdev-formats_files/bayer.png
Binary files differ
diff --git a/Documentation/media/uapi/v4l/tuner.rst b/Documentation/media/uapi/v4l/tuner.rst
new file mode 100644
index 000000000000..37eb4b9b95fb
--- /dev/null
+++ b/Documentation/media/uapi/v4l/tuner.rst
@@ -0,0 +1,83 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _tuner:
4
5*********************
6Tuners and Modulators
7*********************
8
9
10Tuners
11======
12
13Video input devices can have one or more tuners demodulating a RF
14signal. Each tuner is associated with one or more video inputs,
15depending on the number of RF connectors on the tuner. The ``type``
16field of the respective struct :ref:`v4l2_input <v4l2-input>`
17returned by the :ref:`VIDIOC_ENUMINPUT` ioctl is
18set to ``V4L2_INPUT_TYPE_TUNER`` and its ``tuner`` field contains the
19index number of the tuner.
20
21Radio input devices have exactly one tuner with index zero, no video
22inputs.
23
24To query and change tuner properties applications use the
25:ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
26:ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
27struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
28also contains signal status information applicable when the tuner of the
29current video or radio input is queried.
30
31.. note:: :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
32 current tuner, when there is more than one at all. The tuner is solely
33 determined by the current video input. Drivers must support both ioctls
34 and set the ``V4L2_CAP_TUNER`` flag in the struct :ref:`v4l2_capability
35 <v4l2-capability>` returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
36 device has one or more tuners.
37
38
39Modulators
40==========
41
42Video output devices can have one or more modulators, uh, modulating a
43video signal for radiation or connection to the antenna input of a TV
44set or video recorder. Each modulator is associated with one or more
45video outputs, depending on the number of RF connectors on the
46modulator. The ``type`` field of the respective struct
47:ref:`v4l2_output <v4l2-output>` returned by the
48:ref:`VIDIOC_ENUMOUTPUT` ioctl is set to
49``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the
50index number of the modulator.
51
52Radio output devices have exactly one modulator with index zero, no
53video outputs.
54
55A video or radio device cannot support both a tuner and a modulator. Two
56separate device nodes will have to be used for such hardware, one that
57supports the tuner functionality and one that supports the modulator
58functionality. The reason is a limitation with the
59:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you
60cannot specify whether the frequency is for a tuner or a modulator.
61
62To query and change modulator properties applications use the
63:ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and
64:ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that
65:ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` does not switch the current modulator, when there
66is more than one at all. The modulator is solely determined by the
67current video output. Drivers must support both ioctls and set the
68``V4L2_CAP_MODULATOR`` flag in the struct
69:ref:`v4l2_capability <v4l2-capability>` returned by the
70:ref:`VIDIOC_QUERYCAP` ioctl when the device has
71one or more modulators.
72
73
74Radio Frequency
75===============
76
77To get and set the tuner or modulator radio frequency applications use
78the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
79:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
80a pointer to a struct :ref:`v4l2_frequency <v4l2-frequency>`. These
81ioctls are used for TV and radio devices alike. Drivers must support
82both ioctls when the tuner or modulator ioctls are supported, or when
83the device is a radio device.
diff --git a/Documentation/media/uapi/v4l/user-func.rst b/Documentation/media/uapi/v4l/user-func.rst
new file mode 100644
index 000000000000..3e0413b83a33
--- /dev/null
+++ b/Documentation/media/uapi/v4l/user-func.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _user-func:
4
5******************
6Function Reference
7******************
8
9
10.. toctree::
11 :maxdepth: 1
12
13 func-close
14 func-ioctl
15 vidioc-create-bufs
16 vidioc-cropcap
17 vidioc-dbg-g-chip-info
18 vidioc-dbg-g-register
19 vidioc-decoder-cmd
20 vidioc-dqevent
21 vidioc-dv-timings-cap
22 vidioc-encoder-cmd
23 vidioc-enumaudio
24 vidioc-enumaudioout
25 vidioc-enum-dv-timings
26 vidioc-enum-fmt
27 vidioc-enum-framesizes
28 vidioc-enum-frameintervals
29 vidioc-enum-freq-bands
30 vidioc-enuminput
31 vidioc-enumoutput
32 vidioc-enumstd
33 vidioc-expbuf
34 vidioc-g-audio
35 vidioc-g-audioout
36 vidioc-g-crop
37 vidioc-g-ctrl
38 vidioc-g-dv-timings
39 vidioc-g-edid
40 vidioc-g-enc-index
41 vidioc-g-ext-ctrls
42 vidioc-g-fbuf
43 vidioc-g-fmt
44 vidioc-g-frequency
45 vidioc-g-input
46 vidioc-g-jpegcomp
47 vidioc-g-modulator
48 vidioc-g-output
49 vidioc-g-parm
50 vidioc-g-priority
51 vidioc-g-selection
52 vidioc-g-sliced-vbi-cap
53 vidioc-g-std
54 vidioc-g-tuner
55 vidioc-log-status
56 vidioc-overlay
57 vidioc-prepare-buf
58 vidioc-qbuf
59 vidioc-querybuf
60 vidioc-querycap
61 vidioc-queryctrl
62 vidioc-query-dv-timings
63 vidioc-querystd
64 vidioc-reqbufs
65 vidioc-s-hw-freq-seek
66 vidioc-streamon
67 vidioc-subdev-enum-frame-interval
68 vidioc-subdev-enum-frame-size
69 vidioc-subdev-enum-mbus-code
70 vidioc-subdev-g-crop
71 vidioc-subdev-g-fmt
72 vidioc-subdev-g-frame-interval
73 vidioc-subdev-g-selection
74 vidioc-subscribe-event
75 func-mmap
76 func-munmap
77 func-open
78 func-poll
79 func-read
80 func-select
81 func-write
diff --git a/Documentation/media/uapi/v4l/userp.rst b/Documentation/media/uapi/v4l/userp.rst
new file mode 100644
index 000000000000..1d8b14bd4cdc
--- /dev/null
+++ b/Documentation/media/uapi/v4l/userp.rst
@@ -0,0 +1,119 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _userp:
4
5*****************************
6Streaming I/O (User Pointers)
7*****************************
8
9Input and output devices support this I/O method when the
10``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
11:ref:`v4l2_capability <v4l2-capability>` returned by the
12:ref:`VIDIOC_QUERYCAP` ioctl is set. If the
13particular user pointer method (not only memory mapping) is supported
14must be determined by calling the :ref:`VIDIOC_REQBUFS` ioctl
15with the memory type set to ``V4L2_MEMORY_USERPTR``.
16
17This I/O method combines advantages of the read/write and memory mapping
18methods. Buffers (planes) are allocated by the application itself, and
19can reside for example in virtual or shared memory. Only pointers to
20data are exchanged, these pointers and meta-information are passed in
21struct :ref:`v4l2_buffer <v4l2-buffer>` (or in struct
22:ref:`v4l2_plane <v4l2-plane>` in the multi-planar API case). The
23driver must be switched into user pointer I/O mode by calling the
24:ref:`VIDIOC_REQBUFS` with the desired buffer type.
25No buffers (planes) are allocated beforehand, consequently they are not
26indexed and cannot be queried like mapped buffers with the
27:ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>` ioctl.
28
29Example: Initiating streaming I/O with user pointers
30====================================================
31
32.. code-block:: c
33
34 struct v4l2_requestbuffers reqbuf;
35
36 memset (&reqbuf, 0, sizeof (reqbuf));
37 reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
38 reqbuf.memory = V4L2_MEMORY_USERPTR;
39
40 if (ioctl (fd, VIDIOC_REQBUFS, &reqbuf) == -1) {
41 if (errno == EINVAL)
42 printf ("Video capturing or user pointer streaming is not supported\\n");
43 else
44 perror ("VIDIOC_REQBUFS");
45
46 exit (EXIT_FAILURE);
47 }
48
49Buffer (plane) addresses and sizes are passed on the fly with the
50:ref:`VIDIOC_QBUF <VIDIOC_QBUF>` ioctl. Although buffers are commonly
51cycled, applications can pass different addresses and sizes at each
52:ref:`VIDIOC_QBUF <VIDIOC_QBUF>` call. If required by the hardware the
53driver swaps memory pages within physical memory to create a continuous
54area of memory. This happens transparently to the application in the
55virtual memory subsystem of the kernel. When buffer pages have been
56swapped out to disk they are brought back and finally locked in physical
57memory for DMA. [#f1]_
58
59Filled or displayed buffers are dequeued with the
60:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. The driver can unlock the
61memory pages at any time between the completion of the DMA and this
62ioctl. The memory is also unlocked when
63:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` is called,
64:ref:`VIDIOC_REQBUFS`, or when the device is closed.
65Applications must take care not to free buffers without dequeuing. For
66once, the buffers remain locked until further, wasting physical memory.
67Second the driver will not be notified when the memory is returned to
68the application's free list and subsequently reused for other purposes,
69possibly completing the requested DMA and overwriting valuable data.
70
71For capturing applications it is customary to enqueue a number of empty
72buffers, to start capturing and enter the read loop. Here the
73application waits until a filled buffer can be dequeued, and re-enqueues
74the buffer when the data is no longer needed. Output applications fill
75and enqueue buffers, when enough buffers are stacked up output is
76started. In the write loop, when the application runs out of free
77buffers it must wait until an empty buffer can be dequeued and reused.
78Two methods exist to suspend execution of the application until one or
79more buffers can be dequeued. By default :ref:`VIDIOC_DQBUF
80<VIDIOC_QBUF>` blocks when no buffer is in the outgoing queue. When the
81``O_NONBLOCK`` flag was given to the :ref:`open() <func-open>` function,
82:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` returns immediately with an ``EAGAIN``
83error code when no buffer is available. The :ref:`select()
84<func-select>` or :ref:`poll() <func-poll>` function are always
85available.
86
87To start and stop capturing or output applications call the
88:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and
89:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctl.
90
91.. note:: ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
92 both queues and unlocks all buffers as a side effect. Since there is no
93 notion of doing anything "now" on a multitasking system, if an
94 application needs to synchronize with another event it should examine
95 the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
96 outputted buffers.
97
98Drivers implementing user pointer I/O must support the
99:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`,
100:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
101and :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls, the
102:ref:`select() <func-select>` and :ref:`poll() <func-poll>` function. [#f2]_
103
104.. [#f1]
105 We expect that frequently used buffers are typically not swapped out.
106 Anyway, the process of swapping, locking or generating scatter-gather
107 lists may be time consuming. The delay can be masked by the depth of
108 the incoming buffer queue, and perhaps by maintaining caches assuming
109 a buffer will be soon enqueued again. On the other hand, to optimize
110 memory usage drivers can limit the number of buffers locked in
111 advance and recycle the most recently used buffers first. Of course,
112 the pages of empty buffers in the incoming queue need not be saved to
113 disk. Output buffers must be saved on the incoming and outgoing queue
114 because an application may share them with other processes.
115
116.. [#f2]
117 At the driver level :ref:`select() <func-select>` and :ref:`poll() <func-poll>` are
118 the same, and :ref:`select() <func-select>` is too important to be optional.
119 The rest should be evident.
diff --git a/Documentation/media/uapi/v4l/v4l2-selection-flags.rst b/Documentation/media/uapi/v4l/v4l2-selection-flags.rst
new file mode 100644
index 000000000000..3ce3731faf5f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/v4l2-selection-flags.rst
@@ -0,0 +1,71 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-selection-flags:
4
5***************
6Selection flags
7***************
8
9
10.. _v4l2-selection-flags-table:
11
12.. flat-table:: Selection flag definitions
13 :header-rows: 1
14 :stub-columns: 0
15
16
17 - .. row 1
18
19 - Flag name
20
21 - id
22
23 - Definition
24
25 - Valid for V4L2
26
27 - Valid for V4L2 subdev
28
29 - .. row 2
30
31 - ``V4L2_SEL_FLAG_GE``
32
33 - (1 << 0)
34
35 - Suggest the driver it should choose greater or equal rectangle (in
36 size) than was requested. Albeit the driver may choose a lesser
37 size, it will only do so due to hardware limitations. Without this
38 flag (and ``V4L2_SEL_FLAG_LE``) the behaviour is to choose the
39 closest possible rectangle.
40
41 - Yes
42
43 - Yes
44
45 - .. row 3
46
47 - ``V4L2_SEL_FLAG_LE``
48
49 - (1 << 1)
50
51 - Suggest the driver it should choose lesser or equal rectangle (in
52 size) than was requested. Albeit the driver may choose a greater
53 size, it will only do so due to hardware limitations.
54
55 - Yes
56
57 - Yes
58
59 - .. row 4
60
61 - ``V4L2_SEL_FLAG_KEEP_CONFIG``
62
63 - (1 << 2)
64
65 - The configuration must not be propagated to any further processing
66 steps. If this flag is not given, the configuration is propagated
67 inside the subdevice to all further processing steps.
68
69 - No
70
71 - Yes
diff --git a/Documentation/media/uapi/v4l/v4l2-selection-targets.rst b/Documentation/media/uapi/v4l/v4l2-selection-targets.rst
new file mode 100644
index 000000000000..7519099a50cd
--- /dev/null
+++ b/Documentation/media/uapi/v4l/v4l2-selection-targets.rst
@@ -0,0 +1,135 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-selection-targets:
4
5*****************
6Selection targets
7*****************
8
9The precise meaning of the selection targets may be dependent on which
10of the two interfaces they are used.
11
12
13.. _v4l2-selection-targets-table:
14
15.. flat-table:: Selection target definitions
16 :header-rows: 1
17 :stub-columns: 0
18
19
20 - .. row 1
21
22 - Target name
23
24 - id
25
26 - Definition
27
28 - Valid for V4L2
29
30 - Valid for V4L2 subdev
31
32 - .. row 2
33
34 - ``V4L2_SEL_TGT_CROP``
35
36 - 0x0000
37
38 - Crop rectangle. Defines the cropped area.
39
40 - Yes
41
42 - Yes
43
44 - .. row 3
45
46 - ``V4L2_SEL_TGT_CROP_DEFAULT``
47
48 - 0x0001
49
50 - Suggested cropping rectangle that covers the "whole picture".
51
52 - Yes
53
54 - No
55
56 - .. row 4
57
58 - ``V4L2_SEL_TGT_CROP_BOUNDS``
59
60 - 0x0002
61
62 - Bounds of the crop rectangle. All valid crop rectangles fit inside
63 the crop bounds rectangle.
64
65 - Yes
66
67 - Yes
68
69 - .. row 5
70
71 - ``V4L2_SEL_TGT_NATIVE_SIZE``
72
73 - 0x0003
74
75 - The native size of the device, e.g. a sensor's pixel array.
76 ``left`` and ``top`` fields are zero for this target. Setting the
77 native size will generally only make sense for memory to memory
78 devices where the software can create a canvas of a given size in
79 which for example a video frame can be composed. In that case
80 V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size of
81 that canvas.
82
83 - Yes
84
85 - Yes
86
87 - .. row 6
88
89 - ``V4L2_SEL_TGT_COMPOSE``
90
91 - 0x0100
92
93 - Compose rectangle. Used to configure scaling and composition.
94
95 - Yes
96
97 - Yes
98
99 - .. row 7
100
101 - ``V4L2_SEL_TGT_COMPOSE_DEFAULT``
102
103 - 0x0101
104
105 - Suggested composition rectangle that covers the "whole picture".
106
107 - Yes
108
109 - No
110
111 - .. row 8
112
113 - ``V4L2_SEL_TGT_COMPOSE_BOUNDS``
114
115 - 0x0102
116
117 - Bounds of the compose rectangle. All valid compose rectangles fit
118 inside the compose bounds rectangle.
119
120 - Yes
121
122 - Yes
123
124 - .. row 9
125
126 - ``V4L2_SEL_TGT_COMPOSE_PADDED``
127
128 - 0x0103
129
130 - The active area and all padding pixels that are inserted or
131 modified by hardware.
132
133 - Yes
134
135 - No
diff --git a/Documentation/media/uapi/v4l/v4l2.rst b/Documentation/media/uapi/v4l/v4l2.rst
new file mode 100644
index 000000000000..5e41a8505301
--- /dev/null
+++ b/Documentation/media/uapi/v4l/v4l2.rst
@@ -0,0 +1,398 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4.. _v4l2spec:
5
6############################
7Part I - Video for Linux API
8############################
9
10This part describes the Video for Linux API version 2 (V4L2 API) specification.
11
12**Revision 4.5**
13
14.. class:: toc-title
15
16 Table of Contents
17
18.. toctree::
19 :numbered:
20 :maxdepth: 5
21
22 common
23 pixfmt
24 io
25 devices
26 driver
27 libv4l
28 compat
29 user-func
30 common-defs
31 videodev
32 capture-example
33 v4l2grab-example
34 biblio
35
36
37**********************
38Revision and Copyright
39**********************
40
41Authors, in alphabetical order:
42
43- Ailus, Sakari <sakari.ailus@iki.fi>
44
45 - Subdev selections API.
46
47- Carvalho Chehab, Mauro <m.chehab@kernel.org>
48
49 - Documented libv4l, designed and added v4l2grab example, Remote Controller chapter.
50
51- Dirks, Bill
52
53 - Original author of the V4L2 API and documentation.
54
55- H Schimek, Michael <mschimek@gmx.at>
56
57 - Original author of the V4L2 API and documentation.
58
59- Karicheri, Muralidharan <m-karicheri2@ti.com>
60
61 - Documented the Digital Video timings API.
62
63- Osciak, Pawel <pawel@osciak.com>
64
65 - Designed and documented the multi-planar API.
66
67- Palosaari, Antti <crope@iki.fi>
68
69 - SDR API.
70
71- Rubli, Martin
72
73 - Designed and documented the VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls.
74
75- Walls, Andy <awalls@md.metrocast.net>
76
77 - Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV MPEG stream embedded, sliced VBI data format in this specification.
78
79- Verkuil, Hans <hverkuil@xs4all.nl>
80
81 - Designed and documented the VIDIOC_LOG_STATUS ioctl, the extended control ioctls, major parts of the sliced VBI API, the MPEG encoder and decoder APIs and the DV Timings API.
82
83**Copyright** |copy| 1999-2016: Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, Pawel Osciak, Sakari Ailus & Antti Palosaari.
84
85Except when explicitly stated as GPL, programming examples within this
86part can be used and distributed without restrictions.
87
88****************
89Revision History
90****************
91
92:revision: 4.5 / 2015-10-29 (*rr*)
93
94Extend VIDIOC_G_EXT_CTRLS;. Replace ctrl_class with a new union with
95ctrl_class and which. Which is used to select the current value of the
96control or the default value.
97
98
99:revision: 4.4 / 2015-05-26 (*ap*)
100
101Renamed V4L2_TUNER_ADC to V4L2_TUNER_SDR. Added
102V4L2_CID_RF_TUNER_RF_GAIN control. Added transmitter support for
103Software Defined Radio (SDR) Interface.
104
105
106:revision: 4.1 / 2015-02-13 (*mcc*)
107
108Fix documentation for media controller device nodes and add support for
109DVB device nodes. Add support for Tuner sub-device.
110
111
112:revision: 3.19 / 2014-12-05 (*hv*)
113
114Rewrote Colorspace chapter, added new enum
115:ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>` and enum
116:ref:`v4l2_quantization <v4l2-quantization>` fields to struct
117:ref:`v4l2_pix_format <v4l2-pix-format>`, struct
118:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` and struct
119:ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`.
120
121
122:revision: 3.17 / 2014-08-04 (*lp, hv*)
123
124Extended struct :ref:`v4l2_pix_format <v4l2-pix-format>`. Added
125format flags. Added compound control types and VIDIOC_QUERY_EXT_CTRL.
126
127
128:revision: 3.15 / 2014-02-03 (*hv, ap*)
129
130Update several sections of "Common API Elements": "Opening and Closing
131Devices" "Querying Capabilities", "Application Priority", "Video Inputs
132and Outputs", "Audio Inputs and Outputs" "Tuners and Modulators", "Video
133Standards" and "Digital Video (DV) Timings". Added SDR API.
134
135
136:revision: 3.14 / 2013-11-25 (*rr*)
137
138Set width and height as unsigned on v4l2_rect.
139
140
141:revision: 3.11 / 2013-05-26 (*hv*)
142
143Remove obsolete VIDIOC_DBG_G_CHIP_IDENT ioctl.
144
145
146:revision: 3.10 / 2013-03-25 (*hv*)
147
148Remove obsolete and unused DV_PRESET ioctls: VIDIOC_G_DV_PRESET,
149VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and
150VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output
151capability flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS.
152Added VIDIOC_DBG_G_CHIP_INFO.
153
154
155:revision: 3.9 / 2012-12-03 (*sa, sn*)
156
157Added timestamp types to v4l2_buffer. Added
158V4L2_EVENT_CTRL_CH_RANGE control event changes flag.
159
160
161:revision: 3.6 / 2012-07-02 (*hv*)
162
163Added VIDIOC_ENUM_FREQ_BANDS.
164
165
166:revision: 3.5 / 2012-05-07 (*sa, sn, hv*)
167
168Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev selections API.
169Improved the description of V4L2_CID_COLORFX control, added
170V4L2_CID_COLORFX_CBCR control. Added camera controls
171V4L2_CID_AUTO_EXPOSURE_BIAS,
172V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE,
173V4L2_CID_IMAGE_STABILIZATION, V4L2_CID_ISO_SENSITIVITY,
174V4L2_CID_ISO_SENSITIVITY_AUTO, V4L2_CID_EXPOSURE_METERING,
175V4L2_CID_SCENE_MODE, V4L2_CID_3A_LOCK,
176V4L2_CID_AUTO_FOCUS_START, V4L2_CID_AUTO_FOCUS_STOP,
177V4L2_CID_AUTO_FOCUS_STATUS and V4L2_CID_AUTO_FOCUS_RANGE. Added
178VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and
179VIDIOC_DV_TIMINGS_CAP.
180
181
182:revision: 3.4 / 2012-01-25 (*sn*)
183
184Added :ref:`JPEG compression control class. <jpeg-controls>`
185
186
187:revision: 3.3 / 2012-01-11 (*hv*)
188
189Added device_caps field to struct v4l2_capabilities.
190
191
192:revision: 3.2 / 2011-08-26 (*hv*)
193
194Added V4L2_CTRL_FLAG_VOLATILE.
195
196
197:revision: 3.1 / 2011-06-27 (*mcc, po, hv*)
198
199Documented that VIDIOC_QUERYCAP now returns a per-subsystem version
200instead of a per-driver one. Standardize an error code for invalid
201ioctl. Added V4L2_CTRL_TYPE_BITMASK.
202
203
204:revision: 2.6.39 / 2011-03-01 (*mcc, po*)
205
206Removed VIDIOC_*_OLD from videodev2.h header and update it to reflect
207latest changes. Added the :ref:`multi-planar API <planar-apis>`.
208
209
210:revision: 2.6.37 / 2010-08-06 (*hv*)
211
212Removed obsolete vtx (videotext) API.
213
214
215:revision: 2.6.33 / 2009-12-03 (*mk*)
216
217Added documentation for the Digital Video timings API.
218
219
220:revision: 2.6.32 / 2009-08-31 (*mcc*)
221
222Now, revisions will match the kernel version where the V4L2 API changes
223will be used by the Linux Kernel. Also added Remote Controller chapter.
224
225
226:revision: 0.29 / 2009-08-26 (*ev*)
227
228Added documentation for string controls and for FM Transmitter controls.
229
230
231:revision: 0.28 / 2009-08-26 (*gl*)
232
233Added V4L2_CID_BAND_STOP_FILTER documentation.
234
235
236:revision: 0.27 / 2009-08-15 (*mcc*)
237
238Added libv4l and Remote Controller documentation; added v4l2grab and
239keytable application examples.
240
241
242:revision: 0.26 / 2009-07-23 (*hv*)
243
244Finalized the RDS capture API. Added modulator and RDS encoder
245capabilities. Added support for string controls.
246
247
248:revision: 0.25 / 2009-01-18 (*hv*)
249
250Added pixel formats VYUY, NV16 and NV61, and changed the debug ioctls
251VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT. Added camera
252controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
253V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.
254
255
256:revision: 0.24 / 2008-03-04 (*mhs*)
257
258Added pixel formats Y16 and SBGGR16, new controls and a camera controls
259class. Removed VIDIOC_G/S_MPEGCOMP.
260
261
262:revision: 0.23 / 2007-08-30 (*mhs*)
263
264Fixed a typo in VIDIOC_DBG_G/S_REGISTER. Clarified the byte order of
265packed pixel formats.
266
267
268:revision: 0.22 / 2007-08-29 (*mhs*)
269
270Added the Video Output Overlay interface, new MPEG controls,
271V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
272VIDIOC_DBG_G/S_REGISTER, VIDIOC\_(TRY\_)ENCODER_CMD,
273VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
274Clarifications in the cropping chapter, about RGB pixel formats, the
275mmap(), poll(), select(), read() and write() functions. Typographical
276fixes.
277
278
279:revision: 0.21 / 2006-12-19 (*mhs*)
280
281Fixed a link in the VIDIOC_G_EXT_CTRLS section.
282
283
284:revision: 0.20 / 2006-11-24 (*mhs*)
285
286Clarified the purpose of the audioset field in struct v4l2_input and
287v4l2_output.
288
289
290:revision: 0.19 / 2006-10-19 (*mhs*)
291
292Documented V4L2_PIX_FMT_RGB444.
293
294
295:revision: 0.18 / 2006-10-18 (*mhs*)
296
297Added the description of extended controls by Hans Verkuil. Linked
298V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.
299
300
301:revision: 0.17 / 2006-10-12 (*mhs*)
302
303Corrected V4L2_PIX_FMT_HM12 description.
304
305
306:revision: 0.16 / 2006-10-08 (*mhs*)
307
308VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS are now part
309of the API.
310
311
312:revision: 0.15 / 2006-09-23 (*mhs*)
313
314Cleaned up the bibliography, added BT.653 and BT.1119.
315capture.c/start_capturing() for user pointer I/O did not initialize the
316buffer index. Documented the V4L MPEG and MJPEG VID_TYPEs and
317V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel formats. See
318the history chapter for API changes.
319
320
321:revision: 0.14 / 2006-09-14 (*mr*)
322
323Added VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS proposal
324for frame format enumeration of digital devices.
325
326
327:revision: 0.13 / 2006-04-07 (*mhs*)
328
329Corrected the description of struct v4l2_window clips. New V4L2_STD\_
330and V4L2_TUNER_MODE_LANG1_LANG2 defines.
331
332
333:revision: 0.12 / 2006-02-03 (*mhs*)
334
335Corrected the description of struct v4l2_captureparm and
336v4l2_outputparm.
337
338
339:revision: 0.11 / 2006-01-27 (*mhs*)
340
341Improved the description of struct v4l2_tuner.
342
343
344:revision: 0.10 / 2006-01-10 (*mhs*)
345
346VIDIOC_G_INPUT and VIDIOC_S_PARM clarifications.
347
348
349:revision: 0.9 / 2005-11-27 (*mhs*)
350
351Improved the 525 line numbering diagram. Hans Verkuil and I rewrote the
352sliced VBI section. He also contributed a VIDIOC_LOG_STATUS page.
353Fixed VIDIOC_S_STD call in the video standard selection example.
354Various updates.
355
356
357:revision: 0.8 / 2004-10-04 (*mhs*)
358
359Somehow a piece of junk slipped into the capture example, removed.
360
361
362:revision: 0.7 / 2004-09-19 (*mhs*)
363
364Fixed video standard selection, control enumeration, downscaling and
365aspect example. Added read and user pointer i/o to video capture
366example.
367
368
369:revision: 0.6 / 2004-08-01 (*mhs*)
370
371v4l2_buffer changes, added video capture example, various corrections.
372
373
374:revision: 0.5 / 2003-11-05 (*mhs*)
375
376Pixel format erratum.
377
378
379:revision: 0.4 / 2003-09-17 (*mhs*)
380
381Corrected source and Makefile to generate a PDF. SGML fixes. Added
382latest API changes. Closed gaps in the history chapter.
383
384
385:revision: 0.3 / 2003-02-05 (*mhs*)
386
387Another draft, more corrections.
388
389
390:revision: 0.2 / 2003-01-15 (*mhs*)
391
392Second draft, with corrections pointed out by Gerd Knorr.
393
394
395:revision: 0.1 / 2002-12-01 (*mhs*)
396
397First draft, based on documentation by Bill Dirks and discussions on the
398V4L mailing list.
diff --git a/Documentation/media/uapi/v4l/v4l2grab-example.rst b/Documentation/media/uapi/v4l/v4l2grab-example.rst
new file mode 100644
index 000000000000..c240f0513bee
--- /dev/null
+++ b/Documentation/media/uapi/v4l/v4l2grab-example.rst
@@ -0,0 +1,17 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2grab-example:
4
5**********************************
6Video Grabber example using libv4l
7**********************************
8
9This program demonstrates how to grab V4L2 images in ppm format by using
10libv4l handlers. The advantage is that this grabber can potentially work
11with any V4L2 driver.
12
13
14.. toctree::
15 :maxdepth: 1
16
17 v4l2grab.c
diff --git a/Documentation/media/uapi/v4l/v4l2grab.c.rst b/Documentation/media/uapi/v4l/v4l2grab.c.rst
new file mode 100644
index 000000000000..5aabd0b7b089
--- /dev/null
+++ b/Documentation/media/uapi/v4l/v4l2grab.c.rst
@@ -0,0 +1,169 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3file: media/v4l/v4l2grab.c
4==========================
5
6.. code-block:: c
7
8 /* V4L2 video picture grabber
9 Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org>
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation version 2 of the License.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 */
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <fcntl.h>
25 #include <errno.h>
26 #include <sys/ioctl.h>
27 #include <sys/types.h>
28 #include <sys/time.h>
29 #include <sys/mman.h>
30 #include <linux/videodev2.h>
31 #include "../libv4l/include/libv4l2.h"
32
33 #define CLEAR(x) memset(&(x), 0, sizeof(x))
34
35 struct buffer {
36 void *start;
37 size_t length;
38 };
39
40 static void xioctl(int fh, int request, void *arg)
41 {
42 int r;
43
44 do {
45 r = v4l2_ioctl(fh, request, arg);
46 } while (r == -1 && ((errno == EINTR) || (errno == EAGAIN)));
47
48 if (r == -1) {
49 fprintf(stderr, "error %d, %s\\n", errno, strerror(errno));
50 exit(EXIT_FAILURE);
51 }
52 }
53
54 int main(int argc, char **argv)
55 {
56 struct v4l2_format fmt;
57 struct v4l2_buffer buf;
58 struct v4l2_requestbuffers req;
59 enum v4l2_buf_type type;
60 fd_set fds;
61 struct timeval tv;
62 int r, fd = -1;
63 unsigned int i, n_buffers;
64 char *dev_name = "/dev/video0";
65 char out_name[256];
66 FILE *fout;
67 struct buffer *buffers;
68
69 fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0);
70 if (fd < 0) {
71 perror("Cannot open device");
72 exit(EXIT_FAILURE);
73 }
74
75 CLEAR(fmt);
76 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
77 fmt.fmt.pix.width = 640;
78 fmt.fmt.pix.height = 480;
79 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
80 fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
81 xioctl(fd, VIDIOC_S_FMT, &fmt);
82 if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) {
83 printf("Libv4l didn't accept RGB24 format. Can't proceed.\\n");
84 exit(EXIT_FAILURE);
85 }
86 if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480))
87 printf("Warning: driver is sending image at %dx%d\\n",
88 fmt.fmt.pix.width, fmt.fmt.pix.height);
89
90 CLEAR(req);
91 req.count = 2;
92 req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
93 req.memory = V4L2_MEMORY_MMAP;
94 xioctl(fd, VIDIOC_REQBUFS, &req);
95
96 buffers = calloc(req.count, sizeof(*buffers));
97 for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
98 CLEAR(buf);
99
100 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
101 buf.memory = V4L2_MEMORY_MMAP;
102 buf.index = n_buffers;
103
104 xioctl(fd, VIDIOC_QUERYBUF, &buf);
105
106 buffers[n_buffers].length = buf.length;
107 buffers[n_buffers].start = v4l2_mmap(NULL, buf.length,
108 PROT_READ | PROT_WRITE, MAP_SHARED,
109 fd, buf.m.offset);
110
111 if (MAP_FAILED == buffers[n_buffers].start) {
112 perror("mmap");
113 exit(EXIT_FAILURE);
114 }
115 }
116
117 for (i = 0; i < n_buffers; ++i) {
118 CLEAR(buf);
119 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
120 buf.memory = V4L2_MEMORY_MMAP;
121 buf.index = i;
122 xioctl(fd, VIDIOC_QBUF, &buf);
123 }
124 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
125
126 xioctl(fd, VIDIOC_STREAMON, &type);
127 for (i = 0; i < 20; i++) {
128 do {
129 FD_ZERO(&fds);
130 FD_SET(fd, &fds);
131
132 /* Timeout. */
133 tv.tv_sec = 2;
134 tv.tv_usec = 0;
135
136 r = select(fd + 1, &fds, NULL, NULL, &tv);
137 } while ((r == -1 && (errno = EINTR)));
138 if (r == -1) {
139 perror("select");
140 return errno;
141 }
142
143 CLEAR(buf);
144 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
145 buf.memory = V4L2_MEMORY_MMAP;
146 xioctl(fd, VIDIOC_DQBUF, &buf);
147
148 sprintf(out_name, "out%03d.ppm", i);
149 fout = fopen(out_name, "w");
150 if (!fout) {
151 perror("Cannot open image");
152 exit(EXIT_FAILURE);
153 }
154 fprintf(fout, "P6\\n%d %d 255\\n",
155 fmt.fmt.pix.width, fmt.fmt.pix.height);
156 fwrite(buffers[buf.index].start, buf.bytesused, 1, fout);
157 fclose(fout);
158
159 xioctl(fd, VIDIOC_QBUF, &buf);
160 }
161
162 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
163 xioctl(fd, VIDIOC_STREAMOFF, &type);
164 for (i = 0; i < n_buffers; ++i)
165 v4l2_munmap(buffers[i].start, buffers[i].length);
166 v4l2_close(fd);
167
168 return 0;
169 }
diff --git a/Documentation/media/uapi/v4l/video.rst b/Documentation/media/uapi/v4l/video.rst
new file mode 100644
index 000000000000..d3f00715fbc1
--- /dev/null
+++ b/Documentation/media/uapi/v4l/video.rst
@@ -0,0 +1,67 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _video:
4
5************************
6Video Inputs and Outputs
7************************
8
9Video inputs and outputs are physical connectors of a device. These can
10be for example RF connectors (antenna/cable), CVBS a.k.a. Composite
11Video, S-Video or RGB connectors. Video and VBI capture devices have
12inputs. Video and VBI output devices have outputs, at least one each.
13Radio devices have no video inputs or outputs.
14
15To learn about the number and attributes of the available inputs and
16outputs applications can enumerate them with the
17:ref:`VIDIOC_ENUMINPUT` and
18:ref:`VIDIOC_ENUMOUTPUT` ioctl, respectively. The
19struct :ref:`v4l2_input <v4l2-input>` returned by the
20:ref:`VIDIOC_ENUMINPUT` ioctl also contains signal
21:status information applicable when the current video input is queried.
22
23The :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
24:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctls return the index of
25the current video input or output. To select a different input or output
26applications call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` and
27:ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctls. Drivers must
28implement all the input ioctls when the device has one or more inputs,
29all the output ioctls when the device has one or more outputs.
30
31Example: Information about the current video input
32==================================================
33
34.. code-block:: c
35
36 struct v4l2_input input;
37 int index;
38
39 if (-1 == ioctl(fd, VIDIOC_G_INPUT, &index)) {
40 perror("VIDIOC_G_INPUT");
41 exit(EXIT_FAILURE);
42 }
43
44 memset(&input, 0, sizeof(input));
45 input.index = index;
46
47 if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) {
48 perror("VIDIOC_ENUMINPUT");
49 exit(EXIT_FAILURE);
50 }
51
52 printf("Current input: %s\\n", input.name);
53
54
55Example: Switching to the first video input
56===========================================
57
58.. code-block:: c
59
60 int index;
61
62 index = 0;
63
64 if (-1 == ioctl(fd, VIDIOC_S_INPUT, &index)) {
65 perror("VIDIOC_S_INPUT");
66 exit(EXIT_FAILURE);
67 }
diff --git a/Documentation/media/uapi/v4l/videodev.rst b/Documentation/media/uapi/v4l/videodev.rst
new file mode 100644
index 000000000000..b9ee4672d639
--- /dev/null
+++ b/Documentation/media/uapi/v4l/videodev.rst
@@ -0,0 +1,9 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _videodev:
4
5*******************************
6Video For Linux Two Header File
7*******************************
8
9.. kernel-include:: $BUILDDIR/videodev2.h.rst
diff --git a/Documentation/media/uapi/v4l/vidioc-create-bufs.rst b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst
new file mode 100644
index 000000000000..abdc0b4d83d5
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst
@@ -0,0 +1,146 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_CREATE_BUFS:
4
5************************
6ioctl VIDIOC_CREATE_BUFS
7************************
8
9Name
10====
11
12VIDIOC_CREATE_BUFS - Create buffers for Memory Mapped or User Pointer or DMA Buffer I/O
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_create_buffers *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_CREATE_BUFS
29
30``argp``
31
32
33Description
34===========
35
36This ioctl is used to create buffers for :ref:`memory mapped <mmap>`
37or :ref:`user pointer <userp>` or :ref:`DMA buffer <dmabuf>` I/O. It
38can be used as an alternative or in addition to the
39:ref:`VIDIOC_REQBUFS` ioctl, when a tighter control
40over buffers is required. This ioctl can be called multiple times to
41create buffers of different sizes.
42
43To allocate the device buffers applications must initialize the relevant
44fields of the :ref:`struct v4l2_create_buffers <v4l2-create-buffers>` structure. The
45``count`` field must be set to the number of requested buffers, the
46``memory`` field specifies the requested I/O method and the ``reserved``
47array must be zeroed.
48
49The ``format`` field specifies the image format that the buffers must be
50able to handle. The application has to fill in this struct
51:ref:`v4l2_format <v4l2-format>`. Usually this will be done using the
52:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` or
53:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctls to ensure that the
54requested format is supported by the driver. Based on the format's
55``type`` field the requested buffer size (for single-planar) or plane
56sizes (for multi-planar formats) will be used for the allocated buffers.
57The driver may return an error if the size(s) are not supported by the
58hardware (usually because they are too small).
59
60The buffers created by this ioctl will have as minimum size the size
61defined by the ``format.pix.sizeimage`` field (or the corresponding
62fields for other format types). Usually if the ``format.pix.sizeimage``
63field is less than the minimum required for the given format, then an
64error will be returned since drivers will typically not allow this. If
65it is larger, then the value will be used as-is. In other words, the
66driver may reject the requested size, but if it is accepted the driver
67will use it unchanged.
68
69When the ioctl is called with a pointer to this structure the driver
70will attempt to allocate up to the requested number of buffers and store
71the actual number allocated and the starting index in the ``count`` and
72the ``index`` fields respectively. On return ``count`` can be smaller
73than the number requested.
74
75
76.. _v4l2-create-buffers:
77
78.. flat-table:: struct v4l2_create_buffers
79 :header-rows: 0
80 :stub-columns: 0
81 :widths: 1 1 2
82
83
84 - .. row 1
85
86 - __u32
87
88 - ``index``
89
90 - The starting buffer index, returned by the driver.
91
92 - .. row 2
93
94 - __u32
95
96 - ``count``
97
98 - The number of buffers requested or granted. If count == 0, then
99 :ref:`VIDIOC_CREATE_BUFS` will set ``index`` to the current number of
100 created buffers, and it will check the validity of ``memory`` and
101 ``format.type``. If those are invalid -1 is returned and errno is
102 set to ``EINVAL`` error code, otherwise :ref:`VIDIOC_CREATE_BUFS` returns
103 0. It will never set errno to ``EBUSY`` error code in this particular
104 case.
105
106 - .. row 3
107
108 - __u32
109
110 - ``memory``
111
112 - Applications set this field to ``V4L2_MEMORY_MMAP``,
113 ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See
114 :ref:`v4l2-memory`
115
116 - .. row 4
117
118 - struct :ref:`v4l2_format <v4l2-format>`
119
120 - ``format``
121
122 - Filled in by the application, preserved by the driver.
123
124 - .. row 5
125
126 - __u32
127
128 - ``reserved``\ [8]
129
130 - A place holder for future extensions. Drivers and applications
131 must set the array to zero.
132
133
134Return Value
135============
136
137On success 0 is returned, on error -1 and the ``errno`` variable is set
138appropriately. The generic error codes are described at the
139:ref:`Generic Error Codes <gen-errors>` chapter.
140
141ENOMEM
142 No memory to allocate buffers for :ref:`memory mapped <mmap>` I/O.
143
144EINVAL
145 The buffer type (``format.type`` field), requested I/O method
146 (``memory``) or format (``format`` field) is not valid.
diff --git a/Documentation/media/uapi/v4l/vidioc-cropcap.rst b/Documentation/media/uapi/v4l/vidioc-cropcap.rst
new file mode 100644
index 000000000000..8dcbe6d26219
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-cropcap.rst
@@ -0,0 +1,167 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_CROPCAP:
4
5********************
6ioctl VIDIOC_CROPCAP
7********************
8
9Name
10====
11
12VIDIOC_CROPCAP - Information about the video cropping and scaling abilities
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_cropcap *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_CROPCAP
29
30``argp``
31
32
33Description
34===========
35
36Applications use this function to query the cropping limits, the pixel
37aspect of images and to calculate scale factors. They set the ``type``
38field of a v4l2_cropcap structure to the respective buffer (stream)
39type and call the :ref:`VIDIOC_CROPCAP` ioctl with a pointer to this
40structure. Drivers fill the rest of the structure. The results are
41constant except when switching the video standard. Remember this switch
42can occur implicit when switching the video input or output.
43
44Do not use the multiplanar buffer types. Use
45``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
46``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
47``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
48``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``.
49
50This ioctl must be implemented for video capture or output devices that
51support cropping and/or scaling and/or have non-square pixels, and for
52overlay devices.
53
54
55.. _v4l2-cropcap:
56
57.. flat-table:: struct v4l2_cropcap
58 :header-rows: 0
59 :stub-columns: 0
60 :widths: 1 1 2
61
62
63 - .. row 1
64
65 - __u32
66
67 - ``type``
68
69 - Type of the data stream, set by the application. Only these types
70 are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``,
71 ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and
72 ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
73
74 - .. row 2
75
76 - struct :ref:`v4l2_rect <v4l2-rect-crop>`
77
78 - ``bounds``
79
80 - Defines the window within capturing or output is possible, this
81 may exclude for example the horizontal and vertical blanking
82 areas. The cropping rectangle cannot exceed these limits. Width
83 and height are defined in pixels, the driver writer is free to
84 choose origin and units of the coordinate system in the analog
85 domain.
86
87 - .. row 3
88
89 - struct :ref:`v4l2_rect <v4l2-rect-crop>`
90
91 - ``defrect``
92
93 - Default cropping rectangle, it shall cover the "whole picture".
94 Assuming pixel aspect 1/1 this could be for example a 640 × 480
95 rectangle for NTSC, a 768 × 576 rectangle for PAL and SECAM
96 centered over the active picture area. The same co-ordinate system
97 as for ``bounds`` is used.
98
99 - .. row 4
100
101 - struct :ref:`v4l2_fract <v4l2-fract>`
102
103 - ``pixelaspect``
104
105 - This is the pixel aspect (y / x) when no scaling is applied, the
106 ratio of the actual sampling frequency and the frequency required
107 to get square pixels.
108
109 When cropping coordinates refer to square pixels, the driver sets
110 ``pixelaspect`` to 1/1. Other common values are 54/59 for PAL and
111 SECAM, 11/10 for NTSC sampled according to [:ref:`itu601`].
112
113
114
115.. _v4l2-rect-crop:
116
117.. flat-table:: struct v4l2_rect
118 :header-rows: 0
119 :stub-columns: 0
120 :widths: 1 1 2
121
122
123 - .. row 1
124
125 - __s32
126
127 - ``left``
128
129 - Horizontal offset of the top, left corner of the rectangle, in
130 pixels.
131
132 - .. row 2
133
134 - __s32
135
136 - ``top``
137
138 - Vertical offset of the top, left corner of the rectangle, in
139 pixels.
140
141 - .. row 3
142
143 - __u32
144
145 - ``width``
146
147 - Width of the rectangle, in pixels.
148
149 - .. row 4
150
151 - __u32
152
153 - ``height``
154
155 - Height of the rectangle, in pixels.
156
157
158Return Value
159============
160
161On success 0 is returned, on error -1 and the ``errno`` variable is set
162appropriately. The generic error codes are described at the
163:ref:`Generic Error Codes <gen-errors>` chapter.
164
165EINVAL
166 The struct :ref:`v4l2_cropcap <v4l2-cropcap>` ``type`` is
167 invalid.
diff --git a/Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst b/Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst
new file mode 100644
index 000000000000..f7e1b80af29e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst
@@ -0,0 +1,204 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_DBG_G_CHIP_INFO:
4
5****************************
6ioctl VIDIOC_DBG_G_CHIP_INFO
7****************************
8
9Name
10====
11
12VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_dbg_chip_info *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_DBG_G_CHIP_INFO
29
30``argp``
31
32
33Description
34===========
35
36.. note::
37
38 This is an :ref:`experimental` interface and may
39 change in the future.
40
41For driver debugging purposes this ioctl allows test applications to
42query the driver about the chips present on the TV card. Regular
43applications must not use it. When you found a chip specific bug, please
44contact the linux-media mailing list
45(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
46so it can be fixed.
47
48Additionally the Linux kernel must be compiled with the
49``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.
50
51To query the driver applications must initialize the ``match.type`` and
52``match.addr`` or ``match.name`` fields of a struct
53:ref:`v4l2_dbg_chip_info <v4l2-dbg-chip-info>` and call
54:ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
55the driver stores information about the selected chip in the ``name``
56and ``flags`` fields.
57
58When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
59selects the nth bridge 'chip' on the TV card. You can enumerate all
60chips by starting at zero and incrementing ``match.addr`` by one until
61:ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
62zero always selects the bridge chip itself, e. g. the chip connected to
63the PCI or USB bus. Non-zero numbers identify specific parts of the
64bridge chip such as an AC97 register block.
65
66When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
67selects the nth sub-device. This allows you to enumerate over all
68sub-devices.
69
70On success, the ``name`` field will contain a chip name and the
71``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
72supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
73if the driver supports writing registers to the device.
74
75We recommended the v4l2-dbg utility over calling this ioctl directly. It
76is available from the LinuxTV v4l-dvb repository; see
77`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
78instructions.
79
80
81.. _name-v4l2-dbg-match:
82
83.. flat-table:: struct v4l2_dbg_match
84 :header-rows: 0
85 :stub-columns: 0
86 :widths: 1 1 1 2
87
88
89 - .. row 1
90
91 - __u32
92
93 - ``type``
94
95 - See :ref:`name-chip-match-types` for a list of possible types.
96
97 - .. row 2
98
99 - union
100
101 - (anonymous)
102
103 - .. row 3
104
105 -
106 - __u32
107
108 - ``addr``
109
110 - Match a chip by this number, interpreted according to the ``type``
111 field.
112
113 - .. row 4
114
115 -
116 - char
117
118 - ``name[32]``
119
120 - Match a chip by this name, interpreted according to the ``type``
121 field. Currently unused.
122
123
124
125.. _v4l2-dbg-chip-info:
126
127.. flat-table:: struct v4l2_dbg_chip_info
128 :header-rows: 0
129 :stub-columns: 0
130 :widths: 1 1 2
131
132
133 - .. row 1
134
135 - struct v4l2_dbg_match
136
137 - ``match``
138
139 - How to match the chip, see :ref:`name-v4l2-dbg-match`.
140
141 - .. row 2
142
143 - char
144
145 - ``name[32]``
146
147 - The name of the chip.
148
149 - .. row 3
150
151 - __u32
152
153 - ``flags``
154
155 - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
156 driver supports reading registers from the device. If
157 ``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
158 registers.
159
160 - .. row 4
161
162 - __u32
163
164 - ``reserved[8]``
165
166 - Reserved fields, both application and driver must set these to 0.
167
168
169
170.. _name-chip-match-types:
171
172.. flat-table:: Chip Match Types
173 :header-rows: 0
174 :stub-columns: 0
175 :widths: 3 1 4
176
177
178 - .. row 1
179
180 - ``V4L2_CHIP_MATCH_BRIDGE``
181
182 - 0
183
184 - Match the nth chip on the card, zero for the bridge chip. Does not
185 match sub-devices.
186
187 - .. row 2
188
189 - ``V4L2_CHIP_MATCH_SUBDEV``
190
191 - 4
192
193 - Match the nth sub-device.
194
195
196Return Value
197============
198
199On success 0 is returned, on error -1 and the ``errno`` variable is set
200appropriately. The generic error codes are described at the
201:ref:`Generic Error Codes <gen-errors>` chapter.
202
203EINVAL
204 The ``match_type`` is invalid or no device could be matched.
diff --git a/Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst b/Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst
new file mode 100644
index 000000000000..09d2880e6170
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst
@@ -0,0 +1,209 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_DBG_G_REGISTER:
4
5**************************************************
6ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER
7**************************************************
8
9Name
10====
11
12VIDIOC_DBG_G_REGISTER - VIDIOC_DBG_S_REGISTER - Read or write hardware registers
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_dbg_register *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_dbg_register *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER
31
32``argp``
33
34
35Description
36===========
37
38.. note::
39
40 This is an :ref:`experimental` interface and may
41 change in the future.
42
43For driver debugging purposes these ioctls allow test applications to
44access hardware registers directly. Regular applications must not use
45them.
46
47Since writing or even reading registers can jeopardize the system
48security, its stability and damage the hardware, both ioctls require
49superuser privileges. Additionally the Linux kernel must be compiled
50with the ``CONFIG_VIDEO_ADV_DEBUG`` option to enable these ioctls.
51
52To write a register applications must initialize all fields of a struct
53:ref:`v4l2_dbg_register <v4l2-dbg-register>` except for ``size`` and
54call ``VIDIOC_DBG_S_REGISTER`` with a pointer to this structure. The
55``match.type`` and ``match.addr`` or ``match.name`` fields select a chip
56on the TV card, the ``reg`` field specifies a register number and the
57``val`` field the value to be written into the register.
58
59To read a register applications must initialize the ``match.type``,
60``match.addr`` or ``match.name`` and ``reg`` fields, and call
61``VIDIOC_DBG_G_REGISTER`` with a pointer to this structure. On success
62the driver stores the register value in the ``val`` field and the size
63(in bytes) of the value in ``size``.
64
65When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
66selects the nth non-sub-device chip on the TV card. The number zero
67always selects the host chip, e. g. the chip connected to the PCI or USB
68bus. You can find out which chips are present with the
69:ref:`VIDIOC_DBG_G_CHIP_INFO` ioctl.
70
71When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
72selects the nth sub-device.
73
74These ioctls are optional, not all drivers may support them. However
75when a driver supports these ioctls it must also support
76:ref:`VIDIOC_DBG_G_CHIP_INFO`. Conversely
77it may support ``VIDIOC_DBG_G_CHIP_INFO`` but not these ioctls.
78
79``VIDIOC_DBG_G_REGISTER`` and ``VIDIOC_DBG_S_REGISTER`` were introduced
80in Linux 2.6.21, but their API was changed to the one described here in
81kernel 2.6.29.
82
83We recommended the v4l2-dbg utility over calling these ioctls directly.
84It is available from the LinuxTV v4l-dvb repository; see
85`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
86instructions.
87
88
89.. _v4l2-dbg-match:
90
91.. flat-table:: struct v4l2_dbg_match
92 :header-rows: 0
93 :stub-columns: 0
94 :widths: 1 1 1 2
95
96
97 - .. row 1
98
99 - __u32
100
101 - ``type``
102
103 - See :ref:`chip-match-types` for a list of possible types.
104
105 - .. row 2
106
107 - union
108
109 - (anonymous)
110
111 - .. row 3
112
113 -
114 - __u32
115
116 - ``addr``
117
118 - Match a chip by this number, interpreted according to the ``type``
119 field.
120
121 - .. row 4
122
123 -
124 - char
125
126 - ``name[32]``
127
128 - Match a chip by this name, interpreted according to the ``type``
129 field. Currently unused.
130
131
132
133.. _v4l2-dbg-register:
134
135.. flat-table:: struct v4l2_dbg_register
136 :header-rows: 0
137 :stub-columns: 0
138
139
140 - .. row 1
141
142 - struct v4l2_dbg_match
143
144 - ``match``
145
146 - How to match the chip, see :ref:`v4l2-dbg-match`.
147
148 - .. row 2
149
150 - __u32
151
152 - ``size``
153
154 - The register size in bytes.
155
156 - .. row 3
157
158 - __u64
159
160 - ``reg``
161
162 - A register number.
163
164 - .. row 4
165
166 - __u64
167
168 - ``val``
169
170 - The value read from, or to be written into the register.
171
172
173
174.. _chip-match-types:
175
176.. flat-table:: Chip Match Types
177 :header-rows: 0
178 :stub-columns: 0
179 :widths: 3 1 4
180
181
182 - .. row 1
183
184 - ``V4L2_CHIP_MATCH_BRIDGE``
185
186 - 0
187
188 - Match the nth chip on the card, zero for the bridge chip. Does not
189 match sub-devices.
190
191 - .. row 2
192
193 - ``V4L2_CHIP_MATCH_SUBDEV``
194
195 - 4
196
197 - Match the nth sub-device.
198
199
200Return Value
201============
202
203On success 0 is returned, on error -1 and the ``errno`` variable is set
204appropriately. The generic error codes are described at the
205:ref:`Generic Error Codes <gen-errors>` chapter.
206
207EPERM
208 Insufficient permissions. Root privileges are required to execute
209 these ioctls.
diff --git a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
new file mode 100644
index 000000000000..2a36e91b57b9
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
@@ -0,0 +1,271 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_DECODER_CMD:
4
5************************************************
6ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD
7************************************************
8
9Name
10====
11
12VIDIOC_DECODER_CMD - VIDIOC_TRY_DECODER_CMD - Execute an decoder command
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_decoder_cmd *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD
29
30``argp``
31
32
33Description
34===========
35
36These ioctls control an audio/video (usually MPEG-) decoder.
37``VIDIOC_DECODER_CMD`` sends a command to the decoder,
38``VIDIOC_TRY_DECODER_CMD`` can be used to try a command without actually
39executing it. To send a command applications must initialize all fields
40of a struct :ref:`v4l2_decoder_cmd <v4l2-decoder-cmd>` and call
41``VIDIOC_DECODER_CMD`` or ``VIDIOC_TRY_DECODER_CMD`` with a pointer to
42this structure.
43
44The ``cmd`` field must contain the command code. Some commands use the
45``flags`` field for additional information.
46
47A :ref:`write() <func-write>` or :ref:`VIDIOC_STREAMON`
48call sends an implicit START command to the decoder if it has not been
49started yet.
50
51A :ref:`close() <func-close>` or :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
52call of a streaming file descriptor sends an implicit immediate STOP
53command to the decoder, and all buffered data is discarded.
54
55These ioctls are optional, not all drivers may support them. They were
56introduced in Linux 3.3.
57
58
59.. _v4l2-decoder-cmd:
60
61.. flat-table:: struct v4l2_decoder_cmd
62 :header-rows: 0
63 :stub-columns: 0
64 :widths: 1 1 2 1 1
65
66
67 - .. row 1
68
69 - __u32
70
71 - ``cmd``
72
73 -
74 -
75 - The decoder command, see :ref:`decoder-cmds`.
76
77 - .. row 2
78
79 - __u32
80
81 - ``flags``
82
83 -
84 -
85 - Flags to go with the command. If no flags are defined for this
86 command, drivers and applications must set this field to zero.
87
88 - .. row 3
89
90 - union
91
92 - (anonymous)
93
94 -
95 -
96 -
97
98 - .. row 4
99
100 -
101 - struct
102
103 - ``start``
104
105 -
106 - Structure containing additional data for the
107 ``V4L2_DEC_CMD_START`` command.
108
109 - .. row 5
110
111 -
112 -
113 - __s32
114
115 - ``speed``
116
117 - Playback speed and direction. The playback speed is defined as
118 ``speed``/1000 of the normal speed. So 1000 is normal playback.
119 Negative numbers denote reverse playback, so -1000 does reverse
120 playback at normal speed. Speeds -1, 0 and 1 have special
121 meanings: speed 0 is shorthand for 1000 (normal playback). A speed
122 of 1 steps just one frame forward, a speed of -1 steps just one
123 frame back.
124
125 - .. row 6
126
127 -
128 -
129 - __u32
130
131 - ``format``
132
133 - Format restrictions. This field is set by the driver, not the
134 application. Possible values are ``V4L2_DEC_START_FMT_NONE`` if
135 there are no format restrictions or ``V4L2_DEC_START_FMT_GOP`` if
136 the decoder operates on full GOPs (*Group Of Pictures*). This is
137 usually the case for reverse playback: the decoder needs full
138 GOPs, which it can then play in reverse order. So to implement
139 reverse playback the application must feed the decoder the last
140 GOP in the video file, then the GOP before that, etc. etc.
141
142 - .. row 7
143
144 -
145 - struct
146
147 - ``stop``
148
149 -
150 - Structure containing additional data for the ``V4L2_DEC_CMD_STOP``
151 command.
152
153 - .. row 8
154
155 -
156 -
157 - __u64
158
159 - ``pts``
160
161 - Stop playback at this ``pts`` or immediately if the playback is
162 already past that timestamp. Leave to 0 if you want to stop after
163 the last frame was decoded.
164
165 - .. row 9
166
167 -
168 - struct
169
170 - ``raw``
171
172 -
173 -
174
175 - .. row 10
176
177 -
178 -
179 - __u32
180
181 - ``data``\ [16]
182
183 - Reserved for future extensions. Drivers and applications must set
184 the array to zero.
185
186
187
188.. _decoder-cmds:
189
190.. flat-table:: Decoder Commands
191 :header-rows: 0
192 :stub-columns: 0
193 :widths: 3 1 4
194
195
196 - .. row 1
197
198 - ``V4L2_DEC_CMD_START``
199
200 - 0
201
202 - Start the decoder. When the decoder is already running or paused,
203 this command will just change the playback speed. That means that
204 calling ``V4L2_DEC_CMD_START`` when the decoder was paused will
205 *not* resume the decoder. You have to explicitly call
206 ``V4L2_DEC_CMD_RESUME`` for that. This command has one flag:
207 ``V4L2_DEC_CMD_START_MUTE_AUDIO``. If set, then audio will be
208 muted when playing back at a non-standard speed.
209
210 - .. row 2
211
212 - ``V4L2_DEC_CMD_STOP``
213
214 - 1
215
216 - Stop the decoder. When the decoder is already stopped, this
217 command does nothing. This command has two flags: if
218 ``V4L2_DEC_CMD_STOP_TO_BLACK`` is set, then the decoder will set
219 the picture to black after it stopped decoding. Otherwise the last
220 image will repeat. mem2mem decoders will stop producing new frames
221 altogether. They will send a ``V4L2_EVENT_EOS`` event when the
222 last frame has been decoded and all frames are ready to be
223 dequeued and will set the ``V4L2_BUF_FLAG_LAST`` buffer flag on
224 the last buffer of the capture queue to indicate there will be no
225 new buffers produced to dequeue. This buffer may be empty,
226 indicated by the driver setting the ``bytesused`` field to 0. Once
227 the ``V4L2_BUF_FLAG_LAST`` flag was set, the
228 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
229 but return an ``EPIPE`` error code. If
230 ``V4L2_DEC_CMD_STOP_IMMEDIATELY`` is set, then the decoder stops
231 immediately (ignoring the ``pts`` value), otherwise it will keep
232 decoding until timestamp >= pts or until the last of the pending
233 data from its internal buffers was decoded.
234
235 - .. row 3
236
237 - ``V4L2_DEC_CMD_PAUSE``
238
239 - 2
240
241 - Pause the decoder. When the decoder has not been started yet, the
242 driver will return an ``EPERM`` error code. When the decoder is
243 already paused, this command does nothing. This command has one
244 flag: if ``V4L2_DEC_CMD_PAUSE_TO_BLACK`` is set, then set the
245 decoder output to black when paused.
246
247 - .. row 4
248
249 - ``V4L2_DEC_CMD_RESUME``
250
251 - 3
252
253 - Resume decoding after a PAUSE command. When the decoder has not
254 been started yet, the driver will return an ``EPERM`` error code. When
255 the decoder is already running, this command does nothing. No
256 flags are defined for this command.
257
258
259Return Value
260============
261
262On success 0 is returned, on error -1 and the ``errno`` variable is set
263appropriately. The generic error codes are described at the
264:ref:`Generic Error Codes <gen-errors>` chapter.
265
266EINVAL
267 The ``cmd`` field is invalid.
268
269EPERM
270 The application sent a PAUSE or RESUME command when the decoder was
271 not running.
diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
new file mode 100644
index 000000000000..73c0d5be62ee
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -0,0 +1,573 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_DQEVENT:
4
5********************
6ioctl VIDIOC_DQEVENT
7********************
8
9Name
10====
11
12VIDIOC_DQEVENT - Dequeue event
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_event *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_DQEVENT
29
30``argp``
31
32
33Description
34===========
35
36Dequeue an event from a video device. No input is required for this
37ioctl. All the fields of the struct :ref:`v4l2_event <v4l2-event>`
38structure are filled by the driver. The file handle will also receive
39exceptions which the application may get by e.g. using the select system
40call.
41
42
43.. _v4l2-event:
44
45.. flat-table:: struct v4l2_event
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2 1
49
50
51 - .. row 1
52
53 - __u32
54
55 - ``type``
56
57 -
58 - Type of the event, see :ref:`event-type`.
59
60 - .. row 2
61
62 - union
63
64 - ``u``
65
66 -
67 -
68
69 - .. row 3
70
71 -
72 - struct :ref:`v4l2_event_vsync <v4l2-event-vsync>`
73
74 - ``vsync``
75
76 - Event data for event ``V4L2_EVENT_VSYNC``.
77
78 - .. row 4
79
80 -
81 - struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>`
82
83 - ``ctrl``
84
85 - Event data for event ``V4L2_EVENT_CTRL``.
86
87 - .. row 5
88
89 -
90 - struct :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>`
91
92 - ``frame_sync``
93
94 - Event data for event ``V4L2_EVENT_FRAME_SYNC``.
95
96 - .. row 6
97
98 -
99 - struct :ref:`v4l2_event_motion_det <v4l2-event-motion-det>`
100
101 - ``motion_det``
102
103 - Event data for event V4L2_EVENT_MOTION_DET.
104
105 - .. row 7
106
107 -
108 - struct :ref:`v4l2_event_src_change <v4l2-event-src-change>`
109
110 - ``src_change``
111
112 - Event data for event V4L2_EVENT_SOURCE_CHANGE.
113
114 - .. row 8
115
116 -
117 - __u8
118
119 - ``data``\ [64]
120
121 - Event data. Defined by the event type. The union should be used to
122 define easily accessible type for events.
123
124 - .. row 9
125
126 - __u32
127
128 - ``pending``
129
130 -
131 - Number of pending events excluding this one.
132
133 - .. row 10
134
135 - __u32
136
137 - ``sequence``
138
139 -
140 - Event sequence number. The sequence number is incremented for
141 every subscribed event that takes place. If sequence numbers are
142 not contiguous it means that events have been lost.
143
144 - .. row 11
145
146 - struct timespec
147
148 - ``timestamp``
149
150 -
151 - Event timestamp. The timestamp has been taken from the
152 ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2,
153 use :c:func:`clock_gettime(2)`.
154
155 - .. row 12
156
157 - u32
158
159 - ``id``
160
161 -
162 - The ID associated with the event source. If the event does not
163 have an associated ID (this depends on the event type), then this
164 is 0.
165
166 - .. row 13
167
168 - __u32
169
170 - ``reserved``\ [8]
171
172 -
173 - Reserved for future extensions. Drivers must set the array to
174 zero.
175
176
177
178.. _event-type:
179
180.. flat-table:: Event Types
181 :header-rows: 0
182 :stub-columns: 0
183 :widths: 3 1 4
184
185
186 - .. row 1
187
188 - ``V4L2_EVENT_ALL``
189
190 - 0
191
192 - All events. V4L2_EVENT_ALL is valid only for
193 VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once.
194
195 - .. row 2
196
197 - ``V4L2_EVENT_VSYNC``
198
199 - 1
200
201 - This event is triggered on the vertical sync. This event has a
202 struct :ref:`v4l2_event_vsync <v4l2-event-vsync>` associated
203 with it.
204
205 - .. row 3
206
207 - ``V4L2_EVENT_EOS``
208
209 - 2
210
211 - This event is triggered when the end of a stream is reached. This
212 is typically used with MPEG decoders to report to the application
213 when the last of the MPEG stream has been decoded.
214
215 - .. row 4
216
217 - ``V4L2_EVENT_CTRL``
218
219 - 3
220
221 - This event requires that the ``id`` matches the control ID from
222 which you want to receive events. This event is triggered if the
223 control's value changes, if a button control is pressed or if the
224 control's flags change. This event has a struct
225 :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` associated with it.
226 This struct contains much of the same information as struct
227 :ref:`v4l2_queryctrl <v4l2-queryctrl>` and struct
228 :ref:`v4l2_control <v4l2-control>`.
229
230 If the event is generated due to a call to
231 :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` or
232 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, then the
233 event will *not* be sent to the file handle that called the ioctl
234 function. This prevents nasty feedback loops. If you *do* want to
235 get the event, then set the ``V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK``
236 flag.
237
238 This event type will ensure that no information is lost when more
239 events are raised than there is room internally. In that case the
240 struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` of the
241 second-oldest event is kept, but the ``changes`` field of the
242 second-oldest event is ORed with the ``changes`` field of the
243 oldest event.
244
245 - .. row 5
246
247 - ``V4L2_EVENT_FRAME_SYNC``
248
249 - 4
250
251 - Triggered immediately when the reception of a frame has begun.
252 This event has a struct
253 :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>`
254 associated with it.
255
256 If the hardware needs to be stopped in the case of a buffer
257 underrun it might not be able to generate this event. In such
258 cases the ``frame_sequence`` field in struct
259 :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>` will not
260 be incremented. This causes two consecutive frame sequence numbers
261 to have n times frame interval in between them.
262
263 - .. row 6
264
265 - ``V4L2_EVENT_SOURCE_CHANGE``
266
267 - 5
268
269 - This event is triggered when a source parameter change is detected
270 during runtime by the video device. It can be a runtime resolution
271 change triggered by a video decoder or the format change happening
272 on an input connector. This event requires that the ``id`` matches
273 the input index (when used with a video device node) or the pad
274 index (when used with a subdevice node) from which you want to
275 receive events.
276
277 This event has a struct
278 :ref:`v4l2_event_src_change <v4l2-event-src-change>`
279 associated with it. The ``changes`` bitfield denotes what has
280 changed for the subscribed pad. If multiple events occurred before
281 application could dequeue them, then the changes will have the
282 ORed value of all the events generated.
283
284 - .. row 7
285
286 - ``V4L2_EVENT_MOTION_DET``
287
288 - 6
289
290 - Triggered whenever the motion detection state for one or more of
291 the regions changes. This event has a struct
292 :ref:`v4l2_event_motion_det <v4l2-event-motion-det>`
293 associated with it.
294
295 - .. row 8
296
297 - ``V4L2_EVENT_PRIVATE_START``
298
299 - 0x08000000
300
301 - Base event number for driver-private events.
302
303
304
305.. _v4l2-event-vsync:
306
307.. flat-table:: struct v4l2_event_vsync
308 :header-rows: 0
309 :stub-columns: 0
310 :widths: 1 1 2
311
312
313 - .. row 1
314
315 - __u8
316
317 - ``field``
318
319 - The upcoming field. See enum :ref:`v4l2_field <v4l2-field>`.
320
321
322
323.. _v4l2-event-ctrl:
324
325.. flat-table:: struct v4l2_event_ctrl
326 :header-rows: 0
327 :stub-columns: 0
328 :widths: 1 1 2 1
329
330
331 - .. row 1
332
333 - __u32
334
335 - ``changes``
336
337 -
338 - A bitmask that tells what has changed. See
339 :ref:`ctrl-changes-flags`.
340
341 - .. row 2
342
343 - __u32
344
345 - ``type``
346
347 -
348 - The type of the control. See enum
349 :ref:`v4l2_ctrl_type <v4l2-ctrl-type>`.
350
351 - .. row 3
352
353 - union (anonymous)
354
355 -
356 -
357 -
358
359 - .. row 4
360
361 -
362 - __s32
363
364 - ``value``
365
366 - The 32-bit value of the control for 32-bit control types. This is
367 0 for string controls since the value of a string cannot be passed
368 using :ref:`VIDIOC_DQEVENT`.
369
370 - .. row 5
371
372 -
373 - __s64
374
375 - ``value64``
376
377 - The 64-bit value of the control for 64-bit control types.
378
379 - .. row 6
380
381 - __u32
382
383 - ``flags``
384
385 -
386 - The control flags. See :ref:`control-flags`.
387
388 - .. row 7
389
390 - __s32
391
392 - ``minimum``
393
394 -
395 - The minimum value of the control. See struct
396 :ref:`v4l2_queryctrl <v4l2-queryctrl>`.
397
398 - .. row 8
399
400 - __s32
401
402 - ``maximum``
403
404 -
405 - The maximum value of the control. See struct
406 :ref:`v4l2_queryctrl <v4l2-queryctrl>`.
407
408 - .. row 9
409
410 - __s32
411
412 - ``step``
413
414 -
415 - The step value of the control. See struct
416 :ref:`v4l2_queryctrl <v4l2-queryctrl>`.
417
418 - .. row 10
419
420 - __s32
421
422 - ``default_value``
423
424 -
425 - The default value value of the control. See struct
426 :ref:`v4l2_queryctrl <v4l2-queryctrl>`.
427
428
429
430.. _v4l2-event-frame-sync:
431
432.. flat-table:: struct v4l2_event_frame_sync
433 :header-rows: 0
434 :stub-columns: 0
435 :widths: 1 1 2
436
437
438 - .. row 1
439
440 - __u32
441
442 - ``frame_sequence``
443
444 - The sequence number of the frame being received.
445
446
447
448.. _v4l2-event-src-change:
449
450.. flat-table:: struct v4l2_event_src_change
451 :header-rows: 0
452 :stub-columns: 0
453 :widths: 1 1 2
454
455
456 - .. row 1
457
458 - __u32
459
460 - ``changes``
461
462 - A bitmask that tells what has changed. See
463 :ref:`src-changes-flags`.
464
465
466
467.. _v4l2-event-motion-det:
468
469.. flat-table:: struct v4l2_event_motion_det
470 :header-rows: 0
471 :stub-columns: 0
472 :widths: 1 1 2
473
474
475 - .. row 1
476
477 - __u32
478
479 - ``flags``
480
481 - Currently only one flag is available: if
482 ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` is set, then the
483 ``frame_sequence`` field is valid, otherwise that field should be
484 ignored.
485
486 - .. row 2
487
488 - __u32
489
490 - ``frame_sequence``
491
492 - The sequence number of the frame being received. Only valid if the
493 ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` flag was set.
494
495 - .. row 3
496
497 - __u32
498
499 - ``region_mask``
500
501 - The bitmask of the regions that reported motion. There is at least
502 one region. If this field is 0, then no motion was detected at
503 all. If there is no ``V4L2_CID_DETECT_MD_REGION_GRID`` control
504 (see :ref:`detect-controls`) to assign a different region to
505 each cell in the motion detection grid, then that all cells are
506 automatically assigned to the default region 0.
507
508
509
510.. _ctrl-changes-flags:
511
512.. flat-table:: Control Changes
513 :header-rows: 0
514 :stub-columns: 0
515 :widths: 3 1 4
516
517
518 - .. row 1
519
520 - ``V4L2_EVENT_CTRL_CH_VALUE``
521
522 - 0x0001
523
524 - This control event was triggered because the value of the control
525 changed. Special cases: Volatile controls do no generate this
526 event; If a control has the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE``
527 flag set, then this event is sent as well, regardless its value.
528
529 - .. row 2
530
531 - ``V4L2_EVENT_CTRL_CH_FLAGS``
532
533 - 0x0002
534
535 - This control event was triggered because the control flags
536 changed.
537
538 - .. row 3
539
540 - ``V4L2_EVENT_CTRL_CH_RANGE``
541
542 - 0x0004
543
544 - This control event was triggered because the minimum, maximum,
545 step or the default value of the control changed.
546
547
548
549.. _src-changes-flags:
550
551.. flat-table:: Source Changes
552 :header-rows: 0
553 :stub-columns: 0
554 :widths: 3 1 4
555
556
557 - .. row 1
558
559 - ``V4L2_EVENT_SRC_CH_RESOLUTION``
560
561 - 0x0001
562
563 - This event gets triggered when a resolution change is detected at
564 an input. This can come from an input connector or from a video
565 decoder.
566
567
568Return Value
569============
570
571On success 0 is returned, on error -1 and the ``errno`` variable is set
572appropriately. The generic error codes are described at the
573:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst b/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst
new file mode 100644
index 000000000000..6e05957013bb
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst
@@ -0,0 +1,252 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_DV_TIMINGS_CAP:
4
5*********************************************************
6ioctl VIDIOC_DV_TIMINGS_CAP, VIDIOC_SUBDEV_DV_TIMINGS_CAP
7*********************************************************
8
9Name
10====
11
12VIDIOC_DV_TIMINGS_CAP - VIDIOC_SUBDEV_DV_TIMINGS_CAP - The capabilities of the Digital Video receiver/transmitter
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_dv_timings_cap *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_DV_TIMINGS_CAP, VIDIOC_SUBDEV_DV_TIMINGS_CAP
29
30``argp``
31
32
33Description
34===========
35
36To query the capabilities of the DV receiver/transmitter applications
37initialize the ``pad`` field to 0, zero the reserved array of struct
38:ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` and call the
39``VIDIOC_DV_TIMINGS_CAP`` ioctl on a video node and the driver will fill
40in the structure.
41
42.. note:: Drivers may return different values after
43 switching the video input or output.
44
45When implemented by the driver DV capabilities of subdevices can be
46queried by calling the ``VIDIOC_SUBDEV_DV_TIMINGS_CAP`` ioctl directly
47on a subdevice node. The capabilities are specific to inputs (for DV
48receivers) or outputs (for DV transmitters), applications must specify
49the desired pad number in the struct
50:ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` ``pad`` field and
51zero the ``reserved`` array. Attempts to query capabilities on a pad
52that doesn't support them will return an ``EINVAL`` error code.
53
54
55.. _v4l2-bt-timings-cap:
56
57.. flat-table:: struct v4l2_bt_timings_cap
58 :header-rows: 0
59 :stub-columns: 0
60 :widths: 1 1 2
61
62
63 - .. row 1
64
65 - __u32
66
67 - ``min_width``
68
69 - Minimum width of the active video in pixels.
70
71 - .. row 2
72
73 - __u32
74
75 - ``max_width``
76
77 - Maximum width of the active video in pixels.
78
79 - .. row 3
80
81 - __u32
82
83 - ``min_height``
84
85 - Minimum height of the active video in lines.
86
87 - .. row 4
88
89 - __u32
90
91 - ``max_height``
92
93 - Maximum height of the active video in lines.
94
95 - .. row 5
96
97 - __u64
98
99 - ``min_pixelclock``
100
101 - Minimum pixelclock frequency in Hz.
102
103 - .. row 6
104
105 - __u64
106
107 - ``max_pixelclock``
108
109 - Maximum pixelclock frequency in Hz.
110
111 - .. row 7
112
113 - __u32
114
115 - ``standards``
116
117 - The video standard(s) supported by the hardware. See
118 :ref:`dv-bt-standards` for a list of standards.
119
120 - .. row 8
121
122 - __u32
123
124 - ``capabilities``
125
126 - Several flags giving more information about the capabilities. See
127 :ref:`dv-bt-cap-capabilities` for a description of the flags.
128
129 - .. row 9
130
131 - __u32
132
133 - ``reserved``\ [16]
134
135 - Reserved for future extensions. Drivers must set the array to
136 zero.
137
138
139
140.. _v4l2-dv-timings-cap:
141
142.. flat-table:: struct v4l2_dv_timings_cap
143 :header-rows: 0
144 :stub-columns: 0
145 :widths: 1 1 2 1
146
147
148 - .. row 1
149
150 - __u32
151
152 - ``type``
153
154 - Type of DV timings as listed in :ref:`dv-timing-types`.
155
156 - .. row 2
157
158 - __u32
159
160 - ``pad``
161
162 - Pad number as reported by the media controller API. This field is
163 only used when operating on a subdevice node. When operating on a
164 video node applications must set this field to zero.
165
166 - .. row 3
167
168 - __u32
169
170 - ``reserved``\ [2]
171
172 - Reserved for future extensions. Drivers and applications must set
173 the array to zero.
174
175 - .. row 4
176
177 - union
178
179 -
180 -
181
182 - .. row 5
183
184 -
185 - struct :ref:`v4l2_bt_timings_cap <v4l2-bt-timings-cap>`
186
187 - ``bt``
188
189 - BT.656/1120 timings capabilities of the hardware.
190
191 - .. row 6
192
193 -
194 - __u32
195
196 - ``raw_data``\ [32]
197
198 -
199
200
201
202.. _dv-bt-cap-capabilities:
203
204.. flat-table:: DV BT Timing capabilities
205 :header-rows: 0
206 :stub-columns: 0
207
208
209 - .. row 1
210
211 - Flag
212
213 - Description
214
215 - .. row 2
216
217 -
218 -
219
220 - .. row 3
221
222 - ``V4L2_DV_BT_CAP_INTERLACED``
223
224 - Interlaced formats are supported.
225
226 - .. row 4
227
228 - ``V4L2_DV_BT_CAP_PROGRESSIVE``
229
230 - Progressive formats are supported.
231
232 - .. row 5
233
234 - ``V4L2_DV_BT_CAP_REDUCED_BLANKING``
235
236 - CVT/GTF specific: the timings can make use of reduced blanking
237 (CVT) or the 'Secondary GTF' curve (GTF).
238
239 - .. row 6
240
241 - ``V4L2_DV_BT_CAP_CUSTOM``
242
243 - Can support non-standard timings, i.e. timings not belonging to
244 the standards set in the ``standards`` field.
245
246
247Return Value
248============
249
250On success 0 is returned, on error -1 and the ``errno`` variable is set
251appropriately. The generic error codes are described at the
252:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst
new file mode 100644
index 000000000000..69bd9b4e0e56
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst
@@ -0,0 +1,195 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENCODER_CMD:
4
5************************************************
6ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD
7************************************************
8
9Name
10====
11
12VIDIOC_ENCODER_CMD - VIDIOC_TRY_ENCODER_CMD - Execute an encoder command
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_encoder_cmd *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD
29
30``argp``
31
32
33Description
34===========
35
36These ioctls control an audio/video (usually MPEG-) encoder.
37``VIDIOC_ENCODER_CMD`` sends a command to the encoder,
38``VIDIOC_TRY_ENCODER_CMD`` can be used to try a command without actually
39executing it.
40
41To send a command applications must initialize all fields of a struct
42:ref:`v4l2_encoder_cmd <v4l2-encoder-cmd>` and call
43``VIDIOC_ENCODER_CMD`` or ``VIDIOC_TRY_ENCODER_CMD`` with a pointer to
44this structure.
45
46The ``cmd`` field must contain the command code. The ``flags`` field is
47currently only used by the STOP command and contains one bit: If the
48``V4L2_ENC_CMD_STOP_AT_GOP_END`` flag is set, encoding will continue
49until the end of the current *Group Of Pictures*, otherwise it will stop
50immediately.
51
52A :ref:`read() <func-read>` or :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
53call sends an implicit START command to the encoder if it has not been
54started yet. After a STOP command, :ref:`read() <func-read>` calls will read
55the remaining data buffered by the driver. When the buffer is empty,
56:ref:`read() <func-read>` will return zero and the next :ref:`read() <func-read>`
57call will restart the encoder.
58
59A :ref:`close() <func-close>` or :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
60call of a streaming file descriptor sends an implicit immediate STOP to
61the encoder, and all buffered data is discarded.
62
63These ioctls are optional, not all drivers may support them. They were
64introduced in Linux 2.6.21.
65
66
67.. _v4l2-encoder-cmd:
68
69.. flat-table:: struct v4l2_encoder_cmd
70 :header-rows: 0
71 :stub-columns: 0
72 :widths: 1 1 2
73
74
75 - .. row 1
76
77 - __u32
78
79 - ``cmd``
80
81 - The encoder command, see :ref:`encoder-cmds`.
82
83 - .. row 2
84
85 - __u32
86
87 - ``flags``
88
89 - Flags to go with the command, see :ref:`encoder-flags`. If no
90 flags are defined for this command, drivers and applications must
91 set this field to zero.
92
93 - .. row 3
94
95 - __u32
96
97 - ``data``\ [8]
98
99 - Reserved for future extensions. Drivers and applications must set
100 the array to zero.
101
102
103
104.. _encoder-cmds:
105
106.. flat-table:: Encoder Commands
107 :header-rows: 0
108 :stub-columns: 0
109 :widths: 3 1 4
110
111
112 - .. row 1
113
114 - ``V4L2_ENC_CMD_START``
115
116 - 0
117
118 - Start the encoder. When the encoder is already running or paused,
119 this command does nothing. No flags are defined for this command.
120
121 - .. row 2
122
123 - ``V4L2_ENC_CMD_STOP``
124
125 - 1
126
127 - Stop the encoder. When the ``V4L2_ENC_CMD_STOP_AT_GOP_END`` flag
128 is set, encoding will continue until the end of the current *Group
129 Of Pictures*, otherwise encoding will stop immediately. When the
130 encoder is already stopped, this command does nothing. mem2mem
131 encoders will send a ``V4L2_EVENT_EOS`` event when the last frame
132 has been encoded and all frames are ready to be dequeued and will
133 set the ``V4L2_BUF_FLAG_LAST`` buffer flag on the last buffer of
134 the capture queue to indicate there will be no new buffers
135 produced to dequeue. This buffer may be empty, indicated by the
136 driver setting the ``bytesused`` field to 0. Once the
137 ``V4L2_BUF_FLAG_LAST`` flag was set, the
138 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
139 but return an ``EPIPE`` error code.
140
141 - .. row 3
142
143 - ``V4L2_ENC_CMD_PAUSE``
144
145 - 2
146
147 - Pause the encoder. When the encoder has not been started yet, the
148 driver will return an ``EPERM`` error code. When the encoder is
149 already paused, this command does nothing. No flags are defined
150 for this command.
151
152 - .. row 4
153
154 - ``V4L2_ENC_CMD_RESUME``
155
156 - 3
157
158 - Resume encoding after a PAUSE command. When the encoder has not
159 been started yet, the driver will return an ``EPERM`` error code. When
160 the encoder is already running, this command does nothing. No
161 flags are defined for this command.
162
163
164
165.. _encoder-flags:
166
167.. flat-table:: Encoder Command Flags
168 :header-rows: 0
169 :stub-columns: 0
170 :widths: 3 1 4
171
172
173 - .. row 1
174
175 - ``V4L2_ENC_CMD_STOP_AT_GOP_END``
176
177 - 0x0001
178
179 - Stop encoding at the end of the current *Group Of Pictures*,
180 rather than immediately.
181
182
183Return Value
184============
185
186On success 0 is returned, on error -1 and the ``errno`` variable is set
187appropriately. The generic error codes are described at the
188:ref:`Generic Error Codes <gen-errors>` chapter.
189
190EINVAL
191 The ``cmd`` field is invalid.
192
193EPERM
194 The application sent a PAUSE or RESUME command when the encoder was
195 not running.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst b/Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst
new file mode 100644
index 000000000000..3ba75d3fb93c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst
@@ -0,0 +1,121 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUM_DV_TIMINGS:
4
5***********************************************************
6ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
7***********************************************************
8
9Name
10====
11
12VIDIOC_ENUM_DV_TIMINGS - VIDIOC_SUBDEV_ENUM_DV_TIMINGS - Enumerate supported Digital Video timings
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_enum_dv_timings *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
29
30``argp``
31
32
33Description
34===========
35
36While some DV receivers or transmitters support a wide range of timings,
37others support only a limited number of timings. With this ioctl
38applications can enumerate a list of known supported timings. Call
39:ref:`VIDIOC_DV_TIMINGS_CAP` to check if it
40also supports other standards or even custom timings that are not in
41this list.
42
43To query the available timings, applications initialize the ``index``
44field, set the ``pad`` field to 0, zero the reserved array of struct
45:ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>` and call the
46``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node with a pointer to this
47structure. Drivers fill the rest of the structure or return an ``EINVAL``
48error code when the index is out of bounds. To enumerate all supported
49DV timings, applications shall begin at index zero, incrementing by one
50until the driver returns ``EINVAL``.
51
52.. note:: Drivers may enumerate a different set of DV timings after
53 switching the video input or output.
54
55When implemented by the driver DV timings of subdevices can be queried
56by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
57subdevice node. The DV timings are specific to inputs (for DV receivers)
58or outputs (for DV transmitters), applications must specify the desired
59pad number in the struct
60:ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>` ``pad`` field.
61Attempts to enumerate timings on a pad that doesn't support them will
62return an ``EINVAL`` error code.
63
64
65.. _v4l2-enum-dv-timings:
66
67.. flat-table:: struct v4l2_enum_dv_timings
68 :header-rows: 0
69 :stub-columns: 0
70 :widths: 1 1 2
71
72
73 - .. row 1
74
75 - __u32
76
77 - ``index``
78
79 - Number of the DV timings, set by the application.
80
81 - .. row 2
82
83 - __u32
84
85 - ``pad``
86
87 - Pad number as reported by the media controller API. This field is
88 only used when operating on a subdevice node. When operating on a
89 video node applications must set this field to zero.
90
91 - .. row 3
92
93 - __u32
94
95 - ``reserved``\ [2]
96
97 - Reserved for future extensions. Drivers and applications must set
98 the array to zero.
99
100 - .. row 4
101
102 - struct :ref:`v4l2_dv_timings <v4l2-dv-timings>`
103
104 - ``timings``
105
106 - The timings.
107
108
109Return Value
110============
111
112On success 0 is returned, on error -1 and the ``errno`` variable is set
113appropriately. The generic error codes are described at the
114:ref:`Generic Error Codes <gen-errors>` chapter.
115
116EINVAL
117 The struct :ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>`
118 ``index`` is out of bounds or the ``pad`` number is invalid.
119
120ENODATA
121 Digital video presets are not supported for this input or output.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
new file mode 100644
index 000000000000..90996f69d6ae
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -0,0 +1,166 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUM_FMT:
4
5*********************
6ioctl VIDIOC_ENUM_FMT
7*********************
8
9Name
10====
11
12VIDIOC_ENUM_FMT - Enumerate image formats
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_fmtdesc *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUM_FMT
29
30``argp``
31
32
33Description
34===========
35
36To enumerate image formats applications initialize the ``type`` and
37``index`` field of struct :ref:`v4l2_fmtdesc <v4l2-fmtdesc>` and call
38the :ref:`VIDIOC_ENUM_FMT` ioctl with a pointer to this structure. Drivers
39fill the rest of the structure or return an ``EINVAL`` error code. All
40formats are enumerable by beginning at index zero and incrementing by
41one until ``EINVAL`` is returned.
42
43.. note:: After switching input or output the list of enumerated image
44 formats may be different.
45
46
47.. _v4l2-fmtdesc:
48
49.. flat-table:: struct v4l2_fmtdesc
50 :header-rows: 0
51 :stub-columns: 0
52 :widths: 1 1 2
53
54
55 - .. row 1
56
57 - __u32
58
59 - ``index``
60
61 - Number of the format in the enumeration, set by the application.
62 This is in no way related to the ``pixelformat`` field.
63
64 - .. row 2
65
66 - __u32
67
68 - ``type``
69
70 - Type of the data stream, set by the application. Only these types
71 are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``,
72 ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``,
73 ``V4L2_BUF_TYPE_VIDEO_OUTPUT``,
74 ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE`` and
75 ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
76
77 - .. row 3
78
79 - __u32
80
81 - ``flags``
82
83 - See :ref:`fmtdesc-flags`
84
85 - .. row 4
86
87 - __u8
88
89 - ``description``\ [32]
90
91 - Description of the format, a NUL-terminated ASCII string. This
92 information is intended for the user, for example: "YUV 4:2:2".
93
94 - .. row 5
95
96 - __u32
97
98 - ``pixelformat``
99
100 - The image format identifier. This is a four character code as
101 computed by the v4l2_fourcc() macro:
102
103 - .. row 6
104
105 - :cspan:`2`
106
107
108 .. _v4l2-fourcc:
109 .. code-block:: c
110
111 #define v4l2_fourcc(a,b,c,d) (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
112
113 Several image formats are already defined by this specification in
114 :ref:`pixfmt`.
115
116 .. attention:: These codes are not the same as those used
117 in the Windows world.
118
119 - .. row 7
120
121 - __u32
122
123 - ``reserved``\ [4]
124
125 - Reserved for future extensions. Drivers must set the array to
126 zero.
127
128
129
130.. _fmtdesc-flags:
131
132.. flat-table:: Image Format Description Flags
133 :header-rows: 0
134 :stub-columns: 0
135 :widths: 3 1 4
136
137
138 - .. row 1
139
140 - ``V4L2_FMT_FLAG_COMPRESSED``
141
142 - 0x0001
143
144 - This is a compressed format.
145
146 - .. row 2
147
148 - ``V4L2_FMT_FLAG_EMULATED``
149
150 - 0x0002
151
152 - This format is not native to the device but emulated through
153 software (usually libv4l2), where possible try to use a native
154 format instead for better performance.
155
156
157Return Value
158============
159
160On success 0 is returned, on error -1 and the ``errno`` variable is set
161appropriately. The generic error codes are described at the
162:ref:`Generic Error Codes <gen-errors>` chapter.
163
164EINVAL
165 The struct :ref:`v4l2_fmtdesc <v4l2-fmtdesc>` ``type`` is not
166 supported or the ``index`` is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst b/Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst
new file mode 100644
index 000000000000..ceae6003039e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst
@@ -0,0 +1,270 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUM_FRAMEINTERVALS:
4
5********************************
6ioctl VIDIOC_ENUM_FRAMEINTERVALS
7********************************
8
9Name
10====
11
12VIDIOC_ENUM_FRAMEINTERVALS - Enumerate frame intervals
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_frmivalenum *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUM_FRAMEINTERVALS
29
30``argp``
31 Pointer to a struct :ref:`v4l2_frmivalenum <v4l2-frmivalenum>`
32 structure that contains a pixel format and size and receives a frame
33 interval.
34
35
36Description
37===========
38
39This ioctl allows applications to enumerate all frame intervals that the
40device supports for the given pixel format and frame size.
41
42The supported pixel formats and frame sizes can be obtained by using the
43:ref:`VIDIOC_ENUM_FMT` and
44:ref:`VIDIOC_ENUM_FRAMESIZES` functions.
45
46The return value and the content of the ``v4l2_frmivalenum.type`` field
47depend on the type of frame intervals the device supports. Here are the
48semantics of the function for the different cases:
49
50- **Discrete:** The function returns success if the given index value
51 (zero-based) is valid. The application should increase the index by
52 one for each call until ``EINVAL`` is returned. The
53 `v4l2_frmivalenum.type` field is set to
54 `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the union only
55 the `discrete` member is valid.
56
57- **Step-wise:** The function returns success if the given index value
58 is zero and ``EINVAL`` for any other index value. The
59 ``v4l2_frmivalenum.type`` field is set to
60 ``V4L2_FRMIVAL_TYPE_STEPWISE`` by the driver. Of the union only the
61 ``stepwise`` member is valid.
62
63- **Continuous:** This is a special case of the step-wise type above.
64 The function returns success if the given index value is zero and
65 ``EINVAL`` for any other index value. The ``v4l2_frmivalenum.type``
66 field is set to ``V4L2_FRMIVAL_TYPE_CONTINUOUS`` by the driver. Of
67 the union only the ``stepwise`` member is valid and the ``step``
68 value is set to 1.
69
70When the application calls the function with index zero, it must check
71the ``type`` field to determine the type of frame interval enumeration
72the device supports. Only for the ``V4L2_FRMIVAL_TYPE_DISCRETE`` type
73does it make sense to increase the index value to receive more frame
74intervals.
75
76.. note:: The order in which the frame intervals are returned has no
77 special meaning. In particular does it not say anything about potential
78 default frame intervals.
79
80Applications can assume that the enumeration data does not change
81without any interaction from the application itself. This means that the
82enumeration data is consistent if the application does not perform any
83other ioctl calls while it runs the frame interval enumeration.
84
85.. note::
86
87 **Frame intervals and frame rates:** The V4L2 API uses frame
88 intervals instead of frame rates. Given the frame interval the frame
89 rate can be computed as follows:
90
91 ::
92
93 frame_rate = 1 / frame_interval
94
95
96Structs
97=======
98
99In the structs below, *IN* denotes a value that has to be filled in by
100the application, *OUT* denotes values that the driver fills in. The
101application should zero out all members except for the *IN* fields.
102
103
104.. _v4l2-frmival-stepwise:
105
106.. flat-table:: struct v4l2_frmival_stepwise
107 :header-rows: 0
108 :stub-columns: 0
109 :widths: 1 1 2
110
111
112 - .. row 1
113
114 - struct :ref:`v4l2_fract <v4l2-fract>`
115
116 - ``min``
117
118 - Minimum frame interval [s].
119
120 - .. row 2
121
122 - struct :ref:`v4l2_fract <v4l2-fract>`
123
124 - ``max``
125
126 - Maximum frame interval [s].
127
128 - .. row 3
129
130 - struct :ref:`v4l2_fract <v4l2-fract>`
131
132 - ``step``
133
134 - Frame interval step size [s].
135
136
137
138.. _v4l2-frmivalenum:
139
140.. flat-table:: struct v4l2_frmivalenum
141 :header-rows: 0
142 :stub-columns: 0
143
144
145 - .. row 1
146
147 - __u32
148
149 - ``index``
150
151 -
152 - IN: Index of the given frame interval in the enumeration.
153
154 - .. row 2
155
156 - __u32
157
158 - ``pixel_format``
159
160 -
161 - IN: Pixel format for which the frame intervals are enumerated.
162
163 - .. row 3
164
165 - __u32
166
167 - ``width``
168
169 -
170 - IN: Frame width for which the frame intervals are enumerated.
171
172 - .. row 4
173
174 - __u32
175
176 - ``height``
177
178 -
179 - IN: Frame height for which the frame intervals are enumerated.
180
181 - .. row 5
182
183 - __u32
184
185 - ``type``
186
187 -
188 - OUT: Frame interval type the device supports.
189
190 - .. row 6
191
192 - union
193
194 -
195 -
196 - OUT: Frame interval with the given index.
197
198 - .. row 7
199
200 -
201 - struct :ref:`v4l2_fract <v4l2-fract>`
202
203 - ``discrete``
204
205 - Frame interval [s].
206
207 - .. row 8
208
209 -
210 - struct :ref:`v4l2_frmival_stepwise <v4l2-frmival-stepwise>`
211
212 - ``stepwise``
213
214 -
215
216 - .. row 9
217
218 - __u32
219
220 - ``reserved[2]``
221
222 -
223 - Reserved space for future use. Must be zeroed by drivers and
224 applications.
225
226
227
228Enums
229=====
230
231
232.. _v4l2-frmivaltypes:
233
234.. flat-table:: enum v4l2_frmivaltypes
235 :header-rows: 0
236 :stub-columns: 0
237 :widths: 3 1 4
238
239
240 - .. row 1
241
242 - ``V4L2_FRMIVAL_TYPE_DISCRETE``
243
244 - 1
245
246 - Discrete frame interval.
247
248 - .. row 2
249
250 - ``V4L2_FRMIVAL_TYPE_CONTINUOUS``
251
252 - 2
253
254 - Continuous frame interval.
255
256 - .. row 3
257
258 - ``V4L2_FRMIVAL_TYPE_STEPWISE``
259
260 - 3
261
262 - Step-wise defined frame interval.
263
264
265Return Value
266============
267
268On success 0 is returned, on error -1 and the ``errno`` variable is set
269appropriately. The generic error codes are described at the
270:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst b/Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst
new file mode 100644
index 000000000000..8b268354d442
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst
@@ -0,0 +1,291 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUM_FRAMESIZES:
4
5****************************
6ioctl VIDIOC_ENUM_FRAMESIZES
7****************************
8
9Name
10====
11
12VIDIOC_ENUM_FRAMESIZES - Enumerate frame sizes
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_frmsizeenum *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUM_FRAMESIZES
29
30``argp``
31 Pointer to a struct :ref:`v4l2_frmsizeenum <v4l2-frmsizeenum>`
32 that contains an index and pixel format and receives a frame width
33 and height.
34
35
36Description
37===========
38
39This ioctl allows applications to enumerate all frame sizes (i. e. width
40and height in pixels) that the device supports for the given pixel
41format.
42
43The supported pixel formats can be obtained by using the
44:ref:`VIDIOC_ENUM_FMT` function.
45
46The return value and the content of the ``v4l2_frmsizeenum.type`` field
47depend on the type of frame sizes the device supports. Here are the
48semantics of the function for the different cases:
49
50- **Discrete:** The function returns success if the given index value
51 (zero-based) is valid. The application should increase the index by
52 one for each call until ``EINVAL`` is returned. The
53 ``v4l2_frmsizeenum.type`` field is set to
54 ``V4L2_FRMSIZE_TYPE_DISCRETE`` by the driver. Of the union only the
55 ``discrete`` member is valid.
56
57- **Step-wise:** The function returns success if the given index value
58 is zero and ``EINVAL`` for any other index value. The
59 ``v4l2_frmsizeenum.type`` field is set to
60 ``V4L2_FRMSIZE_TYPE_STEPWISE`` by the driver. Of the union only the
61 ``stepwise`` member is valid.
62
63- **Continuous:** This is a special case of the step-wise type above.
64 The function returns success if the given index value is zero and
65 ``EINVAL`` for any other index value. The ``v4l2_frmsizeenum.type``
66 field is set to ``V4L2_FRMSIZE_TYPE_CONTINUOUS`` by the driver. Of
67 the union only the ``stepwise`` member is valid and the
68 ``step_width`` and ``step_height`` values are set to 1.
69
70When the application calls the function with index zero, it must check
71the ``type`` field to determine the type of frame size enumeration the
72device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does
73it make sense to increase the index value to receive more frame sizes.
74
75.. note:: The order in which the frame sizes are returned has no special
76 meaning. In particular does it not say anything about potential default
77 format sizes.
78
79Applications can assume that the enumeration data does not change
80without any interaction from the application itself. This means that the
81enumeration data is consistent if the application does not perform any
82other ioctl calls while it runs the frame size enumeration.
83
84
85Structs
86=======
87
88In the structs below, *IN* denotes a value that has to be filled in by
89the application, *OUT* denotes values that the driver fills in. The
90application should zero out all members except for the *IN* fields.
91
92
93.. _v4l2-frmsize-discrete:
94
95.. flat-table:: struct v4l2_frmsize_discrete
96 :header-rows: 0
97 :stub-columns: 0
98 :widths: 1 1 2
99
100
101 - .. row 1
102
103 - __u32
104
105 - ``width``
106
107 - Width of the frame [pixel].
108
109 - .. row 2
110
111 - __u32
112
113 - ``height``
114
115 - Height of the frame [pixel].
116
117
118
119.. _v4l2-frmsize-stepwise:
120
121.. flat-table:: struct v4l2_frmsize_stepwise
122 :header-rows: 0
123 :stub-columns: 0
124 :widths: 1 1 2
125
126
127 - .. row 1
128
129 - __u32
130
131 - ``min_width``
132
133 - Minimum frame width [pixel].
134
135 - .. row 2
136
137 - __u32
138
139 - ``max_width``
140
141 - Maximum frame width [pixel].
142
143 - .. row 3
144
145 - __u32
146
147 - ``step_width``
148
149 - Frame width step size [pixel].
150
151 - .. row 4
152
153 - __u32
154
155 - ``min_height``
156
157 - Minimum frame height [pixel].
158
159 - .. row 5
160
161 - __u32
162
163 - ``max_height``
164
165 - Maximum frame height [pixel].
166
167 - .. row 6
168
169 - __u32
170
171 - ``step_height``
172
173 - Frame height step size [pixel].
174
175
176
177.. _v4l2-frmsizeenum:
178
179.. flat-table:: struct v4l2_frmsizeenum
180 :header-rows: 0
181 :stub-columns: 0
182
183
184 - .. row 1
185
186 - __u32
187
188 - ``index``
189
190 -
191 - IN: Index of the given frame size in the enumeration.
192
193 - .. row 2
194
195 - __u32
196
197 - ``pixel_format``
198
199 -
200 - IN: Pixel format for which the frame sizes are enumerated.
201
202 - .. row 3
203
204 - __u32
205
206 - ``type``
207
208 -
209 - OUT: Frame size type the device supports.
210
211 - .. row 4
212
213 - union
214
215 -
216 -
217 - OUT: Frame size with the given index.
218
219 - .. row 5
220
221 -
222 - struct :ref:`v4l2_frmsize_discrete <v4l2-frmsize-discrete>`
223
224 - ``discrete``
225
226 -
227
228 - .. row 6
229
230 -
231 - struct :ref:`v4l2_frmsize_stepwise <v4l2-frmsize-stepwise>`
232
233 - ``stepwise``
234
235 -
236
237 - .. row 7
238
239 - __u32
240
241 - ``reserved[2]``
242
243 -
244 - Reserved space for future use. Must be zeroed by drivers and
245 applications.
246
247
248
249Enums
250=====
251
252
253.. _v4l2-frmsizetypes:
254
255.. flat-table:: enum v4l2_frmsizetypes
256 :header-rows: 0
257 :stub-columns: 0
258 :widths: 3 1 4
259
260
261 - .. row 1
262
263 - ``V4L2_FRMSIZE_TYPE_DISCRETE``
264
265 - 1
266
267 - Discrete frame size.
268
269 - .. row 2
270
271 - ``V4L2_FRMSIZE_TYPE_CONTINUOUS``
272
273 - 2
274
275 - Continuous frame size.
276
277 - .. row 3
278
279 - ``V4L2_FRMSIZE_TYPE_STEPWISE``
280
281 - 3
282
283 - Step-wise defined frame size.
284
285
286Return Value
287============
288
289On success 0 is returned, on error -1 and the ``errno`` variable is set
290appropriately. The generic error codes are described at the
291:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
new file mode 100644
index 000000000000..00ab5e19cc1d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
@@ -0,0 +1,192 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUM_FREQ_BANDS:
4
5****************************
6ioctl VIDIOC_ENUM_FREQ_BANDS
7****************************
8
9Name
10====
11
12VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_frequency_band *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUM_FREQ_BANDS
29
30``argp``
31
32
33Description
34===========
35
36Enumerates the frequency bands that a tuner or modulator supports. To do
37this applications initialize the ``tuner``, ``type`` and ``index``
38fields, and zero out the ``reserved`` array of a struct
39:ref:`v4l2_frequency_band <v4l2-frequency-band>` and call the
40:ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
41
42This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
43of the corresponding tuner/modulator is set.
44
45
46.. _v4l2-frequency-band:
47
48.. flat-table:: struct v4l2_frequency_band
49 :header-rows: 0
50 :stub-columns: 0
51 :widths: 1 1 2 1 1
52
53
54 - .. row 1
55
56 - __u32
57
58 - ``tuner``
59
60 - The tuner or modulator index number. This is the same value as in
61 the struct :ref:`v4l2_input <v4l2-input>` ``tuner`` field and
62 the struct :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field, or
63 the struct :ref:`v4l2_output <v4l2-output>` ``modulator`` field
64 and the struct :ref:`v4l2_modulator <v4l2-modulator>` ``index``
65 field.
66
67 - .. row 2
68
69 - __u32
70
71 - ``type``
72
73 - The tuner type. This is the same value as in the struct
74 :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. The type must be
75 set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
76 to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
77 ``V4L2_TUNER_RADIO`` for modulators (currently only radio
78 modulators are supported). See :ref:`v4l2-tuner-type`
79
80 - .. row 3
81
82 - __u32
83
84 - ``index``
85
86 - Identifies the frequency band, set by the application.
87
88 - .. row 4
89
90 - __u32
91
92 - ``capability``
93
94 - :cspan:`2` The tuner/modulator capability flags for this
95 frequency band, see :ref:`tuner-capability`. The
96 ``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
97 be the same for all frequency bands of the selected
98 tuner/modulator. So either all bands have that capability set, or
99 none of them have that capability.
100
101 - .. row 5
102
103 - __u32
104
105 - ``rangelow``
106
107 - :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
108 if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
109 of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
110 ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
111
112 - .. row 6
113
114 - __u32
115
116 - ``rangehigh``
117
118 - :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
119 or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
120 units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
121 when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
122
123 - .. row 7
124
125 - __u32
126
127 - ``modulation``
128
129 - :cspan:`2` The supported modulation systems of this frequency
130 band. See :ref:`band-modulation`.
131
132 .. note:: Currently only one modulation system per frequency band
133 is supported. More work will need to be done if multiple
134 modulation systems are possible. Contact the linux-media
135 mailing list
136 (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
137 if you need such functionality.
138
139 - .. row 8
140
141 - __u32
142
143 - ``reserved``\ [9]
144
145 - Reserved for future extensions. Applications and drivers must set
146 the array to zero.
147
148
149
150.. _band-modulation:
151
152.. flat-table:: Band Modulation Systems
153 :header-rows: 0
154 :stub-columns: 0
155 :widths: 3 1 4
156
157
158 - .. row 1
159
160 - ``V4L2_BAND_MODULATION_VSB``
161
162 - 0x02
163
164 - Vestigial Sideband modulation, used for analog TV.
165
166 - .. row 2
167
168 - ``V4L2_BAND_MODULATION_FM``
169
170 - 0x04
171
172 - Frequency Modulation, commonly used for analog radio.
173
174 - .. row 3
175
176 - ``V4L2_BAND_MODULATION_AM``
177
178 - 0x08
179
180 - Amplitude Modulation, commonly used for analog radio.
181
182
183Return Value
184============
185
186On success 0 is returned, on error -1 and the ``errno`` variable is set
187appropriately. The generic error codes are described at the
188:ref:`Generic Error Codes <gen-errors>` chapter.
189
190EINVAL
191 The ``tuner`` or ``index`` is out of bounds or the ``type`` field is
192 wrong.
diff --git a/Documentation/media/uapi/v4l/vidioc-enumaudio.rst b/Documentation/media/uapi/v4l/vidioc-enumaudio.rst
new file mode 100644
index 000000000000..bfdc3533240d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enumaudio.rst
@@ -0,0 +1,56 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUMAUDIO:
4
5**********************
6ioctl VIDIOC_ENUMAUDIO
7**********************
8
9Name
10====
11
12VIDIOC_ENUMAUDIO - Enumerate audio inputs
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_audio *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUMAUDIO
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of an audio input applications initialize the
37``index`` field and zero out the ``reserved`` array of a struct
38:ref:`v4l2_audio <v4l2-audio>` and call the :ref:`VIDIOC_ENUMAUDIO`
39ioctl with a pointer to this structure. Drivers fill the rest of the
40structure or return an ``EINVAL`` error code when the index is out of
41bounds. To enumerate all audio inputs applications shall begin at index
42zero, incrementing by one until the driver returns ``EINVAL``.
43
44See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
45:ref:`v4l2_audio <v4l2-audio>`.
46
47
48Return Value
49============
50
51On success 0 is returned, on error -1 and the ``errno`` variable is set
52appropriately. The generic error codes are described at the
53:ref:`Generic Error Codes <gen-errors>` chapter.
54
55EINVAL
56 The number of the audio input is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-enumaudioout.rst b/Documentation/media/uapi/v4l/vidioc-enumaudioout.rst
new file mode 100644
index 000000000000..cde1db55834f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enumaudioout.rst
@@ -0,0 +1,59 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUMAUDOUT:
4
5***********************
6ioctl VIDIOC_ENUMAUDOUT
7***********************
8
9Name
10====
11
12VIDIOC_ENUMAUDOUT - Enumerate audio outputs
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_audioout *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUMAUDOUT
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of an audio output applications initialize the
37``index`` field and zero out the ``reserved`` array of a struct
38:ref:`v4l2_audioout <v4l2-audioout>` and call the ``VIDIOC_G_AUDOUT``
39ioctl with a pointer to this structure. Drivers fill the rest of the
40structure or return an ``EINVAL`` error code when the index is out of
41bounds. To enumerate all audio outputs applications shall begin at index
42zero, incrementing by one until the driver returns ``EINVAL``.
43
44.. note:: Connectors on a TV card to loop back the received audio signal
45 to a sound card are not audio outputs in this sense.
46
47See :ref:`VIDIOC_G_AUDIOout <VIDIOC_G_AUDOUT>` for a description of struct
48:ref:`v4l2_audioout <v4l2-audioout>`.
49
50
51Return Value
52============
53
54On success 0 is returned, on error -1 and the ``errno`` variable is set
55appropriately. The generic error codes are described at the
56:ref:`Generic Error Codes <gen-errors>` chapter.
57
58EINVAL
59 The number of the audio output is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-enuminput.rst b/Documentation/media/uapi/v4l/vidioc-enuminput.rst
new file mode 100644
index 000000000000..5060f54e3d18
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enuminput.rst
@@ -0,0 +1,367 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUMINPUT:
4
5**********************
6ioctl VIDIOC_ENUMINPUT
7**********************
8
9Name
10====
11
12VIDIOC_ENUMINPUT - Enumerate video inputs
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_input *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUMINPUT
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of a video input applications initialize the
37``index`` field of struct :ref:`v4l2_input <v4l2-input>` and call the
38:ref:`VIDIOC_ENUMINPUT` ioctl with a pointer to this structure. Drivers
39fill the rest of the structure or return an ``EINVAL`` error code when the
40index is out of bounds. To enumerate all inputs applications shall begin
41at index zero, incrementing by one until the driver returns ``EINVAL``.
42
43
44.. _v4l2-input:
45
46.. flat-table:: struct v4l2_input
47 :header-rows: 0
48 :stub-columns: 0
49 :widths: 1 1 2
50
51
52 - .. row 1
53
54 - __u32
55
56 - ``index``
57
58 - Identifies the input, set by the application.
59
60 - .. row 2
61
62 - __u8
63
64 - ``name``\ [32]
65
66 - Name of the video input, a NUL-terminated ASCII string, for
67 example: "Vin (Composite 2)". This information is intended for the
68 user, preferably the connector label on the device itself.
69
70 - .. row 3
71
72 - __u32
73
74 - ``type``
75
76 - Type of the input, see :ref:`input-type`.
77
78 - .. row 4
79
80 - __u32
81
82 - ``audioset``
83
84 - Drivers can enumerate up to 32 video and audio inputs. This field
85 shows which audio inputs were selectable as audio source if this
86 was the currently selected video input. It is a bit mask. The LSB
87 corresponds to audio input 0, the MSB to input 31. Any number of
88 bits can be set, or none.
89
90 When the driver does not enumerate audio inputs no bits must be
91 set. Applications shall not interpret this as lack of audio
92 support. Some drivers automatically select audio sources and do
93 not enumerate them since there is no choice anyway.
94
95 For details on audio inputs and how to select the current input
96 see :ref:`audio`.
97
98 - .. row 5
99
100 - __u32
101
102 - ``tuner``
103
104 - Capture devices can have zero or more tuners (RF demodulators).
105 When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
106 RF connector and this field identifies the tuner. It corresponds
107 to struct :ref:`v4l2_tuner <v4l2-tuner>` field ``index``. For
108 details on tuners see :ref:`tuner`.
109
110 - .. row 6
111
112 - :ref:`v4l2_std_id <v4l2-std-id>`
113
114 - ``std``
115
116 - Every video input supports one or more different video standards.
117 This field is a set of all supported standards. For details on
118 video standards and how to switch see :ref:`standard`.
119
120 - .. row 7
121
122 - __u32
123
124 - ``status``
125
126 - This field provides status information about the input. See
127 :ref:`input-status` for flags. With the exception of the sensor
128 orientation bits ``status`` is only valid when this is the current
129 input.
130
131 - .. row 8
132
133 - __u32
134
135 - ``capabilities``
136
137 - This field provides capabilities for the input. See
138 :ref:`input-capabilities` for flags.
139
140 - .. row 9
141
142 - __u32
143
144 - ``reserved``\ [3]
145
146 - Reserved for future extensions. Drivers must set the array to
147 zero.
148
149
150
151.. _input-type:
152
153.. flat-table:: Input Types
154 :header-rows: 0
155 :stub-columns: 0
156 :widths: 3 1 4
157
158
159 - .. row 1
160
161 - ``V4L2_INPUT_TYPE_TUNER``
162
163 - 1
164
165 - This input uses a tuner (RF demodulator).
166
167 - .. row 2
168
169 - ``V4L2_INPUT_TYPE_CAMERA``
170
171 - 2
172
173 - Analog baseband input, for example CVBS / Composite Video,
174 S-Video, RGB.
175
176
177
178.. _input-status:
179
180.. flat-table:: Input Status Flags
181 :header-rows: 0
182 :stub-columns: 0
183
184
185 - .. row 1
186
187 - :cspan:`2` General
188
189 - .. row 2
190
191 - ``V4L2_IN_ST_NO_POWER``
192
193 - 0x00000001
194
195 - Attached device is off.
196
197 - .. row 3
198
199 - ``V4L2_IN_ST_NO_SIGNAL``
200
201 - 0x00000002
202
203 -
204
205 - .. row 4
206
207 - ``V4L2_IN_ST_NO_COLOR``
208
209 - 0x00000004
210
211 - The hardware supports color decoding, but does not detect color
212 modulation in the signal.
213
214 - .. row 5
215
216 - :cspan:`2` Sensor Orientation
217
218 - .. row 6
219
220 - ``V4L2_IN_ST_HFLIP``
221
222 - 0x00000010
223
224 - The input is connected to a device that produces a signal that is
225 flipped horizontally and does not correct this before passing the
226 signal to userspace.
227
228 - .. row 7
229
230 - ``V4L2_IN_ST_VFLIP``
231
232 - 0x00000020
233
234 - The input is connected to a device that produces a signal that is
235 flipped vertically and does not correct this before passing the
236 signal to userspace.
237 .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
238
239 - .. row 8
240
241 - :cspan:`2` Analog Video
242
243 - .. row 9
244
245 - ``V4L2_IN_ST_NO_H_LOCK``
246
247 - 0x00000100
248
249 - No horizontal sync lock.
250
251 - .. row 10
252
253 - ``V4L2_IN_ST_COLOR_KILL``
254
255 - 0x00000200
256
257 - A color killer circuit automatically disables color decoding when
258 it detects no color modulation. When this flag is set the color
259 killer is enabled *and* has shut off color decoding.
260
261 - .. row 11
262
263 - :cspan:`2` Digital Video
264
265 - .. row 12
266
267 - ``V4L2_IN_ST_NO_SYNC``
268
269 - 0x00010000
270
271 - No synchronization lock.
272
273 - .. row 13
274
275 - ``V4L2_IN_ST_NO_EQU``
276
277 - 0x00020000
278
279 - No equalizer lock.
280
281 - .. row 14
282
283 - ``V4L2_IN_ST_NO_CARRIER``
284
285 - 0x00040000
286
287 - Carrier recovery failed.
288
289 - .. row 15
290
291 - :cspan:`2` VCR and Set-Top Box
292
293 - .. row 16
294
295 - ``V4L2_IN_ST_MACROVISION``
296
297 - 0x01000000
298
299 - Macrovision is an analog copy prevention system mangling the video
300 signal to confuse video recorders. When this flag is set
301 Macrovision has been detected.
302
303 - .. row 17
304
305 - ``V4L2_IN_ST_NO_ACCESS``
306
307 - 0x02000000
308
309 - Conditional access denied.
310
311 - .. row 18
312
313 - ``V4L2_IN_ST_VTR``
314
315 - 0x04000000
316
317 - VTR time constant. [?]
318
319
320
321.. _input-capabilities:
322
323.. flat-table:: Input capabilities
324 :header-rows: 0
325 :stub-columns: 0
326 :widths: 3 1 4
327
328
329 - .. row 1
330
331 - ``V4L2_IN_CAP_DV_TIMINGS``
332
333 - 0x00000002
334
335 - This input supports setting video timings by using
336 VIDIOC_S_DV_TIMINGS.
337
338 - .. row 2
339
340 - ``V4L2_IN_CAP_STD``
341
342 - 0x00000004
343
344 - This input supports setting the TV standard by using
345 VIDIOC_S_STD.
346
347 - .. row 3
348
349 - ``V4L2_IN_CAP_NATIVE_SIZE``
350
351 - 0x00000008
352
353 - This input supports setting the native size using the
354 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
355 :ref:`v4l2-selections-common`.
356
357
358Return Value
359============
360
361On success 0 is returned, on error -1 and the ``errno`` variable is set
362appropriately. The generic error codes are described at the
363:ref:`Generic Error Codes <gen-errors>` chapter.
364
365EINVAL
366 The struct :ref:`v4l2_input <v4l2-input>` ``index`` is out of
367 bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-enumoutput.rst b/Documentation/media/uapi/v4l/vidioc-enumoutput.rst
new file mode 100644
index 000000000000..82fc9d3b237f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enumoutput.rst
@@ -0,0 +1,222 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUMOUTPUT:
4
5***********************
6ioctl VIDIOC_ENUMOUTPUT
7***********************
8
9Name
10====
11
12VIDIOC_ENUMOUTPUT - Enumerate video outputs
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_output *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUMOUTPUT
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of a video outputs applications initialize the
37``index`` field of struct :ref:`v4l2_output <v4l2-output>` and call
38the :ref:`VIDIOC_ENUMOUTPUT` ioctl with a pointer to this structure.
39Drivers fill the rest of the structure or return an ``EINVAL`` error code
40when the index is out of bounds. To enumerate all outputs applications
41shall begin at index zero, incrementing by one until the driver returns
42EINVAL.
43
44
45.. _v4l2-output:
46
47.. flat-table:: struct v4l2_output
48 :header-rows: 0
49 :stub-columns: 0
50 :widths: 1 1 2
51
52
53 - .. row 1
54
55 - __u32
56
57 - ``index``
58
59 - Identifies the output, set by the application.
60
61 - .. row 2
62
63 - __u8
64
65 - ``name``\ [32]
66
67 - Name of the video output, a NUL-terminated ASCII string, for
68 example: "Vout". This information is intended for the user,
69 preferably the connector label on the device itself.
70
71 - .. row 3
72
73 - __u32
74
75 - ``type``
76
77 - Type of the output, see :ref:`output-type`.
78
79 - .. row 4
80
81 - __u32
82
83 - ``audioset``
84
85 - Drivers can enumerate up to 32 video and audio outputs. This field
86 shows which audio outputs were selectable as the current output if
87 this was the currently selected video output. It is a bit mask.
88 The LSB corresponds to audio output 0, the MSB to output 31. Any
89 number of bits can be set, or none.
90
91 When the driver does not enumerate audio outputs no bits must be
92 set. Applications shall not interpret this as lack of audio
93 support. Drivers may automatically select audio outputs without
94 enumerating them.
95
96 For details on audio outputs and how to select the current output
97 see :ref:`audio`.
98
99 - .. row 5
100
101 - __u32
102
103 - ``modulator``
104
105 - Output devices can have zero or more RF modulators. When the
106 ``type`` is ``V4L2_OUTPUT_TYPE_MODULATOR`` this is an RF connector
107 and this field identifies the modulator. It corresponds to struct
108 :ref:`v4l2_modulator <v4l2-modulator>` field ``index``. For
109 details on modulators see :ref:`tuner`.
110
111 - .. row 6
112
113 - :ref:`v4l2_std_id <v4l2-std-id>`
114
115 - ``std``
116
117 - Every video output supports one or more different video standards.
118 This field is a set of all supported standards. For details on
119 video standards and how to switch see :ref:`standard`.
120
121 - .. row 7
122
123 - __u32
124
125 - ``capabilities``
126
127 - This field provides capabilities for the output. See
128 :ref:`output-capabilities` for flags.
129
130 - .. row 8
131
132 - __u32
133
134 - ``reserved``\ [3]
135
136 - Reserved for future extensions. Drivers must set the array to
137 zero.
138
139
140
141.. _output-type:
142
143.. flat-table:: Output Type
144 :header-rows: 0
145 :stub-columns: 0
146 :widths: 3 1 4
147
148
149 - .. row 1
150
151 - ``V4L2_OUTPUT_TYPE_MODULATOR``
152
153 - 1
154
155 - This output is an analog TV modulator.
156
157 - .. row 2
158
159 - ``V4L2_OUTPUT_TYPE_ANALOG``
160
161 - 2
162
163 - Analog baseband output, for example Composite / CVBS, S-Video,
164 RGB.
165
166 - .. row 3
167
168 - ``V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY``
169
170 - 3
171
172 - [?]
173
174
175
176.. _output-capabilities:
177
178.. flat-table:: Output capabilities
179 :header-rows: 0
180 :stub-columns: 0
181 :widths: 3 1 4
182
183
184 - .. row 1
185
186 - ``V4L2_OUT_CAP_DV_TIMINGS``
187
188 - 0x00000002
189
190 - This output supports setting video timings by using
191 VIDIOC_S_DV_TIMINGS.
192
193 - .. row 2
194
195 - ``V4L2_OUT_CAP_STD``
196
197 - 0x00000004
198
199 - This output supports setting the TV standard by using
200 VIDIOC_S_STD.
201
202 - .. row 3
203
204 - ``V4L2_OUT_CAP_NATIVE_SIZE``
205
206 - 0x00000008
207
208 - This output supports setting the native size using the
209 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
210 :ref:`v4l2-selections-common`.
211
212
213Return Value
214============
215
216On success 0 is returned, on error -1 and the ``errno`` variable is set
217appropriately. The generic error codes are described at the
218:ref:`Generic Error Codes <gen-errors>` chapter.
219
220EINVAL
221 The struct :ref:`v4l2_output <v4l2-output>` ``index`` is out of
222 bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-enumstd.rst b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
new file mode 100644
index 000000000000..6699b26cdeb4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
@@ -0,0 +1,442 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_ENUMSTD:
4
5********************
6ioctl VIDIOC_ENUMSTD
7********************
8
9Name
10====
11
12VIDIOC_ENUMSTD - Enumerate supported video standards
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_standard *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_ENUMSTD
29
30``argp``
31
32
33Description
34===========
35
36To query the attributes of a video standard, especially a custom (driver
37defined) one, applications initialize the ``index`` field of struct
38:ref:`v4l2_standard <v4l2-standard>` and call the :ref:`VIDIOC_ENUMSTD`
39ioctl with a pointer to this structure. Drivers fill the rest of the
40structure or return an ``EINVAL`` error code when the index is out of
41bounds. To enumerate all standards applications shall begin at index
42zero, incrementing by one until the driver returns ``EINVAL``. Drivers may
43enumerate a different set of standards after switching the video input
44or output. [#f1]_
45
46
47.. _v4l2-standard:
48
49.. flat-table:: struct v4l2_standard
50 :header-rows: 0
51 :stub-columns: 0
52 :widths: 1 1 2
53
54
55 - .. row 1
56
57 - __u32
58
59 - ``index``
60
61 - Number of the video standard, set by the application.
62
63 - .. row 2
64
65 - :ref:`v4l2_std_id <v4l2-std-id>`
66
67 - ``id``
68
69 - The bits in this field identify the standard as one of the common
70 standards listed in :ref:`v4l2-std-id`, or if bits 32 to 63 are
71 set as custom standards. Multiple bits can be set if the hardware
72 does not distinguish between these standards, however separate
73 indices do not indicate the opposite. The ``id`` must be unique.
74 No other enumerated :ref:`struct v4l2_standard <v4l2-standard>` structure,
75 for this input or output anyway, can contain the same set of bits.
76
77 - .. row 3
78
79 - __u8
80
81 - ``name``\ [24]
82
83 - Name of the standard, a NUL-terminated ASCII string, for example:
84 "PAL-B/G", "NTSC Japan". This information is intended for the
85 user.
86
87 - .. row 4
88
89 - struct :ref:`v4l2_fract <v4l2-fract>`
90
91 - ``frameperiod``
92
93 - The frame period (not field period) is numerator / denominator.
94 For example M/NTSC has a frame period of 1001 / 30000 seconds.
95
96 - .. row 5
97
98 - __u32
99
100 - ``framelines``
101
102 - Total lines per frame including blanking, e. g. 625 for B/PAL.
103
104 - .. row 6
105
106 - __u32
107
108 - ``reserved``\ [4]
109
110 - Reserved for future extensions. Drivers must set the array to
111 zero.
112
113
114
115.. _v4l2-fract:
116
117.. flat-table:: struct v4l2_fract
118 :header-rows: 0
119 :stub-columns: 0
120 :widths: 1 1 2
121
122
123 - .. row 1
124
125 - __u32
126
127 - ``numerator``
128
129 -
130
131 - .. row 2
132
133 - __u32
134
135 - ``denominator``
136
137 -
138
139
140
141.. _v4l2-std-id:
142
143.. flat-table:: typedef v4l2_std_id
144 :header-rows: 0
145 :stub-columns: 0
146 :widths: 1 1 2
147
148
149 - .. row 1
150
151 - __u64
152
153 - ``v4l2_std_id``
154
155 - This type is a set, each bit representing another video standard
156 as listed below and in :ref:`video-standards`. The 32 most
157 significant bits are reserved for custom (driver defined) video
158 standards.
159
160
161
162.. code-block:: c
163
164 #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
165 #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
166 #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
167 #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
168 #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
169 #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
170 #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
171 #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
172
173 #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
174 #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
175 #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
176 #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
177
178``V4L2_STD_PAL_60`` is a hybrid standard with 525 lines, 60 Hz refresh
179rate, and PAL color modulation with a 4.43 MHz color subcarrier. Some
180PAL video recorders can play back NTSC tapes in this mode for display on
181a 50/60 Hz agnostic PAL TV.
182
183
184.. code-block:: c
185
186 #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
187 #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
188 #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
189
190``V4L2_STD_NTSC_443`` is a hybrid standard with 525 lines, 60 Hz refresh
191rate, and NTSC color modulation with a 4.43 MHz color subcarrier.
192
193
194.. code-block:: c
195
196 #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
197
198 #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
199 #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
200 #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
201 #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
202 #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
203 #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
204 #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
205 #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
206
207 /* ATSC/HDTV */
208 #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
209 #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
210
211``V4L2_STD_ATSC_8_VSB`` and ``V4L2_STD_ATSC_16_VSB`` are U.S.
212terrestrial digital TV standards. Presently the V4L2 API does not
213support digital TV. See also the Linux DVB API at
214`https://linuxtv.org <https://linuxtv.org>`__.
215
216
217.. code-block:: c
218
219 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |
220 V4L2_STD_PAL_B1 |
221 V4L2_STD_PAL_G)
222 #define V4L2_STD_B (V4L2_STD_PAL_B |
223 V4L2_STD_PAL_B1 |
224 V4L2_STD_SECAM_B)
225 #define V4L2_STD_GH (V4L2_STD_PAL_G |
226 V4L2_STD_PAL_H |
227 V4L2_STD_SECAM_G |
228 V4L2_STD_SECAM_H)
229 #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |
230 V4L2_STD_PAL_D1 |
231 V4L2_STD_PAL_K)
232 #define V4L2_STD_PAL (V4L2_STD_PAL_BG |
233 V4L2_STD_PAL_DK |
234 V4L2_STD_PAL_H |
235 V4L2_STD_PAL_I)
236 #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |
237 V4L2_STD_NTSC_M_JP |
238 V4L2_STD_NTSC_M_KR)
239 #define V4L2_STD_MN (V4L2_STD_PAL_M |
240 V4L2_STD_PAL_N |
241 V4L2_STD_PAL_Nc |
242 V4L2_STD_NTSC)
243 #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |
244 V4L2_STD_SECAM_K |
245 V4L2_STD_SECAM_K1)
246 #define V4L2_STD_DK (V4L2_STD_PAL_DK |
247 V4L2_STD_SECAM_DK)
248
249 #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |
250 V4L2_STD_SECAM_G |
251 V4L2_STD_SECAM_H |
252 V4L2_STD_SECAM_DK |
253 V4L2_STD_SECAM_L |
254 V4L2_STD_SECAM_LC)
255
256 #define V4L2_STD_525_60 (V4L2_STD_PAL_M |
257 V4L2_STD_PAL_60 |
258 V4L2_STD_NTSC |
259 V4L2_STD_NTSC_443)
260 #define V4L2_STD_625_50 (V4L2_STD_PAL |
261 V4L2_STD_PAL_N |
262 V4L2_STD_PAL_Nc |
263 V4L2_STD_SECAM)
264
265 #define V4L2_STD_UNKNOWN 0
266 #define V4L2_STD_ALL (V4L2_STD_525_60 |
267 V4L2_STD_625_50)
268
269
270.. _video-standards:
271
272.. flat-table:: Video Standards (based on [])
273 :header-rows: 1
274 :stub-columns: 0
275
276
277 - .. row 1
278
279 - Characteristics
280
281 - M/NTSC [#f2]_
282
283 - M/PAL
284
285 - N/PAL [#f3]_
286
287 - B, B1, G/PAL
288
289 - D, D1, K/PAL
290
291 - H/PAL
292
293 - I/PAL
294
295 - B, G/SECAM
296
297 - D, K/SECAM
298
299 - K1/SECAM
300
301 - L/SECAM
302
303 - .. row 2
304
305 - Frame lines
306
307 - :cspan:`1` 525
308
309 - :cspan:`9` 625
310
311 - .. row 3
312
313 - Frame period (s)
314
315 - :cspan:`1` 1001/30000
316
317 - :cspan:`9` 1/25
318
319 - .. row 4
320
321 - Chrominance sub-carrier frequency (Hz)
322
323 - 3579545 ± 10
324
325 - 3579611.49 ± 10
326
327 - 4433618.75 ± 5 (3582056.25 ± 5)
328
329 - :cspan:`3` 4433618.75 ± 5
330
331 - 4433618.75 ± 1
332
333 - :cspan:`3` f\ :sub:`OR` = 4406250 ± 2000, f\ :sub:`OB` = 4250000
334 ± 2000
335
336 - .. row 5
337
338 - Nominal radio-frequency channel bandwidth (MHz)
339
340 - 6
341
342 - 6
343
344 - 6
345
346 - B: 7; B1, G: 8
347
348 - 8
349
350 - 8
351
352 - 8
353
354 - 8
355
356 - 8
357
358 - 8
359
360 - 8
361
362 - .. row 6
363
364 - Sound carrier relative to vision carrier (MHz)
365
366 - + 4.5
367
368 - + 4.5
369
370 - + 4.5
371
372 - + 5.5 ± 0.001 [#f4]_ [#f5]_ [#f6]_ [#f7]_
373
374 - + 6.5 ± 0.001
375
376 - + 5.5
377
378 - + 5.9996 ± 0.0005
379
380 - + 5.5 ± 0.001
381
382 - + 6.5 ± 0.001
383
384 - + 6.5
385
386 - + 6.5 [#f8]_
387
388
389Return Value
390============
391
392On success 0 is returned, on error -1 and the ``errno`` variable is set
393appropriately. The generic error codes are described at the
394:ref:`Generic Error Codes <gen-errors>` chapter.
395
396EINVAL
397 The struct :ref:`v4l2_standard <v4l2-standard>` ``index`` is out
398 of bounds.
399
400ENODATA
401 Standard video timings are not supported for this input or output.
402
403.. [#f1]
404 The supported standards may overlap and we need an unambiguous set to
405 find the current standard returned by :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`.
406
407.. [#f2]
408 Japan uses a standard similar to M/NTSC (V4L2_STD_NTSC_M_JP).
409
410.. [#f3]
411 The values in brackets apply to the combination N/PAL a.k.a.
412 N\ :sub:`C` used in Argentina (V4L2_STD_PAL_Nc).
413
414.. [#f4]
415 In the Federal Republic of Germany, Austria, Italy, the Netherlands,
416 Slovakia and Switzerland a system of two sound carriers is used, the
417 frequency of the second carrier being 242.1875 kHz above the
418 frequency of the first sound carrier. For stereophonic sound
419 transmissions a similar system is used in Australia.
420
421.. [#f5]
422 New Zealand uses a sound carrier displaced 5.4996 ± 0.0005 MHz from
423 the vision carrier.
424
425.. [#f6]
426 In Denmark, Finland, New Zealand, Sweden and Spain a system of two
427 sound carriers is used. In Iceland, Norway and Poland the same system
428 is being introduced. The second carrier is 5.85 MHz above the vision
429 carrier and is DQPSK modulated with 728 kbit/s sound and data
430 multiplex. (NICAM system)
431
432.. [#f7]
433 In the United Kingdom, a system of two sound carriers is used. The
434 second sound carrier is 6.552 MHz above the vision carrier and is
435 DQPSK modulated with a 728 kbit/s sound and data multiplex able to
436 carry two sound channels. (NICAM system)
437
438.. [#f8]
439 In France, a digital carrier 5.85 MHz away from the vision carrier
440 may be used in addition to the main sound carrier. It is modulated in
441 differentially encoded QPSK with a 728 kbit/s sound and data
442 multiplexer capable of carrying two sound channels. (NICAM system)
diff --git a/Documentation/media/uapi/v4l/vidioc-expbuf.rst b/Documentation/media/uapi/v4l/vidioc-expbuf.rst
new file mode 100644
index 000000000000..ded708e647fa
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-expbuf.rst
@@ -0,0 +1,197 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_EXPBUF:
4
5*******************
6ioctl VIDIOC_EXPBUF
7*******************
8
9Name
10====
11
12VIDIOC_EXPBUF - Export a buffer as a DMABUF file descriptor.
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_exportbuffer *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_EXPBUF
29
30``argp``
31
32
33Description
34===========
35
36This ioctl is an extension to the :ref:`memory mapping <mmap>` I/O
37method, therefore it is available only for ``V4L2_MEMORY_MMAP`` buffers.
38It can be used to export a buffer as a DMABUF file at any time after
39buffers have been allocated with the
40:ref:`VIDIOC_REQBUFS` ioctl.
41
42To export a buffer, applications fill struct
43:ref:`v4l2_exportbuffer <v4l2-exportbuffer>`. The ``type`` field is
44set to the same buffer type as was previously used with struct
45:ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``.
46Applications must also set the ``index`` field. Valid index numbers
47range from zero to the number of buffers allocated with
48:ref:`VIDIOC_REQBUFS` (struct
49:ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``count``) minus
50one. For the multi-planar API, applications set the ``plane`` field to
51the index of the plane to be exported. Valid planes range from zero to
52the maximal number of valid planes for the currently active format. For
53the single-planar API, applications must set ``plane`` to zero.
54Additional flags may be posted in the ``flags`` field. Refer to a manual
55for open() for details. Currently only O_CLOEXEC, O_RDONLY, O_WRONLY,
56and O_RDWR are supported. All other fields must be set to zero. In the
57case of multi-planar API, every plane is exported separately using
58multiple :ref:`VIDIOC_EXPBUF` calls.
59
60After calling :ref:`VIDIOC_EXPBUF` the ``fd`` field will be set by a
61driver. This is a DMABUF file descriptor. The application may pass it to
62other DMABUF-aware devices. Refer to :ref:`DMABUF importing <dmabuf>`
63for details about importing DMABUF files into V4L2 nodes. It is
64recommended to close a DMABUF file when it is no longer used to allow
65the associated memory to be reclaimed.
66
67
68Examples
69========
70
71
72.. code-block:: c
73
74 int buffer_export(int v4lfd, enum v4l2_buf_type bt, int index, int *dmafd)
75 {
76 struct v4l2_exportbuffer expbuf;
77
78 memset(&expbuf, 0, sizeof(expbuf));
79 expbuf.type = bt;
80 expbuf.index = index;
81 if (ioctl(v4lfd, VIDIOC_EXPBUF, &expbuf) == -1) {
82 perror("VIDIOC_EXPBUF");
83 return -1;
84 }
85
86 *dmafd = expbuf.fd;
87
88 return 0;
89 }
90
91
92.. code-block:: c
93
94 int buffer_export_mp(int v4lfd, enum v4l2_buf_type bt, int index,
95 int dmafd[], int n_planes)
96 {
97 int i;
98
99 for (i = 0; i < n_planes; ++i) {
100 struct v4l2_exportbuffer expbuf;
101
102 memset(&expbuf, 0, sizeof(expbuf));
103 expbuf.type = bt;
104 expbuf.index = index;
105 expbuf.plane = i;
106 if (ioctl(v4lfd, VIDIOC_EXPBUF, &expbuf) == -1) {
107 perror("VIDIOC_EXPBUF");
108 while (i)
109 close(dmafd[--i]);
110 return -1;
111 }
112 dmafd[i] = expbuf.fd;
113 }
114
115 return 0;
116 }
117
118
119.. _v4l2-exportbuffer:
120
121.. flat-table:: struct v4l2_exportbuffer
122 :header-rows: 0
123 :stub-columns: 0
124 :widths: 1 1 2
125
126
127 - .. row 1
128
129 - __u32
130
131 - ``type``
132
133 - Type of the buffer, same as struct
134 :ref:`v4l2_format <v4l2-format>` ``type`` or struct
135 :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``, set
136 by the application. See :ref:`v4l2-buf-type`
137
138 - .. row 2
139
140 - __u32
141
142 - ``index``
143
144 - Number of the buffer, set by the application. This field is only
145 used for :ref:`memory mapping <mmap>` I/O and can range from
146 zero to the number of buffers allocated with the
147 :ref:`VIDIOC_REQBUFS` and/or
148 :ref:`VIDIOC_CREATE_BUFS` ioctls.
149
150 - .. row 3
151
152 - __u32
153
154 - ``plane``
155
156 - Index of the plane to be exported when using the multi-planar API.
157 Otherwise this value must be set to zero.
158
159 - .. row 4
160
161 - __u32
162
163 - ``flags``
164
165 - Flags for the newly created file, currently only ``O_CLOEXEC``,
166 ``O_RDONLY``, ``O_WRONLY``, and ``O_RDWR`` are supported, refer to
167 the manual of open() for more details.
168
169 - .. row 5
170
171 - __s32
172
173 - ``fd``
174
175 - The DMABUF file descriptor associated with a buffer. Set by the
176 driver.
177
178 - .. row 6
179
180 - __u32
181
182 - ``reserved[11]``
183
184 - Reserved field for future use. Drivers and applications must set
185 the array to zero.
186
187
188Return Value
189============
190
191On success 0 is returned, on error -1 and the ``errno`` variable is set
192appropriately. The generic error codes are described at the
193:ref:`Generic Error Codes <gen-errors>` chapter.
194
195EINVAL
196 A queue is not in MMAP mode or DMABUF exporting is not supported or
197 ``flags`` or ``type`` or ``index`` or ``plane`` fields are invalid.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-audio.rst b/Documentation/media/uapi/v4l/vidioc-g-audio.rst
new file mode 100644
index 000000000000..cccbcdb8c463
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-audio.rst
@@ -0,0 +1,162 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_AUDIO:
4
5************************************
6ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO
7************************************
8
9Name
10====
11
12VIDIOC_G_AUDIO - VIDIOC_S_AUDIO - Query or select the current audio input and its attributes
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_audio *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_audio *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_AUDIO, VIDIOC_S_AUDIO
31
32``argp``
33
34
35Description
36===========
37
38To query the current audio input applications zero out the ``reserved``
39array of a struct :ref:`v4l2_audio <v4l2-audio>` and call the
40:ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` ioctl with a pointer to this structure. Drivers fill
41the rest of the structure or return an ``EINVAL`` error code when the device
42has no audio inputs, or none which combine with the current video input.
43
44Audio inputs have one writable property, the audio mode. To select the
45current audio input *and* change the audio mode, applications initialize
46the ``index`` and ``mode`` fields, and the ``reserved`` array of a
47:ref:`struct v4l2_audio <v4l2-audio>` structure and call the :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>`
48ioctl. Drivers may switch to a different audio mode if the request
49cannot be satisfied. However, this is a write-only ioctl, it does not
50return the actual new audio mode.
51
52
53.. _v4l2-audio:
54
55.. flat-table:: struct v4l2_audio
56 :header-rows: 0
57 :stub-columns: 0
58 :widths: 1 1 2
59
60
61 - .. row 1
62
63 - __u32
64
65 - ``index``
66
67 - Identifies the audio input, set by the driver or application.
68
69 - .. row 2
70
71 - __u8
72
73 - ``name``\ [32]
74
75 - Name of the audio input, a NUL-terminated ASCII string, for
76 example: "Line In". This information is intended for the user,
77 preferably the connector label on the device itself.
78
79 - .. row 3
80
81 - __u32
82
83 - ``capability``
84
85 - Audio capability flags, see :ref:`audio-capability`.
86
87 - .. row 4
88
89 - __u32
90
91 - ``mode``
92
93 - Audio mode flags set by drivers and applications (on
94 :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` ioctl), see :ref:`audio-mode`.
95
96 - .. row 5
97
98 - __u32
99
100 - ``reserved``\ [2]
101
102 - Reserved for future extensions. Drivers and applications must set
103 the array to zero.
104
105
106
107.. _audio-capability:
108
109.. flat-table:: Audio Capability Flags
110 :header-rows: 0
111 :stub-columns: 0
112 :widths: 3 1 4
113
114
115 - .. row 1
116
117 - ``V4L2_AUDCAP_STEREO``
118
119 - 0x00001
120
121 - This is a stereo input. The flag is intended to automatically
122 disable stereo recording etc. when the signal is always monaural.
123 The API provides no means to detect if stereo is *received*,
124 unless the audio input belongs to a tuner.
125
126 - .. row 2
127
128 - ``V4L2_AUDCAP_AVL``
129
130 - 0x00002
131
132 - Automatic Volume Level mode is supported.
133
134
135
136.. _audio-mode:
137
138.. flat-table:: Audio Mode Flags
139 :header-rows: 0
140 :stub-columns: 0
141 :widths: 3 1 4
142
143
144 - .. row 1
145
146 - ``V4L2_AUDMODE_AVL``
147
148 - 0x00001
149
150 - AVL mode is on.
151
152
153Return Value
154============
155
156On success 0 is returned, on error -1 and the ``errno`` variable is set
157appropriately. The generic error codes are described at the
158:ref:`Generic Error Codes <gen-errors>` chapter.
159
160EINVAL
161 No audio inputs combine with the current video input, or the number
162 of the selected audio input is out of bounds or it does not combine.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-audioout.rst b/Documentation/media/uapi/v4l/vidioc-g-audioout.rst
new file mode 100644
index 000000000000..b1c1bfeb251e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-audioout.rst
@@ -0,0 +1,122 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_AUDOUT:
4
5**************************************
6ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
7**************************************
8
9Name
10====
11
12VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - Query or select the current audio output
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_audioout *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_audioout *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
31
32``argp``
33
34
35Description
36===========
37
38To query the current audio output applications zero out the ``reserved``
39array of a struct :ref:`v4l2_audioout <v4l2-audioout>` and call the
40``VIDIOC_G_AUDOUT`` ioctl with a pointer to this structure. Drivers fill
41the rest of the structure or return an ``EINVAL`` error code when the device
42has no audio inputs, or none which combine with the current video
43output.
44
45Audio outputs have no writable properties. Nevertheless, to select the
46current audio output applications can initialize the ``index`` field and
47``reserved`` array (which in the future may contain writable properties)
48of a :ref:`struct v4l2_audioout <v4l2-audioout>` structure and call the
49``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or
50return the ``EINVAL`` error code when the index is out of bounds. This is a
51write-only ioctl, it does not return the current audio output attributes
52as ``VIDIOC_G_AUDOUT`` does.
53
54.. note:: Connectors on a TV card to loop back the received audio signal
55 to a sound card are not audio outputs in this sense.
56
57
58.. _v4l2-audioout:
59
60.. flat-table:: struct v4l2_audioout
61 :header-rows: 0
62 :stub-columns: 0
63 :widths: 1 1 2
64
65
66 - .. row 1
67
68 - __u32
69
70 - ``index``
71
72 - Identifies the audio output, set by the driver or application.
73
74 - .. row 2
75
76 - __u8
77
78 - ``name``\ [32]
79
80 - Name of the audio output, a NUL-terminated ASCII string, for
81 example: "Line Out". This information is intended for the user,
82 preferably the connector label on the device itself.
83
84 - .. row 3
85
86 - __u32
87
88 - ``capability``
89
90 - Audio capability flags, none defined yet. Drivers must set this
91 field to zero.
92
93 - .. row 4
94
95 - __u32
96
97 - ``mode``
98
99 - Audio mode, none defined yet. Drivers and applications (on
100 ``VIDIOC_S_AUDOUT``) must set this field to zero.
101
102 - .. row 5
103
104 - __u32
105
106 - ``reserved``\ [2]
107
108 - Reserved for future extensions. Drivers and applications must set
109 the array to zero.
110
111
112Return Value
113============
114
115On success 0 is returned, on error -1 and the ``errno`` variable is set
116appropriately. The generic error codes are described at the
117:ref:`Generic Error Codes <gen-errors>` chapter.
118
119EINVAL
120 No audio outputs combine with the current video output, or the
121 number of the selected audio output is out of bounds or it does not
122 combine.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-crop.rst b/Documentation/media/uapi/v4l/vidioc-g-crop.rst
new file mode 100644
index 000000000000..6cf76497937c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-crop.rst
@@ -0,0 +1,113 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_CROP:
4
5**********************************
6ioctl VIDIOC_G_CROP, VIDIOC_S_CROP
7**********************************
8
9Name
10====
11
12VIDIOC_G_CROP - VIDIOC_S_CROP - Get or set the current cropping rectangle
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_crop *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_crop *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_CROP, VIDIOC_S_CROP
31
32``argp``
33
34
35Description
36===========
37
38To query the cropping rectangle size and position applications set the
39``type`` field of a :ref:`struct v4l2_crop <v4l2-crop>` structure to the
40respective buffer (stream) type and call the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` ioctl
41with a pointer to this structure. The driver fills the rest of the
42structure or returns the ``EINVAL`` error code if cropping is not supported.
43
44To change the cropping rectangle applications initialize the ``type``
45and struct :ref:`v4l2_rect <v4l2-rect>` substructure named ``c`` of a
46v4l2_crop structure and call the :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctl with a pointer
47to this structure.
48
49Do not use the multiplanar buffer types. Use
50``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
51``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
52``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
53``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``.
54
55The driver first adjusts the requested dimensions against hardware
56limits, i. e. the bounds given by the capture/output window, and it
57rounds to the closest possible values of horizontal and vertical offset,
58width and height. In particular the driver must round the vertical
59offset of the cropping rectangle to frame lines modulo two, such that
60the field order cannot be confused.
61
62Second the driver adjusts the image size (the opposite rectangle of the
63scaling process, source or target depending on the data direction) to
64the closest size possible while maintaining the current horizontal and
65vertical scaling factor.
66
67Finally the driver programs the hardware with the actual cropping and
68image parameters. :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` is a write-only ioctl, it does not
69return the actual parameters. To query them applications must call
70:ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_G_FMT`. When the
71parameters are unsuitable the application may modify the cropping or
72image parameters and repeat the cycle until satisfactory parameters have
73been negotiated.
74
75When cropping is not supported then no parameters are changed and
76:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` returns the ``EINVAL`` error code.
77
78
79.. _v4l2-crop:
80
81.. flat-table:: struct v4l2_crop
82 :header-rows: 0
83 :stub-columns: 0
84 :widths: 1 1 2
85
86
87 - .. row 1
88
89 - __u32
90
91 - ``type``
92
93 - Type of the data stream, set by the application. Only these types
94 are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``,
95 ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and
96 ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
97
98 - .. row 2
99
100 - struct :ref:`v4l2_rect <v4l2-rect>`
101
102 - ``c``
103
104 - Cropping rectangle. The same co-ordinate system as for struct
105 :ref:`v4l2_cropcap <v4l2-cropcap>` ``bounds`` is used.
106
107
108Return Value
109============
110
111On success 0 is returned, on error -1 and the ``errno`` variable is set
112appropriately. The generic error codes are described at the
113:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-ctrl.rst b/Documentation/media/uapi/v4l/vidioc-g-ctrl.rst
new file mode 100644
index 000000000000..ee929f692ebe
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-ctrl.rst
@@ -0,0 +1,105 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_CTRL:
4
5**********************************
6ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL
7**********************************
8
9Name
10====
11
12VIDIOC_G_CTRL - VIDIOC_S_CTRL - Get or set the value of a control
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_control *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_CTRL, VIDIOC_S_CTRL
29
30``argp``
31
32
33Description
34===========
35
36To get the current value of a control applications initialize the ``id``
37field of a struct :ref:`struct v4l2_control <v4l2-control>` and call the
38:ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` ioctl with a pointer to this structure. To change the
39value of a control applications initialize the ``id`` and ``value``
40fields of a struct :ref:`struct v4l2_control <v4l2-control>` and call the
41:ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctl.
42
43When the ``id`` is invalid drivers return an ``EINVAL`` error code. When the
44``value`` is out of bounds drivers can choose to take the closest valid
45value or return an ``ERANGE`` error code, whatever seems more appropriate.
46However, :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` is a write-only ioctl, it does not return the
47actual new value. If the ``value`` is inappropriate for the control
48(e.g. if it refers to an unsupported menu index of a menu control), then
49EINVAL error code is returned as well.
50
51These ioctls work only with user controls. For other control classes the
52:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`,
53:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` or
54:ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` must be used.
55
56
57.. _v4l2-control:
58
59.. flat-table:: struct v4l2_control
60 :header-rows: 0
61 :stub-columns: 0
62 :widths: 1 1 2
63
64
65 - .. row 1
66
67 - __u32
68
69 - ``id``
70
71 - Identifies the control, set by the application.
72
73 - .. row 2
74
75 - __s32
76
77 - ``value``
78
79 - New value or current value.
80
81
82Return Value
83============
84
85On success 0 is returned, on error -1 and the ``errno`` variable is set
86appropriately. The generic error codes are described at the
87:ref:`Generic Error Codes <gen-errors>` chapter.
88
89EINVAL
90 The struct :ref:`v4l2_control <v4l2-control>` ``id`` is invalid
91 or the ``value`` is inappropriate for the given control (i.e. if a
92 menu item is selected that is not supported by the driver according
93 to :ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>`).
94
95ERANGE
96 The struct :ref:`v4l2_control <v4l2-control>` ``value`` is out of
97 bounds.
98
99EBUSY
100 The control is temporarily not changeable, possibly because another
101 applications took over control of the device function this control
102 belongs to.
103
104EACCES
105 Attempt to set a read-only control or to get a write-only control.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst b/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst
new file mode 100644
index 000000000000..f7bf21f49092
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst
@@ -0,0 +1,417 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_DV_TIMINGS:
4
5**********************************************
6ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS
7**********************************************
8
9Name
10====
11
12VIDIOC_G_DV_TIMINGS - VIDIOC_S_DV_TIMINGS - VIDIOC_SUBDEV_G_DV_TIMINGS - VIDIOC_SUBDEV_S_DV_TIMINGS - Get or set DV timings for input or output
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_dv_timings *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS,
29 VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_S_DV_TIMINGS
30
31``argp``
32
33
34Description
35===========
36
37To set DV timings for the input or output, applications use the
38:ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl and to get the current timings,
39applications use the :ref:`VIDIOC_G_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl. The detailed timing
40information is filled in using the structure struct
41:ref:`v4l2_dv_timings <v4l2-dv-timings>`. These ioctls take a
42pointer to the struct :ref:`v4l2_dv_timings <v4l2-dv-timings>`
43structure as argument. If the ioctl is not supported or the timing
44values are not correct, the driver returns ``EINVAL`` error code.
45
46The ``linux/v4l2-dv-timings.h`` header can be used to get the timings of
47the formats in the :ref:`cea861` and :ref:`vesadmt` standards. If
48the current input or output does not support DV timings (e.g. if
49:ref:`VIDIOC_ENUMINPUT` does not set the
50``V4L2_IN_CAP_DV_TIMINGS`` flag), then ``ENODATA`` error code is returned.
51
52
53Return Value
54============
55
56On success 0 is returned, on error -1 and the ``errno`` variable is set
57appropriately. The generic error codes are described at the
58:ref:`Generic Error Codes <gen-errors>` chapter.
59
60EINVAL
61 This ioctl is not supported, or the :ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>`
62 parameter was unsuitable.
63
64ENODATA
65 Digital video timings are not supported for this input or output.
66
67EBUSY
68 The device is busy and therefore can not change the timings.
69
70
71.. _v4l2-bt-timings:
72
73.. flat-table:: struct v4l2_bt_timings
74 :header-rows: 0
75 :stub-columns: 0
76 :widths: 1 1 2
77
78
79 - .. row 1
80
81 - __u32
82
83 - ``width``
84
85 - Width of the active video in pixels.
86
87 - .. row 2
88
89 - __u32
90
91 - ``height``
92
93 - Height of the active video frame in lines. So for interlaced
94 formats the height of the active video in each field is
95 ``height``/2.
96
97 - .. row 3
98
99 - __u32
100
101 - ``interlaced``
102
103 - Progressive (``V4L2_DV_PROGRESSIVE``) or interlaced (``V4L2_DV_INTERLACED``).
104
105 - .. row 4
106
107 - __u32
108
109 - ``polarities``
110
111 - This is a bit mask that defines polarities of sync signals. bit 0
112 (``V4L2_DV_VSYNC_POS_POL``) is for vertical sync polarity and bit
113 1 (``V4L2_DV_HSYNC_POS_POL``) is for horizontal sync polarity. If
114 the bit is set (1) it is positive polarity and if is cleared (0),
115 it is negative polarity.
116
117 - .. row 5
118
119 - __u64
120
121 - ``pixelclock``
122
123 - Pixel clock in Hz. Ex. 74.25MHz->74250000
124
125 - .. row 6
126
127 - __u32
128
129 - ``hfrontporch``
130
131 - Horizontal front porch in pixels
132
133 - .. row 7
134
135 - __u32
136
137 - ``hsync``
138
139 - Horizontal sync length in pixels
140
141 - .. row 8
142
143 - __u32
144
145 - ``hbackporch``
146
147 - Horizontal back porch in pixels
148
149 - .. row 9
150
151 - __u32
152
153 - ``vfrontporch``
154
155 - Vertical front porch in lines. For interlaced formats this refers
156 to the odd field (aka field 1).
157
158 - .. row 10
159
160 - __u32
161
162 - ``vsync``
163
164 - Vertical sync length in lines. For interlaced formats this refers
165 to the odd field (aka field 1).
166
167 - .. row 11
168
169 - __u32
170
171 - ``vbackporch``
172
173 - Vertical back porch in lines. For interlaced formats this refers
174 to the odd field (aka field 1).
175
176 - .. row 12
177
178 - __u32
179
180 - ``il_vfrontporch``
181
182 - Vertical front porch in lines for the even field (aka field 2) of
183 interlaced field formats. Must be 0 for progressive formats.
184
185 - .. row 13
186
187 - __u32
188
189 - ``il_vsync``
190
191 - Vertical sync length in lines for the even field (aka field 2) of
192 interlaced field formats. Must be 0 for progressive formats.
193
194 - .. row 14
195
196 - __u32
197
198 - ``il_vbackporch``
199
200 - Vertical back porch in lines for the even field (aka field 2) of
201 interlaced field formats. Must be 0 for progressive formats.
202
203 - .. row 15
204
205 - __u32
206
207 - ``standards``
208
209 - The video standard(s) this format belongs to. This will be filled
210 in by the driver. Applications must set this to 0. See
211 :ref:`dv-bt-standards` for a list of standards.
212
213 - .. row 16
214
215 - __u32
216
217 - ``flags``
218
219 - Several flags giving more information about the format. See
220 :ref:`dv-bt-flags` for a description of the flags.
221
222
223
224.. _v4l2-dv-timings:
225
226.. flat-table:: struct v4l2_dv_timings
227 :header-rows: 0
228 :stub-columns: 0
229 :widths: 1 1 2 1
230
231
232 - .. row 1
233
234 - __u32
235
236 - ``type``
237
238 -
239 - Type of DV timings as listed in :ref:`dv-timing-types`.
240
241 - .. row 2
242
243 - union
244
245 -
246 -
247
248 - .. row 3
249
250 -
251 - struct :ref:`v4l2_bt_timings <v4l2-bt-timings>`
252
253 - ``bt``
254
255 - Timings defined by BT.656/1120 specifications
256
257 - .. row 4
258
259 -
260 - __u32
261
262 - ``reserved``\ [32]
263
264 -
265
266
267
268.. _dv-timing-types:
269
270.. flat-table:: DV Timing types
271 :header-rows: 0
272 :stub-columns: 0
273 :widths: 1 1 2
274
275
276 - .. row 1
277
278 - Timing type
279
280 - value
281
282 - Description
283
284 - .. row 2
285
286 -
287 -
288 -
289
290 - .. row 3
291
292 - ``V4L2_DV_BT_656_1120``
293
294 - 0
295
296 - BT.656/1120 timings
297
298
299
300.. _dv-bt-standards:
301
302.. flat-table:: DV BT Timing standards
303 :header-rows: 0
304 :stub-columns: 0
305
306
307 - .. row 1
308
309 - Timing standard
310
311 - Description
312
313 - .. row 2
314
315 -
316 -
317
318 - .. row 3
319
320 - ``V4L2_DV_BT_STD_CEA861``
321
322 - The timings follow the CEA-861 Digital TV Profile standard
323
324 - .. row 4
325
326 - ``V4L2_DV_BT_STD_DMT``
327
328 - The timings follow the VESA Discrete Monitor Timings standard
329
330 - .. row 5
331
332 - ``V4L2_DV_BT_STD_CVT``
333
334 - The timings follow the VESA Coordinated Video Timings standard
335
336 - .. row 6
337
338 - ``V4L2_DV_BT_STD_GTF``
339
340 - The timings follow the VESA Generalized Timings Formula standard
341
342
343
344.. _dv-bt-flags:
345
346.. flat-table:: DV BT Timing flags
347 :header-rows: 0
348 :stub-columns: 0
349
350
351 - .. row 1
352
353 - Flag
354
355 - Description
356
357 - .. row 2
358
359 -
360 -
361
362 - .. row 3
363
364 - ``V4L2_DV_FL_REDUCED_BLANKING``
365
366 - CVT/GTF specific: the timings use reduced blanking (CVT) or the
367 'Secondary GTF' curve (GTF). In both cases the horizontal and/or
368 vertical blanking intervals are reduced, allowing a higher
369 resolution over the same bandwidth. This is a read-only flag,
370 applications must not set this.
371
372 - .. row 4
373
374 - ``V4L2_DV_FL_CAN_REDUCE_FPS``
375
376 - CEA-861 specific: set for CEA-861 formats with a framerate that is
377 a multiple of six. These formats can be optionally played at 1 /
378 1.001 speed to be compatible with 60 Hz based standards such as
379 NTSC and PAL-M that use a framerate of 29.97 frames per second. If
380 the transmitter can't generate such frequencies, then the flag
381 will also be cleared. This is a read-only flag, applications must
382 not set this.
383
384 - .. row 5
385
386 - ``V4L2_DV_FL_REDUCED_FPS``
387
388 - CEA-861 specific: only valid for video transmitters, the flag is
389 cleared by receivers. It is also only valid for formats with the
390 ``V4L2_DV_FL_CAN_REDUCE_FPS`` flag set, for other formats the
391 flag will be cleared by the driver. If the application sets this
392 flag, then the pixelclock used to set up the transmitter is
393 divided by 1.001 to make it compatible with NTSC framerates. If
394 the transmitter can't generate such frequencies, then the flag
395 will also be cleared.
396
397 - .. row 6
398
399 - ``V4L2_DV_FL_HALF_LINE``
400
401 - Specific to interlaced formats: if set, then the vertical
402 frontporch of field 1 (aka the odd field) is really one half-line
403 longer and the vertical backporch of field 2 (aka the even field)
404 is really one half-line shorter, so each field has exactly the
405 same number of half-lines. Whether half-lines can be detected or
406 used depends on the hardware.
407
408 - .. row 7
409
410 - ``V4L2_DV_FL_IS_CE_VIDEO``
411
412 - If set, then this is a Consumer Electronics (CE) video format.
413 Such formats differ from other formats (commonly called IT
414 formats) in that if R'G'B' encoding is used then by default the
415 R'G'B' values use limited range (i.e. 16-235) as opposed to full
416 range (i.e. 0-255). All formats defined in CEA-861 except for the
417 640x480p59.94 format are CE formats.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-edid.rst b/Documentation/media/uapi/v4l/vidioc-g-edid.rst
new file mode 100644
index 000000000000..1a982b68a72f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-edid.rst
@@ -0,0 +1,160 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_EDID:
4
5******************************************************************************
6ioctl VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID
7******************************************************************************
8
9Name
10====
11
12VIDIOC_G_EDID - VIDIOC_S_EDID - VIDIOC_SUBDEV_G_EDID - VIDIOC_SUBDEV_S_EDID - Get or set the EDID of a video receiver/transmitter
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_edid *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID,
29 VIDIOC_SUBDEV_S_EDID
30
31``argp``
32
33
34Description
35===========
36
37These ioctls can be used to get or set an EDID associated with an input
38from a receiver or an output of a transmitter device. They can be used
39with subdevice nodes (/dev/v4l-subdevX) or with video nodes
40(/dev/videoX).
41
42When used with video nodes the ``pad`` field represents the input (for
43video capture devices) or output (for video output devices) index as is
44returned by :ref:`VIDIOC_ENUMINPUT` and
45:ref:`VIDIOC_ENUMOUTPUT` respectively. When used
46with subdevice nodes the ``pad`` field represents the input or output
47pad of the subdevice. If there is no EDID support for the given ``pad``
48value, then the ``EINVAL`` error code will be returned.
49
50To get the EDID data the application has to fill in the ``pad``,
51``start_block``, ``blocks`` and ``edid`` fields, zero the ``reserved``
52array and call :ref:`VIDIOC_G_EDID <VIDIOC_G_EDID>`. The current EDID from block
53``start_block`` and of size ``blocks`` will be placed in the memory
54``edid`` points to. The ``edid`` pointer must point to memory at least
55``blocks`` * 128 bytes large (the size of one block is 128 bytes).
56
57If there are fewer blocks than specified, then the driver will set
58``blocks`` to the actual number of blocks. If there are no EDID blocks
59available at all, then the error code ``ENODATA`` is set.
60
61If blocks have to be retrieved from the sink, then this call will block
62until they have been read.
63
64If ``start_block`` and ``blocks`` are both set to 0 when
65:ref:`VIDIOC_G_EDID <VIDIOC_G_EDID>` is called, then the driver will set ``blocks`` to the
66total number of available EDID blocks and it will return 0 without
67copying any data. This is an easy way to discover how many EDID blocks
68there are.
69
70.. note:: If there are no EDID blocks available at all, then
71 the driver will set ``blocks`` to 0 and it returns 0.
72
73To set the EDID blocks of a receiver the application has to fill in the
74``pad``, ``blocks`` and ``edid`` fields, set ``start_block`` to 0 and
75zero the ``reserved`` array. It is not possible to set part of an EDID,
76it is always all or nothing. Setting the EDID data is only valid for
77receivers as it makes no sense for a transmitter.
78
79The driver assumes that the full EDID is passed in. If there are more
80EDID blocks than the hardware can handle then the EDID is not written,
81but instead the error code ``E2BIG`` is set and ``blocks`` is set to the
82maximum that the hardware supports. If ``start_block`` is any value
83other than 0 then the error code ``EINVAL`` is set.
84
85To disable an EDID you set ``blocks`` to 0. Depending on the hardware
86this will drive the hotplug pin low and/or block the source from reading
87the EDID data in some way. In any case, the end result is the same: the
88EDID is no longer available.
89
90
91.. _v4l2-edid:
92
93.. flat-table:: struct v4l2_edid
94 :header-rows: 0
95 :stub-columns: 0
96 :widths: 1 1 2
97
98
99 - .. row 1
100
101 - __u32
102
103 - ``pad``
104
105 - Pad for which to get/set the EDID blocks. When used with a video
106 device node the pad represents the input or output index as
107 returned by :ref:`VIDIOC_ENUMINPUT` and
108 :ref:`VIDIOC_ENUMOUTPUT` respectively.
109
110 - .. row 2
111
112 - __u32
113
114 - ``start_block``
115
116 - Read the EDID from starting with this block. Must be 0 when
117 setting the EDID.
118
119 - .. row 3
120
121 - __u32
122
123 - ``blocks``
124
125 - The number of blocks to get or set. Must be less or equal to 256
126 (the maximum number of blocks as defined by the standard). When
127 you set the EDID and ``blocks`` is 0, then the EDID is disabled or
128 erased.
129
130 - .. row 4
131
132 - __u32
133
134 - ``reserved``\ [5]
135
136 - Reserved for future extensions. Applications and drivers must set
137 the array to zero.
138
139 - .. row 5
140
141 - __u8 *
142
143 - ``edid``
144
145 - Pointer to memory that contains the EDID. The minimum size is
146 ``blocks`` * 128.
147
148
149Return Value
150============
151
152On success 0 is returned, on error -1 and the ``errno`` variable is set
153appropriately. The generic error codes are described at the
154:ref:`Generic Error Codes <gen-errors>` chapter.
155
156``ENODATA``
157 The EDID data is not available.
158
159``E2BIG``
160 The EDID data you provided is more than the hardware can handle.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst b/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst
new file mode 100644
index 000000000000..f0f41ac56b80
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst
@@ -0,0 +1,210 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_ENC_INDEX:
4
5************************
6ioctl VIDIOC_G_ENC_INDEX
7************************
8
9Name
10====
11
12VIDIOC_G_ENC_INDEX - Get meta data about a compressed video stream
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_enc_idx *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_ENC_INDEX
29
30``argp``
31
32
33Description
34===========
35
36The :ref:`VIDIOC_G_ENC_INDEX <VIDIOC_G_ENC_INDEX>` ioctl provides meta data about a compressed
37video stream the same or another application currently reads from the
38driver, which is useful for random access into the stream without
39decoding it.
40
41To read the data applications must call :ref:`VIDIOC_G_ENC_INDEX <VIDIOC_G_ENC_INDEX>` with a
42pointer to a struct :ref:`v4l2_enc_idx <v4l2-enc-idx>`. On success
43the driver fills the ``entry`` array, stores the number of elements
44written in the ``entries`` field, and initializes the ``entries_cap``
45field.
46
47Each element of the ``entry`` array contains meta data about one
48picture. A :ref:`VIDIOC_G_ENC_INDEX <VIDIOC_G_ENC_INDEX>` call reads up to
49``V4L2_ENC_IDX_ENTRIES`` entries from a driver buffer, which can hold up
50to ``entries_cap`` entries. This number can be lower or higher than
51``V4L2_ENC_IDX_ENTRIES``, but not zero. When the application fails to
52read the meta data in time the oldest entries will be lost. When the
53buffer is empty or no capturing/encoding is in progress, ``entries``
54will be zero.
55
56Currently this ioctl is only defined for MPEG-2 program streams and
57video elementary streams.
58
59
60.. _v4l2-enc-idx:
61
62.. flat-table:: struct v4l2_enc_idx
63 :header-rows: 0
64 :stub-columns: 0
65 :widths: 1 1 2 1 1
66
67
68 - .. row 1
69
70 - __u32
71
72 - ``entries``
73
74 - The number of entries the driver stored in the ``entry`` array.
75
76 - .. row 2
77
78 - __u32
79
80 - ``entries_cap``
81
82 - The number of entries the driver can buffer. Must be greater than
83 zero.
84
85 - .. row 3
86
87 - __u32
88
89 - ``reserved``\ [4]
90
91 - :cspan:`2` Reserved for future extensions. Drivers must set the
92 array to zero.
93
94 - .. row 4
95
96 - struct :ref:`v4l2_enc_idx_entry <v4l2-enc-idx-entry>`
97
98 - ``entry``\ [``V4L2_ENC_IDX_ENTRIES``]
99
100 - Meta data about a compressed video stream. Each element of the
101 array corresponds to one picture, sorted in ascending order by
102 their ``offset``.
103
104
105
106.. _v4l2-enc-idx-entry:
107
108.. flat-table:: struct v4l2_enc_idx_entry
109 :header-rows: 0
110 :stub-columns: 0
111 :widths: 1 1 2
112
113
114 - .. row 1
115
116 - __u64
117
118 - ``offset``
119
120 - The offset in bytes from the beginning of the compressed video
121 stream to the beginning of this picture, that is a *PES packet
122 header* as defined in :ref:`mpeg2part1` or a *picture header* as
123 defined in :ref:`mpeg2part2`. When the encoder is stopped, the
124 driver resets the offset to zero.
125
126 - .. row 2
127
128 - __u64
129
130 - ``pts``
131
132 - The 33 bit *Presentation Time Stamp* of this picture as defined in
133 :ref:`mpeg2part1`.
134
135 - .. row 3
136
137 - __u32
138
139 - ``length``
140
141 - The length of this picture in bytes.
142
143 - .. row 4
144
145 - __u32
146
147 - ``flags``
148
149 - Flags containing the coding type of this picture, see
150 :ref:`enc-idx-flags`.
151
152 - .. row 5
153
154 - __u32
155
156 - ``reserved``\ [2]
157
158 - Reserved for future extensions. Drivers must set the array to
159 zero.
160
161
162
163.. _enc-idx-flags:
164
165.. flat-table:: Index Entry Flags
166 :header-rows: 0
167 :stub-columns: 0
168 :widths: 3 1 4
169
170
171 - .. row 1
172
173 - ``V4L2_ENC_IDX_FRAME_I``
174
175 - 0x00
176
177 - This is an Intra-coded picture.
178
179 - .. row 2
180
181 - ``V4L2_ENC_IDX_FRAME_P``
182
183 - 0x01
184
185 - This is a Predictive-coded picture.
186
187 - .. row 3
188
189 - ``V4L2_ENC_IDX_FRAME_B``
190
191 - 0x02
192
193 - This is a Bidirectionally predictive-coded picture.
194
195 - .. row 4
196
197 - ``V4L2_ENC_IDX_FRAME_MASK``
198
199 - 0x0F
200
201 - *AND* the flags field with this mask to obtain the picture coding
202 type.
203
204
205Return Value
206============
207
208On success 0 is returned, on error -1 and the ``errno`` variable is set
209appropriately. The generic error codes are described at the
210:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst b/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst
new file mode 100644
index 000000000000..39e24ad4b825
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst
@@ -0,0 +1,492 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_EXT_CTRLS:
4
5******************************************************************
6ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS
7******************************************************************
8
9Name
10====
11
12VIDIOC_G_EXT_CTRLS - VIDIOC_S_EXT_CTRLS - VIDIOC_TRY_EXT_CTRLS - Get or set the value of several controls, try control values
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_ext_controls *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
29 VIDIOC_TRY_EXT_CTRLS
30
31``argp``
32
33
34Description
35===========
36
37These ioctls allow the caller to get or set multiple controls
38atomically. Control IDs are grouped into control classes (see
39:ref:`ctrl-class`) and all controls in the control array must belong
40to the same control class.
41
42Applications must always fill in the ``count``, ``which``, ``controls``
43and ``reserved`` fields of struct
44:ref:`v4l2_ext_controls <v4l2-ext-controls>`, and initialize the
45struct :ref:`v4l2_ext_control <v4l2-ext-control>` array pointed to
46by the ``controls`` fields.
47
48To get the current value of a set of controls applications initialize
49the ``id``, ``size`` and ``reserved2`` fields of each struct
50:ref:`v4l2_ext_control <v4l2-ext-control>` and call the
51:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. String controls controls must also set the
52``string`` field. Controls of compound types
53(``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set) must set the ``ptr`` field.
54
55If the ``size`` is too small to receive the control result (only
56relevant for pointer-type controls like strings), then the driver will
57set ``size`` to a valid value and return an ``ENOSPC`` error code. You
58should re-allocate the memory to this new size and try again. For the
59string type it is possible that the same issue occurs again if the
60string has grown in the meantime. It is recommended to call
61:ref:`VIDIOC_QUERYCTRL` first and use
62``maximum``\ +1 as the new ``size`` value. It is guaranteed that that is
63sufficient memory.
64
65N-dimensional arrays are set and retrieved row-by-row. You cannot set a
66partial array, all elements have to be set or retrieved. The total size
67is calculated as ``elems`` * ``elem_size``. These values can be obtained
68by calling :ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>`.
69
70To change the value of a set of controls applications initialize the
71``id``, ``size``, ``reserved2`` and ``value/value64/string/ptr`` fields
72of each struct :ref:`v4l2_ext_control <v4l2-ext-control>` and call
73the :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. The controls will only be set if *all*
74control values are valid.
75
76To check if a set of controls have correct values applications
77initialize the ``id``, ``size``, ``reserved2`` and
78``value/value64/string/ptr`` fields of each struct
79:ref:`v4l2_ext_control <v4l2-ext-control>` and call the
80:ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. It is up to the driver whether wrong
81values are automatically adjusted to a valid value or if an error is
82returned.
83
84When the ``id`` or ``which`` is invalid drivers return an ``EINVAL`` error
85code. When the value is out of bounds drivers can choose to take the
86closest valid value or return an ``ERANGE`` error code, whatever seems more
87appropriate. In the first case the new value is set in struct
88:ref:`v4l2_ext_control <v4l2-ext-control>`. If the new control value
89is inappropriate (e.g. the given menu index is not supported by the menu
90control), then this will also result in an ``EINVAL`` error code error.
91
92The driver will only set/get these controls if all control values are
93correct. This prevents the situation where only some of the controls
94were set/get. Only low-level errors (e. g. a failed i2c command) can
95still cause this situation.
96
97
98.. _v4l2-ext-control:
99
100.. flat-table:: struct v4l2_ext_control
101 :header-rows: 0
102 :stub-columns: 0
103 :widths: 1 1 1 2
104
105
106 - .. row 1
107
108 - __u32
109
110 - ``id``
111
112 -
113 - Identifies the control, set by the application.
114
115 - .. row 2
116
117 - __u32
118
119 - ``size``
120
121 -
122 - The total size in bytes of the payload of this control. This is
123 normally 0, but for pointer controls this should be set to the
124 size of the memory containing the payload, or that will receive
125 the payload. If :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` finds that this value is
126 less than is required to store the payload result, then it is set
127 to a value large enough to store the payload result and ``ENOSPC`` is
128 returned.
129
130 .. note:: For string controls, this ``size`` field should
131 not be confused with the length of the string. This field refers
132 to the size of the memory that contains the string. The actual
133 *length* of the string may well be much smaller.
134
135 - .. row 3
136
137 - __u32
138
139 - ``reserved2``\ [1]
140
141 -
142 - Reserved for future extensions. Drivers and applications must set
143 the array to zero.
144
145 - .. row 4
146
147 - union
148
149 - (anonymous)
150
151 - .. row 5
152
153 -
154 - __s32
155
156 - ``value``
157
158 - New value or current value. Valid if this control is not of type
159 ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is
160 not set.
161
162 - .. row 6
163
164 -
165 - __s64
166
167 - ``value64``
168
169 - New value or current value. Valid if this control is of type
170 ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is
171 not set.
172
173 - .. row 7
174
175 -
176 - char *
177
178 - ``string``
179
180 - A pointer to a string. Valid if this control is of type
181 ``V4L2_CTRL_TYPE_STRING``.
182
183 - .. row 8
184
185 -
186 - __u8 *
187
188 - ``p_u8``
189
190 - A pointer to a matrix control of unsigned 8-bit values. Valid if
191 this control is of type ``V4L2_CTRL_TYPE_U8``.
192
193 - .. row 9
194
195 -
196 - __u16 *
197
198 - ``p_u16``
199
200 - A pointer to a matrix control of unsigned 16-bit values. Valid if
201 this control is of type ``V4L2_CTRL_TYPE_U16``.
202
203 - .. row 10
204
205 -
206 - __u32 *
207
208 - ``p_u32``
209
210 - A pointer to a matrix control of unsigned 32-bit values. Valid if
211 this control is of type ``V4L2_CTRL_TYPE_U32``.
212
213 - .. row 11
214
215 -
216 - void *
217
218 - ``ptr``
219
220 - A pointer to a compound type which can be an N-dimensional array
221 and/or a compound type (the control's type is >=
222 ``V4L2_CTRL_COMPOUND_TYPES``). Valid if
223 ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set for this control.
224
225
226
227.. _v4l2-ext-controls:
228
229.. flat-table:: struct v4l2_ext_controls
230 :header-rows: 0
231 :stub-columns: 0
232 :widths: 1 1 2 1
233
234
235 - .. row 1
236
237 - union
238
239 - (anonymous)
240
241 - .. row 2
242
243 -
244 - __u32
245
246 - ``ctrl_class``
247
248 - The control class to which all controls belong, see
249 :ref:`ctrl-class`. Drivers that use a kernel framework for
250 handling controls will also accept a value of 0 here, meaning that
251 the controls can belong to any control class. Whether drivers
252 support this can be tested by setting ``ctrl_class`` to 0 and
253 calling :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` with a ``count`` of 0. If that
254 succeeds, then the driver supports this feature.
255
256 - .. row 3
257
258 -
259 - __u32
260
261 - ``which``
262
263 - Which value of the control to get/set/try.
264 ``V4L2_CTRL_WHICH_CUR_VAL`` will return the current value of the
265 control and ``V4L2_CTRL_WHICH_DEF_VAL`` will return the default
266 value of the control.
267
268 .. note:: You can only get the default value of the control,
269 you cannot set or try it.
270
271 For backwards compatibility you can also use a control class here
272 (see :ref:`ctrl-class`). In that case all controls have to
273 belong to that control class. This usage is deprecated, instead
274 just use ``V4L2_CTRL_WHICH_CUR_VAL``. There are some very old
275 drivers that do not yet support ``V4L2_CTRL_WHICH_CUR_VAL`` and
276 that require a control class here. You can test for such drivers
277 by setting ctrl_class to ``V4L2_CTRL_WHICH_CUR_VAL`` and calling
278 VIDIOC_TRY_EXT_CTRLS with a count of 0. If that fails, then the
279 driver does not support ``V4L2_CTRL_WHICH_CUR_VAL``.
280
281 - .. row 4
282
283 - __u32
284
285 - ``count``
286
287 - The number of controls in the controls array. May also be zero.
288
289 - .. row 5
290
291 - __u32
292
293 - ``error_idx``
294
295 - Set by the driver in case of an error. If the error is associated
296 with a particular control, then ``error_idx`` is set to the index
297 of that control. If the error is not related to a specific
298 control, or the validation step failed (see below), then
299 ``error_idx`` is set to ``count``. The value is undefined if the
300 ioctl returned 0 (success).
301
302 Before controls are read from/written to hardware a validation
303 step takes place: this checks if all controls in the list are
304 valid controls, if no attempt is made to write to a read-only
305 control or read from a write-only control, and any other up-front
306 checks that can be done without accessing the hardware. The exact
307 validations done during this step are driver dependent since some
308 checks might require hardware access for some devices, thus making
309 it impossible to do those checks up-front. However, drivers should
310 make a best-effort to do as many up-front checks as possible.
311
312 This check is done to avoid leaving the hardware in an
313 inconsistent state due to easy-to-avoid problems. But it leads to
314 another problem: the application needs to know whether an error
315 came from the validation step (meaning that the hardware was not
316 touched) or from an error during the actual reading from/writing
317 to hardware.
318
319 The, in hindsight quite poor, solution for that is to set
320 ``error_idx`` to ``count`` if the validation failed. This has the
321 unfortunate side-effect that it is not possible to see which
322 control failed the validation. If the validation was successful
323 and the error happened while accessing the hardware, then
324 ``error_idx`` is less than ``count`` and only the controls up to
325 ``error_idx-1`` were read or written correctly, and the state of
326 the remaining controls is undefined.
327
328 Since :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` does not access hardware there is
329 also no need to handle the validation step in this special way, so
330 ``error_idx`` will just be set to the control that failed the
331 validation step instead of to ``count``. This means that if
332 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` fails with ``error_idx`` set to ``count``,
333 then you can call :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` to try to discover the
334 actual control that failed the validation step. Unfortunately,
335 there is no ``TRY`` equivalent for :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`.
336
337 - .. row 6
338
339 - __u32
340
341 - ``reserved``\ [2]
342
343 - Reserved for future extensions. Drivers and applications must set
344 the array to zero.
345
346 - .. row 7
347
348 - struct :ref:`v4l2_ext_control <v4l2-ext-control>` *
349
350 - ``controls``
351
352 - Pointer to an array of ``count`` v4l2_ext_control structures.
353 Ignored if ``count`` equals zero.
354
355
356
357.. _ctrl-class:
358
359.. flat-table:: Control classes
360 :header-rows: 0
361 :stub-columns: 0
362 :widths: 3 1 4
363
364
365 - .. row 1
366
367 - ``V4L2_CTRL_CLASS_USER``
368
369 - 0x980000
370
371 - The class containing user controls. These controls are described
372 in :ref:`control`. All controls that can be set using the
373 :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` and
374 :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` ioctl belong to this
375 class.
376
377 - .. row 2
378
379 - ``V4L2_CTRL_CLASS_MPEG``
380
381 - 0x990000
382
383 - The class containing MPEG compression controls. These controls are
384 described in :ref:`mpeg-controls`.
385
386 - .. row 3
387
388 - ``V4L2_CTRL_CLASS_CAMERA``
389
390 - 0x9a0000
391
392 - The class containing camera controls. These controls are described
393 in :ref:`camera-controls`.
394
395 - .. row 4
396
397 - ``V4L2_CTRL_CLASS_FM_TX``
398
399 - 0x9b0000
400
401 - The class containing FM Transmitter (FM TX) controls. These
402 controls are described in :ref:`fm-tx-controls`.
403
404 - .. row 5
405
406 - ``V4L2_CTRL_CLASS_FLASH``
407
408 - 0x9c0000
409
410 - The class containing flash device controls. These controls are
411 described in :ref:`flash-controls`.
412
413 - .. row 6
414
415 - ``V4L2_CTRL_CLASS_JPEG``
416
417 - 0x9d0000
418
419 - The class containing JPEG compression controls. These controls are
420 described in :ref:`jpeg-controls`.
421
422 - .. row 7
423
424 - ``V4L2_CTRL_CLASS_IMAGE_SOURCE``
425
426 - 0x9e0000
427
428 - The class containing image source controls. These controls are
429 described in :ref:`image-source-controls`.
430
431 - .. row 8
432
433 - ``V4L2_CTRL_CLASS_IMAGE_PROC``
434
435 - 0x9f0000
436
437 - The class containing image processing controls. These controls are
438 described in :ref:`image-process-controls`.
439
440 - .. row 9
441
442 - ``V4L2_CTRL_CLASS_FM_RX``
443
444 - 0xa10000
445
446 - The class containing FM Receiver (FM RX) controls. These controls
447 are described in :ref:`fm-rx-controls`.
448
449 - .. row 10
450
451 - ``V4L2_CTRL_CLASS_RF_TUNER``
452
453 - 0xa20000
454
455 - The class containing RF tuner controls. These controls are
456 described in :ref:`rf-tuner-controls`.
457
458
459Return Value
460============
461
462On success 0 is returned, on error -1 and the ``errno`` variable is set
463appropriately. The generic error codes are described at the
464:ref:`Generic Error Codes <gen-errors>` chapter.
465
466EINVAL
467 The struct :ref:`v4l2_ext_control <v4l2-ext-control>` ``id`` is
468 invalid, the struct :ref:`v4l2_ext_controls <v4l2-ext-controls>`
469 ``which`` is invalid, or the struct
470 :ref:`v4l2_ext_control <v4l2-ext-control>` ``value`` was
471 inappropriate (e.g. the given menu index is not supported by the
472 driver). This error code is also returned by the
473 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctls if two or
474 more control values are in conflict.
475
476ERANGE
477 The struct :ref:`v4l2_ext_control <v4l2-ext-control>` ``value``
478 is out of bounds.
479
480EBUSY
481 The control is temporarily not changeable, possibly because another
482 applications took over control of the device function this control
483 belongs to.
484
485ENOSPC
486 The space reserved for the control's payload is insufficient. The
487 field ``size`` is set to a value that is enough to store the payload
488 and this error code is returned.
489
490EACCES
491 Attempt to try or set a read-only control or to get a write-only
492 control.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-fbuf.rst b/Documentation/media/uapi/v4l/vidioc-g-fbuf.rst
new file mode 100644
index 000000000000..d182d9f5a50d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-fbuf.rst
@@ -0,0 +1,500 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_FBUF:
4
5**********************************
6ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF
7**********************************
8
9Name
10====
11
12VIDIOC_G_FBUF - VIDIOC_S_FBUF - Get or set frame buffer overlay parameters
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_framebuffer *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_framebuffer *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_FBUF, VIDIOC_S_FBUF
31
32``argp``
33
34
35Description
36===========
37
38Applications can use the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` and :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` ioctl
39to get and set the framebuffer parameters for a
40:ref:`Video Overlay <overlay>` or :ref:`Video Output Overlay <osd>`
41(OSD). The type of overlay is implied by the device type (capture or
42output device) and can be determined with the
43:ref:`VIDIOC_QUERYCAP` ioctl. One ``/dev/videoN``
44device must not support both kinds of overlay.
45
46The V4L2 API distinguishes destructive and non-destructive overlays. A
47destructive overlay copies captured video images into the video memory
48of a graphics card. A non-destructive overlay blends video images into a
49VGA signal or graphics into a video signal. *Video Output Overlays* are
50always non-destructive.
51
52To get the current parameters applications call the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`
53ioctl with a pointer to a :ref:`struct v4l2_framebuffer <v4l2-framebuffer>`
54structure. The driver fills all fields of the structure or returns an
55EINVAL error code when overlays are not supported.
56
57To set the parameters for a *Video Output Overlay*, applications must
58initialize the ``flags`` field of a struct
59:ref:`struct v4l2_framebuffer <v4l2-framebuffer>`. Since the framebuffer is
60implemented on the TV card all other parameters are determined by the
61driver. When an application calls :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` with a pointer to
62this structure, the driver prepares for the overlay and returns the
63framebuffer parameters as :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` does, or it returns an error
64code.
65
66To set the parameters for a *non-destructive Video Overlay*,
67applications must initialize the ``flags`` field, the ``fmt``
68substructure, and call :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`. Again the driver prepares for
69the overlay and returns the framebuffer parameters as :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`
70does, or it returns an error code.
71
72For a *destructive Video Overlay* applications must additionally provide
73a ``base`` address. Setting up a DMA to a random memory location can
74jeopardize the system security, its stability or even damage the
75hardware, therefore only the superuser can set the parameters for a
76destructive video overlay.
77
78
79.. _v4l2-framebuffer:
80
81.. flat-table:: struct v4l2_framebuffer
82 :header-rows: 0
83 :stub-columns: 0
84 :widths: 1 1 1 2
85
86
87 - .. row 1
88
89 - __u32
90
91 - ``capability``
92
93 -
94 - Overlay capability flags set by the driver, see
95 :ref:`framebuffer-cap`.
96
97 - .. row 2
98
99 - __u32
100
101 - ``flags``
102
103 -
104 - Overlay control flags set by application and driver, see
105 :ref:`framebuffer-flags`
106
107 - .. row 3
108
109 - void *
110
111 - ``base``
112
113 -
114 - Physical base address of the framebuffer, that is the address of
115 the pixel in the top left corner of the framebuffer. [#f1]_
116
117 - .. row 4
118
119 -
120 -
121 -
122 - This field is irrelevant to *non-destructive Video Overlays*. For
123 *destructive Video Overlays* applications must provide a base
124 address. The driver may accept only base addresses which are a
125 multiple of two, four or eight bytes. For *Video Output Overlays*
126 the driver must return a valid base address, so applications can
127 find the corresponding Linux framebuffer device (see
128 :ref:`osd`).
129
130 - .. row 5
131
132 - struct
133
134 - ``fmt``
135
136 -
137 - Layout of the frame buffer.
138
139 - .. row 6
140
141 -
142 - __u32
143
144 - ``width``
145
146 - Width of the frame buffer in pixels.
147
148 - .. row 7
149
150 -
151 - __u32
152
153 - ``height``
154
155 - Height of the frame buffer in pixels.
156
157 - .. row 8
158
159 -
160 - __u32
161
162 - ``pixelformat``
163
164 - The pixel format of the framebuffer.
165
166 - .. row 9
167
168 -
169 -
170 -
171 - For *non-destructive Video Overlays* this field only defines a
172 format for the struct :ref:`v4l2_window <v4l2-window>`
173 ``chromakey`` field.
174
175 - .. row 10
176
177 -
178 -
179 -
180 - For *destructive Video Overlays* applications must initialize this
181 field. For *Video Output Overlays* the driver must return a valid
182 format.
183
184 - .. row 11
185
186 -
187 -
188 -
189 - Usually this is an RGB format (for example
190 :ref:`V4L2_PIX_FMT_RGB565 <V4L2-PIX-FMT-RGB565>`) but YUV
191 formats (only packed YUV formats when chroma keying is used, not
192 including ``V4L2_PIX_FMT_YUYV`` and ``V4L2_PIX_FMT_UYVY``) and the
193 ``V4L2_PIX_FMT_PAL8`` format are also permitted. The behavior of
194 the driver when an application requests a compressed format is
195 undefined. See :ref:`pixfmt` for information on pixel formats.
196
197 - .. row 12
198
199 -
200 - enum :ref:`v4l2_field <v4l2-field>`
201
202 - ``field``
203
204 - Drivers and applications shall ignore this field. If applicable,
205 the field order is selected with the
206 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, using the ``field``
207 field of struct :ref:`v4l2_window <v4l2-window>`.
208
209 - .. row 13
210
211 -
212 - __u32
213
214 - ``bytesperline``
215
216 - Distance in bytes between the leftmost pixels in two adjacent
217 lines.
218
219 - .. row 14
220
221 - :cspan:`3`
222
223 This field is irrelevant to *non-destructive Video Overlays*.
224
225 For *destructive Video Overlays* both applications and drivers can
226 set this field to request padding bytes at the end of each line.
227 Drivers however may ignore the requested value, returning
228 ``width`` times bytes-per-pixel or a larger value required by the
229 hardware. That implies applications can just set this field to
230 zero to get a reasonable default.
231
232 For *Video Output Overlays* the driver must return a valid value.
233
234 Video hardware may access padding bytes, therefore they must
235 reside in accessible memory. Consider for example the case where
236 padding bytes after the last line of an image cross a system page
237 boundary. Capture devices may write padding bytes, the value is
238 undefined. Output devices ignore the contents of padding bytes.
239
240 When the image format is planar the ``bytesperline`` value applies
241 to the first plane and is divided by the same factor as the
242 ``width`` field for the other planes. For example the Cb and Cr
243 planes of a YUV 4:2:0 image have half as many padding bytes
244 following each line as the Y plane. To avoid ambiguities drivers
245 must return a ``bytesperline`` value rounded up to a multiple of
246 the scale factor.
247
248 - .. row 15
249
250 -
251 - __u32
252
253 - ``sizeimage``
254
255 - This field is irrelevant to *non-destructive Video Overlays*. For
256 *destructive Video Overlays* applications must initialize this
257 field. For *Video Output Overlays* the driver must return a valid
258 format.
259
260 Together with ``base`` it defines the framebuffer memory
261 accessible by the driver.
262
263 - .. row 16
264
265 -
266 - enum :ref:`v4l2_colorspace <v4l2-colorspace>`
267
268 - ``colorspace``
269
270 - This information supplements the ``pixelformat`` and must be set
271 by the driver, see :ref:`colorspaces`.
272
273 - .. row 17
274
275 -
276 - __u32
277
278 - ``priv``
279
280 - Reserved. Drivers and applications must set this field to zero.
281
282
283
284.. _framebuffer-cap:
285
286.. flat-table:: Frame Buffer Capability Flags
287 :header-rows: 0
288 :stub-columns: 0
289 :widths: 3 1 4
290
291
292 - .. row 1
293
294 - ``V4L2_FBUF_CAP_EXTERNOVERLAY``
295
296 - 0x0001
297
298 - The device is capable of non-destructive overlays. When the driver
299 clears this flag, only destructive overlays are supported. There
300 are no drivers yet which support both destructive and
301 non-destructive overlays. Video Output Overlays are in practice
302 always non-destructive.
303
304 - .. row 2
305
306 - ``V4L2_FBUF_CAP_CHROMAKEY``
307
308 - 0x0002
309
310 - The device supports clipping by chroma-keying the images. That is,
311 image pixels replace pixels in the VGA or video signal only where
312 the latter assume a certain color. Chroma-keying makes no sense
313 for destructive overlays.
314
315 - .. row 3
316
317 - ``V4L2_FBUF_CAP_LIST_CLIPPING``
318
319 - 0x0004
320
321 - The device supports clipping using a list of clip rectangles.
322
323 - .. row 4
324
325 - ``V4L2_FBUF_CAP_BITMAP_CLIPPING``
326
327 - 0x0008
328
329 - The device supports clipping using a bit mask.
330
331 - .. row 5
332
333 - ``V4L2_FBUF_CAP_LOCAL_ALPHA``
334
335 - 0x0010
336
337 - The device supports clipping/blending using the alpha channel of
338 the framebuffer or VGA signal. Alpha blending makes no sense for
339 destructive overlays.
340
341 - .. row 6
342
343 - ``V4L2_FBUF_CAP_GLOBAL_ALPHA``
344
345 - 0x0020
346
347 - The device supports alpha blending using a global alpha value.
348 Alpha blending makes no sense for destructive overlays.
349
350 - .. row 7
351
352 - ``V4L2_FBUF_CAP_LOCAL_INV_ALPHA``
353
354 - 0x0040
355
356 - The device supports clipping/blending using the inverted alpha
357 channel of the framebuffer or VGA signal. Alpha blending makes no
358 sense for destructive overlays.
359
360 - .. row 8
361
362 - ``V4L2_FBUF_CAP_SRC_CHROMAKEY``
363
364 - 0x0080
365
366 - The device supports Source Chroma-keying. Video pixels with the
367 chroma-key colors are replaced by framebuffer pixels, which is
368 exactly opposite of ``V4L2_FBUF_CAP_CHROMAKEY``
369
370
371
372.. _framebuffer-flags:
373
374.. flat-table:: Frame Buffer Flags
375 :header-rows: 0
376 :stub-columns: 0
377 :widths: 3 1 4
378
379
380 - .. row 1
381
382 - ``V4L2_FBUF_FLAG_PRIMARY``
383
384 - 0x0001
385
386 - The framebuffer is the primary graphics surface. In other words,
387 the overlay is destructive. This flag is typically set by any
388 driver that doesn't have the ``V4L2_FBUF_CAP_EXTERNOVERLAY``
389 capability and it is cleared otherwise.
390
391 - .. row 2
392
393 - ``V4L2_FBUF_FLAG_OVERLAY``
394
395 - 0x0002
396
397 - If this flag is set for a video capture device, then the driver
398 will set the initial overlay size to cover the full framebuffer
399 size, otherwise the existing overlay size (as set by
400 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`) will be used. Only one
401 video capture driver (bttv) supports this flag. The use of this
402 flag for capture devices is deprecated. There is no way to detect
403 which drivers support this flag, so the only reliable method of
404 setting the overlay size is through
405 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`. If this flag is set for a
406 video output device, then the video output overlay window is
407 relative to the top-left corner of the framebuffer and restricted
408 to the size of the framebuffer. If it is cleared, then the video
409 output overlay window is relative to the video output display.
410
411 - .. row 3
412
413 - ``V4L2_FBUF_FLAG_CHROMAKEY``
414
415 - 0x0004
416
417 - Use chroma-keying. The chroma-key color is determined by the
418 ``chromakey`` field of struct :ref:`v4l2_window <v4l2-window>`
419 and negotiated with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
420 ioctl, see :ref:`overlay` and :ref:`osd`.
421
422 - .. row 4
423
424 - :cspan:`2` There are no flags to enable clipping using a list of
425 clip rectangles or a bitmap. These methods are negotiated with the
426 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay`
427 and :ref:`osd`.
428
429 - .. row 5
430
431 - ``V4L2_FBUF_FLAG_LOCAL_ALPHA``
432
433 - 0x0008
434
435 - Use the alpha channel of the framebuffer to clip or blend
436 framebuffer pixels with video images. The blend function is:
437 output = framebuffer pixel * alpha + video pixel * (1 - alpha).
438 The actual alpha depth depends on the framebuffer pixel format.
439
440 - .. row 6
441
442 - ``V4L2_FBUF_FLAG_GLOBAL_ALPHA``
443
444 - 0x0010
445
446 - Use a global alpha value to blend the framebuffer with video
447 images. The blend function is: output = (framebuffer pixel * alpha
448 + video pixel * (255 - alpha)) / 255. The alpha value is
449 determined by the ``global_alpha`` field of struct
450 :ref:`v4l2_window <v4l2-window>` and negotiated with the
451 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay`
452 and :ref:`osd`.
453
454 - .. row 7
455
456 - ``V4L2_FBUF_FLAG_LOCAL_INV_ALPHA``
457
458 - 0x0020
459
460 - Like ``V4L2_FBUF_FLAG_LOCAL_ALPHA``, use the alpha channel of the
461 framebuffer to clip or blend framebuffer pixels with video images,
462 but with an inverted alpha value. The blend function is: output =
463 framebuffer pixel * (1 - alpha) + video pixel * alpha. The actual
464 alpha depth depends on the framebuffer pixel format.
465
466 - .. row 8
467
468 - ``V4L2_FBUF_FLAG_SRC_CHROMAKEY``
469
470 - 0x0040
471
472 - Use source chroma-keying. The source chroma-key color is
473 determined by the ``chromakey`` field of struct
474 :ref:`v4l2_window <v4l2-window>` and negotiated with the
475 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl, see :ref:`overlay`
476 and :ref:`osd`. Both chroma-keying are mutual exclusive to each
477 other, so same ``chromakey`` field of struct
478 :ref:`v4l2_window <v4l2-window>` is being used.
479
480
481Return Value
482============
483
484On success 0 is returned, on error -1 and the ``errno`` variable is set
485appropriately. The generic error codes are described at the
486:ref:`Generic Error Codes <gen-errors>` chapter.
487
488EPERM
489 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` can only be called by a privileged user to
490 negotiate the parameters for a destructive overlay.
491
492EINVAL
493 The :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` parameters are unsuitable.
494
495.. [#f1]
496 A physical base address may not suit all platforms. GK notes in
497 theory we should pass something like PCI device + memory region +
498 offset instead. If you encounter problems please discuss on the
499 linux-media mailing list:
500 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-fmt.rst b/Documentation/media/uapi/v4l/vidioc-g-fmt.rst
new file mode 100644
index 000000000000..ee6f11978fd6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-fmt.rst
@@ -0,0 +1,188 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_FMT:
4
5************************************************
6ioctl VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT
7************************************************
8
9Name
10====
11
12VIDIOC_G_FMT - VIDIOC_S_FMT - VIDIOC_TRY_FMT - Get or set the data format, try a format
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_format *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT
29
30``argp``
31
32
33Description
34===========
35
36These ioctls are used to negotiate the format of data (typically image
37format) exchanged between driver and application.
38
39To query the current parameters applications set the ``type`` field of a
40struct :ref:`struct v4l2_format <v4l2-format>` to the respective buffer (stream)
41type. For example video capture devices use
42``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or
43``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``. When the application calls the
44:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer to this structure the driver fills
45the respective member of the ``fmt`` union. In case of video capture
46devices that is either the struct
47:ref:`v4l2_pix_format <v4l2-pix-format>` ``pix`` or the struct
48:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` ``pix_mp``
49member. When the requested buffer type is not supported drivers return
50an ``EINVAL`` error code.
51
52To change the current format parameters applications initialize the
53``type`` field and all fields of the respective ``fmt`` union member.
54For details see the documentation of the various devices types in
55:ref:`devices`. Good practice is to query the current parameters
56first, and to modify only those parameters not suitable for the
57application. When the application calls the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl with
58a pointer to a :ref:`struct v4l2_format <v4l2-format>` structure the driver
59checks and adjusts the parameters against hardware abilities. Drivers
60should not return an error code unless the ``type`` field is invalid,
61this is a mechanism to fathom device capabilities and to approach
62parameters acceptable for both the application and driver. On success
63the driver may program the hardware, allocate resources and generally
64prepare for data exchange. Finally the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl returns
65the current format parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does. Very simple,
66inflexible devices may even ignore all input and always return the
67default parameters. However all V4L2 devices exchanging data with the
68application must implement the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
69ioctl. When the requested buffer type is not supported drivers return an
70EINVAL error code on a :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` attempt. When I/O is already in
71progress or the resource is not available for other reasons drivers
72return the ``EBUSY`` error code.
73
74The :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl is equivalent to :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` with one
75exception: it does not change driver state. It can also be called at any
76time, never returning ``EBUSY``. This function is provided to negotiate
77parameters, to learn about hardware limitations, without disabling I/O
78or possibly time consuming hardware preparations. Although strongly
79recommended drivers are not required to implement this ioctl.
80
81The format as returned by :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` must be identical to what
82:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` returns for the same input or output.
83
84
85.. _v4l2-format:
86
87.. flat-table:: struct v4l2_format
88 :header-rows: 0
89 :stub-columns: 0
90
91
92 - .. row 1
93
94 - __u32
95
96 - ``type``
97
98 -
99 - Type of the data stream, see :ref:`v4l2-buf-type`.
100
101 - .. row 2
102
103 - union
104
105 - ``fmt``
106
107 - .. row 3
108
109 -
110 - struct :ref:`v4l2_pix_format <v4l2-pix-format>`
111
112 - ``pix``
113
114 - Definition of an image format, see :ref:`pixfmt`, used by video
115 capture and output devices.
116
117 - .. row 4
118
119 -
120 - struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>`
121
122 - ``pix_mp``
123
124 - Definition of an image format, see :ref:`pixfmt`, used by video
125 capture and output devices that support the
126 :ref:`multi-planar version of the API <planar-apis>`.
127
128 - .. row 5
129
130 -
131 - struct :ref:`v4l2_window <v4l2-window>`
132
133 - ``win``
134
135 - Definition of an overlaid image, see :ref:`overlay`, used by
136 video overlay devices.
137
138 - .. row 6
139
140 -
141 - struct :ref:`v4l2_vbi_format <v4l2-vbi-format>`
142
143 - ``vbi``
144
145 - Raw VBI capture or output parameters. This is discussed in more
146 detail in :ref:`raw-vbi`. Used by raw VBI capture and output
147 devices.
148
149 - .. row 7
150
151 -
152 - struct :ref:`v4l2_sliced_vbi_format <v4l2-sliced-vbi-format>`
153
154 - ``sliced``
155
156 - Sliced VBI capture or output parameters. See :ref:`sliced` for
157 details. Used by sliced VBI capture and output devices.
158
159 - .. row 8
160
161 -
162 - struct :ref:`v4l2_sdr_format <v4l2-sdr-format>`
163
164 - ``sdr``
165
166 - Definition of a data format, see :ref:`pixfmt`, used by SDR
167 capture and output devices.
168
169 - .. row 9
170
171 -
172 - __u8
173
174 - ``raw_data``\ [200]
175
176 - Place holder for future extensions.
177
178
179Return Value
180============
181
182On success 0 is returned, on error -1 and the ``errno`` variable is set
183appropriately. The generic error codes are described at the
184:ref:`Generic Error Codes <gen-errors>` chapter.
185
186EINVAL
187 The struct :ref:`v4l2_format <v4l2-format>` ``type`` field is
188 invalid or the requested buffer type not supported.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-frequency.rst b/Documentation/media/uapi/v4l/vidioc-g-frequency.rst
new file mode 100644
index 000000000000..a1fd2a870de4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-frequency.rst
@@ -0,0 +1,123 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_FREQUENCY:
4
5********************************************
6ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY
7********************************************
8
9Name
10====
11
12VIDIOC_G_FREQUENCY - VIDIOC_S_FREQUENCY - Get or set tuner or modulator radio frequency
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_frequency *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_frequency *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY
31
32``argp``
33
34
35Description
36===========
37
38To get the current tuner or modulator radio frequency applications set
39the ``tuner`` field of a struct
40:ref:`v4l2_frequency <v4l2-frequency>` to the respective tuner or
41modulator number (only input devices have tuners, only output devices
42have modulators), zero out the ``reserved`` array and call the
43:ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl with a pointer to this structure. The
44driver stores the current frequency in the ``frequency`` field.
45
46To change the current tuner or modulator radio frequency applications
47initialize the ``tuner``, ``type`` and ``frequency`` fields, and the
48``reserved`` array of a struct :ref:`v4l2_frequency <v4l2-frequency>`
49and call the :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl with a pointer to this
50structure. When the requested frequency is not possible the driver
51assumes the closest possible value. However :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` is a
52write-only ioctl, it does not return the actual new frequency.
53
54
55.. _v4l2-frequency:
56
57.. flat-table:: struct v4l2_frequency
58 :header-rows: 0
59 :stub-columns: 0
60 :widths: 1 1 2
61
62
63 - .. row 1
64
65 - __u32
66
67 - ``tuner``
68
69 - The tuner or modulator index number. This is the same value as in
70 the struct :ref:`v4l2_input <v4l2-input>` ``tuner`` field and
71 the struct :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field, or
72 the struct :ref:`v4l2_output <v4l2-output>` ``modulator`` field
73 and the struct :ref:`v4l2_modulator <v4l2-modulator>` ``index``
74 field.
75
76 - .. row 2
77
78 - __u32
79
80 - ``type``
81
82 - The tuner type. This is the same value as in the struct
83 :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. The type must be
84 set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
85 to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
86 ``V4L2_TUNER_RADIO`` for modulators (currently only radio
87 modulators are supported). See :ref:`v4l2-tuner-type`
88
89 - .. row 3
90
91 - __u32
92
93 - ``frequency``
94
95 - Tuning frequency in units of 62.5 kHz, or if the struct
96 :ref:`v4l2_tuner <v4l2-tuner>` or struct
97 :ref:`v4l2_modulator <v4l2-modulator>` ``capability`` flag
98 ``V4L2_TUNER_CAP_LOW`` is set, in units of 62.5 Hz. A 1 Hz unit is
99 used when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
100
101 - .. row 4
102
103 - __u32
104
105 - ``reserved``\ [8]
106
107 - Reserved for future extensions. Drivers and applications must set
108 the array to zero.
109
110
111Return Value
112============
113
114On success 0 is returned, on error -1 and the ``errno`` variable is set
115appropriately. The generic error codes are described at the
116:ref:`Generic Error Codes <gen-errors>` chapter.
117
118EINVAL
119 The ``tuner`` index is out of bounds or the value in the ``type``
120 field is wrong.
121
122EBUSY
123 A hardware seek is in progress.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-input.rst b/Documentation/media/uapi/v4l/vidioc-g-input.rst
new file mode 100644
index 000000000000..29e22f6f8028
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-input.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_INPUT:
4
5************************************
6ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
7************************************
8
9Name
10====
11
12VIDIOC_G_INPUT - VIDIOC_S_INPUT - Query or select the current video input
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, int *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_INPUT, VIDIOC_S_INPUT
29
30``argp``
31
32
33Description
34===========
35
36To query the current video input applications call the
37:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
38stores the number of the input, as in the struct
39:ref:`v4l2_input <v4l2-input>` ``index`` field. This ioctl will fail
40only when there are no video inputs, returning ``EINVAL``.
41
42To select a video input applications store the number of the desired
43input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
44to this integer. Side effects are possible. For example inputs may
45support different video standards, so the driver may implicitly switch
46the current standard. Because of these possible side effects
47applications must select an input before querying or negotiating any
48other parameters.
49
50Information about video inputs is available using the
51:ref:`VIDIOC_ENUMINPUT` ioctl.
52
53
54Return Value
55============
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61EINVAL
62 The number of the video input is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst b/Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst
new file mode 100644
index 000000000000..f5bf8b7915ed
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst
@@ -0,0 +1,184 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_JPEGCOMP:
4
5******************************************
6ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
7******************************************
8
9Name
10====
11
12VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, v4l2_jpegcompression *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const v4l2_jpegcompression *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
31
32``argp``
33
34
35Description
36===========
37
38These ioctls are **deprecated**. New drivers and applications should use
39:ref:`JPEG class controls <jpeg-controls>` for image quality and JPEG
40markers control.
41
42[to do]
43
44Ronald Bultje elaborates:
45
46APP is some application-specific information. The application can set it
47itself, and it'll be stored in the JPEG-encoded fields (eg; interlacing
48information for in an AVI or so). COM is the same, but it's comments,
49like 'encoded by me' or so.
50
51jpeg_markers describes whether the huffman tables, quantization tables
52and the restart interval information (all JPEG-specific stuff) should be
53stored in the JPEG-encoded fields. These define how the JPEG field is
54encoded. If you omit them, applications assume you've used standard
55encoding. You usually do want to add them.
56
57
58.. _v4l2-jpegcompression:
59
60.. flat-table:: struct v4l2_jpegcompression
61 :header-rows: 0
62 :stub-columns: 0
63 :widths: 1 1 2
64
65
66 - .. row 1
67
68 - int
69
70 - ``quality``
71
72 - Deprecated. If
73 :ref:`V4L2_CID_JPEG_COMPRESSION_QUALITY <jpeg-quality-control>`
74 control is exposed by a driver applications should use it instead
75 and ignore this field.
76
77 - .. row 2
78
79 - int
80
81 - ``APPn``
82
83 -
84
85 - .. row 3
86
87 - int
88
89 - ``APP_len``
90
91 -
92
93 - .. row 4
94
95 - char
96
97 - ``APP_data``\ [60]
98
99 -
100
101 - .. row 5
102
103 - int
104
105 - ``COM_len``
106
107 -
108
109 - .. row 6
110
111 - char
112
113 - ``COM_data``\ [60]
114
115 -
116
117 - .. row 7
118
119 - __u32
120
121 - ``jpeg_markers``
122
123 - See :ref:`jpeg-markers`. Deprecated. If
124 :ref:`V4L2_CID_JPEG_ACTIVE_MARKER <jpeg-active-marker-control>`
125 control is exposed by a driver applications should use it instead
126 and ignore this field.
127
128
129
130.. _jpeg-markers:
131
132.. flat-table:: JPEG Markers Flags
133 :header-rows: 0
134 :stub-columns: 0
135 :widths: 3 1 4
136
137
138 - .. row 1
139
140 - ``V4L2_JPEG_MARKER_DHT``
141
142 - (1<<3)
143
144 - Define Huffman Tables
145
146 - .. row 2
147
148 - ``V4L2_JPEG_MARKER_DQT``
149
150 - (1<<4)
151
152 - Define Quantization Tables
153
154 - .. row 3
155
156 - ``V4L2_JPEG_MARKER_DRI``
157
158 - (1<<5)
159
160 - Define Restart Interval
161
162 - .. row 4
163
164 - ``V4L2_JPEG_MARKER_COM``
165
166 - (1<<6)
167
168 - Comment segment
169
170 - .. row 5
171
172 - ``V4L2_JPEG_MARKER_APP``
173
174 - (1<<7)
175
176 - App segment, driver will always use APP0
177
178
179Return Value
180============
181
182On success 0 is returned, on error -1 and the ``errno`` variable is set
183appropriately. The generic error codes are described at the
184:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-modulator.rst b/Documentation/media/uapi/v4l/vidioc-g-modulator.rst
new file mode 100644
index 000000000000..a2e8c73f0678
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-modulator.rst
@@ -0,0 +1,257 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_MODULATOR:
4
5********************************************
6ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR
7********************************************
8
9Name
10====
11
12VIDIOC_G_MODULATOR - VIDIOC_S_MODULATOR - Get or set modulator attributes
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_modulator *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_modulator *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR
31
32``argp``
33
34
35Description
36===========
37
38To query the attributes of a modulator applications initialize the
39``index`` field and zero out the ``reserved`` array of a struct
40:ref:`v4l2_modulator <v4l2-modulator>` and call the
41:ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` ioctl with a pointer to this structure. Drivers
42fill the rest of the structure or return an ``EINVAL`` error code when the
43index is out of bounds. To enumerate all modulators applications shall
44begin at index zero, incrementing by one until the driver returns
45EINVAL.
46
47Modulators have two writable properties, an audio modulation set and the
48radio frequency. To change the modulated audio subprograms, applications
49initialize the ``index`` and ``txsubchans`` fields and the ``reserved``
50array and call the :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Drivers may choose a
51different audio modulation if the request cannot be satisfied. However
52this is a write-only ioctl, it does not return the actual audio
53modulation selected.
54
55:ref:`SDR <sdr>` specific modulator types are ``V4L2_TUNER_SDR`` and
56``V4L2_TUNER_RF``. For SDR devices ``txsubchans`` field must be
57initialized to zero. The term 'modulator' means SDR transmitter in this
58context.
59
60To change the radio frequency the
61:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.
62
63
64.. _v4l2-modulator:
65
66.. flat-table:: struct v4l2_modulator
67 :header-rows: 0
68 :stub-columns: 0
69 :widths: 1 1 2 1 1
70
71
72 - .. row 1
73
74 - __u32
75
76 - ``index``
77
78 - Identifies the modulator, set by the application.
79
80 - .. row 2
81
82 - __u8
83
84 - ``name``\ [32]
85
86 - Name of the modulator, a NUL-terminated ASCII string. This
87 information is intended for the user.
88
89 - .. row 3
90
91 - __u32
92
93 - ``capability``
94
95 - Modulator capability flags. No flags are defined for this field,
96 the tuner flags in struct :ref:`v4l2_tuner <v4l2-tuner>` are
97 used accordingly. The audio flags indicate the ability to encode
98 audio subprograms. They will *not* change for example with the
99 current video standard.
100
101 - .. row 4
102
103 - __u32
104
105 - ``rangelow``
106
107 - The lowest tunable frequency in units of 62.5 KHz, or if the
108 ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units of
109 62.5 Hz, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is
110 set, in units of 1 Hz.
111
112 - .. row 5
113
114 - __u32
115
116 - ``rangehigh``
117
118 - The highest tunable frequency in units of 62.5 KHz, or if the
119 ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units of
120 62.5 Hz, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is
121 set, in units of 1 Hz.
122
123 - .. row 6
124
125 - __u32
126
127 - ``txsubchans``
128
129 - With this field applications can determine how audio sub-carriers
130 shall be modulated. It contains a set of flags as defined in
131 :ref:`modulator-txsubchans`.
132
133 .. note:: The tuner ``rxsubchans`` flags are reused, but the
134 semantics are different. Video output devices
135 are assumed to have an analog or PCM audio input with 1-3
136 channels. The ``txsubchans`` flags select one or more channels
137 for modulation, together with some audio subprogram indicator,
138 for example, a stereo pilot tone.
139
140 - .. row 7
141
142 - __u32
143
144 - ``type``
145
146 - :cspan:`2` Type of the modulator, see :ref:`v4l2-tuner-type`.
147
148 - .. row 8
149
150 - __u32
151
152 - ``reserved``\ [3]
153
154 - Reserved for future extensions. Drivers and applications must set
155 the array to zero.
156
157
158
159.. _modulator-txsubchans:
160
161.. flat-table:: Modulator Audio Transmission Flags
162 :header-rows: 0
163 :stub-columns: 0
164 :widths: 3 1 4
165
166
167 - .. row 1
168
169 - ``V4L2_TUNER_SUB_MONO``
170
171 - 0x0001
172
173 - Modulate channel 1 as mono audio, when the input has more
174 channels, a down-mix of channel 1 and 2. This flag does not
175 combine with ``V4L2_TUNER_SUB_STEREO`` or
176 ``V4L2_TUNER_SUB_LANG1``.
177
178 - .. row 2
179
180 - ``V4L2_TUNER_SUB_STEREO``
181
182 - 0x0002
183
184 - Modulate channel 1 and 2 as left and right channel of a stereo
185 audio signal. When the input has only one channel or two channels
186 and ``V4L2_TUNER_SUB_SAP`` is also set, channel 1 is encoded as
187 left and right channel. This flag does not combine with
188 ``V4L2_TUNER_SUB_MONO`` or ``V4L2_TUNER_SUB_LANG1``. When the
189 driver does not support stereo audio it shall fall back to mono.
190
191 - .. row 3
192
193 - ``V4L2_TUNER_SUB_LANG1``
194
195 - 0x0008
196
197 - Modulate channel 1 and 2 as primary and secondary language of a
198 bilingual audio signal. When the input has only one channel it is
199 used for both languages. It is not possible to encode the primary
200 or secondary language only. This flag does not combine with
201 ``V4L2_TUNER_SUB_MONO``, ``V4L2_TUNER_SUB_STEREO`` or
202 ``V4L2_TUNER_SUB_SAP``. If the hardware does not support the
203 respective audio matrix, or the current video standard does not
204 permit bilingual audio the :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl shall
205 return an ``EINVAL`` error code and the driver shall fall back to mono
206 or stereo mode.
207
208 - .. row 4
209
210 - ``V4L2_TUNER_SUB_LANG2``
211
212 - 0x0004
213
214 - Same effect as ``V4L2_TUNER_SUB_SAP``.
215
216 - .. row 5
217
218 - ``V4L2_TUNER_SUB_SAP``
219
220 - 0x0004
221
222 - When combined with ``V4L2_TUNER_SUB_MONO`` the first channel is
223 encoded as mono audio, the last channel as Second Audio Program.
224 When the input has only one channel it is used for both audio
225 tracks. When the input has three channels the mono track is a
226 down-mix of channel 1 and 2. When combined with
227 ``V4L2_TUNER_SUB_STEREO`` channel 1 and 2 are encoded as left and
228 right stereo audio, channel 3 as Second Audio Program. When the
229 input has only two channels, the first is encoded as left and
230 right channel and the second as SAP. When the input has only one
231 channel it is used for all audio tracks. It is not possible to
232 encode a Second Audio Program only. This flag must combine with
233 ``V4L2_TUNER_SUB_MONO`` or ``V4L2_TUNER_SUB_STEREO``. If the
234 hardware does not support the respective audio matrix, or the
235 current video standard does not permit SAP the
236 :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl shall return an ``EINVAL`` error code and
237 driver shall fall back to mono or stereo mode.
238
239 - .. row 6
240
241 - ``V4L2_TUNER_SUB_RDS``
242
243 - 0x0010
244
245 - Enable the RDS encoder for a radio FM transmitter.
246
247
248Return Value
249============
250
251On success 0 is returned, on error -1 and the ``errno`` variable is set
252appropriately. The generic error codes are described at the
253:ref:`Generic Error Codes <gen-errors>` chapter.
254
255EINVAL
256 The struct :ref:`v4l2_modulator <v4l2-modulator>` ``index`` is
257 out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-output.rst b/Documentation/media/uapi/v4l/vidioc-g-output.rst
new file mode 100644
index 000000000000..ae0ad577ba97
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-output.rst
@@ -0,0 +1,64 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_OUTPUT:
4
5**************************************
6ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
7**************************************
8
9Name
10====
11
12VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, int *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
29
30``argp``
31
32
33Description
34===========
35
36To query the current video output applications call the
37:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
38stores the number of the output, as in the struct
39:ref:`v4l2_output <v4l2-output>` ``index`` field. This ioctl will
40fail only when there are no video outputs, returning the ``EINVAL`` error
41code.
42
43To select a video output applications store the number of the desired
44output in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
45pointer to this integer. Side effects are possible. For example outputs
46may support different video standards, so the driver may implicitly
47switch the current standard. standard. Because of these possible side
48effects applications must select an output before querying or
49negotiating any other parameters.
50
51Information about video outputs is available using the
52:ref:`VIDIOC_ENUMOUTPUT` ioctl.
53
54
55Return Value
56============
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62EINVAL
63 The number of the video output is out of bounds, or there are no
64 video outputs at all.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-parm.rst b/Documentation/media/uapi/v4l/vidioc-g-parm.rst
new file mode 100644
index 000000000000..7116e0decddc
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-parm.rst
@@ -0,0 +1,349 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_PARM:
4
5**********************************
6ioctl VIDIOC_G_PARM, VIDIOC_S_PARM
7**********************************
8
9Name
10====
11
12VIDIOC_G_PARM - VIDIOC_S_PARM - Get or set streaming parameters
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, v4l2_streamparm *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_PARM, VIDIOC_S_PARM
29
30``argp``
31
32
33Description
34===========
35
36The current video standard determines a nominal number of frames per
37second. If less than this number of frames is to be captured or output,
38applications can request frame skipping or duplicating on the driver
39side. This is especially useful when using the :ref:`read() <func-read>` or
40:ref:`write() <func-write>`, which are not augmented by timestamps or sequence
41counters, and to avoid unnecessary data copying.
42
43Further these ioctls can be used to determine the number of buffers used
44internally by a driver in read/write mode. For implications see the
45section discussing the :ref:`read() <func-read>` function.
46
47To get and set the streaming parameters applications call the
48:ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take a
49pointer to a struct :ref:`struct v4l2_streamparm <v4l2-streamparm>` which contains a
50union holding separate parameters for input and output devices.
51
52
53.. _v4l2-streamparm:
54
55.. flat-table:: struct v4l2_streamparm
56 :header-rows: 0
57 :stub-columns: 0
58 :widths: 1 1 1 2
59
60
61 - .. row 1
62
63 - __u32
64
65 - ``type``
66
67 -
68 - The buffer (stream) type, same as struct
69 :ref:`v4l2_format <v4l2-format>` ``type``, set by the
70 application. See :ref:`v4l2-buf-type`
71
72 - .. row 2
73
74 - union
75
76 - ``parm``
77
78 -
79 -
80
81 - .. row 3
82
83 -
84 - struct :ref:`v4l2_captureparm <v4l2-captureparm>`
85
86 - ``capture``
87
88 - Parameters for capture devices, used when ``type`` is
89 ``V4L2_BUF_TYPE_VIDEO_CAPTURE``.
90
91 - .. row 4
92
93 -
94 - struct :ref:`v4l2_outputparm <v4l2-outputparm>`
95
96 - ``output``
97
98 - Parameters for output devices, used when ``type`` is
99 ``V4L2_BUF_TYPE_VIDEO_OUTPUT``.
100
101 - .. row 5
102
103 -
104 - __u8
105
106 - ``raw_data``\ [200]
107
108 - A place holder for future extensions.
109
110
111
112.. _v4l2-captureparm:
113
114.. flat-table:: struct v4l2_captureparm
115 :header-rows: 0
116 :stub-columns: 0
117 :widths: 1 1 2
118
119
120 - .. row 1
121
122 - __u32
123
124 - ``capability``
125
126 - See :ref:`parm-caps`.
127
128 - .. row 2
129
130 - __u32
131
132 - ``capturemode``
133
134 - Set by drivers and applications, see :ref:`parm-flags`.
135
136 - .. row 3
137
138 - struct :ref:`v4l2_fract <v4l2-fract>`
139
140 - ``timeperframe``
141
142 - This is the desired period between successive frames captured by
143 the driver, in seconds. The field is intended to skip frames on
144 the driver side, saving I/O bandwidth.
145
146 Applications store here the desired frame period, drivers return
147 the actual frame period, which must be greater or equal to the
148 nominal frame period determined by the current video standard
149 (struct :ref:`v4l2_standard <v4l2-standard>` ``frameperiod``
150 field). Changing the video standard (also implicitly by switching
151 the video input) may reset this parameter to the nominal frame
152 period. To reset manually applications can just set this field to
153 zero.
154
155 Drivers support this function only when they set the
156 ``V4L2_CAP_TIMEPERFRAME`` flag in the ``capability`` field.
157
158 - .. row 4
159
160 - __u32
161
162 - ``extendedmode``
163
164 - Custom (driver specific) streaming parameters. When unused,
165 applications and drivers must set this field to zero. Applications
166 using this field should check the driver name and version, see
167 :ref:`querycap`.
168
169 - .. row 5
170
171 - __u32
172
173 - ``readbuffers``
174
175 - Applications set this field to the desired number of buffers used
176 internally by the driver in :ref:`read() <func-read>` mode.
177 Drivers return the actual number of buffers. When an application
178 requests zero buffers, drivers should just return the current
179 setting rather than the minimum or an error code. For details see
180 :ref:`rw`.
181
182 - .. row 6
183
184 - __u32
185
186 - ``reserved``\ [4]
187
188 - Reserved for future extensions. Drivers and applications must set
189 the array to zero.
190
191
192
193.. _v4l2-outputparm:
194
195.. flat-table:: struct v4l2_outputparm
196 :header-rows: 0
197 :stub-columns: 0
198 :widths: 1 1 2
199
200
201 - .. row 1
202
203 - __u32
204
205 - ``capability``
206
207 - See :ref:`parm-caps`.
208
209 - .. row 2
210
211 - __u32
212
213 - ``outputmode``
214
215 - Set by drivers and applications, see :ref:`parm-flags`.
216
217 - .. row 3
218
219 - struct :ref:`v4l2_fract <v4l2-fract>`
220
221 - ``timeperframe``
222
223 - This is the desired period between successive frames output by the
224 driver, in seconds.
225
226 - .. row 4
227
228 - :cspan:`2`
229
230 The field is intended to repeat frames on the driver side in
231 :ref:`write() <func-write>` mode (in streaming mode timestamps
232 can be used to throttle the output), saving I/O bandwidth.
233
234 Applications store here the desired frame period, drivers return
235 the actual frame period, which must be greater or equal to the
236 nominal frame period determined by the current video standard
237 (struct :ref:`v4l2_standard <v4l2-standard>` ``frameperiod``
238 field). Changing the video standard (also implicitly by switching
239 the video output) may reset this parameter to the nominal frame
240 period. To reset manually applications can just set this field to
241 zero.
242
243 Drivers support this function only when they set the
244 ``V4L2_CAP_TIMEPERFRAME`` flag in the ``capability`` field.
245
246 - .. row 5
247
248 - __u32
249
250 - ``extendedmode``
251
252 - Custom (driver specific) streaming parameters. When unused,
253 applications and drivers must set this field to zero. Applications
254 using this field should check the driver name and version, see
255 :ref:`querycap`.
256
257 - .. row 6
258
259 - __u32
260
261 - ``writebuffers``
262
263 - Applications set this field to the desired number of buffers used
264 internally by the driver in :ref:`write() <func-write>` mode. Drivers
265 return the actual number of buffers. When an application requests
266 zero buffers, drivers should just return the current setting
267 rather than the minimum or an error code. For details see
268 :ref:`rw`.
269
270 - .. row 7
271
272 - __u32
273
274 - ``reserved``\ [4]
275
276 - Reserved for future extensions. Drivers and applications must set
277 the array to zero.
278
279
280
281.. _parm-caps:
282
283.. flat-table:: Streaming Parameters Capabilites
284 :header-rows: 0
285 :stub-columns: 0
286 :widths: 3 1 4
287
288
289 - .. row 1
290
291 - ``V4L2_CAP_TIMEPERFRAME``
292
293 - 0x1000
294
295 - The frame skipping/repeating controlled by the ``timeperframe``
296 field is supported.
297
298
299
300.. _parm-flags:
301
302.. flat-table:: Capture Parameters Flags
303 :header-rows: 0
304 :stub-columns: 0
305 :widths: 3 1 4
306
307
308 - .. row 1
309
310 - ``V4L2_MODE_HIGHQUALITY``
311
312 - 0x0001
313
314 - High quality imaging mode. High quality mode is intended for still
315 imaging applications. The idea is to get the best possible image
316 quality that the hardware can deliver. It is not defined how the
317 driver writer may achieve that; it will depend on the hardware and
318 the ingenuity of the driver writer. High quality mode is a
319 different mode from the regular motion video capture modes. In
320 high quality mode:
321
322 - The driver may be able to capture higher resolutions than for
323 motion capture.
324
325 - The driver may support fewer pixel formats than motion capture
326 (eg; true color).
327
328 - The driver may capture and arithmetically combine multiple
329 successive fields or frames to remove color edge artifacts and
330 reduce the noise in the video data.
331
332 - The driver may capture images in slices like a scanner in order
333 to handle larger format images than would otherwise be
334 possible.
335
336 - An image capture operation may be significantly slower than
337 motion capture.
338
339 - Moving objects in the image might have excessive motion blur.
340
341 - Capture might only work through the :ref:`read() <func-read>` call.
342
343
344Return Value
345============
346
347On success 0 is returned, on error -1 and the ``errno`` variable is set
348appropriately. The generic error codes are described at the
349:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-priority.rst b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
new file mode 100644
index 000000000000..9f774ce400a4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
@@ -0,0 +1,117 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_PRIORITY:
4
5******************************************
6ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
7******************************************
8
9Name
10====
11
12VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, enum v4l2_priority *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const enum v4l2_priority *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
31
32``argp``
33 Pointer to an enum v4l2_priority type.
34
35
36Description
37===========
38
39To query the current access priority applications call the
40:ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
41variable where the driver stores the current priority.
42
43To request an access priority applications store the desired priority in
44an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
45with a pointer to this variable.
46
47
48.. _v4l2-priority:
49
50.. flat-table:: enum v4l2_priority
51 :header-rows: 0
52 :stub-columns: 0
53 :widths: 3 1 4
54
55
56 - .. row 1
57
58 - ``V4L2_PRIORITY_UNSET``
59
60 - 0
61
62 -
63
64 - .. row 2
65
66 - ``V4L2_PRIORITY_BACKGROUND``
67
68 - 1
69
70 - Lowest priority, usually applications running in background, for
71 example monitoring VBI transmissions. A proxy application running
72 in user space will be necessary if multiple applications want to
73 read from a device at this priority.
74
75 - .. row 3
76
77 - ``V4L2_PRIORITY_INTERACTIVE``
78
79 - 2
80
81 -
82
83 - .. row 4
84
85 - ``V4L2_PRIORITY_DEFAULT``
86
87 - 2
88
89 - Medium priority, usually applications started and interactively
90 controlled by the user. For example TV viewers, Teletext browsers,
91 or just "panel" applications to change the channel or video
92 controls. This is the default priority unless an application
93 requests another.
94
95 - .. row 5
96
97 - ``V4L2_PRIORITY_RECORD``
98
99 - 3
100
101 - Highest priority. Only one file descriptor can have this priority,
102 it blocks any other fd from changing device properties. Usually
103 applications which must not be interrupted, like video recording.
104
105
106Return Value
107============
108
109On success 0 is returned, on error -1 and the ``errno`` variable is set
110appropriately. The generic error codes are described at the
111:ref:`Generic Error Codes <gen-errors>` chapter.
112
113EINVAL
114 The requested priority value is invalid.
115
116EBUSY
117 Another application already requested higher priority.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-selection.rst b/Documentation/media/uapi/v4l/vidioc-g-selection.rst
new file mode 100644
index 000000000000..953931fabd00
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-selection.rst
@@ -0,0 +1,209 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_SELECTION:
4
5********************************************
6ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION
7********************************************
8
9Name
10====
11
12VIDIOC_G_SELECTION - VIDIOC_S_SELECTION - Get or set one of the selection rectangles
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_selection *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_SELECTION, VIDIOC_S_SELECTION
29
30``argp``
31
32
33Description
34===========
35
36The ioctls are used to query and configure selection rectangles.
37
38To query the cropping (composing) rectangle set struct
39:ref:`v4l2_selection <v4l2-selection>` ``type`` field to the
40respective buffer type. Do not use the multiplanar buffer types. Use
41``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
42``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
43``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
44``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``. The next step is setting the
45value of struct :ref:`v4l2_selection <v4l2-selection>` ``target``
46field to ``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer
47to table :ref:`v4l2-selections-common` or :ref:`selection-api` for
48additional targets. The ``flags`` and ``reserved`` fields of struct
49:ref:`v4l2_selection <v4l2-selection>` are ignored and they must be
50filled with zeros. The driver fills the rest of the structure or returns
51EINVAL error code if incorrect buffer type or target was used. If
52cropping (composing) is not supported then the active rectangle is not
53mutable and it is always equal to the bounds rectangle. Finally, the
54struct :ref:`v4l2_rect <v4l2-rect>` ``r`` rectangle is filled with
55the current cropping (composing) coordinates. The coordinates are
56expressed in driver-dependent units. The only exception are rectangles
57for images in raw formats, whose coordinates are always expressed in
58pixels.
59
60To change the cropping (composing) rectangle set the struct
61:ref:`v4l2_selection <v4l2-selection>` ``type`` field to the
62respective buffer type. Do not use multiplanar buffers. Use
63``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
64``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``. Use
65``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
66``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``. The next step is setting the
67value of struct :ref:`v4l2_selection <v4l2-selection>` ``target`` to
68``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer to table
69:ref:`v4l2-selections-common` or :ref:`selection-api` for additional
70targets. The struct :ref:`v4l2_rect <v4l2-rect>` ``r`` rectangle need
71to be set to the desired active area. Field struct
72:ref:`v4l2_selection <v4l2-selection>` ``reserved`` is ignored and
73must be filled with zeros. The driver may adjust coordinates of the
74requested rectangle. An application may introduce constraints to control
75rounding behaviour. The struct :ref:`v4l2_selection <v4l2-selection>`
76``flags`` field must be set to one of the following:
77
78- ``0`` - The driver can adjust the rectangle size freely and shall
79 choose a crop/compose rectangle as close as possible to the requested
80 one.
81
82- ``V4L2_SEL_FLAG_GE`` - The driver is not allowed to shrink the
83 rectangle. The original rectangle must lay inside the adjusted one.
84
85- ``V4L2_SEL_FLAG_LE`` - The driver is not allowed to enlarge the
86 rectangle. The adjusted rectangle must lay inside the original one.
87
88- ``V4L2_SEL_FLAG_GE | V4L2_SEL_FLAG_LE`` - The driver must choose the
89 size exactly the same as in the requested rectangle.
90
91Please refer to :ref:`sel-const-adjust`.
92
93The driver may have to adjusts the requested dimensions against hardware
94limits and other parts as the pipeline, i.e. the bounds given by the
95capture/output window or TV display. The closest possible values of
96horizontal and vertical offset and sizes are chosen according to
97following priority:
98
991. Satisfy constraints from struct
100 :ref:`v4l2_selection <v4l2-selection>` ``flags``.
101
1022. Adjust width, height, left, and top to hardware limits and
103 alignments.
104
1053. Keep center of adjusted rectangle as close as possible to the
106 original one.
107
1084. Keep width and height as close as possible to original ones.
109
1105. Keep horizontal and vertical offset as close as possible to original
111 ones.
112
113On success the struct :ref:`v4l2_rect <v4l2-rect>` ``r`` field
114contains the adjusted rectangle. When the parameters are unsuitable the
115application may modify the cropping (composing) or image parameters and
116repeat the cycle until satisfactory parameters have been negotiated. If
117constraints flags have to be violated at then ``ERANGE`` is returned. The
118error indicates that *there exist no rectangle* that satisfies the
119constraints.
120
121Selection targets and flags are documented in
122:ref:`v4l2-selections-common`.
123
124
125.. _sel-const-adjust:
126
127.. figure:: vidioc-g-selection_files/constraints.*
128 :alt: constraints.png
129 :align: center
130
131 Size adjustments with constraint flags.
132
133 Behaviour of rectangle adjustment for different constraint flags.
134
135
136
137
138.. _v4l2-selection:
139
140.. flat-table:: struct v4l2_selection
141 :header-rows: 0
142 :stub-columns: 0
143 :widths: 1 1 2
144
145
146 - .. row 1
147
148 - __u32
149
150 - ``type``
151
152 - Type of the buffer (from enum
153 :ref:`v4l2_buf_type <v4l2-buf-type>`).
154
155 - .. row 2
156
157 - __u32
158
159 - ``target``
160
161 - Used to select between
162 :ref:`cropping and composing rectangles <v4l2-selections-common>`.
163
164 - .. row 3
165
166 - __u32
167
168 - ``flags``
169
170 - Flags controlling the selection rectangle adjustments, refer to
171 :ref:`selection flags <v4l2-selection-flags>`.
172
173 - .. row 4
174
175 - struct :ref:`v4l2_rect <v4l2-rect>`
176
177 - ``r``
178
179 - The selection rectangle.
180
181 - .. row 5
182
183 - __u32
184
185 - ``reserved[9]``
186
187 - Reserved fields for future use. Drivers and applications must zero
188 this array.
189
190
191Return Value
192============
193
194On success 0 is returned, on error -1 and the ``errno`` variable is set
195appropriately. The generic error codes are described at the
196:ref:`Generic Error Codes <gen-errors>` chapter.
197
198EINVAL
199 Given buffer type ``type`` or the selection target ``target`` is not
200 supported, or the ``flags`` argument is not valid.
201
202ERANGE
203 It is not possible to adjust struct :ref:`v4l2_rect <v4l2-rect>`
204 ``r`` rectangle to satisfy all constraints given in the ``flags``
205 argument.
206
207EBUSY
208 It is not possible to apply change of the selection rectangle at the
209 moment. Usually because streaming is in progress.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.png b/Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.png
new file mode 100644
index 000000000000..20228d2c5504
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.png
Binary files differ
diff --git a/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst b/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
new file mode 100644
index 000000000000..f1f661d0200c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
@@ -0,0 +1,276 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_SLICED_VBI_CAP:
4
5*****************************
6ioctl VIDIOC_G_SLICED_VBI_CAP
7*****************************
8
9Name
10====
11
12VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_sliced_vbi_cap *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_SLICED_VBI_CAP
29
30``argp``
31
32
33Description
34===========
35
36To find out which data services are supported by a sliced VBI capture or
37output device, applications initialize the ``type`` field of a struct
38:ref:`v4l2_sliced_vbi_cap <v4l2-sliced-vbi-cap>`, clear the
39``reserved`` array and call the :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl. The
40driver fills in the remaining fields or returns an ``EINVAL`` error code if
41the sliced VBI API is unsupported or ``type`` is invalid.
42
43.. note:: The ``type`` field was added, and the ioctl changed from read-only
44 to write-read, in Linux 2.6.19.
45
46
47.. _v4l2-sliced-vbi-cap:
48
49.. flat-table:: struct v4l2_sliced_vbi_cap
50 :header-rows: 0
51 :stub-columns: 0
52 :widths: 3 3 2 2 2
53
54
55 - .. row 1
56
57 - __u16
58
59 - ``service_set``
60
61 - :cspan:`2` A set of all data services supported by the driver.
62 Equal to the union of all elements of the ``service_lines`` array.
63
64 - .. row 2
65
66 - __u16
67
68 - ``service_lines``\ [2][24]
69
70 - :cspan:`2` Each element of this array contains a set of data
71 services the hardware can look for or insert into a particular
72 scan line. Data services are defined in :ref:`vbi-services`.
73 Array indices map to ITU-R line numbers (see also :ref:`vbi-525`
74 and :ref:`vbi-625`) as follows:
75
76 - .. row 3
77
78 -
79 -
80 - Element
81
82 - 525 line systems
83
84 - 625 line systems
85
86 - .. row 4
87
88 -
89 -
90 - ``service_lines``\ [0][1]
91
92 - 1
93
94 - 1
95
96 - .. row 5
97
98 -
99 -
100 - ``service_lines``\ [0][23]
101
102 - 23
103
104 - 23
105
106 - .. row 6
107
108 -
109 -
110 - ``service_lines``\ [1][1]
111
112 - 264
113
114 - 314
115
116 - .. row 7
117
118 -
119 -
120 - ``service_lines``\ [1][23]
121
122 - 286
123
124 - 336
125
126 - .. row 8
127
128 -
129
130 - .. row 9
131
132 -
133 -
134 - :cspan:`2` The number of VBI lines the hardware can capture or
135 output per frame, or the number of services it can identify on a
136 given line may be limited. For example on PAL line 16 the hardware
137 may be able to look for a VPS or Teletext signal, but not both at
138 the same time. Applications can learn about these limits using the
139 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
140 :ref:`sliced`.
141
142 - .. row 10
143
144 -
145
146 - .. row 11
147
148 -
149 -
150 - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
151 ``service_lines``\ [1][0] to zero.
152
153 - .. row 12
154
155 - __u32
156
157 - ``type``
158
159 - Type of the data stream, see :ref:`v4l2-buf-type`. Should be
160 ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
161 ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
162
163 - .. row 13
164
165 - __u32
166
167 - ``reserved``\ [3]
168
169 - :cspan:`2` This array is reserved for future extensions.
170 Applications and drivers must set it to zero.
171
172
173
174.. _vbi-services:
175
176.. flat-table:: Sliced VBI services
177 :header-rows: 1
178 :stub-columns: 0
179 :widths: 2 1 1 2 2
180
181
182 - .. row 1
183
184 - Symbol
185
186 - Value
187
188 - Reference
189
190 - Lines, usually
191
192 - Payload
193
194 - .. row 2
195
196 - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
197
198 - 0x0001
199
200 - :ref:`ets300706`, :ref:`itu653`
201
202 - PAL/SECAM line 7-22, 320-335 (second field 7-22)
203
204 - Last 42 of the 45 byte Teletext packet, that is without clock
205 run-in and framing code, lsb first transmitted.
206
207 - .. row 3
208
209 - ``V4L2_SLICED_VPS``
210
211 - 0x0400
212
213 - :ref:`ets300231`
214
215 - PAL line 16
216
217 - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
218 first transmitted.
219
220 - .. row 4
221
222 - ``V4L2_SLICED_CAPTION_525``
223
224 - 0x1000
225
226 - :ref:`cea608`
227
228 - NTSC line 21, 284 (second field 21)
229
230 - Two bytes in transmission order, including parity bit, lsb first
231 transmitted.
232
233 - .. row 5
234
235 - ``V4L2_SLICED_WSS_625``
236
237 - 0x4000
238
239 - :ref:`en300294`, :ref:`itu1119`
240
241 - PAL/SECAM line 23
242
243 -
244
245 ::
246
247 Byte 0 1
248 msb lsb msb lsb
249 Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
250
251 - .. row 6
252
253 - ``V4L2_SLICED_VBI_525``
254
255 - 0x1000
256
257 - :cspan:`2` Set of services applicable to 525 line systems.
258
259 - .. row 7
260
261 - ``V4L2_SLICED_VBI_625``
262
263 - 0x4401
264
265 - :cspan:`2` Set of services applicable to 625 line systems.
266
267
268Return Value
269============
270
271On success 0 is returned, on error -1 and the ``errno`` variable is set
272appropriately. The generic error codes are described at the
273:ref:`Generic Error Codes <gen-errors>` chapter.
274
275EINVAL
276 The value in the ``type`` field is wrong.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-std.rst b/Documentation/media/uapi/v4l/vidioc-g-std.rst
new file mode 100644
index 000000000000..5c2b861f8d26
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-std.rst
@@ -0,0 +1,68 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_STD:
4
5********************************
6ioctl VIDIOC_G_STD, VIDIOC_S_STD
7********************************
8
9Name
10====
11
12VIDIOC_G_STD - VIDIOC_S_STD - Query or select the video standard of the current input
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, v4l2_std_id *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const v4l2_std_id *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_STD, VIDIOC_S_STD
31
32``argp``
33
34
35Description
36===========
37
38To query and select the current video standard applications use the
39:ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctls which take a pointer to a
40:ref:`v4l2_std_id <v4l2-std-id>` type as argument. :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`
41can return a single flag or a set of flags as in struct
42:ref:`v4l2_standard <v4l2-standard>` field ``id``. The flags must be
43unambiguous such that they appear in only one enumerated
44:ref:`struct v4l2_standard <v4l2-standard>` structure.
45
46:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
47does not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
48no flags are given or the current input does not support the requested
49standard the driver returns an ``EINVAL`` error code. When the standard set
50is ambiguous drivers may return ``EINVAL`` or choose any of the requested
51standards. If the current input or output does not support standard
52video timings (e.g. if :ref:`VIDIOC_ENUMINPUT`
53does not set the ``V4L2_IN_CAP_STD`` flag), then ``ENODATA`` error code is
54returned.
55
56
57Return Value
58============
59
60On success 0 is returned, on error -1 and the ``errno`` variable is set
61appropriately. The generic error codes are described at the
62:ref:`Generic Error Codes <gen-errors>` chapter.
63
64EINVAL
65 The :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` parameter was unsuitable.
66
67ENODATA
68 Standard video timings are not supported for this input or output.
diff --git a/Documentation/media/uapi/v4l/vidioc-g-tuner.rst b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
new file mode 100644
index 000000000000..614db06b8b4b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
@@ -0,0 +1,717 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_G_TUNER:
4
5************************************
6ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER
7************************************
8
9Name
10====
11
12VIDIOC_G_TUNER - VIDIOC_S_TUNER - Get or set tuner attributes
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_tuner *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_tuner *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_G_TUNER, VIDIOC_S_TUNER
31
32``argp``
33
34
35Description
36===========
37
38To query the attributes of a tuner applications initialize the ``index``
39field and zero out the ``reserved`` array of a struct
40:ref:`v4l2_tuner <v4l2-tuner>` and call the ``VIDIOC_G_TUNER`` ioctl
41with a pointer to this structure. Drivers fill the rest of the structure
42or return an ``EINVAL`` error code when the index is out of bounds. To
43enumerate all tuners applications shall begin at index zero,
44incrementing by one until the driver returns ``EINVAL``.
45
46Tuners have two writable properties, the audio mode and the radio
47frequency. To change the audio mode, applications initialize the
48``index``, ``audmode`` and ``reserved`` fields and call the
49``VIDIOC_S_TUNER`` ioctl. This will *not* change the current tuner,
50which is determined by the current video input. Drivers may choose a
51different audio mode if the requested mode is invalid or unsupported.
52Since this is a write-only ioctl, it does not return the actually
53selected audio mode.
54
55:ref:`SDR <sdr>` specific tuner types are ``V4L2_TUNER_SDR`` and
56``V4L2_TUNER_RF``. For SDR devices ``audmode`` field must be initialized
57to zero. The term 'tuner' means SDR receiver in this context.
58
59To change the radio frequency the
60:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.
61
62
63.. _v4l2-tuner:
64
65.. flat-table:: struct v4l2_tuner
66 :header-rows: 0
67 :stub-columns: 0
68
69
70 - .. row 1
71
72 - __u32
73
74 - ``index``
75
76 - :cspan:`1` Identifies the tuner, set by the application.
77
78 - .. row 2
79
80 - __u8
81
82 - ``name``\ [32]
83
84 - :cspan:`1`
85
86 Name of the tuner, a NUL-terminated ASCII string. This information
87 is intended for the user.
88
89 - .. row 3
90
91 - __u32
92
93 - ``type``
94
95 - :cspan:`1` Type of the tuner, see :ref:`v4l2-tuner-type`.
96
97 - .. row 4
98
99 - __u32
100
101 - ``capability``
102
103 - :cspan:`1`
104
105 Tuner capability flags, see :ref:`tuner-capability`. Audio flags
106 indicate the ability to decode audio subprograms. They will *not*
107 change, for example with the current video standard.
108
109 When the structure refers to a radio tuner the
110 ``V4L2_TUNER_CAP_LANG1``, ``V4L2_TUNER_CAP_LANG2`` and
111 ``V4L2_TUNER_CAP_NORM`` flags can't be used.
112
113 If multiple frequency bands are supported, then ``capability`` is
114 the union of all ``capability`` fields of each struct
115 :ref:`v4l2_frequency_band <v4l2-frequency-band>`.
116
117 - .. row 5
118
119 - __u32
120
121 - ``rangelow``
122
123 - :cspan:`1` The lowest tunable frequency in units of 62.5 kHz, or
124 if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
125 of 62.5 Hz, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ``
126 is set, in units of 1 Hz. If multiple frequency bands are
127 supported, then ``rangelow`` is the lowest frequency of all the
128 frequency bands.
129
130 - .. row 6
131
132 - __u32
133
134 - ``rangehigh``
135
136 - :cspan:`1` The highest tunable frequency in units of 62.5 kHz,
137 or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
138 units of 62.5 Hz, or if the ``capability`` flag
139 ``V4L2_TUNER_CAP_1HZ`` is set, in units of 1 Hz. If multiple
140 frequency bands are supported, then ``rangehigh`` is the highest
141 frequency of all the frequency bands.
142
143 - .. row 7
144
145 - __u32
146
147 - ``rxsubchans``
148
149 - :cspan:`1`
150
151 Some tuners or audio decoders can determine the received audio
152 subprograms by analyzing audio carriers, pilot tones or other
153 indicators. To pass this information drivers set flags defined in
154 :ref:`tuner-rxsubchans` in this field. For example:
155
156 - .. row 8
157
158 -
159 -
160 - ``V4L2_TUNER_SUB_MONO``
161
162 - receiving mono audio
163
164 - .. row 9
165
166 -
167 -
168 - ``STEREO | SAP``
169
170 - receiving stereo audio and a secondary audio program
171
172 - .. row 10
173
174 -
175 -
176 - ``MONO | STEREO``
177
178 - receiving mono or stereo audio, the hardware cannot distinguish
179
180 - .. row 11
181
182 -
183 -
184 - ``LANG1 | LANG2``
185
186 - receiving bilingual audio
187
188 - .. row 12
189
190 -
191 -
192 - ``MONO | STEREO | LANG1 | LANG2``
193
194 - receiving mono, stereo or bilingual audio
195
196 - .. row 13
197
198 -
199 -
200 - :cspan:`1`
201
202 When the ``V4L2_TUNER_CAP_STEREO``, ``_LANG1``, ``_LANG2`` or
203 ``_SAP`` flag is cleared in the ``capability`` field, the
204 corresponding ``V4L2_TUNER_SUB_`` flag must not be set here.
205
206 This field is valid only if this is the tuner of the current video
207 input, or when the structure refers to a radio tuner.
208
209 - .. row 14
210
211 - __u32
212
213 - ``audmode``
214
215 - :cspan:`1`
216
217 The selected audio mode, see :ref:`tuner-audmode` for valid
218 values. The audio mode does not affect audio subprogram detection,
219 and like a :ref:`control` it does not automatically
220 change unless the requested mode is invalid or unsupported. See
221 :ref:`tuner-matrix` for possible results when the selected and
222 received audio programs do not match.
223
224 Currently this is the only field of struct
225 :ref:`struct v4l2_tuner <v4l2-tuner>` applications can change.
226
227 - .. row 15
228
229 - __u32
230
231 - ``signal``
232
233 - :cspan:`1` The signal strength if known, ranging from 0 to
234 65535. Higher values indicate a better signal.
235
236 - .. row 16
237
238 - __s32
239
240 - ``afc``
241
242 - :cspan:`1` Automatic frequency control: When the ``afc`` value
243 is negative, the frequency is too low, when positive too high.
244
245 - .. row 17
246
247 - __u32
248
249 - ``reserved``\ [4]
250
251 - :cspan:`1` Reserved for future extensions. Drivers and
252 applications must set the array to zero.
253
254
255
256.. _v4l2-tuner-type:
257
258.. flat-table:: enum v4l2_tuner_type
259 :header-rows: 0
260 :stub-columns: 0
261 :widths: 3 1 4
262
263
264 - .. row 1
265
266 - ``V4L2_TUNER_RADIO``
267
268 - 1
269
270 -
271
272 - .. row 2
273
274 - ``V4L2_TUNER_ANALOG_TV``
275
276 - 2
277
278 -
279
280 - .. row 3
281
282 - ``V4L2_TUNER_SDR``
283
284 - 4
285
286 -
287
288 - .. row 4
289
290 - ``V4L2_TUNER_RF``
291
292 - 5
293
294 -
295
296
297
298.. _tuner-capability:
299
300.. flat-table:: Tuner and Modulator Capability Flags
301 :header-rows: 0
302 :stub-columns: 0
303 :widths: 3 1 4
304
305
306 - .. row 1
307
308 - ``V4L2_TUNER_CAP_LOW``
309
310 - 0x0001
311
312 - When set, tuning frequencies are expressed in units of 62.5 Hz
313 instead of 62.5 kHz.
314
315 - .. row 2
316
317 - ``V4L2_TUNER_CAP_NORM``
318
319 - 0x0002
320
321 - This is a multi-standard tuner; the video standard can or must be
322 switched. (B/G PAL tuners for example are typically not considered
323 multi-standard because the video standard is automatically
324 determined from the frequency band.) The set of supported video
325 standards is available from the struct
326 :ref:`v4l2_input <v4l2-input>` pointing to this tuner, see the
327 description of ioctl :ref:`VIDIOC_ENUMINPUT`
328 for details. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
329 capability.
330
331 - .. row 3
332
333 - ``V4L2_TUNER_CAP_HWSEEK_BOUNDED``
334
335 - 0x0004
336
337 - If set, then this tuner supports the hardware seek functionality
338 where the seek stops when it reaches the end of the frequency
339 range.
340
341 - .. row 4
342
343 - ``V4L2_TUNER_CAP_HWSEEK_WRAP``
344
345 - 0x0008
346
347 - If set, then this tuner supports the hardware seek functionality
348 where the seek wraps around when it reaches the end of the
349 frequency range.
350
351 - .. row 5
352
353 - ``V4L2_TUNER_CAP_STEREO``
354
355 - 0x0010
356
357 - Stereo audio reception is supported.
358
359 - .. row 6
360
361 - ``V4L2_TUNER_CAP_LANG1``
362
363 - 0x0040
364
365 - Reception of the primary language of a bilingual audio program is
366 supported. Bilingual audio is a feature of two-channel systems,
367 transmitting the primary language monaural on the main audio
368 carrier and a secondary language monaural on a second carrier.
369 Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
370
371 - .. row 7
372
373 - ``V4L2_TUNER_CAP_LANG2``
374
375 - 0x0020
376
377 - Reception of the secondary language of a bilingual audio program
378 is supported. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
379 capability.
380
381 - .. row 8
382
383 - ``V4L2_TUNER_CAP_SAP``
384
385 - 0x0020
386
387 - Reception of a secondary audio program is supported. This is a
388 feature of the BTSC system which accompanies the NTSC video
389 standard. Two audio carriers are available for mono or stereo
390 transmissions of a primary language, and an independent third
391 carrier for a monaural secondary language. Only
392 ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
393
394 .. note:: The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
395 flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner
396 supports the ``V4L2_STD_NTSC_M`` video standard.
397
398 - .. row 9
399
400 - ``V4L2_TUNER_CAP_RDS``
401
402 - 0x0080
403
404 - RDS capture is supported. This capability is only valid for radio
405 tuners.
406
407 - .. row 10
408
409 - ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
410
411 - 0x0100
412
413 - The RDS data is passed as unparsed RDS blocks.
414
415 - .. row 11
416
417 - ``V4L2_TUNER_CAP_RDS_CONTROLS``
418
419 - 0x0200
420
421 - The RDS data is parsed by the hardware and set via controls.
422
423 - .. row 12
424
425 - ``V4L2_TUNER_CAP_FREQ_BANDS``
426
427 - 0x0400
428
429 - The :ref:`VIDIOC_ENUM_FREQ_BANDS`
430 ioctl can be used to enumerate the available frequency bands.
431
432 - .. row 13
433
434 - ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM``
435
436 - 0x0800
437
438 - The range to search when using the hardware seek functionality is
439 programmable, see
440 :ref:`VIDIOC_S_HW_FREQ_SEEK` for
441 details.
442
443 - .. row 14
444
445 - ``V4L2_TUNER_CAP_1HZ``
446
447 - 0x1000
448
449 - When set, tuning frequencies are expressed in units of 1 Hz
450 instead of 62.5 kHz.
451
452
453
454.. _tuner-rxsubchans:
455
456.. flat-table:: Tuner Audio Reception Flags
457 :header-rows: 0
458 :stub-columns: 0
459 :widths: 3 1 4
460
461
462 - .. row 1
463
464 - ``V4L2_TUNER_SUB_MONO``
465
466 - 0x0001
467
468 - The tuner receives a mono audio signal.
469
470 - .. row 2
471
472 - ``V4L2_TUNER_SUB_STEREO``
473
474 - 0x0002
475
476 - The tuner receives a stereo audio signal.
477
478 - .. row 3
479
480 - ``V4L2_TUNER_SUB_LANG1``
481
482 - 0x0008
483
484 - The tuner receives the primary language of a bilingual audio
485 signal. Drivers must clear this flag when the current video
486 standard is ``V4L2_STD_NTSC_M``.
487
488 - .. row 4
489
490 - ``V4L2_TUNER_SUB_LANG2``
491
492 - 0x0004
493
494 - The tuner receives the secondary language of a bilingual audio
495 signal (or a second audio program).
496
497 - .. row 5
498
499 - ``V4L2_TUNER_SUB_SAP``
500
501 - 0x0004
502
503 - The tuner receives a Second Audio Program.
504
505 .. note:: The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
506 flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies
507 when the current video standard is ``V4L2_STD_NTSC_M``.
508
509 - .. row 6
510
511 - ``V4L2_TUNER_SUB_RDS``
512
513 - 0x0010
514
515 - The tuner receives an RDS channel.
516
517
518
519.. _tuner-audmode:
520
521.. flat-table:: Tuner Audio Modes
522 :header-rows: 0
523 :stub-columns: 0
524 :widths: 3 1 4
525
526
527 - .. row 1
528
529 - ``V4L2_TUNER_MODE_MONO``
530
531 - 0
532
533 - Play mono audio. When the tuner receives a stereo signal this a
534 down-mix of the left and right channel. When the tuner receives a
535 bilingual or SAP signal this mode selects the primary language.
536
537 - .. row 2
538
539 - ``V4L2_TUNER_MODE_STEREO``
540
541 - 1
542
543 - Play stereo audio. When the tuner receives bilingual audio it may
544 play different languages on the left and right channel or the
545 primary language is played on both channels.
546
547 Playing different languages in this mode is deprecated. New
548 drivers should do this only in ``MODE_LANG1_LANG2``.
549
550 When the tuner receives no stereo signal or does not support
551 stereo reception the driver shall fall back to ``MODE_MONO``.
552
553 - .. row 3
554
555 - ``V4L2_TUNER_MODE_LANG1``
556
557 - 3
558
559 - Play the primary language, mono or stereo. Only
560 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
561
562 - .. row 4
563
564 - ``V4L2_TUNER_MODE_LANG2``
565
566 - 2
567
568 - Play the secondary language, mono. When the tuner receives no
569 bilingual audio or SAP, or their reception is not supported the
570 driver shall fall back to mono or stereo mode. Only
571 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
572
573 - .. row 5
574
575 - ``V4L2_TUNER_MODE_SAP``
576
577 - 2
578
579 - Play the Second Audio Program. When the tuner receives no
580 bilingual audio or SAP, or their reception is not supported the
581 driver shall fall back to mono or stereo mode. Only
582 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
583
584 .. note:: The ``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP``
585 are synonyms.
586
587 - .. row 6
588
589 - ``V4L2_TUNER_MODE_LANG1_LANG2``
590
591 - 4
592
593 - Play the primary language on the left channel, the secondary
594 language on the right channel. When the tuner receives no
595 bilingual audio or SAP, it shall fall back to ``MODE_LANG1`` or
596 ``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this
597 mode.
598
599
600
601.. _tuner-matrix:
602
603.. flat-table:: Tuner Audio Matrix
604 :header-rows: 2
605 :stub-columns: 0
606
607
608 - .. row 1
609
610 -
611 - :cspan:`5` Selected ``V4L2_TUNER_MODE_``
612
613 - .. row 2
614
615 - Received ``V4L2_TUNER_SUB_``
616
617 - ``MONO``
618
619 - ``STEREO``
620
621 - ``LANG1``
622
623 - ``LANG2 = SAP``
624
625 - ``LANG1_LANG2``\ [#f1]_
626
627 - .. row 3
628
629 - ``MONO``
630
631 - Mono
632
633 - Mono/Mono
634
635 - Mono
636
637 - Mono
638
639 - Mono/Mono
640
641 - .. row 4
642
643 - ``MONO | SAP``
644
645 - Mono
646
647 - Mono/Mono
648
649 - Mono
650
651 - SAP
652
653 - Mono/SAP (preferred) or Mono/Mono
654
655 - .. row 5
656
657 - ``STEREO``
658
659 - L+R
660
661 - L/R
662
663 - Stereo L/R (preferred) or Mono L+R
664
665 - Stereo L/R (preferred) or Mono L+R
666
667 - L/R (preferred) or L+R/L+R
668
669 - .. row 6
670
671 - ``STEREO | SAP``
672
673 - L+R
674
675 - L/R
676
677 - Stereo L/R (preferred) or Mono L+R
678
679 - SAP
680
681 - L+R/SAP (preferred) or L/R or L+R/L+R
682
683 - .. row 7
684
685 - ``LANG1 | LANG2``
686
687 - Language 1
688
689 - Lang1/Lang2 (deprecated [#f2]_) or Lang1/Lang1
690
691 - Language 1
692
693 - Language 2
694
695 - Lang1/Lang2 (preferred) or Lang1/Lang1
696
697
698Return Value
699============
700
701On success 0 is returned, on error -1 and the ``errno`` variable is set
702appropriately. The generic error codes are described at the
703:ref:`Generic Error Codes <gen-errors>` chapter.
704
705EINVAL
706 The struct :ref:`v4l2_tuner <v4l2-tuner>` ``index`` is out of
707 bounds.
708
709.. [#f1]
710 This mode has been added in Linux 2.6.17 and may not be supported by
711 older drivers.
712
713.. [#f2]
714 Playback of both languages in ``MODE_STEREO`` is deprecated. In the
715 future drivers should produce only the primary language in this mode.
716 Applications should request ``MODE_LANG1_LANG2`` to record both
717 languages or a stereo signal.
diff --git a/Documentation/media/uapi/v4l/vidioc-log-status.rst b/Documentation/media/uapi/v4l/vidioc-log-status.rst
new file mode 100644
index 000000000000..66fc352c0ffa
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-log-status.rst
@@ -0,0 +1,46 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_LOG_STATUS:
4
5***********************
6ioctl VIDIOC_LOG_STATUS
7***********************
8
9Name
10====
11
12VIDIOC_LOG_STATUS - Log driver status information
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request )
19
20
21Arguments
22=========
23
24
25
26Description
27===========
28
29As the video/audio devices become more complicated it becomes harder to
30debug problems. When this ioctl is called the driver will output the
31current device status to the kernel log. This is particular useful when
32dealing with problems like no sound, no video and incorrectly tuned
33channels. Also many modern devices autodetect video and audio standards
34and this ioctl will report what the device thinks what the standard is.
35Mismatches may give an indication where the problem is.
36
37This ioctl is optional and not all drivers support it. It was introduced
38in Linux 2.6.15.
39
40
41Return Value
42============
43
44On success 0 is returned, on error -1 and the ``errno`` variable is set
45appropriately. The generic error codes are described at the
46:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-overlay.rst b/Documentation/media/uapi/v4l/vidioc-overlay.rst
new file mode 100644
index 000000000000..191dbc144ef7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-overlay.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_OVERLAY:
4
5********************
6ioctl VIDIOC_OVERLAY
7********************
8
9Name
10====
11
12VIDIOC_OVERLAY - Start or stop video overlay
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, const int *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_OVERLAY
29
30``argp``
31
32
33Description
34===========
35
36This ioctl is part of the :ref:`video overlay <overlay>` I/O method.
37Applications call :ref:`VIDIOC_OVERLAY` to start or stop the overlay. It
38takes a pointer to an integer which must be set to zero by the
39application to stop overlay, to one to start.
40
41Drivers do not support :ref:`VIDIOC_STREAMON` or
42:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` with
43``V4L2_BUF_TYPE_VIDEO_OVERLAY``.
44
45
46Return Value
47============
48
49On success 0 is returned, on error -1 and the ``errno`` variable is set
50appropriately. The generic error codes are described at the
51:ref:`Generic Error Codes <gen-errors>` chapter.
52
53EINVAL
54 The overlay parameters have not been set up. See :ref:`overlay`
55 for the necessary steps.
diff --git a/Documentation/media/uapi/v4l/vidioc-prepare-buf.rst b/Documentation/media/uapi/v4l/vidioc-prepare-buf.rst
new file mode 100644
index 000000000000..79076dff46fd
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-prepare-buf.rst
@@ -0,0 +1,62 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_PREPARE_BUF:
4
5************************
6ioctl VIDIOC_PREPARE_BUF
7************************
8
9Name
10====
11
12VIDIOC_PREPARE_BUF - Prepare a buffer for I/O
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_buffer *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_PREPARE_BUF
29
30``argp``
31
32
33Description
34===========
35
36Applications can optionally call the :ref:`VIDIOC_PREPARE_BUF` ioctl to
37pass ownership of the buffer to the driver before actually enqueuing it,
38using the :ref:`VIDIOC_QBUF` ioctl, and to prepare it for future I/O. Such
39preparations may include cache invalidation or cleaning. Performing them
40in advance saves time during the actual I/O. In case such cache
41operations are not required, the application can use one of
42``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE`` and
43``V4L2_BUF_FLAG_NO_CACHE_CLEAN`` flags to skip the respective step.
44
45The :ref:`struct v4l2_buffer <v4l2-buffer>` structure is specified in
46:ref:`buffer`.
47
48
49Return Value
50============
51
52On success 0 is returned, on error -1 and the ``errno`` variable is set
53appropriately. The generic error codes are described at the
54:ref:`Generic Error Codes <gen-errors>` chapter.
55
56EBUSY
57 File I/O is in progress.
58
59EINVAL
60 The buffer ``type`` is not supported, or the ``index`` is out of
61 bounds, or no buffers have been allocated yet, or the ``userptr`` or
62 ``length`` are invalid.
diff --git a/Documentation/media/uapi/v4l/vidioc-qbuf.rst b/Documentation/media/uapi/v4l/vidioc-qbuf.rst
new file mode 100644
index 000000000000..3b927f36fb5b
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-qbuf.rst
@@ -0,0 +1,151 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QBUF:
4
5*******************************
6ioctl VIDIOC_QBUF, VIDIOC_DQBUF
7*******************************
8
9Name
10====
11
12VIDIOC_QBUF - VIDIOC_DQBUF - Exchange a buffer with the driver
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_buffer *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_QBUF, VIDIOC_DQBUF
29
30``argp``
31
32
33Description
34===========
35
36Applications call the ``VIDIOC_QBUF`` ioctl to enqueue an empty
37(capturing) or filled (output) buffer in the driver's incoming queue.
38The semantics depend on the selected I/O method.
39
40To enqueue a buffer applications set the ``type`` field of a struct
41:ref:`v4l2_buffer <v4l2-buffer>` to the same buffer type as was
42previously used with struct :ref:`v4l2_format <v4l2-format>` ``type``
43and struct :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``.
44Applications must also set the ``index`` field. Valid index numbers
45range from zero to the number of buffers allocated with
46:ref:`VIDIOC_REQBUFS` (struct
47:ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``count``) minus
48one. The contents of the struct :ref:`struct v4l2_buffer <v4l2-buffer>` returned
49by a :ref:`VIDIOC_QUERYBUF` ioctl will do as well.
50When the buffer is intended for output (``type`` is
51``V4L2_BUF_TYPE_VIDEO_OUTPUT``, ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``,
52or ``V4L2_BUF_TYPE_VBI_OUTPUT``) applications must also initialize the
53``bytesused``, ``field`` and ``timestamp`` fields, see :ref:`buffer`
54for details. Applications must also set ``flags`` to 0. The
55``reserved2`` and ``reserved`` fields must be set to 0. When using the
56:ref:`multi-planar API <planar-apis>`, the ``m.planes`` field must
57contain a userspace pointer to a filled-in array of struct
58:ref:`v4l2_plane <v4l2-plane>` and the ``length`` field must be set
59to the number of elements in that array.
60
61To enqueue a :ref:`memory mapped <mmap>` buffer applications set the
62``memory`` field to ``V4L2_MEMORY_MMAP``. When ``VIDIOC_QBUF`` is called
63with a pointer to this structure the driver sets the
64``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_QUEUED`` flags and clears
65the ``V4L2_BUF_FLAG_DONE`` flag in the ``flags`` field, or it returns an
66EINVAL error code.
67
68To enqueue a :ref:`user pointer <userp>` buffer applications set the
69``memory`` field to ``V4L2_MEMORY_USERPTR``, the ``m.userptr`` field to
70the address of the buffer and ``length`` to its size. When the
71multi-planar API is used, ``m.userptr`` and ``length`` members of the
72passed array of struct :ref:`v4l2_plane <v4l2-plane>` have to be used
73instead. When ``VIDIOC_QBUF`` is called with a pointer to this structure
74the driver sets the ``V4L2_BUF_FLAG_QUEUED`` flag and clears the
75``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_DONE`` flags in the
76``flags`` field, or it returns an error code. This ioctl locks the
77memory pages of the buffer in physical memory, they cannot be swapped
78out to disk. Buffers remain locked until dequeued, until the
79:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` or
80:ref:`VIDIOC_REQBUFS` ioctl is called, or until the
81device is closed.
82
83To enqueue a :ref:`DMABUF <dmabuf>` buffer applications set the
84``memory`` field to ``V4L2_MEMORY_DMABUF`` and the ``m.fd`` field to a
85file descriptor associated with a DMABUF buffer. When the multi-planar
86API is used the ``m.fd`` fields of the passed array of struct
87:ref:`v4l2_plane <v4l2-plane>` have to be used instead. When
88``VIDIOC_QBUF`` is called with a pointer to this structure the driver
89sets the ``V4L2_BUF_FLAG_QUEUED`` flag and clears the
90``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_DONE`` flags in the
91``flags`` field, or it returns an error code. This ioctl locks the
92buffer. Locking a buffer means passing it to a driver for a hardware
93access (usually DMA). If an application accesses (reads/writes) a locked
94buffer then the result is undefined. Buffers remain locked until
95dequeued, until the :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` or
96:ref:`VIDIOC_REQBUFS` ioctl is called, or until the
97device is closed.
98
99Applications call the ``VIDIOC_DQBUF`` ioctl to dequeue a filled
100(capturing) or displayed (output) buffer from the driver's outgoing
101queue. They just set the ``type``, ``memory`` and ``reserved`` fields of
102a struct :ref:`v4l2_buffer <v4l2-buffer>` as above, when
103``VIDIOC_DQBUF`` is called with a pointer to this structure the driver
104fills the remaining fields or returns an error code. The driver may also
105set ``V4L2_BUF_FLAG_ERROR`` in the ``flags`` field. It indicates a
106non-critical (recoverable) streaming error. In such case the application
107may continue as normal, but should be aware that data in the dequeued
108buffer might be corrupted. When using the multi-planar API, the planes
109array must be passed in as well.
110
111By default ``VIDIOC_DQBUF`` blocks when no buffer is in the outgoing
112queue. When the ``O_NONBLOCK`` flag was given to the
113:ref:`open() <func-open>` function, ``VIDIOC_DQBUF`` returns
114immediately with an ``EAGAIN`` error code when no buffer is available.
115
116The :ref:`struct v4l2_buffer <v4l2-buffer>` structure is specified in
117:ref:`buffer`.
118
119
120Return Value
121============
122
123On success 0 is returned, on error -1 and the ``errno`` variable is set
124appropriately. The generic error codes are described at the
125:ref:`Generic Error Codes <gen-errors>` chapter.
126
127EAGAIN
128 Non-blocking I/O has been selected using ``O_NONBLOCK`` and no
129 buffer was in the outgoing queue.
130
131EINVAL
132 The buffer ``type`` is not supported, or the ``index`` is out of
133 bounds, or no buffers have been allocated yet, or the ``userptr`` or
134 ``length`` are invalid.
135
136EIO
137 ``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate
138 temporary problems like signal loss.
139
140 .. note:: The driver might dequeue an (empty) buffer despite returning
141 an error, or even stop capturing. Reusing such buffer may be unsafe
142 though and its details (e.g. ``index``) may not be returned either.
143 It is recommended that drivers indicate recoverable errors by setting
144 the ``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the
145 application should be able to safely reuse the buffer and continue
146 streaming.
147
148EPIPE
149 ``VIDIOC_DQBUF`` returns this on an empty capture queue for mem2mem
150 codecs if a buffer with the ``V4L2_BUF_FLAG_LAST`` was already
151 dequeued and no new buffers are expected to become available.
diff --git a/Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst b/Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst
new file mode 100644
index 000000000000..416d8d604af4
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst
@@ -0,0 +1,83 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QUERY_DV_TIMINGS:
4
5*****************************
6ioctl VIDIOC_QUERY_DV_TIMINGS
7*****************************
8
9Name
10====
11
12VIDIOC_QUERY_DV_TIMINGS - VIDIOC_SUBDEV_QUERY_DV_TIMINGS - Sense the DV preset received by the current input
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_dv_timings *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERY_DV_TIMINGS
29
30``argp``
31
32
33Description
34===========
35
36The hardware may be able to detect the current DV timings automatically,
37similar to sensing the video standard. To do so, applications call
38:ref:`VIDIOC_QUERY_DV_TIMINGS` with a pointer to a struct
39:ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects
40the timings, it will fill in the timings structure.
41
42.. note:: Drivers shall *not* switch timings automatically if new
43 timings are detected. Instead, drivers should send the
44 ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect
45 that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`.
46 The reason is that new timings usually mean different buffer sizes as
47 well, and you cannot change buffer sizes on the fly. In general,
48 applications that receive the Source Change event will have to call
49 :ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they
50 will have to stop streaming, set the new timings, allocate new buffers
51 and start streaming again.
52
53If the timings could not be detected because there was no signal, then
54ENOLINK is returned. If a signal was detected, but it was unstable and
55the receiver could not lock to the signal, then ``ENOLCK`` is returned. If
56the receiver could lock to the signal, but the format is unsupported
57(e.g. because the pixelclock is out of range of the hardware
58capabilities), then the driver fills in whatever timings it could find
59and returns ``ERANGE``. In that case the application can call
60:ref:`VIDIOC_DV_TIMINGS_CAP` to compare the
61found timings with the hardware's capabilities in order to give more
62precise feedback to the user.
63
64
65Return Value
66============
67
68On success 0 is returned, on error -1 and the ``errno`` variable is set
69appropriately. The generic error codes are described at the
70:ref:`Generic Error Codes <gen-errors>` chapter.
71
72ENODATA
73 Digital video timings are not supported for this input or output.
74
75ENOLINK
76 No timings could be detected because no signal was found.
77
78ENOLCK
79 The signal was unstable and the hardware could not lock on to it.
80
81ERANGE
82 Timings were found, but they are out of range of the hardware
83 capabilities.
diff --git a/Documentation/media/uapi/v4l/vidioc-querybuf.rst b/Documentation/media/uapi/v4l/vidioc-querybuf.rst
new file mode 100644
index 000000000000..32af6f7b5060
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-querybuf.rst
@@ -0,0 +1,81 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QUERYBUF:
4
5*********************
6ioctl VIDIOC_QUERYBUF
7*********************
8
9Name
10====
11
12VIDIOC_QUERYBUF - Query the status of a buffer
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_buffer *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_QUERYBUF
29
30``argp``
31
32
33Description
34===========
35
36This ioctl is part of the :ref:`streaming <mmap>` I/O method. It can
37be used to query the status of a buffer at any time after buffers have
38been allocated with the :ref:`VIDIOC_REQBUFS` ioctl.
39
40Applications set the ``type`` field of a struct
41:ref:`v4l2_buffer <v4l2-buffer>` to the same buffer type as was
42previously used with struct :ref:`v4l2_format <v4l2-format>` ``type``
43and struct :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``,
44and the ``index`` field. Valid index numbers range from zero to the
45number of buffers allocated with
46:ref:`VIDIOC_REQBUFS` (struct
47:ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``count``) minus
48one. The ``reserved`` and ``reserved2`` fields must be set to 0. When
49using the :ref:`multi-planar API <planar-apis>`, the ``m.planes``
50field must contain a userspace pointer to an array of struct
51:ref:`v4l2_plane <v4l2-plane>` and the ``length`` field has to be set
52to the number of elements in that array. After calling
53:ref:`VIDIOC_QUERYBUF` with a pointer to this structure drivers return an
54error code or fill the rest of the structure.
55
56In the ``flags`` field the ``V4L2_BUF_FLAG_MAPPED``,
57``V4L2_BUF_FLAG_PREPARED``, ``V4L2_BUF_FLAG_QUEUED`` and
58``V4L2_BUF_FLAG_DONE`` flags will be valid. The ``memory`` field will be
59set to the current I/O method. For the single-planar API, the
60``m.offset`` contains the offset of the buffer from the start of the
61device memory, the ``length`` field its size. For the multi-planar API,
62fields ``m.mem_offset`` and ``length`` in the ``m.planes`` array
63elements will be used instead and the ``length`` field of struct
64:ref:`v4l2_buffer <v4l2-buffer>` is set to the number of filled-in
65array elements. The driver may or may not set the remaining fields and
66flags, they are meaningless in this context.
67
68The :ref:`struct v4l2_buffer <v4l2-buffer>` structure is specified in
69:ref:`buffer`.
70
71
72Return Value
73============
74
75On success 0 is returned, on error -1 and the ``errno`` variable is set
76appropriately. The generic error codes are described at the
77:ref:`Generic Error Codes <gen-errors>` chapter.
78
79EINVAL
80 The buffer ``type`` is not supported, or the ``index`` is out of
81 bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-querycap.rst b/Documentation/media/uapi/v4l/vidioc-querycap.rst
new file mode 100644
index 000000000000..b10fed313f99
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-querycap.rst
@@ -0,0 +1,434 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QUERYCAP:
4
5*********************
6ioctl VIDIOC_QUERYCAP
7*********************
8
9Name
10====
11
12VIDIOC_QUERYCAP - Query device capabilities
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_capability *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_QUERYCAP
29
30``argp``
31
32
33Description
34===========
35
36All V4L2 devices support the ``VIDIOC_QUERYCAP`` ioctl. It is used to
37identify kernel devices compatible with this specification and to obtain
38information about driver and hardware capabilities. The ioctl takes a
39pointer to a struct :ref:`v4l2_capability <v4l2-capability>` which is
40filled by the driver. When the driver is not compatible with this
41specification the ioctl returns an ``EINVAL`` error code.
42
43
44.. _v4l2-capability:
45
46.. flat-table:: struct v4l2_capability
47 :header-rows: 0
48 :stub-columns: 0
49 :widths: 1 1 2
50
51
52 - .. row 1
53
54 - __u8
55
56 - ``driver``\ [16]
57
58 - Name of the driver, a unique NUL-terminated ASCII string. For
59 example: "bttv". Driver specific applications can use this
60 information to verify the driver identity. It is also useful to
61 work around known bugs, or to identify drivers in error reports.
62
63 Storing strings in fixed sized arrays is bad practice but
64 unavoidable here. Drivers and applications should take precautions
65 to never read or write beyond the end of the array and to make
66 sure the strings are properly NUL-terminated.
67
68 - .. row 2
69
70 - __u8
71
72 - ``card``\ [32]
73
74 - Name of the device, a NUL-terminated UTF-8 string. For example:
75 "Yoyodyne TV/FM". One driver may support different brands or
76 models of video hardware. This information is intended for users,
77 for example in a menu of available devices. Since multiple TV
78 cards of the same brand may be installed which are supported by
79 the same driver, this name should be combined with the character
80 device file name (e. g. ``/dev/video2``) or the ``bus_info``
81 string to avoid ambiguities.
82
83 - .. row 3
84
85 - __u8
86
87 - ``bus_info``\ [32]
88
89 - Location of the device in the system, a NUL-terminated ASCII
90 string. For example: "PCI:0000:05:06.0". This information is
91 intended for users, to distinguish multiple identical devices. If
92 no such information is available the field must simply count the
93 devices controlled by the driver ("platform:vivi-000"). The
94 bus_info must start with "PCI:" for PCI boards, "PCIe:" for PCI
95 Express boards, "usb-" for USB devices, "I2C:" for i2c devices,
96 "ISA:" for ISA devices, "parport" for parallel port devices and
97 "platform:" for platform devices.
98
99 - .. row 4
100
101 - __u32
102
103 - ``version``
104
105 - Version number of the driver.
106
107 Starting with kernel 3.1, the version reported is provided by the
108 V4L2 subsystem following the kernel numbering scheme. However, it
109 may not always return the same version as the kernel if, for
110 example, a stable or distribution-modified kernel uses the V4L2
111 stack from a newer kernel.
112
113 The version number is formatted using the ``KERNEL_VERSION()``
114 macro:
115
116 - .. row 5
117
118 - :cspan:`2`
119
120
121 .. code-block:: c
122
123 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
124
125 __u32 version = KERNEL_VERSION(0, 8, 1);
126
127 printf ("Version: %u.%u.%u\\n",
128 (version >> 16) & 0xFF,
129 (version >> 8) & 0xFF,
130 version & 0xFF);
131
132 - .. row 6
133
134 - __u32
135
136 - ``capabilities``
137
138 - Available capabilities of the physical device as a whole, see
139 :ref:`device-capabilities`. The same physical device can export
140 multiple devices in /dev (e.g. /dev/videoX, /dev/vbiY and
141 /dev/radioZ). The ``capabilities`` field should contain a union of
142 all capabilities available around the several V4L2 devices
143 exported to userspace. For all those devices the ``capabilities``
144 field returns the same set of capabilities. This allows
145 applications to open just one of the devices (typically the video
146 device) and discover whether video, vbi and/or radio are also
147 supported.
148
149 - .. row 7
150
151 - __u32
152
153 - ``device_caps``
154
155 - Device capabilities of the opened device, see
156 :ref:`device-capabilities`. Should contain the available
157 capabilities of that specific device node. So, for example,
158 ``device_caps`` of a radio device will only contain radio related
159 capabilities and no video or vbi capabilities. This field is only
160 set if the ``capabilities`` field contains the
161 ``V4L2_CAP_DEVICE_CAPS`` capability. Only the ``capabilities``
162 field can have the ``V4L2_CAP_DEVICE_CAPS`` capability,
163 ``device_caps`` will never set ``V4L2_CAP_DEVICE_CAPS``.
164
165 - .. row 8
166
167 - __u32
168
169 - ``reserved``\ [3]
170
171 - Reserved for future extensions. Drivers must set this array to
172 zero.
173
174
175
176.. _device-capabilities:
177
178.. flat-table:: Device Capabilities Flags
179 :header-rows: 0
180 :stub-columns: 0
181 :widths: 3 1 4
182
183
184 - .. row 1
185
186 - ``V4L2_CAP_VIDEO_CAPTURE``
187
188 - 0x00000001
189
190 - The device supports the single-planar API through the
191 :ref:`Video Capture <capture>` interface.
192
193 - .. row 2
194
195 - ``V4L2_CAP_VIDEO_CAPTURE_MPLANE``
196
197 - 0x00001000
198
199 - The device supports the :ref:`multi-planar API <planar-apis>`
200 through the :ref:`Video Capture <capture>` interface.
201
202 - .. row 3
203
204 - ``V4L2_CAP_VIDEO_OUTPUT``
205
206 - 0x00000002
207
208 - The device supports the single-planar API through the
209 :ref:`Video Output <output>` interface.
210
211 - .. row 4
212
213 - ``V4L2_CAP_VIDEO_OUTPUT_MPLANE``
214
215 - 0x00002000
216
217 - The device supports the :ref:`multi-planar API <planar-apis>`
218 through the :ref:`Video Output <output>` interface.
219
220 - .. row 5
221
222 - ``V4L2_CAP_VIDEO_M2M``
223
224 - 0x00004000
225
226 - The device supports the single-planar API through the Video
227 Memory-To-Memory interface.
228
229 - .. row 6
230
231 - ``V4L2_CAP_VIDEO_M2M_MPLANE``
232
233 - 0x00008000
234
235 - The device supports the :ref:`multi-planar API <planar-apis>`
236 through the Video Memory-To-Memory interface.
237
238 - .. row 7
239
240 - ``V4L2_CAP_VIDEO_OVERLAY``
241
242 - 0x00000004
243
244 - The device supports the :ref:`Video Overlay <overlay>`
245 interface. A video overlay device typically stores captured images
246 directly in the video memory of a graphics card, with hardware
247 clipping and scaling.
248
249 - .. row 8
250
251 - ``V4L2_CAP_VBI_CAPTURE``
252
253 - 0x00000010
254
255 - The device supports the :ref:`Raw VBI Capture <raw-vbi>`
256 interface, providing Teletext and Closed Caption data.
257
258 - .. row 9
259
260 - ``V4L2_CAP_VBI_OUTPUT``
261
262 - 0x00000020
263
264 - The device supports the :ref:`Raw VBI Output <raw-vbi>`
265 interface.
266
267 - .. row 10
268
269 - ``V4L2_CAP_SLICED_VBI_CAPTURE``
270
271 - 0x00000040
272
273 - The device supports the :ref:`Sliced VBI Capture <sliced>`
274 interface.
275
276 - .. row 11
277
278 - ``V4L2_CAP_SLICED_VBI_OUTPUT``
279
280 - 0x00000080
281
282 - The device supports the :ref:`Sliced VBI Output <sliced>`
283 interface.
284
285 - .. row 12
286
287 - ``V4L2_CAP_RDS_CAPTURE``
288
289 - 0x00000100
290
291 - The device supports the :ref:`RDS <rds>` capture interface.
292
293 - .. row 13
294
295 - ``V4L2_CAP_VIDEO_OUTPUT_OVERLAY``
296
297 - 0x00000200
298
299 - The device supports the :ref:`Video Output Overlay <osd>` (OSD)
300 interface. Unlike the *Video Overlay* interface, this is a
301 secondary function of video output devices and overlays an image
302 onto an outgoing video signal. When the driver sets this flag, it
303 must clear the ``V4L2_CAP_VIDEO_OVERLAY`` flag and vice
304 versa. [#f1]_
305
306 - .. row 14
307
308 - ``V4L2_CAP_HW_FREQ_SEEK``
309
310 - 0x00000400
311
312 - The device supports the
313 :ref:`VIDIOC_S_HW_FREQ_SEEK` ioctl
314 for hardware frequency seeking.
315
316 - .. row 15
317
318 - ``V4L2_CAP_RDS_OUTPUT``
319
320 - 0x00000800
321
322 - The device supports the :ref:`RDS <rds>` output interface.
323
324 - .. row 16
325
326 - ``V4L2_CAP_TUNER``
327
328 - 0x00010000
329
330 - The device has some sort of tuner to receive RF-modulated video
331 signals. For more information about tuner programming see
332 :ref:`tuner`.
333
334 - .. row 17
335
336 - ``V4L2_CAP_AUDIO``
337
338 - 0x00020000
339
340 - The device has audio inputs or outputs. It may or may not support
341 audio recording or playback, in PCM or compressed formats. PCM
342 audio support must be implemented as ALSA or OSS interface. For
343 more information on audio inputs and outputs see :ref:`audio`.
344
345 - .. row 18
346
347 - ``V4L2_CAP_RADIO``
348
349 - 0x00040000
350
351 - This is a radio receiver.
352
353 - .. row 19
354
355 - ``V4L2_CAP_MODULATOR``
356
357 - 0x00080000
358
359 - The device has some sort of modulator to emit RF-modulated
360 video/audio signals. For more information about modulator
361 programming see :ref:`tuner`.
362
363 - .. row 20
364
365 - ``V4L2_CAP_SDR_CAPTURE``
366
367 - 0x00100000
368
369 - The device supports the :ref:`SDR Capture <sdr>` interface.
370
371 - .. row 21
372
373 - ``V4L2_CAP_EXT_PIX_FORMAT``
374
375 - 0x00200000
376
377 - The device supports the struct
378 :ref:`v4l2_pix_format <v4l2-pix-format>` extended fields.
379
380 - .. row 22
381
382 - ``V4L2_CAP_SDR_OUTPUT``
383
384 - 0x00400000
385
386 - The device supports the :ref:`SDR Output <sdr>` interface.
387
388 - .. row 23
389
390 - ``V4L2_CAP_READWRITE``
391
392 - 0x01000000
393
394 - The device supports the :ref:`read() <rw>` and/or
395 :ref:`write() <rw>` I/O methods.
396
397 - .. row 24
398
399 - ``V4L2_CAP_ASYNCIO``
400
401 - 0x02000000
402
403 - The device supports the :ref:`asynchronous <async>` I/O methods.
404
405 - .. row 25
406
407 - ``V4L2_CAP_STREAMING``
408
409 - 0x04000000
410
411 - The device supports the :ref:`streaming <mmap>` I/O method.
412
413 - .. row 26
414
415 - ``V4L2_CAP_DEVICE_CAPS``
416
417 - 0x80000000
418
419 - The driver fills the ``device_caps`` field. This capability can
420 only appear in the ``capabilities`` field and never in the
421 ``device_caps`` field.
422
423
424Return Value
425============
426
427On success 0 is returned, on error -1 and the ``errno`` variable is set
428appropriately. The generic error codes are described at the
429:ref:`Generic Error Codes <gen-errors>` chapter.
430
431.. [#f1]
432 The struct :ref:`v4l2_framebuffer <v4l2-framebuffer>` lacks an
433 enum :ref:`v4l2_buf_type <v4l2-buf-type>` field, therefore the
434 type of overlay is implied by the driver capabilities.
diff --git a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
new file mode 100644
index 000000000000..8d6e61a7284d
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
@@ -0,0 +1,785 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QUERYCTRL:
4
5*******************************************************************
6ioctls VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL and VIDIOC_QUERYMENU
7*******************************************************************
8
9Name
10====
11
12VIDIOC_QUERYCTRL - VIDIOC_QUERY_EXT_CTRL - VIDIOC_QUERYMENU - Enumerate controls and menu control items
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_queryctrl *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, struct v4l2_query_ext_ctrl *argp )
21
22.. cpp:function:: int ioctl( int fd, int request, struct v4l2_querymenu *argp )
23
24
25Arguments
26=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
31``request``
32 VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL, VIDIOC_QUERYMENU
33
34``argp``
35
36
37Description
38===========
39
40To query the attributes of a control applications set the ``id`` field
41of a struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` and call the
42``VIDIOC_QUERYCTRL`` ioctl with a pointer to this structure. The driver
43fills the rest of the structure or returns an ``EINVAL`` error code when the
44``id`` is invalid.
45
46It is possible to enumerate controls by calling ``VIDIOC_QUERYCTRL``
47with successive ``id`` values starting from ``V4L2_CID_BASE`` up to and
48exclusive ``V4L2_CID_LASTP1``. Drivers may return ``EINVAL`` if a control in
49this range is not supported. Further applications can enumerate private
50controls, which are not defined in this specification, by starting at
51``V4L2_CID_PRIVATE_BASE`` and incrementing ``id`` until the driver
52returns ``EINVAL``.
53
54In both cases, when the driver sets the ``V4L2_CTRL_FLAG_DISABLED`` flag
55in the ``flags`` field this control is permanently disabled and should
56be ignored by the application. [#f1]_
57
58When the application ORs ``id`` with ``V4L2_CTRL_FLAG_NEXT_CTRL`` the
59driver returns the next supported non-compound control, or ``EINVAL`` if
60there is none. In addition, the ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` flag
61can be specified to enumerate all compound controls (i.e. controls with
62type ≥ ``V4L2_CTRL_COMPOUND_TYPES`` and/or array control, in other words
63controls that contain more than one value). Specify both
64``V4L2_CTRL_FLAG_NEXT_CTRL`` and ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` in
65order to enumerate all controls, compound or not. Drivers which do not
66support these flags yet always return ``EINVAL``.
67
68The ``VIDIOC_QUERY_EXT_CTRL`` ioctl was introduced in order to better
69support controls that can use compound types, and to expose additional
70control information that cannot be returned in struct
71:ref:`v4l2_queryctrl <v4l2-queryctrl>` since that structure is full.
72
73``VIDIOC_QUERY_EXT_CTRL`` is used in the same way as
74``VIDIOC_QUERYCTRL``, except that the ``reserved`` array must be zeroed
75as well.
76
77Additional information is required for menu controls: the names of the
78menu items. To query them applications set the ``id`` and ``index``
79fields of struct :ref:`v4l2_querymenu <v4l2-querymenu>` and call the
80``VIDIOC_QUERYMENU`` ioctl with a pointer to this structure. The driver
81fills the rest of the structure or returns an ``EINVAL`` error code when the
82``id`` or ``index`` is invalid. Menu items are enumerated by calling
83``VIDIOC_QUERYMENU`` with successive ``index`` values from struct
84:ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``,
85inclusive.
86
87.. note:: It is possible for ``VIDIOC_QUERYMENU`` to return
88 an ``EINVAL`` error code for some indices between ``minimum`` and
89 ``maximum``. In that case that particular menu item is not supported by
90 this driver. Also note that the ``minimum`` value is not necessarily 0.
91
92See also the examples in :ref:`control`.
93
94
95.. _v4l2-queryctrl:
96
97.. flat-table:: struct v4l2_queryctrl
98 :header-rows: 0
99 :stub-columns: 0
100 :widths: 1 1 2
101
102
103 - .. row 1
104
105 - __u32
106
107 - ``id``
108
109 - Identifies the control, set by the application. See
110 :ref:`control-id` for predefined IDs. When the ID is ORed with
111 V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and
112 returns the first control with a higher ID. Drivers which do not
113 support this flag yet always return an ``EINVAL`` error code.
114
115 - .. row 2
116
117 - __u32
118
119 - ``type``
120
121 - Type of control, see :ref:`v4l2-ctrl-type`.
122
123 - .. row 3
124
125 - __u8
126
127 - ``name``\ [32]
128
129 - Name of the control, a NUL-terminated ASCII string. This
130 information is intended for the user.
131
132 - .. row 4
133
134 - __s32
135
136 - ``minimum``
137
138 - Minimum value, inclusive. This field gives a lower bound for the
139 control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
140 the minimum value is to be used for each possible control type.
141 Note that this a signed 32-bit value.
142
143 - .. row 5
144
145 - __s32
146
147 - ``maximum``
148
149 - Maximum value, inclusive. This field gives an upper bound for the
150 control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
151 the maximum value is to be used for each possible control type.
152 Note that this a signed 32-bit value.
153
154 - .. row 6
155
156 - __s32
157
158 - ``step``
159
160 - This field gives a step size for the control. See enum
161 :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how the step value is
162 to be used for each possible control type. Note that this an
163 unsigned 32-bit value.
164
165 Generally drivers should not scale hardware control values. It may
166 be necessary for example when the ``name`` or ``id`` imply a
167 particular unit and the hardware actually accepts only multiples
168 of said unit. If so, drivers must take care values are properly
169 rounded when scaling, such that errors will not accumulate on
170 repeated read-write cycles.
171
172 This field gives the smallest change of an integer control
173 actually affecting hardware. Often the information is needed when
174 the user can change controls by keyboard or GUI buttons, rather
175 than a slider. When for example a hardware register accepts values
176 0-511 and the driver reports 0-65535, step should be 128.
177
178 Note that although signed, the step value is supposed to be always
179 positive.
180
181 - .. row 7
182
183 - __s32
184
185 - ``default_value``
186
187 - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_BOOLEAN``,
188 ``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid
189 for other types of controls.
190
191 .. note:: Drivers reset controls to their default value only when
192 the driver is first loaded, never afterwards.
193
194 - .. row 8
195
196 - __u32
197
198 - ``flags``
199
200 - Control flags, see :ref:`control-flags`.
201
202 - .. row 9
203
204 - __u32
205
206 - ``reserved``\ [2]
207
208 - Reserved for future extensions. Drivers must set the array to
209 zero.
210
211
212
213.. _v4l2-query-ext-ctrl:
214
215.. flat-table:: struct v4l2_query_ext_ctrl
216 :header-rows: 0
217 :stub-columns: 0
218 :widths: 1 1 2
219
220
221 - .. row 1
222
223 - __u32
224
225 - ``id``
226
227 - Identifies the control, set by the application. See
228 :ref:`control-id` for predefined IDs. When the ID is ORed with
229 ``V4L2_CTRL_FLAG_NEXT_CTRL`` the driver clears the flag and
230 returns the first non-compound control with a higher ID. When the
231 ID is ORed with ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` the driver clears
232 the flag and returns the first compound control with a higher ID.
233 Set both to get the first control (compound or not) with a higher
234 ID.
235
236 - .. row 2
237
238 - __u32
239
240 - ``type``
241
242 - Type of control, see :ref:`v4l2-ctrl-type`.
243
244 - .. row 3
245
246 - char
247
248 - ``name``\ [32]
249
250 - Name of the control, a NUL-terminated ASCII string. This
251 information is intended for the user.
252
253 - .. row 4
254
255 - __s64
256
257 - ``minimum``
258
259 - Minimum value, inclusive. This field gives a lower bound for the
260 control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
261 the minimum value is to be used for each possible control type.
262 Note that this a signed 64-bit value.
263
264 - .. row 5
265
266 - __s64
267
268 - ``maximum``
269
270 - Maximum value, inclusive. This field gives an upper bound for the
271 control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
272 the maximum value is to be used for each possible control type.
273 Note that this a signed 64-bit value.
274
275 - .. row 6
276
277 - __u64
278
279 - ``step``
280
281 - This field gives a step size for the control. See enum
282 :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how the step value is
283 to be used for each possible control type. Note that this an
284 unsigned 64-bit value.
285
286 Generally drivers should not scale hardware control values. It may
287 be necessary for example when the ``name`` or ``id`` imply a
288 particular unit and the hardware actually accepts only multiples
289 of said unit. If so, drivers must take care values are properly
290 rounded when scaling, such that errors will not accumulate on
291 repeated read-write cycles.
292
293 This field gives the smallest change of an integer control
294 actually affecting hardware. Often the information is needed when
295 the user can change controls by keyboard or GUI buttons, rather
296 than a slider. When for example a hardware register accepts values
297 0-511 and the driver reports 0-65535, step should be 128.
298
299 - .. row 7
300
301 - __s64
302
303 - ``default_value``
304
305 - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_INTEGER64``,
306 ``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8``
307 or ``_U16`` control. Not valid for other types of controls.
308
309 .. note:: Drivers reset controls to their default value only when
310 the driver is first loaded, never afterwards.
311
312 - .. row 8
313
314 - __u32
315
316 - ``flags``
317
318 - Control flags, see :ref:`control-flags`.
319
320 - .. row 9
321
322 - __u32
323
324 - ``elem_size``
325
326 - The size in bytes of a single element of the array. Given a char
327 pointer ``p`` to a 3-dimensional array you can find the position
328 of cell ``(z, y, x)`` as follows:
329 ``p + ((z * dims[1] + y) * dims[0] + x) * elem_size``.
330 ``elem_size`` is always valid, also when the control isn't an
331 array. For string controls ``elem_size`` is equal to
332 ``maximum + 1``.
333
334 - .. row 10
335
336 - __u32
337
338 - ``elems``
339
340 - The number of elements in the N-dimensional array. If this control
341 is not an array, then ``elems`` is 1. The ``elems`` field can
342 never be 0.
343
344 - .. row 11
345
346 - __u32
347
348 - ``nr_of_dims``
349
350 - The number of dimension in the N-dimensional array. If this
351 control is not an array, then this field is 0.
352
353 - .. row 12
354
355 - __u32
356
357 - ``dims[V4L2_CTRL_MAX_DIMS]``
358
359 - The size of each dimension. The first ``nr_of_dims`` elements of
360 this array must be non-zero, all remaining elements must be zero.
361
362 - .. row 13
363
364 - __u32
365
366 - ``reserved``\ [32]
367
368 - Reserved for future extensions. Applications and drivers must set
369 the array to zero.
370
371
372
373.. _v4l2-querymenu:
374
375.. flat-table:: struct v4l2_querymenu
376 :header-rows: 0
377 :stub-columns: 0
378 :widths: 1 1 2 1
379
380
381 - .. row 1
382
383 - __u32
384
385 -
386 - ``id``
387
388 - Identifies the control, set by the application from the respective
389 struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id``.
390
391 - .. row 2
392
393 - __u32
394
395 -
396 - ``index``
397
398 - Index of the menu item, starting at zero, set by the application.
399
400 - .. row 3
401
402 - union
403
404 -
405 -
406 -
407
408 - .. row 4
409
410 -
411 - __u8
412
413 - ``name``\ [32]
414
415 - Name of the menu item, a NUL-terminated ASCII string. This
416 information is intended for the user. This field is valid for
417 ``V4L2_CTRL_FLAG_MENU`` type controls.
418
419 - .. row 5
420
421 -
422 - __s64
423
424 - ``value``
425
426 - Value of the integer menu item. This field is valid for
427 ``V4L2_CTRL_FLAG_INTEGER_MENU`` type controls.
428
429 - .. row 6
430
431 - __u32
432
433 -
434 - ``reserved``
435
436 - Reserved for future extensions. Drivers must set the array to
437 zero.
438
439
440
441.. _v4l2-ctrl-type:
442
443.. flat-table:: enum v4l2_ctrl_type
444 :header-rows: 1
445 :stub-columns: 0
446 :widths: 30 5 5 5 55
447
448
449 - .. row 1
450
451 - Type
452
453 - ``minimum``
454
455 - ``step``
456
457 - ``maximum``
458
459 - Description
460
461 - .. row 2
462
463 - ``V4L2_CTRL_TYPE_INTEGER``
464
465 - any
466
467 - any
468
469 - any
470
471 - An integer-valued control ranging from minimum to maximum
472 inclusive. The step value indicates the increment between values.
473
474 - .. row 3
475
476 - ``V4L2_CTRL_TYPE_BOOLEAN``
477
478 - 0
479
480 - 1
481
482 - 1
483
484 - A boolean-valued control. Zero corresponds to "disabled", and one
485 means "enabled".
486
487 - .. row 4
488
489 - ``V4L2_CTRL_TYPE_MENU``
490
491 - ≥ 0
492
493 - 1
494
495 - N-1
496
497 - The control has a menu of N choices. The names of the menu items
498 can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl.
499
500 - .. row 5
501
502 - ``V4L2_CTRL_TYPE_INTEGER_MENU``
503
504 - ≥ 0
505
506 - 1
507
508 - N-1
509
510 - The control has a menu of N choices. The values of the menu items
511 can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl. This is
512 similar to ``V4L2_CTRL_TYPE_MENU`` except that instead of strings,
513 the menu items are signed 64-bit integers.
514
515 - .. row 6
516
517 - ``V4L2_CTRL_TYPE_BITMASK``
518
519 - 0
520
521 - n/a
522
523 - any
524
525 - A bitmask field. The maximum value is the set of bits that can be
526 used, all other bits are to be 0. The maximum value is interpreted
527 as a __u32, allowing the use of bit 31 in the bitmask.
528
529 - .. row 7
530
531 - ``V4L2_CTRL_TYPE_BUTTON``
532
533 - 0
534
535 - 0
536
537 - 0
538
539 - A control which performs an action when set. Drivers must ignore
540 the value passed with ``VIDIOC_S_CTRL`` and return an ``EINVAL`` error
541 code on a ``VIDIOC_G_CTRL`` attempt.
542
543 - .. row 8
544
545 - ``V4L2_CTRL_TYPE_INTEGER64``
546
547 - any
548
549 - any
550
551 - any
552
553 - A 64-bit integer valued control. Minimum, maximum and step size
554 cannot be queried using ``VIDIOC_QUERYCTRL``. Only
555 ``VIDIOC_QUERY_EXT_CTRL`` can retrieve the 64-bit min/max/step
556 values, they should be interpreted as n/a when using
557 ``VIDIOC_QUERYCTRL``.
558
559 - .. row 9
560
561 - ``V4L2_CTRL_TYPE_STRING``
562
563 - ≥ 0
564
565 - ≥ 1
566
567 - ≥ 0
568
569 - The minimum and maximum string lengths. The step size means that
570 the string must be (minimum + N * step) characters long for N ≥ 0.
571 These lengths do not include the terminating zero, so in order to
572 pass a string of length 8 to
573 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you need to
574 set the ``size`` field of struct
575 :ref:`v4l2_ext_control <v4l2-ext-control>` to 9. For
576 :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you can set
577 the ``size`` field to ``maximum`` + 1. Which character encoding is
578 used will depend on the string control itself and should be part
579 of the control documentation.
580
581 - .. row 10
582
583 - ``V4L2_CTRL_TYPE_CTRL_CLASS``
584
585 - n/a
586
587 - n/a
588
589 - n/a
590
591 - This is not a control. When ``VIDIOC_QUERYCTRL`` is called with a
592 control ID equal to a control class code (see :ref:`ctrl-class`)
593 + 1, the ioctl returns the name of the control class and this
594 control type. Older drivers which do not support this feature
595 return an ``EINVAL`` error code.
596
597 - .. row 11
598
599 - ``V4L2_CTRL_TYPE_U8``
600
601 - any
602
603 - any
604
605 - any
606
607 - An unsigned 8-bit valued control ranging from minimum to maximum
608 inclusive. The step value indicates the increment between values.
609
610 - .. row 12
611
612 - ``V4L2_CTRL_TYPE_U16``
613
614 - any
615
616 - any
617
618 - any
619
620 - An unsigned 16-bit valued control ranging from minimum to maximum
621 inclusive. The step value indicates the increment between values.
622
623 - .. row 13
624
625 - ``V4L2_CTRL_TYPE_U32``
626
627 - any
628
629 - any
630
631 - any
632
633 - An unsigned 32-bit valued control ranging from minimum to maximum
634 inclusive. The step value indicates the increment between values.
635
636
637
638.. _control-flags:
639
640.. flat-table:: Control Flags
641 :header-rows: 0
642 :stub-columns: 0
643 :widths: 3 1 4
644
645
646 - .. row 1
647
648 - ``V4L2_CTRL_FLAG_DISABLED``
649
650 - 0x0001
651
652 - This control is permanently disabled and should be ignored by the
653 application. Any attempt to change the control will result in an
654 ``EINVAL`` error code.
655
656 - .. row 2
657
658 - ``V4L2_CTRL_FLAG_GRABBED``
659
660 - 0x0002
661
662 - This control is temporarily unchangeable, for example because
663 another application took over control of the respective resource.
664 Such controls may be displayed specially in a user interface.
665 Attempts to change the control may result in an ``EBUSY`` error code.
666
667 - .. row 3
668
669 - ``V4L2_CTRL_FLAG_READ_ONLY``
670
671 - 0x0004
672
673 - This control is permanently readable only. Any attempt to change
674 the control will result in an ``EINVAL`` error code.
675
676 - .. row 4
677
678 - ``V4L2_CTRL_FLAG_UPDATE``
679
680 - 0x0008
681
682 - A hint that changing this control may affect the value of other
683 controls within the same control class. Applications should update
684 their user interface accordingly.
685
686 - .. row 5
687
688 - ``V4L2_CTRL_FLAG_INACTIVE``
689
690 - 0x0010
691
692 - This control is not applicable to the current configuration and
693 should be displayed accordingly in a user interface. For example
694 the flag may be set on a MPEG audio level 2 bitrate control when
695 MPEG audio encoding level 1 was selected with another control.
696
697 - .. row 6
698
699 - ``V4L2_CTRL_FLAG_SLIDER``
700
701 - 0x0020
702
703 - A hint that this control is best represented as a slider-like
704 element in a user interface.
705
706 - .. row 7
707
708 - ``V4L2_CTRL_FLAG_WRITE_ONLY``
709
710 - 0x0040
711
712 - This control is permanently writable only. Any attempt to read the
713 control will result in an ``EACCES`` error code error code. This flag
714 is typically present for relative controls or action controls
715 where writing a value will cause the device to carry out a given
716 action (e. g. motor control) but no meaningful value can be
717 returned.
718
719 - .. row 8
720
721 - ``V4L2_CTRL_FLAG_VOLATILE``
722
723 - 0x0080
724
725 - This control is volatile, which means that the value of the
726 control changes continuously. A typical example would be the
727 current gain value if the device is in auto-gain mode. In such a
728 case the hardware calculates the gain value based on the lighting
729 conditions which can change over time.
730
731 .. note:: Setting a new value for a volatile control will have no
732 effect and no ``V4L2_EVENT_CTRL_CH_VALUE`` will be sent, unless
733 the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` flag (see below) is
734 also set. Otherwise the new value will just be ignored.
735
736 - .. row 9
737
738 - ``V4L2_CTRL_FLAG_HAS_PAYLOAD``
739
740 - 0x0100
741
742 - This control has a pointer type, so its value has to be accessed
743 using one of the pointer fields of struct
744 :ref:`v4l2_ext_control <v4l2-ext-control>`. This flag is set
745 for controls that are an array, string, or have a compound type.
746 In all cases you have to set a pointer to memory containing the
747 payload of the control.
748
749 - .. row 10
750
751 - ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE``
752
753 - 0x0200
754
755 - The value provided to the control will be propagated to the driver
756 even if it remains constant. This is required when the control
757 represents an action on the hardware. For example: clearing an
758 error flag or triggering the flash. All the controls of the type
759 ``V4L2_CTRL_TYPE_BUTTON`` have this flag set.
760
761
762Return Value
763============
764
765On success 0 is returned, on error -1 and the ``errno`` variable is set
766appropriately. The generic error codes are described at the
767:ref:`Generic Error Codes <gen-errors>` chapter.
768
769EINVAL
770 The struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id`` is
771 invalid. The struct :ref:`v4l2_querymenu <v4l2-querymenu>` ``id``
772 is invalid or ``index`` is out of range (less than ``minimum`` or
773 greater than ``maximum``) or this particular menu item is not
774 supported by the driver.
775
776EACCES
777 An attempt was made to read a write-only control.
778
779.. [#f1]
780 ``V4L2_CTRL_FLAG_DISABLED`` was intended for two purposes: Drivers
781 can skip predefined controls not supported by the hardware (although
782 returning ``EINVAL`` would do as well), or disable predefined and private
783 controls after hardware detection without the trouble of reordering
784 control arrays and indices (``EINVAL`` cannot be used to skip private
785 controls because it would prematurely end the enumeration).
diff --git a/Documentation/media/uapi/v4l/vidioc-querystd.rst b/Documentation/media/uapi/v4l/vidioc-querystd.rst
new file mode 100644
index 000000000000..b4a4e222c7b0
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-querystd.rst
@@ -0,0 +1,66 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_QUERYSTD:
4
5*********************
6ioctl VIDIOC_QUERYSTD
7*********************
8
9Name
10====
11
12VIDIOC_QUERYSTD - Sense the video standard received by the current input
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, v4l2_std_id *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_QUERYSTD
29
30``argp``
31
32
33Description
34===========
35
36The hardware may be able to detect the current video standard
37automatically. To do so, applications call :ref:`VIDIOC_QUERYSTD` with a
38pointer to a :ref:`v4l2_std_id <v4l2-std-id>` type. The driver
39stores here a set of candidates, this can be a single flag or a set of
40supported standards if for example the hardware can only distinguish
41between 50 and 60 Hz systems. If no signal was detected, then the driver
42will return V4L2_STD_UNKNOWN. When detection is not possible or fails,
43the set must contain all standards supported by the current video input
44or output.
45
46.. note:: Drivers shall *not* switch the video standard
47 automatically if a new video standard is detected. Instead, drivers
48 should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support
49 this) and expect that userspace will take action by calling
50 :ref:`VIDIOC_QUERYSTD`. The reason is that a new video standard can mean
51 different buffer sizes as well, and you cannot change buffer sizes on
52 the fly. In general, applications that receive the Source Change event
53 will have to call :ref:`VIDIOC_QUERYSTD`, and if the detected video
54 standard is valid they will have to stop streaming, set the new
55 standard, allocate new buffers and start streaming again.
56
57
58Return Value
59============
60
61On success 0 is returned, on error -1 and the ``errno`` variable is set
62appropriately. The generic error codes are described at the
63:ref:`Generic Error Codes <gen-errors>` chapter.
64
65ENODATA
66 Standard video timings are not supported for this input or output.
diff --git a/Documentation/media/uapi/v4l/vidioc-reqbufs.rst b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst
new file mode 100644
index 000000000000..5d0bc6d31c07
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst
@@ -0,0 +1,125 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_REQBUFS:
4
5********************
6ioctl VIDIOC_REQBUFS
7********************
8
9Name
10====
11
12VIDIOC_REQBUFS - Initiate Memory Mapping, User Pointer I/O or DMA buffer I/O
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_requestbuffers *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_REQBUFS
29
30``argp``
31
32
33Description
34===========
35
36This ioctl is used to initiate :ref:`memory mapped <mmap>`,
37:ref:`user pointer <userp>` or :ref:`DMABUF <dmabuf>` based I/O.
38Memory mapped buffers are located in device memory and must be allocated
39with this ioctl before they can be mapped into the application's address
40space. User buffers are allocated by applications themselves, and this
41ioctl is merely used to switch the driver into user pointer I/O mode and
42to setup some internal structures. Similarly, DMABUF buffers are
43allocated by applications through a device driver, and this ioctl only
44configures the driver into DMABUF I/O mode without performing any direct
45allocation.
46
47To allocate device buffers applications initialize all fields of the
48:ref:`struct v4l2_requestbuffers <v4l2-requestbuffers>` structure. They set the ``type``
49field to the respective stream or buffer type, the ``count`` field to
50the desired number of buffers, ``memory`` must be set to the requested
51I/O method and the ``reserved`` array must be zeroed. When the ioctl is
52called with a pointer to this structure the driver will attempt to
53allocate the requested number of buffers and it stores the actual number
54allocated in the ``count`` field. It can be smaller than the number
55requested, even zero, when the driver runs out of free memory. A larger
56number is also possible when the driver requires more buffers to
57function correctly. For example video output requires at least two
58buffers, one displayed and one filled by the application.
59
60When the I/O method is not supported the ioctl returns an ``EINVAL`` error
61code.
62
63Applications can call :ref:`VIDIOC_REQBUFS` again to change the number of
64buffers, however this cannot succeed when any buffers are still mapped.
65A ``count`` value of zero frees all buffers, after aborting or finishing
66any DMA in progress, an implicit
67:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`.
68
69
70.. _v4l2-requestbuffers:
71
72.. flat-table:: struct v4l2_requestbuffers
73 :header-rows: 0
74 :stub-columns: 0
75 :widths: 1 1 2
76
77
78 - .. row 1
79
80 - __u32
81
82 - ``count``
83
84 - The number of buffers requested or granted.
85
86 - .. row 2
87
88 - __u32
89
90 - ``type``
91
92 - Type of the stream or buffers, this is the same as the struct
93 :ref:`v4l2_format <v4l2-format>` ``type`` field. See
94 :ref:`v4l2-buf-type` for valid values.
95
96 - .. row 3
97
98 - __u32
99
100 - ``memory``
101
102 - Applications set this field to ``V4L2_MEMORY_MMAP``,
103 ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See
104 :ref:`v4l2-memory`.
105
106 - .. row 4
107
108 - __u32
109
110 - ``reserved``\ [2]
111
112 - A place holder for future extensions. Drivers and applications
113 must set the array to zero.
114
115
116Return Value
117============
118
119On success 0 is returned, on error -1 and the ``errno`` variable is set
120appropriately. The generic error codes are described at the
121:ref:`Generic Error Codes <gen-errors>` chapter.
122
123EINVAL
124 The buffer type (``type`` field) or the requested I/O method
125 (``memory``) is not supported.
diff --git a/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst b/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst
new file mode 100644
index 000000000000..5fd332a5bfee
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst
@@ -0,0 +1,179 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_S_HW_FREQ_SEEK:
4
5***************************
6ioctl VIDIOC_S_HW_FREQ_SEEK
7***************************
8
9Name
10====
11
12VIDIOC_S_HW_FREQ_SEEK - Perform a hardware frequency seek
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_hw_freq_seek *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_S_HW_FREQ_SEEK
29
30``argp``
31
32
33Description
34===========
35
36Start a hardware frequency seek from the current frequency. To do this
37applications initialize the ``tuner``, ``type``, ``seek_upward``,
38``wrap_around``, ``spacing``, ``rangelow`` and ``rangehigh`` fields, and
39zero out the ``reserved`` array of a struct
40:ref:`v4l2_hw_freq_seek <v4l2-hw-freq-seek>` and call the
41``VIDIOC_S_HW_FREQ_SEEK`` ioctl with a pointer to this structure.
42
43The ``rangelow`` and ``rangehigh`` fields can be set to a non-zero value
44to tell the driver to search a specific band. If the struct
45:ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the
46``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag set, these values must fall
47within one of the bands returned by
48:ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
49``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag is not set, then these values
50must exactly match those of one of the bands returned by
51:ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
52current frequency of the tuner does not fall within the selected band it
53will be clamped to fit in the band before the seek is started.
54
55If an error is returned, then the original frequency will be restored.
56
57This ioctl is supported if the ``V4L2_CAP_HW_FREQ_SEEK`` capability is
58set.
59
60If this ioctl is called from a non-blocking filehandle, then ``EAGAIN``
61error code is returned and no seek takes place.
62
63
64.. _v4l2-hw-freq-seek:
65
66.. flat-table:: struct v4l2_hw_freq_seek
67 :header-rows: 0
68 :stub-columns: 0
69 :widths: 1 1 2
70
71
72 - .. row 1
73
74 - __u32
75
76 - ``tuner``
77
78 - The tuner index number. This is the same value as in the struct
79 :ref:`v4l2_input <v4l2-input>` ``tuner`` field and the struct
80 :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field.
81
82 - .. row 2
83
84 - __u32
85
86 - ``type``
87
88 - The tuner type. This is the same value as in the struct
89 :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. See
90 :ref:`v4l2-tuner-type`
91
92 - .. row 3
93
94 - __u32
95
96 - ``seek_upward``
97
98 - If non-zero, seek upward from the current frequency, else seek
99 downward.
100
101 - .. row 4
102
103 - __u32
104
105 - ``wrap_around``
106
107 - If non-zero, wrap around when at the end of the frequency range,
108 else stop seeking. The struct :ref:`v4l2_tuner <v4l2-tuner>`
109 ``capability`` field will tell you what the hardware supports.
110
111 - .. row 5
112
113 - __u32
114
115 - ``spacing``
116
117 - If non-zero, defines the hardware seek resolution in Hz. The
118 driver selects the nearest value that is supported by the device.
119 If spacing is zero a reasonable default value is used.
120
121 - .. row 6
122
123 - __u32
124
125 - ``rangelow``
126
127 - If non-zero, the lowest tunable frequency of the band to search in
128 units of 62.5 kHz, or if the struct
129 :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the
130 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
131 struct :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has
132 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
133 ``rangelow`` is zero a reasonable default value is used.
134
135 - .. row 7
136
137 - __u32
138
139 - ``rangehigh``
140
141 - If non-zero, the highest tunable frequency of the band to search
142 in units of 62.5 kHz, or if the struct
143 :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has the
144 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
145 struct :ref:`v4l2_tuner <v4l2-tuner>` ``capability`` field has
146 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
147 ``rangehigh`` is zero a reasonable default value is used.
148
149 - .. row 8
150
151 - __u32
152
153 - ``reserved``\ [5]
154
155 - Reserved for future extensions. Applications must set the array to
156 zero.
157
158
159Return Value
160============
161
162On success 0 is returned, on error -1 and the ``errno`` variable is set
163appropriately. The generic error codes are described at the
164:ref:`Generic Error Codes <gen-errors>` chapter.
165
166EINVAL
167 The ``tuner`` index is out of bounds, the ``wrap_around`` value is
168 not supported or one of the values in the ``type``, ``rangelow`` or
169 ``rangehigh`` fields is wrong.
170
171EAGAIN
172 Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in
173 non-blocking mode.
174
175ENODATA
176 The hardware seek found no channels.
177
178EBUSY
179 Another hardware seek is already in progress.
diff --git a/Documentation/media/uapi/v4l/vidioc-streamon.rst b/Documentation/media/uapi/v4l/vidioc-streamon.rst
new file mode 100644
index 000000000000..bb23745ebcaf
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-streamon.rst
@@ -0,0 +1,103 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_STREAMON:
4
5***************************************
6ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF
7***************************************
8
9Name
10====
11
12VIDIOC_STREAMON - VIDIOC_STREAMOFF - Start or stop streaming I/O
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, const int *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_STREAMON, VIDIOC_STREAMOFF
29
30``argp``
31
32
33Description
34===========
35
36The ``VIDIOC_STREAMON`` and ``VIDIOC_STREAMOFF`` ioctl start and stop
37the capture or output process during streaming
38(:ref:`memory mapping <mmap>`, :ref:`user pointer <userp>` or
39:ref:`DMABUF <dmabuf>`) I/O.
40
41Capture hardware is disabled and no input buffers are filled (if there
42are any empty buffers in the incoming queue) until ``VIDIOC_STREAMON``
43has been called. Output hardware is disabled and no video signal is
44produced until ``VIDIOC_STREAMON`` has been called. The ioctl will
45succeed when at least one output buffer is in the incoming queue.
46
47Memory-to-memory devices will not start until ``VIDIOC_STREAMON`` has
48been called for both the capture and output stream types.
49
50If ``VIDIOC_STREAMON`` fails then any already queued buffers will remain
51queued.
52
53The ``VIDIOC_STREAMOFF`` ioctl, apart of aborting or finishing any DMA
54in progress, unlocks any user pointer buffers locked in physical memory,
55and it removes all buffers from the incoming and outgoing queues. That
56means all images captured but not dequeued yet will be lost, likewise
57all images enqueued for output but not transmitted yet. I/O returns to
58the same state as after calling
59:ref:`VIDIOC_REQBUFS` and can be restarted
60accordingly.
61
62If buffers have been queued with :ref:`VIDIOC_QBUF` and
63``VIDIOC_STREAMOFF`` is called without ever having called
64``VIDIOC_STREAMON``, then those queued buffers will also be removed from
65the incoming queue and all are returned to the same state as after
66calling :ref:`VIDIOC_REQBUFS` and can be restarted
67accordingly.
68
69Both ioctls take a pointer to an integer, the desired buffer or stream
70type. This is the same as struct
71:ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``.
72
73If ``VIDIOC_STREAMON`` is called when streaming is already in progress,
74or if ``VIDIOC_STREAMOFF`` is called when streaming is already stopped,
75then 0 is returned. Nothing happens in the case of ``VIDIOC_STREAMON``,
76but ``VIDIOC_STREAMOFF`` will return queued buffers to their starting
77state as mentioned above.
78
79.. note:: Applications can be preempted for unknown periods right before
80 or after the ``VIDIOC_STREAMON`` or ``VIDIOC_STREAMOFF`` calls, there is
81 no notion of starting or stopping "now". Buffer timestamps can be used
82 to synchronize with other events.
83
84
85Return Value
86============
87
88On success 0 is returned, on error -1 and the ``errno`` variable is set
89appropriately. The generic error codes are described at the
90:ref:`Generic Error Codes <gen-errors>` chapter.
91
92EINVAL
93 The buffer ``type`` is not supported, or no buffers have been
94 allocated (memory mapping) or enqueued (output) yet.
95
96EPIPE
97 The driver implements
98 :ref:`pad-level format configuration <pad-level-formats>` and the
99 pipeline configuration is invalid.
100
101ENOLINK
102 The driver implements Media Controller interface and the pipeline
103 link configuration is invalid.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst b/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst
new file mode 100644
index 000000000000..0aa6482a91a6
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst
@@ -0,0 +1,153 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
4
5***************************************
6ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
7***************************************
8
9Name
10====
11
12VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_frame_interval_enum * argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
29
30``argp``
31
32
33Description
34===========
35
36This ioctl lets applications enumerate available frame intervals on a
37given sub-device pad. Frame intervals only makes sense for sub-devices
38that can control the frame period on their own. This includes, for
39instance, image sensors and TV tuners.
40
41For the common use case of image sensors, the frame intervals available
42on the sub-device output pad depend on the frame format and size on the
43same pad. Applications must thus specify the desired format and size
44when enumerating frame intervals.
45
46To enumerate frame intervals applications initialize the ``index``,
47``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
48:ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
49and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
50to this structure. Drivers fill the rest of the structure or return an
51EINVAL error code if one of the input fields is invalid. All frame
52intervals are enumerable by beginning at index zero and incrementing by
53one until ``EINVAL`` is returned.
54
55Available frame intervals may depend on the current 'try' formats at
56other pads of the sub-device, as well as on the current active links.
57See :ref:`VIDIOC_SUBDEV_G_FMT` for more
58information about the try formats.
59
60Sub-devices that support the frame interval enumeration ioctl should
61implemented it on a single pad only. Its behaviour when supported on
62multiple pads of the same sub-device is not defined.
63
64
65.. _v4l2-subdev-frame-interval-enum:
66
67.. flat-table:: struct v4l2_subdev_frame_interval_enum
68 :header-rows: 0
69 :stub-columns: 0
70 :widths: 1 1 2
71
72
73 - .. row 1
74
75 - __u32
76
77 - ``index``
78
79 - Number of the format in the enumeration, set by the application.
80
81 - .. row 2
82
83 - __u32
84
85 - ``pad``
86
87 - Pad number as reported by the media controller API.
88
89 - .. row 3
90
91 - __u32
92
93 - ``code``
94
95 - The media bus format code, as defined in
96 :ref:`v4l2-mbus-format`.
97
98 - .. row 4
99
100 - __u32
101
102 - ``width``
103
104 - Frame width, in pixels.
105
106 - .. row 5
107
108 - __u32
109
110 - ``height``
111
112 - Frame height, in pixels.
113
114 - .. row 6
115
116 - struct :ref:`v4l2_fract <v4l2-fract>`
117
118 - ``interval``
119
120 - Period, in seconds, between consecutive video frames.
121
122 - .. row 7
123
124 - __u32
125
126 - ``which``
127
128 - Frame intervals to be enumerated, from enum
129 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
130
131 - .. row 8
132
133 - __u32
134
135 - ``reserved``\ [8]
136
137 - Reserved for future extensions. Applications and drivers must set
138 the array to zero.
139
140
141Return Value
142============
143
144On success 0 is returned, on error -1 and the ``errno`` variable is set
145appropriately. The generic error codes are described at the
146:ref:`Generic Error Codes <gen-errors>` chapter.
147
148EINVAL
149 The struct
150 :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
151 ``pad`` references a non-existing pad, one of the ``code``,
152 ``width`` or ``height`` fields are invalid for the given pad or the
153 ``index`` field is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-size.rst b/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-size.rst
new file mode 100644
index 000000000000..7a5811b71b68
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-size.rst
@@ -0,0 +1,162 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_ENUM_FRAME_SIZE:
4
5***********************************
6ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE
7***********************************
8
9Name
10====
11
12VIDIOC_SUBDEV_ENUM_FRAME_SIZE - Enumerate media bus frame sizes
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_frame_size_enum * argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_ENUM_FRAME_SIZE
29
30``argp``
31
32
33Description
34===========
35
36This ioctl allows applications to enumerate all frame sizes supported by
37a sub-device on the given pad for the given media bus format. Supported
38formats can be retrieved with the
39:ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE`
40ioctl.
41
42To enumerate frame sizes applications initialize the ``pad``, ``which``
43, ``code`` and ``index`` fields of the struct
44:ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>` and
45call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_SIZE` ioctl with a pointer to the
46structure. Drivers fill the minimum and maximum frame sizes or return an
47EINVAL error code if one of the input parameters is invalid.
48
49Sub-devices that only support discrete frame sizes (such as most
50sensors) will return one or more frame sizes with identical minimum and
51maximum values.
52
53Not all possible sizes in given [minimum, maximum] ranges need to be
54supported. For instance, a scaler that uses a fixed-point scaling ratio
55might not be able to produce every frame size between the minimum and
56maximum values. Applications must use the
57:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctl to try the
58sub-device for an exact supported frame size.
59
60Available frame sizes may depend on the current 'try' formats at other
61pads of the sub-device, as well as on the current active links and the
62current values of V4L2 controls. See
63:ref:`VIDIOC_SUBDEV_G_FMT` for more
64information about try formats.
65
66
67.. _v4l2-subdev-frame-size-enum:
68
69.. flat-table:: struct v4l2_subdev_frame_size_enum
70 :header-rows: 0
71 :stub-columns: 0
72 :widths: 1 1 2
73
74
75 - .. row 1
76
77 - __u32
78
79 - ``index``
80
81 - Number of the format in the enumeration, set by the application.
82
83 - .. row 2
84
85 - __u32
86
87 - ``pad``
88
89 - Pad number as reported by the media controller API.
90
91 - .. row 3
92
93 - __u32
94
95 - ``code``
96
97 - The media bus format code, as defined in
98 :ref:`v4l2-mbus-format`.
99
100 - .. row 4
101
102 - __u32
103
104 - ``min_width``
105
106 - Minimum frame width, in pixels.
107
108 - .. row 5
109
110 - __u32
111
112 - ``max_width``
113
114 - Maximum frame width, in pixels.
115
116 - .. row 6
117
118 - __u32
119
120 - ``min_height``
121
122 - Minimum frame height, in pixels.
123
124 - .. row 7
125
126 - __u32
127
128 - ``max_height``
129
130 - Maximum frame height, in pixels.
131
132 - .. row 8
133
134 - __u32
135
136 - ``which``
137
138 - Frame sizes to be enumerated, from enum
139 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
140
141 - .. row 9
142
143 - __u32
144
145 - ``reserved``\ [8]
146
147 - Reserved for future extensions. Applications and drivers must set
148 the array to zero.
149
150
151Return Value
152============
153
154On success 0 is returned, on error -1 and the ``errno`` variable is set
155appropriately. The generic error codes are described at the
156:ref:`Generic Error Codes <gen-errors>` chapter.
157
158EINVAL
159 The struct
160 :ref:`v4l2_subdev_frame_size_enum <v4l2-subdev-frame-size-enum>`
161 ``pad`` references a non-existing pad, the ``code`` is invalid for
162 the given pad or the ``index`` field is out of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst b/Documentation/media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst
new file mode 100644
index 000000000000..bc0531eb56fa
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst
@@ -0,0 +1,115 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_ENUM_MBUS_CODE:
4
5**********************************
6ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE
7**********************************
8
9Name
10====
11
12VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_mbus_code_enum * argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_ENUM_MBUS_CODE
29
30``argp``
31
32
33Description
34===========
35
36To enumerate media bus formats available at a given sub-device pad
37applications initialize the ``pad``, ``which`` and ``index`` fields of
38struct
39:ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>` and
40call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl with a pointer to this
41structure. Drivers fill the rest of the structure or return an ``EINVAL``
42error code if either the ``pad`` or ``index`` are invalid. All media bus
43formats are enumerable by beginning at index zero and incrementing by
44one until ``EINVAL`` is returned.
45
46Available media bus formats may depend on the current 'try' formats at
47other pads of the sub-device, as well as on the current active links.
48See :ref:`VIDIOC_SUBDEV_G_FMT` for more
49information about the try formats.
50
51
52.. _v4l2-subdev-mbus-code-enum:
53
54.. flat-table:: struct v4l2_subdev_mbus_code_enum
55 :header-rows: 0
56 :stub-columns: 0
57 :widths: 1 1 2
58
59
60 - .. row 1
61
62 - __u32
63
64 - ``pad``
65
66 - Pad number as reported by the media controller API.
67
68 - .. row 2
69
70 - __u32
71
72 - ``index``
73
74 - Number of the format in the enumeration, set by the application.
75
76 - .. row 3
77
78 - __u32
79
80 - ``code``
81
82 - The media bus format code, as defined in
83 :ref:`v4l2-mbus-format`.
84
85 - .. row 4
86
87 - __u32
88
89 - ``which``
90
91 - Media bus format codes to be enumerated, from enum
92 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
93
94 - .. row 5
95
96 - __u32
97
98 - ``reserved``\ [8]
99
100 - Reserved for future extensions. Applications and drivers must set
101 the array to zero.
102
103
104Return Value
105============
106
107On success 0 is returned, on error -1 and the ``errno`` variable is set
108appropriately. The generic error codes are described at the
109:ref:`Generic Error Codes <gen-errors>` chapter.
110
111EINVAL
112 The struct
113 :ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>`
114 ``pad`` references a non-existing pad, or the ``index`` field is out
115 of bounds.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst b/Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst
new file mode 100644
index 000000000000..ae802f1594e7
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst
@@ -0,0 +1,136 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_G_CROP:
4
5************************************************
6ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP
7************************************************
8
9Name
10====
11
12VIDIOC_SUBDEV_G_CROP - VIDIOC_SUBDEV_S_CROP - Get or set the crop rectangle on a subdev pad
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_crop *argp )
19
20.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_subdev_crop *argp )
21
22
23Arguments
24=========
25
26``fd``
27 File descriptor returned by :ref:`open() <func-open>`.
28
29``request``
30 VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP
31
32``argp``
33
34
35Description
36===========
37
38.. note::
39
40 This is an :ref:`obsolete` interface and may be removed
41 in the future. It is superseded by
42 :ref:`the selection API <VIDIOC_SUBDEV_G_SELECTION>`.
43
44To retrieve the current crop rectangle applications set the ``pad``
45field of a struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>` to the
46desired pad number as reported by the media API and the ``which`` field
47to ``V4L2_SUBDEV_FORMAT_ACTIVE``. They then call the
48``VIDIOC_SUBDEV_G_CROP`` ioctl with a pointer to this structure. The
49driver fills the members of the ``rect`` field or returns ``EINVAL`` error
50code if the input arguments are invalid, or if cropping is not supported
51on the given pad.
52
53To change the current crop rectangle applications set both the ``pad``
54and ``which`` fields and all members of the ``rect`` field. They then
55call the ``VIDIOC_SUBDEV_S_CROP`` ioctl with a pointer to this
56structure. The driver verifies the requested crop rectangle, adjusts it
57based on the hardware capabilities and configures the device. Upon
58return the struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>`
59contains the current format as would be returned by a
60``VIDIOC_SUBDEV_G_CROP`` call.
61
62Applications can query the device capabilities by setting the ``which``
63to ``V4L2_SUBDEV_FORMAT_TRY``. When set, 'try' crop rectangles are not
64applied to the device by the driver, but are mangled exactly as active
65crop rectangles and stored in the sub-device file handle. Two
66applications querying the same sub-device would thus not interact with
67each other.
68
69Drivers must not return an error solely because the requested crop
70rectangle doesn't match the device capabilities. They must instead
71modify the rectangle to match what the hardware can provide. The
72modified format should be as close as possible to the original request.
73
74
75.. _v4l2-subdev-crop:
76
77.. flat-table:: struct v4l2_subdev_crop
78 :header-rows: 0
79 :stub-columns: 0
80 :widths: 1 1 2
81
82
83 - .. row 1
84
85 - __u32
86
87 - ``pad``
88
89 - Pad number as reported by the media framework.
90
91 - .. row 2
92
93 - __u32
94
95 - ``which``
96
97 - Crop rectangle to get or set, from enum
98 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
99
100 - .. row 3
101
102 - struct :ref:`v4l2_rect <v4l2-rect>`
103
104 - ``rect``
105
106 - Crop rectangle boundaries, in pixels.
107
108 - .. row 4
109
110 - __u32
111
112 - ``reserved``\ [8]
113
114 - Reserved for future extensions. Applications and drivers must set
115 the array to zero.
116
117
118Return Value
119============
120
121On success 0 is returned, on error -1 and the ``errno`` variable is set
122appropriately. The generic error codes are described at the
123:ref:`Generic Error Codes <gen-errors>` chapter.
124
125EBUSY
126 The crop rectangle can't be changed because the pad is currently
127 busy. This can be caused, for instance, by an active video stream on
128 the pad. The ioctl must not be retried without performing another
129 action to fix the problem first. Only returned by
130 ``VIDIOC_SUBDEV_S_CROP``
131
132EINVAL
133 The struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>` ``pad``
134 references a non-existing pad, the ``which`` field references a
135 non-existing format, or cropping is not supported on the given
136 subdev pad.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst b/Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst
new file mode 100644
index 000000000000..90e2a6635ebc
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst
@@ -0,0 +1,171 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_G_FMT:
4
5**********************************************
6ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT
7**********************************************
8
9Name
10====
11
12VIDIOC_SUBDEV_G_FMT - VIDIOC_SUBDEV_S_FMT - Get or set the data format on a subdev pad
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_format *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT
29
30``argp``
31
32
33Description
34===========
35
36These ioctls are used to negotiate the frame format at specific subdev
37pads in the image pipeline.
38
39To retrieve the current format applications set the ``pad`` field of a
40struct :ref:`v4l2_subdev_format <v4l2-subdev-format>` to the desired
41pad number as reported by the media API and the ``which`` field to
42``V4L2_SUBDEV_FORMAT_ACTIVE``. When they call the
43``VIDIOC_SUBDEV_G_FMT`` ioctl with a pointer to this structure the
44driver fills the members of the ``format`` field.
45
46To change the current format applications set both the ``pad`` and
47``which`` fields and all members of the ``format`` field. When they call
48the ``VIDIOC_SUBDEV_S_FMT`` ioctl with a pointer to this structure the
49driver verifies the requested format, adjusts it based on the hardware
50capabilities and configures the device. Upon return the struct
51:ref:`v4l2_subdev_format <v4l2-subdev-format>` contains the current
52format as would be returned by a ``VIDIOC_SUBDEV_G_FMT`` call.
53
54Applications can query the device capabilities by setting the ``which``
55to ``V4L2_SUBDEV_FORMAT_TRY``. When set, 'try' formats are not applied
56to the device by the driver, but are changed exactly as active formats
57and stored in the sub-device file handle. Two applications querying the
58same sub-device would thus not interact with each other.
59
60For instance, to try a format at the output pad of a sub-device,
61applications would first set the try format at the sub-device input with
62the ``VIDIOC_SUBDEV_S_FMT`` ioctl. They would then either retrieve the
63default format at the output pad with the ``VIDIOC_SUBDEV_G_FMT`` ioctl,
64or set the desired output pad format with the ``VIDIOC_SUBDEV_S_FMT``
65ioctl and check the returned value.
66
67Try formats do not depend on active formats, but can depend on the
68current links configuration or sub-device controls value. For instance,
69a low-pass noise filter might crop pixels at the frame boundaries,
70modifying its output frame size.
71
72Drivers must not return an error solely because the requested format
73doesn't match the device capabilities. They must instead modify the
74format to match what the hardware can provide. The modified format
75should be as close as possible to the original request.
76
77
78.. _v4l2-subdev-format:
79
80.. flat-table:: struct v4l2_subdev_format
81 :header-rows: 0
82 :stub-columns: 0
83 :widths: 1 1 2
84
85
86 - .. row 1
87
88 - __u32
89
90 - ``pad``
91
92 - Pad number as reported by the media controller API.
93
94 - .. row 2
95
96 - __u32
97
98 - ``which``
99
100 - Format to modified, from enum
101 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
102
103 - .. row 3
104
105 - struct :ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`
106
107 - ``format``
108
109 - Definition of an image format, see :ref:`v4l2-mbus-framefmt` for
110 details.
111
112 - .. row 4
113
114 - __u32
115
116 - ``reserved``\ [8]
117
118 - Reserved for future extensions. Applications and drivers must set
119 the array to zero.
120
121
122
123.. _v4l2-subdev-format-whence:
124
125.. flat-table:: enum v4l2_subdev_format_whence
126 :header-rows: 0
127 :stub-columns: 0
128 :widths: 3 1 4
129
130
131 - .. row 1
132
133 - V4L2_SUBDEV_FORMAT_TRY
134
135 - 0
136
137 - Try formats, used for querying device capabilities.
138
139 - .. row 2
140
141 - V4L2_SUBDEV_FORMAT_ACTIVE
142
143 - 1
144
145 - Active formats, applied to the hardware.
146
147
148Return Value
149============
150
151On success 0 is returned, on error -1 and the ``errno`` variable is set
152appropriately. The generic error codes are described at the
153:ref:`Generic Error Codes <gen-errors>` chapter.
154
155EBUSY
156 The format can't be changed because the pad is currently busy. This
157 can be caused, for instance, by an active video stream on the pad.
158 The ioctl must not be retried without performing another action to
159 fix the problem first. Only returned by ``VIDIOC_SUBDEV_S_FMT``
160
161EINVAL
162 The struct :ref:`v4l2_subdev_format <v4l2-subdev-format>`
163 ``pad`` references a non-existing pad, or the ``which`` field
164 references a non-existing format.
165
166
167============
168
169On success 0 is returned, on error -1 and the ``errno`` variable is set
170appropriately. The generic error codes are described at the
171:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst b/Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst
new file mode 100644
index 000000000000..d8a1cabbd272
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst
@@ -0,0 +1,122 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:
4
5********************************************************************
6ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
7********************************************************************
8
9Name
10====
11
12VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_frame_interval *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_G_FRAME_INTERVAL,
29 VIDIOC_SUBDEV_S_FRAME_INTERVAL
30
31``argp``
32
33
34Description
35===========
36
37These ioctls are used to get and set the frame interval at specific
38subdev pads in the image pipeline. The frame interval only makes sense
39for sub-devices that can control the frame period on their own. This
40includes, for instance, image sensors and TV tuners. Sub-devices that
41don't support frame intervals must not implement these ioctls.
42
43To retrieve the current frame interval applications set the ``pad``
44field of a struct
45:ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>` to
46the desired pad number as reported by the media controller API. When
47they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
48this structure the driver fills the members of the ``interval`` field.
49
50To change the current frame interval applications set both the ``pad``
51field and all members of the ``interval`` field. When they call the
52``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this
53structure the driver verifies the requested interval, adjusts it based
54on the hardware capabilities and configures the device. Upon return the
55struct
56:ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>`
57contains the current frame interval as would be returned by a
58``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
59
60Drivers must not return an error solely because the requested interval
61doesn't match the device capabilities. They must instead modify the
62interval to match what the hardware can provide. The modified interval
63should be as close as possible to the original request.
64
65Sub-devices that support the frame interval ioctls should implement them
66on a single pad only. Their behaviour when supported on multiple pads of
67the same sub-device is not defined.
68
69
70.. _v4l2-subdev-frame-interval:
71
72.. flat-table:: struct v4l2_subdev_frame_interval
73 :header-rows: 0
74 :stub-columns: 0
75 :widths: 1 1 2
76
77
78 - .. row 1
79
80 - __u32
81
82 - ``pad``
83
84 - Pad number as reported by the media controller API.
85
86 - .. row 2
87
88 - struct :ref:`v4l2_fract <v4l2-fract>`
89
90 - ``interval``
91
92 - Period, in seconds, between consecutive video frames.
93
94 - .. row 3
95
96 - __u32
97
98 - ``reserved``\ [9]
99
100 - Reserved for future extensions. Applications and drivers must set
101 the array to zero.
102
103
104Return Value
105============
106
107On success 0 is returned, on error -1 and the ``errno`` variable is set
108appropriately. The generic error codes are described at the
109:ref:`Generic Error Codes <gen-errors>` chapter.
110
111EBUSY
112 The frame interval can't be changed because the pad is currently
113 busy. This can be caused, for instance, by an active video stream on
114 the pad. The ioctl must not be retried without performing another
115 action to fix the problem first. Only returned by
116 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``
117
118EINVAL
119 The struct
120 :ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>`
121 ``pad`` references a non-existing pad, or the pad doesn't support
122 frame intervals.
diff --git a/Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst b/Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst
new file mode 100644
index 000000000000..50838a4a429e
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst
@@ -0,0 +1,144 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBDEV_G_SELECTION:
4
5**********************************************************
6ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION
7**********************************************************
8
9Name
10====
11
12VIDIOC_SUBDEV_G_SELECTION - VIDIOC_SUBDEV_S_SELECTION - Get or set selection rectangles on a subdev pad
13
14
15Synopsis
16========
17
18.. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_selection *argp )
19
20
21Arguments
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION
29
30``argp``
31
32
33Description
34===========
35
36The selections are used to configure various image processing
37functionality performed by the subdevs which affect the image size. This
38currently includes cropping, scaling and composition.
39
40The selection API replaces
41:ref:`the old subdev crop API <VIDIOC_SUBDEV_G_CROP>`. All the
42function of the crop API, and more, are supported by the selections API.
43
44See :ref:`subdev` for more information on how each selection target
45affects the image processing pipeline inside the subdevice.
46
47
48Types of selection targets
49--------------------------
50
51There are two types of selection targets: actual and bounds. The actual
52targets are the targets which configure the hardware. The BOUNDS target
53will return a rectangle that contain all possible actual rectangles.
54
55
56Discovering supported features
57------------------------------
58
59To discover which targets are supported, the user can perform
60``VIDIOC_SUBDEV_G_SELECTION`` on them. Any unsupported target will
61return ``EINVAL``.
62
63Selection targets and flags are documented in
64:ref:`v4l2-selections-common`.
65
66
67.. _v4l2-subdev-selection:
68
69.. flat-table:: struct v4l2_subdev_selection
70 :header-rows: 0
71 :stub-columns: 0
72 :widths: 1 1 2
73
74
75 - .. row 1
76
77 - __u32
78
79 - ``which``
80
81 - Active or try selection, from enum
82 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
83
84 - .. row 2
85
86 - __u32
87
88 - ``pad``
89
90 - Pad number as reported by the media framework.
91
92 - .. row 3
93
94 - __u32
95
96 - ``target``
97
98 - Target selection rectangle. See :ref:`v4l2-selections-common`.
99
100 - .. row 4
101
102 - __u32
103
104 - ``flags``
105
106 - Flags. See :ref:`v4l2-selection-flags`.
107
108 - .. row 5
109
110 - struct :ref:`v4l2_rect <v4l2-rect>`
111
112 - ``r``
113
114 - Selection rectangle, in pixels.
115
116 - .. row 6
117
118 - __u32
119
120 - ``reserved``\ [8]
121
122 - Reserved for future extensions. Applications and drivers must set
123 the array to zero.
124
125
126Return Value
127============
128
129On success 0 is returned, on error -1 and the ``errno`` variable is set
130appropriately. The generic error codes are described at the
131:ref:`Generic Error Codes <gen-errors>` chapter.
132
133EBUSY
134 The selection rectangle can't be changed because the pad is
135 currently busy. This can be caused, for instance, by an active video
136 stream on the pad. The ioctl must not be retried without performing
137 another action to fix the problem first. Only returned by
138 ``VIDIOC_SUBDEV_S_SELECTION``
139
140EINVAL
141 The struct :ref:`v4l2_subdev_selection <v4l2-subdev-selection>`
142 ``pad`` references a non-existing pad, the ``which`` field
143 references a non-existing format, or the selection target is not
144 supported on the given subdev pad.
diff --git a/Documentation/media/uapi/v4l/vidioc-subscribe-event.rst b/Documentation/media/uapi/v4l/vidioc-subscribe-event.rst
new file mode 100644
index 000000000000..3f28e8c47960
--- /dev/null
+++ b/Documentation/media/uapi/v4l/vidioc-subscribe-event.rst
@@ -0,0 +1,138 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDIOC_SUBSCRIBE_EVENT:
4.. _VIDIOC_UNSUBSCRIBE_EVENT:
5
6******************************************************
7ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT
8******************************************************
9
10Name
11====
12
13VIDIOC_SUBSCRIBE_EVENT - VIDIOC_UNSUBSCRIBE_EVENT - Subscribe or unsubscribe event
14
15
16Synopsis
17========
18
19.. cpp:function:: int ioctl( int fd, int request, struct v4l2_event_subscription *argp )
20
21
22Arguments
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <func-open>`.
27
28``request``
29 VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT
30
31``argp``
32
33
34Description
35===========
36
37Subscribe or unsubscribe V4L2 event. Subscribed events are dequeued by
38using the :ref:`VIDIOC_DQEVENT` ioctl.
39
40
41.. _v4l2-event-subscription:
42
43.. flat-table:: struct v4l2_event_subscription
44 :header-rows: 0
45 :stub-columns: 0
46 :widths: 1 1 2
47
48
49 - .. row 1
50
51 - __u32
52
53 - ``type``
54
55 - Type of the event, see :ref:`event-type`.
56
57 .. note:: ``V4L2_EVENT_ALL`` can be used with
58 :ref:`VIDIOC_UNSUBSCRIBE_EVENT <VIDIOC_SUBSCRIBE_EVENT>` for
59 unsubscribing all events at once.
60
61 - .. row 2
62
63 - __u32
64
65 - ``id``
66
67 - ID of the event source. If there is no ID associated with the
68 event source, then set this to 0. Whether or not an event needs an
69 ID depends on the event type.
70
71 - .. row 3
72
73 - __u32
74
75 - ``flags``
76
77 - Event flags, see :ref:`event-flags`.
78
79 - .. row 4
80
81 - __u32
82
83 - ``reserved``\ [5]
84
85 - Reserved for future extensions. Drivers and applications must set
86 the array to zero.
87
88
89
90.. _event-flags:
91
92.. flat-table:: Event Flags
93 :header-rows: 0
94 :stub-columns: 0
95 :widths: 3 1 4
96
97
98 - .. row 1
99
100 - ``V4L2_EVENT_SUB_FL_SEND_INITIAL``
101
102 - 0x0001
103
104 - When this event is subscribed an initial event will be sent
105 containing the current status. This only makes sense for events
106 that are triggered by a status change such as ``V4L2_EVENT_CTRL``.
107 Other events will ignore this flag.
108
109 - .. row 2
110
111 - ``V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK``
112
113 - 0x0002
114
115 - If set, then events directly caused by an ioctl will also be sent
116 to the filehandle that called that ioctl. For example, changing a
117 control using :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` will cause
118 a V4L2_EVENT_CTRL to be sent back to that same filehandle.
119 Normally such events are suppressed to prevent feedback loops
120 where an application changes a control to a one value and then
121 another, and then receives an event telling it that that control
122 has changed to the first value.
123
124 Since it can't tell whether that event was caused by another
125 application or by the :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>`
126 call it is hard to decide whether to set the control to the value
127 in the event, or ignore it.
128
129 Think carefully when you set this flag so you won't get into
130 situations like that.
131
132
133Return Value
134============
135
136On success 0 is returned, on error -1 and the ``errno`` variable is set
137appropriately. The generic error codes are described at the
138:ref:`Generic Error Codes <gen-errors>` chapter.
diff --git a/Documentation/media/uapi/v4l/yuv-formats.rst b/Documentation/media/uapi/v4l/yuv-formats.rst
new file mode 100644
index 000000000000..3334ea445657
--- /dev/null
+++ b/Documentation/media/uapi/v4l/yuv-formats.rst
@@ -0,0 +1,55 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _yuv-formats:
4
5***********
6YUV Formats
7***********
8
9YUV is the format native to TV broadcast and composite video signals. It
10separates the brightness information (Y) from the color information (U
11and V or Cb and Cr). The color information consists of red and blue
12*color difference* signals, this way the green component can be
13reconstructed by subtracting from the brightness component. See
14:ref:`colorspaces` for conversion examples. YUV was chosen because
15early television would only transmit brightness information. To add
16color in a way compatible with existing receivers a new signal carrier
17was added to transmit the color difference signals. Secondary in the YUV
18format the U and V components usually have lower resolution than the Y
19component. This is an analog video compression technique taking
20advantage of a property of the human visual system, being more sensitive
21to brightness information.
22
23
24.. toctree::
25 :maxdepth: 1
26
27 pixfmt-packed-yuv
28 pixfmt-grey
29 pixfmt-y10
30 pixfmt-y12
31 pixfmt-y10b
32 pixfmt-y16
33 pixfmt-y16-be
34 pixfmt-y8i
35 pixfmt-y12i
36 pixfmt-uv8
37 pixfmt-yuyv
38 pixfmt-uyvy
39 pixfmt-yvyu
40 pixfmt-vyuy
41 pixfmt-y41p
42 pixfmt-yuv420
43 pixfmt-yuv420m
44 pixfmt-yuv422m
45 pixfmt-yuv444m
46 pixfmt-yuv410
47 pixfmt-yuv422p
48 pixfmt-yuv411p
49 pixfmt-nv12
50 pixfmt-nv12m
51 pixfmt-nv12mt
52 pixfmt-nv16
53 pixfmt-nv16m
54 pixfmt-nv24
55 pixfmt-m420
diff --git a/Documentation/media/v4l-drivers/au0828-cardlist.rst b/Documentation/media/v4l-drivers/au0828-cardlist.rst
new file mode 100644
index 000000000000..aed51b4ffb46
--- /dev/null
+++ b/Documentation/media/v4l-drivers/au0828-cardlist.rst
@@ -0,0 +1,11 @@
1AU0828 cards list
2=================
3
4.. code-block:: none
5
6 0 -> Unknown board (au0828)
7 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008,2040:7260,2040:7213,2040:7270]
8 2 -> Hauppauge HVR850 (au0828) [2040:7240]
9 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
10 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281]
11 5 -> Hauppauge Woodbury (au0828) [05e1:0480,2040:8200]
diff --git a/Documentation/media/v4l-drivers/bttv-cardlist.rst b/Documentation/media/v4l-drivers/bttv-cardlist.rst
new file mode 100644
index 000000000000..97a966e7f9c4
--- /dev/null
+++ b/Documentation/media/v4l-drivers/bttv-cardlist.rst
@@ -0,0 +1,172 @@
1BTTV cards list
2===============
3
4.. code-block:: none
5
6 0 -> *** UNKNOWN/GENERIC ***
7 1 -> MIRO PCTV
8 2 -> Hauppauge (bt848)
9 3 -> STB, Gateway P/N 6000699 (bt848)
10 4 -> Intel Create and Share PCI/ Smart Video Recorder III
11 5 -> Diamond DTV2000
12 6 -> AVerMedia TVPhone
13 7 -> MATRIX-Vision MV-Delta
14 8 -> Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26
15 9 -> IMS/IXmicro TurboTV
16 10 -> Hauppauge (bt878) [0070:13eb,0070:3900,2636:10b4]
17 11 -> MIRO PCTV pro
18 12 -> ADS Technologies Channel Surfer TV (bt848)
19 13 -> AVerMedia TVCapture 98 [1461:0002,1461:0004,1461:0300]
20 14 -> Aimslab Video Highway Xtreme (VHX)
21 15 -> Zoltrix TV-Max [a1a0:a0fc]
22 16 -> Prolink Pixelview PlayTV (bt878)
23 17 -> Leadtek WinView 601
24 18 -> AVEC Intercapture
25 19 -> Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
26 20 -> CEI Raffles Card
27 21 -> Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
28 22 -> Askey CPH050/ Phoebe Tv Master + FM [14ff:3002]
29 23 -> Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878 [14c7:0101]
30 24 -> Askey CPH05X/06X (bt878) [many vendors] [144f:3002,144f:3005,144f:5000,14ff:3000]
31 25 -> Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
32 26 -> Hauppauge WinCam newer (bt878)
33 27 -> Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
34 28 -> Terratec TerraTV+ Version 1.1 (bt878) [153b:1127,1852:1852]
35 29 -> Imagenation PXC200 [1295:200a]
36 30 -> Lifeview FlyVideo 98 LR50 [1f7f:1850]
37 31 -> Formac iProTV, Formac ProTV I (bt848)
38 32 -> Intel Create and Share PCI/ Smart Video Recorder III
39 33 -> Terratec TerraTValue Version Bt878 [153b:1117,153b:1118,153b:1119,153b:111a,153b:1134,153b:5018]
40 34 -> Leadtek WinFast 2000/ WinFast 2000 XP [107d:6606,107d:6609,6606:217d,f6ff:fff6]
41 35 -> Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II [1851:1850,1851:a050]
42 36 -> Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner [1852:1852]
43 37 -> Prolink PixelView PlayTV pro
44 38 -> Askey CPH06X TView99 [144f:3000,144f:a005,a04f:a0fc]
45 39 -> Pinnacle PCTV Studio/Rave [11bd:0012,bd11:1200,bd11:ff00,11bd:ff12]
46 40 -> STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100 [10b4:2636,10b4:2645,121a:3060]
47 41 -> AVerMedia TVPhone 98 [1461:0001,1461:0003]
48 42 -> ProVideo PV951 [aa0c:146c]
49 43 -> Little OnAir TV
50 44 -> Sigma TVII-FM
51 45 -> MATRIX-Vision MV-Delta 2
52 46 -> Zoltrix Genie TV/FM [15b0:4000,15b0:400a,15b0:400d,15b0:4010,15b0:4016]
53 47 -> Terratec TV/Radio+ [153b:1123]
54 48 -> Askey CPH03x/ Dynalink Magic TView
55 49 -> IODATA GV-BCTV3/PCI [10fc:4020]
56 50 -> Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
57 51 -> Eagle Wireless Capricorn2 (bt878A)
58 52 -> Pinnacle PCTV Studio Pro
59 53 -> Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
60 54 -> Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
61 55 -> Askey CPH031/ BESTBUY Easy TV
62 56 -> Lifeview FlyVideo 98FM LR50 [a051:41a0]
63 57 -> GrandTec 'Grand Video Capture' (Bt848) [4344:4142]
64 58 -> Askey CPH060/ Phoebe TV Master Only (No FM)
65 59 -> Askey CPH03x TV Capturer
66 60 -> Modular Technology MM100PCTV
67 61 -> AG Electronics GMV1 [15cb:0101]
68 62 -> Askey CPH061/ BESTBUY Easy TV (bt878)
69 63 -> ATI TV-Wonder [1002:0001]
70 64 -> ATI TV-Wonder VE [1002:0003]
71 65 -> Lifeview FlyVideo 2000S LR90
72 66 -> Terratec TValueRadio [153b:1135,153b:ff3b]
73 67 -> IODATA GV-BCTV4/PCI [10fc:4050]
74 68 -> 3Dfx VoodooTV FM (Euro) [10b4:2637]
75 69 -> Active Imaging AIMMS
76 70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
77 71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851]
78 72 -> Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM) [1554:4011]
79 73 -> Sensoray 311/611 [6000:0311,6000:0611]
80 74 -> RemoteVision MX (RV605)
81 75 -> Powercolor MTV878/ MTV878R/ MTV878F
82 76 -> Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP) [0e11:0079]
83 77 -> GrandTec Multi Capture Card (Bt878)
84 78 -> Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF [0a01:17de]
85 79 -> DSP Design TCVIDEO
86 80 -> Hauppauge WinTV PVR [0070:4500]
87 81 -> IODATA GV-BCTV5/PCI [10fc:4070,10fc:d018]
88 82 -> Osprey 100/150 (878) [0070:ff00]
89 83 -> Osprey 100/150 (848)
90 84 -> Osprey 101 (848)
91 85 -> Osprey 101/151
92 86 -> Osprey 101/151 w/ svid
93 87 -> Osprey 200/201/250/251
94 88 -> Osprey 200/250 [0070:ff01]
95 89 -> Osprey 210/220/230
96 90 -> Osprey 500 [0070:ff02]
97 91 -> Osprey 540 [0070:ff04]
98 92 -> Osprey 2000 [0070:ff03]
99 93 -> IDS Eagle
100 94 -> Pinnacle PCTV Sat [11bd:001c]
101 95 -> Formac ProTV II (bt878)
102 96 -> MachTV
103 97 -> Euresys Picolo
104 98 -> ProVideo PV150 [aa00:1460,aa01:1461,aa02:1462,aa03:1463,aa04:1464,aa05:1465,aa06:1466,aa07:1467]
105 99 -> AD-TVK503
106 100 -> Hercules Smart TV Stereo
107 101 -> Pace TV & Radio Card
108 102 -> IVC-200 [0000:a155,0001:a155,0002:a155,0003:a155,0100:a155,0101:a155,0102:a155,0103:a155,0800:a155,0801:a155,0802:a155,0803:a155]
109 103 -> Grand X-Guard / Trust 814PCI [0304:0102]
110 104 -> Nebula Electronics DigiTV [0071:0101]
111 105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433]
112 106 -> PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)
113 107 -> PHYTEC VD-009-X1 VD-011 Combi (bt878)
114 108 -> PHYTEC VD-009 MiniDIN (bt878)
115 109 -> PHYTEC VD-009 Combi (bt878)
116 110 -> IVC-100 [ff00:a132]
117 111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182]
118 112 -> pcHDTV HD-2000 TV [7063:2000]
119 113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00,1822:0026]
120 114 -> Winfast VC100 [107d:6607]
121 115 -> Teppro TEV-560/InterVision IV-560
122 116 -> SIMUS GVC1100 [aa6a:82b2]
123 117 -> NGS NGSTV+
124 118 -> LMLBT4
125 119 -> Tekram M205 PRO
126 120 -> Conceptronic CONTVFMi
127 121 -> Euresys Picolo Tetra [1805:0105,1805:0106,1805:0107,1805:0108]
128 122 -> Spirit TV Tuner
129 123 -> AVerMedia AVerTV DVB-T 771 [1461:0771]
130 124 -> AverMedia AverTV DVB-T 761 [1461:0761]
131 125 -> MATRIX Vision Sigma-SQ
132 126 -> MATRIX Vision Sigma-SLC
133 127 -> APAC Viewcomp 878(AMAX)
134 128 -> DViCO FusionHDTV DVB-T Lite [18ac:db10,18ac:db11]
135 129 -> V-Gear MyVCD
136 130 -> Super TV Tuner
137 131 -> Tibet Systems 'Progress DVR' CS16
138 132 -> Kodicom 4400R (master)
139 133 -> Kodicom 4400R (slave)
140 134 -> Adlink RTV24
141 135 -> DViCO FusionHDTV 5 Lite [18ac:d500]
142 136 -> Acorp Y878F [9511:1540]
143 137 -> Conceptronic CTVFMi v2 [036e:109e]
144 138 -> Prolink Pixelview PV-BT878P+ (Rev.2E)
145 139 -> Prolink PixelView PlayTV MPEG2 PV-M4900
146 140 -> Osprey 440 [0070:ff07]
147 141 -> Asound Skyeye PCTV
148 142 -> Sabrent TV-FM (bttv version)
149 143 -> Hauppauge ImpactVCB (bt878) [0070:13eb]
150 144 -> MagicTV
151 145 -> SSAI Security Video Interface [4149:5353]
152 146 -> SSAI Ultrasound Video Interface [414a:5353]
153 147 -> VoodooTV 200 (USA) [121a:3000]
154 148 -> DViCO FusionHDTV 2 [dbc0:d200]
155 149 -> Typhoon TV-Tuner PCI (50684)
156 150 -> Geovision GV-600 [008a:763c]
157 151 -> Kozumi KTV-01C
158 152 -> Encore ENL TV-FM-2 [1000:1801]
159 153 -> PHYTEC VD-012 (bt878)
160 154 -> PHYTEC VD-012-X1 (bt878)
161 155 -> PHYTEC VD-012-X2 (bt878)
162 156 -> IVCE-8784 [0000:f050,0001:f050,0002:f050,0003:f050]
163 157 -> Geovision GV-800(S) (master) [800a:763d]
164 158 -> Geovision GV-800(S) (slave) [800b:763d,800c:763d,800d:763d]
165 159 -> ProVideo PV183 [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540]
166 160 -> Tongwei Video Technology TD-3116 [f200:3116]
167 161 -> Aposonic W-DVR [0279:0228]
168 162 -> Adlink MPG24
169 163 -> Bt848 Capture 14MHz
170 164 -> CyberVision CV06 (SV)
171 165 -> Kworld V-Stream Xpert TV PVR878
172 166 -> PCI-8604PW
diff --git a/Documentation/media/v4l-drivers/bttv.rst b/Documentation/media/v4l-drivers/bttv.rst
new file mode 100644
index 000000000000..f78c135b40e7
--- /dev/null
+++ b/Documentation/media/v4l-drivers/bttv.rst
@@ -0,0 +1,1923 @@
1The bttv driver
2===============
3
4Release notes for bttv
5----------------------
6
7You'll need at least these config options for bttv:
8
9.. code-block:: none
10
11 CONFIG_I2C=m
12 CONFIG_I2C_ALGOBIT=m
13 CONFIG_VIDEO_DEV=m
14
15The latest bttv version is available from http://bytesex.org/bttv/
16
17
18Make bttv work with your card
19-----------------------------
20
21Just try "modprobe bttv" and see if that works.
22
23If it doesn't bttv likely could not autodetect your card and needs some
24insmod options. The most important insmod option for bttv is "card=n"
25to select the correct card type. If you get video but no sound you've
26very likely specified the wrong (or no) card type. A list of supported
27cards is in CARDLIST.bttv
28
29If bttv takes very long to load (happens sometimes with the cheap
30cards which have no tuner), try adding this to your modules.conf:
31
32.. code-block:: none
33
34 options i2c-algo-bit bit_test=1
35
36For the WinTV/PVR you need one firmware file from the driver CD:
37hcwamc.rbf. The file is in the pvr45xxx.exe archive (self-extracting
38zip file, unzip can unpack it). Put it into the /etc/pvr directory or
39use the firm_altera=<path> insmod option to point the driver to the
40location of the file.
41
42If your card isn't listed in CARDLIST.bttv or if you have trouble making
43audio work, you should read the Sound-FAQ.
44
45
46Autodetecting cards
47-------------------
48
49bttv uses the PCI Subsystem ID to autodetect the card type. lspci lists
50the Subsystem ID in the second line, looks like this:
51
52.. code-block:: none
53
54 00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02)
55 Subsystem: Hauppauge computer works Inc. WinTV/GO
56 Flags: bus master, medium devsel, latency 32, IRQ 5
57 Memory at e2000000 (32-bit, prefetchable) [size=4K]
58
59only bt878-based cards can have a subsystem ID (which does not mean
60that every card really has one). bt848 cards can't have a Subsystem
61ID and therefore can't be autodetected. There is a list with the ID's
62in bttv-cards.c (in case you are intrested or want to mail patches
63with updates).
64
65
66Still doesn't work?
67-------------------
68
69I do NOT have a lab with 30+ different grabber boards and a
70PAL/NTSC/SECAM test signal generator at home, so I often can't
71reproduce your problems. This makes debugging very difficult for me.
72If you have some knowledge and spare time, please try to fix this
73yourself (patches very welcome of course...) You know: The linux
74slogan is "Do it yourself".
75
76There is a mailing list at
77http://vger.kernel.org/vger-lists.html#linux-media
78
79If you have trouble with some specific TV card, try to ask there
80instead of mailing me directly. The chance that someone with the
81same card listens there is much higher...
82
83For problems with sound: There are a lot of different systems used
84for TV sound all over the world. And there are also different chips
85which decode the audio signal. Reports about sound problems ("stereo
86does'nt work") are pretty useless unless you include some details
87about your hardware and the TV sound scheme used in your country (or
88at least the country you are living in).
89
90Modprobe options
91----------------
92
93Note: "modinfo <module>" prints various information about a kernel
94module, among them a complete and up-to-date list of insmod options.
95This list tends to be outdated because it is updated manually ...
96
97==========================================================================
98
99bttv.o
100
101.. code-block:: none
102
103 the bt848/878 (grabber chip) driver
104
105 insmod args:
106 card=n card type, see CARDLIST for a list.
107 tuner=n tuner type, see CARDLIST for a list.
108 radio=0/1 card supports radio
109 pll=0/1/2 pll settings
110 0: don't use PLL
111 1: 28 MHz crystal installed
112 2: 35 MHz crystal installed
113
114 triton1=0/1 for Triton1 (+others) compatibility
115 vsfx=0/1 yet another chipset bug compatibility bit
116 see README.quirks for details on these two.
117
118 bigendian=n Set the endianness of the gfx framebuffer.
119 Default is native endian.
120 fieldnr=0/1 Count fields. Some TV descrambling software
121 needs this, for others it only generates
122 50 useless IRQs/sec. default is 0 (off).
123 autoload=0/1 autoload helper modules (tuner, audio).
124 default is 1 (on).
125 bttv_verbose=0/1/2 verbose level (at insmod time, while
126 looking at the hardware). default is 1.
127 bttv_debug=0/1 debug messages (for capture).
128 default is 0 (off).
129 irq_debug=0/1 irq handler debug messages.
130 default is 0 (off).
131 gbuffers=2-32 number of capture buffers for mmap'ed capture.
132 default is 4.
133 gbufsize= size of capture buffers. default and
134 maximum value is 0x208000 (~2MB)
135 no_overlay=0 Enable overlay on broken hardware. There
136 are some chipsets (SIS for example) which
137 are known to have problems with the PCI DMA
138 push used by bttv. bttv will disable overlay
139 by default on this hardware to avoid crashes.
140 With this insmod option you can override this.
141 no_overlay=1 Disable overlay. It should be used by broken
142 hardware that doesn't support PCI2PCI direct
143 transfers.
144 automute=0/1 Automatically mutes the sound if there is
145 no TV signal, on by default. You might try
146 to disable this if you have bad input signal
147 quality which leading to unwanted sound
148 dropouts.
149 chroma_agc=0/1 AGC of chroma signal, off by default.
150 adc_crush=0/1 Luminance ADC crush, on by default.
151 i2c_udelay= Allow reduce I2C speed. Default is 5 usecs
152 (meaning 66,67 Kbps). The default is the
153 maximum supported speed by kernel bitbang
154 algorithm. You may use lower numbers, if I2C
155 messages are lost (16 is known to work on
156 all supported cards).
157
158 bttv_gpio=0/1
159 gpiomask=
160 audioall=
161 audiomux=
162 See Sound-FAQ for a detailed description.
163
164 remap, card, radio and pll accept up to four comma-separated arguments
165 (for multiple boards).
166
167tuner.o
168
169.. code-block:: none
170
171 The tuner driver. You need this unless you want to use only
172 with a camera or external tuner ...
173
174 insmod args:
175 debug=1 print some debug info to the syslog
176 type=n type of the tuner chip. n as follows:
177 see CARDLIST for a complete list.
178 pal=[bdgil] select PAL variant (used for some tuners
179 only, important for the audio carrier).
180
181tvaudio.o
182
183.. code-block:: none
184
185 new, experimental module which is supported to provide a single
186 driver for all simple i2c audio control chips (tda/tea*).
187
188 insmod args:
189 tda8425 = 1 enable/disable the support for the
190 tda9840 = 1 various chips.
191 tda9850 = 1 The tea6300 can't be autodetected and is
192 tda9855 = 1 therefore off by default, if you have
193 tda9873 = 1 this one on your card (STB uses these)
194 tda9874a = 1 you have to enable it explicitly.
195 tea6300 = 0 The two tda985x chips use the same i2c
196 tea6420 = 1 address and can't be disturgished from
197 pic16c54 = 1 each other, you might have to disable
198 the wrong one.
199 debug = 1 print debug messages
200
201 insmod args for tda9874a:
202 tda9874a_SIF=1/2 select sound IF input pin (1 or 2)
203 (default is pin 1)
204 tda9874a_AMSEL=0/1 auto-mute select for NICAM (default=0)
205 Please read note 3 below!
206 tda9874a_STD=n select TV sound standard (0..8):
207 0 - A2, B/G
208 1 - A2, M (Korea)
209 2 - A2, D/K (1)
210 3 - A2, D/K (2)
211 4 - A2, D/K (3)
212 5 - NICAM, I
213 6 - NICAM, B/G
214 7 - NICAM, D/K (default)
215 8 - NICAM, L
216
217 Note 1: tda9874a supports both tda9874h (old) and tda9874a (new) chips.
218 Note 2: tda9874h/a and tda9875 (which is supported separately by
219 tda9875.o) use the same i2c address so both modules should not be
220 used at the same time.
221 Note 3: Using tda9874a_AMSEL option depends on your TV card design!
222 AMSEL=0: auto-mute will switch between NICAM sound
223 and the sound on 1st carrier (i.e. FM mono or AM).
224 AMSEL=1: auto-mute will switch between NICAM sound
225 and the analog mono input (MONOIN pin).
226 If tda9874a decoder on your card has MONOIN pin not connected, then
227 use only tda9874_AMSEL=0 or don't specify this option at all.
228 For example:
229 card=65 (FlyVideo 2000S) - set AMSEL=1 or AMSEL=0
230 card=72 (Prolink PV-BT878P rev.9B) - set AMSEL=0 only
231
232msp3400.o
233
234.. code-block:: none
235
236 The driver for the msp34xx sound processor chips. If you have a
237 stereo card, you probably want to insmod this one.
238
239 insmod args:
240 debug=1/2 print some debug info to the syslog,
241 2 is more verbose.
242 simple=1 Use the "short programming" method. Newer
243 msp34xx versions support this. You need this
244 for dbx stereo. Default is on if supported by
245 the chip.
246 once=1 Don't check the TV-stations Audio mode
247 every few seconds, but only once after
248 channel switches.
249 amsound=1 Audio carrier is AM/NICAM at 6.5 Mhz. This
250 should improve things for french people, the
251 carrier autoscan seems to work with FM only...
252
253tea6300.o - OBSOLETE (use tvaudio instead)
254
255.. code-block:: none
256
257 The driver for the tea6300 fader chip. If you have a stereo
258 card and the msp3400.o doesn't work, you might want to try this
259 one. This chip is seen on most STB TV/FM cards (usually from
260 Gateway OEM sold surplus on auction sites).
261
262 insmod args:
263 debug=1 print some debug info to the syslog.
264
265tda8425.o - OBSOLETE (use tvaudio instead)
266
267.. code-block:: none
268
269 The driver for the tda8425 fader chip. This driver used to be
270 part of bttv.c, so if your sound used to work but does not
271 anymore, try loading this module.
272
273 insmod args:
274 debug=1 print some debug info to the syslog.
275
276tda985x.o - OBSOLETE (use tvaudio instead)
277
278.. code-block:: none
279
280 The driver for the tda9850/55 audio chips.
281
282 insmod args:
283 debug=1 print some debug info to the syslog.
284 chip=9850/9855 set the chip type.
285
286
287If the box freezes hard with bttv
288---------------------------------
289
290It might be a bttv driver bug. It also might be bad hardware. It also
291might be something else ...
292
293Just mailing me "bttv freezes" isn't going to help much. This README
294has a few hints how you can help to pin down the problem.
295
296
297bttv bugs
298~~~~~~~~~
299
300If some version works and another doesn't it is likely to be a driver
301bug. It is very helpful if you can tell where exactly it broke
302(i.e. the last working and the first broken version).
303
304With a hard freeze you probably doesn't find anything in the logfiles.
305The only way to capture any kernel messages is to hook up a serial
306console and let some terminal application log the messages. /me uses
307screen. See Documentation/serial-console.txt for details on setting
308up a serial console.
309
310Read Documentation/oops-tracing.txt to learn how to get any useful
311information out of a register+stack dump printed by the kernel on
312protection faults (so-called "kernel oops").
313
314If you run into some kind of deadlock, you can try to dump a call trace
315for each process using sysrq-t (see Documentation/sysrq.txt).
316This way it is possible to figure where *exactly* some process in "D"
317state is stuck.
318
319I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid
320for some people. Thus probably a small buglet left somewhere in bttv
3210.7.x. I have no idea where exactly, it works stable for me and a lot of
322other people. But in case you have problems with the 0.7.x versions you
323can give 0.8.x a try ...
324
325
326hardware bugs
327~~~~~~~~~~~~~
328
329Some hardware can't deal with PCI-PCI transfers (i.e. grabber => vga).
330Sometimes problems show up with bttv just because of the high load on
331the PCI bus. The bt848/878 chips have a few workarounds for known
332incompatibilities, see README.quirks.
333
334Some folks report that increasing the pci latency helps too,
335althrought I'm not sure whenever this really fixes the problems or
336only makes it less likely to happen. Both bttv and btaudio have a
337insmod option to set the PCI latency of the device.
338
339Some mainboard have problems to deal correctly with multiple devices
340doing DMA at the same time. bttv + ide seems to cause this sometimes,
341if this is the case you likely see freezes only with video and hard disk
342access at the same time. Updating the IDE driver to get the latest and
343greatest workarounds for hardware bugs might fix these problems.
344
345
346other
347~~~~~
348
349If you use some binary-only yunk (like nvidia module) try to reproduce
350the problem without.
351
352IRQ sharing is known to cause problems in some cases. It works just
353fine in theory and many configurations. Neverless it might be worth a
354try to shuffle around the PCI cards to give bttv another IRQ or make
355it share the IRQ with some other piece of hardware. IRQ sharing with
356VGA cards seems to cause trouble sometimes. I've also seen funny
357effects with bttv sharing the IRQ with the ACPI bridge (and
358apci-enabled kernel).
359
360Bttv quirks
361-----------
362
363Below is what the bt878 data book says about the PCI bug compatibility
364modes of the bt878 chip.
365
366The triton1 insmod option sets the EN_TBFX bit in the control register.
367The vsfx insmod option does the same for EN_VSFX bit. If you have
368stability problems you can try if one of these options makes your box
369work solid.
370
371drivers/pci/quirks.c knows about these issues, this way these bits are
372enabled automagically for known-buggy chipsets (look at the kernel
373messages, bttv tells you).
374
375Normal PCI Mode
376~~~~~~~~~~~~~~~
377
378The PCI REQ signal is the logical-or of the incoming function requests.
379The inter-nal GNT[0:1] signals are gated asynchronously with GNT and
380demultiplexed by the audio request signal. Thus the arbiter defaults to
381the video function at power-up and parks there during no requests for
382bus access. This is desirable since the video will request the bus more
383often. However, the audio will have highest bus access priority. Thus
384the audio will have first access to the bus even when issuing a request
385after the video request but before the PCI external arbiter has granted
386access to the Bt879. Neither function can preempt the other once on the
387bus. The duration to empty the entire video PCI FIFO onto the PCI bus is
388very short compared to the bus access latency the audio PCI FIFO can
389tolerate.
390
391
392430FX Compatibility Mode
393~~~~~~~~~~~~~~~~~~~~~~~~
394
395When using the 430FX PCI, the following rules will ensure
396compatibility:
397
398 (1) Deassert REQ at the same time as asserting FRAME.
399 (2) Do not reassert REQ to request another bus transaction until after
400 finish-ing the previous transaction.
401
402Since the individual bus masters do not have direct control of REQ, a
403simple logical-or of video and audio requests would violate the rules.
404Thus, both the arbiter and the initiator contain 430FX compatibility
405mode logic. To enable 430FX mode, set the EN_TBFX bit as indicated in
406Device Control Register on page 104.
407
408When EN_TBFX is enabled, the arbiter ensures that the two compatibility
409rules are satisfied. Before GNT is asserted by the PCI arbiter, this
410internal arbiter may still logical-or the two requests. However, once
411the GNT is issued, this arbiter must lock in its decision and now route
412only the granted request to the REQ pin. The arbiter decision lock
413happens regardless of the state of FRAME because it does not know when
414FRAME will be asserted (typically - each initiator will assert FRAME on
415the cycle following GNT). When FRAME is asserted, it is the initiator s
416responsibility to remove its request at the same time. It is the
417arbiters responsibility to allow this request to flow through to REQ and
418not allow the other request to hold REQ asserted. The decision lock may
419be removed at the end of the transaction: for example, when the bus is
420idle (FRAME and IRDY). The arbiter decision may then continue
421asynchronously until GNT is again asserted.
422
423
424Interfacing with Non-PCI 2.1 Compliant Core Logic
425~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
426
427A small percentage of core logic devices may start a bus transaction
428during the same cycle that GNT is de-asserted. This is non PCI 2.1
429compliant. To ensure compatibility when using PCs with these PCI
430controllers, the EN_VSFX bit must be enabled (refer to Device Control
431Register on page 104). When in this mode, the arbiter does not pass GNT
432to the internal functions unless REQ is asserted. This prevents a bus
433transaction from starting the same cycle as GNT is de-asserted. This
434also has the side effect of not being able to take advantage of bus
435parking, thus lowering arbitration performance. The Bt879 drivers must
436query for these non-compliant devices, and set the EN_VSFX bit only if
437required.
438
439bttv and sound mini howto
440-------------------------
441
442There are a lot of different bt848/849/878/879 based boards available.
443Making video work often is not a big deal, because this is handled
444completely by the bt8xx chip, which is common on all boards. But
445sound is handled in slightly different ways on each board.
446
447To handle the grabber boards correctly, there is a array tvcards[] in
448bttv-cards.c, which holds the information required for each board.
449Sound will work only, if the correct entry is used (for video it often
450makes no difference). The bttv driver prints a line to the kernel
451log, telling which card type is used. Like this one:
452
453.. code-block:: none
454
455 bttv0: model: BT848(Hauppauge old) [autodetected]
456
457You should verify this is correct. If it isn't, you have to pass the
458correct board type as insmod argument, "insmod bttv card=2" for
459example. The file CARDLIST has a list of valid arguments for card.
460If your card isn't listed there, you might check the source code for
461new entries which are not listed yet. If there isn't one for your
462card, you can check if one of the existing entries does work for you
463(just trial and error...).
464
465Some boards have an extra processor for sound to do stereo decoding
466and other nice features. The msp34xx chips are used by Hauppauge for
467example. If your board has one, you might have to load a helper
468module like msp3400.o to make sound work. If there isn't one for the
469chip used on your board: Bad luck. Start writing a new one. Well,
470you might want to check the video4linux mailing list archive first...
471
472Of course you need a correctly installed soundcard unless you have the
473speakers connected directly to the grabber board. Hint: check the
474mixer settings too. ALSA for example has everything muted by default.
475
476
477How sound works in detail
478~~~~~~~~~~~~~~~~~~~~~~~~~
479
480Still doesn't work? Looks like some driver hacking is required.
481Below is a do-it-yourself description for you.
482
483The bt8xx chips have 32 general purpose pins, and registers to control
484these pins. One register is the output enable register
485(BT848_GPIO_OUT_EN), it says which pins are actively driven by the
486bt848 chip. Another one is the data register (BT848_GPIO_DATA), where
487you can get/set the status if these pins. They can be used for input
488and output.
489
490Most grabber board vendors use these pins to control an external chip
491which does the sound routing. But every board is a little different.
492These pins are also used by some companies to drive remote control
493receiver chips. Some boards use the i2c bus instead of the gpio pins
494to connect the mux chip.
495
496As mentioned above, there is a array which holds the required
497information for each known board. You basically have to create a new
498line for your board. The important fields are these two:
499
500.. code-block:: c
501
502 struct tvcard
503 {
504 [ ... ]
505 u32 gpiomask;
506 u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
507 };
508
509gpiomask specifies which pins are used to control the audio mux chip.
510The corresponding bits in the output enable register
511(BT848_GPIO_OUT_EN) will be set as these pins must be driven by the
512bt848 chip.
513
514The audiomux\[\] array holds the data values for the different inputs
515(i.e. which pins must be high/low for tuner/mute/...). This will be
516written to the data register (BT848_GPIO_DATA) to switch the audio
517mux.
518
519
520What you have to do is figure out the correct values for gpiomask and
521the audiomux array. If you have Windows and the drivers four your
522card installed, you might to check out if you can read these registers
523values used by the windows driver. A tool to do this is available
524from ftp://telepresence.dmem.strath.ac.uk/pub/bt848/winutil, but it
525doesn't work with bt878 boards according to some reports I received.
526Another one with bt878 support is available from
527http://btwincap.sourceforge.net/Files/btspy2.00.zip
528
529You might also dig around in the \*.ini files of the Windows applications.
530You can have a look at the board to see which of the gpio pins are
531connected at all and then start trial-and-error ...
532
533
534Starting with release 0.7.41 bttv has a number of insmod options to
535make the gpio debugging easier:
536
537.. code-block:: none
538
539 bttv_gpio=0/1 enable/disable gpio debug messages
540 gpiomask=n set the gpiomask value
541 audiomux=i,j,... set the values of the audiomux array
542 audioall=a set the values of the audiomux array (one
543 value for all array elements, useful to check
544 out which effect the particular value has).
545
546The messages printed with bttv_gpio=1 look like this:
547
548.. code-block:: none
549
550 bttv0: gpio: en=00000027, out=00000024 in=00ffffd8 [audio: off]
551
552 en = output _en_able register (BT848_GPIO_OUT_EN)
553 out = _out_put bits of the data register (BT848_GPIO_DATA),
554 i.e. BT848_GPIO_DATA & BT848_GPIO_OUT_EN
555 in = _in_put bits of the data register,
556 i.e. BT848_GPIO_DATA & ~BT848_GPIO_OUT_EN
557
558
559
560Other elements of the tvcards array
561~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
562
563If you are trying to make a new card work you might find it useful to
564know what the other elements in the tvcards array are good for:
565
566.. code-block:: none
567
568 video_inputs - # of video inputs the card has
569 audio_inputs - historical cruft, not used any more.
570 tuner - which input is the tuner
571 svhs - which input is svhs (all others are labeled composite)
572 muxsel - video mux, input->registervalue mapping
573 pll - same as pll= insmod option
574 tuner_type - same as tuner= insmod option
575 *_modulename - hint whenever some card needs this or that audio
576 module loaded to work properly.
577 has_radio - whenever this TV card has a radio tuner.
578 no_msp34xx - "1" disables loading of msp3400.o module
579 no_tda9875 - "1" disables loading of tda9875.o module
580 needs_tvaudio - set to "1" to load tvaudio.o module
581
582If some config item is specified both from the tvcards array and as
583insmod option, the insmod option takes precedence.
584
585Cards
586-----
587
588.. note::
589 For a more updated list, please check
590 https://linuxtv.org/wiki/index.php/Hardware_Device_Information
591
592Supported cards: Bt848/Bt848a/Bt849/Bt878/Bt879 cards
593~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594
595All cards with Bt848/Bt848a/Bt849/Bt878/Bt879 and normal
596Composite/S-VHS inputs are supported. Teletext and Intercast support
597(PAL only) for ALL cards via VBI sample decoding in software.
598
599Some cards with additional multiplexing of inputs or other additional
600fancy chips are only partially supported (unless specifications by the
601card manufacturer are given). When a card is listed here it isn't
602necessarily fully supported.
603
604All other cards only differ by additional components as tuners, sound
605decoders, EEPROMs, teletext decoders ...
606
607
608MATRIX Vision
609~~~~~~~~~~~~~
610
611MV-Delta
612- Bt848A
613- 4 Composite inputs, 1 S-VHS input (shared with 4th composite)
614- EEPROM
615
616http://www.matrix-vision.de/
617
618This card has no tuner but supports all 4 composite (1 shared with an
619S-VHS input) of the Bt848A.
620Very nice card if you only have satellite TV but several tuners connected
621to the card via composite.
622
623Many thanks to Matrix-Vision for giving us 2 cards for free which made
624Bt848a/Bt849 single crystal operation support possible!!!
625
626
627
628Miro/Pinnacle PCTV
629~~~~~~~~~~~~~~~~~~
630
631- Bt848
632 some (all??) come with 2 crystals for PAL/SECAM and NTSC
633- PAL, SECAM or NTSC TV tuner (Philips or TEMIC)
634- MSP34xx sound decoder on add on board
635 decoder is supported but AFAIK does not yet work
636 (other sound MUX setting in GPIO port needed??? somebody who fixed this???)
637- 1 tuner, 1 composite and 1 S-VHS input
638- tuner type is autodetected
639
640http://www.miro.de/
641http://www.miro.com/
642
643
644Many thanks for the free card which made first NTSC support possible back
645in 1997!
646
647
648Hauppauge Win/TV pci
649~~~~~~~~~~~~~~~~~~~~
650
651There are many different versions of the Hauppauge cards with different
652tuners (TV+Radio ...), teletext decoders.
653Note that even cards with same model numbers have (depending on the revision)
654different chips on it.
655
656- Bt848 (and others but always in 2 crystal operation???)
657 newer cards have a Bt878
658
659- PAL, SECAM, NTSC or tuner with or without Radio support
660
661e.g.:
662
663- PAL:
664
665 - TDA5737: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
666 - TSA5522: 1.4 GHz I2C-bus controlled synthesizer, I2C 0xc2-0xc3
667
668- NTSC:
669
670 - TDA5731: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
671 - TSA5518: no datasheet available on Philips site
672
673- Philips SAA5246 or SAA5284 ( or no) Teletext decoder chip
674 with buffer RAM (e.g. Winbond W24257AS-35: 32Kx8 CMOS static RAM)
675 SAA5246 (I2C 0x22) is supported
676
677- 256 bytes EEPROM: Microchip 24LC02B or Philips 8582E2Y
678 with configuration information
679 I2C address 0xa0 (24LC02B also responds to 0xa2-0xaf)
680
681- 1 tuner, 1 composite and (depending on model) 1 S-VHS input
682
683- 14052B: mux for selection of sound source
684
685- sound decoder: TDA9800, MSP34xx (stereo cards)
686
687
688Askey CPH-Series
689~~~~~~~~~~~~~~~~
690Developed by TelSignal(?), OEMed by many vendors (Typhoon, Anubis, Dynalink)
691
692- Card series:
693 - CPH01x: BT848 capture only
694 - CPH03x: BT848
695 - CPH05x: BT878 with FM
696 - CPH06x: BT878 (w/o FM)
697 - CPH07x: BT878 capture only
698
699- TV standards:
700 - CPH0x0: NTSC-M/M
701 - CPH0x1: PAL-B/G
702 - CPH0x2: PAL-I/I
703 - CPH0x3: PAL-D/K
704 - CPH0x4: SECAM-L/L
705 - CPH0x5: SECAM-B/G
706 - CPH0x6: SECAM-D/K
707 - CPH0x7: PAL-N/N
708 - CPH0x8: PAL-B/H
709 - CPH0x9: PAL-M/M
710
711- CPH03x was often sold as "TV capturer".
712
713Identifying:
714
715 #) 878 cards can be identified by PCI Subsystem-ID:
716 - 144f:3000 = CPH06x
717 - 144F:3002 = CPH05x w/ FM
718 - 144F:3005 = CPH06x_LC (w/o remote control)
719 #) The cards have a sticker with "CPH"-model on the back.
720 #) These cards have a number printed on the PCB just above the tuner metal box:
721 - "80-CP2000300-x" = CPH03X
722 - "80-CP2000500-x" = CPH05X
723 - "80-CP2000600-x" = CPH06X / CPH06x_LC
724
725 Askey sells these cards as "Magic TView series", Brand "MagicXpress".
726 Other OEM often call these "Tview", "TView99" or else.
727
728Lifeview Flyvideo Series:
729~~~~~~~~~~~~~~~~~~~~~~~~~
730
731The naming of these series differs in time and space.
732
733Identifying:
734 #) Some models can be identified by PCI subsystem ID:
735
736 - 1852:1852 = Flyvideo 98 FM
737 - 1851:1850 = Flyvideo 98
738 - 1851:1851 = Flyvideo 98 EZ (capture only)
739
740 #) There is a print on the PCB:
741
742 - LR25 = Flyvideo (Zoran ZR36120, SAA7110A)
743 - LR26 Rev.N = Flyvideo II (Bt848)
744 - LR26 Rev.O = Flyvideo II (Bt878)
745 - LR37 Rev.C = Flyvideo EZ (Capture only, ZR36120 + SAA7110)
746 - LR38 Rev.A1= Flyvideo II EZ (Bt848 capture only)
747 - LR50 Rev.Q = Flyvideo 98 (w/eeprom and PCI subsystem ID)
748 - LR50 Rev.W = Flyvideo 98 (no eeprom)
749 - LR51 Rev.E = Flyvideo 98 EZ (capture only)
750 - LR90 = Flyvideo 2000 (Bt878)
751 - LR90 Flyvideo 2000S (Bt878) w/Stereo TV (Package incl. LR91 daughterboard)
752 - LR91 = Stereo daughter card for LR90
753 - LR97 = Flyvideo DVBS
754 - LR99 Rev.E = Low profile card for OEM integration (only internal audio!) bt878
755 - LR136 = Flyvideo 2100/3100 (Low profile, SAA7130/SAA7134)
756 - LR137 = Flyvideo DV2000/DV3000 (SAA7130/SAA7134 + IEEE1394)
757 - LR138 Rev.C= Flyvideo 2000 (SAA7130)
758 - LR138 Flyvideo 3000 (SAA7134) w/Stereo TV
759
760 - These exist in variations w/FM and w/Remote sometimes denoted
761 by suffixes "FM" and "R".
762
763 #) You have a laptop (miniPCI card):
764
765 - Product = FlyTV Platinum Mini
766 - Model/Chip = LR212/saa7135
767
768 - Lifeview.com.tw states (Feb. 2002):
769 "The FlyVideo2000 and FlyVideo2000s product name have renamed to FlyVideo98."
770 Their Bt8x8 cards are listed as discontinued.
771 - Flyvideo 2000S was probably sold as Flyvideo 3000 in some contries(Europe?).
772 The new Flyvideo 2000/3000 are SAA7130/SAA7134 based.
773
774"Flyvideo II" had been the name for the 848 cards, nowadays (in Germany)
775this name is re-used for LR50 Rev.W.
776
777The Lifeview website mentioned Flyvideo III at some time, but such a card
778has not yet been seen (perhaps it was the german name for LR90 [stereo]).
779These cards are sold by many OEMs too.
780
781FlyVideo A2 (Elta 8680)= LR90 Rev.F (w/Remote, w/o FM, stereo TV by tda9821) {Germany}
782
783Lifeview 3000 (Elta 8681) as sold by Plus(April 2002), Germany = LR138 w/ saa7134
784
785lifeview config coding on gpio pins 0-9
786^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
787
788- LR50 rev. Q ("PARTS: 7031505116), Tuner wurde als Nr. 5 erkannt, Eingänge
789 SVideo, TV, Composite, Audio, Remote:
790
791 - CP9..1=100001001 (1: 0-Ohm-Widerstand gegen GND unbestückt; 0: bestückt)
792
793
794Typhoon TV card series:
795~~~~~~~~~~~~~~~~~~~~~~~
796
797These can be CPH, Flyvideo, Pixelview or KNC1 series.
798Typhoon is the brand of Anubis.
799Model 50680 got re-used, some model no. had different contents over time.
800
801Models:
802
803 - 50680 "TV Tuner PCI Pal BG"(old,red package)=can be CPH03x(bt848) or CPH06x(bt878)
804 - 50680 "TV Tuner Pal BG" (blue package)= Pixelview PV-BT878P+ (Rev 9B)
805 - 50681 "TV Tuner PCI Pal I" (variant of 50680)
806 - 50682 "TView TV/FM Tuner Pal BG" = Flyvideo 98FM (LR50 Rev.Q)
807
808 .. note::
809
810 The package has a picture of CPH05x (which would be a real TView)
811
812 - 50683 "TV Tuner PCI SECAM" (variant of 50680)
813 - 50684 "TV Tuner Pal BG" = Pixelview 878TV(Rev.3D)
814 - 50686 "TV Tuner" = KNC1 TV Station
815 - 50687 "TV Tuner stereo" = KNC1 TV Station pro
816 - 50688 "TV Tuner RDS" (black package) = KNC1 TV Station RDS
817 - 50689 TV SAT DVB-S CARD CI PCI (SAA7146AH, SU1278?) = "KNC1 TV Station DVB-S"
818 - 50692 "TV/FM Tuner" (small PCB)
819 - 50694 TV TUNER CARD RDS (PHILIPS CHIPSET SAA7134HL)
820 - 50696 TV TUNER STEREO (PHILIPS CHIPSET SAA7134HL, MK3ME Tuner)
821 - 50804 PC-SAT TV/Audio Karte = Techni-PC-Sat (ZORAN 36120PQC, Tuner:Alps)
822 - 50866 TVIEW SAT RECEIVER+ADR
823 - 50868 "TV/FM Tuner Pal I" (variant of 50682)
824 - 50999 "TV/FM Tuner Secam" (variant of 50682)
825
826Guillemot
827~~~~~~~~~
828
829Models:
830
831- Maxi-TV PCI (ZR36120)
832- Maxi TV Video 2 = LR50 Rev.Q (FI1216MF, PAL BG+SECAM)
833- Maxi TV Video 3 = CPH064 (PAL BG + SECAM)
834
835Mentor
836~~~~~~
837
838Mentor TV card ("55-878TV-U1") = Pixelview 878TV(Rev.3F) (w/FM w/Remote)
839
840Prolink
841~~~~~~~
842
843- TV cards:
844
845 - PixelView Play TV pro - (Model: PV-BT878P+ REV 8E)
846 - PixelView Play TV pro - (Model: PV-BT878P+ REV 9D)
847 - PixelView Play TV pro - (Model: PV-BT878P+ REV 4C / 8D / 10A )
848 - PixelView Play TV - (Model: PV-BT848P+)
849 - 878TV - (Model: PV-BT878TV)
850
851- Multimedia TV packages (card + software pack):
852
853 - PixelView Play TV Theater - (Model: PV-M4200) = PixelView Play TV pro + Software
854 - PixelView Play TV PAK - (Model: PV-BT878P+ REV 4E)
855 - PixelView Play TV/VCR - (Model: PV-M3200 REV 4C / 8D / 10A )
856 - PixelView Studio PAK - (Model: M2200 REV 4C / 8D / 10A )
857 - PixelView PowerStudio PAK - (Model: PV-M3600 REV 4E)
858 - PixelView DigitalVCR PAK - (Model: PV-M2400 REV 4C / 8D / 10A )
859 - PixelView PlayTV PAK II (TV/FM card + usb camera) PV-M3800
860 - PixelView PlayTV XP PV-M4700,PV-M4700(w/FM)
861 - PixelView PlayTV DVR PV-M4600 package contents:PixelView PlayTV pro, windvr & videoMail s/w
862
863- Further Cards:
864
865 - PV-BT878P+rev.9B (Play TV Pro, opt. w/FM w/NICAM)
866 - PV-BT878P+rev.2F
867 - PV-BT878P Rev.1D (bt878, capture only)
868
869 - XCapture PV-CX881P (cx23881)
870 - PlayTV HD PV-CX881PL+, PV-CX881PL+(w/FM) (cx23881)
871
872 - DTV3000 PV-DTV3000P+ DVB-S CI = Twinhan VP-1030
873 - DTV2000 DVB-S = Twinhan VP-1020
874
875- Video Conferencing:
876
877 - PixelView Meeting PAK - (Model: PV-BT878P)
878 - PixelView Meeting PAK Lite - (Model: PV-BT878P)
879 - PixelView Meeting PAK plus - (Model: PV-BT878P+rev 4C/8D/10A)
880 - PixelView Capture - (Model: PV-BT848P)
881 - PixelView PlayTV USB pro
882 - Model No. PV-NT1004+, PV-NT1004+ (w/FM) = NT1004 USB decoder chip + SAA7113 video decoder chip
883
884Dynalink
885~~~~~~~~
886
887These are CPH series.
888
889Phoebemicro
890~~~~~~~~~~~
891
892- TV Master = CPH030 or CPH060
893- TV Master FM = CPH050
894
895Genius/Kye
896~~~~~~~~~~
897
898- Video Wonder/Genius Internet Video Kit = LR37 Rev.C
899- Video Wonder Pro II (848 or 878) = LR26
900
901Tekram
902~~~~~~
903
904- VideoCap C205 (Bt848)
905- VideoCap C210 (zr36120 +Philips)
906- CaptureTV M200 (ISA)
907- CaptureTV M205 (Bt848)
908
909Lucky Star
910~~~~~~~~~~
911
912- Image World Conference TV = LR50 Rev. Q
913
914Leadtek
915~~~~~~~
916
917- WinView 601 (Bt848)
918- WinView 610 (Zoran)
919- WinFast2000
920- WinFast2000 XP
921
922Support for the Leadtek WinView 601 TV/FM
923^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
924
925Author of this section: Jon Tombs <jon@gte.esi.us.es>
926
927This card is basically the same as all the rest (Bt484A, Philips tuner),
928the main difference is that they have attached a programmable attenuator to 3
929GPIO lines in order to give some volume control. They have also stuck an
930infra-red remote control decoded on the board, I will add support for this
931when I get time (it simple generates an interrupt for each key press, with
932the key code is placed in the GPIO port).
933
934I don't yet have any application to test the radio support. The tuner
935frequency setting should work but it is possible that the audio multiplexer
936is wrong. If it doesn't work, send me email.
937
938
939- No Thanks to Leadtek they refused to answer any questions about their
940 hardware. The driver was written by visual inspection of the card. If you
941 use this driver, send an email insult to them, and tell them you won't
942 continue buying their hardware unless they support Linux.
943
944- Little thanks to Princeton Technology Corp (http://www.princeton.com.tw)
945 who make the audio attenuator. Their publicly available data-sheet available
946 on their web site doesn't include the chip programming information! Hidden
947 on their server are the full data-sheets, but don't ask how I found it.
948
949To use the driver I use the following options, the tuner and pll settings might
950be different in your country
951
952insmod videodev
953insmod i2c scan=1 i2c_debug=0 verbose=0
954insmod tuner type=1 debug=0
955insmod bttv pll=1 radio=1 card=17
956
957
958KNC One
959~~~~~~~
960
961- TV-Station
962- TV-Station SE (+Software Bundle)
963- TV-Station pro (+TV stereo)
964- TV-Station FM (+Radio)
965- TV-Station RDS (+RDS)
966- TV Station SAT (analog satellite)
967- TV-Station DVB-S
968
969.. note:: newer Cards have saa7134, but model name stayed the same?
970
971Provideo
972~~~~~~~~
973
974- PV951 or PV-951 (also are sold as:
975 Boeder TV-FM Video Capture Card,
976 Titanmedia Supervision TV-2400,
977 Provideo PV951 TF,
978 3DeMon PV951,
979 MediaForte TV-Vision PV951,
980 Yoko PV951,
981 Vivanco Tuner Card PCI Art.-Nr.: 68404,
982 ) now named PV-951T
983
984- Surveillance Series:
985
986 - PV-141
987 - PV-143
988 - PV-147
989 - PV-148 (capture only)
990 - PV-150
991 - PV-151
992
993- TV-FM Tuner Series:
994
995 - PV-951TDV (tv tuner + 1394)
996 - PV-951T/TF
997 - PV-951PT/TF
998 - PV-956T/TF Low Profile
999 - PV-911
1000
1001Highscreen
1002~~~~~~~~~~
1003
1004Models:
1005
1006- TV Karte = LR50 Rev.S
1007- TV-Boostar = Terratec Terra TV+ Version 1.0 (Bt848, tda9821) "ceb105.pcb"
1008
1009Zoltrix
1010~~~~~~~
1011
1012Models:
1013
1014- Face to Face Capture (Bt848 capture only) (PCB "VP-2848")
1015- Face To Face TV MAX (Bt848) (PCB "VP-8482 Rev1.3")
1016- Genie TV (Bt878) (PCB "VP-8790 Rev 2.1")
1017- Genie Wonder Pro
1018
1019AVerMedia
1020~~~~~~~~~
1021
1022- AVer FunTV Lite (ISA, AV3001 chipset) "M101.C"
1023- AVerTV
1024- AVerTV Stereo
1025- AVerTV Studio (w/FM)
1026- AVerMedia TV98 with Remote
1027- AVerMedia TV/FM98 Stereo
1028- AVerMedia TVCAM98
1029- TVCapture (Bt848)
1030- TVPhone (Bt848)
1031- TVCapture98 (="AVerMedia TV98" in USA) (Bt878)
1032- TVPhone98 (Bt878, w/FM)
1033
1034======== =========== =============== ======= ====== ======== =======================
1035PCB PCI-ID Model-Name Eeprom Tuner Sound Country
1036======== =========== =============== ======= ====== ======== =======================
1037M101.C ISA !
1038M108-B Bt848 -- FR1236 US [#f2]_, [#f3]_
1039M1A8-A Bt848 AVer TV-Phone FM1216 --
1040M168-T 1461:0003 AVerTV Studio 48:17 FM1216 TDA9840T D [#f1]_ w/FM w/Remote
1041M168-U 1461:0004 TVCapture98 40:11 FI1216 -- D w/Remote
1042M168II-B 1461:0003 Medion MD9592 48:16 FM1216 TDA9873H D w/FM
1043======== =========== =============== ======= ====== ======== =======================
1044
1045.. [#f1] Daughterboard MB68-A with TDA9820T and TDA9840T
1046.. [#f2] Sony NE41S soldered (stereo sound?)
1047.. [#f3] Daughterboard M118-A w/ pic 16c54 and 4 MHz quartz
1048
1049- US site has different drivers for (as of 09/2002):
1050
1051 - EZ Capture/InterCam PCI (BT-848 chip)
1052 - EZ Capture/InterCam PCI (BT-878 chip)
1053 - TV-Phone (BT-848 chip)
1054 - TV98 (BT-848 chip)
1055 - TV98 With Remote (BT-848 chip)
1056 - TV98 (BT-878 chip)
1057 - TV98 With Remote (BT-878)
1058 - TV/FM98 (BT-878 chip)
1059 - AVerTV
1060 - AverTV Stereo
1061 - AVerTV Studio
1062
1063DE hat diverse Treiber fuer diese Modelle (Stand 09/2002):
1064
1065 - TVPhone (848) mit Philips tuner FR12X6 (w/ FM radio)
1066 - TVPhone (848) mit Philips tuner FM12X6 (w/ FM radio)
1067 - TVCapture (848) w/Philips tuner FI12X6
1068 - TVCapture (848) non-Philips tuner
1069 - TVCapture98 (Bt878)
1070 - TVPhone98 (Bt878)
1071 - AVerTV und TVCapture98 w/VCR (Bt 878)
1072 - AVerTVStudio und TVPhone98 w/VCR (Bt878)
1073 - AVerTV GO Serie (Kein SVideo Input)
1074 - AVerTV98 (BT-878 chip)
1075 - AVerTV98 mit Fernbedienung (BT-878 chip)
1076 - AVerTV/FM98 (BT-878 chip)
1077
1078 - VDOmate (www.averm.com.cn) = M168U ?
1079
1080Aimslab
1081~~~~~~~
1082
1083Models:
1084
1085- Video Highway or "Video Highway TR200" (ISA)
1086- Video Highway Xtreme (aka "VHX") (Bt848, FM w/ TEA5757)
1087
1088IXMicro (former: IMS=Integrated Micro Solutions)
1089~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090
1091Models:
1092
1093- IXTV BT848 (=TurboTV)
1094- IXTV BT878
1095- IMS TurboTV (Bt848)
1096
1097Lifetec/Medion/Tevion/Aldi
1098~~~~~~~~~~~~~~~~~~~~~~~~~~
1099
1100Models:
1101
1102- LT9306/MD9306 = CPH061
1103- LT9415/MD9415 = LR90 Rev.F or Rev.G
1104- MD9592 = Avermedia TVphone98 (PCI_ID=1461:0003), PCB-Rev=M168II-B (w/TDA9873H)
1105- MD9717 = KNC One (Rev D4, saa7134, FM1216 MK2 tuner)
1106- MD5044 = KNC One (Rev D4, saa7134, FM1216ME MK3 tuner)
1107
1108Modular Technologies (www.modulartech.com) UK
1109~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110
1111Models:
1112
1113- MM100 PCTV (Bt848)
1114- MM201 PCTV (Bt878, Bt832) w/ Quartzsight camera
1115- MM202 PCTV (Bt878, Bt832, tda9874)
1116- MM205 PCTV (Bt878)
1117- MM210 PCTV (Bt878) (Galaxy TV, Galaxymedia ?)
1118
1119Terratec
1120~~~~~~~~
1121
1122Models:
1123
1124- Terra TV+ Version 1.0 (Bt848), "ceb105.PCB" printed on the PCB, TDA9821
1125- Terra TV+ Version 1.1 (Bt878), "LR74 Rev.E" printed on the PCB, TDA9821
1126- Terra TValueRadio, "LR102 Rev.C" printed on the PCB
1127- Terra TV/Radio+ Version 1.0, "80-CP2830100-0" TTTV3 printed on the PCB,
1128 "CPH010-E83" on the back, SAA6588T, TDA9873H
1129- Terra TValue Version BT878, "80-CP2830110-0 TTTV4" printed on the PCB,
1130 "CPH011-D83" on back
1131- Terra TValue Version 1.0 "ceb105.PCB" (really identical to Terra TV+ Version 1.0)
1132- Terra TValue New Revision "LR102 Rec.C"
1133- Terra Active Radio Upgrade (tea5757h, saa6588t)
1134
1135- LR74 is a newer PCB revision of ceb105 (both incl. connector for Active Radio Upgrade)
1136
1137- Cinergy 400 (saa7134), "E877 11(S)", "PM820092D" printed on PCB
1138- Cinergy 600 (saa7134)
1139
1140Technisat
1141~~~~~~~~~
1142
1143Models:
1144
1145- Discos ADR PC-Karte ISA (no TV!)
1146- Discos ADR PC-Karte PCI (probably no TV?)
1147- Techni-PC-Sat (Sat. analog)
1148 Rev 1.2 (zr36120, vpx3220, stv0030, saa5246, BSJE3-494A)
1149- Mediafocus I (zr36120/zr36125, drp3510, Sat. analog + ADR Radio)
1150- Mediafocus II (saa7146, Sat. analog)
1151- SatADR Rev 2.1 (saa7146a, saa7113h, stv0056a, msp3400c, drp3510a, BSKE3-307A)
1152- SkyStar 1 DVB (AV7110) = Technotrend Premium
1153- SkyStar 2 DVB (B2C2) (=Sky2PC)
1154
1155Siemens
1156~~~~~~~
1157
1158Multimedia eXtension Board (MXB) (SAA7146, SAA7111)
1159
1160Powercolor
1161~~~~~~~~~~
1162
1163Models:
1164
1165- MTV878
1166 Package comes with different contents:
1167
1168 a) pcb "MTV878" (CARD=75)
1169 b) Pixelview Rev. 4\_
1170
1171- MTV878R w/Remote Control
1172- MTV878F w/Remote Control w/FM radio
1173
1174Pinnacle
1175~~~~~~~~
1176
1177PCTV models:
1178
1179- Mirovideo PCTV (Bt848)
1180- Mirovideo PCTV SE (Bt848)
1181- Mirovideo PCTV Pro (Bt848 + Daughterboard for TV Stereo and FM)
1182- Studio PCTV Rave (Bt848 Version = Mirovideo PCTV)
1183- Studio PCTV Rave (Bt878 package w/o infrared)
1184- Studio PCTV (Bt878)
1185- Studio PCTV Pro (Bt878 stereo w/ FM)
1186- Pinnacle PCTV (Bt878, MT2032)
1187- Pinnacle PCTV Pro (Bt878, MT2032)
1188- Pinncale PCTV Sat (bt878a, HM1821/1221) ["Conexant CX24110 with CX24108 tuner, aka HM1221/HM1811"]
1189- Pinnacle PCTV Sat XE
1190
1191M(J)PEG capture and playback models:
1192
1193- DC1+ (ISA)
1194- DC10 (zr36057, zr36060, saa7110, adv7176)
1195- DC10+ (zr36067, zr36060, saa7110, adv7176)
1196- DC20 (ql16x24b,zr36050, zr36016, saa7110, saa7187 ...)
1197- DC30 (zr36057, zr36050, zr36016, vpx3220, adv7176, ad1843, tea6415, miro FST97A1)
1198- DC30+ (zr36067, zr36050, zr36016, vpx3220, adv7176)
1199- DC50 (zr36067, zr36050, zr36016, saa7112, adv7176 (2 pcs.?), ad1843, miro FST97A1, Lattice ???)
1200
1201Lenco
1202~~~~~
1203
1204Models:
1205
1206- MXR-9565 (=Technisat Mediafocus?)
1207- MXR-9571 (Bt848) (=CPH031?)
1208- MXR-9575
1209- MXR-9577 (Bt878) (=Prolink 878TV Rev.3x)
1210- MXTV-9578CP (Bt878) (= Prolink PV-BT878P+4E)
1211
1212Iomega
1213~~~~~~
1214
1215Buz (zr36067, zr36060, saa7111, saa7185)
1216
1217LML
1218~~~
1219 LML33 (zr36067, zr36060, bt819, bt856)
1220
1221Grandtec
1222~~~~~~~~
1223
1224Models:
1225
1226- Grand Video Capture (Bt848)
1227- Multi Capture Card (Bt878)
1228
1229Koutech
1230~~~~~~~
1231
1232Models:
1233
1234- KW-606 (Bt848)
1235- KW-607 (Bt848 capture only)
1236- KW-606RSF
1237- KW-607A (capture only)
1238- KW-608 (Zoran capture only)
1239
1240IODATA (jp)
1241~~~~~~~~~~~
1242
1243Models:
1244
1245- GV-BCTV/PCI
1246- GV-BCTV2/PCI
1247- GV-BCTV3/PCI
1248- GV-BCTV4/PCI
1249- GV-VCP/PCI (capture only)
1250- GV-VCP2/PCI (capture only)
1251
1252Canopus (jp)
1253~~~~~~~~~~~~
1254
1255WinDVR = Kworld "KW-TVL878RF"
1256
1257www.sigmacom.co.kr
1258~~~~~~~~~~~~~~~~~~
1259
1260Sigma Cyber TV II
1261
1262www.sasem.co.kr
1263~~~~~~~~~~~~~~~
1264
1265Litte OnAir TV
1266
1267hama
1268~~~~
1269
1270TV/Radio-Tuner Card, PCI (Model 44677) = CPH051
1271
1272Sigma Designs
1273~~~~~~~~~~~~~
1274
1275Hollywood plus (em8300, em9010, adv7175), (PCB "M340-10") MPEG DVD decoder
1276
1277Formac
1278~~~~~~
1279
1280Models:
1281
1282- iProTV (Card for iMac Mezzanine slot, Bt848+SCSI)
1283- ProTV (Bt848)
1284- ProTV II = ProTV Stereo (Bt878) ["stereo" means FM stereo, tv is still mono]
1285
1286ATI
1287~~~
1288
1289Models:
1290
1291- TV-Wonder
1292- TV-Wonder VE
1293
1294Diamond Multimedia
1295~~~~~~~~~~~~~~~~~~
1296
1297DTV2000 (Bt848, tda9875)
1298
1299Aopen
1300~~~~~
1301
1302- VA1000 Plus (w/ Stereo)
1303- VA1000 Lite
1304- VA1000 (=LR90)
1305
1306Intel
1307~~~~~
1308
1309Models:
1310
1311- Smart Video Recorder (ISA full-length)
1312- Smart Video Recorder pro (ISA half-length)
1313- Smart Video Recorder III (Bt848)
1314
1315STB
1316~~~
1317
1318Models:
1319
1320- STB Gateway 6000704 (bt878)
1321- STB Gateway 6000699 (bt848)
1322- STB Gateway 6000402 (bt848)
1323- STB TV130 PCI
1324
1325Videologic
1326~~~~~~~~~~
1327
1328Models:
1329
1330- Captivator Pro/TV (ISA?)
1331- Captivator PCI/VC (Bt848 bundled with camera) (capture only)
1332
1333Technotrend
1334~~~~~~~~~~~~
1335
1336Models:
1337
1338- TT-SAT PCI (PCB "Sat-PCI Rev.:1.3.1"; zr36125, vpx3225d, stc0056a, Tuner:BSKE6-155A
1339- TT-DVB-Sat
1340 - revisions 1.1, 1.3, 1.5, 1.6 and 2.1
1341 - This card is sold as OEM from:
1342
1343 - Siemens DVB-s Card
1344 - Hauppauge WinTV DVB-S
1345 - Technisat SkyStar 1 DVB
1346 - Galaxis DVB Sat
1347
1348 - Now this card is called TT-PCline Premium Family
1349 - TT-Budget (saa7146, bsru6-701a)
1350 This card is sold as OEM from:
1351
1352 - Hauppauge WinTV Nova
1353 - Satelco Standard PCI (DVB-S)
1354 - TT-DVB-C PCI
1355
1356Teles
1357~~~~~
1358
1359 DVB-s (Rev. 2.2, BSRV2-301A, data only?)
1360
1361Remote Vision
1362~~~~~~~~~~~~~
1363
1364MX RV605 (Bt848 capture only)
1365
1366Boeder
1367~~~~~~
1368
1369Models:
1370
1371- PC ChatCam (Model 68252) (Bt848 capture only)
1372- Tv/Fm Capture Card (Model 68404) = PV951
1373
1374Media-Surfer (esc-kathrein.de)
1375~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1376
1377Models:
1378
1379- Sat-Surfer (ISA)
1380- Sat-Surfer PCI = Techni-PC-Sat
1381- Cable-Surfer 1
1382- Cable-Surfer 2
1383- Cable-Surfer PCI (zr36120)
1384- Audio-Surfer (ISA Radio card)
1385
1386Jetway (www.jetway.com.tw)
1387~~~~~~~~~~~~~~~~~~~~~~~~~~
1388
1389Models:
1390
1391- JW-TV 878M
1392- JW-TV 878 = KWorld KW-TV878RF
1393
1394Galaxis
1395~~~~~~~
1396
1397Models:
1398
1399- Galaxis DVB Card S CI
1400- Galaxis DVB Card C CI
1401- Galaxis DVB Card S
1402- Galaxis DVB Card C
1403- Galaxis plug.in S [neuer Name: Galaxis DVB Card S CI
1404
1405Hauppauge
1406~~~~~~~~~
1407
1408Models:
1409
1410- many many WinTV models ...
1411- WinTV DVBs = Technotrend Premium 1.3
1412- WinTV NOVA = Technotrend Budget 1.1 "S-DVB DATA"
1413- WinTV NOVA-CI "SDVBACI"
1414- WinTV Nova USB (=Technotrend USB 1.0)
1415- WinTV-Nexus-s (=Technotrend Premium 2.1 or 2.2)
1416- WinTV PVR
1417- WinTV PVR 250
1418- WinTV PVR 450
1419
1420US models
1421
1422-990 WinTV-PVR-350 (249USD) (iTVC15 chipset + radio)
1423-980 WinTV-PVR-250 (149USD) (iTVC15 chipset)
1424-880 WinTV-PVR-PCI (199USD) (KFIR chipset + bt878)
1425-881 WinTV-PVR-USB
1426-190 WinTV-GO
1427-191 WinTV-GO-FM
1428-404 WinTV
1429-401 WinTV-radio
1430-495 WinTV-Theater
1431-602 WinTV-USB
1432-621 WinTV-USB-FM
1433-600 USB-Live
1434-698 WinTV-HD
1435-697 WinTV-D
1436-564 WinTV-Nexus-S
1437
1438Deutsche Modelle:
1439
1440-603 WinTV GO
1441-719 WinTV Primio-FM
1442-718 WinTV PCI-FM
1443-497 WinTV Theater
1444-569 WinTV USB
1445-568 WinTV USB-FM
1446-882 WinTV PVR
1447-981 WinTV PVR 250
1448-891 WinTV-PVR-USB
1449-541 WinTV Nova
1450-488 WinTV Nova-Ci
1451-564 WinTV-Nexus-s
1452-727 WinTV-DVB-c
1453-545 Common Interface
1454-898 WinTV-Nova-USB
1455
1456UK models:
1457
1458-607 WinTV Go
1459-693,793 WinTV Primio FM
1460-647,747 WinTV PCI FM
1461-498 WinTV Theater
1462-883 WinTV PVR
1463-893 WinTV PVR USB (Duplicate entry)
1464-566 WinTV USB (UK)
1465-573 WinTV USB FM
1466-429 Impact VCB (bt848)
1467-600 USB Live (Video-In 1x Comp, 1xSVHS)
1468-542 WinTV Nova
1469-717 WinTV DVB-S
1470-909 Nova-t PCI
1471-893 Nova-t USB (Duplicate entry)
1472-802 MyTV
1473-804 MyView
1474-809 MyVideo
1475-872 MyTV2Go FM
1476-546 WinTV Nova-S CI
1477-543 WinTV Nova
1478-907 Nova-S USB
1479-908 Nova-T USB
1480-717 WinTV Nexus-S
1481-157 DEC3000-s Standalone + USB
1482
1483Spain:
1484
1485-685 WinTV-Go
1486-690 WinTV-PrimioFM
1487-416 WinTV-PCI Nicam Estereo
1488-677 WinTV-PCI-FM
1489-699 WinTV-Theater
1490-683 WinTV-USB
1491-678 WinTV-USB-FM
1492-983 WinTV-PVR-250
1493-883 WinTV-PVR-PCI
1494-993 WinTV-PVR-350
1495-893 WinTV-PVR-USB
1496-728 WinTV-DVB-C PCI
1497-832 MyTV2Go
1498-869 MyTV2Go-FM
1499-805 MyVideo (USB)
1500
1501
1502Matrix-Vision
1503~~~~~~~~~~~~~
1504
1505Models:
1506
1507- MATRIX-Vision MV-Delta
1508- MATRIX-Vision MV-Delta 2
1509- MVsigma-SLC (Bt848)
1510
1511Conceptronic (.net)
1512~~~~~~~~~~~~~~~~~~~
1513
1514Models:
1515
1516- TVCON FM, TV card w/ FM = CPH05x
1517- TVCON = CPH06x
1518
1519BestData
1520~~~~~~~~
1521
1522Models:
1523
1524- HCC100 = VCC100rev1 + camera
1525- VCC100 rev1 (bt848)
1526- VCC100 rev2 (bt878)
1527
1528Gallant (www.gallantcom.com) www.minton.com.tw
1529~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1530
1531Models:
1532
1533- Intervision IV-510 (capture only bt8x8)
1534- Intervision IV-550 (bt8x8)
1535- Intervision IV-100 (zoran)
1536- Intervision IV-1000 (bt8x8)
1537
1538Asonic (www.asonic.com.cn) (website down)
1539~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1540
1541SkyEye tv 878
1542
1543Hoontech
1544~~~~~~~~
1545
1546878TV/FM
1547
1548Teppro (www.itcteppro.com.tw)
1549~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1550
1551Models:
1552
1553- ITC PCITV (Card Ver 1.0) "Teppro TV1/TVFM1 Card"
1554- ITC PCITV (Card Ver 2.0)
1555- ITC PCITV (Card Ver 3.0) = "PV-BT878P+ (REV.9D)"
1556- ITC PCITV (Card Ver 4.0)
1557- TEPPRO IV-550 (For BT848 Main Chip)
1558- ITC DSTTV (bt878, satellite)
1559- ITC VideoMaker (saa7146, StreamMachine sm2110, tvtuner) "PV-SM2210P+ (REV:1C)"
1560
1561Kworld (www.kworld.com.tw)
1562~~~~~~~~~~~~~~~~~~~~~~~~~~
1563
1564PC TV Station:
1565
1566- KWORLD KW-TV878R TV (no radio)
1567- KWORLD KW-TV878RF TV (w/ radio)
1568- KWORLD KW-TVL878RF (low profile)
1569- KWORLD KW-TV713XRF (saa7134)
1570
1571
1572 MPEG TV Station (same cards as above plus WinDVR Software MPEG en/decoder)
1573
1574- KWORLD KW-TV878R -Pro TV (no Radio)
1575- KWORLD KW-TV878RF-Pro TV (w/ Radio)
1576- KWORLD KW-TV878R -Ultra TV (no Radio)
1577- KWORLD KW-TV878RF-Ultra TV (w/ Radio)
1578
1579JTT/ Justy Corp.(http://www.jtt.ne.jp/)
1580~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1581
1582JTT-02 (JTT TV) "TV watchmate pro" (bt848)
1583
1584ADS www.adstech.com
1585~~~~~~~~~~~~~~~~~~~
1586
1587Models:
1588
1589- Channel Surfer TV ( CHX-950 )
1590- Channel Surfer TV+FM ( CHX-960FM )
1591
1592AVEC www.prochips.com
1593~~~~~~~~~~~~~~~~~~~~~
1594
1595AVEC Intercapture (bt848, tea6320)
1596
1597NoBrand
1598~~~~~~~
1599
1600TV Excel = Australian Name for "PV-BT878P+ 8E" or "878TV Rev.3\_"
1601
1602Mach www.machspeed.com
1603~~~~~~~~~~~~~~~~~~~~~~
1604
1605Mach TV 878
1606
1607Eline www.eline-net.com/
1608~~~~~~~~~~~~~~~~~~~~~~~~
1609
1610Models:
1611
1612- Eline Vision TVMaster / TVMaster FM (ELV-TVM/ ELV-TVM-FM) = LR26 (bt878)
1613- Eline Vision TVMaster-2000 (ELV-TVM-2000, ELV-TVM-2000-FM)= LR138 (saa713x)
1614
1615Spirit
1616~~~~~~
1617
1618- Spirit TV Tuner/Video Capture Card (bt848)
1619
1620Boser www.boser.com.tw
1621~~~~~~~~~~~~~~~~~~~~~~
1622
1623Models:
1624
1625- HS-878 Mini PCI Capture Add-on Card
1626- HS-879 Mini PCI 3D Audio and Capture Add-on Card (w/ ES1938 Solo-1)
1627
1628Satelco www.citycom-gmbh.de, www.satelco.de
1629~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1630
1631Models:
1632
1633- TV-FM =KNC1 saa7134
1634- Standard PCI (DVB-S) = Technotrend Budget
1635- Standard PCI (DVB-S) w/ CI
1636- Satelco Highend PCI (DVB-S) = Technotrend Premium
1637
1638
1639Sensoray www.sensoray.com
1640~~~~~~~~~~~~~~~~~~~~~~~~~
1641
1642Models:
1643
1644- Sensoray 311 (PC/104 bus)
1645- Sensoray 611 (PCI)
1646
1647CEI (Chartered Electronics Industries Pte Ltd [CEI] [FCC ID HBY])
1648~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1649
1650Models:
1651
1652- TV Tuner - HBY-33A-RAFFLES Brooktree Bt848KPF + Philips
1653- TV Tuner MG9910 - HBY33A-TVO CEI + Philips SAA7110 + OKI M548262 + ST STV8438CV
1654- Primetime TV (ISA)
1655
1656 - acquired by Singapore Technologies
1657 - now operating as Chartered Semiconductor Manufacturing
1658 - Manufacturer of video cards is listed as:
1659
1660 - Cogent Electronics Industries [CEI]
1661
1662AITech
1663~~~~~~
1664
1665Models:
1666
1667- Wavewatcher TV (ISA)
1668- AITech WaveWatcher TV-PCI = can be LR26 (Bt848) or LR50 (BT878)
1669- WaveWatcher TVR-202 TV/FM Radio Card (ISA)
1670
1671MAXRON
1672~~~~~~
1673
1674Maxron MaxTV/FM Radio (KW-TV878-FNT) = Kworld or JW-TV878-FBK
1675
1676www.ids-imaging.de
1677~~~~~~~~~~~~~~~~~~
1678
1679Models:
1680
1681- Falcon Series (capture only)
1682
1683In USA: http://www.theimagingsource.com/
1684- DFG/LC1
1685
1686www.sknet-web.co.jp
1687~~~~~~~~~~~~~~~~~~~
1688
1689SKnet Monster TV (saa7134)
1690
1691A-Max www.amaxhk.com (Colormax, Amax, Napa)
1692~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1693
1694APAC Viewcomp 878
1695
1696Cybertainment
1697~~~~~~~~~~~~~
1698
1699Models:
1700
1701- CyberMail AV Video Email Kit w/ PCI Capture Card (capture only)
1702- CyberMail Xtreme
1703
1704These are Flyvideo
1705
1706VCR (http://www.vcrinc.com/)
1707~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1708
1709Video Catcher 16
1710
1711Twinhan
1712~~~~~~~
1713
1714Models:
1715
1716- DST Card/DST-IP (bt878, twinhan asic) VP-1020
1717 - Sold as:
1718
1719 - KWorld DVBS Satellite TV-Card
1720 - Powercolor DSTV Satellite Tuner Card
1721 - Prolink Pixelview DTV2000
1722 - Provideo PV-911 Digital Satellite TV Tuner Card With Common Interface ?
1723
1724- DST-CI Card (DVB Satellite) VP-1030
1725- DCT Card (DVB cable)
1726
1727MSI
1728~~~
1729
1730Models:
1731
1732- MSI TV@nywhere Tuner Card (MS-8876) (CX23881/883) Not Bt878 compatible.
1733- MS-8401 DVB-S
1734
1735Focus www.focusinfo.com
1736~~~~~~~~~~~~~~~~~~~~~~~
1737
1738InVideo PCI (bt878)
1739
1740Sdisilk www.sdisilk.com/
1741~~~~~~~~~~~~~~~~~~~~~~~~
1742
1743Models:
1744
1745- SDI Silk 100
1746- SDI Silk 200 SDI Input Card
1747
1748www.euresys.com
1749~~~~~~~~~~~~~~~
1750
1751PICOLO series
1752
1753PMC/Pace
1754~~~~~~~~
1755
1756www.pacecom.co.uk website closed
1757
1758Mercury www.kobian.com (UK and FR)
1759~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1760
1761Models:
1762
1763- LR50
1764- LR138RBG-Rx == LR138
1765
1766TEC sound
1767~~~~~~~~~
1768
1769TV-Mate = Zoltrix VP-8482
1770
1771Though educated googling found: www.techmakers.com
1772
1773(package and manuals don't have any other manufacturer info) TecSound
1774
1775Lorenzen www.lorenzen.de
1776~~~~~~~~~~~~~~~~~~~~~~~~
1777
1778SL DVB-S PCI = Technotrend Budget PCI (su1278 or bsru version)
1779
1780Origo (.uk) www.origo2000.com
1781~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1782
1783PC TV Card = LR50
1784
1785I/O Magic www.iomagic.com
1786~~~~~~~~~~~~~~~~~~~~~~~~~
1787
1788PC PVR - Desktop TV Personal Video Recorder DR-PCTV100 = Pinnacle ROB2D-51009464 4.0 + Cyberlink PowerVCR II
1789
1790Arowana
1791~~~~~~~
1792
1793TV-Karte / Poso Power TV (?) = Zoltrix VP-8482 (?)
1794
1795iTVC15 boards
1796~~~~~~~~~~~~~
1797
1798kuroutoshikou.com ITVC15
1799yuan.com MPG160 PCI TV (Internal PCI MPEG2 encoder card plus TV-tuner)
1800
1801Asus www.asuscom.com
1802~~~~~~~~~~~~~~~~~~~~
1803
1804Models:
1805
1806- Asus TV Tuner Card 880 NTSC (low profile, cx23880)
1807- Asus TV (saa7134)
1808
1809Hoontech
1810~~~~~~~~
1811
1812http://www.hoontech.de/
1813
1814- HART Vision 848 (H-ART Vision 848)
1815- HART Vision 878 (H-Art Vision 878)
1816
1817
1818
1819Chips used at bttv devices
1820--------------------------
1821
1822- all boards:
1823
1824 - Brooktree Bt848/848A/849/878/879: video capture chip
1825
1826- Board specific
1827
1828 - Miro PCTV:
1829
1830 - Philips or Temic Tuner
1831
1832 - Hauppauge Win/TV pci (version 405):
1833
1834 - Microchip 24LC02B or Philips 8582E2Y:
1835
1836 - 256 Byte EEPROM with configuration information
1837 - I2C 0xa0-0xa1, (24LC02B also responds to 0xa2-0xaf)
1838
1839 - Philips SAA5246AGP/E: Videotext decoder chip, I2C 0x22-0x23
1840
1841 - TDA9800: sound decoder
1842
1843 - Winbond W24257AS-35: 32Kx8 CMOS static RAM (Videotext buffer mem)
1844
1845 - 14052B: analog switch for selection of sound source
1846
1847- PAL:
1848
1849 - TDA5737: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
1850 - TSA5522: 1.4 GHz I2C-bus controlled synthesizer, I2C 0xc2-0xc3
1851
1852- NTSC:
1853
1854 - TDA5731: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
1855 - TSA5518: no datasheet available on Philips site
1856
1857- STB TV pci:
1858
1859 - ???
1860 - if you want better support for STB cards send me info!
1861 Look at the board! What chips are on it?
1862
1863
1864
1865
1866Specs
1867-----
1868
1869Philips http://www.Semiconductors.COM/pip/
1870
1871Conexant http://www.conexant.com/
1872
1873Micronas http://www.micronas.com/en/home/index.html
1874
1875Thanks
1876------
1877
1878Many thanks to:
1879
1880- Markus Schroeder <schroedm@uni-duesseldorf.de> for information on the Bt848
1881 and tuner programming and his control program xtvc.
1882
1883- Martin Buck <martin-2.buck@student.uni-ulm.de> for his great Videotext
1884 package.
1885
1886- Gerd Hoffmann for the MSP3400 support and the modular
1887 I2C, tuner, ... support.
1888
1889
1890- MATRIX Vision for giving us 2 cards for free, which made support of
1891 single crystal operation possible.
1892
1893- MIRO for providing a free PCTV card and detailed information about the
1894 components on their cards. (E.g. how the tuner type is detected)
1895 Without their card I could not have debugged the NTSC mode.
1896
1897- Hauppauge for telling how the sound input is selected and what components
1898 they do and will use on their radio cards.
1899 Also many thanks for faxing me the FM1216 data sheet.
1900
1901Contributors
1902------------
1903
1904Michael Chu <mmchu@pobox.com>
1905 AverMedia fix and more flexible card recognition
1906
1907Alan Cox <alan@lxorguk.ukuu.org.uk>
1908 Video4Linux interface and 2.1.x kernel adaptation
1909
1910Chris Kleitsch
1911 Hardware I2C
1912
1913Gerd Hoffmann
1914 Radio card (ITT sound processor)
1915
1916bigfoot <bigfoot@net-way.net>
1917
1918Ragnar Hojland Espinosa <ragnar@macula.net>
1919 ConferenceTV card
1920
1921
1922+ many more (please mail me if you are missing in this list and would
1923 like to be mentioned)
diff --git a/Documentation/video4linux/cafe_ccic b/Documentation/media/v4l-drivers/cafe_ccic.rst
index 88821022a5de..b98eb3b7cb4a 100644
--- a/Documentation/video4linux/cafe_ccic
+++ b/Documentation/media/v4l-drivers/cafe_ccic.rst
@@ -1,3 +1,11 @@
1The cafe_ccic driver
2====================
3
4Author: Jonathan Corbet <corbet@lwn.net>
5
6Introdution
7-----------
8
1"cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera 9"cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera
2controller. This is the controller found in first-generation OLPC systems, 10controller. This is the controller found in first-generation OLPC systems,
3and this driver was written with support from the OLPC project. 11and this driver was written with support from the OLPC project.
@@ -10,11 +18,16 @@ sensor is known to work with this controller at this time.
10 18
11To try it out: either of these commands will work: 19To try it out: either of these commands will work:
12 20
13 mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound 21.. code-block:: none
14 mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound 22
23 $ mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound
24 $ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound
15 25
16The "xawtv" utility also works; gqcam does not, for unknown reasons. 26The "xawtv" utility also works; gqcam does not, for unknown reasons.
17 27
28Load time options
29-----------------
30
18There are a few load-time options, most of which can be changed after 31There are a few load-time options, most of which can be changed after
19loading via sysfs as well: 32loading via sysfs as well:
20 33
@@ -45,10 +58,3 @@ loading via sysfs as well:
45 - flip: If this boolean parameter is set, the sensor will be instructed to 58 - flip: If this boolean parameter is set, the sensor will be instructed to
46 invert the video image. Whether it makes sense is determined by how 59 invert the video image. Whether it makes sense is determined by how
47 your particular camera is mounted. 60 your particular camera is mounted.
48
49Work is ongoing with this driver, stay tuned.
50
51jon
52
53Jonathan Corbet
54corbet@lwn.net
diff --git a/Documentation/media/v4l-drivers/cardlist.rst b/Documentation/media/v4l-drivers/cardlist.rst
new file mode 100644
index 000000000000..8a0728d20684
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cardlist.rst
@@ -0,0 +1,18 @@
1Cards List
2==========
3
4.. toctree::
5 :maxdepth: 1
6
7 au0828-cardlist
8 bttv-cardlist
9 cx23885-cardlist
10 cx88-cardlist
11 em28xx-cardlist
12 ivtv-cardlist
13 saa7134-cardlist
14 saa7164-cardlist
15 tm6000-cardlist
16 tuner-cardlist
17 usbvision-cardlist
18 gspca-cardlist
diff --git a/Documentation/media/v4l-drivers/cpia2.rst b/Documentation/media/v4l-drivers/cpia2.rst
new file mode 100644
index 000000000000..763705c1f50f
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cpia2.rst
@@ -0,0 +1,190 @@
1The cpia2 driver
2================
3
4Authors: Peter Pregler <Peter_Pregler@email.com>,
5Scott J. Bertin <scottbertin@yahoo.com>, and
6Jarl Totland <Jarl.Totland@bdc.no> for the original cpia driver, which
7this one was modelled from.
8
9Introduction
10------------
11
12This is a driver for STMicroelectronics's CPiA2 (second generation
13Colour Processor Interface ASIC) based cameras. This camera outputs an MJPEG
14stream at up to vga size. It implements the Video4Linux interface as much as
15possible. Since the V4L interface does not support compressed formats, only
16an mjpeg enabled application can be used with the camera. We have modified the
17gqcam application to view this stream.
18
19The driver is implemented as two kernel modules. The cpia2 module
20contains the camera functions and the V4L interface. The cpia2_usb module
21contains usb specific functions. The main reason for this was the size of the
22module was getting out of hand, so I separated them. It is not likely that
23there will be a parallel port version.
24
25Features
26--------
27
28- Supports cameras with the Vision stv6410 (CIF) and stv6500 (VGA) cmos
29 sensors. I only have the vga sensor, so can't test the other.
30- Image formats: VGA, QVGA, CIF, QCIF, and a number of sizes in between.
31 VGA and QVGA are the native image sizes for the VGA camera. CIF is done
32 in the coprocessor by scaling QVGA. All other sizes are done by clipping.
33- Palette: YCrCb, compressed with MJPEG.
34- Some compression parameters are settable.
35- Sensor framerate is adjustable (up to 30 fps CIF, 15 fps VGA).
36- Adjust brightness, color, contrast while streaming.
37- Flicker control settable for 50 or 60 Hz mains frequency.
38
39Making and installing the stv672 driver modules
40-----------------------------------------------
41
42Requirements
43~~~~~~~~~~~~
44
45Video4Linux must be either compiled into the kernel or
46available as a module. Video4Linux2 is automatically detected and made
47available at compile time.
48
49Setup
50~~~~~
51
52Use 'modprobe cpia2' to load and 'modprobe -r cpia2' to unload. This
53may be done automatically by your distribution.
54
55Driver options
56~~~~~~~~~~~~~~
57
58============== ========================================================
59Option Description
60============== ========================================================
61video_nr video device to register (0=/dev/video0, etc)
62 range -1 to 64. default is -1 (first available)
63 If you have more than 1 camera, this MUST be -1.
64buffer_size Size for each frame buffer in bytes (default 68k)
65num_buffers Number of frame buffers (1-32, default 3)
66alternate USB Alternate (2-7, default 7)
67flicker_freq Frequency for flicker reduction(50 or 60, default 60)
68flicker_mode 0 to disable, or 1 to enable flicker reduction.
69 (default 0). This is only effective if the camera
70 uses a stv0672 coprocessor.
71============== ========================================================
72
73Setting the options
74~~~~~~~~~~~~~~~~~~~
75
76If you are using modules, edit /etc/modules.conf and add an options
77line like this:
78
79.. code-block:: none
80
81 options cpia2 num_buffers=3 buffer_size=65535
82
83If the driver is compiled into the kernel, at boot time specify them
84like this:
85
86.. code-block:: none
87
88 cpia2.num_buffers=3 cpia2.buffer_size=65535
89
90What buffer size should I use?
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93The maximum image size depends on the alternate you choose, and the
94frame rate achieved by the camera. If the compression engine is able to
95keep up with the frame rate, the maximum image size is given by the table
96below.
97
98The compression engine starts out at maximum compression, and will
99increase image quality until it is close to the size in the table. As long
100as the compression engine can keep up with the frame rate, after a short time
101the images will all be about the size in the table, regardless of resolution.
102
103At low alternate settings, the compression engine may not be able to
104compress the image enough and will reduce the frame rate by producing larger
105images.
106
107The default of 68k should be good for most users. This will handle
108any alternate at frame rates down to 15fps. For lower frame rates, it may
109be necessary to increase the buffer size to avoid having frames dropped due
110to insufficient space.
111
112========== ========== ======== =====
113Alternate bytes/ms 15fps 30fps
114========== ========== ======== =====
115 2 128 8533 4267
116 3 384 25600 12800
117 4 640 42667 21333
118 5 768 51200 25600
119 6 896 59733 29867
120 7 1023 68200 34100
121========== ========== ======== =====
122
123Table: Image size(bytes)
124
125
126How many buffers should I use?
127~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128
129For normal streaming, 3 should give the best results. With only 2,
130it is possible for the camera to finish sending one image just after a
131program has started reading the other. If this happens, the driver must drop
132a frame. The exception to this is if you have a heavily loaded machine. In
133this case use 2 buffers. You are probably not reading at the full frame rate.
134If the camera can send multiple images before a read finishes, it could
135overwrite the third buffer before the read finishes, leading to a corrupt
136image. Single and double buffering have extra checks to avoid overwriting.
137
138Using the camera
139~~~~~~~~~~~~~~~~
140
141We are providing a modified gqcam application to view the output. In
142order to avoid confusion, here it is called mview. There is also the qx5view
143program which can also control the lights on the qx5 microscope. MJPEG Tools
144(http://mjpeg.sourceforge.net) can also be used to record from the camera.
145
146Notes to developers
147~~~~~~~~~~~~~~~~~~~
148
149 - This is a driver version stripped of the 2.4 back compatibility
150 and old MJPEG ioctl API. See cpia2.sf.net for 2.4 support.
151
152Programmer's overview of cpia2 driver
153~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
155Cpia2 is the second generation video coprocessor from VLSI Vision Ltd (now a
156division of ST Microelectronics). There are two versions. The first is the
157STV0672, which is capable of up to 30 frames per second (fps) in frame sizes
158up to CIF, and 15 fps for VGA frames. The STV0676 is an improved version,
159which can handle up to 30 fps VGA. Both coprocessors can be attached to two
160CMOS sensors - the vvl6410 CIF sensor and the vvl6500 VGA sensor. These will
161be referred to as the 410 and the 500 sensors, or the CIF and VGA sensors.
162
163The two chipsets operate almost identically. The core is an 8051 processor,
164running two different versions of firmware. The 672 runs the VP4 video
165processor code, the 676 runs VP5. There are a few differences in register
166mappings for the two chips. In these cases, the symbols defined in the
167header files are marked with VP4 or VP5 as part of the symbol name.
168
169The cameras appear externally as three sets of registers. Setting register
170values is the only way to control the camera. Some settings are
171interdependant, such as the sequence required to power up the camera. I will
172try to make note of all of these cases.
173
174The register sets are called blocks. Block 0 is the system block. This
175section is always powered on when the camera is plugged in. It contains
176registers that control housekeeping functions such as powering up the video
177processor. The video processor is the VP block. These registers control
178how the video from the sensor is processed. Examples are timing registers,
179user mode (vga, qvga), scaling, cropping, framerates, and so on. The last
180block is the video compressor (VC). The video stream sent from the camera is
181compressed as Motion JPEG (JPEGA). The VC controls all of the compression
182parameters. Looking at the file cpia2_registers.h, you can get a full view
183of these registers and the possible values for most of them.
184
185One or more registers can be set or read by sending a usb control message to
186the camera. There are three modes for this. Block mode requests a number
187of contiguous registers. Random mode reads or writes random registers with
188a tuple structure containing address/value pairs. The repeat mode is only
189used by VP4 to load a firmware patch. It contains a starting address and
190a sequence of bytes to be written into a gpio port.
diff --git a/Documentation/video4linux/cx18.txt b/Documentation/media/v4l-drivers/cx18.rst
index 4652c0f5da32..afa03f65b01c 100644
--- a/Documentation/video4linux/cx18.txt
+++ b/Documentation/media/v4l-drivers/cx18.rst
@@ -1,3 +1,10 @@
1The cx18 driver
2===============
3
4.. note::
5
6 This documentation is outdated.
7
1Some notes regarding the cx18 driver for the Conexant CX23418 MPEG 8Some notes regarding the cx18 driver for the Conexant CX23418 MPEG
2encoder chip: 9encoder chip:
3 10
diff --git a/Documentation/media/v4l-drivers/cx2341x.rst b/Documentation/media/v4l-drivers/cx2341x.rst
new file mode 100644
index 000000000000..e06d07ebdecd
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cx2341x.rst
@@ -0,0 +1,3858 @@
1The cx2341x driver
2==================
3
4Memory at cx2341x chips
5-----------------------
6
7This section describes the cx2341x memory map and documents some of the
8register space.
9
10.. note:: the memory long words are little-endian ('intel format').
11
12.. warning::
13
14 This information was figured out from searching through the memory
15 and registers, this information may not be correct and is certainly
16 not complete, and was not derived from anything more than searching
17 through the memory space with commands like:
18
19 .. code-block:: none
20
21 ivtvctl -O min=0x02000000,max=0x020000ff
22
23 So take this as is, I'm always searching for more stuff, it's a large
24 register space :-).
25
26Memory Map
27~~~~~~~~~~
28
29The cx2341x exposes its entire 64M memory space to the PCI host via the PCI BAR0
30(Base Address Register 0). The addresses here are offsets relative to the
31address held in BAR0.
32
33.. code-block:: none
34
35 0x00000000-0x00ffffff Encoder memory space
36 0x00000000-0x0003ffff Encode.rom
37 ???-??? MPEG buffer(s)
38 ???-??? Raw video capture buffer(s)
39 ???-??? Raw audio capture buffer(s)
40 ???-??? Display buffers (6 or 9)
41
42 0x01000000-0x01ffffff Decoder memory space
43 0x01000000-0x0103ffff Decode.rom
44 ???-??? MPEG buffers(s)
45 0x0114b000-0x0115afff Audio.rom (deprecated?)
46
47 0x02000000-0x0200ffff Register Space
48
49Registers
50~~~~~~~~~
51
52The registers occupy the 64k space starting at the 0x02000000 offset from BAR0.
53All of these registers are 32 bits wide.
54
55.. code-block:: none
56
57 DMA Registers 0x000-0xff:
58
59 0x00 - Control:
60 0=reset/cancel, 1=read, 2=write, 4=stop
61 0x04 - DMA status:
62 1=read busy, 2=write busy, 4=read error, 8=write error, 16=link list error
63 0x08 - pci DMA pointer for read link list
64 0x0c - pci DMA pointer for write link list
65 0x10 - read/write DMA enable:
66 1=read enable, 2=write enable
67 0x14 - always 0xffffffff, if set any lower instability occurs, 0x00 crashes
68 0x18 - ??
69 0x1c - always 0x20 or 32, smaller values slow down DMA transactions
70 0x20 - always value of 0x780a010a
71 0x24-0x3c - usually just random values???
72 0x40 - Interrupt status
73 0x44 - Write a bit here and shows up in Interrupt status 0x40
74 0x48 - Interrupt Mask
75 0x4C - always value of 0xfffdffff,
76 if changed to 0xffffffff DMA write interrupts break.
77 0x50 - always 0xffffffff
78 0x54 - always 0xffffffff (0x4c, 0x50, 0x54 seem like interrupt masks, are
79 3 processors on chip, Java ones, VPU, SPU, APU, maybe these are the
80 interrupt masks???).
81 0x60-0x7C - random values
82 0x80 - first write linked list reg, for Encoder Memory addr
83 0x84 - first write linked list reg, for pci memory addr
84 0x88 - first write linked list reg, for length of buffer in memory addr
85 (|0x80000000 or this for last link)
86 0x8c-0xdc - rest of write linked list reg, 8 sets of 3 total, DMA goes here
87 from linked list addr in reg 0x0c, firmware must push through or
88 something.
89 0xe0 - first (and only) read linked list reg, for pci memory addr
90 0xe4 - first (and only) read linked list reg, for Decoder memory addr
91 0xe8 - first (and only) read linked list reg, for length of buffer
92 0xec-0xff - Nothing seems to be in these registers, 0xec-f4 are 0x00000000.
93
94Memory locations for Encoder Buffers 0x700-0x7ff:
95
96These registers show offsets of memory locations pertaining to each
97buffer area used for encoding, have to shift them by <<1 first.
98
99- 0x07F8: Encoder SDRAM refresh
100- 0x07FC: Encoder SDRAM pre-charge
101
102Memory locations for Decoder Buffers 0x800-0x8ff:
103
104These registers show offsets of memory locations pertaining to each
105buffer area used for decoding, have to shift them by <<1 first.
106
107- 0x08F8: Decoder SDRAM refresh
108- 0x08FC: Decoder SDRAM pre-charge
109
110Other memory locations:
111
112- 0x2800: Video Display Module control
113- 0x2D00: AO (audio output?) control
114- 0x2D24: Bytes Flushed
115- 0x7000: LSB I2C write clock bit (inverted)
116- 0x7004: LSB I2C write data bit (inverted)
117- 0x7008: LSB I2C read clock bit
118- 0x700c: LSB I2C read data bit
119- 0x9008: GPIO get input state
120- 0x900c: GPIO set output state
121- 0x9020: GPIO direction (Bit7 (GPIO 0..7) - 0:input, 1:output)
122- 0x9050: SPU control
123- 0x9054: Reset HW blocks
124- 0x9058: VPU control
125- 0xA018: Bit6: interrupt pending?
126- 0xA064: APU command
127
128
129Interrupt Status Register
130~~~~~~~~~~~~~~~~~~~~~~~~~
131
132The definition of the bits in the interrupt status register 0x0040, and the
133interrupt mask 0x0048. If a bit is cleared in the mask, then we want our ISR to
134execute.
135
136- bit 31 Encoder Start Capture
137- bit 30 Encoder EOS
138- bit 29 Encoder VBI capture
139- bit 28 Encoder Video Input Module reset event
140- bit 27 Encoder DMA complete
141- bit 24 Decoder audio mode change detection event (through event notification)
142- bit 22 Decoder data request
143- bit 20 Decoder DMA complete
144- bit 19 Decoder VBI re-insertion
145- bit 18 Decoder DMA err (linked-list bad)
146
147Missing documentation
148---------------------
149
150- Encoder API post(?)
151- Decoder API post(?)
152- Decoder VTRACE event
153
154
155The cx2341x firmware upload
156---------------------------
157
158This document describes how to upload the cx2341x firmware to the card.
159
160How to find
161~~~~~~~~~~~
162
163See the web pages of the various projects that uses this chip for information
164on how to obtain the firmware.
165
166The firmware stored in a Windows driver can be detected as follows:
167
168- Each firmware image is 256k bytes.
169- The 1st 32-bit word of the Encoder image is 0x0000da7
170- The 1st 32-bit word of the Decoder image is 0x00003a7
171- The 2nd 32-bit word of both images is 0xaa55bb66
172
173How to load
174~~~~~~~~~~~
175
176- Issue the FWapi command to stop the encoder if it is running. Wait for the
177 command to complete.
178- Issue the FWapi command to stop the decoder if it is running. Wait for the
179 command to complete.
180- Issue the I2C command to the digitizer to stop emitting VSYNC events.
181- Issue the FWapi command to halt the encoder's firmware.
182- Sleep for 10ms.
183- Issue the FWapi command to halt the decoder's firmware.
184- Sleep for 10ms.
185- Write 0x00000000 to register 0x2800 to stop the Video Display Module.
186- Write 0x00000005 to register 0x2D00 to stop the AO (audio output?).
187- Write 0x00000000 to register 0xA064 to ping? the APU.
188- Write 0xFFFFFFFE to register 0x9058 to stop the VPU.
189- Write 0xFFFFFFFF to register 0x9054 to reset the HW blocks.
190- Write 0x00000001 to register 0x9050 to stop the SPU.
191- Sleep for 10ms.
192- Write 0x0000001A to register 0x07FC to init the Encoder SDRAM's pre-charge.
193- Write 0x80000640 to register 0x07F8 to init the Encoder SDRAM's refresh to 1us.
194- Write 0x0000001A to register 0x08FC to init the Decoder SDRAM's pre-charge.
195- Write 0x80000640 to register 0x08F8 to init the Decoder SDRAM's refresh to 1us.
196- Sleep for 512ms. (600ms is recommended)
197- Transfer the encoder's firmware image to offset 0 in Encoder memory space.
198- Transfer the decoder's firmware image to offset 0 in Decoder memory space.
199- Use a read-modify-write operation to Clear bit 0 of register 0x9050 to
200 re-enable the SPU.
201- Sleep for 1 second.
202- Use a read-modify-write operation to Clear bits 3 and 0 of register 0x9058
203 to re-enable the VPU.
204- Sleep for 1 second.
205- Issue status API commands to both firmware images to verify.
206
207
208How to call the firmware API
209----------------------------
210
211The preferred calling convention is known as the firmware mailbox. The
212mailboxes are basically a fixed length array that serves as the call-stack.
213
214Firmware mailboxes can be located by searching the encoder and decoder memory
215for a 16 byte signature. That signature will be located on a 256-byte boundary.
216
217Signature:
218
219.. code-block:: none
220
221 0x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34,
222 0x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78
223
224The firmware implements 20 mailboxes of 20 32-bit words. The first 10 are
225reserved for API calls. The second 10 are used by the firmware for event
226notification.
227
228 ====== =================
229 Index Name
230 ====== =================
231 0 Flags
232 1 Command
233 2 Return value
234 3 Timeout
235 4-19 Parameter/Result
236 ====== =================
237
238
239The flags are defined in the following table. The direction is from the
240perspective of the firmware.
241
242 ==== ========== ============================================
243 Bit Direction Purpose
244 ==== ========== ============================================
245 2 O Firmware has processed the command.
246 1 I Driver has finished setting the parameters.
247 0 I Driver is using this mailbox.
248 ==== ========== ============================================
249
250The command is a 32-bit enumerator. The API specifics may be found in this
251chapter.
252
253The return value is a 32-bit enumerator. Only two values are currently defined:
254
255- 0=success
256- -1=command undefined.
257
258There are 16 parameters/results 32-bit fields. The driver populates these fields
259with values for all the parameters required by the call. The driver overwrites
260these fields with result values returned by the call.
261
262The timeout value protects the card from a hung driver thread. If the driver
263doesn't handle the completed call within the timeout specified, the firmware
264will reset that mailbox.
265
266To make an API call, the driver iterates over each mailbox looking for the
267first one available (bit 0 has been cleared). The driver sets that bit, fills
268in the command enumerator, the timeout value and any required parameters. The
269driver then sets the parameter ready bit (bit 1). The firmware scans the
270mailboxes for pending commands, processes them, sets the result code, populates
271the result value array with that call's return values and sets the call
272complete bit (bit 2). Once bit 2 is set, the driver should retrieve the results
273and clear all the flags. If the driver does not perform this task within the
274time set in the timeout register, the firmware will reset that mailbox.
275
276Event notifications are sent from the firmware to the host. The host tells the
277firmware which events it is interested in via an API call. That call tells the
278firmware which notification mailbox to use. The firmware signals the host via
279an interrupt. Only the 16 Results fields are used, the Flags, Command, Return
280value and Timeout words are not used.
281
282
283OSD firmware API description
284----------------------------
285
286.. note:: this API is part of the decoder firmware, so it's cx23415 only.
287
288
289
290CX2341X_OSD_GET_FRAMEBUFFER
291~~~~~~~~~~~~~~~~~~~~~~~~~~~
292
293Enum: 65/0x41
294
295Description
296^^^^^^^^^^^
297
298Return base and length of contiguous OSD memory.
299
300Result[0]
301^^^^^^^^^
302
303OSD base address
304
305Result[1]
306^^^^^^^^^
307
308OSD length
309
310
311
312CX2341X_OSD_GET_PIXEL_FORMAT
313~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314
315Enum: 66/0x42
316
317Description
318^^^^^^^^^^^
319
320Query OSD format
321
322Result[0]
323^^^^^^^^^
324
3250=8bit index
3261=16bit RGB 5:6:5
3272=16bit ARGB 1:5:5:5
3283=16bit ARGB 1:4:4:4
3294=32bit ARGB 8:8:8:8
330
331
332
333CX2341X_OSD_SET_PIXEL_FORMAT
334~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335
336Enum: 67/0x43
337
338Description
339^^^^^^^^^^^
340
341Assign pixel format
342
343Param[0]
344^^^^^^^^
345
346- 0=8bit index
347- 1=16bit RGB 5:6:5
348- 2=16bit ARGB 1:5:5:5
349- 3=16bit ARGB 1:4:4:4
350- 4=32bit ARGB 8:8:8:8
351
352
353
354CX2341X_OSD_GET_STATE
355~~~~~~~~~~~~~~~~~~~~~
356
357Enum: 68/0x44
358
359Description
360^^^^^^^^^^^
361
362Query OSD state
363
364Result[0]
365^^^^^^^^^
366
367- Bit 0 0=off, 1=on
368- Bits 1:2 alpha control
369- Bits 3:5 pixel format
370
371
372
373CX2341X_OSD_SET_STATE
374~~~~~~~~~~~~~~~~~~~~~
375
376Enum: 69/0x45
377
378Description
379^^^^^^^^^^^
380
381OSD switch
382
383Param[0]
384^^^^^^^^
385
3860=off, 1=on
387
388
389
390CX2341X_OSD_GET_OSD_COORDS
391~~~~~~~~~~~~~~~~~~~~~~~~~~
392
393Enum: 70/0x46
394
395Description
396^^^^^^^^^^^
397
398Retrieve coordinates of OSD area blended with video
399
400Result[0]
401^^^^^^^^^
402
403OSD buffer address
404
405Result[1]
406^^^^^^^^^
407
408Stride in pixels
409
410Result[2]
411^^^^^^^^^
412
413Lines in OSD buffer
414
415Result[3]
416^^^^^^^^^
417
418Horizontal offset in buffer
419
420Result[4]
421^^^^^^^^^
422
423Vertical offset in buffer
424
425
426
427CX2341X_OSD_SET_OSD_COORDS
428~~~~~~~~~~~~~~~~~~~~~~~~~~
429
430Enum: 71/0x47
431
432Description
433^^^^^^^^^^^
434
435Assign the coordinates of the OSD area to blend with video
436
437Param[0]
438^^^^^^^^
439
440buffer address
441
442Param[1]
443^^^^^^^^
444
445buffer stride in pixels
446
447Param[2]
448^^^^^^^^
449
450lines in buffer
451
452Param[3]
453^^^^^^^^
454
455horizontal offset
456
457Param[4]
458^^^^^^^^
459
460vertical offset
461
462
463
464CX2341X_OSD_GET_SCREEN_COORDS
465~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466
467Enum: 72/0x48
468
469Description
470^^^^^^^^^^^
471
472Retrieve OSD screen area coordinates
473
474Result[0]
475^^^^^^^^^
476
477top left horizontal offset
478
479Result[1]
480^^^^^^^^^
481
482top left vertical offset
483
484Result[2]
485^^^^^^^^^
486
487bottom right horizontal offset
488
489Result[3]
490^^^^^^^^^
491
492bottom right vertical offset
493
494
495
496CX2341X_OSD_SET_SCREEN_COORDS
497~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
498
499Enum: 73/0x49
500
501Description
502^^^^^^^^^^^
503
504Assign the coordinates of the screen area to blend with video
505
506Param[0]
507^^^^^^^^
508
509top left horizontal offset
510
511Param[1]
512^^^^^^^^
513
514top left vertical offset
515
516Param[2]
517^^^^^^^^
518
519bottom left horizontal offset
520
521Param[3]
522^^^^^^^^
523
524bottom left vertical offset
525
526
527
528CX2341X_OSD_GET_GLOBAL_ALPHA
529~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530
531Enum: 74/0x4A
532
533Description
534^^^^^^^^^^^
535
536Retrieve OSD global alpha
537
538Result[0]
539^^^^^^^^^
540
541global alpha: 0=off, 1=on
542
543Result[1]
544^^^^^^^^^
545
546bits 0:7 global alpha
547
548
549
550CX2341X_OSD_SET_GLOBAL_ALPHA
551~~~~~~~~~~~~~~~~~~~~~~~~~~~~
552
553Enum: 75/0x4B
554
555Description
556^^^^^^^^^^^
557
558Update global alpha
559
560Param[0]
561^^^^^^^^
562
563global alpha: 0=off, 1=on
564
565Param[1]
566^^^^^^^^
567
568global alpha (8 bits)
569
570Param[2]
571^^^^^^^^
572
573local alpha: 0=on, 1=off
574
575
576
577CX2341X_OSD_SET_BLEND_COORDS
578~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579
580Enum: 78/0x4C
581
582Description
583^^^^^^^^^^^
584
585Move start of blending area within display buffer
586
587Param[0]
588^^^^^^^^
589
590horizontal offset in buffer
591
592Param[1]
593^^^^^^^^
594
595vertical offset in buffer
596
597
598
599CX2341X_OSD_GET_FLICKER_STATE
600~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
601
602Enum: 79/0x4F
603
604Description
605^^^^^^^^^^^
606
607Retrieve flicker reduction module state
608
609Result[0]
610^^^^^^^^^
611
612flicker state: 0=off, 1=on
613
614
615
616CX2341X_OSD_SET_FLICKER_STATE
617~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
618
619Enum: 80/0x50
620
621Description
622^^^^^^^^^^^
623
624Set flicker reduction module state
625
626Param[0]
627^^^^^^^^
628
629State: 0=off, 1=on
630
631
632
633CX2341X_OSD_BLT_COPY
634~~~~~~~~~~~~~~~~~~~~
635
636Enum: 82/0x52
637
638Description
639^^^^^^^^^^^
640
641BLT copy
642
643Param[0]
644^^^^^^^^
645
646.. code-block:: none
647
648 '0000' zero
649 '0001' ~destination AND ~source
650 '0010' ~destination AND source
651 '0011' ~destination
652 '0100' destination AND ~source
653 '0101' ~source
654 '0110' destination XOR source
655 '0111' ~destination OR ~source
656 '1000' ~destination AND ~source
657 '1001' destination XNOR source
658 '1010' source
659 '1011' ~destination OR source
660 '1100' destination
661 '1101' destination OR ~source
662 '1110' destination OR source
663 '1111' one
664
665
666Param[1]
667^^^^^^^^
668
669Resulting alpha blending
670
671- '01' source_alpha
672- '10' destination_alpha
673- '11' source_alpha*destination_alpha+1
674 (zero if both source and destination alpha are zero)
675
676Param[2]
677^^^^^^^^
678
679.. code-block:: none
680
681 '00' output_pixel = source_pixel
682
683 '01' if source_alpha=0:
684 output_pixel = destination_pixel
685 if 256 > source_alpha > 1:
686 output_pixel = ((source_alpha + 1)*source_pixel +
687 (255 - source_alpha)*destination_pixel)/256
688
689 '10' if destination_alpha=0:
690 output_pixel = source_pixel
691 if 255 > destination_alpha > 0:
692 output_pixel = ((255 - destination_alpha)*source_pixel +
693 (destination_alpha + 1)*destination_pixel)/256
694
695 '11' if source_alpha=0:
696 source_temp = 0
697 if source_alpha=255:
698 source_temp = source_pixel*256
699 if 255 > source_alpha > 0:
700 source_temp = source_pixel*(source_alpha + 1)
701 if destination_alpha=0:
702 destination_temp = 0
703 if destination_alpha=255:
704 destination_temp = destination_pixel*256
705 if 255 > destination_alpha > 0:
706 destination_temp = destination_pixel*(destination_alpha + 1)
707 output_pixel = (source_temp + destination_temp)/256
708
709Param[3]
710^^^^^^^^
711
712width
713
714Param[4]
715^^^^^^^^
716
717height
718
719Param[5]
720^^^^^^^^
721
722destination pixel mask
723
724Param[6]
725^^^^^^^^
726
727destination rectangle start address
728
729Param[7]
730^^^^^^^^
731
732destination stride in dwords
733
734Param[8]
735^^^^^^^^
736
737source stride in dwords
738
739Param[9]
740^^^^^^^^
741
742source rectangle start address
743
744
745
746CX2341X_OSD_BLT_FILL
747~~~~~~~~~~~~~~~~~~~~
748
749Enum: 83/0x53
750
751Description
752^^^^^^^^^^^
753
754BLT fill color
755
756Param[0]
757^^^^^^^^
758
759Same as Param[0] on API 0x52
760
761Param[1]
762^^^^^^^^
763
764Same as Param[1] on API 0x52
765
766Param[2]
767^^^^^^^^
768
769Same as Param[2] on API 0x52
770
771Param[3]
772^^^^^^^^
773
774width
775
776Param[4]
777^^^^^^^^
778
779height
780
781Param[5]
782^^^^^^^^
783
784destination pixel mask
785
786Param[6]
787^^^^^^^^
788
789destination rectangle start address
790
791Param[7]
792^^^^^^^^
793
794destination stride in dwords
795
796Param[8]
797^^^^^^^^
798
799color fill value
800
801
802
803CX2341X_OSD_BLT_TEXT
804~~~~~~~~~~~~~~~~~~~~
805
806Enum: 84/0x54
807
808Description
809^^^^^^^^^^^
810
811BLT for 8 bit alpha text source
812
813Param[0]
814^^^^^^^^
815
816Same as Param[0] on API 0x52
817
818Param[1]
819^^^^^^^^
820
821Same as Param[1] on API 0x52
822
823Param[2]
824^^^^^^^^
825
826Same as Param[2] on API 0x52
827
828Param[3]
829^^^^^^^^
830
831width
832
833Param[4]
834^^^^^^^^
835
836height
837
838Param[5]
839^^^^^^^^
840
841destination pixel mask
842
843Param[6]
844^^^^^^^^
845
846destination rectangle start address
847
848Param[7]
849^^^^^^^^
850
851destination stride in dwords
852
853Param[8]
854^^^^^^^^
855
856source stride in dwords
857
858Param[9]
859^^^^^^^^
860
861source rectangle start address
862
863Param[10]
864^^^^^^^^^
865
866color fill value
867
868
869
870CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
871~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
872
873Enum: 86/0x56
874
875Description
876^^^^^^^^^^^
877
878Positions the main output window on the screen. The coordinates must be
879such that the entire window fits on the screen.
880
881Param[0]
882^^^^^^^^
883
884window width
885
886Param[1]
887^^^^^^^^
888
889window height
890
891Param[2]
892^^^^^^^^
893
894top left window corner horizontal offset
895
896Param[3]
897^^^^^^^^
898
899top left window corner vertical offset
900
901
902
903CX2341X_OSD_SET_CHROMA_KEY
904~~~~~~~~~~~~~~~~~~~~~~~~~~
905
906Enum: 96/0x60
907
908Description
909^^^^^^^^^^^
910
911Chroma key switch and color
912
913Param[0]
914^^^^^^^^
915
916state: 0=off, 1=on
917
918Param[1]
919^^^^^^^^
920
921color
922
923
924
925CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
926~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
927
928Enum: 97/0x61
929
930Description
931^^^^^^^^^^^
932
933Retrieve alpha content index
934
935Result[0]
936^^^^^^^^^
937
938alpha content index, Range 0:15
939
940
941
942CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
943~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
944
945Enum: 98/0x62
946
947Description
948^^^^^^^^^^^
949
950Assign alpha content index
951
952Param[0]
953^^^^^^^^
954
955alpha content index, range 0:15
956
957
958Encoder firmware API description
959--------------------------------
960
961CX2341X_ENC_PING_FW
962~~~~~~~~~~~~~~~~~~~
963
964Enum: 128/0x80
965
966Description
967^^^^^^^^^^^
968
969Does nothing. Can be used to check if the firmware is responding.
970
971
972
973CX2341X_ENC_START_CAPTURE
974~~~~~~~~~~~~~~~~~~~~~~~~~
975
976Enum: 129/0x81
977
978Description
979^^^^^^^^^^^
980
981Commences the capture of video, audio and/or VBI data. All encoding
982parameters must be initialized prior to this API call. Captures frames
983continuously or until a predefined number of frames have been captured.
984
985Param[0]
986^^^^^^^^
987
988Capture stream type:
989
990 - 0=MPEG
991 - 1=Raw
992 - 2=Raw passthrough
993 - 3=VBI
994
995
996Param[1]
997^^^^^^^^
998
999Bitmask:
1000
1001 - Bit 0 when set, captures YUV
1002 - Bit 1 when set, captures PCM audio
1003 - Bit 2 when set, captures VBI (same as param[0]=3)
1004 - Bit 3 when set, the capture destination is the decoder
1005 (same as param[0]=2)
1006 - Bit 4 when set, the capture destination is the host
1007
1008.. note:: this parameter is only meaningful for RAW capture type.
1009
1010
1011
1012CX2341X_ENC_STOP_CAPTURE
1013~~~~~~~~~~~~~~~~~~~~~~~~
1014
1015Enum: 130/0x82
1016
1017Description
1018^^^^^^^^^^^
1019
1020Ends a capture in progress
1021
1022Param[0]
1023^^^^^^^^
1024
1025- 0=stop at end of GOP (generates IRQ)
1026- 1=stop immediate (no IRQ)
1027
1028Param[1]
1029^^^^^^^^
1030
1031Stream type to stop, see param[0] of API 0x81
1032
1033Param[2]
1034^^^^^^^^
1035
1036Subtype, see param[1] of API 0x81
1037
1038
1039
1040CX2341X_ENC_SET_AUDIO_ID
1041~~~~~~~~~~~~~~~~~~~~~~~~
1042
1043Enum: 137/0x89
1044
1045Description
1046^^^^^^^^^^^
1047
1048Assigns the transport stream ID of the encoded audio stream
1049
1050Param[0]
1051^^^^^^^^
1052
1053Audio Stream ID
1054
1055
1056
1057CX2341X_ENC_SET_VIDEO_ID
1058~~~~~~~~~~~~~~~~~~~~~~~~
1059
1060Enum: 139/0x8B
1061
1062Description
1063^^^^^^^^^^^
1064
1065Set video transport stream ID
1066
1067Param[0]
1068^^^^^^^^
1069
1070Video stream ID
1071
1072
1073
1074CX2341X_ENC_SET_PCR_ID
1075~~~~~~~~~~~~~~~~~~~~~~
1076
1077Enum: 141/0x8D
1078
1079Description
1080^^^^^^^^^^^
1081
1082Assigns the transport stream ID for PCR packets
1083
1084Param[0]
1085^^^^^^^^
1086
1087PCR Stream ID
1088
1089
1090
1091CX2341X_ENC_SET_FRAME_RATE
1092~~~~~~~~~~~~~~~~~~~~~~~~~~
1093
1094Enum: 143/0x8F
1095
1096Description
1097^^^^^^^^^^^
1098
1099Set video frames per second. Change occurs at start of new GOP.
1100
1101Param[0]
1102^^^^^^^^
1103
1104- 0=30fps
1105- 1=25fps
1106
1107
1108
1109CX2341X_ENC_SET_FRAME_SIZE
1110~~~~~~~~~~~~~~~~~~~~~~~~~~
1111
1112Enum: 145/0x91
1113
1114Description
1115^^^^^^^^^^^
1116
1117Select video stream encoding resolution.
1118
1119Param[0]
1120^^^^^^^^
1121
1122Height in lines. Default 480
1123
1124Param[1]
1125^^^^^^^^
1126
1127Width in pixels. Default 720
1128
1129
1130
1131CX2341X_ENC_SET_BIT_RATE
1132~~~~~~~~~~~~~~~~~~~~~~~~
1133
1134Enum: 149/0x95
1135
1136Description
1137^^^^^^^^^^^
1138
1139Assign average video stream bitrate.
1140
1141Param[0]
1142^^^^^^^^
1143
11440=variable bitrate, 1=constant bitrate
1145
1146Param[1]
1147^^^^^^^^
1148
1149bitrate in bits per second
1150
1151Param[2]
1152^^^^^^^^
1153
1154peak bitrate in bits per second, divided by 400
1155
1156Param[3]
1157^^^^^^^^
1158
1159Mux bitrate in bits per second, divided by 400. May be 0 (default).
1160
1161Param[4]
1162^^^^^^^^
1163
1164Rate Control VBR Padding
1165
1166Param[5]
1167^^^^^^^^
1168
1169VBV Buffer used by encoder
1170
1171.. note::
1172
1173 #) Param\[3\] and Param\[4\] seem to be always 0
1174 #) Param\[5\] doesn't seem to be used.
1175
1176
1177
1178CX2341X_ENC_SET_GOP_PROPERTIES
1179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1180
1181Enum: 151/0x97
1182
1183Description
1184^^^^^^^^^^^
1185
1186Setup the GOP structure
1187
1188Param[0]
1189^^^^^^^^
1190
1191GOP size (maximum is 34)
1192
1193Param[1]
1194^^^^^^^^
1195
1196Number of B frames between the I and P frame, plus 1.
1197For example: IBBPBBPBBPBB --> GOP size: 12, number of B frames: 2+1 = 3
1198
1199.. note::
1200
1201 GOP size must be a multiple of (B-frames + 1).
1202
1203
1204
1205CX2341X_ENC_SET_ASPECT_RATIO
1206~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1207
1208Enum: 153/0x99
1209
1210Description
1211^^^^^^^^^^^
1212
1213Sets the encoding aspect ratio. Changes in the aspect ratio take effect
1214at the start of the next GOP.
1215
1216Param[0]
1217^^^^^^^^
1218
1219- '0000' forbidden
1220- '0001' 1:1 square
1221- '0010' 4:3
1222- '0011' 16:9
1223- '0100' 2.21:1
1224- '0101' to '1111' reserved
1225
1226
1227
1228CX2341X_ENC_SET_DNR_FILTER_MODE
1229~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1230
1231Enum: 155/0x9B
1232
1233Description
1234^^^^^^^^^^^
1235
1236Assign Dynamic Noise Reduction operating mode
1237
1238Param[0]
1239^^^^^^^^
1240
1241Bit0: Spatial filter, set=auto, clear=manual
1242Bit1: Temporal filter, set=auto, clear=manual
1243
1244Param[1]
1245^^^^^^^^
1246
1247Median filter:
1248
1249- 0=Disabled
1250- 1=Horizontal
1251- 2=Vertical
1252- 3=Horiz/Vert
1253- 4=Diagonal
1254
1255
1256
1257CX2341X_ENC_SET_DNR_FILTER_PROPS
1258~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1259
1260Enum: 157/0x9D
1261
1262Description
1263^^^^^^^^^^^
1264
1265These Dynamic Noise Reduction filter values are only meaningful when
1266the respective filter is set to "manual" (See API 0x9B)
1267
1268Param[0]
1269^^^^^^^^
1270
1271Spatial filter: default 0, range 0:15
1272
1273Param[1]
1274^^^^^^^^
1275
1276Temporal filter: default 0, range 0:31
1277
1278
1279
1280CX2341X_ENC_SET_CORING_LEVELS
1281~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1282
1283Enum: 159/0x9F
1284
1285Description
1286^^^^^^^^^^^
1287
1288Assign Dynamic Noise Reduction median filter properties.
1289
1290Param[0]
1291^^^^^^^^
1292
1293Threshold above which the luminance median filter is enabled.
1294Default: 0, range 0:255
1295
1296Param[1]
1297^^^^^^^^
1298
1299Threshold below which the luminance median filter is enabled.
1300Default: 255, range 0:255
1301
1302Param[2]
1303^^^^^^^^
1304
1305Threshold above which the chrominance median filter is enabled.
1306Default: 0, range 0:255
1307
1308Param[3]
1309^^^^^^^^
1310
1311Threshold below which the chrominance median filter is enabled.
1312Default: 255, range 0:255
1313
1314
1315
1316CX2341X_ENC_SET_SPATIAL_FILTER_TYPE
1317~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1318
1319Enum: 161/0xA1
1320
1321Description
1322^^^^^^^^^^^
1323
1324Assign spatial prefilter parameters
1325
1326Param[0]
1327^^^^^^^^
1328
1329Luminance filter
1330
1331- 0=Off
1332- 1=1D Horizontal
1333- 2=1D Vertical
1334- 3=2D H/V Separable (default)
1335- 4=2D Symmetric non-separable
1336
1337Param[1]
1338^^^^^^^^
1339
1340Chrominance filter
1341
1342- 0=Off
1343- 1=1D Horizontal (default)
1344
1345
1346
1347CX2341X_ENC_SET_VBI_LINE
1348~~~~~~~~~~~~~~~~~~~~~~~~
1349
1350Enum: 183/0xB7
1351
1352Description
1353^^^^^^^^^^^
1354
1355Selects VBI line number.
1356
1357Param[0]
1358^^^^^^^^
1359
1360- Bits 0:4 line number
1361- Bit 31 0=top_field, 1=bottom_field
1362- Bits 0:31 all set specifies "all lines"
1363
1364Param[1]
1365^^^^^^^^
1366
1367VBI line information features: 0=disabled, 1=enabled
1368
1369Param[2]
1370^^^^^^^^
1371
1372Slicing: 0=None, 1=Closed Caption
1373Almost certainly not implemented. Set to 0.
1374
1375Param[3]
1376^^^^^^^^
1377
1378Luminance samples in this line.
1379Almost certainly not implemented. Set to 0.
1380
1381Param[4]
1382^^^^^^^^
1383
1384Chrominance samples in this line
1385Almost certainly not implemented. Set to 0.
1386
1387
1388
1389CX2341X_ENC_SET_STREAM_TYPE
1390~~~~~~~~~~~~~~~~~~~~~~~~~~~
1391
1392Enum: 185/0xB9
1393
1394Description
1395^^^^^^^^^^^
1396
1397Assign stream type
1398
1399.. note::
1400
1401 Transport stream is not working in recent firmwares.
1402 And in older firmwares the timestamps in the TS seem to be
1403 unreliable.
1404
1405Param[0]
1406^^^^^^^^
1407
1408- 0=Program stream
1409- 1=Transport stream
1410- 2=MPEG1 stream
1411- 3=PES A/V stream
1412- 5=PES Video stream
1413- 7=PES Audio stream
1414- 10=DVD stream
1415- 11=VCD stream
1416- 12=SVCD stream
1417- 13=DVD_S1 stream
1418- 14=DVD_S2 stream
1419
1420
1421
1422CX2341X_ENC_SET_OUTPUT_PORT
1423~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424
1425Enum: 187/0xBB
1426
1427Description
1428^^^^^^^^^^^
1429
1430Assign stream output port. Normally 0 when the data is copied through
1431the PCI bus (DMA), and 1 when the data is streamed to another chip
1432(pvrusb and cx88-blackbird).
1433
1434Param[0]
1435^^^^^^^^
1436
1437- 0=Memory (default)
1438- 1=Streaming
1439- 2=Serial
1440
1441Param[1]
1442^^^^^^^^
1443
1444Unknown, but leaving this to 0 seems to work best. Indications are that
1445this might have to do with USB support, although passing anything but 0
1446only breaks things.
1447
1448
1449
1450CX2341X_ENC_SET_AUDIO_PROPERTIES
1451~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1452
1453Enum: 189/0xBD
1454
1455Description
1456^^^^^^^^^^^
1457
1458Set audio stream properties, may be called while encoding is in progress.
1459
1460.. note::
1461
1462 All bitfields are consistent with ISO11172 documentation except
1463 bits 2:3 which ISO docs define as:
1464
1465 - '11' Layer I
1466 - '10' Layer II
1467 - '01' Layer III
1468 - '00' Undefined
1469
1470 This discrepancy may indicate a possible error in the documentation.
1471 Testing indicated that only Layer II is actually working, and that
1472 the minimum bitrate should be 192 kbps.
1473
1474Param[0]
1475^^^^^^^^
1476
1477Bitmask:
1478
1479.. code-block:: none
1480
1481 0:1 '00' 44.1Khz
1482 '01' 48Khz
1483 '10' 32Khz
1484 '11' reserved
1485
1486 2:3 '01'=Layer I
1487 '10'=Layer II
1488
1489 4:7 Bitrate:
1490 Index | Layer I | Layer II
1491 ------+-------------+------------
1492 '0000' | free format | free format
1493 '0001' | 32 kbit/s | 32 kbit/s
1494 '0010' | 64 kbit/s | 48 kbit/s
1495 '0011' | 96 kbit/s | 56 kbit/s
1496 '0100' | 128 kbit/s | 64 kbit/s
1497 '0101' | 160 kbit/s | 80 kbit/s
1498 '0110' | 192 kbit/s | 96 kbit/s
1499 '0111' | 224 kbit/s | 112 kbit/s
1500 '1000' | 256 kbit/s | 128 kbit/s
1501 '1001' | 288 kbit/s | 160 kbit/s
1502 '1010' | 320 kbit/s | 192 kbit/s
1503 '1011' | 352 kbit/s | 224 kbit/s
1504 '1100' | 384 kbit/s | 256 kbit/s
1505 '1101' | 416 kbit/s | 320 kbit/s
1506 '1110' | 448 kbit/s | 384 kbit/s
1507
1508 .. note::
1509
1510 For Layer II, not all combinations of total bitrate
1511 and mode are allowed. See ISO11172-3 3-Annex B,
1512 Table 3-B.2
1513
1514 8:9 '00'=Stereo
1515 '01'=JointStereo
1516 '10'=Dual
1517 '11'=Mono
1518
1519 .. note::
1520
1521 The cx23415 cannot decode Joint Stereo properly.
1522
1523 10:11 Mode Extension used in joint_stereo mode.
1524 In Layer I and II they indicate which subbands are in
1525 intensity_stereo. All other subbands are coded in stereo.
1526 '00' subbands 4-31 in intensity_stereo, bound==4
1527 '01' subbands 8-31 in intensity_stereo, bound==8
1528 '10' subbands 12-31 in intensity_stereo, bound==12
1529 '11' subbands 16-31 in intensity_stereo, bound==16
1530
1531 12:13 Emphasis:
1532 '00' None
1533 '01' 50/15uS
1534 '10' reserved
1535 '11' CCITT J.17
1536
1537 14 CRC:
1538 '0' off
1539 '1' on
1540
1541 15 Copyright:
1542 '0' off
1543 '1' on
1544
1545 16 Generation:
1546 '0' copy
1547 '1' original
1548
1549
1550
1551CX2341X_ENC_HALT_FW
1552~~~~~~~~~~~~~~~~~~~
1553
1554Enum: 195/0xC3
1555
1556Description
1557^^^^^^^^^^^
1558
1559The firmware is halted and no further API calls are serviced until the
1560firmware is uploaded again.
1561
1562
1563
1564CX2341X_ENC_GET_VERSION
1565~~~~~~~~~~~~~~~~~~~~~~~
1566
1567Enum: 196/0xC4
1568
1569Description
1570^^^^^^^^^^^
1571
1572Returns the version of the encoder firmware.
1573
1574Result[0]
1575^^^^^^^^^
1576
1577Version bitmask:
1578- Bits 0:15 build
1579- Bits 16:23 minor
1580- Bits 24:31 major
1581
1582
1583
1584CX2341X_ENC_SET_GOP_CLOSURE
1585~~~~~~~~~~~~~~~~~~~~~~~~~~~
1586
1587Enum: 197/0xC5
1588
1589Description
1590^^^^^^^^^^^
1591
1592Assigns the GOP open/close property.
1593
1594Param[0]
1595^^^^^^^^
1596
1597- 0=Open
1598- 1=Closed
1599
1600
1601
1602CX2341X_ENC_GET_SEQ_END
1603~~~~~~~~~~~~~~~~~~~~~~~
1604
1605Enum: 198/0xC6
1606
1607Description
1608^^^^^^^^^^^
1609
1610Obtains the sequence end code of the encoder's buffer. When a capture
1611is started a number of interrupts are still generated, the last of
1612which will have Result[0] set to 1 and Result[1] will contain the size
1613of the buffer.
1614
1615Result[0]
1616^^^^^^^^^
1617
1618State of the transfer (1 if last buffer)
1619
1620Result[1]
1621^^^^^^^^^
1622
1623If Result[0] is 1, this contains the size of the last buffer, undefined
1624otherwise.
1625
1626
1627
1628CX2341X_ENC_SET_PGM_INDEX_INFO
1629~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1630
1631Enum: 199/0xC7
1632
1633Description
1634^^^^^^^^^^^
1635
1636Sets the Program Index Information.
1637The information is stored as follows:
1638
1639.. code-block:: c
1640
1641 struct info {
1642 u32 length; // Length of this frame
1643 u32 offset_low; // Offset in the file of the
1644 u32 offset_high; // start of this frame
1645 u32 mask1; // Bits 0-2 are the type mask:
1646 // 1=I, 2=P, 4=B
1647 // 0=End of Program Index, other fields
1648 // are invalid.
1649 u32 pts; // The PTS of the frame
1650 u32 mask2; // Bit 0 is bit 32 of the pts.
1651 };
1652 u32 table_ptr;
1653 struct info index[400];
1654
1655The table_ptr is the encoder memory address in the table were
1656*new* entries will be written.
1657
1658.. note:: This is a ringbuffer, so the table_ptr will wraparound.
1659
1660Param[0]
1661^^^^^^^^
1662
1663Picture Mask:
1664- 0=No index capture
1665- 1=I frames
1666- 3=I,P frames
1667- 7=I,P,B frames
1668
1669(Seems to be ignored, it always indexes I, P and B frames)
1670
1671Param[1]
1672^^^^^^^^
1673
1674Elements requested (up to 400)
1675
1676Result[0]
1677^^^^^^^^^
1678
1679Offset in the encoder memory of the start of the table.
1680
1681Result[1]
1682^^^^^^^^^
1683
1684Number of allocated elements up to a maximum of Param[1]
1685
1686
1687
1688CX2341X_ENC_SET_VBI_CONFIG
1689~~~~~~~~~~~~~~~~~~~~~~~~~~
1690
1691Enum: 200/0xC8
1692
1693Description
1694^^^^^^^^^^^
1695
1696Configure VBI settings
1697
1698Param[0]
1699^^^^^^^^
1700
1701Bitmap:
1702
1703.. code-block:: none
1704
1705 0 Mode '0' Sliced, '1' Raw
1706 1:3 Insertion:
1707 '000' insert in extension & user data
1708 '001' insert in private packets
1709 '010' separate stream and user data
1710 '111' separate stream and private data
1711 8:15 Stream ID (normally 0xBD)
1712
1713Param[1]
1714^^^^^^^^
1715
1716Frames per interrupt (max 8). Only valid in raw mode.
1717
1718Param[2]
1719^^^^^^^^
1720
1721Total raw VBI frames. Only valid in raw mode.
1722
1723Param[3]
1724^^^^^^^^
1725
1726Start codes
1727
1728Param[4]
1729^^^^^^^^
1730
1731Stop codes
1732
1733Param[5]
1734^^^^^^^^
1735
1736Lines per frame
1737
1738Param[6]
1739^^^^^^^^
1740
1741Byte per line
1742
1743Result[0]
1744^^^^^^^^^
1745
1746Observed frames per interrupt in raw mode only. Rage 1 to Param[1]
1747
1748Result[1]
1749^^^^^^^^^
1750
1751Observed number of frames in raw mode. Range 1 to Param[2]
1752
1753Result[2]
1754^^^^^^^^^
1755
1756Memory offset to start or raw VBI data
1757
1758
1759
1760CX2341X_ENC_SET_DMA_BLOCK_SIZE
1761~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1762
1763Enum: 201/0xC9
1764
1765Description
1766^^^^^^^^^^^
1767
1768Set DMA transfer block size
1769
1770Param[0]
1771^^^^^^^^
1772
1773DMA transfer block size in bytes or frames. When unit is bytes,
1774supported block sizes are 2^7, 2^8 and 2^9 bytes.
1775
1776Param[1]
1777^^^^^^^^
1778
1779Unit: 0=bytes, 1=frames
1780
1781
1782
1783CX2341X_ENC_GET_PREV_DMA_INFO_MB_10
1784~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1785
1786Enum: 202/0xCA
1787
1788Description
1789^^^^^^^^^^^
1790
1791Returns information on the previous DMA transfer in conjunction with
1792bit 27 of the interrupt mask. Uses mailbox 10.
1793
1794Result[0]
1795^^^^^^^^^
1796
1797Type of stream
1798
1799Result[1]
1800^^^^^^^^^
1801
1802Address Offset
1803
1804Result[2]
1805^^^^^^^^^
1806
1807Maximum size of transfer
1808
1809
1810
1811CX2341X_ENC_GET_PREV_DMA_INFO_MB_9
1812~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1813
1814Enum: 203/0xCB
1815
1816Description
1817^^^^^^^^^^^
1818
1819Returns information on the previous DMA transfer in conjunction with
1820bit 27 or 18 of the interrupt mask. Uses mailbox 9.
1821
1822Result[0]
1823^^^^^^^^^
1824
1825Status bits:
1826- 0 read completed
1827- 1 write completed
1828- 2 DMA read error
1829- 3 DMA write error
1830- 4 Scatter-Gather array error
1831
1832Result[1]
1833^^^^^^^^^
1834
1835DMA type
1836
1837Result[2]
1838^^^^^^^^^
1839
1840Presentation Time Stamp bits 0..31
1841
1842Result[3]
1843^^^^^^^^^
1844
1845Presentation Time Stamp bit 32
1846
1847
1848
1849CX2341X_ENC_SCHED_DMA_TO_HOST
1850~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1851
1852Enum: 204/0xCC
1853
1854Description
1855^^^^^^^^^^^
1856
1857Setup DMA to host operation
1858
1859Param[0]
1860^^^^^^^^
1861
1862Memory address of link list
1863
1864Param[1]
1865^^^^^^^^
1866
1867Length of link list (wtf: what units ???)
1868
1869Param[2]
1870^^^^^^^^
1871
1872DMA type (0=MPEG)
1873
1874
1875
1876CX2341X_ENC_INITIALIZE_INPUT
1877~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1878
1879Enum: 205/0xCD
1880
1881Description
1882^^^^^^^^^^^
1883
1884Initializes the video input
1885
1886
1887
1888CX2341X_ENC_SET_FRAME_DROP_RATE
1889~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1890
1891Enum: 208/0xD0
1892
1893Description
1894^^^^^^^^^^^
1895
1896For each frame captured, skip specified number of frames.
1897
1898Param[0]
1899^^^^^^^^
1900
1901Number of frames to skip
1902
1903
1904
1905CX2341X_ENC_PAUSE_ENCODER
1906~~~~~~~~~~~~~~~~~~~~~~~~~
1907
1908Enum: 210/0xD2
1909
1910Description
1911^^^^^^^^^^^
1912
1913During a pause condition, all frames are dropped instead of being encoded.
1914
1915Param[0]
1916^^^^^^^^
1917
1918- 0=Pause encoding
1919- 1=Continue encoding
1920
1921
1922
1923CX2341X_ENC_REFRESH_INPUT
1924~~~~~~~~~~~~~~~~~~~~~~~~~
1925
1926Enum: 211/0xD3
1927
1928Description
1929^^^^^^^^^^^
1930
1931Refreshes the video input
1932
1933
1934
1935CX2341X_ENC_SET_COPYRIGHT
1936~~~~~~~~~~~~~~~~~~~~~~~~~
1937
1938Enum: 212/0xD4
1939
1940Description
1941^^^^^^^^^^^
1942
1943Sets stream copyright property
1944
1945Param[0]
1946^^^^^^^^
1947
1948
1949- 0=Stream is not copyrighted
1950- 1=Stream is copyrighted
1951
1952
1953
1954CX2341X_ENC_SET_EVENT_NOTIFICATION
1955~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1956
1957Enum: 213/0xD5
1958
1959Description
1960^^^^^^^^^^^
1961
1962Setup firmware to notify the host about a particular event. Host must
1963unmask the interrupt bit.
1964
1965Param[0]
1966^^^^^^^^
1967
1968Event (0=refresh encoder input)
1969
1970Param[1]
1971^^^^^^^^
1972
1973Notification 0=disabled 1=enabled
1974
1975Param[2]
1976^^^^^^^^
1977
1978Interrupt bit
1979
1980Param[3]
1981^^^^^^^^
1982
1983Mailbox slot, -1 if no mailbox required.
1984
1985
1986
1987CX2341X_ENC_SET_NUM_VSYNC_LINES
1988~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1989
1990Enum: 214/0xD6
1991
1992Description
1993^^^^^^^^^^^
1994
1995Depending on the analog video decoder used, this assigns the number
1996of lines for field 1 and 2.
1997
1998Param[0]
1999^^^^^^^^
2000
2001Field 1 number of lines:
2002- 0x00EF for SAA7114
2003- 0x00F0 for SAA7115
2004- 0x0105 for Micronas
2005
2006Param[1]
2007^^^^^^^^
2008
2009Field 2 number of lines:
2010- 0x00EF for SAA7114
2011- 0x00F0 for SAA7115
2012- 0x0106 for Micronas
2013
2014
2015
2016CX2341X_ENC_SET_PLACEHOLDER
2017~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018
2019Enum: 215/0xD7
2020
2021Description
2022^^^^^^^^^^^
2023
2024Provides a mechanism of inserting custom user data in the MPEG stream.
2025
2026Param[0]
2027^^^^^^^^
2028
2029- 0=extension & user data
2030- 1=private packet with stream ID 0xBD
2031
2032Param[1]
2033^^^^^^^^
2034
2035Rate at which to insert data, in units of frames (for private packet)
2036or GOPs (for ext. & user data)
2037
2038Param[2]
2039^^^^^^^^
2040
2041Number of data DWORDs (below) to insert
2042
2043Param[3]
2044^^^^^^^^
2045
2046Custom data 0
2047
2048Param[4]
2049^^^^^^^^
2050
2051Custom data 1
2052
2053Param[5]
2054^^^^^^^^
2055
2056Custom data 2
2057
2058Param[6]
2059^^^^^^^^
2060
2061Custom data 3
2062
2063Param[7]
2064^^^^^^^^
2065
2066Custom data 4
2067
2068Param[8]
2069^^^^^^^^
2070
2071Custom data 5
2072
2073Param[9]
2074^^^^^^^^
2075
2076Custom data 6
2077
2078Param[10]
2079^^^^^^^^^
2080
2081Custom data 7
2082
2083Param[11]
2084^^^^^^^^^
2085
2086Custom data 8
2087
2088
2089
2090CX2341X_ENC_MUTE_VIDEO
2091~~~~~~~~~~~~~~~~~~~~~~
2092
2093Enum: 217/0xD9
2094
2095Description
2096^^^^^^^^^^^
2097
2098Video muting
2099
2100Param[0]
2101^^^^^^^^
2102
2103Bit usage:
2104
2105.. code-block:: none
2106
2107 0 '0'=video not muted
2108 '1'=video muted, creates frames with the YUV color defined below
2109 1:7 Unused
2110 8:15 V chrominance information
2111 16:23 U chrominance information
2112 24:31 Y luminance information
2113
2114
2115
2116CX2341X_ENC_MUTE_AUDIO
2117~~~~~~~~~~~~~~~~~~~~~~
2118
2119Enum: 218/0xDA
2120
2121Description
2122^^^^^^^^^^^
2123
2124Audio muting
2125
2126Param[0]
2127^^^^^^^^
2128
2129- 0=audio not muted
2130- 1=audio muted (produces silent mpeg audio stream)
2131
2132
2133
2134CX2341X_ENC_SET_VERT_CROP_LINE
2135~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2136
2137Enum: 219/0xDB
2138
2139Description
2140^^^^^^^^^^^
2141
2142Something to do with 'Vertical Crop Line'
2143
2144Param[0]
2145^^^^^^^^
2146
2147If saa7114 and raw VBI capture and 60 Hz, then set to 10001.
2148Else 0.
2149
2150
2151
2152CX2341X_ENC_MISC
2153~~~~~~~~~~~~~~~~
2154
2155Enum: 220/0xDC
2156
2157Description
2158^^^^^^^^^^^
2159
2160Miscellaneous actions. Not known for 100% what it does. It's really a
2161sort of ioctl call. The first parameter is a command number, the second
2162the value.
2163
2164Param[0]
2165^^^^^^^^
2166
2167Command number:
2168
2169.. code-block:: none
2170
2171 1=set initial SCR value when starting encoding (works).
2172 2=set quality mode (apparently some test setting).
2173 3=setup advanced VIM protection handling.
2174 Always 1 for the cx23416 and 0 for cx23415.
2175 4=generate DVD compatible PTS timestamps
2176 5=USB flush mode
2177 6=something to do with the quantization matrix
2178 7=set navigation pack insertion for DVD: adds 0xbf (private stream 2)
2179 packets to the MPEG. The size of these packets is 2048 bytes (including
2180 the header of 6 bytes: 0x000001bf + length). The payload is zeroed and
2181 it is up to the application to fill them in. These packets are apparently
2182 inserted every four frames.
2183 8=enable scene change detection (seems to be a failure)
2184 9=set history parameters of the video input module
2185 10=set input field order of VIM
2186 11=set quantization matrix
2187 12=reset audio interface after channel change or input switch (has no argument).
2188 Needed for the cx2584x, not needed for the mspx4xx, but it doesn't seem to
2189 do any harm calling it regardless.
2190 13=set audio volume delay
2191 14=set audio delay
2192
2193
2194Param[1]
2195^^^^^^^^
2196
2197Command value.
2198
2199Decoder firmware API description
2200--------------------------------
2201
2202.. note:: this API is part of the decoder firmware, so it's cx23415 only.
2203
2204
2205
2206CX2341X_DEC_PING_FW
2207~~~~~~~~~~~~~~~~~~~
2208
2209Enum: 0/0x00
2210
2211Description
2212^^^^^^^^^^^
2213
2214This API call does nothing. It may be used to check if the firmware
2215is responding.
2216
2217
2218
2219CX2341X_DEC_START_PLAYBACK
2220~~~~~~~~~~~~~~~~~~~~~~~~~~
2221
2222Enum: 1/0x01
2223
2224Description
2225^^^^^^^^^^^
2226
2227Begin or resume playback.
2228
2229Param[0]
2230^^^^^^^^
2231
22320 based frame number in GOP to begin playback from.
2233
2234Param[1]
2235^^^^^^^^
2236
2237Specifies the number of muted audio frames to play before normal
2238audio resumes. (This is not implemented in the firmware, leave at 0)
2239
2240
2241
2242CX2341X_DEC_STOP_PLAYBACK
2243~~~~~~~~~~~~~~~~~~~~~~~~~
2244
2245Enum: 2/0x02
2246
2247Description
2248^^^^^^^^^^^
2249
2250Ends playback and clears all decoder buffers. If PTS is not zero,
2251playback stops at specified PTS.
2252
2253Param[0]
2254^^^^^^^^
2255
2256Display 0=last frame, 1=black
2257
2258.. note::
2259
2260 this takes effect immediately, so if you want to wait for a PTS,
2261 then use '0', otherwise the screen goes to black at once.
2262 You can call this later (even if there is no playback) with a 1 value
2263 to set the screen to black.
2264
2265Param[1]
2266^^^^^^^^
2267
2268PTS low
2269
2270Param[2]
2271^^^^^^^^
2272
2273PTS high
2274
2275
2276
2277CX2341X_DEC_SET_PLAYBACK_SPEED
2278~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2279
2280Enum: 3/0x03
2281
2282Description
2283^^^^^^^^^^^
2284
2285Playback stream at speed other than normal. There are two modes of
2286operation:
2287
2288 - Smooth: host transfers entire stream and firmware drops unused
2289 frames.
2290 - Coarse: host drops frames based on indexing as required to achieve
2291 desired speed.
2292
2293Param[0]
2294^^^^^^^^
2295
2296.. code-block:: none
2297
2298 Bitmap:
2299 0:7 0 normal
2300 1 fast only "1.5 times"
2301 n nX fast, 1/nX slow
2302 30 Framedrop:
2303 '0' during 1.5 times play, every other B frame is dropped
2304 '1' during 1.5 times play, stream is unchanged (bitrate
2305 must not exceed 8mbps)
2306 31 Speed:
2307 '0' slow
2308 '1' fast
2309
2310.. note::
2311
2312 n is limited to 2. Anything higher does not result in
2313 faster playback. Instead the host should start dropping frames.
2314
2315Param[1]
2316^^^^^^^^
2317
2318Direction: 0=forward, 1=reverse
2319
2320.. note::
2321
2322 to make reverse playback work you have to write full GOPs in
2323 reverse order.
2324
2325Param[2]
2326^^^^^^^^
2327
2328.. code-block:: none
2329
2330 Picture mask:
2331 1=I frames
2332 3=I, P frames
2333 7=I, P, B frames
2334
2335Param[3]
2336^^^^^^^^
2337
2338B frames per GOP (for reverse play only)
2339
2340.. note::
2341
2342 for reverse playback the Picture Mask should be set to I or I, P.
2343 Adding B frames to the mask will result in corrupt video. This field
2344 has to be set to the correct value in order to keep the timing correct.
2345
2346Param[4]
2347^^^^^^^^
2348
2349Mute audio: 0=disable, 1=enable
2350
2351Param[5]
2352^^^^^^^^
2353
2354Display 0=frame, 1=field
2355
2356Param[6]
2357^^^^^^^^
2358
2359Specifies the number of muted audio frames to play before normal audio
2360resumes. (Not implemented in the firmware, leave at 0)
2361
2362
2363
2364CX2341X_DEC_STEP_VIDEO
2365~~~~~~~~~~~~~~~~~~~~~~
2366
2367Enum: 5/0x05
2368
2369Description
2370^^^^^^^^^^^
2371
2372Each call to this API steps the playback to the next unit defined below
2373in the current playback direction.
2374
2375Param[0]
2376^^^^^^^^
2377
23780=frame, 1=top field, 2=bottom field
2379
2380
2381
2382CX2341X_DEC_SET_DMA_BLOCK_SIZE
2383~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2384
2385Enum: 8/0x08
2386
2387Description
2388^^^^^^^^^^^
2389
2390Set DMA transfer block size. Counterpart to API 0xC9
2391
2392Param[0]
2393^^^^^^^^
2394
2395DMA transfer block size in bytes. A different size may be specified
2396when issuing the DMA transfer command.
2397
2398
2399
2400CX2341X_DEC_GET_XFER_INFO
2401~~~~~~~~~~~~~~~~~~~~~~~~~
2402
2403Enum: 9/0x09
2404
2405Description
2406^^^^^^^^^^^
2407
2408This API call may be used to detect an end of stream condition.
2409
2410Result[0]
2411^^^^^^^^^
2412
2413Stream type
2414
2415Result[1]
2416^^^^^^^^^
2417
2418Address offset
2419
2420Result[2]
2421^^^^^^^^^
2422
2423Maximum bytes to transfer
2424
2425Result[3]
2426^^^^^^^^^
2427
2428Buffer fullness
2429
2430
2431
2432CX2341X_DEC_GET_DMA_STATUS
2433~~~~~~~~~~~~~~~~~~~~~~~~~~
2434
2435Enum: 10/0x0A
2436
2437Description
2438^^^^^^^^^^^
2439
2440Status of the last DMA transfer
2441
2442Result[0]
2443^^^^^^^^^
2444
2445Bit 1 set means transfer complete
2446Bit 2 set means DMA error
2447Bit 3 set means linked list error
2448
2449Result[1]
2450^^^^^^^^^
2451
2452DMA type: 0=MPEG, 1=OSD, 2=YUV
2453
2454
2455
2456CX2341X_DEC_SCHED_DMA_FROM_HOST
2457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2458
2459Enum: 11/0x0B
2460
2461Description
2462^^^^^^^^^^^
2463
2464Setup DMA from host operation. Counterpart to API 0xCC
2465
2466Param[0]
2467^^^^^^^^
2468
2469Memory address of link list
2470
2471Param[1]
2472^^^^^^^^
2473
2474Total # of bytes to transfer
2475
2476Param[2]
2477^^^^^^^^
2478
2479DMA type (0=MPEG, 1=OSD, 2=YUV)
2480
2481
2482
2483CX2341X_DEC_PAUSE_PLAYBACK
2484~~~~~~~~~~~~~~~~~~~~~~~~~~
2485
2486Enum: 13/0x0D
2487
2488Description
2489^^^^^^^^^^^
2490
2491Freeze playback immediately. In this mode, when internal buffers are
2492full, no more data will be accepted and data request IRQs will be
2493masked.
2494
2495Param[0]
2496^^^^^^^^
2497
2498Display: 0=last frame, 1=black
2499
2500
2501
2502CX2341X_DEC_HALT_FW
2503~~~~~~~~~~~~~~~~~~~
2504
2505Enum: 14/0x0E
2506
2507Description
2508^^^^^^^^^^^
2509
2510The firmware is halted and no further API calls are serviced until
2511the firmware is uploaded again.
2512
2513
2514
2515CX2341X_DEC_SET_STANDARD
2516~~~~~~~~~~~~~~~~~~~~~~~~
2517
2518Enum: 16/0x10
2519
2520Description
2521^^^^^^^^^^^
2522
2523Selects display standard
2524
2525Param[0]
2526^^^^^^^^
2527
25280=NTSC, 1=PAL
2529
2530
2531
2532CX2341X_DEC_GET_VERSION
2533~~~~~~~~~~~~~~~~~~~~~~~
2534
2535Enum: 17/0x11
2536
2537Description
2538^^^^^^^^^^^
2539
2540Returns decoder firmware version information
2541
2542Result[0]
2543^^^^^^^^^
2544
2545Version bitmask:
2546 - Bits 0:15 build
2547 - Bits 16:23 minor
2548 - Bits 24:31 major
2549
2550
2551
2552CX2341X_DEC_SET_STREAM_INPUT
2553~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2554
2555Enum: 20/0x14
2556
2557Description
2558^^^^^^^^^^^
2559
2560Select decoder stream input port
2561
2562Param[0]
2563^^^^^^^^
2564
25650=memory (default), 1=streaming
2566
2567
2568
2569CX2341X_DEC_GET_TIMING_INFO
2570~~~~~~~~~~~~~~~~~~~~~~~~~~~
2571
2572Enum: 21/0x15
2573
2574Description
2575^^^^^^^^^^^
2576
2577Returns timing information from start of playback
2578
2579Result[0]
2580^^^^^^^^^
2581
2582Frame count by decode order
2583
2584Result[1]
2585^^^^^^^^^
2586
2587Video PTS bits 0:31 by display order
2588
2589Result[2]
2590^^^^^^^^^
2591
2592Video PTS bit 32 by display order
2593
2594Result[3]
2595^^^^^^^^^
2596
2597SCR bits 0:31 by display order
2598
2599Result[4]
2600^^^^^^^^^
2601
2602SCR bit 32 by display order
2603
2604
2605
2606CX2341X_DEC_SET_AUDIO_MODE
2607~~~~~~~~~~~~~~~~~~~~~~~~~~
2608
2609Enum: 22/0x16
2610
2611Description
2612^^^^^^^^^^^
2613
2614Select audio mode
2615
2616Param[0]
2617^^^^^^^^
2618
2619Dual mono mode action
2620 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
2621
2622Param[1]
2623^^^^^^^^
2624
2625Stereo mode action:
2626 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
2627
2628
2629
2630CX2341X_DEC_SET_EVENT_NOTIFICATION
2631~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2632
2633Enum: 23/0x17
2634
2635Description
2636^^^^^^^^^^^
2637
2638Setup firmware to notify the host about a particular event.
2639Counterpart to API 0xD5
2640
2641Param[0]
2642^^^^^^^^
2643
2644Event:
2645 - 0=Audio mode change between mono, (joint) stereo and dual channel.
2646 - 3=Decoder started
2647 - 4=Unknown: goes off 10-15 times per second while decoding.
2648 - 5=Some sync event: goes off once per frame.
2649
2650Param[1]
2651^^^^^^^^
2652
2653Notification 0=disabled, 1=enabled
2654
2655Param[2]
2656^^^^^^^^
2657
2658Interrupt bit
2659
2660Param[3]
2661^^^^^^^^
2662
2663Mailbox slot, -1 if no mailbox required.
2664
2665
2666
2667CX2341X_DEC_SET_DISPLAY_BUFFERS
2668~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2669
2670Enum: 24/0x18
2671
2672Description
2673^^^^^^^^^^^
2674
2675Number of display buffers. To decode all frames in reverse playback you
2676must use nine buffers.
2677
2678Param[0]
2679^^^^^^^^
2680
26810=six buffers, 1=nine buffers
2682
2683
2684
2685CX2341X_DEC_EXTRACT_VBI
2686~~~~~~~~~~~~~~~~~~~~~~~
2687
2688Enum: 25/0x19
2689
2690Description
2691^^^^^^^^^^^
2692
2693Extracts VBI data
2694
2695Param[0]
2696^^^^^^^^
2697
26980=extract from extension & user data, 1=extract from private packets
2699
2700Result[0]
2701^^^^^^^^^
2702
2703VBI table location
2704
2705Result[1]
2706^^^^^^^^^
2707
2708VBI table size
2709
2710
2711
2712CX2341X_DEC_SET_DECODER_SOURCE
2713~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2714
2715Enum: 26/0x1A
2716
2717Description
2718^^^^^^^^^^^
2719
2720Selects decoder source. Ensure that the parameters passed to this
2721API match the encoder settings.
2722
2723Param[0]
2724^^^^^^^^
2725
2726Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
2727
2728Param[1]
2729^^^^^^^^
2730
2731YUV picture width
2732
2733Param[2]
2734^^^^^^^^
2735
2736YUV picture height
2737
2738Param[3]
2739^^^^^^^^
2740
2741Bitmap: see Param[0] of API 0xBD
2742
2743
2744
2745CX2341X_DEC_SET_PREBUFFERING
2746~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2747
2748Enum: 30/0x1E
2749
2750Description
2751^^^^^^^^^^^
2752
2753Decoder prebuffering, when enabled up to 128KB are buffered for
2754streams <8mpbs or 640KB for streams >8mbps
2755
2756Param[0]
2757^^^^^^^^
2758
27590=off, 1=on
2760
2761PVR350 Video decoder registers 0x02002800 -> 0x02002B00
2762-------------------------------------------------------
2763
2764Author: Ian Armstrong <ian@iarmst.demon.co.uk>
2765
2766Version: v0.4
2767
2768Date: 12 March 2007
2769
2770
2771This list has been worked out through trial and error. There will be mistakes
2772and omissions. Some registers have no obvious effect so it's hard to say what
2773they do, while others interact with each other, or require a certain load
2774sequence. Horizontal filter setup is one example, with six registers working
2775in unison and requiring a certain load sequence to correctly configure. The
2776indexed colour palette is much easier to set at just two registers, but again
2777it requires a certain load sequence.
2778
2779Some registers are fussy about what they are set to. Load in a bad value & the
2780decoder will fail. A firmware reload will often recover, but sometimes a reset
2781is required. For registers containing size information, setting them to 0 is
2782generally a bad idea. For other control registers i.e. 2878, you'll only find
2783out what values are bad when it hangs.
2784
2785.. code-block:: none
2786
2787 --------------------------------------------------------------------------------
2788 2800
2789 bit 0
2790 Decoder enable
2791 0 = disable
2792 1 = enable
2793 --------------------------------------------------------------------------------
2794 2804
2795 bits 0:31
2796 Decoder horizontal Y alias register 1
2797 ---------------
2798 2808
2799 bits 0:31
2800 Decoder horizontal Y alias register 2
2801 ---------------
2802 280C
2803 bits 0:31
2804 Decoder horizontal Y alias register 3
2805 ---------------
2806 2810
2807 bits 0:31
2808 Decoder horizontal Y alias register 4
2809 ---------------
2810 2814
2811 bits 0:31
2812 Decoder horizontal Y alias register 5
2813 ---------------
2814 2818
2815 bits 0:31
2816 Decoder horizontal Y alias trigger
2817
2818 These six registers control the horizontal aliasing filter for the Y plane.
2819 The first five registers must all be loaded before accessing the trigger
2820 (2818), as this register actually clocks the data through for the first
2821 five.
2822
2823 To correctly program set the filter, this whole procedure must be done 16
2824 times. The actual register contents are copied from a lookup-table in the
2825 firmware which contains 4 different filter settings.
2826
2827 --------------------------------------------------------------------------------
2828 281C
2829 bits 0:31
2830 Decoder horizontal UV alias register 1
2831 ---------------
2832 2820
2833 bits 0:31
2834 Decoder horizontal UV alias register 2
2835 ---------------
2836 2824
2837 bits 0:31
2838 Decoder horizontal UV alias register 3
2839 ---------------
2840 2828
2841 bits 0:31
2842 Decoder horizontal UV alias register 4
2843 ---------------
2844 282C
2845 bits 0:31
2846 Decoder horizontal UV alias register 5
2847 ---------------
2848 2830
2849 bits 0:31
2850 Decoder horizontal UV alias trigger
2851
2852 These six registers control the horizontal aliasing for the UV plane.
2853 Operation is the same as the Y filter, with 2830 being the trigger
2854 register.
2855
2856 --------------------------------------------------------------------------------
2857 2834
2858 bits 0:15
2859 Decoder Y source width in pixels
2860
2861 bits 16:31
2862 Decoder Y destination width in pixels
2863 ---------------
2864 2838
2865 bits 0:15
2866 Decoder UV source width in pixels
2867
2868 bits 16:31
2869 Decoder UV destination width in pixels
2870
2871 NOTE: For both registers, the resulting image must be fully visible on
2872 screen. If the image exceeds the right edge both the source and destination
2873 size must be adjusted to reflect the visible portion. For the source width,
2874 you must take into account the scaling when calculating the new value.
2875 --------------------------------------------------------------------------------
2876
2877 283C
2878 bits 0:31
2879 Decoder Y horizontal scaling
2880 Normally = Reg 2854 >> 2
2881 ---------------
2882 2840
2883 bits 0:31
2884 Decoder ?? unknown - horizontal scaling
2885 Usually 0x00080514
2886 ---------------
2887 2844
2888 bits 0:31
2889 Decoder UV horizontal scaling
2890 Normally = Reg 2854 >> 2
2891 ---------------
2892 2848
2893 bits 0:31
2894 Decoder ?? unknown - horizontal scaling
2895 Usually 0x00100514
2896 ---------------
2897 284C
2898 bits 0:31
2899 Decoder ?? unknown - Y plane
2900 Usually 0x00200020
2901 ---------------
2902 2850
2903 bits 0:31
2904 Decoder ?? unknown - UV plane
2905 Usually 0x00200020
2906 ---------------
2907 2854
2908 bits 0:31
2909 Decoder 'master' value for horizontal scaling
2910 ---------------
2911 2858
2912 bits 0:31
2913 Decoder ?? unknown
2914 Usually 0
2915 ---------------
2916 285C
2917 bits 0:31
2918 Decoder ?? unknown
2919 Normally = Reg 2854 >> 1
2920 ---------------
2921 2860
2922 bits 0:31
2923 Decoder ?? unknown
2924 Usually 0
2925 ---------------
2926 2864
2927 bits 0:31
2928 Decoder ?? unknown
2929 Normally = Reg 2854 >> 1
2930 ---------------
2931 2868
2932 bits 0:31
2933 Decoder ?? unknown
2934 Usually 0
2935
2936 Most of these registers either control horizontal scaling, or appear linked
2937 to it in some way. Register 2854 contains the 'master' value & the other
2938 registers can be calculated from that one. You must also remember to
2939 correctly set the divider in Reg 2874.
2940
2941 To enlarge:
2942 Reg 2854 = (source_width * 0x00200000) / destination_width
2943 Reg 2874 = No divide
2944
2945 To reduce from full size down to half size:
2946 Reg 2854 = (source_width/2 * 0x00200000) / destination width
2947 Reg 2874 = Divide by 2
2948
2949 To reduce from half size down to quarter size:
2950 Reg 2854 = (source_width/4 * 0x00200000) / destination width
2951 Reg 2874 = Divide by 4
2952
2953 The result is always rounded up.
2954
2955 --------------------------------------------------------------------------------
2956 286C
2957 bits 0:15
2958 Decoder horizontal Y buffer offset
2959
2960 bits 15:31
2961 Decoder horizontal UV buffer offset
2962
2963 Offset into the video image buffer. If the offset is gradually incremented,
2964 the on screen image will move left & wrap around higher up on the right.
2965
2966 --------------------------------------------------------------------------------
2967 2870
2968 bits 0:15
2969 Decoder horizontal Y output offset
2970
2971 bits 16:31
2972 Decoder horizontal UV output offset
2973
2974 Offsets the actual video output. Controls output alignment of the Y & UV
2975 planes. The higher the value, the greater the shift to the left. Use
2976 reg 2890 to move the image right.
2977
2978 --------------------------------------------------------------------------------
2979 2874
2980 bits 0:1
2981 Decoder horizontal Y output size divider
2982 00 = No divide
2983 01 = Divide by 2
2984 10 = Divide by 3
2985
2986 bits 4:5
2987 Decoder horizontal UV output size divider
2988 00 = No divide
2989 01 = Divide by 2
2990 10 = Divide by 3
2991
2992 bit 8
2993 Decoder ?? unknown
2994 0 = Normal
2995 1 = Affects video output levels
2996
2997 bit 16
2998 Decoder ?? unknown
2999 0 = Normal
3000 1 = Disable horizontal filter
3001
3002 --------------------------------------------------------------------------------
3003 2878
3004 bit 0
3005 ?? unknown
3006
3007 bit 1
3008 osd on/off
3009 0 = osd off
3010 1 = osd on
3011
3012 bit 2
3013 Decoder + osd video timing
3014 0 = NTSC
3015 1 = PAL
3016
3017 bits 3:4
3018 ?? unknown
3019
3020 bit 5
3021 Decoder + osd
3022 Swaps upper & lower fields
3023
3024 --------------------------------------------------------------------------------
3025 287C
3026 bits 0:10
3027 Decoder & osd ?? unknown
3028 Moves entire screen horizontally. Starts at 0x005 with the screen
3029 shifted heavily to the right. Incrementing in steps of 0x004 will
3030 gradually shift the screen to the left.
3031
3032 bits 11:31
3033 ?? unknown
3034
3035 Normally contents are 0x00101111 (NTSC) or 0x1010111d (PAL)
3036
3037 --------------------------------------------------------------------------------
3038 2880 -------- ?? unknown
3039 2884 -------- ?? unknown
3040 --------------------------------------------------------------------------------
3041 2888
3042 bit 0
3043 Decoder + osd ?? unknown
3044 0 = Normal
3045 1 = Misaligned fields (Correctable through 289C & 28A4)
3046
3047 bit 4
3048 ?? unknown
3049
3050 bit 8
3051 ?? unknown
3052
3053 Warning: Bad values will require a firmware reload to recover.
3054 Known to be bad are 0x000,0x011,0x100,0x111
3055 --------------------------------------------------------------------------------
3056 288C
3057 bits 0:15
3058 osd ?? unknown
3059 Appears to affect the osd position stability. The higher the value the
3060 more unstable it becomes. Decoder output remains stable.
3061
3062 bits 16:31
3063 osd ?? unknown
3064 Same as bits 0:15
3065
3066 --------------------------------------------------------------------------------
3067 2890
3068 bits 0:11
3069 Decoder output horizontal offset.
3070
3071 Horizontal offset moves the video image right. A small left shift is
3072 possible, but it's better to use reg 2870 for that due to its greater
3073 range.
3074
3075 NOTE: Video corruption will occur if video window is shifted off the right
3076 edge. To avoid this read the notes for 2834 & 2838.
3077 --------------------------------------------------------------------------------
3078 2894
3079 bits 0:23
3080 Decoder output video surround colour.
3081
3082 Contains the colour (in yuv) used to fill the screen when the video is
3083 running in a window.
3084 --------------------------------------------------------------------------------
3085 2898
3086 bits 0:23
3087 Decoder video window colour
3088 Contains the colour (in yuv) used to fill the video window when the
3089 video is turned off.
3090
3091 bit 24
3092 Decoder video output
3093 0 = Video on
3094 1 = Video off
3095
3096 bit 28
3097 Decoder plane order
3098 0 = Y,UV
3099 1 = UV,Y
3100
3101 bit 29
3102 Decoder second plane byte order
3103 0 = Normal (UV)
3104 1 = Swapped (VU)
3105
3106 In normal usage, the first plane is Y & the second plane is UV. Though the
3107 order of the planes can be swapped, only the byte order of the second plane
3108 can be swapped. This isn't much use for the Y plane, but can be useful for
3109 the UV plane.
3110
3111 --------------------------------------------------------------------------------
3112 289C
3113 bits 0:15
3114 Decoder vertical field offset 1
3115
3116 bits 16:31
3117 Decoder vertical field offset 2
3118
3119 Controls field output vertical alignment. The higher the number, the lower
3120 the image on screen. Known starting values are 0x011E0017 (NTSC) &
3121 0x01500017 (PAL)
3122 --------------------------------------------------------------------------------
3123 28A0
3124 bits 0:15
3125 Decoder & osd width in pixels
3126
3127 bits 16:31
3128 Decoder & osd height in pixels
3129
3130 All output from the decoder & osd are disabled beyond this area. Decoder
3131 output will simply go black outside of this region. If the osd tries to
3132 exceed this area it will become corrupt.
3133 --------------------------------------------------------------------------------
3134 28A4
3135 bits 0:11
3136 osd left shift.
3137
3138 Has a range of 0x770->0x7FF. With the exception of 0, any value outside of
3139 this range corrupts the osd.
3140 --------------------------------------------------------------------------------
3141 28A8
3142 bits 0:15
3143 osd vertical field offset 1
3144
3145 bits 16:31
3146 osd vertical field offset 2
3147
3148 Controls field output vertical alignment. The higher the number, the lower
3149 the image on screen. Known starting values are 0x011E0017 (NTSC) &
3150 0x01500017 (PAL)
3151 --------------------------------------------------------------------------------
3152 28AC -------- ?? unknown
3153 |
3154 V
3155 28BC -------- ?? unknown
3156 --------------------------------------------------------------------------------
3157 28C0
3158 bit 0
3159 Current output field
3160 0 = first field
3161 1 = second field
3162
3163 bits 16:31
3164 Current scanline
3165 The scanline counts from the top line of the first field
3166 through to the last line of the second field.
3167 --------------------------------------------------------------------------------
3168 28C4 -------- ?? unknown
3169 |
3170 V
3171 28F8 -------- ?? unknown
3172 --------------------------------------------------------------------------------
3173 28FC
3174 bit 0
3175 ?? unknown
3176 0 = Normal
3177 1 = Breaks decoder & osd output
3178 --------------------------------------------------------------------------------
3179 2900
3180 bits 0:31
3181 Decoder vertical Y alias register 1
3182 ---------------
3183 2904
3184 bits 0:31
3185 Decoder vertical Y alias register 2
3186 ---------------
3187 2908
3188 bits 0:31
3189 Decoder vertical Y alias trigger
3190
3191 These three registers control the vertical aliasing filter for the Y plane.
3192 Operation is similar to the horizontal Y filter (2804). The only real
3193 difference is that there are only two registers to set before accessing
3194 the trigger register (2908). As for the horizontal filter, the values are
3195 taken from a lookup table in the firmware, and the procedure must be
3196 repeated 16 times to fully program the filter.
3197 --------------------------------------------------------------------------------
3198 290C
3199 bits 0:31
3200 Decoder vertical UV alias register 1
3201 ---------------
3202 2910
3203 bits 0:31
3204 Decoder vertical UV alias register 2
3205 ---------------
3206 2914
3207 bits 0:31
3208 Decoder vertical UV alias trigger
3209
3210 These three registers control the vertical aliasing filter for the UV
3211 plane. Operation is the same as the Y filter, with 2914 being the trigger.
3212 --------------------------------------------------------------------------------
3213 2918
3214 bits 0:15
3215 Decoder Y source height in pixels
3216
3217 bits 16:31
3218 Decoder Y destination height in pixels
3219 ---------------
3220 291C
3221 bits 0:15
3222 Decoder UV source height in pixels divided by 2
3223
3224 bits 16:31
3225 Decoder UV destination height in pixels
3226
3227 NOTE: For both registers, the resulting image must be fully visible on
3228 screen. If the image exceeds the bottom edge both the source and
3229 destination size must be adjusted to reflect the visible portion. For the
3230 source height, you must take into account the scaling when calculating the
3231 new value.
3232 --------------------------------------------------------------------------------
3233 2920
3234 bits 0:31
3235 Decoder Y vertical scaling
3236 Normally = Reg 2930 >> 2
3237 ---------------
3238 2924
3239 bits 0:31
3240 Decoder Y vertical scaling
3241 Normally = Reg 2920 + 0x514
3242 ---------------
3243 2928
3244 bits 0:31
3245 Decoder UV vertical scaling
3246 When enlarging = Reg 2930 >> 2
3247 When reducing = Reg 2930 >> 3
3248 ---------------
3249 292C
3250 bits 0:31
3251 Decoder UV vertical scaling
3252 Normally = Reg 2928 + 0x514
3253 ---------------
3254 2930
3255 bits 0:31
3256 Decoder 'master' value for vertical scaling
3257 ---------------
3258 2934
3259 bits 0:31
3260 Decoder ?? unknown - Y vertical scaling
3261 ---------------
3262 2938
3263 bits 0:31
3264 Decoder Y vertical scaling
3265 Normally = Reg 2930
3266 ---------------
3267 293C
3268 bits 0:31
3269 Decoder ?? unknown - Y vertical scaling
3270 ---------------
3271 2940
3272 bits 0:31
3273 Decoder UV vertical scaling
3274 When enlarging = Reg 2930 >> 1
3275 When reducing = Reg 2930
3276 ---------------
3277 2944
3278 bits 0:31
3279 Decoder ?? unknown - UV vertical scaling
3280 ---------------
3281 2948
3282 bits 0:31
3283 Decoder UV vertical scaling
3284 Normally = Reg 2940
3285 ---------------
3286 294C
3287 bits 0:31
3288 Decoder ?? unknown - UV vertical scaling
3289
3290 Most of these registers either control vertical scaling, or appear linked
3291 to it in some way. Register 2930 contains the 'master' value & all other
3292 registers can be calculated from that one. You must also remember to
3293 correctly set the divider in Reg 296C
3294
3295 To enlarge:
3296 Reg 2930 = (source_height * 0x00200000) / destination_height
3297 Reg 296C = No divide
3298
3299 To reduce from full size down to half size:
3300 Reg 2930 = (source_height/2 * 0x00200000) / destination height
3301 Reg 296C = Divide by 2
3302
3303 To reduce from half down to quarter.
3304 Reg 2930 = (source_height/4 * 0x00200000) / destination height
3305 Reg 296C = Divide by 4
3306
3307 --------------------------------------------------------------------------------
3308 2950
3309 bits 0:15
3310 Decoder Y line index into display buffer, first field
3311
3312 bits 16:31
3313 Decoder Y vertical line skip, first field
3314 --------------------------------------------------------------------------------
3315 2954
3316 bits 0:15
3317 Decoder Y line index into display buffer, second field
3318
3319 bits 16:31
3320 Decoder Y vertical line skip, second field
3321 --------------------------------------------------------------------------------
3322 2958
3323 bits 0:15
3324 Decoder UV line index into display buffer, first field
3325
3326 bits 16:31
3327 Decoder UV vertical line skip, first field
3328 --------------------------------------------------------------------------------
3329 295C
3330 bits 0:15
3331 Decoder UV line index into display buffer, second field
3332
3333 bits 16:31
3334 Decoder UV vertical line skip, second field
3335 --------------------------------------------------------------------------------
3336 2960
3337 bits 0:15
3338 Decoder destination height minus 1
3339
3340 bits 16:31
3341 Decoder destination height divided by 2
3342 --------------------------------------------------------------------------------
3343 2964
3344 bits 0:15
3345 Decoder Y vertical offset, second field
3346
3347 bits 16:31
3348 Decoder Y vertical offset, first field
3349
3350 These two registers shift the Y plane up. The higher the number, the
3351 greater the shift.
3352 --------------------------------------------------------------------------------
3353 2968
3354 bits 0:15
3355 Decoder UV vertical offset, second field
3356
3357 bits 16:31
3358 Decoder UV vertical offset, first field
3359
3360 These two registers shift the UV plane up. The higher the number, the
3361 greater the shift.
3362 --------------------------------------------------------------------------------
3363 296C
3364 bits 0:1
3365 Decoder vertical Y output size divider
3366 00 = No divide
3367 01 = Divide by 2
3368 10 = Divide by 4
3369
3370 bits 8:9
3371 Decoder vertical UV output size divider
3372 00 = No divide
3373 01 = Divide by 2
3374 10 = Divide by 4
3375 --------------------------------------------------------------------------------
3376 2970
3377 bit 0
3378 Decoder ?? unknown
3379 0 = Normal
3380 1 = Affect video output levels
3381
3382 bit 16
3383 Decoder ?? unknown
3384 0 = Normal
3385 1 = Disable vertical filter
3386
3387 --------------------------------------------------------------------------------
3388 2974 -------- ?? unknown
3389 |
3390 V
3391 29EF -------- ?? unknown
3392 --------------------------------------------------------------------------------
3393 2A00
3394 bits 0:2
3395 osd colour mode
3396 000 = 8 bit indexed
3397 001 = 16 bit (565)
3398 010 = 15 bit (555)
3399 011 = 12 bit (444)
3400 100 = 32 bit (8888)
3401
3402 bits 4:5
3403 osd display bpp
3404 01 = 8 bit
3405 10 = 16 bit
3406 11 = 32 bit
3407
3408 bit 8
3409 osd global alpha
3410 0 = Off
3411 1 = On
3412
3413 bit 9
3414 osd local alpha
3415 0 = Off
3416 1 = On
3417
3418 bit 10
3419 osd colour key
3420 0 = Off
3421 1 = On
3422
3423 bit 11
3424 osd ?? unknown
3425 Must be 1
3426
3427 bit 13
3428 osd colour space
3429 0 = ARGB
3430 1 = AYVU
3431
3432 bits 16:31
3433 osd ?? unknown
3434 Must be 0x001B (some kind of buffer pointer ?)
3435
3436 When the bits-per-pixel is set to 8, the colour mode is ignored and
3437 assumed to be 8 bit indexed. For 16 & 32 bits-per-pixel the colour depth
3438 is honoured, and when using a colour depth that requires fewer bytes than
3439 allocated the extra bytes are used as padding. So for a 32 bpp with 8 bit
3440 index colour, there are 3 padding bytes per pixel. It's also possible to
3441 select 16bpp with a 32 bit colour mode. This results in the pixel width
3442 being doubled, but the color key will not work as expected in this mode.
3443
3444 Colour key is as it suggests. You designate a colour which will become
3445 completely transparent. When using 565, 555 or 444 colour modes, the
3446 colour key is always 16 bits wide. The colour to key on is set in Reg 2A18.
3447
3448 Local alpha works differently depending on the colour mode. For 32bpp & 8
3449 bit indexed, local alpha is a per-pixel 256 step transparency, with 0 being
3450 transparent and 255 being solid. For the 16bpp modes 555 & 444, the unused
3451 bit(s) act as a simple transparency switch, with 0 being solid & 1 being
3452 fully transparent. There is no local alpha support for 16bit 565.
3453
3454 Global alpha is a 256 step transparency that applies to the entire osd,
3455 with 0 being transparent & 255 being solid.
3456
3457 It's possible to combine colour key, local alpha & global alpha.
3458 --------------------------------------------------------------------------------
3459 2A04
3460 bits 0:15
3461 osd x coord for left edge
3462
3463 bits 16:31
3464 osd y coord for top edge
3465 ---------------
3466 2A08
3467 bits 0:15
3468 osd x coord for right edge
3469
3470 bits 16:31
3471 osd y coord for bottom edge
3472
3473 For both registers, (0,0) = top left corner of the display area. These
3474 registers do not control the osd size, only where it's positioned & how
3475 much is visible. The visible osd area cannot exceed the right edge of the
3476 display, otherwise the osd will become corrupt. See reg 2A10 for
3477 setting osd width.
3478 --------------------------------------------------------------------------------
3479 2A0C
3480 bits 0:31
3481 osd buffer index
3482
3483 An index into the osd buffer. Slowly incrementing this moves the osd left,
3484 wrapping around onto the right edge
3485 --------------------------------------------------------------------------------
3486 2A10
3487 bits 0:11
3488 osd buffer 32 bit word width
3489
3490 Contains the width of the osd measured in 32 bit words. This means that all
3491 colour modes are restricted to a byte width which is divisible by 4.
3492 --------------------------------------------------------------------------------
3493 2A14
3494 bits 0:15
3495 osd height in pixels
3496
3497 bits 16:32
3498 osd line index into buffer
3499 osd will start displaying from this line.
3500 --------------------------------------------------------------------------------
3501 2A18
3502 bits 0:31
3503 osd colour key
3504
3505 Contains the colour value which will be transparent.
3506 --------------------------------------------------------------------------------
3507 2A1C
3508 bits 0:7
3509 osd global alpha
3510
3511 Contains the global alpha value (equiv ivtvfbctl --alpha XX)
3512 --------------------------------------------------------------------------------
3513 2A20 -------- ?? unknown
3514 |
3515 V
3516 2A2C -------- ?? unknown
3517 --------------------------------------------------------------------------------
3518 2A30
3519 bits 0:7
3520 osd colour to change in indexed palette
3521 ---------------
3522 2A34
3523 bits 0:31
3524 osd colour for indexed palette
3525
3526 To set the new palette, first load the index of the colour to change into
3527 2A30, then load the new colour into 2A34. The full palette is 256 colours,
3528 so the index range is 0x00-0xFF
3529 --------------------------------------------------------------------------------
3530 2A38 -------- ?? unknown
3531 2A3C -------- ?? unknown
3532 --------------------------------------------------------------------------------
3533 2A40
3534 bits 0:31
3535 osd ?? unknown
3536
3537 Affects overall brightness, wrapping around to black
3538 --------------------------------------------------------------------------------
3539 2A44
3540 bits 0:31
3541 osd ?? unknown
3542
3543 Green tint
3544 --------------------------------------------------------------------------------
3545 2A48
3546 bits 0:31
3547 osd ?? unknown
3548
3549 Red tint
3550 --------------------------------------------------------------------------------
3551 2A4C
3552 bits 0:31
3553 osd ?? unknown
3554
3555 Affects overall brightness, wrapping around to black
3556 --------------------------------------------------------------------------------
3557 2A50
3558 bits 0:31
3559 osd ?? unknown
3560
3561 Colour shift
3562 --------------------------------------------------------------------------------
3563 2A54
3564 bits 0:31
3565 osd ?? unknown
3566
3567 Colour shift
3568 --------------------------------------------------------------------------------
3569 2A58 -------- ?? unknown
3570 |
3571 V
3572 2AFC -------- ?? unknown
3573 --------------------------------------------------------------------------------
3574 2B00
3575 bit 0
3576 osd filter control
3577 0 = filter off
3578 1 = filter on
3579
3580 bits 1:4
3581 osd ?? unknown
3582
3583 --------------------------------------------------------------------------------
3584
3585The cx231xx DMA engine
3586----------------------
3587
3588
3589This page describes the structures and procedures used by the cx2341x DMA
3590engine.
3591
3592Introduction
3593~~~~~~~~~~~~
3594
3595The cx2341x PCI interface is busmaster capable. This means it has a DMA
3596engine to efficiently transfer large volumes of data between the card and main
3597memory without requiring help from a CPU. Like most hardware, it must operate
3598on contiguous physical memory. This is difficult to come by in large quantities
3599on virtual memory machines.
3600
3601Therefore, it also supports a technique called "scatter-gather". The card can
3602transfer multiple buffers in one operation. Instead of allocating one large
3603contiguous buffer, the driver can allocate several smaller buffers.
3604
3605In practice, I've seen the average transfer to be roughly 80K, but transfers
3606above 128K were not uncommon, particularly at startup. The 128K figure is
3607important, because that is the largest block that the kernel can normally
3608allocate. Even still, 128K blocks are hard to come by, so the driver writer is
3609urged to choose a smaller block size and learn the scatter-gather technique.
3610
3611Mailbox #10 is reserved for DMA transfer information.
3612
3613Note: the hardware expects little-endian data ('intel format').
3614
3615Flow
3616~~~~
3617
3618This section describes, in general, the order of events when handling DMA
3619transfers. Detailed information follows this section.
3620
3621- The card raises the Encoder interrupt.
3622- The driver reads the transfer type, offset and size from Mailbox #10.
3623- The driver constructs the scatter-gather array from enough free dma buffers
3624 to cover the size.
3625- The driver schedules the DMA transfer via the ScheduleDMAtoHost API call.
3626- The card raises the DMA Complete interrupt.
3627- The driver checks the DMA status register for any errors.
3628- The driver post-processes the newly transferred buffers.
3629
3630NOTE! It is possible that the Encoder and DMA Complete interrupts get raised
3631simultaneously. (End of the last, start of the next, etc.)
3632
3633Mailbox #10
3634~~~~~~~~~~~
3635
3636The Flags, Command, Return Value and Timeout fields are ignored.
3637
3638- Name: Mailbox #10
3639- Results[0]: Type: 0: MPEG.
3640- Results[1]: Offset: The position relative to the card's memory space.
3641- Results[2]: Size: The exact number of bytes to transfer.
3642
3643My speculation is that since the StartCapture API has a capture type of "RAW"
3644available, that the type field will have other values that correspond to YUV
3645and PCM data.
3646
3647Scatter-Gather Array
3648~~~~~~~~~~~~~~~~~~~~
3649
3650The scatter-gather array is a contiguously allocated block of memory that
3651tells the card the source and destination of each data-block to transfer.
3652Card "addresses" are derived from the offset supplied by Mailbox #10. Host
3653addresses are the physical memory location of the target DMA buffer.
3654
3655Each S-G array element is a struct of three 32-bit words. The first word is
3656the source address, the second is the destination address. Both take up the
3657entire 32 bits. The lowest 18 bits of the third word is the transfer byte
3658count. The high-bit of the third word is the "last" flag. The last-flag tells
3659the card to raise the DMA_DONE interrupt. From hard personal experience, if
3660you forget to set this bit, the card will still "work" but the stream will
3661most likely get corrupted.
3662
3663The transfer count must be a multiple of 256. Therefore, the driver will need
3664to track how much data in the target buffer is valid and deal with it
3665accordingly.
3666
3667Array Element:
3668
3669- 32-bit Source Address
3670- 32-bit Destination Address
3671- 14-bit reserved (high bit is the last flag)
3672- 18-bit byte count
3673
3674DMA Transfer Status
3675~~~~~~~~~~~~~~~~~~~
3676
3677Register 0x0004 holds the DMA Transfer Status:
3678
3679- bit 0: read completed
3680- bit 1: write completed
3681- bit 2: DMA read error
3682- bit 3: DMA write error
3683- bit 4: Scatter-Gather array error
3684
3685Non-compressed file format
3686--------------------------
3687
3688The cx23416 can produce (and the cx23415 can also read) raw YUV output. The
3689format of a YUV frame is specific to this chip and is called HM12. 'HM' stands
3690for 'Hauppauge Macroblock', which is a misnomer as 'Conexant Macroblock' would
3691be more accurate.
3692
3693The format is YUV 4:2:0 which uses 1 Y byte per pixel and 1 U and V byte per
3694four pixels.
3695
3696The data is encoded as two macroblock planes, the first containing the Y
3697values, the second containing UV macroblocks.
3698
3699The Y plane is divided into blocks of 16x16 pixels from left to right
3700and from top to bottom. Each block is transmitted in turn, line-by-line.
3701
3702So the first 16 bytes are the first line of the top-left block, the
3703second 16 bytes are the second line of the top-left block, etc. After
3704transmitting this block the first line of the block on the right to the
3705first block is transmitted, etc.
3706
3707The UV plane is divided into blocks of 16x8 UV values going from left
3708to right, top to bottom. Each block is transmitted in turn, line-by-line.
3709
3710So the first 16 bytes are the first line of the top-left block and
3711contain 8 UV value pairs (16 bytes in total). The second 16 bytes are the
3712second line of 8 UV pairs of the top-left block, etc. After transmitting
3713this block the first line of the block on the right to the first block is
3714transmitted, etc.
3715
3716The code below is given as an example on how to convert HM12 to separate
3717Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels.
3718
3719The width of a frame is always 720 pixels, regardless of the actual specified
3720width.
3721
3722If the height is not a multiple of 32 lines, then the captured video is
3723missing macroblocks at the end and is unusable. So the height must be a
3724multiple of 32.
3725
3726Raw format c example
3727~~~~~~~~~~~~~~~~~~~~
3728
3729.. code-block:: c
3730
3731 #include <stdio.h>
3732 #include <stdlib.h>
3733 #include <string.h>
3734
3735 static unsigned char frame[576*720*3/2];
3736 static unsigned char framey[576*720];
3737 static unsigned char frameu[576*720 / 4];
3738 static unsigned char framev[576*720 / 4];
3739
3740 static void de_macro_y(unsigned char* dst, unsigned char *src, int dstride, int w, int h)
3741 {
3742 unsigned int y, x, i;
3743
3744 // descramble Y plane
3745 // dstride = 720 = w
3746 // The Y plane is divided into blocks of 16x16 pixels
3747 // Each block in transmitted in turn, line-by-line.
3748 for (y = 0; y < h; y += 16) {
3749 for (x = 0; x < w; x += 16) {
3750 for (i = 0; i < 16; i++) {
3751 memcpy(dst + x + (y + i) * dstride, src, 16);
3752 src += 16;
3753 }
3754 }
3755 }
3756 }
3757
3758 static void de_macro_uv(unsigned char *dstu, unsigned char *dstv, unsigned char *src, int dstride, int w, int h)
3759 {
3760 unsigned int y, x, i;
3761
3762 // descramble U/V plane
3763 // dstride = 720 / 2 = w
3764 // The U/V values are interlaced (UVUV...).
3765 // Again, the UV plane is divided into blocks of 16x16 UV values.
3766 // Each block in transmitted in turn, line-by-line.
3767 for (y = 0; y < h; y += 16) {
3768 for (x = 0; x < w; x += 8) {
3769 for (i = 0; i < 16; i++) {
3770 int idx = x + (y + i) * dstride;
3771
3772 dstu[idx+0] = src[0]; dstv[idx+0] = src[1];
3773 dstu[idx+1] = src[2]; dstv[idx+1] = src[3];
3774 dstu[idx+2] = src[4]; dstv[idx+2] = src[5];
3775 dstu[idx+3] = src[6]; dstv[idx+3] = src[7];
3776 dstu[idx+4] = src[8]; dstv[idx+4] = src[9];
3777 dstu[idx+5] = src[10]; dstv[idx+5] = src[11];
3778 dstu[idx+6] = src[12]; dstv[idx+6] = src[13];
3779 dstu[idx+7] = src[14]; dstv[idx+7] = src[15];
3780 src += 16;
3781 }
3782 }
3783 }
3784 }
3785
3786 /*************************************************************************/
3787 int main(int argc, char **argv)
3788 {
3789 FILE *fin;
3790 int i;
3791
3792 if (argc == 1) fin = stdin;
3793 else fin = fopen(argv[1], "r");
3794
3795 if (fin == NULL) {
3796 fprintf(stderr, "cannot open input\n");
3797 exit(-1);
3798 }
3799 while (fread(frame, sizeof(frame), 1, fin) == 1) {
3800 de_macro_y(framey, frame, 720, 720, 576);
3801 de_macro_uv(frameu, framev, frame + 720 * 576, 720 / 2, 720 / 2, 576 / 2);
3802 fwrite(framey, sizeof(framey), 1, stdout);
3803 fwrite(framev, sizeof(framev), 1, stdout);
3804 fwrite(frameu, sizeof(frameu), 1, stdout);
3805 }
3806 fclose(fin);
3807 return 0;
3808 }
3809
3810
3811Format of embedded V4L2_MPEG_STREAM_VBI_FMT_IVTV VBI data
3812---------------------------------------------------------
3813
3814Author: Hans Verkuil <hverkuil@xs4all.nl>
3815
3816
3817This section describes the V4L2_MPEG_STREAM_VBI_FMT_IVTV format of the VBI data
3818embedded in an MPEG-2 program stream. This format is in part dictated by some
3819hardware limitations of the ivtv driver (the driver for the Conexant cx23415/6
3820chips), in particular a maximum size for the VBI data. Anything longer is cut
3821off when the MPEG stream is played back through the cx23415.
3822
3823The advantage of this format is it is very compact and that all VBI data for
3824all lines can be stored while still fitting within the maximum allowed size.
3825
3826The stream ID of the VBI data is 0xBD. The maximum size of the embedded data is
38274 + 43 * 36, which is 4 bytes for a header and 2 * 18 VBI lines with a 1 byte
3828header and a 42 bytes payload each. Anything beyond this limit is cut off by
3829the cx23415/6 firmware. Besides the data for the VBI lines we also need 36 bits
3830for a bitmask determining which lines are captured and 4 bytes for a magic cookie,
3831signifying that this data package contains V4L2_MPEG_STREAM_VBI_FMT_IVTV VBI data.
3832If all lines are used, then there is no longer room for the bitmask. To solve this
3833two different magic numbers were introduced:
3834
3835'itv0': After this magic number two unsigned longs follow. Bits 0-17 of the first
3836unsigned long denote which lines of the first field are captured. Bits 18-31 of
3837the first unsigned long and bits 0-3 of the second unsigned long are used for the
3838second field.
3839
3840'ITV0': This magic number assumes all VBI lines are captured, i.e. it implicitly
3841implies that the bitmasks are 0xffffffff and 0xf.
3842
3843After these magic cookies (and the 8 byte bitmask in case of cookie 'itv0') the
3844captured VBI lines start:
3845
3846For each line the least significant 4 bits of the first byte contain the data type.
3847Possible values are shown in the table below. The payload is in the following 42
3848bytes.
3849
3850Here is the list of possible data types:
3851
3852.. code-block:: c
3853
3854 #define IVTV_SLICED_TYPE_TELETEXT 0x1 // Teletext (uses lines 6-22 for PAL)
3855 #define IVTV_SLICED_TYPE_CC 0x4 // Closed Captions (line 21 NTSC)
3856 #define IVTV_SLICED_TYPE_WSS 0x5 // Wide Screen Signal (line 23 PAL)
3857 #define IVTV_SLICED_TYPE_VPS 0x7 // Video Programming System (PAL) (line 16)
3858
diff --git a/Documentation/media/v4l-drivers/cx23885-cardlist.rst b/Documentation/media/v4l-drivers/cx23885-cardlist.rst
new file mode 100644
index 000000000000..ded3b9139317
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cx23885-cardlist.rst
@@ -0,0 +1,62 @@
1cx23885 cards list
2==================
3
4.. code-block:: none
5
6 0 -> UNKNOWN/GENERIC [0070:3400]
7 1 -> Hauppauge WinTV-HVR1800lp [0070:7600]
8 2 -> Hauppauge WinTV-HVR1800 [0070:7800,0070:7801,0070:7809]
9 3 -> Hauppauge WinTV-HVR1250 [0070:7911]
10 4 -> DViCO FusionHDTV5 Express [18ac:d500]
11 5 -> Hauppauge WinTV-HVR1500Q [0070:7790,0070:7797]
12 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717]
13 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3]
14 8 -> Hauppauge WinTV-HVR1700 [0070:8101]
15 9 -> Hauppauge WinTV-HVR1400 [0070:8010]
16 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618]
17 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
18 12 -> Leadtek Winfast PxDVR3200 H [107d:6681]
19 13 -> Compro VideoMate E650F [185b:e800]
20 14 -> TurboSight TBS 6920 [6920:8888]
21 15 -> TeVii S470 [d470:9022]
22 16 -> DVBWorld DVB-S2 2005 [0001:2005]
23 17 -> NetUP Dual DVB-S2 CI [1b55:2a2c]
24 18 -> Hauppauge WinTV-HVR1270 [0070:2211]
25 19 -> Hauppauge WinTV-HVR1275 [0070:2215,0070:221d,0070:22f2]
26 20 -> Hauppauge WinTV-HVR1255 [0070:2251,0070:22f1]
27 21 -> Hauppauge WinTV-HVR1210 [0070:2291,0070:2295,0070:2299,0070:229d,0070:22f0,0070:22f3,0070:22f4,0070:22f5]
28 22 -> Mygica X8506 DMB-TH [14f1:8651]
29 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657]
30 24 -> Hauppauge WinTV-HVR1850 [0070:8541]
31 25 -> Compro VideoMate E800 [1858:e800]
32 26 -> Hauppauge WinTV-HVR1290 [0070:8551]
33 27 -> Mygica X8558 PRO DMB-TH [14f1:8578]
34 28 -> LEADTEK WinFast PxTV1200 [107d:6f22]
35 29 -> GoTView X5 3D Hybrid [5654:2390]
36 30 -> NetUP Dual DVB-T/C-CI RF [1b55:e2e4]
37 31 -> Leadtek Winfast PxDVR3200 H XC4000 [107d:6f39]
38 32 -> MPX-885
39 33 -> Mygica X8502/X8507 ISDB-T [14f1:8502]
40 34 -> TerraTec Cinergy T PCIe Dual [153b:117e]
41 35 -> TeVii S471 [d471:9022]
42 36 -> Hauppauge WinTV-HVR1255 [0070:2259]
43 37 -> Prof Revolution DVB-S2 8000 [8000:3034]
44 38 -> Hauppauge WinTV-HVR4400/HVR5500 [0070:c108,0070:c138,0070:c1f8]
45 39 -> AVerTV Hybrid Express Slim HC81R [1461:d939]
46 40 -> TurboSight TBS 6981 [6981:8888]
47 41 -> TurboSight TBS 6980 [6980:8888]
48 42 -> Leadtek Winfast PxPVR2200 [107d:6f21]
49 43 -> Hauppauge ImpactVCB-e [0070:7133]
50 44 -> DViCO FusionHDTV DVB-T Dual Express2 [18ac:db98]
51 45 -> DVBSky T9580 [4254:9580]
52 46 -> DVBSky T980C [4254:980c]
53 47 -> DVBSky S950C [4254:950c]
54 48 -> Technotrend TT-budget CT2-4500 CI [13c2:3013]
55 49 -> DVBSky S950 [4254:0950]
56 50 -> DVBSky S952 [4254:0952]
57 51 -> DVBSky T982 [4254:0982]
58 52 -> Hauppauge WinTV-HVR5525 [0070:f038]
59 53 -> Hauppauge WinTV Starburst [0070:c12a]
60 54 -> ViewCast 260e [1576:0260]
61 55 -> ViewCast 460e [1576:0460]
62 56 -> Hauppauge WinTV-QuadHD-DVB [0070:6a28,0070:6b28]
diff --git a/Documentation/media/v4l-drivers/cx88-cardlist.rst b/Documentation/media/v4l-drivers/cx88-cardlist.rst
new file mode 100644
index 000000000000..01128341e1ea
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cx88-cardlist.rst
@@ -0,0 +1,96 @@
1CX88 cards list
2===============
3
4.. code-block:: none
5
6 0 -> UNKNOWN/GENERIC
7 1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401]
8 2 -> GDI Black Gold [14c7:0106,14c7:0107]
9 3 -> PixelView [1554:4811]
10 4 -> ATI TV Wonder Pro [1002:00f8,1002:00f9]
11 5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613]
12 6 -> AverTV Studio 303 (M126) [1461:000b]
13 7 -> MSI TV-@nywhere Master [1462:8606]
14 8 -> Leadtek Winfast DV2000 [107d:6620,107d:6621]
15 9 -> Leadtek PVR 2000 [107d:663b,107d:663c,107d:6632,107d:6630,107d:6638,107d:6631,107d:6637,107d:663d]
16 10 -> IODATA GV-VCP3/PCI [10fc:d003]
17 11 -> Prolink PlayTV PVR
18 12 -> ASUS PVR-416 [1043:4823,1461:c111]
19 13 -> MSI TV-@nywhere
20 14 -> KWorld/VStream XPert DVB-T [17de:08a6]
21 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00]
22 16 -> KWorld LTV883RF
23 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810,18ac:d800]
24 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001,0070:9000]
25 19 -> Conexant DVB-T reference design [14f1:0187]
26 20 -> Provideo PV259 [1540:2580]
27 21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10,18ac:db11]
28 22 -> pcHDTV HD3000 HDTV [7063:3000]
29 23 -> digitalnow DNTV Live! DVB-T [17de:a8a6]
30 24 -> Hauppauge WinTV 28xxx (Roslyn) models [0070:2801]
31 25 -> Digital-Logic MICROSPACE Entertainment Center (MEC) [14f1:0342]
32 26 -> IODATA GV/BCTV7E [10fc:d035]
33 27 -> PixelView PlayTV Ultra Pro (Stereo)
34 28 -> DViCO FusionHDTV 3 Gold-T [18ac:d820]
35 29 -> ADS Tech Instant TV DVB-T PCI [1421:0334]
36 30 -> TerraTec Cinergy 1400 DVB-T [153b:1166]
37 31 -> DViCO FusionHDTV 5 Gold [18ac:d500]
38 32 -> AverMedia UltraTV Media Center PCI 550 [1461:8011]
39 33 -> Kworld V-Stream Xpert DVD
40 34 -> ATI HDTV Wonder [1002:a101]
41 35 -> WinFast DTV1000-T [107d:665f]
42 36 -> AVerTV 303 (M126) [1461:000a]
43 37 -> Hauppauge Nova-S-Plus DVB-S [0070:9201,0070:9202]
44 38 -> Hauppauge Nova-SE2 DVB-S [0070:9200]
45 39 -> KWorld DVB-S 100 [17de:08b2,1421:0341]
46 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402]
47 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802]
48 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019]
49 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1,12ab:2300]
50 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
51 45 -> KWorld HardwareMpegTV XPert [17de:0840,1421:0305]
52 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44]
53 47 -> pcHDTV HD5500 HDTV [7063:5500]
54 48 -> Kworld MCE 200 Deluxe [17de:0841]
55 49 -> PixelView PlayTV P7000 [1554:4813]
56 50 -> NPG Tech Real TV FM Top 10 [14f1:0842]
57 51 -> WinFast DTV2000 H [107d:665e]
58 52 -> Geniatech DVB-S [14f1:0084]
59 53 -> Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T [0070:1404,0070:1400,0070:1401,0070:1402]
60 54 -> Norwood Micro TV Tuner
61 55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM [c180:c980]
62 56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602]
63 57 -> ADS Tech Instant Video PCI [1421:0390]
64 58 -> Pinnacle PCTV HD 800i [11bd:0051]
65 59 -> DViCO FusionHDTV 5 PCI nano [18ac:d530]
66 60 -> Pinnacle Hybrid PCTV [12ab:1788]
67 61 -> Leadtek TV2000 XP Global [107d:6f18,107d:6618,107d:6619]
68 62 -> PowerColor RA330 [14f1:ea3d]
69 63 -> Geniatech X8000-MT DVBT [14f1:8852]
70 64 -> DViCO FusionHDTV DVB-T PRO [18ac:db30]
71 65 -> DViCO FusionHDTV 7 Gold [18ac:d610]
72 66 -> Prolink Pixelview MPEG 8000GT [1554:4935]
73 67 -> Kworld PlusTV HD PCI 120 (ATSC 120) [17de:08c1]
74 68 -> Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid [0070:6900,0070:6904,0070:6902]
75 69 -> Hauppauge WinTV-HVR4000(Lite) DVB-S/S2 [0070:6905,0070:6906]
76 70 -> TeVii S460 DVB-S/S2 [d460:9022]
77 71 -> Omicom SS4 DVB-S/S2 PCI [A044:2011]
78 72 -> TBS 8920 DVB-S/S2 [8920:8888]
79 73 -> TeVii S420 DVB-S [d420:9022]
80 74 -> Prolink Pixelview Global Extreme [1554:4976]
81 75 -> PROF 7300 DVB-S/S2 [B033:3033]
82 76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200]
83 77 -> TBS 8910 DVB-S [8910:8888]
84 78 -> Prof 6200 DVB-S [b022:3022]
85 79 -> Terratec Cinergy HT PCI MKII [153b:1177]
86 80 -> Hauppauge WinTV-IR Only [0070:9290]
87 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654]
88 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
89 83 -> Prof 7301 DVB-S/S2 [b034:3034]
90 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd]
91 85 -> Twinhan VP-1027 DVB-S [1822:0023]
92 86 -> TeVii S464 DVB-S/S2 [d464:9022]
93 87 -> Leadtek WinFast DTV2000 H PLUS [107d:6f42]
94 88 -> Leadtek WinFast DTV1800 H (XC4000) [107d:6f38]
95 89 -> Leadtek TV2000 XP Global (SC4100) [107d:6f36]
96 90 -> Leadtek TV2000 XP Global (XC4100) [107d:6f43]
diff --git a/Documentation/media/v4l-drivers/cx88.rst b/Documentation/media/v4l-drivers/cx88.rst
new file mode 100644
index 000000000000..d8f3a014726a
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cx88.rst
@@ -0,0 +1,163 @@
1The cx88 driver
2===============
3
4Author: Gerd Hoffmann
5
6This is a v4l2 device driver for the cx2388x chip.
7
8
9Current status
10--------------
11
12video
13 - Works.
14 - Overlay isn't supported.
15
16audio
17 - Works. The TV standard detection is made by the driver, as the
18 hardware has bugs to auto-detect.
19 - audio data dma (i.e. recording without loopback cable to the
20 sound card) is supported via cx88-alsa.
21
22vbi
23 - Works.
24
25
26How to add support for new cards
27--------------------------------
28
29The driver needs some config info for the TV cards. This stuff is in
30cx88-cards.c. If the driver doesn't work well you likely need a new
31entry for your card in that file. Check the kernel log (using dmesg)
32to see whenever the driver knows your card or not. There is a line
33like this one:
34
35.. code-block:: none
36
37 cx8800[0]: subsystem: 0070:3400, board: Hauppauge WinTV \
38 34xxx models [card=1,autodetected]
39
40If your card is listed as "board: UNKNOWN/GENERIC" it is unknown to
41the driver. What to do then?
42
431) Try upgrading to the latest snapshot, maybe it has been added
44 meanwhile.
452) You can try to create a new entry yourself, have a look at
46 cx88-cards.c. If that worked, mail me your changes as unified
47 diff ("diff -u").
483) Or you can mail me the config information. We need at least the
49 following information to add the card:
50
51 - the PCI Subsystem ID ("0070:3400" from the line above,
52 "lspci -v" output is fine too).
53 - the tuner type used by the card. You can try to find one by
54 trial-and-error using the tuner=<n> insmod option. If you
55 know which one the card has you can also have a look at the
56 list in CARDLIST.tuner
57
58Documentation missing at the cx88 datasheet
59-------------------------------------------
60
61MO_OUTPUT_FORMAT (0x310164)
62
63.. code-block:: none
64
65 Previous default from DScaler: 0x1c1f0008
66 Digit 8: 31-28
67 28: PREVREMOD = 1
68
69 Digit 7: 27-24 (0xc = 12 = b1100 )
70 27: COMBALT = 1
71 26: PAL_INV_PHASE
72 (DScaler apparently set this to 1, resulted in sucky picture)
73
74 Digits 6,5: 23-16
75 25-16: COMB_RANGE = 0x1f [default] (9 bits -> max 512)
76
77 Digit 4: 15-12
78 15: DISIFX = 0
79 14: INVCBF = 0
80 13: DISADAPT = 0
81 12: NARROWADAPT = 0
82
83 Digit 3: 11-8
84 11: FORCE2H
85 10: FORCEREMD
86 9: NCHROMAEN
87 8: NREMODEN
88
89 Digit 2: 7-4
90 7-6: YCORE
91 5-4: CCORE
92
93 Digit 1: 3-0
94 3: RANGE = 1
95 2: HACTEXT
96 1: HSFMT
97
980x47 is the sync byte for MPEG-2 transport stream packets.
99Datasheet incorrectly states to use 47 decimal. 188 is the length.
100All DVB compliant frontends output packets with this start code.
101
102Hauppauge WinTV cx88 IR information
103-----------------------------------
104
105The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
106
107====== ======== =================================================
108GPIO0 GPIO1
109====== ======== =================================================
110 0 0 TV Audio
111 1 0 FM radio
112 0 1 Line-In
113 1 1 Mono tuner bypass or CD passthru (tuner specific)
114====== ======== =================================================
115
116GPIO 16(I believe) is tied to the IR port (if present).
117
118
119From the data sheet:
120
121- Register 24'h20004 PCI Interrupt Status
122
123 - bit [18] IR_SMP_INT Set when 32 input samples have been collected over
124 - gpio[16] pin into GP_SAMPLE register.
125
126What's missing from the data sheet:
127
128- Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
129 compat remote)
130- set register 0x35C050 to 0xa80a80
131- enable sampling
132- set register 0x35C054 to 0x5
133- enable the IRQ bit 18 in the interrupt mask register (and
134 provide for a handler)
135
136GP_SAMPLE register is at 0x35C058
137
138Bits are then right shifted into the GP_SAMPLE register at the specified
139rate; you get an interrupt when a full DWORD is received.
140You need to recover the actual RC5 bits out of the (oversampled) IR sensor
141bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An
142actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
143
144I'm pretty sure when no IR signal is present the receiver is always in a
145marking state(1); but stray light, etc can cause intermittent noise values
146as well. Remember, this is a free running sample of the IR receiver state
147over time, so don't assume any sample starts at any particular place.
148
149Additional info
150~~~~~~~~~~~~~~~
151
152This data sheet (google search) seems to have a lovely description of the
153RC5 basics:
154http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
155
156This document has more data:
157http://www.nenya.be/beor/electronics/rc5.htm
158
159This document has a how to decode a bi-phase data stream:
160http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
161
162This document has still more info:
163http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm
diff --git a/Documentation/video4linux/README.davinci-vpbe b/Documentation/media/v4l-drivers/davinci-vpbe.rst
index dc9a297f49c3..b545fe001919 100644
--- a/Documentation/video4linux/README.davinci-vpbe
+++ b/Documentation/media/v4l-drivers/davinci-vpbe.rst
@@ -1,9 +1,9 @@
1The VPBE V4L2 driver design
2===========================
1 3
2 VPBE V4L2 driver design 4File partitioning
3 ====================================================================== 5-----------------
4 6
5 File partitioning
6 -----------------
7 V4L2 display device driver 7 V4L2 display device driver
8 drivers/media/platform/davinci/vpbe_display.c 8 drivers/media/platform/davinci/vpbe_display.c
9 drivers/media/platform/davinci/vpbe_display.h 9 drivers/media/platform/davinci/vpbe_display.h
@@ -22,11 +22,11 @@
22 drivers/media/platform/davinci/vpbe_osd.h 22 drivers/media/platform/davinci/vpbe_osd.h
23 drivers/media/platform/davinci/vpbe_osd_regs.h 23 drivers/media/platform/davinci/vpbe_osd_regs.h
24 24
25 Functional partitioning 25Functional partitioning
26 ----------------------- 26-----------------------
27 27
28 Consists of the following (in the same order as the list under file 28Consists of the following (in the same order as the list under file
29 partitioning):- 29partitioning):
30 30
31 1. V4L2 display driver 31 1. V4L2 display driver
32 Implements creation of video2 and video3 device nodes and 32 Implements creation of video2 and video3 device nodes and
@@ -74,20 +74,22 @@
74 features. The VPBE module interacts with the OSD for enabling and 74 features. The VPBE module interacts with the OSD for enabling and
75 disabling appropriate features of the OSD. 75 disabling appropriate features of the OSD.
76 76
77 Current status:- 77Current status
78--------------
78 79
79 A fully functional working version of the V4L2 driver is available. This 80A fully functional working version of the V4L2 driver is available. This
80 driver has been tested with NTSC and PAL standards and buffer streaming. 81driver has been tested with NTSC and PAL standards and buffer streaming.
81 82
82 Following are TBDs. 83To be done
84----------
83 85
84 vpbe display controller 86vpbe display controller
85 - Add support for external encoders. 87 - Add support for external encoders.
86 - add support for selecting external encoder as default at probe time. 88 - add support for selecting external encoder as default at probe time.
87 89
88 vpbe venc sub device 90vpbe venc sub device
89 - add timings for supporting ths8200 91 - add timings for supporting ths8200
90 - add support for LogicPD LCD. 92 - add support for LogicPD LCD.
91 93
92 FB drivers 94FB drivers
93 - Add support for fbdev drivers.- Ready and part of subsequent patches. 95 - Add support for fbdev drivers.- Ready and part of subsequent patches.
diff --git a/Documentation/media/v4l-drivers/em28xx-cardlist.rst b/Documentation/media/v4l-drivers/em28xx-cardlist.rst
new file mode 100644
index 000000000000..e72f2e5c0898
--- /dev/null
+++ b/Documentation/media/v4l-drivers/em28xx-cardlist.rst
@@ -0,0 +1,105 @@
1EM28xx cards list
2=================
3
4.. code-block:: none
5
6 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
7 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868,eb1a:2875]
8 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
9 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
10 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
11 5 -> MSI VOX USB 2.0 (em2820/em2840)
12 6 -> Terratec Cinergy 200 USB (em2800)
13 7 -> Leadtek Winfast USB II (em2800) [0413:6023]
14 8 -> Kworld USB2800 (em2800)
15 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a,093b:a003]
16 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
17 11 -> Terratec Hybrid XS (em2880)
18 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
19 13 -> Terratec Prodigy XS (em2880)
20 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
21 15 -> V-Gear PocketTV (em2800)
22 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b]
23 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
24 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502]
25 19 -> EM2860/SAA711X Reference Design (em2860)
26 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002]
27 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801]
28 22 -> EM2710/EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751]
29 23 -> Huaqi DLCW-130 (em2750)
30 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112]
31 25 -> Gadmei UTV310 (em2820/em2840)
32 26 -> Hercules Smart TV USB 2.0 (em2820/em2840)
33 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840)
34 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840)
35 29 -> EM2860/TVP5150 Reference Design (em2860)
36 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
37 31 -> Usbgear VD204v9 (em2821)
38 32 -> Supercomp USB 2.0 TV (em2821)
39 33 -> Elgato Video Capture (em2860) [0fd9:0033]
40 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
41 35 -> Typhoon DVD Maker (em2860)
42 36 -> NetGMBH Cam (em2860)
43 37 -> Gadmei UTV330 (em2860) [eb1a:50a6]
44 38 -> Yakumo MovieMixer (em2861)
45 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300]
46 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]
47 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]
48 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359]
49 43 -> Terratec Cinergy T XS (em2870)
50 44 -> Terratec Cinergy T XS (MT2060) (em2870) [0ccd:0043]
51 45 -> Pinnacle PCTV DVB-T (em2870)
52 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
53 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
54 48 -> KWorld DVB-T 310U (em2880)
55 49 -> MSI DigiVox A/D (em2880) [eb1a:e310]
56 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320]
57 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c]
58 52 -> DNT DA2 Hybrid (em2881)
59 53 -> Pinnacle Hybrid Pro (em2881)
60 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323]
61 55 -> Terratec Cinnergy Hybrid T USB XS (em2882) (em2882) [0ccd:005e,0ccd:0042]
62 56 -> Pinnacle Hybrid Pro (330e) (em2882) [2304:0226]
63 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
64 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
65 59 -> Pinnacle PCTV HD Mini (em2874) [2304:023f]
66 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
67 61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840)
68 62 -> Gadmei TVR200 (em2820/em2840)
69 63 -> Kaiomy TVnPC U2 (em2860) [eb1a:e303]
70 64 -> Easy Cap Capture DC-60 (em2860) [1b80:e309]
71 65 -> IO-DATA GV-MVP/SZ (em2820/em2840) [04bb:0515]
72 66 -> Empire dual TV (em2880)
73 67 -> Terratec Grabby (em2860) [0ccd:0096,0ccd:10AF]
74 68 -> Terratec AV350 (em2860) [0ccd:0084]
75 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313]
76 70 -> Evga inDtube (em2882)
77 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840)
78 72 -> Gadmei UTV330+ (em2861)
79 73 -> Reddo DVB-C USB TV Box (em2870)
80 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800)
81 75 -> Dikom DK300 (em2882)
82 76 -> KWorld PlusTV 340U or UB435-Q (ATSC) (em2870) [1b80:a340]
83 77 -> EM2874 Leadership ISDBT (em2874)
84 78 -> PCTV nanoStick T2 290e (em28174) [2013:024f]
85 79 -> Terratec Cinergy H5 (em2884) [eb1a:2885,0ccd:10a2,0ccd:10ad,0ccd:10b6]
86 80 -> PCTV DVB-S2 Stick (460e) (em28174) [2013:024c]
87 81 -> Hauppauge WinTV HVR 930C (em2884) [2040:1605]
88 82 -> Terratec Cinergy HTC Stick (em2884) [0ccd:00b2]
89 83 -> Honestech Vidbox NW03 (em2860) [eb1a:5006]
90 84 -> MaxMedia UB425-TC (em2874) [1b80:e425]
91 85 -> PCTV QuatroStick (510e) (em2884) [2304:0242]
92 86 -> PCTV QuatroStick nano (520e) (em2884) [2013:0251]
93 87 -> Terratec Cinergy HTC USB XS (em2884) [0ccd:008e,0ccd:00ac]
94 88 -> C3 Tech Digital Duo HDTV/SDTV USB (em2884) [1b80:e755]
95 89 -> Delock 61959 (em2874) [1b80:e1cc]
96 90 -> KWorld USB ATSC TV Stick UB435-Q V2 (em2874) [1b80:e346]
97 91 -> SpeedLink Vicious And Devine Laplace webcam (em2765) [1ae7:9003,1ae7:9004]
98 92 -> PCTV DVB-S2 Stick (461e) (em28178) [2013:0258]
99 93 -> KWorld USB ATSC TV Stick UB435-Q V3 (em2874) [1b80:e34c]
100 94 -> PCTV tripleStick (292e) (em28178) [2013:025f,2040:0264]
101 95 -> Leadtek VC100 (em2861) [0413:6f07]
102 96 -> Terratec Cinergy T2 Stick HD (em28178) [eb1a:8179]
103 97 -> Elgato EyeTV Hybrid 2008 INT (em2884) [0fd9:0018]
104 98 -> PLEX PX-BCUD (em28178) [3275:0085]
105 99 -> Hauppauge WinTV-dualHD DVB (em28174) [2040:0265]
diff --git a/Documentation/video4linux/fimc.txt b/Documentation/media/v4l-drivers/fimc.rst
index 4fab231be52e..3adc19bcf039 100644
--- a/Documentation/video4linux/fimc.txt
+++ b/Documentation/media/v4l-drivers/fimc.rst
@@ -1,7 +1,9 @@
1Samsung S5P/EXYNOS4 FIMC driver 1.. include:: <isonum.txt>
2 2
3Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd. 3The Samsung S5P/EXYNOS4 FIMC driver
4--------------------------------------------------------------------------- 4===================================
5
6Copyright |copy| 2012 - 2013 Samsung Electronics Co., Ltd.
5 7
6The FIMC (Fully Interactive Mobile Camera) device available in Samsung 8The FIMC (Fully Interactive Mobile Camera) device available in Samsung
7SoC Application Processors is an integrated camera host interface, color 9SoC Application Processors is an integrated camera host interface, color
@@ -12,53 +14,55 @@ slightly different capabilities, like pixel alignment constraints, rotator
12availability, LCD writeback support, etc. The driver is located at 14availability, LCD writeback support, etc. The driver is located at
13drivers/media/platform/exynos4-is directory. 15drivers/media/platform/exynos4-is directory.
14 16
151. Supported SoCs 17Supported SoCs
16================= 18--------------
17 19
18S5PC100 (mem-to-mem only), S5PV210, EXYNOS4210 20S5PC100 (mem-to-mem only), S5PV210, EXYNOS4210
19 21
202. Supported features 22Supported features
21===================== 23------------------
24
25- camera parallel interface capture (ITU-R.BT601/565);
26- camera serial interface capture (MIPI-CSI2);
27- memory-to-memory processing (color space conversion, scaling, mirror
28 and rotation);
29- dynamic pipeline re-configuration at runtime (re-attachment of any FIMC
30 instance to any parallel video input or any MIPI-CSI front-end);
31- runtime PM and system wide suspend/resume
22 32
23 - camera parallel interface capture (ITU-R.BT601/565); 33Not currently supported
24 - camera serial interface capture (MIPI-CSI2); 34-----------------------
25 - memory-to-memory processing (color space conversion, scaling, mirror
26 and rotation);
27 - dynamic pipeline re-configuration at runtime (re-attachment of any FIMC
28 instance to any parallel video input or any MIPI-CSI front-end);
29 - runtime PM and system wide suspend/resume
30 35
31Not currently supported: 36- LCD writeback input
32 - LCD writeback input 37- per frame clock gating (mem-to-mem)
33 - per frame clock gating (mem-to-mem)
34 38
353. Files partitioning 39Files partitioning
36===================== 40------------------
37 41
38- media device driver 42- media device driver
39 drivers/media/platform/exynos4-is/media-dev.[ch] 43 drivers/media/platform/exynos4-is/media-dev.[ch]
40 44
41 - camera capture video device driver 45- camera capture video device driver
42 drivers/media/platform/exynos4-is/fimc-capture.c 46 drivers/media/platform/exynos4-is/fimc-capture.c
43 47
44 - MIPI-CSI2 receiver subdev 48- MIPI-CSI2 receiver subdev
45 drivers/media/platform/exynos4-is/mipi-csis.[ch] 49 drivers/media/platform/exynos4-is/mipi-csis.[ch]
46 50
47 - video post-processor (mem-to-mem) 51- video post-processor (mem-to-mem)
48 drivers/media/platform/exynos4-is/fimc-core.c 52 drivers/media/platform/exynos4-is/fimc-core.c
49 53
50 - common files 54- common files
51 drivers/media/platform/exynos4-is/fimc-core.h 55 drivers/media/platform/exynos4-is/fimc-core.h
52 drivers/media/platform/exynos4-is/fimc-reg.h 56 drivers/media/platform/exynos4-is/fimc-reg.h
53 drivers/media/platform/exynos4-is/regs-fimc.h 57 drivers/media/platform/exynos4-is/regs-fimc.h
54 58
554. User space interfaces 59User space interfaces
56======================== 60---------------------
57 61
584.1. Media device interface 62Media device interface
63~~~~~~~~~~~~~~~~~~~~~~
59 64
60The driver supports Media Controller API as defined at 65The driver supports Media Controller API as defined at :ref:`media_controller`.
61https://linuxtv.org/downloads/v4l-dvb-apis/media_common.html
62The media device driver name is "SAMSUNG S5P FIMC". 66The media device driver name is "SAMSUNG S5P FIMC".
63 67
64The purpose of this interface is to allow changing assignment of FIMC instances 68The purpose of this interface is to allow changing assignment of FIMC instances
@@ -72,7 +76,8 @@ Reconfiguration is done by enabling/disabling media links created by the driver
72during initialization. The internal device topology can be easily discovered 76during initialization. The internal device topology can be easily discovered
73through media entity and links enumeration. 77through media entity and links enumeration.
74 78
754.2. Memory-to-memory video node 79Memory-to-memory video node
80~~~~~~~~~~~~~~~~~~~~~~~~~~~
76 81
77V4L2 memory-to-memory interface at /dev/video? device node. This is standalone 82V4L2 memory-to-memory interface at /dev/video? device node. This is standalone
78video device, it has no media pads. However please note the mem-to-mem and 83video device, it has no media pads. However please note the mem-to-mem and
@@ -80,22 +85,24 @@ capture video node operation on same FIMC instance is not allowed. The driver
80detects such cases but the applications should prevent them to avoid an 85detects such cases but the applications should prevent them to avoid an
81undefined behaviour. 86undefined behaviour.
82 87
834.3. Capture video node 88Capture video node
89~~~~~~~~~~~~~~~~~~
84 90
85The driver supports V4L2 Video Capture Interface as defined at: 91The driver supports V4L2 Video Capture Interface as defined at
86https://linuxtv.org/downloads/v4l-dvb-apis/devices.html 92:ref:`devices`.
87 93
88At the capture and mem-to-mem video nodes only the multi-planar API is 94At the capture and mem-to-mem video nodes only the multi-planar API is
89supported. For more details see: 95supported. For more details see: :ref:`planar-apis`.
90https://linuxtv.org/downloads/v4l-dvb-apis/planar-apis.html
91 96
924.4. Camera capture subdevs 97Camera capture subdevs
98~~~~~~~~~~~~~~~~~~~~~~
93 99
94Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device 100Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device
95node is also created per each available and enabled at the platform level 101node is also created per each available and enabled at the platform level
96MIPI-CSI receiver device (currently up to two). 102MIPI-CSI receiver device (currently up to two).
97 103
984.5. sysfs 104sysfs
105~~~~~
99 106
100In order to enable more precise camera pipeline control through the sub-device 107In order to enable more precise camera pipeline control through the sub-device
101API the driver creates a sysfs entry associated with "s5p-fimc-md" platform 108API the driver creates a sysfs entry associated with "s5p-fimc-md" platform
@@ -115,15 +122,22 @@ when the last configuration steps at the video node is performed.
115 122
116For full sub-device control support (subdevs configured at user space before 123For full sub-device control support (subdevs configured at user space before
117starting streaming): 124starting streaming):
118# echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode 125
126.. code-block:: none
127
128 # echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
119 129
120For V4L2 video node control only (subdevs configured internally by the host 130For V4L2 video node control only (subdevs configured internally by the host
121driver): 131driver):
122# echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode 132
133.. code-block:: none
134
135 # echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
136
123This is a default option. 137This is a default option.
124 138
1255. Device mapping to video and subdev device nodes 1395. Device mapping to video and subdev device nodes
126================================================== 140--------------------------------------------------
127 141
128There are associated two video device nodes with each device instance in 142There are associated two video device nodes with each device instance in
129hardware - video capture and mem-to-mem and additionally a subdev node for 143hardware - video capture and mem-to-mem and additionally a subdev node for
@@ -134,14 +148,21 @@ How to find out which /dev/video? or /dev/v4l-subdev? is assigned to which
134device? 148device?
135 149
136You can either grep through the kernel log to find relevant information, i.e. 150You can either grep through the kernel log to find relevant information, i.e.
137# dmesg | grep -i fimc 151
152.. code-block:: none
153
154 # dmesg | grep -i fimc
155
138(note that udev, if present, might still have rearranged the video nodes), 156(note that udev, if present, might still have rearranged the video nodes),
139 157
140or retrieve the information from /dev/media? with help of the media-ctl tool: 158or retrieve the information from /dev/media? with help of the media-ctl tool:
141# media-ctl -p 159
160.. code-block:: none
161
162 # media-ctl -p
142 163
1437. Build 1647. Build
144======== 165--------
145 166
146If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m) 167If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m)
147two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and 168two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and
diff --git a/Documentation/video4linux/4CCs.txt b/Documentation/media/v4l-drivers/fourcc.rst
index 41241af1ebfe..f7c8cefff02a 100644
--- a/Documentation/video4linux/4CCs.txt
+++ b/Documentation/media/v4l-drivers/fourcc.rst
@@ -8,24 +8,22 @@ other three characters depends on the first one.
8 8
9Existing 4CCs may not obey these guidelines. 9Existing 4CCs may not obey these guidelines.
10 10
11Formats
12=======
13
14Raw bayer 11Raw bayer
15--------- 12---------
16 13
17The following first characters are used by raw bayer formats: 14The following first characters are used by raw bayer formats:
18 15
19 B: raw bayer, uncompressed 16- B: raw bayer, uncompressed
20 b: raw bayer, DPCM compressed 17- b: raw bayer, DPCM compressed
21 a: A-law compressed 18- a: A-law compressed
22 u: u-law compressed 19- u: u-law compressed
23 20
242nd character: pixel order 212nd character: pixel order
25 B: BGGR 22
26 G: GBRG 23- B: BGGR
27 g: GRBG 24- G: GBRG
28 R: RGGB 25- g: GRBG
26- R: RGGB
29 27
303rd character: uncompressed bits-per-pixel 0--9, A-- 283rd character: uncompressed bits-per-pixel 0--9, A--
31 29
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/media/v4l-drivers/gspca-cardlist.rst
index d2ba80bb7af5..33a8ac7d73ab 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/media/v4l-drivers/gspca-cardlist.rst
@@ -1,11 +1,14 @@
1List of the webcams known by gspca. 1The gspca cards list
2====================
2 3
3The modules are: 4The modules for the gspca webcam drivers are:
4 gspca_main main driver
5 gspca_xxxx subdriver module with xxxx as follows
6 5
7xxxx vend:prod 6- gspca_main: main driver
8---- 7- gspca\_\ *driver*: subdriver module with *driver* as follows
8
9========= ========= ====================================================================
10*driver* vend:prod Device
11========= ========= ====================================================================
9spca501 0000:0000 MystFromOri Unknown Camera 12spca501 0000:0000 MystFromOri Unknown Camera
10spca508 0130:0130 Clone Digital Webcam 11043 13spca508 0130:0130 Clone Digital Webcam 11043
11zc3xx 03f0:1b07 HP Premium Starter Cam 14zc3xx 03f0:1b07 HP Premium Starter Cam
@@ -406,3 +409,4 @@ sn9c20x a168:0614 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
406sn9c20x a168:0615 Dino-Lite Digital Microscope (SN9C201 + MT9M111) 409sn9c20x a168:0615 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
407sn9c20x a168:0617 Dino-Lite Digital Microscope (SN9C201 + MT9M111) 410sn9c20x a168:0617 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
408spca561 abcd:cdee Petcam 411spca561 abcd:cdee Petcam
412========= ========= ====================================================================
diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst
new file mode 100644
index 000000000000..aac566f88833
--- /dev/null
+++ b/Documentation/media/v4l-drivers/index.rst
@@ -0,0 +1,58 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. include:: <isonum.txt>
4
5################################################
6Video4Linux (V4L) driver-specific documentation
7################################################
8
9**Copyright** |copy| 1999-2016 : LinuxTV Developers
10
11This documentation is free software; you can redistribute it and/or modify it
12under the terms of the GNU General Public License as published by the Free
13Software Foundation version 2 of the License.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18more details.
19
20For more details see the file COPYING in the source distribution of Linux.
21
22.. class:: toc-title
23
24 Table of Contents
25
26.. toctree::
27 :maxdepth: 5
28 :numbered:
29
30 fourcc
31 v4l-with-ir
32 tuners
33 cardlist
34 bttv
35 cafe_ccic
36 cpia2
37 cx18
38 cx2341x
39 cx88
40 davinci-vpbe
41 fimc
42 ivtv
43 meye
44 omap3isp
45 omap4_camera
46 pvrusb2
47 pxa_camera
48 radiotrack
49 saa7134
50 sh_mobile_ceu_camera
51 si470x
52 si4713
53 si476x
54 soc-camera
55 uvcvideo
56 vivid
57 zoran
58 zr364xx
diff --git a/Documentation/media/v4l-drivers/ivtv-cardlist.rst b/Documentation/media/v4l-drivers/ivtv-cardlist.rst
new file mode 100644
index 000000000000..cd7e79d2963e
--- /dev/null
+++ b/Documentation/media/v4l-drivers/ivtv-cardlist.rst
@@ -0,0 +1,29 @@
1IVTV cards list
2===============
3
4.. code-block:: none
5
6 1 -> Hauppauge WinTV PVR-250
7 2 -> Hauppauge WinTV PVR-350
8 3 -> Hauppauge WinTV PVR-150 or PVR-500
9 4 -> AVerMedia M179 [1461:a3ce,1461:a3cf]
10 5 -> Yuan MPG600/Kuroutoshikou iTVC16-STVLP [12ab:fff3,12ab:ffff]
11 6 -> Yuan MPG160/Kuroutoshikou iTVC15-STVLP [12ab:0000,10fc:40a0]
12 7 -> Yuan PG600/DiamondMM PVR-550 [ff92:0070,ffab:0600]
13 8 -> Adaptec AVC-2410 [9005:0093]
14 9 -> Adaptec AVC-2010 [9005:0092]
15 10 -> NAGASE TRANSGEAR 5000TV [1461:bfff]
16 11 -> AOpen VA2000MAX-STN6 [0000:ff5f]
17 12 -> YUAN MPG600GR/Kuroutoshikou CX23416GYC-STVLP [12ab:0600,fbab:0600,1154:0523]
18 13 -> I/O Data GV-MVP/RX [10fc:d01e,10fc:d038,10fc:d039]
19 14 -> I/O Data GV-MVP/RX2E [10fc:d025]
20 15 -> GOTVIEW PCI DVD (partial support only) [12ab:0600]
21 16 -> GOTVIEW PCI DVD2 Deluxe [ffac:0600]
22 17 -> Yuan MPC622 [ff01:d998]
23 18 -> Digital Cowboy DCT-MTVP1 [1461:bfff]
24 19 -> Yuan PG600V2/GotView PCI DVD Lite [ffab:0600,ffad:0600]
25 20 -> Club3D ZAP-TV1x01 [ffab:0600]
26 21 -> AverTV MCE 116 Plus [1461:c439]
27 22 -> ASUS Falcon2 [1043:4b66,1043:462e,1043:4b2e]
28 23 -> AverMedia PVR-150 Plus [1461:c035]
29 24 -> AverMedia EZMaker PCI Deluxe [1461:c03f]
diff --git a/Documentation/media/v4l-drivers/ivtv.rst b/Documentation/media/v4l-drivers/ivtv.rst
new file mode 100644
index 000000000000..3ba464c4f9bf
--- /dev/null
+++ b/Documentation/media/v4l-drivers/ivtv.rst
@@ -0,0 +1,217 @@
1
2The ivtv driver
3===============
4
5Author: Hans Verkuil <hverkuil@xs4all.nl>
6
7This is a v4l2 device driver for the Conexant cx23415/6 MPEG encoder/decoder.
8The cx23415 can do both encoding and decoding, the cx23416 can only do MPEG
9encoding. Currently the only card featuring full decoding support is the
10Hauppauge PVR-350.
11
12.. note::
13
14 #) This driver requires the latest encoder firmware (version 2.06.039, size
15 376836 bytes). Get the firmware from here:
16
17 https://linuxtv.org/downloads/firmware/#conexant
18
19 #) 'normal' TV applications do not work with this driver, you need
20 an application that can handle MPEG input such as mplayer, xine, MythTV,
21 etc.
22
23The primary goal of the IVTV project is to provide a "clean room" Linux
24Open Source driver implementation for video capture cards based on the
25iCompression iTVC15 or Conexant CX23415/CX23416 MPEG Codec.
26
27Features
28--------
29
30 * Hardware mpeg2 capture of broadcast video (and sound) via the tuner or
31 S-Video/Composite and audio line-in.
32 * Hardware mpeg2 capture of FM radio where hardware support exists
33 * Supports NTSC, PAL, SECAM with stereo sound
34 * Supports SAP and bilingual transmissions.
35 * Supports raw VBI (closed captions and teletext).
36 * Supports sliced VBI (closed captions and teletext) and is able to insert
37 this into the captured MPEG stream.
38 * Supports raw YUV and PCM input.
39
40Additional features for the PVR-350 (CX23415 based)
41---------------------------------------------------
42
43 * Provides hardware mpeg2 playback
44 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the
45 video signal)
46 * Provides a framebuffer (allowing X applications to appear on the video
47 device)
48 * Supports raw YUV output.
49
50IMPORTANT: In case of problems first read this page:
51 https://help.ubuntu.com/community/Install_IVTV_Troubleshooting
52
53See also
54--------
55
56https://linuxtv.org
57
58IRC
59---
60
61irc://irc.freenode.net/#v4l
62
63----------------------------------------------------------
64
65Devices
66-------
67
68A maximum of 12 ivtv boards are allowed at the moment.
69
70Cards that don't have a video output capability (i.e. non PVR350 cards)
71lack the vbi8, vbi16, video16 and video48 devices. They also do not
72support the framebuffer device /dev/fbx for OSD.
73
74The radio0 device may or may not be present, depending on whether the
75card has a radio tuner or not.
76
77Here is a list of the base v4l devices:
78
79.. code-block:: none
80
81 crw-rw---- 1 root video 81, 0 Jun 19 22:22 /dev/video0
82 crw-rw---- 1 root video 81, 16 Jun 19 22:22 /dev/video16
83 crw-rw---- 1 root video 81, 24 Jun 19 22:22 /dev/video24
84 crw-rw---- 1 root video 81, 32 Jun 19 22:22 /dev/video32
85 crw-rw---- 1 root video 81, 48 Jun 19 22:22 /dev/video48
86 crw-rw---- 1 root video 81, 64 Jun 19 22:22 /dev/radio0
87 crw-rw---- 1 root video 81, 224 Jun 19 22:22 /dev/vbi0
88 crw-rw---- 1 root video 81, 228 Jun 19 22:22 /dev/vbi8
89 crw-rw---- 1 root video 81, 232 Jun 19 22:22 /dev/vbi16
90
91Base devices
92------------
93
94For every extra card you have the numbers increased by one. For example,
95/dev/video0 is listed as the 'base' encoding capture device so we have:
96
97- /dev/video0 is the encoding capture device for the first card (card 0)
98- /dev/video1 is the encoding capture device for the second card (card 1)
99- /dev/video2 is the encoding capture device for the third card (card 2)
100
101Note that if the first card doesn't have a feature (eg no decoder, so no
102video16, the second card will still use video17. The simple rule is 'add
103the card number to the base device number'. If you have other capture
104cards (e.g. WinTV PCI) that are detected first, then you have to tell
105the ivtv module about it so that it will start counting at 1 (or 2, or
106whatever). Otherwise the device numbers can get confusing. The ivtv
107'ivtv_first_minor' module option can be used for that.
108
109
110- /dev/video0
111
112 The encoding capture device(s).
113
114 Read-only.
115
116 Reading from this device gets you the MPEG1/2 program stream.
117 Example:
118
119 .. code-block:: none
120
121 cat /dev/video0 > my.mpg (you need to hit ctrl-c to exit)
122
123
124- /dev/video16
125
126 The decoder output device(s)
127
128 Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
129
130 An mpeg2 stream sent to this device will appear on the selected video
131 display, audio will appear on the line-out/audio out. It is only
132 available for cards that support video out. Example:
133
134 .. code-block:: none
135
136 cat my.mpg >/dev/video16
137
138
139- /dev/video24
140
141 The raw audio capture device(s).
142
143 Read-only
144
145 The raw audio PCM stereo stream from the currently selected
146 tuner or audio line-in. Reading from this device results in a raw
147 (signed 16 bit Little Endian, 48000 Hz, stereo pcm) capture.
148 This device only captures audio. This should be replaced by an ALSA
149 device in the future.
150 Note that there is no corresponding raw audio output device, this is
151 not supported in the decoder firmware.
152
153
154- /dev/video32
155
156 The raw video capture device(s)
157
158 Read-only
159
160 The raw YUV video output from the current video input. The YUV format
161 is non-standard (V4L2_PIX_FMT_HM12).
162
163 Note that the YUV and PCM streams are not synchronized, so they are of
164 limited use.
165
166
167- /dev/video48
168
169 The raw video display device(s)
170
171 Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
172
173 Writes a YUV stream to the decoder of the card.
174
175
176- /dev/radio0
177
178 The radio tuner device(s)
179
180 Cannot be read or written.
181
182 Used to enable the radio tuner and tune to a frequency. You cannot
183 read or write audio streams with this device. Once you use this
184 device to tune the radio, use /dev/video24 to read the raw pcm stream
185 or /dev/video0 to get an mpeg2 stream with black video.
186
187
188- /dev/vbi0
189
190 The 'vertical blank interval' (Teletext, CC, WSS etc) capture device(s)
191
192 Read-only
193
194 Captures the raw (or sliced) video data sent during the Vertical Blank
195 Interval. This data is used to encode teletext, closed captions, VPS,
196 widescreen signalling, electronic program guide information, and other
197 services.
198
199
200- /dev/vbi8
201
202 Processed vbi feedback device(s)
203
204 Read-only. Only present if the MPEG decoder (i.e. CX23415) exists.
205
206 The sliced VBI data embedded in an MPEG stream is reproduced on this
207 device. So while playing back a recording on /dev/video16, you can
208 read the embedded VBI data from /dev/vbi8.
209
210
211- /dev/vbi16
212
213 The vbi 'display' device(s)
214
215 Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
216
217 Can be used to send sliced VBI data to the video-out connector.
diff --git a/Documentation/video4linux/meye.txt b/Documentation/media/v4l-drivers/meye.rst
index a051152ea99c..cfaba6021850 100644
--- a/Documentation/video4linux/meye.txt
+++ b/Documentation/media/v4l-drivers/meye.rst
@@ -1,8 +1,13 @@
1Vaio Picturebook Motion Eye Camera Driver Readme 1.. include:: <isonum.txt>
2------------------------------------------------ 2
3 Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> 3Vaio Picturebook Motion Eye Camera Driver
4 Copyright (C) 2001-2002 Alcôve <www.alcove.com> 4=========================================
5 Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> 5
6Copyright |copy| 2001-2004 Stelian Pop <stelian@popies.net>
7
8Copyright |copy| 2001-2002 Alcôve <www.alcove.com>
9
10Copyright |copy| 2000 Andrew Tridgell <tridge@samba.org>
6 11
7This driver enable the use of video4linux compatible applications with the 12This driver enable the use of video4linux compatible applications with the
8Motion Eye camera. This driver requires the "Sony Laptop Extras" driver (which 13Motion Eye camera. This driver requires the "Sony Laptop Extras" driver (which
@@ -15,8 +20,8 @@ Grabbing is supported in packed YUV colorspace only.
15 20
16MJPEG hardware grabbing is supported via a private API (see below). 21MJPEG hardware grabbing is supported via a private API (see below).
17 22
18Hardware supported: 23Hardware supported
19------------------- 24------------------
20 25
21This driver supports the 'second' version of the MotionEye camera :) 26This driver supports the 'second' version of the MotionEye camera :)
22 27
@@ -37,26 +42,30 @@ This camera is not supported at all by the current driver, in fact
37little information if any is available for this camera 42little information if any is available for this camera
38(USB vendor/device is 0x054c/0x0107). 43(USB vendor/device is 0x054c/0x0107).
39 44
40Driver options: 45Driver options
41--------------- 46--------------
42 47
43Several options can be passed to the meye driver using the standard 48Several options can be passed to the meye driver using the standard
44module argument syntax (<param>=<value> when passing the option to the 49module argument syntax (<param>=<value> when passing the option to the
45module or meye.<param>=<value> on the kernel boot line when meye is 50module or meye.<param>=<value> on the kernel boot line when meye is
46statically linked into the kernel). Those options are: 51statically linked into the kernel). Those options are:
47 52
53.. code-block:: none
54
48 gbuffers: number of capture buffers, default is 2 (32 max) 55 gbuffers: number of capture buffers, default is 2 (32 max)
49 56
50 gbufsize: size of each capture buffer, default is 614400 57 gbufsize: size of each capture buffer, default is 614400
51 58
52 video_nr: video device to register (0 = /dev/video0, etc) 59 video_nr: video device to register (0 = /dev/video0, etc)
53 60
54Module use: 61Module use
55----------- 62----------
56 63
57In order to automatically load the meye module on use, you can put those lines 64In order to automatically load the meye module on use, you can put those lines
58in your /etc/modprobe.d/meye.conf file: 65in your /etc/modprobe.d/meye.conf file:
59 66
67.. code-block:: none
68
60 alias char-major-81 videodev 69 alias char-major-81 videodev
61 alias char-major-81-0 meye 70 alias char-major-81-0 meye
62 options meye gbuffers=32 71 options meye gbuffers=32
@@ -64,6 +73,8 @@ in your /etc/modprobe.d/meye.conf file:
64Usage: 73Usage:
65------ 74------
66 75
76.. code-block:: none
77
67 xawtv >= 3.49 (<http://bytesex.org/xawtv/>) 78 xawtv >= 3.49 (<http://bytesex.org/xawtv/>)
68 for display and uncompressed video capture: 79 for display and uncompressed video capture:
69 80
@@ -74,50 +85,48 @@ Usage:
74 motioneye (<http://popies.net/meye/>) 85 motioneye (<http://popies.net/meye/>)
75 for getting ppm or jpg snapshots, mjpeg video 86 for getting ppm or jpg snapshots, mjpeg video
76 87
77Private API: 88Private API
78------------ 89-----------
79 90
80 The driver supports frame grabbing with the video4linux API, 91The driver supports frame grabbing with the video4linux API,
81 so all video4linux tools (like xawtv) should work with this driver. 92so all video4linux tools (like xawtv) should work with this driver.
82 93
83 Besides the video4linux interface, the driver has a private interface 94Besides the video4linux interface, the driver has a private interface
84 for accessing the Motion Eye extended parameters (camera sharpness, 95for accessing the Motion Eye extended parameters (camera sharpness,
85 agc, video framerate), the shapshot and the MJPEG capture facilities. 96agc, video framerate), the shapshot and the MJPEG capture facilities.
86 97
87 This interface consists of several ioctls (prototypes and structures 98This interface consists of several ioctls (prototypes and structures
88 can be found in include/linux/meye.h): 99can be found in include/linux/meye.h):
89 100
90 MEYEIOC_G_PARAMS 101MEYEIOC_G_PARAMS and MEYEIOC_S_PARAMS
91 MEYEIOC_S_PARAMS 102 Get and set the extended parameters of the motion eye camera.
92 Get and set the extended parameters of the motion eye camera. 103 The user should always query the current parameters with
93 The user should always query the current parameters with 104 MEYEIOC_G_PARAMS, change what he likes and then issue the
94 MEYEIOC_G_PARAMS, change what he likes and then issue the 105 MEYEIOC_S_PARAMS call (checking for -EINVAL). The extended
95 MEYEIOC_S_PARAMS call (checking for -EINVAL). The extended 106 parameters are described by the meye_params structure.
96 parameters are described by the meye_params structure.
97 107
98 108
99 MEYEIOC_QBUF_CAPT 109MEYEIOC_QBUF_CAPT
100 Queue a buffer for capture (the buffers must have been 110 Queue a buffer for capture (the buffers must have been
101 obtained with a VIDIOCGMBUF call and mmap'ed by the 111 obtained with a VIDIOCGMBUF call and mmap'ed by the
102 application). The argument to MEYEIOC_QBUF_CAPT is the 112 application). The argument to MEYEIOC_QBUF_CAPT is the
103 buffer number to queue (or -1 to end capture). The first 113 buffer number to queue (or -1 to end capture). The first
104 call to MEYEIOC_QBUF_CAPT starts the streaming capture. 114 call to MEYEIOC_QBUF_CAPT starts the streaming capture.
105 115
106 MEYEIOC_SYNC 116MEYEIOC_SYNC
107 Takes as an argument the buffer number you want to sync. 117 Takes as an argument the buffer number you want to sync.
108 This ioctl blocks until the buffer is filled and ready 118 This ioctl blocks until the buffer is filled and ready
109 for the application to use. It returns the buffer size. 119 for the application to use. It returns the buffer size.
110 120
111 MEYEIOC_STILLCAPT 121MEYEIOC_STILLCAPT and MEYEIOC_STILLJCAPT
112 MEYEIOC_STILLJCAPT 122 Takes a snapshot in an uncompressed or compressed jpeg format.
113 Takes a snapshot in an uncompressed or compressed jpeg format. 123 This ioctl blocks until the snapshot is done and returns (for
114 This ioctl blocks until the snapshot is done and returns (for 124 jpeg snapshot) the size of the image. The image data is
115 jpeg snapshot) the size of the image. The image data is 125 available from the first mmap'ed buffer.
116 available from the first mmap'ed buffer.
117 126
118 Look at the 'motioneye' application code for an actual example. 127Look at the 'motioneye' application code for an actual example.
119 128
120Bugs / Todo: 129Bugs / Todo
121------------ 130-----------
122 131
123 - 'motioneye' still uses the meye private v4l1 API extensions. 132- 'motioneye' still uses the meye private v4l1 API extensions.
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/media/v4l-drivers/omap3isp.rst
index b9a9f83b1587..336e58feaee2 100644
--- a/Documentation/video4linux/omap3isp.txt
+++ b/Documentation/media/v4l-drivers/omap3isp.rst
@@ -1,15 +1,18 @@
1.. include:: <isonum.txt>
2
1OMAP 3 Image Signal Processor (ISP) driver 3OMAP 3 Image Signal Processor (ISP) driver
4==========================================
5
6Copyright |copy| 2010 Nokia Corporation
2 7
3Copyright (C) 2010 Nokia Corporation 8Copyright |copy| 2009 Texas Instruments, Inc.
4Copyright (C) 2009 Texas Instruments, Inc.
5 9
6Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 10Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
7 Sakari Ailus <sakari.ailus@iki.fi> 11Sakari Ailus <sakari.ailus@iki.fi>, David Cohen <dacohen@gmail.com>
8 David Cohen <dacohen@gmail.com>
9 12
10 13
11Introduction 14Introduction
12============ 15------------
13 16
14This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP) 17This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP)
15driver located under drivers/media/platform/omap3isp. The original driver was 18driver located under drivers/media/platform/omap3isp. The original driver was
@@ -18,9 +21,9 @@ Nokia.
18 21
19The driver has been successfully used on the following versions of OMAP 3: 22The driver has been successfully used on the following versions of OMAP 3:
20 23
21 3430 24- 3430
22 3530 25- 3530
23 3630 26- 3630
24 27
25The driver implements V4L2, Media controller and v4l2_subdev interfaces. 28The driver implements V4L2, Media controller and v4l2_subdev interfaces.
26Sensor, lens and flash drivers using the v4l2_subdev interface in the kernel 29Sensor, lens and flash drivers using the v4l2_subdev interface in the kernel
@@ -28,27 +31,27 @@ are supported.
28 31
29 32
30Split to subdevs 33Split to subdevs
31================ 34----------------
32 35
33The OMAP 3 ISP is split into V4L2 subdevs, each of the blocks inside the ISP 36The OMAP 3 ISP is split into V4L2 subdevs, each of the blocks inside the ISP
34having one subdev to represent it. Each of the subdevs provide a V4L2 subdev 37having one subdev to represent it. Each of the subdevs provide a V4L2 subdev
35interface to userspace. 38interface to userspace.
36 39
37 OMAP3 ISP CCP2 40- OMAP3 ISP CCP2
38 OMAP3 ISP CSI2a 41- OMAP3 ISP CSI2a
39 OMAP3 ISP CCDC 42- OMAP3 ISP CCDC
40 OMAP3 ISP preview 43- OMAP3 ISP preview
41 OMAP3 ISP resizer 44- OMAP3 ISP resizer
42 OMAP3 ISP AEWB 45- OMAP3 ISP AEWB
43 OMAP3 ISP AF 46- OMAP3 ISP AF
44 OMAP3 ISP histogram 47- OMAP3 ISP histogram
45 48
46Each possible link in the ISP is modelled by a link in the Media controller 49Each possible link in the ISP is modelled by a link in the Media controller
47interface. For an example program see [2]. 50interface. For an example program see [#f2]_.
48 51
49 52
50Controlling the OMAP 3 ISP 53Controlling the OMAP 3 ISP
51========================== 54--------------------------
52 55
53In general, the settings given to the OMAP 3 ISP take effect at the beginning 56In general, the settings given to the OMAP 3 ISP take effect at the beginning
54of the following frame. This is done when the module becomes idle during the 57of the following frame. This is done when the module becomes idle during the
@@ -65,7 +68,7 @@ is non-zero.
65 68
66 69
67Events 70Events
68====== 71------
69 72
70The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and 73The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
71statistics (AEWB, AF and histogram) subdevs. 74statistics (AEWB, AF and histogram) subdevs.
@@ -85,9 +88,9 @@ generated whenever a statistics buffer can be dequeued by a user space
85application using the VIDIOC_OMAP3ISP_STAT_REQ IOCTL. The events available 88application using the VIDIOC_OMAP3ISP_STAT_REQ IOCTL. The events available
86are: 89are:
87 90
88 V4L2_EVENT_OMAP3ISP_AEWB 91- V4L2_EVENT_OMAP3ISP_AEWB
89 V4L2_EVENT_OMAP3ISP_AF 92- V4L2_EVENT_OMAP3ISP_AF
90 V4L2_EVENT_OMAP3ISP_HIST 93- V4L2_EVENT_OMAP3ISP_HIST
91 94
92The type of the event data is struct omap3isp_stat_event_status for these 95The type of the event data is struct omap3isp_stat_event_status for these
93ioctls. If there is an error calculating the statistics, there will be an 96ioctls. If there is an error calculating the statistics, there will be an
@@ -96,7 +99,7 @@ omap3isp_stat_event_status.buf_err is set to non-zero.
96 99
97 100
98Private IOCTLs 101Private IOCTLs
99============== 102--------------
100 103
101The OMAP 3 ISP driver supports standard V4L2 IOCTLs and controls where 104The OMAP 3 ISP driver supports standard V4L2 IOCTLs and controls where
102possible and practical. Much of the functions provided by the ISP, however, 105possible and practical. Much of the functions provided by the ISP, however,
@@ -108,13 +111,13 @@ containing hardware-dependent functions.
108 111
109The following private IOCTLs are supported: 112The following private IOCTLs are supported:
110 113
111 VIDIOC_OMAP3ISP_CCDC_CFG 114- VIDIOC_OMAP3ISP_CCDC_CFG
112 VIDIOC_OMAP3ISP_PRV_CFG 115- VIDIOC_OMAP3ISP_PRV_CFG
113 VIDIOC_OMAP3ISP_AEWB_CFG 116- VIDIOC_OMAP3ISP_AEWB_CFG
114 VIDIOC_OMAP3ISP_HIST_CFG 117- VIDIOC_OMAP3ISP_HIST_CFG
115 VIDIOC_OMAP3ISP_AF_CFG 118- VIDIOC_OMAP3ISP_AF_CFG
116 VIDIOC_OMAP3ISP_STAT_REQ 119- VIDIOC_OMAP3ISP_STAT_REQ
117 VIDIOC_OMAP3ISP_STAT_EN 120- VIDIOC_OMAP3ISP_STAT_EN
118 121
119The parameter structures used by these ioctls are described in 122The parameter structures used by these ioctls are described in
120include/linux/omap3isp.h. The detailed functions of the ISP itself related to 123include/linux/omap3isp.h. The detailed functions of the ISP itself related to
@@ -128,7 +131,7 @@ appropriate private IOCTLs.
128 131
129 132
130CCDC and preview block IOCTLs 133CCDC and preview block IOCTLs
131============================= 134-----------------------------
132 135
133The VIDIOC_OMAP3ISP_CCDC_CFG and VIDIOC_OMAP3ISP_PRV_CFG IOCTLs are used to 136The VIDIOC_OMAP3ISP_CCDC_CFG and VIDIOC_OMAP3ISP_PRV_CFG IOCTLs are used to
134configure, enable and disable functions in the CCDC and preview blocks, 137configure, enable and disable functions in the CCDC and preview blocks,
@@ -136,7 +139,7 @@ respectively. Both IOCTLs control several functions in the blocks they
136control. VIDIOC_OMAP3ISP_CCDC_CFG IOCTL accepts a pointer to struct 139control. VIDIOC_OMAP3ISP_CCDC_CFG IOCTL accepts a pointer to struct
137omap3isp_ccdc_update_config as its argument. Similarly VIDIOC_OMAP3ISP_PRV_CFG 140omap3isp_ccdc_update_config as its argument. Similarly VIDIOC_OMAP3ISP_PRV_CFG
138accepts a pointer to struct omap3isp_prev_update_config. The definition of 141accepts a pointer to struct omap3isp_prev_update_config. The definition of
139both structures is available in [1]. 142both structures is available in [#f1]_.
140 143
141The update field in the structures tells whether to update the configuration 144The update field in the structures tells whether to update the configuration
142for the specific function and the flag tells whether to enable or disable the 145for the specific function and the flag tells whether to enable or disable the
@@ -151,34 +154,34 @@ Valid values for the update and flag fields are listed here for
151VIDIOC_OMAP3ISP_CCDC_CFG. Values may be or'ed to configure more than one 154VIDIOC_OMAP3ISP_CCDC_CFG. Values may be or'ed to configure more than one
152function in the same IOCTL call. 155function in the same IOCTL call.
153 156
154 OMAP3ISP_CCDC_ALAW 157- OMAP3ISP_CCDC_ALAW
155 OMAP3ISP_CCDC_LPF 158- OMAP3ISP_CCDC_LPF
156 OMAP3ISP_CCDC_BLCLAMP 159- OMAP3ISP_CCDC_BLCLAMP
157 OMAP3ISP_CCDC_BCOMP 160- OMAP3ISP_CCDC_BCOMP
158 OMAP3ISP_CCDC_FPC 161- OMAP3ISP_CCDC_FPC
159 OMAP3ISP_CCDC_CULL 162- OMAP3ISP_CCDC_CULL
160 OMAP3ISP_CCDC_CONFIG_LSC 163- OMAP3ISP_CCDC_CONFIG_LSC
161 OMAP3ISP_CCDC_TBL_LSC 164- OMAP3ISP_CCDC_TBL_LSC
162 165
163The corresponding values for the VIDIOC_OMAP3ISP_PRV_CFG are here: 166The corresponding values for the VIDIOC_OMAP3ISP_PRV_CFG are here:
164 167
165 OMAP3ISP_PREV_LUMAENH 168- OMAP3ISP_PREV_LUMAENH
166 OMAP3ISP_PREV_INVALAW 169- OMAP3ISP_PREV_INVALAW
167 OMAP3ISP_PREV_HRZ_MED 170- OMAP3ISP_PREV_HRZ_MED
168 OMAP3ISP_PREV_CFA 171- OMAP3ISP_PREV_CFA
169 OMAP3ISP_PREV_CHROMA_SUPP 172- OMAP3ISP_PREV_CHROMA_SUPP
170 OMAP3ISP_PREV_WB 173- OMAP3ISP_PREV_WB
171 OMAP3ISP_PREV_BLKADJ 174- OMAP3ISP_PREV_BLKADJ
172 OMAP3ISP_PREV_RGB2RGB 175- OMAP3ISP_PREV_RGB2RGB
173 OMAP3ISP_PREV_COLOR_CONV 176- OMAP3ISP_PREV_COLOR_CONV
174 OMAP3ISP_PREV_YC_LIMIT 177- OMAP3ISP_PREV_YC_LIMIT
175 OMAP3ISP_PREV_DEFECT_COR 178- OMAP3ISP_PREV_DEFECT_COR
176 OMAP3ISP_PREV_GAMMABYPASS 179- OMAP3ISP_PREV_GAMMABYPASS
177 OMAP3ISP_PREV_DRK_FRM_CAPTURE 180- OMAP3ISP_PREV_DRK_FRM_CAPTURE
178 OMAP3ISP_PREV_DRK_FRM_SUBTRACT 181- OMAP3ISP_PREV_DRK_FRM_SUBTRACT
179 OMAP3ISP_PREV_LENS_SHADING 182- OMAP3ISP_PREV_LENS_SHADING
180 OMAP3ISP_PREV_NF 183- OMAP3ISP_PREV_NF
181 OMAP3ISP_PREV_GAMMA 184- OMAP3ISP_PREV_GAMMA
182 185
183The associated configuration pointer for the function may not be NULL when 186The associated configuration pointer for the function may not be NULL when
184enabling the function. When disabling a function the configuration pointer is 187enabling the function. When disabling a function the configuration pointer is
@@ -186,7 +189,7 @@ ignored.
186 189
187 190
188Statistic blocks IOCTLs 191Statistic blocks IOCTLs
189======================= 192-----------------------
190 193
191The statistics subdevs do offer more dynamic configuration options than the 194The statistics subdevs do offer more dynamic configuration options than the
192other subdevs. They can be enabled, disable and reconfigured when the pipeline 195other subdevs. They can be enabled, disable and reconfigured when the pipeline
@@ -218,7 +221,7 @@ can be found on OMAP's TRMs. The two following fields common to all the above
218configure private IOCTLs require explanation for better understanding as they 221configure private IOCTLs require explanation for better understanding as they
219are not part of the TRM. 222are not part of the TRM.
220 223
221omap3isp_[h3a_af/h3a_aewb/hist]_config.buf_size: 224omap3isp_[h3a_af/h3a_aewb/hist]\_config.buf_size:
222 225
223The modules handle their buffers internally. The necessary buffer size for the 226The modules handle their buffers internally. The necessary buffer size for the
224module's data output depends on the requested configuration. Although the 227module's data output depends on the requested configuration. Although the
@@ -235,7 +238,7 @@ out of [minimum, maximum] buffer size range, it's clamped to fit in there.
235The driver then selects the biggest value. The corrected buf_size value is 238The driver then selects the biggest value. The corrected buf_size value is
236written back to user application. 239written back to user application.
237 240
238omap3isp_[h3a_af/h3a_aewb/hist]_config.config_counter: 241omap3isp_[h3a_af/h3a_aewb/hist]\_config.config_counter:
239 242
240As the configuration doesn't take effect synchronously to the request, the 243As the configuration doesn't take effect synchronously to the request, the
241driver must provide a way to track this information to provide more accurate 244driver must provide a way to track this information to provide more accurate
@@ -254,7 +257,7 @@ matches with the video buffer's field_count.
254 257
255 258
256Technical reference manuals (TRMs) and other documentation 259Technical reference manuals (TRMs) and other documentation
257========================================================== 260----------------------------------------------------------
258 261
259OMAP 3430 TRM: 262OMAP 3430 TRM:
260<URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip> 263<URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip>
@@ -272,8 +275,8 @@ DM 3730 TRM:
272 275
273 276
274References 277References
275========== 278----------
276 279
277[1] include/linux/omap3isp.h 280.. [#f1] include/linux/omap3isp.h
278 281
279[2] http://git.ideasonboard.org/?p=media-ctl.git;a=summary 282.. [#f2] http://git.ideasonboard.org/?p=media-ctl.git;a=summary
diff --git a/Documentation/video4linux/omap4_camera.txt b/Documentation/media/v4l-drivers/omap4_camera.rst
index a6734aa77242..54b427b28e5f 100644
--- a/Documentation/video4linux/omap4_camera.txt
+++ b/Documentation/media/v4l-drivers/omap4_camera.rst
@@ -1,5 +1,9 @@
1 OMAP4 ISS Driver 1OMAP4 ISS Driver
2 ================ 2================
3
4Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
5
6Copyright (C) 2012, Texas Instruments
3 7
4Introduction 8Introduction
5------------ 9------------
@@ -11,15 +15,15 @@ Which contains several components that can be categorized in 3 big groups:
11- ISP (Image Signal Processor) 15- ISP (Image Signal Processor)
12- SIMCOP (Still Image Coprocessor) 16- SIMCOP (Still Image Coprocessor)
13 17
14For more information, please look in [1] for latest version of: 18For more information, please look in [#f1]_ for latest version of:
15 "OMAP4430 Multimedia Device Silicon Revision 2.x" 19"OMAP4430 Multimedia Device Silicon Revision 2.x"
16 20
17As of Revision AB, the ISS is described in detail in section 8. 21As of Revision AB, the ISS is described in detail in section 8.
18 22
19This driver is supporting _only_ the CSI2-A/B interfaces for now. 23This driver is supporting **only** the CSI2-A/B interfaces for now.
20 24
21It makes use of the Media Controller framework [2], and inherited most of the 25It makes use of the Media Controller framework [#f2]_, and inherited most of the
22code from OMAP3 ISP driver (found under drivers/media/platform/omap3isp/*), 26code from OMAP3 ISP driver (found under drivers/media/platform/omap3isp/\*),
23except that it doesn't need an IOMMU now for ISS buffers memory mapping. 27except that it doesn't need an IOMMU now for ISS buffers memory mapping.
24 28
25Supports usage of MMAP buffers only (for now). 29Supports usage of MMAP buffers only (for now).
@@ -40,7 +44,7 @@ Tested platforms
40 44
41- Tested on mainline kernel: 45- Tested on mainline kernel:
42 46
43 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary 47 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
44 48
45 Tag: v3.3 (commit c16fa4f2ad19908a47c63d8fa436a1178438c7e7) 49 Tag: v3.3 (commit c16fa4f2ad19908a47c63d8fa436a1178438c7e7)
46 50
@@ -52,9 +56,5 @@ include/linux/platform_data/media/omap4iss.h
52References 56References
53---------- 57----------
54 58
55[1] http://focus.ti.com/general/docs/wtbu/wtbudocumentcenter.tsp?navigationId=12037&templateId=6123#62 59.. [#f1] http://focus.ti.com/general/docs/wtbu/wtbudocumentcenter.tsp?navigationId=12037&templateId=6123#62
56[2] http://lwn.net/Articles/420485/ 60.. [#f2] http://lwn.net/Articles/420485/
57[3] http://www.spinics.net/lists/linux-media/msg44370.html
58--
59Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
60Copyright (C) 2012, Texas Instruments
diff --git a/Documentation/video4linux/README.pvrusb2 b/Documentation/media/v4l-drivers/pvrusb2.rst
index 2137b589276b..dc0e72d94b1a 100644
--- a/Documentation/video4linux/README.pvrusb2
+++ b/Documentation/media/v4l-drivers/pvrusb2.rst
@@ -1,88 +1,81 @@
1The pvrusb2 driver
2==================
1 3
2$Id$ 4Author: Mike Isely <isely@pobox.com>
3Mike Isely <isely@pobox.com>
4 5
5 pvrusb2 driver 6Background
7----------
6 8
7Background: 9This driver is intended for the "Hauppauge WinTV PVR USB 2.0", which
10is a USB 2.0 hosted TV Tuner. This driver is a work in progress.
11Its history started with the reverse-engineering effort by Björn
12Danielsson <pvrusb2@dax.nu> whose web page can be found here:
13http://pvrusb2.dax.nu/
8 14
9 This driver is intended for the "Hauppauge WinTV PVR USB 2.0", which 15From there Aurelien Alleaume <slts@free.fr> began an effort to
10 is a USB 2.0 hosted TV Tuner. This driver is a work in progress. 16create a video4linux compatible driver. I began with Aurelien's
11 Its history started with the reverse-engineering effort by Björn 17last known snapshot and evolved the driver to the state it is in
12 Danielsson <pvrusb2@dax.nu> whose web page can be found here: 18here.
13 19
14 http://pvrusb2.dax.nu/ 20More information on this driver can be found at:
21http://www.isely.net/pvrusb2.html
15 22
16 From there Aurelien Alleaume <slts@free.fr> began an effort to
17 create a video4linux compatible driver. I began with Aurelien's
18 last known snapshot and evolved the driver to the state it is in
19 here.
20 23
21 More information on this driver can be found at: 24This driver has a strong separation of layers. They are very
25roughly:
22 26
23 http://www.isely.net/pvrusb2.html 271. Low level wire-protocol implementation with the device.
24 28
292. I2C adaptor implementation and corresponding I2C client drivers
30 implemented elsewhere in V4L.
25 31
26 This driver has a strong separation of layers. They are very 323. High level hardware driver implementation which coordinates all
27 roughly: 33 activities that ensure correct operation of the device.
28 34
29 1a. Low level wire-protocol implementation with the device. 354. A "context" layer which manages instancing of driver, setup,
36 tear-down, arbitration, and interaction with high level
37 interfaces appropriately as devices are hotplugged in the
38 system.
30 39
31 1b. I2C adaptor implementation and corresponding I2C client drivers 405. High level interfaces which glue the driver to various published
32 implemented elsewhere in V4L. 41 Linux APIs (V4L, sysfs, maybe DVB in the future).
33
34 1c. High level hardware driver implementation which coordinates all
35 activities that ensure correct operation of the device.
36
37 2. A "context" layer which manages instancing of driver, setup,
38 tear-down, arbitration, and interaction with high level
39 interfaces appropriately as devices are hotplugged in the
40 system.
41
42 3. High level interfaces which glue the driver to various published
43 Linux APIs (V4L, sysfs, maybe DVB in the future).
44
45 The most important shearing layer is between the top 2 layers. A
46 lot of work went into the driver to ensure that any kind of
47 conceivable API can be laid on top of the core driver. (Yes, the
48 driver internally leverages V4L to do its work but that really has
49 nothing to do with the API published by the driver to the outside
50 world.) The architecture allows for different APIs to
51 simultaneously access the driver. I have a strong sense of fairness
52 about APIs and also feel that it is a good design principle to keep
53 implementation and interface isolated from each other. Thus while
54 right now the V4L high level interface is the most complete, the
55 sysfs high level interface will work equally well for similar
56 functions, and there's no reason I see right now why it shouldn't be
57 possible to produce a DVB high level interface that can sit right
58 alongside V4L.
59
60 NOTE: Complete documentation on the pvrusb2 driver is contained in
61 the html files within the doc directory; these are exactly the same
62 as what is on the web site at the time. Browse those files
63 (especially the FAQ) before asking questions.
64 42
43The most important shearing layer is between the top 2 layers. A
44lot of work went into the driver to ensure that any kind of
45conceivable API can be laid on top of the core driver. (Yes, the
46driver internally leverages V4L to do its work but that really has
47nothing to do with the API published by the driver to the outside
48world.) The architecture allows for different APIs to
49simultaneously access the driver. I have a strong sense of fairness
50about APIs and also feel that it is a good design principle to keep
51implementation and interface isolated from each other. Thus while
52right now the V4L high level interface is the most complete, the
53sysfs high level interface will work equally well for similar
54functions, and there's no reason I see right now why it shouldn't be
55possible to produce a DVB high level interface that can sit right
56alongside V4L.
65 57
66Building 58Building
59--------
67 60
68 To build these modules essentially amounts to just running "Make", 61To build these modules essentially amounts to just running "Make",
69 but you need the kernel source tree nearby and you will likely also 62but you need the kernel source tree nearby and you will likely also
70 want to set a few controlling environment variables first in order 63want to set a few controlling environment variables first in order
71 to link things up with that source tree. Please see the Makefile 64to link things up with that source tree. Please see the Makefile
72 here for comments that explain how to do that. 65here for comments that explain how to do that.
73 66
67Source file list / functional overview
68--------------------------------------
74 69
75Source file list / functional overview: 70(Note: The term "module" used below generally refers to loosely
71defined functional units within the pvrusb2 driver and bears no
72relation to the Linux kernel's concept of a loadable module.)
76 73
77 (Note: The term "module" used below generally refers to loosely 74pvrusb2-audio.[ch] - This is glue logic that resides between this
78 defined functional units within the pvrusb2 driver and bears no
79 relation to the Linux kernel's concept of a loadable module.)
80
81 pvrusb2-audio.[ch] - This is glue logic that resides between this
82 driver and the msp3400.ko I2C client driver (which is found 75 driver and the msp3400.ko I2C client driver (which is found
83 elsewhere in V4L). 76 elsewhere in V4L).
84 77
85 pvrusb2-context.[ch] - This module implements the context for an 78pvrusb2-context.[ch] - This module implements the context for an
86 instance of the driver. Everything else eventually ties back to 79 instance of the driver. Everything else eventually ties back to
87 or is otherwise instanced within the data structures implemented 80 or is otherwise instanced within the data structures implemented
88 here. Hotplugging is ultimately coordinated here. All high level 81 here. Hotplugging is ultimately coordinated here. All high level
@@ -93,28 +86,28 @@ Source file list / functional overview:
93 the tuner's frequency through sysfs while simultaneously streaming 86 the tuner's frequency through sysfs while simultaneously streaming
94 video through V4L out to an instance of mplayer). 87 video through V4L out to an instance of mplayer).
95 88
96 pvrusb2-debug.h - This header defines a printk() wrapper and a mask 89pvrusb2-debug.h - This header defines a printk() wrapper and a mask
97 of debugging bit definitions for the various kinds of debug 90 of debugging bit definitions for the various kinds of debug
98 messages that can be enabled within the driver. 91 messages that can be enabled within the driver.
99 92
100 pvrusb2-debugifc.[ch] - This module implements a crude command line 93pvrusb2-debugifc.[ch] - This module implements a crude command line
101 oriented debug interface into the driver. Aside from being part 94 oriented debug interface into the driver. Aside from being part
102 of the process for implementing manual firmware extraction (see 95 of the process for implementing manual firmware extraction (see
103 the pvrusb2 web site mentioned earlier), probably I'm the only one 96 the pvrusb2 web site mentioned earlier), probably I'm the only one
104 who has ever used this. It is mainly a debugging aid. 97 who has ever used this. It is mainly a debugging aid.
105 98
106 pvrusb2-eeprom.[ch] - This is glue logic that resides between this 99pvrusb2-eeprom.[ch] - This is glue logic that resides between this
107 driver the tveeprom.ko module, which is itself implemented 100 driver the tveeprom.ko module, which is itself implemented
108 elsewhere in V4L. 101 elsewhere in V4L.
109 102
110 pvrusb2-encoder.[ch] - This module implements all protocol needed to 103pvrusb2-encoder.[ch] - This module implements all protocol needed to
111 interact with the Conexant mpeg2 encoder chip within the pvrusb2 104 interact with the Conexant mpeg2 encoder chip within the pvrusb2
112 device. It is a crude echo of corresponding logic in ivtv, 105 device. It is a crude echo of corresponding logic in ivtv,
113 however the design goals (strict isolation) and physical layer 106 however the design goals (strict isolation) and physical layer
114 (proxy through USB instead of PCI) are enough different that this 107 (proxy through USB instead of PCI) are enough different that this
115 implementation had to be completely different. 108 implementation had to be completely different.
116 109
117 pvrusb2-hdw-internal.h - This header defines the core data structure 110pvrusb2-hdw-internal.h - This header defines the core data structure
118 in the driver used to track ALL internal state related to control 111 in the driver used to track ALL internal state related to control
119 of the hardware. Nobody outside of the core hardware-handling 112 of the hardware. Nobody outside of the core hardware-handling
120 modules should have any business using this header. All external 113 modules should have any business using this header. All external
@@ -123,16 +116,16 @@ Source file list / functional overview:
123 level interfaces are restricted to the API defined in 116 level interfaces are restricted to the API defined in
124 pvrusb2-hdw.h and NOT this header. 117 pvrusb2-hdw.h and NOT this header.
125 118
126 pvrusb2-hdw.h - This header defines the full internal API for 119pvrusb2-hdw.h - This header defines the full internal API for
127 controlling the hardware. High level interfaces (e.g. V4L, sysfs) 120 controlling the hardware. High level interfaces (e.g. V4L, sysfs)
128 will work through here. 121 will work through here.
129 122
130 pvrusb2-hdw.c - This module implements all the various bits of logic 123pvrusb2-hdw.c - This module implements all the various bits of logic
131 that handle overall control of a specific pvrusb2 device. 124 that handle overall control of a specific pvrusb2 device.
132 (Policy, instantiation, and arbitration of pvrusb2 devices fall 125 (Policy, instantiation, and arbitration of pvrusb2 devices fall
133 within the jurisdiction of pvrusb-context not here). 126 within the jurisdiction of pvrusb-context not here).
134 127
135 pvrusb2-i2c-chips-*.c - These modules implement the glue logic to 128pvrusb2-i2c-chips-\*.c - These modules implement the glue logic to
136 tie together and configure various I2C modules as they attach to 129 tie together and configure various I2C modules as they attach to
137 the I2C bus. There are two versions of this file. The "v4l2" 130 the I2C bus. There are two versions of this file. The "v4l2"
138 version is intended to be used in-tree alongside V4L, where we 131 version is intended to be used in-tree alongside V4L, where we
@@ -142,17 +135,17 @@ Source file list / functional overview:
142 from ivtv or older kernel snapshots (or even the support modules 135 from ivtv or older kernel snapshots (or even the support modules
143 in the standalone snapshot). 136 in the standalone snapshot).
144 137
145 pvrusb2-i2c-cmd-v4l1.[ch] - This module implements generic V4L1 138pvrusb2-i2c-cmd-v4l1.[ch] - This module implements generic V4L1
146 compatible commands to the I2C modules. It is here where state 139 compatible commands to the I2C modules. It is here where state
147 changes inside the pvrusb2 driver are translated into V4L1 140 changes inside the pvrusb2 driver are translated into V4L1
148 commands that are in turn send to the various I2C modules. 141 commands that are in turn send to the various I2C modules.
149 142
150 pvrusb2-i2c-cmd-v4l2.[ch] - This module implements generic V4L2 143pvrusb2-i2c-cmd-v4l2.[ch] - This module implements generic V4L2
151 compatible commands to the I2C modules. It is here where state 144 compatible commands to the I2C modules. It is here where state
152 changes inside the pvrusb2 driver are translated into V4L2 145 changes inside the pvrusb2 driver are translated into V4L2
153 commands that are in turn send to the various I2C modules. 146 commands that are in turn send to the various I2C modules.
154 147
155 pvrusb2-i2c-core.[ch] - This module provides an implementation of a 148pvrusb2-i2c-core.[ch] - This module provides an implementation of a
156 kernel-friendly I2C adaptor driver, through which other external 149 kernel-friendly I2C adaptor driver, through which other external
157 I2C client drivers (e.g. msp3400, tuner, lirc) may connect and 150 I2C client drivers (e.g. msp3400, tuner, lirc) may connect and
158 operate corresponding chips within the pvrusb2 device. It is 151 operate corresponding chips within the pvrusb2 device. It is
@@ -162,51 +155,46 @@ Source file list / functional overview:
162 pvrusb2-context, and then ultimately made available to users 155 pvrusb2-context, and then ultimately made available to users
163 through one of the high level interfaces). 156 through one of the high level interfaces).
164 157
165 pvrusb2-io.[ch] - This module implements a very low level ring of 158pvrusb2-io.[ch] - This module implements a very low level ring of
166 transfer buffers, required in order to stream data from the 159 transfer buffers, required in order to stream data from the
167 device. This module is *very* low level. It only operates the 160 device. This module is *very* low level. It only operates the
168 buffers and makes no attempt to define any policy or mechanism for 161 buffers and makes no attempt to define any policy or mechanism for
169 how such buffers might be used. 162 how such buffers might be used.
170 163
171 pvrusb2-ioread.[ch] - This module layers on top of pvrusb2-io.[ch] 164pvrusb2-ioread.[ch] - This module layers on top of pvrusb2-io.[ch]
172 to provide a streaming API usable by a read() system call style of 165 to provide a streaming API usable by a read() system call style of
173 I/O. Right now this is the only layer on top of pvrusb2-io.[ch], 166 I/O. Right now this is the only layer on top of pvrusb2-io.[ch],
174 however the underlying architecture here was intended to allow for 167 however the underlying architecture here was intended to allow for
175 other styles of I/O to be implemented with additional modules, like 168 other styles of I/O to be implemented with additional modules, like
176 mmap()'ed buffers or something even more exotic. 169 mmap()'ed buffers or something even more exotic.
177 170
178 pvrusb2-main.c - This is the top level of the driver. Module level 171pvrusb2-main.c - This is the top level of the driver. Module level
179 and USB core entry points are here. This is our "main". 172 and USB core entry points are here. This is our "main".
180 173
181 pvrusb2-sysfs.[ch] - This is the high level interface which ties the 174pvrusb2-sysfs.[ch] - This is the high level interface which ties the
182 pvrusb2 driver into sysfs. Through this interface you can do 175 pvrusb2 driver into sysfs. Through this interface you can do
183 everything with the driver except actually stream data. 176 everything with the driver except actually stream data.
184 177
185 pvrusb2-tuner.[ch] - This is glue logic that resides between this 178pvrusb2-tuner.[ch] - This is glue logic that resides between this
186 driver and the tuner.ko I2C client driver (which is found 179 driver and the tuner.ko I2C client driver (which is found
187 elsewhere in V4L). 180 elsewhere in V4L).
188 181
189 pvrusb2-util.h - This header defines some common macros used 182pvrusb2-util.h - This header defines some common macros used
190 throughout the driver. These macros are not really specific to 183 throughout the driver. These macros are not really specific to
191 the driver, but they had to go somewhere. 184 the driver, but they had to go somewhere.
192 185
193 pvrusb2-v4l2.[ch] - This is the high level interface which ties the 186pvrusb2-v4l2.[ch] - This is the high level interface which ties the
194 pvrusb2 driver into video4linux. It is through here that V4L 187 pvrusb2 driver into video4linux. It is through here that V4L
195 applications can open and operate the driver in the usual V4L 188 applications can open and operate the driver in the usual V4L
196 ways. Note that **ALL** V4L functionality is published only 189 ways. Note that **ALL** V4L functionality is published only
197 through here and nowhere else. 190 through here and nowhere else.
198 191
199 pvrusb2-video-*.[ch] - This is glue logic that resides between this 192pvrusb2-video-\*.[ch] - This is glue logic that resides between this
200 driver and the saa711x.ko I2C client driver (which is found 193 driver and the saa711x.ko I2C client driver (which is found
201 elsewhere in V4L). Note that saa711x.ko used to be known as 194 elsewhere in V4L). Note that saa711x.ko used to be known as
202 saa7115.ko in ivtv. There are two versions of this; one is 195 saa7115.ko in ivtv. There are two versions of this; one is
203 selected depending on the particular saa711[5x].ko that is found. 196 selected depending on the particular saa711[5x].ko that is found.
204 197
205 pvrusb2.h - This header contains compile time tunable parameters 198pvrusb2.h - This header contains compile time tunable parameters
206 (and at the moment the driver has very little that needs to be 199 (and at the moment the driver has very little that needs to be
207 tuned). 200 tuned).
208
209
210 -Mike Isely
211 isely@pobox.com
212
diff --git a/Documentation/media/v4l-drivers/pxa_camera.rst b/Documentation/media/v4l-drivers/pxa_camera.rst
new file mode 100644
index 000000000000..554f91b04e70
--- /dev/null
+++ b/Documentation/media/v4l-drivers/pxa_camera.rst
@@ -0,0 +1,192 @@
1PXA-Camera Host Driver
2======================
3
4Author: Robert Jarzmik <robert.jarzmik@free.fr>
5
6Constraints
7-----------
8
9a) Image size for YUV422P format
10 All YUV422P images are enforced to have width x height % 16 = 0.
11 This is due to DMA constraints, which transfers only planes of 8 byte
12 multiples.
13
14
15Global video workflow
16---------------------
17
18a) QCI stopped
19 Initialy, the QCI interface is stopped.
20 When a buffer is queued (pxa_videobuf_ops->buf_queue), the QCI starts.
21
22b) QCI started
23 More buffers can be queued while the QCI is started without halting the
24 capture. The new buffers are "appended" at the tail of the DMA chain, and
25 smoothly captured one frame after the other.
26
27 Once a buffer is filled in the QCI interface, it is marked as "DONE" and
28 removed from the active buffers list. It can be then requeud or dequeued by
29 userland application.
30
31 Once the last buffer is filled in, the QCI interface stops.
32
33c) Capture global finite state machine schema
34
35.. code-block:: none
36
37 +----+ +---+ +----+
38 | DQ | | Q | | DQ |
39 | v | v | v
40 +-----------+ +------------------------+
41 | STOP | | Wait for capture start |
42 +-----------+ Q +------------------------+
43 +-> | QCI: stop | ------------------> | QCI: run | <------------+
44 | | DMA: stop | | DMA: stop | |
45 | +-----------+ +-----> +------------------------+ |
46 | / | |
47 | / +---+ +----+ | |
48 |capture list empty / | Q | | DQ | | QCI Irq EOF |
49 | / | v | v v |
50 | +--------------------+ +----------------------+ |
51 | | DMA hotlink missed | | Capture running | |
52 | +--------------------+ +----------------------+ |
53 | | QCI: run | +-----> | QCI: run | <-+ |
54 | | DMA: stop | / | DMA: run | | |
55 | +--------------------+ / +----------------------+ | Other |
56 | ^ /DMA still | | channels |
57 | | capture list / running | DMA Irq End | not |
58 | | not empty / | | finished |
59 | | / v | yet |
60 | +----------------------+ +----------------------+ | |
61 | | Videobuf released | | Channel completed | | |
62 | +----------------------+ +----------------------+ | |
63 +-- | QCI: run | | QCI: run | --+ |
64 | DMA: run | | DMA: run | |
65 +----------------------+ +----------------------+ |
66 ^ / | |
67 | no overrun / | overrun |
68 | / v |
69 +--------------------+ / +----------------------+ |
70 | Frame completed | / | Frame overran | |
71 +--------------------+ <-----+ +----------------------+ restart frame |
72 | QCI: run | | QCI: stop | --------------+
73 | DMA: run | | DMA: stop |
74 +--------------------+ +----------------------+
75
76 Legend: - each box is a FSM state
77 - each arrow is the condition to transition to another state
78 - an arrow with a comment is a mandatory transition (no condition)
79 - arrow "Q" means : a buffer was enqueued
80 - arrow "DQ" means : a buffer was dequeued
81 - "QCI: stop" means the QCI interface is not enabled
82 - "DMA: stop" means all 3 DMA channels are stopped
83 - "DMA: run" means at least 1 DMA channel is still running
84
85DMA usage
86---------
87
88a) DMA flow
89 - first buffer queued for capture
90 Once a first buffer is queued for capture, the QCI is started, but data
91 transfer is not started. On "End Of Frame" interrupt, the irq handler
92 starts the DMA chain.
93 - capture of one videobuffer
94 The DMA chain starts transferring data into videobuffer RAM pages.
95 When all pages are transferred, the DMA irq is raised on "ENDINTR" status
96 - finishing one videobuffer
97 The DMA irq handler marks the videobuffer as "done", and removes it from
98 the active running queue
99 Meanwhile, the next videobuffer (if there is one), is transferred by DMA
100 - finishing the last videobuffer
101 On the DMA irq of the last videobuffer, the QCI is stopped.
102
103b) DMA prepared buffer will have this structure
104
105.. code-block:: none
106
107 +------------+-----+---------------+-----------------+
108 | desc-sg[0] | ... | desc-sg[last] | finisher/linker |
109 +------------+-----+---------------+-----------------+
110
111This structure is pointed by dma->sg_cpu.
112The descriptors are used as follows:
113
114- desc-sg[i]: i-th descriptor, transferring the i-th sg
115 element to the video buffer scatter gather
116- finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN
117- linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0
118
119For the next schema, let's assume d0=desc-sg[0] .. dN=desc-sg[N],
120"f" stands for finisher and "l" for linker.
121A typical running chain is :
122
123.. code-block:: none
124
125 Videobuffer 1 Videobuffer 2
126 +---------+----+---+ +----+----+----+---+
127 | d0 | .. | dN | l | | d0 | .. | dN | f |
128 +---------+----+-|-+ ^----+----+----+---+
129 | |
130 +----+
131
132After the chaining is finished, the chain looks like :
133
134.. code-block:: none
135
136 Videobuffer 1 Videobuffer 2 Videobuffer 3
137 +---------+----+---+ +----+----+----+---+ +----+----+----+---+
138 | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f |
139 +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+
140 | | | |
141 +----+ +----+
142 new_link
143
144c) DMA hot chaining timeslice issue
145
146As DMA chaining is done while DMA _is_ running, the linking may be done
147while the DMA jumps from one Videobuffer to another. On the schema, that
148would be a problem if the following sequence is encountered :
149
150- DMA chain is Videobuffer1 + Videobuffer2
151- pxa_videobuf_queue() is called to queue Videobuffer3
152- DMA controller finishes Videobuffer2, and DMA stops
153
154.. code-block:: none
155
156 =>
157 Videobuffer 1 Videobuffer 2
158 +---------+----+---+ +----+----+----+---+
159 | d0 | .. | dN | l | | d0 | .. | dN | f |
160 +---------+----+-|-+ ^----+----+----+-^-+
161 | | |
162 +----+ +-- DMA DDADR loads DDADR_STOP
163
164- pxa_dma_add_tail_buf() is called, the Videobuffer2 "finisher" is
165 replaced by a "linker" to Videobuffer3 (creation of new_link)
166- pxa_videobuf_queue() finishes
167- the DMA irq handler is called, which terminates Videobuffer2
168- Videobuffer3 capture is not scheduled on DMA chain (as it stopped !!!)
169
170.. code-block:: none
171
172 Videobuffer 1 Videobuffer 2 Videobuffer 3
173 +---------+----+---+ +----+----+----+---+ +----+----+----+---+
174 | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f |
175 +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+
176 | | | |
177 +----+ +----+
178 new_link
179 DMA DDADR still is DDADR_STOP
180
181- pxa_camera_check_link_miss() is called
182 This checks if the DMA is finished and a buffer is still on the
183 pcdev->capture list. If that's the case, the capture will be restarted,
184 and Videobuffer3 is scheduled on DMA chain.
185- the DMA irq handler finishes
186
187.. note::
188
189 If DMA stops just after pxa_camera_check_link_miss() reads DDADR()
190 value, we have the guarantee that the DMA irq handler will be called back
191 when the DMA will finish the buffer, and pxa_camera_check_link_miss() will
192 be called again, to reschedule Videobuffer3.
diff --git a/Documentation/media/v4l-drivers/radiotrack.rst b/Documentation/media/v4l-drivers/radiotrack.rst
new file mode 100644
index 000000000000..2f6325ebfd16
--- /dev/null
+++ b/Documentation/media/v4l-drivers/radiotrack.rst
@@ -0,0 +1,166 @@
1The Radiotrack radio driver
2===========================
3
4Author: Stephen M. Benoit <benoits@servicepro.com>
5
6Date: Dec 14, 1996
7
8ACKNOWLEDGMENTS
9----------------
10
11This document was made based on 'C' code for Linux from Gideon le Grange
12(legrang@active.co.za or legrang@cs.sun.ac.za) in 1994, and elaborations from
13Frans Brinkman (brinkman@esd.nl) in 1996. The results reported here are from
14experiments that the author performed on his own setup, so your mileage may
15vary... I make no guarantees, claims or warranties to the suitability or
16validity of this information. No other documentation on the AIMS
17Lab (http://www.aimslab.com/) RadioTrack card was made available to the
18author. This document is offered in the hopes that it might help users who
19want to use the RadioTrack card in an environment other than MS Windows.
20
21WHY THIS DOCUMENT?
22------------------
23
24I have a RadioTrack card from back when I ran an MS-Windows platform. After
25converting to Linux, I found Gideon le Grange's command-line software for
26running the card, and found that it was good! Frans Brinkman made a
27comfortable X-windows interface, and added a scanning feature. For hack
28value, I wanted to see if the tuner could be tuned beyond the usual FM radio
29broadcast band, so I could pick up the audio carriers from North American
30broadcast TV channels, situated just below and above the 87.0-109.0 MHz range.
31I did not get much success, but I learned about programming ioports under
32Linux and gained some insights about the hardware design used for the card.
33
34So, without further delay, here are the details.
35
36
37PHYSICAL DESCRIPTION
38--------------------
39
40The RadioTrack card is an ISA 8-bit FM radio card. The radio frequency (RF)
41input is simply an antenna lead, and the output is a power audio signal
42available through a miniature phone plug. Its RF frequencies of operation are
43more or less limited from 87.0 to 109.0 MHz (the commercial FM broadcast
44band). Although the registers can be programmed to request frequencies beyond
45these limits, experiments did not give promising results. The variable
46frequency oscillator (VFO) that demodulates the intermediate frequency (IF)
47signal probably has a small range of useful frequencies, and wraps around or
48gets clipped beyond the limits mentioned above.
49
50
51CONTROLLING THE CARD WITH IOPORT
52--------------------------------
53
54The RadioTrack (base) ioport is configurable for 0x30c or 0x20c. Only one
55ioport seems to be involved. The ioport decoding circuitry must be pretty
56simple, as individual ioport bits are directly matched to specific functions
57(or blocks) of the radio card. This way, many functions can be changed in
58parallel with one write to the ioport. The only feedback available through
59the ioports appears to be the "Stereo Detect" bit.
60
61The bits of the ioport are arranged as follows:
62
63.. code-block:: none
64
65 MSb LSb
66 +------+------+------+--------+--------+-------+---------+--------+
67 | VolA | VolB | ???? | Stereo | Radio | TuneA | TuneB | Tune |
68 | (+) | (-) | | Detect | Audio | (bit) | (latch) | Update |
69 | | | | Enable | Enable | | | Enable |
70 +------+------+------+--------+--------+-------+---------+--------+
71
72
73==== ==== =================================
74VolA VolB Description
75==== ==== =================================
760 0 audio mute
770 1 volume + (some delay required)
781 0 volume - (some delay required)
791 1 stay at present volume
80==== ==== =================================
81
82==================== ===========
83Stereo Detect Enable Description
84==================== ===========
850 No Detect
861 Detect
87==================== ===========
88
89Results available by reading ioport >60 msec after last port write.
90
91 0xff ==> no stereo detected, 0xfd ==> stereo detected.
92
93============================= =============================
94Radio to Audio (path) Enable Description
95============================= =============================
960 Disable path (silence)
971 Enable path (audio produced)
98============================= =============================
99
100===== ===== ==================
101TuneA TuneB Description
102===== ===== ==================
1030 0 "zero" bit phase 1
1040 1 "zero" bit phase 2
1051 0 "one" bit phase 1
1061 1 "one" bit phase 2
107===== ===== ==================
108
109
11024-bit code, where bits = (freq*40) + 10486188.
111The Most Significant 11 bits must be 1010 xxxx 0x0 to be valid.
112The bits are shifted in LSb first.
113
114================== ===========================
115Tune Update Enable Description
116================== ===========================
1170 Tuner held constant
1181 Tuner updating in progress
119================== ===========================
120
121
122PROGRAMMING EXAMPLES
123--------------------
124
125.. code-block:: none
126
127 Default: BASE <-- 0xc8 (current volume, no stereo detect,
128 radio enable, tuner adjust disable)
129
130 Card Off: BASE <-- 0x00 (audio mute, no stereo detect,
131 radio disable, tuner adjust disable)
132
133 Card On: BASE <-- 0x00 (see "Card Off", clears any unfinished business)
134 BASE <-- 0xc8 (see "Default")
135
136 Volume Down: BASE <-- 0x48 (volume down, no stereo detect,
137 radio enable, tuner adjust disable)
138 wait 10 msec
139 BASE <-- 0xc8 (see "Default")
140
141 Volume Up: BASE <-- 0x88 (volume up, no stereo detect,
142 radio enable, tuner adjust disable)
143 wait 10 msec
144 BASE <-- 0xc8 (see "Default")
145
146 Check Stereo: BASE <-- 0xd8 (current volume, stereo detect,
147 radio enable, tuner adjust disable)
148 wait 100 msec
149 x <-- BASE (read ioport)
150 BASE <-- 0xc8 (see "Default")
151
152 x=0xff ==> "not stereo", x=0xfd ==> "stereo detected"
153
154 Set Frequency: code = (freq*40) + 10486188
155 foreach of the 24 bits in code,
156 (from Least to Most Significant):
157 to write a "zero" bit,
158 BASE <-- 0x01 (audio mute, no stereo detect, radio
159 disable, "zero" bit phase 1, tuner adjust)
160 BASE <-- 0x03 (audio mute, no stereo detect, radio
161 disable, "zero" bit phase 2, tuner adjust)
162 to write a "one" bit,
163 BASE <-- 0x05 (audio mute, no stereo detect, radio
164 disable, "one" bit phase 1, tuner adjust)
165 BASE <-- 0x07 (audio mute, no stereo detect, radio
166 disable, "one" bit phase 2, tuner adjust)
diff --git a/Documentation/media/v4l-drivers/saa7134-cardlist.rst b/Documentation/media/v4l-drivers/saa7134-cardlist.rst
new file mode 100644
index 000000000000..22c1510d9fa6
--- /dev/null
+++ b/Documentation/media/v4l-drivers/saa7134-cardlist.rst
@@ -0,0 +1,202 @@
1SAA7134 cards list
2==================
3
4.. code-block:: none
5
6 0 -> UNKNOWN/GENERIC
7 1 -> Proteus Pro [philips reference design] [1131:2001,1131:2001]
8 2 -> LifeView FlyVIDEO3000 [5168:0138,4e42:0138]
9 3 -> LifeView/Typhoon FlyVIDEO2000 [5168:0138,4e42:0138]
10 4 -> EMPRESS [1131:6752]
11 5 -> SKNet Monster TV [1131:4e85]
12 6 -> Tevion MD 9717
13 7 -> KNC One TV-Station RDS / Typhoon TV Tuner RDS [1131:fe01,1894:fe01]
14 8 -> Terratec Cinergy 400 TV [153b:1142]
15 9 -> Medion 5044
16 10 -> Kworld/KuroutoShikou SAA7130-TVPCI
17 11 -> Terratec Cinergy 600 TV [153b:1143]
18 12 -> Medion 7134 [16be:0003,16be:5000]
19 13 -> Typhoon TV+Radio 90031
20 14 -> ELSA EX-VISION 300TV [1048:226b]
21 15 -> ELSA EX-VISION 500TV [1048:226a]
22 16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840]
23 17 -> AOPEN VA1000 POWER [1131:7133]
24 18 -> BMK MPEX No Tuner
25 19 -> Compro VideoMate TV [185b:c100]
26 20 -> Matrox CronosPlus [102B:48d0]
27 21 -> 10MOONS PCI TV CAPTURE CARD [1131:2001]
28 22 -> AverMedia M156 / Medion 2819 [1461:a70b]
29 23 -> BMK MPEX Tuner
30 24 -> KNC One TV-Station DVR [1894:a006]
31 25 -> ASUS TV-FM 7133 [1043:4843]
32 26 -> Pinnacle PCTV Stereo (saa7134) [11bd:002b]
33 27 -> Manli MuchTV M-TV002
34 28 -> Manli MuchTV M-TV001
35 29 -> Nagase Sangyo TransGear 3000TV [1461:050c]
36 30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM) [1019:4cb4]
37 31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
38 32 -> AVACS SmartTV
39 33 -> AVerMedia DVD EZMaker [1461:10ff]
40 34 -> Noval Prime TV 7133
41 35 -> AverMedia AverTV Studio 305 [1461:2115]
42 36 -> UPMOST PURPLE TV [12ab:0800]
43 37 -> Items MuchTV Plus / IT-005
44 38 -> Terratec Cinergy 200 TV [153b:1152]
45 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212,5169:1502]
46 40 -> Compro VideoMate TV PVR/FM [185b:c100]
47 41 -> Compro VideoMate TV Gold+ [185b:c100]
48 42 -> Sabrent SBT-TVFM (saa7130)
49 43 -> :Zolid Xpert TV7134
50 44 -> Empire PCI TV-Radio LE
51 45 -> Avermedia AVerTV Studio 307 [1461:9715]
52 46 -> AVerMedia Cardbus TV/Radio (E500) [1461:d6ee]
53 47 -> Terratec Cinergy 400 mobile [153b:1162]
54 48 -> Terratec Cinergy 600 TV MK3 [153b:1158]
55 49 -> Compro VideoMate Gold+ Pal [185b:c200]
56 50 -> Pinnacle PCTV 300i DVB-T + PAL [11bd:002d]
57 51 -> ProVideo PV952 [1540:9524]
58 52 -> AverMedia AverTV/305 [1461:2108]
59 53 -> ASUS TV-FM 7135 [1043:4845]
60 54 -> LifeView FlyTV Platinum FM / Gold [5168:0214,5168:5214,1489:0214,5168:0304]
61 55 -> LifeView FlyDVB-T DUO / MSI TV@nywhere Duo [5168:0306,4E42:0306]
62 56 -> Avermedia AVerTV 307 [1461:a70a]
63 57 -> Avermedia AVerTV GO 007 FM [1461:f31f]
64 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370]
65 59 -> Kworld/Tevion V-Stream Xpert TV PVR7134
66 60 -> LifeView/Typhoon/Genius FlyDVB-T Duo Cardbus [5168:0502,4e42:0502,1489:0502]
67 61 -> Philips TOUGH DVB-T reference design [1131:2004]
68 62 -> Compro VideoMate TV Gold+II
69 63 -> Kworld Xpert TV PVR7134
70 64 -> FlyTV mini Asus Digimatrix [1043:0210]
71 65 -> V-Stream Studio TV Terminator
72 66 -> Yuan TUN-900 (saa7135)
73 67 -> Beholder BeholdTV 409 FM [0000:4091]
74 68 -> GoTView 7135 PCI [5456:7135]
75 69 -> Philips EUROPA V3 reference design [1131:2004]
76 70 -> Compro Videomate DVB-T300 [185b:c900]
77 71 -> Compro Videomate DVB-T200 [185b:c901]
78 72 -> RTD Embedded Technologies VFG7350 [1435:7350]
79 73 -> RTD Embedded Technologies VFG7330 [1435:7330]
80 74 -> LifeView FlyTV Platinum Mini2 [14c0:1212]
81 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044]
82 76 -> SKNet MonsterTV Mobile [1131:4ee9]
83 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e]
84 78 -> ASUSTeK P7131 Dual [1043:4862]
85 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
86 80 -> ASUS Digimatrix TV [1043:0210]
87 81 -> Philips Tiger reference design [1131:2018]
88 82 -> MSI TV@Anywhere plus [1462:6231,1462:8624]
89 83 -> Terratec Cinergy 250 PCI TV [153b:1160]
90 84 -> LifeView FlyDVB Trio [5168:0319]
91 85 -> AverTV DVB-T 777 [1461:2c05,1461:2c05]
92 86 -> LifeView FlyDVB-T / Genius VideoWonder DVB-T [5168:0301,1489:0301]
93 87 -> ADS Instant TV Duo Cardbus PTV331 [0331:1421]
94 88 -> Tevion/KWorld DVB-T 220RF [17de:7201]
95 89 -> ELSA EX-VISION 700TV [1048:226c]
96 90 -> Kworld ATSC110/115 [17de:7350,17de:7352]
97 91 -> AVerMedia A169 B [1461:7360]
98 92 -> AVerMedia A169 B1 [1461:6360]
99 93 -> Medion 7134 Bridge #2 [16be:0005]
100 94 -> LifeView FlyDVB-T Hybrid Cardbus/MSI TV @nywhere A/D NB [5168:3306,5168:3502,5168:3307,4e42:3502]
101 95 -> LifeView FlyVIDEO3000 (NTSC) [5169:0138]
102 96 -> Medion Md8800 Quadro [16be:0007,16be:0008,16be:000d]
103 97 -> LifeView FlyDVB-S /Acorp TV134DS [5168:0300,4e42:0300]
104 98 -> Proteus Pro 2309 [0919:2003]
105 99 -> AVerMedia TV Hybrid A16AR [1461:2c00]
106 100 -> Asus Europa2 OEM [1043:4860]
107 101 -> Pinnacle PCTV 310i [11bd:002f]
108 102 -> Avermedia AVerTV Studio 507 [1461:9715]
109 103 -> Compro Videomate DVB-T200A
110 104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6700,0070:6701,0070:6702,0070:6703,0070:6704,0070:6705]
111 105 -> Terratec Cinergy HT PCMCIA [153b:1172]
112 106 -> Encore ENLTV [1131:2342,1131:2341,3016:2344]
113 107 -> Encore ENLTV-FM [1131:230f]
114 108 -> Terratec Cinergy HT PCI [153b:1175]
115 109 -> Philips Tiger - S Reference design
116 110 -> Avermedia M102 [1461:f31e]
117 111 -> ASUS P7131 4871 [1043:4871]
118 112 -> ASUSTeK P7131 Hybrid [1043:4876]
119 113 -> Elitegroup ECS TVP3XP FM1246 Tuner Card (PAL,FM) [1019:4cb6]
120 114 -> KWorld DVB-T 210 [17de:7250]
121 115 -> Sabrent PCMCIA TV-PCB05 [0919:2003]
122 116 -> 10MOONS TM300 TV Card [1131:2304]
123 117 -> Avermedia Super 007 [1461:f01d]
124 118 -> Beholder BeholdTV 401 [0000:4016]
125 119 -> Beholder BeholdTV 403 [0000:4036]
126 120 -> Beholder BeholdTV 403 FM [0000:4037]
127 121 -> Beholder BeholdTV 405 [0000:4050]
128 122 -> Beholder BeholdTV 405 FM [0000:4051]
129 123 -> Beholder BeholdTV 407 [0000:4070]
130 124 -> Beholder BeholdTV 407 FM [0000:4071]
131 125 -> Beholder BeholdTV 409 [0000:4090]
132 126 -> Beholder BeholdTV 505 FM [5ace:5050]
133 127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090]
134 128 -> Beholder BeholdTV Columbus TV/FM [0000:5201]
135 129 -> Beholder BeholdTV 607 FM [5ace:6070]
136 130 -> Beholder BeholdTV M6 [5ace:6190]
137 131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
138 132 -> Genius TVGO AM11MCE
139 133 -> NXP Snake DVB-S reference design
140 134 -> Medion/Creatix CTX953 Hybrid [16be:0010]
141 135 -> MSI TV@nywhere A/D v1.1 [1462:8625]
142 136 -> AVerMedia Cardbus TV/Radio (E506R) [1461:f436]
143 137 -> AVerMedia Hybrid TV/Radio (A16D) [1461:f936]
144 138 -> Avermedia M115 [1461:a836]
145 139 -> Compro VideoMate T750 [185b:c900]
146 140 -> Avermedia DVB-S Pro A700 [1461:a7a1]
147 141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2]
148 142 -> Beholder BeholdTV H6 [5ace:6290]
149 143 -> Beholder BeholdTV M63 [5ace:6191]
150 144 -> Beholder BeholdTV M6 Extra [5ace:6193]
151 145 -> AVerMedia MiniPCI DVB-T Hybrid M103 [1461:f636,1461:f736]
152 146 -> ASUSTeK P7131 Analog
153 147 -> Asus Tiger 3in1 [1043:4878]
154 148 -> Encore ENLTV-FM v5.3 [1a7f:2008]
155 149 -> Avermedia PCI pure analog (M135A) [1461:f11d]
156 150 -> Zogis Real Angel 220
157 151 -> ADS Tech Instant HDTV [1421:0380]
158 152 -> Asus Tiger Rev:1.00 [1043:4857]
159 153 -> Kworld Plus TV Analog Lite PCI [17de:7128]
160 154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d]
161 155 -> Hauppauge WinTV-HVR1150 ATSC/QAM-Hybrid [0070:6706,0070:6708]
162 156 -> Hauppauge WinTV-HVR1120 DVB-T/Hybrid [0070:6707,0070:6709,0070:670a]
163 157 -> Avermedia AVerTV Studio 507UA [1461:a11b]
164 158 -> AVerMedia Cardbus TV/Radio (E501R) [1461:b7e9]
165 159 -> Beholder BeholdTV 505 RDS [0000:505B]
166 160 -> Beholder BeholdTV 507 RDS [0000:5071]
167 161 -> Beholder BeholdTV 507 RDS [0000:507B]
168 162 -> Beholder BeholdTV 607 FM [5ace:6071]
169 163 -> Beholder BeholdTV 609 FM [5ace:6090]
170 164 -> Beholder BeholdTV 609 FM [5ace:6091]
171 165 -> Beholder BeholdTV 607 RDS [5ace:6072]
172 166 -> Beholder BeholdTV 607 RDS [5ace:6073]
173 167 -> Beholder BeholdTV 609 RDS [5ace:6092]
174 168 -> Beholder BeholdTV 609 RDS [5ace:6093]
175 169 -> Compro VideoMate S350/S300 [185b:c900]
176 170 -> AverMedia AverTV Studio 505 [1461:a115]
177 171 -> Beholder BeholdTV X7 [5ace:7595]
178 172 -> RoverMedia TV Link Pro FM [19d1:0138]
179 173 -> Zolid Hybrid TV Tuner PCI [1131:2004]
180 174 -> Asus Europa Hybrid OEM [1043:4847]
181 175 -> Leadtek Winfast DTV1000S [107d:6655]
182 176 -> Beholder BeholdTV 505 RDS [0000:5051]
183 177 -> Hawell HW-404M7
184 178 -> Beholder BeholdTV H7 [5ace:7190]
185 179 -> Beholder BeholdTV A7 [5ace:7090]
186 180 -> Avermedia PCI M733A [1461:4155,1461:4255]
187 181 -> TechoTrend TT-budget T-3000 [13c2:2804]
188 182 -> Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid [17de:b136]
189 183 -> Compro VideoMate Vista M1F [185b:c900]
190 184 -> Encore ENLTV-FM 3 [1a7f:2108]
191 185 -> MagicPro ProHDTV Pro2 DMB-TH/Hybrid [17de:d136]
192 186 -> Beholder BeholdTV 501 [5ace:5010]
193 187 -> Beholder BeholdTV 503 FM [5ace:5030]
194 188 -> Sensoray 811/911 [6000:0811,6000:0911]
195 189 -> Kworld PC150-U [17de:a134]
196 190 -> Asus My Cinema PS3-100 [1043:48cd]
197 191 -> Hawell HW-9004V1
198 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
199 193 -> WIS Voyager or compatible [1905:7007]
200 194 -> AverMedia AverTV/505 [1461:a10a]
201 195 -> Leadtek Winfast TV2100 FM [107d:6f3a]
202 196 -> SnaZio* TVPVR PRO [1779:13cf]
diff --git a/Documentation/media/v4l-drivers/saa7134.rst b/Documentation/media/v4l-drivers/saa7134.rst
new file mode 100644
index 000000000000..36b2ee9e0fdc
--- /dev/null
+++ b/Documentation/media/v4l-drivers/saa7134.rst
@@ -0,0 +1,113 @@
1The saa7134 driver
2==================
3
4Author Gerd Hoffmann
5
6
7This is a v4l2/oss device driver for saa7130/33/34/35 based capture / TV
8boards. See http://www.semiconductors.philips.com/pip/saa7134hl for a
9description.
10
11
12Status
13------
14
15Almost everything is working. video, sound, tuner, radio, mpeg ts, ...
16
17As with bttv, card-specific tweaks are needed. Check CARDLIST for a
18list of known TV cards and saa7134-cards.c for the drivers card
19configuration info.
20
21
22Build
23-----
24
25Pick up videodev + v4l2 patches from http://bytesex.org/patches/.
26Configure, build, install + boot the new kernel. You'll need at least
27these config options:
28
29.. code-block:: none
30
31 CONFIG_I2C=m
32 CONFIG_VIDEO_DEV=m
33
34Type "make" to build the driver now. "make install" installs the
35driver. "modprobe saa7134" should load it. Depending on the card you
36might have to pass card=<nr> as insmod option, check CARDLIST for
37valid choices.
38
39
40Changes / Fixes
41---------------
42
43Please mail me unified diffs ("diff -u") with your changes, and don't
44forget to tell me what it changes / which problem it fixes / whatever
45it is good for ...
46
47
48Known Problems
49--------------
50
51* The tuner for the flyvideos isn't detected automatically and the
52 default might not work for you depending on which version you have.
53 There is a tuner= insmod option to override the driver's default.
54
55Card Variations:
56----------------
57
58Cards can use either of these two crystals (xtal):
59
60- 32.11 MHz -> .audio_clock=0x187de7
61- 24.576MHz -> .audio_clock=0x200000 (xtal * .audio_clock = 51539600)
62
63Some details about 30/34/35:
64
65- saa7130 - low-price chip, doesn't have mute, that is why all those
66 cards should have .mute field defined in their tuner structure.
67
68- saa7134 - usual chip
69
70- saa7133/35 - saa7135 is probably a marketing decision, since all those
71 chips identifies itself as 33 on pci.
72
73LifeView GPIOs
74--------------
75
76This section was authored by: Peter Missel <peter.missel@onlinehome.de>
77
78- LifeView FlyTV Platinum FM (LR214WF)
79
80 - GP27 MDT2005 PB4 pin 10
81 - GP26 MDT2005 PB3 pin 9
82 - GP25 MDT2005 PB2 pin 8
83 - GP23 MDT2005 PB1 pin 7
84 - GP22 MDT2005 PB0 pin 6
85 - GP21 MDT2005 PB5 pin 11
86 - GP20 MDT2005 PB6 pin 12
87 - GP19 MDT2005 PB7 pin 13
88 - nc MDT2005 PA3 pin 2
89 - Remote MDT2005 PA2 pin 1
90 - GP18 MDT2005 PA1 pin 18
91 - nc MDT2005 PA0 pin 17 strap low
92 - GP17 Strap "GP7"=High
93 - GP16 Strap "GP6"=High
94
95 - 0=Radio 1=TV
96 - Drives SA630D ENCH1 and HEF4052 A1 pinsto do FM radio through
97 SIF input
98
99 - GP15 nc
100 - GP14 nc
101 - GP13 nc
102 - GP12 Strap "GP5" = High
103 - GP11 Strap "GP4" = High
104 - GP10 Strap "GP3" = High
105 - GP09 Strap "GP2" = Low
106 - GP08 Strap "GP1" = Low
107 - GP07.00 nc
108
109Credits
110-------
111
112andrew.stevens@philips.com + werner.leeb@philips.com for providing
113saa7134 hardware specs and sample board.
diff --git a/Documentation/media/v4l-drivers/saa7164-cardlist.rst b/Documentation/media/v4l-drivers/saa7164-cardlist.rst
new file mode 100644
index 000000000000..b937836cd54c
--- /dev/null
+++ b/Documentation/media/v4l-drivers/saa7164-cardlist.rst
@@ -0,0 +1,19 @@
1SAA7134 cards list
2==================
3
4.. code-block:: none
5
6 0 -> Unknown
7 1 -> Generic Rev2
8 2 -> Generic Rev3
9 3 -> Hauppauge WinTV-HVR2250 [0070:8880,0070:8810]
10 4 -> Hauppauge WinTV-HVR2200 [0070:8980]
11 5 -> Hauppauge WinTV-HVR2200 [0070:8900]
12 6 -> Hauppauge WinTV-HVR2200 [0070:8901]
13 7 -> Hauppauge WinTV-HVR2250 [0070:8891,0070:8851]
14 8 -> Hauppauge WinTV-HVR2250 [0070:88A1]
15 9 -> Hauppauge WinTV-HVR2200 [0070:8940]
16 10 -> Hauppauge WinTV-HVR2200 [0070:8953]
17 11 -> Hauppauge WinTV-HVR2255(proto)
18 12 -> Hauppauge WinTV-HVR2255 [0070:f111]
19 13 -> Hauppauge WinTV-HVR2205 [0070:f123,0070:f120]
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/media/v4l-drivers/sh_mobile_ceu_camera.rst
index 1e96ce6e2d2f..e40ffea7708c 100644
--- a/Documentation/video4linux/sh_mobile_ceu_camera.txt
+++ b/Documentation/media/v4l-drivers/sh_mobile_ceu_camera.rst
@@ -1,5 +1,7 @@
1 Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver 1Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
2 ======================================================================= 2=======================================================================
3
4Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
3 5
4Terminology 6Terminology
5----------- 7-----------
@@ -12,29 +14,31 @@ combined scales: sensor_scale * host_scale
12Generic scaling / cropping scheme 14Generic scaling / cropping scheme
13--------------------------------- 15---------------------------------
14 16
15-1-- 17.. code-block:: none
16| 18
17-2-- -\ 19 -1--
18| --\ 20 |
19| --\ 21 -2-- -\
20+-5-- . -- -3-- -\ 22 | --\
21| `... -\ 23 | --\
22| `... -4-- . - -7.. 24 +-5-- . -- -3-- -\
23| `. 25 | `... -\
24| `. .6-- 26 | `... -4-- . - -7..
25| 27 | `.
26| . .6'- 28 | `. .6--
27| .´ 29 |
28| ... -4'- .´ 30 | . .6'-
29| ...´ - -7'. 31 | .´
30+-5'- .´ -/ 32 | ... -4'- .´
31| -- -3'- -/ 33 | ...´ - -7'.
32| --/ 34 +-5'- .´ -/
33| --/ 35 | -- -3'- -/
34-2'- -/ 36 | --/
35| 37 | --/
36| 38 -2'- -/
37-1'- 39 |
40 |
41 -1'-
38 42
39In the above chart minuses and slashes represent "real" data amounts, points and 43In the above chart minuses and slashes represent "real" data amounts, points and
40accents represent "useful" data, basically, CEU scaled and cropped output, 44accents represent "useful" data, basically, CEU scaled and cropped output,
@@ -134,6 +138,3 @@ Cropping is performed in the following 6 steps:
1345. Calculate and apply host scale = (6' - 6) / (4' - 4) 1385. Calculate and apply host scale = (6' - 6) / (4' - 4)
135 139
1366. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5) 1406. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5)
137
138--
139Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
diff --git a/Documentation/video4linux/si470x.txt b/Documentation/media/v4l-drivers/si470x.rst
index 98c32925eb39..955d8ca159fe 100644
--- a/Documentation/video4linux/si470x.txt
+++ b/Documentation/media/v4l-drivers/si470x.rst
@@ -1,10 +1,14 @@
1Driver for USB radios for the Silicon Labs Si470x FM Radio Receivers 1.. include:: <isonum.txt>
2 2
3Copyright (c) 2009 Tobias Lorenz <tobias.lorenz@gmx.net> 3The Silicon Labs Si470x FM Radio Receivers driver
4=================================================
5
6Copyright |copy| 2009 Tobias Lorenz <tobias.lorenz@gmx.net>
4 7
5 8
6Information from Silicon Labs 9Information from Silicon Labs
7============================= 10-----------------------------
11
8Silicon Laboratories is the manufacturer of the radio ICs, that nowadays are the 12Silicon Laboratories is the manufacturer of the radio ICs, that nowadays are the
9most often used radio receivers in cell phones. Usually they are connected with 13most often used radio receivers in cell phones. Usually they are connected with
10I2C. But SiLabs also provides a reference design, which integrates this IC, 14I2C. But SiLabs also provides a reference design, which integrates this IC,
@@ -16,9 +20,11 @@ http://www.silabs.com/usbradio
16 20
17 21
18Supported ICs 22Supported ICs
19============= 23-------------
24
20The following ICs have a very similar register set, so that they are or will be 25The following ICs have a very similar register set, so that they are or will be
21supported somewhen by the driver: 26supported somewhen by the driver:
27
22- Si4700: FM radio receiver 28- Si4700: FM radio receiver
23- Si4701: FM radio receiver, RDS Support 29- Si4701: FM radio receiver, RDS Support
24- Si4702: FM radio receiver 30- Si4702: FM radio receiver
@@ -30,14 +36,17 @@ supported somewhen by the driver:
30- Si4707: Dedicated weather band radio receiver with SAME decoder, RDS Support 36- Si4707: Dedicated weather band radio receiver with SAME decoder, RDS Support
31- Si4708: Smallest FM receivers 37- Si4708: Smallest FM receivers
32- Si4709: Smallest FM receivers, RDS Support 38- Si4709: Smallest FM receivers, RDS Support
39
33More information on these can be downloaded here: 40More information on these can be downloaded here:
34http://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx 41http://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx
35 42
36 43
37Supported USB devices 44Supported USB devices
38===================== 45---------------------
46
39Currently the following USB radios (vendor:product) with the Silicon Labs si470x 47Currently the following USB radios (vendor:product) with the Silicon Labs si470x
40chips are known to work: 48chips are known to work:
49
41- 10c4:818a: Silicon Labs USB FM Radio Reference Design 50- 10c4:818a: Silicon Labs USB FM Radio Reference Design
42- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) 51- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
43- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) 52- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
@@ -45,8 +54,10 @@ chips are known to work:
45 54
46 55
47Software 56Software
48======== 57--------
58
49Testing is usually done with most application under Debian/testing: 59Testing is usually done with most application under Debian/testing:
60
50- fmtools - Utility for managing FM tuner cards 61- fmtools - Utility for managing FM tuner cards
51- gnomeradio - FM-radio tuner for the GNOME desktop 62- gnomeradio - FM-radio tuner for the GNOME desktop
52- gradio - GTK FM radio tuner 63- gradio - GTK FM radio tuner
@@ -54,8 +65,12 @@ Testing is usually done with most application under Debian/testing:
54- radio - ncurses-based radio application 65- radio - ncurses-based radio application
55- mplayer - The Ultimate Movie Player For Linux 66- mplayer - The Ultimate Movie Player For Linux
56- v4l2-ctl - Collection of command line video4linux utilities 67- v4l2-ctl - Collection of command line video4linux utilities
68
57For example, you can use: 69For example, you can use:
58v4l2-ctl -d /dev/radio0 --set-ctrl=volume=10,mute=0 --set-freq=95.21 --all 70
71.. code-block:: none
72
73 v4l2-ctl -d /dev/radio0 --set-ctrl=volume=10,mute=0 --set-freq=95.21 --all
59 74
60There is also a library libv4l, which can be used. It's going to have a function 75There is also a library libv4l, which can be used. It's going to have a function
61for frequency seeking, either by using hardware functionality as in radio-si470x 76for frequency seeking, either by using hardware functionality as in radio-si470x
@@ -69,30 +84,48 @@ There is currently no project for making TMC sentences human readable.
69 84
70 85
71Audio Listing 86Audio Listing
72============= 87-------------
88
73USB Audio is provided by the ALSA snd_usb_audio module. It is recommended to 89USB Audio is provided by the ALSA snd_usb_audio module. It is recommended to
74also select SND_USB_AUDIO, as this is required to get sound from the radio. For 90also select SND_USB_AUDIO, as this is required to get sound from the radio. For
75listing you have to redirect the sound, for example using one of the following 91listing you have to redirect the sound, for example using one of the following
76commands. Please adjust the audio devices to your needs (/dev/dsp* and hw:x,x). 92commands. Please adjust the audio devices to your needs (/dev/dsp* and hw:x,x).
77 93
78If you just want to test audio (very poor quality): 94If you just want to test audio (very poor quality):
79cat /dev/dsp1 > /dev/dsp 95
96.. code-block:: none
97
98 cat /dev/dsp1 > /dev/dsp
80 99
81If you use sox + OSS try: 100If you use sox + OSS try:
82sox -2 --endian little -r 96000 -t oss /dev/dsp1 -t oss /dev/dsp 101
102.. code-block:: none
103
104 sox -2 --endian little -r 96000 -t oss /dev/dsp1 -t oss /dev/dsp
105
83or using sox + alsa: 106or using sox + alsa:
84sox --endian little -c 2 -S -r 96000 -t alsa hw:1 -t alsa -r 96000 hw:0 107
108.. code-block:: none
109
110 sox --endian little -c 2 -S -r 96000 -t alsa hw:1 -t alsa -r 96000 hw:0
85 111
86If you use arts try: 112If you use arts try:
87arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B - 113
114.. code-block:: none
115
116 arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B -
88 117
89If you use mplayer try: 118If you use mplayer try:
90mplayer -radio adevice=hw=1.0:arate=96000 \ 119
91 -rawaudio rate=96000 \ 120.. code-block:: none
92 radio://<frequency>/capture 121
122 mplayer -radio adevice=hw=1.0:arate=96000 \
123 -rawaudio rate=96000 \
124 radio://<frequency>/capture
93 125
94Module Parameters 126Module Parameters
95================= 127-----------------
128
96After loading the module, you still have access to some of them in the sysfs 129After loading the module, you still have access to some of them in the sysfs
97mount under /sys/module/radio_si470x/parameters. The contents of read-only files 130mount under /sys/module/radio_si470x/parameters. The contents of read-only files
98(0444) are not updated, even if space, band and de are changed using private 131(0444) are not updated, even if space, band and de are changed using private
@@ -100,7 +133,8 @@ video controls. The others are runtime changeable.
100 133
101 134
102Errors 135Errors
103====== 136------
137
104Increase tune_timeout, if you often get -EIO errors. 138Increase tune_timeout, if you often get -EIO errors.
105 139
106When timed out or band limit is reached, hw_freq_seek returns -EAGAIN. 140When timed out or band limit is reached, hw_freq_seek returns -EAGAIN.
@@ -109,7 +143,8 @@ If you get any errors from snd_usb_audio, please report them to the ALSA people.
109 143
110 144
111Open Issues 145Open Issues
112=========== 146-----------
147
113V4L minor device allocation and parameter setting is not perfect. A solution is 148V4L minor device allocation and parameter setting is not perfect. A solution is
114currently under discussion. 149currently under discussion.
115 150
@@ -125,5 +160,6 @@ functions in the kernel.
125 160
126 161
127Other useful information and links 162Other useful information and links
128================================== 163----------------------------------
164
129http://www.silabs.com/usbradio 165http://www.silabs.com/usbradio
diff --git a/Documentation/media/v4l-drivers/si4713.rst b/Documentation/media/v4l-drivers/si4713.rst
new file mode 100644
index 000000000000..3022e7cfe9a8
--- /dev/null
+++ b/Documentation/media/v4l-drivers/si4713.rst
@@ -0,0 +1,190 @@
1.. include:: <isonum.txt>
2
3The Silicon Labs Si4713 FM Radio Transmitter Driver
4===================================================
5
6Copyright |copy| 2009 Nokia Corporation
7
8Contact: Eduardo Valentin <eduardo.valentin@nokia.com>
9
10
11Information about the Device
12----------------------------
13
14This chip is a Silicon Labs product. It is a I2C device, currently on 0x63 address.
15Basically, it has transmission and signal noise level measurement features.
16
17The Si4713 integrates transmit functions for FM broadcast stereo transmission.
18The chip also allows integrated receive power scanning to identify low signal
19power FM channels.
20
21The chip is programmed using commands and responses. There are also several
22properties which can change the behavior of this chip.
23
24Users must comply with local regulations on radio frequency (RF) transmission.
25
26Device driver description
27-------------------------
28
29There are two modules to handle this device. One is a I2C device driver
30and the other is a platform driver.
31
32The I2C device driver exports a v4l2-subdev interface to the kernel.
33All properties can also be accessed by v4l2 extended controls interface, by
34using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
35
36The platform device driver exports a v4l2 radio device interface to user land.
37So, it uses the I2C device driver as a sub device in order to send the user
38commands to the actual device. Basically it is a wrapper to the I2C device driver.
39
40Applications can use v4l2 radio API to specify frequency of operation, mute state,
41etc. But mostly of its properties will be present in the extended controls.
42
43When the v4l2 mute property is set to 1 (true), the driver will turn the chip off.
44
45Properties description
46----------------------
47
48The properties can be accessed using v4l2 extended controls.
49Here is an output from v4l2-ctl util:
50
51.. code-block:: none
52
53 / # v4l2-ctl -d /dev/radio0 --all -L
54 Driver Info:
55 Driver name : radio-si4713
56 Card type : Silicon Labs Si4713 Modulator
57 Bus info :
58 Driver version: 0
59 Capabilities : 0x00080800
60 RDS Output
61 Modulator
62 Audio output: 0 (FM Modulator Audio Out)
63 Frequency: 1408000 (88.000000 MHz)
64 Video Standard = 0x00000000
65 Modulator:
66 Name : FM Modulator
67 Capabilities : 62.5 Hz stereo rds
68 Frequency range : 76.0 MHz - 108.0 MHz
69 Subchannel modulation: stereo+rds
70
71 User Controls
72
73 mute (bool) : default=1 value=0
74
75 FM Radio Modulator Controls
76
77 rds_signal_deviation (int) : min=0 max=90000 step=10 default=200 value=200 flags=slider
78 rds_program_id (int) : min=0 max=65535 step=1 default=0 value=0
79 rds_program_type (int) : min=0 max=31 step=1 default=0 value=0
80 rds_ps_name (str) : min=0 max=96 step=8 value='si4713 '
81 rds_radio_text (str) : min=0 max=384 step=32 value=''
82 audio_limiter_feature_enabled (bool) : default=1 value=1
83 audio_limiter_release_time (int) : min=250 max=102390 step=50 default=5010 value=5010 flags=slider
84 audio_limiter_deviation (int) : min=0 max=90000 step=10 default=66250 value=66250 flags=slider
85 audio_compression_feature_enabl (bool) : default=1 value=1
86 audio_compression_gain (int) : min=0 max=20 step=1 default=15 value=15 flags=slider
87 audio_compression_threshold (int) : min=-40 max=0 step=1 default=-40 value=-40 flags=slider
88 audio_compression_attack_time (int) : min=0 max=5000 step=500 default=0 value=0 flags=slider
89 audio_compression_release_time (int) : min=100000 max=1000000 step=100000 default=1000000 value=1000000 flags=slider
90 pilot_tone_feature_enabled (bool) : default=1 value=1
91 pilot_tone_deviation (int) : min=0 max=90000 step=10 default=6750 value=6750 flags=slider
92 pilot_tone_frequency (int) : min=0 max=19000 step=1 default=19000 value=19000 flags=slider
93 pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
94 tune_power_level (int) : min=0 max=120 step=1 default=88 value=88 flags=slider
95 tune_antenna_capacitor (int) : min=0 max=191 step=1 default=0 value=110 flags=slider
96
97Here is a summary of them:
98
99* Pilot is an audible tone sent by the device.
100
101- pilot_frequency - Configures the frequency of the stereo pilot tone.
102- pilot_deviation - Configures pilot tone frequency deviation level.
103- pilot_enabled - Enables or disables the pilot tone feature.
104
105* The si4713 device is capable of applying audio compression to the
106 transmitted signal.
107
108- acomp_enabled - Enables or disables the audio dynamic range control feature.
109- acomp_gain - Sets the gain for audio dynamic range control.
110- acomp_threshold - Sets the threshold level for audio dynamic range control.
111- acomp_attack_time - Sets the attack time for audio dynamic range control.
112- acomp_release_time - Sets the release time for audio dynamic range control.
113
114* Limiter setups audio deviation limiter feature. Once a over deviation occurs,
115 it is possible to adjust the front-end gain of the audio input and always
116 prevent over deviation.
117
118- limiter_enabled - Enables or disables the limiter feature.
119- limiter_deviation - Configures audio frequency deviation level.
120- limiter_release_time - Sets the limiter release time.
121
122* Tuning power
123
124- power_level - Sets the output power level for signal transmission.
125 antenna_capacitor - This selects the value of antenna tuning capacitor
126 manually or automatically if set to zero.
127
128* RDS related
129
130- rds_ps_name - Sets the RDS ps name field for transmission.
131- rds_radio_text - Sets the RDS radio text for transmission.
132- rds_pi - Sets the RDS PI field for transmission.
133- rds_pty - Sets the RDS PTY field for transmission.
134
135* Region related
136
137- preemphasis - sets the preemphasis to be applied for transmission.
138
139RNL
140---
141
142This device also has an interface to measure received noise level. To do that, you should
143ioctl the device node. Here is an code of example:
144
145.. code-block:: none
146
147 int main (int argc, char *argv[])
148 {
149 struct si4713_rnl rnl;
150 int fd = open("/dev/radio0", O_RDWR);
151 int rval;
152
153 if (argc < 2)
154 return -EINVAL;
155
156 if (fd < 0)
157 return fd;
158
159 sscanf(argv[1], "%d", &rnl.frequency);
160
161 rval = ioctl(fd, SI4713_IOC_MEASURE_RNL, &rnl);
162 if (rval < 0)
163 return rval;
164
165 printf("received noise level: %d\n", rnl.rnl);
166
167 close(fd);
168 }
169
170The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under
171include/linux/platform_data/media/si4713.h.
172
173Stereo/Mono and RDS subchannels
174-------------------------------
175
176The device can also be configured using the available sub channels for
177transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly.
178Refer to the V4L2 API specification for proper use of this ioctl.
179
180Testing
181-------
182Testing is usually done with v4l2-ctl utility for managing FM tuner cards.
183The tool can be found in v4l-dvb repository under v4l2-apps/util directory.
184
185Example for setting rds ps name:
186
187.. code-block:: none
188
189 # v4l2-ctl -d /dev/radio0 --set-ctrl=rds_ps_name="Dummy"
190
diff --git a/Documentation/media/v4l-drivers/si476x.rst b/Documentation/media/v4l-drivers/si476x.rst
new file mode 100644
index 000000000000..d5c07bb7524d
--- /dev/null
+++ b/Documentation/media/v4l-drivers/si476x.rst
@@ -0,0 +1,150 @@
1.. include:: <isonum.txt>
2
3
4The SI476x Driver
5=================
6
7Copyright |copy| 2013 Andrey Smirnov <andrew.smirnov@gmail.com>
8
9TODO for the driver
10-------------------
11
12- According to the SiLabs' datasheet it is possible to update the
13 firmware of the radio chip in the run-time, thus bringing it to the
14 most recent version. Unfortunately I couldn't find any mentioning of
15 the said firmware update for the old chips that I tested the driver
16 against, so for chips like that the driver only exposes the old
17 functionality.
18
19
20Parameters exposed over debugfs
21-------------------------------
22SI476x allow user to get multiple characteristics that can be very
23useful for EoL testing/RF performance estimation, parameters that have
24very little to do with V4L2 subsystem. Such parameters are exposed via
25debugfs and can be accessed via regular file I/O operations.
26
27The drivers exposes following files:
28
29* /sys/kernel/debug/<device-name>/acf
30 This file contains ACF(Automatically Controlled Features) status
31 information. The contents of the file is binary data of the
32 following layout:
33
34 ============= ============== ====================================
35 Offset Name Description
36 ============= ============== ====================================
37 0x00 blend_int Flag, set when stereo separation has
38 crossed below the blend threshold
39 0x01 hblend_int Flag, set when HiBlend cutoff
40 frequency is lower than threshold
41 0x02 hicut_int Flag, set when HiCut cutoff
42 frequency is lower than threshold
43 0x03 chbw_int Flag, set when channel filter
44 bandwidth is less than threshold
45 0x04 softmute_int Flag indicating that softmute
46 attenuation has increased above
47 softmute threshold
48 0x05 smute 0 - Audio is not soft muted
49 1 - Audio is soft muted
50 0x06 smattn Soft mute attenuation level in dB
51 0x07 chbw Channel filter bandwidth in kHz
52 0x08 hicut HiCut cutoff frequency in units of
53 100Hz
54 0x09 hiblend HiBlend cutoff frequency in units
55 of 100 Hz
56 0x10 pilot 0 - Stereo pilot is not present
57 1 - Stereo pilot is present
58 0x11 stblend Stereo blend in %
59 ============= ============== ====================================
60
61
62* /sys/kernel/debug/<device-name>/rds_blckcnt
63 This file contains statistics about RDS receptions. It's binary data
64 has the following layout:
65
66 ============= ============== ====================================
67 Offset Name Description
68 ============= ============== ====================================
69 0x00 expected Number of expected RDS blocks
70 0x02 received Number of received RDS blocks
71 0x04 uncorrectable Number of uncorrectable RDS blocks
72 ============= ============== ====================================
73
74* /sys/kernel/debug/<device-name>/agc
75 This file contains information about parameters pertaining to
76 AGC(Automatic Gain Control)
77
78 The layout is:
79
80 ============= ============== ====================================
81 Offset Name Description
82 ============= ============== ====================================
83 0x00 mxhi 0 - FM Mixer PD high threshold is
84 not tripped
85 1 - FM Mixer PD high threshold is
86 tripped
87 0x01 mxlo ditto for FM Mixer PD low
88 0x02 lnahi ditto for FM LNA PD high
89 0x03 lnalo ditto for FM LNA PD low
90 0x04 fmagc1 FMAGC1 attenuator resistance
91 (see datasheet for more detail)
92 0x05 fmagc2 ditto for FMAGC2
93 0x06 pgagain PGA gain in dB
94 0x07 fmwblang FM/WB LNA Gain in dB
95 ============= ============== ====================================
96
97* /sys/kernel/debug/<device-name>/rsq
98 This file contains information about parameters pertaining to
99 RSQ(Received Signal Quality)
100
101 The layout is:
102
103 ============= ============== ====================================
104 Offset Name Description
105 ============= ============== ====================================
106 0x00 multhint 0 - multipath value has not crossed
107 the Multipath high threshold
108 1 - multipath value has crossed
109 the Multipath high threshold
110 0x01 multlint ditto for Multipath low threshold
111 0x02 snrhint 0 - received signal's SNR has not
112 crossed high threshold
113 1 - received signal's SNR has
114 crossed high threshold
115 0x03 snrlint ditto for low threshold
116 0x04 rssihint ditto for RSSI high threshold
117 0x05 rssilint ditto for RSSI low threshold
118 0x06 bltf Flag indicating if seek command
119 reached/wrapped seek band limit
120 0x07 snr_ready Indicates that SNR metrics is ready
121 0x08 rssiready ditto for RSSI metrics
122 0x09 injside 0 - Low-side injection is being used
123 1 - High-side injection is used
124 0x10 afcrl Flag indicating if AFC rails
125 0x11 valid Flag indicating if channel is valid
126 0x12 readfreq Current tuned frequency
127 0x14 freqoff Signed frequency offset in units of
128 2ppm
129 0x15 rssi Signed value of RSSI in dBuV
130 0x16 snr Signed RF SNR in dB
131 0x17 issi Signed Image Strength Signal
132 indicator
133 0x18 lassi Signed Low side adjacent Channel
134 Strength indicator
135 0x19 hassi ditto fpr High side
136 0x20 mult Multipath indicator
137 0x21 dev Frequency deviation
138 0x24 assi Adjacent channel SSI
139 0x25 usn Ultrasonic noise indicator
140 0x26 pilotdev Pilot deviation in units of 100 Hz
141 0x27 rdsdev ditto for RDS
142 0x28 assidev ditto for ASSI
143 0x29 strongdev Frequency deviation
144 0x30 rdspi RDS PI code
145 ============= ============== ====================================
146
147* /sys/kernel/debug/<device-name>/rsq_primary
148 This file contains information about parameters pertaining to
149 RSQ(Received Signal Quality) for primary tuner only. Layout is as
150 the one above.
diff --git a/Documentation/video4linux/soc-camera.txt b/Documentation/media/v4l-drivers/soc-camera.rst
index 84f41cf1f3e8..ba0c15dd092c 100644
--- a/Documentation/video4linux/soc-camera.txt
+++ b/Documentation/media/v4l-drivers/soc-camera.rst
@@ -1,5 +1,7 @@
1 Soc-Camera Subsystem 1The Soc-Camera Drivers
2 ==================== 2======================
3
4Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
3 5
4Terminology 6Terminology
5----------- 7-----------
@@ -45,10 +47,14 @@ Camera host API
45 47
46A host camera driver is registered using the 48A host camera driver is registered using the
47 49
48soc_camera_host_register(struct soc_camera_host *); 50.. code-block:: none
51
52 soc_camera_host_register(struct soc_camera_host *);
49 53
50function. The host object can be initialized as follows: 54function. The host object can be initialized as follows:
51 55
56.. code-block:: none
57
52 struct soc_camera_host *ici; 58 struct soc_camera_host *ici;
53 ici->drv_name = DRV_NAME; 59 ici->drv_name = DRV_NAME;
54 ici->ops = &camera_host_ops; 60 ici->ops = &camera_host_ops;
@@ -58,18 +64,20 @@ function. The host object can be initialized as follows:
58 64
59All camera host methods are passed in a struct soc_camera_host_ops: 65All camera host methods are passed in a struct soc_camera_host_ops:
60 66
61static struct soc_camera_host_ops camera_host_ops = { 67.. code-block:: none
62 .owner = THIS_MODULE, 68
63 .add = camera_add_device, 69 static struct soc_camera_host_ops camera_host_ops = {
64 .remove = camera_remove_device, 70 .owner = THIS_MODULE,
65 .set_fmt = camera_set_fmt_cap, 71 .add = camera_add_device,
66 .try_fmt = camera_try_fmt_cap, 72 .remove = camera_remove_device,
67 .init_videobuf2 = camera_init_videobuf2, 73 .set_fmt = camera_set_fmt_cap,
68 .poll = camera_poll, 74 .try_fmt = camera_try_fmt_cap,
69 .querycap = camera_querycap, 75 .init_videobuf2 = camera_init_videobuf2,
70 .set_bus_param = camera_set_bus_param, 76 .poll = camera_poll,
71 /* The rest of host operations are optional */ 77 .querycap = camera_querycap,
72}; 78 .set_bus_param = camera_set_bus_param,
79 /* The rest of host operations are optional */
80 };
73 81
74.add and .remove methods are called when a sensor is attached to or detached 82.add and .remove methods are called when a sensor is attached to or detached
75from the host. .set_bus_param is used to configure physical connection 83from the host. .set_bus_param is used to configure physical connection
@@ -159,6 +167,3 @@ configure camera drivers to produce the FOURCC format, requested by the user,
159using the VIDIOC_S_FMT ioctl(). Apart from those standard format conversions, 167using the VIDIOC_S_FMT ioctl(). Apart from those standard format conversions,
160host drivers can also provide their own conversion rules by implementing a 168host drivers can also provide their own conversion rules by implementing a
161.get_formats and, if required, a .put_formats methods. 169.get_formats and, if required, a .put_formats methods.
162
163--
164Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
diff --git a/Documentation/media/v4l-drivers/tm6000-cardlist.rst b/Documentation/media/v4l-drivers/tm6000-cardlist.rst
new file mode 100644
index 000000000000..2fbd3886b5f0
--- /dev/null
+++ b/Documentation/media/v4l-drivers/tm6000-cardlist.rst
@@ -0,0 +1,21 @@
1TM6000 cards list
2=================
3
4.. code-block:: none
5
6 1 -> Generic tm5600 board (tm5600) [6000:0001]
7 2 -> Generic tm6000 board (tm6000) [6000:0001]
8 3 -> Generic tm6010 board (tm6010) [6000:0002]
9 4 -> 10Moons UT821 (tm5600) [6000:0001]
10 5 -> 10Moons UT330 (tm5600)
11 6 -> ADSTech Dual TV (tm6000) [06e1:f332]
12 7 -> FreeCom and similar (tm6000) [14aa:0620]
13 8 -> ADSTech Mini Dual TV (tm6000) [06e1:b339]
14 9 -> Hauppauge WinTV HVR-900H/USB2 Stick (tm6010) [2040:6600,2040:6601,2040:6610,2040:6611]
15 10 -> Beholder Wander (tm6010) [6000:dec0]
16 11 -> Beholder Voyager (tm6010) [6000:dec1]
17 12 -> TerraTec Cinergy Hybrid XE/Cinergy Hybrid Stick (tm6010) [0ccd:0086,0ccd:00a5]
18 13 -> TwinHan TU501 (tm6010) [13d3:3240,13d3:3241,13d3:3243,13d3:3264]
19 14 -> Beholder Wander Lite (tm6010) [6000:dec2]
20 15 -> Beholder Voyager Lite (tm6010) [6000:dec3]
21
diff --git a/Documentation/media/v4l-drivers/tuner-cardlist.rst b/Documentation/media/v4l-drivers/tuner-cardlist.rst
new file mode 100644
index 000000000000..2f1e1029c04e
--- /dev/null
+++ b/Documentation/media/v4l-drivers/tuner-cardlist.rst
@@ -0,0 +1,96 @@
1Tuner cards list
2================
3
4.. code-block:: none
5
6 tuner=0 - Temic PAL (4002 FH5)
7 tuner=1 - Philips PAL_I (FI1246 and compatibles)
8 tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
9 tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
10 tuner=4 - NoTuner
11 tuner=5 - Philips PAL_BG (FI1216 and compatibles)
12 tuner=6 - Temic NTSC (4032 FY5)
13 tuner=7 - Temic PAL_I (4062 FY5)
14 tuner=8 - Temic NTSC (4036 FY5)
15 tuner=9 - Alps HSBH1
16 tuner=10 - Alps TSBE1
17 tuner=11 - Alps TSBB5
18 tuner=12 - Alps TSBE5
19 tuner=13 - Alps TSBC5
20 tuner=14 - Temic PAL_BG (4006FH5)
21 tuner=15 - Alps TSCH6
22 tuner=16 - Temic PAL_DK (4016 FY5)
23 tuner=17 - Philips NTSC_M (MK2)
24 tuner=18 - Temic PAL_I (4066 FY5)
25 tuner=19 - Temic PAL* auto (4006 FN5)
26 tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
27 tuner=21 - Temic NTSC (4039 FR5)
28 tuner=22 - Temic PAL/SECAM multi (4046 FM5)
29 tuner=23 - Philips PAL_DK (FI1256 and compatibles)
30 tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
31 tuner=25 - LG PAL_I+FM (TAPC-I001D)
32 tuner=26 - LG PAL_I (TAPC-I701D)
33 tuner=27 - LG NTSC+FM (TPI8NSR01F)
34 tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
35 tuner=29 - LG PAL_BG (TPI8PSB11D)
36 tuner=30 - Temic PAL* auto + FM (4009 FN5)
37 tuner=31 - SHARP NTSC_JP (2U5JF5540)
38 tuner=32 - Samsung PAL TCPM9091PD27
39 tuner=33 - MT20xx universal
40 tuner=34 - Temic PAL_BG (4106 FH5)
41 tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
42 tuner=36 - Temic NTSC (4136 FY5)
43 tuner=37 - LG PAL (newer TAPC series)
44 tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
45 tuner=39 - LG NTSC (newer TAPC series)
46 tuner=40 - HITACHI V7-J180AT
47 tuner=41 - Philips PAL_MK (FI1216 MK)
48 tuner=42 - Philips FCV1236D ATSC/NTSC dual in
49 tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F)
50 tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
51 tuner=45 - Microtune 4049 FM5
52 tuner=46 - Panasonic VP27s/ENGE4324D
53 tuner=47 - LG NTSC (TAPE series)
54 tuner=48 - Tenna TNF 8831 BGFF)
55 tuner=49 - Microtune 4042 FI5 ATSC/NTSC dual in
56 tuner=50 - TCL 2002N
57 tuner=51 - Philips PAL/SECAM_D (FM 1256 I-H3)
58 tuner=52 - Thomson DTT 7610 (ATSC/NTSC)
59 tuner=53 - Philips FQ1286
60 tuner=54 - Philips/NXP TDA 8290/8295 + 8275/8275A/18271
61 tuner=55 - TCL 2002MB
62 tuner=56 - Philips PAL/SECAM multi (FQ1216AME MK4)
63 tuner=57 - Philips FQ1236A MK4
64 tuner=58 - Ymec TVision TVF-8531MF/8831MF/8731MF
65 tuner=59 - Ymec TVision TVF-5533MF
66 tuner=60 - Thomson DTT 761X (ATSC/NTSC)
67 tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF
68 tuner=62 - Philips TEA5767HN FM Radio
69 tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
70 tuner=64 - LG TDVS-H06xF
71 tuner=65 - Ymec TVF66T5-B/DFF
72 tuner=66 - LG TALN series
73 tuner=67 - Philips TD1316 Hybrid Tuner
74 tuner=68 - Philips TUV1236D ATSC/NTSC dual in
75 tuner=69 - Tena TNF 5335 and similar models
76 tuner=70 - Samsung TCPN 2121P30A
77 tuner=71 - Xceive xc2028/xc3028 tuner
78 tuner=72 - Thomson FE6600
79 tuner=73 - Samsung TCPG 6121P30A
80 tuner=75 - Philips TEA5761 FM Radio
81 tuner=76 - Xceive 5000 tuner
82 tuner=77 - TCL tuner MF02GIP-5N-E
83 tuner=78 - Philips FMD1216MEX MK3 Hybrid Tuner
84 tuner=79 - Philips PAL/SECAM multi (FM1216 MK5)
85 tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
86 tuner=81 - Partsnic (Daewoo) PTI-5NF05
87 tuner=82 - Philips CU1216L
88 tuner=83 - NXP TDA18271
89 tuner=84 - Sony BTF-Pxn01Z
90 tuner=85 - Philips FQ1236 MK5
91 tuner=86 - Tena TNF5337 MFD
92 tuner=87 - Xceive 4000 tuner
93 tuner=88 - Xceive 5000C tuner
94 tuner=89 - Sony BTF-PG472Z PAL/SECAM
95 tuner=90 - Sony BTF-PK467Z NTSC-M-JP
96 tuner=91 - Sony BTF-PB463Z NTSC-M
diff --git a/Documentation/media/v4l-drivers/tuners.rst b/Documentation/media/v4l-drivers/tuners.rst
new file mode 100644
index 000000000000..c3e8a1cf64a6
--- /dev/null
+++ b/Documentation/media/v4l-drivers/tuners.rst
@@ -0,0 +1,131 @@
1Tuner drivers
2=============
3
4Simple tuner Programming
5------------------------
6
7There are some flavors of Tuner programming APIs.
8These differ mainly by the bandswitch byte.
9
10- L= LG_API (VHF_LO=0x01, VHF_HI=0x02, UHF=0x08, radio=0x04)
11- P= PHILIPS_API (VHF_LO=0xA0, VHF_HI=0x90, UHF=0x30, radio=0x04)
12- T= TEMIC_API (VHF_LO=0x02, VHF_HI=0x04, UHF=0x01)
13- A= ALPS_API (VHF_LO=0x14, VHF_HI=0x12, UHF=0x11)
14- M= PHILIPS_MK3 (VHF_LO=0x01, VHF_HI=0x02, UHF=0x04, radio=0x19)
15
16Tuner Manufacturers
17-------------------
18
19- SAMSUNG Tuner identification: (e.g. TCPM9091PD27)
20
21.. code-block:: none
22
23 TCP [ABCJLMNQ] 90[89][125] [DP] [ACD] 27 [ABCD]
24 [ABCJLMNQ]:
25 A= BG+DK
26 B= BG
27 C= I+DK
28 J= NTSC-Japan
29 L= Secam LL
30 M= BG+I+DK
31 N= NTSC
32 Q= BG+I+DK+LL
33 [89]: ?
34 [125]:
35 2: No FM
36 5: With FM
37 [DP]:
38 D= NTSC
39 P= PAL
40 [ACD]:
41 A= F-connector
42 C= Phono connector
43 D= Din Jack
44 [ABCD]:
45 3-wire/I2C tuning, 2-band/3-band
46
47These Tuners are PHILIPS_API compatible.
48
49Philips Tuner identification: (e.g. FM1216MF)
50
51.. code-block:: none
52
53 F[IRMQ]12[1345]6{MF|ME|MP}
54 F[IRMQ]:
55 FI12x6: Tuner Series
56 FR12x6: Tuner + Radio IF
57 FM12x6: Tuner + FM
58 FQ12x6: special
59 FMR12x6: special
60 TD15xx: Digital Tuner ATSC
61 12[1345]6:
62 1216: PAL BG
63 1236: NTSC
64 1246: PAL I
65 1256: Pal DK
66 {MF|ME|MP}
67 MF: BG LL w/ Secam (Multi France)
68 ME: BG DK I LL (Multi Europe)
69 MP: BG DK I (Multi PAL)
70 MR: BG DK M (?)
71 MG: BG DKI M (?)
72 MK2 series PHILIPS_API, most tuners are compatible to this one !
73 MK3 series introduced in 2002 w/ PHILIPS_MK3_API
74
75Temic Tuner identification: (.e.g 4006FH5)
76
77.. code-block:: none
78
79 4[01][0136][269]F[HYNR]5
80 40x2: Tuner (5V/33V), TEMIC_API.
81 40x6: Tuner 5V
82 41xx: Tuner compact
83 40x9: Tuner+FM compact
84 [0136]
85 xx0x: PAL BG
86 xx1x: Pal DK, Secam LL
87 xx3x: NTSC
88 xx6x: PAL I
89 F[HYNR]5
90 FH5: Pal BG
91 FY5: others
92 FN5: multistandard
93 FR5: w/ FM radio
94 3X xxxx: order number with specific connector
95 Note: Only 40x2 series has TEMIC_API, all newer tuners have PHILIPS_API.
96
97LG Innotek Tuner:
98
99- TPI8NSR11 : NTSC J/M (TPI8NSR01 w/FM) (P,210/497)
100- TPI8PSB11 : PAL B/G (TPI8PSB01 w/FM) (P,170/450)
101- TAPC-I701 : PAL I (TAPC-I001 w/FM) (P,170/450)
102- TPI8PSB12 : PAL D/K+B/G (TPI8PSB02 w/FM) (P,170/450)
103- TAPC-H701P: NTSC_JP (TAPC-H001P w/FM) (L,170/450)
104- TAPC-G701P: PAL B/G (TAPC-G001P w/FM) (L,170/450)
105- TAPC-W701P: PAL I (TAPC-W001P w/FM) (L,170/450)
106- TAPC-Q703P: PAL D/K (TAPC-Q001P w/FM) (L,170/450)
107- TAPC-Q704P: PAL D/K+I (L,170/450)
108- TAPC-G702P: PAL D/K+B/G (L,170/450)
109
110- TADC-H002F: NTSC (L,175/410?; 2-B, C-W+11, W+12-69)
111- TADC-M201D: PAL D/K+B/G+I (L,143/425) (sound control at I2C address 0xc8)
112- TADC-T003F: NTSC Taiwan (L,175/410?; 2-B, C-W+11, W+12-69)
113
114Suffix:
115 - P= Standard phono female socket
116 - D= IEC female socket
117 - F= F-connector
118
119Other Tuners:
120
121- TCL2002MB-1 : PAL BG + DK =TUNER_LG_PAL_NEW_TAPC
122- TCL2002MB-1F: PAL BG + DK w/FM =PHILIPS_PAL
123- TCL2002MI-2 : PAL I = ??
124
125ALPS Tuners:
126
127- Most are LG_API compatible
128- TSCH6 has ALPS_API (TSCH5 ?)
129- TSBE1 has extra API 05,02,08 Control_byte=0xCB Source:[#f1]_
130
131.. [#f1] conexant100029b-PCI-Decoder-ApplicationNote.pdf
diff --git a/Documentation/media/v4l-drivers/usbvision-cardlist.rst b/Documentation/media/v4l-drivers/usbvision-cardlist.rst
new file mode 100644
index 000000000000..3d8be9cb1b5a
--- /dev/null
+++ b/Documentation/media/v4l-drivers/usbvision-cardlist.rst
@@ -0,0 +1,72 @@
1Usbvision cards list
2====================
3
4.. code-block:: none
5
6 0 -> Xanboo [0a6f:0400]
7 1 -> Belkin USB VideoBus II Adapter [050d:0106]
8 2 -> Belkin Components USB VideoBus [050d:0207]
9 3 -> Belkin USB VideoBus II [050d:0208]
10 4 -> echoFX InterView Lite [0571:0002]
11 5 -> USBGear USBG-V1 resp. HAMA USB [0573:0003]
12 6 -> D-Link V100 [0573:0400]
13 7 -> X10 USB Camera [0573:2000]
14 8 -> Hauppauge WinTV USB Live (PAL B/G) [0573:2d00]
15 9 -> Hauppauge WinTV USB Live Pro (NTSC M/N) [0573:2d01]
16 10 -> Zoran Co. PMD (Nogatech) AV-grabber Manhattan [0573:2101]
17 11 -> Nogatech USB-TV (NTSC) FM [0573:4100]
18 12 -> PNY USB-TV (NTSC) FM [0573:4110]
19 13 -> PixelView PlayTv-USB PRO (PAL) FM [0573:4450]
20 14 -> ZTV ZT-721 2.4GHz USB A/V Receiver [0573:4550]
21 15 -> Hauppauge WinTV USB (NTSC M/N) [0573:4d00]
22 16 -> Hauppauge WinTV USB (PAL B/G) [0573:4d01]
23 17 -> Hauppauge WinTV USB (PAL I) [0573:4d02]
24 18 -> Hauppauge WinTV USB (PAL/SECAM L) [0573:4d03]
25 19 -> Hauppauge WinTV USB (PAL D/K) [0573:4d04]
26 20 -> Hauppauge WinTV USB (NTSC FM) [0573:4d10]
27 21 -> Hauppauge WinTV USB (PAL B/G FM) [0573:4d11]
28 22 -> Hauppauge WinTV USB (PAL I FM) [0573:4d12]
29 23 -> Hauppauge WinTV USB (PAL D/K FM) [0573:4d14]
30 24 -> Hauppauge WinTV USB Pro (NTSC M/N) [0573:4d2a]
31 25 -> Hauppauge WinTV USB Pro (NTSC M/N) V2 [0573:4d2b]
32 26 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L) [0573:4d2c]
33 27 -> Hauppauge WinTV USB Pro (NTSC M/N) V3 [0573:4d20]
34 28 -> Hauppauge WinTV USB Pro (PAL B/G) [0573:4d21]
35 29 -> Hauppauge WinTV USB Pro (PAL I) [0573:4d22]
36 30 -> Hauppauge WinTV USB Pro (PAL/SECAM L) [0573:4d23]
37 31 -> Hauppauge WinTV USB Pro (PAL D/K) [0573:4d24]
38 32 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) [0573:4d25]
39 33 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2 [0573:4d26]
40 34 -> Hauppauge WinTV USB Pro (PAL B/G) V2 [0573:4d27]
41 35 -> Hauppauge WinTV USB Pro (PAL B/G,D/K) [0573:4d28]
42 36 -> Hauppauge WinTV USB Pro (PAL I,D/K) [0573:4d29]
43 37 -> Hauppauge WinTV USB Pro (NTSC M/N FM) [0573:4d30]
44 38 -> Hauppauge WinTV USB Pro (PAL B/G FM) [0573:4d31]
45 39 -> Hauppauge WinTV USB Pro (PAL I FM) [0573:4d32]
46 40 -> Hauppauge WinTV USB Pro (PAL D/K FM) [0573:4d34]
47 41 -> Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM) [0573:4d35]
48 42 -> Hauppauge WinTV USB Pro (Temic PAL B/G FM) [0573:4d36]
49 43 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM) [0573:4d37]
50 44 -> Hauppauge WinTV USB Pro (NTSC M/N FM) V2 [0573:4d38]
51 45 -> Camtel Technology USB TV Genie Pro FM Model TVB330 [0768:0006]
52 46 -> Digital Video Creator I [07d0:0001]
53 47 -> Global Village GV-007 (NTSC) [07d0:0002]
54 48 -> Dazzle Fusion Model DVC-50 Rev 1 (NTSC) [07d0:0003]
55 49 -> Dazzle Fusion Model DVC-80 Rev 1 (PAL) [07d0:0004]
56 50 -> Dazzle Fusion Model DVC-90 Rev 1 (SECAM) [07d0:0005]
57 51 -> Eskape Labs MyTV2Go [07f8:9104]
58 52 -> Pinnacle Studio PCTV USB (PAL) [2304:010d]
59 53 -> Pinnacle Studio PCTV USB (SECAM) [2304:0109]
60 54 -> Pinnacle Studio PCTV USB (PAL) FM [2304:0110]
61 55 -> Miro PCTV USB [2304:0111]
62 56 -> Pinnacle Studio PCTV USB (NTSC) FM [2304:0112]
63 57 -> Pinnacle Studio PCTV USB (PAL) FM V2 [2304:0210]
64 58 -> Pinnacle Studio PCTV USB (NTSC) FM V2 [2304:0212]
65 59 -> Pinnacle Studio PCTV USB (PAL) FM V3 [2304:0214]
66 60 -> Pinnacle Studio Linx Video input cable (NTSC) [2304:0300]
67 61 -> Pinnacle Studio Linx Video input cable (PAL) [2304:0301]
68 62 -> Pinnacle PCTV Bungee USB (PAL) FM [2304:0419]
69 63 -> Hauppauge WinTv-USB [2400:4200]
70 64 -> Pinnacle Studio PCTV USB (NTSC) FM V3 [2304:0113]
71 65 -> Nogatech USB MicroCam NTSC (NV3000N) [0573:3000]
72 66 -> Nogatech USB MicroCam PAL (NV3001P) [0573:3001]
diff --git a/Documentation/video4linux/uvcvideo.txt b/Documentation/media/v4l-drivers/uvcvideo.rst
index 35ce19cddcf8..d68b3d59a4b5 100644
--- a/Documentation/video4linux/uvcvideo.txt
+++ b/Documentation/media/v4l-drivers/uvcvideo.rst
@@ -1,5 +1,5 @@
1Linux USB Video Class (UVC) driver 1The Linux USB Video Class (UVC) driver
2================================== 2======================================
3 3
4This file documents some driver-specific aspects of the UVC driver, such as 4This file documents some driver-specific aspects of the UVC driver, such as
5driver-specific ioctls and implementation notes. 5driver-specific ioctls and implementation notes.
@@ -11,7 +11,8 @@ linux-uvc-devel@lists.berlios.de.
11Extension Unit (XU) support 11Extension Unit (XU) support
12--------------------------- 12---------------------------
13 13
141. Introduction 14Introduction
15~~~~~~~~~~~~
15 16
16The UVC specification allows for vendor-specific extensions through extension 17The UVC specification allows for vendor-specific extensions through extension
17units (XUs). The Linux UVC driver supports extension unit controls (XU controls) 18units (XUs). The Linux UVC driver supports extension unit controls (XU controls)
@@ -31,7 +32,8 @@ maximum flexibility.
31Both mechanisms complement each other and are described in more detail below. 32Both mechanisms complement each other and are described in more detail below.
32 33
33 34
342. Control mappings 35Control mappings
36~~~~~~~~~~~~~~~~
35 37
36The UVC driver provides an API for user space applications to define so-called 38The UVC driver provides an API for user space applications to define so-called
37control mappings at runtime. These allow for individual XU controls or byte 39control mappings at runtime. These allow for individual XU controls or byte
@@ -82,7 +84,8 @@ For details on the UVCIOC_CTRL_QUERY ioctl please refer to the section titled
82"IOCTL reference" below. 84"IOCTL reference" below.
83 85
84 86
854. Security 87Security
88~~~~~~~~
86 89
87The API doesn't currently provide a fine-grained access control facility. The 90The API doesn't currently provide a fine-grained access control facility. The
88UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions. 91UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
@@ -90,20 +93,24 @@ UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
90Suggestions on how to improve this are welcome. 93Suggestions on how to improve this are welcome.
91 94
92 95
935. Debugging 96Debugging
97~~~~~~~~~
94 98
95In order to debug problems related to XU controls or controls in general it is 99In order to debug problems related to XU controls or controls in general it is
96recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'. 100recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'.
97This causes extra output to be written into the system log. 101This causes extra output to be written into the system log.
98 102
99 103
1006. IOCTL reference 104IOCTL reference
105~~~~~~~~~~~~~~~
101 106
102---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ---- 107UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control
108^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 109
104Argument: struct uvc_xu_control_mapping 110Argument: struct uvc_xu_control_mapping
105 111
106Description: 112**Description**:
113
107 This ioctl creates a mapping between a UVC control or part of a UVC 114 This ioctl creates a mapping between a UVC control or part of a UVC
108 control and a V4L2 control. Once mappings are defined, userspace 115 control and a V4L2 control. Once mappings are defined, userspace
109 applications can access vendor-defined UVC control through the V4L2 116 applications can access vendor-defined UVC control through the V4L2
@@ -122,7 +129,8 @@ Description:
122 For signed integer V4L2 controls the data_type field should be set to 129 For signed integer V4L2 controls the data_type field should be set to
123 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored. 130 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored.
124 131
125Return value: 132**Return value**:
133
126 On success 0 is returned. On error -1 is returned and errno is set 134 On success 0 is returned. On error -1 is returned and errno is set
127 appropriately. 135 appropriately.
128 136
@@ -137,7 +145,10 @@ Return value:
137 EEXIST 145 EEXIST
138 Mapping already exists. 146 Mapping already exists.
139 147
140Data types: 148**Data types**:
149
150.. code-block:: none
151
141 * struct uvc_xu_control_mapping 152 * struct uvc_xu_control_mapping
142 153
143 __u32 id V4L2 control identifier 154 __u32 id V4L2 control identifier
@@ -170,11 +181,12 @@ Data types:
170 UVC_CTRL_DATA_TYPE_BITMASK Bitmask 181 UVC_CTRL_DATA_TYPE_BITMASK Bitmask
171 182
172 183
173---- UVCIOC_CTRL_QUERY - Query a UVC XU control ---- 184UVCIOC_CTRL_QUERY - Query a UVC XU control
174 185^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175Argument: struct uvc_xu_control_query 186Argument: struct uvc_xu_control_query
176 187
177Description: 188**Description**:
189
178 This ioctl queries a UVC XU control identified by its extension unit ID 190 This ioctl queries a UVC XU control identified by its extension unit ID
179 and control selector. 191 and control selector.
180 192
@@ -213,7 +225,8 @@ Description:
213 important for the result of the UVC_GET_LEN requests, which is always 225 important for the result of the UVC_GET_LEN requests, which is always
214 returned as a little-endian 16-bit integer by the device. 226 returned as a little-endian 16-bit integer by the device.
215 227
216Return value: 228**Return value**:
229
217 On success 0 is returned. On error -1 is returned and errno is set 230 On success 0 is returned. On error -1 is returned and errno is set
218 appropriately. 231 appropriately.
219 232
@@ -229,7 +242,10 @@ Return value:
229 EFAULT 242 EFAULT
230 The data pointer references an inaccessible memory area. 243 The data pointer references an inaccessible memory area.
231 244
232Data types: 245**Data types**:
246
247.. code-block:: none
248
233 * struct uvc_xu_control_query 249 * struct uvc_xu_control_query
234 250
235 __u8 unit Extension unit ID 251 __u8 unit Extension unit ID
diff --git a/Documentation/media/v4l-drivers/v4l-with-ir.rst b/Documentation/media/v4l-drivers/v4l-with-ir.rst
new file mode 100644
index 000000000000..613e1e79fc96
--- /dev/null
+++ b/Documentation/media/v4l-drivers/v4l-with-ir.rst
@@ -0,0 +1,73 @@
1Infrared remote control support in video4linux drivers
2======================================================
3
4Authors: Gerd Hoffmann, Mauro Carvalho Chehab
5
6Basics
7------
8
9Most analog and digital TV boards support remote controllers. Several of
10them have a microprocessor that receives the IR carriers, convert into
11pulse/space sequences and then to scan codes, returning such codes to
12userspace ("scancode mode"). Other boards return just the pulse/space
13sequences ("raw mode").
14
15The support for remote controller in scancode mode is provided by the
16standard Linux input layer. The support for raw mode is provided via LIRC.
17
18In order to check the support and test it, it is suggested to download
19the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_. It provides
20two tools to handle remote controllers:
21
22- ir-keytable: provides a way to query the remote controller, list the
23 protocols it supports, enable in-kernel support for IR decoder or
24 switch the protocol and to test the reception of scan codes;
25
26- ir-ctl: provide tools to handle remote controllers that support raw mode
27 via LIRC interface.
28
29Usually, the remote controller module is auto-loaded when the TV card is
30detected. However, for a few devices, you need to manually load the
31ir-kbd-i2c module.
32
33How it works
34------------
35
36The modules register the remote as keyboard within the linux input
37layer, i.e. you'll see the keys of the remote as normal key strokes
38(if CONFIG_INPUT_KEYBOARD is enabled).
39
40Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
41applications to access the remote via /dev/input/event<n> devices.
42The udev/systemd will automatically create the devices. If you install
43the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_, it may also
44automatically load a different keytable than the default one. Please see
45`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ ir-keytable.1
46man page for details.
47
48The ir-keytable tool is nice for trouble shooting, i.e. to check
49whenever the input device is really present, which of the devices it
50is, check whenever pressing keys on the remote actually generates
51events and the like. You can also use any other input utility that changes
52the keymaps, like the input kbd utility.
53
54
55Using with lircd
56================
57
58The latest versions of the lircd daemon supports reading events from the
59linux input layer (via event device). It also supports receiving IR codes
60in lirc mode.
61
62
63Using without lircd
64===================
65
66Xorg recognizes several IR keycodes that have its numerical value lower
67than 247. With the advent of Wayland, the input driver got updated too,
68and should now accept all keycodes. Yet, you may want to just reasign
69the keycodes to something that your favorite media application likes.
70
71This can be done by setting
72`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ to load your own
73keytable in runtime. Please read ir-keytable.1 man page for details.
diff --git a/Documentation/video4linux/vivid.txt b/Documentation/media/v4l-drivers/vivid.rst
index 1b26519c6ddc..c8cf371e8bb9 100644
--- a/Documentation/video4linux/vivid.txt
+++ b/Documentation/media/v4l-drivers/vivid.rst
@@ -1,5 +1,5 @@
1vivid: Virtual Video Test Driver 1The Virtual Video Test Driver (vivid)
2================================ 2=====================================
3 3
4This driver emulates video4linux hardware of various types: video capture, video 4This driver emulates video4linux hardware of various types: video capture, video
5output, vbi capture and output, radio receivers and transmitters and a software 5output, vbi capture and output, radio receivers and transmitters and a software
@@ -37,49 +37,8 @@ This document describes the features implemented by this driver:
37 37
38These features will be described in more detail below. 38These features will be described in more detail below.
39 39
40 40Configuring the driver
41Table of Contents 41----------------------
42-----------------
43
44Section 1: Configuring the driver
45Section 2: Video Capture
46Section 2.1: Webcam Input
47Section 2.2: TV and S-Video Inputs
48Section 2.3: HDMI Input
49Section 3: Video Output
50Section 3.1: S-Video Output
51Section 3.2: HDMI Output
52Section 4: VBI Capture
53Section 5: VBI Output
54Section 6: Radio Receiver
55Section 7: Radio Transmitter
56Section 8: Software Defined Radio Receiver
57Section 9: Controls
58Section 9.1: User Controls - Test Controls
59Section 9.2: User Controls - Video Capture
60Section 9.3: User Controls - Audio
61Section 9.4: Vivid Controls
62Section 9.4.1: Test Pattern Controls
63Section 9.4.2: Capture Feature Selection Controls
64Section 9.4.3: Output Feature Selection Controls
65Section 9.4.4: Error Injection Controls
66Section 9.4.5: VBI Raw Capture Controls
67Section 9.5: Digital Video Controls
68Section 9.6: FM Radio Receiver Controls
69Section 9.7: FM Radio Modulator
70Section 10: Video, VBI and RDS Looping
71Section 10.1: Video and Sliced VBI looping
72Section 10.2: Radio & RDS Looping
73Section 11: Cropping, Composing, Scaling
74Section 12: Formats
75Section 13: Capture Overlay
76Section 14: Output Overlay
77Section 15: CEC (Consumer Electronics Control)
78Section 16: Some Future Improvements
79
80
81Section 1: Configuring the driver
82---------------------------------
83 42
84By default the driver will create a single instance that has a video capture 43By default the driver will create a single instance that has a video capture
85device with webcam, TV, S-Video and HDMI inputs, a video output device with 44device with webcam, TV, S-Video and HDMI inputs, a video output device with
@@ -89,71 +48,94 @@ radio receiver device, one radio transmitter device and one SDR device.
89The number of instances, devices, video inputs and outputs and their types are 48The number of instances, devices, video inputs and outputs and their types are
90all configurable using the following module options: 49all configurable using the following module options:
91 50
92n_devs: number of driver instances to create. By default set to 1. Up to 64 51- n_devs:
52
53 number of driver instances to create. By default set to 1. Up to 64
93 instances can be created. 54 instances can be created.
94 55
95node_types: which devices should each driver instance create. An array of 56- node_types:
57
58 which devices should each driver instance create. An array of
96 hexadecimal values, one for each instance. The default is 0x1d3d. 59 hexadecimal values, one for each instance. The default is 0x1d3d.
97 Each value is a bitmask with the following meaning: 60 Each value is a bitmask with the following meaning:
98 bit 0: Video Capture node 61
99 bit 2-3: VBI Capture node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both 62 - bit 0: Video Capture node
100 bit 4: Radio Receiver node 63 - bit 2-3: VBI Capture node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both
101 bit 5: Software Defined Radio Receiver node 64 - bit 4: Radio Receiver node
102 bit 8: Video Output node 65 - bit 5: Software Defined Radio Receiver node
103 bit 10-11: VBI Output node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both 66 - bit 8: Video Output node
104 bit 12: Radio Transmitter node 67 - bit 10-11: VBI Output node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both
105 bit 16: Framebuffer for testing overlays 68 - bit 12: Radio Transmitter node
69 - bit 16: Framebuffer for testing overlays
106 70
107 So to create four instances, the first two with just one video capture 71 So to create four instances, the first two with just one video capture
108 device, the second two with just one video output device you would pass 72 device, the second two with just one video output device you would pass
109 these module options to vivid: 73 these module options to vivid:
110 74
75 .. code-block:: none
76
111 n_devs=4 node_types=0x1,0x1,0x100,0x100 77 n_devs=4 node_types=0x1,0x1,0x100,0x100
112 78
113num_inputs: the number of inputs, one for each instance. By default 4 inputs 79- num_inputs:
80
81 the number of inputs, one for each instance. By default 4 inputs
114 are created for each video capture device. At most 16 inputs can be created, 82 are created for each video capture device. At most 16 inputs can be created,
115 and there must be at least one. 83 and there must be at least one.
116 84
117input_types: the input types for each instance, the default is 0xe4. This defines 85- input_types:
86
87 the input types for each instance, the default is 0xe4. This defines
118 what the type of each input is when the inputs are created for each driver 88 what the type of each input is when the inputs are created for each driver
119 instance. This is a hexadecimal value with up to 16 pairs of bits, each 89 instance. This is a hexadecimal value with up to 16 pairs of bits, each
120 pair gives the type and bits 0-1 map to input 0, bits 2-3 map to input 1, 90 pair gives the type and bits 0-1 map to input 0, bits 2-3 map to input 1,
121 30-31 map to input 15. Each pair of bits has the following meaning: 91 30-31 map to input 15. Each pair of bits has the following meaning:
122 92
123 00: this is a webcam input 93 - 00: this is a webcam input
124 01: this is a TV tuner input 94 - 01: this is a TV tuner input
125 10: this is an S-Video input 95 - 10: this is an S-Video input
126 11: this is an HDMI input 96 - 11: this is an HDMI input
127 97
128 So to create a video capture device with 8 inputs where input 0 is a TV 98 So to create a video capture device with 8 inputs where input 0 is a TV
129 tuner, inputs 1-3 are S-Video inputs and inputs 4-7 are HDMI inputs you 99 tuner, inputs 1-3 are S-Video inputs and inputs 4-7 are HDMI inputs you
130 would use the following module options: 100 would use the following module options:
131 101
102 .. code-block:: none
103
132 num_inputs=8 input_types=0xffa9 104 num_inputs=8 input_types=0xffa9
133 105
134num_outputs: the number of outputs, one for each instance. By default 2 outputs 106- num_outputs:
107
108 the number of outputs, one for each instance. By default 2 outputs
135 are created for each video output device. At most 16 outputs can be 109 are created for each video output device. At most 16 outputs can be
136 created, and there must be at least one. 110 created, and there must be at least one.
137 111
138output_types: the output types for each instance, the default is 0x02. This defines 112- output_types:
113
114 the output types for each instance, the default is 0x02. This defines
139 what the type of each output is when the outputs are created for each 115 what the type of each output is when the outputs are created for each
140 driver instance. This is a hexadecimal value with up to 16 bits, each bit 116 driver instance. This is a hexadecimal value with up to 16 bits, each bit
141 gives the type and bit 0 maps to output 0, bit 1 maps to output 1, bit 117 gives the type and bit 0 maps to output 0, bit 1 maps to output 1, bit
142 15 maps to output 15. The meaning of each bit is as follows: 118 15 maps to output 15. The meaning of each bit is as follows:
143 119
144 0: this is an S-Video output 120 - 0: this is an S-Video output
145 1: this is an HDMI output 121 - 1: this is an HDMI output
146 122
147 So to create a video output device with 8 outputs where outputs 0-3 are 123 So to create a video output device with 8 outputs where outputs 0-3 are
148 S-Video outputs and outputs 4-7 are HDMI outputs you would use the 124 S-Video outputs and outputs 4-7 are HDMI outputs you would use the
149 following module options: 125 following module options:
150 126
127 .. code-block:: none
128
151 num_outputs=8 output_types=0xf0 129 num_outputs=8 output_types=0xf0
152 130
153vid_cap_nr: give the desired videoX start number for each video capture device. 131- vid_cap_nr:
132
133 give the desired videoX start number for each video capture device.
154 The default is -1 which will just take the first free number. This allows 134 The default is -1 which will just take the first free number. This allows
155 you to map capture video nodes to specific videoX device nodes. Example: 135 you to map capture video nodes to specific videoX device nodes. Example:
156 136
137 .. code-block:: none
138
157 n_devs=4 vid_cap_nr=2,4,6,8 139 n_devs=4 vid_cap_nr=2,4,6,8
158 140
159 This will attempt to assign /dev/video2 for the video capture device of 141 This will attempt to assign /dev/video2 for the video capture device of
@@ -161,25 +143,39 @@ vid_cap_nr: give the desired videoX start number for each video capture device.
161 instance. If it can't succeed, then it will just take the next free 143 instance. If it can't succeed, then it will just take the next free
162 number. 144 number.
163 145
164vid_out_nr: give the desired videoX start number for each video output device. 146- vid_out_nr:
165 The default is -1 which will just take the first free number. 147
148 give the desired videoX start number for each video output device.
149 The default is -1 which will just take the first free number.
150
151- vbi_cap_nr:
166 152
167vbi_cap_nr: give the desired vbiX start number for each vbi capture device. 153 give the desired vbiX start number for each vbi capture device.
168 The default is -1 which will just take the first free number. 154 The default is -1 which will just take the first free number.
169 155
170vbi_out_nr: give the desired vbiX start number for each vbi output device. 156- vbi_out_nr:
171 The default is -1 which will just take the first free number.
172 157
173radio_rx_nr: give the desired radioX start number for each radio receiver device. 158 give the desired vbiX start number for each vbi output device.
174 The default is -1 which will just take the first free number. 159 The default is -1 which will just take the first free number.
175 160
176radio_tx_nr: give the desired radioX start number for each radio transmitter 161- radio_rx_nr:
162
163 give the desired radioX start number for each radio receiver device.
164 The default is -1 which will just take the first free number.
165
166- radio_tx_nr:
167
168 give the desired radioX start number for each radio transmitter
177 device. The default is -1 which will just take the first free number. 169 device. The default is -1 which will just take the first free number.
178 170
179sdr_cap_nr: give the desired swradioX start number for each SDR capture device. 171- sdr_cap_nr:
180 The default is -1 which will just take the first free number. 172
173 give the desired swradioX start number for each SDR capture device.
174 The default is -1 which will just take the first free number.
175
176- ccs_cap_mode:
181 177
182ccs_cap_mode: specify the allowed video capture crop/compose/scaling combination 178 specify the allowed video capture crop/compose/scaling combination
183 for each driver instance. Video capture devices can have any combination 179 for each driver instance. Video capture devices can have any combination
184 of cropping, composing and scaling capabilities and this will tell the 180 of cropping, composing and scaling capabilities and this will tell the
185 vivid driver which of those is should emulate. By default the user can 181 vivid driver which of those is should emulate. By default the user can
@@ -188,21 +184,30 @@ ccs_cap_mode: specify the allowed video capture crop/compose/scaling combination
188 The value is either -1 (controlled by the user) or a set of three bits, 184 The value is either -1 (controlled by the user) or a set of three bits,
189 each enabling (1) or disabling (0) one of the features: 185 each enabling (1) or disabling (0) one of the features:
190 186
191 bit 0: Enable crop support. Cropping will take only part of the 187 - bit 0:
192 incoming picture. 188
193 bit 1: Enable compose support. Composing will copy the incoming 189 Enable crop support. Cropping will take only part of the
194 picture into a larger buffer. 190 incoming picture.
195 bit 2: Enable scaling support. Scaling can scale the incoming 191 - bit 1:
196 picture. The scaler of the vivid driver can enlarge up 192
197 or down to four times the original size. The scaler is 193 Enable compose support. Composing will copy the incoming
198 very simple and low-quality. Simplicity and speed were 194 picture into a larger buffer.
199 key, not quality. 195
196 - bit 2:
197
198 Enable scaling support. Scaling can scale the incoming
199 picture. The scaler of the vivid driver can enlarge up
200 or down to four times the original size. The scaler is
201 very simple and low-quality. Simplicity and speed were
202 key, not quality.
200 203
201 Note that this value is ignored by webcam inputs: those enumerate 204 Note that this value is ignored by webcam inputs: those enumerate
202 discrete framesizes and that is incompatible with cropping, composing 205 discrete framesizes and that is incompatible with cropping, composing
203 or scaling. 206 or scaling.
204 207
205ccs_out_mode: specify the allowed video output crop/compose/scaling combination 208- ccs_out_mode:
209
210 specify the allowed video output crop/compose/scaling combination
206 for each driver instance. Video output devices can have any combination 211 for each driver instance. Video output devices can have any combination
207 of cropping, composing and scaling capabilities and this will tell the 212 of cropping, composing and scaling capabilities and this will tell the
208 vivid driver which of those is should emulate. By default the user can 213 vivid driver which of those is should emulate. By default the user can
@@ -211,28 +216,42 @@ ccs_out_mode: specify the allowed video output crop/compose/scaling combination
211 The value is either -1 (controlled by the user) or a set of three bits, 216 The value is either -1 (controlled by the user) or a set of three bits,
212 each enabling (1) or disabling (0) one of the features: 217 each enabling (1) or disabling (0) one of the features:
213 218
214 bit 0: Enable crop support. Cropping will take only part of the 219 - bit 0:
215 outgoing buffer. 220
216 bit 1: Enable compose support. Composing will copy the incoming 221 Enable crop support. Cropping will take only part of the
217 buffer into a larger picture frame. 222 outgoing buffer.
218 bit 2: Enable scaling support. Scaling can scale the incoming 223
219 buffer. The scaler of the vivid driver can enlarge up 224 - bit 1:
220 or down to four times the original size. The scaler is 225
221 very simple and low-quality. Simplicity and speed were 226 Enable compose support. Composing will copy the incoming
222 key, not quality. 227 buffer into a larger picture frame.
223 228
224multiplanar: select whether each device instance supports multi-planar formats, 229 - bit 2:
230
231 Enable scaling support. Scaling can scale the incoming
232 buffer. The scaler of the vivid driver can enlarge up
233 or down to four times the original size. The scaler is
234 very simple and low-quality. Simplicity and speed were
235 key, not quality.
236
237- multiplanar:
238
239 select whether each device instance supports multi-planar formats,
225 and thus the V4L2 multi-planar API. By default device instances are 240 and thus the V4L2 multi-planar API. By default device instances are
226 single-planar. 241 single-planar.
227 242
228 This module option can override that for each instance. Values are: 243 This module option can override that for each instance. Values are:
229 244
230 1: this is a single-planar instance. 245 - 1: this is a single-planar instance.
231 2: this is a multi-planar instance. 246 - 2: this is a multi-planar instance.
232 247
233vivid_debug: enable driver debugging info 248- vivid_debug:
234 249
235no_error_inj: if set disable the error injecting controls. This option is 250 enable driver debugging info
251
252- no_error_inj:
253
254 if set disable the error injecting controls. This option is
236 needed in order to run a tool like v4l2-compliance. Tools like that 255 needed in order to run a tool like v4l2-compliance. Tools like that
237 exercise all controls including a control like 'Disconnect' which 256 exercise all controls including a control like 'Disconnect' which
238 emulates a USB disconnect, making the device inaccessible and so 257 emulates a USB disconnect, making the device inaccessible and so
@@ -250,8 +269,8 @@ It is also very suitable to emulate hardware that is not yet available, e.g.
250when developing software for a new upcoming device. 269when developing software for a new upcoming device.
251 270
252 271
253Section 2: Video Capture 272Video Capture
254------------------------ 273-------------
255 274
256This is probably the most frequently used feature. The video capture device 275This is probably the most frequently used feature. The video capture device
257can be configured by using the module options num_inputs, input_types and 276can be configured by using the module options num_inputs, input_types and
@@ -270,8 +289,8 @@ frame/field sequence counting will keep track of that so the sequence
270count will skip whenever frames are dropped. 289count will skip whenever frames are dropped.
271 290
272 291
273Section 2.1: Webcam Input 292Webcam Input
274------------------------- 293~~~~~~~~~~~~
275 294
276The webcam input supports three framesizes: 320x180, 640x360 and 1280x720. It 295The webcam input supports three framesizes: 320x180, 640x360 and 1280x720. It
277supports frames per second settings of 10, 15, 25, 30, 50 and 60 fps. Which ones 296supports frames per second settings of 10, 15, 25, 30, 50 and 60 fps. Which ones
@@ -282,8 +301,8 @@ The initially selected colorspace when you switch to the webcam input will be
282sRGB. 301sRGB.
283 302
284 303
285Section 2.2: TV and S-Video Inputs 304TV and S-Video Inputs
286---------------------------------- 305~~~~~~~~~~~~~~~~~~~~~
287 306
288The only difference between the TV and S-Video input is that the TV has a 307The only difference between the TV and S-Video input is that the TV has a
289tuner. Otherwise they behave identically. 308tuner. Otherwise they behave identically.
@@ -338,8 +357,8 @@ Finally, for these inputs the v4l2_timecode struct is filled in in the
338dequeued v4l2_buffer struct. 357dequeued v4l2_buffer struct.
339 358
340 359
341Section 2.3: HDMI Input 360HDMI Input
342----------------------- 361~~~~~~~~~~
343 362
344The HDMI inputs supports all CEA-861 and DMT timings, both progressive and 363The HDMI inputs supports all CEA-861 and DMT timings, both progressive and
345interlaced, for pixelclock frequencies between 25 and 600 MHz. The field 364interlaced, for pixelclock frequencies between 25 and 600 MHz. The field
@@ -372,8 +391,8 @@ There is a maximum of 15 HDMI inputs (if there are more, then they will be
372reduced to 15) since that's the limitation of the EDID physical address. 391reduced to 15) since that's the limitation of the EDID physical address.
373 392
374 393
375Section 3: Video Output 394Video Output
376----------------------- 395------------
377 396
378The video output device can be configured by using the module options 397The video output device can be configured by using the module options
379num_outputs, output_types and ccs_out_mode (see section 1 for more detailed 398num_outputs, output_types and ccs_out_mode (see section 1 for more detailed
@@ -384,8 +403,8 @@ below.
384Like with video capture the framerate is also exact in the long term. 403Like with video capture the framerate is also exact in the long term.
385 404
386 405
387Section 3.1: S-Video Output 406S-Video Output
388--------------------------- 407~~~~~~~~~~~~~~
389 408
390This output supports audio outputs as well: "Line-Out 1" and "Line-Out 2". 409This output supports audio outputs as well: "Line-Out 1" and "Line-Out 2".
391The S-Video output supports all TV standards. 410The S-Video output supports all TV standards.
@@ -396,8 +415,8 @@ The initially selected colorspace when you switch to the TV or S-Video input
396will be SMPTE-170M. 415will be SMPTE-170M.
397 416
398 417
399Section 3.2: HDMI Output 418HDMI Output
400------------------------ 419~~~~~~~~~~~
401 420
402The HDMI output supports all CEA-861 and DMT timings, both progressive and 421The HDMI output supports all CEA-861 and DMT timings, both progressive and
403interlaced, for pixelclock frequencies between 25 and 600 MHz. The field 422interlaced, for pixelclock frequencies between 25 and 600 MHz. The field
@@ -418,8 +437,8 @@ There is a maximum of 15 HDMI outputs (if there are more, then they will be
418reduced to 15) since that's the limitation of the EDID physical address. See 437reduced to 15) since that's the limitation of the EDID physical address. See
419also the CEC section for more details. 438also the CEC section for more details.
420 439
421Section 4: VBI Capture 440VBI Capture
422---------------------- 441-----------
423 442
424There are three types of VBI capture devices: those that only support raw 443There are three types of VBI capture devices: those that only support raw
425(undecoded) VBI, those that only support sliced (decoded) VBI and those that 444(undecoded) VBI, those that only support sliced (decoded) VBI and those that
@@ -435,8 +454,8 @@ The VBI device will only work for the S-Video and TV inputs, it will give
435back an error if the current input is a webcam or HDMI. 454back an error if the current input is a webcam or HDMI.
436 455
437 456
438Section 5: VBI Output 457VBI Output
439--------------------- 458----------
440 459
441There are three types of VBI output devices: those that only support raw 460There are three types of VBI output devices: those that only support raw
442(undecoded) VBI, those that only support sliced (decoded) VBI and those that 461(undecoded) VBI, those that only support sliced (decoded) VBI and those that
@@ -449,15 +468,15 @@ The VBI device will only work for the S-Video output, it will give
449back an error if the current output is HDMI. 468back an error if the current output is HDMI.
450 469
451 470
452Section 6: Radio Receiver 471Radio Receiver
453------------------------- 472--------------
454 473
455The radio receiver emulates an FM/AM/SW receiver. The FM band also supports RDS. 474The radio receiver emulates an FM/AM/SW receiver. The FM band also supports RDS.
456The frequency ranges are: 475The frequency ranges are:
457 476
458 FM: 64 MHz - 108 MHz 477 - FM: 64 MHz - 108 MHz
459 AM: 520 kHz - 1710 kHz 478 - AM: 520 kHz - 1710 kHz
460 SW: 2300 kHz - 26.1 MHz 479 - SW: 2300 kHz - 26.1 MHz
461 480
462Valid channels are emulated every 1 MHz for FM and every 100 kHz for AM and SW. 481Valid channels are emulated every 1 MHz for FM and every 100 kHz for AM and SW.
463The signal strength decreases the further the frequency is from the valid 482The signal strength decreases the further the frequency is from the valid
@@ -485,15 +504,15 @@ The receiver supports HW frequency seek, either in Bounded mode, Wrap Around
485mode or both, which is configurable with the "Radio HW Seek Mode" control. 504mode or both, which is configurable with the "Radio HW Seek Mode" control.
486 505
487 506
488Section 7: Radio Transmitter 507Radio Transmitter
489---------------------------- 508-----------------
490 509
491The radio transmitter emulates an FM/AM/SW transmitter. The FM band also supports RDS. 510The radio transmitter emulates an FM/AM/SW transmitter. The FM band also supports RDS.
492The frequency ranges are: 511The frequency ranges are:
493 512
494 FM: 64 MHz - 108 MHz 513 - FM: 64 MHz - 108 MHz
495 AM: 520 kHz - 1710 kHz 514 - AM: 520 kHz - 1710 kHz
496 SW: 2300 kHz - 26.1 MHz 515 - SW: 2300 kHz - 26.1 MHz
497 516
498The initial frequency when the driver is loaded is 95.5 MHz. 517The initial frequency when the driver is loaded is 95.5 MHz.
499 518
@@ -503,8 +522,8 @@ using controls, and in 'Block I/O' mode the blocks are passed to the driver
503using write(). 522using write().
504 523
505 524
506Section 8: Software Defined Radio Receiver 525Software Defined Radio Receiver
507------------------------------------------ 526-------------------------------
508 527
509The SDR receiver has three frequency bands for the ADC tuner: 528The SDR receiver has three frequency bands for the ADC tuner:
510 529
@@ -518,15 +537,15 @@ The generated data contains the In-phase and Quadrature components of a
5181 kHz tone that has an amplitude of sqrt(2). 5371 kHz tone that has an amplitude of sqrt(2).
519 538
520 539
521Section 9: Controls 540Controls
522------------------- 541--------
523 542
524Different devices support different controls. The sections below will describe 543Different devices support different controls. The sections below will describe
525each control and which devices support them. 544each control and which devices support them.
526 545
527 546
528Section 9.1: User Controls - Test Controls 547User Controls - Test Controls
529------------------------------------------ 548~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530 549
531The Button, Boolean, Integer 32 Bits, Integer 64 Bits, Menu, String, Bitmask and 550The Button, Boolean, Integer 32 Bits, Integer 64 Bits, Menu, String, Bitmask and
532Integer Menu are controls that represent all possible control types. The Menu 551Integer Menu are controls that represent all possible control types. The Menu
@@ -537,8 +556,8 @@ allow you to check if your application can handle such things correctly.
537These controls are supported for every device type. 556These controls are supported for every device type.
538 557
539 558
540Section 9.2: User Controls - Video Capture 559User Controls - Video Capture
541------------------------------------------ 560~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
542 561
543The following controls are specific to video capture. 562The following controls are specific to video capture.
544 563
@@ -563,8 +582,8 @@ The 'Alpha Component' control can be used to set the alpha component for
563formats containing an alpha channel. 582formats containing an alpha channel.
564 583
565 584
566Section 9.3: User Controls - Audio 585User Controls - Audio
567---------------------------------- 586~~~~~~~~~~~~~~~~~~~~~
568 587
569The following controls are specific to video capture and output and radio 588The following controls are specific to video capture and output and radio
570receivers and transmitters. 589receivers and transmitters.
@@ -574,70 +593,98 @@ control the volume and mute the audio. They don't actually do anything in
574the vivid driver. 593the vivid driver.
575 594
576 595
577Section 9.4: Vivid Controls 596Vivid Controls
578--------------------------- 597~~~~~~~~~~~~~~
579 598
580These vivid custom controls control the image generation, error injection, etc. 599These vivid custom controls control the image generation, error injection, etc.
581 600
582 601
583Section 9.4.1: Test Pattern Controls 602Test Pattern Controls
584------------------------------------ 603^^^^^^^^^^^^^^^^^^^^^
585 604
586The Test Pattern Controls are all specific to video capture. 605The Test Pattern Controls are all specific to video capture.
587 606
588Test Pattern: selects which test pattern to use. Use the CSC Colorbar for 607- Test Pattern:
608
609 selects which test pattern to use. Use the CSC Colorbar for
589 testing colorspace conversions: the colors used in that test pattern 610 testing colorspace conversions: the colors used in that test pattern
590 map to valid colors in all colorspaces. The colorspace conversion 611 map to valid colors in all colorspaces. The colorspace conversion
591 is disabled for the other test patterns. 612 is disabled for the other test patterns.
592 613
593OSD Text Mode: selects whether the text superimposed on the 614- OSD Text Mode:
615
616 selects whether the text superimposed on the
594 test pattern should be shown, and if so, whether only counters should 617 test pattern should be shown, and if so, whether only counters should
595 be displayed or the full text. 618 be displayed or the full text.
596 619
597Horizontal Movement: selects whether the test pattern should 620- Horizontal Movement:
621
622 selects whether the test pattern should
598 move to the left or right and at what speed. 623 move to the left or right and at what speed.
599 624
600Vertical Movement: does the same for the vertical direction. 625- Vertical Movement:
626
627 does the same for the vertical direction.
628
629- Show Border:
601 630
602Show Border: show a two-pixel wide border at the edge of the actual image, 631 show a two-pixel wide border at the edge of the actual image,
603 excluding letter or pillarboxing. 632 excluding letter or pillarboxing.
604 633
605Show Square: show a square in the middle of the image. If the image is 634- Show Square:
635
636 show a square in the middle of the image. If the image is
606 displayed with the correct pixel and image aspect ratio corrections, 637 displayed with the correct pixel and image aspect ratio corrections,
607 then the width and height of the square on the monitor should be 638 then the width and height of the square on the monitor should be
608 the same. 639 the same.
609 640
610Insert SAV Code in Image: adds a SAV (Start of Active Video) code to the image. 641- Insert SAV Code in Image:
642
643 adds a SAV (Start of Active Video) code to the image.
611 This can be used to check if such codes in the image are inadvertently 644 This can be used to check if such codes in the image are inadvertently
612 interpreted instead of being ignored. 645 interpreted instead of being ignored.
613 646
614Insert EAV Code in Image: does the same for the EAV (End of Active Video) code. 647- Insert EAV Code in Image:
615 648
649 does the same for the EAV (End of Active Video) code.
616 650
617Section 9.4.2: Capture Feature Selection Controls 651
618------------------------------------------------- 652Capture Feature Selection Controls
653^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
619 654
620These controls are all specific to video capture. 655These controls are all specific to video capture.
621 656
622Sensor Flipped Horizontally: the image is flipped horizontally and the 657- Sensor Flipped Horizontally:
658
659 the image is flipped horizontally and the
623 V4L2_IN_ST_HFLIP input status flag is set. This emulates the case where 660 V4L2_IN_ST_HFLIP input status flag is set. This emulates the case where
624 a sensor is for example mounted upside down. 661 a sensor is for example mounted upside down.
625 662
626Sensor Flipped Vertically: the image is flipped vertically and the 663- Sensor Flipped Vertically:
664
665 the image is flipped vertically and the
627 V4L2_IN_ST_VFLIP input status flag is set. This emulates the case where 666 V4L2_IN_ST_VFLIP input status flag is set. This emulates the case where
628 a sensor is for example mounted upside down. 667 a sensor is for example mounted upside down.
668
669- Standard Aspect Ratio:
629 670
630Standard Aspect Ratio: selects if the image aspect ratio as used for the TV or 671 selects if the image aspect ratio as used for the TV or
631 S-Video input should be 4x3, 16x9 or anamorphic widescreen. This may 672 S-Video input should be 4x3, 16x9 or anamorphic widescreen. This may
632 introduce letterboxing. 673 introduce letterboxing.
633 674
634DV Timings Aspect Ratio: selects if the image aspect ratio as used for the HDMI 675- DV Timings Aspect Ratio:
676
677 selects if the image aspect ratio as used for the HDMI
635 input should be the same as the source width and height ratio, or if 678 input should be the same as the source width and height ratio, or if
636 it should be 4x3 or 16x9. This may introduce letter or pillarboxing. 679 it should be 4x3 or 16x9. This may introduce letter or pillarboxing.
637 680
638Timestamp Source: selects when the timestamp for each buffer is taken. 681- Timestamp Source:
682
683 selects when the timestamp for each buffer is taken.
639 684
640Colorspace: selects which colorspace should be used when generating the image. 685- Colorspace:
686
687 selects which colorspace should be used when generating the image.
641 This only applies if the CSC Colorbar test pattern is selected, 688 This only applies if the CSC Colorbar test pattern is selected,
642 otherwise the test pattern will go through unconverted. 689 otherwise the test pattern will go through unconverted.
643 This behavior is also what you want, since a 75% Colorbar 690 This behavior is also what you want, since a 75% Colorbar
@@ -647,95 +694,124 @@ Colorspace: selects which colorspace should be used when generating the image.
647 Changing the colorspace will result in the V4L2_EVENT_SOURCE_CHANGE 694 Changing the colorspace will result in the V4L2_EVENT_SOURCE_CHANGE
648 to be sent since it emulates a detected colorspace change. 695 to be sent since it emulates a detected colorspace change.
649 696
650Transfer Function: selects which colorspace transfer function should be used when 697- Transfer Function:
698
699 selects which colorspace transfer function should be used when
651 generating an image. This only applies if the CSC Colorbar test pattern is 700 generating an image. This only applies if the CSC Colorbar test pattern is
652 selected, otherwise the test pattern will go through unconverted. 701 selected, otherwise the test pattern will go through unconverted.
653 This behavior is also what you want, since a 75% Colorbar 702 This behavior is also what you want, since a 75% Colorbar
654 should really have 75% signal intensity and should not be affected 703 should really have 75% signal intensity and should not be affected
655 by colorspace conversions. 704 by colorspace conversions.
656 705
657 Changing the transfer function will result in the V4L2_EVENT_SOURCE_CHANGE 706 Changing the transfer function will result in the V4L2_EVENT_SOURCE_CHANGE
658 to be sent since it emulates a detected colorspace change. 707 to be sent since it emulates a detected colorspace change.
659 708
660Y'CbCr Encoding: selects which Y'CbCr encoding should be used when generating 709- Y'CbCr Encoding:
710
711 selects which Y'CbCr encoding should be used when generating
661 a Y'CbCr image. This only applies if the format is set to a Y'CbCr format 712 a Y'CbCr image. This only applies if the format is set to a Y'CbCr format
662 as opposed to an RGB format. 713 as opposed to an RGB format.
663 714
664 Changing the Y'CbCr encoding will result in the V4L2_EVENT_SOURCE_CHANGE 715 Changing the Y'CbCr encoding will result in the V4L2_EVENT_SOURCE_CHANGE
665 to be sent since it emulates a detected colorspace change. 716 to be sent since it emulates a detected colorspace change.
666 717
667Quantization: selects which quantization should be used for the RGB or Y'CbCr 718- Quantization:
719
720 selects which quantization should be used for the RGB or Y'CbCr
668 encoding when generating the test pattern. 721 encoding when generating the test pattern.
669 722
670 Changing the quantization will result in the V4L2_EVENT_SOURCE_CHANGE 723 Changing the quantization will result in the V4L2_EVENT_SOURCE_CHANGE
671 to be sent since it emulates a detected colorspace change. 724 to be sent since it emulates a detected colorspace change.
672 725
673Limited RGB Range (16-235): selects if the RGB range of the HDMI source should 726- Limited RGB Range (16-235):
727
728 selects if the RGB range of the HDMI source should
674 be limited or full range. This combines with the Digital Video 'Rx RGB 729 be limited or full range. This combines with the Digital Video 'Rx RGB
675 Quantization Range' control and can be used to test what happens if 730 Quantization Range' control and can be used to test what happens if
676 a source provides you with the wrong quantization range information. 731 a source provides you with the wrong quantization range information.
677 See the description of that control for more details. 732 See the description of that control for more details.
678 733
679Apply Alpha To Red Only: apply the alpha channel as set by the 'Alpha Component' 734- Apply Alpha To Red Only:
735
736 apply the alpha channel as set by the 'Alpha Component'
680 user control to the red color of the test pattern only. 737 user control to the red color of the test pattern only.
681 738
682Enable Capture Cropping: enables crop support. This control is only present if 739- Enable Capture Cropping:
740
741 enables crop support. This control is only present if
683 the ccs_cap_mode module option is set to the default value of -1 and if 742 the ccs_cap_mode module option is set to the default value of -1 and if
684 the no_error_inj module option is set to 0 (the default). 743 the no_error_inj module option is set to 0 (the default).
685 744
686Enable Capture Composing: enables composing support. This control is only 745- Enable Capture Composing:
746
747 enables composing support. This control is only
687 present if the ccs_cap_mode module option is set to the default value of 748 present if the ccs_cap_mode module option is set to the default value of
688 -1 and if the no_error_inj module option is set to 0 (the default). 749 -1 and if the no_error_inj module option is set to 0 (the default).
689 750
690Enable Capture Scaler: enables support for a scaler (maximum 4 times upscaling 751- Enable Capture Scaler:
752
753 enables support for a scaler (maximum 4 times upscaling
691 and downscaling). This control is only present if the ccs_cap_mode 754 and downscaling). This control is only present if the ccs_cap_mode
692 module option is set to the default value of -1 and if the no_error_inj 755 module option is set to the default value of -1 and if the no_error_inj
693 module option is set to 0 (the default). 756 module option is set to 0 (the default).
694 757
695Maximum EDID Blocks: determines how many EDID blocks the driver supports. 758- Maximum EDID Blocks:
759
760 determines how many EDID blocks the driver supports.
696 Note that the vivid driver does not actually interpret new EDID 761 Note that the vivid driver does not actually interpret new EDID
697 data, it just stores it. It allows for up to 256 EDID blocks 762 data, it just stores it. It allows for up to 256 EDID blocks
698 which is the maximum supported by the standard. 763 which is the maximum supported by the standard.
699 764
700Fill Percentage of Frame: can be used to draw only the top X percent 765- Fill Percentage of Frame:
766
767 can be used to draw only the top X percent
701 of the image. Since each frame has to be drawn by the driver, this 768 of the image. Since each frame has to be drawn by the driver, this
702 demands a lot of the CPU. For large resolutions this becomes 769 demands a lot of the CPU. For large resolutions this becomes
703 problematic. By drawing only part of the image this CPU load can 770 problematic. By drawing only part of the image this CPU load can
704 be reduced. 771 be reduced.
705 772
706 773
707Section 9.4.3: Output Feature Selection Controls 774Output Feature Selection Controls
708------------------------------------------------ 775^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
709 776
710These controls are all specific to video output. 777These controls are all specific to video output.
711 778
712Enable Output Cropping: enables crop support. This control is only present if 779- Enable Output Cropping:
780
781 enables crop support. This control is only present if
713 the ccs_out_mode module option is set to the default value of -1 and if 782 the ccs_out_mode module option is set to the default value of -1 and if
714 the no_error_inj module option is set to 0 (the default). 783 the no_error_inj module option is set to 0 (the default).
715 784
716Enable Output Composing: enables composing support. This control is only 785- Enable Output Composing:
786
787 enables composing support. This control is only
717 present if the ccs_out_mode module option is set to the default value of 788 present if the ccs_out_mode module option is set to the default value of
718 -1 and if the no_error_inj module option is set to 0 (the default). 789 -1 and if the no_error_inj module option is set to 0 (the default).
719 790
720Enable Output Scaler: enables support for a scaler (maximum 4 times upscaling 791- Enable Output Scaler:
792
793 enables support for a scaler (maximum 4 times upscaling
721 and downscaling). This control is only present if the ccs_out_mode 794 and downscaling). This control is only present if the ccs_out_mode
722 module option is set to the default value of -1 and if the no_error_inj 795 module option is set to the default value of -1 and if the no_error_inj
723 module option is set to 0 (the default). 796 module option is set to 0 (the default).
724 797
725 798
726Section 9.4.4: Error Injection Controls 799Error Injection Controls
727--------------------------------------- 800^^^^^^^^^^^^^^^^^^^^^^^^
728 801
729The following two controls are only valid for video and vbi capture. 802The following two controls are only valid for video and vbi capture.
730 803
731Standard Signal Mode: selects the behavior of VIDIOC_QUERYSTD: what should 804- Standard Signal Mode:
732 it return? 805
806 selects the behavior of VIDIOC_QUERYSTD: what should it return?
733 807
734 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE 808 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
735 to be sent since it emulates a changed input condition (e.g. a cable 809 to be sent since it emulates a changed input condition (e.g. a cable
736 was plugged in or out). 810 was plugged in or out).
737 811
738Standard: selects the standard that VIDIOC_QUERYSTD should return if the 812- Standard:
813
814 selects the standard that VIDIOC_QUERYSTD should return if the
739 previous control is set to "Selected Standard". 815 previous control is set to "Selected Standard".
740 816
741 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE 817 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
@@ -744,14 +820,17 @@ Standard: selects the standard that VIDIOC_QUERYSTD should return if the
744 820
745The following two controls are only valid for video capture. 821The following two controls are only valid for video capture.
746 822
747DV Timings Signal Mode: selects the behavior of VIDIOC_QUERY_DV_TIMINGS: what 823- DV Timings Signal Mode:
824 selects the behavior of VIDIOC_QUERY_DV_TIMINGS: what
748 should it return? 825 should it return?
749 826
750 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE 827 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
751 to be sent since it emulates a changed input condition (e.g. a cable 828 to be sent since it emulates a changed input condition (e.g. a cable
752 was plugged in or out). 829 was plugged in or out).
753 830
754DV Timings: selects the timings the VIDIOC_QUERY_DV_TIMINGS should return 831- DV Timings:
832
833 selects the timings the VIDIOC_QUERY_DV_TIMINGS should return
755 if the previous control is set to "Selected DV Timings". 834 if the previous control is set to "Selected DV Timings".
756 835
757 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE 836 Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
@@ -763,52 +842,74 @@ is set to 0 (the default). These controls are valid for video and vbi
763capture and output streams and for the SDR capture device except for the 842capture and output streams and for the SDR capture device except for the
764Disconnect control which is valid for all devices. 843Disconnect control which is valid for all devices.
765 844
766Wrap Sequence Number: test what happens when you wrap the sequence number in 845- Wrap Sequence Number:
846
847 test what happens when you wrap the sequence number in
767 struct v4l2_buffer around. 848 struct v4l2_buffer around.
768 849
769Wrap Timestamp: test what happens when you wrap the timestamp in struct 850- Wrap Timestamp:
851
852 test what happens when you wrap the timestamp in struct
770 v4l2_buffer around. 853 v4l2_buffer around.
771 854
772Percentage of Dropped Buffers: sets the percentage of buffers that 855- Percentage of Dropped Buffers:
856
857 sets the percentage of buffers that
773 are never returned by the driver (i.e., they are dropped). 858 are never returned by the driver (i.e., they are dropped).
774 859
775Disconnect: emulates a USB disconnect. The device will act as if it has 860- Disconnect:
861
862 emulates a USB disconnect. The device will act as if it has
776 been disconnected. Only after all open filehandles to the device 863 been disconnected. Only after all open filehandles to the device
777 node have been closed will the device become 'connected' again. 864 node have been closed will the device become 'connected' again.
778 865
779Inject V4L2_BUF_FLAG_ERROR: when pressed, the next frame returned by 866- Inject V4L2_BUF_FLAG_ERROR:
867
868 when pressed, the next frame returned by
780 the driver will have the error flag set (i.e. the frame is marked 869 the driver will have the error flag set (i.e. the frame is marked
781 corrupt). 870 corrupt).
782 871
783Inject VIDIOC_REQBUFS Error: when pressed, the next REQBUFS or CREATE_BUFS 872- Inject VIDIOC_REQBUFS Error:
873
874 when pressed, the next REQBUFS or CREATE_BUFS
784 ioctl call will fail with an error. To be precise: the videobuf2 875 ioctl call will fail with an error. To be precise: the videobuf2
785 queue_setup() op will return -EINVAL. 876 queue_setup() op will return -EINVAL.
786 877
787Inject VIDIOC_QBUF Error: when pressed, the next VIDIOC_QBUF or 878- Inject VIDIOC_QBUF Error:
879
880 when pressed, the next VIDIOC_QBUF or
788 VIDIOC_PREPARE_BUFFER ioctl call will fail with an error. To be 881 VIDIOC_PREPARE_BUFFER ioctl call will fail with an error. To be
789 precise: the videobuf2 buf_prepare() op will return -EINVAL. 882 precise: the videobuf2 buf_prepare() op will return -EINVAL.
790 883
791Inject VIDIOC_STREAMON Error: when pressed, the next VIDIOC_STREAMON ioctl 884- Inject VIDIOC_STREAMON Error:
885
886 when pressed, the next VIDIOC_STREAMON ioctl
792 call will fail with an error. To be precise: the videobuf2 887 call will fail with an error. To be precise: the videobuf2
793 start_streaming() op will return -EINVAL. 888 start_streaming() op will return -EINVAL.
794 889
795Inject Fatal Streaming Error: when pressed, the streaming core will be 890- Inject Fatal Streaming Error:
891
892 when pressed, the streaming core will be
796 marked as having suffered a fatal error, the only way to recover 893 marked as having suffered a fatal error, the only way to recover
797 from that is to stop streaming. To be precise: the videobuf2 894 from that is to stop streaming. To be precise: the videobuf2
798 vb2_queue_error() function is called. 895 vb2_queue_error() function is called.
799 896
800 897
801Section 9.4.5: VBI Raw Capture Controls 898VBI Raw Capture Controls
802--------------------------------------- 899^^^^^^^^^^^^^^^^^^^^^^^^
900
901- Interlaced VBI Format:
803 902
804Interlaced VBI Format: if set, then the raw VBI data will be interlaced instead 903 if set, then the raw VBI data will be interlaced instead
805 of providing it grouped by field. 904 of providing it grouped by field.
806 905
807 906
808Section 9.5: Digital Video Controls 907Digital Video Controls
809----------------------------------- 908~~~~~~~~~~~~~~~~~~~~~~
810 909
811Rx RGB Quantization Range: sets the RGB quantization detection of the HDMI 910- Rx RGB Quantization Range:
911
912 sets the RGB quantization detection of the HDMI
812 input. This combines with the Vivid 'Limited RGB Range (16-235)' 913 input. This combines with the Vivid 'Limited RGB Range (16-235)'
813 control and can be used to test what happens if a source provides 914 control and can be used to test what happens if a source provides
814 you with the wrong quantization range information. This can be tested 915 you with the wrong quantization range information. This can be tested
@@ -817,72 +918,124 @@ Rx RGB Quantization Range: sets the RGB quantization detection of the HDMI
817 control. The effect is easy to see if the 'Gray Ramp' test pattern 918 control. The effect is easy to see if the 'Gray Ramp' test pattern
818 is selected. 919 is selected.
819 920
820Tx RGB Quantization Range: sets the RGB quantization detection of the HDMI 921- Tx RGB Quantization Range:
922
923 sets the RGB quantization detection of the HDMI
821 output. It is currently not used for anything in vivid, but most HDMI 924 output. It is currently not used for anything in vivid, but most HDMI
822 transmitters would typically have this control. 925 transmitters would typically have this control.
823 926
824Transmit Mode: sets the transmit mode of the HDMI output to HDMI or DVI-D. This 927- Transmit Mode:
928
929 sets the transmit mode of the HDMI output to HDMI or DVI-D. This
825 affects the reported colorspace since DVI_D outputs will always use 930 affects the reported colorspace since DVI_D outputs will always use
826 sRGB. 931 sRGB.
827 932
828 933
829Section 9.6: FM Radio Receiver Controls 934FM Radio Receiver Controls
830--------------------------------------- 935~~~~~~~~~~~~~~~~~~~~~~~~~~
936
937- RDS Reception:
938
939 set if the RDS receiver should be enabled.
940
941- RDS Program Type:
942
943
944- RDS PS Name:
945
831 946
832RDS Reception: set if the RDS receiver should be enabled. 947- RDS Radio Text:
833 948
834RDS Program Type: 949
835RDS PS Name: 950- RDS Traffic Announcement:
836RDS Radio Text: 951
837RDS Traffic Announcement: 952
838RDS Traffic Program: 953- RDS Traffic Program:
839RDS Music: these are all read-only controls. If RDS Rx I/O Mode is set to 954
955
956- RDS Music:
957
958 these are all read-only controls. If RDS Rx I/O Mode is set to
840 "Block I/O", then they are inactive as well. If RDS Rx I/O Mode is set 959 "Block I/O", then they are inactive as well. If RDS Rx I/O Mode is set
841 to "Controls", then these controls report the received RDS data. Note 960 to "Controls", then these controls report the received RDS data.
842 that the vivid implementation of this is pretty basic: they are only 961
962.. note::
963 The vivid implementation of this is pretty basic: they are only
843 updated when you set a new frequency or when you get the tuner status 964 updated when you set a new frequency or when you get the tuner status
844 (VIDIOC_G_TUNER). 965 (VIDIOC_G_TUNER).
845 966
846Radio HW Seek Mode: can be one of "Bounded", "Wrap Around" or "Both". This 967- Radio HW Seek Mode:
968
969 can be one of "Bounded", "Wrap Around" or "Both". This
847 determines if VIDIOC_S_HW_FREQ_SEEK will be bounded by the frequency 970 determines if VIDIOC_S_HW_FREQ_SEEK will be bounded by the frequency
848 range or wrap-around or if it is selectable by the user. 971 range or wrap-around or if it is selectable by the user.
849 972
850Radio Programmable HW Seek: if set, then the user can provide the lower and 973- Radio Programmable HW Seek:
974
975 if set, then the user can provide the lower and
851 upper bound of the HW Seek. Otherwise the frequency range boundaries 976 upper bound of the HW Seek. Otherwise the frequency range boundaries
852 will be used. 977 will be used.
853 978
854Generate RBDS Instead of RDS: if set, then generate RBDS (the US variant of 979- Generate RBDS Instead of RDS:
980
981 if set, then generate RBDS (the US variant of
855 RDS) data instead of RDS (European-style RDS). This affects only the 982 RDS) data instead of RDS (European-style RDS). This affects only the
856 PICODE and PTY codes. 983 PICODE and PTY codes.
857 984
858RDS Rx I/O Mode: this can be "Block I/O" where the RDS blocks have to be read() 985- RDS Rx I/O Mode:
986
987 this can be "Block I/O" where the RDS blocks have to be read()
859 by the application, or "Controls" where the RDS data is provided by 988 by the application, or "Controls" where the RDS data is provided by
860 the RDS controls mentioned above. 989 the RDS controls mentioned above.
861 990
862 991
863Section 9.7: FM Radio Modulator Controls 992FM Radio Modulator Controls
864---------------------------------------- 993~~~~~~~~~~~~~~~~~~~~~~~~~~~
865 994
866RDS Program ID: 995- RDS Program ID:
867RDS Program Type: 996
868RDS PS Name: 997
869RDS Radio Text: 998- RDS Program Type:
870RDS Stereo: 999
871RDS Artificial Head: 1000
872RDS Compressed: 1001- RDS PS Name:
873RDS Dynamic PTY: 1002
874RDS Traffic Announcement: 1003
875RDS Traffic Program: 1004- RDS Radio Text:
876RDS Music: these are all controls that set the RDS data that is transmitted by 1005
1006
1007- RDS Stereo:
1008
1009
1010- RDS Artificial Head:
1011
1012
1013- RDS Compressed:
1014
1015
1016- RDS Dynamic PTY:
1017
1018
1019- RDS Traffic Announcement:
1020
1021
1022- RDS Traffic Program:
1023
1024
1025- RDS Music:
1026
1027 these are all controls that set the RDS data that is transmitted by
877 the FM modulator. 1028 the FM modulator.
878 1029
879RDS Tx I/O Mode: this can be "Block I/O" where the application has to use write() 1030- RDS Tx I/O Mode:
880 to pass the RDS blocks to the driver, or "Controls" where the RDS data is
881 provided by the RDS controls mentioned above.
882 1031
1032 this can be "Block I/O" where the application has to use write()
1033 to pass the RDS blocks to the driver, or "Controls" where the RDS data
1034 is Provided by the RDS controls mentioned above.
883 1035
884Section 10: Video, VBI and RDS Looping 1036
885-------------------------------------- 1037Video, VBI and RDS Looping
1038--------------------------
886 1039
887The vivid driver supports looping of video output to video input, VBI output 1040The vivid driver supports looping of video output to video input, VBI output
888to VBI input and RDS output to RDS input. For video/VBI looping this emulates 1041to VBI input and RDS output to RDS input. For video/VBI looping this emulates
@@ -898,8 +1051,8 @@ Looping is currently supported only between devices created by the same
898vivid driver instance. 1051vivid driver instance.
899 1052
900 1053
901Section 10.1: Video and Sliced VBI looping 1054Video and Sliced VBI looping
902------------------------------------------ 1055~~~~~~~~~~~~~~~~~~~~~~~~~~~~
903 1056
904The way to enable video/VBI looping is currently fairly crude. A 'Loop Video' 1057The way to enable video/VBI looping is currently fairly crude. A 'Loop Video'
905control is available in the "Vivid" control class of the video 1058control is available in the "Vivid" control class of the video
@@ -948,8 +1101,8 @@ for either raw or sliced VBI. Note that at the moment only CC/XDS (60 Hz formats
948and WSS (50 Hz formats) VBI data is looped. Teletext VBI data is not looped. 1101and WSS (50 Hz formats) VBI data is looped. Teletext VBI data is not looped.
949 1102
950 1103
951Section 10.2: Radio & RDS Looping 1104Radio & RDS Looping
952--------------------------------- 1105~~~~~~~~~~~~~~~~~~~
953 1106
954As mentioned in section 6 the radio receiver emulates stations are regular 1107As mentioned in section 6 the radio receiver emulates stations are regular
955frequency intervals. Depending on the frequency of the radio receiver a 1108frequency intervals. Depending on the frequency of the radio receiver a
@@ -963,8 +1116,8 @@ frequencies of the radio receiver and transmitter are not identical, so
963initially no looping takes place. 1116initially no looping takes place.
964 1117
965 1118
966Section 11: Cropping, Composing, Scaling 1119Cropping, Composing, Scaling
967---------------------------------------- 1120----------------------------
968 1121
969This driver supports cropping, composing and scaling in any combination. Normally 1122This driver supports cropping, composing and scaling in any combination. Normally
970which features are supported can be selected through the Vivid controls, 1123which features are supported can be selected through the Vivid controls,
@@ -997,8 +1150,8 @@ If the combination of crop, compose and scaling allows it, then it is possible
997to change crop and compose rectangles on the fly. 1150to change crop and compose rectangles on the fly.
998 1151
999 1152
1000Section 12: Formats 1153Formats
1001------------------- 1154-------
1002 1155
1003The driver supports all the regular packed and planar 4:4:4, 4:2:2 and 4:2:0 1156The driver supports all the regular packed and planar 4:4:4, 4:2:2 and 4:2:0
1004YUYV formats, 8, 16, 24 and 32 RGB packed formats and various multiplanar 1157YUYV formats, 8, 16, 24 and 32 RGB packed formats and various multiplanar
@@ -1021,8 +1174,8 @@ data_offset to be non-zero, so this is a useful feature for testing applications
1021Video output will also honor any data_offset that the application set. 1174Video output will also honor any data_offset that the application set.
1022 1175
1023 1176
1024Section 13: Capture Overlay 1177Capture Overlay
1025--------------------------- 1178---------------
1026 1179
1027Note: capture overlay support is implemented primarily to test the existing 1180Note: capture overlay support is implemented primarily to test the existing
1028V4L2 capture overlay API. In practice few if any GPUs support such overlays 1181V4L2 capture overlay API. In practice few if any GPUs support such overlays
@@ -1055,6 +1208,8 @@ the output overlay for the video output, turn on video looping and capture
1055to see the blended framebuffer overlay that's being written to by the second 1208to see the blended framebuffer overlay that's being written to by the second
1056instance. This setup would require the following commands: 1209instance. This setup would require the following commands:
1057 1210
1211.. code-block:: none
1212
1058 $ sudo modprobe vivid n_devs=2 node_types=0x10101,0x1 1213 $ sudo modprobe vivid n_devs=2 node_types=0x10101,0x1
1059 $ v4l2-ctl -d1 --find-fb 1214 $ v4l2-ctl -d1 --find-fb
1060 /dev/fb1 is the framebuffer associated with base address 0x12800000 1215 /dev/fb1 is the framebuffer associated with base address 0x12800000
@@ -1072,10 +1227,14 @@ instance. This setup would require the following commands:
1072 1227
1073And from another console: 1228And from another console:
1074 1229
1230.. code-block:: none
1231
1075 $ v4l2-ctl -d1 --stream-out-mmap 1232 $ v4l2-ctl -d1 --stream-out-mmap
1076 1233
1077And yet another console: 1234And yet another console:
1078 1235
1236.. code-block:: none
1237
1079 $ qv4l2 1238 $ qv4l2
1080 1239
1081and start streaming. 1240and start streaming.
@@ -1083,8 +1242,8 @@ and start streaming.
1083As you can see, this is not for the faint of heart... 1242As you can see, this is not for the faint of heart...
1084 1243
1085 1244
1086Section 14: Output Overlay 1245Output Overlay
1087-------------------------- 1246--------------
1088 1247
1089Note: output overlays are primarily implemented in order to test the existing 1248Note: output overlays are primarily implemented in order to test the existing
1090V4L2 output overlay API. Whether this API should be used for new drivers is 1249V4L2 output overlay API. Whether this API should be used for new drivers is
@@ -1116,8 +1275,8 @@ capabilities will slow down the video loop considerably as a lot of checks have
1116to be done per pixel. 1275to be done per pixel.
1117 1276
1118 1277
1119Section 15: CEC (Consumer Electronics Control) 1278CEC (Consumer Electronics Control)
1120---------------------------------------------- 1279----------------------------------
1121 1280
1122If there are HDMI inputs then a CEC adapter will be created that has 1281If there are HDMI inputs then a CEC adapter will be created that has
1123the same number of input ports. This is the equivalent of e.g. a TV that 1282the same number of input ports. This is the equivalent of e.g. a TV that
@@ -1135,8 +1294,8 @@ there are more outputs than inputs then the remaining outputs have a CEC adapter
1135that is disabled and reports an invalid physical address. 1294that is disabled and reports an invalid physical address.
1136 1295
1137 1296
1138Section 16: Some Future Improvements 1297Some Future Improvements
1139------------------------------------ 1298------------------------
1140 1299
1141Just as a reminder and in no particular order: 1300Just as a reminder and in no particular order:
1142 1301
diff --git a/Documentation/video4linux/Zoran b/Documentation/media/v4l-drivers/zoran.rst
index b5a911fd0602..c3a0f7bc2c7b 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/media/v4l-drivers/zoran.rst
@@ -1,139 +1,191 @@
1Frequently Asked Questions: 1The Zoran driver
2=========================== 2================
3subject: unified zoran driver (zr360x7, zoran, buz, dc10(+), dc30(+), lml33) 3
4unified zoran driver (zr360x7, zoran, buz, dc10(+), dc30(+), lml33)
5
4website: http://mjpeg.sourceforge.net/driver-zoran/ 6website: http://mjpeg.sourceforge.net/driver-zoran/
5 7
61. What cards are supported
71.1 What the TV decoder can do an what not
81.2 What the TV encoder can do an what not
92. How do I get this damn thing to work
103. What mainboard should I use (or why doesn't my card work)
114. Programming interface
125. Applications
136. Concerning buffer sizes, quality, output size etc.
147. It hangs/crashes/fails/whatevers! Help!
158. Maintainers/Contacting
169. License
17 8
18=========================== 9Frequently Asked Questions
10--------------------------
19 11
201. What cards are supported 12What cards are supported
13------------------------
21 14
22Iomega Buz, Linux Media Labs LML33/LML33R10, Pinnacle/Miro 15Iomega Buz, Linux Media Labs LML33/LML33R10, Pinnacle/Miro
23DC10/DC10+/DC30/DC30+ and related boards (available under various names). 16DC10/DC10+/DC30/DC30+ and related boards (available under various names).
24 17
25Iomega Buz: 18Iomega Buz
19~~~~~~~~~~
20
26* Zoran zr36067 PCI controller 21* Zoran zr36067 PCI controller
27* Zoran zr36060 MJPEG codec 22* Zoran zr36060 MJPEG codec
28* Philips saa7111 TV decoder 23* Philips saa7111 TV decoder
29* Philips saa7185 TV encoder 24* Philips saa7185 TV encoder
25
30Drivers to use: videodev, i2c-core, i2c-algo-bit, 26Drivers to use: videodev, i2c-core, i2c-algo-bit,
31 videocodec, saa7111, saa7185, zr36060, zr36067 27videocodec, saa7111, saa7185, zr36060, zr36067
28
32Inputs/outputs: Composite and S-video 29Inputs/outputs: Composite and S-video
30
33Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) 31Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
32
34Card number: 7 33Card number: 7
35 34
36AverMedia 6 Eyes AVS6EYES: 35AverMedia 6 Eyes AVS6EYES
36~~~~~~~~~~~~~~~~~~~~~~~~~
37
37* Zoran zr36067 PCI controller 38* Zoran zr36067 PCI controller
38* Zoran zr36060 MJPEG codec 39* Zoran zr36060 MJPEG codec
39* Samsung ks0127 TV decoder 40* Samsung ks0127 TV decoder
40* Conexant bt866 TV encoder 41* Conexant bt866 TV encoder
42
41Drivers to use: videodev, i2c-core, i2c-algo-bit, 43Drivers to use: videodev, i2c-core, i2c-algo-bit,
42 videocodec, ks0127, bt866, zr36060, zr36067 44videocodec, ks0127, bt866, zr36060, zr36067
43Inputs/outputs: Six physical inputs. 1-6 are composite, 45
44 1-2, 3-4, 5-6 doubles as S-video, 46Inputs/outputs:
45 1-3 triples as component. 47 Six physical inputs. 1-6 are composite,
46 One composite output. 48 1-2, 3-4, 5-6 doubles as S-video,
49 1-3 triples as component.
50 One composite output.
51
47Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) 52Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
53
48Card number: 8 54Card number: 8
49Not autodetected, card=8 is necessary.
50 55
51Linux Media Labs LML33: 56.. note::
57
58 Not autodetected, card=8 is necessary.
59
60Linux Media Labs LML33
61~~~~~~~~~~~~~~~~~~~~~~
62
52* Zoran zr36067 PCI controller 63* Zoran zr36067 PCI controller
53* Zoran zr36060 MJPEG codec 64* Zoran zr36060 MJPEG codec
54* Brooktree bt819 TV decoder 65* Brooktree bt819 TV decoder
55* Brooktree bt856 TV encoder 66* Brooktree bt856 TV encoder
67
56Drivers to use: videodev, i2c-core, i2c-algo-bit, 68Drivers to use: videodev, i2c-core, i2c-algo-bit,
57 videocodec, bt819, bt856, zr36060, zr36067 69videocodec, bt819, bt856, zr36060, zr36067
70
58Inputs/outputs: Composite and S-video 71Inputs/outputs: Composite and S-video
72
59Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) 73Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
74
60Card number: 5 75Card number: 5
61 76
62Linux Media Labs LML33R10: 77Linux Media Labs LML33R10
78~~~~~~~~~~~~~~~~~~~~~~~~~
79
63* Zoran zr36067 PCI controller 80* Zoran zr36067 PCI controller
64* Zoran zr36060 MJPEG codec 81* Zoran zr36060 MJPEG codec
65* Philips saa7114 TV decoder 82* Philips saa7114 TV decoder
66* Analog Devices adv7170 TV encoder 83* Analog Devices adv7170 TV encoder
84
67Drivers to use: videodev, i2c-core, i2c-algo-bit, 85Drivers to use: videodev, i2c-core, i2c-algo-bit,
68 videocodec, saa7114, adv7170, zr36060, zr36067 86videocodec, saa7114, adv7170, zr36060, zr36067
87
69Inputs/outputs: Composite and S-video 88Inputs/outputs: Composite and S-video
89
70Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) 90Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
91
71Card number: 6 92Card number: 6
72 93
73Pinnacle/Miro DC10(new): 94Pinnacle/Miro DC10(new)
95~~~~~~~~~~~~~~~~~~~~~~~
96
74* Zoran zr36057 PCI controller 97* Zoran zr36057 PCI controller
75* Zoran zr36060 MJPEG codec 98* Zoran zr36060 MJPEG codec
76* Philips saa7110a TV decoder 99* Philips saa7110a TV decoder
77* Analog Devices adv7176 TV encoder 100* Analog Devices adv7176 TV encoder
101
78Drivers to use: videodev, i2c-core, i2c-algo-bit, 102Drivers to use: videodev, i2c-core, i2c-algo-bit,
79 videocodec, saa7110, adv7175, zr36060, zr36067 103videocodec, saa7110, adv7175, zr36060, zr36067
104
80Inputs/outputs: Composite, S-video and Internal 105Inputs/outputs: Composite, S-video and Internal
106
81Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps) 107Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
108
82Card number: 1 109Card number: 1
83 110
84Pinnacle/Miro DC10+: 111Pinnacle/Miro DC10+
112~~~~~~~~~~~~~~~~~~~
113
85* Zoran zr36067 PCI controller 114* Zoran zr36067 PCI controller
86* Zoran zr36060 MJPEG codec 115* Zoran zr36060 MJPEG codec
87* Philips saa7110a TV decoder 116* Philips saa7110a TV decoder
88* Analog Devices adv7176 TV encoder 117* Analog Devices adv7176 TV encoder
118
89Drivers to use: videodev, i2c-core, i2c-algo-bit, 119Drivers to use: videodev, i2c-core, i2c-algo-bit,
90 videocodec, sa7110, adv7175, zr36060, zr36067 120videocodec, sa7110, adv7175, zr36060, zr36067
121
91Inputs/outputs: Composite, S-video and Internal 122Inputs/outputs: Composite, S-video and Internal
123
92Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps) 124Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
125
93Card number: 2 126Card number: 2
94 127
95Pinnacle/Miro DC10(old): * 128Pinnacle/Miro DC10(old)
129~~~~~~~~~~~~~~~~~~~~~~~
130
96* Zoran zr36057 PCI controller 131* Zoran zr36057 PCI controller
97* Zoran zr36050 MJPEG codec 132* Zoran zr36050 MJPEG codec
98* Zoran zr36016 Video Front End or Fuji md0211 Video Front End (clone?) 133* Zoran zr36016 Video Front End or Fuji md0211 Video Front End (clone?)
99* Micronas vpx3220a TV decoder 134* Micronas vpx3220a TV decoder
100* mse3000 TV encoder or Analog Devices adv7176 TV encoder * 135* mse3000 TV encoder or Analog Devices adv7176 TV encoder
136
101Drivers to use: videodev, i2c-core, i2c-algo-bit, 137Drivers to use: videodev, i2c-core, i2c-algo-bit,
102 videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067 138videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067
139
103Inputs/outputs: Composite, S-video and Internal 140Inputs/outputs: Composite, S-video and Internal
141
104Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps) 142Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
143
105Card number: 0 144Card number: 0
106 145
107Pinnacle/Miro DC30: * 146Pinnacle/Miro DC30
147~~~~~~~~~~~~~~~~~~
148
108* Zoran zr36057 PCI controller 149* Zoran zr36057 PCI controller
109* Zoran zr36050 MJPEG codec 150* Zoran zr36050 MJPEG codec
110* Zoran zr36016 Video Front End 151* Zoran zr36016 Video Front End
111* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder 152* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
112* Analog Devices adv7176 TV encoder 153* Analog Devices adv7176 TV encoder
154
113Drivers to use: videodev, i2c-core, i2c-algo-bit, 155Drivers to use: videodev, i2c-core, i2c-algo-bit,
114 videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067 156videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067
157
115Inputs/outputs: Composite, S-video and Internal 158Inputs/outputs: Composite, S-video and Internal
159
116Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps) 160Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
161
117Card number: 3 162Card number: 3
118 163
119Pinnacle/Miro DC30+: * 164Pinnacle/Miro DC30+
165~~~~~~~~~~~~~~~~~~~
166
120* Zoran zr36067 PCI controller 167* Zoran zr36067 PCI controller
121* Zoran zr36050 MJPEG codec 168* Zoran zr36050 MJPEG codec
122* Zoran zr36016 Video Front End 169* Zoran zr36016 Video Front End
123* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder 170* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
124* Analog Devices adv7176 TV encoder 171* Analog Devices adv7176 TV encoder
172
125Drivers to use: videodev, i2c-core, i2c-algo-bit, 173Drivers to use: videodev, i2c-core, i2c-algo-bit,
126 videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067 174videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067
175
127Inputs/outputs: Composite, S-video and Internal 176Inputs/outputs: Composite, S-video and Internal
177
128Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps) 178Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
179
129Card number: 4 180Card number: 4
130 181
131Note: No module for the mse3000 is available yet 182.. note::
132Note: No module for the vpx3224 is available yet
133 183
134=========================== 184 #) No module for the mse3000 is available yet
185 #) No module for the vpx3224 is available yet
135 186
1361.1 What the TV decoder can do an what not 1871.1 What the TV decoder can do an what not
188------------------------------------------
137 189
138The best know TV standards are NTSC/PAL/SECAM. but for decoding a frame that 190The best know TV standards are NTSC/PAL/SECAM. but for decoding a frame that
139information is not enough. There are several formats of the TV standards. 191information is not enough. There are several formats of the TV standards.
@@ -187,32 +239,44 @@ to split coma and luma instead of a Delay line.
187But I did not defiantly find out what NTSC Comb is. 239But I did not defiantly find out what NTSC Comb is.
188 240
189Philips saa7111 TV decoder 241Philips saa7111 TV decoder
190was introduced in 1997, is used in the BUZ and 242~~~~~~~~~~~~~~~~~~~~~~~~~~
191can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC N, NTSC 4.43 and SECAM 243
244- was introduced in 1997, is used in the BUZ and
245- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC N, NTSC 4.43 and SECAM
192 246
193Philips saa7110a TV decoder 247Philips saa7110a TV decoder
194was introduced in 1995, is used in the Pinnacle/Miro DC10(new), DC10+ and 248~~~~~~~~~~~~~~~~~~~~~~~~~~~
195can handle: PAL B/G, NTSC M and SECAM 249
250- was introduced in 1995, is used in the Pinnacle/Miro DC10(new), DC10+ and
251- can handle: PAL B/G, NTSC M and SECAM
196 252
197Philips saa7114 TV decoder 253Philips saa7114 TV decoder
198was introduced in 2000, is used in the LML33R10 and 254~~~~~~~~~~~~~~~~~~~~~~~~~~
199can handle: PAL B/G/D/H/I/N, PAL N, PAL M, NTSC M, NTSC 4.43 and SECAM 255
256- was introduced in 2000, is used in the LML33R10 and
257- can handle: PAL B/G/D/H/I/N, PAL N, PAL M, NTSC M, NTSC 4.43 and SECAM
200 258
201Brooktree bt819 TV decoder 259Brooktree bt819 TV decoder
202was introduced in 1996, and is used in the LML33 and 260~~~~~~~~~~~~~~~~~~~~~~~~~~
203can handle: PAL B/D/G/H/I, NTSC M 261
262- was introduced in 1996, and is used in the LML33 and
263- can handle: PAL B/D/G/H/I, NTSC M
204 264
205Micronas vpx3220a TV decoder 265Micronas vpx3220a TV decoder
206was introduced in 1996, is used in the DC30 and DC30+ and 266~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb 267
268- was introduced in 1996, is used in the DC30 and DC30+ and
269- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb
208 270
209Samsung ks0127 TV decoder 271Samsung ks0127 TV decoder
210is used in the AVS6EYES card and 272~~~~~~~~~~~~~~~~~~~~~~~~~
211can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM
212 273
213=========================== 274- is used in the AVS6EYES card and
275- can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM
214 276
2151.2 What the TV encoder can do an what not 277
278What the TV encoder can do an what not
279--------------------------------------
216 280
217The TV encoder are doing the "same" as the decoder, but in the oder direction. 281The TV encoder are doing the "same" as the decoder, but in the oder direction.
218You feed them digital data and the generate a Composite or SVHS signal. 282You feed them digital data and the generate a Composite or SVHS signal.
@@ -220,36 +284,47 @@ For information about the colorsystems and TV norm take a look in the
220TV decoder section. 284TV decoder section.
221 285
222Philips saa7185 TV Encoder 286Philips saa7185 TV Encoder
223was introduced in 1996, is used in the BUZ 287~~~~~~~~~~~~~~~~~~~~~~~~~~
224can generate: PAL B/G, NTSC M 288
289- was introduced in 1996, is used in the BUZ
290- can generate: PAL B/G, NTSC M
225 291
226Brooktree bt856 TV Encoder 292Brooktree bt856 TV Encoder
227was introduced in 1994, is used in the LML33 293~~~~~~~~~~~~~~~~~~~~~~~~~~
228can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL-N (Argentina) 294
295- was introduced in 1994, is used in the LML33
296- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL-N (Argentina)
229 297
230Analog Devices adv7170 TV Encoder 298Analog Devices adv7170 TV Encoder
231was introduced in 2000, is used in the LML300R10 299~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
232can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL 60 300
301- was introduced in 2000, is used in the LML300R10
302- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL 60
233 303
234Analog Devices adv7175 TV Encoder 304Analog Devices adv7175 TV Encoder
235was introduced in 1996, is used in the DC10, DC10+, DC10 old, DC30, DC30+ 305~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236can generate: PAL B/D/G/H/I/N, PAL M, NTSC M 306
307- was introduced in 1996, is used in the DC10, DC10+, DC10 old, DC30, DC30+
308- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M
237 309
238ITT mse3000 TV encoder 310ITT mse3000 TV encoder
239was introduced in 1991, is used in the DC10 old 311~~~~~~~~~~~~~~~~~~~~~~
240can generate: PAL , NTSC , SECAM 312
313- was introduced in 1991, is used in the DC10 old
314- can generate: PAL , NTSC , SECAM
241 315
242Conexant bt866 TV encoder 316Conexant bt866 TV encoder
243is used in AVS6EYES, and 317~~~~~~~~~~~~~~~~~~~~~~~~~
244can generate: NTSC/PAL, PAL­M, PAL­N 318
319- is used in AVS6EYES, and
320- can generate: NTSC/PAL, PAL­M, PAL­N
245 321
246The adv717x, should be able to produce PAL N. But you find nothing PAL N 322The adv717x, should be able to produce PAL N. But you find nothing PAL N
247specific in the registers. Seem that you have to reuse a other standard 323specific in the registers. Seem that you have to reuse a other standard
248to generate PAL N, maybe it would work if you use the PAL M settings. 324to generate PAL N, maybe it would work if you use the PAL M settings.
249 325
250========================== 326How do I get this damn thing to work
251 327------------------------------------
2522. How do I get this damn thing to work
253 328
254Load zr36067.o. If it can't autodetect your card, use the card=X insmod 329Load zr36067.o. If it can't autodetect your card, use the card=X insmod
255option with X being the card number as given in the previous section. 330option with X being the card number as given in the previous section.
@@ -268,9 +343,9 @@ XF86Config-4 when you use X by default, or to run 'v4l-conf -c <device>' in
268one of your startup scripts (normally rc.local) if you don't use X. Both 343one of your startup scripts (normally rc.local) if you don't use X. Both
269make sure that the modules are loaded on startup, under the root account. 344make sure that the modules are loaded on startup, under the root account.
270 345
271=========================== 346What mainboard should I use (or why doesn't my card work)
347---------------------------------------------------------
272 348
2733. What mainboard should I use (or why doesn't my card work)
274 349
275<insert lousy disclaimer here>. In short: good=SiS/Intel, bad=VIA. 350<insert lousy disclaimer here>. In short: good=SiS/Intel, bad=VIA.
276 351
@@ -278,31 +353,31 @@ Experience tells us that people with a Buz, on average, have more problems
278than users with a DC10+/LML33. Also, it tells us that people owning a VIA- 353than users with a DC10+/LML33. Also, it tells us that people owning a VIA-
279based mainboard (ktXXX, MVP3) have more problems than users with a mainboard 354based mainboard (ktXXX, MVP3) have more problems than users with a mainboard
280based on a different chipset. Here's some notes from Andrew Stevens: 355based on a different chipset. Here's some notes from Andrew Stevens:
281-- 356
282Here's my experience of using LML33 and Buz on various motherboards: 357Here's my experience of using LML33 and Buz on various motherboards:
283 358
284VIA MVP3 359- VIA MVP3
285 Forget it. Pointless. Doesn't work. 360 - Forget it. Pointless. Doesn't work.
286Intel 430FX (Pentium 200) 361- Intel 430FX (Pentium 200)
287 LML33 perfect, Buz tolerable (3 or 4 frames dropped per movie) 362 - LML33 perfect, Buz tolerable (3 or 4 frames dropped per movie)
288Intel 440BX (early stepping) 363- Intel 440BX (early stepping)
289 LML33 tolerable. Buz starting to get annoying (6-10 frames/hour) 364 - LML33 tolerable. Buz starting to get annoying (6-10 frames/hour)
290Intel 440BX (late stepping) 365- Intel 440BX (late stepping)
291 Buz tolerable, LML3 almost perfect (occasional single frame drops) 366 - Buz tolerable, LML3 almost perfect (occasional single frame drops)
292SiS735 367- SiS735
293 LML33 perfect, Buz tolerable. 368 - LML33 perfect, Buz tolerable.
294VIA KT133(*) 369- VIA KT133(*)
295 LML33 starting to get annoying, Buz poor enough that I have up. 370 - LML33 starting to get annoying, Buz poor enough that I have up.
296 371
297Both 440BX boards were dual CPU versions. 372- Both 440BX boards were dual CPU versions.
298-- 373
299Bernhard Praschinger later added: 374Bernhard Praschinger later added:
300-- 375
301AMD 751 376- AMD 751
302 Buz perfect-tolerable 377 - Buz perfect-tolerable
303AMD 760 378- AMD 760
304 Buz perfect-tolerable 379 - Buz perfect-tolerable
305-- 380
306In general, people on the user mailinglist won't give you much of a chance 381In general, people on the user mailinglist won't give you much of a chance
307if you have a VIA-based motherboard. They may be cheap, but sometimes, you'd 382if you have a VIA-based motherboard. They may be cheap, but sometimes, you'd
308rather want to spend some more money on better boards. In general, VIA 383rather want to spend some more money on better boards. In general, VIA
@@ -317,9 +392,8 @@ the quality/buffersize during capture (see 'Concerning buffer sizes, quality,
317output size etc.'). If it hangs, there's little we can do as of now. Check 392output size etc.'). If it hangs, there's little we can do as of now. Check
318your IRQs and make sure the card has its own interrupts. 393your IRQs and make sure the card has its own interrupts.
319 394
320=========================== 395Programming interface
321 396---------------------
3224. Programming interface
323 397
324This driver conforms to video4linux2. Support for V4L1 and for the custom 398This driver conforms to video4linux2. Support for V4L1 and for the custom
325zoran ioctls has been removed in kernel 2.6.38. 399zoran ioctls has been removed in kernel 2.6.38.
@@ -337,35 +411,39 @@ Additional notes for software developers:
337 settings of a variety of TV capture cards which may work in ITU or 411 settings of a variety of TV capture cards which may work in ITU or
338 square pixel format. 412 square pixel format.
339 413
340=========================== 414Applications
341 415------------
3425. Applications
343 416
344Applications known to work with this driver: 417Applications known to work with this driver:
345 418
346TV viewing: 419TV viewing:
420
347* xawtv 421* xawtv
348* kwintv 422* kwintv
349* probably any TV application that supports video4linux or video4linux2. 423* probably any TV application that supports video4linux or video4linux2.
350 424
351MJPEG capture/playback: 425MJPEG capture/playback:
426
352* mjpegtools/lavtools (or Linux Video Studio) 427* mjpegtools/lavtools (or Linux Video Studio)
353* gstreamer 428* gstreamer
354* mplayer 429* mplayer
355 430
356General raw capture: 431General raw capture:
432
357* xawtv 433* xawtv
358* gstreamer 434* gstreamer
359* probably any application that supports video4linux or video4linux2 435* probably any application that supports video4linux or video4linux2
360 436
361Video editing: 437Video editing:
438
362* Cinelerra 439* Cinelerra
363* MainActor 440* MainActor
364* mjpegtools (or Linux Video Studio) 441* mjpegtools (or Linux Video Studio)
365 442
366===========================
367 443
3686. Concerning buffer sizes, quality, output size etc. 444Concerning buffer sizes, quality, output size etc.
445--------------------------------------------------
446
369 447
370The zr36060 can do 1:2 JPEG compression. This is really the theoretical 448The zr36060 can do 1:2 JPEG compression. This is really the theoretical
371maximum that the chipset can reach. The driver can, however, limit compression 449maximum that the chipset can reach. The driver can, however, limit compression
@@ -448,9 +526,8 @@ If you experience timeouts, lowering the quality/buffersize or using
448'low_bitrate=1 as insmod option for zr36060.o might actually help, as is 526'low_bitrate=1 as insmod option for zr36060.o might actually help, as is
449proven by the Buz. 527proven by the Buz.
450 528
451=========================== 529It hangs/crashes/fails/whatevers! Help!
452 530---------------------------------------
4537. It hangs/crashes/fails/whatevers! Help!
454 531
455Make sure that the card has its own interrupts (see /proc/interrupts), check 532Make sure that the card has its own interrupts (see /proc/interrupts), check
456the output of dmesg at high verbosity (load zr36067.o with debug=2, 533the output of dmesg at high verbosity (load zr36067.o with debug=2,
@@ -467,9 +544,8 @@ the kernel version, driver version, glibc version, gcc version and any other
467information that might possibly be of interest. Also provide the dmesg output 544information that might possibly be of interest. Also provide the dmesg output
468at high verbosity. See 'Contacting' on how to contact the developers. 545at high verbosity. See 'Contacting' on how to contact the developers.
469 546
470=========================== 547Maintainers/Contacting
471 548----------------------
4728. Maintainers/Contacting
473 549
474The driver is currently maintained by Laurent Pinchart and Ronald Bultje 550The driver is currently maintained by Laurent Pinchart and Ronald Bultje
475(<laurent.pinchart@skynet.be> and <rbultje@ronald.bitfreak.net>). For bug 551(<laurent.pinchart@skynet.be> and <rbultje@ronald.bitfreak.net>). For bug
@@ -487,11 +563,10 @@ Previous maintainers/developers of this driver include Serguei Miridonov
487<mirsev@cicese.mx>, Wolfgang Scherr <scherr@net4you.net>, Dave Perks 563<mirsev@cicese.mx>, Wolfgang Scherr <scherr@net4you.net>, Dave Perks
488<dperks@ibm.net> and Rainer Johanni <Rainer@Johanni.de>. 564<dperks@ibm.net> and Rainer Johanni <Rainer@Johanni.de>.
489 565
490=========================== 566Driver's License
567----------------
491 568
4929. License 569 This driver is distributed under the terms of the General Public License.
493
494This driver is distributed under the terms of the General Public License.
495 570
496 This program is free software; you can redistribute it and/or modify 571 This program is free software; you can redistribute it and/or modify
497 it under the terms of the GNU General Public License as published by 572 it under the terms of the GNU General Public License as published by
@@ -503,8 +578,4 @@ This driver is distributed under the terms of the General Public License.
503 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 578 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
504 GNU General Public License for more details. 579 GNU General Public License for more details.
505 580
506 You should have received a copy of the GNU General Public License
507 along with this program; if not, write to the Free Software
508 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
509
510See http://www.gnu.org/ for more information. 581See http://www.gnu.org/ for more information.
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/media/v4l-drivers/zr364xx.rst
index d98e4d302977..d8d1171887cd 100644
--- a/Documentation/video4linux/zr364xx.txt
+++ b/Documentation/media/v4l-drivers/zr364xx.rst
@@ -1,40 +1,78 @@
1Zoran 364xx based USB webcam module version 0.72 1Zoran 364xx based USB webcam module
2===================================
3
2site: http://royale.zerezo.com/zr364xx/ 4site: http://royale.zerezo.com/zr364xx/
5
3mail: royale@zerezo.com 6mail: royale@zerezo.com
4 7
5introduction: 8.. note:
6This brings support under Linux for the Aiptek PocketDV 3300 in webcam mode. 9
7If you just want to get on your PC the pictures and movies on the camera, you should use the usb-storage module instead. 10 This documentation is outdated
8The driver works with several other cameras in webcam mode (see the list below). 11
9Maybe this code can work for other JPEG/USB cams based on the Coach chips from Zoran? 12Introduction
10Possible chipsets are : ZR36430 (ZR36430BGC) and maybe ZR36431, ZR36440, ZR36442... 13------------
11You can try the experience changing the vendor/product ID values (look at the source code). 14
12You can get these values by looking at /var/log/messages when you plug your camera, or by typing : cat /proc/bus/usb/devices. 15
13If you manage to use your cam with this code, you can send me a mail (royale@zerezo.com) with the name of your cam and a patch if needed. 16This brings support under Linux for the Aiptek PocketDV 3300 in webcam
14This is a beta release of the driver. 17mode. If you just want to get on your PC the pictures and movies on the
15Since version 0.70, this driver is only compatible with V4L2 API and 2.6.x kernels. 18camera, you should use the usb-storage module instead.
16If you need V4L1 or 2.4x kernels support, please use an older version, but the code is not maintained anymore. 19
17Good luck! 20The driver works with several other cameras in webcam mode (see the list
18 21below).
19install: 22
23Maybe this code can work for other JPEG/USB cams based on the Coach
24chips from Zoran?
25
26Possible chipsets are : ZR36430 (ZR36430BGC) and
27maybe ZR36431, ZR36440, ZR36442...
28
29You can try the experience changing the vendor/product ID values (look
30at the source code).
31
32You can get these values by looking at /var/log/messages when you plug
33your camera, or by typing : cat /proc/bus/usb/devices.
34
35If you manage to use your cam with this code, you can send me a mail
36(royale@zerezo.com) with the name of your cam and a patch if needed.
37
38This is a beta release of the driver. Since version 0.70, this driver is
39only compatible with V4L2 API and 2.6.x kernels. If you need V4L1 or
402.4x kernels support, please use an older version, but the code is not
41maintained anymore. Good luck!
42
43Install
44-------
45
20In order to use this driver, you must compile it with your kernel. 46In order to use this driver, you must compile it with your kernel.
47
21Location: Device Drivers -> Multimedia devices -> Video For Linux -> Video Capture Adapters -> V4L USB devices 48Location: Device Drivers -> Multimedia devices -> Video For Linux -> Video Capture Adapters -> V4L USB devices
22 49
23usage: 50Usage
51-----
52
24modprobe zr364xx debug=X mode=Y 53modprobe zr364xx debug=X mode=Y
25 - debug : set to 1 to enable verbose debug messages
26 - mode : 0 = 320x240, 1 = 160x120, 2 = 640x480
27You can then use the camera with V4L2 compatible applications, for example Ekiga.
28To capture a single image, try this: dd if=/dev/video0 of=test.jpg bs=1M count=1
29 54
30links : 55- debug : set to 1 to enable verbose debug messages
56- mode : 0 = 320x240, 1 = 160x120, 2 = 640x480
57
58You can then use the camera with V4L2 compatible applications, for
59example Ekiga.
60
61To capture a single image, try this: dd if=/dev/video0 of=test.jpg bs=1M
62count=1
63
64links
65-----
66
31http://mxhaard.free.fr/ (support for many others cams including some Aiptek PocketDV) 67http://mxhaard.free.fr/ (support for many others cams including some Aiptek PocketDV)
32http://www.harmwal.nl/pccam880/ (this project also supports cameras based on this chipset) 68http://www.harmwal.nl/pccam880/ (this project also supports cameras based on this chipset)
33 69
34supported devices: 70Supported devices
35------ ------- ----------- ----- 71-----------------
72
73====== ======= ============== ====================
36Vendor Product Distributor Model 74Vendor Product Distributor Model
37------ ------- ----------- ----- 75====== ======= ============== ====================
380x08ca 0x0109 Aiptek PocketDV 3300 760x08ca 0x0109 Aiptek PocketDV 3300
390x08ca 0x0109 Maxell Maxcam PRO DV3 770x08ca 0x0109 Maxell Maxcam PRO DV3
400x041e 0x4024 Creative PC-CAM 880 780x041e 0x4024 Creative PC-CAM 880
@@ -67,3 +105,4 @@ Vendor Product Distributor Model
670x041e 0x405d Creative DiVi CAM 516 1050x041e 0x405d Creative DiVi CAM 516
680x08ca 0x2102 Aiptek DV T300 1060x08ca 0x2102 Aiptek DV T300
690x06d6 0x003d Trust Powerc@m 910Z 1070x06d6 0x003d Trust Powerc@m 910Z
108====== ======= ============== ====================
diff --git a/Documentation/media/video.h.rst.exceptions b/Documentation/media/video.h.rst.exceptions
new file mode 100644
index 000000000000..8866145e8269
--- /dev/null
+++ b/Documentation/media/video.h.rst.exceptions
@@ -0,0 +1,40 @@
1# Ignore header name
2ignore define _UAPI_DVBVIDEO_H_
3
4# This is a deprecated obscure API. Just ignore things we don't know
5ignore define VIDEO_CMD_PLAY
6ignore define VIDEO_CMD_STOP
7ignore define VIDEO_CMD_FREEZE
8ignore define VIDEO_CMD_CONTINUE
9ignore define VIDEO_CMD_FREEZE_TO_BLACK
10ignore define VIDEO_CMD_STOP_TO_BLACK
11ignore define VIDEO_CMD_STOP_IMMEDIATELY
12ignore define VIDEO_PLAY_FMT_NONE
13ignore define VIDEO_PLAY_FMT_GOP
14ignore define VIDEO_VSYNC_FIELD_UNKNOWN
15ignore define VIDEO_VSYNC_FIELD_ODD
16ignore define VIDEO_VSYNC_FIELD_EVEN
17ignore define VIDEO_VSYNC_FIELD_PROGRESSIVE
18ignore define VIDEO_EVENT_SIZE_CHANGED
19ignore define VIDEO_EVENT_FRAME_RATE_CHANGED
20ignore define VIDEO_EVENT_DECODER_STOPPED
21ignore define VIDEO_EVENT_VSYNC
22ignore define VIDEO_CAP_MPEG1
23ignore define VIDEO_CAP_MPEG2
24ignore define VIDEO_CAP_SYS
25ignore define VIDEO_CAP_PROG
26ignore define VIDEO_CAP_SPU
27ignore define VIDEO_CAP_NAVI
28ignore define VIDEO_CAP_CSS
29
30# some typedefs should point to struct/enums
31replace typedef video_format_t video-format
32replace typedef video_system_t video-system
33replace typedef video_displayformat_t video-displayformat
34replace typedef video_size_t video-size
35replace typedef video_stream_source_t video-stream-source
36replace typedef video_play_state_t video-play-state
37replace typedef video_highlight_t video-highlight
38replace typedef video_spu_t video-spu
39replace typedef video_spu_palette_t video-spu-palette
40replace typedef video_navi_pack_t video-navi-pack
diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
new file mode 100644
index 000000000000..9bb9a6cc39d8
--- /dev/null
+++ b/Documentation/media/videodev2.h.rst.exceptions
@@ -0,0 +1,535 @@
1# Ignore header name
2ignore define _UAPI__LINUX_VIDEODEV2_H
3
4#
5# The cross reference valitator for videodev2.h DocBook never cared
6# about enum symbols or defines. Yet, they're all (or almost all?)
7# handled inside V4L API sections. So, for now, it is safe to just
8# ignore. This should be revisited, as validating it helps to avoid
9# having something not documented at the uAPI.
10#
11
12# Those symbols should not be used by uAPI - don't document them
13ignore symbol V4L2_BUF_TYPE_PRIVATE
14ignore symbol V4L2_TUNER_DIGITAL_TV
15ignore symbol V4L2_COLORSPACE_BT878
16
17# Documented enum v4l2_field
18replace symbol V4L2_FIELD_ALTERNATE v4l2-field
19replace symbol V4L2_FIELD_ANY v4l2-field
20replace symbol V4L2_FIELD_BOTTOM v4l2-field
21replace symbol V4L2_FIELD_INTERLACED v4l2-field
22replace symbol V4L2_FIELD_INTERLACED_BT v4l2-field
23replace symbol V4L2_FIELD_INTERLACED_TB v4l2-field
24replace symbol V4L2_FIELD_NONE v4l2-field
25replace symbol V4L2_FIELD_SEQ_BT v4l2-field
26replace symbol V4L2_FIELD_SEQ_TB v4l2-field
27replace symbol V4L2_FIELD_TOP v4l2-field
28
29# Documented enum v4l2_buf_type
30replace symbol V4L2_BUF_TYPE_SDR_CAPTURE v4l2-buf-type
31replace symbol V4L2_BUF_TYPE_SDR_OUTPUT v4l2-buf-type
32replace symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE v4l2-buf-type
33replace symbol V4L2_BUF_TYPE_SLICED_VBI_OUTPUT v4l2-buf-type
34replace symbol V4L2_BUF_TYPE_VBI_CAPTURE v4l2-buf-type
35replace symbol V4L2_BUF_TYPE_VBI_OUTPUT v4l2-buf-type
36replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE v4l2-buf-type
37replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE v4l2-buf-type
38replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT v4l2-buf-type
39replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE v4l2-buf-type
40replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY v4l2-buf-type
41replace symbol V4L2_BUF_TYPE_VIDEO_OVERLAY v4l2-buf-type
42
43# Documented enum v4l2_tuner_type
44replace symbol V4L2_TUNER_ANALOG_TV v4l2-tuner-type
45replace symbol V4L2_TUNER_RADIO v4l2-tuner-type
46replace symbol V4L2_TUNER_RF v4l2-tuner-type
47replace symbol V4L2_TUNER_SDR v4l2-tuner-type
48
49# Documented enum v4l2_memory
50replace symbol V4L2_MEMORY_DMABUF v4l2-memory
51replace symbol V4L2_MEMORY_MMAP v4l2-memory
52replace symbol V4L2_MEMORY_OVERLAY v4l2-memory
53replace symbol V4L2_MEMORY_USERPTR v4l2-memory
54
55# Documented enum v4l2_colorspace
56replace symbol V4L2_COLORSPACE_470_SYSTEM_BG v4l2-colorspace
57replace symbol V4L2_COLORSPACE_470_SYSTEM_M v4l2-colorspace
58replace symbol V4L2_COLORSPACE_ADOBERGB v4l2-colorspace
59replace symbol V4L2_COLORSPACE_BT2020 v4l2-colorspace
60replace symbol V4L2_COLORSPACE_DCI_P3 v4l2-colorspace
61replace symbol V4L2_COLORSPACE_DEFAULT v4l2-colorspace
62replace symbol V4L2_COLORSPACE_JPEG v4l2-colorspace
63replace symbol V4L2_COLORSPACE_RAW v4l2-colorspace
64replace symbol V4L2_COLORSPACE_REC709 v4l2-colorspace
65replace symbol V4L2_COLORSPACE_SMPTE170M v4l2-colorspace
66replace symbol V4L2_COLORSPACE_SMPTE240M v4l2-colorspace
67replace symbol V4L2_COLORSPACE_SRGB v4l2-colorspace
68
69# Documented enum v4l2_xfer_func
70replace symbol V4L2_XFER_FUNC_709 v4l2-xfer-func
71replace symbol V4L2_XFER_FUNC_ADOBERGB v4l2-xfer-func
72replace symbol V4L2_XFER_FUNC_DCI_P3 v4l2-xfer-func
73replace symbol V4L2_XFER_FUNC_DEFAULT v4l2-xfer-func
74replace symbol V4L2_XFER_FUNC_NONE v4l2-xfer-func
75replace symbol V4L2_XFER_FUNC_SMPTE2084 v4l2-xfer-func
76replace symbol V4L2_XFER_FUNC_SMPTE240M v4l2-xfer-func
77replace symbol V4L2_XFER_FUNC_SRGB v4l2-xfer-func
78
79# Documented enum v4l2_ycbcr_encoding
80replace symbol V4L2_YCBCR_ENC_601 v4l2-ycbcr-encoding
81replace symbol V4L2_YCBCR_ENC_709 v4l2-ycbcr-encoding
82replace symbol V4L2_YCBCR_ENC_BT2020 v4l2-ycbcr-encoding
83replace symbol V4L2_YCBCR_ENC_BT2020_CONST_LUM v4l2-ycbcr-encoding
84replace symbol V4L2_YCBCR_ENC_DEFAULT v4l2-ycbcr-encoding
85replace symbol V4L2_YCBCR_ENC_SYCC v4l2-ycbcr-encoding
86replace symbol V4L2_YCBCR_ENC_XV601 v4l2-ycbcr-encoding
87replace symbol V4L2_YCBCR_ENC_XV709 v4l2-ycbcr-encoding
88replace symbol V4L2_YCBCR_ENC_SMPTE240M v4l2-ycbcr-encoding
89
90# Documented enum v4l2_quantization
91replace symbol V4L2_QUANTIZATION_DEFAULT v4l2-quantization
92replace symbol V4L2_QUANTIZATION_FULL_RANGE v4l2-quantization
93replace symbol V4L2_QUANTIZATION_LIM_RANGE v4l2-quantization
94
95# Documented enum v4l2_priority
96replace symbol V4L2_PRIORITY_BACKGROUND v4l2-priority
97replace symbol V4L2_PRIORITY_DEFAULT v4l2-priority
98replace symbol V4L2_PRIORITY_INTERACTIVE v4l2-priority
99replace symbol V4L2_PRIORITY_RECORD v4l2-priority
100replace symbol V4L2_PRIORITY_UNSET v4l2-priority
101
102# Documented enum v4l2_frmsizetypes
103replace symbol V4L2_FRMSIZE_TYPE_CONTINUOUS v4l2-frmsizetypes
104replace symbol V4L2_FRMSIZE_TYPE_DISCRETE v4l2-frmsizetypes
105replace symbol V4L2_FRMSIZE_TYPE_STEPWISE v4l2-frmsizetypes
106
107# Documented enum frmivaltypes
108replace symbol V4L2_FRMIVAL_TYPE_CONTINUOUS v4l2-frmivaltypes
109replace symbol V4L2_FRMIVAL_TYPE_DISCRETE v4l2-frmivaltypes
110replace symbol V4L2_FRMIVAL_TYPE_STEPWISE v4l2-frmivaltypes
111
112# Documented enum v4l2-ctrl-type
113replace symbol V4L2_CTRL_COMPOUND_TYPES vidioc_queryctrl
114
115replace symbol V4L2_CTRL_TYPE_BITMASK v4l2-ctrl-type
116replace symbol V4L2_CTRL_TYPE_BOOLEAN v4l2-ctrl-type
117replace symbol V4L2_CTRL_TYPE_BUTTON v4l2-ctrl-type
118replace symbol V4L2_CTRL_TYPE_CTRL_CLASS v4l2-ctrl-type
119replace symbol V4L2_CTRL_TYPE_INTEGER v4l2-ctrl-type
120replace symbol V4L2_CTRL_TYPE_INTEGER64 v4l2-ctrl-type
121replace symbol V4L2_CTRL_TYPE_INTEGER_MENU v4l2-ctrl-type
122replace symbol V4L2_CTRL_TYPE_MENU v4l2-ctrl-type
123replace symbol V4L2_CTRL_TYPE_STRING v4l2-ctrl-type
124replace symbol V4L2_CTRL_TYPE_U16 v4l2-ctrl-type
125replace symbol V4L2_CTRL_TYPE_U32 v4l2-ctrl-type
126replace symbol V4L2_CTRL_TYPE_U8 v4l2-ctrl-type
127
128# V4L2 capability defines
129replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
130replace define V4L2_CAP_VIDEO_CAPTURE_MPLANE device-capabilities
131replace define V4L2_CAP_VIDEO_OUTPUT device-capabilities
132replace define V4L2_CAP_VIDEO_OUTPUT_MPLANE device-capabilities
133replace define V4L2_CAP_VIDEO_M2M device-capabilities
134replace define V4L2_CAP_VIDEO_M2M_MPLANE device-capabilities
135replace define V4L2_CAP_VIDEO_OVERLAY device-capabilities
136replace define V4L2_CAP_VBI_CAPTURE device-capabilities
137replace define V4L2_CAP_VBI_OUTPUT device-capabilities
138replace define V4L2_CAP_SLICED_VBI_CAPTURE device-capabilities
139replace define V4L2_CAP_SLICED_VBI_OUTPUT device-capabilities
140replace define V4L2_CAP_RDS_CAPTURE device-capabilities
141replace define V4L2_CAP_VIDEO_OUTPUT_OVERLAY device-capabilities
142replace define V4L2_CAP_HW_FREQ_SEEK device-capabilities
143replace define V4L2_CAP_RDS_OUTPUT device-capabilities
144replace define V4L2_CAP_TUNER device-capabilities
145replace define V4L2_CAP_AUDIO device-capabilities
146replace define V4L2_CAP_RADIO device-capabilities
147replace define V4L2_CAP_MODULATOR device-capabilities
148replace define V4L2_CAP_SDR_CAPTURE device-capabilities
149replace define V4L2_CAP_EXT_PIX_FORMAT device-capabilities
150replace define V4L2_CAP_SDR_OUTPUT device-capabilities
151replace define V4L2_CAP_READWRITE device-capabilities
152replace define V4L2_CAP_ASYNCIO device-capabilities
153replace define V4L2_CAP_STREAMING device-capabilities
154replace define V4L2_CAP_DEVICE_CAPS device-capabilities
155
156# V4L2 pix flags
157replace define V4L2_PIX_FMT_PRIV_MAGIC v4l2-pix-format
158replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
159
160# V4L2 format flags
161replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
162replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
163
164# V4L2 tymecode types
165replace define V4L2_TC_TYPE_24FPS timecode-type
166replace define V4L2_TC_TYPE_25FPS timecode-type
167replace define V4L2_TC_TYPE_30FPS timecode-type
168replace define V4L2_TC_TYPE_50FPS timecode-type
169replace define V4L2_TC_TYPE_60FPS timecode-type
170
171# V4L2 tymecode flags
172replace define V4L2_TC_FLAG_DROPFRAME timecode-flags
173replace define V4L2_TC_FLAG_COLORFRAME timecode-flags
174replace define V4L2_TC_USERBITS_field timecode-flags
175replace define V4L2_TC_USERBITS_USERDEFINED timecode-flags
176replace define V4L2_TC_USERBITS_8BITCHARS timecode-flags
177
178# V4L2 JPEG markers
179replace define V4L2_JPEG_MARKER_DHT jpeg-markers
180replace define V4L2_JPEG_MARKER_DQT jpeg-markers
181replace define V4L2_JPEG_MARKER_DRI jpeg-markers
182replace define V4L2_JPEG_MARKER_COM jpeg-markers
183replace define V4L2_JPEG_MARKER_APP jpeg-markers
184
185# V4L2 framebuffer caps and flags
186
187replace define V4L2_FBUF_CAP_EXTERNOVERLAY framebuffer-cap
188replace define V4L2_FBUF_CAP_CHROMAKEY framebuffer-cap
189replace define V4L2_FBUF_CAP_LIST_CLIPPING framebuffer-cap
190replace define V4L2_FBUF_CAP_BITMAP_CLIPPING framebuffer-cap
191replace define V4L2_FBUF_CAP_LOCAL_ALPHA framebuffer-cap
192replace define V4L2_FBUF_CAP_GLOBAL_ALPHA framebuffer-cap
193replace define V4L2_FBUF_CAP_LOCAL_INV_ALPHA framebuffer-cap
194replace define V4L2_FBUF_CAP_SRC_CHROMAKEY framebuffer-cap
195
196replace define V4L2_FBUF_FLAG_PRIMARY framebuffer-flags
197replace define V4L2_FBUF_FLAG_OVERLAY framebuffer-flags
198replace define V4L2_FBUF_FLAG_CHROMAKEY framebuffer-flags
199replace define V4L2_FBUF_FLAG_LOCAL_ALPHA framebuffer-flags
200replace define V4L2_FBUF_FLAG_GLOBAL_ALPHA framebuffer-flags
201replace define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA framebuffer-flags
202replace define V4L2_FBUF_FLAG_SRC_CHROMAKEY framebuffer-flags
203
204# Used on VIDIOC_G_PARM
205
206replace define V4L2_MODE_HIGHQUALITY parm-flags
207replace define V4L2_CAP_TIMEPERFRAME v4l2-captureparm
208
209# The V4L2_STD_foo are all defined at v4l2_std_id table
210
211replace define V4L2_STD_PAL_B v4l2-std-id
212replace define V4L2_STD_PAL_B1 v4l2-std-id
213replace define V4L2_STD_PAL_G v4l2-std-id
214replace define V4L2_STD_PAL_H v4l2-std-id
215replace define V4L2_STD_PAL_I v4l2-std-id
216replace define V4L2_STD_PAL_D v4l2-std-id
217replace define V4L2_STD_PAL_D1 v4l2-std-id
218replace define V4L2_STD_PAL_K v4l2-std-id
219replace define V4L2_STD_PAL_M v4l2-std-id
220replace define V4L2_STD_PAL_N v4l2-std-id
221replace define V4L2_STD_PAL_Nc v4l2-std-id
222replace define V4L2_STD_PAL_60 v4l2-std-id
223replace define V4L2_STD_NTSC_M v4l2-std-id
224replace define V4L2_STD_NTSC_M_JP v4l2-std-id
225replace define V4L2_STD_NTSC_443 v4l2-std-id
226replace define V4L2_STD_NTSC_M_KR v4l2-std-id
227replace define V4L2_STD_SECAM_B v4l2-std-id
228replace define V4L2_STD_SECAM_D v4l2-std-id
229replace define V4L2_STD_SECAM_G v4l2-std-id
230replace define V4L2_STD_SECAM_H v4l2-std-id
231replace define V4L2_STD_SECAM_K v4l2-std-id
232replace define V4L2_STD_SECAM_K1 v4l2-std-id
233replace define V4L2_STD_SECAM_L v4l2-std-id
234replace define V4L2_STD_SECAM_LC v4l2-std-id
235replace define V4L2_STD_ATSC_8_VSB v4l2-std-id
236replace define V4L2_STD_ATSC_16_VSB v4l2-std-id
237replace define V4L2_STD_NTSC v4l2-std-id
238replace define V4L2_STD_SECAM_DK v4l2-std-id
239replace define V4L2_STD_SECAM v4l2-std-id
240replace define V4L2_STD_PAL_BG v4l2-std-id
241replace define V4L2_STD_PAL_DK v4l2-std-id
242replace define V4L2_STD_PAL v4l2-std-id
243replace define V4L2_STD_B v4l2-std-id
244replace define V4L2_STD_G v4l2-std-id
245replace define V4L2_STD_H v4l2-std-id
246replace define V4L2_STD_L v4l2-std-id
247replace define V4L2_STD_GH v4l2-std-id
248replace define V4L2_STD_DK v4l2-std-id
249replace define V4L2_STD_BG v4l2-std-id
250replace define V4L2_STD_MN v4l2-std-id
251replace define V4L2_STD_MTS v4l2-std-id
252replace define V4L2_STD_525_60 v4l2-std-id
253replace define V4L2_STD_625_50 v4l2-std-id
254replace define V4L2_STD_ATSC v4l2-std-id
255replace define V4L2_STD_UNKNOWN v4l2-std-id
256replace define V4L2_STD_ALL v4l2-std-id
257
258# V4L2 DT BT timings definitions
259
260replace define V4L2_DV_PROGRESSIVE v4l2-bt-timings
261replace define V4L2_DV_INTERLACED v4l2-bt-timings
262
263replace define V4L2_DV_VSYNC_POS_POL v4l2-bt-timings
264replace define V4L2_DV_HSYNC_POS_POL v4l2-bt-timings
265
266replace define V4L2_DV_BT_STD_CEA861 dv-bt-standards
267replace define V4L2_DV_BT_STD_DMT dv-bt-standards
268replace define V4L2_DV_BT_STD_CVT dv-bt-standards
269replace define V4L2_DV_BT_STD_GTF dv-bt-standards
270
271replace define V4L2_DV_FL_REDUCED_BLANKING dv-bt-standards
272replace define V4L2_DV_FL_CAN_REDUCE_FPS dv-bt-standards
273replace define V4L2_DV_FL_REDUCED_FPS dv-bt-standards
274replace define V4L2_DV_FL_HALF_LINE dv-bt-standards
275replace define V4L2_DV_FL_IS_CE_VIDEO dv-bt-standards
276
277replace define V4L2_DV_BT_656_1120 dv-timing-types
278
279replace define V4L2_DV_BT_CAP_INTERLACED framebuffer-cap
280replace define V4L2_DV_BT_CAP_PROGRESSIVE framebuffer-cap
281replace define V4L2_DV_BT_CAP_REDUCED_BLANKING framebuffer-cap
282replace define V4L2_DV_BT_CAP_CUSTOM framebuffer-cap
283
284# V4L2 input
285
286replace define V4L2_INPUT_TYPE_TUNER input-type
287replace define V4L2_INPUT_TYPE_CAMERA input-type
288
289replace define V4L2_IN_ST_NO_POWER input-status
290replace define V4L2_IN_ST_NO_SIGNAL input-status
291replace define V4L2_IN_ST_NO_COLOR input-status
292replace define V4L2_IN_ST_HFLIP input-status
293replace define V4L2_IN_ST_VFLIP input-status
294replace define V4L2_IN_ST_NO_H_LOCK input-status
295replace define V4L2_IN_ST_COLOR_KILL input-status
296replace define V4L2_IN_ST_NO_SYNC input-status
297replace define V4L2_IN_ST_NO_EQU input-status
298replace define V4L2_IN_ST_NO_CARRIER input-status
299replace define V4L2_IN_ST_MACROVISION input-status
300replace define V4L2_IN_ST_NO_ACCESS input-status
301replace define V4L2_IN_ST_VTR input-status
302
303replace define V4L2_IN_CAP_DV_TIMINGS input-capabilities
304replace define V4L2_IN_CAP_STD input-capabilities
305replace define V4L2_IN_CAP_NATIVE_SIZE input-capabilities
306
307# V4L2 output
308
309replace define V4L2_OUTPUT_TYPE_MODULATOR output-type
310replace define V4L2_OUTPUT_TYPE_ANALOG output-type
311replace define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY output-type
312
313replace define V4L2_OUT_CAP_DV_TIMINGS output-capabilities
314replace define V4L2_OUT_CAP_STD output-capabilities
315replace define V4L2_OUT_CAP_NATIVE_SIZE output-capabilities
316
317# V4L2 control flags
318
319replace define V4L2_CTRL_FLAG_DISABLED control-flags
320replace define V4L2_CTRL_FLAG_GRABBED control-flags
321replace define V4L2_CTRL_FLAG_READ_ONLY control-flags
322replace define V4L2_CTRL_FLAG_UPDATE control-flags
323replace define V4L2_CTRL_FLAG_INACTIVE control-flags
324replace define V4L2_CTRL_FLAG_SLIDER control-flags
325replace define V4L2_CTRL_FLAG_WRITE_ONLY control-flags
326replace define V4L2_CTRL_FLAG_VOLATILE control-flags
327replace define V4L2_CTRL_FLAG_HAS_PAYLOAD control-flags
328replace define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE control-flags
329
330replace define V4L2_CTRL_FLAG_NEXT_CTRL control
331replace define V4L2_CTRL_FLAG_NEXT_COMPOUND control
332replace define V4L2_CID_PRIVATE_BASE control
333
334# V4L2 tuner
335
336replace define V4L2_TUNER_CAP_LOW tuner-capability
337replace define V4L2_TUNER_CAP_NORM tuner-capability
338replace define V4L2_TUNER_CAP_HWSEEK_BOUNDED tuner-capability
339replace define V4L2_TUNER_CAP_HWSEEK_WRAP tuner-capability
340replace define V4L2_TUNER_CAP_STEREO tuner-capability
341replace define V4L2_TUNER_CAP_LANG2 tuner-capability
342replace define V4L2_TUNER_CAP_SAP tuner-capability
343replace define V4L2_TUNER_CAP_LANG1 tuner-capability
344replace define V4L2_TUNER_CAP_RDS tuner-capability
345replace define V4L2_TUNER_CAP_RDS_BLOCK_IO tuner-capability
346replace define V4L2_TUNER_CAP_RDS_CONTROLS tuner-capability
347replace define V4L2_TUNER_CAP_FREQ_BANDS tuner-capability
348replace define V4L2_TUNER_CAP_HWSEEK_PROG_LIM tuner-capability
349replace define V4L2_TUNER_CAP_1HZ tuner-capability
350
351replace define V4L2_TUNER_SUB_MONO tuner-rxsubchans
352replace define V4L2_TUNER_SUB_STEREO tuner-rxsubchans
353replace define V4L2_TUNER_SUB_LANG2 tuner-rxsubchans
354replace define V4L2_TUNER_SUB_SAP tuner-rxsubchans
355replace define V4L2_TUNER_SUB_LANG1 tuner-rxsubchans
356replace define V4L2_TUNER_SUB_RDS tuner-rxsubchans
357
358replace define V4L2_TUNER_MODE_MONO tuner-audmode
359replace define V4L2_TUNER_MODE_STEREO tuner-audmode
360replace define V4L2_TUNER_MODE_LANG2 tuner-audmode
361replace define V4L2_TUNER_MODE_SAP tuner-audmode
362replace define V4L2_TUNER_MODE_LANG1 tuner-audmode
363replace define V4L2_TUNER_MODE_LANG1_LANG2 tuner-audmode
364
365replace define V4L2_BAND_MODULATION_VSB band-modulation
366replace define V4L2_BAND_MODULATION_FM band-modulation
367replace define V4L2_BAND_MODULATION_AM band-modulation
368
369replace define V4L2_RDS_BLOCK_MSK v4l2-rds-block
370replace define V4L2_RDS_BLOCK_A v4l2-rds-block
371replace define V4L2_RDS_BLOCK_B v4l2-rds-block
372replace define V4L2_RDS_BLOCK_C v4l2-rds-block
373replace define V4L2_RDS_BLOCK_D v4l2-rds-block
374replace define V4L2_RDS_BLOCK_C_ALT v4l2-rds-block
375replace define V4L2_RDS_BLOCK_INVALID v4l2-rds-block
376replace define V4L2_RDS_BLOCK_CORRECTED v4l2-rds-block
377replace define V4L2_RDS_BLOCK_ERROR v4l2-rds-block
378
379# V4L2 audio
380
381replace define V4L2_AUDCAP_STEREO audio-capability
382replace define V4L2_AUDCAP_AVL audio-capability
383
384replace define V4L2_AUDMODE_AVL audio-mode
385
386# MPEG
387
388replace define V4L2_ENC_IDX_FRAME_I v4l2-enc-idx
389replace define V4L2_ENC_IDX_FRAME_P v4l2-enc-idx
390replace define V4L2_ENC_IDX_FRAME_B v4l2-enc-idx
391replace define V4L2_ENC_IDX_FRAME_MASK v4l2-enc-idx
392replace define V4L2_ENC_IDX_ENTRIES v4l2-enc-idx
393
394replace define V4L2_ENC_CMD_START encoder-cmds
395replace define V4L2_ENC_CMD_STOP encoder-cmds
396replace define V4L2_ENC_CMD_PAUSE encoder-cmds
397replace define V4L2_ENC_CMD_RESUME encoder-cmds
398
399replace define V4L2_ENC_CMD_STOP_AT_GOP_END encoder-flags
400
401replace define V4L2_DEC_CMD_START decoder-cmds
402replace define V4L2_DEC_CMD_STOP decoder-cmds
403replace define V4L2_DEC_CMD_PAUSE decoder-cmds
404replace define V4L2_DEC_CMD_RESUME decoder-cmds
405
406replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
407replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
408replace define V4L2_DEC_CMD_STOP_TO_BLACK decoder-cmds
409replace define V4L2_DEC_CMD_STOP_IMMEDIATELY decoder-cmds
410
411replace define V4L2_DEC_START_FMT_NONE decoder-cmds
412replace define V4L2_DEC_START_FMT_GOP decoder-cmds
413
414# V4L2 VBI
415
416replace define V4L2_VBI_UNSYNC vbifmt-flags
417replace define V4L2_VBI_INTERLACED vbifmt-flags
418
419replace define V4L2_VBI_ITU_525_F1_START v4l2-vbi-format
420replace define V4L2_VBI_ITU_525_F2_START v4l2-vbi-format
421replace define V4L2_VBI_ITU_625_F1_START v4l2-vbi-format
422replace define V4L2_VBI_ITU_625_F2_START v4l2-vbi-format
423
424
425replace define V4L2_SLICED_TELETEXT_B vbi-services
426replace define V4L2_SLICED_VPS vbi-services
427replace define V4L2_SLICED_CAPTION_525 vbi-services
428replace define V4L2_SLICED_WSS_625 vbi-services
429replace define V4L2_SLICED_VBI_525 vbi-services
430replace define V4L2_SLICED_VBI_625 vbi-services
431
432replace define V4L2_MPEG_VBI_IVTV_TELETEXT_B ITV0-Line-Identifier-Constants
433replace define V4L2_MPEG_VBI_IVTV_CAPTION_525 ITV0-Line-Identifier-Constants
434replace define V4L2_MPEG_VBI_IVTV_WSS_625 ITV0-Line-Identifier-Constants
435replace define V4L2_MPEG_VBI_IVTV_VPS ITV0-Line-Identifier-Constants
436
437replace define V4L2_MPEG_VBI_IVTV_MAGIC0 v4l2-mpeg-vbi-fmt-ivtv-magic
438replace define V4L2_MPEG_VBI_IVTV_MAGIC1 v4l2-mpeg-vbi-fmt-ivtv-magic
439
440# V4L2 events
441
442replace define V4L2_EVENT_ALL event-type
443replace define V4L2_EVENT_VSYNC event-type
444replace define V4L2_EVENT_EOS event-type
445replace define V4L2_EVENT_CTRL event-type
446replace define V4L2_EVENT_FRAME_SYNC event-type
447replace define V4L2_EVENT_SOURCE_CHANGE event-type
448replace define V4L2_EVENT_MOTION_DET event-type
449replace define V4L2_EVENT_PRIVATE_START event-type
450
451replace define V4L2_EVENT_CTRL_CH_VALUE ctrl-changes-flags
452replace define V4L2_EVENT_CTRL_CH_FLAGS ctrl-changes-flags
453replace define V4L2_EVENT_CTRL_CH_RANGE ctrl-changes-flags
454
455replace define V4L2_EVENT_SRC_CH_RESOLUTION src-changes-flags
456
457replace define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ v4l2-event-motion-det
458
459replace define V4L2_EVENT_SUB_FL_SEND_INITIAL event-flags
460replace define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK event-flags
461
462# V4L2 debugging
463replace define V4L2_CHIP_MATCH_BRIDGE vidioc_dbg_g_register
464replace define V4L2_CHIP_MATCH_SUBDEV vidioc_dbg_g_register
465replace define V4L2_CHIP_MATCH_HOST vidioc_dbg_g_register
466replace define V4L2_CHIP_MATCH_I2C_DRIVER vidioc_dbg_g_register
467replace define V4L2_CHIP_MATCH_I2C_ADDR vidioc_dbg_g_register
468replace define V4L2_CHIP_MATCH_AC97 vidioc_dbg_g_register
469
470replace define V4L2_CHIP_FL_READABLE vidioc_dbg_g_register
471replace define V4L2_CHIP_FL_WRITABLE vidioc_dbg_g_register
472
473# Ignore reserved ioctl and ancillary macros
474
475ignore define VIDEO_MAX_FRAME
476ignore define VIDEO_MAX_PLANES
477ignore define v4l2_fourcc
478ignore define v4l2_fourcc_be
479ignore define V4L2_FIELD_HAS_TOP
480ignore define V4L2_FIELD_HAS_BOTTOM
481ignore define V4L2_FIELD_HAS_BOTH
482ignore define V4L2_FIELD_HAS_T_OR_B
483ignore define V4L2_TYPE_IS_MULTIPLANAR
484ignore define V4L2_TYPE_IS_OUTPUT
485ignore define V4L2_TUNER_ADC
486ignore define V4L2_MAP_COLORSPACE_DEFAULT
487ignore define V4L2_MAP_XFER_FUNC_DEFAULT
488ignore define V4L2_MAP_YCBCR_ENC_DEFAULT
489ignore define V4L2_DV_BT_BLANKING_WIDTH
490ignore define V4L2_DV_BT_FRAME_WIDTH
491ignore define V4L2_DV_BT_BLANKING_HEIGHT
492ignore define V4L2_DV_BT_FRAME_HEIGHT
493ignore define V4L2_IN_CAP_CUSTOM_TIMINGS
494ignore define V4L2_CTRL_ID_MASK
495ignore define V4L2_CTRL_ID2CLASS
496ignore define V4L2_CTRL_ID2WHICH
497ignore define V4L2_CTRL_DRIVER_PRIV
498ignore define V4L2_CTRL_MAX_DIMS
499ignore define V4L2_CTRL_WHICH_CUR_VAL
500ignore define V4L2_CTRL_WHICH_DEF_VAL
501ignore define V4L2_OUT_CAP_CUSTOM_TIMINGS
502ignore define V4L2_CID_MAX_CTRLS
503
504ignore ioctl VIDIOC_RESERVED
505ignore define BASE_VIDIOC_PRIVATE
506
507# Associate ioctls with their counterparts
508replace ioctl VIDIOC_DBG_S_REGISTER vidioc_dbg_g_register
509replace ioctl VIDIOC_DQBUF vidioc_qbuf
510replace ioctl VIDIOC_S_AUDOUT vidioc_g_audout
511replace ioctl VIDIOC_S_CROP vidioc_g_crop
512replace ioctl VIDIOC_S_CTRL vidioc_g_ctrl
513replace ioctl VIDIOC_S_DV_TIMINGS vidioc_g_dv_timings
514replace ioctl VIDIOC_S_EDID vidioc_g_edid
515replace ioctl VIDIOC_S_EXT_CTRLS vidioc_g_ext_ctrls
516replace ioctl VIDIOC_S_FBUF vidioc_g_fbuf
517replace ioctl VIDIOC_S_FMT vidioc_g_fmt
518replace ioctl VIDIOC_S_FREQUENCY vidioc_g_frequency
519replace ioctl VIDIOC_S_INPUT vidioc_g_input
520replace ioctl VIDIOC_S_JPEGCOMP vidioc_g_jpegcomp
521replace ioctl VIDIOC_S_MODULATOR vidioc_g_modulator
522replace ioctl VIDIOC_S_OUTPUT vidioc_g_output
523replace ioctl VIDIOC_S_PARM vidioc_g_parm
524replace ioctl VIDIOC_S_PRIORITY vidioc_g_priority
525replace ioctl VIDIOC_S_SELECTION vidioc_g_selection
526replace ioctl VIDIOC_S_STD vidioc_g_std
527replace ioctl VIDIOC_S_AUDIO vidioc_g_audio
528replace ioctl VIDIOC_S_TUNER vidioc_g_tuner
529replace ioctl VIDIOC_TRY_DECODER_CMD vidioc_decoder_cmd
530replace ioctl VIDIOC_TRY_ENCODER_CMD vidioc_encoder_cmd
531replace ioctl VIDIOC_TRY_EXT_CTRLS vidioc_g_ext_ctrls
532replace ioctl VIDIOC_TRY_FMT vidioc_g_fmt
533replace ioctl VIDIOC_STREAMOFF vidioc_streamon
534replace ioctl VIDIOC_QUERY_EXT_CTRL vidioc_queryctrl
535replace ioctl VIDIOC_QUERYMENU vidioc_queryctrl
diff --git a/Documentation/sphinx-static/theme_overrides.css b/Documentation/sphinx-static/theme_overrides.css
new file mode 100644
index 000000000000..3a2ac4bcfd78
--- /dev/null
+++ b/Documentation/sphinx-static/theme_overrides.css
@@ -0,0 +1,58 @@
1/* -*- coding: utf-8; mode: css -*-
2 *
3 * Sphinx HTML theme customization: read the doc
4 *
5 */
6
7@media screen {
8
9 /* content column
10 *
11 * RTD theme's default is 800px as max width for the content, but we have
12 * tables with tons of columns, which need the full width of the view-port.
13 */
14
15 .wy-nav-content{max-width: none; }
16
17 /* table:
18 *
19 * - Sequences of whitespace should collapse into a single whitespace.
20 * - make the overflow auto (scrollbar if needed)
21 * - align caption "left" ("center" is unsuitable on vast tables)
22 */
23
24 .wy-table-responsive table td { white-space: normal; }
25 .wy-table-responsive { overflow: auto; }
26 .rst-content table.docutils caption { text-align: left; font-size: 100%; }
27
28 /* captions:
29 *
30 * - captions should have 100% (not 85%) font size
31 * - hide the permalink symbol as long as link is not hovered
32 */
33
34 .toc-title {
35 font-size: 150%;
36 font-weight: bold;
37 }
38
39 caption, .wy-table caption, .rst-content table.field-list caption {
40 font-size: 100%;
41 }
42 caption a.headerlink { opacity: 0; }
43 caption a.headerlink:hover { opacity: 1; }
44
45 /* inline literal: drop the borderbox and red color */
46
47 code, .rst-content tt, .rst-content code {
48 color: inherit;
49 border: none;
50 background: inherit;
51 font-size: 85%;
52 }
53
54 .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
55 color: inherit;
56 }
57
58}
diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
new file mode 100755
index 000000000000..db5738238733
--- /dev/null
+++ b/Documentation/sphinx/kernel_include.py
@@ -0,0 +1,183 @@
1#!/usr/bin/env python3
2# -*- coding: utf-8; mode: python -*-
3# pylint: disable=R0903, C0330, R0914, R0912, E0401
4
5u"""
6 kernel-include
7 ~~~~~~~~~~~~~~
8
9 Implementation of the ``kernel-include`` reST-directive.
10
11 :copyright: Copyright (C) 2016 Markus Heiser
12 :license: GPL Version 2, June 1991 see linux/COPYING for details.
13
14 The ``kernel-include`` reST-directive is a replacement for the ``include``
15 directive. The ``kernel-include`` directive expand environment variables in
16 the path name and allows to include files from arbitrary locations.
17
18 .. hint::
19
20 Including files from arbitrary locations (e.g. from ``/etc``) is a
21 security risk for builders. This is why the ``include`` directive from
22 docutils *prohibit* pathnames pointing to locations *above* the filesystem
23 tree where the reST document with the include directive is placed.
24
25 Substrings of the form $name or ${name} are replaced by the value of
26 environment variable name. Malformed variable names and references to
27 non-existing variables are left unchanged.
28"""
29
30# ==============================================================================
31# imports
32# ==============================================================================
33
34import os.path
35
36from docutils import io, nodes, statemachine
37from docutils.utils.error_reporting import SafeString, ErrorString
38from docutils.parsers.rst import directives
39from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
40from docutils.parsers.rst.directives.misc import Include
41
42# ==============================================================================
43def setup(app):
44# ==============================================================================
45
46 app.add_directive("kernel-include", KernelInclude)
47
48# ==============================================================================
49class KernelInclude(Include):
50# ==============================================================================
51
52 u"""KernelInclude (``kernel-include``) directive"""
53
54 def run(self):
55 path = os.path.realpath(
56 os.path.expandvars(self.arguments[0]))
57
58 # to get a bit security back, prohibit /etc:
59 if path.startswith(os.sep + "etc"):
60 raise self.severe(
61 'Problems with "%s" directive, prohibited path: %s'
62 % (self.name, path))
63
64 self.arguments[0] = path
65
66 #return super(KernelInclude, self).run() # won't work, see HINTs in _run()
67 return self._run()
68
69 def _run(self):
70 """Include a file as part of the content of this reST file."""
71
72 # HINT: I had to copy&paste the whole Include.run method. I'am not happy
73 # with this, but due to security reasons, the Include.run method does
74 # not allow absolute or relative pathnames pointing to locations *above*
75 # the filesystem tree where the reST document is placed.
76
77 if not self.state.document.settings.file_insertion_enabled:
78 raise self.warning('"%s" directive disabled.' % self.name)
79 source = self.state_machine.input_lines.source(
80 self.lineno - self.state_machine.input_offset - 1)
81 source_dir = os.path.dirname(os.path.abspath(source))
82 path = directives.path(self.arguments[0])
83 if path.startswith('<') and path.endswith('>'):
84 path = os.path.join(self.standard_include_path, path[1:-1])
85 path = os.path.normpath(os.path.join(source_dir, path))
86
87 # HINT: this is the only line I had to change / commented out:
88 #path = utils.relative_path(None, path)
89
90 path = nodes.reprunicode(path)
91 encoding = self.options.get(
92 'encoding', self.state.document.settings.input_encoding)
93 e_handler=self.state.document.settings.input_encoding_error_handler
94 tab_width = self.options.get(
95 'tab-width', self.state.document.settings.tab_width)
96 try:
97 self.state.document.settings.record_dependencies.add(path)
98 include_file = io.FileInput(source_path=path,
99 encoding=encoding,
100 error_handler=e_handler)
101 except UnicodeEncodeError as error:
102 raise self.severe('Problems with "%s" directive path:\n'
103 'Cannot encode input file path "%s" '
104 '(wrong locale?).' %
105 (self.name, SafeString(path)))
106 except IOError as error:
107 raise self.severe('Problems with "%s" directive path:\n%s.' %
108 (self.name, ErrorString(error)))
109 startline = self.options.get('start-line', None)
110 endline = self.options.get('end-line', None)
111 try:
112 if startline or (endline is not None):
113 lines = include_file.readlines()
114 rawtext = ''.join(lines[startline:endline])
115 else:
116 rawtext = include_file.read()
117 except UnicodeError as error:
118 raise self.severe('Problem with "%s" directive:\n%s' %
119 (self.name, ErrorString(error)))
120 # start-after/end-before: no restrictions on newlines in match-text,
121 # and no restrictions on matching inside lines vs. line boundaries
122 after_text = self.options.get('start-after', None)
123 if after_text:
124 # skip content in rawtext before *and incl.* a matching text
125 after_index = rawtext.find(after_text)
126 if after_index < 0:
127 raise self.severe('Problem with "start-after" option of "%s" '
128 'directive:\nText not found.' % self.name)
129 rawtext = rawtext[after_index + len(after_text):]
130 before_text = self.options.get('end-before', None)
131 if before_text:
132 # skip content in rawtext after *and incl.* a matching text
133 before_index = rawtext.find(before_text)
134 if before_index < 0:
135 raise self.severe('Problem with "end-before" option of "%s" '
136 'directive:\nText not found.' % self.name)
137 rawtext = rawtext[:before_index]
138
139 include_lines = statemachine.string2lines(rawtext, tab_width,
140 convert_whitespace=True)
141 if 'literal' in self.options:
142 # Convert tabs to spaces, if `tab_width` is positive.
143 if tab_width >= 0:
144 text = rawtext.expandtabs(tab_width)
145 else:
146 text = rawtext
147 literal_block = nodes.literal_block(rawtext, source=path,
148 classes=self.options.get('class', []))
149 literal_block.line = 1
150 self.add_name(literal_block)
151 if 'number-lines' in self.options:
152 try:
153 startline = int(self.options['number-lines'] or 1)
154 except ValueError:
155 raise self.error(':number-lines: with non-integer '
156 'start value')
157 endline = startline + len(include_lines)
158 if text.endswith('\n'):
159 text = text[:-1]
160 tokens = NumberLines([([], text)], startline, endline)
161 for classes, value in tokens:
162 if classes:
163 literal_block += nodes.inline(value, value,
164 classes=classes)
165 else:
166 literal_block += nodes.Text(value, value)
167 else:
168 literal_block += nodes.Text(text, text)
169 return [literal_block]
170 if 'code' in self.options:
171 self.options['source'] = path
172 codeblock = CodeBlock(self.name,
173 [self.options.pop('code')], # arguments
174 self.options,
175 include_lines, # content
176 self.lineno,
177 self.content_offset,
178 self.block_text,
179 self.state,
180 self.state_machine)
181 return codeblock.run()
182 self.state_machine.insert_input(include_lines, path)
183 return []
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
new file mode 100755
index 000000000000..34bd9e2630b0
--- /dev/null
+++ b/Documentation/sphinx/parse-headers.pl
@@ -0,0 +1,321 @@
1#!/usr/bin/perl
2use strict;
3use Text::Tabs;
4
5# Uncomment if debug is needed
6#use Data::Dumper;
7
8# change to 1 to generate some debug prints
9my $debug = 0;
10
11if (scalar @ARGV < 2 || scalar @ARGV > 3) {
12 die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
13}
14
15my ($file_in, $file_out, $file_exceptions) = @ARGV;
16
17my $data;
18my %ioctls;
19my %defines;
20my %typedefs;
21my %enums;
22my %enum_symbols;
23my %structs;
24
25#
26# read the file and get identifiers
27#
28
29my $is_enum = 0;
30my $is_comment = 0;
31open IN, $file_in or die "Can't open $file_in";
32while (<IN>) {
33 $data .= $_;
34
35 my $ln = $_;
36 if (!$is_comment) {
37 $ln =~ s,/\*.*(\*/),,g;
38
39 $is_comment = 1 if ($ln =~ s,/\*.*,,);
40 } else {
41 if ($ln =~ s,^(.*\*/),,) {
42 $is_comment = 0;
43 } else {
44 next;
45 }
46 }
47
48 if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
49 my $s = $1;
50 my $n = $1;
51 $n =~ tr/A-Z/a-z/;
52 $n =~ tr/_/-/;
53
54 $enum_symbols{$s} = $n;
55
56 $is_enum = 0 if ($is_enum && m/\}/);
57 next;
58 }
59 $is_enum = 0 if ($is_enum && m/\}/);
60
61 if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+_IO/) {
62 my $s = $1;
63 my $n = $1;
64 $n =~ tr/A-Z/a-z/;
65
66 $ioctls{$s} = $n;
67 next;
68 }
69
70 if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+/) {
71 my $s = $1;
72 my $n = $1;
73 $n =~ tr/A-Z/a-z/;
74 $n =~ tr/_/-/;
75
76 $defines{$s} = $n;
77 next;
78 }
79
80 if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
81 my $s = $1;
82 my $n = $1;
83 $n =~ tr/A-Z/a-z/;
84 $n =~ tr/_/-/;
85
86 $typedefs{$s} = $n;
87 next;
88 }
89 if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
90 || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/
91 || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
92 || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
93 my $s = $1;
94 my $n = $1;
95 $n =~ tr/A-Z/a-z/;
96 $n =~ tr/_/-/;
97
98 $enums{$s} = $n;
99
100 $is_enum = $1;
101 next;
102 }
103 if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
104 || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/
105 || $ln =~ m/^\s*typedef\s*struct\s+([_\w][\w\d_]+)\s+\{/
106 || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
107 ) {
108 my $s = $1;
109 my $n = $1;
110 $n =~ tr/A-Z/a-z/;
111 $n =~ tr/_/-/;
112
113 $structs{$s} = $n;
114 next;
115 }
116}
117close IN;
118
119#
120# Handle multi-line typedefs
121#
122
123my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
124 $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
125foreach my $m (@matches) {
126 my $s = $m;
127 my $n = $m;
128 $n =~ tr/A-Z/a-z/;
129 $n =~ tr/_/-/;
130
131 $typedefs{$s} = $n;
132 next;
133}
134
135#
136# Handle exceptions, if any
137#
138
139if ($file_exceptions) {
140 open IN, $file_exceptions or die "Can't read $file_exceptions";
141 while (<IN>) {
142 next if (m/^\s*$/ || m/^\s*#/);
143
144 # Parsers to ignore a symbol
145
146 if (m/^ignore\s+ioctl\s+(\S+)/) {
147 delete $ioctls{$1} if (exists($ioctls{$1}));
148 next;
149 }
150 if (m/^ignore\s+define\s+(\S+)/) {
151 delete $defines{$1} if (exists($defines{$1}));
152 next;
153 }
154 if (m/^ignore\s+typedef\s+(\S+)/) {
155 delete $typedefs{$1} if (exists($typedefs{$1}));
156 next;
157 }
158 if (m/^ignore\s+enum\s+(\S+)/) {
159 delete $enums{$1} if (exists($enums{$1}));
160 next;
161 }
162 if (m/^ignore\s+struct\s+(\S+)/) {
163 delete $structs{$1} if (exists($structs{$1}));
164 next;
165 }
166 if (m/^ignore\s+symbol\s+(\S+)/) {
167 delete $enum_symbols{$1} if (exists($enum_symbols{$1}));
168 next;
169 }
170
171 # Parsers to replace a symbol
172
173 if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
174 $ioctls{$1} = $2 if (exists($ioctls{$1}));
175 next;
176 }
177 if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
178 $defines{$1} = $2 if (exists($defines{$1}));
179 next;
180 }
181 if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
182 $typedefs{$1} = $2 if (exists($typedefs{$1}));
183 next;
184 }
185 if (m/^replace\s+enum\s+(\S+)\s+(\S+)/) {
186 $enums{$1} = $2 if (exists($enums{$1}));
187 next;
188 }
189 if (m/^replace\s+symbol\s+(\S+)\s+(\S+)/) {
190 $enum_symbols{$1} = $2 if (exists($enum_symbols{$1}));
191 next;
192 }
193 if (m/^replace\s+struct\s+(\S+)\s+(\S+)/) {
194 $structs{$1} = $2 if (exists($structs{$1}));
195 next;
196 }
197
198 die "Can't parse $file_exceptions: $_";
199 }
200}
201
202if ($debug) {
203 print Data::Dumper->Dump([\%ioctls], [qw(*ioctls)]) if (%ioctls);
204 print Data::Dumper->Dump([\%typedefs], [qw(*typedefs)]) if (%typedefs);
205 print Data::Dumper->Dump([\%enums], [qw(*enums)]) if (%enums);
206 print Data::Dumper->Dump([\%structs], [qw(*structs)]) if (%structs);
207 print Data::Dumper->Dump([\%defines], [qw(*defines)]) if (%defines);
208 print Data::Dumper->Dump([\%enum_symbols], [qw(*enum_symbols)]) if (%enum_symbols);
209}
210
211#
212# Align block
213#
214$data = expand($data);
215$data = " " . $data;
216$data =~ s/\n/\n /g;
217$data =~ s/\n\s+$/\n/g;
218$data =~ s/\n\s+\n/\n\n/g;
219
220#
221# Add escape codes for special characters
222#
223$data =~ s,([\_\`\*\<\>\&\\\\:\/\|]),\\$1,g;
224
225$data =~ s,DEPRECATED,**DEPRECATED**,g;
226
227#
228# Add references
229#
230
231my $start_delim = "[ \n\t\(\=\*\@]";
232my $end_delim = "(\\s|,|\\\\=|\\\\:|\\;|\\\)|\\}|\\{)";
233
234foreach my $r (keys %ioctls) {
235 my $n = $ioctls{$r};
236
237 my $s = "\\ :ref:`$r <$n>`\\ ";
238
239 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
240
241 print "$r -> $s\n" if ($debug);
242
243 $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
244}
245
246foreach my $r (keys %defines) {
247 my $n = $defines{$r};
248
249 my $s = "\\ :ref:`$r <$n>`\\ ";
250
251 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
252
253 print "$r -> $s\n" if ($debug);
254
255 $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
256}
257
258foreach my $r (keys %enum_symbols) {
259 my $n = $enum_symbols{$r};
260
261 my $s = "\\ :ref:`$r <$n>`\\ ";
262
263 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
264
265 print "$r -> $s\n" if ($debug);
266
267 $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
268}
269
270foreach my $r (keys %enums) {
271 my $n = $enums{$r};
272
273 my $s = "\\ :ref:`enum $r <$n>`\\ ";
274
275 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
276
277 print "$r -> $s\n" if ($debug);
278
279 $data =~ s/enum\s+($r)$end_delim/$s$2/g;
280}
281
282foreach my $r (keys %structs) {
283 my $n = $structs{$r};
284
285 my $s = "\\ :ref:`struct $r <$n>`\\ ";
286
287 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
288
289 print "$r -> $s\n" if ($debug);
290
291 $data =~ s/struct\s+($r)$end_delim/$s$2/g;
292}
293
294foreach my $r (keys %typedefs) {
295 my $n = $typedefs{$r};
296
297 my $s = "\\ :ref:`$r <$n>`\\ ";
298
299 $r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
300
301 print "$r -> $s\n" if ($debug);
302
303 $data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
304}
305
306$data =~ s/\\ \n/\n/g;
307
308#
309# Generate output file
310#
311
312my $title = $file_in;
313$title =~ s,.*/,,;
314
315open OUT, "> $file_out" or die "Can't open $file_out";
316print OUT ".. -*- coding: utf-8; mode: rst -*-\n\n";
317print OUT "$title\n";
318print OUT "=" x length($title);
319print OUT "\n\n.. parsed-literal::\n\n";
320print OUT $data;
321close OUT;
diff --git a/Documentation/video4linux/API.html b/Documentation/video4linux/API.html
deleted file mode 100644
index eaf948cf1ae7..000000000000
--- a/Documentation/video4linux/API.html
+++ /dev/null
@@ -1,27 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3 <head>
4 <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type" />
5 <title>V4L API</title>
6 </head>
7 <body>
8 <h1>Video For Linux APIs</h1>
9 <table border="0">
10 <tr>
11 <td>
12 <a href="https://linuxtv.org/downloads/legacy/video4linux/API/V4L1_API.html">V4L original API</a>
13 </td>
14 <td>
15 Obsoleted by V4L2 API
16 </td>
17 </tr>
18 <tr>
19 <td>
20 <a href="http://v4l2spec.bytesex.org/spec-single/v4l2.html">V4L2 API</a>
21 </td>
22 <td>Should be used for new projects
23 </td>
24 </tr>
25 </table>
26 </body>
27</html>
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828
deleted file mode 100644
index 55a21deab7db..000000000000
--- a/Documentation/video4linux/CARDLIST.au0828
+++ /dev/null
@@ -1,6 +0,0 @@
1 0 -> Unknown board (au0828)
2 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008,2040:7260,2040:7213,2040:7270]
3 2 -> Hauppauge HVR850 (au0828) [2040:7240]
4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
5 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281]
6 5 -> Hauppauge Woodbury (au0828) [05e1:0480,2040:8200]
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
deleted file mode 100644
index b092c0a14df2..000000000000
--- a/Documentation/video4linux/CARDLIST.bttv
+++ /dev/null
@@ -1,167 +0,0 @@
1 0 -> *** UNKNOWN/GENERIC ***
2 1 -> MIRO PCTV
3 2 -> Hauppauge (bt848)
4 3 -> STB, Gateway P/N 6000699 (bt848)
5 4 -> Intel Create and Share PCI/ Smart Video Recorder III
6 5 -> Diamond DTV2000
7 6 -> AVerMedia TVPhone
8 7 -> MATRIX-Vision MV-Delta
9 8 -> Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26
10 9 -> IMS/IXmicro TurboTV
11 10 -> Hauppauge (bt878) [0070:13eb,0070:3900,2636:10b4]
12 11 -> MIRO PCTV pro
13 12 -> ADS Technologies Channel Surfer TV (bt848)
14 13 -> AVerMedia TVCapture 98 [1461:0002,1461:0004,1461:0300]
15 14 -> Aimslab Video Highway Xtreme (VHX)
16 15 -> Zoltrix TV-Max [a1a0:a0fc]
17 16 -> Prolink Pixelview PlayTV (bt878)
18 17 -> Leadtek WinView 601
19 18 -> AVEC Intercapture
20 19 -> Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
21 20 -> CEI Raffles Card
22 21 -> Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
23 22 -> Askey CPH050/ Phoebe Tv Master + FM [14ff:3002]
24 23 -> Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878 [14c7:0101]
25 24 -> Askey CPH05X/06X (bt878) [many vendors] [144f:3002,144f:3005,144f:5000,14ff:3000]
26 25 -> Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
27 26 -> Hauppauge WinCam newer (bt878)
28 27 -> Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
29 28 -> Terratec TerraTV+ Version 1.1 (bt878) [153b:1127,1852:1852]
30 29 -> Imagenation PXC200 [1295:200a]
31 30 -> Lifeview FlyVideo 98 LR50 [1f7f:1850]
32 31 -> Formac iProTV, Formac ProTV I (bt848)
33 32 -> Intel Create and Share PCI/ Smart Video Recorder III
34 33 -> Terratec TerraTValue Version Bt878 [153b:1117,153b:1118,153b:1119,153b:111a,153b:1134,153b:5018]
35 34 -> Leadtek WinFast 2000/ WinFast 2000 XP [107d:6606,107d:6609,6606:217d,f6ff:fff6]
36 35 -> Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II [1851:1850,1851:a050]
37 36 -> Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner [1852:1852]
38 37 -> Prolink PixelView PlayTV pro
39 38 -> Askey CPH06X TView99 [144f:3000,144f:a005,a04f:a0fc]
40 39 -> Pinnacle PCTV Studio/Rave [11bd:0012,bd11:1200,bd11:ff00,11bd:ff12]
41 40 -> STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100 [10b4:2636,10b4:2645,121a:3060]
42 41 -> AVerMedia TVPhone 98 [1461:0001,1461:0003]
43 42 -> ProVideo PV951 [aa0c:146c]
44 43 -> Little OnAir TV
45 44 -> Sigma TVII-FM
46 45 -> MATRIX-Vision MV-Delta 2
47 46 -> Zoltrix Genie TV/FM [15b0:4000,15b0:400a,15b0:400d,15b0:4010,15b0:4016]
48 47 -> Terratec TV/Radio+ [153b:1123]
49 48 -> Askey CPH03x/ Dynalink Magic TView
50 49 -> IODATA GV-BCTV3/PCI [10fc:4020]
51 50 -> Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
52 51 -> Eagle Wireless Capricorn2 (bt878A)
53 52 -> Pinnacle PCTV Studio Pro
54 53 -> Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
55 54 -> Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
56 55 -> Askey CPH031/ BESTBUY Easy TV
57 56 -> Lifeview FlyVideo 98FM LR50 [a051:41a0]
58 57 -> GrandTec 'Grand Video Capture' (Bt848) [4344:4142]
59 58 -> Askey CPH060/ Phoebe TV Master Only (No FM)
60 59 -> Askey CPH03x TV Capturer
61 60 -> Modular Technology MM100PCTV
62 61 -> AG Electronics GMV1 [15cb:0101]
63 62 -> Askey CPH061/ BESTBUY Easy TV (bt878)
64 63 -> ATI TV-Wonder [1002:0001]
65 64 -> ATI TV-Wonder VE [1002:0003]
66 65 -> Lifeview FlyVideo 2000S LR90
67 66 -> Terratec TValueRadio [153b:1135,153b:ff3b]
68 67 -> IODATA GV-BCTV4/PCI [10fc:4050]
69 68 -> 3Dfx VoodooTV FM (Euro) [10b4:2637]
70 69 -> Active Imaging AIMMS
71 70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
72 71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851]
73 72 -> Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM) [1554:4011]
74 73 -> Sensoray 311/611 [6000:0311,6000:0611]
75 74 -> RemoteVision MX (RV605)
76 75 -> Powercolor MTV878/ MTV878R/ MTV878F
77 76 -> Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP) [0e11:0079]
78 77 -> GrandTec Multi Capture Card (Bt878)
79 78 -> Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF [0a01:17de]
80 79 -> DSP Design TCVIDEO
81 80 -> Hauppauge WinTV PVR [0070:4500]
82 81 -> IODATA GV-BCTV5/PCI [10fc:4070,10fc:d018]
83 82 -> Osprey 100/150 (878) [0070:ff00]
84 83 -> Osprey 100/150 (848)
85 84 -> Osprey 101 (848)
86 85 -> Osprey 101/151
87 86 -> Osprey 101/151 w/ svid
88 87 -> Osprey 200/201/250/251
89 88 -> Osprey 200/250 [0070:ff01]
90 89 -> Osprey 210/220/230
91 90 -> Osprey 500 [0070:ff02]
92 91 -> Osprey 540 [0070:ff04]
93 92 -> Osprey 2000 [0070:ff03]
94 93 -> IDS Eagle
95 94 -> Pinnacle PCTV Sat [11bd:001c]
96 95 -> Formac ProTV II (bt878)
97 96 -> MachTV
98 97 -> Euresys Picolo
99 98 -> ProVideo PV150 [aa00:1460,aa01:1461,aa02:1462,aa03:1463,aa04:1464,aa05:1465,aa06:1466,aa07:1467]
100 99 -> AD-TVK503
101100 -> Hercules Smart TV Stereo
102101 -> Pace TV & Radio Card
103102 -> IVC-200 [0000:a155,0001:a155,0002:a155,0003:a155,0100:a155,0101:a155,0102:a155,0103:a155,0800:a155,0801:a155,0802:a155,0803:a155]
104103 -> Grand X-Guard / Trust 814PCI [0304:0102]
105104 -> Nebula Electronics DigiTV [0071:0101]
106105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433]
107106 -> PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)
108107 -> PHYTEC VD-009-X1 VD-011 Combi (bt878)
109108 -> PHYTEC VD-009 MiniDIN (bt878)
110109 -> PHYTEC VD-009 Combi (bt878)
111110 -> IVC-100 [ff00:a132]
112111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182]
113112 -> pcHDTV HD-2000 TV [7063:2000]
114113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00,1822:0026]
115114 -> Winfast VC100 [107d:6607]
116115 -> Teppro TEV-560/InterVision IV-560
117116 -> SIMUS GVC1100 [aa6a:82b2]
118117 -> NGS NGSTV+
119118 -> LMLBT4
120119 -> Tekram M205 PRO
121120 -> Conceptronic CONTVFMi
122121 -> Euresys Picolo Tetra [1805:0105,1805:0106,1805:0107,1805:0108]
123122 -> Spirit TV Tuner
124123 -> AVerMedia AVerTV DVB-T 771 [1461:0771]
125124 -> AverMedia AverTV DVB-T 761 [1461:0761]
126125 -> MATRIX Vision Sigma-SQ
127126 -> MATRIX Vision Sigma-SLC
128127 -> APAC Viewcomp 878(AMAX)
129128 -> DViCO FusionHDTV DVB-T Lite [18ac:db10,18ac:db11]
130129 -> V-Gear MyVCD
131130 -> Super TV Tuner
132131 -> Tibet Systems 'Progress DVR' CS16
133132 -> Kodicom 4400R (master)
134133 -> Kodicom 4400R (slave)
135134 -> Adlink RTV24
136135 -> DViCO FusionHDTV 5 Lite [18ac:d500]
137136 -> Acorp Y878F [9511:1540]
138137 -> Conceptronic CTVFMi v2 [036e:109e]
139138 -> Prolink Pixelview PV-BT878P+ (Rev.2E)
140139 -> Prolink PixelView PlayTV MPEG2 PV-M4900
141140 -> Osprey 440 [0070:ff07]
142141 -> Asound Skyeye PCTV
143142 -> Sabrent TV-FM (bttv version)
144143 -> Hauppauge ImpactVCB (bt878) [0070:13eb]
145144 -> MagicTV
146145 -> SSAI Security Video Interface [4149:5353]
147146 -> SSAI Ultrasound Video Interface [414a:5353]
148147 -> VoodooTV 200 (USA) [121a:3000]
149148 -> DViCO FusionHDTV 2 [dbc0:d200]
150149 -> Typhoon TV-Tuner PCI (50684)
151150 -> Geovision GV-600 [008a:763c]
152151 -> Kozumi KTV-01C
153152 -> Encore ENL TV-FM-2 [1000:1801]
154153 -> PHYTEC VD-012 (bt878)
155154 -> PHYTEC VD-012-X1 (bt878)
156155 -> PHYTEC VD-012-X2 (bt878)
157156 -> IVCE-8784 [0000:f050,0001:f050,0002:f050,0003:f050]
158157 -> Geovision GV-800(S) (master) [800a:763d]
159158 -> Geovision GV-800(S) (slave) [800b:763d,800c:763d,800d:763d]
160159 -> ProVideo PV183 [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540]
161160 -> Tongwei Video Technology TD-3116 [f200:3116]
162161 -> Aposonic W-DVR [0279:0228]
163162 -> Adlink MPG24
164163 -> Bt848 Capture 14MHz
165164 -> CyberVision CV06 (SV)
166165 -> Kworld V-Stream Xpert TV PVR878
167166 -> PCI-8604PW
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
deleted file mode 100644
index c9b4959fd04e..000000000000
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ /dev/null
@@ -1,57 +0,0 @@
1 0 -> UNKNOWN/GENERIC [0070:3400]
2 1 -> Hauppauge WinTV-HVR1800lp [0070:7600]
3 2 -> Hauppauge WinTV-HVR1800 [0070:7800,0070:7801,0070:7809]
4 3 -> Hauppauge WinTV-HVR1250 [0070:7911]
5 4 -> DViCO FusionHDTV5 Express [18ac:d500]
6 5 -> Hauppauge WinTV-HVR1500Q [0070:7790,0070:7797]
7 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717]
8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3]
9 8 -> Hauppauge WinTV-HVR1700 [0070:8101]
10 9 -> Hauppauge WinTV-HVR1400 [0070:8010]
11 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618]
12 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
13 12 -> Leadtek Winfast PxDVR3200 H [107d:6681]
14 13 -> Compro VideoMate E650F [185b:e800]
15 14 -> TurboSight TBS 6920 [6920:8888]
16 15 -> TeVii S470 [d470:9022]
17 16 -> DVBWorld DVB-S2 2005 [0001:2005]
18 17 -> NetUP Dual DVB-S2 CI [1b55:2a2c]
19 18 -> Hauppauge WinTV-HVR1270 [0070:2211]
20 19 -> Hauppauge WinTV-HVR1275 [0070:2215,0070:221d,0070:22f2]
21 20 -> Hauppauge WinTV-HVR1255 [0070:2251,0070:22f1]
22 21 -> Hauppauge WinTV-HVR1210 [0070:2291,0070:2295,0070:2299,0070:229d,0070:22f0,0070:22f3,0070:22f4,0070:22f5]
23 22 -> Mygica X8506 DMB-TH [14f1:8651]
24 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657]
25 24 -> Hauppauge WinTV-HVR1850 [0070:8541]
26 25 -> Compro VideoMate E800 [1858:e800]
27 26 -> Hauppauge WinTV-HVR1290 [0070:8551]
28 27 -> Mygica X8558 PRO DMB-TH [14f1:8578]
29 28 -> LEADTEK WinFast PxTV1200 [107d:6f22]
30 29 -> GoTView X5 3D Hybrid [5654:2390]
31 30 -> NetUP Dual DVB-T/C-CI RF [1b55:e2e4]
32 31 -> Leadtek Winfast PxDVR3200 H XC4000 [107d:6f39]
33 32 -> MPX-885
34 33 -> Mygica X8502/X8507 ISDB-T [14f1:8502]
35 34 -> TerraTec Cinergy T PCIe Dual [153b:117e]
36 35 -> TeVii S471 [d471:9022]
37 36 -> Hauppauge WinTV-HVR1255 [0070:2259]
38 37 -> Prof Revolution DVB-S2 8000 [8000:3034]
39 38 -> Hauppauge WinTV-HVR4400/HVR5500 [0070:c108,0070:c138,0070:c1f8]
40 39 -> AVerTV Hybrid Express Slim HC81R [1461:d939]
41 40 -> TurboSight TBS 6981 [6981:8888]
42 41 -> TurboSight TBS 6980 [6980:8888]
43 42 -> Leadtek Winfast PxPVR2200 [107d:6f21]
44 43 -> Hauppauge ImpactVCB-e [0070:7133]
45 44 -> DViCO FusionHDTV DVB-T Dual Express2 [18ac:db98]
46 45 -> DVBSky T9580 [4254:9580]
47 46 -> DVBSky T980C [4254:980c]
48 47 -> DVBSky S950C [4254:950c]
49 48 -> Technotrend TT-budget CT2-4500 CI [13c2:3013]
50 49 -> DVBSky S950 [4254:0950]
51 50 -> DVBSky S952 [4254:0952]
52 51 -> DVBSky T982 [4254:0982]
53 52 -> Hauppauge WinTV-HVR5525 [0070:f038]
54 53 -> Hauppauge WinTV Starburst [0070:c12a]
55 54 -> ViewCast 260e [1576:0260]
56 55 -> ViewCast 460e [1576:0460]
57 56 -> Hauppauge WinTV-quadHD (DVB) [0070:6a28,0070:6b28]
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
deleted file mode 100644
index fa4b3f947468..000000000000
--- a/Documentation/video4linux/CARDLIST.cx88
+++ /dev/null
@@ -1,91 +0,0 @@
1 0 -> UNKNOWN/GENERIC
2 1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401]
3 2 -> GDI Black Gold [14c7:0106,14c7:0107]
4 3 -> PixelView [1554:4811]
5 4 -> ATI TV Wonder Pro [1002:00f8,1002:00f9]
6 5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613]
7 6 -> AverTV Studio 303 (M126) [1461:000b]
8 7 -> MSI TV-@nywhere Master [1462:8606]
9 8 -> Leadtek Winfast DV2000 [107d:6620,107d:6621]
10 9 -> Leadtek PVR 2000 [107d:663b,107d:663c,107d:6632,107d:6630,107d:6638,107d:6631,107d:6637,107d:663d]
11 10 -> IODATA GV-VCP3/PCI [10fc:d003]
12 11 -> Prolink PlayTV PVR
13 12 -> ASUS PVR-416 [1043:4823,1461:c111]
14 13 -> MSI TV-@nywhere
15 14 -> KWorld/VStream XPert DVB-T [17de:08a6]
16 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00]
17 16 -> KWorld LTV883RF
18 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810,18ac:d800]
19 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001,0070:9000]
20 19 -> Conexant DVB-T reference design [14f1:0187]
21 20 -> Provideo PV259 [1540:2580]
22 21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10,18ac:db11]
23 22 -> pcHDTV HD3000 HDTV [7063:3000]
24 23 -> digitalnow DNTV Live! DVB-T [17de:a8a6]
25 24 -> Hauppauge WinTV 28xxx (Roslyn) models [0070:2801]
26 25 -> Digital-Logic MICROSPACE Entertainment Center (MEC) [14f1:0342]
27 26 -> IODATA GV/BCTV7E [10fc:d035]
28 27 -> PixelView PlayTV Ultra Pro (Stereo)
29 28 -> DViCO FusionHDTV 3 Gold-T [18ac:d820]
30 29 -> ADS Tech Instant TV DVB-T PCI [1421:0334]
31 30 -> TerraTec Cinergy 1400 DVB-T [153b:1166]
32 31 -> DViCO FusionHDTV 5 Gold [18ac:d500]
33 32 -> AverMedia UltraTV Media Center PCI 550 [1461:8011]
34 33 -> Kworld V-Stream Xpert DVD
35 34 -> ATI HDTV Wonder [1002:a101]
36 35 -> WinFast DTV1000-T [107d:665f]
37 36 -> AVerTV 303 (M126) [1461:000a]
38 37 -> Hauppauge Nova-S-Plus DVB-S [0070:9201,0070:9202]
39 38 -> Hauppauge Nova-SE2 DVB-S [0070:9200]
40 39 -> KWorld DVB-S 100 [17de:08b2,1421:0341]
41 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402]
42 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802]
43 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019]
44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1,12ab:2300]
45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
46 45 -> KWorld HardwareMpegTV XPert [17de:0840,1421:0305]
47 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44]
48 47 -> pcHDTV HD5500 HDTV [7063:5500]
49 48 -> Kworld MCE 200 Deluxe [17de:0841]
50 49 -> PixelView PlayTV P7000 [1554:4813]
51 50 -> NPG Tech Real TV FM Top 10 [14f1:0842]
52 51 -> WinFast DTV2000 H [107d:665e]
53 52 -> Geniatech DVB-S [14f1:0084]
54 53 -> Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T [0070:1404,0070:1400,0070:1401,0070:1402]
55 54 -> Norwood Micro TV Tuner
56 55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM [c180:c980]
57 56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602]
58 57 -> ADS Tech Instant Video PCI [1421:0390]
59 58 -> Pinnacle PCTV HD 800i [11bd:0051]
60 59 -> DViCO FusionHDTV 5 PCI nano [18ac:d530]
61 60 -> Pinnacle Hybrid PCTV [12ab:1788]
62 61 -> Leadtek TV2000 XP Global [107d:6f18,107d:6618,107d:6619]
63 62 -> PowerColor RA330 [14f1:ea3d]
64 63 -> Geniatech X8000-MT DVBT [14f1:8852]
65 64 -> DViCO FusionHDTV DVB-T PRO [18ac:db30]
66 65 -> DViCO FusionHDTV 7 Gold [18ac:d610]
67 66 -> Prolink Pixelview MPEG 8000GT [1554:4935]
68 67 -> Kworld PlusTV HD PCI 120 (ATSC 120) [17de:08c1]
69 68 -> Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid [0070:6900,0070:6904,0070:6902]
70 69 -> Hauppauge WinTV-HVR4000(Lite) DVB-S/S2 [0070:6905,0070:6906]
71 70 -> TeVii S460 DVB-S/S2 [d460:9022]
72 71 -> Omicom SS4 DVB-S/S2 PCI [A044:2011]
73 72 -> TBS 8920 DVB-S/S2 [8920:8888]
74 73 -> TeVii S420 DVB-S [d420:9022]
75 74 -> Prolink Pixelview Global Extreme [1554:4976]
76 75 -> PROF 7300 DVB-S/S2 [B033:3033]
77 76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200]
78 77 -> TBS 8910 DVB-S [8910:8888]
79 78 -> Prof 6200 DVB-S [b022:3022]
80 79 -> Terratec Cinergy HT PCI MKII [153b:1177]
81 80 -> Hauppauge WinTV-IR Only [0070:9290]
82 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654]
83 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
84 83 -> Prof 7301 DVB-S/S2 [b034:3034]
85 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd]
86 85 -> Twinhan VP-1027 DVB-S [1822:0023]
87 86 -> TeVii S464 DVB-S/S2 [d464:9022]
88 87 -> Leadtek WinFast DTV2000 H PLUS [107d:6f42]
89 88 -> Leadtek WinFast DTV1800 H (XC4000) [107d:6f38]
90 89 -> Leadtek TV2000 XP Global (SC4100) [107d:6f36]
91 90 -> Leadtek TV2000 XP Global (XC4100) [107d:6f43]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
deleted file mode 100644
index 6784220c6a16..000000000000
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ /dev/null
@@ -1,100 +0,0 @@
1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868,eb1a:2875]
3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
6 5 -> MSI VOX USB 2.0 (em2820/em2840)
7 6 -> Terratec Cinergy 200 USB (em2800)
8 7 -> Leadtek Winfast USB II (em2800) [0413:6023]
9 8 -> Kworld USB2800 (em2800)
10 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a,093b:a003]
11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
12 11 -> Terratec Hybrid XS (em2880)
13 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
14 13 -> Terratec Prodigy XS (em2880)
15 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
16 15 -> V-Gear PocketTV (em2800)
17 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b]
18 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
19 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502]
20 19 -> EM2860/SAA711X Reference Design (em2860)
21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002]
22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801]
23 22 -> EM2710/EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751]
24 23 -> Huaqi DLCW-130 (em2750)
25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112]
26 25 -> Gadmei UTV310 (em2820/em2840)
27 26 -> Hercules Smart TV USB 2.0 (em2820/em2840)
28 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840)
29 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840)
30 29 -> EM2860/TVP5150 Reference Design (em2860)
31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
32 31 -> Usbgear VD204v9 (em2821)
33 32 -> Supercomp USB 2.0 TV (em2821)
34 33 -> Elgato Video Capture (em2860) [0fd9:0033]
35 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
36 35 -> Typhoon DVD Maker (em2860)
37 36 -> NetGMBH Cam (em2860)
38 37 -> Gadmei UTV330 (em2860) [eb1a:50a6]
39 38 -> Yakumo MovieMixer (em2861)
40 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300]
41 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]
42 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]
43 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359]
44 43 -> Terratec Cinergy T XS (em2870)
45 44 -> Terratec Cinergy T XS (MT2060) (em2870) [0ccd:0043]
46 45 -> Pinnacle PCTV DVB-T (em2870)
47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
49 48 -> KWorld DVB-T 310U (em2880)
50 49 -> MSI DigiVox A/D (em2880) [eb1a:e310]
51 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320]
52 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c]
53 52 -> DNT DA2 Hybrid (em2881)
54 53 -> Pinnacle Hybrid Pro (em2881)
55 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323]
56 55 -> Terratec Cinnergy Hybrid T USB XS (em2882) (em2882) [0ccd:005e,0ccd:0042]
57 56 -> Pinnacle Hybrid Pro (330e) (em2882) [2304:0226]
58 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
59 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
60 59 -> Pinnacle PCTV HD Mini (em2874) [2304:023f]
61 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
62 61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840)
63 62 -> Gadmei TVR200 (em2820/em2840)
64 63 -> Kaiomy TVnPC U2 (em2860) [eb1a:e303]
65 64 -> Easy Cap Capture DC-60 (em2860) [1b80:e309]
66 65 -> IO-DATA GV-MVP/SZ (em2820/em2840) [04bb:0515]
67 66 -> Empire dual TV (em2880)
68 67 -> Terratec Grabby (em2860) [0ccd:0096,0ccd:10AF]
69 68 -> Terratec AV350 (em2860) [0ccd:0084]
70 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313]
71 70 -> Evga inDtube (em2882)
72 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840)
73 72 -> Gadmei UTV330+ (em2861)
74 73 -> Reddo DVB-C USB TV Box (em2870)
75 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800)
76 75 -> Dikom DK300 (em2882)
77 76 -> KWorld PlusTV 340U or UB435-Q (ATSC) (em2870) [1b80:a340]
78 77 -> EM2874 Leadership ISDBT (em2874)
79 78 -> PCTV nanoStick T2 290e (em28174) [2013:024f]
80 79 -> Terratec Cinergy H5 (em2884) [eb1a:2885,0ccd:10a2,0ccd:10ad,0ccd:10b6]
81 80 -> PCTV DVB-S2 Stick (460e) (em28174) [2013:024c]
82 81 -> Hauppauge WinTV HVR 930C (em2884) [2040:1605]
83 82 -> Terratec Cinergy HTC Stick (em2884) [0ccd:00b2]
84 83 -> Honestech Vidbox NW03 (em2860) [eb1a:5006]
85 84 -> MaxMedia UB425-TC (em2874) [1b80:e425]
86 85 -> PCTV QuatroStick (510e) (em2884) [2304:0242]
87 86 -> PCTV QuatroStick nano (520e) (em2884) [2013:0251]
88 87 -> Terratec Cinergy HTC USB XS (em2884) [0ccd:008e,0ccd:00ac]
89 88 -> C3 Tech Digital Duo HDTV/SDTV USB (em2884) [1b80:e755]
90 89 -> Delock 61959 (em2874) [1b80:e1cc]
91 90 -> KWorld USB ATSC TV Stick UB435-Q V2 (em2874) [1b80:e346]
92 91 -> SpeedLink Vicious And Devine Laplace webcam (em2765) [1ae7:9003,1ae7:9004]
93 92 -> PCTV DVB-S2 Stick (461e) (em28178) [2013:0258]
94 93 -> KWorld USB ATSC TV Stick UB435-Q V3 (em2874) [1b80:e34c]
95 94 -> PCTV tripleStick (292e) (em28178) [2013:025f,2040:0264]
96 95 -> Leadtek VC100 (em2861) [0413:6f07]
97 96 -> Terratec Cinergy T2 Stick HD (em28178) [eb1a:8179]
98 97 -> Elgato EyeTV Hybrid 2008 INT (em2884) [0fd9:0018]
99 98 -> PLEX PX-BCUD (em28178) [3275:0085]
100 99 -> Hauppauge WinTV-dualHD DVB (em28174) [2040:0265]
diff --git a/Documentation/video4linux/CARDLIST.ivtv b/Documentation/video4linux/CARDLIST.ivtv
deleted file mode 100644
index a019e27e42b3..000000000000
--- a/Documentation/video4linux/CARDLIST.ivtv
+++ /dev/null
@@ -1,24 +0,0 @@
1 1 -> Hauppauge WinTV PVR-250
2 2 -> Hauppauge WinTV PVR-350
3 3 -> Hauppauge WinTV PVR-150 or PVR-500
4 4 -> AVerMedia M179 [1461:a3ce,1461:a3cf]
5 5 -> Yuan MPG600/Kuroutoshikou iTVC16-STVLP [12ab:fff3,12ab:ffff]
6 6 -> Yuan MPG160/Kuroutoshikou iTVC15-STVLP [12ab:0000,10fc:40a0]
7 7 -> Yuan PG600/DiamondMM PVR-550 [ff92:0070,ffab:0600]
8 8 -> Adaptec AVC-2410 [9005:0093]
9 9 -> Adaptec AVC-2010 [9005:0092]
1010 -> NAGASE TRANSGEAR 5000TV [1461:bfff]
1111 -> AOpen VA2000MAX-STN6 [0000:ff5f]
1212 -> YUAN MPG600GR/Kuroutoshikou CX23416GYC-STVLP [12ab:0600,fbab:0600,1154:0523]
1313 -> I/O Data GV-MVP/RX [10fc:d01e,10fc:d038,10fc:d039]
1414 -> I/O Data GV-MVP/RX2E [10fc:d025]
1515 -> GOTVIEW PCI DVD (partial support only) [12ab:0600]
1616 -> GOTVIEW PCI DVD2 Deluxe [ffac:0600]
1717 -> Yuan MPC622 [ff01:d998]
1818 -> Digital Cowboy DCT-MTVP1 [1461:bfff]
1919 -> Yuan PG600V2/GotView PCI DVD Lite [ffab:0600,ffad:0600]
2020 -> Club3D ZAP-TV1x01 [ffab:0600]
2121 -> AverTV MCE 116 Plus [1461:c439]
2222 -> ASUS Falcon2 [1043:4b66,1043:462e,1043:4b2e]
2323 -> AverMedia PVR-150 Plus [1461:c035]
2424 -> AverMedia EZMaker PCI Deluxe [1461:c03f]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
deleted file mode 100644
index 335c24338859..000000000000
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ /dev/null
@@ -1,197 +0,0 @@
1 0 -> UNKNOWN/GENERIC
2 1 -> Proteus Pro [philips reference design] [1131:2001,1131:2001]
3 2 -> LifeView FlyVIDEO3000 [5168:0138,4e42:0138]
4 3 -> LifeView/Typhoon FlyVIDEO2000 [5168:0138,4e42:0138]
5 4 -> EMPRESS [1131:6752]
6 5 -> SKNet Monster TV [1131:4e85]
7 6 -> Tevion MD 9717
8 7 -> KNC One TV-Station RDS / Typhoon TV Tuner RDS [1131:fe01,1894:fe01]
9 8 -> Terratec Cinergy 400 TV [153b:1142]
10 9 -> Medion 5044
11 10 -> Kworld/KuroutoShikou SAA7130-TVPCI
12 11 -> Terratec Cinergy 600 TV [153b:1143]
13 12 -> Medion 7134 [16be:0003,16be:5000]
14 13 -> Typhoon TV+Radio 90031
15 14 -> ELSA EX-VISION 300TV [1048:226b]
16 15 -> ELSA EX-VISION 500TV [1048:226a]
17 16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840]
18 17 -> AOPEN VA1000 POWER [1131:7133]
19 18 -> BMK MPEX No Tuner
20 19 -> Compro VideoMate TV [185b:c100]
21 20 -> Matrox CronosPlus [102B:48d0]
22 21 -> 10MOONS PCI TV CAPTURE CARD [1131:2001]
23 22 -> AverMedia M156 / Medion 2819 [1461:a70b]
24 23 -> BMK MPEX Tuner
25 24 -> KNC One TV-Station DVR [1894:a006]
26 25 -> ASUS TV-FM 7133 [1043:4843]
27 26 -> Pinnacle PCTV Stereo (saa7134) [11bd:002b]
28 27 -> Manli MuchTV M-TV002
29 28 -> Manli MuchTV M-TV001
30 29 -> Nagase Sangyo TransGear 3000TV [1461:050c]
31 30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM) [1019:4cb4]
32 31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
33 32 -> AVACS SmartTV
34 33 -> AVerMedia DVD EZMaker [1461:10ff]
35 34 -> Noval Prime TV 7133
36 35 -> AverMedia AverTV Studio 305 [1461:2115]
37 36 -> UPMOST PURPLE TV [12ab:0800]
38 37 -> Items MuchTV Plus / IT-005
39 38 -> Terratec Cinergy 200 TV [153b:1152]
40 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212,5169:1502]
41 40 -> Compro VideoMate TV PVR/FM [185b:c100]
42 41 -> Compro VideoMate TV Gold+ [185b:c100]
43 42 -> Sabrent SBT-TVFM (saa7130)
44 43 -> :Zolid Xpert TV7134
45 44 -> Empire PCI TV-Radio LE
46 45 -> Avermedia AVerTV Studio 307 [1461:9715]
47 46 -> AVerMedia Cardbus TV/Radio (E500) [1461:d6ee]
48 47 -> Terratec Cinergy 400 mobile [153b:1162]
49 48 -> Terratec Cinergy 600 TV MK3 [153b:1158]
50 49 -> Compro VideoMate Gold+ Pal [185b:c200]
51 50 -> Pinnacle PCTV 300i DVB-T + PAL [11bd:002d]
52 51 -> ProVideo PV952 [1540:9524]
53 52 -> AverMedia AverTV/305 [1461:2108]
54 53 -> ASUS TV-FM 7135 [1043:4845]
55 54 -> LifeView FlyTV Platinum FM / Gold [5168:0214,5168:5214,1489:0214,5168:0304]
56 55 -> LifeView FlyDVB-T DUO / MSI TV@nywhere Duo [5168:0306,4E42:0306]
57 56 -> Avermedia AVerTV 307 [1461:a70a]
58 57 -> Avermedia AVerTV GO 007 FM [1461:f31f]
59 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370]
60 59 -> Kworld/Tevion V-Stream Xpert TV PVR7134
61 60 -> LifeView/Typhoon/Genius FlyDVB-T Duo Cardbus [5168:0502,4e42:0502,1489:0502]
62 61 -> Philips TOUGH DVB-T reference design [1131:2004]
63 62 -> Compro VideoMate TV Gold+II
64 63 -> Kworld Xpert TV PVR7134
65 64 -> FlyTV mini Asus Digimatrix [1043:0210]
66 65 -> V-Stream Studio TV Terminator
67 66 -> Yuan TUN-900 (saa7135)
68 67 -> Beholder BeholdTV 409 FM [0000:4091]
69 68 -> GoTView 7135 PCI [5456:7135]
70 69 -> Philips EUROPA V3 reference design [1131:2004]
71 70 -> Compro Videomate DVB-T300 [185b:c900]
72 71 -> Compro Videomate DVB-T200 [185b:c901]
73 72 -> RTD Embedded Technologies VFG7350 [1435:7350]
74 73 -> RTD Embedded Technologies VFG7330 [1435:7330]
75 74 -> LifeView FlyTV Platinum Mini2 [14c0:1212]
76 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044]
77 76 -> SKNet MonsterTV Mobile [1131:4ee9]
78 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e]
79 78 -> ASUSTeK P7131 Dual [1043:4862]
80 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
81 80 -> ASUS Digimatrix TV [1043:0210]
82 81 -> Philips Tiger reference design [1131:2018]
83 82 -> MSI TV@Anywhere plus [1462:6231,1462:8624]
84 83 -> Terratec Cinergy 250 PCI TV [153b:1160]
85 84 -> LifeView FlyDVB Trio [5168:0319]
86 85 -> AverTV DVB-T 777 [1461:2c05,1461:2c05]
87 86 -> LifeView FlyDVB-T / Genius VideoWonder DVB-T [5168:0301,1489:0301]
88 87 -> ADS Instant TV Duo Cardbus PTV331 [0331:1421]
89 88 -> Tevion/KWorld DVB-T 220RF [17de:7201]
90 89 -> ELSA EX-VISION 700TV [1048:226c]
91 90 -> Kworld ATSC110/115 [17de:7350,17de:7352]
92 91 -> AVerMedia A169 B [1461:7360]
93 92 -> AVerMedia A169 B1 [1461:6360]
94 93 -> Medion 7134 Bridge #2 [16be:0005]
95 94 -> LifeView FlyDVB-T Hybrid Cardbus/MSI TV @nywhere A/D NB [5168:3306,5168:3502,5168:3307,4e42:3502]
96 95 -> LifeView FlyVIDEO3000 (NTSC) [5169:0138]
97 96 -> Medion Md8800 Quadro [16be:0007,16be:0008,16be:000d]
98 97 -> LifeView FlyDVB-S /Acorp TV134DS [5168:0300,4e42:0300]
99 98 -> Proteus Pro 2309 [0919:2003]
100 99 -> AVerMedia TV Hybrid A16AR [1461:2c00]
101100 -> Asus Europa2 OEM [1043:4860]
102101 -> Pinnacle PCTV 310i [11bd:002f]
103102 -> Avermedia AVerTV Studio 507 [1461:9715]
104103 -> Compro Videomate DVB-T200A
105104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6700,0070:6701,0070:6702,0070:6703,0070:6704,0070:6705]
106105 -> Terratec Cinergy HT PCMCIA [153b:1172]
107106 -> Encore ENLTV [1131:2342,1131:2341,3016:2344]
108107 -> Encore ENLTV-FM [1131:230f]
109108 -> Terratec Cinergy HT PCI [153b:1175]
110109 -> Philips Tiger - S Reference design
111110 -> Avermedia M102 [1461:f31e]
112111 -> ASUS P7131 4871 [1043:4871]
113112 -> ASUSTeK P7131 Hybrid [1043:4876]
114113 -> Elitegroup ECS TVP3XP FM1246 Tuner Card (PAL,FM) [1019:4cb6]
115114 -> KWorld DVB-T 210 [17de:7250]
116115 -> Sabrent PCMCIA TV-PCB05 [0919:2003]
117116 -> 10MOONS TM300 TV Card [1131:2304]
118117 -> Avermedia Super 007 [1461:f01d]
119118 -> Beholder BeholdTV 401 [0000:4016]
120119 -> Beholder BeholdTV 403 [0000:4036]
121120 -> Beholder BeholdTV 403 FM [0000:4037]
122121 -> Beholder BeholdTV 405 [0000:4050]
123122 -> Beholder BeholdTV 405 FM [0000:4051]
124123 -> Beholder BeholdTV 407 [0000:4070]
125124 -> Beholder BeholdTV 407 FM [0000:4071]
126125 -> Beholder BeholdTV 409 [0000:4090]
127126 -> Beholder BeholdTV 505 FM [5ace:5050]
128127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090]
129128 -> Beholder BeholdTV Columbus TV/FM [0000:5201]
130129 -> Beholder BeholdTV 607 FM [5ace:6070]
131130 -> Beholder BeholdTV M6 [5ace:6190]
132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
133132 -> Genius TVGO AM11MCE
134133 -> NXP Snake DVB-S reference design
135134 -> Medion/Creatix CTX953 Hybrid [16be:0010]
136135 -> MSI TV@nywhere A/D v1.1 [1462:8625]
137136 -> AVerMedia Cardbus TV/Radio (E506R) [1461:f436]
138137 -> AVerMedia Hybrid TV/Radio (A16D) [1461:f936]
139138 -> Avermedia M115 [1461:a836]
140139 -> Compro VideoMate T750 [185b:c900]
141140 -> Avermedia DVB-S Pro A700 [1461:a7a1]
142141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2]
143142 -> Beholder BeholdTV H6 [5ace:6290]
144143 -> Beholder BeholdTV M63 [5ace:6191]
145144 -> Beholder BeholdTV M6 Extra [5ace:6193]
146145 -> AVerMedia MiniPCI DVB-T Hybrid M103 [1461:f636,1461:f736]
147146 -> ASUSTeK P7131 Analog
148147 -> Asus Tiger 3in1 [1043:4878]
149148 -> Encore ENLTV-FM v5.3 [1a7f:2008]
150149 -> Avermedia PCI pure analog (M135A) [1461:f11d]
151150 -> Zogis Real Angel 220
152151 -> ADS Tech Instant HDTV [1421:0380]
153152 -> Asus Tiger Rev:1.00 [1043:4857]
154153 -> Kworld Plus TV Analog Lite PCI [17de:7128]
155154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d]
156155 -> Hauppauge WinTV-HVR1150 ATSC/QAM-Hybrid [0070:6706,0070:6708]
157156 -> Hauppauge WinTV-HVR1120 DVB-T/Hybrid [0070:6707,0070:6709,0070:670a]
158157 -> Avermedia AVerTV Studio 507UA [1461:a11b]
159158 -> AVerMedia Cardbus TV/Radio (E501R) [1461:b7e9]
160159 -> Beholder BeholdTV 505 RDS [0000:505B]
161160 -> Beholder BeholdTV 507 RDS [0000:5071]
162161 -> Beholder BeholdTV 507 RDS [0000:507B]
163162 -> Beholder BeholdTV 607 FM [5ace:6071]
164163 -> Beholder BeholdTV 609 FM [5ace:6090]
165164 -> Beholder BeholdTV 609 FM [5ace:6091]
166165 -> Beholder BeholdTV 607 RDS [5ace:6072]
167166 -> Beholder BeholdTV 607 RDS [5ace:6073]
168167 -> Beholder BeholdTV 609 RDS [5ace:6092]
169168 -> Beholder BeholdTV 609 RDS [5ace:6093]
170169 -> Compro VideoMate S350/S300 [185b:c900]
171170 -> AverMedia AverTV Studio 505 [1461:a115]
172171 -> Beholder BeholdTV X7 [5ace:7595]
173172 -> RoverMedia TV Link Pro FM [19d1:0138]
174173 -> Zolid Hybrid TV Tuner PCI [1131:2004]
175174 -> Asus Europa Hybrid OEM [1043:4847]
176175 -> Leadtek Winfast DTV1000S [107d:6655]
177176 -> Beholder BeholdTV 505 RDS [0000:5051]
178177 -> Hawell HW-404M7
179178 -> Beholder BeholdTV H7 [5ace:7190]
180179 -> Beholder BeholdTV A7 [5ace:7090]
181180 -> Avermedia PCI M733A [1461:4155,1461:4255]
182181 -> TechoTrend TT-budget T-3000 [13c2:2804]
183182 -> Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid [17de:b136]
184183 -> Compro VideoMate Vista M1F [185b:c900]
185184 -> Encore ENLTV-FM 3 [1a7f:2108]
186185 -> MagicPro ProHDTV Pro2 DMB-TH/Hybrid [17de:d136]
187186 -> Beholder BeholdTV 501 [5ace:5010]
188187 -> Beholder BeholdTV 503 FM [5ace:5030]
189188 -> Sensoray 811/911 [6000:0811,6000:0911]
190189 -> Kworld PC150-U [17de:a134]
191190 -> Asus My Cinema PS3-100 [1043:48cd]
192191 -> Hawell HW-9004V1
193192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
194193 -> WIS Voyager or compatible [1905:7007]
195194 -> AverMedia AverTV/505 [1461:a10a]
196195 -> Leadtek Winfast TV2100 FM [107d:6f3a]
197196 -> SnaZio* TVPVR PRO [1779:13cf]
diff --git a/Documentation/video4linux/CARDLIST.saa7164 b/Documentation/video4linux/CARDLIST.saa7164
deleted file mode 100644
index 6eb057220474..000000000000
--- a/Documentation/video4linux/CARDLIST.saa7164
+++ /dev/null
@@ -1,14 +0,0 @@
1 0 -> Unknown
2 1 -> Generic Rev2
3 2 -> Generic Rev3
4 3 -> Hauppauge WinTV-HVR2250 [0070:8880,0070:8810]
5 4 -> Hauppauge WinTV-HVR2200 [0070:8980]
6 5 -> Hauppauge WinTV-HVR2200 [0070:8900]
7 6 -> Hauppauge WinTV-HVR2200 [0070:8901]
8 7 -> Hauppauge WinTV-HVR2250 [0070:8891,0070:8851]
9 8 -> Hauppauge WinTV-HVR2250 [0070:88A1]
10 9 -> Hauppauge WinTV-HVR2200 [0070:8940]
11 10 -> Hauppauge WinTV-HVR2200 [0070:8953]
12 11 -> Hauppauge WinTV-HVR2255(proto)
13 12 -> Hauppauge WinTV-HVR2255 [0070:f111]
14 13 -> Hauppauge WinTV-HVR2205 [0070:f123,0070:f120]
diff --git a/Documentation/video4linux/CARDLIST.tm6000 b/Documentation/video4linux/CARDLIST.tm6000
deleted file mode 100644
index b5edce487997..000000000000
--- a/Documentation/video4linux/CARDLIST.tm6000
+++ /dev/null
@@ -1,16 +0,0 @@
1 1 -> Generic tm5600 board (tm5600) [6000:0001]
2 2 -> Generic tm6000 board (tm6000) [6000:0001]
3 3 -> Generic tm6010 board (tm6010) [6000:0002]
4 4 -> 10Moons UT821 (tm5600) [6000:0001]
5 5 -> 10Moons UT330 (tm5600)
6 6 -> ADSTech Dual TV (tm6000) [06e1:f332]
7 7 -> FreeCom and similar (tm6000) [14aa:0620]
8 8 -> ADSTech Mini Dual TV (tm6000) [06e1:b339]
9 9 -> Hauppauge WinTV HVR-900H/USB2 Stick (tm6010) [2040:6600,2040:6601,2040:6610,2040:6611]
10 10 -> Beholder Wander (tm6010) [6000:dec0]
11 11 -> Beholder Voyager (tm6010) [6000:dec1]
12 12 -> TerraTec Cinergy Hybrid XE/Cinergy Hybrid Stick (tm6010) [0ccd:0086,0ccd:00a5]
13 13 -> TwinHan TU501 (tm6010) [13d3:3240,13d3:3241,13d3:3243,13d3:3264]
14 14 -> Beholder Wander Lite (tm6010) [6000:dec2]
15 15 -> Beholder Voyager Lite (tm6010) [6000:dec3]
16
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
deleted file mode 100644
index ac8862184962..000000000000
--- a/Documentation/video4linux/CARDLIST.tuner
+++ /dev/null
@@ -1,91 +0,0 @@
1tuner=0 - Temic PAL (4002 FH5)
2tuner=1 - Philips PAL_I (FI1246 and compatibles)
3tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
4tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
5tuner=4 - NoTuner
6tuner=5 - Philips PAL_BG (FI1216 and compatibles)
7tuner=6 - Temic NTSC (4032 FY5)
8tuner=7 - Temic PAL_I (4062 FY5)
9tuner=8 - Temic NTSC (4036 FY5)
10tuner=9 - Alps HSBH1
11tuner=10 - Alps TSBE1
12tuner=11 - Alps TSBB5
13tuner=12 - Alps TSBE5
14tuner=13 - Alps TSBC5
15tuner=14 - Temic PAL_BG (4006FH5)
16tuner=15 - Alps TSCH6
17tuner=16 - Temic PAL_DK (4016 FY5)
18tuner=17 - Philips NTSC_M (MK2)
19tuner=18 - Temic PAL_I (4066 FY5)
20tuner=19 - Temic PAL* auto (4006 FN5)
21tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
22tuner=21 - Temic NTSC (4039 FR5)
23tuner=22 - Temic PAL/SECAM multi (4046 FM5)
24tuner=23 - Philips PAL_DK (FI1256 and compatibles)
25tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
26tuner=25 - LG PAL_I+FM (TAPC-I001D)
27tuner=26 - LG PAL_I (TAPC-I701D)
28tuner=27 - LG NTSC+FM (TPI8NSR01F)
29tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
30tuner=29 - LG PAL_BG (TPI8PSB11D)
31tuner=30 - Temic PAL* auto + FM (4009 FN5)
32tuner=31 - SHARP NTSC_JP (2U5JF5540)
33tuner=32 - Samsung PAL TCPM9091PD27
34tuner=33 - MT20xx universal
35tuner=34 - Temic PAL_BG (4106 FH5)
36tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
37tuner=36 - Temic NTSC (4136 FY5)
38tuner=37 - LG PAL (newer TAPC series)
39tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
40tuner=39 - LG NTSC (newer TAPC series)
41tuner=40 - HITACHI V7-J180AT
42tuner=41 - Philips PAL_MK (FI1216 MK)
43tuner=42 - Philips FCV1236D ATSC/NTSC dual in
44tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F)
45tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
46tuner=45 - Microtune 4049 FM5
47tuner=46 - Panasonic VP27s/ENGE4324D
48tuner=47 - LG NTSC (TAPE series)
49tuner=48 - Tenna TNF 8831 BGFF)
50tuner=49 - Microtune 4042 FI5 ATSC/NTSC dual in
51tuner=50 - TCL 2002N
52tuner=51 - Philips PAL/SECAM_D (FM 1256 I-H3)
53tuner=52 - Thomson DTT 7610 (ATSC/NTSC)
54tuner=53 - Philips FQ1286
55tuner=54 - Philips/NXP TDA 8290/8295 + 8275/8275A/18271
56tuner=55 - TCL 2002MB
57tuner=56 - Philips PAL/SECAM multi (FQ1216AME MK4)
58tuner=57 - Philips FQ1236A MK4
59tuner=58 - Ymec TVision TVF-8531MF/8831MF/8731MF
60tuner=59 - Ymec TVision TVF-5533MF
61tuner=60 - Thomson DTT 761X (ATSC/NTSC)
62tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF
63tuner=62 - Philips TEA5767HN FM Radio
64tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
65tuner=64 - LG TDVS-H06xF
66tuner=65 - Ymec TVF66T5-B/DFF
67tuner=66 - LG TALN series
68tuner=67 - Philips TD1316 Hybrid Tuner
69tuner=68 - Philips TUV1236D ATSC/NTSC dual in
70tuner=69 - Tena TNF 5335 and similar models
71tuner=70 - Samsung TCPN 2121P30A
72tuner=71 - Xceive xc2028/xc3028 tuner
73tuner=72 - Thomson FE6600
74tuner=73 - Samsung TCPG 6121P30A
75tuner=75 - Philips TEA5761 FM Radio
76tuner=76 - Xceive 5000 tuner
77tuner=77 - TCL tuner MF02GIP-5N-E
78tuner=78 - Philips FMD1216MEX MK3 Hybrid Tuner
79tuner=79 - Philips PAL/SECAM multi (FM1216 MK5)
80tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
81tuner=81 - Partsnic (Daewoo) PTI-5NF05
82tuner=82 - Philips CU1216L
83tuner=83 - NXP TDA18271
84tuner=84 - Sony BTF-Pxn01Z
85tuner=85 - Philips FQ1236 MK5
86tuner=86 - Tena TNF5337 MFD
87tuner=87 - Xceive 4000 tuner
88tuner=88 - Xceive 5000C tuner
89tuner=89 - Sony BTF-PG472Z PAL/SECAM
90tuner=90 - Sony BTF-PK467Z NTSC-M-JP
91tuner=91 - Sony BTF-PB463Z NTSC-M
diff --git a/Documentation/video4linux/CARDLIST.usbvision b/Documentation/video4linux/CARDLIST.usbvision
deleted file mode 100644
index 6fd1af365142..000000000000
--- a/Documentation/video4linux/CARDLIST.usbvision
+++ /dev/null
@@ -1,67 +0,0 @@
1 0 -> Xanboo [0a6f:0400]
2 1 -> Belkin USB VideoBus II Adapter [050d:0106]
3 2 -> Belkin Components USB VideoBus [050d:0207]
4 3 -> Belkin USB VideoBus II [050d:0208]
5 4 -> echoFX InterView Lite [0571:0002]
6 5 -> USBGear USBG-V1 resp. HAMA USB [0573:0003]
7 6 -> D-Link V100 [0573:0400]
8 7 -> X10 USB Camera [0573:2000]
9 8 -> Hauppauge WinTV USB Live (PAL B/G) [0573:2d00]
10 9 -> Hauppauge WinTV USB Live Pro (NTSC M/N) [0573:2d01]
11 10 -> Zoran Co. PMD (Nogatech) AV-grabber Manhattan [0573:2101]
12 11 -> Nogatech USB-TV (NTSC) FM [0573:4100]
13 12 -> PNY USB-TV (NTSC) FM [0573:4110]
14 13 -> PixelView PlayTv-USB PRO (PAL) FM [0573:4450]
15 14 -> ZTV ZT-721 2.4GHz USB A/V Receiver [0573:4550]
16 15 -> Hauppauge WinTV USB (NTSC M/N) [0573:4d00]
17 16 -> Hauppauge WinTV USB (PAL B/G) [0573:4d01]
18 17 -> Hauppauge WinTV USB (PAL I) [0573:4d02]
19 18 -> Hauppauge WinTV USB (PAL/SECAM L) [0573:4d03]
20 19 -> Hauppauge WinTV USB (PAL D/K) [0573:4d04]
21 20 -> Hauppauge WinTV USB (NTSC FM) [0573:4d10]
22 21 -> Hauppauge WinTV USB (PAL B/G FM) [0573:4d11]
23 22 -> Hauppauge WinTV USB (PAL I FM) [0573:4d12]
24 23 -> Hauppauge WinTV USB (PAL D/K FM) [0573:4d14]
25 24 -> Hauppauge WinTV USB Pro (NTSC M/N) [0573:4d2a]
26 25 -> Hauppauge WinTV USB Pro (NTSC M/N) V2 [0573:4d2b]
27 26 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L) [0573:4d2c]
28 27 -> Hauppauge WinTV USB Pro (NTSC M/N) V3 [0573:4d20]
29 28 -> Hauppauge WinTV USB Pro (PAL B/G) [0573:4d21]
30 29 -> Hauppauge WinTV USB Pro (PAL I) [0573:4d22]
31 30 -> Hauppauge WinTV USB Pro (PAL/SECAM L) [0573:4d23]
32 31 -> Hauppauge WinTV USB Pro (PAL D/K) [0573:4d24]
33 32 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) [0573:4d25]
34 33 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2 [0573:4d26]
35 34 -> Hauppauge WinTV USB Pro (PAL B/G) V2 [0573:4d27]
36 35 -> Hauppauge WinTV USB Pro (PAL B/G,D/K) [0573:4d28]
37 36 -> Hauppauge WinTV USB Pro (PAL I,D/K) [0573:4d29]
38 37 -> Hauppauge WinTV USB Pro (NTSC M/N FM) [0573:4d30]
39 38 -> Hauppauge WinTV USB Pro (PAL B/G FM) [0573:4d31]
40 39 -> Hauppauge WinTV USB Pro (PAL I FM) [0573:4d32]
41 40 -> Hauppauge WinTV USB Pro (PAL D/K FM) [0573:4d34]
42 41 -> Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM) [0573:4d35]
43 42 -> Hauppauge WinTV USB Pro (Temic PAL B/G FM) [0573:4d36]
44 43 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM) [0573:4d37]
45 44 -> Hauppauge WinTV USB Pro (NTSC M/N FM) V2 [0573:4d38]
46 45 -> Camtel Technology USB TV Genie Pro FM Model TVB330 [0768:0006]
47 46 -> Digital Video Creator I [07d0:0001]
48 47 -> Global Village GV-007 (NTSC) [07d0:0002]
49 48 -> Dazzle Fusion Model DVC-50 Rev 1 (NTSC) [07d0:0003]
50 49 -> Dazzle Fusion Model DVC-80 Rev 1 (PAL) [07d0:0004]
51 50 -> Dazzle Fusion Model DVC-90 Rev 1 (SECAM) [07d0:0005]
52 51 -> Eskape Labs MyTV2Go [07f8:9104]
53 52 -> Pinnacle Studio PCTV USB (PAL) [2304:010d]
54 53 -> Pinnacle Studio PCTV USB (SECAM) [2304:0109]
55 54 -> Pinnacle Studio PCTV USB (PAL) FM [2304:0110]
56 55 -> Miro PCTV USB [2304:0111]
57 56 -> Pinnacle Studio PCTV USB (NTSC) FM [2304:0112]
58 57 -> Pinnacle Studio PCTV USB (PAL) FM V2 [2304:0210]
59 58 -> Pinnacle Studio PCTV USB (NTSC) FM V2 [2304:0212]
60 59 -> Pinnacle Studio PCTV USB (PAL) FM V3 [2304:0214]
61 60 -> Pinnacle Studio Linx Video input cable (NTSC) [2304:0300]
62 61 -> Pinnacle Studio Linx Video input cable (PAL) [2304:0301]
63 62 -> Pinnacle PCTV Bungee USB (PAL) FM [2304:0419]
64 63 -> Hauppauge WinTv-USB [2400:4200]
65 64 -> Pinnacle Studio PCTV USB (NTSC) FM V3 [2304:0113]
66 65 -> Nogatech USB MicroCam NTSC (NV3000N) [0573:3000]
67 66 -> Nogatech USB MicroCam PAL (NV3001P) [0573:3001]
diff --git a/Documentation/video4linux/README.cpia2 b/Documentation/video4linux/README.cpia2
deleted file mode 100644
index 38e742fd0df7..000000000000
--- a/Documentation/video4linux/README.cpia2
+++ /dev/null
@@ -1,130 +0,0 @@
1$Id: README,v 1.7 2005/08/29 23:39:57 sbertin Exp $
2
31. Introduction
4
5 This is a driver for STMicroelectronics's CPiA2 (second generation
6Colour Processor Interface ASIC) based cameras. This camera outputs an MJPEG
7stream at up to vga size. It implements the Video4Linux interface as much as
8possible. Since the V4L interface does not support compressed formats, only
9an mjpeg enabled application can be used with the camera. We have modified the
10gqcam application to view this stream.
11
12 The driver is implemented as two kernel modules. The cpia2 module
13contains the camera functions and the V4L interface. The cpia2_usb module
14contains usb specific functions. The main reason for this was the size of the
15module was getting out of hand, so I separated them. It is not likely that
16there will be a parallel port version.
17
18FEATURES:
19 - Supports cameras with the Vision stv6410 (CIF) and stv6500 (VGA) cmos
20 sensors. I only have the vga sensor, so can't test the other.
21 - Image formats: VGA, QVGA, CIF, QCIF, and a number of sizes in between.
22 VGA and QVGA are the native image sizes for the VGA camera. CIF is done
23 in the coprocessor by scaling QVGA. All other sizes are done by clipping.
24 - Palette: YCrCb, compressed with MJPEG.
25 - Some compression parameters are settable.
26 - Sensor framerate is adjustable (up to 30 fps CIF, 15 fps VGA).
27 - Adjust brightness, color, contrast while streaming.
28 - Flicker control settable for 50 or 60 Hz mains frequency.
29
302. Making and installing the stv672 driver modules:
31
32 Requirements:
33 -------------
34 This should work with 2.4 (2.4.23 and later) and 2.6 kernels, but has
35only been tested on 2.6. Video4Linux must be either compiled into the kernel or
36available as a module. Video4Linux2 is automatically detected and made
37available at compile time.
38
39 Compiling:
40 ----------
41 As root, do a make install. This will compile and install the modules
42into the media/video directory in the module tree. For 2.4 kernels, use
43Makefile_2.4 (aka do make -f Makefile_2.4 install).
44
45 Setup:
46 ------
47 Use 'modprobe cpia2' to load and 'modprobe -r cpia2' to unload. This
48may be done automatically by your distribution.
49
503. Driver options
51
52 Option Description
53 ------ -----------
54 video_nr video device to register (0=/dev/video0, etc)
55 range -1 to 64. default is -1 (first available)
56 If you have more than 1 camera, this MUST be -1.
57 buffer_size Size for each frame buffer in bytes (default 68k)
58 num_buffers Number of frame buffers (1-32, default 3)
59 alternate USB Alternate (2-7, default 7)
60 flicker_freq Frequency for flicker reduction(50 or 60, default 60)
61 flicker_mode 0 to disable, or 1 to enable flicker reduction.
62 (default 0). This is only effective if the camera
63 uses a stv0672 coprocessor.
64
65 Setting the options:
66 --------------------
67 If you are using modules, edit /etc/modules.conf and add an options
68line like this:
69 options cpia2 num_buffers=3 buffer_size=65535
70
71 If the driver is compiled into the kernel, at boot time specify them
72like this:
73 cpia2.num_buffers=3 cpia2.buffer_size=65535
74
75 What buffer size should I use?
76 ------------------------------
77 The maximum image size depends on the alternate you choose, and the
78frame rate achieved by the camera. If the compression engine is able to
79keep up with the frame rate, the maximum image size is given by the table
80below.
81 The compression engine starts out at maximum compression, and will
82increase image quality until it is close to the size in the table. As long
83as the compression engine can keep up with the frame rate, after a short time
84the images will all be about the size in the table, regardless of resolution.
85 At low alternate settings, the compression engine may not be able to
86compress the image enough and will reduce the frame rate by producing larger
87images.
88 The default of 68k should be good for most users. This will handle
89any alternate at frame rates down to 15fps. For lower frame rates, it may
90be necessary to increase the buffer size to avoid having frames dropped due
91to insufficient space.
92
93 Image size(bytes)
94 Alternate bytes/ms 15fps 30fps
95 2 128 8533 4267
96 3 384 25600 12800
97 4 640 42667 21333
98 5 768 51200 25600
99 6 896 59733 29867
100 7 1023 68200 34100
101
102 How many buffers should I use?
103 ------------------------------
104 For normal streaming, 3 should give the best results. With only 2,
105it is possible for the camera to finish sending one image just after a
106program has started reading the other. If this happens, the driver must drop
107a frame. The exception to this is if you have a heavily loaded machine. In
108this case use 2 buffers. You are probably not reading at the full frame rate.
109If the camera can send multiple images before a read finishes, it could
110overwrite the third buffer before the read finishes, leading to a corrupt
111image. Single and double buffering have extra checks to avoid overwriting.
112
1134. Using the camera
114
115 We are providing a modified gqcam application to view the output. In
116order to avoid confusion, here it is called mview. There is also the qx5view
117program which can also control the lights on the qx5 microscope. MJPEG Tools
118(http://mjpeg.sourceforge.net) can also be used to record from the camera.
119
1205. Notes to developers:
121
122 - This is a driver version stripped of the 2.4 back compatibility
123 and old MJPEG ioctl API. See cpia2.sf.net for 2.4 support.
124
1256. Thanks:
126
127 - Peter Pregler <Peter_Pregler@email.com>,
128 Scott J. Bertin <scottbertin@yahoo.com>, and
129 Jarl Totland <Jarl.Totland@bdc.no> for the original cpia driver, which
130 this one was modelled from.
diff --git a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88
deleted file mode 100644
index b09ce36b921e..000000000000
--- a/Documentation/video4linux/README.cx88
+++ /dev/null
@@ -1,67 +0,0 @@
1cx8800 release notes
2====================
3
4This is a v4l2 device driver for the cx2388x chip.
5
6
7current status
8==============
9
10video
11 - Basically works.
12 - For now, only capture and read(). Overlay isn't supported.
13
14audio
15 - The chip specs for the on-chip TV sound decoder are next
16 to useless :-/
17 - Neverless the builtin TV sound decoder starts working now,
18 at least for some standards.
19 FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE
20 USING.
21 - Most tuner chips do provide mono sound, which may or may not
22 be useable depending on the board design. With the Hauppauge
23 cards it works, so there is mono sound available as fallback.
24 - audio data dma (i.e. recording without loopback cable to the
25 sound card) is supported via cx88-alsa.
26
27vbi
28 - Code present. Works for NTSC closed caption. PAL and other
29 TV norms may or may not work.
30
31
32how to add support for new cards
33================================
34
35The driver needs some config info for the TV cards. This stuff is in
36cx88-cards.c. If the driver doesn't work well you likely need a new
37entry for your card in that file. Check the kernel log (using dmesg)
38to see whenever the driver knows your card or not. There is a line
39like this one:
40
41 cx8800[0]: subsystem: 0070:3400, board: Hauppauge WinTV \
42 34xxx models [card=1,autodetected]
43
44If your card is listed as "board: UNKNOWN/GENERIC" it is unknown to
45the driver. What to do then?
46
47 (1) Try upgrading to the latest snapshot, maybe it has been added
48 meanwhile.
49 (2) You can try to create a new entry yourself, have a look at
50 cx88-cards.c. If that worked, mail me your changes as unified
51 diff ("diff -u").
52 (3) Or you can mail me the config information. I need at least the
53 following information to add the card:
54
55 * the PCI Subsystem ID ("0070:3400" from the line above,
56 "lspci -v" output is fine too).
57 * the tuner type used by the card. You can try to find one by
58 trial-and-error using the tuner=<n> insmod option. If you
59 know which one the card has you can also have a look at the
60 list in CARDLIST.tuner
61
62Have fun,
63
64 Gerd
65
66--
67Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff --git a/Documentation/video4linux/README.ir b/Documentation/video4linux/README.ir
deleted file mode 100644
index 0da47a847056..000000000000
--- a/Documentation/video4linux/README.ir
+++ /dev/null
@@ -1,72 +0,0 @@
1
2infrared remote control support in video4linux drivers
3======================================================
4
5
6basics
7------
8
9Current versions use the linux input layer to support infrared
10remote controls. I suggest to download my input layer tools
11from http://bytesex.org/snapshot/input-<date>.tar.gz
12
13Modules you have to load:
14
15 saa7134 statically built in, i.e. just the driver :)
16 bttv ir-kbd-gpio or ir-kbd-i2c depending on your
17 card.
18
19ir-kbd-gpio and ir-kbd-i2c don't support all cards lirc supports
20(yet), mainly for the reason that the code of lirc_i2c and lirc_gpio
21was very confusing and I decided to basically start over from scratch.
22Feel free to contact me in case of trouble. Note that the ir-kbd-*
23modules work on 2.6.x kernels only through ...
24
25
26how it works
27------------
28
29The modules register the remote as keyboard within the linux input
30layer, i.e. you'll see the keys of the remote as normal key strokes
31(if CONFIG_INPUT_KEYBOARD is enabled).
32
33Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
34applications to access the remote via /dev/input/event<n> devices.
35You might have to create the special files using "/sbin/MAKEDEV
36input". The input layer tools mentioned above use the event device.
37
38The input layer tools are nice for trouble shooting, i.e. to check
39whenever the input device is really present, which of the devices it
40is, check whenever pressing keys on the remote actually generates
41events and the like. You can also use the kbd utility to change the
42keymaps (2.6.x kernels only through).
43
44
45using with lircd
46================
47
48The cvs version of the lircd daemon supports reading events from the
49linux input layer (via event device). The input layer tools tarball
50comes with a lircd config file.
51
52
53using without lircd
54===================
55
56XFree86 likely can be configured to recognise the remote keys. Once I
57simply tried to configure one of the multimedia keyboards as input
58device, which had the effect that XFree86 recognised some of the keys
59of my remote control and passed volume up/down key presses as
60XF86AudioRaiseVolume and XF86AudioLowerVolume key events to the X11
61clients.
62
63It likely is possible to make that fly with a nice xkb config file,
64I know next to nothing about that through.
65
66
67Have fun,
68
69 Gerd
70
71--
72Gerd Knorr <kraxel@bytesex.org>
diff --git a/Documentation/video4linux/README.ivtv b/Documentation/video4linux/README.ivtv
deleted file mode 100644
index 2579b5b709ed..000000000000
--- a/Documentation/video4linux/README.ivtv
+++ /dev/null
@@ -1,186 +0,0 @@
1
2ivtv release notes
3==================
4
5This is a v4l2 device driver for the Conexant cx23415/6 MPEG encoder/decoder.
6The cx23415 can do both encoding and decoding, the cx23416 can only do MPEG
7encoding. Currently the only card featuring full decoding support is the
8Hauppauge PVR-350.
9
10NOTE: this driver requires the latest encoder firmware (version 2.06.039, size
11376836 bytes). Get the firmware from here:
12
13http://dl.ivtvdriver.org/ivtv/firmware/
14
15NOTE: 'normal' TV applications do not work with this driver, you need
16an application that can handle MPEG input such as mplayer, xine, MythTV,
17etc.
18
19The primary goal of the IVTV project is to provide a "clean room" Linux
20Open Source driver implementation for video capture cards based on the
21iCompression iTVC15 or Conexant CX23415/CX23416 MPEG Codec.
22
23Features:
24 * Hardware mpeg2 capture of broadcast video (and sound) via the tuner or
25 S-Video/Composite and audio line-in.
26 * Hardware mpeg2 capture of FM radio where hardware support exists
27 * Supports NTSC, PAL, SECAM with stereo sound
28 * Supports SAP and bilingual transmissions.
29 * Supports raw VBI (closed captions and teletext).
30 * Supports sliced VBI (closed captions and teletext) and is able to insert
31 this into the captured MPEG stream.
32 * Supports raw YUV and PCM input.
33
34Additional features for the PVR-350 (CX23415 based):
35 * Provides hardware mpeg2 playback
36 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the
37 video signal)
38 * Provides a framebuffer (allowing X applications to appear on the video
39 device)
40 * Supports raw YUV output.
41
42IMPORTANT: In case of problems first read this page:
43 http://www.ivtvdriver.org/index.php/Troubleshooting
44
45See also:
46
47Homepage + Wiki
48http://www.ivtvdriver.org
49
50IRC
51irc://irc.freenode.net/ivtv-dev
52
53----------------------------------------------------------
54
55Devices
56=======
57
58A maximum of 12 ivtv boards are allowed at the moment.
59
60Cards that don't have a video output capability (i.e. non PVR350 cards)
61lack the vbi8, vbi16, video16 and video48 devices. They also do not
62support the framebuffer device /dev/fbx for OSD.
63
64The radio0 device may or may not be present, depending on whether the
65card has a radio tuner or not.
66
67Here is a list of the base v4l devices:
68crw-rw---- 1 root video 81, 0 Jun 19 22:22 /dev/video0
69crw-rw---- 1 root video 81, 16 Jun 19 22:22 /dev/video16
70crw-rw---- 1 root video 81, 24 Jun 19 22:22 /dev/video24
71crw-rw---- 1 root video 81, 32 Jun 19 22:22 /dev/video32
72crw-rw---- 1 root video 81, 48 Jun 19 22:22 /dev/video48
73crw-rw---- 1 root video 81, 64 Jun 19 22:22 /dev/radio0
74crw-rw---- 1 root video 81, 224 Jun 19 22:22 /dev/vbi0
75crw-rw---- 1 root video 81, 228 Jun 19 22:22 /dev/vbi8
76crw-rw---- 1 root video 81, 232 Jun 19 22:22 /dev/vbi16
77
78Base devices
79============
80
81For every extra card you have the numbers increased by one. For example,
82/dev/video0 is listed as the 'base' encoding capture device so we have:
83
84 /dev/video0 is the encoding capture device for the first card (card 0)
85 /dev/video1 is the encoding capture device for the second card (card 1)
86 /dev/video2 is the encoding capture device for the third card (card 2)
87
88Note that if the first card doesn't have a feature (eg no decoder, so no
89video16, the second card will still use video17. The simple rule is 'add
90the card number to the base device number'. If you have other capture
91cards (e.g. WinTV PCI) that are detected first, then you have to tell
92the ivtv module about it so that it will start counting at 1 (or 2, or
93whatever). Otherwise the device numbers can get confusing. The ivtv
94'ivtv_first_minor' module option can be used for that.
95
96
97/dev/video0
98The encoding capture device(s).
99Read-only.
100
101Reading from this device gets you the MPEG1/2 program stream.
102Example:
103
104cat /dev/video0 > my.mpg (you need to hit ctrl-c to exit)
105
106
107/dev/video16
108The decoder output device(s)
109Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
110
111An mpeg2 stream sent to this device will appear on the selected video
112display, audio will appear on the line-out/audio out. It is only
113available for cards that support video out. Example:
114
115cat my.mpg >/dev/video16
116
117
118/dev/video24
119The raw audio capture device(s).
120Read-only
121
122The raw audio PCM stereo stream from the currently selected
123tuner or audio line-in. Reading from this device results in a raw
124(signed 16 bit Little Endian, 48000 Hz, stereo pcm) capture.
125This device only captures audio. This should be replaced by an ALSA
126device in the future.
127Note that there is no corresponding raw audio output device, this is
128not supported in the decoder firmware.
129
130
131/dev/video32
132The raw video capture device(s)
133Read-only
134
135The raw YUV video output from the current video input. The YUV format
136is non-standard (V4L2_PIX_FMT_HM12).
137
138Note that the YUV and PCM streams are not synchronized, so they are of
139limited use.
140
141
142/dev/video48
143The raw video display device(s)
144Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
145
146Writes a YUV stream to the decoder of the card.
147
148
149/dev/radio0
150The radio tuner device(s)
151Cannot be read or written.
152
153Used to enable the radio tuner and tune to a frequency. You cannot
154read or write audio streams with this device. Once you use this
155device to tune the radio, use /dev/video24 to read the raw pcm stream
156or /dev/video0 to get an mpeg2 stream with black video.
157
158
159/dev/vbi0
160The 'vertical blank interval' (Teletext, CC, WSS etc) capture device(s)
161Read-only
162
163Captures the raw (or sliced) video data sent during the Vertical Blank
164Interval. This data is used to encode teletext, closed captions, VPS,
165widescreen signalling, electronic program guide information, and other
166services.
167
168
169/dev/vbi8
170Processed vbi feedback device(s)
171Read-only. Only present if the MPEG decoder (i.e. CX23415) exists.
172
173The sliced VBI data embedded in an MPEG stream is reproduced on this
174device. So while playing back a recording on /dev/video16, you can
175read the embedded VBI data from /dev/vbi8.
176
177
178/dev/vbi16
179The vbi 'display' device(s)
180Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
181
182Can be used to send sliced VBI data to the video-out connector.
183
184---------------------------------
185
186Hans Verkuil <hverkuil@xs4all.nl>
diff --git a/Documentation/video4linux/README.saa7134 b/Documentation/video4linux/README.saa7134
deleted file mode 100644
index b911f0871874..000000000000
--- a/Documentation/video4linux/README.saa7134
+++ /dev/null
@@ -1,82 +0,0 @@
1
2
3What is it?
4===========
5
6This is a v4l2/oss device driver for saa7130/33/34/35 based capture / TV
7boards. See http://www.semiconductors.philips.com/pip/saa7134hl for a
8description.
9
10
11Status
12======
13
14Almost everything is working. video, sound, tuner, radio, mpeg ts, ...
15
16As with bttv, card-specific tweaks are needed. Check CARDLIST for a
17list of known TV cards and saa7134-cards.c for the drivers card
18configuration info.
19
20
21Build
22=====
23
24Pick up videodev + v4l2 patches from http://bytesex.org/patches/.
25Configure, build, install + boot the new kernel. You'll need at least
26these config options:
27
28 CONFIG_I2C=m
29 CONFIG_VIDEO_DEV=m
30
31Type "make" to build the driver now. "make install" installs the
32driver. "modprobe saa7134" should load it. Depending on the card you
33might have to pass card=<nr> as insmod option, check CARDLIST for
34valid choices.
35
36
37Changes / Fixes
38===============
39
40Please mail me unified diffs ("diff -u") with your changes, and don't
41forget to tell me what it changes / which problem it fixes / whatever
42it is good for ...
43
44
45Known Problems
46==============
47
48* The tuner for the flyvideos isn't detected automatically and the
49 default might not work for you depending on which version you have.
50 There is a tuner= insmod option to override the driver's default.
51
52Card Variations:
53================
54
55Cards can use either of these two crystals (xtal):
56 - 32.11 MHz -> .audio_clock=0x187de7
57 - 24.576MHz -> .audio_clock=0x200000
58(xtal * .audio_clock = 51539600)
59
60Some details about 30/34/35:
61
62 - saa7130 - low-price chip, doesn't have mute, that is why all those
63 cards should have .mute field defined in their tuner structure.
64
65 - saa7134 - usual chip
66
67 - saa7133/35 - saa7135 is probably a marketing decision, since all those
68 chips identifies itself as 33 on pci.
69
70Credits
71=======
72
73andrew.stevens@philips.com + werner.leeb@philips.com for providing
74saa7134 hardware specs and sample board.
75
76
77Have fun,
78
79 Gerd
80
81--
82Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff --git a/Documentation/video4linux/bttv/CONTRIBUTORS b/Documentation/video4linux/bttv/CONTRIBUTORS
deleted file mode 100644
index eb41b2650860..000000000000
--- a/Documentation/video4linux/bttv/CONTRIBUTORS
+++ /dev/null
@@ -1,25 +0,0 @@
1Contributors to bttv:
2
3Michael Chu <mmchu@pobox.com>
4 AverMedia fix and more flexible card recognition
5
6Alan Cox <alan@lxorguk.ukuu.org.uk>
7 Video4Linux interface and 2.1.x kernel adaptation
8
9Chris Kleitsch
10 Hardware I2C
11
12Gerd Knorr <kraxel@cs.tu-berlin.de>
13 Radio card (ITT sound processor)
14
15bigfoot <bigfoot@net-way.net>
16Ragnar Hojland Espinosa <ragnar@macula.net>
17 ConferenceTV card
18
19
20+ many more (please mail me if you are missing in this list and would
21 like to be mentioned)
22
23
24
25
diff --git a/Documentation/video4linux/bttv/Cards b/Documentation/video4linux/bttv/Cards
deleted file mode 100644
index a8fb6e2d3c8b..000000000000
--- a/Documentation/video4linux/bttv/Cards
+++ /dev/null
@@ -1,960 +0,0 @@
1
2Gunther Mayer's bttv card gallery (graphical version of this text file :-)
3is available at: http://www.bttv-gallery.de/
4
5
6Supported cards:
7Bt848/Bt848a/Bt849/Bt878/Bt879 cards
8------------------------------------
9
10All cards with Bt848/Bt848a/Bt849/Bt878/Bt879 and normal
11Composite/S-VHS inputs are supported. Teletext and Intercast support
12(PAL only) for ALL cards via VBI sample decoding in software.
13
14Some cards with additional multiplexing of inputs or other additional
15fancy chips are only partially supported (unless specifications by the
16card manufacturer are given). When a card is listed here it isn't
17necessarily fully supported.
18
19All other cards only differ by additional components as tuners, sound
20decoders, EEPROMs, teletext decoders ...
21
22
23Unsupported Cards:
24------------------
25
26Cards with Zoran (ZR) or Philips (SAA) or ISA are not supported by
27this driver.
28
29
30MATRIX Vision
31-------------
32
33MV-Delta
34- Bt848A
35- 4 Composite inputs, 1 S-VHS input (shared with 4th composite)
36- EEPROM
37
38http://www.matrix-vision.de/
39
40This card has no tuner but supports all 4 composite (1 shared with an
41S-VHS input) of the Bt848A.
42Very nice card if you only have satellite TV but several tuners connected
43to the card via composite.
44
45Many thanks to Matrix-Vision for giving us 2 cards for free which made
46Bt848a/Bt849 single crystal operation support possible!!!
47
48
49
50Miro/Pinnacle PCTV
51------------------
52
53- Bt848
54 some (all??) come with 2 crystals for PAL/SECAM and NTSC
55- PAL, SECAM or NTSC TV tuner (Philips or TEMIC)
56- MSP34xx sound decoder on add on board
57 decoder is supported but AFAIK does not yet work
58 (other sound MUX setting in GPIO port needed??? somebody who fixed this???)
59- 1 tuner, 1 composite and 1 S-VHS input
60- tuner type is autodetected
61
62http://www.miro.de/
63http://www.miro.com/
64
65
66Many thanks for the free card which made first NTSC support possible back
67in 1997!
68
69
70Hauppauge Win/TV pci
71--------------------
72
73There are many different versions of the Hauppauge cards with different
74tuners (TV+Radio ...), teletext decoders.
75Note that even cards with same model numbers have (depending on the revision)
76different chips on it.
77
78- Bt848 (and others but always in 2 crystal operation???)
79 newer cards have a Bt878
80- PAL, SECAM, NTSC or tuner with or without Radio support
81
82e.g.:
83 PAL:
84 TDA5737: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
85 TSA5522: 1.4 GHz I2C-bus controlled synthesizer, I2C 0xc2-0xc3
86
87 NTSC:
88 TDA5731: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
89 TSA5518: no datasheet available on Philips site
90- Philips SAA5246 or SAA5284 ( or no) Teletext decoder chip
91 with buffer RAM (e.g. Winbond W24257AS-35: 32Kx8 CMOS static RAM)
92 SAA5246 (I2C 0x22) is supported
93- 256 bytes EEPROM: Microchip 24LC02B or Philips 8582E2Y
94 with configuration information
95 I2C address 0xa0 (24LC02B also responds to 0xa2-0xaf)
96- 1 tuner, 1 composite and (depending on model) 1 S-VHS input
97- 14052B: mux for selection of sound source
98- sound decoder: TDA9800, MSP34xx (stereo cards)
99
100
101Askey CPH-Series
102----------------
103Developed by TelSignal(?), OEMed by many vendors (Typhoon, Anubis, Dynalink)
104
105 Card series:
106 CPH01x: BT848 capture only
107 CPH03x: BT848
108 CPH05x: BT878 with FM
109 CPH06x: BT878 (w/o FM)
110 CPH07x: BT878 capture only
111
112 TV standards:
113 CPH0x0: NTSC-M/M
114 CPH0x1: PAL-B/G
115 CPH0x2: PAL-I/I
116 CPH0x3: PAL-D/K
117 CPH0x4: SECAM-L/L
118 CPH0x5: SECAM-B/G
119 CPH0x6: SECAM-D/K
120 CPH0x7: PAL-N/N
121 CPH0x8: PAL-B/H
122 CPH0x9: PAL-M/M
123
124 CPH03x was often sold as "TV capturer".
125
126 Identifying:
127 1) 878 cards can be identified by PCI Subsystem-ID:
128 144f:3000 = CPH06x
129 144F:3002 = CPH05x w/ FM
130 144F:3005 = CPH06x_LC (w/o remote control)
131 1) The cards have a sticker with "CPH"-model on the back.
132 2) These cards have a number printed on the PCB just above the tuner metal box:
133 "80-CP2000300-x" = CPH03X
134 "80-CP2000500-x" = CPH05X
135 "80-CP2000600-x" = CPH06X / CPH06x_LC
136
137 Askey sells these cards as "Magic TView series", Brand "MagicXpress".
138 Other OEM often call these "Tview", "TView99" or else.
139
140Lifeview Flyvideo Series:
141-------------------------
142 The naming of these series differs in time and space.
143
144 Identifying:
145 1) Some models can be identified by PCI subsystem ID:
146 1852:1852 = Flyvideo 98 FM
147 1851:1850 = Flyvideo 98
148 1851:1851 = Flyvideo 98 EZ (capture only)
149 2) There is a print on the PCB:
150 LR25 = Flyvideo (Zoran ZR36120, SAA7110A)
151 LR26 Rev.N = Flyvideo II (Bt848)
152 Rev.O = Flyvideo II (Bt878)
153 LR37 Rev.C = Flyvideo EZ (Capture only, ZR36120 + SAA7110)
154 LR38 Rev.A1= Flyvideo II EZ (Bt848 capture only)
155 LR50 Rev.Q = Flyvideo 98 (w/eeprom and PCI subsystem ID)
156 Rev.W = Flyvideo 98 (no eeprom)
157 LR51 Rev.E = Flyvideo 98 EZ (capture only)
158 LR90 = Flyvideo 2000 (Bt878)
159 Flyvideo 2000S (Bt878) w/Stereo TV (Package incl. LR91 daughterboard)
160 LR91 = Stereo daughter card for LR90
161 LR97 = Flyvideo DVBS
162 LR99 Rev.E = Low profile card for OEM integration (only internal audio!) bt878
163 LR136 = Flyvideo 2100/3100 (Low profile, SAA7130/SAA7134)
164 LR137 = Flyvideo DV2000/DV3000 (SAA7130/SAA7134 + IEEE1394)
165 LR138 Rev.C= Flyvideo 2000 (SAA7130)
166 or Flyvideo 3000 (SAA7134) w/Stereo TV
167 These exist in variations w/FM and w/Remote sometimes denoted
168 by suffixes "FM" and "R".
169 3) You have a laptop (miniPCI card):
170 Product = FlyTV Platinum Mini
171 Model/Chip = LR212/saa7135
172
173 Lifeview.com.tw states (Feb. 2002):
174 "The FlyVideo2000 and FlyVideo2000s product name have renamed to FlyVideo98."
175 Their Bt8x8 cards are listed as discontinued.
176 Flyvideo 2000S was probably sold as Flyvideo 3000 in some contries(Europe?).
177 The new Flyvideo 2000/3000 are SAA7130/SAA7134 based.
178
179 "Flyvideo II" had been the name for the 848 cards, nowadays (in Germany)
180 this name is re-used for LR50 Rev.W.
181 The Lifeview website mentioned Flyvideo III at some time, but such a card
182 has not yet been seen (perhaps it was the german name for LR90 [stereo]).
183 These cards are sold by many OEMs too.
184
185 FlyVideo A2 (Elta 8680)= LR90 Rev.F (w/Remote, w/o FM, stereo TV by tda9821) {Germany}
186 Lifeview 3000 (Elta 8681) as sold by Plus(April 2002), Germany = LR138 w/ saa7134
187
188
189Typhoon TV card series:
190-----------------------
191 These can be CPH, Flyvideo, Pixelview or KNC1 series.
192 Typhoon is the brand of Anubis.
193 Model 50680 got re-used, some model no. had different contents over time.
194
195 Models:
196 50680 "TV Tuner PCI Pal BG"(old,red package)=can be CPH03x(bt848) or CPH06x(bt878)
197 50680 "TV Tuner Pal BG" (blue package)= Pixelview PV-BT878P+ (Rev 9B)
198 50681 "TV Tuner PCI Pal I" (variant of 50680)
199 50682 "TView TV/FM Tuner Pal BG" = Flyvideo 98FM (LR50 Rev.Q)
200 Note: The package has a picture of CPH05x (which would be a real TView)
201 50683 "TV Tuner PCI SECAM" (variant of 50680)
202 50684 "TV Tuner Pal BG" = Pixelview 878TV(Rev.3D)
203 50686 "TV Tuner" = KNC1 TV Station
204 50687 "TV Tuner stereo" = KNC1 TV Station pro
205 50688 "TV Tuner RDS" (black package) = KNC1 TV Station RDS
206 50689 TV SAT DVB-S CARD CI PCI (SAA7146AH, SU1278?) = "KNC1 TV Station DVB-S"
207 50692 "TV/FM Tuner" (small PCB)
208 50694 TV TUNER CARD RDS (PHILIPS CHIPSET SAA7134HL)
209 50696 TV TUNER STEREO (PHILIPS CHIPSET SAA7134HL, MK3ME Tuner)
210 50804 PC-SAT TV/Audio Karte = Techni-PC-Sat (ZORAN 36120PQC, Tuner:Alps)
211 50866 TVIEW SAT RECEIVER+ADR
212 50868 "TV/FM Tuner Pal I" (variant of 50682)
213 50999 "TV/FM Tuner Secam" (variant of 50682)
214
215
216Guillemot
217---------
218 Maxi-TV PCI (ZR36120)
219 Maxi TV Video 2 = LR50 Rev.Q (FI1216MF, PAL BG+SECAM)
220 Maxi TV Video 3 = CPH064 (PAL BG + SECAM)
221
222Mentor
223------
224 Mentor TV card ("55-878TV-U1") = Pixelview 878TV(Rev.3F) (w/FM w/Remote)
225
226Prolink
227-------
228 TV cards:
229 PixelView Play TV pro - (Model: PV-BT878P+ REV 8E)
230 PixelView Play TV pro - (Model: PV-BT878P+ REV 9D)
231 PixelView Play TV pro - (Model: PV-BT878P+ REV 4C / 8D / 10A )
232 PixelView Play TV - (Model: PV-BT848P+)
233 878TV - (Model: PV-BT878TV)
234
235 Multimedia TV packages (card + software pack):
236 PixelView Play TV Theater - (Model: PV-M4200) = PixelView Play TV pro + Software
237 PixelView Play TV PAK - (Model: PV-BT878P+ REV 4E)
238 PixelView Play TV/VCR - (Model: PV-M3200 REV 4C / 8D / 10A )
239 PixelView Studio PAK - (Model: M2200 REV 4C / 8D / 10A )
240 PixelView PowerStudio PAK - (Model: PV-M3600 REV 4E)
241 PixelView DigitalVCR PAK - (Model: PV-M2400 REV 4C / 8D / 10A )
242
243 PixelView PlayTV PAK II (TV/FM card + usb camera) PV-M3800
244 PixelView PlayTV XP PV-M4700,PV-M4700(w/FM)
245 PixelView PlayTV DVR PV-M4600 package contents:PixelView PlayTV pro, windvr & videoMail s/w
246
247 Further Cards:
248 PV-BT878P+rev.9B (Play TV Pro, opt. w/FM w/NICAM)
249 PV-BT878P+rev.2F
250 PV-BT878P Rev.1D (bt878, capture only)
251
252 XCapture PV-CX881P (cx23881)
253 PlayTV HD PV-CX881PL+, PV-CX881PL+(w/FM) (cx23881)
254
255 DTV3000 PV-DTV3000P+ DVB-S CI = Twinhan VP-1030
256 DTV2000 DVB-S = Twinhan VP-1020
257
258 Video Conferencing:
259 PixelView Meeting PAK - (Model: PV-BT878P)
260 PixelView Meeting PAK Lite - (Model: PV-BT878P)
261 PixelView Meeting PAK plus - (Model: PV-BT878P+rev 4C/8D/10A)
262 PixelView Capture - (Model: PV-BT848P)
263
264 PixelView PlayTV USB pro
265 Model No. PV-NT1004+, PV-NT1004+ (w/FM) = NT1004 USB decoder chip + SAA7113 video decoder chip
266
267Dynalink
268--------
269 These are CPH series.
270
271Phoebemicro
272-----------
273 TV Master = CPH030 or CPH060
274 TV Master FM = CPH050
275
276Genius/Kye
277----------
278 Video Wonder/Genius Internet Video Kit = LR37 Rev.C
279 Video Wonder Pro II (848 or 878) = LR26
280
281Tekram
282------
283 VideoCap C205 (Bt848)
284 VideoCap C210 (zr36120 +Philips)
285 CaptureTV M200 (ISA)
286 CaptureTV M205 (Bt848)
287
288Lucky Star
289----------
290 Image World Conference TV = LR50 Rev. Q
291
292Leadtek
293-------
294 WinView 601 (Bt848)
295 WinView 610 (Zoran)
296 WinFast2000
297 WinFast2000 XP
298
299KNC One
300-------
301 TV-Station
302 TV-Station SE (+Software Bundle)
303 TV-Station pro (+TV stereo)
304 TV-Station FM (+Radio)
305 TV-Station RDS (+RDS)
306 TV Station SAT (analog satellite)
307 TV-Station DVB-S
308
309 newer Cards have saa7134, but model name stayed the same?
310
311Provideo
312--------
313 PV951 or PV-951 (also are sold as:
314 Boeder TV-FM Video Capture Card
315 Titanmedia Supervision TV-2400
316 Provideo PV951 TF
317 3DeMon PV951
318 MediaForte TV-Vision PV951
319 Yoko PV951
320 Vivanco Tuner Card PCI Art.-Nr.: 68404
321 ) now named PV-951T
322
323 Surveillance Series
324 PV-141
325 PV-143
326 PV-147
327 PV-148 (capture only)
328 PV-150
329 PV-151
330
331 TV-FM Tuner Series
332 PV-951TDV (tv tuner + 1394)
333 PV-951T/TF
334 PV-951PT/TF
335 PV-956T/TF Low Profile
336 PV-911
337
338Highscreen
339----------
340 TV Karte = LR50 Rev.S
341 TV-Boostar = Terratec Terra TV+ Version 1.0 (Bt848, tda9821) "ceb105.pcb"
342
343Zoltrix
344-------
345 Face to Face Capture (Bt848 capture only) (PCB "VP-2848")
346 Face To Face TV MAX (Bt848) (PCB "VP-8482 Rev1.3")
347 Genie TV (Bt878) (PCB "VP-8790 Rev 2.1")
348 Genie Wonder Pro
349
350AVerMedia
351---------
352 AVer FunTV Lite (ISA, AV3001 chipset) "M101.C"
353 AVerTV
354 AVerTV Stereo
355 AVerTV Studio (w/FM)
356 AVerMedia TV98 with Remote
357 AVerMedia TV/FM98 Stereo
358 AVerMedia TVCAM98
359 TVCapture (Bt848)
360 TVPhone (Bt848)
361 TVCapture98 (="AVerMedia TV98" in USA) (Bt878)
362 TVPhone98 (Bt878, w/FM)
363
364 PCB PCI-ID Model-Name Eeprom Tuner Sound Country
365 --------------------------------------------------------------------
366 M101.C ISA !
367 M108-B Bt848 -- FR1236 US (2),(3)
368 M1A8-A Bt848 AVer TV-Phone FM1216 --
369 M168-T 1461:0003 AVerTV Studio 48:17 FM1216 TDA9840T D (1) w/FM w/Remote
370 M168-U 1461:0004 TVCapture98 40:11 FI1216 -- D w/Remote
371 M168II-B 1461:0003 Medion MD9592 48:16 FM1216 TDA9873H D w/FM
372
373 (1) Daughterboard MB68-A with TDA9820T and TDA9840T
374 (2) Sony NE41S soldered (stereo sound?)
375 (3) Daughterboard M118-A w/ pic 16c54 and 4 MHz quartz
376
377 US site has different drivers for (as of 09/2002):
378 EZ Capture/InterCam PCI (BT-848 chip)
379 EZ Capture/InterCam PCI (BT-878 chip)
380 TV-Phone (BT-848 chip)
381 TV98 (BT-848 chip)
382 TV98 With Remote (BT-848 chip)
383 TV98 (BT-878 chip)
384 TV98 With Remote (BT-878)
385 TV/FM98 (BT-878 chip)
386 AVerTV
387 AverTV Stereo
388 AVerTV Studio
389
390 DE hat diverse Treiber fuer diese Modelle (Stand 09/2002):
391 TVPhone (848) mit Philips tuner FR12X6 (w/ FM radio)
392 TVPhone (848) mit Philips tuner FM12X6 (w/ FM radio)
393 TVCapture (848) w/Philips tuner FI12X6
394 TVCapture (848) non-Philips tuner
395 TVCapture98 (Bt878)
396 TVPhone98 (Bt878)
397 AVerTV und TVCapture98 w/VCR (Bt 878)
398 AVerTVStudio und TVPhone98 w/VCR (Bt878)
399 AVerTV GO Serie (Kein SVideo Input)
400 AVerTV98 (BT-878 chip)
401 AVerTV98 mit Fernbedienung (BT-878 chip)
402 AVerTV/FM98 (BT-878 chip)
403
404 VDOmate (www.averm.com.cn) = M168U ?
405
406Aimslab
407-------
408 Video Highway or "Video Highway TR200" (ISA)
409 Video Highway Xtreme (aka "VHX") (Bt848, FM w/ TEA5757)
410
411IXMicro (former: IMS=Integrated Micro Solutions)
412-------
413 IXTV BT848 (=TurboTV)
414 IXTV BT878
415 IMS TurboTV (Bt848)
416
417Lifetec/Medion/Tevion/Aldi
418--------------------------
419 LT9306/MD9306 = CPH061
420 LT9415/MD9415 = LR90 Rev.F or Rev.G
421 MD9592 = Avermedia TVphone98 (PCI_ID=1461:0003), PCB-Rev=M168II-B (w/TDA9873H)
422 MD9717 = KNC One (Rev D4, saa7134, FM1216 MK2 tuner)
423 MD5044 = KNC One (Rev D4, saa7134, FM1216ME MK3 tuner)
424
425Modular Technologies (www.modulartech.com) UK
426---------------------------------------------
427 MM100 PCTV (Bt848)
428 MM201 PCTV (Bt878, Bt832) w/ Quartzsight camera
429 MM202 PCTV (Bt878, Bt832, tda9874)
430 MM205 PCTV (Bt878)
431 MM210 PCTV (Bt878) (Galaxy TV, Galaxymedia ?)
432
433Terratec
434--------
435 Terra TV+ Version 1.0 (Bt848), "ceb105.PCB" printed on the PCB, TDA9821
436 Terra TV+ Version 1.1 (Bt878), "LR74 Rev.E" printed on the PCB, TDA9821
437 Terra TValueRadio, "LR102 Rev.C" printed on the PCB
438 Terra TV/Radio+ Version 1.0, "80-CP2830100-0" TTTV3 printed on the PCB,
439 "CPH010-E83" on the back, SAA6588T, TDA9873H
440 Terra TValue Version BT878, "80-CP2830110-0 TTTV4" printed on the PCB,
441 "CPH011-D83" on back
442 Terra TValue Version 1.0 "ceb105.PCB" (really identical to Terra TV+ Version 1.0)
443 Terra TValue New Revision "LR102 Rec.C"
444 Terra Active Radio Upgrade (tea5757h, saa6588t)
445
446 LR74 is a newer PCB revision of ceb105 (both incl. connector for Active Radio Upgrade)
447
448 Cinergy 400 (saa7134), "E877 11(S)", "PM820092D" printed on PCB
449 Cinergy 600 (saa7134)
450
451Technisat
452---------
453 Discos ADR PC-Karte ISA (no TV!)
454 Discos ADR PC-Karte PCI (probably no TV?)
455 Techni-PC-Sat (Sat. analog)
456 Rev 1.2 (zr36120, vpx3220, stv0030, saa5246, BSJE3-494A)
457 Mediafocus I (zr36120/zr36125, drp3510, Sat. analog + ADR Radio)
458 Mediafocus II (saa7146, Sat. analog)
459 SatADR Rev 2.1 (saa7146a, saa7113h, stv0056a, msp3400c, drp3510a, BSKE3-307A)
460 SkyStar 1 DVB (AV7110) = Technotrend Premium
461 SkyStar 2 DVB (B2C2) (=Sky2PC)
462
463Siemens
464-------
465 Multimedia eXtension Board (MXB) (SAA7146, SAA7111)
466
467Powercolor
468----------
469 MTV878
470 Package comes with different contents:
471 a) pcb "MTV878" (CARD=75)
472 b) Pixelview Rev. 4_
473 MTV878R w/Remote Control
474 MTV878F w/Remote Control w/FM radio
475
476Pinnacle
477--------
478 Mirovideo PCTV (Bt848)
479 Mirovideo PCTV SE (Bt848)
480 Mirovideo PCTV Pro (Bt848 + Daughterboard for TV Stereo and FM)
481 Studio PCTV Rave (Bt848 Version = Mirovideo PCTV)
482 Studio PCTV Rave (Bt878 package w/o infrared)
483 Studio PCTV (Bt878)
484 Studio PCTV Pro (Bt878 stereo w/ FM)
485 Pinnacle PCTV (Bt878, MT2032)
486 Pinnacle PCTV Pro (Bt878, MT2032)
487 Pinncale PCTV Sat (bt878a, HM1821/1221) ["Conexant CX24110 with CX24108 tuner, aka HM1221/HM1811"]
488 Pinnacle PCTV Sat XE
489
490 M(J)PEG capture and playback:
491 DC1+ (ISA)
492 DC10 (zr36057, zr36060, saa7110, adv7176)
493 DC10+ (zr36067, zr36060, saa7110, adv7176)
494 DC20 (ql16x24b,zr36050, zr36016, saa7110, saa7187 ...)
495 DC30 (zr36057, zr36050, zr36016, vpx3220, adv7176, ad1843, tea6415, miro FST97A1)
496 DC30+ (zr36067, zr36050, zr36016, vpx3220, adv7176)
497 DC50 (zr36067, zr36050, zr36016, saa7112, adv7176 (2 pcs.?), ad1843, miro FST97A1, Lattice ???)
498
499Lenco
500-----
501 MXR-9565 (=Technisat Mediafocus?)
502 MXR-9571 (Bt848) (=CPH031?)
503 MXR-9575
504 MXR-9577 (Bt878) (=Prolink 878TV Rev.3x)
505 MXTV-9578CP (Bt878) (= Prolink PV-BT878P+4E)
506
507Iomega
508------
509 Buz (zr36067, zr36060, saa7111, saa7185)
510
511LML
512---
513 LML33 (zr36067, zr36060, bt819, bt856)
514
515Grandtec
516--------
517 Grand Video Capture (Bt848)
518 Multi Capture Card (Bt878)
519
520Koutech
521-------
522 KW-606 (Bt848)
523 KW-607 (Bt848 capture only)
524 KW-606RSF
525 KW-607A (capture only)
526 KW-608 (Zoran capture only)
527
528IODATA (jp)
529------
530 GV-BCTV/PCI
531 GV-BCTV2/PCI
532 GV-BCTV3/PCI
533 GV-BCTV4/PCI
534 GV-VCP/PCI (capture only)
535 GV-VCP2/PCI (capture only)
536
537Canopus (jp)
538-------
539 WinDVR = Kworld "KW-TVL878RF"
540
541www.sigmacom.co.kr
542------------------
543 Sigma Cyber TV II
544
545www.sasem.co.kr
546---------------
547 Litte OnAir TV
548
549hama
550----
551 TV/Radio-Tuner Card, PCI (Model 44677) = CPH051
552
553Sigma Designs
554-------------
555 Hollywood plus (em8300, em9010, adv7175), (PCB "M340-10") MPEG DVD decoder
556
557Formac
558------
559 iProTV (Card for iMac Mezzanine slot, Bt848+SCSI)
560 ProTV (Bt848)
561 ProTV II = ProTV Stereo (Bt878) ["stereo" means FM stereo, tv is still mono]
562
563ATI
564---
565 TV-Wonder
566 TV-Wonder VE
567
568Diamond Multimedia
569------------------
570 DTV2000 (Bt848, tda9875)
571
572Aopen
573-----
574 VA1000 Plus (w/ Stereo)
575 VA1000 Lite
576 VA1000 (=LR90)
577
578Intel
579-----
580 Smart Video Recorder (ISA full-length)
581 Smart Video Recorder pro (ISA half-length)
582 Smart Video Recorder III (Bt848)
583
584STB
585---
586 STB Gateway 6000704 (bt878)
587 STB Gateway 6000699 (bt848)
588 STB Gateway 6000402 (bt848)
589 STB TV130 PCI
590
591Videologic
592----------
593 Captivator Pro/TV (ISA?)
594 Captivator PCI/VC (Bt848 bundled with camera) (capture only)
595
596Technotrend
597------------
598 TT-SAT PCI (PCB "Sat-PCI Rev.:1.3.1"; zr36125, vpx3225d, stc0056a, Tuner:BSKE6-155A
599 TT-DVB-Sat
600 revisions 1.1, 1.3, 1.5, 1.6 and 2.1
601 This card is sold as OEM from:
602 Siemens DVB-s Card
603 Hauppauge WinTV DVB-S
604 Technisat SkyStar 1 DVB
605 Galaxis DVB Sat
606 Now this card is called TT-PCline Premium Family
607 TT-Budget (saa7146, bsru6-701a)
608 This card is sold as OEM from:
609 Hauppauge WinTV Nova
610 Satelco Standard PCI (DVB-S)
611 TT-DVB-C PCI
612
613Teles
614-----
615 DVB-s (Rev. 2.2, BSRV2-301A, data only?)
616
617Remote Vision
618-------------
619 MX RV605 (Bt848 capture only)
620
621Boeder
622------
623 PC ChatCam (Model 68252) (Bt848 capture only)
624 Tv/Fm Capture Card (Model 68404) = PV951
625
626Media-Surfer (esc-kathrein.de)
627-------------------------------
628 Sat-Surfer (ISA)
629 Sat-Surfer PCI = Techni-PC-Sat
630 Cable-Surfer 1
631 Cable-Surfer 2
632 Cable-Surfer PCI (zr36120)
633 Audio-Surfer (ISA Radio card)
634
635Jetway (www.jetway.com.tw)
636--------------------------
637 JW-TV 878M
638 JW-TV 878 = KWorld KW-TV878RF
639
640Galaxis
641-------
642 Galaxis DVB Card S CI
643 Galaxis DVB Card C CI
644 Galaxis DVB Card S
645 Galaxis DVB Card C
646 Galaxis plug.in S [neuer Name: Galaxis DVB Card S CI
647
648Hauppauge
649---------
650 many many WinTV models ...
651 WinTV DVBs = Technotrend Premium 1.3
652 WinTV NOVA = Technotrend Budget 1.1 "S-DVB DATA"
653 WinTV NOVA-CI "SDVBACI"
654 WinTV Nova USB (=Technotrend USB 1.0)
655 WinTV-Nexus-s (=Technotrend Premium 2.1 or 2.2)
656 WinTV PVR
657 WinTV PVR 250
658 WinTV PVR 450
659
660 US models
661 990 WinTV-PVR-350 (249USD) (iTVC15 chipset + radio)
662 980 WinTV-PVR-250 (149USD) (iTVC15 chipset)
663 880 WinTV-PVR-PCI (199USD) (KFIR chipset + bt878)
664 881 WinTV-PVR-USB
665 190 WinTV-GO
666 191 WinTV-GO-FM
667 404 WinTV
668 401 WinTV-radio
669 495 WinTV-Theater
670 602 WinTV-USB
671 621 WinTV-USB-FM
672 600 USB-Live
673 698 WinTV-HD
674 697 WinTV-D
675 564 WinTV-Nexus-S
676
677 Deutsche Modelle
678 603 WinTV GO
679 719 WinTV Primio-FM
680 718 WinTV PCI-FM
681 497 WinTV Theater
682 569 WinTV USB
683 568 WinTV USB-FM
684 882 WinTV PVR
685 981 WinTV PVR 250
686 891 WinTV-PVR-USB
687 541 WinTV Nova
688 488 WinTV Nova-Ci
689 564 WinTV-Nexus-s
690 727 WinTV-DVB-c
691 545 Common Interface
692 898 WinTV-Nova-USB
693
694 UK models
695 607 WinTV Go
696 693,793 WinTV Primio FM
697 647,747 WinTV PCI FM
698 498 WinTV Theater
699 883 WinTV PVR
700 893 WinTV PVR USB (Duplicate entry)
701 566 WinTV USB (UK)
702 573 WinTV USB FM
703 429 Impact VCB (bt848)
704 600 USB Live (Video-In 1x Comp, 1xSVHS)
705 542 WinTV Nova
706 717 WinTV DVB-S
707 909 Nova-t PCI
708 893 Nova-t USB (Duplicate entry)
709 802 MyTV
710 804 MyView
711 809 MyVideo
712 872 MyTV2Go FM
713
714
715 546 WinTV Nova-S CI
716 543 WinTV Nova
717 907 Nova-S USB
718 908 Nova-T USB
719 717 WinTV Nexus-S
720 157 DEC3000-s Standalone + USB
721
722 Spain
723 685 WinTV-Go
724 690 WinTV-PrimioFM
725 416 WinTV-PCI Nicam Estereo
726 677 WinTV-PCI-FM
727 699 WinTV-Theater
728 683 WinTV-USB
729 678 WinTV-USB-FM
730 983 WinTV-PVR-250
731 883 WinTV-PVR-PCI
732 993 WinTV-PVR-350
733 893 WinTV-PVR-USB
734 728 WinTV-DVB-C PCI
735 832 MyTV2Go
736 869 MyTV2Go-FM
737 805 MyVideo (USB)
738
739
740Matrix-Vision
741-------------
742 MATRIX-Vision MV-Delta
743 MATRIX-Vision MV-Delta 2
744 MVsigma-SLC (Bt848)
745
746Conceptronic (.net)
747------------
748 TVCON FM, TV card w/ FM = CPH05x
749 TVCON = CPH06x
750
751BestData
752--------
753 HCC100 = VCC100rev1 + camera
754 VCC100 rev1 (bt848)
755 VCC100 rev2 (bt878)
756
757Gallant (www.gallantcom.com) www.minton.com.tw
758-----------------------------------------------
759 Intervision IV-510 (capture only bt8x8)
760 Intervision IV-550 (bt8x8)
761 Intervision IV-100 (zoran)
762 Intervision IV-1000 (bt8x8)
763
764Asonic (www.asonic.com.cn) (website down)
765-----------------------------------------
766 SkyEye tv 878
767
768Hoontech
769--------
770 878TV/FM
771
772Teppro (www.itcteppro.com.tw)
773-----------------------------
774 ITC PCITV (Card Ver 1.0) "Teppro TV1/TVFM1 Card"
775 ITC PCITV (Card Ver 2.0)
776 ITC PCITV (Card Ver 3.0) = "PV-BT878P+ (REV.9D)"
777 ITC PCITV (Card Ver 4.0)
778 TEPPRO IV-550 (For BT848 Main Chip)
779 ITC DSTTV (bt878, satellite)
780 ITC VideoMaker (saa7146, StreamMachine sm2110, tvtuner) "PV-SM2210P+ (REV:1C)"
781
782Kworld (www.kworld.com.tw)
783--------------------------
784 PC TV Station
785 KWORLD KW-TV878R TV (no radio)
786 KWORLD KW-TV878RF TV (w/ radio)
787
788 KWORLD KW-TVL878RF (low profile)
789
790 KWORLD KW-TV713XRF (saa7134)
791
792
793 MPEG TV Station (same cards as above plus WinDVR Software MPEG en/decoder)
794 KWORLD KW-TV878R -Pro TV (no Radio)
795 KWORLD KW-TV878RF-Pro TV (w/ Radio)
796 KWORLD KW-TV878R -Ultra TV (no Radio)
797 KWORLD KW-TV878RF-Ultra TV (w/ Radio)
798
799
800
801JTT/ Justy Corp.(http://www.jtt.ne.jp/)
802---------------------------------------------------------------------
803 JTT-02 (JTT TV) "TV watchmate pro" (bt848)
804
805ADS www.adstech.com
806-------------------
807 Channel Surfer TV ( CHX-950 )
808 Channel Surfer TV+FM ( CHX-960FM )
809
810AVEC www.prochips.com
811---------------------
812 AVEC Intercapture (bt848, tea6320)
813
814NoBrand
815-------
816 TV Excel = Australian Name for "PV-BT878P+ 8E" or "878TV Rev.3_"
817
818Mach www.machspeed.com
819----
820 Mach TV 878
821
822Eline www.eline-net.com/
823-----
824 Eline Vision TVMaster / TVMaster FM (ELV-TVM/ ELV-TVM-FM) = LR26 (bt878)
825 Eline Vision TVMaster-2000 (ELV-TVM-2000, ELV-TVM-2000-FM)= LR138 (saa713x)
826
827Spirit
828------
829 Spirit TV Tuner/Video Capture Card (bt848)
830
831Boser www.boser.com.tw
832-----
833 HS-878 Mini PCI Capture Add-on Card
834 HS-879 Mini PCI 3D Audio and Capture Add-on Card (w/ ES1938 Solo-1)
835
836Satelco www.citycom-gmbh.de, www.satelco.de
837-------
838 TV-FM =KNC1 saa7134
839 Standard PCI (DVB-S) = Technotrend Budget
840 Standard PCI (DVB-S) w/ CI
841 Satelco Highend PCI (DVB-S) = Technotrend Premium
842
843
844Sensoray www.sensoray.com
845--------
846 Sensoray 311 (PC/104 bus)
847 Sensoray 611 (PCI)
848
849CEI (Chartered Electronics Industries Pte Ltd [CEI] [FCC ID HBY])
850---
851 TV Tuner - HBY-33A-RAFFLES Brooktree Bt848KPF + Philips
852 TV Tuner MG9910 - HBY33A-TVO CEI + Philips SAA7110 + OKI M548262 + ST STV8438CV
853 Primetime TV (ISA)
854 acquired by Singapore Technologies
855 now operating as Chartered Semiconductor Manufacturing
856 Manufacturer of video cards is listed as:
857 Cogent Electronics Industries [CEI]
858
859AITech
860------
861 Wavewatcher TV (ISA)
862 AITech WaveWatcher TV-PCI = can be LR26 (Bt848) or LR50 (BT878)
863 WaveWatcher TVR-202 TV/FM Radio Card (ISA)
864
865MAXRON
866------
867 Maxron MaxTV/FM Radio (KW-TV878-FNT) = Kworld or JW-TV878-FBK
868
869www.ids-imaging.de
870------------------
871 Falcon Series (capture only)
872 In USA: http://www.theimagingsource.com/
873 DFG/LC1
874
875www.sknet-web.co.jp
876-------------------
877 SKnet Monster TV (saa7134)
878
879A-Max www.amaxhk.com (Colormax, Amax, Napa)
880-------------------
881 APAC Viewcomp 878
882
883Cybertainment
884-------------
885 CyberMail AV Video Email Kit w/ PCI Capture Card (capture only)
886 CyberMail Xtreme
887 These are Flyvideo
888
889VCR (http://www.vcrinc.com/)
890---
891 Video Catcher 16
892
893Twinhan
894-------
895 DST Card/DST-IP (bt878, twinhan asic) VP-1020
896 Sold as:
897 KWorld DVBS Satellite TV-Card
898 Powercolor DSTV Satellite Tuner Card
899 Prolink Pixelview DTV2000
900 Provideo PV-911 Digital Satellite TV Tuner Card With Common Interface ?
901 DST-CI Card (DVB Satellite) VP-1030
902 DCT Card (DVB cable)
903
904MSI
905---
906 MSI TV@nywhere Tuner Card (MS-8876) (CX23881/883) Not Bt878 compatible.
907 MS-8401 DVB-S
908
909Focus www.focusinfo.com
910-----
911 InVideo PCI (bt878)
912
913Sdisilk www.sdisilk.com/
914-------
915 SDI Silk 100
916 SDI Silk 200 SDI Input Card
917
918www.euresys.com
919 PICOLO series
920
921PMC/Pace
922www.pacecom.co.uk website closed
923
924Mercury www.kobian.com (UK and FR)
925 LR50
926 LR138RBG-Rx == LR138
927
928TEC sound (package and manuals don't have any other manufacturer info) TecSound
929 Though educated googling found: www.techmakers.com
930 TV-Mate = Zoltrix VP-8482
931
932Lorenzen www.lorenzen.de
933--------
934 SL DVB-S PCI = Technotrend Budget PCI (su1278 or bsru version)
935
936Origo (.uk) www.origo2000.com
937 PC TV Card = LR50
938
939I/O Magic www.iomagic.com
940---------
941 PC PVR - Desktop TV Personal Video Recorder DR-PCTV100 = Pinnacle ROB2D-51009464 4.0 + Cyberlink PowerVCR II
942
943Arowana
944-------
945 TV-Karte / Poso Power TV (?) = Zoltrix VP-8482 (?)
946
947iTVC15 boards:
948-------------
949kuroutoshikou.com ITVC15
950yuan.com MPG160 PCI TV (Internal PCI MPEG2 encoder card plus TV-tuner)
951
952Asus www.asuscom.com
953 Asus TV Tuner Card 880 NTSC (low profile, cx23880)
954 Asus TV (saa7134)
955
956Hoontech
957--------
958http://www.hoontech.de/
959 HART Vision 848 (H-ART Vision 848)
960 HART Vision 878 (H-Art Vision 878)
diff --git a/Documentation/video4linux/bttv/ICs b/Documentation/video4linux/bttv/ICs
deleted file mode 100644
index 611315f87c3e..000000000000
--- a/Documentation/video4linux/bttv/ICs
+++ /dev/null
@@ -1,37 +0,0 @@
1all boards:
2
3Brooktree Bt848/848A/849/878/879: video capture chip
4
5
6
7Miro PCTV:
8
9Philips or Temic Tuner
10
11
12
13Hauppauge Win/TV pci (version 405):
14
15Microchip 24LC02B or
16Philips 8582E2Y: 256 Byte EEPROM with configuration information
17 I2C 0xa0-0xa1, (24LC02B also responds to 0xa2-0xaf)
18Philips SAA5246AGP/E: Videotext decoder chip, I2C 0x22-0x23
19TDA9800: sound decoder
20Winbond W24257AS-35: 32Kx8 CMOS static RAM (Videotext buffer mem)
2114052B: analog switch for selection of sound source
22
23PAL:
24TDA5737: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
25TSA5522: 1.4 GHz I2C-bus controlled synthesizer, I2C 0xc2-0xc3
26
27NTSC:
28TDA5731: VHF, hyperband and UHF mixer/oscillator for TV and VCR 3-band tuners
29TSA5518: no datasheet available on Philips site
30
31
32
33STB TV pci:
34
35???
36if you want better support for STB cards send me info!
37Look at the board! What chips are on it?
diff --git a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options
deleted file mode 100644
index 14c065fa23ef..000000000000
--- a/Documentation/video4linux/bttv/Insmod-options
+++ /dev/null
@@ -1,172 +0,0 @@
1
2Note: "modinfo <module>" prints various information about a kernel
3module, among them a complete and up-to-date list of insmod options.
4This list tends to be outdated because it is updated manually ...
5
6==========================================================================
7
8bttv.o
9 the bt848/878 (grabber chip) driver
10
11 insmod args:
12 card=n card type, see CARDLIST for a list.
13 tuner=n tuner type, see CARDLIST for a list.
14 radio=0/1 card supports radio
15 pll=0/1/2 pll settings
16 0: don't use PLL
17 1: 28 MHz crystal installed
18 2: 35 MHz crystal installed
19
20 triton1=0/1 for Triton1 (+others) compatibility
21 vsfx=0/1 yet another chipset bug compatibility bit
22 see README.quirks for details on these two.
23
24 bigendian=n Set the endianness of the gfx framebuffer.
25 Default is native endian.
26 fieldnr=0/1 Count fields. Some TV descrambling software
27 needs this, for others it only generates
28 50 useless IRQs/sec. default is 0 (off).
29 autoload=0/1 autoload helper modules (tuner, audio).
30 default is 1 (on).
31 bttv_verbose=0/1/2 verbose level (at insmod time, while
32 looking at the hardware). default is 1.
33 bttv_debug=0/1 debug messages (for capture).
34 default is 0 (off).
35 irq_debug=0/1 irq handler debug messages.
36 default is 0 (off).
37 gbuffers=2-32 number of capture buffers for mmap'ed capture.
38 default is 4.
39 gbufsize= size of capture buffers. default and
40 maximum value is 0x208000 (~2MB)
41 no_overlay=0 Enable overlay on broken hardware. There
42 are some chipsets (SIS for example) which
43 are known to have problems with the PCI DMA
44 push used by bttv. bttv will disable overlay
45 by default on this hardware to avoid crashes.
46 With this insmod option you can override this.
47 no_overlay=1 Disable overlay. It should be used by broken
48 hardware that doesn't support PCI2PCI direct
49 transfers.
50 automute=0/1 Automatically mutes the sound if there is
51 no TV signal, on by default. You might try
52 to disable this if you have bad input signal
53 quality which leading to unwanted sound
54 dropouts.
55 chroma_agc=0/1 AGC of chroma signal, off by default.
56 adc_crush=0/1 Luminance ADC crush, on by default.
57 i2c_udelay= Allow reduce I2C speed. Default is 5 usecs
58 (meaning 66,67 Kbps). The default is the
59 maximum supported speed by kernel bitbang
60 algorithm. You may use lower numbers, if I2C
61 messages are lost (16 is known to work on
62 all supported cards).
63
64 bttv_gpio=0/1
65 gpiomask=
66 audioall=
67 audiomux=
68 See Sound-FAQ for a detailed description.
69
70 remap, card, radio and pll accept up to four comma-separated arguments
71 (for multiple boards).
72
73tuner.o
74 The tuner driver. You need this unless you want to use only
75 with a camera or external tuner ...
76
77 insmod args:
78 debug=1 print some debug info to the syslog
79 type=n type of the tuner chip. n as follows:
80 see CARDLIST for a complete list.
81 pal=[bdgil] select PAL variant (used for some tuners
82 only, important for the audio carrier).
83
84tvaudio.o
85 new, experimental module which is supported to provide a single
86 driver for all simple i2c audio control chips (tda/tea*).
87
88 insmod args:
89 tda8425 = 1 enable/disable the support for the
90 tda9840 = 1 various chips.
91 tda9850 = 1 The tea6300 can't be autodetected and is
92 tda9855 = 1 therefore off by default, if you have
93 tda9873 = 1 this one on your card (STB uses these)
94 tda9874a = 1 you have to enable it explicitly.
95 tea6300 = 0 The two tda985x chips use the same i2c
96 tea6420 = 1 address and can't be disturgished from
97 pic16c54 = 1 each other, you might have to disable
98 the wrong one.
99 debug = 1 print debug messages
100
101 insmod args for tda9874a:
102 tda9874a_SIF=1/2 select sound IF input pin (1 or 2)
103 (default is pin 1)
104 tda9874a_AMSEL=0/1 auto-mute select for NICAM (default=0)
105 Please read note 3 below!
106 tda9874a_STD=n select TV sound standard (0..8):
107 0 - A2, B/G
108 1 - A2, M (Korea)
109 2 - A2, D/K (1)
110 3 - A2, D/K (2)
111 4 - A2, D/K (3)
112 5 - NICAM, I
113 6 - NICAM, B/G
114 7 - NICAM, D/K (default)
115 8 - NICAM, L
116
117 Note 1: tda9874a supports both tda9874h (old) and tda9874a (new) chips.
118 Note 2: tda9874h/a and tda9875 (which is supported separately by
119 tda9875.o) use the same i2c address so both modules should not be
120 used at the same time.
121 Note 3: Using tda9874a_AMSEL option depends on your TV card design!
122 AMSEL=0: auto-mute will switch between NICAM sound
123 and the sound on 1st carrier (i.e. FM mono or AM).
124 AMSEL=1: auto-mute will switch between NICAM sound
125 and the analog mono input (MONOIN pin).
126 If tda9874a decoder on your card has MONOIN pin not connected, then
127 use only tda9874_AMSEL=0 or don't specify this option at all.
128 For example:
129 card=65 (FlyVideo 2000S) - set AMSEL=1 or AMSEL=0
130 card=72 (Prolink PV-BT878P rev.9B) - set AMSEL=0 only
131
132msp3400.o
133 The driver for the msp34xx sound processor chips. If you have a
134 stereo card, you probably want to insmod this one.
135
136 insmod args:
137 debug=1/2 print some debug info to the syslog,
138 2 is more verbose.
139 simple=1 Use the "short programming" method. Newer
140 msp34xx versions support this. You need this
141 for dbx stereo. Default is on if supported by
142 the chip.
143 once=1 Don't check the TV-stations Audio mode
144 every few seconds, but only once after
145 channel switches.
146 amsound=1 Audio carrier is AM/NICAM at 6.5 Mhz. This
147 should improve things for french people, the
148 carrier autoscan seems to work with FM only...
149
150tea6300.o - OBSOLETE (use tvaudio instead)
151 The driver for the tea6300 fader chip. If you have a stereo
152 card and the msp3400.o doesn't work, you might want to try this
153 one. This chip is seen on most STB TV/FM cards (usually from
154 Gateway OEM sold surplus on auction sites).
155
156 insmod args:
157 debug=1 print some debug info to the syslog.
158
159tda8425.o - OBSOLETE (use tvaudio instead)
160 The driver for the tda8425 fader chip. This driver used to be
161 part of bttv.c, so if your sound used to work but does not
162 anymore, try loading this module.
163
164 insmod args:
165 debug=1 print some debug info to the syslog.
166
167tda985x.o - OBSOLETE (use tvaudio instead)
168 The driver for the tda9850/55 audio chips.
169
170 insmod args:
171 debug=1 print some debug info to the syslog.
172 chip=9850/9855 set the chip type.
diff --git a/Documentation/video4linux/bttv/MAKEDEV b/Documentation/video4linux/bttv/MAKEDEV
deleted file mode 100644
index 093c0cd18042..000000000000
--- a/Documentation/video4linux/bttv/MAKEDEV
+++ /dev/null
@@ -1,27 +0,0 @@
1#!/bin/bash
2
3function makedev () {
4
5 for dev in 0 1 2 3; do
6 echo "/dev/$1$dev: char 81 $[ $2 + $dev ]"
7 rm -f /dev/$1$dev
8 mknod /dev/$1$dev c 81 $[ $2 + $dev ]
9 chmod 666 /dev/$1$dev
10 done
11
12 # symlink for default device
13 rm -f /dev/$1
14 ln -s /dev/${1}0 /dev/$1
15}
16
17# see http://linux.bytesex.org/v4l2/API.html
18
19echo "*** new device names ***"
20makedev video 0
21makedev radio 64
22makedev vbi 224
23
24#echo "*** old device names (for compatibility only) ***"
25#makedev bttv 0
26#makedev bttv-fm 64
27#makedev bttv-vbi 224
diff --git a/Documentation/video4linux/bttv/Modprobe.conf b/Documentation/video4linux/bttv/Modprobe.conf
deleted file mode 100644
index 55f14650d8cd..000000000000
--- a/Documentation/video4linux/bttv/Modprobe.conf
+++ /dev/null
@@ -1,11 +0,0 @@
1# i2c
2alias char-major-89 i2c-dev
3options i2c-core i2c_debug=1
4options i2c-algo-bit bit_test=1
5
6# bttv
7alias char-major-81 videodev
8alias char-major-81-0 bttv
9options bttv card=2 radio=1
10options tuner debug=1
11
diff --git a/Documentation/video4linux/bttv/Modules.conf b/Documentation/video4linux/bttv/Modules.conf
deleted file mode 100644
index 8f258faf18f1..000000000000
--- a/Documentation/video4linux/bttv/Modules.conf
+++ /dev/null
@@ -1,14 +0,0 @@
1# For modern kernels (2.6 or above), this belongs in /etc/modprobe.d/*.conf
2# For for 2.4 kernels or earlier, this belongs in /etc/modules.conf.
3
4# i2c
5alias char-major-89 i2c-dev
6options i2c-core i2c_debug=1
7options i2c-algo-bit bit_test=1
8
9# bttv
10alias char-major-81 videodev
11alias char-major-81-0 bttv
12options bttv card=2 radio=1
13options tuner debug=1
14
diff --git a/Documentation/video4linux/bttv/PROBLEMS b/Documentation/video4linux/bttv/PROBLEMS
deleted file mode 100644
index 2b8b0079f7c7..000000000000
--- a/Documentation/video4linux/bttv/PROBLEMS
+++ /dev/null
@@ -1,62 +0,0 @@
1- Start capturing by pressing "c" or by selecting it via a menu!
2
3- Start capturing by pressing "c" or by selecting it via a menu!!!
4
5- The memory of some S3 cards is not recognized right:
6
7 First of all, if you are not using XFree-3.2 or newer, upgrade AT LEAST to
8 XFree-3.2A! This solved the problem for most people.
9
10 Start up X11 like this: "XF86_S3 -probeonly" and write down where the
11 linear frame buffer is.
12 If it is different to the address found by bttv install bttv like this:
13 "insmod bttv vidmem=0xfb0"
14 if the linear frame buffer is at 0xfb000000 (i.e. omit the last 5 zeros!)
15
16 Some S3 cards even take up 64MB of memory but only report 32MB to the BIOS.
17 If this 64MB area overlaps the IO memory of the Bt848 you also have to
18 remap this. E.g.: insmod bttv vidmem=0xfb0 remap=0xfa0
19
20 If the video memory is found at the right place and there are no address
21 conflicts but still no picture (or the computer even crashes),
22 try disabling features of your PCI chipset in the BIOS setup.
23
24 Frank Kapahnke <frank@kapahnke.prima.ruhr.de> also reported that problems
25 with his S3 868 went away when he upgraded to XFree 3.2.
26
27
28- I still only get a black picture with my S3 card!
29
30 Even with XFree-3.2A some people have problems with their S3 cards
31 (mostly with Trio 64 but also with some others)
32 Get the free demo version of Accelerated X from www.xinside.com and try
33 bttv with it. bttv seems to work with most S3 cards with Accelerated X.
34
35 Since I do not know much (better make that almost nothing) about VGA card
36 programming I do not know the reason for this.
37 Looks like XFree does something different when setting up the video memory?
38 Maybe somebody can enlighten me?
39 Would be nice if somebody could get this to work with XFree since
40 Accelerated X costs more than some of the grabber cards ...
41
42 Better linear frame buffer support for S3 cards will probably be in
43 XFree 4.0.
44
45- Grabbing is not switched off when changing consoles with XFree.
46 That's because XFree and some AcceleratedX versions do not send unmap
47 events.
48
49- Some popup windows (e.g. of the window manager) are not refreshed.
50
51 Disable backing store by starting X with the option "-bs"
52
53- When using 32 bpp in XFree or 24+8bpp mode in AccelX 3.1 the system
54 can sometimes lock up if you use more than 1 bt848 card at the same time.
55 You will always get pixel errors when e.g. using more than 1 card in full
56 screen mode. Maybe we need something faster than the PCI bus ...
57
58
59- Some S3 cards and the Matrox Mystique will produce pixel errors with
60 full resolution in 32-bit mode.
61
62- Some video cards have problems with Accelerated X 4.1
diff --git a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README
deleted file mode 100644
index 7cbf4fb6cf31..000000000000
--- a/Documentation/video4linux/bttv/README
+++ /dev/null
@@ -1,90 +0,0 @@
1
2Release notes for bttv
3======================
4
5You'll need at least these config options for bttv:
6 CONFIG_I2C=m
7 CONFIG_I2C_ALGOBIT=m
8 CONFIG_VIDEO_DEV=m
9
10The latest bttv version is available from http://bytesex.org/bttv/
11
12
13Make bttv work with your card
14-----------------------------
15
16Just try "modprobe bttv" and see if that works.
17
18If it doesn't bttv likely could not autodetect your card and needs some
19insmod options. The most important insmod option for bttv is "card=n"
20to select the correct card type. If you get video but no sound you've
21very likely specified the wrong (or no) card type. A list of supported
22cards is in CARDLIST.bttv
23
24If bttv takes very long to load (happens sometimes with the cheap
25cards which have no tuner), try adding this to your modules.conf:
26 options i2c-algo-bit bit_test=1
27
28For the WinTV/PVR you need one firmware file from the driver CD:
29hcwamc.rbf. The file is in the pvr45xxx.exe archive (self-extracting
30zip file, unzip can unpack it). Put it into the /etc/pvr directory or
31use the firm_altera=<path> insmod option to point the driver to the
32location of the file.
33
34If your card isn't listed in CARDLIST.bttv or if you have trouble making
35audio work, you should read the Sound-FAQ.
36
37
38Autodetecting cards
39-------------------
40
41bttv uses the PCI Subsystem ID to autodetect the card type. lspci lists
42the Subsystem ID in the second line, looks like this:
43
4400:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02)
45 Subsystem: Hauppauge computer works Inc. WinTV/GO
46 Flags: bus master, medium devsel, latency 32, IRQ 5
47 Memory at e2000000 (32-bit, prefetchable) [size=4K]
48
49only bt878-based cards can have a subsystem ID (which does not mean
50that every card really has one). bt848 cards can't have a Subsystem
51ID and therefore can't be autodetected. There is a list with the ID's
52in bttv-cards.c (in case you are intrested or want to mail patches
53with updates).
54
55
56Still doesn't work?
57-------------------
58
59I do NOT have a lab with 30+ different grabber boards and a
60PAL/NTSC/SECAM test signal generator at home, so I often can't
61reproduce your problems. This makes debugging very difficult for me.
62If you have some knowledge and spare time, please try to fix this
63yourself (patches very welcome of course...) You know: The linux
64slogan is "Do it yourself".
65
66There is a mailing list: linux-media@vger.kernel.org
67http://vger.kernel.org/vger-lists.html#linux-media
68
69If you have trouble with some specific TV card, try to ask there
70instead of mailing me directly. The chance that someone with the
71same card listens there is much higher...
72
73For problems with sound: There are a lot of different systems used
74for TV sound all over the world. And there are also different chips
75which decode the audio signal. Reports about sound problems ("stereo
76does'nt work") are pretty useless unless you include some details
77about your hardware and the TV sound scheme used in your country (or
78at least the country you are living in).
79
80
81Finally: If you mail some patches for bttv around the world (to
82linux-kernel/Alan/Linus/...), please Cc: me.
83
84
85Have fun with bttv,
86
87 Gerd
88
89--
90Gerd Knorr <kraxel@bytesex.org>
diff --git a/Documentation/video4linux/bttv/README.WINVIEW b/Documentation/video4linux/bttv/README.WINVIEW
deleted file mode 100644
index c61cf2864287..000000000000
--- a/Documentation/video4linux/bttv/README.WINVIEW
+++ /dev/null
@@ -1,33 +0,0 @@
1
2Support for the Leadtek WinView 601 TV/FM by Jon Tombs <jon@gte.esi.us.es>
3
4This card is basically the same as all the rest (Bt484A, Philips tuner),
5the main difference is that they have attached a programmable attenuator to 3
6GPIO lines in order to give some volume control. They have also stuck an
7infra-red remote control decoded on the board, I will add support for this
8when I get time (it simple generates an interrupt for each key press, with
9the key code is placed in the GPIO port).
10
11I don't yet have any application to test the radio support. The tuner
12frequency setting should work but it is possible that the audio multiplexer
13is wrong. If it doesn't work, send me email.
14
15
16- No Thanks to Leadtek they refused to answer any questions about their
17hardware. The driver was written by visual inspection of the card. If you
18use this driver, send an email insult to them, and tell them you won't
19continue buying their hardware unless they support Linux.
20
21- Little thanks to Princeton Technology Corp (http://www.princeton.com.tw)
22who make the audio attenuator. Their publicly available data-sheet available
23on their web site doesn't include the chip programming information! Hidden
24on their server are the full data-sheets, but don't ask how I found it.
25
26To use the driver I use the following options, the tuner and pll settings might
27be different in your country
28
29insmod videodev
30insmod i2c scan=1 i2c_debug=0 verbose=0
31insmod tuner type=1 debug=0
32insmod bttv pll=1 radio=1 card=17
33
diff --git a/Documentation/video4linux/bttv/README.freeze b/Documentation/video4linux/bttv/README.freeze
deleted file mode 100644
index 5eddfa076cfb..000000000000
--- a/Documentation/video4linux/bttv/README.freeze
+++ /dev/null
@@ -1,74 +0,0 @@
1
2If the box freezes hard with bttv ...
3=====================================
4
5It might be a bttv driver bug. It also might be bad hardware. It also
6might be something else ...
7
8Just mailing me "bttv freezes" isn't going to help much. This README
9has a few hints how you can help to pin down the problem.
10
11
12bttv bugs
13---------
14
15If some version works and another doesn't it is likely to be a driver
16bug. It is very helpful if you can tell where exactly it broke
17(i.e. the last working and the first broken version).
18
19With a hard freeze you probably doesn't find anything in the logfiles.
20The only way to capture any kernel messages is to hook up a serial
21console and let some terminal application log the messages. /me uses
22screen. See Documentation/serial-console.txt for details on setting
23up a serial console.
24
25Read Documentation/oops-tracing.txt to learn how to get any useful
26information out of a register+stack dump printed by the kernel on
27protection faults (so-called "kernel oops").
28
29If you run into some kind of deadlock, you can try to dump a call trace
30for each process using sysrq-t (see Documentation/sysrq.txt).
31This way it is possible to figure where *exactly* some process in "D"
32state is stuck.
33
34I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid
35for some people. Thus probably a small buglet left somewhere in bttv
360.7.x. I have no idea where exactly, it works stable for me and a lot of
37other people. But in case you have problems with the 0.7.x versions you
38can give 0.8.x a try ...
39
40
41hardware bugs
42-------------
43
44Some hardware can't deal with PCI-PCI transfers (i.e. grabber => vga).
45Sometimes problems show up with bttv just because of the high load on
46the PCI bus. The bt848/878 chips have a few workarounds for known
47incompatibilities, see README.quirks.
48
49Some folks report that increasing the pci latency helps too,
50althrought I'm not sure whenever this really fixes the problems or
51only makes it less likely to happen. Both bttv and btaudio have a
52insmod option to set the PCI latency of the device.
53
54Some mainboard have problems to deal correctly with multiple devices
55doing DMA at the same time. bttv + ide seems to cause this sometimes,
56if this is the case you likely see freezes only with video and hard disk
57access at the same time. Updating the IDE driver to get the latest and
58greatest workarounds for hardware bugs might fix these problems.
59
60
61other
62-----
63
64If you use some binary-only yunk (like nvidia module) try to reproduce
65the problem without.
66
67IRQ sharing is known to cause problems in some cases. It works just
68fine in theory and many configurations. Neverless it might be worth a
69try to shuffle around the PCI cards to give bttv another IRQ or make
70it share the IRQ with some other piece of hardware. IRQ sharing with
71VGA cards seems to cause trouble sometimes. I've also seen funny
72effects with bttv sharing the IRQ with the ACPI bridge (and
73apci-enabled kernel).
74
diff --git a/Documentation/video4linux/bttv/README.quirks b/Documentation/video4linux/bttv/README.quirks
deleted file mode 100644
index 92e03929a6b2..000000000000
--- a/Documentation/video4linux/bttv/README.quirks
+++ /dev/null
@@ -1,83 +0,0 @@
1
2Below is what the bt878 data book says about the PCI bug compatibility
3modes of the bt878 chip.
4
5The triton1 insmod option sets the EN_TBFX bit in the control register.
6The vsfx insmod option does the same for EN_VSFX bit. If you have
7stability problems you can try if one of these options makes your box
8work solid.
9
10drivers/pci/quirks.c knows about these issues, this way these bits are
11enabled automagically for known-buggy chipsets (look at the kernel
12messages, bttv tells you).
13
14HTH,
15
16 Gerd
17
18---------------------------- cut here --------------------------
19
20Normal PCI Mode
21---------------
22
23The PCI REQ signal is the logical-or of the incoming function requests.
24The inter-nal GNT[0:1] signals are gated asynchronously with GNT and
25demultiplexed by the audio request signal. Thus the arbiter defaults to
26the video function at power-up and parks there during no requests for
27bus access. This is desirable since the video will request the bus more
28often. However, the audio will have highest bus access priority. Thus
29the audio will have first access to the bus even when issuing a request
30after the video request but before the PCI external arbiter has granted
31access to the Bt879. Neither function can preempt the other once on the
32bus. The duration to empty the entire video PCI FIFO onto the PCI bus is
33very short compared to the bus access latency the audio PCI FIFO can
34tolerate.
35
36
37430FX Compatibility Mode
38------------------------
39
40When using the 430FX PCI, the following rules will ensure
41compatibility:
42
43 (1) Deassert REQ at the same time as asserting FRAME.
44 (2) Do not reassert REQ to request another bus transaction until after
45 finish-ing the previous transaction.
46
47Since the individual bus masters do not have direct control of REQ, a
48simple logical-or of video and audio requests would violate the rules.
49Thus, both the arbiter and the initiator contain 430FX compatibility
50mode logic. To enable 430FX mode, set the EN_TBFX bit as indicated in
51Device Control Register on page 104.
52
53When EN_TBFX is enabled, the arbiter ensures that the two compatibility
54rules are satisfied. Before GNT is asserted by the PCI arbiter, this
55internal arbiter may still logical-or the two requests. However, once
56the GNT is issued, this arbiter must lock in its decision and now route
57only the granted request to the REQ pin. The arbiter decision lock
58happens regardless of the state of FRAME because it does not know when
59FRAME will be asserted (typically - each initiator will assert FRAME on
60the cycle following GNT). When FRAME is asserted, it is the initiator s
61responsibility to remove its request at the same time. It is the
62arbiters responsibility to allow this request to flow through to REQ and
63not allow the other request to hold REQ asserted. The decision lock may
64be removed at the end of the transaction: for example, when the bus is
65idle (FRAME and IRDY). The arbiter decision may then continue
66asynchronously until GNT is again asserted.
67
68
69Interfacing with Non-PCI 2.1 Compliant Core Logic
70-------------------------------------------------
71
72A small percentage of core logic devices may start a bus transaction
73during the same cycle that GNT is de-asserted. This is non PCI 2.1
74compliant. To ensure compatibility when using PCs with these PCI
75controllers, the EN_VSFX bit must be enabled (refer to Device Control
76Register on page 104). When in this mode, the arbiter does not pass GNT
77to the internal functions unless REQ is asserted. This prevents a bus
78transaction from starting the same cycle as GNT is de-asserted. This
79also has the side effect of not being able to take advantage of bus
80parking, thus lowering arbitration performance. The Bt879 drivers must
81query for these non-compliant devices, and set the EN_VSFX bit only if
82required.
83
diff --git a/Documentation/video4linux/bttv/Sound-FAQ b/Documentation/video4linux/bttv/Sound-FAQ
deleted file mode 100644
index 646a47de0016..000000000000
--- a/Documentation/video4linux/bttv/Sound-FAQ
+++ /dev/null
@@ -1,148 +0,0 @@
1
2bttv and sound mini howto
3=========================
4
5There are a lot of different bt848/849/878/879 based boards available.
6Making video work often is not a big deal, because this is handled
7completely by the bt8xx chip, which is common on all boards. But
8sound is handled in slightly different ways on each board.
9
10To handle the grabber boards correctly, there is a array tvcards[] in
11bttv-cards.c, which holds the information required for each board.
12Sound will work only, if the correct entry is used (for video it often
13makes no difference). The bttv driver prints a line to the kernel
14log, telling which card type is used. Like this one:
15
16 bttv0: model: BT848(Hauppauge old) [autodetected]
17
18You should verify this is correct. If it isn't, you have to pass the
19correct board type as insmod argument, "insmod bttv card=2" for
20example. The file CARDLIST has a list of valid arguments for card.
21If your card isn't listed there, you might check the source code for
22new entries which are not listed yet. If there isn't one for your
23card, you can check if one of the existing entries does work for you
24(just trial and error...).
25
26Some boards have an extra processor for sound to do stereo decoding
27and other nice features. The msp34xx chips are used by Hauppauge for
28example. If your board has one, you might have to load a helper
29module like msp3400.o to make sound work. If there isn't one for the
30chip used on your board: Bad luck. Start writing a new one. Well,
31you might want to check the video4linux mailing list archive first...
32
33Of course you need a correctly installed soundcard unless you have the
34speakers connected directly to the grabber board. Hint: check the
35mixer settings too. ALSA for example has everything muted by default.
36
37
38How sound works in detail
39=========================
40
41Still doesn't work? Looks like some driver hacking is required.
42Below is a do-it-yourself description for you.
43
44The bt8xx chips have 32 general purpose pins, and registers to control
45these pins. One register is the output enable register
46(BT848_GPIO_OUT_EN), it says which pins are actively driven by the
47bt848 chip. Another one is the data register (BT848_GPIO_DATA), where
48you can get/set the status if these pins. They can be used for input
49and output.
50
51Most grabber board vendors use these pins to control an external chip
52which does the sound routing. But every board is a little different.
53These pins are also used by some companies to drive remote control
54receiver chips. Some boards use the i2c bus instead of the gpio pins
55to connect the mux chip.
56
57As mentioned above, there is a array which holds the required
58information for each known board. You basically have to create a new
59line for your board. The important fields are these two:
60
61struct tvcard
62{
63 [ ... ]
64 u32 gpiomask;
65 u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
66};
67
68gpiomask specifies which pins are used to control the audio mux chip.
69The corresponding bits in the output enable register
70(BT848_GPIO_OUT_EN) will be set as these pins must be driven by the
71bt848 chip.
72
73The audiomux[] array holds the data values for the different inputs
74(i.e. which pins must be high/low for tuner/mute/...). This will be
75written to the data register (BT848_GPIO_DATA) to switch the audio
76mux.
77
78
79What you have to do is figure out the correct values for gpiomask and
80the audiomux array. If you have Windows and the drivers four your
81card installed, you might to check out if you can read these registers
82values used by the windows driver. A tool to do this is available
83from ftp://telepresence.dmem.strath.ac.uk/pub/bt848/winutil, but it
84does'nt work with bt878 boards according to some reports I received.
85Another one with bt878 support is available from
86http://btwincap.sourceforge.net/Files/btspy2.00.zip
87
88You might also dig around in the *.ini files of the Windows applications.
89You can have a look at the board to see which of the gpio pins are
90connected at all and then start trial-and-error ...
91
92
93Starting with release 0.7.41 bttv has a number of insmod options to
94make the gpio debugging easier:
95
96bttv_gpio=0/1 enable/disable gpio debug messages
97gpiomask=n set the gpiomask value
98audiomux=i,j,... set the values of the audiomux array
99audioall=a set the values of the audiomux array (one
100 value for all array elements, useful to check
101 out which effect the particular value has).
102
103The messages printed with bttv_gpio=1 look like this:
104
105 bttv0: gpio: en=00000027, out=00000024 in=00ffffd8 [audio: off]
106
107en = output _en_able register (BT848_GPIO_OUT_EN)
108out = _out_put bits of the data register (BT848_GPIO_DATA),
109 i.e. BT848_GPIO_DATA & BT848_GPIO_OUT_EN
110in = _in_put bits of the data register,
111 i.e. BT848_GPIO_DATA & ~BT848_GPIO_OUT_EN
112
113
114
115Other elements of the tvcards array
116===================================
117
118If you are trying to make a new card work you might find it useful to
119know what the other elements in the tvcards array are good for:
120
121video_inputs - # of video inputs the card has
122audio_inputs - historical cruft, not used any more.
123tuner - which input is the tuner
124svhs - which input is svhs (all others are labeled composite)
125muxsel - video mux, input->registervalue mapping
126pll - same as pll= insmod option
127tuner_type - same as tuner= insmod option
128*_modulename - hint whenever some card needs this or that audio
129 module loaded to work properly.
130has_radio - whenever this TV card has a radio tuner.
131no_msp34xx - "1" disables loading of msp3400.o module
132no_tda9875 - "1" disables loading of tda9875.o module
133needs_tvaudio - set to "1" to load tvaudio.o module
134
135If some config item is specified both from the tvcards array and as
136insmod option, the insmod option takes precedence.
137
138
139
140Good luck,
141
142 Gerd
143
144
145PS: If you have a new working entry, mail it to me.
146
147--
148Gerd Knorr <kraxel@bytesex.org>
diff --git a/Documentation/video4linux/bttv/Specs b/Documentation/video4linux/bttv/Specs
deleted file mode 100644
index f32466cdae05..000000000000
--- a/Documentation/video4linux/bttv/Specs
+++ /dev/null
@@ -1,3 +0,0 @@
1Philips http://www.Semiconductors.COM/pip/
2Conexant http://www.conexant.com/
3Micronas http://www.micronas.com/en/home/index.html
diff --git a/Documentation/video4linux/bttv/THANKS b/Documentation/video4linux/bttv/THANKS
deleted file mode 100644
index 950aa781c2e9..000000000000
--- a/Documentation/video4linux/bttv/THANKS
+++ /dev/null
@@ -1,24 +0,0 @@
1Many thanks to:
2
3- Markus Schroeder <schroedm@uni-duesseldorf.de> for information on the Bt848
4 and tuner programming and his control program xtvc.
5
6- Martin Buck <martin-2.buck@student.uni-ulm.de> for his great Videotext
7 package.
8
9- Gerd Knorr <kraxel@cs.tu-berlin.de> for the MSP3400 support and the modular
10 I2C, tuner, ... support.
11
12
13- MATRIX Vision for giving us 2 cards for free, which made support of
14 single crystal operation possible.
15
16- MIRO for providing a free PCTV card and detailed information about the
17 components on their cards. (E.g. how the tuner type is detected)
18 Without their card I could not have debugged the NTSC mode.
19
20- Hauppauge for telling how the sound input is selected and what components
21 they do and will use on their radio cards.
22 Also many thanks for faxing me the FM1216 data sheet.
23
24
diff --git a/Documentation/video4linux/bttv/Tuners b/Documentation/video4linux/bttv/Tuners
deleted file mode 100644
index 0a371d349542..000000000000
--- a/Documentation/video4linux/bttv/Tuners
+++ /dev/null
@@ -1,115 +0,0 @@
11) Tuner Programming
2====================
3There are some flavors of Tuner programming APIs.
4These differ mainly by the bandswitch byte.
5
6 L= LG_API (VHF_LO=0x01, VHF_HI=0x02, UHF=0x08, radio=0x04)
7 P= PHILIPS_API (VHF_LO=0xA0, VHF_HI=0x90, UHF=0x30, radio=0x04)
8 T= TEMIC_API (VHF_LO=0x02, VHF_HI=0x04, UHF=0x01)
9 A= ALPS_API (VHF_LO=0x14, VHF_HI=0x12, UHF=0x11)
10 M= PHILIPS_MK3 (VHF_LO=0x01, VHF_HI=0x02, UHF=0x04, radio=0x19)
11
122) Tuner Manufacturers
13======================
14
15SAMSUNG Tuner identification: (e.g. TCPM9091PD27)
16 TCP [ABCJLMNQ] 90[89][125] [DP] [ACD] 27 [ABCD]
17 [ABCJLMNQ]:
18 A= BG+DK
19 B= BG
20 C= I+DK
21 J= NTSC-Japan
22 L= Secam LL
23 M= BG+I+DK
24 N= NTSC
25 Q= BG+I+DK+LL
26 [89]: ?
27 [125]:
28 2: No FM
29 5: With FM
30 [DP]:
31 D= NTSC
32 P= PAL
33 [ACD]:
34 A= F-connector
35 C= Phono connector
36 D= Din Jack
37 [ABCD]:
38 3-wire/I2C tuning, 2-band/3-band
39
40 These Tuners are PHILIPS_API compatible.
41
42Philips Tuner identification: (e.g. FM1216MF)
43 F[IRMQ]12[1345]6{MF|ME|MP}
44 F[IRMQ]:
45 FI12x6: Tuner Series
46 FR12x6: Tuner + Radio IF
47 FM12x6: Tuner + FM
48 FQ12x6: special
49 FMR12x6: special
50 TD15xx: Digital Tuner ATSC
51 12[1345]6:
52 1216: PAL BG
53 1236: NTSC
54 1246: PAL I
55 1256: Pal DK
56 {MF|ME|MP}
57 MF: BG LL w/ Secam (Multi France)
58 ME: BG DK I LL (Multi Europe)
59 MP: BG DK I (Multi PAL)
60 MR: BG DK M (?)
61 MG: BG DKI M (?)
62 MK2 series PHILIPS_API, most tuners are compatible to this one !
63 MK3 series introduced in 2002 w/ PHILIPS_MK3_API
64
65Temic Tuner identification: (.e.g 4006FH5)
66 4[01][0136][269]F[HYNR]5
67 40x2: Tuner (5V/33V), TEMIC_API.
68 40x6: Tuner 5V
69 41xx: Tuner compact
70 40x9: Tuner+FM compact
71 [0136]
72 xx0x: PAL BG
73 xx1x: Pal DK, Secam LL
74 xx3x: NTSC
75 xx6x: PAL I
76 F[HYNR]5
77 FH5: Pal BG
78 FY5: others
79 FN5: multistandard
80 FR5: w/ FM radio
81 3X xxxx: order number with specific connector
82 Note: Only 40x2 series has TEMIC_API, all newer tuners have PHILIPS_API.
83
84LG Innotek Tuner:
85 TPI8NSR11 : NTSC J/M (TPI8NSR01 w/FM) (P,210/497)
86 TPI8PSB11 : PAL B/G (TPI8PSB01 w/FM) (P,170/450)
87 TAPC-I701 : PAL I (TAPC-I001 w/FM) (P,170/450)
88 TPI8PSB12 : PAL D/K+B/G (TPI8PSB02 w/FM) (P,170/450)
89 TAPC-H701P: NTSC_JP (TAPC-H001P w/FM) (L,170/450)
90 TAPC-G701P: PAL B/G (TAPC-G001P w/FM) (L,170/450)
91 TAPC-W701P: PAL I (TAPC-W001P w/FM) (L,170/450)
92 TAPC-Q703P: PAL D/K (TAPC-Q001P w/FM) (L,170/450)
93 TAPC-Q704P: PAL D/K+I (L,170/450)
94 TAPC-G702P: PAL D/K+B/G (L,170/450)
95
96 TADC-H002F: NTSC (L,175/410?; 2-B, C-W+11, W+12-69)
97 TADC-M201D: PAL D/K+B/G+I (L,143/425) (sound control at I2C address 0xc8)
98 TADC-T003F: NTSC Taiwan (L,175/410?; 2-B, C-W+11, W+12-69)
99 Suffix:
100 P= Standard phono female socket
101 D= IEC female socket
102 F= F-connector
103
104Other Tuners:
105TCL2002MB-1 : PAL BG + DK =TUNER_LG_PAL_NEW_TAPC
106TCL2002MB-1F: PAL BG + DK w/FM =PHILIPS_PAL
107TCL2002MI-2 : PAL I = ??
108
109ALPS Tuners:
110 Most are LG_API compatible
111 TSCH6 has ALPS_API (TSCH5 ?)
112 TSBE1 has extra API 05,02,08 Control_byte=0xCB Source:(1)
113
114Lit.
115(1) conexant100029b-PCI-Decoder-ApplicationNote.pdf
diff --git a/Documentation/video4linux/cpia2_overview.txt b/Documentation/video4linux/cpia2_overview.txt
deleted file mode 100644
index ad6adbedfe50..000000000000
--- a/Documentation/video4linux/cpia2_overview.txt
+++ /dev/null
@@ -1,38 +0,0 @@
1 Programmer's View of Cpia2
2
3Cpia2 is the second generation video coprocessor from VLSI Vision Ltd (now a
4division of ST Microelectronics). There are two versions. The first is the
5STV0672, which is capable of up to 30 frames per second (fps) in frame sizes
6up to CIF, and 15 fps for VGA frames. The STV0676 is an improved version,
7which can handle up to 30 fps VGA. Both coprocessors can be attached to two
8CMOS sensors - the vvl6410 CIF sensor and the vvl6500 VGA sensor. These will
9be referred to as the 410 and the 500 sensors, or the CIF and VGA sensors.
10
11The two chipsets operate almost identically. The core is an 8051 processor,
12running two different versions of firmware. The 672 runs the VP4 video
13processor code, the 676 runs VP5. There are a few differences in register
14mappings for the two chips. In these cases, the symbols defined in the
15header files are marked with VP4 or VP5 as part of the symbol name.
16
17The cameras appear externally as three sets of registers. Setting register
18values is the only way to control the camera. Some settings are
19interdependant, such as the sequence required to power up the camera. I will
20try to make note of all of these cases.
21
22The register sets are called blocks. Block 0 is the system block. This
23section is always powered on when the camera is plugged in. It contains
24registers that control housekeeping functions such as powering up the video
25processor. The video processor is the VP block. These registers control
26how the video from the sensor is processed. Examples are timing registers,
27user mode (vga, qvga), scaling, cropping, framerates, and so on. The last
28block is the video compressor (VC). The video stream sent from the camera is
29compressed as Motion JPEG (JPEGA). The VC controls all of the compression
30parameters. Looking at the file cpia2_registers.h, you can get a full view
31of these registers and the possible values for most of them.
32
33One or more registers can be set or read by sending a usb control message to
34the camera. There are three modes for this. Block mode requests a number
35of contiguous registers. Random mode reads or writes random registers with
36a tuple structure containing address/value pairs. The repeat mode is only
37used by VP4 to load a firmware patch. It contains a starting address and
38a sequence of bytes to be written into a gpio port.
diff --git a/Documentation/video4linux/cx2341x/README.hm12 b/Documentation/video4linux/cx2341x/README.hm12
deleted file mode 100644
index b36148ea0750..000000000000
--- a/Documentation/video4linux/cx2341x/README.hm12
+++ /dev/null
@@ -1,120 +0,0 @@
1The cx23416 can produce (and the cx23415 can also read) raw YUV output. The
2format of a YUV frame is specific to this chip and is called HM12. 'HM' stands
3for 'Hauppauge Macroblock', which is a misnomer as 'Conexant Macroblock' would
4be more accurate.
5
6The format is YUV 4:2:0 which uses 1 Y byte per pixel and 1 U and V byte per
7four pixels.
8
9The data is encoded as two macroblock planes, the first containing the Y
10values, the second containing UV macroblocks.
11
12The Y plane is divided into blocks of 16x16 pixels from left to right
13and from top to bottom. Each block is transmitted in turn, line-by-line.
14
15So the first 16 bytes are the first line of the top-left block, the
16second 16 bytes are the second line of the top-left block, etc. After
17transmitting this block the first line of the block on the right to the
18first block is transmitted, etc.
19
20The UV plane is divided into blocks of 16x8 UV values going from left
21to right, top to bottom. Each block is transmitted in turn, line-by-line.
22
23So the first 16 bytes are the first line of the top-left block and
24contain 8 UV value pairs (16 bytes in total). The second 16 bytes are the
25second line of 8 UV pairs of the top-left block, etc. After transmitting
26this block the first line of the block on the right to the first block is
27transmitted, etc.
28
29The code below is given as an example on how to convert HM12 to separate
30Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels.
31
32The width of a frame is always 720 pixels, regardless of the actual specified
33width.
34
35If the height is not a multiple of 32 lines, then the captured video is
36missing macroblocks at the end and is unusable. So the height must be a
37multiple of 32.
38
39--------------------------------------------------------------------------
40
41#include <stdio.h>
42#include <stdlib.h>
43#include <string.h>
44
45static unsigned char frame[576*720*3/2];
46static unsigned char framey[576*720];
47static unsigned char frameu[576*720 / 4];
48static unsigned char framev[576*720 / 4];
49
50static void de_macro_y(unsigned char* dst, unsigned char *src, int dstride, int w, int h)
51{
52 unsigned int y, x, i;
53
54 // descramble Y plane
55 // dstride = 720 = w
56 // The Y plane is divided into blocks of 16x16 pixels
57 // Each block in transmitted in turn, line-by-line.
58 for (y = 0; y < h; y += 16) {
59 for (x = 0; x < w; x += 16) {
60 for (i = 0; i < 16; i++) {
61 memcpy(dst + x + (y + i) * dstride, src, 16);
62 src += 16;
63 }
64 }
65 }
66}
67
68static void de_macro_uv(unsigned char *dstu, unsigned char *dstv, unsigned char *src, int dstride, int w, int h)
69{
70 unsigned int y, x, i;
71
72 // descramble U/V plane
73 // dstride = 720 / 2 = w
74 // The U/V values are interlaced (UVUV...).
75 // Again, the UV plane is divided into blocks of 16x16 UV values.
76 // Each block in transmitted in turn, line-by-line.
77 for (y = 0; y < h; y += 16) {
78 for (x = 0; x < w; x += 8) {
79 for (i = 0; i < 16; i++) {
80 int idx = x + (y + i) * dstride;
81
82 dstu[idx+0] = src[0]; dstv[idx+0] = src[1];
83 dstu[idx+1] = src[2]; dstv[idx+1] = src[3];
84 dstu[idx+2] = src[4]; dstv[idx+2] = src[5];
85 dstu[idx+3] = src[6]; dstv[idx+3] = src[7];
86 dstu[idx+4] = src[8]; dstv[idx+4] = src[9];
87 dstu[idx+5] = src[10]; dstv[idx+5] = src[11];
88 dstu[idx+6] = src[12]; dstv[idx+6] = src[13];
89 dstu[idx+7] = src[14]; dstv[idx+7] = src[15];
90 src += 16;
91 }
92 }
93 }
94}
95
96/*************************************************************************/
97int main(int argc, char **argv)
98{
99 FILE *fin;
100 int i;
101
102 if (argc == 1) fin = stdin;
103 else fin = fopen(argv[1], "r");
104
105 if (fin == NULL) {
106 fprintf(stderr, "cannot open input\n");
107 exit(-1);
108 }
109 while (fread(frame, sizeof(frame), 1, fin) == 1) {
110 de_macro_y(framey, frame, 720, 720, 576);
111 de_macro_uv(frameu, framev, frame + 720 * 576, 720 / 2, 720 / 2, 576 / 2);
112 fwrite(framey, sizeof(framey), 1, stdout);
113 fwrite(framev, sizeof(framev), 1, stdout);
114 fwrite(frameu, sizeof(frameu), 1, stdout);
115 }
116 fclose(fin);
117 return 0;
118}
119
120--------------------------------------------------------------------------
diff --git a/Documentation/video4linux/cx2341x/README.vbi b/Documentation/video4linux/cx2341x/README.vbi
deleted file mode 100644
index 5807cf156173..000000000000
--- a/Documentation/video4linux/cx2341x/README.vbi
+++ /dev/null
@@ -1,45 +0,0 @@
1
2Format of embedded V4L2_MPEG_STREAM_VBI_FMT_IVTV VBI data
3=========================================================
4
5This document describes the V4L2_MPEG_STREAM_VBI_FMT_IVTV format of the VBI data
6embedded in an MPEG-2 program stream. This format is in part dictated by some
7hardware limitations of the ivtv driver (the driver for the Conexant cx23415/6
8chips), in particular a maximum size for the VBI data. Anything longer is cut
9off when the MPEG stream is played back through the cx23415.
10
11The advantage of this format is it is very compact and that all VBI data for
12all lines can be stored while still fitting within the maximum allowed size.
13
14The stream ID of the VBI data is 0xBD. The maximum size of the embedded data is
154 + 43 * 36, which is 4 bytes for a header and 2 * 18 VBI lines with a 1 byte
16header and a 42 bytes payload each. Anything beyond this limit is cut off by
17the cx23415/6 firmware. Besides the data for the VBI lines we also need 36 bits
18for a bitmask determining which lines are captured and 4 bytes for a magic cookie,
19signifying that this data package contains V4L2_MPEG_STREAM_VBI_FMT_IVTV VBI data.
20If all lines are used, then there is no longer room for the bitmask. To solve this
21two different magic numbers were introduced:
22
23'itv0': After this magic number two unsigned longs follow. Bits 0-17 of the first
24unsigned long denote which lines of the first field are captured. Bits 18-31 of
25the first unsigned long and bits 0-3 of the second unsigned long are used for the
26second field.
27
28'ITV0': This magic number assumes all VBI lines are captured, i.e. it implicitly
29implies that the bitmasks are 0xffffffff and 0xf.
30
31After these magic cookies (and the 8 byte bitmask in case of cookie 'itv0') the
32captured VBI lines start:
33
34For each line the least significant 4 bits of the first byte contain the data type.
35Possible values are shown in the table below. The payload is in the following 42
36bytes.
37
38Here is the list of possible data types:
39
40#define IVTV_SLICED_TYPE_TELETEXT 0x1 // Teletext (uses lines 6-22 for PAL)
41#define IVTV_SLICED_TYPE_CC 0x4 // Closed Captions (line 21 NTSC)
42#define IVTV_SLICED_TYPE_WSS 0x5 // Wide Screen Signal (line 23 PAL)
43#define IVTV_SLICED_TYPE_VPS 0x7 // Video Programming System (PAL) (line 16)
44
45Hans Verkuil <hverkuil@xs4all.nl>
diff --git a/Documentation/video4linux/cx2341x/fw-calling.txt b/Documentation/video4linux/cx2341x/fw-calling.txt
deleted file mode 100644
index 8d21181de537..000000000000
--- a/Documentation/video4linux/cx2341x/fw-calling.txt
+++ /dev/null
@@ -1,69 +0,0 @@
1This page describes how to make calls to the firmware api.
2
3How to call
4===========
5
6The preferred calling convention is known as the firmware mailbox. The
7mailboxes are basically a fixed length array that serves as the call-stack.
8
9Firmware mailboxes can be located by searching the encoder and decoder memory
10for a 16 byte signature. That signature will be located on a 256-byte boundary.
11
12Signature:
130x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34,
140x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78
15
16The firmware implements 20 mailboxes of 20 32-bit words. The first 10 are
17reserved for API calls. The second 10 are used by the firmware for event
18notification.
19
20 Index Name
21 ----- ----
22 0 Flags
23 1 Command
24 2 Return value
25 3 Timeout
26 4-19 Parameter/Result
27
28
29The flags are defined in the following table. The direction is from the
30perspective of the firmware.
31
32 Bit Direction Purpose
33 --- --------- -------
34 2 O Firmware has processed the command.
35 1 I Driver has finished setting the parameters.
36 0 I Driver is using this mailbox.
37
38
39The command is a 32-bit enumerator. The API specifics may be found in the
40fw-*-api.txt documents.
41
42The return value is a 32-bit enumerator. Only two values are currently defined:
430=success and -1=command undefined.
44
45There are 16 parameters/results 32-bit fields. The driver populates these fields
46with values for all the parameters required by the call. The driver overwrites
47these fields with result values returned by the call. The API specifics may be
48found in the fw-*-api.txt documents.
49
50The timeout value protects the card from a hung driver thread. If the driver
51doesn't handle the completed call within the timeout specified, the firmware
52will reset that mailbox.
53
54To make an API call, the driver iterates over each mailbox looking for the
55first one available (bit 0 has been cleared). The driver sets that bit, fills
56in the command enumerator, the timeout value and any required parameters. The
57driver then sets the parameter ready bit (bit 1). The firmware scans the
58mailboxes for pending commands, processes them, sets the result code, populates
59the result value array with that call's return values and sets the call
60complete bit (bit 2). Once bit 2 is set, the driver should retrieve the results
61and clear all the flags. If the driver does not perform this task within the
62time set in the timeout register, the firmware will reset that mailbox.
63
64Event notifications are sent from the firmware to the host. The host tells the
65firmware which events it is interested in via an API call. That call tells the
66firmware which notification mailbox to use. The firmware signals the host via
67an interrupt. Only the 16 Results fields are used, the Flags, Command, Return
68value and Timeout words are not used.
69
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-api.txt b/Documentation/video4linux/cx2341x/fw-decoder-api.txt
deleted file mode 100644
index 8c317b7a4fc9..000000000000
--- a/Documentation/video4linux/cx2341x/fw-decoder-api.txt
+++ /dev/null
@@ -1,297 +0,0 @@
1Decoder firmware API description
2================================
3
4Note: this API is part of the decoder firmware, so it's cx23415 only.
5
6-------------------------------------------------------------------------------
7
8Name CX2341X_DEC_PING_FW
9Enum 0/0x00
10Description
11 This API call does nothing. It may be used to check if the firmware
12 is responding.
13
14-------------------------------------------------------------------------------
15
16Name CX2341X_DEC_START_PLAYBACK
17Enum 1/0x01
18Description
19 Begin or resume playback.
20Param[0]
21 0 based frame number in GOP to begin playback from.
22Param[1]
23 Specifies the number of muted audio frames to play before normal
24 audio resumes. (This is not implemented in the firmware, leave at 0)
25
26-------------------------------------------------------------------------------
27
28Name CX2341X_DEC_STOP_PLAYBACK
29Enum 2/0x02
30Description
31 Ends playback and clears all decoder buffers. If PTS is not zero,
32 playback stops at specified PTS.
33Param[0]
34 Display 0=last frame, 1=black
35 Note: this takes effect immediately, so if you want to wait for a PTS,
36 then use '0', otherwise the screen goes to black at once.
37 You can call this later (even if there is no playback) with a 1 value
38 to set the screen to black.
39Param[1]
40 PTS low
41Param[2]
42 PTS high
43
44-------------------------------------------------------------------------------
45
46Name CX2341X_DEC_SET_PLAYBACK_SPEED
47Enum 3/0x03
48Description
49 Playback stream at speed other than normal. There are two modes of
50 operation:
51 Smooth: host transfers entire stream and firmware drops unused
52 frames.
53 Coarse: host drops frames based on indexing as required to achieve
54 desired speed.
55Param[0]
56 Bitmap:
57 0:7 0 normal
58 1 fast only "1.5 times"
59 n nX fast, 1/nX slow
60 30 Framedrop:
61 '0' during 1.5 times play, every other B frame is dropped
62 '1' during 1.5 times play, stream is unchanged (bitrate
63 must not exceed 8mbps)
64 31 Speed:
65 '0' slow
66 '1' fast
67 Note: n is limited to 2. Anything higher does not result in
68 faster playback. Instead the host should start dropping frames.
69Param[1]
70 Direction: 0=forward, 1=reverse
71 Note: to make reverse playback work you have to write full GOPs in
72 reverse order.
73Param[2]
74 Picture mask:
75 1=I frames
76 3=I, P frames
77 7=I, P, B frames
78Param[3]
79 B frames per GOP (for reverse play only)
80 Note: for reverse playback the Picture Mask should be set to I or I, P.
81 Adding B frames to the mask will result in corrupt video. This field
82 has to be set to the correct value in order to keep the timing correct.
83Param[4]
84 Mute audio: 0=disable, 1=enable
85Param[5]
86 Display 0=frame, 1=field
87Param[6]
88 Specifies the number of muted audio frames to play before normal audio
89 resumes. (Not implemented in the firmware, leave at 0)
90
91-------------------------------------------------------------------------------
92
93Name CX2341X_DEC_STEP_VIDEO
94Enum 5/0x05
95Description
96 Each call to this API steps the playback to the next unit defined below
97 in the current playback direction.
98Param[0]
99 0=frame, 1=top field, 2=bottom field
100
101-------------------------------------------------------------------------------
102
103Name CX2341X_DEC_SET_DMA_BLOCK_SIZE
104Enum 8/0x08
105Description
106 Set DMA transfer block size. Counterpart to API 0xC9
107Param[0]
108 DMA transfer block size in bytes. A different size may be specified
109 when issuing the DMA transfer command.
110
111-------------------------------------------------------------------------------
112
113Name CX2341X_DEC_GET_XFER_INFO
114Enum 9/0x09
115Description
116 This API call may be used to detect an end of stream condition.
117Result[0]
118 Stream type
119Result[1]
120 Address offset
121Result[2]
122 Maximum bytes to transfer
123Result[3]
124 Buffer fullness
125
126-------------------------------------------------------------------------------
127
128Name CX2341X_DEC_GET_DMA_STATUS
129Enum 10/0x0A
130Description
131 Status of the last DMA transfer
132Result[0]
133 Bit 1 set means transfer complete
134 Bit 2 set means DMA error
135 Bit 3 set means linked list error
136Result[1]
137 DMA type: 0=MPEG, 1=OSD, 2=YUV
138
139-------------------------------------------------------------------------------
140
141Name CX2341X_DEC_SCHED_DMA_FROM_HOST
142Enum 11/0x0B
143Description
144 Setup DMA from host operation. Counterpart to API 0xCC
145Param[0]
146 Memory address of link list
147Param[1]
148 Total # of bytes to transfer
149Param[2]
150 DMA type (0=MPEG, 1=OSD, 2=YUV)
151
152-------------------------------------------------------------------------------
153
154Name CX2341X_DEC_PAUSE_PLAYBACK
155Enum 13/0x0D
156Description
157 Freeze playback immediately. In this mode, when internal buffers are
158 full, no more data will be accepted and data request IRQs will be
159 masked.
160Param[0]
161 Display: 0=last frame, 1=black
162
163-------------------------------------------------------------------------------
164
165Name CX2341X_DEC_HALT_FW
166Enum 14/0x0E
167Description
168 The firmware is halted and no further API calls are serviced until
169 the firmware is uploaded again.
170
171-------------------------------------------------------------------------------
172
173Name CX2341X_DEC_SET_STANDARD
174Enum 16/0x10
175Description
176 Selects display standard
177Param[0]
178 0=NTSC, 1=PAL
179
180-------------------------------------------------------------------------------
181
182Name CX2341X_DEC_GET_VERSION
183Enum 17/0x11
184Description
185 Returns decoder firmware version information
186Result[0]
187 Version bitmask:
188 Bits 0:15 build
189 Bits 16:23 minor
190 Bits 24:31 major
191
192-------------------------------------------------------------------------------
193
194Name CX2341X_DEC_SET_STREAM_INPUT
195Enum 20/0x14
196Description
197 Select decoder stream input port
198Param[0]
199 0=memory (default), 1=streaming
200
201-------------------------------------------------------------------------------
202
203Name CX2341X_DEC_GET_TIMING_INFO
204Enum 21/0x15
205Description
206 Returns timing information from start of playback
207Result[0]
208 Frame count by decode order
209Result[1]
210 Video PTS bits 0:31 by display order
211Result[2]
212 Video PTS bit 32 by display order
213Result[3]
214 SCR bits 0:31 by display order
215Result[4]
216 SCR bit 32 by display order
217
218-------------------------------------------------------------------------------
219
220Name CX2341X_DEC_SET_AUDIO_MODE
221Enum 22/0x16
222Description
223 Select audio mode
224Param[0]
225 Dual mono mode action
226 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
227Param[1]
228 Stereo mode action:
229 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
230
231-------------------------------------------------------------------------------
232
233Name CX2341X_DEC_SET_EVENT_NOTIFICATION
234Enum 23/0x17
235Description
236 Setup firmware to notify the host about a particular event.
237 Counterpart to API 0xD5
238Param[0]
239 Event: 0=Audio mode change between mono, (joint) stereo and dual channel.
240 Event: 3=Decoder started
241 Event: 4=Unknown: goes off 10-15 times per second while decoding.
242 Event: 5=Some sync event: goes off once per frame.
243Param[1]
244 Notification 0=disabled, 1=enabled
245Param[2]
246 Interrupt bit
247Param[3]
248 Mailbox slot, -1 if no mailbox required.
249
250-------------------------------------------------------------------------------
251
252Name CX2341X_DEC_SET_DISPLAY_BUFFERS
253Enum 24/0x18
254Description
255 Number of display buffers. To decode all frames in reverse playback you
256 must use nine buffers.
257Param[0]
258 0=six buffers, 1=nine buffers
259
260-------------------------------------------------------------------------------
261
262Name CX2341X_DEC_EXTRACT_VBI
263Enum 25/0x19
264Description
265 Extracts VBI data
266Param[0]
267 0=extract from extension & user data, 1=extract from private packets
268Result[0]
269 VBI table location
270Result[1]
271 VBI table size
272
273-------------------------------------------------------------------------------
274
275Name CX2341X_DEC_SET_DECODER_SOURCE
276Enum 26/0x1A
277Description
278 Selects decoder source. Ensure that the parameters passed to this
279 API match the encoder settings.
280Param[0]
281 Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
282Param[1]
283 YUV picture width
284Param[2]
285 YUV picture height
286Param[3]
287 Bitmap: see Param[0] of API 0xBD
288
289-------------------------------------------------------------------------------
290
291Name CX2341X_DEC_SET_PREBUFFERING
292Enum 30/0x1E
293Description
294 Decoder prebuffering, when enabled up to 128KB are buffered for
295 streams <8mpbs or 640KB for streams >8mbps
296Param[0]
297 0=off, 1=on
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-regs.txt b/Documentation/video4linux/cx2341x/fw-decoder-regs.txt
deleted file mode 100644
index cf52c8f20b9e..000000000000
--- a/Documentation/video4linux/cx2341x/fw-decoder-regs.txt
+++ /dev/null
@@ -1,817 +0,0 @@
1PVR350 Video decoder registers 0x02002800 -> 0x02002B00
2=======================================================
3
4This list has been worked out through trial and error. There will be mistakes
5and omissions. Some registers have no obvious effect so it's hard to say what
6they do, while others interact with each other, or require a certain load
7sequence. Horizontal filter setup is one example, with six registers working
8in unison and requiring a certain load sequence to correctly configure. The
9indexed colour palette is much easier to set at just two registers, but again
10it requires a certain load sequence.
11
12Some registers are fussy about what they are set to. Load in a bad value & the
13decoder will fail. A firmware reload will often recover, but sometimes a reset
14is required. For registers containing size information, setting them to 0 is
15generally a bad idea. For other control registers i.e. 2878, you'll only find
16out what values are bad when it hangs.
17
18--------------------------------------------------------------------------------
192800
20 bit 0
21 Decoder enable
22 0 = disable
23 1 = enable
24--------------------------------------------------------------------------------
252804
26 bits 0:31
27 Decoder horizontal Y alias register 1
28---------------
292808
30 bits 0:31
31 Decoder horizontal Y alias register 2
32---------------
33280C
34 bits 0:31
35 Decoder horizontal Y alias register 3
36---------------
372810
38 bits 0:31
39 Decoder horizontal Y alias register 4
40---------------
412814
42 bits 0:31
43 Decoder horizontal Y alias register 5
44---------------
452818
46 bits 0:31
47 Decoder horizontal Y alias trigger
48
49 These six registers control the horizontal aliasing filter for the Y plane.
50 The first five registers must all be loaded before accessing the trigger
51 (2818), as this register actually clocks the data through for the first
52 five.
53
54 To correctly program set the filter, this whole procedure must be done 16
55 times. The actual register contents are copied from a lookup-table in the
56 firmware which contains 4 different filter settings.
57
58--------------------------------------------------------------------------------
59281C
60 bits 0:31
61 Decoder horizontal UV alias register 1
62---------------
632820
64 bits 0:31
65 Decoder horizontal UV alias register 2
66---------------
672824
68 bits 0:31
69 Decoder horizontal UV alias register 3
70---------------
712828
72 bits 0:31
73 Decoder horizontal UV alias register 4
74---------------
75282C
76 bits 0:31
77 Decoder horizontal UV alias register 5
78---------------
792830
80 bits 0:31
81 Decoder horizontal UV alias trigger
82
83 These six registers control the horizontal aliasing for the UV plane.
84 Operation is the same as the Y filter, with 2830 being the trigger
85 register.
86
87--------------------------------------------------------------------------------
882834
89 bits 0:15
90 Decoder Y source width in pixels
91
92 bits 16:31
93 Decoder Y destination width in pixels
94---------------
952838
96 bits 0:15
97 Decoder UV source width in pixels
98
99 bits 16:31
100 Decoder UV destination width in pixels
101
102 NOTE: For both registers, the resulting image must be fully visible on
103 screen. If the image exceeds the right edge both the source and destination
104 size must be adjusted to reflect the visible portion. For the source width,
105 you must take into account the scaling when calculating the new value.
106--------------------------------------------------------------------------------
107
108283C
109 bits 0:31
110 Decoder Y horizontal scaling
111 Normally = Reg 2854 >> 2
112---------------
1132840
114 bits 0:31
115 Decoder ?? unknown - horizontal scaling
116 Usually 0x00080514
117---------------
1182844
119 bits 0:31
120 Decoder UV horizontal scaling
121 Normally = Reg 2854 >> 2
122---------------
1232848
124 bits 0:31
125 Decoder ?? unknown - horizontal scaling
126 Usually 0x00100514
127---------------
128284C
129 bits 0:31
130 Decoder ?? unknown - Y plane
131 Usually 0x00200020
132---------------
1332850
134 bits 0:31
135 Decoder ?? unknown - UV plane
136 Usually 0x00200020
137---------------
1382854
139 bits 0:31
140 Decoder 'master' value for horizontal scaling
141---------------
1422858
143 bits 0:31
144 Decoder ?? unknown
145 Usually 0
146---------------
147285C
148 bits 0:31
149 Decoder ?? unknown
150 Normally = Reg 2854 >> 1
151---------------
1522860
153 bits 0:31
154 Decoder ?? unknown
155 Usually 0
156---------------
1572864
158 bits 0:31
159 Decoder ?? unknown
160 Normally = Reg 2854 >> 1
161---------------
1622868
163 bits 0:31
164 Decoder ?? unknown
165 Usually 0
166
167 Most of these registers either control horizontal scaling, or appear linked
168 to it in some way. Register 2854 contains the 'master' value & the other
169 registers can be calculated from that one. You must also remember to
170 correctly set the divider in Reg 2874.
171
172 To enlarge:
173 Reg 2854 = (source_width * 0x00200000) / destination_width
174 Reg 2874 = No divide
175
176 To reduce from full size down to half size:
177 Reg 2854 = (source_width/2 * 0x00200000) / destination width
178 Reg 2874 = Divide by 2
179
180 To reduce from half size down to quarter size:
181 Reg 2854 = (source_width/4 * 0x00200000) / destination width
182 Reg 2874 = Divide by 4
183
184 The result is always rounded up.
185
186--------------------------------------------------------------------------------
187286C
188 bits 0:15
189 Decoder horizontal Y buffer offset
190
191 bits 15:31
192 Decoder horizontal UV buffer offset
193
194 Offset into the video image buffer. If the offset is gradually incremented,
195 the on screen image will move left & wrap around higher up on the right.
196
197--------------------------------------------------------------------------------
1982870
199 bits 0:15
200 Decoder horizontal Y output offset
201
202 bits 16:31
203 Decoder horizontal UV output offset
204
205 Offsets the actual video output. Controls output alignment of the Y & UV
206 planes. The higher the value, the greater the shift to the left. Use
207 reg 2890 to move the image right.
208
209--------------------------------------------------------------------------------
2102874
211 bits 0:1
212 Decoder horizontal Y output size divider
213 00 = No divide
214 01 = Divide by 2
215 10 = Divide by 3
216
217 bits 4:5
218 Decoder horizontal UV output size divider
219 00 = No divide
220 01 = Divide by 2
221 10 = Divide by 3
222
223 bit 8
224 Decoder ?? unknown
225 0 = Normal
226 1 = Affects video output levels
227
228 bit 16
229 Decoder ?? unknown
230 0 = Normal
231 1 = Disable horizontal filter
232
233--------------------------------------------------------------------------------
2342878
235 bit 0
236 ?? unknown
237
238 bit 1
239 osd on/off
240 0 = osd off
241 1 = osd on
242
243 bit 2
244 Decoder + osd video timing
245 0 = NTSC
246 1 = PAL
247
248 bits 3:4
249 ?? unknown
250
251 bit 5
252 Decoder + osd
253 Swaps upper & lower fields
254
255--------------------------------------------------------------------------------
256287C
257 bits 0:10
258 Decoder & osd ?? unknown
259 Moves entire screen horizontally. Starts at 0x005 with the screen
260 shifted heavily to the right. Incrementing in steps of 0x004 will
261 gradually shift the screen to the left.
262
263 bits 11:31
264 ?? unknown
265
266 Normally contents are 0x00101111 (NTSC) or 0x1010111d (PAL)
267
268--------------------------------------------------------------------------------
2692880 -------- ?? unknown
2702884 -------- ?? unknown
271--------------------------------------------------------------------------------
2722888
273 bit 0
274 Decoder + osd ?? unknown
275 0 = Normal
276 1 = Misaligned fields (Correctable through 289C & 28A4)
277
278 bit 4
279 ?? unknown
280
281 bit 8
282 ?? unknown
283
284 Warning: Bad values will require a firmware reload to recover.
285 Known to be bad are 0x000,0x011,0x100,0x111
286--------------------------------------------------------------------------------
287288C
288 bits 0:15
289 osd ?? unknown
290 Appears to affect the osd position stability. The higher the value the
291 more unstable it becomes. Decoder output remains stable.
292
293 bits 16:31
294 osd ?? unknown
295 Same as bits 0:15
296
297--------------------------------------------------------------------------------
2982890
299 bits 0:11
300 Decoder output horizontal offset.
301
302 Horizontal offset moves the video image right. A small left shift is
303 possible, but it's better to use reg 2870 for that due to its greater
304 range.
305
306 NOTE: Video corruption will occur if video window is shifted off the right
307 edge. To avoid this read the notes for 2834 & 2838.
308--------------------------------------------------------------------------------
3092894
310 bits 0:23
311 Decoder output video surround colour.
312
313 Contains the colour (in yuv) used to fill the screen when the video is
314 running in a window.
315--------------------------------------------------------------------------------
3162898
317 bits 0:23
318 Decoder video window colour
319 Contains the colour (in yuv) used to fill the video window when the
320 video is turned off.
321
322 bit 24
323 Decoder video output
324 0 = Video on
325 1 = Video off
326
327 bit 28
328 Decoder plane order
329 0 = Y,UV
330 1 = UV,Y
331
332 bit 29
333 Decoder second plane byte order
334 0 = Normal (UV)
335 1 = Swapped (VU)
336
337 In normal usage, the first plane is Y & the second plane is UV. Though the
338 order of the planes can be swapped, only the byte order of the second plane
339 can be swapped. This isn't much use for the Y plane, but can be useful for
340 the UV plane.
341
342--------------------------------------------------------------------------------
343289C
344 bits 0:15
345 Decoder vertical field offset 1
346
347 bits 16:31
348 Decoder vertical field offset 2
349
350 Controls field output vertical alignment. The higher the number, the lower
351 the image on screen. Known starting values are 0x011E0017 (NTSC) &
352 0x01500017 (PAL)
353--------------------------------------------------------------------------------
35428A0
355 bits 0:15
356 Decoder & osd width in pixels
357
358 bits 16:31
359 Decoder & osd height in pixels
360
361 All output from the decoder & osd are disabled beyond this area. Decoder
362 output will simply go black outside of this region. If the osd tries to
363 exceed this area it will become corrupt.
364--------------------------------------------------------------------------------
36528A4
366 bits 0:11
367 osd left shift.
368
369 Has a range of 0x770->0x7FF. With the exception of 0, any value outside of
370 this range corrupts the osd.
371--------------------------------------------------------------------------------
37228A8
373 bits 0:15
374 osd vertical field offset 1
375
376 bits 16:31
377 osd vertical field offset 2
378
379 Controls field output vertical alignment. The higher the number, the lower
380 the image on screen. Known starting values are 0x011E0017 (NTSC) &
381 0x01500017 (PAL)
382--------------------------------------------------------------------------------
38328AC -------- ?? unknown
384 |
385 V
38628BC -------- ?? unknown
387--------------------------------------------------------------------------------
38828C0
389 bit 0
390 Current output field
391 0 = first field
392 1 = second field
393
394 bits 16:31
395 Current scanline
396 The scanline counts from the top line of the first field
397 through to the last line of the second field.
398--------------------------------------------------------------------------------
39928C4 -------- ?? unknown
400 |
401 V
40228F8 -------- ?? unknown
403--------------------------------------------------------------------------------
40428FC
405 bit 0
406 ?? unknown
407 0 = Normal
408 1 = Breaks decoder & osd output
409--------------------------------------------------------------------------------
4102900
411 bits 0:31
412 Decoder vertical Y alias register 1
413---------------
4142904
415 bits 0:31
416 Decoder vertical Y alias register 2
417---------------
4182908
419 bits 0:31
420 Decoder vertical Y alias trigger
421
422 These three registers control the vertical aliasing filter for the Y plane.
423 Operation is similar to the horizontal Y filter (2804). The only real
424 difference is that there are only two registers to set before accessing
425 the trigger register (2908). As for the horizontal filter, the values are
426 taken from a lookup table in the firmware, and the procedure must be
427 repeated 16 times to fully program the filter.
428--------------------------------------------------------------------------------
429290C
430 bits 0:31
431 Decoder vertical UV alias register 1
432---------------
4332910
434 bits 0:31
435 Decoder vertical UV alias register 2
436---------------
4372914
438 bits 0:31
439 Decoder vertical UV alias trigger
440
441 These three registers control the vertical aliasing filter for the UV
442 plane. Operation is the same as the Y filter, with 2914 being the trigger.
443--------------------------------------------------------------------------------
4442918
445 bits 0:15
446 Decoder Y source height in pixels
447
448 bits 16:31
449 Decoder Y destination height in pixels
450---------------
451291C
452 bits 0:15
453 Decoder UV source height in pixels divided by 2
454
455 bits 16:31
456 Decoder UV destination height in pixels
457
458 NOTE: For both registers, the resulting image must be fully visible on
459 screen. If the image exceeds the bottom edge both the source and
460 destination size must be adjusted to reflect the visible portion. For the
461 source height, you must take into account the scaling when calculating the
462 new value.
463--------------------------------------------------------------------------------
4642920
465 bits 0:31
466 Decoder Y vertical scaling
467 Normally = Reg 2930 >> 2
468---------------
4692924
470 bits 0:31
471 Decoder Y vertical scaling
472 Normally = Reg 2920 + 0x514
473---------------
4742928
475 bits 0:31
476 Decoder UV vertical scaling
477 When enlarging = Reg 2930 >> 2
478 When reducing = Reg 2930 >> 3
479---------------
480292C
481 bits 0:31
482 Decoder UV vertical scaling
483 Normally = Reg 2928 + 0x514
484---------------
4852930
486 bits 0:31
487 Decoder 'master' value for vertical scaling
488---------------
4892934
490 bits 0:31
491 Decoder ?? unknown - Y vertical scaling
492---------------
4932938
494 bits 0:31
495 Decoder Y vertical scaling
496 Normally = Reg 2930
497---------------
498293C
499 bits 0:31
500 Decoder ?? unknown - Y vertical scaling
501---------------
5022940
503 bits 0:31
504 Decoder UV vertical scaling
505 When enlarging = Reg 2930 >> 1
506 When reducing = Reg 2930
507---------------
5082944
509 bits 0:31
510 Decoder ?? unknown - UV vertical scaling
511---------------
5122948
513 bits 0:31
514 Decoder UV vertical scaling
515 Normally = Reg 2940
516---------------
517294C
518 bits 0:31
519 Decoder ?? unknown - UV vertical scaling
520
521 Most of these registers either control vertical scaling, or appear linked
522 to it in some way. Register 2930 contains the 'master' value & all other
523 registers can be calculated from that one. You must also remember to
524 correctly set the divider in Reg 296C
525
526 To enlarge:
527 Reg 2930 = (source_height * 0x00200000) / destination_height
528 Reg 296C = No divide
529
530 To reduce from full size down to half size:
531 Reg 2930 = (source_height/2 * 0x00200000) / destination height
532 Reg 296C = Divide by 2
533
534 To reduce from half down to quarter.
535 Reg 2930 = (source_height/4 * 0x00200000) / destination height
536 Reg 296C = Divide by 4
537
538--------------------------------------------------------------------------------
5392950
540 bits 0:15
541 Decoder Y line index into display buffer, first field
542
543 bits 16:31
544 Decoder Y vertical line skip, first field
545--------------------------------------------------------------------------------
5462954
547 bits 0:15
548 Decoder Y line index into display buffer, second field
549
550 bits 16:31
551 Decoder Y vertical line skip, second field
552--------------------------------------------------------------------------------
5532958
554 bits 0:15
555 Decoder UV line index into display buffer, first field
556
557 bits 16:31
558 Decoder UV vertical line skip, first field
559--------------------------------------------------------------------------------
560295C
561 bits 0:15
562 Decoder UV line index into display buffer, second field
563
564 bits 16:31
565 Decoder UV vertical line skip, second field
566--------------------------------------------------------------------------------
5672960
568 bits 0:15
569 Decoder destination height minus 1
570
571 bits 16:31
572 Decoder destination height divided by 2
573--------------------------------------------------------------------------------
5742964
575 bits 0:15
576 Decoder Y vertical offset, second field
577
578 bits 16:31
579 Decoder Y vertical offset, first field
580
581 These two registers shift the Y plane up. The higher the number, the
582 greater the shift.
583--------------------------------------------------------------------------------
5842968
585 bits 0:15
586 Decoder UV vertical offset, second field
587
588 bits 16:31
589 Decoder UV vertical offset, first field
590
591 These two registers shift the UV plane up. The higher the number, the
592 greater the shift.
593--------------------------------------------------------------------------------
594296C
595 bits 0:1
596 Decoder vertical Y output size divider
597 00 = No divide
598 01 = Divide by 2
599 10 = Divide by 4
600
601 bits 8:9
602 Decoder vertical UV output size divider
603 00 = No divide
604 01 = Divide by 2
605 10 = Divide by 4
606--------------------------------------------------------------------------------
6072970
608 bit 0
609 Decoder ?? unknown
610 0 = Normal
611 1 = Affect video output levels
612
613 bit 16
614 Decoder ?? unknown
615 0 = Normal
616 1 = Disable vertical filter
617
618--------------------------------------------------------------------------------
6192974 -------- ?? unknown
620 |
621 V
62229EF -------- ?? unknown
623--------------------------------------------------------------------------------
6242A00
625 bits 0:2
626 osd colour mode
627 000 = 8 bit indexed
628 001 = 16 bit (565)
629 010 = 15 bit (555)
630 011 = 12 bit (444)
631 100 = 32 bit (8888)
632
633 bits 4:5
634 osd display bpp
635 01 = 8 bit
636 10 = 16 bit
637 11 = 32 bit
638
639 bit 8
640 osd global alpha
641 0 = Off
642 1 = On
643
644 bit 9
645 osd local alpha
646 0 = Off
647 1 = On
648
649 bit 10
650 osd colour key
651 0 = Off
652 1 = On
653
654 bit 11
655 osd ?? unknown
656 Must be 1
657
658 bit 13
659 osd colour space
660 0 = ARGB
661 1 = AYVU
662
663 bits 16:31
664 osd ?? unknown
665 Must be 0x001B (some kind of buffer pointer ?)
666
667 When the bits-per-pixel is set to 8, the colour mode is ignored and
668 assumed to be 8 bit indexed. For 16 & 32 bits-per-pixel the colour depth
669 is honoured, and when using a colour depth that requires fewer bytes than
670 allocated the extra bytes are used as padding. So for a 32 bpp with 8 bit
671 index colour, there are 3 padding bytes per pixel. It's also possible to
672 select 16bpp with a 32 bit colour mode. This results in the pixel width
673 being doubled, but the color key will not work as expected in this mode.
674
675 Colour key is as it suggests. You designate a colour which will become
676 completely transparent. When using 565, 555 or 444 colour modes, the
677 colour key is always 16 bits wide. The colour to key on is set in Reg 2A18.
678
679 Local alpha works differently depending on the colour mode. For 32bpp & 8
680 bit indexed, local alpha is a per-pixel 256 step transparency, with 0 being
681 transparent and 255 being solid. For the 16bpp modes 555 & 444, the unused
682 bit(s) act as a simple transparency switch, with 0 being solid & 1 being
683 fully transparent. There is no local alpha support for 16bit 565.
684
685 Global alpha is a 256 step transparency that applies to the entire osd,
686 with 0 being transparent & 255 being solid.
687
688 It's possible to combine colour key, local alpha & global alpha.
689--------------------------------------------------------------------------------
6902A04
691 bits 0:15
692 osd x coord for left edge
693
694 bits 16:31
695 osd y coord for top edge
696---------------
6972A08
698 bits 0:15
699 osd x coord for right edge
700
701 bits 16:31
702 osd y coord for bottom edge
703
704 For both registers, (0,0) = top left corner of the display area. These
705 registers do not control the osd size, only where it's positioned & how
706 much is visible. The visible osd area cannot exceed the right edge of the
707 display, otherwise the osd will become corrupt. See reg 2A10 for
708 setting osd width.
709--------------------------------------------------------------------------------
7102A0C
711 bits 0:31
712 osd buffer index
713
714 An index into the osd buffer. Slowly incrementing this moves the osd left,
715 wrapping around onto the right edge
716--------------------------------------------------------------------------------
7172A10
718 bits 0:11
719 osd buffer 32 bit word width
720
721 Contains the width of the osd measured in 32 bit words. This means that all
722 colour modes are restricted to a byte width which is divisible by 4.
723--------------------------------------------------------------------------------
7242A14
725 bits 0:15
726 osd height in pixels
727
728 bits 16:32
729 osd line index into buffer
730 osd will start displaying from this line.
731--------------------------------------------------------------------------------
7322A18
733 bits 0:31
734 osd colour key
735
736 Contains the colour value which will be transparent.
737--------------------------------------------------------------------------------
7382A1C
739 bits 0:7
740 osd global alpha
741
742 Contains the global alpha value (equiv ivtvfbctl --alpha XX)
743--------------------------------------------------------------------------------
7442A20 -------- ?? unknown
745 |
746 V
7472A2C -------- ?? unknown
748--------------------------------------------------------------------------------
7492A30
750 bits 0:7
751 osd colour to change in indexed palette
752---------------
7532A34
754 bits 0:31
755 osd colour for indexed palette
756
757 To set the new palette, first load the index of the colour to change into
758 2A30, then load the new colour into 2A34. The full palette is 256 colours,
759 so the index range is 0x00-0xFF
760--------------------------------------------------------------------------------
7612A38 -------- ?? unknown
7622A3C -------- ?? unknown
763--------------------------------------------------------------------------------
7642A40
765 bits 0:31
766 osd ?? unknown
767
768 Affects overall brightness, wrapping around to black
769--------------------------------------------------------------------------------
7702A44
771 bits 0:31
772 osd ?? unknown
773
774 Green tint
775--------------------------------------------------------------------------------
7762A48
777 bits 0:31
778 osd ?? unknown
779
780 Red tint
781--------------------------------------------------------------------------------
7822A4C
783 bits 0:31
784 osd ?? unknown
785
786 Affects overall brightness, wrapping around to black
787--------------------------------------------------------------------------------
7882A50
789 bits 0:31
790 osd ?? unknown
791
792 Colour shift
793--------------------------------------------------------------------------------
7942A54
795 bits 0:31
796 osd ?? unknown
797
798 Colour shift
799--------------------------------------------------------------------------------
8002A58 -------- ?? unknown
801 |
802 V
8032AFC -------- ?? unknown
804--------------------------------------------------------------------------------
8052B00
806 bit 0
807 osd filter control
808 0 = filter off
809 1 = filter on
810
811 bits 1:4
812 osd ?? unknown
813
814--------------------------------------------------------------------------------
815
816v0.4 - 12 March 2007 - Ian Armstrong (ian@iarmst.demon.co.uk)
817
diff --git a/Documentation/video4linux/cx2341x/fw-dma.txt b/Documentation/video4linux/cx2341x/fw-dma.txt
deleted file mode 100644
index be52b6fd1e9a..000000000000
--- a/Documentation/video4linux/cx2341x/fw-dma.txt
+++ /dev/null
@@ -1,96 +0,0 @@
1This page describes the structures and procedures used by the cx2341x DMA
2engine.
3
4Introduction
5============
6
7The cx2341x PCI interface is busmaster capable. This means it has a DMA
8engine to efficiently transfer large volumes of data between the card and main
9memory without requiring help from a CPU. Like most hardware, it must operate
10on contiguous physical memory. This is difficult to come by in large quantities
11on virtual memory machines.
12
13Therefore, it also supports a technique called "scatter-gather". The card can
14transfer multiple buffers in one operation. Instead of allocating one large
15contiguous buffer, the driver can allocate several smaller buffers.
16
17In practice, I've seen the average transfer to be roughly 80K, but transfers
18above 128K were not uncommon, particularly at startup. The 128K figure is
19important, because that is the largest block that the kernel can normally
20allocate. Even still, 128K blocks are hard to come by, so the driver writer is
21urged to choose a smaller block size and learn the scatter-gather technique.
22
23Mailbox #10 is reserved for DMA transfer information.
24
25Note: the hardware expects little-endian data ('intel format').
26
27Flow
28====
29
30This section describes, in general, the order of events when handling DMA
31transfers. Detailed information follows this section.
32
33- The card raises the Encoder interrupt.
34- The driver reads the transfer type, offset and size from Mailbox #10.
35- The driver constructs the scatter-gather array from enough free dma buffers
36 to cover the size.
37- The driver schedules the DMA transfer via the ScheduleDMAtoHost API call.
38- The card raises the DMA Complete interrupt.
39- The driver checks the DMA status register for any errors.
40- The driver post-processes the newly transferred buffers.
41
42NOTE! It is possible that the Encoder and DMA Complete interrupts get raised
43simultaneously. (End of the last, start of the next, etc.)
44
45Mailbox #10
46===========
47
48The Flags, Command, Return Value and Timeout fields are ignored.
49
50Name: Mailbox #10
51Results[0]: Type: 0: MPEG.
52Results[1]: Offset: The position relative to the card's memory space.
53Results[2]: Size: The exact number of bytes to transfer.
54
55My speculation is that since the StartCapture API has a capture type of "RAW"
56available, that the type field will have other values that correspond to YUV
57and PCM data.
58
59Scatter-Gather Array
60====================
61
62The scatter-gather array is a contiguously allocated block of memory that
63tells the card the source and destination of each data-block to transfer.
64Card "addresses" are derived from the offset supplied by Mailbox #10. Host
65addresses are the physical memory location of the target DMA buffer.
66
67Each S-G array element is a struct of three 32-bit words. The first word is
68the source address, the second is the destination address. Both take up the
69entire 32 bits. The lowest 18 bits of the third word is the transfer byte
70count. The high-bit of the third word is the "last" flag. The last-flag tells
71the card to raise the DMA_DONE interrupt. From hard personal experience, if
72you forget to set this bit, the card will still "work" but the stream will
73most likely get corrupted.
74
75The transfer count must be a multiple of 256. Therefore, the driver will need
76to track how much data in the target buffer is valid and deal with it
77accordingly.
78
79Array Element:
80
81- 32-bit Source Address
82- 32-bit Destination Address
83- 14-bit reserved (high bit is the last flag)
84- 18-bit byte count
85
86DMA Transfer Status
87===================
88
89Register 0x0004 holds the DMA Transfer Status:
90
91Bit
920 read completed
931 write completed
942 DMA read error
953 DMA write error
964 Scatter-Gather array error
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
deleted file mode 100644
index 5a27af2ee1c6..000000000000
--- a/Documentation/video4linux/cx2341x/fw-encoder-api.txt
+++ /dev/null
@@ -1,709 +0,0 @@
1Encoder firmware API description
2================================
3
4-------------------------------------------------------------------------------
5
6Name CX2341X_ENC_PING_FW
7Enum 128/0x80
8Description
9 Does nothing. Can be used to check if the firmware is responding.
10
11-------------------------------------------------------------------------------
12
13Name CX2341X_ENC_START_CAPTURE
14Enum 129/0x81
15Description
16 Commences the capture of video, audio and/or VBI data. All encoding
17 parameters must be initialized prior to this API call. Captures frames
18 continuously or until a predefined number of frames have been captured.
19Param[0]
20 Capture stream type:
21 0=MPEG
22 1=Raw
23 2=Raw passthrough
24 3=VBI
25
26Param[1]
27 Bitmask:
28 Bit 0 when set, captures YUV
29 Bit 1 when set, captures PCM audio
30 Bit 2 when set, captures VBI (same as param[0]=3)
31 Bit 3 when set, the capture destination is the decoder
32 (same as param[0]=2)
33 Bit 4 when set, the capture destination is the host
34 Note: this parameter is only meaningful for RAW capture type.
35
36-------------------------------------------------------------------------------
37
38Name CX2341X_ENC_STOP_CAPTURE
39Enum 130/0x82
40Description
41 Ends a capture in progress
42Param[0]
43 0=stop at end of GOP (generates IRQ)
44 1=stop immediate (no IRQ)
45Param[1]
46 Stream type to stop, see param[0] of API 0x81
47Param[2]
48 Subtype, see param[1] of API 0x81
49
50-------------------------------------------------------------------------------
51
52Name CX2341X_ENC_SET_AUDIO_ID
53Enum 137/0x89
54Description
55 Assigns the transport stream ID of the encoded audio stream
56Param[0]
57 Audio Stream ID
58
59-------------------------------------------------------------------------------
60
61Name CX2341X_ENC_SET_VIDEO_ID
62Enum 139/0x8B
63Description
64 Set video transport stream ID
65Param[0]
66 Video stream ID
67
68-------------------------------------------------------------------------------
69
70Name CX2341X_ENC_SET_PCR_ID
71Enum 141/0x8D
72Description
73 Assigns the transport stream ID for PCR packets
74Param[0]
75 PCR Stream ID
76
77-------------------------------------------------------------------------------
78
79Name CX2341X_ENC_SET_FRAME_RATE
80Enum 143/0x8F
81Description
82 Set video frames per second. Change occurs at start of new GOP.
83Param[0]
84 0=30fps
85 1=25fps
86
87-------------------------------------------------------------------------------
88
89Name CX2341X_ENC_SET_FRAME_SIZE
90Enum 145/0x91
91Description
92 Select video stream encoding resolution.
93Param[0]
94 Height in lines. Default 480
95Param[1]
96 Width in pixels. Default 720
97
98-------------------------------------------------------------------------------
99
100Name CX2341X_ENC_SET_BIT_RATE
101Enum 149/0x95
102Description
103 Assign average video stream bitrate. Note on the last three params:
104 Param[3] and [4] seem to be always 0, param [5] doesn't seem to be used.
105Param[0]
106 0=variable bitrate, 1=constant bitrate
107Param[1]
108 bitrate in bits per second
109Param[2]
110 peak bitrate in bits per second, divided by 400
111Param[3]
112 Mux bitrate in bits per second, divided by 400. May be 0 (default).
113Param[4]
114 Rate Control VBR Padding
115Param[5]
116 VBV Buffer used by encoder
117
118-------------------------------------------------------------------------------
119
120Name CX2341X_ENC_SET_GOP_PROPERTIES
121Enum 151/0x97
122Description
123 Setup the GOP structure
124Param[0]
125 GOP size (maximum is 34)
126Param[1]
127 Number of B frames between the I and P frame, plus 1.
128 For example: IBBPBBPBBPBB --> GOP size: 12, number of B frames: 2+1 = 3
129 Note that GOP size must be a multiple of (B-frames + 1).
130
131-------------------------------------------------------------------------------
132
133Name CX2341X_ENC_SET_ASPECT_RATIO
134Enum 153/0x99
135Description
136 Sets the encoding aspect ratio. Changes in the aspect ratio take effect
137 at the start of the next GOP.
138Param[0]
139 '0000' forbidden
140 '0001' 1:1 square
141 '0010' 4:3
142 '0011' 16:9
143 '0100' 2.21:1
144 '0101' reserved
145 ....
146 '1111' reserved
147
148-------------------------------------------------------------------------------
149
150Name CX2341X_ENC_SET_DNR_FILTER_MODE
151Enum 155/0x9B
152Description
153 Assign Dynamic Noise Reduction operating mode
154Param[0]
155 Bit0: Spatial filter, set=auto, clear=manual
156 Bit1: Temporal filter, set=auto, clear=manual
157Param[1]
158 Median filter:
159 0=Disabled
160 1=Horizontal
161 2=Vertical
162 3=Horiz/Vert
163 4=Diagonal
164
165-------------------------------------------------------------------------------
166
167Name CX2341X_ENC_SET_DNR_FILTER_PROPS
168Enum 157/0x9D
169Description
170 These Dynamic Noise Reduction filter values are only meaningful when
171 the respective filter is set to "manual" (See API 0x9B)
172Param[0]
173 Spatial filter: default 0, range 0:15
174Param[1]
175 Temporal filter: default 0, range 0:31
176
177-------------------------------------------------------------------------------
178
179Name CX2341X_ENC_SET_CORING_LEVELS
180Enum 159/0x9F
181Description
182 Assign Dynamic Noise Reduction median filter properties.
183Param[0]
184 Threshold above which the luminance median filter is enabled.
185 Default: 0, range 0:255
186Param[1]
187 Threshold below which the luminance median filter is enabled.
188 Default: 255, range 0:255
189Param[2]
190 Threshold above which the chrominance median filter is enabled.
191 Default: 0, range 0:255
192Param[3]
193 Threshold below which the chrominance median filter is enabled.
194 Default: 255, range 0:255
195
196-------------------------------------------------------------------------------
197
198Name CX2341X_ENC_SET_SPATIAL_FILTER_TYPE
199Enum 161/0xA1
200Description
201 Assign spatial prefilter parameters
202Param[0]
203 Luminance filter
204 0=Off
205 1=1D Horizontal
206 2=1D Vertical
207 3=2D H/V Separable (default)
208 4=2D Symmetric non-separable
209Param[1]
210 Chrominance filter
211 0=Off
212 1=1D Horizontal (default)
213
214-------------------------------------------------------------------------------
215
216Name CX2341X_ENC_SET_VBI_LINE
217Enum 183/0xB7
218Description
219 Selects VBI line number.
220Param[0]
221 Bits 0:4 line number
222 Bit 31 0=top_field, 1=bottom_field
223 Bits 0:31 all set specifies "all lines"
224Param[1]
225 VBI line information features: 0=disabled, 1=enabled
226Param[2]
227 Slicing: 0=None, 1=Closed Caption
228 Almost certainly not implemented. Set to 0.
229Param[3]
230 Luminance samples in this line.
231 Almost certainly not implemented. Set to 0.
232Param[4]
233 Chrominance samples in this line
234 Almost certainly not implemented. Set to 0.
235
236-------------------------------------------------------------------------------
237
238Name CX2341X_ENC_SET_STREAM_TYPE
239Enum 185/0xB9
240Description
241 Assign stream type
242 Note: Transport stream is not working in recent firmwares.
243 And in older firmwares the timestamps in the TS seem to be
244 unreliable.
245Param[0]
246 0=Program stream
247 1=Transport stream
248 2=MPEG1 stream
249 3=PES A/V stream
250 5=PES Video stream
251 7=PES Audio stream
252 10=DVD stream
253 11=VCD stream
254 12=SVCD stream
255 13=DVD_S1 stream
256 14=DVD_S2 stream
257
258-------------------------------------------------------------------------------
259
260Name CX2341X_ENC_SET_OUTPUT_PORT
261Enum 187/0xBB
262Description
263 Assign stream output port. Normally 0 when the data is copied through
264 the PCI bus (DMA), and 1 when the data is streamed to another chip
265 (pvrusb and cx88-blackbird).
266Param[0]
267 0=Memory (default)
268 1=Streaming
269 2=Serial
270Param[1]
271 Unknown, but leaving this to 0 seems to work best. Indications are that
272 this might have to do with USB support, although passing anything but 0
273 only breaks things.
274
275-------------------------------------------------------------------------------
276
277Name CX2341X_ENC_SET_AUDIO_PROPERTIES
278Enum 189/0xBD
279Description
280 Set audio stream properties, may be called while encoding is in progress.
281 Note: all bitfields are consistent with ISO11172 documentation except
282 bits 2:3 which ISO docs define as:
283 '11' Layer I
284 '10' Layer II
285 '01' Layer III
286 '00' Undefined
287 This discrepancy may indicate a possible error in the documentation.
288 Testing indicated that only Layer II is actually working, and that
289 the minimum bitrate should be 192 kbps.
290Param[0]
291 Bitmask:
292 0:1 '00' 44.1Khz
293 '01' 48Khz
294 '10' 32Khz
295 '11' reserved
296
297 2:3 '01'=Layer I
298 '10'=Layer II
299
300 4:7 Bitrate:
301 Index | Layer I | Layer II
302 ------+-------------+------------
303 '0000' | free format | free format
304 '0001' | 32 kbit/s | 32 kbit/s
305 '0010' | 64 kbit/s | 48 kbit/s
306 '0011' | 96 kbit/s | 56 kbit/s
307 '0100' | 128 kbit/s | 64 kbit/s
308 '0101' | 160 kbit/s | 80 kbit/s
309 '0110' | 192 kbit/s | 96 kbit/s
310 '0111' | 224 kbit/s | 112 kbit/s
311 '1000' | 256 kbit/s | 128 kbit/s
312 '1001' | 288 kbit/s | 160 kbit/s
313 '1010' | 320 kbit/s | 192 kbit/s
314 '1011' | 352 kbit/s | 224 kbit/s
315 '1100' | 384 kbit/s | 256 kbit/s
316 '1101' | 416 kbit/s | 320 kbit/s
317 '1110' | 448 kbit/s | 384 kbit/s
318 Note: For Layer II, not all combinations of total bitrate
319 and mode are allowed. See ISO11172-3 3-Annex B, Table 3-B.2
320
321 8:9 '00'=Stereo
322 '01'=JointStereo
323 '10'=Dual
324 '11'=Mono
325 Note: the cx23415 cannot decode Joint Stereo properly.
326
327 10:11 Mode Extension used in joint_stereo mode.
328 In Layer I and II they indicate which subbands are in
329 intensity_stereo. All other subbands are coded in stereo.
330 '00' subbands 4-31 in intensity_stereo, bound==4
331 '01' subbands 8-31 in intensity_stereo, bound==8
332 '10' subbands 12-31 in intensity_stereo, bound==12
333 '11' subbands 16-31 in intensity_stereo, bound==16
334
335 12:13 Emphasis:
336 '00' None
337 '01' 50/15uS
338 '10' reserved
339 '11' CCITT J.17
340
341 14 CRC:
342 '0' off
343 '1' on
344
345 15 Copyright:
346 '0' off
347 '1' on
348
349 16 Generation:
350 '0' copy
351 '1' original
352
353-------------------------------------------------------------------------------
354
355Name CX2341X_ENC_HALT_FW
356Enum 195/0xC3
357Description
358 The firmware is halted and no further API calls are serviced until the
359 firmware is uploaded again.
360
361-------------------------------------------------------------------------------
362
363Name CX2341X_ENC_GET_VERSION
364Enum 196/0xC4
365Description
366 Returns the version of the encoder firmware.
367Result[0]
368 Version bitmask:
369 Bits 0:15 build
370 Bits 16:23 minor
371 Bits 24:31 major
372
373-------------------------------------------------------------------------------
374
375Name CX2341X_ENC_SET_GOP_CLOSURE
376Enum 197/0xC5
377Description
378 Assigns the GOP open/close property.
379Param[0]
380 0=Open
381 1=Closed
382
383-------------------------------------------------------------------------------
384
385Name CX2341X_ENC_GET_SEQ_END
386Enum 198/0xC6
387Description
388 Obtains the sequence end code of the encoder's buffer. When a capture
389 is started a number of interrupts are still generated, the last of
390 which will have Result[0] set to 1 and Result[1] will contain the size
391 of the buffer.
392Result[0]
393 State of the transfer (1 if last buffer)
394Result[1]
395 If Result[0] is 1, this contains the size of the last buffer, undefined
396 otherwise.
397
398-------------------------------------------------------------------------------
399
400Name CX2341X_ENC_SET_PGM_INDEX_INFO
401Enum 199/0xC7
402Description
403 Sets the Program Index Information.
404 The information is stored as follows:
405
406 struct info {
407 u32 length; // Length of this frame
408 u32 offset_low; // Offset in the file of the
409 u32 offset_high; // start of this frame
410 u32 mask1; // Bits 0-2 are the type mask:
411 // 1=I, 2=P, 4=B
412 // 0=End of Program Index, other fields
413 // are invalid.
414 u32 pts; // The PTS of the frame
415 u32 mask2; // Bit 0 is bit 32 of the pts.
416 };
417 u32 table_ptr;
418 struct info index[400];
419
420 The table_ptr is the encoder memory address in the table were
421 *new* entries will be written. Note that this is a ringbuffer,
422 so the table_ptr will wraparound.
423Param[0]
424 Picture Mask:
425 0=No index capture
426 1=I frames
427 3=I,P frames
428 7=I,P,B frames
429 (Seems to be ignored, it always indexes I, P and B frames)
430Param[1]
431 Elements requested (up to 400)
432Result[0]
433 Offset in the encoder memory of the start of the table.
434Result[1]
435 Number of allocated elements up to a maximum of Param[1]
436
437-------------------------------------------------------------------------------
438
439Name CX2341X_ENC_SET_VBI_CONFIG
440Enum 200/0xC8
441Description
442 Configure VBI settings
443Param[0]
444 Bitmap:
445 0 Mode '0' Sliced, '1' Raw
446 1:3 Insertion:
447 '000' insert in extension & user data
448 '001' insert in private packets
449 '010' separate stream and user data
450 '111' separate stream and private data
451 8:15 Stream ID (normally 0xBD)
452Param[1]
453 Frames per interrupt (max 8). Only valid in raw mode.
454Param[2]
455 Total raw VBI frames. Only valid in raw mode.
456Param[3]
457 Start codes
458Param[4]
459 Stop codes
460Param[5]
461 Lines per frame
462Param[6]
463 Byte per line
464Result[0]
465 Observed frames per interrupt in raw mode only. Rage 1 to Param[1]
466Result[1]
467 Observed number of frames in raw mode. Range 1 to Param[2]
468Result[2]
469 Memory offset to start or raw VBI data
470
471-------------------------------------------------------------------------------
472
473Name CX2341X_ENC_SET_DMA_BLOCK_SIZE
474Enum 201/0xC9
475Description
476 Set DMA transfer block size
477Param[0]
478 DMA transfer block size in bytes or frames. When unit is bytes,
479 supported block sizes are 2^7, 2^8 and 2^9 bytes.
480Param[1]
481 Unit: 0=bytes, 1=frames
482
483-------------------------------------------------------------------------------
484
485Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_10
486Enum 202/0xCA
487Description
488 Returns information on the previous DMA transfer in conjunction with
489 bit 27 of the interrupt mask. Uses mailbox 10.
490Result[0]
491 Type of stream
492Result[1]
493 Address Offset
494Result[2]
495 Maximum size of transfer
496
497-------------------------------------------------------------------------------
498
499Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_9
500Enum 203/0xCB
501Description
502 Returns information on the previous DMA transfer in conjunction with
503 bit 27 or 18 of the interrupt mask. Uses mailbox 9.
504Result[0]
505 Status bits:
506 0 read completed
507 1 write completed
508 2 DMA read error
509 3 DMA write error
510 4 Scatter-Gather array error
511Result[1]
512 DMA type
513Result[2]
514 Presentation Time Stamp bits 0..31
515Result[3]
516 Presentation Time Stamp bit 32
517
518-------------------------------------------------------------------------------
519
520Name CX2341X_ENC_SCHED_DMA_TO_HOST
521Enum 204/0xCC
522Description
523 Setup DMA to host operation
524Param[0]
525 Memory address of link list
526Param[1]
527 Length of link list (wtf: what units ???)
528Param[2]
529 DMA type (0=MPEG)
530
531-------------------------------------------------------------------------------
532
533Name CX2341X_ENC_INITIALIZE_INPUT
534Enum 205/0xCD
535Description
536 Initializes the video input
537
538-------------------------------------------------------------------------------
539
540Name CX2341X_ENC_SET_FRAME_DROP_RATE
541Enum 208/0xD0
542Description
543 For each frame captured, skip specified number of frames.
544Param[0]
545 Number of frames to skip
546
547-------------------------------------------------------------------------------
548
549Name CX2341X_ENC_PAUSE_ENCODER
550Enum 210/0xD2
551Description
552 During a pause condition, all frames are dropped instead of being encoded.
553Param[0]
554 0=Pause encoding
555 1=Continue encoding
556
557-------------------------------------------------------------------------------
558
559Name CX2341X_ENC_REFRESH_INPUT
560Enum 211/0xD3
561Description
562 Refreshes the video input
563
564-------------------------------------------------------------------------------
565
566Name CX2341X_ENC_SET_COPYRIGHT
567Enum 212/0xD4
568Description
569 Sets stream copyright property
570Param[0]
571 0=Stream is not copyrighted
572 1=Stream is copyrighted
573
574-------------------------------------------------------------------------------
575
576Name CX2341X_ENC_SET_EVENT_NOTIFICATION
577Enum 213/0xD5
578Description
579 Setup firmware to notify the host about a particular event. Host must
580 unmask the interrupt bit.
581Param[0]
582 Event (0=refresh encoder input)
583Param[1]
584 Notification 0=disabled 1=enabled
585Param[2]
586 Interrupt bit
587Param[3]
588 Mailbox slot, -1 if no mailbox required.
589
590-------------------------------------------------------------------------------
591
592Name CX2341X_ENC_SET_NUM_VSYNC_LINES
593Enum 214/0xD6
594Description
595 Depending on the analog video decoder used, this assigns the number
596 of lines for field 1 and 2.
597Param[0]
598 Field 1 number of lines:
599 0x00EF for SAA7114
600 0x00F0 for SAA7115
601 0x0105 for Micronas
602Param[1]
603 Field 2 number of lines:
604 0x00EF for SAA7114
605 0x00F0 for SAA7115
606 0x0106 for Micronas
607
608-------------------------------------------------------------------------------
609
610Name CX2341X_ENC_SET_PLACEHOLDER
611Enum 215/0xD7
612Description
613 Provides a mechanism of inserting custom user data in the MPEG stream.
614Param[0]
615 0=extension & user data
616 1=private packet with stream ID 0xBD
617Param[1]
618 Rate at which to insert data, in units of frames (for private packet)
619 or GOPs (for ext. & user data)
620Param[2]
621 Number of data DWORDs (below) to insert
622Param[3]
623 Custom data 0
624Param[4]
625 Custom data 1
626Param[5]
627 Custom data 2
628Param[6]
629 Custom data 3
630Param[7]
631 Custom data 4
632Param[8]
633 Custom data 5
634Param[9]
635 Custom data 6
636Param[10]
637 Custom data 7
638Param[11]
639 Custom data 8
640
641-------------------------------------------------------------------------------
642
643Name CX2341X_ENC_MUTE_VIDEO
644Enum 217/0xD9
645Description
646 Video muting
647Param[0]
648 Bit usage:
649 0 '0'=video not muted
650 '1'=video muted, creates frames with the YUV color defined below
651 1:7 Unused
652 8:15 V chrominance information
653 16:23 U chrominance information
654 24:31 Y luminance information
655
656-------------------------------------------------------------------------------
657
658Name CX2341X_ENC_MUTE_AUDIO
659Enum 218/0xDA
660Description
661 Audio muting
662Param[0]
663 0=audio not muted
664 1=audio muted (produces silent mpeg audio stream)
665
666-------------------------------------------------------------------------------
667
668Name CX2341X_ENC_SET_VERT_CROP_LINE
669Enum 219/0xDB
670Description
671 Something to do with 'Vertical Crop Line'
672Param[0]
673 If saa7114 and raw VBI capture and 60 Hz, then set to 10001.
674 Else 0.
675
676-------------------------------------------------------------------------------
677
678Name CX2341X_ENC_MISC
679Enum 220/0xDC
680Description
681 Miscellaneous actions. Not known for 100% what it does. It's really a
682 sort of ioctl call. The first parameter is a command number, the second
683 the value.
684Param[0]
685 Command number:
686 1=set initial SCR value when starting encoding (works).
687 2=set quality mode (apparently some test setting).
688 3=setup advanced VIM protection handling.
689 Always 1 for the cx23416 and 0 for cx23415.
690 4=generate DVD compatible PTS timestamps
691 5=USB flush mode
692 6=something to do with the quantization matrix
693 7=set navigation pack insertion for DVD: adds 0xbf (private stream 2)
694 packets to the MPEG. The size of these packets is 2048 bytes (including
695 the header of 6 bytes: 0x000001bf + length). The payload is zeroed and
696 it is up to the application to fill them in. These packets are apparently
697 inserted every four frames.
698 8=enable scene change detection (seems to be a failure)
699 9=set history parameters of the video input module
700 10=set input field order of VIM
701 11=set quantization matrix
702 12=reset audio interface after channel change or input switch (has no argument).
703 Needed for the cx2584x, not needed for the mspx4xx, but it doesn't seem to
704 do any harm calling it regardless.
705 13=set audio volume delay
706 14=set audio delay
707
708Param[1]
709 Command value.
diff --git a/Documentation/video4linux/cx2341x/fw-memory.txt b/Documentation/video4linux/cx2341x/fw-memory.txt
deleted file mode 100644
index 9d736fe8de66..000000000000
--- a/Documentation/video4linux/cx2341x/fw-memory.txt
+++ /dev/null
@@ -1,139 +0,0 @@
1This document describes the cx2341x memory map and documents some of the register
2space.
3
4Note: the memory long words are little-endian ('intel format').
5
6Warning! This information was figured out from searching through the memory and
7registers, this information may not be correct and is certainly not complete, and
8was not derived from anything more than searching through the memory space with
9commands like:
10
11 ivtvctl -O min=0x02000000,max=0x020000ff
12
13So take this as is, I'm always searching for more stuff, it's a large
14register space :-).
15
16Memory Map
17==========
18
19The cx2341x exposes its entire 64M memory space to the PCI host via the PCI BAR0
20(Base Address Register 0). The addresses here are offsets relative to the
21address held in BAR0.
22
230x00000000-0x00ffffff Encoder memory space
240x00000000-0x0003ffff Encode.rom
25 ???-??? MPEG buffer(s)
26 ???-??? Raw video capture buffer(s)
27 ???-??? Raw audio capture buffer(s)
28 ???-??? Display buffers (6 or 9)
29
300x01000000-0x01ffffff Decoder memory space
310x01000000-0x0103ffff Decode.rom
32 ???-??? MPEG buffers(s)
330x0114b000-0x0115afff Audio.rom (deprecated?)
34
350x02000000-0x0200ffff Register Space
36
37Registers
38=========
39
40The registers occupy the 64k space starting at the 0x02000000 offset from BAR0.
41All of these registers are 32 bits wide.
42
43DMA Registers 0x000-0xff:
44
45 0x00 - Control:
46 0=reset/cancel, 1=read, 2=write, 4=stop
47 0x04 - DMA status:
48 1=read busy, 2=write busy, 4=read error, 8=write error, 16=link list error
49 0x08 - pci DMA pointer for read link list
50 0x0c - pci DMA pointer for write link list
51 0x10 - read/write DMA enable:
52 1=read enable, 2=write enable
53 0x14 - always 0xffffffff, if set any lower instability occurs, 0x00 crashes
54 0x18 - ??
55 0x1c - always 0x20 or 32, smaller values slow down DMA transactions
56 0x20 - always value of 0x780a010a
57 0x24-0x3c - usually just random values???
58 0x40 - Interrupt status
59 0x44 - Write a bit here and shows up in Interrupt status 0x40
60 0x48 - Interrupt Mask
61 0x4C - always value of 0xfffdffff,
62 if changed to 0xffffffff DMA write interrupts break.
63 0x50 - always 0xffffffff
64 0x54 - always 0xffffffff (0x4c, 0x50, 0x54 seem like interrupt masks, are
65 3 processors on chip, Java ones, VPU, SPU, APU, maybe these are the
66 interrupt masks???).
67 0x60-0x7C - random values
68 0x80 - first write linked list reg, for Encoder Memory addr
69 0x84 - first write linked list reg, for pci memory addr
70 0x88 - first write linked list reg, for length of buffer in memory addr
71 (|0x80000000 or this for last link)
72 0x8c-0xdc - rest of write linked list reg, 8 sets of 3 total, DMA goes here
73 from linked list addr in reg 0x0c, firmware must push through or
74 something.
75 0xe0 - first (and only) read linked list reg, for pci memory addr
76 0xe4 - first (and only) read linked list reg, for Decoder memory addr
77 0xe8 - first (and only) read linked list reg, for length of buffer
78 0xec-0xff - Nothing seems to be in these registers, 0xec-f4 are 0x00000000.
79
80Memory locations for Encoder Buffers 0x700-0x7ff:
81
82These registers show offsets of memory locations pertaining to each
83buffer area used for encoding, have to shift them by <<1 first.
84
850x07F8: Encoder SDRAM refresh
860x07FC: Encoder SDRAM pre-charge
87
88Memory locations for Decoder Buffers 0x800-0x8ff:
89
90These registers show offsets of memory locations pertaining to each
91buffer area used for decoding, have to shift them by <<1 first.
92
930x08F8: Decoder SDRAM refresh
940x08FC: Decoder SDRAM pre-charge
95
96Other memory locations:
97
980x2800: Video Display Module control
990x2D00: AO (audio output?) control
1000x2D24: Bytes Flushed
1010x7000: LSB I2C write clock bit (inverted)
1020x7004: LSB I2C write data bit (inverted)
1030x7008: LSB I2C read clock bit
1040x700c: LSB I2C read data bit
1050x9008: GPIO get input state
1060x900c: GPIO set output state
1070x9020: GPIO direction (Bit7 (GPIO 0..7) - 0:input, 1:output)
1080x9050: SPU control
1090x9054: Reset HW blocks
1100x9058: VPU control
1110xA018: Bit6: interrupt pending?
1120xA064: APU command
113
114
115Interrupt Status Register
116=========================
117
118The definition of the bits in the interrupt status register 0x0040, and the
119interrupt mask 0x0048. If a bit is cleared in the mask, then we want our ISR to
120execute.
121
122Bit
12331 Encoder Start Capture
12430 Encoder EOS
12529 Encoder VBI capture
12628 Encoder Video Input Module reset event
12727 Encoder DMA complete
12824 Decoder audio mode change detection event (through event notification)
12922 Decoder data request
13020 Decoder DMA complete
13119 Decoder VBI re-insertion
13218 Decoder DMA err (linked-list bad)
133
134Missing
135Encoder API call completed
136Decoder API call completed
137Encoder API post(?)
138Decoder API post(?)
139Decoder VTRACE event
diff --git a/Documentation/video4linux/cx2341x/fw-osd-api.txt b/Documentation/video4linux/cx2341x/fw-osd-api.txt
deleted file mode 100644
index 89c4601042c1..000000000000
--- a/Documentation/video4linux/cx2341x/fw-osd-api.txt
+++ /dev/null
@@ -1,350 +0,0 @@
1OSD firmware API description
2============================
3
4Note: this API is part of the decoder firmware, so it's cx23415 only.
5
6-------------------------------------------------------------------------------
7
8Name CX2341X_OSD_GET_FRAMEBUFFER
9Enum 65/0x41
10Description
11 Return base and length of contiguous OSD memory.
12Result[0]
13 OSD base address
14Result[1]
15 OSD length
16
17-------------------------------------------------------------------------------
18
19Name CX2341X_OSD_GET_PIXEL_FORMAT
20Enum 66/0x42
21Description
22 Query OSD format
23Result[0]
24 0=8bit index
25 1=16bit RGB 5:6:5
26 2=16bit ARGB 1:5:5:5
27 3=16bit ARGB 1:4:4:4
28 4=32bit ARGB 8:8:8:8
29
30-------------------------------------------------------------------------------
31
32Name CX2341X_OSD_SET_PIXEL_FORMAT
33Enum 67/0x43
34Description
35 Assign pixel format
36Param[0]
37 0=8bit index
38 1=16bit RGB 5:6:5
39 2=16bit ARGB 1:5:5:5
40 3=16bit ARGB 1:4:4:4
41 4=32bit ARGB 8:8:8:8
42
43-------------------------------------------------------------------------------
44
45Name CX2341X_OSD_GET_STATE
46Enum 68/0x44
47Description
48 Query OSD state
49Result[0]
50 Bit 0 0=off, 1=on
51 Bits 1:2 alpha control
52 Bits 3:5 pixel format
53
54-------------------------------------------------------------------------------
55
56Name CX2341X_OSD_SET_STATE
57Enum 69/0x45
58Description
59 OSD switch
60Param[0]
61 0=off, 1=on
62
63-------------------------------------------------------------------------------
64
65Name CX2341X_OSD_GET_OSD_COORDS
66Enum 70/0x46
67Description
68 Retrieve coordinates of OSD area blended with video
69Result[0]
70 OSD buffer address
71Result[1]
72 Stride in pixels
73Result[2]
74 Lines in OSD buffer
75Result[3]
76 Horizontal offset in buffer
77Result[4]
78 Vertical offset in buffer
79
80-------------------------------------------------------------------------------
81
82Name CX2341X_OSD_SET_OSD_COORDS
83Enum 71/0x47
84Description
85 Assign the coordinates of the OSD area to blend with video
86Param[0]
87 buffer address
88Param[1]
89 buffer stride in pixels
90Param[2]
91 lines in buffer
92Param[3]
93 horizontal offset
94Param[4]
95 vertical offset
96
97-------------------------------------------------------------------------------
98
99Name CX2341X_OSD_GET_SCREEN_COORDS
100Enum 72/0x48
101Description
102 Retrieve OSD screen area coordinates
103Result[0]
104 top left horizontal offset
105Result[1]
106 top left vertical offset
107Result[2]
108 bottom right horizontal offset
109Result[3]
110 bottom right vertical offset
111
112-------------------------------------------------------------------------------
113
114Name CX2341X_OSD_SET_SCREEN_COORDS
115Enum 73/0x49
116Description
117 Assign the coordinates of the screen area to blend with video
118Param[0]
119 top left horizontal offset
120Param[1]
121 top left vertical offset
122Param[2]
123 bottom left horizontal offset
124Param[3]
125 bottom left vertical offset
126
127-------------------------------------------------------------------------------
128
129Name CX2341X_OSD_GET_GLOBAL_ALPHA
130Enum 74/0x4A
131Description
132 Retrieve OSD global alpha
133Result[0]
134 global alpha: 0=off, 1=on
135Result[1]
136 bits 0:7 global alpha
137
138-------------------------------------------------------------------------------
139
140Name CX2341X_OSD_SET_GLOBAL_ALPHA
141Enum 75/0x4B
142Description
143 Update global alpha
144Param[0]
145 global alpha: 0=off, 1=on
146Param[1]
147 global alpha (8 bits)
148Param[2]
149 local alpha: 0=on, 1=off
150
151-------------------------------------------------------------------------------
152
153Name CX2341X_OSD_SET_BLEND_COORDS
154Enum 78/0x4C
155Description
156 Move start of blending area within display buffer
157Param[0]
158 horizontal offset in buffer
159Param[1]
160 vertical offset in buffer
161
162-------------------------------------------------------------------------------
163
164Name CX2341X_OSD_GET_FLICKER_STATE
165Enum 79/0x4F
166Description
167 Retrieve flicker reduction module state
168Result[0]
169 flicker state: 0=off, 1=on
170
171-------------------------------------------------------------------------------
172
173Name CX2341X_OSD_SET_FLICKER_STATE
174Enum 80/0x50
175Description
176 Set flicker reduction module state
177Param[0]
178 State: 0=off, 1=on
179
180-------------------------------------------------------------------------------
181
182Name CX2341X_OSD_BLT_COPY
183Enum 82/0x52
184Description
185 BLT copy
186Param[0]
187'0000' zero
188'0001' ~destination AND ~source
189'0010' ~destination AND source
190'0011' ~destination
191'0100' destination AND ~source
192'0101' ~source
193'0110' destination XOR source
194'0111' ~destination OR ~source
195'1000' ~destination AND ~source
196'1001' destination XNOR source
197'1010' source
198'1011' ~destination OR source
199'1100' destination
200'1101' destination OR ~source
201'1110' destination OR source
202'1111' one
203
204Param[1]
205 Resulting alpha blending
206 '01' source_alpha
207 '10' destination_alpha
208 '11' source_alpha*destination_alpha+1
209 (zero if both source and destination alpha are zero)
210Param[2]
211 '00' output_pixel = source_pixel
212
213 '01' if source_alpha=0:
214 output_pixel = destination_pixel
215 if 256 > source_alpha > 1:
216 output_pixel = ((source_alpha + 1)*source_pixel +
217 (255 - source_alpha)*destination_pixel)/256
218
219 '10' if destination_alpha=0:
220 output_pixel = source_pixel
221 if 255 > destination_alpha > 0:
222 output_pixel = ((255 - destination_alpha)*source_pixel +
223 (destination_alpha + 1)*destination_pixel)/256
224
225 '11' if source_alpha=0:
226 source_temp = 0
227 if source_alpha=255:
228 source_temp = source_pixel*256
229 if 255 > source_alpha > 0:
230 source_temp = source_pixel*(source_alpha + 1)
231 if destination_alpha=0:
232 destination_temp = 0
233 if destination_alpha=255:
234 destination_temp = destination_pixel*256
235 if 255 > destination_alpha > 0:
236 destination_temp = destination_pixel*(destination_alpha + 1)
237 output_pixel = (source_temp + destination_temp)/256
238Param[3]
239 width
240Param[4]
241 height
242Param[5]
243 destination pixel mask
244Param[6]
245 destination rectangle start address
246Param[7]
247 destination stride in dwords
248Param[8]
249 source stride in dwords
250Param[9]
251 source rectangle start address
252
253-------------------------------------------------------------------------------
254
255Name CX2341X_OSD_BLT_FILL
256Enum 83/0x53
257Description
258 BLT fill color
259Param[0]
260 Same as Param[0] on API 0x52
261Param[1]
262 Same as Param[1] on API 0x52
263Param[2]
264 Same as Param[2] on API 0x52
265Param[3]
266 width
267Param[4]
268 height
269Param[5]
270 destination pixel mask
271Param[6]
272 destination rectangle start address
273Param[7]
274 destination stride in dwords
275Param[8]
276 color fill value
277
278-------------------------------------------------------------------------------
279
280Name CX2341X_OSD_BLT_TEXT
281Enum 84/0x54
282Description
283 BLT for 8 bit alpha text source
284Param[0]
285 Same as Param[0] on API 0x52
286Param[1]
287 Same as Param[1] on API 0x52
288Param[2]
289 Same as Param[2] on API 0x52
290Param[3]
291 width
292Param[4]
293 height
294Param[5]
295 destination pixel mask
296Param[6]
297 destination rectangle start address
298Param[7]
299 destination stride in dwords
300Param[8]
301 source stride in dwords
302Param[9]
303 source rectangle start address
304Param[10]
305 color fill value
306
307-------------------------------------------------------------------------------
308
309Name CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
310Enum 86/0x56
311Description
312 Positions the main output window on the screen. The coordinates must be
313 such that the entire window fits on the screen.
314Param[0]
315 window width
316Param[1]
317 window height
318Param[2]
319 top left window corner horizontal offset
320Param[3]
321 top left window corner vertical offset
322
323-------------------------------------------------------------------------------
324
325Name CX2341X_OSD_SET_CHROMA_KEY
326Enum 96/0x60
327Description
328 Chroma key switch and color
329Param[0]
330 state: 0=off, 1=on
331Param[1]
332 color
333
334-------------------------------------------------------------------------------
335
336Name CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
337Enum 97/0x61
338Description
339 Retrieve alpha content index
340Result[0]
341 alpha content index, Range 0:15
342
343-------------------------------------------------------------------------------
344
345Name CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
346Enum 98/0x62
347Description
348 Assign alpha content index
349Param[0]
350 alpha content index, range 0:15
diff --git a/Documentation/video4linux/cx2341x/fw-upload.txt b/Documentation/video4linux/cx2341x/fw-upload.txt
deleted file mode 100644
index 60c502ce3215..000000000000
--- a/Documentation/video4linux/cx2341x/fw-upload.txt
+++ /dev/null
@@ -1,49 +0,0 @@
1This document describes how to upload the cx2341x firmware to the card.
2
3How to find
4===========
5
6See the web pages of the various projects that uses this chip for information
7on how to obtain the firmware.
8
9The firmware stored in a Windows driver can be detected as follows:
10
11- Each firmware image is 256k bytes.
12- The 1st 32-bit word of the Encoder image is 0x0000da7
13- The 1st 32-bit word of the Decoder image is 0x00003a7
14- The 2nd 32-bit word of both images is 0xaa55bb66
15
16How to load
17===========
18
19- Issue the FWapi command to stop the encoder if it is running. Wait for the
20 command to complete.
21- Issue the FWapi command to stop the decoder if it is running. Wait for the
22 command to complete.
23- Issue the I2C command to the digitizer to stop emitting VSYNC events.
24- Issue the FWapi command to halt the encoder's firmware.
25- Sleep for 10ms.
26- Issue the FWapi command to halt the decoder's firmware.
27- Sleep for 10ms.
28- Write 0x00000000 to register 0x2800 to stop the Video Display Module.
29- Write 0x00000005 to register 0x2D00 to stop the AO (audio output?).
30- Write 0x00000000 to register 0xA064 to ping? the APU.
31- Write 0xFFFFFFFE to register 0x9058 to stop the VPU.
32- Write 0xFFFFFFFF to register 0x9054 to reset the HW blocks.
33- Write 0x00000001 to register 0x9050 to stop the SPU.
34- Sleep for 10ms.
35- Write 0x0000001A to register 0x07FC to init the Encoder SDRAM's pre-charge.
36- Write 0x80000640 to register 0x07F8 to init the Encoder SDRAM's refresh to 1us.
37- Write 0x0000001A to register 0x08FC to init the Decoder SDRAM's pre-charge.
38- Write 0x80000640 to register 0x08F8 to init the Decoder SDRAM's refresh to 1us.
39- Sleep for 512ms. (600ms is recommended)
40- Transfer the encoder's firmware image to offset 0 in Encoder memory space.
41- Transfer the decoder's firmware image to offset 0 in Decoder memory space.
42- Use a read-modify-write operation to Clear bit 0 of register 0x9050 to
43 re-enable the SPU.
44- Sleep for 1 second.
45- Use a read-modify-write operation to Clear bits 3 and 0 of register 0x9058
46 to re-enable the VPU.
47- Sleep for 1 second.
48- Issue status API commands to both firmware images to verify.
49
diff --git a/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt b/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt
deleted file mode 100644
index f4329a38878e..000000000000
--- a/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt
+++ /dev/null
@@ -1,54 +0,0 @@
1The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
2
3GPIO0 GPIO1
4 0 0 TV Audio
5 1 0 FM radio
6 0 1 Line-In
7 1 1 Mono tuner bypass or CD passthru (tuner specific)
8
9GPIO 16(i believe) is tied to the IR port (if present).
10
11------------------------------------------------------------------------------------
12
13>From the data sheet:
14 Register 24'h20004 PCI Interrupt Status
15 bit [18] IR_SMP_INT Set when 32 input samples have been collected over
16 gpio[16] pin into GP_SAMPLE register.
17
18What's missing from the data sheet:
19
20Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
21compat remote)
22set register 0x35C050 to 0xa80a80
23
24enable sampling
25set register 0x35C054 to 0x5
26
27Of course, enable the IRQ bit 18 in the interrupt mask register .(and
28provide for a handler)
29
30GP_SAMPLE register is at 0x35C058
31
32Bits are then right shifted into the GP_SAMPLE register at the specified
33rate; you get an interrupt when a full DWORD is received.
34You need to recover the actual RC5 bits out of the (oversampled) IR sensor
35bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An
36actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
37
38I'm pretty sure when no IR signal is present the receiver is always in a
39marking state(1); but stray light, etc can cause intermittent noise values
40as well. Remember, this is a free running sample of the IR receiver state
41over time, so don't assume any sample starts at any particular place.
42
43http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
44This data sheet (google search) seems to have a lovely description of the
45RC5 basics
46
47http://www.nenya.be/beor/electronics/rc5.htm and more data
48
49http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
50and even a reference to how to decode a bi-phase data stream.
51
52http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm
53still more info
54
diff --git a/Documentation/video4linux/hauppauge-wintv-cx88-ir.txt b/Documentation/video4linux/hauppauge-wintv-cx88-ir.txt
deleted file mode 100644
index a2fd363c40c8..000000000000
--- a/Documentation/video4linux/hauppauge-wintv-cx88-ir.txt
+++ /dev/null
@@ -1,54 +0,0 @@
1The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
2
3GPIO0 GPIO1
4 0 0 TV Audio
5 1 0 FM radio
6 0 1 Line-In
7 1 1 Mono tuner bypass or CD passthru (tuner specific)
8
9GPIO 16(i believe) is tied to the IR port (if present).
10
11------------------------------------------------------------------------------------
12
13>From the data sheet:
14 Register 24'h20004 PCI Interrupt Status
15 bit [18] IR_SMP_INT Set when 32 input samples have been collected over
16 gpio[16] pin into GP_SAMPLE register.
17
18What's missing from the data sheet:
19
20Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
21compat remote)
22set register 0x35C050 to 0xa80a80
23
24enable sampling
25set register 0x35C054 to 0x5
26
27Of course, enable the IRQ bit 18 in the interrupt mask register .(and
28provide for a handler)
29
30GP_SAMPLE register is at 0x35C058
31
32Bits are then right shifted into the GP_SAMPLE register at the specified
33rate; you get an interrupt when a full DWORD is received.
34You need to recover the actual RC5 bits out of the (oversampled) IR sensor
35bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An
36actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
37
38I'm pretty sure when no IR signal is present the receiver is always in a
39marking state(1); but stray light, etc can cause intermittent noise values
40as well. Remember, this is a free running sample of the IR receiver state
41over time, so don't assume any sample starts at any particular place.
42
43http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
44This data sheet (google search) seems to have a lovely description of the
45RC5 basics
46
47http://www.nenya.be/beor/electronics/rc5.htm and more data
48
49http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
50and even a reference to how to decode a bi-phase data stream.
51
52http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm
53still more info
54
diff --git a/Documentation/video4linux/lifeview.txt b/Documentation/video4linux/lifeview.txt
deleted file mode 100644
index 05f9eb57aac9..000000000000
--- a/Documentation/video4linux/lifeview.txt
+++ /dev/null
@@ -1,42 +0,0 @@
1collecting data about the lifeview models and the config coding on
2gpio pins 0-9 ...
3==================================================================
4
5bt878:
6 LR50 rev. Q ("PARTS: 7031505116), Tuner wurde als Nr. 5 erkannt, Eingänge
7 SVideo, TV, Composite, Audio, Remote. CP9..1=100001001 (1: 0-Ohm-Widerstand
8 gegen GND unbestückt; 0: bestückt)
9
10------------------------------------------------------------------------------
11
12saa7134:
13 /* LifeView FlyTV Platinum FM (LR214WF) */
14 /* "Peter Missel <peter.missel@onlinehome.de> */
15 .name = "LifeView FlyTV Platinum FM",
16 /* GP27 MDT2005 PB4 pin 10 */
17 /* GP26 MDT2005 PB3 pin 9 */
18 /* GP25 MDT2005 PB2 pin 8 */
19 /* GP23 MDT2005 PB1 pin 7 */
20 /* GP22 MDT2005 PB0 pin 6 */
21 /* GP21 MDT2005 PB5 pin 11 */
22 /* GP20 MDT2005 PB6 pin 12 */
23 /* GP19 MDT2005 PB7 pin 13 */
24 /* nc MDT2005 PA3 pin 2 */
25 /* Remote MDT2005 PA2 pin 1 */
26 /* GP18 MDT2005 PA1 pin 18 */
27 /* nc MDT2005 PA0 pin 17 strap low */
28
29 /* GP17 Strap "GP7"=High */
30 /* GP16 Strap "GP6"=High
31 0=Radio 1=TV
32 Drives SA630D ENCH1 and HEF4052 A1 pins
33 to do FM radio through SIF input */
34 /* GP15 nc */
35 /* GP14 nc */
36 /* GP13 nc */
37 /* GP12 Strap "GP5" = High */
38 /* GP11 Strap "GP4" = High */
39 /* GP10 Strap "GP3" = High */
40 /* GP09 Strap "GP2" = Low */
41 /* GP08 Strap "GP1" = Low */
42 /* GP07.00 nc */
diff --git a/Documentation/video4linux/not-in-cx2388x-datasheet.txt b/Documentation/video4linux/not-in-cx2388x-datasheet.txt
deleted file mode 100644
index edbfe744d21d..000000000000
--- a/Documentation/video4linux/not-in-cx2388x-datasheet.txt
+++ /dev/null
@@ -1,41 +0,0 @@
1=================================================================================
2MO_OUTPUT_FORMAT (0x310164)
3
4 Previous default from DScaler: 0x1c1f0008
5 Digit 8: 31-28
6 28: PREVREMOD = 1
7
8 Digit 7: 27-24 (0xc = 12 = b1100 )
9 27: COMBALT = 1
10 26: PAL_INV_PHASE
11 (DScaler apparently set this to 1, resulted in sucky picture)
12
13 Digits 6,5: 23-16
14 25-16: COMB_RANGE = 0x1f [default] (9 bits -> max 512)
15
16 Digit 4: 15-12
17 15: DISIFX = 0
18 14: INVCBF = 0
19 13: DISADAPT = 0
20 12: NARROWADAPT = 0
21
22 Digit 3: 11-8
23 11: FORCE2H
24 10: FORCEREMD
25 9: NCHROMAEN
26 8: NREMODEN
27
28 Digit 2: 7-4
29 7-6: YCORE
30 5-4: CCORE
31
32 Digit 1: 3-0
33 3: RANGE = 1
34 2: HACTEXT
35 1: HSFMT
36
370x47 is the sync byte for MPEG-2 transport stream packets.
38Datasheet incorrectly states to use 47 decimal. 188 is the length.
39All DVB compliant frontends output packets with this start code.
40
41=================================================================================
diff --git a/Documentation/video4linux/pxa_camera.txt b/Documentation/video4linux/pxa_camera.txt
deleted file mode 100644
index 51ed1578b0e8..000000000000
--- a/Documentation/video4linux/pxa_camera.txt
+++ /dev/null
@@ -1,174 +0,0 @@
1 PXA-Camera Host Driver
2 ======================
3
4Constraints
5-----------
6 a) Image size for YUV422P format
7 All YUV422P images are enforced to have width x height % 16 = 0.
8 This is due to DMA constraints, which transfers only planes of 8 byte
9 multiples.
10
11
12Global video workflow
13---------------------
14 a) QCI stopped
15 Initialy, the QCI interface is stopped.
16 When a buffer is queued (pxa_videobuf_ops->buf_queue), the QCI starts.
17
18 b) QCI started
19 More buffers can be queued while the QCI is started without halting the
20 capture. The new buffers are "appended" at the tail of the DMA chain, and
21 smoothly captured one frame after the other.
22
23 Once a buffer is filled in the QCI interface, it is marked as "DONE" and
24 removed from the active buffers list. It can be then requeud or dequeued by
25 userland application.
26
27 Once the last buffer is filled in, the QCI interface stops.
28
29 c) Capture global finite state machine schema
30
31 +----+ +---+ +----+
32 | DQ | | Q | | DQ |
33 | v | v | v
34 +-----------+ +------------------------+
35 | STOP | | Wait for capture start |
36 +-----------+ Q +------------------------+
37+-> | QCI: stop | ------------------> | QCI: run | <------------+
38| | DMA: stop | | DMA: stop | |
39| +-----------+ +-----> +------------------------+ |
40| / | |
41| / +---+ +----+ | |
42|capture list empty / | Q | | DQ | | QCI Irq EOF |
43| / | v | v v |
44| +--------------------+ +----------------------+ |
45| | DMA hotlink missed | | Capture running | |
46| +--------------------+ +----------------------+ |
47| | QCI: run | +-----> | QCI: run | <-+ |
48| | DMA: stop | / | DMA: run | | |
49| +--------------------+ / +----------------------+ | Other |
50| ^ /DMA still | | channels |
51| | capture list / running | DMA Irq End | not |
52| | not empty / | | finished |
53| | / v | yet |
54| +----------------------+ +----------------------+ | |
55| | Videobuf released | | Channel completed | | |
56| +----------------------+ +----------------------+ | |
57+-- | QCI: run | | QCI: run | --+ |
58 | DMA: run | | DMA: run | |
59 +----------------------+ +----------------------+ |
60 ^ / | |
61 | no overrun / | overrun |
62 | / v |
63 +--------------------+ / +----------------------+ |
64 | Frame completed | / | Frame overran | |
65 +--------------------+ <-----+ +----------------------+ restart frame |
66 | QCI: run | | QCI: stop | --------------+
67 | DMA: run | | DMA: stop |
68 +--------------------+ +----------------------+
69
70 Legend: - each box is a FSM state
71 - each arrow is the condition to transition to another state
72 - an arrow with a comment is a mandatory transition (no condition)
73 - arrow "Q" means : a buffer was enqueued
74 - arrow "DQ" means : a buffer was dequeued
75 - "QCI: stop" means the QCI interface is not enabled
76 - "DMA: stop" means all 3 DMA channels are stopped
77 - "DMA: run" means at least 1 DMA channel is still running
78
79DMA usage
80---------
81 a) DMA flow
82 - first buffer queued for capture
83 Once a first buffer is queued for capture, the QCI is started, but data
84 transfer is not started. On "End Of Frame" interrupt, the irq handler
85 starts the DMA chain.
86 - capture of one videobuffer
87 The DMA chain starts transferring data into videobuffer RAM pages.
88 When all pages are transferred, the DMA irq is raised on "ENDINTR" status
89 - finishing one videobuffer
90 The DMA irq handler marks the videobuffer as "done", and removes it from
91 the active running queue
92 Meanwhile, the next videobuffer (if there is one), is transferred by DMA
93 - finishing the last videobuffer
94 On the DMA irq of the last videobuffer, the QCI is stopped.
95
96 b) DMA prepared buffer will have this structure
97
98 +------------+-----+---------------+-----------------+
99 | desc-sg[0] | ... | desc-sg[last] | finisher/linker |
100 +------------+-----+---------------+-----------------+
101
102 This structure is pointed by dma->sg_cpu.
103 The descriptors are used as follows :
104 - desc-sg[i]: i-th descriptor, transferring the i-th sg
105 element to the video buffer scatter gather
106 - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN
107 - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0
108
109 For the next schema, let's assume d0=desc-sg[0] .. dN=desc-sg[N],
110 "f" stands for finisher and "l" for linker.
111 A typical running chain is :
112
113 Videobuffer 1 Videobuffer 2
114 +---------+----+---+ +----+----+----+---+
115 | d0 | .. | dN | l | | d0 | .. | dN | f |
116 +---------+----+-|-+ ^----+----+----+---+
117 | |
118 +----+
119
120 After the chaining is finished, the chain looks like :
121
122 Videobuffer 1 Videobuffer 2 Videobuffer 3
123 +---------+----+---+ +----+----+----+---+ +----+----+----+---+
124 | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f |
125 +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+
126 | | | |
127 +----+ +----+
128 new_link
129
130 c) DMA hot chaining timeslice issue
131
132 As DMA chaining is done while DMA _is_ running, the linking may be done
133 while the DMA jumps from one Videobuffer to another. On the schema, that
134 would be a problem if the following sequence is encountered :
135
136 - DMA chain is Videobuffer1 + Videobuffer2
137 - pxa_videobuf_queue() is called to queue Videobuffer3
138 - DMA controller finishes Videobuffer2, and DMA stops
139 =>
140 Videobuffer 1 Videobuffer 2
141 +---------+----+---+ +----+----+----+---+
142 | d0 | .. | dN | l | | d0 | .. | dN | f |
143 +---------+----+-|-+ ^----+----+----+-^-+
144 | | |
145 +----+ +-- DMA DDADR loads DDADR_STOP
146
147 - pxa_dma_add_tail_buf() is called, the Videobuffer2 "finisher" is
148 replaced by a "linker" to Videobuffer3 (creation of new_link)
149 - pxa_videobuf_queue() finishes
150 - the DMA irq handler is called, which terminates Videobuffer2
151 - Videobuffer3 capture is not scheduled on DMA chain (as it stopped !!!)
152
153 Videobuffer 1 Videobuffer 2 Videobuffer 3
154 +---------+----+---+ +----+----+----+---+ +----+----+----+---+
155 | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f |
156 +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+
157 | | | |
158 +----+ +----+
159 new_link
160 DMA DDADR still is DDADR_STOP
161
162 - pxa_camera_check_link_miss() is called
163 This checks if the DMA is finished and a buffer is still on the
164 pcdev->capture list. If that's the case, the capture will be restarted,
165 and Videobuffer3 is scheduled on DMA chain.
166 - the DMA irq handler finishes
167
168 Note: if DMA stops just after pxa_camera_check_link_miss() reads DDADR()
169 value, we have the guarantee that the DMA irq handler will be called back
170 when the DMA will finish the buffer, and pxa_camera_check_link_miss() will
171 be called again, to reschedule Videobuffer3.
172
173--
174Author: Robert Jarzmik <robert.jarzmik@free.fr>
diff --git a/Documentation/video4linux/radiotrack.txt b/Documentation/video4linux/radiotrack.txt
deleted file mode 100644
index d1f3ed199186..000000000000
--- a/Documentation/video4linux/radiotrack.txt
+++ /dev/null
@@ -1,147 +0,0 @@
1NOTES ON RADIOTRACK CARD CONTROL
2by Stephen M. Benoit (benoits@servicepro.com) Dec 14, 1996
3----------------------------------------------------------------------------
4
5Document version 1.0
6
7ACKNOWLEDGMENTS
8----------------
9This document was made based on 'C' code for Linux from Gideon le Grange
10(legrang@active.co.za or legrang@cs.sun.ac.za) in 1994, and elaborations from
11Frans Brinkman (brinkman@esd.nl) in 1996. The results reported here are from
12experiments that the author performed on his own setup, so your mileage may
13vary... I make no guarantees, claims or warranties to the suitability or
14validity of this information. No other documentation on the AIMS
15Lab (http://www.aimslab.com/) RadioTrack card was made available to the
16author. This document is offered in the hopes that it might help users who
17want to use the RadioTrack card in an environment other than MS Windows.
18
19WHY THIS DOCUMENT?
20------------------
21I have a RadioTrack card from back when I ran an MS-Windows platform. After
22converting to Linux, I found Gideon le Grange's command-line software for
23running the card, and found that it was good! Frans Brinkman made a
24comfortable X-windows interface, and added a scanning feature. For hack
25value, I wanted to see if the tuner could be tuned beyond the usual FM radio
26broadcast band, so I could pick up the audio carriers from North American
27broadcast TV channels, situated just below and above the 87.0-109.0 MHz range.
28I did not get much success, but I learned about programming ioports under
29Linux and gained some insights about the hardware design used for the card.
30
31So, without further delay, here are the details.
32
33
34PHYSICAL DESCRIPTION
35--------------------
36The RadioTrack card is an ISA 8-bit FM radio card. The radio frequency (RF)
37input is simply an antenna lead, and the output is a power audio signal
38available through a miniature phone plug. Its RF frequencies of operation are
39more or less limited from 87.0 to 109.0 MHz (the commercial FM broadcast
40band). Although the registers can be programmed to request frequencies beyond
41these limits, experiments did not give promising results. The variable
42frequency oscillator (VFO) that demodulates the intermediate frequency (IF)
43signal probably has a small range of useful frequencies, and wraps around or
44gets clipped beyond the limits mentioned above.
45
46
47CONTROLLING THE CARD WITH IOPORT
48--------------------------------
49The RadioTrack (base) ioport is configurable for 0x30c or 0x20c. Only one
50ioport seems to be involved. The ioport decoding circuitry must be pretty
51simple, as individual ioport bits are directly matched to specific functions
52(or blocks) of the radio card. This way, many functions can be changed in
53parallel with one write to the ioport. The only feedback available through
54the ioports appears to be the "Stereo Detect" bit.
55
56The bits of the ioport are arranged as follows:
57
58 MSb LSb
59+------+------+------+--------+--------+-------+---------+--------+
60| VolA | VolB | ???? | Stereo | Radio | TuneA | TuneB | Tune |
61| (+) | (-) | | Detect | Audio | (bit) | (latch) | Update |
62| | | | Enable | Enable | | | Enable |
63+------+------+------+--------+--------+-------+---------+--------+
64
65
66VolA . VolB [AB......]
67-----------
680 0 : audio mute
690 1 : volume + (some delay required)
701 0 : volume - (some delay required)
711 1 : stay at present volume
72
73Stereo Detect Enable [...S....]
74--------------------
750 : No Detect
761 : Detect
77
78 Results available by reading ioport >60 msec after last port write.
79 0xff ==> no stereo detected, 0xfd ==> stereo detected.
80
81Radio to Audio (path) Enable [....R...]
82----------------------------
830 : Disable path (silence)
841 : Enable path (audio produced)
85
86TuneA . TuneB [.....AB.]
87-------------
880 0 : "zero" bit phase 1
890 1 : "zero" bit phase 2
90
911 0 : "one" bit phase 1
921 1 : "one" bit phase 2
93
94 24-bit code, where bits = (freq*40) + 10486188.
95 The Most Significant 11 bits must be 1010 xxxx 0x0 to be valid.
96 The bits are shifted in LSb first.
97
98Tune Update Enable [.......T]
99------------------
1000 : Tuner held constant
1011 : Tuner updating in progress
102
103
104PROGRAMMING EXAMPLES
105--------------------
106Default: BASE <-- 0xc8 (current volume, no stereo detect,
107 radio enable, tuner adjust disable)
108
109Card Off: BASE <-- 0x00 (audio mute, no stereo detect,
110 radio disable, tuner adjust disable)
111
112Card On: BASE <-- 0x00 (see "Card Off", clears any unfinished business)
113 BASE <-- 0xc8 (see "Default")
114
115Volume Down: BASE <-- 0x48 (volume down, no stereo detect,
116 radio enable, tuner adjust disable)
117 * wait 10 msec *
118 BASE <-- 0xc8 (see "Default")
119
120Volume Up: BASE <-- 0x88 (volume up, no stereo detect,
121 radio enable, tuner adjust disable)
122 * wait 10 msec *
123 BASE <-- 0xc8 (see "Default")
124
125Check Stereo: BASE <-- 0xd8 (current volume, stereo detect,
126 radio enable, tuner adjust disable)
127 * wait 100 msec *
128 x <-- BASE (read ioport)
129 BASE <-- 0xc8 (see "Default")
130
131 x=0xff ==> "not stereo", x=0xfd ==> "stereo detected"
132
133Set Frequency: code = (freq*40) + 10486188
134 foreach of the 24 bits in code,
135 (from Least to Most Significant):
136 to write a "zero" bit,
137 BASE <-- 0x01 (audio mute, no stereo detect, radio
138 disable, "zero" bit phase 1, tuner adjust)
139 BASE <-- 0x03 (audio mute, no stereo detect, radio
140 disable, "zero" bit phase 2, tuner adjust)
141 to write a "one" bit,
142 BASE <-- 0x05 (audio mute, no stereo detect, radio
143 disable, "one" bit phase 1, tuner adjust)
144 BASE <-- 0x07 (audio mute, no stereo detect, radio
145 disable, "one" bit phase 2, tuner adjust)
146
147----------------------------------------------------------------------------
diff --git a/Documentation/video4linux/si4713.txt b/Documentation/video4linux/si4713.txt
deleted file mode 100644
index 2ddc6b095a76..000000000000
--- a/Documentation/video4linux/si4713.txt
+++ /dev/null
@@ -1,176 +0,0 @@
1Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
2
3Copyright (c) 2009 Nokia Corporation
4Contact: Eduardo Valentin <eduardo.valentin@nokia.com>
5
6
7Information about the Device
8============================
9This chip is a Silicon Labs product. It is a I2C device, currently on 0x63 address.
10Basically, it has transmission and signal noise level measurement features.
11
12The Si4713 integrates transmit functions for FM broadcast stereo transmission.
13The chip also allows integrated receive power scanning to identify low signal
14power FM channels.
15
16The chip is programmed using commands and responses. There are also several
17properties which can change the behavior of this chip.
18
19Users must comply with local regulations on radio frequency (RF) transmission.
20
21Device driver description
22=========================
23There are two modules to handle this device. One is a I2C device driver
24and the other is a platform driver.
25
26The I2C device driver exports a v4l2-subdev interface to the kernel.
27All properties can also be accessed by v4l2 extended controls interface, by
28using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
29
30The platform device driver exports a v4l2 radio device interface to user land.
31So, it uses the I2C device driver as a sub device in order to send the user
32commands to the actual device. Basically it is a wrapper to the I2C device driver.
33
34Applications can use v4l2 radio API to specify frequency of operation, mute state,
35etc. But mostly of its properties will be present in the extended controls.
36
37When the v4l2 mute property is set to 1 (true), the driver will turn the chip off.
38
39Properties description
40======================
41
42The properties can be accessed using v4l2 extended controls.
43Here is an output from v4l2-ctl util:
44/ # v4l2-ctl -d /dev/radio0 --all -L
45Driver Info:
46 Driver name : radio-si4713
47 Card type : Silicon Labs Si4713 Modulator
48 Bus info :
49 Driver version: 0
50 Capabilities : 0x00080800
51 RDS Output
52 Modulator
53Audio output: 0 (FM Modulator Audio Out)
54Frequency: 1408000 (88.000000 MHz)
55Video Standard = 0x00000000
56Modulator:
57 Name : FM Modulator
58 Capabilities : 62.5 Hz stereo rds
59 Frequency range : 76.0 MHz - 108.0 MHz
60 Subchannel modulation: stereo+rds
61
62User Controls
63
64 mute (bool) : default=1 value=0
65
66FM Radio Modulator Controls
67
68 rds_signal_deviation (int) : min=0 max=90000 step=10 default=200 value=200 flags=slider
69 rds_program_id (int) : min=0 max=65535 step=1 default=0 value=0
70 rds_program_type (int) : min=0 max=31 step=1 default=0 value=0
71 rds_ps_name (str) : min=0 max=96 step=8 value='si4713 '
72 rds_radio_text (str) : min=0 max=384 step=32 value=''
73 audio_limiter_feature_enabled (bool) : default=1 value=1
74 audio_limiter_release_time (int) : min=250 max=102390 step=50 default=5010 value=5010 flags=slider
75 audio_limiter_deviation (int) : min=0 max=90000 step=10 default=66250 value=66250 flags=slider
76audio_compression_feature_enabl (bool) : default=1 value=1
77 audio_compression_gain (int) : min=0 max=20 step=1 default=15 value=15 flags=slider
78 audio_compression_threshold (int) : min=-40 max=0 step=1 default=-40 value=-40 flags=slider
79 audio_compression_attack_time (int) : min=0 max=5000 step=500 default=0 value=0 flags=slider
80 audio_compression_release_time (int) : min=100000 max=1000000 step=100000 default=1000000 value=1000000 flags=slider
81 pilot_tone_feature_enabled (bool) : default=1 value=1
82 pilot_tone_deviation (int) : min=0 max=90000 step=10 default=6750 value=6750 flags=slider
83 pilot_tone_frequency (int) : min=0 max=19000 step=1 default=19000 value=19000 flags=slider
84 pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
85 tune_power_level (int) : min=0 max=120 step=1 default=88 value=88 flags=slider
86 tune_antenna_capacitor (int) : min=0 max=191 step=1 default=0 value=110 flags=slider
87/ #
88
89Here is a summary of them:
90
91* Pilot is an audible tone sent by the device.
92
93pilot_frequency - Configures the frequency of the stereo pilot tone.
94pilot_deviation - Configures pilot tone frequency deviation level.
95pilot_enabled - Enables or disables the pilot tone feature.
96
97* The si4713 device is capable of applying audio compression to the transmitted signal.
98
99acomp_enabled - Enables or disables the audio dynamic range control feature.
100acomp_gain - Sets the gain for audio dynamic range control.
101acomp_threshold - Sets the threshold level for audio dynamic range control.
102acomp_attack_time - Sets the attack time for audio dynamic range control.
103acomp_release_time - Sets the release time for audio dynamic range control.
104
105* Limiter setups audio deviation limiter feature. Once a over deviation occurs,
106it is possible to adjust the front-end gain of the audio input and always
107prevent over deviation.
108
109limiter_enabled - Enables or disables the limiter feature.
110limiter_deviation - Configures audio frequency deviation level.
111limiter_release_time - Sets the limiter release time.
112
113* Tuning power
114
115power_level - Sets the output power level for signal transmission.
116antenna_capacitor - This selects the value of antenna tuning capacitor manually
117or automatically if set to zero.
118
119* RDS related
120
121rds_ps_name - Sets the RDS ps name field for transmission.
122rds_radio_text - Sets the RDS radio text for transmission.
123rds_pi - Sets the RDS PI field for transmission.
124rds_pty - Sets the RDS PTY field for transmission.
125
126* Region related
127
128preemphasis - sets the preemphasis to be applied for transmission.
129
130RNL
131===
132
133This device also has an interface to measure received noise level. To do that, you should
134ioctl the device node. Here is an code of example:
135
136int main (int argc, char *argv[])
137{
138 struct si4713_rnl rnl;
139 int fd = open("/dev/radio0", O_RDWR);
140 int rval;
141
142 if (argc < 2)
143 return -EINVAL;
144
145 if (fd < 0)
146 return fd;
147
148 sscanf(argv[1], "%d", &rnl.frequency);
149
150 rval = ioctl(fd, SI4713_IOC_MEASURE_RNL, &rnl);
151 if (rval < 0)
152 return rval;
153
154 printf("received noise level: %d\n", rnl.rnl);
155
156 close(fd);
157}
158
159The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under
160include/linux/platform_data/media/si4713.h.
161
162Stereo/Mono and RDS subchannels
163===============================
164
165The device can also be configured using the available sub channels for
166transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly.
167Refer to the V4L2 API specification for proper use of this ioctl.
168
169Testing
170=======
171Testing is usually done with v4l2-ctl utility for managing FM tuner cards.
172The tool can be found in v4l-dvb repository under v4l2-apps/util directory.
173
174Example for setting rds ps name:
175# v4l2-ctl -d /dev/radio0 --set-ctrl=rds_ps_name="Dummy"
176
diff --git a/Documentation/video4linux/si476x.txt b/Documentation/video4linux/si476x.txt
deleted file mode 100644
index 616607955aaf..000000000000
--- a/Documentation/video4linux/si476x.txt
+++ /dev/null
@@ -1,187 +0,0 @@
1SI476x Driver Readme
2------------------------------------------------
3 Copyright (C) 2013 Andrey Smirnov <andrew.smirnov@gmail.com>
4
5TODO for the driver
6------------------------------
7
8- According to the SiLabs' datasheet it is possible to update the
9 firmware of the radio chip in the run-time, thus bringing it to the
10 most recent version. Unfortunately I couldn't find any mentioning of
11 the said firmware update for the old chips that I tested the driver
12 against, so for chips like that the driver only exposes the old
13 functionality.
14
15
16Parameters exposed over debugfs
17-------------------------------
18SI476x allow user to get multiple characteristics that can be very
19useful for EoL testing/RF performance estimation, parameters that have
20very little to do with V4L2 subsystem. Such parameters are exposed via
21debugfs and can be accessed via regular file I/O operations.
22
23The drivers exposes following files:
24
25* /sys/kernel/debug/<device-name>/acf
26 This file contains ACF(Automatically Controlled Features) status
27 information. The contents of the file is binary data of the
28 following layout:
29
30 Offset | Name | Description
31 ====================================================================
32 0x00 | blend_int | Flag, set when stereo separation has
33 | | crossed below the blend threshold
34 --------------------------------------------------------------------
35 0x01 | hblend_int | Flag, set when HiBlend cutoff
36 | | frequency is lower than threshold
37 --------------------------------------------------------------------
38 0x02 | hicut_int | Flag, set when HiCut cutoff
39 | | frequency is lower than threshold
40 --------------------------------------------------------------------
41 0x03 | chbw_int | Flag, set when channel filter
42 | | bandwidth is less than threshold
43 --------------------------------------------------------------------
44 0x04 | softmute_int | Flag indicating that softmute
45 | | attenuation has increased above
46 | | softmute threshold
47 --------------------------------------------------------------------
48 0x05 | smute | 0 - Audio is not soft muted
49 | | 1 - Audio is soft muted
50 --------------------------------------------------------------------
51 0x06 | smattn | Soft mute attenuation level in dB
52 --------------------------------------------------------------------
53 0x07 | chbw | Channel filter bandwidth in kHz
54 --------------------------------------------------------------------
55 0x08 | hicut | HiCut cutoff frequency in units of
56 | | 100Hz
57 --------------------------------------------------------------------
58 0x09 | hiblend | HiBlend cutoff frequency in units
59 | | of 100 Hz
60 --------------------------------------------------------------------
61 0x10 | pilot | 0 - Stereo pilot is not present
62 | | 1 - Stereo pilot is present
63 --------------------------------------------------------------------
64 0x11 | stblend | Stereo blend in %
65 --------------------------------------------------------------------
66
67
68* /sys/kernel/debug/<device-name>/rds_blckcnt
69 This file contains statistics about RDS receptions. It's binary data
70 has the following layout:
71
72 Offset | Name | Description
73 ====================================================================
74 0x00 | expected | Number of expected RDS blocks
75 --------------------------------------------------------------------
76 0x02 | received | Number of received RDS blocks
77 --------------------------------------------------------------------
78 0x04 | uncorrectable | Number of uncorrectable RDS blocks
79 --------------------------------------------------------------------
80
81* /sys/kernel/debug/<device-name>/agc
82 This file contains information about parameters pertaining to
83 AGC(Automatic Gain Control)
84
85 The layout is:
86 Offset | Name | Description
87 ====================================================================
88 0x00 | mxhi | 0 - FM Mixer PD high threshold is
89 | | not tripped
90 | | 1 - FM Mixer PD high threshold is
91 | | tripped
92 --------------------------------------------------------------------
93 0x01 | mxlo | ditto for FM Mixer PD low
94 --------------------------------------------------------------------
95 0x02 | lnahi | ditto for FM LNA PD high
96 --------------------------------------------------------------------
97 0x03 | lnalo | ditto for FM LNA PD low
98 --------------------------------------------------------------------
99 0x04 | fmagc1 | FMAGC1 attenuator resistance
100 | | (see datasheet for more detail)
101 --------------------------------------------------------------------
102 0x05 | fmagc2 | ditto for FMAGC2
103 --------------------------------------------------------------------
104 0x06 | pgagain | PGA gain in dB
105 --------------------------------------------------------------------
106 0x07 | fmwblang | FM/WB LNA Gain in dB
107 --------------------------------------------------------------------
108
109* /sys/kernel/debug/<device-name>/rsq
110 This file contains information about parameters pertaining to
111 RSQ(Received Signal Quality)
112
113 The layout is:
114 Offset | Name | Description
115 ====================================================================
116 0x00 | multhint | 0 - multipath value has not crossed
117 | | the Multipath high threshold
118 | | 1 - multipath value has crossed
119 | | the Multipath high threshold
120 --------------------------------------------------------------------
121 0x01 | multlint | ditto for Multipath low threshold
122 --------------------------------------------------------------------
123 0x02 | snrhint | 0 - received signal's SNR has not
124 | | crossed high threshold
125 | | 1 - received signal's SNR has
126 | | crossed high threshold
127 --------------------------------------------------------------------
128 0x03 | snrlint | ditto for low threshold
129 --------------------------------------------------------------------
130 0x04 | rssihint | ditto for RSSI high threshold
131 --------------------------------------------------------------------
132 0x05 | rssilint | ditto for RSSI low threshold
133 --------------------------------------------------------------------
134 0x06 | bltf | Flag indicating if seek command
135 | | reached/wrapped seek band limit
136 --------------------------------------------------------------------
137 0x07 | snr_ready | Indicates that SNR metrics is ready
138 --------------------------------------------------------------------
139 0x08 | rssiready | ditto for RSSI metrics
140 --------------------------------------------------------------------
141 0x09 | injside | 0 - Low-side injection is being used
142 | | 1 - High-side injection is used
143 --------------------------------------------------------------------
144 0x10 | afcrl | Flag indicating if AFC rails
145 --------------------------------------------------------------------
146 0x11 | valid | Flag indicating if channel is valid
147 --------------------------------------------------------------------
148 0x12 | readfreq | Current tuned frequency
149 --------------------------------------------------------------------
150 0x14 | freqoff | Signed frequency offset in units of
151 | | 2ppm
152 --------------------------------------------------------------------
153 0x15 | rssi | Signed value of RSSI in dBuV
154 --------------------------------------------------------------------
155 0x16 | snr | Signed RF SNR in dB
156 --------------------------------------------------------------------
157 0x17 | issi | Signed Image Strength Signal
158 | | indicator
159 --------------------------------------------------------------------
160 0x18 | lassi | Signed Low side adjacent Channel
161 | | Strength indicator
162 --------------------------------------------------------------------
163 0x19 | hassi | ditto fpr High side
164 --------------------------------------------------------------------
165 0x20 | mult | Multipath indicator
166 --------------------------------------------------------------------
167 0x21 | dev | Frequency deviation
168 --------------------------------------------------------------------
169 0x24 | assi | Adjacent channel SSI
170 --------------------------------------------------------------------
171 0x25 | usn | Ultrasonic noise indicator
172 --------------------------------------------------------------------
173 0x26 | pilotdev | Pilot deviation in units of 100 Hz
174 --------------------------------------------------------------------
175 0x27 | rdsdev | ditto for RDS
176 --------------------------------------------------------------------
177 0x28 | assidev | ditto for ASSI
178 --------------------------------------------------------------------
179 0x29 | strongdev | Frequency deviation
180 --------------------------------------------------------------------
181 0x30 | rdspi | RDS PI code
182 --------------------------------------------------------------------
183
184* /sys/kernel/debug/<device-name>/rsq_primary
185 This file contains information about parameters pertaining to
186 RSQ(Received Signal Quality) for primary tuner only. Layout is as
187 the one above.
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
deleted file mode 100644
index cbefc7902f5f..000000000000
--- a/Documentation/video4linux/v4l2-framework.txt
+++ /dev/null
@@ -1,1160 +0,0 @@
1Overview of the V4L2 driver framework
2=====================================
3
4This text documents the various structures provided by the V4L2 framework and
5their relationships.
6
7
8Introduction
9------------
10
11The V4L2 drivers tend to be very complex due to the complexity of the
12hardware: most devices have multiple ICs, export multiple device nodes in
13/dev, and create also non-V4L2 devices such as DVB, ALSA, FB, I2C and input
14(IR) devices.
15
16Especially the fact that V4L2 drivers have to setup supporting ICs to
17do audio/video muxing/encoding/decoding makes it more complex than most.
18Usually these ICs are connected to the main bridge driver through one or
19more I2C busses, but other busses can also be used. Such devices are
20called 'sub-devices'.
21
22For a long time the framework was limited to the video_device struct for
23creating V4L device nodes and video_buf for handling the video buffers
24(note that this document does not discuss the video_buf framework).
25
26This meant that all drivers had to do the setup of device instances and
27connecting to sub-devices themselves. Some of this is quite complicated
28to do right and many drivers never did do it correctly.
29
30There is also a lot of common code that could never be refactored due to
31the lack of a framework.
32
33So this framework sets up the basic building blocks that all drivers
34need and this same framework should make it much easier to refactor
35common code into utility functions shared by all drivers.
36
37A good example to look at as a reference is the v4l2-pci-skeleton.c
38source that is available in samples/v4l/. It is a skeleton driver for
39a PCI capture card, and demonstrates how to use the V4L2 driver
40framework. It can be used as a template for real PCI video capture driver.
41
42Structure of a driver
43---------------------
44
45All drivers have the following structure:
46
471) A struct for each device instance containing the device state.
48
492) A way of initializing and commanding sub-devices (if any).
50
513) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX and /dev/radioX)
52 and keeping track of device-node specific data.
53
544) Filehandle-specific structs containing per-filehandle data;
55
565) video buffer handling.
57
58This is a rough schematic of how it all relates:
59
60 device instances
61 |
62 +-sub-device instances
63 |
64 \-V4L2 device nodes
65 |
66 \-filehandle instances
67
68
69Structure of the framework
70--------------------------
71
72The framework closely resembles the driver structure: it has a v4l2_device
73struct for the device instance data, a v4l2_subdev struct to refer to
74sub-device instances, the video_device struct stores V4L2 device node data
75and the v4l2_fh struct keeps track of filehandle instances.
76
77The V4L2 framework also optionally integrates with the media framework. If a
78driver sets the struct v4l2_device mdev field, sub-devices and video nodes
79will automatically appear in the media framework as entities.
80
81
82struct v4l2_device
83------------------
84
85Each device instance is represented by a struct v4l2_device (v4l2-device.h).
86Very simple devices can just allocate this struct, but most of the time you
87would embed this struct inside a larger struct.
88
89You must register the device instance:
90
91 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
92
93Registration will initialize the v4l2_device struct. If the dev->driver_data
94field is NULL, it will be linked to v4l2_dev.
95
96Drivers that want integration with the media device framework need to set
97dev->driver_data manually to point to the driver-specific device structure
98that embed the struct v4l2_device instance. This is achieved by a
99dev_set_drvdata() call before registering the V4L2 device instance. They must
100also set the struct v4l2_device mdev field to point to a properly initialized
101and registered media_device instance.
102
103If v4l2_dev->name is empty then it will be set to a value derived from dev
104(driver name followed by the bus_id, to be precise). If you set it up before
105calling v4l2_device_register then it will be untouched. If dev is NULL, then
106you *must* setup v4l2_dev->name before calling v4l2_device_register.
107
108You can use v4l2_device_set_name() to set the name based on a driver name and
109a driver-global atomic_t instance. This will generate names like ivtv0, ivtv1,
110etc. If the name ends with a digit, then it will insert a dash: cx18-0,
111cx18-1, etc. This function returns the instance number.
112
113The first 'dev' argument is normally the struct device pointer of a pci_dev,
114usb_interface or platform_device. It is rare for dev to be NULL, but it happens
115with ISA devices or when one device creates multiple PCI devices, thus making
116it impossible to associate v4l2_dev with a particular parent.
117
118You can also supply a notify() callback that can be called by sub-devices to
119notify you of events. Whether you need to set this depends on the sub-device.
120Any notifications a sub-device supports must be defined in a header in
121include/media/<subdevice>.h.
122
123You unregister with:
124
125 v4l2_device_unregister(struct v4l2_device *v4l2_dev);
126
127If the dev->driver_data field points to v4l2_dev, it will be reset to NULL.
128Unregistering will also automatically unregister all subdevs from the device.
129
130If you have a hotpluggable device (e.g. a USB device), then when a disconnect
131happens the parent device becomes invalid. Since v4l2_device has a pointer to
132that parent device it has to be cleared as well to mark that the parent is
133gone. To do this call:
134
135 v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
136
137This does *not* unregister the subdevs, so you still need to call the
138v4l2_device_unregister() function for that. If your driver is not hotpluggable,
139then there is no need to call v4l2_device_disconnect().
140
141Sometimes you need to iterate over all devices registered by a specific
142driver. This is usually the case if multiple device drivers use the same
143hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv
144hardware. The same is true for alsa drivers for example.
145
146You can iterate over all registered devices as follows:
147
148static int callback(struct device *dev, void *p)
149{
150 struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
151
152 /* test if this device was inited */
153 if (v4l2_dev == NULL)
154 return 0;
155 ...
156 return 0;
157}
158
159int iterate(void *p)
160{
161 struct device_driver *drv;
162 int err;
163
164 /* Find driver 'ivtv' on the PCI bus.
165 pci_bus_type is a global. For USB busses use usb_bus_type. */
166 drv = driver_find("ivtv", &pci_bus_type);
167 /* iterate over all ivtv device instances */
168 err = driver_for_each_device(drv, NULL, p, callback);
169 put_driver(drv);
170 return err;
171}
172
173Sometimes you need to keep a running counter of the device instance. This is
174commonly used to map a device instance to an index of a module option array.
175
176The recommended approach is as follows:
177
178static atomic_t drv_instance = ATOMIC_INIT(0);
179
180static int drv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
181{
182 ...
183 state->instance = atomic_inc_return(&drv_instance) - 1;
184}
185
186If you have multiple device nodes then it can be difficult to know when it is
187safe to unregister v4l2_device for hotpluggable devices. For this purpose
188v4l2_device has refcounting support. The refcount is increased whenever
189video_register_device is called and it is decreased whenever that device node
190is released. When the refcount reaches zero, then the v4l2_device release()
191callback is called. You can do your final cleanup there.
192
193If other device nodes (e.g. ALSA) are created, then you can increase and
194decrease the refcount manually as well by calling:
195
196void v4l2_device_get(struct v4l2_device *v4l2_dev);
197
198or:
199
200int v4l2_device_put(struct v4l2_device *v4l2_dev);
201
202Since the initial refcount is 1 you also need to call v4l2_device_put in the
203disconnect() callback (for USB devices) or in the remove() callback (for e.g.
204PCI devices), otherwise the refcount will never reach 0.
205
206struct v4l2_subdev
207------------------
208
209Many drivers need to communicate with sub-devices. These devices can do all
210sort of tasks, but most commonly they handle audio and/or video muxing,
211encoding or decoding. For webcams common sub-devices are sensors and camera
212controllers.
213
214Usually these are I2C devices, but not necessarily. In order to provide the
215driver with a consistent interface to these sub-devices the v4l2_subdev struct
216(v4l2-subdev.h) was created.
217
218Each sub-device driver must have a v4l2_subdev struct. This struct can be
219stand-alone for simple sub-devices or it might be embedded in a larger struct
220if more state information needs to be stored. Usually there is a low-level
221device struct (e.g. i2c_client) that contains the device data as setup
222by the kernel. It is recommended to store that pointer in the private
223data of v4l2_subdev using v4l2_set_subdevdata(). That makes it easy to go
224from a v4l2_subdev to the actual low-level bus-specific device data.
225
226You also need a way to go from the low-level struct to v4l2_subdev. For the
227common i2c_client struct the i2c_set_clientdata() call is used to store a
228v4l2_subdev pointer, for other busses you may have to use other methods.
229
230Bridges might also need to store per-subdev private data, such as a pointer to
231bridge-specific per-subdev private data. The v4l2_subdev structure provides
232host private data for that purpose that can be accessed with
233v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata().
234
235From the bridge driver perspective you load the sub-device module and somehow
236obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
237i2c_get_clientdata(). For other busses something similar needs to be done.
238Helper functions exists for sub-devices on an I2C bus that do most of this
239tricky work for you.
240
241Each v4l2_subdev contains function pointers that sub-device drivers can
242implement (or leave NULL if it is not applicable). Since sub-devices can do
243so many different things and you do not want to end up with a huge ops struct
244of which only a handful of ops are commonly implemented, the function pointers
245are sorted according to category and each category has its own ops struct.
246
247The top-level ops struct contains pointers to the category ops structs, which
248may be NULL if the subdev driver does not support anything from that category.
249
250It looks like this:
251
252struct v4l2_subdev_core_ops {
253 int (*log_status)(struct v4l2_subdev *sd);
254 int (*init)(struct v4l2_subdev *sd, u32 val);
255 ...
256};
257
258struct v4l2_subdev_tuner_ops {
259 ...
260};
261
262struct v4l2_subdev_audio_ops {
263 ...
264};
265
266struct v4l2_subdev_video_ops {
267 ...
268};
269
270struct v4l2_subdev_pad_ops {
271 ...
272};
273
274struct v4l2_subdev_ops {
275 const struct v4l2_subdev_core_ops *core;
276 const struct v4l2_subdev_tuner_ops *tuner;
277 const struct v4l2_subdev_audio_ops *audio;
278 const struct v4l2_subdev_video_ops *video;
279 const struct v4l2_subdev_pad_ops *video;
280};
281
282The core ops are common to all subdevs, the other categories are implemented
283depending on the sub-device. E.g. a video device is unlikely to support the
284audio ops and vice versa.
285
286This setup limits the number of function pointers while still making it easy
287to add new ops and categories.
288
289A sub-device driver initializes the v4l2_subdev struct using:
290
291 v4l2_subdev_init(sd, &ops);
292
293Afterwards you need to initialize subdev->name with a unique name and set the
294module owner. This is done for you if you use the i2c helper functions.
295
296If integration with the media framework is needed, you must initialize the
297media_entity struct embedded in the v4l2_subdev struct (entity field) by
298calling media_entity_pads_init(), if the entity has pads:
299
300 struct media_pad *pads = &my_sd->pads;
301 int err;
302
303 err = media_entity_pads_init(&sd->entity, npads, pads);
304
305The pads array must have been previously initialized. There is no need to
306manually set the struct media_entity function and name fields, but the
307revision field must be initialized if needed.
308
309A reference to the entity will be automatically acquired/released when the
310subdev device node (if any) is opened/closed.
311
312Don't forget to cleanup the media entity before the sub-device is destroyed:
313
314 media_entity_cleanup(&sd->entity);
315
316If the subdev driver intends to process video and integrate with the media
317framework, it must implement format related functionality using
318v4l2_subdev_pad_ops instead of v4l2_subdev_video_ops.
319
320In that case, the subdev driver may set the link_validate field to provide
321its own link validation function. The link validation function is called for
322every link in the pipeline where both of the ends of the links are V4L2
323sub-devices. The driver is still responsible for validating the correctness
324of the format configuration between sub-devices and video nodes.
325
326If link_validate op is not set, the default function
327v4l2_subdev_link_validate_default() is used instead. This function ensures
328that width, height and the media bus pixel code are equal on both source and
329sink of the link. Subdev drivers are also free to use this function to
330perform the checks mentioned above in addition to their own checks.
331
332There are currently two ways to register subdevices with the V4L2 core. The
333first (traditional) possibility is to have subdevices registered by bridge
334drivers. This can be done when the bridge driver has the complete information
335about subdevices connected to it and knows exactly when to register them. This
336is typically the case for internal subdevices, like video data processing units
337within SoCs or complex PCI(e) boards, camera sensors in USB cameras or connected
338to SoCs, which pass information about them to bridge drivers, usually in their
339platform data.
340
341There are however also situations where subdevices have to be registered
342asynchronously to bridge devices. An example of such a configuration is a Device
343Tree based system where information about subdevices is made available to the
344system independently from the bridge devices, e.g. when subdevices are defined
345in DT as I2C device nodes. The API used in this second case is described further
346below.
347
348Using one or the other registration method only affects the probing process, the
349run-time bridge-subdevice interaction is in both cases the same.
350
351In the synchronous case a device (bridge) driver needs to register the
352v4l2_subdev with the v4l2_device:
353
354 int err = v4l2_device_register_subdev(v4l2_dev, sd);
355
356This can fail if the subdev module disappeared before it could be registered.
357After this function was called successfully the subdev->dev field points to
358the v4l2_device.
359
360If the v4l2_device parent device has a non-NULL mdev field, the sub-device
361entity will be automatically registered with the media device.
362
363You can unregister a sub-device using:
364
365 v4l2_device_unregister_subdev(sd);
366
367Afterwards the subdev module can be unloaded and sd->dev == NULL.
368
369You can call an ops function either directly:
370
371 err = sd->ops->core->g_std(sd, &norm);
372
373but it is better and easier to use this macro:
374
375 err = v4l2_subdev_call(sd, core, g_std, &norm);
376
377The macro will to the right NULL pointer checks and returns -ENODEV if subdev
378is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_std is
379NULL, or the actual result of the subdev->ops->core->g_std ops.
380
381It is also possible to call all or a subset of the sub-devices:
382
383 v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
384
385Any subdev that does not support this ops is skipped and error results are
386ignored. If you want to check for errors use this:
387
388 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
389
390Any error except -ENOIOCTLCMD will exit the loop with that error. If no
391errors (except -ENOIOCTLCMD) occurred, then 0 is returned.
392
393The second argument to both calls is a group ID. If 0, then all subdevs are
394called. If non-zero, then only those whose group ID match that value will
395be called. Before a bridge driver registers a subdev it can set sd->grp_id
396to whatever value it wants (it's 0 by default). This value is owned by the
397bridge driver and the sub-device driver will never modify or use it.
398
399The group ID gives the bridge driver more control how callbacks are called.
400For example, there may be multiple audio chips on a board, each capable of
401changing the volume. But usually only one will actually be used when the
402user want to change the volume. You can set the group ID for that subdev to
403e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling
404v4l2_device_call_all(). That ensures that it will only go to the subdev
405that needs it.
406
407If the sub-device needs to notify its v4l2_device parent of an event, then
408it can call v4l2_subdev_notify(sd, notification, arg). This macro checks
409whether there is a notify() callback defined and returns -ENODEV if not.
410Otherwise the result of the notify() call is returned.
411
412The advantage of using v4l2_subdev is that it is a generic struct and does
413not contain any knowledge about the underlying hardware. So a driver might
414contain several subdevs that use an I2C bus, but also a subdev that is
415controlled through GPIO pins. This distinction is only relevant when setting
416up the device, but once the subdev is registered it is completely transparent.
417
418
419In the asynchronous case subdevice probing can be invoked independently of the
420bridge driver availability. The subdevice driver then has to verify whether all
421the requirements for a successful probing are satisfied. This can include a
422check for a master clock availability. If any of the conditions aren't satisfied
423the driver might decide to return -EPROBE_DEFER to request further reprobing
424attempts. Once all conditions are met the subdevice shall be registered using
425the v4l2_async_register_subdev() function. Unregistration is performed using
426the v4l2_async_unregister_subdev() call. Subdevices registered this way are
427stored in a global list of subdevices, ready to be picked up by bridge drivers.
428
429Bridge drivers in turn have to register a notifier object with an array of
430subdevice descriptors that the bridge device needs for its operation. This is
431performed using the v4l2_async_notifier_register() call. To unregister the
432notifier the driver has to call v4l2_async_notifier_unregister(). The former of
433the two functions takes two arguments: a pointer to struct v4l2_device and a
434pointer to struct v4l2_async_notifier. The latter contains a pointer to an array
435of pointers to subdevice descriptors of type struct v4l2_async_subdev type. The
436V4L2 core will then use these descriptors to match asynchronously registered
437subdevices to them. If a match is detected the .bound() notifier callback is
438called. After all subdevices have been located the .complete() callback is
439called. When a subdevice is removed from the system the .unbind() method is
440called. All three callbacks are optional.
441
442
443V4L2 sub-device userspace API
444-----------------------------
445
446Beside exposing a kernel API through the v4l2_subdev_ops structure, V4L2
447sub-devices can also be controlled directly by userspace applications.
448
449Device nodes named v4l-subdevX can be created in /dev to access sub-devices
450directly. If a sub-device supports direct userspace configuration it must set
451the V4L2_SUBDEV_FL_HAS_DEVNODE flag before being registered.
452
453After registering sub-devices, the v4l2_device driver can create device nodes
454for all registered sub-devices marked with V4L2_SUBDEV_FL_HAS_DEVNODE by calling
455v4l2_device_register_subdev_nodes(). Those device nodes will be automatically
456removed when sub-devices are unregistered.
457
458The device node handles a subset of the V4L2 API.
459
460VIDIOC_QUERYCTRL
461VIDIOC_QUERYMENU
462VIDIOC_G_CTRL
463VIDIOC_S_CTRL
464VIDIOC_G_EXT_CTRLS
465VIDIOC_S_EXT_CTRLS
466VIDIOC_TRY_EXT_CTRLS
467
468 The controls ioctls are identical to the ones defined in V4L2. They
469 behave identically, with the only exception that they deal only with
470 controls implemented in the sub-device. Depending on the driver, those
471 controls can be also be accessed through one (or several) V4L2 device
472 nodes.
473
474VIDIOC_DQEVENT
475VIDIOC_SUBSCRIBE_EVENT
476VIDIOC_UNSUBSCRIBE_EVENT
477
478 The events ioctls are identical to the ones defined in V4L2. They
479 behave identically, with the only exception that they deal only with
480 events generated by the sub-device. Depending on the driver, those
481 events can also be reported by one (or several) V4L2 device nodes.
482
483 Sub-device drivers that want to use events need to set the
484 V4L2_SUBDEV_USES_EVENTS v4l2_subdev::flags and initialize
485 v4l2_subdev::nevents to events queue depth before registering the
486 sub-device. After registration events can be queued as usual on the
487 v4l2_subdev::devnode device node.
488
489 To properly support events, the poll() file operation is also
490 implemented.
491
492Private ioctls
493
494 All ioctls not in the above list are passed directly to the sub-device
495 driver through the core::ioctl operation.
496
497
498I2C sub-device drivers
499----------------------
500
501Since these drivers are so common, special helper functions are available to
502ease the use of these drivers (v4l2-common.h).
503
504The recommended method of adding v4l2_subdev support to an I2C driver is to
505embed the v4l2_subdev struct into the state struct that is created for each
506I2C device instance. Very simple devices have no state struct and in that case
507you can just create a v4l2_subdev directly.
508
509A typical state struct would look like this (where 'chipname' is replaced by
510the name of the chip):
511
512struct chipname_state {
513 struct v4l2_subdev sd;
514 ... /* additional state fields */
515};
516
517Initialize the v4l2_subdev struct as follows:
518
519 v4l2_i2c_subdev_init(&state->sd, client, subdev_ops);
520
521This function will fill in all the fields of v4l2_subdev and ensure that the
522v4l2_subdev and i2c_client both point to one another.
523
524You should also add a helper inline function to go from a v4l2_subdev pointer
525to a chipname_state struct:
526
527static inline struct chipname_state *to_state(struct v4l2_subdev *sd)
528{
529 return container_of(sd, struct chipname_state, sd);
530}
531
532Use this to go from the v4l2_subdev struct to the i2c_client struct:
533
534 struct i2c_client *client = v4l2_get_subdevdata(sd);
535
536And this to go from an i2c_client to a v4l2_subdev struct:
537
538 struct v4l2_subdev *sd = i2c_get_clientdata(client);
539
540Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
541is called. This will unregister the sub-device from the bridge driver. It is
542safe to call this even if the sub-device was never registered.
543
544You need to do this because when the bridge driver destroys the i2c adapter
545the remove() callbacks are called of the i2c devices on that adapter.
546After that the corresponding v4l2_subdev structures are invalid, so they
547have to be unregistered first. Calling v4l2_device_unregister_subdev(sd)
548from the remove() callback ensures that this is always done correctly.
549
550
551The bridge driver also has some helper functions it can use:
552
553struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter,
554 "module_foo", "chipid", 0x36, NULL);
555
556This loads the given module (can be NULL if no module needs to be loaded) and
557calls i2c_new_device() with the given i2c_adapter and chip/address arguments.
558If all goes well, then it registers the subdev with the v4l2_device.
559
560You can also use the last argument of v4l2_i2c_new_subdev() to pass an array
561of possible I2C addresses that it should probe. These probe addresses are
562only used if the previous argument is 0. A non-zero argument means that you
563know the exact i2c address so in that case no probing will take place.
564
565Both functions return NULL if something went wrong.
566
567Note that the chipid you pass to v4l2_i2c_new_subdev() is usually
568the same as the module name. It allows you to specify a chip variant, e.g.
569"saa7114" or "saa7115". In general though the i2c driver autodetects this.
570The use of chipid is something that needs to be looked at more closely at a
571later date. It differs between i2c drivers and as such can be confusing.
572To see which chip variants are supported you can look in the i2c driver code
573for the i2c_device_id table. This lists all the possibilities.
574
575There are two more helper functions:
576
577v4l2_i2c_new_subdev_cfg: this function adds new irq and platform_data
578arguments and has both 'addr' and 'probed_addrs' arguments: if addr is not
5790 then that will be used (non-probing variant), otherwise the probed_addrs
580are probed.
581
582For example: this will probe for address 0x10:
583
584struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
585 "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
586
587v4l2_i2c_new_subdev_board uses an i2c_board_info struct which is passed
588to the i2c driver and replaces the irq, platform_data and addr arguments.
589
590If the subdev supports the s_config core ops, then that op is called with
591the irq and platform_data arguments after the subdev was setup. The older
592v4l2_i2c_new_(probed_)subdev functions will call s_config as well, but with
593irq set to 0 and platform_data set to NULL.
594
595struct video_device
596-------------------
597
598The actual device nodes in the /dev directory are created using the
599video_device struct (v4l2-dev.h). This struct can either be allocated
600dynamically or embedded in a larger struct.
601
602To allocate it dynamically use:
603
604 struct video_device *vdev = video_device_alloc();
605
606 if (vdev == NULL)
607 return -ENOMEM;
608
609 vdev->release = video_device_release;
610
611If you embed it in a larger struct, then you must set the release()
612callback to your own function:
613
614 struct video_device *vdev = &my_vdev->vdev;
615
616 vdev->release = my_vdev_release;
617
618The release callback must be set and it is called when the last user
619of the video device exits.
620
621The default video_device_release() callback just calls kfree to free the
622allocated memory.
623
624There is also a video_device_release_empty() function that does nothing
625(is empty) and can be used if the struct is embedded and there is nothing
626to do when it is released.
627
628You should also set these fields:
629
630- v4l2_dev: must be set to the v4l2_device parent device.
631
632- name: set to something descriptive and unique.
633
634- vfl_dir: set this to VFL_DIR_RX for capture devices (VFL_DIR_RX has value 0,
635 so this is normally already the default), set to VFL_DIR_TX for output
636 devices and VFL_DIR_M2M for mem2mem (codec) devices.
637
638- fops: set to the v4l2_file_operations struct.
639
640- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
641 (highly recommended to use this and it might become compulsory in the
642 future!), then set this to your v4l2_ioctl_ops struct. The vfl_type and
643 vfl_dir fields are used to disable ops that do not match the type/dir
644 combination. E.g. VBI ops are disabled for non-VBI nodes, and output ops
645 are disabled for a capture device. This makes it possible to provide
646 just one v4l2_ioctl_ops struct for both vbi and video nodes.
647
648- lock: leave to NULL if you want to do all the locking in the driver.
649 Otherwise you give it a pointer to a struct mutex_lock and before the
650 unlocked_ioctl file operation is called this lock will be taken by the
651 core and released afterwards. See the next section for more details.
652
653- queue: a pointer to the struct vb2_queue associated with this device node.
654 If queue is non-NULL, and queue->lock is non-NULL, then queue->lock is
655 used for the queuing ioctls (VIDIOC_REQBUFS, CREATE_BUFS, QBUF, DQBUF,
656 QUERYBUF, PREPARE_BUF, STREAMON and STREAMOFF) instead of the lock above.
657 That way the vb2 queuing framework does not have to wait for other ioctls.
658 This queue pointer is also used by the vb2 helper functions to check for
659 queuing ownership (i.e. is the filehandle calling it allowed to do the
660 operation).
661
662- prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY.
663 If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device.
664 If you want to have a separate priority state per (group of) device node(s),
665 then you can point it to your own struct v4l2_prio_state.
666
667- dev_parent: you only set this if v4l2_device was registered with NULL as
668 the parent device struct. This only happens in cases where one hardware
669 device has multiple PCI devices that all share the same v4l2_device core.
670
671 The cx88 driver is an example of this: one core v4l2_device struct, but
672 it is used by both a raw video PCI device (cx8800) and a MPEG PCI device
673 (cx8802). Since the v4l2_device cannot be associated with two PCI devices
674 at the same time it is setup without a parent device. But when the struct
675 video_device is initialized you *do* know which parent PCI device to use and
676 so you set dev_device to the correct PCI device.
677
678If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to video_ioctl2
679in your v4l2_file_operations struct.
680
681Do not use .ioctl! This is deprecated and will go away in the future.
682
683In some cases you want to tell the core that a function you had specified in
684your v4l2_ioctl_ops should be ignored. You can mark such ioctls by calling this
685function before video_device_register is called:
686
687void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd);
688
689This tends to be needed if based on external factors (e.g. which card is
690being used) you want to turns off certain features in v4l2_ioctl_ops without
691having to make a new struct.
692
693The v4l2_file_operations struct is a subset of file_operations. The main
694difference is that the inode argument is omitted since it is never used.
695
696If integration with the media framework is needed, you must initialize the
697media_entity struct embedded in the video_device struct (entity field) by
698calling media_entity_pads_init():
699
700 struct media_pad *pad = &my_vdev->pad;
701 int err;
702
703 err = media_entity_pads_init(&vdev->entity, 1, pad);
704
705The pads array must have been previously initialized. There is no need to
706manually set the struct media_entity type and name fields.
707
708A reference to the entity will be automatically acquired/released when the
709video device is opened/closed.
710
711ioctls and locking
712------------------
713
714The V4L core provides optional locking services. The main service is the
715lock field in struct video_device, which is a pointer to a mutex. If you set
716this pointer, then that will be used by unlocked_ioctl to serialize all ioctls.
717
718If you are using the videobuf2 framework, then there is a second lock that you
719can set: video_device->queue->lock. If set, then this lock will be used instead
720of video_device->lock to serialize all queuing ioctls (see the previous section
721for the full list of those ioctls).
722
723The advantage of using a different lock for the queuing ioctls is that for some
724drivers (particularly USB drivers) certain commands such as setting controls
725can take a long time, so you want to use a separate lock for the buffer queuing
726ioctls. That way your VIDIOC_DQBUF doesn't stall because the driver is busy
727changing the e.g. exposure of the webcam.
728
729Of course, you can always do all the locking yourself by leaving both lock
730pointers at NULL.
731
732If you use the old videobuf then you must pass the video_device lock to the
733videobuf queue initialize function: if videobuf has to wait for a frame to
734arrive, then it will temporarily unlock the lock and relock it afterwards. If
735your driver also waits in the code, then you should do the same to allow other
736processes to access the device node while the first process is waiting for
737something.
738
739In the case of videobuf2 you will need to implement the wait_prepare and
740wait_finish callbacks to unlock/lock if applicable. If you use the queue->lock
741pointer, then you can use the helper functions vb2_ops_wait_prepare/finish.
742
743The implementation of a hotplug disconnect should also take the lock from
744video_device before calling v4l2_device_disconnect. If you are also using
745video_device->queue->lock, then you have to first lock video_device->queue->lock
746followed by video_device->lock. That way you can be sure no ioctl is running
747when you call v4l2_device_disconnect.
748
749video_device registration
750-------------------------
751
752Next you register the video device: this will create the character device
753for you.
754
755 err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
756 if (err) {
757 video_device_release(vdev); /* or kfree(my_vdev); */
758 return err;
759 }
760
761If the v4l2_device parent device has a non-NULL mdev field, the video device
762entity will be automatically registered with the media device.
763
764Which device is registered depends on the type argument. The following
765types exist:
766
767VFL_TYPE_GRABBER: videoX for video input/output devices
768VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext)
769VFL_TYPE_RADIO: radioX for radio tuners
770VFL_TYPE_SDR: swradioX for Software Defined Radio tuners
771
772The last argument gives you a certain amount of control over the device
773device node number used (i.e. the X in videoX). Normally you will pass -1
774to let the v4l2 framework pick the first free number. But sometimes users
775want to select a specific node number. It is common that drivers allow
776the user to select a specific device node number through a driver module
777option. That number is then passed to this function and video_register_device
778will attempt to select that device node number. If that number was already
779in use, then the next free device node number will be selected and it
780will send a warning to the kernel log.
781
782Another use-case is if a driver creates many devices. In that case it can
783be useful to place different video devices in separate ranges. For example,
784video capture devices start at 0, video output devices start at 16.
785So you can use the last argument to specify a minimum device node number
786and the v4l2 framework will try to pick the first free number that is equal
787or higher to what you passed. If that fails, then it will just pick the
788first free number.
789
790Since in this case you do not care about a warning about not being able
791to select the specified device node number, you can call the function
792video_register_device_no_warn() instead.
793
794Whenever a device node is created some attributes are also created for you.
795If you look in /sys/class/video4linux you see the devices. Go into e.g.
796video0 and you will see 'name', 'dev_debug' and 'index' attributes. The 'name'
797attribute is the 'name' field of the video_device struct. The 'dev_debug' attribute
798can be used to enable core debugging. See the next section for more detailed
799information on this.
800
801The 'index' attribute is the index of the device node: for each call to
802video_register_device() the index is just increased by 1. The first video
803device node you register always starts with index 0.
804
805Users can setup udev rules that utilize the index attribute to make fancy
806device names (e.g. 'mpegX' for MPEG video capture device nodes).
807
808After the device was successfully registered, then you can use these fields:
809
810- vfl_type: the device type passed to video_register_device.
811- minor: the assigned device minor number.
812- num: the device node number (i.e. the X in videoX).
813- index: the device index number.
814
815If the registration failed, then you need to call video_device_release()
816to free the allocated video_device struct, or free your own struct if the
817video_device was embedded in it. The vdev->release() callback will never
818be called if the registration failed, nor should you ever attempt to
819unregister the device if the registration failed.
820
821video device debugging
822----------------------
823
824The 'dev_debug' attribute that is created for each video, vbi, radio or swradio
825device in /sys/class/video4linux/<devX>/ allows you to enable logging of
826file operations.
827
828It is a bitmask and the following bits can be set:
829
8300x01: Log the ioctl name and error code. VIDIOC_(D)QBUF ioctls are only logged
831 if bit 0x08 is also set.
8320x02: Log the ioctl name arguments and error code. VIDIOC_(D)QBUF ioctls are
833 only logged if bit 0x08 is also set.
8340x04: Log the file operations open, release, read, write, mmap and
835 get_unmapped_area. The read and write operations are only logged if
836 bit 0x08 is also set.
8370x08: Log the read and write file operations and the VIDIOC_QBUF and
838 VIDIOC_DQBUF ioctls.
8390x10: Log the poll file operation.
840
841video_device cleanup
842--------------------
843
844When the video device nodes have to be removed, either during the unload
845of the driver or because the USB device was disconnected, then you should
846unregister them:
847
848 video_unregister_device(vdev);
849
850This will remove the device nodes from sysfs (causing udev to remove them
851from /dev).
852
853After video_unregister_device() returns no new opens can be done. However,
854in the case of USB devices some application might still have one of these
855device nodes open. So after the unregister all file operations (except
856release, of course) will return an error as well.
857
858When the last user of the video device node exits, then the vdev->release()
859callback is called and you can do the final cleanup there.
860
861Don't forget to cleanup the media entity associated with the video device if
862it has been initialized:
863
864 media_entity_cleanup(&vdev->entity);
865
866This can be done from the release callback.
867
868
869video_device helper functions
870-----------------------------
871
872There are a few useful helper functions:
873
874- file/video_device private data
875
876You can set/get driver private data in the video_device struct using:
877
878void *video_get_drvdata(struct video_device *vdev);
879void video_set_drvdata(struct video_device *vdev, void *data);
880
881Note that you can safely call video_set_drvdata() before calling
882video_register_device().
883
884And this function:
885
886struct video_device *video_devdata(struct file *file);
887
888returns the video_device belonging to the file struct.
889
890The video_drvdata function combines video_get_drvdata with video_devdata:
891
892void *video_drvdata(struct file *file);
893
894You can go from a video_device struct to the v4l2_device struct using:
895
896struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
897
898- Device node name
899
900The video_device node kernel name can be retrieved using
901
902const char *video_device_node_name(struct video_device *vdev);
903
904The name is used as a hint by userspace tools such as udev. The function
905should be used where possible instead of accessing the video_device::num and
906video_device::minor fields.
907
908
909video buffer helper functions
910-----------------------------
911
912The v4l2 core API provides a set of standard methods (called "videobuf")
913for dealing with video buffers. Those methods allow a driver to implement
914read(), mmap() and overlay() in a consistent way. There are currently
915methods for using video buffers on devices that supports DMA with
916scatter/gather method (videobuf-dma-sg), DMA with linear access
917(videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers
918(videobuf-vmalloc).
919
920Please see Documentation/video4linux/videobuf for more information on how
921to use the videobuf layer.
922
923struct v4l2_fh
924--------------
925
926struct v4l2_fh provides a way to easily keep file handle specific data
927that is used by the V4L2 framework. New drivers must use struct v4l2_fh
928since it is also used to implement priority handling (VIDIOC_G/S_PRIORITY).
929
930The users of v4l2_fh (in the V4L2 framework, not the driver) know
931whether a driver uses v4l2_fh as its file->private_data pointer by
932testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. This bit is
933set whenever v4l2_fh_init() is called.
934
935struct v4l2_fh is allocated as a part of the driver's own file handle
936structure and file->private_data is set to it in the driver's open
937function by the driver.
938
939In many cases the struct v4l2_fh will be embedded in a larger structure.
940In that case you should call v4l2_fh_init+v4l2_fh_add in open() and
941v4l2_fh_del+v4l2_fh_exit in release().
942
943Drivers can extract their own file handle structure by using the container_of
944macro. Example:
945
946struct my_fh {
947 int blah;
948 struct v4l2_fh fh;
949};
950
951...
952
953int my_open(struct file *file)
954{
955 struct my_fh *my_fh;
956 struct video_device *vfd;
957 int ret;
958
959 ...
960
961 my_fh = kzalloc(sizeof(*my_fh), GFP_KERNEL);
962
963 ...
964
965 v4l2_fh_init(&my_fh->fh, vfd);
966
967 ...
968
969 file->private_data = &my_fh->fh;
970 v4l2_fh_add(&my_fh->fh);
971 return 0;
972}
973
974int my_release(struct file *file)
975{
976 struct v4l2_fh *fh = file->private_data;
977 struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
978
979 ...
980 v4l2_fh_del(&my_fh->fh);
981 v4l2_fh_exit(&my_fh->fh);
982 kfree(my_fh);
983 return 0;
984}
985
986Below is a short description of the v4l2_fh functions used:
987
988void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
989
990 Initialise the file handle. This *MUST* be performed in the driver's
991 v4l2_file_operations->open() handler.
992
993void v4l2_fh_add(struct v4l2_fh *fh)
994
995 Add a v4l2_fh to video_device file handle list. Must be called once the
996 file handle is completely initialized.
997
998void v4l2_fh_del(struct v4l2_fh *fh)
999
1000 Unassociate the file handle from video_device(). The file handle
1001 exit function may now be called.
1002
1003void v4l2_fh_exit(struct v4l2_fh *fh)
1004
1005 Uninitialise the file handle. After uninitialisation the v4l2_fh
1006 memory can be freed.
1007
1008
1009If struct v4l2_fh is not embedded, then you can use these helper functions:
1010
1011int v4l2_fh_open(struct file *filp)
1012
1013 This allocates a struct v4l2_fh, initializes it and adds it to the struct
1014 video_device associated with the file struct.
1015
1016int v4l2_fh_release(struct file *filp)
1017
1018 This deletes it from the struct video_device associated with the file
1019 struct, uninitialised the v4l2_fh and frees it.
1020
1021These two functions can be plugged into the v4l2_file_operation's open() and
1022release() ops.
1023
1024
1025Several drivers need to do something when the first file handle is opened and
1026when the last file handle closes. Two helper functions were added to check
1027whether the v4l2_fh struct is the only open filehandle of the associated
1028device node:
1029
1030int v4l2_fh_is_singular(struct v4l2_fh *fh)
1031
1032 Returns 1 if the file handle is the only open file handle, else 0.
1033
1034int v4l2_fh_is_singular_file(struct file *filp)
1035
1036 Same, but it calls v4l2_fh_is_singular with filp->private_data.
1037
1038
1039V4L2 events
1040-----------
1041
1042The V4L2 events provide a generic way to pass events to user space.
1043The driver must use v4l2_fh to be able to support V4L2 events.
1044
1045Events are defined by a type and an optional ID. The ID may refer to a V4L2
1046object such as a control ID. If unused, then the ID is 0.
1047
1048When the user subscribes to an event the driver will allocate a number of
1049kevent structs for that event. So every (type, ID) event tuple will have
1050its own set of kevent structs. This guarantees that if a driver is generating
1051lots of events of one type in a short time, then that will not overwrite
1052events of another type.
1053
1054But if you get more events of one type than the number of kevents that were
1055reserved, then the oldest event will be dropped and the new one added.
1056
1057Furthermore, the internal struct v4l2_subscribed_event has merge() and
1058replace() callbacks which drivers can set. These callbacks are called when
1059a new event is raised and there is no more room. The replace() callback
1060allows you to replace the payload of the old event with that of the new event,
1061merging any relevant data from the old payload into the new payload that
1062replaces it. It is called when this event type has only one kevent struct
1063allocated. The merge() callback allows you to merge the oldest event payload
1064into that of the second-oldest event payload. It is called when there are two
1065or more kevent structs allocated.
1066
1067This way no status information is lost, just the intermediate steps leading
1068up to that state.
1069
1070A good example of these replace/merge callbacks is in v4l2-event.c:
1071ctrls_replace() and ctrls_merge() callbacks for the control event.
1072
1073Note: these callbacks can be called from interrupt context, so they must be
1074fast.
1075
1076Useful functions:
1077
1078void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
1079
1080 Queue events to video device. The driver's only responsibility is to fill
1081 in the type and the data fields. The other fields will be filled in by
1082 V4L2.
1083
1084int v4l2_event_subscribe(struct v4l2_fh *fh,
1085 struct v4l2_event_subscription *sub, unsigned elems,
1086 const struct v4l2_subscribed_event_ops *ops)
1087
1088 The video_device->ioctl_ops->vidioc_subscribe_event must check the driver
1089 is able to produce events with specified event id. Then it calls
1090 v4l2_event_subscribe() to subscribe the event.
1091
1092 The elems argument is the size of the event queue for this event. If it is 0,
1093 then the framework will fill in a default value (this depends on the event
1094 type).
1095
1096 The ops argument allows the driver to specify a number of callbacks:
1097 * add: called when a new listener gets added (subscribing to the same
1098 event twice will only cause this callback to get called once)
1099 * del: called when a listener stops listening
1100 * replace: replace event 'old' with event 'new'.
1101 * merge: merge event 'old' into event 'new'.
1102 All 4 callbacks are optional, if you don't want to specify any callbacks
1103 the ops argument itself maybe NULL.
1104
1105int v4l2_event_unsubscribe(struct v4l2_fh *fh,
1106 struct v4l2_event_subscription *sub)
1107
1108 vidioc_unsubscribe_event in struct v4l2_ioctl_ops. A driver may use
1109 v4l2_event_unsubscribe() directly unless it wants to be involved in
1110 unsubscription process.
1111
1112 The special type V4L2_EVENT_ALL may be used to unsubscribe all events. The
1113 drivers may want to handle this in a special way.
1114
1115int v4l2_event_pending(struct v4l2_fh *fh)
1116
1117 Returns the number of pending events. Useful when implementing poll.
1118
1119Events are delivered to user space through the poll system call. The driver
1120can use v4l2_fh->wait (a wait_queue_head_t) as the argument for poll_wait().
1121
1122There are standard and private events. New standard events must use the
1123smallest available event type. The drivers must allocate their events from
1124their own class starting from class base. Class base is
1125V4L2_EVENT_PRIVATE_START + n * 1000 where n is the lowest available number.
1126The first event type in the class is reserved for future use, so the first
1127available event type is 'class base + 1'.
1128
1129An example on how the V4L2 events may be used can be found in the OMAP
11303 ISP driver (drivers/media/platform/omap3isp).
1131
1132A subdev can directly send an event to the v4l2_device notify function with
1133V4L2_DEVICE_NOTIFY_EVENT. This allows the bridge to map the subdev that sends
1134the event to the video node(s) associated with the subdev that need to be
1135informed about such an event.
1136
1137V4L2 clocks
1138-----------
1139
1140Many subdevices, like camera sensors, TV decoders and encoders, need a clock
1141signal to be supplied by the system. Often this clock is supplied by the
1142respective bridge device. The Linux kernel provides a Common Clock Framework for
1143this purpose. However, it is not (yet) available on all architectures. Besides,
1144the nature of the multi-functional (clock, data + synchronisation, I2C control)
1145connection of subdevices to the system might impose special requirements on the
1146clock API usage. E.g. V4L2 has to support clock provider driver unregistration
1147while a subdevice driver is holding a reference to the clock. For these reasons
1148a V4L2 clock helper API has been developed and is provided to bridge and
1149subdevice drivers.
1150
1151The API consists of two parts: two functions to register and unregister a V4L2
1152clock source: v4l2_clk_register() and v4l2_clk_unregister() and calls to control
1153a clock object, similar to the respective generic clock API calls:
1154v4l2_clk_get(), v4l2_clk_put(), v4l2_clk_enable(), v4l2_clk_disable(),
1155v4l2_clk_get_rate(), and v4l2_clk_set_rate(). Clock suppliers have to provide
1156clock operations that will be called when clock users invoke respective API
1157methods.
1158
1159It is expected that once the CCF becomes available on all relevant
1160architectures this API will be removed.
diff --git a/drivers/media/dvb-core/demux.h b/drivers/media/dvb-core/demux.h
index 7f1dffef4353..4b4c1da20f4b 100644
--- a/drivers/media/dvb-core/demux.h
+++ b/drivers/media/dvb-core/demux.h
@@ -1,6 +1,10 @@
1/* 1/*
2 * demux.h 2 * demux.h
3 * 3 *
4 * The Kernel Digital TV Demux kABI defines a driver-internal interface for
5 * registering low-level, hardware specific driver to a hardware independent
6 * demux layer.
7 *
4 * Copyright (c) 2002 Convergence GmbH 8 * Copyright (c) 2002 Convergence GmbH
5 * 9 *
6 * based on code: 10 * based on code:
@@ -32,49 +36,6 @@
32#include <linux/time.h> 36#include <linux/time.h>
33#include <linux/dvb/dmx.h> 37#include <linux/dvb/dmx.h>
34 38
35/**
36 * DOC: Digital TV Demux
37 *
38 * The Kernel Digital TV Demux kABI defines a driver-internal interface for
39 * registering low-level, hardware specific driver to a hardware independent
40 * demux layer. It is only of interest for Digital TV device driver writers.
41 * The header file for this kABI is named demux.h and located in
42 * drivers/media/dvb-core.
43 *
44 * The demux kABI should be implemented for each demux in the system. It is
45 * used to select the TS source of a demux and to manage the demux resources.
46 * When the demux client allocates a resource via the demux kABI, it receives
47 * a pointer to the kABI of that resource.
48 *
49 * Each demux receives its TS input from a DVB front-end or from memory, as
50 * set via this demux kABI. In a system with more than one front-end, the kABI
51 * can be used to select one of the DVB front-ends as a TS source for a demux,
52 * unless this is fixed in the HW platform.
53 *
54 * The demux kABI only controls front-ends regarding to their connections with
55 * demuxes; the kABI used to set the other front-end parameters, such as
56 * tuning, are devined via the Digital TV Frontend kABI.
57 *
58 * The functions that implement the abstract interface demux should be defined
59 * static or module private and registered to the Demux core for external
60 * access. It is not necessary to implement every function in the struct
61 * &dmx_demux. For example, a demux interface might support Section filtering,
62 * but not PES filtering. The kABI client is expected to check the value of any
63 * function pointer before calling the function: the value of NULL means
64 * that the function is not available.
65 *
66 * Whenever the functions of the demux API modify shared data, the
67 * possibilities of lost update and race condition problems should be
68 * addressed, e.g. by protecting parts of code with mutexes.
69 *
70 * Note that functions called from a bottom half context must not sleep.
71 * Even a simple memory allocation without using %GFP_ATOMIC can result in a
72 * kernel thread being put to sleep if swapping is needed. For example, the
73 * Linux Kernel calls the functions of a network device interface from a
74 * bottom half context. Thus, if a demux kABI function is called from network
75 * device code, the function must not sleep.
76 */
77
78/* 39/*
79 * Common definitions 40 * Common definitions
80 */ 41 */
@@ -104,7 +65,7 @@
104 */ 65 */
105 66
106/** 67/**
107 * enum ts_filter_type - filter type bitmap for dmx_ts_feed.set() 68 * enum ts_filter_type - filter type bitmap for dmx_ts_feed.set\(\)
108 * 69 *
109 * @TS_PACKET: Send TS packets (188 bytes) to callback (default). 70 * @TS_PACKET: Send TS packets (188 bytes) to callback (default).
110 * @TS_PAYLOAD_ONLY: In case TS_PACKET is set, only send the TS payload 71 * @TS_PAYLOAD_ONLY: In case TS_PACKET is set, only send the TS payload
@@ -231,30 +192,6 @@ struct dmx_section_feed {
231}; 192};
232 193
233/** 194/**
234 * DOC: Demux Callback
235 *
236 * This kernel-space API comprises the callback functions that deliver filtered
237 * data to the demux client. Unlike the other DVB kABIs, these functions are
238 * provided by the client and called from the demux code.
239 *
240 * The function pointers of this abstract interface are not packed into a
241 * structure as in the other demux APIs, because the callback functions are
242 * registered and used independent of each other. As an example, it is possible
243 * for the API client to provide several callback functions for receiving TS
244 * packets and no callbacks for PES packets or sections.
245 *
246 * The functions that implement the callback API need not be re-entrant: when
247 * a demux driver calls one of these functions, the driver is not allowed to
248 * call the function again before the original call returns. If a callback is
249 * triggered by a hardware interrupt, it is recommended to use the Linux
250 * bottom half mechanism or start a tasklet instead of making the callback
251 * function call directly from a hardware interrupt.
252 *
253 * This mechanism is implemented by dmx_ts_cb() and dmx_section_cb()
254 * callbacks.
255 */
256
257/**
258 * typedef dmx_ts_cb - DVB demux TS filter callback function prototype 195 * typedef dmx_ts_cb - DVB demux TS filter callback function prototype
259 * 196 *
260 * @buffer1: Pointer to the start of the filtered TS packets. 197 * @buffer1: Pointer to the start of the filtered TS packets.
@@ -402,7 +339,7 @@ struct dmx_frontend {
402 * @DMX_SECTION_FILTERING: set if section filtering is supported; 339 * @DMX_SECTION_FILTERING: set if section filtering is supported;
403 * @DMX_MEMORY_BASED_FILTERING: set if write() available. 340 * @DMX_MEMORY_BASED_FILTERING: set if write() available.
404 * 341 *
405 * Those flags are OR'ed in the &dmx_demux.&capabilities field 342 * Those flags are OR'ed in the &dmx_demux.capabilities field
406 */ 343 */
407enum dmx_demux_caps { 344enum dmx_demux_caps {
408 DMX_TS_FILTERING = 1, 345 DMX_TS_FILTERING = 1,
@@ -442,10 +379,10 @@ enum dmx_demux_caps {
442 * @open is called and decrement it when @close is called. 379 * @open is called and decrement it when @close is called.
443 * The @demux function parameter contains a pointer to the demux API and 380 * The @demux function parameter contains a pointer to the demux API and
444 * instance data. 381 * instance data.
445 * It returns 382 * It returns:
446 * 0 on success; 383 * 0 on success;
447 * -EUSERS, if maximum usage count was reached; 384 * -EUSERS, if maximum usage count was reached;
448 * -EINVAL, on bad parameter. 385 * -EINVAL, on bad parameter.
449 * 386 *
450 * @close: This function reserves the demux for use by the caller and, if 387 * @close: This function reserves the demux for use by the caller and, if
451 * necessary, initializes the demux. When the demux is no longer needed, 388 * necessary, initializes the demux. When the demux is no longer needed,
@@ -455,10 +392,10 @@ enum dmx_demux_caps {
455 * @open is called and decrement it when @close is called. 392 * @open is called and decrement it when @close is called.
456 * The @demux function parameter contains a pointer to the demux API and 393 * The @demux function parameter contains a pointer to the demux API and
457 * instance data. 394 * instance data.
458 * It returns 395 * It returns:
459 * 0 on success; 396 * 0 on success;
460 * -ENODEV, if demux was not in use (e. g. no users); 397 * -ENODEV, if demux was not in use (e. g. no users);
461 * -EINVAL, on bad parameter. 398 * -EINVAL, on bad parameter.
462 * 399 *
463 * @write: This function provides the demux driver with a memory buffer 400 * @write: This function provides the demux driver with a memory buffer
464 * containing TS packets. Instead of receiving TS packets from the DVB 401 * containing TS packets. Instead of receiving TS packets from the DVB
@@ -473,12 +410,12 @@ enum dmx_demux_caps {
473 * The @buf function parameter contains a pointer to the TS data in 410 * The @buf function parameter contains a pointer to the TS data in
474 * kernel-space memory. 411 * kernel-space memory.
475 * The @count function parameter contains the length of the TS data. 412 * The @count function parameter contains the length of the TS data.
476 * It returns 413 * It returns:
477 * 0 on success; 414 * 0 on success;
478 * -ERESTARTSYS, if mutex lock was interrupted; 415 * -ERESTARTSYS, if mutex lock was interrupted;
479 * -EINTR, if a signal handling is pending; 416 * -EINTR, if a signal handling is pending;
480 * -ENODEV, if demux was removed; 417 * -ENODEV, if demux was removed;
481 * -EINVAL, on bad parameter. 418 * -EINVAL, on bad parameter.
482 * 419 *
483 * @allocate_ts_feed: Allocates a new TS feed, which is used to filter the TS 420 * @allocate_ts_feed: Allocates a new TS feed, which is used to filter the TS
484 * packets carrying a certain PID. The TS feed normally corresponds to a 421 * packets carrying a certain PID. The TS feed normally corresponds to a
@@ -489,11 +426,11 @@ enum dmx_demux_caps {
489 * instance data. 426 * instance data.
490 * The @callback function parameter contains a pointer to the callback 427 * The @callback function parameter contains a pointer to the callback
491 * function for passing received TS packet. 428 * function for passing received TS packet.
492 * It returns 429 * It returns:
493 * 0 on success; 430 * 0 on success;
494 * -ERESTARTSYS, if mutex lock was interrupted; 431 * -ERESTARTSYS, if mutex lock was interrupted;
495 * -EBUSY, if no more TS feeds is available; 432 * -EBUSY, if no more TS feeds is available;
496 * -EINVAL, on bad parameter. 433 * -EINVAL, on bad parameter.
497 * 434 *
498 * @release_ts_feed: Releases the resources allocated with @allocate_ts_feed. 435 * @release_ts_feed: Releases the resources allocated with @allocate_ts_feed.
499 * Any filtering in progress on the TS feed should be stopped before 436 * Any filtering in progress on the TS feed should be stopped before
@@ -502,9 +439,9 @@ enum dmx_demux_caps {
502 * instance data. 439 * instance data.
503 * The @feed function parameter contains a pointer to the TS feed API and 440 * The @feed function parameter contains a pointer to the TS feed API and
504 * instance data. 441 * instance data.
505 * It returns 442 * It returns:
506 * 0 on success; 443 * 0 on success;
507 * -EINVAL on bad parameter. 444 * -EINVAL on bad parameter.
508 * 445 *
509 * @allocate_section_feed: Allocates a new section feed, i.e. a demux resource 446 * @allocate_section_feed: Allocates a new section feed, i.e. a demux resource
510 * for filtering and receiving sections. On platforms with hardware 447 * for filtering and receiving sections. On platforms with hardware
@@ -520,10 +457,10 @@ enum dmx_demux_caps {
520 * instance data. 457 * instance data.
521 * The @callback function parameter contains a pointer to the callback 458 * The @callback function parameter contains a pointer to the callback
522 * function for passing received TS packet. 459 * function for passing received TS packet.
523 * It returns 460 * It returns:
524 * 0 on success; 461 * 0 on success;
525 * -EBUSY, if no more TS feeds is available; 462 * -EBUSY, if no more TS feeds is available;
526 * -EINVAL, on bad parameter. 463 * -EINVAL, on bad parameter.
527 * 464 *
528 * @release_section_feed: Releases the resources allocated with 465 * @release_section_feed: Releases the resources allocated with
529 * @allocate_section_feed, including allocated filters. Any filtering in 466 * @allocate_section_feed, including allocated filters. Any filtering in
@@ -533,9 +470,9 @@ enum dmx_demux_caps {
533 * instance data. 470 * instance data.
534 * The @feed function parameter contains a pointer to the TS feed API and 471 * The @feed function parameter contains a pointer to the TS feed API and
535 * instance data. 472 * instance data.
536 * It returns 473 * It returns:
537 * 0 on success; 474 * 0 on success;
538 * -EINVAL, on bad parameter. 475 * -EINVAL, on bad parameter.
539 * 476 *
540 * @add_frontend: Registers a connectivity between a demux and a front-end, 477 * @add_frontend: Registers a connectivity between a demux and a front-end,
541 * i.e., indicates that the demux can be connected via a call to 478 * i.e., indicates that the demux can be connected via a call to
@@ -549,9 +486,9 @@ enum dmx_demux_caps {
549 * instance data. 486 * instance data.
550 * The @frontend function parameter contains a pointer to the front-end 487 * The @frontend function parameter contains a pointer to the front-end
551 * instance data. 488 * instance data.
552 * It returns 489 * It returns:
553 * 0 on success; 490 * 0 on success;
554 * -EINVAL, on bad parameter. 491 * -EINVAL, on bad parameter.
555 * 492 *
556 * @remove_frontend: Indicates that the given front-end, registered by a call 493 * @remove_frontend: Indicates that the given front-end, registered by a call
557 * to @add_frontend, can no longer be connected as a TS source by this 494 * to @add_frontend, can no longer be connected as a TS source by this
@@ -565,10 +502,10 @@ enum dmx_demux_caps {
565 * instance data. 502 * instance data.
566 * The @frontend function parameter contains a pointer to the front-end 503 * The @frontend function parameter contains a pointer to the front-end
567 * instance data. 504 * instance data.
568 * It returns 505 * It returns:
569 * 0 on success; 506 * 0 on success;
570 * -ENODEV, if the front-end was not found, 507 * -ENODEV, if the front-end was not found,
571 * -EINVAL, on bad parameter. 508 * -EINVAL, on bad parameter.
572 * 509 *
573 * @get_frontends: Provides the APIs of the front-ends that have been 510 * @get_frontends: Provides the APIs of the front-ends that have been
574 * registered for this demux. Any of the front-ends obtained with this 511 * registered for this demux. Any of the front-ends obtained with this
@@ -592,17 +529,17 @@ enum dmx_demux_caps {
592 * instance data. 529 * instance data.
593 * The @frontend function parameter contains a pointer to the front-end 530 * The @frontend function parameter contains a pointer to the front-end
594 * instance data. 531 * instance data.
595 * It returns 532 * It returns:
596 * 0 on success; 533 * 0 on success;
597 * -EINVAL, on bad parameter. 534 * -EINVAL, on bad parameter.
598 * 535 *
599 * @disconnect_frontend: Disconnects the demux and a front-end previously 536 * @disconnect_frontend: Disconnects the demux and a front-end previously
600 * connected by a @connect_frontend call. 537 * connected by a @connect_frontend call.
601 * The @demux function parameter contains a pointer to the demux API and 538 * The @demux function parameter contains a pointer to the demux API and
602 * instance data. 539 * instance data.
603 * It returns 540 * It returns:
604 * 0 on success; 541 * 0 on success;
605 * -EINVAL on bad parameter. 542 * -EINVAL on bad parameter.
606 * 543 *
607 * @get_pes_pids: Get the PIDs for DMX_PES_AUDIO0, DMX_PES_VIDEO0, 544 * @get_pes_pids: Get the PIDs for DMX_PES_AUDIO0, DMX_PES_VIDEO0,
608 * DMX_PES_TELETEXT0, DMX_PES_SUBTITLE0 and DMX_PES_PCR0. 545 * DMX_PES_TELETEXT0, DMX_PES_SUBTITLE0 and DMX_PES_PCR0.
@@ -610,9 +547,9 @@ enum dmx_demux_caps {
610 * instance data. 547 * instance data.
611 * The @pids function parameter contains an array with five u16 elements 548 * The @pids function parameter contains an array with five u16 elements
612 * where the PIDs will be stored. 549 * where the PIDs will be stored.
613 * It returns 550 * It returns:
614 * 0 on success; 551 * 0 on success;
615 * -EINVAL on bad parameter. 552 * -EINVAL on bad parameter.
616 */ 553 */
617 554
618struct dmx_demux { 555struct dmx_demux {
diff --git a/drivers/media/dvb-core/dvb_frontend.h b/drivers/media/dvb-core/dvb_frontend.h
index 9592573a0b41..fb6e84811504 100644
--- a/drivers/media/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb-core/dvb_frontend.h
@@ -1,6 +1,10 @@
1/* 1/*
2 * dvb_frontend.h 2 * dvb_frontend.h
3 * 3 *
4 * The Digital TV Frontend kABI defines a driver-internal interface for
5 * registering low-level, hardware specific driver to a hardware independent
6 * frontend layer.
7 *
4 * Copyright (C) 2001 convergence integrated media GmbH 8 * Copyright (C) 2001 convergence integrated media GmbH
5 * Copyright (C) 2004 convergence GmbH 9 * Copyright (C) 2004 convergence GmbH
6 * 10 *
@@ -42,29 +46,6 @@
42 46
43#include "dvbdev.h" 47#include "dvbdev.h"
44 48
45/**
46 * DOC: Digital TV Frontend
47 *
48 * The Digital TV Frontend kABI defines a driver-internal interface for
49 * registering low-level, hardware specific driver to a hardware independent
50 * frontend layer. It is only of interest for Digital TV device driver writers.
51 * The header file for this API is named dvb_frontend.h and located in
52 * drivers/media/dvb-core.
53 *
54 * Before using the Digital TV frontend core, the bridge driver should attach
55 * the frontend demod, tuner and SEC devices and call dvb_register_frontend(),
56 * in order to register the new frontend at the subsystem. At device
57 * detach/removal, the bridge driver should call dvb_unregister_frontend() to
58 * remove the frontend from the core and then dvb_frontend_detach() to free the
59 * memory allocated by the frontend drivers.
60 *
61 * The drivers should also call dvb_frontend_suspend() as part of their
62 * handler for the &device_driver.suspend(), and dvb_frontend_resume() as
63 * part of their handler for &device_driver.resume().
64 *
65 * A few other optional functions are provided to handle some special cases.
66 */
67
68/* 49/*
69 * Maximum number of Delivery systems per frontend. It 50 * Maximum number of Delivery systems per frontend. It
70 * should be smaller or equal to 32 51 * should be smaller or equal to 32
@@ -406,7 +387,7 @@ struct dtv_frontend_properties;
406 * FE_DISHNETWORK_SEND_LEGACY_CMD ioctl (only Satellite). 387 * FE_DISHNETWORK_SEND_LEGACY_CMD ioctl (only Satellite).
407 * Drivers should not use this, except when the DVB 388 * Drivers should not use this, except when the DVB
408 * core emulation fails to provide proper support (e.g. 389 * core emulation fails to provide proper support (e.g.
409 * if set_voltage() takes more than 8ms to work), and 390 * if @set_voltage takes more than 8ms to work), and
410 * when backward compatibility with this legacy API is 391 * when backward compatibility with this legacy API is
411 * required. 392 * required.
412 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C 393 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C
@@ -741,13 +722,13 @@ void dvb_frontend_detach(struct dvb_frontend *fe);
741 * This function prepares a Digital TV frontend to suspend. 722 * This function prepares a Digital TV frontend to suspend.
742 * 723 *
743 * In order to prepare the tuner to suspend, if 724 * In order to prepare the tuner to suspend, if
744 * &dvb_frontend_ops.tuner_ops.suspend() is available, it calls it. Otherwise, 725 * &dvb_frontend_ops.tuner_ops.suspend\(\) is available, it calls it. Otherwise,
745 * it will call &dvb_frontend_ops.tuner_ops.sleep(), if available. 726 * it will call &dvb_frontend_ops.tuner_ops.sleep\(\), if available.
746 * 727 *
747 * It will also call &dvb_frontend_ops.sleep() to put the demod to suspend. 728 * It will also call &dvb_frontend_ops.sleep\(\) to put the demod to suspend.
748 * 729 *
749 * The drivers should also call dvb_frontend_suspend() as part of their 730 * The drivers should also call dvb_frontend_suspend\(\) as part of their
750 * handler for the &device_driver.suspend(). 731 * handler for the &device_driver.suspend\(\).
751 */ 732 */
752int dvb_frontend_suspend(struct dvb_frontend *fe); 733int dvb_frontend_suspend(struct dvb_frontend *fe);
753 734
@@ -758,17 +739,17 @@ int dvb_frontend_suspend(struct dvb_frontend *fe);
758 * 739 *
759 * This function resumes the usual operation of the tuner after resume. 740 * This function resumes the usual operation of the tuner after resume.
760 * 741 *
761 * In order to resume the frontend, it calls the demod &dvb_frontend_ops.init(). 742 * In order to resume the frontend, it calls the demod &dvb_frontend_ops.init\(\).
762 * 743 *
763 * If &dvb_frontend_ops.tuner_ops.resume() is available, It, it calls it. 744 * If &dvb_frontend_ops.tuner_ops.resume\(\) is available, It, it calls it.
764 * Otherwise,t will call &dvb_frontend_ops.tuner_ops.init(), if available. 745 * Otherwise,t will call &dvb_frontend_ops.tuner_ops.init\(\), if available.
765 * 746 *
766 * Once tuner and demods are resumed, it will enforce that the SEC voltage and 747 * Once tuner and demods are resumed, it will enforce that the SEC voltage and
767 * tone are restored to their previous values and wake up the frontend's 748 * tone are restored to their previous values and wake up the frontend's
768 * kthread in order to retune the frontend. 749 * kthread in order to retune the frontend.
769 * 750 *
770 * The drivers should also call dvb_frontend_resume() as part of their 751 * The drivers should also call dvb_frontend_resume() as part of their
771 * handler for the &device_driver.resume(). 752 * handler for the &device_driver.resume\(\).
772 */ 753 */
773int dvb_frontend_resume(struct dvb_frontend *fe); 754int dvb_frontend_resume(struct dvb_frontend *fe);
774 755
@@ -777,7 +758,7 @@ int dvb_frontend_resume(struct dvb_frontend *fe);
777 * 758 *
778 * @fe: pointer to the frontend struct 759 * @fe: pointer to the frontend struct
779 * 760 *
780 * Calls &dvb_frontend_ops.init() and &dvb_frontend_ops.tuner_ops.init(), 761 * Calls &dvb_frontend_ops.init\(\) and &dvb_frontend_ops.tuner_ops.init\(\),
781 * and resets SEC tone and voltage (for Satellite systems). 762 * and resets SEC tone and voltage (for Satellite systems).
782 * 763 *
783 * NOTE: Currently, this function is used only by one driver (budget-av). 764 * NOTE: Currently, this function is used only by one driver (budget-av).
@@ -799,14 +780,14 @@ void dvb_frontend_reinitialise(struct dvb_frontend *fe);
799 * satellite subsystem. 780 * satellite subsystem.
800 * 781 *
801 * Its used internally by the DVB frontend core, in order to emulate 782 * Its used internally by the DVB frontend core, in order to emulate
802 * %FE_DISHNETWORK_SEND_LEGACY_CMD using the &dvb_frontend_ops.set_voltage() 783 * %FE_DISHNETWORK_SEND_LEGACY_CMD using the &dvb_frontend_ops.set_voltage\(\)
803 * callback. 784 * callback.
804 * 785 *
805 * NOTE: it should not be used at the drivers, as the emulation for the 786 * NOTE: it should not be used at the drivers, as the emulation for the
806 * legacy callback is provided by the Kernel. The only situation where this 787 * legacy callback is provided by the Kernel. The only situation where this
807 * should be at the drivers is when there are some bugs at the hardware that 788 * should be at the drivers is when there are some bugs at the hardware that
808 * would prevent the core emulation to work. On such cases, the driver would 789 * would prevent the core emulation to work. On such cases, the driver would
809 * be writing a &dvb_frontend_ops.dishnetwork_send_legacy_command() and 790 * be writing a &dvb_frontend_ops.dishnetwork_send_legacy_command\(\) and
810 * calling this function directly. 791 * calling this function directly.
811 */ 792 */
812void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec); 793void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);
diff --git a/drivers/media/dvb-core/dvb_math.h b/drivers/media/dvb-core/dvb_math.h
index 34dc1df03cab..2f0326674ca6 100644
--- a/drivers/media/dvb-core/dvb_math.h
+++ b/drivers/media/dvb-core/dvb_math.h
@@ -30,11 +30,15 @@
30 * @value: The value (must be != 0) 30 * @value: The value (must be != 0)
31 * 31 *
32 * to use rational values you can use the following method: 32 * to use rational values you can use the following method:
33 *
33 * intlog2(value) = intlog2(value * 2^x) - x * 2^24 34 * intlog2(value) = intlog2(value * 2^x) - x * 2^24
34 * 35 *
35 * Some usecase examples: 36 * Some usecase examples:
37 *
36 * intlog2(8) will give 3 << 24 = 3 * 2^24 38 * intlog2(8) will give 3 << 24 = 3 * 2^24
39 *
37 * intlog2(9) will give 3 << 24 + ... = 3.16... * 2^24 40 * intlog2(9) will give 3 << 24 + ... = 3.16... * 2^24
41 *
38 * intlog2(1.5) = intlog2(3) - 2^24 = 0.584... * 2^24 42 * intlog2(1.5) = intlog2(3) - 2^24 = 0.584... * 2^24
39 * 43 *
40 * 44 *
@@ -48,10 +52,13 @@ extern unsigned int intlog2(u32 value);
48 * @value: The value (must be != 0) 52 * @value: The value (must be != 0)
49 * 53 *
50 * to use rational values you can use the following method: 54 * to use rational values you can use the following method:
55 *
51 * intlog10(value) = intlog10(value * 10^x) - x * 2^24 56 * intlog10(value) = intlog10(value * 10^x) - x * 2^24
52 * 57 *
53 * An usecase example: 58 * An usecase example:
59 *
54 * intlog10(1000) will give 3 << 24 = 3 * 2^24 60 * intlog10(1000) will give 3 << 24 = 3 * 2^24
61 *
55 * due to the implementation intlog10(1000) might be not exactly 3 * 2^24 62 * due to the implementation intlog10(1000) might be not exactly 3 * 2^24
56 * 63 *
57 * look at intlog2 for similar examples 64 * look at intlog2 for similar examples
diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb-core/dvb_ringbuffer.h
index 3ebc2d34b4a2..8af642399f1e 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -150,9 +150,6 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
150 150
151/** 151/**
152 * dvb_ringbuffer_pkt_read_user - Read from a packet in the ringbuffer. 152 * dvb_ringbuffer_pkt_read_user - Read from a packet in the ringbuffer.
153 * Note: unlike dvb_ringbuffer_read(), this does NOT update the read pointer
154 * in the ringbuffer. You must use dvb_ringbuffer_pkt_dispose() to mark a
155 * packet as no longer required.
156 * 153 *
157 * @rbuf: Ringbuffer concerned. 154 * @rbuf: Ringbuffer concerned.
158 * @idx: Packet index as returned by dvb_ringbuffer_pkt_next(). 155 * @idx: Packet index as returned by dvb_ringbuffer_pkt_next().
@@ -161,9 +158,17 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
161 * @len: Size of destination buffer. 158 * @len: Size of destination buffer.
162 * 159 *
163 * returns Number of bytes read, or -EFAULT. 160 * returns Number of bytes read, or -EFAULT.
161 *
162 * .. note::
163 *
164 * unlike dvb_ringbuffer_read(), this does **NOT** update the read pointer
165 * in the ringbuffer. You must use dvb_ringbuffer_pkt_dispose() to mark a
166 * packet as no longer required.
164 */ 167 */
165extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx, 168extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf,
166 int offset, u8 __user *buf, size_t len); 169 size_t idx,
170 int offset, u8 __user *buf,
171 size_t len);
167 172
168/** 173/**
169 * dvb_ringbuffer_pkt_read - Read from a packet in the ringbuffer. 174 * dvb_ringbuffer_pkt_read - Read from a packet in the ringbuffer.
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 70b559d7ca80..e6da353b39bc 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -812,40 +812,6 @@ static int video_register_media_controller(struct video_device *vdev, int type)
812 return 0; 812 return 0;
813} 813}
814 814
815/**
816 * __video_register_device - register video4linux devices
817 * @vdev: video device structure we want to register
818 * @type: type of device to register
819 * @nr: which device node number (0 == /dev/video0, 1 == /dev/video1, ...
820 * -1 == first free)
821 * @warn_if_nr_in_use: warn if the desired device node number
822 * was already in use and another number was chosen instead.
823 * @owner: module that owns the video device node
824 *
825 * The registration code assigns minor numbers and device node numbers
826 * based on the requested type and registers the new device node with
827 * the kernel.
828 *
829 * This function assumes that struct video_device was zeroed when it
830 * was allocated and does not contain any stale date.
831 *
832 * An error is returned if no free minor or device node number could be
833 * found, or if the registration of the device node failed.
834 *
835 * Zero is returned on success.
836 *
837 * Valid types are
838 *
839 * %VFL_TYPE_GRABBER - A frame grabber
840 *
841 * %VFL_TYPE_VBI - Vertical blank data (undecoded)
842 *
843 * %VFL_TYPE_RADIO - A radio card
844 *
845 * %VFL_TYPE_SUBDEV - A subdevice
846 *
847 * %VFL_TYPE_SDR - Software Defined Radio
848 */
849int __video_register_device(struct video_device *vdev, int type, int nr, 815int __video_register_device(struct video_device *vdev, int type, int nr,
850 int warn_if_nr_in_use, struct module *owner) 816 int warn_if_nr_in_use, struct module *owner)
851{ 817{
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 953eab08e420..34a1e7c8b306 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -621,16 +621,6 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
621} 621}
622EXPORT_SYMBOL(v4l2_subdev_init); 622EXPORT_SYMBOL(v4l2_subdev_init);
623 623
624/**
625 * v4l2_subdev_notify_event() - Delivers event notification for subdevice
626 * @sd: The subdev for which to deliver the event
627 * @ev: The event to deliver
628 *
629 * Will deliver the specified event to all userspace event listeners which are
630 * subscribed to the v42l subdev event queue as well as to the bridge driver
631 * using the notify callback. The notification type for the notify callback
632 * will be V4L2_DEVICE_NOTIFY_EVENT.
633 */
634void v4l2_subdev_notify_event(struct v4l2_subdev *sd, 624void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
635 const struct v4l2_event *ev) 625 const struct v4l2_event *ev)
636{ 626{
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 0ab59a571fee..cec7d35602d1 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -140,7 +140,7 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
140 * second. 140 * second.
141 * 141 *
142 * @features: lirc compatible hardware features, like LIRC_MODE_RAW, 142 * @features: lirc compatible hardware features, like LIRC_MODE_RAW,
143 * LIRC_CAN_*, as defined at include/media/lirc.h. 143 * LIRC_CAN\_\*, as defined at include/media/lirc.h.
144 * 144 *
145 * @chunk_size: Size of each FIFO buffer. 145 * @chunk_size: Size of each FIFO buffer.
146 * 146 *
diff --git a/include/media/media-device.h b/include/media/media-device.h
index f743ae2210ee..28195242386c 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -29,237 +29,6 @@
29#include <media/media-devnode.h> 29#include <media/media-devnode.h>
30#include <media/media-entity.h> 30#include <media/media-entity.h>
31 31
32/**
33 * DOC: Media Controller
34 *
35 * The media controller userspace API is documented in DocBook format in
36 * Documentation/DocBook/media/v4l/media-controller.xml. This document focus
37 * on the kernel-side implementation of the media framework.
38 *
39 * * Abstract media device model:
40 *
41 * Discovering a device internal topology, and configuring it at runtime, is one
42 * of the goals of the media framework. To achieve this, hardware devices are
43 * modelled as an oriented graph of building blocks called entities connected
44 * through pads.
45 *
46 * An entity is a basic media hardware building block. It can correspond to
47 * a large variety of logical blocks such as physical hardware devices
48 * (CMOS sensor for instance), logical hardware devices (a building block
49 * in a System-on-Chip image processing pipeline), DMA channels or physical
50 * connectors.
51 *
52 * A pad is a connection endpoint through which an entity can interact with
53 * other entities. Data (not restricted to video) produced by an entity
54 * flows from the entity's output to one or more entity inputs. Pads should
55 * not be confused with physical pins at chip boundaries.
56 *
57 * A link is a point-to-point oriented connection between two pads, either
58 * on the same entity or on different entities. Data flows from a source
59 * pad to a sink pad.
60 *
61 *
62 * * Media device:
63 *
64 * A media device is represented by a struct &media_device instance, defined in
65 * include/media/media-device.h. Allocation of the structure is handled by the
66 * media device driver, usually by embedding the &media_device instance in a
67 * larger driver-specific structure.
68 *
69 * Drivers register media device instances by calling
70 * __media_device_register() via the macro media_device_register()
71 * and unregistered by calling
72 * media_device_unregister().
73 *
74 * * Entities, pads and links:
75 *
76 * - Entities
77 *
78 * Entities are represented by a struct &media_entity instance, defined in
79 * include/media/media-entity.h. The structure is usually embedded into a
80 * higher-level structure, such as a v4l2_subdev or video_device instance,
81 * although drivers can allocate entities directly.
82 *
83 * Drivers initialize entity pads by calling
84 * media_entity_pads_init().
85 *
86 * Drivers register entities with a media device by calling
87 * media_device_register_entity()
88 * and unregistred by calling
89 * media_device_unregister_entity().
90 *
91 * - Interfaces
92 *
93 * Interfaces are represented by a struct &media_interface instance, defined in
94 * include/media/media-entity.h. Currently, only one type of interface is
95 * defined: a device node. Such interfaces are represented by a struct
96 * &media_intf_devnode.
97 *
98 * Drivers initialize and create device node interfaces by calling
99 * media_devnode_create()
100 * and remove them by calling:
101 * media_devnode_remove().
102 *
103 * - Pads
104 *
105 * Pads are represented by a struct &media_pad instance, defined in
106 * include/media/media-entity.h. Each entity stores its pads in a pads array
107 * managed by the entity driver. Drivers usually embed the array in a
108 * driver-specific structure.
109 *
110 * Pads are identified by their entity and their 0-based index in the pads
111 * array.
112 * Both information are stored in the &media_pad structure, making the
113 * &media_pad pointer the canonical way to store and pass link references.
114 *
115 * Pads have flags that describe the pad capabilities and state.
116 *
117 * %MEDIA_PAD_FL_SINK indicates that the pad supports sinking data.
118 * %MEDIA_PAD_FL_SOURCE indicates that the pad supports sourcing data.
119 *
120 * NOTE: One and only one of %MEDIA_PAD_FL_SINK and %MEDIA_PAD_FL_SOURCE must
121 * be set for each pad.
122 *
123 * - Links
124 *
125 * Links are represented by a struct &media_link instance, defined in
126 * include/media/media-entity.h. There are two types of links:
127 *
128 * 1. pad to pad links:
129 *
130 * Associate two entities via their PADs. Each entity has a list that points
131 * to all links originating at or targeting any of its pads.
132 * A given link is thus stored twice, once in the source entity and once in
133 * the target entity.
134 *
135 * Drivers create pad to pad links by calling:
136 * media_create_pad_link() and remove with media_entity_remove_links().
137 *
138 * 2. interface to entity links:
139 *
140 * Associate one interface to a Link.
141 *
142 * Drivers create interface to entity links by calling:
143 * media_create_intf_link() and remove with media_remove_intf_links().
144 *
145 * NOTE:
146 *
147 * Links can only be created after having both ends already created.
148 *
149 * Links have flags that describe the link capabilities and state. The
150 * valid values are described at media_create_pad_link() and
151 * media_create_intf_link().
152 *
153 * Graph traversal:
154 *
155 * The media framework provides APIs to iterate over entities in a graph.
156 *
157 * To iterate over all entities belonging to a media device, drivers can use
158 * the media_device_for_each_entity macro, defined in
159 * include/media/media-device.h.
160 *
161 * struct media_entity *entity;
162 *
163 * media_device_for_each_entity(entity, mdev) {
164 * // entity will point to each entity in turn
165 * ...
166 * }
167 *
168 * Drivers might also need to iterate over all entities in a graph that can be
169 * reached only through enabled links starting at a given entity. The media
170 * framework provides a depth-first graph traversal API for that purpose.
171 *
172 * Note that graphs with cycles (whether directed or undirected) are *NOT*
173 * supported by the graph traversal API. To prevent infinite loops, the graph
174 * traversal code limits the maximum depth to MEDIA_ENTITY_ENUM_MAX_DEPTH,
175 * currently defined as 16.
176 *
177 * Drivers initiate a graph traversal by calling
178 * media_entity_graph_walk_start()
179 *
180 * The graph structure, provided by the caller, is initialized to start graph
181 * traversal at the given entity.
182 *
183 * Drivers can then retrieve the next entity by calling
184 * media_entity_graph_walk_next()
185 *
186 * When the graph traversal is complete the function will return NULL.
187 *
188 * Graph traversal can be interrupted at any moment. No cleanup function call
189 * is required and the graph structure can be freed normally.
190 *
191 * Helper functions can be used to find a link between two given pads, or a pad
192 * connected to another pad through an enabled link
193 * media_entity_find_link() and media_entity_remote_pad()
194 *
195 * Use count and power handling:
196 *
197 * Due to the wide differences between drivers regarding power management
198 * needs, the media controller does not implement power management. However,
199 * the &media_entity structure includes a use_count field that media drivers
200 * can use to track the number of users of every entity for power management
201 * needs.
202 *
203 * The &media_entity.@use_count field is owned by media drivers and must not be
204 * touched by entity drivers. Access to the field must be protected by the
205 * &media_device.@graph_mutex lock.
206 *
207 * Links setup:
208 *
209 * Link properties can be modified at runtime by calling
210 * media_entity_setup_link()
211 *
212 * Pipelines and media streams:
213 *
214 * When starting streaming, drivers must notify all entities in the pipeline to
215 * prevent link states from being modified during streaming by calling
216 * media_entity_pipeline_start().
217 *
218 * The function will mark all entities connected to the given entity through
219 * enabled links, either directly or indirectly, as streaming.
220 *
221 * The &media_pipeline instance pointed to by the pipe argument will be stored
222 * in every entity in the pipeline. Drivers should embed the &media_pipeline
223 * structure in higher-level pipeline structures and can then access the
224 * pipeline through the &media_entity pipe field.
225 *
226 * Calls to media_entity_pipeline_start() can be nested. The pipeline pointer
227 * must be identical for all nested calls to the function.
228 *
229 * media_entity_pipeline_start() may return an error. In that case, it will
230 * clean up any of the changes it did by itself.
231 *
232 * When stopping the stream, drivers must notify the entities with
233 * media_entity_pipeline_stop().
234 *
235 * If multiple calls to media_entity_pipeline_start() have been made the same
236 * number of media_entity_pipeline_stop() calls are required to stop streaming.
237 * The &media_entity pipe field is reset to NULL on the last nested stop call.
238 *
239 * Link configuration will fail with -%EBUSY by default if either end of the
240 * link is a streaming entity. Links that can be modified while streaming must
241 * be marked with the %MEDIA_LNK_FL_DYNAMIC flag.
242 *
243 * If other operations need to be disallowed on streaming entities (such as
244 * changing entities configuration parameters) drivers can explicitly check the
245 * media_entity stream_count field to find out if an entity is streaming. This
246 * operation must be done with the media_device graph_mutex held.
247 *
248 * Link validation:
249 *
250 * Link validation is performed by media_entity_pipeline_start() for any
251 * entity which has sink pads in the pipeline. The
252 * &media_entity.@link_validate() callback is used for that purpose. In
253 * @link_validate() callback, entity driver should check that the properties of
254 * the source pad of the connected entity and its own sink pad match. It is up
255 * to the type of the entity (and in the end, the properties of the hardware)
256 * what matching actually means.
257 *
258 * Subsystems should facilitate link validation by providing subsystem specific
259 * helper functions to provide easy access for commonly needed information, and
260 * in the end provide a way to use driver-specific callbacks.
261 */
262
263struct ida; 32struct ida;
264struct device; 33struct device;
265 34
@@ -473,13 +242,11 @@ void media_device_cleanup(struct media_device *mdev);
473 * without breaking binary compatibility. The version major must be 242 * without breaking binary compatibility. The version major must be
474 * incremented when binary compatibility is broken. 243 * incremented when binary compatibility is broken.
475 * 244 *
476 * Notes: 245 * .. note::
477 * 246 *
478 * Upon successful registration a character device named media[0-9]+ is created. 247 * #) Upon successful registration a character device named media[0-9]+ is created. The device major and minor numbers are dynamic. The model name is exported as a sysfs attribute.
479 * The device major and minor numbers are dynamic. The model name is exported as
480 * a sysfs attribute.
481 * 248 *
482 * Unregistering a media device that hasn't been registered is *NOT* safe. 249 * #) Unregistering a media device that hasn't been registered is **NOT** safe.
483 * 250 *
484 * Return: returns zero on success or a negative error code. 251 * Return: returns zero on success or a negative error code.
485 */ 252 */
@@ -527,14 +294,16 @@ void media_device_unregister(struct media_device *mdev);
527 * This can be used to report the default audio and video devices or the 294 * This can be used to report the default audio and video devices or the
528 * default camera sensor. 295 * default camera sensor.
529 * 296 *
530 * NOTE: Drivers should set the entity function before calling this function. 297 * .. note::
531 * Please notice that the values %MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN and 298 *
532 * %MEDIA_ENT_F_UNKNOWN should not be used by the drivers. 299 * Drivers should set the entity function before calling this function.
300 * Please notice that the values %MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN and
301 * %MEDIA_ENT_F_UNKNOWN should not be used by the drivers.
533 */ 302 */
534int __must_check media_device_register_entity(struct media_device *mdev, 303int __must_check media_device_register_entity(struct media_device *mdev,
535 struct media_entity *entity); 304 struct media_entity *entity);
536 305
537/* 306/**
538 * media_device_unregister_entity() - unregisters a media entity. 307 * media_device_unregister_entity() - unregisters a media entity.
539 * 308 *
540 * @entity: pointer to struct &media_entity to be unregistered 309 * @entity: pointer to struct &media_entity to be unregistered
@@ -548,8 +317,10 @@ int __must_check media_device_register_entity(struct media_device *mdev,
548 * When a media device is unregistered, all its entities are unregistered 317 * When a media device is unregistered, all its entities are unregistered
549 * automatically. No manual entities unregistration is then required. 318 * automatically. No manual entities unregistration is then required.
550 * 319 *
551 * Note: the media_entity instance itself must be freed explicitly by 320 * .. note::
552 * the driver if required. 321 *
322 * The media_entity instance itself must be freed explicitly by
323 * the driver if required.
553 */ 324 */
554void media_device_unregister_entity(struct media_entity *entity); 325void media_device_unregister_entity(struct media_entity *entity);
555 326
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index cbb266f7f2b5..09b03c17784d 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -104,7 +104,7 @@ struct media_entity_graph {
104 int top; 104 int top;
105}; 105};
106 106
107/* 107/**
108 * struct media_pipeline - Media pipeline related information 108 * struct media_pipeline - Media pipeline related information
109 * 109 *
110 * @streaming_count: Streaming start count - streaming stop count 110 * @streaming_count: Streaming start count - streaming stop count
@@ -180,8 +180,10 @@ struct media_pad {
180 * view. The media_entity_pipeline_start() function 180 * view. The media_entity_pipeline_start() function
181 * validates all links by calling this operation. Optional. 181 * validates all links by calling this operation. Optional.
182 * 182 *
183 * Note: Those these callbacks are called with struct media_device.@graph_mutex 183 * .. note::
184 * mutex held. 184 *
185 * Those these callbacks are called with struct media_device.@graph_mutex
186 * mutex held.
185 */ 187 */
186struct media_entity_operations { 188struct media_entity_operations {
187 int (*link_setup)(struct media_entity *entity, 189 int (*link_setup)(struct media_entity *entity,
@@ -538,7 +540,7 @@ static inline bool media_entity_enum_intersects(
538 * @gobj: Pointer to the graph object 540 * @gobj: Pointer to the graph object
539 * 541 *
540 * This routine initializes the embedded struct media_gobj inside a 542 * This routine initializes the embedded struct media_gobj inside a
541 * media graph object. It is called automatically if media_*_create() 543 * media graph object. It is called automatically if media_*_create\(\)
542 * calls are used. However, if the object (entity, link, pad, interface) 544 * calls are used. However, if the object (entity, link, pad, interface)
543 * is embedded on some other object, this function should be called before 545 * is embedded on some other object, this function should be called before
544 * registering the object at the media controller. 546 * registering the object at the media controller.
@@ -602,19 +604,20 @@ static inline void media_entity_cleanup(struct media_entity *entity) {};
602 * @flags: Link flags, as defined in include/uapi/linux/media.h. 604 * @flags: Link flags, as defined in include/uapi/linux/media.h.
603 * 605 *
604 * Valid values for flags: 606 * Valid values for flags:
605 * A %MEDIA_LNK_FL_ENABLED flag indicates that the link is enabled and can be
606 * used to transfer media data. When two or more links target a sink pad,
607 * only one of them can be enabled at a time.
608 * 607 *
609 * A %MEDIA_LNK_FL_IMMUTABLE flag indicates that the link enabled state can't 608 * - A %MEDIA_LNK_FL_ENABLED flag indicates that the link is enabled and can
610 * be modified at runtime. If %MEDIA_LNK_FL_IMMUTABLE is set, then 609 * be used to transfer media data. When two or more links target a sink pad,
611 * %MEDIA_LNK_FL_ENABLED must also be set since an immutable link is 610 * only one of them can be enabled at a time.
612 * always enabled. 611 *
612 * - A %MEDIA_LNK_FL_IMMUTABLE flag indicates that the link enabled state can't
613 * be modified at runtime. If %MEDIA_LNK_FL_IMMUTABLE is set, then
614 * %MEDIA_LNK_FL_ENABLED must also be set since an immutable link is
615 * always enabled.
613 * 616 *
614 * NOTE: 617 * .. note::
615 * 618 *
616 * Before calling this function, media_entity_pads_init() and 619 * Before calling this function, media_entity_pads_init() and
617 * media_device_register_entity() should be called previously for both ends. 620 * media_device_register_entity() should be called previously for both ends.
618 */ 621 */
619__must_check int media_create_pad_link(struct media_entity *source, 622__must_check int media_create_pad_link(struct media_entity *source,
620 u16 source_pad, struct media_entity *sink, 623 u16 source_pad, struct media_entity *sink,
@@ -641,6 +644,7 @@ __must_check int media_create_pad_link(struct media_entity *source,
641 * and @sink are NULL. 644 * and @sink are NULL.
642 * 645 *
643 * Valid values for flags: 646 * Valid values for flags:
647 *
644 * A %MEDIA_LNK_FL_ENABLED flag indicates that the link is enabled and can be 648 * A %MEDIA_LNK_FL_ENABLED flag indicates that the link is enabled and can be
645 * used to transfer media data. If multiple links are created and this 649 * used to transfer media data. If multiple links are created and this
646 * flag is passed as an argument, only the first created link will have 650 * flag is passed as an argument, only the first created link will have
@@ -677,8 +681,10 @@ void __media_entity_remove_links(struct media_entity *entity);
677 * 681 *
678 * @entity: pointer to &media_entity 682 * @entity: pointer to &media_entity
679 * 683 *
680 * Note: this is called automatically when an entity is unregistered via 684 * .. note::
681 * media_device_register_entity(). 685 *
686 * This is called automatically when an entity is unregistered via
687 * media_device_register_entity().
682 */ 688 */
683void media_entity_remove_links(struct media_entity *entity); 689void media_entity_remove_links(struct media_entity *entity);
684 690
@@ -728,9 +734,11 @@ int __media_entity_setup_link(struct media_link *link, u32 flags);
728 * being enabled, the link_setup operation must return -EBUSY and can't 734 * being enabled, the link_setup operation must return -EBUSY and can't
729 * implicitly disable the first enabled link. 735 * implicitly disable the first enabled link.
730 * 736 *
731 * NOTE: the valid values of the flags for the link is the same as described 737 * .. note::
732 * on media_create_pad_link(), for pad to pad links or the same as described 738 *
733 * on media_create_intf_link(), for interface to entity links. 739 * The valid values of the flags for the link is the same as described
740 * on media_create_pad_link(), for pad to pad links or the same as described
741 * on media_create_intf_link(), for interface to entity links.
734 */ 742 */
735int media_entity_setup_link(struct media_link *link, u32 flags); 743int media_entity_setup_link(struct media_link *link, u32 flags);
736 744
@@ -844,7 +852,7 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
844 * @entity: Starting entity 852 * @entity: Starting entity
845 * @pipe: Media pipeline to be assigned to all entities in the pipeline. 853 * @pipe: Media pipeline to be assigned to all entities in the pipeline.
846 * 854 *
847 * Note: This is the non-locking version of media_entity_pipeline_start() 855 * ..note:: This is the non-locking version of media_entity_pipeline_start()
848 */ 856 */
849__must_check int __media_entity_pipeline_start(struct media_entity *entity, 857__must_check int __media_entity_pipeline_start(struct media_entity *entity,
850 struct media_pipeline *pipe); 858 struct media_pipeline *pipe);
@@ -868,7 +876,7 @@ void media_entity_pipeline_stop(struct media_entity *entity);
868 * 876 *
869 * @entity: Starting entity 877 * @entity: Starting entity
870 * 878 *
871 * Note: This is the non-locking version of media_entity_pipeline_stop() 879 * .. note:: This is the non-locking version of media_entity_pipeline_stop()
872 */ 880 */
873void __media_entity_pipeline_stop(struct media_entity *entity); 881void __media_entity_pipeline_stop(struct media_entity *entity);
874 882
@@ -909,20 +917,21 @@ struct media_link *
909 * 917 *
910 * 918 *
911 * Valid values for flags: 919 * Valid values for flags:
912 * The %MEDIA_LNK_FL_ENABLED flag indicates that the interface is connected to
913 * the entity hardware. That's the default value for interfaces. An
914 * interface may be disabled if the hardware is busy due to the usage
915 * of some other interface that it is currently controlling the hardware.
916 * A typical example is an hybrid TV device that handle only one type of
917 * stream on a given time. So, when the digital TV is streaming,
918 * the V4L2 interfaces won't be enabled, as such device is not able to
919 * also stream analog TV or radio.
920 * 920 *
921 * Note: 921 * - The %MEDIA_LNK_FL_ENABLED flag indicates that the interface is connected to
922 * the entity hardware. That's the default value for interfaces. An
923 * interface may be disabled if the hardware is busy due to the usage
924 * of some other interface that it is currently controlling the hardware.
925 * A typical example is an hybrid TV device that handle only one type of
926 * stream on a given time. So, when the digital TV is streaming,
927 * the V4L2 interfaces won't be enabled, as such device is not able to
928 * also stream analog TV or radio.
929 *
930 * .. note::
922 * 931 *
923 * Before calling this function, media_devnode_create() should be called for 932 * Before calling this function, media_devnode_create() should be called for
924 * the interface and media_device_register_entity() should be called for the 933 * the interface and media_device_register_entity() should be called for the
925 * interface that will be part of the link. 934 * interface that will be part of the link.
926 */ 935 */
927__must_check media_create_intf_link(struct media_entity *entity, 936__must_check media_create_intf_link(struct media_entity *entity,
928 struct media_interface *intf, 937 struct media_interface *intf,
@@ -932,7 +941,7 @@ __must_check media_create_intf_link(struct media_entity *entity,
932 * 941 *
933 * @link: pointer to &media_link. 942 * @link: pointer to &media_link.
934 * 943 *
935 * Note: this is an unlocked version of media_remove_intf_link() 944 * .. note:: This is an unlocked version of media_remove_intf_link()
936 */ 945 */
937void __media_remove_intf_link(struct media_link *link); 946void __media_remove_intf_link(struct media_link *link);
938 947
@@ -941,7 +950,7 @@ void __media_remove_intf_link(struct media_link *link);
941 * 950 *
942 * @link: pointer to &media_link. 951 * @link: pointer to &media_link.
943 * 952 *
944 * Note: prefer to use this one, instead of __media_remove_intf_link() 953 * .. note:: Prefer to use this one, instead of __media_remove_intf_link()
945 */ 954 */
946void media_remove_intf_link(struct media_link *link); 955void media_remove_intf_link(struct media_link *link);
947 956
@@ -950,7 +959,7 @@ void media_remove_intf_link(struct media_link *link);
950 * 959 *
951 * @intf: pointer to &media_interface 960 * @intf: pointer to &media_interface
952 * 961 *
953 * Note: this is an unlocked version of media_remove_intf_links(). 962 * .. note:: This is an unlocked version of media_remove_intf_links().
954 */ 963 */
955void __media_remove_intf_links(struct media_interface *intf); 964void __media_remove_intf_links(struct media_interface *intf);
956 965
@@ -959,12 +968,12 @@ void __media_remove_intf_links(struct media_interface *intf);
959 * 968 *
960 * @intf: pointer to &media_interface 969 * @intf: pointer to &media_interface
961 * 970 *
962 * Notes: 971 * .. note::
963 * 972 *
964 * this is called automatically when an entity is unregistered via 973 * #) This is called automatically when an entity is unregistered via
965 * media_device_register_entity() and by media_devnode_remove(). 974 * media_device_register_entity() and by media_devnode_remove().
966 * 975 *
967 * Prefer to use this one, instead of __media_remove_intf_links(). 976 * #) Prefer to use this one, instead of __media_remove_intf_links().
968 */ 977 */
969void media_remove_intf_links(struct media_interface *intf); 978void media_remove_intf_links(struct media_interface *intf);
970 979
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 324232cfc08d..10908e356b23 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -29,9 +29,16 @@ do { \
29 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ 29 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
30} while (0) 30} while (0)
31 31
32/**
33 * enum rc_driver_type - type of the RC output
34 *
35 * @RC_DRIVER_SCANCODE: Driver or hardware generates a scancode
36 * @RC_DRIVER_IR_RAW: Driver or hardware generates pulse/space sequences.
37 * It needs a Infra-Red pulse/space decoder
38 */
32enum rc_driver_type { 39enum rc_driver_type {
33 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ 40 RC_DRIVER_SCANCODE = 0,
34 RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ 41 RC_DRIVER_IR_RAW,
35}; 42};
36 43
37/** 44/**
@@ -188,12 +195,46 @@ struct rc_dev {
188 * Remote Controller, at sys/class/rc. 195 * Remote Controller, at sys/class/rc.
189 */ 196 */
190 197
198/**
199 * rc_allocate_device - Allocates a RC device
200 *
201 * returns a pointer to struct rc_dev.
202 */
191struct rc_dev *rc_allocate_device(void); 203struct rc_dev *rc_allocate_device(void);
204
205/**
206 * rc_free_device - Frees a RC device
207 *
208 * @dev: pointer to struct rc_dev.
209 */
192void rc_free_device(struct rc_dev *dev); 210void rc_free_device(struct rc_dev *dev);
211
212/**
213 * rc_register_device - Registers a RC device
214 *
215 * @dev: pointer to struct rc_dev.
216 */
193int rc_register_device(struct rc_dev *dev); 217int rc_register_device(struct rc_dev *dev);
218
219/**
220 * rc_unregister_device - Unregisters a RC device
221 *
222 * @dev: pointer to struct rc_dev.
223 */
194void rc_unregister_device(struct rc_dev *dev); 224void rc_unregister_device(struct rc_dev *dev);
195 225
226/**
227 * rc_open - Opens a RC device
228 *
229 * @rdev: pointer to struct rc_dev.
230 */
196int rc_open(struct rc_dev *rdev); 231int rc_open(struct rc_dev *rdev);
232
233/**
234 * rc_open - Closes a RC device
235 *
236 * @rdev: pointer to struct rc_dev.
237 */
197void rc_close(struct rc_dev *rdev); 238void rc_close(struct rc_dev *rdev);
198 239
199void rc_repeat(struct rc_dev *dev); 240void rc_repeat(struct rc_dev *dev);
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index a459129dd554..daa75fcc1ff1 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -98,10 +98,25 @@ struct rc_map_list {
98 98
99/* Routines from rc-map.c */ 99/* Routines from rc-map.c */
100 100
101/**
102 * rc_map_register() - Registers a Remote Controler scancode map
103 *
104 * @map: pointer to struct rc_map_list
105 */
101int rc_map_register(struct rc_map_list *map); 106int rc_map_register(struct rc_map_list *map);
107
108/**
109 * rc_map_unregister() - Unregisters a Remote Controler scancode map
110 *
111 * @map: pointer to struct rc_map_list
112 */
102void rc_map_unregister(struct rc_map_list *map); 113void rc_map_unregister(struct rc_map_list *map);
114
115/**
116 * rc_map_get - gets an RC map from its name
117 * @name: name of the RC scancode map
118 */
103struct rc_map *rc_map_get(const char *name); 119struct rc_map *rc_map_get(const char *name);
104void rc_map_init(void);
105 120
106/* Names of the several keytables defined in-kernel */ 121/* Names of the several keytables defined in-kernel */
107 122
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 094e112cc325..aed539068d2d 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -35,8 +35,12 @@ enum param_type {
35 * those ranges, as they're defined inside the driver. This is used by 35 * those ranges, as they're defined inside the driver. This is used by
36 * analog tuners that are compatible with the "Philips way" to setup the 36 * analog tuners that are compatible with the "Philips way" to setup the
37 * tuners. On those devices, the tuner set is done via 4 bytes: 37 * tuners. On those devices, the tuner set is done via 4 bytes:
38 * divider byte1 (DB1), divider byte 2 (DB2), Control byte (CB) and 38 *
39 * band switch byte (BB). 39 * #) divider byte1 (DB1)
40 * #) divider byte 2 (DB2)
41 * #) Control byte (CB)
42 * #) band switch byte (BB)
43 *
40 * Some tuners also have an additional optional Auxiliary byte (AB). 44 * Some tuners also have an additional optional Auxiliary byte (AB).
41 */ 45 */
42struct tuner_range { 46struct tuner_range {
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 8be898739e0c..c56501ee0484 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -27,31 +27,43 @@ enum tveeprom_audio_processor {
27 * struct tveeprom - Contains the fields parsed from Hauppauge eeproms 27 * struct tveeprom - Contains the fields parsed from Hauppauge eeproms
28 * 28 *
29 * @has_radio: 1 if the device has radio; 0 otherwise. 29 * @has_radio: 1 if the device has radio; 0 otherwise.
30 *
30 * @has_ir: If has_ir == 0, then it is unknown what the IR 31 * @has_ir: If has_ir == 0, then it is unknown what the IR
31 * capabilities are. Otherwise: 32 * capabilities are. Otherwise:
32 * bit 0) 1 (= IR capabilities are known); 33 * bit 0) 1 (= IR capabilities are known);
33 * bit 1) IR receiver present; 34 * bit 1) IR receiver present;
34 * bit 2) IR transmitter (blaster) present. 35 * bit 2) IR transmitter (blaster) present.
36 *
35 * @has_MAC_address: 0: no MAC, 1: MAC present, 2: unknown. 37 * @has_MAC_address: 0: no MAC, 1: MAC present, 2: unknown.
36 * @tuner_type: type of the tuner (TUNER_*, as defined at 38 * @tuner_type: type of the tuner (TUNER_*, as defined at
37 * include/media/tuner.h). 39 * include/media/tuner.h).
40 *
38 * @tuner_formats: Supported analog TV standards (V4L2_STD_*). 41 * @tuner_formats: Supported analog TV standards (V4L2_STD_*).
39 * @tuner_hauppauge_model: Hauppauge's code for the device model number. 42 * @tuner_hauppauge_model: Hauppauge's code for the device model number.
40 * @tuner2_type: type of the second tuner (TUNER_*, as defined 43 * @tuner2_type: type of the second tuner (TUNER_*, as defined
41 * at include/media/tuner.h). 44 * at include/media/tuner.h).
45 *
42 * @tuner2_formats: Tuner 2 supported analog TV standards 46 * @tuner2_formats: Tuner 2 supported analog TV standards
43 * (V4L2_STD_*). 47 * (V4L2_STD_*).
48 *
44 * @tuner2_hauppauge_model: tuner 2 Hauppauge's code for the device model 49 * @tuner2_hauppauge_model: tuner 2 Hauppauge's code for the device model
45 * number. 50 * number.
51 *
46 * @audio_processor: analog audio decoder, as defined by enum 52 * @audio_processor: analog audio decoder, as defined by enum
47 * tveeprom_audio_processor. 53 * tveeprom_audio_processor.
54 *
48 * @decoder_processor: Hauppauge's code for the decoder chipset. 55 * @decoder_processor: Hauppauge's code for the decoder chipset.
49 * Unused by the drivers, as they probe the 56 * Unused by the drivers, as they probe the
50 * decoder based on the PCI or USB ID. 57 * decoder based on the PCI or USB ID.
58 *
51 * @model: Hauppauge's model number 59 * @model: Hauppauge's model number
60 *
52 * @revision: Card revision number 61 * @revision: Card revision number
62 *
53 * @serial_number: Card's serial number 63 * @serial_number: Card's serial number
64 *
54 * @rev_str: Card revision converted to number 65 * @rev_str: Card revision converted to number
66 *
55 * @MAC_address: MAC address for the network interface 67 * @MAC_address: MAC address for the network interface
56 */ 68 */
57struct tveeprom { 69struct tveeprom {
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index 1d6d7da4c45d..8e2a236a4d03 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -23,6 +23,19 @@ struct v4l2_async_notifier;
23/* A random max subdevice number, used to allocate an array on stack */ 23/* A random max subdevice number, used to allocate an array on stack */
24#define V4L2_MAX_SUBDEVS 128U 24#define V4L2_MAX_SUBDEVS 128U
25 25
26/**
27 * enum v4l2_async_match_type - type of asynchronous subdevice logic to be used
28 * in order to identify a match
29 *
30 * @V4L2_ASYNC_MATCH_CUSTOM: Match will use the logic provided by &struct
31 * v4l2_async_subdev.match ops
32 * @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name
33 * @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address
34 * @V4L2_ASYNC_MATCH_OF: Match will use OF node
35 *
36 * This enum is used by the asyncrhronous sub-device logic to define the
37 * algorithm that will be used to match an asynchronous device.
38 */
26enum v4l2_async_match_type { 39enum v4l2_async_match_type {
27 V4L2_ASYNC_MATCH_CUSTOM, 40 V4L2_ASYNC_MATCH_CUSTOM,
28 V4L2_ASYNC_MATCH_DEVNAME, 41 V4L2_ASYNC_MATCH_DEVNAME,
@@ -91,9 +104,35 @@ struct v4l2_async_notifier {
91 struct v4l2_async_subdev *asd); 104 struct v4l2_async_subdev *asd);
92}; 105};
93 106
107/**
108 * v4l2_async_notifier_register - registers a subdevice asynchronous notifier
109 *
110 * @v4l2_dev: pointer to &struct v4l2_device
111 * @notifier: pointer to &struct v4l2_async_notifier
112 */
94int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev, 113int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
95 struct v4l2_async_notifier *notifier); 114 struct v4l2_async_notifier *notifier);
115
116/**
117 * v4l2_async_notifier_unregister - unregisters a subdevice asynchronous notifier
118 *
119 * @notifier: pointer to &struct v4l2_async_notifier
120 */
96void v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier); 121void v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier);
122
123/**
124 * v4l2_async_register_subdev - registers a sub-device to the asynchronous
125 * subdevice framework
126 *
127 * @sd: pointer to &struct v4l2_subdev
128 */
97int v4l2_async_register_subdev(struct v4l2_subdev *sd); 129int v4l2_async_register_subdev(struct v4l2_subdev *sd);
130
131/**
132 * v4l2_async_unregister_subdev - unregisters a sub-device to the asynchronous
133 * subdevice framework
134 *
135 * @sd: pointer to &struct v4l2_subdev
136 */
98void v4l2_async_unregister_subdev(struct v4l2_subdev *sd); 137void v4l2_async_unregister_subdev(struct v4l2_subdev *sd);
99#endif 138#endif
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 1cc0c5ba16b3..350cbf9fb10e 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -78,11 +78,26 @@
78 v4l2_printk(KERN_DEBUG, dev, fmt , ## arg); \ 78 v4l2_printk(KERN_DEBUG, dev, fmt , ## arg); \
79 } while (0) 79 } while (0)
80 80
81/* ------------------------------------------------------------------------- */ 81/**
82 82 * v4l2_ctrl_query_fill- Fill in a struct v4l2_queryctrl
83/* Control helper function */ 83 *
84 * @qctrl: pointer to the &struct v4l2_queryctrl to be filled
85 * @min: minimum value for the control
86 * @max: maximum value for the control
87 * @step: control step
88 * @def: default value for the control
89 *
90 * Fills the &struct v4l2_queryctrl fields for the query control.
91 *
92 * .. note::
93 *
94 * This function assumes that the @qctrl->id field is filled.
95 *
96 * Returns -EINVAL if the control is not known by the V4L2 core, 0 on success.
97 */
84 98
85int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); 99int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl,
100 s32 min, s32 max, s32 step, s32 def);
86 101
87/* ------------------------------------------------------------------------- */ 102/* ------------------------------------------------------------------------- */
88 103
@@ -96,23 +111,60 @@ struct v4l2_device;
96struct v4l2_subdev; 111struct v4l2_subdev;
97struct v4l2_subdev_ops; 112struct v4l2_subdev_ops;
98 113
99 114/**
100/* Load an i2c module and return an initialized v4l2_subdev struct. 115 * v4l2_i2c_new_subdev - Load an i2c module and return an initialized
101 The client_type argument is the name of the chip that's on the adapter. */ 116 * &struct v4l2_subdev.
117 *
118 * @v4l2_dev: pointer to &struct v4l2_device
119 * @adapter: pointer to struct i2c_adapter
120 * @client_type: name of the chip that's on the adapter.
121 * @addr: I2C address. If zero, it will use @probe_addrs
122 * @probe_addrs: array with a list of address. The last entry at such
123 * array should be %I2C_CLIENT_END.
124 *
125 * returns a &struct v4l2_subdev pointer.
126 */
102struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, 127struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
103 struct i2c_adapter *adapter, const char *client_type, 128 struct i2c_adapter *adapter, const char *client_type,
104 u8 addr, const unsigned short *probe_addrs); 129 u8 addr, const unsigned short *probe_addrs);
105 130
106struct i2c_board_info; 131struct i2c_board_info;
107 132
133/**
134 * v4l2_i2c_new_subdev_board - Load an i2c module and return an initialized
135 * &struct v4l2_subdev.
136 *
137 * @v4l2_dev: pointer to &struct v4l2_device
138 * @adapter: pointer to struct i2c_adapter
139 * @info: pointer to struct i2c_board_info used to replace the irq,
140 * platform_data and addr arguments.
141 * @probe_addrs: array with a list of address. The last entry at such
142 * array should be %I2C_CLIENT_END.
143 *
144 * returns a &struct v4l2_subdev pointer.
145 */
108struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, 146struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
109 struct i2c_adapter *adapter, struct i2c_board_info *info, 147 struct i2c_adapter *adapter, struct i2c_board_info *info,
110 const unsigned short *probe_addrs); 148 const unsigned short *probe_addrs);
111 149
112/* Initialize a v4l2_subdev with data from an i2c_client struct */ 150/**
151 * v4l2_i2c_subdev_init - Initializes a &struct v4l2_subdev with data from
152 * an i2c_client struct.
153 *
154 * @sd: pointer to &struct v4l2_subdev
155 * @client: pointer to struct i2c_client
156 * @ops: pointer to &struct v4l2_subdev_ops
157 */
113void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, 158void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
114 const struct v4l2_subdev_ops *ops); 159 const struct v4l2_subdev_ops *ops);
115/* Return i2c client address of v4l2_subdev. */ 160
161/**
162 * v4l2_i2c_subdev_addr - returns i2c client address of &struct v4l2_subdev.
163 *
164 * @sd: pointer to &struct v4l2_subdev
165 *
166 * Returns the address of an I2C sub-device
167 */
116unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd); 168unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd);
117 169
118enum v4l2_i2c_tuner_type { 170enum v4l2_i2c_tuner_type {
@@ -137,12 +189,28 @@ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type);
137 189
138struct spi_device; 190struct spi_device;
139 191
140/* Load an spi module and return an initialized v4l2_subdev struct. 192/**
141 The client_type argument is the name of the chip that's on the adapter. */ 193 * v4l2_spi_new_subdev - Load an spi module and return an initialized
194 * &struct v4l2_subdev.
195 *
196 *
197 * @v4l2_dev: pointer to &struct v4l2_device.
198 * @master: pointer to struct spi_master.
199 * @info: pointer to struct spi_board_info.
200 *
201 * returns a &struct v4l2_subdev pointer.
202 */
142struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev, 203struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
143 struct spi_master *master, struct spi_board_info *info); 204 struct spi_master *master, struct spi_board_info *info);
144 205
145/* Initialize a v4l2_subdev with data from an spi_device struct */ 206/**
207 * v4l2_spi_subdev_init - Initialize a v4l2_subdev with data from an
208 * spi_device struct.
209 *
210 * @sd: pointer to &struct v4l2_subdev
211 * @spi: pointer to struct spi_device.
212 * @ops: pointer to &struct v4l2_subdev_ops
213 */
146void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi, 214void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
147 const struct v4l2_subdev_ops *ops); 215 const struct v4l2_subdev_ops *ops);
148#endif 216#endif
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 8b59336b2217..178a88d45aea 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -1,21 +1,17 @@
1/* 1/*
2 V4L2 controls support header. 2 * V4L2 controls support header.
3 3 *
4 Copyright (C) 2010 Hans Verkuil <hverkuil@xs4all.nl> 4 * Copyright (C) 2010 Hans Verkuil <hverkuil@xs4all.nl>
5 5 *
6 This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 * (at your option) any later version.
10 10 *
11 This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 * GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 15 */
20 16
21#ifndef _V4L2_CTRLS_H 17#ifndef _V4L2_CTRLS_H
@@ -58,6 +54,7 @@ union v4l2_ctrl_ptr {
58 54
59/** 55/**
60 * struct v4l2_ctrl_ops - The control operations that the driver has to provide. 56 * struct v4l2_ctrl_ops - The control operations that the driver has to provide.
57 *
61 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant 58 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant
62 * for volatile (and usually read-only) controls such as a control 59 * for volatile (and usually read-only) controls such as a control
63 * that returns the current signal strength which changes 60 * that returns the current signal strength which changes
@@ -77,12 +74,13 @@ struct v4l2_ctrl_ops {
77 74
78/** 75/**
79 * struct v4l2_ctrl_type_ops - The control type operations that the driver 76 * struct v4l2_ctrl_type_ops - The control type operations that the driver
80 * has to provide. 77 * has to provide.
81 * 78 *
82 * @equal: return true if both values are equal. 79 * @equal: return true if both values are equal.
83 * @init: initialize the value. 80 * @init: initialize the value.
84 * @log: log the value. 81 * @log: log the value.
85 * @validate: validate the value. Return 0 on success and a negative value otherwise. 82 * @validate: validate the value. Return 0 on success and a negative value
83 * otherwise.
86 */ 84 */
87struct v4l2_ctrl_type_ops { 85struct v4l2_ctrl_type_ops {
88 bool (*equal)(const struct v4l2_ctrl *ctrl, u32 idx, 86 bool (*equal)(const struct v4l2_ctrl *ctrl, u32 idx,
@@ -99,6 +97,7 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
99 97
100/** 98/**
101 * struct v4l2_ctrl - The control structure. 99 * struct v4l2_ctrl - The control structure.
100 *
102 * @node: The list node. 101 * @node: The list node.
103 * @ev_subs: The list of control event subscriptions. 102 * @ev_subs: The list of control event subscriptions.
104 * @handler: The handler that owns the control. 103 * @handler: The handler that owns the control.
@@ -106,7 +105,7 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
106 * @ncontrols: Number of controls in cluster array. 105 * @ncontrols: Number of controls in cluster array.
107 * @done: Internal flag: set for each processed control. 106 * @done: Internal flag: set for each processed control.
108 * @is_new: Set when the user specified a new value for this control. It 107 * @is_new: Set when the user specified a new value for this control. It
109 * is also set when called from v4l2_ctrl_handler_setup. Drivers 108 * is also set when called from v4l2_ctrl_handler_setup(). Drivers
110 * should never set this flag. 109 * should never set this flag.
111 * @has_changed: Set when the current value differs from the new value. Drivers 110 * @has_changed: Set when the current value differs from the new value. Drivers
112 * should never use this flag. 111 * should never use this flag.
@@ -119,9 +118,10 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
119 * set this flag directly. 118 * set this flag directly.
120 * @is_int: If set, then this control has a simple integer value (i.e. it 119 * @is_int: If set, then this control has a simple integer value (i.e. it
121 * uses ctrl->val). 120 * uses ctrl->val).
122 * @is_string: If set, then this control has type V4L2_CTRL_TYPE_STRING. 121 * @is_string: If set, then this control has type %V4L2_CTRL_TYPE_STRING.
123 * @is_ptr: If set, then this control is an array and/or has type >= V4L2_CTRL_COMPOUND_TYPES 122 * @is_ptr: If set, then this control is an array and/or has type >=
124 * and/or has type V4L2_CTRL_TYPE_STRING. In other words, struct 123 * %V4L2_CTRL_COMPOUND_TYPES
124 * and/or has type %V4L2_CTRL_TYPE_STRING. In other words, &struct
125 * v4l2_ext_control uses field p to point to the data. 125 * v4l2_ext_control uses field p to point to the data.
126 * @is_array: If set, then this control contains an N-dimensional array. 126 * @is_array: If set, then this control contains an N-dimensional array.
127 * @has_volatiles: If set, then one or more members of the cluster are volatile. 127 * @has_volatiles: If set, then one or more members of the cluster are volatile.
@@ -177,7 +177,8 @@ struct v4l2_ctrl {
177 struct list_head ev_subs; 177 struct list_head ev_subs;
178 struct v4l2_ctrl_handler *handler; 178 struct v4l2_ctrl_handler *handler;
179 struct v4l2_ctrl **cluster; 179 struct v4l2_ctrl **cluster;
180 unsigned ncontrols; 180 unsigned int ncontrols;
181
181 unsigned int done:1; 182 unsigned int done:1;
182 183
183 unsigned int is_new:1; 184 unsigned int is_new:1;
@@ -223,10 +224,12 @@ struct v4l2_ctrl {
223 224
224/** 225/**
225 * struct v4l2_ctrl_ref - The control reference. 226 * struct v4l2_ctrl_ref - The control reference.
227 *
226 * @node: List node for the sorted list. 228 * @node: List node for the sorted list.
227 * @next: Single-link list node for the hash. 229 * @next: Single-link list node for the hash.
228 * @ctrl: The actual control information. 230 * @ctrl: The actual control information.
229 * @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls(). 231 * @helper: Pointer to helper struct. Used internally in
232 * prepare_ext_ctrls().
230 * 233 *
231 * Each control handler has a list of these refs. The list_head is used to 234 * Each control handler has a list of these refs. The list_head is used to
232 * keep a sorted-by-control-ID list of all controls, while the next pointer 235 * keep a sorted-by-control-ID list of all controls, while the next pointer
@@ -241,8 +244,9 @@ struct v4l2_ctrl_ref {
241 244
242/** 245/**
243 * struct v4l2_ctrl_handler - The control handler keeps track of all the 246 * struct v4l2_ctrl_handler - The control handler keeps track of all the
244 * controls: both the controls owned by the handler and those inherited 247 * controls: both the controls owned by the handler and those inherited
245 * from other handlers. 248 * from other handlers.
249 *
246 * @_lock: Default for "lock". 250 * @_lock: Default for "lock".
247 * @lock: Lock to control access to this handler and its controls. 251 * @lock: Lock to control access to this handler and its controls.
248 * May be replaced by the user right after init. 252 * May be replaced by the user right after init.
@@ -252,7 +256,8 @@ struct v4l2_ctrl_ref {
252 * control is needed multiple times, so this is a simple 256 * control is needed multiple times, so this is a simple
253 * optimization. 257 * optimization.
254 * @buckets: Buckets for the hashing. Allows for quick control lookup. 258 * @buckets: Buckets for the hashing. Allows for quick control lookup.
255 * @notify: A notify callback that is called whenever the control changes value. 259 * @notify: A notify callback that is called whenever the control changes
260 * value.
256 * Note that the handler's lock is held when the notify function 261 * Note that the handler's lock is held when the notify function
257 * is called! 262 * is called!
258 * @notify_priv: Passed as argument to the v4l2_ctrl notify callback. 263 * @notify_priv: Passed as argument to the v4l2_ctrl notify callback.
@@ -274,6 +279,7 @@ struct v4l2_ctrl_handler {
274 279
275/** 280/**
276 * struct v4l2_ctrl_config - Control configuration structure. 281 * struct v4l2_ctrl_config - Control configuration structure.
282 *
277 * @ops: The control ops. 283 * @ops: The control ops.
278 * @type_ops: The control type ops. Only needed for compound controls. 284 * @type_ops: The control type ops. Only needed for compound controls.
279 * @id: The control ID. 285 * @id: The control ID.
@@ -282,7 +288,7 @@ struct v4l2_ctrl_handler {
282 * @min: The control's minimum value. 288 * @min: The control's minimum value.
283 * @max: The control's maximum value. 289 * @max: The control's maximum value.
284 * @step: The control's step value for non-menu controls. 290 * @step: The control's step value for non-menu controls.
285 * @def: The control's default value. 291 * @def: The control's default value.
286 * @dims: The size of each dimension. 292 * @dims: The size of each dimension.
287 * @elem_size: The size in bytes of the control. 293 * @elem_size: The size in bytes of the control.
288 * @flags: The control's flags. 294 * @flags: The control's flags.
@@ -297,7 +303,7 @@ struct v4l2_ctrl_handler {
297 * is in addition to the menu_skip_mask above). The last entry 303 * is in addition to the menu_skip_mask above). The last entry
298 * must be NULL. 304 * must be NULL.
299 * @qmenu_int: A const s64 integer array for all menu items of the type 305 * @qmenu_int: A const s64 integer array for all menu items of the type
300 * V4L2_CTRL_TYPE_INTEGER_MENU. 306 * V4L2_CTRL_TYPE_INTEGER_MENU.
301 * @is_private: If set, then this control is private to its handler and it 307 * @is_private: If set, then this control is private to its handler and it
302 * will not be added to any other handlers. 308 * will not be added to any other handlers.
303 */ 309 */
@@ -320,20 +326,31 @@ struct v4l2_ctrl_config {
320 unsigned int is_private:1; 326 unsigned int is_private:1;
321}; 327};
322 328
323/* 329/**
324 * v4l2_ctrl_fill() - Fill in the control fields based on the control ID. 330 * v4l2_ctrl_fill - Fill in the control fields based on the control ID.
331 *
332 * @id: ID of the control
333 * @name: name of the control
334 * @type: type of the control
335 * @min: minimum value for the control
336 * @max: maximum value for the control
337 * @step: control step
338 * @def: default value for the control
339 * @flags: flags to be used on the control
325 * 340 *
326 * This works for all standard V4L2 controls. 341 * This works for all standard V4L2 controls.
327 * For non-standard controls it will only fill in the given arguments 342 * For non-standard controls it will only fill in the given arguments
328 * and @name will be NULL. 343 * and @name will be %NULL.
329 * 344 *
330 * This function will overwrite the contents of @name, @type and @flags. 345 * This function will overwrite the contents of @name, @type and @flags.
331 * The contents of @min, @max, @step and @def may be modified depending on 346 * The contents of @min, @max, @step and @def may be modified depending on
332 * the type. 347 * the type.
333 * 348 *
334 * Do not use in drivers! It is used internally for backwards compatibility 349 * .. note::
335 * control handling only. Once all drivers are converted to use the new 350 *
336 * control framework this function will no longer be exported. 351 * Do not use in drivers! It is used internally for backwards compatibility
352 * control handling only. Once all drivers are converted to use the new
353 * control framework this function will no longer be exported.
337 */ 354 */
338void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, 355void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
339 s64 *min, s64 *max, u64 *step, s64 *def, u32 *flags); 356 s64 *min, s64 *max, u64 *step, s64 *def, u32 *flags);
@@ -359,7 +376,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
359 * macro that hides the @key and @name arguments. 376 * macro that hides the @key and @name arguments.
360 */ 377 */
361int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl, 378int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
362 unsigned nr_of_controls_hint, 379 unsigned int nr_of_controls_hint,
363 struct lock_class_key *key, const char *name); 380 struct lock_class_key *key, const char *name);
364 381
365#ifdef CONFIG_LOCKDEP 382#ifdef CONFIG_LOCKDEP
@@ -436,7 +453,8 @@ void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
436 453
437/** 454/**
438 * v4l2_ctrl_new_custom() - Allocate and initialize a new custom V4L2 455 * v4l2_ctrl_new_custom() - Allocate and initialize a new custom V4L2
439 * control. 456 * control.
457 *
440 * @hdl: The control handler. 458 * @hdl: The control handler.
441 * @cfg: The control's configuration data. 459 * @cfg: The control's configuration data.
442 * @priv: The control's driver-specific private data. 460 * @priv: The control's driver-specific private data.
@@ -445,17 +463,20 @@ void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
445 * and @hdl->error is set to the error code (if it wasn't set already). 463 * and @hdl->error is set to the error code (if it wasn't set already).
446 */ 464 */
447struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl, 465struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
448 const struct v4l2_ctrl_config *cfg, void *priv); 466 const struct v4l2_ctrl_config *cfg,
467 void *priv);
449 468
450/** 469/**
451 * v4l2_ctrl_new_std() - Allocate and initialize a new standard V4L2 non-menu control. 470 * v4l2_ctrl_new_std() - Allocate and initialize a new standard V4L2 non-menu
471 * control.
472 *
452 * @hdl: The control handler. 473 * @hdl: The control handler.
453 * @ops: The control ops. 474 * @ops: The control ops.
454 * @id: The control ID. 475 * @id: The control ID.
455 * @min: The control's minimum value. 476 * @min: The control's minimum value.
456 * @max: The control's maximum value. 477 * @max: The control's maximum value.
457 * @step: The control's step value 478 * @step: The control's step value
458 * @def: The control's default value. 479 * @def: The control's default value.
459 * 480 *
460 * If the &v4l2_ctrl struct could not be allocated, or the control 481 * If the &v4l2_ctrl struct could not be allocated, or the control
461 * ID is not known, then NULL is returned and @hdl->error is set to the 482 * ID is not known, then NULL is returned and @hdl->error is set to the
@@ -466,22 +487,25 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
466 * Use v4l2_ctrl_new_std_menu() when adding menu controls. 487 * Use v4l2_ctrl_new_std_menu() when adding menu controls.
467 */ 488 */
468struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, 489struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
469 const struct v4l2_ctrl_ops *ops, 490 const struct v4l2_ctrl_ops *ops,
470 u32 id, s64 min, s64 max, u64 step, s64 def); 491 u32 id, s64 min, s64 max, u64 step,
492 s64 def);
471 493
472/** 494/**
473 * v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control. 495 * v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2
496 * menu control.
497 *
474 * @hdl: The control handler. 498 * @hdl: The control handler.
475 * @ops: The control ops. 499 * @ops: The control ops.
476 * @id: The control ID. 500 * @id: The control ID.
477 * @max: The control's maximum value. 501 * @max: The control's maximum value.
478 * @mask: The control's skip mask for menu controls. This makes it 502 * @mask: The control's skip mask for menu controls. This makes it
479 * easy to skip menu items that are not valid. If bit X is set, 503 * easy to skip menu items that are not valid. If bit X is set,
480 * then menu item X is skipped. Of course, this only works for 504 * then menu item X is skipped. Of course, this only works for
481 * menus with <= 64 menu items. There are no menus that come 505 * menus with <= 64 menu items. There are no menus that come
482 * close to that number, so this is OK. Should we ever need more, 506 * close to that number, so this is OK. Should we ever need more,
483 * then this will have to be extended to a bit array. 507 * then this will have to be extended to a bit array.
484 * @def: The control's default value. 508 * @def: The control's default value.
485 * 509 *
486 * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value 510 * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value
487 * determines which menu items are to be skipped. 511 * determines which menu items are to be skipped.
@@ -489,12 +513,13 @@ struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
489 * If @id refers to a non-menu control, then this function will return NULL. 513 * If @id refers to a non-menu control, then this function will return NULL.
490 */ 514 */
491struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, 515struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
492 const struct v4l2_ctrl_ops *ops, 516 const struct v4l2_ctrl_ops *ops,
493 u32 id, u8 max, u64 mask, u8 def); 517 u32 id, u8 max, u64 mask, u8 def);
494 518
495/** 519/**
496 * v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control 520 * v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control
497 * with driver specific menu. 521 * with driver specific menu.
522 *
498 * @hdl: The control handler. 523 * @hdl: The control handler.
499 * @ops: The control ops. 524 * @ops: The control ops.
500 * @id: The control ID. 525 * @id: The control ID.
@@ -513,11 +538,14 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
513 * 538 *
514 */ 539 */
515struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, 540struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
516 const struct v4l2_ctrl_ops *ops, u32 id, u8 max, 541 const struct v4l2_ctrl_ops *ops,
517 u64 mask, u8 def, const char * const *qmenu); 542 u32 id, u8 max,
543 u64 mask, u8 def,
544 const char * const *qmenu);
518 545
519/** 546/**
520 * v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. 547 * v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control.
548 *
521 * @hdl: The control handler. 549 * @hdl: The control handler.
522 * @ops: The control ops. 550 * @ops: The control ops.
523 * @id: The control ID. 551 * @id: The control ID.
@@ -528,15 +556,20 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
528 * Same as v4l2_ctrl_new_std_menu(), but @mask is set to 0 and it additionaly 556 * Same as v4l2_ctrl_new_std_menu(), but @mask is set to 0 and it additionaly
529 * takes as an argument an array of integers determining the menu items. 557 * takes as an argument an array of integers determining the menu items.
530 * 558 *
531 * If @id refers to a non-integer-menu control, then this function will return NULL. 559 * If @id refers to a non-integer-menu control, then this function will
560 * return %NULL.
532 */ 561 */
533struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, 562struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
534 const struct v4l2_ctrl_ops *ops, 563 const struct v4l2_ctrl_ops *ops,
535 u32 id, u8 max, u8 def, const s64 *qmenu_int); 564 u32 id, u8 max, u8 def,
565 const s64 *qmenu_int);
566
567typedef bool (*v4l2_ctrl_filter)(const struct v4l2_ctrl *ctrl);
536 568
537/** 569/**
538 * v4l2_ctrl_add_handler() - Add all controls from handler @add to 570 * v4l2_ctrl_add_handler() - Add all controls from handler @add to
539 * handler @hdl. 571 * handler @hdl.
572 *
540 * @hdl: The control handler. 573 * @hdl: The control handler.
541 * @add: The control handler whose controls you want to add to 574 * @add: The control handler whose controls you want to add to
542 * the @hdl control handler. 575 * the @hdl control handler.
@@ -550,10 +583,11 @@ struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
550 */ 583 */
551int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, 584int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
552 struct v4l2_ctrl_handler *add, 585 struct v4l2_ctrl_handler *add,
553 bool (*filter)(const struct v4l2_ctrl *ctrl)); 586 v4l2_ctrl_filter filter);
554 587
555/** 588/**
556 * v4l2_ctrl_radio_filter() - Standard filter for radio controls. 589 * v4l2_ctrl_radio_filter() - Standard filter for radio controls.
590 *
557 * @ctrl: The control that is filtered. 591 * @ctrl: The control that is filtered.
558 * 592 *
559 * This will return true for any controls that are valid for radio device 593 * This will return true for any controls that are valid for radio device
@@ -565,16 +599,19 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
565bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl); 599bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl);
566 600
567/** 601/**
568 * v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging to that cluster. 602 * v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging
603 * to that cluster.
604 *
569 * @ncontrols: The number of controls in this cluster. 605 * @ncontrols: The number of controls in this cluster.
570 * @controls: The cluster control array of size @ncontrols. 606 * @controls: The cluster control array of size @ncontrols.
571 */ 607 */
572void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); 608void v4l2_ctrl_cluster(unsigned int ncontrols, struct v4l2_ctrl **controls);
573 609
574 610
575/** 611/**
576 * v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to 612 * v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging
577 * that cluster and set it up for autofoo/foo-type handling. 613 * to that cluster and set it up for autofoo/foo-type handling.
614 *
578 * @ncontrols: The number of controls in this cluster. 615 * @ncontrols: The number of controls in this cluster.
579 * @controls: The cluster control array of size @ncontrols. The first control 616 * @controls: The cluster control array of size @ncontrols. The first control
580 * must be the 'auto' control (e.g. autogain, autoexposure, etc.) 617 * must be the 'auto' control (e.g. autogain, autoexposure, etc.)
@@ -602,12 +639,14 @@ void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls);
602 * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s) 639 * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
603 * if autofoo is in auto mode. 640 * if autofoo is in auto mode.
604 */ 641 */
605void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, 642void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
606 u8 manual_val, bool set_volatile); 643 struct v4l2_ctrl **controls,
644 u8 manual_val, bool set_volatile);
607 645
608 646
609/** 647/**
610 * v4l2_ctrl_find() - Find a control with the given ID. 648 * v4l2_ctrl_find() - Find a control with the given ID.
649 *
611 * @hdl: The control handler. 650 * @hdl: The control handler.
612 * @id: The control ID to find. 651 * @id: The control ID to find.
613 * 652 *
@@ -632,6 +671,7 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
632 671
633/** 672/**
634 * v4l2_ctrl_grab() - Mark the control as grabbed or not grabbed. 673 * v4l2_ctrl_grab() - Mark the control as grabbed or not grabbed.
674 *
635 * @ctrl: The control to (de)activate. 675 * @ctrl: The control to (de)activate.
636 * @grabbed: True if the control should become grabbed. 676 * @grabbed: True if the control should become grabbed.
637 * 677 *
@@ -671,6 +711,7 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
671 711
672/** 712/**
673 * v4l2_ctrl_modify_range() - Update the range of a control. 713 * v4l2_ctrl_modify_range() - Update the range of a control.
714 *
674 * @ctrl: The control to update. 715 * @ctrl: The control to update.
675 * @min: The control's minimum value. 716 * @min: The control's minimum value.
676 * @max: The control's maximum value. 717 * @max: The control's maximum value.
@@ -701,6 +742,7 @@ static inline int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
701 742
702/** 743/**
703 * v4l2_ctrl_notify() - Function to set a notify callback for a control. 744 * v4l2_ctrl_notify() - Function to set a notify callback for a control.
745 *
704 * @ctrl: The control. 746 * @ctrl: The control.
705 * @notify: The callback function. 747 * @notify: The callback function.
706 * @priv: The callback private handle, passed as argument to the callback. 748 * @priv: The callback private handle, passed as argument to the callback.
@@ -712,10 +754,12 @@ static inline int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
712 * There can be only one notify. If another already exists, then a WARN_ON 754 * There can be only one notify. If another already exists, then a WARN_ON
713 * will be issued and the function will do nothing. 755 * will be issued and the function will do nothing.
714 */ 756 */
715void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, void *priv); 757void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify,
758 void *priv);
716 759
717/** 760/**
718 * v4l2_ctrl_get_name() - Get the name of the control 761 * v4l2_ctrl_get_name() - Get the name of the control
762 *
719 * @id: The control ID. 763 * @id: The control ID.
720 * 764 *
721 * This function returns the name of the given control ID or NULL if it isn't 765 * This function returns the name of the given control ID or NULL if it isn't
@@ -725,6 +769,7 @@ const char *v4l2_ctrl_get_name(u32 id);
725 769
726/** 770/**
727 * v4l2_ctrl_get_menu() - Get the menu string array of the control 771 * v4l2_ctrl_get_menu() - Get the menu string array of the control
772 *
728 * @id: The control ID. 773 * @id: The control ID.
729 * 774 *
730 * This function returns the NULL-terminated menu string array name of the 775 * This function returns the NULL-terminated menu string array name of the
@@ -734,6 +779,7 @@ const char * const *v4l2_ctrl_get_menu(u32 id);
734 779
735/** 780/**
736 * v4l2_ctrl_get_int_menu() - Get the integer menu array of the control 781 * v4l2_ctrl_get_int_menu() - Get the integer menu array of the control
782 *
737 * @id: The control ID. 783 * @id: The control ID.
738 * @len: The size of the integer array. 784 * @len: The size of the integer array.
739 * 785 *
@@ -743,7 +789,9 @@ const char * const *v4l2_ctrl_get_menu(u32 id);
743const s64 *v4l2_ctrl_get_int_menu(u32 id, u32 *len); 789const s64 *v4l2_ctrl_get_int_menu(u32 id, u32 *len);
744 790
745/** 791/**
746 * v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. 792 * v4l2_ctrl_g_ctrl() - Helper function to get the control's value from
793 * within a driver.
794 *
747 * @ctrl: The control. 795 * @ctrl: The control.
748 * 796 *
749 * This returns the control's value safely by going through the control 797 * This returns the control's value safely by going through the control
@@ -756,8 +804,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
756 804
757/** 805/**
758 * __v4l2_ctrl_s_ctrl() - Unlocked variant of v4l2_ctrl_s_ctrl(). 806 * __v4l2_ctrl_s_ctrl() - Unlocked variant of v4l2_ctrl_s_ctrl().
807 *
759 * @ctrl: The control. 808 * @ctrl: The control.
760 * @val: The new value. 809 * @val: TheControls name new value.
761 * 810 *
762 * This sets the control's new value safely by going through the control 811 * This sets the control's new value safely by going through the control
763 * framework. This function assumes the control's handler is already locked, 812 * framework. This function assumes the control's handler is already locked,
@@ -767,7 +816,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
767 */ 816 */
768int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); 817int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
769 818
770/** v4l2_ctrl_s_ctrl() - Helper function to set the control's value from within a driver. 819/**
820 * v4l2_ctrl_s_ctrl() - Helper function to set the control's value from
821 * within a driver.
771 * @ctrl: The control. 822 * @ctrl: The control.
772 * @val: The new value. 823 * @val: The new value.
773 * 824 *
@@ -791,6 +842,7 @@ static inline int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
791/** 842/**
792 * v4l2_ctrl_g_ctrl_int64() - Helper function to get a 64-bit control's value 843 * v4l2_ctrl_g_ctrl_int64() - Helper function to get a 64-bit control's value
793 * from within a driver. 844 * from within a driver.
845 *
794 * @ctrl: The control. 846 * @ctrl: The control.
795 * 847 *
796 * This returns the control's value safely by going through the control 848 * This returns the control's value safely by going through the control
@@ -815,7 +867,8 @@ s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl);
815 */ 867 */
816int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val); 868int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val);
817 869
818/** v4l2_ctrl_s_ctrl_int64() - Helper function to set a 64-bit control's value 870/**
871 * v4l2_ctrl_s_ctrl_int64() - Helper function to set a 64-bit control's value
819 * from within a driver. 872 * from within a driver.
820 * 873 *
821 * @ctrl: The control. 874 * @ctrl: The control.
@@ -838,7 +891,8 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
838 return rval; 891 return rval;
839} 892}
840 893
841/** __v4l2_ctrl_s_ctrl_string() - Unlocked variant of v4l2_ctrl_s_ctrl_string(). 894/**
895 * __v4l2_ctrl_s_ctrl_string() - Unlocked variant of v4l2_ctrl_s_ctrl_string().
842 * 896 *
843 * @ctrl: The control. 897 * @ctrl: The control.
844 * @s: The new string. 898 * @s: The new string.
@@ -851,12 +905,13 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
851 */ 905 */
852int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s); 906int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s);
853 907
854/** v4l2_ctrl_s_ctrl_string() - Helper function to set a control's string value 908/**
909 * v4l2_ctrl_s_ctrl_string() - Helper function to set a control's string value
855 * from within a driver. 910 * from within a driver.
856 * 911 *
857 * @ctrl: The control. 912 * @ctrl: The control.
858 * @s: The new string. 913 * @s: The new string.
859 * 914 *Controls name
860 * This sets the control's new string safely by going through the control 915 * This sets the control's new string safely by going through the control
861 * framework. This function will lock the control's handler, so it cannot be 916 * framework. This function will lock the control's handler, so it cannot be
862 * used from within the &v4l2_ctrl_ops functions. 917 * used from within the &v4l2_ctrl_ops functions.
@@ -876,39 +931,179 @@ static inline int v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s)
876 931
877/* Internal helper functions that deal with control events. */ 932/* Internal helper functions that deal with control events. */
878extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops; 933extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops;
934
935/**
936 * v4l2_ctrl_replace - Function to be used as a callback to
937 * &struct v4l2_subscribed_event_ops replace\(\)
938 *
939 * @old: pointer to :ref:`struct v4l2_event <v4l2-event>` with the reported
940 * event;
941 * @new: pointer to :ref:`struct v4l2_event <v4l2-event>` with the modified
942 * event;
943 */
879void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new); 944void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
945
946/**
947 * v4l2_ctrl_merge - Function to be used as a callback to
948 * &struct v4l2_subscribed_event_ops merge(\)
949 *
950 * @old: pointer to :ref:`struct v4l2_event <v4l2-event>` with the reported
951 * event;
952 * @new: pointer to :ref:`struct v4l2_event <v4l2-event>` with the merged
953 * event;
954 */
880void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new); 955void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new);
881 956
882/* Can be used as a vidioc_log_status function that just dumps all controls 957/**
883 associated with the filehandle. */ 958 * v4l2_ctrl_log_status - helper function to implement %VIDIOC_LOG_STATUS ioctl
959 *
960 * @file: pointer to struct file
961 * @fh: unused. Kept just to be compatible to the arguments expected by
962 * &struct v4l2_ioctl_ops.vidioc_log_status.
963 *
964 * Can be used as a vidioc_log_status function that just dumps all controls
965 * associated with the filehandle.
966 */
884int v4l2_ctrl_log_status(struct file *file, void *fh); 967int v4l2_ctrl_log_status(struct file *file, void *fh);
885 968
886/* Can be used as a vidioc_subscribe_event function that just subscribes 969/**
887 control events. */ 970 * v4l2_ctrl_subscribe_event - Subscribes to an event
971 *
972 *
973 * @fh: pointer to struct v4l2_fh
974 * @sub: pointer to &struct v4l2_event_subscription
975 *
976 * Can be used as a vidioc_subscribe_event function that just subscribes
977 * control events.
978 */
888int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh, 979int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
889 const struct v4l2_event_subscription *sub); 980 const struct v4l2_event_subscription *sub);
890 981
891/* Can be used as a poll function that just polls for control events. */ 982/**
983 * v4l2_ctrl_poll - function to be used as a callback to the poll()
984 * That just polls for control events.
985 *
986 * @file: pointer to struct file
987 * @wait: pointer to struct poll_table_struct
988 */
892unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait); 989unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait);
893 990
894/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ 991/* Helpers for ioctl_ops */
992
993/**
994 * v4l2_queryctrl - Helper function to implement
995 * :ref:`VIDIOC_QUERYCTRL <vidioc_queryctrl>` ioctl
996 *
997 * @hdl: pointer to &struct v4l2_ctrl_handler
998 * @qc: pointer to &struct v4l2_queryctrl
999 *
1000 * If hdl == NULL then they will all return -EINVAL.
1001 */
895int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); 1002int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
896int v4l2_query_ext_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_query_ext_ctrl *qc); 1003
1004/**
1005 * v4l2_query_ext_ctrl - Helper function to implement
1006 * :ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl
1007 *
1008 * @hdl: pointer to &struct v4l2_ctrl_handler
1009 * @qc: pointer to &struct v4l2_query_ext_ctrl
1010 *
1011 * If hdl == NULL then they will all return -EINVAL.
1012 */
1013int v4l2_query_ext_ctrl(struct v4l2_ctrl_handler *hdl,
1014 struct v4l2_query_ext_ctrl *qc);
1015
1016/**
1017 * v4l2_querymenu - Helper function to implement
1018 * :ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl
1019 *
1020 * @hdl: pointer to &struct v4l2_ctrl_handler
1021 * @qm: pointer to &struct v4l2_querymenu
1022 *
1023 * If hdl == NULL then they will all return -EINVAL.
1024 */
897int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); 1025int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm);
1026
1027/**
1028 * v4l2_g_ctrl - Helper function to implement
1029 * :ref:`VIDIOC_G_CTRL <vidioc_g_ctrl>` ioctl
1030 *
1031 * @hdl: pointer to &struct v4l2_ctrl_handler
1032 * @ctrl: pointer to &struct v4l2_control
1033 *
1034 * If hdl == NULL then they will all return -EINVAL.
1035 */
898int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); 1036int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl);
1037
1038/**
1039 * v4l2_s_ctrl - Helper function to implement
1040 * :ref:`VIDIOC_S_CTRL <vidioc_g_ctrl>` ioctl
1041 *
1042 * @fh: pointer to &struct v4l2_fh
1043 * @hdl: pointer to &struct v4l2_ctrl_handler
1044 *
1045 * @ctrl: pointer to &struct v4l2_control
1046 *
1047 * If hdl == NULL then they will all return -EINVAL.
1048 */
899int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, 1049int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
900 struct v4l2_control *ctrl); 1050 struct v4l2_control *ctrl);
901int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 1051
902int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 1052/**
1053 * v4l2_g_ext_ctrls - Helper function to implement
1054 * :ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
1055 *
1056 * @hdl: pointer to &struct v4l2_ctrl_handler
1057 * @c: pointer to &struct v4l2_ext_controls
1058 *
1059 * If hdl == NULL then they will all return -EINVAL.
1060 */
1061int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl,
1062 struct v4l2_ext_controls *c);
1063
1064/**
1065 * v4l2_try_ext_ctrls - Helper function to implement
1066 * :ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
1067 *
1068 * @hdl: pointer to &struct v4l2_ctrl_handler
1069 * @c: pointer to &struct v4l2_ext_controls
1070 *
1071 * If hdl == NULL then they will all return -EINVAL.
1072 */
1073int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl,
1074 struct v4l2_ext_controls *c);
1075
1076/**
1077 * v4l2_s_ext_ctrls - Helper function to implement
1078 * :ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
1079 *
1080 * @fh: pointer to &struct v4l2_fh
1081 * @hdl: pointer to &struct v4l2_ctrl_handler
1082 * @c: pointer to &struct v4l2_ext_controls
1083 *
1084 * If hdl == NULL then they will all return -EINVAL.
1085 */
903int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, 1086int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
904 struct v4l2_ext_controls *c); 1087 struct v4l2_ext_controls *c);
905 1088
906/* Can be used as a subscribe_event function that just subscribes control 1089/**
907 events. */ 1090 * v4l2_ctrl_subdev_subscribe_event - Helper function to implement
1091 * as a &struct v4l2_subdev_core_ops subscribe_event function
1092 * that just subscribes control events.
1093 *
1094 * @sd: pointer to &struct v4l2_subdev
1095 * @fh: pointer to &struct v4l2_fh
1096 * @sub: pointer to &struct v4l2_event_subscription
1097 */
908int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, 1098int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
909 struct v4l2_event_subscription *sub); 1099 struct v4l2_event_subscription *sub);
910 1100
911/* Log all controls owned by subdev's control handler. */ 1101/**
1102 * v4l2_ctrl_subdev_log_status - Log all controls owned by subdev's control
1103 * handler.
1104 *
1105 * @sd: pointer to &struct v4l2_subdev
1106 */
912int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd); 1107int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd);
913 1108
914#endif 1109#endif
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 25a3190308fb..a122b1bd40f9 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -47,19 +47,105 @@ struct v4l2_ctrl_handler;
47 47
48/* Priority helper functions */ 48/* Priority helper functions */
49 49
50/**
51 * struct v4l2_prio_state - stores the priority states
52 *
53 * @prios: array with elements to store the array priorities
54 *
55 *
56 * .. note::
57 * The size of @prios array matches the number of priority types defined
58 * by :ref:`enum v4l2_priority <v4l2-priority>`.
59 */
50struct v4l2_prio_state { 60struct v4l2_prio_state {
51 atomic_t prios[4]; 61 atomic_t prios[4];
52}; 62};
53 63
64/**
65 * v4l2_prio_init - initializes a struct v4l2_prio_state
66 *
67 * @global: pointer to &struct v4l2_prio_state
68 */
54void v4l2_prio_init(struct v4l2_prio_state *global); 69void v4l2_prio_init(struct v4l2_prio_state *global);
70
71/**
72 * v4l2_prio_change - changes the v4l2 file handler priority
73 *
74 * @global: pointer to the &struct v4l2_prio_state of the device node.
75 * @local: pointer to the desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
76 * @new: Priority type requested, as defined by :ref:`enum v4l2_priority <v4l2-priority>`.
77 *
78 * .. note::
79 * This function should be used only by the V4L2 core.
80 */
55int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, 81int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
56 enum v4l2_priority new); 82 enum v4l2_priority new);
83
84/**
85 * v4l2_prio_open - Implements the priority logic for a file handler open
86 *
87 * @global: pointer to the &struct v4l2_prio_state of the device node.
88 * @local: pointer to the desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
89 *
90 * .. note::
91 * This function should be used only by the V4L2 core.
92 */
57void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); 93void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
94
95/**
96 * v4l2_prio_close - Implements the priority logic for a file handler close
97 *
98 * @global: pointer to the &struct v4l2_prio_state of the device node.
99 * @local: priority to be released, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
100 *
101 * .. note::
102 * This function should be used only by the V4L2 core.
103 */
58void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local); 104void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local);
105
106/**
107 * v4l2_prio_max - Return the maximum priority, as stored at the @global array.
108 *
109 * @global: pointer to the &struct v4l2_prio_state of the device node.
110 *
111 * .. note::
112 * This function should be used only by the V4L2 core.
113 */
59enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); 114enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
60int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local);
61 115
116/**
117 * v4l2_prio_close - Implements the priority logic for a file handler close
118 *
119 * @global: pointer to the &struct v4l2_prio_state of the device node.
120 * @local: desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>` local
121 *
122 * .. note::
123 * This function should be used only by the V4L2 core.
124 */
125int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local);
62 126
127/**
128 * struct v4l2_file_operations - fs operations used by a V4L2 device
129 *
130 * @owner: pointer to struct module
131 * @read: operations needed to implement the read() syscall
132 * @write: operations needed to implement the write() syscall
133 * @poll: operations needed to implement the poll() syscall
134 * @unlocked_ioctl: operations needed to implement the ioctl() syscall
135 * @compat_ioctl32: operations needed to implement the ioctl() syscall for
136 * the special case where the Kernel uses 64 bits instructions, but
137 * the userspace uses 32 bits.
138 * @get_unmapped_area: called by the mmap() syscall, used when %!CONFIG_MMU
139 * @mmap: operations needed to implement the mmap() syscall
140 * @open: operations needed to implement the open() syscall
141 * @release: operations needed to implement the release() syscall
142 *
143 * .. note::
144 *
145 * Those operations are used to implemente the fs struct file_operations
146 * at the V4L2 drivers. The V4L2 core overrides the fs ops with some
147 * extra logic needed by the subsystem.
148 */
63struct v4l2_file_operations { 149struct v4l2_file_operations {
64 struct module *owner; 150 struct module *owner;
65 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 151 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
@@ -82,6 +168,47 @@ struct v4l2_file_operations {
82 * the common handler 168 * the common handler
83 */ 169 */
84 170
171/**
172 * struct video_device - Structure used to create and manage the V4L2 device
173 * nodes.
174 *
175 * @entity: &struct media_entity
176 * @intf_devnode: pointer to &struct media_intf_devnode
177 * @pipe: &struct media_pipeline
178 * @fops: pointer to &struct v4l2_file_operations for the video device
179 * @device_caps: device capabilities as used in v4l2_capabilities
180 * @dev: &struct device for the video device
181 * @cdev: character device
182 * @v4l2_dev: pointer to &struct v4l2_device parent
183 * @dev_parent: pointer to &struct device parent
184 * @ctrl_handler: Control handler associated with this device node.
185 * May be NULL.
186 * @queue: &struct vb2_queue associated with this device node. May be NULL.
187 * @prio: pointer to &struct v4l2_prio_state with device's Priority state.
188 * If NULL, then v4l2_dev->prio will be used.
189 * @name: video device name
190 * @vfl_type: V4L device type
191 * @vfl_dir: V4L receiver, transmitter or m2m
192 * @minor: device node 'minor'. It is set to -1 if the registration failed
193 * @num: number of the video device node
194 * @flags: video device flags. Use bitops to set/clear/test flags
195 * @index: attribute to differentiate multiple indices on one physical device
196 * @fh_lock: Lock for all v4l2_fhs
197 * @fh_list: List of &struct v4l2_fh
198 * @dev_debug: Internal device debug flags, not for use by drivers
199 * @tvnorms: Supported tv norms
200 *
201 * @release: video device release() callback
202 * @ioctl_ops: pointer to &struct v4l2_ioctl_ops with ioctl callbacks
203 *
204 * @valid_ioctls: bitmap with the valid ioctls for this device
205 * @disable_locking: bitmap with the ioctls that don't require locking
206 * @lock: pointer to &struct mutex serialization lock
207 *
208 * .. note::
209 * Only set @dev_parent if that can't be deduced from @v4l2_dev.
210 */
211
85struct video_device 212struct video_device
86{ 213{
87#if defined(CONFIG_MEDIA_CONTROLLER) 214#if defined(CONFIG_MEDIA_CONTROLLER)
@@ -89,59 +216,45 @@ struct video_device
89 struct media_intf_devnode *intf_devnode; 216 struct media_intf_devnode *intf_devnode;
90 struct media_pipeline pipe; 217 struct media_pipeline pipe;
91#endif 218#endif
92 /* device ops */
93 const struct v4l2_file_operations *fops; 219 const struct v4l2_file_operations *fops;
94 220
95 /* device capabilities as used in v4l2_capabilities */
96 u32 device_caps; 221 u32 device_caps;
97 222
98 /* sysfs */ 223 /* sysfs */
99 struct device dev; /* v4l device */ 224 struct device dev;
100 struct cdev *cdev; /* character device */ 225 struct cdev *cdev;
101 226
102 struct v4l2_device *v4l2_dev; /* v4l2_device parent */ 227 struct v4l2_device *v4l2_dev;
103 /* Only set parent if that can't be deduced from v4l2_dev */ 228 struct device *dev_parent;
104 struct device *dev_parent; /* device parent */
105 229
106 /* Control handler associated with this device node. May be NULL. */
107 struct v4l2_ctrl_handler *ctrl_handler; 230 struct v4l2_ctrl_handler *ctrl_handler;
108 231
109 /* vb2_queue associated with this device node. May be NULL. */
110 struct vb2_queue *queue; 232 struct vb2_queue *queue;
111 233
112 /* Priority state. If NULL, then v4l2_dev->prio will be used. */
113 struct v4l2_prio_state *prio; 234 struct v4l2_prio_state *prio;
114 235
115 /* device info */ 236 /* device info */
116 char name[32]; 237 char name[32];
117 int vfl_type; /* device type */ 238 int vfl_type;
118 int vfl_dir; /* receiver, transmitter or m2m */ 239 int vfl_dir;
119 /* 'minor' is set to -1 if the registration failed */
120 int minor; 240 int minor;
121 u16 num; 241 u16 num;
122 /* use bitops to set/clear/test flags */
123 unsigned long flags; 242 unsigned long flags;
124 /* attribute to differentiate multiple indices on one physical device */
125 int index; 243 int index;
126 244
127 /* V4L2 file handles */ 245 /* V4L2 file handles */
128 spinlock_t fh_lock; /* Lock for all v4l2_fhs */ 246 spinlock_t fh_lock;
129 struct list_head fh_list; /* List of struct v4l2_fh */ 247 struct list_head fh_list;
130 248
131 /* Internal device debug flags, not for use by drivers */
132 int dev_debug; 249 int dev_debug;
133 250
134 /* Video standard vars */ 251 v4l2_std_id tvnorms;
135 v4l2_std_id tvnorms; /* Supported tv norms */
136 252
137 /* callbacks */ 253 /* callbacks */
138 void (*release)(struct video_device *vdev); 254 void (*release)(struct video_device *vdev);
139
140 /* ioctl callbacks */
141 const struct v4l2_ioctl_ops *ioctl_ops; 255 const struct v4l2_ioctl_ops *ioctl_ops;
142 DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE); 256 DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE);
143 257
144 /* serialization lock */
145 DECLARE_BITMAP(disable_locking, BASE_VIDIOC_PRIVATE); 258 DECLARE_BITMAP(disable_locking, BASE_VIDIOC_PRIVATE);
146 struct mutex *lock; 259 struct mutex *lock;
147}; 260};
@@ -151,88 +264,241 @@ struct video_device
151/* dev to video-device */ 264/* dev to video-device */
152#define to_video_device(cd) container_of(cd, struct video_device, dev) 265#define to_video_device(cd) container_of(cd, struct video_device, dev)
153 266
267/**
268 * __video_register_device - register video4linux devices
269 *
270 * @vdev: struct video_device to register
271 * @type: type of device to register
272 * @nr: which device node number is desired:
273 * (0 == /dev/video0, 1 == /dev/video1, ..., -1 == first free)
274 * @warn_if_nr_in_use: warn if the desired device node number
275 * was already in use and another number was chosen instead.
276 * @owner: module that owns the video device node
277 *
278 * The registration code assigns minor numbers and device node numbers
279 * based on the requested type and registers the new device node with
280 * the kernel.
281 *
282 * This function assumes that struct video_device was zeroed when it
283 * was allocated and does not contain any stale date.
284 *
285 * An error is returned if no free minor or device node number could be
286 * found, or if the registration of the device node failed.
287 *
288 * Returns 0 on success.
289 *
290 * Valid values for @type are:
291 *
292 * - %VFL_TYPE_GRABBER - A frame grabber
293 * - %VFL_TYPE_VBI - Vertical blank data (undecoded)
294 * - %VFL_TYPE_RADIO - A radio card
295 * - %VFL_TYPE_SUBDEV - A subdevice
296 * - %VFL_TYPE_SDR - Software Defined Radio
297 *
298 * .. note::
299 *
300 * This function is meant to be used only inside the V4L2 core.
301 * Drivers should use video_register_device() or
302 * video_register_device_no_warn().
303 */
154int __must_check __video_register_device(struct video_device *vdev, int type, 304int __must_check __video_register_device(struct video_device *vdev, int type,
155 int nr, int warn_if_nr_in_use, struct module *owner); 305 int nr, int warn_if_nr_in_use, struct module *owner);
156 306
157/* Register video devices. Note that if video_register_device fails, 307/**
158 the release() callback of the video_device structure is *not* called, so 308 * video_register_device - register video4linux devices
159 the caller is responsible for freeing any data. Usually that means that 309 *
160 you call video_device_release() on failure. */ 310 * @vdev: struct video_device to register
311 * @type: type of device to register
312 * @nr: which device node number is desired:
313 * (0 == /dev/video0, 1 == /dev/video1, ..., -1 == first free)
314 *
315 * Internally, it calls __video_register_device(). Please see its
316 * documentation for more details.
317 *
318 * .. note::
319 * if video_register_device fails, the release() callback of
320 * &struct video_device structure is *not* called, so the caller
321 * is responsible for freeing any data. Usually that means that
322 * you video_device_release() should be called on failure.
323 */
161static inline int __must_check video_register_device(struct video_device *vdev, 324static inline int __must_check video_register_device(struct video_device *vdev,
162 int type, int nr) 325 int type, int nr)
163{ 326{
164 return __video_register_device(vdev, type, nr, 1, vdev->fops->owner); 327 return __video_register_device(vdev, type, nr, 1, vdev->fops->owner);
165} 328}
166 329
167/* Same as video_register_device, but no warning is issued if the desired 330/**
168 device node number was already in use. */ 331 * video_register_device_no_warn - register video4linux devices
332 *
333 * @vdev: struct video_device to register
334 * @type: type of device to register
335 * @nr: which device node number is desired:
336 * (0 == /dev/video0, 1 == /dev/video1, ..., -1 == first free)
337 *
338 * This function is identical to video_register_device() except that no
339 * warning is issued if the desired device node number was already in use.
340 *
341 * Internally, it calls __video_register_device(). Please see its
342 * documentation for more details.
343 *
344 * .. note::
345 * if video_register_device fails, the release() callback of
346 * &struct video_device structure is *not* called, so the caller
347 * is responsible for freeing any data. Usually that means that
348 * you video_device_release() should be called on failure.
349 */
169static inline int __must_check video_register_device_no_warn( 350static inline int __must_check video_register_device_no_warn(
170 struct video_device *vdev, int type, int nr) 351 struct video_device *vdev, int type, int nr)
171{ 352{
172 return __video_register_device(vdev, type, nr, 0, vdev->fops->owner); 353 return __video_register_device(vdev, type, nr, 0, vdev->fops->owner);
173} 354}
174 355
175/* Unregister video devices. Will do nothing if vdev == NULL or 356/**
176 video_is_registered() returns false. */ 357 * video_unregister_device - Unregister video devices.
358 *
359 * @vdev: &struct video_device to register
360 *
361 * Does nothing if vdev == NULL or if video_is_registered() returns false.
362 */
177void video_unregister_device(struct video_device *vdev); 363void video_unregister_device(struct video_device *vdev);
178 364
179/* helper functions to alloc/release struct video_device, the 365/**
180 latter can also be used for video_device->release(). */ 366 * video_device_alloc - helper function to alloc &struct video_device
367 *
368 * Returns NULL if %-ENOMEM or a &struct video_device on success.
369 */
181struct video_device * __must_check video_device_alloc(void); 370struct video_device * __must_check video_device_alloc(void);
182 371
183/* this release function frees the vdev pointer */ 372/**
373 * video_device_release - helper function to release &struct video_device
374 *
375 * @vdev: pointer to &struct video_device
376 *
377 * Can also be used for video_device->release\(\).
378 */
184void video_device_release(struct video_device *vdev); 379void video_device_release(struct video_device *vdev);
185 380
186/* this release function does nothing, use when the video_device is a 381/**
187 static global struct. Note that having a static video_device is 382 * video_device_release_empty - helper function to implement the
188 a dubious construction at best. */ 383 * video_device->release\(\) callback.
384 *
385 * @vdev: pointer to &struct video_device
386 *
387 * This release function does nothing.
388 *
389 * It should be used when the video_device is a static global struct.
390 *
391 * .. note::
392 * Having a static video_device is a dubious construction at best.
393 */
189void video_device_release_empty(struct video_device *vdev); 394void video_device_release_empty(struct video_device *vdev);
190 395
191/* returns true if cmd is a known V4L2 ioctl */ 396/**
397 * v4l2_is_known_ioctl - Checks if a given cmd is a known V4L ioctl
398 *
399 * @cmd: ioctl command
400 *
401 * returns true if cmd is a known V4L2 ioctl
402 */
192bool v4l2_is_known_ioctl(unsigned int cmd); 403bool v4l2_is_known_ioctl(unsigned int cmd);
193 404
194/* mark that this command shouldn't use core locking */ 405/** v4l2_disable_ioctl_locking - mark that a given command
195static inline void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd) 406 * shouldn't use core locking
407 *
408 * @vdev: pointer to &struct video_device
409 * @cmd: ioctl command
410 */
411static inline void v4l2_disable_ioctl_locking(struct video_device *vdev,
412 unsigned int cmd)
196{ 413{
197 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) 414 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE)
198 set_bit(_IOC_NR(cmd), vdev->disable_locking); 415 set_bit(_IOC_NR(cmd), vdev->disable_locking);
199} 416}
200 417
201/* Mark that this command isn't implemented. This must be called before 418/**
202 video_device_register. See also the comments in determine_valid_ioctls(). 419 * v4l2_disable_ioctl- mark that a given command isn't implemented.
203 This function allows drivers to provide just one v4l2_ioctl_ops struct, but 420 * shouldn't use core locking
204 disable ioctls based on the specific card that is actually found. */ 421 *
205static inline void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd) 422 * @vdev: pointer to &struct video_device
423 * @cmd: ioctl command
424 *
425 * This function allows drivers to provide just one v4l2_ioctl_ops struct, but
426 * disable ioctls based on the specific card that is actually found.
427 *
428 * .. note::
429 *
430 * This must be called before video_register_device.
431 * See also the comments for determine_valid_ioctls().
432 */
433static inline void v4l2_disable_ioctl(struct video_device *vdev,
434 unsigned int cmd)
206{ 435{
207 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) 436 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE)
208 set_bit(_IOC_NR(cmd), vdev->valid_ioctls); 437 set_bit(_IOC_NR(cmd), vdev->valid_ioctls);
209} 438}
210 439
211/* helper functions to access driver private data. */ 440/**
441 * video_get_drvdata - gets private data from &struct video_device.
442 *
443 * @vdev: pointer to &struct video_device
444 *
445 * returns a pointer to the private data
446 */
212static inline void *video_get_drvdata(struct video_device *vdev) 447static inline void *video_get_drvdata(struct video_device *vdev)
213{ 448{
214 return dev_get_drvdata(&vdev->dev); 449 return dev_get_drvdata(&vdev->dev);
215} 450}
216 451
452/**
453 * video_set_drvdata - sets private data from &struct video_device.
454 *
455 * @vdev: pointer to &struct video_device
456 * @data: private data pointer
457 */
217static inline void video_set_drvdata(struct video_device *vdev, void *data) 458static inline void video_set_drvdata(struct video_device *vdev, void *data)
218{ 459{
219 dev_set_drvdata(&vdev->dev, data); 460 dev_set_drvdata(&vdev->dev, data);
220} 461}
221 462
463/**
464 * video_devdata - gets &struct video_device from struct file.
465 *
466 * @file: pointer to struct file
467 */
222struct video_device *video_devdata(struct file *file); 468struct video_device *video_devdata(struct file *file);
223 469
224/* Combine video_get_drvdata and video_devdata as this is 470/**
225 used very often. */ 471 * video_drvdata - gets private data from &struct video_device using the
472 * struct file.
473 *
474 * @file: pointer to struct file
475 *
476 * This is function combines both video_get_drvdata() and video_devdata()
477 * as this is used very often.
478 */
226static inline void *video_drvdata(struct file *file) 479static inline void *video_drvdata(struct file *file)
227{ 480{
228 return video_get_drvdata(video_devdata(file)); 481 return video_get_drvdata(video_devdata(file));
229} 482}
230 483
484/**
485 * video_device_node_name - returns the video device name
486 *
487 * @vdev: pointer to &struct video_device
488 *
489 * Returns the device name string
490 */
231static inline const char *video_device_node_name(struct video_device *vdev) 491static inline const char *video_device_node_name(struct video_device *vdev)
232{ 492{
233 return dev_name(&vdev->dev); 493 return dev_name(&vdev->dev);
234} 494}
235 495
496/**
497 * video_is_registered - returns true if the &struct video_device is registered.
498 *
499 *
500 * @vdev: pointer to &struct video_device
501 */
236static inline int video_is_registered(struct video_device *vdev) 502static inline int video_is_registered(struct video_device *vdev)
237{ 503{
238 return test_bit(V4L2_FL_REGISTERED, &vdev->flags); 504 return test_bit(V4L2_FL_REGISTERED, &vdev->flags);
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index d5d45a8d3998..a9d6aa41790e 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -25,100 +25,188 @@
25#include <media/v4l2-subdev.h> 25#include <media/v4l2-subdev.h>
26#include <media/v4l2-dev.h> 26#include <media/v4l2-dev.h>
27 27
28/* Each instance of a V4L2 device should create the v4l2_device struct,
29 either stand-alone or embedded in a larger struct.
30
31 It allows easy access to sub-devices (see v4l2-subdev.h) and provides
32 basic V4L2 device-level support.
33 */
34
35#define V4L2_DEVICE_NAME_SIZE (20 + 16) 28#define V4L2_DEVICE_NAME_SIZE (20 + 16)
36 29
37struct v4l2_ctrl_handler; 30struct v4l2_ctrl_handler;
38 31
32/**
33 * struct v4l2_device - main struct to for V4L2 device drivers
34 *
35 * @dev: pointer to struct device.
36 * @mdev: pointer to struct media_device
37 * @subdevs: used to keep track of the registered subdevs
38 * @lock: lock this struct; can be used by the driver as well
39 * if this struct is embedded into a larger struct.
40 * @name: unique device name, by default the driver name + bus ID
41 * @notify: notify callback called by some sub-devices.
42 * @ctrl_handler: The control handler. May be NULL.
43 * @prio: Device's priority state
44 * @ref: Keep track of the references to this struct.
45 * @release: Release function that is called when the ref count
46 * goes to 0.
47 *
48 * Each instance of a V4L2 device should create the v4l2_device struct,
49 * either stand-alone or embedded in a larger struct.
50 *
51 * It allows easy access to sub-devices (see v4l2-subdev.h) and provides
52 * basic V4L2 device-level support.
53 *
54 * .. note::
55 *
56 * #) dev->driver_data points to this struct.
57 * #) dev might be NULL if there is no parent device
58 */
59
39struct v4l2_device { 60struct v4l2_device {
40 /* dev->driver_data points to this struct.
41 Note: dev might be NULL if there is no parent device
42 as is the case with e.g. ISA devices. */
43 struct device *dev; 61 struct device *dev;
44#if defined(CONFIG_MEDIA_CONTROLLER) 62#if defined(CONFIG_MEDIA_CONTROLLER)
45 struct media_device *mdev; 63 struct media_device *mdev;
46#endif 64#endif
47 /* used to keep track of the registered subdevs */
48 struct list_head subdevs; 65 struct list_head subdevs;
49 /* lock this struct; can be used by the driver as well if this
50 struct is embedded into a larger struct. */
51 spinlock_t lock; 66 spinlock_t lock;
52 /* unique device name, by default the driver name + bus ID */
53 char name[V4L2_DEVICE_NAME_SIZE]; 67 char name[V4L2_DEVICE_NAME_SIZE];
54 /* notify callback called by some sub-devices. */
55 void (*notify)(struct v4l2_subdev *sd, 68 void (*notify)(struct v4l2_subdev *sd,
56 unsigned int notification, void *arg); 69 unsigned int notification, void *arg);
57 /* The control handler. May be NULL. */
58 struct v4l2_ctrl_handler *ctrl_handler; 70 struct v4l2_ctrl_handler *ctrl_handler;
59 /* Device's priority state */
60 struct v4l2_prio_state prio; 71 struct v4l2_prio_state prio;
61 /* Keep track of the references to this struct. */
62 struct kref ref; 72 struct kref ref;
63 /* Release function that is called when the ref count goes to 0. */
64 void (*release)(struct v4l2_device *v4l2_dev); 73 void (*release)(struct v4l2_device *v4l2_dev);
65}; 74};
66 75
76/**
77 * v4l2_device_get - gets a V4L2 device reference
78 *
79 * @v4l2_dev: pointer to struct v4l2_device
80 *
81 * This is an ancillary routine meant to increment the usage for the
82 * struct v4l2_device pointed by @v4l2_dev.
83 */
67static inline void v4l2_device_get(struct v4l2_device *v4l2_dev) 84static inline void v4l2_device_get(struct v4l2_device *v4l2_dev)
68{ 85{
69 kref_get(&v4l2_dev->ref); 86 kref_get(&v4l2_dev->ref);
70} 87}
71 88
89/**
90 * v4l2_device_put - putss a V4L2 device reference
91 *
92 * @v4l2_dev: pointer to struct v4l2_device
93 *
94 * This is an ancillary routine meant to decrement the usage for the
95 * struct v4l2_device pointed by @v4l2_dev.
96 */
72int v4l2_device_put(struct v4l2_device *v4l2_dev); 97int v4l2_device_put(struct v4l2_device *v4l2_dev);
73 98
74/* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. 99/**
75 dev may be NULL in rare cases (ISA devices). In that case you 100 * v4l2_device_register -Initialize v4l2_dev and make dev->driver_data
76 must fill in the v4l2_dev->name field before calling this function. */ 101 * point to v4l2_dev.
77int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); 102 *
78 103 * @dev: pointer to struct device
79/* Optional function to initialize the name field of struct v4l2_device using 104 * @v4l2_dev: pointer to struct v4l2_device
80 the driver name and a driver-global atomic_t instance. 105 *
81 This function will increment the instance counter and returns the instance 106 * .. note::
82 value used in the name. 107 * dev may be NULL in rare cases (ISA devices).
83 108 * In such case the caller must fill in the v4l2_dev->name field
84 Example: 109 * before calling this function.
85 110 */
86 static atomic_t drv_instance = ATOMIC_INIT(0); 111int __must_check v4l2_device_register(struct device *dev,
87 112 struct v4l2_device *v4l2_dev);
88 ... 113
89 114/**
90 instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance); 115 * v4l2_device_set_name - Optional function to initialize the
91 116 * name field of struct v4l2_device
92 The first time this is called the name field will be set to foo0 and 117 *
93 this function returns 0. If the name ends with a digit (e.g. cx18), 118 * @v4l2_dev: pointer to struct v4l2_device
94 then the name will be set to cx18-0 since cx180 looks really odd. */ 119 * @basename: base name for the device name
120 * @instance: pointer to a static atomic_t var with the instance usage for
121 * the device driver.
122 *
123 * v4l2_device_set_name() initializes the name field of struct v4l2_device
124 * using the driver name and a driver-global atomic_t instance.
125 *
126 * This function will increment the instance counter and returns the
127 * instance value used in the name.
128 *
129 * Example:
130 *
131 * static atomic_t drv_instance = ATOMIC_INIT(0);
132 *
133 * ...
134 *
135 * instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance);
136 *
137 * The first time this is called the name field will be set to foo0 and
138 * this function returns 0. If the name ends with a digit (e.g. cx18),
139 * then the name will be set to cx18-0 since cx180 would look really odd.
140 */
95int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename, 141int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
96 atomic_t *instance); 142 atomic_t *instance);
97 143
98/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects. 144/**
99 Since the parent disappears this ensures that v4l2_dev doesn't have an 145 * v4l2_device_disconnect - Change V4L2 device state to disconnected.
100 invalid parent pointer. */ 146 *
147 * @v4l2_dev: pointer to struct v4l2_device
148 *
149 * Should be called when the USB parent disconnects.
150 * Since the parent disappears, this ensures that v4l2_dev doesn't have
151 * an invalid parent pointer.
152 *
153 * .. note:: This function sets v4l2_dev->dev to NULL.
154 */
101void v4l2_device_disconnect(struct v4l2_device *v4l2_dev); 155void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
102 156
103/* Unregister all sub-devices and any other resources related to v4l2_dev. */ 157/**
158 * v4l2_device_unregister - Unregister all sub-devices and any other
159 * resources related to v4l2_dev.
160 *
161 * @v4l2_dev: pointer to struct v4l2_device
162 */
104void v4l2_device_unregister(struct v4l2_device *v4l2_dev); 163void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
105 164
106/* Register a subdev with a v4l2 device. While registered the subdev module 165/**
107 is marked as in-use. An error is returned if the module is no longer 166 * v4l2_device_register_subdev - Registers a subdev with a v4l2 device.
108 loaded when you attempt to register it. */ 167 *
168 * @v4l2_dev: pointer to struct v4l2_device
169 * @sd: pointer to struct v4l2_subdev
170 *
171 * While registered, the subdev module is marked as in-use.
172 *
173 * An error is returned if the module is no longer loaded on any attempts
174 * to register it.
175 */
109int __must_check v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, 176int __must_check v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
110 struct v4l2_subdev *sd); 177 struct v4l2_subdev *sd);
111/* Unregister a subdev with a v4l2 device. Can also be called if the subdev 178
112 wasn't registered. In that case it will do nothing. */ 179/**
180 * v4l2_device_unregister_subdev - Unregisters a subdev with a v4l2 device.
181 *
182 * @sd: pointer to struct v4l2_subdev
183 *
184 * .. note ::
185 *
186 * Can also be called if the subdev wasn't registered. In such
187 * case, it will do nothing.
188 */
113void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); 189void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
114 190
115/* Register device nodes for all subdev of the v4l2 device that are marked with 191/**
116 * the V4L2_SUBDEV_FL_HAS_DEVNODE flag. 192 * v4l2_device_register_subdev_nodes - Registers device nodes for all subdevs
193 * of the v4l2 device that are marked with
194 * the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
195 *
196 * @v4l2_dev: pointer to struct v4l2_device
117 */ 197 */
118int __must_check 198int __must_check
119v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev); 199v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev);
120 200
121/* Send a notification to v4l2_device. */ 201/**
202 * v4l2_subdev_notify - Sends a notification to v4l2_device.
203 *
204 * @sd: pointer to struct v4l2_subdev
205 * @notification: type of notification. Please notice that the notification
206 * type is driver-specific.
207 * @arg: arguments for the notification. Those are specific to each
208 * notification type.
209 */
122static inline void v4l2_subdev_notify(struct v4l2_subdev *sd, 210static inline void v4l2_subdev_notify(struct v4l2_subdev *sd,
123 unsigned int notification, void *arg) 211 unsigned int notification, void *arg)
124{ 212{
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
index 1113c8874c26..65caadf13eec 100644
--- a/include/media/v4l2-dv-timings.h
+++ b/include/media/v4l2-dv-timings.h
@@ -28,7 +28,7 @@
28 */ 28 */
29extern const struct v4l2_dv_timings v4l2_dv_timings_presets[]; 29extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
30 30
31/** 31/*
32 * v4l2_check_dv_timings_fnc - timings check callback 32 * v4l2_check_dv_timings_fnc - timings check callback
33 * 33 *
34 * @t: the v4l2_dv_timings struct. 34 * @t: the v4l2_dv_timings struct.
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 9792f906423b..ca854203b8b9 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -73,14 +73,15 @@ struct video_device;
73 * @list: List node for the v4l2_fh->available list. 73 * @list: List node for the v4l2_fh->available list.
74 * @sev: Pointer to parent v4l2_subscribed_event. 74 * @sev: Pointer to parent v4l2_subscribed_event.
75 * @event: The event itself. 75 * @event: The event itself.
76 */ 76 */
77struct v4l2_kevent { 77struct v4l2_kevent {
78 struct list_head list; 78 struct list_head list;
79 struct v4l2_subscribed_event *sev; 79 struct v4l2_subscribed_event *sev;
80 struct v4l2_event event; 80 struct v4l2_event event;
81}; 81};
82 82
83/** struct v4l2_subscribed_event_ops - Subscribed event operations. 83/**
84 * struct v4l2_subscribed_event_ops - Subscribed event operations.
84 * 85 *
85 * @add: Optional callback, called when a new listener is added 86 * @add: Optional callback, called when a new listener is added
86 * @del: Optional callback, called when a listener stops listening 87 * @del: Optional callback, called when a listener stops listening
@@ -88,20 +89,23 @@ struct v4l2_kevent {
88 * @merge: Optional callback that can merge event 'old' into event 'new'. 89 * @merge: Optional callback that can merge event 'old' into event 'new'.
89 */ 90 */
90struct v4l2_subscribed_event_ops { 91struct v4l2_subscribed_event_ops {
91 int (*add)(struct v4l2_subscribed_event *sev, unsigned elems); 92 int (*add)(struct v4l2_subscribed_event *sev, unsigned int elems);
92 void (*del)(struct v4l2_subscribed_event *sev); 93 void (*del)(struct v4l2_subscribed_event *sev);
93 void (*replace)(struct v4l2_event *old, const struct v4l2_event *new); 94 void (*replace)(struct v4l2_event *old, const struct v4l2_event *new);
94 void (*merge)(const struct v4l2_event *old, struct v4l2_event *new); 95 void (*merge)(const struct v4l2_event *old, struct v4l2_event *new);
95}; 96};
96 97
97/** 98/**
98 * struct v4l2_subscribed_event - Internal struct representing a subscribed event. 99 * struct v4l2_subscribed_event - Internal struct representing a subscribed
100 * event.
101 *
99 * @list: List node for the v4l2_fh->subscribed list. 102 * @list: List node for the v4l2_fh->subscribed list.
100 * @type: Event type. 103 * @type: Event type.
101 * @id: Associated object ID (e.g. control ID). 0 if there isn't any. 104 * @id: Associated object ID (e.g. control ID). 0 if there isn't any.
102 * @flags: Copy of v4l2_event_subscription->flags. 105 * @flags: Copy of v4l2_event_subscription->flags.
103 * @fh: Filehandle that subscribed to this event. 106 * @fh: Filehandle that subscribed to this event.
104 * @node: List node that hooks into the object's event list (if there is one). 107 * @node: List node that hooks into the object's event list
108 * (if there is one).
105 * @ops: v4l2_subscribed_event_ops 109 * @ops: v4l2_subscribed_event_ops
106 * @elems: The number of elements in the events array. 110 * @elems: The number of elements in the events array.
107 * @first: The index of the events containing the oldest available event. 111 * @first: The index of the events containing the oldest available event.
@@ -116,27 +120,124 @@ struct v4l2_subscribed_event {
116 struct v4l2_fh *fh; 120 struct v4l2_fh *fh;
117 struct list_head node; 121 struct list_head node;
118 const struct v4l2_subscribed_event_ops *ops; 122 const struct v4l2_subscribed_event_ops *ops;
119 unsigned elems; 123 unsigned int elems;
120 unsigned first; 124 unsigned int first;
121 unsigned in_use; 125 unsigned int in_use;
122 struct v4l2_kevent events[]; 126 struct v4l2_kevent events[];
123}; 127};
124 128
129/**
130 * v4l2_event_dequeue - Dequeue events from video device.
131 *
132 * @fh: pointer to struct v4l2_fh
133 * @event: pointer to struct v4l2_event
134 * @nonblocking: if not zero, waits for an event to arrive
135 */
125int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, 136int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event,
126 int nonblocking); 137 int nonblocking);
138
139/**
140 * v4l2_event_queue - Queue events to video device.
141 *
142 * @vdev: pointer to &struct video_device
143 * @ev: pointer to &struct v4l2_event
144 *
145 * The event will be queued for all &struct v4l2_fh file handlers.
146 *
147 * .. note::
148 * The driver's only responsibility is to fill in the type and the data
149 * fields.The other fields will be filled in by V4L2.
150 */
127void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); 151void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev);
152
153/**
154 * v4l2_event_queue_fh - Queue events to video device.
155 *
156 * @fh: pointer to &struct v4l2_fh
157 * @ev: pointer to &struct v4l2_event
158 *
159 *
160 * The event will be queued only for the specified &struct v4l2_fh file handler.
161 *
162 * .. note::
163 * The driver's only responsibility is to fill in the type and the data
164 * fields.The other fields will be filled in by V4L2.
165 */
128void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); 166void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev);
167
168/**
169 * v4l2_event_pending - Check if an event is available
170 *
171 * @fh: pointer to &struct v4l2_fh
172 *
173 * Returns the number of pending events.
174 */
129int v4l2_event_pending(struct v4l2_fh *fh); 175int v4l2_event_pending(struct v4l2_fh *fh);
176
177/**
178 * v4l2_event_subscribe - Subscribes to an event
179 *
180 * @fh: pointer to &struct v4l2_fh
181 * @sub: pointer to &struct v4l2_event_subscription
182 * @elems: size of the events queue
183 * @ops: pointer to &v4l2_subscribed_event_ops
184 *
185 * .. note::
186 *
187 * if @elems is zero, the framework will fill in a default value,
188 * with is currently 1 element.
189 */
130int v4l2_event_subscribe(struct v4l2_fh *fh, 190int v4l2_event_subscribe(struct v4l2_fh *fh,
131 const struct v4l2_event_subscription *sub, unsigned elems, 191 const struct v4l2_event_subscription *sub,
192 unsigned int elems,
132 const struct v4l2_subscribed_event_ops *ops); 193 const struct v4l2_subscribed_event_ops *ops);
194/**
195 * v4l2_event_unsubscribe - Unsubscribes to an event
196 *
197 * @fh: pointer to &struct v4l2_fh
198 * @sub: pointer to &struct v4l2_event_subscription
199 */
133int v4l2_event_unsubscribe(struct v4l2_fh *fh, 200int v4l2_event_unsubscribe(struct v4l2_fh *fh,
134 const struct v4l2_event_subscription *sub); 201 const struct v4l2_event_subscription *sub);
202/**
203 * v4l2_event_unsubscribe_all - Unsubscribes to all events
204 *
205 * @fh: pointer to &struct v4l2_fh
206 */
135void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); 207void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
136int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh, 208
209/**
210 * v4l2_event_subdev_unsubscribe - Subdev variant of v4l2_event_unsubscribe()
211 *
212 * @sd: pointer to &struct v4l2_subdev
213 * @fh: pointer to &struct v4l2_fh
214 * @sub: pointer to &struct v4l2_event_subscription
215 *
216 * .. note::
217 *
218 * This function should be used for the &struct v4l2_subdev_core_ops
219 * %unsubscribe_event field.
220 */
221int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd,
222 struct v4l2_fh *fh,
137 struct v4l2_event_subscription *sub); 223 struct v4l2_event_subscription *sub);
224/**
225 * v4l2_src_change_event_subscribe -
226 *
227 * @fh: pointer to struct v4l2_fh
228 * @sub: pointer to &struct v4l2_event_subscription
229 */
138int v4l2_src_change_event_subscribe(struct v4l2_fh *fh, 230int v4l2_src_change_event_subscribe(struct v4l2_fh *fh,
139 const struct v4l2_event_subscription *sub); 231 const struct v4l2_event_subscription *sub);
232/**
233 * v4l2_src_change_event_subdev_subscribe - Variant of v4l2_event_subscribe(),
234 * meant to subscribe only events of the type %V4L2_EVENT_SOURCE_CHANGE.
235 *
236 * @sd: pointer to &struct v4l2_subdev
237 * @fh: pointer to &struct v4l2_fh
238 * @sub: pointer to &struct v4l2_event_subscription
239 */
140int v4l2_src_change_event_subdev_subscribe(struct v4l2_subdev *sd, 240int v4l2_src_change_event_subdev_subscribe(struct v4l2_subdev *sd,
141 struct v4l2_fh *fh, struct v4l2_event_subscription *sub); 241 struct v4l2_fh *fh,
242 struct v4l2_event_subscription *sub);
142#endif /* V4L2_EVENT_H */ 243#endif /* V4L2_EVENT_H */
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h
index 803516775162..e19e6246e21c 100644
--- a/include/media/v4l2-fh.h
+++ b/include/media/v4l2-fh.h
@@ -33,6 +33,21 @@
33struct video_device; 33struct video_device;
34struct v4l2_ctrl_handler; 34struct v4l2_ctrl_handler;
35 35
36/**
37 * struct v4l2_fh - Describes a V4L2 file handler
38 *
39 * @list: list of file handlers
40 * @vdev: pointer to &struct video_device
41 * @ctrl_handler: pointer to &struct v4l2_ctrl_handler
42 * @prio: priority of the file handler, as defined by &enum v4l2_priority
43 *
44 * @wait: event' s wait queue
45 * @subscribed: list of subscribed events
46 * @available: list of events waiting to be dequeued
47 * @navailable: number of available events at @available list
48 * @sequence: event sequence number
49 * @m2m_ctx: pointer to &struct v4l2_m2m_ctx
50 */
36struct v4l2_fh { 51struct v4l2_fh {
37 struct list_head list; 52 struct list_head list;
38 struct video_device *vdev; 53 struct video_device *vdev;
@@ -41,8 +56,8 @@ struct v4l2_fh {
41 56
42 /* Events */ 57 /* Events */
43 wait_queue_head_t wait; 58 wait_queue_head_t wait;
44 struct list_head subscribed; /* Subscribed events */ 59 struct list_head subscribed;
45 struct list_head available; /* Dequeueable event */ 60 struct list_head available;
46 unsigned int navailable; 61 unsigned int navailable;
47 u32 sequence; 62 u32 sequence;
48 63
@@ -51,53 +66,102 @@ struct v4l2_fh {
51#endif 66#endif
52}; 67};
53 68
54/* 69/**
55 * Initialise the file handle. Parts of the V4L2 framework using the 70 * v4l2_fh_init - Initialise the file handle.
71 *
72 * @fh: pointer to &struct v4l2_fh
73 * @vdev: pointer to &struct video_device
74 *
75 * Parts of the V4L2 framework using the
56 * file handles should be initialised in this function. Must be called 76 * file handles should be initialised in this function. Must be called
57 * from driver's v4l2_file_operations->open() handler if the driver 77 * from driver's v4l2_file_operations->open\(\) handler if the driver
58 * uses v4l2_fh. 78 * uses &struct v4l2_fh.
59 */ 79 */
60void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); 80void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev);
61/* 81
62 * Add the fh to the list of file handles on a video_device. The file 82/**
63 * handle must be initialised first. 83 * v4l2_fh_add - Add the fh to the list of file handles on a video_device.
84 *
85 * @fh: pointer to &struct v4l2_fh
86 *
87 * .. note::
88 * The @fh file handle must be initialised first.
64 */ 89 */
65void v4l2_fh_add(struct v4l2_fh *fh); 90void v4l2_fh_add(struct v4l2_fh *fh);
66/* 91
67 * Can be used as the open() op of v4l2_file_operations. 92/**
68 * It allocates a v4l2_fh and inits and adds it to the video_device associated 93 * v4l2_fh_open - Ancillary routine that can be used as the open\(\) op
69 * with the file pointer. 94 * of v4l2_file_operations.
95 *
96 * @filp: pointer to struct file
97 *
98 * It allocates a v4l2_fh and inits and adds it to the &struct video_device
99 * associated with the file pointer.
70 */ 100 */
71int v4l2_fh_open(struct file *filp); 101int v4l2_fh_open(struct file *filp);
72/* 102
73 * Remove file handle from the list of file handles. Must be called in 103/**
74 * v4l2_file_operations->release() handler if the driver uses v4l2_fh. 104 * v4l2_fh_del - Remove file handle from the list of file handles.
75 * On error filp->private_data will be NULL, otherwise it will point to 105 *
76 * the v4l2_fh struct. 106 * @fh: pointer to &struct v4l2_fh
107 *
108 * On error filp->private_data will be %NULL, otherwise it will point to
109 * the &struct v4l2_fh.
110 *
111 * .. note::
112 * Must be called in v4l2_file_operations->release\(\) handler if the driver
113 * uses &struct v4l2_fh.
77 */ 114 */
78void v4l2_fh_del(struct v4l2_fh *fh); 115void v4l2_fh_del(struct v4l2_fh *fh);
79/* 116
80 * Release resources related to a file handle. Parts of the V4L2 117/**
81 * framework using the v4l2_fh must release their resources here, too. 118 * v4l2_fh_exit - Release resources related to a file handle.
82 * Must be called in v4l2_file_operations->release() handler if the 119 *
83 * driver uses v4l2_fh. 120 * @fh: pointer to &struct v4l2_fh
121 *
122 * Parts of the V4L2 framework using the v4l2_fh must release their
123 * resources here, too.
124 *
125 * .. note::
126 * Must be called in v4l2_file_operations->release\(\) handler if the
127 * driver uses &struct v4l2_fh.
84 */ 128 */
85void v4l2_fh_exit(struct v4l2_fh *fh); 129void v4l2_fh_exit(struct v4l2_fh *fh);
86/* 130
87 * Can be used as the release() op of v4l2_file_operations. 131/**
132 * v4l2_fh_release - Ancillary routine that can be used as the release\(\) op
133 * of v4l2_file_operations.
134 *
135 * @filp: pointer to struct file
136 *
88 * It deletes and exits the v4l2_fh associated with the file pointer and 137 * It deletes and exits the v4l2_fh associated with the file pointer and
89 * frees it. It will do nothing if filp->private_data (the pointer to the 138 * frees it. It will do nothing if filp->private_data (the pointer to the
90 * v4l2_fh struct) is NULL. This function always returns 0. 139 * v4l2_fh struct) is %NULL.
140 *
141 * This function always returns 0.
91 */ 142 */
92int v4l2_fh_release(struct file *filp); 143int v4l2_fh_release(struct file *filp);
93/* 144
94 * Returns 1 if this filehandle is the only filehandle opened for the 145/**
95 * associated video_device. If fh is NULL, then it returns 0. 146 * v4l2_fh_is_singular - Returns 1 if this filehandle is the only filehandle
147 * opened for the associated video_device.
148 *
149 * @fh: pointer to &struct v4l2_fh
150 *
151 * If @fh is NULL, then it returns 0.
96 */ 152 */
97int v4l2_fh_is_singular(struct v4l2_fh *fh); 153int v4l2_fh_is_singular(struct v4l2_fh *fh);
98/* 154
99 * Helper function with struct file as argument. If filp->private_data is 155/**
100 * NULL, then it will return 0. 156 * v4l2_fh_is_singular_file - Returns 1 if this filehandle is the only
157 * filehandle opened for the associated video_device.
158 *
159 * @filp: pointer to struct file
160 *
161 * This is a helper function variant of v4l2_fh_is_singular() with uses
162 * struct file as argument.
163 *
164 * If filp->private_data is %NULL, then it will return 0.
101 */ 165 */
102static inline int v4l2_fh_is_singular_file(struct file *filp) 166static inline int v4l2_fh_is_singular_file(struct file *filp)
103{ 167{
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 017ffb2220c7..8b1d19bc9b0e 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -17,6 +17,272 @@
17 17
18struct v4l2_fh; 18struct v4l2_fh;
19 19
20/**
21 * struct v4l2_ioctl_ops - describe operations for each V4L2 ioctl
22 *
23 * @vidioc_querycap: pointer to the function that implements
24 * :ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl
25 * @vidioc_enum_fmt_vid_cap: pointer to the function that implements
26 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
27 * for video capture in single plane mode
28 * @vidioc_enum_fmt_vid_overlay: pointer to the function that implements
29 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
30 * for video overlay
31 * @vidioc_enum_fmt_vid_out: pointer to the function that implements
32 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
33 * for video output in single plane mode
34 * @vidioc_enum_fmt_vid_cap_mplane: pointer to the function that implements
35 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
36 * for video capture in multiplane mode
37 * @vidioc_enum_fmt_vid_out_mplane: pointer to the function that implements
38 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
39 * for video output in multiplane mode
40 * @vidioc_enum_fmt_sdr_cap: pointer to the function that implements
41 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
42 * for Software Defined Radio capture
43 * @vidioc_enum_fmt_sdr_out: pointer to the function that implements
44 * :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
45 * for Software Defined Radio output
46 * @vidioc_g_fmt_vid_cap: pointer to the function that implements
47 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
48 * in single plane mode
49 * @vidioc_g_fmt_vid_overlay: pointer to the function that implements
50 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay
51 * @vidioc_g_fmt_vid_out: pointer to the function that implements
52 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
53 * in single plane mode
54 * @vidioc_g_fmt_vid_out_overlay: pointer to the function that implements
55 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
56 * @vidioc_g_fmt_vbi_cap: pointer to the function that implements
57 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
58 * @vidioc_g_fmt_vbi_out: pointer to the function that implements
59 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
60 * @vidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements
61 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
62 * @vidioc_g_fmt_sliced_vbi_out: pointer to the function that implements
63 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
64 * @vidioc_g_fmt_vid_cap_mplane: pointer to the function that implements
65 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video capture
66 * in multiple plane mode
67 * @vidioc_g_fmt_vid_out_mplane: pointer to the function that implements
68 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for video out
69 * in multiplane plane mode
70 * @vidioc_g_fmt_sdr_cap: pointer to the function that implements
71 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
72 * Radio capture
73 * @vidioc_g_fmt_sdr_out: pointer to the function that implements
74 * :ref:`VIDIOC_G_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
75 * Radio output
76 * @vidioc_s_fmt_vid_cap: pointer to the function that implements
77 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
78 * in single plane mode
79 * @vidioc_s_fmt_vid_overlay: pointer to the function that implements
80 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay
81 * @vidioc_s_fmt_vid_out: pointer to the function that implements
82 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
83 * in single plane mode
84 * @vidioc_s_fmt_vid_out_overlay: pointer to the function that implements
85 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video overlay output
86 * @vidioc_s_fmt_vbi_cap: pointer to the function that implements
87 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
88 * @vidioc_s_fmt_vbi_out: pointer to the function that implements
89 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
90 * @vidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements
91 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI capture
92 * @vidioc_s_fmt_sliced_vbi_out: pointer to the function that implements
93 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
94 * @vidioc_s_fmt_vid_cap_mplane: pointer to the function that implements
95 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video capture
96 * in multiple plane mode
97 * @vidioc_s_fmt_vid_out_mplane: pointer to the function that implements
98 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for video out
99 * in multiplane plane mode
100 * @vidioc_s_fmt_sdr_cap: pointer to the function that implements
101 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
102 * Radio capture
103 * @vidioc_s_fmt_sdr_out: pointer to the function that implements
104 * :ref:`VIDIOC_S_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
105 * Radio output
106 * @vidioc_try_fmt_vid_cap: pointer to the function that implements
107 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
108 * in single plane mode
109 * @vidioc_try_fmt_vid_overlay: pointer to the function that implements
110 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
111 * @vidioc_try_fmt_vid_out: pointer to the function that implements
112 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
113 * in single plane mode
114 * @vidioc_try_fmt_vid_out_overlay: pointer to the function that implements
115 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video overlay
116 * output
117 * @vidioc_try_fmt_vbi_cap: pointer to the function that implements
118 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI capture
119 * @vidioc_try_fmt_vbi_out: pointer to the function that implements
120 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for raw VBI output
121 * @vidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements
122 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI
123 * capture
124 * @vidioc_try_fmt_sliced_vbi_out: pointer to the function that implements
125 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for sliced VBI output
126 * @vidioc_try_fmt_vid_cap_mplane: pointer to the function that implements
127 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video capture
128 * in multiple plane mode
129 * @vidioc_try_fmt_vid_out_mplane: pointer to the function that implements
130 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for video out
131 * in multiplane plane mode
132 * @vidioc_try_fmt_sdr_cap: pointer to the function that implements
133 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
134 * Radio capture
135 * @vidioc_try_fmt_sdr_out: pointer to the function that implements
136 * :ref:`VIDIOC_TRY_FMT <vidioc_g_fmt>` ioctl logic for Software Defined
137 * Radio output
138 * @vidioc_reqbufs: pointer to the function that implements
139 * :ref:`VIDIOC_REQBUFS <vidioc_reqbufs>` ioctl
140 * @vidioc_querybuf: pointer to the function that implements
141 * :ref:`VIDIOC_QUERYBUF <vidioc_querybuf>` ioctl
142 * @vidioc_qbuf: pointer to the function that implements
143 * :ref:`VIDIOC_QBUF <vidioc_qbuf>` ioctl
144 * @vidioc_expbuf: pointer to the function that implements
145 * :ref:`VIDIOC_EXPBUF <vidioc_expbuf>` ioctl
146 * @vidioc_dqbuf: pointer to the function that implements
147 * :ref:`VIDIOC_DQBUF <vidioc_qbuf>` ioctl
148 * @vidioc_create_bufs: pointer to the function that implements
149 * :ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl
150 * @vidioc_prepare_buf: pointer to the function that implements
151 * :ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl
152 * @vidioc_overlay: pointer to the function that implements
153 * :ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl
154 * @vidioc_g_fbuf: pointer to the function that implements
155 * :ref:`VIDIOC_G_FBUF <vidioc_g_fbuf>` ioctl
156 * @vidioc_s_fbuf: pointer to the function that implements
157 * :ref:`VIDIOC_S_FBUF <vidioc_g_fbuf>` ioctl
158 * @vidioc_streamon: pointer to the function that implements
159 * :ref:`VIDIOC_STREAMON <vidioc_streamon>` ioctl
160 * @vidioc_streamoff: pointer to the function that implements
161 * :ref:`VIDIOC_STREAMOFF <vidioc_streamon>` ioctl
162 * @vidioc_g_std: pointer to the function that implements
163 * :ref:`VIDIOC_G_STD <vidioc_g_std>` ioctl
164 * @vidioc_s_std: pointer to the function that implements
165 * :ref:`VIDIOC_S_STD <vidioc_g_std>` ioctl
166 * @vidioc_querystd: pointer to the function that implements
167 * :ref:`VIDIOC_QUERYSTD <vidioc_querystd>` ioctl
168 * @vidioc_enum_input: pointer to the function that implements
169 * :ref:`VIDIOC_ENUM_INPUT <vidioc_g_input>` ioctl
170 * @vidioc_g_input: pointer to the function that implements
171 * :ref:`VIDIOC_G_INPUT <vidioc_g_input>` ioctl
172 * @vidioc_s_input: pointer to the function that implements
173 * :ref:`VIDIOC_S_INPUT <vidioc_g_input>` ioctl
174 * @vidioc_enum_output: pointer to the function that implements
175 * :ref:`VIDIOC_ENUM_OUTPUT <vidioc_g_output>` ioctl
176 * @vidioc_g_output: pointer to the function that implements
177 * :ref:`VIDIOC_G_OUTPUT <vidioc_g_output>` ioctl
178 * @vidioc_s_output: pointer to the function that implements
179 * :ref:`VIDIOC_S_OUTPUT <vidioc_g_output>` ioctl
180 * @vidioc_queryctrl: pointer to the function that implements
181 * :ref:`VIDIOC_QUERYCTRL <vidioc_queryctrl>` ioctl
182 * @vidioc_query_ext_ctrl: pointer to the function that implements
183 * :ref:`VIDIOC_QUERY_EXT_CTRL <vidioc_queryctrl>` ioctl
184 * @vidioc_g_ctrl: pointer to the function that implements
185 * :ref:`VIDIOC_G_CTRL <vidioc_g_ctrl>` ioctl
186 * @vidioc_s_ctrl: pointer to the function that implements
187 * :ref:`VIDIOC_S_CTRL <vidioc_g_ctrl>` ioctl
188 * @vidioc_g_ext_ctrls: pointer to the function that implements
189 * :ref:`VIDIOC_G_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
190 * @vidioc_s_ext_ctrls: pointer to the function that implements
191 * :ref:`VIDIOC_S_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
192 * @vidioc_try_ext_ctrls: pointer to the function that implements
193 * :ref:`VIDIOC_TRY_EXT_CTRLS <vidioc_g_ext_ctrls>` ioctl
194 * @vidioc_querymenu: pointer to the function that implements
195 * :ref:`VIDIOC_QUERYMENU <vidioc_queryctrl>` ioctl
196 * @vidioc_enumaudio: pointer to the function that implements
197 * :ref:`VIDIOC_ENUMAUDIO <vidioc_enumaudio>` ioctl
198 * @vidioc_g_audio: pointer to the function that implements
199 * :ref:`VIDIOC_G_AUDIO <vidioc_g_audio>` ioctl
200 * @vidioc_s_audio: pointer to the function that implements
201 * :ref:`VIDIOC_S_AUDIO <vidioc_g_audio>` ioctl
202 * @vidioc_enumaudout: pointer to the function that implements
203 * :ref:`VIDIOC_ENUMAUDOUT <vidioc_enumaudout>` ioctl
204 * @vidioc_g_audout: pointer to the function that implements
205 * :ref:`VIDIOC_G_AUDOUT <vidioc_g_audout>` ioctl
206 * @vidioc_s_audout: pointer to the function that implements
207 * :ref:`VIDIOC_S_AUDOUT <vidioc_g_audout>` ioctl
208 * @vidioc_g_modulator: pointer to the function that implements
209 * :ref:`VIDIOC_G_MODULATOR <vidioc_g_modulator>` ioctl
210 * @vidioc_s_modulator: pointer to the function that implements
211 * :ref:`VIDIOC_S_MODULATOR <vidioc_g_modulator>` ioctl
212 * @vidioc_cropcap: pointer to the function that implements
213 * :ref:`VIDIOC_CROPCAP <vidioc_cropcap>` ioctl
214 * @vidioc_g_crop: pointer to the function that implements
215 * :ref:`VIDIOC_G_CROP <vidioc_g_crop>` ioctl
216 * @vidioc_s_crop: pointer to the function that implements
217 * :ref:`VIDIOC_S_CROP <vidioc_g_crop>` ioctl
218 * @vidioc_g_selection: pointer to the function that implements
219 * :ref:`VIDIOC_G_SELECTION <vidioc_g_selection>` ioctl
220 * @vidioc_s_selection: pointer to the function that implements
221 * :ref:`VIDIOC_S_SELECTION <vidioc_g_selection>` ioctl
222 * @vidioc_g_jpegcomp: pointer to the function that implements
223 * :ref:`VIDIOC_G_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
224 * @vidioc_s_jpegcomp: pointer to the function that implements
225 * :ref:`VIDIOC_S_JPEGCOMP <vidioc_g_jpegcomp>` ioctl
226 * @vidioc_g_enc_index: pointer to the function that implements
227 * :ref:`VIDIOC_G_ENC_INDEX <vidioc_g_enc_index>` ioctl
228 * @vidioc_encoder_cmd: pointer to the function that implements
229 * :ref:`VIDIOC_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
230 * @vidioc_try_encoder_cmd: pointer to the function that implements
231 * :ref:`VIDIOC_TRY_ENCODER_CMD <vidioc_encoder_cmd>` ioctl
232 * @vidioc_decoder_cmd: pointer to the function that implements
233 * :ref:`VIDIOC_DECODER_CMD <vidioc_decoder_cmd>` ioctl
234 * @vidioc_try_decoder_cmd: pointer to the function that implements
235 * :ref:`VIDIOC_TRY_DECODER_CMD <vidioc_decoder_cmd>` ioctl
236 * @vidioc_g_parm: pointer to the function that implements
237 * :ref:`VIDIOC_G_PARM <vidioc_g_parm>` ioctl
238 * @vidioc_s_parm: pointer to the function that implements
239 * :ref:`VIDIOC_S_PARM <vidioc_g_parm>` ioctl
240 * @vidioc_g_tuner: pointer to the function that implements
241 * :ref:`VIDIOC_G_TUNER <vidioc_g_tuner>` ioctl
242 * @vidioc_s_tuner: pointer to the function that implements
243 * :ref:`VIDIOC_S_TUNER <vidioc_g_tuner>` ioctl
244 * @vidioc_g_frequency: pointer to the function that implements
245 * :ref:`VIDIOC_G_FREQUENCY <vidioc_g_frequency>` ioctl
246 * @vidioc_s_frequency: pointer to the function that implements
247 * :ref:`VIDIOC_S_FREQUENCY <vidioc_g_frequency>` ioctl
248 * @vidioc_enum_freq_bands: pointer to the function that implements
249 * :ref:`VIDIOC_ENUM_FREQ_BANDS <vidioc_enum_freq_bands>` ioctl
250 * @vidioc_g_sliced_vbi_cap: pointer to the function that implements
251 * :ref:`VIDIOC_G_SLICED_VBI_CAP <vidioc_g_sliced_vbi_cap>` ioctl
252 * @vidioc_log_status: pointer to the function that implements
253 * :ref:`VIDIOC_LOG_STATUS <vidioc_log_status>` ioctl
254 * @vidioc_s_hw_freq_seek: pointer to the function that implements
255 * :ref:`VIDIOC_S_HW_FREQ_SEEK <vidioc_s_hw_freq_seek>` ioctl
256 * @vidioc_g_register: pointer to the function that implements
257 * :ref:`VIDIOC_DBG_G_REGISTER <vidioc_dbg_g_register>` ioctl
258 * @vidioc_s_register: pointer to the function that implements
259 * :ref:`VIDIOC_DBG_S_REGISTER <vidioc_dbg_g_register>` ioctl
260 * @vidioc_g_chip_info: pointer to the function that implements
261 * :ref:`VIDIOC_DBG_G_CHIP_INFO <vidioc_dbg_g_chip_info>` ioctl
262 * @vidioc_enum_framesizes: pointer to the function that implements
263 * :ref:`VIDIOC_ENUM_FRAMESIZES <vidioc_enum_framesizes>` ioctl
264 * @vidioc_enum_frameintervals: pointer to the function that implements
265 * :ref:`VIDIOC_ENUM_FRAMEINTERVALS <vidioc_enum_frameintervals>` ioctl
266 * @vidioc_s_dv_timings: pointer to the function that implements
267 * :ref:`VIDIOC_S_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
268 * @vidioc_g_dv_timings: pointer to the function that implements
269 * :ref:`VIDIOC_G_DV_TIMINGS <vidioc_g_dv_timings>` ioctl
270 * @vidioc_query_dv_timings: pointer to the function that implements
271 * :ref:`VIDIOC_QUERY_DV_TIMINGS <vidioc_query_dv_timings>` ioctl
272 * @vidioc_enum_dv_timings: pointer to the function that implements
273 * :ref:`VIDIOC_ENUM_DV_TIMINGS <vidioc_enum_dv_timings>` ioctl
274 * @vidioc_dv_timings_cap: pointer to the function that implements
275 * :ref:`VIDIOC_DV_TIMINGS_CAP <vidioc_dv_timings_cap>` ioctl
276 * @vidioc_g_edid: pointer to the function that implements
277 * :ref:`VIDIOC_G_EDID <vidioc_g_edid>` ioctl
278 * @vidioc_s_edid: pointer to the function that implements
279 * :ref:`VIDIOC_S_EDID <vidioc_g_edid>` ioctl
280 * @vidioc_subscribe_event: pointer to the function that implements
281 * :ref:`VIDIOC_SUBSCRIBE_EVENT <vidioc_subscribe_event>` ioctl
282 * @vidioc_unsubscribe_event: pointer to the function that implements
283 * :ref:`VIDIOC_UNSUBSCRIBE_EVENT <vidioc_unsubscribe_event>` ioctl
284 * @vidioc_default: pointed used to allow other ioctls
285 */
20struct v4l2_ioctl_ops { 286struct v4l2_ioctl_ops {
21 /* ioctl callbacks */ 287 /* ioctl callbacks */
22 288
diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h
index 7a8d6037a4bb..28c3f9d9c209 100644
--- a/include/media/v4l2-mc.h
+++ b/include/media/v4l2-mc.h
@@ -114,11 +114,14 @@ struct usb_device;
114 * Add links between the entities commonly found on PC customer's hardware at 114 * Add links between the entities commonly found on PC customer's hardware at
115 * the V4L2 side: camera sensors, audio and video PLL-IF decoders, tuners, 115 * the V4L2 side: camera sensors, audio and video PLL-IF decoders, tuners,
116 * analog TV decoder and I/O entities (video, VBI and Software Defined Radio). 116 * analog TV decoder and I/O entities (video, VBI and Software Defined Radio).
117 * NOTE: webcams are modelled on a very simple way: the sensor is 117 *
118 * connected directly to the I/O entity. All dirty details, like 118 * .. note::
119 * scaler and crop HW are hidden. While such mapping is enough for v4l2 119 *
120 * interface centric PC-consumer's hardware, V4L2 subdev centric camera 120 * Webcams are modelled on a very simple way: the sensor is
121 * hardware should not use this routine, as it will not build the right graph. 121 * connected directly to the I/O entity. All dirty details, like
122 * scaler and crop HW are hidden. While such mapping is enough for v4l2
123 * interface centric PC-consumer's hardware, V4L2 subdev centric camera
124 * hardware should not use this routine, as it will not build the right graph.
122 */ 125 */
123int v4l2_mc_create_media_graph(struct media_device *mdev); 126int v4l2_mc_create_media_graph(struct media_device *mdev);
124 127
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index c672efc4f87b..2a2240c99b30 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1,21 +1,17 @@
1/* 1/*
2 V4L2 sub-device support header. 2 * V4L2 sub-device support header.
3 3 *
4 Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl> 4 * Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
5 5 *
6 This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 * (at your option) any later version.
10 10 *
11 This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 * GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 15 */
20 16
21#ifndef _V4L2_SUBDEV_H 17#ifndef _V4L2_SUBDEV_H
@@ -52,55 +48,64 @@ struct v4l2_subdev_fh;
52struct tuner_setup; 48struct tuner_setup;
53struct v4l2_mbus_frame_desc; 49struct v4l2_mbus_frame_desc;
54 50
55/* decode_vbi_line */ 51/**
52 * struct v4l2_decode_vbi_line - used to decode_vbi_line
53 *
54 * @is_second_field: Set to 0 for the first (odd) field;
55 * set to 1 for the second (even) field.
56 * @p: Pointer to the sliced VBI data from the decoder. On exit, points to
57 * the start of the payload.
58 * @line: Line number of the sliced VBI data (1-23)
59 * @type: VBI service type (V4L2_SLICED_*). 0 if no service found
60 */
56struct v4l2_decode_vbi_line { 61struct v4l2_decode_vbi_line {
57 u32 is_second_field; /* Set to 0 for the first (odd) field, 62 u32 is_second_field;
58 set to 1 for the second (even) field. */ 63 u8 *p;
59 u8 *p; /* Pointer to the sliced VBI data from the decoder. 64 u32 line;
60 On exit points to the start of the payload. */ 65 u32 type;
61 u32 line; /* Line number of the sliced VBI data (1-23) */
62 u32 type; /* VBI service type (V4L2_SLICED_*). 0 if no service found */
63}; 66};
64 67
65/* Sub-devices are devices that are connected somehow to the main bridge 68/*
66 device. These devices are usually audio/video muxers/encoders/decoders or 69 * Sub-devices are devices that are connected somehow to the main bridge
67 sensors and webcam controllers. 70 * device. These devices are usually audio/video muxers/encoders/decoders or
68 71 * sensors and webcam controllers.
69 Usually these devices are controlled through an i2c bus, but other busses 72 *
70 may also be used. 73 * Usually these devices are controlled through an i2c bus, but other busses
71 74 * may also be used.
72 The v4l2_subdev struct provides a way of accessing these devices in a 75 *
73 generic manner. Most operations that these sub-devices support fall in 76 * The v4l2_subdev struct provides a way of accessing these devices in a
74 a few categories: core ops, audio ops, video ops and tuner ops. 77 * generic manner. Most operations that these sub-devices support fall in
75 78 * a few categories: core ops, audio ops, video ops and tuner ops.
76 More categories can be added if needed, although this should remain a 79 *
77 limited set (no more than approx. 8 categories). 80 * More categories can be added if needed, although this should remain a
78 81 * limited set (no more than approx. 8 categories).
79 Each category has its own set of ops that subdev drivers can implement. 82 *
80 83 * Each category has its own set of ops that subdev drivers can implement.
81 A subdev driver can leave the pointer to the category ops NULL if 84 *
82 it does not implement them (e.g. an audio subdev will generally not 85 * A subdev driver can leave the pointer to the category ops NULL if
83 implement the video category ops). The exception is the core category: 86 * it does not implement them (e.g. an audio subdev will generally not
84 this must always be present. 87 * implement the video category ops). The exception is the core category:
85 88 * this must always be present.
86 These ops are all used internally so it is no problem to change, remove 89 *
87 or add ops or move ops from one to another category. Currently these 90 * These ops are all used internally so it is no problem to change, remove
88 ops are based on the original ioctls, but since ops are not limited to 91 * or add ops or move ops from one to another category. Currently these
89 one argument there is room for improvement here once all i2c subdev 92 * ops are based on the original ioctls, but since ops are not limited to
90 drivers are converted to use these ops. 93 * one argument there is room for improvement here once all i2c subdev
94 * drivers are converted to use these ops.
91 */ 95 */
92 96
93/* Core ops: it is highly recommended to implement at least these ops: 97/*
94 98 * Core ops: it is highly recommended to implement at least these ops:
95 log_status 99 *
96 g_register 100 * log_status
97 s_register 101 * g_register
98 102 * s_register
99 This provides basic debugging support. 103 *
100 104 * This provides basic debugging support.
101 The ioctl ops is meant for generic ioctl-like commands. Depending on 105 *
102 the use-case it might be better to use subdev-specific ops (currently 106 * The ioctl ops is meant for generic ioctl-like commands. Depending on
103 not yet implemented) since ops provide proper type-checking. 107 * the use-case it might be better to use subdev-specific ops (currently
108 * not yet implemented) since ops provide proper type-checking.
104 */ 109 */
105 110
106/* Subdevice external IO pin configuration */ 111/* Subdevice external IO pin configuration */
@@ -110,18 +115,32 @@ struct v4l2_decode_vbi_line {
110#define V4L2_SUBDEV_IO_PIN_SET_VALUE (1 << 3) /* Set output value */ 115#define V4L2_SUBDEV_IO_PIN_SET_VALUE (1 << 3) /* Set output value */
111#define V4L2_SUBDEV_IO_PIN_ACTIVE_LOW (1 << 4) /* ACTIVE HIGH assumed */ 116#define V4L2_SUBDEV_IO_PIN_ACTIVE_LOW (1 << 4) /* ACTIVE HIGH assumed */
112 117
118/**
119 * struct v4l2_subdev_io_pin_config - Subdevice external IO pin configuration
120 *
121 * @flags: bitmask with flags for this pin's config:
122 * %V4L2_SUBDEV_IO_PIN_DISABLE - disables a pin config,
123 * %V4L2_SUBDEV_IO_PIN_OUTPUT - if pin is an output,
124 * %V4L2_SUBDEV_IO_PIN_INPUT - if pin is an input,
125 * %V4L2_SUBDEV_IO_PIN_SET_VALUE - to set the output value via @value
126 * and %V4L2_SUBDEV_IO_PIN_ACTIVE_LOW - if active is 0.
127 * @pin: Chip external IO pin to configure
128 * @function: Internal signal pad/function to route to IO pin
129 * @value: Initial value for pin - e.g. GPIO output value
130 * @strength: Pin drive strength
131 */
113struct v4l2_subdev_io_pin_config { 132struct v4l2_subdev_io_pin_config {
114 u32 flags; /* V4L2_SUBDEV_IO_PIN_* flags for this pin's config */ 133 u32 flags;
115 u8 pin; /* Chip external IO pin to configure */ 134 u8 pin;
116 u8 function; /* Internal signal pad/function to route to IO pin */ 135 u8 function;
117 u8 value; /* Initial value for pin - e.g. GPIO output value */ 136 u8 value;
118 u8 strength; /* Pin drive strength */ 137 u8 strength;
119}; 138};
120 139
121/** 140/**
122 * struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs 141 * struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
123 * 142 *
124 * @log_status: callback for VIDIOC_LOG_STATUS ioctl handler code. 143 * @log_status: callback for %VIDIOC_LOG_STATUS ioctl handler code.
125 * 144 *
126 * @s_io_pin_config: configure one or more chip I/O pins for chips that 145 * @s_io_pin_config: configure one or more chip I/O pins for chips that
127 * multiplex different internal signal pads out to IO pins. This function 146 * multiplex different internal signal pads out to IO pins. This function
@@ -149,9 +168,9 @@ struct v4l2_subdev_io_pin_config {
149 * @compat_ioctl32: called when a 32 bits application uses a 64 bits Kernel, 168 * @compat_ioctl32: called when a 32 bits application uses a 64 bits Kernel,
150 * in order to fix data passed from/to userspace. 169 * in order to fix data passed from/to userspace.
151 * 170 *
152 * @g_register: callback for VIDIOC_G_REGISTER ioctl handler code. 171 * @g_register: callback for %VIDIOC_G_REGISTER ioctl handler code.
153 * 172 *
154 * @s_register: callback for VIDIOC_G_REGISTER ioctl handler code. 173 * @s_register: callback for %VIDIOC_G_REGISTER ioctl handler code.
155 * 174 *
156 * @s_power: puts subdevice in power saving mode (on == 0) or normal operation 175 * @s_power: puts subdevice in power saving mode (on == 0) or normal operation
157 * mode (on == 1). 176 * mode (on == 1).
@@ -159,7 +178,7 @@ struct v4l2_subdev_io_pin_config {
159 * @interrupt_service_routine: Called by the bridge chip's interrupt service 178 * @interrupt_service_routine: Called by the bridge chip's interrupt service
160 * handler, when an interrupt status has be raised due to this subdev, 179 * handler, when an interrupt status has be raised due to this subdev,
161 * so that this subdev can handle the details. It may schedule work to be 180 * so that this subdev can handle the details. It may schedule work to be
162 * performed later. It must not sleep. *Called from an IRQ context*. 181 * performed later. It must not sleep. **Called from an IRQ context**.
163 * 182 *
164 * @subscribe_event: used by the drivers to request the control framework that 183 * @subscribe_event: used by the drivers to request the control framework that
165 * for it to be warned when the value of a control changes. 184 * for it to be warned when the value of a control changes.
@@ -198,25 +217,25 @@ struct v4l2_subdev_core_ops {
198/** 217/**
199 * struct s_radio - Callbacks used when v4l device was opened in radio mode. 218 * struct s_radio - Callbacks used when v4l device was opened in radio mode.
200 * 219 *
201 * @s_radio: callback for VIDIOC_S_RADIO ioctl handler code. 220 * @s_radio: callback for %VIDIOC_S_RADIO ioctl handler code.
202 * 221 *
203 * @s_frequency: callback for VIDIOC_S_FREQUENCY ioctl handler code. 222 * @s_frequency: callback for %VIDIOC_S_FREQUENCY ioctl handler code.
204 * 223 *
205 * @g_frequency: callback for VIDIOC_G_FREQUENCY ioctl handler code. 224 * @g_frequency: callback for %VIDIOC_G_FREQUENCY ioctl handler code.
206 * freq->type must be filled in. Normally done by video_ioctl2 225 * freq->type must be filled in. Normally done by video_ioctl2()
207 * or the bridge driver. 226 * or the bridge driver.
208 * 227 *
209 * @enum_freq_bands: callback for VIDIOC_ENUM_FREQ_BANDS ioctl handler code. 228 * @enum_freq_bands: callback for %VIDIOC_ENUM_FREQ_BANDS ioctl handler code.
210 * 229 *
211 * @g_tuner: callback for VIDIOC_G_TUNER ioctl handler code. 230 * @g_tuner: callback for %VIDIOC_G_TUNER ioctl handler code.
212 * 231 *
213 * @s_tuner: callback for VIDIOC_S_TUNER ioctl handler code. vt->type must be 232 * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. &vt->type must be
214 * filled in. Normally done by video_ioctl2 or the 233 * filled in. Normally done by video_ioctl2 or the
215 * bridge driver. 234 * bridge driver.
216 * 235 *
217 * @g_modulator: callback for VIDIOC_G_MODULATOR ioctl handler code. 236 * @g_modulator: callback for %VIDIOC_G_MODULATOR ioctl handler code.
218 * 237 *
219 * @s_modulator: callback for VIDIOC_S_MODULATOR ioctl handler code. 238 * @s_modulator: callback for %VIDIOC_S_MODULATOR ioctl handler code.
220 * 239 *
221 * @s_type_addr: sets tuner type and its I2C addr. 240 * @s_type_addr: sets tuner type and its I2C addr.
222 * 241 *
@@ -247,7 +266,7 @@ struct v4l2_subdev_tuner_ops {
247 * @s_i2s_clock_freq: sets I2S speed in bps. This is used to provide a standard 266 * @s_i2s_clock_freq: sets I2S speed in bps. This is used to provide a standard
248 * way to select I2S clock used by driving digital audio streams at some 267 * way to select I2S clock used by driving digital audio streams at some
249 * board designs. Usual values for the frequency are 1024000 and 2048000. 268 * board designs. Usual values for the frequency are 1024000 and 2048000.
250 * If the frequency is not supported, then -EINVAL is returned. 269 * If the frequency is not supported, then %-EINVAL is returned.
251 * 270 *
252 * @s_routing: used to define the input and/or output pins of an audio chip, 271 * @s_routing: used to define the input and/or output pins of an audio chip,
253 * and any additional configuration data. 272 * and any additional configuration data.
@@ -279,7 +298,8 @@ struct v4l2_subdev_audio_ops {
279/** 298/**
280 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure 299 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
281 * 300 *
282 * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags 301 * @flags: bitmask flags: %V4L2_MBUS_FRAME_DESC_FL_LEN_MAX and
302 * %V4L2_MBUS_FRAME_DESC_FL_BLOB.
283 * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set 303 * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set
284 * @length: number of octets per frame, valid if V4L2_MBUS_FRAME_DESC_FL_BLOB 304 * @length: number of octets per frame, valid if V4L2_MBUS_FRAME_DESC_FL_BLOB
285 * is set 305 * is set
@@ -304,7 +324,7 @@ struct v4l2_mbus_frame_desc {
304 324
305/** 325/**
306 * struct v4l2_subdev_video_ops - Callbacks used when v4l device was opened 326 * struct v4l2_subdev_video_ops - Callbacks used when v4l device was opened
307 * in video mode. 327 * in video mode.
308 * 328 *
309 * @s_routing: see s_routing in audio_ops, except this version is for video 329 * @s_routing: see s_routing in audio_ops, except this version is for video
310 * devices. 330 * devices.
@@ -314,9 +334,9 @@ struct v4l2_mbus_frame_desc {
314 * regarding clock frequency dividers, etc. If not used, then set flags 334 * regarding clock frequency dividers, etc. If not used, then set flags
315 * to 0. If the frequency is not supported, then -EINVAL is returned. 335 * to 0. If the frequency is not supported, then -EINVAL is returned.
316 * 336 *
317 * @g_std: callback for VIDIOC_G_STD ioctl handler code. 337 * @g_std: callback for %VIDIOC_G_STD ioctl handler code.
318 * 338 *
319 * @s_std: callback for VIDIOC_S_STD ioctl handler code. 339 * @s_std: callback for %VIDIOC_S_STD ioctl handler code.
320 * 340 *
321 * @s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 341 * @s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
322 * video input devices. 342 * video input devices.
@@ -324,33 +344,33 @@ struct v4l2_mbus_frame_desc {
324 * @g_std_output: get current standard for video OUTPUT devices. This is ignored 344 * @g_std_output: get current standard for video OUTPUT devices. This is ignored
325 * by video input devices. 345 * by video input devices.
326 * 346 *
327 * @querystd: callback for VIDIOC_QUERYSTD ioctl handler code. 347 * @querystd: callback for %VIDIOC_QUERYSTD ioctl handler code.
328 * 348 *
329 * @g_tvnorms: get v4l2_std_id with all standards supported by the video 349 * @g_tvnorms: get &v4l2_std_id with all standards supported by the video
330 * CAPTURE device. This is ignored by video output devices. 350 * CAPTURE device. This is ignored by video output devices.
331 * 351 *
332 * @g_tvnorms_output: get v4l2_std_id with all standards supported by the video 352 * @g_tvnorms_output: get v4l2_std_id with all standards supported by the video
333 * OUTPUT device. This is ignored by video capture devices. 353 * OUTPUT device. This is ignored by video capture devices.
334 * 354 *
335 * @g_input_status: get input status. Same as the status field in the v4l2_input 355 * @g_input_status: get input status. Same as the status field in the
336 * struct. 356 * &struct &v4l2_input
337 * 357 *
338 * @s_stream: used to notify the driver that a video stream will start or has 358 * @s_stream: used to notify the driver that a video stream will start or has
339 * stopped. 359 * stopped.
340 * 360 *
341 * @cropcap: callback for VIDIOC_CROPCAP ioctl handler code. 361 * @cropcap: callback for %VIDIOC_CROPCAP ioctl handler code.
342 * 362 *
343 * @g_crop: callback for VIDIOC_G_CROP ioctl handler code. 363 * @g_crop: callback for %VIDIOC_G_CROP ioctl handler code.
344 * 364 *
345 * @s_crop: callback for VIDIOC_S_CROP ioctl handler code. 365 * @s_crop: callback for %VIDIOC_S_CROP ioctl handler code.
346 * 366 *
347 * @g_parm: callback for VIDIOC_G_PARM ioctl handler code. 367 * @g_parm: callback for %VIDIOC_G_PARM ioctl handler code.
348 * 368 *
349 * @s_parm: callback for VIDIOC_S_PARM ioctl handler code. 369 * @s_parm: callback for %VIDIOC_S_PARM ioctl handler code.
350 * 370 *
351 * @g_frame_interval: callback for VIDIOC_G_FRAMEINTERVAL ioctl handler code. 371 * @g_frame_interval: callback for %VIDIOC_G_FRAMEINTERVAL ioctl handler code.
352 * 372 *
353 * @s_frame_interval: callback for VIDIOC_S_FRAMEINTERVAL ioctl handler code. 373 * @s_frame_interval: callback for %VIDIOC_S_FRAMEINTERVAL ioctl handler code.
354 * 374 *
355 * @s_dv_timings: Set custom dv timings in the sub device. This is used 375 * @s_dv_timings: Set custom dv timings in the sub device. This is used
356 * when sub device is capable of setting detailed timing information 376 * when sub device is capable of setting detailed timing information
@@ -358,7 +378,7 @@ struct v4l2_mbus_frame_desc {
358 * 378 *
359 * @g_dv_timings: Get custom dv timings in the sub device. 379 * @g_dv_timings: Get custom dv timings in the sub device.
360 * 380 *
361 * @query_dv_timings: callback for VIDIOC_QUERY_DV_TIMINGS ioctl handler code. 381 * @query_dv_timings: callback for %VIDIOC_QUERY_DV_TIMINGS ioctl handler code.
362 * 382 *
363 * @g_mbus_config: get supported mediabus configurations 383 * @g_mbus_config: get supported mediabus configurations
364 * 384 *
@@ -407,31 +427,31 @@ struct v4l2_subdev_video_ops {
407 427
408/** 428/**
409 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened 429 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened
410 * in video mode via the vbi device node. 430 * in video mode via the vbi device node.
411 * 431 *
412 * @decode_vbi_line: video decoders that support sliced VBI need to implement 432 * @decode_vbi_line: video decoders that support sliced VBI need to implement
413 * this ioctl. Field p of the v4l2_sliced_vbi_line struct is set to the 433 * this ioctl. Field p of the &struct v4l2_sliced_vbi_line is set to the
414 * start of the VBI data that was generated by the decoder. The driver 434 * start of the VBI data that was generated by the decoder. The driver
415 * then parses the sliced VBI data and sets the other fields in the 435 * then parses the sliced VBI data and sets the other fields in the
416 * struct accordingly. The pointer p is updated to point to the start of 436 * struct accordingly. The pointer p is updated to point to the start of
417 * the payload which can be copied verbatim into the data field of the 437 * the payload which can be copied verbatim into the data field of the
418 * v4l2_sliced_vbi_data struct. If no valid VBI data was found, then the 438 * &struct v4l2_sliced_vbi_data. If no valid VBI data was found, then the
419 * type field is set to 0 on return. 439 * type field is set to 0 on return.
420 * 440 *
421 * @s_vbi_data: used to generate VBI signals on a video signal. 441 * @s_vbi_data: used to generate VBI signals on a video signal.
422 * v4l2_sliced_vbi_data is filled with the data packets that should be 442 * &struct v4l2_sliced_vbi_data is filled with the data packets that
423 * output. Note that if you set the line field to 0, then that VBI signal 443 * should be output. Note that if you set the line field to 0, then that
424 * is disabled. If no valid VBI data was found, then the type field is 444 * VBI signal is disabled. If no valid VBI data was found, then the type
425 * set to 0 on return. 445 * field is set to 0 on return.
426 * 446 *
427 * @g_vbi_data: used to obtain the sliced VBI packet from a readback register. 447 * @g_vbi_data: used to obtain the sliced VBI packet from a readback register.
428 * Not all video decoders support this. If no data is available because 448 * Not all video decoders support this. If no data is available because
429 * the readback register contains invalid or erroneous data -EIO is 449 * the readback register contains invalid or erroneous data %-EIO is
430 * returned. Note that you must fill in the 'id' member and the 'field' 450 * returned. Note that you must fill in the 'id' member and the 'field'
431 * member (to determine whether CC data from the first or second field 451 * member (to determine whether CC data from the first or second field
432 * should be obtained). 452 * should be obtained).
433 * 453 *
434 * @g_sliced_vbi_cap: callback for VIDIOC_SLICED_VBI_CAP ioctl handler code. 454 * @g_sliced_vbi_cap: callback for %VIDIOC_SLICED_VBI_CAP ioctl handler code.
435 * 455 *
436 * @s_raw_fmt: setup the video encoder/decoder for raw VBI. 456 * @s_raw_fmt: setup the video encoder/decoder for raw VBI.
437 * 457 *
@@ -464,58 +484,99 @@ struct v4l2_subdev_sensor_ops {
464 int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames); 484 int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames);
465}; 485};
466 486
467/* 487/**
468 [rt]x_g_parameters: Get the current operating parameters and state of the 488 * enum v4l2_subdev_ir_mode- describes the type of IR supported
469 the IR receiver or transmitter. 489 *
470 490 * @V4L2_SUBDEV_IR_MODE_PULSE_WIDTH: IR uses struct ir_raw_event records
471 [rt]x_s_parameters: Set the current operating parameters and state of the
472 the IR receiver or transmitter. It is recommended to call
473 [rt]x_g_parameters first to fill out the current state, and only change
474 the fields that need to be changed. Upon return, the actual device
475 operating parameters and state will be returned. Note that hardware
476 limitations may prevent the actual settings from matching the requested
477 settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
478 was requested. An exception is when the shutdown parameter is true.
479 The last used operational parameters will be returned, but the actual
480 state of the hardware be different to minimize power consumption and
481 processing when shutdown is true.
482
483 rx_read: Reads received codes or pulse width data.
484 The semantics are similar to a non-blocking read() call.
485
486 tx_write: Writes codes or pulse width data for transmission.
487 The semantics are similar to a non-blocking write() call.
488 */ 491 */
489
490enum v4l2_subdev_ir_mode { 492enum v4l2_subdev_ir_mode {
491 V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* uses struct ir_raw_event records */ 493 V4L2_SUBDEV_IR_MODE_PULSE_WIDTH,
492}; 494};
493 495
496/**
497 * struct v4l2_subdev_ir_parameters - Parameters for IR TX or TX
498 *
499 * @bytes_per_data_element: bytes per data element of data in read or
500 * write call.
501 * @mode: IR mode as defined by &enum v4l2_subdev_ir_mode.
502 * @enable: device is active if true
503 * @interrupt_enable: IR interrupts are enabled if true
504 * @shutdown: if true: set hardware to low/no power, false: normal mode
505 *
506 * @modulation: if true, it uses carrier, if false: baseband
507 * @max_pulse_width: maximum pulse width in ns, valid only for baseband signal
508 * @carrier_freq: carrier frequency in Hz, valid only for modulated signal
509 * @duty_cycle: duty cycle percentage, valid only for modulated signal
510 * @invert_level: invert signal level
511 *
512 * @invert_carrier_sense: Send 0/space as a carrier burst. used only in TX.
513 *
514 * @noise_filter_min_width: min time of a valid pulse, in ns. Used only for RX.
515 * @carrier_range_lower: Lower carrier range, in Hz, valid only for modulated
516 * signal. Used only for RX.
517 * @carrier_range_upper: Upper carrier range, in Hz, valid only for modulated
518 * signal. Used only for RX.
519 * @resolution: The receive resolution, in ns . Used only for RX.
520 */
494struct v4l2_subdev_ir_parameters { 521struct v4l2_subdev_ir_parameters {
495 /* Either Rx or Tx */ 522 unsigned int bytes_per_data_element;
496 unsigned int bytes_per_data_element; /* of data in read or write call */
497 enum v4l2_subdev_ir_mode mode; 523 enum v4l2_subdev_ir_mode mode;
498 524
499 bool enable; 525 bool enable;
500 bool interrupt_enable; 526 bool interrupt_enable;
501 bool shutdown; /* true: set hardware to low/no power, false: normal */ 527 bool shutdown;
502 528
503 bool modulation; /* true: uses carrier, false: baseband */ 529 bool modulation;
504 u32 max_pulse_width; /* ns, valid only for baseband signal */ 530 u32 max_pulse_width;
505 unsigned int carrier_freq; /* Hz, valid only for modulated signal*/ 531 unsigned int carrier_freq;
506 unsigned int duty_cycle; /* percent, valid only for modulated signal*/ 532 unsigned int duty_cycle;
507 bool invert_level; /* invert signal level */ 533 bool invert_level;
508 534
509 /* Tx only */ 535 /* Tx only */
510 bool invert_carrier_sense; /* Send 0/space as a carrier burst */ 536 bool invert_carrier_sense;
511 537
512 /* Rx only */ 538 /* Rx only */
513 u32 noise_filter_min_width; /* ns, min time of a valid pulse */ 539 u32 noise_filter_min_width;
514 unsigned int carrier_range_lower; /* Hz, valid only for modulated sig */ 540 unsigned int carrier_range_lower;
515 unsigned int carrier_range_upper; /* Hz, valid only for modulated sig */ 541 unsigned int carrier_range_upper;
516 u32 resolution; /* ns */ 542 u32 resolution;
517}; 543};
518 544
545/**
546 * struct v4l2_subdev_ir_ops - operations for IR subdevices
547 *
548 * @rx_read: Reads received codes or pulse width data.
549 * The semantics are similar to a non-blocking read() call.
550 * @rx_g_parameters: Get the current operating parameters and state of the
551 * the IR receiver.
552 * @rx_s_parameters: Set the current operating parameters and state of the
553 * the IR receiver. It is recommended to call
554 * [rt]x_g_parameters first to fill out the current state, and only change
555 * the fields that need to be changed. Upon return, the actual device
556 * operating parameters and state will be returned. Note that hardware
557 * limitations may prevent the actual settings from matching the requested
558 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
559 * was requested. An exception is when the shutdown parameter is true.
560 * The last used operational parameters will be returned, but the actual
561 * state of the hardware be different to minimize power consumption and
562 * processing when shutdown is true.
563 *
564 * @tx_write: Writes codes or pulse width data for transmission.
565 * The semantics are similar to a non-blocking write() call.
566 * @tx_g_parameters: Get the current operating parameters and state of the
567 * the IR transmitter.
568 * @tx_s_parameters: Set the current operating parameters and state of the
569 * the IR transmitter. It is recommended to call
570 * [rt]x_g_parameters first to fill out the current state, and only change
571 * the fields that need to be changed. Upon return, the actual device
572 * operating parameters and state will be returned. Note that hardware
573 * limitations may prevent the actual settings from matching the requested
574 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
575 * was requested. An exception is when the shutdown parameter is true.
576 * The last used operational parameters will be returned, but the actual
577 * state of the hardware be different to minimize power consumption and
578 * processing when shutdown is true.
579 */
519struct v4l2_subdev_ir_ops { 580struct v4l2_subdev_ir_ops {
520 /* Receiver */ 581 /* Receiver */
521 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count, 582 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
@@ -536,11 +597,16 @@ struct v4l2_subdev_ir_ops {
536 struct v4l2_subdev_ir_parameters *params); 597 struct v4l2_subdev_ir_parameters *params);
537}; 598};
538 599
539/* 600/**
540 * Used for storing subdev pad information. This structure only needs 601 * struct v4l2_subdev_pad_config - Used for storing subdev pad information.
541 * to be passed to the pad op if the 'which' field of the main argument 602 *
542 * is set to V4L2_SUBDEV_FORMAT_TRY. For V4L2_SUBDEV_FORMAT_ACTIVE it is 603 * @try_fmt: pointer to &struct v4l2_mbus_framefmt
543 * safe to pass NULL. 604 * @try_crop: pointer to &struct v4l2_rect to be used for crop
605 * @try_compose: pointer to &struct v4l2_rect to be used for compose
606 *
607 * This structure only needs to be passed to the pad op if the 'which' field
608 * of the main argument is set to %V4L2_SUBDEV_FORMAT_TRY. For
609 * %V4L2_SUBDEV_FORMAT_ACTIVE it is safe to pass %NULL.
544 */ 610 */
545struct v4l2_subdev_pad_config { 611struct v4l2_subdev_pad_config {
546 struct v4l2_mbus_framefmt try_fmt; 612 struct v4l2_mbus_framefmt try_fmt;
@@ -552,30 +618,30 @@ struct v4l2_subdev_pad_config {
552 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations 618 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
553 * 619 *
554 * @init_cfg: initialize the pad config to default values 620 * @init_cfg: initialize the pad config to default values
555 * @enum_mbus_code: callback for VIDIOC_SUBDEV_ENUM_MBUS_CODE ioctl handler 621 * @enum_mbus_code: callback for %VIDIOC_SUBDEV_ENUM_MBUS_CODE ioctl handler
556 * code. 622 * code.
557 * @enum_frame_size: callback for VIDIOC_SUBDEV_ENUM_FRAME_SIZE ioctl handler 623 * @enum_frame_size: callback for %VIDIOC_SUBDEV_ENUM_FRAME_SIZE ioctl handler
558 * code. 624 * code.
559 * 625 *
560 * @enum_frame_interval: callback for VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL ioctl 626 * @enum_frame_interval: callback for %VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL ioctl
561 * handler code. 627 * handler code.
562 * 628 *
563 * @get_fmt: callback for VIDIOC_SUBDEV_G_FMT ioctl handler code. 629 * @get_fmt: callback for %VIDIOC_SUBDEV_G_FMT ioctl handler code.
564 * 630 *
565 * @set_fmt: callback for VIDIOC_SUBDEV_S_FMT ioctl handler code. 631 * @set_fmt: callback for %VIDIOC_SUBDEV_S_FMT ioctl handler code.
566 * 632 *
567 * @get_selection: callback for VIDIOC_SUBDEV_G_SELECTION ioctl handler code. 633 * @get_selection: callback for %VIDIOC_SUBDEV_G_SELECTION ioctl handler code.
568 * 634 *
569 * @set_selection: callback for VIDIOC_SUBDEV_S_SELECTION ioctl handler code. 635 * @set_selection: callback for %VIDIOC_SUBDEV_S_SELECTION ioctl handler code.
570 * 636 *
571 * @get_edid: callback for VIDIOC_SUBDEV_G_EDID ioctl handler code. 637 * @get_edid: callback for %VIDIOC_SUBDEV_G_EDID ioctl handler code.
572 * 638 *
573 * @set_edid: callback for VIDIOC_SUBDEV_S_EDID ioctl handler code. 639 * @set_edid: callback for %VIDIOC_SUBDEV_S_EDID ioctl handler code.
574 * 640 *
575 * @dv_timings_cap: callback for VIDIOC_SUBDEV_DV_TIMINGS_CAP ioctl handler 641 * @dv_timings_cap: callback for %VIDIOC_SUBDEV_DV_TIMINGS_CAP ioctl handler
576 * code. 642 * code.
577 * 643 *
578 * @enum_dv_timings: callback for VIDIOC_SUBDEV_ENUM_DV_TIMINGS ioctl handler 644 * @enum_dv_timings: callback for %VIDIOC_SUBDEV_ENUM_DV_TIMINGS ioctl handler
579 * code. 645 * code.
580 * 646 *
581 * @link_validate: used by the media controller code to check if the links 647 * @link_validate: used by the media controller code to check if the links
@@ -627,6 +693,18 @@ struct v4l2_subdev_pad_ops {
627 struct v4l2_mbus_frame_desc *fd); 693 struct v4l2_mbus_frame_desc *fd);
628}; 694};
629 695
696/**
697 * struct v4l2_subdev_ops - Subdev operations
698 *
699 * @core: pointer to &struct v4l2_subdev_core_ops. Can be %NULL
700 * @tuner: pointer to &struct v4l2_subdev_tuner_ops. Can be %NULL
701 * @audio: pointer to &struct v4l2_subdev_audio_ops. Can be %NULL
702 * @video: pointer to &struct v4l2_subdev_video_ops. Can be %NULL
703 * @vbi: pointer to &struct v4l2_subdev_vbi_ops. Can be %NULL
704 * @ir: pointer to &struct v4l2_subdev_ir_ops. Can be %NULL
705 * @sensor: pointer to &struct v4l2_subdev_sensor_ops. Can be %NULL
706 * @pad: pointer to &struct v4l2_subdev_pad_ops. Can be %NULL
707 */
630struct v4l2_subdev_ops { 708struct v4l2_subdev_ops {
631 const struct v4l2_subdev_core_ops *core; 709 const struct v4l2_subdev_core_ops *core;
632 const struct v4l2_subdev_tuner_ops *tuner; 710 const struct v4l2_subdev_tuner_ops *tuner;
@@ -638,19 +716,22 @@ struct v4l2_subdev_ops {
638 const struct v4l2_subdev_pad_ops *pad; 716 const struct v4l2_subdev_pad_ops *pad;
639}; 717};
640 718
641/* 719/**
642 * Internal ops. Never call this from drivers, only the v4l2 framework can call 720 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops
643 * these ops.
644 * 721 *
645 * registered: called when this subdev is registered. When called the v4l2_dev 722 * @registered: called when this subdev is registered. When called the v4l2_dev
646 * field is set to the correct v4l2_device. 723 * field is set to the correct v4l2_device.
647 * 724 *
648 * unregistered: called when this subdev is unregistered. When called the 725 * @unregistered: called when this subdev is unregistered. When called the
649 * v4l2_dev field is still set to the correct v4l2_device. 726 * v4l2_dev field is still set to the correct v4l2_device.
650 * 727 *
651 * open: called when the subdev device node is opened by an application. 728 * @open: called when the subdev device node is opened by an application.
652 * 729 *
653 * close: called when the subdev device node is closed. 730 * @close: called when the subdev device node is closed.
731 *
732 * .. note::
733 * Never call this from drivers, only the v4l2 framework can call
734 * these ops.
654 */ 735 */
655struct v4l2_subdev_internal_ops { 736struct v4l2_subdev_internal_ops {
656 int (*registered)(struct v4l2_subdev *sd); 737 int (*registered)(struct v4l2_subdev *sd);
@@ -672,17 +753,60 @@ struct v4l2_subdev_internal_ops {
672 753
673struct regulator_bulk_data; 754struct regulator_bulk_data;
674 755
756/**
757 * struct v4l2_subdev_platform_data - regulators config struct
758 *
759 * @regulators: Optional regulators used to power on/off the subdevice
760 * @num_regulators: Number of regululators
761 * @host_priv: Per-subdevice data, specific for a certain video host device
762 */
675struct v4l2_subdev_platform_data { 763struct v4l2_subdev_platform_data {
676 /* Optional regulators uset to power on/off the subdevice */
677 struct regulator_bulk_data *regulators; 764 struct regulator_bulk_data *regulators;
678 int num_regulators; 765 int num_regulators;
679 766
680 /* Per-subdevice data, specific for a certain video host device */
681 void *host_priv; 767 void *host_priv;
682}; 768};
683 769
684/* Each instance of a subdev driver should create this struct, either 770/**
685 stand-alone or embedded in a larger struct. 771 * struct v4l2_subdev - describes a V4L2 sub-device
772 *
773 * @entity: pointer to &struct media_entity
774 * @list: List of sub-devices
775 * @owner: The owner is the same as the driver's &struct device owner.
776 * @owner_v4l2_dev: true if the &sd->owner matches the owner of &v4l2_dev->dev
777 * ownner. Initialized by v4l2_device_register_subdev().
778 * @flags: subdev flags. Can be:
779 * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device;
780 * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device;
781 * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a
782 * device node;
783 * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates
784 * events.
785 *
786 * @v4l2_dev: pointer to &struct v4l2_device
787 * @ops: pointer to &struct v4l2_subdev_ops
788 * @internal_ops: pointer to &struct v4l2_subdev_internal_ops.
789 * Never call these internal ops from within a driver!
790 * @ctrl_handler: The control handler of this subdev. May be NULL.
791 * @name: Name of the sub-device. Please notice that the name must be unique.
792 * @grp_id: can be used to group similar subdevs. Value is driver-specific
793 * @dev_priv: pointer to private data
794 * @host_priv: pointer to private data used by the device where the subdev
795 * is attached.
796 * @devnode: subdev device node
797 * @dev: pointer to the physical device, if any
798 * @of_node: The device_node of the subdev, usually the same as dev->of_node.
799 * @async_list: Links this subdev to a global subdev_list or @notifier->done
800 * list.
801 * @asd: Pointer to respective &struct v4l2_async_subdev.
802 * @notifier: Pointer to the managing notifier.
803 * @pdata: common part of subdevice platform data
804 *
805 * Each instance of a subdev driver should create this struct, either
806 * stand-alone or embedded in a larger struct.
807 *
808 * This structure should be initialized by v4l2_subdev_init() or one of
809 * its variants: v4l2_spi_subdev_init(), v4l2_i2c_subdev_init().
686 */ 810 */
687struct v4l2_subdev { 811struct v4l2_subdev {
688#if defined(CONFIG_MEDIA_CONTROLLER) 812#if defined(CONFIG_MEDIA_CONTROLLER)
@@ -694,30 +818,18 @@ struct v4l2_subdev {
694 u32 flags; 818 u32 flags;
695 struct v4l2_device *v4l2_dev; 819 struct v4l2_device *v4l2_dev;
696 const struct v4l2_subdev_ops *ops; 820 const struct v4l2_subdev_ops *ops;
697 /* Never call these internal ops from within a driver! */
698 const struct v4l2_subdev_internal_ops *internal_ops; 821 const struct v4l2_subdev_internal_ops *internal_ops;
699 /* The control handler of this subdev. May be NULL. */
700 struct v4l2_ctrl_handler *ctrl_handler; 822 struct v4l2_ctrl_handler *ctrl_handler;
701 /* name must be unique */
702 char name[V4L2_SUBDEV_NAME_SIZE]; 823 char name[V4L2_SUBDEV_NAME_SIZE];
703 /* can be used to group similar subdevs, value is driver-specific */
704 u32 grp_id; 824 u32 grp_id;
705 /* pointer to private data */
706 void *dev_priv; 825 void *dev_priv;
707 void *host_priv; 826 void *host_priv;
708 /* subdev device node */
709 struct video_device *devnode; 827 struct video_device *devnode;
710 /* pointer to the physical device, if any */
711 struct device *dev; 828 struct device *dev;
712 /* The device_node of the subdev, usually the same as dev->of_node. */
713 struct device_node *of_node; 829 struct device_node *of_node;
714 /* Links this subdev to a global subdev_list or @notifier->done list. */
715 struct list_head async_list; 830 struct list_head async_list;
716 /* Pointer to respective struct v4l2_async_subdev. */
717 struct v4l2_async_subdev *asd; 831 struct v4l2_async_subdev *asd;
718 /* Pointer to the managing notifier. */
719 struct v4l2_async_notifier *notifier; 832 struct v4l2_async_notifier *notifier;
720 /* common part of subdevice platform data */
721 struct v4l2_subdev_platform_data *pdata; 833 struct v4l2_subdev_platform_data *pdata;
722}; 834};
723 835
@@ -726,8 +838,11 @@ struct v4l2_subdev {
726#define vdev_to_v4l2_subdev(vdev) \ 838#define vdev_to_v4l2_subdev(vdev) \
727 ((struct v4l2_subdev *)video_get_drvdata(vdev)) 839 ((struct v4l2_subdev *)video_get_drvdata(vdev))
728 840
729/* 841/**
730 * Used for storing subdev information per file handle 842 * struct v4l2_subdev_fh - Used for storing subdev information per file handle
843 *
844 * @vfh: pointer to struct v4l2_fh
845 * @pad: pointer to v4l2_subdev_pad_config
731 */ 846 */
732struct v4l2_subdev_fh { 847struct v4l2_subdev_fh {
733 struct v4l2_fh vfh; 848 struct v4l2_fh vfh;
@@ -757,53 +872,132 @@ __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, v4l2_subdev_get_try_compose, try_compose)
757 872
758extern const struct v4l2_file_operations v4l2_subdev_fops; 873extern const struct v4l2_file_operations v4l2_subdev_fops;
759 874
875/**
876 * v4l2_set_subdevdata - Sets V4L2 dev private device data
877 *
878 * @sd: pointer to &struct v4l2_subdev
879 * @p: pointer to the private device data to be stored.
880 */
760static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 881static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
761{ 882{
762 sd->dev_priv = p; 883 sd->dev_priv = p;
763} 884}
764 885
886/**
887 * v4l2_get_subdevdata - Gets V4L2 dev private device data
888 *
889 * @sd: pointer to &struct v4l2_subdev
890 *
891 * Returns the pointer to the private device data to be stored.
892 */
765static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) 893static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
766{ 894{
767 return sd->dev_priv; 895 return sd->dev_priv;
768} 896}
769 897
898/**
899 * v4l2_set_subdevdata - Sets V4L2 dev private host data
900 *
901 * @sd: pointer to &struct v4l2_subdev
902 * @p: pointer to the private data to be stored.
903 */
770static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p) 904static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
771{ 905{
772 sd->host_priv = p; 906 sd->host_priv = p;
773} 907}
774 908
909/**
910 * v4l2_get_subdevdata - Gets V4L2 dev private data
911 *
912 * @sd: pointer to &struct v4l2_subdev
913 *
914 * Returns the pointer to the private host data to be stored.
915 */
775static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd) 916static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
776{ 917{
777 return sd->host_priv; 918 return sd->host_priv;
778} 919}
779 920
780#ifdef CONFIG_MEDIA_CONTROLLER 921#ifdef CONFIG_MEDIA_CONTROLLER
922
923/**
924 * v4l2_subdev_link_validate_default - validates a media link
925 *
926 * @sd: pointer to &struct v4l2_subdev
927 * @link: pointer to &struct media_link
928 * @source_fmt: pointer to &struct v4l2_subdev_format
929 * @sink_fmt: pointer to &struct v4l2_subdev_format
930 *
931 * This function ensures that width, height and the media bus pixel
932 * code are equal on both source and sink of the link.
933 */
781int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, 934int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
782 struct media_link *link, 935 struct media_link *link,
783 struct v4l2_subdev_format *source_fmt, 936 struct v4l2_subdev_format *source_fmt,
784 struct v4l2_subdev_format *sink_fmt); 937 struct v4l2_subdev_format *sink_fmt);
938
939/**
940 * v4l2_subdev_link_validate - validates a media link
941 *
942 * @link: pointer to &struct media_link
943 *
944 * This function calls the subdev's link_validate ops to validate
945 * if a media link is valid for streaming. It also internally
946 * calls v4l2_subdev_link_validate_default() to ensure that
947 * width, height and the media bus pixel code are equal on both
948 * source and sink of the link.
949 */
785int v4l2_subdev_link_validate(struct media_link *link); 950int v4l2_subdev_link_validate(struct media_link *link);
786 951
787struct v4l2_subdev_pad_config * 952/**
788v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd); 953 * v4l2_subdev_alloc_pad_config - Allocates memory for pad config
954 *
955 * @sd: pointer to struct v4l2_subdev
956 */
957struct
958v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd);
959
960/**
961 * v4l2_subdev_free_pad_config - Frees memory allocated by
962 * v4l2_subdev_alloc_pad_config().
963 *
964 * @cfg: pointer to &struct v4l2_subdev_pad_config
965 */
789void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg); 966void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg);
790#endif /* CONFIG_MEDIA_CONTROLLER */ 967#endif /* CONFIG_MEDIA_CONTROLLER */
791 968
969/**
970 * v4l2_subdev_init - initializes the sub-device struct
971 *
972 * @sd: pointer to the &struct v4l2_subdev to be initialized
973 * @ops: pointer to &struct v4l2_subdev_ops.
974 */
792void v4l2_subdev_init(struct v4l2_subdev *sd, 975void v4l2_subdev_init(struct v4l2_subdev *sd,
793 const struct v4l2_subdev_ops *ops); 976 const struct v4l2_subdev_ops *ops);
794 977
795/* Call an ops of a v4l2_subdev, doing the right checks against 978/*
796 NULL pointers. 979 * Call an ops of a v4l2_subdev, doing the right checks against
797 980 * NULL pointers.
798 Example: err = v4l2_subdev_call(sd, video, s_std, norm); 981 *
982 * Example: err = v4l2_subdev_call(sd, video, s_std, norm);
799 */ 983 */
800#define v4l2_subdev_call(sd, o, f, args...) \ 984#define v4l2_subdev_call(sd, o, f, args...) \
801 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \ 985 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \
802 (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) 986 (sd)->ops->o->f((sd), ##args) : -ENOIOCTLCMD))
803 987
804#define v4l2_subdev_has_op(sd, o, f) \ 988#define v4l2_subdev_has_op(sd, o, f) \
805 ((sd)->ops->o && (sd)->ops->o->f) 989 ((sd)->ops->o && (sd)->ops->o->f)
806 990
991/**
992 * v4l2_subdev_notify_event() - Delivers event notification for subdevice
993 * @sd: The subdev for which to deliver the event
994 * @ev: The event to deliver
995 *
996 * Will deliver the specified event to all userspace event listeners which are
997 * subscribed to the v42l subdev event queue as well as to the bridge driver
998 * using the notify callback. The notification type for the notify callback
999 * will be %V4L2_DEVICE_NOTIFY_EVENT.
1000 */
807void v4l2_subdev_notify_event(struct v4l2_subdev *sd, 1001void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
808 const struct v4l2_event *ev); 1002 const struct v4l2_event *ev);
809 1003
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index bea81c9e3758..946340ce7701 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -85,11 +85,17 @@ struct vb2_threadio_data;
85 * @mmap: setup a userspace mapping for a given memory buffer under 85 * @mmap: setup a userspace mapping for a given memory buffer under
86 * the provided virtual memory region. 86 * the provided virtual memory region.
87 * 87 *
88 * Required ops for USERPTR types: get_userptr, put_userptr. 88 * Those operations are used by the videobuf2 core to implement the memory
89 * Required ops for MMAP types: alloc, put, num_users, mmap. 89 * handling/memory allocators for each type of supported streaming I/O method.
90 * Required ops for read/write access types: alloc, put, num_users, vaddr. 90 *
91 * Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, map_dmabuf, 91 * .. note::
92 * unmap_dmabuf. 92 * #) Required ops for USERPTR types: get_userptr, put_userptr.
93 *
94 * #) Required ops for MMAP types: alloc, put, num_users, mmap.
95 *
96 * #) Required ops for read/write access types: alloc, put, num_users, vaddr.
97 *
98 * #) Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, map_dmabuf, unmap_dmabuf.
93 */ 99 */
94struct vb2_mem_ops { 100struct vb2_mem_ops {
95 void *(*alloc)(struct device *dev, const struct dma_attrs *attrs, 101 void *(*alloc)(struct device *dev, const struct dma_attrs *attrs,
@@ -271,26 +277,26 @@ struct vb2_buffer {
271/** 277/**
272 * struct vb2_ops - driver-specific callbacks 278 * struct vb2_ops - driver-specific callbacks
273 * 279 *
274 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS 280 * @queue_setup: called from %VIDIOC_REQBUFS and %VIDIOC_CREATE_BUFS
275 * handlers before memory allocation. It can be called 281 * handlers before memory allocation. It can be called
276 * twice: if the original number of requested buffers 282 * twice: if the original number of requested buffers
277 * could not be allocated, then it will be called a 283 * could not be allocated, then it will be called a
278 * second time with the actually allocated number of 284 * second time with the actually allocated number of
279 * buffers to verify if that is OK. 285 * buffers to verify if that is OK.
280 * The driver should return the required number of buffers 286 * The driver should return the required number of buffers
281 * in *num_buffers, the required number of planes per 287 * in \*num_buffers, the required number of planes per
282 * buffer in *num_planes, the size of each plane should be 288 * buffer in \*num_planes, the size of each plane should be
283 * set in the sizes[] array and optional per-plane 289 * set in the sizes\[\] array and optional per-plane
284 * allocator specific device in the alloc_devs[] array. 290 * allocator specific device in the alloc_devs\[\] array.
285 * When called from VIDIOC_REQBUFS, *num_planes == 0, the 291 * When called from %VIDIOC_REQBUFS, \*num_planes == 0, the
286 * driver has to use the currently configured format to 292 * driver has to use the currently configured format to
287 * determine the plane sizes and *num_buffers is the total 293 * determine the plane sizes and \*num_buffers is the total
288 * number of buffers that are being allocated. When called 294 * number of buffers that are being allocated. When called
289 * from VIDIOC_CREATE_BUFS, *num_planes != 0 and it 295 * from %VIDIOC_CREATE_BUFS, \*num_planes != 0 and it
290 * describes the requested number of planes and sizes[] 296 * describes the requested number of planes and sizes\[\]
291 * contains the requested plane sizes. If either 297 * contains the requested plane sizes. If either
292 * *num_planes or the requested sizes are invalid callback 298 * \*num_planes or the requested sizes are invalid callback
293 * must return -EINVAL. In this case *num_buffers are 299 * must return %-EINVAL. In this case \*num_buffers are
294 * being allocated additionally to q->num_buffers. 300 * being allocated additionally to q->num_buffers.
295 * @wait_prepare: release any locks taken while calling vb2 functions; 301 * @wait_prepare: release any locks taken while calling vb2 functions;
296 * it is called before an ioctl needs to wait for a new 302 * it is called before an ioctl needs to wait for a new
@@ -305,11 +311,11 @@ struct vb2_buffer {
305 * initialization failure (return != 0) will prevent 311 * initialization failure (return != 0) will prevent
306 * queue setup from completing successfully; optional. 312 * queue setup from completing successfully; optional.
307 * @buf_prepare: called every time the buffer is queued from userspace 313 * @buf_prepare: called every time the buffer is queued from userspace
308 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may 314 * and from the %VIDIOC_PREPARE_BUF ioctl; drivers may
309 * perform any initialization required before each 315 * perform any initialization required before each
310 * hardware operation in this callback; drivers can 316 * hardware operation in this callback; drivers can
311 * access/modify the buffer here as it is still synced for 317 * access/modify the buffer here as it is still synced for
312 * the CPU; drivers that support VIDIOC_CREATE_BUFS must 318 * the CPU; drivers that support %VIDIOC_CREATE_BUFS must
313 * also validate the buffer size; if an error is returned, 319 * also validate the buffer size; if an error is returned,
314 * the buffer will not be queued in driver; optional. 320 * the buffer will not be queued in driver; optional.
315 * @buf_finish: called before every dequeue of the buffer back to 321 * @buf_finish: called before every dequeue of the buffer back to
@@ -317,23 +323,23 @@ struct vb2_buffer {
317 * can access/modify the buffer contents; drivers may 323 * can access/modify the buffer contents; drivers may
318 * perform any operations required before userspace 324 * perform any operations required before userspace
319 * accesses the buffer; optional. The buffer state can be 325 * accesses the buffer; optional. The buffer state can be
320 * one of the following: DONE and ERROR occur while 326 * one of the following: %DONE and %ERROR occur while
321 * streaming is in progress, and the PREPARED state occurs 327 * streaming is in progress, and the %PREPARED state occurs
322 * when the queue has been canceled and all pending 328 * when the queue has been canceled and all pending
323 * buffers are being returned to their default DEQUEUED 329 * buffers are being returned to their default %DEQUEUED
324 * state. Typically you only have to do something if the 330 * state. Typically you only have to do something if the
325 * state is VB2_BUF_STATE_DONE, since in all other cases 331 * state is %VB2_BUF_STATE_DONE, since in all other cases
326 * the buffer contents will be ignored anyway. 332 * the buffer contents will be ignored anyway.
327 * @buf_cleanup: called once before the buffer is freed; drivers may 333 * @buf_cleanup: called once before the buffer is freed; drivers may
328 * perform any additional cleanup; optional. 334 * perform any additional cleanup; optional.
329 * @start_streaming: called once to enter 'streaming' state; the driver may 335 * @start_streaming: called once to enter 'streaming' state; the driver may
330 * receive buffers with @buf_queue callback before 336 * receive buffers with @buf_queue callback
331 * @start_streaming is called; the driver gets the number 337 * before @start_streaming is called; the driver gets the
332 * of already queued buffers in count parameter; driver 338 * number of already queued buffers in count parameter;
333 * can return an error if hardware fails, in that case all 339 * driver can return an error if hardware fails, in that
334 * buffers that have been already given by the @buf_queue 340 * case all buffers that have been already given by
335 * callback are to be returned by the driver by calling 341 * the @buf_queue callback are to be returned by the driver
336 * @vb2_buffer_done(VB2_BUF_STATE_QUEUED). 342 * by calling @vb2_buffer_done\(%VB2_BUF_STATE_QUEUED\).
337 * If you need a minimum number of buffers before you can 343 * If you need a minimum number of buffers before you can
338 * start streaming, then set @min_buffers_needed in the 344 * start streaming, then set @min_buffers_needed in the
339 * vb2_queue structure. If that is non-zero then 345 * vb2_queue structure. If that is non-zero then
@@ -341,16 +347,16 @@ struct vb2_buffer {
341 * many buffers have been queued up by userspace. 347 * many buffers have been queued up by userspace.
342 * @stop_streaming: called when 'streaming' state must be disabled; driver 348 * @stop_streaming: called when 'streaming' state must be disabled; driver
343 * should stop any DMA transactions or wait until they 349 * should stop any DMA transactions or wait until they
344 * finish and give back all buffers it got from buf_queue() 350 * finish and give back all buffers it got from &buf_queue
345 * callback by calling @vb2_buffer_done() with either 351 * callback by calling @vb2_buffer_done\(\) with either
346 * VB2_BUF_STATE_DONE or VB2_BUF_STATE_ERROR; may use 352 * %VB2_BUF_STATE_DONE or %VB2_BUF_STATE_ERROR; may use
347 * vb2_wait_for_all_buffers() function 353 * vb2_wait_for_all_buffers() function
348 * @buf_queue: passes buffer vb to the driver; driver may start 354 * @buf_queue: passes buffer vb to the driver; driver may start
349 * hardware operation on this buffer; driver should give 355 * hardware operation on this buffer; driver should give
350 * the buffer back by calling vb2_buffer_done() function; 356 * the buffer back by calling vb2_buffer_done() function;
351 * it is allways called after calling STREAMON ioctl; 357 * it is allways called after calling %VIDIOC_STREAMON ioctl;
352 * might be called before start_streaming callback if user 358 * might be called before start_streaming callback if user
353 * pre-queued buffers before calling STREAMON. 359 * pre-queued buffers before calling %VIDIOC_STREAMON.
354 */ 360 */
355struct vb2_ops { 361struct vb2_ops {
356 int (*queue_setup)(struct vb2_queue *q, 362 int (*queue_setup)(struct vb2_queue *q,
diff --git a/include/uapi/linux/lirc.h b/include/uapi/linux/lirc.h
index 4b3ab2966b5a..991ab4570b8e 100644
--- a/include/uapi/linux/lirc.h
+++ b/include/uapi/linux/lirc.h
@@ -90,20 +90,11 @@
90 90
91#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32) 91#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
92#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32) 92#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
93#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
94#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
95#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
96#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
97#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32) 93#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
98 94
99#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32) 95#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32)
100#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32) 96#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32)
101 97
102#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32)
103#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32)
104#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32)
105#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32)
106
107/* code length in bits, currently only for LIRC_MODE_LIRCCODE */ 98/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
108#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32) 99#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
109 100
@@ -113,7 +104,6 @@
113#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32) 104#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
114#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32) 105#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
115#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32) 106#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
116#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
117#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32) 107#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
118 108
119/* 109/*
@@ -127,42 +117,17 @@
127#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32) 117#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32)
128 118
129/* 119/*
130 * pulses shorter than this are filtered out by hardware (software
131 * emulation in lirc_dev?)
132 */
133#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32)
134/*
135 * spaces shorter than this are filtered out by hardware (software
136 * emulation in lirc_dev?)
137 */
138#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32)
139/*
140 * if filter cannot be set independently for pulse/space, this should
141 * be used
142 */
143#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32)
144
145/*
146 * if enabled from the next key press on the driver will send 120 * if enabled from the next key press on the driver will send
147 * LIRC_MODE2_FREQUENCY packets 121 * LIRC_MODE2_FREQUENCY packets
148 */ 122 */
149#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32) 123#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32)
150 124
151/* 125/*
152 * to set a range use 126 * to set a range use LIRC_SET_REC_CARRIER_RANGE with the
153 * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the 127 * lower bound first and later LIRC_SET_REC_CARRIER with the upper bound
154 * lower bound first and later
155 * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
156 */ 128 */
157
158#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
159#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32) 129#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
160 130
161#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
162
163#define LIRC_SETUP_START _IO('i', 0x00000021)
164#define LIRC_SETUP_END _IO('i', 0x00000022)
165
166#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32) 131#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32)
167 132
168#endif 133#endif
diff --git a/Documentation/video4linux/extract_xc3028.pl b/scripts/extract_xc3028.pl
index 47877deae6d7..47877deae6d7 100755
--- a/Documentation/video4linux/extract_xc3028.pl
+++ b/scripts/extract_xc3028.pl
diff --git a/Documentation/dvb/get_dvb_firmware b/scripts/get_dvb_firmware
index 1a0a04125f71..1a0a04125f71 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/scripts/get_dvb_firmware