[U-Boot] [RESEND PATCH 5/5] clk: add enable() callback

Simon Glass sjg at chromium.org
Mon Dec 28 15:20:44 CET 2015


Hi Masahiro,

On 22 December 2015 at 03:04, Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
> The most basic thing for clock is to enable it, but it is missing
> in this uclass.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
>
>  include/clk.h | 9 +++++++++
>  1 file changed, 9 insertions(+)

Acked-by: Simon Glass <sjg at chromium.org>

Thinking ahead, should we have disable() also, or maybe replacing both
with set_enable(bool enable) would be better?

>
> diff --git a/include/clk.h b/include/clk.h
> index 518cb47..ce2db41 100644
> --- a/include/clk.h
> +++ b/include/clk.h
> @@ -33,6 +33,15 @@ struct clk_ops {
>         ulong (*set_rate)(struct udevice *dev, ulong rate);
>
>         /**
> +        * enable() - Enable the clock for a peripheral
> +        *
> +        * @dev:        clock provider
> +        * @periph:     Peripheral ID to enable
> +        * @return zero on success, or -ve error code
> +        */
> +       int (*enable)(struct udevice *dev, int periph);
> +
> +       /**
>          * get_periph_rate() - Get clock rate for a peripheral
>          *
>          * @dev:        Device to check (UCLASS_CLK)
> --
> 1.9.1
>

Regards,
Simon


More information about the U-Boot mailing list