linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Spi slave devices with two chip selects, how best to handle?
@ 2010-11-25 22:08 J.I. Cameron
       [not found] ` <Prayer.1.3.3.1011252208210.17045-rNEEB5iaIwQgWVoWv9+vLtDNj2e20MGE@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: J.I. Cameron @ 2010-11-25 22:08 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: drivers-OyLXuOCK7orQT0dZR+AlfA, David Brownell

Hi,

I've just been looking through some recent drivers from Analog Devices that 
are in staging-next (and hence linux-next 
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=drivers/staging/iio/gyro/adis16060_core.c;h=fc48aca04bd3420b705b79d3cbb5c0117e187568;hb=HEAD 
) and ran into something I haven't seen before.

The adis16060
http://www.analog.com/static/imported-files/data_sheets/ADIS16060.pdf
uses two chip selects. One is for writing to the device and one
is for reading.

At the moment, the adis16060 driver registers a pair of spi drivers, 
adis16060_r and adis16060_w. The problem comes in how these two get 
information about each other. Currently there is a global pointer in that 
file. Obviously this means that we can only have one of these devices 
running at a time and should be removed. So what I'm basically asking is if 
anyone else has run into a similar situation and what their solution was. 
We could put a magic code in the platform data for the two devices and use 
that to link them together but that's ugly and would mean having the driver 
handle lists of the drivers that are currently registered but not paired so 
as to be able to pair them up. Anyone have a better idea or an example of 
what someone else has done in similar circumstances?

Thanks,

Jonathan 

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-29 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 22:08 Spi slave devices with two chip selects, how best to handle? J.I. Cameron
     [not found] ` <Prayer.1.3.3.1011252208210.17045-rNEEB5iaIwQgWVoWv9+vLtDNj2e20MGE@public.gmane.org>
2010-11-26  4:02   ` Grant Likely
     [not found]     ` <AANLkTi=0tP4phH2=iZf7=R7iqazC2Vru+EB3B2M=sQN2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-26  4:19       ` David Brownell
     [not found]         ` <301691.11173.qm-4JhmkcZgSkkHBU+L9ui1Svu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-11-26 14:39           ` Jonathan Cameron
     [not found]             ` <4CEFC686.30603-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2010-11-29 12:16               ` Hennerich, Michael

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).