lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] GPIO: Add gpio_lookup
On Mon, 12 Oct 2009 17:11:44 +1100
Ben Nizette <bn@niasdigital.com> wrote:

> Back to this patch though, the gpio names have to come from the platform
> code via some platform_data for the gpio chip [1], the driver then looks
> up that pre-defined name to find the gpio number. Why not just pass the
> gpio number straight to the end device driver through platform_data and
> bypass the middle-man?

That's true in a situation where you've one One Platform to Bind Them
All, yes. But if you have (say) GPIOs provided by a PCI-connected
peripheral which are needed in (say) a camera driver, there is no one
platform which can manage all those GPIO numbers. In particular, I've
done a driver for viafb-based GPIOs; these devices can show up in any
of a number of x86-based systems. I honestly don't know why it would
make sense to try to hardware numbers to these GPIOs when using names
and dynamic numbering is so much more flexible - and we are already
tracking the names.

Perhaps it would make sense to implement a proper namespace layer for
GPIOs rather than continuing to grow something which evidently sneaked
in through the back door. Until that's done, though, I think this
patch is useful. But it it's really unwanted I'll find some other way.

Thanks,

jon


\
 
 \ /
  Last update: 2009-10-12 17:35    [W:0.108 / U:1.556 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site