greybus: module: implement controlled module removal
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>