From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ppsw-52.csi.cam.ac.uk ([131.111.8.152]:55373 "EHLO ppsw-52.csi.cam.ac.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755870Ab1JMOqE (ORCPT ); Thu, 13 Oct 2011 10:46:04 -0400 Message-ID: <4E96F9AC.9000001@cam.ac.uk> Date: Thu, 13 Oct 2011 15:46:04 +0100 From: Jonathan Cameron MIME-Version: 1.0 To: Mark Brown CC: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, zdevai@gmail.com, linus.walleij@linaro.org Subject: Re: [PATCH] staging:iio:proof of concept in kernel interface. References: <1318333383-17663-1-git-send-email-jic23@cam.ac.uk> <1318333383-17663-2-git-send-email-jic23@cam.ac.uk> <20111013143224.GO1098@sirena.org.uk> In-Reply-To: <20111013143224.GO1098@sirena.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 10/13/11 15:32, Mark Brown wrote: > On Tue, Oct 11, 2011 at 12:43:03PM +0100, Jonathan Cameron wrote: > >> +struct iio_dev *iio_find_dev(const char *name); >> +void iio_release_dev(struct iio_dev *indio_dev); > > This looks like it should really be clk style with a struct device and a > back end interface that deals with mapping the provider to consumers at > runtime. Agreed. That definitely looks like the best discovery interface out there at the moment. Will reroll with the equivalent. We'll have to play a few games in the drivers to map back to the underlying bus names so that we have consistent naming. (simple callback). > >> + /* read from channel 1 and exit */ >> + ret = indio_dev->info->read_raw(indio_dev, &indio_dev->channels[0], &val, &val2, 0); > > I guess an actual implementation would have wrappers for doing the > indirections rather than having users peer into the ops table directly? > Yup, for some reason the cover letter seems to have detached from this. It suggested exactly that. There may be weird cases where peering this deep into the ops makes sense, but not for something like this one.