Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp245858ybz; Tue, 28 Apr 2020 22:48:40 -0700 (PDT) X-Google-Smtp-Source: APiQypIuYY1fa0Xq8FGda1JFX1NjHRpiSQ1gdb33w0Es0pHt9Fp9Xdt2G+mTNRtmOBq7JMVj7USG X-Received: by 2002:a17:906:2488:: with SMTP id e8mr1102891ejb.157.1588139320606; Tue, 28 Apr 2020 22:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588139320; cv=none; d=google.com; s=arc-20160816; b=fkn4twQ5TuiRg16Z2qk5uaX/ducjcGAxR3alwhradLV0txrle3ONlxGs9oaGuiQ+vN LxD5IRMNoTKwVv8zFZeJ7U2gfB6EwCXouiUiKUB/UabuEzRWKuvxaefKiP2ENg4PXrNl Nyc196vaCcXV0qYxTCEF2l3cTlBje9/zKditWFbsBfZtABz01MviKv4v3Sxs0HcHEHzB JuVR7vEIoNCE0r8ZA2fP2nejWujRrwTV+ERAUruv2NUjh6dsZn5Zw346h4ktT73SQ7wW HEQcgvzi9HOx3CmMyZ0m3SE5mrCsSDGE8AcBm+PV3AJSKkeD28gHXBrTnjuINpdvjilk 5KaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NDFxg++eD1+RNatg0LEkYVk+fTXxx1+fMgnRzfGeuOc=; b=lVInoyUEwKt1GNl1o39CFtOi6O9StMyMXqhCpZF45kcIEES97QPd+JXkr5dq2hlZmH qCxzNDwrMKcJAs5Tg/fjHduhduEP+T68bczeYQKLqmS69fp+9/67LEYjvYBBwMoMSVsN OQayJTpO0/hs+ra/NMzwIa3ytJPWnZ4aZzDn5+sLTRAP2gltbjYiwVpnHa6uJ5Srm7IZ akNhG1drUYS8JGco9MxySgiQfTRcDMlO2SQ1GNTmHzv4iJPBH70JHIQiOuNMqJHgU4u8 Y1MLoccsnGhXxRCpMmXUUIZ0UcSRBkoCZeAmVYiNpJXEY1COBRC1HohHXMXgPZp8kCR2 e6NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZFl1+Jgu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si3078213ejd.260.2020.04.28.22.48.18; Tue, 28 Apr 2020 22:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZFl1+Jgu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbgD2Fov (ORCPT + 99 others); Wed, 29 Apr 2020 01:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbgD2Fov (ORCPT ); Wed, 29 Apr 2020 01:44:51 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0512AC03C1AC for ; Tue, 28 Apr 2020 22:44:51 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id c21so447976plz.4 for ; Tue, 28 Apr 2020 22:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NDFxg++eD1+RNatg0LEkYVk+fTXxx1+fMgnRzfGeuOc=; b=ZFl1+JgulcKUI4Z0turXxsq7c5UiKjHXVoMW4gqGdqvgC5/w/9mW4JfWjmr6/sTvkK ALmTcejusRpPD0UDoLgCrO97Fqh3ZZC9WKdgm1zH4uJO9Od1pbqbXBzYrJKUEEay3m9P B5iLs4A9nyz/fj+th00q+bnVie+LKBIUMYPZg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NDFxg++eD1+RNatg0LEkYVk+fTXxx1+fMgnRzfGeuOc=; b=oN/FAEjxiL+5A773wJcoLFvl/ODf/T0tFrHTN8FIa+mrHex2LNZZa8cFGgs2qd7XvE c550HKWPH6OUIfGF0Y4AMs79K5R0FVIylfWzvBVdEr2kMzxJB6qJoNZRYo7XmBPFZqsb XyMjapGX5GDMm9lqEoiikbAONYwuITg8/w20QhLWHrFvXbJZALhYhnoXwm2McDE2t8JZ R6Au66Ks86YU6U2do5sErrgbD/T1e52gSnEK2i+jfok8RHwBNIA5gn+1S8qBGyHGFLWI PKMUJ/O7eMwhM10YaC3boBA+DuXvUBDKSZ4gm8tm+rpayTk7KGencw2TFg+5zDA1yOQv j2mA== X-Gm-Message-State: AGi0Pub7u2WA6TwPHz4URjZx8oh/xlDhM+QUOVrDuMsIjhXcFPOD4jSk 3Q27a+AzRVhR7mVozizi0xAeb4Oygsc= X-Received: by 2002:a17:90a:e38c:: with SMTP id b12mr1158873pjz.102.1588139090096; Tue, 28 Apr 2020 22:44:50 -0700 (PDT) Received: from pmalani2.mtv.corp.google.com ([2620:15c:202:201:476b:691:abc3:38db]) by smtp.gmail.com with ESMTPSA id 141sm79944pfz.171.2020.04.28.22.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 22:44:49 -0700 (PDT) From: Prashant Malani To: linux-kernel@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, bleung@chromium.org, Prashant Malani , Greg Kroah-Hartman , linux-usb@vger.kernel.org (open list:USB TYPEC CLASS) Subject: [PATCH v2] usb: typec: mux: intel: Handle alt mode HPD_HIGH Date: Tue, 28 Apr 2020 22:44:28 -0700 Message-Id: <20200429054432.134178-1-pmalani@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the PMC Type C Subsystem (TCSS) Mux programming guide rev 0.6, when a device is transitioning to DP Alternate Mode state, if the HPD_STATE (bit 7) field in the status update command VDO is set to HPD_HIGH, the HPD_HIGH field in the Alternate Mode request “mode_data” field (bit 14) should also be set. Ensure the bit is correctly handled while issuing the Alternate Mode request. Signed-off-by: Prashant Malani Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control") --- Changes in v2: - Clarified the commit message to mention the proper field names. drivers/usb/typec/mux/intel_pmc_mux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index f5c5e0aef66f..c599112559e7 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -157,6 +157,10 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << PMC_USB_ALTMODE_DP_MODE_SHIFT; + if (data->status & DP_STATUS_HPD_STATE) + req.mode_data |= PMC_USB_DP_HPD_LVL << + PMC_USB_ALTMODE_DP_MODE_SHIFT; + return pmc_usb_command(port, (void *)&req, sizeof(req)); } -- 2.26.2.303.gf8c07b1a785-goog