greybus: Documentation/sysfs: add module devices
authorJohan Hovold <johan@hovoldconsulting.com>
Mon, 22 Feb 2016 17:50:54 +0000 (18:50 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 26 Feb 2016 00:23:01 +0000 (16:23 -0800)
commit8886c44f87cbee41fd4ac1cfdf1ef6a7cb4583f5
tree9daa62f8f88e50c480df39cf3c27b9a0161ee354
parentbb80c76448b2463a1ecfe622df4f7b3c5fb39cdf
greybus: Documentation/sysfs: add module devices

Introduce module devices and rename interface and bundle devices.

Greybus module devices correspond to physical modules and have one or
more interfaces. Modules have an id that is identical to the id of their
primary interface, which in turn is the interface with lowest numbered
id. The module name is constructed from the bus and module id:

<bus_id>-<module_id>

Interfaces and bundles are consequently renamed as

<bus_id>-<module_id>.<interface_id>

and

<bus_id>-<module_id>.<interface_id>.<bundle_id>

respectively.

As before, interface ids (and therefore in a sense now also module ids)
correspond to physical interface positions on the frame.

Modules have the following attributes:

eject
module_id
num_interfaces

where module_id is the id of the module and num_interface the number of
interfaces the module has.

Note that the interface ids of a module's interfaces are expected to be
<module_id>, <module_id + 1>, ..., <module_id + num_interfaces - 1>.

Writing a non-zero argument to eject cleanly shuts down and unregisters
all of the module interfaces before ejecting the module.

The example sysfs tree now looks as follows with the second bus
(APBridgeA) left out:

greybus1/
├── 1-2
│   ├── 1-2.2
│   │   ├── 1-2.2.1
│   │   │   ├── bundle_class
│   │   │   ├── bundle_id
│   │   │   └── state
│   │   ├── 1-2.2.2
│   │   │   ├── bundle_class
│   │   │   ├── bundle_id
│   │   │   └── state
│   │   ├── ddbl1_manufacturer_id
│   │   ├── ddbl1_product_id
│   │   ├── interface_id
│   │   ├── product_id
│   │   ├── serial_number
│   │   ├── unique_id
│   │   └── vendor_id
│   ├── eject
│   ├── module_id
│   └── num_interfaces
├── 1-4
│   ├── 1-4.4
│   │   ├── 1-4.4.2
│   │   │   ├── bundle_class
│   │   │   ├── bundle_id
│   │   │   ├── gpbridge0
│   │   │   │   ├── gpio
│   │   │   │   │   └── gpiochip490
│   │   │   │   └── i2c-4
│   │   │   └── state
│   │   ├── ddbl1_manufacturer_id
│   │   ├── ddbl1_product_id
│   │   ├── interface_id
│   │   ├── product_id
│   │   ├── serial_number
│   │   ├── unique_id
│   │   └── vendor_id
│   ├── eject
│   ├── module_id
│   └── num_interfaces
└── 1-svc
    ├── ap_intf_id
    ├── eject
    └── endo_id

where greybus1 is a bus; 1-svc the svc; 1-2, and 1-4 are modules; 1-2.2
and 1-4.4 are (primary) interfaces; and 1-2.2.1, 1-2.2.2, and 1-4.4.2
are bundles.

Note that the svc eject attribute may eventually be renamed force_eject.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
79 files changed:
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.1/bundle_class [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.1/bundle_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.1/state [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.1/bundle_class [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.1/bundle_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.1/state [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.2/bundle_class [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.2/bundle_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/1-2.2.2/state [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/bundle_class [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/bundle_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/interface_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/serial_number [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/state [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/unique_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/1-2.2/vendor_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_manufacturer_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/eject [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/interface_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/module_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/num_interfaces [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/serial_number [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/unique_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/vendor_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.2/bundle_class [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.2/bundle_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.2/gpbridge0/gpio/gpiochip490/.gitignore [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.2/gpbridge0/i2c-4/.gitignore [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.2/state [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/1-4.4.2/bundle_class [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/1-4.4.2/bundle_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/1-4.4.2/gpbridge0/gpio/gpiochip490/.gitignore [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/1-4.4.2/gpbridge0/i2c-4/.gitignore [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/1-4.4.2/state [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/interface_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/serial_number [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/unique_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/1-4.4/vendor_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_manufacturer_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/eject [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/interface_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/module_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/num_interfaces [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/serial_number [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/unique_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/vendor_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.1/bundle_class [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.1/bundle_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.1/state [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/2-3.3.1/bundle_class [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/2-3.3.1/bundle_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/2-3.3.1/state [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/interface_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/serial_number [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/unique_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/2-3.3/vendor_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_manufacturer_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/eject [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/interface_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/module_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/num_interfaces [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/product_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/serial_number [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/unique_id [deleted file]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/vendor_id [deleted file]