From: Brian Masney <bmasney@redhat.com>
To: joakim.zhang@cixtech.com
Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de,
cix-kernel-upstream@cixtech.com, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v8 2/4] clk: cix: add sky1 audss clock controller
Date: Tue, 7 Jul 2026 12:35:34 -0400 [thread overview]
Message-ID: <ak0q1pWZREYsvJ4f@redhat.com> (raw)
In-Reply-To: <20260630124413.1814379-3-joakim.zhang@cixtech.com>
Hi Joakim,
Thanks for the patch.
On Tue, Jun 30, 2026 at 08:44:11PM +0800, joakim.zhang@cixtech.com wrote:
> From: Joakim Zhang <joakim.zhang@cixtech.com>
>
> Add a platform driver for the Cix Sky1 AUDSS CRU. The driver maps
> the CRU registers and registers mux, divider and gate clocks for
> DSP, SRAM, HDA, DMAC, I2S, mailbox, watchdog and timer blocks.
>
> Four SoC-level audio reference clocks are enabled as inputs to the
> internal clock tree. The driver releases the AUDSS NOC reset, enables
> runtime PM and instantiates the auxiliary reset device.
>
> Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
[snip]
> +static struct clk_hw *sky1_audss_clk_register(struct device *dev,
> + const char *name,
> + const char * const *parent_names,
> + int num_parents,
> + struct regmap *regmap,
> + const u32 *mux_table,
> + struct muxdiv_cfg *mux_cfg,
> + struct muxdiv_cfg *div_cfg,
> + struct gate_cfg *gate_cfg,
> + unsigned long flags,
> + spinlock_t *lock)
> +{
> + const struct clk_ops *sky1_mux_ops = NULL;
> + const struct clk_ops *sky1_div_ops = NULL;
> + const struct clk_ops *sky1_gate_ops = NULL;
> + struct clk_hw *hw = ERR_PTR(-ENOMEM);
> + struct sky1_clk_divider *sky1_div = NULL;
> + struct sky1_clk_gate *sky1_gate = NULL;
> + struct sky1_clk_mux *sky1_mux = NULL;
Reverse Christmas tree order please.
> +
> + if (mux_cfg->offset >= 0) {
> + sky1_mux = devm_kzalloc(dev, sizeof(*sky1_mux), GFP_KERNEL);
> + if (!sky1_mux)
> + return ERR_PTR(-ENOMEM);
> +
> + sky1_mux->mux.reg = NULL;
> + sky1_mux->mux.shift = mux_cfg->shift;
> + sky1_mux->mux.mask = BIT(mux_cfg->width) - 1;
> + sky1_mux->mux.flags = mux_cfg->flags;
> + sky1_mux->mux.table = mux_table;
> + sky1_mux->mux.lock = lock;
> + sky1_mux_ops = &sky1_audss_clk_mux_ops;
> + sky1_mux->regmap = regmap;
> + sky1_mux->offset = mux_cfg->offset;
> + }
> +
> + if (div_cfg->offset >= 0) {
> + sky1_div = devm_kzalloc(dev, sizeof(*sky1_div), GFP_KERNEL);
> + if (!sky1_div)
> + return ERR_PTR(-ENOMEM);
> +
> + sky1_div->div.reg = NULL;
> + sky1_div->div.shift = div_cfg->shift;
> + sky1_div->div.width = div_cfg->width;
> + sky1_div->div.flags = div_cfg->flags | CLK_DIVIDER_POWER_OF_TWO;
> + sky1_div->div.lock = lock;
> + sky1_div_ops = &sky1_audss_clk_divider_ops;
> + sky1_div->regmap = regmap;
> + sky1_div->offset = div_cfg->offset;
> + }
> +
> + if (gate_cfg->offset >= 0) {
> + sky1_gate = devm_kzalloc(dev, sizeof(*sky1_gate), GFP_KERNEL);
> + if (!sky1_gate)
> + return ERR_PTR(-ENOMEM);
> +
> + sky1_gate->gate.reg = NULL;
> + sky1_gate->gate.bit_idx = gate_cfg->shift;
> + sky1_gate->gate.flags = gate_cfg->flags;
> + sky1_gate->gate.lock = lock;
> + sky1_gate_ops = &sky1_audss_clk_gate_ops;
> + sky1_gate->regmap = regmap;
> + sky1_gate->offset = gate_cfg->offset;
> + }
> +
> + hw = clk_hw_register_composite(dev, name, parent_names, num_parents,
> + sky1_mux ? &sky1_mux->mux.hw : NULL, sky1_mux_ops,
> + sky1_div ? &sky1_div->div.hw : NULL, sky1_div_ops,
> + sky1_gate ? &sky1_gate->gate.hw : NULL, sky1_gate_ops,
> + flags);
Please use devm_clk_hw_register_composite_pdata() to make sure that
everything is cleaned up in the expected order relative to the other
devm_*() calls.
Please go through the Sashiko feedback at
https://sashiko.dev/#/message/20260630125936.E186A1F000E9%40smtp.kernel.org
and I'll do do a thorough review on the next version.
Brian
next prev parent reply other threads:[~2026-07-07 16:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 12:44 [PATCH v8 0/4] Add Cix Sky1 AUDSS clock and reset support joakim.zhang
2026-06-30 12:44 ` [PATCH v8 1/4] dt-bindings: soc: cix: add sky1 audss cru controller joakim.zhang
2026-06-30 12:44 ` [PATCH v8 2/4] clk: cix: add sky1 audss clock controller joakim.zhang
2026-06-30 12:59 ` sashiko-bot
2026-07-07 16:35 ` Brian Masney [this message]
2026-07-09 11:41 ` Joakim Zhang
2026-06-30 12:44 ` [PATCH v8 3/4] reset: cix: add sky1 audss auxiliary reset driver joakim.zhang
2026-06-30 12:44 ` [PATCH v8 4/4] arm64: dts: cix: sky1: add audss cru joakim.zhang
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=ak0q1pWZREYsvJ4f@redhat.com \
--to=bmasney@redhat.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=joakim.zhang@cixtech.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
/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.