Devicetree
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Shaju Abraham <shaju.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH 5/7] Samsung: SMDKV210: Init Timer Using Device tree
Date: Thu, 23 Sep 2010 14:01:46 -0600	[thread overview]
Message-ID: <20100923200146.GE17400@angua.secretlab.ca> (raw)
In-Reply-To: <1284977997-30807-1-git-send-email-shaju.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Mon, Sep 20, 2010 at 03:49:57PM +0530, Shaju Abraham wrote:
> Get the irq number and virtual address to be used from the
> device tree. Initialise the timer using these parameters.
> 
> Signed-off-by: Shaju Abraham <shaju.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  arch/arm/plat-s5p/irq_dt.c |   29 +++++++++++++++++++++++------
>  1 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/plat-s5p/irq_dt.c b/arch/arm/plat-s5p/irq_dt.c
> index 2fca196..317348f 100644
> --- a/arch/arm/plat-s5p/irq_dt.c
> +++ b/arch/arm/plat-s5p/irq_dt.c
> @@ -58,7 +58,28 @@ static struct s3c_uart_irq uart_irqs[] = {
>  	},
>  #endif
>  };
> +int s5p_dt_init_vic_timer_irq(void)
> +{
> +	struct device_node *node;
> +	int err = -ENODEV, irq = 0;
> +	const u32 *prop;
> +	u32 virt_irq = 0;
>  
> +	for_each_compatible_node(node, NULL , "samsung,s5p-timer") {
> +		prop = of_get_property(node, "interrupts", NULL);
> +		if (prop == NULL) {
> +			printk(KERN_ERR "No Irq defined for %s timer\n",
> +				node->name);
> +			return err;
> +		}
> +		irq = of_read_ulong(prop, 1);
> +		s3c_init_vic_timer_irq(S5P_IRQ_VIC0(irq),
> +					S5P_TIMER_IRQ(virt_irq));
> +		virt_irq++;
> +	}
> +	of_node_put(node);
> +	return 0;
> +}
>  
>  static int __init s5p_dt_vic_init(void)
>  {
> @@ -88,11 +109,7 @@ void __init s5p_dt_init_irq(void)
>  
>  	/* initialize the VICs */
>  	s5p_dt_vic_init();
> -	s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
> -	s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
> -	s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
> -	s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
> -	s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
> -
> +	if (s5p_dt_init_vic_timer_irq())
> +		printk(KERN_ERR"s5p_dt Timer init Failed\n");

Ah, heh.  Forget my comment from the last patch as you are doing what
I suggested here.  You can probably merge this patch with the previous
patch.


>  	s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
>  }
> -- 
> 1.7.2
> 
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

      parent reply	other threads:[~2010-09-23 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 10:19 [PATCH 5/7] Samsung: SMDKV210: Init Timer Using Device tree Shaju Abraham
     [not found] ` <1284977997-30807-1-git-send-email-shaju.abraham-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2010-09-23 20:01   ` Grant Likely [this message]

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=20100923200146.GE17400@angua.secretlab.ca \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=shaju.abraham-QSEj5FYQhm4dnm+yROfE0A@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