Re: [PATCH] i2c: designware: Do not require clock when SSCN and FFCN are provided

From: Mika Westerberg
Date: Wed Dec 16 2015 - 10:07:28 EST


On Wed, Dec 16, 2015 at 08:44:34AM -0600, Suravee Suthikulpanit wrote:
> I am trying to avoid having to hard-coded clock frequency value in the
> driver. Would it be alright to not return w/ error, and just do the
> following?
>
> dev->clk = devm_clk_get(&pdev->dev, NULL);
> if (!IS_ERR(dev->clk))
> dev->get_clk_rate_khz = i2c_dw_get_clk_rate_khz;
>
> This should work for the Intel case when clock is also provided.

Does it also work when clk_prepare_enable()/disable() is called for the
clock (in PM callbacks for example)? If yes, then I don't see problems
with what you are suggesting.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/