Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1941070rdb; Thu, 21 Sep 2023 04:21:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZF1IA6gqGQ40MR+BVnEuQX/nBHleJlwiQhJm+tmvM5gvXYoUxTJ5k9bolPyga0TtIg3kC X-Received: by 2002:a05:6a00:230c:b0:690:15c7:60d8 with SMTP id h12-20020a056a00230c00b0069015c760d8mr5816518pfh.22.1695295279746; Thu, 21 Sep 2023 04:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695295279; cv=none; d=google.com; s=arc-20160816; b=euoWg2x5JHPA9OwYTegmRKAXmxtKdFgcfc1pRnCVXkzQHT448EDd95QVkIRVJZV8eg BrtRTRHz/qBozJHbGwUhj7EosBTql8X4Ndm0G8+OlaMrAdFDx2rjmSoBzCXZCGcWc/o8 H5NJHeccY3y9GhEAfY9SnQchQhdAVJwrSbEnjBLa+QIsv9a/633fQCp/Fi1VwTqLUclu RXCSsN/MSvuv9h001gde+Kz2gLBW7Pbj515N6v3d0ICzQ3e4JCsS6PbTpkKb19MK4omo 4RZauTCIyclqIV6som3kPciUDr99X0NN802f2wj4RTuIwVh5DmDr9pN2EDiDaoSF3O4J j3hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2h7cs036UrR/eQjftEBWFTHYb+KQvYnSOLcHTnPuW8s=; fh=TYWxe9Gy0kdSVhFp0m2druWrTwSeuWjniP5Pz4cLowY=; b=g7VDraIHEOOdyOh//arBcvP720m0s2pP0udQ03Gt2mb1U2VfganU1Y6sEM2hxautNV iNDz73OjY/nPWF3TbhewJI3Ln/u6O4JntzC0Pk7ok9hKhjwZM2PeKW1Y2/PCfS3RgDQ0 DowZ5tGFvnGpDEuHkgV7ronE98fHSt5501/HpioOePT3xxt+JBT3BfsIsEN9FntTqkXd LjjyvwIMAu056ev/1EsKwgexavNP6784bR4stah0Rju0+d8uBvMxngmCy7VNVFNA/eXV Le+1HNiXGGbEEP2JLyUa9JrRqc6zmqkmoQ29uWhctHIuNqlfKDGwOVHcZSnHi1S+kiEZ +cmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OCK4EQGI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q25-20020a656859000000b00578ac88e239si1217012pgt.595.2023.09.21.04.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 04:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OCK4EQGI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DF9A68073DF2; Wed, 20 Sep 2023 02:10:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233753AbjITJKc (ORCPT + 99 others); Wed, 20 Sep 2023 05:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjITJKb (ORCPT ); Wed, 20 Sep 2023 05:10:31 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A93E91; Wed, 20 Sep 2023 02:10:25 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c012232792so46063511fa.0; Wed, 20 Sep 2023 02:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695201024; x=1695805824; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=2h7cs036UrR/eQjftEBWFTHYb+KQvYnSOLcHTnPuW8s=; b=OCK4EQGI1LT1YorN75EJHABksvlHSWHSVTHv+NyWB000qjc8D1gTneiJ5LrXiKfvrk YgkEpOsSZv6YulvqiSp+GlA5LC1VuCUOFCQheckjQGGxNObDIVWmxE5HhBaXW4xknXhW q2HRSEyERX+VapSf7ARM6ZqLMuxYVCV5tWkXVaTvpbBA0dyAapMufDnPgiEltHjsfpnJ /ch7XMXdlBbBNneUe2AZPOwtF2OGsw3CtONch34WE0P5TUNJmCpLiL3WNJW2/S1YqyZc bPauSUwrT0HDzNiJMVw20VeXzCsB0yahK6NMrqEqSIwZ1AT3O0Hcn9LSVppBRrAXMN6U fhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695201024; x=1695805824; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2h7cs036UrR/eQjftEBWFTHYb+KQvYnSOLcHTnPuW8s=; b=l3HCmOMktK2hYpkS+5TDtlpk0rcAf8NEZSmCbwhpa+bChDW7US+3sz9YX7B+5JxfKc 011W77dF4Y78YyyvfV4+iRq3oMw/EQefjKb9eElOygnAnnfotPofWud1uVHKchnKQJAw 83SmRDNcDJ53idrZmj6eMmsBJ/k9sF4YQIrjo9G866Uka+0X5+9IBRcVSR77lO0ftwYQ ITWpTbe+iOqmhLQZXNxxqZriIF2WJ99dg1nm27uXNbLtPlzAcL+s2ajMmsxNDQ2HS+vL 3SRA+gaNOistz9uAHxIp9KCW4IpgY/1fmi86dR0qPyuV2ePWu0W3zlxgH6DIj+DSw9kA BPkQ== X-Gm-Message-State: AOJu0YyHqsy9c/TNPqldVpErIAxLDAZ5R5WsB3ct+qI3Uyshk1XjWIey LrGQaIxEsDDUh77AiSw9cgw= X-Received: by 2002:ac2:5041:0:b0:503:2623:7cfc with SMTP id a1-20020ac25041000000b0050326237cfcmr1489636lfm.34.1695201023290; Wed, 20 Sep 2023 02:10:23 -0700 (PDT) Received: from [192.168.1.103] ([178.176.76.10]) by smtp.gmail.com with ESMTPSA id p12-20020ac246cc000000b004ff9ee35739sm2609505lfo.283.2023.09.20.02.10.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 02:10:22 -0700 (PDT) Subject: Re: [PATCH v4 5/5] usb: typec: intel_pmc_mux: Configure Displayport Alternate mode 2.1 To: Utkarsh Patel , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, pmalani@chromium.org, chrome-platform@lists.linux.dev, andriy.shevchenko@linux.intel.com, bleung@chromium.org References: <20230920023243.2494410-1-utkarsh.h.patel@intel.com> <20230920023243.2494410-6-utkarsh.h.patel@intel.com> From: Sergei Shtylyov Message-ID: <086a35c5-6402-3e3e-1ac4-fade2797b63a@gmail.com> Date: Wed, 20 Sep 2023 12:10:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20230920023243.2494410-6-utkarsh.h.patel@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 20 Sep 2023 02:10:42 -0700 (PDT) On 9/20/23 5:32 AM, Utkarsh Patel wrote: > Mux agent driver can configure cable details such as cable type and > cable speed received as a part of displayport configuration to support > Displayport Alternate mode 2.1. > > Reviewed-by: Andy Shevchenko > Reviewed-by: Heikki Krogerus > Signed-off-by: Utkarsh Patel > --- > Changes in v4: > - No change. > > Changes in v3: > - No change. > > Changes in v2: > - No change. > > drivers/usb/typec/mux/intel_pmc_mux.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c > index 60ed1f809130..233958084b43 100644 > --- a/drivers/usb/typec/mux/intel_pmc_mux.c > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c [...] > @@ -293,6 +299,24 @@ 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 (!is_pmc_mux_tbt(port->pmc->iom_adev)) { > + u8 cable_speed = (data->conf & DP_CONF_SIGNALLING_MASK) >> > + DP_CONF_SIGNALLING_SHIFT; > + > + u8 cable_type = (data->conf & DP_CONF_CABLE_TYPE_MASK) >> > + DP_CONF_CABLE_TYPE_SHIFT; > + > + req.mode_data |= PMC_USB_ALTMODE_CABLE_SPD(cable_speed); > + > + if (cable_type == DP_CONF_CABLE_TYPE_OPTICAL) > + req.mode_data |= PMC_USB_ALTMODE_CABLE_TYPE; > + else if (cable_type == DP_CONF_CABLE_TYPE_RE_TIMER) > + req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE | > + PMC_USB_ALTMODE_RETIMER_CABLE; > + else if (cable_type == DP_CONF_CABLE_TYPE_RE_DRIVER) > + req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE; Why not *switch* instead of string of *if*s? > + } > + > ret = pmc_usb_command(port, (void *)&req, sizeof(req)); > if (ret) > return ret; MBR, Sergey