devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Sylwester Nawrocki
	<s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org"
	<galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v4 07/10] exynos4-is: Add clock provider for the SCLK_CAM clock outputs
Date: Sat, 22 Feb 2014 23:18:25 +0100	[thread overview]
Message-ID: <53092231.6080402@gmail.com> (raw)
In-Reply-To: <20140221160504.GG20449-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>

On 02/21/2014 05:05 PM, Mark Rutland wrote:
>> ---
>>   drivers/media/platform/exynos4-is/media-dev.c |  110 +++++++++++++++++++++++++
>>   drivers/media/platform/exynos4-is/media-dev.h |   19 ++++-
>>   2 files changed, 128 insertions(+), 1 deletion(-)
...
>
>> +static int fimc_md_register_clk_provider(struct fimc_md *fmd)
>> +{
>> +	struct cam_clk_provider *cp =&fmd->clk_provider;
>> +	struct device *dev =&fmd->pdev->dev;
>> +	int i, ret;
>> +
>> +	for (i = 0; i<  ARRAY_SIZE(cp->clks); i++) {
>> +		struct cam_clk *camclk =&cp->camclk[i];
>> +		struct clk_init_data init;
>> +
>> +		ret = of_property_read_string_index(dev->of_node,
>> +					"clock-output-names", i,&init.name);
>
> Are there not well-defined names for the clock outputs of the block?

There are, but this driver handles multiple SoCs so I thought it's better
to define these names in devicetree. They are supposed to be unique. Isn't
that what the clock-output-names property is for ?

>> +		if (ret<  0)
>> +			break;
>> +
>> +		ret = of_property_read_string_index(dev->of_node,
>> +					"clock-names", i, init.parent_names);
>
> This shouldn't be a parent name. It should be the input line name.
>
> I don't think this makes sense.
>
> Why do you need the name of the parent clock?

As explained in previous e-mail, it is needed to maintain the clock tree,
the parent clock names must be set properly. As the above is not correct
I could hard code these names or retrieve with __clk_get_name() from proper
input clocks. of_clk_get_parent_name() cannot be used.

>> +		if (ret<  0)
>> +			break;
>> +
>> +		init.num_parents = 1;
>> +		init.ops =&cam_clk_ops;
>> +		init.flags = CLK_SET_RATE_PARENT;
>> +		camclk->hw.init =&init;
>> +		camclk->fmd = fmd;
>> +
>> +		cp->clks[i] = clk_register(NULL,&camclk->hw);
>> +		if (IS_ERR(cp->clks[i])) {
>> +			dev_err(dev, "failed to register clock: %s (%ld)\n",
>> +					init.name, PTR_ERR(cp->clks[i]));
>> +			ret = PTR_ERR(cp->clks[i]);
>> +			goto err;
>> +		}
>> +		cp->num_clocks++;
>> +	}
>> +
>> +	if (cp->num_clocks == 0) {
>> +		dev_warn(dev, "clk provider not registered\n");
>> +		return 0;
>> +	}
>> +
>> +	cp->clk_data.clks = cp->clks;
>> +	cp->clk_data.clk_num = cp->num_clocks;
>> +	cp->of_node = dev->of_node;
>> +	ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
>> +				&cp->clk_data);
>
> Are _all_ of the input clock lines available to children in hardware?

This code is only for two clocks, ARRAY_SIZE(cp->clks) == 2 and
cp->num_clocks can't be greater than 2. Nevertheless, for some SoC
variants this driver handles (e.g. S5PV210) there can be only up to
two clocks listed in the camera node.

The camera interface IP block doesn't generate the clock itself, it just
passes it through when is active, i.e. its other clocks are enabled and
the power domain activated.

> The binding and commit message(s) implied only two clocks were, so
> what's the point in exporting clocks which aren't available?

I'm not sure what makes you think there is more than two ?

--
Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-02-22 22:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 19:40 [PATCH v4 00/10] Add device tree support for Exynos4 SoC camera subsystem Sylwester Nawrocki
2014-02-20 19:40 ` Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 01/10] Documentation: dt: Add DT binding documentation for S5K6A3 image sensor Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 02/10] Documentation: dt: Add DT binding documentation for S5C73M3 camera Sylwester Nawrocki
2014-02-21 15:42   ` Mark Rutland
2014-02-21 17:52     ` Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 03/10] Documentation: devicetree: Update Samsung FIMC DT binding Sylwester Nawrocki
2014-02-21 15:50   ` Mark Rutland
2014-02-22 22:02     ` Sylwester Nawrocki
2014-02-22 22:26       ` Tomasz Figa
2014-02-22 22:52         ` Sylwester Nawrocki
     [not found] ` <1392925237-31394-1-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-02-20 19:40   ` [PATCH v4 04/10] V4L: Add driver for s5k6a3 image sensor Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 05/10] V4L: s5c73m3: Add device tree support Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 06/10] exynos4-is: Use external s5k6a3 sensor driver Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 07/10] exynos4-is: Add clock provider for the SCLK_CAM clock outputs Sylwester Nawrocki
2014-02-21 16:05   ` Mark Rutland
     [not found]     ` <20140221160504.GG20449-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-02-22 22:18       ` Sylwester Nawrocki [this message]
2014-02-20 19:40 ` [PATCH v4 08/10] exynos4-is: Add support for asynchronous subdevices registration Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 09/10] ARM: dts: Add rear camera nodes for Exynos4412 TRATS2 board Sylwester Nawrocki
2014-02-20 19:40 ` [PATCH v4 10/10] ARM: dts: exynos4: Update clk provider part of the camera subsystem Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53092231.6080402@gmail.com \
    --to=sylvester.nawrocki-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).