Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1429466AbdDYK0e (ORCPT ); Tue, 25 Apr 2017 06:26:34 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:33022 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1429443AbdDYK0T (ORCPT ); Tue, 25 Apr 2017 06:26:19 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=rf@opensource.wolfsonmicro.com Message-ID: <1493115962.4826.51.camel@rf-debian.wolfsonmicro.main> Subject: Re: [PATCH v2 10/18] pinctrl: madera: Add driver for Cirrus Logic Madera 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 11:26:02 +0100 In-Reply-To: References: <1493050124-5970-1-git-send-email-rf@opensource.wolfsonmicro.com> <1493050124-5970-11-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=0 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-1704250189 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2262 Lines: 56 On Tue, 2017-04-25 at 11:41 +0200, Linus Walleij wrote: > On Mon, Apr 24, 2017 at 6:08 PM, Richard Fitzgerald > wrote: > > > These codecs have a variable number of I/O lines each of which > > is individually selectable to a wide range of possible functions. > > > > The functionality is slightly different from the traditional muxed > > GPIO since most of the functions can be mapped to any pin (and even > > the same function to multiple pins). Most pins have a dedicated > > "alternate" function that is only available on that pin. The > > alternate functions are usually a group of signals, though it is > > not always necessary to enable the full group, depending on the > > alternate function and how it is to be used. The mapping between > > alternate functions and GPIO pins varies between codecs depending > > on the number of alternate functions and available pins. > > > > Note on the Kconfig options: > > The formula "default y if..." is used for PINCTRL_MADERA so that its > > select options will be processed, allowing us to group selects for > > pinctrl into the pinctrl Kconfig where they logically belong instead > > of accumulating under the parent MFD Kconfig. > > > > Signed-off-by: Richard Fitzgerald > (...) > > > Changes since V1: > > This is starting to look good! > > In fact, kind of finished. Except: > > > + if (pdata) { > > + ret = pinctrl_register_mappings(pdata->gpio_configs, > > + pdata->n_gpio_configs); > > + if (ret) { > > + dev_err(priv->dev, > > + "Failed to register pdata mappings (%d)\n", > > + ret); > > + return ret; > > + } > > + } > > What is this? It looks like boardfile support which we do not like to > encourage. Why are the mappings not exclusively set up from > device tree or similar? > We want to work on systems that don't use DT for configuration, so we offer pdata as a fallback across all the drivers. In that case the configuration is defined as part of the parent pdata struct and this applies it. > Yours, > Linus Walleij