Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755863AbdDGJlz (ORCPT ); Fri, 7 Apr 2017 05:41:55 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:36869 "EHLO mail-it0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754958AbdDGJlq (ORCPT ); Fri, 7 Apr 2017 05:41:46 -0400 MIME-Version: 1.0 In-Reply-To: <20170402204244.14216-4-paul@crapouillou.net> References: <20170125185207.23902-2-paul@crapouillou.net> <20170402204244.14216-1-paul@crapouillou.net> <20170402204244.14216-4-paul@crapouillou.net> From: Linus Walleij Date: Fri, 7 Apr 2017 11:41:44 +0200 Message-ID: Subject: Re: [PATCH v4 03/14] pinctrl-ingenic: add a pinctrl driver for the Ingenic jz47xx SoCs To: Paul Cercueil , Lee Jones Cc: Alexandre Courbot , Rob Herring , Mark Rutland , Ralf Baechle , Boris Brezillon , Thierry Reding , Bartlomiej Zolnierkiewicz , Maarten ter Huurne , Lars-Peter Clausen , Paul Burton , James Hogan , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linux MIPS , "linux-mmc@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "linux-pwm@vger.kernel.org" , "linux-fbdev@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: 1921 Lines: 63 On Sun, Apr 2, 2017 at 10:42 PM, Paul Cercueil wrote: > This driver handles pin configuration and pin muxing for the > JZ4740 and JZ4780 SoCs from Ingenic. > > Signed-off-by: Paul Cercueil (...) > + select MFD_CORE (...) > +#include That's unorthodox. Still quite pretty! I would nee Lee Jones to say something about this, as it is essentially hijacking MFD into the pinctrl subsystem. > +static struct mfd_cell ingenic_pinctrl_mfd_cells[] = { > + { > + .id = 0, > + .name = "GPIOA", > + .of_compatible = "ingenic,gpio-bank-a", > + }, > + { > + .id = 1, > + .name = "GPIOB", > + .of_compatible = "ingenic,gpio-bank-b", > + }, > + { > + .id = 2, > + .name = "GPIOC", > + .of_compatible = "ingenic,gpio-bank-c", > + }, > + { > + .id = 3, > + .name = "GPIOD", > + .of_compatible = "ingenic,gpio-bank-d", > + }, > + { > + .id = 4, > + .name = "GPIOE", > + .of_compatible = "ingenic,gpio-bank-e", > + }, > + { > + .id = 5, > + .name = "GPIOF", > + .of_compatible = "ingenic,gpio-bank-f", > + }, > +}; (...) > + err = devm_mfd_add_devices(dev, 0, ingenic_pinctrl_mfd_cells, > + ARRAY_SIZE(ingenic_pinctrl_mfd_cells), NULL, 0, NULL); > + if (err) { > + dev_err(dev, "Failed to add MFD devices\n"); > + return err; > + } I guess the alternative would be to reimplement the MFD structure. Did you check the approach to use "simple-mfd" and just let the subnodes spawn as devices that way? I guess you did and this adds something necessary. Yours, Linus Walleij