Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa2a5459 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: hd: rename CPort-features callbacks



Rename the CPort-features callbacks, that are not just used to enable
FCT flow, to the more descriptive cport_features_enable/disable.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 64a6d138
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -290,17 +290,18 @@ static void gb_connection_hd_cport_disable(struct gb_connection *connection)
	hd->driver->cport_disable(hd, connection->hd_cport_id);
}

static int gb_connection_hd_fct_flow_enable(struct gb_connection *connection)
static int
gb_connection_hd_cport_features_enable(struct gb_connection *connection)
{
	struct gb_host_device *hd = connection->hd;
	int ret;

	if (!hd->driver->fct_flow_enable)
	if (!hd->driver->cport_features_enable)
		return 0;

	ret = hd->driver->fct_flow_enable(hd, connection->hd_cport_id);
	ret = hd->driver->cport_features_enable(hd, connection->hd_cport_id);
	if (ret) {
		dev_err(&hd->dev, "%s: failed to enable FCT flow: %d\n",
		dev_err(&hd->dev, "%s: failed to enable CPort features: %d\n",
			connection->name, ret);
		return ret;
	}
@@ -308,14 +309,15 @@ static int gb_connection_hd_fct_flow_enable(struct gb_connection *connection)
	return 0;
}

static void gb_connection_hd_fct_flow_disable(struct gb_connection *connection)
static void
gb_connection_hd_cport_features_disable(struct gb_connection *connection)
{
	struct gb_host_device *hd = connection->hd;

	if (!hd->driver->fct_flow_disable)
	if (!hd->driver->cport_features_disable)
		return;

	hd->driver->fct_flow_disable(hd, connection->hd_cport_id);
	hd->driver->cport_features_disable(hd, connection->hd_cport_id);
}

/*
@@ -331,7 +333,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
	int ret;

	if (gb_connection_is_static(connection))
		return gb_connection_hd_fct_flow_enable(connection);
		return gb_connection_hd_cport_features_enable(connection);

	intf = connection->intf;

@@ -357,7 +359,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
		return ret;
	}

	ret = gb_connection_hd_fct_flow_enable(connection);
	ret = gb_connection_hd_cport_features_enable(connection);
	if (ret) {
		gb_svc_connection_destroy(hd->svc, hd->svc->ap_intf_id,
					  connection->hd_cport_id,
@@ -372,7 +374,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
static void
gb_connection_svc_connection_destroy(struct gb_connection *connection)
{
	gb_connection_hd_fct_flow_disable(connection);
	gb_connection_hd_cport_features_disable(connection);

	if (gb_connection_is_static(connection))
		return;
+8 −8
Original line number Diff line number Diff line
@@ -574,37 +574,37 @@ static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id)
	return retval;
}

static int fct_flow_enable(struct gb_host_device *hd, u16 cport_id)
static int cport_features_enable(struct gb_host_device *hd, u16 cport_id)
{
	int retval;
	struct es2_ap_dev *es2 = hd_to_es2(hd);
	struct usb_device *udev = es2->usb_dev;

	retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
				 GB_APB_REQUEST_FCT_FLOW_EN,
				 GB_APB_REQUEST_CPORT_FEAT_EN,
				 USB_DIR_OUT | USB_TYPE_VENDOR |
				 USB_RECIP_INTERFACE, cport_id, 0, NULL,
				 0, ES2_TIMEOUT);
	if (retval < 0)
		dev_err(&udev->dev, "Cannot enable FCT flow for cport %u: %d\n",
		dev_err(&udev->dev, "Cannot enable CPort features for cport %u: %d\n",
			cport_id, retval);
	return retval;
}

static int fct_flow_disable(struct gb_host_device *hd, u16 cport_id)
static int cport_features_disable(struct gb_host_device *hd, u16 cport_id)
{
	int retval;
	struct es2_ap_dev *es2 = hd_to_es2(hd);
	struct usb_device *udev = es2->usb_dev;

	retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
				 GB_APB_REQUEST_FCT_FLOW_DIS,
				 GB_APB_REQUEST_CPORT_FEAT_DIS,
				 USB_DIR_OUT | USB_TYPE_VENDOR |
				 USB_RECIP_INTERFACE, cport_id, 0, NULL,
				 0, ES2_TIMEOUT);
	if (retval < 0)
		dev_err(&udev->dev,
			"Cannot disable FCT flow for cport %u: %d\n",
			"Cannot disable CPort features for cport %u: %d\n",
			cport_id, retval);
	return retval;
}
@@ -617,8 +617,8 @@ static struct gb_hd_driver es2_driver = {
	.latency_tag_enable	= latency_tag_enable,
	.latency_tag_disable	= latency_tag_disable,
	.output			= output,
	.fct_flow_enable	= fct_flow_enable,
	.fct_flow_disable	= fct_flow_disable,
	.cport_features_enable	= cport_features_enable,
	.cport_features_disable	= cport_features_disable,
};

/* Common function to report consistent warnings based on URB status */
+3 −3
Original line number Diff line number Diff line
@@ -212,9 +212,9 @@ struct gb_control_timesync_authoritative_request {
/* request to control the CSI transmitter */
#define GB_APB_REQUEST_AUDIO_CONTROL	0x09

/* vendor requests to enable/disable FCT tokens flow */
#define GB_APB_REQUEST_FCT_FLOW_EN	0x0b
#define GB_APB_REQUEST_FCT_FLOW_DIS	0x0c
/* vendor requests to enable/disable CPort features */
#define GB_APB_REQUEST_CPORT_FEAT_EN	0x0b
#define GB_APB_REQUEST_CPORT_FEAT_DIS	0x0c

/* Firmware Protocol */

+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ struct gb_hd_driver {
	int (*latency_tag_disable)(struct gb_host_device *hd, u16 cport_id);
	int (*output)(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
		      bool async);
	int (*fct_flow_enable)(struct gb_host_device *hd, u16 cport_id);
	int (*fct_flow_disable)(struct gb_host_device *hd, u16 cport_id);
	int (*cport_features_enable)(struct gb_host_device *hd, u16 cport_id);
	int (*cport_features_disable)(struct gb_host_device *hd, u16 cport_id);
};

struct gb_host_device {