Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2469238ybx; Fri, 8 Nov 2019 04:52:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzrEthc9n3+2xQxxFqc7jG6GIvvmBS5RKjIUoFj23vuT1J2Y/C9GC5A88GY4P2V8EfU+QAL X-Received: by 2002:a50:fc8e:: with SMTP id f14mr10060150edq.83.1573217534675; Fri, 08 Nov 2019 04:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573217534; cv=none; d=google.com; s=arc-20160816; b=T0nMuDhZAjgBadKu8ydYwQ0Q8bsekDbptW9bcf+KnnEL2JI9Lt7guN3TfExZNovViY qjYyIZ7CPEjjVUorE46Jwo9WX1Pl6bl2hsfx93zV08imTql5FW/D3HqDjftmyPnknTG9 iYZKrVmsJE3VBGz7/CnWvT7BJ60xjlGs4KNR2F84/CPSSSJgc6RLWrSQW+26+dVj8G9K 3hFJ4vhFo2PyzicfQESOCBk6SwBxrO9u32d6p+wOoHEiwLpGzyVSBfVFUvJKyIqTlmpP gk00gBcudjHE7wXwSma8D8OJBNmPU9cJJHrXgL/BxTkTTH1Um73N/HoJ0mY5V0derpMl wUrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:dkim-signature; bh=h1rRsM7+DRkVXx86Ozl4pcfkVOljAGPaOjgIAe0lUrs=; b=cpPVezNuPjgeOeRkEkDMCSxJGTfsp19mFy/ZNxCrVnNSg+KCD25Oew2amE3dsHW0lz 2vtN2wc1X/H8wWyePf8jjC4yUuSEkBRyt86H6DLxPsNpewmkkYFEDX5Ti57Fus3rgzsM CFZMyE/YKN5FJXJEb3KYvpHFQMogvOmjN91LfwftFI6sjklTtJjidelPGZ64eV0+n+4n aJt4HVL1ieaAfROqLOXqQM7u0Gci0qNu9p/igOH9aleKuSYS1bScTaHZg+ysjNC2vg6w mRyUGbkEflzTWv42x8xS9KyySqT8FYPEOSWga+diwtG4RvPNSxoTeqrFditueOKNlo/7 JkAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MDaKUWl7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si3504050eji.283.2019.11.08.04.51.50; Fri, 08 Nov 2019 04:52:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MDaKUWl7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbfKHMue (ORCPT + 99 others); Fri, 8 Nov 2019 07:50:34 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46893 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbfKHMue (ORCPT ); Fri, 8 Nov 2019 07:50:34 -0500 Received: by mail-wr1-f67.google.com with SMTP id b3so6887931wrs.13 for ; Fri, 08 Nov 2019 04:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=h1rRsM7+DRkVXx86Ozl4pcfkVOljAGPaOjgIAe0lUrs=; b=MDaKUWl7vQ2E8Biz6A/cpa/6O9ARQS37G0UClg+4Eu9xGrLQbpaNEHz8vaHUWBQl+a E5MpAOcAfnNnOrPO6P1/VzzPajttR3u+E1EIv7vXiE6hBp/pafyio9okvrBZYy8ntBAV aBxgJxtMKfUJvVRHM4iezNNoIiYzSGz75VLGr8dJbVm3p/P2F4fb/QHC9Ak1wuavedn+ sSGj3xR5MEO1Rn1i2ufhzDOU0dlcsxePZGDx+RmDG+3UU9VGml5GI6NPZfH4rP3HIAq/ voB8CTX3hrvqGgNAtFn4s8hyzNAzqxjkWudeNHGUV+HU9hJkjiAiDxs2XTzkFAUoWCYl mWnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=h1rRsM7+DRkVXx86Ozl4pcfkVOljAGPaOjgIAe0lUrs=; b=LCidKO5yIjWX0ajJUk1Iwdhp1GT/3qNb2tuns1pmxz6ER36ai5YL5csFcWhOyC8wy2 uC13b+jofFEQbpCpKNVfWIUFxydriX6QDPFfgf/uVyNvjFpFWfyexTDPly7xWqNN08Eu OTeXyXr3KtuFmPPrNsWwoT0bVfmMEbmg1wo3IV4yI8l9XZ/+TfRPG2LioaccX3B3DQLY fCI1GaykxaLwrZppMGsjZGVWn/glq3+S/OJiZyZMfQiyTPizi6PKx1ZDQrI+Lrp+kpWI 6YUtNz4tm8hxp/+nHMdsYHp2OS1imkkhfucQlC9ihBehVqh70SCnTAb/c2C2dFZtyKxp 159g== X-Gm-Message-State: APjAAAXRLYMw30WG/OU/HWzZ/OXl1K59N3xbjf51LJfg5HJW3XczZ0cb Q73fG6Ue+FeVbvnei9kZIcTdAmqDz6ncEQ== X-Received: by 2002:a5d:5230:: with SMTP id i16mr8511074wra.317.1573217429952; Fri, 08 Nov 2019 04:50:29 -0800 (PST) Received: from [10.1.2.12] (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id f67sm2393601wme.16.2019.11.08.04.50.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 04:50:29 -0800 (PST) Subject: Re: [PATCH v5 1/3] pinctrl: meson: add a new callback for SoCs fixup To: Qianggui Song , Linus Walleij , linux-gpio@vger.kernel.org Cc: Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Carlo Caione , Rob Herring , Xingyu Chen , Jianxin Pan , Hanjie Lin , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <1573203636-7436-1-git-send-email-qianggui.song@amlogic.com> <1573203636-7436-2-git-send-email-qianggui.song@amlogic.com> From: Neil Armstrong Openpgp: preference=signencrypt Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= mQENBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAG0KE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT6JATsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62oKOFlgOTYCMkYpm2aAOZZLf6VKHKc7DoVwuUkjHfIRXdslbrxi4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B3Xfe6sOp24PQTHAKGtjTHNP/THomkH24Fum9K3iM /4Wh4V2eqGEgpdeSp5K+LdaNyNgaqzMOtt4HYk86LYLSHfFXywdlbGrY9+TqiJ+ZVW4trmui NIJCOku8SYansq34QzYM0x3UFRwff+45zNBEVzctSnremg1mVgrzOfXU8rt+4N1b2MxorPF8 619aCwVP7U16qNSBaqiAJr4e5SNEnoAq18+1Gp8QsFG0ARY8xp+qaKBByWES7lRi3QbqAKZf yOHS6gmYo9gBmuAhc65/VtHMJtxwjpUeN4Bcs9HUpDMDVHdfeRa73wM+wY5potfQ5zkSp0Jp bxnv/cRBH6+c43stTffprd//4Hgz+nJcCgZKtCYIAPkUxABC85ID2CidzbraErVACmRoizhT KR2OiqSLW2x4xdmSiFNcIWkWJB6Qdri0Fzs2dHe8etD1HYaht1ZhZ810s7QOL7JwypO8dscN KTEkyoTGn6cWj0CX+PeP4xp8AR8ot4d0BhtUY34UPzjE1/xyrQFAdnLd0PP4wXxdIUuRs0+n WLY9Aou/vC1LAdlaGsoTVzJ2gX4fkKQIWhX0WVk41BSFeDKQ3RQ2pnuzwedLO94Bf6X0G48O VsbXrP9BZ6snXyHfebPnno/te5XRqZTL9aJOytB/1iUna+1MAwBxGFPvqeEUUyT+gx1l3Acl ZaTUOEkgIor5losDrePdPgE= Organization: Baylibre Message-ID: <54809378-d4b0-2013-eb22-d6570eff2a8c@baylibre.com> Date: Fri, 8 Nov 2019 13:50:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1573203636-7436-2-git-send-email-qianggui.song@amlogic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 08/11/2019 10:00, Qianggui Song wrote: > In meson_pinctrl_parse_dt, it contains two parts: reg parsing and > SoC relative fixup for AO. Several fixups in the same code make it hard > to maintain, so move all fixups to each SoC's callback and make > meson_pinctrl_parse_dt just do the reg parsing, separate these two > parts.Overview of all current Meson SoCs fixup is as below: > > +------+--------------------------------------+--------------------------+ > | | | | > | SoC | EE domain | AO domain | > +------+--------------------------------------+--------------------------+ > |m8 | parse regs: | parse regs: | > |m8b | gpio,mux,pull,pull-enable(skip ds) | gpio,mux,pull(skip ds)| > |gxl | fixup: | fixup: | > |gxbb | no | pull-enable = pull; | > |axg | | | > +------+--------------------------------------+--------------------------+ > |g12a | parse regs: | parse regs: | > |sm1 | gpio,mux,pull,pull-enable,ds | gpio,mux,ds | > | | fixup: | fixup: | > | | no | pull = gpio; | > | | | pull-enable = gpio; | > +------+--------------------------------------+--------------------------+ > |a1 or | parse regs: | > |later | gpio/mux (without ao domain) | > |SoCs | fixup: | > | | pull = gpio; pull-enable = gpio; ds = gpio; | > +------+-----------------------------------------------------------------+ > Since m8-axg share the same ao fixup, make a common function > meson8_aobus_parse_dt_extra to do the job. > > Signed-off-by: Qianggui Song > --- > drivers/pinctrl/meson/pinctrl-meson-axg.c | 1 + > drivers/pinctrl/meson/pinctrl-meson-g12a.c | 9 +++++++++ > drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 1 + > drivers/pinctrl/meson/pinctrl-meson-gxl.c | 1 + > drivers/pinctrl/meson/pinctrl-meson.c | 25 ++++++++++++++++++------- > drivers/pinctrl/meson/pinctrl-meson.h | 5 +++++ > drivers/pinctrl/meson/pinctrl-meson8.c | 1 + > drivers/pinctrl/meson/pinctrl-meson8b.c | 1 + > 8 files changed, 37 insertions(+), 7 deletions(-) > > diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c > index ad502eda4afa..072765db93d7 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c > +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c > @@ -1066,6 +1066,7 @@ > .num_banks = ARRAY_SIZE(meson_axg_aobus_banks), > .pmx_ops = &meson_axg_pmx_ops, > .pmx_data = &meson_axg_aobus_pmx_banks_data, > + .parse_dt = meson8_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson_axg_pinctrl_dt_match[] = { > diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c > index 582665fd362a..41850e3c0091 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c > +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c > @@ -1362,6 +1362,14 @@ > .num_pmx_banks = ARRAY_SIZE(meson_g12a_aobus_pmx_banks), > }; > > +static int meson_g12a_aobus_parse_dt_extra(struct meson_pinctrl *pc) > +{ > + pc->reg_pull = pc->reg_gpio; > + pc->reg_pullen = pc->reg_gpio; > + > + return 0; > +} > + > static struct meson_pinctrl_data meson_g12a_periphs_pinctrl_data = { > .name = "periphs-banks", > .pins = meson_g12a_periphs_pins, > @@ -1388,6 +1396,7 @@ > .num_banks = ARRAY_SIZE(meson_g12a_aobus_banks), > .pmx_ops = &meson_axg_pmx_ops, > .pmx_data = &meson_g12a_aobus_pmx_banks_data, > + .parse_dt = meson_g12a_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson_g12a_pinctrl_dt_match[] = { > diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c > index 5bfa56f3847e..926b9997159a 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c > +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c > @@ -851,6 +851,7 @@ > .num_funcs = ARRAY_SIZE(meson_gxbb_aobus_functions), > .num_banks = ARRAY_SIZE(meson_gxbb_aobus_banks), > .pmx_ops = &meson8_pmx_ops, > + .parse_dt = meson8_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson_gxbb_pinctrl_dt_match[] = { > diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c > index 72c5373c8dc1..8b1a49f5da43 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c > +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c > @@ -820,6 +820,7 @@ > .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), > .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), > .pmx_ops = &meson8_pmx_ops, > + .parse_dt = meson8_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson_gxl_pinctrl_dt_match[] = { > diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c > index 8bba9d053d9f..a812c6d986d9 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson.c > +++ b/drivers/pinctrl/meson/pinctrl-meson.c > @@ -625,7 +625,7 @@ static struct regmap *meson_map_resource(struct meson_pinctrl *pc, > > i = of_property_match_string(node, "reg-names", name); > if (of_address_to_resource(node, i, &res)) > - return ERR_PTR(-ENOENT); > + return NULL; > > base = devm_ioremap_resource(pc->dev, &res); > if (IS_ERR(base)) > @@ -665,26 +665,24 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc, > pc->of_node = gpio_np; > > pc->reg_mux = meson_map_resource(pc, gpio_np, "mux"); > - if (IS_ERR(pc->reg_mux)) { > + if (IS_ERR_OR_NULL(pc->reg_mux)) { > dev_err(pc->dev, "mux registers not found\n"); > return PTR_ERR(pc->reg_mux); If pc->reg_mux is NULL, it will return "0" here, which is wrong. Either keep the return ERR_PTR(-ENOENT); in meson_map_resource, or return pc->reg_mux ? -ENOENT : PTR_ERR(pc->reg_mux); > } > > pc->reg_gpio = meson_map_resource(pc, gpio_np, "gpio"); > - if (IS_ERR(pc->reg_gpio)) { > + if (IS_ERR_OR_NULL(pc->reg_gpio)) { > dev_err(pc->dev, "gpio registers not found\n"); > return PTR_ERR(pc->reg_gpio); Ditto > } > > pc->reg_pull = meson_map_resource(pc, gpio_np, "pull"); > - /* Use gpio region if pull one is not present */ > if (IS_ERR(pc->reg_pull)) > - pc->reg_pull = pc->reg_gpio; > + pc->reg_pull = NULL; > > pc->reg_pullen = meson_map_resource(pc, gpio_np, "pull-enable"); > - /* Use pull region if pull-enable one is not present */ > if (IS_ERR(pc->reg_pullen)) > - pc->reg_pullen = pc->reg_pull; > + pc->reg_pullen = NULL; > > pc->reg_ds = meson_map_resource(pc, gpio_np, "ds"); > if (IS_ERR(pc->reg_ds)) { > @@ -692,6 +690,19 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc, > pc->reg_ds = NULL; > } > > + if (pc->data->parse_dt) > + return pc->data->parse_dt(pc); > + > + return 0; > +} > + > +int meson8_aobus_parse_dt_extra(struct meson_pinctrl *pc) > +{ > + if (!pc->reg_pull) > + return -EINVAL; > + > + pc->reg_pullen = pc->reg_pull; > + > return 0; > } > > diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h > index c696f3241a36..bfa1d3599333 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson.h > +++ b/drivers/pinctrl/meson/pinctrl-meson.h > @@ -11,6 +11,8 @@ > #include > #include > > +struct meson_pinctrl; > + > /** > * struct meson_pmx_group - a pinmux group > * > @@ -114,6 +116,7 @@ struct meson_pinctrl_data { > unsigned int num_banks; > const struct pinmux_ops *pmx_ops; > void *pmx_data; > + int (*parse_dt)(struct meson_pinctrl *pc); > }; > > struct meson_pinctrl { > @@ -171,3 +174,5 @@ int meson_pmx_get_groups(struct pinctrl_dev *pcdev, > > /* Common probe function */ > int meson_pinctrl_probe(struct platform_device *pdev); > +/* Common ao groups extra dt parse function for SoCs before g12a */ > +int meson8_aobus_parse_dt_extra(struct meson_pinctrl *pc); > diff --git a/drivers/pinctrl/meson/pinctrl-meson8.c b/drivers/pinctrl/meson/pinctrl-meson8.c > index 0b97befa6335..dd17100efdcf 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson8.c > +++ b/drivers/pinctrl/meson/pinctrl-meson8.c > @@ -1103,6 +1103,7 @@ > .num_funcs = ARRAY_SIZE(meson8_aobus_functions), > .num_banks = ARRAY_SIZE(meson8_aobus_banks), > .pmx_ops = &meson8_pmx_ops, > + .parse_dt = &meson8_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson8_pinctrl_dt_match[] = { > diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c > index a7de388388e6..2d5339edd0b7 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson8b.c > +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c > @@ -962,6 +962,7 @@ > .num_funcs = ARRAY_SIZE(meson8b_aobus_functions), > .num_banks = ARRAY_SIZE(meson8b_aobus_banks), > .pmx_ops = &meson8_pmx_ops, > + .parse_dt = &meson8_aobus_parse_dt_extra, > }; > > static const struct of_device_id meson8b_pinctrl_dt_match[] = { >