From patchwork Thu Feb 29 01:52:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jameson Thies X-Patchwork-Id: 208160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp121686dyb; Wed, 28 Feb 2024 17:52:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWPEWcMsVCKEGvBS928CXX5JIP6fwGPGaa9ba+x8XtxXNXQ1hp7mjIhZJSWvuQe8I0MrdHkMnB7qaBY7T5HD3ifozry2w== X-Google-Smtp-Source: AGHT+IGkEJl8Go6Lfdw6277hD0ywZ0SUrQQQh+QJ3NHqvFeaEjNbkAbef3nKTBAv0A22DxZR8eTv X-Received: by 2002:a62:81c1:0:b0:6e5:5de9:146c with SMTP id t184-20020a6281c1000000b006e55de9146cmr928915pfd.14.1709171579478; Wed, 28 Feb 2024 17:52:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709171579; cv=pass; d=google.com; s=arc-20160816; b=WktIElZ6TdNnS/cKT6BsbqYNVN/XGGJs2PhA1Smt6jOhKftu5iqkF99p/HOPb9u8MA KJVAf63OI+dHG7lmEPvoCAY6jZoGCqMZTOI30sNwd7C1aGMcjPuI2AN83GQQqNU1CqAy wprSt5JpZuGVZ7bRZS2ZuDxxQPOwaPgr8C6e0E8sHMosTofAV2XvYKNmKt5f0tKEUPLV cPADW3PBJ2b2a6BVdDHdYrhe3z2RN4e19LGzG9JL//A4dTgFjbQ/SVMZNTwa/dKLqV/J pXVhccH1CXQR1dTXXrnznVMcs+co5Zh/x4Hfd2Tsscx9fXFBs6LXJEHSjYYiASGiuMGp 4aPA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86015-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d4-20020a056a0010c400b006e5571cfb33si254420pfu.311.2024.02.28.17.52.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 17:52:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86015-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86015-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4924E2824CB for ; Thu, 29 Feb 2024 01:52:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF2BD364DF; Thu, 29 Feb 2024 01:52:45 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792182848307269728 X-GMAIL-MSGID: 1792196298364703115 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;