linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging:iio: fixed version of the differential handling patch.
@ 2011-08-31 12:04 Jonathan Cameron
  2011-08-31 12:04 ` [PATCH] staging:iio: Differential channel handling - use explicit flag rather than types Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2011-08-31 12:04 UTC (permalink / raw)
  To: linux-iio; +Cc: michael.hennerich, Jonathan Cameron

This hopefully gets the event code asignment right.

Please sanity check.  I'll push the tree up later when hera is back up.

Jonathan

Jonathan Cameron (1):
  staging:iio: Differential channel handling - use explicit flag rather
    than types.

 drivers/staging/iio/adc/ad7192.c        |    8 +-
 drivers/staging/iio/adc/ad7280a.c       |   26 +++--
 drivers/staging/iio/adc/ad7793.c        |  176 ++++++++++++++++++++--------
 drivers/staging/iio/adc/max1363_core.c  |  198 ++++++++++++++-----------------
 drivers/staging/iio/iio.h               |    3 +-
 drivers/staging/iio/industrialio-core.c |  145 ++++++++++++-----------
 drivers/staging/iio/sysfs.h             |   11 +-
 7 files changed, 323 insertions(+), 244 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: RFC: Does separate types for differential signals make sense?
@ 2011-08-18 12:09 Michael Hennerich
  2011-08-18 12:29 ` [PATCH] staging:iio: Differential channel handling - use explicit flag rather than types Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Hennerich @ 2011-08-18 12:09 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org

On 08/18/2011 12:18 PM, Jonathan Cameron wrote:
> Hi All,
>
> Whilst working on some of the capacitance adc drivers yesterday I added a second
> differential type.   Whilst we only had IIO_VOlTAGE_DIFF, it seemed easier to
> handle it as a special case - now we have IIO_CAPACITANCE_DIFF, I'm not so sure.
IIO_CURRENT_DIFF is also likely to be added in future...

> The alternative is to add another flag to struct iio_chan_spec and build the
> differential names automatically (easy enough I think).  Nastier is how to handle
> the related event codes.  As we haven't pushed out the new 64 bit codes, this
> is a perfect time to slip in a change there (rather than two changes back to back.)
> Current macro to generate codes is:
>
> define IIO_EVENT_CODE(chan_type, modifier, direction,			\
> 		       type, chan, chan1, chan2)			\
> 	(((u64)type<<  56) | ((u64)direction<<  48) | ((u64)modifier<<  40) | \
> 	 ((u64)chan_type<<  32) | (chan2<<  16) | chan1 | chan)
>
> So if we were to steal a bit to mark channels as differential, where would we do it?
> Obvious choice is in type - reducing max number of types to 128 - can't see that being
> a problem any time soon.  Could pinch the top bit off direction instead - that one
> has way more values than I can think of uses for...
In the way we use chan_type today - I think it would be the best spot.
> This is going to be an annoyingly invasive patch to do. I'll probably scrap the
> use of the IIO_CHAN macro for all differential channels rather than adding another
> parameter to it. Plan was to scrap that macro entirely eventually, so not such a
> bad thing.
>
> Jonathan
>
>


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif

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

end of thread, other threads:[~2011-08-31 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-31 12:04 [PATCH] staging:iio: fixed version of the differential handling patch Jonathan Cameron
2011-08-31 12:04 ` [PATCH] staging:iio: Differential channel handling - use explicit flag rather than types Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-08-18 12:09 RFC: Does separate types for differential signals make sense? Michael Hennerich
2011-08-18 12:29 ` [PATCH] staging:iio: Differential channel handling - use explicit flag rather than types Jonathan Cameron

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