aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci12
-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-driver-wacom13
-rw-r--r--Documentation/ABI/testing/sysfs-platform-ideapad-laptop11
-rw-r--r--Documentation/ABI/testing/sysfs-tty9
-rw-r--r--Documentation/DocBook/filesystems.tmpl4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml2
-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/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/block/00-INDEX10
-rw-r--r--Documentation/block/cfq-iosched.txt77
-rw-r--r--Documentation/block/queue-sysfs.txt64
-rw-r--r--Documentation/devicetree/bindings/arm/bcm2835.txt8
-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/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/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/dma/mmp-dma.txt74
-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/i2c/trivial-devices.txt1
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt110
-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/ab8500.txt15
-rw-r--r--Documentation/devicetree/bindings/misc/at25.txt34
-rw-r--r--Documentation/devicetree/bindings/misc/lis302.txt112
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt8
-rw-r--r--Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt31
-rw-r--r--Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt196
-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.txt85
-rw-r--r--Documentation/devicetree/bindings/rtc/pxa-rtc.txt14
-rw-r--r--Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt15
-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/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/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/feature-removal-schedule.txt639
-rw-r--r--Documentation/filesystems/Locking2
-rw-r--r--Documentation/filesystems/debugfs.txt4
-rw-r--r--Documentation/filesystems/porting5
-rw-r--r--Documentation/filesystems/vfat.txt11
-rw-r--r--Documentation/filesystems/vfs.txt4
-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-i8011
-rw-r--r--Documentation/ia64/aliasing-test.c1
-rw-r--r--Documentation/kernel-parameters.txt26
-rw-r--r--Documentation/kobject.txt6
-rw-r--r--Documentation/laptops/laptop-mode.txt12
-rw-r--r--Documentation/misc-devices/lis3lv02d3
-rw-r--r--Documentation/networking/netconsole.txt19
-rw-r--r--Documentation/pinctrl.txt6
-rw-r--r--Documentation/power/swsusp.txt2
-rw-r--r--Documentation/scheduler/sched-arch.txt10
-rw-r--r--Documentation/security/Yama.txt14
-rw-r--r--Documentation/serial/00-INDEX2
-rw-r--r--Documentation/serial/computone.txt520
-rw-r--r--Documentation/sysctl/vm.txt14
-rw-r--r--Documentation/trace/kprobetrace.txt2
-rw-r--r--Documentation/usb/persist.txt3
-rw-r--r--Documentation/vfio.txt2
-rw-r--r--Documentation/vm/hugetlbpage.txt10
-rw-r--r--Documentation/w1/slaves/w1_therm2
-rw-r--r--Documentation/watchdog/src/watchdog-test.c2
-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
120 files changed, 5542 insertions, 1439 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
index 34f51100f02..dff1f48d252 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -210,3 +210,15 @@ Users:
210 firmware assigned instance number of the PCI 210 firmware assigned instance number of the PCI
211 device that can help in understanding the firmware 211 device that can help in understanding the firmware
212 intended order of the PCI device. 212 intended order of the PCI device.
213
214What: /sys/bus/pci/devices/.../d3cold_allowed
215Date: July 2012
216Contact: Huang Ying <ying.huang@intel.com>
217Description:
218 d3cold_allowed is bit to control whether the corresponding PCI
219 device can be put into D3Cold state. If it is cleared, the
220 device will never be put into D3Cold state. If it is set, the
221 device may be put into D3Cold state if other requirements are
222 satisfied too. Reading this attribute will show the current
223 value of d3cold_allowed bit. Writing this attribute will set
224 the value of d3cold_allowed bit.
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb
index 5f75f8f7df3..b6fbe514a86 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 20ab361bd8c..57a72623291 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 e091fa87379..bc578bc6062 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-driver-wacom b/Documentation/ABI/testing/sysfs-driver-wacom
index 8d55a83d692..7fc781048b7 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-platform-ideapad-laptop b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop
index 814b01354c4..b31e782bd98 100644
--- a/Documentation/ABI/testing/sysfs-platform-ideapad-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop
@@ -5,4 +5,15 @@ Contact: "Ike Panhc <ike.pan@canonical.com>"
5Description: 5Description:
6 Control the power of camera module. 1 means on, 0 means off. 6 Control the power of camera module. 1 means on, 0 means off.
7 7
8What: /sys/devices/platform/ideapad/fan_mode
9Date: June 2012
10KernelVersion: 3.6
11Contact: "Maxim Mikityanskiy <maxtram95@gmail.com>"
12Description:
13 Change fan mode
14 There are four available modes:
15 * 0 -> Super Silent Mode
16 * 1 -> Standard Mode
17 * 2 -> Dust Cleaning
18 * 4 -> Efficient Thermal Dissipation Mode
8 19
diff --git a/Documentation/ABI/testing/sysfs-tty b/Documentation/ABI/testing/sysfs-tty
index b138b663bf5..0c430150d92 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/DocBook/filesystems.tmpl b/Documentation/DocBook/filesystems.tmpl
index 3fca32c4192..25b58efd955 100644
--- a/Documentation/DocBook/filesystems.tmpl
+++ b/Documentation/DocBook/filesystems.tmpl
@@ -224,8 +224,8 @@ all your transactions.
224</para> 224</para>
225 225
226<para> 226<para>
227Then at umount time , in your put_super() (2.4) or write_super() (2.5) 227Then at umount time , in your put_super() you can then call journal_destroy()
228you can then call journal_destroy() to clean up your in-core journal object. 228to clean up your in-core journal object.
229</para> 229</para>
230 230
231<para> 231<para>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
index 72039512790..701138f1209 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -125,7 +125,7 @@ the structure refers to a radio tuner the
125<constant>V4L2_TUNER_CAP_NORM</constant> flags can't be used.</para> 125<constant>V4L2_TUNER_CAP_NORM</constant> flags can't be used.</para>
126<para>If multiple frequency bands are supported, then 126<para>If multiple frequency bands are supported, then
127<structfield>capability</structfield> is the union of all 127<structfield>capability</structfield> is the union of all
128<structfield>capability></structfield> fields of each &v4l2-frequency-band;. 128<structfield>capability</structfield> fields of each &v4l2-frequency-band;.
129</para></entry> 129</para></entry>
130 </row> 130 </row>
131 <row> 131 <row>
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index fc103d7a047..cdb20d41a44 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 523364e4e1f..1927151b386 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 f6f15ce3990..672d1908325 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 69ee188515e..bf0f6de2aa0 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 f6318f6d7ba..6f706aca204 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/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 816d6071669..8b46c79679c 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 513f2562c1a..795adfd8808 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 208a2d465b9..4bfb9ffbdbc 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 00000000000..9c4d388dadd
--- /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 00000000000..dbbdcbba75a
--- /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/block/00-INDEX b/Documentation/block/00-INDEX
index d111e3b23db..d18ecd827c4 100644
--- a/Documentation/block/00-INDEX
+++ b/Documentation/block/00-INDEX
@@ -3,15 +3,21 @@
3biodoc.txt 3biodoc.txt
4 - Notes on the Generic Block Layer Rewrite in Linux 2.5 4 - Notes on the Generic Block Layer Rewrite in Linux 2.5
5capability.txt 5capability.txt
6 - Generic Block Device Capability (/sys/block/<disk>/capability) 6 - Generic Block Device Capability (/sys/block/<device>/capability)
7cfq-iosched.txt
8 - CFQ IO scheduler tunables
9data-integrity.txt
10 - Block data integrity
7deadline-iosched.txt 11deadline-iosched.txt
8 - Deadline IO scheduler tunables 12 - Deadline IO scheduler tunables
9ioprio.txt 13ioprio.txt
10 - Block io priorities (in CFQ scheduler) 14 - Block io priorities (in CFQ scheduler)
15queue-sysfs.txt
16 - Queue's sysfs entries
11request.txt 17request.txt
12 - The members of struct request (in include/linux/blkdev.h) 18 - The members of struct request (in include/linux/blkdev.h)
13stat.txt 19stat.txt
14 - Block layer statistics in /sys/block/<dev>/stat 20 - Block layer statistics in /sys/block/<device>/stat
15switching-sched.txt 21switching-sched.txt
16 - Switching I/O schedulers at runtime 22 - Switching I/O schedulers at runtime
17writeback_cache_control.txt 23writeback_cache_control.txt
diff --git a/Documentation/block/cfq-iosched.txt b/Documentation/block/cfq-iosched.txt
index 6d670f57045..d89b4fe724d 100644
--- a/Documentation/block/cfq-iosched.txt
+++ b/Documentation/block/cfq-iosched.txt
@@ -1,3 +1,14 @@
1CFQ (Complete Fairness Queueing)
2===============================
3
4The main aim of CFQ scheduler is to provide a fair allocation of the disk
5I/O bandwidth for all the processes which requests an I/O operation.
6
7CFQ maintains the per process queue for the processes which request I/O
8operation(syncronous requests). In case of asynchronous requests, all the
9requests from all the processes are batched together according to their
10process's I/O priority.
11
1CFQ ioscheduler tunables 12CFQ ioscheduler tunables
2======================== 13========================
3 14
@@ -25,6 +36,72 @@ there are multiple spindles behind single LUN (Host based hardware RAID
25controller or for storage arrays), setting slice_idle=0 might end up in better 36controller or for storage arrays), setting slice_idle=0 might end up in better
26throughput and acceptable latencies. 37throughput and acceptable latencies.
27 38
39back_seek_max
40-------------
41This specifies, given in Kbytes, the maximum "distance" for backward seeking.
42The distance is the amount of space from the current head location to the
43sectors that are backward in terms of distance.
44
45This parameter allows the scheduler to anticipate requests in the "backward"
46direction and consider them as being the "next" if they are within this
47distance from the current head location.
48
49back_seek_penalty
50-----------------
51This parameter is used to compute the cost of backward seeking. If the
52backward distance of request is just 1/back_seek_penalty from a "front"
53request, then the seeking cost of two requests is considered equivalent.
54
55So scheduler will not bias toward one or the other request (otherwise scheduler
56will bias toward front request). Default value of back_seek_penalty is 2.
57
58fifo_expire_async
59-----------------
60This parameter is used to set the timeout of asynchronous requests. Default
61value of this is 248ms.
62
63fifo_expire_sync
64----------------
65This parameter is used to set the timeout of synchronous requests. Default
66value of this is 124ms. In case to favor synchronous requests over asynchronous
67one, this value should be decreased relative to fifo_expire_async.
68
69slice_async
70-----------
71This parameter is same as of slice_sync but for asynchronous queue. The
72default value is 40ms.
73
74slice_async_rq
75--------------
76This parameter is used to limit the dispatching of asynchronous request to
77device request queue in queue's slice time. The maximum number of request that
78are allowed to be dispatched also depends upon the io priority. Default value
79for this is 2.
80
81slice_sync
82----------
83When a queue is selected for execution, the queues IO requests are only
84executed for a certain amount of time(time_slice) before switching to another
85queue. This parameter is used to calculate the time slice of synchronous
86queue.
87
88time_slice is computed using the below equation:-
89time_slice = slice_sync + (slice_sync/5 * (4 - prio)). To increase the
90time_slice of synchronous queue, increase the value of slice_sync. Default
91value is 100ms.
92
93quantum
94-------
95This specifies the number of request dispatched to the device queue. In a
96queue's time slice, a request will not be dispatched if the number of request
97in the device exceeds this parameter. This parameter is used for synchronous
98request.
99
100In case of storage with several disk, this setting can limit the parallel
101processing of request. Therefore, increasing the value can imporve the
102performace although this can cause the latency of some I/O to increase due
103to more number of requests.
104
28CFQ IOPS Mode for group scheduling 105CFQ IOPS Mode for group scheduling
29=================================== 106===================================
30Basic CFQ design is to provide priority based time slices. Higher priority 107Basic CFQ design is to provide priority based time slices. Higher priority
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt
index 6518a55273e..e54ac1d5340 100644
--- a/Documentation/block/queue-sysfs.txt
+++ b/Documentation/block/queue-sysfs.txt
@@ -9,20 +9,71 @@ These files are the ones found in the /sys/block/xxx/queue/ directory.
9Files denoted with a RO postfix are readonly and the RW postfix means 9Files denoted with a RO postfix are readonly and the RW postfix means
10read-write. 10read-write.
11 11
12add_random (RW)
13----------------
14This file allows to trun off the disk entropy contribution. Default
15value of this file is '1'(on).
16
17discard_granularity (RO)
18-----------------------
19This shows the size of internal allocation of the device in bytes, if
20reported by the device. A value of '0' means device does not support
21the discard functionality.
22
23discard_max_bytes (RO)
24----------------------
25Devices that support discard functionality may have internal limits on
26the number of bytes that can be trimmed or unmapped in a single operation.
27The discard_max_bytes parameter is set by the device driver to the maximum
28number of bytes that can be discarded in a single operation. Discard
29requests issued to the device must not exceed this limit. A discard_max_bytes
30value of 0 means that the device does not support discard functionality.
31
32discard_zeroes_data (RO)
33------------------------
34When read, this file will show if the discarded block are zeroed by the
35device or not. If its value is '1' the blocks are zeroed otherwise not.
36
12hw_sector_size (RO) 37hw_sector_size (RO)
13------------------- 38-------------------
14This is the hardware sector size of the device, in bytes. 39This is the hardware sector size of the device, in bytes.
15 40
41iostats (RW)
42-------------
43This file is used to control (on/off) the iostats accounting of the
44disk.
45
46logical_block_size (RO)
47-----------------------
48This is the logcal block size of the device, in bytes.
49
16max_hw_sectors_kb (RO) 50max_hw_sectors_kb (RO)
17---------------------- 51----------------------
18This is the maximum number of kilobytes supported in a single data transfer. 52This is the maximum number of kilobytes supported in a single data transfer.
19 53
54max_integrity_segments (RO)
55---------------------------
56When read, this file shows the max limit of integrity segments as
57set by block layer which a hardware controller can handle.
58
20max_sectors_kb (RW) 59max_sectors_kb (RW)
21------------------- 60-------------------
22This is the maximum number of kilobytes that the block layer will allow 61This is the maximum number of kilobytes that the block layer will allow
23for a filesystem request. Must be smaller than or equal to the maximum 62for a filesystem request. Must be smaller than or equal to the maximum
24size allowed by the hardware. 63size allowed by the hardware.
25 64
65max_segments (RO)
66-----------------
67Maximum number of segments of the device.
68
69max_segment_size (RO)
70---------------------
71Maximum segment size of the device.
72
73minimum_io_size (RO)
74--------------------
75This is the smallest preferred io size reported by the device.
76
26nomerges (RW) 77nomerges (RW)
27------------- 78-------------
28This enables the user to disable the lookup logic involved with IO 79This enables the user to disable the lookup logic involved with IO
@@ -45,11 +96,24 @@ per-block-cgroup request pool. IOW, if there are N block cgroups,
45each request queue may have upto N request pools, each independently 96each request queue may have upto N request pools, each independently
46regulated by nr_requests. 97regulated by nr_requests.
47 98
99optimal_io_size (RO)
100--------------------
101This is the optimal io size reported by the device.
102
103physical_block_size (RO)
104------------------------
105This is the physical block size of device, in bytes.
106
48read_ahead_kb (RW) 107read_ahead_kb (RW)
49------------------ 108------------------
50Maximum number of kilobytes to read-ahead for filesystems on this block 109Maximum number of kilobytes to read-ahead for filesystems on this block
51device. 110device.
52 111
112rotational (RW)
113---------------
114This file is used to stat if the device is of rotational type or
115non-rotational type.
116
53rq_affinity (RW) 117rq_affinity (RW)
54---------------- 118----------------
55If this option is '1', the block layer will migrate request completions to the 119If this option is '1', the block layer will migrate request completions to the
diff --git a/Documentation/devicetree/bindings/arm/bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm2835.txt
new file mode 100644
index 00000000000..ac683480c48
--- /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/mrvl/tauros2.txt b/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt
new file mode 100644
index 00000000000..31af1cbb60b
--- /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 00000000000..8c5907b9cae
--- /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 ccdd0e53451..d0051a75058 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 1c044eb320c..343781b9f24 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/vt8500.txt b/Documentation/devicetree/bindings/arm/vt8500.txt
new file mode 100644
index 00000000000..d657832c681
--- /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 00000000000..0a4ce1051b0
--- /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 00000000000..521b9c7de93
--- /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 00000000000..901c73f0d8e
--- /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/bus/omap-ocp2scp.txt b/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt
new file mode 100644
index 00000000000..d2fe064a828
--- /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 00000000000..a0b867ef8d9
--- /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 00000000000..aa2af2866fe
--- /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 00000000000..492bd991d52
--- /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 00000000000..a880c70d004
--- /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/dma/mmp-dma.txt b/Documentation/devicetree/bindings/dma/mmp-dma.txt
new file mode 100644
index 00000000000..a4fa4efa1d8
--- /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-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
index 5375625e8cd..f1e5dfecf55 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 16695d9cf1e..66788fda1db 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 00000000000..f4dc5233167
--- /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/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 1a85f986961..2f5322b119e 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/interrupt-controller/brcm,bcm2835-armctrl-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
new file mode 100644
index 00000000000..548892c08c5
--- /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/lpddr2/lpddr2-timings.txt b/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
new file mode 100644
index 00000000000..9ceb19e0c7f
--- /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 00000000000..58354a075e1
--- /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 00000000000..0604d42f38d
--- /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 00000000000..938f8e1ba20
--- /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/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt
index 69e757a657a..ce83c8d3c00 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/misc/at25.txt b/Documentation/devicetree/bindings/misc/at25.txt
index ab3c327929d..1d3447165c3 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/lis302.txt b/Documentation/devicetree/bindings/misc/lis302.txt
new file mode 100644
index 00000000000..6def86f6b05
--- /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/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 70cd49b1caa..1dd622546d0 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -10,8 +10,8 @@ Required properties:
10- compatible : Should be "fsl,<chip>-esdhc" 10- compatible : Should be "fsl,<chip>-esdhc"
11 11
12Optional properties: 12Optional properties:
13- fsl,cd-internal : Indicate to use controller internal card detection 13- fsl,cd-controller : Indicate to use controller internal card detection
14- fsl,wp-internal : Indicate to use controller internal write protection 14- fsl,wp-controller : Indicate to use controller internal write protection
15 15
16Examples: 16Examples:
17 17
@@ -19,8 +19,8 @@ esdhc@70004000 {
19 compatible = "fsl,imx51-esdhc"; 19 compatible = "fsl,imx51-esdhc";
20 reg = <0x70004000 0x4000>; 20 reg = <0x70004000 0x4000>;
21 interrupts = <1>; 21 interrupts = <1>;
22 fsl,cd-internal; 22 fsl,cd-controller;
23 fsl,wp-internal; 23 fsl,wp-controller;
24}; 24};
25 25
26esdhc@70008000 { 26esdhc@70008000 {
diff --git a/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt b/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
new file mode 100644
index 00000000000..f1421e2bbab
--- /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/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
new file mode 100644
index 00000000000..03dee50532f
--- /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/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 66ece3f87bb..ecfc6ccd67e 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 0487e9675ba..d316fb895da 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 d156e1b5db1..07b9ef6e49d 100644
--- a/Documentation/devicetree/bindings/regulator/tps6586x.txt
+++ b/Documentation/devicetree/bindings/regulator/tps6586x.txt
@@ -6,12 +6,16 @@ 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- sm0-supply: The input supply for the SM0. 12 The content of each sub-node is defined by the standard binding for
13- sm1-supply: The input supply for the SM1. 13 regulators; see regulator.txt.
14- sm2-supply: The input supply for the SM2. 14 sys, sm[0-2], ldo[0-9] and ldo_rtc
15- sys-supply: The input supply for SYS.
16- vin-sm0-supply: The input supply for the SM0.
17- vin-sm1-supply: The input supply for the SM1.
18- vin-sm2-supply: The input supply for the SM2.
15- vinldo01-supply: The input supply for the LDO1 and LDO2 19- vinldo01-supply: The input supply for the LDO1 and LDO2
16- vinldo23-supply: The input supply for the LDO2 and LDO3 20- vinldo23-supply: The input supply for the LDO2 and LDO3
17- vinldo4-supply: The input supply for the LDO4 21- vinldo4-supply: The input supply for the LDO4
@@ -20,6 +24,9 @@ Required properties:
20 24
21Each regulator is defined using the standard binding for regulators. 25Each regulator is defined using the standard binding for regulators.
22 26
27Note: LDO5 and LDO_RTC is supplied by SYS regulator internally and driver
28 take care of making proper parent child relationship.
29
23Example: 30Example:
24 31
25 pmu: tps6586x@34 { 32 pmu: tps6586x@34 {
@@ -30,9 +37,10 @@ Example:
30 #gpio-cells = <2>; 37 #gpio-cells = <2>;
31 gpio-controller; 38 gpio-controller;
32 39
33 sm0-supply = <&some_reg>; 40 sys-supply = <&some_reg>;
34 sm1-supply = <&some_reg>; 41 vin-sm0-supply = <&some_reg>;
35 sm2-supply = <&some_reg>; 42 vin-sm1-supply = <&some_reg>;
43 vin-sm2-supply = <&some_reg>;
36 vinldo01-supply = <...>; 44 vinldo01-supply = <...>;
37 vinldo23-supply = <...>; 45 vinldo23-supply = <...>;
38 vinldo4-supply = <...>; 46 vinldo4-supply = <...>;
@@ -40,103 +48,80 @@ Example:
40 vinldo9-supply = <...>; 48 vinldo9-supply = <...>;
41 49
42 regulators { 50 regulators {
43 #address-cells = <1>; 51 sys_reg: sys {
44 #size-cells = <0>; 52 regulator-name = "vdd_sys";
53 regulator-boot-on;
54 regulator-always-on;
55 };
45 56
46 sm0_reg: regulator@0 { 57 sm0_reg: sm0 {
47 reg = <0>;
48 regulator-compatible = "sm0";
49 regulator-min-microvolt = < 725000>; 58 regulator-min-microvolt = < 725000>;
50 regulator-max-microvolt = <1500000>; 59 regulator-max-microvolt = <1500000>;
51 regulator-boot-on; 60 regulator-boot-on;
52 regulator-always-on; 61 regulator-always-on;
53 }; 62 };
54 63
55 sm1_reg: regulator@1 { 64 sm1_reg: sm1 {
56 reg = <1>;
57 regulator-compatible = "sm1";
58 regulator-min-microvolt = < 725000>; 65 regulator-min-microvolt = < 725000>;
59 regulator-max-microvolt = <1500000>; 66 regulator-max-microvolt = <1500000>;
60 regulator-boot-on; 67 regulator-boot-on;
61 regulator-always-on; 68 regulator-always-on;
62 }; 69 };
63 70
64 sm2_reg: regulator@2 { 71 sm2_reg: sm2 {
65 reg = <2>;
66 regulator-compatible = "sm2";
67 regulator-min-microvolt = <3000000>; 72 regulator-min-microvolt = <3000000>;
68 regulator-max-microvolt = <4550000>; 73 regulator-max-microvolt = <4550000>;
69 regulator-boot-on; 74 regulator-boot-on;
70 regulator-always-on; 75 regulator-always-on;
71 }; 76 };
72 77
73 ldo0_reg: regulator@3 { 78 ldo0_reg: ldo0 {
74 reg = <3>;
75 regulator-compatible = "ldo0";
76 regulator-name = "PCIE CLK"; 79 regulator-name = "PCIE CLK";
77 regulator-min-microvolt = <3300000>; 80 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>; 81 regulator-max-microvolt = <3300000>;
79 }; 82 };
80 83
81 ldo1_reg: regulator@4 { 84 ldo1_reg: ldo1 {
82 reg = <4>;
83 regulator-compatible = "ldo1";
84 regulator-min-microvolt = < 725000>; 85 regulator-min-microvolt = < 725000>;
85 regulator-max-microvolt = <1500000>; 86 regulator-max-microvolt = <1500000>;
86 }; 87 };
87 88
88 ldo2_reg: regulator@5 { 89 ldo2_reg: ldo2 {
89 reg = <5>;
90 regulator-compatible = "ldo2";
91 regulator-min-microvolt = < 725000>; 90 regulator-min-microvolt = < 725000>;
92 regulator-max-microvolt = <1500000>; 91 regulator-max-microvolt = <1500000>;
93 }; 92 };
94 93
95 ldo3_reg: regulator@6 { 94 ldo3_reg: ldo3 {
96 reg = <6>;
97 regulator-compatible = "ldo3";
98 regulator-min-microvolt = <1250000>; 95 regulator-min-microvolt = <1250000>;
99 regulator-max-microvolt = <3300000>; 96 regulator-max-microvolt = <3300000>;
100 }; 97 };
101 98
102 ldo4_reg: regulator@7 { 99 ldo4_reg: ldo4 {
103 reg = <7>;
104 regulator-compatible = "ldo4";
105 regulator-min-microvolt = <1700000>; 100 regulator-min-microvolt = <1700000>;
106 regulator-max-microvolt = <2475000>; 101 regulator-max-microvolt = <2475000>;
107 }; 102 };
108 103
109 ldo5_reg: regulator@8 { 104 ldo5_reg: ldo5 {
110 reg = <8>;
111 regulator-compatible = "ldo5";
112 regulator-min-microvolt = <1250000>; 105 regulator-min-microvolt = <1250000>;
113 regulator-max-microvolt = <3300000>; 106 regulator-max-microvolt = <3300000>;
114 }; 107 };
115 108
116 ldo6_reg: regulator@9 { 109 ldo6_reg: ldo6 {
117 reg = <9>;
118 regulator-compatible = "ldo6";
119 regulator-min-microvolt = <1250000>; 110 regulator-min-microvolt = <1250000>;
120 regulator-max-microvolt = <3300000>; 111 regulator-max-microvolt = <3300000>;
121 }; 112 };
122 113
123 ldo7_reg: regulator@10 { 114 ldo7_reg: ldo7 {
124 reg = <10>;
125 regulator-compatible = "ldo7";
126 regulator-min-microvolt = <1250000>; 115 regulator-min-microvolt = <1250000>;
127 regulator-max-microvolt = <3300000>; 116 regulator-max-microvolt = <3300000>;
128 }; 117 };
129 118
130 ldo8_reg: regulator@11 { 119 ldo8_reg: ldo8 {
131 reg = <11>;
132 regulator-compatible = "ldo8";
133 regulator-min-microvolt = <1250000>; 120 regulator-min-microvolt = <1250000>;
134 regulator-max-microvolt = <3300000>; 121 regulator-max-microvolt = <3300000>;
135 }; 122 };
136 123
137 ldo9_reg: regulator@12 { 124 ldo9_reg: ldo9 {
138 reg = <12>;
139 regulator-compatible = "ldo9";
140 regulator-min-microvolt = <1250000>; 125 regulator-min-microvolt = <1250000>;
141 regulator-max-microvolt = <3300000>; 126 regulator-max-microvolt = <3300000>;
142 }; 127 };
diff --git a/Documentation/devicetree/bindings/rtc/pxa-rtc.txt b/Documentation/devicetree/bindings/rtc/pxa-rtc.txt
new file mode 100644
index 00000000000..8c6672a1b7d
--- /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/via,vt8500-rtc.txt b/Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt
new file mode 100644
index 00000000000..3c0484c4958
--- /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/sound/ux500-mop500.txt b/Documentation/devicetree/bindings/sound/ux500-mop500.txt
new file mode 100644
index 00000000000..48e071c96b4
--- /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 00000000000..99acd9c774e
--- /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/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
new file mode 100644
index 00000000000..801d58cb6d4
--- /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 00000000000..07654f0338b
--- /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 00000000000..2de21c2acf5
--- /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 00000000000..0d439dfc1aa
--- /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 0847fdeee11..ba385f2e0dd 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 00000000000..5feef1ef167
--- /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 00000000000..ca8fa56e9f0
--- /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 2c290418bb2..5778b9c83bd 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 00000000000..29a043ecda5
--- /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 00000000000..a4fb0719d15
--- /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 00000000000..79729a948d5
--- /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 00000000000..36b9aede3f4
--- /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 00000000000..80d4148cb66
--- /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 00000000000..97ce94e1a6c
--- /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 00000000000..17b3ad1d97e
--- /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 00000000000..5fb8fd6e250
--- /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 db4d3af3643..9de2b9ff9d6 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/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
new file mode 100644
index 00000000000..c870b6478ec
--- /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 00000000000..a850fa011f0
--- /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 00000000000..3d325e1d11e
--- /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 00000000000..6e09c35d9f1
--- /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 39462cf35cd..74c25c8d888 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/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
deleted file mode 100644
index afaff312bf4..00000000000
--- 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.7
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/Locking b/Documentation/filesystems/Locking
index 0f103e39b4f..e540a24e5d0 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -114,7 +114,6 @@ prototypes:
114 int (*drop_inode) (struct inode *); 114 int (*drop_inode) (struct inode *);
115 void (*evict_inode) (struct inode *); 115 void (*evict_inode) (struct inode *);
116 void (*put_super) (struct super_block *); 116 void (*put_super) (struct super_block *);
117 void (*write_super) (struct super_block *);
118 int (*sync_fs)(struct super_block *sb, int wait); 117 int (*sync_fs)(struct super_block *sb, int wait);
119 int (*freeze_fs) (struct super_block *); 118 int (*freeze_fs) (struct super_block *);
120 int (*unfreeze_fs) (struct super_block *); 119 int (*unfreeze_fs) (struct super_block *);
@@ -136,7 +135,6 @@ write_inode:
136drop_inode: !!!inode->i_lock!!! 135drop_inode: !!!inode->i_lock!!!
137evict_inode: 136evict_inode:
138put_super: write 137put_super: write
139write_super: read
140sync_fs: read 138sync_fs: read
141freeze_fs: write 139freeze_fs: write
142unfreeze_fs: write 140unfreeze_fs: write
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt
index 7a34f827989..3a863f69272 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/porting b/Documentation/filesystems/porting
index 2bef2b3843d..0742feebc6e 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -94,9 +94,8 @@ protected.
94--- 94---
95[mandatory] 95[mandatory]
96 96
97BKL is also moved from around sb operations. ->write_super() Is now called 97BKL is also moved from around sb operations. BKL should have been shifted into
98without BKL held. BKL should have been shifted into individual fs sb_op 98individual fs sb_op functions. If you don't need it, remove it.
99functions. If you don't need it, remove it.
100 99
101--- 100---
102[informational] 101[informational]
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index ead764b2728..de1e6c4dccf 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -137,6 +137,17 @@ errors=panic|continue|remount-ro
137 without doing anything or remount the partition in 137 without doing anything or remount the partition in
138 read-only mode (default behavior). 138 read-only mode (default behavior).
139 139
140discard -- If set, issues discard/TRIM commands to the block
141 device when blocks are freed. This is useful for SSD devices
142 and sparse/thinly-provisoned LUNs.
143
144nfs -- This option maintains an index (cache) of directory
145 inodes by i_logstart which is used by the nfs-related code to
146 improve look-ups.
147
148 Enable this only if you want to export the FAT filesystem
149 over NFS
150
140<bool>: 0,1,yes,no,true,false 151<bool>: 0,1,yes,no,true,false
141 152
142TODO 153TODO
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 065aa2dc083..2ee133e030c 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -216,7 +216,6 @@ struct super_operations {
216 void (*drop_inode) (struct inode *); 216 void (*drop_inode) (struct inode *);
217 void (*delete_inode) (struct inode *); 217 void (*delete_inode) (struct inode *);
218 void (*put_super) (struct super_block *); 218 void (*put_super) (struct super_block *);
219 void (*write_super) (struct super_block *);
220 int (*sync_fs)(struct super_block *sb, int wait); 219 int (*sync_fs)(struct super_block *sb, int wait);
221 int (*freeze_fs) (struct super_block *); 220 int (*freeze_fs) (struct super_block *);
222 int (*unfreeze_fs) (struct super_block *); 221 int (*unfreeze_fs) (struct super_block *);
@@ -273,9 +272,6 @@ or bottom half).
273 put_super: called when the VFS wishes to free the superblock 272 put_super: called when the VFS wishes to free the superblock
274 (i.e. unmount). This is called with the superblock lock held 273 (i.e. unmount). This is called with the superblock lock held
275 274
276 write_super: called when the VFS superblock needs to be written to
277 disc. This method is optional
278
279 sync_fs: called when VFS is writing out all dirty data associated with 275 sync_fs: called when VFS is writing out all dirty data associated with
280 a superblock. The second parameter indicates whether the method 276 a superblock. The second parameter indicates whether the method
281 should wait until the write out has been completed. Optional. 277 should wait until the write out has been completed. Optional.
diff --git a/Documentation/hid/hid-sensor.txt b/Documentation/hid/hid-sensor.txt
new file mode 100755
index 00000000000..948b0989c43
--- /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 00000000000..96004000dc2
--- /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 f50a6cc2761..03444f9d833 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 0d240291e3c..86d182942c5 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 00000000000..8d89b9009df
--- /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 325fd87e81b..74a6b72adf5 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-i801 b/Documentation/i2c/busses/i2c-i801
index 615142da4ef..157416e78cc 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -21,6 +21,7 @@ Supported adapters:
21 * Intel DH89xxCC (PCH) 21 * Intel DH89xxCC (PCH)
22 * Intel Panther Point (PCH) 22 * Intel Panther Point (PCH)
23 * Intel Lynx Point (PCH) 23 * Intel Lynx Point (PCH)
24 * Intel Lynx Point-LP (PCH)
24 Datasheets: Publicly available at the Intel website 25 Datasheets: Publicly available at the Intel website
25 26
26On Intel Patsburg and later chipsets, both the normal host SMBus controller 27On Intel Patsburg and later chipsets, both the normal host SMBus controller
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c
index 5caa2af3320..62a190d45f3 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/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index ad7e2e5088c..df43807bb5d 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1812,8 +1812,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1812 noexec=on: enable non-executable mappings (default) 1812 noexec=on: enable non-executable mappings (default)
1813 noexec=off: disable non-executable mappings 1813 noexec=off: disable non-executable mappings
1814 1814
1815 nosmap [X86]
1816 Disable SMAP (Supervisor Mode Access Prevention)
1817 even if it is supported by processor.
1818
1815 nosmep [X86] 1819 nosmep [X86]
1816 Disable SMEP (Supervisor Mode Execution Protection) 1820 Disable SMEP (Supervisor Mode Execution Prevention)
1817 even if it is supported by processor. 1821 even if it is supported by processor.
1818 1822
1819 noexec32 [X86-64] 1823 noexec32 [X86-64]
@@ -1833,6 +1837,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1833 and restore using xsave. The kernel will fallback to 1837 and restore using xsave. The kernel will fallback to
1834 enabling legacy floating-point and sse state. 1838 enabling legacy floating-point and sse state.
1835 1839
1840 eagerfpu= [X86]
1841 on enable eager fpu restore
1842 off disable eager fpu restore
1843 auto selects the default scheme, which automatically
1844 enables eagerfpu restore for xsaveopt.
1845
1836 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or 1846 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
1837 wfi(ARM) instruction doesn't work correctly and not to 1847 wfi(ARM) instruction doesn't work correctly and not to
1838 use it. This is also useful when using JTAG debugger. 1848 use it. This is also useful when using JTAG debugger.
@@ -2385,6 +2395,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2385 rcutree.rcu_cpu_stall_timeout= [KNL,BOOT] 2395 rcutree.rcu_cpu_stall_timeout= [KNL,BOOT]
2386 Set timeout for RCU CPU stall warning messages. 2396 Set timeout for RCU CPU stall warning messages.
2387 2397
2398 rcutree.jiffies_till_first_fqs= [KNL,BOOT]
2399 Set delay from grace-period initialization to
2400 first attempt to force quiescent states.
2401 Units are jiffies, minimum value is zero,
2402 and maximum value is HZ.
2403
2404 rcutree.jiffies_till_next_fqs= [KNL,BOOT]
2405 Set delay between subsequent attempts to force
2406 quiescent states. Units are jiffies, minimum
2407 value is one, and maximum value is HZ.
2408
2388 rcutorture.fqs_duration= [KNL,BOOT] 2409 rcutorture.fqs_duration= [KNL,BOOT]
2389 Set duration of force_quiescent_state bursts. 2410 Set duration of force_quiescent_state bursts.
2390 2411
@@ -2638,9 +2659,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2638 smart2= [HW] 2659 smart2= [HW]
2639 Format: <io1>[,<io2>[,...,<io8>]] 2660 Format: <io1>[,<io2>[,...,<io8>]]
2640 2661
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 2662 smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices
2645 smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port 2663 smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port
2646 smsc-ircc2.ircc_sir= [HW] SIR base I/O port 2664 smsc-ircc2.ircc_sir= [HW] SIR base I/O port
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index 49578cf1aea..c5182bb2c16 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/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt
index 0bf25eebce9..4ebbfc3f1c6 100644
--- a/Documentation/laptops/laptop-mode.txt
+++ b/Documentation/laptops/laptop-mode.txt
@@ -262,9 +262,9 @@ MINIMUM_BATTERY_MINUTES=10
262 262
263# 263#
264# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been 264# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
265# exceeded, the kernel will wake pdflush which will then reduce the amount 265# exceeded, the kernel will wake flusher threads which will then reduce the
266# of dirty memory to dirty_background_ratio. Set this nice and low, so once 266# amount of dirty memory to dirty_background_ratio. Set this nice and low,
267# some writeout has commenced, we do a lot of it. 267# so once some writeout has commenced, we do a lot of it.
268# 268#
269#DIRTY_BACKGROUND_RATIO=5 269#DIRTY_BACKGROUND_RATIO=5
270 270
@@ -384,9 +384,9 @@ CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'}
384 384
385# 385#
386# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been 386# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
387# exceeded, the kernel will wake pdflush which will then reduce the amount 387# exceeded, the kernel will wake flusher threads which will then reduce the
388# of dirty memory to dirty_background_ratio. Set this nice and low, so once 388# amount of dirty memory to dirty_background_ratio. Set this nice and low,
389# some writeout has commenced, we do a lot of it. 389# so once some writeout has commenced, we do a lot of it.
390# 390#
391DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} 391DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'}
392 392
diff --git a/Documentation/misc-devices/lis3lv02d b/Documentation/misc-devices/lis3lv02d
index f1a4ec840f8..af815b9ba41 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/netconsole.txt b/Documentation/networking/netconsole.txt
index 8d022073e3e..2e9e0ae2cd4 100644
--- a/Documentation/networking/netconsole.txt
+++ b/Documentation/networking/netconsole.txt
@@ -51,8 +51,23 @@ Built-in netconsole starts immediately after the TCP stack is
51initialized and attempts to bring up the supplied dev at the supplied 51initialized and attempts to bring up the supplied dev at the supplied
52address. 52address.
53 53
54The remote host can run either 'netcat -u -l -p <port>', 54The remote host has several options to receive the kernel messages,
55'nc -l -u <port>' or syslogd. 55for example:
56
571) syslogd
58
592) netcat
60
61 On distributions using a BSD-based netcat version (e.g. Fedora,
62 openSUSE and Ubuntu) the listening port must be specified without
63 the -p switch:
64
65 'nc -u -l -p <port>' / 'nc -u -l <port>' or
66 'netcat -u -l -p <port>' / 'netcat -u -l <port>'
67
683) socat
69
70 'socat udp-recv:<port> -'
56 71
57Dynamic reconfiguration: 72Dynamic reconfiguration:
58======================== 73========================
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt
index e40f4b4e197..1479aca2374 100644
--- a/Documentation/pinctrl.txt
+++ b/Documentation/pinctrl.txt
@@ -840,9 +840,9 @@ static unsigned long i2c_pin_configs[] = {
840 840
841static struct pinctrl_map __initdata mapping[] = { 841static struct pinctrl_map __initdata mapping[] = {
842 PIN_MAP_MUX_GROUP("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", "i2c0"), 842 PIN_MAP_MUX_GROUP("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", "i2c0"),
843 PIN_MAP_MUX_CONFIGS_GROUP("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", i2c_grp_configs), 843 PIN_MAP_CONFIGS_GROUP("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", i2c_grp_configs),
844 PIN_MAP_MUX_CONFIGS_PIN("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0scl", i2c_pin_configs), 844 PIN_MAP_CONFIGS_PIN("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0scl", i2c_pin_configs),
845 PIN_MAP_MUX_CONFIGS_PIN("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0sda", i2c_pin_configs), 845 PIN_MAP_CONFIGS_PIN("foo-i2c.0", PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0sda", i2c_pin_configs),
846}; 846};
847 847
848Finally, some devices expect the mapping table to contain certain specific 848Finally, some devices expect the mapping table to contain certain specific
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 92341b84250..0b4b63e7e9b 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/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt
index 28aa1075e29..b1b8587b86f 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/security/Yama.txt b/Documentation/security/Yama.txt
index e369de2d48c..dd908cf64ec 100644
--- a/Documentation/security/Yama.txt
+++ b/Documentation/security/Yama.txt
@@ -46,14 +46,13 @@ restrictions, it can call prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, ...)
46so that any otherwise allowed process (even those in external pid namespaces) 46so that any otherwise allowed process (even those in external pid namespaces)
47may attach. 47may attach.
48 48
49These restrictions do not change how ptrace via PTRACE_TRACEME operates. 49The sysctl settings (writable only with CAP_SYS_PTRACE) are:
50
51The sysctl settings are:
52 50
530 - classic ptrace permissions: a process can PTRACE_ATTACH to any other 510 - classic ptrace permissions: a process can PTRACE_ATTACH to any other
54 process running under the same uid, as long as it is dumpable (i.e. 52 process running under the same uid, as long as it is dumpable (i.e.
55 did not transition uids, start privileged, or have called 53 did not transition uids, start privileged, or have called
56 prctl(PR_SET_DUMPABLE...) already). 54 prctl(PR_SET_DUMPABLE...) already). Similarly, PTRACE_TRACEME is
55 unchanged.
57 56
581 - restricted ptrace: a process must have a predefined relationship 571 - restricted ptrace: a process must have a predefined relationship
59 with the inferior it wants to call PTRACE_ATTACH on. By default, 58 with the inferior it wants to call PTRACE_ATTACH on. By default,
@@ -61,12 +60,13 @@ The sysctl settings are:
61 classic criteria is also met. To change the relationship, an 60 classic criteria is also met. To change the relationship, an
62 inferior can call prctl(PR_SET_PTRACER, debugger, ...) to declare 61 inferior can call prctl(PR_SET_PTRACER, debugger, ...) to declare
63 an allowed debugger PID to call PTRACE_ATTACH on the inferior. 62 an allowed debugger PID to call PTRACE_ATTACH on the inferior.
63 Using PTRACE_TRACEME is unchanged.
64 64
652 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace 652 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace
66 with PTRACE_ATTACH. 66 with PTRACE_ATTACH, or through children calling PTRACE_TRACEME.
67 67
683 - no attach: no processes may use ptrace with PTRACE_ATTACH. Once set, 683 - no attach: no processes may use ptrace with PTRACE_ATTACH nor via
69 this sysctl cannot be changed to a lower value. 69 PTRACE_TRACEME. Once set, this sysctl value cannot be changed.
70 70
71The original children-only logic was based on the restrictions in grsecurity. 71The original children-only logic was based on the restrictions in grsecurity.
72 72
diff --git a/Documentation/serial/00-INDEX b/Documentation/serial/00-INDEX
index e09468ad3cb..f7b0c7dc25e 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 a6a1158ea2b..00000000000
--- 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/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index dcc2a94ae34..078701fdbd4 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -76,8 +76,8 @@ huge pages although processes will also directly compact memory as required.
76 76
77dirty_background_bytes 77dirty_background_bytes
78 78
79Contains the amount of dirty memory at which the pdflush background writeback 79Contains the amount of dirty memory at which the background kernel
80daemon will start writeback. 80flusher threads will start writeback.
81 81
82Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only 82Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
83one of them may be specified at a time. When one sysctl is written it is 83one of them may be specified at a time. When one sysctl is written it is
@@ -89,7 +89,7 @@ other appears as 0 when read.
89dirty_background_ratio 89dirty_background_ratio
90 90
91Contains, as a percentage of total system memory, the number of pages at which 91Contains, as a percentage of total system memory, the number of pages at which
92the pdflush background writeback daemon will start writing out dirty data. 92the background kernel flusher threads will start writing out dirty data.
93 93
94============================================================== 94==============================================================
95 95
@@ -112,9 +112,9 @@ retained.
112dirty_expire_centisecs 112dirty_expire_centisecs
113 113
114This tunable is used to define when dirty data is old enough to be eligible 114This tunable is used to define when dirty data is old enough to be eligible
115for writeout by the pdflush daemons. It is expressed in 100'ths of a second. 115for writeout by the kernel flusher threads. It is expressed in 100'ths
116Data which has been dirty in-memory for longer than this interval will be 116of a second. Data which has been dirty in-memory for longer than this
117written out next time a pdflush daemon wakes up. 117interval will be written out next time a flusher thread wakes up.
118 118
119============================================================== 119==============================================================
120 120
@@ -128,7 +128,7 @@ data.
128 128
129dirty_writeback_centisecs 129dirty_writeback_centisecs
130 130
131The pdflush writeback daemons will periodically wake up and write `old' data 131The kernel flusher threads will periodically wake up and write `old' data
132out to disk. This tunable expresses the interval between those wakeups, in 132out to disk. This tunable expresses the interval between those wakeups, in
133100'ths of a second. 133100'ths of a second.
134 134
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
index d0d0bb9e3e2..d68ea5fc812 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 074b159b77c..35d70eda9ad 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/vfio.txt b/Documentation/vfio.txt
index 0cb6685c802..8eda3635a17 100644
--- a/Documentation/vfio.txt
+++ b/Documentation/vfio.txt
@@ -133,7 +133,7 @@ character devices for this group:
133$ lspci -n -s 0000:06:0d.0 133$ lspci -n -s 0000:06:0d.0
13406:0d.0 0401: 1102:0002 (rev 08) 13406:0d.0 0401: 1102:0002 (rev 08)
135# echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind 135# echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
136# echo 1102 0002 > /sys/bus/pci/drivers/vfio/new_id 136# echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
137 137
138Now we need to look at what other devices are in the group to free 138Now we need to look at what other devices are in the group to free
139it for use by VFIO: 139it for use by VFIO:
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index f8551b3879f..4ac359b7aa1 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -299,11 +299,17 @@ map_hugetlb.c.
299******************************************************************* 299*******************************************************************
300 300
301/* 301/*
302 * hugepage-shm: see Documentation/vm/hugepage-shm.c 302 * map_hugetlb: see tools/testing/selftests/vm/map_hugetlb.c
303 */ 303 */
304 304
305******************************************************************* 305*******************************************************************
306 306
307/* 307/*
308 * hugepage-mmap: see Documentation/vm/hugepage-mmap.c 308 * hugepage-shm: see tools/testing/selftests/vm/hugepage-shm.c
309 */
310
311*******************************************************************
312
313/*
314 * hugepage-mmap: see tools/testing/selftests/vm/hugepage-mmap.c
309 */ 315 */
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm
index 0403aaaba87..874a8ca93fe 100644
--- a/Documentation/w1/slaves/w1_therm
+++ b/Documentation/w1/slaves/w1_therm
@@ -3,6 +3,7 @@ Kernel driver w1_therm
3 3
4Supported chips: 4Supported chips:
5 * Maxim ds18*20 based temperature sensors. 5 * Maxim ds18*20 based temperature sensors.
6 * Maxim ds1825 based temperature sensors.
6 7
7Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> 8Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
8 9
@@ -15,6 +16,7 @@ supported family codes:
15W1_THERM_DS18S20 0x10 16W1_THERM_DS18S20 0x10
16W1_THERM_DS1822 0x22 17W1_THERM_DS1822 0x22
17W1_THERM_DS18B20 0x28 18W1_THERM_DS18B20 0x28
19W1_THERM_DS1825 0x3B
18 20
19Support is provided through the sysfs w1_slave file. Each open and 21Support is provided through the sysfs w1_slave file. Each open and
20read sequence will initiate a temperature conversion then provide two 22read sequence will initiate a temperature conversion then provide two
diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c
index 73ff5cc93e0..3da822967ee 100644
--- a/Documentation/watchdog/src/watchdog-test.c
+++ b/Documentation/watchdog/src/watchdog-test.c
@@ -31,7 +31,7 @@ static void keep_alive(void)
31 * or "-e" to enable the card. 31 * or "-e" to enable the card.
32 */ 32 */
33 33
34void term(int sig) 34static void term(int sig)
35{ 35{
36 close(fd); 36 close(fd);
37 fprintf(stderr, "Stopping watchdog ticks...\n"); 37 fprintf(stderr, "Stopping watchdog ticks...\n");
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index c54b4f503e2..de38429beb7 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 00000000000..6158a64df80
--- /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 00000000000..1e6bf0bdf8f
--- /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 00000000000..e230eaa3312
--- /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 00000000000..4fa7b4e6f85
--- /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 00000000000..67ffbf352ae
--- /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 00000000000..3e74f13af42
--- /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)中找到。