[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5a33645-fac1-9c69-afe6-654bfe93ca48@amlogic.com>
Date: Mon, 18 Apr 2022 11:40:10 +0800
From: Liang Yang <liang.yang@...ogic.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
CC: <linux-mtd@...ts.infradead.org>, Rob Herring <robh+dt@...nel.org>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Jerome Brunet <jbrunet@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Kevin Hilman <khilman@...libre.com>,
Jianxin Pan <jianxin.pan@...ogic.com>,
Victor Wan <victor.wan@...ogic.com>,
XianWei Zhao <xianwei.zhao@...ogic.com>,
Kelvin Zhang <kelvin.zhang@...ogic.com>,
BiChao Zheng <bichao.zheng@...ogic.com>,
YongHui Yu <yonghui.yu@...ogic.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-amlogic@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v4 1/2] mtd: rawnand: meson: discard the common MMC sub
clock framework
Hi Miquel,
i have some confusion when i prepare the patches. for DT compatibility,
it falls back to the old DT when failed to get resource by the new DT,
but there is some points:
a. old DT depends on MMC sub clock driver, but it never be merged, so it
can't work.
b. if it falls back to the old DT, beside the regmap lookup below, it
seems that we have to preserve the code of the old clock setting in
nfc_clk_init(). do we still need to avoid break DT compatibility?
Thanks.
On 2022/4/11 10:40, Liang Yang wrote:
>>> nfc->dev = dev;
>>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> - nfc->reg_base = devm_ioremap_resource(dev, res);
>>> + nfc->reg_base = devm_platform_ioremap_resource_byname(pdev, "nfc");
>>
>> This change seems unrelated.
>
> To be consistent with the following
> devm_platform_ioremap_resource_byname(pdev, "emmc"). do you mean that we
> don't need it?>
>>> if (IS_ERR(nfc->reg_base))
>>> return PTR_ERR(nfc->reg_base);
>>> - nfc->reg_clk =
>>> - syscon_regmap_lookup_by_phandle(dev->of_node,
>>> - "amlogic,mmc-syscon");
>>> - if (IS_ERR(nfc->reg_clk)) {
>>> - dev_err(dev, "Failed to lookup clock base\n");
>>> - return PTR_ERR(nfc->reg_clk);
>>> - }
>>> + nfc->sd_emmc_clock = devm_platform_ioremap_resource_byname(pdev,
>>> "emmc");
>>> + if (IS_ERR(nfc->sd_emmc_clock))
>>> + return PTR_ERR(nfc->sd_emmc_clock);
>>
>> While I agree this is much better than the previous solution, we cannot
>> break DT compatibility, so you need to try getting the emmc clock, but
>> if it fails you should fallback to the regmap lookup.
>
> ok, i will fix it next version. thanks.
>
>>
>>> irq = platform_get_irq(pdev, 0);
Powered by blists - more mailing lists