Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbbKNSoM (ORCPT ); Sat, 14 Nov 2015 13:44:12 -0500 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:41379 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbbKNSoI (ORCPT ); Sat, 14 Nov 2015 13:44:08 -0500 Subject: Re: [RFC 4/4] iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo. To: Marc Titinger , Lars-Peter Clausen , knaack.h@gmx.de, pmeerw@pmeerw.net References: <1447171653-12756-1-git-send-email-mtitinger@baylibre.com> <1447171653-12756-5-git-send-email-mtitinger@baylibre.com> <56423613.6090403@metafoo.de> <5644675A.2080308@baylibre.com> Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, mturquette@baylibre.com, bcousson@baylibre.com, ptitiano@baylibre.com From: Jonathan Cameron X-Enigmail-Draft-Status: N1110 Message-ID: <564780F6.5040300@kernel.org> Date: Sat, 14 Nov 2015 18:44:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5644675A.2080308@baylibre.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3336 Lines: 90 On 12/11/15 10:18, Marc Titinger wrote: > On 10/11/2015 19:23, Lars-Peter Clausen wrote: >> On 11/10/2015 05:07 PM, Marc Titinger wrote: >>> Capture the active scan_elements into a kfifo. >>> The capture thread will compute the remaining time until the next capture >>> tick, and do an active wait (udelay). >>> >>> This will produce a stream of up to fours channels plus a 64bits >>> timestamps (ns). >>> >>> # iio_readdev ina226 | od -x >>> WARNING: High-speed mode not enabled >>> 0000000 042f 0d5a 002e 010c 4be8 4eb4 0013 0000 >>> 0000020 0430 0d5a 002e 010c a704 4f3e 0013 0000 >>> 0000040 0430 0d5a 002e 010c b477 4fc7 0013 0000 >>> 0000060 042f 0d5b 002e 010c 8052 5050 0013 0000 >>> 0000100 042f 0d5b 002e 010c 5d92 50d8 0013 0000 >>> 0000120 0430 0d5a 002e 010c fa59 515e 0013 0000 >>> 0000140 0430 0d5b 002e 010c 95d2 51e5 0013 0000 >>> >>> Signed-off-by: Marc Titinger > > Hi Lars, > >> >> Interesting approach. I think if we are going to due this we want to make >> this kind of emulation generic. Have you seen the software trigger and >> configfs support patches[1] from Daniel? It kind of achieves the same as you >> do, but using hrtimers. > > I totally agree, let me have a look on those patches maybe I could > add an active waiting scheme for platforms w/o hrtimers ? I've no idea if this is a remotely common case any more but in theory I'd have no objection to such a patch though I would like it to be a stand alone trigger similar to that used in the patch Daniel has submitted. >> >>> >>> --- >>> Ina2xx does not support auto-increment, hence the capture threads sticks >>> with single register reads instead of regmap_bulk_read. >>> >>> The proper scales must be applied to those raw register >>> values, I'm in favor of doing the conversion in userland in a client plugin >> >> Yes, conversion should not be done in kernel space, we don't want to impose >> the performance penalty on users which don't need it and you can typically >> do it faster in userspace anyway where you have floats and SSE and what not. >> >>> for instance a sigrok >> >> Slightly OT, but do you already have some Sigrok IIO support? I have this >> scheduled for end of the month, maybe we can align our strategies here and >> avoid duplicated work. > > How fortunate! I've started some preliminary work like cloning the > demo driver into a skeletton for 'hardware/generic-iio/api.c', adding > the build/ac plumbing, and linking to libiio with the idea of using > iio_info to create a generic enumeration of the iio-context into > sigrok channels. > > Now, I'm not familiar with Glib and it might not be my prio until a > couple of weeks, so I'd be super happy to wait for you if you are > keen to do that part :) > > What would be the best spot to chat about this ? > > Marc. > > >> >> - Lars >> >> [1] https://lkml.org/lkml/2015/8/10/877 >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/