From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede 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> References: <20170901214845.7153-1-hdegoede@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170901214845.7153-1-hdegoede@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Peter Rosin , Mathias Nyman Cc: devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Sathyanarayanan Kuppuswamy Natarajan , Hans de Goede List-Id: platform-driver-x86.vger.kernel.org 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; -- 2.13.5