Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp736134imm; Fri, 8 Jun 2018 04:32:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI8jnXXKLeF7NSP/LA6AQpOHoUd8l541ZNM2WcCTvP0biERlsrBXAL5Lg2kkXJEEA8ACEjj X-Received: by 2002:a17:902:4303:: with SMTP id i3-v6mr6382414pld.394.1528457564880; Fri, 08 Jun 2018 04:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528457564; cv=none; d=google.com; s=arc-20160816; b=fbDxGpHSlk2PvqnayzTtphu5Cd56/7i6+vVnJwUvzakRgd1/bFskddpcQuMVn1NnIo pJtt1HWE8gvRX5RMVu4MUVXjKaUlkH7yHKvfEmTTKiSiePpn6aO8vAxAbzCFbaymg4oV 67PZEwb3hJlpI0b+k3jD/k9Zj4+UYhFaKa51YL9I+kv3JwmeoikyUDPRj+vR/lwR0EVM CQiD5kOgDXmikjpFU5GYhHkikfz8UhUmZN6xv8kiAQr0VHzWR7tmeGIYbagrsLspqagC 59peYoynKPPhRsocWVPlFm9axVhWTm87aqog5Dz4FtrxLMJqCeDJEZTMYdtOp8IngHR/ dqbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=S8JpG4YDhxpDtOLXsFEJcmzTaZAib+GzeulJZ0v12H0=; b=sFqx4ek9cPQy3IhxQ4RyvYrabxUntXl5QkB57gN05QLHulWSXg4nTOzo/3XywtxAxA yH8FosA+DMvn1DDMYdXNynIbrvaDhBoCVjNC5etZeenmpG+DNv3oi8JjSx9DHtC5FHsr P3m9OkevxhDTRnJlxDpL4DcrSUkM+bJnfhXiis02QrFCpf7lB+gbgMI5e5yUV856t0bd RyYEsVi/gLeA+hBJ8KENtIR+U7UbEDMqYxQbHjtQctvFXSCYfdIG99RtWRdpvEJnkgX5 VsQCGBOn+4UwufXBXLRp2evbEJdBv83aAty7rpsOwv0V0N6J8ltmYVFOBoZH/6j3VrPb fLAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si56739787pld.215.2018.06.08.04.32.30; Fri, 08 Jun 2018 04:32:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753000AbeFHLad (ORCPT + 99 others); Fri, 8 Jun 2018 07:30:33 -0400 Received: from mga17.intel.com ([192.55.52.151]:32425 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbeFHLaB (ORCPT ); Fri, 8 Jun 2018 07:30:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 04:30:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="62389008" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Jun 2018 04:29:58 -0700 From: Heikki Krogerus To: Guenter Roeck , Hans de Goede Cc: Greg Kroah-Hartman , Jun Li , Mats Karrman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v4 7/8] usb: typec: pi3usb30532: Start using generic state values Date: Fri, 8 Jun 2018 14:29:40 +0300 Message-Id: <20180608112941.26332-8-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180608112941.26332-1-heikki.krogerus@linux.intel.com> References: <20180608112941.26332-1-heikki.krogerus@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of the tcpm specific mux states, using the generic USB type-c connector state values, and with DisplayPort using connector states defined for the DisplayPort Alt Mode. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux/pi3usb30532.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/mux/pi3usb30532.c b/drivers/usb/typec/mux/pi3usb30532.c index b0e88db60ecf..bcea242852f2 100644 --- a/drivers/usb/typec/mux/pi3usb30532.c +++ b/drivers/usb/typec/mux/pi3usb30532.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #define PI3USB30532_CONF 0x00 @@ -83,21 +83,24 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state) new_conf = pi->conf; switch (state) { - case TYPEC_MUX_NONE: + case TYPEC_STATE_SAFE: new_conf = PI3USB30532_CONF_OPEN; break; - case TYPEC_MUX_USB: + case TYPEC_STATE_USB: new_conf = (new_conf & PI3USB30532_CONF_SWAP) | - PI3USB30532_CONF_USB3; + PI3USB30532_CONF_USB3; break; - case TYPEC_MUX_DP: + case TYPEC_DP_STATE_C: + case TYPEC_DP_STATE_E: new_conf = (new_conf & PI3USB30532_CONF_SWAP) | PI3USB30532_CONF_4LANE_DP; break; - case TYPEC_MUX_DOCK: + case TYPEC_DP_STATE_D: new_conf = (new_conf & PI3USB30532_CONF_SWAP) | PI3USB30532_CONF_USB3_AND_2LANE_DP; break; + default: + break; } ret = pi3usb30532_set_conf(pi, new_conf); -- 2.17.1