Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp146086rbe; Wed, 28 Feb 2024 15:22:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/aBUEBqMgJoTye7O2VUcGBCG2j2k5Jcre+Q2W3NdVwrcE6SSg4Ir3ya270UI/wqyacZgU0T7LYq26yNjfsldlHgZJpogpBykcIFiiXQ== X-Google-Smtp-Source: AGHT+IEZApbUxpZHn1XSBi6gg8O/Xu8fctp2+Rq8ZrObij1Try2eS+JTRmLuToYo/GFwI34ouav1 X-Received: by 2002:a17:906:52d1:b0:a44:3109:f1bc with SMTP id w17-20020a17090652d100b00a443109f1bcmr212574ejn.29.1709162556153; Wed, 28 Feb 2024 15:22:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709162556; cv=pass; d=google.com; s=arc-20160816; b=Xo3RtTFUt3C2TvDBS6M9U6jMLMg5kJKthQCYv3/2BXS/Lhmq9Tx0ISyMduIZWfB+sq wYxkLrIl/9FMovP9ErgzvB98CNyM/T+L8dCaFCHrGaHGaJ/vJ4otJzS+7hh0h9EYXKIz O5pvnL0cPlgui8O+9lvrBLv4k2hX2BoOQvLDG2h9RLSyFvyZrQkpayAvHQuOMxuCVl/R JK2K5/bcy1vUSf8ZxNcMlbaoKB4ntCrALAAbzQaIM82vLWXAoPFpEj8oiHvrRGIA34Fs qOBdMwK+h1gYMjpwa5dSwRgrfLrMfT6ZTLlKiFtHe7EHiDpOAwZ+1FxA4LujdiiyOtvK fIXQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id nc22-20020a1709071c1600b00a3e34ecee31si13832ejc.1049.2024.02.28.15.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 15:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85843-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85843-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A17011F26110 for ; Wed, 28 Feb 2024 23:21:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D64AA72924; Wed, 28 Feb 2024 23:21:30 +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 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