All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>,
	Jisheng Zhang <jszhang@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Wei Fu <wefu@redhat.com>,
	Yangtao Li <frank.li@vivo.com>,
	mturquette@baylibre.com
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	Icenowy Zheng <uwu@icenowy.me>
Subject: Re: [PATCH 2/3] clk: thead: add support for the T-HEAD TH1520 CCU
Date: Mon, 12 Jun 2023 18:35:41 -0700	[thread overview]
Message-ID: <91c3373b5b00afc1910b704a16c1ac89.sboyd@kernel.org> (raw)
In-Reply-To: <20230515054402.27633-3-frank.li@vivo.com>

Quoting Yangtao Li (2023-05-14 22:44:00)
> diff --git a/drivers/clk/clk-th1520.c b/drivers/clk/clk-th1520.c
> new file mode 100644
> index 000000000000..5dfa9e5207e2
> --- /dev/null
> +++ b/drivers/clk/clk-th1520.c
> @@ -0,0 +1,999 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd.
> + * Authors: Yangtao Li <frank.li@vivo.com>
> + */
> +
[....]
> +
> +
> +static CLK_FIXED_FACTOR_HW(pll_gmac_100m_clk, "pll-gmac-100m",
> +                          &pll_gmac_clk.common.hw,
> +                          10, 1, 0);
> +
> +static const char * const uart_parents[] = { "pll-gmac-100m", "osc24m" };
> +struct ccu_mux uart_clk = {
> +       .mux    = TH_CCU_ARG(0, 1),
> +       .common = {
> +               .reg            = 0x210,
> +               .hw.init        = CLK_HW_INIT_PARENTS("uart",

Don't use strings for clk tree topology. Instead use clk_parent_data or
clk_hw pointers directly.

> +                                             uart_parents,
> +                                             &ccu_mux_ops,
> +                                             0),
> +       }
> +};
> +};
> +
> +static const struct regmap_config config = {

Namespace this, th1520_clk_regmap_config[]

> +       .reg_bits = 32,
> +       .val_bits = 32,
> +       .reg_stride = 4,
> +       .fast_io = true,
> +};
> +
> +static int th1520_clock_probe(struct platform_device *pdev)
> +{
> +       struct device *dev = &pdev->dev;
> +       struct regmap *map;
> +       void __iomem *regs;
> +       int ret, i;
> +
> +       regs = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(regs))
> +               return PTR_ERR(regs);
> +
> +       map = devm_regmap_init_mmio(dev, regs, &config);
> +       if (IS_ERR(map))
> +               return PTR_ERR(map);
> +
> +       for (i = 0; i < ARRAY_SIZE(th1520_clks); i++)
> +               th1520_clks[i]->map = map;
> +
> +       for (i = 0; i < th1520_hw_clks.num; i++) {
> +               ret = devm_clk_hw_register(dev, th1520_hw_clks.hws[i]);
> +               if (ret)
> +                       return ret;
> +       }
> +
> +       ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> +                                       &th1520_hw_clks);
> +       if (ret)
> +               return ret;
> +
> +       return 0;
> +}
> +
> +static const struct of_device_id clk_match_table[] = {

Namespace this, th1520_clk_match_table[]

> +       {
> +               .compatible = "thead,th1520-ccu",
> +       },
> +       { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, clk_match_table);
> +

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>,
	Jisheng Zhang <jszhang@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Wei Fu <wefu@redhat.com>,
	Yangtao Li <frank.li@vivo.com>,
	mturquette@baylibre.com
Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] clk: thead: add support for the T-HEAD TH1520 CCU
Date: Mon, 12 Jun 2023 18:35:41 -0700	[thread overview]
Message-ID: <91c3373b5b00afc1910b704a16c1ac89.sboyd@kernel.org> (raw)
In-Reply-To: <20230515054402.27633-3-frank.li@vivo.com>

