summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/interface.c
Commit message (Collapse)AuthorAgeFilesLines
* greybus: timesync: Bind TimeSync into GreybusBryan O'Donoghue2016-06-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | TimeSync needs to bind into Greybus in a few places. - core.c To initialize its internal state and tear-down its internal state. To schedule a timesync to a newly added Bundle after probe() completes. - svc.c To get access to the SVC and enable/disable timesync as well as extracting the authoritative time from the SVC to subsequently disseminate to other entities in the system. - interface.c To get access to an Interface in order to inform APBx of timesync enable/disable and authoritative operations. This patch adds those bindings into Greybus core. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Acked-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: timesync: Add timesync core driverBryan O'Donoghue2016-06-061-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the core timesync functionality. 0. arche-platform.c/arche-apb-ctrl.c Modifies the platform layer to hook the incoming TIME_SYNC signal up to the timesync strobe IRQ handler. If the arche-platform driver can't satisfy the request for the wake-detect line, it will return -EAGAIN and the calling work-queue must reschedule the attempt to get exclusive access to the wake-detect pin logic. A private data field is added to the arche-platform driver to enable passing of a timesync pointer to the ISR responsible for synchronizing time. 1. timesync.c A new file added which contains all of the logic associated with sending greybus commands to SVC, APBx or Interfaces to enable, disable and disseminate timing information. 2. timesync_platform.c Any platform/arch specific code goes into timesync_platform.c. Originally the idea was to keep the x86 and ARM arch dependencies in a timesync_platform_arch.c file - however with further refinement that's currently not necessary however just-in-case it becomes necessary to resuscitate arch or platform specific methods for accessing timer resources that access shouldn't be part of the core timesync.c logic and so for the moment we access these timer resources through a thin access layer in timesync_platform.c. Expect this to go away long term ideally. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Acked-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: Mode switch takes over a secondViresh Kumar2016-06-021-1/+1
| | | | | | | | | | | | | | | | | | | Mode switch takes just over a second to complete and the current timeout of one second isn't sufficient. Mode-switch logs from EVT 1.5: [ 56.709082] gb-firmware 1-3.3.1: Requested firmware package 'ara_00000126_00001002_fffe0001_ff980067_03.tftf' [ 57.003968] gb_control_mode_switch_operation: 176 [ 58.041616] greybus 1-3.3: mode switch detected Increase the timeout to two seconds. Tested with EVT 1.5 with gpbridge-test module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Karthik Ravi Shankar <karthikrs@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: implement generic mode-switch functionalityJohan Hovold2016-05-271-2/+178
| | | | | | | | | | | | | | | | | | | | | | Add a generic interface for bundle drivers to use to request that a mode switch is carried out on its behalf. Mode switching involves tearing down all connections to an interface, sending a unidirectional mode-switch request, and waiting for a mailbox event that triggers deferred control connection reset and re-enumeration of the interface. In case of a timeout waiting for the interface mailbox event, or on other errors, the interface is powered off. All of this needs to be done by core from work-queue context in order not to block incoming SVC requests and bundle-device tear down. Care must also be taken to serialise against concurrent module removal events and eject requests. Special handling of legacy mode-switching is also added in order to continue to support the ES3 bootrom. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: avoid I/O to bootrom during removalJohan Hovold2016-05-271-2/+6
| | | | | | | | | | | | Add an interface quirk flag to suppress I/O during interface disable. This is needed to prevent I/O to the bootrom during controlled connection tear down (e.g. eject or driver unbind). This will be more obvious with the new connection tear-down procedure. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up bootrom quirk handlingJohan Hovold2016-05-271-4/+7
| | | | | | | | | Clean up bootrom quirk handling in preparation for addition of further flags. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: core: avoid I/O to disconnected interfacesJohan Hovold2016-05-271-7/+0
| | | | | | | | | | | | | | | | | | | | | | Add new helper to disable connections to interfaces that have already been disconnected (e.g. forcibly removed). The connection tear-down procedure differs enough depending on whether the interface is still present or already gone to warrant a dedicated helper. This will become more obvious with the new tear-down procedure, which involves I/O on the connection being tore down. This also simplifies handling of the legacy bootrom, which does not support the new tear-down operations. Specifically, this allows us to remove the early control-connection tear down during interface disable, and also avoids some error messages currently printed during legacy mode switch (i.e. bootrom boot-over-UniPro) and forcible removal. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: tracing: define interface tracesAlex Elder2016-05-261-0/+17
| | | | | | | | | | | | | Define a new gb_module trace point event class, used to trace events associated with the interface abstraction. Define four basic trace points for this--creation time, drop of last reference, before registring interfaces and after de-registering them. In addition, define traces for activating and deactivating, and enabling and disabling an interface. Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: fix svc-resource error messagesJohan Hovold2016-05-261-3/+3
| | | | | | | | | | The interface svc-resource helper are used to enable as well as disable the corresponding SVC resources so make sure the error messages reflect that. 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>
* greybus: gpbridge: rename 'gpbridge' to 'gbphy' everywhereSandeep Patil2016-05-191-1/+1
| | | | | | | | | | | | | | The 'gpbridge' name didn't relaly reflect what the bus is; which is a bus for bridged-phy devices. So, rename all instances of 'gpbridge' to more appropriate 'gbphy' Testing Done: Build and boot tested. 'lsgb' will stop displaying 'GPBridge' devices until I change the library to reflect this change. Signed-off-by: Sandeep Patil <patil_sandeep@projectara.com> Suggested-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: retry enumeration of UniPro-only modulesJeffrey Carlyle2016-05-181-1/+2
| | | | | | | | | | | | | | | Greybus modules will sometimes fail to send the mailbox poke and erroneously be enumerated as UniPro-only modules. The root cause for this on the module side is not fully understand, but it seems that this may be due to "the bootrom bug:" a known problem with the bootrom where linkup will occasionally fail because of a race condition. Before the new hotplug code was implemented in the firmware, the SVC would retry enumeration of modules that did not send the mailbox poke; this patch ports that functionality to the AP. Signed-off-by: Jeffrey Carlyle <jcarlyle@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: remove unused interface-version quirkJohan Hovold2016-05-131-4/+1
| | | | | | | | | The interface-version request was just removed so remove the now unused interface-version quirk. 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>
* greybus: interface: fix type in enable error messageJohan Hovold2016-05-131-1/+1
| | | | | | | | Fix type of PTR_ERR in an interface-enable error message. 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>
* greybus: Revert "interface: Fetch and expose version of interface's firmware"Viresh Kumar2016-05-051-15/+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>
* greybus: interface: fix broken UniPro flow controlJohan Hovold2016-04-281-0/+3
| | | | | | | | | | | | | | A recent commit inadvertently disabled E2EFC on all interface connections, due to a failure to clear the ES3 bootrom quirk flags during mode switch. Testing Done: Verified that the CPort flags are again set to 0x7 for non-bootrom interface connections. Fixes: 5b638080e94e ("svc: keep interfaces registered during mode switch") Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: implement interface activation and power downJohan Hovold2016-04-251-2/+122
| | | | | | | | | | | | | | | Implement the interface activation and power-down sequences. Note that all the required SVC operations have not yet been implemented so some stub functions are used for now. Support for hibernating the UniPro link depends on future power-management work so a stub function is used also for this. Interface type handling will be refined later. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: add active state flagJohan Hovold2016-04-251-0/+7
| | | | | | | | Add active state flag to avoid deactivating an interface which is already off. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: module: implement controlled module removalJohan Hovold2016-04-251-1/+21
| | | | | | | | | | | | | | | | | | | 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>
* greybus: core: add module abstractionJohan Hovold2016-04-251-28/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* greybus: svc: keep interfaces registered during mode switchJohan Hovold2016-04-211-15/+17
| | | | | | | | | | | | | Keep a detected interface registered until it is physically removed. Specifically, do not re-register an interface that is switching mode. Note that this also allows us to get rid of some nasty hacks from core. The Ara VID/PID bootrom hack for ES2 will continue to work, but is now mostly confined to the bootrom driver. 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>
* greybus: interface: reduce control-device lifetimeJohan Hovold2016-04-211-12/+22
| | | | | | | | | | | | Make the control-device lifetime coincide with when the interface is enabled (enumerated). This is needed to be able register a new control device after a mode switch. 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>
* greybus: control: return error pointer when failing to create control deviceJohan Hovold2016-04-211-2/+4
| | | | | | | | Return an error pointer when failing to create a control device. 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>
* greybus: interface: move vendor and product strings to control deviceJohan Hovold2016-04-211-7/+0
| | | | | | | | | | | | | | | | | 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>
* greybus: interface: register control device at hotplugJohan Hovold2016-04-211-0/+4
| | | | | | | | | | | Make sure to register also the control device along with any bundles when registering an interface. Note that we currently ignore failures to register the control device just as we do for bundle devices. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: core: make the control object be a deviceJohan Hovold2016-04-211-1/+1
| | | | | | | | | | Make the control object be a greybus device. The control device will be used to expose attributes specific to greybus-type interfaces. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add Interface power measurements supportDavid Lin2016-04-071-0/+60
| | | | | | | | | | | | | | | | | | | 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>
* greybus: interface: add Ara serial-number supportJohan Hovold2016-03-301-2/+12
| | | | | | | Add support for reading the Ara serial-number attributes. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up DME attribute handlingJohan Hovold2016-03-301-10/+16
| | | | | | | | | | | | | | Move all DME defines to the interface code and rename them using common prefixes (e.g. DME_T and DME_TOSHIBA). The DDB L1 attributes are defined by MIPI and the Ara attributes are currently Toshiba specific so move them all out of the Greybus protocol header. Also rename the Greybus init-status values using a GB_INIT prefix. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up ES2 VID/PID hackJohan Hovold2016-03-301-0/+1
| | | | | | | | | | Clean up the ES2 VID/PID hack using a new quirk flag. Note that the hack is now used if and only if the interface is a Toshiba ES2 bridge (and not if the attributes read zero). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: add ES2 init-status quirk flagJohan Hovold2016-03-301-6/+7
| | | | | | | Add ES2 init-status quirk flag instead of checking MID/PID directly. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: read DME attributes at activationJohan Hovold2016-03-301-0/+72
| | | | | | | | | | | | | | | | Read the DDBL1 and Ara DME attributes when activating an interface. These values are currently provided by the SVC in the intf_hotplug request, which is about to go away. Note that there are currently no standard Ara VID and PID attributes and that Toshiba uses attributes from the reserved space in ES3. For now, we therefore refuse to enumerate any non-Toshiba bridges. Also note that the Ara serial number is currently not supported. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: greybus_protocols: rename NULL DME selector indexJohan Hovold2016-03-301-2/+2
| | | | | | | Add NULL suffix to the don't-care DME selector index. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up device-id handlingJohan Hovold2016-03-301-14/+11
| | | | | | | | Clean up the device id-handling and make sure we never allocate invalid device ids due to a missing upper bound. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: move route creation to interface activationJohan Hovold2016-03-301-0/+81
| | | | | | | | | | | | Creating and destroying a route to an interface is arguably an interface operation and belongs with the interface code. Add new interface_activate and interface_deactivate helpers that will be used to activate and deactivate an interface in the new interface boot sequence. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up ES3-bootroom-quirk handlingJohan Hovold2016-03-301-4/+13
| | | | | | | | | | | | | | Clean up handling of the ES3-bootrom quirks by adding an interface quirk-flags field that is set appropriately when we detect that the ES3 bootrom is running. Note that we need to reserve the DME_DIS_UNIPRO_BOOT_STARTED and DME_DIS_FALLBACK_UNIPRO_BOOT_STARTED status values for the ES3 bootrom, which does not support any CPort features (unlike later boot stages). Add a BOOTROM infix to the defines to make this more clear. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: clean up and rename init-status helperJohan Hovold2016-03-301-19/+23
| | | | | | | Clean up and rename the interface-init-status helper. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: fix es2 boot-status maskJohan Hovold2016-03-301-1/+1
| | | | | | | The ES2 boot status is stored in the least significant byte. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: move boot-status clearing to interface enableJohan Hovold2016-03-301-0/+69
| | | | | | | | | | | Reading and clearing the boot status of an interface is an interface operation and belongs in the interface code. As part of the reworked interface boot sequence, we also want to do this when enabling (enumerating) a Greybus interface. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: separate disabling from removalJohan Hovold2016-03-101-30/+32
| | | | | | | | | | | | | | | Separate interface disable from interface removal. Disabling an interface means tearing down its control connection and destroying (i.e. deregistering and releasing) its bundles, while removing it means deregistering and releasing the interface itself. This is needed to implement controlled module removal, where the module interfaces are disabled before being physically ejected. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: rename initialisation functionJohan Hovold2016-03-101-2/+2
| | | | | | | | | | Rename the interface-initialisation function gb_interface_enable(), which is more descriptive. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: move interface-removal helperJohan Hovold2016-03-101-8/+0
| | | | | | | | | | | Move helper to remove all interfaces of a host-device to the svc code and call it when removing the svc device as this needs to be coordinated with flushing the SVC work queue. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: remove useless spinlockJohan Hovold2016-03-101-7/+3
| | | | | | | | | | | | Remove useless global interface spinlock that appeared to protect the host-device interface list, but really did not as we are doing lock-less look-ups by relying on the single-threaded SVC workqueue. Document the locking assumptions. 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>
* greybus: interface: disable control connection on initialisation errorsJohan Hovold2016-03-101-4/+11
| | | | | | | | | | | Disable the control connection immediately on any errors during interface initialisation as there's no need to keep it around for an interface in an error state. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: free bundles on initialisation errorsJohan Hovold2016-03-101-5/+13
| | | | | | | | | | Immediately free any created bundle structures on interface initialisation errors. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: separate initialisation and registrationJohan Hovold2016-03-101-14/+17
| | | | | | | | | | | | | Separate interface initialisation from registration of the interface and its bundles. This is a step towards registering also interfaces that failed to initialise (e.g. a dummy interface). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: refactor interface-route creationJohan Hovold2016-03-101-3/+1
| | | | | | | | | | Add interface-route-create helper to allocate an interface device id and setup the route. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: add comment about early control-connection disableJohan Hovold2016-03-101-0/+4
| | | | | | | | | | Add comment about why the control connection is disabled early when the interface is already gone. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: expose full 32 bits of vid/pid to userspaceGreg Kroah-Hartman2016-02-261-23/+2
| | | | | | | Now that userspace is ready for all 32 bits of the vid/pid, take off our mask and send the full values. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: interface: Add print messages on interface initialization/removalViresh Kumar2016-02-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It might be of interest (to developers at least) to know when an interface is getting created or removed from the system. Interface creation message can further contain basic information about the interface, like its vid/pid and mfg/prod ids. Now, the interface is created by gb_interface_create(), which doesn't register the intf->dev to the kernel and so the print message is rather added to gb_interface_init() where we register the device with the kernel. A similar message is added to gb_interface_remove() only when the interface was earlier initialized. And this is how the output looks on real insertion/removal of the module: greybus 1-1: Interface added: VID=0x00000001, PID=0x00000001 greybus 1-1: DDBL1 Manufacturer=0x00000001, Product=0x00000001 ... greybus 1-1: Interface removed 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>
* greybus: interface: clear upper 16-bits of version_id and product_idMichael Scott2016-02-101-2/+23
| | | | | | | | | | | | | | | Current userspace looks through the sysfs interface entries for matching vendor_id and product_id any time an interface is opened by module developers. The upper 16-bits of ES3 vendor_id and product_id contain a reverse mask of the lower 16-bits. This additional information is never used and should be removed so that every consumer of these sysfs entries doesn't have to perform the same bit clearing logic. Signed-off-by: Michael Scott <michael.scott@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
OpenPOWER on IntegriCloud