From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161443AbcHENnz (ORCPT ); Fri, 5 Aug 2016 09:43:55 -0400 Received: from foss.arm.com ([217.140.101.70]:56514 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161130AbcHENnx (ORCPT ); Fri, 5 Aug 2016 09:43:53 -0400 Date: Fri, 5 Aug 2016 14:43:43 +0100 From: Mark Rutland To: Fabien Lahoudere Cc: Mark Brown , Rob Herring , "open list:SPI SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list Subject: Re: [PATCH 1/1] generic spidev devices must be registered Message-ID: <20160805134342.GD25152@leverpostej> References: <1470402714-10798-1-git-send-email-fabien.lahoudere@collabora.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470402714-10798-1-git-send-email-fabien.lahoudere@collabora.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 05, 2016 at 03:11:53PM +0200, Fabien Lahoudere wrote: > Adding spidev in the compatible list, let configure spidev from device tree > instead of C source code. I'm not keen on this. It ties the hardware description to today's use-case, and leaves the DT without information regarding the particuarl device. The binding is also written in terms of the userspace interface, which is backwards. So NAK to this as-is. Thanks, Mark. > > Signed-off-by: Fabien Lahoudere > --- > Documentation/devicetree/bindings/spi/spidev.txt | 16 ++++++++++++++++ > drivers/spi/spidev.c | 1 + > 2 files changed, 17 insertions(+) > create mode 100644 Documentation/devicetree/bindings/spi/spidev.txt > > diff --git a/Documentation/devicetree/bindings/spi/spidev.txt b/Documentation/devicetree/bindings/spi/spidev.txt > new file mode 100644 > index 0000000..23200f2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/spi/spidev.txt > @@ -0,0 +1,16 @@ > +* SPIDEV > + > +spidev is a device driver to access to SPI devices using normal userspace I/O calls. > +To make an SPI device compatible with this drivers add: > + > +Required properties: > +- compatible : should be "spidev". > + > +Example: > + > +spidev0: spi@0 { > + compatible = "spidev"; > + reg = <0>; > + spi-max-frequency = <1000000>; > + status = "okay"; > +}; > diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c > index 2e05046..d780491 100644 > --- a/drivers/spi/spidev.c > +++ b/drivers/spi/spidev.c > @@ -696,6 +696,7 @@ static struct class *spidev_class; > static const struct of_device_id spidev_dt_ids[] = { > { .compatible = "rohm,dh2228fv" }, > { .compatible = "lineartechnology,ltc2488" }, > + { .compatible = "spidev" }, > {}, > }; > MODULE_DEVICE_TABLE(of, spidev_dt_ids); > -- > 2.7.4 >