Message ID | 20240126183930.1170845-1-abhishekpandit@chromium.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp75526dyb; Fri, 26 Jan 2024 10:43:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDqZdJ7aehEMRmYipbZkrJFc7Wk8o26OkRQCU/Lbz/oJdA3EEISr8wwTyCyhQwlpn2kGn0 X-Received: by 2002:a05:620a:2001:b0:783:e114:2a62 with SMTP id c1-20020a05620a200100b00783e1142a62mr115611qka.16.1706294607540; Fri, 26 Jan 2024 10:43:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706294607; cv=pass; d=google.com; s=arc-20160816; b=rhG5AS8uZHESnOJ0+MC1PCPb/RSQKtmJzsS8bTq9hjeXq7QPznEjFK5jAmk31ivYYn 1vwInEVm/AiuAyjs0YQJJ1stM1c21IGonziGdcvbezFTudnqyP8VjTl/nxxamJsktFPM TLEtcvE9WIPAai15pY5bTxxVCZ5OI/w7O2PKtBNWM1ytm093ozSiY6/+WpN4KZb1OjFB i4e3QyPwcPDpNkIdm2OBtC6k3Xi3sNdtnakB1D6W2gmoDGkKdY2Q9mSLwELfIl/dpQua 4LzrvzJ/wwemaKB5qNuHtcdQO2L+VDxnHIllCMAn9T+YNQ1hwaBvIkzopz1Aust764i2 aaTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=S8hCjCIj0wY+btghjatqQCYEGwLIKeiKm/Edu/1s92Y=; fh=XoPQAeu7Fuor2202s6JEs/0PUBni9ATIo0WIbdQ5L2U=; b=QKKN8yeSGi4cS1CMsH8JskBn15BXrmfLvxpQzbfCHfB7L5UYcdcKk2i9jufTNMpq8K es7uTV++/I5qEFQUQ5Nu5RH3xXR9H3emQUwNDntp9a1EgKoC7eXOP3SajsMnRQorukvf YgDe5FTQtjGzYwyV55fvgf1H4rzwazsiJF0Lxm2A6BR7/LydI47zpHf0daizve+ALOny jkHh6h4uewk4+sGaIeuveAk/KxXicNwc3qS6iIc9N+TIb02QiuSiu13mjC1jywKE7S+j i3fxSz2MjEJka1jTC5MP3wuIv/uVgQ1zfwkUTNxIP+Y2u3ItAm6Io6goYjwQmNo9I562 jLGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OYim8Ygq; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s21-20020a05620a081500b00783484f3fedsi1843820qks.348.2024.01.26.10.43.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 10:43:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OYim8Ygq; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40515-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 570C51C210ED for <ouuuleilei@gmail.com>; Fri, 26 Jan 2024 18:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C64F553E2A; Fri, 26 Jan 2024 18:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OYim8Ygq" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C5521A0C for <linux-kernel@vger.kernel.org>; Fri, 26 Jan 2024 18:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706294378; cv=none; b=nijmX5VQ5qjrtFe3TRSAHyUdsthUOLryDElv6RFRTj+XM03LqBvDCHiKu96uAH6rw+SF2MiSYpKkTjePOWGaAQfiIiKp1ZHPOLotGQlLB231qs0yJMU3/xthJ4/JiK1YRGglOXYEN2dcMbJul+Lu2qIi+nhrT/xBRJEjjmENyD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706294378; c=relaxed/simple; bh=pBwTJx9vqo4YpKH1g0zLKQIz+09wVpQoiwp6B3aMnxA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=babBTxf1hD7TxYIaqED+B8iz2uVfxhKtGTnBkwBsTI7gb7PKCWhKVJBpI1Fw8Hk48+QvfoKxc/1k0xZpoEvJDb8MvvmWZc1WVVjnto4YJOMTforyABKFEOH3LPg58/tPZxVQbJh5Qs2Cov1AxQZ2xPV8DQcYBYZEH1UMNbF52mY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=OYim8Ygq; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6ddc162d8d5so539820b3a.1 for <linux-kernel@vger.kernel.org>; Fri, 26 Jan 2024 10:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706294377; x=1706899177; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S8hCjCIj0wY+btghjatqQCYEGwLIKeiKm/Edu/1s92Y=; b=OYim8YgqV/OQwKnAhAW8/8hi4LKOxbI7nM4ezzvyMfMmzOFesbclJh/YNdbsE1eWfj q1TT4R9LudMdEfY/3yYoUUsgASlYIPjliH3h5Z9dj9pZIJHXam4EJ2eUlW2+wMMVnFjN MfP8GkvrzfipJwhoB+3vCHQqUpNTD8WOM3F5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706294377; x=1706899177; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S8hCjCIj0wY+btghjatqQCYEGwLIKeiKm/Edu/1s92Y=; b=C4n2CTR0ythhBaKSLMrHZtlhkndErmpLvCJK7VV5d+x32apvOu4CnjY4rQyF6zm7tk 7OjbN2p0DbaW/fsy4oE7DSjuLmFk0sZpfwAKwX4mdlGRk9iV3VdzBYZsJPv+oNRaXR0P TsQ0ANAFDv14VNF4bq2zxYGMnVF9svNIQszSD5tQJRASSy2RsRDOLO7qR9IQk96rGdfv GcvQW/Hfh5CdQ6GFNmnj3X3PpRdw2KR9Zw0+6Y2DDi5C7WRvZBix6yzJdjcwq4J5bzBf f2Tdso/Kjg/1uZ0Cwun2cIydNt2a99MNdofJbXrPGyqEKzirGZmvmU2BJY64Yxa13WFF j6Qw== X-Gm-Message-State: AOJu0YwgW6/z8h+Mtqb/zyFL8ZtNtPJPRdhbcMJxsc55X22NHRzxnxj5 z8F9vsPxefSz/vHYmGzp3gxCPl0LEXweur+x+zbEyDRVJxYcPhNdGHz7Lh7WNQ== X-Received: by 2002:a62:6287:0:b0:6dd:7d11:41dd with SMTP id w129-20020a626287000000b006dd7d1141ddmr187072pfb.69.1706294376535; Fri, 26 Jan 2024 10:39:36 -0800 (PST) Received: from localhost (209.148.168.34.bc.googleusercontent.com. [34.168.148.209]) by smtp.gmail.com with UTF8SMTPSA id y12-20020aa7854c000000b006dbd3aec001sm1446879pfn.146.2024.01.26.10.39.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jan 2024 10:39:36 -0800 (PST) From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>, linux-usb@vger.kernel.org Cc: pmalani@chromium.org, jthies@google.com, Abhishek Pandit-Subedi <abhishekpandit@chromium.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Bjorn Andersson <andersson@kernel.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Fabrice Gasnier <fabrice.gasnier@foss.st.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Hans de Goede <hdegoede@redhat.com>, Neil Armstrong <neil.armstrong@linaro.org>, Prashanth K <quic_prashk@quicinc.com>, Rajaram Regupathy <rajaram.regupathy@intel.com>, Saranya Gopal <saranya.gopal@intel.com>, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] usb: typec: ucsi: Adding support for UCSI 3.0 Date: Fri, 26 Jan 2024 10:39:06 -0800 Message-ID: <20240126183930.1170845-1-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789179574708685731 X-GMAIL-MSGID: 1789179574708685731 |
Series |
usb: typec: ucsi: Adding support for UCSI 3.0
|
|
Message
Abhishek Pandit-Subedi
Jan. 26, 2024, 6:39 p.m. UTC
Hi Heikki, This series starts the work adding UCSI 3.0 support to the UCSI driver. There's a couple of pieces to start here: * Add version checks and limit read size on 1.2. * Update Connector Status and Connector Capability structures. * Expose Partner PD revision from Capability data. These were tested against on a 6.6 kernel running a usermode PPM against a Realtek Evaluation board. One additional note: there are a lot more unaligned fields in UCSI now and the struct definitions are getting a bit out of hand. We can discuss alternate mechanisms for defining these structs in the patch that changes these structures. Thanks, Abhishek Changes in v3: - Change include to asm/unaligned.h and reorder include. Changes in v2: - Changed log message to DEBUG - Formatting changes and update macro to use brackets. - Fix incorrect guard condition when checking connector capability. Abhishek Pandit-Subedi (3): usb: typec: ucsi: Limit read size on v1.2 usb: typec: ucsi: Update connector cap and status usb: typec: ucsi: Get PD revision for partner drivers/usb/typec/ucsi/ucsi.c | 49 +++++++++++++++++++++++++-- drivers/usb/typec/ucsi/ucsi.h | 64 ++++++++++++++++++++++++++++++++--- 2 files changed, 107 insertions(+), 6 deletions(-)
Comments
On 1/26/2024 12:39, Abhishek Pandit-Subedi wrote: > > Hi Heikki, > > This series starts the work adding UCSI 3.0 support to the UCSI driver. > > There's a couple of pieces to start here: > * Add version checks and limit read size on 1.2. > * Update Connector Status and Connector Capability structures. > * Expose Partner PD revision from Capability data. > > These were tested against on a 6.6 kernel running a usermode PPM against > a Realtek Evaluation board. > > One additional note: there are a lot more unaligned fields in UCSI now > and the struct definitions are getting a bit out of hand. We can discuss > alternate mechanisms for defining these structs in the patch that > changes these structures. On the Windows side I notice that Microsoft explicitly checks the UCSI version to decide what data structures to use. https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/ucsi#ucm-ucsi-acpi-device-for-ucsi-20-and-greater Perhaps doing something similar makes sense in Linux? > > Thanks, > Abhishek > > Changes in v3: > - Change include to asm/unaligned.h and reorder include. > > Changes in v2: > - Changed log message to DEBUG > - Formatting changes and update macro to use brackets. > - Fix incorrect guard condition when checking connector capability. > > Abhishek Pandit-Subedi (3): > usb: typec: ucsi: Limit read size on v1.2 > usb: typec: ucsi: Update connector cap and status > usb: typec: ucsi: Get PD revision for partner > > drivers/usb/typec/ucsi/ucsi.c | 49 +++++++++++++++++++++++++-- > drivers/usb/typec/ucsi/ucsi.h | 64 ++++++++++++++++++++++++++++++++--- > 2 files changed, 107 insertions(+), 6 deletions(-) >
On Sun, Jan 28, 2024 at 8:06 AM Mario Limonciello <mario.limonciello@amd.com> wrote: > > On 1/26/2024 12:39, Abhishek Pandit-Subedi wrote: > > > > Hi Heikki, > > > > This series starts the work adding UCSI 3.0 support to the UCSI driver. > > > > There's a couple of pieces to start here: > > * Add version checks and limit read size on 1.2. > > * Update Connector Status and Connector Capability structures. > > * Expose Partner PD revision from Capability data. > > > > These were tested against on a 6.6 kernel running a usermode PPM against > > a Realtek Evaluation board. > > > > One additional note: there are a lot more unaligned fields in UCSI now > > and the struct definitions are getting a bit out of hand. We can discuss > > alternate mechanisms for defining these structs in the patch that > > changes these structures. > > On the Windows side I notice that Microsoft explicitly checks the UCSI > version to decide what data structures to use. > > https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/ucsi#ucm-ucsi-acpi-device-for-ucsi-20-and-greater > > Perhaps doing something similar makes sense in Linux? That probably belongs in `ucsi_acpi` and would be good to add there. I don't have a Windows device reporting a UCSI version 2.0 but wanting 1.2 so I can't add or test this patch. > > > > > Thanks, > > Abhishek > > > > Changes in v3: > > - Change include to asm/unaligned.h and reorder include. > > > > Changes in v2: > > - Changed log message to DEBUG > > - Formatting changes and update macro to use brackets. > > - Fix incorrect guard condition when checking connector capability. > > > > Abhishek Pandit-Subedi (3): > > usb: typec: ucsi: Limit read size on v1.2 > > usb: typec: ucsi: Update connector cap and status > > usb: typec: ucsi: Get PD revision for partner > > > > drivers/usb/typec/ucsi/ucsi.c | 49 +++++++++++++++++++++++++-- > > drivers/usb/typec/ucsi/ucsi.h | 64 ++++++++++++++++++++++++++++++++--- > > 2 files changed, 107 insertions(+), 6 deletions(-) > > >