Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606AbdIBKKp (ORCPT ); Sat, 2 Sep 2017 06:10:45 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:36815 "EHLO mail-qt0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752243AbdIBKKn (ORCPT ); Sat, 2 Sep 2017 06:10:43 -0400 X-Google-Smtp-Source: ADKCNb6UmWun28C0eIIo6zXITWAE8TKRPRmRPoqWj2Uhiss7djEztMWjm9utakBVnraqGQ+3A8a4YNBXFVIvZ1DQIr4= MIME-Version: 1.0 In-Reply-To: <20170901214845.7153-4-hdegoede@redhat.com> References: <20170901214845.7153-1-hdegoede@redhat.com> <20170901214845.7153-4-hdegoede@redhat.com> From: Andy Shevchenko Date: Sat, 2 Sep 2017 13:10:42 +0300 Message-ID: Subject: Re: [PATCH 03/11] mux: consumer.h: Add MUX_USB_* state constant defines To: Hans de Goede Cc: MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Peter Rosin , Mathias Nyman , Platform Driver , devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Sathyanarayanan Kuppuswamy Natarajan , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , USB Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 31 On Sat, Sep 2, 2017 at 12:48 AM, 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. > +/* > + * 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) I would put OR'ed bits higher. Like allocate 4 (8) bits for states and start special flagst from bit 8 and so on. -- With Best Regards, Andy Shevchenko