Convert files to ReST - part 2
Subsystems (46)
cover Convert files to ReST - part 2
This is the second part of a series I wrote sometime ago where I manually convert lots of files to be properly parsed by Sphinx as ReST files.
As it touches on lot of stuff, this series is based on today's linux-next, at tag next-20190612.
The first version of this series had 57 patches. Right now, there are ~80 patches pending applying on this undergoing work. That's because I opted to do ~1 patch per converted directory.
That sounds too much to be send on a single round. So, I'm opting to split it on 3 parts. That's the second part.
Those patches should probably be good to be merged either by subsystem maintainers or via the docs tree.
I opted to mark new files not included yet to the main index.rst (directly or indirectly) with the :orphan: tag, in order to avoid adding warnings to the build system. This should be removed after we find a "home" for all the converted files within the new document tree arrangement.
Both this series and the other parts of this work are on my devel git tree, at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=convert_rst_renames_v4.3
The final output in html (after all patches I currently have, including the upcoming series) can be seen at:
https://www.infradead.org/~mchehab/rst_conversion/
Mauro Carvalho Chehab (31):
docs: connector: convert to ReST and rename to connector.rst
docs: lcd-panel-cgram.txt: convert docs to ReST and rename to *.rst
docs: lp855x-driver.txt: convert to ReST and move to kernel-api
docs: m68k: convert docs to ReST and rename to *.rst
docs: cma/debugfs.txt: convert docs to ReST and rename to *.rst
docs: console.txt: convert docs to ReST and rename to *.rst
docs: pti_intel_mid.txt: convert it to pti_intel_mid.rst
docs: early-userspace: convert docs to ReST and rename to *.rst
docs: driver-model: convert docs to ReST and rename to *.rst
docs: arm: convert docs to ReST and rename to *.rst
docs: memory-devices: convert ti-emif.txt to ReST
docs: xen-tpmfront.txt: convert it to .rst
docs: bus-devices: ti-gpmc.rst: convert it to ReST
docs: nvmem: convert docs to ReST and rename to *.rst
docs: phy: convert samsung-usb2.txt to ReST format
docs: rbtree.txt: fix Sphinx build warnings
docs: DMA-API-HOWTO.txt: fix an unmarked code block
docs: accounting: convert to ReST
docs: fmc: convert to ReST
docs: hid: convert to ReST
docs: ia64: convert to ReST
docs: leds: convert to ReST
docs: laptops: convert to ReST
docs: iio: convert to ReST
docs: namespaces: convert to ReST
docs: nfc: convert to ReST
docs: md: convert to ReST
docs: mtd: convert to ReST
docs: nvdimm: convert to ReST
docs: xtensa: convert to ReST
docs: mmc: convert to ReST
Documentation/ABI/testing/sysfs-block-device | 2 +-
.../ABI/testing/sysfs-platform-asus-laptop | 2 +-
Documentation/DMA-API-HOWTO.txt | 2 +-
.../{cgroupstats.txt => cgroupstats.rst} | 14 +-
...ay-accounting.txt => delay-accounting.rst} | 61 ++-
Documentation/accounting/index.rst | 14 +
Documentation/accounting/{psi.txt => psi.rst} | 40 +-
...kstats-struct.txt => taskstats-struct.rst} | 79 ++-
.../{taskstats.txt => taskstats.rst} | 15 +-
Documentation/admin-guide/cgroup-v2.rst | 6 +-
.../admin-guide/kernel-parameters.rst | 2 +-
.../admin-guide/kernel-parameters.txt | 2 +-
Documentation/arm/Marvell/README | 395 -------------
Documentation/arm/Netwinder | 78 ---
Documentation/arm/SA1100/FreeBird | 21 -
Documentation/arm/SA1100/empeg | 2 -
Documentation/arm/SA1100/serial_UART | 47 --
Documentation/arm/{README => arm.rst} | 50 +-
Documentation/arm/{Booting => booting.rst} | 71 ++-
...ance.txt => cluster-pm-race-avoidance.rst} | 177 +++---
.../arm/{firmware.txt => firmware.rst} | 14 +-
Documentation/arm/index.rst | 80 +++
.../arm/{Interrupts => interrupts.rst} | 86 +--
Documentation/arm/{IXP4xx => ixp4xx.rst} | 61 ++-
...nel_mode_neon.txt => kernel_mode_neon.rst} | 3 +
...er_helpers.txt => kernel_user_helpers.rst} | 79 +--
.../keystone/{knav-qmss.txt => knav-qmss.rst} | 6 +-
.../keystone/{Overview.txt => overview.rst} | 47 +-
Documentation/arm/marvel.rst | 488 +++++++++++++++++
.../arm/{mem_alignment => mem_alignment.rst} | 11 +-
Documentation/arm/{memory.txt => memory.rst} | 9 +-
.../arm/{Microchip/README => microchip.rst} | 63 ++-
Documentation/arm/netwinder.rst | 85 +++
Documentation/arm/nwfpe/index.rst | 11 +
.../nwfpe/{README.FPE => netwinder-fpe.rst} | 24 +-
Documentation/arm/nwfpe/{NOTES => notes.rst} | 3 +
Documentation/arm/nwfpe/{README => nwfpe.rst} | 10 +-
Documentation/arm/nwfpe/{TODO => todo.rst} | 47 +-
Documentation/arm/{OMAP/DSS => omap/dss.rst} | 112 ++--
Documentation/arm/omap/index.rst | 10 +
.../arm/{OMAP/README => omap/omap.rst} | 7 +
.../arm/{OMAP/omap_pm => omap/omap_pm.rst} | 55 +-
Documentation/arm/{Porting => porting.rst} | 14 +-
Documentation/arm/pxa/{mfp.txt => mfp.rst} | 106 ++--
.../{SA1100/ADSBitsy => sa1100/adsbitsy.rst} | 14 +-
.../{SA1100/Assabet => sa1100/assabet.rst} | 185 +++----
.../arm/{SA1100/Brutus => sa1100/brutus.rst} | 45 +-
.../arm/{SA1100/CERF => sa1100/cerf.rst} | 10 +-
Documentation/arm/sa1100/freebird.rst | 25 +
.../graphicsclient.rst} | 46 +-
.../graphicsmaster.rst} | 13 +-
.../HUW_WEBPANEL => sa1100/huw_webpanel.rst} | 8 +-
Documentation/arm/sa1100/index.rst | 23 +
.../arm/{SA1100/Itsy => sa1100/itsy.rst} | 14 +-
.../arm/{SA1100/LART => sa1100/lart.rst} | 3 +-
.../nanoEngine => sa1100/nanoengine.rst} | 6 +-
.../{SA1100/Pangolin => sa1100/pangolin.rst} | 10 +-
.../arm/{SA1100/PLEB => sa1100/pleb.rst} | 6 +-
Documentation/arm/sa1100/serial_uart.rst | 51 ++
.../arm/{SA1100/Tifon => sa1100/tifon.rst} | 4 +-
.../arm/{SA1100/Yopy => sa1100/yopy.rst} | 5 +-
.../cpufreq.rst} | 5 +-
.../eb2410itx.rst} | 5 +-
.../GPIO.txt => samsung-s3c24xx/gpio.rst} | 23 +-
.../H1940.txt => samsung-s3c24xx/h1940.rst} | 5 +-
Documentation/arm/samsung-s3c24xx/index.rst | 18 +
.../NAND.txt => samsung-s3c24xx/nand.rst} | 6 +-
.../overview.rst} | 21 +-
.../s3c2412.rst} | 5 +-
.../s3c2413.rst} | 7 +-
.../smdk2440.rst} | 5 +-
.../suspend.rst} | 20 +-
.../usb-host.rst} | 16 +-
.../bootloader-interface.rst} | 27 +-
.../clksrc-change-registers.awk | 0
.../{Samsung/GPIO.txt => samsung/gpio.rst} | 7 +-
Documentation/arm/samsung/index.rst | 10 +
.../Overview.txt => samsung/overview.rst} | 15 +-
Documentation/arm/{Setup => setup.rst} | 49 +-
.../arm/{SH-Mobile => sh-mobile}/.gitignore | 0
.../overview.txt => spear/overview.rst} | 20 +-
.../arm/sti/{overview.txt => overview.rst} | 21 +-
...h407-overview.txt => stih407-overview.rst} | 9 +-
...h415-overview.txt => stih415-overview.rst} | 8 +-
...h416-overview.txt => stih416-overview.rst} | 5 +-
...h418-overview.txt => stih418-overview.rst} | 9 +-
.../arm/stm32/stm32f429-overview.rst | 7 +-
.../arm/stm32/stm32f746-overview.rst | 7 +-
.../arm/stm32/stm32f769-overview.rst | 7 +-
.../arm/stm32/stm32h743-overview.rst | 7 +-
.../arm/stm32/stm32mp157-overview.rst | 3 +-
Documentation/arm/{sunxi/README => sunxi.rst} | 98 +++-
.../arm/sunxi/{clocks.txt => clocks.rst} | 7 +-
.../arm/{swp_emulation => swp_emulation.rst} | 24 +-
Documentation/arm/{tcm.txt => tcm.rst} | 54 +-
Documentation/arm/{uefi.txt => uefi.rst} | 39 +-
.../release-notes.rst} | 4 +-
Documentation/arm/{vlocks.txt => vlocks.rst} | 9 +-
...cd-panel-cgram.txt => lcd-panel-cgram.rst} | 9 +-
Documentation/backlight/lp855x-driver.rst | 83 +++
Documentation/backlight/lp855x-driver.txt | 66 ---
.../bus-devices/{ti-gpmc.txt => ti-gpmc.rst} | 159 ++++--
.../cma/{debugfs.txt => debugfs.rst} | 8 +-
.../{connector.txt => connector.rst} | 130 ++---
.../console/{console.txt => console.rst} | 63 ++-
Documentation/devicetree/bindings/arm/xen.txt | 2 +-
.../devicetree/booting-without-of.txt | 4 +-
Documentation/driver-api/gpio/driver.rst | 2 +-
.../driver-model/{binding.txt => binding.rst} | 20 +-
.../driver-model/{bus.txt => bus.rst} | 69 +--
.../driver-model/{class.txt => class.rst} | 74 +--
...esign-patterns.txt => design-patterns.rst} | 106 ++--
.../driver-model/{device.txt => device.rst} | 57 +-
.../driver-model/{devres.txt => devres.rst} | 50 +-
.../driver-model/{driver.txt => driver.rst} | 112 ++--
Documentation/driver-model/index.rst | 26 +
.../{overview.txt => overview.rst} | 37 +-
.../{platform.txt => platform.rst} | 30 +-
.../driver-model/{porting.txt => porting.rst} | 333 +++++------
.../{buffer-format.txt => buffer-format.rst} | 19 +-
.../{README => early_userspace_support.rst} | 3 +
Documentation/early-userspace/index.rst | 18 +
Documentation/eisa.txt | 4 +-
Documentation/fb/fbcon.rst | 4 +-
Documentation/filesystems/nfs/nfsroot.txt | 2 +-
.../filesystems/ramfs-rootfs-initramfs.txt | 4 +-
Documentation/fmc/{API.txt => api.rst} | 10 +-
.../fmc/{carrier.txt => carrier.rst} | 65 +--
.../fmc/{FMC-and-SDB.txt => fmc-and-sdb.rst} | 19 +-
.../fmc/{fmc-chardev.txt => fmc-chardev.rst} | 9 +-
.../fmc/{fmc-fakedev.txt => fmc-fakedev.rst} | 13 +-
.../fmc/{fmc-trivial.txt => fmc-trivial.rst} | 11 +-
...-write-eeprom.txt => fmc-write-eeprom.rst} | 36 +-
.../fmc/{identifiers.txt => identifiers.rst} | 20 +-
Documentation/fmc/index.rst | 21 +
.../fmc/{mezzanine.txt => mezzanine.rst} | 34 +-
.../fmc/{parameters.txt => parameters.rst} | 11 +-
.../hid/{hid-alps.txt => hid-alps.rst} | 85 ++-
.../hid/{hid-sensor.txt => hid-sensor.rst} | 192 ++++---
.../{hid-transport.txt => hid-transport.rst} | 82 ++-
Documentation/hid/{hiddev.txt => hiddev.rst} | 154 ++++--
Documentation/hid/{hidraw.txt => hidraw.rst} | 53 +-
Documentation/hid/index.rst | 18 +
Documentation/hid/intel-ish-hid.rst | 485 ++++++++++++++++
Documentation/hid/intel-ish-hid.txt | 454 ---------------
Documentation/hid/{uhid.txt => uhid.rst} | 46 +-
Documentation/hwmon/submitting-patches.rst | 2 +-
.../ia64/{aliasing.txt => aliasing.rst} | 73 ++-
Documentation/ia64/{efirtc.txt => efirtc.rst} | 118 ++--
.../ia64/{err_inject.txt => err_inject.rst} | 349 ++++++------
Documentation/ia64/{fsys.txt => fsys.rst} | 127 +++--
Documentation/ia64/{README => ia64.rst} | 26 +-
Documentation/ia64/index.rst | 18 +
.../ia64/{IRQ-redir.txt => irq-redir.rst} | 31 +-
Documentation/ia64/{mca.txt => mca.rst} | 10 +-
Documentation/ia64/{serial.txt => serial.rst} | 36 +-
Documentation/ia64/xen.rst | 206 +++++++
Documentation/ia64/xen.txt | 183 -------
.../iio/{ep93xx_adc.txt => ep93xx_adc.rst} | 15 +-
.../{iio_configfs.txt => iio_configfs.rst} | 52 +-
Documentation/iio/index.rst | 12 +
Documentation/index.rst | 1 +
Documentation/input/input.rst | 2 +-
.../{asus-laptop.txt => asus-laptop.rst} | 92 ++--
...otection.txt => disk-shock-protection.rst} | 32 +-
Documentation/laptops/index.rst | 17 +
.../{laptop-mode.txt => laptop-mode.rst} | 509 +++++++++--------
.../{sony-laptop.txt => sony-laptop.rst} | 58 +-
.../laptops/{sonypi.txt => sonypi.rst} | 28 +-
.../{thinkpad-acpi.txt => thinkpad-acpi.rst} | 367 ++++++++-----
.../{toshiba_haps.txt => toshiba_haps.rst} | 47 +-
Documentation/leds/index.rst | 25 +
.../leds/{leds-blinkm.txt => leds-blinkm.rst} | 64 ++-
...s-class-flash.txt => leds-class-flash.rst} | 49 +-
.../leds/{leds-class.txt => leds-class.rst} | 15 +-
.../leds/{leds-lm3556.txt => leds-lm3556.rst} | 100 +++-
.../leds/{leds-lp3944.txt => leds-lp3944.rst} | 23 +-
Documentation/leds/leds-lp5521.rst | 115 ++++
Documentation/leds/leds-lp5521.txt | 101 ----
Documentation/leds/leds-lp5523.rst | 147 +++++
Documentation/leds/leds-lp5523.txt | 130 -----
Documentation/leds/leds-lp5562.rst | 137 +++++
Documentation/leds/leds-lp5562.txt | 120 ----
Documentation/leds/leds-lp55xx.rst | 224 ++++++++
Documentation/leds/leds-lp55xx.txt | 194 -------
Documentation/leds/leds-mlxcpld.rst | 118 ++++
Documentation/leds/leds-mlxcpld.txt | 110 ----
...edtrig-oneshot.txt => ledtrig-oneshot.rst} | 11 +-
...ig-transient.txt => ledtrig-transient.rst} | 63 ++-
...edtrig-usbport.txt => ledtrig-usbport.rst} | 11 +-
Documentation/leds/{uleds.txt => uleds.rst} | 5 +-
Documentation/m68k/index.rst | 17 +
...{kernel-options.txt => kernel-options.rst} | 319 ++++++-----
Documentation/md/index.rst | 12 +
.../md/{md-cluster.txt => md-cluster.rst} | 188 ++++---
.../md/{raid5-cache.txt => raid5-cache.rst} | 28 +-
.../md/{raid5-ppl.txt => raid5-ppl.rst} | 2 +
.../{ti-emif.txt => ti-emif.rst} | 27 +-
Documentation/mmc/index.rst | 13 +
.../{mmc-async-req.txt => mmc-async-req.rst} | 53 +-
.../{mmc-dev-attrs.txt => mmc-dev-attrs.rst} | 32 +-
.../{mmc-dev-parts.txt => mmc-dev-parts.rst} | 13 +-
.../mmc/{mmc-tools.txt => mmc-tools.rst} | 5 +-
Documentation/mtd/index.rst | 12 +
.../mtd/{intel-spi.txt => intel-spi.rst} | 46 +-
.../mtd/{nand_ecc.txt => nand_ecc.rst} | 481 ++++++++--------
.../mtd/{spi-nor.txt => spi-nor.rst} | 7 +-
...bility-list.txt => compatibility-list.rst} | 10 +-
Documentation/namespaces/index.rst | 11 +
...ource-control.txt => resource-control.rst} | 4 +
Documentation/nfc/index.rst | 11 +
.../nfc/{nfc-hci.txt => nfc-hci.rst} | 163 +++---
.../nfc/{nfc-pn544.txt => nfc-pn544.rst} | 6 +-
Documentation/nvdimm/{btt.txt => btt.rst} | 140 ++---
Documentation/nvdimm/index.rst | 12 +
.../nvdimm/{nvdimm.txt => nvdimm.rst} | 518 ++++++++++--------
.../nvdimm/{security.txt => security.rst} | 4 +-
Documentation/nvmem/{nvmem.txt => nvmem.rst} | 112 ++--
.../{samsung-usb2.txt => samsung-usb2.rst} | 62 ++-
Documentation/pti/pti_intel_mid.rst | 106 ++++
Documentation/pti/pti_intel_mid.txt | 99 ----
Documentation/rbtree.txt | 6 +-
.../{xen-tpmfront.txt => xen-tpmfront.rst} | 103 ++--
Documentation/sysctl/vm.txt | 4 +-
Documentation/translations/zh_CN/arm/Booting | 4 +-
.../zh_CN/arm/kernel_user_helpers.txt | 4 +-
.../xtensa/{atomctl.txt => atomctl.rst} | 13 +-
.../xtensa/{booting.txt => booting.rst} | 5 +-
Documentation/xtensa/index.rst | 12 +
Documentation/xtensa/mmu.rst | 195 +++++++
Documentation/xtensa/mmu.txt | 189 -------
MAINTAINERS | 18 +-
arch/arm/Kconfig | 2 +-
arch/arm/common/mcpm_entry.c | 2 +-
arch/arm/common/mcpm_head.S | 2 +-
arch/arm/common/vlock.S | 2 +-
arch/arm/include/asm/setup.h | 2 +-
arch/arm/include/uapi/asm/setup.h | 2 +-
arch/arm/kernel/entry-armv.S | 2 +-
arch/arm/mach-exynos/common.h | 2 +-
arch/arm/mach-ixp4xx/Kconfig | 14 +-
arch/arm/mach-s3c24xx/pm.c | 2 +-
arch/arm/mm/Kconfig | 4 +-
arch/arm/plat-samsung/Kconfig | 6 +-
arch/arm/tools/mach-types | 2 +-
arch/arm64/Kconfig | 2 +-
arch/arm64/kernel/kuser32.S | 2 +-
arch/ia64/kernel/efi.c | 2 +-
arch/ia64/kernel/fsys.S | 2 +-
arch/ia64/mm/ioremap.c | 2 +-
arch/ia64/pci/pci.c | 2 +-
arch/mips/bmips/setup.c | 2 +-
arch/xtensa/include/asm/initialize_mmu.h | 2 +-
drivers/base/platform.c | 2 +-
drivers/char/Kconfig | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-core.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss.h | 2 +-
drivers/gpio/gpio-cs5535.c | 2 +-
drivers/iio/Kconfig | 2 +-
drivers/input/touchscreen/sun4i-ts.c | 2 +-
drivers/leds/trigger/Kconfig | 2 +-
drivers/leds/trigger/ledtrig-transient.c | 2 +-
drivers/mtd/nand/raw/nand_ecc.c | 2 +-
drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
drivers/nvdimm/Kconfig | 2 +-
drivers/platform/x86/Kconfig | 4 +-
drivers/tty/Kconfig | 2 +-
drivers/tty/serial/Kconfig | 2 +-
drivers/w1/Kconfig | 2 +-
include/linux/connector.h | 63 ++-
init/Kconfig | 2 +-
net/netfilter/Kconfig | 2 +-
samples/Kconfig | 2 +-
scripts/coccinelle/free/devm_free.cocci | 2 +-
usr/Kconfig | 2 +-
277 files changed, 8166 insertions(+), 6117 deletions(-)
rename Documentation/accounting/{cgroupstats.txt => cgroupstats.rst} (77%)
rename Documentation/accounting/{delay-accounting.txt => delay-accounting.rst} (77%)
create mode 100644 Documentation/accounting/index.rst
rename Documentation/accounting/{psi.txt => psi.rst} (91%)
rename Documentation/accounting/{taskstats-struct.txt => taskstats-struct.rst} (78%)
rename Documentation/accounting/{taskstats.txt => taskstats.rst} (95%)
delete mode 100644 Documentation/arm/Marvell/README
delete mode 100644 Documentation/arm/Netwinder
delete mode 100644 Documentation/arm/SA1100/FreeBird
delete mode 100644 Documentation/arm/SA1100/empeg
delete mode 100644 Documentation/arm/SA1100/serial_UART
rename Documentation/arm/{README => arm.rst} (88%)
rename Documentation/arm/{Booting => booting.rst} (89%)
rename Documentation/arm/{cluster-pm-race-avoidance.txt => cluster-pm-race-avoidance.rst} (84%)
rename Documentation/arm/{firmware.txt => firmware.rst} (86%)
create mode 100644 Documentation/arm/index.rst
rename Documentation/arm/{Interrupts => interrupts.rst} (81%)
rename Documentation/arm/{IXP4xx => ixp4xx.rst} (84%)
rename Documentation/arm/{kernel_mode_neon.txt => kernel_mode_neon.rst} (99%)
rename Documentation/arm/{kernel_user_helpers.txt => kernel_user_helpers.rst} (78%)
rename Documentation/arm/keystone/{knav-qmss.txt => knav-qmss.rst} (92%)
rename Documentation/arm/keystone/{Overview.txt => overview.rst} (59%)
create mode 100644 Documentation/arm/marvel.rst
rename Documentation/arm/{mem_alignment => mem_alignment.rst} (89%)
rename Documentation/arm/{memory.txt => memory.rst} (90%)
rename Documentation/arm/{Microchip/README => microchip.rst} (92%)
create mode 100644 Documentation/arm/netwinder.rst
create mode 100644 Documentation/arm/nwfpe/index.rst
rename Documentation/arm/nwfpe/{README.FPE => netwinder-fpe.rst} (94%)
rename Documentation/arm/nwfpe/{NOTES => notes.rst} (99%)
rename Documentation/arm/nwfpe/{README => nwfpe.rst} (98%)
rename Documentation/arm/nwfpe/{TODO => todo.rst} (75%)
rename Documentation/arm/{OMAP/DSS => omap/dss.rst} (86%)
create mode 100644 Documentation/arm/omap/index.rst
rename Documentation/arm/{OMAP/README => omap/omap.rst} (62%)
rename Documentation/arm/{OMAP/omap_pm => omap/omap_pm.rst} (83%)
rename Documentation/arm/{Porting => porting.rst} (94%)
rename Documentation/arm/pxa/{mfp.txt => mfp.rst} (83%)
rename Documentation/arm/{SA1100/ADSBitsy => sa1100/adsbitsy.rst} (90%)
rename Documentation/arm/{SA1100/Assabet => sa1100/assabet.rst} (62%)
rename Documentation/arm/{SA1100/Brutus => sa1100/brutus.rst} (75%)
rename Documentation/arm/{SA1100/CERF => sa1100/cerf.rst} (91%)
create mode 100644 Documentation/arm/sa1100/freebird.rst
rename Documentation/arm/{SA1100/GraphicsClient => sa1100/graphicsclient.rst} (87%)
rename Documentation/arm/{SA1100/GraphicsMaster => sa1100/graphicsmaster.rst} (92%)
rename Documentation/arm/{SA1100/HUW_WEBPANEL => sa1100/huw_webpanel.rst} (78%)
create mode 100644 Documentation/arm/sa1100/index.rst
rename Documentation/arm/{SA1100/Itsy => sa1100/itsy.rst} (88%)
rename Documentation/arm/{SA1100/LART => sa1100/lart.rst} (90%)
rename Documentation/arm/{SA1100/nanoEngine => sa1100/nanoengine.rst} (74%)
rename Documentation/arm/{SA1100/Pangolin => sa1100/pangolin.rst} (81%)
rename Documentation/arm/{SA1100/PLEB => sa1100/pleb.rst} (95%)
create mode 100644 Documentation/arm/sa1100/serial_uart.rst
rename Documentation/arm/{SA1100/Tifon => sa1100/tifon.rst} (88%)
rename Documentation/arm/{SA1100/Yopy => sa1100/yopy.rst} (74%)
rename Documentation/arm/{Samsung-S3C24XX/CPUfreq.txt => samsung-s3c24xx/cpufreq.rst} (96%)
rename Documentation/arm/{Samsung-S3C24XX/EB2410ITX.txt => samsung-s3c24xx/eb2410itx.rst} (92%)
rename Documentation/arm/{Samsung-S3C24XX/GPIO.txt => samsung-s3c24xx/gpio.rst} (89%)
rename Documentation/arm/{Samsung-S3C24XX/H1940.txt => samsung-s3c24xx/h1940.rst} (94%)
create mode 100644 Documentation/arm/samsung-s3c24xx/index.rst
rename Documentation/arm/{Samsung-S3C24XX/NAND.txt => samsung-s3c24xx/nand.rst} (92%)
rename Documentation/arm/{Samsung-S3C24XX/Overview.txt => samsung-s3c24xx/overview.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/S3C2412.txt => samsung-s3c24xx/s3c2412.rst} (96%)
rename Documentation/arm/{Samsung-S3C24XX/S3C2413.txt => samsung-s3c24xx/s3c2413.rst} (77%)
rename Documentation/arm/{Samsung-S3C24XX/SMDK2440.txt => samsung-s3c24xx/smdk2440.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/Suspend.txt => samsung-s3c24xx/suspend.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/USB-Host.txt => samsung-s3c24xx/usb-host.rst} (94%)
rename Documentation/arm/{Samsung/Bootloader-interface.txt => samsung/bootloader-interface.rst} (72%)
rename Documentation/arm/{Samsung => samsung}/clksrc-change-registers.awk (100%)
rename Documentation/arm/{Samsung/GPIO.txt => samsung/gpio.rst} (87%)
create mode 100644 Documentation/arm/samsung/index.rst
rename Documentation/arm/{Samsung/Overview.txt => samsung/overview.rst} (86%)
rename Documentation/arm/{Setup => setup.rst} (87%)
rename Documentation/arm/{SH-Mobile => sh-mobile}/.gitignore (100%)
rename Documentation/arm/{SPEAr/overview.txt => spear/overview.rst} (91%)
rename Documentation/arm/sti/{overview.txt => overview.rst} (82%)
rename Documentation/arm/sti/{stih407-overview.txt => stih407-overview.rst} (82%)
rename Documentation/arm/sti/{stih415-overview.txt => stih415-overview.rst} (79%)
rename Documentation/arm/sti/{stih416-overview.txt => stih416-overview.rst} (83%)
rename Documentation/arm/sti/{stih418-overview.txt => stih418-overview.rst} (83%)
rename Documentation/arm/{sunxi/README => sunxi.rst} (83%)
rename Documentation/arm/sunxi/{clocks.txt => clocks.rst} (92%)
rename Documentation/arm/{swp_emulation => swp_emulation.rst} (63%)
rename Documentation/arm/{tcm.txt => tcm.rst} (86%)
rename Documentation/arm/{uefi.txt => uefi.rst} (63%)
rename Documentation/arm/{VFP/release-notes.txt => vfp/release-notes.rst} (92%)
rename Documentation/arm/{vlocks.txt => vlocks.rst} (98%)
rename Documentation/auxdisplay/{lcd-panel-cgram.txt => lcd-panel-cgram.rst} (88%)
create mode 100644 Documentation/backlight/lp855x-driver.rst
delete mode 100644 Documentation/backlight/lp855x-driver.txt
rename Documentation/bus-devices/{ti-gpmc.txt => ti-gpmc.rst} (58%)
rename Documentation/cma/{debugfs.txt => debugfs.rst} (91%)
rename Documentation/connector/{connector.txt => connector.rst} (57%)
rename Documentation/console/{console.txt => console.rst} (80%)
rename Documentation/driver-model/{binding.txt => binding.rst} (92%)
rename Documentation/driver-model/{bus.txt => bus.rst} (76%)
rename Documentation/driver-model/{class.txt => class.rst} (75%)
rename Documentation/driver-model/{design-patterns.txt => design-patterns.rst} (59%)
rename Documentation/driver-model/{device.txt => device.rst} (71%)
rename Documentation/driver-model/{devres.txt => devres.rst} (93%)
rename Documentation/driver-model/{driver.txt => driver.rst} (75%)
create mode 100644 Documentation/driver-model/index.rst
rename Documentation/driver-model/{overview.txt => overview.rst} (90%)
rename Documentation/driver-model/{platform.txt => platform.rst} (95%)
rename Documentation/driver-model/{porting.txt => porting.rst} (62%)
rename Documentation/early-userspace/{buffer-format.txt => buffer-format.rst} (91%)
rename Documentation/early-userspace/{README => early_userspace_support.rst} (99%)
create mode 100644 Documentation/early-userspace/index.rst
rename Documentation/fmc/{API.txt => api.rst} (87%)
rename Documentation/fmc/{carrier.txt => carrier.rst} (91%)
rename Documentation/fmc/{FMC-and-SDB.txt => fmc-and-sdb.rst} (88%)
rename Documentation/fmc/{fmc-chardev.txt => fmc-chardev.rst} (96%)
rename Documentation/fmc/{fmc-fakedev.txt => fmc-fakedev.rst} (85%)
rename Documentation/fmc/{fmc-trivial.txt => fmc-trivial.rst} (69%)
rename Documentation/fmc/{fmc-write-eeprom.txt => fmc-write-eeprom.rst} (79%)
rename Documentation/fmc/{identifiers.txt => identifiers.rst} (93%)
create mode 100644 Documentation/fmc/index.rst
rename Documentation/fmc/{mezzanine.txt => mezzanine.rst} (87%)
rename Documentation/fmc/{parameters.txt => parameters.rst} (96%)
rename Documentation/hid/{hid-alps.txt => hid-alps.rst} (64%)
rename Documentation/hid/{hid-sensor.txt => hid-sensor.rst} (61%)
rename Documentation/hid/{hid-transport.txt => hid-transport.rst} (93%)
rename Documentation/hid/{hiddev.txt => hiddev.rst} (77%)
rename Documentation/hid/{hidraw.txt => hidraw.rst} (89%)
create mode 100644 Documentation/hid/index.rst
create mode 100644 Documentation/hid/intel-ish-hid.rst
delete mode 100644 Documentation/hid/intel-ish-hid.txt
rename Documentation/hid/{uhid.txt => uhid.rst} (94%)
rename Documentation/ia64/{aliasing.txt => aliasing.rst} (83%)
rename Documentation/ia64/{efirtc.txt => efirtc.rst} (70%)
rename Documentation/ia64/{err_inject.txt => err_inject.rst} (82%)
rename Documentation/ia64/{fsys.txt => fsys.rst} (76%)
rename Documentation/ia64/{README => ia64.rst} (61%)
create mode 100644 Documentation/ia64/index.rst
rename Documentation/ia64/{IRQ-redir.txt => irq-redir.rst} (86%)
rename Documentation/ia64/{mca.txt => mca.rst} (96%)
rename Documentation/ia64/{serial.txt => serial.rst} (87%)
create mode 100644 Documentation/ia64/xen.rst
delete mode 100644 Documentation/ia64/xen.txt
rename Documentation/iio/{ep93xx_adc.txt => ep93xx_adc.rst} (71%)
rename Documentation/iio/{iio_configfs.txt => iio_configfs.rst} (73%)
create mode 100644 Documentation/iio/index.rst
rename Documentation/laptops/{asus-laptop.txt => asus-laptop.rst} (84%)
rename Documentation/laptops/{disk-shock-protection.txt => disk-shock-protection.rst} (91%)
create mode 100644 Documentation/laptops/index.rst
rename Documentation/laptops/{laptop-mode.txt => laptop-mode.rst} (62%)
rename Documentation/laptops/{sony-laptop.txt => sony-laptop.rst} (85%)
rename Documentation/laptops/{sonypi.txt => sonypi.rst} (87%)
rename Documentation/laptops/{thinkpad-acpi.txt => thinkpad-acpi.rst} (89%)
rename Documentation/laptops/{toshiba_haps.txt => toshiba_haps.rst} (60%)
create mode 100644 Documentation/leds/index.rst
rename Documentation/leds/{leds-blinkm.txt => leds-blinkm.rst} (57%)
rename Documentation/leds/{leds-class-flash.txt => leds-class-flash.rst} (74%)
rename Documentation/leds/{leds-class.txt => leds-class.rst} (92%)
rename Documentation/leds/{leds-lm3556.txt => leds-lm3556.rst} (70%)
rename Documentation/leds/{leds-lp3944.txt => leds-lp3944.rst} (78%)
create mode 100644 Documentation/leds/leds-lp5521.rst
delete mode 100644 Documentation/leds/leds-lp5521.txt
create mode 100644 Documentation/leds/leds-lp5523.rst
delete mode 100644 Documentation/leds/leds-lp5523.txt
create mode 100644 Documentation/leds/leds-lp5562.rst
delete mode 100644 Documentation/leds/leds-lp5562.txt
create mode 100644 Documentation/leds/leds-lp55xx.rst
delete mode 100644 Documentation/leds/leds-lp55xx.txt
create mode 100644 Documentation/leds/leds-mlxcpld.rst
delete mode 100644 Documentation/leds/leds-mlxcpld.txt
rename Documentation/leds/{ledtrig-oneshot.txt => ledtrig-oneshot.rst} (90%)
rename Documentation/leds/{ledtrig-transient.txt => ledtrig-transient.rst} (81%)
rename Documentation/leds/{ledtrig-usbport.txt => ledtrig-usbport.rst} (86%)
rename Documentation/leds/{uleds.txt => uleds.rst} (95%)
create mode 100644 Documentation/m68k/index.rst
rename Documentation/m68k/{kernel-options.txt => kernel-options.rst} (78%)
create mode 100644 Documentation/md/index.rst
rename Documentation/md/{md-cluster.txt => md-cluster.rst} (68%)
rename Documentation/md/{raid5-cache.txt => raid5-cache.rst} (92%)
rename Documentation/md/{raid5-ppl.txt => raid5-ppl.rst} (98%)
rename Documentation/memory-devices/{ti-emif.txt => ti-emif.rst} (81%)
create mode 100644 Documentation/mmc/index.rst
rename Documentation/mmc/{mmc-async-req.txt => mmc-async-req.rst} (75%)
rename Documentation/mmc/{mmc-dev-attrs.txt => mmc-dev-attrs.rst} (73%)
rename Documentation/mmc/{mmc-dev-parts.txt => mmc-dev-parts.rst} (83%)
rename Documentation/mmc/{mmc-tools.txt => mmc-tools.rst} (92%)
create mode 100644 Documentation/mtd/index.rst
rename Documentation/mtd/{intel-spi.txt => intel-spi.rst} (71%)
rename Documentation/mtd/{nand_ecc.txt => nand_ecc.rst} (67%)
rename Documentation/mtd/{spi-nor.txt => spi-nor.rst} (94%)
rename Documentation/namespaces/{compatibility-list.txt => compatibility-list.rst} (86%)
create mode 100644 Documentation/namespaces/index.rst
rename Documentation/namespaces/{resource-control.txt => resource-control.rst} (89%)
create mode 100644 Documentation/nfc/index.rst
rename Documentation/nfc/{nfc-hci.txt => nfc-hci.rst} (71%)
rename Documentation/nfc/{nfc-pn544.txt => nfc-pn544.rst} (82%)
rename Documentation/nvdimm/{btt.txt => btt.rst} (71%)
create mode 100644 Documentation/nvdimm/index.rst
rename Documentation/nvdimm/{nvdimm.txt => nvdimm.rst} (60%)
rename Documentation/nvdimm/{security.txt => security.rst} (99%)
rename Documentation/nvmem/{nvmem.txt => nvmem.rst} (62%)
rename Documentation/phy/{samsung-usb2.txt => samsung-usb2.rst} (77%)
create mode 100644 Documentation/pti/pti_intel_mid.rst
delete mode 100644 Documentation/pti/pti_intel_mid.txt
rename Documentation/security/tpm/{xen-tpmfront.txt => xen-tpmfront.rst} (66%)
rename Documentation/xtensa/{atomctl.txt => atomctl.rst} (81%)
rename Documentation/xtensa/{booting.txt => booting.rst} (91%)
create mode 100644 Documentation/xtensa/index.rst
create mode 100644 Documentation/xtensa/mmu.rst
delete mode 100644 Documentation/xtensa/mmu.txtSignature · 1 line
2.21.0
PATCH 1/31 docs: connector: convert to ReST and rename to connector.rst
As it has some function definitions, move them to connector.h.
The remaining conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../{connector.txt => connector.rst} | 130 ++++++------------
drivers/w1/Kconfig | 2 +-
include/linux/connector.h | 63 ++++++++-
samples/Kconfig | 2 +-
4 files changed, 109 insertions(+), 88 deletions(-)
rename Documentation/connector/{connector.txt => connector.rst} (57%)Documentation/connector/connector.rst renamed from Documentation/connector/connector.txt +45 -85
@@ -1,6 +1,8 @@ -/*****************************************/ -Kernel Connector. -/*****************************************/ +:orphan: + +================ +Kernel Connector +================ Kernel connector - new netlink based userspace <-> kernel space easy to use communication module.
@@ -12,94 +14,55 @@ identifier, the appropriate callback will be called. From the userspace point of view it's quite straightforward: - socket(); - bind(); - send(); - recv(); + - socket(); + - bind(); + - send(); + - recv(); But if kernelspace wants to use the full power of such connections, the driver writer must create special sockets, must know about struct sk_buff handling, etc... The Connector driver allows any kernelspace agents to use netlink based networking for inter-process communication in a significantly -easier way: +easier way:: -int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); -void cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __group, int gfp_mask); -void cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, int gfp_mask); + int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); + void cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __group, int gfp_mask); + void cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, int gfp_mask); -struct cb_id -{ + struct cb_id + { __u32 idx; __u32 val; -}; + }; idx and val are unique identifiers which must be registered in the -connector.h header for in-kernel usage. void (*callback) (void *) is a +connector.h header for in-kernel usage. `void (*callback) (void *)` is a callback function which will be called when a message with above idx.val is received by the connector core. The argument for that function must -be dereferenced to struct cn_msg *. +be dereferenced to `struct cn_msg *`:: -struct cn_msg -{ + struct cn_msg + { struct cb_id id; __u32 seq; __u32 ack; - __u32 len; /* Length of the following data */ + __u32 len; /* Length of the following data */ __u8 data[0]; -}; + }; -/*****************************************/ -Connector interfaces. -/*****************************************/ +Connector interfaces +==================== -int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); + .. kernel-doc:: include/linux/connector.h - Registers new callback with connector core. + Note: + When registering new callback user, connector core assigns + netlink group to the user which is equal to its id.idx. - struct cb_id *id - unique connector's user identifier. - It must be registered in connector.h for legal in-kernel users. - char *name - connector's callback symbolic name. - void (*callback) (struct cn..) - connector's callback. - cn_msg and the sender's credentials - - -void cn_del_callback(struct cb_id *id); - - Unregisters new callback with connector core. - - struct cb_id *id - unique connector's user identifier. - - -int cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __groups, int gfp_mask); -int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __groups, int gfp_mask); - - Sends message to the specified groups. It can be safely called from - softirq context, but may silently fail under strong memory pressure. - If there are no listeners for given group -ESRCH can be returned. - - struct cn_msg * - message header(with attached data). - u16 len - for *_multi multiple cn_msg messages can be sent - u32 port - destination port. - If non-zero the message will be sent to the - given port, which should be set to the - original sender. - u32 __group - destination group. - If port and __group is zero, then appropriate group will - be searched through all registered connector users, - and message will be delivered to the group which was - created for user with the same ID as in msg. - If __group is not zero, then message will be delivered - to the specified group. - int gfp_mask - GFP mask. - - Note: When registering new callback user, connector core assigns - netlink group to the user which is equal to its id.idx. - -/*****************************************/ -Protocol description. -/*****************************************/ +Protocol description +==================== The current framework offers a transport layer with fixed headers. The recommended protocol which uses such a header is as following:
@@ -132,9 +95,8 @@ driver (it also registers itself with id={-1, -1}). As example of this usage can be found in the cn_test.c module which uses the connector to request notification and to send messages. -/*****************************************/ -Reliability. -/*****************************************/ +Reliability +=========== Netlink itself is not a reliable protocol. That means that messages can be lost due to memory pressure or process' receiving queue overflowed,
@@ -142,32 +104,31 @@ so caller is warned that it must be prepared. That is why the struct cn_msg [main connector's message header] contains u32 seq and u32 ack fields. -/*****************************************/ -Userspace usage. -/*****************************************/ +Userspace usage +=============== 2.6.14 has a new netlink socket implementation, which by default does not allow people to send data to netlink groups other than 1. So, if you wish to use a netlink socket (for example using connector) with a different group number, the userspace application must subscribe to -that group first. It can be achieved by the following pseudocode: +that group first. It can be achieved by the following pseudocode:: -s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); + s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); -l_local.nl_family = AF_NETLINK; -l_local.nl_groups = 12345; -l_local.nl_pid = 0; + l_local.nl_family = AF_NETLINK; + l_local.nl_groups = 12345; + l_local.nl_pid = 0; -if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) { + if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) { perror("bind"); close(s); return -1; -} + } -{ + { int on = l_local.nl_groups; setsockopt(s, 270, 1, &on, sizeof(on)); -} + } Where 270 above is SOL_NETLINK, and 1 is a NETLINK_ADD_MEMBERSHIP socket option. To drop a multicast subscription, one should call the above socket
@@ -180,16 +141,15 @@ group number 12345, you must increment CN_NETLINK_USERS to that number. Additional 0xf numbers are allocated to be used by non-in-kernel users. Due to this limitation, group 0xffffffff does not work now, so one can -not use add/remove connector's group notifications, but as far as I know, +not use add/remove connector's group notifications, but as far as I know, only cn_test.c test module used it. Some work in netlink area is still being done, so things can be changed in 2.6.15 timeframe, if it will happen, documentation will be updated for that kernel. -/*****************************************/ Code samples -/*****************************************/ +============ Sample code for a connector test module and user space can be found in samples/connector/. To build this code, enable CONFIG_CONNECTOR
drivers/w1/Kconfig +1 -1
@@ -19,7 +19,7 @@ config W1_CON default y ---help--- This allows to communicate with userspace using connector. For more - information see <file:Documentation/connector/connector.txt>. + information see <file:Documentation/connector/connector.rst>. There are three types of messages between w1 core and userspace: 1. Events. They are generated each time new master or slave device found either due to automatic or requested search.
include/linux/connector.h +62 -1
72 lines not on this page · raw message
samples/Kconfig +1 -1
@@ -100,7 +100,7 @@ config SAMPLE_CONNECTOR When enabled, this builds both a sample kernel module for the connector interface and a user space tool to communicate with it. - See also Documentation/connector/connector.txt + See also Documentation/connector/connector.rst config SAMPLE_SECCOMP bool "Build seccomp sample code"
Signature · 1 line
2.21.0
PATCH 2/31 docs: lcd-panel-cgram.txt: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabThis small text file describes the usage of parallel port LCD displays from userspace PoV. So, a good candidate for the admin guide.
While this is not part of the admin-guide book, mark it as :orphan:, in order to avoid build warnings.
---
.../{lcd-panel-cgram.txt => lcd-panel-cgram.rst} | 9 +++++++--
MAINTAINERS | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
rename Documentation/auxdisplay/{lcd-panel-cgram.txt => lcd-panel-cgram.rst} (88%)Documentation/auxdisplay/lcd-panel-cgram.rst renamed from Documentation/auxdisplay/lcd-panel-cgram.txt +7 -2
@@ -1,3 +1,9 @@ +:orphan: + +====================================== +Parallel port LCD/Keypad Panel support +====================================== + Some LCDs allow you to define up to 8 characters, mapped to ASCII characters 0 to 7. The escape code to define a new character is '\e[LG' followed by one digit from 0 to 7, representing the character
@@ -7,7 +13,7 @@ illuminated pixel with LSB on the right. Lines are numbered from the top of the character to the bottom. On a 5x7 matrix, only the 5 lower bits of the 7 first bytes are used for each character. If the string is incomplete, only complete lines will be redefined. Here are some -examples : +examples:: printf "\e[LG0010101050D1F0C04;" => 0 = [enter] printf "\e[LG1040E1F0000000000;" => 1 = [up]
@@ -21,4 +27,3 @@ examples : printf "\e[LG00002061E1E060200;" => small speaker Willy -
MAINTAINERS +1 -1
@@ -11932,7 +11932,7 @@ PARALLEL LCD/KEYPAD PANEL DRIVER M: Willy Tarreau <[email protected]> M: Ksenija Stanojevic <[email protected]> S: Odd Fixes -F: Documentation/auxdisplay/lcd-panel-cgram.txt +F: Documentation/auxdisplay/lcd-panel-cgram.rst F: drivers/auxdisplay/panel.c PARALLEL PORT SUBSYSTEM
Signature · 1 line
2.21.0
PATCH 3/31 docs: lp855x-driver.txt: convert to ReST and move to kernel-api
In reply to Mauro Carvalho ChehabThis small file seems to be an attempt to start documenting backlight drivers.
It contains descriptions of the controls for the driver with could sound as an somewhat user-faced description, but it's main focus is to describe, instead, the data that should be passed via platform data and some driver-specific stuff.
While this is not part of the driver-api book, mark it as :orphan:, in order to avoid build warnings.
--- Documentation/backlight/lp855x-driver.rst | 83 +++++++++++++++++++++++ Documentation/backlight/lp855x-driver.txt | 66 ------------------ MAINTAINERS | 2 +- 3 files changed, 84 insertions(+), 67 deletions(-) create mode 100644 Documentation/backlight/lp855x-driver.rst delete mode 100644 Documentation/backlight/lp855x-driver.txt
Documentation/backlight/lp855x-driver.rst new file +83 -0
@@ -0,0 +1,83 @@ +:orphan: + +==================== +Kernel driver lp855x +==================== + +Backlight driver for LP855x ICs + +Supported chips: + + Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and + LP8557 + +Author: Milo(Woogyom) Kim <[email protected]> + +Description +----------- + +* Brightness control + + Brightness can be controlled by the pwm input or the i2c command. + The lp855x driver supports both cases. + +* Device attributes + + 1) bl_ctl_mode + + Backlight control mode. + + Value: pwm based or register based + + 2) chip_id + + The lp855x chip id. + + Value: lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557 + +Platform data for lp855x +------------------------ + +For supporting platform specific data, the lp855x platform data can be used. + +* name: + Backlight driver name. If it is not defined, default name is set. +* device_control: + Value of DEVICE CONTROL register. +* initial_brightness: + Initial value of backlight brightness. +* period_ns: + Platform specific PWM period value. unit is nano. + Only valid when brightness is pwm input mode. +* size_program: + Total size of lp855x_rom_data. +* rom_data: + List of new eeprom/eprom registers. + +Examples +======== + +1) lp8552 platform data: i2c register mode with new eeprom data:: + + #define EEPROM_A5_ADDR 0xA5 + #define EEPROM_A5_VAL 0x4f /* EN_VSYNC=0 */ + + static struct lp855x_rom_data lp8552_eeprom_arr[] = { + {EEPROM_A5_ADDR, EEPROM_A5_VAL}, + }; + + static struct lp855x_platform_data lp8552_pdata = { + .name = "lcd-bl", + .device_control = I2C_CONFIG(LP8552), + .initial_brightness = INITIAL_BRT, + .size_program = ARRAY_SIZE(lp8552_eeprom_arr), + .rom_data = lp8552_eeprom_arr, + }; + +2) lp8556 platform data: pwm input mode with default rom data:: + + static struct lp855x_platform_data lp8556_pdata = { + .device_control = PWM_CONFIG(LP8556), + .initial_brightness = INITIAL_BRT, + .period_ns = 1000000, + };
Documentation/backlight/lp855x-driver.txt deleted +0 -66
66 lines not on this page · raw message
MAINTAINERS +1 -1
@@ -15828,7 +15828,7 @@ F: sound/soc/codecs/isabelle* TI LP855x BACKLIGHT DRIVER M: Milo Kim <[email protected]> S: Maintained -F: Documentation/backlight/lp855x-driver.txt +F: Documentation/backlight/lp855x-driver.rst F: drivers/video/backlight/lp855x_bl.c F: include/linux/platform_data/lp855x.h
Signature · 1 line
2.21.0
PATCH 4/31 docs: m68k: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabConvert the m68k kernel-options.txt file to ReST.
The conversion is trivial, as the document is already on a format close enough to ReST. Just some small adjustments were needed in order to make it both good for being parsed while keeping it on a good txt shape.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../admin-guide/kernel-parameters.rst | 2 +-
Documentation/m68k/index.rst | 17 +
...{kernel-options.txt => kernel-options.rst} | 319 ++++++++++--------
3 files changed, 191 insertions(+), 147 deletions(-)
create mode 100644 Documentation/m68k/index.rst
rename Documentation/m68k/{kernel-options.txt => kernel-options.rst} (78%)Documentation/admin-guide/kernel-parameters.rst +1 -1
@@ -118,7 +118,7 @@ parameter is applicable:: LOOP Loopback device support is enabled. M68k M68k architecture is enabled. These options have more detailed description inside of - Documentation/m68k/kernel-options.txt. + Documentation/m68k/kernel-options.rst. MDA MDA console support is enabled. MIPS MIPS architecture is enabled. MOUSE Appropriate mouse support is enabled.
Documentation/m68k/index.rst new file +17 -0
@@ -0,0 +1,17 @@ +:orphan: + +================= +m68k Architecture +================= + +.. toctree:: + :maxdepth: 2 + + kernel-options + +.. only:: subproject and html + + Indices + ======= + + * :ref:`genindex`
Documentation/m68k/kernel-options.rst renamed from Documentation/m68k/kernel-options.txt +173 -146
802 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH 5/31 docs: cma/debugfs.txt: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabThe debugfs interface for CMA should be there together with other mm-related documents.
Convert this small file to ReST and move it to its rightful place.
The conversion is actually quite simple: just add a title for the document. In order to make it to look better for the audience, also mark the "echo" command as a literal block.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
Documentation/cma/{debugfs.txt => debugfs.rst} | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
rename Documentation/cma/{debugfs.txt => debugfs.rst} (91%)Documentation/cma/debugfs.rst renamed from Documentation/cma/debugfs.txt +7 -1
@@ -1,3 +1,9 @@ +:orphan: + +===================== +CMA Debugfs Interface +===================== + The CMA debugfs interface is useful to retrieve basic information out of the different CMA areas and to test allocation/release in each of the areas.
@@ -12,7 +18,7 @@ The structure of the files created under that directory is as follows: - [RO] count: Amount of memory in the CMA area. - [RO] order_per_bit: Order of pages represented by one bit. - [RO] bitmap: The bitmap of page states in the zone. - - [WO] alloc: Allocate N pages from that CMA area. For example: + - [WO] alloc: Allocate N pages from that CMA area. For example:: echo 5 > <debugfs>/cma/cma-2/alloc
Signature · 1 line
2.21.0
PATCH 6/31 docs: console.txt: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabConvert this small file to ReST in preparation for adding it to the driver-api book.
While this is not part of the driver-api book, mark it as :orphan:, in order to avoid build warnings.
---
.../console/{console.txt => console.rst} | 63 ++++++++++---------
Documentation/fb/fbcon.rst | 4 +-
drivers/tty/Kconfig | 2 +-
3 files changed, 38 insertions(+), 31 deletions(-)
rename Documentation/console/{console.txt => console.rst} (80%)Documentation/console/console.rst renamed from Documentation/console/console.txt +34 -28
@@ -1,3 +1,6 @@ +:orphan: + +======= Console Drivers =======
@@ -17,25 +20,26 @@ of driver occupying the consoles.) They can only take over the console that is occupied by the system driver. In the same token, if the modular driver is released by the console, the system driver will take over. -Modular drivers, from the programmer's point of view, have to call: +Modular drivers, from the programmer's point of view, have to call:: do_take_over_console() - load and bind driver to console layer give_up_console() - unload driver; it will only work if driver is fully unbound -In newer kernels, the following are also available: +In newer kernels, the following are also available:: do_register_con_driver() do_unregister_con_driver() If sysfs is enabled, the contents of /sys/class/vtconsole can be examined. This shows the console backends currently registered by the -system which are named vtcon<n> where <n> is an integer from 0 to 15. Thus: +system which are named vtcon<n> where <n> is an integer from 0 to 15. +Thus:: ls /sys/class/vtconsole . .. vtcon0 vtcon1 -Each directory in /sys/class/vtconsole has 3 files: +Each directory in /sys/class/vtconsole has 3 files:: ls /sys/class/vtconsole/vtcon0 . .. bind name uevent
@@ -46,27 +50,29 @@ What do these files signify? read, or acts to bind or unbind the driver to the virtual consoles when written to. The possible values are: - 0 - means the driver is not bound and if echo'ed, commands the driver + 0 + - means the driver is not bound and if echo'ed, commands the driver to unbind - 1 - means the driver is bound and if echo'ed, commands the driver to + 1 + - means the driver is bound and if echo'ed, commands the driver to bind - 2. name - read-only file. Shows the name of the driver in this format: + 2. name - read-only file. Shows the name of the driver in this format:: - cat /sys/class/vtconsole/vtcon0/name - (S) VGA+ + cat /sys/class/vtconsole/vtcon0/name + (S) VGA+ - '(S)' stands for a (S)ystem driver, i.e., it cannot be directly - commanded to bind or unbind + '(S)' stands for a (S)ystem driver, i.e., it cannot be directly + commanded to bind or unbind - 'VGA+' is the name of the driver + 'VGA+' is the name of the driver - cat /sys/class/vtconsole/vtcon1/name - (M) frame buffer device + cat /sys/class/vtconsole/vtcon1/name + (M) frame buffer device - In this case, '(M)' stands for a (M)odular driver, one that can be - directly commanded to bind or unbind. + In this case, '(M)' stands for a (M)odular driver, one that can be + directly commanded to bind or unbind. 3. uevent - ignore this file
@@ -75,14 +81,17 @@ driver takes over the consoles vacated by the driver. Binding, on the other hand, will bind the driver to the consoles that are currently occupied by a system driver. -NOTE1: Binding and unbinding must be selected in Kconfig. It's under: +NOTE1: + Binding and unbinding must be selected in Kconfig. It's under:: -Device Drivers -> Character devices -> Support for binding and unbinding -console drivers + Device Drivers -> + Character devices -> + Support for binding and unbinding console drivers -NOTE2: If any of the virtual consoles are in KD_GRAPHICS mode, then binding or -unbinding will not succeed. An example of an application that sets the console -to KD_GRAPHICS is X. +NOTE2: + If any of the virtual consoles are in KD_GRAPHICS mode, then binding or + unbinding will not succeed. An example of an application that sets the + console to KD_GRAPHICS is X. How useful is this feature? This is very useful for console driver developers. By unbinding the driver from the console layer, one can unload the
@@ -92,10 +101,10 @@ framebuffer console to VGA console and vice versa, this feature also makes this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb for more details.) -Notes for developers: -==========+Notes for developers +========== -do_take_over_console() is now broken up into: +do_take_over_console() is now broken up into:: do_register_con_driver() do_bind_con_driver() - private function
@@ -104,7 +113,7 @@ give_up_console() is a wrapper to do_unregister_con_driver(), and a driver must be fully unbound for this call to succeed. con_is_bound() will check if the driver is bound or not. -Guidelines for console driver writers: +Guidelines for console driver writers ================== In order for binding to and unbinding from the console to properly work,
@@ -140,6 +149,4 @@ The current crop of console drivers should still work correctly, but binding and unbinding them may cause problems. With minimal fixes, these drivers can be made to work correctly. -============= Antonino Daplas <[email protected]> -
Documentation/fb/fbcon.rst +2 -2
@@ -187,7 +187,7 @@ the hardware. Thus, in a VGA console:: Assuming the VGA driver can be unloaded, one must first unbind the VGA driver from the console layer before unloading the driver. The VGA driver cannot be unloaded if it is still bound to the console layer. (See -Documentation/console/console.txt for more information). +Documentation/console/console.rst for more information). This is more complicated in the case of the framebuffer console (fbcon), because fbcon is an intermediate layer between the console and the drivers::
@@ -204,7 +204,7 @@ fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from fbcon. So, how do we unbind fbcon from the console? Part of the answer is in -Documentation/console/console.txt. To summarize: +Documentation/console/console.rst. To summarize: Echo a value to the bind file that represents the framebuffer console driver. So assuming vtcon1 represents fbcon, then::
drivers/tty/Kconfig +1 -1
@@ -93,7 +93,7 @@ config VT_HW_CONSOLE_BINDING select the console driver that will serve as the backend for the virtual terminals. - See <file:Documentation/console/console.txt> for more + See <file:Documentation/console/console.rst> for more information. For framebuffer console users, please refer to <file:Documentation/fb/fbcon.rst>.
Signature · 1 line
2.21.0
PATCH 7/31 docs: pti_intel_mid.txt: convert it to pti_intel_mid.rst
In reply to Mauro Carvalho ChehabConvert this small file to ReST format and rename it.
Most of the conversion were related to adjusting whitespaces in order for each section to be properly parsed.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
--- Documentation/pti/pti_intel_mid.rst | 106 ++++++++++++++++++++++++++++ Documentation/pti/pti_intel_mid.txt | 99 -------------------------- 2 files changed, 106 insertions(+), 99 deletions(-) create mode 100644 Documentation/pti/pti_intel_mid.rst delete mode 100644 Documentation/pti/pti_intel_mid.txt
Documentation/pti/pti_intel_mid.rst new file +106 -0
@@ -0,0 +1,106 @@ +:orphan: + +============= +Intel MID PTI +============= + +The Intel MID PTI project is HW implemented in Intel Atom +system-on-a-chip designs based on the Parallel Trace +Interface for MIPI P1149.7 cJTAG standard. The kernel solution +for this platform involves the following files:: + + ./include/linux/pti.h + ./drivers/.../n_tracesink.h + ./drivers/.../n_tracerouter.c + ./drivers/.../n_tracesink.c + ./drivers/.../pti.c + +pti.c is the driver that enables various debugging features +popular on platforms from certain mobile manufacturers. +n_tracerouter.c and n_tracesink.c allow extra system information to +be collected and routed to the pti driver, such as trace +debugging data from a modem. Although n_tracerouter +and n_tracesink are a part of the complete PTI solution, +these two line disciplines can work separately from +pti.c and route any data stream from one /dev/tty node +to another /dev/tty node via kernel-space. This provides +a stable, reliable connection that will not break unless +the user-space application shuts down (plus avoids +kernel->user->kernel context switch overheads of routing +data). + +An example debugging usage for this driver system: + + * Hook /dev/ttyPTI0 to syslogd. Opening this port will also start + a console device to further capture debugging messages to PTI. + * Hook /dev/ttyPTI1 to modem debugging data to write to PTI HW. + This is where n_tracerouter and n_tracesink are used. + * Hook /dev/pti to a user-level debugging application for writing + to PTI HW. + * `Use mipi_` Kernel Driver API in other device drivers for + debugging to PTI by first requesting a PTI write address via + mipi_request_masterchannel(1). + +Below is example pseudo-code on how a 'privileged' application +can hook up n_tracerouter and n_tracesink to any tty on +a system. 'Privileged' means the application has enough +privileges to successfully manipulate the ldisc drivers +but is not just blindly executing as 'root'. Keep in mind +the use of ioctl(,TIOCSETD,) is not specific to the n_tracerouter +and n_tracesink line discpline drivers but is a generic +operation for a program to use a line discpline driver +on a tty port other than the default n_tty:: + + /////////// To hook up n_tracerouter and n_tracesink ///////// + + // Note that n_tracerouter depends on n_tracesink. + #include <errno.h> + #define ONE_TTY "/dev/ttyOne" + #define TWO_TTY "/dev/ttyTwo" + + // needed global to hand onto ldisc connection + static int g_fd_source = -1; + static int g_fd_sink = -1; + + // these two vars used to grab LDISC values from loaded ldisc drivers + // in OS. Look at /proc/tty/ldiscs to get the right numbers from + // the ldiscs loaded in the system. + int source_ldisc_num, sink_ldisc_num = -1; + int retval; + + g_fd_source = open(ONE_TTY, O_RDWR); // must be R/W + g_fd_sink = open(TWO_TTY, O_RDWR); // must be R/W + + if (g_fd_source <= 0) || (g_fd_sink <= 0) { + // doubt you'll want to use these exact error lines of code + printf("Error on open(). errno: %d\n",errno); + return errno; + } + + retval = ioctl(g_fd_sink, TIOCSETD, &sink_ldisc_num); + if (retval < 0) { + printf("Error on ioctl(). errno: %d\n", errno); + return errno; + } + + retval = ioctl(g_fd_source, TIOCSETD, &source_ldisc_num); + if (retval < 0) { + printf("Error on ioctl(). errno: %d\n", errno); + return errno; + } + + /////////// To disconnect n_tracerouter and n_tracesink //////// + + // First make sure data through the ldiscs has stopped. + + // Second, disconnect ldiscs. This provides a + // little cleaner shutdown on tty stack. + sink_ldisc_num = 0; + source_ldisc_num = 0; + ioctl(g_fd_uart, TIOCSETD, &sink_ldisc_num); + ioctl(g_fd_gadget, TIOCSETD, &source_ldisc_num); + + // Three, program closes connection, and cleanup: + close(g_fd_uart); + close(g_fd_gadget); + g_fd_uart = g_fd_gadget = NULL;
Documentation/pti/pti_intel_mid.txt deleted +0 -99
99 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH 8/31 docs: early-userspace: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabThe two files there describes a Kernel API feature, used to support early userspace stuff. Prepare for moving them to the kernel API book by converting to ReST format.
The conversion itself was quite trivial: just add/mark a few titles as such, add a literal block markup, add a table markup and a few blank lines, in order to make Sphinx to properly parse it.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../{buffer-format.txt => buffer-format.rst} | 19 +++++++++++++------
.../{README => early_userspace_support.rst} | 3 +++
Documentation/early-userspace/index.rst | 18 ++++++++++++++++++
Documentation/filesystems/nfs/nfsroot.txt | 2 +-
.../filesystems/ramfs-rootfs-initramfs.txt | 4 ++--
usr/Kconfig | 2 +-
6 files changed, 38 insertions(+), 10 deletions(-)
rename Documentation/early-userspace/{buffer-format.txt => buffer-format.rst} (91%)
rename Documentation/early-userspace/{README => early_userspace_support.rst} (99%)
create mode 100644 Documentation/early-userspace/index.rstDocumentation/early-userspace/buffer-format.rst renamed from Documentation/early-userspace/buffer-format.txt +13 -6
@@ -1,8 +1,10 @@ - initramfs buffer format - ----------------------- +======================= +initramfs buffer format +======================= - Al Viro, H. Peter Anvin - Last revision: 2002-01-13 +Al Viro, H. Peter Anvin + +Last revision: 2002-01-13 Starting with kernel 2.5.x, the old "initial ramdisk" protocol is getting {replaced/complemented} with the new "initial ramfs"
@@ -18,7 +20,8 @@ archive can be compressed using gzip(1). One valid version of an initramfs buffer is thus a single .cpio.gz file. The full format of the initramfs buffer is defined by the following -grammar, where: +grammar, where:: + * is used to indicate "0 or more occurrences of" (|) indicates alternatives + indicates concatenation
@@ -49,7 +52,9 @@ hexadecimal ASCII numbers fully padded with '0' on the left to the full width of the field, for example, the integer 4780 is represented by the ASCII string "000012ac"): +============= ================== ============================================== Field name Field size Meaning +============= ================== ============================================== c_magic 6 bytes The string "070701" or "070702" c_ino 8 bytes File inode number c_mode 8 bytes File mode and permissions
@@ -65,6 +70,7 @@ c_rmin 8 bytes Minor part of device node reference c_namesize 8 bytes Length of filename, including final \0 c_chksum 8 bytes Checksum of data field if c_magic is 070702; otherwise zero +============= ================== ============================================== The c_mode field matches the contents of st_mode returned by stat(2) on Linux, and encodes the file type and file permissions.
@@ -82,7 +88,8 @@ If the filename is "TRAILER!!!" this is actually an end-of-archive marker; the c_filesize for an end-of-archive marker must be zero. -*** Handling of hard links +Handling of hard links +====================== When a nondirectory with c_nlink > 1 is seen, the (c_maj,c_min,c_ino) tuple is looked up in a tuple buffer. If not found, it is entered in
Documentation/early-userspace/early_userspace_support.rst renamed from Documentation/early-userspace/README +3 -0
@@ -1,3 +1,4 @@ +======================= Early userspace support =======================
@@ -26,6 +27,7 @@ archive to be used as the image or have the kernel build process build the image from specifications. CPIO ARCHIVE method +------------------- You can create a cpio archive that contains the early userspace image. Your cpio archive should be specified in CONFIG_INITRAMFS_SOURCE and it
@@ -34,6 +36,7 @@ CONFIG_INITRAMFS_SOURCE and directory and file names are not allowed in combination with a cpio archive. IMAGE BUILDING method +--------------------- The kernel build process can also build an early userspace image from source parts rather than supplying a cpio archive. This method provides
Documentation/early-userspace/index.rst new file +18 -0
@@ -0,0 +1,18 @@ +:orphan: + +=============== +Early Userspace +=============== + +.. toctree:: + :maxdepth: 1 + + early_userspace_support + buffer-format + +.. only:: subproject and html + + Indices + ======= + + * :ref:`genindex`
Documentation/filesystems/nfs/nfsroot.txt +1 -1
@@ -239,7 +239,7 @@ rdinit=<executable file> A description of the process of mounting the root file system can be found in: - Documentation/early-userspace/README + Documentation/early-userspace/early_userspace_support.rst
Documentation/filesystems/ramfs-rootfs-initramfs.txt +2 -2
@@ -105,7 +105,7 @@ All this differs from the old initrd in several ways: - The old initrd file was a gzipped filesystem image (in some file format, such as ext2, that needed a driver built into the kernel), while the new initramfs archive is a gzipped cpio archive (like tar only simpler, - see cpio(1) and Documentation/early-userspace/buffer-format.txt). The + see cpio(1) and Documentation/early-userspace/buffer-format.rst). The kernel's cpio extraction code is not only extremely small, it's also __init text and data that can be discarded during the boot process.
@@ -159,7 +159,7 @@ One advantage of the configuration file is that root access is not required to set permissions or create device nodes in the new archive. (Note that those two example "file" entries expect to find files named "init.sh" and "busybox" in a directory called "initramfs", under the linux-2.6.* directory. See -Documentation/early-userspace/README for more details.) +Documentation/early-userspace/early_userspace_support.rst for more details.) The kernel does not depend on external cpio tools. If you specify a directory instead of a configuration file, the kernel's build infrastructure
usr/Kconfig +1 -1
@@ -18,7 +18,7 @@ config INITRAMFS_SOURCE When multiple directories and files are specified then the initramfs image will be the aggregate of all of them. - See <file:Documentation/early-userspace/README> for more details. + See <file:Documentation/early-userspace/early_userspace_support.rst> for more details. If you are not sure, leave it blank.
Signature · 1 line
2.21.0
PATCH 9/31 docs: driver-model: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabConvert the various documents at the driver-model, preparing them to be part of the driver-api book.
The conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
Documentation/driver-api/gpio/driver.rst | 2 +-
.../driver-model/{binding.txt => binding.rst} | 20 +-
.../driver-model/{bus.txt => bus.rst} | 69 ++--
.../driver-model/{class.txt => class.rst} | 74 ++--
...esign-patterns.txt => design-patterns.rst} | 106 +++---
.../driver-model/{device.txt => device.rst} | 57 +--
.../driver-model/{devres.txt => devres.rst} | 50 +--
.../driver-model/{driver.txt => driver.rst} | 112 +++---
Documentation/driver-model/index.rst | 26 ++
.../{overview.txt => overview.rst} | 37 +-
.../{platform.txt => platform.rst} | 30 +-
.../driver-model/{porting.txt => porting.rst} | 333 +++++++++---------
Documentation/eisa.txt | 4 +-
Documentation/hwmon/submitting-patches.rst | 2 +-
drivers/base/platform.c | 2 +-
drivers/gpio/gpio-cs5535.c | 2 +-
drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
scripts/coccinelle/free/devm_free.cocci | 2 +-
18 files changed, 489 insertions(+), 441 deletions(-)
rename Documentation/driver-model/{binding.txt => binding.rst} (92%)
rename Documentation/driver-model/{bus.txt => bus.rst} (76%)
rename Documentation/driver-model/{class.txt => class.rst} (75%)
rename Documentation/driver-model/{design-patterns.txt => design-patterns.rst} (59%)
rename Documentation/driver-model/{device.txt => device.rst} (71%)
rename Documentation/driver-model/{devres.txt => devres.rst} (93%)
rename Documentation/driver-model/{driver.txt => driver.rst} (75%)
create mode 100644 Documentation/driver-model/index.rst
rename Documentation/driver-model/{overview.txt => overview.rst} (90%)
rename Documentation/driver-model/{platform.txt => platform.rst} (95%)
rename Documentation/driver-model/{porting.txt => porting.rst} (62%)Documentation/driver-api/gpio/driver.rst +1 -1
@@ -399,7 +399,7 @@ symbol: will pass the struct gpio_chip* for the chip to all IRQ callbacks, so the callbacks need to embed the gpio_chip in its state container and obtain a pointer to the container using container_of(). - (See Documentation/driver-model/design-patterns.txt) + (See Documentation/driver-model/design-patterns.rst) - gpiochip_irqchip_add_nested(): adds a nested cascaded irqchip to a gpiochip, as discussed above regarding different types of cascaded irqchips. The
Documentation/driver-model/binding.rst renamed from Documentation/driver-model/binding.txt +10 -10
@@ -1,5 +1,6 @@ - +============== Driver Binding +============== Driver binding is the process of associating a device with a device driver that can control it. Bus drivers have typically handled this
@@ -25,7 +26,7 @@ device_register When a new device is added, the bus's list of drivers is iterated over to find one that supports it. In order to determine that, the device ID of the device must match one of the device IDs that the driver -supports. The format and semantics for comparing IDs is bus-specific. +supports. The format and semantics for comparing IDs is bus-specific. Instead of trying to derive a complex state machine and matching algorithm, it is up to the bus driver to provide a callback to compare a device against the IDs of a driver. The bus returns 1 if a match was
@@ -36,14 +37,14 @@ int match(struct device * dev, struct device_driver * drv); If a match is found, the device's driver field is set to the driver and the driver's probe callback is called. This gives the driver a chance to verify that it really does support the hardware, and that -it's in a working state. +it's in a working state. Device Class ~~~~~~~~~~~~ Upon the successful completion of probe, the device is registered with the class to which it belongs. Device drivers belong to one and only one -class, and that is set in the driver's devclass field. +class, and that is set in the driver's devclass field. devclass_add_device is called to enumerate the device within the class and actually register it with the class, which happens with the class's register_dev callback.
@@ -53,7 +54,7 @@ Driver ~~~~~~ When a driver is attached to a device, the device is inserted into the -driver's list of devices. +driver's list of devices. sysfs
@@ -67,18 +68,18 @@ to the device's directory in the physical hierarchy. A directory for the device is created in the class's directory. A symlink is created in that directory that points to the device's -physical location in the sysfs tree. +physical location in the sysfs tree. A symlink can be created (though this isn't done yet) in the device's physical directory to either its class directory, or the class's top-level directory. One can also be created to point to its driver's -directory also. +directory also. driver_register ~~~~~~~~~~~~~~~ -The process is almost identical for when a new driver is added. +The process is almost identical for when a new driver is added. The bus's list of devices is iterated over to find a match. Devices that already have a driver are skipped. All the devices are iterated over, to bind as many devices as possible to the driver.
@@ -94,5 +95,4 @@ of the driver is decremented. All symlinks between the two are removed. When a driver is removed, the list of devices that it supports is iterated over, and the driver's remove callback is called for each -one. The device is removed from that list and the symlinks removed. - +one. The device is removed from that list and the symlinks removed.
Documentation/driver-model/bus.rst renamed from Documentation/driver-model/bus.txt +36 -33
147 lines not on this page · raw message
Documentation/driver-model/class.rst renamed from Documentation/driver-model/class.txt +38 -36
165 lines not on this page · raw message
Documentation/driver-model/design-patterns.rst renamed from Documentation/driver-model/design-patterns.txt +53 -53
141 lines not on this page · raw message
Documentation/driver-model/device.rst renamed from Documentation/driver-model/device.txt +30 -27
114 lines not on this page · raw message
Documentation/driver-model/devres.rst renamed from Documentation/driver-model/devres.txt +26 -24
126 lines not on this page · raw message
Documentation/driver-model/driver.rst renamed from Documentation/driver-model/driver.txt +60 -52
209 lines not on this page · raw message
Documentation/driver-model/index.rst new file +26 -0
@@ -0,0 +1,26 @@ +:orphan: + +============ +Driver Model +============ + +.. toctree:: + :maxdepth: 1 + + binding + bus + class + design-patterns + device + devres + driver + overview + platform + porting + +.. only:: subproject and html + + Indices + ======= + + * :ref:`genindex`
Documentation/driver-model/overview.rst renamed from Documentation/driver-model/overview.txt +19 -18
@@ -1,4 +1,6 @@ +============================= The Linux Kernel Device Model +============================= Patrick Mochel <[email protected]>
@@ -41,14 +43,14 @@ data structure. These fields must still be accessed by the bus layers, and sometimes by the device-specific drivers. Other bus layers are encouraged to do what has been done for the PCI layer. -struct pci_dev now looks like this: +struct pci_dev now looks like this:: -struct pci_dev { + struct pci_dev { ... struct device dev; /* Generic device interface */ ... -}; + }; Note first that the struct device dev within the struct pci_dev is statically allocated. This means only one allocation on device discovery.
@@ -80,26 +82,26 @@ easy. This has been accomplished by implementing a special purpose virtual file system named sysfs. Almost all mainstream Linux distros mount this filesystem automatically; you -can see some variation of the following in the output of the "mount" command: +can see some variation of the following in the output of the "mount" command:: -$ mount -... -none on /sys type sysfs (rw,noexec,nosuid,nodev) -... -$ + $ mount + ... + none on /sys type sysfs (rw,noexec,nosuid,nodev) + ... + $ The auto-mounting of sysfs is typically accomplished by an entry similar to -the following in the /etc/fstab file: +the following in the /etc/fstab file:: -none /sys sysfs defaults 0 0 + none /sys sysfs defaults 0 0 -or something similar in the /lib/init/fstab file on Debian-based systems: +or something similar in the /lib/init/fstab file on Debian-based systems:: -none /sys sysfs nodev,noexec,nosuid 0 0 + none /sys sysfs nodev,noexec,nosuid 0 0 -If sysfs is not automatically mounted, you can always do it manually with: +If sysfs is not automatically mounted, you can always do it manually with:: -# mount -t sysfs sysfs /sys + # mount -t sysfs sysfs /sys Whenever a device is inserted into the tree, a directory is created for it. This directory may be populated at each layer of discovery - the global layer,
@@ -108,7 +110,7 @@ the bus layer, or the device layer. The global layer currently creates two files - 'name' and 'power'. The former only reports the name of the device. The latter reports the current power state of the device. It will also be used to set the current -power state. +power state. The bus layer may also create files for the devices it finds while probing the bus. For example, the PCI layer currently creates 'irq' and 'resource' files
@@ -118,6 +120,5 @@ A device-specific driver may also export files in its directory to expose device-specific data or tunable interfaces. More information about the sysfs directory layout can be found in -the other documents in this directory and in the file +the other documents in this directory and in the file Documentation/filesystems/sysfs.txt. -
Documentation/driver-model/platform.rst renamed from Documentation/driver-model/platform.txt +16 -14
@@ -1,5 +1,7 @@ +============================ Platform Devices and Drivers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +============================ + See <linux/platform_device.h> for the driver model interface to the platform bus: platform_device, and platform_driver. This pseudo-bus is used to connect devices on busses with minimal infrastructure,
@@ -19,15 +21,15 @@ be connected through a segment of some other kind of bus; but its registers will still be directly addressable. Platform devices are given a name, used in driver binding, and a -list of resources such as addresses and IRQs. +list of resources such as addresses and IRQs:: -struct platform_device { + struct platform_device { const char *name; u32 id; struct device dev; u32 num_resources; struct resource *resource; -}; + }; Platform drivers
@@ -35,9 +37,9 @@ Platform drivers Platform drivers follow the standard driver model convention, where discovery/enumeration is handled outside the drivers, and drivers provide probe() and remove() methods. They support power management -and shutdown notifications using the standard conventions. +and shutdown notifications using the standard conventions:: -struct platform_driver { + struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *);
@@ -46,25 +48,25 @@ struct platform_driver { int (*resume_early)(struct platform_device *); int (*resume)(struct platform_device *); struct device_driver driver; -}; + }; Note that probe() should in general verify that the specified device hardware actually exists; sometimes platform setup code can't be sure. The probing can use device resources, including clocks, and device platform_data. -Platform drivers register themselves the normal way: +Platform drivers register themselves the normal way:: int platform_driver_register(struct platform_driver *drv); Or, in common situations where the device is known not to be hot-pluggable, the probe() routine can live in an init section to reduce the driver's -runtime memory footprint: +runtime memory footprint:: int platform_driver_probe(struct platform_driver *drv, int (*probe)(struct platform_device *)) Kernel modules can be composed of several platform drivers. The platform core -provides helpers to register and unregister an array of drivers: +provides helpers to register and unregister an array of drivers:: int __platform_register_drivers(struct platform_driver * const *drivers, unsigned int count, struct module *owner);
@@ -73,7 +75,7 @@ provides helpers to register and unregister an array of drivers: If one of the drivers fails to register, all drivers registered up to that point will be unregistered in reverse order. Note that there is a convenience -macro that passes THIS_MODULE as owner parameter: +macro that passes THIS_MODULE as owner parameter:: #define platform_register_drivers(drivers, count)
@@ -81,7 +83,7 @@ macro that passes THIS_MODULE as owner parameter: Device Enumeration ~~~~~~~~~~~~~~~~~~ As a rule, platform specific (and often board-specific) setup code will -register platform devices: +register platform devices:: int platform_device_register(struct platform_device *pdev);
@@ -133,14 +135,14 @@ tend to already have "normal" modes, such as ones using device nodes that were created by PNP or by platform device setup. None the less, there are some APIs to support such legacy drivers. Avoid -using these calls except with such hotplug-deficient drivers. +using these calls except with such hotplug-deficient drivers:: struct platform_device *platform_device_alloc( const char *name, int id); You can use platform_device_alloc() to dynamically allocate a device, which you will then initialize with resources and platform_device_register(). -A better solution is usually: +A better solution is usually:: struct platform_device *platform_device_register_simple( const char *name, int id,
Documentation/driver-model/porting.rst renamed from Documentation/driver-model/porting.txt +167 -166
586 lines not on this page · raw message
Documentation/eisa.txt +2 -2
@@ -103,7 +103,7 @@ id_table an array of NULL terminated EISA id strings, (driver_data). driver a generic driver, such as described in - Documentation/driver-model/driver.txt. Only .name, + Documentation/driver-model/driver.rst. Only .name, .probe and .remove members are mandatory. =============== ====================================================
@@ -152,7 +152,7 @@ state set of flags indicating the state of the device. Current flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED. res set of four 256 bytes I/O regions allocated to this device dma_mask DMA mask set from the parent device. -dev generic device (see Documentation/driver-model/device.txt) +dev generic device (see Documentation/driver-model/device.rst) ======== ============================================================ You can get the 'struct eisa_device' from 'struct device' using the
Documentation/hwmon/submitting-patches.rst +1 -1
@@ -89,7 +89,7 @@ increase the chances of your change being accepted. console. Excessive logging can seriously affect system performance. * Use devres functions whenever possible to allocate resources. For rationale - and supported functions, please see Documentation/driver-model/devres.txt. + and supported functions, please see Documentation/driver-model/devres.rst. If a function is not supported by devres, consider using devm_add_action(). * If the driver has a detect function, make sure it is silent. Debug messages
drivers/base/platform.c +1 -1
@@ -5,7 +5,7 @@* Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs * -* Please see Documentation/driver-model/platform.txt for more +* Please see Documentation/driver-model/platform.rst for more * information. */
drivers/gpio/gpio-cs5535.c +1 -1
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(mask, "GPIO channel mask.");/* * FIXME: convert this singleton driver to use the state container -* design pattern, see Documentation/driver-model/design-patterns.txt +* design pattern, see Documentation/driver-model/design-patterns.rst */ static struct cs5535_gpio_chip { struct gpio_chip chip;
drivers/net/ethernet/intel/ice/ice_main.c +1 -1
@@ -2286,7 +2286,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)struct ice_hw *hw;int err; -/* this driver uses devres, see Documentation/driver-model/devres.txt */ +/* this driver uses devres, see Documentation/driver-model/devres.rst */ err =pcim_enable_device (pdev);if (err)return err;
scripts/coccinelle/free/devm_free.cocci +1 -1
@@ -2,7 +2,7 @@ /// functions. Values allocated using the devm_functions are freed when /// the device is detached, and thus the use of the standard freeing /// function would cause a double free. -/// See Documentation/driver-model/devres.txt for more information. +/// See Documentation/driver-model/devres.rst for more information. /// /// A difficulty of detecting this problem is that the standard freeing /// function might be called from a different function than the one
Signature · 1 line
2.21.0
Re: [PATCH v1 09/31] docs: driver-model: convert docs to ReST and rename to *.rst
Quoted 10 lines · Mauro Carvalho Chehab
Convert the various documents at the driver-model, preparing them to be part of the driver-api book.
The conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.
Quoted 4 lines
At its new
index.rst, let's add a :orphan: while this is not linked to the mainindex.rstfile, in order to avoid build warnings.Signed-off-by Mauro Carvalho Chehab <[email protected]>
For the ice driver comment change.
Quoted 24 lines
---
Documentation/driver-api/gpio/driver.rst | 2 +-
.../driver-model/{binding.txt => binding.rst} | 20 +-
.../driver-model/{bus.txt => bus.rst} | 69 ++--
.../driver-model/{class.txt => class.rst} | 74 ++--
...esign-patterns.txt => design-patterns.rst} | 106 +++---
.../driver-model/{device.txt => device.rst} | 57 +--
.../driver-model/{devres.txt => devres.rst} | 50 +--
.../driver-model/{driver.txt => driver.rst} | 112 +++---
Documentation/driver-model/index.rst | 26 ++
.../{overview.txt => overview.rst} | 37 +-
.../{platform.txt => platform.rst} | 30 +-
.../driver-model/{porting.txt => porting.rst} | 333 +++++++++---------
Documentation/eisa.txt | 4 +-
Documentation/hwmon/submitting-patches.rst | 2 +-
drivers/base/platform.c | 2 +-
drivers/gpio/gpio-cs5535.c | 2 +-
drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
scripts/coccinelle/free/devm_free.cocci | 2 +-
18 files changed, 489 insertions(+), 441 deletions(-)
rename Documentation/driver-model/{binding.txt => binding.rst} (92%)
rename Documentation/driver-model/{bus.txt => bus.rst} (76%)
rename Documentation/driver-model/{class.txt => class.rst} (75%)
rename Documentation/driver-model/{design-patterns.txt => design-Quoted 8 lines
patterns.rst} (59%)rename Documentation/driver-model/{device.txt => device.rst} (71%) rename Documentation/driver-model/{devres.txt => devres.rst} (93%) rename Documentation/driver-model/{driver.txt => driver.rst} (75%) create mode 100644 Documentation/driver-model/index.rst rename Documentation/driver-model/{overview.txt => overview.rst} (90%) rename Documentation/driver-model/{platform.txt => platform.rst} (95%) rename Documentation/driver-model/{porting.txt => porting.rst} (62%)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20190612/701c155a/attachment.asc>
PATCH 10/31 docs: arm: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabConverts ARM the text files to ReST, preparing them to be an architecture book.
The conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
Documentation/arm/Marvell/README | 395 --------------
Documentation/arm/Netwinder | 78 ---
Documentation/arm/SA1100/FreeBird | 21 -
Documentation/arm/SA1100/empeg | 2 -
Documentation/arm/SA1100/serial_UART | 47 --
Documentation/arm/{README => arm.rst} | 50 +-
Documentation/arm/{Booting => booting.rst} | 71 ++-
...ance.txt => cluster-pm-race-avoidance.rst} | 177 ++++---
.../arm/{firmware.txt => firmware.rst} | 14 +-
Documentation/arm/index.rst | 80 +++
.../arm/{Interrupts => interrupts.rst} | 86 +--
Documentation/arm/{IXP4xx => ixp4xx.rst} | 61 +--
...nel_mode_neon.txt => kernel_mode_neon.rst} | 3 +
...er_helpers.txt => kernel_user_helpers.rst} | 79 +--
.../keystone/{knav-qmss.txt => knav-qmss.rst} | 6 +-
.../keystone/{Overview.txt => overview.rst} | 47 +-
Documentation/arm/marvel.rst | 488 ++++++++++++++++++
.../arm/{mem_alignment => mem_alignment.rst} | 11 +-
Documentation/arm/{memory.txt => memory.rst} | 9 +-
.../arm/{Microchip/README => microchip.rst} | 63 ++-
Documentation/arm/netwinder.rst | 85 +++
Documentation/arm/nwfpe/index.rst | 11 +
.../nwfpe/{README.FPE => netwinder-fpe.rst} | 24 +-
Documentation/arm/nwfpe/{NOTES => notes.rst} | 3 +
Documentation/arm/nwfpe/{README => nwfpe.rst} | 10 +-
Documentation/arm/nwfpe/{TODO => todo.rst} | 47 +-
Documentation/arm/{OMAP/DSS => omap/dss.rst} | 112 ++--
Documentation/arm/omap/index.rst | 10 +
.../arm/{OMAP/README => omap/omap.rst} | 7 +
.../arm/{OMAP/omap_pm => omap/omap_pm.rst} | 55 +-
Documentation/arm/{Porting => porting.rst} | 14 +-
Documentation/arm/pxa/{mfp.txt => mfp.rst} | 106 ++--
.../{SA1100/ADSBitsy => sa1100/adsbitsy.rst} | 14 +-
.../{SA1100/Assabet => sa1100/assabet.rst} | 185 +++----
.../arm/{SA1100/Brutus => sa1100/brutus.rst} | 45 +-
.../arm/{SA1100/CERF => sa1100/cerf.rst} | 10 +-
Documentation/arm/sa1100/freebird.rst | 25 +
.../graphicsclient.rst} | 46 +-
.../graphicsmaster.rst} | 13 +-
.../HUW_WEBPANEL => sa1100/huw_webpanel.rst} | 8 +-
Documentation/arm/sa1100/index.rst | 23 +
.../arm/{SA1100/Itsy => sa1100/itsy.rst} | 14 +-
.../arm/{SA1100/LART => sa1100/lart.rst} | 3 +-
.../nanoEngine => sa1100/nanoengine.rst} | 6 +-
.../{SA1100/Pangolin => sa1100/pangolin.rst} | 10 +-
.../arm/{SA1100/PLEB => sa1100/pleb.rst} | 6 +-
Documentation/arm/sa1100/serial_uart.rst | 51 ++
.../arm/{SA1100/Tifon => sa1100/tifon.rst} | 4 +-
.../arm/{SA1100/Yopy => sa1100/yopy.rst} | 5 +-
.../cpufreq.rst} | 5 +-
.../eb2410itx.rst} | 5 +-
.../GPIO.txt => samsung-s3c24xx/gpio.rst} | 23 +-
.../H1940.txt => samsung-s3c24xx/h1940.rst} | 5 +-
Documentation/arm/samsung-s3c24xx/index.rst | 18 +
.../NAND.txt => samsung-s3c24xx/nand.rst} | 6 +-
.../overview.rst} | 21 +-
.../s3c2412.rst} | 5 +-
.../s3c2413.rst} | 7 +-
.../smdk2440.rst} | 5 +-
.../suspend.rst} | 20 +-
.../usb-host.rst} | 16 +-
.../bootloader-interface.rst} | 27 +-
.../clksrc-change-registers.awk | 0
.../{Samsung/GPIO.txt => samsung/gpio.rst} | 7 +-
Documentation/arm/samsung/index.rst | 10 +
.../Overview.txt => samsung/overview.rst} | 15 +-
Documentation/arm/{Setup => setup.rst} | 49 +-
.../arm/{SH-Mobile => sh-mobile}/.gitignore | 0
.../overview.txt => spear/overview.rst} | 20 +-
.../arm/sti/{overview.txt => overview.rst} | 21 +-
...h407-overview.txt => stih407-overview.rst} | 9 +-
...h415-overview.txt => stih415-overview.rst} | 8 +-
...h416-overview.txt => stih416-overview.rst} | 5 +-
...h418-overview.txt => stih418-overview.rst} | 9 +-
.../arm/stm32/stm32f429-overview.rst | 7 +-
.../arm/stm32/stm32f746-overview.rst | 7 +-
.../arm/stm32/stm32f769-overview.rst | 7 +-
.../arm/stm32/stm32h743-overview.rst | 7 +-
.../arm/stm32/stm32mp157-overview.rst | 3 +-
Documentation/arm/{sunxi/README => sunxi.rst} | 98 +++-
.../arm/sunxi/{clocks.txt => clocks.rst} | 7 +-
.../arm/{swp_emulation => swp_emulation.rst} | 24 +-
Documentation/arm/{tcm.txt => tcm.rst} | 54 +-
Documentation/arm/{uefi.txt => uefi.rst} | 39 +-
.../release-notes.rst} | 4 +-
Documentation/arm/{vlocks.txt => vlocks.rst} | 9 +-
Documentation/devicetree/bindings/arm/xen.txt | 2 +-
.../devicetree/booting-without-of.txt | 4 +-
Documentation/index.rst | 1 +
Documentation/translations/zh_CN/arm/Booting | 4 +-
.../zh_CN/arm/kernel_user_helpers.txt | 4 +-
MAINTAINERS | 4 +-
arch/arm/Kconfig | 2 +-
arch/arm/common/mcpm_entry.c | 2 +-
arch/arm/common/mcpm_head.S | 2 +-
arch/arm/common/vlock.S | 2 +-
arch/arm/include/asm/setup.h | 2 +-
arch/arm/include/uapi/asm/setup.h | 2 +-
arch/arm/kernel/entry-armv.S | 2 +-
arch/arm/mach-exynos/common.h | 2 +-
arch/arm/mach-ixp4xx/Kconfig | 14 +-
arch/arm/mach-s3c24xx/pm.c | 2 +-
arch/arm/mm/Kconfig | 4 +-
arch/arm/plat-samsung/Kconfig | 6 +-
arch/arm/tools/mach-types | 2 +-
arch/arm64/Kconfig | 2 +-
arch/arm64/kernel/kuser32.S | 2 +-
arch/mips/bmips/setup.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-core.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +-
drivers/crypto/sunxi-ss/sun4i-ss.h | 2 +-
drivers/input/touchscreen/sun4i-ts.c | 2 +-
drivers/tty/serial/Kconfig | 2 +-
114 files changed, 1985 insertions(+), 1418 deletions(-)
delete mode 100644 Documentation/arm/Marvell/README
delete mode 100644 Documentation/arm/Netwinder
delete mode 100644 Documentation/arm/SA1100/FreeBird
delete mode 100644 Documentation/arm/SA1100/empeg
delete mode 100644 Documentation/arm/SA1100/serial_UART
rename Documentation/arm/{README => arm.rst} (88%)
rename Documentation/arm/{Booting => booting.rst} (89%)
rename Documentation/arm/{cluster-pm-race-avoidance.txt => cluster-pm-race-avoidance.rst} (84%)
rename Documentation/arm/{firmware.txt => firmware.rst} (86%)
create mode 100644 Documentation/arm/index.rst
rename Documentation/arm/{Interrupts => interrupts.rst} (81%)
rename Documentation/arm/{IXP4xx => ixp4xx.rst} (84%)
rename Documentation/arm/{kernel_mode_neon.txt => kernel_mode_neon.rst} (99%)
rename Documentation/arm/{kernel_user_helpers.txt => kernel_user_helpers.rst} (78%)
rename Documentation/arm/keystone/{knav-qmss.txt => knav-qmss.rst} (92%)
rename Documentation/arm/keystone/{Overview.txt => overview.rst} (59%)
create mode 100644 Documentation/arm/marvel.rst
rename Documentation/arm/{mem_alignment => mem_alignment.rst} (89%)
rename Documentation/arm/{memory.txt => memory.rst} (90%)
rename Documentation/arm/{Microchip/README => microchip.rst} (92%)
create mode 100644 Documentation/arm/netwinder.rst
create mode 100644 Documentation/arm/nwfpe/index.rst
rename Documentation/arm/nwfpe/{README.FPE => netwinder-fpe.rst} (94%)
rename Documentation/arm/nwfpe/{NOTES => notes.rst} (99%)
rename Documentation/arm/nwfpe/{README => nwfpe.rst} (98%)
rename Documentation/arm/nwfpe/{TODO => todo.rst} (75%)
rename Documentation/arm/{OMAP/DSS => omap/dss.rst} (86%)
create mode 100644 Documentation/arm/omap/index.rst
rename Documentation/arm/{OMAP/README => omap/omap.rst} (62%)
rename Documentation/arm/{OMAP/omap_pm => omap/omap_pm.rst} (83%)
rename Documentation/arm/{Porting => porting.rst} (94%)
rename Documentation/arm/pxa/{mfp.txt => mfp.rst} (83%)
rename Documentation/arm/{SA1100/ADSBitsy => sa1100/adsbitsy.rst} (90%)
rename Documentation/arm/{SA1100/Assabet => sa1100/assabet.rst} (62%)
rename Documentation/arm/{SA1100/Brutus => sa1100/brutus.rst} (75%)
rename Documentation/arm/{SA1100/CERF => sa1100/cerf.rst} (91%)
create mode 100644 Documentation/arm/sa1100/freebird.rst
rename Documentation/arm/{SA1100/GraphicsClient => sa1100/graphicsclient.rst} (87%)
rename Documentation/arm/{SA1100/GraphicsMaster => sa1100/graphicsmaster.rst} (92%)
rename Documentation/arm/{SA1100/HUW_WEBPANEL => sa1100/huw_webpanel.rst} (78%)
create mode 100644 Documentation/arm/sa1100/index.rst
rename Documentation/arm/{SA1100/Itsy => sa1100/itsy.rst} (88%)
rename Documentation/arm/{SA1100/LART => sa1100/lart.rst} (90%)
rename Documentation/arm/{SA1100/nanoEngine => sa1100/nanoengine.rst} (74%)
rename Documentation/arm/{SA1100/Pangolin => sa1100/pangolin.rst} (81%)
rename Documentation/arm/{SA1100/PLEB => sa1100/pleb.rst} (95%)
create mode 100644 Documentation/arm/sa1100/serial_uart.rst
rename Documentation/arm/{SA1100/Tifon => sa1100/tifon.rst} (88%)
rename Documentation/arm/{SA1100/Yopy => sa1100/yopy.rst} (74%)
rename Documentation/arm/{Samsung-S3C24XX/CPUfreq.txt => samsung-s3c24xx/cpufreq.rst} (96%)
rename Documentation/arm/{Samsung-S3C24XX/EB2410ITX.txt => samsung-s3c24xx/eb2410itx.rst} (92%)
rename Documentation/arm/{Samsung-S3C24XX/GPIO.txt => samsung-s3c24xx/gpio.rst} (89%)
rename Documentation/arm/{Samsung-S3C24XX/H1940.txt => samsung-s3c24xx/h1940.rst} (94%)
create mode 100644 Documentation/arm/samsung-s3c24xx/index.rst
rename Documentation/arm/{Samsung-S3C24XX/NAND.txt => samsung-s3c24xx/nand.rst} (92%)
rename Documentation/arm/{Samsung-S3C24XX/Overview.txt => samsung-s3c24xx/overview.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/S3C2412.txt => samsung-s3c24xx/s3c2412.rst} (96%)
rename Documentation/arm/{Samsung-S3C24XX/S3C2413.txt => samsung-s3c24xx/s3c2413.rst} (77%)
rename Documentation/arm/{Samsung-S3C24XX/SMDK2440.txt => samsung-s3c24xx/smdk2440.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/Suspend.txt => samsung-s3c24xx/suspend.rst} (94%)
rename Documentation/arm/{Samsung-S3C24XX/USB-Host.txt => samsung-s3c24xx/usb-host.rst} (94%)
rename Documentation/arm/{Samsung/Bootloader-interface.txt => samsung/bootloader-interface.rst} (72%)
rename Documentation/arm/{Samsung => samsung}/clksrc-change-registers.awk (100%)
rename Documentation/arm/{Samsung/GPIO.txt => samsung/gpio.rst} (87%)
create mode 100644 Documentation/arm/samsung/index.rst
rename Documentation/arm/{Samsung/Overview.txt => samsung/overview.rst} (86%)
rename Documentation/arm/{Setup => setup.rst} (87%)
rename Documentation/arm/{SH-Mobile => sh-mobile}/.gitignore (100%)
rename Documentation/arm/{SPEAr/overview.txt => spear/overview.rst} (91%)
rename Documentation/arm/sti/{overview.txt => overview.rst} (82%)
rename Documentation/arm/sti/{stih407-overview.txt => stih407-overview.rst} (82%)
rename Documentation/arm/sti/{stih415-overview.txt => stih415-overview.rst} (79%)
rename Documentation/arm/sti/{stih416-overview.txt => stih416-overview.rst} (83%)
rename Documentation/arm/sti/{stih418-overview.txt => stih418-overview.rst} (83%)
rename Documentation/arm/{sunxi/README => sunxi.rst} (83%)
rename Documentation/arm/sunxi/{clocks.txt => clocks.rst} (92%)
rename Documentation/arm/{swp_emulation => swp_emulation.rst} (63%)
rename Documentation/arm/{tcm.txt => tcm.rst} (86%)
rename Documentation/arm/{uefi.txt => uefi.rst} (63%)
rename Documentation/arm/{VFP/release-notes.txt => vfp/release-notes.rst} (92%)
rename Documentation/arm/{vlocks.txt => vlocks.rst} (98%)Documentation/arm/Marvell/README deleted +0 -395
@@ -1,395 +0,0 @@ -ARM Marvell SoCs -================ - -This document lists all the ARM Marvell SoCs that are currently -supported in mainline by the Linux kernel. As the Marvell families of -SoCs are large and complex, it is hard to understand where the support -for a particular SoC is available in the Linux kernel. This document -tries to help in understanding where those SoCs are supported, and to -match them with their corresponding public datasheet, when available. - -Orion family ------------- - - Flavors: - 88F5082 - 88F5181 - 88F5181L - 88F5182 - Datasheet : http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf - Programmer's User Guide : http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf - User Manual : http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf - 88F5281 - Datasheet : http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf - 88F6183 - Core: Feroceon 88fr331 (88f51xx) or 88fr531-vd (88f52xx) ARMv5 compatible - Linux kernel mach directory: arch/arm/mach-orion5x - Linux kernel plat directory: arch/arm/plat-orion - -Kirkwood family ---------------- - - Flavors: - 88F6282 a.k.a Armada 300 - Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf - 88F6283 a.k.a Armada 310 - Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf - 88F6190 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf - 88F6192 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf - 88F6182 - 88F6180 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf - 88F6281 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf - Homepage: http://www.marvell.com/embedded-processors/kirkwood/ - Core: Feroceon 88fr131 ARMv5 compatible - Linux kernel mach directory: arch/arm/mach-mvebu - Linux kernel plat directory: none - -Discovery family ----------------- - - Flavors: - MV78100 - Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf - MV78200 - Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf - Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf - Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf - MV76100 - Not supported by the Linux kernel. - - Core: Feroceon 88fr571-vd ARMv5 compatible - - Linux kernel mach directory: arch/arm/mach-mv78xx0 - Linux kernel plat directory: arch/arm/plat-orion - -EBU Armada family ------------------ - - Armada 370 Flavors: - 88F6710 - 88F6707 - 88F6W11 - Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf - Hardware Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf - Functional Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf - Core: Sheeva ARMv7 compatible PJ4B - - Armada 375 Flavors: - 88F6720 - Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf - Core: ARM Cortex-A9 - - Armada 38x Flavors: - 88F6810 Armada 380 - 88F6820 Armada 385 - 88F6828 Armada 388 - Product infos: http://www.marvell.com/embedded-processors/armada-38x/ - Functional Spec: https://marvellcorp.wufoo.com/forms/marvell-armada-38x-functional-specifications/ - Core: ARM Cortex-A9 - - Armada 39x Flavors: - 88F6920 Armada 390 - 88F6928 Armada 398 - Product infos: http://www.marvell.com/embedded-processors/armada-39x/ - Core: ARM Cortex-A9 - - Armada XP Flavors: - MV78230 - MV78260 - MV78460 - NOTE: not to be confused with the non-SMP 78xx0 SoCs - Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf - Functional Spec: http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf - Hardware Specs: - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF - Core: Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP - - Linux kernel mach directory: arch/arm/mach-mvebu - Linux kernel plat directory: none - -EBU Armada family ARMv8 ------------------------ - - Armada 3710/3720 Flavors: - 88F3710 - 88F3720 - Core: ARM Cortex A53 (ARMv8) - - Homepage: http://www.marvell.com/embedded-processors/armada-3700/ - Product Brief: http://www.marvell.com/embedded-processors/assets/PB-88F3700-FNL.pdf - Device tree files: arch/arm64/boot/dts/marvell/armada-37* - - Armada 7K Flavors: - 88F7020 (AP806 Dual + one CP110) - 88F7040 (AP806 Quad + one CP110) - Core: ARM Cortex A72 - - Homepage: http://www.marvell.com/embedded-processors/armada-70xx/ - Product Brief: http://www.marvell.com/embedded-processors/assets/Armada7020PB-Jan2016.pdf - http://www.marvell.com/embedded-processors/assets/Armada7040PB-Jan2016.pdf - Device tree files: arch/arm64/boot/dts/marvell/armada-70* - - Armada 8K Flavors: - 88F8020 (AP806 Dual + two CP110) - 88F8040 (AP806 Quad + two CP110) - Core: ARM Cortex A72 - - Homepage: http://www.marvell.com/embedded-processors/armada-80xx/ - Product Brief: http://www.marvell.com/embedded-processors/assets/Armada8020PB-Jan2016.pdf - http://www.marvell.com/embedded-processors/assets/Armada8040PB-Jan2016.pdf - Device tree files: arch/arm64/boot/dts/marvell/armada-80* - -Avanta family -------------- - - Flavors: - 88F6510 - 88F6530P - 88F6550 - 88F6560 - Homepage : http://www.marvell.com/broadband/ - Product Brief: http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf - No public datasheet available. - - Core: ARMv5 compatible - - Linux kernel mach directory: no code in mainline yet, planned for the future - Linux kernel plat directory: no code in mainline yet, planned for the future - -Storage family --------------- - - Armada SP: - 88RC1580 - Product infos: http://www.marvell.com/storage/armada-sp/ - Core: Sheeva ARMv7 comatible Quad-core PJ4C - (not supported in upstream Linux kernel) - -Dove family (application processor) ------------------------------------ - - Flavors: - 88AP510 a.k.a Armada 510 - Product Brief : http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf - Hardware Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf - Functional Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf - Homepage: http://www.marvell.com/application-processors/armada-500/ - Core: ARMv7 compatible - - Directory: arch/arm/mach-mvebu (DT enabled platforms) - arch/arm/mach-dove (non-DT enabled platforms) - -PXA 2xx/3xx/93x/95x family --------------------------- - - Flavors: - PXA21x, PXA25x, PXA26x - Application processor only - Core: ARMv5 XScale1 core - PXA270, PXA271, PXA272 - Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf - Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf - Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf - Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf - Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf - Application processor only - Core: ARMv5 XScale2 core - PXA300, PXA310, PXA320 - PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf - PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf - PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf - Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf - Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip - Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf - Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip - Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf - Application processor only - Core: ARMv5 XScale3 core - PXA930, PXA935 - Application processor with Communication processor - Core: ARMv5 XScale3 core - PXA955 - Application processor with Communication processor - Core: ARMv7 compatible Sheeva PJ4 core - - Comments: - - * This line of SoCs originates from the XScale family developed by - Intel and acquired by Marvell in ~2006. The PXA21x, PXA25x, - PXA26x, PXA27x, PXA3xx and PXA93x were developed by Intel, while - the later PXA95x were developed by Marvell. - - * Due to their XScale origin, these SoCs have virtually nothing in - common with the other (Kirkwood, Dove, etc.) families of Marvell - SoCs, except with the MMP/MMP2 family of SoCs. - - Linux kernel mach directory: arch/arm/mach-pxa - Linux kernel plat directory: arch/arm/plat-pxa - -MMP/MMP2/MMP3 family (communication processor) ------------------------------------------ - - Flavors: - PXA168, a.k.a Armada 168 - Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp - Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf - Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf - Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf - Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf - Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf - App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf - Application processor only - Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk) - PXA910/PXA920 - Homepage : http://www.marvell.com/communication-processors/pxa910/ - Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf - Application processor with Communication processor - Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk) - PXA688, a.k.a. MMP2, a.k.a Armada 610 - Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf - Application processor only - Core: ARMv7 compatible Sheeva PJ4 88sv581x core - PXA2128, a.k.a. MMP3 (OLPC XO4, Linux support not upstream) - Product Brief : http://www.marvell.com/application-processors/armada/pxa2128/assets/Marvell-ARMADA-PXA2128-SoC-PB.pdf - Application processor only - Core: Dual-core ARMv7 compatible Sheeva PJ4C core - PXA960/PXA968/PXA978 (Linux support not upstream) - Application processor with Communication Processor - Core: ARMv7 compatible Sheeva PJ4 core - PXA986/PXA988 (Linux support not upstream) - Application processor with Communication Processor - Core: Dual-core ARMv7 compatible Sheeva PJ4B-MP core - PXA1088/PXA1920 (Linux support not upstream) - Application processor with Communication Processor - Core: quad-core ARMv7 Cortex-A7 - PXA1908/PXA1928/PXA1936 - Application processor with Communication Processor - Core: multi-core ARMv8 Cortex-A53 - - Comments: - - * This line of SoCs originates from the XScale family developed by - Intel and acquired by Marvell in ~2006. All the processors of - this MMP/MMP2 family were developed by Marvell. - - * Due to their XScale origin, these SoCs have virtually nothing in - common with the other (Kirkwood, Dove, etc.) families of Marvell - SoCs, except with the PXA family of SoCs listed above. - - Linux kernel mach directory: arch/arm/mach-mmp - Linux kernel plat directory: arch/arm/plat-pxa - -Berlin family (Multimedia Solutions) -------------------------------------- - - Flavors: - 88DE3010, Armada 1000 (no Linux support) - Core: Marvell PJ1 (ARMv5TE), Dual-core - Product Brief: http://www.marvell.com.cn/digital-entertainment/assets/armada_1000_pb.pdf - 88DE3005, Armada 1500 Mini - Design name: BG2CD - Core: ARM Cortex-A9, PL310 L2CC - 88DE3006, Armada 1500 Mini Plus - Design name: BG2CDP - Core: Dual Core ARM Cortex-A7 - 88DE3100, Armada 1500 - Design name: BG2 - Core: Marvell PJ4B-MP (ARMv7), Tauros3 L2CC - 88DE3114, Armada 1500 Pro - Design name: BG2Q - Core: Quad Core ARM Cortex-A9, PL310 L2CC - 88DE3214, Armada 1500 Pro 4K - Design name: BG3 - Core: ARM Cortex-A15, CA15 integrated L2CC - 88DE3218, ARMADA 1500 Ultra - Core: ARM Cortex-A53 - - Homepage: https://www.synaptics.com/products/multimedia-solutions - Directory: arch/arm/mach-berlin - - Comments: - - * This line of SoCs is based on Marvell Sheeva or ARM Cortex CPUs - with Synopsys DesignWare (IRQ, GPIO, Timers, ...) and PXA IP (SDHCI, USB, ETH, ...). - - * The Berlin family was acquired by Synaptics from Marvell in 2017. - -CPU Cores ---------- - -The XScale cores were designed by Intel, and shipped by Marvell in the older -PXA processors. Feroceon is a Marvell designed core that developed in-house, -and that evolved into Sheeva. The XScale and Feroceon cores were phased out -over time and replaced with Sheeva cores in later products, which subsequently -got replaced with licensed ARM Cortex-A cores. - - XScale 1 - CPUID 0x69052xxx - ARMv5, iWMMXt - XScale 2 - CPUID 0x69054xxx - ARMv5, iWMMXt - XScale 3 - CPUID 0x69056xxx or 0x69056xxx - ARMv5, iWMMXt - Feroceon-1850 88fr331 "Mohawk" - CPUID 0x5615331x or 0x41xx926x - ARMv5TE, single issue - Feroceon-2850 88fr531-vd "Jolteon" - CPUID 0x5605531x or 0x41xx926x - ARMv5TE, VFP, dual-issue - Feroceon 88fr571-vd "Jolteon" - CPUID 0x5615571x - ARMv5TE, VFP, dual-issue - Feroceon 88fr131 "Mohawk-D" - CPUID 0x5625131x - ARMv5TE, single-issue in-order - Sheeva PJ1 88sv331 "Mohawk" - CPUID 0x561584xx - ARMv5, single-issue iWMMXt v2 - Sheeva PJ4 88sv581x "Flareon" - CPUID 0x560f581x - ARMv7, idivt, optional iWMMXt v2 - Sheeva PJ4B 88sv581x - CPUID 0x561f581x - ARMv7, idivt, optional iWMMXt v2 - Sheeva PJ4B-MP / PJ4C - CPUID 0x562f584x - ARMv7, idivt/idiva, LPAE, optional iWMMXt v2 and/or NEON - -Long-term plans ---------------- - - * Unify the mach-dove/, mach-mv78xx0/, mach-orion5x/ into the - mach-mvebu/ to support all SoCs from the Marvell EBU (Engineering - Business Unit) in a single mach-<foo> directory. The plat-orion/ - would therefore disappear. - - * Unify the mach-mmp/ and mach-pxa/ into the same mach-pxa - directory. The plat-pxa/ would therefore disappear. - -Credits -------- - - Maen Suleiman <[email protected]> - Lior Amsalem <[email protected]> - Thomas Petazzoni <[email protected]> - Andrew Lunn <[email protected]> - Nicolas Pitre <[email protected]> - Eric Miao <[email protected]>
Documentation/arm/Netwinder deleted +0 -78
78 lines not on this page · raw message
Documentation/arm/SA1100/FreeBird deleted +0 -21
@@ -1,21 +0,0 @@ -Freebird-1.1 is produced by Legend(C), Inc. -http://web.archive.org/web/*/http://www.legend.com.cn -and software/linux maintained by Coventive(C), Inc. -(http://www.coventive.com) - -Based on the Nicolas's strongarm kernel tree. - -=============================================================== -Maintainer: - -Chester Kuo <[email protected]> - <[email protected]> - -Author : -Tim wu <[email protected]> -CIH <[email protected]> -Eric Peng <[email protected]> -Jeff Lee <[email protected]> -Allen Cheng -Tony Liu <[email protected]> -
Documentation/arm/SA1100/empeg deleted +0 -2
@@ -1,2 +0,0 @@ -See ../empeg/README -
Documentation/arm/SA1100/serial_UART deleted +0 -47
47 lines not on this page · raw message
Documentation/arm/arm.rst renamed from Documentation/arm/README +30 -20
106 lines not on this page · raw message
Documentation/arm/booting.rst renamed from Documentation/arm/Booting +45 -26
135 lines not on this page · raw message
Documentation/arm/cluster-pm-race-avoidance.rst renamed from Documentation/arm/cluster-pm-race-avoidance.txt +106 -71
321 lines not on this page · raw message
Documentation/arm/firmware.rst renamed from Documentation/arm/firmware.txt +8 -6
@@ -1,5 +1,7 @@ -Interface for registering and calling firmware-specific operations for ARM. ----- +========================================================================== +Interface for registering and calling firmware-specific operations for ARM +========================================================================== + Written by Tomasz Figa <[email protected]> Some boards are running with secure firmware running in TrustZone secure
@@ -9,7 +11,7 @@ operations and call them when needed. Firmware operations can be specified by filling in a struct firmware_ops with appropriate callbacks and then registering it with register_firmware_ops() -function. +function:: void register_firmware_ops(const struct firmware_ops *ops)
@@ -19,7 +21,7 @@ and its members can be found in arch/arm/include/asm/firmware.h header. There is a default, empty set of operations provided, so there is no need to set anything if platform does not require firmware operations. -To call a firmware operation, a helper macro is provided +To call a firmware operation, a helper macro is provided:: #define call_firmware_op(op, ...) \ ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
@@ -28,7 +30,7 @@ the macro checks if the operation is provided and calls it or otherwise returns -ENOSYS to signal that given operation is not available (for example, to allow fallback to legacy operation). -Example of registering firmware operations: +Example of registering firmware operations:: /* board file */
@@ -56,7 +58,7 @@ Example of registering firmware operations: register_firmware_ops(&platformX_firmware_ops); } -Example of using a firmware operation: +Example of using a firmware operation:: /* some platform code, e.g. SMP initialization */
Documentation/arm/index.rst new file +80 -0
80 lines not on this page · raw message
Documentation/arm/interrupts.rst renamed from Documentation/arm/Interrupts +44 -42
141 lines not on this page · raw message
Documentation/arm/ixp4xx.rst renamed from Documentation/arm/IXP4xx +31 -30
135 lines not on this page · raw message
Documentation/arm/kernel_mode_neon.rst renamed from Documentation/arm/kernel_mode_neon.txt +3 -0
@@ -1,3 +1,4 @@ +================ Kernel mode NEON ================
@@ -86,6 +87,7 @@ instructions appearing in unexpected places if no special care is taken. Therefore, the recommended and only supported way of using NEON/VFP in the kernel is by adhering to the following rules: + * isolate the NEON code in a separate compilation unit and compile it with '-march=armv7-a -mfpu=neon -mfloat-abi=softfp'; * issue the calls to kernel_neon_begin(), kernel_neon_end() as well as the calls
@@ -115,6 +117,7 @@ NEON intrinsics NEON intrinsics are also supported. However, as code using NEON intrinsics relies on the GCC header <arm_neon.h>, (which #includes <stdint.h>), you should observe the following in addition to the rules above: + * Compile the unit containing the NEON intrinsics with '-ffreestanding' so GCC uses its builtin version of <stdint.h> (this is a C99 header which the kernel does not supply);
Documentation/arm/kernel_user_helpers.rst renamed from Documentation/arm/kernel_user_helpers.txt +40 -39
175 lines not on this page · raw message
Documentation/arm/keystone/knav-qmss.rst renamed from Documentation/arm/keystone/knav-qmss.txt +5 -1
@@ -1,4 +1,6 @@ -* Texas Instruments Keystone Navigator Queue Management SubSystem driver +====================================================================== +Texas Instruments Keystone Navigator Queue Management SubSystem driver +====================================================================== Driver source code path drivers/soc/ti/knav_qmss.c
@@ -34,11 +36,13 @@ driver that interface with the accumulator PDSP. This configures accumulator channels defined in DTS (example in DT documentation) to monitor 1 or 32 queues per channel. More description on the firmware is available in CPPI/QMSS Low Level Driver document (docs/CPPI_QMSS_LLD_SDS.pdf) at + git://git.ti.com/keystone-rtos/qmss-lld.git k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin firmware supports upto 48 accumulator channels. This firmware is available under ti-keystone folder of firmware.git at + git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git To use copy the firmware image to lib/firmware folder of the initramfs or
Documentation/arm/keystone/overview.rst renamed from Documentation/arm/keystone/Overview.txt +33 -14
85 lines not on this page · raw message
Documentation/arm/marvel.rst new file +488 -0
488 lines not on this page · raw message
Documentation/arm/mem_alignment.rst renamed from Documentation/arm/mem_alignment +8 -3
@@ -1,3 +1,7 @@ +================ +Memory alignment +================ + Too many problems popped up because of unnoticed misaligned memory access in kernel code lately. Therefore the alignment fixup is now unconditionally configured in for SA11x0 based targets. According to Alan Cox, this is a
@@ -26,9 +30,9 @@ space, and might cause programs to fail unexpectedly. To change the alignment trap behavior, simply echo a number into /proc/cpu/alignment. The number is made up from various bits: +=== ======================================================== bit behavior when set ---- ----------------- - +=== ======================================================== 0 A user process performing an unaligned memory access will cause the kernel to print a message indicating process name, pid, pc, instruction, address, and the
@@ -41,12 +45,13 @@ bit behavior when set 2 The kernel will send a SIGBUS signal to the user process performing the unaligned access. +=== ======================================================== Note that not all combinations are supported - only values 0 through 5. (6 and 7 don't make sense). For example, the following will turn on the warnings, but without -fixing up or sending SIGBUS signals: +fixing up or sending SIGBUS signals:: echo 1 > /proc/cpu/alignment
Documentation/arm/memory.rst renamed from Documentation/arm/memory.txt +7 -2
@@ -1,6 +1,9 @@ - Kernel Memory Layout on ARM Linux +================================= +Kernel Memory Layout on ARM Linux +================================= Russell King <[email protected]> + November 17, 2005 (2.6.15) This document describes the virtual memory layout which the Linux
@@ -15,8 +18,9 @@ As the ARM architecture matures, it becomes necessary to reserve certain regions of VM space for use for new facilities; therefore this document may reserve more VM space over time. +=============== =============== =============================================== Start End Use --------------------------------------------------------------------------- +=============== =============== =============================================== ffff8000 ffffffff copy_user_page / clear_user_page use. For SA11xx and Xscale, this is used to setup a minicache mapping.
@@ -77,6 +81,7 @@ MODULES_VADDR MODULES_END-1 Kernel module space place their vector page here. NULL pointer dereferences by both the kernel and user space are also caught via this mapping. +=============== =============== =============================================== Please note that mappings which collide with the above areas may result in a non-bootable kernel, or may cause the kernel to (eventually) panic
Documentation/arm/microchip.rst renamed from Documentation/arm/Microchip/README +49 -14
160 lines not on this page · raw message
Documentation/arm/netwinder.rst new file +85 -0
85 lines not on this page · raw message
Documentation/arm/nwfpe/index.rst new file +11 -0
@@ -0,0 +1,11 @@ +=================================== +NetWinder's floating point emulator +=================================== + +.. toctree:: + :maxdepth: 1 + + nwfpe + netwinder-fpe + notes + todo
Documentation/arm/nwfpe/netwinder-fpe.rst renamed from Documentation/arm/nwfpe/README.FPE +15 -9
@@ -1,12 +1,18 @@ +============= +Current State +============= + The following describes the current state of the NetWinder's floating point emulator. In the following nomenclature is used to describe the floating point instructions. It follows the conventions in the ARM manual. -<S|D|E> = <single|double|extended>, no default -{P|M|Z} = {round to +infinity,round to -infinity,round to zero}, - default = round to nearest +:: + + <S|D|E> = <single|double|extended>, no default + {P|M|Z} = {round to +infinity,round to -infinity,round to zero}, + default = round to nearest Note: items enclosed in {} are optional.
@@ -32,10 +38,10 @@ Form 2 syntax: <LFM|SFM>{cond}<FD,EA> Fd, <count>, [Rn]{!} These instructions are fully implemented. They store/load three words -for each floating point register into the memory location given in the +for each floating point register into the memory location given in the instruction. The format in memory is unlikely to be compatible with other implementations, in particular the actual hardware. Specific -mention of this is made in the ARM manuals. +mention of this is made in the ARM manuals. Floating Point Coprocessor Register Transfer Instructions (CPRT) ----------------------------------------------------------------
@@ -123,7 +129,7 @@ RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2) LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10 -LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e +LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
@@ -134,7 +140,7 @@ ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent These are not implemented. They are not currently issued by the compiler, and are handled by routines in libc. These are not implemented by the FPA11 -hardware, but are handled by the floating point support code. They should +hardware, but are handled by the floating point support code. They should be implemented in future versions. Signalling:
@@ -147,10 +153,10 @@ current_set[0] correctly. The kernel provided with this distribution (vmlinux-nwfpe-0.93) contains a fix for this problem and also incorporates the current version of the emulator directly. It is possible to run with no floating point module -loaded with this kernel. It is provided as a demonstration of the +loaded with this kernel. It is provided as a demonstration of the technology and for those who want to do floating point work that depends on signals. It is not strictly necessary to use the module. -A module (either the one provided by Russell King, or the one in this +A module (either the one provided by Russell King, or the one in this distribution) can be loaded to replace the functionality of the emulator built into the kernel.
Documentation/arm/nwfpe/notes.rst renamed from Documentation/arm/nwfpe/NOTES +3 -0
@@ -1,3 +1,6 @@ +Notes +===== + There seems to be a problem with exp(double) and our emulator. I haven't been able to track it down yet. This does not occur with the emulator supplied by Russell King.
Documentation/arm/nwfpe/nwfpe.rst renamed from Documentation/arm/nwfpe/README +7 -3
@@ -1,4 +1,7 @@ -This directory contains the version 0.92 test release of the NetWinder +Introduction +============ + +This directory contains the version 0.92 test release of the NetWinder Floating Point Emulator. The majority of the code was written by me, Scott Bambrough It is
@@ -31,7 +34,7 @@ SoftFloat to the ARM was done by Phil Blundell, based on an earlier port of SoftFloat version 1 by Neil Carson for NetBSD/arm32. The file README.FPE contains a description of what has been implemented -so far in the emulator. The file TODO contains a information on what +so far in the emulator. The file TODO contains a information on what remains to be done, and other ideas for the emulator. Bug reports, comments, suggestions should be directed to me at
@@ -48,10 +51,11 @@ Legal Notices The NetWinder Floating Point Emulator is free software. Everything Rebel.com has written is provided under the GNU GPL. See the file COPYING for copying -conditions. Excluded from the above is the SoftFloat code. John Hauser's +conditions. Excluded from the above is the SoftFloat code. John Hauser's legal notice for SoftFloat is included below. ------------------------------------------------------------------------------- + SoftFloat Legal Notice SoftFloat was written by John R. Hauser. This work was made possible in
Documentation/arm/nwfpe/todo.rst renamed from Documentation/arm/nwfpe/TODO +26 -21
84 lines not on this page · raw message
Documentation/arm/omap/dss.rst renamed from Documentation/arm/OMAP/DSS +61 -51
167 lines not on this page · raw message
Documentation/arm/omap/index.rst new file +10 -0
@@ -0,0 +1,10 @@ +======= +TI OMAP +======= + +.. toctree:: + :maxdepth: 1 + + omap.rst + omap_pm.rst + dss.rst
Documentation/arm/omap/omap.rst renamed from Documentation/arm/OMAP/README +7 -0
@@ -1,7 +1,13 @@ +============ +OMAP history +============ + This file contains documentation for running mainline kernel on omaps. +====== ====================================================== KERNEL NEW DEPENDENCIES +====== ====================================================== v4.3+ Update is needed for custom .config files to make sure CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work properly.
@@ -9,3 +15,4 @@ v4.3+ Update is needed for custom .config files to make sure v4.18+ Update is needed for custom .config files to make sure CONFIG_MMC_SDHCI_OMAP is enabled for all MMC instances to work in DRA7 and K2G based boards. +====== ======================================================
Documentation/arm/omap/omap_pm.rst renamed from Documentation/arm/OMAP/omap_pm +33 -22
24 lines not on this page · raw message
Documentation/arm/porting.rst renamed from Documentation/arm/Porting +8 -6
Lines of this file are not shown. View the raw message.
Documentation/arm/pxa/mfp.rst renamed from Documentation/arm/pxa/mfp.txt +54 -52
106 lines not on this page · raw message
Documentation/arm/sa1100/adsbitsy.rst renamed from Documentation/arm/SA1100/ADSBitsy +11 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/assabet.rst renamed from Documentation/arm/SA1100/Assabet +93 -92
185 lines not on this page · raw message
Documentation/arm/sa1100/brutus.rst renamed from Documentation/arm/SA1100/Brutus +24 -21
45 lines not on this page · raw message
Documentation/arm/sa1100/cerf.rst renamed from Documentation/arm/SA1100/CERF +8 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/freebird.rst new file +25 -0
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/graphicsclient.rst renamed from Documentation/arm/SA1100/GraphicsClient +25 -21
46 lines not on this page · raw message
Documentation/arm/sa1100/graphicsmaster.rst renamed from Documentation/arm/SA1100/GraphicsMaster +10 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/huw_webpanel.rst renamed from Documentation/arm/SA1100/HUW_WEBPANEL +6 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/index.rst new file +23 -0
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/itsy.rst renamed from Documentation/arm/SA1100/Itsy +11 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/lart.rst renamed from Documentation/arm/SA1100/LART +2 -1
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/nanoengine.rst renamed from Documentation/arm/SA1100/nanoEngine +3 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/pangolin.rst renamed from Documentation/arm/SA1100/Pangolin +8 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/pleb.rst renamed from Documentation/arm/SA1100/PLEB +4 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/serial_uart.rst new file +51 -0
51 lines not on this page · raw message
Documentation/arm/sa1100/tifon.rst renamed from Documentation/arm/SA1100/Tifon +2 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sa1100/yopy.rst renamed from Documentation/arm/SA1100/Yopy +4 -1
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/cpufreq.rst renamed from Documentation/arm/Samsung-S3C24XX/CPUfreq.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/eb2410itx.rst renamed from Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/gpio.rst renamed from Documentation/arm/Samsung-S3C24XX/GPIO.txt +12 -11
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/h1940.rst renamed from Documentation/arm/Samsung-S3C24XX/H1940.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/index.rst new file +18 -0
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/nand.rst renamed from Documentation/arm/Samsung-S3C24XX/NAND.txt +3 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/overview.rst renamed from Documentation/arm/Samsung-S3C24XX/Overview.txt +11 -10
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/s3c2412.rst renamed from Documentation/arm/Samsung-S3C24XX/S3C2412.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/s3c2413.rst renamed from Documentation/arm/Samsung-S3C24XX/S3C2413.txt +4 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/smdk2440.rst renamed from Documentation/arm/Samsung-S3C24XX/SMDK2440.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/suspend.rst renamed from Documentation/arm/Samsung-S3C24XX/Suspend.txt +10 -10
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung-s3c24xx/usb-host.rst renamed from Documentation/arm/Samsung-S3C24XX/USB-Host.txt +7 -9
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung/bootloader-interface.rst renamed from Documentation/arm/Samsung/Bootloader-interface.txt +20 -7
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung/clksrc-change-registers.awk renamed from Documentation/arm/Samsung/clksrc-change-registers.awk +0 -0
Documentation/arm/samsung/gpio.rst renamed from Documentation/arm/Samsung/GPIO.txt +4 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung/index.rst new file +10 -0
Lines of this file are not shown. View the raw message.
Documentation/arm/samsung/overview.rst renamed from Documentation/arm/Samsung/Overview.txt +9 -6
Lines of this file are not shown. View the raw message.
Documentation/arm/setup.rst renamed from Documentation/arm/Setup +14 -35
49 lines not on this page · raw message
Documentation/arm/sh-mobile/.gitignore renamed from Documentation/arm/SH-Mobile/.gitignore +0 -0
Documentation/arm/spear/overview.rst renamed from Documentation/arm/SPEAr/overview.txt +11 -9
Lines of this file are not shown. View the raw message.
Documentation/arm/sti/overview.rst renamed from Documentation/arm/sti/overview.txt +12 -9
Lines of this file are not shown. View the raw message.
Documentation/arm/sti/stih407-overview.rst renamed from Documentation/arm/sti/stih407-overview.txt +5 -4
Lines of this file are not shown. View the raw message.
Documentation/arm/sti/stih415-overview.rst renamed from Documentation/arm/sti/stih415-overview.txt +5 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/sti/stih416-overview.rst renamed from Documentation/arm/sti/stih416-overview.txt +3 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sti/stih418-overview.rst renamed from Documentation/arm/sti/stih418-overview.txt +5 -4
Lines of this file are not shown. View the raw message.
Documentation/arm/stm32/stm32f429-overview.rst +2 -5
Lines of this file are not shown. View the raw message.
Documentation/arm/stm32/stm32f746-overview.rst +2 -5
Lines of this file are not shown. View the raw message.
Documentation/arm/stm32/stm32f769-overview.rst +2 -5
Lines of this file are not shown. View the raw message.
Documentation/arm/stm32/stm32h743-overview.rst +2 -5
Lines of this file are not shown. View the raw message.
Documentation/arm/stm32/stm32mp157-overview.rst +1 -2
Lines of this file are not shown. View the raw message.
Documentation/arm/sunxi.rst renamed from Documentation/arm/sunxi/README +73 -25
98 lines not on this page · raw message
Documentation/arm/sunxi/clocks.rst renamed from Documentation/arm/sunxi/clocks.txt +4 -3
Lines of this file are not shown. View the raw message.
Documentation/arm/swp_emulation.rst renamed from Documentation/arm/swp_emulation +12 -12
Lines of this file are not shown. View the raw message.
Documentation/arm/tcm.rst renamed from Documentation/arm/tcm.txt +30 -24
54 lines not on this page · raw message
Documentation/arm/uefi.rst renamed from Documentation/arm/uefi.txt +23 -16
Lines of this file are not shown. View the raw message.
Documentation/arm/vfp/release-notes.rst renamed from Documentation/arm/VFP/release-notes.txt +3 -1
Lines of this file are not shown. View the raw message.
Documentation/arm/vlocks.rst renamed from Documentation/arm/vlocks.txt +5 -4
Lines of this file are not shown. View the raw message.
Documentation/devicetree/bindings/arm/xen.txt +1 -1
Lines of this file are not shown. View the raw message.
Documentation/devicetree/booting-without-of.txt +2 -2
Lines of this file are not shown. View the raw message.
Documentation/translations/zh_CN/arm/Booting +2 -2
Lines of this file are not shown. View the raw message.
Documentation/translations/zh_CN/arm/kernel_user_helpers.txt +2 -2
Lines of this file are not shown. View the raw message.
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/crypto/sunxi-ss/sun4i-ss-core.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/crypto/sunxi-ss/sun4i-ss-hash.c +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.0
Part of the diff is not shown here. View the raw message.
PATCH 11/31 docs: memory-devices: convert ti-emif.txt to ReST
In reply to Mauro Carvalho ChehabPrepare this file to be moved to a kernel book by converting it to ReST format and renaming it to ti-emif.rst.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
.../{ti-emif.txt => ti-emif.rst} | 27 ++++++++++++-------
1 file changed, 17 insertions(+), 10 deletions(-)
rename Documentation/memory-devices/{ti-emif.txt => ti-emif.rst} (81%)Documentation/memory-devices/ti-emif.rst renamed from Documentation/memory-devices/ti-emif.txt +17 -10
@@ -1,20 +1,24 @@ -TI EMIF SDRAM Controller Driver: +:orphan: + +=============================== +TI EMIF SDRAM Controller Driver +=============================== Author -======== +====== Aneesh V <[email protected]> Location -============ +======== driver/memory/emif.c Supported SoCs: -=================== +=============== TI OMAP44xx TI OMAP54xx Menuconfig option: -========================== +================== Device Drivers Memory devices Texas Instruments EMIF driver
@@ -29,10 +33,11 @@ functions of the driver includes re-configuring AC timing parameters and other settings during frequency, voltage and temperature changes -Platform Data (see include/linux/platform_data/emif_plat.h): -===================================================================== +Platform Data (see include/linux/platform_data/emif_plat.h) +=========================================================== DDR device details and other board dependent and SoC dependent information can be passed through platform data (struct emif_platform_data) + - DDR device details: 'struct ddr_device_info' - Device AC timings: 'struct lpddr2_timings' and 'struct lpddr2_min_tck' - Custom configurations: customizable policy options through
@@ -40,17 +45,19 @@ information can be passed through platform data (struct emif_platform_data) - IP revision - PHY type -Interface to the external world: -================================ +Interface to the external world +=============================== EMIF driver registers notifiers for voltage and frequency changes affecting EMIF and takes appropriate actions when these are invoked. + - freq_pre_notify_handling() - freq_post_notify_handling() - volt_notify_handling() Debugfs -======== +======= The driver creates two debugfs entries per device. + - regcache_dump : dump of register values calculated and saved for all frequencies used so far. - mr4 : last polled value of MR4 register in the LPDDR2 device. MR4
Signature · 1 line
2.21.0
PATCH 12/31 docs: xen-tpmfront.txt: convert it to .rst
In reply to Mauro Carvalho ChehabIn order to be able to add this file to the security book, we need first to convert it to reST.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
.../{xen-tpmfront.txt => xen-tpmfront.rst} | 103 ++++++++++--------
1 file changed, 58 insertions(+), 45 deletions(-)
rename Documentation/security/tpm/{xen-tpmfront.txt => xen-tpmfront.rst} (66%)Documentation/security/tpm/xen-tpmfront.rst renamed from Documentation/security/tpm/xen-tpmfront.txt +58 -45
@@ -1,4 +1,8 @@ +:orphan: + +============================= Virtual TPM interface for Xen +============================= Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)
@@ -6,7 +10,8 @@ This document describes the virtual Trusted Platform Module (vTPM) subsystem for Xen. The reader is assumed to have familiarity with building and installing Xen, Linux, and a basic understanding of the TPM and vTPM concepts. -INTRODUCTION +Introduction +------------ The goal of this work is to provide a TPM functionality to a virtual guest operating system (in Xen terms, a DomU). This allows programs to interact with
@@ -24,81 +29,89 @@ This mini-os vTPM subsystem was built on top of the previous vTPM work done by IBM and Intel corporation. -DESIGN OVERVIEW +Design Overview --------------- -The architecture of vTPM is described below: +The architecture of vTPM is described below:: -+------------------+ -| Linux DomU | ... -| | ^ | -| v | | -| xen-tpmfront | -+------------------+ - | ^ - v | -+------------------+ -| mini-os/tpmback | -| | ^ | -| v | | -| vtpm-stubdom | ... -| | ^ | -| v | | -| mini-os/tpmfront | -+------------------+ - | ^ - v | -+------------------+ -| mini-os/tpmback | -| | ^ | -| v | | -| vtpmmgr-stubdom | -| | ^ | -| v | | -| mini-os/tpm_tis | -+------------------+ - | ^ - v | -+------------------+ -| Hardware TPM | -+------------------+ + +------------------+ + | Linux DomU | ... + | | ^ | + | v | | + | xen-tpmfront | + +------------------+ + | ^ + v | + +------------------+ + | mini-os/tpmback | + | | ^ | + | v | | + | vtpm-stubdom | ... + | | ^ | + | v | | + | mini-os/tpmfront | + +------------------+ + | ^ + v | + +------------------+ + | mini-os/tpmback | + | | ^ | + | v | | + | vtpmmgr-stubdom | + | | ^ | + | v | | + | mini-os/tpm_tis | + +------------------+ + | ^ + v | + +------------------+ + | Hardware TPM | + +------------------+ - * Linux DomU: The Linux based guest that wants to use a vTPM. There may be +* Linux DomU: + The Linux based guest that wants to use a vTPM. There may be more than one of these. - * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver +* xen-tpmfront.ko: + Linux kernel virtual TPM frontend driver. This driver provides vTPM access to a Linux-based DomU. - * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver +* mini-os/tpmback: + Mini-os TPM backend driver. The Linux frontend driver connects to this backend driver to facilitate communications between the Linux DomU and its vTPM. This driver is also used by vtpmmgr-stubdom to communicate with vtpm-stubdom. - * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a +* vtpm-stubdom: + A mini-os stub domain that implements a vTPM. There is a one to one mapping between running vtpm-stubdom instances and logical vtpms on the system. The vTPM Platform Configuration Registers (PCRs) are normally all initialized to zero. - * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain +* mini-os/tpmfront: + Mini-os TPM frontend driver. The vTPM mini-os domain vtpm-stubdom uses this driver to communicate with vtpmmgr-stubdom. This driver is also used in mini-os domains such as pv-grub that talk to the vTPM domain. - * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager. There is +* vtpmmgr-stubdom: + A mini-os domain that implements the vTPM manager. There is only one vTPM manager and it should be running during the entire lifetime of the machine. This domain regulates access to the physical TPM on the system and secures the persistent state of each vTPM. - * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS) +* mini-os/tpm_tis: + Mini-os TPM version 1.2 TPM Interface Specification (TIS) driver. This driver used by vtpmmgr-stubdom to talk directly to the hardware TPM. Communication is facilitated by mapping hardware memory pages into vtpmmgr-stubdom. - * Hardware TPM: The physical TPM that is soldered onto the motherboard. +* Hardware TPM: + The physical TPM that is soldered onto the motherboard. -INTEGRATION WITH XEN +Integration With Xen -------------------- Support for the vTPM driver was added in Xen using the libxl toolstack in Xen
Signature · 1 line
2.21.0
PATCH 13/31 docs: bus-devices: ti-gpmc.rst: convert it to ReST
In reply to Mauro Carvalho ChehabIn order to be able to add this file to a book, it needs first to be converted to ReST and renamed.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
.../bus-devices/{ti-gpmc.txt => ti-gpmc.rst} | 159 ++++++++++++------
1 file changed, 108 insertions(+), 51 deletions(-)
rename Documentation/bus-devices/{ti-gpmc.txt => ti-gpmc.rst} (58%)Documentation/bus-devices/ti-gpmc.rst renamed from Documentation/bus-devices/ti-gpmc.txt +108 -51
@@ -1,8 +1,12 @@ -GPMC (General Purpose Memory Controller): -========================================= +:orphan: + +======================================== +GPMC (General Purpose Memory Controller) +======================================== GPMC is an unified memory controller dedicated to interfacing external memory devices like + * Asynchronous SRAM like memories and application specific integrated circuit devices. * Asynchronous, synchronous, and page mode burst NOR flash devices
@@ -48,75 +52,128 @@ most of the datasheets & hardware (to be exact none of those supported in mainline having custom timing routine) and by simulation. gpmc timing dependency on peripheral timings: + [<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...] 1. common -cs_on: t_ceasu -adv_on: t_avdasu, t_ceavd + +cs_on: + t_ceasu +adv_on: + t_avdasu, t_ceavd 2. sync common -sync_clk: clk -page_burst_access: t_bacc -clk_activation: t_ces, t_avds + +sync_clk: + clk +page_burst_access: + t_bacc +clk_activation: + t_ces, t_avds 3. read async muxed -adv_rd_off: t_avdp_r -oe_on: t_oeasu, t_aavdh -access: t_iaa, t_oe, t_ce, t_aa -rd_cycle: t_rd_cycle, t_cez_r, t_oez + +adv_rd_off: + t_avdp_r +oe_on: + t_oeasu, t_aavdh +access: + t_iaa, t_oe, t_ce, t_aa +rd_cycle: + t_rd_cycle, t_cez_r, t_oez 4. read async non-muxed -adv_rd_off: t_avdp_r -oe_on: t_oeasu -access: t_iaa, t_oe, t_ce, t_aa -rd_cycle: t_rd_cycle, t_cez_r, t_oez + +adv_rd_off: + t_avdp_r +oe_on: + t_oeasu +access: + t_iaa, t_oe, t_ce, t_aa +rd_cycle: + t_rd_cycle, t_cez_r, t_oez 5. read sync muxed -adv_rd_off: t_avdp_r, t_avdh -oe_on: t_oeasu, t_ach, cyc_aavdh_oe -access: t_iaa, cyc_iaa, cyc_oe -rd_cycle: t_cez_r, t_oez, t_ce_rdyz + +adv_rd_off: + t_avdp_r, t_avdh +oe_on: + t_oeasu, t_ach, cyc_aavdh_oe +access: + t_iaa, cyc_iaa, cyc_oe +rd_cycle: + t_cez_r, t_oez, t_ce_rdyz 6. read sync non-muxed -adv_rd_off: t_avdp_r -oe_on: t_oeasu -access: t_iaa, cyc_iaa, cyc_oe -rd_cycle: t_cez_r, t_oez, t_ce_rdyz + +adv_rd_off: + t_avdp_r +oe_on: + t_oeasu +access: + t_iaa, cyc_iaa, cyc_oe +rd_cycle: + t_cez_r, t_oez, t_ce_rdyz 7. write async muxed -adv_wr_off: t_avdp_w -we_on, wr_data_mux_bus: t_weasu, t_aavdh, cyc_aavhd_we -we_off: t_wpl -cs_wr_off: t_wph -wr_cycle: t_cez_w, t_wr_cycle + +adv_wr_off: + t_avdp_w +we_on, wr_data_mux_bus: + t_weasu, t_aavdh, cyc_aavhd_we +we_off: + t_wpl +cs_wr_off: + t_wph +wr_cycle: + t_cez_w, t_wr_cycle 8. write async non-muxed -adv_wr_off: t_avdp_w -we_on, wr_data_mux_bus: t_weasu -we_off: t_wpl -cs_wr_off: t_wph -wr_cycle: t_cez_w, t_wr_cycle + +adv_wr_off: + t_avdp_w +we_on, wr_data_mux_bus: + t_weasu +we_off: + t_wpl +cs_wr_off: + t_wph +wr_cycle: + t_cez_w, t_wr_cycle 9. write sync muxed -adv_wr_off: t_avdp_w, t_avdh -we_on, wr_data_mux_bus: t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we -we_off: t_wpl, cyc_wpl -cs_wr_off: t_wph -wr_cycle: t_cez_w, t_ce_rdyz + +adv_wr_off: + t_avdp_w, t_avdh +we_on, wr_data_mux_bus: + t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we +we_off: + t_wpl, cyc_wpl +cs_wr_off: + t_wph +wr_cycle: + t_cez_w, t_ce_rdyz 10. write sync non-muxed -adv_wr_off: t_avdp_w -we_on, wr_data_mux_bus: t_weasu, t_rdyo -we_off: t_wpl, cyc_wpl -cs_wr_off: t_wph -wr_cycle: t_cez_w, t_ce_rdyz +adv_wr_off: + t_avdp_w +we_on, wr_data_mux_bus: + t_weasu, t_rdyo +we_off: + t_wpl, cyc_wpl +cs_wr_off: + t_wph +wr_cycle: + t_cez_w, t_ce_rdyz -Note: Many of gpmc timings are dependent on other gpmc timings (a few -gpmc timings purely dependent on other gpmc timings, a reason that -some of the gpmc timings are missing above), and it will result in -indirect dependency of peripheral timings to gpmc timings other than -mentioned above, refer timing routine for more details. To know what -these peripheral timings correspond to, please see explanations in -struct gpmc_device_timings definition. And for gpmc timings refer -IP details (link above). + +Note: + Many of gpmc timings are dependent on other gpmc timings (a few + gpmc timings purely dependent on other gpmc timings, a reason that + some of the gpmc timings are missing above), and it will result in + indirect dependency of peripheral timings to gpmc timings other than + mentioned above, refer timing routine for more details. To know what + these peripheral timings correspond to, please see explanations in + struct gpmc_device_timings definition. And for gpmc timings refer + IP details (link above).
Signature · 1 line
2.21.0
PATCH 14/31 docs: nvmem: convert docs to ReST and rename to *.rst
In reply to Mauro Carvalho ChehabIn order to be able to add it into a doc book, we need first convert it to ReST.
The conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- mark literal blocks;
- adjust title markups.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
Documentation/nvmem/{nvmem.txt => nvmem.rst} | 112 ++++++++++---------
1 file changed, 59 insertions(+), 53 deletions(-)
rename Documentation/nvmem/{nvmem.txt => nvmem.rst} (62%)Documentation/nvmem/nvmem.rst renamed from Documentation/nvmem/nvmem.txt +59 -53
@@ -1,5 +1,10 @@ - NVMEM SUBSYSTEM - Srinivas Kandagatla <[email protected]> +:orphan: + +=============== +NVMEM Subsystem +=============== + + Srinivas Kandagatla <[email protected]> This document explains the NVMEM Framework along with the APIs provided, and how to use it.
@@ -40,54 +45,54 @@ nvmem_device pointer. nvmem_unregister(nvmem) is used to unregister a previously registered provider. -For example, a simple qfprom case: +For example, a simple qfprom case:: -static struct nvmem_config econfig = { + static struct nvmem_config econfig = { .name = "qfprom", .owner = THIS_MODULE, -}; + }; -static int qfprom_probe(struct platform_device *pdev) -{ + static int qfprom_probe(struct platform_device *pdev) + { ... econfig.dev = &pdev->dev; nvmem = nvmem_register(&econfig); ... -} + } It is mandatory that the NVMEM provider has a regmap associated with its struct device. Failure to do would return error code from nvmem_register(). Users of board files can define and register nvmem cells using the -nvmem_cell_table struct: +nvmem_cell_table struct:: -static struct nvmem_cell_info foo_nvmem_cells[] = { + static struct nvmem_cell_info foo_nvmem_cells[] = { { .name = "macaddr", .offset = 0x7f00, .bytes = ETH_ALEN, } -}; + }; -static struct nvmem_cell_table foo_nvmem_cell_table = { + static struct nvmem_cell_table foo_nvmem_cell_table = { .nvmem_name = "i2c-eeprom", .cells = foo_nvmem_cells, .ncells = ARRAY_SIZE(foo_nvmem_cells), -}; + }; -nvmem_add_cell_table(&foo_nvmem_cell_table); + nvmem_add_cell_table(&foo_nvmem_cell_table); Additionally it is possible to create nvmem cell lookup entries and register -them with the nvmem framework from machine code as shown in the example below: +them with the nvmem framework from machine code as shown in the example below:: -static struct nvmem_cell_lookup foo_nvmem_lookup = { + static struct nvmem_cell_lookup foo_nvmem_lookup = { .nvmem_name = "i2c-eeprom", .cell_name = "macaddr", .dev_id = "foo_mac.0", .con_id = "mac-address", -}; + }; -nvmem_add_cell_lookups(&foo_nvmem_lookup, 1); + nvmem_add_cell_lookups(&foo_nvmem_lookup, 1); NVMEM Consumers +++++++++++++++
@@ -99,43 +104,43 @@ read from and to NVMEM. ================================= NVMEM cells are the data entries/fields in the NVMEM. -The NVMEM framework provides 3 APIs to read/write NVMEM cells. +The NVMEM framework provides 3 APIs to read/write NVMEM cells:: -struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *name); -struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *name); + struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *name); + struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *name); -void nvmem_cell_put(struct nvmem_cell *cell); -void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); + void nvmem_cell_put(struct nvmem_cell *cell); + void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); -void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len); -int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); + void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len); + int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); -*nvmem_cell_get() apis will get a reference to nvmem cell for a given id, +`*nvmem_cell_get()` apis will get a reference to nvmem cell for a given id, and nvmem_cell_read/write() can then read or write to the cell. -Once the usage of the cell is finished the consumer should call *nvmem_cell_put() -to free all the allocation memory for the cell. +Once the usage of the cell is finished the consumer should call +`*nvmem_cell_put()` to free all the allocation memory for the cell. 4. Direct NVMEM device based consumer APIs ========================================== In some instances it is necessary to directly read/write the NVMEM. -To facilitate such consumers NVMEM framework provides below apis. +To facilitate such consumers NVMEM framework provides below apis:: -struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); -struct nvmem_device *devm_nvmem_device_get(struct device *dev, + struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); + struct nvmem_device *devm_nvmem_device_get(struct device *dev, const char *name); -void nvmem_device_put(struct nvmem_device *nvmem); -int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, + void nvmem_device_put(struct nvmem_device *nvmem); + int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, size_t bytes, void *buf); -int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, + int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, size_t bytes, void *buf); -int nvmem_device_cell_read(struct nvmem_device *nvmem, + int nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); -int nvmem_device_cell_write(struct nvmem_device *nvmem, + int nvmem_device_cell_write(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); Before the consumers can read/write NVMEM directly, it should get hold -of nvmem_controller from one of the *nvmem_device_get() api. +of nvmem_controller from one of the `*nvmem_device_get()` api. The difference between these apis and cell based apis is that these apis always take nvmem_device as parameter.
@@ -145,12 +150,12 @@ take nvmem_device as parameter. When a consumer no longer needs the NVMEM, it has to release the reference to the NVMEM it has obtained using the APIs mentioned in the above section. -The NVMEM framework provides 2 APIs to release a reference to the NVMEM. +The NVMEM framework provides 2 APIs to release a reference to the NVMEM:: -void nvmem_cell_put(struct nvmem_cell *cell); -void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); -void nvmem_device_put(struct nvmem_device *nvmem); -void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem); + void nvmem_cell_put(struct nvmem_cell *cell); + void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); + void nvmem_device_put(struct nvmem_device *nvmem); + void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem); Both these APIs are used to release a reference to the NVMEM and devm_nvmem_cell_put and devm_nvmem_device_put destroys the devres associated
@@ -162,20 +167,21 @@ Userspace 6. Userspace binary interface ============================== -Userspace can read/write the raw NVMEM file located at -/sys/bus/nvmem/devices/*/nvmem +Userspace can read/write the raw NVMEM file located at:: -ex: + /sys/bus/nvmem/devices/*/nvmem -hexdump /sys/bus/nvmem/devices/qfprom0/nvmem +ex:: -0000000 0000 0000 0000 0000 0000 0000 0000 0000 -* -00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00 -0000000 0000 0000 0000 0000 0000 0000 0000 0000 -... -* -0001000 + hexdump /sys/bus/nvmem/devices/qfprom0/nvmem + + 0000000 0000 0000 0000 0000 0000 0000 0000 0000 + * + 00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00 + 0000000 0000 0000 0000 0000 0000 0000 0000 0000 + ... + * + 0001000 7. DeviceTree Binding =====================
Signature · 1 line
2.21.0
PATCH 15/31 docs: phy: convert samsung-usb2.txt to ReST format
In reply to Mauro Carvalho ChehabIn order to merge it into a Sphinx book, we need first to convert to ReST.
While this is not part of any book, mark it as :orphan:, in order to avoid build warnings.
---
.../{samsung-usb2.txt => samsung-usb2.rst} | 62 ++++++++++---------
MAINTAINERS | 2 +-
2 files changed, 34 insertions(+), 30 deletions(-)
rename Documentation/phy/{samsung-usb2.txt => samsung-usb2.rst} (77%)Documentation/phy/samsung-usb2.rst renamed from Documentation/phy/samsung-usb2.txt +33 -29
@@ -1,9 +1,11 @@ -.------------------------------------------------------------------------------+ -| Samsung USB 2.0 PHY adaptation layer | -+-----------------------------------------------------------------------------+' +:orphan: -| 1. Description -+---------------- +==================================== +Samsung USB 2.0 PHY adaptation layer +==================================== + +1. Description +-------------- The architecture of the USB 2.0 PHY module in Samsung SoCs is similar among many SoCs. In spite of the similarities it proved difficult to
@@ -14,8 +16,8 @@ the PHY powering up process had to be altered. This adaptation layer is a compromise between having separate drivers and having a single driver with added support for many special cases. -| 2. Files description -+---------------------- +2. Files description +-------------------- - phy-samsung-usb2.c This is the main file of the adaptation layer. This file contains
@@ -32,44 +34,45 @@ with added support for many special cases. driver. In addition it should contain extern declarations for structures that describe particular SoCs. -| 3. Supporting SoCs -+-------------------- +3. Supporting SoCs +------------------ To support a new SoC a new file should be added to the drivers/phy directory. Each SoC's configuration is stored in an instance of the -struct samsung_usb2_phy_config. +struct samsung_usb2_phy_config:: -struct samsung_usb2_phy_config { + struct samsung_usb2_phy_config { const struct samsung_usb2_common_phy *phys; int (*rate_to_clk)(unsigned long, u32 *); unsigned int num_phys; bool has_mode_switch; -}; + }; -The num_phys is the number of phys handled by the driver. *phys is an +The num_phys is the number of phys handled by the driver. `*phys` is an array that contains the configuration for each phy. The has_mode_switch property is a boolean flag that determines whether the SoC has USB host and device on a single pair of pins. If so, a special register has to be modified to change the internal routing of these pins between a USB device or host module. -For example the configuration for Exynos 4210 is following: +For example the configuration for Exynos 4210 is following:: -const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = { + const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = { .has_mode_switch = 0, .num_phys = EXYNOS4210_NUM_PHYS, .phys = exynos4210_phys, .rate_to_clk = exynos4210_rate_to_clk, -} + } + +- `int (*rate_to_clk)(unsigned long, u32 *)` -- int (*rate_to_clk)(unsigned long, u32 *) The rate_to_clk callback is to convert the rate of the clock used as the reference clock for the PHY module to the value that should be written in the hardware register. -The exynos4210_phys configuration array is as follows: +The exynos4210_phys configuration array is as follows:: -static const struct samsung_usb2_common_phy exynos4210_phys[] = { + static const struct samsung_usb2_common_phy exynos4210_phys[] = { { .label = "device", .id = EXYNOS4210_DEVICE,
@@ -95,29 +98,30 @@ static const struct samsung_usb2_common_phy exynos4210_phys[] = { .power_off = exynos4210_power_off, }, {}, -}; + }; + +- `int (*power_on)(struct samsung_usb2_phy_instance *);` + `int (*power_off)(struct samsung_usb2_phy_instance *);` -- int (*power_on)(struct samsung_usb2_phy_instance *); -- int (*power_off)(struct samsung_usb2_phy_instance *); These two callbacks are used to power on and power off the phy by modifying appropriate registers. Final change to the driver is adding appropriate compatible value to the phy-samsung-usb2.c file. In case of Exynos 4210 the following lines were -added to the struct of_device_id samsung_usb2_phy_of_match[] array: +added to the struct of_device_id samsung_usb2_phy_of_match[] array:: -#ifdef CONFIG_PHY_EXYNOS4210_USB2 + #ifdef CONFIG_PHY_EXYNOS4210_USB2 { .compatible = "samsung,exynos4210-usb2-phy", .data = &exynos4210_usb2_phy_config, }, -#endif + #endif To add further flexibility to the driver the Kconfig file enables to include support for selected SoCs in the compiled driver. The Kconfig -entry for Exynos 4210 is following: +entry for Exynos 4210 is following:: -config PHY_EXYNOS4210_USB2 + config PHY_EXYNOS4210_USB2 bool "Support for Exynos 4210" depends on PHY_SAMSUNG_USB2 depends on CPU_EXYNOS4210
@@ -128,8 +132,8 @@ config PHY_EXYNOS4210_USB2 phys are available - device, host, HSCI0 and HSCI1. The newly created file that supports the new SoC has to be also added to the -Makefile. In case of Exynos 4210 the added line is following: +Makefile. In case of Exynos 4210 the added line is following:: -obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o + obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o After completing these steps the support for the new SoC should be ready.
MAINTAINERS +1 -1
@@ -13963,7 +13963,7 @@ M: Sylwester Nawrocki <[email protected]> L: [email protected] S: Supported F: Documentation/devicetree/bindings/phy/samsung-phy.txt -F: Documentation/phy/samsung-usb2.txt +F: Documentation/phy/samsung-usb2.rst F: drivers/phy/samsung/phy-exynos4210-usb2.c F: drivers/phy/samsung/phy-exynos4x12-usb2.c F: drivers/phy/samsung/phy-exynos5250-usb2.c
Signature · 1 line
2.21.0
PATCH 16/31 docs: rbtree.txt: fix Sphinx build warnings
In reply to Mauro Carvalho ChehabThs file is already at ReST format. Yet, some recent changes made it to produce a few warnings when building it with Sphinx.
Those are trivially fixed by marking some literal blocks.
Fix them before adding it to the docs building system.
--- Documentation/rbtree.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/rbtree.txt +3 -3
@@ -204,21 +204,21 @@ potentially expensive tree iterations. This is done at negligible runtime overhead for maintanence; albeit larger memory footprint. Similar to the rb_root structure, cached rbtrees are initialized to be -empty via: +empty via:: struct rb_root_cached mytree = RB_ROOT_CACHED; Cached rbtree is simply a regular rb_root with an extra pointer to cache the leftmost node. This allows rb_root_cached to exist wherever rb_root does, which permits augmented trees to be supported as well as only a few extra -interfaces: +interfaces:: struct rb_node *rb_first_cached(struct rb_root_cached *tree); void rb_insert_color_cached(struct rb_node *, struct rb_root_cached *, bool); void rb_erase_cached(struct rb_node *node, struct rb_root_cached *); Both insert and erase calls have their respective counterpart of augmented -trees: +trees:: void rb_insert_augmented_cached(struct rb_node *node, struct rb_root_cached *, bool, struct rb_augment_callbacks *);
Signature · 1 line
2.21.0
PATCH 17/31 docs: DMA-API-HOWTO.txt: fix an unmarked code block
In reply to Mauro Carvalho ChehabWhen building with Sphinx, it would produce this warning:
docs/Documentation/DMA-API-HOWTO.rst:222: WARNING: Definition list ends without a blank line; unexpected unindent.
--- Documentation/DMA-API-HOWTO.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/DMA-API-HOWTO.txt +1 -1
@@ -212,7 +212,7 @@ The standard 64-bit addressing device would do something like this:: If the device only supports 32-bit addressing for descriptors in the coherent allocations, but supports full 64-bits for streaming mappings -it would look like this: +it would look like this:: if (dma_set_mask(dev, DMA_BIT_MASK(64))) { dev_warn(dev, "mydev: No suitable DMA available\n");
Signature · 1 line
2.21.0
PATCH 18/31 docs: accounting: convert to ReST
In reply to Mauro Carvalho ChehabRename the accounting documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../{cgroupstats.txt => cgroupstats.rst} | 14 ++--
...ay-accounting.txt => delay-accounting.rst} | 61 ++++++++------
Documentation/accounting/index.rst | 14 ++++
Documentation/accounting/{psi.txt => psi.rst} | 40 +++++-----
...kstats-struct.txt => taskstats-struct.rst} | 79 ++++++++++++-------
.../{taskstats.txt => taskstats.rst} | 15 ++--
Documentation/admin-guide/cgroup-v2.rst | 6 +-
init/Kconfig | 2 +-
8 files changed, 139 insertions(+), 92 deletions(-)
rename Documentation/accounting/{cgroupstats.txt => cgroupstats.rst} (77%)
rename Documentation/accounting/{delay-accounting.txt => delay-accounting.rst} (77%)
create mode 100644 Documentation/accounting/index.rst
rename Documentation/accounting/{psi.txt => psi.rst} (91%)
rename Documentation/accounting/{taskstats-struct.txt => taskstats-struct.rst} (78%)
rename Documentation/accounting/{taskstats.txt => taskstats.rst} (95%)Documentation/accounting/cgroupstats.rst renamed from Documentation/accounting/cgroupstats.txt +9 -5
@@ -1,3 +1,7 @@ +================== +Control Groupstats +================== + Control Groupstats is inspired by the discussion at http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263.
@@ -19,9 +23,9 @@ about tasks blocked on I/O. If CONFIG_TASK_DELAY_ACCT is disabled, this information will not be available. To extract cgroup statistics a utility very similar to getdelays.c -has been developed, the sample output of the utility is shown below +has been developed, the sample output of the utility is shown below:: -~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" -sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 -~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" -sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 + ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" + sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 + ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" + sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2
Documentation/accounting/delay-accounting.rst renamed from Documentation/accounting/delay-accounting.txt +35 -26
100 lines not on this page · raw message
Documentation/accounting/index.rst new file +14 -0
@@ -0,0 +1,14 @@ +:orphan: + +========== +Accounting +========== + +.. toctree:: + :maxdepth: 1 + + cgroupstats + delay-accounting + psi + taskstats + taskstats-struct
Documentation/accounting/psi.rst renamed from Documentation/accounting/psi.txt +21 -19
@@ -35,14 +35,14 @@ Pressure interface Pressure information for each resource is exported through the respective file in /proc/pressure/ -- cpu, memory, and io. -The format for CPU is as such: +The format for CPU is as such:: -some avg10=0.00 avg60=0.00 avg300=0.00 total=0 + some avg10=0.00 avg60=0.00 avg300=0.00 total=0 -and for memory and IO: +and for memory and IO:: -some avg10=0.00 avg60=0.00 avg300=0.00 total=0 -full avg10=0.00 avg60=0.00 avg300=0.00 total=0 + some avg10=0.00 avg60=0.00 avg300=0.00 total=0 + full avg10=0.00 avg60=0.00 avg300=0.00 total=0 The "some" line indicates the share of time in which at least some tasks are stalled on a given resource.
@@ -77,9 +77,9 @@ To register a trigger user has to open psi interface file under /proc/pressure/ representing the resource to be monitored and write the desired threshold and time window. The open file descriptor should be used to wait for trigger events using select(), poll() or epoll(). -The following format is used: +The following format is used:: -<some|full> <stall amount in us> <time window in us> + <some|full> <stall amount in us> <time window in us> For example writing "some 150000 1000000" into /proc/pressure/memory would add 150ms threshold for partial memory stall measured within
@@ -115,18 +115,20 @@ trigger is closed. Userspace monitor usage example =============================== -#include <errno.h> -#include <fcntl.h> -#include <stdio.h> -#include <poll.h> -#include <string.h> -#include <unistd.h> +:: -/* - * Monitor memory partial stall with 1s tracking window size - * and 150ms threshold. - */ -int main() { + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> + #include <poll.h> + #include <string.h> + #include <unistd.h> + + /* + * Monitor memory partial stall with 1s tracking window size + * and 150ms threshold. + */ + int main() { const char trig[] = "some 150000 1000000"; struct pollfd fds; int n;
@@ -165,7 +167,7 @@ int main() { } return 0; -} + } Cgroup2 interface =================
Documentation/accounting/taskstats-struct.rst renamed from Documentation/accounting/taskstats-struct.txt +49 -30
166 lines not on this page · raw message
Documentation/accounting/taskstats.rst renamed from Documentation/accounting/taskstats.txt +7 -8
@@ -1,5 +1,6 @@ +============================= Per-task statistics interface ------------------------------ +============================= Taskstats is a netlink-based interface for sending per-task and
@@ -65,7 +66,7 @@ taskstats.h file. The data exchanged between user and kernel space is a netlink message belonging to the NETLINK_GENERIC family and using the netlink attributes interface. -The messages are in the format +The messages are in the format:: +----------+- - -+-------------+-------------------+ | nlmsghdr | Pad | genlmsghdr | taskstats payload |
@@ -167,15 +168,13 @@ extended and the number of cpus grows large. To avoid losing statistics, userspace should do one or more of the following: - increase the receive buffer sizes for the netlink sockets opened by -listeners to receive exit data. + listeners to receive exit data. - create more listeners and reduce the number of cpus being listened to by -each listener. In the extreme case, there could be one listener for each cpu. -Users may also consider setting the cpu affinity of the listener to the subset -of cpus to which it listens, especially if they are listening to just one cpu. + each listener. In the extreme case, there could be one listener for each cpu. + Users may also consider setting the cpu affinity of the listener to the subset + of cpus to which it listens, especially if they are listening to just one cpu. Despite these measures, if the userspace receives ENOBUFS error messages indicated overflow of receive buffers, it should take measures to handle the loss of data. - -----
Documentation/admin-guide/cgroup-v2.rst +3 -3
@@ -1014,7 +1014,7 @@ All time durations are in microseconds. A read-only nested-key file which exists on non-root cgroups. Shows pressure stall information for CPU. See - Documentation/accounting/psi.txt for details. + Documentation/accounting/psi.rst for details. Memory
@@ -1361,7 +1361,7 @@ PAGE_SIZE multiple when read back. A read-only nested-key file which exists on non-root cgroups. Shows pressure stall information for memory. See - Documentation/accounting/psi.txt for details. + Documentation/accounting/psi.rst for details. Usage Guidelines
@@ -1504,7 +1504,7 @@ IO Interface Files A read-only nested-key file which exists on non-root cgroups. Shows pressure stall information for IO. See - Documentation/accounting/psi.txt for details. + Documentation/accounting/psi.rst for details. Writeback
init/Kconfig +1 -1
@@ -517,7 +517,7 @@ config PSI have cpu.pressure, memory.pressure, and io.pressure files, which aggregate pressure stalls for the grouped tasks only. - For more details see Documentation/accounting/psi.txt. + For more details see Documentation/accounting/psi.rst. Say N if unsure.
Signature · 1 line
2.21.0
PATCH 19/31 docs: fmc: convert to ReST
In reply to Mauro Carvalho ChehabRename the FMC documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At least some of this files seemed to be using some markup language similar to ReST, but with a different markup for cross-references. Adjust those to use the ReST syntax.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
Documentation/fmc/{API.txt => api.rst} | 10 +--
.../fmc/{carrier.txt => carrier.rst} | 65 ++++++++++---------
.../fmc/{FMC-and-SDB.txt => fmc-and-sdb.rst} | 19 ++++--
.../fmc/{fmc-chardev.txt => fmc-chardev.rst} | 9 +--
.../fmc/{fmc-fakedev.txt => fmc-fakedev.rst} | 13 ++--
.../fmc/{fmc-trivial.txt => fmc-trivial.rst} | 11 ++--
...-write-eeprom.txt => fmc-write-eeprom.rst} | 36 +++++-----
.../fmc/{identifiers.txt => identifiers.rst} | 20 +++---
Documentation/fmc/index.rst | 21 ++++++
.../fmc/{mezzanine.txt => mezzanine.rst} | 34 +++++-----
.../fmc/{parameters.txt => parameters.rst} | 11 ++--
11 files changed, 147 insertions(+), 102 deletions(-)
rename Documentation/fmc/{API.txt => api.rst} (87%)
rename Documentation/fmc/{carrier.txt => carrier.rst} (91%)
rename Documentation/fmc/{FMC-and-SDB.txt => fmc-and-sdb.rst} (88%)
rename Documentation/fmc/{fmc-chardev.txt => fmc-chardev.rst} (96%)
rename Documentation/fmc/{fmc-fakedev.txt => fmc-fakedev.rst} (85%)
rename Documentation/fmc/{fmc-trivial.txt => fmc-trivial.rst} (69%)
rename Documentation/fmc/{fmc-write-eeprom.txt => fmc-write-eeprom.rst} (79%)
rename Documentation/fmc/{identifiers.txt => identifiers.rst} (93%)
create mode 100644 Documentation/fmc/index.rst
rename Documentation/fmc/{mezzanine.txt => mezzanine.rst} (87%)
rename Documentation/fmc/{parameters.txt => parameters.rst} (96%)Documentation/fmc/api.rst renamed from Documentation/fmc/API.txt +5 -5
@@ -2,7 +2,7 @@ Functions Exported by fmc.ko **************************** The FMC core exports the usual 4 functions that are needed for a bus to -work, and a few more: +work, and a few more:: int fmc_driver_register(struct fmc_driver *drv); void fmc_driver_unregister(struct fmc_driver *drv);
@@ -20,9 +20,9 @@ work, and a few more: int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw, int sdb_entry); -The data structure that describe a device is detailed in *note FMC -Device::, the one that describes a driver is detailed in *note FMC -Driver::. Please note that structures of type fmc_device must be +The data structure that describe a device is detailed in :ref:`fmc_device`, +the one that describes a driver is detailed in :ref:`fmc_driver`. +Please note that structures of type fmc_device must be allocated by the caller, but must not be released after unregistering. The fmc-bus itself takes care of releasing the structure when their use count reaches zero - actually, the device model does that in lieu of us.
@@ -39,7 +39,7 @@ should register as a group only mezzanines that are driven by the same FPGA, for the reason outlined above. Finally, the fmc_reprogram function calls the reprogram method (see -*note The API Offered by Carriers:: and also scans the memory area for +:ref:`fmc_api_offered_by_carriers`) and also scans the memory area for an SDB tree. You can pass -1 as sdb_entry to disable such scan. Otherwise, the function fails if no tree is found at the specified entry point. The function is meant to factorize common code, and by
Documentation/fmc/carrier.rst renamed from Documentation/fmc/carrier.txt +33 -32
149 lines not on this page · raw message
Documentation/fmc/fmc-and-sdb.rst renamed from Documentation/fmc/FMC-and-SDB.txt +12 -7
@@ -1,3 +1,6 @@ +============ +Introduction +============ FMC (FPGA Mezzanine Card) is the standard we use for our I/O devices, in the context of White Rabbit and related hardware.
@@ -18,12 +21,12 @@ submodule. The most up to date version of code and documentation is always available from the repository you can clone from: - git://ohwr.org/fmc-projects/fmc-bus.git (read-only) - [email protected]:fmc-projects/fmc-bus.git (read-write for developers) + - git://ohwr.org/fmc-projects/fmc-bus.git (read-only) + - [email protected]:fmc-projects/fmc-bus.git (read-write for developers) Selected versions of the documentation, as well as complete tar archives for selected revisions are placed to the Files section of the -project: `http://www.ohwr.org/projects/fmc-bus/files' +project: `http://www.ohwr.org/projects/fmc-bus/files` What is FMC
@@ -62,13 +65,15 @@ a filesystem inside the FMC EEPROM. SDB is not mandatory for use of this FMC kernel bus, but if you have SDB this package can make good use of it. SDB itself is developed in the fpga-config-space OHWR project. The link to the repository is -`git://ohwr.org/hdl-core-lib/fpga-config-space.git' and what is used in +`git://ohwr.org/hdl-core-lib/fpga-config-space.git` and what is used in this project lives in the sdbfs subdirectory in there. -SDB support for FMC is described in *note FMC Identification:: and -*note SDB Support:: +SDB support for FMC is described in :ref:`fmc_identification` and +:ref:`fmc_sdb_support`. +.. _fmc_sdb_support: + SDB Support ***********
@@ -79,7 +84,7 @@ memory image. The module exports the following functions, in the special header <linux/fmc-sdb.h>. The linux/ prefix in the name is there because we plan to submit it upstream in the future, and don't want to force -changes on our drivers if that happens. +changes on our drivers if that happens:: int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address); void fmc_show_sdb_tree(struct fmc_device *fmc);
Documentation/fmc/fmc-chardev.rst renamed from Documentation/fmc/fmc-chardev.txt +5 -4
@@ -1,5 +1,6 @@ -fmc-chardev -=========== +================ +Character device +================ This is a simple generic driver, that allows user access by means of a character device (actually, one for each mezzanine it takes hold of).
@@ -27,7 +28,7 @@ arises. The example below shows raw access to a SPEC card programmed with its golden FPGA file, that features an SDB structure at offset 256 - i.e. 64 words. The mezzanine's EEPROM in this case is not programmed, so the -default name is fmc-<bus><devfn>, and there are two cards in the system: +default name is fmc-<bus><devfn>, and there are two cards in the system:: spusa.root# insmod fmc-chardev.ko [ 1073.339332] spec 0000:02:00.0: Driver has no ID: matches all
@@ -52,7 +53,7 @@ repeated reading data is written to stdout; repeated writes read from stdin and the value argument is ignored. The following examples show reading the SDB magic number and the first -SDB record from a SPEC device programmed with its golden image: +SDB record from a SPEC device programmed with its golden image:: spusa.root# ./fmc-mem /dev/fmc-0200 100 5344422d
Documentation/fmc/fmc-fakedev.rst renamed from Documentation/fmc/fmc-fakedev.txt +8 -5
@@ -1,7 +1,10 @@ -fmc-fakedev -=========== +.. _fmc_fakedev: -This package includes a software-only device, called fmc-fakedev, which +========================= +Software-only Fake Device +========================= + +This package includes a software-only device, called **fmc-fakedev**, which is able to register up to 4 mezzanines (by default it registers one). Unlike the SPEC driver, which creates an FMC device for each PCI cards it manages, this module creates a single instance of its set of
@@ -9,14 +12,14 @@ mezzanines. It is meant as the simplest possible example of how a driver should be written, and it includes a fake EEPROM image (built using the tools -described in *note FMC Identification::),, which by default is +described in :ref:`fmc_identification` which by default is replicated for each fake mezzanine. You can also use this device to verify the match algorithms, by asking it to test your own EEPROM image. You can provide the image by means of the eeprom= module parameter: the new EEPROM image is loaded, as usual, by means of the firmware loader. This example shows the defaults and a -custom EEPROM image: +custom EEPROM image:: spusa.root# insmod fmc-fakedev.ko [ 99.971247] fake-fmc-carrier: mezzanine 0
Documentation/fmc/fmc-trivial.rst renamed from Documentation/fmc/fmc-trivial.txt +6 -5
@@ -1,7 +1,9 @@ -fmc-trivial -=========== +.. _fmc_trivial: -The simple module fmc-trivial is just a simple client that registers an +FMC trivial driver +================== + +The simple module **fmc-trivial** is just a simple client that registers an interrupt handler. I used it to verify the basic mechanism of the FMC bus and how interrupts worked.
@@ -9,8 +11,7 @@ The module implements the generic FMC parameters, so it can program a different gateware file in each card. The whole list of parameters it accepts are: -`busid=' -`gateware=' +`busid=`, `gateware=` Generic parameters. See mezzanine.txt
Documentation/fmc/fmc-write-eeprom.rst renamed from Documentation/fmc/fmc-write-eeprom.txt +20 -16
@@ -1,9 +1,12 @@ -fmc-write-eeprom +.. _fmc_write_eeprom: + +================ +FMC write eeprom ================ -This module is designed to load a binary file from /lib/firmware and to -write it to the internal EEPROM of the mezzanine card. This driver uses -the `busid' generic parameter. +The module **fmc-write-eeprom** is designed to load a binary file from +/lib/firmware and to write it to the internal EEPROM of the mezzanine card. +This driver uses the `busid` generic parameter. Overwriting the EEPROM is not something you should do daily, and it is expected to only happen during manufacturing. For this reason, the
@@ -11,36 +14,36 @@ module makes it unlikely for the random user to change a working EEPROM. However, since the EEPROM may include application-specific information other than the identification, later versions of this packages added -write-support through sysfs. See *note Accessing the EEPROM::. +write-support through sysfs. See :ref:`fmc_accessing_eeprom`. To avoid damaging the EEPROM content, the module takes the following measures: - * It accepts a `file=' argument (within /lib/firmware) and if no + * It accepts a `file=` argument (within /lib/firmware) and if no such argument is received, it doesn't write anything to EEPROM (i.e. there is no default file name). - * If the file name ends with `.bin' it is written verbatim starting + * If the file name ends with `.bin` it is written verbatim starting at offset 0. - * If the file name ends with `.tlv' it is interpreted as + * If the file name ends with `.tlv` it is interpreted as type-length-value (i.e., it allows writev(2)-like operation). * If the file name doesn't match any of the patterns above, it is ignored and no write is performed. - * Only cards listed with `busid=' are written to. If no busid is + * Only cards listed with `busid=` are written to. If no busid is specified, no programming is done (and the probe function of the driver will fail). Each TLV tuple is formatted in this way: the header is 5 bytes, -followed by data. The first byte is `w' for write, the next two bytes +followed by data. The first byte is `w` for write, the next two bytes represent the address, in little-endian byte order, and the next two represent the data length, in little-endian order. The length does not include the header (it is the actual number of bytes to be written). -This is a real example: that writes 5 bytes at position 0x110: +This is a real example: that writes 5 bytes at position 0x110:: spusa.root# od -t x1 -Ax /lib/firmware/try.tlv 000000 77 10 01 05 00 30 31 32 33 34
@@ -55,13 +58,13 @@ Rabbit environment. For this reason the TLV format is not expected to be used much and is not expected to be developed further. If you want to try reflashing fake EEPROM devices, you can use the -fmc-fakedev.ko module (see *note fmc-fakedev::). Whenever you change +fmc-fakedev.ko module (see :ref:`fmc_fakedev`). Whenever you change the image starting at offset 0, it will deregister and register again after two seconds. Please note, however, that if fmc-write-eeprom is still loaded, the system will associate it to the new device, which will be reprogrammed and thus will be unloaded after two seconds. The following example removes the module after it reflashed fakedev the -first time. +first time:: spusa.root# insmod fmc-fakedev.ko [ 72.984733] fake-fmc: Manufacturer: fake-vendor
@@ -74,12 +77,13 @@ first time. [ 132.895794] fake-fmc: Manufacturer: CERN [ 132.899872] fake-fmc: Product name: FmcDelay1ns4cha +.. _fmc_accessing_eeprom: Accessing the EEPROM -===================== +==================== The bus creates a sysfs binary file called eeprom for each mezzanine it -knows about: +knows about:: spusa.root# cd /sys/bus/fmc/devices; ls -l */eeprom -r--r--r-- 1 root root 8192 Feb 21 12:30 FmcAdc100m14b4cha-0800/eeprom
@@ -94,5 +98,5 @@ the FPGA with a custom circuit, the carrier is unable to access the EEPROM and returns ENOTSUPP. An alternative way to write the EEPROM is the mezzanine driver -fmc-write-eeprom (See *note fmc-write-eeprom::), but the procedure is +fmc-write-eeprom (See :ref:`fmc_write_eeprom`), but the procedure is more complex.
Documentation/fmc/identifiers.rst renamed from Documentation/fmc/identifiers.txt +12 -8
@@ -1,3 +1,5 @@ +.. _fmc_identification: + FMC Identification ******************
@@ -19,7 +21,7 @@ package and SDB (part of the fpga-config-space package). The first sections are only interesting for manufacturers who need to write the EEPROM. If you are just a software developer writing an FMC -device or driver, you may jump straight to *note SDB Support::. +device or driver, you may jump straight to :ref:`fmc_sdb_support`. Building the FRU Structure
@@ -27,7 +29,7 @@ Building the FRU Structure If you want to know the internals of the FRU structure and despair, you can retrieve the document from -`http://download.intel.com/design/servers/ipmi/FRU1011.pdf' . The +`http://download.intel.com/design/servers/ipmi/FRU1011.pdf` . The standard is awful and difficult without reason, so we only support the minimum mandatory subset - we create a simple structure and parse it back at run time, but we are not able to either generate or parse more
@@ -43,13 +45,15 @@ line takes precedence) To make a long story short, in order to build a standard-compliant binary file to be burned in your EEPROM, you need the following items: + =========== === ===================== ============ Environment Opt Official Name Default ---------------------------------------------------------------------- + =========== === ===================== ============ FRU_VENDOR -v "Board Manufacturer" fmc-example FRU_NAME -n "Board Product Name" mezzanine - FRU_SERIAL -s `Board Serial Number" 0001 + FRU_SERIAL -s "Board Serial Number" 0001 FRU_PART -p "Board Part Number" sample-part FRU_OUTPUT -o not applicable /dev/stdout + =========== === ===================== ============ The "Official Name" above is what you find in the FRU official documentation, chapter 11, page 7 ("Board Info Area Format"). The
@@ -63,7 +67,7 @@ soon as I find some time for that. FIXME: consumption etc for FRU are here or in PTS? -The following example creates a binary image for a specific board: +The following example creates a binary image for a specific board:: ./tools/fru-generator -v CERN -n FmcAdc100m14b4cha \ -s HCCFFIA___-CR000003 -p EDA-02063-V5-0 > eeprom.bin
@@ -71,7 +75,7 @@ The following example creates a binary image for a specific board: The following example shows a script that builds several binary EEPROM images for a series of boards, changing the serial number for each of them. The script uses a mix of environment variables and command line -options, and uses the same string patterns shown above. +options, and uses the same string patterns shown above:: #!/bin/sh
@@ -131,7 +135,7 @@ name. The IPMI-FRU name is not mandatory, but a strongly suggested choice; the name filename is mandatory, because this is the preferred short name used by the FMC core. For example, a name of "fdelay" may supplement a Product Name like "FmcDelay1ns4cha" - exactly as -demonstrated in `tools/sdbfs'. +demonstrated in `tools/sdbfs`. Note: SDB access to flash memory is not yet supported, so the short name currently in use is just the "Product Name" FRU string.
@@ -139,7 +143,7 @@ name currently in use is just the "Product Name" FRU string. The example in tools/sdbfs includes an extra file, that is needed by the fine-delay driver, and must live at a known address of 0x1800. By running gensdbfs on that directory you can output your binary EEPROM -image (here below spusa$ is the shell prompt): +image (here below spusa$ is the shell prompt):: spusa$ ../fru-generator -v CERN -n FmcDelay1ns4cha -s proto-0 \ -p EDA-02267-V3 > IPMI-FRU
Documentation/fmc/index.rst new file +21 -0
@@ -0,0 +1,21 @@ +:orphan: + +========================= +FMC (FPGA Mezzanine Card) +========================= + +.. toctree:: + :maxdepth: 1 + + fmc-and-sdb + carrier + identifiers + mezzanine + parameters + + api + + fmc-fakedev + fmc-trivial + fmc-write-eeprom + fmc-chardev
Documentation/fmc/mezzanine.rst renamed from Documentation/fmc/mezzanine.txt +19 -15
@@ -1,5 +1,8 @@ +.. _fmc_driver: + +========== FMC Driver -********** +========== An FMC driver is concerned with the specific mezzanine and associated gateware. As such, it is expected to be independent of the carrier
@@ -12,23 +15,23 @@ configured in the FPGA; the latter technique is used when the FPGA is already programmed when the device is registered to the bus core. In some special cases it is possible for a driver to directly access -FPGA registers, by means of the `fpga_base' field of the device +FPGA registers, by means of the `fpga_base` field of the device structure. This may be needed for high-bandwidth peripherals like fast ADC cards. If the device module registered a remote device (for example -by means of Etherbone), the `fpga_base' pointer will be NULL. +by means of Etherbone), the `fpga_base` pointer will be NULL. Therefore, drivers must be ready to deal with NULL base pointers, and fail gracefully. Most driver, however, are not expected to access the pointer directly but run fmc_readl and fmc_writel instead, which will work in any case. In even more special cases, the driver may access carrier-specific -functionality: the `carrier_name' string allows the driver to check -which is the current carrier and make use of the `carrier_data' +functionality: the `carrier_name` string allows the driver to check +which is the current carrier and make use of the `carrier_data` pointer. We chose to use carrier names rather than numeric identifiers for greater flexibility, but also to avoid a central registry within -the `fmc.h' file - we hope other users will exploit our framework with +the `fmc.h` file - we hope other users will exploit our framework with their own carriers. An example use of carrier names is in GPIO setup -(see *note The GPIO Abstraction::), although the name match is not +(see :ref:`fmc_gpio_abstraction`), although the name match is not expected to be performed by the driver. If you depend on specific carriers, please check the carrier name and fail gracefully if your driver finds it is running in a yet-unknown-to-it environment.
@@ -44,7 +47,7 @@ their EEPROM or on the actual FPGA cores that can be enumerated. Therefore, we have two tables of identifiers. Matching of FRU information depends on two names, the manufacturer (or -vendor) and the device (see *note FMC Identification::); for +vendor) and the device (see :ref:`fmc_identification`); for flexibility during production (i.e. before writing to the EEPROM) the bus supports a catch-all driver that specifies NULL strings. For this reason, the table is specified as pointer-and-length, not a a
@@ -58,7 +61,7 @@ instantiated), and for consistency the list is passed as pointer-and-length. Several similar devices can be driven by the same driver, and thus the driver specifies and array of such arrays. -The complete set of involved data structures is thus the following: +The complete set of involved data structures is thus the following:: struct fmc_fru_id { char *manufacturer; char *product_name; }; struct fmc_sdb_one_id { uint64_t vendor; uint32_t device; };
@@ -71,13 +74,14 @@ The complete set of involved data structures is thus the following: A better reference, with full explanation, is the <linux/fmc.h> header. +.. _fmc_module_parameters: Module Parameters ================= Most of the FMC drivers need the same set of kernel parameters. This package includes support to implement common parameters by means of -fields in the `fmc_driver' structure and simple macro definitions. +fields in the `fmc_driver` structure and simple macro definitions. The parameters are carrier-specific, in that they rely on the busid concept, that varies among carriers. For the SPEC, the identifier is a
@@ -88,20 +92,20 @@ and some code duplication is unavoidable. This is the list of parameters that are common to several modules to see how they are actually used, please look at spec-trivial.c. -`busid=' +`busid=` This is an array of integers, listing carrier-specific - identification numbers. For PIC, for example, `0x0400' represents + identification numbers. For PIC, for example, `0x0400` represents bus 4, slot 0. If any such ID is specified, the driver will only accept to drive cards that appear in the list (even if the FMC ID matches). This is accomplished by the validate carrier method. -`gateware=' +`gateware=` The argument is an array of strings. If no busid= is specified, the first string of gateware= is used for all cards; otherwise the identifiers and gateware names are paired one by one, in the order specified. -`show_sdb=' +`show_sdb=` For modules supporting it, this parameter asks to show the SDB internal structure by means of kernel messages. It is disabled by default because those lines tend to hide more important messages,
@@ -113,7 +117,7 @@ see how they are actually used, please look at spec-trivial.c. For example, if you are using the trivial driver to load two different gateware files to two different cards, you can use the following parameters to load different binaries to the cards, after looking up -the PCI identifiers. This has been tested with a SPEC carrier. +the PCI identifiers. This has been tested with a SPEC carrier:: insmod fmc-trivial.ko \ busid=0x0200,0x0400 \
Documentation/fmc/parameters.rst renamed from Documentation/fmc/parameters.txt +6 -5
@@ -1,16 +1,17 @@ +=========================== Module Parameters in fmc.ko -*************************** +=========================== The core driver receives two module parameters, meant to help debugging client modules. Both parameters can be modified by writing to /sys/module/fmc/parameters/, because they are used when client drivers are devices are registered, not when fmc.ko is loaded. -`dump_eeprom=' +`dump_eeprom=` If not zero, the parameter asks the bus controller to dump the EEPROM of any device that is registered, using printk. -`dump_sdb=' +`dump_sdb=` If not zero, the parameter prints the SDB tree of every FPGA it is loaded by fmc_reprogram(). If greater than one, it asks to dump the binary content of SDB records. This currently only dumps the
@@ -19,7 +20,7 @@ are devices are registered, not when fmc.ko is loaded. EEPROM dumping avoids repeating lines, since most of the contents is usually empty and all bits are one or zero. This is an example of the -output: +output:: [ 6625.850480] spec 0000:02:00.0: FPGA programming successful [ 6626.139949] spec 0000:02:00.0: Manufacturer: CERN
@@ -40,7 +41,7 @@ output: The dump of SDB looks like the following; the example shows the simple golden gateware for the SPEC card, removing the leading timestamps to -fit the page: +fit the page:: spec 0000:02:00.0: SDB: 00000651:e6a542c9 WB4-Crossbar-GSI spec 0000:02:00.0: SDB: 0000ce42:ff07fc47 WR-Periph-Syscon (00000000-000000ff)
Signature · 1 line
2.21.0
PATCH 20/31 docs: hid: convert to ReST
In reply to Mauro Carvalho ChehabRename the HID documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
While here, fix the sysfs example from hid-sensor.txt, that has a lot of "?" instead of the proper UTF-8 characters that are produced by the tree command.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../hid/{hid-alps.txt => hid-alps.rst} | 85 ++-
.../hid/{hid-sensor.txt => hid-sensor.rst} | 192 +++----
.../{hid-transport.txt => hid-transport.rst} | 82 ++-
Documentation/hid/{hiddev.txt => hiddev.rst} | 154 ++++--
Documentation/hid/{hidraw.txt => hidraw.rst} | 53 +-
Documentation/hid/index.rst | 18 +
Documentation/hid/intel-ish-hid.rst | 485 ++++++++++++++++++
Documentation/hid/intel-ish-hid.txt | 454 ----------------
Documentation/hid/{uhid.txt => uhid.rst} | 46 +-
Documentation/input/input.rst | 2 +-
MAINTAINERS | 2 +-
11 files changed, 897 insertions(+), 676 deletions(-)
rename Documentation/hid/{hid-alps.txt => hid-alps.rst} (64%)
rename Documentation/hid/{hid-sensor.txt => hid-sensor.rst} (61%)
rename Documentation/hid/{hid-transport.txt => hid-transport.rst} (93%)
rename Documentation/hid/{hiddev.txt => hiddev.rst} (77%)
rename Documentation/hid/{hidraw.txt => hidraw.rst} (89%)
create mode 100644 Documentation/hid/index.rst
create mode 100644 Documentation/hid/intel-ish-hid.rst
delete mode 100644 Documentation/hid/intel-ish-hid.txt
rename Documentation/hid/{uhid.txt => uhid.rst} (94%)Documentation/hid/hid-alps.rst renamed from Documentation/hid/hid-alps.txt +63 -22
@@ -1,19 +1,26 @@ +========================== ALPS HID Touchpad Protocol ----------------------- +========================== Introduction ------------ Currently ALPS HID driver supports U1 Touchpad device. -U1 devuce basic information. +U1 device basic information. + +========== ====== Vender ID 0x044E Product ID 0x120B Version ID 0x0121 +========== ====== HID Descriptor ------------- +-------------- + +======= ==================== ===== ======================================= Byte Field Value Notes +======= ==================== ===== ======================================= 0 wHIDDescLength 001E Length of HID Descriptor : 30 bytes 2 bcdVersion 0100 Compliant with Version 1.00 4 wReportDescLength 00B2 Report Descriptor is 178 Bytes (0x00B2)
@@ -28,32 +35,42 @@ Byte Field Value Notes 22 wProductID 120B Product ID 0x120B 24 wVersionID 0121 Version 01.21 26 RESERVED 0000 RESERVED +======= ==================== ===== ======================================= Report ID ------------- -ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP -ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP -ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP -ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP -ReportID-5 (Feature Reports) Feature Reports -ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP -ReportID-7 (Feature Reports) Flash update (Bootloader) +--------- + +========== ================= ========================================= +ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP +ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP +ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP +ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP +ReportID-5 (Feature Reports) Feature Reports +ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP +ReportID-7 (Feature Reports) Flash update (Bootloader) +========== ================= ========================================= Data pattern ------------ + +===== ========== ===== ================= Case1 ReportID_1 TP/SP Relative/Relative Case2 ReportID_3 TP Absolute ReportID_6 SP Absolute +===== ========== ===== ================= Command Read/Write ------------------ To read/write to RAM, need to send a commands to the device. + The command format is as below. DataByte(SET_REPORT) + +===== ====================== Byte1 Command Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1
@@ -61,13 +78,19 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Command Byte is read=0xD1/write=0xD2 . + Address is read/write RAM address. + Value Byte is writing data when you send the write commands. + When you read RAM, there is no meaning. DataByte(GET_REPORT) + +===== ====================== Byte1 Response Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1
@@ -75,6 +98,7 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Read value is stored in Value Byte.
@@ -82,7 +106,11 @@ Read value is stored in Value Byte. Packet Format Touchpad data byte ------------------ - b7 b6 b5 b4 b3 b2 b1 b0 + + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== 1 0 0 SW6 SW5 SW4 SW3 SW2 SW1 2 0 0 0 Fcv Fn3 Fn2 Fn1 Fn0 3 Xa0_7 Xa0_6 Xa0_5 Xa0_4 Xa0_3 Xa0_2 Xa0_1 Xa0_0
@@ -114,17 +142,25 @@ Touchpad data byte 25 Ya4_7 Ya4_6 Ya4_5 Ya4_4 Ya4_3 Ya4_2 Ya4_1 Ya4_0 26 Ya4_15 Ya4_14 Ya4_13 Ya4_12 Ya4_11 Ya4_10 Ya4_9 Ya4_8 27 LFB4 Zs4_6 Zs4_5 Zs4_4 Zs4_3 Zs4_2 Zs4_1 Zs4_0 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW6: SW ON/OFF status -Xan_15-0(16bit):X Absolute data of the "n"th finger -Yan_15-0(16bit):Y Absolute data of the "n"th finger -Zsn_6-0(7bit): Operation area of the "n"th finger +SW1-SW6: + SW ON/OFF status +Xan_15-0(16bit): + X Absolute data of the "n"th finger +Yan_15-0(16bit): + Y Absolute data of the "n"th finger +Zsn_6-0(7bit): + Operation area of the "n"th finger StickPointer data byte ------------------- - b7 b6 b5 b4 b3 b2 b1 b0 +---------------------- + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== Byte1 1 1 1 0 1 SW3 SW2 SW1 Byte2 X7 X6 X5 X4 X3 X2 X1 X0 Byte3 X15 X14 X13 X12 X11 X10 X9 X8
@@ -132,8 +168,13 @@ Byte4 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Byte5 Y15 Y14 Y13 Y12 Y11 Y10 Y9 Y8 Byte6 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 Byte7 T&P Z14 Z13 Z12 Z11 Z10 Z9 Z8 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW3: SW ON/OFF status -Xn_15-0(16bit):X Absolute data -Yn_15-0(16bit):Y Absolute data -Zn_14-0(15bit):Z +SW1-SW3: + SW ON/OFF status +Xn_15-0(16bit): + X Absolute data +Yn_15-0(16bit): + Y Absolute data +Zn_14-0(15bit): + Z
Documentation/hid/hid-sensor.rst renamed from Documentation/hid/hid-sensor.txt +105 -87
290 lines not on this page · raw message
Documentation/hid/hid-transport.rst renamed from Documentation/hid/hid-transport.txt +62 -20
172 lines not on this page · raw message
Documentation/hid/hiddev.rst renamed from Documentation/hid/hiddev.txt +100 -54
274 lines not on this page · raw message
Documentation/hid/hidraw.rst renamed from Documentation/hid/hidraw.txt +36 -17
110 lines not on this page · raw message
Documentation/hid/index.rst new file +18 -0
@@ -0,0 +1,18 @@ +:orphan: + +============================= +Human Interface Devices (HID) +============================= + +.. toctree:: + :maxdepth: 1 + + hiddev + hidraw + hid-sensor + hid-transport + + uhid + + hid-alps + intel-ish-hid
Documentation/hid/intel-ish-hid.rst new file +485 -0
485 lines not on this page · raw message
Documentation/hid/intel-ish-hid.txt deleted +0 -454
454 lines not on this page · raw message
Documentation/hid/uhid.rst renamed from Documentation/hid/uhid.txt +26 -20
138 lines not on this page · raw message
Documentation/input/input.rst +1 -1
@@ -188,7 +188,7 @@ LCDs and many other purposes. The monitor and speaker controls should be easy to add to the hid/input interface, but for the UPSs and LCDs it doesn't make much sense. For this, -the hiddev interface was designed. See Documentation/hid/hiddev.txt +the hiddev interface was designed. See Documentation/hid/hiddev.rst for more information about it. The usage of the usbhid module is very simple, it takes no parameters,
MAINTAINERS +1 -1
@@ -16383,7 +16383,7 @@ M: Benjamin Tissoires <[email protected]> L: [email protected] T: git git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git S: Maintained -F: Documentation/hid/hiddev.txt +F: Documentation/hid/hiddev.rst F: drivers/hid/usbhid/ USB INTEL XHCI ROLE MUX DRIVER
Signature · 1 line
2.21.0
Re: [PATCH v1 20/31] docs: hid: convert to ReST
Quoted 9 lines · Mauro Carvalho Chehab
Rename the HID documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
While here, fix the sysfs example from hid-sensor.txt, that has a lot of "?" instead of the proper UTF-8 characters that are produced by the tree command.
Quoted 5 lines
At its new
index.rst, let's add a :orphan: while this is not linked to the mainindex.rstfile, in order to avoid build warnings.Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Do you need to take this patch through the doc tree or should we carry it in the HID one?
Cheers,
Benjamin
Quoted 2,261 lines
.../hid/{hid-alps.txt => hid-alps.rst} | 85 ++- .../hid/{hid-sensor.txt => hid-sensor.rst} | 192 +++---- .../{hid-transport.txt => hid-transport.rst} | 82 ++- Documentation/hid/{hiddev.txt => hiddev.rst} | 154 ++++-- Documentation/hid/{hidraw.txt => hidraw.rst} | 53 +- Documentation/hid/index.rst | 18 + Documentation/hid/intel-ish-hid.rst | 485 ++++++++++++++++++ Documentation/hid/intel-ish-hid.txt | 454 ---------------- Documentation/hid/{uhid.txt => uhid.rst} | 46 +- Documentation/input/input.rst | 2 +- MAINTAINERS | 2 +- 11 files changed, 897 insertions(+), 676 deletions(-) rename Documentation/hid/{hid-alps.txt => hid-alps.rst} (64%) rename Documentation/hid/{hid-sensor.txt => hid-sensor.rst} (61%) rename Documentation/hid/{hid-transport.txt => hid-transport.rst} (93%) rename Documentation/hid/{hiddev.txt => hiddev.rst} (77%) rename Documentation/hid/{hidraw.txt => hidraw.rst} (89%) create mode 100644 Documentation/hid/index.rst create mode 100644 Documentation/hid/intel-ish-hid.rst delete mode 100644 Documentation/hid/intel-ish-hid.txt rename Documentation/hid/{uhid.txt => uhid.rst} (94%)Documentation/hid/hid-alps.rst renamed from Documentation/hid/hid-alps.txt +63
-22@@ -1,19 +1,26 @@ +========================== ALPS HID Touchpad Protocol ----------------------- +========================== Introduction ------------ Currently ALPS HID driver supports U1 Touchpad device. -U1 devuce basic information. +U1 device basic information. + +========== ====== Vender ID 0x044E Product ID 0x120B Version ID 0x0121 +========== ====== HID Descriptor ------------- +-------------- + +======= ==================== ===== ======================================= Byte Field Value Notes +======= ==================== ===== ======================================= 0 wHIDDescLength 001E Length of HID Descriptor : 30 bytes 2 bcdVersion 0100 Compliant with Version 1.00 4 wReportDescLength 00B2 Report Descriptor is 178 Bytes (0x00B2)@@ -28,32 +35,42 @@ Byte Field Value Notes 22 wProductID 120B Product ID 0x120B 24 wVersionID 0121 Version 01.21 26 RESERVED 0000 RESERVED +======= ==================== ===== ======================================= Report ID ------------- -ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP -ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP -ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP -ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP -ReportID-5 (Feature Reports) Feature Reports -ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP -ReportID-7 (Feature Reports) Flash update (Bootloader) +--------- + +========== ================= ========================================= +ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP +ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP +ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP +ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP +ReportID-5 (Feature Reports) Feature Reports +ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP +ReportID-7 (Feature Reports) Flash update (Bootloader) +========== ================= ========================================= Data pattern ------------ + +===== ========== ===== ================= Case1 ReportID_1 TP/SP Relative/Relative Case2 ReportID_3 TP Absolute ReportID_6 SP Absolute +===== ========== ===== ================= Command Read/Write ------------------ To read/write to RAM, need to send a commands to the device. + The command format is as below. DataByte(SET_REPORT) + +===== ====================== Byte1 Command Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1@@ -61,13 +78,19 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Command Byte is read=0xD1/write=0xD2 . + Address is read/write RAM address. + Value Byte is writing data when you send the write commands. + When you read RAM, there is no meaning. DataByte(GET_REPORT) + +===== ====================== Byte1 Response Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1@@ -75,6 +98,7 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Read value is stored in Value Byte.@@ -82,7 +106,11 @@ Read value is stored in Value Byte. Packet Format Touchpad data byte ------------------ - b7 b6 b5 b4 b3 b2 b1 b0 + + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== 1 0 0 SW6 SW5 SW4 SW3 SW2 SW1 2 0 0 0 Fcv Fn3 Fn2 Fn1 Fn0 3 Xa0_7 Xa0_6 Xa0_5 Xa0_4 Xa0_3 Xa0_2 Xa0_1 Xa0_0@@ -114,17 +142,25 @@ Touchpad data byte 25 Ya4_7 Ya4_6 Ya4_5 Ya4_4 Ya4_3 Ya4_2 Ya4_1 Ya4_0 26 Ya4_15 Ya4_14 Ya4_13 Ya4_12 Ya4_11 Ya4_10 Ya4_9 Ya4_8 27 LFB4 Zs4_6 Zs4_5 Zs4_4 Zs4_3 Zs4_2 Zs4_1 Zs4_0 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW6: SW ON/OFF status -Xan_15-0(16bit):X Absolute data of the "n"th finger -Yan_15-0(16bit):Y Absolute data of the "n"th finger -Zsn_6-0(7bit): Operation area of the "n"th finger +SW1-SW6: + SW ON/OFF status +Xan_15-0(16bit): + X Absolute data of the "n"th finger +Yan_15-0(16bit): + Y Absolute data of the "n"th finger +Zsn_6-0(7bit): + Operation area of the "n"th finger StickPointer data byte ------------------- - b7 b6 b5 b4 b3 b2 b1 b0 +---------------------- + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== Byte1 1 1 1 0 1 SW3 SW2 SW1 Byte2 X7 X6 X5 X4 X3 X2 X1 X0 Byte3 X15 X14 X13 X12 X11 X10 X9 X8@@ -132,8 +168,13 @@ Byte4 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Byte5 Y15 Y14 Y13 Y12 Y11 Y10 Y9 Y8 Byte6 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 Byte7 T&P Z14 Z13 Z12 Z11 Z10 Z9 Z8 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW3: SW ON/OFF status -Xn_15-0(16bit):X Absolute data -Yn_15-0(16bit):Y Absolute data -Zn_14-0(15bit):Z +SW1-SW3: + SW ON/OFF status +Xn_15-0(16bit): + X Absolute data +Yn_15-0(16bit): + Y Absolute data +Zn_14-0(15bit): + ZDocumentation/hid/hid-sensor.rst renamed from Documentation/hid/hid-sensor.txt +105
-87@@ -1,6 +1,6 @@ - +===================== HID Sensors Framework -====================== +===================== HID sensor framework provides necessary interfaces to implement sensor drivers, which are connected to a sensor hub. The sensor hub is a HID device and it provides a report descriptor conforming to HID 1.12 sensor usage tables.@@ -15,22 +15,22 @@ the drivers themselves." This specification describes many usage IDs, which describe the type of sensor and also the individual data fields. Each sensor can have variable number of data fields. The length and order is specified in the report descriptor. For -example a part of report descriptor can look like: +example a part of report descriptor can look like:: - INPUT(1)[INPUT] - .. - Field(2) - Physical(0020.0073) - Usage(1) - 0020.045f - Logical Minimum(-32767) - Logical Maximum(32767) - Report Size(8) - Report Count(1) - Report Offset(16) - Flags(Variable Absolute) -.. -.. + INPUT(1)[INPUT] + .. + Field(2) + Physical(0020.0073) + Usage(1) + 0020.045f + Logical Minimum(-32767) + Logical Maximum(32767) + Report Size(8) + Report Count(1) + Report Offset(16) + Flags(Variable Absolute) + .. + .. The report is indicating "sensor page (0x20)" contains an accelerometer-3D (0x73). This accelerometer-3D has some fields. Here for example field 2 is motion intensity@@ -40,13 +40,14 @@ data will use this format. Implementation -================= +============== This specification defines many different types of sensors with different sets of data fields. It is difficult to have a common input event to user space applications, for different sensors. For example an accelerometer can send X,Y and Z data, whereas an ambient light sensor can send illumination data. So the implementation has two parts: + - Core hid driver - Individual sensor processing part (sensor drivers)@@ -55,8 +56,11 @@ Core driver The core driver registers (hid-sensor-hub) registers as a HID driver. It parses report descriptors and identifies all the sensors present. It adds an MFD device with name HID-SENSOR-xxxx (where xxxx is usage id from the specification). -For example + +For example: + HID-SENSOR-200073 is registered for an Accelerometer 3D driver. + So if any driver with this name is inserted, then the probe routine for that function will be called. So an accelerometer processing driver can register with this name and will be probed if there is an accelerometer-3D detected.@@ -66,7 +70,8 @@ drivers to register and get events for that usage id. Also it provides parsing functions, which get and set each input/feature/output report. Individual sensor processing part (sensor drivers) ------------ +-------------------------------------------------- + The processing driver will use an interface provided by the core driver to parse the report and get the indexes of the fields and also can get events. This driver can use IIO interface to use the standard ABI defined for a type of sensor.@@ -75,31 +80,34 @@ can use IIO interface to use the standard ABI defined for a type of sensor. Core driver Interface ===================== -Callback structure: -Each processing driver can use this structure to set some callbacks. +Callback structure:: + + Each processing driver can use this structure to set some callbacks. int (*suspend)(..): Callback when HID suspend is received int (*resume)(..): Callback when HID resume is received int (*capture_sample)(..): Capture a sample for one of its data fields int (*send_event)(..): One complete event is received which can have multiple data fields. -Registration functions: -int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, +Registration functions:: + + int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, u32 usage_id, struct hid_sensor_hub_callbacks *usage_callback): Registers callbacks for an usage id. The callback functions are not allowed -to sleep. +to sleep:: -int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, + int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, u32 usage_id): Removes callbacks for an usage id. -Parsing function: -int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, +Parsing function:: + + int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, u8 type, u32 usage_id, u32 attr_usage_id, struct hid_sensor_hub_attribute_info *info);@@ -110,26 +118,27 @@ so that fields can be set or get individually. These indexes avoid searching every time and getting field index to get or set. -Set Feature report -int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, +Set Feature report:: + + int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 value); This interface is used to set a value for a field in feature report. For example if there is a field report_interval, which is parsed by a call to -sensor_hub_input_get_attribute_info before, then it can directly set that individual -field. +sensor_hub_input_get_attribute_info before, then it can directly set that +individual field:: -int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, + int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 *value); This interface is used to get a value for a field in input report. For example if there is a field report_interval, which is parsed by a call to -sensor_hub_input_get_attribute_info before, then it can directly get that individual -field value. +sensor_hub_input_get_attribute_info before, then it can directly get that +individual field value:: -int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, + int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, u32 usage_id, u32 attr_usage_id, u32 report_id);@@ -143,6 +152,8 @@ registered callback function to process the sample. ---------- HID Custom and generic Sensors +------------------------------ + HID Sensor specification defines two special sensor usage types. Since they don't represent a standard sensor, it is not possible to define using Linux IIO@@ -158,66 +169,73 @@ keyboard attached/detached or lid open/close. To allow application to utilize these sensors, here they are exported uses sysfs attribute groups, attributes and misc device interface. -An example of this representation on sysfs: -/sys/devices/pci0000:00/INT33C2:00/i2c-0/i2c-INT33D1:00/0018:8086:09FA.0001/HID-SENSOR-2000e1.6.auto$ tree -R -. -????????? enable_sensor -????????? feature-0-200316 -??????? ????????? feature-0-200316-maximum -??????? ????????? feature-0-200316-minimum -??????? ????????? feature-0-200316-name -??????? ????????? feature-0-200316-size -??????? ????????? feature-0-200316-unit-expo -??????? ????????? feature-0-200316-units -??????? ????????? feature-0-200316-value -????????? feature-1-200201 -??????? ????????? feature-1-200201-maximum -??????? ????????? feature-1-200201-minimum -??????? ????????? feature-1-200201-name -??????? ????????? feature-1-200201-size -??????? ????????? feature-1-200201-unit-expo -??????? ????????? feature-1-200201-units -??????? ????????? feature-1-200201-value -????????? input-0-200201 -??????? ????????? input-0-200201-maximum -??????? ????????? input-0-200201-minimum -??????? ????????? input-0-200201-name -??????? ????????? input-0-200201-size -??????? ????????? input-0-200201-unit-expo -??????? ????????? input-0-200201-units -??????? ????????? input-0-200201-value -????????? input-1-200202 -??????? ????????? input-1-200202-maximum -??????? ????????? input-1-200202-minimum -??????? ????????? input-1-200202-name -??????? ????????? input-1-200202-size -??????? ????????? input-1-200202-unit-expo -??????? ????????? input-1-200202-units -??????? ????????? input-1-200202-value +An example of this representation on sysfs:: + + /sys/devices/pci0000:00/INT33C2:00/i2c-0/i2c-INT33D1:00/0018:8086:09FA.0001/HID-SENSOR-2000e1.6.auto$ tree -R + . + │ ├── enable_sensor + │ │ ├── feature-0-200316 + │ │ │ ├── feature-0-200316-maximum + │ │ │ ├── feature-0-200316-minimum + │ │ │ ├── feature-0-200316-name + │ │ │ ├── feature-0-200316-size + │ │ │ ├── feature-0-200316-unit-expo + │ │ │ ├── feature-0-200316-units + │ │ │ ├── feature-0-200316-value + │ │ ├── feature-1-200201 + │ │ │ ├── feature-1-200201-maximum + │ │ │ ├── feature-1-200201-minimum + │ │ │ ├── feature-1-200201-name + │ │ │ ├── feature-1-200201-size + │ │ │ ├── feature-1-200201-unit-expo + │ │ │ ├── feature-1-200201-units + │ │ │ ├── feature-1-200201-value + │ │ ├── input-0-200201 + │ │ │ ├── input-0-200201-maximum + │ │ │ ├── input-0-200201-minimum + │ │ │ ├── input-0-200201-name + │ │ │ ├── input-0-200201-size + │ │ │ ├── input-0-200201-unit-expo + │ │ │ ├── input-0-200201-units + │ │ │ ├── input-0-200201-value + │ │ ├── input-1-200202 + │ │ │ ├── input-1-200202-maximum + │ │ │ ├── input-1-200202-minimum + │ │ │ ├── input-1-200202-name + │ │ │ ├── input-1-200202-size + │ │ │ ├── input-1-200202-unit-expo + │ │ │ ├── input-1-200202-units + │ │ │ ├── input-1-200202-value Here there is a custom sensors with four fields, two feature and two inputs. Each field is represented by a set of attributes. All fields except the "value" are read only. The value field is a RW field. -Example -/sys/bus/platform/devices/HID-SENSOR-2000e1.6.auto/feature-0-200316$ grep -r . * -feature-0-200316-maximum:6 -feature-0-200316-minimum:0 -feature-0-200316-name:property-reporting-state -feature-0-200316-size:1 -feature-0-200316-unit-expo:0 -feature-0-200316-units:25 -feature-0-200316-value:1 + +Example:: + + /sys/bus/platform/devices/HID-SENSOR-2000e1.6.auto/feature-0-200316$ grep -r . * + feature-0-200316-maximum:6 + feature-0-200316-minimum:0 + feature-0-200316-name:property-reporting-state + feature-0-200316-size:1 + feature-0-200316-unit-expo:0 + feature-0-200316-units:25 + feature-0-200316-value:1 How to enable such sensor? +^^^^^^^^^^^^^^^^^^^^^^^^^^ + By default sensor can be power gated. To enable sysfs attribute "enable" can be -used. -$ echo 1 > enable_sensor +used:: + + $ echo 1 > enable_sensor Once enabled and powered on, sensor can report value using HID reports. -These reports are pushed using misc device interface in a FIFO order. -/dev$ tree | grep HID-SENSOR-2000e1.6.auto -??????? ????????? 10:53 -> ../HID-SENSOR-2000e1.6.auto -????????? HID-SENSOR-2000e1.6.auto +These reports are pushed using misc device interface in a FIFO order:: + + /dev$ tree | grep HID-SENSOR-2000e1.6.auto + │ │ │ ├── 10:53 -> ../HID-SENSOR-2000e1.6.auto + │ ├── HID-SENSOR-2000e1.6.auto Each reports can be of variable length preceded by a header. This header consist of a 32 bit usage id, 64 bit time stamp and 32 bit length field of rawDocumentation/hid/hid-transport.rst renamed from Documentation/hid/hid-transport.txt +62
-20@@ -1,5 +1,6 @@ - HID I/O Transport Drivers - =========================== +========================= +HID I/O Transport Drivers +========================= The HID subsystem is independent of the underlying transport driver. Initially, only USB was supported, but other specifications adopted the HID design and@@ -16,6 +17,8 @@ transport and device setup/management. HID core is responsible of report-parsing, report interpretation and the user-space API. Device specifics and quirks are handled by all layers depending on the quirk. +:: + +-----------+ +-----------+ +-----------+ +-----------+ | Device #1 | | Device #i | | Device #j | | Device #k | +-----------+ +-----------+ +-----------+ +-----------+@@ -42,8 +45,9 @@ and quirks are handled by all layers depending on the quirk. +----------------+ +-----------+ +------------------+ +------------------+ Example Drivers: - I/O: USB, I2C, Bluetooth-l2cap - Transport: USB-HID, I2C-HID, BT-HIDP + + - I/O: USB, I2C, Bluetooth-l2cap + - Transport: USB-HID, I2C-HID, BT-HIDP Everything below "HID Core" is simplified in this graph as it is only of interest to HID device drivers. Transport drivers do not need to know the@@ -183,7 +187,7 @@ Other ctrl-channel requests are supported by USB-HID but are not available ------------------- Transport drivers normally use the following procedure to register a new device -with HID core: +with HID core:: struct hid_device *hid; int ret;@@ -215,7 +219,7 @@ Once hid_add_device() is entered, HID core might use the callbacks provided in "custom_ll_driver". Note that fields like "country" can be ignored by underlying transport-drivers if not supported. -To unregister a device, use: +To unregister a device, use:: hid_destroy_device(hid);@@ -226,73 +230,110 @@ driver callbacks. ----------------------------- The available HID callbacks are: - - int (*start) (struct hid_device *hdev) + + :: + + int (*start) (struct hid_device *hdev) + Called from HID device drivers once they want to use the device. Transport drivers can choose to setup their device in this callback. However, normally devices are already set up before transport drivers register them to HID core so this is mostly only used by USB-HID. - - void (*stop) (struct hid_device *hdev) + :: + + void (*stop) (struct hid_device *hdev) + Called from HID device drivers once they are done with a device. Transport drivers can free any buffers and deinitialize the device. But note that ->start() might be called again if another HID device driver is loaded on the device. + Transport drivers are free to ignore it and deinitialize devices after they destroyed them via hid_destroy_device(). - - int (*open) (struct hid_device *hdev) + :: + + int (*open) (struct hid_device *hdev) + Called from HID device drivers once they are interested in data reports. Usually, while user-space didn't open any input API/etc., device drivers are not interested in device data and transport drivers can put devices asleep. However, once ->open() is called, transport drivers must be ready for I/O. ->open() calls are nested for each client that opens the HID device. - - void (*close) (struct hid_device *hdev) + :: + + void (*close) (struct hid_device *hdev) + Called from HID device drivers after ->open() was called but they are no longer interested in device reports. (Usually if user-space closed any input devices of the driver). + Transport drivers can put devices asleep and terminate any I/O of all ->open() calls have been followed by a ->close() call. However, ->start() may be called again if the device driver is interested in input reports again. - - int (*parse) (struct hid_device *hdev) + :: + + int (*parse) (struct hid_device *hdev) + Called once during device setup after ->start() has been called. Transport drivers must read the HID report-descriptor from the device and tell HID core about it via hid_parse_report(). - - int (*power) (struct hid_device *hdev, int level) + :: + + int (*power) (struct hid_device *hdev, int level) + Called by HID core to give PM hints to transport drivers. Usually this is analogical to the ->open() and ->close() hints and redundant. - - void (*request) (struct hid_device *hdev, struct hid_report *report, - int reqtype) + :: + + void (*request) (struct hid_device *hdev, struct hid_report *report, + int reqtype) + Send an HID request on the ctrl channel. "report" contains the report that should be sent and "reqtype" the request type. Request-type can be HID_REQ_SET_REPORT or HID_REQ_GET_REPORT. + This callback is optional. If not provided, HID core will assemble a raw report following the HID specs and send it via the ->raw_request() callback. The transport driver is free to implement this asynchronously. - - int (*wait) (struct hid_device *hdev) + :: + + int (*wait) (struct hid_device *hdev) + Used by HID core before calling ->request() again. A transport driver can use it to wait for any pending requests to complete if only one request is allowed at a time. - - int (*raw_request) (struct hid_device *hdev, unsigned char reportnum, - __u8 *buf, size_t count, unsigned char rtype, - int reqtype) + :: + + int (*raw_request) (struct hid_device *hdev, unsigned char reportnum, + __u8 *buf, size_t count, unsigned char rtype, + int reqtype) + Same as ->request() but provides the report as raw buffer. This request shall be synchronous. A transport driver must not use ->wait() to complete such requests. This request is mandatory and hid core will reject the device if it is missing. - - int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len) + :: + + int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len) + Send raw output report via intr channel. Used by some HID device drivers which require high throughput for outgoing requests on the intr channel. This must not cause SET_REPORT calls! This must be implemented as asynchronous output report on the intr channel! - - int (*idle) (struct hid_device *hdev, int report, int idle, int reqtype) + :: + + int (*idle) (struct hid_device *hdev, int report, int idle, int reqtype) + Perform SET/GET_IDLE request. Only used by USB-HID, do not implement! 2.3) Data Path@@ -314,4 +355,5 @@ transport driver and not passed to hid_input_report(). Acknowledgements to SET_REPORT requests are not of interest to HID core. ---------------------------------------------------- + Written 2013, David Herrmann <[email protected]>Documentation/hid/hiddev.rst renamed from Documentation/hid/hiddev.txt +100
-54@@ -1,6 +1,9 @@ +================================================ Care and feeding of your Human Interface Devices +================================================ -INTRODUCTION +Introduction +============ In addition to the normal input type HID devices, USB also uses the human interface device protocols for things that are not really human@@ -16,38 +19,40 @@ normalised event interface - see Documentation/input/input.rst * the hiddev interface, which provides fairly raw HID events The data flow for a HID event produced by a device is something like -the following : +the following:: usb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event] | | - --> hiddev.c ----> POWER / MONITOR CONTROL + --> hiddev.c ----> POWER / MONITOR CONTROL In addition, other subsystems (apart from USB) can potentially feed events into the input subsystem, but these have no effect on the hid device interface. -USING THE HID DEVICE INTERFACE +Using the HID Device Interface +============================== The hiddev interface is a char interface using the normal USB major, with the minor numbers starting at 96 and finishing at 111. Therefore, -you need the following commands: -mknod /dev/usb/hiddev0 c 180 96 -mknod /dev/usb/hiddev1 c 180 97 -mknod /dev/usb/hiddev2 c 180 98 -mknod /dev/usb/hiddev3 c 180 99 -mknod /dev/usb/hiddev4 c 180 100 -mknod /dev/usb/hiddev5 c 180 101 -mknod /dev/usb/hiddev6 c 180 102 -mknod /dev/usb/hiddev7 c 180 103 -mknod /dev/usb/hiddev8 c 180 104 -mknod /dev/usb/hiddev9 c 180 105 -mknod /dev/usb/hiddev10 c 180 106 -mknod /dev/usb/hiddev11 c 180 107 -mknod /dev/usb/hiddev12 c 180 108 -mknod /dev/usb/hiddev13 c 180 109 -mknod /dev/usb/hiddev14 c 180 110 -mknod /dev/usb/hiddev15 c 180 111 +you need the following commands:: + + mknod /dev/usb/hiddev0 c 180 96 + mknod /dev/usb/hiddev1 c 180 97 + mknod /dev/usb/hiddev2 c 180 98 + mknod /dev/usb/hiddev3 c 180 99 + mknod /dev/usb/hiddev4 c 180 100 + mknod /dev/usb/hiddev5 c 180 101 + mknod /dev/usb/hiddev6 c 180 102 + mknod /dev/usb/hiddev7 c 180 103 + mknod /dev/usb/hiddev8 c 180 104 + mknod /dev/usb/hiddev9 c 180 105 + mknod /dev/usb/hiddev10 c 180 106 + mknod /dev/usb/hiddev11 c 180 107 + mknod /dev/usb/hiddev12 c 180 108 + mknod /dev/usb/hiddev13 c 180 109 + mknod /dev/usb/hiddev14 c 180 110 + mknod /dev/usb/hiddev15 c 180 111 So you point your hiddev compliant user-space program at the correct interface for your device, and it all just works.@@ -56,7 +61,9 @@ Assuming that you have a hiddev compliant user-space program, of course. If you need to write one, read on. -THE HIDDEV API +The HIDDEV API +============== + This description should be read in conjunction with the HID specification, freely available from http://www.usb.org, and conveniently linked of http://www.linux-usb.org.@@ -69,12 +76,14 @@ each of which can have one or more "usages". In the hid-core, each one of these usages has a single signed 32 bit value. read(): +------- + This is the event interface. When the HID device's state changes, it performs an interrupt transfer containing a report which contains the changed value. The hid-core.c module parses the report, and returns to hiddev.c the individual usages that have changed within the report. In its basic mode, the hiddev will make these individual -usage changes available to the reader using a struct hiddev_event: +usage changes available to the reader using a struct hiddev_event:: struct hiddev_event { unsigned hid;@@ -90,13 +99,19 @@ behavior of the read() function can be modified using the HIDIOCSFLAG ioctl() described below. -ioctl(): -This is the control interface. There are a number of controls: +ioctl(): +-------- -HIDIOCGVERSION - int (read) -Gets the version code out of the hiddev driver. +This is the control interface. There are a number of controls: + +HIDIOCGVERSION + - int (read) + + Gets the version code out of the hiddev driver. + +HIDIOCAPPLICATION + - (none) -HIDIOCAPPLICATION - (none) This ioctl call returns the HID application usage associated with the hid device. The third argument to ioctl() specifies which application index to get. This is useful when the device has more than one@@ -104,25 +119,33 @@ application collection. If the index is invalid (greater or equal to the number of application collections this device has) the ioctl returns -1. You can find out beforehand how many application collections the device has from the num_applications field from the -hiddev_devinfo structure. +hiddev_devinfo structure. + +HIDIOCGCOLLECTIONINFO + - struct hiddev_collection_info (read/write) -HIDIOCGCOLLECTIONINFO - struct hiddev_collection_info (read/write) This returns a superset of the information above, providing not only application collections, but all the collections the device has. It also returns the level the collection lives in the hierarchy. -The user passes in a hiddev_collection_info struct with the index -field set to the index that should be returned. The ioctl fills in -the other fields. If the index is larger than the last collection +The user passes in a hiddev_collection_info struct with the index +field set to the index that should be returned. The ioctl fills in +the other fields. If the index is larger than the last collection index, the ioctl returns -1 and sets errno to -EINVAL. -HIDIOCGDEVINFO - struct hiddev_devinfo (read) +HIDIOCGDEVINFO + - struct hiddev_devinfo (read) + Gets a hiddev_devinfo structure which describes the device. -HIDIOCGSTRING - struct hiddev_string_descriptor (read/write) +HIDIOCGSTRING + - struct hiddev_string_descriptor (read/write) + Gets a string descriptor from the device. The caller must fill in the "index" field to indicate which descriptor should be returned. -HIDIOCINITREPORT - (none) +HIDIOCINITREPORT + - (none) + Instructs the kernel to retrieve all input and feature report values from the device. At this point, all the usage structures will contain current values for the device, and will maintain it as the device@@ -130,21 +153,29 @@ changes. Note that the use of this ioctl is unnecessary in general, since later kernels automatically initialize the reports from the device at attach time. -HIDIOCGNAME - string (variable length) +HIDIOCGNAME + - string (variable length) + Gets the device name -HIDIOCGREPORT - struct hiddev_report_info (write) +HIDIOCGREPORT + - struct hiddev_report_info (write) + Instructs the kernel to get a feature or input report from the device, in order to selectively update the usage structures (in contrast to INITREPORT). -HIDIOCSREPORT - struct hiddev_report_info (write) +HIDIOCSREPORT + - struct hiddev_report_info (write) + Instructs the kernel to send a report to the device. This report can be filled in by the user through HIDIOCSUSAGE calls (below) to fill in individual usage values in the report before sending the report in full -to the device. +to the device. + +HIDIOCGREPORTINFO + - struct hiddev_report_info (read/write) -HIDIOCGREPORTINFO - struct hiddev_report_info (read/write) Fills in a hiddev_report_info structure for the user. The report is looked up by type (input, output or feature) and id, so these fields must be filled in by the user. The ID can be absolute -- the actual@@ -154,52 +185,67 @@ report_id) for the next report after report_id. Without a-priori information about report ids, the right way to use this ioctl is to use the relative IDs above to enumerate the valid IDs. The ioctl returns non-zero when there is no more next ID. The real report ID is -filled into the returned hiddev_report_info structure. +filled into the returned hiddev_report_info structure. + +HIDIOCGFIELDINFO + - struct hiddev_field_info (read/write) -HIDIOCGFIELDINFO - struct hiddev_field_info (read/write) Returns the field information associated with a report in a hiddev_field_info structure. The user must fill in report_id and report_type in this structure, as above. The field_index should also be filled in, which should be a number from 0 and maxfield-1, as -returned from a previous HIDIOCGREPORTINFO call. +returned from a previous HIDIOCGREPORTINFO call. + +HIDIOCGUCODE + - struct hiddev_usage_ref (read/write) -HIDIOCGUCODE - struct hiddev_usage_ref (read/write) Returns the usage_code in a hiddev_usage_ref structure, given that given its report type, report id, field index, and index within the field have already been filled into the structure. -HIDIOCGUSAGE - struct hiddev_usage_ref (read/write) +HIDIOCGUSAGE + - struct hiddev_usage_ref (read/write) + Returns the value of a usage in a hiddev_usage_ref structure. The usage to be retrieved can be specified as above, or the user can choose to fill in the report_type field and specify the report_id as HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be filled in with the report and field information associated with this -usage if it is found. +usage if it is found. + +HIDIOCSUSAGE + - struct hiddev_usage_ref (write) -HIDIOCSUSAGE - struct hiddev_usage_ref (write) Sets the value of a usage in an output report. The user fills in the hiddev_usage_ref structure as above, but additionally fills in the value field. -HIDIOGCOLLECTIONINDEX - struct hiddev_usage_ref (write) +HIDIOGCOLLECTIONINDEX + - struct hiddev_usage_ref (write) + Returns the collection index associated with this usage. This indicates where in the collection hierarchy this usage sits. -HIDIOCGFLAG - int (read) -HIDIOCSFLAG - int (write) +HIDIOCGFLAG + - int (read) +HIDIOCSFLAG + - int (write) + These operations respectively inspect and replace the mode flags that influence the read() call above. The flags are as follows: - HIDDEV_FLAG_UREF - read() calls will now return + HIDDEV_FLAG_UREF + - read() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity. - HIDDEV_FLAG_REPORT - This flag can only be used in conjunction + HIDDEV_FLAG_REPORT + - This flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned - to read() filled in with the report_type and report_id, but + to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.Documentation/hid/hidraw.rst renamed from Documentation/hid/hidraw.txt +36
-17@@ -1,5 +1,6 @@ - HIDRAW - Raw Access to USB and Bluetooth Human Interface Devices - ================================================================== +================================================================ +HIDRAW - Raw Access to USB and Bluetooth Human Interface Devices +================================================================ The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs). It differs from hiddev in that reports sent and@@ -31,6 +32,7 @@ directly under /dev (eg: /dev/hidraw0). As this location is distribution- and udev rule-dependent, applications should use libudev to locate hidraw devices attached to the system. There is a tutorial on libudev with a working example at: + http://www.signal11.us/oss/udev/ The HIDRAW API@@ -51,7 +53,7 @@ byte. For devices which do not use numbered reports, the report data will begin at the first byte. write() --------- +------- The write() function will write a report to the device. For USB devices, if the device has an INTERRUPT OUT endpoint, the report will be sent on that endpoint. If it does not, the report will be sent over the control endpoint,@@ -62,38 +64,52 @@ number. If the device does not use numbered reports, the first byte should be set to 0. The report data itself should begin at the second byte. ioctl() --------- +------- Hidraw supports the following ioctls: -HIDIOCGRDESCSIZE: Get Report Descriptor Size +HIDIOCGRDESCSIZE: + Get Report Descriptor Size + This ioctl will get the size of the device's report descriptor. -HIDIOCGRDESC: Get Report Descriptor +HIDIOCGRDESC: + Get Report Descriptor + This ioctl returns the device's report descriptor using a hidraw_report_descriptor struct. Make sure to set the size field of the hidraw_report_descriptor struct to the size returned from HIDIOCGRDESCSIZE. -HIDIOCGRAWINFO: Get Raw Info +HIDIOCGRAWINFO: + Get Raw Info + This ioctl will return a hidraw_devinfo struct containing the bus type, the vendor ID (VID), and product ID (PID) of the device. The bus type can be one -of: - BUS_USB - BUS_HIL - BUS_BLUETOOTH - BUS_VIRTUAL +of:: + + - BUS_USB + - BUS_HIL + - BUS_BLUETOOTH + - BUS_VIRTUAL + which are defined in uapi/linux/input.h. -HIDIOCGRAWNAME(len): Get Raw Name +HIDIOCGRAWNAME(len): + Get Raw Name + This ioctl returns a string containing the vendor and product strings of the device. The returned string is Unicode, UTF-8 encoded. -HIDIOCGRAWPHYS(len): Get Physical Address +HIDIOCGRAWPHYS(len): + Get Physical Address + This ioctl returns a string representing the physical address of the device. For USB devices, the string contains the physical path to the device (the USB controller, hubs, ports, etc). For Bluetooth devices, the string contains the hardware (MAC) address of the device. -HIDIOCSFEATURE(len): Send a Feature Report +HIDIOCSFEATURE(len): + Send a Feature Report + This ioctl will send a feature report to the device. Per the HID specification, feature reports are always sent using the control endpoint. Set the first byte of the supplied buffer to the report number. For devices@@ -101,7 +117,9 @@ which do not use numbered reports, set the first byte to 0. The report data begins in the second byte. Make sure to set len accordingly, to one more than the length of the report (to account for the report number). -HIDIOCGFEATURE(len): Get a Feature Report +HIDIOCGFEATURE(len): + Get a Feature Report + This ioctl will request a feature report from the device using the control endpoint. The first byte of the supplied buffer should be set to the report number of the requested report. For devices which do not use numbered@@ -109,11 +127,12 @@ reports, set the first byte to 0. The report will be returned starting at the first byte of the buffer (ie: the report number is not returned). Example ---------- +------- In samples/, find hid-example.c, which shows examples of read(), write(), and all the ioctls for hidraw. The code may be used by anyone for any purpose, and can serve as a starting point for developing applications using hidraw. Document by: + Alan Ott <[email protected]>, Signal 11 SoftwareDocumentation/hid/index.rst new file +18
-0@@ -0,0 +1,18 @@ +:orphan: + +============================= +Human Interface Devices (HID) +============================= + +.. toctree:: + :maxdepth: 1 + + hiddev + hidraw + hid-sensor + hid-transport + + uhid + + hid-alps + intel-ish-hidDocumentation/hid/intel-ish-hid.rst new file +485
-0@@ -0,0 +1,485 @@ +================================= +Intel Integrated Sensor Hub (ISH) +================================= + +A sensor hub enables the ability to offload sensor polling and algorithm +processing to a dedicated low power co-processor. This allows the core +processor to go into low power modes more often, resulting in the increased +battery life. + +There are many vendors providing external sensor hubs confirming to HID +Sensor usage tables, and used in several tablets, 2 in 1 convertible laptops +and embedded products. Linux had this support since Linux 3.9. + +Intel® introduced integrated sensor hubs as a part of the SoC starting from +Cherry Trail and now supported on multiple generations of CPU packages. There +are many commercial devices already shipped with Integrated Sensor Hubs (ISH). +These ISH also comply to HID sensor specification, but the difference is the +transport protocol used for communication. The current external sensor hubs +mainly use HID over i2C or USB. But ISH doesn't use either i2c or USB. + +1. Overview +=========== + +Using a analogy with a usbhid implementation, the ISH follows a similar model +for a very high speed communication:: + + ----------------- ---------------------- + | USB HID | --> | ISH HID | + ----------------- ---------------------- + ----------------- ---------------------- + | USB protocol | --> | ISH Transport | + ----------------- ---------------------- + ----------------- ---------------------- + | EHCI/XHCI | --> | ISH IPC | + ----------------- ---------------------- + PCI PCI + ----------------- ---------------------- + |Host controller| --> | ISH processor | + ----------------- ---------------------- + USB Link + ----------------- ---------------------- + | USB End points| --> | ISH Clients | + ----------------- ---------------------- + +Like USB protocol provides a method for device enumeration, link management +and user data encapsulation, the ISH also provides similar services. But it is +very light weight tailored to manage and communicate with ISH client +applications implemented in the firmware. + +The ISH allows multiple sensor management applications executing in the +firmware. Like USB endpoints the messaging can be to/from a client. As part of +enumeration process, these clients are identified. These clients can be simple +HID sensor applications, sensor calibration application or senor firmware +update application. + +The implementation model is similar, like USB bus, ISH transport is also +implemented as a bus. Each client application executing in the ISH processor +is registered as a device on this bus. The driver, which binds each device +(ISH HID driver) identifies the device type and registers with the hid core. + +2. ISH Implementation: Block Diagram +==================================== + +:: + + --------------------------- + | User Space Applications | + --------------------------- + + ----------------IIO ABI---------------- + -------------------------- + | IIO Sensor Drivers | + -------------------------- + -------------------------- + | IIO core | + -------------------------- + -------------------------- + | HID Sensor Hub MFD | + -------------------------- + -------------------------- + | HID Core | + -------------------------- + -------------------------- + | HID over ISH Client | + -------------------------- + -------------------------- + | ISH Transport (ISHTP) | + -------------------------- + -------------------------- + | IPC Drivers | + -------------------------- + OS + ---------------- PCI ----------------- + Hardware + Firmware + ---------------------------- + | ISH Hardware/Firmware(FW) | + ---------------------------- + +3. High level processing in above blocks +======================================== + +3.1 Hardware Interface +---------------------- + +The ISH is exposed as "Non-VGA unclassified PCI device" to the host. The PCI +product and vendor IDs are changed from different generations of processors. So +the source code which enumerate drivers needs to update from generation to +generation. + +3.2 Inter Processor Communication (IPC) driver +---------------------------------------------- + +Location: drivers/hid/intel-ish-hid/ipc + +The IPC message used memory mapped I/O. The registers are defined in +hw-ish-regs.h. + +3.2.1 IPC/FW message types +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There are two types of messages, one for management of link and other messages +are to and from transport layers. + +TX and RX of Transport messages +............................... + +A set of memory mapped register offers support of multi byte messages TX and +RX (E.g.IPC_REG_ISH2HOST_MSG, IPC_REG_HOST2ISH_MSG). The IPC layer maintains +internal queues to sequence messages and send them in order to the FW. +Optionally the caller can register handler to get notification of completion. +A door bell mechanism is used in messaging to trigger processing in host and +client firmware side. When ISH interrupt handler is called, the ISH2HOST +doorbell register is used by host drivers to determine that the interrupt +is for ISH. + +Each side has 32 32-bit message registers and a 32-bit doorbell. Doorbell +register has the following format: +Bits 0..6: fragment length (7 bits are used) +Bits 10..13: encapsulated protocol +Bits 16..19: management command (for IPC management protocol) +Bit 31: doorbell trigger (signal H/W interrupt to the other side) +Other bits are reserved, should be 0. + +3.2.2 Transport layer interface +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To abstract HW level IPC communication, a set of callbacks are registered. +The transport layer uses them to send and receive messages. +Refer to struct ishtp_hw_ops for callbacks. + +3.3 ISH Transport layer +----------------------- + +Location: drivers/hid/intel-ish-hid/ishtp/ + +3.3.1 A Generic Transport Layer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The transport layer is a bi-directional protocol, which defines: +- Set of commands to start, stop, connect, disconnect and flow control +(ishtp/hbm.h) for details +- A flow control mechanism to avoid buffer overflows + +This protocol resembles bus messages described in the following document: +http://www.intel.com/content/dam/www/public/us/en/documents/technical-\ +specifications/dcmi-hi-1-0-spec.pdf "Chapter 7: Bus Message Layer" + +3.3.2 Connection and Flow Control Mechanism +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Each FW client and a protocol is identified by an UUID. In order to communicate +to a FW client, a connection must be established using connect request and +response bus messages. If successful, a pair (host_client_id and fw_client_id) +will identify the connection. + +Once connection is established, peers send each other flow control bus messages +independently. Every peer may send a message only if it has received a +flow-control credit before. Once it sent a message, it may not send another one +before receiving the next flow control credit. +Either side can send disconnect request bus message to end communication. Also +the link will be dropped if major FW reset occurs. + +3.3.3 Peer to Peer data transfer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Peer to Peer data transfer can happen with or without using DMA. Depending on +the sensor bandwidth requirement DMA can be enabled by using module parameter +ishtp_use_dma under intel_ishtp. + +Each side (host and FW) manages its DMA transfer memory independently. When an +ISHTP client from either host or FW side wants to send something, it decides +whether to send over IPC or over DMA; for each transfer the decision is +independent. The sending side sends DMA_XFER message when the message is in +the respective host buffer (TX when host client sends, RX when FW client +sends). The recipient of DMA message responds with DMA_XFER_ACK, indicating +the sender that the memory region for that message may be reused. + +DMA initialization is started with host sending DMA_ALLOC_NOTIFY bus message +(that includes RX buffer) and FW responds with DMA_ALLOC_NOTIFY_ACK. +Additionally to DMA address communication, this sequence checks capabilities: +if thw host doesn't support DMA, then it won't send DMA allocation, so FW can't +send DMA; if FW doesn't support DMA then it won't respond with +DMA_ALLOC_NOTIFY_ACK, in which case host will not use DMA transfers. +Here ISH acts as busmaster DMA controller. Hence when host sends DMA_XFER, +it's request to do host->ISH DMA transfer; when FW sends DMA_XFER, it means +that it already did DMA and the message resides at host. Thus, DMA_XFER +and DMA_XFER_ACK act as ownership indicators. + +At initial state all outgoing memory belongs to the sender (TX to host, RX to +FW), DMA_XFER transfers ownership on the region that contains ISHTP message to +the receiving side, DMA_XFER_ACK returns ownership to the sender. A sender +needs not wait for previous DMA_XFER to be ack'ed, and may send another message +as long as remaining continuous memory in its ownership is enough. +In principle, multiple DMA_XFER and DMA_XFER_ACK messages may be sent at once +(up to IPC MTU), thus allowing for interrupt throttling. +Currently, ISH FW decides to send over DMA if ISHTP message is more than 3 IPC +fragments and via IPC otherwise. + +3.3.4 Ring Buffers +^^^^^^^^^^^^^^^^^^ + +When a client initiate a connection, a ring or RX and TX buffers are allocated. +The size of ring can be specified by the client. HID client set 16 and 32 for +TX and RX buffers respectively. On send request from client, the data to be +sent is copied to one of the send ring buffer and scheduled to be sent using +bus message protocol. These buffers are required because the FW may have not +have processed the last message and may not have enough flow control credits +to send. Same thing holds true on receive side and flow control is required. + +3.3.5 Host Enumeration +^^^^^^^^^^^^^^^^^^^^^^ + +The host enumeration bus command allow discovery of clients present in the FW. +There can be multiple sensor clients and clients for calibration function. + +To ease in implantation and allow independent driver handle each client +this transport layer takes advantage of Linux Bus driver model. Each +client is registered as device on the the transport bus (ishtp bus). + +Enumeration sequence of messages: + +- Host sends HOST_START_REQ_CMD, indicating that host ISHTP layer is up. +- FW responds with HOST_START_RES_CMD +- Host sends HOST_ENUM_REQ_CMD (enumerate FW clients) +- FW responds with HOST_ENUM_RES_CMD that includes bitmap of available FW + client IDs +- For each FW ID found in that bitmap host sends + HOST_CLIENT_PROPERTIES_REQ_CMD +- FW responds with HOST_CLIENT_PROPERTIES_RES_CMD. Properties include UUID, + max ISHTP message size, etc. +- Once host received properties for that last discovered client, it considers + ISHTP device fully functional (and allocates DMA buffers) + +3.4 HID over ISH Client +----------------------- + +Location: drivers/hid/intel-ish-hid + +The ISHTP client driver is responsible for: + +- enumerate HID devices under FW ISH client +- Get Report descriptor +- Register with HID core as a LL driver +- Process Get/Set feature request +- Get input reports + +3.5 HID Sensor Hub MFD and IIO sensor drivers +--------------------------------------------- + +The functionality in these drivers is the same as an external sensor hub. +Refer to +Documentation/hid/hid-sensor.rst for HID sensor +Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space + +3.6 End to End HID transport Sequence Diagram +--------------------------------------------- + +:: + + HID-ISH-CLN ISHTP IPC HW + | | | | + | | |-----WAKE UP------------------>| + | | | | + | | |-----HOST READY--------------->| + | | | | + | | |<----MNG_RESET_NOTIFY_ACK----- | + | | | | + | |<----ISHTP_START------ | | + | | | | + | |<-----------------HOST_START_RES_CMD-------------------| + | | | | + | |------------------QUERY_SUBSCRIBER-------------------->| + | | | | + | |------------------HOST_ENUM_REQ_CMD------------------->| + | | | | + | |<-----------------HOST_ENUM_RES_CMD--------------------| + | | | | + | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| + | | | | + | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| + | Create new device on in ishtp bus | | + | | | | + | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| + | | | | + | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| + | Create new device on in ishtp bus | | + | | | | + | |--Repeat HOST_CLIENT_PROPERTIES_REQ_CMD-till last one--| + | | | | + probed() + |----ishtp_cl_connect--->|----------------- CLIENT_CONNECT_REQ_CMD-------------->| + | | | | + | |<----------------CLIENT_CONNECT_RES_CMD----------------| + | | | | + |register event callback | | | + | | | | + |ishtp_cl_send( + HOSTIF_DM_ENUM_DEVICES) |----------fill ishtp_msg_hdr struct write to HW----- >| + | | | | + | | |<-----IRQ(IPC_PROTOCOL_ISHTP---| + | | | | + |<--ENUM_DEVICE RSP------| | | + | | | | + for each enumerated device + |ishtp_cl_send( + HOSTIF_GET_HID_DESCRIPTOR|----------fill ishtp_msg_hdr struct write to HW----- >| + | | | | + ...Response + | | | | + for each enumerated device + |ishtp_cl_send( + HOSTIF_GET_REPORT_DESCRIPTOR|--------------fill ishtp_msg_hdr struct write to HW-- >| + | | | | + | | | | + hid_allocate_device + | | | | + hid_add_device | | | + | | | | + + +3.7 ISH Debugging +----------------- + +To debug ISH, event tracing mechanism is used. To enable debug logs +echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable +cat sys/kernel/debug/tracing/trace + +3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260 +----------------------------------------------------- + +:: + + root@otcpl-ThinkPad-Yoga-260:~# tree -l /sys/bus/iio/devices/ + /sys/bus/iio/devices/ + ├── iio:device0 -> ../../../devices/0044:8086:22D8.0001/HID-SENSOR-200073.9.auto/iio:device0 + │ ├── buffer + │ │ ├── enable + │ │ ├── length + │ │ └── watermark + ... + │ ├── in_accel_hysteresis + │ ├── in_accel_offset + │ ├── in_accel_sampling_frequency + │ ├── in_accel_scale + │ ├── in_accel_x_raw + │ ├── in_accel_y_raw + │ ├── in_accel_z_raw + │ ├── name + │ ├── scan_elements + │ │ ├── in_accel_x_en + │ │ ├── in_accel_x_index + │ │ ├── in_accel_x_type + │ │ ├── in_accel_y_en + │ │ ├── in_accel_y_index + │ │ ├── in_accel_y_type + │ │ ├── in_accel_z_en + │ │ ├── in_accel_z_index + │ │ └── in_accel_z_type + ... + │ │ ├── devices + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_intensity_both_raw + │ │ │ │ ├── in_intensity_hysteresis + │ │ │ │ ├── in_intensity_offset + │ │ │ │ ├── in_intensity_sampling_frequency + │ │ │ │ ├── in_intensity_scale + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_intensity_both_en + │ │ │ │ │ ├── in_intensity_both_index + │ │ │ │ │ └── in_intensity_both_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_magn_hysteresis + │ │ │ │ ├── in_magn_offset + │ │ │ │ ├── in_magn_sampling_frequency + │ │ │ │ ├── in_magn_scale + │ │ │ │ ├── in_magn_x_raw + │ │ │ │ ├── in_magn_y_raw + │ │ │ │ ├── in_magn_z_raw + │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_raw + │ │ │ │ ├── in_rot_hysteresis + │ │ │ │ ├── in_rot_offset + │ │ │ │ ├── in_rot_sampling_frequency + │ │ │ │ ├── in_rot_scale + │ │ │ │ ├── name + ... + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_magn_x_en + │ │ │ │ │ ├── in_magn_x_index + │ │ │ │ │ ├── in_magn_x_type + │ │ │ │ │ ├── in_magn_y_en + │ │ │ │ │ ├── in_magn_y_index + │ │ │ │ │ ├── in_magn_y_type + │ │ │ │ │ ├── in_magn_z_en + │ │ │ │ │ ├── in_magn_z_index + │ │ │ │ │ ├── in_magn_z_type + │ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_en + │ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_index + │ │ │ │ │ └── in_rot_from_north_magnetic_tilt_comp_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_anglvel_hysteresis + │ │ │ │ ├── in_anglvel_offset + │ │ │ │ ├── in_anglvel_sampling_frequency + │ │ │ │ ├── in_anglvel_scale + │ │ │ │ ├── in_anglvel_x_raw + │ │ │ │ ├── in_anglvel_y_raw + │ │ │ │ ├── in_anglvel_z_raw + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_anglvel_x_en + │ │ │ │ │ ├── in_anglvel_x_index + │ │ │ │ │ ├── in_anglvel_x_type + │ │ │ │ │ ├── in_anglvel_y_en + │ │ │ │ │ ├── in_anglvel_y_index + │ │ │ │ │ ├── in_anglvel_y_type + │ │ │ │ │ ├── in_anglvel_z_en + │ │ │ │ │ ├── in_anglvel_z_index + │ │ │ │ │ └── in_anglvel_z_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_anglvel_hysteresis + │ │ │ │ ├── in_anglvel_offset + │ │ │ │ ├── in_anglvel_sampling_frequency + │ │ │ │ ├── in_anglvel_scale + │ │ │ │ ├── in_anglvel_x_raw + │ │ │ │ ├── in_anglvel_y_raw + │ │ │ │ ├── in_anglvel_z_raw + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_anglvel_x_en + │ │ │ │ │ ├── in_anglvel_x_index + │ │ │ │ │ ├── in_anglvel_x_type + │ │ │ │ │ ├── in_anglvel_y_en + │ │ │ │ │ ├── in_anglvel_y_index + │ │ │ │ │ ├── in_anglvel_y_type + │ │ │ │ │ ├── in_anglvel_z_en + │ │ │ │ │ ├── in_anglvel_z_index + │ │ │ │ │ └── in_anglvel_z_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ...Documentation/hid/intel-ish-hid.txt deleted +0
-454@@ -1,454 +0,0 @@ -Intel Integrated Sensor Hub (ISH) -=============================== - -A sensor hub enables the ability to offload sensor polling and algorithm -processing to a dedicated low power co-processor. This allows the core -processor to go into low power modes more often, resulting in the increased -battery life. - -There are many vendors providing external sensor hubs confirming to HID -Sensor usage tables, and used in several tablets, 2 in 1 convertible laptops -and embedded products. Linux had this support since Linux 3.9. - -Intel® introduced integrated sensor hubs as a part of the SoC starting from -Cherry Trail and now supported on multiple generations of CPU packages. There -are many commercial devices already shipped with Integrated Sensor Hubs (ISH). -These ISH also comply to HID sensor specification, but the difference is the -transport protocol used for communication. The current external sensor hubs -mainly use HID over i2C or USB. But ISH doesn't use either i2c or USB. - -1. Overview - -Using a analogy with a usbhid implementation, the ISH follows a similar model -for a very high speed communication: - - ----------------- ---------------------- - | USB HID | --> | ISH HID | - ----------------- ---------------------- - ----------------- ---------------------- - | USB protocol | --> | ISH Transport | - ----------------- ---------------------- - ----------------- ---------------------- - | EHCI/XHCI | --> | ISH IPC | - ----------------- ---------------------- - PCI PCI - ----------------- ---------------------- - |Host controller| --> | ISH processor | - ----------------- ---------------------- - USB Link - ----------------- ---------------------- - | USB End points| --> | ISH Clients | - ----------------- ---------------------- - -Like USB protocol provides a method for device enumeration, link management -and user data encapsulation, the ISH also provides similar services. But it is -very light weight tailored to manage and communicate with ISH client -applications implemented in the firmware. - -The ISH allows multiple sensor management applications executing in the -firmware. Like USB endpoints the messaging can be to/from a client. As part of -enumeration process, these clients are identified. These clients can be simple -HID sensor applications, sensor calibration application or senor firmware -update application. - -The implementation model is similar, like USB bus, ISH transport is also -implemented as a bus. Each client application executing in the ISH processor -is registered as a device on this bus. The driver, which binds each device -(ISH HID driver) identifies the device type and registers with the hid core. - -2. ISH Implementation: Block Diagram - - --------------------------- - | User Space Applications | - --------------------------- - -----------------IIO ABI---------------- - -------------------------- - | IIO Sensor Drivers | - -------------------------- - -------------------------- - | IIO core | - -------------------------- - -------------------------- - | HID Sensor Hub MFD | - -------------------------- - -------------------------- - | HID Core | - -------------------------- - -------------------------- - | HID over ISH Client | - -------------------------- - -------------------------- - | ISH Transport (ISHTP) | - -------------------------- - -------------------------- - | IPC Drivers | - -------------------------- -OS ----------------- PCI ----------------- -Hardware + Firmware - ---------------------------- - | ISH Hardware/Firmware(FW) | - ---------------------------- - -3. High level processing in above blocks - -3.1 Hardware Interface - -The ISH is exposed as "Non-VGA unclassified PCI device" to the host. The PCI -product and vendor IDs are changed from different generations of processors. So -the source code which enumerate drivers needs to update from generation to -generation. - -3.2 Inter Processor Communication (IPC) driver -Location: drivers/hid/intel-ish-hid/ipc - -The IPC message used memory mapped I/O. The registers are defined in -hw-ish-regs.h. - -3.2.1 IPC/FW message types - -There are two types of messages, one for management of link and other messages -are to and from transport layers. - -TX and RX of Transport messages - -A set of memory mapped register offers support of multi byte messages TX and -RX (E.g.IPC_REG_ISH2HOST_MSG, IPC_REG_HOST2ISH_MSG). The IPC layer maintains -internal queues to sequence messages and send them in order to the FW. -Optionally the caller can register handler to get notification of completion. -A door bell mechanism is used in messaging to trigger processing in host and -client firmware side. When ISH interrupt handler is called, the ISH2HOST -doorbell register is used by host drivers to determine that the interrupt -is for ISH. - -Each side has 32 32-bit message registers and a 32-bit doorbell. Doorbell -register has the following format: -Bits 0..6: fragment length (7 bits are used) -Bits 10..13: encapsulated protocol -Bits 16..19: management command (for IPC management protocol) -Bit 31: doorbell trigger (signal H/W interrupt to the other side) -Other bits are reserved, should be 0. - -3.2.2 Transport layer interface - -To abstract HW level IPC communication, a set of callbacks are registered. -The transport layer uses them to send and receive messages. -Refer to struct ishtp_hw_ops for callbacks. - -3.3 ISH Transport layer -Location: drivers/hid/intel-ish-hid/ishtp/ - -3.3.1 A Generic Transport Layer - -The transport layer is a bi-directional protocol, which defines: -- Set of commands to start, stop, connect, disconnect and flow control -(ishtp/hbm.h) for details -- A flow control mechanism to avoid buffer overflows - -This protocol resembles bus messages described in the following document: -http://www.intel.com/content/dam/www/public/us/en/documents/technical-\ -specifications/dcmi-hi-1-0-spec.pdf "Chapter 7: Bus Message Layer" - -3.3.2 Connection and Flow Control Mechanism - -Each FW client and a protocol is identified by an UUID. In order to communicate -to a FW client, a connection must be established using connect request and -response bus messages. If successful, a pair (host_client_id and fw_client_id) -will identify the connection. - -Once connection is established, peers send each other flow control bus messages -independently. Every peer may send a message only if it has received a -flow-control credit before. Once it sent a message, it may not send another one -before receiving the next flow control credit. -Either side can send disconnect request bus message to end communication. Also -the link will be dropped if major FW reset occurs. - -3.3.3 Peer to Peer data transfer - -Peer to Peer data transfer can happen with or without using DMA. Depending on -the sensor bandwidth requirement DMA can be enabled by using module parameter -ishtp_use_dma under intel_ishtp. - -Each side (host and FW) manages its DMA transfer memory independently. When an -ISHTP client from either host or FW side wants to send something, it decides -whether to send over IPC or over DMA; for each transfer the decision is -independent. The sending side sends DMA_XFER message when the message is in -the respective host buffer (TX when host client sends, RX when FW client -sends). The recipient of DMA message responds with DMA_XFER_ACK, indicating -the sender that the memory region for that message may be reused. - -DMA initialization is started with host sending DMA_ALLOC_NOTIFY bus message -(that includes RX buffer) and FW responds with DMA_ALLOC_NOTIFY_ACK. -Additionally to DMA address communication, this sequence checks capabilities: -if thw host doesn't support DMA, then it won't send DMA allocation, so FW can't -send DMA; if FW doesn't support DMA then it won't respond with -DMA_ALLOC_NOTIFY_ACK, in which case host will not use DMA transfers. -Here ISH acts as busmaster DMA controller. Hence when host sends DMA_XFER, -it's request to do host->ISH DMA transfer; when FW sends DMA_XFER, it means -that it already did DMA and the message resides at host. Thus, DMA_XFER -and DMA_XFER_ACK act as ownership indicators. - -At initial state all outgoing memory belongs to the sender (TX to host, RX to -FW), DMA_XFER transfers ownership on the region that contains ISHTP message to -the receiving side, DMA_XFER_ACK returns ownership to the sender. A sender -needs not wait for previous DMA_XFER to be ack'ed, and may send another message -as long as remaining continuous memory in its ownership is enough. -In principle, multiple DMA_XFER and DMA_XFER_ACK messages may be sent at once -(up to IPC MTU), thus allowing for interrupt throttling. -Currently, ISH FW decides to send over DMA if ISHTP message is more than 3 IPC -fragments and via IPC otherwise. - -3.3.4 Ring Buffers - -When a client initiate a connection, a ring or RX and TX buffers are allocated. -The size of ring can be specified by the client. HID client set 16 and 32 for -TX and RX buffers respectively. On send request from client, the data to be -sent is copied to one of the send ring buffer and scheduled to be sent using -bus message protocol. These buffers are required because the FW may have not -have processed the last message and may not have enough flow control credits -to send. Same thing holds true on receive side and flow control is required. - -3.3.5 Host Enumeration - -The host enumeration bus command allow discovery of clients present in the FW. -There can be multiple sensor clients and clients for calibration function. - -To ease in implantation and allow independent driver handle each client -this transport layer takes advantage of Linux Bus driver model. Each -client is registered as device on the the transport bus (ishtp bus). - -Enumeration sequence of messages: -- Host sends HOST_START_REQ_CMD, indicating that host ISHTP layer is up. -- FW responds with HOST_START_RES_CMD -- Host sends HOST_ENUM_REQ_CMD (enumerate FW clients) -- FW responds with HOST_ENUM_RES_CMD that includes bitmap of available FW -client IDs -- For each FW ID found in that bitmap host sends -HOST_CLIENT_PROPERTIES_REQ_CMD -- FW responds with HOST_CLIENT_PROPERTIES_RES_CMD. Properties include UUID, -max ISHTP message size, etc. -- Once host received properties for that last discovered client, it considers -ISHTP device fully functional (and allocates DMA buffers) - -3.4 HID over ISH Client -Location: drivers/hid/intel-ish-hid - -The ISHTP client driver is responsible for: -- enumerate HID devices under FW ISH client -- Get Report descriptor -- Register with HID core as a LL driver -- Process Get/Set feature request -- Get input reports - -3.5 HID Sensor Hub MFD and IIO sensor drivers - -The functionality in these drivers is the same as an external sensor hub. -Refer to -Documentation/hid/hid-sensor.txt for HID sensor -Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space - -3.6 End to End HID transport Sequence Diagram - -HID-ISH-CLN ISHTP IPC HW - | | | | - | | |-----WAKE UP------------------>| - | | | | - | | |-----HOST READY--------------->| - | | | | - | | |<----MNG_RESET_NOTIFY_ACK----- | - | | | | - | |<----ISHTP_START------ | | - | | | | - | |<-----------------HOST_START_RES_CMD-------------------| - | | | | - | |------------------QUERY_SUBSCRIBER-------------------->| - | | | | - | |------------------HOST_ENUM_REQ_CMD------------------->| - | | | | - | |<-----------------HOST_ENUM_RES_CMD--------------------| - | | | | - | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| - | | | | - | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| - | Create new device on in ishtp bus | | - | | | | - | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| - | | | | - | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| - | Create new device on in ishtp bus | | - | | | | - | |--Repeat HOST_CLIENT_PROPERTIES_REQ_CMD-till last one--| - | | | | - probed() - |----ishtp_cl_connect-->|----------------- CLIENT_CONNECT_REQ_CMD-------------->| - | | | | - | |<----------------CLIENT_CONNECT_RES_CMD----------------| - | | | | - |register event callback| | | - | | | | - |ishtp_cl_send( - HOSTIF_DM_ENUM_DEVICES) |----------fill ishtp_msg_hdr struct write to HW----- >| - | | | | - | | |<-----IRQ(IPC_PROTOCOL_ISHTP---| - | | | | - |<--ENUM_DEVICE RSP-----| | | - | | | | -for each enumerated device - |ishtp_cl_send( - HOSTIF_GET_HID_DESCRIPTOR |----------fill ishtp_msg_hdr struct write to HW--- >| - | | | | - ...Response - | | | | -for each enumerated device - |ishtp_cl_send( - HOSTIF_GET_REPORT_DESCRIPTOR |----------fill ishtp_msg_hdr struct write to HW- >| - | | | | - | | | | - hid_allocate_device - | | | | - hid_add_device | | | - | | | | - - -3.7 ISH Debugging - -To debug ISH, event tracing mechanism is used. To enable debug logs -echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable -cat sys/kernel/debug/tracing/trace - -3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260 - -root@otcpl-ThinkPad-Yoga-260:~# tree -l /sys/bus/iio/devices/ -/sys/bus/iio/devices/ -├── iio:device0 -> ../../../devices/0044:8086:22D8.0001/HID-SENSOR-200073.9.auto/iio:device0 -│ ├── buffer -│ │ ├── enable -│ │ ├── length -│ │ └── watermark -... -│ ├── in_accel_hysteresis -│ ├── in_accel_offset -│ ├── in_accel_sampling_frequency -│ ├── in_accel_scale -│ ├── in_accel_x_raw -│ ├── in_accel_y_raw -│ ├── in_accel_z_raw -│ ├── name -│ ├── scan_elements -│ │ ├── in_accel_x_en -│ │ ├── in_accel_x_index -│ │ ├── in_accel_x_type -│ │ ├── in_accel_y_en -│ │ ├── in_accel_y_index -│ │ ├── in_accel_y_type -│ │ ├── in_accel_z_en -│ │ ├── in_accel_z_index -│ │ └── in_accel_z_type -... -│ │ ├── devices -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_intensity_both_raw -│ │ │ │ ├── in_intensity_hysteresis -│ │ │ │ ├── in_intensity_offset -│ │ │ │ ├── in_intensity_sampling_frequency -│ │ │ │ ├── in_intensity_scale -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_intensity_both_en -│ │ │ │ │ ├── in_intensity_both_index -│ │ │ │ │ └── in_intensity_both_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_magn_hysteresis -│ │ │ │ ├── in_magn_offset -│ │ │ │ ├── in_magn_sampling_frequency -│ │ │ │ ├── in_magn_scale -│ │ │ │ ├── in_magn_x_raw -│ │ │ │ ├── in_magn_y_raw -│ │ │ │ ├── in_magn_z_raw -│ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_raw -│ │ │ │ ├── in_rot_hysteresis -│ │ │ │ ├── in_rot_offset -│ │ │ │ ├── in_rot_sampling_frequency -│ │ │ │ ├── in_rot_scale -│ │ │ │ ├── name -... -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_magn_x_en -│ │ │ │ │ ├── in_magn_x_index -│ │ │ │ │ ├── in_magn_x_type -│ │ │ │ │ ├── in_magn_y_en -│ │ │ │ │ ├── in_magn_y_index -│ │ │ │ │ ├── in_magn_y_type -│ │ │ │ │ ├── in_magn_z_en -│ │ │ │ │ ├── in_magn_z_index -│ │ │ │ │ ├── in_magn_z_type -│ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_en -│ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_index -│ │ │ │ │ └── in_rot_from_north_magnetic_tilt_comp_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_anglvel_hysteresis -│ │ │ │ ├── in_anglvel_offset -│ │ │ │ ├── in_anglvel_sampling_frequency -│ │ │ │ ├── in_anglvel_scale -│ │ │ │ ├── in_anglvel_x_raw -│ │ │ │ ├── in_anglvel_y_raw -│ │ │ │ ├── in_anglvel_z_raw -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_anglvel_x_en -│ │ │ │ │ ├── in_anglvel_x_index -│ │ │ │ │ ├── in_anglvel_x_type -│ │ │ │ │ ├── in_anglvel_y_en -│ │ │ │ │ ├── in_anglvel_y_index -│ │ │ │ │ ├── in_anglvel_y_type -│ │ │ │ │ ├── in_anglvel_z_en -│ │ │ │ │ ├── in_anglvel_z_index -│ │ │ │ │ └── in_anglvel_z_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_anglvel_hysteresis -│ │ │ │ ├── in_anglvel_offset -│ │ │ │ ├── in_anglvel_sampling_frequency -│ │ │ │ ├── in_anglvel_scale -│ │ │ │ ├── in_anglvel_x_raw -│ │ │ │ ├── in_anglvel_y_raw -│ │ │ │ ├── in_anglvel_z_raw -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_anglvel_x_en -│ │ │ │ │ ├── in_anglvel_x_index -│ │ │ │ │ ├── in_anglvel_x_type -│ │ │ │ │ ├── in_anglvel_y_en -│ │ │ │ │ ├── in_anglvel_y_index -│ │ │ │ │ ├── in_anglvel_y_type -│ │ │ │ │ ├── in_anglvel_z_en -│ │ │ │ │ ├── in_anglvel_z_index -│ │ │ │ │ └── in_anglvel_z_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -...Documentation/hid/uhid.rst renamed from Documentation/hid/uhid.txt +26
-20@@ -1,5 +1,6 @@ - UHID - User-space I/O driver support for HID subsystem - ======================================================== +====================================================== +UHID - User-space I/O driver support for HID subsystem +====================================================== UHID allows user-space to implement HID transport drivers. Please see hid-transport.txt for an introduction into HID transport drivers. This document@@ -22,9 +23,9 @@ If a new device is detected by your HID I/O Driver and you want to register this device with the HID subsystem, then you need to open /dev/uhid once for each device you want to register. All further communication is done by read()'ing or write()'ing "struct uhid_event" objects. Non-blocking operations are supported -by setting O_NONBLOCK. +by setting O_NONBLOCK:: -struct uhid_event { + struct uhid_event { __u32 type; union { struct uhid_create2_req create2;@@ -32,7 +33,7 @@ struct uhid_event { struct uhid_input2_req input2; } u; -}; + }; The "type" field contains the ID of the event. Depending on the ID different payloads are sent. You must not split a single event across multiple read()'s or@@ -86,31 +87,31 @@ the request was handled successfully. O_NONBLOCK does not affect write() as writes are always handled immediately in a non-blocking fashion. Future requests might make use of O_NONBLOCK, though. - UHID_CREATE2: +UHID_CREATE2: This creates the internal HID device. No I/O is possible until you send this event to the kernel. The payload is of type struct uhid_create2_req and contains information about your device. You can start I/O now. - UHID_DESTROY: +UHID_DESTROY: This destroys the internal HID device. No further I/O will be accepted. There may still be pending messages that you can receive with read() but no further UHID_INPUT events can be sent to the kernel. You can create a new device by sending UHID_CREATE2 again. There is no need to reopen the character device. - UHID_INPUT2: +UHID_INPUT2: You must send UHID_CREATE2 before sending input to the kernel! This event contains a data-payload. This is the raw data that you read from your device on the interrupt channel. The kernel will parse the HID reports. - UHID_GET_REPORT_REPLY: +UHID_GET_REPORT_REPLY: If you receive a UHID_GET_REPORT request you must answer with this request. You must copy the "id" field from the request into the answer. Set the "err" field to 0 if no error occurred or to EIO if an I/O error occurred. If "err" is 0 then you should fill the buffer of the answer with the results of the GET_REPORT request and set "size" correspondingly. - UHID_SET_REPORT_REPLY: +UHID_SET_REPORT_REPLY: This is the SET_REPORT equivalent of UHID_GET_REPORT_REPLY. Unlike GET_REPORT, SET_REPORT never returns a data buffer, therefore, it's sufficient to set the "id" and "err" fields correctly.@@ -120,16 +121,18 @@ read() read() will return a queued output report. No reaction is required to any of them but you should handle them according to your needs. - UHID_START: +UHID_START: This is sent when the HID device is started. Consider this as an answer to UHID_CREATE2. This is always the first event that is sent. Note that this event might not be available immediately after write(UHID_CREATE2) returns. Device drivers might required delayed setups. This event contains a payload of type uhid_start_req. The "dev_flags" field describes special behaviors of a device. The following flags are defined: - UHID_DEV_NUMBERED_FEATURE_REPORTS: - UHID_DEV_NUMBERED_OUTPUT_REPORTS: - UHID_DEV_NUMBERED_INPUT_REPORTS: + + - UHID_DEV_NUMBERED_FEATURE_REPORTS + - UHID_DEV_NUMBERED_OUTPUT_REPORTS + - UHID_DEV_NUMBERED_INPUT_REPORTS + Each of these flags defines whether a given report-type uses numbered reports. If numbered reports are used for a type, all messages from the kernel already have the report-number as prefix. Otherwise, no@@ -137,33 +140,35 @@ them but you should handle them according to your needs. For messages sent by user-space to the kernel, you must adjust the prefixes according to these flags. - UHID_STOP: +UHID_STOP: This is sent when the HID device is stopped. Consider this as an answer to UHID_DESTROY. + If you didn't destroy your device via UHID_DESTROY, but the kernel sends an UHID_STOP event, this should usually be ignored. It means that the kernel reloaded/changed the device driver loaded on your HID device (or some other maintenance actions happened). + You can usually ignored any UHID_STOP events safely. - UHID_OPEN: +UHID_OPEN: This is sent when the HID device is opened. That is, the data that the HID device provides is read by some other process. You may ignore this event but it is useful for power-management. As long as you haven't received this event there is actually no other process that reads your data so there is no need to send UHID_INPUT2 events to the kernel. - UHID_CLOSE: +UHID_CLOSE: This is sent when there are no more processes which read the HID data. It is the counterpart of UHID_OPEN and you may as well ignore this event. - UHID_OUTPUT: +UHID_OUTPUT: This is sent if the HID device driver wants to send raw data to the I/O device on the interrupt channel. You should read the payload and forward it to the device. The payload is of type "struct uhid_output_req". This may be received even though you haven't received UHID_OPEN, yet. - UHID_GET_REPORT: +UHID_GET_REPORT: This event is sent if the kernel driver wants to perform a GET_REPORT request on the control channeld as described in the HID specs. The report-type and report-number are available in the payload.@@ -177,11 +182,12 @@ them but you should handle them according to your needs. timed out, the kernel will ignore the response silently. The "id" field is never re-used, so conflicts cannot happen. - UHID_SET_REPORT: +UHID_SET_REPORT: This is the SET_REPORT equivalent of UHID_GET_REPORT. On receipt, you shall send a SET_REPORT request to your hid device. Once it replies, you must tell the kernel about it via UHID_SET_REPORT_REPLY. The same restrictions as for UHID_GET_REPORT apply. ---------------------------------------------------- + Written 2012, David Herrmann <[email protected]>Documentation/input/input.rst +1
-1@@ -188,7 +188,7 @@ LCDs and many other purposes. The monitor and speaker controls should be easy to add to the hid/input interface, but for the UPSs and LCDs it doesn't make much sense. For this, -the hiddev interface was designed. See Documentation/hid/hiddev.txt +the hiddev interface was designed. See Documentation/hid/hiddev.rst for more information about it. The usage of the usbhid module is very simple, it takes no parameters,MAINTAINERS +1
-2@@ -16383,7 +16383,7 @@ M: Benjamin Tissoires <[email protected]> L: [email protected] T: git git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git S: Maintained -F: Documentation/hid/hiddev.txt +F: Documentation/hid/hiddev.rst F: drivers/hid/usbhid/ USB INTEL XHCI ROLE MUX DRIVER --2.21.0
Re: [PATCH v1 20/31] docs: hid: convert to ReST
Em Thu, 13 Jun 2019 10:08:34 +0200
Benjamin Tissoires <[email protected]> escreveu:
Quoted 14 lines
Quoted 12 lines · Mauro Carvalho Chehab
Rename the HID documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
While here, fix the sysfs example from hid-sensor.txt, that has a lot of "?" instead of the proper UTF-8 characters that are produced by the tree command.
At its new
index.rst, let's add a :orphan: while this is not linked to the mainindex.rstfile, in order to avoid build warnings.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>---
Do you need to take this patch through the doc tree or should we carry it in the HID one?
Each patch in this series is pretty much independent. So, feel free to apply it via the HID tree.
Quoted 2,261 lines
Cheers,
BenjaminQuoted 2,257 lines
.../hid/{hid-alps.txt => hid-alps.rst} | 85 ++- .../hid/{hid-sensor.txt => hid-sensor.rst} | 192 +++---- .../{hid-transport.txt => hid-transport.rst} | 82 ++- Documentation/hid/{hiddev.txt => hiddev.rst} | 154 ++++-- Documentation/hid/{hidraw.txt => hidraw.rst} | 53 +- Documentation/hid/index.rst | 18 + Documentation/hid/intel-ish-hid.rst | 485 ++++++++++++++++++ Documentation/hid/intel-ish-hid.txt | 454 ---------------- Documentation/hid/{uhid.txt => uhid.rst} | 46 +- Documentation/input/input.rst | 2 +- MAINTAINERS | 2 +- 11 files changed, 897 insertions(+), 676 deletions(-) rename Documentation/hid/{hid-alps.txt => hid-alps.rst} (64%) rename Documentation/hid/{hid-sensor.txt => hid-sensor.rst} (61%) rename Documentation/hid/{hid-transport.txt => hid-transport.rst} (93%) rename Documentation/hid/{hiddev.txt => hiddev.rst} (77%) rename Documentation/hid/{hidraw.txt => hidraw.rst} (89%) create mode 100644 Documentation/hid/index.rst create mode 100644 Documentation/hid/intel-ish-hid.rst delete mode 100644 Documentation/hid/intel-ish-hid.txt rename Documentation/hid/{uhid.txt => uhid.rst} (94%)Documentation/hid/hid-alps.rst renamed from Documentation/hid/hid-alps.txt +63
-22@@ -1,19 +1,26 @@ +========================== ALPS HID Touchpad Protocol ----------------------- +========================== Introduction ------------ Currently ALPS HID driver supports U1 Touchpad device. -U1 devuce basic information. +U1 device basic information. + +========== ====== Vender ID 0x044E Product ID 0x120B Version ID 0x0121 +========== ====== HID Descriptor ------------- +-------------- + +======= ==================== ===== ======================================= Byte Field Value Notes +======= ==================== ===== ======================================= 0 wHIDDescLength 001E Length of HID Descriptor : 30 bytes 2 bcdVersion 0100 Compliant with Version 1.00 4 wReportDescLength 00B2 Report Descriptor is 178 Bytes (0x00B2)@@ -28,32 +35,42 @@ Byte Field Value Notes 22 wProductID 120B Product ID 0x120B 24 wVersionID 0121 Version 01.21 26 RESERVED 0000 RESERVED +======= ==================== ===== ======================================= Report ID ------------- -ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP -ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP -ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP -ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP -ReportID-5 (Feature Reports) Feature Reports -ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP -ReportID-7 (Feature Reports) Flash update (Bootloader) +--------- + +========== ================= ========================================= +ReportID-1 (Input Reports) (HIDUsage-Mouse) for TP&SP +ReportID-2 (Input Reports) (HIDUsage-keyboard) for TP +ReportID-3 (Input Reports) (Vendor Usage: Max 10 finger data) for TP +ReportID-4 (Input Reports) (Vendor Usage: ON bit data) for GP +ReportID-5 (Feature Reports) Feature Reports +ReportID-6 (Input Reports) (Vendor Usage: StickPointer data) for SP +ReportID-7 (Feature Reports) Flash update (Bootloader) +========== ================= ========================================= Data pattern ------------ + +===== ========== ===== ================= Case1 ReportID_1 TP/SP Relative/Relative Case2 ReportID_3 TP Absolute ReportID_6 SP Absolute +===== ========== ===== ================= Command Read/Write ------------------ To read/write to RAM, need to send a commands to the device. + The command format is as below. DataByte(SET_REPORT) + +===== ====================== Byte1 Command Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1@@ -61,13 +78,19 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Command Byte is read=0xD1/write=0xD2 . + Address is read/write RAM address. + Value Byte is writing data when you send the write commands. + When you read RAM, there is no meaning. DataByte(GET_REPORT) + +===== ====================== Byte1 Response Byte Byte2 Address - Byte 0 (LSB) Byte3 Address - Byte 1@@ -75,6 +98,7 @@ Byte4 Address - Byte 2 Byte5 Address - Byte 3 (MSB) Byte6 Value Byte Byte7 Checksum +===== ====================== Read value is stored in Value Byte.@@ -82,7 +106,11 @@ Read value is stored in Value Byte. Packet Format Touchpad data byte ------------------ - b7 b6 b5 b4 b3 b2 b1 b0 + + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== 1 0 0 SW6 SW5 SW4 SW3 SW2 SW1 2 0 0 0 Fcv Fn3 Fn2 Fn1 Fn0 3 Xa0_7 Xa0_6 Xa0_5 Xa0_4 Xa0_3 Xa0_2 Xa0_1 Xa0_0@@ -114,17 +142,25 @@ Touchpad data byte 25 Ya4_7 Ya4_6 Ya4_5 Ya4_4 Ya4_3 Ya4_2 Ya4_1 Ya4_0 26 Ya4_15 Ya4_14 Ya4_13 Ya4_12 Ya4_11 Ya4_10 Ya4_9 Ya4_8 27 LFB4 Zs4_6 Zs4_5 Zs4_4 Zs4_3 Zs4_2 Zs4_1 Zs4_0 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW6: SW ON/OFF status -Xan_15-0(16bit):X Absolute data of the "n"th finger -Yan_15-0(16bit):Y Absolute data of the "n"th finger -Zsn_6-0(7bit): Operation area of the "n"th finger +SW1-SW6: + SW ON/OFF status +Xan_15-0(16bit): + X Absolute data of the "n"th finger +Yan_15-0(16bit): + Y Absolute data of the "n"th finger +Zsn_6-0(7bit): + Operation area of the "n"th finger StickPointer data byte ------------------- - b7 b6 b5 b4 b3 b2 b1 b0 +---------------------- + +======= ======= ======= ======= ======= ======= ======= ======= ===== +- b7 b6 b5 b4 b3 b2 b1 b0 +======= ======= ======= ======= ======= ======= ======= ======= ===== Byte1 1 1 1 0 1 SW3 SW2 SW1 Byte2 X7 X6 X5 X4 X3 X2 X1 X0 Byte3 X15 X14 X13 X12 X11 X10 X9 X8@@ -132,8 +168,13 @@ Byte4 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Byte5 Y15 Y14 Y13 Y12 Y11 Y10 Y9 Y8 Byte6 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 Byte7 T&P Z14 Z13 Z12 Z11 Z10 Z9 Z8 +======= ======= ======= ======= ======= ======= ======= ======= ===== -SW1-SW3: SW ON/OFF status -Xn_15-0(16bit):X Absolute data -Yn_15-0(16bit):Y Absolute data -Zn_14-0(15bit):Z +SW1-SW3: + SW ON/OFF status +Xn_15-0(16bit): + X Absolute data +Yn_15-0(16bit): + Y Absolute data +Zn_14-0(15bit): + ZDocumentation/hid/hid-sensor.rst renamed from Documentation/hid/hid-sensor.txt +105
-87@@ -1,6 +1,6 @@ - +===================== HID Sensors Framework -====================== +===================== HID sensor framework provides necessary interfaces to implement sensor drivers, which are connected to a sensor hub. The sensor hub is a HID device and it provides a report descriptor conforming to HID 1.12 sensor usage tables.@@ -15,22 +15,22 @@ the drivers themselves." This specification describes many usage IDs, which describe the type of sensor and also the individual data fields. Each sensor can have variable number of data fields. The length and order is specified in the report descriptor. For -example a part of report descriptor can look like: +example a part of report descriptor can look like:: - INPUT(1)[INPUT] - .. - Field(2) - Physical(0020.0073) - Usage(1) - 0020.045f - Logical Minimum(-32767) - Logical Maximum(32767) - Report Size(8) - Report Count(1) - Report Offset(16) - Flags(Variable Absolute) -.. -.. + INPUT(1)[INPUT] + .. + Field(2) + Physical(0020.0073) + Usage(1) + 0020.045f + Logical Minimum(-32767) + Logical Maximum(32767) + Report Size(8) + Report Count(1) + Report Offset(16) + Flags(Variable Absolute) + .. + .. The report is indicating "sensor page (0x20)" contains an accelerometer-3D (0x73). This accelerometer-3D has some fields. Here for example field 2 is motion intensity@@ -40,13 +40,14 @@ data will use this format. Implementation -================= +============== This specification defines many different types of sensors with different sets of data fields. It is difficult to have a common input event to user space applications, for different sensors. For example an accelerometer can send X,Y and Z data, whereas an ambient light sensor can send illumination data. So the implementation has two parts: + - Core hid driver - Individual sensor processing part (sensor drivers)@@ -55,8 +56,11 @@ Core driver The core driver registers (hid-sensor-hub) registers as a HID driver. It parses report descriptors and identifies all the sensors present. It adds an MFD device with name HID-SENSOR-xxxx (where xxxx is usage id from the specification). -For example + +For example: + HID-SENSOR-200073 is registered for an Accelerometer 3D driver. + So if any driver with this name is inserted, then the probe routine for that function will be called. So an accelerometer processing driver can register with this name and will be probed if there is an accelerometer-3D detected.@@ -66,7 +70,8 @@ drivers to register and get events for that usage id. Also it provides parsing functions, which get and set each input/feature/output report. Individual sensor processing part (sensor drivers) ------------ +-------------------------------------------------- + The processing driver will use an interface provided by the core driver to parse the report and get the indexes of the fields and also can get events. This driver can use IIO interface to use the standard ABI defined for a type of sensor.@@ -75,31 +80,34 @@ can use IIO interface to use the standard ABI defined for a type of sensor. Core driver Interface ===================== -Callback structure: -Each processing driver can use this structure to set some callbacks. +Callback structure:: + + Each processing driver can use this structure to set some callbacks. int (*suspend)(..): Callback when HID suspend is received int (*resume)(..): Callback when HID resume is received int (*capture_sample)(..): Capture a sample for one of its data fields int (*send_event)(..): One complete event is received which can have multiple data fields. -Registration functions: -int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, +Registration functions:: + + int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, u32 usage_id, struct hid_sensor_hub_callbacks *usage_callback): Registers callbacks for an usage id. The callback functions are not allowed -to sleep. +to sleep:: -int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, + int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, u32 usage_id): Removes callbacks for an usage id. -Parsing function: -int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, +Parsing function:: + + int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, u8 type, u32 usage_id, u32 attr_usage_id, struct hid_sensor_hub_attribute_info *info);@@ -110,26 +118,27 @@ so that fields can be set or get individually. These indexes avoid searching every time and getting field index to get or set. -Set Feature report -int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, +Set Feature report:: + + int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 value); This interface is used to set a value for a field in feature report. For example if there is a field report_interval, which is parsed by a call to -sensor_hub_input_get_attribute_info before, then it can directly set that individual -field. +sensor_hub_input_get_attribute_info before, then it can directly set that +individual field:: -int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, + int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 *value); This interface is used to get a value for a field in input report. For example if there is a field report_interval, which is parsed by a call to -sensor_hub_input_get_attribute_info before, then it can directly get that individual -field value. +sensor_hub_input_get_attribute_info before, then it can directly get that +individual field value:: -int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, + int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, u32 usage_id, u32 attr_usage_id, u32 report_id);@@ -143,6 +152,8 @@ registered callback function to process the sample. ---------- HID Custom and generic Sensors +------------------------------ + HID Sensor specification defines two special sensor usage types. Since they don't represent a standard sensor, it is not possible to define using Linux IIO@@ -158,66 +169,73 @@ keyboard attached/detached or lid open/close. To allow application to utilize these sensors, here they are exported uses sysfs attribute groups, attributes and misc device interface. -An example of this representation on sysfs: -/sys/devices/pci0000:00/INT33C2:00/i2c-0/i2c-INT33D1:00/0018:8086:09FA.0001/HID-SENSOR-2000e1.6.auto$ tree -R -. -????????? enable_sensor -????????? feature-0-200316 -??????? ????????? feature-0-200316-maximum -??????? ????????? feature-0-200316-minimum -??????? ????????? feature-0-200316-name -??????? ????????? feature-0-200316-size -??????? ????????? feature-0-200316-unit-expo -??????? ????????? feature-0-200316-units -??????? ????????? feature-0-200316-value -????????? feature-1-200201 -??????? ????????? feature-1-200201-maximum -??????? ????????? feature-1-200201-minimum -??????? ????????? feature-1-200201-name -??????? ????????? feature-1-200201-size -??????? ????????? feature-1-200201-unit-expo -??????? ????????? feature-1-200201-units -??????? ????????? feature-1-200201-value -????????? input-0-200201 -??????? ????????? input-0-200201-maximum -??????? ????????? input-0-200201-minimum -??????? ????????? input-0-200201-name -??????? ????????? input-0-200201-size -??????? ????????? input-0-200201-unit-expo -??????? ????????? input-0-200201-units -??????? ????????? input-0-200201-value -????????? input-1-200202 -??????? ????????? input-1-200202-maximum -??????? ????????? input-1-200202-minimum -??????? ????????? input-1-200202-name -??????? ????????? input-1-200202-size -??????? ????????? input-1-200202-unit-expo -??????? ????????? input-1-200202-units -??????? ????????? input-1-200202-value +An example of this representation on sysfs:: + + /sys/devices/pci0000:00/INT33C2:00/i2c-0/i2c-INT33D1:00/0018:8086:09FA.0001/HID-SENSOR-2000e1.6.auto$ tree -R + . + │ ├── enable_sensor + │ │ ├── feature-0-200316 + │ │ │ ├── feature-0-200316-maximum + │ │ │ ├── feature-0-200316-minimum + │ │ │ ├── feature-0-200316-name + │ │ │ ├── feature-0-200316-size + │ │ │ ├── feature-0-200316-unit-expo + │ │ │ ├── feature-0-200316-units + │ │ │ ├── feature-0-200316-value + │ │ ├── feature-1-200201 + │ │ │ ├── feature-1-200201-maximum + │ │ │ ├── feature-1-200201-minimum + │ │ │ ├── feature-1-200201-name + │ │ │ ├── feature-1-200201-size + │ │ │ ├── feature-1-200201-unit-expo + │ │ │ ├── feature-1-200201-units + │ │ │ ├── feature-1-200201-value + │ │ ├── input-0-200201 + │ │ │ ├── input-0-200201-maximum + │ │ │ ├── input-0-200201-minimum + │ │ │ ├── input-0-200201-name + │ │ │ ├── input-0-200201-size + │ │ │ ├── input-0-200201-unit-expo + │ │ │ ├── input-0-200201-units + │ │ │ ├── input-0-200201-value + │ │ ├── input-1-200202 + │ │ │ ├── input-1-200202-maximum + │ │ │ ├── input-1-200202-minimum + │ │ │ ├── input-1-200202-name + │ │ │ ├── input-1-200202-size + │ │ │ ├── input-1-200202-unit-expo + │ │ │ ├── input-1-200202-units + │ │ │ ├── input-1-200202-value Here there is a custom sensors with four fields, two feature and two inputs. Each field is represented by a set of attributes. All fields except the "value" are read only. The value field is a RW field. -Example -/sys/bus/platform/devices/HID-SENSOR-2000e1.6.auto/feature-0-200316$ grep -r . * -feature-0-200316-maximum:6 -feature-0-200316-minimum:0 -feature-0-200316-name:property-reporting-state -feature-0-200316-size:1 -feature-0-200316-unit-expo:0 -feature-0-200316-units:25 -feature-0-200316-value:1 + +Example:: + + /sys/bus/platform/devices/HID-SENSOR-2000e1.6.auto/feature-0-200316$ grep -r . * + feature-0-200316-maximum:6 + feature-0-200316-minimum:0 + feature-0-200316-name:property-reporting-state + feature-0-200316-size:1 + feature-0-200316-unit-expo:0 + feature-0-200316-units:25 + feature-0-200316-value:1 How to enable such sensor? +^^^^^^^^^^^^^^^^^^^^^^^^^^ + By default sensor can be power gated. To enable sysfs attribute "enable" can be -used. -$ echo 1 > enable_sensor +used:: + + $ echo 1 > enable_sensor Once enabled and powered on, sensor can report value using HID reports. -These reports are pushed using misc device interface in a FIFO order. -/dev$ tree | grep HID-SENSOR-2000e1.6.auto -??????? ????????? 10:53 -> ../HID-SENSOR-2000e1.6.auto -????????? HID-SENSOR-2000e1.6.auto +These reports are pushed using misc device interface in a FIFO order:: + + /dev$ tree | grep HID-SENSOR-2000e1.6.auto + │ │ │ ├── 10:53 -> ../HID-SENSOR-2000e1.6.auto + │ ├── HID-SENSOR-2000e1.6.auto Each reports can be of variable length preceded by a header. This header consist of a 32 bit usage id, 64 bit time stamp and 32 bit length field of rawDocumentation/hid/hid-transport.rst renamed from Documentation/hid/hid-transport.txt +62
-20@@ -1,5 +1,6 @@ - HID I/O Transport Drivers - =========================== +========================= +HID I/O Transport Drivers +========================= The HID subsystem is independent of the underlying transport driver. Initially, only USB was supported, but other specifications adopted the HID design and@@ -16,6 +17,8 @@ transport and device setup/management. HID core is responsible of report-parsing, report interpretation and the user-space API. Device specifics and quirks are handled by all layers depending on the quirk. +:: + +-----------+ +-----------+ +-----------+ +-----------+ | Device #1 | | Device #i | | Device #j | | Device #k | +-----------+ +-----------+ +-----------+ +-----------+@@ -42,8 +45,9 @@ and quirks are handled by all layers depending on the quirk. +----------------+ +-----------+ +------------------+ +------------------+ Example Drivers: - I/O: USB, I2C, Bluetooth-l2cap - Transport: USB-HID, I2C-HID, BT-HIDP + + - I/O: USB, I2C, Bluetooth-l2cap + - Transport: USB-HID, I2C-HID, BT-HIDP Everything below "HID Core" is simplified in this graph as it is only of interest to HID device drivers. Transport drivers do not need to know the@@ -183,7 +187,7 @@ Other ctrl-channel requests are supported by USB-HID but are not available ------------------- Transport drivers normally use the following procedure to register a new device -with HID core: +with HID core:: struct hid_device *hid; int ret;@@ -215,7 +219,7 @@ Once hid_add_device() is entered, HID core might use the callbacks provided in "custom_ll_driver". Note that fields like "country" can be ignored by underlying transport-drivers if not supported. -To unregister a device, use: +To unregister a device, use:: hid_destroy_device(hid);@@ -226,73 +230,110 @@ driver callbacks. ----------------------------- The available HID callbacks are: - - int (*start) (struct hid_device *hdev) + + :: + + int (*start) (struct hid_device *hdev) + Called from HID device drivers once they want to use the device. Transport drivers can choose to setup their device in this callback. However, normally devices are already set up before transport drivers register them to HID core so this is mostly only used by USB-HID. - - void (*stop) (struct hid_device *hdev) + :: + + void (*stop) (struct hid_device *hdev) + Called from HID device drivers once they are done with a device. Transport drivers can free any buffers and deinitialize the device. But note that ->start() might be called again if another HID device driver is loaded on the device. + Transport drivers are free to ignore it and deinitialize devices after they destroyed them via hid_destroy_device(). - - int (*open) (struct hid_device *hdev) + :: + + int (*open) (struct hid_device *hdev) + Called from HID device drivers once they are interested in data reports. Usually, while user-space didn't open any input API/etc., device drivers are not interested in device data and transport drivers can put devices asleep. However, once ->open() is called, transport drivers must be ready for I/O. ->open() calls are nested for each client that opens the HID device. - - void (*close) (struct hid_device *hdev) + :: + + void (*close) (struct hid_device *hdev) + Called from HID device drivers after ->open() was called but they are no longer interested in device reports. (Usually if user-space closed any input devices of the driver). + Transport drivers can put devices asleep and terminate any I/O of all ->open() calls have been followed by a ->close() call. However, ->start() may be called again if the device driver is interested in input reports again. - - int (*parse) (struct hid_device *hdev) + :: + + int (*parse) (struct hid_device *hdev) + Called once during device setup after ->start() has been called. Transport drivers must read the HID report-descriptor from the device and tell HID core about it via hid_parse_report(). - - int (*power) (struct hid_device *hdev, int level) + :: + + int (*power) (struct hid_device *hdev, int level) + Called by HID core to give PM hints to transport drivers. Usually this is analogical to the ->open() and ->close() hints and redundant. - - void (*request) (struct hid_device *hdev, struct hid_report *report, - int reqtype) + :: + + void (*request) (struct hid_device *hdev, struct hid_report *report, + int reqtype) + Send an HID request on the ctrl channel. "report" contains the report that should be sent and "reqtype" the request type. Request-type can be HID_REQ_SET_REPORT or HID_REQ_GET_REPORT. + This callback is optional. If not provided, HID core will assemble a raw report following the HID specs and send it via the ->raw_request() callback. The transport driver is free to implement this asynchronously. - - int (*wait) (struct hid_device *hdev) + :: + + int (*wait) (struct hid_device *hdev) + Used by HID core before calling ->request() again. A transport driver can use it to wait for any pending requests to complete if only one request is allowed at a time. - - int (*raw_request) (struct hid_device *hdev, unsigned char reportnum, - __u8 *buf, size_t count, unsigned char rtype, - int reqtype) + :: + + int (*raw_request) (struct hid_device *hdev, unsigned char reportnum, + __u8 *buf, size_t count, unsigned char rtype, + int reqtype) + Same as ->request() but provides the report as raw buffer. This request shall be synchronous. A transport driver must not use ->wait() to complete such requests. This request is mandatory and hid core will reject the device if it is missing. - - int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len) + :: + + int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len) + Send raw output report via intr channel. Used by some HID device drivers which require high throughput for outgoing requests on the intr channel. This must not cause SET_REPORT calls! This must be implemented as asynchronous output report on the intr channel! - - int (*idle) (struct hid_device *hdev, int report, int idle, int reqtype) + :: + + int (*idle) (struct hid_device *hdev, int report, int idle, int reqtype) + Perform SET/GET_IDLE request. Only used by USB-HID, do not implement! 2.3) Data Path@@ -314,4 +355,5 @@ transport driver and not passed to hid_input_report(). Acknowledgements to SET_REPORT requests are not of interest to HID core. ---------------------------------------------------- + Written 2013, David Herrmann <[email protected]>Documentation/hid/hiddev.rst renamed from Documentation/hid/hiddev.txt +100
-54@@ -1,6 +1,9 @@ +================================================ Care and feeding of your Human Interface Devices +================================================ -INTRODUCTION +Introduction +============ In addition to the normal input type HID devices, USB also uses the human interface device protocols for things that are not really human@@ -16,38 +19,40 @@ normalised event interface - see Documentation/input/input.rst * the hiddev interface, which provides fairly raw HID events The data flow for a HID event produced by a device is something like -the following : +the following:: usb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event] | | - --> hiddev.c ----> POWER / MONITOR CONTROL + --> hiddev.c ----> POWER / MONITOR CONTROL In addition, other subsystems (apart from USB) can potentially feed events into the input subsystem, but these have no effect on the hid device interface. -USING THE HID DEVICE INTERFACE +Using the HID Device Interface +============================== The hiddev interface is a char interface using the normal USB major, with the minor numbers starting at 96 and finishing at 111. Therefore, -you need the following commands: -mknod /dev/usb/hiddev0 c 180 96 -mknod /dev/usb/hiddev1 c 180 97 -mknod /dev/usb/hiddev2 c 180 98 -mknod /dev/usb/hiddev3 c 180 99 -mknod /dev/usb/hiddev4 c 180 100 -mknod /dev/usb/hiddev5 c 180 101 -mknod /dev/usb/hiddev6 c 180 102 -mknod /dev/usb/hiddev7 c 180 103 -mknod /dev/usb/hiddev8 c 180 104 -mknod /dev/usb/hiddev9 c 180 105 -mknod /dev/usb/hiddev10 c 180 106 -mknod /dev/usb/hiddev11 c 180 107 -mknod /dev/usb/hiddev12 c 180 108 -mknod /dev/usb/hiddev13 c 180 109 -mknod /dev/usb/hiddev14 c 180 110 -mknod /dev/usb/hiddev15 c 180 111 +you need the following commands:: + + mknod /dev/usb/hiddev0 c 180 96 + mknod /dev/usb/hiddev1 c 180 97 + mknod /dev/usb/hiddev2 c 180 98 + mknod /dev/usb/hiddev3 c 180 99 + mknod /dev/usb/hiddev4 c 180 100 + mknod /dev/usb/hiddev5 c 180 101 + mknod /dev/usb/hiddev6 c 180 102 + mknod /dev/usb/hiddev7 c 180 103 + mknod /dev/usb/hiddev8 c 180 104 + mknod /dev/usb/hiddev9 c 180 105 + mknod /dev/usb/hiddev10 c 180 106 + mknod /dev/usb/hiddev11 c 180 107 + mknod /dev/usb/hiddev12 c 180 108 + mknod /dev/usb/hiddev13 c 180 109 + mknod /dev/usb/hiddev14 c 180 110 + mknod /dev/usb/hiddev15 c 180 111 So you point your hiddev compliant user-space program at the correct interface for your device, and it all just works.@@ -56,7 +61,9 @@ Assuming that you have a hiddev compliant user-space program, of course. If you need to write one, read on. -THE HIDDEV API +The HIDDEV API +============== + This description should be read in conjunction with the HID specification, freely available from http://www.usb.org, and conveniently linked of http://www.linux-usb.org.@@ -69,12 +76,14 @@ each of which can have one or more "usages". In the hid-core, each one of these usages has a single signed 32 bit value. read(): +------- + This is the event interface. When the HID device's state changes, it performs an interrupt transfer containing a report which contains the changed value. The hid-core.c module parses the report, and returns to hiddev.c the individual usages that have changed within the report. In its basic mode, the hiddev will make these individual -usage changes available to the reader using a struct hiddev_event: +usage changes available to the reader using a struct hiddev_event:: struct hiddev_event { unsigned hid;@@ -90,13 +99,19 @@ behavior of the read() function can be modified using the HIDIOCSFLAG ioctl() described below. -ioctl(): -This is the control interface. There are a number of controls: +ioctl(): +-------- -HIDIOCGVERSION - int (read) -Gets the version code out of the hiddev driver. +This is the control interface. There are a number of controls: + +HIDIOCGVERSION + - int (read) + + Gets the version code out of the hiddev driver. + +HIDIOCAPPLICATION + - (none) -HIDIOCAPPLICATION - (none) This ioctl call returns the HID application usage associated with the hid device. The third argument to ioctl() specifies which application index to get. This is useful when the device has more than one@@ -104,25 +119,33 @@ application collection. If the index is invalid (greater or equal to the number of application collections this device has) the ioctl returns -1. You can find out beforehand how many application collections the device has from the num_applications field from the -hiddev_devinfo structure. +hiddev_devinfo structure. + +HIDIOCGCOLLECTIONINFO + - struct hiddev_collection_info (read/write) -HIDIOCGCOLLECTIONINFO - struct hiddev_collection_info (read/write) This returns a superset of the information above, providing not only application collections, but all the collections the device has. It also returns the level the collection lives in the hierarchy. -The user passes in a hiddev_collection_info struct with the index -field set to the index that should be returned. The ioctl fills in -the other fields. If the index is larger than the last collection +The user passes in a hiddev_collection_info struct with the index +field set to the index that should be returned. The ioctl fills in +the other fields. If the index is larger than the last collection index, the ioctl returns -1 and sets errno to -EINVAL. -HIDIOCGDEVINFO - struct hiddev_devinfo (read) +HIDIOCGDEVINFO + - struct hiddev_devinfo (read) + Gets a hiddev_devinfo structure which describes the device. -HIDIOCGSTRING - struct hiddev_string_descriptor (read/write) +HIDIOCGSTRING + - struct hiddev_string_descriptor (read/write) + Gets a string descriptor from the device. The caller must fill in the "index" field to indicate which descriptor should be returned. -HIDIOCINITREPORT - (none) +HIDIOCINITREPORT + - (none) + Instructs the kernel to retrieve all input and feature report values from the device. At this point, all the usage structures will contain current values for the device, and will maintain it as the device@@ -130,21 +153,29 @@ changes. Note that the use of this ioctl is unnecessary in general, since later kernels automatically initialize the reports from the device at attach time. -HIDIOCGNAME - string (variable length) +HIDIOCGNAME + - string (variable length) + Gets the device name -HIDIOCGREPORT - struct hiddev_report_info (write) +HIDIOCGREPORT + - struct hiddev_report_info (write) + Instructs the kernel to get a feature or input report from the device, in order to selectively update the usage structures (in contrast to INITREPORT). -HIDIOCSREPORT - struct hiddev_report_info (write) +HIDIOCSREPORT + - struct hiddev_report_info (write) + Instructs the kernel to send a report to the device. This report can be filled in by the user through HIDIOCSUSAGE calls (below) to fill in individual usage values in the report before sending the report in full -to the device. +to the device. + +HIDIOCGREPORTINFO + - struct hiddev_report_info (read/write) -HIDIOCGREPORTINFO - struct hiddev_report_info (read/write) Fills in a hiddev_report_info structure for the user. The report is looked up by type (input, output or feature) and id, so these fields must be filled in by the user. The ID can be absolute -- the actual@@ -154,52 +185,67 @@ report_id) for the next report after report_id. Without a-priori information about report ids, the right way to use this ioctl is to use the relative IDs above to enumerate the valid IDs. The ioctl returns non-zero when there is no more next ID. The real report ID is -filled into the returned hiddev_report_info structure. +filled into the returned hiddev_report_info structure. + +HIDIOCGFIELDINFO + - struct hiddev_field_info (read/write) -HIDIOCGFIELDINFO - struct hiddev_field_info (read/write) Returns the field information associated with a report in a hiddev_field_info structure. The user must fill in report_id and report_type in this structure, as above. The field_index should also be filled in, which should be a number from 0 and maxfield-1, as -returned from a previous HIDIOCGREPORTINFO call. +returned from a previous HIDIOCGREPORTINFO call. + +HIDIOCGUCODE + - struct hiddev_usage_ref (read/write) -HIDIOCGUCODE - struct hiddev_usage_ref (read/write) Returns the usage_code in a hiddev_usage_ref structure, given that given its report type, report id, field index, and index within the field have already been filled into the structure. -HIDIOCGUSAGE - struct hiddev_usage_ref (read/write) +HIDIOCGUSAGE + - struct hiddev_usage_ref (read/write) + Returns the value of a usage in a hiddev_usage_ref structure. The usage to be retrieved can be specified as above, or the user can choose to fill in the report_type field and specify the report_id as HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be filled in with the report and field information associated with this -usage if it is found. +usage if it is found. + +HIDIOCSUSAGE + - struct hiddev_usage_ref (write) -HIDIOCSUSAGE - struct hiddev_usage_ref (write) Sets the value of a usage in an output report. The user fills in the hiddev_usage_ref structure as above, but additionally fills in the value field. -HIDIOGCOLLECTIONINDEX - struct hiddev_usage_ref (write) +HIDIOGCOLLECTIONINDEX + - struct hiddev_usage_ref (write) + Returns the collection index associated with this usage. This indicates where in the collection hierarchy this usage sits. -HIDIOCGFLAG - int (read) -HIDIOCSFLAG - int (write) +HIDIOCGFLAG + - int (read) +HIDIOCSFLAG + - int (write) + These operations respectively inspect and replace the mode flags that influence the read() call above. The flags are as follows: - HIDDEV_FLAG_UREF - read() calls will now return + HIDDEV_FLAG_UREF + - read() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity. - HIDDEV_FLAG_REPORT - This flag can only be used in conjunction + HIDDEV_FLAG_REPORT + - This flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned - to read() filled in with the report_type and report_id, but + to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.Documentation/hid/hidraw.rst renamed from Documentation/hid/hidraw.txt +36
-17@@ -1,5 +1,6 @@ - HIDRAW - Raw Access to USB and Bluetooth Human Interface Devices - ================================================================== +================================================================ +HIDRAW - Raw Access to USB and Bluetooth Human Interface Devices +================================================================ The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs). It differs from hiddev in that reports sent and@@ -31,6 +32,7 @@ directly under /dev (eg: /dev/hidraw0). As this location is distribution- and udev rule-dependent, applications should use libudev to locate hidraw devices attached to the system. There is a tutorial on libudev with a working example at: + http://www.signal11.us/oss/udev/ The HIDRAW API@@ -51,7 +53,7 @@ byte. For devices which do not use numbered reports, the report data will begin at the first byte. write() --------- +------- The write() function will write a report to the device. For USB devices, if the device has an INTERRUPT OUT endpoint, the report will be sent on that endpoint. If it does not, the report will be sent over the control endpoint,@@ -62,38 +64,52 @@ number. If the device does not use numbered reports, the first byte should be set to 0. The report data itself should begin at the second byte. ioctl() --------- +------- Hidraw supports the following ioctls: -HIDIOCGRDESCSIZE: Get Report Descriptor Size +HIDIOCGRDESCSIZE: + Get Report Descriptor Size + This ioctl will get the size of the device's report descriptor. -HIDIOCGRDESC: Get Report Descriptor +HIDIOCGRDESC: + Get Report Descriptor + This ioctl returns the device's report descriptor using a hidraw_report_descriptor struct. Make sure to set the size field of the hidraw_report_descriptor struct to the size returned from HIDIOCGRDESCSIZE. -HIDIOCGRAWINFO: Get Raw Info +HIDIOCGRAWINFO: + Get Raw Info + This ioctl will return a hidraw_devinfo struct containing the bus type, the vendor ID (VID), and product ID (PID) of the device. The bus type can be one -of: - BUS_USB - BUS_HIL - BUS_BLUETOOTH - BUS_VIRTUAL +of:: + + - BUS_USB + - BUS_HIL + - BUS_BLUETOOTH + - BUS_VIRTUAL + which are defined in uapi/linux/input.h. -HIDIOCGRAWNAME(len): Get Raw Name +HIDIOCGRAWNAME(len): + Get Raw Name + This ioctl returns a string containing the vendor and product strings of the device. The returned string is Unicode, UTF-8 encoded. -HIDIOCGRAWPHYS(len): Get Physical Address +HIDIOCGRAWPHYS(len): + Get Physical Address + This ioctl returns a string representing the physical address of the device. For USB devices, the string contains the physical path to the device (the USB controller, hubs, ports, etc). For Bluetooth devices, the string contains the hardware (MAC) address of the device. -HIDIOCSFEATURE(len): Send a Feature Report +HIDIOCSFEATURE(len): + Send a Feature Report + This ioctl will send a feature report to the device. Per the HID specification, feature reports are always sent using the control endpoint. Set the first byte of the supplied buffer to the report number. For devices@@ -101,7 +117,9 @@ which do not use numbered reports, set the first byte to 0. The report data begins in the second byte. Make sure to set len accordingly, to one more than the length of the report (to account for the report number). -HIDIOCGFEATURE(len): Get a Feature Report +HIDIOCGFEATURE(len): + Get a Feature Report + This ioctl will request a feature report from the device using the control endpoint. The first byte of the supplied buffer should be set to the report number of the requested report. For devices which do not use numbered@@ -109,11 +127,12 @@ reports, set the first byte to 0. The report will be returned starting at the first byte of the buffer (ie: the report number is not returned). Example ---------- +------- In samples/, find hid-example.c, which shows examples of read(), write(), and all the ioctls for hidraw. The code may be used by anyone for any purpose, and can serve as a starting point for developing applications using hidraw. Document by: + Alan Ott <[email protected]>, Signal 11 SoftwareDocumentation/hid/index.rst new file +18
-0@@ -0,0 +1,18 @@ +:orphan: + +============================= +Human Interface Devices (HID) +============================= + +.. toctree:: + :maxdepth: 1 + + hiddev + hidraw + hid-sensor + hid-transport + + uhid + + hid-alps + intel-ish-hidDocumentation/hid/intel-ish-hid.rst new file +485
-0@@ -0,0 +1,485 @@ +================================= +Intel Integrated Sensor Hub (ISH) +================================= + +A sensor hub enables the ability to offload sensor polling and algorithm +processing to a dedicated low power co-processor. This allows the core +processor to go into low power modes more often, resulting in the increased +battery life. + +There are many vendors providing external sensor hubs confirming to HID +Sensor usage tables, and used in several tablets, 2 in 1 convertible laptops +and embedded products. Linux had this support since Linux 3.9. + +Intel® introduced integrated sensor hubs as a part of the SoC starting from +Cherry Trail and now supported on multiple generations of CPU packages. There +are many commercial devices already shipped with Integrated Sensor Hubs (ISH). +These ISH also comply to HID sensor specification, but the difference is the +transport protocol used for communication. The current external sensor hubs +mainly use HID over i2C or USB. But ISH doesn't use either i2c or USB. + +1. Overview +=========== + +Using a analogy with a usbhid implementation, the ISH follows a similar model +for a very high speed communication:: + + ----------------- ---------------------- + | USB HID | --> | ISH HID | + ----------------- ---------------------- + ----------------- ---------------------- + | USB protocol | --> | ISH Transport | + ----------------- ---------------------- + ----------------- ---------------------- + | EHCI/XHCI | --> | ISH IPC | + ----------------- ---------------------- + PCI PCI + ----------------- ---------------------- + |Host controller| --> | ISH processor | + ----------------- ---------------------- + USB Link + ----------------- ---------------------- + | USB End points| --> | ISH Clients | + ----------------- ---------------------- + +Like USB protocol provides a method for device enumeration, link management +and user data encapsulation, the ISH also provides similar services. But it is +very light weight tailored to manage and communicate with ISH client +applications implemented in the firmware. + +The ISH allows multiple sensor management applications executing in the +firmware. Like USB endpoints the messaging can be to/from a client. As part of +enumeration process, these clients are identified. These clients can be simple +HID sensor applications, sensor calibration application or senor firmware +update application. + +The implementation model is similar, like USB bus, ISH transport is also +implemented as a bus. Each client application executing in the ISH processor +is registered as a device on this bus. The driver, which binds each device +(ISH HID driver) identifies the device type and registers with the hid core. + +2. ISH Implementation: Block Diagram +==================================== + +:: + + --------------------------- + | User Space Applications | + --------------------------- + + ----------------IIO ABI---------------- + -------------------------- + | IIO Sensor Drivers | + -------------------------- + -------------------------- + | IIO core | + -------------------------- + -------------------------- + | HID Sensor Hub MFD | + -------------------------- + -------------------------- + | HID Core | + -------------------------- + -------------------------- + | HID over ISH Client | + -------------------------- + -------------------------- + | ISH Transport (ISHTP) | + -------------------------- + -------------------------- + | IPC Drivers | + -------------------------- + OS + ---------------- PCI ----------------- + Hardware + Firmware + ---------------------------- + | ISH Hardware/Firmware(FW) | + ---------------------------- + +3. High level processing in above blocks +======================================== + +3.1 Hardware Interface +---------------------- + +The ISH is exposed as "Non-VGA unclassified PCI device" to the host. The PCI +product and vendor IDs are changed from different generations of processors. So +the source code which enumerate drivers needs to update from generation to +generation. + +3.2 Inter Processor Communication (IPC) driver +---------------------------------------------- + +Location: drivers/hid/intel-ish-hid/ipc + +The IPC message used memory mapped I/O. The registers are defined in +hw-ish-regs.h. + +3.2.1 IPC/FW message types +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There are two types of messages, one for management of link and other messages +are to and from transport layers. + +TX and RX of Transport messages +............................... + +A set of memory mapped register offers support of multi byte messages TX and +RX (E.g.IPC_REG_ISH2HOST_MSG, IPC_REG_HOST2ISH_MSG). The IPC layer maintains +internal queues to sequence messages and send them in order to the FW. +Optionally the caller can register handler to get notification of completion. +A door bell mechanism is used in messaging to trigger processing in host and +client firmware side. When ISH interrupt handler is called, the ISH2HOST +doorbell register is used by host drivers to determine that the interrupt +is for ISH. + +Each side has 32 32-bit message registers and a 32-bit doorbell. Doorbell +register has the following format: +Bits 0..6: fragment length (7 bits are used) +Bits 10..13: encapsulated protocol +Bits 16..19: management command (for IPC management protocol) +Bit 31: doorbell trigger (signal H/W interrupt to the other side) +Other bits are reserved, should be 0. + +3.2.2 Transport layer interface +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To abstract HW level IPC communication, a set of callbacks are registered. +The transport layer uses them to send and receive messages. +Refer to struct ishtp_hw_ops for callbacks. + +3.3 ISH Transport layer +----------------------- + +Location: drivers/hid/intel-ish-hid/ishtp/ + +3.3.1 A Generic Transport Layer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The transport layer is a bi-directional protocol, which defines: +- Set of commands to start, stop, connect, disconnect and flow control +(ishtp/hbm.h) for details +- A flow control mechanism to avoid buffer overflows + +This protocol resembles bus messages described in the following document: +http://www.intel.com/content/dam/www/public/us/en/documents/technical-\ +specifications/dcmi-hi-1-0-spec.pdf "Chapter 7: Bus Message Layer" + +3.3.2 Connection and Flow Control Mechanism +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Each FW client and a protocol is identified by an UUID. In order to communicate +to a FW client, a connection must be established using connect request and +response bus messages. If successful, a pair (host_client_id and fw_client_id) +will identify the connection. + +Once connection is established, peers send each other flow control bus messages +independently. Every peer may send a message only if it has received a +flow-control credit before. Once it sent a message, it may not send another one +before receiving the next flow control credit. +Either side can send disconnect request bus message to end communication. Also +the link will be dropped if major FW reset occurs. + +3.3.3 Peer to Peer data transfer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Peer to Peer data transfer can happen with or without using DMA. Depending on +the sensor bandwidth requirement DMA can be enabled by using module parameter +ishtp_use_dma under intel_ishtp. + +Each side (host and FW) manages its DMA transfer memory independently. When an +ISHTP client from either host or FW side wants to send something, it decides +whether to send over IPC or over DMA; for each transfer the decision is +independent. The sending side sends DMA_XFER message when the message is in +the respective host buffer (TX when host client sends, RX when FW client +sends). The recipient of DMA message responds with DMA_XFER_ACK, indicating +the sender that the memory region for that message may be reused. + +DMA initialization is started with host sending DMA_ALLOC_NOTIFY bus message +(that includes RX buffer) and FW responds with DMA_ALLOC_NOTIFY_ACK. +Additionally to DMA address communication, this sequence checks capabilities: +if thw host doesn't support DMA, then it won't send DMA allocation, so FW can't +send DMA; if FW doesn't support DMA then it won't respond with +DMA_ALLOC_NOTIFY_ACK, in which case host will not use DMA transfers. +Here ISH acts as busmaster DMA controller. Hence when host sends DMA_XFER, +it's request to do host->ISH DMA transfer; when FW sends DMA_XFER, it means +that it already did DMA and the message resides at host. Thus, DMA_XFER +and DMA_XFER_ACK act as ownership indicators. + +At initial state all outgoing memory belongs to the sender (TX to host, RX to +FW), DMA_XFER transfers ownership on the region that contains ISHTP message to +the receiving side, DMA_XFER_ACK returns ownership to the sender. A sender +needs not wait for previous DMA_XFER to be ack'ed, and may send another message +as long as remaining continuous memory in its ownership is enough. +In principle, multiple DMA_XFER and DMA_XFER_ACK messages may be sent at once +(up to IPC MTU), thus allowing for interrupt throttling. +Currently, ISH FW decides to send over DMA if ISHTP message is more than 3 IPC +fragments and via IPC otherwise. + +3.3.4 Ring Buffers +^^^^^^^^^^^^^^^^^^ + +When a client initiate a connection, a ring or RX and TX buffers are allocated. +The size of ring can be specified by the client. HID client set 16 and 32 for +TX and RX buffers respectively. On send request from client, the data to be +sent is copied to one of the send ring buffer and scheduled to be sent using +bus message protocol. These buffers are required because the FW may have not +have processed the last message and may not have enough flow control credits +to send. Same thing holds true on receive side and flow control is required. + +3.3.5 Host Enumeration +^^^^^^^^^^^^^^^^^^^^^^ + +The host enumeration bus command allow discovery of clients present in the FW. +There can be multiple sensor clients and clients for calibration function. + +To ease in implantation and allow independent driver handle each client +this transport layer takes advantage of Linux Bus driver model. Each +client is registered as device on the the transport bus (ishtp bus). + +Enumeration sequence of messages: + +- Host sends HOST_START_REQ_CMD, indicating that host ISHTP layer is up. +- FW responds with HOST_START_RES_CMD +- Host sends HOST_ENUM_REQ_CMD (enumerate FW clients) +- FW responds with HOST_ENUM_RES_CMD that includes bitmap of available FW + client IDs +- For each FW ID found in that bitmap host sends + HOST_CLIENT_PROPERTIES_REQ_CMD +- FW responds with HOST_CLIENT_PROPERTIES_RES_CMD. Properties include UUID, + max ISHTP message size, etc. +- Once host received properties for that last discovered client, it considers + ISHTP device fully functional (and allocates DMA buffers) + +3.4 HID over ISH Client +----------------------- + +Location: drivers/hid/intel-ish-hid + +The ISHTP client driver is responsible for: + +- enumerate HID devices under FW ISH client +- Get Report descriptor +- Register with HID core as a LL driver +- Process Get/Set feature request +- Get input reports + +3.5 HID Sensor Hub MFD and IIO sensor drivers +--------------------------------------------- + +The functionality in these drivers is the same as an external sensor hub. +Refer to +Documentation/hid/hid-sensor.rst for HID sensor +Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space + +3.6 End to End HID transport Sequence Diagram +--------------------------------------------- + +:: + + HID-ISH-CLN ISHTP IPC HW + | | | | + | | |-----WAKE UP------------------>| + | | | | + | | |-----HOST READY--------------->| + | | | | + | | |<----MNG_RESET_NOTIFY_ACK----- | + | | | | + | |<----ISHTP_START------ | | + | | | | + | |<-----------------HOST_START_RES_CMD-------------------| + | | | | + | |------------------QUERY_SUBSCRIBER-------------------->| + | | | | + | |------------------HOST_ENUM_REQ_CMD------------------->| + | | | | + | |<-----------------HOST_ENUM_RES_CMD--------------------| + | | | | + | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| + | | | | + | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| + | Create new device on in ishtp bus | | + | | | | + | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| + | | | | + | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| + | Create new device on in ishtp bus | | + | | | | + | |--Repeat HOST_CLIENT_PROPERTIES_REQ_CMD-till last one--| + | | | | + probed() + |----ishtp_cl_connect--->|----------------- CLIENT_CONNECT_REQ_CMD-------------->| + | | | | + | |<----------------CLIENT_CONNECT_RES_CMD----------------| + | | | | + |register event callback | | | + | | | | + |ishtp_cl_send( + HOSTIF_DM_ENUM_DEVICES) |----------fill ishtp_msg_hdr struct write to HW----- >| + | | | | + | | |<-----IRQ(IPC_PROTOCOL_ISHTP---| + | | | | + |<--ENUM_DEVICE RSP------| | | + | | | | + for each enumerated device + |ishtp_cl_send( + HOSTIF_GET_HID_DESCRIPTOR|----------fill ishtp_msg_hdr struct write to HW----- >| + | | | | + ...Response + | | | | + for each enumerated device + |ishtp_cl_send( + HOSTIF_GET_REPORT_DESCRIPTOR|--------------fill ishtp_msg_hdr struct write to HW-- >| + | | | | + | | | | + hid_allocate_device + | | | | + hid_add_device | | | + | | | | + + +3.7 ISH Debugging +----------------- + +To debug ISH, event tracing mechanism is used. To enable debug logs +echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable +cat sys/kernel/debug/tracing/trace + +3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260 +----------------------------------------------------- + +:: + + root@otcpl-ThinkPad-Yoga-260:~# tree -l /sys/bus/iio/devices/ + /sys/bus/iio/devices/ + ├── iio:device0 -> ../../../devices/0044:8086:22D8.0001/HID-SENSOR-200073.9.auto/iio:device0 + │ ├── buffer + │ │ ├── enable + │ │ ├── length + │ │ └── watermark + ... + │ ├── in_accel_hysteresis + │ ├── in_accel_offset + │ ├── in_accel_sampling_frequency + │ ├── in_accel_scale + │ ├── in_accel_x_raw + │ ├── in_accel_y_raw + │ ├── in_accel_z_raw + │ ├── name + │ ├── scan_elements + │ │ ├── in_accel_x_en + │ │ ├── in_accel_x_index + │ │ ├── in_accel_x_type + │ │ ├── in_accel_y_en + │ │ ├── in_accel_y_index + │ │ ├── in_accel_y_type + │ │ ├── in_accel_z_en + │ │ ├── in_accel_z_index + │ │ └── in_accel_z_type + ... + │ │ ├── devices + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_intensity_both_raw + │ │ │ │ ├── in_intensity_hysteresis + │ │ │ │ ├── in_intensity_offset + │ │ │ │ ├── in_intensity_sampling_frequency + │ │ │ │ ├── in_intensity_scale + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_intensity_both_en + │ │ │ │ │ ├── in_intensity_both_index + │ │ │ │ │ └── in_intensity_both_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_magn_hysteresis + │ │ │ │ ├── in_magn_offset + │ │ │ │ ├── in_magn_sampling_frequency + │ │ │ │ ├── in_magn_scale + │ │ │ │ ├── in_magn_x_raw + │ │ │ │ ├── in_magn_y_raw + │ │ │ │ ├── in_magn_z_raw + │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_raw + │ │ │ │ ├── in_rot_hysteresis + │ │ │ │ ├── in_rot_offset + │ │ │ │ ├── in_rot_sampling_frequency + │ │ │ │ ├── in_rot_scale + │ │ │ │ ├── name + ... + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_magn_x_en + │ │ │ │ │ ├── in_magn_x_index + │ │ │ │ │ ├── in_magn_x_type + │ │ │ │ │ ├── in_magn_y_en + │ │ │ │ │ ├── in_magn_y_index + │ │ │ │ │ ├── in_magn_y_type + │ │ │ │ │ ├── in_magn_z_en + │ │ │ │ │ ├── in_magn_z_index + │ │ │ │ │ ├── in_magn_z_type + │ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_en + │ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_index + │ │ │ │ │ └── in_rot_from_north_magnetic_tilt_comp_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_anglvel_hysteresis + │ │ │ │ ├── in_anglvel_offset + │ │ │ │ ├── in_anglvel_sampling_frequency + │ │ │ │ ├── in_anglvel_scale + │ │ │ │ ├── in_anglvel_x_raw + │ │ │ │ ├── in_anglvel_y_raw + │ │ │ │ ├── in_anglvel_z_raw + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_anglvel_x_en + │ │ │ │ │ ├── in_anglvel_x_index + │ │ │ │ │ ├── in_anglvel_x_type + │ │ │ │ │ ├── in_anglvel_y_en + │ │ │ │ │ ├── in_anglvel_y_index + │ │ │ │ │ ├── in_anglvel_y_type + │ │ │ │ │ ├── in_anglvel_z_en + │ │ │ │ │ ├── in_anglvel_z_index + │ │ │ │ │ └── in_anglvel_z_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ... + │ │ │ │ ├── buffer + │ │ │ │ │ ├── enable + │ │ │ │ │ ├── length + │ │ │ │ │ └── watermark + │ │ │ │ ├── dev + │ │ │ │ ├── in_anglvel_hysteresis + │ │ │ │ ├── in_anglvel_offset + │ │ │ │ ├── in_anglvel_sampling_frequency + │ │ │ │ ├── in_anglvel_scale + │ │ │ │ ├── in_anglvel_x_raw + │ │ │ │ ├── in_anglvel_y_raw + │ │ │ │ ├── in_anglvel_z_raw + │ │ │ │ ├── name + │ │ │ │ ├── scan_elements + │ │ │ │ │ ├── in_anglvel_x_en + │ │ │ │ │ ├── in_anglvel_x_index + │ │ │ │ │ ├── in_anglvel_x_type + │ │ │ │ │ ├── in_anglvel_y_en + │ │ │ │ │ ├── in_anglvel_y_index + │ │ │ │ │ ├── in_anglvel_y_type + │ │ │ │ │ ├── in_anglvel_z_en + │ │ │ │ │ ├── in_anglvel_z_index + │ │ │ │ │ └── in_anglvel_z_type + │ │ │ │ ├── trigger + │ │ │ │ │ └── current_trigger + ...Documentation/hid/intel-ish-hid.txt deleted +0
-454@@ -1,454 +0,0 @@ -Intel Integrated Sensor Hub (ISH) -=============================== - -A sensor hub enables the ability to offload sensor polling and algorithm -processing to a dedicated low power co-processor. This allows the core -processor to go into low power modes more often, resulting in the increased -battery life. - -There are many vendors providing external sensor hubs confirming to HID -Sensor usage tables, and used in several tablets, 2 in 1 convertible laptops -and embedded products. Linux had this support since Linux 3.9. - -Intel® introduced integrated sensor hubs as a part of the SoC starting from -Cherry Trail and now supported on multiple generations of CPU packages. There -are many commercial devices already shipped with Integrated Sensor Hubs (ISH). -These ISH also comply to HID sensor specification, but the difference is the -transport protocol used for communication. The current external sensor hubs -mainly use HID over i2C or USB. But ISH doesn't use either i2c or USB. - -1. Overview - -Using a analogy with a usbhid implementation, the ISH follows a similar model -for a very high speed communication: - - ----------------- ---------------------- - | USB HID | --> | ISH HID | - ----------------- ---------------------- - ----------------- ---------------------- - | USB protocol | --> | ISH Transport | - ----------------- ---------------------- - ----------------- ---------------------- - | EHCI/XHCI | --> | ISH IPC | - ----------------- ---------------------- - PCI PCI - ----------------- ---------------------- - |Host controller| --> | ISH processor | - ----------------- ---------------------- - USB Link - ----------------- ---------------------- - | USB End points| --> | ISH Clients | - ----------------- ---------------------- - -Like USB protocol provides a method for device enumeration, link management -and user data encapsulation, the ISH also provides similar services. But it is -very light weight tailored to manage and communicate with ISH client -applications implemented in the firmware. - -The ISH allows multiple sensor management applications executing in the -firmware. Like USB endpoints the messaging can be to/from a client. As part of -enumeration process, these clients are identified. These clients can be simple -HID sensor applications, sensor calibration application or senor firmware -update application. - -The implementation model is similar, like USB bus, ISH transport is also -implemented as a bus. Each client application executing in the ISH processor -is registered as a device on this bus. The driver, which binds each device -(ISH HID driver) identifies the device type and registers with the hid core. - -2. ISH Implementation: Block Diagram - - --------------------------- - | User Space Applications | - --------------------------- - -----------------IIO ABI---------------- - -------------------------- - | IIO Sensor Drivers | - -------------------------- - -------------------------- - | IIO core | - -------------------------- - -------------------------- - | HID Sensor Hub MFD | - -------------------------- - -------------------------- - | HID Core | - -------------------------- - -------------------------- - | HID over ISH Client | - -------------------------- - -------------------------- - | ISH Transport (ISHTP) | - -------------------------- - -------------------------- - | IPC Drivers | - -------------------------- -OS ----------------- PCI ----------------- -Hardware + Firmware - ---------------------------- - | ISH Hardware/Firmware(FW) | - ---------------------------- - -3. High level processing in above blocks - -3.1 Hardware Interface - -The ISH is exposed as "Non-VGA unclassified PCI device" to the host. The PCI -product and vendor IDs are changed from different generations of processors. So -the source code which enumerate drivers needs to update from generation to -generation. - -3.2 Inter Processor Communication (IPC) driver -Location: drivers/hid/intel-ish-hid/ipc - -The IPC message used memory mapped I/O. The registers are defined in -hw-ish-regs.h. - -3.2.1 IPC/FW message types - -There are two types of messages, one for management of link and other messages -are to and from transport layers. - -TX and RX of Transport messages - -A set of memory mapped register offers support of multi byte messages TX and -RX (E.g.IPC_REG_ISH2HOST_MSG, IPC_REG_HOST2ISH_MSG). The IPC layer maintains -internal queues to sequence messages and send them in order to the FW. -Optionally the caller can register handler to get notification of completion. -A door bell mechanism is used in messaging to trigger processing in host and -client firmware side. When ISH interrupt handler is called, the ISH2HOST -doorbell register is used by host drivers to determine that the interrupt -is for ISH. - -Each side has 32 32-bit message registers and a 32-bit doorbell. Doorbell -register has the following format: -Bits 0..6: fragment length (7 bits are used) -Bits 10..13: encapsulated protocol -Bits 16..19: management command (for IPC management protocol) -Bit 31: doorbell trigger (signal H/W interrupt to the other side) -Other bits are reserved, should be 0. - -3.2.2 Transport layer interface - -To abstract HW level IPC communication, a set of callbacks are registered. -The transport layer uses them to send and receive messages. -Refer to struct ishtp_hw_ops for callbacks. - -3.3 ISH Transport layer -Location: drivers/hid/intel-ish-hid/ishtp/ - -3.3.1 A Generic Transport Layer - -The transport layer is a bi-directional protocol, which defines: -- Set of commands to start, stop, connect, disconnect and flow control -(ishtp/hbm.h) for details -- A flow control mechanism to avoid buffer overflows - -This protocol resembles bus messages described in the following document: -http://www.intel.com/content/dam/www/public/us/en/documents/technical-\ -specifications/dcmi-hi-1-0-spec.pdf "Chapter 7: Bus Message Layer" - -3.3.2 Connection and Flow Control Mechanism - -Each FW client and a protocol is identified by an UUID. In order to communicate -to a FW client, a connection must be established using connect request and -response bus messages. If successful, a pair (host_client_id and fw_client_id) -will identify the connection. - -Once connection is established, peers send each other flow control bus messages -independently. Every peer may send a message only if it has received a -flow-control credit before. Once it sent a message, it may not send another one -before receiving the next flow control credit. -Either side can send disconnect request bus message to end communication. Also -the link will be dropped if major FW reset occurs. - -3.3.3 Peer to Peer data transfer - -Peer to Peer data transfer can happen with or without using DMA. Depending on -the sensor bandwidth requirement DMA can be enabled by using module parameter -ishtp_use_dma under intel_ishtp. - -Each side (host and FW) manages its DMA transfer memory independently. When an -ISHTP client from either host or FW side wants to send something, it decides -whether to send over IPC or over DMA; for each transfer the decision is -independent. The sending side sends DMA_XFER message when the message is in -the respective host buffer (TX when host client sends, RX when FW client -sends). The recipient of DMA message responds with DMA_XFER_ACK, indicating -the sender that the memory region for that message may be reused. - -DMA initialization is started with host sending DMA_ALLOC_NOTIFY bus message -(that includes RX buffer) and FW responds with DMA_ALLOC_NOTIFY_ACK. -Additionally to DMA address communication, this sequence checks capabilities: -if thw host doesn't support DMA, then it won't send DMA allocation, so FW can't -send DMA; if FW doesn't support DMA then it won't respond with -DMA_ALLOC_NOTIFY_ACK, in which case host will not use DMA transfers. -Here ISH acts as busmaster DMA controller. Hence when host sends DMA_XFER, -it's request to do host->ISH DMA transfer; when FW sends DMA_XFER, it means -that it already did DMA and the message resides at host. Thus, DMA_XFER -and DMA_XFER_ACK act as ownership indicators. - -At initial state all outgoing memory belongs to the sender (TX to host, RX to -FW), DMA_XFER transfers ownership on the region that contains ISHTP message to -the receiving side, DMA_XFER_ACK returns ownership to the sender. A sender -needs not wait for previous DMA_XFER to be ack'ed, and may send another message -as long as remaining continuous memory in its ownership is enough. -In principle, multiple DMA_XFER and DMA_XFER_ACK messages may be sent at once -(up to IPC MTU), thus allowing for interrupt throttling. -Currently, ISH FW decides to send over DMA if ISHTP message is more than 3 IPC -fragments and via IPC otherwise. - -3.3.4 Ring Buffers - -When a client initiate a connection, a ring or RX and TX buffers are allocated. -The size of ring can be specified by the client. HID client set 16 and 32 for -TX and RX buffers respectively. On send request from client, the data to be -sent is copied to one of the send ring buffer and scheduled to be sent using -bus message protocol. These buffers are required because the FW may have not -have processed the last message and may not have enough flow control credits -to send. Same thing holds true on receive side and flow control is required. - -3.3.5 Host Enumeration - -The host enumeration bus command allow discovery of clients present in the FW. -There can be multiple sensor clients and clients for calibration function. - -To ease in implantation and allow independent driver handle each client -this transport layer takes advantage of Linux Bus driver model. Each -client is registered as device on the the transport bus (ishtp bus). - -Enumeration sequence of messages: -- Host sends HOST_START_REQ_CMD, indicating that host ISHTP layer is up. -- FW responds with HOST_START_RES_CMD -- Host sends HOST_ENUM_REQ_CMD (enumerate FW clients) -- FW responds with HOST_ENUM_RES_CMD that includes bitmap of available FW -client IDs -- For each FW ID found in that bitmap host sends -HOST_CLIENT_PROPERTIES_REQ_CMD -- FW responds with HOST_CLIENT_PROPERTIES_RES_CMD. Properties include UUID, -max ISHTP message size, etc. -- Once host received properties for that last discovered client, it considers -ISHTP device fully functional (and allocates DMA buffers) - -3.4 HID over ISH Client -Location: drivers/hid/intel-ish-hid - -The ISHTP client driver is responsible for: -- enumerate HID devices under FW ISH client -- Get Report descriptor -- Register with HID core as a LL driver -- Process Get/Set feature request -- Get input reports - -3.5 HID Sensor Hub MFD and IIO sensor drivers - -The functionality in these drivers is the same as an external sensor hub. -Refer to -Documentation/hid/hid-sensor.txt for HID sensor -Documentation/ABI/testing/sysfs-bus-iio for IIO ABIs to user space - -3.6 End to End HID transport Sequence Diagram - -HID-ISH-CLN ISHTP IPC HW - | | | | - | | |-----WAKE UP------------------>| - | | | | - | | |-----HOST READY--------------->| - | | | | - | | |<----MNG_RESET_NOTIFY_ACK----- | - | | | | - | |<----ISHTP_START------ | | - | | | | - | |<-----------------HOST_START_RES_CMD-------------------| - | | | | - | |------------------QUERY_SUBSCRIBER-------------------->| - | | | | - | |------------------HOST_ENUM_REQ_CMD------------------->| - | | | | - | |<-----------------HOST_ENUM_RES_CMD--------------------| - | | | | - | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| - | | | | - | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| - | Create new device on in ishtp bus | | - | | | | - | |------------------HOST_CLIENT_PROPERTIES_REQ_CMD------>| - | | | | - | |<-----------------HOST_CLIENT_PROPERTIES_RES_CMD-------| - | Create new device on in ishtp bus | | - | | | | - | |--Repeat HOST_CLIENT_PROPERTIES_REQ_CMD-till last one--| - | | | | - probed() - |----ishtp_cl_connect-->|----------------- CLIENT_CONNECT_REQ_CMD-------------->| - | | | | - | |<----------------CLIENT_CONNECT_RES_CMD----------------| - | | | | - |register event callback| | | - | | | | - |ishtp_cl_send( - HOSTIF_DM_ENUM_DEVICES) |----------fill ishtp_msg_hdr struct write to HW----- >| - | | | | - | | |<-----IRQ(IPC_PROTOCOL_ISHTP---| - | | | | - |<--ENUM_DEVICE RSP-----| | | - | | | | -for each enumerated device - |ishtp_cl_send( - HOSTIF_GET_HID_DESCRIPTOR |----------fill ishtp_msg_hdr struct write to HW--- >| - | | | | - ...Response - | | | | -for each enumerated device - |ishtp_cl_send( - HOSTIF_GET_REPORT_DESCRIPTOR |----------fill ishtp_msg_hdr struct write to HW- >| - | | | | - | | | | - hid_allocate_device - | | | | - hid_add_device | | | - | | | | - - -3.7 ISH Debugging - -To debug ISH, event tracing mechanism is used. To enable debug logs -echo 1 > /sys/kernel/debug/tracing/events/intel_ish/enable -cat sys/kernel/debug/tracing/trace - -3.8 ISH IIO sysfs Example on Lenovo thinkpad Yoga 260 - -root@otcpl-ThinkPad-Yoga-260:~# tree -l /sys/bus/iio/devices/ -/sys/bus/iio/devices/ -├── iio:device0 -> ../../../devices/0044:8086:22D8.0001/HID-SENSOR-200073.9.auto/iio:device0 -│ ├── buffer -│ │ ├── enable -│ │ ├── length -│ │ └── watermark -... -│ ├── in_accel_hysteresis -│ ├── in_accel_offset -│ ├── in_accel_sampling_frequency -│ ├── in_accel_scale -│ ├── in_accel_x_raw -│ ├── in_accel_y_raw -│ ├── in_accel_z_raw -│ ├── name -│ ├── scan_elements -│ │ ├── in_accel_x_en -│ │ ├── in_accel_x_index -│ │ ├── in_accel_x_type -│ │ ├── in_accel_y_en -│ │ ├── in_accel_y_index -│ │ ├── in_accel_y_type -│ │ ├── in_accel_z_en -│ │ ├── in_accel_z_index -│ │ └── in_accel_z_type -... -│ │ ├── devices -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_intensity_both_raw -│ │ │ │ ├── in_intensity_hysteresis -│ │ │ │ ├── in_intensity_offset -│ │ │ │ ├── in_intensity_sampling_frequency -│ │ │ │ ├── in_intensity_scale -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_intensity_both_en -│ │ │ │ │ ├── in_intensity_both_index -│ │ │ │ │ └── in_intensity_both_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_magn_hysteresis -│ │ │ │ ├── in_magn_offset -│ │ │ │ ├── in_magn_sampling_frequency -│ │ │ │ ├── in_magn_scale -│ │ │ │ ├── in_magn_x_raw -│ │ │ │ ├── in_magn_y_raw -│ │ │ │ ├── in_magn_z_raw -│ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_raw -│ │ │ │ ├── in_rot_hysteresis -│ │ │ │ ├── in_rot_offset -│ │ │ │ ├── in_rot_sampling_frequency -│ │ │ │ ├── in_rot_scale -│ │ │ │ ├── name -... -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_magn_x_en -│ │ │ │ │ ├── in_magn_x_index -│ │ │ │ │ ├── in_magn_x_type -│ │ │ │ │ ├── in_magn_y_en -│ │ │ │ │ ├── in_magn_y_index -│ │ │ │ │ ├── in_magn_y_type -│ │ │ │ │ ├── in_magn_z_en -│ │ │ │ │ ├── in_magn_z_index -│ │ │ │ │ ├── in_magn_z_type -│ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_en -│ │ │ │ │ ├── in_rot_from_north_magnetic_tilt_comp_index -│ │ │ │ │ └── in_rot_from_north_magnetic_tilt_comp_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_anglvel_hysteresis -│ │ │ │ ├── in_anglvel_offset -│ │ │ │ ├── in_anglvel_sampling_frequency -│ │ │ │ ├── in_anglvel_scale -│ │ │ │ ├── in_anglvel_x_raw -│ │ │ │ ├── in_anglvel_y_raw -│ │ │ │ ├── in_anglvel_z_raw -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_anglvel_x_en -│ │ │ │ │ ├── in_anglvel_x_index -│ │ │ │ │ ├── in_anglvel_x_type -│ │ │ │ │ ├── in_anglvel_y_en -│ │ │ │ │ ├── in_anglvel_y_index -│ │ │ │ │ ├── in_anglvel_y_type -│ │ │ │ │ ├── in_anglvel_z_en -│ │ │ │ │ ├── in_anglvel_z_index -│ │ │ │ │ └── in_anglvel_z_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -... -│ │ │ │ ├── buffer -│ │ │ │ │ ├── enable -│ │ │ │ │ ├── length -│ │ │ │ │ └── watermark -│ │ │ │ ├── dev -│ │ │ │ ├── in_anglvel_hysteresis -│ │ │ │ ├── in_anglvel_offset -│ │ │ │ ├── in_anglvel_sampling_frequency -│ │ │ │ ├── in_anglvel_scale -│ │ │ │ ├── in_anglvel_x_raw -│ │ │ │ ├── in_anglvel_y_raw -│ │ │ │ ├── in_anglvel_z_raw -│ │ │ │ ├── name -│ │ │ │ ├── scan_elements -│ │ │ │ │ ├── in_anglvel_x_en -│ │ │ │ │ ├── in_anglvel_x_index -│ │ │ │ │ ├── in_anglvel_x_type -│ │ │ │ │ ├── in_anglvel_y_en -│ │ │ │ │ ├── in_anglvel_y_index -│ │ │ │ │ ├── in_anglvel_y_type -│ │ │ │ │ ├── in_anglvel_z_en -│ │ │ │ │ ├── in_anglvel_z_index -│ │ │ │ │ └── in_anglvel_z_type -│ │ │ │ ├── trigger -│ │ │ │ │ └── current_trigger -...Documentation/hid/uhid.rst renamed from Documentation/hid/uhid.txt +26
-20@@ -1,5 +1,6 @@ - UHID - User-space I/O driver support for HID subsystem - ======================================================== +====================================================== +UHID - User-space I/O driver support for HID subsystem +====================================================== UHID allows user-space to implement HID transport drivers. Please see hid-transport.txt for an introduction into HID transport drivers. This document@@ -22,9 +23,9 @@ If a new device is detected by your HID I/O Driver and you want to register this device with the HID subsystem, then you need to open /dev/uhid once for each device you want to register. All further communication is done by read()'ing or write()'ing "struct uhid_event" objects. Non-blocking operations are supported -by setting O_NONBLOCK. +by setting O_NONBLOCK:: -struct uhid_event { + struct uhid_event { __u32 type; union { struct uhid_create2_req create2;@@ -32,7 +33,7 @@ struct uhid_event { struct uhid_input2_req input2; } u; -}; + }; The "type" field contains the ID of the event. Depending on the ID different payloads are sent. You must not split a single event across multiple read()'s or@@ -86,31 +87,31 @@ the request was handled successfully. O_NONBLOCK does not affect write() as writes are always handled immediately in a non-blocking fashion. Future requests might make use of O_NONBLOCK, though. - UHID_CREATE2: +UHID_CREATE2: This creates the internal HID device. No I/O is possible until you send this event to the kernel. The payload is of type struct uhid_create2_req and contains information about your device. You can start I/O now. - UHID_DESTROY: +UHID_DESTROY: This destroys the internal HID device. No further I/O will be accepted. There may still be pending messages that you can receive with read() but no further UHID_INPUT events can be sent to the kernel. You can create a new device by sending UHID_CREATE2 again. There is no need to reopen the character device. - UHID_INPUT2: +UHID_INPUT2: You must send UHID_CREATE2 before sending input to the kernel! This event contains a data-payload. This is the raw data that you read from your device on the interrupt channel. The kernel will parse the HID reports. - UHID_GET_REPORT_REPLY: +UHID_GET_REPORT_REPLY: If you receive a UHID_GET_REPORT request you must answer with this request. You must copy the "id" field from the request into the answer. Set the "err" field to 0 if no error occurred or to EIO if an I/O error occurred. If "err" is 0 then you should fill the buffer of the answer with the results of the GET_REPORT request and set "size" correspondingly. - UHID_SET_REPORT_REPLY: +UHID_SET_REPORT_REPLY: This is the SET_REPORT equivalent of UHID_GET_REPORT_REPLY. Unlike GET_REPORT, SET_REPORT never returns a data buffer, therefore, it's sufficient to set the "id" and "err" fields correctly.@@ -120,16 +121,18 @@ read() read() will return a queued output report. No reaction is required to any of them but you should handle them according to your needs. - UHID_START: +UHID_START: This is sent when the HID device is started. Consider this as an answer to UHID_CREATE2. This is always the first event that is sent. Note that this event might not be available immediately after write(UHID_CREATE2) returns. Device drivers might required delayed setups. This event contains a payload of type uhid_start_req. The "dev_flags" field describes special behaviors of a device. The following flags are defined: - UHID_DEV_NUMBERED_FEATURE_REPORTS: - UHID_DEV_NUMBERED_OUTPUT_REPORTS: - UHID_DEV_NUMBERED_INPUT_REPORTS: + + - UHID_DEV_NUMBERED_FEATURE_REPORTS + - UHID_DEV_NUMBERED_OUTPUT_REPORTS + - UHID_DEV_NUMBERED_INPUT_REPORTS + Each of these flags defines whether a given report-type uses numbered reports. If numbered reports are used for a type, all messages from the kernel already have the report-number as prefix. Otherwise, no@@ -137,33 +140,35 @@ them but you should handle them according to your needs. For messages sent by user-space to the kernel, you must adjust the prefixes according to these flags. - UHID_STOP: +UHID_STOP: This is sent when the HID device is stopped. Consider this as an answer to UHID_DESTROY. + If you didn't destroy your device via UHID_DESTROY, but the kernel sends an UHID_STOP event, this should usually be ignored. It means that the kernel reloaded/changed the device driver loaded on your HID device (or some other maintenance actions happened). + You can usually ignored any UHID_STOP events safely. - UHID_OPEN: +UHID_OPEN: This is sent when the HID device is opened. That is, the data that the HID device provides is read by some other process. You may ignore this event but it is useful for power-management. As long as you haven't received this event there is actually no other process that reads your data so there is no need to send UHID_INPUT2 events to the kernel. - UHID_CLOSE: +UHID_CLOSE: This is sent when there are no more processes which read the HID data. It is the counterpart of UHID_OPEN and you may as well ignore this event. - UHID_OUTPUT: +UHID_OUTPUT: This is sent if the HID device driver wants to send raw data to the I/O device on the interrupt channel. You should read the payload and forward it to the device. The payload is of type "struct uhid_output_req". This may be received even though you haven't received UHID_OPEN, yet. - UHID_GET_REPORT: +UHID_GET_REPORT: This event is sent if the kernel driver wants to perform a GET_REPORT request on the control channeld as described in the HID specs. The report-type and report-number are available in the payload.@@ -177,11 +182,12 @@ them but you should handle them according to your needs. timed out, the kernel will ignore the response silently. The "id" field is never re-used, so conflicts cannot happen. - UHID_SET_REPORT: +UHID_SET_REPORT: This is the SET_REPORT equivalent of UHID_GET_REPORT. On receipt, you shall send a SET_REPORT request to your hid device. Once it replies, you must tell the kernel about it via UHID_SET_REPORT_REPLY. The same restrictions as for UHID_GET_REPORT apply. ---------------------------------------------------- + Written 2012, David Herrmann <[email protected]>Documentation/input/input.rst +1
-1@@ -188,7 +188,7 @@ LCDs and many other purposes. The monitor and speaker controls should be easy to add to the hid/input interface, but for the UPSs and LCDs it doesn't make much sense. For this, -the hiddev interface was designed. See Documentation/hid/hiddev.txt +the hiddev interface was designed. See Documentation/hid/hiddev.rst for more information about it. The usage of the usbhid module is very simple, it takes no parameters,MAINTAINERS +1
-1@@ -16383,7 +16383,7 @@ M: Benjamin Tissoires <[email protected]> L: [email protected] T: git git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git S: Maintained -F: Documentation/hid/hiddev.txt +F: Documentation/hid/hiddev.rst F: drivers/hid/usbhid/
Quoted 4 lines
Quoted 4 lines
MAINTAINERS +0
-1USB INTEL XHCI ROLE MUX DRIVER --2.21.0
Thanks,
Mauro
PATCH 21/31 docs: ia64: convert to ReST
In reply to Mauro Carvalho ChehabRename the ia64 documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
There are two upper case file names. Rename them to lower case, as we're working to avoid upper case file names at Documentation.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../ia64/{aliasing.txt => aliasing.rst} | 73 ++--
Documentation/ia64/{efirtc.txt => efirtc.rst} | 118 +++---
.../ia64/{err_inject.txt => err_inject.rst} | 349 +++++++++---------
Documentation/ia64/{fsys.txt => fsys.rst} | 127 ++++---
Documentation/ia64/{README => ia64.rst} | 26 +-
Documentation/ia64/index.rst | 18 +
.../ia64/{IRQ-redir.txt => irq-redir.rst} | 31 +-
Documentation/ia64/{mca.txt => mca.rst} | 10 +-
Documentation/ia64/{serial.txt => serial.rst} | 36 +-
Documentation/ia64/xen.rst | 206 +++++++++++
Documentation/ia64/xen.txt | 183 ---------
MAINTAINERS | 2 +-
arch/ia64/kernel/efi.c | 2 +-
arch/ia64/kernel/fsys.S | 2 +-
arch/ia64/mm/ioremap.c | 2 +-
arch/ia64/pci/pci.c | 2 +-
16 files changed, 660 insertions(+), 527 deletions(-)
rename Documentation/ia64/{aliasing.txt => aliasing.rst} (83%)
rename Documentation/ia64/{efirtc.txt => efirtc.rst} (70%)
rename Documentation/ia64/{err_inject.txt => err_inject.rst} (82%)
rename Documentation/ia64/{fsys.txt => fsys.rst} (76%)
rename Documentation/ia64/{README => ia64.rst} (61%)
create mode 100644 Documentation/ia64/index.rst
rename Documentation/ia64/{IRQ-redir.txt => irq-redir.rst} (86%)
rename Documentation/ia64/{mca.txt => mca.rst} (96%)
rename Documentation/ia64/{serial.txt => serial.rst} (87%)
create mode 100644 Documentation/ia64/xen.rst
delete mode 100644 Documentation/ia64/xen.txtDocumentation/ia64/aliasing.rst renamed from Documentation/ia64/aliasing.txt +49 -24
@@ -1,20 +1,25 @@ - MEMORY ATTRIBUTE ALIASING ON IA-64 +================= +Memory Attribute Aliasing on IA-64 +================= - Bjorn Helgaas - <[email protected]> - May 4, 2006 +Bjorn Helgaas <[email protected]> +May 4, 2006 -MEMORY ATTRIBUTES + +Memory Attributes +======== Itanium supports several attributes for virtual memory references. The attribute is part of the virtual translation, i.e., it is contained in the TLB entry. The ones of most interest to the Linux kernel are: - WB Write-back (cacheable) + = =========== + WB Write-back (cacheable) UC Uncacheable WC Write-coalescing + = =========== System memory typically uses the WB attribute. The UC attribute is used for memory-mapped I/O devices. The WC attribute is uncacheable
@@ -29,7 +34,8 @@ MEMORY ATTRIBUTES support either WB or UC access to main memory, while others support only WB access. -MEMORY MAP +Memory Map +===== Platform firmware describes the physical memory map and the supported attributes for each region. At boot-time, the kernel uses
@@ -55,7 +61,8 @@ MEMORY MAP The efi_memmap table is preserved unmodified because the original boot-time information is required for kexec. -KERNEL IDENTITY MAPPINGS +Kernel Identify Mappings +============ Linux/ia64 identity mappings are done with large pages, currently either 16MB or 64MB, referred to as "granules." Cacheable mappings
@@ -74,17 +81,20 @@ KERNEL IDENTITY MAPPINGS are only partially populated, or populated with a combination of UC and WB regions. -USER MAPPINGS +User Mappings +====== User mappings are typically done with 16K or 64K pages. The smaller page size allows more flexibility because only 16K or 64K has to be homogeneous with respect to memory attributes. -POTENTIAL ATTRIBUTE ALIASING CASES +Potential Attribute Aliasing Cases +================= There are several ways the kernel creates new mappings: - mmap of /dev/mem +mmap of /dev/mem +---------------- This uses remap_pfn_range(), which creates user mappings. These mappings may be either WB or UC. If the region being mapped
@@ -98,7 +108,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES Since the EFI memory map does not describe MMIO on some machines, this should use an uncacheable mapping as a fallback. - mmap of /sys/class/pci_bus/.../legacy_mem +mmap of /sys/class/pci_bus/.../legacy_mem +----------------------------------------- This is very similar to mmap of /dev/mem, except that legacy_mem only allows mmap of the one megabyte "legacy MMIO" area for a
@@ -112,9 +123,10 @@ POTENTIAL ATTRIBUTE ALIASING CASES The /dev/mem mmap constraints apply. - mmap of /proc/bus/pci/.../??.? +mmap of /proc/bus/pci/.../??.? +------------------------------ - This is an MMIO mmap of PCI functions, which additionally may or + This is an MMIO mmap of PCI functions, which additionally may or may not be requested as using the WC attribute. If WC is requested, and the region in kern_memmap is either WC
@@ -124,7 +136,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES Otherwise, the user mapping must use the same attribute as the kernel mapping. - read/write of /dev/mem +read/write of /dev/mem +---------------------- This uses copy_from_user(), which implicitly uses a kernel identity mapping. This is obviously safe for things in
@@ -138,7 +151,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES eight-byte accesses, and the copy_from_user() path doesn't allow any control over the access size, so this would be dangerous. - ioremap() +ioremap() +--------- This returns a mapping for use inside the kernel.
@@ -155,9 +169,11 @@ POTENTIAL ATTRIBUTE ALIASING CASES Failing all of the above, we have to fall back to a UC mapping. -PAST PROBLEM CASES +Past Problem Cases +========= - mmap of various MMIO regions from /dev/mem by "X" on Intel platforms +mmap of various MMIO regions from /dev/mem by "X" on Intel platforms +-------------------------------------------------------------------- The EFI memory map may not report these MMIO regions.
@@ -166,12 +182,16 @@ PAST PROBLEM CASES succeed. It may create either WB or UC user mappings, depending on whether the region is in kern_memmap or the EFI memory map. - mmap of 0x0-0x9FFFF /dev/mem by "hwinfo" on HP sx1000 with VGA enabled +mmap of 0x0-0x9FFFF /dev/mem by "hwinfo" on HP sx1000 with VGA enabled +---------------------------------------------------------------------- The EFI memory map reports the following attributes: + + ======== ==== ========= 0x00000-0x9FFFF WB only 0xA0000-0xBFFFF UC only (VGA frame buffer) 0xC0000-0xFFFFF WB only + ======== ==== ========= This mmap is done with user pages, not kernel identity mappings, so it is safe to use WB mappings.
@@ -182,7 +202,8 @@ PAST PROBLEM CASES never generate an uncacheable reference to the WB-only areas unless the driver explicitly touches them. - mmap of 0x0-0xFFFFF legacy_mem by "X" +mmap of 0x0-0xFFFFF legacy_mem by "X" +------------------------------------- If the EFI memory map reports that the entire range supports the same attributes, we can allow the mmap (and we will prefer WB if
@@ -197,15 +218,18 @@ PAST PROBLEM CASES that doesn't report the VGA frame buffer at all), we should fail the mmap and force the user to map just the specific region of interest. - mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled +mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled +------------------------------------------------------------------------ + + The EFI memory map reports the following attributes:: - The EFI memory map reports the following attributes: 0x00000-0xFFFFF WB only (no VGA MMIO hole) This is a special case of the previous case, and the mmap should fail for the same reason as above. - read of /sys/devices/.../rom +read of /sys/devices/.../rom +---------------------------- For VGA devices, this may cause an ioremap() of 0xC0000. This used to be done with a UC mapping, because the VGA frame buffer
@@ -215,7 +239,8 @@ PAST PROBLEM CASES We should use WB page table mappings to avoid covering the VGA frame buffer. -NOTES +Notes +== [1] SDM rev 2.2, vol 2, sec 4.4.1. [2] SDM rev 2.2, vol 2, sec 4.4.6.
Documentation/ia64/efirtc.rst renamed from Documentation/ia64/efirtc.txt +67 -51
187 lines not on this page · raw message
Documentation/ia64/err_inject.rst renamed from Documentation/ia64/err_inject.txt +174 -175
570 lines not on this page · raw message
Documentation/ia64/fsys.rst renamed from Documentation/ia64/fsys.txt +69 -55
233 lines not on this page · raw message
Documentation/ia64/ia64.rst renamed from Documentation/ia64/README +15 -10
@@ -1,43 +1,49 @@ - Linux kernel release 2.4.xx for the IA-64 Platform +=====================+Linux kernel release for the IA-64 Platform +===================== - These are the release notes for Linux version 2.4 for IA-64 + These are the release notes for Linux since version 2.4 for IA-64 platform. This document provides information specific to IA-64 ONLY, to get additional information about the Linux kernel also read the original Linux README provided with the kernel. -INSTALLING the kernel: +Installing the Kernel +========== - IA-64 kernel installation is the same as the other platforms, see original README for details. -SOFTWARE REQUIREMENTS +Software Requirements +========== Compiling and running this kernel requires an IA-64 compliant GCC compiler. And various software packages also compiled with an IA-64 compliant GCC compiler. -CONFIGURING the kernel: +Configuring the Kernel +=========== Configuration is the same, see original README for details. -COMPILING the kernel: +Compiling the Kernel: - Compiling this kernel doesn't differ from other platform so read the original README for details BUT make sure you have an IA-64 compliant GCC compiler. -IA-64 SPECIFICS +IA-64 Specifics +======= - General issues: - o Hardly any performance tuning has been done. Obvious targets + * Hardly any performance tuning has been done. Obvious targets include the library routines (IP checksum, etc.). Less obvious targets include making sure we don't flush the TLB needlessly, etc. - o SMP locks cleanup/optimization + * SMP locks cleanup/optimization - o IA32 support. Currently experimental. It mostly works. + * IA32 support. Currently experimental. It mostly works.
Documentation/ia64/index.rst new file +18 -0
@@ -0,0 +1,18 @@ +:orphan: + +========= +IA-64 Architecture +========= + +.. toctree:: + :maxdepth: 1 + + ia64 + aliasing + efirtc + err_inject + fsys + irq-redir + mca + serial + xen
Documentation/ia64/irq-redir.rst renamed from Documentation/ia64/IRQ-redir.txt +21 -10
@@ -1,6 +1,8 @@ +=============== IRQ affinity on IA64 platforms ------------------------------- - 07.01.2002, Erich Focht <[email protected]> +=============== + +07.01.2002, Erich Focht <[email protected]> By writing to /proc/irq/IRQ#/smp_affinity the interrupt routing can be
@@ -12,22 +14,27 @@ IRQ target is one particular CPU and cannot be a mask of several CPUs. Only the first non-zero bit is taken into account. -Usage examples: +Usage examples +======= The target CPU has to be specified as a hexadecimal CPU mask. The first non-zero bit is the selected CPU. This format has been kept for compatibility reasons with i386. Set the delivery mode of interrupt 41 to fixed and route the -interrupts to CPU #3 (logical CPU number) (2^3=0x08): +interrupts to CPU #3 (logical CPU number) (2^3=0x08):: + echo "8" >/proc/irq/41/smp_affinity Set the default route for IRQ number 41 to CPU 6 in lowest priority -delivery mode (redirectable): +delivery mode (redirectable):: + echo "r 40" >/proc/irq/41/smp_affinity -The output of the command +The output of the command:: + cat /proc/irq/IRQ#/smp_affinity + gives the target CPU mask for the specified interrupt vector. If the CPU mask is preceded by the character "r", the interrupt is redirectable (i.e. lowest priority mode routing is used), otherwise its route is
@@ -35,7 +42,8 @@ fixed. -Initialization and default behavior: +Initialization and default behavior +================= If the platform features IRQ redirection (info provided by SAL) all IO-SAPIC interrupts are initialized with CPU#0 as their default target
@@ -43,9 +51,11 @@ and the routing is the so called "lowest priority mode" (actually fixed SAPIC mode with hint). The XTP chipset registers are used as hints for the IRQ routing. Currently in Linux XTP registers can have three values: + - minimal for an idle task, - normal if any other task runs, - maximal if the CPU is going to be switched off. + The IRQ is routed to the CPU with lowest XTP register value, the search begins at the default CPU. Therefore most of the interrupts will be handled by CPU #0.
@@ -53,12 +63,14 @@ will be handled by CPU #0. If the platform doesn't feature interrupt redirection IOSAPIC fixed routing is used. The target CPUs are distributed in a round robin manner. IRQs will be routed only to the selected target CPUs. Check -with +with:: + cat /proc/interrupts -Comments: +Comments +==== On large (multi-node) systems it is recommended to route the IRQs to the node to which the corresponding device is connected.
@@ -66,4 +78,3 @@ For systems like the NEC AzusA we get IRQ node-affinity for free. This is because usually the chipsets on each node redirect the interrupts only to their own CPUs (as they cannot see the XTP registers on the other nodes). -
Documentation/ia64/mca.rst renamed from Documentation/ia64/mca.txt +5 -3
@@ -1,5 +1,8 @@ -An ad-hoc collection of notes on IA64 MCA and INIT processing. Feel -free to update it with notes about any area that is not clear. +==============================+An ad-hoc collection of notes on IA64 MCA and INIT processing +==============================+ +Feel free to update it with notes about any area that is not clear. ---
@@ -82,7 +85,8 @@ if we have a choice here. own stack as running on that cpu. Then a recursive error gets a trace of the failing handler's "task". -[1] My (Keith Owens) original design called for ia64 to separate its +[1] + My (Keith Owens) original design called for ia64 to separate its struct task and the kernel stacks. Then the MCA/INIT data would be chained stacks like i386 interrupt stacks. But that required radical surgery on the rest of ia64, plus extra hard wired TLB
Documentation/ia64/serial.rst renamed from Documentation/ia64/serial.txt +24 -11
@@ -1,4 +1,9 @@ -SERIAL DEVICE NAMING +======= +Serial Devices +======= + +Serial Device Naming +========== As of 2.6.10, serial devices on ia64 are named based on the order of ACPI and PCI enumeration. The first device in the
@@ -30,17 +35,21 @@ SERIAL DEVICE NAMING (described in the ACPI namespace) plus an MP[2] (a PCI device) has these ports: - pre-2.6.10 pre-2.6.10 - MMIO (EFI console (EFI console - address on builtin) on MP port) 2.6.10 - ===== ===== ===== === + ===== ===== ====== ====== ===+ Type MMIO pre-2.6.10 pre-2.6.10 2.6.10+ + address + (EFI console (EFI console + on builtin) on MP port) + ===== ===== ====== ====== === builtin 0xff5e0000 ttyS0 ttyS1 ttyS0 MP UPS 0xf8031000 ttyS1 ttyS2 ttyS1 MP Console 0xf8030000 ttyS2 ttyS0 ttyS2 MP 2 0xf8030010 ttyS3 ttyS3 ttyS3 MP 3 0xf8030038 ttyS4 ttyS4 ttyS4 + ===== ===== ====== ====== === -CONSOLE SELECTION +Console Selection +======== EFI knows what your console devices are, but it doesn't tell the kernel quite enough to actually locate them. The DIG64 HCDP
@@ -67,7 +76,8 @@ CONSOLE SELECTION entries in /etc/inittab (for getty) and /etc/securetty (to allow root login). -EARLY SERIAL CONSOLE +Early Serial Console +========== The kernel can't start using a serial console until it knows where the device lives. Normally this happens when the driver enumerates
@@ -80,7 +90,8 @@ EARLY SERIAL CONSOLE or if the EFI console path contains only a UART device and the firmware supplies an HCDP. -TROUBLESHOOTING SERIAL CONSOLE PROBLEMS +Troubleshooting Serial Console Problems +=================== No kernel output after elilo prints "Uncompressing Linux... done":
@@ -133,19 +144,22 @@ TROUBLESHOOTING SERIAL CONSOLE PROBLEMS -[1] http://www.dig64.org/specifications/agreement +[1] + http://www.dig64.org/specifications/agreement The table was originally defined as the "HCDP" for "Headless Console/Debug Port." The current version is the "PCDP" for "Primary Console and Debug Port Devices." -[2] The HP MP (management processor) is a PCI device that provides +[2] + The HP MP (management processor) is a PCI device that provides several UARTs. One of the UARTs is often used as a console; the EFI Boot Manager identifies it as "Acpi(HWP0002,700)/Pci(...)/Uart". The external connection is usually a 25-pin connector, and a special dongle converts that to three 9-pin connectors, one of which is labelled "Console." -[3] EFI console devices are configured using the EFI Boot Manager +[3] + EFI console devices are configured using the EFI Boot Manager "Boot option maintenance" menu. You may have to interrupt the boot sequence to use this menu, and you will have to reset the box after changing console configuration.
Documentation/ia64/xen.rst new file +203 -0
203 lines not on this page · raw message
Documentation/ia64/xen.txt deleted +0 -177
177 lines not on this page · raw message
MAINTAINERS +1 -1
@@ -14263,7 +14263,7 @@ SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER M: Pat Gefre <[email protected]> L: [email protected] S: Supported -F: Documentation/ia64/serial.txt +F: Documentation/ia64/serial.rst F: drivers/tty/serial/ioc?_serial.c F: include/linux/ioc?.h
arch/ia64/kernel/efi.c +1 -1
@@ -852,7 +852,7 @@ valid_phys_addr_range (phys_addr_t phys_addr, unsigned long size)* /dev/mem reads and writes use copy_to_user(), which implicitly * uses a granule-sized kernel identity mapping. It's really * only safe to do this for regions in kern_memmap. For more -* details, see Documentation/ia64/aliasing.txt. +* details, see Documentation/ia64/aliasing.rst. */ attr =kern_mem_attribute (phys_addr, size);if (attr &EFI_MEMORY_WB || attr &EFI_MEMORY_UC )
arch/ia64/kernel/fsys.S +1 -1
@@ -28,7 +28,7 @@ #include <asm/native/inst.h> /* - * See Documentation/ia64/fsys.txt for details on fsyscalls. + * See Documentation/ia64/fsys.rst for details on fsyscalls. * * On entry to an fsyscall handler: * r10 = 0 (i.e., defaults to "successful syscall return")
arch/ia64/mm/ioremap.c +1 -1
@@ -45,7 +45,7 @@ ioremap (unsigned long phys_addr, unsigned long size)/* * For things in kern_memmap, we must use the same attribute * as the rest of the kernel. For more details, see -* Documentation/ia64/aliasing.txt. +* Documentation/ia64/aliasing.rst. */ attr =kern_mem_attribute (phys_addr, size);if (attr &EFI_MEMORY_WB )
arch/ia64/pci/pci.c +1 -1
@@ -450,7 +450,7 @@ pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma,return -ENOSYS ;/* -* Avoid attribute aliasing. See Documentation/ia64/aliasing.txt +* Avoid attribute aliasing. See Documentation/ia64/aliasing.rst * for more details. */ if (!valid_mmap_phys_addr_range (vma->vm_pgoff, size))
Signature · 1 line
2.21.0
PATCH 22/31 docs: leds: convert to ReST
In reply to Mauro Carvalho ChehabRename the leds documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
Documentation/laptops/thinkpad-acpi.txt | 4 +-
Documentation/leds/index.rst | 25 ++
.../leds/{leds-blinkm.txt => leds-blinkm.rst} | 64 ++---
...s-class-flash.txt => leds-class-flash.rst} | 49 ++--
.../leds/{leds-class.txt => leds-class.rst} | 15 +-
.../leds/{leds-lm3556.txt => leds-lm3556.rst} | 100 ++++++--
.../leds/{leds-lp3944.txt => leds-lp3944.rst} | 23 +-
Documentation/leds/leds-lp5521.rst | 115 +++++++++
Documentation/leds/leds-lp5521.txt | 101 --------
Documentation/leds/leds-lp5523.rst | 147 ++++++++++++
Documentation/leds/leds-lp5523.txt | 130 ----------
Documentation/leds/leds-lp5562.rst | 137 +++++++++++
Documentation/leds/leds-lp5562.txt | 120 ----------
Documentation/leds/leds-lp55xx.rst | 224 ++++++++++++++++++
Documentation/leds/leds-lp55xx.txt | 194 ---------------
Documentation/leds/leds-mlxcpld.rst | 118 +++++++++
Documentation/leds/leds-mlxcpld.txt | 110 ---------
...edtrig-oneshot.txt => ledtrig-oneshot.rst} | 11 +-
...ig-transient.txt => ledtrig-transient.rst} | 63 +++--
...edtrig-usbport.txt => ledtrig-usbport.rst} | 11 +-
Documentation/leds/{uleds.txt => uleds.rst} | 5 +-
MAINTAINERS | 2 +-
drivers/leds/trigger/Kconfig | 2 +-
drivers/leds/trigger/ledtrig-transient.c | 2 +-
net/netfilter/Kconfig | 2 +-
25 files changed, 996 insertions(+), 778 deletions(-)
create mode 100644 Documentation/leds/index.rst
rename Documentation/leds/{leds-blinkm.txt => leds-blinkm.rst} (57%)
rename Documentation/leds/{leds-class-flash.txt => leds-class-flash.rst} (74%)
rename Documentation/leds/{leds-class.txt => leds-class.rst} (92%)
rename Documentation/leds/{leds-lm3556.txt => leds-lm3556.rst} (70%)
rename Documentation/leds/{leds-lp3944.txt => leds-lp3944.rst} (78%)
create mode 100644 Documentation/leds/leds-lp5521.rst
delete mode 100644 Documentation/leds/leds-lp5521.txt
create mode 100644 Documentation/leds/leds-lp5523.rst
delete mode 100644 Documentation/leds/leds-lp5523.txt
create mode 100644 Documentation/leds/leds-lp5562.rst
delete mode 100644 Documentation/leds/leds-lp5562.txt
create mode 100644 Documentation/leds/leds-lp55xx.rst
delete mode 100644 Documentation/leds/leds-lp55xx.txt
create mode 100644 Documentation/leds/leds-mlxcpld.rst
delete mode 100644 Documentation/leds/leds-mlxcpld.txt
rename Documentation/leds/{ledtrig-oneshot.txt => ledtrig-oneshot.rst} (90%)
rename Documentation/leds/{ledtrig-transient.txt => ledtrig-transient.rst} (81%)
rename Documentation/leds/{ledtrig-usbport.txt => ledtrig-usbport.rst} (86%)
rename Documentation/leds/{uleds.txt => uleds.rst} (95%)Documentation/laptops/thinkpad-acpi.txt +2 -2
@@ -679,7 +679,7 @@ status as "unknown". The available commands are: sysfs notes: The ThinkLight sysfs interface is documented by the LED class -documentation, in Documentation/leds/leds-class.txt. The ThinkLight LED name +documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name is "tpacpi::thinklight". Due to limitations in the sysfs LED class, if the status of the ThinkLight
@@ -779,7 +779,7 @@ All of the above can be turned on and off and can be made to blink. sysfs notes: The ThinkPad LED sysfs interface is described in detail by the LED class -documentation, in Documentation/leds/leds-class.txt. +documentation, in Documentation/leds/leds-class.rst. The LEDs are named (in LED ID order, from 0 to 12): "tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt",
Documentation/leds/index.rst new file +25 -0
@@ -0,0 +1,25 @@ +:orphan: + +==== +LEDs +==== + +.. toctree:: + :maxdepth: 1 + + leds-class + leds-class-flash + ledtrig-oneshot + ledtrig-transient + ledtrig-usbport + + uleds + + leds-blinkm + leds-lm3556 + leds-lp3944 + leds-lp5521 + leds-lp5523 + leds-lp5562 + leds-lp55xx + leds-mlxcpld
Documentation/leds/leds-blinkm.rst renamed from Documentation/leds/leds-blinkm.txt +34 -30
101 lines not on this page · raw message
Documentation/leds/leds-class-flash.rst renamed from Documentation/leds/leds-class-flash.txt +33 -16
78 lines not on this page · raw message
Documentation/leds/leds-class.rst renamed from Documentation/leds/leds-class.txt +9 -6
@@ -1,4 +1,4 @@ - +======================== LED handling under Linux ========================
@@ -43,7 +43,7 @@ LED Device Naming Is currently of the form: -"devicename:colour:function" + "devicename:colour:function" There have been calls for LED properties such as colour to be exported as individual led class attributes. As a solution which doesn't incur as much
@@ -57,9 +57,12 @@ Brightness setting API LED subsystem core exposes following API for setting brightness: - - led_set_brightness : it is guaranteed not to sleep, passing LED_OFF stops + - led_set_brightness: + it is guaranteed not to sleep, passing LED_OFF stops blinking, - - led_set_brightness_sync : for use cases when immediate effect is desired - + + - led_set_brightness_sync: + for use cases when immediate effect is desired - it can block the caller for the time required for accessing device registers and can sleep, passing LED_OFF stops hardware blinking, returns -EBUSY if software blink fallback is enabled.
@@ -70,7 +73,7 @@ LED registration API A driver wanting to register a LED classdev for use by other drivers / userspace needs to allocate and fill a led_classdev struct and then call -[devm_]led_classdev_register. If the non devm version is used the driver +`[devm_]led_classdev_register`. If the non devm version is used the driver must call led_classdev_unregister from its remove function before free-ing the led_classdev struct.
@@ -94,7 +97,7 @@ with brightness value LED_OFF, which should stop any software timers that may have been required for blinking. The blink_set() function should choose a user friendly blinking value -if it is called with *delay_on==0 && *delay_off==0 parameters. In this +if it is called with `*delay_on==0` && `*delay_off==0` parameters. In this case the driver should give back the chosen value through delay_on and delay_off parameters to the leds subsystem.
Documentation/leds/leds-lm3556.rst renamed from Documentation/leds/leds-lm3556.txt +76 -24
157 lines not on this page · raw message
Documentation/leds/leds-lp3944.rst renamed from Documentation/leds/leds-lp3944.txt +16 -7
@@ -1,14 +1,20 @@ +==================== Kernel driver lp3944 ==================== * National Semiconductor LP3944 Fun-light Chip + Prefix: 'lp3944' + Addresses scanned: None (see the Notes section below) - Datasheet: Publicly available at the National Semiconductor website - http://www.national.com/pf/LP/LP3944.html + + Datasheet: + + Publicly available at the National Semiconductor website + http://www.national.com/pf/LP/LP3944.html Authors: - Antonio Ospite <[email protected]> + Antonio Ospite <[email protected]> Description
@@ -19,8 +25,11 @@ is used as a led controller. The DIM modes are used to set _blink_ patterns for leds, the pattern is specified supplying two parameters: - - period: from 0s to 1.6s - - duty cycle: percentage of the period the led is on, from 0 to 100 + + - period: + from 0s to 1.6s + - duty cycle: + percentage of the period the led is on, from 0 to 100 Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern. See the datasheet for details.
@@ -35,7 +44,7 @@ The chip is used mainly in embedded contexts, so this driver expects it is registered using the i2c_board_info mechanism. To register the chip at address 0x60 on adapter 0, set the platform data -according to include/linux/leds-lp3944.h, set the i2c board info: +according to include/linux/leds-lp3944.h, set the i2c board info:: static struct i2c_board_info a910_i2c_board_info[] __initdata = { {
@@ -44,7 +53,7 @@ according to include/linux/leds-lp3944.h, set the i2c board info: }, }; -and register it in the platform init function +and register it in the platform init function:: i2c_register_board_info(0, a910_i2c_board_info, ARRAY_SIZE(a910_i2c_board_info));
Documentation/leds/leds-lp5521.rst new file +115 -0
115 lines not on this page · raw message
Documentation/leds/leds-lp5521.txt deleted +0 -101
101 lines not on this page · raw message
Documentation/leds/leds-lp5523.rst new file +147 -0
147 lines not on this page · raw message
Documentation/leds/leds-lp5523.txt deleted +0 -130
130 lines not on this page · raw message
Documentation/leds/leds-lp5562.rst new file +137 -0
137 lines not on this page · raw message
Documentation/leds/leds-lp5562.txt deleted +0 -120
120 lines not on this page · raw message
Documentation/leds/leds-lp55xx.rst new file +224 -0
224 lines not on this page · raw message
Documentation/leds/leds-lp55xx.txt deleted +0 -194
194 lines not on this page · raw message
Documentation/leds/leds-mlxcpld.rst new file +118 -0
118 lines not on this page · raw message
Documentation/leds/leds-mlxcpld.txt deleted +0 -110
110 lines not on this page · raw message
Documentation/leds/ledtrig-oneshot.rst renamed from Documentation/leds/ledtrig-oneshot.txt +6 -5
@@ -1,3 +1,4 @@ +==================== One-shot LED Trigger ====================
@@ -17,27 +18,27 @@ additional "invert" property specifies if the LED has to stay off (normal) or on (inverted) when not rearmed. The trigger can be activated from user space on led class devices as shown -below: +below:: echo oneshot > trigger This adds sysfs attributes to the LED that are documented in: Documentation/ABI/testing/sysfs-class-led-trigger-oneshot -Example use-case: network devices, initialization: +Example use-case: network devices, initialization:: echo oneshot > trigger # set trigger for this led echo 33 > delay_on # blink at 1 / (33 + 33) Hz on continuous traffic echo 33 > delay_off -interface goes up: +interface goes up:: echo 1 > invert # set led as normally-on, turn the led on -packet received/transmitted: +packet received/transmitted:: echo 1 > shot # led starts blinking, ignored if already blinking -interface goes down +interface goes down:: echo 0 > invert # set led as normally-off, turn the led off
Documentation/leds/ledtrig-transient.rst renamed from Documentation/leds/ledtrig-transient.txt +39 -24
112 lines not on this page · raw message
Documentation/leds/ledtrig-usbport.rst renamed from Documentation/leds/ledtrig-usbport.txt +8 -3
@@ -1,3 +1,4 @@ +==================== USB port LED trigger ====================
@@ -10,14 +11,18 @@ listed as separated entries in a "ports" subdirectory. Selecting is handled by echoing "1" to a chosen port. Please note that this trigger allows selecting multiple USB ports for a single -LED. This can be useful in two cases: +LED. + +This can be useful in two cases: 1) Device with single USB LED and few physical ports +==================================================== In such a case LED will be turned on as long as there is at least one connected USB device. 2) Device with a physical port handled by few controllers +========================================================= Some devices may have one controller per PHY standard. E.g. USB 3.0 physical port may be handled by ohci-platform, ehci-platform and xhci-hcd. If there is
@@ -25,14 +30,14 @@ only one LED user will most likely want to assign ports from all 3 hubs. This trigger can be activated from user space on led class devices as shown -below: +below:: echo usbport > trigger This adds sysfs attributes to the LED that are documented in: Documentation/ABI/testing/sysfs-class-led-trigger-usbport -Example use-case: +Example use-case:: echo usbport > trigger echo 1 > ports/usb1-port1
Documentation/leds/uleds.rst renamed from Documentation/leds/uleds.txt +3 -2
@@ -1,3 +1,4 @@ +============== Userspace LEDs ==============
@@ -10,12 +11,12 @@ Usage When the driver is loaded, a character device is created at /dev/uleds. To create a new LED class device, open /dev/uleds and write a uleds_user_dev -structure to it (found in kernel public header file linux/uleds.h). +structure to it (found in kernel public header file linux/uleds.h):: #define LED_MAX_NAME_SIZE 64 struct uleds_user_dev { - char name[LED_MAX_NAME_SIZE]; + char name[LED_MAX_NAME_SIZE]; }; A new LED class device will be created with the name given. The name can be
MAINTAINERS +1 -1
@@ -10172,7 +10172,7 @@ L: [email protected] S: Supported F: drivers/leds/leds-mlxcpld.c F: drivers/leds/leds-mlxreg.c -F: Documentation/leds/leds-mlxcpld.txt +F: Documentation/leds/leds-mlxcpld.rst MELLANOX PLATFORM DRIVER M: Vadim Pasternak <[email protected]>
drivers/leds/trigger/Kconfig +1 -1
@@ -15,7 +15,7 @@ config LEDS_TRIGGER_TIMER This allows LEDs to be controlled by a programmable timer via sysfs. Some LED hardware can be programmed to start blinking the LED without any further software interaction. - For more details read Documentation/leds/leds-class.txt. + For more details read Documentation/leds/leds-class.rst. If unsure, say Y.
drivers/leds/trigger/ledtrig-transient.c +1 -1
@@ -3,7 +3,7 @@// LED Kernel Transient Trigger // // Transient trigger allows one shot timer activation. Please refer to -// Documentation/leds/ledtrig-transient.txt for details +// Documentation/leds/ledtrig-transient.rst for details // Copyright (C) 2012 Shuah Khan <[email protected]> // // Based on Richard Purdie's ledtrig-timer.c and Atsushi Nemoto's
net/netfilter/Kconfig +1 -1
@@ -906,7 +906,7 @@ config NETFILTER_XT_TARGET_LED echo netfilter-ssh > /sys/class/leds/<ledname>/trigger For more information on the LEDs available on your system, see - Documentation/leds/leds-class.txt + Documentation/leds/leds-class.rst config NETFILTER_XT_TARGET_LOG tristate "LOG target support"
Signature · 1 line
2.21.0
PATCH 23/31 docs: laptops: convert to ReST
In reply to Mauro Carvalho ChehabRename the laptops documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
Documentation/ABI/testing/sysfs-block-device | 2 +-
.../ABI/testing/sysfs-platform-asus-laptop | 2 +-
.../admin-guide/kernel-parameters.txt | 2 +-
.../{asus-laptop.txt => asus-laptop.rst} | 92 ++--
...otection.txt => disk-shock-protection.rst} | 32 +-
Documentation/laptops/index.rst | 17 +
.../{laptop-mode.txt => laptop-mode.rst} | 509 +++++++++---------
.../{sony-laptop.txt => sony-laptop.rst} | 58 +-
.../laptops/{sonypi.txt => sonypi.rst} | 28 +-
.../{thinkpad-acpi.txt => thinkpad-acpi.rst} | 363 ++++++++-----
.../{toshiba_haps.txt => toshiba_haps.rst} | 47 +-
Documentation/sysctl/vm.txt | 4 +-
MAINTAINERS | 2 +-
drivers/char/Kconfig | 2 +-
drivers/platform/x86/Kconfig | 4 +-
15 files changed, 660 insertions(+), 504 deletions(-)
rename Documentation/laptops/{asus-laptop.txt => asus-laptop.rst} (84%)
rename Documentation/laptops/{disk-shock-protection.txt => disk-shock-protection.rst} (91%)
create mode 100644 Documentation/laptops/index.rst
rename Documentation/laptops/{laptop-mode.txt => laptop-mode.rst} (62%)
rename Documentation/laptops/{sony-laptop.txt => sony-laptop.rst} (85%)
rename Documentation/laptops/{sonypi.txt => sonypi.rst} (87%)
rename Documentation/laptops/{thinkpad-acpi.txt => thinkpad-acpi.rst} (89%)
rename Documentation/laptops/{toshiba_haps.txt => toshiba_haps.rst} (60%)Documentation/ABI/testing/sysfs-block-device +1 -1
@@ -45,7 +45,7 @@ Description: - Values below -2 are rejected with -EINVAL For more information, see - Documentation/laptops/disk-shock-protection.txt + Documentation/laptops/disk-shock-protection.rst What: /sys/block/*/device/ncq_prio_enable
Documentation/ABI/testing/sysfs-platform-asus-laptop +1 -1
@@ -31,7 +31,7 @@ Description: To control the LED display, use the following : echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ where T control the 3 letters display, and DDD the 3 digits display. - The DDD table can be found in Documentation/laptops/asus-laptop.txt + The DDD table can be found in Documentation/laptops/asus-laptop.rst What: /sys/devices/platform/asus_laptop/bluetooth Date: January 2007
Documentation/admin-guide/kernel-parameters.txt +1 -1
@@ -4356,7 +4356,7 @@ Format: <integer> sonypi.*= [HW] Sony Programmable I/O Control Device driver - See Documentation/laptops/sonypi.txt + See Documentation/laptops/sonypi.rst spectre_v2= [X86] Control mitigation of Spectre variant 2 (indirect branch speculation) vulnerability.
Documentation/laptops/asus-laptop.rst renamed from Documentation/laptops/asus-laptop.txt +53 -39
207 lines not on this page · raw message
Documentation/laptops/disk-shock-protection.rst renamed from Documentation/laptops/disk-shock-protection.txt +17 -15
@@ -1,17 +1,18 @@ +========================== Hard disk shock protection ========================== Author: Elias Oltmanns <[email protected]> + Last modified: 2008-10-03 -0. Contents ------------ +.. 0. Contents -1. Intro -2. The interface -3. References -4. CREDITS + 1. Intro + 2. The interface + 3. References + 4. CREDITS 1. Intro
@@ -36,8 +37,8 @@ that). ---------------- For each ATA device, the kernel exports the file -block/*/device/unload_heads in sysfs (here assumed to be mounted under -/sys). Access to /sys/block/*/device/unload_heads is denied with +`block/*/device/unload_heads` in sysfs (here assumed to be mounted under +/sys). Access to `/sys/block/*/device/unload_heads` is denied with -EOPNOTSUPP if the device does not support the unload feature. Otherwise, writing an integer value to this file will take the heads of the respective drive off the platter and block all I/O operations
@@ -54,18 +55,18 @@ cancel a previously set timeout and resume normal operation immediately by specifying a timeout of 0. Values below -2 are rejected with -EINVAL (see below for the special meaning of -1 and -2). If the timeout specified for a recent head park request has not yet expired, -reading from /sys/block/*/device/unload_heads will report the number +reading from `/sys/block/*/device/unload_heads` will report the number of milliseconds remaining until normal operation will be resumed; otherwise, reading the unload_heads attribute will return 0. For example, do the following in order to park the heads of drive -/dev/sda and stop all I/O operations for five seconds: +/dev/sda and stop all I/O operations for five seconds:: -# echo 5000 > /sys/block/sda/device/unload_heads + # echo 5000 > /sys/block/sda/device/unload_heads -A simple +A simple:: -# cat /sys/block/sda/device/unload_heads + # cat /sys/block/sda/device/unload_heads will show you how many milliseconds are left before normal operation will be resumed.
@@ -112,9 +113,9 @@ unload_heads attribute. If you know that your device really does support the unload feature (for instance, because the vendor of your laptop or the hard drive itself told you so), then you can tell the kernel to enable the usage of this feature for that drive by writing -the special value -1 to the unload_heads attribute: +the special value -1 to the unload_heads attribute:: -# echo -1 > /sys/block/sda/device/unload_heads + # echo -1 > /sys/block/sda/device/unload_heads will enable the feature for /dev/sda, and giving -2 instead of -1 will disable it again.
@@ -135,6 +136,7 @@ for use. Please feel free to add projects that have been the victims of my ignorance. - http://www.thinkwiki.org/wiki/HDAPS + See this page for information about Linux support of the hard disk active protection system as implemented in IBM/Lenovo Thinkpads.
Documentation/laptops/index.rst new file +17 -0
@@ -0,0 +1,17 @@ +:orphan: + +============== +Laptop Drivers +============== + +.. toctree:: + :maxdepth: 1 + + asus-laptop + disk-shock-protection + laptop-mode + lg-laptop + sony-laptop + sonypi + thinkpad-acpi + toshiba_haps
Documentation/laptops/laptop-mode.rst renamed from Documentation/laptops/laptop-mode.txt +254 -255
663 lines not on this page · raw message
Documentation/laptops/sony-laptop.rst renamed from Documentation/laptops/sony-laptop.txt +44 -14
128 lines not on this page · raw message
Documentation/laptops/sonypi.rst renamed from Documentation/laptops/sonypi.txt +18 -10
@@ -1,11 +1,13 @@ +================================================== Sony Programmable I/O Control Device Driver Readme --------------------------------------------------- - Copyright (C) 2001-2004 Stelian Pop <[email protected]> - Copyright (C) 2001-2002 Alcôve <www.alcove.com> - Copyright (C) 2001 Michael Ashley <[email protected]> - Copyright (C) 2001 Junichi Morita <[email protected]> - Copyright (C) 2000 Takaya Kinjo <[email protected]> - Copyright (C) 2000 Andrew Tridgell <[email protected]> +================================================== + + - Copyright (C) 2001-2004 Stelian Pop <[email protected]> + - Copyright (C) 2001-2002 Alcôve <www.alcove.com> + - Copyright (C) 2001 Michael Ashley <[email protected]> + - Copyright (C) 2001 Junichi Morita <[email protected]> + - Copyright (C) 2000 Takaya Kinjo <[email protected]> + - Copyright (C) 2000 Andrew Tridgell <[email protected]> This driver enables access to the Sony Programmable I/O Control Device which can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
@@ -14,6 +16,7 @@ sonypi device and are not supported at all by this driver. It will give access (through a user space utility) to some events those laptops generate, like: + - jogdial events (the small wheel on the side of Vaios) - capture button events (only on Vaio Picturebook series) - Fn keys
@@ -49,6 +52,7 @@ module argument syntax (<param>=<value> when passing the option to the module or sonypi.<param>=<value> on the kernel boot line when sonypi is statically linked into the kernel). Those options are: + =============== ======================================================= minor: minor number of the misc device /dev/sonypi, default is -1 (automatic allocation, see /proc/misc or kernel logs)
@@ -86,6 +90,8 @@ statically linked into the kernel). Those options are: will be tried. You can use the following bits to construct your own event mask (from drivers/char/sonypi.h): + + ======================== ====== SONYPI_JOGGER_MASK 0x0001 SONYPI_CAPTURE_MASK 0x0002 SONYPI_FNKEY_MASK 0x0004
@@ -100,22 +106,24 @@ statically linked into the kernel). Those options are: SONYPI_MEMORYSTICK_MASK 0x0800 SONYPI_BATTERY_MASK 0x1000 SONYPI_WIRELESS_MASK 0x2000 + ======================== ====== useinput: if set (which is the default) two input devices are created, one which interprets the jogdial events as mouse events, the other one which acts like a keyboard reporting the pressing of the special keys. + =============== ======================================================= Module use: ----------- In order to automatically load the sonypi module on use, you can put those -lines a configuration file in /etc/modprobe.d/: +lines a configuration file in /etc/modprobe.d/:: alias char-major-10-250 sonypi options sonypi minor=250 -This supposes the use of minor 250 for the sonypi device: +This supposes the use of minor 250 for the sonypi device:: # mknod /dev/sonypi c 10 250
@@ -148,5 +156,5 @@ Bugs: http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 - since all development was done by reverse engineering, there is - _absolutely no guarantee_ that this driver will not crash your + *absolutely no guarantee* that this driver will not crash your laptop. Permanently.
Documentation/laptops/thinkpad-acpi.rst renamed from Documentation/laptops/thinkpad-acpi.txt +219 -144
783 lines not on this page · raw message
Documentation/laptops/toshiba_haps.rst renamed from Documentation/laptops/toshiba_haps.txt +29 -18
75 lines not on this page · raw message
Documentation/sysctl/vm.txt +2 -2
@@ -102,7 +102,7 @@ Changing this takes effect whenever an application requests memory. block_dump block_dump enables block I/O debugging when set to a nonzero value. More -information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. +information on block I/O debugging is in Documentation/laptops/laptop-mode.rst. ==============================================================
@@ -286,7 +286,7 @@ shared memory segment using hugetlb page. laptop_mode laptop_mode is a knob that controls "laptop mode". All the things that are -controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. +controlled by this knob are discussed in Documentation/laptops/laptop-mode.rst. ==============================================================
MAINTAINERS +1 -1
@@ -14753,7 +14753,7 @@ M: Mattia Dongili <[email protected]> L: [email protected] W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers S: Maintained -F: Documentation/laptops/sony-laptop.txt +F: Documentation/laptops/sony-laptop.rst F: drivers/char/sonypi.c F: drivers/platform/x86/sony-laptop.c F: include/linux/sony-laptop.h
drivers/char/Kconfig +1 -1
@@ -382,7 +382,7 @@ config SONYPI Device which can be found in many (all ?) Sony Vaio laptops. If you have one of those laptops, read - <file:Documentation/laptops/sonypi.txt>, and say Y or M here. + <file:Documentation/laptops/sonypi.rst>, and say Y or M here. To compile this driver as a module, choose M here: the module will be called sonypi.
drivers/platform/x86/Kconfig +2 -2
@@ -451,7 +451,7 @@ config SONY_LAPTOP screen brightness control, Fn keys and allows powering on/off some devices. - Read <file:Documentation/laptops/sony-laptop.txt> for more information. + Read <file:Documentation/laptops/sony-laptop.rst> for more information. config SONYPI_COMPAT bool "Sonypi compatibility"
@@ -503,7 +503,7 @@ config THINKPAD_ACPI support for Fn-Fx key combinations, Bluetooth control, video output switching, ThinkLight control, UltraBay eject and more. For more information about this driver see - <file:Documentation/laptops/thinkpad-acpi.txt> and + <file:Documentation/laptops/thinkpad-acpi.rst> and <http://ibm-acpi.sf.net/> . This driver was formerly known as ibm-acpi.
Signature · 1 line
2.21.0
Re: [PATCH v1 23/31] docs: laptops: convert to ReST
Quoted 8 lines · Mauro Carvalho Chehab
Rename the laptops documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At its new
index.rst, let's add a :orphan: while this is not linked to the mainindex.rstfile, in order to avoid build warnings.
Thanks!
Quoted 2,316 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- Documentation/ABI/testing/sysfs-block-device | 2 +- .../ABI/testing/sysfs-platform-asus-laptop | 2 +- .../admin-guide/kernel-parameters.txt | 2 +- .../{asus-laptop.txt => asus-laptop.rst} | 92 ++-- ...otection.txt => disk-shock-protection.rst} | 32 +- Documentation/laptops/index.rst | 17 + .../{laptop-mode.txt => laptop-mode.rst} | 509 +++++++++--------- .../{sony-laptop.txt => sony-laptop.rst} | 58 +- .../laptops/{sonypi.txt => sonypi.rst} | 28 +- .../{thinkpad-acpi.txt => thinkpad-acpi.rst} | 363 ++++++++----- .../{toshiba_haps.txt => toshiba_haps.rst} | 47 +- Documentation/sysctl/vm.txt | 4 +- MAINTAINERS | 2 +- drivers/char/Kconfig | 2 +- drivers/platform/x86/Kconfig | 4 +- 15 files changed, 660 insertions(+), 504 deletions(-) rename Documentation/laptops/{asus-laptop.txt => asus-laptop.rst} (84%) rename Documentation/laptops/{disk-shock-protection.txt => disk-shock-protection.rst} (91%) create mode 100644 Documentation/laptops/index.rst rename Documentation/laptops/{laptop-mode.txt => laptop-mode.rst} (62%) rename Documentation/laptops/{sony-laptop.txt => sony-laptop.rst} (85%) rename Documentation/laptops/{sonypi.txt => sonypi.rst} (87%) rename Documentation/laptops/{thinkpad-acpi.txt => thinkpad-acpi.rst} (89%) rename Documentation/laptops/{toshiba_haps.txt => toshiba_haps.rst} (60%)Documentation/ABI/testing/sysfs-block-device +1
-1@@ -45,7 +45,7 @@ Description: - Values below -2 are rejected with -EINVAL For more information, see - Documentation/laptops/disk-shock-protection.txt + Documentation/laptops/disk-shock-protection.rst What: /sys/block/*/device/ncq_prio_enableDocumentation/ABI/testing/sysfs-platform-asus-laptop +1
-1@@ -31,7 +31,7 @@ Description: To control the LED display, use the following : echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ where T control the 3 letters display, and DDD the 3 digits display. - The DDD table can be found in Documentation/laptops/asus-laptop.txt + The DDD table can be found in Documentation/laptops/asus-laptop.rst What: /sys/devices/platform/asus_laptop/bluetooth Date: January 2007Documentation/admin-guide/kernel-parameters.txt +1
-1@@ -4356,7 +4356,7 @@ Format: <integer> sonypi.*= [HW] Sony Programmable I/O Control Device driver - See Documentation/laptops/sonypi.txt + See Documentation/laptops/sonypi.rst spectre_v2= [X86] Control mitigation of Spectre variant 2 (indirect branch speculation) vulnerability.Documentation/laptops/asus-laptop.rst renamed from Documentation/laptops/asus-laptop.txt +53
-39@@ -1,6 +1,9 @@ +================== Asus Laptop Extras +================== Version 0.1 + August 6, 2009 Corentin Chary <[email protected]>@@ -10,11 +13,12 @@ http://acpi4asus.sf.net/ It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or VICTOR XP7210 for example). It makes all the extra buttons generate input events (like keyboards). + On some models adds support for changing the display brightness and output, switching the LCD backlight on and off, and most importantly, allows you to blink those fancy LEDs intended for reporting mail and wireless status. -This driver supercedes the old asus_acpi driver. +This driver supersedes the old asus_acpi driver. Requirements ------------@@ -49,7 +53,7 @@ Usage see some lines like this : Asus Laptop Extras version 0.42 - L2D model detected. + - L2D model detected. If it is not the output you have on your laptop, send it (and the laptop's DSDT) to me.@@ -68,9 +72,12 @@ Usage LEDs ---- - You can modify LEDs be echoing values to /sys/class/leds/asus::*/brightness : + You can modify LEDs be echoing values to `/sys/class/leds/asus/*/brightness`:: + echo 1 > /sys/class/leds/asus::mail/brightness + will switch the mail LED on. + You can also know if they are on/off by reading their content and use kernel triggers like disk-activity or heartbeat.@@ -81,7 +88,7 @@ Backlight /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15. Wireless devices ---------------- +---------------- You can turn the internal Bluetooth adapter on/off with the bluetooth entry (only on models with Bluetooth). This usually controls the associated LED.@@ -93,18 +100,20 @@ Display switching Note: the display switching code is currently considered EXPERIMENTAL. Switching works for the following models: - L3800C - A2500H - L5800C - M5200N - W1000N (albeit with some glitches) - M6700R - A6JC - F3J + + - L3800C + - A2500H + - L5800C + - M5200N + - W1000N (albeit with some glitches) + - M6700R + - A6JC + - F3J Switching doesn't work for the following: - M3700N - L2X00D (locks the laptop under certain conditions) + + - M3700N + - L2X00D (locks the laptop under certain conditions) To switch the displays, echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. The significance of those values@@ -113,48 +122,51 @@ Display switching +-------+-----+-----+-----+-----+-----+ | Bin | Val | DVI | TV | CRT | LCD | +-------+-----+-----+-----+-----+-----+ - + 0000 + 0 + + + + + + | 0000 | 0 | | | | | +-------+-----+-----+-----+-----+-----+ - + 0001 + 1 + + + + X + + | 0001 | 1 | | | | X | +-------+-----+-----+-----+-----+-----+ - + 0010 + 2 + + + X + + + | 0010 | 2 | | | X | | +-------+-----+-----+-----+-----+-----+ - + 0011 + 3 + + + X + X + + | 0011 | 3 | | | X | X | +-------+-----+-----+-----+-----+-----+ - + 0100 + 4 + + X + + + + | 0100 | 4 | | X | | | +-------+-----+-----+-----+-----+-----+ - + 0101 + 5 + + X + + X + + | 0101 | 5 | | X | | X | +-------+-----+-----+-----+-----+-----+ - + 0110 + 6 + + X + X + + + | 0110 | 6 | | X | X | | +-------+-----+-----+-----+-----+-----+ - + 0111 + 7 + + X + X + X + + | 0111 | 7 | | X | X | X | +-------+-----+-----+-----+-----+-----+ - + 1000 + 8 + X + + + + + | 1000 | 8 | X | | | | +-------+-----+-----+-----+-----+-----+ - + 1001 + 9 + X + + + X + + | 1001 | 9 | X | | | X | +-------+-----+-----+-----+-----+-----+ - + 1010 + 10 + X + + X + + + | 1010 | 10 | X | | X | | +-------+-----+-----+-----+-----+-----+ - + 1011 + 11 + X + + X + X + + | 1011 | 11 | X | | X | X | +-------+-----+-----+-----+-----+-----+ - + 1100 + 12 + X + X + + + + | 1100 | 12 | X | X | | | +-------+-----+-----+-----+-----+-----+ - + 1101 + 13 + X + X + + X + + | 1101 | 13 | X | X | | X | +-------+-----+-----+-----+-----+-----+ - + 1110 + 14 + X + X + X + + + | 1110 | 14 | X | X | X | | +-------+-----+-----+-----+-----+-----+ - + 1111 + 15 + X + X + X + X + + | 1111 | 15 | X | X | X | X | +-------+-----+-----+-----+-----+-----+ In most cases, the appropriate displays must be plugged in for the above combinations to work. TV-Out may need to be initialized at boot time. Debugging: + 1) Check whether the Fn+F8 key: + a) does not lock the laptop (try a boot with noapic / nolapic if it does) b) generates events (0x6n, where n is the value corresponding to the configuration above) c) actually works + Record the disp value at every configuration. 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. Record its value, note any change. If nothing changes, try a broader range,@@ -164,7 +176,7 @@ Display switching Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n events are generated and no actual switching occurs. In such a case, a line - like: + like:: echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display@@ -180,15 +192,16 @@ LED display several items of information. LED display works for the following models: - W1000N - W1J - To control the LED display, use the following : + - W1000N + - W1J + + To control the LED display, use the following:: echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ where T control the 3 letters display, and DDD the 3 digits display, - according to the tables below. + according to the tables below:: DDD (digits) 000 to 999 = display digits@@ -208,8 +221,8 @@ LED display For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd" would display "DVD001". -Driver options: ---------------- +Driver options +-------------- Options can be passed to the asus-laptop driver using the standard module argument syntax (<param>=<value> when passing the option to the@@ -219,6 +232,7 @@ Driver options: wapf: WAPF defines the behavior of the Fn+Fx wlan key The significance of values is yet to be found, but most of the time: + - 0x0 should do nothing - 0x1 should allow to control the device with Fn+Fx key. - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key@@ -237,7 +251,7 @@ Unsupported models - ASUS L7300G - ASUS L8400 -Patches, Errors, Questions: +Patches, Errors, Questions -------------------------- I appreciate any success or failure@@ -253,5 +267,5 @@ Patches, Errors, Questions: Any other comments or patches are also more than welcome. [email protected] + http://sourceforge.net/projects/acpi4asus -Documentation/laptops/disk-shock-protection.rst renamed from Documentation/laptops/disk-shock-protection.txt +17
-15@@ -1,17 +1,18 @@ +========================== Hard disk shock protection ========================== Author: Elias Oltmanns <[email protected]> + Last modified: 2008-10-03 -0. Contents ------------ +.. 0. Contents -1. Intro -2. The interface -3. References -4. CREDITS + 1. Intro + 2. The interface + 3. References + 4. CREDITS 1. Intro@@ -36,8 +37,8 @@ that). ---------------- For each ATA device, the kernel exports the file -block/*/device/unload_heads in sysfs (here assumed to be mounted under -/sys). Access to /sys/block/*/device/unload_heads is denied with +`block/*/device/unload_heads` in sysfs (here assumed to be mounted under +/sys). Access to `/sys/block/*/device/unload_heads` is denied with -EOPNOTSUPP if the device does not support the unload feature. Otherwise, writing an integer value to this file will take the heads of the respective drive off the platter and block all I/O operations@@ -54,18 +55,18 @@ cancel a previously set timeout and resume normal operation immediately by specifying a timeout of 0. Values below -2 are rejected with -EINVAL (see below for the special meaning of -1 and -2). If the timeout specified for a recent head park request has not yet expired, -reading from /sys/block/*/device/unload_heads will report the number +reading from `/sys/block/*/device/unload_heads` will report the number of milliseconds remaining until normal operation will be resumed; otherwise, reading the unload_heads attribute will return 0. For example, do the following in order to park the heads of drive -/dev/sda and stop all I/O operations for five seconds: +/dev/sda and stop all I/O operations for five seconds:: -# echo 5000 > /sys/block/sda/device/unload_heads + # echo 5000 > /sys/block/sda/device/unload_heads -A simple +A simple:: -# cat /sys/block/sda/device/unload_heads + # cat /sys/block/sda/device/unload_heads will show you how many milliseconds are left before normal operation will be resumed.@@ -112,9 +113,9 @@ unload_heads attribute. If you know that your device really does support the unload feature (for instance, because the vendor of your laptop or the hard drive itself told you so), then you can tell the kernel to enable the usage of this feature for that drive by writing -the special value -1 to the unload_heads attribute: +the special value -1 to the unload_heads attribute:: -# echo -1 > /sys/block/sda/device/unload_heads + # echo -1 > /sys/block/sda/device/unload_heads will enable the feature for /dev/sda, and giving -2 instead of -1 will disable it again.@@ -135,6 +136,7 @@ for use. Please feel free to add projects that have been the victims of my ignorance. - http://www.thinkwiki.org/wiki/HDAPS + See this page for information about Linux support of the hard disk active protection system as implemented in IBM/Lenovo Thinkpads.Documentation/laptops/index.rst new file +17
-0@@ -0,0 +1,17 @@ +:orphan: + +============== +Laptop Drivers +============== + +.. toctree:: + :maxdepth: 1 + + asus-laptop + disk-shock-protection + laptop-mode + lg-laptop + sony-laptop + sonypi + thinkpad-acpi + toshiba_hapsDocumentation/laptops/laptop-mode.rst renamed from Documentation/laptops/laptop-mode.txt +254
-255@@ -1,8 +1,11 @@ +=============================================== How to conserve battery power using laptop-mode ------------------------------------------------ +=============================================== Document Author: Bart Samwel ([email protected]) + Date created: January 2, 2004 + Last modified: December 06, 2004 Introduction@@ -12,17 +15,16 @@ Laptop mode is used to minimize the time that the hard disk needs to be spun up, to conserve battery power on laptops. It has been reported to cause significant power savings. -Contents --------- +.. Contents -* Introduction -* Installation -* Caveats -* The Details -* Tips & Tricks -* Control script -* ACPI integration -* Monitoring tool + * Introduction + * Installation + * Caveats + * The Details + * Tips & Tricks + * Control script + * ACPI integration + * Monitoring tool Installation@@ -33,7 +35,7 @@ or anything. Simply install all the files included in this document, and laptop mode will automatically be started when you're on battery. For your convenience, a tarball containing an installer can be downloaded at: -http://www.samwel.tk/laptop_mode/laptop_mode/ + http://www.samwel.tk/laptop_mode/laptop_mode/ To configure laptop mode, you need to edit the configuration file, which is located in /etc/default/laptop-mode on Debian-based systems, or in@@ -209,7 +211,7 @@ Tips & Tricks this on powerbooks too. I hope that this is a piece of information that might be useful to the Laptop Mode patch or its users." -* In syslog.conf, you can prefix entries with a dash ``-'' to omit syncing the +* In syslog.conf, you can prefix entries with a dash `-` to omit syncing the file after every logging. When you're using laptop-mode and your disk doesn't spin down, this is a likely culprit.@@ -233,83 +235,82 @@ configuration file It should be installed as /etc/default/laptop-mode on Debian, and as /etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes. ---------------------CONFIG FILE BEGIN------------------------------------------- -# Maximum time, in seconds, of hard drive spindown time that you are -# comfortable with. Worst case, it's possible that you could lose this -# amount of work if your battery fails you while in laptop mode. -#MAX_AGE=600 +Config file:: -# Automatically disable laptop mode when the number of minutes of battery -# that you have left goes below this threshold. -MINIMUM_BATTERY_MINUTES=10 + # Maximum time, in seconds, of hard drive spindown time that you are + # comfortable with. Worst case, it's possible that you could lose this + # amount of work if your battery fails you while in laptop mode. + #MAX_AGE=600 -# Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG -# by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk -# will read a complete MP3 at once, and will then spin down while the MP3/OGG is -# playing. -#READAHEAD=4096 + # Automatically disable laptop mode when the number of minutes of battery + # that you have left goes below this threshold. + MINIMUM_BATTERY_MINUTES=10 -# Shall we remount journaled fs. with appropriate commit interval? (1=yes) -#DO_REMOUNTS=1 + # Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG + # by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk + # will read a complete MP3 at once, and will then spin down while the MP3/OGG is + # playing. + #READAHEAD=4096 -# And shall we add the "noatime" option to that as well? (1=yes) -#DO_REMOUNT_NOATIME=1 + # Shall we remount journaled fs. with appropriate commit interval? (1=yes) + #DO_REMOUNTS=1 -# Dirty synchronous ratio. At this percentage of dirty pages the process -# which -# calls write() does its own writeback -#DIRTY_RATIO=40 + # And shall we add the "noatime" option to that as well? (1=yes) + #DO_REMOUNT_NOATIME=1 -# -# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been -# exceeded, the kernel will wake flusher threads which will then reduce the -# amount of dirty memory to dirty_background_ratio. Set this nice and low, -# so once some writeout has commenced, we do a lot of it. -# -#DIRTY_BACKGROUND_RATIO=5 + # Dirty synchronous ratio. At this percentage of dirty pages the process + # which + # calls write() does its own writeback + #DIRTY_RATIO=40 -# kernel default dirty buffer age -#DEF_AGE=30 -#DEF_UPDATE=5 -#DEF_DIRTY_BACKGROUND_RATIO=10 -#DEF_DIRTY_RATIO=40 -#DEF_XFS_AGE_BUFFER=15 -#DEF_XFS_SYNC_INTERVAL=30 -#DEF_XFS_BUFD_INTERVAL=1 + # + # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been + # exceeded, the kernel will wake flusher threads which will then reduce the + # amount of dirty memory to dirty_background_ratio. Set this nice and low, + # so once some writeout has commenced, we do a lot of it. + # + #DIRTY_BACKGROUND_RATIO=5 -# This must be adjusted manually to the value of HZ in the running kernel -# on 2.4, until the XFS people change their 2.4 external interfaces to work in -# centisecs. This can be automated, but it's a work in progress that still -# needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for -# external interfaces, and that is currently always set to 100. So you don't -# need to change this on 2.6. -#XFS_HZ=100 + # kernel default dirty buffer age + #DEF_AGE=30 + #DEF_UPDATE=5 + #DEF_DIRTY_BACKGROUND_RATIO=10 + #DEF_DIRTY_RATIO=40 + #DEF_XFS_AGE_BUFFER=15 + #DEF_XFS_SYNC_INTERVAL=30 + #DEF_XFS_BUFD_INTERVAL=1 -# Should the maximum CPU frequency be adjusted down while on battery? -# Requires CPUFreq to be setup. -# See Documentation/admin-guide/pm/cpufreq.rst for more info -#DO_CPU=0 + # This must be adjusted manually to the value of HZ in the running kernel + # on 2.4, until the XFS people change their 2.4 external interfaces to work in + # centisecs. This can be automated, but it's a work in progress that still + # needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for + # external interfaces, and that is currently always set to 100. So you don't + # need to change this on 2.6. + #XFS_HZ=100 -# When on battery what is the maximum CPU speed that the system should -# use? Legal values are "slowest" for the slowest speed that your -# CPU is able to operate at, or a value listed in: -# /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies -# Only applicable if DO_CPU=1. -#CPU_MAXFREQ=slowest + # Should the maximum CPU frequency be adjusted down while on battery? + # Requires CPUFreq to be setup. + # See Documentation/admin-guide/pm/cpufreq.rst for more info + #DO_CPU=0 -# Idle timeout for your hard drive (man hdparm for valid values, -S option) -# Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4). -#AC_HD=244 -#BATT_HD=4 + # When on battery what is the maximum CPU speed that the system should + # use? Legal values are "slowest" for the slowest speed that your + # CPU is able to operate at, or a value listed in: + # /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies + # Only applicable if DO_CPU=1. + #CPU_MAXFREQ=slowest -# The drives for which to adjust the idle timeout. Separate them by a space, -# e.g. HD="/dev/hda /dev/hdb". -#HD="/dev/hda" + # Idle timeout for your hard drive (man hdparm for valid values, -S option) + # Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4). + #AC_HD=244 + #BATT_HD=4 -# Set the spindown timeout on a hard drive? -#DO_HD=1 + # The drives for which to adjust the idle timeout. Separate them by a space, + # e.g. HD="/dev/hda /dev/hdb". + #HD="/dev/hda" ---------------------CONFIG FILE END--------------------------------------------- + # Set the spindown timeout on a hard drive? + #DO_HD=1 Control script@@ -318,125 +319,126 @@ Control script Please note that this control script works for the Linux 2.4 and 2.6 series (thanks to Kiko Piris). ---------------------CONTROL SCRIPT BEGIN---------------------------------------- -#!/bin/bash +Control script:: -# start or stop laptop_mode, best run by a power management daemon when -# ac gets connected/disconnected from a laptop -# -# install as /sbin/laptop_mode -# -# Contributors to this script: Kiko Piris -# Bart Samwel -# Micha Feigin -# Andrew Morton -# Herve Eychenne -# Dax Kelson -# -# Original Linux 2.4 version by: Jens Axboe + #!/bin/bash -############################################################################# + # start or stop laptop_mode, best run by a power management daemon when + # ac gets connected/disconnected from a laptop + # + # install as /sbin/laptop_mode + # + # Contributors to this script: Kiko Piris + # Bart Samwel + # Micha Feigin + # Andrew Morton + # Herve Eychenne + # Dax Kelson + # + # Original Linux 2.4 version by: Jens Axboe -# Source config -if [ -f /etc/default/laptop-mode ] ; then + ############################################################################# + + # Source config + if [ -f /etc/default/laptop-mode ] ; then # Debian . /etc/default/laptop-mode -elif [ -f /etc/sysconfig/laptop-mode ] ; then + elif [ -f /etc/sysconfig/laptop-mode ] ; then # Others - . /etc/sysconfig/laptop-mode -fi + . /etc/sysconfig/laptop-mode + fi -# Don't raise an error if the config file is incomplete -# set defaults instead: + # Don't raise an error if the config file is incomplete + # set defaults instead: -# Maximum time, in seconds, of hard drive spindown time that you are -# comfortable with. Worst case, it's possible that you could lose this -# amount of work if your battery fails you while in laptop mode. -MAX_AGE=${MAX_AGE:-'600'} + # Maximum time, in seconds, of hard drive spindown time that you are + # comfortable with. Worst case, it's possible that you could lose this + # amount of work if your battery fails you while in laptop mode. + MAX_AGE=${MAX_AGE:-'600'} -# Read-ahead, in kilobytes -READAHEAD=${READAHEAD:-'4096'} + # Read-ahead, in kilobytes + READAHEAD=${READAHEAD:-'4096'} -# Shall we remount journaled fs. with appropriate commit interval? (1=yes) -DO_REMOUNTS=${DO_REMOUNTS:-'1'} + # Shall we remount journaled fs. with appropriate commit interval? (1=yes) + DO_REMOUNTS=${DO_REMOUNTS:-'1'} -# And shall we add the "noatime" option to that as well? (1=yes) -DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'} + # And shall we add the "noatime" option to that as well? (1=yes) + DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'} -# Shall we adjust the idle timeout on a hard drive? -DO_HD=${DO_HD:-'1'} + # Shall we adjust the idle timeout on a hard drive? + DO_HD=${DO_HD:-'1'} -# Adjust idle timeout on which hard drive? -HD="${HD:-'/dev/hda'}" + # Adjust idle timeout on which hard drive? + HD="${HD:-'/dev/hda'}" -# spindown time for HD (hdparm -S values) -AC_HD=${AC_HD:-'244'} -BATT_HD=${BATT_HD:-'4'} + # spindown time for HD (hdparm -S values) + AC_HD=${AC_HD:-'244'} + BATT_HD=${BATT_HD:-'4'} -# Dirty synchronous ratio. At this percentage of dirty pages the process which -# calls write() does its own writeback -DIRTY_RATIO=${DIRTY_RATIO:-'40'} + # Dirty synchronous ratio. At this percentage of dirty pages the process which + # calls write() does its own writeback + DIRTY_RATIO=${DIRTY_RATIO:-'40'} -# cpu frequency scaling -# See Documentation/admin-guide/pm/cpufreq.rst for more info -DO_CPU=${CPU_MANAGE:-'0'} -CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} + # cpu frequency scaling + # See Documentation/admin-guide/pm/cpufreq.rst for more info + DO_CPU=${CPU_MANAGE:-'0'} + CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} -# -# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been -# exceeded, the kernel will wake flusher threads which will then reduce the -# amount of dirty memory to dirty_background_ratio. Set this nice and low, -# so once some writeout has commenced, we do a lot of it. -# -DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} + # + # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been + # exceeded, the kernel will wake flusher threads which will then reduce the + # amount of dirty memory to dirty_background_ratio. Set this nice and low, + # so once some writeout has commenced, we do a lot of it. + # + DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} -# kernel default dirty buffer age -DEF_AGE=${DEF_AGE:-'30'} -DEF_UPDATE=${DEF_UPDATE:-'5'} -DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'} -DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'} -DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'} -DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'} -DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'} + # kernel default dirty buffer age + DEF_AGE=${DEF_AGE:-'30'} + DEF_UPDATE=${DEF_UPDATE:-'5'} + DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'} + DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'} + DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'} + DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'} + DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'} -# This must be adjusted manually to the value of HZ in the running kernel -# on 2.4, until the XFS people change their 2.4 external interfaces to work in -# centisecs. This can be automated, but it's a work in progress that still needs -# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external -# interfaces, and that is currently always set to 100. So you don't need to -# change this on 2.6. -XFS_HZ=${XFS_HZ:-'100'} + # This must be adjusted manually to the value of HZ in the running kernel + # on 2.4, until the XFS people change their 2.4 external interfaces to work in + # centisecs. This can be automated, but it's a work in progress that still needs + # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external + # interfaces, and that is currently always set to 100. So you don't need to + # change this on 2.6. + XFS_HZ=${XFS_HZ:-'100'} -############################################################################# + ############################################################################# -KLEVEL="$(uname -r | - { + KLEVEL="$(uname -r | + { IFS='.' read a b c echo $a.$b } -)" -case "$KLEVEL" in + )" + case "$KLEVEL" in "2.4"|"2.6") ;; *) echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2 exit 1 ;; -esac + esac -if [ ! -e /proc/sys/vm/laptop_mode ] ; then + if [ ! -e /proc/sys/vm/laptop_mode ] ; then echo "Kernel is not patched with laptop_mode patch." >&2 exit 1 -fi + fi -if [ ! -w /proc/sys/vm/laptop_mode ] ; then + if [ ! -w /proc/sys/vm/laptop_mode ] ; then echo "You do not have enough privileges to enable laptop_mode." >&2 exit 1 -fi + fi -# Remove an option (the first parameter) of the form option=<number> from -# a mount options string (the rest of the parameters). -parse_mount_opts () { + # Remove an option (the first parameter) of the form option=<number> from + # a mount options string (the rest of the parameters). + parse_mount_opts () { OPT="$1" shift echo ",$*," | sed \@@ -444,11 +446,11 @@ parse_mount_opts () { -e 's/,,*/,/g' \ -e 's/^,//' \ -e 's/,$//' -} + } -# Remove an option (the first parameter) without any arguments from -# a mount option string (the rest of the parameters). -parse_nonumber_mount_opts () { + # Remove an option (the first parameter) without any arguments from + # a mount option string (the rest of the parameters). + parse_nonumber_mount_opts () { OPT="$1" shift echo ",$*," | sed \@@ -456,20 +458,20 @@ parse_nonumber_mount_opts () { -e 's/,,*/,/g' \ -e 's/^,//' \ -e 's/,$//' -} + } -# Find out the state of a yes/no option (e.g. "atime"/"noatime") in -# fstab for a given filesystem, and use this state to replace the -# value of the option in another mount options string. The device -# is the first argument, the option name the second, and the default -# value the third. The remainder is the mount options string. -# -# Example: -# parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime -# -# If fstab contains, say, "rw" for this filesystem, then the result -# will be "defaults,atime". -parse_yesno_opts_wfstab () { + # Find out the state of a yes/no option (e.g. "atime"/"noatime") in + # fstab for a given filesystem, and use this state to replace the + # value of the option in another mount options string. The device + # is the first argument, the option name the second, and the default + # value the third. The remainder is the mount options string. + # + # Example: + # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime + # + # If fstab contains, say, "rw" for this filesystem, then the result + # will be "defaults,atime". + parse_yesno_opts_wfstab () { L_DEV="$1" OPT="$2" DEF_OPT="$3"@@ -491,21 +493,21 @@ parse_yesno_opts_wfstab () { # option not specified in fstab -- choose the default. echo "$PARSEDOPTS1,$DEF_OPT" fi -} + } -# Find out the state of a numbered option (e.g. "commit=NNN") in -# fstab for a given filesystem, and use this state to replace the -# value of the option in another mount options string. The device -# is the first argument, and the option name the second. The -# remainder is the mount options string in which the replacement -# must be done. -# -# Example: -# parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 -# -# If fstab contains, say, "commit=3,rw" for this filesystem, then the -# result will be "rw,commit=3". -parse_mount_opts_wfstab () { + # Find out the state of a numbered option (e.g. "commit=NNN") in + # fstab for a given filesystem, and use this state to replace the + # value of the option in another mount options string. The device + # is the first argument, and the option name the second. The + # remainder is the mount options string in which the replacement + # must be done. + # + # Example: + # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 + # + # If fstab contains, say, "commit=3,rw" for this filesystem, then the + # result will be "rw,commit=3". + parse_mount_opts_wfstab () { L_DEV="$1" OPT="$2" shift 2@@ -523,9 +525,9 @@ parse_mount_opts_wfstab () { # option not specified in fstab: set it to 0 echo "$PARSEDOPTS1,$OPT=0" fi -} + } -deduce_fstype () { + deduce_fstype () { MP="$1" # My root filesystem unfortunately has # type "unknown" in /etc/mtab. If we encounter@@ -538,13 +540,13 @@ deduce_fstype () { exit 0 fi done -} + } -if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then + if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then NOATIME_OPT=",noatime" -fi + fi -case "$1" in + case "$1" in start) AGE=$((100*$MAX_AGE)) XFS_AGE=$(($XFS_HZ*$MAX_AGE))@@ -687,10 +689,9 @@ case "$1" in exit 1 ;; -esac + esac -exit 0 ---------------------CONTROL SCRIPT END------------------------------------------ + exit 0 ACPI integration@@ -701,78 +702,76 @@ kick off the laptop_mode script and run hdparm. The part that automatically disables laptop mode when the battery is low was written by Jan Topinski. ------------------/etc/acpi/events/ac_adapter BEGIN------------------------------ -event=ac_adapter -action=/etc/acpi/actions/ac.sh %e -----------------/etc/acpi/events/ac_adapter END--------------------------------- +/etc/acpi/events/ac_adapter:: + event=ac_adapter + action=/etc/acpi/actions/ac.sh %e ------------------/etc/acpi/events/battery BEGIN--------------------------------- -event=battery.* -action=/etc/acpi/actions/battery.sh %e -----------------/etc/acpi/events/battery END------------------------------------ +/etc/acpi/events/battery:: + event=battery.* + action=/etc/acpi/actions/battery.sh %e -----------------/etc/acpi/actions/ac.sh BEGIN----------------------------------- -#!/bin/bash +/etc/acpi/actions/ac.sh:: -# ac on/offline event handler + #!/bin/bash -status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state` + # ac on/offline event handler -case $status in - "on-line") - /sbin/laptop_mode stop - exit 0 - ;; - "off-line") - /sbin/laptop_mode start - exit 0 - ;; -esac ----------------------------/etc/acpi/actions/ac.sh END-------------------------- + status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state` + case $status in + "on-line") + /sbin/laptop_mode stop + exit 0 + ;; + "off-line") + /sbin/laptop_mode start + exit 0 + ;; + esac ----------------------------/etc/acpi/actions/battery.sh BEGIN------------------- -#! /bin/bash -# Automatically disable laptop mode when the battery almost runs out. +/etc/acpi/actions/battery.sh:: -BATT_INFO=/proc/acpi/battery/$2/state + #! /bin/bash -if [[ -f /proc/sys/vm/laptop_mode ]] -then - LM=`cat /proc/sys/vm/laptop_mode` - if [[ $LM -gt 0 ]] - then - if [[ -f $BATT_INFO ]] + # Automatically disable laptop mode when the battery almost runs out. + + BATT_INFO=/proc/acpi/battery/$2/state + + if [[ -f /proc/sys/vm/laptop_mode ]] + then + LM=`cat /proc/sys/vm/laptop_mode` + if [[ $LM -gt 0 ]] then - # Source the config file only now that we know we need - if [ -f /etc/default/laptop-mode ] ; then - # Debian - . /etc/default/laptop-mode - elif [ -f /etc/sysconfig/laptop-mode ] ; then - # Others - . /etc/sysconfig/laptop-mode - fi - MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'} + if [[ -f $BATT_INFO ]] + then + # Source the config file only now that we know we need + if [ -f /etc/default/laptop-mode ] ; then + # Debian + . /etc/default/laptop-mode + elif [ -f /etc/sysconfig/laptop-mode ] ; then + # Others + . /etc/sysconfig/laptop-mode + fi + MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'} - ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`" - if [[ ACTION -eq "discharging" ]] - then - PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` - REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` - fi - if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES)) - then - /sbin/laptop_mode stop - fi - else - logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path." + ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`" + if [[ ACTION -eq "discharging" ]] + then + PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` + REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` + fi + if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES)) + then + /sbin/laptop_mode stop + fi + else + logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path." + fi fi - fi -fi ----------------------------/etc/acpi/actions/battery.sh END-------------------- + fi Monitoring toolDocumentation/laptops/sony-laptop.rst renamed from Documentation/laptops/sony-laptop.txt +44
-14@@ -1,7 +1,9 @@ +========================================= Sony Notebook Control Driver (SNC) Readme ------------------------------------------ - Copyright (C) 2004- 2005 Stelian Pop <[email protected]> - Copyright (C) 2007 Mattia Dongili <[email protected]> +========================================= + + - Copyright (C) 2004- 2005 Stelian Pop <[email protected]> + - Copyright (C) 2007 Mattia Dongili <[email protected]> This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the Sony Vaio laptops. This driver mixes both devices functions under the same@@ -10,6 +12,7 @@ obsoleted by sony-laptop now. Fn keys (hotkeys): ------------------ + Some models report hotkeys through the SNC or SPIC devices, such events are reported both through the ACPI subsystem as acpi events and through the INPUT subsystem. See the logs of /proc/bus/input/devices to find out what those@@ -28,11 +31,14 @@ If your laptop model supports it, you will find sysfs files in the /sys/class/backlight/sony/ directory. You will be able to query and set the current screen brightness: + + ====================== ========================================= brightness get/set screen brightness (an integer between 0 and 7) actual_brightness reading from this file will query the HW to get real brightness value max_brightness the maximum brightness value + ====================== ========================================= Platform specific:@@ -45,6 +51,8 @@ You then read/write integer values from/to those files by using standard UNIX tools. The files are: + + ====================== ========================================== brightness_default screen brightness which will be set when the laptop will be rebooted cdpower power on/off the internal CD drive@@ -53,21 +61,39 @@ The files are: (only in debug mode) bluetoothpower power on/off the internal bluetooth device fanspeed get/set the fan speed + ====================== ========================================== Note that some files may be missing if they are not supported by your particular laptop model. -Example usage: +Example usage:: + # echo "1" > /sys/devices/platform/sony-laptop/brightness_default -sets the lowest screen brightness for the next and later reboots, + +sets the lowest screen brightness for the next and later reboots + +:: + # echo "8" > /sys/devices/platform/sony-laptop/brightness_default -sets the highest screen brightness for the next and later reboots, + +sets the highest screen brightness for the next and later reboots + +:: + # cat /sys/devices/platform/sony-laptop/brightness_default -retrieves the value. + +retrieves the value + +:: # echo "0" > /sys/devices/platform/sony-laptop/audiopower -powers off the sound card, + +powers off the sound card + +:: + # echo "1" > /sys/devices/platform/sony-laptop/audiopower + powers on the sound card.@@ -76,7 +102,8 @@ RFkill control: More recent Vaio models expose a consistent set of ACPI methods to control radio frequency emitting devices. If you are a lucky owner of such a laptop you will find the necessary rfkill devices under -/sys/class/rfkill. Check those starting with sony-* in +/sys/class/rfkill. Check those starting with sony-* in:: + # grep . /sys/class/rfkill/*/{state,name}@@ -88,26 +115,29 @@ you are not afraid of any side effects doing strange things with your ACPI BIOS could have on your laptop), load the driver and pass the option 'debug=1'. -REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS. +REPEAT: + **DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.** In your kernel logs you will find the list of all ACPI methods the SNC device has on your laptop. * For new models you will see a long list of meaningless method names, -reading the DSDT table source should reveal that: + reading the DSDT table source should reveal that: + (1) the SNC device uses an internal capability lookup table (2) SN00 is used to find values in the lookup table (3) SN06 and SN07 are used to call into the real methods based on offsets you can obtain iterating the table using SN00 (4) SN02 used to enable events. + Some values in the capability lookup table are more or less known, see the code for all sony_call_snc_handle calls, others are more obscure. * For old models you can see the GCDP/GCDP methods used to pwer on/off -the CD drive, but there are others and they are usually different from -model to model. + the CD drive, but there are others and they are usually different from + model to model. -I HAVE NO IDEA WHAT THOSE METHODS DO. +**I HAVE NO IDEA WHAT THOSE METHODS DO.** The sony-laptop driver creates, for some of those methods (the most current ones found on several Vaio models), an entry underDocumentation/laptops/sonypi.rst renamed from Documentation/laptops/sonypi.txt +18
-10@@ -1,11 +1,13 @@ +================================================== Sony Programmable I/O Control Device Driver Readme --------------------------------------------------- - Copyright (C) 2001-2004 Stelian Pop <[email protected]> - Copyright (C) 2001-2002 Alcôve <www.alcove.com> - Copyright (C) 2001 Michael Ashley <[email protected]> - Copyright (C) 2001 Junichi Morita <[email protected]> - Copyright (C) 2000 Takaya Kinjo <[email protected]> - Copyright (C) 2000 Andrew Tridgell <[email protected]> +================================================== + + - Copyright (C) 2001-2004 Stelian Pop <[email protected]> + - Copyright (C) 2001-2002 Alcôve <www.alcove.com> + - Copyright (C) 2001 Michael Ashley <[email protected]> + - Copyright (C) 2001 Junichi Morita <[email protected]> + - Copyright (C) 2000 Takaya Kinjo <[email protected]> + - Copyright (C) 2000 Andrew Tridgell <[email protected]> This driver enables access to the Sony Programmable I/O Control Device which can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be@@ -14,6 +16,7 @@ sonypi device and are not supported at all by this driver. It will give access (through a user space utility) to some events those laptops generate, like: + - jogdial events (the small wheel on the side of Vaios) - capture button events (only on Vaio Picturebook series) - Fn keys@@ -49,6 +52,7 @@ module argument syntax (<param>=<value> when passing the option to the module or sonypi.<param>=<value> on the kernel boot line when sonypi is statically linked into the kernel). Those options are: + =============== ======================================================= minor: minor number of the misc device /dev/sonypi, default is -1 (automatic allocation, see /proc/misc or kernel logs)@@ -86,6 +90,8 @@ statically linked into the kernel). Those options are: will be tried. You can use the following bits to construct your own event mask (from drivers/char/sonypi.h): + + ======================== ====== SONYPI_JOGGER_MASK 0x0001 SONYPI_CAPTURE_MASK 0x0002 SONYPI_FNKEY_MASK 0x0004@@ -100,22 +106,24 @@ statically linked into the kernel). Those options are: SONYPI_MEMORYSTICK_MASK 0x0800 SONYPI_BATTERY_MASK 0x1000 SONYPI_WIRELESS_MASK 0x2000 + ======================== ====== useinput: if set (which is the default) two input devices are created, one which interprets the jogdial events as mouse events, the other one which acts like a keyboard reporting the pressing of the special keys. + =============== ======================================================= Module use: ----------- In order to automatically load the sonypi module on use, you can put those -lines a configuration file in /etc/modprobe.d/: +lines a configuration file in /etc/modprobe.d/:: alias char-major-10-250 sonypi options sonypi minor=250 -This supposes the use of minor 250 for the sonypi device: +This supposes the use of minor 250 for the sonypi device:: # mknod /dev/sonypi c 10 250@@ -148,5 +156,5 @@ Bugs: http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 - since all development was done by reverse engineering, there is - _absolutely no guarantee_ that this driver will not crash your + *absolutely no guarantee* that this driver will not crash your laptop. Permanently.Documentation/laptops/thinkpad-acpi.rst renamed from Documentation/laptops/thinkpad-acpi.txt +219
-144@@ -1,12 +1,15 @@ - ThinkPad ACPI Extras Driver +=========================== +ThinkPad ACPI Extras Driver +=========================== - Version 0.25 - October 16th, 2013 +Version 0.25 - Borislav Deianov <[email protected]> - Henrique de Moraes Holschuh <[email protected]> - http://ibm-acpi.sf.net/ +October 16th, 2013 +- Borislav Deianov <[email protected]> +- Henrique de Moraes Holschuh <[email protected]> + +http://ibm-acpi.sf.net/ This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It supports various features of these laptops which are accessible@@ -91,7 +94,8 @@ yet ready or stabilized, it is expected that this interface will change, and any and all userspace programs must deal with it. -Notes about the sysfs interface: +Notes about the sysfs interface +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unlike what was done with the procfs interface, correctness when talking to the sysfs interfaces will be enforced, as will correctness in the@@ -129,6 +133,7 @@ Driver version -------------- procfs: /proc/acpi/ibm/driver + sysfs driver attribute: version The driver name and version. No commands can be written to this file.@@ -141,9 +146,13 @@ sysfs driver attribute: interface_version Version of the thinkpad-acpi sysfs interface, as an unsigned long (output in hex format: 0xAAAABBCC), where: - AAAA - major revision - BB - minor revision - CC - bugfix revision + + AAAA + - major revision + BB + - minor revision + CC + - bugfix revision The sysfs interface version changelog for the driver can be found at the end of this document. Changes to the sysfs interface done by the kernel@@ -170,6 +179,7 @@ Hot keys -------- procfs: /proc/acpi/ibm/hotkey + sysfs device attribute: hotkey_* In a ThinkPad, the ACPI HKEY handler is responsible for communicating@@ -181,7 +191,7 @@ firmware will behave in many situations. The driver enables the HKEY ("hot key") event reporting automatically when loaded, and disables it when it is removed. -The driver will report HKEY events in the following format: +The driver will report HKEY events in the following format:: ibm/hotkey HKEY 00000080 0000xxxx@@ -217,9 +227,10 @@ ThinkPads, it is still possible to support some extra hotkeys by polling the "CMOS NVRAM" at least 10 times per second. The driver attempts to enables this functionality automatically when required. -procfs notes: +procfs notes +^^^^^^^^^^^^ -The following commands can be written to the /proc/acpi/ibm/hotkey file: +The following commands can be written to the /proc/acpi/ibm/hotkey file:: echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys@@ -227,7 +238,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file: echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask The following commands have been deprecated and will cause the kernel -to log a warning: +to log a warning:: echo enable > /proc/acpi/ibm/hotkey -- does nothing echo disable > /proc/acpi/ibm/hotkey -- returns an error@@ -237,7 +248,8 @@ maintain maximum bug-to-bug compatibility, it does not report any masks, nor does it allow one to manipulate the hot key mask when the firmware does not support masks at all, even if NVRAM polling is in use. -sysfs notes: +sysfs notes +^^^^^^^^^^^ hotkey_bios_enabled: DEPRECATED, WILL BE REMOVED SOON.@@ -349,7 +361,8 @@ sysfs notes: This attribute has poll()/select() support. -input layer notes: +input layer notes +^^^^^^^^^^^^^^^^^ A Hot key is mapped to a single input layer EV_KEY event, possibly followed by an EV_MSC MSC_SCAN event that shall contain that key's scan@@ -362,11 +375,13 @@ remapping KEY_UNKNOWN keys. The events are available in an input device, with the following id: - Bus: BUS_HOST - vendor: 0x1014 (PCI_VENDOR_ID_IBM) or + ============== ============================== + Bus BUS_HOST + vendor 0x1014 (PCI_VENDOR_ID_IBM) or 0x17aa (PCI_VENDOR_ID_LENOVO) - product: 0x5054 ("TP") - version: 0x4101 + product 0x5054 ("TP") + version 0x4101 + ============== ============================== The version will have its LSB incremented if the keymap changes in a backwards-compatible way. The MSB shall always be 0x41 for this input@@ -380,9 +395,10 @@ backwards-compatible change for this input device. Thinkpad-acpi Hot Key event map (version 0x4101): +======= ======= ============== ============================================== ACPI Scan event code Key Notes - +======= ======= ============== ============================================== 0x1001 0x00 FN+F1 - 0x1002 0x01 FN+F2 IBM: battery (rare)@@ -426,7 +442,9 @@ event code Key Notes or toggle screen expand 0x1009 0x08 FN+F9 - - .. .. .. + +... ... ... ... + 0x100B 0x0A FN+F11 - 0x100C 0x0B FN+F12 Sleep to disk. You are always@@ -480,8 +498,11 @@ event code Key Notes 0x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key 0x1019 0x18 unknown -.. .. .. + +... ... ... + 0x1020 0x1F unknown +======= ======= ============== ============================================== The ThinkPad firmware does not allow one to differentiate when most hot keys are pressed or released (either that, or we don't know how to, yet).@@ -499,14 +520,17 @@ generate input device EV_KEY events. In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW events for switches: +============== ============================================== SW_RFKILL_ALL T60 and later hardware rfkill rocker switch SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A +============== ============================================== -Non hotkey ACPI HKEY event map: -------------------------------- +Non hotkey ACPI HKEY event map +------------------------------ Events that are never propagated by the driver: +====== ================================================== 0x2304 System is waking up from suspend to undock 0x2305 System is waking up from suspend to eject bay 0x2404 System is waking up from hibernation to undock@@ -519,10 +543,12 @@ Events that are never propagated by the driver: 0x6000 KEYBOARD: Numlock key pressed 0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) 0x7000 Radio Switch may have changed state +====== ================================================== Events that are propagated by the driver to userspace: +====== ===================================================== 0x2313 ALARM: System is waking up from suspend because the battery is nearly empty 0x2413 ALARM: System is waking up from hibernation because@@ -544,6 +570,7 @@ Events that are propagated by the driver to userspace: 0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) 0x60C0 X1 Yoga 2016, Tablet mode status changed 0x60F0 Thermal Transformation changed (GMTS, Windows) +====== ===================================================== Battery nearly empty alarms are a last resort attempt to get the operating system to hibernate or shutdown cleanly (0x2313), or shutdown@@ -562,7 +589,8 @@ cycle, or a system shutdown. Obviously, something is very wrong if this happens. -Brightness hotkey notes: +Brightness hotkey notes +^^^^^^^^^^^^^^^^^^^^^^^ Don't mess with the brightness hotkeys in a Thinkpad. If you want notifications for OSD, use the sysfs backlight class event support.@@ -579,7 +607,9 @@ Bluetooth --------- procfs: /proc/acpi/ibm/bluetooth + sysfs device attribute: bluetooth_enable (deprecated) + sysfs rfkill class: switch "tpacpi_bluetooth_sw" This feature shows the presence and current state of a ThinkPad@@ -588,22 +618,25 @@ Bluetooth device in the internal ThinkPad CDC slot. If the ThinkPad supports it, the Bluetooth state is stored in NVRAM, so it is kept across reboots and power-off. -Procfs notes: +Procfs notes +^^^^^^^^^^^^ -If Bluetooth is installed, the following commands can be used: +If Bluetooth is installed, the following commands can be used:: echo enable > /proc/acpi/ibm/bluetooth echo disable > /proc/acpi/ibm/bluetooth -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ If the Bluetooth CDC card is installed, it can be enabled / disabled through the "bluetooth_enable" thinkpad-acpi device attribute, and its current status can also be queried. enable: - 0: disables Bluetooth / Bluetooth is disabled - 1: enables Bluetooth / Bluetooth is enabled. + + - 0: disables Bluetooth / Bluetooth is disabled + - 1: enables Bluetooth / Bluetooth is enabled. Note: this interface has been superseded by the generic rfkill class. It has been deprecated, and it will be removed in year@@ -617,7 +650,7 @@ Video output control -- /proc/acpi/ibm/video -------------------------------------------- This feature allows control over the devices used for video output - -LCD, CRT or DVI (if available). The following commands are available: +LCD, CRT or DVI (if available). The following commands are available:: echo lcd_enable > /proc/acpi/ibm/video echo lcd_disable > /proc/acpi/ibm/video@@ -630,9 +663,10 @@ LCD, CRT or DVI (if available). The following commands are available: echo expand_toggle > /proc/acpi/ibm/video echo video_switch > /proc/acpi/ibm/video -NOTE: Access to this feature is restricted to processes owning the -CAP_SYS_ADMIN capability for safety reasons, as it can interact badly -enough with some versions of X.org to crash it. +NOTE: + Access to this feature is restricted to processes owning the + CAP_SYS_ADMIN capability for safety reasons, as it can interact badly + enough with some versions of X.org to crash it. Each video output device can be enabled or disabled individually. Reading /proc/acpi/ibm/video shows the status of each device.@@ -665,18 +699,21 @@ ThinkLight control ------------------ procfs: /proc/acpi/ibm/light + sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED -procfs notes: +procfs notes +^^^^^^^^^^^^ The ThinkLight status can be read and set through the procfs interface. A few models which do not make the status available will show the ThinkLight -status as "unknown". The available commands are: +status as "unknown". The available commands are:: echo on > /proc/acpi/ibm/light echo off > /proc/acpi/ibm/light -sysfs notes: +sysfs notes +^^^^^^^^^^^ The ThinkLight sysfs interface is documented by the LED class documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name@@ -691,6 +728,7 @@ CMOS/UCMS control ----------------- procfs: /proc/acpi/ibm/cmos + sysfs device attribute: cmos_command This feature is mostly used internally by the ACPI firmware to keep the legacy@@ -707,16 +745,16 @@ The range of valid cmos command numbers is 0 to 21, but not all have an effect and the behavior varies from model to model. Here is the behavior on the X40 (tpb is the ThinkPad Buttons utility): - 0 - Related to "Volume down" key press - 1 - Related to "Volume up" key press - 2 - Related to "Mute on" key press - 3 - Related to "Access IBM" key press - 4 - Related to "LCD brightness up" key press - 5 - Related to "LCD brightness down" key press - 11 - Related to "toggle screen expansion" key press/function - 12 - Related to "ThinkLight on" - 13 - Related to "ThinkLight off" - 14 - Related to "ThinkLight" key press (toggle ThinkLight) + - 0 - Related to "Volume down" key press + - 1 - Related to "Volume up" key press + - 2 - Related to "Mute on" key press + - 3 - Related to "Access IBM" key press + - 4 - Related to "LCD brightness up" key press + - 5 - Related to "LCD brightness down" key press + - 11 - Related to "toggle screen expansion" key press/function + - 12 - Related to "ThinkLight on" + - 13 - Related to "ThinkLight off" + - 14 - Related to "ThinkLight" key press (toggle ThinkLight) The cmos command interface is prone to firmware split-brain problems, as in newer ThinkPads it is just a compatibility layer. Do not use it, it is@@ -748,9 +786,10 @@ are aware of the consequences are welcome to enabling it. Audio mute and microphone mute LEDs are supported, but currently not visible to userspace. They are used by the snd-hda-intel audio driver. -procfs notes: +procfs notes +^^^^^^^^^^^^ -The available commands are: +The available commands are:: echo '<LED number> on' >/proc/acpi/ibm/led echo '<LED number> off' >/proc/acpi/ibm/led@@ -760,23 +799,24 @@ The <LED number> range is 0 to 15. The set of LEDs that can be controlled varies from model to model. Here is the common ThinkPad mapping: - 0 - power - 1 - battery (orange) - 2 - battery (green) - 3 - UltraBase/dock - 4 - UltraBay - 5 - UltraBase battery slot - 6 - (unknown) - 7 - standby - 8 - dock status 1 - 9 - dock status 2 - 10, 11 - (unknown) - 12 - thinkvantage - 13, 14, 15 - (unknown) + - 0 - power + - 1 - battery (orange) + - 2 - battery (green) + - 3 - UltraBase/dock + - 4 - UltraBay + - 5 - UltraBase battery slot + - 6 - (unknown) + - 7 - standby + - 8 - dock status 1 + - 9 - dock status 2 + - 10, 11 - (unknown) + - 12 - thinkvantage + - 13, 14, 15 - (unknown) All of the above can be turned on and off and can be made to blink. -sysfs notes: +sysfs notes +^^^^^^^^^^^ The ThinkPad LED sysfs interface is described in detail by the LED class documentation, in Documentation/leds/leds-class.rst.@@ -815,7 +855,7 @@ The BEEP method is used internally by the ACPI firmware to provide audible alerts in various situations. This feature allows the same sounds to be triggered manually. -The commands are non-negative integer numbers: +The commands are non-negative integer numbers:: echo <number> >/proc/acpi/ibm/beep@@ -823,25 +863,26 @@ The valid <number> range is 0 to 17. Not all numbers trigger sounds and the sounds vary from model to model. Here is the behavior on the X40: - 0 - stop a sound in progress (but use 17 to stop 16) - 2 - two beeps, pause, third beep ("low battery") - 3 - single beep - 4 - high, followed by low-pitched beep ("unable") - 5 - single beep - 6 - very high, followed by high-pitched beep ("AC/DC") - 7 - high-pitched beep - 9 - three short beeps - 10 - very long beep - 12 - low-pitched beep - 15 - three high-pitched beeps repeating constantly, stop with 0 - 16 - one medium-pitched beep repeating constantly, stop with 17 - 17 - stop 16 + - 0 - stop a sound in progress (but use 17 to stop 16) + - 2 - two beeps, pause, third beep ("low battery") + - 3 - single beep + - 4 - high, followed by low-pitched beep ("unable") + - 5 - single beep + - 6 - very high, followed by high-pitched beep ("AC/DC") + - 7 - high-pitched beep + - 9 - three short beeps + - 10 - very long beep + - 12 - low-pitched beep + - 15 - three high-pitched beeps repeating constantly, stop with 0 + - 16 - one medium-pitched beep repeating constantly, stop with 17 + - 17 - stop 16 Temperature sensors ------------------- procfs: /proc/acpi/ibm/thermal + sysfs device attributes: (hwmon "thinkpad") temp*_input Most ThinkPads include six or more separate temperature sensors but only@@ -850,10 +891,14 @@ feature shows readings from up to eight different sensors on older ThinkPads, and up to sixteen different sensors on newer ThinkPads. For example, on the X40, a typical output may be: -temperatures: 42 42 45 41 36 -128 33 -128 + +temperatures: + 42 42 45 41 36 -128 33 -128 On the T43/p, a typical output may be: -temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 + +temperatures: + 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 The mapping of thermal sensors to physical locations varies depending on system-board model (and thus, on ThinkPad model).@@ -863,46 +908,53 @@ tries to track down these locations for various models. Most (newer?) models seem to follow this pattern: -1: CPU -2: (depends on model) -3: (depends on model) -4: GPU -5: Main battery: main sensor -6: Bay battery: main sensor -7: Main battery: secondary sensor -8: Bay battery: secondary sensor -9-15: (depends on model) +- 1: CPU +- 2: (depends on model) +- 3: (depends on model) +- 4: GPU +- 5: Main battery: main sensor +- 6: Bay battery: main sensor +- 7: Main battery: secondary sensor +- 8: Bay battery: secondary sensor +- 9-15: (depends on model) For the R51 (source: Thomas Gruber): -2: Mini-PCI -3: Internal HDD + +- 2: Mini-PCI +- 3: Internal HDD For the T43, T43/p (source: Shmidoax/Thinkwiki.org) http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p -2: System board, left side (near PCMCIA slot), reported as HDAPS temp -3: PCMCIA slot -9: MCH (northbridge) to DRAM Bus -10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI - card, under touchpad -11: Power regulator, underside of system board, below F2 key + +- 2: System board, left side (near PCMCIA slot), reported as HDAPS temp +- 3: PCMCIA slot +- 9: MCH (northbridge) to DRAM Bus +- 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI + card, under touchpad +- 11: Power regulator, underside of system board, below F2 key The A31 has a very atypical layout for the thermal sensors (source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31) -1: CPU -2: Main Battery: main sensor -3: Power Converter -4: Bay Battery: main sensor -5: MCH (northbridge) -6: PCMCIA/ambient -7: Main Battery: secondary sensor -8: Bay Battery: secondary sensor +- 1: CPU +- 2: Main Battery: main sensor +- 3: Power Converter +- 4: Bay Battery: main sensor +- 5: MCH (northbridge) +- 6: PCMCIA/ambient +- 7: Main Battery: secondary sensor +- 8: Bay Battery: secondary sensor + + +Procfs notes +^^^^^^^^^^^^ -Procfs notes: Readings from sensors that are not available return -128. No commands can be written to this file. -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ + Sensors that are not available return the ENXIO error. This status may change at runtime, as there are hotplug thermal sensors, like those inside the batteries and docks.@@ -921,6 +973,7 @@ ftp://ftp.suse.com/pub/people/trenn/sources/ec Use it to determine the register holding the fan speed on some models. To do that, do the following: + - make sure the battery is fully charged - make sure the fan is running - use above mentioned tool to read out the EC@@ -941,6 +994,7 @@ LCD brightness control ---------------------- procfs: /proc/acpi/ibm/brightness + sysfs backlight device "thinkpad_screen" This feature allows software control of the LCD brightness on ThinkPad@@ -985,15 +1039,17 @@ brightness_enable=0 forces it to be disabled. brightness_enable=1 forces it to be enabled when available, even if the standard ACPI interface is also available. -Procfs notes: +Procfs notes +^^^^^^^^^^^^ - The available commands are: +The available commands are:: echo up >/proc/acpi/ibm/brightness echo down >/proc/acpi/ibm/brightness echo 'level <level>' >/proc/acpi/ibm/brightness -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ The interface is implemented through the backlight sysfs class, which is poorly documented at this time.@@ -1038,6 +1094,7 @@ Volume control (Console Audio control) -------------------------------------- procfs: /proc/acpi/ibm/volume + ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC" NOTE: by default, the volume control interface operates in read-only@@ -1053,7 +1110,8 @@ Software volume control should be done only in the main AC97/HDA mixer. -About the ThinkPad Console Audio control: +About the ThinkPad Console Audio control +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ThinkPads have a built-in amplifier and muting circuit that drives the console headphone and speakers. This circuit is after the main AC97@@ -1092,13 +1150,14 @@ normal key presses to the operating system (thinkpad-acpi is not involved). -The ThinkPad-ACPI volume control: +The ThinkPad-ACPI volume control +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The preferred way to interact with the Console Audio control is the ALSA interface. The legacy procfs interface allows one to read the current state, -and if volume control is enabled, accepts the following commands: +and if volume control is enabled, accepts the following commands:: echo up >/proc/acpi/ibm/volume echo down >/proc/acpi/ibm/volume@@ -1137,13 +1196,15 @@ Fan control and monitoring: fan speed, fan enable/disable --------------------------------------------------------- procfs: /proc/acpi/ibm/fan -sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, - pwm1_enable, fan2_input + +sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, pwm1_enable, fan2_input + sysfs hwmon driver attributes: fan_watchdog -NOTE NOTE NOTE: fan control operations are disabled by default for -safety reasons. To enable them, the module parameter "fan_control=1" -must be given to thinkpad-acpi. +NOTE NOTE NOTE: + fan control operations are disabled by default for + safety reasons. To enable them, the module parameter "fan_control=1" + must be given to thinkpad-acpi. This feature attempts to show the current fan speed, control mode and other fan data that might be available. The speed is read directly@@ -1154,7 +1215,8 @@ value on other models. Some Lenovo ThinkPads support a secondary fan. This fan cannot be controlled separately, it shares the main fan control. -Fan levels: +Fan levels +^^^^^^^^^^ Most ThinkPad fans work in "levels" at the firmware interface. Level 0 stops the fan. The higher the level, the higher the fan speed, although@@ -1209,9 +1271,10 @@ therefore, not suitable to protect against fan mode changes made through means other than the "enable", "disable", and "level" procfs fan commands, or the hwmon fan control sysfs interface. -Procfs notes: +Procfs notes +^^^^^^^^^^^^ -The fan may be enabled or disabled with the following commands: +The fan may be enabled or disabled with the following commands:: echo enable >/proc/acpi/ibm/fan echo disable >/proc/acpi/ibm/fan@@ -1219,7 +1282,7 @@ The fan may be enabled or disabled with the following commands: Placing a fan on level 0 is the same as disabling it. Enabling a fan will try to place it in a safe level if it is too slow or disabled. -The fan level can be controlled with the command: +The fan level can be controlled with the command:: echo 'level <level>' > /proc/acpi/ibm/fan@@ -1231,7 +1294,7 @@ compatibility. On the X31 and X40 (and ONLY on those models), the fan speed can be controlled to a certain degree. Once the fan is running, it can be -forced to run faster or slower with the following command: +forced to run faster or slower with the following command:: echo 'speed <speed>' > /proc/acpi/ibm/fan@@ -1241,13 +1304,14 @@ effect or the fan speed eventually settles somewhere in that range. The fan cannot be stopped or started with this command. This functionality is incomplete, and not available through the sysfs interface. -To program the safety watchdog, use the "watchdog" command. +To program the safety watchdog, use the "watchdog" command:: echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan If you want to disable the watchdog, use 0 as the interval. -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ The sysfs interface follows the hwmon subsystem guidelines for the most part, and the exception is the fan safety watchdog.@@ -1261,10 +1325,10 @@ to the firmware). Features not yet implemented by the driver return ENOSYS. hwmon device attribute pwm1_enable: - 0: PWM offline (fan is set to full-speed mode) - 1: Manual PWM control (use pwm1 to set fan level) - 2: Hardware PWM control (EC "auto" mode) - 3: reserved (Software PWM control, not implemented yet) + - 0: PWM offline (fan is set to full-speed mode) + - 1: Manual PWM control (use pwm1 to set fan level) + - 2: Hardware PWM control (EC "auto" mode) + - 3: reserved (Software PWM control, not implemented yet) Modes 0 and 2 are not supported by all ThinkPads, and the driver is not always able to detect this. If it does know a@@ -1304,7 +1368,9 @@ WAN --- procfs: /proc/acpi/ibm/wan + sysfs device attribute: wwan_enable (deprecated) + sysfs rfkill class: switch "tpacpi_wwan_sw" This feature shows the presence and current state of the built-in@@ -1316,22 +1382,24 @@ so it is kept across reboots and power-off. It was tested on a Lenovo ThinkPad X60. It should probably work on other ThinkPad models which come with this module installed. -Procfs notes: +Procfs notes +^^^^^^^^^^^^ -If the W-WAN card is installed, the following commands can be used: +If the W-WAN card is installed, the following commands can be used:: echo enable > /proc/acpi/ibm/wan echo disable > /proc/acpi/ibm/wan -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ If the W-WAN card is installed, it can be enabled / disabled through the "wwan_enable" thinkpad-acpi device attribute, and its current status can also be queried. enable: - 0: disables WWAN card / WWAN card is disabled - 1: enables WWAN card / WWAN card is enabled. + - 0: disables WWAN card / WWAN card is disabled + - 1: enables WWAN card / WWAN card is enabled. Note: this interface has been superseded by the generic rfkill class. It has been deprecated, and it will be removed in year@@ -1354,7 +1422,8 @@ sysfs rfkill class: switch "tpacpi_uwb_sw" This feature exports an rfkill controller for the UWB device, if one is present and enabled in the BIOS. -Sysfs notes: +Sysfs notes +^^^^^^^^^^^ rfkill controller switch "tpacpi_uwb_sw": refer to Documentation/rfkill.txt for details.@@ -1368,11 +1437,11 @@ This sysfs attribute controls the keyboard "face" that will be shown on the Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read and set. -1 = Home mode -2 = Web-browser mode -3 = Web-conference mode -4 = Function mode -5 = Layflat mode +- 1 = Home mode +- 2 = Web-browser mode +- 3 = Web-conference mode +- 4 = Function mode +- 5 = Layflat mode For more details about which buttons will appear depending on the mode, please review the laptop's user guide:@@ -1382,13 +1451,13 @@ Multiple Commands, Module Parameters ------------------------------------ Multiple commands can be written to the proc files in one shot by -separating them with commas, for example: +separating them with commas, for example:: echo enable,0xffff > /proc/acpi/ibm/hotkey echo lcd_disable,crt_enable > /proc/acpi/ibm/video Commands can also be specified when loading the thinkpad-acpi module, -for example: +for example:: modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable@@ -1397,14 +1466,16 @@ Enabling debugging output ------------------------- The module takes a debug parameter which can be used to selectively -enable various classes of debugging output, for example: +enable various classes of debugging output, for example:: modprobe thinkpad_acpi debug=0xffff will enable all debugging output classes. It takes a bitmask, so to enable more than one output class, just add their values. + ============= ====================================== Debug bitmask Description + ============= ====================================== 0x8000 Disclose PID of userspace programs accessing some functions of the driver 0x0001 Initialization and probing@@ -1415,6 +1486,7 @@ to enable more than one output class, just add their values. 0x0010 Fan control 0x0020 Backlight brightness 0x0040 Audio mixer/volume control + ============= ====================================== There is also a kernel build option to enable more debugging information, which may be necessary to debug driver problems.@@ -1432,8 +1504,10 @@ the module parameter force_load=1. Regardless of whether this works or not, please contact [email protected] with a report. -Sysfs interface changelog: +Sysfs interface changelog +^^^^^^^^^^^^^^^^^^^^^^^^^ +========= =============================================================== 0x000100: Initial sysfs support, as a single platform driver and device. 0x000200: Hot key support for 32 hot keys, and radio slider switch@@ -1485,3 +1559,4 @@ Sysfs interface changelog: 0x030000: Thermal and fan sysfs attributes were moved to the hwmon device instead of being attached to the backing platform device. +========= ===============================================================Documentation/laptops/toshiba_haps.rst renamed from Documentation/laptops/toshiba_haps.txt +29
-18@@ -1,18 +1,19 @@ -Kernel driver toshiba_haps +==================================== Toshiba HDD Active Protection Sensor ==================================== +Kernel driver: toshiba_haps + Author: Azael Avalos <[email protected]> -0. Contents ------------ +.. 0. Contents -1. Description -2. Interface -3. Accelerometer axes -4. Supported devices -5. Usage + 1. Description + 2. Interface + 3. Accelerometer axes + 4. Supported devices + 5. Usage 1. Description@@ -32,17 +33,20 @@ file to set the desired protection level or sensor sensibility. ------------ This device comes with 3 methods: -_STA - Checks existence of the device, returning Zero if the device does not + +==== ===================================================================== +_STA Checks existence of the device, returning Zero if the device does not exists or is not supported. -PTLV - Sets the desired protection level. -RSSS - Shuts down the HDD protection interface for a few seconds, +PTLV Sets the desired protection level. +RSSS Shuts down the HDD protection interface for a few seconds, then restores normal operation. +==== ===================================================================== Note: -The presence of Solid State Drives (SSD) can make this driver to fail loading, -given the fact that such drives have no movable parts, and thus, not requiring -any "protection" as well as failing during the evaluation of the _STA method -found under this device. + The presence of Solid State Drives (SSD) can make this driver to fail loading, + given the fact that such drives have no movable parts, and thus, not requiring + any "protection" as well as failing during the evaluation of the _STA method + found under this device. 3. Accelerometer axes@@ -66,11 +70,18 @@ conventional HDD and not only SSD, or a combination of both HDD and SSD. -------- The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are: -protection_level - The protection_level is readable and writeable, and + +================ ============================================================ +protection_level The protection_level is readable and writeable, and provides a way to let userspace query the current protection level, as well as set the desired protection level, the available protection levels are: - 0 - Disabled | 1 - Low | 2 - Medium | 3 - High -reset_protection - The reset_protection entry is writeable only, being "1" + + ============ ======= ========== ======== + 0 - Disabled 1 - Low 2 - Medium 3 - High + ============ ======= ========== ======== + +reset_protection The reset_protection entry is writeable only, being "1" the only parameter it accepts, it is used to trigger a reset of the protection interface. +================ ============================================================Documentation/sysctl/vm.txt +2
-2@@ -102,7 +102,7 @@ Changing this takes effect whenever an application requests memory. block_dump block_dump enables block I/O debugging when set to a nonzero value. More -information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. +information on block I/O debugging is in Documentation/laptops/laptop-mode.rst. ==============================================================@@ -286,7 +286,7 @@ shared memory segment using hugetlb page. laptop_mode laptop_mode is a knob that controls "laptop mode". All the things that are -controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. +controlled by this knob are discussed in Documentation/laptops/laptop-mode.rst. ==============================================================MAINTAINERS +1
-1@@ -14753,7 +14753,7 @@ M: Mattia Dongili <[email protected]> L: [email protected] W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers S: Maintained -F: Documentation/laptops/sony-laptop.txt +F: Documentation/laptops/sony-laptop.rst F: drivers/char/sonypi.c F: drivers/platform/x86/sony-laptop.c F: include/linux/sony-laptop.hdrivers/char/Kconfig +1
-1@@ -382,7 +382,7 @@ config SONYPI Device which can be found in many (all ?) Sony Vaio laptops. If you have one of those laptops, read - <file:Documentation/laptops/sonypi.txt>, and say Y or M here. + <file:Documentation/laptops/sonypi.rst>, and say Y or M here. To compile this driver as a module, choose M here: the module will be called sonypi.drivers/platform/x86/Kconfig +2
-3@@ -451,7 +451,7 @@ config SONY_LAPTOP screen brightness control, Fn keys and allows powering on/off some devices. - Read <file:Documentation/laptops/sony-laptop.txt> for more information. + Read <file:Documentation/laptops/sony-laptop.rst> for more information. config SONYPI_COMPAT bool "Sonypi compatibility"@@ -503,7 +503,7 @@ config THINKPAD_ACPI support for Fn-Fx key combinations, Bluetooth control, video output switching, ThinkLight control, UltraBay eject and more. For more information about this driver see - <file:Documentation/laptops/thinkpad-acpi.txt> and + <file:Documentation/laptops/thinkpad-acpi.rst> and <http://ibm-acpi.sf.net/> . This driver was formerly known as ibm-acpi. --2.21.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 24/31 docs: iio: convert to ReST
In reply to Mauro Carvalho ChehabRename the iio documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
---
.../iio/{ep93xx_adc.txt => ep93xx_adc.rst} | 15 +++++-
.../{iio_configfs.txt => iio_configfs.rst} | 52 +++++++++++--------
Documentation/iio/index.rst | 12 +++++
drivers/iio/Kconfig | 2 +-
4 files changed, 56 insertions(+), 25 deletions(-)
rename Documentation/iio/{ep93xx_adc.txt => ep93xx_adc.rst} (71%)
rename Documentation/iio/{iio_configfs.txt => iio_configfs.rst} (73%)
create mode 100644 Documentation/iio/index.rstDocumentation/iio/ep93xx_adc.rst renamed from Documentation/iio/ep93xx_adc.txt +13 -2
@@ -1,12 +1,16 @@ -Cirrus Logic EP93xx ADC driver. +============================== +Cirrus Logic EP93xx ADC driver +============================== 1. Overview +=========== The driver is intended to work on both low-end (EP9301, EP9302) devices with 5-channel ADC and high-end (EP9307, EP9312, EP9315) devices with 10-channel touchscreen/ADC module. 2. Channel numbering +==================== Numbering scheme for channels 0..4 is defined in EP9301 and EP9302 datasheets. EP9307, EP9312 and EP9312 have 3 channels more (total 8), but the numbering is
@@ -17,13 +21,20 @@ Assuming ep93xx_adc is IIO device0, you'd find the following entries under +-----------------+---------------+ | sysfs entry | ball/pin name | - +-----------------+---------------+ + +=================+===============+ | in_voltage0_raw | YM | + +-----------------+---------------+ | in_voltage1_raw | SXP | + +-----------------+---------------+ | in_voltage2_raw | SXM | + +-----------------+---------------+ | in_voltage3_raw | SYP | + +-----------------+---------------+ | in_voltage4_raw | SYM | + +-----------------+---------------+ | in_voltage5_raw | XP | + +-----------------+---------------+ | in_voltage6_raw | XM | + +-----------------+---------------+ | in_voltage7_raw | YP | +-----------------+---------------+
Documentation/iio/iio_configfs.rst renamed from Documentation/iio/iio_configfs.txt +30 -22
117 lines not on this page · raw message
Documentation/iio/index.rst new file +12 -0
@@ -0,0 +1,12 @@ +:orphan: + +============== +Industrial I/O +============== + +.. toctree:: + :maxdepth: 1 + + iio_configfs + + ep93xx_adc
drivers/iio/Kconfig +1 -1
@@ -28,7 +28,7 @@ config IIO_CONFIGFS help This allows configuring various IIO bits through configfs (e.g. software triggers). For more info see - Documentation/iio/iio_configfs.txt. + Documentation/iio/iio_configfs.rst. config IIO_TRIGGER bool "Enable triggered sampling support"
Signature · 1 line
2.21.0