devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
To: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	software-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 1/2] i2c: i2c-ocores: Add irq support for sparc
Date: Wed, 24 Oct 2012 11:05:04 +0200	[thread overview]
Message-ID: <5087AF40.7090105@gaisler.com> (raw)
In-Reply-To: <87wqyhlzfv.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>

On 10/23/2012 10:13 PM, Peter Korsgaard wrote:
>>>>>> "Andreas" == Andreas Larsson <andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org> writes:
>
>   Andreas> There are no platform resources of type IORESOURCE_IRQ on
>   Andreas> sparc, so the irq number is acquired in a different manner for
>   Andreas> sparc. The general case uses platform_get_irq, that internally
>   Andreas> still uses platform_get_resource.
>
> I have no idea why sparc is being odd in this regard, but assuming this
> is how it's done, I'm fine with this change.
>
> A quick grep doesn't find any other drivers doing this though:
>
> git grep -l archdata.irqs drivers | xargs grep platform_get_irq
>
> Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>

Other drivers that work both on sparc and on other platforms usually use 
irq_of_parse_and_map on a corresponding device_node. For non-sparc 
architectures irq_of_parse_and_map sets up mappings that needs to be 
teared down on module exit. Sparc however has its own version of 
irq_of_parse_and_map that just returns the irq number using archdata.irq[].

I am trying to get through a patch platform_get_irq to work for sparc as 
well. If that eventually goes through, the CONFIG_SPARC stuff can then 
be removed cleanly from this driver withouth having to mess with 
irq_of_parse_and_map and tearing mappings down.

Another solution is to use irq_of_parse_and_map for the of-case if no 
irq was found using platform_get_irq. But that would make for more 
rearrangements and add the need for irq_dispose_mapping to be added on 
module exit as well (even though the disposing would do nothing for sparc).

Cheers,
Andreas Larsson

  parent reply	other threads:[~2012-10-24  9:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 15:03 [PATCH 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller Andreas Larsson
     [not found] ` <1351004637-11049-1-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2012-10-23 15:03   ` [PATCH 1/2] i2c: i2c-ocores: Add irq support for sparc Andreas Larsson
     [not found]     ` <1351004637-11049-2-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2012-10-23 20:13       ` Peter Korsgaard
     [not found]         ` <87wqyhlzfv.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2012-10-24  9:05           ` Andreas Larsson [this message]
2012-10-23 15:03   ` [PATCH 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions Andreas Larsson
2012-10-23 20:24     ` Peter Korsgaard
2012-10-24  9:05       ` Andreas Larsson
     [not found]         ` <5087AF46.1070707-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2012-10-24 11:48           ` Peter Korsgaard

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=5087AF40.7090105@gaisler.com \
    --to=andreas-fkztooa/julbdgjk7y7tuq@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=software-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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).