linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roland Stigge <stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Device tree conversion of spi device vs. controller_data
Date: Sat, 28 Apr 2012 12:39:30 +0200	[thread overview]
Message-ID: <4F9BC8E2.20005@antcom.de> (raw)
In-Reply-To: <20120427180344.F023D3E171B@localhost>

On 27/04/12 20:03, Grant Likely wrote:
>>> Can you point me at specific code?
>>>
>>> .controller_data is owned by the spi_master driver.  The eeprom driver
>>> shouldn't be accessing it directly at all; but I'll need to look at
>>> specific code to really understand what is going on.
>>
>> Please have a look at arch/arm/mach-lpc32xx/phy3250.c :
>>
>> static struct pl022_config_chip spi0_chip_info = {
>>         .com_mode               = INTERRUPT_TRANSFER,
>>         .iface                  = SSP_INTERFACE_MOTOROLA_SPI,
>>         .hierarchy              = SSP_MASTER,
>>         .slave_tx_disable       = 0,
>>         .rx_lev_trig            = SSP_RX_4_OR_MORE_ELEM,
>>         .tx_lev_trig            = SSP_TX_4_OR_MORE_EMPTY_LOC,
>>         .ctrl_len               = SSP_BITS_8,
>>         .wait_state             = SSP_MWIRE_WAIT_ZERO,
>>         .duplex                 = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
>>         .cs_control             = phy3250_spi_cs_set,
> 
> phy3250_spi_cs_set is only a wrapper around gpio_set_value().  GPIO CS
> manipulation should be handled by the core pl022 spi driver, so that
> gets rid of the hardest part of this conversion (callbacks in platform
> data).
> 
> The pl022_config_chip structure is 100% owned by the spi controller
> (pl022).  If the bus driver depends on this structure, then it is the
> responsibility of the bus driver to allocate one and set the
> controller data pointer for each of the child devices.  You may need
> to add pl022-specific properties to each of the child nodes to
> populate this data correctly if it cannot be determined with other
> means.

Yes, that's what I'll need to do.

Thanks!

Roland

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

      reply	other threads:[~2012-04-28 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-08 10:24 Device tree conversion of spi device vs. controller_data Roland Stigge
     [not found] ` <4F816772.5000607-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-04-13  3:29   ` Grant Likely
2012-04-13  7:10     ` Roland Stigge
     [not found]       ` <4F87D157.2020700-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-04-27 18:03         ` Grant Likely
2012-04-28 10:39           ` Roland Stigge [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=4F9BC8E2.20005@antcom.de \
    --to=stigge-uj/7r2tj6vmzqb+pc5nmwq@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@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).