devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Priit Laes <plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Re: [PATCH] ARM: dts: sun4i: Add dts file for the pov protab2-ips9 tablet
Date: Thu, 10 Sep 2015 15:56:10 +0200	[thread overview]
Message-ID: <20150910135610.GI9885@lukather> (raw)
In-Reply-To: <55EE92E0.1010805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

On Tue, Sep 08, 2015 at 09:48:48AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 07-09-15 22:52, Maxime Ripard wrote:
> >Hi,
> >
> >On Mon, Sep 07, 2015 at 11:30:03AM +0200, Hans de Goede wrote:
> >>>>>bma250 already has devicetree support. It is used in Gemei G9
> >>>>>tablet (sun4i-gemei-g9.dts).
> >>>>
> >>>>Yes I've seen that, but does it actually work? I've not tried but
> >>>>I do not see any compatible string in the actual bma250 code in
> >>>>the kernel, so I believe that this part of the sun4i-gemei-g9.dts
> >>>>file does not work ?
> >>>
> >>>It worked (even without IRQs) when I submitted the patch. Driver
> >>>itself is under iio/accel/bma180.c
> >>
> >>That is really weird, because:
> >>
> >>https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/accel/bma180.c
> >>
> >>Does not have an of_match_table ... ??
> >
> >Not really, when using DT, i2c will set the i2c_client name to the
> >device part of the compatible [1] [2], and then if the of_device_id
> >lookup fails, will fallback to matching the i2c_client name to the
> >i2c_device_id [3]. Which in our case matches.
> >
> >Maxime
> >
> >[1] http://lxr.free-electrons.com/source/drivers/i2c/i2c-core.c#L1281
> >[2] http://lxr.free-electrons.com/source/drivers/i2c/i2c-core.c#L969
> >[3] http://lxr.free-electrons.com/source/drivers/i2c/i2c-core.c#L461
> 
> Hmm, not sure whether that is a useful feature or an ugly hack :)

Don't shoot the messenger :)

But I don't know either.

> It is sorta unexpected either way. But I can make good use of this to
> enable the accelerometer and maybe also some touchscreens on a bunch of
> boards I have.
> 
> Still should we rely on this? This means relying on Linux kernel behavior,
> rather then something documented in Documentation/devicetree/bindings/...

AFAIK, the behaviour isn't going away, there's been a few patches to
remove the need for i2c_device_id, and they've all been nacked, so I'd
say we can use it as is.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-09-10 13:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05  8:21 [PATCH] ARM: dts: sun4i: Add dts file for the pov protab2-ips9 tablet Hans de Goede
     [not found] ` <1441441319-10658-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-06 16:30   ` Maxime Ripard
2015-09-07  7:05     ` Hans de Goede
     [not found]       ` <55ED3739.609-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-07  7:49         ` Priit Laes
     [not found]           ` <1441612142.14422.34.camel-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2015-09-07  8:49             ` [linux-sunxi] " Hans de Goede
     [not found]               ` <55ED4F8F.6080502-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-07  9:14                 ` Priit Laes
     [not found]                   ` <1441617262.21530.4.camel-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org>
2015-09-07  9:30                     ` Hans de Goede
     [not found]                       ` <55ED591B.7050705-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-07 20:52                         ` Maxime Ripard
2015-09-08  7:48                           ` Hans de Goede
     [not found]                             ` <55EE92E0.1010805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-10 13:56                               ` Maxime Ripard [this message]
2015-09-07 20:56         ` Maxime Ripard
2015-09-08  7:45           ` [linux-sunxi] " Hans de Goede
     [not found]             ` <55EE9230.70209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-08  8:40               ` Chen-Yu Tsai
     [not found]                 ` <CAGb2v64BGPP9Fs0gM0ghJZ0tO8QdGZD9GfpquGCGKiZCeTkyww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 12:49                   ` [linux-sunxi] " Hans de Goede
     [not found]                     ` <55EED95D.20004-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-08 13:14                       ` Chen-Yu Tsai
2015-09-13 15:22               ` Maxime Ripard
2015-09-13 17:33                 ` Hans de Goede
     [not found]                   ` <55F5B370.7040203-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-22 15:02                     ` Maxime Ripard
2015-09-22 15:24                       ` [linux-sunxi] " Hans de Goede
     [not found]                         ` <560172B5.8090709-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-10-10 12:32                           ` Hans de Goede
2015-10-19 19:43                           ` Maxime Ripard
2015-10-20 21:59                             ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150910135610.GI9885@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).