summaryrefslogtreecommitdiffstats
path: root/Documentation/usb/functionfs.txt
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-04-15 23:56:01 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-16 12:16:19 +0200
commitd80b5005c5dd113442454b469752f0f95ac15645 (patch)
tree36450319ec6c345904bfb591fdd125af093db2b6 /Documentation/usb/functionfs.txt
parent5f9be5f3f89921de6e3961bedf3202a383f126c9 (diff)
downloadlinux-stable-d80b5005c5dd113442454b469752f0f95ac15645.tar.gz
linux-stable-d80b5005c5dd113442454b469752f0f95ac15645.tar.bz2
linux-stable-d80b5005c5dd113442454b469752f0f95ac15645.zip
docs: usb: convert documents to ReST
Convert USB documents to ReST, in order to prepare for adding it to the kernel API book, as most of the stuff there are driver or subsystem-related. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/usb/functionfs.txt')
-rw-r--r--Documentation/usb/functionfs.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/Documentation/usb/functionfs.txt b/Documentation/usb/functionfs.txt
index eaaaea019fc7..7fdc6d840ac5 100644
--- a/Documentation/usb/functionfs.txt
+++ b/Documentation/usb/functionfs.txt
@@ -1,4 +1,6 @@
-*How FunctionFS works*
+====================
+How FunctionFS works
+====================
From kernel point of view it is just a composite function with some
unique behaviour. It may be added to an USB configuration only after
@@ -38,13 +40,13 @@ when mounting.
One can imagine a gadget that has an Ethernet, MTP and HID interfaces
where the last two are implemented via FunctionFS. On user space
-level it would look like this:
+level it would look like this::
-$ insmod g_ffs.ko idVendor=<ID> iSerialNumber=<string> functions=mtp,hid
-$ mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp
-$ ( cd /dev/ffs-mtp && mtp-daemon ) &
-$ mkdir /dev/ffs-hid && mount -t functionfs hid /dev/ffs-hid
-$ ( cd /dev/ffs-hid && hid-daemon ) &
+ $ insmod g_ffs.ko idVendor=<ID> iSerialNumber=<string> functions=mtp,hid
+ $ mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp
+ $ ( cd /dev/ffs-mtp && mtp-daemon ) &
+ $ mkdir /dev/ffs-hid && mount -t functionfs hid /dev/ffs-hid
+ $ ( cd /dev/ffs-hid && hid-daemon ) &
On kernel level the gadget checks ffs_data->dev_name to identify
whether it's FunctionFS designed for MTP ("mtp") or HID ("hid").
@@ -64,4 +66,3 @@ have been written to their ep0's.
Conversely, the gadget is unregistered after the first USB function
closes its endpoints.
-