linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Medhurst (Tixy)" <tixy@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 1/3] amba-clcd: Add Device Tree support to amba-clcd driver
Date: Wed, 10 Oct 2012 10:13:26 +0000	[thread overview]
Message-ID: <1349864006.3354.35.camel@linaro1.home> (raw)
In-Reply-To: <1348070666-9153-2-git-send-email-ryan.harkin@linaro.org>

On Wed, 2012-09-19 at 17:04 +0100, Ryan Harkin wrote:
> Add support to parse the display configuration from device tree.
> 
> If the board does not provide platform specific functions in the struct
> clcd_board contained with the amba device info, then defaults are provided
> by the driver.
> 
> The device tree configuration can either ask for a DMA setup or provide a
> framebuffer address to be remapped into the driver.
> 
> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
> ---

<big snip>

>  static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
>  {
>  	struct clcd_board *board = dev->dev.platform_data;
>  	struct clcd_fb *fb;
>  	int ret;
>  
> +#ifdef CONFIG_OF
> +	if (dev->dev.of_node) {
> +		const __be32 *prop;
> +		int len, na, ns;
> +		phys_addr_t reg_base;
> +
> +		na = of_n_addr_cells(dev->dev.of_node);
> +		ns = of_n_size_cells(dev->dev.of_node);
> +
> +		prop = of_get_property(dev->dev.of_node, "reg", &len);
> +		if (WARN_ON(!prop || len < (na + ns) * sizeof(*prop)))
> +			return -EINVAL;
> +		reg_base = of_read_number(prop, na);
> +
> +		if (dev->res.start != reg_base)
> +			return -EINVAL;

When the motherboard CLCD is used, the CLCD node is under the iofga node
and has a reg value equal to the offset from the start of the iofgpa,
however dev->res.start holds the calculated address of the start of the
iofga region plus the offset of the clcd, this means that the above
check fails.

The question is, what is the purpose of this check? Can't we rely on the
value of dev->res.start being consistent with dev->dev.of_node and so
just drop all the above code from "const __be32 *prop" onwards?

-- 
Tixy


  parent reply	other threads:[~2012-10-10 10:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 16:04 [RFC PATCH 0/3] amba-clcd: add device tree support Ryan Harkin
2012-09-19 16:04 ` [RFC PATCH 1/3] amba-clcd: Add Device Tree support to amba-clcd driver Ryan Harkin
2012-09-20 10:24   ` Liviu Dudau
2012-09-21 10:35     ` Ryan Harkin
2012-09-21 10:44       ` Pawel Moll
2012-09-21 11:02   ` Russell King - ARM Linux
2012-09-21 11:43   ` Sascha Hauer
2012-09-21 12:19     ` Russell King - ARM Linux
2012-09-24  7:07       ` Ryan Harkin
2012-10-10 10:13   ` Jon Medhurst (Tixy) [this message]
2012-09-19 16:04 ` [RFC PATCH 2/3] ARM: vexpress: Add device tree support for CLCD driver Ryan Harkin
2012-09-19 16:11   ` Pawel Moll
2012-09-19 16:04 ` [RFC PATCH 3/3] ARM: vexpress: configure CLCD driver device tree support for A9 CoreTile Ryan Harkin
2012-09-20 10:29   ` Liviu Dudau

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=1349864006.3354.35.camel@linaro1.home \
    --to=tixy@linaro.org \
    --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 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).