linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Andersson <jan-FkzTOoA/JUnLoDKTGw+V6w@public.gmane.org>
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi: add support for aeroflex gaisler spimctrl
Date: Wed, 04 May 2011 16:46:08 +0200	[thread overview]
Message-ID: <4DC166B0.4090001@gaisler.se> (raw)
In-Reply-To: <4DBC09FB.5070406-FkzTOoA/JUnLoDKTGw+V6w@public.gmane.org>

On 04/30/2011 03:09 PM, Jan Andersson wrote:
> Grant Likely wrote:
>>> +	if (!hw->base) {
>>> +		err = -EBUSY;
>>> +		goto exit;
>>> +	}
>>> +
>>> +	/* check current hw state. if controller is busy, leave it alone */
>>> +	status = ag_spim_read(hw->base + AG_SPIM_STAT);
>>> +	if (status & AG_SPIM_STAT_BUSY) {
>>> +		err = -EBUSY;
>>> +		goto exit_iounmap;
>>> +	}
>>> +
>>> +	/* save control register value to keep settings */
>>> +	hw->ctrl = ag_spim_read(hw->base + AG_SPIM_CTRL);
>>> +
>>> +	/* irq is optional */
>>> +	hw->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
>>
>> The irq should already be populated in the platform_device resource
>> table.  You shouldn't need to call irq_of_parse_and_map().
>>
> 
> I tried replacing the call with platform_get_irq() but did not get a
> sensible value back. I am not familiar with how these structures get
> populated. If I would follow how the irq is obtained in other drivers
> for these SoCs I would have done: hw->irq = pdev->archdata.irqs[0];
> 
> I thought the call to irq_of_parse_and_map was cleaner, and the end
> result is the same. If the use of irq_of_parse_and_map is not acceptable
> I will need to dig deeper.
> 

I checked with a colleague who is more familiar with the driver layer
and SPARC port. IORESOURCE_IRQ will not work on SPARC. It looks like the
proper fix for this is to get rid of pdev_archdata in the SPARC port and
change all the SPARC drivers. That will be done but it may take a while
to complete and get it accepted so it would be great if we could allow
the use of irq_of_parse_and_map(pdev->dev.of_node, 0); for the time being.

Best regards,
  Jan

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd

  parent reply	other threads:[~2011-05-04 14:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 20:41 [PATCH] spi: add support for aeroflex gaisler spimctrl Jan Andersson
     [not found] ` <1304023295-5829-1-git-send-email-jan-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2011-04-29 21:45   ` Grant Likely
2011-04-30 13:09   ` Jan Andersson
     [not found]     ` <4DBC09FB.5070406-FkzTOoA/JUnLoDKTGw+V6w@public.gmane.org>
2011-05-04 14:46       ` Jan Andersson [this message]
     [not found]         ` <4DC166B0.4090001-FkzTOoA/JUnLoDKTGw+V6w@public.gmane.org>
2011-05-04 14:46           ` Grant Likely
2011-04-30 13:11   ` [PATCH V2] " Jan Andersson
     [not found]     ` <1304169112-11224-1-git-send-email-jan-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2011-04-30 13:38       ` [PATCH V3] " Jan Andersson
     [not found]         ` <1304170705-11319-1-git-send-email-jan-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2011-05-20  7:26           ` Jan Andersson

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=4DC166B0.4090001@gaisler.se \
    --to=jan-fkztooa/junlodktgw+v6w@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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).