linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mason <mpeg.blue@free.fr>
To: "Andreas Färber" <afaerber@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Device Tree <devicetree@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: Looking for good references for ARM driver development
Date: Wed, 19 Nov 2014 17:05:00 +0100	[thread overview]
Message-ID: <546CBFAC.9040906@free.fr> (raw)
In-Reply-To: <546CB0EB.9080005@suse.de>

Hello Andreas,

On 19/11/2014 16:02, Andreas Färber wrote:

> Am 19.11.2014 um 13:50 schrieb Mason:
>
>> [...] I'm writing a driver for a temperature sensor, which is
>> supposed to work within the hwmon/lm-sensors framework.
>>
>> The sensor's API consists of 3 memory-mapped registers, which are
>> accessible over the SoC's memory bus. [...]
>>
>> 1) Which bus should I be using for this driver?
>> Is the platform bus appropriate?
>
> Probably.

Is there an exhaustive list of available buses (on the ARM platform)
and an overview of when/where each one is appropriate?

>> 2) platform.txt states
>>
>>> Some drivers are not fully converted to the driver model, because
>>> they take on a non-driver role:  the driver registers its
>>> platform device, rather than leaving that for system
>>> infrastructure.  Such drivers can't be hotplugged or coldplugged,
>>> since those mechanisms require device creation to be in a
>>> different system component than the driver.
>>
>> How do I "leave device registration for the system
>> infrastructure"? Where should I put that code? Is it a good idea to
>> separate device registration and driver registration in the case of
>> a SoC, where the device is embedded in the SoC and is not
>> "hot-plugged" (or anything-plugged for that matter, it's just
>> "there").
>
> Since this appears to be about an ARM SoC according to your To list,
> in general, you create a device tree binding, that binding is
> registered within your platform/... driver code and referenced in the
> device tree for SoC or board, and then your driver will automatically
> be probed.

I know nothing about DT (aside from the Wikipedia entry).
I'll take a closer look at Documentation/devicetree.
Will that explain what platform/... is?

I see a drivers/platform folder, but nothing ARM-specific there?

>> 4) Can I use platform_driver_probe, instead of
>> platform_driver_register?
>
> Most likely you do not need to call either yourself.

Hmmm, color me even more confused. I had really come to believe that
driver registration was a mandatory part of the driver, something
that wasn't left to "infrastructure code".

> Just compare other platform drivers on the one hand, and temperature
> sensor drivers on the other (such as I2C based gmt,g781 / LM90). Did
> you already check whether there is a driver that is both?

Please excuse my naive question: what are platform drivers, and where
are they stored in the kernel source tree?

Regards.


  reply	other threads:[~2014-11-19 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 12:50 Looking for good references for ARM driver development Mason
2014-11-19 15:02 ` Andreas Färber
2014-11-19 16:05   ` Mason [this message]
2014-11-20  9:18     ` Viresh Kumar
2014-11-20 14:33     ` Antony Pavlov
2014-11-19 16:57 ` Victor Ascroft
2014-11-19 17:19   ` Mason
2014-11-19 17:30     ` Victor Ascroft
2014-11-20 21:41   ` Mason
2014-11-21  6:00     ` Victor Ascroft

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=546CBFAC.9040906@free.fr \
    --to=mpeg.blue@free.fr \
    --cc=afaerber@suse.de \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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).