aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/Documentation (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-27staging: greybus: remove license "boilerplate"Greg Kroah-Hartman2-92/+0
When the greybus drivers were converted to SPDX identifiers for the license text, some license boilerplate was not removed. Clean this up by removing this unneeded text now. Cc: Johan Hovold <johan@kernel.org> Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com> Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Cc: greybus-dev@lists.linaro.org Cc: devel@driverdev.osuosl.org Acked-by: Mark Greer <mgreer@animalcreekk.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Alex Elder <elder@kernel.org> Link: https://lore.kernel.org/r/20190825055429.18547-3-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman2-0/+2
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/greybus files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: David Lin <dtwlin@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: greybus: firmware: Convert sscanf calls to strtoulMichael Sartain1-5/+7
Also convert the fw_update_type and fw_timeout variables to unsigned and update the printf specifier to %u. The FW_MGMT_IOC_SET_TIMEOUT_MS ioctl takes an unsigned int and checkpatch was complaining about not checking the sscanf return values. Signed-off-by: Michael Sartain <mikesart@fastmail.com> Acked-by: Viresh Kumar <viresh.kumar at linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: greybus: firmware: Change long long unsigned to unsigned long longMichael Sartain1-1/+1
Fixes checkpatch warning: type 'long long unsigned int' should be specified in [[un]signed] [short|int|long|long long] order Signed-off-by: Michael Sartain <mikesart@fastmail.com> Acked-by: Viresh Kumar <viresh.kumar at linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: greybus: firmware: Remove extra braces from single line ifMichael Sartain1-4/+3
Fixes checkpatch warning: braces {} are not necessary for any arm of this statement Signed-off-by: Michael Sartain <mikesart@fastmail.com> Acked-by: Viresh Kumar <viresh.kumar at linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: greybus: firmware: Remove trailing semicolon from FW_TIMEOUT_DEFAULTMichael Sartain1-1/+1
Fixes checkpatch warning: macros should not use a trailing semicolon Signed-off-by: Michael Sartain <mikesart@fastmail.com> Acked-by: Viresh Kumar <viresh.kumar at linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: greybus: remove old es1 endpoint descriptionGreg Kroah-Hartman1-70/+0
The Toshiba ES1 chip is no longer around, so remove the USB descriptor documentation for it as no one cares anymore. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-09-19staging: greybus: Documentation: remove sysfs treeGreg Kroah-Hartman56-18/+0
We do not need an example of the sysfs tree in the kernel code itself, so remove these files, as they are now pointless. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-08-12greybus: firmware: s/_LEN/_SIZEViresh Kumar2-7/+7
Alex Elder pointed out that the macros also count the trailing NULL ('\0') character and so it should be using SIZE instead of LEN. This patch makes that change. Reported-by: Alex Elder <alex.elder@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-08-11greybus: firmware: Fix typo in documentationViresh Kumar1-25/+26
s/shall be used the user/shall be used by the user/ Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-28greybus: Documentation/sysfs: replace Ara referencesJohan Hovold1-2/+2
Refer to the MDK as GMP MDK. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-26greybus: svc_watchdog: Add sysfs file to change the behavior of biteDavid Lin1-0/+16
Currently, AP performs unipro_reset if SVC fails to response to its ping. While this error recovery is best suited for the end-user experience, errors in the UniPro network could potentially go unnoticed by the QA and fishfooders in the development phase of the project. This patch adds an option to trigger a kernel panic so logs can be collected for analysis. Testing Done: - Reproduce issue and observe kernel panic when watchdob_control is changed to 'panic' Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-26greybus: firmware: Update Documentation and sample applicationViresh Kumar2-17/+52
Update documentation and sample application to capture the 'status' byte in backend version operation and new error types in backend firmware update operation. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-21greybus: firmware: Improve test applicationViresh Kumar1-50/+96
It can take arguments not and we can perform all the operations with a single binary, sorry for missing that initially. Usage: ./firmware <gb-fw-mgmt-X> <type: interface/backend> <firmware-tag> <timeout> And all of them have default values, etc. Tested with a semco 13 MP module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-20greybus: interface: fix power_state documentationJohan Hovold1-8/+9
Reword the power_state attribute documentation to make it clear that an attempt to boot and possibly enumerate an interface is made when writing "on" to the file, and that on errors the interface will again be powered down. Drop the incorrect claim that writing the currently read value has no effect, since no such guarantees can be made (e.g. several writers may be sleeping on the interface mutex). Also fix some minor language issues. Reviewed-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-20greybus: interface: add power_state attributeViresh Kumar1-0/+17
User space needs the capability of powering ON or OFF an Interface for multiple use cases. For example, userspace may want an Interface currently in its S3 boot stage, to boot into its S2 Loader stage to update the bridge SPI flash. Or the Interface is running its S2 Loader stage and updated the SPI flash with the new S2 Loader firmware and wants to boot into the new S2 Loader firmware. Another use case can be, Android wants to disable (not eject) a misbehaving module. Add a 'power_state' sysfs file within the interface directory. It can be read to know the current power state of the Interface and can be written to power ON or power OFF an Interface. Possible values that can be written or read from it are: "on" and "off". Testing Done: Tested by enabling/disabling camera module on EVT 2.0. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> CC: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> [johan: drop es3-quirk duplication, add to power attribute group, fix return value, drop tags ] Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Sandeep Patil <sspatil@google.com> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-19greybus: interface: add interface-type attributeJohan Hovold1-0/+8
Add an interface-type string attribute that represents the detected interface type as either "dummy", "unipro", "greybus", or "unknown". Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Sandeep Patil <sspatil@google.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-06greybus: Documentation: Document Authentication interfacesViresh Kumar2-4/+269
This patch defined userspace interface of the CAP protocol. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Jun Li <li_jun@projectara.com> Tested-by: Jun Li <li_jun@projectara.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-06-16greybus: firmware: prefix char-device with 'gb-'Viresh Kumar2-10/+10
This will make it consistent with any other character devices we have for greybus and let us identify greybus character devices easily. Compiled tested only. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-16greybus: firmware: Add license and copyright header to applicationViresh Kumar1-1/+52
Add license and copyright header to the firmware.c test application. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-10greybus: firmware: Fix spelling mistakeViresh Kumar1-1/+1
s/directly/directory :) Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26greybus: Documentation/sysfs: gbphy0 is an invalid nameViresh Kumar2-0/+0
The numbering of gbphy devices is going to start from 1 and not 0. Reflect the same in sysfs hierarchy. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26greybus: Documentation/sysfs: Rename gpbridge to gbphyViresh Kumar2-0/+0
These were left in the earlier renaming series, fix them as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-15greybus: Documentation: Document firmware-management interfacesViresh Kumar2-0/+336
This patch adds a new 'firmware' folder in Documentation, which contains two files: - firmware-management: This describes the userspace interface for interacting with firmware-management bundle. - firmware.c: Sample application to test firmware load for Interface Firmware and firmware updates to Backend Interface Firmware. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Jun Li <li_jun@projectara.com> Tested-by: Karthik Ravi Shankar <karthikrs@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-05greybus: Documentation: Add sysfs information about bridged-phy deviceVaibhav Hiremath1-0/+8
Update the documentation (sysfs-bus-greybus) for recent conversion of bridged-phy drivers to real drivers. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-05greybus: Revert "interface: Fetch and expose version of interface's firmware"Viresh Kumar1-8/+0
This reverts commit b957ade7b3e4ab8c149c53346dbf02e977b7f3a7. The interface version is now managed as part of the firmware-management protocol. This operation is already removed from the greybus specifications. Drop interface version support from greybus. Tested with gbsim (sysfs file not available after this patch). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Acked-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-29greybus: Documentation/sysfs: fix sysfs pathsSandeep Patil1-29/+29
correct sysfs paths typo. (s/device/devices). Signed-off-by: Sandeep Patil <sspatil@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-29greybus: Documentation/sysfs: add entry for host device bus_idSandeep Patil3-0/+9
Add description for greybus host device bus_id attribute Signed-off-by: Sandeep Patil <sspatil@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: module: implement controlled module removalJohan Hovold1-0/+8
Implement controlled module removal through a new module attribute "eject". When a non-zero argument is written to the attribute, all interfaces of the module are disabled (e.g. bundles are deregistered) and deactivated (e.g. powered off) before instructing the SVC to physically eject the module. Note that the module device is not deregistered until the SVC has reported the physical removal of all of its interfaces. A new interface mutex is added to enforce interface state-change serialisation. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: core: add module abstractionJohan Hovold1-20/+43
Add Greybus module abstraction that will be used to implement controlled module removal (eject) and represent module geometry. 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, bundles, and control devices are consequently renamed as <bus_id>-<module_id>.<interface_id> <bus_id>-<module_id>.<interface_id>.<bundle_id> <bus_id>-<module_id>.<interface_id>.ctrl 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: 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 until SVC module-size detection has been implemented, all interfaces are considered to be part of 1x2 modules. Specifically, the two interfaces of a 2x2 module will be presented as two 1x2 modules for now. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: Documentation/sysfs: sort entries alphabeticallyJohan Hovold1-18/+18
The attribute entries have been kept mostly sorted within each device type. Let's move the three more-recently added interface attributes that were not. Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: Documentation/sysfs: add entry for control deviceJohan Hovold1-3/+11
Add an entry for the recently added interface control device. Also move the bundle-device entry below the control-device entries. Reported-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-21greybus: interface: move vendor and product strings to control deviceJohan Hovold1-14/+14
The control device is an abstraction of the control connection over which a greybus manifest is retrieved. As interfaces switch modes (e.g. after boot-over-unipro) they expose new manifests, which can contain different vendor and product strings. Eventually control devices will be deregistered and recreated after an interface mode switch, while the interface itself remains registered. Note that only interfaces of type greybus will have control devices. Specifically, dummy interfaces will not. 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>
2016-04-21greybus: Documentation/sysfs: add example control devicesJohan Hovold6-0/+0
Add control devices to the example sysfs tree. Control devices are named <bus_id>-<module_id>.<intf_id>.ctrl and expose attributes that are specific to the greybus interface type. Specifically, dummy interfaces do not have a control device. Currently, only the vendor and product strings extracted from the manifest are exported. A subtree of the example tree now looks as follows: greybus1/ ├── 1-5 │   ├── 1-5.5 │   │   ├── 1-5.5.2 │   │   │   ├── bundle_class │   │   │   ├── bundle_id │   │   │   └── state │   │   ├── 1-5.5.ctrl │   │   │   ├── product_string │   │   │   └── vendor_string │   │   ├── ddbl1_manufacturer_id │   │   ├── ddbl1_product_id │   │   ├── interface_id │   │   ├── product_id │   │   ├── serial_number │   │   └── vendor_id │   ├── 1-5.6 │   │   └── interface_id │   ├── eject │   ├── module_id │   └── num_interfaces └── 1-svc 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>
2016-04-21greybus: Documentation/sysfs: rename the svc eject attributeJohan Hovold2-0/+0
The svc eject attribute was added as an interim solution and is still used to implement a form of forced ejection. This will soon be superseded by the module eject attribute, which will provide an interface for clean eject. We may keep the forced-eject mechanism around indefinitely, albeit possibly with a different name (e.g. forced_intf_eject). Either way, update the example tree to reflect the actual name, intf_eject, which currently used for this svc attribute. 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>
2016-04-21greybus: Documentation/sysfs: remove interface unique_id attributeJohan Hovold3-0/+0
Remove the interface unique_id attribute, which there is currently no plan to ever implement. Note that the Ara serial numbers are already exposed through the serial_number attribute. 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>
2016-04-21greybus: Documentation: move the interface power attributesJohan Hovold1-21/+21
Move the interface power attributes after the other interface attributes to keep the attributes grouped by device type. 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>
2016-04-07greybus: svc: add Interface power measurements supportDavid Lin1-0/+21
This change implements the AP Power Monitor functions for obtaining current/voltage/power on a specific rail of an Interface. Testing Done: $ cat /sys/bus/greybus/devices/1-3/current_now 103 $ cat /sys/bus/greybus/devices/1-3/power_now 303 $ cat /sys/bus/greybus/devices/1-3/voltage_now 203 Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-25greybus: Documentation/sysfs: make 1-5 a 2x2 moduleJohan Hovold2-1/+2
Make example module 1-5 a 2x2 module by adding a second, dummy interface. This is both an example of how a 2x2 module would be represented and also suggests what a dummy interface may look like. A 2x2 module has two child interface devices and a num_interfaces value of two. In this example, the secondary interface 1-5.6, is a dummy interface and therefore lacks the normal identifying attributes (e.g. UniPro DDBL1 and Ara ids). We may eventually add an interface_type attribute to facilitate distinguishing various interface types (there may be more than two). In the following tree, the bundle attributes and child devices have been left out: greybus1/ ├── 1-2 │   ├── 1-2.2 │   │   ├── 1-2.2.1 │   │   ├── 1-2.2.2 │   │   ├── ddbl1_manufacturer_id │   │   ├── ddbl1_product_id │   │   ├── interface_id │   │   ├── product_id │   │   ├── serial_number │   │   ├── unique_id │   │   └── vendor_id │   ├── eject │   ├── module_id │   └── num_interfaces ├── 1-5 │   ├── 1-5.5 │   │   ├── 1-5.5.2 │   │   ├── ddbl1_manufacturer_id │   │   ├── ddbl1_product_id │   │   ├── interface_id │   │   ├── product_id │   │   ├── serial_number │   │   ├── unique_id │   │   └── vendor_id │   ├── 1-5.6 │   │   └── interface_id │   ├── eject │   ├── module_id │   └── num_interfaces └── 1-svc In this example there are two modules: 1-2 is a 1x2 module with one interface, and 1-5 is a 2x2 module with two interfaces of which the second (1-5.6) is a dummy interface. 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>
2016-02-25greybus: Documentation/sysfs: move module 1-4 to position 5Johan Hovold17-2/+2
Move example module 1-4 to position 5, effectively renaming it 1-5. 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>
2016-02-25greybus: Documentation/sysfs: add module devicesJohan Hovold44-0/+6
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>
2016-02-22greybus: Documentation: remove svc unique_id attributeJohan Hovold3-7/+0
Remove unimplemented svc unique_id attribute from the documentation. This attribute made more sense when we thought we'd have an AP-module, unlike now when the AP and SVC are both part of the same frame. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-26greybus: svc watchdog: allow it to be enabled/disabled from userspaceGreg Kroah-Hartman1-0/+8
Sometimes you want to disable the SVC watchdog without having to patch your kernel, so provide a sysfs file to do this. This can let us do power measurements, and let the firmware developers not go crazy worrying that the kernel is going to reset their chips with no notice. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-12greybus: svc: add intf_eject attributeRui Miguel Silva1-0/+8
Add a new write-only svc attribute to send an eject request to the svc giving the interface number. So, doing: echo 3 > /sys/bus/greybus/devices/1-svc/intf_eject will force eject the module on interface 3 (module slot 1 on EVT1). This can take some seconds as the pulse width for module release is large. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com>
2015-12-30greybus: interface: Fetch and expose version of interface's firmwareViresh Kumar1-0/+8
The version of the currently running firmware on the module is useful for userspace as it can be used to find if an update is available or not. This patch fetches interface's version with a new control operation and exposes the same in userspace. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-30greybus: interface: Receive serial-number on hotplug eventViresh Kumar4-0/+8
Two exactly same modules can be uniquely identified using module's serial-number. This patch updates the interface hotplug event to also receive the serial-number of the module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-22greybus: interface: Expose DDBL1 manufacturing and production id in sysfsViresh Kumar7-0/+16
These ids are already fetched from the SVC, but were never exposed to sysfs. Userspace may be interested in using these values and hence these must be exposed to it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-04greybus: Documentation: Arrange entries in alphabetical orderViresh Kumar1-40/+40
The order of entries in sysfs-bus-greybus file doesn't match the order files/directories in sysfs on a real board. More specifically, N-svc comes at last and ap_interface_id comes before endo_id within the svc. Fix that. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03greybus: Documentation: Fix N-svc directory nameViresh Kumar1-1/+1
endo_id was present in place of the directory N-svc, fix it. Fixes: 4f7b1833e78f ("Documentation/sysfs-bus-greybus: update the bus ABI documentation") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: Documentation/sysfs: rename interface and bundle attributesJohan Hovold11-0/+0
Update the example sysfs-tree layout under Documentation due renamed interface and bundle attributes. The interface and bundle "id" attributes have been renamed "interface_id" and "bundle_id" respectively to make them self describing. For consistency reasons the bundle class attribute is renamed as "bundle_class". . ├── greybus1 │   ├── 1-2 │   │   ├── 1-2.1 │   │   │   ├── bundle_class │   │   │   ├── bundle_id │   │   │   └── state │   │   ├── 1-2.2 │   │   │   ├── bundle_class │   │   │   ├── bundle_id │   │   │   └── state │   │   ├── interface_id │   │   ├── product_id │   │   ├── unique_id │   │   └── vendor_id │   ├── 1-4 │   │   ├── 1-4.2 │   │   │   ├── bundle_class │   │   │   ├── bundle_id │   │   │   ├── gpbridge0 │   │   │   │   ├── gpio │   │   │   │   │   └── gpiochip490 │   │   │   │   └── i2c-4 │   │   │   └── state │   │   ├── interface_id │   │   ├── product_id │   │   ├── unique_id │   │   └── vendor_id │   └── 1-svc │   ├── ap_intf_id │   ├── eject │   ├── endo_id │   └── unique_id └── greybus2 ├── 2-3 │   ├── 2-3.1 │   │   ├── bundle_class │   │   ├── bundle_id │   │   └── state │   ├── interface_id │   ├── product_id │   ├── unique_id │   └── vendor_id └── 2-svc ├── ap_intf_id ├── eject ├── endo_id └── unique_id Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>