Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751838AbbDZMzH (ORCPT ); Sun, 26 Apr 2015 08:55:07 -0400 Received: from down.free-electrons.com ([37.187.137.238]:33778 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751273AbbDZMzE (ORCPT ); Sun, 26 Apr 2015 08:55:04 -0400 Date: Sun, 26 Apr 2015 14:51:13 +0200 From: Maxime Ripard To: Michal Suchanek Cc: Martin Sperl , Hans de Goede , Mark Brown , linux-sunxi , Jonathan Corbet , linux-spi , linux-doc , Linux Kernel Mailing List Subject: Re: [linux-sunxi] [PATCH 2/3] spidev: Add DT binding example. Message-ID: <20150426125113.GF5627@lukather> References: <20150426103257.GJ22845@sirena.org.uk> <20150426110144.GK22845@sirena.org.uk> <553CCABA.3090504@redhat.com> <12F80B18-7418-430E-94F7-5A20C133BA9A@martin.sperl.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NGIwU0kFl1Z1A3An" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4235 Lines: 115 --NGIwU0kFl1Z1A3An Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 26, 2015 at 02:38:18PM +0200, Michal Suchanek wrote: > On 26 April 2015 at 13:56, Martin Sperl wrote: > > > >> On 26.04.2015, at 13:23, Hans de Goede wrote: > >> I think there is actual a use for just binding spidev as spidev, > >> think e.g. the spi pins on the raspberry pi. > >> > >> How do you deal we suggest with such a situation ? > > > > I actually asked the same question a few days ago on the spi list > > (in thread: "spi: spidev: Warn loudly if instantiated from DT as =E2=80= =9Cspidev=E2=80=9D) > > and the summary was: > > > > You can still do as before, but you have to accept that long > > irritating warning. > > > > Or you patch spidev.c to include your pattern of choice for compatiblity >=20 > So the suggestion is to add a compatible string like olimex,uext-slot > to spidev and use that compatible in the DT? No, you add a compatible for the device that is connected to the bus through that slot. > That can certainly be done but adding a new compatible for every board > that has some random pins looks like a needless nuisance to me. > Especially compared to i2c where you can just open the bus so long as > ti is enabled. >=20 > > > > Or you implement the following proposal (which needs a volunteer): > >> On 23.04.2015, at 09:42, Geert Uytterhoeven wro= te: > >> > >> So what you need is a way to handover from generic spidev to a device-= specific > >> driver, cfr. what graphics drivers do when the device has been bound t= o by > >> vesafb or simplefb. > >> > >> Could this be implemented in a generic way in the spi or DT code? > > > > ... > >> On 23.04.2015, at 12:36, Mark Brown wrote: > >> On Thu, Apr 23, 2015 at 09:45:16AM +0200, Geert Uytterhoeven wrote: > >> > >>> I guess this has been suggested before: the spi core could provide sp= idev > >>> access to all spi client devices which are not bound by a driver? > >> > >> I don't know if it's been suggested before, certainly nobody did the > >> work to make it happen. I don't think I have a massive objection in > >> principal. Actually, I did it a year ago, and it looked at the time that it wasn't what should be done either. https://lkml.org/lkml/2014/4/28/612 > But how do you know there is a device? >=20 > Devices on i2c can be probed. On spi you just transfer random data and > hope it does something useful. Some devices have readable registers > and can be probed in a device-specific way but others are write-only. Well, what's the point of communicating with a non-existent device in the first place? > So binding spidev is in my view just saying that you are going to > transfer random data from userspace on this bus. Yes, to a device connected on that bus. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --NGIwU0kFl1Z1A3An Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVPN9BAAoJEBx+YmzsjxAgSRwP/RRETp7lLYW9gRAbX2oBjZvI WXw8GubLY0uPqbDhzqMvcoeQ2YQNzWu0xiA0yR+/s8P8a2fMBe6A7chcPMmPHkoz yY8RWSpoFoqEaHmk1QfMfhR9OqbwmG1QRtqEtmEeJ5fSkaPVJOLnOnZW8SIdTW4C Ha/fBP07Eaxtg+kcH+QFzoKx2fjSVNmoEXr5bWwStjeDC0ZXvTgTFIX7eZKxwvuY YHpbRLg0S9QbPQz/hQhI7eFnGhsojZic2C5uReN2NRDAbgm/mnEJYRl36NSUwER0 W2tjuaOEjaJ/lVxcb3PM2GboaYmb7L1FhTIMsTpzpAk77mkx7s5ekgsU1FXdV7Ku GWM152YYBaTnVZfFRjrFqLCOrWRGvXo9S/YlUk+zb3Ga0af+URjxXGdO3BXDnECb rzi4C72yHRrppPPPjpFeinyJkOP9YanlpUJ7ZGdV8Az3OGmekJ+rf4d9/BKh1Ycp 8HnsFyWo+2rzKmVyUNQrW7PplZJ8uJq0TQKy17pJ4oYeE5vzx4iPuaqFNroDM5w1 BsYTtsyt+34QJ+Azbf7Rlp118uWr62pdSiTG+3Jkneovnx7wl7I9gihEkGo9nO5L andRmHWAXcZLVg48Jm3yrADOpZ1BBPBLbhDsCe1vJJLaJkrM+arMv1uIeK8Fgdmp tJazTvu5tf8fv+gRRbrM =prAV -----END PGP SIGNATURE----- --NGIwU0kFl1Z1A3An-- -- 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/