From: Johan Hovold Date: Tue, 29 Mar 2016 22:56:09 +0000 (-0400) Subject: greybus: interface: add ES2 init-status quirk flag X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d7acc06a0febf9f08649df52aa267b8f74b0de9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: interface: add ES2 init-status quirk flag Add ES2 init-status quirk flag instead of checking MID/PID directly. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c index c7793a93c802..767bf87b2dbd 100644 --- a/drivers/staging/greybus/interface.c +++ b/drivers/staging/greybus/interface.c @@ -78,6 +78,11 @@ static int gb_interface_read_dme(struct gb_interface *intf) if (ret) return ret; + if (intf->ddbl1_manufacturer_id == TOSHIBA_DMID && + intf->ddbl1_product_id == TOSHIBA_ES2_BRIDGE_DPID) { + intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS; + } + return gb_interface_read_ara_dme(intf); } @@ -155,17 +160,13 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) u32 value; u16 attr; u8 init_status; - bool es2_bridge; - - es2_bridge = intf->ddbl1_manufacturer_id == ES2_DDBL1_MFR_ID && - intf->ddbl1_product_id == ES2_DDBL1_PROD_ID; /* * ES2 bridges use T_TstSrcIncrement for the init status. * * FIXME: Remove ES2 support */ - if (es2_bridge) + if (intf->quirks & GB_INTERFACE_QUIRK_NO_INIT_STATUS) attr = DME_ATTR_T_TST_SRC_INCREMENT; else attr = DME_ATTR_ES3_INIT_STATUS; @@ -192,7 +193,7 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) * * FIXME: Remove ES2 support */ - if (es2_bridge) + if (intf->quirks & GB_INTERFACE_QUIRK_NO_INIT_STATUS) init_status = value & 0xff; else init_status = value >> 24; diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index 1a6ce5ce6e6c..94eb36e36975 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -12,6 +12,7 @@ #define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0) #define GB_INTERFACE_QUIRK_NO_INTERFACE_VERSION BIT(1) +#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(2) struct gb_interface { struct device dev;