lkml.org 
[lkml]   [2012]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver
From
Hi Corentin,

Thanks for your feedback on this. Indeed, what Olof is saying is
correct. In its current form, this driver exists to register i2c
devices on our laptops. We have one piece of information (the irq,
specifically) that cannot be added to the i2c_board_info when using
user space probing.

To answer your question about where this driver is going in the
future, you can take a look at the current version of the driver in
the chromiumos kernel:

https://gerrit.chromium.org/gitweb/?p=chromiumos/third_party/kernel.git;a=blob;f=drivers/platform/x86/chromeos_laptop.c;h=f948f61d864a5265f6e144833358512f68b7e467;hb=chromeos-3.4

I added more i2c devices that are registered the same way for a number
of other chromeos systems, but there is one platform device (a
keyboard backlight) that is added using
platform_device_register_simple.

Thanks again for reviewing,
Benson

On Fri, Nov 2, 2012 at 6:32 AM, Corentin Chary <corentin.chary@gmail.com> wrote:
> On Fri, Nov 2, 2012 at 1:09 PM, Olof Johansson <olof@lixom.net> wrote:
>> On Fri, Nov 2, 2012 at 2:03 PM, Corentin Chary <corentin.chary@gmail.com> wrote:
>>> On Fri, Nov 2, 2012 at 12:45 PM, Olof Johansson <olof@lixom.net> wrote:
>>>> On Fri, Oct 26, 2012 at 10:30 AM, Corentin Chary
>>>> <corentin.chary@gmail.com> wrote:
>>>>
>>>>> Looks better, but I'm curious, what is the final purpose of this driver ?
>>>>> What ABI will be exposed, who will use it ?
>>>>>
>>>>> If it is going to be bigger, it may be a good idea to convert it to a
>>>>> real platform driver (platform_drivers/platform_device stuff).
>>>>
>>>> It's not a driver per se. It's platform glue that, based on the DMI
>>>> table, registers platform and i2c devices (at this time only i2c
>>>> devices).
>>>>
>>>> Unfortunately there's no way to do this nicely from userspace after
>>>> boot, since there's limits to how much data you can provide with the
>>>> simpler userspace-driven i2c probing protocol.
>>>>
>>>> So, there's no user-facing ABI on this, and no one is expected to use
>>>> it from userspace. It's just there to make sure that the un-probably
>>>> devices on this kind of hardware gets bound to drivers properly.
>>>>
>>>> If it's converted to a platform_driver, how do you expect that to
>>>> probe, where would the platform_device be registered?
>>>
>>> I guess I would check dmi in the module init method, and then use the
>>> probe callback of platform_create_bundle to do more probing if
>>> necessary.
>>
>> Maybe I'm dense but I don't see how that could possibly be better than
>> what the code does today. It would just add more overhead and clutter
>> by creating a unnecessary dummy device/driver setup just to, in the
>> end, register the same i2c devices.
>>
>
> Well that was the point of "If it is going to be bigger".
> Of course, as long as it only register those i2c devices, it doesn't
> really matter.
>
> --
> Corentin Chary
> http://xf.iksaif.net



--
Benson Leung
Software Engineer, Chrom* OS
bleung@chromium.org


\
 
 \ /
  Last update: 2012-11-04 22:01    [W:0.056 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site