From patchwork Wed Feb 28 23:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jameson Thies X-Patchwork-Id: 208073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a1a:b0:17b:cd04:e0c6 with SMTP id 26csp259724rwa; Wed, 28 Feb 2024 15:38:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVuj1bMQ1tTENYfZFuHv3bwqVZPQWPu34h9oe2FAXzbuyJrx+NCBpmq96A8QmPYnRGFWqB6ndf55jD+VtmsbmNrM/g2UA== X-Google-Smtp-Source: AGHT+IHs4pjbVz98vExzgUS4IuFtkZ32xSk6NKBElXc2ua6lz79kNen74EOhE8VLIEU6GUJ+/GOx X-Received: by 2002:a17:903:2286:b0:1dc:b392:d67b with SMTP id b6-20020a170903228600b001dcb392d67bmr352806plh.24.1709163538958; Wed, 28 Feb 2024 15:38:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709163538; cv=pass; d=google.com; s=arc-20160816; b=w+M25JnU0K68tZg6jIrTpiNu3MoWKHAV/4PI/Wmfd07wx50SYs8ZZM8fukSEGhLAg7 282gA62mfbrFcEpz1OY2EEO7Thz6n0isTp8u0M3odv6f1pB9ltOcfqVgzp8nkI2R0+w7 kM2RHVfbIcnwPzQ5BPwQVKej0X6q5v8XbwyIuwaEZFt6dga14JKNkgV/dGz09fWvWT73 ReTJT7k4FHH7YQS3kcS2NWKXn8SPeaON50uT67wyCQeMaRBsg93K2glJ8kqIcMuiahMR pj3Ki9vcY5HfF0R9TS3sBhd5LSPywJ5l9QFSua8GRU5E4760rVf6KypoyokK5YUp3RO+ FbSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; fh=BssfrmYFgEvG9LAXY2/mnOpCDl2J/hizcHs8BzHRblk=; b=IzFXYg1a4FG/uTvs8S1ZHKVbQCO5rZ/zlokJgqyZbIoYpFFTaudjhrGFCMwKekuzBG QY7FaLuRRON4MeDOyB+HhdziwvMUrvu9UllVG/7+YYys0r8DebD8S2iXZN5JStEzqAzE A0g6xkeq3G2s+JiSpSsvgLuinj1N2+TsAfY/cjG4ossnUbk7nw+oChDdmzlvE5g/o/fQ w+X2+daUcODl09xZLoi0L7w+DwZpToG4WnwAS/0nRDOQVkS6PWuLNeDCWEmyyyFra0FZ 6Yf2UKw3NNv90A0/8pYMXum1/tj/3Fkd7rAPaFHw/ZVbQdXYYfa1DLAjRJvbswQz9cmW ulJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TbKFe5Zz; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85843-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i13-20020a170902eb4d00b001db5df6dfb7si34250pli.421.2024.02.28.15.38.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 15:38:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TbKFe5Zz; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85843-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EB46FB25524 for ; Wed, 28 Feb 2024 23:22:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5FB27293B; Wed, 28 Feb 2024 23:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TbKFe5Zz" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 9B54871EA1 for ; Wed, 28 Feb 2024 23:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709162490; cv=none; b=RXpphnyIKXsdEZwKJN7QmDujvUuhU4IM7es0IuZmAP0wDY46MSDRtX/dQtUFFSjTwWHhDMgXx1p0DYNHI8QfK0VbAxotiSHVGzS4MNNnlqTIXKiXiqHxIfNah9bH43t2ulWYqXQB5AtgDm0UGvVCg3ydOfcxfO9QTAWeMd9dLuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709162490; c=relaxed/simple; bh=7tJEoT7UeieYnDrUIelxhTjT/DTW8yYe3f7+9yRHQ0g=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=rp8T4B79/922Py4+MlxKXbEQUeq/UFK5PROy723LoMeGp9YevtYOynffkko15CSn7f4g1egHFdKTfl0WrwDlkKq7XuzR09Posqp2U47V/ZXpAmJX++itaUQL9AMEq72HfDIMVD6hk2xZe+dxGAR7HwwrcJaWJVjRt37WuSk1LfU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TbKFe5Zz; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60948e99cd4so4925477b3.1 for ; Wed, 28 Feb 2024 15:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709162487; x=1709767287; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; b=TbKFe5ZzuvbIQBSmu8WfhzGno/ATX/w/sPE4xH39dKwN9JRJg5wYCkNAI46qDP013H tjd4rlPzbspnfaIqImPDH7JP/b6fTqDy19AxsEg9zoP7PLpIizW71kTLE+dhk62U0F/A DiEQjTImWs/j2GfzpMrsKKvNzBBZE95myM8BvRAcDWlBYN9ah2ag5ddtQST3WBkNeysW tey985fSKlMSB1mbEz+L1XSJEDK9hnkgpaWFGORxexuFNzUw1GybGnHoIth78Q+NaokH MSYLtbtYd70QgppYWUouTyZVGw8ZWH1+Wx2+sf2IgykhE4OUovzpcO0o2hQNaBkXAytr zi3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709162487; x=1709767287; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; b=HV8eYO9rlHI/c7I8/QjPIIZ7uA1fETLoYXz7Z34JdTDcxuhl5Z+Lq1gCfsFv3soKnC XVE+r0lDlDoJ2qGgGzwlce2NQ4XoDKzEWtBZBcg2KkHWg1aUFzKvdu4DwUZUvk4xwZfS sleCAQ5YRpMLZyGXi3skx1cfgrZ0e8rWqceeKRHzsMm6Dl5skDqtAfjK1KYuKxItARoL lwdXoo0XcL/oLu0K6VYK1roIhLGM2E7jq6ZcVDYZHy+eV7HWU6ksPi6JDxZJoa8c1kCh IVbPenNmygufLvAExddPZ66tX7CVJyxPkUUvv8ZuaWilDrF2+I/xujKIKOyEFqUTqgp0 meaA== X-Forwarded-Encrypted: i=1; AJvYcCXU2ZCMy/pIbkviVAP6OlvZJebJwLS1bUdkVLRio9U66zixst5MPz91HWlOpMluSiKqoRJwQ4hqKIP4JX6E3ZMcldt9vtXXjN/hKdF6 X-Gm-Message-State: AOJu0YxBsIJXS1XwRgS1kmOH/IN7GIK2W+fEExgbHap/2KreHvX0DNiA 0HvSolkZeic9dgtRojQE2/HwnBd6hFXEJufRCQ0dSW3u573qk72MaTcWF1yeosFu60iNeoEoPDf hUg== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:6902:10c2:b0:dc6:e823:9edb with SMTP id w2-20020a05690210c200b00dc6e8239edbmr41694ybu.12.1709162487685; Wed, 28 Feb 2024 15:21:27 -0800 (PST) Date: Wed, 28 Feb 2024 23:20:34 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog Message-ID: <20240228232034.3630838-1-jthies@google.com> Subject: [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros From: Jameson Thies To: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org Cc: jthies@google.com, pmalani@chromium.org, bleung@google.com, abhishekpandit@chromium.org, andersson@kernel.org, dmitry.baryshkov@linaro.org, fabrice.gasnier@foss.st.com, gregkh@linuxfoundation.org, hdegoede@redhat.com, neil.armstrong@linaro.org, rajaram.regupathy@intel.com, saranya.gopal@intel.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Benson Leung X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792182848307269728 X-GMAIL-MSGID: 1792187867154977702 Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for plug type and updating the modal support macro for consistent naming. Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields") Cc: stable@vger.kernel.org Reviewed-by: Benson Leung Reviewed-by: Prashant Malani Reviewed-by: Dmitry Baryshkov Signed-off-by: Jameson Thies --- Changes in v3: - Fixed CC stable. Changes in v2: - Tested on usb-testing branch merged with chromeOS 6.8-rc2 kernel. drivers/usb/typec/ucsi/ucsi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index 7e35ffbe0a6f2..469a2baf472e4 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -259,12 +259,12 @@ struct ucsi_cable_property { #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE BIT(0) #define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE BIT(1) #define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY BIT(2) -#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_) ((_f_) & GENMASK(3, 0)) +#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_) (((_f_) & GENMASK(4, 3)) >> 3) #define UCSI_CABLE_PROPERTY_PLUG_TYPE_A 0 #define UCSI_CABLE_PROPERTY_PLUG_TYPE_B 1 #define UCSI_CABLE_PROPERTY_PLUG_TYPE_C 2 #define UCSI_CABLE_PROPERTY_PLUG_OTHER 3 -#define UCSI_CABLE_PROP_MODE_SUPPORT BIT(5) +#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT BIT(5) u8 latency; } __packed;