linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/7] ARM: davinci, intc: Add OF support for TI interrupt controller
Date: Sun, 20 May 2012 16:28:08 +0530	[thread overview]
Message-ID: <4FB8CE40.4030404@ti.com> (raw)
In-Reply-To: <20120519061628.663F53E046E@localhost>

On 5/19/2012 11:46 AM, Grant Likely wrote:
> On Mon,  5 Mar 2012 12:09:58 +0100, Heiko Schocher <hs@denx.de> wrote:
>> Add a function to initialize the Common Platform Interrupt Controller
>> (cp_intc) from TI used on OMAP-L1x SoCs using a device tree node.
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> Cc: davinci-linux-open-source at linux.davincidsp.com
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: devicetree-discuss at lists.ozlabs.org
>> Cc: Grant Likely <grant.likely@secretlab.ca>
>> Cc: Sekhar Nori <nsekhar@ti.com>
>> Cc: Wolfgang Denk <wd@denx.de>
>> Cc: Sergei Shtylyov <sshtylyov@mvista.com>
>>
>> ---

>> @@ -165,13 +197,48 @@ void __init cp_intc_init(void)
>>  		for (i = 0; host_map[i] != -1; i++)
>>  			cp_intc_write(host_map[i], CP_INTC_HOST_MAP(i));
>>  
>> -	/* Set up genirq dispatching for cp_intc */
>> -	for (i = 0; i < num_irq; i++) {
>> -		irq_set_chip(i, &cp_intc_irq_chip);
>> -		set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
>> -		irq_set_handler(i, handle_edge_irq);
>> +	if (node) {
>> +		irq_base = irq_alloc_descs(-1, 0, num_irq, 0);
>> +		if (irq_base < 0) {
>> +			pr_warn("Couldn't allocate IRQ numbers\n");
>> +			irq_base = 0;
>> +		}
>> +
>> +		/* create a legacy host */
>> +		cp_intc_domain = irq_domain_add_legacy(node, num_irq,
>> +					irq_base, 0, &cp_intc_host_ops, NULL);
>> +		if (cp_intc_domain == NULL) {
>> +			pr_err("CP INTC: failed to allocate irq host!\n");
>> +			return -EINVAL;
>> +		}
>> +	} else {
>> +		/* Set up genirq dispatching for cp_intc */
>> +		for (i = 0; i < num_irq; i++) {
>> +			irq_set_chip(i, &cp_intc_irq_chip);
>> +			set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
>> +			irq_set_handler(i, handle_edge_irq);
>> +		}
> 
> No need for the if/else clause here.  irq_domain should be used for
> both DT and non-DT.  It makes the code a lot simpler that way.  The
> only difference I would suggest is to call irq_domain_add_linear() in
> the DT case instead of irq_domain_add_legacy()...  and this is
> temporary too until I fix up the irq_domain code to better handle both
> static and dynamic mapping.

It will also help to do the irq_domain conversion in a separate patch.
That way irq_domain conversion can be reviewed separately from DT
conversion.

Thanks,
Sekhar

  reply	other threads:[~2012-05-20 10:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 11:09 [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher
2012-03-05 11:09 ` [PATCH v3 1/7] ARM: davinci, intc: Add OF support for TI interrupt controller Heiko Schocher
2012-05-19  6:16   ` Grant Likely
2012-05-20 10:58     ` Sekhar Nori [this message]
2012-05-26  1:05   ` Grant Likely
2012-05-29 13:07     ` Heiko Schocher
2012-03-05 11:09 ` [PATCH v3 2/7] ARM: davinci: configure davinci aemif chipselects through OF Heiko Schocher
2012-03-05 11:10 ` [PATCH v3 3/7] ARM: davinci: mux: add OF support Heiko Schocher
2012-03-05 11:10 ` [PATCH v3 4/7] ARM: davinci: net: davinci_emac: " Heiko Schocher
2012-05-15 18:08   ` Nori, Sekhar
2012-05-17  6:32     ` Heiko Schocher
2012-05-17  7:21       ` Sekhar Nori
2012-03-05 11:10 ` [PATCH v3 5/7] ARM: davinci: i2c: " Heiko Schocher
2012-03-05 11:10 ` [PATCH v3 6/7] ARM: mtd: nand: davinci: add OF support for davinci nand controller Heiko Schocher
2012-03-05 11:10 ` [PATCH v3 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher
2012-05-04 15:33 ` [PATCH v3 0/7] " Heiko Schocher
2012-05-04 18:36   ` Sekhar Nori

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=4FB8CE40.4030404@ti.com \
    --to=nsekhar@ti.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 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).