aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorGravatar Alexandre Bailon <abailon@baylibre.com> 2015-09-04 16:55:40 +0200
committerGravatar Greg Kroah-Hartman <gregkh@google.com> 2015-09-04 14:49:09 -0700
commit8afd831ea00822fdc811ff640ef62352619d64c0 (patch)
tree30436645f24303a6d7806b13214f508ab76022c6 /drivers/staging/greybus/connection.c
parentgreybus: spi: Allow spi-core to allocate bus numbers dynamically (diff)
downloadlinux-8afd831ea00822fdc811ff640ef62352619d64c0.tar.gz
linux-8afd831ea00822fdc811ff640ef62352619d64c0.tar.bz2
linux-8afd831ea00822fdc811ff640ef62352619d64c0.zip
greybus: Greybus driver: add a new callbacks to driver
Add connection_create and connection_destroy callbacks. ES2 can map a cport to a pair of endpoints. Because ES2 have only a few pair of endpoints, ES2 need to have access to some high level connection information such as protocol id to effectively map the cports. These callback will provide these information and help ES2 to map cports. Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 466ea36da0aa..c25e5705f865 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -262,6 +262,8 @@ gb_connection_create_range(struct greybus_host_device *hd,
gb_svc_connection_create(hd->svc,
hd->endo->ap_intf_id, hd_cport_id,
bundle->intf->interface_id, cport_id);
+ if (hd->driver->connection_create)
+ hd->driver->connection_create(connection);
}
gb_connection_bind_protocol(connection);
@@ -430,6 +432,9 @@ void gb_connection_destroy(struct gb_connection *connection)
list_del(&connection->hd_links);
spin_unlock_irq(&gb_connections_lock);
+ if (connection->hd->driver->connection_destroy)
+ connection->hd->driver->connection_destroy(connection);
+
if (connection->protocol)
gb_protocol_put(connection->protocol);
connection->protocol = NULL;