static const char *gb_interface_type_string(struct gb_interface *intf)
{
static const char * const types[] = {
- [GB_SVC_INTF_TYPE_UNKNOWN] = "unknown",
- [GB_SVC_INTF_TYPE_DUMMY] = "dummy",
- [GB_SVC_INTF_TYPE_UNIPRO] = "unipro",
- [GB_SVC_INTF_TYPE_GREYBUS] = "greybus",
+ [GB_INTERFACE_TYPE_INVALID] = "invalid",
+ [GB_INTERFACE_TYPE_UNKNOWN] = "unknown",
+ [GB_INTERFACE_TYPE_DUMMY] = "dummy",
+ [GB_INTERFACE_TYPE_UNIPRO] = "unipro",
+ [GB_INTERFACE_TYPE_GREYBUS] = "greybus",
};
return types[intf->type];
struct gb_interface *intf = to_gb_interface(dev);
switch (intf->type) {
- case GB_SVC_INTF_TYPE_UNIPRO:
- case GB_SVC_INTF_TYPE_GREYBUS:
+ case GB_INTERFACE_TYPE_UNIPRO:
+ case GB_INTERFACE_TYPE_GREYBUS:
return attr->mode;
default:
return 0;
struct gb_interface *intf = to_gb_interface(dev);
switch (intf->type) {
- case GB_SVC_INTF_TYPE_GREYBUS:
+ case GB_INTERFACE_TYPE_GREYBUS:
return attr->mode;
default:
return 0;
struct gb_interface *intf = to_gb_interface(dev);
switch (intf->type) {
- case GB_SVC_INTF_TYPE_UNIPRO:
- case GB_SVC_INTF_TYPE_GREYBUS:
+ case GB_INTERFACE_TYPE_UNIPRO:
+ case GB_INTERFACE_TYPE_GREYBUS:
return attr->mode;
default:
return 0;
return ret;
}
- intf->type = type;
-
switch (type) {
case GB_SVC_INTF_TYPE_DUMMY:
+ intf->type = GB_INTERFACE_TYPE_DUMMY;
/* FIXME: handle as an error for now */
return -ENODEV;
case GB_SVC_INTF_TYPE_UNIPRO:
+ intf->type = GB_INTERFACE_TYPE_UNIPRO;
dev_err(&intf->dev, "interface type UniPro not supported\n");
/* FIXME: check if this is a Toshiba bridge before retrying? */
return -EAGAIN;
case GB_SVC_INTF_TYPE_GREYBUS:
+ intf->type = GB_INTERFACE_TYPE_GREYBUS;
break;
default:
dev_err(&intf->dev, "unknown interface type: %u\n", type);
- intf->type = GB_SVC_INTF_TYPE_UNKNOWN;
+ intf->type = GB_INTERFACE_TYPE_UNKNOWN;
return -ENODEV;
}
gb_interface_type_string(intf));
switch (intf->type) {
- case GB_SVC_INTF_TYPE_GREYBUS:
+ case GB_INTERFACE_TYPE_GREYBUS:
dev_info(&intf->dev, "Ara VID=0x%08x, PID=0x%08x\n",
intf->vendor_id, intf->product_id);
/* fall-through */
- case GB_SVC_INTF_TYPE_UNIPRO:
+ case GB_INTERFACE_TYPE_UNIPRO:
dev_info(&intf->dev, "DDBL1 Manufacturer=0x%08x, Product=0x%08x\n",
intf->ddbl1_manufacturer_id,
intf->ddbl1_product_id);
break;
+ default:
+ break;
}
return 0;
#ifndef __INTERFACE_H
#define __INTERFACE_H
+enum gb_interface_type {
+ GB_INTERFACE_TYPE_INVALID = 0,
+ GB_INTERFACE_TYPE_UNKNOWN,
+ GB_INTERFACE_TYPE_DUMMY,
+ GB_INTERFACE_TYPE_UNIPRO,
+ GB_INTERFACE_TYPE_GREYBUS,
+};
+
#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)
u8 interface_id; /* Physical location within the Endo */
u8 device_id;
u8 features; /* Feature flags set in the manifest */
- u8 type;
+
+ enum gb_interface_type type;
u32 ddbl1_manufacturer_id;
u32 ddbl1_product_id;