lkml.org 
[lkml]   [2017]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 03/11] mux: consumer.h: Add MUX_USB_* state constant defines
On Sat, Sep 2, 2017 at 12:48 AM, Hans de Goede <hdegoede@redhat.com> 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

\
 
 \ /
  Last update: 2017-09-02 12:11    [W:0.200 / U:4.032 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site