[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <98619eef-8b51-c138-e98d-39fdbe4c9ebb@amlogic.com>
Date: Fri, 14 Jan 2022 11:07:17 +0800
From: Liang Yang <liang.yang@...ogic.com>
To: Stephen Boyd <sboyd@...nel.org>,
Jerome Brunet <jbrunet@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Michael Turquette <mturquette@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Rob Herring <robh+dt@...nel.org>, <linux-clk@...r.kernel.org>
CC: Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Jianxin Pan <jianxin.pan@...ogic.com>,
Victor Wan <victor.wan@...ogic.com>,
XianWei Zhao <xianwei.zhao@...ogic.com>,
Kelvin Zhang <kelvin.zhang@...ogic.com>,
BiChao Zheng <bichao.zheng@...ogic.com>,
YongHui Yu <yonghui.yu@...ogic.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-amlogic@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v9 1/4] clk: meson: add one based divider support for sclk
Hi Stephen,
On 2022/1/14 5:28, Stephen Boyd wrote:
> [ EXTERNAL EMAIL ]
>
> Quoting Liang Yang (2022-01-13 03:57:42)
>> diff --git a/drivers/clk/meson/sclk-div.c b/drivers/clk/meson/sclk-div.c
>> index 76d31c0a3342..79c9efd28115 100644
>> --- a/drivers/clk/meson/sclk-div.c
>> +++ b/drivers/clk/meson/sclk-div.c
>> @@ -28,22 +29,39 @@ meson_sclk_div_data(struct clk_regmap *clk)
>> return (struct meson_sclk_div_data *)clk->data;
>> }
>>
>> -static int sclk_div_maxval(struct meson_sclk_div_data *sclk)
>> +static inline int sclk_get_reg(int val, unsigned char flag)
>> {
>> - return (1 << sclk->div.width) - 1;
>> + if ((flag & MESON_SCLK_ONE_BASED) || !val)
>> + return val;
>> + else
>> + return val - 1;
>
> Please drop the else
ok
>
>> +}
>> +
>> +static inline int sclk_get_divider(int reg, unsigned char flag)
>> +{
>> + if (flag & MESON_SCLK_ONE_BASED)
>> + return reg;
>> + else
>
> Please drop the else
ok
>
>> + return reg + 1;
>> }
>>
>> static int sclk_div_maxdiv(struct meson_sclk_div_data *sclk)
>> {
>> - return sclk_div_maxval(sclk) + 1;
>
> .
Powered by blists - more mailing lists