Re: [PATCH v5 03/13] pwm: mediatek: add a property "clock-frequency"

From: Uwe Kleine-König
Date: Fri Aug 23 2019 - 20:32:41 EST


Hello Sam,

On Thu, Aug 22, 2019 at 02:58:33PM +0800, Sam Shih wrote:
> This fix mt7628 pwm during configure from userspace. The SoC
> is legacy MIPS and has no complex clock tree. This patch add property
> clock-frequency to the SoC specific data and legacy MIPS SoC need to
> configure it in DT. This property is use for period calculation.
>
> We will improve this fix by droping has-clks attribute and using
> clock-frequency to do the same thing in a new patch.
>
> Signed-off-by: Ryder Lee <ryder.lee@xxxxxxxxxxxx>
> Signed-off-by: Sam Shih <sam.shih@xxxxxxxxxxxx>

I wonder if instead the platform could provide some dummy and optional
clocks.

You could add a fixed-clock for the clk that is used to determine the
clock rate and switch to devm_clk_get_optional for the others.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |