Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5887273imm; Tue, 12 Jun 2018 15:19:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLg0jCCn5Aqv4uRTmVXlxs6J2BIF8Ol0yXZHVqONPIfLL82zg98Pv2qlSUgLvU0FJqBTs8a X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr2382062plb.266.1528841999796; Tue, 12 Jun 2018 15:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528841999; cv=none; d=google.com; s=arc-20160816; b=KSsBYcXGg5o15VIxo6YbkyKZlVzObif5rGFkNVMEjfbE62CmJs0uonOC5teUnYAipe iPCPL60kc3kgdUlgc/KiQBB6iET0C9hnbu9XaZocqWCRpugE28+jyoTW5h+V9ARtQdQR Cx8qhE3zizPX978NRXZxGGjZyJd4b4H/x4PFBrecjHBg0/KEp1G0uo9c+rkgN4DtwMgb 7U5Dd1/ps47Lik0um5SMZkVhjfaFKQs9EUsQNYlVljRLr3G2Q8DPo8Eq2c6Q4D+BaOOG 6Ox2s1vQPHeN//jKU6/JU0wP65FLWzmUdcGBPmUPFxfL/gKZDbzoMimx5d8sTe1ck1Oz Zn0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KdcxnL/V87t3c8oEU7atZCCB7zx8+qjs4i7aG7vUVog=; b=qylWVdRaSfCu9gE+x8Gz3KObpT+fYfD5JPHkavQW4zqaHLuA82tDjSZI6+JCr06u9x U1iqh/hOTROImQgXLFDUQoHkAYWOZyEJZmxEyY7a8C6G7bgf95glH3qQTRElyLW+5fT0 OX0xr4lYOYDUl6j5wbM87CRJlle89jd2LH1Hv5gM9up9mS3Oblo91gLD0LC+fF2ECVNp SVOiJz/892ybKQ5fXGiok+/MhAcv1gVUK9iVi/UoURPUy5bfVGPyTBrr4gNet+g1G4oF Ml6l/8gJojGVn7PDKQBLjvGuCTAbd+oTtgksfbrXUsq/Kfwh+vlYegRHLsMc+dAVIlSt lHcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b="bHIt/Jwu"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si837614pge.676.2018.06.12.15.19.45; Tue, 12 Jun 2018 15:19:59 -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; dkim=fail header.i=@roeck-us.net header.s=default header.b="bHIt/Jwu"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934880AbeFLWSq (ORCPT + 99 others); Tue, 12 Jun 2018 18:18:46 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:48546 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934377AbeFLWSp (ORCPT ); Tue, 12 Jun 2018 18:18:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KdcxnL/V87t3c8oEU7atZCCB7zx8+qjs4i7aG7vUVog=; b=bHIt/JwuqoNryVNZ+Qg5s5AM/9 6viJ9tMaC9ZEYbS0/R5qeKqatp4mzk2/xVg+3XlzZPjlXNTAlJQyuqpBIu27TY52giASP6L87lvKe fdbIif7DD2BwC2zE6FgGFWn43aUa/NFODs2cwG5yxoXawSOLT2u5yexTwFbLJLcPP+X3hdE/KGfJ1 1QcwdkLPA3ot47gb5RZ3AD3Ex14mxFVRCLoxGGPt/buxeKYpPrxEd1tKf0Dhg2KiAywZIdsfansm3 oP8WJo3DiVpDLyC/YDcQ+9kr4pIWRnjF8LoUyTW9P72QJDJKx3dgmyrzwNfbrpSjaLThib86cGmGP E+/WEXGw==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48194 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.89) (envelope-from ) id 1fSrch-005kpE-50; Tue, 12 Jun 2018 22:18:44 +0000 Date: Tue, 12 Jun 2018 15:18:42 -0700 From: Guenter Roeck To: Mats Karrman Cc: Heikki Krogerus , Hans de Goede , Greg Kroah-Hartman , Jun Li , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v4 2/8] usb: typec: helper for checking cable plug orientation Message-ID: <20180612221842.GA16275@roeck-us.net> References: <20180608112941.26332-1-heikki.krogerus@linux.intel.com> <20180608112941.26332-3-heikki.krogerus@linux.intel.com> <595c8953-040a-5697-0f79-ea6622d88bcb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <595c8953-040a-5697-0f79-ea6622d88bcb@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 08:56:31PM +0200, Mats Karrman wrote: > Hi Heikki, > > On 2018-06-08 13:29, Heikki Krogerus wrote: > > >This adds function typec_get_orientation() that can be used > >for checking the current cable plug orientation. > > > >Signed-off-by: Heikki Krogerus > >--- > > drivers/usb/typec/class.c | 11 +++++++++++ > > include/linux/usb/typec.h | 1 + > > 2 files changed, 12 insertions(+) > > > >diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > >index 53df10df2f9d..02db9bcbac0c 100644 > >--- a/drivers/usb/typec/class.c > >+++ b/drivers/usb/typec/class.c > >@@ -1279,6 +1279,17 @@ int typec_set_orientation(struct typec_port *port, > > } > > EXPORT_SYMBOL_GPL(typec_set_orientation); > >+/** > >+ * typec_get_orientation - Get USB Type-C cable plug orientation > >+ * @port: USB Type-C Port > >+ * > >+ * Get current cable plug orientation for @port. > >+ */ > >+enum typec_orientation typec_get_orientation(struct typec_port *port) > >+{ > >+ return port->orientation; > >+} > > +EXPORT_SYMBOL_GPL(typec_get_orientation); > > Isn't this a candidate for an inline? > Currently struct typec_port is class private. To make this function inline, struct typec_port would have to be moved from drivers/usb/typec/class.c to include/linux/usb/typec.h. That doesn't sound like a good idea to me. Guenter > BR // Mats > > >+ > > /** > > * typec_set_mode - Set mode of operation for USB Type-C connector > > * @port: USB Type-C port for the connector > >diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h > >index 672b39bb0adc..a5f6433e218b 100644 > >--- a/include/linux/usb/typec.h > >+++ b/include/linux/usb/typec.h > >@@ -265,6 +265,7 @@ void typec_set_pwr_opmode(struct typec_port *port, enum typec_pwr_opmode mode); > > int typec_set_orientation(struct typec_port *port, > > enum typec_orientation orientation); > >+enum typec_orientation typec_get_orientation(struct typec_port *port); > > int typec_set_mode(struct typec_port *port, int mode); > > #endif /* __LINUX_USB_TYPEC_H */ > >