Re: [PATCH v12 4/9] dt-bindings: clock: Add bindings for SP7021 clock driver

From: Krzysztof Kozlowski
Date: Fri Apr 01 2022 - 05:32:32 EST


On 01/04/2022 11:19, qinjian[覃健] wrote:
>>> diff --git a/include/dt-bindings/clock/sp-sp7021.h b/include/dt-bindings/clock/sp-sp7021.h
>>> new file mode 100644
>>> index 000000000..45dac6de8
>>> --- /dev/null
>>> +++ b/include/dt-bindings/clock/sp-sp7021.h
>>> @@ -0,0 +1,112 @@
>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>> +/*
>>> + * Copyright (C) Sunplus Technology Co., Ltd.
>>> + * All rights reserved.
>>> + */
>>> +#ifndef _DT_BINDINGS_CLOCK_SUNPLUS_SP7021_H
>>> +#define _DT_BINDINGS_CLOCK_SUNPLUS_SP7021_H
>>> +
>>> +#define XTAL 27000000
>>> +
>>> +/* plls */
>>> +#define PLL_A 0
>>> +#define PLL_E 1
>>> +#define PLL_E_2P5 2
>>> +#define PLL_E_25 3
>>> +#define PLL_E_112P5 4
>>> +#define PLL_F 5
>>> +#define PLL_TV 6
>>> +#define PLL_TV_A 7
>>> +#define PLL_SYS 8
>>> +
>>> +/* gates: mo_clken0 ~ mo_clken9 */
>>> +#define CLK_SYSTEM 0x10
>>> +#define CLK_RTC 0x12
>>
>> YAML looks ok, but here comment from Arnd also applies. These should be
>> regular decimal numbers incremented by one.
>>
>> Best regards,
>> Krzysztof
>
> Yes, same as reset driver, these defines also mapping the hardware.
> But different from reset driver, clk driver also used these defines.
> If I removed this defines, I must write the proper hardware number twice in dt & driver.
> It's meaningless & hard to check.

Not really... just follow what most (or all) clock drivers are doing -
incremental IDs.



Best regards,
Krzysztof