[PATCH 3/3] decoder: Add V4L2 stateless H.264 decoder driver
Martin Blumenstingl
martin.blumenstingl at googlemail.com
Sat Nov 8 14:53:07 PST 2025
Hello,
thank you for your work on this!
On Mon, Oct 27, 2025 at 6:42 AM Zhentao Guo via B4 Relay
<devnull+zhentao.guo.amlogic.com at kernel.org> wrote:
[...]
+/**
+ * enum aml_power_type_e - Type of decoder power.
+ */
+enum aml_power_type_e {
+ AML_PM_PD = 0,
+};
Are there any other power types that you are already aware of - or is
this added "just in case" an additional type is needed in future?
> +/**
> + * struct gate_switch_node - clock node definition
> + * @clk: Pointer to clk instance.
> + * @name: Clock name used.
> + * @mutex: Mutex lock for multi decoder instance.
> + * @ref_count: Curr clk instance ref count.
> + */
> +struct gate_switch_node {
> + struct clk *clk;
> + const char *name;
> + struct mutex mutex;
> + int ref_count;
> +};
Generally I'm not sure if the whole struct is needed as I think the
common clock framework has everything we need.
There's struct clk_bulk_data which allows mapping clocks from
device-tree to an array in the code.
drivers/staging/media/starfive/camss/stf-camss.h for defines an enum
(stf_clk) to access each of the clocks by it's index in the array.
You even seem to have an enum (clk_type_e) which you could use to
simplify the code.
My understanding is that one can call clk_prepare_enable() and
clk_disable_unprepare() as often as you'd like and these functions
will do the ref-counting internally.
So I think the ref_count is not explicitly needed, as that's managed
by the common clock framework.
Best regards,
Martin
More information about the linux-amlogic
mailing list