Commit 7d7acc06 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: interface: add ES2 init-status quirk flag



Add ES2 init-status quirk flag instead of checking MID/PID directly.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 153ff7e7
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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;