{
struct gb_svc *svc = connection->hd->svc;
struct gb_camera *gcam;
+ u8 cport_flags;
int ret;
gcam = kzalloc(sizeof(*gcam), GFP_KERNEL);
* Create the data connection between camera module CDSI0 and APB CDS1.
* The CPort IDs are hardcoded by the ES2 bridges.
*/
+ /* FIXME: remove E2EFC */
+ cport_flags = GB_SVC_CPORT_FLAG_E2EFC | GB_SVC_CPORT_FLAG_CSD_N |
+ GB_SVC_CPORT_FLAG_CSV_N;
ret = gb_svc_connection_create(svc, connection->intf->interface_id,
ES2_APB_CDSI0_CPORT, svc->ap_intf_id,
- ES2_APB_CDSI1_CPORT, false);
+ ES2_APB_CDSI1_CPORT, cport_flags);
if (ret < 0)
goto error;
{
struct gb_host_device *hd = connection->hd;
struct gb_interface *intf;
+ u8 cport_flags;
int ret;
if (gb_connection_is_static(connection))
return gb_connection_hd_fct_flow_enable(connection);
intf = connection->intf;
+
+ /* The ES2/ES3 bootrom requires E2EFC, CSD and CSV to be disabled. */
+ cport_flags = GB_SVC_CPORT_FLAG_CSV_N;
+ if (intf->boot_over_unipro) {
+ cport_flags |= GB_SVC_CPORT_FLAG_CSD_N;
+ } else {
+ cport_flags |= GB_SVC_CPORT_FLAG_CSD_N |
+ GB_SVC_CPORT_FLAG_E2EFC;
+ }
+
ret = gb_svc_connection_create(hd->svc,
hd->svc->ap_intf_id,
connection->hd_cport_id,
intf->interface_id,
connection->intf_cport_id,
- intf->boot_over_unipro);
+ cport_flags);
if (ret) {
dev_err(&connection->hd->dev,
"%s: failed to create svc connection: %d\n",
#include "greybus.h"
-#define CPORT_FLAGS_E2EFC BIT(0)
-#define CPORT_FLAGS_CSD_N BIT(1)
-#define CPORT_FLAGS_CSV_N BIT(2)
-
#define SVC_KEY_ARA_BUTTON KEY_A
struct gb_svc_deferred_request {
int gb_svc_connection_create(struct gb_svc *svc,
u8 intf1_id, u16 cport1_id,
u8 intf2_id, u16 cport2_id,
- bool boot_over_unipro)
+ u8 cport_flags)
{
struct gb_svc_conn_create_request request;
request.intf2_id = intf2_id;
request.cport2_id = cpu_to_le16(cport2_id);
request.tc = 0; /* TC0 */
-
- /* The ES2/ES3 bootrom requires E2EFC, CSD and CSV to be disabled. */
- request.flags = CPORT_FLAGS_CSV_N;
- if (boot_over_unipro)
- request.flags |= CPORT_FLAGS_CSD_N;
- else
- request.flags |= CPORT_FLAGS_CSD_N | CPORT_FLAGS_E2EFC;
+ request.flags = cport_flags;
return gb_operation_sync(svc->connection, GB_SVC_TYPE_CONN_CREATE,
&request, sizeof(request), NULL, 0);
#ifndef __SVC_H
#define __SVC_H
+#define GB_SVC_CPORT_FLAG_E2EFC BIT(0)
+#define GB_SVC_CPORT_FLAG_CSD_N BIT(1)
+#define GB_SVC_CPORT_FLAG_CSV_N BIT(2)
+
enum gb_svc_state {
GB_SVC_STATE_RESET,
GB_SVC_STATE_PROTOCOL_VERSION,
int gb_svc_intf_reset(struct gb_svc *svc, u8 intf_id);
int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
- u8 intf2_id, u16 cport2_id, bool boot_over_unipro);
+ u8 intf2_id, u16 cport2_id, u8 cport_flags);
void gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
u8 intf2_id, u16 cport2_id);
int gb_svc_intf_eject(struct gb_svc *svc, u8 intf_id);