From patchwork Fri Sep 1 21:48:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9935345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85B266038C for ; Fri, 1 Sep 2017 21:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A2EA28458 for ; Fri, 1 Sep 2017 21:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F2C628462; Fri, 1 Sep 2017 21:51:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 345FB28458 for ; Fri, 1 Sep 2017 21:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbdIAVtG (ORCPT ); Fri, 1 Sep 2017 17:49:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbdIAVtF (ORCPT ); Fri, 1 Sep 2017 17:49:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C239F7E44E; Fri, 1 Sep 2017 21:49:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C239F7E44E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Received: from dhcp-45-79.space.revspace.nl.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 274FA6046B; Fri, 1 Sep 2017 21:49:00 +0000 (UTC) From: Hans de Goede To: MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Peter Rosin , Mathias Nyman Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Sathyanarayanan Kuppuswamy Natarajan , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 03/11] mux: consumer.h: Add MUX_USB_* state constant defines Date: Fri, 1 Sep 2017 23:48:37 +0200 Message-Id: <20170901214845.7153-4-hdegoede@redhat.com> In-Reply-To: <20170901214845.7153-1-hdegoede@redhat.com> References: <20170901214845.7153-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Sep 2017 21:49:05 +0000 (UTC) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add MUX_USB_* state constant defines, which can be used by USB device/host and Type-C polarity/role/altmode mux drivers and consumers to ensure that they agree on the meaning of the mux_control_select() state argument. Signed-off-by: Hans de Goede --- include/linux/mux/consumer.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h index 912dd48a3a5d..e3ec9b4db962 100644 --- a/include/linux/mux/consumer.h +++ b/include/linux/mux/consumer.h @@ -15,6 +15,22 @@ #include +/* + * Mux state values for USB muxes, used for both USB device/host role muxes + * as well as for Type-C polarity/role/altmode muxes. + * + * MUX_USB_POLARITY_INV may be or-ed together with any other mux-state as + * inverted-polarity (Type-C plugged in upside down) can happen with any + * other mux-state. + */ +#define MUX_USB_POLARITY_INV BIT(0) /* Polarity inverted bit */ +#define MUX_USB_NONE (1 << 1) /* Mux open / not connected */ +#define MUX_USB_DEVICE (2 << 1) /* USB device mode */ +#define MUX_USB_HOST (3 << 1) /* USB host mode */ +#define MUX_USB_HOST_AND_DP_SRC (4 << 1) /* USB host + 2 lanes Display Port */ +#define MUX_USB_DP_SRC (5 << 1) /* 4 lanes Display Port source */ +#define MUX_USB_STATES (6 << 1) + struct device; struct mux_control;