Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7721512ybc; Thu, 28 Nov 2019 23:52:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyD1xfLHboo53/ptTsU7hTFzHbviAVYx35dDer6SKuJHnK9UEDYSYQ1e8Bmrm8fMEEnwQgE X-Received: by 2002:aa7:c756:: with SMTP id c22mr42573099eds.25.1575013961727; Thu, 28 Nov 2019 23:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575013961; cv=none; d=google.com; s=arc-20160816; b=WVcWuH6/FBFRVuXtbL0I9SDQvfhtZV94Id1ZfGKTq0N3IsYuUB2r807GyDsVEeG/zo McQBq6UW8eEcDBD6NH0OqBwvCBkv1gbQFWWQCI9tAw4omGDYmEJugMihU14iB5N4SUh4 6RVE2RPqrgbiabYt9QVIxCNKsUvefElEWKXHyKnDI35WfB6maksry4vga0RkSO6lB+3b mHU51RKhbcLYxdLXKfGaF1MsXF6vT7ZqHQlWDHnyGwpcte4lM6ideSfszU3sxXbYxtzS GkuPzx4smpKnjferCwaVKeYBTUrDuUnJR5pqg3q9ZGly9ByssGs+4sJ2YgCTlStpzHsu BWXw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2l4lgxQfD8cytW32qv/UG2k1L/fyv7YIVSch3WA4Ngo=; b=CVqNC5tWHGJSP+Hm6dA1l00+W/1Bo/Dy24cVD8/W/G6wDTuvVcxfpS7RNbYxN5HpiM MTpHED/NcY4dDHSFdDpxTjlN2yckHXhdpWUtVSjigCjHwAA/FQdl9XJfb1UEmm/hKFBZ kAwkyaVGGUoJ0KPPONZH0GeIUbMkCIo1uixuCwn4uoQQE8U+i1JFclJqSKwZ5JUhCDiZ bPw1bcyPfEkGrrf+NID97MZ6iKoky/1eGIeyIroVdZSRYvbiOpY9YY/z6+tw/so6HJJH p3qCxn0FEz68LBv9DMYq5l/+kRw6skozRxkmmMVgM47xiwK1RryHhCy5AUIsXXWE4K/m KsaA== ARC-Authentication-Results: i=1; mx.google.com; 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 t19si13196491ejr.411.2019.11.28.23.52.17; Thu, 28 Nov 2019 23:52:41 -0800 (PST) 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; 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 S1726823AbfK2Huc (ORCPT + 99 others); Fri, 29 Nov 2019 02:50:32 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51741 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfK2Huc (ORCPT ); Fri, 29 Nov 2019 02:50:32 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iab2s-0003x1-FL; Fri, 29 Nov 2019 08:50:30 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iab2r-0002eU-Fz; Fri, 29 Nov 2019 08:50:29 +0100 Date: Fri, 29 Nov 2019 08:50:29 +0100 From: Marco Felsch To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Bartosz Golaszewski , linux-devicetree , Support Opensource , Linus Walleij , Liam Girdwood , Rob Herring , LKML , Mark Brown , Steve Twiss , kernel@pengutronix.de, Adam.Thomson.Opensource@diasemi.com, Lee Jones Subject: Re: [PATCH v2 1/5] gpio: add support to get local gpio number Message-ID: <20191129075029.gs42pdwehjarem6y@pengutronix.de> References: <20191127135932.7223-1-m.felsch@pengutronix.de> <20191127135932.7223-2-m.felsch@pengutronix.de> <20191128124942.4ddyi5eeclvxmqbg@pengutronix.de> <20191129074524.dipo37u6lv7vzfhc@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191129074524.dipo37u6lv7vzfhc@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:49:56 up 13 days, 23:08, 28 users, load average: 0.00, 0.04, 0.02 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-11-29 08:45, Uwe Kleine-König wrote: > On Thu, Nov 28, 2019 at 01:49:42PM +0100, Marco Felsch wrote: > > On 19-11-28 11:46, Bartosz Golaszewski wrote: > > > śr., 27 lis 2019 o 14:59 Marco Felsch napisał(a): > > > > > > > > Sometimes consumers needs to know the gpio-chip local gpio number of a > > > > 'struct gpio_desc' for further configuration. This is often the case for > > > > mfd devices. > > > > > > > > > > We already have this support. It's just a matter of exporting it, so > > > maybe adjust the commit message to not be confusing. > > > > Therefore I mentioned the consumers. > > > > > That being said: I'm not really a fan of this - the whole idea of gpio > > > descriptors was to make them opaque and their hardware offsets > > > irrelevant. :( > > > > I know therefore I added a driver local helper but this wasn't the way > > Linus wanted to go.. > > > > > > Signed-off-by: Marco Felsch > > > > --- > > > > drivers/gpio/gpiolib.c | 6 ++++++ > > > > include/linux/gpio/consumer.h | 10 ++++++++++ > > > > 2 files changed, 16 insertions(+) > > > > > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > > > > index 104ed299d5ea..7709648313fc 100644 > > > > --- a/drivers/gpio/gpiolib.c > > > > +++ b/drivers/gpio/gpiolib.c > > > > @@ -4377,6 +4377,12 @@ int gpiod_count(struct device *dev, const char *con_id) > > > > } > > > > EXPORT_SYMBOL_GPL(gpiod_count); > > > > > > > > +int gpiod_to_offset(struct gpio_desc *desc) > > > > > > Maybe call it: gpiod_desc_to_offset()? > > > > The function name is proposed by Linus too so Linus what's your > > oppinion? > > INAL (I'm not a Linus) but I wonder what the 'd' in gpiod stands for. > Assuming it already meand "desc" I'd prefer gpiod_to_offset. Yes, that was my assumption too. Regards, Marco > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-König | > Industrial Linux Solutions | https://www.pengutronix.de/ | > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |