All of lore.kernel.org
 help / color / mirror / Atom feed
* Avoiding platform-specific callbacks in drivers?
@ 2010-11-09 22:32 Bill Gatliff
  2010-11-10  0:02 ` Kevin Dankwardt
  2010-11-10  0:10 ` Nicolas Pitre
  0 siblings, 2 replies; 5+ messages in thread
From: Bill Gatliff @ 2010-11-09 22:32 UTC (permalink / raw)
  To: linux-embedded

Guys:


Let's say that on a given platform, I need to twiddle with a GPIO pin
when a chip enters and exits suspend.  One way to do that is to hack
the driver itself; a slightly less-inelegant way is to add a function
pointer in the platform data, and have the driver call back in its
suspend() and resume() methods.  I'm not real keen on either strategy,
because they both involve touching driver code that should be
platform-agnostic.  They seem... hacky.  :)

I would love to come up with a way that prevents touching the driver
at all, since the activity is terribly platform-specific. Is there
such a way?

One possibility is to set up some sort of parent-child relationship
between the device and a pseudo-device that deals with the GPIO pin.
But I'm not sure that will actually work, and it seems a bit
overly-complicated.

Ideas, anyone?  I'll be happy to try them out if they seem feasible,
and post code and feedback.


b.g.
-- 
Bill Gatliff
bgat@billgatliff.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-10  4:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 22:32 Avoiding platform-specific callbacks in drivers? Bill Gatliff
2010-11-10  0:02 ` Kevin Dankwardt
2010-11-10  4:17   ` Bill Gatliff
2010-11-10  0:10 ` Nicolas Pitre
2010-11-10  4:11   ` Bill Gatliff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.