Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757444AbbLBCOe (ORCPT ); Tue, 1 Dec 2015 21:14:34 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:59497 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755288AbbLBCOc (ORCPT ); Tue, 1 Dec 2015 21:14:32 -0500 Date: Tue, 1 Dec 2015 18:14:29 -0800 From: Guenter Roeck To: Marc Titinger Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors Message-ID: <20151202021429.GA19098@roeck-us.net> References: <1448884155-2546-1-git-send-email-mtitinger@baylibre.com> <1448884155-2546-2-git-send-email-mtitinger@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448884155-2546-2-git-send-email-mtitinger@baylibre.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1959 Lines: 52 On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: > in SOFTWARE buffer mode, a kthread will capture the active scan_elements > into a kfifo, then 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). > > Tested with ina226, on BeagleBoneBlack. > > Datasheet: http://www.ti.com/lit/gpn/ina226 > > Signed-off-by: Marc Titinger > --- > drivers/iio/adc/Kconfig | 9 + > drivers/iio/adc/Makefile | 1 + > drivers/iio/adc/ina2xx-iio.c | 678 +++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 688 insertions(+) > create mode 100644 drivers/iio/adc/ina2xx-iio.c > + [ ... ] > + > +static const struct i2c_device_id ina2xx_id[] = { > + {"ina219", ina219}, > + {"ina220", ina219}, > + {"ina226", ina226}, > + {"ina230", ina226}, > + {"ina231", ina226}, > + {} > +}; I wonder what is going to happen if both this driver and the hwmon driver for the same chips are configured in a system which supports devicetree (or any system, really). Unless I am missing something, the result will be that both drivers will try to instantiate, and one will fail with -EBUSY. Or the instantiated driver is more or less random, depending on which one happens to be loaded. Not a good situation to be in. For the time being, it might make sense to add cross-dependencies in Kconfig to only permit one of the two drivers to be configured. Ultimately we may need a better solution for the iio-hwmon bridge, one that makes the underlying driver transparent in both devicetree properties and user space ABI. No idea how to do that, though. Guenter -- 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/