Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp216158lqc; Thu, 29 Feb 2024 15:28:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVVtaNX7qvQFUGPeRVUGd5dxFFWOLhGdtoCUgJCmYC/yQdmaUUnIhE46AXvQekqf69+Uhho3MXgh3nUoFEeTGLvo433FWyGOdV68r1Fqg== X-Google-Smtp-Source: AGHT+IGc48F3ZrrhlDJpVq3d3wTCos29w09YhgagUc9DABf39LL8AycI/JPLnxCALMX6EfrzgSka X-Received: by 2002:a05:6830:1be1:b0:6e4:8eb0:a7d9 with SMTP id k1-20020a0568301be100b006e48eb0a7d9mr189703otb.3.1709249301939; Thu, 29 Feb 2024 15:28:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709249301; cv=pass; d=google.com; s=arc-20160816; b=PGy1kJGRBC054HpiGcFA6kWWS1IAnnjSvtcmvPz6/IwIZze03VKWILwAAeJlOuFo4I 8xgdTLUywYMDvw7qNaaNg0fYq7ahw/TeiBriW/BcRwAXJ9m7GwsiIOm19jrMdfowkEHv Li3YBKazyTg/PdKrXmKLmODuqcb/v27aHlQWnLIHkOecH7e5AzwOLTIk2r/pP8nQI25X cuTnUDUiZ8mqSHYZVJG9vBYdelP9ontr48NCYl39Dn4emiMY4/qDfzjCwtVfwxkseNQt ng97610kOG6FT1zl7o/o/GJXd+qh18mc4h+cUdKC1Uxvl2bzJ6q9unHlxeFvIYakUw0t rJ1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; fh=KkptrE3fAQ35dBONH/n1qQpkrt/K/EXFIIvjqDhho08=; b=LQ4UOBsL3ebNoRldrTyIO0LMPY3FFC5klrj+/3wd5W9rQGS5qcDJB8obAlK2xZIjx4 P0WTkwXNjZgErm7XI/csti8bS82ZyuD5WCdDhR8fk1PSV6DMkket6gYhRt0a7Bnhk5b6 gcHQNc1pEDdfFowL8u5tgx/q7hyyOw1NV1bLA7GVkGp6CDGL+Ohh0NZ87U2iqMcSf9MK 48kXo6hPFWGo8RmByhUAb6/6GEO6EqXZjpi4n52fwWry10uW5KLtBeAlisQglS0Hz5rd kJXLDUzn0AQIB5obuE/DEVlVSaA11FULOF0qjS/EKGWjNS0fzjmy4oijYXKMx6bfehfv h+Iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UstDicte; 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-87690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87690-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s18-20020a634512000000b005dc85a758cfsi2264852pga.169.2024.02.29.15.28.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:28:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87690-linux.lists.archive=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=UstDicte; 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-87690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87690-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 60B24B220C2 for ; Thu, 29 Feb 2024 23:28:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 346AF7A15D; Thu, 29 Feb 2024 23:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UstDicte" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 2C8356D535 for ; Thu, 29 Feb 2024 23:27:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709249268; cv=none; b=kbbDD02xnr9AJbSt5cW7rziTLWPKUd35LDWveDfH6GphmgUd1XrONGq5yVNHTYjk/+QK2SdcZXegk6gk/JawSDBXSNhUHr9p1tnCwZW9jExNcQa5vvRrG6fxzGoK5c2jWlOrONbBCH+y9HgB6JQwJkjGlUwfCUr7nAGMxPJ6Wsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709249268; c=relaxed/simple; bh=7tJEoT7UeieYnDrUIelxhTjT/DTW8yYe3f7+9yRHQ0g=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=p5VqksDK+SJyIkDm6aqdcKQlNk1HCktBbQOojA3eI04PkIDlWJpIyKc6JYsRZrHk5NrPx3RhXu7/8db1BoJQ5h/NNkjC9qgQg6CL0MYkj8GuxSREJOa+cGaBDsyfUoE+ywxbJujo0a/HEQgmZyaeXYUHUpMqQzsam0R8bT/To5o= 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=UstDicte; arc=none smtp.client-ip=209.85.128.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-yw1-f202.google.com with SMTP id 00721157ae682-60804b369c7so18938537b3.2 for ; Thu, 29 Feb 2024 15:27:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709249265; x=1709854065; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; b=UstDicteCTjBperi9tOyIrGuhf+jdUGHooZE4z8lG7gi+AlyqryVfmf/V1PebCg/pT LjKSmniNwekt0cPh4XfoLR4peuAF3eMClSGY2kWZdZeDnphUzDdHcHvgNMKunrbzzpCb evt7rwZonGmFw+vYINQMPLB4ahdxKEO9iA8NePH574wkJa6bJRlr9hV58ZqfZXOWA0bw yvuETpmvJ6gH3X2FOD3ga/pq4mub+thLMLt0H7pXX6OXGfao6ipOEVIfmZUV8hJMPyf7 12DcPyuTSarVJJlEBY3CQw/sSjMLKmBtK0Lt8DaZwcvpMd3F1xPQ7xjASyuqbOjeHjUb OJ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709249265; x=1709854065; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E3VOyu5h5VNnqIC5C1wAkPY2R8kjBMsntg/JOJOAxJU=; b=ljH9cZrqfDwdYPedQh9MtaIPI8RgR8bgPLGVGjCU+Cr1u/dQ4rwn6AofuXj3mQlmwj wwPWI3gWpcFdrqQ0D1Wnzm9ShQ4cIOmnnvSJfSJ1WWSBBWxH+WUMYQAoRwi9x79lSSzh 7vnnxluO+HscbtcSpx3rb2UzECfe7mt4ZGaz+qHG/o/4UQkL02GiPOWZIZL3GG8GJ81y F4rVLz7Z/CYBEzQBOAuFWsI3ySTHxfjiDq7RAeJH7h+qomCMdQWEHOwWBqfrPyj/jNv4 pesL8q2NsMiyN04XJYssgk3EGLF7xyJjabXZRI8OtjWp8femNyhy0X73jdb65G0nIjfm 8b8w== X-Forwarded-Encrypted: i=1; AJvYcCXgqbJEJ28Ea1I02YNlqOFsQASOjaIF12tb/jCrQIzv7hIdzF7nj/KMrVzck9qu3muRF99OrLhknY4ylYEfv7E4NrqQ9VPOYr+aw2Jd X-Gm-Message-State: AOJu0Yzd4AvIA55ne4QLtVs1Ta6+pGSn8xWfcStrwIdRIY1cGG3TmH8c o1PUmHMbuVRjQDZBPJCwk1K8Nm0ZeFIeTBIysSD95nZpohJ7pTFkUF92mxZ58lZp7fnhSlXFABC tNA== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:690c:b15:b0:608:e4fc:aada with SMTP id cj21-20020a05690c0b1500b00608e4fcaadamr124ywb.8.1709249265253; Thu, 29 Feb 2024 15:27:45 -0800 (PST) Date: Thu, 29 Feb 2024 23:26:22 +0000 In-Reply-To: <20240229232625.3944115-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240229232625.3944115-1-jthies@google.com> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog Message-ID: <20240229232625.3944115-2-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