Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp617790ybg; Tue, 28 Jul 2020 14:26:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzD7zZ4uJ/a4TETOpgNAL75HLixCfvye1SVeUA6e815J/GmO+Y7byGWZ58zwqq+Gl9yziS X-Received: by 2002:a17:906:3281:: with SMTP id 1mr2392493ejw.132.1595971568433; Tue, 28 Jul 2020 14:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595971568; cv=none; d=google.com; s=arc-20160816; b=IDTjbURdWstNxEORJ1R1kNesPkq6mQ5SoWRhls2ldPafhl72EG1r3jF7WNsB6QDThi 2xiwFbTd/r7FiTZUlR9p48wfgRzRB1jmnyspsMvwvKhB7CUgQzuQ2qQB83NxhlGxWxv7 vodccLWo9yuonV4pJ3CtIYTG5wqcfkn8TNB9YscbT4QgqPlvXUnfh0GGiufADinefT0h GRydgn8b5p9EBZ5HFB4x17PZiL3uKTteJxdi9wnkW9DflfY8le0jh8Oq+cPeGxKY0mGm dP6fh6oKPoCTxfCM/slLOHgYa+HcruLiqM1ccyqbd5/+ASOJvkkDndhpW+GOY4kh1iHP D9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=GGMqk5adUFTDwUndte5jIz4577CMBHfhs/OxIbUw15w=; b=ytqWB3UvQ2xq6bIBxVfarzCdPf5O15agIcbNQradSTGVCiiw/d4bYKhUn2cPbjz6mp hldWwPGzV8j3+I1fB7nhQoGN4sWNv2TPjZNeXP6wDZgsDr8us7Dw+zp8Vhr1CWGeJXLG sjHaGJn66iyihXKIqcREyWr2yutZSF2aFy/BA3DurqAhwEN1yG2IUrXDNu8tOfOMXpec +TQ7WTWkQrLoUpMGyFR9ILLvRWFqxx041BLpomnulp8m2g6I7NUC7sHaxPc1ghKM3wCl ylfUUM/PElQsLOzuuVdjztzaV5PiMZJ4lLFEWiTn2ZwqWrckSeSRzE7EluM18vZIXHmi kOhA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk3si8973546ejb.323.2020.07.28.14.25.46; Tue, 28 Jul 2020 14:26:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729426AbgG1VYV (ORCPT + 99 others); Tue, 28 Jul 2020 17:24:21 -0400 Received: from mga12.intel.com ([192.55.52.136]:29354 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729243AbgG1VYU (ORCPT ); Tue, 28 Jul 2020 17:24:20 -0400 IronPort-SDR: Q0w5bOyuvgW6TaCV7LcTDMGUGzps+asVBwCOhzZbdt3qIJAFxixlGxO4nK6QCml+ke6tcsoAaE J83kdkT4Orhg== X-IronPort-AV: E=McAfee;i="6000,8403,9696"; a="130877351" X-IronPort-AV: E=Sophos;i="5.75,407,1589266800"; d="scan'208";a="130877351" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 14:24:20 -0700 IronPort-SDR: 0wRBq9msnHmGxyTaWt+3wdxaRXlmo5roR3jTrRyBuokoK0IJAe4p9uNhxDVrvv1bF2VhwDgGA/ RbW3zZEH+CVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,407,1589266800"; d="scan'208";a="490514452" Received: from otc-chromeosbuild-1.jf.intel.com ([10.54.30.83]) by fmsmga005.fm.intel.com with ESMTP; 28 Jul 2020 14:24:20 -0700 From: Azhar Shaikh To: bleung@chromium.org, enric.balletbo@collabora.com, groeck@chromium.org, pmalani@chromium.org, linux-kernel@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, azhar.shaikh@intel.com, utkarsh.h.patel@intel.com, casey.g.bowman@intel.com, rajmohan.mani@intel.com Subject: [PATCH] platform/chrome: cros_ec_typec: Send enum values to usb_role_switch_set_role() Date: Tue, 28 Jul 2020 14:24:46 -0700 Message-Id: <20200728212446.2699-1-azhar.shaikh@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org usb_role_switch_set_role() has the second argument as enum for usb_role. Currently depending upon the data role i.e. UFP(0) or DFP(1) is sent. This eventually translates to USB_ROLE_NONE in case of UFP and USB_ROLE_DEVICE in case of DFP. Correct this by sending correct enum values as USB_ROLE_DEVICE in case of UFP and USB_ROLE_HOST in case of UFP. Fixes: 7e7def15fa4b ("platform/chrome: cros_ec_typec: Add USB mux control") Signed-off-by: Azhar Shaikh Cc: Prashant Malani --- drivers/platform/chrome/cros_ec_typec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 3eae01f4c9f7..eb4713b7ae14 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -590,7 +590,8 @@ static int cros_typec_port_update(struct cros_typec_data *typec, int port_num) dev_warn(typec->dev, "Configure muxes failed, err = %d\n", ret); return usb_role_switch_set_role(typec->ports[port_num]->role_sw, - !!(resp.role & PD_CTRL_RESP_ROLE_DATA)); + resp.role & PD_CTRL_RESP_ROLE_DATA + ? USB_ROLE_HOST : USB_ROLE_DEVICE); } static int cros_typec_get_cmd_version(struct cros_typec_data *typec) -- 2.17.1