From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762816AbbA3RB4 (ORCPT ); Fri, 30 Jan 2015 12:01:56 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:11523 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114AbbA3RBz (ORCPT ); Fri, 30 Jan 2015 12:01:55 -0500 X-IronPort-AV: E=Sophos;i="5.09,492,1418112000"; d="scan'208";a="55808805" Message-ID: <54CBB901.9020709@broadcom.com> Date: Fri, 30 Jan 2015 09:01:53 -0800 From: Ray Jui User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Linus Walleij CC: Grant Likely , Rob Herring , Scott Branden , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , bcm-kernel-feedback-list , "devicetree@vger.kernel.org" Subject: Re: [PATCH 1/4] pinctrl: Broadcom Cygnus pinctrl device tree binding References: <1417131990-17954-1-git-send-email-rjui@broadcom.com> <1417131990-17954-2-git-send-email-rjui@broadcom.com> <54B01D44.5080601@broadcom.com> <54C1AE9F.3020407@broadcom.com> <54C1EEF3.4040406@broadcom.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/30/2015 6:18 AM, Linus Walleij wrote: > On Fri, Jan 23, 2015 at 7:49 AM, Ray Jui wrote: > >> I dig into the pinctrl framework code a bit more and found that I can >> use pinctrl_request_gpio from the GPIO driver and implement >> gpio_request_enable in the pinctrl driver. > > Yep :) ain't it nice. > >> The only problem I see now is that these APIs seem to expect the use of >> global GPIO numbers? > > No they don't, only if you use the deprecated pinctrl_add_gpio_range(). > > Instead, when you register your struct gpio_chip, use > gpiochip_add_pin_range() and this will use relative offsets > without relying on global GPIO numbers. > > This latter call replaces pinctrl_add_gpio_range(). > >> I hope I'm not missing something here? > > You're missing gpiochip_add_pin_range() ;) > > Yours, > Linus Walleij > Yeah, I realized this while implementing the driver, :) I'm now in the final testing/cleaning phase of both Cygnus pinmux and gpio/pinconf driver. I really appreciate that the pinctrl framework allows the two to work seamlessly with each other and at the same time provides the necessary interface to bridge the two, :) I should be able to send out the patches of the two drivers for review sometime next week. Thanks for the help! Ray