lkml.org 
[lkml]   [2015]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i2c-ocores: add common clock support
> @@ -320,9 +322,23 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
> }
>
> if (of_property_read_u32(np, "clock-frequency", &val)) {
> - dev_err(&pdev->dev,
> - "Missing required parameter 'clock-frequency'\n");
> - return -ENODEV;
> + struct clk *clk = devm_clk_get(&pdev->dev, NULL);
> +
> + if (!IS_ERR(clk)) {
> + int ret = clk_prepare_enable(clk);
> +
> + if (ret) {
> + dev_err(&pdev->dev,
> + "clk_prepare_enable failed: %d\n", ret);
> + return ret;
> + }
> + i2c->clk = clk;
> + val = clk_get_rate(clk);
> + } else {
> + dev_err(&pdev->dev,
> + "Missing required parameter 'clock-frequency'\n");
> + return -ENODEV;
> + }

Either NAK or I don't understand the logic here :) If a dts does NOT
have the bus-speed set by 'clock-frequency', then we take the value of
the clock assigned to this platform_device?

The usual thing to do when 'clock-frequency' is not set is to default to
100kHz.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-01-22 16:01    [W:0.111 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site