misc: mic: Add support for kernel mode SCIF clients

Add support for registration/de-registration of kernel mode SCIF
clients. SCIF clients are probed with new and existing SCIF peer
devices. Similarly the client remove method is called when SCIF
peer devices are removed.

Changes to SCIF peer device framework necessitated by supporting
kernel mode SCIF clients are also included in this patch.

Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ashutosh Dixit
2015-09-29 18:11:15 -07:00
committed by Greg Kroah-Hartman
parent b7f944411b
commit d3d912eb73
8 changed files with 257 additions and 223 deletions

View File

@@ -1430,3 +1430,46 @@ int scif_get_node_ids(u16 *nodes, int len, u16 *self)
return online;
}
EXPORT_SYMBOL_GPL(scif_get_node_ids);
static int scif_add_client_dev(struct device *dev, struct subsys_interface *si)
{
struct scif_client *client =
container_of(si, struct scif_client, si);
struct scif_peer_dev *spdev =
container_of(dev, struct scif_peer_dev, dev);
if (client->probe)
client->probe(spdev);
return 0;
}
static void scif_remove_client_dev(struct device *dev,
struct subsys_interface *si)
{
struct scif_client *client =
container_of(si, struct scif_client, si);
struct scif_peer_dev *spdev =
container_of(dev, struct scif_peer_dev, dev);
if (client->remove)
client->remove(spdev);
}
void scif_client_unregister(struct scif_client *client)
{
subsys_interface_unregister(&client->si);
}
EXPORT_SYMBOL_GPL(scif_client_unregister);
int scif_client_register(struct scif_client *client)
{
struct subsys_interface *si = &client->si;
si->name = client->name;
si->subsys = &scif_peer_bus;
si->add_dev = scif_add_client_dev;
si->remove_dev = scif_remove_client_dev;
return subsys_interface_register(&client->si);
}
EXPORT_SYMBOL_GPL(scif_client_register);