]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/greybus/connection.c
greybus: Merge branch 'master' into branch 'svc'.
[karo-tx-linux.git] / drivers / staging / greybus / connection.c
index 88383b6e603f5183b3df680cffcb92134be80f56..ef837c50fcfbfbc9e72e0f371f18b9055c16eb3c 100644 (file)
@@ -251,7 +251,12 @@ gb_connection_create_range(struct greybus_host_device *hd,
 
        spin_unlock_irq(&gb_connections_lock);
 
-       /* XXX Will have to establish connections to get version */
+       if (hd_cport_id != GB_SVC_CPORT_ID) {
+               gb_svc_connection_create(hd->svc,
+                                        hd->endo->ap_intf_id, hd_cport_id,
+                                        bundle->intf->interface_id, cport_id);
+       }
+
        gb_connection_bind_protocol(connection);
        if (!connection->protocol)
                dev_warn(&connection->dev,
@@ -340,7 +345,8 @@ static void gb_connection_disconnected(struct gb_connection *connection)
         * Inform Interface about In-active CPorts. We don't need to do this
         * operation for control cport.
         */
-       if (cport_id == GB_CONTROL_CPORT_ID)
+       if ((cport_id == GB_CONTROL_CPORT_ID) ||
+           (connection->hd_cport_id == GB_SVC_CPORT_ID))
                return;
 
        control = connection->bundle->intf->control;
@@ -365,7 +371,8 @@ int gb_connection_init(struct gb_connection *connection)
         * Inform Interface about Active CPorts. We don't need to do this
         * operation for control cport.
         */
-       if (cport_id != GB_CONTROL_CPORT_ID) {
+       if (cport_id != GB_CONTROL_CPORT_ID &&
+           connection->hd_cport_id != GB_SVC_CPORT_ID) {
                struct gb_control *control = connection->bundle->intf->control;
 
                ret = gb_control_connected_operation(control, cport_id);