Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5706220imm; Tue, 12 Jun 2018 11:57:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSzWqGADPi9tj0t+O+YREHdZl6L1EmzVCUIXd0fB46DdktswyFF8wUhtbEqst2cbDOzAil X-Received: by 2002:a17:902:369:: with SMTP id 96-v6mr1761139pld.64.1528829836010; Tue, 12 Jun 2018 11:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528829835; cv=none; d=google.com; s=arc-20160816; b=NnaktW7zs3tI6Len0sUzOU8txxvp5XRW5lX3TMyl2IPJ7NWFqMVcfwKlz8/5/nKMkA 6qP+33br4UVeFOwHlAmugiWHbeXLq+r0HjCrbQhB8gKtaKGZQWkVUvpcuscLXR7QRP42 GBv6r4CuDn8vXFyGfuuZngT+DmZaMHQ/uXF9BMiEwVk6htHhJnkeoH1qQDCGVDUN4lQi 2cIbe94y2u9lk1prey0OfQbJwsjpwoJXFSpGlGSQbOk+COLxopU4AXE0psDV1YJi6Ufm 0f3d77s6Km11w4AHacW6Qg/c6pXP5x+4+ZPi6Yus3MJteDB54Tb1Tibs0c+WkfYZ/6yE 947A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=F45+7eMwaB1PS2GbhzxNHdboD5CR51q523s4loyzq/c=; b=rBrW5JUSg8dMvPFW5M0clHsn9YMFDQPZdmq8xMbBfgH795QNBkH+peImTTUI9QfzYM HUqWvU4yqZaZepm4rS/1glglw4fJFXdGVaru907yEemkqypIzZDRgui5HzfYYixY/BsC j3zLZgDrgK/4lVBYpjzEzacgfok1MQ+35mi6g3mpSKH3Tf6w1UmwJiO0375xWSkGz57o NB6vDLDUvacb6CYyBwleQL2/WbKCLadJ2cv0TG50T1XoezH6BgavcJfOs99gGLBbbZT9 9mDJGsxkzU9b9bC/UjaTNoORY9GudIj25fRLEDWooGRVgMe6vBhprxIUlrYvCfL1/4cm GJjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sssua68m; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si704106plc.369.2018.06.12.11.57.01; Tue, 12 Jun 2018 11:57:15 -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=pass header.i=@gmail.com header.s=20161025 header.b=Sssua68m; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754288AbeFLS4f (ORCPT + 99 others); Tue, 12 Jun 2018 14:56:35 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:43724 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753979AbeFLS4e (ORCPT ); Tue, 12 Jun 2018 14:56:34 -0400 Received: by mail-lf0-f67.google.com with SMTP id n15-v6so9061lfn.10; Tue, 12 Jun 2018 11:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=F45+7eMwaB1PS2GbhzxNHdboD5CR51q523s4loyzq/c=; b=Sssua68mOWqq7dw+0NB4Sfeb4R7EHYtS7Ez0znsS5tInVYafJLqbIb8OIRZAL8XAze tmfvLXeLZfZTsVCScaXf/iP4+Cu0f1EGNgCu/E42E9VvBLDuNd6Itz+VUzABfJZFi7I4 r95wc9oMvpwFNKSX/KryajdgIhx4Leqif04Gi/UE9sSYwf1IfNIz+pfd+zyETy7OWrNy UTyBifNQMMA1Bb0qpLvs5VaM5CbMOYD5NkrivSPzfVoTPrmbnK/XWJ6s3TEaB0GuRj4F 0g9bZ6n6XJzY+w2uOmHI69WHxkwy/ozU6j1BmkU2fXxqXAq3oAGHLxLFEzwXG3kbk5cv WWSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=F45+7eMwaB1PS2GbhzxNHdboD5CR51q523s4loyzq/c=; b=umqNHyiCdQfIPoPV0+WLqLKrJobFvddG+yPmKBgpw+9t+tzfG4+gcEBrZfG89uUaYD zAw8kIuWletbiVnusHJ1kMI3Xgje5EXnhR/ynJCp9vjg5HD84LsEPP97tQuAVXnAJXwf AWIjR7e0n3GubIMffeHUeLOAwxTTur0hUiAWEkWRbVz7Ci4UL99mtF1xgA/mqHjztKs3 /pfVKA8+nITUr0JBkWCgScp9Zm6z0V/TuwGnmq2FRqDgXOuEmxR7BDr6LiD1LjGBjFvB dsTPTnoCgXr0bsF6/QTD9jUTaRHkiSTIrKYJbQhMv4BqIuGTEEINFiGZbJV4TlFH9FfM oVBA== X-Gm-Message-State: APt69E2cPMoQ5PTdKllUNuDNFxmQZgki/MiJAwTii/++Mk63xfMOL9IL dHQ/hbC2l8sXcdDdD7Ch0EDaKuFH X-Received: by 2002:a19:1714:: with SMTP id n20-v6mr906831lfi.54.1528829792732; Tue, 12 Jun 2018 11:56:32 -0700 (PDT) Received: from [192.168.1.232] ([195.84.96.49]) by smtp.gmail.com with ESMTPSA id y20-v6sm154751lfe.40.2018.06.12.11.56.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 11:56:32 -0700 (PDT) Subject: Re: [RFC PATCH v4 2/8] usb: typec: helper for checking cable plug orientation To: Heikki Krogerus , Guenter Roeck , Hans de Goede Cc: Greg Kroah-Hartman , Jun Li , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180608112941.26332-1-heikki.krogerus@linux.intel.com> <20180608112941.26332-3-heikki.krogerus@linux.intel.com> From: Mats Karrman Message-ID: <595c8953-040a-5697-0f79-ea6622d88bcb@gmail.com> Date: Tue, 12 Jun 2018 20:56:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180608112941.26332-3-heikki.krogerus@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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 */ >