android_kernel_xiaomi_sm8350/drivers/staging/greybus/interface.h
Viresh Kumar cdee4f7505 greybus: Add control protocol support
Add control protocol driver that is responsible for handling operations
on control CPort. The AP also needs to support incoming requests on its
control port. Features not implemented yet are marked as TODO for now.

NOTE: This also fixes cport-bundle-id to 0 and cport-id to 2 for control
protocol.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-23 23:16:15 -07:00

58 lines
1.4 KiB
C

/*
* Greybus Interface Block code
*
* Copyright 2014 Google Inc.
* Copyright 2014 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#ifndef __INTERFACE_H
#define __INTERFACE_H
/* Greybus "public" definitions" */
struct gb_interface {
struct device dev;
struct gb_control *control;
struct list_head bundles;
struct list_head links; /* greybus_host_device->interfaces */
struct list_head manifest_descs;
u8 interface_id; /* Physical location within the Endo */
/* Information taken from the manifest descriptor */
u16 vendor;
u16 product;
char *vendor_string;
char *product_string;
u64 unique_id;
struct gb_module *module;
struct greybus_host_device *hd;
};
#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
static inline void gb_interface_set_drvdata(struct gb_interface *intf,
void *data)
{
dev_set_drvdata(&intf->dev, data);
}
static inline void *gb_interface_get_drvdata(struct gb_interface *intf)
{
return dev_get_drvdata(&intf->dev);
}
/* Greybus "private" definitions */
struct gb_interface *gb_interface_find(struct greybus_host_device *hd,
u8 interface_id);
void gb_interface_add(struct greybus_host_device *hd, u8 interface_id, u8 *data,
int size);
void gb_interface_remove(struct greybus_host_device *hd, u8 interface_id);
void gb_interfaces_remove(struct greybus_host_device *hd);
#endif /* __INTERFACE_H */