All of lore.kernel.org
 help / color / mirror / Atom feed
From: songjun.wu@atmel.com (Wu, Songjun)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] [media] atmel-isc: add the Image Sensor Controller code
Date: Tue, 19 Apr 2016 18:02:46 +0800	[thread overview]
Message-ID: <57160246.2060804@atmel.com> (raw)
In-Reply-To: <81160604.beJHM8QlLS@avalon>



On 4/15/2016 00:21, Laurent Pinchart wrote:
>> >+		return -EINVAL;
>> >+
>> >+	parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
>> >+	if (!parent_names)
>> >+		return -ENOMEM;
>> >+
>> >+	of_clk_parent_fill(np, parent_names, num_parents);
>> >+
>> >+	init.parent_names	= parent_names;
>> >+	init.num_parents	= num_parents;
>> >+	init.name		= clk_name;
>> >+	init.ops		= &isc_clk_ops;
>> >+	init.flags		= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
>> >+
>> >+	isc_clk = &isc->isc_clks[id];
>> >+	isc_clk->hw.init	= &init;
>> >+	isc_clk->regmap		= regmap;
>> >+	isc_clk->lock		= lock;
>> >+	isc_clk->id		= id;
>> >+
>> >+	isc_clk->clk = clk_register(NULL, &isc_clk->hw);
>> >+	if (!IS_ERR(isc_clk->clk))
>> >+		of_clk_add_provider(np, of_clk_src_simple_get, isc_clk->clk);
>> >+	else {
>> >+		dev_err(isc->dev, "%s: clock register fail\n", clk_name);
>> >+		ret = PTR_ERR(isc_clk->clk);
>> >+		goto free_parent_names;
>> >+	}
>> >+
>> >+free_parent_names:
>> >+	kfree(parent_names);
>> >+	return ret;
>> >+}
>> >+
>> >+static int isc_clk_init(struct isc_device *isc)
>> >+{
>> >+	struct device_node *np = of_get_child_by_name(isc->dev->of_node,
>> >+						      "clk_in_isc");
> Do you really need the clk_in_isc DT node ? I would have assumed that the
> clock topology inside the ISC is fixed, and that it would be enough to just
> specify the three parent clocks in the ISC DT node and create the two internal
> clocks in the driver without needing a DT description.
>
Hi Laurent,

I think more, and the clk_in_isc DT node should be needed. The clock 
topology inside the ISC is fixed, but isc will provide the clock to 
sensor, we need create the corresponding clock node int DT file, then 
the sensor will get this clock and set the clock rate in DT file.

WARNING: multiple messages have this Message-ID (diff)
From: "Wu, Songjun" <songjun.wu@atmel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: g.liakhovetski@gmx.de, nicolas.ferre@atmel.com,
	linux-arm-kernel@lists.infradead.org,
	"Mauro Carvalho Chehab" <mchehab@osg.samsung.com>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Sudip Mukherjee" <sudipm.mukherjee@gmail.com>,
	"Mikhail Ulyanov" <mikhail.ulyanov@cogentembedded.com>,
	"Fabien Dessenne" <fabien.dessenne@st.com>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"Benoit Parrot" <bparrot@ti.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Richard Röjfors" <richard@puffinpack.se>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/2] [media] atmel-isc: add the Image Sensor Controller code
Date: Tue, 19 Apr 2016 18:02:46 +0800	[thread overview]
Message-ID: <57160246.2060804@atmel.com> (raw)
In-Reply-To: <81160604.beJHM8QlLS@avalon>



On 4/15/2016 00:21, Laurent Pinchart wrote:
>> >+		return -EINVAL;
>> >+
>> >+	parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
>> >+	if (!parent_names)
>> >+		return -ENOMEM;
>> >+
>> >+	of_clk_parent_fill(np, parent_names, num_parents);
>> >+
>> >+	init.parent_names	= parent_names;
>> >+	init.num_parents	= num_parents;
>> >+	init.name		= clk_name;
>> >+	init.ops		= &isc_clk_ops;
>> >+	init.flags		= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
>> >+
>> >+	isc_clk = &isc->isc_clks[id];
>> >+	isc_clk->hw.init	= &init;
>> >+	isc_clk->regmap		= regmap;
>> >+	isc_clk->lock		= lock;
>> >+	isc_clk->id		= id;
>> >+
>> >+	isc_clk->clk = clk_register(NULL, &isc_clk->hw);
>> >+	if (!IS_ERR(isc_clk->clk))
>> >+		of_clk_add_provider(np, of_clk_src_simple_get, isc_clk->clk);
>> >+	else {
>> >+		dev_err(isc->dev, "%s: clock register fail\n", clk_name);
>> >+		ret = PTR_ERR(isc_clk->clk);
>> >+		goto free_parent_names;
>> >+	}
>> >+
>> >+free_parent_names:
>> >+	kfree(parent_names);
>> >+	return ret;
>> >+}
>> >+
>> >+static int isc_clk_init(struct isc_device *isc)
>> >+{
>> >+	struct device_node *np = of_get_child_by_name(isc->dev->of_node,
>> >+						      "clk_in_isc");
> Do you really need the clk_in_isc DT node ? I would have assumed that the
> clock topology inside the ISC is fixed, and that it would be enough to just
> specify the three parent clocks in the ISC DT node and create the two internal
> clocks in the driver without needing a DT description.
>
Hi Laurent,

I think more, and the clk_in_isc DT node should be needed. The clock 
topology inside the ISC is fixed, but isc will provide the clock to 
sensor, we need create the corresponding clock node int DT file, then 
the sensor will get this clock and set the clock rate in DT file.


  parent reply	other threads:[~2016-04-19 10:02 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  7:44 [PATCH 0/2] [media] atmel-isc: add driver for Atmel ISC Songjun Wu
2016-04-13  7:44 ` Songjun Wu
2016-04-13  7:44 ` Songjun Wu
2016-04-13  7:44 ` [PATCH 1/2] [media] atmel-isc: add the Image Sensor Controller code Songjun Wu
2016-04-13  7:44   ` Songjun Wu
2016-04-13 11:29   ` kbuild test robot
2016-04-13 11:29     ` kbuild test robot
2016-04-13 13:31   ` kbuild test robot
2016-04-13 13:31     ` kbuild test robot
2016-04-13 16:01   ` kbuild test robot
2016-04-13 16:01     ` kbuild test robot
2016-04-14  5:44     ` Wu, Songjun
2016-04-14  5:44       ` Wu, Songjun
2016-04-14 14:14       ` Laurent Pinchart
2016-04-14 14:14         ` Laurent Pinchart
2016-04-19  2:28         ` Wu, Songjun
2016-04-19  2:28           ` Wu, Songjun
2016-04-14 16:21   ` Laurent Pinchart
2016-04-14 16:21     ` Laurent Pinchart
2016-04-19  7:46     ` Wu, Songjun
2016-04-19  7:46       ` Wu, Songjun
2016-04-19  9:23       ` Nicolas Ferre
2016-04-19  9:23         ` Nicolas Ferre
2016-04-19 10:02     ` Wu, Songjun [this message]
2016-04-19 10:02       ` Wu, Songjun
2016-04-18  7:24   ` Hans Verkuil
2016-04-18  7:24     ` Hans Verkuil
2016-04-19  8:29     ` Wu, Songjun
2016-04-19  8:29       ` Wu, Songjun
2016-04-13  7:44 ` [PATCH 2/2] [media] atmel-isc: DT binding for Image Sensor Controller driver Songjun Wu
2016-04-13  7:44   ` Songjun Wu
2016-04-13  7:44   ` Songjun Wu
2016-04-14 15:29   ` Rob Herring
2016-04-14 15:29     ` Rob Herring
2016-04-20  2:50     ` Wu, Songjun
2016-04-20  2:50       ` Wu, Songjun
2016-04-20  2:50       ` Wu, Songjun
2016-04-15  9:22   ` Ludovic Desroches
2016-04-15  9:22     ` Ludovic Desroches
2016-04-15  9:22     ` Ludovic Desroches
2016-04-14 14:17 ` [PATCH 0/2] [media] atmel-isc: add driver for Atmel ISC Laurent Pinchart
2016-04-14 14:17   ` Laurent Pinchart
2016-04-14 14:17   ` Laurent Pinchart

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=57160246.2060804@atmel.com \
    --to=songjun.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.