Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1431640AbdDYOOI (ORCPT ); Tue, 25 Apr 2017 10:14:08 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:36347 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1431337AbdDYON7 (ORCPT ); Tue, 25 Apr 2017 10:13:59 -0400 MIME-Version: 1.0 In-Reply-To: <1493050124-5970-13-git-send-email-rf@opensource.wolfsonmicro.com> References: <1493050124-5970-1-git-send-email-rf@opensource.wolfsonmicro.com> <1493050124-5970-13-git-send-email-rf@opensource.wolfsonmicro.com> From: Linus Walleij Date: Tue, 25 Apr 2017 16:13:57 +0200 Message-ID: Subject: Re: [PATCH v2 12/18] gpio: madera: Support Cirrus Logic Madera class codecs To: Richard Fitzgerald Cc: Lee Jones , Mark Brown , Alexandre Courbot , Rob Herring , Thomas Gleixner , Jason Cooper , "alsa-devel@alsa-project.org" , "open list:WOLFSON MICROELECTRONICS DRIVERS" , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1380 Lines: 37 On Mon, Apr 24, 2017 at 6:08 PM, Richard Fitzgerald wrote: > This adds support for the GPIOs on Cirrus Logic Madera class codecs. > Any pins not used for special functions (see the pinctrl driver) can be > used as general single-bit input or output lines. The number of available > GPIOs varies between codecs. > > Signed-off-by: Nariman Poushin > Signed-off-by: Richard Fitzgerald > Signed-off-by: Charles Keepax > --- > Changes from V1: > - dt bindings moved to a separate patch > - dependent on pinctrl driver instead of parent MFD > - added get_direction function > - added .request / .free / .set_config to work with pinctrl driver > - register range with pinctrl driver Nice, but... > + ret = gpiochip_add_pin_range(&madera_gpio->gpio_chip, "madera-pinctrl", > + 0, 0, madera_gpio->gpio_chip.ngpio); > + if (ret) { > + dev_warn(&pdev->dev, "Failed to add pin range (%d)\n", ret); > + return ret; > + } This is all fine, but we have generic code for adding ranges from the device tree, see Documentation/devicetree/bindings/gpio/gpio.txt With that this range should not even be needed. Apart from that it looks pretty solid. Yours, Linus Walleij