X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fstaging%2Fgreybus%2Finterface.h;h=05a3909b475f8ac36a90114f5b39e36f7b472cd1;hb=1bb61840c4db64e27f0077dcfc5389e662022d40;hp=52adc83dd19fe2d50bdc819cdef9b58ab54e6f39;hpb=4ab9b3c24b009fdc55465977153c5deffd31b0c0;p=cascardo%2Flinux.git diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index 52adc83dd19f..05a3909b475f 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -10,48 +10,66 @@ #ifndef __INTERFACE_H #define __INTERFACE_H -/* Increase these values if needed */ -#define MAX_CPORTS_PER_MODULE 10 -#define MAX_STRINGS_PER_MODULE 10 +#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0) +#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1) +#define GB_INTERFACE_QUIRK_NO_ARA_IDS BIT(2) +#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3) +#define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4) - -/* Greybus "public" definitions" */ struct gb_interface { struct device dev; + struct gb_control *control; struct list_head bundles; - struct list_head links; /* greybus_host_device->modules */ - u8 module_id; /* Physical location within the Endo */ + struct list_head module_node; + struct list_head manifest_descs; + u8 interface_id; /* Physical location within the Endo */ + u8 device_id; + u8 features; /* Feature flags set in the manifest */ + u8 type; - /* Information taken from the manifest module descriptor */ - u16 vendor; - u16 product; - char *vendor_string; - char *product_string; - u64 unique_id; + u32 ddbl1_manufacturer_id; + u32 ddbl1_product_id; + u32 vendor_id; + u32 product_id; + u64 serial_number; - struct greybus_host_device *hd; -}; -#define to_gb_interface(d) container_of(d, struct gb_interface, dev) + struct gb_host_device *hd; + struct gb_module *module; + + unsigned long quirks; -static inline void gb_interface_set_drvdata(struct gb_interface *intf, - void *data) -{ - dev_set_drvdata(&intf->dev, data); -} + struct mutex mutex; -static inline void * gb_interface__get_drvdata(struct gb_interface *intf) -{ - return dev_get_drvdata(&intf->dev); -} + bool disconnected; -/* Greybus "private" definitions */ + bool ejected; + bool active; + bool enabled; + bool mode_switch; + + struct work_struct mode_switch_work; + struct completion mode_switch_completion; +}; +#define to_gb_interface(d) container_of(d, struct gb_interface, dev) -const struct greybus_interface_block_id * - gb_interface_match_id(struct gb_interface *intf, - const struct greybus_interface_block_id *id); +struct gb_interface *gb_interface_create(struct gb_module *module, + u8 interface_id); +int gb_interface_activate(struct gb_interface *intf); +void gb_interface_deactivate(struct gb_interface *intf); +int gb_interface_enable(struct gb_interface *intf); +void gb_interface_disable(struct gb_interface *intf); +int gb_interface_timesync_enable(struct gb_interface *intf, u8 count, + u64 frame_time, u32 strobe_delay, u32 refclk); +int gb_interface_timesync_authoritative(struct gb_interface *intf, + u64 *frame_time); +int gb_interface_timesync_disable(struct gb_interface *intf); +int gb_interface_add(struct gb_interface *intf); +void gb_interface_del(struct gb_interface *intf); +void gb_interface_put(struct gb_interface *intf); +void gb_interface_mailbox_event(struct gb_interface *intf, u16 result, + u32 mailbox); -struct gb_interface *gb_interface_find(struct greybus_host_device *hd, - u8 module_id); +int gb_interface_request_mode_switch(struct gb_interface *intf); #endif /* __INTERFACE_H */