Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755836AbdIHPr2 (ORCPT ); Fri, 8 Sep 2017 11:47:28 -0400 Received: from mail-ve1eur01on0098.outbound.protection.outlook.com ([104.47.1.98]:18124 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750807AbdIHPrX (ORCPT ); Fri, 8 Sep 2017 11:47:23 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2 03/11] mux: core: Add usb.h header with MUX_USB_* and and MUX_TYPEC_* state constants To: Hans de Goede , MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Mathias Nyman Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Sathyanarayanan Kuppuswamy Natarajan , Greg Kroah-Hartman , linux-usb@vger.kernel.org References: <20170905164221.11266-1-hdegoede@redhat.com> <20170905164221.11266-4-hdegoede@redhat.com> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Fri, 8 Sep 2017 17:47:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170905164221.11266-4-hdegoede@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: HE1PR06CA0138.eurprd06.prod.outlook.com (2603:10a6:7:16::25) To DB6PR0202MB2550.eurprd02.prod.outlook.com (2603:10a6:4:1b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a2a7a96-1ac2-41ea-403c-08d4f6d0e2ca X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(2017082002075)(300000503095)(300135400095)(201703131423075)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DB6PR0202MB2550; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2550;3:NXA2PqpjOMEtAy1TntfY5f5UpyzBMJ+73RstBOnGznaRszmPNeZmkNnqSkyTzpiwqlIFxWikaMT64sBp6jwuT96YSiFteIeDWxwUEvmzc5xG7OXW8wJlWMvf1b90bQ/FtCfaNtxQh7y+jQwFiMc12N6lE+fooDgCG/V1Dfp30AcOkrPbQsuZfnVPmCcA/kVl3rLJMdphd3HENPDrVCq0h7C1eVGLy89TxvwL12zDy7LVuwaq42Nex4SHE672udCN;25:i4elJG1eGxuGRUN8CExy6QnSZFeZfTOb0lCXn+P+W45gyD8Hq4C01lMSBGElXGU43Kq4W5Mvd1rBhdJSc0wLGuSgcehznJ6blwAU4qpvAEBoW4ijFcCBklDqt2EHTuNjsATjLFpxG5o2MlI5x7ezFPqZJoMyW2j7QH5sfMx7aOvzgcxH8svkPof0d08W/baatmX8UbsO9lDt+MKP20qBB8M9FAOk4QCV17rN6J2JVICbME0faPT0WTUbSfaQmzj8vV1p4DxzPQUzFjBvNMJx200IVqVnReTXSEItonQYBwspoQRj3OXR0AKuBD6KHfhhj+qe7UfZloWZM3jOhTZjVQ==;31:2gb1TICmwFgzynS4tH1cvFus6PcbGaf7I3iiba08JzSojjMMeTW8wHsgBkLIi9AqV/JeIo7ssgvnkgoB06FVXFK+cPB6qAPBgF0Y5mtqe5hEuPcp13/hpVOw00lPIL5uqYgti0GvNcK95UOBhemxbGnWysoSzbPDKf8S6EmzL/KO2JNKcjO2Zvr6hbOfOj3VfcJKTN7bcZ1dV7rVmUHjlhiWR/jPnFf6uWne4FN+06g= X-MS-TrafficTypeDiagnostic: DB6PR0202MB2550: X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(2016111802025)(20161123562025)(201703131423075)(201703061421075)(6072148)(6043046)(6042181)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DB6PR0202MB2550;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DB6PR0202MB2550; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2550;4:KcrrMRKB6oeXGHpMPhD7XWknL42iqEYEc0WjgEVellvpfS/DSX0+B5Nn1VfFj8zm2aJIp30n1GkNnxRaqh7IyQVP/OUaib7CpM0cKnfM24604b6eOQn0I5YdpiSOeNkNJeT98iedI0UCabuoTgq5TFcu39pIf/4SDrrDqnwHkH9JFZugoE1FyZFtBCZB3P8jzvdkyFbq5egSpmtjs+Cg19gGJnBS5tKy9Wsgm4uVgnzcwkEreQSBAAIvysIwd/36 X-Forefront-PRVS: 04244E0DC5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6049001)(6009001)(24454002)(199003)(377424004)(189002)(7736002)(53546010)(3846002)(106356001)(83506001)(4001350100001)(105586002)(7350300001)(305945005)(2906002)(6116002)(65956001)(66066001)(97736004)(76176999)(81166006)(6666003)(64126003)(47776003)(54356999)(230700001)(74482002)(65806001)(8676002)(36756003)(50986999)(81156014)(33646002)(508600001)(54906002)(101416001)(6486002)(77096006)(86362001)(31686004)(50466002)(31696002)(53936002)(23676002)(6246003)(229853002)(5660300001)(189998001)(65826007)(7416002)(117156002)(2950100002)(68736007)(42186005)(25786009)(3260700006)(4326008)(2004002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0202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wf5KQxar9NIEuJRgfvz0ypTK1ogm7FDcoc/zmTtuAsGagKMGnTwMMVIW+slfn+fa1VbbeVPboN5UbLqrTMOo/eo1K5zyjBnFvFmuQPsYxDy/qwcWsA9q0NCBgT6A2+SdGRrSfn5HpKSaLw6Wv/ZChEYThqo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 15:47:16.3055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0202MB2550 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2591 Lines: 67 On 2017-09-05 18:42, Hans de Goede wrote: > Add MUX_USB_* and MUX_TYPEC_* state constant defines, which can be used by > USB device/host, resp. 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 > --- > Changes in v2: > -Start numbering of defines at 0 not 1 > -Use a new usb.h header, rather then adding these to consumer.h > -Add separate MUX_USB_* and MUX_TYPEC_* defines > --- > include/linux/mux/usb.h | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 include/linux/mux/usb.h > > diff --git a/include/linux/mux/usb.h b/include/linux/mux/usb.h > new file mode 100644 > index 000000000000..44df5eca5256 > --- /dev/null > +++ b/include/linux/mux/usb.h > @@ -0,0 +1,32 @@ > +/* > + * mux/usb.h - definitions for USB multiplexers > + * > + * Copyright (C) 2017 Hans de Goede > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > +#ifndef _LINUX_MUX_USB_H > +#define _LINUX_MUX_USB_H > + > +/* Mux state values for USB device/host role muxes */ > +#define MUX_USB_DEVICE (0) /* USB device mode */ > +#define MUX_USB_HOST (1) /* USB host mode */ > +#define MUX_USB_STATES (2) > + > +/* > + * Mux state values for Type-C polarity/role/altmode muxes. > + * > + * MUX_TYPEC_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_TYPEC_POLARITY_INV BIT(0) /* Polarity inverted bit */ > +#define MUX_TYPEC_DEVICE (0 << 1) /* USB device mode */ > +#define MUX_TYPEC_HOST (1 << 1) /* USB host mode */ > +#define MUX_TYPEC_HOST_AND_DP_SRC (2 << 1) /* USB host + 2 lanes DP src */ > +#define MUX_TYPEC_DP_SRC (3 << 1) /* 4 lanes Display Port src */ > +#define MUX_TYPEC_STATES (4 << 1) But USB Type-C muxes need not support just these states If I read it right? USB Type-C seems to be usable for a variety of protocols and the above list seems pretty much like a special case for this mux (and perhaps a set of other similar muxes). But when someone with a USB Type-C mux for different protocols shows up, that person will probably be frustrated by these defines, no? Or is there something I don't see that limits USB-C to DP? Cheers, Peter > + > +#endif /* _LINUX_MUX_TYPEC_H */ >