Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp734039imw; Wed, 13 Jul 2022 07:07:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sEQ2DAC4H9gLmF4SnyjU2k9H+3j/j6hkI86OM08pc0BThEMEEu9SZi9VBLqELxdha6VKr+ X-Received: by 2002:a05:6a00:140d:b0:52a:d561:d991 with SMTP id l13-20020a056a00140d00b0052ad561d991mr3541345pfu.46.1657721221008; Wed, 13 Jul 2022 07:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657721221; cv=none; d=google.com; s=arc-20160816; b=yKGNxLdIkjtpentgBmwBsyg8km6JHhZPYd8SY7Gs8aenKBXN0arf+RSksQaYTABr8D cqpILmJYKNeHBY3izaxGwUgGuZ/5Cr1+83wel6VG5NF0JvQl8nBLzJ/IXIYFiLbW5996 lDWh0dmidl2YbW8/+uSCRrozwoePrP5tukqKAdYBrihUZ5ikPiV16Psa1MdkgAux1Ios /EZTENQVzls3pTcoxSIDkkHlIL6ctecvN6lNcn1c3b5r8Zluhm/QS22TL9ZBvTql8XT0 ACkpRvTl64ZW1/4g/ShEp4rRjZ5UmzD8yCutF2h7YDYIv5mjhPSuh00EvtVmk57PPHej BYTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OYKoXtQBi+UHHvlNJzsiB51zZLZoDshebAIvkG4Ze80=; b=kWw+/ELAi6gwJBX7Jb0wOskNYv8YD8VL3M35YL7ZgLMvgzC0Bw/GgQ2b2DAZVAOpEk uycZ/F2RE6Z7Yuc6Go5LfEaVxh5rNYKGoTWfOk8IihqWVi4g2Drey3PoGOxO4rXIjLH9 xALcsShu36sDydGNAsjy7DlMxBq2CWyf3kiwY75/GDqf3r/ftBT3HfyM5Pfm940ITE65 YLiW2JHI/DLhDJZSC+XTn3Ljl6as/3bSLoPPtNCgZqlBYSTmkbIEcBQ+EEeAiAA4sr+A 2QHpnJ1VbEIdWgF4cRtsHpNje1XM88Xezmgz7tijzO2lArpLq5YjSVyHnByeHYtV8kg2 RGGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=h9bIngDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg14-20020a056a02010e00b0040d9515987asi19185949pgb.62.2022.07.13.07.06.49; Wed, 13 Jul 2022 07:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=h9bIngDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234412AbiGMNf7 (ORCPT + 99 others); Wed, 13 Jul 2022 09:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiGMNf6 (ORCPT ); Wed, 13 Jul 2022 09:35:58 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B882DBE; Wed, 13 Jul 2022 06:35:57 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id t25so19107017lfg.7; Wed, 13 Jul 2022 06:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OYKoXtQBi+UHHvlNJzsiB51zZLZoDshebAIvkG4Ze80=; b=h9bIngDNE7y+/fKX/oHw7+azOdfnTz2i7MgBHs5a3O0NBQRb9Jhkr8NN2D43RoxyaQ JfUUqNxRf2r2xyx2nr4o8UNpakeH0ch8O8dWrBQI6SYIqEOWBlqDbVQ3TBs4GPXW6srI p5ZXpOypyN4OimKhc5jlB186gygVDd4N0/Qii6mfN6TSSuKSh/11YEtz9bf/yameG/xy iC6f3xvZ8U3eAj68RJBuEiLDxNrnb0yGrSf/Qbvq9YIypvHGX/XJ+oApN9+olMdZ0pQA sSJA4NHPhXzcg87Q+SzqCMW0+e0mS4OdDvc7z5y6nJuyk6I2OyYTaAh7tLbCfJJadw7b srWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OYKoXtQBi+UHHvlNJzsiB51zZLZoDshebAIvkG4Ze80=; b=sHpyXunXcCHoe1R6i9d135KDjTkN6nj9DVM1RPIQCc4RiMjHHXauHsxjqQ4n4hrYMT n9jhprhvrp2NyooBaTFeFVOEEH9nWgO1ztWPhmnJCmPIrWjLaCnvX3vyo8i42v5hxRi1 Ctr/ef92iWADGCNvod0n1iqg4yrvtvdQRAk5GMrn5vnN8hZcn6/46/ft4OYiDIR00bke IN2Y1Y1HlYt4JMRzt1fzFxZXkK18Filwkmw2QITIN7G/gi7uPy7H5Wj8jxzcgxr3FZYJ kQ7Jj8YX3ghWsJUVFCzr84Eq0boH7+1bH2oKaYKEwOVaiVFpQRdskg1hsx+wS+aASI2z efNw== X-Gm-Message-State: AJIora8Q3m4WVGorp60fYjgM2c4i+0ZoHKqdA4tesvHgDKTHBEcX1AW+ BEpbDS4t6+QGeb70MXFcDkGbqf05Ov4IyOQ3wDo= X-Received: by 2002:a05:6512:2382:b0:48a:24d:51cc with SMTP id c2-20020a056512238200b0048a024d51ccmr1936006lfv.108.1657719355396; Wed, 13 Jul 2022 06:35:55 -0700 (PDT) MIME-Version: 1.0 References: <20220710102110.39748-1-tmaimon77@gmail.com> <20220710102110.39748-3-tmaimon77@gmail.com> <95d12b72-be9d-5503-c4ea-801303bb7776@linaro.org> In-Reply-To: <95d12b72-be9d-5503-c4ea-801303bb7776@linaro.org> From: Tomer Maimon Date: Wed, 13 Jul 2022 16:35:43 +0300 Message-ID: Subject: Re: [PATCH v1 2/2] pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver To: Krzysztof Kozlowski Cc: Avi Fishman , Tali Perry , Joel Stanley , Patrick Venture , Nancy Yuen , Benjamin Fair , Linus Walleij , Rob Herring , Krzysztof Kozlowski , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , zhengbin13@huawei.com, OpenBMC Maillist , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , devicetree Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, Thanks for your comments. On Tue, 12 Jul 2022 at 12:50, Krzysztof Kozlowski wrote: > > On 10/07/2022 12:21, Tomer Maimon wrote: > > Add pinctrl and GPIO controller driver support to Arbel BMC NPCM8XX SoC. > > > > Arbel BMC NPCM8XX pinctrl driver based on Poleg NPCM7XX, except the > > pin mux mapping difference the NPCM8XX GPIO supports adjust debounce > > period time. > > > > Signed-off-by: Tomer Maimon > > (...) > > > + > > +static int npcm8xx_pinctrl_probe(struct platform_device *pdev) > > +{ > > + struct npcm8xx_pinctrl *pctrl; > > + int ret; > > + > > + pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); > > + if (!pctrl) > > + return -ENOMEM; > > + > > + pctrl->dev = &pdev->dev; > > + dev_set_drvdata(&pdev->dev, pctrl); > > + > > + pctrl->gcr_regmap = > > + syscon_regmap_lookup_by_compatible("nuvoton,npcm845-gcr"); > > No. Use property. By this patchset, I would expect that you learnt from > previous mistakes around this. Why repeating the same trouble second time? You suggest to use phandle property like nuvoton,sysgcr even that the NPCM8XX pin controller driver is used only NPCM8XX SoC, so the only GCR node in the NPCM8XX SoC is nuvoton,npcm845-gcr? > > > + if (IS_ERR(pctrl->gcr_regmap)) { > > + dev_err(pctrl->dev, "didn't find nuvoton,npcm845-gcr\n"); > > + return PTR_ERR(pctrl->gcr_regmap); > > + } > > + > > + ret = npcm8xx_gpio_of(pctrl); > > + if (ret < 0) { > > + dev_err(pctrl->dev, "Failed to gpio dt-binding %u\n", ret); > > + return ret; > > + } > > + > > + pctrl->pctldev = devm_pinctrl_register(&pdev->dev, > > + &npcm8xx_pinctrl_desc, pctrl); > > + if (IS_ERR(pctrl->pctldev)) { > > + dev_err(&pdev->dev, "Failed to register pinctrl device\n"); > > + return PTR_ERR(pctrl->pctldev); > > + } > > + > > + ret = npcm8xx_gpio_register(pctrl); > > + if (ret < 0) { > > + dev_err(pctrl->dev, "Failed to register gpio %u\n", ret); > > + return ret; > > + } > > + > > + pr_info("npcm8xx Pinctrl driver probed\n"); > > > No pr_ in devices. No success debug messages. > > > + return 0; > > +} > > + > > +static const struct of_device_id npcm8xx_pinctrl_match[] = { > > + { .compatible = "nuvoton,npcm845-pinctrl" }, > > + { }, > > +}; > > +MODULE_DEVICE_TABLE(of, npcm8xx_pinctrl_match); > > + > > +static struct platform_driver npcm8xx_pinctrl_driver = { > > + .probe = npcm8xx_pinctrl_probe, > > + .driver = { > > + .name = "npcm8xx-pinctrl", > > + .of_match_table = npcm8xx_pinctrl_match, > > + .suppress_bind_attrs = true, > > + }, > > +}; > > + > > +static int __init npcm8xx_pinctrl_register(void) > > +{ > > + return platform_driver_register(&npcm8xx_pinctrl_driver); > > +} > > +arch_initcall(npcm8xx_pinctrl_register); > > + > > +MODULE_LICENSE("GPL v2"); > > +MODULE_AUTHOR("tomer.maimon@nuvoton.com"); > > +MODULE_DESCRIPTION("Nuvoton NPCM8XX Pinctrl and GPIO driver"); > > > Best regards, > Krzysztof Best regards, Tomer