From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97F027E for ; Sun, 22 Jan 2023 15:07:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E392C433D2; Sun, 22 Jan 2023 15:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1674400066; bh=cc/v7m/mpHXzegOwvt3tpMdwtYJkp+XIpTEfmBwT9aA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ul6P+Too4+1LmoSXL7UxeBrv07rbJt9Fa5dnkHiAai2/zMacl5uhS3XZ18oUqT79u 7OGgD9AicUdKQ2e/jFD9jSrAxJhS9YiwwIHxyza7mrqp+Y99qHujx9g/3D3D7QRoUC SLNywjPKHUY0UAiauDQubMmgODddbEkmrtzzu7AM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Heikki Krogerus , Prashant Malani , Benson Leung Subject: [PATCH 4.19 26/37] usb: typec: altmodes/displayport: Fix pin assignment calculation Date: Sun, 22 Jan 2023 16:04:23 +0100 Message-Id: <20230122150220.641775235@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122150219.557984692@linuxfoundation.org> References: <20230122150219.557984692@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Prashant Malani commit 9682b41e52cc9f42f5c33caf410464392adaef04 upstream. Commit c1e5c2f0cb8a ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles") fixed the pin assignment calculation to take into account whether the peripheral was a plug or a receptacle. But the "pin_assignments" sysfs logic was not updated. Address this by using the macros introduced in the aforementioned commit in the sysfs logic too. Fixes: c1e5c2f0cb8a ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles") Cc: stable@vger.kernel.org Cc: Heikki Krogerus Signed-off-by: Prashant Malani Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230111020546.3384569-2-pmalani@chromium.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/altmodes/displayport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -418,9 +418,9 @@ static const char * const pin_assignment static u8 get_current_pin_assignments(struct dp_altmode *dp) { if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) - return DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); + return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo); else - return DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); + return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo); } static ssize_t