Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp202206rbe; Wed, 28 Feb 2024 17:52:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXilHeIwhSUjvN/Hg3k2Df5NB6AAsCivX1o2aWMv8hZYxNpq9gthpSOaAVZs19PT8+qqacznpNXJ6d78ChWT2saIzbhXfsmgjHawbp+9A== X-Google-Smtp-Source: AGHT+IEpl4wWwtNNM7MNPudzLDTtHMbSAoPQr4pHB+HM8rQ+HKGsCoSXtC5lfA3L35vSmxJtVf7Y X-Received: by 2002:a05:620a:1023:b0:787:7d3e:f72a with SMTP id a3-20020a05620a102300b007877d3ef72amr858064qkk.59.1709171569183; Wed, 28 Feb 2024 17:52:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709171569; cv=pass; d=google.com; s=arc-20160816; b=r03BKqK7gCtxtM9zr0pHuy9CN+92WkhWqo/URiB09XowwqKZeuo75aHS8oiK4dOi1i lWoZdf1VyLI2bg0oYCrKfW0BMxWP856x2kT0doJrSn51YoD2LoZ/UImIWGvCJDGOJJ+6 L3tEvWd8Zu4asKRDEDD19SclP8QxzMv+eTUzsRS9B3rSsB+1tVY9KbjW0+37JaGR8EHx bEvziXOt7wnmt0csMT9bSGZlhLkEuSPwP5YvZ2LaAlY46GhHbsnNPGfoQAUu6EoyGlff Xsh6lGKxdQ3mOnyQeWxFtabWgpk2X7TQkfaJTopVF+Z59pwy1qNjXr/2zeFVPy21oEc0 WwVg== 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=8dt5PmPSxE+xY+ZrvaoIeqYK7w3AHY3sLDIMPbPvWZk=; b=HKTJIstVDLKtzXPdT3/djtk4/K62uxYDfhbY0gFOaTfvzxuQpc94fQrCcUjUd3/u+p UKsA4rrPmL0rr8sCxbqpnk26MJI7drhMZ8JmaUJZITcqGWP0kgscb8JNcOt43nm0wDNH 29Thcch0CzfpyGerFSlXoAGvbgHbO/HEbN64dzmRTQba53QcTOVIQG5gFNgXTxylHe+H CO+5qRfcJzI3A8szRjNBMCbxHy0YLVog4heLHXLbM5oNBfvlEDBgXRb+t19pzdnS+Apj lY5Akj6bT9emmr6bwBTBdbZrqKOYx10rEeQjVXPmmUqn2dzWYnmEJxMjB9hPPl+XltmD x3dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=r3Odmy4w; 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-86015-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y16-20020a05620a44d000b00787fb830fa0si408594qkp.300.2024.02.28.17.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 17:52:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86015-linux.lists.archive=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=@google.com header.s=20230601 header.b=r3Odmy4w; 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-86015-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86015-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E6A8D1C22476 for ; Thu, 29 Feb 2024 01:52:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAFDC3612A; Thu, 29 Feb 2024 01:52:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="r3Odmy4w" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 78D8636AE5 for ; Thu, 29 Feb 2024 01:52:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171563; cv=none; b=vGqe4IEdrOsPKQ3H1QKqpS019MzV83sFTaW/q3BrRydLswp/3AbNDr3uHJjEpLG+bGOIgTLIeXSgsIEvlUjeraUBHtzGlb+L3IA7vysRPCVVVwSJq4ZEisSg+Hn1fBht0B2wIwDHBUzo4O4rrXgpMrHLtjsRaSPeIonEkXUUMSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171563; c=relaxed/simple; bh=7tJEoT7UeieYnDrUIelxhTjT/DTW8yYe3f7+9yRHQ0g=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=rYrJZz3cbjTJxnOKPzxS9QVTDY44BQVU6pbahcE4SoFVCu2ELPxEwdgzol8Bu7MhbL9W1RPGK2FtmJBce3L5pTsRpqpUil2hKvBfOHrJ8jC3/Dc4JOugfRuVGflO0xpFeCSR9ZQyVB0iN/mapaKmT5XBV2BKouuUh6ZQv4DeFvc= 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=r3Odmy4w; arc=none smtp.client-ip=209.85.219.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-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6b2682870so850837276.0 for ; Wed, 28 Feb 2024 17:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709171560; x=1709776360; 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=r3Odmy4w9nUoBFuT8uHtW8oR/jEYDSJB3qjSnrlPntvaLFhLvkowp9zdVwSSniuExn i40Udw7lMUFLwMpqpFaXHT5n8EV77mXhFu4L1PbqFTVII7E1FA2BS52lc/9jmVD7l9TS ss7wlGWGzqhucQOnIjvJkvvI5eWYw7NqARi1ZKP+JCJ2k/pqBUj31CtLCwaF0Bo6Y+gJ a80aOSCAdTqZFQBWknxpE3wG4WIKgHugdfOrfNFbVUQk6wiX6sbxKBGaE0JuCgM4H7ou NBnentahKIQHoirFBJcRIIAFLwGPYpq/c4Prue4jfuT0u6WDeU8HJw5nuyQCF81qmEC9 yEmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709171560; x=1709776360; 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=YM/Zd9/KAwdlSp6hfb4VghNuFtG6Bg9Gz+kWA3iEhnnb1b0mpespPlRAXwhPULvOYH yP0O2ieQ2SdV6aTVZFQHlXxhMfWuxzZ3YFnr8jgYWVuMvyMaty9av40NyUwPKYb+A6ZK MDttrjgigGYBQTntvuYnQcv+2uyzCeSUixD9l/J9jnAnFBmi01d+FfWojespimJrUXtk eTvsH8NeG1Zx2GnO1vD7s5YLVBOTpPYYDUOF5KxnQJy/DoBDnGGrA8QYCCu20XNB2467 pydvqq0usN5ThIs6+LC95Sw/ExSIF61PGTCJCWsdWOx45ePIcf7h0M/Fp21Tu+wj49pj KrcA== X-Forwarded-Encrypted: i=1; AJvYcCX7Nba5HOSmP89WDd5IuokbzUSqLdIHIMyAv90JPfxGlDhoe/sif1mZN1SYe7dssAdlkRSHG1JnttqcntqSZjSNKZXCG3XTTfojvHOn X-Gm-Message-State: AOJu0YweL3gJoShJmj9XryV54OVK6W73e6EBVLVyRisGmnpbneQGV6Bh g+MdF0or7I9C528VBA48c4dU5No4+c+BELUAG5CmL5+XQ04x3ydnA/CrNHvNGwCusDKlKUcwVsp YlQ== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a25:dc0c:0:b0:dcd:25be:aefb with SMTP id y12-20020a25dc0c000000b00dcd25beaefbmr233082ybe.13.1709171560541; Wed, 28 Feb 2024 17:52:40 -0800 (PST) Date: Thu, 29 Feb 2024 01:52:21 +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: <20240229015221.3668955-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 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") 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; -- 2.44.0.rc1.240.g4c46232300-goog