Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1948314AbdDYOpA (ORCPT ); Tue, 25 Apr 2017 10:45:00 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:43183 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1948253AbdDYOow (ORCPT ); Tue, 25 Apr 2017 10:44:52 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=rf@opensource.wolfsonmicro.com Message-ID: <1493131461.4826.66.camel@rf-debian.wolfsonmicro.main> Subject: Re: [PATCH v2 12/18] gpio: madera: Support Cirrus Logic Madera class codecs From: Richard Fitzgerald To: Linus Walleij 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" Date: Tue, 25 Apr 2017 15:44:21 +0100 In-Reply-To: References: <1493050124-5970-1-git-send-email-rf@opensource.wolfsonmicro.com> <1493050124-5970-13-git-send-email-rf@opensource.wolfsonmicro.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.4.4-3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704250269 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1768 Lines: 47 On Tue, 2017-04-25 at 16:13 +0200, Linus Walleij wrote: > 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 > The range of gpio pins is a fixed property of the chip, and so is the combination of gpio+pinctrl drivers. I think the general principle of the DT maintainers is that DT should be used for things that the drivers don't already know and can't figure out. > With that this range should not even be needed. > Apart from that it looks pretty solid. > > Yours, > Linus Walleij