aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-10-11 05:55:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-10-11 05:55:04 -0400
commita0f0dd57f4a85310d9936f1770a0424b49fef876 (patch)
tree2f85b8b67dda13d19b02ca39e0fbef921cb1cf8b /Documentation
parent2a552d5e63d7fa602c9a9a0717008737f55625a6 (diff)
parent846a136881b8f73c1f74250bf6acfaa309cab1f2 (diff)
Merge branch 'fixes' into for-linus
Conflicts: arch/arm/kernel/smp.c
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/ima_policy25
-rw-r--r--Documentation/ABI/testing/sysfs-bus-rbd18
-rw-r--r--Documentation/ABI/testing/sysfs-bus-usb7
-rw-r--r--Documentation/ABI/testing/sysfs-class-extcon22
-rw-r--r--Documentation/ABI/testing/sysfs-class-regulator21
-rw-r--r--Documentation/ABI/testing/sysfs-devices-firmware_node17
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu11
-rw-r--r--Documentation/ABI/testing/sysfs-driver-ppi70
-rw-r--r--Documentation/ABI/testing/sysfs-driver-wacom13
-rw-r--r--Documentation/ABI/testing/sysfs-fs-ext413
-rw-r--r--Documentation/ABI/testing/sysfs-ptp6
-rw-r--r--Documentation/ABI/testing/sysfs-tty9
-rw-r--r--Documentation/CodingStyle10
-rw-r--r--Documentation/DocBook/drm.tmpl2835
-rw-r--r--Documentation/DocBook/media/Makefile2
-rw-r--r--Documentation/DocBook/media/dvb/audio.xml113
-rw-r--r--Documentation/DocBook/media/dvb/ca.xml353
-rw-r--r--Documentation/DocBook/media/dvb/demux.xml230
-rw-r--r--Documentation/DocBook/media/dvb/dvbapi.xml4
-rw-r--r--Documentation/DocBook/media/dvb/dvbproperty.xml113
-rw-r--r--Documentation/DocBook/media/dvb/frontend.xml71
-rw-r--r--Documentation/DocBook/media/dvb/intro.xml2
-rw-r--r--Documentation/DocBook/media/dvb/kdapi.xml2
-rw-r--r--Documentation/DocBook/media/dvb/net.xml127
-rw-r--r--Documentation/DocBook/media/dvb/video.xml333
-rw-r--r--Documentation/DocBook/media/v4l/biblio.xml52
-rw-r--r--Documentation/DocBook/media/v4l/common.xml30
-rw-r--r--Documentation/DocBook/media/v4l/compat.xml41
-rw-r--r--Documentation/DocBook/media/v4l/controls.xml614
-rw-r--r--Documentation/DocBook/media/v4l/dev-osd.xml7
-rw-r--r--Documentation/DocBook/media/v4l/dev-rds.xml2
-rw-r--r--Documentation/DocBook/media/v4l/dev-subdev.xml20
-rw-r--r--Documentation/DocBook/media/v4l/gen-errors.xml19
-rw-r--r--Documentation/DocBook/media/v4l/io.xml21
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml3
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml154
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt.xml1
-rw-r--r--Documentation/DocBook/media/v4l/selection-api.xml22
-rw-r--r--Documentation/DocBook/media/v4l/v4l2.xml15
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-cropcap.xml12
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml9
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enuminput.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumoutput.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enumstd.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-crop.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml9
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml13
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fmt.xml13
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-parm.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-selection.xml9
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-std.xml10
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-qbuf.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml9
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querycap.xml10
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querystd.xml8
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-reqbufs.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml10
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-streamon.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml152
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml8
-rw-r--r--Documentation/DocBook/media_api.tmpl9
-rw-r--r--Documentation/RCU/checklist.txt6
-rw-r--r--Documentation/RCU/stallwarn.txt16
-rw-r--r--Documentation/RCU/trace.txt43
-rw-r--r--Documentation/RCU/whatisRCU.txt9
-rw-r--r--Documentation/accounting/getdelays.c5
-rw-r--r--Documentation/aoe/aoe.txt58
-rw-r--r--Documentation/aoe/mkdevs.sh41
-rw-r--r--Documentation/aoe/mkshelf.sh28
-rw-r--r--Documentation/aoe/status.sh3
-rw-r--r--Documentation/arm/Marvell/README232
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt82
-rw-r--r--Documentation/arm/Samsung/GPIO.txt8
-rw-r--r--Documentation/arm/memory.txt3
-rw-r--r--Documentation/arm64/booting.txt152
-rw-r--r--Documentation/arm64/memory.txt73
-rw-r--r--Documentation/cgroups/cgroups.txt92
-rw-r--r--Documentation/cpu-freq/boost.txt93
-rw-r--r--Documentation/cpuidle/sysfs.txt10
-rw-r--r--Documentation/devicetree/bindings/arm/arm-boards12
-rw-r--r--Documentation/devicetree/bindings/arm/bcm2835.txt8
-rw-r--r--Documentation/devicetree/bindings/arm/calxeda/combophy.txt17
-rw-r--r--Documentation/devicetree/bindings/arm/mrvl/tauros2.txt17
-rw-r--r--Documentation/devicetree/bindings/arm/msm/timer.txt38
-rw-r--r--Documentation/devicetree/bindings/arm/omap/omap.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/pmu.txt4
-rw-r--r--Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt31
-rw-r--r--Documentation/devicetree/bindings/arm/vt8500.txt14
-rw-r--r--Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt16
-rw-r--r--Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt13
-rw-r--r--Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt15
-rw-r--r--Documentation/devicetree/bindings/arm/xen.txt25
-rw-r--r--Documentation/devicetree/bindings/ata/ahci-platform.txt9
-rw-r--r--Documentation/devicetree/bindings/ata/pata-arasan.txt17
-rw-r--r--Documentation/devicetree/bindings/bus/omap-ocp2scp.txt10
-rw-r--r--Documentation/devicetree/bindings/clock/imx23-clock.txt76
-rw-r--r--Documentation/devicetree/bindings/clock/imx28-clock.txt99
-rw-r--r--Documentation/devicetree/bindings/clock/imx6q-clock.txt222
-rw-r--r--Documentation/devicetree/bindings/clock/vt8500.txt72
-rw-r--r--Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt55
-rw-r--r--Documentation/devicetree/bindings/crypto/fsl-sec4.txt51
-rw-r--r--Documentation/devicetree/bindings/crypto/mv_cesa.txt20
-rw-r--r--Documentation/devicetree/bindings/dma/arm-pl330.txt3
-rw-r--r--Documentation/devicetree/bindings/dma/mmp-dma.txt74
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-74x164.txt22
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-adnp.txt34
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-fan.txt25
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-mvebu.txt53
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-samsung.txt43
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-twl4030.txt6
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-vt8500.txt24
-rw-r--r--Documentation/devicetree/bindings/gpio/led.txt2
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt1
-rw-r--r--Documentation/devicetree/bindings/input/gpio-keys-polled.txt38
-rw-r--r--Documentation/devicetree/bindings/input/rotary-encoder.txt36
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt110
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/interrupts.txt95
-rw-r--r--Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt52
-rw-r--r--Documentation/devicetree/bindings/lpddr2/lpddr2.txt102
-rw-r--r--Documentation/devicetree/bindings/media/exynos5-gsc.txt30
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/ti/emif.txt55
-rw-r--r--Documentation/devicetree/bindings/mfd/88pm860x.txt85
-rw-r--r--Documentation/devicetree/bindings/mfd/ab8500.txt15
-rw-r--r--Documentation/devicetree/bindings/mfd/syscon.txt20
-rw-r--r--Documentation/devicetree/bindings/mfd/tps65910.txt4
-rw-r--r--Documentation/devicetree/bindings/mfd/twl4030-audio.txt46
-rw-r--r--Documentation/devicetree/bindings/mfd/twl6040.txt9
-rw-r--r--Documentation/devicetree/bindings/misc/at25.txt34
-rw-r--r--Documentation/devicetree/bindings/misc/ifm-csi.txt41
-rw-r--r--Documentation/devicetree/bindings/misc/lis302.txt112
-rw-r--r--Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt31
-rw-r--r--Documentation/devicetree/bindings/net/calxeda-xgmac.txt3
-rw-r--r--Documentation/devicetree/bindings/net/can/c_can.txt49
-rw-r--r--Documentation/devicetree/bindings/net/cpsw.txt109
-rw-r--r--Documentation/devicetree/bindings/net/davinci-mdio.txt33
-rw-r--r--Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt75
-rw-r--r--Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt74
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,imx35-pinctrl.txt984
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt95
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt100
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt72
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt279
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt46
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt41
-rw-r--r--Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt196
-rw-r--r--Documentation/devicetree/bindings/power/opp.txt25
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/ifc.txt9
-rw-r--r--Documentation/devicetree/bindings/pwm/mxs-pwm.txt2
-rw-r--r--Documentation/devicetree/bindings/regulator/88pm860x.txt30
-rw-r--r--Documentation/devicetree/bindings/regulator/max8907.txt69
-rw-r--r--Documentation/devicetree/bindings/regulator/regulator.txt5
-rw-r--r--Documentation/devicetree/bindings/regulator/tps65217.txt31
-rw-r--r--Documentation/devicetree/bindings/regulator/tps6586x.txt79
-rw-r--r--Documentation/devicetree/bindings/rtc/pxa-rtc.txt14
-rw-r--r--Documentation/devicetree/bindings/rtc/snvs-rtc.txt1
-rw-r--r--Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt15
-rw-r--r--Documentation/devicetree/bindings/serial/fsl-imx-uart.txt35
-rw-r--r--Documentation/devicetree/bindings/sound/cs4270.txt21
-rw-r--r--Documentation/devicetree/bindings/sound/cs4271.txt36
-rw-r--r--Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt45
-rw-r--r--Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt91
-rw-r--r--Documentation/devicetree/bindings/sound/omap-mcbsp.txt37
-rw-r--r--Documentation/devicetree/bindings/sound/omap-twl4030.txt17
-rw-r--r--Documentation/devicetree/bindings/sound/tlv320aic3x.txt20
-rw-r--r--Documentation/devicetree/bindings/sound/ux500-mop500.txt39
-rw-r--r--Documentation/devicetree/bindings/sound/ux500-msp.txt43
-rw-r--r--Documentation/devicetree/bindings/spi/mxs-spi.txt22
-rw-r--r--Documentation/devicetree/bindings/spi/spi-bus.txt3
-rw-r--r--Documentation/devicetree/bindings/spi/spi-gpio.txt29
-rw-r--r--Documentation/devicetree/bindings/spi/spi-sc18is602.txt23
-rw-r--r--Documentation/devicetree/bindings/spi/spi_pl022.txt22
-rw-r--r--Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt15
-rw-r--r--Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt41
-rw-r--r--Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt22
-rw-r--r--Documentation/devicetree/bindings/tty/serial/nxp-lpc32xx-hsuart.txt14
-rw-r--r--Documentation/devicetree/bindings/tty/serial/of-serial.txt2
-rw-r--r--Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt17
-rw-r--r--Documentation/devicetree/bindings/usb/am33xx-usb.txt14
-rw-r--r--Documentation/devicetree/bindings/usb/ci13xxx-imx.txt5
-rw-r--r--Documentation/devicetree/bindings/usb/omap-usb.txt33
-rw-r--r--Documentation/devicetree/bindings/usb/platform-uhci.txt15
-rw-r--r--Documentation/devicetree/bindings/usb/pxa-usb.txt31
-rw-r--r--Documentation/devicetree/bindings/usb/twlxxxx-usb.txt40
-rw-r--r--Documentation/devicetree/bindings/usb/usb-phy.txt17
-rw-r--r--Documentation/devicetree/bindings/usb/usbmisc-imx.txt14
-rw-r--r--Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt15
-rw-r--r--Documentation/devicetree/bindings/usb/vt8500-ehci.txt12
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt3
-rw-r--r--Documentation/devicetree/bindings/video/backlight/88pm860x.txt15
-rw-r--r--Documentation/devicetree/bindings/video/via,vt8500-fb.txt62
-rw-r--r--Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt13
-rw-r--r--Documentation/devicetree/bindings/video/wm,wm8505-fb.txt23
-rw-r--r--Documentation/devicetree/bindings/w1/w1-gpio.txt22
-rw-r--r--Documentation/dontdiff1
-rw-r--r--Documentation/dvb/README.dvb-usb2
-rwxr-xr-xDocumentation/dvb/get_dvb_firmware2
-rw-r--r--Documentation/feature-removal-schedule.txt639
-rw-r--r--Documentation/filesystems/debugfs.txt4
-rw-r--r--Documentation/filesystems/ext4.txt10
-rw-r--r--Documentation/filesystems/jfs.txt19
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt10
-rwxr-xr-xDocumentation/hid/hid-sensor.txt140
-rw-r--r--Documentation/hwmon/adt741051
-rw-r--r--Documentation/hwmon/ina2xx18
-rw-r--r--Documentation/hwmon/lm7012
-rw-r--r--Documentation/hwmon/max19760
-rw-r--r--Documentation/hwmon/mcp302123
-rw-r--r--Documentation/i2c/busses/i2c-viapro6
-rw-r--r--Documentation/i2c/muxes/i2c-mux-gpio18
-rw-r--r--Documentation/ia64/aliasing-test.c1
-rw-r--r--Documentation/infiniband/ipoib.txt3
-rw-r--r--Documentation/ioctl/ioctl-number.txt5
-rw-r--r--Documentation/kbuild/makefiles.txt8
-rw-r--r--Documentation/kernel-parameters.txt37
-rw-r--r--Documentation/kobject.txt6
-rw-r--r--Documentation/misc-devices/lis3lv02d3
-rw-r--r--Documentation/networking/batman-adv.txt7
-rw-r--r--Documentation/networking/bonding.txt30
-rw-r--r--Documentation/networking/ip-sysctl.txt37
-rw-r--r--Documentation/networking/stmmac.txt5
-rw-r--r--Documentation/networking/vxlan.txt47
-rw-r--r--Documentation/pinctrl.txt60
-rw-r--r--Documentation/power/power_supply_class.txt7
-rw-r--r--Documentation/power/swsusp.txt2
-rw-r--r--Documentation/printk-formats.txt1
-rw-r--r--Documentation/ramoops.txt4
-rw-r--r--Documentation/remoteproc.txt7
-rw-r--r--Documentation/rtc.txt5
-rw-r--r--Documentation/scheduler/sched-arch.txt10
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas10
-rw-r--r--Documentation/scsi/LICENSE.qla2xxx2
-rw-r--r--Documentation/scsi/LICENSE.qla4xxx2
-rw-r--r--Documentation/scsi/st.txt6
-rw-r--r--Documentation/security/Smack.txt10
-rw-r--r--Documentation/serial/00-INDEX2
-rw-r--r--Documentation/serial/computone.txt520
-rw-r--r--Documentation/smsc_ece1099.txt56
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt10
-rw-r--r--Documentation/sound/alsa/Channel-Mapping-API.txt153
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt3
-rw-r--r--Documentation/spi/ep93xx_spi2
-rw-r--r--Documentation/spi/spi-sc18is60236
-rw-r--r--Documentation/sysctl/kernel.txt2
-rw-r--r--Documentation/trace/kprobetrace.txt2
-rw-r--r--Documentation/usb/persist.txt3
-rw-r--r--Documentation/video4linux/CARDLIST.cx238851
-rw-r--r--Documentation/video4linux/CQcam.txt2
-rw-r--r--Documentation/video4linux/README.davinci-vpbe20
-rw-r--r--Documentation/video4linux/fimc.txt16
-rw-r--r--Documentation/video4linux/omap3isp.txt2
-rw-r--r--Documentation/video4linux/v4l2-controls.txt6
-rw-r--r--Documentation/video4linux/v4l2-framework.txt12
-rw-r--r--Documentation/video4linux/videobuf2
-rw-r--r--Documentation/virtual/kvm/api.txt33
-rw-r--r--Documentation/virtual/kvm/hypercalls.txt66
-rw-r--r--Documentation/virtual/kvm/msr.txt32
-rw-r--r--Documentation/virtual/kvm/ppc-pv.txt22
-rw-r--r--Documentation/x86/x86_64/boot-options.txt7
-rw-r--r--Documentation/zh_CN/arm/Booting175
-rw-r--r--Documentation/zh_CN/basic_profiling.txt71
-rw-r--r--Documentation/zh_CN/filesystems/sysfs.txt372
-rw-r--r--Documentation/zh_CN/gpio.txt658
-rw-r--r--Documentation/zh_CN/video4linux/omap3isp.txt277
-rw-r--r--Documentation/zh_CN/video4linux/v4l2-framework.txt983
272 files changed, 14297 insertions, 2738 deletions
diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy
index 6cd6daefaaed..986946613542 100644
--- a/Documentation/ABI/testing/ima_policy
+++ b/Documentation/ABI/testing/ima_policy
@@ -12,11 +12,14 @@ Description:
12 then closing the file. The new policy takes effect after 12 then closing the file. The new policy takes effect after
13 the file ima/policy is closed. 13 the file ima/policy is closed.
14 14
15 IMA appraisal, if configured, uses these file measurements
16 for local measurement appraisal.
17
15 rule format: action [condition ...] 18 rule format: action [condition ...]
16 19
17 action: measure | dont_measure 20 action: measure | dont_measure | appraise | dont_appraise | audit
18 condition:= base | lsm 21 condition:= base | lsm
19 base: [[func=] [mask=] [fsmagic=] [uid=]] 22 base: [[func=] [mask=] [fsmagic=] [uid=] [fowner]]
20 lsm: [[subj_user=] [subj_role=] [subj_type=] 23 lsm: [[subj_user=] [subj_role=] [subj_type=]
21 [obj_user=] [obj_role=] [obj_type=]] 24 [obj_user=] [obj_role=] [obj_type=]]
22 25
@@ -24,36 +27,50 @@ Description:
24 mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] 27 mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
25 fsmagic:= hex value 28 fsmagic:= hex value
26 uid:= decimal value 29 uid:= decimal value
30 fowner:=decimal value
27 lsm: are LSM specific 31 lsm: are LSM specific
28 32
29 default policy: 33 default policy:
30 # PROC_SUPER_MAGIC 34 # PROC_SUPER_MAGIC
31 dont_measure fsmagic=0x9fa0 35 dont_measure fsmagic=0x9fa0
36 dont_appraise fsmagic=0x9fa0
32 # SYSFS_MAGIC 37 # SYSFS_MAGIC
33 dont_measure fsmagic=0x62656572 38 dont_measure fsmagic=0x62656572
39 dont_appraise fsmagic=0x62656572
34 # DEBUGFS_MAGIC 40 # DEBUGFS_MAGIC
35 dont_measure fsmagic=0x64626720 41 dont_measure fsmagic=0x64626720
42 dont_appraise fsmagic=0x64626720
36 # TMPFS_MAGIC 43 # TMPFS_MAGIC
37 dont_measure fsmagic=0x01021994 44 dont_measure fsmagic=0x01021994
45 dont_appraise fsmagic=0x01021994
46 # RAMFS_MAGIC
47 dont_measure fsmagic=0x858458f6
48 dont_appraise fsmagic=0x858458f6
38 # SECURITYFS_MAGIC 49 # SECURITYFS_MAGIC
39 dont_measure fsmagic=0x73636673 50 dont_measure fsmagic=0x73636673
51 dont_appraise fsmagic=0x73636673
40 52
41 measure func=BPRM_CHECK 53 measure func=BPRM_CHECK
42 measure func=FILE_MMAP mask=MAY_EXEC 54 measure func=FILE_MMAP mask=MAY_EXEC
43 measure func=FILE_CHECK mask=MAY_READ uid=0 55 measure func=FILE_CHECK mask=MAY_READ uid=0
56 appraise fowner=0
44 57
45 The default policy measures all executables in bprm_check, 58 The default policy measures all executables in bprm_check,
46 all files mmapped executable in file_mmap, and all files 59 all files mmapped executable in file_mmap, and all files
47 open for read by root in do_filp_open. 60 open for read by root in do_filp_open. The default appraisal
61 policy appraises all files owned by root.
48 62
49 Examples of LSM specific definitions: 63 Examples of LSM specific definitions:
50 64
51 SELinux: 65 SELinux:
52 # SELINUX_MAGIC 66 # SELINUX_MAGIC
53 dont_measure fsmagic=0xF97CFF8C 67 dont_measure fsmagic=0xf97cff8c
68 dont_appraise fsmagic=0xf97cff8c
54 69
55 dont_measure obj_type=var_log_t 70 dont_measure obj_type=var_log_t
71 dont_appraise obj_type=var_log_t
56 dont_measure obj_type=auditd_log_t 72 dont_measure obj_type=auditd_log_t
73 dont_appraise obj_type=auditd_log_t
57 measure subj_user=system_u func=FILE_CHECK mask=MAY_READ 74 measure subj_user=system_u func=FILE_CHECK mask=MAY_READ
58 measure subj_role=system_r func=FILE_CHECK mask=MAY_READ 75 measure subj_role=system_r func=FILE_CHECK mask=MAY_READ
59 76
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd
index 3c17b62899f6..1cf2adf46b11 100644
--- a/Documentation/ABI/testing/sysfs-bus-rbd
+++ b/Documentation/ABI/testing/sysfs-bus-rbd
@@ -25,6 +25,10 @@ client_id
25 25
26 The ceph unique client id that was assigned for this specific session. 26 The ceph unique client id that was assigned for this specific session.
27 27
28features
29
30 A hexadecimal encoding of the feature bits for this image.
31
28major 32major
29 33
30 The block device major number. 34 The block device major number.
@@ -33,6 +37,11 @@ name
33 37
34 The name of the rbd image. 38 The name of the rbd image.
35 39
40image_id
41
42 The unique id for the rbd image. (For rbd image format 1
43 this is empty.)
44
36pool 45pool
37 46
38 The name of the storage pool where this rbd image resides. 47 The name of the storage pool where this rbd image resides.
@@ -57,12 +66,6 @@ current_snap
57 66
58 The current snapshot for which the device is mapped. 67 The current snapshot for which the device is mapped.
59 68
60create_snap
61
62 Create a snapshot:
63
64 $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create
65
66snap_* 69snap_*
67 70
68 A directory per each snapshot 71 A directory per each snapshot
@@ -79,4 +82,7 @@ snap_size
79 82
80 The size of the image when this snapshot was taken. 83 The size of the image when this snapshot was taken.
81 84
85snap_features
86
87 A hexadecimal encoding of the feature bits for this snapshot.
82 88
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb
index 5f75f8f7df34..b6fbe514a869 100644
--- a/Documentation/ABI/testing/sysfs-bus-usb
+++ b/Documentation/ABI/testing/sysfs-bus-usb
@@ -220,3 +220,10 @@ Description:
220 If the device doesn't support LTM, the file will read "no". 220 If the device doesn't support LTM, the file will read "no".
221 The file will be present for all speeds of USB devices, and will 221 The file will be present for all speeds of USB devices, and will
222 always read "no" for USB 1.1 and USB 2.0 devices. 222 always read "no" for USB 1.1 and USB 2.0 devices.
223
224What: /sys/bus/usb/devices/.../(hub interface)/portX
225Date: August 2012
226Contact: Lan Tianyu <tianyu.lan@intel.com>
227Description:
228 The /sys/bus/usb/devices/.../(hub interface)/portX
229 is usb port device's sysfs directory.
diff --git a/Documentation/ABI/testing/sysfs-class-extcon b/Documentation/ABI/testing/sysfs-class-extcon
index 20ab361bd8c6..57a726232912 100644
--- a/Documentation/ABI/testing/sysfs-class-extcon
+++ b/Documentation/ABI/testing/sysfs-class-extcon
@@ -13,7 +13,7 @@ Description:
13 accessory cables have such capability. For example, 13 accessory cables have such capability. For example,
14 the 30-pin port of Nuri board (/arch/arm/mach-exynos) 14 the 30-pin port of Nuri board (/arch/arm/mach-exynos)
15 may have both HDMI and Charger attached, or analog audio, 15 may have both HDMI and Charger attached, or analog audio,
16 video, and USB cables attached simulteneously. 16 video, and USB cables attached simultaneously.
17 17
18 If there are cables mutually exclusive with each other, 18 If there are cables mutually exclusive with each other,
19 such binary relations may be expressed with extcon_dev's 19 such binary relations may be expressed with extcon_dev's
@@ -35,7 +35,7 @@ Description:
35 The /sys/class/extcon/.../state shows and stores the cable 35 The /sys/class/extcon/.../state shows and stores the cable
36 attach/detach information of the corresponding extcon object. 36 attach/detach information of the corresponding extcon object.
37 If the extcon object has an optional callback "show_state" 37 If the extcon object has an optional callback "show_state"
38 defined, the showing function is overriden with the optional 38 defined, the showing function is overridden with the optional
39 callback. 39 callback.
40 40
41 If the default callback for showing function is used, the 41 If the default callback for showing function is used, the
@@ -46,19 +46,19 @@ Description:
46 TA=1 46 TA=1
47 EAR_JACK=0 47 EAR_JACK=0
48 # 48 #
49 In this example, the extcon device have USB_OTG and TA 49 In this example, the extcon device has USB_OTG and TA
50 cables attached and HDMI and EAR_JACK cables detached. 50 cables attached and HDMI and EAR_JACK cables detached.
51 51
52 In order to update the state of an extcon device, enter a hex 52 In order to update the state of an extcon device, enter a hex
53 state number starting with 0x. 53 state number starting with 0x:
54 echo 0xHEX > state 54 # echo 0xHEX > state
55 55
56 This updates the whole state of the extcon dev. 56 This updates the whole state of the extcon device.
57 Inputs of all the methods are required to meet the 57 Inputs of all the methods are required to meet the
58 mutually_exclusive contidions if they exist. 58 mutually_exclusive conditions if they exist.
59 59
60 It is recommended to use this "global" state interface if 60 It is recommended to use this "global" state interface if
61 you need to enter the value atomically. The later state 61 you need to set the value atomically. The later state
62 interface associated with each cable cannot update 62 interface associated with each cable cannot update
63 multiple cable states of an extcon device simultaneously. 63 multiple cable states of an extcon device simultaneously.
64 64
@@ -73,7 +73,7 @@ What: /sys/class/extcon/.../cable.x/state
73Date: February 2012 73Date: February 2012
74Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 74Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
75Description: 75Description:
76 The /sys/class/extcon/.../cable.x/name shows and stores the 76 The /sys/class/extcon/.../cable.x/state shows and stores the
77 state of cable "x" (integer between 0 and 31) of an extcon 77 state of cable "x" (integer between 0 and 31) of an extcon
78 device. The state value is either 0 (detached) or 1 78 device. The state value is either 0 (detached) or 1
79 (attached). 79 (attached).
@@ -83,8 +83,8 @@ Date: December 2011
83Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 83Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
84Description: 84Description:
85 Shows the relations of mutually exclusiveness. For example, 85 Shows the relations of mutually exclusiveness. For example,
86 if the mutually_exclusive array of extcon_dev is 86 if the mutually_exclusive array of extcon device is
87 {0x3, 0x5, 0xC, 0x0}, the, the output is: 87 {0x3, 0x5, 0xC, 0x0}, then the output is:
88 # ls mutually_exclusive/ 88 # ls mutually_exclusive/
89 0x3 89 0x3
90 0x5 90 0x5
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator
index e091fa873792..bc578bc60628 100644
--- a/Documentation/ABI/testing/sysfs-class-regulator
+++ b/Documentation/ABI/testing/sysfs-class-regulator
@@ -349,3 +349,24 @@ Description:
349 349
350 This will be one of the same strings reported by 350 This will be one of the same strings reported by
351 the "state" attribute. 351 the "state" attribute.
352
353What: /sys/class/regulator/.../bypass
354Date: September 2012
355KernelVersion: 3.7
356Contact: Mark Brown <broonie@opensource.wolfsonmicro.com>
357Description:
358 Some regulator directories will contain a field called
359 bypass. This indicates if the device is in bypass mode.
360
361 This will be one of the following strings:
362
363 'enabled'
364 'disabled'
365 'unknown'
366
367 'enabled' means the regulator is in bypass mode.
368
369 'disabled' means that the regulator is regulating.
370
371 'unknown' means software cannot determine the state, or
372 the reported state is invalid.
diff --git a/Documentation/ABI/testing/sysfs-devices-firmware_node b/Documentation/ABI/testing/sysfs-devices-firmware_node
new file mode 100644
index 000000000000..46badc9ea284
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-firmware_node
@@ -0,0 +1,17 @@
1What: /sys/devices/.../firmware_node/
2Date: September 2012
3Contact: <>
4Description:
5 The /sys/devices/.../firmware_node directory contains attributes
6 allowing the user space to check and modify some firmware
7 related properties of given device.
8
9What: /sys/devices/.../firmware_node/description
10Date: September 2012
11Contact: Lance Ortiz <lance.ortiz@hp.com>
12Description:
13 The /sys/devices/.../firmware/description attribute contains a string
14 that describes the device as provided by the _STR method in the ACPI
15 namespace. This attribute is read-only. If the device does not have
16 an _STR method associated with it in the ACPI namespace, this
17 attribute is not present.
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index 5dab36448b44..6943133afcb8 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -176,3 +176,14 @@ Description: Disable L3 cache indices
176 All AMD processors with L3 caches provide this functionality. 176 All AMD processors with L3 caches provide this functionality.
177 For details, see BKDGs at 177 For details, see BKDGs at
178 http://developer.amd.com/documentation/guides/Pages/default.aspx 178 http://developer.amd.com/documentation/guides/Pages/default.aspx
179
180
181What: /sys/devices/system/cpu/cpufreq/boost
182Date: August 2012
183Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
184Description: Processor frequency boosting control
185
186 This switch controls the boost setting for the whole system.
187 Boosting allows the CPU and the firmware to run at a frequency
188 beyound it's nominal limit.
189 More details can be found in Documentation/cpu-freq/boost.txt
diff --git a/Documentation/ABI/testing/sysfs-driver-ppi b/Documentation/ABI/testing/sysfs-driver-ppi
new file mode 100644
index 000000000000..97a003ee058b
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-ppi
@@ -0,0 +1,70 @@
1What: /sys/devices/pnp0/<bus-num>/ppi/
2Date: August 2012
3Kernel Version: 3.6
4Contact: xiaoyan.zhang@intel.com
5Description:
6 This folder includes the attributes related with PPI (Physical
7 Presence Interface). Only if TPM is supported by BIOS, this
8 folder makes sence. The folder path can be got by command
9 'find /sys/ -name 'pcrs''. For the detail information of PPI,
10 please refer to the PPI specification from
11 http://www.trustedcomputinggroup.org/
12
13What: /sys/devices/pnp0/<bus-num>/ppi/version
14Date: August 2012
15Contact: xiaoyan.zhang@intel.com
16Description:
17 This attribute shows the version of the PPI supported by the
18 platform.
19 This file is readonly.
20
21What: /sys/devices/pnp0/<bus-num>/ppi/request
22Date: August 2012
23Contact: xiaoyan.zhang@intel.com
24Description:
25 This attribute shows the request for an operation to be
26 executed in the pre-OS environment. It is the only input from
27 the OS to the pre-OS environment. The request should be an
28 integer value range from 1 to 160, and 0 means no request.
29 This file can be read and written.
30
31What: /sys/devices/pnp0/00:<bus-num>/ppi/response
32Date: August 2012
33Contact: xiaoyan.zhang@intel.com
34Description:
35 This attribute shows the response to the most recent operation
36 request it acted upon. The format is "<request> <response num>
37 : <response description>".
38 This file is readonly.
39
40What: /sys/devices/pnp0/<bus-num>/ppi/transition_action
41Date: August 2012
42Contact: xiaoyan.zhang@intel.com
43Description:
44 This attribute shows the platform-specific action that should
45 take place in order to transition to the BIOS for execution of
46 a requested operation. The format is "<action num>: <action
47 description>".
48 This file is readonly.
49
50What: /sys/devices/pnp0/<bus-num>/ppi/tcg_operations
51Date: August 2012
52Contact: xiaoyan.zhang@intel.com
53Description:
54 This attribute shows whether it is allowed to request an
55 operation to be executed in the pre-OS environment by the BIOS
56 for the requests defined by TCG, i.e. requests from 1 to 22.
57 The format is "<request> <status num>: <status description>".
58 This attribute is only supported by PPI version 1.2+.
59 This file is readonly.
60
61What: /sys/devices/pnp0/<bus-num>/ppi/vs_operations
62Date: August 2012
63Contact: xiaoyan.zhang@intel.com
64Description:
65 This attribute shows whether it is allowed to request an
66 operation to be executed in the pre-OS environment by the BIOS
67 for the verdor specific requests, i.e. requests from 128 to
68 255. The format is same with tcg_operations. This attribute
69 is also only supported by PPI version 1.2+.
70 This file is readonly.
diff --git a/Documentation/ABI/testing/sysfs-driver-wacom b/Documentation/ABI/testing/sysfs-driver-wacom
index 8d55a83d6921..7fc781048b79 100644
--- a/Documentation/ABI/testing/sysfs-driver-wacom
+++ b/Documentation/ABI/testing/sysfs-driver-wacom
@@ -1,3 +1,16 @@
1WWhat: /sys/class/hidraw/hidraw*/device/oled*_img
2Date: June 2012
3Contact: linux-bluetooth@vger.kernel.org
4Description:
5 The /sys/class/hidraw/hidraw*/device/oled*_img files control
6 OLED mocro displays on Intuos4 Wireless tablet. Accepted image
7 has to contain 256 bytes (64x32 px 1 bit colour). The format
8 is the same as PBM image 62x32px without header (64 bits per
9 horizontal line, 32 lines). An example of setting OLED No. 0:
10 dd bs=256 count=1 if=img_file of=[path to oled0_img]/oled0_img
11 The attribute is read only and no local copy of the image is
12 stored.
13
1What: /sys/class/hidraw/hidraw*/device/speed 14What: /sys/class/hidraw/hidraw*/device/speed
2Date: April 2010 15Date: April 2010
3Kernel Version: 2.6.35 16Kernel Version: 2.6.35
diff --git a/Documentation/ABI/testing/sysfs-fs-ext4 b/Documentation/ABI/testing/sysfs-fs-ext4
index f22ac0872ae8..c631253cf85c 100644
--- a/Documentation/ABI/testing/sysfs-fs-ext4
+++ b/Documentation/ABI/testing/sysfs-fs-ext4
@@ -96,3 +96,16 @@ Contact: "Theodore Ts'o" <tytso@mit.edu>
96Description: 96Description:
97 The maximum number of megabytes the writeback code will 97 The maximum number of megabytes the writeback code will
98 try to write out before move on to another inode. 98 try to write out before move on to another inode.
99
100What: /sys/fs/ext4/<disk>/extent_max_zeroout_kb
101Date: August 2012
102Contact: "Theodore Ts'o" <tytso@mit.edu>
103Description:
104 The maximum number of kilobytes which will be zeroed
105 out in preference to creating a new uninitialized
106 extent when manipulating an inode's extent tree. Note
107 that using a larger value will increase the
108 variability of time necessary to complete a random
109 write operation (since a 4k random write might turn
110 into a much larger write due to the zeroout
111 operation).
diff --git a/Documentation/ABI/testing/sysfs-ptp b/Documentation/ABI/testing/sysfs-ptp
index d40d2b550502..05aeedf17794 100644
--- a/Documentation/ABI/testing/sysfs-ptp
+++ b/Documentation/ABI/testing/sysfs-ptp
@@ -19,7 +19,11 @@ Date: September 2010
19Contact: Richard Cochran <richardcochran@gmail.com> 19Contact: Richard Cochran <richardcochran@gmail.com>
20Description: 20Description:
21 This file contains the name of the PTP hardware clock 21 This file contains the name of the PTP hardware clock
22 as a human readable string. 22 as a human readable string. The purpose of this
23 attribute is to provide the user with a "friendly
24 name" and to help distinguish PHY based devices from
25 MAC based ones. The string does not necessarily have
26 to be any kind of unique id.
23 27
24What: /sys/class/ptp/ptpN/max_adjustment 28What: /sys/class/ptp/ptpN/max_adjustment
25Date: September 2010 29Date: September 2010
diff --git a/Documentation/ABI/testing/sysfs-tty b/Documentation/ABI/testing/sysfs-tty
index b138b663bf54..0c430150d929 100644
--- a/Documentation/ABI/testing/sysfs-tty
+++ b/Documentation/ABI/testing/sysfs-tty
@@ -17,3 +17,12 @@ Description:
17 device, like 'tty1'. 17 device, like 'tty1'.
18 The file supports poll() to detect virtual 18 The file supports poll() to detect virtual
19 console switches. 19 console switches.
20
21What: /sys/class/tty/ttyS0/uartclk
22Date: Sep 2012
23Contact: Tomas Hlavacek <tmshlvck@gmail.com>
24Description:
25 Shows the current uartclk value associated with the
26 UART port in serial_core, that is bound to TTY like ttyS0.
27 uartclk = 16 * baud_base
28
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index cb9258b8fd35..495e5ba1634c 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -454,6 +454,16 @@ The preferred style for long (multi-line) comments is:
454 * with beginning and ending almost-blank lines. 454 * with beginning and ending almost-blank lines.
455 */ 455 */
456 456
457For files in net/ and drivers/net/ the preferred style for long (multi-line)
458comments is a little different.
459
460 /* The preferred comment style for files in net/ and drivers/net
461 * looks like this.
462 *
463 * It is nearly the same as the generally preferred comment style,
464 * but there is no initial almost-blank line.
465 */
466
457It's also important to comment data, whether they are basic types or derived 467It's also important to comment data, whether they are basic types or derived
458types. To this end, use just one data declaration per line (no commas for 468types. To this end, use just one data declaration per line (no commas for
459multiple data declarations). This leaves you room for a small comment on each 469multiple data declarations). This leaves you room for a small comment on each
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index 196b8b9dba11..b0300529ab13 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -6,11 +6,36 @@
6 <bookinfo> 6 <bookinfo>
7 <title>Linux DRM Developer's Guide</title> 7 <title>Linux DRM Developer's Guide</title>
8 8
9 <authorgroup>
10 <author>
11 <firstname>Jesse</firstname>
12 <surname>Barnes</surname>
13 <contrib>Initial version</contrib>
14 <affiliation>
15 <orgname>Intel Corporation</orgname>
16 <address>
17 <email>jesse.barnes@intel.com</email>
18 </address>
19 </affiliation>
20 </author>
21 <author>
22 <firstname>Laurent</firstname>
23 <surname>Pinchart</surname>
24 <contrib>Driver internals</contrib>
25 <affiliation>
26 <orgname>Ideas on board SPRL</orgname>
27 <address>
28 <email>laurent.pinchart@ideasonboard.com</email>
29 </address>
30 </affiliation>
31 </author>
32 </authorgroup>
33
9 <copyright> 34 <copyright>
10 <year>2008-2009</year> 35 <year>2008-2009</year>
11 <holder> 36 <year>2012</year>
12 Intel Corporation (Jesse Barnes &lt;jesse.barnes@intel.com&gt;) 37 <holder>Intel Corporation</holder>
13 </holder> 38 <holder>Laurent Pinchart</holder>
14 </copyright> 39 </copyright>
15 40
16 <legalnotice> 41 <legalnotice>
@@ -20,6 +45,17 @@
20 the kernel source COPYING file. 45 the kernel source COPYING file.
21 </para> 46 </para>
22 </legalnotice> 47 </legalnotice>
48
49 <revhistory>
50 <!-- Put document revisions here, newest first. -->
51 <revision>
52 <revnumber>1.0</revnumber>
53 <date>2012-07-13</date>
54 <authorinitials>LP</authorinitials>
55 <revremark>Added extensive documentation about driver internals.
56 </revremark>
57 </revision>
58 </revhistory>
23 </bookinfo> 59 </bookinfo>
24 60
25<toc></toc> 61<toc></toc>
@@ -72,342 +108,361 @@
72 submission &amp; fencing, suspend/resume support, and DMA 108 submission &amp; fencing, suspend/resume support, and DMA
73 services. 109 services.
74 </para> 110 </para>
75 <para>
76 The core of every DRM driver is struct drm_driver. Drivers
77 typically statically initialize a drm_driver structure,
78 then pass it to drm_init() at load time.
79 </para>
80 111
81 <!-- Internals: driver init --> 112 <!-- Internals: driver init -->
82 113
83 <sect1> 114 <sect1>
84 <title>Driver initialization</title> 115 <title>Driver Initialization</title>
85 <para> 116 <para>
86 Before calling the DRM initialization routines, the driver must 117 At the core of every DRM driver is a <structname>drm_driver</structname>
87 first create and fill out a struct drm_driver structure. 118 structure. Drivers typically statically initialize a drm_driver structure,
88 </para> 119 and then pass it to one of the <function>drm_*_init()</function> functions
89 <programlisting> 120 to register it with the DRM subsystem.
90 static struct drm_driver driver = {
91 /* Don't use MTRRs here; the Xserver or userspace app should
92 * deal with them for Intel hardware.
93 */
94 .driver_features =
95 DRIVER_USE_AGP | DRIVER_REQUIRE_AGP |
96 DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_MODESET,
97 .load = i915_driver_load,
98 .unload = i915_driver_unload,
99 .firstopen = i915_driver_firstopen,
100 .lastclose = i915_driver_lastclose,
101 .preclose = i915_driver_preclose,
102 .save = i915_save,
103 .restore = i915_restore,
104 .device_is_agp = i915_driver_device_is_agp,
105 .get_vblank_counter = i915_get_vblank_counter,
106 .enable_vblank = i915_enable_vblank,
107 .disable_vblank = i915_disable_vblank,
108 .irq_preinstall = i915_driver_irq_preinstall,
109 .irq_postinstall = i915_driver_irq_postinstall,
110 .irq_uninstall = i915_driver_irq_uninstall,
111 .irq_handler = i915_driver_irq_handler,
112 .reclaim_buffers = drm_core_reclaim_buffers,
113 .get_map_ofs = drm_core_get_map_ofs,
114 .get_reg_ofs = drm_core_get_reg_ofs,
115 .fb_probe = intelfb_probe,
116 .fb_remove = intelfb_remove,
117 .fb_resize = intelfb_resize,
118 .master_create = i915_master_create,
119 .master_destroy = i915_master_destroy,
120#if defined(CONFIG_DEBUG_FS)
121 .debugfs_init = i915_debugfs_init,
122 .debugfs_cleanup = i915_debugfs_cleanup,
123#endif
124 .gem_init_object = i915_gem_init_object,
125 .gem_free_object = i915_gem_free_object,
126 .gem_vm_ops = &amp;i915_gem_vm_ops,
127 .ioctls = i915_ioctls,
128 .fops = {
129 .owner = THIS_MODULE,
130 .open = drm_open,
131 .release = drm_release,
132 .ioctl = drm_ioctl,
133 .mmap = drm_mmap,
134 .poll = drm_poll,
135 .fasync = drm_fasync,
136#ifdef CONFIG_COMPAT
137 .compat_ioctl = i915_compat_ioctl,
138#endif
139 .llseek = noop_llseek,
140 },
141 .pci_driver = {
142 .name = DRIVER_NAME,
143 .id_table = pciidlist,
144 .probe = probe,
145 .remove = __devexit_p(drm_cleanup_pci),
146 },
147 .name = DRIVER_NAME,
148 .desc = DRIVER_DESC,
149 .date = DRIVER_DATE,
150 .major = DRIVER_MAJOR,
151 .minor = DRIVER_MINOR,
152 .patchlevel = DRIVER_PATCHLEVEL,
153 };
154 </programlisting>
155 <para>
156 In the example above, taken from the i915 DRM driver, the driver
157 sets several flags indicating what core features it supports;
158 we go over the individual callbacks in later sections. Since
159 flags indicate which features your driver supports to the DRM
160 core, you need to set most of them prior to calling drm_init(). Some,
161 like DRIVER_MODESET can be set later based on user supplied parameters,
162 but that's the exception rather than the rule.
163 </para>
164 <variablelist>
165 <title>Driver flags</title>
166 <varlistentry>
167 <term>DRIVER_USE_AGP</term>
168 <listitem><para>
169 Driver uses AGP interface
170 </para></listitem>
171 </varlistentry>
172 <varlistentry>
173 <term>DRIVER_REQUIRE_AGP</term>
174 <listitem><para>
175 Driver needs AGP interface to function.
176 </para></listitem>
177 </varlistentry>
178 <varlistentry>
179 <term>DRIVER_USE_MTRR</term>
180 <listitem>
181 <para>
182 Driver uses MTRR interface for mapping memory. Deprecated.
183 </para>
184 </listitem>
185 </varlistentry>
186 <varlistentry>
187 <term>DRIVER_PCI_DMA</term>
188 <listitem><para>
189 Driver is capable of PCI DMA. Deprecated.
190 </para></listitem>
191 </varlistentry>
192 <varlistentry>
193 <term>DRIVER_SG</term>
194 <listitem><para>
195 Driver can perform scatter/gather DMA. Deprecated.
196 </para></listitem>
197 </varlistentry>
198 <varlistentry>
199 <term>DRIVER_HAVE_DMA</term>
200 <listitem><para>Driver supports DMA. Deprecated.</para></listitem>
201 </varlistentry>
202 <varlistentry>
203 <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term>
204 <listitem>
205 <para>
206 DRIVER_HAVE_IRQ indicates whether the driver has an IRQ
207 handler. DRIVER_IRQ_SHARED indicates whether the device &amp;
208 handler support shared IRQs (note that this is required of
209 PCI drivers).
210 </para>
211 </listitem>
212 </varlistentry>
213 <varlistentry>
214 <term>DRIVER_DMA_QUEUE</term>
215 <listitem>
216 <para>
217 Should be set if the driver queues DMA requests and completes them
218 asynchronously. Deprecated.
219 </para>
220 </listitem>
221 </varlistentry>
222 <varlistentry>
223 <term>DRIVER_FB_DMA</term>
224 <listitem>
225 <para>
226 Driver supports DMA to/from the framebuffer. Deprecated.
227 </para>
228 </listitem>
229 </varlistentry>
230 <varlistentry>
231 <term>DRIVER_MODESET</term>
232 <listitem>
233 <para>
234 Driver supports mode setting interfaces.
235 </para>
236 </listitem>
237 </varlistentry>
238 </variablelist>
239 <para>
240 In this specific case, the driver requires AGP and supports
241 IRQs. DMA, as discussed later, is handled by device-specific ioctls
242 in this case. It also supports the kernel mode setting APIs, though
243 unlike in the actual i915 driver source, this example unconditionally
244 exports KMS capability.
245 </para> 121 </para>
246 </sect1> 122 <para>
247 123 The <structname>drm_driver</structname> structure contains static
248 <!-- Internals: driver load --> 124 information that describes the driver and features it supports, and
249 125 pointers to methods that the DRM core will call to implement the DRM API.
250 <sect1> 126 We will first go through the <structname>drm_driver</structname> static
251 <title>Driver load</title> 127 information fields, and will then describe individual operations in
252 <para> 128 details as they get used in later sections.
253 In the previous section, we saw what a typical drm_driver
254 structure might look like. One of the more important fields in
255 the structure is the hook for the load function.
256 </para>
257 <programlisting>
258 static struct drm_driver driver = {
259 ...
260 .load = i915_driver_load,
261 ...
262 };
263 </programlisting>
264 <para>
265 The load function has many responsibilities: allocating a driver
266 private structure, specifying supported performance counters,
267 configuring the device (e.g. mapping registers &amp; command
268 buffers), initializing the memory manager, and setting up the
269 initial output configuration.
270 </para>
271 <para>
272 If compatibility is a concern (e.g. with drivers converted over
273 to the new interfaces from the old ones), care must be taken to
274 prevent device initialization and control that is incompatible with
275 currently active userspace drivers. For instance, if user
276 level mode setting drivers are in use, it would be problematic
277 to perform output discovery &amp; configuration at load time.
278 Likewise, if user-level drivers unaware of memory management are
279 in use, memory management and command buffer setup may need to
280 be omitted. These requirements are driver-specific, and care
281 needs to be taken to keep both old and new applications and
282 libraries working. The i915 driver supports the "modeset"
283 module parameter to control whether advanced features are
284 enabled at load time or in legacy fashion.
285 </para> 129 </para>
286
287 <sect2> 130 <sect2>
288 <title>Driver private &amp; performance counters</title> 131 <title>Driver Information</title>
289 <para> 132 <sect3>
290 The driver private hangs off the main drm_device structure and 133 <title>Driver Features</title>
291 can be used for tracking various device-specific bits of 134 <para>
292 information, like register offsets, command buffer status, 135 Drivers inform the DRM core about their requirements and supported
293 register state for suspend/resume, etc. At load time, a 136 features by setting appropriate flags in the
294 driver may simply allocate one and set drm_device.dev_priv 137 <structfield>driver_features</structfield> field. Since those flags
295 appropriately; it should be freed and drm_device.dev_priv set 138 influence the DRM core behaviour since registration time, most of them
296 to NULL when the driver is unloaded. 139 must be set to registering the <structname>drm_driver</structname>
297 </para> 140 instance.
141 </para>
142 <synopsis>u32 driver_features;</synopsis>
143 <variablelist>
144 <title>Driver Feature Flags</title>
145 <varlistentry>
146 <term>DRIVER_USE_AGP</term>
147 <listitem><para>
148 Driver uses AGP interface, the DRM core will manage AGP resources.
149 </para></listitem>
150 </varlistentry>
151 <varlistentry>
152 <term>DRIVER_REQUIRE_AGP</term>
153 <listitem><para>
154 Driver needs AGP interface to function. AGP initialization failure
155 will become a fatal error.
156 </para></listitem>
157 </varlistentry>
158 <varlistentry>
159 <term>DRIVER_USE_MTRR</term>
160 <listitem><para>
161 Driver uses MTRR interface for mapping memory, the DRM core will
162 manage MTRR resources. Deprecated.
163 </para></listitem>
164 </varlistentry>
165 <varlistentry>
166 <term>DRIVER_PCI_DMA</term>
167 <listitem><para>
168 Driver is capable of PCI DMA, mapping of PCI DMA buffers to
169 userspace will be enabled. Deprecated.
170 </para></listitem>
171 </varlistentry>
172 <varlistentry>
173 <term>DRIVER_SG</term>
174 <listitem><para>
175 Driver can perform scatter/gather DMA, allocation and mapping of
176 scatter/gather buffers will be enabled. Deprecated.
177 </para></listitem>
178 </varlistentry>
179 <varlistentry>
180 <term>DRIVER_HAVE_DMA</term>
181 <listitem><para>
182 Driver supports DMA, the userspace DMA API will be supported.
183 Deprecated.
184 </para></listitem>
185 </varlistentry>
186 <varlistentry>
187 <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term>
188 <listitem><para>
189 DRIVER_HAVE_IRQ indicates whether the driver has an IRQ handler. The
190 DRM core will automatically register an interrupt handler when the
191 flag is set. DRIVER_IRQ_SHARED indicates whether the device &amp;
192 handler support shared IRQs (note that this is required of PCI
193 drivers).
194 </para></listitem>
195 </varlistentry>
196 <varlistentry>
197 <term>DRIVER_IRQ_VBL</term>
198 <listitem><para>Unused. Deprecated.</para></listitem>
199 </varlistentry>
200 <varlistentry>
201 <term>DRIVER_DMA_QUEUE</term>
202 <listitem><para>
203 Should be set if the driver queues DMA requests and completes them
204 asynchronously. Deprecated.
205 </para></listitem>
206 </varlistentry>
207 <varlistentry>
208 <term>DRIVER_FB_DMA</term>
209 <listitem><para>
210 Driver supports DMA to/from the framebuffer, mapping of frambuffer
211 DMA buffers to userspace will be supported. Deprecated.
212 </para></listitem>
213 </varlistentry>
214 <varlistentry>
215 <term>DRIVER_IRQ_VBL2</term>
216 <listitem><para>Unused. Deprecated.</para></listitem>
217 </varlistentry>
218 <varlistentry>
219 <term>DRIVER_GEM</term>
220 <listitem><para>
221 Driver use the GEM memory manager.
222 </para></listitem>
223 </varlistentry>
224 <varlistentry>
225 <term>DRIVER_MODESET</term>
226 <listitem><para>
227 Driver supports mode setting interfaces (KMS).
228 </para></listitem>
229 </varlistentry>
230 <varlistentry>
231 <term>DRIVER_PRIME</term>
232 <listitem><para>
233 Driver implements DRM PRIME buffer sharing.
234 </para></listitem>
235 </varlistentry>
236 </variablelist>
237 </sect3>
238 <sect3>
239 <title>Major, Minor and Patchlevel</title>
240 <synopsis>int major;
241int minor;
242int patchlevel;</synopsis>
243 <para>
244 The DRM core identifies driver versions by a major, minor and patch
245 level triplet. The information is printed to the kernel log at
246 initialization time and passed to userspace through the
247 DRM_IOCTL_VERSION ioctl.
248 </para>
249 <para>
250 The major and minor numbers are also used to verify the requested driver
251 API version passed to DRM_IOCTL_SET_VERSION. When the driver API changes
252 between minor versions, applications can call DRM_IOCTL_SET_VERSION to
253 select a specific version of the API. If the requested major isn't equal
254 to the driver major, or the requested minor is larger than the driver
255 minor, the DRM_IOCTL_SET_VERSION call will return an error. Otherwise
256 the driver's set_version() method will be called with the requested
257 version.
258 </para>
259 </sect3>
260 <sect3>
261 <title>Name, Description and Date</title>
262 <synopsis>char *name;
263char *desc;
264char *date;</synopsis>
265 <para>
266 The driver name is printed to the kernel log at initialization time,
267 used for IRQ registration and passed to userspace through
268 DRM_IOCTL_VERSION.
269 </para>
270 <para>
271 The driver description is a purely informative string passed to
272 userspace through the DRM_IOCTL_VERSION ioctl and otherwise unused by
273 the kernel.
274 </para>
275 <para>
276 The driver date, formatted as YYYYMMDD, is meant to identify the date of
277 the latest modification to the driver. However, as most drivers fail to
278 update it, its value is mostly useless. The DRM core prints it to the
279 kernel log at initialization time and passes it to userspace through the
280 DRM_IOCTL_VERSION ioctl.
281 </para>
282 </sect3>
283 </sect2>
284 <sect2>
285 <title>Driver Load</title>
298 <para> 286 <para>
299 The DRM supports several counters which may be used for rough 287 The <methodname>load</methodname> method is the driver and device
300 performance characterization. Note that the DRM stat counter 288 initialization entry point. The method is responsible for allocating and
301 system is not often used by applications, and supporting 289 initializing driver private data, specifying supported performance
302 additional counters is completely optional. 290 counters, performing resource allocation and mapping (e.g. acquiring
291 clocks, mapping registers or allocating command buffers), initializing
292 the memory manager (<xref linkend="drm-memory-management"/>), installing
293 the IRQ handler (<xref linkend="drm-irq-registration"/>), setting up
294 vertical blanking handling (<xref linkend="drm-vertical-blank"/>), mode
295 setting (<xref linkend="drm-mode-setting"/>) and initial output
296 configuration (<xref linkend="drm-kms-init"/>).
303 </para> 297 </para>
298 <note><para>
299 If compatibility is a concern (e.g. with drivers converted over from
300 User Mode Setting to Kernel Mode Setting), care must be taken to prevent
301 device initialization and control that is incompatible with currently
302 active userspace drivers. For instance, if user level mode setting
303 drivers are in use, it would be problematic to perform output discovery
304 &amp; configuration at load time. Likewise, if user-level drivers
305 unaware of memory management are in use, memory management and command
306 buffer setup may need to be omitted. These requirements are
307 driver-specific, and care needs to be taken to keep both old and new
308 applications and libraries working.
309 </para></note>
310 <synopsis>int (*load) (struct drm_device *, unsigned long flags);</synopsis>
304 <para> 311 <para>
305 These interfaces are deprecated and should not be used. If performance 312 The method takes two arguments, a pointer to the newly created
306 monitoring is desired, the developer should investigate and 313 <structname>drm_device</structname> and flags. The flags are used to
307 potentially enhance the kernel perf and tracing infrastructure to export 314 pass the <structfield>driver_data</structfield> field of the device id
308 GPU related performance information for consumption by performance 315 corresponding to the device passed to <function>drm_*_init()</function>.
309 monitoring tools and applications. 316 Only PCI devices currently use this, USB and platform DRM drivers have
317 their <methodname>load</methodname> method called with flags to 0.
310 </para> 318 </para>
319 <sect3>
320 <title>Driver Private &amp; Performance Counters</title>
321 <para>
322 The driver private hangs off the main
323 <structname>drm_device</structname> structure and can be used for
324 tracking various device-specific bits of information, like register
325 offsets, command buffer status, register state for suspend/resume, etc.
326 At load time, a driver may simply allocate one and set
327 <structname>drm_device</structname>.<structfield>dev_priv</structfield>
328 appropriately; it should be freed and
329 <structname>drm_device</structname>.<structfield>dev_priv</structfield>
330 set to NULL when the driver is unloaded.
331 </para>
332 <para>
333 DRM supports several counters which were used for rough performance
334 characterization. This stat counter system is deprecated and should not
335 be used. If performance monitoring is desired, the developer should
336 investigate and potentially enhance the kernel perf and tracing
337 infrastructure to export GPU related performance information for
338 consumption by performance monitoring tools and applications.
339 </para>
340 </sect3>
341 <sect3 id="drm-irq-registration">
342 <title>IRQ Registration</title>
343 <para>
344 The DRM core tries to facilitate IRQ handler registration and
345 unregistration by providing <function>drm_irq_install</function> and
346 <function>drm_irq_uninstall</function> functions. Those functions only
347 support a single interrupt per device.
348 </para>
349 <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install-->
350 <para>
351 Both functions get the device IRQ by calling
352 <function>drm_dev_to_irq</function>. This inline function will call a
353 bus-specific operation to retrieve the IRQ number. For platform devices,
354 <function>platform_get_irq</function>(..., 0) is used to retrieve the
355 IRQ number.
356 </para>
357 <para>
358 <function>drm_irq_install</function> starts by calling the
359 <methodname>irq_preinstall</methodname> driver operation. The operation
360 is optional and must make sure that the interrupt will not get fired by
361 clearing all pending interrupt flags or disabling the interrupt.
362 </para>
363 <para>
364 The IRQ will then be requested by a call to
365 <function>request_irq</function>. If the DRIVER_IRQ_SHARED driver
366 feature flag is set, a shared (IRQF_SHARED) IRQ handler will be
367 requested.
368 </para>
369 <para>
370 The IRQ handler function must be provided as the mandatory irq_handler
371 driver operation. It will get passed directly to
372 <function>request_irq</function> and thus has the same prototype as all
373 IRQ handlers. It will get called with a pointer to the DRM device as the
374 second argument.
375 </para>
376 <para>
377 Finally the function calls the optional
378 <methodname>irq_postinstall</methodname> driver operation. The operation
379 usually enables interrupts (excluding the vblank interrupt, which is
380 enabled separately), but drivers may choose to enable/disable interrupts
381 at a different time.
382 </para>
383 <para>
384 <function>drm_irq_uninstall</function> is similarly used to uninstall an
385 IRQ handler. It starts by waking up all processes waiting on a vblank
386 interrupt to make sure they don't hang, and then calls the optional
387 <methodname>irq_uninstall</methodname> driver operation. The operation
388 must disable all hardware interrupts. Finally the function frees the IRQ
389 by calling <function>free_irq</function>.
390 </para>
391 </sect3>
392 <sect3>
393 <title>Memory Manager Initialization</title>
394 <para>
395 Every DRM driver requires a memory manager which must be initialized at
396 load time. DRM currently contains two memory managers, the Translation
397 Table Manager (TTM) and the Graphics Execution Manager (GEM).
398 This document describes the use of the GEM memory manager only. See
399 <xref linkend="drm-memory-management"/> for details.
400 </para>
401 </sect3>
402 <sect3>
403 <title>Miscellaneous Device Configuration</title>
404 <para>
405 Another task that may be necessary for PCI devices during configuration
406 is mapping the video BIOS. On many devices, the VBIOS describes device
407 configuration, LCD panel timings (if any), and contains flags indicating
408 device state. Mapping the BIOS can be done using the pci_map_rom() call,
409 a convenience function that takes care of mapping the actual ROM,
410 whether it has been shadowed into memory (typically at address 0xc0000)
411 or exists on the PCI device in the ROM BAR. Note that after the ROM has
412 been mapped and any necessary information has been extracted, it should
413 be unmapped; on many devices, the ROM address decoder is shared with
414 other BARs, so leaving it mapped could cause undesired behaviour like
415 hangs or memory corruption.
416 <!--!Fdrivers/pci/rom.c pci_map_rom-->
417 </para>
418 </sect3>
311 </sect2> 419 </sect2>
420 </sect1>
312 421
313 <sect2> 422 <!-- Internals: memory management -->
314 <title>Configuring the device</title>
315 <para>
316 Obviously, device configuration is device-specific.
317 However, there are several common operations: finding a
318 device's PCI resources, mapping them, and potentially setting
319 up an IRQ handler.
320 </para>
321 <para>
322 Finding &amp; mapping resources is fairly straightforward. The
323 DRM wrapper functions, drm_get_resource_start() and
324 drm_get_resource_len(), may be used to find BARs on the given
325 drm_device struct. Once those values have been retrieved, the
326 driver load function can call drm_addmap() to create a new
327 mapping for the BAR in question. Note that you probably want a
328 drm_local_map_t in your driver private structure to track any
329 mappings you create.
330<!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* -->
331<!-- !Finclude/drm/drmP.h drm_local_map_t -->
332 </para>
333 <para>
334 if compatibility with other operating systems isn't a concern
335 (DRM drivers can run under various BSD variants and OpenSolaris),
336 native Linux calls may be used for the above, e.g. pci_resource_*
337 and iomap*/iounmap. See the Linux device driver book for more
338 info.
339 </para>
340 <para>
341 Once you have a register map, you may use the DRM_READn() and
342 DRM_WRITEn() macros to access the registers on your device, or
343 use driver-specific versions to offset into your MMIO space
344 relative to a driver-specific base pointer (see I915_READ for
345 an example).
346 </para>
347 <para>
348 If your device supports interrupt generation, you may want to
349 set up an interrupt handler when the driver is loaded. This
350 is done using the drm_irq_install() function. If your device
351 supports vertical blank interrupts, it should call
352 drm_vblank_init() to initialize the core vblank handling code before
353 enabling interrupts on your device. This ensures the vblank related
354 structures are allocated and allows the core to handle vblank events.
355 </para>
356<!--!Fdrivers/char/drm/drm_irq.c drm_irq_install-->
357 <para>
358 Once your interrupt handler is registered (it uses your
359 drm_driver.irq_handler as the actual interrupt handling
360 function), you can safely enable interrupts on your device,
361 assuming any other state your interrupt handler uses is also
362 initialized.
363 </para>
364 <para>
365 Another task that may be necessary during configuration is
366 mapping the video BIOS. On many devices, the VBIOS describes
367 device configuration, LCD panel timings (if any), and contains
368 flags indicating device state. Mapping the BIOS can be done
369 using the pci_map_rom() call, a convenience function that
370 takes care of mapping the actual ROM, whether it has been
371 shadowed into memory (typically at address 0xc0000) or exists
372 on the PCI device in the ROM BAR. Note that after the ROM
373 has been mapped and any necessary information has been extracted,
374 it should be unmapped; on many devices, the ROM address decoder is
375 shared with other BARs, so leaving it mapped could cause
376 undesired behavior like hangs or memory corruption.
377<!--!Fdrivers/pci/rom.c pci_map_rom-->
378 </para>
379 </sect2>
380 423
424 <sect1 id="drm-memory-management">
425 <title>Memory management</title>
426 <para>
427 Modern Linux systems require large amount of graphics memory to store
428 frame buffers, textures, vertices and other graphics-related data. Given
429 the very dynamic nature of many of that data, managing graphics memory
430 efficiently is thus crucial for the graphics stack and plays a central
431 role in the DRM infrastructure.
432 </para>
433 <para>
434 The DRM core includes two memory managers, namely Translation Table Maps
435 (TTM) and Graphics Execution Manager (GEM). TTM was the first DRM memory
436 manager to be developed and tried to be a one-size-fits-them all
437 solution. It provides a single userspace API to accomodate the need of
438 all hardware, supporting both Unified Memory Architecture (UMA) devices
439 and devices with dedicated video RAM (i.e. most discrete video cards).
440 This resulted in a large, complex piece of code that turned out to be
441 hard to use for driver development.
442 </para>
443 <para>
444 GEM started as an Intel-sponsored project in reaction to TTM's
445 complexity. Its design philosophy is completely different: instead of
446 providing a solution to every graphics memory-related problems, GEM
447 identified common code between drivers and created a support library to
448 share it. GEM has simpler initialization and execution requirements than
449 TTM, but has no video RAM management capabitilies and is thus limited to
450 UMA devices.
451 </para>
381 <sect2> 452 <sect2>
382 <title>Memory manager initialization</title> 453 <title>The Translation Table Manager (TTM)</title>
383 <para>
384 In order to allocate command buffers, cursor memory, scanout
385 buffers, etc., as well as support the latest features provided
386 by packages like Mesa and the X.Org X server, your driver
387 should support a memory manager.
388 </para>
389 <para> 454 <para>
390 If your driver supports memory management (it should!), you 455 TTM design background and information belongs here.
391 need to set that up at load time as well. How you initialize
392 it depends on which memory manager you're using: TTM or GEM.
393 </para> 456 </para>
394 <sect3> 457 <sect3>
395 <title>TTM initialization</title> 458 <title>TTM initialization</title>
396 <para> 459 <warning><para>This section is outdated.</para></warning>
397 TTM (for Translation Table Manager) manages video memory and 460 <para>
398 aperture space for graphics devices. TTM supports both UMA devices 461 Drivers wishing to support TTM must fill out a drm_bo_driver
399 and devices with dedicated video RAM (VRAM), i.e. most discrete 462 structure. The structure contains several fields with function
400 graphics devices. If your device has dedicated RAM, supporting 463 pointers for initializing the TTM, allocating and freeing memory,
401 TTM is desirable. TTM also integrates tightly with your 464 waiting for command completion and fence synchronization, and memory
402 driver-specific buffer execution function. See the radeon 465 migration. See the radeon_ttm.c file for an example of usage.
403 driver for examples.
404 </para>
405 <para>
406 The core TTM structure is the ttm_bo_driver struct. It contains
407 several fields with function pointers for initializing the TTM,
408 allocating and freeing memory, waiting for command completion
409 and fence synchronization, and memory migration. See the
410 radeon_ttm.c file for an example of usage.
411 </para> 466 </para>
412 <para> 467 <para>
413 The ttm_global_reference structure is made up of several fields: 468 The ttm_global_reference structure is made up of several fields:
@@ -445,82 +500,1081 @@
445 count for the TTM, which will call your initialization function. 500 count for the TTM, which will call your initialization function.
446 </para> 501 </para>
447 </sect3> 502 </sect3>
503 </sect2>
504 <sect2 id="drm-gem">
505 <title>The Graphics Execution Manager (GEM)</title>
506 <para>
507 The GEM design approach has resulted in a memory manager that doesn't
508 provide full coverage of all (or even all common) use cases in its
509 userspace or kernel API. GEM exposes a set of standard memory-related
510 operations to userspace and a set of helper functions to drivers, and let
511 drivers implement hardware-specific operations with their own private API.
512 </para>
513 <para>
514 The GEM userspace API is described in the
515 <ulink url="http://lwn.net/Articles/283798/"><citetitle>GEM - the Graphics
516 Execution Manager</citetitle></ulink> article on LWN. While slightly
517 outdated, the document provides a good overview of the GEM API principles.
518 Buffer allocation and read and write operations, described as part of the
519 common GEM API, are currently implemented using driver-specific ioctls.
520 </para>
521 <para>
522 GEM is data-agnostic. It manages abstract buffer objects without knowing
523 what individual buffers contain. APIs that require knowledge of buffer
524 contents or purpose, such as buffer allocation or synchronization
525 primitives, are thus outside of the scope of GEM and must be implemented
526 using driver-specific ioctls.
527 </para>
528 <para>
529 On a fundamental level, GEM involves several operations:
530 <itemizedlist>
531 <listitem>Memory allocation and freeing</listitem>
532 <listitem>Command execution</listitem>
533 <listitem>Aperture management at command execution time</listitem>
534 </itemizedlist>
535 Buffer object allocation is relatively straightforward and largely
536 provided by Linux's shmem layer, which provides memory to back each
537 object.
538 </para>
539 <para>
540 Device-specific operations, such as command execution, pinning, buffer
541 read &amp; write, mapping, and domain ownership transfers are left to
542 driver-specific ioctls.
543 </para>
544 <sect3>
545 <title>GEM Initialization</title>
546 <para>
547 Drivers that use GEM must set the DRIVER_GEM bit in the struct
548 <structname>drm_driver</structname>
549 <structfield>driver_features</structfield> field. The DRM core will
550 then automatically initialize the GEM core before calling the
551 <methodname>load</methodname> operation. Behind the scene, this will
552 create a DRM Memory Manager object which provides an address space
553 pool for object allocation.
554 </para>
555 <para>
556 In a KMS configuration, drivers need to allocate and initialize a
557 command ring buffer following core GEM initialization if required by
558 the hardware. UMA devices usually have what is called a "stolen"
559 memory region, which provides space for the initial framebuffer and
560 large, contiguous memory regions required by the device. This space is
561 typically not managed by GEM, and must be initialized separately into
562 its own DRM MM object.
563 </para>
564 </sect3>
448 <sect3> 565 <sect3>
449 <title>GEM initialization</title> 566 <title>GEM Objects Creation</title>
450 <para> 567 <para>
451 GEM is an alternative to TTM, designed specifically for UMA 568 GEM splits creation of GEM objects and allocation of the memory that
452 devices. It has simpler initialization and execution requirements 569 backs them in two distinct operations.
453 than TTM, but has no VRAM management capability. Core GEM 570 </para>
454 is initialized by calling drm_mm_init() to create 571 <para>
455 a GTT DRM MM object, which provides an address space pool for 572 GEM objects are represented by an instance of struct
456 object allocation. In a KMS configuration, the driver 573 <structname>drm_gem_object</structname>. Drivers usually need to extend
457 needs to allocate and initialize a command ring buffer following 574 GEM objects with private information and thus create a driver-specific
458 core GEM initialization. A UMA device usually has what is called a 575 GEM object structure type that embeds an instance of struct
459 "stolen" memory region, which provides space for the initial 576 <structname>drm_gem_object</structname>.
460 framebuffer and large, contiguous memory regions required by the 577 </para>
461 device. This space is not typically managed by GEM, and it must 578 <para>
462 be initialized separately into its own DRM MM object. 579 To create a GEM object, a driver allocates memory for an instance of its
463 </para> 580 specific GEM object type and initializes the embedded struct
464 <para> 581 <structname>drm_gem_object</structname> with a call to
465 Initialization is driver-specific. In the case of Intel 582 <function>drm_gem_object_init</function>. The function takes a pointer to
466 integrated graphics chips like 965GM, GEM initialization can 583 the DRM device, a pointer to the GEM object and the buffer object size
467 be done by calling the internal GEM init function, 584 in bytes.
468 i915_gem_do_init(). Since the 965GM is a UMA device 585 </para>
469 (i.e. it doesn't have dedicated VRAM), GEM manages 586 <para>
470 making regular RAM available for GPU operations. Memory set 587 GEM uses shmem to allocate anonymous pageable memory.
471 aside by the BIOS (called "stolen" memory by the i915 588 <function>drm_gem_object_init</function> will create an shmfs file of
472 driver) is managed by the DRM memrange allocator; the 589 the requested size and store it into the struct
473 rest of the aperture is managed by GEM. 590 <structname>drm_gem_object</structname> <structfield>filp</structfield>
474 <programlisting> 591 field. The memory is used as either main storage for the object when the
475 /* Basic memrange allocator for stolen space (aka vram) */ 592 graphics hardware uses system memory directly or as a backing store
476 drm_memrange_init(&amp;dev_priv->vram, 0, prealloc_size); 593 otherwise.
477 /* Let GEM Manage from end of prealloc space to end of aperture */ 594 </para>
478 i915_gem_do_init(dev, prealloc_size, agp_size); 595 <para>
479 </programlisting> 596 Drivers are responsible for the actual physical pages allocation by
480<!--!Edrivers/char/drm/drm_memrange.c--> 597 calling <function>shmem_read_mapping_page_gfp</function> for each page.
481 </para> 598 Note that they can decide to allocate pages when initializing the GEM
482 <para> 599 object, or to delay allocation until the memory is needed (for instance
483 Once the memory manager has been set up, we may allocate the 600 when a page fault occurs as a result of a userspace memory access or
484 command buffer. In the i915 case, this is also done with a 601 when the driver needs to start a DMA transfer involving the memory).
485 GEM function, i915_gem_init_ringbuffer(). 602 </para>
486 </para> 603 <para>
604 Anonymous pageable memory allocation is not always desired, for instance
605 when the hardware requires physically contiguous system memory as is
606 often the case in embedded devices. Drivers can create GEM objects with
607 no shmfs backing (called private GEM objects) by initializing them with
608 a call to <function>drm_gem_private_object_init</function> instead of
609 <function>drm_gem_object_init</function>. Storage for private GEM
610 objects must be managed by drivers.
611 </para>
612 <para>
613 Drivers that do not need to extend GEM objects with private information
614 can call the <function>drm_gem_object_alloc</function> function to
615 allocate and initialize a struct <structname>drm_gem_object</structname>
616 instance. The GEM core will call the optional driver
617 <methodname>gem_init_object</methodname> operation after initializing
618 the GEM object with <function>drm_gem_object_init</function>.
619 <synopsis>int (*gem_init_object) (struct drm_gem_object *obj);</synopsis>
620 </para>
621 <para>
622 No alloc-and-init function exists for private GEM objects.
623 </para>
624 </sect3>
625 <sect3>
626 <title>GEM Objects Lifetime</title>
627 <para>
628 All GEM objects are reference-counted by the GEM core. References can be
629 acquired and release by <function>calling drm_gem_object_reference</function>
630 and <function>drm_gem_object_unreference</function> respectively. The
631 caller must hold the <structname>drm_device</structname>
632 <structfield>struct_mutex</structfield> lock. As a convenience, GEM
633 provides the <function>drm_gem_object_reference_unlocked</function> and
634 <function>drm_gem_object_unreference_unlocked</function> functions that
635 can be called without holding the lock.
636 </para>
637 <para>
638 When the last reference to a GEM object is released the GEM core calls
639 the <structname>drm_driver</structname>
640 <methodname>gem_free_object</methodname> operation. That operation is
641 mandatory for GEM-enabled drivers and must free the GEM object and all
642 associated resources.
643 </para>
644 <para>
645 <synopsis>void (*gem_free_object) (struct drm_gem_object *obj);</synopsis>
646 Drivers are responsible for freeing all GEM object resources, including
647 the resources created by the GEM core. If an mmap offset has been
648 created for the object (in which case
649 <structname>drm_gem_object</structname>::<structfield>map_list</structfield>::<structfield>map</structfield>
650 is not NULL) it must be freed by a call to
651 <function>drm_gem_free_mmap_offset</function>. The shmfs backing store
652 must be released by calling <function>drm_gem_object_release</function>
653 (that function can safely be called if no shmfs backing store has been
654 created).
655 </para>
656 </sect3>
657 <sect3>
658 <title>GEM Objects Naming</title>
659 <para>
660 Communication between userspace and the kernel refers to GEM objects
661 using local handles, global names or, more recently, file descriptors.
662 All of those are 32-bit integer values; the usual Linux kernel limits
663 apply to the file descriptors.
664 </para>
665 <para>
666 GEM handles are local to a DRM file. Applications get a handle to a GEM
667 object through a driver-specific ioctl, and can use that handle to refer
668 to the GEM object in other standard or driver-specific ioctls. Closing a
669 DRM file handle frees all its GEM handles and dereferences the
670 associated GEM objects.
671 </para>
672 <para>
673 To create a handle for a GEM object drivers call
674 <function>drm_gem_handle_create</function>. The function takes a pointer
675 to the DRM file and the GEM object and returns a locally unique handle.
676 When the handle is no longer needed drivers delete it with a call to
677 <function>drm_gem_handle_delete</function>. Finally the GEM object
678 associated with a handle can be retrieved by a call to
679 <function>drm_gem_object_lookup</function>.
680 </para>
681 <para>
682 Handles don't take ownership of GEM objects, they only take a reference
683 to the object that will be dropped when the handle is destroyed. To
684 avoid leaking GEM objects, drivers must make sure they drop the
685 reference(s) they own (such as the initial reference taken at object
686 creation time) as appropriate, without any special consideration for the
687 handle. For example, in the particular case of combined GEM object and
688 handle creation in the implementation of the
689 <methodname>dumb_create</methodname> operation, drivers must drop the
690 initial reference to the GEM object before returning the handle.
691 </para>
692 <para>
693 GEM names are similar in purpose to handles but are not local to DRM
694 files. They can be passed between processes to reference a GEM object
695 globally. Names can't be used directly to refer to objects in the DRM
696 API, applications must convert handles to names and names to handles
697 using the DRM_IOCTL_GEM_FLINK and DRM_IOCTL_GEM_OPEN ioctls
698 respectively. The conversion is handled by the DRM core without any
699 driver-specific support.
700 </para>
701 <para>
702 Similar to global names, GEM file descriptors are also used to share GEM
703 objects across processes. They offer additional security: as file
704 descriptors must be explictly sent over UNIX domain sockets to be shared
705 between applications, they can't be guessed like the globally unique GEM
706 names.
707 </para>
708 <para>
709 Drivers that support GEM file descriptors, also known as the DRM PRIME
710 API, must set the DRIVER_PRIME bit in the struct
711 <structname>drm_driver</structname>
712 <structfield>driver_features</structfield> field, and implement the
713 <methodname>prime_handle_to_fd</methodname> and
714 <methodname>prime_fd_to_handle</methodname> operations.
715 </para>
716 <para>
717 <synopsis>int (*prime_handle_to_fd)(struct drm_device *dev,
718 struct drm_file *file_priv, uint32_t handle,
719 uint32_t flags, int *prime_fd);
720 int (*prime_fd_to_handle)(struct drm_device *dev,
721 struct drm_file *file_priv, int prime_fd,
722 uint32_t *handle);</synopsis>
723 Those two operations convert a handle to a PRIME file descriptor and
724 vice versa. Drivers must use the kernel dma-buf buffer sharing framework
725 to manage the PRIME file descriptors.
726 </para>
727 <para>
728 While non-GEM drivers must implement the operations themselves, GEM
729 drivers must use the <function>drm_gem_prime_handle_to_fd</function>
730 and <function>drm_gem_prime_fd_to_handle</function> helper functions.
731 Those helpers rely on the driver
732 <methodname>gem_prime_export</methodname> and
733 <methodname>gem_prime_import</methodname> operations to create a dma-buf
734 instance from a GEM object (dma-buf exporter role) and to create a GEM
735 object from a dma-buf instance (dma-buf importer role).
736 </para>
737 <para>
738 <synopsis>struct dma_buf * (*gem_prime_export)(struct drm_device *dev,
739 struct drm_gem_object *obj,
740 int flags);
741 struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
742 struct dma_buf *dma_buf);</synopsis>
743 These two operations are mandatory for GEM drivers that support DRM
744 PRIME.
745 </para>
746 </sect3>
747 <sect3 id="drm-gem-objects-mapping">
748 <title>GEM Objects Mapping</title>
749 <para>
750 Because mapping operations are fairly heavyweight GEM favours
751 read/write-like access to buffers, implemented through driver-specific
752 ioctls, over mapping buffers to userspace. However, when random access
753 to the buffer is needed (to perform software rendering for instance),
754 direct access to the object can be more efficient.
755 </para>
756 <para>
757 The mmap system call can't be used directly to map GEM objects, as they
758 don't have their own file handle. Two alternative methods currently
759 co-exist to map GEM objects to userspace. The first method uses a
760 driver-specific ioctl to perform the mapping operation, calling
761 <function>do_mmap</function> under the hood. This is often considered
762 dubious, seems to be discouraged for new GEM-enabled drivers, and will
763 thus not be described here.
764 </para>
765 <para>
766 The second method uses the mmap system call on the DRM file handle.
767 <synopsis>void *mmap(void *addr, size_t length, int prot, int flags, int fd,
768 off_t offset);</synopsis>
769 DRM identifies the GEM object to be mapped by a fake offset passed
770 through the mmap offset argument. Prior to being mapped, a GEM object
771 must thus be associated with a fake offset. To do so, drivers must call
772 <function>drm_gem_create_mmap_offset</function> on the object. The
773 function allocates a fake offset range from a pool and stores the
774 offset divided by PAGE_SIZE in
775 <literal>obj-&gt;map_list.hash.key</literal>. Care must be taken not to
776 call <function>drm_gem_create_mmap_offset</function> if a fake offset
777 has already been allocated for the object. This can be tested by
778 <literal>obj-&gt;map_list.map</literal> being non-NULL.
779 </para>
780 <para>
781 Once allocated, the fake offset value
782 (<literal>obj-&gt;map_list.hash.key &lt;&lt; PAGE_SHIFT</literal>)
783 must be passed to the application in a driver-specific way and can then
784 be used as the mmap offset argument.
785 </para>
786 <para>
787 The GEM core provides a helper method <function>drm_gem_mmap</function>
788 to handle object mapping. The method can be set directly as the mmap
789 file operation handler. It will look up the GEM object based on the
790 offset value and set the VMA operations to the
791 <structname>drm_driver</structname> <structfield>gem_vm_ops</structfield>
792 field. Note that <function>drm_gem_mmap</function> doesn't map memory to
793 userspace, but relies on the driver-provided fault handler to map pages
794 individually.
795 </para>
796 <para>
797 To use <function>drm_gem_mmap</function>, drivers must fill the struct
798 <structname>drm_driver</structname> <structfield>gem_vm_ops</structfield>
799 field with a pointer to VM operations.
800 </para>
801 <para>
802 <synopsis>struct vm_operations_struct *gem_vm_ops
803
804 struct vm_operations_struct {
805 void (*open)(struct vm_area_struct * area);
806 void (*close)(struct vm_area_struct * area);
807 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
808 };</synopsis>
809 </para>
810 <para>
811 The <methodname>open</methodname> and <methodname>close</methodname>
812 operations must update the GEM object reference count. Drivers can use
813 the <function>drm_gem_vm_open</function> and
814 <function>drm_gem_vm_close</function> helper functions directly as open
815 and close handlers.
816 </para>
817 <para>
818 The fault operation handler is responsible for mapping individual pages
819 to userspace when a page fault occurs. Depending on the memory
820 allocation scheme, drivers can allocate pages at fault time, or can
821 decide to allocate memory for the GEM object at the time the object is
822 created.
823 </para>
824 <para>
825 Drivers that want to map the GEM object upfront instead of handling page
826 faults can implement their own mmap file operation handler.
827 </para>
828 </sect3>
829 <sect3>
830 <title>Dumb GEM Objects</title>
831 <para>
832 The GEM API doesn't standardize GEM objects creation and leaves it to
833 driver-specific ioctls. While not an issue for full-fledged graphics
834 stacks that include device-specific userspace components (in libdrm for
835 instance), this limit makes DRM-based early boot graphics unnecessarily
836 complex.
837 </para>
838 <para>
839 Dumb GEM objects partly alleviate the problem by providing a standard
840 API to create dumb buffers suitable for scanout, which can then be used
841 to create KMS frame buffers.
842 </para>
843 <para>
844 To support dumb GEM objects drivers must implement the
845 <methodname>dumb_create</methodname>,
846 <methodname>dumb_destroy</methodname> and
847 <methodname>dumb_map_offset</methodname> operations.
848 </para>
849 <itemizedlist>
850 <listitem>
851 <synopsis>int (*dumb_create)(struct drm_file *file_priv, struct drm_device *dev,
852 struct drm_mode_create_dumb *args);</synopsis>
853 <para>
854 The <methodname>dumb_create</methodname> operation creates a GEM
855 object suitable for scanout based on the width, height and depth
856 from the struct <structname>drm_mode_create_dumb</structname>
857 argument. It fills the argument's <structfield>handle</structfield>,
858 <structfield>pitch</structfield> and <structfield>size</structfield>
859 fields with a handle for the newly created GEM object and its line
860 pitch and size in bytes.
861 </para>
862 </listitem>
863 <listitem>
864 <synopsis>int (*dumb_destroy)(struct drm_file *file_priv, struct drm_device *dev,
865 uint32_t handle);</synopsis>
866 <para>
867 The <methodname>dumb_destroy</methodname> operation destroys a dumb
868 GEM object created by <methodname>dumb_create</methodname>.
869 </para>
870 </listitem>
871 <listitem>
872 <synopsis>int (*dumb_map_offset)(struct drm_file *file_priv, struct drm_device *dev,
873 uint32_t handle, uint64_t *offset);</synopsis>
874 <para>
875 The <methodname>dumb_map_offset</methodname> operation associates an
876 mmap fake offset with the GEM object given by the handle and returns
877 it. Drivers must use the
878 <function>drm_gem_create_mmap_offset</function> function to
879 associate the fake offset as described in
880 <xref linkend="drm-gem-objects-mapping"/>.
881 </para>
882 </listitem>
883 </itemizedlist>
884 </sect3>
885 <sect3>
886 <title>Memory Coherency</title>
887 <para>
888 When mapped to the device or used in a command buffer, backing pages
889 for an object are flushed to memory and marked write combined so as to
890 be coherent with the GPU. Likewise, if the CPU accesses an object
891 after the GPU has finished rendering to the object, then the object
892 must be made coherent with the CPU's view of memory, usually involving
893 GPU cache flushing of various kinds. This core CPU&lt;-&gt;GPU
894 coherency management is provided by a device-specific ioctl, which
895 evaluates an object's current domain and performs any necessary
896 flushing or synchronization to put the object into the desired
897 coherency domain (note that the object may be busy, i.e. an active
898 render target; in that case, setting the domain blocks the client and
899 waits for rendering to complete before performing any necessary
900 flushing operations).
901 </para>
902 </sect3>
903 <sect3>
904 <title>Command Execution</title>
905 <para>
906 Perhaps the most important GEM function for GPU devices is providing a
907 command execution interface to clients. Client programs construct
908 command buffers containing references to previously allocated memory
909 objects, and then submit them to GEM. At that point, GEM takes care to
910 bind all the objects into the GTT, execute the buffer, and provide
911 necessary synchronization between clients accessing the same buffers.
912 This often involves evicting some objects from the GTT and re-binding
913 others (a fairly expensive operation), and providing relocation
914 support which hides fixed GTT offsets from clients. Clients must take
915 care not to submit command buffers that reference more objects than
916 can fit in the GTT; otherwise, GEM will reject them and no rendering
917 will occur. Similarly, if several objects in the buffer require fence
918 registers to be allocated for correct rendering (e.g. 2D blits on
919 pre-965 chips), care must be taken not to require more fence registers
920 than are available to the client. Such resource management should be
921 abstracted from the client in libdrm.
922 </para>
487 </sect3> 923 </sect3>
488 </sect2> 924 </sect2>
925 </sect1>
926
927 <!-- Internals: mode setting -->
489 928
929 <sect1 id="drm-mode-setting">
930 <title>Mode Setting</title>
931 <para>
932 Drivers must initialize the mode setting core by calling
933 <function>drm_mode_config_init</function> on the DRM device. The function
934 initializes the <structname>drm_device</structname>
935 <structfield>mode_config</structfield> field and never fails. Once done,
936 mode configuration must be setup by initializing the following fields.
937 </para>
938 <itemizedlist>
939 <listitem>
940 <synopsis>int min_width, min_height;
941int max_width, max_height;</synopsis>
942 <para>
943 Minimum and maximum width and height of the frame buffers in pixel
944 units.
945 </para>
946 </listitem>
947 <listitem>
948 <synopsis>struct drm_mode_config_funcs *funcs;</synopsis>
949 <para>Mode setting functions.</para>
950 </listitem>
951 </itemizedlist>
490 <sect2> 952 <sect2>
491 <title>Output configuration</title> 953 <title>Frame Buffer Creation</title>
954 <synopsis>struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
955 struct drm_file *file_priv,
956 struct drm_mode_fb_cmd2 *mode_cmd);</synopsis>
492 <para> 957 <para>
493 The final initialization task is output configuration. This involves: 958 Frame buffers are abstract memory objects that provide a source of
494 <itemizedlist> 959 pixels to scanout to a CRTC. Applications explicitly request the
495 <listitem> 960 creation of frame buffers through the DRM_IOCTL_MODE_ADDFB(2) ioctls and
496 Finding and initializing the CRTCs, encoders, and connectors 961 receive an opaque handle that can be passed to the KMS CRTC control,
497 for the device. 962 plane configuration and page flip functions.
498 </listitem> 963 </para>
499 <listitem> 964 <para>
500 Creating an initial configuration. 965 Frame buffers rely on the underneath memory manager for low-level memory
501 </listitem> 966 operations. When creating a frame buffer applications pass a memory
502 <listitem> 967 handle (or a list of memory handles for multi-planar formats) through
503 Registering a framebuffer console driver. 968 the <parameter>drm_mode_fb_cmd2</parameter> argument. This document
504 </listitem> 969 assumes that the driver uses GEM, those handles thus reference GEM
505 </itemizedlist> 970 objects.
971 </para>
972 <para>
973 Drivers must first validate the requested frame buffer parameters passed
974 through the mode_cmd argument. In particular this is where invalid
975 sizes, pixel formats or pitches can be caught.
976 </para>
977 <para>
978 If the parameters are deemed valid, drivers then create, initialize and
979 return an instance of struct <structname>drm_framebuffer</structname>.
980 If desired the instance can be embedded in a larger driver-specific
981 structure. The new instance is initialized with a call to
982 <function>drm_framebuffer_init</function> which takes a pointer to DRM
983 frame buffer operations (struct
984 <structname>drm_framebuffer_funcs</structname>). Frame buffer operations are
985 <itemizedlist>
986 <listitem>
987 <synopsis>int (*create_handle)(struct drm_framebuffer *fb,
988 struct drm_file *file_priv, unsigned int *handle);</synopsis>
989 <para>
990 Create a handle to the frame buffer underlying memory object. If
991 the frame buffer uses a multi-plane format, the handle will
992 reference the memory object associated with the first plane.
993 </para>
994 <para>
995 Drivers call <function>drm_gem_handle_create</function> to create
996 the handle.
997 </para>
998 </listitem>
999 <listitem>
1000 <synopsis>void (*destroy)(struct drm_framebuffer *framebuffer);</synopsis>
1001 <para>
1002 Destroy the frame buffer object and frees all associated
1003 resources. Drivers must call
1004 <function>drm_framebuffer_cleanup</function> to free resources
1005 allocated by the DRM core for the frame buffer object, and must
1006 make sure to unreference all memory objects associated with the
1007 frame buffer. Handles created by the
1008 <methodname>create_handle</methodname> operation are released by
1009 the DRM core.
1010 </para>
1011 </listitem>
1012 <listitem>
1013 <synopsis>int (*dirty)(struct drm_framebuffer *framebuffer,
1014 struct drm_file *file_priv, unsigned flags, unsigned color,
1015 struct drm_clip_rect *clips, unsigned num_clips);</synopsis>
1016 <para>
1017 This optional operation notifies the driver that a region of the
1018 frame buffer has changed in response to a DRM_IOCTL_MODE_DIRTYFB
1019 ioctl call.
1020 </para>
1021 </listitem>
1022 </itemizedlist>
1023 </para>
1024 <para>
1025 After initializing the <structname>drm_framebuffer</structname>
1026 instance drivers must fill its <structfield>width</structfield>,
1027 <structfield>height</structfield>, <structfield>pitches</structfield>,
1028 <structfield>offsets</structfield>, <structfield>depth</structfield>,
1029 <structfield>bits_per_pixel</structfield> and
1030 <structfield>pixel_format</structfield> fields from the values passed
1031 through the <parameter>drm_mode_fb_cmd2</parameter> argument. They
1032 should call the <function>drm_helper_mode_fill_fb_struct</function>
1033 helper function to do so.
1034 </para>
1035 </sect2>
1036 <sect2>
1037 <title>Output Polling</title>
1038 <synopsis>void (*output_poll_changed)(struct drm_device *dev);</synopsis>
1039 <para>
1040 This operation notifies the driver that the status of one or more
1041 connectors has changed. Drivers that use the fb helper can just call the
1042 <function>drm_fb_helper_hotplug_event</function> function to handle this
1043 operation.
1044 </para>
1045 </sect2>
1046 </sect1>
1047
1048 <!-- Internals: kms initialization and cleanup -->
1049
1050 <sect1 id="drm-kms-init">
1051 <title>KMS Initialization and Cleanup</title>
1052 <para>
1053 A KMS device is abstracted and exposed as a set of planes, CRTCs, encoders
1054 and connectors. KMS drivers must thus create and initialize all those
1055 objects at load time after initializing mode setting.
1056 </para>
1057 <sect2>
1058 <title>CRTCs (struct <structname>drm_crtc</structname>)</title>
1059 <para>
1060 A CRTC is an abstraction representing a part of the chip that contains a
1061 pointer to a scanout buffer. Therefore, the number of CRTCs available
1062 determines how many independent scanout buffers can be active at any
1063 given time. The CRTC structure contains several fields to support this:
1064 a pointer to some video memory (abstracted as a frame buffer object), a
1065 display mode, and an (x, y) offset into the video memory to support
1066 panning or configurations where one piece of video memory spans multiple
1067 CRTCs.
506 </para> 1068 </para>
507 <sect3> 1069 <sect3>
508 <title>Output discovery and initialization</title> 1070 <title>CRTC Initialization</title>
509 <para> 1071 <para>
510 Several core functions exist to create CRTCs, encoders, and 1072 A KMS device must create and register at least one struct
511 connectors, namely: drm_crtc_init(), drm_connector_init(), and 1073 <structname>drm_crtc</structname> instance. The instance is allocated
512 drm_encoder_init(), along with several "helper" functions to 1074 and zeroed by the driver, possibly as part of a larger structure, and
513 perform common tasks. 1075 registered with a call to <function>drm_crtc_init</function> with a
514 </para> 1076 pointer to CRTC functions.
515 <para> 1077 </para>
516 Connectors should be registered with sysfs once they've been 1078 </sect3>
517 detected and initialized, using the 1079 <sect3>
518 drm_sysfs_connector_add() function. Likewise, when they're 1080 <title>CRTC Operations</title>
519 removed from the system, they should be destroyed with 1081 <sect4>
520 drm_sysfs_connector_remove(). 1082 <title>Set Configuration</title>
521 </para> 1083 <synopsis>int (*set_config)(struct drm_mode_set *set);</synopsis>
522 <programlisting> 1084 <para>
523<![CDATA[ 1085 Apply a new CRTC configuration to the device. The configuration
1086 specifies a CRTC, a frame buffer to scan out from, a (x,y) position in
1087 the frame buffer, a display mode and an array of connectors to drive
1088 with the CRTC if possible.
1089 </para>
1090 <para>
1091 If the frame buffer specified in the configuration is NULL, the driver
1092 must detach all encoders connected to the CRTC and all connectors
1093 attached to those encoders and disable them.
1094 </para>
1095 <para>
1096 This operation is called with the mode config lock held.
1097 </para>
1098 <note><para>
1099 FIXME: How should set_config interact with DPMS? If the CRTC is
1100 suspended, should it be resumed?
1101 </para></note>
1102 </sect4>
1103 <sect4>
1104 <title>Page Flipping</title>
1105 <synopsis>int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb,
1106 struct drm_pending_vblank_event *event);</synopsis>
1107 <para>
1108 Schedule a page flip to the given frame buffer for the CRTC. This
1109 operation is called with the mode config mutex held.
1110 </para>
1111 <para>
1112 Page flipping is a synchronization mechanism that replaces the frame
1113 buffer being scanned out by the CRTC with a new frame buffer during
1114 vertical blanking, avoiding tearing. When an application requests a page
1115 flip the DRM core verifies that the new frame buffer is large enough to
1116 be scanned out by the CRTC in the currently configured mode and then
1117 calls the CRTC <methodname>page_flip</methodname> operation with a
1118 pointer to the new frame buffer.
1119 </para>
1120 <para>
1121 The <methodname>page_flip</methodname> operation schedules a page flip.
1122 Once any pending rendering targetting the new frame buffer has
1123 completed, the CRTC will be reprogrammed to display that frame buffer
1124 after the next vertical refresh. The operation must return immediately
1125 without waiting for rendering or page flip to complete and must block
1126 any new rendering to the frame buffer until the page flip completes.
1127 </para>
1128 <para>
1129 If a page flip is already pending, the
1130 <methodname>page_flip</methodname> operation must return
1131 -<errorname>EBUSY</errorname>.
1132 </para>
1133 <para>
1134 To synchronize page flip to vertical blanking the driver will likely
1135 need to enable vertical blanking interrupts. It should call
1136 <function>drm_vblank_get</function> for that purpose, and call
1137 <function>drm_vblank_put</function> after the page flip completes.
1138 </para>
1139 <para>
1140 If the application has requested to be notified when page flip completes
1141 the <methodname>page_flip</methodname> operation will be called with a
1142 non-NULL <parameter>event</parameter> argument pointing to a
1143 <structname>drm_pending_vblank_event</structname> instance. Upon page
1144 flip completion the driver must fill the
1145 <parameter>event</parameter>::<structfield>event</structfield>
1146 <structfield>sequence</structfield>, <structfield>tv_sec</structfield>
1147 and <structfield>tv_usec</structfield> fields with the associated
1148 vertical blanking count and timestamp, add the event to the
1149 <parameter>drm_file</parameter> list of events to be signaled, and wake
1150 up any waiting process. This can be performed with
1151 <programlisting><![CDATA[
1152 struct timeval now;
1153
1154 event->event.sequence = drm_vblank_count_and_time(..., &now);
1155 event->event.tv_sec = now.tv_sec;
1156 event->event.tv_usec = now.tv_usec;
1157
1158 spin_lock_irqsave(&dev->event_lock, flags);
1159 list_add_tail(&event->base.link, &event->base.file_priv->event_list);
1160 wake_up_interruptible(&event->base.file_priv->event_wait);
1161 spin_unlock_irqrestore(&dev->event_lock, flags);
1162 ]]></programlisting>
1163 </para>
1164 <note><para>
1165 FIXME: Could drivers that don't need to wait for rendering to complete
1166 just add the event to <literal>dev-&gt;vblank_event_list</literal> and
1167 let the DRM core handle everything, as for "normal" vertical blanking
1168 events?
1169 </para></note>
1170 <para>
1171 While waiting for the page flip to complete, the
1172 <literal>event-&gt;base.link</literal> list head can be used freely by
1173 the driver to store the pending event in a driver-specific list.
1174 </para>
1175 <para>
1176 If the file handle is closed before the event is signaled, drivers must
1177 take care to destroy the event in their
1178 <methodname>preclose</methodname> operation (and, if needed, call
1179 <function>drm_vblank_put</function>).
1180 </para>
1181 </sect4>
1182 <sect4>
1183 <title>Miscellaneous</title>
1184 <itemizedlist>
1185 <listitem>
1186 <synopsis>void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
1187 uint32_t start, uint32_t size);</synopsis>
1188 <para>
1189 Apply a gamma table to the device. The operation is optional.
1190 </para>
1191 </listitem>
1192 <listitem>
1193 <synopsis>void (*destroy)(struct drm_crtc *crtc);</synopsis>
1194 <para>
1195 Destroy the CRTC when not needed anymore. See
1196 <xref linkend="drm-kms-init"/>.
1197 </para>
1198 </listitem>
1199 </itemizedlist>
1200 </sect4>
1201 </sect3>
1202 </sect2>
1203 <sect2>
1204 <title>Planes (struct <structname>drm_plane</structname>)</title>
1205 <para>
1206 A plane represents an image source that can be blended with or overlayed
1207 on top of a CRTC during the scanout process. Planes are associated with
1208 a frame buffer to crop a portion of the image memory (source) and
1209 optionally scale it to a destination size. The result is then blended
1210 with or overlayed on top of a CRTC.
1211 </para>
1212 <sect3>
1213 <title>Plane Initialization</title>
1214 <para>
1215 Planes are optional. To create a plane, a KMS drivers allocates and
1216 zeroes an instances of struct <structname>drm_plane</structname>
1217 (possibly as part of a larger structure) and registers it with a call
1218 to <function>drm_plane_init</function>. The function takes a bitmask
1219 of the CRTCs that can be associated with the plane, a pointer to the
1220 plane functions and a list of format supported formats.
1221 </para>
1222 </sect3>
1223 <sect3>
1224 <title>Plane Operations</title>
1225 <itemizedlist>
1226 <listitem>
1227 <synopsis>int (*update_plane)(struct drm_plane *plane, struct drm_crtc *crtc,
1228 struct drm_framebuffer *fb, int crtc_x, int crtc_y,
1229 unsigned int crtc_w, unsigned int crtc_h,
1230 uint32_t src_x, uint32_t src_y,
1231 uint32_t src_w, uint32_t src_h);</synopsis>
1232 <para>
1233 Enable and configure the plane to use the given CRTC and frame buffer.
1234 </para>
1235 <para>
1236 The source rectangle in frame buffer memory coordinates is given by
1237 the <parameter>src_x</parameter>, <parameter>src_y</parameter>,
1238 <parameter>src_w</parameter> and <parameter>src_h</parameter>
1239 parameters (as 16.16 fixed point values). Devices that don't support
1240 subpixel plane coordinates can ignore the fractional part.
1241 </para>
1242 <para>
1243 The destination rectangle in CRTC coordinates is given by the
1244 <parameter>crtc_x</parameter>, <parameter>crtc_y</parameter>,
1245 <parameter>crtc_w</parameter> and <parameter>crtc_h</parameter>
1246 parameters (as integer values). Devices scale the source rectangle to
1247 the destination rectangle. If scaling is not supported, and the source
1248 rectangle size doesn't match the destination rectangle size, the
1249 driver must return a -<errorname>EINVAL</errorname> error.
1250 </para>
1251 </listitem>
1252 <listitem>
1253 <synopsis>int (*disable_plane)(struct drm_plane *plane);</synopsis>
1254 <para>
1255 Disable the plane. The DRM core calls this method in response to a
1256 DRM_IOCTL_MODE_SETPLANE ioctl call with the frame buffer ID set to 0.
1257 Disabled planes must not be processed by the CRTC.
1258 </para>
1259 </listitem>
1260 <listitem>
1261 <synopsis>void (*destroy)(struct drm_plane *plane);</synopsis>
1262 <para>
1263 Destroy the plane when not needed anymore. See
1264 <xref linkend="drm-kms-init"/>.
1265 </para>
1266 </listitem>
1267 </itemizedlist>
1268 </sect3>
1269 </sect2>
1270 <sect2>
1271 <title>Encoders (struct <structname>drm_encoder</structname>)</title>
1272 <para>
1273 An encoder takes pixel data from a CRTC and converts it to a format
1274 suitable for any attached connectors. On some devices, it may be
1275 possible to have a CRTC send data to more than one encoder. In that
1276 case, both encoders would receive data from the same scanout buffer,
1277 resulting in a "cloned" display configuration across the connectors
1278 attached to each encoder.
1279 </para>
1280 <sect3>
1281 <title>Encoder Initialization</title>
1282 <para>
1283 As for CRTCs, a KMS driver must create, initialize and register at
1284 least one struct <structname>drm_encoder</structname> instance. The
1285 instance is allocated and zeroed by the driver, possibly as part of a
1286 larger structure.
1287 </para>
1288 <para>
1289 Drivers must initialize the struct <structname>drm_encoder</structname>
1290 <structfield>possible_crtcs</structfield> and
1291 <structfield>possible_clones</structfield> fields before registering the
1292 encoder. Both fields are bitmasks of respectively the CRTCs that the
1293 encoder can be connected to, and sibling encoders candidate for cloning.
1294 </para>
1295 <para>
1296 After being initialized, the encoder must be registered with a call to
1297 <function>drm_encoder_init</function>. The function takes a pointer to
1298 the encoder functions and an encoder type. Supported types are
1299 <itemizedlist>
1300 <listitem>
1301 DRM_MODE_ENCODER_DAC for VGA and analog on DVI-I/DVI-A
1302 </listitem>
1303 <listitem>
1304 DRM_MODE_ENCODER_TMDS for DVI, HDMI and (embedded) DisplayPort
1305 </listitem>
1306 <listitem>
1307 DRM_MODE_ENCODER_LVDS for display panels
1308 </listitem>
1309 <listitem>
1310 DRM_MODE_ENCODER_TVDAC for TV output (Composite, S-Video, Component,
1311 SCART)
1312 </listitem>
1313 <listitem>
1314 DRM_MODE_ENCODER_VIRTUAL for virtual machine displays
1315 </listitem>
1316 </itemizedlist>
1317 </para>
1318 <para>
1319 Encoders must be attached to a CRTC to be used. DRM drivers leave
1320 encoders unattached at initialization time. Applications (or the fbdev
1321 compatibility layer when implemented) are responsible for attaching the
1322 encoders they want to use to a CRTC.
1323 </para>
1324 </sect3>
1325 <sect3>
1326 <title>Encoder Operations</title>
1327 <itemizedlist>
1328 <listitem>
1329 <synopsis>void (*destroy)(struct drm_encoder *encoder);</synopsis>
1330 <para>
1331 Called to destroy the encoder when not needed anymore. See
1332 <xref linkend="drm-kms-init"/>.
1333 </para>
1334 </listitem>
1335 </itemizedlist>
1336 </sect3>
1337 </sect2>
1338 <sect2>
1339 <title>Connectors (struct <structname>drm_connector</structname>)</title>
1340 <para>
1341 A connector is the final destination for pixel data on a device, and
1342 usually connects directly to an external display device like a monitor
1343 or laptop panel. A connector can only be attached to one encoder at a
1344 time. The connector is also the structure where information about the
1345 attached display is kept, so it contains fields for display data, EDID
1346 data, DPMS &amp; connection status, and information about modes
1347 supported on the attached displays.
1348 </para>
1349 <sect3>
1350 <title>Connector Initialization</title>
1351 <para>
1352 Finally a KMS driver must create, initialize, register and attach at
1353 least one struct <structname>drm_connector</structname> instance. The
1354 instance is created as other KMS objects and initialized by setting the
1355 following fields.
1356 </para>
1357 <variablelist>
1358 <varlistentry>
1359 <term><structfield>interlace_allowed</structfield></term>
1360 <listitem><para>
1361 Whether the connector can handle interlaced modes.
1362 </para></listitem>
1363 </varlistentry>
1364 <varlistentry>
1365 <term><structfield>doublescan_allowed</structfield></term>
1366 <listitem><para>
1367 Whether the connector can handle doublescan.
1368 </para></listitem>
1369 </varlistentry>
1370 <varlistentry>
1371 <term><structfield>display_info
1372 </structfield></term>
1373 <listitem><para>
1374 Display information is filled from EDID information when a display
1375 is detected. For non hot-pluggable displays such as flat panels in
1376 embedded systems, the driver should initialize the
1377 <structfield>display_info</structfield>.<structfield>width_mm</structfield>
1378 and
1379 <structfield>display_info</structfield>.<structfield>height_mm</structfield>
1380 fields with the physical size of the display.
1381 </para></listitem>
1382 </varlistentry>
1383 <varlistentry>
1384 <term id="drm-kms-connector-polled"><structfield>polled</structfield></term>
1385 <listitem><para>
1386 Connector polling mode, a combination of
1387 <variablelist>
1388 <varlistentry>
1389 <term>DRM_CONNECTOR_POLL_HPD</term>
1390 <listitem><para>
1391 The connector generates hotplug events and doesn't need to be
1392 periodically polled. The CONNECT and DISCONNECT flags must not
1393 be set together with the HPD flag.
1394 </para></listitem>
1395 </varlistentry>
1396 <varlistentry>
1397 <term>DRM_CONNECTOR_POLL_CONNECT</term>
1398 <listitem><para>
1399 Periodically poll the connector for connection.
1400 </para></listitem>
1401 </varlistentry>
1402 <varlistentry>
1403 <term>DRM_CONNECTOR_POLL_DISCONNECT</term>
1404 <listitem><para>
1405 Periodically poll the connector for disconnection.
1406 </para></listitem>
1407 </varlistentry>
1408 </variablelist>
1409 Set to 0 for connectors that don't support connection status
1410 discovery.
1411 </para></listitem>
1412 </varlistentry>
1413 </variablelist>
1414 <para>
1415 The connector is then registered with a call to
1416 <function>drm_connector_init</function> with a pointer to the connector
1417 functions and a connector type, and exposed through sysfs with a call to
1418 <function>drm_sysfs_connector_add</function>.
1419 </para>
1420 <para>
1421 Supported connector types are
1422 <itemizedlist>
1423 <listitem>DRM_MODE_CONNECTOR_VGA</listitem>
1424 <listitem>DRM_MODE_CONNECTOR_DVII</listitem>
1425 <listitem>DRM_MODE_CONNECTOR_DVID</listitem>
1426 <listitem>DRM_MODE_CONNECTOR_DVIA</listitem>
1427 <listitem>DRM_MODE_CONNECTOR_Composite</listitem>
1428 <listitem>DRM_MODE_CONNECTOR_SVIDEO</listitem>
1429 <listitem>DRM_MODE_CONNECTOR_LVDS</listitem>
1430 <listitem>DRM_MODE_CONNECTOR_Component</listitem>
1431 <listitem>DRM_MODE_CONNECTOR_9PinDIN</listitem>
1432 <listitem>DRM_MODE_CONNECTOR_DisplayPort</listitem>
1433 <listitem>DRM_MODE_CONNECTOR_HDMIA</listitem>
1434 <listitem>DRM_MODE_CONNECTOR_HDMIB</listitem>
1435 <listitem>DRM_MODE_CONNECTOR_TV</listitem>
1436 <listitem>DRM_MODE_CONNECTOR_eDP</listitem>
1437 <listitem>DRM_MODE_CONNECTOR_VIRTUAL</listitem>
1438 </itemizedlist>
1439 </para>
1440 <para>
1441 Connectors must be attached to an encoder to be used. For devices that
1442 map connectors to encoders 1:1, the connector should be attached at
1443 initialization time with a call to
1444 <function>drm_mode_connector_attach_encoder</function>. The driver must
1445 also set the <structname>drm_connector</structname>
1446 <structfield>encoder</structfield> field to point to the attached
1447 encoder.
1448 </para>
1449 <para>
1450 Finally, drivers must initialize the connectors state change detection
1451 with a call to <function>drm_kms_helper_poll_init</function>. If at
1452 least one connector is pollable but can't generate hotplug interrupts
1453 (indicated by the DRM_CONNECTOR_POLL_CONNECT and
1454 DRM_CONNECTOR_POLL_DISCONNECT connector flags), a delayed work will
1455 automatically be queued to periodically poll for changes. Connectors
1456 that can generate hotplug interrupts must be marked with the
1457 DRM_CONNECTOR_POLL_HPD flag instead, and their interrupt handler must
1458 call <function>drm_helper_hpd_irq_event</function>. The function will
1459 queue a delayed work to check the state of all connectors, but no
1460 periodic polling will be done.
1461 </para>
1462 </sect3>
1463 <sect3>
1464 <title>Connector Operations</title>
1465 <note><para>
1466 Unless otherwise state, all operations are mandatory.
1467 </para></note>
1468 <sect4>
1469 <title>DPMS</title>
1470 <synopsis>void (*dpms)(struct drm_connector *connector, int mode);</synopsis>
1471 <para>
1472 The DPMS operation sets the power state of a connector. The mode
1473 argument is one of
1474 <itemizedlist>
1475 <listitem><para>DRM_MODE_DPMS_ON</para></listitem>
1476 <listitem><para>DRM_MODE_DPMS_STANDBY</para></listitem>
1477 <listitem><para>DRM_MODE_DPMS_SUSPEND</para></listitem>
1478 <listitem><para>DRM_MODE_DPMS_OFF</para></listitem>
1479 </itemizedlist>
1480 </para>
1481 <para>
1482 In all but DPMS_ON mode the encoder to which the connector is attached
1483 should put the display in low-power mode by driving its signals
1484 appropriately. If more than one connector is attached to the encoder
1485 care should be taken not to change the power state of other displays as
1486 a side effect. Low-power mode should be propagated to the encoders and
1487 CRTCs when all related connectors are put in low-power mode.
1488 </para>
1489 </sect4>
1490 <sect4>
1491 <title>Modes</title>
1492 <synopsis>int (*fill_modes)(struct drm_connector *connector, uint32_t max_width,
1493 uint32_t max_height);</synopsis>
1494 <para>
1495 Fill the mode list with all supported modes for the connector. If the
1496 <parameter>max_width</parameter> and <parameter>max_height</parameter>
1497 arguments are non-zero, the implementation must ignore all modes wider
1498 than <parameter>max_width</parameter> or higher than
1499 <parameter>max_height</parameter>.
1500 </para>
1501 <para>
1502 The connector must also fill in this operation its
1503 <structfield>display_info</structfield>
1504 <structfield>width_mm</structfield> and
1505 <structfield>height_mm</structfield> fields with the connected display
1506 physical size in millimeters. The fields should be set to 0 if the value
1507 isn't known or is not applicable (for instance for projector devices).
1508 </para>
1509 </sect4>
1510 <sect4>
1511 <title>Connection Status</title>
1512 <para>
1513 The connection status is updated through polling or hotplug events when
1514 supported (see <xref linkend="drm-kms-connector-polled"/>). The status
1515 value is reported to userspace through ioctls and must not be used
1516 inside the driver, as it only gets initialized by a call to
1517 <function>drm_mode_getconnector</function> from userspace.
1518 </para>
1519 <synopsis>enum drm_connector_status (*detect)(struct drm_connector *connector,
1520 bool force);</synopsis>
1521 <para>
1522 Check to see if anything is attached to the connector. The
1523 <parameter>force</parameter> parameter is set to false whilst polling or
1524 to true when checking the connector due to user request.
1525 <parameter>force</parameter> can be used by the driver to avoid
1526 expensive, destructive operations during automated probing.
1527 </para>
1528 <para>
1529 Return connector_status_connected if something is connected to the
1530 connector, connector_status_disconnected if nothing is connected and
1531 connector_status_unknown if the connection state isn't known.
1532 </para>
1533 <para>
1534 Drivers should only return connector_status_connected if the connection
1535 status has really been probed as connected. Connectors that can't detect
1536 the connection status, or failed connection status probes, should return
1537 connector_status_unknown.
1538 </para>
1539 </sect4>
1540 <sect4>
1541 <title>Miscellaneous</title>
1542 <itemizedlist>
1543 <listitem>
1544 <synopsis>void (*destroy)(struct drm_connector *connector);</synopsis>
1545 <para>
1546 Destroy the connector when not needed anymore. See
1547 <xref linkend="drm-kms-init"/>.
1548 </para>
1549 </listitem>
1550 </itemizedlist>
1551 </sect4>
1552 </sect3>
1553 </sect2>
1554 <sect2>
1555 <title>Cleanup</title>
1556 <para>
1557 The DRM core manages its objects' lifetime. When an object is not needed
1558 anymore the core calls its destroy function, which must clean up and
1559 free every resource allocated for the object. Every
1560 <function>drm_*_init</function> call must be matched with a
1561 corresponding <function>drm_*_cleanup</function> call to cleanup CRTCs
1562 (<function>drm_crtc_cleanup</function>), planes
1563 (<function>drm_plane_cleanup</function>), encoders
1564 (<function>drm_encoder_cleanup</function>) and connectors
1565 (<function>drm_connector_cleanup</function>). Furthermore, connectors
1566 that have been added to sysfs must be removed by a call to
1567 <function>drm_sysfs_connector_remove</function> before calling
1568 <function>drm_connector_cleanup</function>.
1569 </para>
1570 <para>
1571 Connectors state change detection must be cleanup up with a call to
1572 <function>drm_kms_helper_poll_fini</function>.
1573 </para>
1574 </sect2>
1575 <sect2>
1576 <title>Output discovery and initialization example</title>
1577 <programlisting><![CDATA[
524void intel_crt_init(struct drm_device *dev) 1578void intel_crt_init(struct drm_device *dev)
525{ 1579{
526 struct drm_connector *connector; 1580 struct drm_connector *connector;
@@ -556,252 +1610,741 @@ void intel_crt_init(struct drm_device *dev)
556 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); 1610 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
557 1611
558 drm_sysfs_connector_add(connector); 1612 drm_sysfs_connector_add(connector);
559} 1613}]]></programlisting>
560]]> 1614 <para>
561 </programlisting> 1615 In the example above (taken from the i915 driver), a CRTC, connector and
562 <para> 1616 encoder combination is created. A device-specific i2c bus is also
563 In the example above (again, taken from the i915 driver), a 1617 created for fetching EDID data and performing monitor detection. Once
564 CRT connector and encoder combination is created. A device-specific 1618 the process is complete, the new connector is registered with sysfs to
565 i2c bus is also created for fetching EDID data and 1619 make its properties available to applications.
566 performing monitor detection. Once the process is complete, 1620 </para>
567 the new connector is registered with sysfs to make its
568 properties available to applications.
569 </para>
570 <sect4>
571 <title>Helper functions and core functions</title>
572 <para>
573 Since many PC-class graphics devices have similar display output
574 designs, the DRM provides a set of helper functions to make
575 output management easier. The core helper routines handle
576 encoder re-routing and the disabling of unused functions following
577 mode setting. Using the helpers is optional, but recommended for
578 devices with PC-style architectures (i.e. a set of display planes
579 for feeding pixels to encoders which are in turn routed to
580 connectors). Devices with more complex requirements needing
581 finer grained management may opt to use the core callbacks
582 directly.
583 </para>
584 <para>
585 [Insert typical diagram here.] [Insert OMAP style config here.]
586 </para>
587 </sect4>
588 <para>
589 Each encoder object needs to provide:
590 <itemizedlist>
591 <listitem>
592 A DPMS (basically on/off) function.
593 </listitem>
594 <listitem>
595 A mode-fixup function (for converting requested modes into
596 native hardware timings).
597 </listitem>
598 <listitem>
599 Functions (prepare, set, and commit) for use by the core DRM
600 helper functions.
601 </listitem>
602 </itemizedlist>
603 Connector helpers need to provide functions (mode-fetch, validity,
604 and encoder-matching) for returning an ideal encoder for a given
605 connector. The core connector functions include a DPMS callback,
606 save/restore routines (deprecated), detection, mode probing,
607 property handling, and cleanup functions.
608 </para>
609<!--!Edrivers/char/drm/drm_crtc.h-->
610<!--!Edrivers/char/drm/drm_crtc.c-->
611<!--!Edrivers/char/drm/drm_crtc_helper.c-->
612 </sect3>
613 </sect2> 1621 </sect2>
614 </sect1> 1622 </sect1>
615 1623
616 <!-- Internals: vblank handling --> 1624 <!-- Internals: mid-layer helper functions -->
617 1625
618 <sect1> 1626 <sect1>
619 <title>VBlank event handling</title> 1627 <title>Mid-layer Helper Functions</title>
620 <para> 1628 <para>
621 The DRM core exposes two vertical blank related ioctls: 1629 The CRTC, encoder and connector functions provided by the drivers
622 <variablelist> 1630 implement the DRM API. They're called by the DRM core and ioctl handlers
623 <varlistentry> 1631 to handle device state changes and configuration request. As implementing
624 <term>DRM_IOCTL_WAIT_VBLANK</term> 1632 those functions often requires logic not specific to drivers, mid-layer
625 <listitem> 1633 helper functions are available to avoid duplicating boilerplate code.
626 <para> 1634 </para>
627 This takes a struct drm_wait_vblank structure as its argument, 1635 <para>
628 and it is used to block or request a signal when a specified 1636 The DRM core contains one mid-layer implementation. The mid-layer provides
629 vblank event occurs. 1637 implementations of several CRTC, encoder and connector functions (called
630 </para> 1638 from the top of the mid-layer) that pre-process requests and call
631 </listitem> 1639 lower-level functions provided by the driver (at the bottom of the
632 </varlistentry> 1640 mid-layer). For instance, the
633 <varlistentry> 1641 <function>drm_crtc_helper_set_config</function> function can be used to
634 <term>DRM_IOCTL_MODESET_CTL</term> 1642 fill the struct <structname>drm_crtc_funcs</structname>
635 <listitem> 1643 <structfield>set_config</structfield> field. When called, it will split
636 <para> 1644 the <methodname>set_config</methodname> operation in smaller, simpler
637 This should be called by application level drivers before and 1645 operations and call the driver to handle them.
638 after mode setting, since on many devices the vertical blank
639 counter is reset at that time. Internally, the DRM snapshots
640 the last vblank count when the ioctl is called with the
641 _DRM_PRE_MODESET command, so that the counter won't go backwards
642 (which is dealt with when _DRM_POST_MODESET is used).
643 </para>
644 </listitem>
645 </varlistentry>
646 </variablelist>
647<!--!Edrivers/char/drm/drm_irq.c-->
648 </para> 1646 </para>
649 <para> 1647 <para>
650 To support the functions above, the DRM core provides several 1648 To use the mid-layer, drivers call <function>drm_crtc_helper_add</function>,
651 helper functions for tracking vertical blank counters, and 1649 <function>drm_encoder_helper_add</function> and
652 requires drivers to provide several callbacks: 1650 <function>drm_connector_helper_add</function> functions to install their
653 get_vblank_counter(), enable_vblank() and disable_vblank(). The 1651 mid-layer bottom operations handlers, and fill the
654 core uses get_vblank_counter() to keep the counter accurate 1652 <structname>drm_crtc_funcs</structname>,
655 across interrupt disable periods. It should return the current 1653 <structname>drm_encoder_funcs</structname> and
656 vertical blank event count, which is often tracked in a device 1654 <structname>drm_connector_funcs</structname> structures with pointers to
657 register. The enable and disable vblank callbacks should enable 1655 the mid-layer top API functions. Installing the mid-layer bottom operation
658 and disable vertical blank interrupts, respectively. In the 1656 handlers is best done right after registering the corresponding KMS object.
659 absence of DRM clients waiting on vblank events, the core DRM
660 code uses the disable_vblank() function to disable
661 interrupts, which saves power. They are re-enabled again when
662 a client calls the vblank wait ioctl above.
663 </para> 1657 </para>
664 <para> 1658 <para>
665 A device that doesn't provide a count register may simply use an 1659 The mid-layer is not split between CRTC, encoder and connector operations.
666 internal atomic counter incremented on every vertical blank 1660 To use it, a driver must provide bottom functions for all of the three KMS
667 interrupt (and then treat the enable_vblank() and disable_vblank() 1661 entities.
668 callbacks as no-ops).
669 </para> 1662 </para>
1663 <sect2>
1664 <title>Helper Functions</title>
1665 <itemizedlist>
1666 <listitem>
1667 <synopsis>int drm_crtc_helper_set_config(struct drm_mode_set *set);</synopsis>
1668 <para>
1669 The <function>drm_crtc_helper_set_config</function> helper function
1670 is a CRTC <methodname>set_config</methodname> implementation. It
1671 first tries to locate the best encoder for each connector by calling
1672 the connector <methodname>best_encoder</methodname> helper
1673 operation.
1674 </para>
1675 <para>
1676 After locating the appropriate encoders, the helper function will
1677 call the <methodname>mode_fixup</methodname> encoder and CRTC helper
1678 operations to adjust the requested mode, or reject it completely in
1679 which case an error will be returned to the application. If the new
1680 configuration after mode adjustment is identical to the current
1681 configuration the helper function will return without performing any
1682 other operation.
1683 </para>
1684 <para>
1685 If the adjusted mode is identical to the current mode but changes to
1686 the frame buffer need to be applied, the
1687 <function>drm_crtc_helper_set_config</function> function will call
1688 the CRTC <methodname>mode_set_base</methodname> helper operation. If
1689 the adjusted mode differs from the current mode, or if the
1690 <methodname>mode_set_base</methodname> helper operation is not
1691 provided, the helper function performs a full mode set sequence by
1692 calling the <methodname>prepare</methodname>,
1693 <methodname>mode_set</methodname> and
1694 <methodname>commit</methodname> CRTC and encoder helper operations,
1695 in that order.
1696 </para>
1697 </listitem>
1698 <listitem>
1699 <synopsis>void drm_helper_connector_dpms(struct drm_connector *connector, int mode);</synopsis>
1700 <para>
1701 The <function>drm_helper_connector_dpms</function> helper function
1702 is a connector <methodname>dpms</methodname> implementation that
1703 tracks power state of connectors. To use the function, drivers must
1704 provide <methodname>dpms</methodname> helper operations for CRTCs
1705 and encoders to apply the DPMS state to the device.
1706 </para>
1707 <para>
1708 The mid-layer doesn't track the power state of CRTCs and encoders.
1709 The <methodname>dpms</methodname> helper operations can thus be
1710 called with a mode identical to the currently active mode.
1711 </para>
1712 </listitem>
1713 <listitem>
1714 <synopsis>int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
1715 uint32_t maxX, uint32_t maxY);</synopsis>
1716 <para>
1717 The <function>drm_helper_probe_single_connector_modes</function> helper
1718 function is a connector <methodname>fill_modes</methodname>
1719 implementation that updates the connection status for the connector
1720 and then retrieves a list of modes by calling the connector
1721 <methodname>get_modes</methodname> helper operation.
1722 </para>
1723 <para>
1724 The function filters out modes larger than
1725 <parameter>max_width</parameter> and <parameter>max_height</parameter>
1726 if specified. It then calls the connector
1727 <methodname>mode_valid</methodname> helper operation for each mode in
1728 the probed list to check whether the mode is valid for the connector.
1729 </para>
1730 </listitem>
1731 </itemizedlist>
1732 </sect2>
1733 <sect2>
1734 <title>CRTC Helper Operations</title>
1735 <itemizedlist>
1736 <listitem id="drm-helper-crtc-mode-fixup">
1737 <synopsis>bool (*mode_fixup)(struct drm_crtc *crtc,
1738 const struct drm_display_mode *mode,
1739 struct drm_display_mode *adjusted_mode);</synopsis>
1740 <para>
1741 Let CRTCs adjust the requested mode or reject it completely. This
1742 operation returns true if the mode is accepted (possibly after being
1743 adjusted) or false if it is rejected.
1744 </para>
1745 <para>
1746 The <methodname>mode_fixup</methodname> operation should reject the
1747 mode if it can't reasonably use it. The definition of "reasonable"
1748 is currently fuzzy in this context. One possible behaviour would be
1749 to set the adjusted mode to the panel timings when a fixed-mode
1750 panel is used with hardware capable of scaling. Another behaviour
1751 would be to accept any input mode and adjust it to the closest mode
1752 supported by the hardware (FIXME: This needs to be clarified).
1753 </para>
1754 </listitem>
1755 <listitem>
1756 <synopsis>int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
1757 struct drm_framebuffer *old_fb)</synopsis>
1758 <para>
1759 Move the CRTC on the current frame buffer (stored in
1760 <literal>crtc-&gt;fb</literal>) to position (x,y). Any of the frame
1761 buffer, x position or y position may have been modified.
1762 </para>
1763 <para>
1764 This helper operation is optional. If not provided, the
1765 <function>drm_crtc_helper_set_config</function> function will fall
1766 back to the <methodname>mode_set</methodname> helper operation.
1767 </para>
1768 <note><para>
1769 FIXME: Why are x and y passed as arguments, as they can be accessed
1770 through <literal>crtc-&gt;x</literal> and
1771 <literal>crtc-&gt;y</literal>?
1772 </para></note>
1773 </listitem>
1774 <listitem>
1775 <synopsis>void (*prepare)(struct drm_crtc *crtc);</synopsis>
1776 <para>
1777 Prepare the CRTC for mode setting. This operation is called after
1778 validating the requested mode. Drivers use it to perform
1779 device-specific operations required before setting the new mode.
1780 </para>
1781 </listitem>
1782 <listitem>
1783 <synopsis>int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
1784 struct drm_display_mode *adjusted_mode, int x, int y,
1785 struct drm_framebuffer *old_fb);</synopsis>
1786 <para>
1787 Set a new mode, position and frame buffer. Depending on the device
1788 requirements, the mode can be stored internally by the driver and
1789 applied in the <methodname>commit</methodname> operation, or
1790 programmed to the hardware immediately.
1791 </para>
1792 <para>
1793 The <methodname>mode_set</methodname> operation returns 0 on success
1794 or a negative error code if an error occurs.
1795 </para>
1796 </listitem>
1797 <listitem>
1798 <synopsis>void (*commit)(struct drm_crtc *crtc);</synopsis>
1799 <para>
1800 Commit a mode. This operation is called after setting the new mode.
1801 Upon return the device must use the new mode and be fully
1802 operational.
1803 </para>
1804 </listitem>
1805 </itemizedlist>
1806 </sect2>
1807 <sect2>
1808 <title>Encoder Helper Operations</title>
1809 <itemizedlist>
1810 <listitem>
1811 <synopsis>bool (*mode_fixup)(struct drm_encoder *encoder,
1812 const struct drm_display_mode *mode,
1813 struct drm_display_mode *adjusted_mode);</synopsis>
1814 <note><para>
1815 FIXME: The mode argument be const, but the i915 driver modifies
1816 mode-&gt;clock in <function>intel_dp_mode_fixup</function>.
1817 </para></note>
1818 <para>
1819 Let encoders adjust the requested mode or reject it completely. This
1820 operation returns true if the mode is accepted (possibly after being
1821 adjusted) or false if it is rejected. See the
1822 <link linkend="drm-helper-crtc-mode-fixup">mode_fixup CRTC helper
1823 operation</link> for an explanation of the allowed adjustments.
1824 </para>
1825 </listitem>
1826 <listitem>
1827 <synopsis>void (*prepare)(struct drm_encoder *encoder);</synopsis>
1828 <para>
1829 Prepare the encoder for mode setting. This operation is called after
1830 validating the requested mode. Drivers use it to perform
1831 device-specific operations required before setting the new mode.
1832 </para>
1833 </listitem>
1834 <listitem>
1835 <synopsis>void (*mode_set)(struct drm_encoder *encoder,
1836 struct drm_display_mode *mode,
1837 struct drm_display_mode *adjusted_mode);</synopsis>
1838 <para>
1839 Set a new mode. Depending on the device requirements, the mode can
1840 be stored internally by the driver and applied in the
1841 <methodname>commit</methodname> operation, or programmed to the
1842 hardware immediately.
1843 </para>
1844 </listitem>
1845 <listitem>
1846 <synopsis>void (*commit)(struct drm_encoder *encoder);</synopsis>
1847 <para>
1848 Commit a mode. This operation is called after setting the new mode.
1849 Upon return the device must use the new mode and be fully
1850 operational.
1851 </para>
1852 </listitem>
1853 </itemizedlist>
1854 </sect2>
1855 <sect2>
1856 <title>Connector Helper Operations</title>
1857 <itemizedlist>
1858 <listitem>
1859 <synopsis>struct drm_encoder *(*best_encoder)(struct drm_connector *connector);</synopsis>
1860 <para>
1861 Return a pointer to the best encoder for the connecter. Device that
1862 map connectors to encoders 1:1 simply return the pointer to the
1863 associated encoder. This operation is mandatory.
1864 </para>
1865 </listitem>
1866 <listitem>
1867 <synopsis>int (*get_modes)(struct drm_connector *connector);</synopsis>
1868 <para>
1869 Fill the connector's <structfield>probed_modes</structfield> list
1870 by parsing EDID data with <function>drm_add_edid_modes</function> or
1871 calling <function>drm_mode_probed_add</function> directly for every
1872 supported mode and return the number of modes it has detected. This
1873 operation is mandatory.
1874 </para>
1875 <para>
1876 When adding modes manually the driver creates each mode with a call to
1877 <function>drm_mode_create</function> and must fill the following fields.
1878 <itemizedlist>
1879 <listitem>
1880 <synopsis>__u32 type;</synopsis>
1881 <para>
1882 Mode type bitmask, a combination of
1883 <variablelist>
1884 <varlistentry>
1885 <term>DRM_MODE_TYPE_BUILTIN</term>
1886 <listitem><para>not used?</para></listitem>
1887 </varlistentry>
1888 <varlistentry>
1889 <term>DRM_MODE_TYPE_CLOCK_C</term>
1890 <listitem><para>not used?</para></listitem>
1891 </varlistentry>
1892 <varlistentry>
1893 <term>DRM_MODE_TYPE_CRTC_C</term>
1894 <listitem><para>not used?</para></listitem>
1895 </varlistentry>
1896 <varlistentry>
1897 <term>
1898 DRM_MODE_TYPE_PREFERRED - The preferred mode for the connector
1899 </term>
1900 <listitem>
1901 <para>not used?</para>
1902 </listitem>
1903 </varlistentry>
1904 <varlistentry>
1905 <term>DRM_MODE_TYPE_DEFAULT</term>
1906 <listitem><para>not used?</para></listitem>
1907 </varlistentry>
1908 <varlistentry>
1909 <term>DRM_MODE_TYPE_USERDEF</term>
1910 <listitem><para>not used?</para></listitem>
1911 </varlistentry>
1912 <varlistentry>
1913 <term>DRM_MODE_TYPE_DRIVER</term>
1914 <listitem>
1915 <para>
1916 The mode has been created by the driver (as opposed to
1917 to user-created modes).
1918 </para>
1919 </listitem>
1920 </varlistentry>
1921 </variablelist>
1922 Drivers must set the DRM_MODE_TYPE_DRIVER bit for all modes they
1923 create, and set the DRM_MODE_TYPE_PREFERRED bit for the preferred
1924 mode.
1925 </para>
1926 </listitem>
1927 <listitem>
1928 <synopsis>__u32 clock;</synopsis>
1929 <para>Pixel clock frequency in kHz unit</para>
1930 </listitem>
1931 <listitem>
1932 <synopsis>__u16 hdisplay, hsync_start, hsync_end, htotal;
1933 __u16 vdisplay, vsync_start, vsync_end, vtotal;</synopsis>
1934 <para>Horizontal and vertical timing information</para>
1935 <screen><![CDATA[
1936 Active Front Sync Back
1937 Region Porch Porch
1938 <-----------------------><----------------><-------------><-------------->
1939
1940 //////////////////////|
1941 ////////////////////// |
1942 ////////////////////// |.................. ................
1943 _______________
1944
1945 <----- [hv]display ----->
1946 <------------- [hv]sync_start ------------>
1947 <--------------------- [hv]sync_end --------------------->
1948 <-------------------------------- [hv]total ----------------------------->
1949]]></screen>
1950 </listitem>
1951 <listitem>
1952 <synopsis>__u16 hskew;
1953 __u16 vscan;</synopsis>
1954 <para>Unknown</para>
1955 </listitem>
1956 <listitem>
1957 <synopsis>__u32 flags;</synopsis>
1958 <para>
1959 Mode flags, a combination of
1960 <variablelist>
1961 <varlistentry>
1962 <term>DRM_MODE_FLAG_PHSYNC</term>
1963 <listitem><para>
1964 Horizontal sync is active high
1965 </para></listitem>
1966 </varlistentry>
1967 <varlistentry>
1968 <term>DRM_MODE_FLAG_NHSYNC</term>
1969 <listitem><para>
1970 Horizontal sync is active low
1971 </para></listitem>
1972 </varlistentry>
1973 <varlistentry>
1974 <term>DRM_MODE_FLAG_PVSYNC</term>
1975 <listitem><para>
1976 Vertical sync is active high
1977 </para></listitem>
1978 </varlistentry>
1979 <varlistentry>
1980 <term>DRM_MODE_FLAG_NVSYNC</term>
1981 <listitem><para>
1982 Vertical sync is active low
1983 </para></listitem>
1984 </varlistentry>
1985 <varlistentry>
1986 <term>DRM_MODE_FLAG_INTERLACE</term>
1987 <listitem><para>
1988 Mode is interlaced
1989 </para></listitem>
1990 </varlistentry>
1991 <varlistentry>
1992 <term>DRM_MODE_FLAG_DBLSCAN</term>
1993 <listitem><para>
1994 Mode uses doublescan
1995 </para></listitem>
1996 </varlistentry>
1997 <varlistentry>
1998 <term>DRM_MODE_FLAG_CSYNC</term>
1999 <listitem><para>
2000 Mode uses composite sync
2001 </para></listitem>
2002 </varlistentry>
2003 <varlistentry>
2004 <term>DRM_MODE_FLAG_PCSYNC</term>
2005 <listitem><para>
2006 Composite sync is active high
2007 </para></listitem>
2008 </varlistentry>
2009 <varlistentry>
2010 <term>DRM_MODE_FLAG_NCSYNC</term>
2011 <listitem><para>
2012 Composite sync is active low
2013 </para></listitem>
2014 </varlistentry>
2015 <varlistentry>
2016 <term>DRM_MODE_FLAG_HSKEW</term>
2017 <listitem><para>
2018 hskew provided (not used?)
2019 </para></listitem>
2020 </varlistentry>
2021 <varlistentry>
2022 <term>DRM_MODE_FLAG_BCAST</term>
2023 <listitem><para>
2024 not used?
2025 </para></listitem>
2026 </varlistentry>
2027 <varlistentry>
2028 <term>DRM_MODE_FLAG_PIXMUX</term>
2029 <listitem><para>
2030 not used?
2031 </para></listitem>
2032 </varlistentry>
2033 <varlistentry>
2034 <term>DRM_MODE_FLAG_DBLCLK</term>
2035 <listitem><para>
2036 not used?
2037 </para></listitem>
2038 </varlistentry>
2039 <varlistentry>
2040 <term>DRM_MODE_FLAG_CLKDIV2</term>
2041 <listitem><para>
2042 ?
2043 </para></listitem>
2044 </varlistentry>
2045 </variablelist>
2046 </para>
2047 <para>
2048 Note that modes marked with the INTERLACE or DBLSCAN flags will be
2049 filtered out by
2050 <function>drm_helper_probe_single_connector_modes</function> if
2051 the connector's <structfield>interlace_allowed</structfield> or
2052 <structfield>doublescan_allowed</structfield> field is set to 0.
2053 </para>
2054 </listitem>
2055 <listitem>
2056 <synopsis>char name[DRM_DISPLAY_MODE_LEN];</synopsis>
2057 <para>
2058 Mode name. The driver must call
2059 <function>drm_mode_set_name</function> to fill the mode name from
2060 <structfield>hdisplay</structfield>,
2061 <structfield>vdisplay</structfield> and interlace flag after
2062 filling the corresponding fields.
2063 </para>
2064 </listitem>
2065 </itemizedlist>
2066 </para>
2067 <para>
2068 The <structfield>vrefresh</structfield> value is computed by
2069 <function>drm_helper_probe_single_connector_modes</function>.
2070 </para>
2071 <para>
2072 When parsing EDID data, <function>drm_add_edid_modes</function> fill the
2073 connector <structfield>display_info</structfield>
2074 <structfield>width_mm</structfield> and
2075 <structfield>height_mm</structfield> fields. When creating modes
2076 manually the <methodname>get_modes</methodname> helper operation must
2077 set the <structfield>display_info</structfield>
2078 <structfield>width_mm</structfield> and
2079 <structfield>height_mm</structfield> fields if they haven't been set
2080 already (for instance at initilization time when a fixed-size panel is
2081 attached to the connector). The mode <structfield>width_mm</structfield>
2082 and <structfield>height_mm</structfield> fields are only used internally
2083 during EDID parsing and should not be set when creating modes manually.
2084 </para>
2085 </listitem>
2086 <listitem>
2087 <synopsis>int (*mode_valid)(struct drm_connector *connector,
2088 struct drm_display_mode *mode);</synopsis>
2089 <para>
2090 Verify whether a mode is valid for the connector. Return MODE_OK for
2091 supported modes and one of the enum drm_mode_status values (MODE_*)
2092 for unsupported modes. This operation is mandatory.
2093 </para>
2094 <para>
2095 As the mode rejection reason is currently not used beside for
2096 immediately removing the unsupported mode, an implementation can
2097 return MODE_BAD regardless of the exact reason why the mode is not
2098 valid.
2099 </para>
2100 <note><para>
2101 Note that the <methodname>mode_valid</methodname> helper operation is
2102 only called for modes detected by the device, and
2103 <emphasis>not</emphasis> for modes set by the user through the CRTC
2104 <methodname>set_config</methodname> operation.
2105 </para></note>
2106 </listitem>
2107 </itemizedlist>
2108 </sect2>
670 </sect1> 2109 </sect1>
671 2110
672 <sect1> 2111 <!-- Internals: vertical blanking -->
673 <title>Memory management</title> 2112
2113 <sect1 id="drm-vertical-blank">
2114 <title>Vertical Blanking</title>
2115 <para>
2116 Vertical blanking plays a major role in graphics rendering. To achieve
2117 tear-free display, users must synchronize page flips and/or rendering to
2118 vertical blanking. The DRM API offers ioctls to perform page flips
2119 synchronized to vertical blanking and wait for vertical blanking.
2120 </para>
2121 <para>
2122 The DRM core handles most of the vertical blanking management logic, which
2123 involves filtering out spurious interrupts, keeping race-free blanking
2124 counters, coping with counter wrap-around and resets and keeping use
2125 counts. It relies on the driver to generate vertical blanking interrupts
2126 and optionally provide a hardware vertical blanking counter. Drivers must
2127 implement the following operations.
2128 </para>
2129 <itemizedlist>
2130 <listitem>
2131 <synopsis>int (*enable_vblank) (struct drm_device *dev, int crtc);
2132void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis>
2133 <para>
2134 Enable or disable vertical blanking interrupts for the given CRTC.
2135 </para>
2136 </listitem>
2137 <listitem>
2138 <synopsis>u32 (*get_vblank_counter) (struct drm_device *dev, int crtc);</synopsis>
2139 <para>
2140 Retrieve the value of the vertical blanking counter for the given
2141 CRTC. If the hardware maintains a vertical blanking counter its value
2142 should be returned. Otherwise drivers can use the
2143 <function>drm_vblank_count</function> helper function to handle this
2144 operation.
2145 </para>
2146 </listitem>
2147 </itemizedlist>
674 <para> 2148 <para>
675 The memory manager lies at the heart of many DRM operations; it 2149 Drivers must initialize the vertical blanking handling core with a call to
676 is required to support advanced client features like OpenGL 2150 <function>drm_vblank_init</function> in their
677 pbuffers. The DRM currently contains two memory managers: TTM 2151 <methodname>load</methodname> operation. The function will set the struct
678 and GEM. 2152 <structname>drm_device</structname>
2153 <structfield>vblank_disable_allowed</structfield> field to 0. This will
2154 keep vertical blanking interrupts enabled permanently until the first mode
2155 set operation, where <structfield>vblank_disable_allowed</structfield> is
2156 set to 1. The reason behind this is not clear. Drivers can set the field
2157 to 1 after <function>calling drm_vblank_init</function> to make vertical
2158 blanking interrupts dynamically managed from the beginning.
679 </para> 2159 </para>
2160 <para>
2161 Vertical blanking interrupts can be enabled by the DRM core or by drivers
2162 themselves (for instance to handle page flipping operations). The DRM core
2163 maintains a vertical blanking use count to ensure that the interrupts are
2164 not disabled while a user still needs them. To increment the use count,
2165 drivers call <function>drm_vblank_get</function>. Upon return vertical
2166 blanking interrupts are guaranteed to be enabled.
2167 </para>
2168 <para>
2169 To decrement the use count drivers call
2170 <function>drm_vblank_put</function>. Only when the use count drops to zero
2171 will the DRM core disable the vertical blanking interrupts after a delay
2172 by scheduling a timer. The delay is accessible through the vblankoffdelay
2173 module parameter or the <varname>drm_vblank_offdelay</varname> global
2174 variable and expressed in milliseconds. Its default value is 5000 ms.
2175 </para>
2176 <para>
2177 When a vertical blanking interrupt occurs drivers only need to call the
2178 <function>drm_handle_vblank</function> function to account for the
2179 interrupt.
2180 </para>
2181 <para>
2182 Resources allocated by <function>drm_vblank_init</function> must be freed
2183 with a call to <function>drm_vblank_cleanup</function> in the driver
2184 <methodname>unload</methodname> operation handler.
2185 </para>
2186 </sect1>
2187
2188 <!-- Internals: open/close, file operations and ioctls -->
680 2189
2190 <sect1>
2191 <title>Open/Close, File Operations and IOCTLs</title>
681 <sect2> 2192 <sect2>
682 <title>The Translation Table Manager (TTM)</title> 2193 <title>Open and Close</title>
2194 <synopsis>int (*firstopen) (struct drm_device *);
2195void (*lastclose) (struct drm_device *);
2196int (*open) (struct drm_device *, struct drm_file *);
2197void (*preclose) (struct drm_device *, struct drm_file *);
2198void (*postclose) (struct drm_device *, struct drm_file *);</synopsis>
2199 <abstract>Open and close handlers. None of those methods are mandatory.
2200 </abstract>
683 <para> 2201 <para>
684 TTM was developed by Tungsten Graphics, primarily by Thomas 2202 The <methodname>firstopen</methodname> method is called by the DRM core
685 Hellström, and is intended to be a flexible, high performance 2203 when an application opens a device that has no other opened file handle.
686 graphics memory manager. 2204 Similarly the <methodname>lastclose</methodname> method is called when
2205 the last application holding a file handle opened on the device closes
2206 it. Both methods are mostly used for UMS (User Mode Setting) drivers to
2207 acquire and release device resources which should be done in the
2208 <methodname>load</methodname> and <methodname>unload</methodname>
2209 methods for KMS drivers.
687 </para> 2210 </para>
688 <para> 2211 <para>
689 Drivers wishing to support TTM must fill out a drm_bo_driver 2212 Note that the <methodname>lastclose</methodname> method is also called
690 structure. 2213 at module unload time or, for hot-pluggable devices, when the device is
2214 unplugged. The <methodname>firstopen</methodname> and
2215 <methodname>lastclose</methodname> calls can thus be unbalanced.
691 </para> 2216 </para>
692 <para> 2217 <para>
693 TTM design background and information belongs here. 2218 The <methodname>open</methodname> method is called every time the device
2219 is opened by an application. Drivers can allocate per-file private data
2220 in this method and store them in the struct
2221 <structname>drm_file</structname> <structfield>driver_priv</structfield>
2222 field. Note that the <methodname>open</methodname> method is called
2223 before <methodname>firstopen</methodname>.
2224 </para>
2225 <para>
2226 The close operation is split into <methodname>preclose</methodname> and
2227 <methodname>postclose</methodname> methods. Drivers must stop and
2228 cleanup all per-file operations in the <methodname>preclose</methodname>
2229 method. For instance pending vertical blanking and page flip events must
2230 be cancelled. No per-file operation is allowed on the file handle after
2231 returning from the <methodname>preclose</methodname> method.
2232 </para>
2233 <para>
2234 Finally the <methodname>postclose</methodname> method is called as the
2235 last step of the close operation, right before calling the
2236 <methodname>lastclose</methodname> method if no other open file handle
2237 exists for the device. Drivers that have allocated per-file private data
2238 in the <methodname>open</methodname> method should free it here.
2239 </para>
2240 <para>
2241 The <methodname>lastclose</methodname> method should restore CRTC and
2242 plane properties to default value, so that a subsequent open of the
2243 device will not inherit state from the previous user.
694 </para> 2244 </para>
695 </sect2> 2245 </sect2>
696
697 <sect2> 2246 <sect2>
698 <title>The Graphics Execution Manager (GEM)</title> 2247 <title>File Operations</title>
2248 <synopsis>const struct file_operations *fops</synopsis>
2249 <abstract>File operations for the DRM device node.</abstract>
699 <para> 2250 <para>
700 GEM is an Intel project, authored by Eric Anholt and Keith 2251 Drivers must define the file operations structure that forms the DRM
701 Packard. It provides simpler interfaces than TTM, and is well 2252 userspace API entry point, even though most of those operations are
702 suited for UMA devices. 2253 implemented in the DRM core. The <methodname>open</methodname>,
2254 <methodname>release</methodname> and <methodname>ioctl</methodname>
2255 operations are handled by
2256 <programlisting>
2257 .owner = THIS_MODULE,
2258 .open = drm_open,
2259 .release = drm_release,
2260 .unlocked_ioctl = drm_ioctl,
2261 #ifdef CONFIG_COMPAT
2262 .compat_ioctl = drm_compat_ioctl,
2263 #endif
2264 </programlisting>
703 </para> 2265 </para>
704 <para> 2266 <para>
705 GEM-enabled drivers must provide gem_init_object() and 2267 Drivers that implement private ioctls that requires 32/64bit
706 gem_free_object() callbacks to support the core memory 2268 compatibility support must provide their own
707 allocation routines. They should also provide several driver-specific 2269 <methodname>compat_ioctl</methodname> handler that processes private
708 ioctls to support command execution, pinning, buffer 2270 ioctls and calls <function>drm_compat_ioctl</function> for core ioctls.
709 read &amp; write, mapping, and domain ownership transfers.
710 </para> 2271 </para>
711 <para> 2272 <para>
712 On a fundamental level, GEM involves several operations: 2273 The <methodname>read</methodname> and <methodname>poll</methodname>
713 <itemizedlist> 2274 operations provide support for reading DRM events and polling them. They
714 <listitem>Memory allocation and freeing</listitem> 2275 are implemented by
715 <listitem>Command execution</listitem> 2276 <programlisting>
716 <listitem>Aperture management at command execution time</listitem> 2277 .poll = drm_poll,
717 </itemizedlist> 2278 .read = drm_read,
718 Buffer object allocation is relatively 2279 .fasync = drm_fasync,
719 straightforward and largely provided by Linux's shmem layer, which 2280 .llseek = no_llseek,
720 provides memory to back each object. When mapped into the GTT 2281 </programlisting>
721 or used in a command buffer, the backing pages for an object are 2282 </para>
722 flushed to memory and marked write combined so as to be coherent 2283 <para>
723 with the GPU. Likewise, if the CPU accesses an object after the GPU 2284 The memory mapping implementation varies depending on how the driver
724 has finished rendering to the object, then the object must be made 2285 manages memory. Pre-GEM drivers will use <function>drm_mmap</function>,
725 coherent with the CPU's view 2286 while GEM-aware drivers will use <function>drm_gem_mmap</function>. See
726 of memory, usually involving GPU cache flushing of various kinds. 2287 <xref linkend="drm-gem"/>.
727 This core CPU&lt;-&gt;GPU coherency management is provided by a 2288 <programlisting>
728 device-specific ioctl, which evaluates an object's current domain and 2289 .mmap = drm_gem_mmap,
729 performs any necessary flushing or synchronization to put the object 2290 </programlisting>
730 into the desired coherency domain (note that the object may be busy, 2291 </para>
731 i.e. an active render target; in that case, setting the domain 2292 <para>
732 blocks the client and waits for rendering to complete before 2293 No other file operation is supported by the DRM API.
733 performing any necessary flushing operations). 2294 </para>
734 </para> 2295 </sect2>
735 <para> 2296 <sect2>
736 Perhaps the most important GEM function is providing a command 2297 <title>IOCTLs</title>
737 execution interface to clients. Client programs construct command 2298 <synopsis>struct drm_ioctl_desc *ioctls;
738 buffers containing references to previously allocated memory objects, 2299int num_ioctls;</synopsis>
739 and then submit them to GEM. At that point, GEM takes care to bind 2300 <abstract>Driver-specific ioctls descriptors table.</abstract>
740 all the objects into the GTT, execute the buffer, and provide 2301 <para>
741 necessary synchronization between clients accessing the same buffers. 2302 Driver-specific ioctls numbers start at DRM_COMMAND_BASE. The ioctls
742 This often involves evicting some objects from the GTT and re-binding 2303 descriptors table is indexed by the ioctl number offset from the base
743 others (a fairly expensive operation), and providing relocation 2304 value. Drivers can use the DRM_IOCTL_DEF_DRV() macro to initialize the
744 support which hides fixed GTT offsets from clients. Clients must 2305 table entries.
745 take care not to submit command buffers that reference more objects 2306 </para>
746 than can fit in the GTT; otherwise, GEM will reject them and no rendering 2307 <para>
747 will occur. Similarly, if several objects in the buffer require 2308 <programlisting>DRM_IOCTL_DEF_DRV(ioctl, func, flags)</programlisting>
748 fence registers to be allocated for correct rendering (e.g. 2D blits 2309 <para>
749 on pre-965 chips), care must be taken not to require more fence 2310 <parameter>ioctl</parameter> is the ioctl name. Drivers must define
750 registers than are available to the client. Such resource management 2311 the DRM_##ioctl and DRM_IOCTL_##ioctl macros to the ioctl number
751 should be abstracted from the client in libdrm. 2312 offset from DRM_COMMAND_BASE and the ioctl number respectively. The
2313 first macro is private to the device while the second must be exposed
2314 to userspace in a public header.
2315 </para>
2316 <para>
2317 <parameter>func</parameter> is a pointer to the ioctl handler function
2318 compatible with the <type>drm_ioctl_t</type> type.
2319 <programlisting>typedef int drm_ioctl_t(struct drm_device *dev, void *data,
2320 struct drm_file *file_priv);</programlisting>
2321 </para>
2322 <para>
2323 <parameter>flags</parameter> is a bitmask combination of the following
2324 values. It restricts how the ioctl is allowed to be called.
2325 <itemizedlist>
2326 <listitem><para>
2327 DRM_AUTH - Only authenticated callers allowed
2328 </para></listitem>
2329 <listitem><para>
2330 DRM_MASTER - The ioctl can only be called on the master file
2331 handle
2332 </para></listitem>
2333 <listitem><para>
2334 DRM_ROOT_ONLY - Only callers with the SYSADMIN capability allowed
2335 </para></listitem>
2336 <listitem><para>
2337 DRM_CONTROL_ALLOW - The ioctl can only be called on a control
2338 device
2339 </para></listitem>
2340 <listitem><para>
2341 DRM_UNLOCKED - The ioctl handler will be called without locking
2342 the DRM global mutex
2343 </para></listitem>
2344 </itemizedlist>
2345 </para>
752 </para> 2346 </para>
753 </sect2> 2347 </sect2>
754
755 </sect1>
756
757 <!-- Output management -->
758 <sect1>
759 <title>Output management</title>
760 <para>
761 At the core of the DRM output management code is a set of
762 structures representing CRTCs, encoders, and connectors.
763 </para>
764 <para>
765 A CRTC is an abstraction representing a part of the chip that
766 contains a pointer to a scanout buffer. Therefore, the number
767 of CRTCs available determines how many independent scanout
768 buffers can be active at any given time. The CRTC structure
769 contains several fields to support this: a pointer to some video
770 memory, a display mode, and an (x, y) offset into the video
771 memory to support panning or configurations where one piece of
772 video memory spans multiple CRTCs.
773 </para>
774 <para>
775 An encoder takes pixel data from a CRTC and converts it to a
776 format suitable for any attached connectors. On some devices,
777 it may be possible to have a CRTC send data to more than one
778 encoder. In that case, both encoders would receive data from
779 the same scanout buffer, resulting in a "cloned" display
780 configuration across the connectors attached to each encoder.
781 </para>
782 <para>
783 A connector is the final destination for pixel data on a device,
784 and usually connects directly to an external display device like
785 a monitor or laptop panel. A connector can only be attached to
786 one encoder at a time. The connector is also the structure
787 where information about the attached display is kept, so it
788 contains fields for display data, EDID data, DPMS &amp;
789 connection status, and information about modes supported on the
790 attached displays.
791 </para>
792<!--!Edrivers/char/drm/drm_crtc.c-->
793 </sect1>
794
795 <sect1>
796 <title>Framebuffer management</title>
797 <para>
798 Clients need to provide a framebuffer object which provides a source
799 of pixels for a CRTC to deliver to the encoder(s) and ultimately the
800 connector(s). A framebuffer is fundamentally a driver-specific memory
801 object, made into an opaque handle by the DRM's addfb() function.
802 Once a framebuffer has been created this way, it may be passed to the
803 KMS mode setting routines for use in a completed configuration.
804 </para>
805 </sect1> 2348 </sect1>
806 2349
807 <sect1> 2350 <sect1>
@@ -812,15 +2355,24 @@ void intel_crt_init(struct drm_device *dev)
812 </para> 2355 </para>
813 </sect1> 2356 </sect1>
814 2357
2358 <!-- Internals: suspend/resume -->
2359
815 <sect1> 2360 <sect1>
816 <title>Suspend/resume</title> 2361 <title>Suspend/Resume</title>
2362 <para>
2363 The DRM core provides some suspend/resume code, but drivers wanting full
2364 suspend/resume support should provide save() and restore() functions.
2365 These are called at suspend, hibernate, or resume time, and should perform
2366 any state save or restore required by your device across suspend or
2367 hibernate states.
2368 </para>
2369 <synopsis>int (*suspend) (struct drm_device *, pm_message_t state);
2370int (*resume) (struct drm_device *);</synopsis>
817 <para> 2371 <para>
818 The DRM core provides some suspend/resume code, but drivers 2372 Those are legacy suspend and resume methods. New driver should use the
819 wanting full suspend/resume support should provide save() and 2373 power management interface provided by their bus type (usually through
820 restore() functions. These are called at suspend, 2374 the struct <structname>device_driver</structname> dev_pm_ops) and set
821 hibernate, or resume time, and should perform any state save or 2375 these methods to NULL.
822 restore required by your device across suspend or hibernate
823 states.
824 </para> 2376 </para>
825 </sect1> 2377 </sect1>
826 2378
@@ -833,6 +2385,35 @@ void intel_crt_init(struct drm_device *dev)
833 </sect1> 2385 </sect1>
834 </chapter> 2386 </chapter>
835 2387
2388<!-- TODO
2389
2390- Add a glossary
2391- Document the struct_mutex catch-all lock
2392- Document connector properties
2393
2394- Why is the load method optional?
2395- What are drivers supposed to set the initial display state to, and how?
2396 Connector's DPMS states are not initialized and are thus equal to
2397 DRM_MODE_DPMS_ON. The fbcon compatibility layer calls
2398 drm_helper_disable_unused_functions(), which disables unused encoders and
2399 CRTCs, but doesn't touch the connectors' DPMS state, and
2400 drm_helper_connector_dpms() in reaction to fbdev blanking events. Do drivers
2401 that don't implement (or just don't use) fbcon compatibility need to call
2402 those functions themselves?
2403- KMS drivers must call drm_vblank_pre_modeset() and drm_vblank_post_modeset()
2404 around mode setting. Should this be done in the DRM core?
2405- vblank_disable_allowed is set to 1 in the first drm_vblank_post_modeset()
2406 call and never set back to 0. It seems to be safe to permanently set it to 1
2407 in drm_vblank_init() for KMS driver, and it might be safe for UMS drivers as
2408 well. This should be investigated.
2409- crtc and connector .save and .restore operations are only used internally in
2410 drivers, should they be removed from the core?
2411- encoder mid-layer .save and .restore operations are only used internally in
2412 drivers, should they be removed from the core?
2413- encoder mid-layer .detect operation is only used internally in drivers,
2414 should it be removed from the core?
2415-->
2416
836 <!-- External interfaces --> 2417 <!-- External interfaces -->
837 2418
838 <chapter id="drmExternals"> 2419 <chapter id="drmExternals">
@@ -853,6 +2434,42 @@ void intel_crt_init(struct drm_device *dev)
853 Cover generic ioctls and sysfs layout here. We only need high-level 2434 Cover generic ioctls and sysfs layout here. We only need high-level
854 info, since man pages should cover the rest. 2435 info, since man pages should cover the rest.
855 </para> 2436 </para>
2437
2438 <!-- External: vblank handling -->
2439
2440 <sect1>
2441 <title>VBlank event handling</title>
2442 <para>
2443 The DRM core exposes two vertical blank related ioctls:
2444 <variablelist>
2445 <varlistentry>
2446 <term>DRM_IOCTL_WAIT_VBLANK</term>
2447 <listitem>
2448 <para>
2449 This takes a struct drm_wait_vblank structure as its argument,
2450 and it is used to block or request a signal when a specified
2451 vblank event occurs.
2452 </para>
2453 </listitem>
2454 </varlistentry>
2455 <varlistentry>
2456 <term>DRM_IOCTL_MODESET_CTL</term>
2457 <listitem>
2458 <para>
2459 This should be called by application level drivers before and
2460 after mode setting, since on many devices the vertical blank
2461 counter is reset at that time. Internally, the DRM snapshots
2462 the last vblank count when the ioctl is called with the
2463 _DRM_PRE_MODESET command, so that the counter won't go backwards
2464 (which is dealt with when _DRM_POST_MODESET is used).
2465 </para>
2466 </listitem>
2467 </varlistentry>
2468 </variablelist>
2469<!--!Edrivers/char/drm/drm_irq.c-->
2470 </para>
2471 </sect1>
2472
856 </chapter> 2473 </chapter>
857 2474
858 <!-- API reference --> 2475 <!-- API reference -->
diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile
index 362520992ced..9b7e4c557928 100644
--- a/Documentation/DocBook/media/Makefile
+++ b/Documentation/DocBook/media/Makefile
@@ -300,7 +300,7 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
300 @( \ 300 @( \
301 for ident in $(IOCTLS) ; do \ 301 for ident in $(IOCTLS) ; do \
302 entity=`echo $$ident | tr _ -` ; \ 302 entity=`echo $$ident | tr _ -` ; \
303 id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \ 303 id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml $(MEDIA_OBJ_DIR)/media-ioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
304 echo "<!ENTITY $$entity \"<link" \ 304 echo "<!ENTITY $$entity \"<link" \
305 "linkend='$$id'><constant>$$ident</constant></link>\">" \ 305 "linkend='$$id'><constant>$$ident</constant></link>\">" \
306 >>$@ ; \ 306 >>$@ ; \
diff --git a/Documentation/DocBook/media/dvb/audio.xml b/Documentation/DocBook/media/dvb/audio.xml
index d64386237207..a7ea56c71a27 100644
--- a/Documentation/DocBook/media/dvb/audio.xml
+++ b/Documentation/DocBook/media/dvb/audio.xml
@@ -1,12 +1,16 @@
1<title>DVB Audio Device</title> 1<title>DVB Audio Device</title>
2<para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It 2<para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It
3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and 3can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and
4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your 4ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/audio.h</emphasis> in your
5application. 5application.
6</para> 6</para>
7<para>Please note that some DVB cards don&#8217;t have their own MPEG decoder, which results in 7<para>Please note that some DVB cards don&#8217;t have their own MPEG decoder, which results in
8the omission of the audio and video device. 8the omission of the audio and video device.
9</para> 9</para>
10<para>
11These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use
12of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls
13have been created to replace that functionality.</para>
10 14
11<section id="audio_data_types"> 15<section id="audio_data_types">
12<title>Audio Data Types</title> 16<title>Audio Data Types</title>
@@ -558,6 +562,8 @@ role="subsection"><title>AUDIO_SELECT_SOURCE</title>
558role="subsection"><title>AUDIO_SET_MUTE</title> 562role="subsection"><title>AUDIO_SET_MUTE</title>
559<para>DESCRIPTION 563<para>DESCRIPTION
560</para> 564</para>
565<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
566&VIDIOC-DECODER-CMD; with the <constant>V4L2_DEC_CMD_START_MUTE_AUDIO</constant> flag instead.</para>
561<informaltable><tgroup cols="1"><tbody><row><entry 567<informaltable><tgroup cols="1"><tbody><row><entry
562 align="char"> 568 align="char">
563<para>This ioctl call asks the audio device to mute the stream that is currently being 569<para>This ioctl call asks the audio device to mute the stream that is currently being
@@ -730,6 +736,8 @@ role="subsection"><title>AUDIO_SET_BYPASS_MODE</title>
730role="subsection"><title>AUDIO_CHANNEL_SELECT</title> 736role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
731<para>DESCRIPTION 737<para>DESCRIPTION
732</para> 738</para>
739<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
740<constant>V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK</constant> control instead.</para>
733<informaltable><tgroup cols="1"><tbody><row><entry 741<informaltable><tgroup cols="1"><tbody><row><entry
734 align="char"> 742 align="char">
735<para>This ioctl call asks the Audio Device to select the requested channel if possible.</para> 743<para>This ioctl call asks the Audio Device to select the requested channel if possible.</para>
@@ -772,6 +780,109 @@ role="subsection"><title>AUDIO_CHANNEL_SELECT</title>
772 </row></tbody></tgroup></informaltable> 780 </row></tbody></tgroup></informaltable>
773&return-value-dvb; 781&return-value-dvb;
774 782
783</section><section id="AUDIO_BILINGUAL_CHANNEL_SELECT"
784role="subsection"><title>AUDIO_BILINGUAL_CHANNEL_SELECT</title>
785<para>DESCRIPTION
786</para>
787<para>This ioctl is obsolete. Do not use in new drivers. It has been replaced by
788the V4L2 <constant>V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK</constant> control
789for MPEG decoders controlled through V4L2.</para>
790<informaltable><tgroup cols="1"><tbody><row><entry
791 align="char">
792<para>This ioctl call asks the Audio Device to select the requested channel for bilingual streams if possible.</para>
793</entry>
794 </row></tbody></tgroup></informaltable>
795<para>SYNOPSIS
796</para>
797<informaltable><tgroup cols="1"><tbody><row><entry
798 align="char">
799<para>int ioctl(int fd, int request =
800 AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t);</para>
801</entry>
802 </row></tbody></tgroup></informaltable>
803<para>PARAMETERS
804</para>
805<informaltable><tgroup cols="2"><tbody><row><entry
806 align="char">
807<para>int fd</para>
808</entry><entry
809 align="char">
810<para>File descriptor returned by a previous call to open().</para>
811</entry>
812 </row><row><entry
813 align="char">
814<para>int request</para>
815</entry><entry
816 align="char">
817<para>Equals AUDIO_BILINGUAL_CHANNEL_SELECT for this
818 command.</para>
819</entry>
820 </row><row><entry
821 align="char">
822<para>audio_channel_select_t
823ch</para>
824</entry><entry
825 align="char">
826<para>Select the output format of the audio (mono left/right,
827 stereo).</para>
828</entry>
829 </row>
830</tbody></tgroup></informaltable>
831&return-value-dvb;
832
833</section><section id="AUDIO_GET_PTS"
834role="subsection"><title>AUDIO_GET_PTS</title>
835<para>DESCRIPTION
836</para>
837<para>This ioctl is obsolete. Do not use in new drivers. If you need this functionality,
838then please contact the linux-media mailing list (&v4l-ml;).</para>
839<informaltable><tgroup cols="1"><tbody><row><entry
840 align="char">
841<para>This ioctl call asks the Audio Device to return the current PTS timestamp.</para>
842</entry>
843 </row></tbody></tgroup></informaltable>
844<para>SYNOPSIS
845</para>
846<informaltable><tgroup cols="1"><tbody><row><entry
847 align="char">
848<para>int ioctl(int fd, int request =
849 AUDIO_GET_PTS, __u64 *pts);</para>
850</entry>
851 </row></tbody></tgroup></informaltable>
852<para>PARAMETERS
853</para>
854<informaltable><tgroup cols="2"><tbody><row><entry
855 align="char">
856<para>int fd</para>
857</entry><entry
858 align="char">
859<para>File descriptor returned by a previous call to open().</para>
860</entry>
861 </row><row><entry
862 align="char">
863<para>int request</para>
864</entry><entry
865 align="char">
866<para>Equals AUDIO_GET_PTS for this
867 command.</para>
868</entry>
869 </row><row><entry
870 align="char">
871<para>__u64 *pts
872</para>
873</entry><entry
874 align="char">
875<para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
876</para>
877<para>
878The PTS should belong to the currently played
879frame if possible, but may also be a value close to it
880like the PTS of the last decoded frame or the last PTS
881extracted by the PES parser.</para>
882</entry>
883 </row></tbody></tgroup></informaltable>
884&return-value-dvb;
885
775</section><section id="AUDIO_GET_STATUS" 886</section><section id="AUDIO_GET_STATUS"
776role="subsection"><title>AUDIO_GET_STATUS</title> 887role="subsection"><title>AUDIO_GET_STATUS</title>
777<para>DESCRIPTION 888<para>DESCRIPTION
diff --git a/Documentation/DocBook/media/dvb/ca.xml b/Documentation/DocBook/media/dvb/ca.xml
index 5c4adb44b1c1..85eaf4fe2931 100644
--- a/Documentation/DocBook/media/dvb/ca.xml
+++ b/Documentation/DocBook/media/dvb/ca.xml
@@ -226,4 +226,357 @@ typedef struct ca_pid {
226</entry> 226</entry>
227 </row></tbody></tgroup></informaltable> 227 </row></tbody></tgroup></informaltable>
228 </section> 228 </section>
229
230<section id="CA_RESET"
231role="subsection"><title>CA_RESET</title>
232<para>DESCRIPTION
233</para>
234<informaltable><tgroup cols="1"><tbody><row><entry
235 align="char">
236<para>This ioctl is undocumented. Documentation is welcome.</para>
237</entry>
238 </row></tbody></tgroup></informaltable>
239<para>SYNOPSIS
240</para>
241<informaltable><tgroup cols="1"><tbody><row><entry
242 align="char">
243<para>int ioctl(fd, int request = CA_RESET);
244</para>
245</entry>
246 </row></tbody></tgroup></informaltable>
247<para>PARAMETERS
248</para>
249<informaltable><tgroup cols="2"><tbody><row><entry
250 align="char">
251<para>int fd</para>
252</entry><entry
253 align="char">
254<para>File descriptor returned by a previous call to open().</para>
255</entry>
256 </row><row><entry
257 align="char">
258<para>int request</para>
259</entry><entry
260 align="char">
261<para>Equals CA_RESET for this command.</para>
262</entry>
263 </row></tbody></tgroup></informaltable>
264&return-value-dvb;
265</section>
266
267<section id="CA_GET_CAP"
268role="subsection"><title>CA_GET_CAP</title>
269<para>DESCRIPTION
270</para>
271<informaltable><tgroup cols="1"><tbody><row><entry
272 align="char">
273<para>This ioctl is undocumented. Documentation is welcome.</para>
274</entry>
275 </row></tbody></tgroup></informaltable>
276<para>SYNOPSIS
277</para>
278<informaltable><tgroup cols="1"><tbody><row><entry
279 align="char">
280<para>int ioctl(fd, int request = CA_GET_CAP,
281 ca_caps_t *);</para>
282</entry>
283 </row></tbody></tgroup></informaltable>
284<para>PARAMETERS
285</para>
286<informaltable><tgroup cols="2"><tbody><row><entry
287 align="char">
288<para>int fd</para>
289</entry><entry
290 align="char">
291<para>File descriptor returned by a previous call to open().</para>
292</entry>
293 </row><row><entry
294 align="char">
295<para>int request</para>
296</entry><entry
297 align="char">
298<para>Equals CA_GET_CAP for this command.</para>
299</entry>
300 </row><row><entry
301 align="char">
302<para>ca_caps_t *
303</para>
304</entry><entry
305 align="char">
306<para>Undocumented.</para>
307</entry>
308 </row></tbody></tgroup></informaltable>
309&return-value-dvb;
310</section>
311
312<section id="CA_GET_SLOT_INFO"
313role="subsection"><title>CA_GET_SLOT_INFO</title>
314<para>DESCRIPTION
315</para>
316<informaltable><tgroup cols="1"><tbody><row><entry
317 align="char">
318<para>This ioctl is undocumented. Documentation is welcome.</para>
319</entry>
320 </row></tbody></tgroup></informaltable>
321<para>SYNOPSIS
322</para>
323<informaltable><tgroup cols="1"><tbody><row><entry
324 align="char">
325<para>int ioctl(fd, int request = CA_GET_SLOT_INFO,
326 ca_slot_info_t *);</para>
327</entry>
328 </row></tbody></tgroup></informaltable>
329<para>PARAMETERS
330</para>
331<informaltable><tgroup cols="2"><tbody><row><entry
332 align="char">
333<para>int fd</para>
334</entry><entry
335 align="char">
336<para>File descriptor returned by a previous call to open().</para>
337</entry>
338 </row><row><entry
339 align="char">
340<para>int request</para>
341</entry><entry
342 align="char">
343<para>Equals CA_GET_SLOT_INFO for this command.</para>
344</entry>
345 </row><row><entry
346 align="char">
347<para>ca_slot_info_t *
348</para>
349</entry><entry
350 align="char">
351<para>Undocumented.</para>
352</entry>
353 </row></tbody></tgroup></informaltable>
354&return-value-dvb;
355</section>
356
357<section id="CA_GET_DESCR_INFO"
358role="subsection"><title>CA_GET_DESCR_INFO</title>
359<para>DESCRIPTION
360</para>
361<informaltable><tgroup cols="1"><tbody><row><entry
362 align="char">
363<para>This ioctl is undocumented. Documentation is welcome.</para>
364</entry>
365 </row></tbody></tgroup></informaltable>
366<para>SYNOPSIS
367</para>
368<informaltable><tgroup cols="1"><tbody><row><entry
369 align="char">
370<para>int ioctl(fd, int request = CA_GET_DESCR_INFO,
371 ca_descr_info_t *);</para>
372</entry>
373 </row></tbody></tgroup></informaltable>
374<para>PARAMETERS
375</para>
376<informaltable><tgroup cols="2"><tbody><row><entry
377 align="char">
378<para>int fd</para>
379</entry><entry
380 align="char">
381<para>File descriptor returned by a previous call to open().</para>
382</entry>
383 </row><row><entry
384 align="char">
385<para>int request</para>
386</entry><entry
387 align="char">
388<para>Equals CA_GET_DESCR_INFO for this command.</para>
389</entry>
390 </row><row><entry
391 align="char">
392<para>ca_descr_info_t *
393</para>
394</entry><entry
395 align="char">
396<para>Undocumented.</para>
397</entry>
398 </row></tbody></tgroup></informaltable>
399&return-value-dvb;
400</section>
401
402<section id="CA_GET_MSG"
403role="subsection"><title>CA_GET_MSG</title>
404<para>DESCRIPTION
405</para>
406<informaltable><tgroup cols="1"><tbody><row><entry
407 align="char">
408<para>This ioctl is undocumented. Documentation is welcome.</para>
409</entry>
410 </row></tbody></tgroup></informaltable>
411<para>SYNOPSIS
412</para>
413<informaltable><tgroup cols="1"><tbody><row><entry
414 align="char">
415<para>int ioctl(fd, int request = CA_GET_MSG,
416 ca_msg_t *);</para>
417</entry>
418 </row></tbody></tgroup></informaltable>
419<para>PARAMETERS
420</para>
421<informaltable><tgroup cols="2"><tbody><row><entry
422 align="char">
423<para>int fd</para>
424</entry><entry
425 align="char">
426<para>File descriptor returned by a previous call to open().</para>
427</entry>
428 </row><row><entry
429 align="char">
430<para>int request</para>
431</entry><entry
432 align="char">
433<para>Equals CA_GET_MSG for this command.</para>
434</entry>
435 </row><row><entry
436 align="char">
437<para>ca_msg_t *
438</para>
439</entry><entry
440 align="char">
441<para>Undocumented.</para>
442</entry>
443 </row></tbody></tgroup></informaltable>
444&return-value-dvb;
445</section>
446
447<section id="CA_SEND_MSG"
448role="subsection"><title>CA_SEND_MSG</title>
449<para>DESCRIPTION
450</para>
451<informaltable><tgroup cols="1"><tbody><row><entry
452 align="char">
453<para>This ioctl is undocumented. Documentation is welcome.</para>
454</entry>
455 </row></tbody></tgroup></informaltable>
456<para>SYNOPSIS
457</para>
458<informaltable><tgroup cols="1"><tbody><row><entry
459 align="char">
460<para>int ioctl(fd, int request = CA_SEND_MSG,
461 ca_msg_t *);</para>
462</entry>
463 </row></tbody></tgroup></informaltable>
464<para>PARAMETERS
465</para>
466<informaltable><tgroup cols="2"><tbody><row><entry
467 align="char">
468<para>int fd</para>
469</entry><entry
470 align="char">
471<para>File descriptor returned by a previous call to open().</para>
472</entry>
473 </row><row><entry
474 align="char">
475<para>int request</para>
476</entry><entry
477 align="char">
478<para>Equals CA_SEND_MSG for this command.</para>
479</entry>
480 </row><row><entry
481 align="char">
482<para>ca_msg_t *
483</para>
484</entry><entry
485 align="char">
486<para>Undocumented.</para>
487</entry>
488 </row></tbody></tgroup></informaltable>
489&return-value-dvb;
490</section>
491
492<section id="CA_SET_DESCR"
493role="subsection"><title>CA_SET_DESCR</title>
494<para>DESCRIPTION
495</para>
496<informaltable><tgroup cols="1"><tbody><row><entry
497 align="char">
498<para>This ioctl is undocumented. Documentation is welcome.</para>
499</entry>
500 </row></tbody></tgroup></informaltable>
501<para>SYNOPSIS
502</para>
503<informaltable><tgroup cols="1"><tbody><row><entry
504 align="char">
505<para>int ioctl(fd, int request = CA_SET_DESCR,
506 ca_descr_t *);</para>
507</entry>
508 </row></tbody></tgroup></informaltable>
509<para>PARAMETERS
510</para>
511<informaltable><tgroup cols="2"><tbody><row><entry
512 align="char">
513<para>int fd</para>
514</entry><entry
515 align="char">
516<para>File descriptor returned by a previous call to open().</para>
517</entry>
518 </row><row><entry
519 align="char">
520<para>int request</para>
521</entry><entry
522 align="char">
523<para>Equals CA_SET_DESCR for this command.</para>
524</entry>
525 </row><row><entry
526 align="char">
527<para>ca_descr_t *
528</para>
529</entry><entry
530 align="char">
531<para>Undocumented.</para>
532</entry>
533 </row></tbody></tgroup></informaltable>
534&return-value-dvb;
535</section>
536
537<section id="CA_SET_PID"
538role="subsection"><title>CA_SET_PID</title>
539<para>DESCRIPTION
540</para>
541<informaltable><tgroup cols="1"><tbody><row><entry
542 align="char">
543<para>This ioctl is undocumented. Documentation is welcome.</para>
544</entry>
545 </row></tbody></tgroup></informaltable>
546<para>SYNOPSIS
547</para>
548<informaltable><tgroup cols="1"><tbody><row><entry
549 align="char">
550<para>int ioctl(fd, int request = CA_SET_PID,
551 ca_pid_t *);</para>
552</entry>
553 </row></tbody></tgroup></informaltable>
554<para>PARAMETERS
555</para>
556<informaltable><tgroup cols="2"><tbody><row><entry
557 align="char">
558<para>int fd</para>
559</entry><entry
560 align="char">
561<para>File descriptor returned by a previous call to open().</para>
562</entry>
563 </row><row><entry
564 align="char">
565<para>int request</para>
566</entry><entry
567 align="char">
568<para>Equals CA_SET_PID for this command.</para>
569</entry>
570 </row><row><entry
571 align="char">
572<para>ca_pid_t *
573</para>
574</entry><entry
575 align="char">
576<para>Undocumented.</para>
577</entry>
578 </row></tbody></tgroup></informaltable>
579&return-value-dvb;
580</section>
581
229</section> 582</section>
diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml
index 37c17908aa40..86de89cfbd67 100644
--- a/Documentation/DocBook/media/dvb/demux.xml
+++ b/Documentation/DocBook/media/dvb/demux.xml
@@ -899,4 +899,232 @@ typedef enum {
899<para>Invalid stc number.</para> 899<para>Invalid stc number.</para>
900</entry> 900</entry>
901 </row></tbody></tgroup></informaltable> 901 </row></tbody></tgroup></informaltable>
902 </section></section> 902 </section>
903
904<section id="DMX_GET_PES_PIDS"
905role="subsection"><title>DMX_GET_PES_PIDS</title>
906<para>DESCRIPTION
907</para>
908<informaltable><tgroup cols="1"><tbody><row><entry
909 align="char">
910<para>This ioctl is undocumented. Documentation is welcome.</para>
911</entry>
912 </row></tbody></tgroup></informaltable>
913<para>SYNOPSIS
914</para>
915<informaltable><tgroup cols="1"><tbody><row><entry
916 align="char">
917<para>int ioctl(fd, int request = DMX_GET_PES_PIDS,
918 __u16[5]);</para>
919</entry>
920 </row></tbody></tgroup></informaltable>
921<para>PARAMETERS
922</para>
923<informaltable><tgroup cols="2"><tbody><row><entry
924 align="char">
925<para>int fd</para>
926</entry><entry
927 align="char">
928<para>File descriptor returned by a previous call to open().</para>
929</entry>
930 </row><row><entry
931 align="char">
932<para>int request</para>
933</entry><entry
934 align="char">
935<para>Equals DMX_GET_PES_PIDS for this command.</para>
936</entry>
937 </row><row><entry
938 align="char">
939<para>__u16[5]
940</para>
941</entry><entry
942 align="char">
943<para>Undocumented.</para>
944</entry>
945 </row></tbody></tgroup></informaltable>
946&return-value-dvb;
947</section>
948
949<section id="DMX_GET_CAPS"
950role="subsection"><title>DMX_GET_CAPS</title>
951<para>DESCRIPTION
952</para>
953<informaltable><tgroup cols="1"><tbody><row><entry
954 align="char">
955<para>This ioctl is undocumented. Documentation is welcome.</para>
956</entry>
957 </row></tbody></tgroup></informaltable>
958<para>SYNOPSIS
959</para>
960<informaltable><tgroup cols="1"><tbody><row><entry
961 align="char">
962<para>int ioctl(fd, int request = DMX_GET_CAPS,
963 dmx_caps_t *);</para>
964</entry>
965 </row></tbody></tgroup></informaltable>
966<para>PARAMETERS
967</para>
968<informaltable><tgroup cols="2"><tbody><row><entry
969 align="char">
970<para>int fd</para>
971</entry><entry
972 align="char">
973<para>File descriptor returned by a previous call to open().</para>
974</entry>
975 </row><row><entry
976 align="char">
977<para>int request</para>
978</entry><entry
979 align="char">
980<para>Equals DMX_GET_CAPS for this command.</para>
981</entry>
982 </row><row><entry
983 align="char">
984<para>dmx_caps_t *
985</para>
986</entry><entry
987 align="char">
988<para>Undocumented.</para>
989</entry>
990 </row></tbody></tgroup></informaltable>
991&return-value-dvb;
992</section>
993
994<section id="DMX_SET_SOURCE"
995role="subsection"><title>DMX_SET_SOURCE</title>
996<para>DESCRIPTION
997</para>
998<informaltable><tgroup cols="1"><tbody><row><entry
999 align="char">
1000<para>This ioctl is undocumented. Documentation is welcome.</para>
1001</entry>
1002 </row></tbody></tgroup></informaltable>
1003<para>SYNOPSIS
1004</para>
1005<informaltable><tgroup cols="1"><tbody><row><entry
1006 align="char">
1007<para>int ioctl(fd, int request = DMX_SET_SOURCE,
1008 dmx_source_t *);</para>
1009</entry>
1010 </row></tbody></tgroup></informaltable>
1011<para>PARAMETERS
1012</para>
1013<informaltable><tgroup cols="2"><tbody><row><entry
1014 align="char">
1015<para>int fd</para>
1016</entry><entry
1017 align="char">
1018<para>File descriptor returned by a previous call to open().</para>
1019</entry>
1020 </row><row><entry
1021 align="char">
1022<para>int request</para>
1023</entry><entry
1024 align="char">
1025<para>Equals DMX_SET_SOURCE for this command.</para>
1026</entry>
1027 </row><row><entry
1028 align="char">
1029<para>dmx_source_t *
1030</para>
1031</entry><entry
1032 align="char">
1033<para>Undocumented.</para>
1034</entry>
1035 </row></tbody></tgroup></informaltable>
1036&return-value-dvb;
1037</section>
1038
1039<section id="DMX_ADD_PID"
1040role="subsection"><title>DMX_ADD_PID</title>
1041<para>DESCRIPTION
1042</para>
1043<informaltable><tgroup cols="1"><tbody><row><entry
1044 align="char">
1045<para>This ioctl is undocumented. Documentation is welcome.</para>
1046</entry>
1047 </row></tbody></tgroup></informaltable>
1048<para>SYNOPSIS
1049</para>
1050<informaltable><tgroup cols="1"><tbody><row><entry
1051 align="char">
1052<para>int ioctl(fd, int request = DMX_ADD_PID,
1053 __u16 *);</para>
1054</entry>
1055 </row></tbody></tgroup></informaltable>
1056<para>PARAMETERS
1057</para>
1058<informaltable><tgroup cols="2"><tbody><row><entry
1059 align="char">
1060<para>int fd</para>
1061</entry><entry
1062 align="char">
1063<para>File descriptor returned by a previous call to open().</para>
1064</entry>
1065 </row><row><entry
1066 align="char">
1067<para>int request</para>
1068</entry><entry
1069 align="char">
1070<para>Equals DMX_ADD_PID for this command.</para>
1071</entry>
1072 </row><row><entry
1073 align="char">
1074<para>__u16 *
1075</para>
1076</entry><entry
1077 align="char">
1078<para>Undocumented.</para>
1079</entry>
1080 </row></tbody></tgroup></informaltable>
1081&return-value-dvb;
1082</section>
1083
1084<section id="DMX_REMOVE_PID"
1085role="subsection"><title>DMX_REMOVE_PID</title>
1086<para>DESCRIPTION
1087</para>
1088<informaltable><tgroup cols="1"><tbody><row><entry
1089 align="char">
1090<para>This ioctl is undocumented. Documentation is welcome.</para>
1091</entry>
1092 </row></tbody></tgroup></informaltable>
1093<para>SYNOPSIS
1094</para>
1095<informaltable><tgroup cols="1"><tbody><row><entry
1096 align="char">
1097<para>int ioctl(fd, int request = DMX_REMOVE_PID,
1098 __u16 *);</para>
1099</entry>
1100 </row></tbody></tgroup></informaltable>
1101<para>PARAMETERS
1102</para>
1103<informaltable><tgroup cols="2"><tbody><row><entry
1104 align="char">
1105<para>int fd</para>
1106</entry><entry
1107 align="char">
1108<para>File descriptor returned by a previous call to open().</para>
1109</entry>
1110 </row><row><entry
1111 align="char">
1112<para>int request</para>
1113</entry><entry
1114 align="char">
1115<para>Equals DMX_REMOVE_PID for this command.</para>
1116</entry>
1117 </row><row><entry
1118 align="char">
1119<para>__u16 *
1120</para>
1121</entry><entry
1122 align="char">
1123<para>Undocumented.</para>
1124</entry>
1125 </row></tbody></tgroup></informaltable>
1126&return-value-dvb;
1127</section>
1128
1129
1130</section>
diff --git a/Documentation/DocBook/media/dvb/dvbapi.xml b/Documentation/DocBook/media/dvb/dvbapi.xml
index 2ab6ddcfc4e0..757488b24f4f 100644
--- a/Documentation/DocBook/media/dvb/dvbapi.xml
+++ b/Documentation/DocBook/media/dvb/dvbapi.xml
@@ -28,7 +28,7 @@
28 <holder>Convergence GmbH</holder> 28 <holder>Convergence GmbH</holder>
29</copyright> 29</copyright>
30<copyright> 30<copyright>
31 <year>2009-2011</year> 31 <year>2009-2012</year>
32 <holder>Mauro Carvalho Chehab</holder> 32 <holder>Mauro Carvalho Chehab</holder>
33</copyright> 33</copyright>
34 34
@@ -84,7 +84,7 @@ Added ISDB-T test originally written by Patrick Boettcher
84 84
85 85
86<title>LINUX DVB API</title> 86<title>LINUX DVB API</title>
87<subtitle>Version 5.2</subtitle> 87<subtitle>Version 5.8</subtitle>
88<!-- ADD THE CHAPTERS HERE --> 88<!-- ADD THE CHAPTERS HERE -->
89 <chapter id="dvb_introdution"> 89 <chapter id="dvb_introdution">
90 &sub-intro; 90 &sub-intro;
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
index e633c097a8d1..957e3acaae8e 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -194,6 +194,7 @@ get/set up to 64 properties. The actual meaning of each property is described on
194 APSK_16, 194 APSK_16,
195 APSK_32, 195 APSK_32,
196 DQPSK, 196 DQPSK,
197 QAM_4_NR,
197 } fe_modulation_t; 198 } fe_modulation_t;
198</programlisting> 199</programlisting>
199 </section> 200 </section>
@@ -265,6 +266,7 @@ typedef enum fe_code_rate {
265 FEC_AUTO, 266 FEC_AUTO,
266 FEC_3_5, 267 FEC_3_5,
267 FEC_9_10, 268 FEC_9_10,
269 FEC_2_5,
268} fe_code_rate_t; 270} fe_code_rate_t;
269 </programlisting> 271 </programlisting>
270 <para>which correspond to error correction rates of 1/2, 2/3, etc., 272 <para>which correspond to error correction rates of 1/2, 2/3, etc.,
@@ -351,7 +353,7 @@ typedef enum fe_delivery_system {
351 SYS_ISDBC, 353 SYS_ISDBC,
352 SYS_ATSC, 354 SYS_ATSC,
353 SYS_ATSCMH, 355 SYS_ATSCMH,
354 SYS_DMBTH, 356 SYS_DTMB,
355 SYS_CMMB, 357 SYS_CMMB,
356 SYS_DAB, 358 SYS_DAB,
357 SYS_DVBT2, 359 SYS_DVBT2,
@@ -567,28 +569,33 @@ typedef enum fe_delivery_system {
567 <title><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></title> 569 <title><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></title>
568 <para>RS frame mode.</para> 570 <para>RS frame mode.</para>
569 <para>Possible values are:</para> 571 <para>Possible values are:</para>
572 <para id="atscmh-rs-frame-mode">
570<programlisting> 573<programlisting>
571typedef enum atscmh_rs_frame_mode { 574typedef enum atscmh_rs_frame_mode {
572 ATSCMH_RSFRAME_PRI_ONLY = 0, 575 ATSCMH_RSFRAME_PRI_ONLY = 0,
573 ATSCMH_RSFRAME_PRI_SEC = 1, 576 ATSCMH_RSFRAME_PRI_SEC = 1,
574} atscmh_rs_frame_mode_t; 577} atscmh_rs_frame_mode_t;
575</programlisting> 578</programlisting>
579 </para>
576 </section> 580 </section>
577 <section id="DTV-ATSCMH-RS-FRAME-ENSEMBLE"> 581 <section id="DTV-ATSCMH-RS-FRAME-ENSEMBLE">
578 <title><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></title> 582 <title><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></title>
579 <para>RS frame ensemble.</para> 583 <para>RS frame ensemble.</para>
580 <para>Possible values are:</para> 584 <para>Possible values are:</para>
585 <para id="atscmh-rs-frame-ensemble">
581<programlisting> 586<programlisting>
582typedef enum atscmh_rs_frame_ensemble { 587typedef enum atscmh_rs_frame_ensemble {
583 ATSCMH_RSFRAME_ENS_PRI = 0, 588 ATSCMH_RSFRAME_ENS_PRI = 0,
584 ATSCMH_RSFRAME_ENS_SEC = 1, 589 ATSCMH_RSFRAME_ENS_SEC = 1,
585} atscmh_rs_frame_ensemble_t; 590} atscmh_rs_frame_ensemble_t;
586</programlisting> 591</programlisting>
592 </para>
587 </section> 593 </section>
588 <section id="DTV-ATSCMH-RS-CODE-MODE-PRI"> 594 <section id="DTV-ATSCMH-RS-CODE-MODE-PRI">
589 <title><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></title> 595 <title><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></title>
590 <para>RS code mode (primary).</para> 596 <para>RS code mode (primary).</para>
591 <para>Possible values are:</para> 597 <para>Possible values are:</para>
598 <para id="atscmh-rs-code-mode">
592<programlisting> 599<programlisting>
593typedef enum atscmh_rs_code_mode { 600typedef enum atscmh_rs_code_mode {
594 ATSCMH_RSCODE_211_187 = 0, 601 ATSCMH_RSCODE_211_187 = 0,
@@ -596,6 +603,7 @@ typedef enum atscmh_rs_code_mode {
596 ATSCMH_RSCODE_235_187 = 2, 603 ATSCMH_RSCODE_235_187 = 2,
597} atscmh_rs_code_mode_t; 604} atscmh_rs_code_mode_t;
598</programlisting> 605</programlisting>
606 </para>
599 </section> 607 </section>
600 <section id="DTV-ATSCMH-RS-CODE-MODE-SEC"> 608 <section id="DTV-ATSCMH-RS-CODE-MODE-SEC">
601 <title><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></title> 609 <title><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></title>
@@ -613,23 +621,27 @@ typedef enum atscmh_rs_code_mode {
613 <title><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></title> 621 <title><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></title>
614 <para>Series Concatenated Convolutional Code Block Mode.</para> 622 <para>Series Concatenated Convolutional Code Block Mode.</para>
615 <para>Possible values are:</para> 623 <para>Possible values are:</para>
624 <para id="atscmh-sccc-block-mode">
616<programlisting> 625<programlisting>
617typedef enum atscmh_sccc_block_mode { 626typedef enum atscmh_sccc_block_mode {
618 ATSCMH_SCCC_BLK_SEP = 0, 627 ATSCMH_SCCC_BLK_SEP = 0,
619 ATSCMH_SCCC_BLK_COMB = 1, 628 ATSCMH_SCCC_BLK_COMB = 1,
620} atscmh_sccc_block_mode_t; 629} atscmh_sccc_block_mode_t;
621</programlisting> 630</programlisting>
631 </para>
622 </section> 632 </section>
623 <section id="DTV-ATSCMH-SCCC-CODE-MODE-A"> 633 <section id="DTV-ATSCMH-SCCC-CODE-MODE-A">
624 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></title> 634 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></title>
625 <para>Series Concatenated Convolutional Code Rate.</para> 635 <para>Series Concatenated Convolutional Code Rate.</para>
626 <para>Possible values are:</para> 636 <para>Possible values are:</para>
637 <para id="atscmh-sccc-code-mode">
627<programlisting> 638<programlisting>
628typedef enum atscmh_sccc_code_mode { 639typedef enum atscmh_sccc_code_mode {
629 ATSCMH_SCCC_CODE_HLF = 0, 640 ATSCMH_SCCC_CODE_HLF = 0,
630 ATSCMH_SCCC_CODE_QTR = 1, 641 ATSCMH_SCCC_CODE_QTR = 1,
631} atscmh_sccc_code_mode_t; 642} atscmh_sccc_code_mode_t;
632</programlisting> 643</programlisting>
644 </para>
633 </section> 645 </section>
634 <section id="DTV-ATSCMH-SCCC-CODE-MODE-B"> 646 <section id="DTV-ATSCMH-SCCC-CODE-MODE-B">
635 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></title> 647 <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></title>
@@ -725,6 +737,9 @@ typedef enum fe_guard_interval {
725 GUARD_INTERVAL_1_128, 737 GUARD_INTERVAL_1_128,
726 GUARD_INTERVAL_19_128, 738 GUARD_INTERVAL_19_128,
727 GUARD_INTERVAL_19_256, 739 GUARD_INTERVAL_19_256,
740 GUARD_INTERVAL_PN420,
741 GUARD_INTERVAL_PN595,
742 GUARD_INTERVAL_PN945,
728} fe_guard_interval_t; 743} fe_guard_interval_t;
729</programlisting> 744</programlisting>
730 745
@@ -733,6 +748,7 @@ typedef enum fe_guard_interval {
733 try to find the correct guard interval (if capable) and will use TMCC to fill 748 try to find the correct guard interval (if capable) and will use TMCC to fill
734 in the missing parameters.</para> 749 in the missing parameters.</para>
735 <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para> 750 <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para>
751 <para>3) DTMB specifies PN420, PN595 and PN945.</para>
736 </section> 752 </section>
737 <section id="DTV-TRANSMISSION-MODE"> 753 <section id="DTV-TRANSMISSION-MODE">
738 <title><constant>DTV_TRANSMISSION_MODE</constant></title> 754 <title><constant>DTV_TRANSMISSION_MODE</constant></title>
@@ -749,6 +765,8 @@ typedef enum fe_transmit_mode {
749 TRANSMISSION_MODE_1K, 765 TRANSMISSION_MODE_1K,
750 TRANSMISSION_MODE_16K, 766 TRANSMISSION_MODE_16K,
751 TRANSMISSION_MODE_32K, 767 TRANSMISSION_MODE_32K,
768 TRANSMISSION_MODE_C1,
769 TRANSMISSION_MODE_C3780,
752} fe_transmit_mode_t; 770} fe_transmit_mode_t;
753</programlisting> 771</programlisting>
754 <para>Notes:</para> 772 <para>Notes:</para>
@@ -760,6 +778,7 @@ typedef enum fe_transmit_mode {
760 use TMCC to fill in the missing parameters.</para> 778 use TMCC to fill in the missing parameters.</para>
761 <para>3) DVB-T specifies 2K and 8K as valid sizes.</para> 779 <para>3) DVB-T specifies 2K and 8K as valid sizes.</para>
762 <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para> 780 <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para>
781 <para>5) DTMB specifies C1 and C3780.</para>
763 </section> 782 </section>
764 <section id="DTV-HIERARCHY"> 783 <section id="DTV-HIERARCHY">
765 <title><constant>DTV_HIERARCHY</constant></title> 784 <title><constant>DTV_HIERARCHY</constant></title>
@@ -774,17 +793,28 @@ typedef enum fe_hierarchy {
774 } fe_hierarchy_t; 793 } fe_hierarchy_t;
775 </programlisting> 794 </programlisting>
776 </section> 795 </section>
777 <section id="DTV-ISDBS-TS-ID"> 796 <section id="DTV-STREAM-ID">
778 <title><constant>DTV_ISDBS_TS_ID</constant></title> 797 <title><constant>DTV_STREAM_ID</constant></title>
779 <para>Currently unused.</para> 798 <para>DVB-S2, DVB-T2 and ISDB-S support the transmission of several
799 streams on a single transport stream.
800 This property enables the DVB driver to handle substream filtering,
801 when supported by the hardware.
802 By default, substream filtering is disabled.
803 </para><para>
804 For DVB-S2 and DVB-T2, the valid substream id range is from 0 to 255.
805 </para><para>
806 For ISDB, the valid substream id range is from 1 to 65535.
807 </para><para>
808 To disable it, you should use the special macro NO_STREAM_ID_FILTER.
809 </para><para>
810 Note: any value outside the id range also disables filtering.
811 </para>
780 </section> 812 </section>
781 <section id="DTV-DVBT2-PLP-ID"> 813 <section id="DTV-DVBT2-PLP-ID-LEGACY">
782 <title><constant>DTV_DVBT2_PLP_ID</constant></title> 814 <title><constant>DTV_DVBT2_PLP_ID_LEGACY</constant></title>
783 <para>DVB-T2 supports Physical Layer Pipes (PLP) to allow transmission of 815 <para>Obsolete, replaced with DTV_STREAM_ID.</para>
784 many data types via a single multiplex. The API will soon support this
785 at which point this section will be expanded.</para>
786 </section> 816 </section>
787 <section id="DTV_ENUM_DELSYS"> 817 <section id="DTV-ENUM-DELSYS">
788 <title><constant>DTV_ENUM_DELSYS</constant></title> 818 <title><constant>DTV_ENUM_DELSYS</constant></title>
789 <para>A Multi standard frontend needs to advertise the delivery systems provided. 819 <para>A Multi standard frontend needs to advertise the delivery systems provided.
790 Applications need to enumerate the provided delivery systems, before using 820 Applications need to enumerate the provided delivery systems, before using
@@ -796,6 +826,29 @@ typedef enum fe_hierarchy {
796 FE_GET_INFO. In the case of a legacy frontend, the result is just the same 826 FE_GET_INFO. In the case of a legacy frontend, the result is just the same
797 as with FE_GET_INFO, but in a more structured format </para> 827 as with FE_GET_INFO, but in a more structured format </para>
798 </section> 828 </section>
829 <section id="DTV-INTERLEAVING">
830 <title><constant>DTV_INTERLEAVING</constant></title>
831 <para id="fe-interleaving">Interleaving mode</para>
832 <programlisting>
833enum fe_interleaving {
834 INTERLEAVING_NONE,
835 INTERLEAVING_AUTO,
836 INTERLEAVING_240,
837 INTERLEAVING_720,
838};
839 </programlisting>
840 </section>
841 <section id="DTV-LNA">
842 <title><constant>DTV_LNA</constant></title>
843 <para>Low-noise amplifier.</para>
844 <para>Hardware might offer controllable LNA which can be set manually
845 using that parameter. Usually LNA could be found only from
846 terrestrial devices if at all.</para>
847 <para>Possible values: 0, 1, LNA_AUTO</para>
848 <para>0, LNA off</para>
849 <para>1, LNA on</para>
850 <para>use the special macro LNA_AUTO to set LNA auto</para>
851 </section>
799</section> 852</section>
800 <section id="frontend-property-terrestrial-systems"> 853 <section id="frontend-property-terrestrial-systems">
801 <title>Properties used on terrestrial delivery systems</title> 854 <title>Properties used on terrestrial delivery systems</title>
@@ -816,6 +869,7 @@ typedef enum fe_hierarchy {
816 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> 869 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
817 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> 870 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
818 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> 871 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem>
872 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
819 </itemizedlist> 873 </itemizedlist>
820 </section> 874 </section>
821 <section id="dvbt2-params"> 875 <section id="dvbt2-params">
@@ -838,7 +892,8 @@ typedef enum fe_hierarchy {
838 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> 892 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
839 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> 893 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
840 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> 894 <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem>
841 <listitem><para><link linkend="DTV-DVBT2-PLP-ID"><constant>DTV_DVBT2_PLP_ID</constant></link></para></listitem> 895 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
896 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
842 </itemizedlist> 897 </itemizedlist>
843 </section> 898 </section>
844 <section id="isdbt"> 899 <section id="isdbt">
@@ -925,13 +980,32 @@ typedef enum fe_hierarchy {
925 <listitem><para><link linkend="DTV-ATSCMH-PRC"><constant>DTV_ATSCMH_PRC</constant></link></para></listitem> 980 <listitem><para><link linkend="DTV-ATSCMH-PRC"><constant>DTV_ATSCMH_PRC</constant></link></para></listitem>
926 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-MODE"><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></link></para></listitem> 981 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-MODE"><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></link></para></listitem>
927 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE"><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></link></para></listitem> 982 <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE"><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></link></para></listitem>
928 <listitem><para><link linkend="DTV-ATSCMH-CODE-MODE-PRI"><constant>DTV_ATSCMH_CODE_MODE_PRI</constant></link></para></listitem> 983 <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-PRI"><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></link></para></listitem>
929 <listitem><para><link linkend="DTV-ATSCMH-CODE-MODE-SEC"><constant>DTV_ATSCMH_CODE_MODE_SEC</constant></link></para></listitem> 984 <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-SEC"><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></link></para></listitem>
930 <listitem><para><link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE"><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></link></para></listitem> 985 <listitem><para><link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE"><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></link></para></listitem>
931 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-A"><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></link></para></listitem> 986 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-A"><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></link></para></listitem>
932 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-B"><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></link></para></listitem> 987 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-B"><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></link></para></listitem>
933 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-C"><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></link></para></listitem> 988 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-C"><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></link></para></listitem>
934 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem> 989 <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem>
990 </itemizedlist>
991 </section>
992 <section id="dtmb-params">
993 <title>DTMB delivery system</title>
994 <para>The following parameters are valid for DTMB:</para>
995 <itemizedlist mark='opencircle'>
996 <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
997 <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
998 <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
999 <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
1000 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
1001 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1002 <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
1003 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1004 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1005 <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
1006 <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
1007 <listitem><para><link linkend="DTV-INTERLEAVING"><constant>DTV_INTERLEAVING</constant></link></para></listitem>
1008 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
935 </itemizedlist> 1009 </itemizedlist>
936 </section> 1010 </section>
937 </section> 1011 </section>
@@ -952,6 +1026,7 @@ typedef enum fe_hierarchy {
952 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> 1026 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
953 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> 1027 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
954 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> 1028 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1029 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
955 </itemizedlist> 1030 </itemizedlist>
956 </section> 1031 </section>
957 <section id="dvbc-annex-b-params"> 1032 <section id="dvbc-annex-b-params">
@@ -966,6 +1041,7 @@ typedef enum fe_hierarchy {
966 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem> 1041 <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
967 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> 1042 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
968 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> 1043 <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
1044 <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem>
969 </itemizedlist> 1045 </itemizedlist>
970 </section> 1046 </section>
971 </section> 1047 </section>
@@ -999,6 +1075,7 @@ typedef enum fe_hierarchy {
999 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> 1075 <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
1000 <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem> 1076 <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem>
1001 <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem> 1077 <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem>
1078 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
1002 </itemizedlist> 1079 </itemizedlist>
1003 </section> 1080 </section>
1004 <section id="turbo-params"> 1081 <section id="turbo-params">
@@ -1021,7 +1098,7 @@ typedef enum fe_hierarchy {
1021 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> 1098 <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
1022 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> 1099 <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
1023 <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem> 1100 <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
1024 <listitem><para><link linkend="DTV-ISDBS-TS-ID"><constant>DTV_ISDBS_TS_ID</constant></link></para></listitem> 1101 <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem>
1025 </itemizedlist> 1102 </itemizedlist>
1026 </section> 1103 </section>
1027 </section> 1104 </section>
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
index aeaed59d0f1f..426c2526a454 100644
--- a/Documentation/DocBook/media/dvb/frontend.xml
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -66,7 +66,7 @@ supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET
66 66
67<para>The usage of this field is deprecated, as it doesn't report all supported standards, and 67<para>The usage of this field is deprecated, as it doesn't report all supported standards, and
68will provide an incomplete information for frontends that support multiple delivery systems. 68will provide an incomplete information for frontends that support multiple delivery systems.
69Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para> 69Please use <link linkend="DTV-ENUM-DELSYS">DTV_ENUM_DELSYS</link> instead.</para>
70</section> 70</section>
71 71
72<section id="fe-caps-t"> 72<section id="fe-caps-t">
@@ -101,6 +101,7 @@ a specific frontend type.</para>
101 FE_CAN_8VSB = 0x200000, 101 FE_CAN_8VSB = 0x200000,
102 FE_CAN_16VSB = 0x400000, 102 FE_CAN_16VSB = 0x400000,
103 FE_HAS_EXTENDED_CAPS = 0x800000, 103 FE_HAS_EXTENDED_CAPS = 0x800000,
104 FE_CAN_MULTISTREAM = 0x4000000,
104 FE_CAN_TURBO_FEC = 0x8000000, 105 FE_CAN_TURBO_FEC = 0x8000000,
105 FE_CAN_2G_MODULATION = 0x10000000, 106 FE_CAN_2G_MODULATION = 0x10000000,
106 FE_NEEDS_BENDING = 0x20000000, 107 FE_NEEDS_BENDING = 0x20000000,
@@ -207,18 +208,44 @@ spec.</para>
207<para>Several functions of the frontend device use the fe_status data type defined 208<para>Several functions of the frontend device use the fe_status data type defined
208by</para> 209by</para>
209<programlisting> 210<programlisting>
210 typedef enum fe_status { 211typedef enum fe_status {
211 FE_HAS_SIGNAL = 0x01, /&#x22C6; found something above the noise level &#x22C6;/ 212 FE_HAS_SIGNAL = 0x01,
212 FE_HAS_CARRIER = 0x02, /&#x22C6; found a DVB signal &#x22C6;/ 213 FE_HAS_CARRIER = 0x02,
213 FE_HAS_VITERBI = 0x04, /&#x22C6; FEC is stable &#x22C6;/ 214 FE_HAS_VITERBI = 0x04,
214 FE_HAS_SYNC = 0x08, /&#x22C6; found sync bytes &#x22C6;/ 215 FE_HAS_SYNC = 0x08,
215 FE_HAS_LOCK = 0x10, /&#x22C6; everything's working... &#x22C6;/ 216 FE_HAS_LOCK = 0x10,
216 FE_TIMEDOUT = 0x20, /&#x22C6; no lock within the last ~2 seconds &#x22C6;/ 217 FE_TIMEDOUT = 0x20,
217 FE_REINIT = 0x40 /&#x22C6; frontend was reinitialized, &#x22C6;/ 218 FE_REINIT = 0x40,
218 } fe_status_t; /&#x22C6; application is recommned to reset &#x22C6;/ 219} fe_status_t;
219</programlisting> 220</programlisting>
220<para>to indicate the current state and/or state changes of the frontend hardware. 221<para>to indicate the current state and/or state changes of the frontend hardware:
221</para> 222</para>
223
224<informaltable><tgroup cols="2"><tbody>
225<row>
226<entry align="char">FE_HAS_SIGNAL</entry>
227<entry align="char">The frontend has found something above the noise level</entry>
228</row><row>
229<entry align="char">FE_HAS_CARRIER</entry>
230<entry align="char">The frontend has found a DVB signal</entry>
231</row><row>
232<entry align="char">FE_HAS_VITERBI</entry>
233<entry align="char">The frontend FEC code is stable</entry>
234</row><row>
235<entry align="char">FE_HAS_SYNC</entry>
236<entry align="char">Syncronization bytes was found</entry>
237</row><row>
238<entry align="char">FE_HAS_LOCK</entry>
239<entry align="char">The DVB were locked and everything is working</entry>
240</row><row>
241<entry align="char">FE_TIMEDOUT</entry>
242<entry align="char">no lock within the last about 2 seconds</entry>
243</row><row>
244<entry align="char">FE_REINIT</entry>
245<entry align="char">The frontend was reinitialized, application is
246recommended to reset DiSEqC, tone and parameters</entry>
247</row>
248</tbody></tgroup></informaltable>
222 249
223</section> 250</section>
224 251
@@ -238,7 +265,7 @@ and to add newer delivery systems.</para>
238<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in 265<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in
239order to be able to support the newer System Delivery like DVB-S2, DVB-T2, 266order to be able to support the newer System Delivery like DVB-S2, DVB-T2,
240DVB-C2, ISDB, etc.</para> 267DVB-C2, ISDB, etc.</para>
241<para>All kinds of parameters are combined as an union in the FrontendParameters structure:</para> 268<para>All kinds of parameters are combined as an union in the FrontendParameters structure:
242<programlisting> 269<programlisting>
243struct dvb_frontend_parameters { 270struct dvb_frontend_parameters {
244 uint32_t frequency; /&#x22C6; (absolute) frequency in Hz for QAM/OFDM &#x22C6;/ 271 uint32_t frequency; /&#x22C6; (absolute) frequency in Hz for QAM/OFDM &#x22C6;/
@@ -251,12 +278,13 @@ struct dvb_frontend_parameters {
251 struct dvb_vsb_parameters vsb; 278 struct dvb_vsb_parameters vsb;
252 } u; 279 } u;
253}; 280};
254</programlisting> 281</programlisting></para>
255<para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate 282<para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate
256frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of 283frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
257the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and 284the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
258OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz. 285OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz.
259</para> 286</para>
287
260<section id="dvb-qpsk-parameters"> 288<section id="dvb-qpsk-parameters">
261<title>QPSK parameters</title> 289<title>QPSK parameters</title>
262<para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para> 290<para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para>
@@ -321,8 +349,8 @@ itself.
321<section id="fe-code-rate-t"> 349<section id="fe-code-rate-t">
322<title>frontend code rate</title> 350<title>frontend code rate</title>
323<para>The possible values for the <constant>fec_inner</constant> field used on 351<para>The possible values for the <constant>fec_inner</constant> field used on
324<link refend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and 352<link linkend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
325<link refend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are: 353<link linkend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
326</para> 354</para>
327<programlisting> 355<programlisting>
328typedef enum fe_code_rate { 356typedef enum fe_code_rate {
@@ -347,9 +375,9 @@ detection.
347<section id="fe-modulation-t"> 375<section id="fe-modulation-t">
348<title>frontend modulation type for QAM, OFDM and VSB</title> 376<title>frontend modulation type for QAM, OFDM and VSB</title>
349<para>For cable and terrestrial frontends, e. g. for 377<para>For cable and terrestrial frontends, e. g. for
350<link refend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>, 378<link linkend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
351<link refend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and 379<link linkend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
352<link refend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>, 380<link linkend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
353it needs to specify the quadrature modulation mode which can be one of the following: 381it needs to specify the quadrature modulation mode which can be one of the following:
354</para> 382</para>
355<programlisting> 383<programlisting>
@@ -370,8 +398,8 @@ it needs to specify the quadrature modulation mode which can be one of the follo
370 } fe_modulation_t; 398 } fe_modulation_t;
371</programlisting> 399</programlisting>
372</section> 400</section>
373<para>Finally, there are several more parameters for OFDM: 401<section>
374</para> 402<title>More OFDM parameters</title>
375<section id="fe-transmit-mode-t"> 403<section id="fe-transmit-mode-t">
376<title>Number of carriers per channel</title> 404<title>Number of carriers per channel</title>
377<programlisting> 405<programlisting>
@@ -427,6 +455,7 @@ typedef enum fe_hierarchy {
427 } fe_hierarchy_t; 455 } fe_hierarchy_t;
428</programlisting> 456</programlisting>
429</section> 457</section>
458</section>
430 459
431</section> 460</section>
432 461
diff --git a/Documentation/DocBook/media/dvb/intro.xml b/Documentation/DocBook/media/dvb/intro.xml
index 170064a3dc8f..2048b53d19b9 100644
--- a/Documentation/DocBook/media/dvb/intro.xml
+++ b/Documentation/DocBook/media/dvb/intro.xml
@@ -205,7 +205,7 @@ a partial path like:</para>
205additional include file <emphasis 205additional include file <emphasis
206role="tt">linux/dvb/version.h</emphasis> exists, which defines the 206role="tt">linux/dvb/version.h</emphasis> exists, which defines the
207constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document 207constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
208describes <emphasis role="tt">DVB_API_VERSION 5.4</emphasis>. 208describes <emphasis role="tt">DVB_API_VERSION 5.8</emphasis>.
209</para> 209</para>
210 210
211</section> 211</section>
diff --git a/Documentation/DocBook/media/dvb/kdapi.xml b/Documentation/DocBook/media/dvb/kdapi.xml
index 6c67481eaa4b..6c11ec52cbee 100644
--- a/Documentation/DocBook/media/dvb/kdapi.xml
+++ b/Documentation/DocBook/media/dvb/kdapi.xml
@@ -2,7 +2,7 @@
2<para>The kernel demux API defines a driver-internal interface for registering low-level, 2<para>The kernel demux API defines a driver-internal interface for registering low-level,
3hardware specific driver to a hardware independent demux layer. It is only of interest for 3hardware specific driver to a hardware independent demux layer. It is only of interest for
4DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in 4DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in
5<emphasis role="tt">drivers/media/dvb/dvb-core</emphasis>. 5<emphasis role="tt">drivers/media/dvb-core</emphasis>.
6</para> 6</para>
7<para>Maintainer note: This section must be reviewed. It is probably out of date. 7<para>Maintainer note: This section must be reviewed. It is probably out of date.
8</para> 8</para>
diff --git a/Documentation/DocBook/media/dvb/net.xml b/Documentation/DocBook/media/dvb/net.xml
index 67d37e5ce597..a193e86941b5 100644
--- a/Documentation/DocBook/media/dvb/net.xml
+++ b/Documentation/DocBook/media/dvb/net.xml
@@ -26,4 +26,131 @@ struct dvb_net_if {
26<title>DVB net Function Calls</title> 26<title>DVB net Function Calls</title>
27<para>To be written&#x2026; 27<para>To be written&#x2026;
28</para> 28</para>
29
30<section id="NET_ADD_IF"
31role="subsection"><title>NET_ADD_IF</title>
32<para>DESCRIPTION
33</para>
34<informaltable><tgroup cols="1"><tbody><row><entry
35 align="char">
36<para>This ioctl is undocumented. Documentation is welcome.</para>
37</entry>
38 </row></tbody></tgroup></informaltable>
39<para>SYNOPSIS
40</para>
41<informaltable><tgroup cols="1"><tbody><row><entry
42 align="char">
43<para>int ioctl(fd, int request = NET_ADD_IF,
44 struct dvb_net_if *if);</para>
45</entry>
46 </row></tbody></tgroup></informaltable>
47<para>PARAMETERS
48</para>
49<informaltable><tgroup cols="2"><tbody><row><entry
50 align="char">
51<para>int fd</para>
52</entry><entry
53 align="char">
54<para>File descriptor returned by a previous call to open().</para>
55</entry>
56 </row><row><entry
57 align="char">
58<para>int request</para>
59</entry><entry
60 align="char">
61<para>Equals NET_ADD_IF for this command.</para>
62</entry>
63 </row><row><entry
64 align="char">
65<para>struct dvb_net_if *if
66</para>
67</entry><entry
68 align="char">
69<para>Undocumented.</para>
70</entry>
71 </row></tbody></tgroup></informaltable>
72&return-value-dvb;
73</section>
74
75<section id="NET_REMOVE_IF"
76role="subsection"><title>NET_REMOVE_IF</title>
77<para>DESCRIPTION
78</para>
79<informaltable><tgroup cols="1"><tbody><row><entry
80 align="char">
81<para>This ioctl is undocumented. Documentation is welcome.</para>
82</entry>
83 </row></tbody></tgroup></informaltable>
84<para>SYNOPSIS
85</para>
86<informaltable><tgroup cols="1"><tbody><row><entry
87 align="char">
88<para>int ioctl(fd, int request = NET_REMOVE_IF);
89</para>
90</entry>
91 </row></tbody></tgroup></informaltable>
92<para>PARAMETERS
93</para>
94<informaltable><tgroup cols="2"><tbody><row><entry
95 align="char">
96<para>int fd</para>
97</entry><entry
98 align="char">
99<para>File descriptor returned by a previous call to open().</para>
100</entry>
101 </row><row><entry
102 align="char">
103<para>int request</para>
104</entry><entry
105 align="char">
106<para>Equals NET_REMOVE_IF for this command.</para>
107</entry>
108 </row></tbody></tgroup></informaltable>
109&return-value-dvb;
110</section>
111
112<section id="NET_GET_IF"
113role="subsection"><title>NET_GET_IF</title>
114<para>DESCRIPTION
115</para>
116<informaltable><tgroup cols="1"><tbody><row><entry
117 align="char">
118<para>This ioctl is undocumented. Documentation is welcome.</para>
119</entry>
120 </row></tbody></tgroup></informaltable>
121<para>SYNOPSIS
122</para>
123<informaltable><tgroup cols="1"><tbody><row><entry
124 align="char">
125<para>int ioctl(fd, int request = NET_GET_IF,
126 struct dvb_net_if *if);</para>
127</entry>
128 </row></tbody></tgroup></informaltable>
129<para>PARAMETERS
130</para>
131<informaltable><tgroup cols="2"><tbody><row><entry
132 align="char">
133<para>int fd</para>
134</entry><entry
135 align="char">
136<para>File descriptor returned by a previous call to open().</para>
137</entry>
138 </row><row><entry
139 align="char">
140<para>int request</para>
141</entry><entry
142 align="char">
143<para>Equals NET_GET_IF for this command.</para>
144</entry>
145 </row><row><entry
146 align="char">
147<para>struct dvb_net_if *if
148</para>
149</entry><entry
150 align="char">
151<para>Undocumented.</para>
152</entry>
153 </row></tbody></tgroup></informaltable>
154&return-value-dvb;
155</section>
29</section> 156</section>
diff --git a/Documentation/DocBook/media/dvb/video.xml b/Documentation/DocBook/media/dvb/video.xml
index 25fb823226b4..3ea1ca7e785e 100644
--- a/Documentation/DocBook/media/dvb/video.xml
+++ b/Documentation/DocBook/media/dvb/video.xml
@@ -15,6 +15,10 @@ the audio and video device as well as the video4linux device.
15<para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only 15<para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only
16supported on some MPEG decoders made for DVD playback. 16supported on some MPEG decoders made for DVD playback.
17</para> 17</para>
18<para>
19These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use
20of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls
21have been created to replace that functionality.</para>
18<section id="video_types"> 22<section id="video_types">
19<title>Video Data Types</title> 23<title>Video Data Types</title>
20 24
@@ -55,7 +59,7 @@ typedef enum {
55</section> 59</section>
56 60
57<section id="video-stream-source-t"> 61<section id="video-stream-source-t">
58<title>video stream source</title> 62<title>video_stream_source_t</title>
59<para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take 63<para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take
60the following values, depending on whether we are replaying from an internal (demuxer) or 64the following values, depending on whether we are replaying from an internal (demuxer) or
61external (user write) source. 65external (user write) source.
@@ -76,7 +80,7 @@ call.
76</section> 80</section>
77 81
78<section id="video-play-state-t"> 82<section id="video-play-state-t">
79<title>video play state</title> 83<title>video_play_state_t</title>
80<para>The following values can be returned by the VIDEO_GET_STATUS call representing the 84<para>The following values can be returned by the VIDEO_GET_STATUS call representing the
81state of video playback. 85state of video playback.
82</para> 86</para>
@@ -90,9 +94,9 @@ typedef enum {
90</section> 94</section>
91 95
92<section id="video-command"> 96<section id="video-command">
97<title>struct video_command</title>
93<para>The structure must be zeroed before use by the application 98<para>The structure must be zeroed before use by the application
94This ensures it can be extended safely in the future.</para> 99This ensures it can be extended safely in the future.</para>
95<title>struct video-command</title>
96<programlisting> 100<programlisting>
97struct video_command { 101struct video_command {
98 __u32 cmd; 102 __u32 cmd;
@@ -121,7 +125,7 @@ struct video_command {
121</section> 125</section>
122 126
123<section id="video-size-t"> 127<section id="video-size-t">
124<title>struct video_size-t</title> 128<title>video_size_t</title>
125<programlisting> 129<programlisting>
126typedef struct { 130typedef struct {
127 int w; 131 int w;
@@ -217,7 +221,7 @@ bits set according to the hardwares capabilities.
217</section> 221</section>
218 222
219<section id="video-system"> 223<section id="video-system">
220<title>video system</title> 224<title>video_system_t</title>
221<para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The 225<para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The
222following system types can be set: 226following system types can be set:
223</para> 227</para>
@@ -263,7 +267,7 @@ call expects the following format for that information:
263 267
264</section> 268</section>
265<section id="video-spu"> 269<section id="video-spu">
266<title>video SPU</title> 270<title>struct video_spu</title>
267<para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the 271<para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the
268following format: 272following format:
269</para> 273</para>
@@ -277,12 +281,12 @@ following format:
277 281
278</section> 282</section>
279<section id="video-spu-palette"> 283<section id="video-spu-palette">
280<title>video SPU palette</title> 284<title>struct video_spu_palette</title>
281<para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE: 285<para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE:
282</para> 286</para>
283<programlisting> 287<programlisting>
284 typedef 288 typedef
285 struct video_spu_palette{ 289 struct video_spu_palette {
286 int length; 290 int length;
287 uint8_t &#x22C6;palette; 291 uint8_t &#x22C6;palette;
288 } video_spu_palette_t; 292 } video_spu_palette_t;
@@ -290,13 +294,13 @@ following format:
290 294
291</section> 295</section>
292<section id="video-navi-pack"> 296<section id="video-navi-pack">
293<title>video NAVI pack</title> 297<title>struct video_navi_pack</title>
294<para>In order to get the navigational data the following structure has to be passed to the ioctl 298<para>In order to get the navigational data the following structure has to be passed to the ioctl
295VIDEO_GET_NAVI: 299VIDEO_GET_NAVI:
296</para> 300</para>
297<programlisting> 301<programlisting>
298 typedef 302 typedef
299 struct video_navi_pack{ 303 struct video_navi_pack {
300 int length; /&#x22C6; 0 ... 1024 &#x22C6;/ 304 int length; /&#x22C6; 0 ... 1024 &#x22C6;/
301 uint8_t data[1024]; 305 uint8_t data[1024];
302 } video_navi_pack_t; 306 } video_navi_pack_t;
@@ -305,7 +309,7 @@ VIDEO_GET_NAVI:
305 309
306 310
307<section id="video-attributes-t"> 311<section id="video-attributes-t">
308<title>video attributes</title> 312<title>video_attributes_t</title>
309<para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES: 313<para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
310</para> 314</para>
311<programlisting> 315<programlisting>
@@ -541,6 +545,8 @@ VIDEO_GET_NAVI:
541role="subsection"><title>VIDEO_STOP</title> 545role="subsection"><title>VIDEO_STOP</title>
542<para>DESCRIPTION 546<para>DESCRIPTION
543</para> 547</para>
548<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
549&VIDIOC-DECODER-CMD; instead.</para>
544<informaltable><tgroup cols="1"><tbody><row><entry 550<informaltable><tgroup cols="1"><tbody><row><entry
545 align="char"> 551 align="char">
546<para>This ioctl call asks the Video Device to stop playing the current stream. 552<para>This ioctl call asks the Video Device to stop playing the current stream.
@@ -598,6 +604,8 @@ role="subsection"><title>VIDEO_STOP</title>
598role="subsection"><title>VIDEO_PLAY</title> 604role="subsection"><title>VIDEO_PLAY</title>
599<para>DESCRIPTION 605<para>DESCRIPTION
600</para> 606</para>
607<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
608&VIDIOC-DECODER-CMD; instead.</para>
601<informaltable><tgroup cols="1"><tbody><row><entry 609<informaltable><tgroup cols="1"><tbody><row><entry
602 align="char"> 610 align="char">
603<para>This ioctl call asks the Video Device to start playing a video stream from the 611<para>This ioctl call asks the Video Device to start playing a video stream from the
@@ -634,6 +642,8 @@ role="subsection"><title>VIDEO_PLAY</title>
634role="subsection"><title>VIDEO_FREEZE</title> 642role="subsection"><title>VIDEO_FREEZE</title>
635<para>DESCRIPTION 643<para>DESCRIPTION
636</para> 644</para>
645<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
646&VIDIOC-DECODER-CMD; instead.</para>
637<informaltable><tgroup cols="1"><tbody><row><entry 647<informaltable><tgroup cols="1"><tbody><row><entry
638 align="char"> 648 align="char">
639<para>This ioctl call suspends the live video stream being played. Decoding 649<para>This ioctl call suspends the live video stream being played. Decoding
@@ -674,6 +684,8 @@ role="subsection"><title>VIDEO_FREEZE</title>
674role="subsection"><title>VIDEO_CONTINUE</title> 684role="subsection"><title>VIDEO_CONTINUE</title>
675<para>DESCRIPTION 685<para>DESCRIPTION
676</para> 686</para>
687<para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
688&VIDIOC-DECODER-CMD; instead.</para>
677<informaltable><tgroup cols="1"><tbody><row><entry 689<informaltable><tgroup cols="1"><tbody><row><entry
678 align="char"> 690 align="char">
679<para>This ioctl call restarts decoding and playing processes of the video stream 691<para>This ioctl call restarts decoding and playing processes of the video stream
@@ -710,6 +722,9 @@ role="subsection"><title>VIDEO_CONTINUE</title>
710role="subsection"><title>VIDEO_SELECT_SOURCE</title> 722role="subsection"><title>VIDEO_SELECT_SOURCE</title>
711<para>DESCRIPTION 723<para>DESCRIPTION
712</para> 724</para>
725<para>This ioctl is for DVB devices only. This ioctl was also supported by the
726V4L2 ivtv driver, but that has been replaced by the ivtv-specific
727<constant>IVTV_IOC_PASSTHROUGH_MODE</constant> ioctl.</para>
713<informaltable><tgroup cols="1"><tbody><row><entry 728<informaltable><tgroup cols="1"><tbody><row><entry
714 align="char"> 729 align="char">
715<para>This ioctl call informs the video device which source shall be used for the input 730<para>This ioctl call informs the video device which source shall be used for the input
@@ -845,10 +860,160 @@ role="subsection"><title>VIDEO_GET_STATUS</title>
845 </row></tbody></tgroup></informaltable> 860 </row></tbody></tgroup></informaltable>
846&return-value-dvb; 861&return-value-dvb;
847 862
863</section><section id="VIDEO_GET_FRAME_COUNT"
864role="subsection"><title>VIDEO_GET_FRAME_COUNT</title>
865<para>DESCRIPTION
866</para>
867<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
868ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_FRAME</constant> control.</para>
869<informaltable><tgroup cols="1"><tbody><row><entry
870 align="char">
871<para>This ioctl call asks the Video Device to return the number of displayed frames
872since the decoder was started.</para>
873</entry>
874 </row></tbody></tgroup></informaltable>
875<para>SYNOPSIS
876</para>
877<informaltable><tgroup cols="1"><tbody><row><entry
878 align="char">
879<para>int ioctl(int fd, int request =
880 VIDEO_GET_FRAME_COUNT, __u64 *pts);</para>
881</entry>
882 </row></tbody></tgroup></informaltable>
883<para>PARAMETERS
884</para>
885<informaltable><tgroup cols="2"><tbody><row><entry
886 align="char">
887<para>int fd</para>
888</entry><entry
889 align="char">
890<para>File descriptor returned by a previous call to open().</para>
891</entry>
892 </row><row><entry
893 align="char">
894<para>int request</para>
895</entry><entry
896 align="char">
897<para>Equals VIDEO_GET_FRAME_COUNT for this
898 command.</para>
899</entry>
900 </row><row><entry
901 align="char">
902<para>__u64 *pts
903</para>
904</entry><entry
905 align="char">
906<para>Returns the number of frames displayed since the decoder was started.
907</para>
908</entry>
909 </row></tbody></tgroup></informaltable>
910&return-value-dvb;
911
912</section><section id="VIDEO_GET_PTS"
913role="subsection"><title>VIDEO_GET_PTS</title>
914<para>DESCRIPTION
915</para>
916<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
917ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_PTS</constant> control.</para>
918<informaltable><tgroup cols="1"><tbody><row><entry
919 align="char">
920<para>This ioctl call asks the Video Device to return the current PTS timestamp.</para>
921</entry>
922 </row></tbody></tgroup></informaltable>
923<para>SYNOPSIS
924</para>
925<informaltable><tgroup cols="1"><tbody><row><entry
926 align="char">
927<para>int ioctl(int fd, int request =
928 VIDEO_GET_PTS, __u64 *pts);</para>
929</entry>
930 </row></tbody></tgroup></informaltable>
931<para>PARAMETERS
932</para>
933<informaltable><tgroup cols="2"><tbody><row><entry
934 align="char">
935<para>int fd</para>
936</entry><entry
937 align="char">
938<para>File descriptor returned by a previous call to open().</para>
939</entry>
940 </row><row><entry
941 align="char">
942<para>int request</para>
943</entry><entry
944 align="char">
945<para>Equals VIDEO_GET_PTS for this
946 command.</para>
947</entry>
948 </row><row><entry
949 align="char">
950<para>__u64 *pts
951</para>
952</entry><entry
953 align="char">
954<para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
955</para>
956<para>
957The PTS should belong to the currently played
958frame if possible, but may also be a value close to it
959like the PTS of the last decoded frame or the last PTS
960extracted by the PES parser.</para>
961</entry>
962 </row></tbody></tgroup></informaltable>
963&return-value-dvb;
964
965</section><section id="VIDEO_GET_FRAME_RATE"
966role="subsection"><title>VIDEO_GET_FRAME_RATE</title>
967<para>DESCRIPTION
968</para>
969<informaltable><tgroup cols="1"><tbody><row><entry
970 align="char">
971<para>This ioctl call asks the Video Device to return the current framerate.</para>
972</entry>
973 </row></tbody></tgroup></informaltable>
974<para>SYNOPSIS
975</para>
976<informaltable><tgroup cols="1"><tbody><row><entry
977 align="char">
978<para>int ioctl(int fd, int request =
979 VIDEO_GET_FRAME_RATE, unsigned int *rate);</para>
980</entry>
981 </row></tbody></tgroup></informaltable>
982<para>PARAMETERS
983</para>
984<informaltable><tgroup cols="2"><tbody><row><entry
985 align="char">
986<para>int fd</para>
987</entry><entry
988 align="char">
989<para>File descriptor returned by a previous call to open().</para>
990</entry>
991 </row><row><entry
992 align="char">
993<para>int request</para>
994</entry><entry
995 align="char">
996<para>Equals VIDEO_GET_FRAME_RATE for this
997 command.</para>
998</entry>
999 </row><row><entry
1000 align="char">
1001<para>unsigned int *rate
1002</para>
1003</entry><entry
1004 align="char">
1005<para>Returns the framerate in number of frames per 1000 seconds.
1006</para>
1007</entry>
1008 </row></tbody></tgroup></informaltable>
1009&return-value-dvb;
1010
848</section><section id="VIDEO_GET_EVENT" 1011</section><section id="VIDEO_GET_EVENT"
849role="subsection"><title>VIDEO_GET_EVENT</title> 1012role="subsection"><title>VIDEO_GET_EVENT</title>
850<para>DESCRIPTION 1013<para>DESCRIPTION
851</para> 1014</para>
1015<para>This ioctl is for DVB devices only. To get events from a V4L2 decoder use the V4L2
1016&VIDIOC-DQEVENT; ioctl instead.</para>
852<informaltable><tgroup cols="1"><tbody><row><entry 1017<informaltable><tgroup cols="1"><tbody><row><entry
853 align="char"> 1018 align="char">
854<para>This ioctl call returns an event of type video_event if available. If an event is 1019<para>This ioctl call returns an event of type video_event if available. If an event is
@@ -914,6 +1079,152 @@ role="subsection"><title>VIDEO_GET_EVENT</title>
914</entry> 1079</entry>
915 </row></tbody></tgroup></informaltable> 1080 </row></tbody></tgroup></informaltable>
916 1081
1082</section><section id="VIDEO_COMMAND"
1083role="subsection"><title>VIDEO_COMMAND</title>
1084<para>DESCRIPTION
1085</para>
1086<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1087ioctl has been replaced by the &VIDIOC-DECODER-CMD; ioctl.</para>
1088<informaltable><tgroup cols="1"><tbody><row><entry
1089 align="char">
1090<para>This ioctl commands the decoder. The <constant>video_command</constant> struct
1091is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1092&VIDIOC-DECODER-CMD; documentation for more information.</para>
1093</entry>
1094 </row></tbody></tgroup></informaltable>
1095<para>SYNOPSIS
1096</para>
1097<informaltable><tgroup cols="1"><tbody><row><entry
1098 align="char">
1099<para>int ioctl(int fd, int request =
1100 VIDEO_COMMAND, struct video_command *cmd);</para>
1101</entry>
1102 </row></tbody></tgroup></informaltable>
1103<para>PARAMETERS
1104</para>
1105<informaltable><tgroup cols="2"><tbody><row><entry
1106 align="char">
1107<para>int fd</para>
1108</entry><entry
1109 align="char">
1110<para>File descriptor returned by a previous call to open().</para>
1111</entry>
1112 </row><row><entry
1113 align="char">
1114<para>int request</para>
1115</entry><entry
1116 align="char">
1117<para>Equals VIDEO_COMMAND for this
1118 command.</para>
1119</entry>
1120 </row><row><entry
1121 align="char">
1122<para>struct video_command *cmd
1123</para>
1124</entry><entry
1125 align="char">
1126<para>Commands the decoder.
1127</para>
1128</entry>
1129 </row></tbody></tgroup></informaltable>
1130&return-value-dvb;
1131
1132</section><section id="VIDEO_TRY_COMMAND"
1133role="subsection"><title>VIDEO_TRY_COMMAND</title>
1134<para>DESCRIPTION
1135</para>
1136<para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this
1137ioctl has been replaced by the &VIDIOC-TRY-DECODER-CMD; ioctl.</para>
1138<informaltable><tgroup cols="1"><tbody><row><entry
1139 align="char">
1140<para>This ioctl tries a decoder command. The <constant>video_command</constant> struct
1141is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the
1142&VIDIOC-TRY-DECODER-CMD; documentation for more information.</para>
1143</entry>
1144 </row></tbody></tgroup></informaltable>
1145<para>SYNOPSIS
1146</para>
1147<informaltable><tgroup cols="1"><tbody><row><entry
1148 align="char">
1149<para>int ioctl(int fd, int request =
1150 VIDEO_TRY_COMMAND, struct video_command *cmd);</para>
1151</entry>
1152 </row></tbody></tgroup></informaltable>
1153<para>PARAMETERS
1154</para>
1155<informaltable><tgroup cols="2"><tbody><row><entry
1156 align="char">
1157<para>int fd</para>
1158</entry><entry
1159 align="char">
1160<para>File descriptor returned by a previous call to open().</para>
1161</entry>
1162 </row><row><entry
1163 align="char">
1164<para>int request</para>
1165</entry><entry
1166 align="char">
1167<para>Equals VIDEO_TRY_COMMAND for this
1168 command.</para>
1169</entry>
1170 </row><row><entry
1171 align="char">
1172<para>struct video_command *cmd
1173</para>
1174</entry><entry
1175 align="char">
1176<para>Try a decoder command.
1177</para>
1178</entry>
1179 </row></tbody></tgroup></informaltable>
1180&return-value-dvb;
1181
1182</section><section id="VIDEO_GET_SIZE"
1183role="subsection"><title>VIDEO_GET_SIZE</title>
1184<para>DESCRIPTION
1185</para>
1186<informaltable><tgroup cols="1"><tbody><row><entry
1187 align="char">
1188<para>This ioctl returns the size and aspect ratio.</para>
1189</entry>
1190 </row></tbody></tgroup></informaltable>
1191<para>SYNOPSIS
1192</para>
1193<informaltable><tgroup cols="1"><tbody><row><entry
1194 align="char">
1195<para>int ioctl(int fd, int request =
1196 VIDEO_GET_SIZE, video_size_t *size);</para>
1197</entry>
1198 </row></tbody></tgroup></informaltable>
1199<para>PARAMETERS
1200</para>
1201<informaltable><tgroup cols="2"><tbody><row><entry
1202 align="char">
1203<para>int fd</para>
1204</entry><entry
1205 align="char">
1206<para>File descriptor returned by a previous call to open().</para>
1207</entry>
1208 </row><row><entry
1209 align="char">
1210<para>int request</para>
1211</entry><entry
1212 align="char">
1213<para>Equals VIDEO_GET_SIZE for this
1214 command.</para>
1215</entry>
1216 </row><row><entry
1217 align="char">
1218<para>video_size_t *size
1219</para>
1220</entry><entry
1221 align="char">
1222<para>Returns the size and aspect ratio.
1223</para>
1224</entry>
1225 </row></tbody></tgroup></informaltable>
1226&return-value-dvb;
1227
917</section><section id="VIDEO_SET_DISPLAY_FORMAT" 1228</section><section id="VIDEO_SET_DISPLAY_FORMAT"
918role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title> 1229role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title>
919<para>DESCRIPTION 1230<para>DESCRIPTION
diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml
index 1078e45f189f..d2eb79e41a01 100644
--- a/Documentation/DocBook/media/v4l/biblio.xml
+++ b/Documentation/DocBook/media/v4l/biblio.xml
@@ -178,23 +178,23 @@ Signal - NTSC for Studio Applications"</title>
1781125-Line High-Definition Production"</title> 1781125-Line High-Definition Production"</title>
179 </biblioentry> 179 </biblioentry>
180 180
181 <biblioentry id="en50067"> 181 <biblioentry id="iec62106">
182 <abbrev>EN&nbsp;50067</abbrev> 182 <abbrev>IEC&nbsp;62106</abbrev>
183 <authorgroup> 183 <authorgroup>
184 <corpauthor>European Committee for Electrotechnical Standardization 184 <corpauthor>International Electrotechnical Commission
185(<ulink url="http://www.cenelec.eu">http://www.cenelec.eu</ulink>)</corpauthor> 185(<ulink url="http://www.iec.ch">http://www.iec.ch</ulink>)</corpauthor>
186 </authorgroup> 186 </authorgroup>
187 <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting 187 <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting
188in the frequency range from 87,5 to 108,0 MHz</title> 188in the frequency range from 87,5 to 108,0 MHz</title>
189 </biblioentry> 189 </biblioentry>
190 190
191 <biblioentry id="nrsc4"> 191 <biblioentry id="nrsc4">
192 <abbrev>NRSC-4</abbrev> 192 <abbrev>NRSC-4-B</abbrev>
193 <authorgroup> 193 <authorgroup>
194 <corpauthor>National Radio Systems Committee 194 <corpauthor>National Radio Systems Committee
195(<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor> 195(<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor>
196 </authorgroup> 196 </authorgroup>
197 <title>NRSC-4: United States RBDS Standard</title> 197 <title>NRSC-4-B: United States RBDS Standard</title>
198 </biblioentry> 198 </biblioentry>
199 199
200 <biblioentry id="iso12232"> 200 <biblioentry id="iso12232">
@@ -226,4 +226,44 @@ in the frequency range from 87,5 to 108,0 MHz</title>
226 <title>VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)</title> 226 <title>VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)</title>
227 </biblioentry> 227 </biblioentry>
228 228
229 <biblioentry id="vesaedid">
230 <abbrev>EDID</abbrev>
231 <authorgroup>
232 <corpauthor>Video Electronics Standards Association
233(<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor>
234 </authorgroup>
235 <title>VESA Enhanced Extended Display Identification Data Standard</title>
236 <subtitle>Release A, Revision 2</subtitle>
237 </biblioentry>
238
239 <biblioentry id="hdcp">
240 <abbrev>HDCP</abbrev>
241 <authorgroup>
242 <corpauthor>Digital Content Protection LLC
243(<ulink url="http://www.digital-cp.com">http://www.digital-cp.com</ulink>)</corpauthor>
244 </authorgroup>
245 <title>High-bandwidth Digital Content Protection System</title>
246 <subtitle>Revision 1.3</subtitle>
247 </biblioentry>
248
249 <biblioentry id="hdmi">
250 <abbrev>HDMI</abbrev>
251 <authorgroup>
252 <corpauthor>HDMI Licensing LLC
253(<ulink url="http://www.hdmi.org">http://www.hdmi.org</ulink>)</corpauthor>
254 </authorgroup>
255 <title>High-Definition Multimedia Interface</title>
256 <subtitle>Specification Version 1.4a</subtitle>
257 </biblioentry>
258
259 <biblioentry id="dp">
260 <abbrev>DP</abbrev>
261 <authorgroup>
262 <corpauthor>Video Electronics Standards Association
263(<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor>
264 </authorgroup>
265 <title>VESA DisplayPort Standard</title>
266 <subtitle>Version 1, Revision 2</subtitle>
267 </biblioentry>
268
229 </bibliography> 269 </bibliography>
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml
index b91d25313b63..73c6847436c9 100644
--- a/Documentation/DocBook/media/v4l/common.xml
+++ b/Documentation/DocBook/media/v4l/common.xml
@@ -564,7 +564,7 @@ automatically.</para>
564 <para>To query and select the standard used by the current video 564 <para>To query and select the standard used by the current video
565input or output applications call the &VIDIOC-G-STD; and 565input or output applications call the &VIDIOC-G-STD; and
566&VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis> 566&VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis>
567standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote> 567standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note that the parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote>
568 <para>An alternative to the current scheme is to use pointers 568 <para>An alternative to the current scheme is to use pointers
569to indices as arguments of <constant>VIDIOC_G_STD</constant> and 569to indices as arguments of <constant>VIDIOC_G_STD</constant> and
570<constant>VIDIOC_S_STD</constant>, the &v4l2-input; and 570<constant>VIDIOC_S_STD</constant>, the &v4l2-input; and
@@ -588,30 +588,28 @@ switch to a standard by &v4l2-std-id;.</para>
588 </footnote> Drivers must implement all video standard ioctls 588 </footnote> Drivers must implement all video standard ioctls
589when the device has one or more video inputs or outputs.</para> 589when the device has one or more video inputs or outputs.</para>
590 590
591 <para>Special rules apply to USB cameras where the notion of video 591 <para>Special rules apply to devices such as USB cameras where the notion of video
592standards makes little sense. More generally any capture device, 592standards makes little sense. More generally for any capture or output device
593output devices accordingly, which is <itemizedlist> 593which is: <itemizedlist>
594 <listitem> 594 <listitem>
595 <para>incapable of capturing fields or frames at the nominal 595 <para>incapable of capturing fields or frames at the nominal
596rate of the video standard, or</para> 596rate of the video standard, or</para>
597 </listitem> 597 </listitem>
598 <listitem> 598 <listitem>
599 <para>where <link linkend="buffer">timestamps</link> refer 599 <para>that does not support the video standard formats at all.</para>
600to the instant the field or frame was received by the driver, not the
601capture time, or</para>
602 </listitem>
603 <listitem>
604 <para>where <link linkend="buffer">sequence numbers</link>
605refer to the frames received by the driver, not the captured
606frames.</para>
607 </listitem> 600 </listitem>
608 </itemizedlist> Here the driver shall set the 601 </itemizedlist> Here the driver shall set the
609<structfield>std</structfield> field of &v4l2-input; and &v4l2-output; 602<structfield>std</structfield> field of &v4l2-input; and &v4l2-output;
610to zero, the <constant>VIDIOC_G_STD</constant>, 603to zero and the <constant>VIDIOC_G_STD</constant>,
611<constant>VIDIOC_S_STD</constant>, 604<constant>VIDIOC_S_STD</constant>,
612<constant>VIDIOC_QUERYSTD</constant> and 605<constant>VIDIOC_QUERYSTD</constant> and
613<constant>VIDIOC_ENUMSTD</constant> ioctls shall return the 606<constant>VIDIOC_ENUMSTD</constant> ioctls shall return the
614&EINVAL;.<footnote> 607&ENOTTY;.<footnote>
608 <para>See <xref linkend="buffer" /> for a rationale.</para>
609 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
610<xref linkend="output-capabilities"/> flags to determine whether the video standard ioctls
611are available for the device.</para>
612&ENOTTY;.
615 <para>See <xref linkend="buffer" /> for a rationale. Probably 613 <para>See <xref linkend="buffer" /> for a rationale. Probably
616even USB cameras follow some well known video standard. It might have 614even USB cameras follow some well known video standard. It might have
617been better to explicitly indicate elsewhere if a device cannot live 615been better to explicitly indicate elsewhere if a device cannot live
@@ -626,9 +624,9 @@ up to normal expectations, instead of this exception.</para>
626&v4l2-standard; standard; 624&v4l2-standard; standard;
627 625
628if (-1 == ioctl (fd, &VIDIOC-G-STD;, &amp;std_id)) { 626if (-1 == ioctl (fd, &VIDIOC-G-STD;, &amp;std_id)) {
629 /* Note when VIDIOC_ENUMSTD always returns EINVAL this 627 /* Note when VIDIOC_ENUMSTD always returns ENOTTY this
630 is no video device or it falls under the USB exception, 628 is no video device or it falls under the USB exception,
631 and VIDIOC_G_STD returning EINVAL is no error. */ 629 and VIDIOC_G_STD returning ENOTTY is no error. */
632 630
633 perror ("VIDIOC_G_STD"); 631 perror ("VIDIOC_G_STD");
634 exit (EXIT_FAILURE); 632 exit (EXIT_FAILURE);
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml
index faa0fd14666a..c6ae4c9d0e0c 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -1476,7 +1476,7 @@ follows.<informaltable>
1476 </row> 1476 </row>
1477 <row> 1477 <row>
1478 <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry> 1478 <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry>
1479 <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant></entry> 1479 <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant> (but this is deprecated)</entry>
1480 </row> 1480 </row>
1481 </tbody> 1481 </tbody>
1482 </tgroup> 1482 </tgroup>
@@ -2468,21 +2468,9 @@ that used it. It was originally scheduled for removal in 2.6.35.
2468 <structfield>reserved2</structfield> and removed 2468 <structfield>reserved2</structfield> and removed
2469 <constant>V4L2_BUF_FLAG_INPUT</constant>.</para> 2469 <constant>V4L2_BUF_FLAG_INPUT</constant>.</para>
2470 </listitem> 2470 </listitem>
2471 </orderedlist>
2472 </section>
2473
2474 <section>
2475 <title>V4L2 in Linux 3.6</title>
2476 <orderedlist>
2477 <listitem> 2471 <listitem>
2478 <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para> 2472 <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para>
2479 </listitem> 2473 </listitem>
2480 </orderedlist>
2481 </section>
2482
2483 <section>
2484 <title>V4L2 in Linux 3.6</title>
2485 <orderedlist>
2486 <listitem> 2474 <listitem>
2487 <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para> 2475 <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para>
2488 </listitem> 2476 </listitem>
@@ -2567,29 +2555,6 @@ and may change in the future.</para>
2567 <para>Video Output Overlay (OSD) Interface, <xref 2555 <para>Video Output Overlay (OSD) Interface, <xref
2568 linkend="osd" />.</para> 2556 linkend="osd" />.</para>
2569 </listitem> 2557 </listitem>
2570 <listitem>
2571 <para><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant>,
2572 &v4l2-buf-type;, <xref linkend="v4l2-buf-type" />.</para>
2573 </listitem>
2574 <listitem>
2575 <para><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant>,
2576&VIDIOC-QUERYCAP; ioctl, <xref linkend="device-capabilities" />.</para>
2577 </listitem>
2578 <listitem>
2579 <para>&VIDIOC-ENUM-FRAMESIZES; and
2580&VIDIOC-ENUM-FRAMEINTERVALS; ioctls.</para>
2581 </listitem>
2582 <listitem>
2583 <para>&VIDIOC-G-ENC-INDEX; ioctl.</para>
2584 </listitem>
2585 <listitem>
2586 <para>&VIDIOC-ENCODER-CMD; and &VIDIOC-TRY-ENCODER-CMD;
2587ioctls.</para>
2588 </listitem>
2589 <listitem>
2590 <para>&VIDIOC-DECODER-CMD; and &VIDIOC-TRY-DECODER-CMD;
2591ioctls.</para>
2592 </listitem>
2593 <listitem> 2558 <listitem>
2594 <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER; 2559 <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER;
2595ioctls.</para> 2560ioctls.</para>
@@ -2615,10 +2580,6 @@ ioctls.</para>
2615 and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para> 2580 and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para>
2616 </listitem> 2581 </listitem>
2617 <listitem> 2582 <listitem>
2618 <para><link linkend="v4l2-auto-focus-area"><constant>
2619 V4L2_CID_AUTO_FOCUS_AREA</constant></link> control.</para>
2620 </listitem>
2621 <listitem>
2622 <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para> 2583 <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para>
2623 </listitem> 2584 </listitem>
2624 </itemizedlist> 2585 </itemizedlist>
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index b0964fb4e834..272a5f718509 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -3505,7 +3505,7 @@ This encodes up to 31 pre-defined programme types.</entry>
3505 </row> 3505 </row>
3506 <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission. 3506 <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission.
3507It is intended for static display on a receiver. It is the primary aid to listeners in programme service 3507It is intended for static display on a receiver. It is the primary aid to listeners in programme service
3508identification and selection. In Annex E of <xref linkend="en50067" />, the RDS specification, 3508identification and selection. In Annex E of <xref linkend="iec62106" />, the RDS specification,
3509there is a full description of the correct character encoding for Programme Service name strings. 3509there is a full description of the correct character encoding for Programme Service name strings.
3510Also from RDS specification, PS is usually a single eight character text. However, it is also possible 3510Also from RDS specification, PS is usually a single eight character text. However, it is also possible
3511to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured 3511to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured
@@ -3519,7 +3519,7 @@ with steps of 8 characters. The result is it must always contain a string with s
3519what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names, 3519what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names,
3520programme-related information or any other text. In these cases, RadioText should be used in addition to 3520programme-related information or any other text. In these cases, RadioText should be used in addition to
3521<constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described 3521<constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described
3522in Annex E of <xref linkend="en50067" />. The length of Radio Text strings depends on which RDS Block is being 3522in Annex E of <xref linkend="iec62106" />. The length of Radio Text strings depends on which RDS Block is being
3523used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible 3523used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible
3524to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured 3524to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured
3525with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry> 3525with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry>
@@ -3650,7 +3650,7 @@ manually or automatically if set to zero. Unit, range and step are driver-specif
3650 </table> 3650 </table>
3651 3651
3652<para>For more details about RDS specification, refer to 3652<para>For more details about RDS specification, refer to
3653<xref linkend="en50067" /> document, from CENELEC.</para> 3653<xref linkend="iec62106" /> document, from CENELEC.</para>
3654 </section> 3654 </section>
3655 3655
3656 <section id="flash-controls"> 3656 <section id="flash-controls">
@@ -3717,232 +3717,231 @@ interface and may change in the future.</para>
3717 use case involving camera or individually. 3717 use case involving camera or individually.
3718 </para> 3718 </para>
3719 3719
3720 </section>
3721 3720
3721 <table pgwide="1" frame="none" id="flash-control-id">
3722 <title>Flash Control IDs</title>
3723
3724 <tgroup cols="4">
3725 <colspec colname="c1" colwidth="1*" />
3726 <colspec colname="c2" colwidth="6*" />
3727 <colspec colname="c3" colwidth="2*" />
3728 <colspec colname="c4" colwidth="6*" />
3729 <spanspec namest="c1" nameend="c2" spanname="id" />
3730 <spanspec namest="c2" nameend="c4" spanname="descr" />
3731 <thead>
3732 <row>
3733 <entry spanname="id" align="left">ID</entry>
3734 <entry align="left">Type</entry>
3735 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
3736 </row>
3737 </thead>
3738 <tbody valign="top">
3739 <row><entry></entry></row>
3740 <row>
3741 <entry spanname="id"><constant>V4L2_CID_FLASH_CLASS</constant></entry>
3742 <entry>class</entry>
3743 </row>
3744 <row>
3745 <entry spanname="descr">The FLASH class descriptor.</entry>
3746 </row>
3747 <row>
3748 <entry spanname="id"><constant>V4L2_CID_FLASH_LED_MODE</constant></entry>
3749 <entry>menu</entry>
3750 </row>
3751 <row id="v4l2-flash-led-mode">
3752 <entry spanname="descr">Defines the mode of the flash LED,
3753 the high-power white LED attached to the flash controller.
3754 Setting this control may not be possible in presence of
3755 some faults. See V4L2_CID_FLASH_FAULT.</entry>
3756 </row>
3757 <row>
3758 <entrytbl spanname="descr" cols="2">
3759 <tbody valign="top">
3760 <row>
3761 <entry><constant>V4L2_FLASH_LED_MODE_NONE</constant></entry>
3762 <entry>Off.</entry>
3763 </row>
3764 <row>
3765 <entry><constant>V4L2_FLASH_LED_MODE_FLASH</constant></entry>
3766 <entry>Flash mode.</entry>
3767 </row>
3768 <row>
3769 <entry><constant>V4L2_FLASH_LED_MODE_TORCH</constant></entry>
3770 <entry>Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.</entry>
3771 </row>
3772 </tbody>
3773 </entrytbl>
3774 </row>
3775 <row>
3776 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_SOURCE</constant></entry>
3777 <entry>menu</entry>
3778 </row>
3779 <row id="v4l2-flash-strobe-source"><entry
3780 spanname="descr">Defines the source of the flash LED
3781 strobe.</entry>
3782 </row>
3783 <row>
3784 <entrytbl spanname="descr" cols="2">
3785 <tbody valign="top">
3786 <row>
3787 <entry><constant>V4L2_FLASH_STROBE_SOURCE_SOFTWARE</constant></entry>
3788 <entry>The flash strobe is triggered by using
3789 the V4L2_CID_FLASH_STROBE control.</entry>
3790 </row>
3791 <row>
3792 <entry><constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL</constant></entry>
3793 <entry>The flash strobe is triggered by an
3794 external source. Typically this is a sensor,
3795 which makes it possible to synchronises the
3796 flash strobe start to exposure start.</entry>
3797 </row>
3798 </tbody>
3799 </entrytbl>
3800 </row>
3801 <row>
3802 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE</constant></entry>
3803 <entry>button</entry>
3804 </row>
3805 <row>
3806 <entry spanname="descr">Strobe flash. Valid when
3807 V4L2_CID_FLASH_LED_MODE is set to
3808 V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
3809 is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
3810 control may not be possible in presence of some faults.
3811 See V4L2_CID_FLASH_FAULT.</entry>
3812 </row>
3813 <row>
3814 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STOP</constant></entry>
3815 <entry>button</entry>
3816 </row>
3817 <row><entry spanname="descr">Stop flash strobe immediately.</entry>
3818 </row>
3819 <row>
3820 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STATUS</constant></entry>
3821 <entry>boolean</entry>
3822 </row>
3823 <row>
3824 <entry spanname="descr">Strobe status: whether the flash
3825 is strobing at the moment or not. This is a read-only
3826 control.</entry>
3827 </row>
3828 <row>
3829 <entry spanname="id"><constant>V4L2_CID_FLASH_TIMEOUT</constant></entry>
3830 <entry>integer</entry>
3831 </row>
3832 <row>
3833 <entry spanname="descr">Hardware timeout for flash. The
3834 flash strobe is stopped after this period of time has
3835 passed from the start of the strobe.</entry>
3836 </row>
3837 <row>
3838 <entry spanname="id"><constant>V4L2_CID_FLASH_INTENSITY</constant></entry>
3839 <entry>integer</entry>
3840 </row>
3841 <row>
3842 <entry spanname="descr">Intensity of the flash strobe when
3843 the flash LED is in flash mode
3844 (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps
3845 (mA) if possible.</entry>
3846 </row>
3847 <row>
3848 <entry spanname="id"><constant>V4L2_CID_FLASH_TORCH_INTENSITY</constant></entry>
3849 <entry>integer</entry>
3850 </row>
3851 <row>
3852 <entry spanname="descr">Intensity of the flash LED in
3853 torch mode (V4L2_FLASH_LED_MODE_TORCH). The unit should be
3854 milliamps (mA) if possible. Setting this control may not
3855 be possible in presence of some faults. See
3856 V4L2_CID_FLASH_FAULT.</entry>
3857 </row>
3858 <row>
3859 <entry spanname="id"><constant>V4L2_CID_FLASH_INDICATOR_INTENSITY</constant></entry>
3860 <entry>integer</entry>
3861 </row>
3862 <row>
3863 <entry spanname="descr">Intensity of the indicator LED.
3864 The indicator LED may be fully independent of the flash
3865 LED. The unit should be microamps (uA) if possible.</entry>
3866 </row>
3867 <row>
3868 <entry spanname="id"><constant>V4L2_CID_FLASH_FAULT</constant></entry>
3869 <entry>bitmask</entry>
3870 </row>
3871 <row>
3872 <entry spanname="descr">Faults related to the flash. The
3873 faults tell about specific problems in the flash chip
3874 itself or the LEDs attached to it. Faults may prevent
3875 further use of some of the flash controls. In particular,
3876 V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
3877 if the fault affects the flash LED. Exactly which faults
3878 have such an effect is chip dependent. Reading the faults
3879 resets the control and returns the chip to a usable state
3880 if possible.</entry>
3881 </row>
3882 <row>
3883 <entrytbl spanname="descr" cols="2">
3884 <tbody valign="top">
3885 <row>
3886 <entry><constant>V4L2_FLASH_FAULT_OVER_VOLTAGE</constant></entry>
3887 <entry>Flash controller voltage to the flash LED
3888 has exceeded the limit specific to the flash
3889 controller.</entry>
3890 </row>
3891 <row>
3892 <entry><constant>V4L2_FLASH_FAULT_TIMEOUT</constant></entry>
3893 <entry>The flash strobe was still on when
3894 the timeout set by the user ---
3895 V4L2_CID_FLASH_TIMEOUT control --- has expired.
3896 Not all flash controllers may set this in all
3897 such conditions.</entry>
3898 </row>
3899 <row>
3900 <entry><constant>V4L2_FLASH_FAULT_OVER_TEMPERATURE</constant></entry>
3901 <entry>The flash controller has overheated.</entry>
3902 </row>
3903 <row>
3904 <entry><constant>V4L2_FLASH_FAULT_SHORT_CIRCUIT</constant></entry>
3905 <entry>The short circuit protection of the flash
3906 controller has been triggered.</entry>
3907 </row>
3908 <row>
3909 <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry>
3910 <entry>Current in the LED power supply has exceeded the limit
3911 specific to the flash controller.</entry>
3912 </row>
3913 <row>
3914 <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry>
3915 <entry>The flash controller has detected a short or open
3916 circuit condition on the indicator LED.</entry>
3917 </row>
3918 </tbody>
3919 </entrytbl>
3920 </row>
3921 <row>
3922 <entry spanname="id"><constant>V4L2_CID_FLASH_CHARGE</constant></entry>
3923 <entry>boolean</entry>
3924 </row>
3925 <row><entry spanname="descr">Enable or disable charging of the xenon
3926 flash capacitor.</entry>
3927 </row>
3928 <row>
3929 <entry spanname="id"><constant>V4L2_CID_FLASH_READY</constant></entry>
3930 <entry>boolean</entry>
3931 </row>
3932 <row>
3933 <entry spanname="descr">Is the flash ready to strobe?
3934 Xenon flashes require their capacitors charged before
3935 strobing. LED flashes often require a cooldown period
3936 after strobe during which another strobe will not be
3937 possible. This is a read-only control.</entry>
3938 </row>
3939 <row><entry></entry></row>
3940 </tbody>
3941 </tgroup>
3942 </table>
3943 </section>
3722 </section> 3944 </section>
3723
3724 <table pgwide="1" frame="none" id="flash-control-id">
3725 <title>Flash Control IDs</title>
3726
3727 <tgroup cols="4">
3728 <colspec colname="c1" colwidth="1*" />
3729 <colspec colname="c2" colwidth="6*" />
3730 <colspec colname="c3" colwidth="2*" />
3731 <colspec colname="c4" colwidth="6*" />
3732 <spanspec namest="c1" nameend="c2" spanname="id" />
3733 <spanspec namest="c2" nameend="c4" spanname="descr" />
3734 <thead>
3735 <row>
3736 <entry spanname="id" align="left">ID</entry>
3737 <entry align="left">Type</entry>
3738 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
3739 </row>
3740 </thead>
3741 <tbody valign="top">
3742 <row><entry></entry></row>
3743 <row>
3744 <entry spanname="id"><constant>V4L2_CID_FLASH_CLASS</constant></entry>
3745 <entry>class</entry>
3746 </row>
3747 <row>
3748 <entry spanname="descr">The FLASH class descriptor.</entry>
3749 </row>
3750 <row>
3751 <entry spanname="id"><constant>V4L2_CID_FLASH_LED_MODE</constant></entry>
3752 <entry>menu</entry>
3753 </row>
3754 <row id="v4l2-flash-led-mode">
3755 <entry spanname="descr">Defines the mode of the flash LED,
3756 the high-power white LED attached to the flash controller.
3757 Setting this control may not be possible in presence of
3758 some faults. See V4L2_CID_FLASH_FAULT.</entry>
3759 </row>
3760 <row>
3761 <entrytbl spanname="descr" cols="2">
3762 <tbody valign="top">
3763 <row>
3764 <entry><constant>V4L2_FLASH_LED_MODE_NONE</constant></entry>
3765 <entry>Off.</entry>
3766 </row>
3767 <row>
3768 <entry><constant>V4L2_FLASH_LED_MODE_FLASH</constant></entry>
3769 <entry>Flash mode.</entry>
3770 </row>
3771 <row>
3772 <entry><constant>V4L2_FLASH_LED_MODE_TORCH</constant></entry>
3773 <entry>Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.</entry>
3774 </row>
3775 </tbody>
3776 </entrytbl>
3777 </row>
3778 <row>
3779 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_SOURCE</constant></entry>
3780 <entry>menu</entry>
3781 </row>
3782 <row id="v4l2-flash-strobe-source"><entry
3783 spanname="descr">Defines the source of the flash LED
3784 strobe.</entry>
3785 </row>
3786 <row>
3787 <entrytbl spanname="descr" cols="2">
3788 <tbody valign="top">
3789 <row>
3790 <entry><constant>V4L2_FLASH_STROBE_SOURCE_SOFTWARE</constant></entry>
3791 <entry>The flash strobe is triggered by using
3792 the V4L2_CID_FLASH_STROBE control.</entry>
3793 </row>
3794 <row>
3795 <entry><constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL</constant></entry>
3796 <entry>The flash strobe is triggered by an
3797 external source. Typically this is a sensor,
3798 which makes it possible to synchronises the
3799 flash strobe start to exposure start.</entry>
3800 </row>
3801 </tbody>
3802 </entrytbl>
3803 </row>
3804 <row>
3805 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE</constant></entry>
3806 <entry>button</entry>
3807 </row>
3808 <row>
3809 <entry spanname="descr">Strobe flash. Valid when
3810 V4L2_CID_FLASH_LED_MODE is set to
3811 V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
3812 is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
3813 control may not be possible in presence of some faults.
3814 See V4L2_CID_FLASH_FAULT.</entry>
3815 </row>
3816 <row>
3817 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STOP</constant></entry>
3818 <entry>button</entry>
3819 </row>
3820 <row><entry spanname="descr">Stop flash strobe immediately.</entry>
3821 </row>
3822 <row>
3823 <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STATUS</constant></entry>
3824 <entry>boolean</entry>
3825 </row>
3826 <row>
3827 <entry spanname="descr">Strobe status: whether the flash
3828 is strobing at the moment or not. This is a read-only
3829 control.</entry>
3830 </row>
3831 <row>
3832 <entry spanname="id"><constant>V4L2_CID_FLASH_TIMEOUT</constant></entry>
3833 <entry>integer</entry>
3834 </row>
3835 <row>
3836 <entry spanname="descr">Hardware timeout for flash. The
3837 flash strobe is stopped after this period of time has
3838 passed from the start of the strobe.</entry>
3839 </row>
3840 <row>
3841 <entry spanname="id"><constant>V4L2_CID_FLASH_INTENSITY</constant></entry>
3842 <entry>integer</entry>
3843 </row>
3844 <row>
3845 <entry spanname="descr">Intensity of the flash strobe when
3846 the flash LED is in flash mode
3847 (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps
3848 (mA) if possible.</entry>
3849 </row>
3850 <row>
3851 <entry spanname="id"><constant>V4L2_CID_FLASH_TORCH_INTENSITY</constant></entry>
3852 <entry>integer</entry>
3853 </row>
3854 <row>
3855 <entry spanname="descr">Intensity of the flash LED in
3856 torch mode (V4L2_FLASH_LED_MODE_TORCH). The unit should be
3857 milliamps (mA) if possible. Setting this control may not
3858 be possible in presence of some faults. See
3859 V4L2_CID_FLASH_FAULT.</entry>
3860 </row>
3861 <row>
3862 <entry spanname="id"><constant>V4L2_CID_FLASH_INDICATOR_INTENSITY</constant></entry>
3863 <entry>integer</entry>
3864 </row>
3865 <row>
3866 <entry spanname="descr">Intensity of the indicator LED.
3867 The indicator LED may be fully independent of the flash
3868 LED. The unit should be microamps (uA) if possible.</entry>
3869 </row>
3870 <row>
3871 <entry spanname="id"><constant>V4L2_CID_FLASH_FAULT</constant></entry>
3872 <entry>bitmask</entry>
3873 </row>
3874 <row>
3875 <entry spanname="descr">Faults related to the flash. The
3876 faults tell about specific problems in the flash chip
3877 itself or the LEDs attached to it. Faults may prevent
3878 further use of some of the flash controls. In particular,
3879 V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
3880 if the fault affects the flash LED. Exactly which faults
3881 have such an effect is chip dependent. Reading the faults
3882 resets the control and returns the chip to a usable state
3883 if possible.</entry>
3884 </row>
3885 <row>
3886 <entrytbl spanname="descr" cols="2">
3887 <tbody valign="top">
3888 <row>
3889 <entry><constant>V4L2_FLASH_FAULT_OVER_VOLTAGE</constant></entry>
3890 <entry>Flash controller voltage to the flash LED
3891 has exceeded the limit specific to the flash
3892 controller.</entry>
3893 </row>
3894 <row>
3895 <entry><constant>V4L2_FLASH_FAULT_TIMEOUT</constant></entry>
3896 <entry>The flash strobe was still on when
3897 the timeout set by the user ---
3898 V4L2_CID_FLASH_TIMEOUT control --- has expired.
3899 Not all flash controllers may set this in all
3900 such conditions.</entry>
3901 </row>
3902 <row>
3903 <entry><constant>V4L2_FLASH_FAULT_OVER_TEMPERATURE</constant></entry>
3904 <entry>The flash controller has overheated.</entry>
3905 </row>
3906 <row>
3907 <entry><constant>V4L2_FLASH_FAULT_SHORT_CIRCUIT</constant></entry>
3908 <entry>The short circuit protection of the flash
3909 controller has been triggered.</entry>
3910 </row>
3911 <row>
3912 <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry>
3913 <entry>Current in the LED power supply has exceeded the limit
3914 specific to the flash controller.</entry>
3915 </row>
3916 <row>
3917 <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry>
3918 <entry>The flash controller has detected a short or open
3919 circuit condition on the indicator LED.</entry>
3920 </row>
3921 </tbody>
3922 </entrytbl>
3923 </row>
3924 <row>
3925 <entry spanname="id"><constant>V4L2_CID_FLASH_CHARGE</constant></entry>
3926 <entry>boolean</entry>
3927 </row>
3928 <row><entry spanname="descr">Enable or disable charging of the xenon
3929 flash capacitor.</entry>
3930 </row>
3931 <row>
3932 <entry spanname="id"><constant>V4L2_CID_FLASH_READY</constant></entry>
3933 <entry>boolean</entry>
3934 </row>
3935 <row>
3936 <entry spanname="descr">Is the flash ready to strobe?
3937 Xenon flashes require their capacitors charged before
3938 strobing. LED flashes often require a cooldown period
3939 after strobe during which another strobe will not be
3940 possible. This is a read-only control.</entry>
3941 </row>
3942 <row><entry></entry></row>
3943 </tbody>
3944 </tgroup>
3945 </table>
3946 </section> 3945 </section>
3947 3946
3948 <section id="jpeg-controls"> 3947 <section id="jpeg-controls">
@@ -4274,4 +4273,165 @@ interface and may change in the future.</para>
4274 </table> 4273 </table>
4275 4274
4276 </section> 4275 </section>
4276
4277 <section id="dv-controls">
4278 <title>Digital Video Control Reference</title>
4279
4280 <note>
4281 <title>Experimental</title>
4282
4283 <para>This is an <link
4284 linkend="experimental">experimental</link> interface and may
4285 change in the future.</para>
4286 </note>
4287
4288 <para>
4289 The Digital Video control class is intended to control receivers
4290 and transmitters for <ulink url="http://en.wikipedia.org/wiki/Vga">VGA</ulink>,
4291 <ulink url="http://en.wikipedia.org/wiki/Digital_Visual_Interface">DVI</ulink>
4292 (Digital Visual Interface), HDMI (<xref linkend="hdmi" />) and DisplayPort (<xref linkend="dp" />).
4293 These controls are generally expected to be private to the receiver or transmitter
4294 subdevice that implements them, so they are only exposed on the
4295 <filename>/dev/v4l-subdev*</filename> device node.
4296 </para>
4297
4298 <para>Note that these devices can have multiple input or output pads which are
4299 hooked up to e.g. HDMI connectors. Even though the subdevice will receive or
4300 transmit video from/to only one of those pads, the other pads can still be
4301 active when it comes to EDID (Extended Display Identification Data,
4302 <xref linkend="vesaedid" />) and HDCP (High-bandwidth Digital Content
4303 Protection System, <xref linkend="hdcp" />) processing, allowing the device
4304 to do the fairly slow EDID/HDCP handling in advance. This allows for quick
4305 switching between connectors.</para>
4306
4307 <para>These pads appear in several of the controls in this section as
4308 bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad 1,
4309 etc. The maximum value of the control is the set of valid pads.</para>
4310
4311 <table pgwide="1" frame="none" id="dv-control-id">
4312 <title>Digital Video Control IDs</title>
4313
4314 <tgroup cols="4">
4315 <colspec colname="c1" colwidth="1*" />
4316 <colspec colname="c2" colwidth="6*" />
4317 <colspec colname="c3" colwidth="2*" />
4318 <colspec colname="c4" colwidth="6*" />
4319 <spanspec namest="c1" nameend="c2" spanname="id" />
4320 <spanspec namest="c2" nameend="c4" spanname="descr" />
4321 <thead>
4322 <row>
4323 <entry spanname="id" align="left">ID</entry>
4324 <entry align="left">Type</entry>
4325 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
4326 </row>
4327 </thead>
4328 <tbody valign="top">
4329 <row><entry></entry></row>
4330 <row>
4331 <entry spanname="id"><constant>V4L2_CID_DV_CLASS</constant></entry>
4332 <entry>class</entry>
4333 </row>
4334 <row>
4335 <entry spanname="descr">The Digital Video class descriptor.</entry>
4336 </row>
4337 <row>
4338 <entry spanname="id"><constant>V4L2_CID_DV_TX_HOTPLUG</constant></entry>
4339 <entry>bitmask</entry>
4340 </row>
4341 <row>
4342 <entry spanname="descr">Many connectors have a hotplug pin which is high
4343 if EDID information is available from the source. This control shows the
4344 state of the hotplug pin as seen by the transmitter.
4345 Each bit corresponds to an output pad on the transmitter. If an output pad
4346 does not have an associated hotplug pin, then the bit for that pad will be 0.
4347 This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors.
4348 </entry>
4349 </row>
4350 <row>
4351 <entry spanname="id"><constant>V4L2_CID_DV_TX_RXSENSE</constant></entry>
4352 <entry>bitmask</entry>
4353 </row>
4354 <row>
4355 <entry spanname="descr">Rx Sense is the detection of pull-ups on the TMDS
4356 clock lines. This normally means that the sink has left/entered standby (i.e.
4357 the transmitter can sense that the receiver is ready to receive video).
4358 Each bit corresponds to an output pad on the transmitter. If an output pad
4359 does not have an associated Rx Sense, then the bit for that pad will be 0.
4360 This read-only control is applicable to DVI-D and HDMI devices.
4361 </entry>
4362 </row>
4363 <row>
4364 <entry spanname="id"><constant>V4L2_CID_DV_TX_EDID_PRESENT</constant></entry>
4365 <entry>bitmask</entry>
4366 </row>
4367 <row>
4368 <entry spanname="descr">When the transmitter sees the hotplug signal from the
4369 receiver it will attempt to read the EDID. If set, then the transmitter has read
4370 at least the first block (= 128 bytes).
4371 Each bit corresponds to an output pad on the transmitter. If an output pad
4372 does not support EDIDs, then the bit for that pad will be 0.
4373 This read-only control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4374 </entry>
4375 </row>
4376 <row>
4377 <entry spanname="id"><constant>V4L2_CID_DV_TX_MODE</constant></entry>
4378 <entry id="v4l2-dv-tx-mode">enum v4l2_dv_tx_mode</entry>
4379 </row>
4380 <row>
4381 <entry spanname="descr">HDMI transmitters can transmit in DVI-D mode (just video)
4382 or in HDMI mode (video + audio + auxiliary data). This control selects which mode
4383 to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
4384 This control is applicable to HDMI connectors.
4385 </entry>
4386 </row>
4387 <row>
4388 <entry spanname="id"><constant>V4L2_CID_DV_TX_RGB_RANGE</constant></entry>
4389 <entry id="v4l2-dv-rgb-range">enum v4l2_dv_rgb_range</entry>
4390 </row>
4391 <row>
4392 <entry spanname="descr">Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
4393 follows the RGB quantization range specified in the standard for the video interface
4394 (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard
4395 to be compatible with sinks that have not implemented the standard correctly
4396 (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be
4397 used whereas limited range sets the range to (16 &lt;&lt; (N-8)) - (235 &lt;&lt; (N-8))
4398 where N is the number of bits per component.
4399 This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4400 </entry>
4401 </row>
4402 <row>
4403 <entry spanname="id"><constant>V4L2_CID_DV_RX_POWER_PRESENT</constant></entry>
4404 <entry>bitmask</entry>
4405 </row>
4406 <row>
4407 <entry spanname="descr">Detects whether the receiver receives power from the source
4408 (e.g. HDMI carries 5V on one of the pins). This is often used to power an eeprom
4409 which contains EDID information, such that the source can read the EDID even if
4410 the sink is in standby/power off.
4411 Each bit corresponds to an input pad on the transmitter. If an input pad
4412 cannot detect whether power is present, then the bit for that pad will be 0.
4413 This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors.
4414 </entry>
4415 </row>
4416 <row>
4417 <entry spanname="id"><constant>V4L2_CID_DV_RX_RGB_RANGE</constant></entry>
4418 <entry>enum v4l2_dv_rgb_range</entry>
4419 </row>
4420 <row>
4421 <entry spanname="descr">Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
4422 follows the RGB quantization range specified in the standard for the video interface
4423 (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard
4424 to be compatible with sources that have not implemented the standard correctly
4425 (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be
4426 used whereas limited range sets the range to (16 &lt;&lt; (N-8)) - (235 &lt;&lt; (N-8))
4427 where N is the number of bits per component.
4428 This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
4429 </entry>
4430 </row>
4431 <row><entry></entry></row>
4432 </tbody>
4433 </tgroup>
4434 </table>
4435
4436 </section>
4277</section> 4437</section>
diff --git a/Documentation/DocBook/media/v4l/dev-osd.xml b/Documentation/DocBook/media/v4l/dev-osd.xml
index 479d9433869a..dd91d6134e8c 100644
--- a/Documentation/DocBook/media/v4l/dev-osd.xml
+++ b/Documentation/DocBook/media/v4l/dev-osd.xml
@@ -1,13 +1,6 @@
1 <title>Video Output Overlay Interface</title> 1 <title>Video Output Overlay Interface</title>
2 <subtitle>Also known as On-Screen Display (OSD)</subtitle> 2 <subtitle>Also known as On-Screen Display (OSD)</subtitle>
3 3
4 <note>
5 <title>Experimental</title>
6
7 <para>This is an <link linkend="experimental">experimental</link>
8interface and may change in the future.</para>
9 </note>
10
11 <para>Some video output devices can overlay a framebuffer image onto 4 <para>Some video output devices can overlay a framebuffer image onto
12the outgoing video signal. Applications can set up such an overlay 5the outgoing video signal. Applications can set up such an overlay
13using this interface, which borrows structures and ioctls of the <link 6using this interface, which borrows structures and ioctls of the <link
diff --git a/Documentation/DocBook/media/v4l/dev-rds.xml b/Documentation/DocBook/media/v4l/dev-rds.xml
index 38883a419e65..be2f33737323 100644
--- a/Documentation/DocBook/media/v4l/dev-rds.xml
+++ b/Documentation/DocBook/media/v4l/dev-rds.xml
@@ -6,7 +6,7 @@ information, on an inaudible audio subcarrier of a radio program. This
6interface is aimed at devices capable of receiving and/or transmitting RDS 6interface is aimed at devices capable of receiving and/or transmitting RDS
7information.</para> 7information.</para>
8 8
9 <para>For more information see the core RDS standard <xref linkend="en50067" /> 9 <para>For more information see the core RDS standard <xref linkend="iec62106" />
10and the RBDS standard <xref linkend="nrsc4" />.</para> 10and the RBDS standard <xref linkend="nrsc4" />.</para>
11 11
12 <para>Note that the RBDS standard as is used in the USA is almost identical 12 <para>Note that the RBDS standard as is used in the USA is almost identical
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index a3d9dd093268..d15aaf83f56f 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -374,29 +374,29 @@
374 rectangle --- if it is supported by the hardware.</para> 374 rectangle --- if it is supported by the hardware.</para>
375 375
376 <orderedlist> 376 <orderedlist>
377 <listitem>Sink pad format. The user configures the sink pad 377 <listitem><para>Sink pad format. The user configures the sink pad
378 format. This format defines the parameters of the image the 378 format. This format defines the parameters of the image the
379 entity receives through the pad for further processing.</listitem> 379 entity receives through the pad for further processing.</para></listitem>
380 380
381 <listitem>Sink pad actual crop selection. The sink pad crop 381 <listitem><para>Sink pad actual crop selection. The sink pad crop
382 defines the crop performed to the sink pad format.</listitem> 382 defines the crop performed to the sink pad format.</para></listitem>
383 383
384 <listitem>Sink pad actual compose selection. The size of the 384 <listitem><para>Sink pad actual compose selection. The size of the
385 sink pad compose rectangle defines the scaling ratio compared 385 sink pad compose rectangle defines the scaling ratio compared
386 to the size of the sink pad crop rectangle. The location of 386 to the size of the sink pad crop rectangle. The location of
387 the compose rectangle specifies the location of the actual 387 the compose rectangle specifies the location of the actual
388 sink compose rectangle in the sink compose bounds 388 sink compose rectangle in the sink compose bounds
389 rectangle.</listitem> 389 rectangle.</para></listitem>
390 390
391 <listitem>Source pad actual crop selection. Crop on the source 391 <listitem><para>Source pad actual crop selection. Crop on the source
392 pad defines crop performed to the image in the sink compose 392 pad defines crop performed to the image in the sink compose
393 bounds rectangle.</listitem> 393 bounds rectangle.</para></listitem>
394 394
395 <listitem>Source pad format. The source pad format defines the 395 <listitem><para>Source pad format. The source pad format defines the
396 output pixel format of the subdev, as well as the other 396 output pixel format of the subdev, as well as the other
397 parameters with the exception of the image width and height. 397 parameters with the exception of the image width and height.
398 Width and height are defined by the size of the source pad 398 Width and height are defined by the size of the source pad
399 actual crop selection.</listitem> 399 actual crop selection.</para></listitem>
400 </orderedlist> 400 </orderedlist>
401 401
402 <para>Accessing any of the above rectangles not supported by the 402 <para>Accessing any of the above rectangles not supported by the
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
index 5bbf3ce1973a..7e29a4e1f696 100644
--- a/Documentation/DocBook/media/v4l/gen-errors.xml
+++ b/Documentation/DocBook/media/v4l/gen-errors.xml
@@ -7,6 +7,15 @@
7 <tbody valign="top"> 7 <tbody valign="top">
8 <!-- Keep it ordered alphabetically --> 8 <!-- Keep it ordered alphabetically -->
9 <row> 9 <row>
10 <entry>EAGAIN (aka EWOULDBLOCK)</entry>
11 <entry>The ioctl can't be handled because the device is in state where
12 it can't perform it. This could happen for example in case where
13 device is sleeping and ioctl is performed to query statistics.
14 It is also returned when the ioctl would need to wait
15 for an event, but the device was opened in non-blocking mode.
16 </entry>
17 </row>
18 <row>
10 <entry>EBADF</entry> 19 <entry>EBADF</entry>
11 <entry>The file descriptor is not a valid.</entry> 20 <entry>The file descriptor is not a valid.</entry>
12 </row> 21 </row>
@@ -51,21 +60,11 @@
51 for periodic transfers (up to 80% of the USB bandwidth).</entry> 60 for periodic transfers (up to 80% of the USB bandwidth).</entry>
52 </row> 61 </row>
53 <row> 62 <row>
54 <entry>ENOSYS or EOPNOTSUPP</entry>
55 <entry>Function not available for this device (dvb API only. Will likely
56 be replaced anytime soon by ENOTTY).</entry>
57 </row>
58 <row>
59 <entry>EPERM</entry> 63 <entry>EPERM</entry>
60 <entry>Permission denied. Can be returned if the device needs write 64 <entry>Permission denied. Can be returned if the device needs write
61 permission, or some special capabilities is needed 65 permission, or some special capabilities is needed
62 (e. g. root)</entry> 66 (e. g. root)</entry>
63 </row> 67 </row>
64 <row>
65 <entry>EWOULDBLOCK</entry>
66 <entry>Operation would block. Used when the ioctl would need to wait
67 for an event, but the device was opened in non-blocking mode.</entry>
68 </row>
69 </tbody> 68 </tbody>
70 </tgroup> 69 </tgroup>
71</table> 70</table>
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index 1885cc0755cb..97f785add841 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -613,8 +613,8 @@ field is independent of the <structfield>timestamp</structfield> and
613 <entry>__u32</entry> 613 <entry>__u32</entry>
614 <entry><structfield>sequence</structfield></entry> 614 <entry><structfield>sequence</structfield></entry>
615 <entry></entry> 615 <entry></entry>
616 <entry>Set by the driver, counting the frames in the 616 <entry>Set by the driver, counting the frames (not fields!) in
617sequence.</entry> 617sequence. This field is set for both input and output devices.</entry>
618 </row> 618 </row>
619 <row> 619 <row>
620 <entry spanname="hspan"><para>In <link 620 <entry spanname="hspan"><para>In <link
@@ -685,18 +685,14 @@ memory, set by the application. See <xref linkend="userp" /> for details.
685 <entry>__u32</entry> 685 <entry>__u32</entry>
686 <entry><structfield>reserved2</structfield></entry> 686 <entry><structfield>reserved2</structfield></entry>
687 <entry></entry> 687 <entry></entry>
688 <entry>A place holder for future extensions and custom 688 <entry>A place holder for future extensions. Applications
689(driver defined) buffer types
690<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
691should set this to 0.</entry> 689should set this to 0.</entry>
692 </row> 690 </row>
693 <row> 691 <row>
694 <entry>__u32</entry> 692 <entry>__u32</entry>
695 <entry><structfield>reserved</structfield></entry> 693 <entry><structfield>reserved</structfield></entry>
696 <entry></entry> 694 <entry></entry>
697 <entry>A place holder for future extensions and custom 695 <entry>A place holder for future extensions. Applications
698(driver defined) buffer types
699<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
700should set this to 0.</entry> 696should set this to 0.</entry>
701 </row> 697 </row>
702 </tbody> 698 </tbody>
@@ -827,14 +823,7 @@ should set this to 0.</entry>
827 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant></entry> 823 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant></entry>
828 <entry>8</entry> 824 <entry>8</entry>
829 <entry>Buffer for video output overlay (OSD), see <xref 825 <entry>Buffer for video output overlay (OSD), see <xref
830 linkend="osd" />. Status: <link 826 linkend="osd" />.</entry>
831linkend="experimental">Experimental</link>.</entry>
832 </row>
833 <row>
834 <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant></entry>
835 <entry>0x80</entry>
836 <entry>This and higher values are reserved for custom
837(driver defined) buffer types.</entry>
838 </row> 827 </row>
839 </tbody> 828 </tbody>
840 </tgroup> 829 </tgroup>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml
index 8eace3e2e7d4..2d3f0b1aefe0 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml
@@ -22,8 +22,7 @@
22 with 10 bits per colour compressed to 8 bits each, using DPCM 22 with 10 bits per colour compressed to 8 bits each, using DPCM
23 compression. DPCM, differential pulse-code modulation, is lossy. 23 compression. DPCM, differential pulse-code modulation, is lossy.
24 Each colour component consumes 8 bits of memory. In other respects 24 Each colour component consumes 8 bits of memory. In other respects
25 this format is similar to <xref 25 this format is similar to <xref linkend="pixfmt-srggb10" />.</para>
26 linkend="pixfmt-srggb10">.</xref></para>
27 26
28 </refsect1> 27 </refsect1>
29 </refentry> 28 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml
new file mode 100644
index 000000000000..2330667907c7
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml
@@ -0,0 +1,154 @@
1 <refentry id="V4L2-PIX-FMT-YVU420M">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YVU420M ('YM21')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname> <constant>V4L2_PIX_FMT_YVU420M</constant></refname>
8 <refpurpose>Variation of <constant>V4L2_PIX_FMT_YVU420</constant>
9 with planes non contiguous in memory. </refpurpose>
10 </refnamediv>
11
12 <refsect1>
13 <title>Description</title>
14
15 <para>This is a multi-planar format, as opposed to a packed format.
16The three components are separated into three sub-images or planes.
17
18The Y plane is first. The Y plane has one byte per pixel. The Cr data
19constitutes the second plane which is half the width and half
20the height of the Y plane (and of the image). Each Cr belongs to four
21pixels, a two-by-two square of the image. For example,
22Cr<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24Y'<subscript>11</subscript>. The Cb data, just like the Cr plane, constitutes
25the third plane. </para>
26
27 <para>If the Y plane has pad bytes after each row, then the Cr
28and Cb planes have half as many pad bytes after their rows. In other
29words, two Cx rows (including padding) is exactly as long as one Y row
30(including padding).</para>
31
32 <para><constant>V4L2_PIX_FMT_YVU420M</constant> is intended to be
33used only in drivers and applications that support the multi-planar API,
34described in <xref linkend="planar-apis"/>. </para>
35
36 <example>
37 <title><constant>V4L2_PIX_FMT_YVU420M</constant> 4 &times; 4
38pixel image</title>
39
40 <formalpara>
41 <title>Byte Order.</title>
42 <para>Each cell is one byte.
43 <informaltable frame="none">
44 <tgroup cols="5" align="center">
45 <colspec align="left" colwidth="2*" />
46 <tbody valign="top">
47 <row>
48 <entry>start0&nbsp;+&nbsp;0:</entry>
49 <entry>Y'<subscript>00</subscript></entry>
50 <entry>Y'<subscript>01</subscript></entry>
51 <entry>Y'<subscript>02</subscript></entry>
52 <entry>Y'<subscript>03</subscript></entry>
53 </row>
54 <row>
55 <entry>start0&nbsp;+&nbsp;4:</entry>
56 <entry>Y'<subscript>10</subscript></entry>
57 <entry>Y'<subscript>11</subscript></entry>
58 <entry>Y'<subscript>12</subscript></entry>
59 <entry>Y'<subscript>13</subscript></entry>
60 </row>
61 <row>
62 <entry>start0&nbsp;+&nbsp;8:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start0&nbsp;+&nbsp;12:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row><entry></entry></row>
76 <row>
77 <entry>start1&nbsp;+&nbsp;0:</entry>
78 <entry>Cr<subscript>00</subscript></entry>
79 <entry>Cr<subscript>01</subscript></entry>
80 </row>
81 <row>
82 <entry>start1&nbsp;+&nbsp;2:</entry>
83 <entry>Cr<subscript>10</subscript></entry>
84 <entry>Cr<subscript>11</subscript></entry>
85 </row>
86 <row><entry></entry></row>
87 <row>
88 <entry>start2&nbsp;+&nbsp;0:</entry>
89 <entry>Cb<subscript>00</subscript></entry>
90 <entry>Cb<subscript>01</subscript></entry>
91 </row>
92 <row>
93 <entry>start2&nbsp;+&nbsp;2:</entry>
94 <entry>Cb<subscript>10</subscript></entry>
95 <entry>Cb<subscript>11</subscript></entry>
96 </row>
97 </tbody>
98 </tgroup>
99 </informaltable>
100 </para>
101 </formalpara>
102
103 <formalpara>
104 <title>Color Sample Location.</title>
105 <para>
106 <informaltable frame="none">
107 <tgroup cols="7" align="center">
108 <tbody valign="top">
109 <row>
110 <entry></entry>
111 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
112 <entry>2</entry><entry></entry><entry>3</entry>
113 </row>
114 <row>
115 <entry>0</entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
117 <entry>Y</entry><entry></entry><entry>Y</entry>
118 </row>
119 <row>
120 <entry></entry>
121 <entry></entry><entry>C</entry><entry></entry><entry></entry>
122 <entry></entry><entry>C</entry><entry></entry>
123 </row>
124 <row>
125 <entry>1</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry>
128 </row>
129 <row>
130 <entry></entry>
131 </row>
132 <row>
133 <entry>2</entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
135 <entry>Y</entry><entry></entry><entry>Y</entry>
136 </row>
137 <row>
138 <entry></entry>
139 <entry></entry><entry>C</entry><entry></entry><entry></entry>
140 <entry></entry><entry>C</entry><entry></entry>
141 </row>
142 <row>
143 <entry>3</entry>
144 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
145 <entry>Y</entry><entry></entry><entry>Y</entry>
146 </row>
147 </tbody>
148 </tgroup>
149 </informaltable>
150 </para>
151 </formalpara>
152 </example>
153 </refsect1>
154 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index e58934c92895..1ddbfabe3195 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -708,6 +708,7 @@ information.</para>
708 &sub-y41p; 708 &sub-y41p;
709 &sub-yuv420; 709 &sub-yuv420;
710 &sub-yuv420m; 710 &sub-yuv420m;
711 &sub-yvu420m;
711 &sub-yuv410; 712 &sub-yuv410;
712 &sub-yuv422p; 713 &sub-yuv422p;
713 &sub-yuv411p; 714 &sub-yuv411p;
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
index e7ed5077834d..4c238ce068b0 100644
--- a/Documentation/DocBook/media/v4l/selection-api.xml
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -40,6 +40,7 @@ cropping and composing rectangles have the same size.</para>
40 <section> 40 <section>
41 <title>Selection targets</title> 41 <title>Selection targets</title>
42 42
43 <para>
43 <figure id="sel-targets-capture"> 44 <figure id="sel-targets-capture">
44 <title>Cropping and composing targets</title> 45 <title>Cropping and composing targets</title>
45 <mediaobject> 46 <mediaobject>
@@ -52,12 +53,12 @@ cropping and composing rectangles have the same size.</para>
52 </textobject> 53 </textobject>
53 </mediaobject> 54 </mediaobject>
54 </figure> 55 </figure>
56 </para>
55 57
58 <para>See <xref linkend="v4l2-selection-targets" /> for more
59 information.</para>
56 </section> 60 </section>
57 61
58 See <xref linkend="v4l2-selection-targets" /> for more
59 information.
60
61 <section> 62 <section>
62 63
63 <title>Configuration</title> 64 <title>Configuration</title>
@@ -216,18 +217,17 @@ composing and cropping operations by setting the appropriate targets. The V4L2
216API lacks any support for composing to and cropping from an image inside a 217API lacks any support for composing to and cropping from an image inside a
217memory buffer. The application could configure a capture device to fill only a 218memory buffer. The application could configure a capture device to fill only a
218part of an image by abusing V4L2 API. Cropping a smaller image from a larger 219part of an image by abusing V4L2 API. Cropping a smaller image from a larger
219one is achieved by setting the field <structfield> 220one is achieved by setting the field
220&v4l2-pix-format;::bytesperline </structfield>. Introducing an image offsets 221&v4l2-pix-format;<structfield>::bytesperline</structfield>. Introducing an image offsets
221could be done by modifying field <structfield> &v4l2-buffer;::m:userptr 222could be done by modifying field &v4l2-buffer;<structfield>::m_userptr</structfield>
222</structfield> before calling <constant> VIDIOC_QBUF </constant>. Those 223before calling <constant> VIDIOC_QBUF </constant>. Those
223operations should be avoided because they are not portable (endianness), and do 224operations should be avoided because they are not portable (endianness), and do
224not work for macroblock and Bayer formats and mmap buffers. The selection API 225not work for macroblock and Bayer formats and mmap buffers. The selection API
225deals with configuration of buffer cropping/composing in a clear, intuitive and 226deals with configuration of buffer cropping/composing in a clear, intuitive and
226portable way. Next, with the selection API the concepts of the padded target 227portable way. Next, with the selection API the concepts of the padded target
227and constraints flags are introduced. Finally, <structname> &v4l2-crop; 228and constraints flags are introduced. Finally, &v4l2-crop; and &v4l2-cropcap;
228</structname> and <structname> &v4l2-cropcap; </structname> have no reserved 229have no reserved fields. Therefore there is no way to extend their functionality.
229fields. Therefore there is no way to extend their functionality. The new 230The new &v4l2-selection; provides a lot of place for future
230<structname> &v4l2-selection; </structname> provides a lot of place for future
231extensions. Driver developers are encouraged to implement only selection API. 231extensions. Driver developers are encouraged to implement only selection API.
232The former cropping API would be simulated using the new one. </para> 232The former cropping API would be simulated using the new one. </para>
233 233
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index eee6908c749f..10ccde9d16d0 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -145,9 +145,12 @@ applications. -->
145 <authorinitials>hv</authorinitials> 145 <authorinitials>hv</authorinitials>
146 <revremark>Added VIDIOC_ENUM_FREQ_BANDS. 146 <revremark>Added VIDIOC_ENUM_FREQ_BANDS.
147 </revremark> 147 </revremark>
148 </revision>
149
150 <revision>
148 <revnumber>3.5</revnumber> 151 <revnumber>3.5</revnumber>
149 <date>2012-05-07</date> 152 <date>2012-05-07</date>
150 <authorinitials>sa, sn</authorinitials> 153 <authorinitials>sa, sn, hv</authorinitials>
151 <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev 154 <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev
152 selections API. Improved the description of V4L2_CID_COLORFX 155 selections API. Improved the description of V4L2_CID_COLORFX
153 control, added V4L2_CID_COLORFX_CBCR control. 156 control, added V4L2_CID_COLORFX_CBCR control.
@@ -158,11 +161,8 @@ applications. -->
158 V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START, 161 V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START,
159 V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS 162 V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS
160 and V4L2_CID_AUTO_FOCUS_RANGE. 163 and V4L2_CID_AUTO_FOCUS_RANGE.
161 </revremark> 164 Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and
162 <date>2012-05-01</date> 165 VIDIOC_DV_TIMINGS_CAP.
163 <authorinitials>hv</authorinitials>
164 <revremark>Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and
165 VIDIOC_DV_TIMINGS_CAP.
166 </revremark> 166 </revremark>
167 </revision> 167 </revision>
168 168
@@ -472,7 +472,7 @@ and discussions on the V4L mailing list.</revremark>
472</partinfo> 472</partinfo>
473 473
474<title>Video for Linux Two API Specification</title> 474<title>Video for Linux Two API Specification</title>
475 <subtitle>Revision 3.5</subtitle> 475 <subtitle>Revision 3.6</subtitle>
476 476
477 <chapter id="common"> 477 <chapter id="common">
478 &sub-common; 478 &sub-common;
@@ -581,6 +581,7 @@ and discussions on the V4L mailing list.</revremark>
581 &sub-subdev-enum-frame-size; 581 &sub-subdev-enum-frame-size;
582 &sub-subdev-enum-mbus-code; 582 &sub-subdev-enum-mbus-code;
583 &sub-subdev-g-crop; 583 &sub-subdev-g-crop;
584 &sub-subdev-g-edid;
584 &sub-subdev-g-fmt; 585 &sub-subdev-g-fmt;
585 &sub-subdev-g-frame-interval; 586 &sub-subdev-g-frame-interval;
586 &sub-subdev-g-selection; 587 &sub-subdev-g-selection;
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
index f1bac2c6e978..bf7cc979fdfa 100644
--- a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
@@ -59,6 +59,9 @@ constant except when switching the video standard. Remember this
59switch can occur implicit when switching the video input or 59switch can occur implicit when switching the video input or
60output.</para> 60output.</para>
61 61
62 <para>This ioctl must be implemented for video capture or output devices that
63support cropping and/or scaling and/or have non-square pixels, and for overlay devices.</para>
64
62 <table pgwide="1" frame="none" id="v4l2-cropcap"> 65 <table pgwide="1" frame="none" id="v4l2-cropcap">
63 <title>struct <structname>v4l2_cropcap</structname></title> 66 <title>struct <structname>v4l2_cropcap</structname></title>
64 <tgroup cols="3"> 67 <tgroup cols="3">
@@ -70,10 +73,10 @@ output.</para>
70 <entry>Type of the data stream, set by the application. 73 <entry>Type of the data stream, set by the application.
71Only these types are valid here: 74Only these types are valid here:
72<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 75<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
76<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>,
73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 77<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 78<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and
75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 79<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
76and higher. See <xref linkend="v4l2-buf-type" />.</entry>
77 </row> 80 </row>
78 <row> 81 <row>
79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> 82 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry>
@@ -156,8 +159,7 @@ on 22 Oct 2002 subject "Re:[V4L][patches!] Re:v4l2/kernel-2.5" -->
156 <term><errorcode>EINVAL</errorcode></term> 159 <term><errorcode>EINVAL</errorcode></term>
157 <listitem> 160 <listitem>
158 <para>The &v4l2-cropcap; <structfield>type</structfield> is 161 <para>The &v4l2-cropcap; <structfield>type</structfield> is
159invalid. This is not permitted for video capture, output and overlay devices, 162invalid.</para>
160which must support <constant>VIDIOC_CROPCAP</constant>.</para>
161 </listitem> 163 </listitem>
162 </varlistentry> 164 </varlistentry>
163 </variablelist> 165 </variablelist>
diff --git a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
index 74b87f6e480a..9215627b04c7 100644
--- a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
@@ -49,13 +49,6 @@
49 <refsect1> 49 <refsect1>
50 <title>Description</title> 50 <title>Description</title>
51 51
52 <note>
53 <title>Experimental</title>
54
55 <para>This is an <link linkend="experimental">experimental</link>
56interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls control an audio/video (usually MPEG-) decoder. 52 <para>These ioctls control an audio/video (usually MPEG-) decoder.
60<constant>VIDIOC_DECODER_CMD</constant> sends a command to the 53<constant>VIDIOC_DECODER_CMD</constant> sends a command to the
61decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to 54decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to
diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
index f431b3ba79bd..0619ca5d2d36 100644
--- a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
@@ -49,13 +49,6 @@
49 <refsect1> 49 <refsect1>
50 <title>Description</title> 50 <title>Description</title>
51 51
52 <note>
53 <title>Experimental</title>
54
55 <para>This is an <link linkend="experimental">experimental</link>
56interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls control an audio/video (usually MPEG-) encoder. 52 <para>These ioctls control an audio/video (usually MPEG-) encoder.
60<constant>VIDIOC_ENCODER_CMD</constant> sends a command to the 53<constant>VIDIOC_ENCODER_CMD</constant> sends a command to the
61encoder, <constant>VIDIOC_TRY_ENCODER_CMD</constant> can be used to 54encoder, <constant>VIDIOC_TRY_ENCODER_CMD</constant> can be used to
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
index 509f0012d2a6..fced5fb0dbf0 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml
@@ -229,6 +229,12 @@ intended for the user.</entry>
229is out of bounds.</para> 229is out of bounds.</para>
230 </listitem> 230 </listitem>
231 </varlistentry> 231 </varlistentry>
232 <varlistentry>
233 <term><errorcode>ENODATA</errorcode></term>
234 <listitem>
235 <para>Digital video presets are not supported for this input or output.</para>
236 </listitem>
237 </varlistentry>
232 </variablelist> 238 </variablelist>
233 </refsect1> 239 </refsect1>
234</refentry> 240</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml
index 24c3bf4fd29a..b3e17c1dfaf5 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml
@@ -106,6 +106,12 @@ application.</entry>
106is out of bounds.</para> 106is out of bounds.</para>
107 </listitem> 107 </listitem>
108 </varlistentry> 108 </varlistentry>
109 <varlistentry>
110 <term><errorcode>ENODATA</errorcode></term>
111 <listitem>
112 <para>Digital video presets are not supported for this input or output.</para>
113 </listitem>
114 </varlistentry>
109 </variablelist> 115 </variablelist>
110 </refsect1> 116 </refsect1>
111</refentry> 117</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
index 81ebe48317fe..f8dfeed34fca 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
@@ -58,6 +58,9 @@ structure. Drivers fill the rest of the structure or return an
58incrementing by one until <errorcode>EINVAL</errorcode> is 58incrementing by one until <errorcode>EINVAL</errorcode> is
59returned.</para> 59returned.</para>
60 60
61 <para>Note that after switching input or output the list of enumerated image
62formats may be different.</para>
63
61 <table pgwide="1" frame="none" id="v4l2-fmtdesc"> 64 <table pgwide="1" frame="none" id="v4l2-fmtdesc">
62 <title>struct <structname>v4l2_fmtdesc</structname></title> 65 <title>struct <structname>v4l2_fmtdesc</structname></title>
63 <tgroup cols="3"> 66 <tgroup cols="3">
@@ -78,10 +81,8 @@ Only these types are valid here:
78<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 81<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
79<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>, 82<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>,
80<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 83<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, 84<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and
82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 85<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
84and higher. See <xref linkend="v4l2-buf-type" />.</entry>
85 </row> 86 </row>
86 <row> 87 <row>
87 <entry>__u32</entry> 88 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
index f77a13f486d7..a78454b5abcd 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml
@@ -50,13 +50,6 @@ and pixel format and receives a frame width and height.</para>
50 <refsect1> 50 <refsect1>
51 <title>Description</title> 51 <title>Description</title>
52 52
53 <note>
54 <title>Experimental</title>
55
56 <para>This is an <link linkend="experimental">experimental</link>
57interface and may change in the future.</para>
58 </note>
59
60 <para>This ioctl allows applications to enumerate all frame sizes 53 <para>This ioctl allows applications to enumerate all frame sizes
61(&ie; width and height in pixels) that the device supports for the 54(&ie; width and height in pixels) that the device supports for the
62given pixel format.</para> 55given pixel format.</para>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
index 46d5a044a537..3c9a81305ad4 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
@@ -283,7 +283,7 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
283 <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> 283 <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
284 </row> 284 </row>
285 <row> 285 <row>
286 <entry><constant>V4L2_IN_CAP_CUSTOM_TIMINGS</constant></entry> 286 <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry>
287 <entry>0x00000002</entry> 287 <entry>0x00000002</entry>
288 <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> 288 <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry>
289 </row> 289 </row>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
index 428020000ef0..f4ab0798545d 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
@@ -168,7 +168,7 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
168 <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> 168 <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
169 </row> 169 </row>
170 <row> 170 <row>
171 <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry> 171 <entry><constant>V4L2_OUT_CAP_DV_TIMINGS</constant></entry>
172 <entry>0x00000002</entry> 172 <entry>0x00000002</entry>
173 <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> 173 <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry>
174 </row> 174 </row>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml
index 3a5fc5405f96..8065099401d1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml
@@ -378,6 +378,12 @@ system)</para></footnote></para></entry>
378is out of bounds.</para> 378is out of bounds.</para>
379 </listitem> 379 </listitem>
380 </varlistentry> 380 </varlistentry>
381 <varlistentry>
382 <term><errorcode>ENODATA</errorcode></term>
383 <listitem>
384 <para>Standard video timings are not supported for this input or output.</para>
385 </listitem>
386 </varlistentry>
381 </variablelist> 387 </variablelist>
382 </refsect1> 388 </refsect1>
383</refentry> 389</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
index c4ff3b1887fb..75c6a93de3c1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
@@ -104,10 +104,8 @@ changed and <constant>VIDIOC_S_CROP</constant> returns the
104 <entry><structfield>type</structfield></entry> 104 <entry><structfield>type</structfield></entry>
105 <entry>Type of the data stream, set by the application. 105 <entry>Type of the data stream, set by the application.
106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> and
108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry>
109defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
110and higher. See <xref linkend="v4l2-buf-type" />.</entry>
111 </row> 109 </row>
112 <row> 110 <row>
113 <entry>&v4l2-rect;</entry> 111 <entry>&v4l2-rect;</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
index 61be9fa3803a..b9ea37634f6c 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml
@@ -78,6 +78,12 @@ If the preset is not supported, it returns an &EINVAL; </para>
78 </listitem> 78 </listitem>
79 </varlistentry> 79 </varlistentry>
80 <varlistentry> 80 <varlistentry>
81 <term><errorcode>ENODATA</errorcode></term>
82 <listitem>
83 <para>Digital video presets are not supported for this input or output.</para>
84 </listitem>
85 </varlistentry>
86 <varlistentry>
81 <term><errorcode>EBUSY</errorcode></term> 87 <term><errorcode>EBUSY</errorcode></term>
82 <listitem> 88 <listitem>
83 <para>The device is busy and therefore can not change the preset.</para> 89 <para>The device is busy and therefore can not change the preset.</para>
@@ -104,7 +110,4 @@ If the preset is not supported, it returns an &EINVAL; </para>
104 </tgroup> 110 </tgroup>
105 </table> 111 </table>
106 </refsect1> 112 </refsect1>
107 <refsect1>
108 &return-value;
109 </refsect1>
110</refentry> 113</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
index eda1a2991bbe..72369707bd77 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
@@ -56,7 +56,9 @@ a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not su
56or the timing values are not correct, the driver returns &EINVAL;.</para> 56or the timing values are not correct, the driver returns &EINVAL;.</para>
57<para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the 57<para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the
58timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" /> 58timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" />
59standards.</para> 59standards. If the current input or output does not support DV timings (e.g. if
60&VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_DV_TIMINGS</constant> flag), then
61&ENODATA; is returned.</para>
60 </refsect1> 62 </refsect1>
61 63
62 <refsect1> 64 <refsect1>
@@ -71,6 +73,12 @@ standards.</para>
71 </listitem> 73 </listitem>
72 </varlistentry> 74 </varlistentry>
73 <varlistentry> 75 <varlistentry>
76 <term><errorcode>ENODATA</errorcode></term>
77 <listitem>
78 <para>Digital video timings are not supported for this input or output.</para>
79 </listitem>
80 </varlistentry>
81 <varlistentry>
74 <term><errorcode>EBUSY</errorcode></term> 82 <term><errorcode>EBUSY</errorcode></term>
75 <listitem> 83 <listitem>
76 <para>The device is busy and therefore can not change the timings.</para> 84 <para>The device is busy and therefore can not change the timings.</para>
@@ -320,7 +328,4 @@ detected or used depends on the hardware.
320 </tgroup> 328 </tgroup>
321 </table> 329 </table>
322 </refsect1> 330 </refsect1>
323 <refsect1>
324 &return-value;
325 </refsect1>
326</refentry> 331</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
index 2aef02c9044e..be25029a16f1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml
@@ -48,13 +48,6 @@
48 <refsect1> 48 <refsect1>
49 <title>Description</title> 49 <title>Description</title>
50 50
51 <note>
52 <title>Experimental</title>
53
54 <para>This is an <link linkend="experimental">experimental</link>
55interface and may change in the future.</para>
56 </note>
57
58 <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides 51 <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides
59meta data about a compressed video stream the same or another 52meta data about a compressed video stream the same or another
60application currently reads from the driver, which is useful for 53application currently reads from the driver, which is useful for
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
index 52acff193a6f..ee8f56e1bac0 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -81,7 +81,7 @@ the application calls the <constant>VIDIOC_S_FMT</constant> ioctl
81with a pointer to a <structname>v4l2_format</structname> structure 81with a pointer to a <structname>v4l2_format</structname> structure
82the driver checks 82the driver checks
83and adjusts the parameters against hardware abilities. Drivers 83and adjusts the parameters against hardware abilities. Drivers
84should not return an error code unless the input is ambiguous, this is 84should not return an error code unless the <structfield>type</structfield> field is invalid, this is
85a mechanism to fathom device capabilities and to approach parameters 85a mechanism to fathom device capabilities and to approach parameters
86acceptable for both the application and driver. On success the driver 86acceptable for both the application and driver. On success the driver
87may program the hardware, allocate resources and generally prepare for 87may program the hardware, allocate resources and generally prepare for
@@ -107,6 +107,10 @@ disabling I/O or possibly time consuming hardware preparations.
107Although strongly recommended drivers are not required to implement 107Although strongly recommended drivers are not required to implement
108this ioctl.</para> 108this ioctl.</para>
109 109
110 <para>The format as returned by <constant>VIDIOC_TRY_FMT</constant>
111must be identical to what <constant>VIDIOC_S_FMT</constant> returns for
112the same input or output.</para>
113
110 <table pgwide="1" frame="none" id="v4l2-format"> 114 <table pgwide="1" frame="none" id="v4l2-format">
111 <title>struct <structname>v4l2_format</structname></title> 115 <title>struct <structname>v4l2_format</structname></title>
112 <tgroup cols="4"> 116 <tgroup cols="4">
@@ -170,9 +174,7 @@ capture and output devices.</entry>
170 <entry></entry> 174 <entry></entry>
171 <entry>__u8</entry> 175 <entry>__u8</entry>
172 <entry><structfield>raw_data</structfield>[200]</entry> 176 <entry><structfield>raw_data</structfield>[200]</entry>
173 <entry>Place holder for future extensions and custom 177 <entry>Place holder for future extensions.</entry>
174(driver defined) formats with <structfield>type</structfield>
175<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher.</entry>
176 </row> 178 </row>
177 </tbody> 179 </tbody>
178 </tgroup> 180 </tgroup>
@@ -187,8 +189,7 @@ capture and output devices.</entry>
187 <term><errorcode>EINVAL</errorcode></term> 189 <term><errorcode>EINVAL</errorcode></term>
188 <listitem> 190 <listitem>
189 <para>The &v4l2-format; <structfield>type</structfield> 191 <para>The &v4l2-format; <structfield>type</structfield>
190field is invalid, the requested buffer type not supported, or the 192field is invalid or the requested buffer type not supported.</para>
191format is not supported with this buffer type.</para>
192 </listitem> 193 </listitem>
193 </varlistentry> 194 </varlistentry>
194 </variablelist> 195 </variablelist>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
index f83d2cdd1185..9058224d1bbf 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
@@ -108,9 +108,7 @@ devices.</para>
108 <entry></entry> 108 <entry></entry>
109 <entry>__u8</entry> 109 <entry>__u8</entry>
110 <entry><structfield>raw_data</structfield>[200]</entry> 110 <entry><structfield>raw_data</structfield>[200]</entry>
111 <entry>A place holder for future extensions and custom 111 <entry>A place holder for future extensions.</entry>
112(driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and
113higher.</entry>
114 </row> 112 </row>
115 </tbody> 113 </tbody>
116 </tgroup> 114 </tgroup>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
index f76d8a6d9b92..b11ec75e21a1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
@@ -152,12 +152,10 @@ satisfactory parameters have been negotiated. If constraints flags have to be
152violated at then ERANGE is returned. The error indicates that <emphasis> there 152violated at then ERANGE is returned. The error indicates that <emphasis> there
153exist no rectangle </emphasis> that satisfies the constraints.</para> 153exist no rectangle </emphasis> that satisfies the constraints.</para>
154 154
155 </refsect1>
156
157 <para>Selection targets and flags are documented in <xref 155 <para>Selection targets and flags are documented in <xref
158 linkend="v4l2-selections-common"/>.</para> 156 linkend="v4l2-selections-common"/>.</para>
159 157
160 <section> 158 <para>
161 <figure id="sel-const-adjust"> 159 <figure id="sel-const-adjust">
162 <title>Size adjustments with constraint flags.</title> 160 <title>Size adjustments with constraint flags.</title>
163 <mediaobject> 161 <mediaobject>
@@ -170,9 +168,9 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
170 </textobject> 168 </textobject>
171 </mediaobject> 169 </mediaobject>
172 </figure> 170 </figure>
173 </section> 171 </para>
174 172
175 <refsect1> 173 <para>
176 <table pgwide="1" frame="none" id="v4l2-selection"> 174 <table pgwide="1" frame="none" id="v4l2-selection">
177 <title>struct <structname>v4l2_selection</structname></title> 175 <title>struct <structname>v4l2_selection</structname></title>
178 <tgroup cols="3"> 176 <tgroup cols="3">
@@ -208,6 +206,7 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
208 </tbody> 206 </tbody>
209 </tgroup> 207 </tgroup>
210 </table> 208 </table>
209 </para>
211 </refsect1> 210 </refsect1>
212 211
213 <refsect1> 212 <refsect1>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-std.xml b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
index 99ff1a016220..4a898417de28 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-std.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-std.xml
@@ -72,7 +72,9 @@ flags, being a write-only ioctl it does not return the actual new standard as
72the current input does not support the requested standard the driver 72the current input does not support the requested standard the driver
73returns an &EINVAL;. When the standard set is ambiguous drivers may 73returns an &EINVAL;. When the standard set is ambiguous drivers may
74return <errorcode>EINVAL</errorcode> or choose any of the requested 74return <errorcode>EINVAL</errorcode> or choose any of the requested
75standards.</para> 75standards. If the current input or output does not support standard video timings (e.g. if
76&VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_STD</constant> flag), then
77&ENODATA; is returned.</para>
76 </refsect1> 78 </refsect1>
77 79
78 <refsect1> 80 <refsect1>
@@ -85,6 +87,12 @@ standards.</para>
85 <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> 87 <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
86 </listitem> 88 </listitem>
87 </varlistentry> 89 </varlistentry>
90 <varlistentry>
91 <term><errorcode>ENODATA</errorcode></term>
92 <listitem>
93 <para>Standard video timings are not supported for this input or output.</para>
94 </listitem>
95 </varlistentry>
88 </variablelist> 96 </variablelist>
89 </refsect1> 97 </refsect1>
90</refentry> 98</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
index 701138f1209d..6cc82010c736 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -354,6 +354,12 @@ radio tuners.</entry>
354 <entry>The &VIDIOC-ENUM-FREQ-BANDS; ioctl can be used to enumerate 354 <entry>The &VIDIOC-ENUM-FREQ-BANDS; ioctl can be used to enumerate
355 the available frequency bands.</entry> 355 the available frequency bands.</entry>
356 </row> 356 </row>
357 <row>
358 <entry><constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant></entry>
359 <entry>0x0800</entry>
360 <entry>The range to search when using the hardware seek functionality
361 is programmable, see &VIDIOC-S-HW-FREQ-SEEK; for details.</entry>
362 </row>
357 </tbody> 363 </tbody>
358 </tgroup> 364 </tgroup>
359 </table> 365 </table>
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
index 77ff5be0809d..6a821a65a5ae 100644
--- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
@@ -155,6 +155,8 @@ or no buffers have been allocated yet, or the
155<structfield>userptr</structfield> or 155<structfield>userptr</structfield> or
156<structfield>length</structfield> are invalid.</para> 156<structfield>length</structfield> are invalid.</para>
157 </listitem> 157 </listitem>
158 </varlistentry>
159 <varlistentry>
158 <term><errorcode>EIO</errorcode></term> 160 <term><errorcode>EIO</errorcode></term>
159 <listitem> 161 <listitem>
160 <para><constant>VIDIOC_DQBUF</constant> failed due to an 162 <para><constant>VIDIOC_DQBUF</constant> failed due to an
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
index 1bc8aeb3ff1f..68b49d09e245 100644
--- a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml
@@ -65,5 +65,14 @@ returned.</para>
65 65
66 <refsect1> 66 <refsect1>
67 &return-value; 67 &return-value;
68
69 <variablelist>
70 <varlistentry>
71 <term><errorcode>ENODATA</errorcode></term>
72 <listitem>
73 <para>Digital video presets are not supported for this input or output.</para>
74 </listitem>
75 </varlistentry>
76 </variablelist>
68 </refsect1> 77 </refsect1>
69</refentry> 78</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml
index 44935a0ffcf0..e185f149e0a1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml
@@ -78,6 +78,12 @@ capabilities in order to give more precise feedback to the user.
78 78
79 <variablelist> 79 <variablelist>
80 <varlistentry> 80 <varlistentry>
81 <term><errorcode>ENODATA</errorcode></term>
82 <listitem>
83 <para>Digital video timings are not supported for this input or output.</para>
84 </listitem>
85 </varlistentry>
86 <varlistentry>
81 <term><errorcode>ENOLINK</errorcode></term> 87 <term><errorcode>ENOLINK</errorcode></term>
82 <listitem> 88 <listitem>
83 <para>No timings could be detected because no signal was found. 89 <para>No timings could be detected because no signal was found.
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
index f33dd746b66b..4c70215ae03f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
@@ -90,11 +90,13 @@ ambiguities.</entry>
90 <entry>__u8</entry> 90 <entry>__u8</entry>
91 <entry><structfield>bus_info</structfield>[32]</entry> 91 <entry><structfield>bus_info</structfield>[32]</entry>
92 <entry>Location of the device in the system, a 92 <entry>Location of the device in the system, a
93NUL-terminated ASCII string. For example: "PCI Slot 4". This 93NUL-terminated ASCII string. For example: "PCI:0000:05:06.0". This
94information is intended for users, to distinguish multiple 94information is intended for users, to distinguish multiple
95identical devices. If no such information is available the field may 95identical devices. If no such information is available the field must
96simply count the devices controlled by the driver, or contain the 96simply count the devices controlled by the driver ("platform:vivi-000").
97empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry> 97The bus_info must start with "PCI:" for PCI boards, "PCIe:" for PCI Express boards,
98"usb-" for USB devices, "I2C:" for i2c devices, "ISA:" for ISA devices,
99"parport" for parallel port devices and "platform:" for platform devices.</entry>
98 </row> 100 </row>
99 <row> 101 <row>
100 <entry>__u32</entry> 102 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-querystd.xml b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
index 4b79c7c04ed6..fe80a183d957 100644
--- a/Documentation/DocBook/media/v4l/vidioc-querystd.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-querystd.xml
@@ -62,5 +62,13 @@ current video input or output.</para>
62 62
63 <refsect1> 63 <refsect1>
64 &return-value; 64 &return-value;
65 <variablelist>
66 <varlistentry>
67 <term><errorcode>ENODATA</errorcode></term>
68 <listitem>
69 <para>Standard video timings are not supported for this input or output.</para>
70 </listitem>
71 </varlistentry>
72 </variablelist>
65 </refsect1> 73 </refsect1>
66</refentry> 74</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
index d7c95057bc51..2b50ef2007f3 100644
--- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
@@ -109,9 +109,8 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref
109 <row> 109 <row>
110 <entry>__u32</entry> 110 <entry>__u32</entry>
111 <entry><structfield>reserved</structfield>[2]</entry> 111 <entry><structfield>reserved</structfield>[2]</entry>
112 <entry>A place holder for future extensions and custom 112 <entry>A place holder for future extensions. This array should
113(driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and 113be zeroed by applications.</entry>
114higher. This array should be zeroed by applications.</entry>
115 </row> 114 </row>
116 </tbody> 115 </tbody>
117 </tgroup> 116 </tgroup>
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
index 3dd1bec6d3c7..5b379e752194 100644
--- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -75,6 +75,9 @@ seek is started.</para>
75 75
76 <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> 76 <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para>
77 77
78 <para>If this ioctl is called from a non-blocking filehandle, then &EAGAIN; is
79 returned and no seek takes place.</para>
80
78 <table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> 81 <table pgwide="1" frame="none" id="v4l2-hw-freq-seek">
79 <title>struct <structname>v4l2_hw_freq_seek</structname></title> 82 <title>struct <structname>v4l2_hw_freq_seek</structname></title>
80 <tgroup cols="3"> 83 <tgroup cols="3">
@@ -158,6 +161,13 @@ fields is wrong.</para>
158 </listitem> 161 </listitem>
159 </varlistentry> 162 </varlistentry>
160 <varlistentry> 163 <varlistentry>
164 <term><errorcode>EAGAIN</errorcode></term>
165 <listitem>
166 <para>Attempted to call <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
167 with the filehandle in non-blocking mode.</para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
161 <term><errorcode>ENODATA</errorcode></term> 171 <term><errorcode>ENODATA</errorcode></term>
162 <listitem> 172 <listitem>
163 <para>The hardware seek found no channels.</para> 173 <para>The hardware seek found no channels.</para>
diff --git a/Documentation/DocBook/media/v4l/vidioc-streamon.xml b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
index 81cca4569050..716ea15e54a1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-streamon.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
@@ -74,7 +74,12 @@ not transmitted yet. I/O returns to the same state as after calling
74stream type. This is the same as &v4l2-requestbuffers; 74stream type. This is the same as &v4l2-requestbuffers;
75<structfield>type</structfield>.</para> 75<structfield>type</structfield>.</para>
76 76
77 <para>Note applications can be preempted for unknown periods right 77 <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming
78is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called
79when streaming is already stopped, then the ioctl does nothing and 0 is
80returned.</para>
81
82 <para>Note that applications can be preempted for unknown periods right
78before or after the <constant>VIDIOC_STREAMON</constant> or 83before or after the <constant>VIDIOC_STREAMON</constant> or
79<constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of 84<constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of
80starting or stopping "now". Buffer timestamps can be used to 85starting or stopping "now". Buffer timestamps can be used to
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
new file mode 100644
index 000000000000..bbd18f0e6ede
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
@@ -0,0 +1,152 @@
1<refentry id="vidioc-subdev-g-edid">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_EDID</refname>
9 <refname>VIDIOC_SUBDEV_S_EDID</refname>
10 <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59 <para>These ioctls can be used to get or set an EDID associated with an input pad
60 from a receiver or an output pad of a transmitter subdevice.</para>
61
62 <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
63 <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
64 fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block
65 <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
66 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
67 pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes
68 large (the size of one block is 128 bytes).</para>
69
70 <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield>
71 to the actual number of blocks. If there are no EDID blocks available at all, then the error code
72 ENODATA is set.</para>
73
74 <para>If blocks have to be retrieved from the sink, then this call will block until they
75 have been read.</para>
76
77 <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
78 <structfield>blocks</structfield> and <structfield>edid</structfield> fields and set
79 <structfield>start_block</structfield> to 0. It is not possible to set part of an EDID,
80 it is always all or nothing. Setting the EDID data is only valid for receivers as it makes
81 no sense for a transmitter.</para>
82
83 <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than
84 the hardware can handle then the EDID is not written, but instead the error code E2BIG is set
85 and <structfield>blocks</structfield> is set to the maximum that the hardware supports.
86 If <structfield>start_block</structfield> is any
87 value other than 0 then the error code EINVAL is set.</para>
88
89 <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the
90 hardware this will drive the hotplug pin low and/or block the source from reading the EDID
91 data in some way. In any case, the end result is the same: the EDID is no longer available.
92 </para>
93
94 <table pgwide="1" frame="none" id="v4l2-subdev-edid">
95 <title>struct <structname>v4l2_subdev_edid</structname></title>
96 <tgroup cols="3">
97 &cs-str;
98 <tbody valign="top">
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>pad</structfield></entry>
102 <entry>Pad for which to get/set the EDID blocks.</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>start_block</structfield></entry>
107 <entry>Read the EDID from starting with this block. Must be 0 when setting
108 the EDID.</entry>
109 </row>
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>blocks</structfield></entry>
113 <entry>The number of blocks to get or set. Must be less or equal to 256 (the
114 maximum number of blocks as defined by the standard). When you set the EDID and
115 <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry>
116 </row>
117 <row>
118 <entry>__u8&nbsp;*</entry>
119 <entry><structfield>edid</structfield></entry>
120 <entry>Pointer to memory that contains the EDID. The minimum size is
121 <structfield>blocks</structfield>&nbsp;*&nbsp;128.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>reserved</structfield>[5]</entry>
126 <entry>Reserved for future extensions. Applications and drivers must
127 set the array to zero.</entry>
128 </row>
129 </tbody>
130 </tgroup>
131 </table>
132 </refsect1>
133
134 <refsect1>
135 &return-value;
136
137 <variablelist>
138 <varlistentry>
139 <term><errorcode>ENODATA</errorcode></term>
140 <listitem>
141 <para>The EDID data is not available.</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term><errorcode>E2BIG</errorcode></term>
146 <listitem>
147 <para>The EDID data you provided is more than the hardware can handle.</para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
151 </refsect1>
152</refentry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
index f33cc814a01d..1ba9e999af3f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -69,23 +69,22 @@
69 more information on how each selection target affects the image 69 more information on how each selection target affects the image
70 processing pipeline inside the subdevice.</para> 70 processing pipeline inside the subdevice.</para>
71 71
72 <section> 72 <refsect2>
73 <title>Types of selection targets</title> 73 <title>Types of selection targets</title>
74 74
75 <para>There are two types of selection targets: actual and bounds. The 75 <para>There are two types of selection targets: actual and bounds. The
76 actual targets are the targets which configure the hardware. The BOUNDS 76 actual targets are the targets which configure the hardware. The BOUNDS
77 target will return a rectangle that contain all possible actual 77 target will return a rectangle that contain all possible actual
78 rectangles.</para> 78 rectangles.</para>
79 </section> 79 </refsect2>
80 80
81 <section> 81 <refsect2>
82 <title>Discovering supported features</title> 82 <title>Discovering supported features</title>
83 83
84 <para>To discover which targets are supported, the user can 84 <para>To discover which targets are supported, the user can
85 perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them. 85 perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them.
86 Any unsupported target will return 86 Any unsupported target will return
87 <constant>EINVAL</constant>.</para> 87 <constant>EINVAL</constant>.</para>
88 </section>
89 88
90 <para>Selection targets and flags are documented in <xref 89 <para>Selection targets and flags are documented in <xref
91 linkend="v4l2-selections-common"/>.</para> 90 linkend="v4l2-selections-common"/>.</para>
@@ -132,6 +131,7 @@
132 </tbody> 131 </tbody>
133 </tgroup> 132 </tgroup>
134 </table> 133 </table>
134 </refsect2>
135 135
136 </refsect1> 136 </refsect1>
137 137
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl
index 4e8e8985cc17..f2413acfe241 100644
--- a/Documentation/DocBook/media_api.tmpl
+++ b/Documentation/DocBook/media_api.tmpl
@@ -29,7 +29,7 @@
29<title>LINUX MEDIA INFRASTRUCTURE API</title> 29<title>LINUX MEDIA INFRASTRUCTURE API</title>
30 30
31<copyright> 31<copyright>
32 <year>2009-2011</year> 32 <year>2009-2012</year>
33 <holder>LinuxTV Developers</holder> 33 <holder>LinuxTV Developers</holder>
34</copyright> 34</copyright>
35 35
@@ -53,7 +53,7 @@ Foundation. A copy of the license is included in the chapter entitled
53 video and radio straming devices, including video cameras, 53 video and radio straming devices, including video cameras,
54 analog and digital TV receiver cards, AM/FM receiver cards, 54 analog and digital TV receiver cards, AM/FM receiver cards,
55 streaming capture devices.</para> 55 streaming capture devices.</para>
56 <para>It is divided into three parts.</para> 56 <para>It is divided into four parts.</para>
57 <para>The first part covers radio, capture, 57 <para>The first part covers radio, capture,
58 cameras and analog TV devices.</para> 58 cameras and analog TV devices.</para>
59 <para>The second part covers the 59 <para>The second part covers the
@@ -62,7 +62,8 @@ Foundation. A copy of the license is included in the chapter entitled
62 in fact it covers several different video standards including 62 in fact it covers several different video standards including
63 DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated 63 DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated
64 to documment support also for DVB-S2, ISDB-T and ISDB-S.</para> 64 to documment support also for DVB-S2, ISDB-T and ISDB-S.</para>
65 <para>The third part covers Remote Controller API</para> 65 <para>The third part covers the Remote Controller API.</para>
66 <para>The fourth part covers the Media Controller API.</para>
66 <para>For additional information and for the latest development code, 67 <para>For additional information and for the latest development code,
67 see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para> 68 see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
68 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para> 69 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para>
@@ -87,7 +88,7 @@ Foundation. A copy of the license is included in the chapter entitled
87</author> 88</author>
88</authorgroup> 89</authorgroup>
89<copyright> 90<copyright>
90 <year>2009-2011</year> 91 <year>2009-2012</year>
91 <holder>Mauro Carvalho Chehab</holder> 92 <holder>Mauro Carvalho Chehab</holder>
92</copyright> 93</copyright>
93 94
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index fc103d7a0474..cdb20d41a44a 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -310,6 +310,12 @@ over a rather long period of time, but improvements are always welcome!
310 code under the influence of preempt_disable(), you instead 310 code under the influence of preempt_disable(), you instead
311 need to use synchronize_irq() or synchronize_sched(). 311 need to use synchronize_irq() or synchronize_sched().
312 312
313 This same limitation also applies to synchronize_rcu_bh()
314 and synchronize_srcu(), as well as to the asynchronous and
315 expedited forms of the three primitives, namely call_rcu(),
316 call_rcu_bh(), call_srcu(), synchronize_rcu_expedited(),
317 synchronize_rcu_bh_expedited(), and synchronize_srcu_expedited().
318
31312. Any lock acquired by an RCU callback must be acquired elsewhere 31912. Any lock acquired by an RCU callback must be acquired elsewhere
314 with softirq disabled, e.g., via spin_lock_irqsave(), 320 with softirq disabled, e.g., via spin_lock_irqsave(),
315 spin_lock_bh(), etc. Failing to disable irq on a given 321 spin_lock_bh(), etc. Failing to disable irq on a given
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt
index 523364e4e1f1..1927151b386b 100644
--- a/Documentation/RCU/stallwarn.txt
+++ b/Documentation/RCU/stallwarn.txt
@@ -99,7 +99,7 @@ In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is
99printed: 99printed:
100 100
101 INFO: rcu_preempt detected stall on CPU 101 INFO: rcu_preempt detected stall on CPU
102 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer=-1 102 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer not pending
103 (t=65000 jiffies) 103 (t=65000 jiffies)
104 104
105The "(64628 ticks this GP)" indicates that this CPU has taken more 105The "(64628 ticks this GP)" indicates that this CPU has taken more
@@ -116,13 +116,13 @@ number between the two "/"s is the value of the nesting, which will
116be a small positive number if in the idle loop and a very large positive 116be a small positive number if in the idle loop and a very large positive
117number (as shown above) otherwise. 117number (as shown above) otherwise.
118 118
119For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the 119For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the CPU is
120CPU is not in the process of trying to force itself into dyntick-idle 120not in the process of trying to force itself into dyntick-idle state, the
121state, the "." indicates that the CPU has not given up forcing RCU 121"." indicates that the CPU has not given up forcing RCU into dyntick-idle
122into dyntick-idle mode (it would be "H" otherwise), and the "timer=-1" 122mode (it would be "H" otherwise), and the "timer not pending" indicates
123indicates that the CPU has not recented forced RCU into dyntick-idle 123that the CPU has not recently forced RCU into dyntick-idle mode (it
124mode (it would otherwise indicate the number of microseconds remaining 124would otherwise indicate the number of microseconds remaining in this
125in this forced state). 125forced state).
126 126
127 127
128Multiple Warnings From One Stall 128Multiple Warnings From One Stall
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index f6f15ce39903..672d19083252 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -333,23 +333,23 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
333The output of "cat rcu/rcu_pending" looks as follows: 333The output of "cat rcu/rcu_pending" looks as follows:
334 334
335rcu_sched: 335rcu_sched:
336 0 np=255892 qsp=53936 rpq=85 cbr=0 cng=14417 gpc=10033 gps=24320 nf=6445 nn=146741 336 0 np=255892 qsp=53936 rpq=85 cbr=0 cng=14417 gpc=10033 gps=24320 nn=146741
337 1 np=261224 qsp=54638 rpq=33 cbr=0 cng=25723 gpc=16310 gps=2849 nf=5912 nn=155792 337 1 np=261224 qsp=54638 rpq=33 cbr=0 cng=25723 gpc=16310 gps=2849 nn=155792
338 2 np=237496 qsp=49664 rpq=23 cbr=0 cng=2762 gpc=45478 gps=1762 nf=1201 nn=136629 338 2 np=237496 qsp=49664 rpq=23 cbr=0 cng=2762 gpc=45478 gps=1762 nn=136629
339 3 np=236249 qsp=48766 rpq=98 cbr=0 cng=286 gpc=48049 gps=1218 nf=207 nn=137723 339 3 np=236249 qsp=48766 rpq=98 cbr=0 cng=286 gpc=48049 gps=1218 nn=137723
340 4 np=221310 qsp=46850 rpq=7 cbr=0 cng=26 gpc=43161 gps=4634 nf=3529 nn=123110 340 4 np=221310 qsp=46850 rpq=7 cbr=0 cng=26 gpc=43161 gps=4634 nn=123110
341 5 np=237332 qsp=48449 rpq=9 cbr=0 cng=54 gpc=47920 gps=3252 nf=201 nn=137456 341 5 np=237332 qsp=48449 rpq=9 cbr=0 cng=54 gpc=47920 gps=3252 nn=137456
342 6 np=219995 qsp=46718 rpq=12 cbr=0 cng=50 gpc=42098 gps=6093 nf=4202 nn=120834 342 6 np=219995 qsp=46718 rpq=12 cbr=0 cng=50 gpc=42098 gps=6093 nn=120834
343 7 np=249893 qsp=49390 rpq=42 cbr=0 cng=72 gpc=38400 gps=17102 nf=41 nn=144888 343 7 np=249893 qsp=49390 rpq=42 cbr=0 cng=72 gpc=38400 gps=17102 nn=144888
344rcu_bh: 344rcu_bh:
345 0 np=146741 qsp=1419 rpq=6 cbr=0 cng=6 gpc=0 gps=0 nf=2 nn=145314 345 0 np=146741 qsp=1419 rpq=6 cbr=0 cng=6 gpc=0 gps=0 nn=145314
346 1 np=155792 qsp=12597 rpq=3 cbr=0 cng=0 gpc=4 gps=8 nf=3 nn=143180 346 1 np=155792 qsp=12597 rpq=3 cbr=0 cng=0 gpc=4 gps=8 nn=143180
347 2 np=136629 qsp=18680 rpq=1 cbr=0 cng=0 gpc=7 gps=6 nf=0 nn=117936 347 2 np=136629 qsp=18680 rpq=1 cbr=0 cng=0 gpc=7 gps=6 nn=117936
348 3 np=137723 qsp=2843 rpq=0 cbr=0 cng=0 gpc=10 gps=7 nf=0 nn=134863 348 3 np=137723 qsp=2843 rpq=0 cbr=0 cng=0 gpc=10 gps=7 nn=134863
349 4 np=123110 qsp=12433 rpq=0 cbr=0 cng=0 gpc=4 gps=2 nf=0 nn=110671 349 4 np=123110 qsp=12433 rpq=0 cbr=0 cng=0 gpc=4 gps=2 nn=110671
350 5 np=137456 qsp=4210 rpq=1 cbr=0 cng=0 gpc=6 gps=5 nf=0 nn=133235 350 5 np=137456 qsp=4210 rpq=1 cbr=0 cng=0 gpc=6 gps=5 nn=133235
351 6 np=120834 qsp=9902 rpq=2 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 351 6 np=120834 qsp=9902 rpq=2 cbr=0 cng=0 gpc=6 gps=3 nn=110921
352 7 np=144888 qsp=26336 rpq=0 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 352 7 np=144888 qsp=26336 rpq=0 cbr=0 cng=0 gpc=8 gps=2 nn=118542
353 353
354As always, this is once again split into "rcu_sched" and "rcu_bh" 354As always, this is once again split into "rcu_sched" and "rcu_bh"
355portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional 355portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional
@@ -377,17 +377,6 @@ o "gpc" is the number of times that an old grace period had
377o "gps" is the number of times that a new grace period had started, 377o "gps" is the number of times that a new grace period had started,
378 but this CPU was not yet aware of it. 378 but this CPU was not yet aware of it.
379 379
380o "nf" is the number of times that this CPU suspected that the
381 current grace period had run for too long, and thus needed to
382 be forced.
383
384 Please note that "forcing" consists of sending resched IPIs
385 to holdout CPUs. If that CPU really still is in an old RCU
386 read-side critical section, then we really do have to wait for it.
387 The assumption behing "forcing" is that the CPU is not still in
388 an old RCU read-side critical section, but has not yet responded
389 for some other reason.
390
391o "nn" is the number of times that this CPU needed nothing. Alert 380o "nn" is the number of times that this CPU needed nothing. Alert
392 readers will note that the rcu "nn" number for a given CPU very 381 readers will note that the rcu "nn" number for a given CPU very
393 closely matches the rcu_bh "np" number for that same CPU. This 382 closely matches the rcu_bh "np" number for that same CPU. This
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index 69ee188515e7..bf0f6de2aa00 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -873,7 +873,7 @@ d. Do you need to treat NMI handlers, hardirq handlers,
873 and code segments with preemption disabled (whether 873 and code segments with preemption disabled (whether
874 via preempt_disable(), local_irq_save(), local_bh_disable(), 874 via preempt_disable(), local_irq_save(), local_bh_disable(),
875 or some other mechanism) as if they were explicit RCU readers? 875 or some other mechanism) as if they were explicit RCU readers?
876 If so, you need RCU-sched. 876 If so, RCU-sched is the only choice that will work for you.
877 877
878e. Do you need RCU grace periods to complete even in the face 878e. Do you need RCU grace periods to complete even in the face
879 of softirq monopolization of one or more of the CPUs? For 879 of softirq monopolization of one or more of the CPUs? For
@@ -884,7 +884,12 @@ f. Is your workload too update-intensive for normal use of
884 RCU, but inappropriate for other synchronization mechanisms? 884 RCU, but inappropriate for other synchronization mechanisms?
885 If so, consider SLAB_DESTROY_BY_RCU. But please be careful! 885 If so, consider SLAB_DESTROY_BY_RCU. But please be careful!
886 886
887g. Otherwise, use RCU. 887g. Do you need read-side critical sections that are respected
888 even though they are in the middle of the idle loop, during
889 user-mode execution, or on an offlined CPU? If so, SRCU is the
890 only choice that will work for you.
891
892h. Otherwise, use RCU.
888 893
889Of course, this all assumes that you have determined that RCU is in fact 894Of course, this all assumes that you have determined that RCU is in fact
890the right tool for your job. 895the right tool for your job.
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index f6318f6d7baf..6f706aca2049 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -98,10 +98,9 @@ static int create_nl_socket(int protocol)
98 if (rcvbufsz) 98 if (rcvbufsz)
99 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, 99 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
100 &rcvbufsz, sizeof(rcvbufsz)) < 0) { 100 &rcvbufsz, sizeof(rcvbufsz)) < 0) {
101 fprintf(stderr, "Unable to set socket rcv buf size " 101 fprintf(stderr, "Unable to set socket rcv buf size to %d\n",
102 "to %d\n",
103 rcvbufsz); 102 rcvbufsz);
104 return -1; 103 goto error;
105 } 104 }
106 105
107 memset(&local, 0, sizeof(local)); 106 memset(&local, 0, sizeof(local));
diff --git a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt
index 5f5aa16047ff..bfc9cb19abcd 100644
--- a/Documentation/aoe/aoe.txt
+++ b/Documentation/aoe/aoe.txt
@@ -1,8 +1,16 @@
1The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... 1ATA over Ethernet is a network protocol that provides simple access to
2block storage on the LAN.
2 3
3 http://www.coraid.com/SUPPORT/EtherDrive-HBA 4 http://support.coraid.com/documents/AoEr11.txt
4 5
5 It has many tips and hints! 6The EtherDrive (R) HOWTO for 2.6 and 3.x kernels is found at ...
7
8 http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO.html
9
10It has many tips and hints! Please see, especially, recommended
11tunings for virtual memory:
12
13 http://support.coraid.com/support/linux/EtherDrive-2.6-HOWTO-5.html#ss5.19
6 14
7The aoetools are userland programs that are designed to work with this 15The aoetools are userland programs that are designed to work with this
8driver. The aoetools are on sourceforge. 16driver. The aoetools are on sourceforge.
@@ -23,20 +31,12 @@ CREATING DEVICE NODES
23 There is a udev-install.sh script that shows how to install these 31 There is a udev-install.sh script that shows how to install these
24 rules on your system. 32 rules on your system.
25 33
26 If you are not using udev, two scripts are provided in
27 Documentation/aoe as examples of static device node creation for
28 using the aoe driver.
29
30 rm -rf /dev/etherd
31 sh Documentation/aoe/mkdevs.sh /dev/etherd
32
33 ... or to make just one shelf's worth of block device nodes ...
34
35 sh Documentation/aoe/mkshelf.sh /dev/etherd 0
36
37 There is also an autoload script that shows how to edit 34 There is also an autoload script that shows how to edit
38 /etc/modprobe.d/aoe.conf to ensure that the aoe module is loaded when 35 /etc/modprobe.d/aoe.conf to ensure that the aoe module is loaded when
39 necessary. 36 necessary. Preloading the aoe module is preferable to autoloading,
37 however, because AoE discovery takes a few seconds. It can be
38 confusing when an AoE device is not present the first time the a
39 command is run but appears a second later.
40 40
41USING DEVICE NODES 41USING DEVICE NODES
42 42
@@ -51,9 +51,9 @@ USING DEVICE NODES
51 "echo > /dev/etherd/discover" tells the driver to find out what AoE 51 "echo > /dev/etherd/discover" tells the driver to find out what AoE
52 devices are available. 52 devices are available.
53 53
54 These character devices may disappear and be replaced by sysfs 54 In the future these character devices may disappear and be replaced
55 counterparts. Using the commands in aoetools insulates users from 55 by sysfs counterparts. Using the commands in aoetools insulates
56 these implementation details. 56 users from these implementation details.
57 57
58 The block devices are named like this: 58 The block devices are named like this:
59 59
@@ -76,8 +76,8 @@ USING SYSFS
76 The netif attribute is the network interface on the localhost 76 The netif attribute is the network interface on the localhost
77 through which we are communicating with the remote AoE device. 77 through which we are communicating with the remote AoE device.
78 78
79 There is a script in this directory that formats this information 79 There is a script in this directory that formats this information in
80 in a convenient way. Users with aoetools can use the aoe-stat 80 a convenient way. Users with aoetools should use the aoe-stat
81 command. 81 command.
82 82
83 root@makki root# sh Documentation/aoe/status.sh 83 root@makki root# sh Documentation/aoe/status.sh
@@ -121,3 +121,21 @@ DRIVER OPTIONS
121 usage example for the module parameter. 121 usage example for the module parameter.
122 122
123 modprobe aoe_iflist="eth1 eth3" 123 modprobe aoe_iflist="eth1 eth3"
124
125 The aoe_deadsecs module parameter determines the maximum number of
126 seconds that the driver will wait for an AoE device to provide a
127 response to an AoE command. After aoe_deadsecs seconds have
128 elapsed, the AoE device will be marked as "down".
129
130 The aoe_maxout module parameter has a default of 128. This is the
131 maximum number of unresponded packets that will be sent to an AoE
132 target at one time.
133
134 The aoe_dyndevs module parameter defaults to 1, meaning that the
135 driver will assign a block device minor number to a discovered AoE
136 target based on the order of its discovery. With dynamic minor
137 device numbers in use, a greater range of AoE shelf and slot
138 addresses can be supported. Users with udev will never have to
139 think about minor numbers. Using aoe_dyndevs=0 allows device nodes
140 to be pre-created using a static minor-number scheme with the
141 aoe-mkshelf script in the aoetools.
diff --git a/Documentation/aoe/mkdevs.sh b/Documentation/aoe/mkdevs.sh
deleted file mode 100644
index 44c0ab702432..000000000000
--- a/Documentation/aoe/mkdevs.sh
+++ /dev/null
@@ -1,41 +0,0 @@
1#!/bin/sh
2
3n_shelves=${n_shelves:-10}
4n_partitions=${n_partitions:-16}
5
6if test "$#" != "1"; then
7 echo "Usage: sh `basename $0` {dir}" 1>&2
8 echo " n_partitions=16 sh `basename $0` {dir}" 1>&2
9 exit 1
10fi
11dir=$1
12
13MAJOR=152
14
15echo "Creating AoE devnode files in $dir ..."
16
17set -e
18
19mkdir -p $dir
20
21# (Status info is in sysfs. See status.sh.)
22# rm -f $dir/stat
23# mknod -m 0400 $dir/stat c $MAJOR 1
24rm -f $dir/err
25mknod -m 0400 $dir/err c $MAJOR 2
26rm -f $dir/discover
27mknod -m 0200 $dir/discover c $MAJOR 3
28rm -f $dir/interfaces
29mknod -m 0200 $dir/interfaces c $MAJOR 4
30rm -f $dir/revalidate
31mknod -m 0200 $dir/revalidate c $MAJOR 5
32rm -f $dir/flush
33mknod -m 0200 $dir/flush c $MAJOR 6
34
35export n_partitions
36mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`
37i=0
38while test $i -lt $n_shelves; do
39 sh -xc "sh $mkshelf $dir $i"
40 i=`expr $i + 1`
41done
diff --git a/Documentation/aoe/mkshelf.sh b/Documentation/aoe/mkshelf.sh
deleted file mode 100644
index 32615814271c..000000000000
--- a/Documentation/aoe/mkshelf.sh
+++ /dev/null
@@ -1,28 +0,0 @@
1#! /bin/sh
2
3if test "$#" != "2"; then
4 echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2
5 echo " n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2
6 exit 1
7fi
8n_partitions=${n_partitions:-16}
9dir=$1
10shelf=$2
11nslots=16
12maxslot=`echo $nslots 1 - p | dc`
13MAJOR=152
14
15set -e
16
17minor=`echo $nslots \* $shelf \* $n_partitions | bc`
18endp=`echo $n_partitions - 1 | bc`
19for slot in `seq 0 $maxslot`; do
20 for part in `seq 0 $endp`; do
21 name=e$shelf.$slot
22 test "$part" != "0" && name=${name}p$part
23 rm -f $dir/$name
24 mknod -m 0660 $dir/$name b $MAJOR $minor
25
26 minor=`expr $minor + 1`
27 done
28done
diff --git a/Documentation/aoe/status.sh b/Documentation/aoe/status.sh
index 751f3be514b8..eeec7baae57a 100644
--- a/Documentation/aoe/status.sh
+++ b/Documentation/aoe/status.sh
@@ -1,5 +1,8 @@
1#! /bin/sh 1#! /bin/sh
2# collate and present sysfs information about AoE storage 2# collate and present sysfs information about AoE storage
3#
4# A more complete version of this script is aoe-stat, in the
5# aoetools.
3 6
4set -e 7set -e
5format="%8s\t%8s\t%8s\n" 8format="%8s\t%8s\t%8s\n"
diff --git a/Documentation/arm/Marvell/README b/Documentation/arm/Marvell/README
new file mode 100644
index 000000000000..8f08a86e03b7
--- /dev/null
+++ b/Documentation/arm/Marvell/README
@@ -0,0 +1,232 @@
1ARM Marvell SoCs
2================
3
4This document lists all the ARM Marvell SoCs that are currently
5supported in mainline by the Linux kernel. As the Marvell families of
6SoCs are large and complex, it is hard to understand where the support
7for a particular SoC is available in the Linux kernel. This document
8tries to help in understanding where those SoCs are supported, and to
9match them with their corresponding public datasheet, when available.
10
11Orion family
12------------
13
14 Flavors:
15 88F5082
16 88F5181
17 88F5181L
18 88F5182
19 Datasheet : http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf
20 Programmer's User Guide : http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf
21 User Manual : http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf
22 88F5281
23 Datasheet : http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
24 88F6183
25 Core: Feroceon ARMv5 compatible
26 Linux kernel mach directory: arch/arm/mach-orion5x
27 Linux kernel plat directory: arch/arm/plat-orion
28
29Kirkwood family
30---------------
31
32 Flavors:
33 88F6282 a.k.a Armada 300
34 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
35 88F6283 a.k.a Armada 310
36 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
37 88F6190
38 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
39 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
40 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
41 88F6192
42 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
43 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
44 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
45 88F6182
46 88F6180
47 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
48 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
49 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
50 88F6281
51 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
52 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
53 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
54 Homepage: http://www.marvell.com/embedded-processors/kirkwood/
55 Core: Feroceon ARMv5 compatible
56 Linux kernel mach directory: arch/arm/mach-kirkwood
57 Linux kernel plat directory: arch/arm/plat-orion
58
59Discovery family
60----------------
61
62 Flavors:
63 MV78100
64 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
65 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
66 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
67 MV78200
68 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
69 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
70 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
71 MV76100
72 Not supported by the Linux kernel.
73
74 Core: Feroceon ARMv5 compatible
75
76 Linux kernel mach directory: arch/arm/mach-mv78xx0
77 Linux kernel plat directory: arch/arm/plat-orion
78
79EBU Armada family
80-----------------
81
82 Armada 370 Flavors:
83 88F6710
84 88F6707
85 88F6W11
86
87 Armada XP Flavors:
88 MV78230
89 MV78260
90 MV78460
91
92 Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
93 No public datasheet available.
94
95 Core: Sheeva ARMv7 compatible
96
97 Linux kernel mach directory: arch/arm/mach-mvebu
98 Linux kernel plat directory: none
99
100Avanta family
101-------------
102
103 Flavors:
104 88F6510
105 88F6530P
106 88F6550
107 88F6560
108 Homepage : http://www.marvell.com/broadband/
109 Product Brief: http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
110 No public datasheet available.
111
112 Core: ARMv5 compatible
113
114 Linux kernel mach directory: no code in mainline yet, planned for the future
115 Linux kernel plat directory: no code in mainline yet, planned for the future
116
117Dove family (application processor)
118-----------------------------------
119
120 Flavors:
121 88AP510 a.k.a Armada 510
122 Product Brief : http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
123 Hardware Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
124 Functional Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
125 Homepage: http://www.marvell.com/application-processors/armada-500/
126 Core: ARMv7 compatible
127 Directory: arch/arm/mach-dove
128
129PXA 2xx/3xx/93x/95x family
130--------------------------
131
132 Flavors:
133 PXA21x, PXA25x, PXA26x
134 Application processor only
135 Core: ARMv5 XScale core
136 PXA270, PXA271, PXA272
137 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
138 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
139 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
140 Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
141 Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
142 Application processor only
143 Core: ARMv5 XScale core
144 PXA300, PXA310, PXA320
145 PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
146 PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
147 PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
148 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
149 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
150 Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
151 Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
152 Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
153 Application processor only
154 Core: ARMv5 XScale core
155 PXA930, PXA935
156 Application processor with Communication processor
157 Core: ARMv5 XScale core
158 PXA955
159 Application processor with Communication processor
160 Core: ARMv7 compatible Sheeva PJ4 core
161
162 Comments:
163
164 * This line of SoCs originates from the XScale family developed by
165 Intel and acquired by Marvell in ~2006. The PXA21x, PXA25x,
166 PXA26x, PXA27x, PXA3xx and PXA93x were developed by Intel, while
167 the later PXA95x were developed by Marvell.
168
169 * Due to their XScale origin, these SoCs have virtually nothing in
170 common with the other (Kirkwood, Dove, etc.) families of Marvell
171 SoCs, except with the MMP/MMP2 family of SoCs.
172
173 Linux kernel mach directory: arch/arm/mach-pxa
174 Linux kernel plat directory: arch/arm/plat-pxa
175
176MMP/MMP2 family (communication processor)
177-----------------------------------------
178
179 Flavors:
180 PXA168, a.k.a Armada 168
181 Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp
182 Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
183 Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
184 Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
185 Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
186 Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
187 App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
188 Application processor only
189 Core: ARMv5 compatible Marvell PJ1 (Mohawk)
190 PXA910
191 Homepage : http://www.marvell.com/communication-processors/pxa910/
192 Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf
193 Application processor with Communication processor
194 Core: ARMv5 compatible Marvell PJ1 (Mohawk)
195 MMP2, a.k.a Armada 610
196 Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
197 Application processor only
198 Core: ARMv7 compatible Sheeva PJ4 core
199
200 Comments:
201
202 * This line of SoCs originates from the XScale family developed by
203 Intel and acquired by Marvell in ~2006. All the processors of
204 this MMP/MMP2 family were developed by Marvell.
205
206 * Due to their XScale origin, these SoCs have virtually nothing in
207 common with the other (Kirkwood, Dove, etc.) families of Marvell
208 SoCs, except with the PXA family of SoCs listed above.
209
210 Linux kernel mach directory: arch/arm/mach-mmp
211 Linux kernel plat directory: arch/arm/plat-pxa
212
213Long-term plans
214---------------
215
216 * Unify the mach-dove/, mach-mv78xx0/, mach-orion5x/ and
217 mach-kirkwood/ into the mach-mvebu/ to support all SoCs from the
218 Marvell EBU (Engineering Business Unit) in a single mach-<foo>
219 directory. The plat-orion/ would therefore disappear.
220
221 * Unify the mach-mmp/ and mach-pxa/ into the same mach-pxa
222 directory. The plat-pxa/ would therefore disappear.
223
224Credits
225-------
226
227 Maen Suleiman <maen@marvell.com>
228 Lior Amsalem <alior@marvell.com>
229 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
230 Andrew Lunn <andrew@lunn.ch>
231 Nicolas Pitre <nico@fluxnic.net>
232 Eric Miao <eric.y.miao@gmail.com>
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 816d6071669e..8b46c79679c4 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -1,4 +1,4 @@
1 S3C2410 GPIO Control 1 S3C24XX GPIO Control
2 ==================== 2 ====================
3 3
4Introduction 4Introduction
@@ -12,7 +12,7 @@ Introduction
12 of the s3c2410 GPIO system, please read the Samsung provided 12 of the s3c2410 GPIO system, please read the Samsung provided
13 data-sheet/users manual to find out the complete list. 13 data-sheet/users manual to find out the complete list.
14 14
15 See Documentation/arm/Samsung/GPIO.txt for the core implemetation. 15 See Documentation/arm/Samsung/GPIO.txt for the core implementation.
16 16
17 17
18GPIOLIB 18GPIOLIB
@@ -41,8 +41,8 @@ GPIOLIB
41GPIOLIB conversion 41GPIOLIB conversion
42------------------ 42------------------
43 43
44If you need to convert your board or driver to use gpiolib from the exiting 44If you need to convert your board or driver to use gpiolib from the phased
45s3c2410 api, then here are some notes on the process. 45out s3c2410 API, then here are some notes on the process.
46 46
471) If your board is exclusively using an GPIO, say to control peripheral 471) If your board is exclusively using an GPIO, say to control peripheral
48 power, then it will require to claim the gpio with gpio_request() before 48 power, then it will require to claim the gpio with gpio_request() before
@@ -55,7 +55,7 @@ s3c2410 api, then here are some notes on the process.
55 as they have the same arguments, and can either take the pin specific 55 as they have the same arguments, and can either take the pin specific
56 values, or the more generic special-function-number arguments. 56 values, or the more generic special-function-number arguments.
57 57
583) s3c2410_gpio_pullup() changs have the problem that whilst the 583) s3c2410_gpio_pullup() changes have the problem that whilst the
59 s3c2410_gpio_pullup(x, 1) can be easily translated to the 59 s3c2410_gpio_pullup(x, 1) can be easily translated to the
60 s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) 60 s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0)
61 are not so easy. 61 are not so easy.
@@ -74,7 +74,7 @@ s3c2410 api, then here are some notes on the process.
74 when using gpio_get_value() on an output pin (s3c2410_gpio_getpin 74 when using gpio_get_value() on an output pin (s3c2410_gpio_getpin
75 would return the value the pin is supposed to be outputting). 75 would return the value the pin is supposed to be outputting).
76 76
776) s3c2410_gpio_getirq() should be directly replacable with the 776) s3c2410_gpio_getirq() should be directly replaceable with the
78 gpio_to_irq() call. 78 gpio_to_irq() call.
79 79
80The s3c2410_gpio and gpio_ calls have always operated on the same gpio 80The s3c2410_gpio and gpio_ calls have always operated on the same gpio
@@ -105,7 +105,7 @@ PIN Numbers
105----------- 105-----------
106 106
107 Each pin has an unique number associated with it in regs-gpio.h, 107 Each pin has an unique number associated with it in regs-gpio.h,
108 eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell 108 e.g. S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell
109 the GPIO functions which pin is to be used. 109 the GPIO functions which pin is to be used.
110 110
111 With the conversion to gpiolib, there is no longer a direct conversion 111 With the conversion to gpiolib, there is no longer a direct conversion
@@ -120,31 +120,27 @@ Configuring a pin
120 The following function allows the configuration of a given pin to 120 The following function allows the configuration of a given pin to
121 be changed. 121 be changed.
122 122
123 void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); 123 void s3c_gpio_cfgpin(unsigned int pin, unsigned int function);
124 124
125 Eg: 125 e.g.:
126 126
127 s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); 127 s3c_gpio_cfgpin(S3C2410_GPA(0), S3C_GPIO_SFN(1));
128 s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); 128 s3c_gpio_cfgpin(S3C2410_GPE(8), S3C_GPIO_SFN(2));
129 129
130 which would turn GPA(0) into the lowest Address line A0, and set 130 which would turn GPA(0) into the lowest Address line A0, and set
131 GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. 131 GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line.
132 132
133 The s3c_gpio_cfgpin() call is a functional replacement for this call.
134
135 133
136Reading the current configuration 134Reading the current configuration
137--------------------------------- 135---------------------------------
138 136
139 The current configuration of a pin can be read by using: 137 The current configuration of a pin can be read by using standard
138 gpiolib function:
140 139
141 s3c2410_gpio_getcfg(unsigned int pin); 140 s3c_gpio_getcfg(unsigned int pin);
142 141
143 The return value will be from the same set of values which can be 142 The return value will be from the same set of values which can be
144 passed to s3c2410_gpio_cfgpin(). 143 passed to s3c_gpio_cfgpin().
145
146 The s3c_gpio_getcfg() call should be a functional replacement for
147 this call.
148 144
149 145
150Configuring a pull-up resistor 146Configuring a pull-up resistor
@@ -154,61 +150,33 @@ Configuring a pull-up resistor
154 pull-up resistors enabled. This can be configured by the following 150 pull-up resistors enabled. This can be configured by the following
155 function: 151 function:
156 152
157 void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); 153 void s3c_gpio_setpull(unsigned int pin, unsigned int to);
158
159 Where the to value is zero to set the pull-up off, and 1 to enable
160 the specified pull-up. Any other values are currently undefined.
161
162 The s3c_gpio_setpull() offers similar functionality, but with the
163 ability to encode whether the pull is up or down. Currently there
164 is no 'just on' state, so up or down must be selected.
165
166
167Getting the state of a PIN
168--------------------------
169
170 The state of a pin can be read by using the function:
171
172 unsigned int s3c2410_gpio_getpin(unsigned int pin);
173 154
174 This will return either zero or non-zero. Do not count on this 155 Where the to value is S3C_GPIO_PULL_NONE to set the pull-up off,
175 function returning 1 if the pin is set. 156 and S3C_GPIO_PULL_UP to enable the specified pull-up. Any other
157 values are currently undefined.
176 158
177 This call is now implemented by the relevant gpiolib calls, convert
178 your board or driver to use gpiolib.
179
180
181Setting the state of a PIN
182--------------------------
183
184 The value an pin is outputing can be modified by using the following:
185 159
186 void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); 160Getting and setting the state of a PIN
161--------------------------------------
187 162
188 Which sets the given pin to the value. Use 0 to write 0, and 1 to 163 These calls are now implemented by the relevant gpiolib calls, convert
189 set the output to 1.
190
191 This call is now implemented by the relevant gpiolib calls, convert
192 your board or driver to use gpiolib. 164 your board or driver to use gpiolib.
193 165
194 166
195Getting the IRQ number associated with a PIN 167Getting the IRQ number associated with a PIN
196-------------------------------------------- 168--------------------------------------------
197 169
198 The following function can map the given pin number to an IRQ 170 A standard gpiolib function can map the given pin number to an IRQ
199 number to pass to the IRQ system. 171 number to pass to the IRQ system.
200 172
201 int s3c2410_gpio_getirq(unsigned int pin); 173 int gpio_to_irq(unsigned int pin);
202 174
203 Note, not all pins have an IRQ. 175 Note, not all pins have an IRQ.
204 176
205 This call is now implemented by the relevant gpiolib calls, convert
206 your board or driver to use gpiolib.
207
208 177
209Authour 178Author
210------- 179-------
211 180
212
213Ben Dooks, 03 October 2004 181Ben Dooks, 03 October 2004
214Copyright 2004 Ben Dooks, Simtec Electronics 182Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung/GPIO.txt b/Documentation/arm/Samsung/GPIO.txt
index 513f2562c1a3..795adfd88081 100644
--- a/Documentation/arm/Samsung/GPIO.txt
+++ b/Documentation/arm/Samsung/GPIO.txt
@@ -5,14 +5,14 @@ Introduction
5------------ 5------------
6 6
7This outlines the Samsung GPIO implementation and the architecture 7This outlines the Samsung GPIO implementation and the architecture
8specific calls provided alongisde the drivers/gpio core. 8specific calls provided alongside the drivers/gpio core.
9 9
10 10
11S3C24XX (Legacy) 11S3C24XX (Legacy)
12---------------- 12----------------
13 13
14See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information 14See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information
15about these devices. Their implementation is being brought into line 15about these devices. Their implementation has been brought into line
16with the core samsung implementation described in this document. 16with the core samsung implementation described in this document.
17 17
18 18
@@ -29,7 +29,7 @@ GPIO numbering is synchronised between the Samsung and gpiolib system.
29PIN configuration 29PIN configuration
30----------------- 30-----------------
31 31
32Pin configuration is specific to the Samsung architecutre, with each SoC 32Pin configuration is specific to the Samsung architecture, with each SoC
33registering the necessary information for the core gpio configuration 33registering the necessary information for the core gpio configuration
34implementation to configure pins as necessary. 34implementation to configure pins as necessary.
35 35
@@ -38,5 +38,3 @@ driver or machine to change gpio configuration.
38 38
39See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information 39See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information
40on these functions. 40on these functions.
41
42
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 208a2d465b92..4bfb9ffbdbc1 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -51,6 +51,9 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned
51ff000000 ffbfffff Reserved for future expansion of DMA 51ff000000 ffbfffff Reserved for future expansion of DMA
52 mapping region. 52 mapping region.
53 53
54fee00000 feffffff Mapping of PCI I/O space. This is a static
55 mapping within the vmalloc space.
56
54VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. 57VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space.
55 Memory returned by vmalloc/ioremap will 58 Memory returned by vmalloc/ioremap will
56 be dynamically placed in this region. 59 be dynamically placed in this region.
diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt
new file mode 100644
index 000000000000..9c4d388daddc
--- /dev/null
+++ b/Documentation/arm64/booting.txt
@@ -0,0 +1,152 @@
1 Booting AArch64 Linux
2 =====================
3
4Author: Will Deacon <will.deacon@arm.com>
5Date : 07 September 2012
6
7This document is based on the ARM booting document by Russell King and
8is relevant to all public releases of the AArch64 Linux kernel.
9
10The AArch64 exception model is made up of a number of exception levels
11(EL0 - EL3), with EL0 and EL1 having a secure and a non-secure
12counterpart. EL2 is the hypervisor level and exists only in non-secure
13mode. EL3 is the highest priority level and exists only in secure mode.
14
15For the purposes of this document, we will use the term `boot loader'
16simply to define all software that executes on the CPU(s) before control
17is passed to the Linux kernel. This may include secure monitor and
18hypervisor code, or it may just be a handful of instructions for
19preparing a minimal boot environment.
20
21Essentially, the boot loader should provide (as a minimum) the
22following:
23
241. Setup and initialise the RAM
252. Setup the device tree
263. Decompress the kernel image
274. Call the kernel image
28
29
301. Setup and initialise RAM
31---------------------------
32
33Requirement: MANDATORY
34
35The boot loader is expected to find and initialise all RAM that the
36kernel will use for volatile data storage in the system. It performs
37this in a machine dependent manner. (It may use internal algorithms
38to automatically locate and size all RAM, or it may use knowledge of
39the RAM in the machine, or any other method the boot loader designer
40sees fit.)
41
42
432. Setup the device tree
44-------------------------
45
46Requirement: MANDATORY
47
48The device tree blob (dtb) must be no bigger than 2 megabytes in size
49and placed at a 2-megabyte boundary within the first 512 megabytes from
50the start of the kernel image. This is to allow the kernel to map the
51blob using a single section mapping in the initial page tables.
52
53
543. Decompress the kernel image
55------------------------------
56
57Requirement: OPTIONAL
58
59The AArch64 kernel does not currently provide a decompressor and
60therefore requires decompression (gzip etc.) to be performed by the boot
61loader if a compressed Image target (e.g. Image.gz) is used. For
62bootloaders that do not implement this requirement, the uncompressed
63Image target is available instead.
64
65
664. Call the kernel image
67------------------------
68
69Requirement: MANDATORY
70
71The decompressed kernel image contains a 32-byte header as follows:
72
73 u32 magic = 0x14000008; /* branch to stext, little-endian */
74 u32 res0 = 0; /* reserved */
75 u64 text_offset; /* Image load offset */
76 u64 res1 = 0; /* reserved */
77 u64 res2 = 0; /* reserved */
78
79The image must be placed at the specified offset (currently 0x80000)
80from the start of the system RAM and called there. The start of the
81system RAM must be aligned to 2MB.
82
83Before jumping into the kernel, the following conditions must be met:
84
85- Quiesce all DMA capable devices so that memory does not get
86 corrupted by bogus network packets or disk data. This will save
87 you many hours of debug.
88
89- Primary CPU general-purpose register settings
90 x0 = physical address of device tree blob (dtb) in system RAM.
91 x1 = 0 (reserved for future use)
92 x2 = 0 (reserved for future use)
93 x3 = 0 (reserved for future use)
94
95- CPU mode
96 All forms of interrupts must be masked in PSTATE.DAIF (Debug, SError,
97 IRQ and FIQ).
98 The CPU must be in either EL2 (RECOMMENDED in order to have access to
99 the virtualisation extensions) or non-secure EL1.
100
101- Caches, MMUs
102 The MMU must be off.
103 Instruction cache may be on or off.
104 Data cache must be off and invalidated.
105 External caches (if present) must be configured and disabled.
106
107- Architected timers
108 CNTFRQ must be programmed with the timer frequency.
109 If entering the kernel at EL1, CNTHCTL_EL2 must have EL1PCTEN (bit 0)
110 set where available.
111
112- Coherency
113 All CPUs to be booted by the kernel must be part of the same coherency
114 domain on entry to the kernel. This may require IMPLEMENTATION DEFINED
115 initialisation to enable the receiving of maintenance operations on
116 each CPU.
117
118- System registers
119 All writable architected system registers at the exception level where
120 the kernel image will be entered must be initialised by software at a
121 higher exception level to prevent execution in an UNKNOWN state.
122
123The boot loader is expected to enter the kernel on each CPU in the
124following manner:
125
126- The primary CPU must jump directly to the first instruction of the
127 kernel image. The device tree blob passed by this CPU must contain
128 for each CPU node:
129
130 1. An 'enable-method' property. Currently, the only supported value
131 for this field is the string "spin-table".
132
133 2. A 'cpu-release-addr' property identifying a 64-bit,
134 zero-initialised memory location.
135
136 It is expected that the bootloader will generate these device tree
137 properties and insert them into the blob prior to kernel entry.
138
139- Any secondary CPUs must spin outside of the kernel in a reserved area
140 of memory (communicated to the kernel by a /memreserve/ region in the
141 device tree) polling their cpu-release-addr location, which must be
142 contained in the reserved region. A wfe instruction may be inserted
143 to reduce the overhead of the busy-loop and a sev will be issued by
144 the primary CPU. When a read of the location pointed to by the
145 cpu-release-addr returns a non-zero value, the CPU must jump directly
146 to this value.
147
148- Secondary CPU general-purpose register settings
149 x0 = 0 (reserved for future use)
150 x1 = 0 (reserved for future use)
151 x2 = 0 (reserved for future use)
152 x3 = 0 (reserved for future use)
diff --git a/Documentation/arm64/memory.txt b/Documentation/arm64/memory.txt
new file mode 100644
index 000000000000..dbbdcbba75a3
--- /dev/null
+++ b/Documentation/arm64/memory.txt
@@ -0,0 +1,73 @@
1 Memory Layout on AArch64 Linux
2 ==============================
3
4Author: Catalin Marinas <catalin.marinas@arm.com>
5Date : 20 February 2012
6
7This document describes the virtual memory layout used by the AArch64
8Linux kernel. The architecture allows up to 4 levels of translation
9tables with a 4KB page size and up to 3 levels with a 64KB page size.
10
11AArch64 Linux uses 3 levels of translation tables with the 4KB page
12configuration, allowing 39-bit (512GB) virtual addresses for both user
13and kernel. With 64KB pages, only 2 levels of translation tables are
14used but the memory layout is the same.
15
16User addresses have bits 63:39 set to 0 while the kernel addresses have
17the same bits set to 1. TTBRx selection is given by bit 63 of the
18virtual address. The swapper_pg_dir contains only kernel (global)
19mappings while the user pgd contains only user (non-global) mappings.
20The swapper_pgd_dir address is written to TTBR1 and never written to
21TTBR0.
22
23
24AArch64 Linux memory layout:
25
26Start End Size Use
27-----------------------------------------------------------------------
280000000000000000 0000007fffffffff 512GB user
29
30ffffff8000000000 ffffffbbfffcffff ~240GB vmalloc
31
32ffffffbbfffd0000 ffffffbcfffdffff 64KB [guard page]
33
34ffffffbbfffe0000 ffffffbcfffeffff 64KB PCI I/O space
35
36ffffffbbffff0000 ffffffbcffffffff 64KB [guard page]
37
38ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
39
40ffffffbe00000000 ffffffbffbffffff ~8GB [guard, future vmmemap]
41
42ffffffbffc000000 ffffffbfffffffff 64MB modules
43
44ffffffc000000000 ffffffffffffffff 256GB memory
45
46
47Translation table lookup with 4KB pages:
48
49+--------+--------+--------+--------+--------+--------+--------+--------+
50|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
51+--------+--------+--------+--------+--------+--------+--------+--------+
52 | | | | | |
53 | | | | | v
54 | | | | | [11:0] in-page offset
55 | | | | +-> [20:12] L3 index
56 | | | +-----------> [29:21] L2 index
57 | | +---------------------> [38:30] L1 index
58 | +-------------------------------> [47:39] L0 index (not used)
59 +-------------------------------------------------> [63] TTBR0/1
60
61
62Translation table lookup with 64KB pages:
63
64+--------+--------+--------+--------+--------+--------+--------+--------+
65|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
66+--------+--------+--------+--------+--------+--------+--------+--------+
67 | | | | |
68 | | | | v
69 | | | | [15:0] in-page offset
70 | | | +----------> [28:16] L3 index
71 | | +--------------------------> [41:29] L2 index (only 38:29 used)
72 | +-------------------------------> [47:42] L1 index (not used)
73 +-------------------------------------------------> [63] TTBR0/1
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 4a0b64c605fc..9e04196c4d78 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -29,7 +29,8 @@ CONTENTS:
29 3.1 Overview 29 3.1 Overview
30 3.2 Synchronization 30 3.2 Synchronization
31 3.3 Subsystem API 31 3.3 Subsystem API
324. Questions 324. Extended attributes usage
335. Questions
33 34
341. Control Groups 351. Control Groups
35================= 36=================
@@ -62,9 +63,9 @@ an instance of the cgroup virtual filesystem associated with it.
62At any one time there may be multiple active hierarchies of task 63At any one time there may be multiple active hierarchies of task
63cgroups. Each hierarchy is a partition of all tasks in the system. 64cgroups. Each hierarchy is a partition of all tasks in the system.
64 65
65User level code may create and destroy cgroups by name in an 66User-level code may create and destroy cgroups by name in an
66instance of the cgroup virtual file system, specify and query to 67instance of the cgroup virtual file system, specify and query to
67which cgroup a task is assigned, and list the task pids assigned to 68which cgroup a task is assigned, and list the task PIDs assigned to
68a cgroup. Those creations and assignments only affect the hierarchy 69a cgroup. Those creations and assignments only affect the hierarchy
69associated with that instance of the cgroup file system. 70associated with that instance of the cgroup file system.
70 71
@@ -72,7 +73,7 @@ On their own, the only use for cgroups is for simple job
72tracking. The intention is that other subsystems hook into the generic 73tracking. The intention is that other subsystems hook into the generic
73cgroup support to provide new attributes for cgroups, such as 74cgroup support to provide new attributes for cgroups, such as
74accounting/limiting the resources which processes in a cgroup can 75accounting/limiting the resources which processes in a cgroup can
75access. For example, cpusets (see Documentation/cgroups/cpusets.txt) allows 76access. For example, cpusets (see Documentation/cgroups/cpusets.txt) allow
76you to associate a set of CPUs and a set of memory nodes with the 77you to associate a set of CPUs and a set of memory nodes with the
77tasks in each cgroup. 78tasks in each cgroup.
78 79
@@ -80,11 +81,11 @@ tasks in each cgroup.
80---------------------------- 81----------------------------
81 82
82There are multiple efforts to provide process aggregations in the 83There are multiple efforts to provide process aggregations in the
83Linux kernel, mainly for resource tracking purposes. Such efforts 84Linux kernel, mainly for resource-tracking purposes. Such efforts
84include cpusets, CKRM/ResGroups, UserBeanCounters, and virtual server 85include cpusets, CKRM/ResGroups, UserBeanCounters, and virtual server
85namespaces. These all require the basic notion of a 86namespaces. These all require the basic notion of a
86grouping/partitioning of processes, with newly forked processes ending 87grouping/partitioning of processes, with newly forked processes ending
87in the same group (cgroup) as their parent process. 88up in the same group (cgroup) as their parent process.
88 89
89The kernel cgroup patch provides the minimum essential kernel 90The kernel cgroup patch provides the minimum essential kernel
90mechanisms required to efficiently implement such groups. It has 91mechanisms required to efficiently implement such groups. It has
@@ -127,14 +128,14 @@ following lines:
127 / \ 128 / \
128 Professors (15%) students (5%) 129 Professors (15%) students (5%)
129 130
130Browsers like Firefox/Lynx go into the WWW network class, while (k)nfsd go 131Browsers like Firefox/Lynx go into the WWW network class, while (k)nfsd goes
131into NFS network class. 132into the NFS network class.
132 133
133At the same time Firefox/Lynx will share an appropriate CPU/Memory class 134At the same time Firefox/Lynx will share an appropriate CPU/Memory class
134depending on who launched it (prof/student). 135depending on who launched it (prof/student).
135 136
136With the ability to classify tasks differently for different resources 137With the ability to classify tasks differently for different resources
137(by putting those resource subsystems in different hierarchies) then 138(by putting those resource subsystems in different hierarchies),
138the admin can easily set up a script which receives exec notifications 139the admin can easily set up a script which receives exec notifications
139and depending on who is launching the browser he can 140and depending on who is launching the browser he can
140 141
@@ -145,19 +146,19 @@ a separate cgroup for every browser launched and associate it with
145appropriate network and other resource class. This may lead to 146appropriate network and other resource class. This may lead to
146proliferation of such cgroups. 147proliferation of such cgroups.
147 148
148Also lets say that the administrator would like to give enhanced network 149Also let's say that the administrator would like to give enhanced network
149access temporarily to a student's browser (since it is night and the user 150access temporarily to a student's browser (since it is night and the user
150wants to do online gaming :)) OR give one of the students simulation 151wants to do online gaming :)) OR give one of the student's simulation
151apps enhanced CPU power, 152apps enhanced CPU power.
152 153
153With ability to write pids directly to resource classes, it's just a 154With ability to write PIDs directly to resource classes, it's just a
154matter of : 155matter of:
155 156
156 # echo pid > /sys/fs/cgroup/network/<new_class>/tasks 157 # echo pid > /sys/fs/cgroup/network/<new_class>/tasks
157 (after some time) 158 (after some time)
158 # echo pid > /sys/fs/cgroup/network/<orig_class>/tasks 159 # echo pid > /sys/fs/cgroup/network/<orig_class>/tasks
159 160
160Without this ability, he would have to split the cgroup into 161Without this ability, the administrator would have to split the cgroup into
161multiple separate ones and then associate the new cgroups with the 162multiple separate ones and then associate the new cgroups with the
162new resource classes. 163new resource classes.
163 164
@@ -184,20 +185,20 @@ Control Groups extends the kernel as follows:
184 field of each task_struct using the css_set, anchored at 185 field of each task_struct using the css_set, anchored at
185 css_set->tasks. 186 css_set->tasks.
186 187
187 - A cgroup hierarchy filesystem can be mounted for browsing and 188 - A cgroup hierarchy filesystem can be mounted for browsing and
188 manipulation from user space. 189 manipulation from user space.
189 190
190 - You can list all the tasks (by pid) attached to any cgroup. 191 - You can list all the tasks (by PID) attached to any cgroup.
191 192
192The implementation of cgroups requires a few, simple hooks 193The implementation of cgroups requires a few, simple hooks
193into the rest of the kernel, none in performance critical paths: 194into the rest of the kernel, none in performance-critical paths:
194 195
195 - in init/main.c, to initialize the root cgroups and initial 196 - in init/main.c, to initialize the root cgroups and initial
196 css_set at system boot. 197 css_set at system boot.
197 198
198 - in fork and exit, to attach and detach a task from its css_set. 199 - in fork and exit, to attach and detach a task from its css_set.
199 200
200In addition a new file system, of type "cgroup" may be mounted, to 201In addition, a new file system of type "cgroup" may be mounted, to
201enable browsing and modifying the cgroups presently known to the 202enable browsing and modifying the cgroups presently known to the
202kernel. When mounting a cgroup hierarchy, you may specify a 203kernel. When mounting a cgroup hierarchy, you may specify a
203comma-separated list of subsystems to mount as the filesystem mount 204comma-separated list of subsystems to mount as the filesystem mount
@@ -230,13 +231,13 @@ as the path relative to the root of the cgroup file system.
230Each cgroup is represented by a directory in the cgroup file system 231Each cgroup is represented by a directory in the cgroup file system
231containing the following files describing that cgroup: 232containing the following files describing that cgroup:
232 233
233 - tasks: list of tasks (by pid) attached to that cgroup. This list 234 - tasks: list of tasks (by PID) attached to that cgroup. This list
234 is not guaranteed to be sorted. Writing a thread id into this file 235 is not guaranteed to be sorted. Writing a thread ID into this file
235 moves the thread into this cgroup. 236 moves the thread into this cgroup.
236 - cgroup.procs: list of tgids in the cgroup. This list is not 237 - cgroup.procs: list of thread group IDs in the cgroup. This list is
237 guaranteed to be sorted or free of duplicate tgids, and userspace 238 not guaranteed to be sorted or free of duplicate TGIDs, and userspace
238 should sort/uniquify the list if this property is required. 239 should sort/uniquify the list if this property is required.
239 Writing a thread group id into this file moves all threads in that 240 Writing a thread group ID into this file moves all threads in that
240 group into this cgroup. 241 group into this cgroup.
241 - notify_on_release flag: run the release agent on exit? 242 - notify_on_release flag: run the release agent on exit?
242 - release_agent: the path to use for release notifications (this file 243 - release_agent: the path to use for release notifications (this file
@@ -261,7 +262,7 @@ cgroup file system directories.
261 262
262When a task is moved from one cgroup to another, it gets a new 263When a task is moved from one cgroup to another, it gets a new
263css_set pointer - if there's an already existing css_set with the 264css_set pointer - if there's an already existing css_set with the
264desired collection of cgroups then that group is reused, else a new 265desired collection of cgroups then that group is reused, otherwise a new
265css_set is allocated. The appropriate existing css_set is located by 266css_set is allocated. The appropriate existing css_set is located by
266looking into a hash table. 267looking into a hash table.
267 268
@@ -292,7 +293,7 @@ file system) of the abandoned cgroup. This enables automatic
292removal of abandoned cgroups. The default value of 293removal of abandoned cgroups. The default value of
293notify_on_release in the root cgroup at system boot is disabled 294notify_on_release in the root cgroup at system boot is disabled
294(0). The default value of other cgroups at creation is the current 295(0). The default value of other cgroups at creation is the current
295value of their parents notify_on_release setting. The default value of 296value of their parents' notify_on_release settings. The default value of
296a cgroup hierarchy's release_agent path is empty. 297a cgroup hierarchy's release_agent path is empty.
297 298
2981.5 What does clone_children do ? 2991.5 What does clone_children do ?
@@ -316,7 +317,7 @@ the "cpuset" cgroup subsystem, the steps are something like:
316 4) Create the new cgroup by doing mkdir's and write's (or echo's) in 317 4) Create the new cgroup by doing mkdir's and write's (or echo's) in
317 the /sys/fs/cgroup virtual file system. 318 the /sys/fs/cgroup virtual file system.
318 5) Start a task that will be the "founding father" of the new job. 319 5) Start a task that will be the "founding father" of the new job.
319 6) Attach that task to the new cgroup by writing its pid to the 320 6) Attach that task to the new cgroup by writing its PID to the
320 /sys/fs/cgroup/cpuset/tasks file for that cgroup. 321 /sys/fs/cgroup/cpuset/tasks file for that cgroup.
321 7) fork, exec or clone the job tasks from this founding father task. 322 7) fork, exec or clone the job tasks from this founding father task.
322 323
@@ -344,7 +345,7 @@ and then start a subshell 'sh' in that cgroup:
3442.1 Basic Usage 3452.1 Basic Usage
345--------------- 346---------------
346 347
347Creating, modifying, using the cgroups can be done through the cgroup 348Creating, modifying, using cgroups can be done through the cgroup
348virtual filesystem. 349virtual filesystem.
349 350
350To mount a cgroup hierarchy with all available subsystems, type: 351To mount a cgroup hierarchy with all available subsystems, type:
@@ -441,7 +442,7 @@ You can attach the current shell task by echoing 0:
441# echo 0 > tasks 442# echo 0 > tasks
442 443
443You can use the cgroup.procs file instead of the tasks file to move all 444You can use the cgroup.procs file instead of the tasks file to move all
444threads in a threadgroup at once. Echoing the pid of any task in a 445threads in a threadgroup at once. Echoing the PID of any task in a
445threadgroup to cgroup.procs causes all tasks in that threadgroup to be 446threadgroup to cgroup.procs causes all tasks in that threadgroup to be
446be attached to the cgroup. Writing 0 to cgroup.procs moves all tasks 447be attached to the cgroup. Writing 0 to cgroup.procs moves all tasks
447in the writing task's threadgroup. 448in the writing task's threadgroup.
@@ -479,7 +480,7 @@ in /proc/mounts and /proc/<pid>/cgroups.
479There is mechanism which allows to get notifications about changing 480There is mechanism which allows to get notifications about changing
480status of a cgroup. 481status of a cgroup.
481 482
482To register new notification handler you need: 483To register a new notification handler you need to:
483 - create a file descriptor for event notification using eventfd(2); 484 - create a file descriptor for event notification using eventfd(2);
484 - open a control file to be monitored (e.g. memory.usage_in_bytes); 485 - open a control file to be monitored (e.g. memory.usage_in_bytes);
485 - write "<event_fd> <control_fd> <args>" to cgroup.event_control. 486 - write "<event_fd> <control_fd> <args>" to cgroup.event_control.
@@ -488,7 +489,7 @@ To register new notification handler you need:
488eventfd will be woken up by control file implementation or when the 489eventfd will be woken up by control file implementation or when the
489cgroup is removed. 490cgroup is removed.
490 491
491To unregister notification handler just close eventfd. 492To unregister a notification handler just close eventfd.
492 493
493NOTE: Support of notifications should be implemented for the control 494NOTE: Support of notifications should be implemented for the control
494file. See documentation for the subsystem. 495file. See documentation for the subsystem.
@@ -502,7 +503,7 @@ file. See documentation for the subsystem.
502Each kernel subsystem that wants to hook into the generic cgroup 503Each kernel subsystem that wants to hook into the generic cgroup
503system needs to create a cgroup_subsys object. This contains 504system needs to create a cgroup_subsys object. This contains
504various methods, which are callbacks from the cgroup system, along 505various methods, which are callbacks from the cgroup system, along
505with a subsystem id which will be assigned by the cgroup system. 506with a subsystem ID which will be assigned by the cgroup system.
506 507
507Other fields in the cgroup_subsys object include: 508Other fields in the cgroup_subsys object include:
508 509
@@ -516,7 +517,7 @@ Other fields in the cgroup_subsys object include:
516 at system boot. 517 at system boot.
517 518
518Each cgroup object created by the system has an array of pointers, 519Each cgroup object created by the system has an array of pointers,
519indexed by subsystem id; this pointer is entirely managed by the 520indexed by subsystem ID; this pointer is entirely managed by the
520subsystem; the generic cgroup code will never touch this pointer. 521subsystem; the generic cgroup code will never touch this pointer.
521 522
5223.2 Synchronization 5233.2 Synchronization
@@ -639,7 +640,7 @@ void post_clone(struct cgroup *cgrp)
639 640
640Called during cgroup_create() to do any parameter 641Called during cgroup_create() to do any parameter
641initialization which might be required before a task could attach. For 642initialization which might be required before a task could attach. For
642example in cpusets, no task may attach before 'cpus' and 'mems' are set 643example, in cpusets, no task may attach before 'cpus' and 'mems' are set
643up. 644up.
644 645
645void bind(struct cgroup *root) 646void bind(struct cgroup *root)
@@ -650,7 +651,26 @@ and root cgroup. Currently this will only involve movement between
650the default hierarchy (which never has sub-cgroups) and a hierarchy 651the default hierarchy (which never has sub-cgroups) and a hierarchy
651that is being created/destroyed (and hence has no sub-cgroups). 652that is being created/destroyed (and hence has no sub-cgroups).
652 653
6534. Questions 6544. Extended attribute usage
655===========================
656
657cgroup filesystem supports certain types of extended attributes in its
658directories and files. The current supported types are:
659 - Trusted (XATTR_TRUSTED)
660 - Security (XATTR_SECURITY)
661
662Both require CAP_SYS_ADMIN capability to set.
663
664Like in tmpfs, the extended attributes in cgroup filesystem are stored
665using kernel memory and it's advised to keep the usage at minimum. This
666is the reason why user defined extended attributes are not supported, since
667any user can do it and there's no limit in the value size.
668
669The current known users for this feature are SELinux to limit cgroup usage
670in containers and systemd for assorted meta data like main PID in a cgroup
671(systemd creates a cgroup per service).
672
6735. Questions
654============ 674============
655 675
656Q: what's up with this '/bin/echo' ? 676Q: what's up with this '/bin/echo' ?
@@ -660,5 +680,5 @@ A: bash's builtin 'echo' command does not check calls to write() against
660 680
661Q: When I attach processes, only the first of the line gets really attached ! 681Q: When I attach processes, only the first of the line gets really attached !
662A: We can only return one error code per call to write(). So you should also 682A: We can only return one error code per call to write(). So you should also
663 put only ONE pid. 683 put only ONE PID.
664 684
diff --git a/Documentation/cpu-freq/boost.txt b/Documentation/cpu-freq/boost.txt
new file mode 100644
index 000000000000..9b4edfcf486f
--- /dev/null
+++ b/Documentation/cpu-freq/boost.txt
@@ -0,0 +1,93 @@
1Processor boosting control
2
3 - information for users -
4
5Quick guide for the impatient:
6--------------------
7/sys/devices/system/cpu/cpufreq/boost
8controls the boost setting for the whole system. You can read and write
9that file with either "0" (boosting disabled) or "1" (boosting allowed).
10Reading or writing 1 does not mean that the system is boosting at this
11very moment, but only that the CPU _may_ raise the frequency at it's
12discretion.
13--------------------
14
15Introduction
16-------------
17Some CPUs support a functionality to raise the operating frequency of
18some cores in a multi-core package if certain conditions apply, mostly
19if the whole chip is not fully utilized and below it's intended thermal
20budget. This is done without operating system control by a combination
21of hardware and firmware.
22On Intel CPUs this is called "Turbo Boost", AMD calls it "Turbo-Core",
23in technical documentation "Core performance boost". In Linux we use
24the term "boost" for convenience.
25
26Rationale for disable switch
27----------------------------
28
29Though the idea is to just give better performance without any user
30intervention, sometimes the need arises to disable this functionality.
31Most systems offer a switch in the (BIOS) firmware to disable the
32functionality at all, but a more fine-grained and dynamic control would
33be desirable:
341. While running benchmarks, reproducible results are important. Since
35 the boosting functionality depends on the load of the whole package,
36 single thread performance can vary. By explicitly disabling the boost
37 functionality at least for the benchmark's run-time the system will run
38 at a fixed frequency and results are reproducible again.
392. To examine the impact of the boosting functionality it is helpful
40 to do tests with and without boosting.
413. Boosting means overclocking the processor, though under controlled
42 conditions. By raising the frequency and the voltage the processor
43 will consume more power than without the boosting, which may be
44 undesirable for instance for mobile users. Disabling boosting may
45 save power here, though this depends on the workload.
46
47
48User controlled switch
49----------------------
50
51To allow the user to toggle the boosting functionality, the acpi-cpufreq
52driver exports a sysfs knob to disable it. There is a file:
53/sys/devices/system/cpu/cpufreq/boost
54which can either read "0" (boosting disabled) or "1" (boosting enabled).
55Reading the file is always supported, even if the processor does not
56support boosting. In this case the file will be read-only and always
57reads as "0". Explicitly changing the permissions and writing to that
58file anyway will return EINVAL.
59
60On supported CPUs one can write either a "0" or a "1" into this file.
61This will either disable the boost functionality on all cores in the
62whole system (0) or will allow the hardware to boost at will (1).
63
64Writing a "1" does not explicitly boost the system, but just allows the
65CPU (and the firmware) to boost at their discretion. Some implementations
66take external factors like the chip's temperature into account, so
67boosting once does not necessarily mean that it will occur every time
68even using the exact same software setup.
69
70
71AMD legacy cpb switch
72---------------------
73The AMD powernow-k8 driver used to support a very similar switch to
74disable or enable the "Core Performance Boost" feature of some AMD CPUs.
75This switch was instantiated in each CPU's cpufreq directory
76(/sys/devices/system/cpu[0-9]*/cpufreq) and was called "cpb".
77Though the per CPU existence hints at a more fine grained control, the
78actual implementation only supported a system-global switch semantics,
79which was simply reflected into each CPU's file. Writing a 0 or 1 into it
80would pull the other CPUs to the same state.
81For compatibility reasons this file and its behavior is still supported
82on AMD CPUs, though it is now protected by a config switch
83(X86_ACPI_CPUFREQ_CPB). On Intel CPUs this file will never be created,
84even with the config option set.
85This functionality is considered legacy and will be removed in some future
86kernel version.
87
88More fine grained boosting control
89----------------------------------
90
91Technically it is possible to switch the boosting functionality at least
92on a per package basis, for some CPUs even per core. Currently the driver
93does not support it, but this may be implemented in the future.
diff --git a/Documentation/cpuidle/sysfs.txt b/Documentation/cpuidle/sysfs.txt
index 9d28a3406e74..b6f44f490ed7 100644
--- a/Documentation/cpuidle/sysfs.txt
+++ b/Documentation/cpuidle/sysfs.txt
@@ -76,9 +76,17 @@ total 0
76 76
77 77
78* desc : Small description about the idle state (string) 78* desc : Small description about the idle state (string)
79* disable : Option to disable this idle state (bool) 79* disable : Option to disable this idle state (bool) -> see note below
80* latency : Latency to exit out of this idle state (in microseconds) 80* latency : Latency to exit out of this idle state (in microseconds)
81* name : Name of the idle state (string) 81* name : Name of the idle state (string)
82* power : Power consumed while in this idle state (in milliwatts) 82* power : Power consumed while in this idle state (in milliwatts)
83* time : Total time spent in this idle state (in microseconds) 83* time : Total time spent in this idle state (in microseconds)
84* usage : Number of times this state was entered (count) 84* usage : Number of times this state was entered (count)
85
86Note:
87The behavior and the effect of the disable variable depends on the
88implementation of a particular governor. In the ladder governor, for
89example, it is not coherent, i.e. if one is disabling a light state,
90then all deeper states are disabled as well, but the disable variable
91does not reflect it. Likewise, if one enables a deep state but a lighter
92state still is disabled, then this has no effect.
diff --git a/Documentation/devicetree/bindings/arm/arm-boards b/Documentation/devicetree/bindings/arm/arm-boards
index 91f26148af79..fc81a7d6b0f1 100644
--- a/Documentation/devicetree/bindings/arm/arm-boards
+++ b/Documentation/devicetree/bindings/arm/arm-boards
@@ -1,3 +1,15 @@
1ARM Integrator/AP (Application Platform) and Integrator/CP (Compact Platform)
2-----------------------------------------------------------------------------
3ARM's oldest Linux-supported platform with connectors for different core
4tiles of ARMv4, ARMv5 and ARMv6 type.
5
6Required properties (in root node):
7 compatible = "arm,integrator-ap"; /* Application Platform */
8 compatible = "arm,integrator-cp"; /* Compact Platform */
9
10FPGA type interrupt controllers, see the versatile-fpga-irq binding doc.
11
12
1ARM Versatile Application and Platform Baseboards 13ARM Versatile Application and Platform Baseboards
2------------------------------------------------- 14-------------------------------------------------
3ARM's development hardware platform with connectors for customizable 15ARM's development hardware platform with connectors for customizable
diff --git a/Documentation/devicetree/bindings/arm/bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm2835.txt
new file mode 100644
index 000000000000..ac683480c486
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm2835.txt
@@ -0,0 +1,8 @@
1Broadcom BCM2835 device tree bindings
2-------------------------------------------
3
4Boards with the BCM2835 SoC shall have the following properties:
5
6Required root node property:
7
8compatible = "brcm,bcm2835";
diff --git a/Documentation/devicetree/bindings/arm/calxeda/combophy.txt b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
new file mode 100644
index 000000000000..6622bdb2e8bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
@@ -0,0 +1,17 @@
1Calxeda Highbank Combination Phys for SATA
2
3Properties:
4- compatible : Should be "calxeda,hb-combophy"
5- #phy-cells: Should be 1.
6- reg : Address and size for Combination Phy registers.
7- phydev: device ID for programming the combophy.
8
9Example:
10
11 combophy5: combo-phy@fff5d000 {
12 compatible = "calxeda,hb-combophy";
13 #phy-cells = <1>;
14 reg = <0xfff5d000 0x1000>;
15 phydev = <31>;
16 };
17
diff --git a/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt b/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt
new file mode 100644
index 000000000000..31af1cbb60bd
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt
@@ -0,0 +1,17 @@
1* Marvell Tauros2 Cache
2
3Required properties:
4- compatible : Should be "marvell,tauros2-cache".
5- marvell,tauros2-cache-features : Specify the features supported for the
6 tauros2 cache.
7 The features including
8 CACHE_TAUROS2_PREFETCH_ON (1 << 0)
9 CACHE_TAUROS2_LINEFILL_BURST8 (1 << 1)
10 The definition can be found at
11 arch/arm/include/asm/hardware/cache-tauros2.h
12
13Example:
14 L2: l2-cache {
15 compatible = "marvell,tauros2-cache";
16 marvell,tauros2-cache-features = <0x3>;
17 };
diff --git a/Documentation/devicetree/bindings/arm/msm/timer.txt b/Documentation/devicetree/bindings/arm/msm/timer.txt
new file mode 100644
index 000000000000..8c5907b9cae8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/timer.txt
@@ -0,0 +1,38 @@
1* MSM Timer
2
3Properties:
4
5- compatible : Should at least contain "qcom,msm-timer". More specific
6 properties such as "qcom,msm-gpt" and "qcom,msm-dgt" specify a general
7 purpose timer and a debug timer respectively.
8
9- interrupts : Interrupt indicating a match event.
10
11- reg : Specifies the base address of the timer registers. The second region
12 specifies an optional register used to configure the clock divider.
13
14- clock-frequency : The frequency of the timer in Hz.
15
16Optional:
17
18- cpu-offset : per-cpu offset used when the timer is accessed without the
19 CPU remapping facilities. The offset is cpu-offset * cpu-nr.
20
21Example:
22
23 timer@200a004 {
24 compatible = "qcom,msm-gpt", "qcom,msm-timer";
25 interrupts = <1 2 0x301>;
26 reg = <0x0200a004 0x10>;
27 clock-frequency = <32768>;
28 cpu-offset = <0x40000>;
29 };
30
31 timer@200a024 {
32 compatible = "qcom,msm-dgt", "qcom,msm-timer";
33 interrupts = <1 3 0x301>;
34 reg = <0x0200a024 0x10>,
35 <0x0200a034 0x4>;
36 clock-frequency = <6750000>;
37 cpu-offset = <0x40000>;
38 };
diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index ccdd0e53451f..d0051a750587 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -36,6 +36,9 @@ Boards:
36- OMAP3 BeagleBoard : Low cost community board 36- OMAP3 BeagleBoard : Low cost community board
37 compatible = "ti,omap3-beagle", "ti,omap3" 37 compatible = "ti,omap3-beagle", "ti,omap3"
38 38
39- OMAP3 Tobi with Overo : Commercial expansion board with daughter board
40 compatible = "ti,omap3-tobi", "ti,omap3-overo", "ti,omap3"
41
39- OMAP4 SDP : Software Developement Board 42- OMAP4 SDP : Software Developement Board
40 compatible = "ti,omap4-sdp", "ti,omap4430" 43 compatible = "ti,omap4-sdp", "ti,omap4430"
41 44
diff --git a/Documentation/devicetree/bindings/arm/pmu.txt b/Documentation/devicetree/bindings/arm/pmu.txt
index 1c044eb320cc..343781b9f246 100644
--- a/Documentation/devicetree/bindings/arm/pmu.txt
+++ b/Documentation/devicetree/bindings/arm/pmu.txt
@@ -7,8 +7,12 @@ representation in the device tree should be done as under:-
7Required properties: 7Required properties:
8 8
9- compatible : should be one of 9- compatible : should be one of
10 "arm,cortex-a15-pmu"
10 "arm,cortex-a9-pmu" 11 "arm,cortex-a9-pmu"
11 "arm,cortex-a8-pmu" 12 "arm,cortex-a8-pmu"
13 "arm,cortex-a7-pmu"
14 "arm,cortex-a5-pmu"
15 "arm,arm11mpcore-pmu"
12 "arm,arm1176-pmu" 16 "arm,arm1176-pmu"
13 "arm,arm1136-pmu" 17 "arm,arm1136-pmu"
14- interrupts : 1 combined interrupt or 1 per core. 18- interrupts : 1 combined interrupt or 1 per core.
diff --git a/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt b/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt
new file mode 100644
index 000000000000..9989eda755d9
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt
@@ -0,0 +1,31 @@
1* ARM Versatile FPGA interrupt controller
2
3One or more FPGA IRQ controllers can be synthesized in an ARM reference board
4such as the Integrator or Versatile family. The output of these different
5controllers are OR:ed together and fed to the CPU tile's IRQ input. Each
6instance can handle up to 32 interrupts.
7
8Required properties:
9- compatible: "arm,versatile-fpga-irq"
10- interrupt-controller: Identifies the node as an interrupt controller
11- #interrupt-cells: The number of cells to define the interrupts. Must be 1
12 as the FPGA IRQ controller has no configuration options for interrupt
13 sources. The cell is a u32 and defines the interrupt number.
14- reg: The register bank for the FPGA interrupt controller.
15- clear-mask: a u32 number representing the mask written to clear all IRQs
16 on the controller at boot for example.
17- valid-mask: a u32 number representing a bit mask determining which of
18 the interrupts are valid. Unconnected/unused lines are set to 0, and
19 the system till not make it possible for devices to request these
20 interrupts.
21
22Example:
23
24pic: pic@14000000 {
25 compatible = "arm,versatile-fpga-irq";
26 #interrupt-cells = <1>;
27 interrupt-controller;
28 reg = <0x14000000 0x100>;
29 clear-mask = <0xffffffff>;
30 valid-mask = <0x003fffff>;
31};
diff --git a/Documentation/devicetree/bindings/arm/vt8500.txt b/Documentation/devicetree/bindings/arm/vt8500.txt
new file mode 100644
index 000000000000..d657832c6819
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vt8500.txt
@@ -0,0 +1,14 @@
1VIA/Wondermedia VT8500 Platforms Device Tree Bindings
2---------------------------------------
3
4Boards with the VIA VT8500 SoC shall have the following properties:
5Required root node property:
6compatible = "via,vt8500";
7
8Boards with the Wondermedia WM8505 SoC shall have the following properties:
9Required root node property:
10compatible = "wm,wm8505";
11
12Boards with the Wondermedia WM8650 SoC shall have the following properties:
13Required root node property:
14compatible = "wm,wm8650";
diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt
new file mode 100644
index 000000000000..0a4ce1051b02
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt
@@ -0,0 +1,16 @@
1VIA/Wondermedia VT8500 Interrupt Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-intc"
6- reg : Should contain 1 register ranges(address and length)
7- #interrupt-cells : should be <1>
8
9Example:
10
11 intc: interrupt-controller@d8140000 {
12 compatible = "via,vt8500-intc";
13 interrupt-controller;
14 reg = <0xd8140000 0x10000>;
15 #interrupt-cells = <1>;
16 };
diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
new file mode 100644
index 000000000000..521b9c7de933
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
@@ -0,0 +1,13 @@
1VIA/Wondermedia VT8500 Power Management Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-pmc"
6- reg : Should contain 1 register ranges(address and length)
7
8Example:
9
10 pmc@d8130000 {
11 compatible = "via,vt8500-pmc";
12 reg = <0xd8130000 0x1000>;
13 };
diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt
new file mode 100644
index 000000000000..901c73f0d8ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt
@@ -0,0 +1,15 @@
1VIA/Wondermedia VT8500 Timer
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-timer"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : interrupt for the timer
8
9Example:
10
11 timer@d8130100 {
12 compatible = "via,vt8500-timer";
13 reg = <0xd8130100 0x28>;
14 interrupts = <36>;
15 };
diff --git a/Documentation/devicetree/bindings/arm/xen.txt b/Documentation/devicetree/bindings/arm/xen.txt
new file mode 100644
index 000000000000..0f7b9c2109f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/xen.txt
@@ -0,0 +1,25 @@
1* Xen hypervisor device tree bindings
2
3Xen ARM virtual platforms shall have a top-level "hypervisor" node with
4the following properties:
5
6- compatible:
7 compatible = "xen,xen-<version>", "xen,xen";
8 where <version> is the version of the Xen ABI of the platform.
9
10- reg: specifies the base physical address and size of a region in
11 memory where the grant table should be mapped to, using an
12 HYPERVISOR_memory_op hypercall. The memory region is large enough to map
13 the whole grant table (it is larger or equal to gnttab_max_grant_frames()).
14
15- interrupts: the interrupt used by Xen to inject event notifications.
16 A GIC node is also required.
17
18
19Example (assuming #address-cells = <2> and #size-cells = <2>):
20
21hypervisor {
22 compatible = "xen,xen-4.3", "xen,xen";
23 reg = <0 0xb0000000 0 0x20000>;
24 interrupts = <1 15 0xf08>;
25};
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 8bb8a76d42e8..b519f9b699c3 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -8,9 +8,18 @@ Required properties:
8- interrupts : <interrupt mapping for SATA IRQ> 8- interrupts : <interrupt mapping for SATA IRQ>
9- reg : <registers mapping> 9- reg : <registers mapping>
10 10
11Optional properties:
12- calxeda,port-phys: phandle-combophy and lane assignment, which maps each
13 SATA port to a combophy and a lane within that
14 combophy
15- dma-coherent : Present if dma operations are coherent
16
11Example: 17Example:
12 sata@ffe08000 { 18 sata@ffe08000 {
13 compatible = "calxeda,hb-ahci"; 19 compatible = "calxeda,hb-ahci";
14 reg = <0xffe08000 0x1000>; 20 reg = <0xffe08000 0x1000>;
15 interrupts = <115>; 21 interrupts = <115>;
22 calxeda,port-phys = <&combophy5 0 &combophy0 0 &combophy0 1
23 &combophy0 2 &combophy0 3>;
24
16 }; 25 };
diff --git a/Documentation/devicetree/bindings/ata/pata-arasan.txt b/Documentation/devicetree/bindings/ata/pata-arasan.txt
new file mode 100644
index 000000000000..95ec7f825ede
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/pata-arasan.txt
@@ -0,0 +1,17 @@
1* ARASAN PATA COMPACT FLASH CONTROLLER
2
3Required properties:
4- compatible: "arasan,cf-spear1340"
5- reg: Address range of the CF registers
6- interrupt-parent: Should be the phandle for the interrupt controller
7 that services interrupts for this device
8- interrupt: Should contain the CF interrupt number
9
10Example:
11
12 cf@fc000000 {
13 compatible = "arasan,cf-spear1340";
14 reg = <0xfc000000 0x1000>;
15 interrupt-parent = <&vic1>;
16 interrupts = <12>;
17 };
diff --git a/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt b/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt
new file mode 100644
index 000000000000..d2fe064a828b
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt
@@ -0,0 +1,10 @@
1* OMAP OCP2SCP - ocp interface to scp interface
2
3properties:
4- compatible : Should be "ti,omap-ocp2scp"
5- #address-cells, #size-cells : Must be present if the device has sub-nodes
6- ranges : the child address space are mapped 1:1 onto the parent address space
7- ti,hwmods : must be "ocp2scp_usb_phy"
8
9Sub-nodes:
10All the devices connected to ocp2scp are described using sub-node to ocp2scp
diff --git a/Documentation/devicetree/bindings/clock/imx23-clock.txt b/Documentation/devicetree/bindings/clock/imx23-clock.txt
new file mode 100644
index 000000000000..a0b867ef8d96
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx23-clock.txt
@@ -0,0 +1,76 @@
1* Clock bindings for Freescale i.MX23
2
3Required properties:
4- compatible: Should be "fsl,imx23-clkctrl"
5- reg: Address and length of the register set
6- #clock-cells: Should be <1>
7
8The clock consumer should specify the desired clock by having the clock
9ID in its "clocks" phandle cell. The following is a full list of i.MX23
10clocks and IDs.
11
12 Clock ID
13 ------------------
14 ref_xtal 0
15 pll 1
16 ref_cpu 2
17 ref_emi 3
18 ref_pix 4
19 ref_io 5
20 saif_sel 6
21 lcdif_sel 7
22 gpmi_sel 8
23 ssp_sel 9
24 emi_sel 10
25 cpu 11
26 etm_sel 12
27 cpu_pll 13
28 cpu_xtal 14
29 hbus 15
30 xbus 16
31 lcdif_div 17
32 ssp_div 18
33 gpmi_div 19
34 emi_pll 20
35 emi_xtal 21
36 etm_div 22
37 saif_div 23
38 clk32k_div 24
39 rtc 25
40 adc 26
41 spdif_div 27
42 clk32k 28
43 dri 29
44 pwm 30
45 filt 31
46 uart 32
47 ssp 33
48 gpmi 34
49 spdif 35
50 emi 36
51 saif 37
52 lcdif 38
53 etm 39
54 usb 40
55 usb_pwr 41
56
57Examples:
58
59clks: clkctrl@80040000 {
60 compatible = "fsl,imx23-clkctrl";
61 reg = <0x80040000 0x2000>;
62 #clock-cells = <1>;
63 clock-output-names =
64 ...
65 "uart", /* 32 */
66 ...
67 "end_of_list";
68};
69
70auart0: serial@8006c000 {
71 compatible = "fsl,imx23-auart";
72 reg = <0x8006c000 0x2000>;
73 interrupts = <24 25 23>;
74 clocks = <&clks 32>;
75 status = "disabled";
76};
diff --git a/Documentation/devicetree/bindings/clock/imx28-clock.txt b/Documentation/devicetree/bindings/clock/imx28-clock.txt
new file mode 100644
index 000000000000..aa2af2866fe8
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx28-clock.txt
@@ -0,0 +1,99 @@
1* Clock bindings for Freescale i.MX28
2
3Required properties:
4- compatible: Should be "fsl,imx28-clkctrl"
5- reg: Address and length of the register set
6- #clock-cells: Should be <1>
7
8The clock consumer should specify the desired clock by having the clock
9ID in its "clocks" phandle cell. The following is a full list of i.MX28
10clocks and IDs.
11
12 Clock ID
13 ------------------
14 ref_xtal 0
15 pll0 1
16 pll1 2
17 pll2 3
18 ref_cpu 4
19 ref_emi 5
20 ref_io0 6
21 ref_io1 7
22 ref_pix 8
23 ref_hsadc 9
24 ref_gpmi 10
25 saif0_sel 11
26 saif1_sel 12
27 gpmi_sel 13
28 ssp0_sel 14
29 ssp1_sel 15
30 ssp2_sel 16
31 ssp3_sel 17
32 emi_sel 18
33 etm_sel 19
34 lcdif_sel 20
35 cpu 21
36 ptp_sel 22
37 cpu_pll 23
38 cpu_xtal 24
39 hbus 25
40 xbus 26
41 ssp0_div 27
42 ssp1_div 28
43 ssp2_div 29
44 ssp3_div 30
45 gpmi_div 31
46 emi_pll 32
47 emi_xtal 33
48 lcdif_div 34
49 etm_div 35
50 ptp 36
51 saif0_div 37
52 saif1_div 38
53 clk32k_div 39
54 rtc 40
55 lradc 41
56 spdif_div 42
57 clk32k 43
58 pwm 44
59 uart 45
60 ssp0 46
61 ssp1 47
62 ssp2 48
63 ssp3 49
64 gpmi 50
65 spdif 51
66 emi 52
67 saif0 53
68 saif1 54
69 lcdif 55
70 etm 56
71 fec 57
72 can0 58
73 can1 59
74 usb0 60
75 usb1 61
76 usb0_pwr 62
77 usb1_pwr 63
78 enet_out 64
79
80Examples:
81
82clks: clkctrl@80040000 {
83 compatible = "fsl,imx28-clkctrl";
84 reg = <0x80040000 0x2000>;
85 #clock-cells = <1>;
86 clock-output-names =
87 ...
88 "uart", /* 45 */
89 ...
90 "end_of_list";
91};
92
93auart0: serial@8006a000 {
94 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
95 reg = <0x8006a000 0x2000>;
96 interrupts = <112 70 71>;
97 clocks = <&clks 45>;
98 status = "disabled";
99};
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
new file mode 100644
index 000000000000..492bd991d52a
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
@@ -0,0 +1,222 @@
1* Clock bindings for Freescale i.MX6 Quad
2
3Required properties:
4- compatible: Should be "fsl,imx6q-ccm"
5- reg: Address and length of the register set
6- interrupts: Should contain CCM interrupt
7- #clock-cells: Should be <1>
8
9The clock consumer should specify the desired clock by having the clock
10ID in its "clocks" phandle cell. The following is a full list of i.MX6Q
11clocks and IDs.
12
13 Clock ID
14 ---------------------------
15 dummy 0
16 ckil 1
17 ckih 2
18 osc 3
19 pll2_pfd0_352m 4
20 pll2_pfd1_594m 5
21 pll2_pfd2_396m 6
22 pll3_pfd0_720m 7
23 pll3_pfd1_540m 8
24 pll3_pfd2_508m 9
25 pll3_pfd3_454m 10
26 pll2_198m 11
27 pll3_120m 12
28 pll3_80m 13
29 pll3_60m 14
30 twd 15
31 step 16
32 pll1_sw 17
33 periph_pre 18
34 periph2_pre 19
35 periph_clk2_sel 20
36 periph2_clk2_sel 21
37 axi_sel 22
38 esai_sel 23
39 asrc_sel 24
40 spdif_sel 25
41 gpu2d_axi 26
42 gpu3d_axi 27
43 gpu2d_core_sel 28
44 gpu3d_core_sel 29
45 gpu3d_shader_sel 30
46 ipu1_sel 31
47 ipu2_sel 32
48 ldb_di0_sel 33
49 ldb_di1_sel 34
50 ipu1_di0_pre_sel 35
51 ipu1_di1_pre_sel 36
52 ipu2_di0_pre_sel 37
53 ipu2_di1_pre_sel 38
54 ipu1_di0_sel 39
55 ipu1_di1_sel 40
56 ipu2_di0_sel 41
57 ipu2_di1_sel 42
58 hsi_tx_sel 43
59 pcie_axi_sel 44
60 ssi1_sel 45
61 ssi2_sel 46
62 ssi3_sel 47
63 usdhc1_sel 48
64 usdhc2_sel 49
65 usdhc3_sel 50
66 usdhc4_sel 51
67 enfc_sel 52
68 emi_sel 53
69 emi_slow_sel 54
70 vdo_axi_sel 55
71 vpu_axi_sel 56
72 cko1_sel 57
73 periph 58
74 periph2 59
75 periph_clk2 60
76 periph2_clk2 61
77 ipg 62
78 ipg_per 63
79 esai_pred 64
80 esai_podf 65
81 asrc_pred 66
82 asrc_podf 67
83 spdif_pred 68
84 spdif_podf 69
85 can_root 70
86 ecspi_root 71
87 gpu2d_core_podf 72
88 gpu3d_core_podf 73
89 gpu3d_shader 74
90 ipu1_podf 75
91 ipu2_podf 76
92 ldb_di0_podf 77
93 ldb_di1_podf 78
94 ipu1_di0_pre 79
95 ipu1_di1_pre 80
96 ipu2_di0_pre 81
97 ipu2_di1_pre 82
98 hsi_tx_podf 83
99 ssi1_pred 84
100 ssi1_podf 85
101 ssi2_pred 86
102 ssi2_podf 87
103 ssi3_pred 88
104 ssi3_podf 89
105 uart_serial_podf 90
106 usdhc1_podf 91
107 usdhc2_podf 92
108 usdhc3_podf 93
109 usdhc4_podf 94
110 enfc_pred 95
111 enfc_podf 96
112 emi_podf 97
113 emi_slow_podf 98
114 vpu_axi_podf 99
115 cko1_podf 100
116 axi 101
117 mmdc_ch0_axi_podf 102
118 mmdc_ch1_axi_podf 103
119 arm 104
120 ahb 105
121 apbh_dma 106
122 asrc 107
123 can1_ipg 108
124 can1_serial 109
125 can2_ipg 110
126 can2_serial 111
127 ecspi1 112
128 ecspi2 113
129 ecspi3 114
130 ecspi4 115
131 ecspi5 116
132 enet 117
133 esai 118
134 gpt_ipg 119
135 gpt_ipg_per 120
136 gpu2d_core 121
137 gpu3d_core 122
138 hdmi_iahb 123
139 hdmi_isfr 124
140 i2c1 125
141 i2c2 126
142 i2c3 127
143 iim 128
144 enfc 129
145 ipu1 130
146 ipu1_di0 131
147 ipu1_di1 132
148 ipu2 133
149 ipu2_di0 134
150 ldb_di0 135
151 ldb_di1 136
152 ipu2_di1 137
153 hsi_tx 138
154 mlb 139
155 mmdc_ch0_axi 140
156 mmdc_ch1_axi 141
157 ocram 142
158 openvg_axi 143
159 pcie_axi 144
160 pwm1 145
161 pwm2 146
162 pwm3 147
163 pwm4 148
164 per1_bch 149
165 gpmi_bch_apb 150
166 gpmi_bch 151
167 gpmi_io 152
168 gpmi_apb 153
169 sata 154
170 sdma 155
171 spba 156
172 ssi1 157
173 ssi2 158
174 ssi3 159
175 uart_ipg 160
176 uart_serial 161
177 usboh3 162
178 usdhc1 163
179 usdhc2 164
180 usdhc3 165
181 usdhc4 166
182 vdo_axi 167
183 vpu_axi 168
184 cko1 169
185 pll1_sys 170
186 pll2_bus 171
187 pll3_usb_otg 172
188 pll4_audio 173
189 pll5_video 174
190 pll6_mlb 175
191 pll7_usb_host 176
192 pll8_enet 177
193 ssi1_ipg 178
194 ssi2_ipg 179
195 ssi3_ipg 180
196 rom 181
197 usbphy1 182
198 usbphy2 183
199 ldb_di0_div_3_5 184
200 ldb_di1_div_3_5 185
201
202Examples:
203
204clks: ccm@020c4000 {
205 compatible = "fsl,imx6q-ccm";
206 reg = <0x020c4000 0x4000>;
207 interrupts = <0 87 0x04 0 88 0x04>;
208 #clock-cells = <1>;
209 clock-output-names = ...
210 "uart_ipg",
211 "uart_serial",
212 ...;
213};
214
215uart1: serial@02020000 {
216 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
217 reg = <0x02020000 0x4000>;
218 interrupts = <0 26 0x04>;
219 clocks = <&clks 160>, <&clks 161>;
220 clock-names = "ipg", "per";
221 status = "disabled";
222};
diff --git a/Documentation/devicetree/bindings/clock/vt8500.txt b/Documentation/devicetree/bindings/clock/vt8500.txt
new file mode 100644
index 000000000000..a880c70d0047
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/vt8500.txt
@@ -0,0 +1,72 @@
1Device Tree Clock bindings for arch-vt8500
2
3This binding uses the common clock binding[1].
4
5[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7Required properties:
8- compatible : shall be one of the following:
9 "via,vt8500-pll-clock" - for a VT8500/WM8505 PLL clock
10 "wm,wm8650-pll-clock" - for a WM8650 PLL clock
11 "via,vt8500-device-clock" - for a VT/WM device clock
12
13Required properties for PLL clocks:
14- reg : shall be the control register offset from PMC base for the pll clock.
15- clocks : shall be the input parent clock phandle for the clock. This should
16 be the reference clock.
17- #clock-cells : from common clock binding; shall be set to 0.
18
19Required properties for device clocks:
20- clocks : shall be the input parent clock phandle for the clock. This should
21 be a pll output.
22- #clock-cells : from common clock binding; shall be set to 0.
23
24
25Device Clocks
26
27Device clocks are required to have one or both of the following sets of
28properties:
29
30
31Gated device clocks:
32
33Required properties:
34- enable-reg : shall be the register offset from PMC base for the enable
35 register.
36- enable-bit : shall be the bit within enable-reg to enable/disable the clock.
37
38
39Divisor device clocks:
40
41Required property:
42- divisor-reg : shall be the register offset from PMC base for the divisor
43 register.
44Optional property:
45- divisor-mask : shall be the mask for the divisor register. Defaults to 0x1f
46 if not specified.
47
48
49For example:
50
51ref25: ref25M {
52 #clock-cells = <0>;
53 compatible = "fixed-clock";
54 clock-frequency = <25000000>;
55};
56
57plla: plla {
58 #clock-cells = <0>;
59 compatible = "wm,wm8650-pll-clock";
60 clocks = <&ref25>;
61 reg = <0x200>;
62};
63
64sdhc: sdhc {
65 #clock-cells = <0>;
66 compatible = "via,vt8500-device-clock";
67 clocks = <&pllb>;
68 divisor-reg = <0x328>;
69 divisor-mask = <0x3f>;
70 enable-reg = <0x254>;
71 enable-bit = <18>;
72};
diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
new file mode 100644
index 000000000000..4416ccc33472
--- /dev/null
+++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
@@ -0,0 +1,55 @@
1Generic CPU0 cpufreq driver
2
3It is a generic cpufreq driver for CPU0 frequency management. It
4supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
5systems which share clock and voltage across all CPUs.
6
7Both required and optional properties listed below must be defined
8under node /cpus/cpu@0.
9
10Required properties:
11- operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt
12 for details
13
14Optional properties:
15- clock-latency: Specify the possible maximum transition latency for clock,
16 in unit of nanoseconds.
17- voltage-tolerance: Specify the CPU voltage tolerance in percentage.
18
19Examples:
20
21cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 cpu@0 {
26 compatible = "arm,cortex-a9";
27 reg = <0>;
28 next-level-cache = <&L2>;
29 operating-points = <
30 /* kHz uV */
31 792000 1100000
32 396000 950000
33 198000 850000
34 >;
35 transition-latency = <61036>; /* two CLK32 periods */
36 };
37
38 cpu@1 {
39 compatible = "arm,cortex-a9";
40 reg = <1>;
41 next-level-cache = <&L2>;
42 };
43
44 cpu@2 {
45 compatible = "arm,cortex-a9";
46 reg = <2>;
47 next-level-cache = <&L2>;
48 };
49
50 cpu@3 {
51 compatible = "arm,cortex-a9";
52 reg = <3>;
53 next-level-cache = <&L2>;
54 };
55};
diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
index bf57ecd5d73a..bd7ce120bc13 100644
--- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
@@ -9,6 +9,7 @@ Copyright (C) 2008-2011 Freescale Semiconductor Inc.
9 -Run Time Integrity Check (RTIC) Node 9 -Run Time Integrity Check (RTIC) Node
10 -Run Time Integrity Check (RTIC) Memory Node 10 -Run Time Integrity Check (RTIC) Memory Node
11 -Secure Non-Volatile Storage (SNVS) Node 11 -Secure Non-Volatile Storage (SNVS) Node
12 -Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
12 -Full Example 13 -Full Example
13 14
14NOTE: the SEC 4 is also known as Freescale's Cryptographic Accelerator 15NOTE: the SEC 4 is also known as Freescale's Cryptographic Accelerator
@@ -294,6 +295,27 @@ Secure Non-Volatile Storage (SNVS) Node
294 address and length of the SEC4 configuration 295 address and length of the SEC4 configuration
295 registers. 296 registers.
296 297
298 - #address-cells
299 Usage: required
300 Value type: <u32>
301 Definition: A standard property. Defines the number of cells
302 for representing physical addresses in child nodes. Must
303 have a value of 1.
304
305 - #size-cells
306 Usage: required
307 Value type: <u32>
308 Definition: A standard property. Defines the number of cells
309 for representing the size of physical addresses in
310 child nodes. Must have a value of 1.
311
312 - ranges
313 Usage: required
314 Value type: <prop-encoded-array>
315 Definition: A standard property. Specifies the physical address
316 range of the SNVS register space. A triplet that includes
317 the child address, parent address, & length.
318
297 - interrupts 319 - interrupts
298 Usage: required 320 Usage: required
299 Value type: <prop_encoded-array> 321 Value type: <prop_encoded-array>
@@ -314,11 +336,34 @@ EXAMPLE
314 sec_mon@314000 { 336 sec_mon@314000 {
315 compatible = "fsl,sec-v4.0-mon"; 337 compatible = "fsl,sec-v4.0-mon";
316 reg = <0x314000 0x1000>; 338 reg = <0x314000 0x1000>;
339 ranges = <0 0x314000 0x1000>;
317 interrupt-parent = <&mpic>; 340 interrupt-parent = <&mpic>;
318 interrupts = <93 2>; 341 interrupts = <93 2>;
319 }; 342 };
320 343
321===================================================================== 344=====================================================================
345Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
346
347 A SNVS child node that defines SNVS LP RTC.
348
349 - compatible
350 Usage: required
351 Value type: <string>
352 Definition: Must include "fsl,sec-v4.0-mon-rtc-lp".
353
354 - reg
355 Usage: required
356 Value type: <prop-encoded-array>
357 Definition: A standard property. Specifies the physical
358 address and length of the SNVS LP configuration registers.
359
360EXAMPLE
361 sec_mon_rtc_lp@314000 {
362 compatible = "fsl,sec-v4.0-mon-rtc-lp";
363 reg = <0x34 0x58>;
364 };
365
366=====================================================================
322FULL EXAMPLE 367FULL EXAMPLE
323 368
324 crypto: crypto@300000 { 369 crypto: crypto@300000 {
@@ -390,8 +435,14 @@ FULL EXAMPLE
390 sec_mon: sec_mon@314000 { 435 sec_mon: sec_mon@314000 {
391 compatible = "fsl,sec-v4.0-mon"; 436 compatible = "fsl,sec-v4.0-mon";
392 reg = <0x314000 0x1000>; 437 reg = <0x314000 0x1000>;
438 ranges = <0 0x314000 0x1000>;
393 interrupt-parent = <&mpic>; 439 interrupt-parent = <&mpic>;
394 interrupts = <93 2>; 440 interrupts = <93 2>;
441
442 sec_mon_rtc_lp@34 {
443 compatible = "fsl,sec-v4.0-mon-rtc-lp";
444 reg = <0x34 0x58>;
445 };
395 }; 446 };
396 447
397===================================================================== 448=====================================================================
diff --git a/Documentation/devicetree/bindings/crypto/mv_cesa.txt b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
new file mode 100644
index 000000000000..47229b1a594b
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
@@ -0,0 +1,20 @@
1Marvell Cryptographic Engines And Security Accelerator
2
3Required properties:
4- compatible : should be "marvell,orion-crypto"
5- reg : base physical address of the engine and length of memory mapped
6 region, followed by base physical address of sram and its memory
7 length
8- reg-names : "regs" , "sram";
9- interrupts : interrupt number
10
11Examples:
12
13 crypto@30000 {
14 compatible = "marvell,orion-crypto";
15 reg = <0x30000 0x10000>,
16 <0x4000000 0x800>;
17 reg-names = "regs" , "sram";
18 interrupts = <22>;
19 status = "okay";
20 };
diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindings/dma/arm-pl330.txt
index a4cd273b2a67..36e27d54260b 100644
--- a/Documentation/devicetree/bindings/dma/arm-pl330.txt
+++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
@@ -9,6 +9,9 @@ Required properties:
9 region. 9 region.
10 - interrupts: interrupt number to the cpu. 10 - interrupts: interrupt number to the cpu.
11 11
12Optional properties:
13- dma-coherent : Present if dma operations are coherent
14
12Example: 15Example:
13 16
14 pdma0: pdma@12680000 { 17 pdma0: pdma@12680000 {
diff --git a/Documentation/devicetree/bindings/dma/mmp-dma.txt b/Documentation/devicetree/bindings/dma/mmp-dma.txt
new file mode 100644
index 000000000000..a4fa4efa1d83
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/mmp-dma.txt
@@ -0,0 +1,74 @@
1* MARVELL MMP DMA controller
2
3Marvell Peripheral DMA Controller
4Used platfroms: pxa688, pxa910, pxa3xx, etc
5
6Required properties:
7- compatible: Should be "marvell,pdma-1.0"
8- reg: Should contain DMA registers location and length.
9- interrupts: Either contain all of the per-channel DMA interrupts
10 or one irq for pdma device
11- #dma-channels: Number of DMA channels supported by the controller.
12
13"marvell,pdma-1.0"
14Used platfroms: pxa25x, pxa27x, pxa3xx, pxa93x, pxa168, pxa910, pxa688.
15
16Examples:
17
18/*
19 * Each channel has specific irq
20 * ICU parse out irq channel from ICU register,
21 * while DMA controller may not able to distinguish the irq channel
22 * Using this method, interrupt-parent is required as demuxer
23 * For example, pxa688 icu register 0x128, bit 0~15 is PDMA channel irq,
24 * 18~21 is ADMA irq
25 */
26pdma: dma-controller@d4000000 {
27 compatible = "marvell,pdma-1.0";
28 reg = <0xd4000000 0x10000>;
29 interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
30 interrupt-parent = <&intcmux32>;
31 #dma-channels = <16>;
32 };
33
34/*
35 * One irq for all channels
36 * Dmaengine driver (DMA controller) distinguish irq channel via
37 * parsing internal register
38 */
39pdma: dma-controller@d4000000 {
40 compatible = "marvell,pdma-1.0";
41 reg = <0xd4000000 0x10000>;
42 interrupts = <47>;
43 #dma-channels = <16>;
44 };
45
46
47Marvell Two Channel DMA Controller used specifically for audio
48Used platfroms: pxa688, pxa910
49
50Required properties:
51- compatible: Should be "marvell,adma-1.0" or "marvell,pxa910-squ"
52- reg: Should contain DMA registers location and length.
53- interrupts: Either contain all of the per-channel DMA interrupts
54 or one irq for dma device
55
56"marvell,adma-1.0" used on pxa688
57"marvell,pxa910-squ" used on pxa910
58
59Examples:
60
61/* each channel has specific irq */
62adma0: dma-controller@d42a0800 {
63 compatible = "marvell,adma-1.0";
64 reg = <0xd42a0800 0x100>;
65 interrupts = <18 19>;
66 interrupt-parent = <&intcmux32>;
67 };
68
69/* One irq for all channels */
70squ: dma-controller@d42a0800 {
71 compatible = "marvell,pxa910-squ";
72 reg = <0xd42a0800 0x100>;
73 interrupts = <46>;
74 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-74x164.txt b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
new file mode 100644
index 000000000000..cc2608021f26
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-74x164.txt
@@ -0,0 +1,22 @@
1* Generic 8-bits shift register GPIO driver
2
3Required properties:
4- compatible : Should be "fairchild,74hc595"
5- reg : chip select number
6- gpio-controller : Marks the device node as a gpio controller.
7- #gpio-cells : Should be two. The first cell is the pin number and
8 the second cell is used to specify the gpio polarity:
9 0 = active high
10 1 = active low
11- registers-number: Number of daisy-chained shift registers
12
13Example:
14
15gpio5: gpio5@0 {
16 compatible = "fairchild,74hc595";
17 reg = <0>;
18 gpio-controller;
19 #gpio-cells = <2>;
20 registers-number = <4>;
21 spi-max-frequency = <100000>;
22};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-adnp.txt b/Documentation/devicetree/bindings/gpio/gpio-adnp.txt
new file mode 100644
index 000000000000..af66b2724837
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-adnp.txt
@@ -0,0 +1,34 @@
1Avionic Design N-bit GPIO expander bindings
2
3Required properties:
4- compatible: should be "ad,gpio-adnp"
5- reg: The I2C slave address for this device.
6- interrupt-parent: phandle of the parent interrupt controller.
7- interrupts: Interrupt specifier for the controllers interrupt.
8- #gpio-cells: Should be 2. The first cell is the GPIO number and the
9 second cell is used to specify optional parameters:
10 - bit 0: polarity (0: normal, 1: inverted)
11- gpio-controller: Marks the device as a GPIO controller
12- nr-gpios: The number of pins supported by the controller.
13
14The GPIO expander can optionally be used as an interrupt controller, in
15which case it uses the default two cell specifier as described in
16Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
17
18Example:
19
20 gpioext: gpio-controller@41 {
21 compatible = "ad,gpio-adnp";
22 reg = <0x41>;
23
24 interrupt-parent = <&gpio>;
25 interrupts = <160 1>;
26
27 gpio-controller;
28 #gpio-cells = <2>;
29
30 interrupt-controller;
31 #interrupt-cells = <2>;
32
33 nr-gpios = <64>;
34 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
new file mode 100644
index 000000000000..2dd457a3469a
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
@@ -0,0 +1,25 @@
1Bindings for fan connected to GPIO lines
2
3Required properties:
4- compatible : "gpio-fan"
5- gpios: Specifies the pins that map to bits in the control value,
6 ordered MSB-->LSB.
7- gpio-fan,speed-map: A mapping of possible fan RPM speeds and the
8 control value that should be set to achieve them. This array
9 must have the RPM values in ascending order.
10
11Optional properties:
12- alarm-gpios: This pin going active indicates something is wrong with
13 the fan, and a udev event will be fired.
14
15Examples:
16
17 gpio_fan {
18 compatible = "gpio-fan";
19 gpios = <&gpio1 14 1
20 &gpio1 13 1>;
21 gpio-fan,speed-map = <0 0
22 3000 1
23 6000 2>;
24 alarm-gpios = <&gpio1 15 1>;
25 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
new file mode 100644
index 000000000000..a6f3bec1da7d
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
@@ -0,0 +1,53 @@
1* Marvell EBU GPIO controller
2
3Required properties:
4
5- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
6 or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
7 Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
8 370. "marvell,mv78200-gpio" should be used for the Discovery
9 MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
10 SoCs (MV78230, MV78260, MV78460).
11
12- reg: Address and length of the register set for the device. Only one
13 entry is expected, except for the "marvell,armadaxp-gpio" variant
14 for which two entries are expected: one for the general registers,
15 one for the per-cpu registers.
16
17- interrupts: The list of interrupts that are used for all the pins
18 managed by this GPIO bank. There can be more than one interrupt
19 (example: 1 interrupt per 8 pins on Armada XP, which means 4
20 interrupts per bank of 32 GPIOs).
21
22- interrupt-controller: identifies the node as an interrupt controller
23
24- #interrupt-cells: specifies the number of cells needed to encode an
25 interrupt source. Should be two.
26 The first cell is the GPIO number.
27 The second cell is used to specify flags:
28 bits[3:0] trigger type and level flags:
29 1 = low-to-high edge triggered.
30 2 = high-to-low edge triggered.
31 4 = active high level-sensitive.
32 8 = active low level-sensitive.
33
34- gpio-controller: marks the device node as a gpio controller
35
36- ngpios: number of GPIOs this controller has
37
38- #gpio-cells: Should be two. The first cell is the pin number. The
39 second cell is reserved for flags, unused at the moment.
40
41Example:
42
43 gpio0: gpio@d0018100 {
44 compatible = "marvell,armadaxp-gpio";
45 reg = <0xd0018100 0x40>,
46 <0xd0018800 0x30>;
47 ngpios = <32>;
48 gpio-controller;
49 #gpio-cells = <2>;
50 interrupt-controller;
51 #interrupt-cells = <2>;
52 interrupts = <16>, <17>, <18>, <19>;
53 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
index 5375625e8cd2..f1e5dfecf55d 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
@@ -39,3 +39,46 @@ Example:
39 #gpio-cells = <4>; 39 #gpio-cells = <4>;
40 gpio-controller; 40 gpio-controller;
41 }; 41 };
42
43
44Samsung S3C24XX GPIO Controller
45
46Required properties:
47- compatible: Compatible property value should be "samsung,s3c24xx-gpio".
48
49- reg: Physical base address of the controller and length of memory mapped
50 region.
51
52- #gpio-cells: Should be 3. The syntax of the gpio specifier used by client nodes
53 should be the following with values derived from the SoC user manual.
54 <[phandle of the gpio controller node]
55 [pin number within the gpio controller]
56 [mux function]
57 [flags and pull up/down]
58
59 Values for gpio specifier:
60 - Pin number: depending on the controller a number from 0 up to 15.
61 - Mux function: Depending on the SoC and the gpio bank the gpio can be set
62 as input, output or a special function
63 - Flags and Pull Up/Down: the values to use differ for the individual SoCs
64 example S3C2416/S3C2450:
65 0 - Pull Up/Down Disabled.
66 1 - Pull Down Enabled.
67 2 - Pull Up Enabled.
68 Bit 16 (0x00010000) - Input is active low.
69 Consult the user manual for the correct values of Mux and Pull Up/Down.
70
71- gpio-controller: Specifies that the node is a gpio controller.
72- #address-cells: should be 1.
73- #size-cells: should be 1.
74
75Example:
76
77 gpa: gpio-controller@56000000 {
78 #address-cells = <1>;
79 #size-cells = <1>;
80 compatible = "samsung,s3c24xx-gpio";
81 reg = <0x56000000 0x10>;
82 #gpio-cells = <3>;
83 gpio-controller;
84 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
index 16695d9cf1e8..66788fda1db3 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
@@ -11,6 +11,11 @@ Required properties:
11- interrupt-controller: Mark the device node as an interrupt controller 11- interrupt-controller: Mark the device node as an interrupt controller
12 The first cell is the GPIO number. 12 The first cell is the GPIO number.
13 The second cell is not used. 13 The second cell is not used.
14- ti,use-leds : Enables LEDA and LEDB outputs if set
15- ti,debounce : if n-th bit is set, debounces GPIO-n
16- ti,mmc-cd : if n-th bit is set, GPIO-n controls VMMC(n+1)
17- ti,pullups : if n-th bit is set, set a pullup on GPIO-n
18- ti,pulldowns : if n-th bit is set, set a pulldown on GPIO-n
14 19
15Example: 20Example:
16 21
@@ -20,4 +25,5 @@ twl_gpio: gpio {
20 gpio-controller; 25 gpio-controller;
21 #interrupt-cells = <2>; 26 #interrupt-cells = <2>;
22 interrupt-controller; 27 interrupt-controller;
28 ti,use-leds;
23}; 29};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-vt8500.txt b/Documentation/devicetree/bindings/gpio/gpio-vt8500.txt
new file mode 100644
index 000000000000..f4dc5233167e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-vt8500.txt
@@ -0,0 +1,24 @@
1VIA/Wondermedia VT8500 GPIO Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-gpio", "wm,wm8505-gpio"
6 or "wm,wm8650-gpio" depending on your SoC
7- reg : Should contain 1 register range (address and length)
8- #gpio-cells : should be <3>.
9 1) bank
10 2) pin number
11 3) flags - should be 0
12
13Example:
14
15 gpio: gpio-controller@d8110000 {
16 compatible = "via,vt8500-gpio";
17 gpio-controller;
18 reg = <0xd8110000 0x10000>;
19 #gpio-cells = <3>;
20 };
21
22 vibrate {
23 gpios = <&gpio 0 1 0>; /* Bank 0, Pin 1, No flags */
24 };
diff --git a/Documentation/devicetree/bindings/gpio/led.txt b/Documentation/devicetree/bindings/gpio/led.txt
index 9bb308abd221..edc83c1c0d54 100644
--- a/Documentation/devicetree/bindings/gpio/led.txt
+++ b/Documentation/devicetree/bindings/gpio/led.txt
@@ -8,7 +8,7 @@ node's name represents the name of the corresponding LED.
8 8
9LED sub-node properties: 9LED sub-node properties:
10- gpios : Should specify the LED's GPIO, see "gpios property" in 10- gpios : Should specify the LED's GPIO, see "gpios property" in
11 Documentation/devicetree/gpio.txt. Active low LEDs should be 11 Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be
12 indicated using flags in the GPIO specifier. 12 indicated using flags in the GPIO specifier.
13- label : (optional) The label for this LED. If omitted, the label is 13- label : (optional) The label for this LED. If omitted, the label is
14 taken from the node name (excluding the unit address). 14 taken from the node name (excluding the unit address).
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 1a85f986961b..2f5322b119eb 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -56,3 +56,4 @@ stm,m41t00 Serial Access TIMEKEEPER
56stm,m41t62 Serial real-time clock (RTC) with alarm 56stm,m41t62 Serial real-time clock (RTC) with alarm
57stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS 57stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS
58ti,tsc2003 I2C Touch-Screen Controller 58ti,tsc2003 I2C Touch-Screen Controller
59ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
diff --git a/Documentation/devicetree/bindings/input/gpio-keys-polled.txt b/Documentation/devicetree/bindings/input/gpio-keys-polled.txt
new file mode 100644
index 000000000000..313abefa37cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/gpio-keys-polled.txt
@@ -0,0 +1,38 @@
1Device-Tree bindings for input/gpio_keys_polled.c keyboard driver
2
3Required properties:
4 - compatible = "gpio-keys-polled";
5 - poll-interval: Poll interval time in milliseconds
6
7Optional properties:
8 - autorepeat: Boolean, Enable auto repeat feature of Linux input
9 subsystem.
10
11Each button (key) is represented as a sub-node of "gpio-keys-polled":
12Subnode properties:
13
14 - gpios: OF device-tree gpio specification.
15 - label: Descriptive name of the key.
16 - linux,code: Keycode to emit.
17
18Optional subnode-properties:
19 - linux,input-type: Specify event type this button/key generates.
20 If not specified defaults to <1> == EV_KEY.
21 - debounce-interval: Debouncing interval time in milliseconds.
22 If not specified defaults to 5.
23 - gpio-key,wakeup: Boolean, button can wake-up the system.
24
25Example nodes:
26
27 gpio_keys_polled {
28 compatible = "gpio-keys-polled";
29 #address-cells = <1>;
30 #size-cells = <0>;
31 poll-interval = <100>;
32 autorepeat;
33 button@21 {
34 label = "GPIO Key UP";
35 linux,code = <103>;
36 gpios = <&gpio1 0 1>;
37 };
38 ...
diff --git a/Documentation/devicetree/bindings/input/rotary-encoder.txt b/Documentation/devicetree/bindings/input/rotary-encoder.txt
new file mode 100644
index 000000000000..331549593ed5
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/rotary-encoder.txt
@@ -0,0 +1,36 @@
1Rotary encoder DT bindings
2
3Required properties:
4- gpios: a spec for two GPIOs to be used
5
6Optional properties:
7- linux,axis: the input subsystem axis to map to this rotary encoder.
8 Defaults to 0 (ABS_X / REL_X)
9- rotary-encoder,steps: Number of steps in a full turnaround of the
10 encoder. Only relevant for absolute axis. Defaults to 24 which is a
11 typical value for such devices.
12- rotary-encoder,relative-axis: register a relative axis rather than an
13 absolute one. Relative axis will only generate +1/-1 events on the input
14 device, hence no steps need to be passed.
15- rotary-encoder,rollover: Automatic rollove when the rotary value becomes
16 greater than the specified steps or smaller than 0. For absolute axis only.
17- rotary-encoder,half-period: Makes the driver work on half-period mode.
18
19See Documentation/input/rotary-encoder.txt for more information.
20
21Example:
22
23 rotary@0 {
24 compatible = "rotary-encoder";
25 gpios = <&gpio 19 1>, <&gpio 20 0>; /* GPIO19 is inverted */
26 linux,axis = <0>; /* REL_X */
27 rotary-encoder,relative-axis;
28 };
29
30 rotary@1 {
31 compatible = "rotary-encoder";
32 gpios = <&gpio 21 0>, <&gpio 22 0>;
33 linux,axis = <1>; /* ABS_Y */
34 rotary-encoder,steps = <24>;
35 rotary-encoder,rollover;
36 };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
new file mode 100644
index 000000000000..548892c08c59
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
@@ -0,0 +1,110 @@
1BCM2835 Top-Level ("ARMCTRL") Interrupt Controller
2
3The BCM2835 contains a custom top-level interrupt controller, which supports
472 interrupt sources using a 2-level register scheme. The interrupt
5controller, or the HW block containing it, is referred to occasionally
6as "armctrl" in the SoC documentation, hence naming of this binding.
7
8Required properties:
9
10- compatible : should be "brcm,bcm2835-armctrl-ic.txt"
11- reg : Specifies base physical address and size of the registers.
12- interrupt-controller : Identifies the node as an interrupt controller
13- #interrupt-cells : Specifies the number of cells needed to encode an
14 interrupt source. The value shall be 2.
15
16 The 1st cell is the interrupt bank; 0 for interrupts in the "IRQ basic
17 pending" register, or 1/2 respectively for interrupts in the "IRQ pending
18 1/2" register.
19
20 The 2nd cell contains the interrupt number within the bank. Valid values
21 are 0..7 for bank 0, and 0..31 for bank 1.
22
23The interrupt sources are as follows:
24
25Bank 0:
260: ARM_TIMER
271: ARM_MAILBOX
282: ARM_DOORBELL_0
293: ARM_DOORBELL_1
304: VPU0_HALTED
315: VPU1_HALTED
326: ILLEGAL_TYPE0
337: ILLEGAL_TYPE1
34
35Bank 1:
360: TIMER0
371: TIMER1
382: TIMER2
393: TIMER3
404: CODEC0
415: CODEC1
426: CODEC2
437: VC_JPEG
448: ISP
459: VC_USB
4610: VC_3D
4711: TRANSPOSER
4812: MULTICORESYNC0
4913: MULTICORESYNC1
5014: MULTICORESYNC2
5115: MULTICORESYNC3
5216: DMA0
5317: DMA1
5418: VC_DMA2
5519: VC_DMA3
5620: DMA4
5721: DMA5
5822: DMA6
5923: DMA7
6024: DMA8
6125: DMA9
6226: DMA10
6327: DMA11
6428: DMA12
6529: AUX
6630: ARM
6731: VPUDMA
68
69Bank 2:
700: HOSTPORT
711: VIDEOSCALER
722: CCP2TX
733: SDC
744: DSI0
755: AVE
766: CAM0
777: CAM1
788: HDMI0
799: HDMI1
8010: PIXELVALVE1
8111: I2CSPISLV
8212: DSI1
8313: PWA0
8414: PWA1
8515: CPR
8616: SMI
8717: GPIO0
8818: GPIO1
8919: GPIO2
9020: GPIO3
9121: VC_I2C
9222: VC_SPI
9323: VC_I2SPCM
9424: VC_SDIO
9525: VC_UART
9626: SLIMBUS
9727: VEC
9828: CPG
9929: RNG
10030: VC_ARASANSDIO
10131: AVSPMON
102
103Example:
104
105intc: interrupt-controller {
106 compatible = "brcm,bcm2835-armctrl-ic";
107 reg = <0x7e00b200 0x200>;
108 interrupt-controller;
109 #interrupt-cells = <2>;
110};
diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
new file mode 100644
index 000000000000..72a06c0ab1db
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -0,0 +1,95 @@
1Specifying interrupt information for devices
2============================================
3
41) Interrupt client nodes
5-------------------------
6
7Nodes that describe devices which generate interrupts must contain an
8"interrupts" property. This property must contain a list of interrupt
9specifiers, one per output interrupt. The format of the interrupt specifier is
10determined by the interrupt controller to which the interrupts are routed; see
11section 2 below for details.
12
13The "interrupt-parent" property is used to specify the controller to which
14interrupts are routed and contains a single phandle referring to the interrupt
15controller node. This property is inherited, so it may be specified in an
16interrupt client node or in any of its parent nodes.
17
182) Interrupt controller nodes
19-----------------------------
20
21A device is marked as an interrupt controller with the "interrupt-controller"
22property. This is a empty, boolean property. An additional "#interrupt-cells"
23property defines the number of cells needed to specify a single interrupt.
24
25It is the responsibility of the interrupt controller's binding to define the
26length and format of the interrupt specifier. The following two variants are
27commonly used:
28
29 a) one cell
30 -----------
31 The #interrupt-cells property is set to 1 and the single cell defines the
32 index of the interrupt within the controller.
33
34 Example:
35
36 vic: intc@10140000 {
37 compatible = "arm,versatile-vic";
38 interrupt-controller;
39 #interrupt-cells = <1>;
40 reg = <0x10140000 0x1000>;
41 };
42
43 sic: intc@10003000 {
44 compatible = "arm,versatile-sic";
45 interrupt-controller;
46 #interrupt-cells = <1>;
47 reg = <0x10003000 0x1000>;
48 interrupt-parent = <&vic>;
49 interrupts = <31>; /* Cascaded to vic */
50 };
51
52 b) two cells
53 ------------
54 The #interrupt-cells property is set to 2 and the first cell defines the
55 index of the interrupt within the controller, while the second cell is used
56 to specify any of the following flags:
57 - bits[3:0] trigger type and level flags
58 1 = low-to-high edge triggered
59 2 = high-to-low edge triggered
60 4 = active high level-sensitive
61 8 = active low level-sensitive
62
63 Example:
64
65 i2c@7000c000 {
66 gpioext: gpio-adnp@41 {
67 compatible = "ad,gpio-adnp";
68 reg = <0x41>;
69
70 interrupt-parent = <&gpio>;
71 interrupts = <160 1>;
72
73 gpio-controller;
74 #gpio-cells = <1>;
75
76 interrupt-controller;
77 #interrupt-cells = <2>;
78
79 nr-gpios = <64>;
80 };
81
82 sx8634@2b {
83 compatible = "smtc,sx8634";
84 reg = <0x2b>;
85
86 interrupt-parent = <&gpioext>;
87 interrupts = <3 0x8>;
88
89 #address-cells = <1>;
90 #size-cells = <0>;
91
92 threshold = <0x40>;
93 sensitivity = <7>;
94 };
95 };
diff --git a/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt b/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
new file mode 100644
index 000000000000..9ceb19e0c7fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
@@ -0,0 +1,52 @@
1* AC timing parameters of LPDDR2(JESD209-2) memories for a given speed-bin
2
3Required properties:
4- compatible : Should be "jedec,lpddr2-timings"
5- min-freq : minimum DDR clock frequency for the speed-bin. Type is <u32>
6- max-freq : maximum DDR clock frequency for the speed-bin. Type is <u32>
7
8Optional properties:
9
10The following properties represent AC timing parameters from the memory
11data-sheet of the device for a given speed-bin. All these properties are
12of type <u32> and the default unit is ps (pico seconds). Parameters with
13a different unit have a suffix indicating the unit such as 'tRAS-max-ns'
14- tRCD
15- tWR
16- tRAS-min
17- tRRD
18- tWTR
19- tXP
20- tRTP
21- tDQSCK-max
22- tFAW
23- tZQCS
24- tZQinit
25- tRPab
26- tZQCL
27- tCKESR
28- tRAS-max-ns
29- tDQSCK-max-derated
30
31Example:
32
33timings_elpida_ECB240ABACN_400mhz: lpddr2-timings@0 {
34 compatible = "jedec,lpddr2-timings";
35 min-freq = <10000000>;
36 max-freq = <400000000>;
37 tRPab = <21000>;
38 tRCD = <18000>;
39 tWR = <15000>;
40 tRAS-min = <42000>;
41 tRRD = <10000>;
42 tWTR = <7500>;
43 tXP = <7500>;
44 tRTP = <7500>;
45 tCKESR = <15000>;
46 tDQSCK-max = <5500>;
47 tFAW = <50000>;
48 tZQCS = <90000>;
49 tZQCL = <360000>;
50 tZQinit = <1000000>;
51 tRAS-max-ns = <70000>;
52};
diff --git a/Documentation/devicetree/bindings/lpddr2/lpddr2.txt b/Documentation/devicetree/bindings/lpddr2/lpddr2.txt
new file mode 100644
index 000000000000..58354a075e13
--- /dev/null
+++ b/Documentation/devicetree/bindings/lpddr2/lpddr2.txt
@@ -0,0 +1,102 @@
1* LPDDR2 SDRAM memories compliant to JEDEC JESD209-2
2
3Required properties:
4- compatible : Should be one of - "jedec,lpddr2-nvm", "jedec,lpddr2-s2",
5 "jedec,lpddr2-s4"
6
7 "ti,jedec-lpddr2-s2" should be listed if the memory part is LPDDR2-S2 type
8
9 "ti,jedec-lpddr2-s4" should be listed if the memory part is LPDDR2-S4 type
10
11 "ti,jedec-lpddr2-nvm" should be listed if the memory part is LPDDR2-NVM type
12
13- density : <u32> representing density in Mb (Mega bits)
14
15- io-width : <u32> representing bus width. Possible values are 8, 16, and 32
16
17Optional properties:
18
19The following optional properties represent the minimum value of some AC
20timing parameters of the DDR device in terms of number of clock cycles.
21These values shall be obtained from the device data-sheet.
22- tRRD-min-tck
23- tWTR-min-tck
24- tXP-min-tck
25- tRTP-min-tck
26- tCKE-min-tck
27- tRPab-min-tck
28- tRCD-min-tck
29- tWR-min-tck
30- tRASmin-min-tck
31- tCKESR-min-tck
32- tFAW-min-tck
33
34Child nodes:
35- The lpddr2 node may have one or more child nodes of type "lpddr2-timings".
36 "lpddr2-timings" provides AC timing parameters of the device for
37 a given speed-bin. The user may provide the timings for as many
38 speed-bins as is required. Please see Documentation/devicetree/
39 bindings/lpddr2/lpddr2-timings.txt for more information on "lpddr2-timings"
40
41Example:
42
43elpida_ECB240ABACN : lpddr2 {
44 compatible = "Elpida,ECB240ABACN","jedec,lpddr2-s4";
45 density = <2048>;
46 io-width = <32>;
47
48 tRPab-min-tck = <3>;
49 tRCD-min-tck = <3>;
50 tWR-min-tck = <3>;
51 tRASmin-min-tck = <3>;
52 tRRD-min-tck = <2>;
53 tWTR-min-tck = <2>;
54 tXP-min-tck = <2>;
55 tRTP-min-tck = <2>;
56 tCKE-min-tck = <3>;
57 tCKESR-min-tck = <3>;
58 tFAW-min-tck = <8>;
59
60 timings_elpida_ECB240ABACN_400mhz: lpddr2-timings@0 {
61 compatible = "jedec,lpddr2-timings";
62 min-freq = <10000000>;
63 max-freq = <400000000>;
64 tRPab = <21000>;
65 tRCD = <18000>;
66 tWR = <15000>;
67 tRAS-min = <42000>;
68 tRRD = <10000>;
69 tWTR = <7500>;
70 tXP = <7500>;
71 tRTP = <7500>;
72 tCKESR = <15000>;
73 tDQSCK-max = <5500>;
74 tFAW = <50000>;
75 tZQCS = <90000>;
76 tZQCL = <360000>;
77 tZQinit = <1000000>;
78 tRAS-max-ns = <70000>;
79 };
80
81 timings_elpida_ECB240ABACN_200mhz: lpddr2-timings@1 {
82 compatible = "jedec,lpddr2-timings";
83 min-freq = <10000000>;
84 max-freq = <200000000>;
85 tRPab = <21000>;
86 tRCD = <18000>;
87 tWR = <15000>;
88 tRAS-min = <42000>;
89 tRRD = <10000>;
90 tWTR = <10000>;
91 tXP = <7500>;
92 tRTP = <7500>;
93 tCKESR = <15000>;
94 tDQSCK-max = <5500>;
95 tFAW = <50000>;
96 tZQCS = <90000>;
97 tZQCL = <360000>;
98 tZQinit = <1000000>;
99 tRAS-max-ns = <70000>;
100 };
101
102}
diff --git a/Documentation/devicetree/bindings/media/exynos5-gsc.txt b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
new file mode 100644
index 000000000000..0604d42f38d1
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
@@ -0,0 +1,30 @@
1* Samsung Exynos5 G-Scaler device
2
3G-Scaler is used for scaling and color space conversion on EXYNOS5 SoCs.
4
5Required properties:
6- compatible: should be "samsung,exynos5-gsc"
7- reg: should contain G-Scaler physical address location and length.
8- interrupts: should contain G-Scaler interrupt number
9
10Example:
11
12gsc_0: gsc@0x13e00000 {
13 compatible = "samsung,exynos5-gsc";
14 reg = <0x13e00000 0x1000>;
15 interrupts = <0 85 0>;
16};
17
18Aliases:
19Each G-Scaler node should have a numbered alias in the aliases node,
20in the form of gscN, N = 0...3. G-Scaler driver uses these aliases
21to retrieve the device IDs using "of_alias_get_id()" call.
22
23Example:
24
25aliases {
26 gsc0 =&gsc_0;
27 gsc1 =&gsc_1;
28 gsc2 =&gsc_2;
29 gsc3 =&gsc_3;
30};
diff --git a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
new file mode 100644
index 000000000000..938f8e1ba205
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
@@ -0,0 +1,55 @@
1* EMIF family of TI SDRAM controllers
2
3EMIF - External Memory Interface - is an SDRAM controller used in
4TI SoCs. EMIF supports, based on the IP revision, one or more of
5DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance
6of the EMIF IP and memory parts attached to it.
7
8Required properties:
9- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev>
10 is the IP revision of the specific EMIF instance.
11
12- phy-type : <u32> indicating the DDR phy type. Following are the
13 allowed values
14 <1> : Attila PHY
15 <2> : Intelli PHY
16
17- device-handle : phandle to a "lpddr2" node representing the memory part
18
19- ti,hwmods : For TI hwmods processing and omap device creation
20 the value shall be "emif<n>" where <n> is the number of the EMIF
21 instance with base 1.
22
23Optional properties:
24- cs1-used : Have this property if CS1 of this EMIF
25 instance has a memory part attached to it. If there is a memory
26 part attached to CS1, it should be the same type as the one on CS0,
27 so there is no need to give the details of this memory part.
28
29- cal-resistor-per-cs : Have this property if the board has one
30 calibration resistor per chip-select.
31
32- hw-caps-read-idle-ctrl: Have this property if the controller
33 supports read idle window programming
34
35- hw-caps-dll-calib-ctrl: Have this property if the controller
36 supports dll calibration control
37
38- hw-caps-ll-interface : Have this property if the controller
39 has a low latency interface and corresponding interrupt events
40
41- hw-caps-temp-alert : Have this property if the controller
42 has capability for generating SDRAM temperature alerts
43
44Example:
45
46emif1: emif@0x4c000000 {
47 compatible = "ti,emif-4d";
48 ti,hwmods = "emif2";
49 phy-type = <1>;
50 device-handle = <&elpida_ECB240ABACN>;
51 cs1-used;
52 hw-caps-read-idle-ctrl;
53 hw-caps-ll-interface;
54 hw-caps-temp-alert;
55};
diff --git a/Documentation/devicetree/bindings/mfd/88pm860x.txt b/Documentation/devicetree/bindings/mfd/88pm860x.txt
new file mode 100644
index 000000000000..63f3ee33759c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/88pm860x.txt
@@ -0,0 +1,85 @@
1* Marvell 88PM860x Power Management IC
2
3Required parent device properties:
4- compatible : "marvell,88pm860x"
5- reg : the I2C slave address for the 88pm860x chip
6- interrupts : IRQ line for the 88pm860x chip
7- interrupt-controller: describes the 88pm860x as an interrupt controller (has its own domain)
8- #interrupt-cells : should be 1.
9 - The cell is the 88pm860x local IRQ number
10
11Optional parent device properties:
12- marvell,88pm860x-irq-read-clr: inicates whether interrupt status is cleared by read
13- marvell,88pm860x-slave-addr: 88pm860x are two chips solution. <reg> stores the I2C address
14 of one chip, and this property stores the I2C address of
15 another chip.
16
1788pm860x consists of a large and varied group of sub-devices:
18
19Device Supply Names Description
20------ ------------ -----------
2188pm860x-onkey : : On key
2288pm860x-rtc : : RTC
2388pm8607 : : Regulators
2488pm860x-backlight : : Backlight
2588pm860x-led : : Led
2688pm860x-touch : : Touchscreen
27
28Example:
29
30 pmic: 88pm860x@34 {
31 compatible = "marvell,88pm860x";
32 reg = <0x34>;
33 interrupts = <4>;
34 interrupt-parent = <&intc>;
35 interrupt-controller;
36 #interrupt-cells = <1>;
37
38 marvell,88pm860x-irq-read-clr;
39 marvell,88pm860x-slave-addr = <0x11>;
40
41 regulators {
42 BUCK1 {
43 regulator-min-microvolt = <1000000>;
44 regulator-max-microvolt = <1500000>;
45 regulator-boot-on;
46 regulator-always-on;
47 };
48 LDO1 {
49 regulator-min-microvolt = <1200000>;
50 regulator-max-microvolt = <2800000>;
51 regulator-boot-on;
52 regulator-always-on;
53 };
54 };
55 rtc {
56 marvell,88pm860x-vrtc = <1>;
57 };
58 touch {
59 marvell,88pm860x-gpadc-prebias = <1>;
60 marvell,88pm860x-gpadc-slot-cycle = <1>;
61 marvell,88pm860x-tsi-prebias = <6>;
62 marvell,88pm860x-pen-prebias = <16>;
63 marvell,88pm860x-pen-prechg = <2>;
64 marvell,88pm860x-resistor-X = <300>;
65 };
66 backlights {
67 backlight-0 {
68 marvell,88pm860x-iset = <4>;
69 marvell,88pm860x-pwm = <3>;
70 };
71 backlight-2 {
72 };
73 };
74 leds {
75 led0-red {
76 marvell,88pm860x-iset = <12>;
77 };
78 led0-green {
79 marvell,88pm860x-iset = <12>;
80 };
81 led0-blue {
82 marvell,88pm860x-iset = <12>;
83 };
84 };
85 };
diff --git a/Documentation/devicetree/bindings/mfd/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt
index 69e757a657a0..ce83c8d3c00e 100644
--- a/Documentation/devicetree/bindings/mfd/ab8500.txt
+++ b/Documentation/devicetree/bindings/mfd/ab8500.txt
@@ -23,6 +23,7 @@ Device IRQ Names Supply Names Description
23ab8500-bm : : : Battery Manager 23ab8500-bm : : : Battery Manager
24ab8500-btemp : : : Battery Temperature 24ab8500-btemp : : : Battery Temperature
25ab8500-charger : : : Battery Charger 25ab8500-charger : : : Battery Charger
26ab8500-codec : : : Audio Codec
26ab8500-fg : : : Fuel Gauge 27ab8500-fg : : : Fuel Gauge
27ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter 28ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter
28 SW_CONV_END : : 29 SW_CONV_END : :
@@ -52,6 +53,14 @@ Optional child device properties:
52 supplied in the interrupts property 53 supplied in the interrupts property
53- <supply_name>-supply : contains a phandle to the regulator supply node in Device Tree 54- <supply_name>-supply : contains a phandle to the regulator supply node in Device Tree
54 55
56Non-standard child device properties:
57 - Audio CODEC:
58 - stericsson,amic[1|2]-type-single-ended : Single-ended Analoge Mic (default: differential)
59 - stericsson,amic1a-bias-vamic2 : Analoge Mic wishes to use a non-standard Vamic
60 - stericsson,amic1b-bias-vamic2 : Analoge Mic wishes to use a non-standard Vamic
61 - stericsson,amic2-bias-vamic1 : Analoge Mic wishes to use a non-standard Vamic
62 - stericsson,earpeice-cmv : Earpeice voltage (only: 950 | 1100 | 1270 | 1580)
63
55ab8500@5 { 64ab8500@5 {
56 compatible = "stericsson,ab8500"; 65 compatible = "stericsson,ab8500";
57 reg = <5>; /* mailbox 5 is i2c */ 66 reg = <5>; /* mailbox 5 is i2c */
@@ -110,6 +119,12 @@ ab8500@5 {
110 compatible = "stericsson,ab8500-pwm"; 119 compatible = "stericsson,ab8500-pwm";
111 }; 120 };
112 121
122 codec: ab8500-codec {
123 compatible = "stericsson,ab8500-codec";
124
125 stericsson,earpeice-cmv = <950>; /* Units in mV. */
126 };
127
113 ab8500-regulators { 128 ab8500-regulators {
114 compatible = "stericsson,ab8500-regulator"; 129 compatible = "stericsson,ab8500-regulator";
115 130
diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
new file mode 100644
index 000000000000..fe8150bb3248
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/syscon.txt
@@ -0,0 +1,20 @@
1* System Controller Registers R/W driver
2
3System controller node represents a register region containing a set
4of miscellaneous registers. The registers are not cohesive enough to
5represent as any specific type of device. The typical use-case is for
6some other node's driver, or platform-specific code, to acquire a
7reference to the syscon node (e.g. by phandle, node path, or search
8using a specific compatible value), interrogate the node (or associated
9OS driver) to determine the location of the registers, and access the
10registers directly.
11
12Required properties:
13- compatible: Should contain "syscon".
14- reg: the register region can be accessed from syscon
15
16Examples:
17gpr: iomuxc-gpr@020e0000 {
18 compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
19 reg = <0x020e0000 0x38>;
20};
diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt b/Documentation/devicetree/bindings/mfd/tps65910.txt
index db03599ae4dc..2e3304888ffc 100644
--- a/Documentation/devicetree/bindings/mfd/tps65910.txt
+++ b/Documentation/devicetree/bindings/mfd/tps65910.txt
@@ -59,6 +59,8 @@ Optional properties:
59 in TPS6591X datasheet) 59 in TPS6591X datasheet)
60- ti,en-gpio-sleep: enable sleep control for gpios 60- ti,en-gpio-sleep: enable sleep control for gpios
61 There should be 9 entries here, one for each gpio. 61 There should be 9 entries here, one for each gpio.
62- ti,system-power-controller: Telling whether or not this pmic is controlling
63 the system power.
62 64
63Regulator Optional properties: 65Regulator Optional properties:
64- ti,regulator-ext-sleep-control: enable external sleep 66- ti,regulator-ext-sleep-control: enable external sleep
@@ -79,6 +81,8 @@ Example:
79 #interrupt-cells = <2>; 81 #interrupt-cells = <2>;
80 interrupt-controller; 82 interrupt-controller;
81 83
84 ti,system-power-controller;
85
82 ti,vmbch-threshold = 0; 86 ti,vmbch-threshold = 0;
83 ti,vmbch2-threshold = 0; 87 ti,vmbch2-threshold = 0;
84 ti,en-ck32k-xtal; 88 ti,en-ck32k-xtal;
diff --git a/Documentation/devicetree/bindings/mfd/twl4030-audio.txt b/Documentation/devicetree/bindings/mfd/twl4030-audio.txt
new file mode 100644
index 000000000000..414d2ae0adf6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/twl4030-audio.txt
@@ -0,0 +1,46 @@
1Texas Instruments TWL family (twl4030) audio module
2
3The audio module inside the TWL family consist of an audio codec and a vibra
4driver.
5
6Required properties:
7- compatible : must be "ti,twl4030-audio"
8
9Optional properties, nodes:
10
11Audio functionality:
12- codec { }: Need to be present if the audio functionality is used. Within this
13 section the following options can be used:
14- ti,digimic_delay: Delay need after enabling the digimic to reduce artifacts
15 from the start of the recorded sample (in ms)
16-ti,ramp_delay_value: HS ramp delay configuration to reduce pop noise
17-ti,hs_extmute: Use external mute for HS pop reduction
18-ti,hs_extmute_gpio: Use external GPIO to control the external mute
19-ti,offset_cncl_path: Offset cancellation path selection, refer to TRM for the
20 valid values.
21
22Vibra functionality
23- ti,enable-vibra: Need to be set to <1> if the vibra functionality is used. if
24 missing or it is 0, the vibra functionality is disabled.
25
26Example:
27&i2c1 {
28 clock-frequency = <2600000>;
29
30 twl: twl@48 {
31 reg = <0x48>;
32 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
33 interrupt-parent = <&intc>;
34
35 twl_audio: audio {
36 compatible = "ti,twl4030-audio";
37
38 ti,enable-vibra = <1>;
39
40 codec {
41 ti,ramp_delay_value = <3>;
42 };
43
44 };
45 };
46};
diff --git a/Documentation/devicetree/bindings/mfd/twl6040.txt b/Documentation/devicetree/bindings/mfd/twl6040.txt
index c855240f3a0e..0f5dd709d752 100644
--- a/Documentation/devicetree/bindings/mfd/twl6040.txt
+++ b/Documentation/devicetree/bindings/mfd/twl6040.txt
@@ -1,7 +1,7 @@
1Texas Instruments TWL6040 family 1Texas Instruments TWL6040 family
2 2
3The TWL6040s are 8-channel high quality low-power audio codecs providing audio 3The TWL6040s are 8-channel high quality low-power audio codecs providing audio,
4and vibra functionality on OMAP4+ platforms. 4vibra and GPO functionality on OMAP4+ platforms.
5They are connected ot the host processor via i2c for commands, McPDM for audio 5They are connected ot the host processor via i2c for commands, McPDM for audio
6data and commands. 6data and commands.
7 7
@@ -10,6 +10,8 @@ Required properties:
10- reg: must be 0x4b for i2c address 10- reg: must be 0x4b for i2c address
11- interrupts: twl6040 has one interrupt line connecteded to the main SoC 11- interrupts: twl6040 has one interrupt line connecteded to the main SoC
12- interrupt-parent: The parent interrupt controller 12- interrupt-parent: The parent interrupt controller
13- gpio-controller:
14- #gpio-cells = <1>: twl6040 provides GPO lines.
13- twl6040,audpwron-gpio: Power on GPIO line for the twl6040 15- twl6040,audpwron-gpio: Power on GPIO line for the twl6040
14 16
15- vio-supply: Regulator for the twl6040 VIO supply 17- vio-supply: Regulator for the twl6040 VIO supply
@@ -37,7 +39,6 @@ Example:
37&i2c1 { 39&i2c1 {
38 twl6040: twl@4b { 40 twl6040: twl@4b {
39 compatible = "ti,twl6040"; 41 compatible = "ti,twl6040";
40 reg = <0x4b>;
41 42
42 interrupts = <0 119 4>; 43 interrupts = <0 119 4>;
43 interrupt-parent = <&gic>; 44 interrupt-parent = <&gic>;
@@ -60,3 +61,5 @@ Example:
60 }; 61 };
61 }; 62 };
62}; 63};
64
65/include/ "twl6040.dtsi"
diff --git a/Documentation/devicetree/bindings/misc/at25.txt b/Documentation/devicetree/bindings/misc/at25.txt
index ab3c327929dd..1d3447165c37 100644
--- a/Documentation/devicetree/bindings/misc/at25.txt
+++ b/Documentation/devicetree/bindings/misc/at25.txt
@@ -1,21 +1,35 @@
1Atmel AT25 eeprom 1EEPROMs (SPI) compatible with Atmel at25.
2 2
3Required properties: 3Required properties:
4- compatible : "atmel,at25". 4- compatible : "atmel,at25".
5- reg : chip select number 5- reg : chip select number
6- spi-max-frequency : max spi frequency to use 6- spi-max-frequency : max spi frequency to use
7- pagesize : size of the eeprom page
8- size : total eeprom size in bytes
9- address-width : number of address bits (one of 8, 16, or 24)
7 10
11Optional properties:
12- spi-cpha : SPI shifted clock phase, as per spi-bus bindings.
13- spi-cpol : SPI inverse clock polarity, as per spi-bus bindings.
14- read-only : this parameter-less property disables writes to the eeprom
15
16Obsolete legacy properties are can be used in place of "size", "pagesize",
17"address-width", and "read-only":
8- at25,byte-len : total eeprom size in bytes 18- at25,byte-len : total eeprom size in bytes
9- at25,addr-mode : addr-mode flags, as defined in include/linux/spi/eeprom.h 19- at25,addr-mode : addr-mode flags, as defined in include/linux/spi/eeprom.h
10- at25,page-size : size of the eeprom page 20- at25,page-size : size of the eeprom page
11 21
12Examples: 22Additional compatible properties are also allowed.
13at25@0 { 23
14 compatible = "atmel,at25"; 24Example:
15 reg = <0> 25 at25@0 {
16 spi-max-frequency = <5000000>; 26 compatible = "atmel,at25", "st,m95256";
27 reg = <0>
28 spi-max-frequency = <5000000>;
29 spi-cpha;
30 spi-cpol;
17 31
18 at25,byte-len = <0x8000>; 32 pagesize = <64>;
19 at25,addr-mode = <2>; 33 size = <32768>;
20 at25,page-size = <64>; 34 address-width = <16>;
21}; 35 };
diff --git a/Documentation/devicetree/bindings/misc/ifm-csi.txt b/Documentation/devicetree/bindings/misc/ifm-csi.txt
new file mode 100644
index 000000000000..5bdfffb0b9f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/ifm-csi.txt
@@ -0,0 +1,41 @@
1IFM camera sensor interface on mpc5200 LocalPlus bus
2
3Required properties:
4- compatible: "ifm,o2d-csi"
5- reg: specifies sensor chip select number and associated address range
6- interrupts: external interrupt line number and interrupt sense mode
7 of the interrupt line signaling frame valid events
8- gpios: three gpio-specifiers for "capture", "reset" and "master enable"
9 GPIOs (strictly in this order).
10- ifm,csi-clk-handle: the phandle to a node in the DT describing the sensor
11 clock generator. This node is usually a general purpose timer controller.
12- ifm,csi-addr-bus-width: address bus width (valid values are 16, 24, 25)
13- ifm,csi-data-bus-width: data bus width (valid values are 8 and 16)
14- ifm,csi-wait-cycles: sensor bus wait cycles
15
16Optional properties:
17- ifm,csi-byte-swap: if this property is present, the byte swapping on
18 the bus will be enabled.
19
20Example:
21
22 csi@3,0 {
23 compatible = "ifm,o2d-csi";
24 reg = <3 0 0x00100000>; /* CS 3, 1 MiB range */
25 interrupts = <1 1 2>; /* IRQ1, edge falling */
26
27 ifm,csi-clk-handle = <&timer7>;
28 gpios = <&gpio_simple 23 0 /* image_capture */
29 &gpio_simple 26 0 /* image_reset */
30 &gpio_simple 29 0>; /* image_master_en */
31
32 ifm,csi-addr-bus-width = <24>;
33 ifm,csi-data-bus-width = <8>;
34 ifm,csi-wait-cycles = <0>;
35 };
36
37The base address of the used chip select is specified in the
38ranges property of the parent localbus node, for example:
39
40 ranges = <0 0 0xff000000 0x01000000
41 3 0 0xe3000000 0x00100000>;
diff --git a/Documentation/devicetree/bindings/misc/lis302.txt b/Documentation/devicetree/bindings/misc/lis302.txt
new file mode 100644
index 000000000000..6def86f6b053
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/lis302.txt
@@ -0,0 +1,112 @@
1LIS302 accelerometer devicetree bindings
2
3This device is matched via its bus drivers, and has a number of properties
4that apply in on the generic device (independent from the bus).
5
6
7Required properties for the SPI bindings:
8 - compatible: should be set to "st,lis3lv02d_spi"
9 - reg: the chipselect index
10 - spi-max-frequency: maximal bus speed, should be set to 1000000 unless
11 constrained by external circuitry
12 - interrupts: the interrupt generated by the device
13
14Required properties for the I2C bindings:
15 - compatible: should be set to "st,lis3lv02d"
16 - reg: i2c slave address
17 - Vdd-supply: The input supply for Vdd
18 - Vdd_IO-supply: The input supply for Vdd_IO
19
20
21Optional properties for all bus drivers:
22
23 - st,click-single-{x,y,z}: if present, tells the device to issue an
24 interrupt on single click events on the
25 x/y/z axis.
26 - st,click-double-{x,y,z}: if present, tells the device to issue an
27 interrupt on double click events on the
28 x/y/z axis.
29 - st,click-thresh-{x,y,z}: set the x/y/z axis threshold
30 - st,click-click-time-limit: click time limit, from 0 to 127.5msec
31 with step of 0.5 msec
32 - st,click-latency: click latency, from 0 to 255 msec with
33 step of 1 msec.
34 - st,click-window: click window, from 0 to 255 msec with
35 step of 1 msec.
36 - st,irq{1,2}-disable: disable IRQ 1/2
37 - st,irq{1,2}-ff-wu-1: raise IRQ 1/2 on FF_WU_1 condition
38 - st,irq{1,2}-ff-wu-2: raise IRQ 1/2 on FF_WU_2 condition
39 - st,irq{1,2}-data-ready: raise IRQ 1/2 on data ready contition
40 - st,irq{1,2}-click: raise IRQ 1/2 on click condition
41 - st,irq-open-drain: consider IRQ lines open-drain
42 - st,irq-active-low: make IRQ lines active low
43 - st,wu-duration-1: duration register for Free-Fall/Wake-Up
44 interrupt 1
45 - st,wu-duration-2: duration register for Free-Fall/Wake-Up
46 interrupt 2
47 - st,wakeup-{x,y,z}-{lo,hi}: set wakeup condition on x/y/z axis for
48 upper/lower limit
49 - st,highpass-cutoff-hz=: 1, 2, 4 or 8 for 1Hz, 2Hz, 4Hz or 8Hz of
50 highpass cut-off frequency
51 - st,hipass{1,2}-disable: disable highpass 1/2.
52 - st,default-rate=: set the default rate
53 - st,axis-{x,y,z}=: set the axis to map to the three coordinates
54 - st,{min,max}-limit-{x,y,z} set the min/max limits for x/y/z axis
55 (used by self-test)
56
57
58Example for a SPI device node:
59
60 lis302@0 {
61 compatible = "st,lis302dl-spi";
62 reg = <0>;
63 spi-max-frequency = <1000000>;
64 interrupt-parent = <&gpio>;
65 interrupts = <104 0>;
66
67 st,click-single-x;
68 st,click-single-y;
69 st,click-single-z;
70 st,click-thresh-x = <10>;
71 st,click-thresh-y = <10>;
72 st,click-thresh-z = <10>;
73 st,irq1-click;
74 st,irq2-click;
75 st,wakeup-x-lo;
76 st,wakeup-x-hi;
77 st,wakeup-y-lo;
78 st,wakeup-y-hi;
79 st,wakeup-z-lo;
80 st,wakeup-z-hi;
81 };
82
83Example for a I2C device node:
84
85 lis331dlh: lis331dlh@18 {
86 compatible = "st,lis331dlh", "st,lis3lv02d";
87 reg = <0x18>;
88 Vdd-supply = <&lis3_reg>;
89 Vdd_IO-supply = <&lis3_reg>;
90
91 st,click-single-x;
92 st,click-single-y;
93 st,click-single-z;
94 st,click-thresh-x = <10>;
95 st,click-thresh-y = <10>;
96 st,click-thresh-z = <10>;
97 st,irq1-click;
98 st,irq2-click;
99 st,wakeup-x-lo;
100 st,wakeup-x-hi;
101 st,wakeup-y-lo;
102 st,wakeup-y-hi;
103 st,wakeup-z-lo;
104 st,wakeup-z-hi;
105 st,min-limit-x = <120>;
106 st,min-limit-y = <120>;
107 st,min-limit-z = <140>;
108 st,max-limit-x = <550>;
109 st,max-limit-y = <550>;
110 st,max-limit-z = <750>;
111 };
112
diff --git a/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt b/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
new file mode 100644
index 000000000000..f1421e2bbab7
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
@@ -0,0 +1,31 @@
1PXA3xx NAND DT bindings
2
3Required properties:
4
5 - compatible: Should be "marvell,pxa3xx-nand"
6 - reg: The register base for the controller
7 - interrupts: The interrupt to map
8 - #address-cells: Set to <1> if the node includes partitions
9
10Optional properties:
11
12 - marvell,nand-enable-arbiter: Set to enable the bus arbiter
13 - marvell,nand-keep-config: Set to keep the NAND controller config as set
14 by the bootloader
15 - num-cs: Number of chipselect lines to usw
16
17Example:
18
19 nand0: nand@43100000 {
20 compatible = "marvell,pxa3xx-nand";
21 reg = <0x43100000 90>;
22 interrupts = <45>;
23 #address-cells = <1>;
24
25 marvell,nand-enable-arbiter;
26 marvell,nand-keep-config;
27 num-cs = <1>;
28
29 /* partitions (optional) */
30 };
31
diff --git a/Documentation/devicetree/bindings/net/calxeda-xgmac.txt b/Documentation/devicetree/bindings/net/calxeda-xgmac.txt
index 411727a3f82d..c8ae996bd8f2 100644
--- a/Documentation/devicetree/bindings/net/calxeda-xgmac.txt
+++ b/Documentation/devicetree/bindings/net/calxeda-xgmac.txt
@@ -6,6 +6,9 @@ Required properties:
6- interrupts : Should contain 3 xgmac interrupts. The 1st is main interrupt. 6- interrupts : Should contain 3 xgmac interrupts. The 1st is main interrupt.
7 The 2nd is pwr mgt interrupt. The 3rd is low power state interrupt. 7 The 2nd is pwr mgt interrupt. The 3rd is low power state interrupt.
8 8
9Optional properties:
10- dma-coherent : Present if dma operations are coherent
11
9Example: 12Example:
10 13
11ethernet@fff50000 { 14ethernet@fff50000 {
diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
new file mode 100644
index 000000000000..8f1ae81228e3
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/c_can.txt
@@ -0,0 +1,49 @@
1Bosch C_CAN/D_CAN controller Device Tree Bindings
2-------------------------------------------------
3
4Required properties:
5- compatible : Should be "bosch,c_can" for C_CAN controllers and
6 "bosch,d_can" for D_CAN controllers.
7- reg : physical base address and size of the C_CAN/D_CAN
8 registers map
9- interrupts : property with a value describing the interrupt
10 number
11
12Optional properties:
13- ti,hwmods : Must be "d_can<n>" or "c_can<n>", n being the
14 instance number
15
16Note: "ti,hwmods" field is used to fetch the base address and irq
17resources from TI, omap hwmod data base during device registration.
18Future plan is to migrate hwmod data base contents into device tree
19blob so that, all the required data will be used from device tree dts
20file.
21
22Example:
23
24Step1: SoC common .dtsi file
25
26 dcan1: d_can@481d0000 {
27 compatible = "bosch,d_can";
28 reg = <0x481d0000 0x2000>;
29 interrupts = <55>;
30 interrupt-parent = <&intc>;
31 status = "disabled";
32 };
33
34(or)
35
36 dcan1: d_can@481d0000 {
37 compatible = "bosch,d_can";
38 ti,hwmods = "d_can1";
39 reg = <0x481d0000 0x2000>;
40 interrupts = <55>;
41 interrupt-parent = <&intc>;
42 status = "disabled";
43 };
44
45Step 2: board specific .dts file
46
47 &dcan1 {
48 status = "okay";
49 };
diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
new file mode 100644
index 000000000000..dcaabe9fe869
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/cpsw.txt
@@ -0,0 +1,109 @@
1TI SoC Ethernet Switch Controller Device Tree Bindings
2------------------------------------------------------
3
4Required properties:
5- compatible : Should be "ti,cpsw"
6- reg : physical base address and size of the cpsw
7 registers map
8- interrupts : property with a value describing the interrupt
9 number
10- interrupt-parent : The parent interrupt controller
11- cpdma_channels : Specifies number of channels in CPDMA
12- host_port_no : Specifies host port shift
13- cpdma_reg_ofs : Specifies CPDMA submodule register offset
14- cpdma_sram_ofs : Specifies CPDMA SRAM offset
15- ale_reg_ofs : Specifies ALE submodule register offset
16- ale_entries : Specifies No of entries ALE can hold
17- host_port_reg_ofs : Specifies host port register offset
18- hw_stats_reg_ofs : Specifies hardware statistics register offset
19- bd_ram_ofs : Specifies internal desciptor RAM offset
20- bd_ram_size : Specifies internal descriptor RAM size
21- rx_descs : Specifies number of Rx descriptors
22- mac_control : Specifies Default MAC control register content
23 for the specific platform
24- slaves : Specifies number for slaves
25- slave_reg_ofs : Specifies slave register offset
26- sliver_reg_ofs : Specifies slave sliver register offset
27- phy_id : Specifies slave phy id
28- mac-address : Specifies slave MAC address
29
30Optional properties:
31- ti,hwmods : Must be "cpgmac0"
32- no_bd_ram : Must be 0 or 1
33
34Note: "ti,hwmods" field is used to fetch the base address and irq
35resources from TI, omap hwmod data base during device registration.
36Future plan is to migrate hwmod data base contents into device tree
37blob so that, all the required data will be used from device tree dts
38file.
39
40Examples:
41
42 mac: ethernet@4A100000 {
43 compatible = "ti,cpsw";
44 reg = <0x4A100000 0x1000>;
45 interrupts = <55 0x4>;
46 interrupt-parent = <&intc>;
47 cpdma_channels = <8>;
48 host_port_no = <0>;
49 cpdma_reg_ofs = <0x800>;
50 cpdma_sram_ofs = <0xa00>;
51 ale_reg_ofs = <0xd00>;
52 ale_entries = <1024>;
53 host_port_reg_ofs = <0x108>;
54 hw_stats_reg_ofs = <0x900>;
55 bd_ram_ofs = <0x2000>;
56 bd_ram_size = <0x2000>;
57 no_bd_ram = <0>;
58 rx_descs = <64>;
59 mac_control = <0x20>;
60 slaves = <2>;
61 cpsw_emac0: slave@0 {
62 slave_reg_ofs = <0x208>;
63 sliver_reg_ofs = <0xd80>;
64 phy_id = "davinci_mdio.16:00";
65 /* Filled in by U-Boot */
66 mac-address = [ 00 00 00 00 00 00 ];
67 };
68 cpsw_emac1: slave@1 {
69 slave_reg_ofs = <0x308>;
70 sliver_reg_ofs = <0xdc0>;
71 phy_id = "davinci_mdio.16:01";
72 /* Filled in by U-Boot */
73 mac-address = [ 00 00 00 00 00 00 ];
74 };
75 };
76
77(or)
78 mac: ethernet@4A100000 {
79 compatible = "ti,cpsw";
80 ti,hwmods = "cpgmac0";
81 cpdma_channels = <8>;
82 host_port_no = <0>;
83 cpdma_reg_ofs = <0x800>;
84 cpdma_sram_ofs = <0xa00>;
85 ale_reg_ofs = <0xd00>;
86 ale_entries = <1024>;
87 host_port_reg_ofs = <0x108>;
88 hw_stats_reg_ofs = <0x900>;
89 bd_ram_ofs = <0x2000>;
90 bd_ram_size = <0x2000>;
91 no_bd_ram = <0>;
92 rx_descs = <64>;
93 mac_control = <0x20>;
94 slaves = <2>;
95 cpsw_emac0: slave@0 {
96 slave_reg_ofs = <0x208>;
97 sliver_reg_ofs = <0xd80>;
98 phy_id = "davinci_mdio.16:00";
99 /* Filled in by U-Boot */
100 mac-address = [ 00 00 00 00 00 00 ];
101 };
102 cpsw_emac1: slave@1 {
103 slave_reg_ofs = <0x308>;
104 sliver_reg_ofs = <0xdc0>;
105 phy_id = "davinci_mdio.16:01";
106 /* Filled in by U-Boot */
107 mac-address = [ 00 00 00 00 00 00 ];
108 };
109 };
diff --git a/Documentation/devicetree/bindings/net/davinci-mdio.txt b/Documentation/devicetree/bindings/net/davinci-mdio.txt
new file mode 100644
index 000000000000..72efaaf764f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/davinci-mdio.txt
@@ -0,0 +1,33 @@
1TI SoC Davinci MDIO Controller Device Tree Bindings
2---------------------------------------------------
3
4Required properties:
5- compatible : Should be "ti,davinci_mdio"
6- reg : physical base address and size of the davinci mdio
7 registers map
8- bus_freq : Mdio Bus frequency
9
10Optional properties:
11- ti,hwmods : Must be "davinci_mdio"
12
13Note: "ti,hwmods" field is used to fetch the base address and irq
14resources from TI, omap hwmod data base during device registration.
15Future plan is to migrate hwmod data base contents into device tree
16blob so that, all the required data will be used from device tree dts
17file.
18
19Examples:
20
21 mdio: davinci_mdio@4A101000 {
22 compatible = "ti,cpsw";
23 reg = <0x4A101000 0x1000>;
24 bus_freq = <1000000>;
25 };
26
27(or)
28
29 mdio: davinci_mdio@4A101000 {
30 compatible = "ti,cpsw";
31 ti,hwmods = "davinci_mdio";
32 bus_freq = <1000000>;
33 };
diff --git a/Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt b/Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt
new file mode 100644
index 000000000000..8516929c7251
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-mux-mmioreg.txt
@@ -0,0 +1,75 @@
1Properties for an MDIO bus multiplexer controlled by a memory-mapped device
2
3This is a special case of a MDIO bus multiplexer. A memory-mapped device,
4like an FPGA, is used to control which child bus is connected. The mdio-mux
5node must be a child of the memory-mapped device. The driver currently only
6supports devices with eight-bit registers.
7
8Required properties in addition to the generic multiplexer properties:
9
10- compatible : string, must contain "mdio-mux-mmioreg"
11
12- reg : integer, contains the offset of the register that controls the bus
13 multiplexer. The size field in the 'reg' property is the size of
14 register, and must therefore be 1.
15
16- mux-mask : integer, contains an eight-bit mask that specifies which
17 bits in the register control the actual bus multiplexer. The
18 'reg' property of each child mdio-mux node must be constrained by
19 this mask.
20
21Example:
22
23The FPGA node defines a memory-mapped FPGA with a register space of 0x30 bytes.
24For the "EMI2" MDIO bus, register 9 (BRDCFG1) controls the mux on that bus.
25A bitmask of 0x6 means that bits 1 and 2 (bit 0 is lsb) are the bits on
26BRDCFG1 that control the actual mux.
27
28 /* The FPGA node */
29 fpga: board-control@3,0 {
30 #address-cells = <1>;
31 #size-cells = <1>;
32 compatible = "fsl,p5020ds-fpga", "fsl,fpga-ngpixis";
33 reg = <3 0 0x30>;
34 ranges = <0 3 0 0x30>;
35
36 mdio-mux-emi2 {
37 compatible = "mdio-mux-mmioreg", "mdio-mux";
38 mdio-parent-bus = <&xmdio0>;
39 #address-cells = <1>;
40 #size-cells = <0>;
41 reg = <9 1>; // BRDCFG1
42 mux-mask = <0x6>; // EMI2
43
44 emi2_slot1: mdio@0 { // Slot 1 XAUI (FM2)
45 reg = <0>;
46 #address-cells = <1>;
47 #size-cells = <0>;
48
49 phy_xgmii_slot1: ethernet-phy@0 {
50 compatible = "ethernet-phy-ieee802.3-c45";
51 reg = <4>;
52 };
53 };
54
55 emi2_slot2: mdio@2 { // Slot 2 XAUI (FM1)
56 reg = <2>;
57 #address-cells = <1>;
58 #size-cells = <0>;
59
60 phy_xgmii_slot2: ethernet-phy@4 {
61 compatible = "ethernet-phy-ieee802.3-c45";
62 reg = <0>;
63 };
64 };
65 };
66 };
67
68 /* The parent MDIO bus. */
69 xmdio0: mdio@f1000 {
70 #address-cells = <1>;
71 #size-cells = <0>;
72 compatible = "fsl,fman-xmdio";
73 reg = <0xf1000 0x1000>;
74 interrupts = <100 1 0 0>;
75 };
diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
new file mode 100644
index 000000000000..8edc20e1b09e
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
@@ -0,0 +1,74 @@
1Broadcom BCM2835 GPIO (and pinmux) controller
2
3The BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
4controller, and pinmux/control device.
5
6Required properties:
7- compatible: "brcm,bcm2835-gpio"
8- reg: Should contain the physical address of the GPIO module's registes.
9- gpio-controller: Marks the device node as a GPIO controller.
10- #gpio-cells : Should be two. The first cell is the pin number and the
11 second cell is used to specify optional parameters:
12 - bit 0 specifies polarity (0 for normal, 1 for inverted)
13- interrupts : The interrupt outputs from the controller. One interrupt per
14 individual bank followed by the "all banks" interrupt.
15- interrupt-controller: Marks the device node as an interrupt controller.
16- #interrupt-cells : Should be 2.
17 The first cell is the GPIO number.
18 The second cell is used to specify flags:
19 bits[3:0] trigger type and level flags:
20 1 = low-to-high edge triggered.
21 2 = high-to-low edge triggered.
22 4 = active high level-sensitive.
23 8 = active low level-sensitive.
24 Valid combinations are 1, 2, 3, 4, 8.
25
26Please refer to ../gpio/gpio.txt for a general description of GPIO bindings.
27
28Please refer to pinctrl-bindings.txt in this directory for details of the
29common pinctrl bindings used by client devices, including the meaning of the
30phrase "pin configuration node".
31
32Each pin configuration node lists the pin(s) to which it applies, and one or
33more of the mux function to select on those pin(s), and pull-up/down
34configuration. Each subnode only affects those parameters that are explicitly
35listed. In other words, a subnode that lists only a mux function implies no
36information about any pull configuration. Similarly, a subnode that lists only
37a pul parameter implies no information about the mux function.
38
39Required subnode-properties:
40- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
41 are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
42
43Optional subnode-properties:
44- brcm,function: Integer, containing the function to mux to the pin(s):
45 0: GPIO in
46 1: GPIO out
47 2: alt5
48 3: alt4
49 4: alt0
50 5: alt1
51 6: alt2
52 7: alt3
53- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
54 0: none
55 1: down
56 2: up
57
58Each of brcm,function and brcm,pull may contain either a single value which
59will be applied to all pins in brcm,pins, or 1 value for each entry in
60brcm,pins.
61
62Example:
63
64 gpio: gpio {
65 compatible = "brcm,bcm2835-gpio";
66 reg = <0x2200000 0xb4>;
67 interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
68
69 gpio-controller;
70 #gpio-cells = <2>;
71
72 interrupt-controller;
73 #interrupt-cells = <2>;
74 };
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx35-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx35-pinctrl.txt
new file mode 100644
index 000000000000..1183f1a3be33
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx35-pinctrl.txt
@@ -0,0 +1,984 @@
1* Freescale IMX35 IOMUX Controller
2
3Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
4and usage.
5
6Required properties:
7- compatible: "fsl,imx35-iomuxc"
8- fsl,pins: two integers array, represents a group of pins mux and config
9 setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
10 pin working on a specific function, CONFIG is the pad setting value like
11 pull-up for this pin. Please refer to imx35 datasheet for the valid pad
12 config settings.
13
14CONFIG bits definition:
15PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13)
16PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13)
17PAD_CTL_HYS (1 << 8)
18PAD_CTL_PKE (1 << 7)
19PAD_CTL_PUE (1 << 6)
20PAD_CTL_PUS_100K_DOWN (0 << 4)
21PAD_CTL_PUS_47K_UP (1 << 4)
22PAD_CTL_PUS_100K_UP (2 << 4)
23PAD_CTL_PUS_22K_UP (3 << 4)
24PAD_CTL_ODE_CMOS (0 << 3)
25PAD_CTL_ODE_OPENDRAIN (1 << 3)
26PAD_CTL_DSE_NOMINAL (0 << 1)
27PAD_CTL_DSE_HIGH (1 << 1)
28PAD_CTL_DSE_MAX (2 << 1)
29PAD_CTL_SRE_FAST (1 << 0)
30PAD_CTL_SRE_SLOW (0 << 0)
31
32See below for available PIN_FUNC_ID for imx35:
330 MX35_PAD_CAPTURE__GPT_CAPIN1
341 MX35_PAD_CAPTURE__GPT_CMPOUT2
352 MX35_PAD_CAPTURE__CSPI2_SS1
363 MX35_PAD_CAPTURE__EPIT1_EPITO
374 MX35_PAD_CAPTURE__CCM_CLK32K
385 MX35_PAD_CAPTURE__GPIO1_4
396 MX35_PAD_COMPARE__GPT_CMPOUT1
407 MX35_PAD_COMPARE__GPT_CAPIN2
418 MX35_PAD_COMPARE__GPT_CMPOUT3
429 MX35_PAD_COMPARE__EPIT2_EPITO
4310 MX35_PAD_COMPARE__GPIO1_5
4411 MX35_PAD_COMPARE__SDMA_EXTDMA_2
4512 MX35_PAD_WDOG_RST__WDOG_WDOG_B
4613 MX35_PAD_WDOG_RST__IPU_FLASH_STROBE
4714 MX35_PAD_WDOG_RST__GPIO1_6
4815 MX35_PAD_GPIO1_0__GPIO1_0
4916 MX35_PAD_GPIO1_0__CCM_PMIC_RDY
5017 MX35_PAD_GPIO1_0__OWIRE_LINE
5118 MX35_PAD_GPIO1_0__SDMA_EXTDMA_0
5219 MX35_PAD_GPIO1_1__GPIO1_1
5320 MX35_PAD_GPIO1_1__PWM_PWMO
5421 MX35_PAD_GPIO1_1__CSPI1_SS2
5522 MX35_PAD_GPIO1_1__SCC_TAMPER_DETECT
5623 MX35_PAD_GPIO1_1__SDMA_EXTDMA_1
5724 MX35_PAD_GPIO2_0__GPIO2_0
5825 MX35_PAD_GPIO2_0__USB_TOP_USBOTG_CLK
5926 MX35_PAD_GPIO3_0__GPIO3_0
6027 MX35_PAD_GPIO3_0__USB_TOP_USBH2_CLK
6128 MX35_PAD_RESET_IN_B__CCM_RESET_IN_B
6229 MX35_PAD_POR_B__CCM_POR_B
6330 MX35_PAD_CLKO__CCM_CLKO
6431 MX35_PAD_CLKO__GPIO1_8
6532 MX35_PAD_BOOT_MODE0__CCM_BOOT_MODE_0
6633 MX35_PAD_BOOT_MODE1__CCM_BOOT_MODE_1
6734 MX35_PAD_CLK_MODE0__CCM_CLK_MODE_0
6835 MX35_PAD_CLK_MODE1__CCM_CLK_MODE_1
6936 MX35_PAD_POWER_FAIL__CCM_DSM_WAKEUP_INT_26
7037 MX35_PAD_VSTBY__CCM_VSTBY
7138 MX35_PAD_VSTBY__GPIO1_7
7239 MX35_PAD_A0__EMI_EIM_DA_L_0
7340 MX35_PAD_A1__EMI_EIM_DA_L_1
7441 MX35_PAD_A2__EMI_EIM_DA_L_2
7542 MX35_PAD_A3__EMI_EIM_DA_L_3
7643 MX35_PAD_A4__EMI_EIM_DA_L_4
7744 MX35_PAD_A5__EMI_EIM_DA_L_5
7845 MX35_PAD_A6__EMI_EIM_DA_L_6
7946 MX35_PAD_A7__EMI_EIM_DA_L_7
8047 MX35_PAD_A8__EMI_EIM_DA_H_8
8148 MX35_PAD_A9__EMI_EIM_DA_H_9
8249 MX35_PAD_A10__EMI_EIM_DA_H_10
8350 MX35_PAD_MA10__EMI_MA10
8451 MX35_PAD_A11__EMI_EIM_DA_H_11
8552 MX35_PAD_A12__EMI_EIM_DA_H_12
8653 MX35_PAD_A13__EMI_EIM_DA_H_13
8754 MX35_PAD_A14__EMI_EIM_DA_H2_14
8855 MX35_PAD_A15__EMI_EIM_DA_H2_15
8956 MX35_PAD_A16__EMI_EIM_A_16
9057 MX35_PAD_A17__EMI_EIM_A_17
9158 MX35_PAD_A18__EMI_EIM_A_18
9259 MX35_PAD_A19__EMI_EIM_A_19
9360 MX35_PAD_A20__EMI_EIM_A_20
9461 MX35_PAD_A21__EMI_EIM_A_21
9562 MX35_PAD_A22__EMI_EIM_A_22
9663 MX35_PAD_A23__EMI_EIM_A_23
9764 MX35_PAD_A24__EMI_EIM_A_24
9865 MX35_PAD_A25__EMI_EIM_A_25
9966 MX35_PAD_SDBA1__EMI_EIM_SDBA1
10067 MX35_PAD_SDBA0__EMI_EIM_SDBA0
10168 MX35_PAD_SD0__EMI_DRAM_D_0
10269 MX35_PAD_SD1__EMI_DRAM_D_1
10370 MX35_PAD_SD2__EMI_DRAM_D_2
10471 MX35_PAD_SD3__EMI_DRAM_D_3
10572 MX35_PAD_SD4__EMI_DRAM_D_4
10673 MX35_PAD_SD5__EMI_DRAM_D_5
10774 MX35_PAD_SD6__EMI_DRAM_D_6
10875 MX35_PAD_SD7__EMI_DRAM_D_7
10976 MX35_PAD_SD8__EMI_DRAM_D_8
11077 MX35_PAD_SD9__EMI_DRAM_D_9
11178 MX35_PAD_SD10__EMI_DRAM_D_10
11279 MX35_PAD_SD11__EMI_DRAM_D_11
11380 MX35_PAD_SD12__EMI_DRAM_D_12
11481 MX35_PAD_SD13__EMI_DRAM_D_13
11582 MX35_PAD_SD14__EMI_DRAM_D_14
11683 MX35_PAD_SD15__EMI_DRAM_D_15
11784 MX35_PAD_SD16__EMI_DRAM_D_16
11885 MX35_PAD_SD17__EMI_DRAM_D_17
11986 MX35_PAD_SD18__EMI_DRAM_D_18
12087 MX35_PAD_SD19__EMI_DRAM_D_19
12188 MX35_PAD_SD20__EMI_DRAM_D_20
12289 MX35_PAD_SD21__EMI_DRAM_D_21
12390 MX35_PAD_SD22__EMI_DRAM_D_22
12491 MX35_PAD_SD23__EMI_DRAM_D_23
12592 MX35_PAD_SD24__EMI_DRAM_D_24
12693 MX35_PAD_SD25__EMI_DRAM_D_25
12794 MX35_PAD_SD26__EMI_DRAM_D_26
12895 MX35_PAD_SD27__EMI_DRAM_D_27
12996 MX35_PAD_SD28__EMI_DRAM_D_28
13097 MX35_PAD_SD29__EMI_DRAM_D_29
13198 MX35_PAD_SD30__EMI_DRAM_D_30
13299 MX35_PAD_SD31__EMI_DRAM_D_31
133100 MX35_PAD_DQM0__EMI_DRAM_DQM_0
134101 MX35_PAD_DQM1__EMI_DRAM_DQM_1
135102 MX35_PAD_DQM2__EMI_DRAM_DQM_2
136103 MX35_PAD_DQM3__EMI_DRAM_DQM_3
137104 MX35_PAD_EB0__EMI_EIM_EB0_B
138105 MX35_PAD_EB1__EMI_EIM_EB1_B
139106 MX35_PAD_OE__EMI_EIM_OE
140107 MX35_PAD_CS0__EMI_EIM_CS0
141108 MX35_PAD_CS1__EMI_EIM_CS1
142109 MX35_PAD_CS1__EMI_NANDF_CE3
143110 MX35_PAD_CS2__EMI_EIM_CS2
144111 MX35_PAD_CS3__EMI_EIM_CS3
145112 MX35_PAD_CS4__EMI_EIM_CS4
146113 MX35_PAD_CS4__EMI_DTACK_B
147114 MX35_PAD_CS4__EMI_NANDF_CE1
148115 MX35_PAD_CS4__GPIO1_20
149116 MX35_PAD_CS5__EMI_EIM_CS5
150117 MX35_PAD_CS5__CSPI2_SS2
151118 MX35_PAD_CS5__CSPI1_SS2
152119 MX35_PAD_CS5__EMI_NANDF_CE2
153120 MX35_PAD_CS5__GPIO1_21
154121 MX35_PAD_NF_CE0__EMI_NANDF_CE0
155122 MX35_PAD_NF_CE0__GPIO1_22
156123 MX35_PAD_ECB__EMI_EIM_ECB
157124 MX35_PAD_LBA__EMI_EIM_LBA
158125 MX35_PAD_BCLK__EMI_EIM_BCLK
159126 MX35_PAD_RW__EMI_EIM_RW
160127 MX35_PAD_RAS__EMI_DRAM_RAS
161128 MX35_PAD_CAS__EMI_DRAM_CAS
162129 MX35_PAD_SDWE__EMI_DRAM_SDWE
163130 MX35_PAD_SDCKE0__EMI_DRAM_SDCKE_0
164131 MX35_PAD_SDCKE1__EMI_DRAM_SDCKE_1
165132 MX35_PAD_SDCLK__EMI_DRAM_SDCLK
166133 MX35_PAD_SDQS0__EMI_DRAM_SDQS_0
167134 MX35_PAD_SDQS1__EMI_DRAM_SDQS_1
168135 MX35_PAD_SDQS2__EMI_DRAM_SDQS_2
169136 MX35_PAD_SDQS3__EMI_DRAM_SDQS_3
170137 MX35_PAD_NFWE_B__EMI_NANDF_WE_B
171138 MX35_PAD_NFWE_B__USB_TOP_USBH2_DATA_3
172139 MX35_PAD_NFWE_B__IPU_DISPB_D0_VSYNC
173140 MX35_PAD_NFWE_B__GPIO2_18
174141 MX35_PAD_NFWE_B__ARM11P_TOP_TRACE_0
175142 MX35_PAD_NFRE_B__EMI_NANDF_RE_B
176143 MX35_PAD_NFRE_B__USB_TOP_USBH2_DIR
177144 MX35_PAD_NFRE_B__IPU_DISPB_BCLK
178145 MX35_PAD_NFRE_B__GPIO2_19
179146 MX35_PAD_NFRE_B__ARM11P_TOP_TRACE_1
180147 MX35_PAD_NFALE__EMI_NANDF_ALE
181148 MX35_PAD_NFALE__USB_TOP_USBH2_STP
182149 MX35_PAD_NFALE__IPU_DISPB_CS0
183150 MX35_PAD_NFALE__GPIO2_20
184151 MX35_PAD_NFALE__ARM11P_TOP_TRACE_2
185152 MX35_PAD_NFCLE__EMI_NANDF_CLE
186153 MX35_PAD_NFCLE__USB_TOP_USBH2_NXT
187154 MX35_PAD_NFCLE__IPU_DISPB_PAR_RS
188155 MX35_PAD_NFCLE__GPIO2_21
189156 MX35_PAD_NFCLE__ARM11P_TOP_TRACE_3
190157 MX35_PAD_NFWP_B__EMI_NANDF_WP_B
191158 MX35_PAD_NFWP_B__USB_TOP_USBH2_DATA_7
192159 MX35_PAD_NFWP_B__IPU_DISPB_WR
193160 MX35_PAD_NFWP_B__GPIO2_22
194161 MX35_PAD_NFWP_B__ARM11P_TOP_TRCTL
195162 MX35_PAD_NFRB__EMI_NANDF_RB
196163 MX35_PAD_NFRB__IPU_DISPB_RD
197164 MX35_PAD_NFRB__GPIO2_23
198165 MX35_PAD_NFRB__ARM11P_TOP_TRCLK
199166 MX35_PAD_D15__EMI_EIM_D_15
200167 MX35_PAD_D14__EMI_EIM_D_14
201168 MX35_PAD_D13__EMI_EIM_D_13
202169 MX35_PAD_D12__EMI_EIM_D_12
203170 MX35_PAD_D11__EMI_EIM_D_11
204171 MX35_PAD_D10__EMI_EIM_D_10
205172 MX35_PAD_D9__EMI_EIM_D_9
206173 MX35_PAD_D8__EMI_EIM_D_8
207174 MX35_PAD_D7__EMI_EIM_D_7
208175 MX35_PAD_D6__EMI_EIM_D_6
209176 MX35_PAD_D5__EMI_EIM_D_5
210177 MX35_PAD_D4__EMI_EIM_D_4
211178 MX35_PAD_D3__EMI_EIM_D_3
212179 MX35_PAD_D2__EMI_EIM_D_2
213180 MX35_PAD_D1__EMI_EIM_D_1
214181 MX35_PAD_D0__EMI_EIM_D_0
215182 MX35_PAD_CSI_D8__IPU_CSI_D_8
216183 MX35_PAD_CSI_D8__KPP_COL_0
217184 MX35_PAD_CSI_D8__GPIO1_20
218185 MX35_PAD_CSI_D8__ARM11P_TOP_EVNTBUS_13
219186 MX35_PAD_CSI_D9__IPU_CSI_D_9
220187 MX35_PAD_CSI_D9__KPP_COL_1
221188 MX35_PAD_CSI_D9__GPIO1_21
222189 MX35_PAD_CSI_D9__ARM11P_TOP_EVNTBUS_14
223190 MX35_PAD_CSI_D10__IPU_CSI_D_10
224191 MX35_PAD_CSI_D10__KPP_COL_2
225192 MX35_PAD_CSI_D10__GPIO1_22
226193 MX35_PAD_CSI_D10__ARM11P_TOP_EVNTBUS_15
227194 MX35_PAD_CSI_D11__IPU_CSI_D_11
228195 MX35_PAD_CSI_D11__KPP_COL_3
229196 MX35_PAD_CSI_D11__GPIO1_23
230197 MX35_PAD_CSI_D12__IPU_CSI_D_12
231198 MX35_PAD_CSI_D12__KPP_ROW_0
232199 MX35_PAD_CSI_D12__GPIO1_24
233200 MX35_PAD_CSI_D13__IPU_CSI_D_13
234201 MX35_PAD_CSI_D13__KPP_ROW_1
235202 MX35_PAD_CSI_D13__GPIO1_25
236203 MX35_PAD_CSI_D14__IPU_CSI_D_14
237204 MX35_PAD_CSI_D14__KPP_ROW_2
238205 MX35_PAD_CSI_D14__GPIO1_26
239206 MX35_PAD_CSI_D15__IPU_CSI_D_15
240207 MX35_PAD_CSI_D15__KPP_ROW_3
241208 MX35_PAD_CSI_D15__GPIO1_27
242209 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK
243210 MX35_PAD_CSI_MCLK__GPIO1_28
244211 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC
245212 MX35_PAD_CSI_VSYNC__GPIO1_29
246213 MX35_PAD_CSI_HSYNC__IPU_CSI_HSYNC
247214 MX35_PAD_CSI_HSYNC__GPIO1_30
248215 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK
249216 MX35_PAD_CSI_PIXCLK__GPIO1_31
250217 MX35_PAD_I2C1_CLK__I2C1_SCL
251218 MX35_PAD_I2C1_CLK__GPIO2_24
252219 MX35_PAD_I2C1_CLK__CCM_USB_BYP_CLK
253220 MX35_PAD_I2C1_DAT__I2C1_SDA
254221 MX35_PAD_I2C1_DAT__GPIO2_25
255222 MX35_PAD_I2C2_CLK__I2C2_SCL
256223 MX35_PAD_I2C2_CLK__CAN1_TXCAN
257224 MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR
258225 MX35_PAD_I2C2_CLK__GPIO2_26
259226 MX35_PAD_I2C2_CLK__SDMA_DEBUG_BUS_DEVICE_2
260227 MX35_PAD_I2C2_DAT__I2C2_SDA
261228 MX35_PAD_I2C2_DAT__CAN1_RXCAN
262229 MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC
263230 MX35_PAD_I2C2_DAT__GPIO2_27
264231 MX35_PAD_I2C2_DAT__SDMA_DEBUG_BUS_DEVICE_3
265232 MX35_PAD_STXD4__AUDMUX_AUD4_TXD
266233 MX35_PAD_STXD4__GPIO2_28
267234 MX35_PAD_STXD4__ARM11P_TOP_ARM_COREASID0
268235 MX35_PAD_SRXD4__AUDMUX_AUD4_RXD
269236 MX35_PAD_SRXD4__GPIO2_29
270237 MX35_PAD_SRXD4__ARM11P_TOP_ARM_COREASID1
271238 MX35_PAD_SCK4__AUDMUX_AUD4_TXC
272239 MX35_PAD_SCK4__GPIO2_30
273240 MX35_PAD_SCK4__ARM11P_TOP_ARM_COREASID2
274241 MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS
275242 MX35_PAD_STXFS4__GPIO2_31
276243 MX35_PAD_STXFS4__ARM11P_TOP_ARM_COREASID3
277244 MX35_PAD_STXD5__AUDMUX_AUD5_TXD
278245 MX35_PAD_STXD5__SPDIF_SPDIF_OUT1
279246 MX35_PAD_STXD5__CSPI2_MOSI
280247 MX35_PAD_STXD5__GPIO1_0
281248 MX35_PAD_STXD5__ARM11P_TOP_ARM_COREASID4
282249 MX35_PAD_SRXD5__AUDMUX_AUD5_RXD
283250 MX35_PAD_SRXD5__SPDIF_SPDIF_IN1
284251 MX35_PAD_SRXD5__CSPI2_MISO
285252 MX35_PAD_SRXD5__GPIO1_1
286253 MX35_PAD_SRXD5__ARM11P_TOP_ARM_COREASID5
287254 MX35_PAD_SCK5__AUDMUX_AUD5_TXC
288255 MX35_PAD_SCK5__SPDIF_SPDIF_EXTCLK
289256 MX35_PAD_SCK5__CSPI2_SCLK
290257 MX35_PAD_SCK5__GPIO1_2
291258 MX35_PAD_SCK5__ARM11P_TOP_ARM_COREASID6
292259 MX35_PAD_STXFS5__AUDMUX_AUD5_TXFS
293260 MX35_PAD_STXFS5__CSPI2_RDY
294261 MX35_PAD_STXFS5__GPIO1_3
295262 MX35_PAD_STXFS5__ARM11P_TOP_ARM_COREASID7
296263 MX35_PAD_SCKR__ESAI_SCKR
297264 MX35_PAD_SCKR__GPIO1_4
298265 MX35_PAD_SCKR__ARM11P_TOP_EVNTBUS_10
299266 MX35_PAD_FSR__ESAI_FSR
300267 MX35_PAD_FSR__GPIO1_5
301268 MX35_PAD_FSR__ARM11P_TOP_EVNTBUS_11
302269 MX35_PAD_HCKR__ESAI_HCKR
303270 MX35_PAD_HCKR__AUDMUX_AUD5_RXFS
304271 MX35_PAD_HCKR__CSPI2_SS0
305272 MX35_PAD_HCKR__IPU_FLASH_STROBE
306273 MX35_PAD_HCKR__GPIO1_6
307274 MX35_PAD_HCKR__ARM11P_TOP_EVNTBUS_12
308275 MX35_PAD_SCKT__ESAI_SCKT
309276 MX35_PAD_SCKT__GPIO1_7
310277 MX35_PAD_SCKT__IPU_CSI_D_0
311278 MX35_PAD_SCKT__KPP_ROW_2
312279 MX35_PAD_FST__ESAI_FST
313280 MX35_PAD_FST__GPIO1_8
314281 MX35_PAD_FST__IPU_CSI_D_1
315282 MX35_PAD_FST__KPP_ROW_3
316283 MX35_PAD_HCKT__ESAI_HCKT
317284 MX35_PAD_HCKT__AUDMUX_AUD5_RXC
318285 MX35_PAD_HCKT__GPIO1_9
319286 MX35_PAD_HCKT__IPU_CSI_D_2
320287 MX35_PAD_HCKT__KPP_COL_3
321288 MX35_PAD_TX5_RX0__ESAI_TX5_RX0
322289 MX35_PAD_TX5_RX0__AUDMUX_AUD4_RXC
323290 MX35_PAD_TX5_RX0__CSPI2_SS2
324291 MX35_PAD_TX5_RX0__CAN2_TXCAN
325292 MX35_PAD_TX5_RX0__UART2_DTR
326293 MX35_PAD_TX5_RX0__GPIO1_10
327294 MX35_PAD_TX5_RX0__EMI_M3IF_CHOSEN_MASTER_0
328295 MX35_PAD_TX4_RX1__ESAI_TX4_RX1
329296 MX35_PAD_TX4_RX1__AUDMUX_AUD4_RXFS
330297 MX35_PAD_TX4_RX1__CSPI2_SS3
331298 MX35_PAD_TX4_RX1__CAN2_RXCAN
332299 MX35_PAD_TX4_RX1__UART2_DSR
333300 MX35_PAD_TX4_RX1__GPIO1_11
334301 MX35_PAD_TX4_RX1__IPU_CSI_D_3
335302 MX35_PAD_TX4_RX1__KPP_ROW_0
336303 MX35_PAD_TX3_RX2__ESAI_TX3_RX2
337304 MX35_PAD_TX3_RX2__I2C3_SCL
338305 MX35_PAD_TX3_RX2__EMI_NANDF_CE1
339306 MX35_PAD_TX3_RX2__GPIO1_12
340307 MX35_PAD_TX3_RX2__IPU_CSI_D_4
341308 MX35_PAD_TX3_RX2__KPP_ROW_1
342309 MX35_PAD_TX2_RX3__ESAI_TX2_RX3
343310 MX35_PAD_TX2_RX3__I2C3_SDA
344311 MX35_PAD_TX2_RX3__EMI_NANDF_CE2
345312 MX35_PAD_TX2_RX3__GPIO1_13
346313 MX35_PAD_TX2_RX3__IPU_CSI_D_5
347314 MX35_PAD_TX2_RX3__KPP_COL_0
348315 MX35_PAD_TX1__ESAI_TX1
349316 MX35_PAD_TX1__CCM_PMIC_RDY
350317 MX35_PAD_TX1__CSPI1_SS2
351318 MX35_PAD_TX1__EMI_NANDF_CE3
352319 MX35_PAD_TX1__UART2_RI
353320 MX35_PAD_TX1__GPIO1_14
354321 MX35_PAD_TX1__IPU_CSI_D_6
355322 MX35_PAD_TX1__KPP_COL_1
356323 MX35_PAD_TX0__ESAI_TX0
357324 MX35_PAD_TX0__SPDIF_SPDIF_EXTCLK
358325 MX35_PAD_TX0__CSPI1_SS3
359326 MX35_PAD_TX0__EMI_DTACK_B
360327 MX35_PAD_TX0__UART2_DCD
361328 MX35_PAD_TX0__GPIO1_15
362329 MX35_PAD_TX0__IPU_CSI_D_7
363330 MX35_PAD_TX0__KPP_COL_2
364331 MX35_PAD_CSPI1_MOSI__CSPI1_MOSI
365332 MX35_PAD_CSPI1_MOSI__GPIO1_16
366333 MX35_PAD_CSPI1_MOSI__ECT_CTI_TRIG_OUT1_2
367334 MX35_PAD_CSPI1_MISO__CSPI1_MISO
368335 MX35_PAD_CSPI1_MISO__GPIO1_17
369336 MX35_PAD_CSPI1_MISO__ECT_CTI_TRIG_OUT1_3
370337 MX35_PAD_CSPI1_SS0__CSPI1_SS0
371338 MX35_PAD_CSPI1_SS0__OWIRE_LINE
372339 MX35_PAD_CSPI1_SS0__CSPI2_SS3
373340 MX35_PAD_CSPI1_SS0__GPIO1_18
374341 MX35_PAD_CSPI1_SS0__ECT_CTI_TRIG_OUT1_4
375342 MX35_PAD_CSPI1_SS1__CSPI1_SS1
376343 MX35_PAD_CSPI1_SS1__PWM_PWMO
377344 MX35_PAD_CSPI1_SS1__CCM_CLK32K
378345 MX35_PAD_CSPI1_SS1__GPIO1_19
379346 MX35_PAD_CSPI1_SS1__IPU_DIAGB_29
380347 MX35_PAD_CSPI1_SS1__ECT_CTI_TRIG_OUT1_5
381348 MX35_PAD_CSPI1_SCLK__CSPI1_SCLK
382349 MX35_PAD_CSPI1_SCLK__GPIO3_4
383350 MX35_PAD_CSPI1_SCLK__IPU_DIAGB_30
384351 MX35_PAD_CSPI1_SCLK__EMI_M3IF_CHOSEN_MASTER_1
385352 MX35_PAD_CSPI1_SPI_RDY__CSPI1_RDY
386353 MX35_PAD_CSPI1_SPI_RDY__GPIO3_5
387354 MX35_PAD_CSPI1_SPI_RDY__IPU_DIAGB_31
388355 MX35_PAD_CSPI1_SPI_RDY__EMI_M3IF_CHOSEN_MASTER_2
389356 MX35_PAD_RXD1__UART1_RXD_MUX
390357 MX35_PAD_RXD1__CSPI2_MOSI
391358 MX35_PAD_RXD1__KPP_COL_4
392359 MX35_PAD_RXD1__GPIO3_6
393360 MX35_PAD_RXD1__ARM11P_TOP_EVNTBUS_16
394361 MX35_PAD_TXD1__UART1_TXD_MUX
395362 MX35_PAD_TXD1__CSPI2_MISO
396363 MX35_PAD_TXD1__KPP_COL_5
397364 MX35_PAD_TXD1__GPIO3_7
398365 MX35_PAD_TXD1__ARM11P_TOP_EVNTBUS_17
399366 MX35_PAD_RTS1__UART1_RTS
400367 MX35_PAD_RTS1__CSPI2_SCLK
401368 MX35_PAD_RTS1__I2C3_SCL
402369 MX35_PAD_RTS1__IPU_CSI_D_0
403370 MX35_PAD_RTS1__KPP_COL_6
404371 MX35_PAD_RTS1__GPIO3_8
405372 MX35_PAD_RTS1__EMI_NANDF_CE1
406373 MX35_PAD_RTS1__ARM11P_TOP_EVNTBUS_18
407374 MX35_PAD_CTS1__UART1_CTS
408375 MX35_PAD_CTS1__CSPI2_RDY
409376 MX35_PAD_CTS1__I2C3_SDA
410377 MX35_PAD_CTS1__IPU_CSI_D_1
411378 MX35_PAD_CTS1__KPP_COL_7
412379 MX35_PAD_CTS1__GPIO3_9
413380 MX35_PAD_CTS1__EMI_NANDF_CE2
414381 MX35_PAD_CTS1__ARM11P_TOP_EVNTBUS_19
415382 MX35_PAD_RXD2__UART2_RXD_MUX
416383 MX35_PAD_RXD2__KPP_ROW_4
417384 MX35_PAD_RXD2__GPIO3_10
418385 MX35_PAD_TXD2__UART2_TXD_MUX
419386 MX35_PAD_TXD2__SPDIF_SPDIF_EXTCLK
420387 MX35_PAD_TXD2__KPP_ROW_5
421388 MX35_PAD_TXD2__GPIO3_11
422389 MX35_PAD_RTS2__UART2_RTS
423390 MX35_PAD_RTS2__SPDIF_SPDIF_IN1
424391 MX35_PAD_RTS2__CAN2_RXCAN
425392 MX35_PAD_RTS2__IPU_CSI_D_2
426393 MX35_PAD_RTS2__KPP_ROW_6
427394 MX35_PAD_RTS2__GPIO3_12
428395 MX35_PAD_RTS2__AUDMUX_AUD5_RXC
429396 MX35_PAD_RTS2__UART3_RXD_MUX
430397 MX35_PAD_CTS2__UART2_CTS
431398 MX35_PAD_CTS2__SPDIF_SPDIF_OUT1
432399 MX35_PAD_CTS2__CAN2_TXCAN
433400 MX35_PAD_CTS2__IPU_CSI_D_3
434401 MX35_PAD_CTS2__KPP_ROW_7
435402 MX35_PAD_CTS2__GPIO3_13
436403 MX35_PAD_CTS2__AUDMUX_AUD5_RXFS
437404 MX35_PAD_CTS2__UART3_TXD_MUX
438405 MX35_PAD_RTCK__ARM11P_TOP_RTCK
439406 MX35_PAD_TCK__SJC_TCK
440407 MX35_PAD_TMS__SJC_TMS
441408 MX35_PAD_TDI__SJC_TDI
442409 MX35_PAD_TDO__SJC_TDO
443410 MX35_PAD_TRSTB__SJC_TRSTB
444411 MX35_PAD_DE_B__SJC_DE_B
445412 MX35_PAD_SJC_MOD__SJC_MOD
446413 MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR
447414 MX35_PAD_USBOTG_PWR__USB_TOP_USBH2_PWR
448415 MX35_PAD_USBOTG_PWR__GPIO3_14
449416 MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC
450417 MX35_PAD_USBOTG_OC__USB_TOP_USBH2_OC
451418 MX35_PAD_USBOTG_OC__GPIO3_15
452419 MX35_PAD_LD0__IPU_DISPB_DAT_0
453420 MX35_PAD_LD0__GPIO2_0
454421 MX35_PAD_LD0__SDMA_SDMA_DEBUG_PC_0
455422 MX35_PAD_LD1__IPU_DISPB_DAT_1
456423 MX35_PAD_LD1__GPIO2_1
457424 MX35_PAD_LD1__SDMA_SDMA_DEBUG_PC_1
458425 MX35_PAD_LD2__IPU_DISPB_DAT_2
459426 MX35_PAD_LD2__GPIO2_2
460427 MX35_PAD_LD2__SDMA_SDMA_DEBUG_PC_2
461428 MX35_PAD_LD3__IPU_DISPB_DAT_3
462429 MX35_PAD_LD3__GPIO2_3
463430 MX35_PAD_LD3__SDMA_SDMA_DEBUG_PC_3
464431 MX35_PAD_LD4__IPU_DISPB_DAT_4
465432 MX35_PAD_LD4__GPIO2_4
466433 MX35_PAD_LD4__SDMA_SDMA_DEBUG_PC_4
467434 MX35_PAD_LD5__IPU_DISPB_DAT_5
468435 MX35_PAD_LD5__GPIO2_5
469436 MX35_PAD_LD5__SDMA_SDMA_DEBUG_PC_5
470437 MX35_PAD_LD6__IPU_DISPB_DAT_6
471438 MX35_PAD_LD6__GPIO2_6
472439 MX35_PAD_LD6__SDMA_SDMA_DEBUG_PC_6
473440 MX35_PAD_LD7__IPU_DISPB_DAT_7
474441 MX35_PAD_LD7__GPIO2_7
475442 MX35_PAD_LD7__SDMA_SDMA_DEBUG_PC_7
476443 MX35_PAD_LD8__IPU_DISPB_DAT_8
477444 MX35_PAD_LD8__GPIO2_8
478445 MX35_PAD_LD8__SDMA_SDMA_DEBUG_PC_8
479446 MX35_PAD_LD9__IPU_DISPB_DAT_9
480447 MX35_PAD_LD9__GPIO2_9
481448 MX35_PAD_LD9__SDMA_SDMA_DEBUG_PC_9
482449 MX35_PAD_LD10__IPU_DISPB_DAT_10
483450 MX35_PAD_LD10__GPIO2_10
484451 MX35_PAD_LD10__SDMA_SDMA_DEBUG_PC_10
485452 MX35_PAD_LD11__IPU_DISPB_DAT_11
486453 MX35_PAD_LD11__GPIO2_11
487454 MX35_PAD_LD11__SDMA_SDMA_DEBUG_PC_11
488455 MX35_PAD_LD11__ARM11P_TOP_TRACE_4
489456 MX35_PAD_LD12__IPU_DISPB_DAT_12
490457 MX35_PAD_LD12__GPIO2_12
491458 MX35_PAD_LD12__SDMA_SDMA_DEBUG_PC_12
492459 MX35_PAD_LD12__ARM11P_TOP_TRACE_5
493460 MX35_PAD_LD13__IPU_DISPB_DAT_13
494461 MX35_PAD_LD13__GPIO2_13
495462 MX35_PAD_LD13__SDMA_SDMA_DEBUG_PC_13
496463 MX35_PAD_LD13__ARM11P_TOP_TRACE_6
497464 MX35_PAD_LD14__IPU_DISPB_DAT_14
498465 MX35_PAD_LD14__GPIO2_14
499466 MX35_PAD_LD14__SDMA_SDMA_DEBUG_EVENT_CHANNEL_0
500467 MX35_PAD_LD14__ARM11P_TOP_TRACE_7
501468 MX35_PAD_LD15__IPU_DISPB_DAT_15
502469 MX35_PAD_LD15__GPIO2_15
503470 MX35_PAD_LD15__SDMA_SDMA_DEBUG_EVENT_CHANNEL_1
504471 MX35_PAD_LD15__ARM11P_TOP_TRACE_8
505472 MX35_PAD_LD16__IPU_DISPB_DAT_16
506473 MX35_PAD_LD16__IPU_DISPB_D12_VSYNC
507474 MX35_PAD_LD16__GPIO2_16
508475 MX35_PAD_LD16__SDMA_SDMA_DEBUG_EVENT_CHANNEL_2
509476 MX35_PAD_LD16__ARM11P_TOP_TRACE_9
510477 MX35_PAD_LD17__IPU_DISPB_DAT_17
511478 MX35_PAD_LD17__IPU_DISPB_CS2
512479 MX35_PAD_LD17__GPIO2_17
513480 MX35_PAD_LD17__SDMA_SDMA_DEBUG_EVENT_CHANNEL_3
514481 MX35_PAD_LD17__ARM11P_TOP_TRACE_10
515482 MX35_PAD_LD18__IPU_DISPB_DAT_18
516483 MX35_PAD_LD18__IPU_DISPB_D0_VSYNC
517484 MX35_PAD_LD18__IPU_DISPB_D12_VSYNC
518485 MX35_PAD_LD18__ESDHC3_CMD
519486 MX35_PAD_LD18__USB_TOP_USBOTG_DATA_3
520487 MX35_PAD_LD18__GPIO3_24
521488 MX35_PAD_LD18__SDMA_SDMA_DEBUG_EVENT_CHANNEL_4
522489 MX35_PAD_LD18__ARM11P_TOP_TRACE_11
523490 MX35_PAD_LD19__IPU_DISPB_DAT_19
524491 MX35_PAD_LD19__IPU_DISPB_BCLK
525492 MX35_PAD_LD19__IPU_DISPB_CS1
526493 MX35_PAD_LD19__ESDHC3_CLK
527494 MX35_PAD_LD19__USB_TOP_USBOTG_DIR
528495 MX35_PAD_LD19__GPIO3_25
529496 MX35_PAD_LD19__SDMA_SDMA_DEBUG_EVENT_CHANNEL_5
530497 MX35_PAD_LD19__ARM11P_TOP_TRACE_12
531498 MX35_PAD_LD20__IPU_DISPB_DAT_20
532499 MX35_PAD_LD20__IPU_DISPB_CS0
533500 MX35_PAD_LD20__IPU_DISPB_SD_CLK
534501 MX35_PAD_LD20__ESDHC3_DAT0
535502 MX35_PAD_LD20__GPIO3_26
536503 MX35_PAD_LD20__SDMA_SDMA_DEBUG_CORE_STATUS_3
537504 MX35_PAD_LD20__ARM11P_TOP_TRACE_13
538505 MX35_PAD_LD21__IPU_DISPB_DAT_21
539506 MX35_PAD_LD21__IPU_DISPB_PAR_RS
540507 MX35_PAD_LD21__IPU_DISPB_SER_RS
541508 MX35_PAD_LD21__ESDHC3_DAT1
542509 MX35_PAD_LD21__USB_TOP_USBOTG_STP
543510 MX35_PAD_LD21__GPIO3_27
544511 MX35_PAD_LD21__SDMA_DEBUG_EVENT_CHANNEL_SEL
545512 MX35_PAD_LD21__ARM11P_TOP_TRACE_14
546513 MX35_PAD_LD22__IPU_DISPB_DAT_22
547514 MX35_PAD_LD22__IPU_DISPB_WR
548515 MX35_PAD_LD22__IPU_DISPB_SD_D_I
549516 MX35_PAD_LD22__ESDHC3_DAT2
550517 MX35_PAD_LD22__USB_TOP_USBOTG_NXT
551518 MX35_PAD_LD22__GPIO3_28
552519 MX35_PAD_LD22__SDMA_DEBUG_BUS_ERROR
553520 MX35_PAD_LD22__ARM11P_TOP_TRCTL
554521 MX35_PAD_LD23__IPU_DISPB_DAT_23
555522 MX35_PAD_LD23__IPU_DISPB_RD
556523 MX35_PAD_LD23__IPU_DISPB_SD_D_IO
557524 MX35_PAD_LD23__ESDHC3_DAT3
558525 MX35_PAD_LD23__USB_TOP_USBOTG_DATA_7
559526 MX35_PAD_LD23__GPIO3_29
560527 MX35_PAD_LD23__SDMA_DEBUG_MATCHED_DMBUS
561528 MX35_PAD_LD23__ARM11P_TOP_TRCLK
562529 MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC
563530 MX35_PAD_D3_HSYNC__IPU_DISPB_SD_D_IO
564531 MX35_PAD_D3_HSYNC__GPIO3_30
565532 MX35_PAD_D3_HSYNC__SDMA_DEBUG_RTBUFFER_WRITE
566533 MX35_PAD_D3_HSYNC__ARM11P_TOP_TRACE_15
567534 MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK
568535 MX35_PAD_D3_FPSHIFT__IPU_DISPB_SD_CLK
569536 MX35_PAD_D3_FPSHIFT__GPIO3_31
570537 MX35_PAD_D3_FPSHIFT__SDMA_SDMA_DEBUG_CORE_STATUS_0
571538 MX35_PAD_D3_FPSHIFT__ARM11P_TOP_TRACE_16
572539 MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY
573540 MX35_PAD_D3_DRDY__IPU_DISPB_SD_D_O
574541 MX35_PAD_D3_DRDY__GPIO1_0
575542 MX35_PAD_D3_DRDY__SDMA_SDMA_DEBUG_CORE_STATUS_1
576543 MX35_PAD_D3_DRDY__ARM11P_TOP_TRACE_17
577544 MX35_PAD_CONTRAST__IPU_DISPB_CONTR
578545 MX35_PAD_CONTRAST__GPIO1_1
579546 MX35_PAD_CONTRAST__SDMA_SDMA_DEBUG_CORE_STATUS_2
580547 MX35_PAD_CONTRAST__ARM11P_TOP_TRACE_18
581548 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC
582549 MX35_PAD_D3_VSYNC__IPU_DISPB_CS1
583550 MX35_PAD_D3_VSYNC__GPIO1_2
584551 MX35_PAD_D3_VSYNC__SDMA_DEBUG_YIELD
585552 MX35_PAD_D3_VSYNC__ARM11P_TOP_TRACE_19
586553 MX35_PAD_D3_REV__IPU_DISPB_D3_REV
587554 MX35_PAD_D3_REV__IPU_DISPB_SER_RS
588555 MX35_PAD_D3_REV__GPIO1_3
589556 MX35_PAD_D3_REV__SDMA_DEBUG_BUS_RWB
590557 MX35_PAD_D3_REV__ARM11P_TOP_TRACE_20
591558 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS
592559 MX35_PAD_D3_CLS__IPU_DISPB_CS2
593560 MX35_PAD_D3_CLS__GPIO1_4
594561 MX35_PAD_D3_CLS__SDMA_DEBUG_BUS_DEVICE_0
595562 MX35_PAD_D3_CLS__ARM11P_TOP_TRACE_21
596563 MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL
597564 MX35_PAD_D3_SPL__IPU_DISPB_D12_VSYNC
598565 MX35_PAD_D3_SPL__GPIO1_5
599566 MX35_PAD_D3_SPL__SDMA_DEBUG_BUS_DEVICE_1
600567 MX35_PAD_D3_SPL__ARM11P_TOP_TRACE_22
601568 MX35_PAD_SD1_CMD__ESDHC1_CMD
602569 MX35_PAD_SD1_CMD__MSHC_SCLK
603570 MX35_PAD_SD1_CMD__IPU_DISPB_D0_VSYNC
604571 MX35_PAD_SD1_CMD__USB_TOP_USBOTG_DATA_4
605572 MX35_PAD_SD1_CMD__GPIO1_6
606573 MX35_PAD_SD1_CMD__ARM11P_TOP_TRCTL
607574 MX35_PAD_SD1_CLK__ESDHC1_CLK
608575 MX35_PAD_SD1_CLK__MSHC_BS
609576 MX35_PAD_SD1_CLK__IPU_DISPB_BCLK
610577 MX35_PAD_SD1_CLK__USB_TOP_USBOTG_DATA_5
611578 MX35_PAD_SD1_CLK__GPIO1_7
612579 MX35_PAD_SD1_CLK__ARM11P_TOP_TRCLK
613580 MX35_PAD_SD1_DATA0__ESDHC1_DAT0
614581 MX35_PAD_SD1_DATA0__MSHC_DATA_0
615582 MX35_PAD_SD1_DATA0__IPU_DISPB_CS0
616583 MX35_PAD_SD1_DATA0__USB_TOP_USBOTG_DATA_6
617584 MX35_PAD_SD1_DATA0__GPIO1_8
618585 MX35_PAD_SD1_DATA0__ARM11P_TOP_TRACE_23
619586 MX35_PAD_SD1_DATA1__ESDHC1_DAT1
620587 MX35_PAD_SD1_DATA1__MSHC_DATA_1
621588 MX35_PAD_SD1_DATA1__IPU_DISPB_PAR_RS
622589 MX35_PAD_SD1_DATA1__USB_TOP_USBOTG_DATA_0
623590 MX35_PAD_SD1_DATA1__GPIO1_9
624591 MX35_PAD_SD1_DATA1__ARM11P_TOP_TRACE_24
625592 MX35_PAD_SD1_DATA2__ESDHC1_DAT2
626593 MX35_PAD_SD1_DATA2__MSHC_DATA_2
627594 MX35_PAD_SD1_DATA2__IPU_DISPB_WR
628595 MX35_PAD_SD1_DATA2__USB_TOP_USBOTG_DATA_1
629596 MX35_PAD_SD1_DATA2__GPIO1_10
630597 MX35_PAD_SD1_DATA2__ARM11P_TOP_TRACE_25
631598 MX35_PAD_SD1_DATA3__ESDHC1_DAT3
632599 MX35_PAD_SD1_DATA3__MSHC_DATA_3
633600 MX35_PAD_SD1_DATA3__IPU_DISPB_RD
634601 MX35_PAD_SD1_DATA3__USB_TOP_USBOTG_DATA_2
635602 MX35_PAD_SD1_DATA3__GPIO1_11
636603 MX35_PAD_SD1_DATA3__ARM11P_TOP_TRACE_26
637604 MX35_PAD_SD2_CMD__ESDHC2_CMD
638605 MX35_PAD_SD2_CMD__I2C3_SCL
639606 MX35_PAD_SD2_CMD__ESDHC1_DAT4
640607 MX35_PAD_SD2_CMD__IPU_CSI_D_2
641608 MX35_PAD_SD2_CMD__USB_TOP_USBH2_DATA_4
642609 MX35_PAD_SD2_CMD__GPIO2_0
643610 MX35_PAD_SD2_CMD__SPDIF_SPDIF_OUT1
644611 MX35_PAD_SD2_CMD__IPU_DISPB_D12_VSYNC
645612 MX35_PAD_SD2_CLK__ESDHC2_CLK
646613 MX35_PAD_SD2_CLK__I2C3_SDA
647614 MX35_PAD_SD2_CLK__ESDHC1_DAT5
648615 MX35_PAD_SD2_CLK__IPU_CSI_D_3
649616 MX35_PAD_SD2_CLK__USB_TOP_USBH2_DATA_5
650617 MX35_PAD_SD2_CLK__GPIO2_1
651618 MX35_PAD_SD2_CLK__SPDIF_SPDIF_IN1
652619 MX35_PAD_SD2_CLK__IPU_DISPB_CS2
653620 MX35_PAD_SD2_DATA0__ESDHC2_DAT0
654621 MX35_PAD_SD2_DATA0__UART3_RXD_MUX
655622 MX35_PAD_SD2_DATA0__ESDHC1_DAT6
656623 MX35_PAD_SD2_DATA0__IPU_CSI_D_4
657624 MX35_PAD_SD2_DATA0__USB_TOP_USBH2_DATA_6
658625 MX35_PAD_SD2_DATA0__GPIO2_2
659626 MX35_PAD_SD2_DATA0__SPDIF_SPDIF_EXTCLK
660627 MX35_PAD_SD2_DATA1__ESDHC2_DAT1
661628 MX35_PAD_SD2_DATA1__UART3_TXD_MUX
662629 MX35_PAD_SD2_DATA1__ESDHC1_DAT7
663630 MX35_PAD_SD2_DATA1__IPU_CSI_D_5
664631 MX35_PAD_SD2_DATA1__USB_TOP_USBH2_DATA_0
665632 MX35_PAD_SD2_DATA1__GPIO2_3
666633 MX35_PAD_SD2_DATA2__ESDHC2_DAT2
667634 MX35_PAD_SD2_DATA2__UART3_RTS
668635 MX35_PAD_SD2_DATA2__CAN1_RXCAN
669636 MX35_PAD_SD2_DATA2__IPU_CSI_D_6
670637 MX35_PAD_SD2_DATA2__USB_TOP_USBH2_DATA_1
671638 MX35_PAD_SD2_DATA2__GPIO2_4
672639 MX35_PAD_SD2_DATA3__ESDHC2_DAT3
673640 MX35_PAD_SD2_DATA3__UART3_CTS
674641 MX35_PAD_SD2_DATA3__CAN1_TXCAN
675642 MX35_PAD_SD2_DATA3__IPU_CSI_D_7
676643 MX35_PAD_SD2_DATA3__USB_TOP_USBH2_DATA_2
677644 MX35_PAD_SD2_DATA3__GPIO2_5
678645 MX35_PAD_ATA_CS0__ATA_CS0
679646 MX35_PAD_ATA_CS0__CSPI1_SS3
680647 MX35_PAD_ATA_CS0__IPU_DISPB_CS1
681648 MX35_PAD_ATA_CS0__GPIO2_6
682649 MX35_PAD_ATA_CS0__IPU_DIAGB_0
683650 MX35_PAD_ATA_CS0__ARM11P_TOP_MAX1_HMASTER_0
684651 MX35_PAD_ATA_CS1__ATA_CS1
685652 MX35_PAD_ATA_CS1__IPU_DISPB_CS2
686653 MX35_PAD_ATA_CS1__CSPI2_SS0
687654 MX35_PAD_ATA_CS1__GPIO2_7
688655 MX35_PAD_ATA_CS1__IPU_DIAGB_1
689656 MX35_PAD_ATA_CS1__ARM11P_TOP_MAX1_HMASTER_1
690657 MX35_PAD_ATA_DIOR__ATA_DIOR
691658 MX35_PAD_ATA_DIOR__ESDHC3_DAT0
692659 MX35_PAD_ATA_DIOR__USB_TOP_USBOTG_DIR
693660 MX35_PAD_ATA_DIOR__IPU_DISPB_BE0
694661 MX35_PAD_ATA_DIOR__CSPI2_SS1
695662 MX35_PAD_ATA_DIOR__GPIO2_8
696663 MX35_PAD_ATA_DIOR__IPU_DIAGB_2
697664 MX35_PAD_ATA_DIOR__ARM11P_TOP_MAX1_HMASTER_2
698665 MX35_PAD_ATA_DIOW__ATA_DIOW
699666 MX35_PAD_ATA_DIOW__ESDHC3_DAT1
700667 MX35_PAD_ATA_DIOW__USB_TOP_USBOTG_STP
701668 MX35_PAD_ATA_DIOW__IPU_DISPB_BE1
702669 MX35_PAD_ATA_DIOW__CSPI2_MOSI
703670 MX35_PAD_ATA_DIOW__GPIO2_9
704671 MX35_PAD_ATA_DIOW__IPU_DIAGB_3
705672 MX35_PAD_ATA_DIOW__ARM11P_TOP_MAX1_HMASTER_3
706673 MX35_PAD_ATA_DMACK__ATA_DMACK
707674 MX35_PAD_ATA_DMACK__ESDHC3_DAT2
708675 MX35_PAD_ATA_DMACK__USB_TOP_USBOTG_NXT
709676 MX35_PAD_ATA_DMACK__CSPI2_MISO
710677 MX35_PAD_ATA_DMACK__GPIO2_10
711678 MX35_PAD_ATA_DMACK__IPU_DIAGB_4
712679 MX35_PAD_ATA_DMACK__ARM11P_TOP_MAX0_HMASTER_0
713680 MX35_PAD_ATA_RESET_B__ATA_RESET_B
714681 MX35_PAD_ATA_RESET_B__ESDHC3_DAT3
715682 MX35_PAD_ATA_RESET_B__USB_TOP_USBOTG_DATA_0
716683 MX35_PAD_ATA_RESET_B__IPU_DISPB_SD_D_O
717684 MX35_PAD_ATA_RESET_B__CSPI2_RDY
718685 MX35_PAD_ATA_RESET_B__GPIO2_11
719686 MX35_PAD_ATA_RESET_B__IPU_DIAGB_5
720687 MX35_PAD_ATA_RESET_B__ARM11P_TOP_MAX0_HMASTER_1
721688 MX35_PAD_ATA_IORDY__ATA_IORDY
722689 MX35_PAD_ATA_IORDY__ESDHC3_DAT4
723690 MX35_PAD_ATA_IORDY__USB_TOP_USBOTG_DATA_1
724691 MX35_PAD_ATA_IORDY__IPU_DISPB_SD_D_IO
725692 MX35_PAD_ATA_IORDY__ESDHC2_DAT4
726693 MX35_PAD_ATA_IORDY__GPIO2_12
727694 MX35_PAD_ATA_IORDY__IPU_DIAGB_6
728695 MX35_PAD_ATA_IORDY__ARM11P_TOP_MAX0_HMASTER_2
729696 MX35_PAD_ATA_DATA0__ATA_DATA_0
730697 MX35_PAD_ATA_DATA0__ESDHC3_DAT5
731698 MX35_PAD_ATA_DATA0__USB_TOP_USBOTG_DATA_2
732699 MX35_PAD_ATA_DATA0__IPU_DISPB_D12_VSYNC
733700 MX35_PAD_ATA_DATA0__ESDHC2_DAT5
734701 MX35_PAD_ATA_DATA0__GPIO2_13
735702 MX35_PAD_ATA_DATA0__IPU_DIAGB_7
736703 MX35_PAD_ATA_DATA0__ARM11P_TOP_MAX0_HMASTER_3
737704 MX35_PAD_ATA_DATA1__ATA_DATA_1
738705 MX35_PAD_ATA_DATA1__ESDHC3_DAT6
739706 MX35_PAD_ATA_DATA1__USB_TOP_USBOTG_DATA_3
740707 MX35_PAD_ATA_DATA1__IPU_DISPB_SD_CLK
741708 MX35_PAD_ATA_DATA1__ESDHC2_DAT6
742709 MX35_PAD_ATA_DATA1__GPIO2_14
743710 MX35_PAD_ATA_DATA1__IPU_DIAGB_8
744711 MX35_PAD_ATA_DATA1__ARM11P_TOP_TRACE_27
745712 MX35_PAD_ATA_DATA2__ATA_DATA_2
746713 MX35_PAD_ATA_DATA2__ESDHC3_DAT7
747714 MX35_PAD_ATA_DATA2__USB_TOP_USBOTG_DATA_4
748715 MX35_PAD_ATA_DATA2__IPU_DISPB_SER_RS
749716 MX35_PAD_ATA_DATA2__ESDHC2_DAT7
750717 MX35_PAD_ATA_DATA2__GPIO2_15
751718 MX35_PAD_ATA_DATA2__IPU_DIAGB_9
752719 MX35_PAD_ATA_DATA2__ARM11P_TOP_TRACE_28
753720 MX35_PAD_ATA_DATA3__ATA_DATA_3
754721 MX35_PAD_ATA_DATA3__ESDHC3_CLK
755722 MX35_PAD_ATA_DATA3__USB_TOP_USBOTG_DATA_5
756723 MX35_PAD_ATA_DATA3__CSPI2_SCLK
757724 MX35_PAD_ATA_DATA3__GPIO2_16
758725 MX35_PAD_ATA_DATA3__IPU_DIAGB_10
759726 MX35_PAD_ATA_DATA3__ARM11P_TOP_TRACE_29
760727 MX35_PAD_ATA_DATA4__ATA_DATA_4
761728 MX35_PAD_ATA_DATA4__ESDHC3_CMD
762729 MX35_PAD_ATA_DATA4__USB_TOP_USBOTG_DATA_6
763730 MX35_PAD_ATA_DATA4__GPIO2_17
764731 MX35_PAD_ATA_DATA4__IPU_DIAGB_11
765732 MX35_PAD_ATA_DATA4__ARM11P_TOP_TRACE_30
766733 MX35_PAD_ATA_DATA5__ATA_DATA_5
767734 MX35_PAD_ATA_DATA5__USB_TOP_USBOTG_DATA_7
768735 MX35_PAD_ATA_DATA5__GPIO2_18
769736 MX35_PAD_ATA_DATA5__IPU_DIAGB_12
770737 MX35_PAD_ATA_DATA5__ARM11P_TOP_TRACE_31
771738 MX35_PAD_ATA_DATA6__ATA_DATA_6
772739 MX35_PAD_ATA_DATA6__CAN1_TXCAN
773740 MX35_PAD_ATA_DATA6__UART1_DTR
774741 MX35_PAD_ATA_DATA6__AUDMUX_AUD6_TXD
775742 MX35_PAD_ATA_DATA6__GPIO2_19
776743 MX35_PAD_ATA_DATA6__IPU_DIAGB_13
777744 MX35_PAD_ATA_DATA7__ATA_DATA_7
778745 MX35_PAD_ATA_DATA7__CAN1_RXCAN
779746 MX35_PAD_ATA_DATA7__UART1_DSR
780747 MX35_PAD_ATA_DATA7__AUDMUX_AUD6_RXD
781748 MX35_PAD_ATA_DATA7__GPIO2_20
782749 MX35_PAD_ATA_DATA7__IPU_DIAGB_14
783750 MX35_PAD_ATA_DATA8__ATA_DATA_8
784751 MX35_PAD_ATA_DATA8__UART3_RTS
785752 MX35_PAD_ATA_DATA8__UART1_RI
786753 MX35_PAD_ATA_DATA8__AUDMUX_AUD6_TXC
787754 MX35_PAD_ATA_DATA8__GPIO2_21
788755 MX35_PAD_ATA_DATA8__IPU_DIAGB_15
789756 MX35_PAD_ATA_DATA9__ATA_DATA_9
790757 MX35_PAD_ATA_DATA9__UART3_CTS
791758 MX35_PAD_ATA_DATA9__UART1_DCD
792759 MX35_PAD_ATA_DATA9__AUDMUX_AUD6_TXFS
793760 MX35_PAD_ATA_DATA9__GPIO2_22
794761 MX35_PAD_ATA_DATA9__IPU_DIAGB_16
795762 MX35_PAD_ATA_DATA10__ATA_DATA_10
796763 MX35_PAD_ATA_DATA10__UART3_RXD_MUX
797764 MX35_PAD_ATA_DATA10__AUDMUX_AUD6_RXC
798765 MX35_PAD_ATA_DATA10__GPIO2_23
799766 MX35_PAD_ATA_DATA10__IPU_DIAGB_17
800767 MX35_PAD_ATA_DATA11__ATA_DATA_11
801768 MX35_PAD_ATA_DATA11__UART3_TXD_MUX
802769 MX35_PAD_ATA_DATA11__AUDMUX_AUD6_RXFS
803770 MX35_PAD_ATA_DATA11__GPIO2_24
804771 MX35_PAD_ATA_DATA11__IPU_DIAGB_18
805772 MX35_PAD_ATA_DATA12__ATA_DATA_12
806773 MX35_PAD_ATA_DATA12__I2C3_SCL
807774 MX35_PAD_ATA_DATA12__GPIO2_25
808775 MX35_PAD_ATA_DATA12__IPU_DIAGB_19
809776 MX35_PAD_ATA_DATA13__ATA_DATA_13
810777 MX35_PAD_ATA_DATA13__I2C3_SDA
811778 MX35_PAD_ATA_DATA13__GPIO2_26
812779 MX35_PAD_ATA_DATA13__IPU_DIAGB_20
813780 MX35_PAD_ATA_DATA14__ATA_DATA_14
814781 MX35_PAD_ATA_DATA14__IPU_CSI_D_0
815782 MX35_PAD_ATA_DATA14__KPP_ROW_0
816783 MX35_PAD_ATA_DATA14__GPIO2_27
817784 MX35_PAD_ATA_DATA14__IPU_DIAGB_21
818785 MX35_PAD_ATA_DATA15__ATA_DATA_15
819786 MX35_PAD_ATA_DATA15__IPU_CSI_D_1
820787 MX35_PAD_ATA_DATA15__KPP_ROW_1
821788 MX35_PAD_ATA_DATA15__GPIO2_28
822789 MX35_PAD_ATA_DATA15__IPU_DIAGB_22
823790 MX35_PAD_ATA_INTRQ__ATA_INTRQ
824791 MX35_PAD_ATA_INTRQ__IPU_CSI_D_2
825792 MX35_PAD_ATA_INTRQ__KPP_ROW_2
826793 MX35_PAD_ATA_INTRQ__GPIO2_29
827794 MX35_PAD_ATA_INTRQ__IPU_DIAGB_23
828795 MX35_PAD_ATA_BUFF_EN__ATA_BUFFER_EN
829796 MX35_PAD_ATA_BUFF_EN__IPU_CSI_D_3
830797 MX35_PAD_ATA_BUFF_EN__KPP_ROW_3
831798 MX35_PAD_ATA_BUFF_EN__GPIO2_30
832799 MX35_PAD_ATA_BUFF_EN__IPU_DIAGB_24
833800 MX35_PAD_ATA_DMARQ__ATA_DMARQ
834801 MX35_PAD_ATA_DMARQ__IPU_CSI_D_4
835802 MX35_PAD_ATA_DMARQ__KPP_COL_0
836803 MX35_PAD_ATA_DMARQ__GPIO2_31
837804 MX35_PAD_ATA_DMARQ__IPU_DIAGB_25
838805 MX35_PAD_ATA_DMARQ__ECT_CTI_TRIG_IN1_4
839806 MX35_PAD_ATA_DA0__ATA_DA_0
840807 MX35_PAD_ATA_DA0__IPU_CSI_D_5
841808 MX35_PAD_ATA_DA0__KPP_COL_1
842809 MX35_PAD_ATA_DA0__GPIO3_0
843810 MX35_PAD_ATA_DA0__IPU_DIAGB_26
844811 MX35_PAD_ATA_DA0__ECT_CTI_TRIG_IN1_5
845812 MX35_PAD_ATA_DA1__ATA_DA_1
846813 MX35_PAD_ATA_DA1__IPU_CSI_D_6
847814 MX35_PAD_ATA_DA1__KPP_COL_2
848815 MX35_PAD_ATA_DA1__GPIO3_1
849816 MX35_PAD_ATA_DA1__IPU_DIAGB_27
850817 MX35_PAD_ATA_DA1__ECT_CTI_TRIG_IN1_6
851818 MX35_PAD_ATA_DA2__ATA_DA_2
852819 MX35_PAD_ATA_DA2__IPU_CSI_D_7
853820 MX35_PAD_ATA_DA2__KPP_COL_3
854821 MX35_PAD_ATA_DA2__GPIO3_2
855822 MX35_PAD_ATA_DA2__IPU_DIAGB_28
856823 MX35_PAD_ATA_DA2__ECT_CTI_TRIG_IN1_7
857824 MX35_PAD_MLB_CLK__MLB_MLBCLK
858825 MX35_PAD_MLB_CLK__GPIO3_3
859826 MX35_PAD_MLB_DAT__MLB_MLBDAT
860827 MX35_PAD_MLB_DAT__GPIO3_4
861828 MX35_PAD_MLB_SIG__MLB_MLBSIG
862829 MX35_PAD_MLB_SIG__GPIO3_5
863830 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK
864831 MX35_PAD_FEC_TX_CLK__ESDHC1_DAT4
865832 MX35_PAD_FEC_TX_CLK__UART3_RXD_MUX
866833 MX35_PAD_FEC_TX_CLK__USB_TOP_USBH2_DIR
867834 MX35_PAD_FEC_TX_CLK__CSPI2_MOSI
868835 MX35_PAD_FEC_TX_CLK__GPIO3_6
869836 MX35_PAD_FEC_TX_CLK__IPU_DISPB_D12_VSYNC
870837 MX35_PAD_FEC_TX_CLK__ARM11P_TOP_EVNTBUS_0
871838 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK
872839 MX35_PAD_FEC_RX_CLK__ESDHC1_DAT5
873840 MX35_PAD_FEC_RX_CLK__UART3_TXD_MUX
874841 MX35_PAD_FEC_RX_CLK__USB_TOP_USBH2_STP
875842 MX35_PAD_FEC_RX_CLK__CSPI2_MISO
876843 MX35_PAD_FEC_RX_CLK__GPIO3_7
877844 MX35_PAD_FEC_RX_CLK__IPU_DISPB_SD_D_I
878845 MX35_PAD_FEC_RX_CLK__ARM11P_TOP_EVNTBUS_1
879846 MX35_PAD_FEC_RX_DV__FEC_RX_DV
880847 MX35_PAD_FEC_RX_DV__ESDHC1_DAT6
881848 MX35_PAD_FEC_RX_DV__UART3_RTS
882849 MX35_PAD_FEC_RX_DV__USB_TOP_USBH2_NXT
883850 MX35_PAD_FEC_RX_DV__CSPI2_SCLK
884851 MX35_PAD_FEC_RX_DV__GPIO3_8
885852 MX35_PAD_FEC_RX_DV__IPU_DISPB_SD_CLK
886853 MX35_PAD_FEC_RX_DV__ARM11P_TOP_EVNTBUS_2
887854 MX35_PAD_FEC_COL__FEC_COL
888855 MX35_PAD_FEC_COL__ESDHC1_DAT7
889856 MX35_PAD_FEC_COL__UART3_CTS
890857 MX35_PAD_FEC_COL__USB_TOP_USBH2_DATA_0
891858 MX35_PAD_FEC_COL__CSPI2_RDY
892859 MX35_PAD_FEC_COL__GPIO3_9
893860 MX35_PAD_FEC_COL__IPU_DISPB_SER_RS
894861 MX35_PAD_FEC_COL__ARM11P_TOP_EVNTBUS_3
895862 MX35_PAD_FEC_RDATA0__FEC_RDATA_0
896863 MX35_PAD_FEC_RDATA0__PWM_PWMO
897864 MX35_PAD_FEC_RDATA0__UART3_DTR
898865 MX35_PAD_FEC_RDATA0__USB_TOP_USBH2_DATA_1
899866 MX35_PAD_FEC_RDATA0__CSPI2_SS0
900867 MX35_PAD_FEC_RDATA0__GPIO3_10
901868 MX35_PAD_FEC_RDATA0__IPU_DISPB_CS1
902869 MX35_PAD_FEC_RDATA0__ARM11P_TOP_EVNTBUS_4
903870 MX35_PAD_FEC_TDATA0__FEC_TDATA_0
904871 MX35_PAD_FEC_TDATA0__SPDIF_SPDIF_OUT1
905872 MX35_PAD_FEC_TDATA0__UART3_DSR
906873 MX35_PAD_FEC_TDATA0__USB_TOP_USBH2_DATA_2
907874 MX35_PAD_FEC_TDATA0__CSPI2_SS1
908875 MX35_PAD_FEC_TDATA0__GPIO3_11
909876 MX35_PAD_FEC_TDATA0__IPU_DISPB_CS0
910877 MX35_PAD_FEC_TDATA0__ARM11P_TOP_EVNTBUS_5
911878 MX35_PAD_FEC_TX_EN__FEC_TX_EN
912879 MX35_PAD_FEC_TX_EN__SPDIF_SPDIF_IN1
913880 MX35_PAD_FEC_TX_EN__UART3_RI
914881 MX35_PAD_FEC_TX_EN__USB_TOP_USBH2_DATA_3
915882 MX35_PAD_FEC_TX_EN__GPIO3_12
916883 MX35_PAD_FEC_TX_EN__IPU_DISPB_PAR_RS
917884 MX35_PAD_FEC_TX_EN__ARM11P_TOP_EVNTBUS_6
918885 MX35_PAD_FEC_MDC__FEC_MDC
919886 MX35_PAD_FEC_MDC__CAN2_TXCAN
920887 MX35_PAD_FEC_MDC__UART3_DCD
921888 MX35_PAD_FEC_MDC__USB_TOP_USBH2_DATA_4
922889 MX35_PAD_FEC_MDC__GPIO3_13
923890 MX35_PAD_FEC_MDC__IPU_DISPB_WR
924891 MX35_PAD_FEC_MDC__ARM11P_TOP_EVNTBUS_7
925892 MX35_PAD_FEC_MDIO__FEC_MDIO
926893 MX35_PAD_FEC_MDIO__CAN2_RXCAN
927894 MX35_PAD_FEC_MDIO__USB_TOP_USBH2_DATA_5
928895 MX35_PAD_FEC_MDIO__GPIO3_14
929896 MX35_PAD_FEC_MDIO__IPU_DISPB_RD
930897 MX35_PAD_FEC_MDIO__ARM11P_TOP_EVNTBUS_8
931898 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR
932899 MX35_PAD_FEC_TX_ERR__OWIRE_LINE
933900 MX35_PAD_FEC_TX_ERR__SPDIF_SPDIF_EXTCLK
934901 MX35_PAD_FEC_TX_ERR__USB_TOP_USBH2_DATA_6
935902 MX35_PAD_FEC_TX_ERR__GPIO3_15
936903 MX35_PAD_FEC_TX_ERR__IPU_DISPB_D0_VSYNC
937904 MX35_PAD_FEC_TX_ERR__ARM11P_TOP_EVNTBUS_9
938905 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR
939906 MX35_PAD_FEC_RX_ERR__IPU_CSI_D_0
940907 MX35_PAD_FEC_RX_ERR__USB_TOP_USBH2_DATA_7
941908 MX35_PAD_FEC_RX_ERR__KPP_COL_4
942909 MX35_PAD_FEC_RX_ERR__GPIO3_16
943910 MX35_PAD_FEC_RX_ERR__IPU_DISPB_SD_D_IO
944911 MX35_PAD_FEC_CRS__FEC_CRS
945912 MX35_PAD_FEC_CRS__IPU_CSI_D_1
946913 MX35_PAD_FEC_CRS__USB_TOP_USBH2_PWR
947914 MX35_PAD_FEC_CRS__KPP_COL_5
948915 MX35_PAD_FEC_CRS__GPIO3_17
949916 MX35_PAD_FEC_CRS__IPU_FLASH_STROBE
950917 MX35_PAD_FEC_RDATA1__FEC_RDATA_1
951918 MX35_PAD_FEC_RDATA1__IPU_CSI_D_2
952919 MX35_PAD_FEC_RDATA1__AUDMUX_AUD6_RXC
953920 MX35_PAD_FEC_RDATA1__USB_TOP_USBH2_OC
954921 MX35_PAD_FEC_RDATA1__KPP_COL_6
955922 MX35_PAD_FEC_RDATA1__GPIO3_18
956923 MX35_PAD_FEC_RDATA1__IPU_DISPB_BE0
957924 MX35_PAD_FEC_TDATA1__FEC_TDATA_1
958925 MX35_PAD_FEC_TDATA1__IPU_CSI_D_3
959926 MX35_PAD_FEC_TDATA1__AUDMUX_AUD6_RXFS
960927 MX35_PAD_FEC_TDATA1__KPP_COL_7
961928 MX35_PAD_FEC_TDATA1__GPIO3_19
962929 MX35_PAD_FEC_TDATA1__IPU_DISPB_BE1
963930 MX35_PAD_FEC_RDATA2__FEC_RDATA_2
964931 MX35_PAD_FEC_RDATA2__IPU_CSI_D_4
965932 MX35_PAD_FEC_RDATA2__AUDMUX_AUD6_TXD
966933 MX35_PAD_FEC_RDATA2__KPP_ROW_4
967934 MX35_PAD_FEC_RDATA2__GPIO3_20
968935 MX35_PAD_FEC_TDATA2__FEC_TDATA_2
969936 MX35_PAD_FEC_TDATA2__IPU_CSI_D_5
970937 MX35_PAD_FEC_TDATA2__AUDMUX_AUD6_RXD
971938 MX35_PAD_FEC_TDATA2__KPP_ROW_5
972939 MX35_PAD_FEC_TDATA2__GPIO3_21
973940 MX35_PAD_FEC_RDATA3__FEC_RDATA_3
974941 MX35_PAD_FEC_RDATA3__IPU_CSI_D_6
975942 MX35_PAD_FEC_RDATA3__AUDMUX_AUD6_TXC
976943 MX35_PAD_FEC_RDATA3__KPP_ROW_6
977944 MX35_PAD_FEC_RDATA3__GPIO3_22
978945 MX35_PAD_FEC_TDATA3__FEC_TDATA_3
979946 MX35_PAD_FEC_TDATA3__IPU_CSI_D_7
980947 MX35_PAD_FEC_TDATA3__AUDMUX_AUD6_TXFS
981948 MX35_PAD_FEC_TDATA3__KPP_ROW_7
982949 MX35_PAD_FEC_TDATA3__GPIO3_23
983950 MX35_PAD_EXT_ARMCLK__CCM_EXT_ARMCLK
984951 MX35_PAD_TEST_MODE__TCU_TEST_MODE
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt
new file mode 100644
index 000000000000..01ef408e205f
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt
@@ -0,0 +1,95 @@
1* Marvell Armada 370 SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,88f6710-pinctrl"
8
9Available mpp pins/groups and functions:
10Note: brackets (x) are not part of the mpp name for marvell,function and given
11only for more detailed description in this document.
12
13name pins functions
14================================================================================
15mpp0 0 gpio, uart0(rxd)
16mpp1 1 gpo, uart0(txd)
17mpp2 2 gpio, i2c0(sck), uart0(txd)
18mpp3 3 gpio, i2c0(sda), uart0(rxd)
19mpp4 4 gpio, cpu_pd(vdd)
20mpp5 5 gpo, ge0(txclko), uart1(txd), spi1(clk), audio(mclk)
21mpp6 6 gpio, ge0(txd0), sata0(prsnt), tdm(rst), audio(sdo)
22mpp7 7 gpo, ge0(txd1), tdm(tdx), audio(lrclk)
23mpp8 8 gpio, ge0(txd2), uart0(rts), tdm(drx), audio(bclk)
24mpp9 9 gpo, ge0(txd3), uart1(txd), sd0(clk), audio(spdifo)
25mpp10 10 gpio, ge0(txctl), uart0(cts), tdm(fsync), audio(sdi)
26mpp11 11 gpio, ge0(rxd0), uart1(rxd), sd0(cmd), spi0(cs1),
27 sata1(prsnt), spi1(cs1)
28mpp12 12 gpio, ge0(rxd1), i2c1(sda), sd0(d0), spi1(cs0),
29 audio(spdifi)
30mpp13 13 gpio, ge0(rxd2), i2c1(sck), sd0(d1), tdm(pclk),
31 audio(rmclk)
32mpp14 14 gpio, ge0(rxd3), pcie(clkreq0), sd0(d2), spi1(mosi),
33 spi0(cs2)
34mpp15 15 gpio, ge0(rxctl), pcie(clkreq1), sd0(d3), spi1(miso),
35 spi0(cs3)
36mpp16 16 gpio, ge0(rxclk), uart1(rxd), tdm(int), audio(extclk)
37mpp17 17 gpo, ge(mdc)
38mpp18 18 gpio, ge(mdio)
39mpp19 19 gpio, ge0(txclk), ge1(txclkout), tdm(pclk)
40mpp20 20 gpo, ge0(txd4), ge1(txd0)
41mpp21 21 gpo, ge0(txd5), ge1(txd1), uart1(txd)
42mpp22 22 gpo, ge0(txd6), ge1(txd2), uart0(rts)
43mpp23 23 gpo, ge0(txd7), ge1(txd3), spi1(mosi)
44mpp24 24 gpio, ge0(col), ge1(txctl), spi1(cs0)
45mpp25 25 gpio, ge0(rxerr), ge1(rxd0), uart1(rxd)
46mpp26 26 gpio, ge0(crs), ge1(rxd1), spi1(miso)
47mpp27 27 gpio, ge0(rxd4), ge1(rxd2), uart0(cts)
48mpp28 28 gpio, ge0(rxd5), ge1(rxd3)
49mpp29 29 gpio, ge0(rxd6), ge1(rxctl), i2c1(sda)
50mpp30 30 gpio, ge0(rxd7), ge1(rxclk), i2c1(sck)
51mpp31 31 gpio, tclk, ge0(txerr)
52mpp32 32 gpio, spi0(cs0)
53mpp33 33 gpio, dev(bootcs), spi0(cs0)
54mpp34 34 gpo, dev(wen0), spi0(mosi)
55mpp35 35 gpo, dev(oen), spi0(sck)
56mpp36 36 gpo, dev(a1), spi0(miso)
57mpp37 37 gpo, dev(a0), sata0(prsnt)
58mpp38 38 gpio, dev(ready), uart1(cts), uart0(cts)
59mpp39 39 gpo, dev(ad0), audio(spdifo)
60mpp40 40 gpio, dev(ad1), uart1(rts), uart0(rts)
61mpp41 41 gpio, dev(ad2), uart1(rxd)
62mpp42 42 gpo, dev(ad3), uart1(txd)
63mpp43 43 gpo, dev(ad4), audio(bclk)
64mpp44 44 gpo, dev(ad5), audio(mclk)
65mpp45 45 gpo, dev(ad6), audio(lrclk)
66mpp46 46 gpo, dev(ad7), audio(sdo)
67mpp47 47 gpo, dev(ad8), sd0(clk), audio(spdifo)
68mpp48 48 gpio, dev(ad9), uart0(rts), sd0(cmd), sata1(prsnt),
69 spi0(cs1)
70mpp49 49 gpio, dev(ad10), pcie(clkreq1), sd0(d0), spi1(cs0),
71 audio(spdifi)
72mpp50 50 gpio, dev(ad11), uart0(cts), sd0(d1), spi1(miso),
73 audio(rmclk)
74mpp51 51 gpio, dev(ad12), i2c1(sda), sd0(d2), spi1(mosi)
75mpp52 52 gpio, dev(ad13), i2c1(sck), sd0(d3), spi1(sck)
76mpp53 53 gpio, dev(ad14), sd0(clk), tdm(pclk), spi0(cs2),
77 pcie(clkreq1)
78mpp54 54 gpo, dev(ad15), tdm(dtx)
79mpp55 55 gpio, dev(cs1), uart1(txd), tdm(rst), sata1(prsnt),
80 sata0(prsnt)
81mpp56 56 gpio, dev(cs2), uart1(cts), uart0(cts), spi0(cs3),
82 pcie(clkreq0), spi1(cs1)
83mpp57 57 gpio, dev(cs3), uart1(rxd), tdm(fsync), sata0(prsnt),
84 audio(sdo)
85mpp58 58 gpio, dev(cs0), uart1(rts), tdm(int), audio(extclk),
86 uart0(rts)
87mpp59 59 gpo, dev(ale0), uart1(rts), uart0(rts), audio(bclk)
88mpp60 60 gpio, dev(ale1), uart1(rxd), sata0(prsnt), pcie(rst-out),
89 audio(sdi)
90mpp61 61 gpo, dev(wen1), uart1(txd), audio(rclk)
91mpp62 62 gpio, dev(a2), uart1(cts), tdm(drx), pcie(clkreq0),
92 audio(mclk), uart0(cts)
93mpp63 63 gpo, spi0(sck), tclk
94mpp64 64 gpio, spi0(miso), spi0-1(cs1)
95mpp65 65 gpio, spi0(mosi), spi0-1(cs2)
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt
new file mode 100644
index 000000000000..bfa0a2e5e0cb
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt
@@ -0,0 +1,100 @@
1* Marvell Armada XP SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,mv78230-pinctrl", "marvell,mv78260-pinctrl",
8 "marvell,mv78460-pinctrl"
9
10This driver supports all Armada XP variants, i.e. mv78230, mv78260, and mv78460.
11
12Available mpp pins/groups and functions:
13Note: brackets (x) are not part of the mpp name for marvell,function and given
14only for more detailed description in this document.
15
16* Marvell Armada XP (all variants)
17
18name pins functions
19================================================================================
20mpp0 0 gpio, ge0(txclko), lcd(d0)
21mpp1 1 gpio, ge0(txd0), lcd(d1)
22mpp2 2 gpio, ge0(txd1), lcd(d2)
23mpp3 3 gpio, ge0(txd2), lcd(d3)
24mpp4 4 gpio, ge0(txd3), lcd(d4)
25mpp5 5 gpio, ge0(txctl), lcd(d5)
26mpp6 6 gpio, ge0(rxd0), lcd(d6)
27mpp7 7 gpio, ge0(rxd1), lcd(d7)
28mpp8 8 gpio, ge0(rxd2), lcd(d8)
29mpp9 9 gpio, ge0(rxd3), lcd(d9)
30mpp10 10 gpio, ge0(rxctl), lcd(d10)
31mpp11 11 gpio, ge0(rxclk), lcd(d11)
32mpp12 12 gpio, ge0(txd4), ge1(txd0), lcd(d12)
33mpp13 13 gpio, ge0(txd5), ge1(txd1), lcd(d13)
34mpp14 14 gpio, ge0(txd6), ge1(txd2), lcd(d15)
35mpp15 15 gpio, ge0(txd7), ge1(txd3), lcd(d16)
36mpp16 16 gpio, ge0(txd7), ge1(txd3), lcd(d16)
37mpp17 17 gpio, ge0(col), ge1(txctl), lcd(d17)
38mpp18 18 gpio, ge0(rxerr), ge1(rxd0), lcd(d18), ptp(trig)
39mpp19 19 gpio, ge0(crs), ge1(rxd1), lcd(d19), ptp(evreq)
40mpp20 20 gpio, ge0(rxd4), ge1(rxd2), lcd(d20), ptp(clk)
41mpp21 21 gpio, ge0(rxd5), ge1(rxd3), lcd(d21), mem(bat)
42mpp22 22 gpio, ge0(rxd6), ge1(rxctl), lcd(d22), sata0(prsnt)
43mpp23 23 gpio, ge0(rxd7), ge1(rxclk), lcd(d23), sata1(prsnt)
44mpp24 24 gpio, lcd(hsync), sata1(prsnt), nf(bootcs-re), tdm(rst)
45mpp25 25 gpio, lcd(vsync), sata0(prsnt), nf(bootcs-we), tdm(pclk)
46mpp26 26 gpio, lcd(clk), tdm(fsync), vdd(cpu1-pd)
47mpp27 27 gpio, lcd(e), tdm(dtx), ptp(trig)
48mpp28 28 gpio, lcd(pwm), tdm(drx), ptp(evreq)
49mpp29 29 gpio, lcd(ref-clk), tdm(int0), ptp(clk), vdd(cpu0-pd)
50mpp30 30 gpio, tdm(int1), sd0(clk)
51mpp31 31 gpio, tdm(int2), sd0(cmd), vdd(cpu0-pd)
52mpp32 32 gpio, tdm(int3), sd0(d0), vdd(cpu1-pd)
53mpp33 33 gpio, tdm(int4), sd0(d1), mem(bat)
54mpp34 34 gpio, tdm(int5), sd0(d2), sata0(prsnt)
55mpp35 35 gpio, tdm(int6), sd0(d3), sata1(prsnt)
56mpp36 36 gpio, spi(mosi)
57mpp37 37 gpio, spi(miso)
58mpp38 38 gpio, spi(sck)
59mpp39 39 gpio, spi(cs0)
60mpp40 40 gpio, spi(cs1), uart2(cts), lcd(vga-hsync), vdd(cpu1-pd),
61 pcie(clkreq0)
62mpp41 41 gpio, spi(cs2), uart2(rts), lcd(vga-vsync), sata1(prsnt),
63 pcie(clkreq1)
64mpp42 42 gpio, uart2(rxd), uart0(cts), tdm(int7), tdm-1(timer),
65 vdd(cpu0-pd)
66mpp43 43 gpio, uart2(txd), uart0(rts), spi(cs3), pcie(rstout),
67 vdd(cpu2-3-pd){1}
68mpp44 44 gpio, uart2(cts), uart3(rxd), spi(cs4), pcie(clkreq2),
69 mem(bat)
70mpp45 45 gpio, uart2(rts), uart3(txd), spi(cs5), sata1(prsnt)
71mpp46 46 gpio, uart3(rts), uart1(rts), spi(cs6), sata0(prsnt)
72mpp47 47 gpio, uart3(cts), uart1(cts), spi(cs7), pcie(clkreq3),
73 ref(clkout)
74mpp48 48 gpio, tclk, dev(burst/last)
75
76* Marvell Armada XP (mv78260 and mv78460 only)
77
78name pins functions
79================================================================================
80mpp49 49 gpio, dev(we3)
81mpp50 50 gpio, dev(we2)
82mpp51 51 gpio, dev(ad16)
83mpp52 52 gpio, dev(ad17)
84mpp53 53 gpio, dev(ad18)
85mpp54 54 gpio, dev(ad19)
86mpp55 55 gpio, dev(ad20), vdd(cpu0-pd)
87mpp56 56 gpio, dev(ad21), vdd(cpu1-pd)
88mpp57 57 gpio, dev(ad22), vdd(cpu2-3-pd){1}
89mpp58 58 gpio, dev(ad23)
90mpp59 59 gpio, dev(ad24)
91mpp60 60 gpio, dev(ad25)
92mpp61 61 gpio, dev(ad26)
93mpp62 62 gpio, dev(ad27)
94mpp63 63 gpio, dev(ad28)
95mpp64 64 gpio, dev(ad29)
96mpp65 65 gpio, dev(ad30)
97mpp66 66 gpio, dev(ad31)
98
99Notes:
100* {1} vdd(cpu2-3-pd) only available on mv78460.
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt
new file mode 100644
index 000000000000..a648aaad6110
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt
@@ -0,0 +1,72 @@
1* Marvell Dove SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,dove-pinctrl"
8- clocks: (optional) phandle of pdma clock
9
10Available mpp pins/groups and functions:
11Note: brackets (x) are not part of the mpp name for marvell,function and given
12only for more detailed description in this document.
13
14name pins functions
15================================================================================
16mpp0 0 gpio, pmu, uart2(rts), sdio0(cd), lcd0(pwm)
17mpp1 1 gpio, pmu, uart2(cts), sdio0(wp), lcd1(pwm)
18mpp2 2 gpio, pmu, uart2(txd), sdio0(buspwr), sata(prsnt),
19 uart1(rts)
20mpp3 3 gpio, pmu, uart2(rxd), sdio0(ledctrl), sata(act),
21 uart1(cts), lcd-spi(cs1)
22mpp4 4 gpio, pmu, uart3(rts), sdio1(cd), spi1(miso)
23mpp5 5 gpio, pmu, uart3(cts), sdio1(wp), spi1(cs)
24mpp6 6 gpio, pmu, uart3(txd), sdio1(buspwr), spi1(mosi)
25mpp7 7 gpio, pmu, uart3(rxd), sdio1(ledctrl), spi1(sck)
26mpp8 8 gpio, pmu, watchdog(rstout)
27mpp9 9 gpio, pmu, pex1(clkreq)
28mpp10 10 gpio, pmu, ssp(sclk)
29mpp11 11 gpio, pmu, sata(prsnt), sata-1(act), sdio0(ledctrl),
30 sdio1(ledctrl), pex0(clkreq)
31mpp12 12 gpio, pmu, uart2(rts), audio0(extclk), sdio1(cd), sata(act)
32mpp13 13 gpio, pmu, uart2(cts), audio1(extclk), sdio1(wp),
33 ssp(extclk)
34mpp14 14 gpio, pmu, uart2(txd), sdio1(buspwr), ssp(rxd)
35mpp15 15 gpio, pmu, uart2(rxd), sdio1(ledctrl), ssp(sfrm)
36mpp16 16 gpio, uart3(rts), sdio0(cd), ac97(sdi1), lcd-spi(cs1)
37mpp17 17 gpio, uart3(cts), sdio0(wp), ac97(sdi2), twsi(sda),
38 ac97-1(sysclko)
39mpp18 18 gpio, uart3(txd), sdio0(buspwr), ac97(sdi3), lcd0(pwm)
40mpp19 19 gpio, uart3(rxd), sdio0(ledctrl), twsi(sck)
41mpp20 20 gpio, sdio0(cd), sdio1(cd), spi1(miso), lcd-spi(miso),
42 ac97(sysclko)
43mpp21 21 gpio, sdio0(wp), sdio1(wp), spi1(cs), lcd-spi(cs0),
44 uart1(cts), ssp(sfrm)
45mpp22 22 gpio, sdio0(buspwr), sdio1(buspwr), spi1(mosi),
46 lcd-spi(mosi), uart1(cts), ssp(txd)
47mpp23 23 gpio, sdio0(ledctrl), sdio1(ledctrl), spi1(sck),
48 lcd-spi(sck), ssp(sclk)
49mpp_camera 24-39 gpio, camera
50mpp_sdio0 40-45 gpio, sdio0
51mpp_sdio1 46-51 gpio, sdio1
52mpp_audio1 52-57 gpio, i2s1/spdifo, i2s1, spdifo, twsi, ssp/spdifo, ssp,
53 ssp/twsi
54mpp_spi0 58-61 gpio, spi0
55mpp_uart1 62-63 gpio, uart1
56mpp_nand 64-71 gpo, nand
57audio0 - i2s, ac97
58twsi - none, opt1, opt2, opt3
59
60Notes:
61* group "mpp_audio1" allows the following functions and gpio pins:
62 - gpio : gpio on pins 52-57
63 - i2s1/spdifo : audio1 i2s on pins 52-55 and spdifo on 57, no gpios
64 - i2s1 : audio1 i2s on pins 52-55, gpio on pins 56,57
65 - spdifo : spdifo on pin 57, gpio on pins 52-55
66 - twsi : twsi on pins 56,57, gpio on pins 52-55
67 - ssp/spdifo : ssp on pins 52-55, spdifo on pin 57, no gpios
68 - ssp : ssp on pins 52-55, gpio on pins 56,57
69 - ssp/twsi : ssp on pins 52-55, twsi on pins 56,57, no gpios
70* group "audio0" internally muxes i2s0 or ac97 controller to the dedicated
71 audio0 pins.
72* group "twsi" internally muxes twsi controller to the dedicated or option pins.
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt
new file mode 100644
index 000000000000..361bccb7ec89
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt
@@ -0,0 +1,279 @@
1* Marvell Kirkwood SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,88f6180-pinctrl",
8 "marvell,88f6190-pinctrl", "marvell,88f6192-pinctrl",
9 "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl"
10
11This driver supports all kirkwood variants, i.e. 88f6180, 88f619x, and 88f628x.
12
13Available mpp pins/groups and functions:
14Note: brackets (x) are not part of the mpp name for marvell,function and given
15only for more detailed description in this document.
16
17* Marvell Kirkwood 88f6180
18
19name pins functions
20================================================================================
21mpp0 0 gpio, nand(io2), spi(cs)
22mpp1 1 gpo, nand(io3), spi(mosi)
23mpp2 2 gpo, nand(io4), spi(sck)
24mpp3 3 gpo, nand(io5), spi(miso)
25mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
26mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig)
27mpp6 6 sysrst(out), spi(mosi), ptp(trig)
28mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
29mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
30 mii(col)
31mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
32 mii(crs)
33mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig)
34mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
35 ptp-2(trig)
36mpp12 12 gpo, sdio(clk)
37mpp13 13 gpio, sdio(cmd), uart1(txd)
38mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col)
39mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd)
40mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs)
41mpp17 17 gpio, sdio(d3)
42mpp18 18 gpo, nand(io0)
43mpp19 19 gpo, nand(io1)
44mpp20 20 gpio, mii(rxerr)
45mpp21 21 gpio, audio(spdifi)
46mpp22 22 gpio, audio(spdifo)
47mpp23 23 gpio, audio(rmclk)
48mpp24 24 gpio, audio(bclk)
49mpp25 25 gpio, audio(sdo)
50mpp26 26 gpio, audio(lrclk)
51mpp27 27 gpio, audio(mclk)
52mpp28 28 gpio, audio(sdi)
53mpp29 29 gpio, audio(extclk)
54
55* Marvell Kirkwood 88f6190
56
57name pins functions
58================================================================================
59mpp0 0 gpio, nand(io2), spi(cs)
60mpp1 1 gpo, nand(io3), spi(mosi)
61mpp2 2 gpo, nand(io4), spi(sck)
62mpp3 3 gpo, nand(io5), spi(miso)
63mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
64mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
65mpp6 6 sysrst(out), spi(mosi), ptp(trig)
66mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
67mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
68 mii(col), mii-1(rxerr)
69mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
70 mii(crs), sata0(prsnt)
71mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig)
72mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
73 ptp-2(trig), sata0(act)
74mpp12 12 gpo, sdio(clk)
75mpp13 13 gpio, sdio(cmd), uart1(txd)
76mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col)
77mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
78mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs)
79mpp17 17 gpio, sdio(d3), sata0(prsnt)
80mpp18 18 gpo, nand(io0)
81mpp19 19 gpo, nand(io1)
82mpp20 20 gpio, ge1(txd0)
83mpp21 21 gpio, ge1(txd1), sata0(act)
84mpp22 22 gpio, ge1(txd2)
85mpp23 23 gpio, ge1(txd3), sata0(prsnt)
86mpp24 24 gpio, ge1(rxd0)
87mpp25 25 gpio, ge1(rxd1)
88mpp26 26 gpio, ge1(rxd2)
89mpp27 27 gpio, ge1(rxd3)
90mpp28 28 gpio, ge1(col)
91mpp29 29 gpio, ge1(txclk)
92mpp30 30 gpio, ge1(rxclk)
93mpp31 31 gpio, ge1(rxclk)
94mpp32 32 gpio, ge1(txclko)
95mpp33 33 gpo, ge1(txclk)
96mpp34 34 gpio, ge1(txen)
97mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr)
98
99* Marvell Kirkwood 88f6192
100
101name pins functions
102================================================================================
103mpp0 0 gpio, nand(io2), spi(cs)
104mpp1 1 gpo, nand(io3), spi(mosi)
105mpp2 2 gpo, nand(io4), spi(sck)
106mpp3 3 gpo, nand(io5), spi(miso)
107mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act)
108mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
109mpp6 6 sysrst(out), spi(mosi), ptp(trig)
110mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
111mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
112 mii(col), mii-1(rxerr), sata1(prsnt)
113mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
114 mii(crs), sata0(prsnt)
115mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act)
116mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
117 ptp-2(trig), sata0(act)
118mpp12 12 gpo, sdio(clk)
119mpp13 13 gpio, sdio(cmd), uart1(txd)
120mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt)
121mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
122mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
123 sata1(act)
124mpp17 17 gpio, sdio(d3), sata0(prsnt)
125mpp18 18 gpo, nand(io0)
126mpp19 19 gpo, nand(io1)
127mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
128 sata1(act)
129mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
130 audio(spdifo)
131mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
132 sata1(prsnt)
133mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
134 audio(bclk)
135mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo)
136mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk)
137mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk)
138mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi)
139mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk)
140mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst)
141mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk)
142mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs)
143mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx)
144mpp33 33 gpo, ge1(txclk), tdm(drx)
145mpp34 34 gpio, ge1(txen), tdm(spi-cs1)
146mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql)
147
148* Marvell Kirkwood 88f6281
149
150name pins functions
151================================================================================
152mpp0 0 gpio, nand(io2), spi(cs)
153mpp1 1 gpo, nand(io3), spi(mosi)
154mpp2 2 gpo, nand(io4), spi(sck)
155mpp3 3 gpo, nand(io5), spi(miso)
156mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act)
157mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
158mpp6 6 sysrst(out), spi(mosi), ptp(trig)
159mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
160mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
161 mii(col), mii-1(rxerr), sata1(prsnt)
162mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
163 mii(crs), sata0(prsnt)
164mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act)
165mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
166 ptp-2(trig), sata0(act)
167mpp12 12 gpio, sdio(clk)
168mpp13 13 gpio, sdio(cmd), uart1(txd)
169mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt)
170mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
171mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
172 sata1(act)
173mpp17 17 gpio, sdio(d3), sata0(prsnt)
174mpp18 18 gpo, nand(io0)
175mpp19 19 gpo, nand(io1)
176mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
177 sata1(act)
178mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
179 audio(spdifo)
180mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
181 sata1(prsnt)
182mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
183 audio(bclk)
184mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo)
185mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk)
186mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk)
187mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi)
188mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk)
189mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst)
190mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk)
191mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs)
192mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx)
193mpp33 33 gpo, ge1(txclk), tdm(drx)
194mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act)
195mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql)
196mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi)
197mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo)
198mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk)
199mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk)
200mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo)
201mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk)
202mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk)
203mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi)
204mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk)
205mpp45 45 gpio, ts(mp9), tdm(pclk)
206mpp46 46 gpio, ts(mp10), tdm(fs)
207mpp47 47 gpio, ts(mp11), tdm(drx)
208mpp48 48 gpio, ts(mp12), tdm(dtx)
209mpp49 49 gpio, ts(mp9), tdm(rx0ql), ptp(clk)
210
211* Marvell Kirkwood 88f6282
212
213name pins functions
214================================================================================
215mpp0 0 gpio, nand(io2), spi(cs)
216mpp1 1 gpo, nand(io3), spi(mosi)
217mpp2 2 gpo, nand(io4), spi(sck)
218mpp3 3 gpo, nand(io5), spi(miso)
219mpp4 4 gpio, nand(io6), uart0(rxd), sata1(act), lcd(hsync)
220mpp5 5 gpo, nand(io7), uart0(txd), sata0(act), lcd(vsync)
221mpp6 6 sysrst(out), spi(mosi)
222mpp7 7 gpo, spi(cs), lcd(pwm)
223mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), mii(col),
224 mii-1(rxerr), sata1(prsnt)
225mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), mii(crs),
226 sata0(prsnt)
227mpp10 10 gpo, spi(sck), uart0(txd), sata1(act)
228mpp11 11 gpio, spi(miso), uart0(rxd), sata0(act)
229mpp12 12 gpo, sdio(clk), audio(spdifo), spi(mosi), twsi(sda)
230mpp13 13 gpio, sdio(cmd), uart1(txd), audio(rmclk), lcd(pwm)
231mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt),
232 audio(spdifi), audio-1(sdi)
233mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act),
234 spi(cs)
235mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
236 sata1(act), lcd(extclk)
237mpp17 17 gpio, sdio(d3), sata0(prsnt), sata1(act), twsi1(sck)
238mpp18 18 gpo, nand(io0), pex(clkreq)
239mpp19 19 gpo, nand(io1)
240mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
241 sata1(act), lcd(d0)
242mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
243 audio(spdifo), lcd(d1)
244mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
245 sata1(prsnt), lcd(d2)
246mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
247 audio(bclk), lcd(d3)
248mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo),
249 lcd(d4)
250mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk),
251 lcd(d5)
252mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk),
253 lcd(d6)
254mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi),
255 lcd(d7)
256mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk),
257 lcd(d8)
258mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst), lcd(d9)
259mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk), lcd(d10)
260mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs), lcd(d11)
261mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx), lcd(d12)
262mpp33 33 gpo, ge1(txclk), tdm(drx), lcd(d13)
263mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act), lcd(d14)
264mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql),
265 lcd(d15)
266mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi), twsi1(sda)
267mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo), twsi1(sck)
268mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk), lcd(d18)
269mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk), lcd(d19)
270mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo), lcd(d20)
271mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk), lcd(d21)
272mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk), lcd(d22)
273mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi), lcd(d23)
274mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk), lcd(clk)
275mpp45 45 gpio, ts(mp9), tdm(pclk), lcd(e)
276mpp46 46 gpio, ts(mp10), tdm(fs), lcd(hsync)
277mpp47 47 gpio, ts(mp11), tdm(drx), lcd(vsync)
278mpp48 48 gpio, ts(mp12), tdm(dtx), lcd(d16)
279mpp49 49 gpo, tdm(rx0ql), pex(clkreq), lcd(d17)
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt
new file mode 100644
index 000000000000..0a26c3aa4e6d
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt
@@ -0,0 +1,46 @@
1* Marvell SoC pinctrl core driver for mpp
2
3The pinctrl driver enables Marvell SoCs to configure the multi-purpose pins
4(mpp) to a specific function. For each SoC family there is a SoC specific
5driver using this core driver.
6
7Please refer to pinctrl-bindings.txt in this directory for details of the
8common pinctrl bindings used by client devices, including the meaning of the
9phrase "pin configuration node".
10
11A Marvell SoC pin configuration node is a node of a group of pins which can
12be used for a specific device or function. Each node requires one or more
13mpp pins or group of pins and a mpp function common to all pins.
14
15Required properties for pinctrl driver:
16- compatible: "marvell,<soc>-pinctrl"
17 Please refer to each marvell,<soc>-pinctrl.txt binding doc for supported SoCs.
18
19Required properties for pin configuration node:
20- marvell,pins: string array of mpp pins or group of pins to be muxed.
21- marvell,function: string representing a function to mux to for all
22 marvell,pins given in this pin configuration node. The function has to be
23 common for all marvell,pins. Please refer to marvell,<soc>-pinctrl.txt for
24 valid pin/pin group names and available function names for each SoC.
25
26Examples:
27
28uart1: serial@12100 {
29 compatible = "ns16550a";
30 reg = <0x12100 0x100>;
31 reg-shift = <2>;
32 interrupts = <7>;
33
34 pinctrl-0 = <&pmx_uart1_sw>;
35 pinctrl-names = "default";
36};
37
38pinctrl: pinctrl@d0200 {
39 compatible = "marvell,dove-pinctrl";
40 reg = <0xd0200 0x20>;
41
42 pmx_uart1_sw: pmx-uart1-sw {
43 marvell,pins = "mpp_uart1";
44 marvell,function = "uart1";
45 };
46};
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
index 5187f0dd8b28..2c81e45f1374 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
@@ -14,10 +14,12 @@ Optional properties:
14- pinctrl-single,function-off : function off mode for disabled state if 14- pinctrl-single,function-off : function off mode for disabled state if
15 available and same for all registers; if not specified, disabling of 15 available and same for all registers; if not specified, disabling of
16 pin functions is ignored 16 pin functions is ignored
17- pinctrl-single,bit-per-mux : boolean to indicate that one register controls
18 more than one pin
17 19
18This driver assumes that there is only one register for each pin, 20This driver assumes that there is only one register for each pin (unless the
19and uses the common pinctrl bindings as specified in the pinctrl-bindings.txt 21pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as
20document in this directory. 22specified in the pinctrl-bindings.txt document in this directory.
21 23
22The pin configuration nodes for pinctrl-single are specified as pinctrl 24The pin configuration nodes for pinctrl-single are specified as pinctrl
23register offset and value pairs using pinctrl-single,pins. Only the bits 25register offset and value pairs using pinctrl-single,pins. Only the bits
@@ -31,6 +33,15 @@ device pinctrl register, and 0x118 contains the desired value of the
31pinctrl register. See the device example and static board pins example 33pinctrl register. See the device example and static board pins example
32below for more information. 34below for more information.
33 35
36In case when one register changes more than one pin's mux the
37pinctrl-single,bits need to be used which takes three parameters:
38
39 pinctrl-single,bits = <0xdc 0x18, 0xff>;
40
41Where 0xdc is the offset from the pinctrl register base address for the
42device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to
43be used when applying this change to the register.
44
34Example: 45Example:
35 46
36/* SoC common file */ 47/* SoC common file */
@@ -55,6 +66,15 @@ pmx_wkup: pinmux@4a31e040 {
55 pinctrl-single,function-mask = <0xffff>; 66 pinctrl-single,function-mask = <0xffff>;
56}; 67};
57 68
69control_devconf0: pinmux@48002274 {
70 compatible = "pinctrl-single";
71 reg = <0x48002274 4>; /* Single register */
72 #address-cells = <1>;
73 #size-cells = <0>;
74 pinctrl-single,bit-per-mux;
75 pinctrl-single,register-width = <32>;
76 pinctrl-single,function-mask = <0x5F>;
77};
58 78
59/* board specific .dts file */ 79/* board specific .dts file */
60 80
@@ -87,6 +107,21 @@ pmx_wkup: pinmux@4a31e040 {
87 }; 107 };
88}; 108};
89 109
110&control_devconf0 {
111 mcbsp1_pins: pinmux_mcbsp1_pins {
112 pinctrl-single,bits = <
113 0x00 0x18 0x18 /* FSR/CLKR signal from FSX/CLKX pin */
114 >;
115 };
116
117 mcbsp2_clks_pins: pinmux_mcbsp2_clks_pins {
118 pinctrl-single,bits = <
119 0x00 0x40 0x40 /* McBSP2 CLKS from McBSP_CLKS pin */
120 >;
121 };
122
123};
124
90&uart2 { 125&uart2 {
91 pinctrl-names = "default"; 126 pinctrl-names = "default";
92 pinctrl-0 = <&uart2_pins>; 127 pinctrl-0 = <&uart2_pins>;
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
new file mode 100644
index 000000000000..03dee50532f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
@@ -0,0 +1,196 @@
1Samsung GPIO and Pin Mux/Config controller
2
3Samsung's ARM based SoC's integrates a GPIO and Pin mux/config hardware
4controller. It controls the input/output settings on the available pads/pins
5and also provides ability to multiplex and configure the output of various
6on-chip controllers onto these pads.
7
8Required Properties:
9- compatible: should be one of the following.
10 - "samsung,pinctrl-exynos4210": for Exynos4210 compatible pin-controller.
11 - "samsung,pinctrl-exynos5250": for Exynos5250 compatible pin-controller.
12
13- reg: Base address of the pin controller hardware module and length of
14 the address space it occupies.
15
16- interrupts: interrupt specifier for the controller. The format and value of
17 the interrupt specifier depends on the interrupt parent for the controller.
18
19- Pin mux/config groups as child nodes: The pin mux (selecting pin function
20 mode) and pin config (pull up/down, driver strength) settings are represented
21 as child nodes of the pin-controller node. There should be atleast one
22 child node and there is no limit on the count of these child nodes.
23
24 The child node should contain a list of pin(s) on which a particular pin
25 function selection or pin configuration (or both) have to applied. This
26 list of pins is specified using the property name "samsung,pins". There
27 should be atleast one pin specfied for this property and there is no upper
28 limit on the count of pins that can be specified. The pins are specified
29 using pin names which are derived from the hardware manual of the SoC. As
30 an example, the pins in GPA0 bank of the pin controller can be represented
31 as "gpa0-0", "gpa0-1", "gpa0-2" and so on. The names should be in lower case.
32 The format of the pin names should be (as per the hardware manual)
33 "[pin bank name]-[pin number within the bank]".
34
35 The pin function selection that should be applied on the pins listed in the
36 child node is specified using the "samsung,pin-function" property. The value
37 of this property that should be applied to each of the pins listed in the
38 "samsung,pins" property should be picked from the hardware manual of the SoC
39 for the specified pin group. This property is optional in the child node if
40 no specific function selection is desired for the pins listed in the child
41 node. The value of this property is used as-is to program the pin-controller
42 function selector register of the pin-bank.
43
44 The child node can also optionally specify one or more of the pin
45 configuration that should be applied on all the pins listed in the
46 "samsung,pins" property of the child node. The following pin configuration
47 properties are supported.
48
49 - samsung,pin-pud: Pull up/down configuration.
50 - samsung,pin-drv: Drive strength configuration.
51 - samsung,pin-pud-pdn: Pull up/down configuration in power down mode.
52 - samsung,pin-drv-pdn: Drive strength configuration in power down mode.
53
54 The values specified by these config properties should be derived from the
55 hardware manual and these values are programmed as-is into the pin
56 pull up/down and driver strength register of the pin-controller.
57
58 Note: A child should include atleast a pin function selection property or
59 pin configuration property (one or more) or both.
60
61 The client nodes that require a particular pin function selection and/or
62 pin configuration should use the bindings listed in the "pinctrl-bindings.txt"
63 file.
64
65External GPIO and Wakeup Interrupts:
66
67The controller supports two types of external interrupts over gpio. The first
68is the external gpio interrupt and second is the external wakeup interrupts.
69The difference between the two is that the external wakeup interrupts can be
70used as system wakeup events.
71
72A. External GPIO Interrupts: For supporting external gpio interrupts, the
73 following properties should be specified in the pin-controller device node.
74
75- interrupt-controller: identifies the controller node as interrupt-parent.
76- #interrupt-cells: the value of this property should be 2.
77 - First Cell: represents the external gpio interrupt number local to the
78 external gpio interrupt space of the controller.
79 - Second Cell: flags to identify the type of the interrupt
80 - 1 = rising edge triggered
81 - 2 = falling edge triggered
82 - 3 = rising and falling edge triggered
83 - 4 = high level triggered
84 - 8 = low level triggered
85
86B. External Wakeup Interrupts: For supporting external wakeup interrupts, a
87 child node representing the external wakeup interrupt controller should be
88 included in the pin-controller device node. This child node should include
89 the following properties.
90
91 - compatible: identifies the type of the external wakeup interrupt controller
92 The possible values are:
93 - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller
94 found on Samsung Exynos4210 SoC.
95 - interrupt-parent: phandle of the interrupt parent to which the external
96 wakeup interrupts are forwarded to.
97 - interrupt-controller: identifies the node as interrupt-parent.
98 - #interrupt-cells: the value of this property should be 2
99 - First Cell: represents the external wakeup interrupt number local to
100 the external wakeup interrupt space of the controller.
101 - Second Cell: flags to identify the type of the interrupt
102 - 1 = rising edge triggered
103 - 2 = falling edge triggered
104 - 3 = rising and falling edge triggered
105 - 4 = high level triggered
106 - 8 = low level triggered
107
108Aliases:
109
110All the pin controller nodes should be represented in the aliases node using
111the following format 'pinctrl{n}' where n is a unique number for the alias.
112
113Example 1: A pin-controller node with pin groups.
114
115 pinctrl_0: pinctrl@11400000 {
116 compatible = "samsung,pinctrl-exynos4210";
117 reg = <0x11400000 0x1000>;
118 interrupts = <0 47 0>;
119
120 uart0_data: uart0-data {
121 samsung,pins = "gpa0-0", "gpa0-1";
122 samsung,pin-function = <2>;
123 samsung,pin-pud = <0>;
124 samsung,pin-drv = <0>;
125 };
126
127 uart0_fctl: uart0-fctl {
128 samsung,pins = "gpa0-2", "gpa0-3";
129 samsung,pin-function = <2>;
130 samsung,pin-pud = <0>;
131 samsung,pin-drv = <0>;
132 };
133
134 uart1_data: uart1-data {
135 samsung,pins = "gpa0-4", "gpa0-5";
136 samsung,pin-function = <2>;
137 samsung,pin-pud = <0>;
138 samsung,pin-drv = <0>;
139 };
140
141 uart1_fctl: uart1-fctl {
142 samsung,pins = "gpa0-6", "gpa0-7";
143 samsung,pin-function = <2>;
144 samsung,pin-pud = <0>;
145 samsung,pin-drv = <0>;
146 };
147
148 i2c2_bus: i2c2-bus {
149 samsung,pins = "gpa0-6", "gpa0-7";
150 samsung,pin-function = <3>;
151 samsung,pin-pud = <3>;
152 samsung,pin-drv = <0>;
153 };
154 };
155
156Example 2: A pin-controller node with external wakeup interrupt controller node.
157
158 pinctrl_1: pinctrl@11000000 {
159 compatible = "samsung,pinctrl-exynos4210";
160 reg = <0x11000000 0x1000>;
161 interrupts = <0 46 0>;
162 interrupt-controller;
163 #interrupt-cells = <2>;
164
165 wakup_eint: wakeup-interrupt-controller {
166 compatible = "samsung,exynos4210-wakeup-eint";
167 interrupt-parent = <&gic>;
168 interrupt-controller;
169 #interrupt-cells = <2>;
170 interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
171 <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>,
172 <0 24 0>, <0 25 0>, <0 26 0>, <0 27 0>,
173 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>,
174 <0 32 0>;
175 };
176 };
177
178Example 3: A uart client node that supports 'default' and 'flow-control' states.
179
180 uart@13800000 {
181 compatible = "samsung,exynos4210-uart";
182 reg = <0x13800000 0x100>;
183 interrupts = <0 52 0>;
184 pinctrl-names = "default", "flow-control;
185 pinctrl-0 = <&uart0_data>;
186 pinctrl-1 = <&uart0_data &uart0_fctl>;
187 };
188
189Example 4: Set up the default pin state for uart controller.
190
191 static int s3c24xx_serial_probe(struct platform_device *pdev) {
192 struct pinctrl *pinctrl;
193 ...
194 ...
195 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
196 }
diff --git a/Documentation/devicetree/bindings/power/opp.txt b/Documentation/devicetree/bindings/power/opp.txt
new file mode 100644
index 000000000000..74499e5033fc
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/opp.txt
@@ -0,0 +1,25 @@
1* Generic OPP Interface
2
3SoCs have a standard set of tuples consisting of frequency and
4voltage pairs that the device will support per voltage domain. These
5are called Operating Performance Points or OPPs.
6
7Properties:
8- operating-points: An array of 2-tuples items, and each item consists
9 of frequency and voltage like <freq-kHz vol-uV>.
10 freq: clock frequency in kHz
11 vol: voltage in microvolt
12
13Examples:
14
15cpu@0 {
16 compatible = "arm,cortex-a9";
17 reg = <0>;
18 next-level-cache = <&L2>;
19 operating-points = <
20 /* kHz uV */
21 792000 1100000
22 396000 950000
23 198000 850000
24 >;
25};
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
index 939a26d541f6..d5e370450ac0 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
@@ -12,9 +12,12 @@ Properties:
12- #size-cells : Either one or two, depending on how large each chipselect 12- #size-cells : Either one or two, depending on how large each chipselect
13 can be. 13 can be.
14- reg : Offset and length of the register set for the device 14- reg : Offset and length of the register set for the device
15- interrupts : IFC has two interrupts. The first one is the "common" 15- interrupts: IFC may have one or two interrupts. If two interrupt
16 interrupt(CM_EVTER_STAT), and second is the NAND interrupt 16 specifiers are present, the first is the "common"
17 (NAND_EVTER_STAT). 17 interrupt (CM_EVTER_STAT), and the second is the NAND
18 interrupt (NAND_EVTER_STAT). If there is only one,
19 that interrupt reports both types of event.
20
18 21
19- ranges : Each range corresponds to a single chipselect, and covers 22- ranges : Each range corresponds to a single chipselect, and covers
20 the entire access window as configured. 23 the entire access window as configured.
diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt b/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
index b16f4a57d111..11963e4d6bc4 100644
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
@@ -11,7 +11,7 @@ Example:
11 11
12pwm: pwm@80064000 { 12pwm: pwm@80064000 {
13 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm"; 13 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm";
14 reg = <0x80064000 2000>; 14 reg = <0x80064000 0x2000>;
15 #pwm-cells = <2>; 15 #pwm-cells = <2>;
16 fsl,pwm-number = <8>; 16 fsl,pwm-number = <8>;
17}; 17};
diff --git a/Documentation/devicetree/bindings/regulator/88pm860x.txt b/Documentation/devicetree/bindings/regulator/88pm860x.txt
new file mode 100644
index 000000000000..1267b3e1a2cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/88pm860x.txt
@@ -0,0 +1,30 @@
1Marvell 88PM860x regulator
2
3Required properties:
4- compatible: "marvell,88pm860x"
5- reg: I2C slave address
6- regulators: A node that houses a sub-node for each regulator within the
7 device. Each sub-node is identified using the regulator-compatible
8 property, with valid values listed below.
9
10Example:
11
12 pmic: 88pm860x@34 {
13 compatible = "marvell,88pm860x";
14 reg = <0x34>;
15
16 regulators {
17 BUCK1 {
18 regulator-min-microvolt = <1000000>;
19 regulator-max-microvolt = <1500000>;
20 regulator-boot-on;
21 regulator-always-on;
22 };
23 BUCK3 {
24 regulator-min-microvolt = <1000000>;
25 regulator-max-microvolt = <3000000>;
26 regulator-boot-on;
27 regulator-always-on;
28 };
29 };
30 };
diff --git a/Documentation/devicetree/bindings/regulator/max8907.txt b/Documentation/devicetree/bindings/regulator/max8907.txt
new file mode 100644
index 000000000000..371eccd1cd68
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/max8907.txt
@@ -0,0 +1,69 @@
1MAX8907 regulator
2
3Required properties:
4- compatible: "maxim,max8907"
5- reg: I2C slave address
6- interrupts: The interrupt output of the controller
7- mbatt-supply: The input supply for MBATT, BBAT, SDBY, VRTC.
8- in-v1-supply: The input supply for SD1.
9- in-v2-supply: The input supply for SD2.
10- in-v3-supply: The input supply for SD3.
11- in1-supply: The input supply for LDO1.
12...
13- in20-supply: The input supply for LDO20.
14- regulators: A node that houses a sub-node for each regulator within the
15 device. Each sub-node is identified using the node's name (or the deprecated
16 regulator-compatible property if present), with valid values listed below.
17 The content of each sub-node is defined by the standard binding for
18 regulators; see regulator.txt.
19
20Optional properties:
21- maxim,system-power-controller: Boolean property indicating that the PMIC
22 controls the overall system power.
23
24The valid names for regulators are:
25
26 sd1, sd2, sd3, ldo1, ldo2, ldo3, ldo4, ldo5, ldo6, ldo7, ldo8, ldo9, ldo10,
27 ldo11, ldo12, ldo13, ldo14, ldo15, ldo16, ldo17, ldo18, ldo19, ldo20, out5v,
28 out33v, bbat, sdby, vrtc.
29
30Example:
31
32 max8907@3c {
33 compatible = "maxim,max8907";
34 reg = <0x3c>;
35 interrupts = <0 86 0x4>;
36
37 maxim,system-power-controller;
38
39 mbatt-supply = <&some_reg>;
40 in-v1-supply = <&mbatt_reg>;
41 ...
42 in1-supply = <&mbatt_reg>;
43 ...
44
45 regulators {
46 mbatt_reg: mbatt {
47 regulator-name = "vbat_pmu";
48 regulator-min-microvolt = <5000000>;
49 regulator-max-microvolt = <5000000>;
50 regulator-always-on;
51 };
52
53 sd1 {
54 regulator-name = "nvvdd_sv1,vdd_cpu_pmu";
55 regulator-min-microvolt = <1000000>;
56 regulator-max-microvolt = <1000000>;
57 regulator-always-on;
58 };
59
60 sd2 {
61 regulator-name = "nvvdd_sv2,vdd_core";
62 regulator-min-microvolt = <1200000>;
63 regulator-max-microvolt = <1200000>;
64 regulator-always-on;
65 };
66...
67 };
68 };
69 };
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 66ece3f87bbc..ecfc6ccd67ef 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -11,10 +11,13 @@ Optional properties:
11- regulator-boot-on: bootloader/firmware enabled regulator 11- regulator-boot-on: bootloader/firmware enabled regulator
12- <name>-supply: phandle to the parent supply/regulator node 12- <name>-supply: phandle to the parent supply/regulator node
13- regulator-ramp-delay: ramp delay for regulator(in uV/uS) 13- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
14
15Deprecated properties:
14- regulator-compatible: If a regulator chip contains multiple 16- regulator-compatible: If a regulator chip contains multiple
15 regulators, and if the chip's binding contains a child node that 17 regulators, and if the chip's binding contains a child node that
16 describes each regulator, then this property indicates which regulator 18 describes each regulator, then this property indicates which regulator
17 this child node is intended to configure. 19 this child node is intended to configure. If this property is missing,
20 the node's name will be used instead.
18 21
19Example: 22Example:
20 23
diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt b/Documentation/devicetree/bindings/regulator/tps65217.txt
index 0487e9675ba0..d316fb895daf 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -22,66 +22,49 @@ Example:
22 compatible = "ti,tps65217"; 22 compatible = "ti,tps65217";
23 23
24 regulators { 24 regulators {
25 #address-cells = <1>; 25 dcdc1_reg: dcdc1 {
26 #size-cells = <0>;
27
28 dcdc1_reg: regulator@0 {
29 reg = <0>;
30 regulator-compatible = "dcdc1";
31 regulator-min-microvolt = <900000>; 26 regulator-min-microvolt = <900000>;
32 regulator-max-microvolt = <1800000>; 27 regulator-max-microvolt = <1800000>;
33 regulator-boot-on; 28 regulator-boot-on;
34 regulator-always-on; 29 regulator-always-on;
35 }; 30 };
36 31
37 dcdc2_reg: regulator@1 { 32 dcdc2_reg: dcdc2 {
38 reg = <1>;
39 regulator-compatible = "dcdc2";
40 regulator-min-microvolt = <900000>; 33 regulator-min-microvolt = <900000>;
41 regulator-max-microvolt = <3300000>; 34 regulator-max-microvolt = <3300000>;
42 regulator-boot-on; 35 regulator-boot-on;
43 regulator-always-on; 36 regulator-always-on;
44 }; 37 };
45 38
46 dcdc3_reg: regulator@2 { 39 dcdc3_reg: dcc3 {
47 reg = <2>;
48 regulator-compatible = "dcdc3";
49 regulator-min-microvolt = <900000>; 40 regulator-min-microvolt = <900000>;
50 regulator-max-microvolt = <1500000>; 41 regulator-max-microvolt = <1500000>;
51 regulator-boot-on; 42 regulator-boot-on;
52 regulator-always-on; 43 regulator-always-on;
53 }; 44 };
54 45
55 ldo1_reg: regulator@3 { 46 ldo1_reg: ldo1 {
56 reg = <3>;
57 regulator-compatible = "ldo1";
58 regulator-min-microvolt = <1000000>; 47 regulator-min-microvolt = <1000000>;
59 regulator-max-microvolt = <3300000>; 48 regulator-max-microvolt = <3300000>;
60 regulator-boot-on; 49 regulator-boot-on;
61 regulator-always-on; 50 regulator-always-on;
62 }; 51 };
63 52
64 ldo2_reg: regulator@4 { 53 ldo2_reg: ldo2 {
65 reg = <4>;
66 regulator-compatible = "ldo2";
67 regulator-min-microvolt = <900000>; 54 regulator-min-microvolt = <900000>;
68 regulator-max-microvolt = <3300000>; 55 regulator-max-microvolt = <3300000>;
69 regulator-boot-on; 56 regulator-boot-on;
70 regulator-always-on; 57 regulator-always-on;
71 }; 58 };
72 59
73 ldo3_reg: regulator@5 { 60 ldo3_reg: ldo3 {
74 reg = <5>;
75 regulator-compatible = "ldo3";
76 regulator-min-microvolt = <1800000>; 61 regulator-min-microvolt = <1800000>;
77 regulator-max-microvolt = <3300000>; 62 regulator-max-microvolt = <3300000>;
78 regulator-boot-on; 63 regulator-boot-on;
79 regulator-always-on; 64 regulator-always-on;
80 }; 65 };
81 66
82 ldo4_reg: regulator@6 { 67 ldo4_reg: ldo4 {
83 reg = <6>;
84 regulator-compatible = "ldo4";
85 regulator-min-microvolt = <1800000>; 68 regulator-min-microvolt = <1800000>;
86 regulator-max-microvolt = <3300000>; 69 regulator-max-microvolt = <3300000>;
87 regulator-boot-on; 70 regulator-boot-on;
diff --git a/Documentation/devicetree/bindings/regulator/tps6586x.txt b/Documentation/devicetree/bindings/regulator/tps6586x.txt
index da80c2ae0915..8b40cac24d93 100644
--- a/Documentation/devicetree/bindings/regulator/tps6586x.txt
+++ b/Documentation/devicetree/bindings/regulator/tps6586x.txt
@@ -6,9 +6,13 @@ Required properties:
6- interrupts: the interrupt outputs of the controller 6- interrupts: the interrupt outputs of the controller
7- #gpio-cells: number of cells to describe a GPIO 7- #gpio-cells: number of cells to describe a GPIO
8- gpio-controller: mark the device as a GPIO controller 8- gpio-controller: mark the device as a GPIO controller
9- regulators: list of regulators provided by this controller, must have 9- regulators: A node that houses a sub-node for each regulator within the
10 property "regulator-compatible" to match their hardware counterparts: 10 device. Each sub-node is identified using the node's name (or the deprecated
11 sm[0-2], ldo[0-9] and ldo_rtc 11 regulator-compatible property if present), with valid values listed below.
12 The content of each sub-node is defined by the standard binding for
13 regulators; see regulator.txt.
14 sys, sm[0-2], ldo[0-9] and ldo_rtc
15- sys-supply: The input supply for SYS.
12- vin-sm0-supply: The input supply for the SM0. 16- vin-sm0-supply: The input supply for the SM0.
13- vin-sm1-supply: The input supply for the SM1. 17- vin-sm1-supply: The input supply for the SM1.
14- vin-sm2-supply: The input supply for the SM2. 18- vin-sm2-supply: The input supply for the SM2.
@@ -18,8 +22,15 @@ Required properties:
18- vinldo678-supply: The input supply for the LDO6, LDO7 and LDO8 22- vinldo678-supply: The input supply for the LDO6, LDO7 and LDO8
19- vinldo9-supply: The input supply for the LDO9 23- vinldo9-supply: The input supply for the LDO9
20 24
25Optional properties:
26- ti,system-power-controller: Telling whether or not this pmic is controlling
27 the system power.
28
21Each regulator is defined using the standard binding for regulators. 29Each regulator is defined using the standard binding for regulators.
22 30
31Note: LDO5 and LDO_RTC is supplied by SYS regulator internally and driver
32 take care of making proper parent child relationship.
33
23Example: 34Example:
24 35
25 pmu: tps6586x@34 { 36 pmu: tps6586x@34 {
@@ -30,6 +41,9 @@ Example:
30 #gpio-cells = <2>; 41 #gpio-cells = <2>;
31 gpio-controller; 42 gpio-controller;
32 43
44 ti,system-power-controller;
45
46 sys-supply = <&some_reg>;
33 vin-sm0-supply = <&some_reg>; 47 vin-sm0-supply = <&some_reg>;
34 vin-sm1-supply = <&some_reg>; 48 vin-sm1-supply = <&some_reg>;
35 vin-sm2-supply = <&some_reg>; 49 vin-sm2-supply = <&some_reg>;
@@ -40,103 +54,80 @@ Example:
40 vinldo9-supply = <...>; 54 vinldo9-supply = <...>;
41 55
42 regulators { 56 regulators {
43 #address-cells = <1>; 57 sys_reg: sys {
44 #size-cells = <0>; 58 regulator-name = "vdd_sys";
59 regulator-boot-on;
60 regulator-always-on;
61 };
45 62
46 sm0_reg: regulator@0 { 63 sm0_reg: sm0 {
47 reg = <0>;
48 regulator-compatible = "sm0";
49 regulator-min-microvolt = < 725000>; 64 regulator-min-microvolt = < 725000>;
50 regulator-max-microvolt = <1500000>; 65 regulator-max-microvolt = <1500000>;
51 regulator-boot-on; 66 regulator-boot-on;
52 regulator-always-on; 67 regulator-always-on;
53 }; 68 };
54 69
55 sm1_reg: regulator@1 { 70 sm1_reg: sm1 {
56 reg = <1>;
57 regulator-compatible = "sm1";
58 regulator-min-microvolt = < 725000>; 71 regulator-min-microvolt = < 725000>;
59 regulator-max-microvolt = <1500000>; 72 regulator-max-microvolt = <1500000>;
60 regulator-boot-on; 73 regulator-boot-on;
61 regulator-always-on; 74 regulator-always-on;
62 }; 75 };
63 76
64 sm2_reg: regulator@2 { 77 sm2_reg: sm2 {
65 reg = <2>;
66 regulator-compatible = "sm2";
67 regulator-min-microvolt = <3000000>; 78 regulator-min-microvolt = <3000000>;
68 regulator-max-microvolt = <4550000>; 79 regulator-max-microvolt = <4550000>;
69 regulator-boot-on; 80 regulator-boot-on;
70 regulator-always-on; 81 regulator-always-on;
71 }; 82 };
72 83
73 ldo0_reg: regulator@3 { 84 ldo0_reg: ldo0 {
74 reg = <3>;
75 regulator-compatible = "ldo0";
76 regulator-name = "PCIE CLK"; 85 regulator-name = "PCIE CLK";
77 regulator-min-microvolt = <3300000>; 86 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>; 87 regulator-max-microvolt = <3300000>;
79 }; 88 };
80 89
81 ldo1_reg: regulator@4 { 90 ldo1_reg: ldo1 {
82 reg = <4>;
83 regulator-compatible = "ldo1";
84 regulator-min-microvolt = < 725000>; 91 regulator-min-microvolt = < 725000>;
85 regulator-max-microvolt = <1500000>; 92 regulator-max-microvolt = <1500000>;
86 }; 93 };
87 94
88 ldo2_reg: regulator@5 { 95 ldo2_reg: ldo2 {
89 reg = <5>;
90 regulator-compatible = "ldo2";
91 regulator-min-microvolt = < 725000>; 96 regulator-min-microvolt = < 725000>;
92 regulator-max-microvolt = <1500000>; 97 regulator-max-microvolt = <1500000>;
93 }; 98 };
94 99
95 ldo3_reg: regulator@6 { 100 ldo3_reg: ldo3 {
96 reg = <6>;
97 regulator-compatible = "ldo3";
98 regulator-min-microvolt = <1250000>; 101 regulator-min-microvolt = <1250000>;
99 regulator-max-microvolt = <3300000>; 102 regulator-max-microvolt = <3300000>;
100 }; 103 };
101 104
102 ldo4_reg: regulator@7 { 105 ldo4_reg: ldo4 {
103 reg = <7>;
104 regulator-compatible = "ldo4";
105 regulator-min-microvolt = <1700000>; 106 regulator-min-microvolt = <1700000>;
106 regulator-max-microvolt = <2475000>; 107 regulator-max-microvolt = <2475000>;
107 }; 108 };
108 109
109 ldo5_reg: regulator@8 { 110 ldo5_reg: ldo5 {
110 reg = <8>;
111 regulator-compatible = "ldo5";
112 regulator-min-microvolt = <1250000>; 111 regulator-min-microvolt = <1250000>;
113 regulator-max-microvolt = <3300000>; 112 regulator-max-microvolt = <3300000>;
114 }; 113 };
115 114
116 ldo6_reg: regulator@9 { 115 ldo6_reg: ldo6 {
117 reg = <9>;
118 regulator-compatible = "ldo6";
119 regulator-min-microvolt = <1250000>; 116 regulator-min-microvolt = <1250000>;
120 regulator-max-microvolt = <3300000>; 117 regulator-max-microvolt = <3300000>;
121 }; 118 };
122 119
123 ldo7_reg: regulator@10 { 120 ldo7_reg: ldo7 {
124 reg = <10>;
125 regulator-compatible = "ldo7";
126 regulator-min-microvolt = <1250000>; 121 regulator-min-microvolt = <1250000>;
127 regulator-max-microvolt = <3300000>; 122 regulator-max-microvolt = <3300000>;
128 }; 123 };
129 124
130 ldo8_reg: regulator@11 { 125 ldo8_reg: ldo8 {
131 reg = <11>;
132 regulator-compatible = "ldo8";
133 regulator-min-microvolt = <1250000>; 126 regulator-min-microvolt = <1250000>;
134 regulator-max-microvolt = <3300000>; 127 regulator-max-microvolt = <3300000>;
135 }; 128 };
136 129
137 ldo9_reg: regulator@12 { 130 ldo9_reg: ldo9 {
138 reg = <12>;
139 regulator-compatible = "ldo9";
140 regulator-min-microvolt = <1250000>; 131 regulator-min-microvolt = <1250000>;
141 regulator-max-microvolt = <3300000>; 132 regulator-max-microvolt = <3300000>;
142 }; 133 };
diff --git a/Documentation/devicetree/bindings/rtc/pxa-rtc.txt b/Documentation/devicetree/bindings/rtc/pxa-rtc.txt
new file mode 100644
index 000000000000..8c6672a1b7d7
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/pxa-rtc.txt
@@ -0,0 +1,14 @@
1* PXA RTC
2
3PXA specific RTC driver.
4
5Required properties:
6- compatible : Should be "marvell,pxa-rtc"
7
8Examples:
9
10rtc@40900000 {
11 compatible = "marvell,pxa-rtc";
12 reg = <0x40900000 0x3c>;
13 interrupts = <30 31>;
14};
diff --git a/Documentation/devicetree/bindings/rtc/snvs-rtc.txt b/Documentation/devicetree/bindings/rtc/snvs-rtc.txt
new file mode 100644
index 000000000000..fb61ed77ada3
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/snvs-rtc.txt
@@ -0,0 +1 @@
See Documentation/devicetree/bindings/crypto/fsl-sec4.txt for details.
diff --git a/Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt b/Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt
new file mode 100644
index 000000000000..3c0484c49582
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt
@@ -0,0 +1,15 @@
1VIA/Wondermedia VT8500 Realtime Clock Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-rtc"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : alarm interrupt
8
9Example:
10
11 rtc@d8100000 {
12 compatible = "via,vt8500-rtc";
13 reg = <0xd8100000 0x10000>;
14 interrupts = <48>;
15 };
diff --git a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
new file mode 100644
index 000000000000..c58573b5b1a4
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
@@ -0,0 +1,35 @@
1* Freescale i.MX UART controller
2
3Required properties:
4- compatible : should be "fsl,imx21-uart"
5- reg : Address and length of the register set for the device
6- interrupts : Should contain UART interrupt number
7
8Optional properties:
9- fsl,uart-has-rtscts: indicate that RTS/CTS signals are used
10
11Note: Each uart controller should have an alias correctly numbered
12in "aliases" node.
13
14Example:
15
16- From imx51.dtsi:
17aliases {
18 serial0 = &uart1;
19 serial1 = &uart2;
20 serial2 = &uart3;
21};
22
23uart1: serial@73fbc000 {
24 compatible = "fsl,imx51-uart", "fsl,imx21-uart";
25 reg = <0x73fbc000 0x4000>;
26 interrupts = <31>;
27 status = "disabled";
28}
29
30- From imx51-babbage.dts:
31uart1: serial@73fbc000 {
32 fsl,uart-has-rtscts;
33 status = "okay";
34};
35
diff --git a/Documentation/devicetree/bindings/sound/cs4270.txt b/Documentation/devicetree/bindings/sound/cs4270.txt
new file mode 100644
index 000000000000..6b222f9b8ef5
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cs4270.txt
@@ -0,0 +1,21 @@
1CS4270 audio CODEC
2
3The driver for this device currently only supports I2C.
4
5Required properties:
6
7 - compatible : "cirrus,cs4270"
8
9 - reg : the I2C address of the device for I2C
10
11Optional properties:
12
13 - reset-gpio : a GPIO spec for the reset pin. If specified, it will be
14 deasserted before communication to the codec starts.
15
16Example:
17
18codec: cs4270@48 {
19 compatible = "cirrus,cs4270";
20 reg = <0x48>;
21};
diff --git a/Documentation/devicetree/bindings/sound/cs4271.txt b/Documentation/devicetree/bindings/sound/cs4271.txt
new file mode 100644
index 000000000000..c81b5fd5a5bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cs4271.txt
@@ -0,0 +1,36 @@
1Cirrus Logic CS4271 DT bindings
2
3This driver supports both the I2C and the SPI bus.
4
5Required properties:
6
7 - compatible: "cirrus,cs4271"
8
9For required properties on SPI, please consult
10Documentation/devicetree/bindings/spi/spi-bus.txt
11
12Required properties on I2C:
13
14 - reg: the i2c address
15
16
17Optional properties:
18
19 - reset-gpio: a GPIO spec to define which pin is connected to the chip's
20 !RESET pin
21
22Examples:
23
24 codec_i2c: cs4271@10 {
25 compatible = "cirrus,cs4271";
26 reg = <0x10>;
27 reset-gpio = <&gpio 23 0>;
28 };
29
30 codec_spi: cs4271@0 {
31 compatible = "cirrus,cs4271";
32 reg = <0x0>;
33 reset-gpio = <&gpio 23 0>;
34 spi-max-frequency = <6000000>;
35 };
36
diff --git a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
new file mode 100644
index 000000000000..374e145c2ef1
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
@@ -0,0 +1,45 @@
1Texas Instruments McASP controller
2
3Required properties:
4- compatible :
5 "ti,dm646x-mcasp-audio" : for DM646x platforms
6 "ti,da830-mcasp-audio" : for both DA830 & DA850 platforms
7 "ti,omap2-mcasp-audio" : for OMAP2 platforms (TI81xx, AM33xx)
8
9- reg : Should contain McASP registers offset and length
10- interrupts : Interrupt number for McASP
11- op-mode : I2S/DIT ops mode.
12- tdm-slots : Slots for TDM operation.
13- num-serializer : Serializers used by McASP.
14- serial-dir : A list of serializer pin mode. The list number should be equal
15 to "num-serializer" parameter. Each entry is a number indication
16 serializer pin direction. (0 - INACTIVE, 1 - TX, 2 - RX)
17
18
19Optional properties:
20
21- ti,hwmods : Must be "mcasp<n>", n is controller instance starting 0
22- tx-num-evt : FIFO levels.
23- rx-num-evt : FIFO levels.
24- sram-size-playback : size of sram to be allocated during playback
25- sram-size-capture : size of sram to be allocated during capture
26
27Example:
28
29mcasp0: mcasp0@1d00000 {
30 compatible = "ti,da830-mcasp-audio";
31 #address-cells = <1>;
32 #size-cells = <0>;
33 reg = <0x100000 0x3000>;
34 interrupts = <82 83>;
35 op-mode = <0>; /* MCASP_IIS_MODE */
36 tdm-slots = <2>;
37 num-serializer = <16>;
38 serial-dir = <
39 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */
40 0 0 0 0
41 0 0 0 1
42 2 0 0 0 >;
43 tx-num-evt = <1>;
44 rx-num-evt = <1>;
45};
diff --git a/Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt b/Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt
new file mode 100644
index 000000000000..65dec876cb2d
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt
@@ -0,0 +1,91 @@
1* Texas Instruments OMAP4+ and twl6040 based audio setups
2
3Required properties:
4- compatible: "ti,abe-twl6040"
5- ti,model: Name of the sound card ( for example "SDP4430")
6- ti,mclk-freq: MCLK frequency for HPPLL operation
7- ti,mcpdm: phandle for the McPDM node
8- ti,twl6040: phandle for the twl6040 core node
9- ti,audio-routing: List of connections between audio components.
10 Each entry is a pair of strings, the first being the connection's sink,
11 the second being the connection's source.
12
13Optional properties:
14- ti,dmic: phandle for the OMAP dmic node if the machine have it connected
15- ti,jack_detection: Need to be set to <1> if the board capable to detect jack
16 insertion, removal.
17
18Available audio endpoints for the audio-routing table:
19
20Board connectors:
21 * Headset Stereophone
22 * Earphone Spk
23 * Ext Spk
24 * Line Out
25 * Vibrator
26 * Headset Mic
27 * Main Handset Mic
28 * Sub Handset Mic
29 * Line In
30 * Digital Mic
31
32twl6040 pins:
33 * HSOL
34 * HSOR
35 * EP
36 * HFL
37 * HFR
38 * AUXL
39 * AUXR
40 * VIBRAL
41 * VIBRAR
42 * HSMIC
43 * MAINMIC
44 * SUBMIC
45 * AFML
46 * AFMR
47
48 * Headset Mic Bias
49 * Main Mic Bias
50 * Digital Mic1 Bias
51 * Digital Mic2 Bias
52
53Digital mic pins:
54 * DMic
55
56Example:
57
58sound {
59 compatible = "ti,abe-twl6040";
60 ti,model = "SDP4430";
61
62 ti,jack-detection = <1>;
63 ti,mclk-freq = <38400000>;
64
65 ti,mcpdm = <&mcpdm>;
66 ti,dmic = <&dmic>;
67
68 ti,twl6040 = <&twl6040>;
69
70 /* Audio routing */
71 ti,audio-routing =
72 "Headset Stereophone", "HSOL",
73 "Headset Stereophone", "HSOR",
74 "Earphone Spk", "EP",
75 "Ext Spk", "HFL",
76 "Ext Spk", "HFR",
77 "Line Out", "AUXL",
78 "Line Out", "AUXR",
79 "Vibrator", "VIBRAL",
80 "Vibrator", "VIBRAR",
81 "HSMIC", "Headset Mic",
82 "Headset Mic", "Headset Mic Bias",
83 "MAINMIC", "Main Handset Mic",
84 "Main Handset Mic", "Main Mic Bias",
85 "SUBMIC", "Sub Handset Mic",
86 "Sub Handset Mic", "Main Mic Bias",
87 "AFML", "Line In",
88 "AFMR", "Line In",
89 "DMic", "Digital Mic",
90 "Digital Mic", "Digital Mic1 Bias";
91};
diff --git a/Documentation/devicetree/bindings/sound/omap-mcbsp.txt b/Documentation/devicetree/bindings/sound/omap-mcbsp.txt
new file mode 100644
index 000000000000..17cce4490456
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/omap-mcbsp.txt
@@ -0,0 +1,37 @@
1* Texas Instruments OMAP2+ McBSP module
2
3Required properties:
4- compatible: "ti,omap2420-mcbsp" for McBSP on OMAP2420
5 "ti,omap2430-mcbsp" for McBSP on OMAP2430
6 "ti,omap3-mcbsp" for McBSP on OMAP3
7 "ti,omap4-mcbsp" for McBSP on OMAP4 and newer SoC
8- reg: Register location and size, for OMAP4+ as an array:
9 <MPU access base address, size>,
10 <L3 interconnect address, size>;
11- reg-names: Array of strings associated with the address space
12- interrupts: Interrupt numbers for the McBSP port, as an array in case the
13 McBSP IP have more interrupt lines:
14 <OCP compliant irq>,
15 <TX irq>,
16 <RX irq>;
17- interrupt-names: Array of strings associated with the interrupt numbers
18- interrupt-parent: The parent interrupt controller
19- ti,buffer-size: Size of the FIFO on the port (OMAP2430 and newer SoC)
20- ti,hwmods: Name of the hwmod associated to the McBSP port
21
22Example:
23
24mcbsp2: mcbsp@49022000 {
25 compatible = "ti,omap3-mcbsp";
26 reg = <0x49022000 0xff>,
27 <0x49028000 0xff>;
28 reg-names = "mpu", "sidetone";
29 interrupts = <0 17 0x4>, /* OCP compliant interrupt */
30 <0 62 0x4>, /* TX interrupt */
31 <0 63 0x4>, /* RX interrupt */
32 <0 4 0x4>; /* Sidetone */
33 interrupt-names = "common", "tx", "rx", "sidetone";
34 interrupt-parent = <&intc>;
35 ti,buffer-size = <1280>;
36 ti,hwmods = "mcbsp2";
37};
diff --git a/Documentation/devicetree/bindings/sound/omap-twl4030.txt b/Documentation/devicetree/bindings/sound/omap-twl4030.txt
new file mode 100644
index 000000000000..6fae51c7f766
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/omap-twl4030.txt
@@ -0,0 +1,17 @@
1* Texas Instruments SoC with twl4030 based audio setups
2
3Required properties:
4- compatible: "ti,omap-twl4030"
5- ti,model: Name of the sound card (for example "omap3beagle")
6- ti,mcbsp: phandle for the McBSP node
7- ti,codec: phandle for the twl4030 audio node
8
9Example:
10
11sound {
12 compatible = "ti,omap-twl4030";
13 ti,model = "omap3beagle";
14
15 ti,mcbsp = <&mcbsp2>;
16 ti,codec = <&twl_audio>;
17};
diff --git a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
new file mode 100644
index 000000000000..e7b98f41fa5f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
@@ -0,0 +1,20 @@
1Texas Instruments - tlv320aic3x Codec module
2
3The tlv320aic3x serial control bus communicates through I2C protocols
4
5Required properties:
6- compatible - "string" - "ti,tlv320aic3x"
7- reg - <int> - I2C slave address
8
9
10Optional properties:
11
12- gpio-reset - gpio pin number used for codec reset
13- ai3x-gpio-func - <array of 2 int> - AIC3X_GPIO1 & AIC3X_GPIO2 Functionality
14
15Example:
16
17tlv320aic3x: tlv320aic3x@1b {
18 compatible = "ti,tlv320aic3x";
19 reg = <0x1b>;
20};
diff --git a/Documentation/devicetree/bindings/sound/ux500-mop500.txt b/Documentation/devicetree/bindings/sound/ux500-mop500.txt
new file mode 100644
index 000000000000..48e071c96b46
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ux500-mop500.txt
@@ -0,0 +1,39 @@
1* MOP500 Audio Machine Driver
2
3This node is responsible for linking together all ux500 Audio Driver components.
4
5Required properties:
6 - compatible : "stericsson,snd-soc-mop500"
7
8Non-standard properties:
9 - stericsson,cpu-dai : Phandle to the CPU-side DAI
10 - stericsson,audio-codec : Phandle to the Audio CODEC
11 - stericsson,card-name : Over-ride default card name
12
13Example:
14
15 sound {
16 compatible = "stericsson,snd-soc-mop500";
17
18 stericsson,cpu-dai = <&msp1 &msp3>;
19 stericsson,audio-codec = <&codec>;
20 };
21
22 msp1: msp@80124000 {
23 compatible = "stericsson,ux500-msp-i2s";
24 reg = <0x80124000 0x1000>;
25 interrupts = <0 62 0x4>;
26 v-ape-supply = <&db8500_vape_reg>;
27 };
28
29 msp3: msp@80125000 {
30 compatible = "stericsson,ux500-msp-i2s";
31 reg = <0x80125000 0x1000>;
32 interrupts = <0 62 0x4>;
33 v-ape-supply = <&db8500_vape_reg>;
34 };
35
36 codec: ab8500-codec {
37 compatible = "stericsson,ab8500-codec";
38 stericsson,earpeice-cmv = <950>; /* Units in mV. */
39 };
diff --git a/Documentation/devicetree/bindings/sound/ux500-msp.txt b/Documentation/devicetree/bindings/sound/ux500-msp.txt
new file mode 100644
index 000000000000..99acd9c774e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ux500-msp.txt
@@ -0,0 +1,43 @@
1* ux500 MSP (CPU-side Digital Audio Interface)
2
3Required properties:
4 - compatible :"stericsson,ux500-msp-i2s"
5 - reg : Physical base address and length of the device's registers.
6
7Optional properties:
8 - interrupts : The interrupt output from the device.
9 - interrupt-parent : The parent interrupt controller.
10 - <name>-supply : Phandle to the regulator <name> supply
11
12Example:
13
14 sound {
15 compatible = "stericsson,snd-soc-mop500";
16
17 stericsson,platform-pcm-dma = <&pcm>;
18 stericsson,cpu-dai = <&msp1 &msp3>;
19 stericsson,audio-codec = <&codec>;
20 };
21
22 pcm: ux500-pcm {
23 compatible = "stericsson,ux500-pcm";
24 };
25
26 msp1: msp@80124000 {
27 compatible = "stericsson,ux500-msp-i2s";
28 reg = <0x80124000 0x1000>;
29 interrupts = <0 62 0x4>;
30 v-ape-supply = <&db8500_vape_reg>;
31 };
32
33 msp3: msp@80125000 {
34 compatible = "stericsson,ux500-msp-i2s";
35 reg = <0x80125000 0x1000>;
36 interrupts = <0 62 0x4>;
37 v-ape-supply = <&db8500_vape_reg>;
38 };
39
40 codec: ab8500-codec {
41 compatible = "stericsson,ab8500-codec";
42 stericsson,earpeice-cmv = <950>; /* Units in mV. */
43 };
diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.txt b/Documentation/devicetree/bindings/spi/mxs-spi.txt
new file mode 100644
index 000000000000..e2e13957c2a4
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/mxs-spi.txt
@@ -0,0 +1,22 @@
1* Freescale MX233/MX28 SSP/SPI
2
3Required properties:
4- compatible: Should be "fsl,<soc>-spi", where soc is "imx23" or "imx28"
5- reg: Offset and length of the register set for the device
6- interrupts: Should contain SSP interrupts (error irq first, dma irq second)
7- fsl,ssp-dma-channel: APBX DMA channel for the SSP
8
9Optional properties:
10- clock-frequency : Input clock frequency to the SPI block in Hz.
11 Default is 160000000 Hz.
12
13Example:
14
15ssp0: ssp@80010000 {
16 #address-cells = <1>;
17 #size-cells = <0>;
18 compatible = "fsl,imx28-spi";
19 reg = <0x80010000 0x2000>;
20 interrupts = <96 82>;
21 fsl,ssp-dma-channel = <0>;
22};
diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index e782add2e457..d2c33d0f533e 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -21,6 +21,9 @@ assumption that board specific platform code will be used to manage
21chip selects. Individual drivers can define additional properties to 21chip selects. Individual drivers can define additional properties to
22support describing the chip select layout. 22support describing the chip select layout.
23 23
24Optional property:
25- num-cs : total number of chipselects
26
24SPI slave nodes must be children of the SPI master node and can 27SPI slave nodes must be children of the SPI master node and can
25contain the following properties. 28contain the following properties.
26- reg - (required) chip select address of device. 29- reg - (required) chip select address of device.
diff --git a/Documentation/devicetree/bindings/spi/spi-gpio.txt b/Documentation/devicetree/bindings/spi/spi-gpio.txt
new file mode 100644
index 000000000000..8a824be15754
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-gpio.txt
@@ -0,0 +1,29 @@
1SPI-GPIO devicetree bindings
2
3Required properties:
4
5 - compatible: should be set to "spi-gpio"
6 - #address-cells: should be set to <0x1>
7 - ranges
8 - gpio-sck: GPIO spec for the SCK line to use
9 - gpio-miso: GPIO spec for the MISO line to use
10 - gpio-mosi: GPIO spec for the MOSI line to use
11 - cs-gpios: GPIOs to use for chipselect lines
12 - num-chipselects: number of chipselect lines
13
14Example:
15
16 spi {
17 compatible = "spi-gpio";
18 #address-cells = <0x1>;
19 ranges;
20
21 gpio-sck = <&gpio 95 0>;
22 gpio-miso = <&gpio 98 0>;
23 gpio-mosi = <&gpio 97 0>;
24 cs-gpios = <&gpio 125 0>;
25 num-chipselects = <1>;
26
27 /* clients */
28 };
29
diff --git a/Documentation/devicetree/bindings/spi/spi-sc18is602.txt b/Documentation/devicetree/bindings/spi/spi-sc18is602.txt
new file mode 100644
index 000000000000..02f9033270a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-sc18is602.txt
@@ -0,0 +1,23 @@
1NXP SC18IS602/SCIS603
2
3Required properties:
4 - compatible : Should be one of
5 "nxp,sc18is602"
6 "nxp,sc18is602b"
7 "nxp,sc18is603"
8 - reg: I2C bus address
9
10Optional properties:
11 - clock-frequency : external oscillator clock frequency. If not
12 specified, the SC18IS602 default frequency (7372000) will be used.
13
14The clock-frequency property is relevant and needed only if the chip has an
15external oscillator (SC18IS603).
16
17Example:
18
19 sc18is603@28 {
20 compatible = "nxp,sc18is603";
21 reg = <0x28>;
22 clock-frequency = <14744000>;
23 }
diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt
index 306ec3ff3c0e..f158fd31cfda 100644
--- a/Documentation/devicetree/bindings/spi/spi_pl022.txt
+++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt
@@ -6,7 +6,29 @@ Required properties:
6- interrupts : Should contain SPI controller interrupt 6- interrupts : Should contain SPI controller interrupt
7 7
8Optional properties: 8Optional properties:
9- num-cs : total number of chipselects
9- cs-gpios : should specify GPIOs used for chipselects. 10- cs-gpios : should specify GPIOs used for chipselects.
10 The gpios will be referred to as reg = <index> in the SPI child nodes. 11 The gpios will be referred to as reg = <index> in the SPI child nodes.
11 If unspecified, a single SPI device without a chip select can be used. 12 If unspecified, a single SPI device without a chip select can be used.
13- pl022,autosuspend-delay : delay in ms following transfer completion before
14 the runtime power management system suspends the
15 device. A setting of 0 indicates no delay and the
16 device will be suspended immediately
17- pl022,rt : indicates the controller should run the message pump with realtime
18 priority to minimise the transfer latency on the bus (boolean)
19
20
21SPI slave nodes must be children of the SPI master node and can
22contain the following properties.
23
24- pl022,interface : interface type:
25 0: SPI
26 1: Texas Instruments Synchronous Serial Frame Format
27 2: Microwire (Half Duplex)
28- pl022,com-mode : polling, interrupt or dma
29- pl022,rx-level-trig : Rx FIFO watermark level
30- pl022,tx-level-trig : Tx FIFO watermark level
31- pl022,ctrl-len : Microwire interface: Control length
32- pl022,wait-state : Microwire interface: Wait state
33- pl022,duplex : Microwire interface: Full/Half duplex
12 34
diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
new file mode 100644
index 000000000000..801d58cb6d4d
--- /dev/null
+++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
@@ -0,0 +1,15 @@
1* Freescale i.MX28 LRADC device driver
2
3Required properties:
4- compatible: Should be "fsl,imx28-lradc"
5- reg: Address and length of the register set for the device
6- interrupts: Should contain the LRADC interrupts
7
8Examples:
9
10 lradc@80050000 {
11 compatible = "fsl,imx28-lradc";
12 reg = <0x80050000 0x2000>;
13 interrupts = <10 14 15 16 17 18 19
14 20 21 22 23 24 25>;
15 };
diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
new file mode 100644
index 000000000000..07654f0338b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
@@ -0,0 +1,41 @@
1Freescale i.MX IPUv3
2====================
3
4Required properties:
5- compatible: Should be "fsl,<chip>-ipu"
6- reg: should be register base and length as documented in the
7 datasheet
8- interrupts: Should contain sync interrupt and error interrupt,
9 in this order.
10- #crtc-cells: 1, See below
11
12example:
13
14ipu: ipu@18000000 {
15 #crtc-cells = <1>;
16 compatible = "fsl,imx53-ipu";
17 reg = <0x18000000 0x080000000>;
18 interrupts = <11 10>;
19};
20
21Parallel display support
22========================
23
24Required properties:
25- compatible: Should be "fsl,imx-parallel-display"
26- crtc: the crtc this display is connected to, see below
27Optional properties:
28- interface_pix_fmt: How this display is connected to the
29 crtc. Currently supported types: "rgb24", "rgb565"
30- edid: verbatim EDID data block describing attached display.
31- ddc: phandle describing the i2c bus handling the display data
32 channel
33
34example:
35
36display@di0 {
37 compatible = "fsl,imx-parallel-display";
38 edid = [edid-data];
39 crtc = <&ipu 0>;
40 interface-pix-fmt = "rgb24";
41};
diff --git a/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt b/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt
new file mode 100644
index 000000000000..2de21c2acf55
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt
@@ -0,0 +1,22 @@
1BCM2835 System Timer
2
3The System Timer peripheral provides four 32-bit timer channels and a
4single 64-bit free running counter. Each channel has an output compare
5register, which is compared against the 32 least significant bits of the
6free running counter values, and generates an interrupt.
7
8Required properties:
9
10- compatible : should be "brcm,bcm2835-system-timer.txt"
11- reg : Specifies base physical address and size of the registers.
12- interrupts : A list of 4 interrupt sinks; one per timer channel.
13- clock-frequency : The frequency of the clock that drives the counter, in Hz.
14
15Example:
16
17timer {
18 compatible = "brcm,bcm2835-system-timer";
19 reg = <0x7e003000 0x1000>;
20 interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
21 clock-frequency = <1000000>;
22};
diff --git a/Documentation/devicetree/bindings/tty/serial/nxp-lpc32xx-hsuart.txt b/Documentation/devicetree/bindings/tty/serial/nxp-lpc32xx-hsuart.txt
new file mode 100644
index 000000000000..0d439dfc1aa5
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/nxp-lpc32xx-hsuart.txt
@@ -0,0 +1,14 @@
1* NXP LPC32xx SoC High Speed UART
2
3Required properties:
4- compatible: Should be "nxp,lpc3220-hsuart"
5- reg: Should contain registers location and length
6- interrupts: Should contain interrupt
7
8Example:
9
10 uart1: serial@40014000 {
11 compatible = "nxp,lpc3220-hsuart";
12 reg = <0x40014000 0x1000>;
13 interrupts = <26 0>;
14 };
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
index 0847fdeee11a..ba385f2e0ddc 100644
--- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
@@ -25,6 +25,8 @@ Optional properties:
25 accesses to the UART (e.g. TI davinci). 25 accesses to the UART (e.g. TI davinci).
26- used-by-rtas : set to indicate that the port is in use by the OpenFirmware 26- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
27 RTAS and should not be registered. 27 RTAS and should not be registered.
28- no-loopback-test: set to indicate that the port does not implements loopback
29 test mode
28 30
29Example: 31Example:
30 32
diff --git a/Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt b/Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt
new file mode 100644
index 000000000000..5feef1ef167d
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt
@@ -0,0 +1,17 @@
1VIA/Wondermedia VT8500 UART Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-uart"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : UART interrupt
8- clocks : phandle to the uart source clock (usually a 24Mhz fixed clock)
9
10Example:
11
12 uart@d8210000 {
13 compatible = "via,vt8500-uart";
14 reg = <0xd8210000 0x1040>;
15 interrupts = <47>;
16 clocks = <&ref24>;
17 };
diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
new file mode 100644
index 000000000000..ca8fa56e9f03
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -0,0 +1,14 @@
1AM33XX MUSB GLUE
2 - compatible : Should be "ti,musb-am33xx"
3 - ti,hwmods : must be "usb_otg_hs"
4 - multipoint : Should be "1" indicating the musb controller supports
5 multipoint. This is a MUSB configuration-specific setting.
6 - num_eps : Specifies the number of endpoints. This is also a
7 MUSB configuration-specific setting. Should be set to "16"
8 - ram_bits : Specifies the ram address size. Should be set to "12"
9 - port0_mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
10 represents PERIPHERAL.
11 - port1_mode : Should be "1" to represent HOST. "3" signifies OTG and "2"
12 represents PERIPHERAL.
13 - power : Should be "250". This signifies the controller can supply upto
14 500mA when operating in host mode.
diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
index 2c290418bb2d..5778b9c83bd8 100644
--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
@@ -7,7 +7,10 @@ Required properties:
7 7
8Optional properties: 8Optional properties:
9- fsl,usbphy: phandler of usb phy that connects to the only one port 9- fsl,usbphy: phandler of usb phy that connects to the only one port
10- fsl,usbmisc: phandler of non-core register device, with one argument
11 that indicate usb controller index
10- vbus-supply: regulator for vbus 12- vbus-supply: regulator for vbus
13- disable-over-current: disable over current detect
11 14
12Examples: 15Examples:
13usb@02184000 { /* USB OTG */ 16usb@02184000 { /* USB OTG */
@@ -15,4 +18,6 @@ usb@02184000 { /* USB OTG */
15 reg = <0x02184000 0x200>; 18 reg = <0x02184000 0x200>;
16 interrupts = <0 43 0x04>; 19 interrupts = <0 43 0x04>;
17 fsl,usbphy = <&usbphy1>; 20 fsl,usbphy = <&usbphy1>;
21 fsl,usbmisc = <&usbmisc 0>;
22 disable-over-current;
18}; 23};
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
new file mode 100644
index 000000000000..29a043ecda52
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -0,0 +1,33 @@
1OMAP GLUE
2
3OMAP MUSB GLUE
4 - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
5 - ti,hwmods : must be "usb_otg_hs"
6 - multipoint : Should be "1" indicating the musb controller supports
7 multipoint. This is a MUSB configuration-specific setting.
8 - num_eps : Specifies the number of endpoints. This is also a
9 MUSB configuration-specific setting. Should be set to "16"
10 - ram_bits : Specifies the ram address size. Should be set to "12"
11 - interface_type : This is a board specific setting to describe the type of
12 interface between the controller and the phy. It should be "0" or "1"
13 specifying ULPI and UTMI respectively.
14 - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
15 represents PERIPHERAL.
16 - power : Should be "50". This signifies the controller can supply upto
17 100mA when operating in host mode.
18
19SOC specific device node entry
20usb_otg_hs: usb_otg_hs@4a0ab000 {
21 compatible = "ti,omap4-musb";
22 ti,hwmods = "usb_otg_hs";
23 multipoint = <1>;
24 num_eps = <16>;
25 ram_bits = <12>;
26};
27
28Board specific device node entry
29&usb_otg_hs {
30 interface_type = <1>;
31 mode = <3>;
32 power = <50>;
33};
diff --git a/Documentation/devicetree/bindings/usb/platform-uhci.txt b/Documentation/devicetree/bindings/usb/platform-uhci.txt
new file mode 100644
index 000000000000..a4fb0719d157
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/platform-uhci.txt
@@ -0,0 +1,15 @@
1Generic Platform UHCI Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "platform-uhci"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : UHCI controller interrupt
8
9Example:
10
11 uhci@d8007b00 {
12 compatible = "platform-uhci";
13 reg = <0xd8007b00 0x200>;
14 interrupts = <43>;
15 };
diff --git a/Documentation/devicetree/bindings/usb/pxa-usb.txt b/Documentation/devicetree/bindings/usb/pxa-usb.txt
new file mode 100644
index 000000000000..79729a948d5a
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/pxa-usb.txt
@@ -0,0 +1,31 @@
1PXA USB controllers
2
3OHCI
4
5Required properties:
6 - compatible: Should be "marvell,pxa-ohci" for USB controllers
7 used in host mode.
8
9Optional properties:
10 - "marvell,enable-port1", "marvell,enable-port2", "marvell,enable-port3"
11 If present, enables the appropriate USB port of the controller.
12 - "marvell,port-mode" selects the mode of the ports:
13 1 = PMM_NPS_MODE
14 2 = PMM_GLOBAL_MODE
15 3 = PMM_PERPORT_MODE
16 - "marvell,power-sense-low" - power sense pin is low-active.
17 - "marvell,power-control-low" - power control pin is low-active.
18 - "marvell,no-oc-protection" - disable over-current protection.
19 - "marvell,oc-mode-perport" - enable per-port over-current protection.
20 - "marvell,power_on_delay" Power On to Power Good time - in ms.
21
22Example:
23
24 usb0: ohci@4c000000 {
25 compatible = "marvell,pxa-ohci", "usb-ohci";
26 reg = <0x4c000000 0x100000>;
27 interrupts = <18>;
28 marvell,enable-port1;
29 marvell,port-mode = <2>; /* PMM_GLOBAL_MODE */
30 };
31
diff --git a/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt b/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
new file mode 100644
index 000000000000..36b9aede3f40
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
@@ -0,0 +1,40 @@
1USB COMPARATOR OF TWL CHIPS
2
3TWL6030 USB COMPARATOR
4 - compatible : Should be "ti,twl6030-usb"
5 - interrupts : Two interrupt numbers to the cpu should be specified. First
6 interrupt number is the otg interrupt number that raises ID interrupts when
7 the controller has to act as host and the second interrupt number is the
8 usb interrupt number that raises VBUS interrupts when the controller has to
9 act as device
10 - usb-supply : phandle to the regulator device tree node. It should be vusb
11 if it is twl6030 or ldousb if it is twl6025 subclass.
12
13twl6030-usb {
14 compatible = "ti,twl6030-usb";
15 interrupts = < 4 10 >;
16};
17
18Board specific device node entry
19&twl6030-usb {
20 usb-supply = <&vusb>;
21};
22
23TWL4030 USB PHY AND COMPARATOR
24 - compatible : Should be "ti,twl4030-usb"
25 - interrupts : The interrupt numbers to the cpu should be specified. First
26 interrupt number is the otg interrupt number that raises ID interrupts
27 and VBUS interrupts. The second interrupt number is optional.
28 - <supply-name>-supply : phandle to the regulator device tree node.
29 <supply-name> should be vusb1v5, vusb1v8 and vusb3v1
30 - usb_mode : The mode used by the phy to connect to the controller. "1"
31 specifies "ULPI" mode and "2" specifies "CEA2011_3PIN" mode.
32
33twl4030-usb {
34 compatible = "ti,twl4030-usb";
35 interrupts = < 10 4 >;
36 usb1v5-supply = <&vusb1v5>;
37 usb1v8-supply = <&vusb1v8>;
38 usb3v1-supply = <&vusb3v1>;
39 usb_mode = <1>;
40};
diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
new file mode 100644
index 000000000000..80d4148cb661
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
@@ -0,0 +1,17 @@
1USB PHY
2
3OMAP USB2 PHY
4
5Required properties:
6 - compatible: Should be "ti,omap-usb2"
7 - reg : Address and length of the register set for the device. Also
8add the address of control module dev conf register until a driver for
9control module is added
10
11This is usually a subnode of ocp2scp to which it is connected.
12
13usb2phy@4a0ad080 {
14 compatible = "ti,omap-usb2";
15 reg = <0x4a0ad080 0x58>,
16 <0x4a002300 0x4>;
17};
diff --git a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt b/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
new file mode 100644
index 000000000000..97ce94e1a6cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
@@ -0,0 +1,14 @@
1* Freescale i.MX non-core registers
2
3Required properties:
4- #index-cells: Cells used to descibe usb controller index. Should be <1>
5- compatible: Should be one of below:
6 "fsl,imx6q-usbmisc" for imx6q
7- reg: Should contain registers location and length
8
9Examples:
10usbmisc@02184800 {
11 #index-cells = <1>;
12 compatible = "fsl,imx6q-usbmisc";
13 reg = <0x02184800 0x200>;
14};
diff --git a/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt b/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
new file mode 100644
index 000000000000..17b3ad1d97e7
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
@@ -0,0 +1,15 @@
1VIA/Wondermedia VT8500 EHCI Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-ehci"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : ehci controller interrupt
8
9Example:
10
11 ehci@d8007900 {
12 compatible = "via,vt8500-ehci";
13 reg = <0xd8007900 0x200>;
14 interrupts = <43>;
15 };
diff --git a/Documentation/devicetree/bindings/usb/vt8500-ehci.txt b/Documentation/devicetree/bindings/usb/vt8500-ehci.txt
new file mode 100644
index 000000000000..5fb8fd6e250c
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/vt8500-ehci.txt
@@ -0,0 +1,12 @@
1VIA VT8500 and Wondermedia WM8xxx SoC USB controllers.
2
3Required properties:
4 - compatible: Should be "via,vt8500-ehci" or "wm,prizm-ehci".
5 - reg: Address range of the ehci registers. size should be 0x200
6 - interrupts: Should contain the ehci interrupt.
7
8usb: ehci@D8007100 {
9 compatible = "wm,prizm-ehci", "usb-ehci";
10 reg = <0xD8007100 0x200>;
11 interrupts = <1>;
12};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index db4d3af3643c..9de2b9ff9d6e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -10,6 +10,7 @@ apm Applied Micro Circuits Corporation (APM)
10arm ARM Ltd. 10arm ARM Ltd.
11atmel Atmel Corporation 11atmel Atmel Corporation
12bosch Bosch Sensortec GmbH 12bosch Bosch Sensortec GmbH
13brcm Broadcom Corporation
13cavium Cavium, Inc. 14cavium Cavium, Inc.
14chrp Common Hardware Reference Platform 15chrp Common Hardware Reference Platform
15cortina Cortina Systems, Inc. 16cortina Cortina Systems, Inc.
@@ -47,5 +48,7 @@ sirf SiRF Technology, Inc.
47st STMicroelectronics 48st STMicroelectronics
48stericsson ST-Ericsson 49stericsson ST-Ericsson
49ti Texas Instruments 50ti Texas Instruments
51via VIA Technologies, Inc.
50wlf Wolfson Microelectronics 52wlf Wolfson Microelectronics
53wm Wondermedia Technologies, Inc.
51xlnx Xilinx 54xlnx Xilinx
diff --git a/Documentation/devicetree/bindings/video/backlight/88pm860x.txt b/Documentation/devicetree/bindings/video/backlight/88pm860x.txt
new file mode 100644
index 000000000000..261df2799315
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/88pm860x.txt
@@ -0,0 +1,15 @@
188pm860x-backlight bindings
2
3Optional properties:
4 - marvell,88pm860x-iset: Current supplies on backlight device.
5 - marvell,88pm860x-pwm: PWM frequency on backlight device.
6
7Example:
8
9 backlights {
10 backlight-0 {
11 marvell,88pm860x-iset = <4>;
12 marvell,88pm860x-pwm = <3>;
13 };
14 backlight-2 {
15 };
diff --git a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
new file mode 100644
index 000000000000..c870b6478ec8
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
@@ -0,0 +1,62 @@
1VIA VT8500 Framebuffer
2-----------------------------------------------------
3
4Required properties:
5- compatible : "via,vt8500-fb"
6- reg : Should contain 1 register ranges(address and length)
7- interrupts : framebuffer controller interrupt
8- display: a phandle pointing to the display node
9
10Required nodes:
11- display: a display node is required to initialize the lcd panel
12 This should be in the board dts.
13- default-mode: a videomode within the display with timing parameters
14 as specified below.
15
16Example:
17
18 fb@d800e400 {
19 compatible = "via,vt8500-fb";
20 reg = <0xd800e400 0x400>;
21 interrupts = <12>;
22 display = <&display>;
23 default-mode = <&mode0>;
24 };
25
26VIA VT8500 Display
27-----------------------------------------------------
28Required properties (as per of_videomode_helper):
29
30 - hactive, vactive: Display resolution
31 - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters
32 in pixels
33 vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in
34 lines
35 - clock: displayclock in Hz
36 - bpp: lcd panel bit-depth.
37 <16> for RGB565, <32> for RGB888
38
39Optional properties (as per of_videomode_helper):
40 - width-mm, height-mm: Display dimensions in mm
41 - hsync-active-high (bool): Hsync pulse is active high
42 - vsync-active-high (bool): Vsync pulse is active high
43 - interlaced (bool): This is an interlaced mode
44 - doublescan (bool): This is a doublescan mode
45
46Example:
47 display: display@0 {
48 modes {
49 mode0: mode@0 {
50 hactive = <800>;
51 vactive = <480>;
52 hback-porch = <88>;
53 hfront-porch = <40>;
54 hsync-len = <0>;
55 vback-porch = <32>;
56 vfront-porch = <11>;
57 vsync-len = <1>;
58 clock = <0>; /* unused but required */
59 bpp = <16>; /* non-standard but required */
60 };
61 };
62 };
diff --git a/Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt b/Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt
new file mode 100644
index 000000000000..a850fa011f02
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt
@@ -0,0 +1,13 @@
1VIA/Wondermedia Graphics Engine Controller
2-----------------------------------------------------
3
4Required properties:
5- compatible : "wm,prizm-ge-rops"
6- reg : Should contain 1 register ranges(address and length)
7
8Example:
9
10 ge_rops@d8050400 {
11 compatible = "wm,prizm-ge-rops";
12 reg = <0xd8050400 0x100>;
13 };
diff --git a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
new file mode 100644
index 000000000000..3d325e1d11ee
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
@@ -0,0 +1,23 @@
1Wondermedia WM8505 Framebuffer
2-----------------------------------------------------
3
4Required properties:
5- compatible : "wm,wm8505-fb"
6- reg : Should contain 1 register ranges(address and length)
7- via,display: a phandle pointing to the display node
8
9Required nodes:
10- display: a display node is required to initialize the lcd panel
11 This should be in the board dts. See definition in
12 Documentation/devicetree/bindings/video/via,vt8500-fb.txt
13- default-mode: a videomode node as specified in
14 Documentation/devicetree/bindings/video/via,vt8500-fb.txt
15
16Example:
17
18 fb@d8050800 {
19 compatible = "wm,wm8505-fb";
20 reg = <0xd8050800 0x200>;
21 display = <&display>;
22 default-mode = <&mode0>;
23 };
diff --git a/Documentation/devicetree/bindings/w1/w1-gpio.txt b/Documentation/devicetree/bindings/w1/w1-gpio.txt
new file mode 100644
index 000000000000..6e09c35d9f1a
--- /dev/null
+++ b/Documentation/devicetree/bindings/w1/w1-gpio.txt
@@ -0,0 +1,22 @@
1w1-gpio devicetree bindings
2
3Required properties:
4
5 - compatible: "w1-gpio"
6 - gpios: one or two GPIO specs:
7 - the first one is used as data I/O pin
8 - the second one is optional. If specified, it is used as
9 enable pin for an external pin pullup.
10
11Optional properties:
12
13 - linux,open-drain: if specified, the data pin is considered in
14 open-drain mode.
15
16Examples:
17
18 onewire@0 {
19 compatible = "w1-gpio";
20 gpios = <&gpio 126 0>, <&gpio 105 0>;
21 };
22
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 39462cf35cd4..74c25c8d8884 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -162,7 +162,6 @@ mach-types.h
162machtypes.h 162machtypes.h
163map 163map
164map_hugetlb 164map_hugetlb
165maui_boot.h
166media 165media
167mconf 166mconf
168miboot* 167miboot*
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb
index c4d963a67d6f..8eb92264ee04 100644
--- a/Documentation/dvb/README.dvb-usb
+++ b/Documentation/dvb/README.dvb-usb
@@ -30,7 +30,7 @@ with the device via the bus. The connection between the DVB-API-functionality
30is done via callbacks, assigned in a static device-description (struct 30is done via callbacks, assigned in a static device-description (struct
31dvb_usb_device) each device-driver has to have. 31dvb_usb_device) each device-driver has to have.
32 32
33For an example have a look in drivers/media/dvb/dvb-usb/vp7045*. 33For an example have a look in drivers/media/usb/dvb-usb/vp7045*.
34 34
35Objective is to migrate all the usb-devices (dibusb, cinergyT2, maybe the 35Objective is to migrate all the usb-devices (dibusb, cinergyT2, maybe the
36ttusb; flexcop-usb already benefits from the generic flexcop-device) to use 36ttusb; flexcop-usb already benefits from the generic flexcop-device) to use
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 12d3952e83d5..32bc56b13b1c 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -116,7 +116,7 @@ sub tda10045 {
116 116
117sub tda10046 { 117sub tda10046 {
118 my $sourcefile = "TT_PCI_2.19h_28_11_2006.zip"; 118 my $sourcefile = "TT_PCI_2.19h_28_11_2006.zip";
119 my $url = "http://www.tt-download.com/download/updates/219/$sourcefile"; 119 my $url = "http://technotrend.com.ua/download/software/219/$sourcefile";
120 my $hash = "6a7e1e2f2644b162ff0502367553c72d"; 120 my $hash = "6a7e1e2f2644b162ff0502367553c72d";
121 my $outfile = "dvb-fe-tda10046.fw"; 121 my $outfile = "dvb-fe-tda10046.fw";
122 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); 122 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
deleted file mode 100644
index f4d8c7105fcd..000000000000
--- a/Documentation/feature-removal-schedule.txt
+++ /dev/null
@@ -1,639 +0,0 @@
1The following is a list of files and features that are going to be
2removed in the kernel source tree. Every entry should contain what
3exactly is going away, why it is happening, and who is going to be doing
4the work. When the feature is removed from the kernel, it should also
5be removed from this file. The suggested deprecation period is 3 releases.
6
7---------------------------
8
9What: ddebug_query="query" boot cmdline param
10When: v3.8
11Why: obsoleted by dyndbg="query" and module.dyndbg="query"
12Who: Jim Cromie <jim.cromie@gmail.com>, Jason Baron <jbaron@redhat.com>
13
14---------------------------
15
16What: /proc/sys/vm/nr_pdflush_threads
17When: 2012
18Why: Since pdflush is deprecated, the interface exported in /proc/sys/vm/
19 should be removed.
20Who: Wanpeng Li <liwp@linux.vnet.ibm.com>
21
22---------------------------
23
24What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
25When: 2012
26Why: This optional sub-feature of APM is of dubious reliability,
27 and ancient APM laptops are likely better served by calling HLT.
28 Deleting CONFIG_APM_CPU_IDLE allows x86 to stop exporting
29 the pm_idle function pointer to modules.
30Who: Len Brown <len.brown@intel.com>
31
32----------------------------
33
34What: x86_32 "no-hlt" cmdline param
35When: 2012
36Why: remove a branch from idle path, simplify code used by everybody.
37 This option disabled the use of HLT in idle and machine_halt()
38 for hardware that was flakey 15-years ago. Today we have
39 "idle=poll" that removed HLT from idle, and so if such a machine
40 is still running the upstream kernel, "idle=poll" is likely sufficient.
41Who: Len Brown <len.brown@intel.com>
42
43----------------------------
44
45What: x86 "idle=mwait" cmdline param
46When: 2012
47Why: simplify x86 idle code
48Who: Len Brown <len.brown@intel.com>
49
50----------------------------
51
52What: PRISM54
53When: 2.6.34
54
55Why: prism54 FullMAC PCI / Cardbus devices used to be supported only by the
56 prism54 wireless driver. After Intersil stopped selling these
57 devices in preference for the newer more flexible SoftMAC devices
58 a SoftMAC device driver was required and prism54 did not support
59 them. The p54pci driver now exists and has been present in the kernel for
60 a while. This driver supports both SoftMAC devices and FullMAC devices.
61 The main difference between these devices was the amount of memory which
62 could be used for the firmware. The SoftMAC devices support a smaller
63 amount of memory. Because of this the SoftMAC firmware fits into FullMAC
64 devices's memory. p54pci supports not only PCI / Cardbus but also USB
65 and SPI. Since p54pci supports all devices prism54 supports
66 you will have a conflict. I'm not quite sure how distributions are
67 handling this conflict right now. prism54 was kept around due to
68 claims users may experience issues when using the SoftMAC driver.
69 Time has passed users have not reported issues. If you use prism54
70 and for whatever reason you cannot use p54pci please let us know!
71 E-mail us at: linux-wireless@vger.kernel.org
72
73 For more information see the p54 wiki page:
74
75 http://wireless.kernel.org/en/users/Drivers/p54
76
77Who: Luis R. Rodriguez <lrodriguez@atheros.com>
78
79---------------------------
80
81What: The ieee80211_regdom module parameter
82When: March 2010 / desktop catchup
83
84Why: This was inherited by the CONFIG_WIRELESS_OLD_REGULATORY code,
85 and currently serves as an option for users to define an
86 ISO / IEC 3166 alpha2 code for the country they are currently
87 present in. Although there are userspace API replacements for this
88 through nl80211 distributions haven't yet caught up with implementing
89 decent alternatives through standard GUIs. Although available as an
90 option through iw or wpa_supplicant its just a matter of time before
91 distributions pick up good GUI options for this. The ideal solution
92 would actually consist of intelligent designs which would do this for
93 the user automatically even when travelling through different countries.
94 Until then we leave this module parameter as a compromise.
95
96 When userspace improves with reasonable widely-available alternatives for
97 this we will no longer need this module parameter. This entry hopes that
98 by the super-futuristically looking date of "March 2010" we will have
99 such replacements widely available.
100
101Who: Luis R. Rodriguez <lrodriguez@atheros.com>
102
103---------------------------
104
105What: dev->power.power_state
106When: July 2007
107Why: Broken design for runtime control over driver power states, confusing
108 driver-internal runtime power management with: mechanisms to support
109 system-wide sleep state transitions; event codes that distinguish
110 different phases of swsusp "sleep" transitions; and userspace policy
111 inputs. This framework was never widely used, and most attempts to
112 use it were broken. Drivers should instead be exposing domain-specific
113 interfaces either to kernel or to userspace.
114Who: Pavel Machek <pavel@ucw.cz>
115
116---------------------------
117
118What: /proc/<pid>/oom_adj
119When: August 2012
120Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's
121 badness heuristic used to determine which task to kill when the kernel
122 is out of memory.
123
124 The badness heuristic has since been rewritten since the introduction of
125 this tunable such that its meaning is deprecated. The value was
126 implemented as a bitshift on a score generated by the badness()
127 function that did not have any precise units of measure. With the
128 rewrite, the score is given as a proportion of available memory to the
129 task allocating pages, so using a bitshift which grows the score
130 exponentially is, thus, impossible to tune with fine granularity.
131
132 A much more powerful interface, /proc/<pid>/oom_score_adj, was
133 introduced with the oom killer rewrite that allows users to increase or
134 decrease the badness score linearly. This interface will replace
135 /proc/<pid>/oom_adj.
136
137 A warning will be emitted to the kernel log if an application uses this
138 deprecated interface. After it is printed once, future warnings will be
139 suppressed until the kernel is rebooted.
140
141---------------------------
142
143What: remove EXPORT_SYMBOL(kernel_thread)
144When: August 2006
145Files: arch/*/kernel/*_ksyms.c
146Check: kernel_thread
147Why: kernel_thread is a low-level implementation detail. Drivers should
148 use the <linux/kthread.h> API instead which shields them from
149 implementation details and provides a higherlevel interface that
150 prevents bugs and code duplication
151Who: Christoph Hellwig <hch@lst.de>
152
153---------------------------
154
155What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports
156 (temporary transition config option provided until then)
157 The transition config option will also be removed at the same time.
158When: before 2.6.19
159Why: Unused symbols are both increasing the size of the kernel binary
160 and are often a sign of "wrong API"
161Who: Arjan van de Ven <arjan@linux.intel.com>
162
163---------------------------
164
165What: PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment
166When: October 2008
167Why: The stacking of class devices makes these values misleading and
168 inconsistent.
169 Class devices should not carry any of these properties, and bus
170 devices have SUBSYTEM and DRIVER as a replacement.
171Who: Kay Sievers <kay.sievers@suse.de>
172
173---------------------------
174
175What: ACPI procfs interface
176When: July 2008
177Why: ACPI sysfs conversion should be finished by January 2008.
178 ACPI procfs interface will be removed in July 2008 so that
179 there is enough time for the user space to catch up.
180Who: Zhang Rui <rui.zhang@intel.com>
181
182---------------------------
183
184What: CONFIG_ACPI_PROCFS_POWER
185When: 2.6.39
186Why: sysfs I/F for ACPI power devices, including AC and Battery,
187 has been working in upstream kernel since 2.6.24, Sep 2007.
188 In 2.6.37, we make the sysfs I/F always built in and this option
189 disabled by default.
190 Remove this option and the ACPI power procfs interface in 2.6.39.
191Who: Zhang Rui <rui.zhang@intel.com>
192
193---------------------------
194
195What: /proc/acpi/event
196When: February 2008
197Why: /proc/acpi/event has been replaced by events via the input layer
198 and netlink since 2.6.23.
199Who: Len Brown <len.brown@intel.com>
200
201---------------------------
202
203What: i386/x86_64 bzImage symlinks
204When: April 2010
205
206Why: The i386/x86_64 merge provides a symlink to the old bzImage
207 location so not yet updated user space tools, e.g. package
208 scripts, do not break.
209Who: Thomas Gleixner <tglx@linutronix.de>
210
211---------------------------
212
213What: GPIO autorequest on gpio_direction_{input,output}() in gpiolib
214When: February 2010
215Why: All callers should use explicit gpio_request()/gpio_free().
216 The autorequest mechanism in gpiolib was provided mostly as a
217 migration aid for legacy GPIO interfaces (for SOC based GPIOs).
218 Those users have now largely migrated. Platforms implementing
219 the GPIO interfaces without using gpiolib will see no changes.
220Who: David Brownell <dbrownell@users.sourceforge.net>
221---------------------------
222
223What: b43 support for firmware revision < 410
224When: The schedule was July 2008, but it was decided that we are going to keep the
225 code as long as there are no major maintanance headaches.
226 So it _could_ be removed _any_ time now, if it conflicts with something new.
227Why: The support code for the old firmware hurts code readability/maintainability
228 and slightly hurts runtime performance. Bugfixes for the old firmware
229 are not provided by Broadcom anymore.
230Who: Michael Buesch <m@bues.ch>
231
232---------------------------
233
234What: Ability for non root users to shm_get hugetlb pages based on mlock
235 resource limits
236When: 2.6.31
237Why: Non root users need to be part of /proc/sys/vm/hugetlb_shm_group or
238 have CAP_IPC_LOCK to be able to allocate shm segments backed by
239 huge pages. The mlock based rlimit check to allow shm hugetlb is
240 inconsistent with mmap based allocations. Hence it is being
241 deprecated.
242Who: Ravikiran Thirumalai <kiran@scalex86.org>
243
244---------------------------
245
246What: sysfs ui for changing p4-clockmod parameters
247When: September 2009
248Why: See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and
249 e088e4c9cdb618675874becb91b2fd581ee707e6.
250 Removal is subject to fixing any remaining bugs in ACPI which may
251 cause the thermal throttling not to happen at the right time.
252Who: Dave Jones <davej@redhat.com>, Matthew Garrett <mjg@redhat.com>
253
254-----------------------------
255
256What: fakephp and associated sysfs files in /sys/bus/pci/slots/
257When: 2011
258Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
259 represent a machine's physical PCI slots. The change in semantics
260 had userspace implications, as the hotplug core no longer allowed
261 drivers to create multiple sysfs files per physical slot (required
262 for multi-function devices, e.g.). fakephp was seen as a developer's
263 tool only, and its interface changed. Too late, we learned that
264 there were some users of the fakephp interface.
265
266 In 2.6.30, the original fakephp interface was restored. At the same
267 time, the PCI core gained the ability that fakephp provided, namely
268 function-level hot-remove and hot-add.
269
270 Since the PCI core now provides the same functionality, exposed in:
271
272 /sys/bus/pci/rescan
273 /sys/bus/pci/devices/.../remove
274 /sys/bus/pci/devices/.../rescan
275
276 there is no functional reason to maintain fakephp as well.
277
278 We will keep the existing module so that 'modprobe fakephp' will
279 present the old /sys/bus/pci/slots/... interface for compatibility,
280 but users are urged to migrate their applications to the API above.
281
282 After a reasonable transition period, we will remove the legacy
283 fakephp interface.
284Who: Alex Chiang <achiang@hp.com>
285
286---------------------------
287
288What: CONFIG_RFKILL_INPUT
289When: 2.6.33
290Why: Should be implemented in userspace, policy daemon.
291Who: Johannes Berg <johannes@sipsolutions.net>
292
293----------------------------
294
295What: sound-slot/service-* module aliases and related clutters in
296 sound/sound_core.c
297When: August 2010
298Why: OSS sound_core grabs all legacy minors (0-255) of SOUND_MAJOR
299 (14) and requests modules using custom sound-slot/service-*
300 module aliases. The only benefit of doing this is allowing
301 use of custom module aliases which might as well be considered
302 a bug at this point. This preemptive claiming prevents
303 alternative OSS implementations.
304
305 Till the feature is removed, the kernel will be requesting
306 both sound-slot/service-* and the standard char-major-* module
307 aliases and allow turning off the pre-claiming selectively via
308 CONFIG_SOUND_OSS_CORE_PRECLAIM and soundcore.preclaim_oss
309 kernel parameter.
310
311 After the transition phase is complete, both the custom module
312 aliases and switches to disable it will go away. This removal
313 will also allow making ALSA OSS emulation independent of
314 sound_core. The dependency will be broken then too.
315Who: Tejun Heo <tj@kernel.org>
316
317----------------------------
318
319What: sysfs-class-rfkill state file
320When: Feb 2014
321Files: net/rfkill/core.c
322Why: Documented as obsolete since Feb 2010. This file is limited to 3
323 states while the rfkill drivers can have 4 states.
324Who: anybody or Florian Mickler <florian@mickler.org>
325
326----------------------------
327
328What: sysfs-class-rfkill claim file
329When: Feb 2012
330Files: net/rfkill/core.c
331Why: It is not possible to claim an rfkill driver since 2007. This is
332 Documented as obsolete since Feb 2010.
333Who: anybody or Florian Mickler <florian@mickler.org>
334
335----------------------------
336
337What: iwlwifi 50XX module parameters
338When: 3.0
339Why: The "..50" modules parameters were used to configure 5000 series and
340 up devices; different set of module parameters also available for 4965
341 with same functionalities. Consolidate both set into single place
342 in drivers/net/wireless/iwlwifi/iwl-agn.c
343
344Who: Wey-Yi Guy <wey-yi.w.guy@intel.com>
345
346----------------------------
347
348What: iwl4965 alias support
349When: 3.0
350Why: Internal alias support has been present in module-init-tools for some
351 time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed
352 with no impact.
353
354Who: Wey-Yi Guy <wey-yi.w.guy@intel.com>
355
356---------------------------
357
358What: xt_NOTRACK
359Files: net/netfilter/xt_NOTRACK.c
360When: April 2011
361Why: Superseded by xt_CT
362Who: Netfilter developer team <netfilter-devel@vger.kernel.org>
363
364----------------------------
365
366What: IRQF_DISABLED
367When: 2.6.36
368Why: The flag is a NOOP as we run interrupt handlers with interrupts disabled
369Who: Thomas Gleixner <tglx@linutronix.de>
370
371----------------------------
372
373What: PCI DMA unmap state API
374When: August 2012
375Why: PCI DMA unmap state API (include/linux/pci-dma.h) was replaced
376 with DMA unmap state API (DMA unmap state API can be used for
377 any bus).
378Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
379
380----------------------------
381
382What: iwlwifi disable_hw_scan module parameters
383When: 3.0
384Why: Hareware scan is the prefer method for iwlwifi devices for
385 scanning operation. Remove software scan support for all the
386 iwlwifi devices.
387
388Who: Wey-Yi Guy <wey-yi.w.guy@intel.com>
389
390----------------------------
391
392What: Legacy, non-standard chassis intrusion detection interface.
393When: June 2011
394Why: The adm9240, w83792d and w83793 hardware monitoring drivers have
395 legacy interfaces for chassis intrusion detection. A standard
396 interface has been added to each driver, so the legacy interface
397 can be removed.
398Who: Jean Delvare <khali@linux-fr.org>
399
400----------------------------
401
402What: i2c_driver.attach_adapter
403 i2c_driver.detach_adapter
404When: September 2011
405Why: These legacy callbacks should no longer be used as i2c-core offers
406 a variety of preferable alternative ways to instantiate I2C devices.
407Who: Jean Delvare <khali@linux-fr.org>
408
409----------------------------
410
411What: Opening a radio device node will no longer automatically switch the
412 tuner mode from tv to radio.
413When: 3.3
414Why: Just opening a V4L device should not change the state of the hardware
415 like that. It's very unexpected and against the V4L spec. Instead, you
416 switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second
417 and last step of the move to consistent handling of tv and radio tuners.
418Who: Hans Verkuil <hans.verkuil@cisco.com>
419
420----------------------------
421
422What: CONFIG_CFG80211_WEXT
423When: as soon as distributions ship new wireless tools, ie. wpa_supplicant 1.0
424 and NetworkManager/connman/etc. that are able to use nl80211
425Why: Wireless extensions are deprecated, and userland tools are moving to
426 using nl80211. New drivers are no longer using wireless extensions,
427 and while there might still be old drivers, both new drivers and new
428 userland no longer needs them and they can't be used for an feature
429 developed in the past couple of years. As such, compatibility with
430 wireless extensions in new drivers will be removed.
431Who: Johannes Berg <johannes@sipsolutions.net>
432
433----------------------------
434
435What: g_file_storage driver
436When: 3.8
437Why: This driver has been superseded by g_mass_storage.
438Who: Alan Stern <stern@rowland.harvard.edu>
439
440----------------------------
441
442What: threeg and interface sysfs files in /sys/devices/platform/acer-wmi
443When: 2012
444Why: In 3.0, we can now autodetect internal 3G device and already have
445 the threeg rfkill device. So, we plan to remove threeg sysfs support
446 for it's no longer necessary.
447
448 We also plan to remove interface sysfs file that exposed which ACPI-WMI
449 interface that was used by acer-wmi driver. It will replaced by
450 information log when acer-wmi initial.
451Who: Lee, Chun-Yi <jlee@novell.com>
452
453---------------------------
454
455What: /sys/devices/platform/_UDC_/udc/_UDC_/is_dualspeed file and
456 is_dualspeed line in /sys/devices/platform/ci13xxx_*/udc/device file.
457When: 3.8
458Why: The is_dualspeed file is superseded by maximum_speed in the same
459 directory and is_dualspeed line in device file is superseded by
460 max_speed line in the same file.
461
462 The maximum_speed/max_speed specifies maximum speed supported by UDC.
463 To check if dualspeeed is supported, check if the value is >= 3.
464 Various possible speeds are defined in <linux/usb/ch9.h>.
465Who: Michal Nazarewicz <mina86@mina86.com>
466
467----------------------------
468
469What: The XFS nodelaylog mount option
470When: 3.3
471Why: The delaylog mode that has been the default since 2.6.39 has proven
472 stable, and the old code is in the way of additional improvements in
473 the log code.
474Who: Christoph Hellwig <hch@lst.de>
475
476----------------------------
477
478What: iwlagn alias support
479When: 3.5
480Why: The iwlagn module has been renamed iwlwifi. The alias will be around
481 for backward compatibility for several cycles and then dropped.
482Who: Don Fry <donald.h.fry@intel.com>
483
484----------------------------
485
486What: pci_scan_bus_parented()
487When: 3.5
488Why: The pci_scan_bus_parented() interface creates a new root bus. The
489 bus is created with default resources (ioport_resource and
490 iomem_resource) that are always wrong, so we rely on arch code to
491 correct them later. Callers of pci_scan_bus_parented() should
492 convert to using pci_scan_root_bus() so they can supply a list of
493 bus resources when the bus is created.
494Who: Bjorn Helgaas <bhelgaas@google.com>
495
496----------------------------
497
498What: Low Performance USB Block driver ("CONFIG_BLK_DEV_UB")
499When: 3.6
500Why: This driver provides support for USB storage devices like "USB
501 sticks". As of now, it is deactivated in Debian, Fedora and
502 Ubuntu. All current users can switch over to usb-storage
503 (CONFIG_USB_STORAGE) which only drawback is the additional SCSI
504 stack.
505Who: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
506
507----------------------------
508
509What: get_robust_list syscall
510When: 2013
511Why: There appear to be no production users of the get_robust_list syscall,
512 and it runs the risk of leaking address locations, allowing the bypass
513 of ASLR. It was only ever intended for debugging, so it should be
514 removed.
515Who: Kees Cook <keescook@chromium.org>
516
517----------------------------
518
519What: Removing the pn544 raw driver.
520When: 3.6
521Why: With the introduction of the NFC HCI and SHDL kernel layers, pn544.c
522 is being replaced by pn544_hci.c which is accessible through the netlink
523 and socket NFC APIs. Moreover, pn544.c is outdated and does not seem to
524 work properly with the latest Android stacks.
525 Having 2 drivers for the same hardware is confusing and as such we
526 should only keep the one following the kernel NFC APIs.
527Who: Samuel Ortiz <sameo@linux.intel.com>
528
529----------------------------
530
531What: setitimer accepts user NULL pointer (value)
532When: 3.6
533Why: setitimer is not returning -EFAULT if user pointer is NULL. This
534 violates the spec.
535Who: Sasikantha Babu <sasikanth.v19@gmail.com>
536
537----------------------------
538
539What: remove bogus DV presets V4L2_DV_1080I29_97, V4L2_DV_1080I30 and
540 V4L2_DV_1080I25
541When: 3.6
542Why: These HDTV formats do not exist and were added by a confused mind
543 (that was me, to be precise...)
544Who: Hans Verkuil <hans.verkuil@cisco.com>
545
546----------------------------
547
548What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls
549When: 3.7
550Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated
551 for about 4 years and they are not used by any mainline driver.
552 There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide
553 similar functionality.
554Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
555
556----------------------------
557
558What: cgroup option updates via remount
559When: March 2013
560Why: Remount currently allows changing bound subsystems and
561 release_agent. Rebinding is hardly useful as it only works
562 when the hierarchy is empty and release_agent itself should be
563 replaced with conventional fsnotify.
564
565----------------------------
566
567What: xt_recent rev 0
568When: 2013
569Who: Pablo Neira Ayuso <pablo@netfilter.org>
570Files: net/netfilter/xt_recent.c
571
572----------------------------
573
574What: KVM debugfs statistics
575When: 2013
576Why: KVM tracepoints provide mostly equivalent information in a much more
577 flexible fashion.
578
579----------------------------
580
581What: at91-mci driver ("CONFIG_MMC_AT91")
582When: 3.8
583Why: There are two mci drivers: at91-mci and atmel-mci. The PDC support
584 was added to atmel-mci as a first step to support more chips.
585 Then at91-mci was kept only for old IP versions (on at91rm9200 and
586 at91sam9261). The support of these IP versions has just been added
587 to atmel-mci, so atmel-mci can be used for all chips.
588Who: Ludovic Desroches <ludovic.desroches@atmel.com>
589
590----------------------------
591
592What: net/wanrouter/
593When: June 2013
594Why: Unsupported/unmaintained/unused since 2.6
595
596----------------------------
597
598What: V4L2 selections API target rectangle and flags unification, the
599 following definitions will be removed: V4L2_SEL_TGT_CROP_ACTIVE,
600 V4L2_SEL_TGT_COMPOSE_ACTIVE, V4L2_SUBDEV_SEL_*, V4L2_SUBDEV_SEL_FLAG_*
601 in favor of common V4L2_SEL_TGT_* and V4L2_SEL_FLAG_* definitions.
602 For more details see include/linux/v4l2-common.h.
603When: 3.8
604Why: The regular V4L2 selections and the subdev selection API originally
605 defined distinct names for the target rectangles and flags - V4L2_SEL_*
606 and V4L2_SUBDEV_SEL_*. Although, it turned out that the meaning of these
607 target rectangles is virtually identical and the APIs were consolidated
608 to use single set of names - V4L2_SEL_*. This didn't involve any ABI
609 changes. Alias definitions were created for the original ones to avoid
610 any instabilities in the user space interface. After few cycles these
611 backward compatibility definitions will be removed.
612Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
613
614----------------------------
615
616What: Using V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT flags
617 to indicate a V4L2 memory-to-memory device capability
618When: 3.8
619Why: New drivers should use new V4L2_CAP_VIDEO_M2M capability flag
620 to indicate a V4L2 video memory-to-memory (M2M) device and
621 applications can now identify a M2M video device by checking
622 for V4L2_CAP_VIDEO_M2M, with VIDIOC_QUERYCAP ioctl. Using ORed
623 V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT flags for M2M
624 devices is ambiguous and may lead, for example, to identifying
625 a M2M device as a video capture or output device.
626Who: Sylwester Nawrocki <s.nawrocki@samsung.com>
627
628----------------------------
629
630What: OMAP private DMA implementation
631When: 2013
632Why: We have a DMA engine implementation; all users should be updated
633 to use this rather than persisting with the old APIs. The old APIs
634 block merging the old DMA engine implementation into the DMA
635 engine driver.
636Who: Russell King <linux@arm.linux.org.uk>,
637 Santosh Shilimkar <santosh.shilimkar@ti.com>
638
639----------------------------
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt
index 7a34f827989c..3a863f692728 100644
--- a/Documentation/filesystems/debugfs.txt
+++ b/Documentation/filesystems/debugfs.txt
@@ -15,8 +15,8 @@ Debugfs is typically mounted with a command like:
15 mount -t debugfs none /sys/kernel/debug 15 mount -t debugfs none /sys/kernel/debug
16 16
17(Or an equivalent /etc/fstab line). 17(Or an equivalent /etc/fstab line).
18The debugfs root directory is accessible by anyone by default. To 18The debugfs root directory is accessible only to the root user by
19restrict access to the tree the "uid", "gid" and "mode" mount 19default. To change access to the tree the "uid", "gid" and "mode" mount
20options can be used. 20options can be used.
21 21
22Note that the debugfs API is exported GPL-only to modules. 22Note that the debugfs API is exported GPL-only to modules.
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 1b7f9acbcbbe..104322bf378c 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -375,6 +375,16 @@ dioread_nolock locking. If the dioread_nolock option is specified
375 Because of the restrictions this options comprises 375 Because of the restrictions this options comprises
376 it is off by default (e.g. dioread_lock). 376 it is off by default (e.g. dioread_lock).
377 377
378max_dir_size_kb=n This limits the size of directories so that any
379 attempt to expand them beyond the specified
380 limit in kilobytes will cause an ENOSPC error.
381 This is useful in memory constrained
382 environments, where a very large directory can
383 cause severe performance problems or even
384 provoke the Out Of Memory killer. (For example,
385 if there is only 512mb memory available, a 176mb
386 directory may seriously cramp the system's style.)
387
378i_version Enable 64-bit inode version support. This option is 388i_version Enable 64-bit inode version support. This option is
379 off by default. 389 off by default.
380 390
diff --git a/Documentation/filesystems/jfs.txt b/Documentation/filesystems/jfs.txt
index 26ebde77e821..f7433355394a 100644
--- a/Documentation/filesystems/jfs.txt
+++ b/Documentation/filesystems/jfs.txt
@@ -3,6 +3,7 @@ IBM's Journaled File System (JFS) for Linux
3JFS Homepage: http://jfs.sourceforge.net/ 3JFS Homepage: http://jfs.sourceforge.net/
4 4
5The following mount options are supported: 5The following mount options are supported:
6(*) == default
6 7
7iocharset=name Character set to use for converting from Unicode to 8iocharset=name Character set to use for converting from Unicode to
8 ASCII. The default is to do no conversion. Use 9 ASCII. The default is to do no conversion. Use
@@ -21,12 +22,12 @@ nointegrity Do not write to the journal. The primary use of this option
21 from backup media. The integrity of the volume is not 22 from backup media. The integrity of the volume is not
22 guaranteed if the system abnormally abends. 23 guaranteed if the system abnormally abends.
23 24
24integrity Default. Commit metadata changes to the journal. Use this 25integrity(*) Commit metadata changes to the journal. Use this option to
25 option to remount a volume where the nointegrity option was 26 remount a volume where the nointegrity option was
26 previously specified in order to restore normal behavior. 27 previously specified in order to restore normal behavior.
27 28
28errors=continue Keep going on a filesystem error. 29errors=continue Keep going on a filesystem error.
29errors=remount-ro Default. Remount the filesystem read-only on an error. 30errors=remount-ro(*) Remount the filesystem read-only on an error.
30errors=panic Panic and halt the machine if an error occurs. 31errors=panic Panic and halt the machine if an error occurs.
31 32
32uid=value Override on-disk uid with specified value 33uid=value Override on-disk uid with specified value
@@ -35,7 +36,17 @@ umask=value Override on-disk umask with specified octal value. For
35 directories, the execute bit will be set if the corresponding 36 directories, the execute bit will be set if the corresponding
36 read bit is set. 37 read bit is set.
37 38
38Please send bugs, comments, cards and letters to shaggy@linux.vnet.ibm.com. 39discard=minlen This enables/disables the use of discard/TRIM commands.
40discard The discard/TRIM commands are sent to the underlying
41nodiscard(*) block device when blocks are freed. This is useful for SSD
42 devices and sparse/thinly-provisioned LUNs. The FITRIM ioctl
43 command is also available together with the nodiscard option.
44 The value of minlen specifies the minimum blockcount, when
45 a TRIM command to the block device is considered usefull.
46 When no value is given to the discard option, it defaults to
47 64 blocks, which means 256KiB in JFS.
48 The minlen value of discard overrides the minlen value given
49 on an FITRIM ioctl().
39 50
40The JFS mailing list can be subscribed to by using the link labeled 51The JFS mailing list can be subscribed to by using the link labeled
41"Mail list Subscribe" at our web page http://jfs.sourceforge.net/ 52"Mail list Subscribe" at our web page http://jfs.sourceforge.net/
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index ffdd9d866ad7..2d66ed688125 100644
--- a/Documentation/filesystems/nfs/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
@@ -78,7 +78,8 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
78 flags = hard, nointr, noposix, cto, ac 78 flags = hard, nointr, noposix, cto, ac
79 79
80 80
81ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> 81ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
82 <dns0-ip>:<dns1-ip>
82 83
83 This parameter tells the kernel how to configure IP addresses of devices 84 This parameter tells the kernel how to configure IP addresses of devices
84 and also how to set up the IP routing table. It was originally called 85 and also how to set up the IP routing table. It was originally called
@@ -158,6 +159,13 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
158 159
159 Default: any 160 Default: any
160 161
162 <dns0-ip> IP address of first nameserver.
163 Value gets exported by /proc/net/pnp which is often linked
164 on embedded systems by /etc/resolv.conf.
165
166 <dns1-ip> IP address of secound nameserver.
167 Same as above.
168
161 169
162nfsrootdebug 170nfsrootdebug
163 171
diff --git a/Documentation/hid/hid-sensor.txt b/Documentation/hid/hid-sensor.txt
new file mode 100755
index 000000000000..948b0989c433
--- /dev/null
+++ b/Documentation/hid/hid-sensor.txt
@@ -0,0 +1,140 @@
1
2HID Sensors Framework
3======================
4HID sensor framework provides necessary interfaces to implement sensor drivers,
5which are connected to a sensor hub. The sensor hub is a HID device and it provides
6a report descriptor conforming to HID 1.12 sensor usage tables.
7
8Description from the HID 1.12 "HID Sensor Usages" specification:
9"Standardization of HID usages for sensors would allow (but not require) sensor
10hardware vendors to provide a consistent Plug And Play interface at the USB boundary,
11thereby enabling some operating systems to incorporate common device drivers that
12could be reused between vendors, alleviating any need for the vendors to provide
13the drivers themselves."
14
15This specification describes many usage IDs, which describe the type of sensor
16and also the individual data fields. Each sensor can have variable number of
17data fields. The length and order is specified in the report descriptor. For
18example a part of report descriptor can look like:
19
20 INPUT(1)[INPUT]
21 ..
22 Field(2)
23 Physical(0020.0073)
24 Usage(1)
25 0020.045f
26 Logical Minimum(-32767)
27 Logical Maximum(32767)
28 Report Size(8)
29 Report Count(1)
30 Report Offset(16)
31 Flags(Variable Absolute)
32..
33..
34
35The report is indicating "sensor page (0x20)" contains an accelerometer-3D (0x73).
36This accelerometer-3D has some fields. Here for example field 2 is motion intensity
37(0x045f) with a logical minimum value of -32767 and logical maximum of 32767. The
38order of fields and length of each field is important as the input event raw
39data will use this format.
40
41
42Implementation
43=================
44
45This specification defines many different types of sensors with different sets of
46data fields. It is difficult to have a common input event to user space applications,
47for different sensors. For example an accelerometer can send X,Y and Z data, whereas
48an ambient light sensor can send illumination data.
49So the implementation has two parts:
50- Core hid driver
51- Individual sensor processing part (sensor drivers)
52
53Core driver
54-----------
55The core driver registers (hid-sensor-hub) registers as a HID driver. It parses
56report descriptors and identifies all the sensors present. It adds an MFD device
57with name HID-SENSOR-xxxx (where xxxx is usage id from the specification).
58For example
59HID-SENSOR-200073 is registered for an Accelerometer 3D driver.
60So if any driver with this name is inserted, then the probe routine for that
61function will be called. So an accelerometer processing driver can register
62with this name and will be probed if there is an accelerometer-3D detected.
63
64The core driver provides a set of APIs which can be used by the processing
65drivers to register and get events for that usage id. Also it provides parsing
66functions, which get and set each input/feature/output report.
67
68Individual sensor processing part (sensor drivers)
69-----------
70The processing driver will use an interface provided by the core driver to parse
71the report and get the indexes of the fields and also can get events. This driver
72can use IIO interface to use the standard ABI defined for a type of sensor.
73
74
75Core driver Interface
76=====================
77
78Callback structure:
79Each processing driver can use this structure to set some callbacks.
80 int (*suspend)(..): Callback when HID suspend is received
81 int (*resume)(..): Callback when HID resume is received
82 int (*capture_sample)(..): Capture a sample for one of its data fields
83 int (*send_event)(..): One complete event is received which can have
84 multiple data fields.
85
86Registration functions:
87int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
88 u32 usage_id,
89 struct hid_sensor_hub_callbacks *usage_callback):
90
91Registers callbacks for an usage id. The callback functions are not allowed
92to sleep.
93
94
95int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
96 u32 usage_id):
97
98Removes callbacks for an usage id.
99
100
101Parsing function:
102int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
103 u8 type,
104 u32 usage_id, u32 attr_usage_id,
105 struct hid_sensor_hub_attribute_info *info);
106
107A processing driver can look for some field of interest and check if it exists
108in a report descriptor. If it exists it will store necessary information
109so that fields can be set or get individually.
110These indexes avoid searching every time and getting field index to get or set.
111
112
113Set Feature report
114int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
115 u32 field_index, s32 value);
116
117This interface is used to set a value for a field in feature report. For example
118if there is a field report_interval, which is parsed by a call to
119sensor_hub_input_get_attribute_info before, then it can directly set that individual
120field.
121
122
123int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
124 u32 field_index, s32 *value);
125
126This interface is used to get a value for a field in input report. For example
127if there is a field report_interval, which is parsed by a call to
128sensor_hub_input_get_attribute_info before, then it can directly get that individual
129field value.
130
131
132int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
133 u32 usage_id,
134 u32 attr_usage_id, u32 report_id);
135
136This is used to get a particular field value through input reports. For example
137accelerometer wants to poll X axis value, then it can call this function with
138the usage id of X axis. HID sensors can provide events, so this is not necessary
139to poll for any field. If there is some new sample, the core driver will call
140registered callback function to process the sample.
diff --git a/Documentation/hwmon/adt7410 b/Documentation/hwmon/adt7410
new file mode 100644
index 000000000000..96004000dc2a
--- /dev/null
+++ b/Documentation/hwmon/adt7410
@@ -0,0 +1,51 @@
1Kernel driver adt7410
2=====================
3
4Supported chips:
5 * Analog Devices ADT7410
6 Prefix: 'adt7410'
7 Addresses scanned: I2C 0x48 - 0x4B
8 Datasheet: Publicly available at the Analog Devices website
9 http://www.analog.com/static/imported-files/data_sheets/ADT7410.pdf
10
11Author: Hartmut Knaack <knaack.h@gmx.de>
12
13Description
14-----------
15
16The ADT7410 is a temperature sensor with rated temperature range of -55°C to
17+150°C. It has a high accuracy of +/-0.5°C and can be operated at a resolution
18of 13 bits (0.0625°C) or 16 bits (0.0078°C). The sensor provides an INT pin to
19indicate that a minimum or maximum temperature set point has been exceeded, as
20well as a critical temperature (CT) pin to indicate that the critical
21temperature set point has been exceeded. Both pins can be set up with a common
22hysteresis of 0°C - 15°C and a fault queue, ranging from 1 to 4 events. Both
23pins can individually set to be active-low or active-high, while the whole
24device can either run in comparator mode or interrupt mode. The ADT7410
25supports continous temperature sampling, as well as sampling one temperature
26value per second or even justget one sample on demand for power saving.
27Besides, it can completely power down its ADC, if power management is
28required.
29
30Configuration Notes
31-------------------
32
33Since the device uses one hysteresis value, which is an offset to minimum,
34maximum and critical temperature, it can only be set for temp#_max_hyst.
35However, temp#_min_hyst and temp#_crit_hyst show their corresponding
36hysteresis.
37The device is set to 16 bit resolution and comparator mode.
38
39sysfs-Interface
40---------------
41
42temp#_input - temperature input
43temp#_min - temperature minimum setpoint
44temp#_max - temperature maximum setpoint
45temp#_crit - critical temperature setpoint
46temp#_min_hyst - hysteresis for temperature minimum (read-only)
47temp#_max_hyst - hysteresis for temperature maximum (read/write)
48temp#_crit_hyst - hysteresis for critical temperature (read-only)
49temp#_min_alarm - temperature minimum alarm flag
50temp#_max_alarm - temperature maximum alarm flag
51temp#_crit_alarm - critical temperature alarm flag
diff --git a/Documentation/hwmon/ina2xx b/Documentation/hwmon/ina2xx
index f50a6cc27616..03444f9d833f 100644
--- a/Documentation/hwmon/ina2xx
+++ b/Documentation/hwmon/ina2xx
@@ -8,12 +8,24 @@ Supported chips:
8 Datasheet: Publicly available at the Texas Instruments website 8 Datasheet: Publicly available at the Texas Instruments website
9 http://www.ti.com/ 9 http://www.ti.com/
10 10
11 * Texas Instruments INA220
12 Prefix: 'ina220'
13 Addresses: I2C 0x40 - 0x4f
14 Datasheet: Publicly available at the Texas Instruments website
15 http://www.ti.com/
16
11 * Texas Instruments INA226 17 * Texas Instruments INA226
12 Prefix: 'ina226' 18 Prefix: 'ina226'
13 Addresses: I2C 0x40 - 0x4f 19 Addresses: I2C 0x40 - 0x4f
14 Datasheet: Publicly available at the Texas Instruments website 20 Datasheet: Publicly available at the Texas Instruments website
15 http://www.ti.com/ 21 http://www.ti.com/
16 22
23 * Texas Instruments INA230
24 Prefix: 'ina230'
25 Addresses: I2C 0x40 - 0x4f
26 Datasheet: Publicly available at the Texas Instruments website
27 http://www.ti.com/
28
17Author: Lothar Felten <l-felten@ti.com> 29Author: Lothar Felten <l-felten@ti.com>
18 30
19Description 31Description
@@ -23,7 +35,13 @@ The INA219 is a high-side current shunt and power monitor with an I2C
23interface. The INA219 monitors both shunt drop and supply voltage, with 35interface. The INA219 monitors both shunt drop and supply voltage, with
24programmable conversion times and filtering. 36programmable conversion times and filtering.
25 37
38The INA220 is a high or low side current shunt and power monitor with an I2C
39interface. The INA220 monitors both shunt drop and supply voltage.
40
26The INA226 is a current shunt and power monitor with an I2C interface. 41The INA226 is a current shunt and power monitor with an I2C interface.
27The INA226 monitors both a shunt voltage drop and bus supply voltage. 42The INA226 monitors both a shunt voltage drop and bus supply voltage.
28 43
44The INA230 is a high or low side current shunt and power monitor with an I2C
45interface. The INA230 monitors both a shunt voltage drop and bus supply voltage.
46
29The shunt value in micro-ohms can be set via platform data. 47The shunt value in micro-ohms can be set via platform data.
diff --git a/Documentation/hwmon/lm70 b/Documentation/hwmon/lm70
index 0d240291e3cc..86d182942c51 100644
--- a/Documentation/hwmon/lm70
+++ b/Documentation/hwmon/lm70
@@ -6,6 +6,10 @@ Supported chips:
6 Datasheet: http://www.national.com/pf/LM/LM70.html 6 Datasheet: http://www.national.com/pf/LM/LM70.html
7 * Texas Instruments TMP121/TMP123 7 * Texas Instruments TMP121/TMP123
8 Information: http://focus.ti.com/docs/prod/folders/print/tmp121.html 8 Information: http://focus.ti.com/docs/prod/folders/print/tmp121.html
9 * National Semiconductor LM71
10 Datasheet: http://www.ti.com/product/LM71
11 * National Semiconductor LM74
12 Datasheet: http://www.ti.com/product/LM74
9 13
10Author: 14Author:
11 Kaiwan N Billimoria <kaiwan@designergraphix.com> 15 Kaiwan N Billimoria <kaiwan@designergraphix.com>
@@ -31,9 +35,11 @@ As a real (in-tree) example of this "SPI protocol driver" interfacing
31with a "SPI master controller driver", see drivers/spi/spi_lm70llp.c 35with a "SPI master controller driver", see drivers/spi/spi_lm70llp.c
32and its associated documentation. 36and its associated documentation.
33 37
34The TMP121/TMP123 are very similar; main differences are 4 wire SPI inter- 38The LM74 and TMP121/TMP123 are very similar; main difference is 13-bit
35face (read only) and 13-bit temperature data (0.0625 degrees celsius reso- 39temperature data (0.0625 degrees celsius resolution).
36lution). 40
41The LM71 is also very similar; main difference is 14-bit temperature
42data (0.03125 degrees celsius resolution).
37 43
38Thanks to 44Thanks to
39--------- 45---------
diff --git a/Documentation/hwmon/max197 b/Documentation/hwmon/max197
new file mode 100644
index 000000000000..8d89b9009df8
--- /dev/null
+++ b/Documentation/hwmon/max197
@@ -0,0 +1,60 @@
1Maxim MAX197 driver
2===================
3
4Author:
5 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
6
7Supported chips:
8 * Maxim MAX197
9 Prefix: 'max197'
10 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf
11
12 * Maxim MAX199
13 Prefix: 'max199'
14 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf
15
16Description
17-----------
18
19The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
2012-Bit DAS with 8+4 Bus Interface and Fault Protection.
21
22The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
23while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
24
25Platform data
26-------------
27
28The MAX197 platform data (defined in linux/platform_data/max197.h) should be
29filled with a pointer to a conversion function, defined like:
30
31 int convert(u8 ctrl);
32
33ctrl is the control byte to write to start a new conversion.
34On success, the function must return the 12-bit raw value read from the chip,
35or a negative error code otherwise.
36
37Control byte format:
38
39Bit Name Description
407,6 PD1,PD0 Clock and Power-Down modes
415 ACQMOD Internal or External Controlled Acquisition
424 RNG Full-scale voltage magnitude at the input
433 BIP Unipolar or Bipolar conversion mode
442,1,0 A2,A1,A0 Channel
45
46Sysfs interface
47---------------
48
49* in[0-7]_input: The conversion value for the corresponding channel.
50 RO
51
52* in[0-7]_min: The lower limit (in mV) for the corresponding channel.
53 For the MAX197, it will be adjusted to -10000, -5000, or 0.
54 For the MAX199, it will be adjusted to -4000, -2000, or 0.
55 RW
56
57* in[0-7]_max: The higher limit (in mV) for the corresponding channel.
58 For the MAX197, it will be adjusted to 0, 5000, or 10000.
59 For the MAX199, it will be adjusted to 0, 2000, or 4000.
60 RW
diff --git a/Documentation/hwmon/mcp3021 b/Documentation/hwmon/mcp3021
index 325fd87e81b2..74a6b72adf5f 100644
--- a/Documentation/hwmon/mcp3021
+++ b/Documentation/hwmon/mcp3021
@@ -5,18 +5,25 @@ Supported chips:
5 * Microchip Technology MCP3021 5 * Microchip Technology MCP3021
6 Prefix: 'mcp3021' 6 Prefix: 'mcp3021'
7 Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21805a.pdf 7 Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21805a.pdf
8 * Microchip Technology MCP3221
9 Prefix: 'mcp3221'
10 Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21732c.pdf
8 11
9Author: Mingkai Hu 12Authors:
13 Mingkai Hu
14 Sven Schuchmann <schuchmann@schleissheimer.de>
10 15
11Description 16Description
12----------- 17-----------
13 18
14This driver implements support for the Microchip Technology MCP3021 chip. 19This driver implements support for the Microchip Technology MCP3021 and
20MCP3221 chip.
15 21
16The Microchip Technology Inc. MCP3021 is a successive approximation A/D 22The Microchip Technology Inc. MCP3021 is a successive approximation A/D
17converter (ADC) with 10-bit resolution. 23converter (ADC) with 10-bit resolution. The MCP3221 has 12-bit resolution.
18This device provides one single-ended input with very low power consumption. 24
19Communication to the MCP3021 is performed using a 2-wire I2C compatible 25These devices provide one single-ended input with very low power consumption.
20interface. Standard (100 kHz) and Fast (400 kHz) I2C modes are available. 26Communication to the MCP3021/MCP3221 is performed using a 2-wire I2C
21The default I2C device address is 0x4d (contact the Microchip factory for 27compatible interface. Standard (100 kHz) and Fast (400 kHz) I2C modes are
22additional address options). 28available. The default I2C device address is 0x4d (contact the Microchip
29factory for additional address options).
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro
index 2e758b0e9456..b88f91ae580e 100644
--- a/Documentation/i2c/busses/i2c-viapro
+++ b/Documentation/i2c/busses/i2c-viapro
@@ -20,7 +20,10 @@ Supported adapters:
20 Datasheet: available on http://linux.via.com.tw 20 Datasheet: available on http://linux.via.com.tw
21 21
22 * VIA Technologies, Inc. VX855/VX875 22 * VIA Technologies, Inc. VX855/VX875
23 Datasheet: Availability unknown 23 Datasheet: available on http://linux.via.com.tw
24
25 * VIA Technologies, Inc. VX900
26 Datasheet: available on http://linux.via.com.tw
24 27
25Authors: 28Authors:
26 Kyösti Mälkki <kmalkki@cc.hut.fi>, 29 Kyösti Mälkki <kmalkki@cc.hut.fi>,
@@ -57,6 +60,7 @@ Your lspci -n listing must show one of these :
57 device 1106:8324 (CX700) 60 device 1106:8324 (CX700)
58 device 1106:8353 (VX800/VX820) 61 device 1106:8353 (VX800/VX820)
59 device 1106:8409 (VX855/VX875) 62 device 1106:8409 (VX855/VX875)
63 device 1106:8410 (VX900)
60 64
61If none of these show up, you should look in the BIOS for settings like 65If none of these show up, you should look in the BIOS for settings like
62enable ACPI / SMBus or even USB. 66enable ACPI / SMBus or even USB.
diff --git a/Documentation/i2c/muxes/i2c-mux-gpio b/Documentation/i2c/muxes/i2c-mux-gpio
index bd9b2299b739..d4d91a53fc39 100644
--- a/Documentation/i2c/muxes/i2c-mux-gpio
+++ b/Documentation/i2c/muxes/i2c-mux-gpio
@@ -63,3 +63,21 @@ static struct platform_device myboard_i2cmux = {
63 .platform_data = &myboard_i2cmux_data, 63 .platform_data = &myboard_i2cmux_data,
64 }, 64 },
65}; 65};
66
67If you don't know the absolute GPIO pin numbers at registration time,
68you can instead provide a chip name (.chip_name) and relative GPIO pin
69numbers, and the i2c-gpio-mux driver will do the work for you,
70including deferred probing if the GPIO chip isn't immediately
71available.
72
73Device Registration
74-------------------
75
76When registering your i2c-gpio-mux device, you should pass the number
77of any GPIO pin it uses as the device ID. This guarantees that every
78instance has a different ID.
79
80Alternatively, if you don't need a stable device name, you can simply
81pass PLATFORM_DEVID_AUTO as the device ID, and the platform core will
82assign a dynamic ID to your device. If you do not know the absolute
83GPIO pin numbers at registration time, this is even the only option.
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c
index 5caa2af33207..62a190d45f38 100644
--- a/Documentation/ia64/aliasing-test.c
+++ b/Documentation/ia64/aliasing-test.c
@@ -132,6 +132,7 @@ static int read_rom(char *path)
132 132
133 rc = write(fd, "1", 2); 133 rc = write(fd, "1", 2);
134 if (rc <= 0) { 134 if (rc <= 0) {
135 close(fd);
135 perror("write"); 136 perror("write");
136 return -1; 137 return -1;
137 } 138 }
diff --git a/Documentation/infiniband/ipoib.txt b/Documentation/infiniband/ipoib.txt
index 64eeb55d0c09..f2cfe265e836 100644
--- a/Documentation/infiniband/ipoib.txt
+++ b/Documentation/infiniband/ipoib.txt
@@ -24,6 +24,9 @@ Partitions and P_Keys
24 The P_Key for any interface is given by the "pkey" file, and the 24 The P_Key for any interface is given by the "pkey" file, and the
25 main interface for a subinterface is in "parent." 25 main interface for a subinterface is in "parent."
26 26
27 Child interface create/delete can also be done using IPoIB's
28 rtnl_link_ops, where childs created using either way behave the same.
29
27Datagram vs Connected modes 30Datagram vs Connected modes
28 31
29 The IPoIB driver supports two modes of operation: datagram and 32 The IPoIB driver supports two modes of operation: datagram and
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 849b771c5e03..2152b0e7237d 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -178,7 +178,6 @@ Code Seq#(hex) Include File Comments
178'V' C0 linux/ivtv.h conflict! 178'V' C0 linux/ivtv.h conflict!
179'V' C0 media/davinci/vpfe_capture.h conflict! 179'V' C0 media/davinci/vpfe_capture.h conflict!
180'V' C0 media/si4713.h conflict! 180'V' C0 media/si4713.h conflict!
181'V' C0-CF drivers/media/video/mxb.h conflict!
182'W' 00-1F linux/watchdog.h conflict! 181'W' 00-1F linux/watchdog.h conflict!
183'W' 00-1F linux/wanrouter.h conflict! 182'W' 00-1F linux/wanrouter.h conflict!
184'W' 00-3F sound/asound.h conflict! 183'W' 00-3F sound/asound.h conflict!
@@ -204,8 +203,6 @@ Code Seq#(hex) Include File Comments
204'c' A0-AF arch/x86/include/asm/msr.h conflict! 203'c' A0-AF arch/x86/include/asm/msr.h conflict!
205'd' 00-FF linux/char/drm/drm/h conflict! 204'd' 00-FF linux/char/drm/drm/h conflict!
206'd' 02-40 pcmcia/ds.h conflict! 205'd' 02-40 pcmcia/ds.h conflict!
207'd' 10-3F drivers/media/video/dabusb.h conflict!
208'd' C0-CF drivers/media/video/saa7191.h conflict!
209'd' F0-FF linux/digi1.h 206'd' F0-FF linux/digi1.h
210'e' all linux/digi1.h conflict! 207'e' all linux/digi1.h conflict!
211'e' 00-1F drivers/net/irda/irtty-sir.h conflict! 208'e' 00-1F drivers/net/irda/irtty-sir.h conflict!
@@ -267,9 +264,7 @@ Code Seq#(hex) Include File Comments
267'v' 00-1F linux/ext2_fs.h conflict! 264'v' 00-1F linux/ext2_fs.h conflict!
268'v' 00-1F linux/fs.h conflict! 265'v' 00-1F linux/fs.h conflict!
269'v' 00-0F linux/sonypi.h conflict! 266'v' 00-0F linux/sonypi.h conflict!
270'v' C0-DF media/pwc-ioctl.h conflict!
271'v' C0-FF linux/meye.h conflict! 267'v' C0-FF linux/meye.h conflict!
272'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict!
273'w' all CERN SCI driver 268'w' all CERN SCI driver
274'y' 00-1F packet based user level communications 269'y' 00-1F packet based user level communications
275 <mailto:zapman@interlan.net> 270 <mailto:zapman@interlan.net>
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index ab0a984530d8..ec9ae6708691 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -45,7 +45,7 @@ This document describes the Linux kernel Makefiles.
45 45
46 === 7 Kbuild syntax for exported headers 46 === 7 Kbuild syntax for exported headers
47 --- 7.1 header-y 47 --- 7.1 header-y
48 --- 7.2 objhdr-y 48 --- 7.2 genhdr-y
49 --- 7.3 destination-y 49 --- 7.3 destination-y
50 --- 7.4 generic-y 50 --- 7.4 generic-y
51 51
@@ -1282,15 +1282,15 @@ See subsequent chapter for the syntax of the Kbuild file.
1282 1282
1283 Subdirectories are visited before their parent directories. 1283 Subdirectories are visited before their parent directories.
1284 1284
1285 --- 7.2 objhdr-y 1285 --- 7.2 genhdr-y
1286 1286
1287 objhdr-y specifies generated files to be exported. 1287 genhdr-y specifies generated files to be exported.
1288 Generated files are special as they need to be looked 1288 Generated files are special as they need to be looked
1289 up in another directory when doing 'make O=...' builds. 1289 up in another directory when doing 'make O=...' builds.
1290 1290
1291 Example: 1291 Example:
1292 #include/linux/Kbuild 1292 #include/linux/Kbuild
1293 objhdr-y += version.h 1293 genhdr-y += version.h
1294 1294
1295 --- 7.3 destination-y 1295 --- 7.3 destination-y
1296 1296
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index ad7e2e5088c1..f777fa96243d 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1051,6 +1051,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1051 ihash_entries= [KNL] 1051 ihash_entries= [KNL]
1052 Set number of hash buckets for inode cache. 1052 Set number of hash buckets for inode cache.
1053 1053
1054 ima_appraise= [IMA] appraise integrity measurements
1055 Format: { "off" | "enforce" | "fix" }
1056 default: "enforce"
1057
1058 ima_appraise_tcb [IMA]
1059 The builtin appraise policy appraises all files
1060 owned by uid=0.
1061
1054 ima_audit= [IMA] 1062 ima_audit= [IMA]
1055 Format: { "0" | "1" } 1063 Format: { "0" | "1" }
1056 0 -- integrity auditing messages. (Default) 1064 0 -- integrity auditing messages. (Default)
@@ -1350,6 +1358,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1350 * nohrst, nosrst, norst: suppress hard, soft 1358 * nohrst, nosrst, norst: suppress hard, soft
1351 and both resets. 1359 and both resets.
1352 1360
1361 * rstonce: only attempt one reset during
1362 hot-unplug link recovery
1363
1353 * dump_id: dump IDENTIFY data. 1364 * dump_id: dump IDENTIFY data.
1354 1365
1355 If there are multiple matching configurations changing 1366 If there are multiple matching configurations changing
@@ -1812,8 +1823,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1812 noexec=on: enable non-executable mappings (default) 1823 noexec=on: enable non-executable mappings (default)
1813 noexec=off: disable non-executable mappings 1824 noexec=off: disable non-executable mappings
1814 1825
1826 nosmap [X86]
1827 Disable SMAP (Supervisor Mode Access Prevention)
1828 even if it is supported by processor.
1829
1815 nosmep [X86] 1830 nosmep [X86]
1816 Disable SMEP (Supervisor Mode Execution Protection) 1831 Disable SMEP (Supervisor Mode Execution Prevention)
1817 even if it is supported by processor. 1832 even if it is supported by processor.
1818 1833
1819 noexec32 [X86-64] 1834 noexec32 [X86-64]
@@ -1833,6 +1848,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1833 and restore using xsave. The kernel will fallback to 1848 and restore using xsave. The kernel will fallback to
1834 enabling legacy floating-point and sse state. 1849 enabling legacy floating-point and sse state.
1835 1850
1851 eagerfpu= [X86]
1852 on enable eager fpu restore
1853 off disable eager fpu restore
1854 auto selects the default scheme, which automatically
1855 enables eagerfpu restore for xsaveopt.
1856
1836 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or 1857 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
1837 wfi(ARM) instruction doesn't work correctly and not to 1858 wfi(ARM) instruction doesn't work correctly and not to
1838 use it. This is also useful when using JTAG debugger. 1859 use it. This is also useful when using JTAG debugger.
@@ -2385,6 +2406,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2385 rcutree.rcu_cpu_stall_timeout= [KNL,BOOT] 2406 rcutree.rcu_cpu_stall_timeout= [KNL,BOOT]
2386 Set timeout for RCU CPU stall warning messages. 2407 Set timeout for RCU CPU stall warning messages.
2387 2408
2409 rcutree.jiffies_till_first_fqs= [KNL,BOOT]
2410 Set delay from grace-period initialization to
2411 first attempt to force quiescent states.
2412 Units are jiffies, minimum value is zero,
2413 and maximum value is HZ.
2414
2415 rcutree.jiffies_till_next_fqs= [KNL,BOOT]
2416 Set delay between subsequent attempts to force
2417 quiescent states. Units are jiffies, minimum
2418 value is one, and maximum value is HZ.
2419
2388 rcutorture.fqs_duration= [KNL,BOOT] 2420 rcutorture.fqs_duration= [KNL,BOOT]
2389 Set duration of force_quiescent_state bursts. 2421 Set duration of force_quiescent_state bursts.
2390 2422
@@ -2638,9 +2670,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2638 smart2= [HW] 2670 smart2= [HW]
2639 Format: <io1>[,<io2>[,...,<io8>]] 2671 Format: <io1>[,<io2>[,...,<io8>]]
2640 2672
2641 smp-alt-once [X86-32,SMP] On a hotplug CPU system, only
2642 attempt to substitute SMP alternatives once at boot.
2643
2644 smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices 2673 smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices
2645 smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port 2674 smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port
2646 smsc-ircc2.ircc_sir= [HW] SIR base I/O port 2675 smsc-ircc2.ircc_sir= [HW] SIR base I/O port
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index 49578cf1aea5..c5182bb2c16c 100644
--- a/Documentation/kobject.txt
+++ b/Documentation/kobject.txt
@@ -284,9 +284,11 @@ instead, it is associated with the ktype. So let us introduce struct
284kobj_type: 284kobj_type:
285 285
286 struct kobj_type { 286 struct kobj_type {
287 void (*release)(struct kobject *); 287 void (*release)(struct kobject *kobj);
288 const struct sysfs_ops *sysfs_ops; 288 const struct sysfs_ops *sysfs_ops;
289 struct attribute **default_attrs; 289 struct attribute **default_attrs;
290 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
291 const void *(*namespace)(struct kobject *kobj);
290 }; 292 };
291 293
292This structure is used to describe a particular type of kobject (or, more 294This structure is used to describe a particular type of kobject (or, more
diff --git a/Documentation/misc-devices/lis3lv02d b/Documentation/misc-devices/lis3lv02d
index f1a4ec840f86..af815b9ba413 100644
--- a/Documentation/misc-devices/lis3lv02d
+++ b/Documentation/misc-devices/lis3lv02d
@@ -4,7 +4,8 @@ Kernel driver lis3lv02d
4Supported chips: 4Supported chips:
5 5
6 * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision) 6 * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision)
7 * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits) 7 * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits) and
8 LIS331DLH (16 bits)
8 9
9Authors: 10Authors:
10 Yan Burman <burman.yan@gmail.com> 11 Yan Burman <burman.yan@gmail.com>
diff --git a/Documentation/networking/batman-adv.txt b/Documentation/networking/batman-adv.txt
index 8f3ae4a6147e..a173d2a879f5 100644
--- a/Documentation/networking/batman-adv.txt
+++ b/Documentation/networking/batman-adv.txt
@@ -75,9 +75,10 @@ folder:
75 75
76There is a special folder for debugging information: 76There is a special folder for debugging information:
77 77
78# ls /sys/kernel/debug/batman_adv/bat0/ 78# ls /sys/kernel/debug/batman_adv/bat0/
79# bla_claim_table log socket transtable_local 79# bla_backbone_table log transtable_global
80# gateways originators transtable_global vis_data 80# bla_claim_table originators transtable_local
81# gateways socket vis_data
81 82
82Some of the files contain all sort of status information regard- 83Some of the files contain all sort of status information regard-
83ing the mesh network. For example, you can view the table of 84ing the mesh network. For example, you can view the table of
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 6b1c7110534e..10a015c384b8 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -752,12 +752,22 @@ xmit_hash_policy
752 protocol information to generate the hash. 752 protocol information to generate the hash.
753 753
754 Uses XOR of hardware MAC addresses and IP addresses to 754 Uses XOR of hardware MAC addresses and IP addresses to
755 generate the hash. The formula is 755 generate the hash. The IPv4 formula is
756 756
757 (((source IP XOR dest IP) AND 0xffff) XOR 757 (((source IP XOR dest IP) AND 0xffff) XOR
758 ( source MAC XOR destination MAC )) 758 ( source MAC XOR destination MAC ))
759 modulo slave count 759 modulo slave count
760 760
761 The IPv6 formula is
762
763 hash = (source ip quad 2 XOR dest IP quad 2) XOR
764 (source ip quad 3 XOR dest IP quad 3) XOR
765 (source ip quad 4 XOR dest IP quad 4)
766
767 (((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash)
768 XOR (source MAC XOR destination MAC))
769 modulo slave count
770
761 This algorithm will place all traffic to a particular 771 This algorithm will place all traffic to a particular
762 network peer on the same slave. For non-IP traffic, 772 network peer on the same slave. For non-IP traffic,
763 the formula is the same as for the layer2 transmit 773 the formula is the same as for the layer2 transmit
@@ -778,19 +788,29 @@ xmit_hash_policy
778 slaves, although a single connection will not span 788 slaves, although a single connection will not span
779 multiple slaves. 789 multiple slaves.
780 790
781 The formula for unfragmented TCP and UDP packets is 791 The formula for unfragmented IPv4 TCP and UDP packets is
782 792
783 ((source port XOR dest port) XOR 793 ((source port XOR dest port) XOR
784 ((source IP XOR dest IP) AND 0xffff) 794 ((source IP XOR dest IP) AND 0xffff)
785 modulo slave count 795 modulo slave count
786 796
787 For fragmented TCP or UDP packets and all other IP 797 The formula for unfragmented IPv6 TCP and UDP packets is
788 protocol traffic, the source and destination port 798
799 hash = (source port XOR dest port) XOR
800 ((source ip quad 2 XOR dest IP quad 2) XOR
801 (source ip quad 3 XOR dest IP quad 3) XOR
802 (source ip quad 4 XOR dest IP quad 4))
803
804 ((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash)
805 modulo slave count
806
807 For fragmented TCP or UDP packets and all other IPv4 and
808 IPv6 protocol traffic, the source and destination port
789 information is omitted. For non-IP traffic, the 809 information is omitted. For non-IP traffic, the
790 formula is the same as for the layer2 transmit hash 810 formula is the same as for the layer2 transmit hash
791 policy. 811 policy.
792 812
793 This policy is intended to mimic the behavior of 813 The IPv4 policy is intended to mimic the behavior of
794 certain switches, notably Cisco switches with PFC2 as 814 certain switches, notably Cisco switches with PFC2 as
795 well as some Foundry and IBM products. 815 well as some Foundry and IBM products.
796 816
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index ca447b35b833..c7fc10724948 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -439,7 +439,9 @@ tcp_stdurg - BOOLEAN
439tcp_synack_retries - INTEGER 439tcp_synack_retries - INTEGER
440 Number of times SYNACKs for a passive TCP connection attempt will 440 Number of times SYNACKs for a passive TCP connection attempt will
441 be retransmitted. Should not be higher than 255. Default value 441 be retransmitted. Should not be higher than 255. Default value
442 is 5, which corresponds to ~180seconds. 442 is 5, which corresponds to 31seconds till the last retransmission
443 with the current initial RTO of 1second. With this the final timeout
444 for a passive TCP connection will happen after 63seconds.
443 445
444tcp_syncookies - BOOLEAN 446tcp_syncookies - BOOLEAN
445 Only valid when the kernel was compiled with CONFIG_SYNCOOKIES 447 Only valid when the kernel was compiled with CONFIG_SYNCOOKIES
@@ -465,20 +467,37 @@ tcp_syncookies - BOOLEAN
465tcp_fastopen - INTEGER 467tcp_fastopen - INTEGER
466 Enable TCP Fast Open feature (draft-ietf-tcpm-fastopen) to send data 468 Enable TCP Fast Open feature (draft-ietf-tcpm-fastopen) to send data
467 in the opening SYN packet. To use this feature, the client application 469 in the opening SYN packet. To use this feature, the client application
468 must not use connect(). Instead, it should use sendmsg() or sendto() 470 must use sendmsg() or sendto() with MSG_FASTOPEN flag rather than
469 with MSG_FASTOPEN flag which performs a TCP handshake automatically. 471 connect() to perform a TCP handshake automatically.
470 472
471 The values (bitmap) are: 473 The values (bitmap) are
472 1: Enables sending data in the opening SYN on the client 474 1: Enables sending data in the opening SYN on the client.
473 5: Enables sending data in the opening SYN on the client regardless 475 2: Enables TCP Fast Open on the server side, i.e., allowing data in
474 of cookie availability. 476 a SYN packet to be accepted and passed to the application before
477 3-way hand shake finishes.
478 4: Send data in the opening SYN regardless of cookie availability and
479 without a cookie option.
480 0x100: Accept SYN data w/o validating the cookie.
481 0x200: Accept data-in-SYN w/o any cookie option present.
482 0x400/0x800: Enable Fast Open on all listeners regardless of the
483 TCP_FASTOPEN socket option. The two different flags designate two
484 different ways of setting max_qlen without the TCP_FASTOPEN socket
485 option.
475 486
476 Default: 0 487 Default: 0
477 488
489 Note that the client & server side Fast Open flags (1 and 2
490 respectively) must be also enabled before the rest of flags can take
491 effect.
492
493 See include/net/tcp.h and the code for more details.
494
478tcp_syn_retries - INTEGER 495tcp_syn_retries - INTEGER
479 Number of times initial SYNs for an active TCP connection attempt 496 Number of times initial SYNs for an active TCP connection attempt
480 will be retransmitted. Should not be higher than 255. Default value 497 will be retransmitted. Should not be higher than 255. Default value
481 is 5, which corresponds to ~180seconds. 498 is 6, which corresponds to 63seconds till the last restransmission
499 with the current initial RTO of 1second. With this the final timeout
500 for an active TCP connection attempt will happen after 127seconds.
482 501
483tcp_timestamps - BOOLEAN 502tcp_timestamps - BOOLEAN
484 Enable timestamps as defined in RFC1323. 503 Enable timestamps as defined in RFC1323.
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index c676b9cedbd0..ef9ee71b4d7f 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -173,7 +173,6 @@ Where:
173For MDIO bus The we have: 173For MDIO bus The we have:
174 174
175 struct stmmac_mdio_bus_data { 175 struct stmmac_mdio_bus_data {
176 int bus_id;
177 int (*phy_reset)(void *priv); 176 int (*phy_reset)(void *priv);
178 unsigned int phy_mask; 177 unsigned int phy_mask;
179 int *irqs; 178 int *irqs;
@@ -181,7 +180,6 @@ For MDIO bus The we have:
181 }; 180 };
182 181
183Where: 182Where:
184 o bus_id: bus identifier;
185 o phy_reset: hook to reset the phy device attached to the bus. 183 o phy_reset: hook to reset the phy device attached to the bus.
186 o phy_mask: phy mask passed when register the MDIO bus within the driver. 184 o phy_mask: phy mask passed when register the MDIO bus within the driver.
187 o irqs: list of IRQs, one per PHY. 185 o irqs: list of IRQs, one per PHY.
@@ -230,9 +228,6 @@ there are two MAC cores: one MAC is for MDIO Bus/PHY emulation
230with fixed_link support. 228with fixed_link support.
231 229
232static struct stmmac_mdio_bus_data stmmac1_mdio_bus = { 230static struct stmmac_mdio_bus_data stmmac1_mdio_bus = {
233 .bus_id = 1,
234 |
235 |-> phy device on the bus_id 1
236 .phy_reset = phy_reset; 231 .phy_reset = phy_reset;
237 | 232 |
238 |-> function to provide the phy_reset on this board 233 |-> function to provide the phy_reset on this board
diff --git a/Documentation/networking/vxlan.txt b/Documentation/networking/vxlan.txt
new file mode 100644
index 000000000000..5b34b762d7d5
--- /dev/null
+++ b/Documentation/networking/vxlan.txt
@@ -0,0 +1,47 @@
1Virtual eXtensible Local Area Networking documentation
2======================================================
3
4The VXLAN protocol is a tunnelling protocol that is designed to
5solve the problem of limited number of available VLAN's (4096).
6With VXLAN identifier is expanded to 24 bits.
7
8It is a draft RFC standard, that is implemented by Cisco Nexus,
9Vmware and Brocade. The protocol runs over UDP using a single
10destination port (still not standardized by IANA).
11This document describes the Linux kernel tunnel device,
12there is also an implantation of VXLAN for Openvswitch.
13
14Unlike most tunnels, a VXLAN is a 1 to N network, not just point
15to point. A VXLAN device can either dynamically learn the IP address
16of the other end, in a manner similar to a learning bridge, or the
17forwarding entries can be configured statically.
18
19The management of vxlan is done in a similar fashion to it's
20too closest neighbors GRE and VLAN. Configuring VXLAN requires
21the version of iproute2 that matches the kernel release
22where VXLAN was first merged upstream.
23
241. Create vxlan device
25 # ip li add vxlan0 type vxlan id 42 group 239.1.1.1 dev eth1
26
27This creates a new device (vxlan0). The device uses the
28the multicast group 239.1.1.1 over eth1 to handle packets where
29no entry is in the forwarding table.
30
312. Delete vxlan device
32 # ip link delete vxlan0
33
343. Show vxlan info
35 # ip -d show vxlan0
36
37It is possible to create, destroy and display the vxlan
38forwarding table using the new bridge command.
39
401. Create forwarding table entry
41 # bridge fdb add to 00:17:42:8a:b4:05 dst 192.19.0.2 dev vxlan0
42
432. Delete forwarding table entry
44 # bridge fdb delete 00:17:42:8a:b4:05
45
463. Show forwarding table
47 # bridge fdb show dev vxlan0
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt
index 1479aca23744..3b4ee5328868 100644
--- a/Documentation/pinctrl.txt
+++ b/Documentation/pinctrl.txt
@@ -289,6 +289,11 @@ Interaction with the GPIO subsystem
289The GPIO drivers may want to perform operations of various types on the same 289The GPIO drivers may want to perform operations of various types on the same
290physical pins that are also registered as pin controller pins. 290physical pins that are also registered as pin controller pins.
291 291
292First and foremost, the two subsystems can be used as completely orthogonal,
293see the section named "pin control requests from drivers" and
294"drivers needing both pin control and GPIOs" below for details. But in some
295situations a cross-subsystem mapping between pins and GPIOs is needed.
296
292Since the pin controller subsystem have its pinspace local to the pin 297Since the pin controller subsystem have its pinspace local to the pin
293controller we need a mapping so that the pin control subsystem can figure out 298controller we need a mapping so that the pin control subsystem can figure out
294which pin controller handles control of a certain GPIO pin. Since a single 299which pin controller handles control of a certain GPIO pin. Since a single
@@ -359,6 +364,7 @@ will get an pin number into its handled number range. Further it is also passed
359the range ID value, so that the pin controller knows which range it should 364the range ID value, so that the pin controller knows which range it should
360deal with. 365deal with.
361 366
367
362PINMUX interfaces 368PINMUX interfaces
363================= 369=================
364 370
@@ -960,8 +966,8 @@ all get selected, and they all get enabled and disable simultaneously by the
960pinmux core. 966pinmux core.
961 967
962 968
963Pinmux requests from drivers 969Pin control requests from drivers
964============================ 970=================================
965 971
966Generally it is discouraged to let individual drivers get and enable pin 972Generally it is discouraged to let individual drivers get and enable pin
967control. So if possible, handle the pin control in platform code or some other 973control. So if possible, handle the pin control in platform code or some other
@@ -969,6 +975,11 @@ place where you have access to all the affected struct device * pointers. In
969some cases where a driver needs to e.g. switch between different mux mappings 975some cases where a driver needs to e.g. switch between different mux mappings
970at runtime this is not possible. 976at runtime this is not possible.
971 977
978A typical case is if a driver needs to switch bias of pins from normal
979operation and going to sleep, moving from the PINCTRL_STATE_DEFAULT to
980PINCTRL_STATE_SLEEP at runtime, re-biasing or even re-muxing pins to save
981current in sleep mode.
982
972A driver may request a certain control state to be activated, usually just the 983A driver may request a certain control state to be activated, usually just the
973default state like this: 984default state like this:
974 985
@@ -1058,6 +1069,51 @@ registered. Thus make sure that the error path in your driver gracefully
1058cleans up and is ready to retry the probing later in the startup process. 1069cleans up and is ready to retry the probing later in the startup process.
1059 1070
1060 1071
1072Drivers needing both pin control and GPIOs
1073==========================================
1074
1075Again, it is discouraged to let drivers lookup and select pin control states
1076themselves, but again sometimes this is unavoidable.
1077
1078So say that your driver is fetching its resources like this:
1079
1080#include <linux/pinctrl/consumer.h>
1081#include <linux/gpio.h>
1082
1083struct pinctrl *pinctrl;
1084int gpio;
1085
1086pinctrl = devm_pinctrl_get_select_default(&dev);
1087gpio = devm_gpio_request(&dev, 14, "foo");
1088
1089Here we first request a certain pin state and then request GPIO 14 to be
1090used. If you're using the subsystems orthogonally like this, you should
1091nominally always get your pinctrl handle and select the desired pinctrl
1092state BEFORE requesting the GPIO. This is a semantic convention to avoid
1093situations that can be electrically unpleasant, you will certainly want to
1094mux in and bias pins in a certain way before the GPIO subsystems starts to
1095deal with them.
1096
1097The above can be hidden: using pinctrl hogs, the pin control driver may be
1098setting up the config and muxing for the pins when it is probing,
1099nevertheless orthogonal to the GPIO subsystem.
1100
1101But there are also situations where it makes sense for the GPIO subsystem
1102to communicate directly with with the pinctrl subsystem, using the latter
1103as a back-end. This is when the GPIO driver may call out to the functions
1104described in the section "Pin control interaction with the GPIO subsystem"
1105above. This only involves per-pin multiplexing, and will be completely
1106hidden behind the gpio_*() function namespace. In this case, the driver
1107need not interact with the pin control subsystem at all.
1108
1109If a pin control driver and a GPIO driver is dealing with the same pins
1110and the use cases involve multiplexing, you MUST implement the pin controller
1111as a back-end for the GPIO driver like this, unless your hardware design
1112is such that the GPIO controller can override the pin controller's
1113multiplexing state through hardware without the need to interact with the
1114pin control system.
1115
1116
1061System pin control hogging 1117System pin control hogging
1062========================== 1118==========================
1063 1119
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 2f0ddc15b5ac..9c647bd7c5a9 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -81,6 +81,9 @@ This defines trickle and fast charges. For batteries that
81are already charged or discharging, 'n/a' can be displayed (or 81are already charged or discharging, 'n/a' can be displayed (or
82'unknown', if the status is not known). 82'unknown', if the status is not known).
83 83
84AUTHENTIC - indicates the power supply (battery or charger) connected
85to the platform is authentic(1) or non authentic(0).
86
84HEALTH - represents health of the battery, values corresponds to 87HEALTH - represents health of the battery, values corresponds to
85POWER_SUPPLY_HEALTH_*, defined in battery.h. 88POWER_SUPPLY_HEALTH_*, defined in battery.h.
86 89
@@ -113,8 +116,12 @@ be negative; there is no empty or full value. It is only useful for
113relative, time-based measurements. 116relative, time-based measurements.
114 117
115CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger. 118CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger.
119CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the
120power supply object.
116 121
117CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger. 122CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
123CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
124power supply object.
118 125
119ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. 126ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
120 127
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 92341b84250d..0b4b63e7e9b6 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -53,7 +53,7 @@ before suspend (it is limited to 500 MB by default).
53 53
54Article about goals and implementation of Software Suspend for Linux 54Article about goals and implementation of Software Suspend for Linux
55~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56Author: G‚ábor Kuti 56Author: Gábor Kuti
57Last revised: 2003-10-20 by Pavel Machek 57Last revised: 2003-10-20 by Pavel Machek
58 58
59Idea and goals to achieve 59Idea and goals to achieve
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 7561d7ed8e11..8ffb274367c7 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -69,6 +69,7 @@ MAC/FDDI addresses:
69 %pMR 05:04:03:02:01:00 69 %pMR 05:04:03:02:01:00
70 %pMF 00-01-02-03-04-05 70 %pMF 00-01-02-03-04-05
71 %pm 000102030405 71 %pm 000102030405
72 %pmR 050403020100
72 73
73 For printing 6-byte MAC/FDDI addresses in hex notation. The 'M' and 'm' 74 For printing 6-byte MAC/FDDI addresses in hex notation. The 'M' and 'm'
74 specifiers result in a printed address with ('M') or without ('m') byte 75 specifiers result in a printed address with ('M') or without ('m') byte
diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
index 197ad59ab9bf..69b3cac4749d 100644
--- a/Documentation/ramoops.txt
+++ b/Documentation/ramoops.txt
@@ -102,9 +102,7 @@ related hangs. The functions call chain log is stored in a "ftrace-ramoops"
102file. Here is an example of usage: 102file. Here is an example of usage:
103 103
104 # mount -t debugfs debugfs /sys/kernel/debug/ 104 # mount -t debugfs debugfs /sys/kernel/debug/
105 # cd /sys/kernel/debug/tracing 105 # echo 1 > /sys/kernel/debug/pstore/record_ftrace
106 # echo function > current_tracer
107 # echo 1 > options/func_pstore
108 # reboot -f 106 # reboot -f
109 [...] 107 [...]
110 # mount -t pstore pstore /mnt/ 108 # mount -t pstore pstore /mnt/
diff --git a/Documentation/remoteproc.txt b/Documentation/remoteproc.txt
index 23a09b884bc7..e6469fdcf89a 100644
--- a/Documentation/remoteproc.txt
+++ b/Documentation/remoteproc.txt
@@ -129,6 +129,13 @@ int dummy_rproc_example(struct rproc *my_rproc)
129 129
130 Returns 0 on success and -EINVAL if @rproc isn't valid. 130 Returns 0 on success and -EINVAL if @rproc isn't valid.
131 131
132 void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type)
133 - Report a crash in a remoteproc
134 This function must be called every time a crash is detected by the
135 platform specific rproc implementation. This should not be called from a
136 non-remoteproc driver. This function can be called from atomic/interrupt
137 context.
138
1325. Implementation callbacks 1395. Implementation callbacks
133 140
134These callbacks should be provided by platform-specific remoteproc 141These callbacks should be provided by platform-specific remoteproc
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 250160469d83..32aa4002de4a 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -119,8 +119,9 @@ three different userspace interfaces:
119 * /sys/class/rtc/rtcN ... sysfs attributes support readonly 119 * /sys/class/rtc/rtcN ... sysfs attributes support readonly
120 access to some RTC attributes. 120 access to some RTC attributes.
121 121
122 * /proc/driver/rtc ... the first RTC (rtc0) may expose itself 122 * /proc/driver/rtc ... the system clock RTC may expose itself
123 using a procfs interface. More information is (currently) shown 123 using a procfs interface. If there is no RTC for the system clock,
124 rtc0 is used by default. More information is (currently) shown
124 here than through sysfs. 125 here than through sysfs.
125 126
126The RTC Class framework supports a wide variety of RTCs, ranging from those 127The RTC Class framework supports a wide variety of RTCs, ranging from those
diff --git a/Documentation/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt
index 28aa1075e291..b1b8587b86f0 100644
--- a/Documentation/scheduler/sched-arch.txt
+++ b/Documentation/scheduler/sched-arch.txt
@@ -17,16 +17,6 @@ you must `#define __ARCH_WANT_UNLOCKED_CTXSW` in a header file
17Unlocked context switches introduce only a very minor performance 17Unlocked context switches introduce only a very minor performance
18penalty to the core scheduler implementation in the CONFIG_SMP case. 18penalty to the core scheduler implementation in the CONFIG_SMP case.
19 19
202. Interrupt status
21By default, the switch_to arch function is called with interrupts
22disabled. Interrupts may be enabled over the call if it is likely to
23introduce a significant interrupt latency by adding the line
24`#define __ARCH_WANT_INTERRUPTS_ON_CTXSW` in the same place as for
25unlocked context switches. This define also implies
26`__ARCH_WANT_UNLOCKED_CTXSW`. See arch/arm/include/asm/system.h for an
27example.
28
29
30CPU idle 20CPU idle
31======== 21========
32Your cpu_idle routines need to obey the following rules: 22Your cpu_idle routines need to obey the following rules:
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index 80441ab608e4..3a3079411a3d 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,13 @@
1Release Date : Tue. Jun 17, 2012 17:00:00 PST 2012 -
2 (emaild-id:megaraidlinux@lsi.com)
3 Adam Radford/Kashyap Desai
4Current Version : 00.00.06.18-rc1
5Old Version : 00.00.06.15-rc1
6 1. Fix Copyright dates.
7 2. Add throttlequeuedepth module parameter.
8 3. Add resetwaittime module parameter.
9 4. Move poll_aen_lock initializer.
10-------------------------------------------------------------------------------
1Release Date : Mon. Mar 19, 2012 17:00:00 PST 2012 - 11Release Date : Mon. Mar 19, 2012 17:00:00 PST 2012 -
2 (emaild-id:megaraidlinux@lsi.com) 12 (emaild-id:megaraidlinux@lsi.com)
3 Adam Radford 13 Adam Radford
diff --git a/Documentation/scsi/LICENSE.qla2xxx b/Documentation/scsi/LICENSE.qla2xxx
index ce0fdf349a81..27a91cf43d6d 100644
--- a/Documentation/scsi/LICENSE.qla2xxx
+++ b/Documentation/scsi/LICENSE.qla2xxx
@@ -1,4 +1,4 @@
1Copyright (c) 2003-2011 QLogic Corporation 1Copyright (c) 2003-2012 QLogic Corporation
2QLogic Linux FC-FCoE Driver 2QLogic Linux FC-FCoE Driver
3 3
4This program includes a device driver for Linux 3.x. 4This program includes a device driver for Linux 3.x.
diff --git a/Documentation/scsi/LICENSE.qla4xxx b/Documentation/scsi/LICENSE.qla4xxx
index ab899591ecb7..78c169f0d7c6 100644
--- a/Documentation/scsi/LICENSE.qla4xxx
+++ b/Documentation/scsi/LICENSE.qla4xxx
@@ -1,4 +1,4 @@
1Copyright (c) 2003-2011 QLogic Corporation 1Copyright (c) 2003-2012 QLogic Corporation
2QLogic Linux iSCSI Driver 2QLogic Linux iSCSI Driver
3 3
4This program includes a device driver for Linux 3.x. 4This program includes a device driver for Linux 3.x.
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt
index 685bf3582abe..f346abbdd6ff 100644
--- a/Documentation/scsi/st.txt
+++ b/Documentation/scsi/st.txt
@@ -112,10 +112,8 @@ attempted).
112 112
113MINOR NUMBERS 113MINOR NUMBERS
114 114
115The tape driver currently supports 128 drives by default. This number 115The tape driver currently supports up to 2^17 drives if 4 modes for
116can be increased by editing st.h and recompiling the driver if 116each drive are used.
117necessary. The upper limit is 2^17 drives if 4 modes for each drive
118are used.
119 117
120The minor numbers consist of the following bit fields: 118The minor numbers consist of the following bit fields:
121 119
diff --git a/Documentation/security/Smack.txt b/Documentation/security/Smack.txt
index a416479b8a1c..8a177e4b6e21 100644
--- a/Documentation/security/Smack.txt
+++ b/Documentation/security/Smack.txt
@@ -28,12 +28,11 @@ Smack kernels use the CIPSO IP option. Some network
28configurations are intolerant of IP options and can impede 28configurations are intolerant of IP options and can impede
29access to systems that use them as Smack does. 29access to systems that use them as Smack does.
30 30
31The current git repositories for Smack user space are: 31The current git repository for Smack user space is:
32 32
33 git@gitorious.org:meego-platform-security/smackutil.git 33 git://github.com/smack-team/smack.git
34 git@gitorious.org:meego-platform-security/libsmack.git
35 34
36These should make and install on most modern distributions. 35This should make and install on most modern distributions.
37There are three commands included in smackutil: 36There are three commands included in smackutil:
38 37
39smackload - properly formats data for writing to /smack/load 38smackload - properly formats data for writing to /smack/load
@@ -194,6 +193,9 @@ onlycap
194 these capabilities are effective at for processes with any 193 these capabilities are effective at for processes with any
195 label. The value is set by writing the desired label to the 194 label. The value is set by writing the desired label to the
196 file or cleared by writing "-" to the file. 195 file or cleared by writing "-" to the file.
196revoke-subject
197 Writing a Smack label here sets the access to '-' for all access
198 rules with that subject label.
197 199
198You can add access rules in /etc/smack/accesses. They take the form: 200You can add access rules in /etc/smack/accesses. They take the form:
199 201
diff --git a/Documentation/serial/00-INDEX b/Documentation/serial/00-INDEX
index e09468ad3cb1..f7b0c7dc25ef 100644
--- a/Documentation/serial/00-INDEX
+++ b/Documentation/serial/00-INDEX
@@ -2,8 +2,6 @@
2 - this file. 2 - this file.
3README.cycladesZ 3README.cycladesZ
4 - info on Cyclades-Z firmware loading. 4 - info on Cyclades-Z firmware loading.
5computone.txt
6 - info on Computone Intelliport II/Plus Multiport Serial Driver.
7digiepca.txt 5digiepca.txt
8 - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards. 6 - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards.
9hayes-esp.txt 7hayes-esp.txt
diff --git a/Documentation/serial/computone.txt b/Documentation/serial/computone.txt
deleted file mode 100644
index a6a1158ea2ba..000000000000
--- a/Documentation/serial/computone.txt
+++ /dev/null
@@ -1,520 +0,0 @@
1NOTE: This is an unmaintained driver. It is not guaranteed to work due to
2changes made in the tty layer in 2.6. If you wish to take over maintenance of
3this driver, contact Michael Warfield <mhw@wittsend.com>.
4
5Changelog:
6----------
711-01-2001: Original Document
8
910-29-2004: Minor misspelling & format fix, update status of driver.
10 James Nelson <james4765@gmail.com>
11
12Computone Intelliport II/Plus Multiport Serial Driver
13-----------------------------------------------------
14
15Release Notes For Linux Kernel 2.2 and higher.
16These notes are for the drivers which have already been integrated into the
17kernel and have been tested on Linux kernels 2.0, 2.2, 2.3, and 2.4.
18
19Version: 1.2.14
20Date: 11/01/2001
21Historical Author: Andrew Manison <amanison@america.net>
22Primary Author: Doug McNash
23
24This file assumes that you are using the Computone drivers which are
25integrated into the kernel sources. For updating the drivers or installing
26drivers into kernels which do not already have Computone drivers, please
27refer to the instructions in the README.computone file in the driver patch.
28
29
301. INTRODUCTION
31
32This driver supports the entire family of Intelliport II/Plus controllers
33with the exception of the MicroChannel controllers. It does not support
34products previous to the Intelliport II.
35
36This driver was developed on the v2.0.x Linux tree and has been tested up
37to v2.4.14; it will probably not work with earlier v1.X kernels,.
38
39
402. QUICK INSTALLATION
41
42Hardware - If you have an ISA card, find a free interrupt and io port.
43 List those in use with `cat /proc/interrupts` and
44 `cat /proc/ioports`. Set the card dip switches to a free
45 address. You may need to configure your BIOS to reserve an
46 irq for an ISA card. PCI and EISA parameters are set
47 automagically. Insert card into computer with the power off
48 before or after drivers installation.
49
50 Note the hardware address from the Computone ISA cards installed into
51 the system. These are required for editing ip2.c or editing
52 /etc/modprobe.d/*.conf, or for specification on the modprobe
53 command line.
54
55 Note that the /etc/modules.conf should be used for older (pre-2.6)
56 kernels.
57
58Software -
59
60Module installation:
61
62a) Determine free irq/address to use if any (configure BIOS if need be)
63b) Run "make config" or "make menuconfig" or "make xconfig"
64 Select (m) module for CONFIG_COMPUTONE under character
65 devices. CONFIG_PCI and CONFIG_MODULES also may need to be set.
66c) Set address on ISA cards then:
67 edit /usr/src/linux/drivers/char/ip2.c if needed
68 or
69 edit config file in /etc/modprobe.d/ if needed (module).
70 or both to match this setting.
71d) Run "make modules"
72e) Run "make modules_install"
73f) Run "/sbin/depmod -a"
74g) install driver using `modprobe ip2 <options>` (options listed below)
75h) run ip2mkdev (either the script below or the binary version)
76
77
78Kernel installation:
79
80a) Determine free irq/address to use if any (configure BIOS if need be)
81b) Run "make config" or "make menuconfig" or "make xconfig"
82 Select (y) kernel for CONFIG_COMPUTONE under character
83 devices. CONFIG_PCI may need to be set if you have PCI bus.
84c) Set address on ISA cards then:
85 edit /usr/src/linux/drivers/char/ip2.c
86 (Optional - may be specified on kernel command line now)
87d) Run "make zImage" or whatever target you prefer.
88e) mv /usr/src/linux/arch/x86/boot/zImage to /boot.
89f) Add new config for this kernel into /etc/lilo.conf, run "lilo"
90 or copy to a floppy disk and boot from that floppy disk.
91g) Reboot using this kernel
92h) run ip2mkdev (either the script below or the binary version)
93
94Kernel command line options:
95
96When compiling the driver into the kernel, io and irq may be
97compiled into the driver by editing ip2.c and setting the values for
98io and irq in the appropriate array. An alternative is to specify
99a command line parameter to the kernel at boot up.
100
101 ip2=io0,irq0,io1,irq1,io2,irq2,io3,irq3
102
103Note that this order is very different from the specifications for the
104modload parameters which have separate IRQ and IO specifiers.
105
106The io port also selects PCI (1) and EISA (2) boards.
107
108 io=0 No board
109 io=1 PCI board
110 io=2 EISA board
111 else ISA board io address
112
113You only need to specify the boards which are present.
114
115 Examples:
116
117 2 PCI boards:
118
119 ip2=1,0,1,0
120
121 1 ISA board at 0x310 irq 5:
122
123 ip2=0x310,5
124
125This can be added to and "append" option in lilo.conf similar to this:
126
127 append="ip2=1,0,1,0"
128
129
1303. INSTALLATION
131
132Previously, the driver sources were packaged with a set of patch files
133to update the character drivers' makefile and configuration file, and other
134kernel source files. A build script (ip2build) was included which applies
135the patches if needed, and build any utilities needed.
136What you receive may be a single patch file in conventional kernel
137patch format build script. That form can also be applied by
138running patch -p1 < ThePatchFile. Otherwise run ip2build.
139
140The driver can be installed as a module (recommended) or built into the
141kernel. This is selected as for other drivers through the `make config`
142command from the root of the Linux source tree. If the driver is built
143into the kernel you will need to edit the file ip2.c to match the boards
144you are installing. See that file for instructions. If the driver is
145installed as a module the configuration can also be specified on the
146modprobe command line as follows:
147
148 modprobe ip2 irq=irq1,irq2,irq3,irq4 io=addr1,addr2,addr3,addr4
149
150where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
15112,15) and addr1-4 are the base addresses for up to four controllers. If
152the irqs are not specified the driver uses the default in ip2.c (which
153selects polled mode). If no base addresses are specified the defaults in
154ip2.c are used. If you are autoloading the driver module with kerneld or
155kmod the base addresses and interrupt number must also be set in ip2.c
156and recompile or just insert and options line in /etc/modprobe.d/*.conf or both.
157The options line is equivalent to the command line and takes precedence over
158what is in ip2.c.
159
160config sample to put /etc/modprobe.d/*.conf:
161 options ip2 io=1,0x328 irq=1,10
162 alias char-major-71 ip2
163 alias char-major-72 ip2
164 alias char-major-73 ip2
165
166The equivalent in ip2.c:
167
168static int io[IP2_MAX_BOARDS]= { 1, 0x328, 0, 0 };
169static int irq[IP2_MAX_BOARDS] = { 1, 10, -1, -1 };
170
171The equivalent for the kernel command line (in lilo.conf):
172
173 append="ip2=1,1,0x328,10"
174
175
176Note: Both io and irq should be updated to reflect YOUR system. An "io"
177 address of 1 or 2 indicates a PCI or EISA card in the board table.
178 The PCI or EISA irq will be assigned automatically.
179
180Specifying an invalid or in-use irq will default the driver into
181running in polled mode for that card. If all irq entries are 0 then
182all cards will operate in polled mode.
183
184If you select the driver as part of the kernel run :
185
186 make zlilo (or whatever you do to create a bootable kernel)
187
188If you selected a module run :
189
190 make modules && make modules_install
191
192The utility ip2mkdev (see 5 and 7 below) creates all the device nodes
193required by the driver. For a device to be created it must be configured
194in the driver and the board must be installed. Only devices corresponding
195to real IntelliPort II ports are created. With multiple boards and expansion
196boxes this will leave gaps in the sequence of device names. ip2mkdev uses
197Linux tty naming conventions: ttyF0 - ttyF255 for normal devices, and
198cuf0 - cuf255 for callout devices.
199
200
2014. USING THE DRIVERS
202
203As noted above, the driver implements the ports in accordance with Linux
204conventions, and the devices should be interchangeable with the standard
205serial devices. (This is a key point for problem reporting: please make
206sure that what you are trying do works on the ttySx/cuax ports first; then
207tell us what went wrong with the ip2 ports!)
208
209Higher speeds can be obtained using the setserial utility which remaps
21038,400 bps (extb) to 57,600 bps, 115,200 bps, or a custom speed.
211Intelliport II installations using the PowerPort expansion module can
212use the custom speed setting to select the highest speeds: 153,600 bps,
213230,400 bps, 307,200 bps, 460,800bps and 921,600 bps. The base for
214custom baud rate configuration is fixed at 921,600 for cards/expansion
215modules with ST654's and 115200 for those with Cirrus CD1400's. This
216corresponds to the maximum bit rates those chips are capable.
217For example if the baud base is 921600 and the baud divisor is 18 then
218the custom rate is 921600/18 = 51200 bps. See the setserial man page for
219complete details. Of course if stty accepts the higher rates now you can
220use that as well as the standard ioctls().
221
222
2235. ip2mkdev and assorted utilities...
224
225Several utilities, including the source for a binary ip2mkdev utility are
226available under .../drivers/char/ip2. These can be build by changing to
227that directory and typing "make" after the kernel has be built. If you do
228not wish to compile the binary utilities, the shell script below can be
229cut out and run as "ip2mkdev" to create the necessary device files. To
230use the ip2mkdev script, you must have procfs enabled and the proc file
231system mounted on /proc.
232
233
2346. NOTES
235
236This is a release version of the driver, but it is impossible to test it
237in all configurations of Linux. If there is any anomalous behaviour that
238does not match the standard serial port's behaviour please let us know.
239
240
2417. ip2mkdev shell script
242
243Previously, this script was simply attached here. It is now attached as a
244shar archive to make it easier to extract the script from the documentation.
245To create the ip2mkdev shell script change to a convenient directory (/tmp
246works just fine) and run the following command:
247
248 unshar Documentation/serial/computone.txt
249 (This file)
250
251You should now have a file ip2mkdev in your current working directory with
252permissions set to execute. Running that script with then create the
253necessary devices for the Computone boards, interfaces, and ports which
254are present on you system at the time it is run.
255
256
257#!/bin/sh
258# This is a shell archive (produced by GNU sharutils 4.2.1).
259# To extract the files from this archive, save it to some FILE, remove
260# everything before the `!/bin/sh' line above, then type `sh FILE'.
261#
262# Made on 2001-10-29 10:32 EST by <mhw@alcove.wittsend.com>.
263# Source directory was `/home2/src/tmp'.
264#
265# Existing files will *not* be overwritten unless `-c' is specified.
266#
267# This shar contains:
268# length mode name
269# ------ ---------- ------------------------------------------
270# 4251 -rwxr-xr-x ip2mkdev
271#
272save_IFS="${IFS}"
273IFS="${IFS}:"
274gettext_dir=FAILED
275locale_dir=FAILED
276first_param="$1"
277for dir in $PATH
278do
279 if test "$gettext_dir" = FAILED && test -f $dir/gettext \
280 && ($dir/gettext --version >/dev/null 2>&1)
281 then
282 set `$dir/gettext --version 2>&1`
283 if test "$3" = GNU
284 then
285 gettext_dir=$dir
286 fi
287 fi
288 if test "$locale_dir" = FAILED && test -f $dir/shar \
289 && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
290 then
291 locale_dir=`$dir/shar --print-text-domain-dir`
292 fi
293done
294IFS="$save_IFS"
295if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
296then
297 echo=echo
298else
299 TEXTDOMAINDIR=$locale_dir
300 export TEXTDOMAINDIR
301 TEXTDOMAIN=sharutils
302 export TEXTDOMAIN
303 echo="$gettext_dir/gettext -s"
304fi
305if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
306 shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
307elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
308 shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
309elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
310 shar_touch='touch -am $3$4$5$6$2 "$8"'
311else
312 shar_touch=:
313 echo
314 $echo 'WARNING: not restoring timestamps. Consider getting and'
315 $echo "installing GNU \`touch', distributed in GNU File Utilities..."
316 echo
317fi
318rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
319#
320if mkdir _sh17581; then
321 $echo 'x -' 'creating lock directory'
322else
323 $echo 'failed to create lock directory'
324 exit 1
325fi
326# ============= ip2mkdev ==============
327if test -f 'ip2mkdev' && test "$first_param" != -c; then
328 $echo 'x -' SKIPPING 'ip2mkdev' '(file already exists)'
329else
330 $echo 'x -' extracting 'ip2mkdev' '(text)'
331 sed 's/^X//' << 'SHAR_EOF' > 'ip2mkdev' &&
332#!/bin/sh -
333#
334# ip2mkdev
335#
336# Make or remove devices as needed for Computone Intelliport drivers
337#
338# First rule! If the dev file exists and you need it, don't mess
339# with it. That prevents us from screwing up open ttys, ownership
340# and permissions on a running system!
341#
342# This script will NOT remove devices that no longer exist if their
343# board or interface box has been removed. If you want to get rid
344# of them, you can manually do an "rm -f /dev/ttyF* /dev/cuaf*"
345# before running this script. Running this script will then recreate
346# all the valid devices.
347#
348# Michael H. Warfield
349# /\/\|=mhw=|\/\/
350# mhw@wittsend.com
351#
352# Updated 10/29/2000 for version 1.2.13 naming convention
353# under devfs. /\/\|=mhw=|\/\/
354#
355# Updated 03/09/2000 for devfs support in ip2 drivers. /\/\|=mhw=|\/\/
356#
357X
358if test -d /dev/ip2 ; then
359# This is devfs mode... We don't do anything except create symlinks
360# from the real devices to the old names!
361X cd /dev
362X echo "Creating symbolic links to devfs devices"
363X for i in `ls ip2` ; do
364X if test ! -L ip2$i ; then
365X # Remove it incase it wasn't a symlink (old device)
366X rm -f ip2$i
367X ln -s ip2/$i ip2$i
368X fi
369X done
370X for i in `( cd tts ; ls F* )` ; do
371X if test ! -L tty$i ; then
372X # Remove it incase it wasn't a symlink (old device)
373X rm -f tty$i
374X ln -s tts/$i tty$i
375X fi
376X done
377X for i in `( cd cua ; ls F* )` ; do
378X DEVNUMBER=`expr $i : 'F\(.*\)'`
379X if test ! -L cuf$DEVNUMBER ; then
380X # Remove it incase it wasn't a symlink (old device)
381X rm -f cuf$DEVNUMBER
382X ln -s cua/$i cuf$DEVNUMBER
383X fi
384X done
385X exit 0
386fi
387X
388if test ! -f /proc/tty/drivers
389then
390X echo "\
391Unable to check driver status.
392Make sure proc file system is mounted."
393X
394X exit 255
395fi
396X
397if test ! -f /proc/tty/driver/ip2
398then
399X echo "\
400Unable to locate ip2 proc file.
401Attempting to load driver"
402X
403X if /sbin/insmod ip2
404X then
405X if test ! -f /proc/tty/driver/ip2
406X then
407X echo "\
408Unable to locate ip2 proc file after loading driver.
409Driver initialization failure or driver version error.
410"
411X exit 255
412X fi
413X else
414X echo "Unable to load ip2 driver."
415X exit 255
416X fi
417fi
418X
419# Ok... So we got the driver loaded and we can locate the procfs files.
420# Next we need our major numbers.
421X
422TTYMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/tt/!d' -e 's/.*tt[^ ]*[ ]*\([0-9]*\)[ ]*.*/\1/' < /proc/tty/drivers`
423CUAMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/cu/!d' -e 's/.*cu[^ ]*[ ]*\([0-9]*\)[ ]*.*/\1/' < /proc/tty/drivers`
424BRDMAJOR=`sed -e '/^Driver: /!d' -e 's/.*IMajor=\([0-9]*\)[ ]*.*/\1/' < /proc/tty/driver/ip2`
425X
426echo "\
427TTYMAJOR = $TTYMAJOR
428CUAMAJOR = $CUAMAJOR
429BRDMAJOR = $BRDMAJOR
430"
431X
432# Ok... Now we should know our major numbers, if appropriate...
433# Now we need our boards and start the device loops.
434X
435grep '^Board [0-9]:' /proc/tty/driver/ip2 | while read token number type alltherest
436do
437X # The test for blank "type" will catch the stats lead-in lines
438X # if they exist in the file
439X if test "$type" = "vacant" -o "$type" = "Vacant" -o "$type" = ""
440X then
441X continue
442X fi
443X
444X BOARDNO=`expr "$number" : '\([0-9]\):'`
445X PORTS=`expr "$alltherest" : '.*ports=\([0-9]*\)' | tr ',' ' '`
446X MINORS=`expr "$alltherest" : '.*minors=\([0-9,]*\)' | tr ',' ' '`
447X
448X if test "$BOARDNO" = "" -o "$PORTS" = ""
449X then
450# This may be a bug. We should at least get this much information
451X echo "Unable to process board line"
452X continue
453X fi
454X
455X if test "$MINORS" = ""
456X then
457# Silently skip this one. This board seems to have no boxes
458X continue
459X fi
460X
461X echo "board $BOARDNO: $type ports = $PORTS; port numbers = $MINORS"
462X
463X if test "$BRDMAJOR" != ""
464X then
465X BRDMINOR=`expr $BOARDNO \* 4`
466X STSMINOR=`expr $BRDMINOR + 1`
467X if test ! -c /dev/ip2ipl$BOARDNO ; then
468X mknod /dev/ip2ipl$BOARDNO c $BRDMAJOR $BRDMINOR
469X fi
470X if test ! -c /dev/ip2stat$BOARDNO ; then
471X mknod /dev/ip2stat$BOARDNO c $BRDMAJOR $STSMINOR
472X fi
473X fi
474X
475X if test "$TTYMAJOR" != ""
476X then
477X PORTNO=$BOARDBASE
478X
479X for PORTNO in $MINORS
480X do
481X if test ! -c /dev/ttyF$PORTNO ; then
482X # We got the hardware but no device - make it
483X mknod /dev/ttyF$PORTNO c $TTYMAJOR $PORTNO
484X fi
485X done
486X fi
487X
488X if test "$CUAMAJOR" != ""
489X then
490X PORTNO=$BOARDBASE
491X
492X for PORTNO in $MINORS
493X do
494X if test ! -c /dev/cuf$PORTNO ; then
495X # We got the hardware but no device - make it
496X mknod /dev/cuf$PORTNO c $CUAMAJOR $PORTNO
497X fi
498X done
499X fi
500done
501X
502Xexit 0
503SHAR_EOF
504 (set 20 01 10 29 10 32 01 'ip2mkdev'; eval "$shar_touch") &&
505 chmod 0755 'ip2mkdev' ||
506 $echo 'restore of' 'ip2mkdev' 'failed'
507 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
508 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
509 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
510 || $echo 'ip2mkdev:' 'MD5 check failed'
511cb5717134509f38bad9fde6b1f79b4a4 ip2mkdev
512SHAR_EOF
513 else
514 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ip2mkdev'`"
515 test 4251 -eq "$shar_count" ||
516 $echo 'ip2mkdev:' 'original size' '4251,' 'current size' "$shar_count!"
517 fi
518fi
519rm -fr _sh17581
520exit 0
diff --git a/Documentation/smsc_ece1099.txt b/Documentation/smsc_ece1099.txt
new file mode 100644
index 000000000000..6b492e82b43d
--- /dev/null
+++ b/Documentation/smsc_ece1099.txt
@@ -0,0 +1,56 @@
1What is smsc-ece1099?
2----------------------
3
4The ECE1099 is a 40-Pin 3.3V Keyboard Scan Expansion
5or GPIO Expansion device. The device supports a keyboard
6scan matrix of 23x8. The device is connected to a Master
7via the SMSC BC-Link interface or via the SMBus.
8Keypad scan Input(KSI) and Keypad Scan Output(KSO) signals
9are multiplexed with GPIOs.
10
11Interrupt generation
12--------------------
13
14Interrupts can be generated by an edge detection on a GPIO
15pin or an edge detection on one of the bus interface pins.
16Interrupts can also be detected on the keyboard scan interface.
17The bus interrupt pin (BC_INT# or SMBUS_INT#) is asserted if
18any bit in one of the Interrupt Status registers is 1 and
19the corresponding Interrupt Mask bit is also 1.
20
21In order for software to determine which device is the source
22of an interrupt, it should first read the Group Interrupt Status Register
23to determine which Status register group is a source for the interrupt.
24Software should read both the Status register and the associated Mask register,
25then AND the two values together. Bits that are 1 in the result of the AND
26are active interrupts. Software clears an interrupt by writing a 1 to the
27corresponding bit in the Status register.
28
29Communication Protocol
30----------------------
31
32- SMbus slave Interface
33 The host processor communicates with the ECE1099 device
34 through a series of read/write registers via the SMBus
35 interface. SMBus is a serial communication protocol between
36 a computer host and its peripheral devices. The SMBus data
37 rate is 10KHz minimum to 400 KHz maximum
38
39- Slave Bus Interface
40 The ECE1099 device SMBus implementation is a subset of the
41 SMBus interface to the host. The device is a slave-only SMBus device.
42 The implementation in the device is a subset of SMBus since it
43 only supports four protocols.
44
45 The Write Byte, Read Byte, Send Byte, and Receive Byte protocols are the
46 only valid SMBus protocols for the device.
47
48- BC-LinkTM Interface
49 The BC-Link is a proprietary bus that allows communication
50 between a Master device and a Companion device. The Master
51 device uses this serial bus to read and write registers
52 located on the Companion device. The bus comprises three signals,
53 BC_CLK, BC_DAT and BC_INT#. The Master device always provides the
54 clock, BC_CLK, and the Companion device is the source for an
55 independent asynchronous interrupt signal, BC_INT#. The ECE1099
56 supports BC-Link speeds up to 24MHz.
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 4e4d0bc9816f..d90d8ec2853d 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -860,8 +860,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
860 860
861 [Multiple options for each card instance] 861 [Multiple options for each card instance]
862 model - force the model name 862 model - force the model name
863 position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF, 863 position_fix - Fix DMA pointer
864 3 = VIACOMBO, 4 = COMBO) 864 -1 = system default: choose appropriate one per controller
865 hardware
866 0 = auto: falls back to LPIB when POSBUF doesn't work
867 1 = use LPIB
868 2 = POSBUF: use position buffer
869 3 = VIACOMBO: VIA-specific workaround for capture
870 4 = COMBO: use LPIB for playback, auto for capture stream
865 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) 871 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots)
866 When the bit 8 (0x100) is set, the lower 8 bits are used 872 When the bit 8 (0x100) is set, the lower 8 bits are used
867 as the "fixed" codec slots; i.e. the driver probes the 873 as the "fixed" codec slots; i.e. the driver probes the
diff --git a/Documentation/sound/alsa/Channel-Mapping-API.txt b/Documentation/sound/alsa/Channel-Mapping-API.txt
new file mode 100644
index 000000000000..3c43d1a4ca0e
--- /dev/null
+++ b/Documentation/sound/alsa/Channel-Mapping-API.txt
@@ -0,0 +1,153 @@
1ALSA PCM channel-mapping API
2============================
3 Takashi Iwai <tiwai@suse.de>
4
5GENERAL
6-------
7
8The channel mapping API allows user to query the possible channel maps
9and the current channel map, also optionally to modify the channel map
10of the current stream.
11
12A channel map is an array of position for each PCM channel.
13Typically, a stereo PCM stream has a channel map of
14 { front_left, front_right }
15while a 4.0 surround PCM stream has a channel map of
16 { front left, front right, rear left, rear right }.
17
18The problem, so far, was that we had no standard channel map
19explicitly, and applications had no way to know which channel
20corresponds to which (speaker) position. Thus, applications applied
21wrong channels for 5.1 outputs, and you hear suddenly strange sound
22from rear. Or, some devices secretly assume that center/LFE is the
23third/fourth channels while others that C/LFE as 5th/6th channels.
24
25Also, some devices such as HDMI are configurable for different speaker
26positions even with the same number of total channels. However, there
27was no way to specify this because of lack of channel map
28specification. These are the main motivations for the new channel
29mapping API.
30
31
32DESIGN
33------
34
35Actually, "the channel mapping API" doesn't introduce anything new in
36the kernel/user-space ABI perspective. It uses only the existing
37control element features.
38
39As a ground design, each PCM substream may contain a control element
40providing the channel mapping information and configuration. This
41element is specified by:
42 iface = SNDRV_CTL_ELEM_IFACE_PCM
43 name = "Playback Channel Map" or "Capture Channel Map"
44 device = the same device number for the assigned PCM substream
45 index = the same index number for the assigned PCM substream
46
47Note the name is different depending on the PCM substream direction.
48
49Each control element provides at least the TLV read operation and the
50read operation. Optionally, the write operation can be provided to
51allow user to change the channel map dynamically.
52
53* TLV
54
55The TLV operation gives the list of available channel
56maps. A list item of a channel map is usually a TLV of
57 type data-bytes ch0 ch1 ch2...
58where type is the TLV type value, the second argument is the total
59bytes (not the numbers) of channel values, and the rest are the
60position value for each channel.
61
62As a TLV type, either SNDRV_CTL_TLVT_CHMAP_FIXED,
63SNDRV_CTL_TLV_CHMAP_VAR or SNDRV_CTL_TLVT_CHMAP_PAIRED can be used.
64The _FIXED type is for a channel map with the fixed channel position
65while the latter two are for flexible channel positions. _VAR type is
66for a channel map where all channels are freely swappable and _PAIRED
67type is where pair-wise channels are swappable. For example, when you
68have {FL/FR/RL/RR} channel map, _PAIRED type would allow you to swap
69only {RL/RR/FL/FR} while _VAR type would allow even swapping FL and
70RR.
71
72These new TLV types are defined in sound/tlv.h.
73
74The available channel position values are defined in sound/asound.h,
75here is a cut:
76
77/* channel positions */
78enum {
79 SNDRV_CHMAP_UNKNOWN = 0,
80 SNDRV_CHMAP_NA, /* N/A, silent */
81 SNDRV_CHMAP_MONO, /* mono stream */
82 /* this follows the alsa-lib mixer channel value + 3 */
83 SNDRV_CHMAP_FL, /* front left */
84 SNDRV_CHMAP_FR, /* front right */
85 SNDRV_CHMAP_RL, /* rear left */
86 SNDRV_CHMAP_RR, /* rear right */
87 SNDRV_CHMAP_FC, /* front center */
88 SNDRV_CHMAP_LFE, /* LFE */
89 SNDRV_CHMAP_SL, /* side left */
90 SNDRV_CHMAP_SR, /* side right */
91 SNDRV_CHMAP_RC, /* rear center */
92 /* new definitions */
93 SNDRV_CHMAP_FLC, /* front left center */
94 SNDRV_CHMAP_FRC, /* front right center */
95 SNDRV_CHMAP_RLC, /* rear left center */
96 SNDRV_CHMAP_RRC, /* rear right center */
97 SNDRV_CHMAP_FLW, /* front left wide */
98 SNDRV_CHMAP_FRW, /* front right wide */
99 SNDRV_CHMAP_FLH, /* front left high */
100 SNDRV_CHMAP_FCH, /* front center high */
101 SNDRV_CHMAP_FRH, /* front right high */
102 SNDRV_CHMAP_TC, /* top center */
103 SNDRV_CHMAP_TFL, /* top front left */
104 SNDRV_CHMAP_TFR, /* top front right */
105 SNDRV_CHMAP_TFC, /* top front center */
106 SNDRV_CHMAP_TRL, /* top rear left */
107 SNDRV_CHMAP_TRR, /* top rear right */
108 SNDRV_CHMAP_TRC, /* top rear center */
109 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
110};
111
112When a PCM stream can provide more than one channel map, you can
113provide multiple channel maps in a TLV container type. The TLV data
114to be returned will contain such as:
115 SNDRV_CTL_TLVT_CONTAINER 96
116 SNDRV_CTL_TLVT_CHMAP_FIXED 4 SNDRV_CHMAP_FC
117 SNDRV_CTL_TLVT_CHMAP_FIXED 8 SNDRV_CHMAP_FL SNDRV_CHMAP_FR
118 SNDRV_CTL_TLVT_CHMAP_FIXED 16 NDRV_CHMAP_FL SNDRV_CHMAP_FR \
119 SNDRV_CHMAP_RL SNDRV_CHMAP_RR
120
121The channel position is provided in LSB 16bits. The upper bits are
122used for bit flags.
123
124#define SNDRV_CHMAP_POSITION_MASK 0xffff
125#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
126#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
127
128SNDRV_CHMAP_PHASE_INVERSE indicates the channel is phase inverted,
129(thus summing left and right channels would result in almost silence).
130Some digital mic devices have this.
131
132When SNDRV_CHMAP_DRIVER_SPEC is set, all the channel position values
133don't follow the standard definition above but driver-specific.
134
135* READ OPERATION
136
137The control read operation is for providing the current channel map of
138the given stream. The control element returns an integer array
139containing the position of each channel.
140
141When this is performed before the number of the channel is specified
142(i.e. hw_params is set), it should return all channels set to
143UNKNOWN.
144
145* WRITE OPERATION
146
147The control write operation is optional, and only for devices that can
148change the channel configuration on the fly, such as HDMI. User needs
149to pass an integer value containing the valid channel positions for
150all channels of the assigned PCM substream.
151
152This operation is allowed only at PCM PREPARED state. When called in
153other states, it shall return an error.
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index a92bba816843..16dfe57f1731 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -74,7 +74,8 @@ CMI9880
74 74
75AD1882 / AD1882A 75AD1882 / AD1882A
76================ 76================
77 3stack 3-stack mode (default) 77 3stack 3-stack mode
78 3stack-automute 3-stack with automute front HP (default)
78 6stack 6-stack mode 79 6stack 6-stack mode
79 80
80AD1884A / AD1883 / AD1984A / AD1984B 81AD1884A / AD1883 / AD1984A / AD1984B
diff --git a/Documentation/spi/ep93xx_spi b/Documentation/spi/ep93xx_spi
index d8eb01c15db1..832ddce6e5fb 100644
--- a/Documentation/spi/ep93xx_spi
+++ b/Documentation/spi/ep93xx_spi
@@ -26,7 +26,7 @@ arch/arm/mach-ep93xx/ts72xx.c:
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28 28
29#include <mach/ep93xx_spi.h> 29#include <linux/platform_data/spi-ep93xx.h>
30 30
31/* this is our GPIO line used for chip select */ 31/* this is our GPIO line used for chip select */
32#define MMC_CHIP_SELECT_GPIO EP93XX_GPIO_LINE_EGPIO9 32#define MMC_CHIP_SELECT_GPIO EP93XX_GPIO_LINE_EGPIO9
diff --git a/Documentation/spi/spi-sc18is602 b/Documentation/spi/spi-sc18is602
new file mode 100644
index 000000000000..a45702865a38
--- /dev/null
+++ b/Documentation/spi/spi-sc18is602
@@ -0,0 +1,36 @@
1Kernel driver spi-sc18is602
2===========================
3
4Supported chips:
5 * NXP SI18IS602/602B/603
6 Datasheet: http://www.nxp.com/documents/data_sheet/SC18IS602_602B_603.pdf
7
8Author:
9 Guenter Roeck <linux@roeck-us.net>
10
11
12Description
13-----------
14
15This driver provides connects a NXP SC18IS602/603 I2C-bus to SPI bridge to the
16kernel's SPI core subsystem.
17
18The driver does not probe for supported chips, since the SI18IS602/603 does not
19support Chip ID registers. You will have to instantiate the devices explicitly.
20Please see Documentation/i2c/instantiating-devices for details.
21
22
23Usage Notes
24-----------
25
26This driver requires the I2C adapter driver to support raw I2C messages. I2C
27adapter drivers which can only handle the SMBus protocol are not supported.
28
29The maximum SPI message size supported by SC18IS602/603 is 200 bytes. Attempts
30to initiate longer transfers will fail with -EINVAL. EEPROM read operations and
31similar large accesses have to be split into multiple chunks of no more than
32200 bytes per SPI message (128 bytes of data per message is recommended). This
33means that programs such as "cp" or "od", which automatically use large block
34sizes to access a device, can not be used directly to read data from EEPROM.
35Programs such as dd, where the block size can be specified, should be used
36instead.
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 6d78841fd416..2907ba6c3607 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -181,6 +181,8 @@ core_pattern is used to specify a core dumpfile pattern name.
181 %p pid 181 %p pid
182 %u uid 182 %u uid
183 %g gid 183 %g gid
184 %d dump mode, matches PR_SET_DUMPABLE and
185 /proc/sys/fs/suid_dumpable
184 %s signal number 186 %s signal number
185 %t UNIX time of dump 187 %t UNIX time of dump
186 %h hostname 188 %h hostname
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
index d0d0bb9e3e25..d68ea5fc812b 100644
--- a/Documentation/trace/kprobetrace.txt
+++ b/Documentation/trace/kprobetrace.txt
@@ -12,7 +12,7 @@ kprobes can probe (this means, all functions body except for __kprobes
12functions). Unlike the Tracepoint based event, this can be added and removed 12functions). Unlike the Tracepoint based event, this can be added and removed
13dynamically, on the fly. 13dynamically, on the fly.
14 14
15To enable this feature, build your kernel with CONFIG_KPROBE_TRACING=y. 15To enable this feature, build your kernel with CONFIG_KPROBE_EVENT=y.
16 16
17Similar to the events tracer, this doesn't need to be activated via 17Similar to the events tracer, this doesn't need to be activated via
18current_tracer. Instead of that, add probe points via 18current_tracer. Instead of that, add probe points via
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt
index 074b159b77c2..35d70eda9ad6 100644
--- a/Documentation/usb/persist.txt
+++ b/Documentation/usb/persist.txt
@@ -155,6 +155,9 @@ If the kernel gets fooled in this way, it's almost certain to cause
155data corruption and to crash your system. You'll have no one to blame 155data corruption and to crash your system. You'll have no one to blame
156but yourself. 156but yourself.
157 157
158For those devices with avoid_reset_quirk attribute being set, persist
159maybe fail because they may morph after reset.
160
158YOU HAVE BEEN WARNED! USE AT YOUR OWN RISK! 161YOU HAVE BEEN WARNED! USE AT YOUR OWN RISK!
159 162
160That having been said, most of the time there shouldn't be any trouble 163That having been said, most of the time there shouldn't be any trouble
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index 652aecd13199..1299b5e82d7f 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -35,3 +35,4 @@
35 34 -> TerraTec Cinergy T PCIe Dual [153b:117e] 35 34 -> TerraTec Cinergy T PCIe Dual [153b:117e]
36 35 -> TeVii S471 [d471:9022] 36 35 -> TeVii S471 [d471:9022]
37 36 -> Hauppauge WinTV-HVR1255 [0070:2259] 37 36 -> Hauppauge WinTV-HVR1255 [0070:2259]
38 37 -> Prof Revolution DVB-S2 8000 [8000:3034]
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt
index 6e680fec1e9c..0b69e4ee8e31 100644
--- a/Documentation/video4linux/CQcam.txt
+++ b/Documentation/video4linux/CQcam.txt
@@ -18,7 +18,7 @@ Table of Contents
18 18
191.0 Introduction 191.0 Introduction
20 20
21 The file ../../drivers/media/video/c-qcam.c is a device driver for 21 The file ../../drivers/media/parport/c-qcam.c is a device driver for
22the Logitech (nee Connectix) parallel port interface color CCD camera. 22the Logitech (nee Connectix) parallel port interface color CCD camera.
23This is a fairly inexpensive device for capturing images. Logitech 23This is a fairly inexpensive device for capturing images. Logitech
24does not currently provide information for developers, but many people 24does not currently provide information for developers, but many people
diff --git a/Documentation/video4linux/README.davinci-vpbe b/Documentation/video4linux/README.davinci-vpbe
index 7a460b0685bb..dc9a297f49c3 100644
--- a/Documentation/video4linux/README.davinci-vpbe
+++ b/Documentation/video4linux/README.davinci-vpbe
@@ -5,22 +5,22 @@
5 File partitioning 5 File partitioning
6 ----------------- 6 -----------------
7 V4L2 display device driver 7 V4L2 display device driver
8 drivers/media/video/davinci/vpbe_display.c 8 drivers/media/platform/davinci/vpbe_display.c
9 drivers/media/video/davinci/vpbe_display.h 9 drivers/media/platform/davinci/vpbe_display.h
10 10
11 VPBE display controller 11 VPBE display controller
12 drivers/media/video/davinci/vpbe.c 12 drivers/media/platform/davinci/vpbe.c
13 drivers/media/video/davinci/vpbe.h 13 drivers/media/platform/davinci/vpbe.h
14 14
15 VPBE venc sub device driver 15 VPBE venc sub device driver
16 drivers/media/video/davinci/vpbe_venc.c 16 drivers/media/platform/davinci/vpbe_venc.c
17 drivers/media/video/davinci/vpbe_venc.h 17 drivers/media/platform/davinci/vpbe_venc.h
18 drivers/media/video/davinci/vpbe_venc_regs.h 18 drivers/media/platform/davinci/vpbe_venc_regs.h
19 19
20 VPBE osd driver 20 VPBE osd driver
21 drivers/media/video/davinci/vpbe_osd.c 21 drivers/media/platform/davinci/vpbe_osd.c
22 drivers/media/video/davinci/vpbe_osd.h 22 drivers/media/platform/davinci/vpbe_osd.h
23 drivers/media/video/davinci/vpbe_osd_regs.h 23 drivers/media/platform/davinci/vpbe_osd_regs.h
24 24
25 Functional partitioning 25 Functional partitioning
26 ----------------------- 26 -----------------------
diff --git a/Documentation/video4linux/fimc.txt b/Documentation/video4linux/fimc.txt
index eb049708f3e4..fd02d9a4930a 100644
--- a/Documentation/video4linux/fimc.txt
+++ b/Documentation/video4linux/fimc.txt
@@ -10,7 +10,7 @@ data from LCD controller (FIMD) through the SoC internal writeback data
10path. There are multiple FIMC instances in the SoCs (up to 4), having 10path. There are multiple FIMC instances in the SoCs (up to 4), having
11slightly different capabilities, like pixel alignment constraints, rotator 11slightly different capabilities, like pixel alignment constraints, rotator
12availability, LCD writeback support, etc. The driver is located at 12availability, LCD writeback support, etc. The driver is located at
13drivers/media/video/s5p-fimc directory. 13drivers/media/platform/s5p-fimc directory.
14 14
151. Supported SoCs 151. Supported SoCs
16================= 16=================
@@ -36,21 +36,21 @@ Not currently supported:
36===================== 36=====================
37 37
38- media device driver 38- media device driver
39 drivers/media/video/s5p-fimc/fimc-mdevice.[ch] 39 drivers/media/platform/s5p-fimc/fimc-mdevice.[ch]
40 40
41 - camera capture video device driver 41 - camera capture video device driver
42 drivers/media/video/s5p-fimc/fimc-capture.c 42 drivers/media/platform/s5p-fimc/fimc-capture.c
43 43
44 - MIPI-CSI2 receiver subdev 44 - MIPI-CSI2 receiver subdev
45 drivers/media/video/s5p-fimc/mipi-csis.[ch] 45 drivers/media/platform/s5p-fimc/mipi-csis.[ch]
46 46
47 - video post-processor (mem-to-mem) 47 - video post-processor (mem-to-mem)
48 drivers/media/video/s5p-fimc/fimc-core.c 48 drivers/media/platform/s5p-fimc/fimc-core.c
49 49
50 - common files 50 - common files
51 drivers/media/video/s5p-fimc/fimc-core.h 51 drivers/media/platform/s5p-fimc/fimc-core.h
52 drivers/media/video/s5p-fimc/fimc-reg.h 52 drivers/media/platform/s5p-fimc/fimc-reg.h
53 drivers/media/video/s5p-fimc/regs-fimc.h 53 drivers/media/platform/s5p-fimc/regs-fimc.h
54 54
554. User space interfaces 554. User space interfaces
56======================== 56========================
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/video4linux/omap3isp.txt
index 5dd1439b61fd..b9a9f83b1587 100644
--- a/Documentation/video4linux/omap3isp.txt
+++ b/Documentation/video4linux/omap3isp.txt
@@ -12,7 +12,7 @@ Introduction
12============ 12============
13 13
14This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP) 14This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP)
15driver located under drivers/media/video/omap3isp. The original driver was 15driver located under drivers/media/platform/omap3isp. The original driver was
16written by Texas Instruments but since that it has been rewritten (twice) at 16written by Texas Instruments but since that it has been rewritten (twice) at
17Nokia. 17Nokia.
18 18
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index 43da22b89728..54270df99d5c 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -594,7 +594,11 @@ handler and finally add the first handler to the second. For example:
594 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...); 594 v4l2_ctrl_new_std(&radio_ctrl_handler, &radio_ops, V4L2_CID_AUDIO_MUTE, ...);
595 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...); 595 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_BRIGHTNESS, ...);
596 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_CONTRAST, ...); 596 v4l2_ctrl_new_std(&video_ctrl_handler, &video_ops, V4L2_CID_CONTRAST, ...);
597 v4l2_ctrl_add_handler(&video_ctrl_handler, &radio_ctrl_handler); 597 v4l2_ctrl_add_handler(&video_ctrl_handler, &radio_ctrl_handler, NULL);
598
599The last argument to v4l2_ctrl_add_handler() is a filter function that allows
600you to filter which controls will be added. Set it to NULL if you want to add
601all controls.
598 602
599Or you can add specific controls to a handler: 603Or you can add specific controls to a handler:
600 604
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index 89318be6c1d2..32bfe926e8d7 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -583,11 +583,19 @@ You should also set these fields:
583 583
584- name: set to something descriptive and unique. 584- name: set to something descriptive and unique.
585 585
586- vfl_dir: set this to VFL_DIR_RX for capture devices (VFL_DIR_RX has value 0,
587 so this is normally already the default), set to VFL_DIR_TX for output
588 devices and VFL_DIR_M2M for mem2mem (codec) devices.
589
586- fops: set to the v4l2_file_operations struct. 590- fops: set to the v4l2_file_operations struct.
587 591
588- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance 592- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
589 (highly recommended to use this and it might become compulsory in the 593 (highly recommended to use this and it might become compulsory in the
590 future!), then set this to your v4l2_ioctl_ops struct. 594 future!), then set this to your v4l2_ioctl_ops struct. The vfl_type and
595 vfl_dir fields are used to disable ops that do not match the type/dir
596 combination. E.g. VBI ops are disabled for non-VBI nodes, and output ops
597 are disabled for a capture device. This makes it possible to provide
598 just one v4l2_ioctl_ops struct for both vbi and video nodes.
591 599
592- lock: leave to NULL if you want to do all the locking in the driver. 600- lock: leave to NULL if you want to do all the locking in the driver.
593 Otherwise you give it a pointer to a struct mutex_lock and before the 601 Otherwise you give it a pointer to a struct mutex_lock and before the
@@ -1054,4 +1062,4 @@ The first event type in the class is reserved for future use, so the first
1054available event type is 'class base + 1'. 1062available event type is 'class base + 1'.
1055 1063
1056An example on how the V4L2 events may be used can be found in the OMAP 1064An example on how the V4L2 events may be used can be found in the OMAP
10573 ISP driver (drivers/media/video/omap3isp). 10653 ISP driver (drivers/media/platform/omap3isp).
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf
index 1d00d7f15b8f..3ffe9e960b6f 100644
--- a/Documentation/video4linux/videobuf
+++ b/Documentation/video4linux/videobuf
@@ -349,7 +349,7 @@ again.
349Developers who are interested in more information can go into the relevant 349Developers who are interested in more information can go into the relevant
350header files; there are a few low-level functions declared there which have 350header files; there are a few low-level functions declared there which have
351not been talked about here. Also worthwhile is the vivi driver 351not been talked about here. Also worthwhile is the vivi driver
352(drivers/media/video/vivi.c), which is maintained as an example of how V4L2 352(drivers/media/platform/vivi.c), which is maintained as an example of how V4L2
353drivers should be written. Vivi only uses the vmalloc() API, but it's good 353drivers should be written. Vivi only uses the vmalloc() API, but it's good
354enough to get started with. Note also that all of these calls are exported 354enough to get started with. Note also that all of these calls are exported
355GPL-only, so they will not be available to non-GPL kernel modules. 355GPL-only, so they will not be available to non-GPL kernel modules.
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index bf33aaa4c59f..f6ec3a92e621 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -857,7 +857,8 @@ struct kvm_userspace_memory_region {
857}; 857};
858 858
859/* for kvm_memory_region::flags */ 859/* for kvm_memory_region::flags */
860#define KVM_MEM_LOG_DIRTY_PAGES 1UL 860#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
861#define KVM_MEM_READONLY (1UL << 1)
861 862
862This ioctl allows the user to create or modify a guest physical memory 863This ioctl allows the user to create or modify a guest physical memory
863slot. When changing an existing slot, it may be moved in the guest 864slot. When changing an existing slot, it may be moved in the guest
@@ -873,14 +874,17 @@ It is recommended that the lower 21 bits of guest_phys_addr and userspace_addr
873be identical. This allows large pages in the guest to be backed by large 874be identical. This allows large pages in the guest to be backed by large
874pages in the host. 875pages in the host.
875 876
876The flags field supports just one flag, KVM_MEM_LOG_DIRTY_PAGES, which 877The flags field supports two flag, KVM_MEM_LOG_DIRTY_PAGES, which instructs
877instructs kvm to keep track of writes to memory within the slot. See 878kvm to keep track of writes to memory within the slot. See KVM_GET_DIRTY_LOG
878the KVM_GET_DIRTY_LOG ioctl. 879ioctl. The KVM_CAP_READONLY_MEM capability indicates the availability of the
880KVM_MEM_READONLY flag. When this flag is set for a memory region, KVM only
881allows read accesses. Writes will be posted to userspace as KVM_EXIT_MMIO
882exits.
879 883
880When the KVM_CAP_SYNC_MMU capability, changes in the backing of the memory 884When the KVM_CAP_SYNC_MMU capability is available, changes in the backing of
881region are automatically reflected into the guest. For example, an mmap() 885the memory region are automatically reflected into the guest. For example, an
882that affects the region will be made visible immediately. Another example 886mmap() that affects the region will be made visible immediately. Another
883is madvise(MADV_DROP). 887example is madvise(MADV_DROP).
884 888
885It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl. 889It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl.
886The KVM_SET_MEMORY_REGION does not allow fine grained control over memory 890The KVM_SET_MEMORY_REGION does not allow fine grained control over memory
@@ -1946,6 +1950,19 @@ the guest using the specified gsi pin. The irqfd is removed using
1946the KVM_IRQFD_FLAG_DEASSIGN flag, specifying both kvm_irqfd.fd 1950the KVM_IRQFD_FLAG_DEASSIGN flag, specifying both kvm_irqfd.fd
1947and kvm_irqfd.gsi. 1951and kvm_irqfd.gsi.
1948 1952
1953With KVM_CAP_IRQFD_RESAMPLE, KVM_IRQFD supports a de-assert and notify
1954mechanism allowing emulation of level-triggered, irqfd-based
1955interrupts. When KVM_IRQFD_FLAG_RESAMPLE is set the user must pass an
1956additional eventfd in the kvm_irqfd.resamplefd field. When operating
1957in resample mode, posting of an interrupt through kvm_irq.fd asserts
1958the specified gsi in the irqchip. When the irqchip is resampled, such
1959as from an EOI, the gsi is de-asserted and the user is notifed via
1960kvm_irqfd.resamplefd. It is the user's responsibility to re-queue
1961the interrupt if the device making use of it still requires service.
1962Note that closing the resamplefd is not sufficient to disable the
1963irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment
1964and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.
1965
19494.76 KVM_PPC_ALLOCATE_HTAB 19664.76 KVM_PPC_ALLOCATE_HTAB
1950 1967
1951Capability: KVM_CAP_PPC_ALLOC_HTAB 1968Capability: KVM_CAP_PPC_ALLOC_HTAB
diff --git a/Documentation/virtual/kvm/hypercalls.txt b/Documentation/virtual/kvm/hypercalls.txt
new file mode 100644
index 000000000000..ea113b5d87a4
--- /dev/null
+++ b/Documentation/virtual/kvm/hypercalls.txt
@@ -0,0 +1,66 @@
1Linux KVM Hypercall:
2===================
3X86:
4 KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall
5 instruction. The hypervisor can replace it with instructions that are
6 guaranteed to be supported.
7
8 Up to four arguments may be passed in rbx, rcx, rdx, and rsi respectively.
9 The hypercall number should be placed in rax and the return value will be
10 placed in rax. No other registers will be clobbered unless explicitly stated
11 by the particular hypercall.
12
13S390:
14 R2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall
15 number. The return value is written to R2.
16
17 S390 uses diagnose instruction as hypercall (0x500) along with hypercall
18 number in R1.
19
20 PowerPC:
21 It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.
22 Return value is placed in R3.
23
24 KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions'
25 property inside the device tree's /hypervisor node.
26 For more information refer to Documentation/virtual/kvm/ppc-pv.txt
27
28KVM Hypercalls Documentation
29===========================
30The template for each hypercall is:
311. Hypercall name.
322. Architecture(s)
333. Status (deprecated, obsolete, active)
344. Purpose
35
361. KVM_HC_VAPIC_POLL_IRQ
37------------------------
38Architecture: x86
39Status: active
40Purpose: Trigger guest exit so that the host can check for pending
41interrupts on reentry.
42
432. KVM_HC_MMU_OP
44------------------------
45Architecture: x86
46Status: deprecated.
47Purpose: Support MMU operations such as writing to PTE,
48flushing TLB, release PT.
49
503. KVM_HC_FEATURES
51------------------------
52Architecture: PPC
53Status: active
54Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
55used to enumerate which hypercalls are available. On PPC, either device tree
56based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration
57mechanism (which is this hypercall) can be used.
58
594. KVM_HC_PPC_MAP_MAGIC_PAGE
60------------------------
61Architecture: PPC
62Status: active
63Purpose: To enable communication between the hypervisor and guest there is a
64shared page that contains parts of supervisor visible register state.
65The guest can map this shared page to access its supervisor register through
66memory using this hypercall.
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 730471048583..6d470ae7b073 100644
--- a/Documentation/virtual/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -34,9 +34,12 @@ MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00
34 time information and check that they are both equal and even. 34 time information and check that they are both equal and even.
35 An odd version indicates an in-progress update. 35 An odd version indicates an in-progress update.
36 36
37 sec: number of seconds for wallclock. 37 sec: number of seconds for wallclock at time of boot.
38 38
39 nsec: number of nanoseconds for wallclock. 39 nsec: number of nanoseconds for wallclock at time of boot.
40
41 In order to get the current wallclock time, the system_time from
42 MSR_KVM_SYSTEM_TIME_NEW needs to be added.
40 43
41 Note that although MSRs are per-CPU entities, the effect of this 44 Note that although MSRs are per-CPU entities, the effect of this
42 particular MSR is global. 45 particular MSR is global.
@@ -82,20 +85,25 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01
82 time at the time this structure was last updated. Unit is 85 time at the time this structure was last updated. Unit is
83 nanoseconds. 86 nanoseconds.
84 87
85 tsc_to_system_mul: a function of the tsc frequency. One has 88 tsc_to_system_mul: multiplier to be used when converting
86 to multiply any tsc-related quantity by this value to get 89 tsc-related quantity to nanoseconds
87 a value in nanoseconds, besides dividing by 2^tsc_shift
88 90
89 tsc_shift: cycle to nanosecond divider, as a power of two, to 91 tsc_shift: shift to be used when converting tsc-related
90 allow for shift rights. One has to shift right any tsc-related 92 quantity to nanoseconds. This shift will ensure that
91 quantity by this value to get a value in nanoseconds, besides 93 multiplication with tsc_to_system_mul does not overflow.
92 multiplying by tsc_to_system_mul. 94 A positive value denotes a left shift, a negative value
95 a right shift.
93 96
94 With this information, guests can derive per-CPU time by 97 The conversion from tsc to nanoseconds involves an additional
95 doing: 98 right shift by 32 bits. With this information, guests can
99 derive per-CPU time by doing:
96 100
97 time = (current_tsc - tsc_timestamp) 101 time = (current_tsc - tsc_timestamp)
98 time = (time * tsc_to_system_mul) >> tsc_shift 102 if (tsc_shift >= 0)
103 time <<= tsc_shift;
104 else
105 time >>= -tsc_shift;
106 time = (time * tsc_to_system_mul) >> 32
99 time = time + system_time 107 time = time + system_time
100 108
101 flags: bits in this field indicate extended capabilities 109 flags: bits in this field indicate extended capabilities
diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virtual/kvm/ppc-pv.txt
index 4911cf95c67e..4cd076febb02 100644
--- a/Documentation/virtual/kvm/ppc-pv.txt
+++ b/Documentation/virtual/kvm/ppc-pv.txt
@@ -174,3 +174,25 @@ following:
174That way we can inject an arbitrary amount of code as replacement for a single 174That way we can inject an arbitrary amount of code as replacement for a single
175instruction. This allows us to check for pending interrupts when setting EE=1 175instruction. This allows us to check for pending interrupts when setting EE=1
176for example. 176for example.
177
178Hypercall ABIs in KVM on PowerPC
179=================================
1801) KVM hypercalls (ePAPR)
181
182These are ePAPR compliant hypercall implementation (mentioned above). Even
183generic hypercalls are implemented here, like the ePAPR idle hcall. These are
184available on all targets.
185
1862) PAPR hypercalls
187
188PAPR hypercalls are needed to run server PowerPC PAPR guests (-M pseries in QEMU).
189These are the same hypercalls that pHyp, the POWER hypervisor implements. Some of
190them are handled in the kernel, some are handled in user space. This is only
191available on book3s_64.
192
1933) OSI hypercalls
194
195Mac-on-Linux is another user of KVM on PowerPC, which has its own hypercall (long
196before KVM). This is supported to maintain compatibility. All these hypercalls get
197forwarded to user space. This is only useful on book3s_32, but can be used with
198book3s_64 as well.
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index c54b4f503e2a..de38429beb71 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -50,6 +50,13 @@ Machine check
50 monarchtimeout: 50 monarchtimeout:
51 Sets the time in us to wait for other CPUs on machine checks. 0 51 Sets the time in us to wait for other CPUs on machine checks. 0
52 to disable. 52 to disable.
53 mce=bios_cmci_threshold
54 Don't overwrite the bios-set CMCI threshold. This boot option
55 prevents Linux from overwriting the CMCI threshold set by the
56 bios. Without this option, Linux always sets the CMCI
57 threshold to 1. Enabling this may make memory predictive failure
58 analysis less effective if the bios sets thresholds for memory
59 errors since we will not see details for all errors.
53 60
54 nomce (for compatibility with i386): same as mce=off 61 nomce (for compatibility with i386): same as mce=off
55 62
diff --git a/Documentation/zh_CN/arm/Booting b/Documentation/zh_CN/arm/Booting
new file mode 100644
index 000000000000..6158a64df80c
--- /dev/null
+++ b/Documentation/zh_CN/arm/Booting
@@ -0,0 +1,175 @@
1Chinese translated version of Documentation/arm/Booting
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Maintainer: Russell King <linux@arm.linux.org.uk>
10Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11---------------------------------------------------------------------
12Documentation/arm/Booting 的中文翻译
13
14如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16译存在问题,请联系中文版维护者。
17
18英文版维护者: Russell King <linux@arm.linux.org.uk>
19中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22
23以下为正文
24---------------------------------------------------------------------
25
26 启动 ARM Linux
27 ==============
28
29作者:Russell King
30日期:2002年5月18日
31
32以下文档适用于 2.4.18-rmk6 及以上版本。
33
34为了启动 ARM Linux,你需要一个引导装载程序(boot loader),
35它是一个在主内核启动前运行的一个小程序。引导装载程序需要初始化各种
36设备,并最终调用 Linux 内核,将信息传递给内核。
37
38从本质上讲,引导装载程序应提供(至少)以下功能:
39
401、设置和初始化 RAM。
412、初始化一个串口。
423、检测机器的类型(machine type)。
434、设置内核标签列表(tagged list)。
445、调用内核映像。
45
46
471、设置和初始化 RAM
48-------------------
49
50现有的引导加载程序: 强制
51新开发的引导加载程序: 强制
52
53引导装载程序应该找到并初始化系统中所有内核用于保持系统变量数据的 RAM。
54这个操作的执行是设备依赖的。(它可能使用内部算法来自动定位和计算所有
55RAM,或可能使用对这个设备已知的 RAM 信息,还可能使用任何引导装载程序
56设计者想到的匹配方法。)
57
58
592、初始化一个串口
60-----------------------------
61
62现有的引导加载程序: 可选、建议
63新开发的引导加载程序: 可选、建议
64
65引导加载程序应该初始化并使能一个目标板上的串口。这允许内核串口驱动
66自动检测哪个串口用于内核控制台。(一般用于调试或与目标板通信。)
67
68作为替代方案,引导加载程序也可以通过标签列表传递相关的'console='
69选项给内核以指定某个串口,而串口数据格式的选项在以下文档中描述:
70
71 Documentation/kernel-parameters.txt。
72
73
743、检测机器类型
75--------------------------
76
77现有的引导加载程序: 可选
78新开发的引导加载程序: 强制
79
80引导加载程序应该通过某些方式检测自身所处的机器类型。这是一个硬件
81代码或通过查看所连接的硬件用某些算法得到,这些超出了本文档的范围。
82引导加载程序最终必须能提供一个 MACH_TYPE_xxx 值给内核。
83(详见 linux/arch/arm/tools/mach-types )。
84
854、设置启动数据
86------------------
87
88现有的引导加载程序: 可选、强烈建议
89新开发的引导加载程序: 强制
90
91引导加载程序必须提供标签列表或者 dtb 映像以传递配置数据给内核。启动
92数据的物理地址通过寄存器 r2 传递给内核。
93
944a、设置内核标签列表
95--------------------------------
96
97bootloader 必须创建和初始化内核标签列表。一个有效的标签列表以
98ATAG_CORE 标签开始,并以 ATAG_NONE 标签结束。ATAG_CORE 标签可以是
99空的,也可以是非空。一个空 ATAG_CORE 标签其 size 域设置为
100‘2’(0x00000002)。ATAG_NONE 标签的 size 域必须设置为零。
101
102在列表中可以保存任意数量的标签。对于一个重复的标签是追加到之前标签
103所携带的信息之后,还是会覆盖原来的信息,是未定义的。某些标签的行为
104是前者,其他是后者。
105
106bootloader 必须传递一个系统内存的位置和最小值,以及根文件系统位置。
107因此,最小的标签列表如下所示:
108
109 +-----------+
110基地址 -> | ATAG_CORE | |
111 +-----------+ |
112 | ATAG_MEM | | 地址增长方向
113 +-----------+ |
114 | ATAG_NONE | |
115 +-----------+ v
116
117标签列表应该保存在系统的 RAM 中。
118
119标签列表必须置于内核自解压和 initrd'bootp' 程序都不会覆盖的内存区。
120建议放在 RAM 的头 16KiB 中。
121
1224b、设置设备树
123-------------------------
124
125bootloader 必须以 64bit 地址对齐的形式加载一个设备树映像(dtb)到系统
126RAM 中,并用启动数据初始化它。dtb 格式在文档
127Documentation/devicetree/booting-without-of.txt 中。内核将会在
128dtb 物理地址处查找 dtb 魔数值(0xd00dfeed),以确定 dtb 是否已经代替
129标签列表被传递进来。
130
131bootloader 必须传递一个系统内存的位置和最小值,以及根文件系统位置。
132dtb 必须置于内核自解压不会覆盖的内存区。建议将其放置于 RAM 的头 16KiB
133中。但是不可将其放置于“0”物理地址处,因为内核认为:r2 中为 0,意味着
134没有标签列表和 dtb 传递过来。
135
1365、调用内核映像
137---------------------------
138
139现有的引导加载程序: 强制
140新开发的引导加载程序: 强制
141
142调用内核映像 zImage 有两个选择。如果 zImge 保存在 flash 中,且是为了
143在 flash 中直接运行而被正确链接的。这样引导加载程序就可以在 flash 中
144直接调用 zImage。
145
146zImage 也可以被放在系统 RAM(任意位置)中被调用。注意:内核使用映像
147基地址的前 16KB RAM 空间来保存页表。建议将映像置于 RAM 的 32KB 处。
148
149对于以上任意一种情况,都必须符合以下启动状态:
150
151- 停止所有 DMA 设备,这样内存数据就不会因为虚假网络包或磁盘数据而被破坏。
152 这可能可以节省你许多的调试时间。
153
154- CPU 寄存器配置
155 r0 = 0,
156 r1 = (在上面 3 中获取的)机器类型码。
157 r2 = 标签列表在系统 RAM 中的物理地址,或
158 设备树块(dtb)在系统 RAM 中的物理地址
159
160- CPU 模式
161 所有形式的中断必须被禁止 (IRQs 和 FIQs)
162 CPU 必须处于 SVC 模式。(对于 Angel 调试有特例存在)
163
164- 缓存,MMUs
165 MMU 必须关闭。
166 指令缓存开启或关闭都可以。
167 数据缓存必须关闭。
168
169- 引导加载程序应该通过直接跳转到内核映像的第一条指令来调用内核映像。
170
171 对于支持 ARM 指令集的 CPU,跳入内核入口时必须处在 ARM 状态,即使
172 对于 Thumb-2 内核也是如此。
173
174 对于仅支持 Thumb 指令集的 CPU,比如 Cortex-M 系列的 CPU,跳入
175 内核入口时必须处于 Thumb 状态。
diff --git a/Documentation/zh_CN/basic_profiling.txt b/Documentation/zh_CN/basic_profiling.txt
new file mode 100644
index 000000000000..1e6bf0bdf8f5
--- /dev/null
+++ b/Documentation/zh_CN/basic_profiling.txt
@@ -0,0 +1,71 @@
1Chinese translated version of Documentation/basic_profiling
2
3If you have any comment or update to the content, please post to LKML directly.
4However, if you have problem communicating in English you can also ask the
5Chinese maintainer for help. Contact the Chinese maintainer, if this
6translation is outdated or there is problem with translation.
7
8Chinese maintainer: Liang Xie <xieliang@xiaomi.com>
9---------------------------------------------------------------------
10Documentation/basic_profiling的中文翻译
11
12如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可
13以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者。
14
15中文版维护者: 谢良 Liang Xie <xieliang007@gmail.com>
16中文版翻译者: 谢良 Liang Xie <xieliang007@gmail.com>
17中文版校译者:
18以下为正文
19---------------------------------------------------------------------
20
21下面这些说明指令都是非常基础的,如果你想进一步了解请阅读相关专业文档:)
22请不要再在本文档增加新的内容,但可以修复文档中的错误:)(mbligh@aracnet.com)
23感谢John Levon,Dave Hansen等在撰写时的帮助
24
25<test> 用于表示要测量的目标
26请先确保您已经有正确的System.map / vmlinux配置!
27
28对于linux系统来说,配置vmlinuz最容易的方法可能就是使用“make install”,然后修改
29/sbin/installkernel将vmlinux拷贝到/boot目录,而System.map通常是默认安装好的
30
31Readprofile
32-----------
332.6系列内核需要版本相对较新的readprofile,比如util-linux 2.12a中包含的,可以从:
34
35http://www.kernel.org/pub/linux/utils/util-linux/ 下载
36
37大部分linux发行版已经包含了.
38
39启用readprofile需要在kernel启动命令行增加”profile=2“
40
41clear readprofile -r
42 <test>
43dump output readprofile -m /boot/System.map > captured_profile
44
45Oprofile
46--------
47
48从http://oprofile.sourceforge.net/获取源代码(请参考Changes以获取匹配的版本)
49在kernel启动命令行增加“idle=poll”
50
51配置CONFIG_PROFILING=y和CONFIG_OPROFILE=y然后重启进入新kernel
52
53./configure --with-kernel-support
54make install
55
56想得到好的测量结果,请确保启用了本地APIC特性。如果opreport显示有0Hz CPU,
57说明APIC特性没有开启。另外注意idle=poll选项可能有损性能。
58
59One time setup:
60 opcontrol --setup --vmlinux=/boot/vmlinux
61
62clear opcontrol --reset
63start opcontrol --start
64 <test>
65stop opcontrol --stop
66dump output opreport > output_file
67
68如果只看kernel相关的报告结果,请运行命令 opreport -l /boot/vmlinux > output_file
69
70通过reset选项可以清理过期统计数据,相当于重启的效果。
71
diff --git a/Documentation/zh_CN/filesystems/sysfs.txt b/Documentation/zh_CN/filesystems/sysfs.txt
new file mode 100644
index 000000000000..e230eaa33122
--- /dev/null
+++ b/Documentation/zh_CN/filesystems/sysfs.txt
@@ -0,0 +1,372 @@
1Chinese translated version of Documentation/filesystems/sysfs.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Maintainer: Patrick Mochel <mochel@osdl.org>
10 Mike Murphy <mamurph@cs.clemson.edu>
11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
12---------------------------------------------------------------------
13Documentation/filesystems/sysfs.txt 的中文翻译
14
15如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
16交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
17译存在问题,请联系中文版维护者。
18英文版维护者: Patrick Mochel <mochel@osdl.org>
19 Mike Murphy <mamurph@cs.clemson.edu>
20中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
23
24
25以下为正文
26---------------------------------------------------------------------
27sysfs - 用于导出内核对象(kobject)的文件系统
28
29Patrick Mochel <mochel@osdl.org>
30Mike Murphy <mamurph@cs.clemson.edu>
31
32修订: 16 August 2011
33原始版本: 10 January 2003
34
35
36sysfs 简介:
37~~~~~~~~~~
38
39sysfs 是一个最初基于 ramfs 且位于内存的文件系统。它提供导出内核
40数据结构及其属性,以及它们之间的关联到用户空间的方法。
41
42sysfs 始终与 kobject 的底层结构紧密相关。请阅读
43Documentation/kobject.txt 文档以获得更多关于 kobject 接口的
44信息。
45
46
47使用 sysfs
48~~~~~~~~~~~
49
50只要内核配置中定义了 CONFIG_SYSFS ,sysfs 总是被编译进内核。你可
51通过以下命令挂载它:
52
53 mount -t sysfs sysfs /sys
54
55
56创建目录
57~~~~~~~~
58
59任何 kobject 在系统中注册,就会有一个目录在 sysfs 中被创建。这个
60目录是作为该 kobject 的父对象所在目录的子目录创建的,以准确地传递
61内核的对象层次到用户空间。sysfs 中的顶层目录代表着内核对象层次的
62共同祖先;例如:某些对象属于某个子系统。
63
64Sysfs 在与其目录关联的 sysfs_dirent 对象中内部保存一个指向实现
65目录的 kobject 的指针。以前,这个 kobject 指针被 sysfs 直接用于
66kobject 文件打开和关闭的引用计数。而现在的 sysfs 实现中,kobject
67引用计数只能通过 sysfs_schedule_callback() 函数直接修改。
68
69
70属性
71~~~~
72
73kobject 的属性可在文件系统中以普通文件的形式导出。Sysfs 为属性定义
74了面向文件 I/O 操作的方法,以提供对内核属性的读写。
75
76
77属性应为 ASCII 码文本文件。以一个文件只存储一个属性值为宜。但一个
78文件只包含一个属性值可能影响效率,所以一个包含相同数据类型的属性值
79数组也被广泛地接受。
80
81混合类型、表达多行数据以及一些怪异的数据格式会遭到强烈反对。这样做是
82很丢脸的,而且其代码会在未通知作者的情况下被重写。
83
84
85一个简单的属性结构定义如下:
86
87struct attribute {
88 char * name;
89 struct module *owner;
90 umode_t mode;
91};
92
93
94int sysfs_create_file(struct kobject * kobj, const struct attribute * attr);
95void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr);
96
97
98一个单独的属性结构并不包含读写其属性值的方法。子系统最好为增删特定
99对象类型的属性定义自己的属性结构体和封装函数。
100
101例如:驱动程序模型定义的 device_attribute 结构体如下:
102
103struct device_attribute {
104 struct attribute attr;
105 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
106 char *buf);
107 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
108 const char *buf, size_t count);
109};
110
111int device_create_file(struct device *, const struct device_attribute *);
112void device_remove_file(struct device *, const struct device_attribute *);
113
114为了定义设备属性,同时定义了一下辅助宏:
115
116#define DEVICE_ATTR(_name, _mode, _show, _store) \
117struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
118
119例如:声明
120
121static DEVICE_ATTR(foo, S_IWUSR | S_IRUGO, show_foo, store_foo);
122
123等同于如下代码:
124
125static struct device_attribute dev_attr_foo = {
126 .attr = {
127 .name = "foo",
128 .mode = S_IWUSR | S_IRUGO,
129 .show = show_foo,
130 .store = store_foo,
131 },
132};
133
134
135子系统特有的回调函数
136~~~~~~~~~~~~~~~~~~~
137
138当一个子系统定义一个新的属性类型时,必须实现一系列的 sysfs 操作,
139以帮助读写调用实现属性所有者的显示和储存方法。
140
141struct sysfs_ops {
142 ssize_t (*show)(struct kobject *, struct attribute *, char *);
143 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
144};
145
146[子系统应已经定义了一个 struct kobj_type 结构体作为这个类型的
147描述符,并在此保存 sysfs_ops 的指针。更多的信息参见 kobject 的
148文档]
149
150sysfs 会为这个类型调用适当的方法。当一个文件被读写时,这个方法会
151将一般的kobject 和 attribute 结构体指针转换为适当的指针类型后
152调用相关联的函数。
153
154
155示例:
156
157#define to_dev(obj) container_of(obj, struct device, kobj)
158#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
159
160static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
161 char *buf)
162{
163 struct device_attribute *dev_attr = to_dev_attr(attr);
164 struct device *dev = to_dev(kobj);
165 ssize_t ret = -EIO;
166
167 if (dev_attr->show)
168 ret = dev_attr->show(dev, dev_attr, buf);
169 if (ret >= (ssize_t)PAGE_SIZE) {
170 print_symbol("dev_attr_show: %s returned bad count\n",
171 (unsigned long)dev_attr->show);
172 }
173 return ret;
174}
175
176
177
178读写属性数据
179~~~~~~~~~~~~
180
181在声明属性时,必须指定 show() 或 store() 方法,以实现属性的
182读或写。这些方法的类型应该和以下的设备属性定义一样简单。
183
184ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf);
185ssize_t (*store)(struct device *dev, struct device_attribute *attr,
186 const char *buf, size_t count);
187
188也就是说,他们应只以一个处理对象、一个属性和一个缓冲指针作为参数。
189
190sysfs 会分配一个大小为 (PAGE_SIZE) 的缓冲区并传递给这个方法。
191Sysfs 将会为每次读写操作调用一次这个方法。这使得这些方法在执行时
192会出现以下的行为:
193
194- 在读方面(read(2)),show() 方法应该填充整个缓冲区。回想属性
195 应只导出了一个属性值或是一个同类型属性值的数组,所以这个代价将
196 不会不太高。
197
198 这使得用户空间可以局部地读和任意的向前搜索整个文件。如果用户空间
199 向后搜索到零或使用‘0’偏移执行一个pread(2)操作,show()方法将
200 再次被调用,以重新填充缓存。
201
202- 在写方面(write(2)),sysfs 希望在第一次写操作时得到整个缓冲区。
203 之后 Sysfs 传递整个缓冲区给 store() 方法。
204
205 当要写 sysfs 文件时,用户空间进程应首先读取整个文件,修该想要
206 改变的值,然后回写整个缓冲区。
207
208 在读写属性值时,属性方法的执行应操作相同的缓冲区。
209
210注记:
211
212- 写操作导致的 show() 方法重载,会忽略当前文件位置。
213
214- 缓冲区应总是 PAGE_SIZE 大小。对于i386,这个值为4096。
215
216- show() 方法应该返回写入缓冲区的字节数,也就是 snprintf()的
217 返回值。
218
219- show() 应始终使用 snprintf()。
220
221- store() 应返回缓冲区的已用字节数。如果整个缓存都已填满,只需返回
222 count 参数。
223
224- show() 或 store() 可以返回错误值。当得到一个非法值,必须返回一个
225 错误值。
226
227- 一个传递给方法的对象将会通过 sysfs 调用对象内嵌的引用计数固定在
228 内存中。尽管如此,对象代表的物理实体(如设备)可能已不存在。如有必要,
229 应该实现一个检测机制。
230
231一个简单的(未经实验证实的)设备属性实现如下:
232
233static ssize_t show_name(struct device *dev, struct device_attribute *attr,
234 char *buf)
235{
236 return scnprintf(buf, PAGE_SIZE, "%s\n", dev->name);
237}
238
239static ssize_t store_name(struct device *dev, struct device_attribute *attr,
240 const char *buf, size_t count)
241{
242 snprintf(dev->name, sizeof(dev->name), "%.*s",
243 (int)min(count, sizeof(dev->name) - 1), buf);
244 return count;
245}
246
247static DEVICE_ATTR(name, S_IRUGO, show_name, store_name);
248
249
250(注意:真正的实现不允许用户空间设置设备名。)
251
252顶层目录布局
253~~~~~~~~~~~~
254
255sysfs 目录的安排显示了内核数据结构之间的关系。
256
257顶层 sysfs 目录如下:
258
259block/
260bus/
261class/
262dev/
263devices/
264firmware/
265net/
266fs/
267
268devices/ 包含了一个设备树的文件系统表示。他直接映射了内部的内核
269设备树,反映了设备的层次结构。
270
271bus/ 包含了内核中各种总线类型的平面目录布局。每个总线目录包含两个
272子目录:
273
274 devices/
275 drivers/
276
277devices/ 包含了系统中出现的每个设备的符号链接,他们指向 root/ 下的
278设备目录。
279
280drivers/ 包含了每个已为特定总线上的设备而挂载的驱动程序的目录(这里
281假定驱动没有跨越多个总线类型)。
282
283fs/ 包含了一个为文件系统设立的目录。现在每个想要导出属性的文件系统必须
284在 fs/ 下创建自己的层次结构(参见Documentation/filesystems/fuse.txt)。
285
286dev/ 包含两个子目录: char/ 和 block/。在这两个子目录中,有以
287<major>:<minor> 格式命名的符号链接。这些符号链接指向 sysfs 目录
288中相应的设备。/sys/dev 提供一个通过一个 stat(2) 操作结果,查找
289设备 sysfs 接口快捷的方法。
290
291更多有关 driver-model 的特性信息可以在 Documentation/driver-model/
292中找到。
293
294
295TODO: 完成这一节。
296
297
298当前接口
299~~~~~~~~
300
301以下的接口层普遍存在于当前的sysfs中:
302
303- 设备 (include/linux/device.h)
304----------------------------------
305结构体:
306
307struct device_attribute {
308 struct attribute attr;
309 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
310 char *buf);
311 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
312 const char *buf, size_t count);
313};
314
315声明:
316
317DEVICE_ATTR(_name, _mode, _show, _store);
318
319增/删属性:
320
321int device_create_file(struct device *dev, const struct device_attribute * attr);
322void device_remove_file(struct device *dev, const struct device_attribute * attr);
323
324
325- 总线驱动程序 (include/linux/device.h)
326--------------------------------------
327结构体:
328
329struct bus_attribute {
330 struct attribute attr;
331 ssize_t (*show)(struct bus_type *, char * buf);
332 ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
333};
334
335声明:
336
337BUS_ATTR(_name, _mode, _show, _store)
338
339增/删属性:
340
341int bus_create_file(struct bus_type *, struct bus_attribute *);
342void bus_remove_file(struct bus_type *, struct bus_attribute *);
343
344
345- 设备驱动程序 (include/linux/device.h)
346-----------------------------------------
347
348结构体:
349
350struct driver_attribute {
351 struct attribute attr;
352 ssize_t (*show)(struct device_driver *, char * buf);
353 ssize_t (*store)(struct device_driver *, const char * buf,
354 size_t count);
355};
356
357声明:
358
359DRIVER_ATTR(_name, _mode, _show, _store)
360
361增/删属性:
362
363int driver_create_file(struct device_driver *, const struct driver_attribute *);
364void driver_remove_file(struct device_driver *, const struct driver_attribute *);
365
366
367文档
368~~~~
369
370sysfs 目录结构以及其中包含的属性定义了一个内核与用户空间之间的 ABI。
371对于任何 ABI,其自身的稳定和适当的文档是非常重要的。所有新的 sysfs
372属性必须在 Documentation/ABI 中有文档。详见 Documentation/ABI/README。
diff --git a/Documentation/zh_CN/gpio.txt b/Documentation/zh_CN/gpio.txt
new file mode 100644
index 000000000000..4fa7b4e6f856
--- /dev/null
+++ b/Documentation/zh_CN/gpio.txt
@@ -0,0 +1,658 @@
1Chinese translated version of Documentation/gpio.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Maintainer: Grant Likely <grant.likely@secretlab.ca>
10 Linus Walleij <linus.walleij@linaro.org>
11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
12---------------------------------------------------------------------
13Documentation/gpio.txt 的中文翻译
14
15如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
16交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
17译存在问题,请联系中文版维护者。
18英文版维护者: Grant Likely <grant.likely@secretlab.ca>
19 Linus Walleij <linus.walleij@linaro.org>
20中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
23
24
25以下为正文
26---------------------------------------------------------------------
27GPIO 接口
28
29本文档提供了一个在Linux下访问GPIO的公约概述。
30
31这些函数以 gpio_* 作为前缀。其他的函数不允许使用这样的前缀或相关的
32__gpio_* 前缀。
33
34
35什么是GPIO?
36==========
37"通用输入/输出口"(GPIO)是一个灵活的由软件控制的数字信号。他们可
38由多种芯片提供,且对于从事嵌入式和定制硬件的 Linux 开发者来说是
39比较熟悉。每个GPIO 都代表一个连接到特定引脚或球栅阵列(BGA)封装中
40“球珠”的一个位。电路板原理图显示了 GPIO 与外部硬件的连接关系。
41驱动可以编写成通用代码,以使板级启动代码可传递引脚配置数据给驱动。
42
43片上系统 (SOC) 处理器对 GPIO 有很大的依赖。在某些情况下,每个
44非专用引脚都可配置为 GPIO,且大多数芯片都最少有一些 GPIO。
45可编程逻辑器件(类似 FPGA) 可以方便地提供 GPIO。像电源管理和
46音频编解码器这样的多功能芯片经常留有一些这样的引脚来帮助那些引脚
47匮乏的 SOC。同时还有通过 I2C 或 SPI 串行总线连接的“GPIO扩展器”
48芯片。大多数 PC 的南桥有一些拥有 GPIO 能力的引脚 (只有BIOS
49固件才知道如何使用他们)。
50
51GPIO 的实际功能因系统而异。通常用法有:
52
53 - 输出值可写 (高电平=1,低电平=0)。一些芯片也有如何驱动这些值的选项,
54 例如只允许输出一个值、支持“线与”及其他取值类似的模式(值得注意的是
55 “开漏”信号)
56
57 - 输入值可读(1、0)。一些芯片支持引脚在配置为“输出”时回读,这对于类似
58 “线与”的情况(以支持双向信号)是非常有用的。GPIO 控制器可能有输入
59 去毛刺/消抖逻辑,这有时需要软件控制。
60
61 - 输入通常可作为 IRQ 信号,一般是沿触发,但有时是电平触发。这样的 IRQ
62 可能配置为系统唤醒事件,以将系统从低功耗状态下唤醒。
63
64 - 通常一个 GPIO 根据不同产品电路板的需求,可以配置为输入或输出,也有仅
65 支持单向的。
66
67 - 大部分 GPIO 可以在持有自旋锁时访问,但是通常由串行总线扩展的 GPIO
68 不允许持有自旋锁。但某些系统也支持这种类型。
69
70对于给定的电路板,每个 GPIO 都用于某个特定的目的,如监控 MMC/SD 卡的
71插入/移除、检测卡的写保护状态、驱动 LED、配置收发器、模拟串行总线、
72复位硬件看门狗、感知开关状态等等。
73
74
75GPIO 公约
76=========
77注意,这个叫做“公约”,因为这不是强制性的,不遵循这个公约是无伤大雅的,
78因为此时可移植性并不重要。GPIO 常用于板级特定的电路逻辑,甚至可能
79随着电路板的版本而改变,且不可能在不同走线的电路板上使用。仅有在少数
80功能上才具有可移植性,其他功能是平台特定。这也是由于“胶合”的逻辑造成的。
81
82此外,这不需要任何的执行框架,只是一个接口。某个平台可能通过一个简单地
83访问芯片寄存器的内联函数来实现它,其他平台可能通过委托一系列不同的GPIO
84控制器的抽象函数来实现它。(有一些可选的代码能支持这种策略的实现,本文档
85后面会介绍,但作为 GPIO 接口的客户端驱动程序必须与它的实现无关。)
86
87也就是说,如果在他们的平台上支持这个公约,驱动应尽可能的使用它。平台
88必须在 Kconfig 中声明对 GENERIC_GPIO的支持 (布尔型 true),并提供
89一个 <asm/gpio.h> 文件。那些调用标准 GPIO 函数的驱动应该在 Kconfig
90入口中声明依赖GENERIC_GPIO。当驱动包含文件:
91
92 #include <linux/gpio.h>
93
94则 GPIO 函数是可用,无论是“真实代码”还是经优化过的语句。如果你遵守
95这个公约,当你的代码完成后,对其他的开发者来说会更容易看懂和维护。
96
97注意,这些操作包含所用平台的 I/O 屏障代码,驱动无须显式地调用他们。
98
99
100标识 GPIO
101---------
102GPIO 是通过无符号整型来标识的,范围是 0 到 MAX_INT。保留“负”数
103用于其他目的,例如标识信号“在这个板子上不可用”或指示错误。未接触底层
104硬件的代码会忽略这些整数。
105
106平台会定义这些整数的用法,且通常使用 #define 来定义 GPIO,这样
107板级特定的启动代码可以直接关联相应的原理图。相对来说,驱动应该仅使用
108启动代码传递过来的 GPIO 编号,使用 platform_data 保存板级特定
109引脚配置数据 (同时还有其他须要的板级特定数据),避免可能出现的问题。
110
111例如一个平台使用编号 32-159 来标识 GPIO,而在另一个平台使用编号0-63
112标识一组 GPIO 控制器,64-79标识另一类 GPIO 控制器,且在一个含有
113FPGA 的特定板子上使用 80-95。编号不一定要连续,那些平台中,也可以
114使用编号2000-2063来标识一个 I2C 接口的 GPIO 扩展器中的 GPIO。
115
116如果你要初始化一个带有无效 GPIO 编号的结构体,可以使用一些负编码
117(如"-EINVAL"),那将使其永远不会是有效。来测试这样一个结构体中的编号
118是否关联一个 GPIO,你可使用以下断言:
119
120 int gpio_is_valid(int number);
121
122如果编号不存在,则请求和释放 GPIO 的函数将拒绝执行相关操作(见下文)。
123其他编号也可能被拒绝,比如一个编号可能存在,但暂时在给定的电路上不可用。
124
125一个平台是否支持多个 GPIO 控制器为平台特定的实现问题,就像是否可以
126在 GPIO 编号空间中有“空洞”和是否可以在运行时添加新的控制器一样。
127这些问题会影响其他事情,包括相邻的 GPIO 编号是否存在等。
128
129使用 GPIO
130---------
131对于一个 GPIO,系统应该做的第一件事情就是通过 gpio_request()
132函数分配它,见下文。
133
134接下来是设置I/O方向,这通常是在板级启动代码中为所使用的 GPIO 设置
135platform_device 时完成。
136
137 /* 设置为输入或输出, 返回 0 或负的错误代码 */
138 int gpio_direction_input(unsigned gpio);
139 int gpio_direction_output(unsigned gpio, int value);
140
141返回值为零代表成功,否则返回一个负的错误代码。这个返回值需要检查,因为
142get/set(获取/设置)函数调用没法返回错误,且有可能是配置错误。通常,
143你应该在进程上下文中调用这些函数。然而,对于自旋锁安全的 GPIO,在板子
144启动的早期、进程启动前使用他们也是可以的。
145
146对于作为输出的 GPIO,为其提供初始输出值,对于避免在系统启动期间出现
147信号毛刺是很有帮助的。
148
149为了与传统的 GPIO 接口兼容, 在设置一个 GPIO 方向时,如果它还未被申请,
150则隐含了申请那个 GPIO 的操作(见下文)。这种兼容性正在从可选的 gpiolib
151框架中移除。
152
153如果这个 GPIO 编码不存在,或者特定的 GPIO 不能用于那种模式,则方向
154设置可能失败。依赖启动固件来正确地设置方向通常是一个坏主意,因为它可能
155除了启动Linux,并没有做更多的验证工作。(同理, 板子的启动代码可能需要
156将这个复用的引脚设置为 GPIO,并正确地配置上拉/下拉电阻。)
157
158
159访问自旋锁安全的 GPIO
160-------------------
161大多数 GPIO 控制器可以通过内存读/写指令来访问。这些指令不会休眠,可以
162安全地在硬(非线程)中断例程和类似的上下文中完成。
163
164对于那些用 gpio_cansleep()测试总是返回失败的 GPIO(见下文),使用
165以下的函数访问:
166
167 /* GPIO 输入:返回零或非零 */
168 int gpio_get_value(unsigned gpio);
169
170 /* GPIO 输出 */
171 void gpio_set_value(unsigned gpio, int value);
172
173GPIO值是布尔值,零表示低电平,非零表示高电平。当读取一个输出引脚的值时,
174返回值应该是引脚上的值。这个值不总是和输出值相符,因为存在开漏输出信号和
175输出延迟问题。
176
177以上的 get/set 函数无错误返回值,因为之前 gpio_direction_*()应已检查过
178其是否为“无效GPIO”。此外,还需要注意的是并不是所有平台都可以从输出引脚
179中读取数据,对于不能读取的引脚应总返回零。另外,对那些在原子上下文中无法
180安全访问的 GPIO (译者注:因为访问可能导致休眠)使用这些函数是不合适的
181(见下文)。
182
183在 GPIO 编号(还有输出、值)为常数的情况下,鼓励通过平台特定的实现来优化
184这两个函数来访问 GPIO 值。这种情况(读写一个硬件寄存器)下只需要几条指令
185是很正常的,且无须自旋锁。这种优化函数比起那些在子程序上花费许多指令的
186函数可以使得模拟接口(译者注:例如 GPIO 模拟 I2C、1-wire 或 SPI)的
187应用(在空间和时间上都)更具效率。
188
189
190访问可能休眠的 GPIO
191-----------------
192某些 GPIO 控制器必须通过基于总线(如 I2C 或 SPI)的消息访问。读或写这些
193GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其反馈。期间需要
194休眠,这不能在 IRQ 例程(中断上下文)中执行。
195
196支持此类 GPIO 的平台通过以下函数返回非零值来区分出这种 GPIO。(此函数需要
197一个之前通过 gpio_request 分配到的有效 GPIO 编号):
198
199 int gpio_cansleep(unsigned gpio);
200
201为了访问这种 GPIO,内核定义了一套不同的函数:
202
203 /* GPIO 输入:返回零或非零 ,可能会休眠 */
204 int gpio_get_value_cansleep(unsigned gpio);
205
206 /* GPIO 输出,可能会休眠 */
207 void gpio_set_value_cansleep(unsigned gpio, int value);
208
209
210访问这样的 GPIO 需要一个允许休眠的上下文,例如线程 IRQ 处理例程,并用以上的
211访问函数替换那些没有 cansleep()后缀的自旋锁安全访问函数。
212
213除了这些访问函数可能休眠,且它们操作的 GPIO 不能在硬件 IRQ 处理例程中访问的
214事实,这些处理例程实际上和自旋锁安全的函数是一样的。
215
216** 除此之外 ** 调用设置和配置此类 GPIO 的函数也必须在允许休眠的上下文中,
217因为它们可能也需要访问 GPIO 控制器芯片: (这些设置函数通常在板级启动代码或者
218驱动探测/断开代码中,所以这是一个容易满足的约束条件。)
219
220 gpio_direction_input()
221 gpio_direction_output()
222 gpio_request()
223
224## gpio_request_one()
225## gpio_request_array()
226## gpio_free_array()
227
228 gpio_free()
229 gpio_set_debounce()
230
231
232
233声明和释放 GPIO
234----------------------------
235为了有助于捕获系统配置错误,定义了两个函数。
236
237 /* 申请 GPIO, 返回 0 或负的错误代码.
238 * 非空标签可能有助于诊断.
239 */
240 int gpio_request(unsigned gpio, const char *label);
241
242 /* 释放之前声明的 GPIO */
243 void gpio_free(unsigned gpio);
244
245将无效的 GPIO 编码传递给 gpio_request()会导致失败,申请一个已使用这个
246函数声明过的 GPIO 也会失败。gpio_request()的返回值必须检查。你应该在
247进程上下文中调用这些函数。然而,对于自旋锁安全的 GPIO,在板子启动的早期、
248进入进程之前是可以申请的。
249
250这个函数完成两个基本的目标。一是标识那些实际上已作为 GPIO 使用的信号线,
251这样便于更好地诊断;系统可能需要服务几百个可用的 GPIO,但是对于任何一个
252给定的电路板通常只有一些被使用。另一个目的是捕获冲突,查明错误:如两个或
253更多驱动错误地认为他们已经独占了某个信号线,或是错误地认为移除一个管理着
254某个已激活信号的驱动是安全的。也就是说,申请 GPIO 的作用类似一种锁机制。
255
256某些平台可能也使用 GPIO 作为电源管理激活信号(例如通过关闭未使用芯片区和
257简单地关闭未使用时钟)。
258
259对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况;
260一个 gpiolib 驱动的 .request()操作应调用 pinctrl_request_gpio(),
261而 gpiolib 驱动的 .free()操作应调用 pinctrl_free_gpio()。pinctrl
262子系统允许 pinctrl_request_gpio()在某个引脚或引脚组以复用形式“属于”
263一个设备时都成功返回。
264
265任何须将 GPIO 信号导向适当引脚的引脚复用硬件的编程应该发生在 GPIO
266驱动的 .direction_input()或 .direction_output()函数中,以及
267任何输出 GPIO 值的设置之后。这样可使从引脚特殊功能到 GPIO 的转换
268不会在引脚产生毛刺波形。有时当用一个 GPIO 实现其信号驱动一个非 GPIO
269硬件模块的解决方案时,就需要这种机制。
270
271某些平台允许部分或所有 GPIO 信号使用不同的引脚。类似的,GPIO 或引脚的
272其他方面也需要配置,如上拉/下拉。平台软件应该在对这些 GPIO 调用
273gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映射表,
274使得 GPIO 的用户无须关注这些细节。
275
276还有一个值得注意的是在释放 GPIO 前,你必须停止使用它。
277
278
279注意:申请一个 GPIO 并没有以任何方式配置它,只不过标识那个 GPIO 处于使用
280状态。必须有另外的代码来处理引脚配置(如控制 GPIO 使用的引脚、上拉/下拉)。
281考虑到大多数情况下声明 GPIO 之后就会立即配置它们,所以定义了以下三个辅助函数:
282
283 /* 申请一个 GPIO 信号, 同时通过特定的'flags'初始化配置,
284 * 其他和 gpio_request()的参数和返回值相同
285 *
286 */
287 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
288
289 /* 在单个函数中申请多个 GPIO
290 */
291 int gpio_request_array(struct gpio *array, size_t num);
292
293 /* 在单个函数中释放多个 GPIO
294 */
295 void gpio_free_array(struct gpio *array, size_t num);
296
297这里 'flags' 当前定义可指定以下属性:
298
299 * GPIOF_DIR_IN - 配置方向为输入
300 * GPIOF_DIR_OUT - 配置方向为输出
301
302 * GPIOF_INIT_LOW - 在作为输出时,初始值为低电平
303 * GPIOF_INIT_HIGH - 在作为输出时,初始值为高电平
304 * GPIOF_OPEN_DRAIN - gpio引脚为开漏信号
305 * GPIOF_OPEN_SOURCE - gpio引脚为源极开路信号
306
307 * GPIOF_EXPORT_DIR_FIXED - 将 gpio 导出到 sysfs,并保持方向
308 * GPIOF_EXPORT_DIR_CHANGEABLE - 同样是导出, 但允许改变方向
309
310因为 GPIOF_INIT_* 仅有在配置为输出的时候才存在,所以有效的组合为:
311
312 * GPIOF_IN - 配置为输入
313 * GPIOF_OUT_INIT_LOW - 配置为输出,并初始化为低电平
314 * GPIOF_OUT_INIT_HIGH - 配置为输出,并初始化为高电平
315
316当设置 flag 为 GPIOF_OPEN_DRAIN 时,则假设引脚是开漏信号。这样的引脚
317将不会在输出模式下置1。这样的引脚需要连接上拉电阻。通过使能这个标志,gpio库
318将会在被要求输出模式下置1时将引脚变为输入状态来使引脚置高。引脚在输出模式下
319通过置0使其输出低电平。
320
321当设置 flag 为 GPIOF_OPEN_SOURCE 时,则假设引脚为源极开路信号。这样的引脚
322将不会在输出模式下置0。这样的引脚需要连接下拉电阻。通过使能这个标志,gpio库
323将会在被要求输出模式下置0时将引脚变为输入状态来使引脚置低。引脚在输出模式下
324通过置1使其输出高电平。
325
326将来这些标志可能扩展到支持更多的属性。
327
328更进一步,为了更简单地声明/释放多个 GPIO,'struct gpio'被引进来封装所有
329这三个领域:
330
331 struct gpio {
332 unsigned gpio;
333 unsigned long flags;
334 const char *label;
335 };
336
337一个典型的用例:
338
339 static struct gpio leds_gpios[] = {
340 { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* 默认开启 */
341 { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* 默认关闭 */
342 { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* 默认关闭 */
343 { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* 默认关闭 */
344 { ... },
345 };
346
347 err = gpio_request_one(31, GPIOF_IN, "Reset Button");
348 if (err)
349 ...
350
351 err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
352 if (err)
353 ...
354
355 gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));
356
357
358GPIO 映射到 IRQ
359--------------------
360GPIO 编号是无符号整数;IRQ 编号也是。这些构成了两个逻辑上不同的命名空间
361(GPIO 0 不一定使用 IRQ 0)。你可以通过以下函数在它们之间实现映射:
362
363 /* 映射 GPIO 编号到 IRQ 编号 */
364 int gpio_to_irq(unsigned gpio);
365
366 /* 映射 IRQ 编号到 GPIO 编号 (尽量避免使用) */
367 int irq_to_gpio(unsigned irq);
368
369它们的返回值为对应命名空间的相关编号,或是负的错误代码(如果无法映射)。
370(例如,某些 GPIO 无法做为 IRQ 使用。)以下的编号错误是未经检测的:使用一个
371未通过 gpio_direction_input()配置为输入的 GPIO 编号,或者使用一个
372并非来源于gpio_to_irq()的 IRQ 编号。
373
374这两个映射函数可能会在信号编号的加减计算过程上花些时间。它们不可休眠。
375
376gpio_to_irq()返回的非错误值可以传递给 request_irq()或者 free_irq()。
377它们通常通过板级特定的初始化代码存放到平台设备的 IRQ 资源中。注意:IRQ
378触发选项是 IRQ 接口的一部分,如 IRQF_TRIGGER_FALLING,系统唤醒能力
379也是如此。
380
381irq_to_gpio()返回的非错误值大多数通常可以被 gpio_get_value()所使用,
382比如在 IRQ 是沿触发时初始化或更新驱动状态。注意某些平台不支持反映射,所以
383你应该尽量避免使用它。
384
385
386模拟开漏信号
387----------------------------
388有时在只有低电平信号作为实际驱动结果(译者注:多个输出连接于一点,逻辑电平
389结果为所有输出的逻辑与)的时候,共享的信号线需要使用“开漏”信号。(该术语
390适用于 CMOS 管;而 TTL 用“集电极开路”。)一个上拉电阻使信号为高电平。这
391有时被称为“线与”。实际上,从负逻辑(低电平为真)的角度来看,这是一个“线或”。
392
393一个开漏信号的常见例子是共享的低电平使能 IRQ 信号线。此外,有时双向数据总线
394信号也使用漏极开路信号。
395
396某些 GPIO 控制器直接支持开漏输出,还有许多不支持。当你需要开漏信号,但
397硬件又不直接支持的时候,一个常用的方法是用任何即可作输入也可作输出的 GPIO
398引脚来模拟:
399
400 LOW: gpio_direction_output(gpio, 0) ... 这代码驱动信号并覆盖
401 上拉配置。
402
403 HIGH: gpio_direction_input(gpio) ... 这代码关闭输出,所以上拉电阻
404 (或其他的一些器件)控制了信号。
405
406如果你将信号线“驱动”为高电平,但是 gpio_get_value(gpio)报告了一个
407低电平(在适当的上升时间后),你就可以知道是其他的一些组件将共享信号线拉低了。
408这不一定是错误的。一个常见的例子就是 I2C 时钟的延长:一个需要较慢时钟的
409从设备延迟 SCK 的上升沿,而 I2C 主设备相应地调整其信号传输速率。
410
411
412这些公约忽略了什么?
413================
414这些公约忽略的最大一件事就是引脚复用,因为这属于高度芯片特定的属性且
415没有可移植性。某个平台可能不需要明确的复用信息;有的对于任意给定的引脚
416可能只有两个功能选项;有的可能每个引脚有八个功能选项;有的可能可以将
417几个引脚中的任何一个作为给定的 GPIO。(是的,这些例子都来自于当前运行
418Linux 的系统。)
419
420在某些系统中,与引脚复用相关的是配置和使能集成的上、下拉模式。并不是所有
421平台都支持这种模式,或者不会以相同的方式来支持这种模式;且任何给定的电路板
422可能使用外置的上拉(或下拉)电阻,这时芯片上的就不应该使用。(当一个电路需要
4235kOhm 的拉动电阻,芯片上的 100 kOhm 电阻就不能做到。)同样的,驱动能力
424(2 mA vs 20 mA)和电压(1.8V vs 3.3V)是平台特定问题,就像模型一样在
425可配置引脚和 GPIO 之间(没)有一一对应的关系。
426
427还有其他一些系统特定的机制没有在这里指出,例如上述的输入去毛刺和线与输出
428选项。硬件可能支持批量读或写 GPIO,但是那一般是配置相关的:对于处于同一
429块区(bank)的GPIO。(GPIO 通常以 16 或 32 个组成一个区块,一个给定的
430片上系统一般有几个这样的区块。)某些系统可以通过输出 GPIO 触发 IRQ,
431或者从并非以 GPIO 管理的引脚取值。这些机制的相关代码没有必要具有可移植性。
432
433当前,动态定义 GPIO 并不是标准的,例如作为配置一个带有某些 GPIO 扩展器的
434附加电路板的副作用。
435
436GPIO 实现者的框架 (可选)
437=====================
438前面提到了,有一个可选的实现框架,让平台使用相同的编程接口,更加简单地支持
439不同种类的 GPIO 控制器。这个框架称为"gpiolib"。
440
441作为一个辅助调试功能,如果 debugfs 可用,就会有一个 /sys/kernel/debug/gpio
442文件。通过这个框架,它可以列出所有注册的控制器,以及当前正在使用中的 GPIO
443的状态。
444
445
446控制器驱动: gpio_chip
447-------------------
448在框架中每个 GPIO 控制器都包装为一个 "struct gpio_chip",他包含了
449该类型的每个控制器的常用信息:
450
451 - 设置 GPIO 方向的方法
452 - 用于访问 GPIO 值的方法
453 - 告知调用其方法是否可能休眠的标志
454 - 可选的 debugfs 信息导出方法 (显示类似上拉配置一样的额外状态)
455 - 诊断标签
456
457也包含了来自 device.platform_data 的每个实例的数据:它第一个 GPIO 的
458编号和它可用的 GPIO 的数量。
459
460实现 gpio_chip 的代码应支持多控制器实例,这可能使用驱动模型。那些代码要
461配置每个 gpio_chip,并发起gpiochip_add()。卸载一个 GPIO 控制器很少见,
462但在必要的时候可以使用 gpiochip_remove()。
463
464大部分 gpio_chip 是一个实例特定结构体的一部分,而并不将 GPIO 接口单独
465暴露出来,比如编址、电源管理等。类似编解码器这样的芯片会有复杂的非 GPIO
466状态。
467
468任何一个 debugfs 信息导出方法通常应该忽略还未申请作为 GPIO 的信号线。
469他们可以使用 gpiochip_is_requested()测试,当这个 GPIO 已经申请过了
470就返回相关的标签,否则返回 NULL。
471
472
473平台支持
474-------
475为了支持这个框架,一个平台的 Kconfig 文件将会 "select"(选择)
476ARCH_REQUIRE_GPIOLIB 或 ARCH_WANT_OPTIONAL_GPIOLIB,并让它的
477<asm/gpio.h> 包含 <asm-generic/gpio.h>,同时定义三个方法:
478gpio_get_value()、gpio_set_value()和 gpio_cansleep()。
479
480它也应提供一个 ARCH_NR_GPIOS 的定义值,这样可以更好地反映该平台 GPIO
481的实际数量,节省静态表的空间。(这个定义值应该包含片上系统内建 GPIO 和
482GPIO 扩展器中的数据。)
483
484ARCH_REQUIRE_GPIOLIB 意味着 gpiolib 核心在这个构架中将总是编译进内核。
485
486ARCH_WANT_OPTIONAL_GPIOLIB 意味着 gpiolib 核心默认关闭,且用户可以
487使能它,并将其编译进内核(可选)。
488
489如果这些选项都没被选择,该平台就不通过 GPIO-lib 支持 GPIO,且代码不可以
490被用户使能。
491
492以下这些方法的实现可以直接使用框架代码,并总是通过 gpio_chip 调度:
493
494 #define gpio_get_value __gpio_get_value
495 #define gpio_set_value __gpio_set_value
496 #define gpio_cansleep __gpio_cansleep
497
498这些定义可以用更理想的实现方法替代,那就是使用经过逻辑优化的内联函数来访问
499基于特定片上系统的 GPIO。例如,若引用的 GPIO (寄存器位偏移)是常量“12”,
500读取或设置它可能只需少则两或三个指令,且不会休眠。当这样的优化无法实现时,
501那些函数必须使用框架提供的代码,那就至少要几十条指令才可以实现。对于用 GPIO
502模拟的 I/O 接口, 如此精简指令是很有意义的。
503
504对于片上系统,平台特定代码为片上 GPIO 每个区(bank)定义并注册 gpio_chip
505实例。那些 GPIO 应该根据芯片厂商的文档进行编码/标签,并直接和电路板原理图
506对应。他们应该开始于零并终止于平台特定的限制。这些 GPIO(代码)通常从
507arch_initcall()或者更早的地方集成进平台初始化代码,使这些 GPIO 总是可用,
508且他们通常可以作为 IRQ 使用。
509
510板级支持
511-------
512对于外部 GPIO 控制器(例如 I2C 或 SPI 扩展器、专用芯片、多功能器件、FPGA
513或 CPLD),大多数常用板级特定代码都可以注册控制器设备,并保证他们的驱动知道
514gpiochip_add()所使用的 GPIO 编号。他们的起始编号通常跟在平台特定的 GPIO
515编号之后。
516
517例如板级启动代码应该创建结构体指明芯片公开的 GPIO 范围,并使用 platform_data
518将其传递给每个 GPIO 扩展器芯片。然后芯片驱动中的 probe()例程可以将这个
519数据传递给 gpiochip_add()。
520
521初始化顺序很重要。例如,如果一个设备依赖基于 I2C 的(扩展)GPIO,那么它的
522probe()例程就应该在那个 GPIO 有效以后才可以被调用。这意味着设备应该在
523GPIO 可以工作之后才可被注册。解决这类依赖的的一种方法是让这种 gpio_chip
524控制器向板级特定代码提供 setup()和 teardown()回调函数。一旦所有必须的
525资源可用之后,这些板级特定的回调函数将会注册设备,并可以在这些 GPIO 控制器
526设备变成无效时移除它们。
527
528
529用户空间的 Sysfs 接口(可选)
530========================
531使用“gpiolib”实现框架的平台可以选择配置一个 GPIO 的 sysfs 用户接口。
532这不同于 debugfs 接口,因为它提供的是对 GPIO方向和值的控制,而不只显示
533一个GPIO 的状态摘要。此外,它可以出现在没有调试支持的产品级系统中。
534
535例如,通过适当的系统硬件文档,用户空间可以知道 GIOP #23 控制 Flash
536存储器的写保护(用于保护其中 Bootloader 分区)。产品的系统升级可能需要
537临时解除这个保护:首先导入一个 GPIO,改变其输出状态,然后在重新使能写保护
538前升级代码。通常情况下,GPIO #23 是不会被触及的,并且内核也不需要知道他。
539
540根据适当的硬件文档,某些系统的用户空间 GPIO 可以用于确定系统配置数据,
541这些数据是标准内核不知道的。在某些任务中,简单的用户空间 GPIO 驱动可能是
542系统真正需要的。
543
544注意:标准内核驱动中已经存在通用的“LED 和按键”GPIO 任务,分别是:
545"leds-gpio" 和 "gpio_keys"。请使用这些来替代直接访问 GPIO,因为集成在
546内核框架中的这类驱动比你在用户空间的代码更好。
547
548
549Sysfs 中的路径
550--------------
551在/sys/class/gpio 中有 3 类入口:
552
553 - 用于在用户空间控制 GPIO 的控制接口;
554
555 - GPIOs 本身;以及
556
557 - GPIO 控制器 ("gpio_chip" 实例)。
558
559除了这些标准的文件,还包含“device”符号链接。
560
561控制接口是只写的:
562
563 /sys/class/gpio/
564
565 "export" ... 用户空间可以通过写其编号到这个文件,要求内核导出
566 一个 GPIO 的控制到用户空间。
567
568 例如: 如果内核代码没有申请 GPIO #19,"echo 19 > export"
569 将会为 GPIO #19 创建一个 "gpio19" 节点。
570
571 "unexport" ... 导出到用户空间的逆操作。
572
573 例如: "echo 19 > unexport" 将会移除使用"export"文件导出的
574 "gpio19" 节点。
575
576GPIO 信号的路径类似 /sys/class/gpio/gpio42/ (对于 GPIO #42 来说),
577并有如下的读/写属性:
578
579 /sys/class/gpio/gpioN/
580
581 "direction" ... 读取得到 "in" 或 "out"。这个值通常运行写入。
582 写入"out" 时,其引脚的默认输出为低电平。为了确保无故障运行,
583 "low" 或 "high" 的电平值应该写入 GPIO 的配置,作为初始输出值。
584
585 注意:如果内核不支持改变 GPIO 的方向,或者在导出时内核代码没有
586 明确允许用户空间可以重新配置 GPIO 方向,那么这个属性将不存在。
587
588 "value" ... 读取得到 0 (低电平) 或 1 (高电平)。如果 GPIO 配置为
589 输出,这个值允许写操作。任何非零值都以高电平看待。
590
591 如果引脚可以配置为中断信号,且如果已经配置了产生中断的模式
592 (见"edge"的描述),你可以对这个文件使用轮询操作(poll(2)),
593 且轮询操作会在任何中断触发时返回。如果你使用轮询操作(poll(2)),
594 请在 events 中设置 POLLPRI 和 POLLERR。如果你使用轮询操作
595 (select(2)),请在 exceptfds 设置你期望的文件描述符。在
596 轮询操作(poll(2))返回之后,既可以通过 lseek(2)操作读取
597 sysfs 文件的开始部分,也可以关闭这个文件并重新打开它来读取数据。
598
599 "edge" ... 读取得到“none”、“rising”、“falling”或者“both”。
600 将这些字符串写入这个文件可以选择沿触发模式,会使得轮询操作
601 (select(2))在"value"文件中返回。
602
603 这个文件仅有在这个引脚可以配置为可产生中断输入引脚时,才存在。
604
605 "active_low" ... 读取得到 0 (假) 或 1 (真)。写入任何非零值可以
606 翻转这个属性的(读写)值。已存在或之后通过"edge"属性设置了"rising"
607 和 "falling" 沿触发模式的轮询操作(poll(2))将会遵循这个设置。
608
609GPIO 控制器的路径类似 /sys/class/gpio/gpiochip42/ (对于从#42 GPIO
610开始实现控制的控制器),并有着以下只读属性:
611
612 /sys/class/gpio/gpiochipN/
613
614 "base" ... 与以上的 N 相同,代表此芯片管理的第一个 GPIO 的编号
615
616 "label" ... 用于诊断 (并不总是只有唯一值)
617
618 "ngpio" ... 此控制器所管理的 GPIO 数量(而 GPIO 编号从 N 到
619 N + ngpio - 1)
620
621大多数情况下,电路板的文档应当标明每个 GPIO 的使用目的。但是那些编号并不总是
622固定的,例如在扩展卡上的 GPIO会根据所使用的主板或所在堆叠架构中其他的板子而
623有所不同。在这种情况下,你可能需要使用 gpiochip 节点(尽可能地结合电路图)来
624确定给定信号所用的 GPIO 编号。
625
626
627从内核代码中导出
628-------------
629内核代码可以明确地管理那些已通过 gpio_request()申请的 GPIO 的导出:
630
631 /* 导出 GPIO 到用户空间 */
632 int gpio_export(unsigned gpio, bool direction_may_change);
633
634 /* gpio_export()的逆操作 */
635 void gpio_unexport();
636
637 /* 创建一个 sysfs 连接到已导出的 GPIO 节点 */
638 int gpio_export_link(struct device *dev, const char *name,
639 unsigned gpio)
640
641 /* 改变 sysfs 中的一个 GPIO 节点的极性 */
642 int gpio_sysfs_set_active_low(unsigned gpio, int value);
643
644在一个内核驱动申请一个 GPIO 之后,它可以通过 gpio_export()使其在 sysfs
645接口中可见。该驱动可以控制信号方向是否可修改。这有助于防止用户空间代码无意间
646破坏重要的系统状态。
647
648这个明确的导出有助于(通过使某些实验更容易来)调试,也可以提供一个始终存在的接口,
649与文档配合作为板级支持包的一部分。
650
651在 GPIO 被导出之后,gpio_export_link()允许在 sysfs 文件系统的任何地方
652创建一个到这个 GPIO sysfs 节点的符号链接。这样驱动就可以通过一个描述性的
653名字,在 sysfs 中他们所拥有的设备下提供一个(到这个 GPIO sysfs 节点的)接口。
654
655驱动可以使用 gpio_sysfs_set_active_low() 来在用户空间隐藏电路板之间
656GPIO 线的极性差异。这个仅对 sysfs 接口起作用。极性的改变可以在 gpio_export()
657前后进行,且之前使能的轮询操作(poll(2))支持(上升或下降沿)将会被重新配置来遵循
658这个设置。
diff --git a/Documentation/zh_CN/video4linux/omap3isp.txt b/Documentation/zh_CN/video4linux/omap3isp.txt
new file mode 100644
index 000000000000..67ffbf352ae0
--- /dev/null
+++ b/Documentation/zh_CN/video4linux/omap3isp.txt
@@ -0,0 +1,277 @@
1Chinese translated version of Documentation/video4linux/omap3isp.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Maintainer: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 Sakari Ailus <sakari.ailus@iki.fi>
11 David Cohen <dacohen@gmail.com>
12Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
13---------------------------------------------------------------------
14Documentation/video4linux/omap3isp.txt 的中文翻译
15
16如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
17交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
18译存在问题,请联系中文版维护者。
19英文版维护者: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
20 Sakari Ailus <sakari.ailus@iki.fi>
21 David Cohen <dacohen@gmail.com>
22中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
23中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
24中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
25
26
27以下为正文
28---------------------------------------------------------------------
29OMAP 3 图像信号处理器 (ISP) 驱动
30
31Copyright (C) 2010 Nokia Corporation
32Copyright (C) 2009 Texas Instruments, Inc.
33
34联系人: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
35 Sakari Ailus <sakari.ailus@iki.fi>
36 David Cohen <dacohen@gmail.com>
37
38
39介绍
40===
41
42本文档介绍了由 drivers/media/video/omap3isp 加载的德州仪器
43(TI)OMAP 3 图像信号处理器 (ISP) 驱动。原始驱动由德州仪器(TI)
44编写,但此后由诺基亚重写了两次。
45
46驱动已在以下 OMAP 3 系列的芯片中成功使用:
47
48 3430
49 3530
50 3630
51
52驱动实现了 V4L2、媒体控制器和 v4l2_subdev 接口。支持内核中使用
53v4l2_subdev 接口的传感器、镜头和闪光灯驱动。
54
55
56拆分为子设备
57==========
58
59OMAP 3 ISP 被拆分为 V4L2 子设备,ISP中的每个模块都由一个子设备
60来表示。每个子设备向用户空间提供一个 V4L2 子设备接口。
61
62 OMAP3 ISP CCP2
63 OMAP3 ISP CSI2a
64 OMAP3 ISP CCDC
65 OMAP3 ISP preview
66 OMAP3 ISP resizer
67 OMAP3 ISP AEWB
68 OMAP3 ISP AF
69 OMAP3 ISP histogram
70
71ISP 中每个可能的连接都通过一个链接嵌入到媒体控制器接口中。详见例程 [2]。
72
73
74控制 OMAP 3 ISP
75==============
76
77通常,对 OMAP 3 ISP 的配置会在下一帧起始时生效。在传感器垂直消隐期间,
78模块变为空闲时完成配置。在内存到内存的操作中,视频管道一次处理一帧。
79应用配置应在帧间完成。
80
81ISP 中的所有模块,除 CSI-2 和 (可能存在的)CCP2 接收器外,都必须
82接收完整的帧数据。因此,传感器必须保证从不发送部分帧数据给ISP。
83
84Autoidle(自动空闲)功能至少在 3430 的 ISP 模块中确实存在一些问题。
85当 omap3isp 模块参数 autoidle 非零时,autoidle(自动空闲)功能
86仅在 3630 中启用了。
87
88
89事件机制
90======
91
92OMAP 3 ISP 驱动在 CCDC 和统计(AEWB、AF 和 直方图)子设备中支持
93V4L2 事件机制接口。
94
95CCDC 子设备通过 HS_VS 中断,处理 V4L2_EVENT_FRAME_SYNC 类型
96事件,用于告知帧起始。早期版本的驱动则使用 V4L2_EVENT_OMAP3ISP_HS_VS。
97当在 CCDC 模块中接收到起始帧的第一行时,会准确地触发事件。这个事件
98可以在 CCDC 子设备中“订阅”。
99
100(当使用并行接口时,必须注意正确地配置 VS 信号极性。而当使用串行接收时
101这个会自动校正。)
102
103每个统计子设备都可以产生事件。每当一个统计缓冲区可由用户空间应用程序
104通过 VIDIOC_OMAP3ISP_STAT_REQ IOCTL 操作获取时,就会产生一个
105事件。当前存在以下事件:
106
107 V4L2_EVENT_OMAP3ISP_AEWB
108 V4L2_EVENT_OMAP3ISP_AF
109 V4L2_EVENT_OMAP3ISP_HIST
110
111这些 ioctl 的事件数据类型为 struct omap3isp_stat_event_status
112结构体。如果出现计算错误的统计,也同样会产生一个事件,但没有相关的统计
113数据缓冲区。这种情况下 omap3isp_stat_event_status.buf_err 会被
114设置为非零值。
115
116
117私有 IOCTL
118==========
119
120OMAP 3 ISP 驱动支持标准的 V4L2 IOCTL 以及可能存在且实用的控制。但
121ISP 提供的许多功能都不在标准 IOCTL 之列,例如 gamma(伽马)表和统计
122数据采集配置等。
123
124通常,会有一个私有 ioctl 用于配置每个包含硬件依赖功能的模块。
125
126支持以下私有 IOCTL:
127
128 VIDIOC_OMAP3ISP_CCDC_CFG
129 VIDIOC_OMAP3ISP_PRV_CFG
130 VIDIOC_OMAP3ISP_AEWB_CFG
131 VIDIOC_OMAP3ISP_HIST_CFG
132 VIDIOC_OMAP3ISP_AF_CFG
133 VIDIOC_OMAP3ISP_STAT_REQ
134 VIDIOC_OMAP3ISP_STAT_EN
135
136在 include/linux/omap3isp.h 中描述了这些 ioctl 使用的参数结构体。
137与特定 ISP 模块相关的 ISP 自身的详细功能在技术参考手册 (TRMs)中有
138描述,详见文档结尾。
139
140虽然在不使用任何私有 IOCTL 的情况下使用 ISP 驱动是可能的,但这样无法
141获得最佳的图像质量。AEWB、AF 和 直方图(译者注:一般用于自动曝光和增益
142控制,以及图像均衡等)模块无法在未使用适当的私有 IOCTL 配置的情况下使用。
143
144
145CCDC 和 preview(预览)模块 IOCTL
146===============================
147
148VIDIOC_OMAP3ISP_CCDC_CFG 和 VIDIOC_OMAP3ISP_PRV_CFG IOCTL
149被分别用于配置、启用和禁用 CCDC 和 preview(预览)模块的功能。在它们
150所控制的模块中,两个 IOCTL 控制多种功能。VIDIOC_OMAP3ISP_CCDC_CFG IOCTL
151接受一个指向 omap3isp_ccdc_update_config 结构体的指针作为它的参数。
152同样的,VIDIOC_OMAP3ISP_PRV_CFG 接受一个指向 omap3isp_prev_update_config
153结构体的指针。以上两个结构体定义位于 [1]。
154
155这些结构体中的 update 域标识是否针对指定的功能更新配置,而 flag 域
156则标识是启用还是禁用此功能。
157
158update 和 flag 位接受以下掩码值。CCDC 和 preview(预览)模块的
159每个单独功能都与一个 flag 关联(禁用或启用;在结构体中 flag 域的
160一部分)和一个指向功能配置数据的指针。
161
162对于 VIDIOC_OMAP3ISP_CCDC_CFG,下面列出了 update 和 flag 域
163中的有效值。 这些值可能会在同一个 IOCTL 调用中配置多个功能。
164
165 OMAP3ISP_CCDC_ALAW
166 OMAP3ISP_CCDC_LPF
167 OMAP3ISP_CCDC_BLCLAMP
168 OMAP3ISP_CCDC_BCOMP
169 OMAP3ISP_CCDC_FPC
170 OMAP3ISP_CCDC_CULL
171 OMAP3ISP_CCDC_CONFIG_LSC
172 OMAP3ISP_CCDC_TBL_LSC
173
174针对 VIDIOC_OMAP3ISP_PRV_CFG 的相应值如下:
175
176 OMAP3ISP_PREV_LUMAENH
177 OMAP3ISP_PREV_INVALAW
178 OMAP3ISP_PREV_HRZ_MED
179 OMAP3ISP_PREV_CFA
180 OMAP3ISP_PREV_CHROMA_SUPP
181 OMAP3ISP_PREV_WB
182 OMAP3ISP_PREV_BLKADJ
183 OMAP3ISP_PREV_RGB2RGB
184 OMAP3ISP_PREV_COLOR_CONV
185 OMAP3ISP_PREV_YC_LIMIT
186 OMAP3ISP_PREV_DEFECT_COR
187 OMAP3ISP_PREV_GAMMABYPASS
188 OMAP3ISP_PREV_DRK_FRM_CAPTURE
189 OMAP3ISP_PREV_DRK_FRM_SUBTRACT
190 OMAP3ISP_PREV_LENS_SHADING
191 OMAP3ISP_PREV_NF
192 OMAP3ISP_PREV_GAMMA
193
194在启用某个功能的时候,相关的配置数据指针不可为 NULL。在禁用某个功能时,
195配置数据指针会被忽略。
196
197
198统计模块 IOCTL
199=============
200
201统计子设备相较于其他子设备提供了更多动态配置选项。在图像处理流水线处于
202工作状态时,它们可以被启用、禁用和重配。
203
204统计模块总是从 CCDC 中获取输入的图像数据(由于直方图内存读取未实现)。
205统计数据可由用户通过统计子设备节点使用私有 IOCTL 获取。
206
207AEWB、AF 和 直方图子设备提供的私有 IOCTL 极大程度上反应了 ISP 硬件
208提供的寄存器级接口。有些方面纯粹和驱动程序的实现相关,这些将在下面讨论。
209
210VIDIOC_OMAP3ISP_STAT_EN
211-----------------------
212
213这个私有 IOCTL 启用/禁用 一个统计模块。如果这个申请在视频流启动前完成,
214它将在视频流水线开始工作时生效。如果视频流水线已经处于工作状态了,它将在
215CCDC 变为空闲时生效。
216
217VIDIOC_OMAP3ISP_AEWB_CFG, VIDIOC_OMAP3ISP_HIST_CFG and VIDIOC_OMAP3ISP_AF_CFG
218-----------------------------------------------------------------------------
219
220这些 IOCTL 用于配置模块。它们要求用户应用程序对硬件有深入的认识。对
221大多数域的解释可以在 OMAP 的 TRM 中找到。以下两个域对于以上所有的
222私有 IOCTL 配置都很常见,由于他们没有在 TRM 中提及,故需要对其有
223更好的认识。
224
225omap3isp_[h3a_af/h3a_aewb/hist]_config.buf_size:
226
227模块在内部处理自身缓冲。对模块数据输出所必需的缓存大小依赖于已申请的配置。
228虽然驱动支持在视频流工作时重新配置,但对于所需缓存量大于模块启用时内部
229所分配数量的情况,则不支持重新配置。在这种情况下将返回 -EBUSY。为了避免
230此类状况,无论是禁用/重配/启用模块,还是第一次配置时申请必须的缓存大小,
231都应在模块禁用的情况下进行。
232
233内部缓冲分配的大小需综合考虑所申请配置的最小缓存量以及 buf_size 域中
234所设的值。如果 buf_size 域在[minimum(最小值), maximum(最大值)]
235缓冲大小范围之外,则应该将其调整到其范围中。驱动则会选择最大值。正确的
236buf_size 值将回写到用户应用程序中。
237
238omap3isp_[h3a_af/h3a_aewb/hist]_config.config_counter:
239
240由于配置并未在申请之后同步生效,驱动必须提供一个跟踪这类信息的方法,
241以提供更准确的数据。在一个配置被申请之后,返回到用户空间应用程序的
242config_counter 是一个与其配置相关的唯一值。当用户应用程序接收到
243一个缓冲可用或一个新的缓冲申请事件时,这个 config_counter 用于
244一个缓冲数据和一个配置的匹配。
245
246VIDIOC_OMAP3ISP_STAT_REQ
247------------------------
248
249将内部缓冲队列中最早的数据发送到用户空间,然后丢弃此缓冲区。
250omap3isp_stat_data.frame_number 域与视频缓冲的 field_count
251域相匹配。
252
253
254技术参考手册 (TRMs) 和其他文档
255==========================
256
257OMAP 3430 TRM:
258<URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip>
259参考于 2011-03-05.
260
261OMAP 35xx TRM:
262<URL:http://www.ti.com/litv/pdf/spruf98o> 参考于 2011-03-05.
263
264OMAP 3630 TRM:
265<URL:http://focus.ti.com/pdfs/wtbu/OMAP36xx_ES1.x_PUBLIC_TRM_vQ.zip>
266参考于 2011-03-05.
267
268DM 3730 TRM:
269<URL:http://www.ti.com/litv/pdf/sprugn4h> 参考于 2011-03-06.
270
271
272参考资料
273=======
274
275[1] include/linux/omap3isp.h
276
277[2] http://git.ideasonboard.org/?p=media-ctl.git;a=summary
diff --git a/Documentation/zh_CN/video4linux/v4l2-framework.txt b/Documentation/zh_CN/video4linux/v4l2-framework.txt
new file mode 100644
index 000000000000..3e74f13af426
--- /dev/null
+++ b/Documentation/zh_CN/video4linux/v4l2-framework.txt
@@ -0,0 +1,983 @@
1Chinese translated version of Documentation/video4linux/v4l2-framework.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Maintainer: Mauro Carvalho Chehab <mchehab@infradead.org>
10Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11---------------------------------------------------------------------
12Documentation/video4linux/v4l2-framework.txt 的中文翻译
13
14如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16译存在问题,请联系中文版维护者。
17英文版维护者: Mauro Carvalho Chehab <mchehab@infradead.org>
18中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
19中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21
22
23以下为正文
24---------------------------------------------------------------------
25V4L2 驱动框架概览
26==============
27
28本文档描述 V4L2 框架所提供的各种结构和它们之间的关系。
29
30
31介绍
32----
33
34大部分现代 V4L2 设备由多个 IC 组成,在 /dev 下导出多个设备节点,
35并同时创建非 V4L2 设备(如 DVB、ALSA、FB、I2C 和红外输入设备)。
36由于这种硬件的复杂性,V4L2 驱动也变得非常复杂。
37
38尤其是 V4L2 必须支持 IC 实现音视频的多路复用和编解码,这就更增加了其
39复杂性。通常这些 IC 通过一个或多个 I2C 总线连接到主桥驱动器,但也可
40使用其他总线。这些设备称为“子设备”。
41
42长期以来,这个框架仅限于通过 video_device 结构体创建 V4L 设备节点,
43并使用 video_buf 处理视频缓冲(注:本文不讨论 video_buf 框架)。
44
45这意味着所有驱动必须自己设置设备实例并连接到子设备。其中一部分要正确地
46完成是比较复杂的,使得许多驱动都没有正确地实现。
47
48由于框架的缺失,有很多通用代码都不可重复利用。
49
50因此,这个框架构建所有驱动都需要的基本结构块,而统一的框架将使通用代码
51创建成实用函数并在所有驱动中共享变得更加容易。
52
53
54驱动结构
55-------
56
57所有 V4L2 驱动都有如下结构:
58
591) 每个设备实例的结构体--包含其设备状态。
60
612) 初始化和控制子设备的方法(如果有)。
62
633) 创建 V4L2 设备节点 (/dev/videoX、/dev/vbiX 和 /dev/radioX)
64 并跟踪设备节点的特定数据。
65
664) 特定文件句柄结构体--包含每个文件句柄的数据。
67
685) 视频缓冲处理。
69
70以下是它们的初略关系图:
71
72 device instances(设备实例)
73 |
74 +-sub-device instances(子设备实例)
75 |
76 \-V4L2 device nodes(V4L2 设备节点)
77 |
78 \-filehandle instances(文件句柄实例)
79
80
81框架结构
82-------
83
84该框架非常类似驱动结构:它有一个 v4l2_device 结构用于保存设备
85实例的数据;一个 v4l2_subdev 结构体代表子设备实例;video_device
86结构体保存 V4L2 设备节点的数据;将来 v4l2_fh 结构体将跟踪文件句柄
87实例(暂未尚未实现)。
88
89V4L2 框架也可与媒体框架整合(可选的)。如果驱动设置了 v4l2_device
90结构体的 mdev 域,子设备和视频节点的入口将自动出现在媒体框架中。
91
92
93v4l2_device 结构体
94----------------
95
96每个设备实例都通过 v4l2_device (v4l2-device.h)结构体来表示。
97简单设备可以仅分配这个结构体,但在大多数情况下,都会将这个结构体
98嵌入到一个更大的结构体中。
99
100你必须注册这个设备实例:
101
102 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
103
104注册操作将会初始化 v4l2_device 结构体。如果 dev->driver_data 域
105为 NULL,就将其指向 v4l2_dev。
106
107需要与媒体框架整合的驱动必须手动设置 dev->driver_data,指向包含
108v4l2_device 结构体实例的驱动特定设备结构体。这可以在注册 V4L2 设备
109实例前通过 dev_set_drvdata() 函数完成。同时必须设置 v4l2_device
110结构体的 mdev 域,指向适当的初始化并注册过的 media_device 实例。
111
112如果 v4l2_dev->name 为空,则它将被设置为从 dev 中衍生出的值(为了
113更加精确,形式为驱动名后跟 bus_id)。如果你在调用 v4l2_device_register
114前已经设置好了,则不会被修改。如果 dev 为 NULL,则你*必须*在调用
115v4l2_device_register 前设置 v4l2_dev->name。
116
117你可以基于驱动名和驱动的全局 atomic_t 类型的实例编号,通过
118v4l2_device_set_name() 设置 name。这样会生成类似 ivtv0、ivtv1 等
119名字。若驱动名以数字结尾,则会在编号和驱动名间插入一个破折号,如:
120cx18-0、cx18-1 等。此函数返回实例编号。
121
122第一个 “dev” 参数通常是一个指向 pci_dev、usb_interface 或
123platform_device 的指针。很少使其为 NULL,除非是一个ISA设备或者
124当一个设备创建了多个 PCI 设备,使得 v4l2_dev 无法与一个特定的父设备
125关联。
126
127你也可以提供一个 notify() 回调,使子设备可以调用它实现事件通知。
128但这个设置与子设备相关。子设备支持的任何通知必须在
129include/media/<subdevice>.h 中定义一个消息头。
130
131注销 v4l2_device 使用如下函数:
132
133 v4l2_device_unregister(struct v4l2_device *v4l2_dev);
134
135如果 dev->driver_data 域指向 v4l2_dev,将会被重置为 NULL。注销同时
136会自动从设备中注销所有子设备。
137
138如果你有一个热插拔设备(如USB设备),则当断开发生时,父设备将无效。
139由于 v4l2_device 有一个指向父设备的指针必须被清除,同时标志父设备
140已消失,所以必须调用以下函数:
141
142 v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
143
144这个函数并*不*注销子设备,因此你依然要调用 v4l2_device_unregister()
145函数。如果你的驱动器并非热插拔的,就没有必要调用 v4l2_device_disconnect()。
146
147有时你需要遍历所有被特定驱动注册的设备。这通常发生在多个设备驱动使用
148同一个硬件的情况下。如:ivtvfb 驱动是一个使用 ivtv 硬件的帧缓冲驱动,
149同时 alsa 驱动也使用此硬件。
150
151你可以使用如下例程遍历所有注册的设备:
152
153static int callback(struct device *dev, void *p)
154{
155 struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
156
157 /* 测试这个设备是否已经初始化 */
158 if (v4l2_dev == NULL)
159 return 0;
160 ...
161 return 0;
162}
163
164int iterate(void *p)
165{
166 struct device_driver *drv;
167 int err;
168
169 /* 在PCI 总线上查找ivtv驱动。
170 pci_bus_type是全局的. 对于USB总线使用usb_bus_type。 */
171 drv = driver_find("ivtv", &pci_bus_type);
172 /* 遍历所有的ivtv设备实例 */
173 err = driver_for_each_device(drv, NULL, p, callback);
174 put_driver(drv);
175 return err;
176}
177
178有时你需要一个设备实例的运行计数。这个通常用于映射一个设备实例到一个
179模块选择数组的索引。
180
181推荐方法如下:
182
183static atomic_t drv_instance = ATOMIC_INIT(0);
184
185static int __devinit drv_probe(struct pci_dev *pdev,
186 const struct pci_device_id *pci_id)
187{
188 ...
189 state->instance = atomic_inc_return(&drv_instance) - 1;
190}
191
192如果你有多个设备节点,对于热插拔设备,知道何时注销 v4l2_device 结构体
193就比较困难。为此 v4l2_device 有引用计数支持。当调用 video_register_device
194时增加引用计数,而设备节点释放时减小引用计数。当引用计数为零,则
195v4l2_device 的release() 回调将被执行。你就可以在此时做最后的清理工作。
196
197如果创建了其他设备节点(比如 ALSA),则你可以通过以下函数手动增减
198引用计数:
199
200void v4l2_device_get(struct v4l2_device *v4l2_dev);
201
202或:
203
204int v4l2_device_put(struct v4l2_device *v4l2_dev);
205
206由于引用技术初始化为 1 ,你也需要在 disconnect() 回调(对于 USB 设备)中
207调用 v4l2_device_put,或者 remove() 回调(例如对于 PCI 设备),否则
208引用计数将永远不会为 0 。
209
210v4l2_subdev结构体
211------------------
212
213许多驱动需要与子设备通信。这些设备可以完成各种任务,但通常他们负责
214音视频复用和编解码。如网络摄像头的子设备通常是传感器和摄像头控制器。
215
216这些一般为 I2C 接口设备,但并不一定都是。为了给驱动提供调用子设备的
217统一接口,v4l2_subdev 结构体(v4l2-subdev.h)产生了。
218
219每个子设备驱动都必须有一个 v4l2_subdev 结构体。这个结构体可以单独
220代表一个简单的子设备,也可以嵌入到一个更大的结构体中,与更多设备状态
221信息保存在一起。通常有一个下级设备结构体(比如:i2c_client)包含了
222内核创建的设备数据。建议使用 v4l2_set_subdevdata() 将这个结构体的
223指针保存在 v4l2_subdev 的私有数据域(dev_priv)中。这使得通过 v4l2_subdev
224找到实际的低层总线特定设备数据变得容易。
225
226你同时需要一个从低层结构体获取 v4l2_subdev 指针的方法。对于常用的
227i2c_client 结构体,i2c_set_clientdata() 函数可用于保存一个 v4l2_subdev
228指针;对于其他总线你可能需要使用其他相关函数。
229
230桥驱动中也应保存每个子设备的私有数据,比如一个指向特定桥的各设备私有
231数据的指针。为此 v4l2_subdev 结构体提供主机私有数据域(host_priv),
232并可通过 v4l2_get_subdev_hostdata() 和 v4l2_set_subdev_hostdata()
233访问。
234
235从总线桥驱动的视角,驱动加载子设备模块并以某种方式获得 v4l2_subdev
236结构体指针。对于 i2c 总线设备相对简单:调用 i2c_get_clientdata()。
237对于其他总线也需要做类似的操作。针对 I2C 总线上的子设备辅助函数帮你
238完成了大部分复杂的工作。
239
240每个 v4l2_subdev 都包含子设备驱动需要实现的函数指针(如果对此设备
241不适用,可为NULL)。由于子设备可完成许多不同的工作,而在一个庞大的
242函数指针结构体中通常仅有少数有用的函数实现其功能肯定不合适。所以,
243函数指针根据其实现的功能被分类,每一类都有自己的函数指针结构体。
244
245顶层函数指针结构体包含了指向各类函数指针结构体的指针,如果子设备驱动
246不支持该类函数中的任何一个功能,则指向该类结构体的指针为NULL。
247
248这些结构体定义如下:
249
250struct v4l2_subdev_core_ops {
251 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
252 int (*log_status)(struct v4l2_subdev *sd);
253 int (*init)(struct v4l2_subdev *sd, u32 val);
254 ...
255};
256
257struct v4l2_subdev_tuner_ops {
258 ...
259};
260
261struct v4l2_subdev_audio_ops {
262 ...
263};
264
265struct v4l2_subdev_video_ops {
266 ...
267};
268
269struct v4l2_subdev_pad_ops {
270 ...
271};
272
273struct v4l2_subdev_ops {
274 const struct v4l2_subdev_core_ops *core;
275 const struct v4l2_subdev_tuner_ops *tuner;
276 const struct v4l2_subdev_audio_ops *audio;
277 const struct v4l2_subdev_video_ops *video;
278 const struct v4l2_subdev_pad_ops *video;
279};
280
281其中 core(核心)函数集通常可用于所有子设备,其他类别的实现依赖于
282子设备。如视频设备可能不支持音频操作函数,反之亦然。
283
284这样的设置在限制了函数指针数量的同时,还使增加新的操作函数和分类
285变得较为容易。
286
287子设备驱动可使用如下函数初始化 v4l2_subdev 结构体:
288
289 v4l2_subdev_init(sd, &ops);
290
291然后,你必须用一个唯一的名字初始化 subdev->name,并初始化模块的
292owner 域。若使用 i2c 辅助函数,这些都会帮你处理好。
293
294若需同媒体框架整合,你必须调用 media_entity_init() 初始化 v4l2_subdev
295结构体中的 media_entity 结构体(entity 域):
296
297 struct media_pad *pads = &my_sd->pads;
298 int err;
299
300 err = media_entity_init(&sd->entity, npads, pads, 0);
301
302pads 数组必须预先初始化。无须手动设置 media_entity 的 type 和
303name 域,但如有必要,revision 域必须初始化。
304
305当(任何)子设备节点被打开/关闭,对 entity 的引用将被自动获取/释放。
306
307在子设备被注销之后,不要忘记清理 media_entity 结构体:
308
309 media_entity_cleanup(&sd->entity);
310
311如果子设备驱动趋向于处理视频并整合进了媒体框架,必须使用 v4l2_subdev_pad_ops
312替代 v4l2_subdev_video_ops 实现格式相关的功能。
313
314这种情况下,子设备驱动应该设置 link_validate 域,以提供它自身的链接
315验证函数。链接验证函数应对管道(两端链接的都是 V4L2 子设备)中的每个
316链接调用。驱动还要负责验证子设备和视频节点间格式配置的正确性。
317
318如果 link_validate 操作没有设置,默认的 v4l2_subdev_link_validate_default()
319函数将会被调用。这个函数保证宽、高和媒体总线像素格式在链接的收发两端
320都一致。子设备驱动除了它们自己的检测外,也可以自由使用这个函数以执行
321上面提到的检查。
322
323设备(桥)驱动程序必须向 v4l2_device 注册 v4l2_subdev:
324
325 int err = v4l2_device_register_subdev(v4l2_dev, sd);
326
327如果子设备模块在它注册前消失,这个操作可能失败。在这个函数成功返回后,
328subdev->dev 域就指向了 v4l2_device。
329
330如果 v4l2_device 父设备的 mdev 域为非 NULL 值,则子设备实体将被自动
331注册为媒体设备。
332
333注销子设备则可用如下函数:
334
335 v4l2_device_unregister_subdev(sd);
336
337此后,子设备模块就可卸载,且 sd->dev == NULL。
338
339注册之设备后,可通过以下方式直接调用其操作函数:
340
341 err = sd->ops->core->g_chip_ident(sd, &chip);
342
343但使用如下宏会比较容易且合适:
344
345 err = v4l2_subdev_call(sd, core, g_chip_ident, &chip);
346
347这个宏将会做 NULL 指针检查,如果 subdev 为 NULL,则返回-ENODEV;如果
348subdev->core 或 subdev->core->g_chip_ident 为 NULL,则返回 -ENOIOCTLCMD;
349否则将返回 subdev->ops->core->g_chip_ident ops 调用的实际结果。
350
351有时也可能同时调用所有或一系列子设备的某个操作函数:
352
353 v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip);
354
355任何不支持此操作的子设备都会被跳过,并忽略错误返回值。但如果你需要
356检查出错码,则可使用如下函数:
357
358 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip);
359
360除 -ENOIOCTLCMD 外的任何错误都会跳出循环并返回错误值。如果(除 -ENOIOCTLCMD
361外)没有错误发生,则返回 0。
362
363对于以上两个函数的第二个参数为组 ID。如果为 0,则所有子设备都会执行
364这个操作。如果为非 0 值,则只有那些组 ID 匹配的子设备才会执行此操作。
365在桥驱动注册一个子设备前,可以设置 sd->grp_id 为任何期望值(默认值为
3660)。这个值属于桥驱动,且子设备驱动将不会修改和使用它。
367
368组 ID 赋予了桥驱动更多对于如何调用回调的控制。例如,电路板上有多个
369音频芯片,每个都有改变音量的能力。但当用户想要改变音量的时候,通常
370只有一个会被实际使用。你可以对这样的子设备设置组 ID 为(例如 AUDIO_CONTROLLER)
371并在调用 v4l2_device_call_all() 时指定它为组 ID 值。这就保证了只有
372需要的子设备才会执行这个回调。
373
374如果子设备需要通知它的 v4l2_device 父设备一个事件,可以调用
375v4l2_subdev_notify(sd, notification, arg)。这个宏检查是否有一个
376notify() 回调被注册,如果没有,返回 -ENODEV。否则返回 notify() 调用
377结果。
378
379使用 v4l2_subdev 的好处在于它是一个通用结构体,且不包含任何底层硬件
380信息。所有驱动可以包含多个 I2C 总线的子设备,但也有子设备是通过 GPIO
381控制。这个区别仅在配置设备时有关系,一旦子设备注册完成,对于 v4l2
382子系统来说就完全透明了。
383
384
385V4L2 子设备用户空间API
386--------------------
387
388除了通过 v4l2_subdev_ops 结构导出的内核 API,V4L2 子设备也可以直接
389通过用户空间应用程序来控制。
390
391可以在 /dev 中创建名为 v4l-subdevX 设备节点,以通过其直接访问子设备。
392如果子设备支持用户空间直接配置,必须在注册前设置 V4L2_SUBDEV_FL_HAS_DEVNODE
393标志。
394
395注册子设备之后, v4l2_device 驱动会通过调用 v4l2_device_register_subdev_nodes()
396函数为所有已注册并设置了 V4L2_SUBDEV_FL_HAS_DEVNODE 的子设备创建
397设备节点。这些设备节点会在子设备注销时自动删除。
398
399这些设备节点处理 V4L2 API 的一个子集。
400
401VIDIOC_QUERYCTRL
402VIDIOC_QUERYMENU
403VIDIOC_G_CTRL
404VIDIOC_S_CTRL
405VIDIOC_G_EXT_CTRLS
406VIDIOC_S_EXT_CTRLS
407VIDIOC_TRY_EXT_CTRLS
408
409 这些 ioctls 控制与 V4L2 中定义的一致。他们行为相同,唯一的
410 不同是他们只处理子设备的控制实现。根据驱动程序,这些控制也
411 可以通过一个(或多个) V4L2 设备节点访问。
412
413VIDIOC_DQEVENT
414VIDIOC_SUBSCRIBE_EVENT
415VIDIOC_UNSUBSCRIBE_EVENT
416
417 这些 ioctls 事件与 V4L2 中定义的一致。他们行为相同,唯一的
418 不同是他们只处理子设备产生的事件。根据驱动程序,这些事件也
419 可以通过一个(或多个) V4L2 设备节点上报。
420
421 要使用事件通知的子设备驱动,在注册子设备前必须在 v4l2_subdev::flags
422 中设置 V4L2_SUBDEV_USES_EVENTS 并在 v4l2_subdev::nevents
423 中初始化事件队列深度。注册完成后,事件会在 v4l2_subdev::devnode
424 设备节点中像通常一样被排队。
425
426 为正确支持事件机制,poll() 文件操作也应被实现。
427
428私有 ioctls
429
430 不在以上列表中的所有 ioctls 会通过 core::ioctl 操作直接传递
431 给子设备驱动。
432
433
434I2C 子设备驱动
435-------------
436
437由于这些驱动很常见,所以内特提供了特定的辅助函数(v4l2-common.h)让这些
438设备的使用更加容易。
439
440添加 v4l2_subdev 支持的推荐方法是让 I2C 驱动将 v4l2_subdev 结构体
441嵌入到为每个 I2C 设备实例创建的状态结构体中。而最简单的设备没有状态
442结构体,此时可以直接创建一个 v4l2_subdev 结构体。
443
444一个典型的状态结构体如下所示(‘chipname’用芯片名代替):
445
446struct chipname_state {
447 struct v4l2_subdev sd;
448 ... /* 附加的状态域*/
449};
450
451初始化 v4l2_subdev 结构体的方法如下:
452
453 v4l2_i2c_subdev_init(&state->sd, client, subdev_ops);
454
455这个函数将填充 v4l2_subdev 结构体中的所有域,并保证 v4l2_subdev 和
456i2c_client 都指向彼此。
457
458同时,你也应该为从 v4l2_subdev 指针找到 chipname_state 结构体指针
459添加一个辅助内联函数。
460
461static inline struct chipname_state *to_state(struct v4l2_subdev *sd)
462{
463 return container_of(sd, struct chipname_state, sd);
464}
465
466使用以下函数可以通过 v4l2_subdev 结构体指针获得 i2c_client 结构体
467指针:
468
469 struct i2c_client *client = v4l2_get_subdevdata(sd);
470
471而以下函数则相反,通过 i2c_client 结构体指针获得 v4l2_subdev 结构体
472指针:
473
474 struct v4l2_subdev *sd = i2c_get_clientdata(client);
475
476当 remove()函数被调用前,必须保证先调用 v4l2_device_unregister_subdev(sd)。
477此操作将会从桥驱动中注销子设备。即使子设备没有注册,调用此函数也是
478安全的。
479
480必须这样做的原因是:当桥驱动注销 i2c 适配器时,remove()回调函数
481会被那个适配器上的 i2c 设备调用。此后,相应的 v4l2_subdev 结构体
482就不存在了,所有它们必须先被注销。在 remove()回调函数中调用
483v4l2_device_unregister_subdev(sd),可以保证执行总是正确的。
484
485
486桥驱动也有一些辅组函数可用:
487
488struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter,
489 "module_foo", "chipid", 0x36, NULL);
490
491这个函数会加载给定的模块(如果没有模块需要加载,可以为 NULL),
492并用给定的 i2c 适配器结构体指针(i2c_adapter)和 器件地址(chip/address)
493作为参数调用 i2c_new_device()。如果一切顺利,则就在 v4l2_device
494中注册了子设备。
495
496你也可以利用 v4l2_i2c_new_subdev()的最后一个参数,传递一个可能的
497I2C 地址数组,让函数自动探测。这些探测地址只有在前一个参数为 0 的
498情况下使用。非零参数意味着你知道准确的 i2c 地址,所以此时无须进行
499探测。
500
501如果出错,两个函数都返回 NULL。
502
503注意:传递给 v4l2_i2c_new_subdev()的 chipid 通常与模块名一致。
504它允许你指定一个芯片的变体,比如“saa7114”或“saa7115”。一般通过
505i2c 驱动自动探测。chipid 的使用是在今后需要深入了解的事情。这个与
506i2c 驱动不同,较容易混淆。要知道支持哪些芯片变体,你可以查阅 i2c
507驱动代码的 i2c_device_id 表,上面列出了所有可能支持的芯片。
508
509还有两个辅助函数:
510
511v4l2_i2c_new_subdev_cfg:这个函数添加新的 irq 和 platform_data
512参数,并有‘addr’和‘probed_addrs’参数:如果 addr 非零,则被使用
513(不探测变体),否则 probed_addrs 中的地址将用于自动探测。
514
515例如:以下代码将会探测地址(0x10):
516
517struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
518 "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
519
520v4l2_i2c_new_subdev_board 使用一个 i2c_board_info 结构体,将其
521替代 irq、platform_data 和 add r参数传递给 i2c 驱动。
522
523如果子设备支持 s_config 核心操作,这个操作会在子设备配置好之后以 irq 和
524platform_data 为参数调用。早期的 v4l2_i2c_new_(probed_)subdev 函数
525同样也会调用 s_config,但仅在 irq 为 0 且 platform_data 为 NULL 时。
526
527video_device结构体
528-----------------
529
530在 /dev 目录下的实际设备节点根据 video_device 结构体(v4l2-dev.h)
531创建。此结构体既可以动态分配也可以嵌入到一个更大的结构体中。
532
533动态分配方法如下:
534
535 struct video_device *vdev = video_device_alloc();
536
537 if (vdev == NULL)
538 return -ENOMEM;
539
540 vdev->release = video_device_release;
541
542如果将其嵌入到一个大结构体中,则必须自己实现 release()回调。
543
544 struct video_device *vdev = &my_vdev->vdev;
545
546 vdev->release = my_vdev_release;
547
548release()回调必须被设置,且在最后一个 video_device 用户退出之后
549被调用。
550
551默认的 video_device_release()回调只是调用 kfree 来释放之前分配的
552内存。
553
554你应该设置这些域:
555
556- v4l2_dev: 设置为 v4l2_device 父设备。
557
558- name: 设置为唯一的描述性设备名。
559
560- fops: 设置为已有的 v4l2_file_operations 结构体。
561
562- ioctl_ops: 如果你使用v4l2_ioctl_ops 来简化 ioctl 的维护
563 (强烈建议使用,且将来可能变为强制性的!),然后设置你自己的
564 v4l2_ioctl_ops 结构体.
565
566- lock: 如果你要在驱动中实现所有的锁操作,则设为 NULL 。否则
567 就要设置一个指向 struct mutex_lock 结构体的指针,这个锁将
568 在 unlocked_ioctl 文件操作被调用前由内核获得,并在调用返回后
569 释放。详见下一节。
570
571- prio: 保持对优先级的跟踪。用于实现 VIDIOC_G/S_PRIORITY。如果
572 设置为 NULL,则会使用 v4l2_device 中的 v4l2_prio_state 结构体。
573 如果要对每个设备节点(组)实现独立的优先级,可以将其指向自己
574 实现的 v4l2_prio_state 结构体。
575
576- parent: 仅在使用 NULL 作为父设备结构体参数注册 v4l2_device 时
577 设置此参数。只有在一个硬件设备包含多一个 PCI 设备,共享同一个
578 v4l2_device 核心时才会发生。
579
580 cx88 驱动就是一个例子:一个 v4l2_device 结构体核心,被一个裸的
581 视频 PCI 设备(cx8800)和一个 MPEG PCI 设备(cx8802)共用。由于
582 v4l2_device 无法与特定的 PCI 设备关联,所有没有设置父设备。但当
583 video_device 配置后,就知道使用哪个父 PCI 设备了。
584
585- flags:可选。如果你要让框架处理设置 VIDIOC_G/S_PRIORITY ioctls,
586 请设置 V4L2_FL_USE_FH_PRIO。这要求你使用 v4l2_fh 结构体。
587 一旦所有驱动使用了核心的优先级处理,最终这个标志将消失。但现在它
588 必须被显式设置。
589
590如果你使用 v4l2_ioctl_ops,则应该在 v4l2_file_operations 结构体中
591设置 .unlocked_ioctl 指向 video_ioctl2。
592
593请勿使用 .ioctl!它已被废弃,今后将消失。
594
595某些情况下你要告诉核心:你在 v4l2_ioctl_ops 指定的某个函数应被忽略。
596你可以在 video_device_register 被调用前通过以下函数标记这个 ioctls。
597
598void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd);
599
600基于外部因素(例如某个板卡已被使用),在不创建新结构体的情况下,你想
601要关闭 v4l2_ioctl_ops 中某个特性往往需要这个机制。
602
603v4l2_file_operations 结构体是 file_operations 的一个子集。其主要
604区别在于:因 inode 参数从未被使用,它将被忽略。
605
606如果需要与媒体框架整合,你必须通过调用 media_entity_init() 初始化
607嵌入在 video_device 结构体中的 media_entity(entity 域)结构体:
608
609 struct media_pad *pad = &my_vdev->pad;
610 int err;
611
612 err = media_entity_init(&vdev->entity, 1, pad, 0);
613
614pads 数组必须预先初始化。没有必要手动设置 media_entity 的 type 和
615name 域。
616
617当(任何)子设备节点被打开/关闭,对 entity 的引用将被自动获取/释放。
618
619v4l2_file_operations 与锁
620--------------------------
621
622你可以在 video_device 结构体中设置一个指向 mutex_lock 的指针。通常
623这既可是一个顶层互斥锁也可为设备节点自身的互斥锁。默认情况下,此锁
624用于 unlocked_ioctl,但为了使用 ioctls 你通过以下函数可禁用锁定:
625
626 void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd);
627
628例如: v4l2_disable_ioctl_locking(vdev, VIDIOC_DQBUF);
629
630你必须在注册 video_device 前调用这个函数。
631
632特别是对于 USB 驱动程序,某些命令(如设置控制)需要很长的时间,可能
633需要自行为缓冲区队列的 ioctls 实现锁定。
634
635如果你需要更细粒度的锁,你必须设置 mutex_lock 为 NULL,并完全自己实现
636锁机制。
637
638这完全由驱动开发者决定使用何种方法。然而,如果你的驱动存在长延时操作
639(例如,改变 USB 摄像头的曝光时间可能需要较长时间),而你又想让用户
640在等待长延时操作完成期间做其他的事,则你最好自己实现锁机制。
641
642如果指定一个锁,则所有 ioctl 操作将在这个锁的作用下串行执行。如果你
643使用 videobuf,则必须将同一个锁传递给 videobuf 队列初始化函数;如
644videobuf 必须等待一帧的到达,则可临时解锁并在这之后重新上锁。如果驱动
645也在代码执行期间等待,则可做同样的工作(临时解锁,再上锁)让其他进程
646可以在第一个进程阻塞时访问设备节点。
647
648在使用 videobuf2 的情况下,必须实现 wait_prepare 和 wait_finish 回调
649在适当的时候解锁/加锁。进一步来说,如果你在 video_device 结构体中使用
650锁,则必须在 wait_prepare 和 wait_finish 中对这个互斥锁进行解锁/加锁。
651
652热插拔的断开实现也必须在调用 v4l2_device_disconnect 前获得锁。
653
654video_device注册
655---------------
656
657接下来你需要注册视频设备:这会为你创建一个字符设备。
658
659 err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
660 if (err) {
661 video_device_release(vdev); /* or kfree(my_vdev); */
662 return err;
663 }
664
665如果 v4l2_device 父设备的 mdev 域为非 NULL 值,视频设备实体将自动
666注册为媒体设备。
667
668注册哪种设备是根据类型(type)参数。存在以下类型:
669
670VFL_TYPE_GRABBER: 用于视频输入/输出设备的 videoX
671VFL_TYPE_VBI: 用于垂直消隐数据的 vbiX (例如,隐藏式字幕,图文电视)
672VFL_TYPE_RADIO: 用于广播调谐器的 radioX
673
674最后一个参数让你确定一个所控制设备的设备节点号数量(例如 videoX 中的 X)。
675通常你可以传入-1,让 v4l2 框架自己选择第一个空闲的编号。但是有时用户
676需要选择一个特定的节点号。驱动允许用户通过驱动模块参数选择一个特定的
677设备节点号是很普遍的。这个编号将会传递给这个函数,且 video_register_device
678将会试图选择这个设备节点号。如果这个编号被占用,下一个空闲的设备节点
679编号将被选中,并向内核日志中发送一个警告信息。
680
681另一个使用场景是当驱动创建多个设备时。这种情况下,对不同的视频设备在
682编号上使用不同的范围是很有用的。例如,视频捕获设备从 0 开始,视频
683输出设备从 16 开始。所以你可以使用最后一个参数来指定设备节点号最小值,
684而 v4l2 框架会试图选择第一个的空闲编号(等于或大于你提供的编号)。
685如果失败,则它会就选择第一个空闲的编号。
686
687由于这种情况下,你会忽略无法选择特定设备节点号的警告,则可调用
688video_register_device_no_warn() 函数避免警告信息的产生。
689
690只要设备节点被创建,一些属性也会同时创建。在 /sys/class/video4linux
691目录中你会找到这些设备。例如进入其中的 video0 目录,你会看到‘name’和
692‘index’属性。‘name’属性值就是 video_device 结构体中的‘name’域。
693
694‘index’属性值就是设备节点的索引值:每次调用 video_register_device(),
695索引值都递增 1 。第一个视频设备节点总是从索引值 0 开始。
696
697用户可以设置 udev 规则,利用索引属性生成花哨的设备名(例如:用‘mpegX’
698代表 MPEG 视频捕获设备节点)。
699
700在设备成功注册后,就可以使用这些域:
701
702- vfl_type: 传递给 video_register_device 的设备类型。
703- minor: 已指派的次设备号。
704- num: 设备节点编号 (例如 videoX 中的 X)。
705- index: 设备索引号。
706
707如果注册失败,你必须调用 video_device_release() 来释放已分配的
708video_device 结构体;如果 video_device 是嵌入在自己创建的结构体中,
709你也必须释放它。vdev->release() 回调不会在注册失败之后被调用,
710你也不应试图在注册失败后注销设备。
711
712
713video_device 注销
714----------------
715
716当视频设备节点已被移除,不论是卸载驱动还是USB设备断开,你都应注销
717它们:
718
719 video_unregister_device(vdev);
720
721这个操作将从 sysfs 中移除设备节点(导致 udev 将其从 /dev 中移除)。
722
723video_unregister_device() 返回之后,就无法完成打开操作。尽管如此,
724USB 设备的情况则不同,某些应用程序可能依然打开着其中一个已注销设备
725节点。所以在注销之后,所有文件操作(当然除了 release )也应返回错误值。
726
727当最后一个视频设备节点的用户退出,则 vdev->release() 回调会被调用,
728并且你可以做最后的清理操作。
729
730不要忘记清理与视频设备相关的媒体入口(如果被初始化过):
731
732 media_entity_cleanup(&vdev->entity);
733
734这可以在 release 回调中完成。
735
736
737video_device 辅助函数
738---------------------
739
740一些有用的辅助函数如下:
741
742- file/video_device 私有数据
743
744你可以用以下函数在 video_device 结构体中设置/获取驱动私有数据:
745
746void *video_get_drvdata(struct video_device *vdev);
747void video_set_drvdata(struct video_device *vdev, void *data);
748
749注意:在调用 video_register_device() 前执行 video_set_drvdata()
750是安全的。
751
752而以下函数:
753
754struct video_device *video_devdata(struct file *file);
755
756返回 file 结构体中拥有的的 video_device 指针。
757
758video_drvdata 辅助函数结合了 video_get_drvdata 和 video_devdata
759的功能:
760
761void *video_drvdata(struct file *file);
762
763你可以使用如下代码从 video_device 结构体中获取 v4l2_device 结构体
764指针:
765
766struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
767
768- 设备节点名
769
770video_device 设备节点在内核中的名称可以通过以下函数获得
771
772const char *video_device_node_name(struct video_device *vdev);
773
774这个名字被用户空间工具(例如 udev)作为提示信息使用。应尽可能使用
775此功能,而非访问 video_device::num 和 video_device::minor 域。
776
777
778视频缓冲辅助函数
779---------------
780
781v4l2 核心 API 提供了一个处理视频缓冲的标准方法(称为“videobuf”)。
782这些方法使驱动可以通过统一的方式实现 read()、mmap() 和 overlay()。
783目前在设备上支持视频缓冲的方法有分散/聚集 DMA(videobuf-dma-sg)、
784线性 DMA(videobuf-dma-contig)以及大多用于 USB 设备的用 vmalloc
785分配的缓冲(videobuf-vmalloc)。
786
787请参阅 Documentation/video4linux/videobuf,以获得更多关于 videobuf
788层的使用信息。
789
790v4l2_fh 结构体
791-------------
792
793v4l2_fh 结构体提供一个保存用于 V4L2 框架的文件句柄特定数据的简单方法。
794如果 video_device 的 flag 设置了 V4L2_FL_USE_FH_PRIO 标志,新驱动
795必须使用 v4l2_fh 结构体,因为它也用于实现优先级处理(VIDIOC_G/S_PRIORITY)。
796
797v4l2_fh 的用户(位于 V4l2 框架中,并非驱动)可通过测试
798video_device->flags 中的 V4L2_FL_USES_V4L2_FH 位得知驱动是否使用
799v4l2_fh 作为他的 file->private_data 指针。这个位会在调用 v4l2_fh_init()
800时被设置。
801
802v4l2_fh 结构体作为驱动自身文件句柄结构体的一部分被分配,且驱动在
803其打开函数中将 file->private_data 指向它。
804
805在许多情况下,v4l2_fh 结构体会嵌入到一个更大的结构体中。这钟情况下,
806应该在 open() 中调用 v4l2_fh_init+v4l2_fh_add,并在 release() 中
807调用 v4l2_fh_del+v4l2_fh_exit。
808
809驱动可以通过使用 container_of 宏提取他们自己的文件句柄结构体。例如:
810
811struct my_fh {
812 int blah;
813 struct v4l2_fh fh;
814};
815
816...
817
818int my_open(struct file *file)
819{
820 struct my_fh *my_fh;
821 struct video_device *vfd;
822 int ret;
823
824 ...
825
826 my_fh = kzalloc(sizeof(*my_fh), GFP_KERNEL);
827
828 ...
829
830 v4l2_fh_init(&my_fh->fh, vfd);
831
832 ...
833
834 file->private_data = &my_fh->fh;
835 v4l2_fh_add(&my_fh->fh);
836 return 0;
837}
838
839int my_release(struct file *file)
840{
841 struct v4l2_fh *fh = file->private_data;
842 struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
843
844 ...
845 v4l2_fh_del(&my_fh->fh);
846 v4l2_fh_exit(&my_fh->fh);
847 kfree(my_fh);
848 return 0;
849}
850
851以下是 v4l2_fh 函数使用的简介:
852
853void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
854
855 初始化文件句柄。这*必须*在驱动的 v4l2_file_operations->open()
856 函数中执行。
857
858void v4l2_fh_add(struct v4l2_fh *fh)
859
860 添加一个 v4l2_fh 到 video_device 文件句柄列表。一旦文件句柄
861 初始化完成就必须调用。
862
863void v4l2_fh_del(struct v4l2_fh *fh)
864
865 从 video_device() 中解除文件句柄的关联。文件句柄的退出函数也
866 将被调用。
867
868void v4l2_fh_exit(struct v4l2_fh *fh)
869
870 清理文件句柄。在清理完 v4l2_fh 后,相关内存会被释放。
871
872
873如果 v4l2_fh 不是嵌入在其他结构体中的,则可以用这些辅助函数:
874
875int v4l2_fh_open(struct file *filp)
876
877 分配一个 v4l2_fh 结构体空间,初始化并将其添加到 file 结构体相关的
878 video_device 结构体中。
879
880int v4l2_fh_release(struct file *filp)
881
882 从 file 结构体相关的 video_device 结构体中删除 v4l2_fh ,清理
883 v4l2_fh 并释放空间。
884
885这两个函数可以插入到 v4l2_file_operation 的 open() 和 release()
886操作中。
887
888
889某些驱动需要在第一个文件句柄打开和最后一个文件句柄关闭的时候做些
890工作。所以加入了两个辅助函数以检查 v4l2_fh 结构体是否是相关设备
891节点打开的唯一文件句柄。
892
893int v4l2_fh_is_singular(struct v4l2_fh *fh)
894
895 如果此文件句柄是唯一打开的文件句柄,则返回 1 ,否则返回 0 。
896
897int v4l2_fh_is_singular_file(struct file *filp)
898
899 功能相同,但通过 filp->private_data 调用 v4l2_fh_is_singular。
900
901
902V4L2 事件机制
903-----------
904
905V4L2 事件机制提供了一个通用的方法将事件传递到用户空间。驱动必须使用
906v4l2_fh 才能支持 V4L2 事件机制。
907
908
909事件通过一个类型和选择 ID 来定义。ID 对应一个 V4L2 对象,例如
910一个控制 ID。如果未使用,则 ID 为 0。
911
912当用户订阅一个事件,驱动会为此分配一些 kevent 结构体。所以每个
913事件组(类型、ID)都会有自己的一套 kevent 结构体。这保证了如果
914一个驱动短时间内产生了许多同类事件,不会覆盖其他类型的事件。
915
916但如果你收到的事件数量大于同类事件 kevent 的保存数量,则最早的
917事件将被丢弃,并加入新事件。
918
919此外,v4l2_subscribed_event 结构体内部有可供驱动设置的 merge() 和
920replace() 回调,这些回调会在新事件产生且没有多余空间的时候被调用。
921replace() 回调让你可以将早期事件的净荷替换为新事件的净荷,将早期
922净荷的相关数据合并到替换进来的新净荷中。当该类型的事件仅分配了一个
923kevent 结构体时,它将被调用。merge() 回调让你可以合并最早的事件净荷
924到在它之后的那个事件净荷中。当该类型的事件分配了两个或更多 kevent
925结构体时,它将被调用。
926
927这种方法不会有状态信息丢失,只会导致中间步骤信息丢失。
928
929
930关于 replace/merge 回调的一个不错的例子在 v4l2-event.c 中:用于
931控制事件的 ctrls_replace() 和 ctrls_merge() 回调。
932
933注意:这些回调可以在中断上下文中调用,所以它们必须尽快完成并退出。
934
935有用的函数:
936
937void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
938
939 将事件加入视频设备的队列。驱动仅负责填充 type 和 data 域。
940 其他域由 V4L2 填充。
941
942int v4l2_event_subscribe(struct v4l2_fh *fh,
943 struct v4l2_event_subscription *sub, unsigned elems,
944 const struct v4l2_subscribed_event_ops *ops)
945
946 video_device->ioctl_ops->vidioc_subscribe_event 必须检测驱动能
947 产生特定 id 的事件。然后调用 v4l2_event_subscribe() 来订阅该事件。
948
949 elems 参数是该事件的队列大小。若为 0,V4L2 框架将会(根据事件类型)
950 填充默认值。
951
952 ops 参数允许驱动指定一系列回调:
953 * add: 当添加一个新监听者时调用(重复订阅同一个事件,此回调
954 仅被执行一次)。
955 * del: 当一个监听者停止监听时调用。
956 * replace: 用‘新’事件替换‘早期‘事件。
957 * merge: 将‘早期‘事件合并到‘新’事件中。
958 这四个调用都是可选的,如果不想指定任何回调,则 ops 可为 NULL。
959
960int v4l2_event_unsubscribe(struct v4l2_fh *fh,
961 struct v4l2_event_subscription *sub)
962
963 v4l2_ioctl_ops 结构体中的 vidioc_unsubscribe_event 回调函数。
964 驱动程序可以直接使用 v4l2_event_unsubscribe() 实现退订事件过程。
965
966 特殊的 V4L2_EVENT_ALL 类型,可用于退订所有事件。驱动可能在特殊
967 情况下需要做此操作。
968
969int v4l2_event_pending(struct v4l2_fh *fh)
970
971 返回未决事件的数量。有助于实现轮询(poll)操作。
972
973事件通过 poll 系统调用传递到用户空间。驱动可用
974v4l2_fh->wait (wait_queue_head_t 类型)作为参数调用 poll_wait()。
975
976事件分为标准事件和私有事件。新的标准事件必须使用可用的最小事件类型
977编号。驱动必须从他们本类型的编号起始处分配事件。类型的编号起始为
978V4L2_EVENT_PRIVATE_START + n * 1000 ,其中 n 为可用最小编号。每个
979类型中的第一个事件类型编号是为以后的使用保留的,所以第一个可用事件
980类型编号是‘class base + 1’。
981
982V4L2 事件机制的使用实例可以在 OMAP3 ISP 的驱动
983(drivers/media/video/omap3isp)中找到。