Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752714AbdIBPAD (ORCPT ); Sat, 2 Sep 2017 11:00:03 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33461 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbdIBPAB (ORCPT ); Sat, 2 Sep 2017 11:00:01 -0400 X-Google-Smtp-Source: ADKCNb5QzWTI1so9M/FpjKYDLi/IXfO/MlcfhQ+FYEjJRRGwFcFG9Xa0ZiSM/zpknXuSw7ISRdmKfg== Subject: Re: [PATCH 03/11] mux: consumer.h: Add MUX_USB_* state constant defines To: Hans de Goede , MyungJoo Ham , Chanwoo Choi , Heikki Krogerus , Darren Hart , Andy Shevchenko , Peter Rosin , Mathias Nyman Cc: 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 References: <20170901214845.7153-1-hdegoede@redhat.com> <20170901214845.7153-4-hdegoede@redhat.com> From: Guenter Roeck Message-ID: <8a05c405-3649-ac99-d4ca-3e519e1c63a8@roeck-us.net> Date: Sat, 2 Sep 2017 07:59:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170901214845.7153-4-hdegoede@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1552 Lines: 46 On 09/01/2017 02:48 PM, Hans de Goede wrote: > 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 */ Why BIT(0) but (1 << 1) and so on ? Guenter > +#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; > >