Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp387266pxb; Wed, 18 Nov 2020 07:06:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9il3CvTzJv+l9r0JwM3ST5D1hvjOo1NcNC2dsdlzn3cWy1a9+PO7JNCKeldwvLZOf0t4C X-Received: by 2002:a17:906:814:: with SMTP id e20mr23978684ejd.514.1605711978666; Wed, 18 Nov 2020 07:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605711978; cv=none; d=google.com; s=arc-20160816; b=R22ic2HGm1VyKjwwDMHVZYv//nOJhgw4GECCWI32j+0CS+GJm+JlClSDjYpDUL6z3t GVLv/570VtDHtj+cSJXTtuu8Z/zQiOKsJKGnDzmHDAXZSmNxIF2zkAUcW6P9ffiI0tFv PdV4jBUvmBz5oXV70SoeA+tatDIsquVyeWKDBPbwRnyuH26OIenYl64SGU6jtEuAMMVL g/CErfsFwLv/qY6VvgsQKTcs0TbMNNuV71n+QoHauDWLO2UDWD9ceQVaEFg8/vPu2dEa oJN1evbgL7V/j6dVi6VDTc3KXWLmzuAg5eF0TD3WPJRZIn+dTnO3UeqaMAZFxVsfZX5w j/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=1A1jMq8G/9HfSb1Sme5ru8UZYHYfmenUE92jmHyHJN0=; b=ts3NcRbnleXR37IUKWVJFvL2FRo4/J7DIRWywwQRUl4XN1Vnbz/mXY9Vq93V9eTbEV f96KgYMP41s/DwaqZCWiTxzeHbNjWBwp0020EAAgrL6jjGRCOvY5d0th1htraIFqusyh hfm8uqqkiDkDkcP6n9hbal7fuvtHj/b6fod8Pkre+glsNXvCEkUGA5zbJ610fVjfmE0x gwFzQaCEyCSA8w7824rrH74+J+HoRK/F86WRZnJo2NLFQWpb+PZ7E/rbmkfSv6+QgPH0 ADNoOPWARv2QfNNRY/nYeow/JdjU2DVVsVr6Jb0/3JAv299mocLlZxHRW70xVTpeDasU WLrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc11si15608024ejb.154.2020.11.18.07.05.54; Wed, 18 Nov 2020 07:06:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727252AbgKRPBN (ORCPT + 99 others); Wed, 18 Nov 2020 10:01:13 -0500 Received: from mga03.intel.com ([134.134.136.65]:37906 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726781AbgKRPBE (ORCPT ); Wed, 18 Nov 2020 10:01:04 -0500 IronPort-SDR: SBemjTiVyGvF9Yl1xjgsFa95MyhvgoXPvw38JPreCgtBi1qIDSt8GzMFE/b+HAWkAM5+OBjtxq 5qnm1LOFRNWg== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="171224100" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="171224100" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 07:01:04 -0800 IronPort-SDR: 9KBkcqlFub0GAnpedm3ZCWLcSyFEdGqk3vFU7IBAgfWnB7Qwy5V3kjMIyBQl++YjHxy75tk9Nl leFMwrCC8RLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="430881579" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 18 Nov 2020 07:01:02 -0800 From: Heikki Krogerus To: Prashant Malani Cc: Benson Leung , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [RFC PATCH 1/3] usb: pd: DFP product types Date: Wed, 18 Nov 2020 18:00:57 +0300 Message-Id: <20201118150059.3419-2-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201118150059.3419-1-heikki.krogerus@linux.intel.com> References: <20201118150059.3419-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org USB Power Delivery Specification R3.0 introduced separate field for the DFP product type to the ID Header VDO. Signed-off-by: Heikki Krogerus --- include/linux/usb/pd_vdo.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/linux/usb/pd_vdo.h b/include/linux/usb/pd_vdo.h index 68bdc4e2f5a90..704aaf826c5b4 100644 --- a/include/linux/usb/pd_vdo.h +++ b/include/linux/usb/pd_vdo.h @@ -103,17 +103,26 @@ * -------------------- * <31> :: data capable as a USB host * <30> :: data capable as a USB device - * <29:27> :: product type + * <29:27> :: product type (UFP / Cable) * <26> :: modal operation supported (1b == yes) - * <25:16> :: Reserved, Shall be set to zero + * <25:16> :: product type (DFP) * <15:0> :: USB-IF assigned VID for this cable vendor */ #define IDH_PTYPE_UNDEF 0 #define IDH_PTYPE_HUB 1 #define IDH_PTYPE_PERIPH 2 +#define IDH_PTYPE_PSD 3 +#define IDH_PTYPE_AMA 5 +#define IDH_PTYPE_VPD 6 + #define IDH_PTYPE_PCABLE 3 #define IDH_PTYPE_ACABLE 4 -#define IDH_PTYPE_AMA 5 + +#define IDH_PTYPE_DFP_UNDEF 0 +#define IDH_PTYPE_DFP_HUB 1 +#define IDH_PTYPE_DFP_HOST 2 +#define IDH_PTYPE_DFP_PB 3 +#define IDH_PTYPE_DFP_AMC 4 #define VDO_IDH(usbh, usbd, ptype, is_modal, vid) \ ((usbh) << 31 | (usbd) << 30 | ((ptype) & 0x7) << 27 \ @@ -122,6 +131,7 @@ #define PD_IDH_PTYPE(vdo) (((vdo) >> 27) & 0x7) #define PD_IDH_VID(vdo) ((vdo) & 0xffff) #define PD_IDH_MODAL_SUPP(vdo) ((vdo) & (1 << 26)) +#define PD_IDH_DFP_PTYPE(vdo) (((vdo) >> 23) & 0x7) /* * Cert Stat VDO -- 2.29.2