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

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

greybus: hd: rename host-device structure



Rename host-device structure gb_host_device to match our other
structures.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 7bc6faac
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ static DEFINE_SPINLOCK(gb_connections_lock);
static struct gb_connection *
gb_connection_intf_find(struct gb_interface *intf, u16 cport_id)
{
	struct greybus_host_device *hd = intf->hd;
	struct gb_host_device *hd = intf->hd;
	struct gb_connection *connection;

	list_for_each_entry(connection, &hd->connections, hd_links)
@@ -28,7 +28,7 @@ gb_connection_intf_find(struct gb_interface *intf, u16 cport_id)
}

static struct gb_connection *
gb_connection_hd_find(struct greybus_host_device *hd, u16 cport_id)
gb_connection_hd_find(struct gb_host_device *hd, u16 cport_id)
{
	struct gb_connection *connection;
	unsigned long flags;
@@ -48,7 +48,7 @@ gb_connection_hd_find(struct greybus_host_device *hd, u16 cport_id)
 * Callback from the host driver to let us know that data has been
 * received on the bundle.
 */
void greybus_data_rcvd(struct greybus_host_device *hd, u16 cport_id,
void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
			u8 *data, size_t length)
{
	struct gb_connection *connection;
@@ -105,7 +105,7 @@ int svc_update_connection(struct gb_interface *intf,
 * pointer otherwise.
 */
struct gb_connection *
gb_connection_create_range(struct greybus_host_device *hd,
gb_connection_create_range(struct gb_host_device *hd,
			   struct gb_bundle *bundle, struct device *parent,
			   u16 cport_id, u8 protocol_id, u32 ida_start,
			   u32 ida_end)
@@ -188,7 +188,7 @@ gb_connection_create_range(struct greybus_host_device *hd,

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

	if (!hd->driver->cport_enable)
@@ -206,7 +206,7 @@ static int gb_connection_hd_cport_enable(struct gb_connection *connection)

static void gb_connection_hd_cport_disable(struct gb_connection *connection)
{
	struct greybus_host_device *hd = connection->hd;
	struct gb_host_device *hd = connection->hd;

	if (!hd->driver->cport_disable)
		return;
@@ -258,7 +258,7 @@ static void gb_connection_cancel_operations(struct gb_connection *connection,
static int
gb_connection_svc_connection_create(struct gb_connection *connection)
{
	struct greybus_host_device *hd = connection->hd;
	struct gb_host_device *hd = connection->hd;
	struct gb_protocol *protocol = connection->protocol;
	struct gb_interface *intf;
	int ret;
@@ -459,7 +459,7 @@ void gb_connection_destroy(struct gb_connection *connection)

void gb_connection_latency_tag_enable(struct gb_connection *connection)
{
	struct greybus_host_device *hd = connection->hd;
	struct gb_host_device *hd = connection->hd;
	int ret;

	if (!hd->driver->latency_tag_enable)
@@ -475,7 +475,7 @@ EXPORT_SYMBOL_GPL(gb_connection_latency_tag_enable);

void gb_connection_latency_tag_disable(struct gb_connection *connection)
{
	struct greybus_host_device *hd = connection->hd;
	struct gb_host_device *hd = connection->hd;
	int ret;

	if (!hd->driver->latency_tag_disable)
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ enum gb_connection_state {
};

struct gb_connection {
	struct greybus_host_device	*hd;
	struct gb_host_device		*hd;
	struct gb_bundle		*bundle;
	struct kref			kref;
	u16				hd_cport_id;
@@ -53,13 +53,13 @@ int svc_update_connection(struct gb_interface *intf,
			  struct gb_connection *connection);
struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
				u16 cport_id, u8 protocol_id);
struct gb_connection *gb_connection_create_range(struct greybus_host_device *hd,
struct gb_connection *gb_connection_create_range(struct gb_host_device *hd,
			   struct gb_bundle *bundle, struct device *parent,
			   u16 cport_id, u8 protocol_id, u32 ida_start,
			   u32 ida_end);
void gb_connection_destroy(struct gb_connection *connection);

void greybus_data_rcvd(struct greybus_host_device *hd, u16 cport_id,
void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
			u8 *data, size_t length);

int gb_connection_bind_protocol(struct gb_connection *connection);
+6 −6
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static bool single_cross_rib(u8 left_ribs, u8 right_ribs)
 * - Bit 1: 2nd rib location from top, i.e. between interface 2 and 3.
 * - Bit 2: 3rd rib location from top, i.e. between interface 3 and 4.
 */
static bool validate_front_ribs(struct greybus_host_device *hd,
static bool validate_front_ribs(struct gb_host_device *hd,
				struct endo_layout *layout, bool mini,
				u16 endo_id)
{
@@ -254,7 +254,7 @@ static bool validate_front_ribs(struct greybus_host_device *hd,
 * its rotational orientation.  We define one canonical id to represent a
 * particular endo configuration.
 */
static bool validate_back_ribs(struct greybus_host_device *hd,
static bool validate_back_ribs(struct gb_host_device *hd,
			       struct endo_layout *layout, u16 endo_id)
{
	u8 max_ribs = layout->max_ribs;
@@ -320,7 +320,7 @@ static bool validate_back_ribs(struct greybus_host_device *hd,
 * Validate the endo-id passed from SVC. Error out if its not a valid Endo,
 * else return structure representing ribs positions on front and back of Endo.
 */
static int gb_endo_validate_id(struct greybus_host_device *hd,
static int gb_endo_validate_id(struct gb_host_device *hd,
			       struct endo_layout *layout, u16 endo_id)
{
	/* Validate Endo Size */
@@ -435,7 +435,7 @@ static int create_modules(struct gb_endo *endo)
	return 0;
}

static int gb_endo_register(struct greybus_host_device *hd,
static int gb_endo_register(struct gb_host_device *hd,
			    struct gb_endo *endo)
{
	int dev_id;
@@ -471,7 +471,7 @@ static int gb_endo_register(struct greybus_host_device *hd,
	return retval;
}

struct gb_endo *gb_endo_create(struct greybus_host_device *hd, u16 endo_id,
struct gb_endo *gb_endo_create(struct gb_host_device *hd, u16 endo_id,
				u8 ap_intf_id)
{
	struct gb_endo *endo;
@@ -524,7 +524,7 @@ void gb_endo_remove(struct gb_endo *endo)
	device_unregister(&endo->dev);
}

int greybus_endo_setup(struct greybus_host_device *hd, u16 endo_id,
int greybus_endo_setup(struct gb_host_device *hd, u16 endo_id,
		       u8 ap_intf_id)
{
	struct gb_endo *endo;
+3 −3
Original line number Diff line number Diff line
@@ -47,15 +47,15 @@ struct gb_endo {
#define to_gb_endo(d) container_of(d, struct gb_endo, dev)

/* Greybus "private" definitions */
struct greybus_host_device;
struct gb_host_device;

int gb_endo_init(void);
void gb_endo_exit(void);

struct gb_endo *gb_endo_create(struct greybus_host_device *hd,
struct gb_endo *gb_endo_create(struct gb_host_device *hd,
				u16 endo_id, u8 ap_intf_id);
void gb_endo_remove(struct gb_endo *endo);
int greybus_endo_setup(struct greybus_host_device *hd, u16 endo_id,
int greybus_endo_setup(struct gb_host_device *hd, u16 endo_id,
		       u8 ap_intf_id);

u8 endo_get_module_id(struct gb_endo *endo, u8 interface_id);
+10 −10
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE);
 * es1_ap_dev - ES1 USB Bridge to AP structure
 * @usb_dev: pointer to the USB device we are.
 * @usb_intf: pointer to the USB interface we are bound to.
 * @hd: pointer to our greybus_host_device structure
 * @hd: pointer to our gb_host_device structure
 * @cport_in_endpoint: bulk in endpoint for CPort data
 * @cport-out_endpoint: bulk out endpoint for CPort data
 * @cport_in_urb: array of urbs for the CPort in messages
@@ -75,7 +75,7 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE);
struct es1_ap_dev {
	struct usb_device *usb_dev;
	struct usb_interface *usb_intf;
	struct greybus_host_device *hd;
	struct gb_host_device *hd;

	__u8 cport_in_endpoint;
	__u8 cport_out_endpoint;
@@ -88,7 +88,7 @@ struct es1_ap_dev {
	spinlock_t cport_out_urb_lock;
};

static inline struct es1_ap_dev *hd_to_es1(struct greybus_host_device *hd)
static inline struct es1_ap_dev *hd_to_es1(struct gb_host_device *hd)
{
	return (struct es1_ap_dev *)&hd->hd_priv;
}
@@ -181,7 +181,7 @@ static u16 gb_message_cport_unpack(struct gb_operation_msg_hdr *header)
 * Returns zero if the message was successfully queued, or a negative errno
 * otherwise.
 */
static int message_send(struct greybus_host_device *hd, u16 cport_id,
static int message_send(struct gb_host_device *hd, u16 cport_id,
			struct gb_message *message, gfp_t gfp_mask)
{
	struct es1_ap_dev *es1 = hd_to_es1(hd);
@@ -244,7 +244,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
 */
static void message_cancel(struct gb_message *message)
{
	struct greybus_host_device *hd = message->operation->connection->hd;
	struct gb_host_device *hd = message->operation->connection->hd;
	struct es1_ap_dev *es1 = hd_to_es1(hd);
	struct urb *urb;
	int i;
@@ -277,7 +277,7 @@ static void message_cancel(struct gb_message *message)
	usb_free_urb(urb);
}

static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id)
static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id)
{
	int retval;
	struct es1_ap_dev *es1 = hd_to_es1(hd);
@@ -301,7 +301,7 @@ static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id)
	return retval;
}

static int latency_tag_disable(struct greybus_host_device *hd, u16 cport_id)
static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id)
{
	int retval;
	struct es1_ap_dev *es1 = hd_to_es1(hd);
@@ -403,7 +403,7 @@ static void ap_disconnect(struct usb_interface *interface)

static void cport_in_callback(struct urb *urb)
{
	struct greybus_host_device *hd = urb->context;
	struct gb_host_device *hd = urb->context;
	struct device *dev = &urb->dev->dev;
	struct gb_operation_msg_hdr *header;
	int status = check_urb_status(urb);
@@ -443,7 +443,7 @@ static void cport_in_callback(struct urb *urb)
static void cport_out_callback(struct urb *urb)
{
	struct gb_message *message = urb->context;
	struct greybus_host_device *hd = message->operation->connection->hd;
	struct gb_host_device *hd = message->operation->connection->hd;
	struct es1_ap_dev *es1 = hd_to_es1(hd);
	int status = check_urb_status(urb);
	unsigned long flags;
@@ -599,7 +599,7 @@ static int ap_probe(struct usb_interface *interface,
		    const struct usb_device_id *id)
{
	struct es1_ap_dev *es1;
	struct greybus_host_device *hd;
	struct gb_host_device *hd;
	struct usb_device *udev;
	struct usb_host_interface *iface_desc;
	struct usb_endpoint_descriptor *endpoint;
Loading