Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp196996rdb; Mon, 18 Sep 2023 12:07:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHozB/Uoq85PnUfEGhaV7C8Pz/0O3CZfF4dktZbgPLOXJXR4GmHJL8aqf2wmj6+P1gEFk7r X-Received: by 2002:aca:1308:0:b0:3a7:5d6e:dcf8 with SMTP id e8-20020aca1308000000b003a75d6edcf8mr10692228oii.39.1695064062215; Mon, 18 Sep 2023 12:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695064062; cv=none; d=google.com; s=arc-20160816; b=Wh2x2VA8wXsIsznR6tNtOAWflgaCxN6xV7uk5zuWvyxT2oh5WND06Sf13znAuiEQ// eHnJo7HgcK0NtzFaK6pfybw8nsqnEpz2rq7JXuiuS1lT/gK6d8w4kgY+bhIXsIJldANx Luw24RhHHAMtuYOw7ymNTZAdO2dGXyH4lTKdBSMO7j6QFK3U5TpRi/i1LFy048G7WH3x JahNKe9FKsfsiVeDl0qcDnhakH6IOHXp9knx2sIGEtXAXlDT1PzWfqa7o9q8ILPxO1Wc LCWPFKsKw26/yNvhWjXQe9iEeG/rMUCtAHBVga2gCFi498wnWORRK/+qqe46kS+AYx89 XIJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=PIpUMSw/2404AMS4Yo5lxieSUrVtp4AW1CJFXc7BrJs=; fh=tg23kI/R0I7tQJ9Lw3TRyG/kkDPTlCB0rpWGjBEeiD4=; b=Y3Wp4Trpbmf8b5hBYKkq3ObZ2TScuSG1luevYqoAdXFARPDkiehW+7yzwaDtPB6XQT mbEEY4YARVgG3O3PJJLwzrDNzRPpg4IjhS/ZoR/rDpxwGGdNvTPTopPNpaww1js9Kcgq XztpmgO4P6Bkutdnqb25EIq1hw+JDn8taH0MxjUC2oiIZ3+z3xNVSO76jImN/rHQdV7X x7prwc/3jQ8Azt65tN9ldIz09xMOKdr36ebUkOaN0jZYTHTfljdjSiQpBlvqsTIqNmsL j6zP1GLbtA6X9D3GobQ/sBdy4itiMGHgg0GUEnaSKrtAKUpB6BeDMm5hFERAQU17dWw/ FMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=odhYABxa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bz32-20020a056a02062000b00577f80e6af0si8929095pgb.731.2023.09.18.12.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=odhYABxa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A2AD180CCD23; Mon, 18 Sep 2023 01:37:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233942AbjIRIgb (ORCPT + 99 others); Mon, 18 Sep 2023 04:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbjIRIfy (ORCPT ); Mon, 18 Sep 2023 04:35:54 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5718F8F; Mon, 18 Sep 2023 01:35:47 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 447DF20004; Mon, 18 Sep 2023 08:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695026146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PIpUMSw/2404AMS4Yo5lxieSUrVtp4AW1CJFXc7BrJs=; b=odhYABxaRFjWsbpVj+xwjaWnzsTPysdiTFLNxA143gxz1iv0ARdos2si28g0FvPNRJfsf0 igTTeSj9hOhAqT6WSZud7AhrNda9CqPeN5PToxzt17WLYZqrS7tcAk8lFN57RUn3qpNRhE axfLCMiY3kNHK6sZsERj4OZGA3JB2nhfkCfqOQC+MpQw43+dglF1J/3dgc4hzlfWktvcWT YpEl/Xnb2C0XOfhwkDTsXYka/KFGolot4npq0MbCNCidMtsN0Z0yYsupn3/3Xbc+g6cEOQ xEMnYzwq1m+uwdoUDuMZ5gO7ubkRx5I7/tiJ126KShCLAKMDSrnEnITmLJj8Rw== Date: Mon, 18 Sep 2023 10:35:40 +0200 From: Herve Codina To: Linus Walleij Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: Re: [PATCH v5 28/31] pinctrl: Add support for the Lantic PEF2256 pinmux Message-ID: <20230918103540.5902af4c@bootlin.com> In-Reply-To: References: <20230912081527.208499-1-herve.codina@bootlin.com> <20230912101505.225899-1-herve.codina@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 01:37:17 -0700 (PDT) On Tue, 12 Sep 2023 13:04:56 +0200 Linus Walleij wrote: > Hi Herve, > > thanks for your patch! > > On Tue, Sep 12, 2023 at 12:15 PM Herve Codina wrote: > > > The Lantiq PEF2256 is a framer and line interface component designed to > > fulfill all required interfacing between an analog E1/T1/J1 line and the > > digital PCM system highway/H.100 bus. > > > > This kind of component can be found in old telecommunication system. > > It was used to digital transmission of many simultaneous telephone calls > > by time-division multiplexing. Also using HDLC protocol, WAN networks > > can be reached through the framer. > > > > This pinmux support handles the pin muxing part (pins RP(A..D) and pins > > XP(A..D)) of the PEF2256. > > > > Signed-off-by: Herve Codina > > Reviewed-by: Christophe Leroy > > Signed-off-by: Christophe Leroy > > Nice to see this as a proper pin control driver! > > > drivers/pinctrl/pinctrl-pef2256-regs.h | 65 ++++++ > > drivers/pinctrl/pinctrl-pef2256.c | 308 +++++++++++++++++++++++++ > > Do you really need a separate header just for some registers? > But it's a matter of taste so I'm not gonna complain if you want > it this way. Will be move to the .c file in the next iteration. > > > +config PINCTRL_PEF2256 > > + tristate "Lantiq PEF2256 (FALC56) pin controller driver" > > + depends on OF && FRAMER_PEF2256 > > + select PINMUX > > select PINCONF Will be added in the next iteration. > > > + select GENERIC_PINCONF > > This brings it in implicitly but I prefer that you just select it. > > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > I think SPDX mandates that you start the tag with C99 comments Already replied by Mark, C style comment is correct -> No change. > > // SPDX-License-Identifier: GPL-2.0-only > > > + /* We map 1 group <-> 1 pin */ > > Also known as "the qualcomm trick", but hey: it's fine. > > > +static int pef2256_register_pinctrl(struct pef2256_pinctrl *pef2256) > > +{ > > + struct pinctrl_dev *pctrl; > > + > > + pef2256->pctrl_desc.name = dev_name(pef2256->dev); > > + pef2256->pctrl_desc.owner = THIS_MODULE; > > + pef2256->pctrl_desc.pctlops = &pef2256_pctlops; > > + pef2256->pctrl_desc.pmxops = &pef2256_pmxops; > > + if (pef2256->version == PEF2256_VERSION_1_2) { > > + pef2256->pctrl_desc.pins = pef2256_v12_pins; > > + pef2256->pctrl_desc.npins = ARRAY_SIZE(pef2256_v12_pins); > > + pef2256->functions = pef2256_v12_functions; > > + pef2256->nfunctions = ARRAY_SIZE(pef2256_v12_functions); > > + } else { > > + pef2256->pctrl_desc.pins = pef2256_v2x_pins; > > + pef2256->pctrl_desc.npins = ARRAY_SIZE(pef2256_v2x_pins); > > + pef2256->functions = pef2256_v2x_functions; > > + pef2256->nfunctions = ARRAY_SIZE(pef2256_v2x_functions); > > + } > > + > > + pctrl = devm_pinctrl_register(pef2256->dev, &pef2256->pctrl_desc, pef2256); > > + if (IS_ERR(pctrl)) { > > + dev_err(pef2256->dev, "pinctrl driver registration failed\n"); > > + return PTR_ERR(pctrl); > > + } > > + > > + return 0; > > You could use > return dev_err_probe(...); Indeed, I will change. > > > + pef2256_reset_pinmux(pef2256_pinctrl); > > + ret = pef2256_register_pinctrl(pef2256_pinctrl); > > + if (ret) > > + return ret; > > Or you could use it down here. > > With or without these changes (because they are nitpicks) > Reviewed-by: Linus Walleij > > Yours, > Linus Walleij Thanks for your comment. Best regards, Hervé