Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1573002ybj; Fri, 8 May 2020 04:40:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJzp9xqnxq5nnupvAOWE1BhCR8qkfxqjD2VRZrVID1+/lPJmG0nbjV9qMKFtiAX1jCzWQ+i X-Received: by 2002:a17:906:340a:: with SMTP id c10mr1543900ejb.218.1588938046657; Fri, 08 May 2020 04:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588938046; cv=none; d=google.com; s=arc-20160816; b=ZlzTFGs9/I+DflgkDThcyemGJ15aWphrczFSadTreMAaF/AfvfBIAE53VSM4cjuq+p iXSFtmq9PAyAfxO466afMVaAH47WVjSc30eyOjw8dhiWW6QDs9vS3NRs09yND19c+gA2 lmtUYh1oxBar/a36FGOP2bMF/+D3HTW1W0PyNln6Q1ZSpU5a5WvfL0wkNMoRxordPUtn hahVaEfuATz68qYrJHCTySCCr01rEq5OxtWrFvKke+hNBFOm3QlQHj3hgMwQyFiXPPGC F0Yww+dsfs0ziaW57fv89AiLsdqB6eFZaHFZSZ/KOHnK1I9h67Li7mr41qnia0+VeJtN oZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xG/oTmVNvsSrVAKyKn0GG7fP0wz/voKoWWtsagHKWks=; b=JgkkgqyuZiePKfn5tfoYdm6bM6Nh3DGVKhi5cArs7f4Yp3NwoyVmHNOggMePvqfHzP prLOwAb9aDFOvEZImlMor1ez1JawQyxOfb2HHamkVOQ6u+wLEqkOKQg8igoCUTzKy+F4 iwrj8hD1xtA/X36LaIt3ljzvA4Mxgs8Qa0Ua4HtdZRsQmmt4oiwPGEjDX0ETvsAkH20Y fFz9yEifQh4hG56dovTnyRctKlNK/CsnDZP9EYxnNuPpXU3vmHx//zx5gc4htHu5fW9M SDTd2QjTRDSa5V8qzm032s6pCsHA2YBLC6tOWaWUDt9rfzIIQjaK9IJwvmBh2TtmxxYa tKtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=W1zZ1SHm; 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 dn17si989188ejc.311.2020.05.08.04.40.23; Fri, 08 May 2020 04:40:46 -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=W1zZ1SHm; 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 S1726864AbgEHLg4 (ORCPT + 99 others); Fri, 8 May 2020 07:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726690AbgEHLgz (ORCPT ); Fri, 8 May 2020 07:36:55 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB07BC05BD09 for ; Fri, 8 May 2020 04:36:54 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id r14so820430pfg.2 for ; Fri, 08 May 2020 04:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xG/oTmVNvsSrVAKyKn0GG7fP0wz/voKoWWtsagHKWks=; b=W1zZ1SHmI2Ggfi1Ayr4ozVYtK2iuT8r+74rAm5ZyvFqZalCMq2gcmRIvtkUzqyS+mj PaNmE2v+/aR1B8wUfixjzKlek1GOHGl+mvLQsQpJR1WpwH+9lzdA9IO/BJHK0qYLH9q6 QxOQmJYFsuiIyR/FrfTlGrZANhUfvzr3R4QSU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xG/oTmVNvsSrVAKyKn0GG7fP0wz/voKoWWtsagHKWks=; b=Yy1S7SWxA5czjhNBiHFC8tjDTPIOU109DBBzk8DtzlDAgh/GvwfOjAtd2AR4tnORhm OVDp2QWnNdd+nm/uNPTk/gjptyeYrMC1FeH7yYC/0cjBgs8LgTqq8HDjdDaH3xir4otF NgcBH5nCgDMxPzYJ7c9TMQuPhHAQfxPt+jOnNFCMy+ue3HPz1X4Lg392iPTv9iGKZoKA pre19WMFgPLZCfitOUXWlxHh9QaC1qn07o1FjOuXNAiwq6J/rnmqpj8ADHY4inI0ZCxq j4AvYGCX01gU62TIJLl2re5Euu5prbDGneZXM/ltdyguYMm1SCzenzXv2NC87NoRG3nB 2sUA== X-Gm-Message-State: AGi0PuZrjebrZKxXXVvDzwrMIkibCBoY78YJHERv4sYzT3/6OidA0hRD HJAt6euwXHTyHVlpJQDNvNJBHQ== X-Received: by 2002:a62:76c3:: with SMTP id r186mr2454835pfc.190.1588937814083; Fri, 08 May 2020 04:36:54 -0700 (PDT) Received: from google.com ([2620:15c:202:201:476b:691:abc3:38db]) by smtp.gmail.com with ESMTPSA id a12sm1615001pfr.28.2020.05.08.04.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 04:36:53 -0700 (PDT) Date: Fri, 8 May 2020 04:36:52 -0700 From: Prashant Malani To: Heikki Krogerus Cc: Greg Kroah-Hartman , Benson Leung , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH 2/4] usb: typec: mux: intel_pmc_mux: Support for static SBU/HSL orientation Message-ID: <20200508113652.GA34001@google.com> References: <20200507150900.12102-1-heikki.krogerus@linux.intel.com> <20200507150900.12102-3-heikki.krogerus@linux.intel.com> <20200507224041.GA247416@google.com> <20200508111840.GG645261@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508111840.GG645261@kuha.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 02:18:40PM +0300, Heikki Krogerus wrote: > Hi Prashant, > > On Thu, May 07, 2020 at 03:40:41PM -0700, Prashant Malani wrote: > > > +static int sbu_orientation(struct pmc_usb_port *port) > > > +{ > > > + if (port->sbu_orientation) > > > + return port->sbu_orientation - 1; > > > + > > > + return port->orientation - 1; > > > +} > > > + > > > +static int hsl_orientation(struct pmc_usb_port *port) > > > +{ > > > + if (port->hsl_orientation) > > > + return port->hsl_orientation - 1; > > > + > > > + return port->orientation - 1; > > > +} > > > + > > > static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) > > > { > > > u8 response[4]; > > > @@ -151,8 +170,9 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) > > > > > > req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT; > > > req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; > > > - req.mode_data |= (port->orientation - 1) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; > > > - req.mode_data |= (port->orientation - 1) << PMC_USB_ALTMODE_ORI_HSL_SHIFT; > > > + > > > + req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT; > > > > I'm curious to know what would happen when sbu-orientation == "normal". > > That means |port->sbu_orientation| == 1. > > > > It sounds like what should happen is the AUX_SHIFT orientation > > setting should follow what |port->orientation| is, but here it > > looks like it will always be set to |port->sbu_orientation - 1|, i.e 0, > > even if port->orientation == TYPEC_ORIENTATION_REVERSE, i.e 2, meaning > > it should be set to 1 ? > > I'll double check this, and get back to you.. > > Thanks a lot for reviewing this. If you guys have time, then please > check also that the documentation I'm proposing in patch 3/4 for this > driver has everything explained clearly enough, and nothing is missing. > Sure thing, we'll take a look. Best, -Prashant > Br, > > -- > heikki