mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "pHilipp Zabel" <philipp.zabel@gmail.com>
To: "Eric Miao" <eric.y.miao@gmail.com>
Cc: "Pavel Machek" <pavel@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	"Samuel Ortiz" <sameo@openedhand.com>
Subject: Re: Fundamental Design Flaw of the Device Driver Model?
Date: Fri, 22 Aug 2008 13:29:34 +0200	[thread overview]
Message-ID: <74d0deb30808220429y73daf8cbg4b593516f05f7302@mail.gmail.com> (raw)
In-Reply-To: <f17812d70808220232o7976680fkbb34528c4b7b000f@mail.gmail.com>

On Fri, Aug 22, 2008 at 11:32 AM, Eric Miao <eric.y.miao@gmail.com> wrote:
> On Fri, Aug 22, 2008 at 5:03 PM, Pavel Machek <pavel@suse.cz> wrote:
>>> Fundamental Design Flaw of the Device Driver Model?
>>> ===================================================
>>>
>>> Sorry for the misleading subject, its purpose is to draw your attention :-)
>>> The ideas below are preliminary and I hope I'm not making serious mistakes
>>> here.
>>>
>>> This question has actually been around in my mind for several months, when
>>> I started to work on some devices with multiple functions. Specifically, a
>>> Power Management IC (PMIC in short in the following text) usually includes
>>> LEDs support (charging, indication...) audio, touch screen, power monitoring,
>>> LDOs, DC-DC bucks, and possibly some others.
>>>
>>> The initial two ideas came into my mind were:
>>>
>>>    1. separate the functions into multiple devices, write a driver for each
>>>       of these devices
>>
>> Go for 1.
>>
>>>    4. An intermediate device with no bus, no driver, no many other things
>>>       is really not something deserving a "struct device", that's a waste
>>>       of memory.
>>
>> Memory is not _that_ expensive, and struct device is not that
>> big. Adding infrastructure to driver model for supporting this would
>> also cost you memory, this time in .text segment.
>>
>
> Actually I don't mind wasting additional memory for a better structure,
> but option (1) isn't. And I just assume you have read to the end of thi
>  mail, then you will see it's more like a concept change,no fundamental
> change to the code itself.
>
> Actually the reason to have two different kind of devices are obvious:
>
> 1. physical device - handles the bus related operations (read, write,
> locking, I/O)
> 2. virtual device - handles the functionality (interface with the
> upper framework)
>
> With this separation, the same IP on different semiconductor can be
> shared naturally. There are lot of such products esp in embedded market,
> with multiple shared IPs within a single die.
>
> Attached is a patch series to get you guys a feeling how the option
> (1) will look like, and think again about the device-driver relationship,
> the correctness of introducing an intermediate platform_device.

Instead of allocating/adding the platform subdevices manually in
da903x_add_subdevs, couldn't you use the MFD (multi function device)
infrastructure that seems to be intended for this case? Also, I think
that the da9030 base driver would then better fit in drivers/mfd, not
drivers/i2c/chips (didn't Jean Delvare himself state that ideally
drivers/i2c/chips should be empty?).

regards
Philipp

  reply	other threads:[~2008-08-22 11:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  6:25 Eric Miao
2008-08-22  9:03 ` Pavel Machek
2008-08-22  9:32   ` Eric Miao
2008-08-22 11:29     ` pHilipp Zabel [this message]
2008-08-23  0:56       ` Eric Miao
2008-08-22 11:17 ` Liam Girdwood
2008-08-22 14:00 ` Stefan Richter
2008-08-22 14:33 ` Jon Smirl
2008-08-23  1:02   ` Eric Miao
2008-08-23  3:54     ` Jon Smirl

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=74d0deb30808220429y73daf8cbg4b593516f05f7302@mail.gmail.com \
    --to=philipp.zabel@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=sameo@openedhand.com \
    /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

all inboxes | Powered by JetHome®