Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp112444rbe; Wed, 28 Feb 2024 14:04:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUDLyneo2x7pfA6phnrEpyoIYlH24sHpyHKj2IlagzHjPzrOTvB2/NxrlHiCqRdOWiFds6/K9uCY2wOUUSVqdIxQ2s6HbfTVIAKJu2g+Q== X-Google-Smtp-Source: AGHT+IENtLQnucrq1gtOUcmcvJ7BqajpNgB6lOKUbjfNAvxDp3wrfUz7nBIbNbbVw1aBzoU2PfFJ X-Received: by 2002:aa7:8517:0:b0:6e5:2f97:bf43 with SMTP id v23-20020aa78517000000b006e52f97bf43mr383193pfn.27.1709157845383; Wed, 28 Feb 2024 14:04:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709157845; cv=pass; d=google.com; s=arc-20160816; b=bzrgXSSFLJIoMTxKJD673gDYlii5jh6tYMMj/01fePiflEX+ZPWpNAyRLgwPVUU8+8 iGbpeRrOlpjXVV6JfKfpx3uuTRJcCkhA4hwfYwOPG61JkZyZaWsK6MNs9ZvTfmou2255 4wi64FqVeubuWybq56rh/ItfXZh8Uad6rWcRV/6k9fUiwF6vihBfcoBl4I8vO4j8fM+0 L7V0oLdP3nUCNXmlys1yXfICZ0D9D9jVizZHBItXLT81Lz22al8o/skQ40e/dIxOanC+ 35Bq2cmcW1hPfGbCNl85sxWRgcVjp5Bt8OTIPVKQ1yWRCgXQMIUpMwI54ZtvaKsnRxBz 1PcQ== 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=EOALInjeSh3HTsFKo9WeEXTAmZVBSHgGCLq/ONkSsHE=; fh=idSapr98KOiZ4BfPEqBEBE6RAun/wOeqLKG5WfuJsD0=; b=vpcG9w2mSVUFZUQcLgLk0XzAHqlwvoays2k/Wk8tYszuZW+liaVG/3vtCLhQPab1po 4q1lYlZRB7MQEysVJiCjRzW3bkOJ/kouBgTnjG+6ww3NAHtCnt0GhbHzQ24NknOs0X6m MmXTAq5+4cm4TuZKrG3/pSOrzReSjTcMv4aq4Ywg3B0EIARtYvJ2hPvL8PWCMUMVB7kz XRKKZGP3W5oOq1iN2DbCR5II3GHmrSJkhnjYwv9/NbIgL0eFsSKlhHdD0o9eI+rL6hzm bD/sWU8uKjUUpp5yI7yIqljr2KXjLWyMGdr62qQWArVWexx6TqLTdw5SUaVY/fbKA6u0 30AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vKQoa0a+; 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-85767-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e23-20020a63d957000000b005dc96170131si357066pgj.766.2024.02.28.14.04.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:04:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85767-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vKQoa0a+; 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-85767-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85767-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1C6EA284A25 for ; Wed, 28 Feb 2024 22:04:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AEAC1361B7; Wed, 28 Feb 2024 22:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vKQoa0a+" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 83CE71361A0 for ; Wed, 28 Feb 2024 22:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157790; cv=none; b=r9J5NK+kXBwS8Z9fCh62PTPh2iXmZztGaPXlufjBGjYpRmkRvYMDF4x8MP/MGU666oa0GMfs+50Zl4d8dwlPaBXkXp9iH1Dy6pl4h8zXs2zoonwIc7yG30WbEf8gSXnj1vgfOBxi/lXkVQqsaw/IWTg1F/v8bkj9cWv4MPrHYQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157790; c=relaxed/simple; bh=Ybd/HW3xor3RSSR0F37+S3Wo7Gc0r4PsvTMb4I8HHCI=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Z2cUuFSoiHateAClnH0XJdC13DhERcx1YoRsLhhqBgileIdwqyETLw/CL9h2WvNwQe+MmgBK4UsbYNgRo5lr1hVeSdVpi/ins1LHNRMUtib8CuJYaWWTxm8NTrxTKmEDPNfBFSlozLUlEVuH2MIzkMrcBQNwKF3wog4aL635DgU= 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=vKQoa0a+; arc=none smtp.client-ip=209.85.219.202 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-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6b269686aso445980276.1 for ; Wed, 28 Feb 2024 14:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709157787; x=1709762587; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=EOALInjeSh3HTsFKo9WeEXTAmZVBSHgGCLq/ONkSsHE=; b=vKQoa0a+MuYFP7qu+/L7cVNB6QPL2QiKG6k0ejUKLLGASeEjtHXTizcOx4mHfzvHB4 9VUNIUoBKkJjiLQEse12DknNAVLyLps8yN030mrxeoqt/9cY4caXfiDHrubjIZX1v1gc jRz12nVBlxe3s8WMMf9ZIjDmV1omJegZNDbRMyjBTc3CRjx8OhYMsLBlyELliakCjFQA K8piN8tcsJlLeus+fFhTCupKF+cJdnvCd+wKy7pjAptu8Jvyt8RlFW9sOlHj/Qkmtk0n 7qiWTDOVs7XYRcHxKugbATK1Pq3aaKYSxM77L1x42P0NWTpDUIqQTyD0xoe8qqhq4tab Ytew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709157787; x=1709762587; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EOALInjeSh3HTsFKo9WeEXTAmZVBSHgGCLq/ONkSsHE=; b=B/kTCZMai2yAE98Jvt0FbZSFDrCMe5NLDsmAfFNicLkNjz4Pw5QrhxS12B2SfNFrgO 0Um1uxpBmnDO6xZwLs9xuC0yziRuw0dSBCfv/VowOaNfNAUK1kVArb156uqnSeeJZIY8 T3CN7ugi1auAxFHg3lr7yQ0q7pmyYPHkACgxhqlEiWPa/cjGRWeIG+HFFl2dMelwOToj rq+3g3k0Dy4Qyr5wKhRefmWBGsOdyoTtVgUBia9FEIcJ91cliyaNse2plctAtdoqek8x 2OncOkJ2P7pJN16VORyWifcjaJD1Oikb4olj0XH1oP03kfVlKveEcRengW6IpWn7jswt iOPg== X-Forwarded-Encrypted: i=1; AJvYcCV2mscUOxAEKlhx/YVhyqs1v9NFj3j5THPGoM5Xbz9c65/dKgsDiZlH0hMsuyitomdJl59qRTw6Q0s2anBmYqWPaCPAJ6saO+WYuYVU X-Gm-Message-State: AOJu0Yza4vb4QTYo2+sdhTU8OW41WT+j49b5dtv6GgmNBmtxKqvvghkV 3LmkyvfkCziAxVDn4o0WBkdvNCwqPzNZmd+5+XkqFJRDBILY2uTDBXg1yfDedMlDmm4bURF4Su2 tvQ== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:6902:1142:b0:dce:5218:c89b with SMTP id p2-20020a056902114200b00dce5218c89bmr31900ybu.5.1709157787604; Wed, 28 Feb 2024 14:03:07 -0800 (PST) Date: Wed, 28 Feb 2024 22:02:51 +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: <20240228220251.3613424-1-jthies@google.com> Subject: [PATCH v2 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 Content-Type: text/plain; charset="UTF-8" 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") Reviewed-by: Benson Leung Reviewed-by: Prashant Malani Reviewed-by: Dmitry Baryshkov Signed-off-by: Jameson Thies --- 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; -- 2.44.0.rc1.240.g4c46232300-goog