Quoting Yangtao Li (2023-05-14 22:44:00)
> diff --git a/drivers/clk/clk-th1520.c b/drivers/clk/clk-th1520.c
> new file mode 100644
> index 000000000000..5dfa9e5207e2
> --- /dev/null
> +++ b/drivers/clk/clk-th1520.c
> @@ -0,0 +1,999 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd.
> + * Authors: Yangtao Li <frank.li@vivo.com>
> + */
> +
[....]
> +
> +
> +static CLK_FIXED_FACTOR_HW(pll_gmac_100m_clk, "pll-gmac-100m",
> +                          &pll_gmac_clk.common.hw,
> +                          10, 1, 0);
> +
> +static const char * const uart_parents[] = { "pll-gmac-100m", "osc24m" };
> +struct ccu_mux uart_clk = {
> +       .mux    = TH_CCU_ARG(0, 1),
> +       .common = {
> +               .reg            = 0x210,
> +               .hw.init        = CLK_HW_INIT_PARENTS("uart",

Don't use strings for clk tree topology. Instead use clk_parent_data or
clk_hw pointers directly.

> +                                             uart_parents,
> +                                             &ccu_mux_ops,
> +                                             0),
> +       }
> +};
> +};
> +
> +static const struct regmap_config config = {

Namespace this, th1520_clk_regmap_config[]

> +       .reg_bits = 32,
> +       .val_bits = 32,
> +       .reg_stride = 4,
> +       .fast_io = true,
> +};
> +
> +static int th1520_clock_probe(struct platform_device *pdev)
> +{
> +       struct device *dev = &pdev->dev;
> +       struct regmap *map;
> +       void __iomem *regs;
> +       int ret, i;
> +
> +       regs = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(regs))
> +               return PTR_ERR(regs);
> +
> +       map = devm_regmap_init_mmio(dev, regs, &config);
> +       if (IS_ERR(map))
> +               return PTR_ERR(map);
> +
> +       for (i = 0; i < ARRAY_SIZE(th1520_clks); i++)
> +               th1520_clks[i]->map = map;
> +
> +       for (i = 0; i < th1520_hw_clks.num; i++) {
> +               ret = devm_clk_hw_register(dev, th1520_hw_clks.hws[i]);
> +               if (ret)
> +                       return ret;
> +       }
> +
> +       ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> +                                       &th1520_hw_clks);
> +       if (ret)
> +               return ret;
> +
> +       return 0;
> +}
> +
> +static const struct of_device_id clk_match_table[] = {

Namespace this, th1520_clk_match_table[]

> +       {
> +               .compatible = "thead,th1520-ccu",
> +       },
> +       { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, clk_match_table);
> +

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2023-06-13  1:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  5:43 [PATCH 0/3] Add T-HEAD th1520 soc clock support Yangtao Li
2023-05-15  5:43 ` Yangtao Li
2023-05-15  5:43 ` [PATCH 1/3] dt-bindings: clock: Add thead th1520 clock Yangtao Li
2023-05-15  5:43   ` Yangtao Li
2023-05-15  6:22   ` Krzysztof Kozlowski
2023-05-15  6:22     ` Krzysztof Kozlowski
2023-05-15  6:26   ` Krzysztof Kozlowski
2023-05-15  6:26     ` Krzysztof Kozlowski
2023-05-15  5:44 ` [PATCH 2/3] clk: thead: add support for the T-HEAD TH1520 CCU Yangtao Li
2023-05-15  5:44   ` Yangtao Li
2023-05-15  6:27   ` Krzysztof Kozlowski
2023-05-15  6:27     ` Krzysztof Kozlowski
2023-06-13  1:35   ` Stephen Boyd [this message]
2023-06-13  1:35     ` Stephen Boyd
2023-08-27 10:37   ` Jisheng Zhang
2023-08-27 10:37     ` Jisheng Zhang
2023-09-03 22:37     ` Drew Fustini
2023-09-03 22:37       ` Drew Fustini
2023-05-15  5:44 ` [PATCH 3/3] MAINTAINERS: update entry for T-HEAD RISC-V SoC Yangtao Li
2023-05-15  5:44   ` Yangtao Li
2023-05-15 17:15   ` Conor Dooley
2023-05-15 17:15     ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91c3373b5b00afc1910b704a16c1ac89.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frank.li@vivo.com \
    --cc=jszhang@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=uwu@icenowy.me \
    --cc=wefu@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.