Avoiding platform-specific callbacks in drivers?

2010-11-09 Thread Bill Gatliff
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

Re: Avoiding platform-specific callbacks in drivers?

2010-11-09 Thread Nicolas Pitre
On Tue, 9 Nov 2010, Bill Gatliff wrote: Let's say that on a given platform, I need to twiddle with a GPIO pin when a chip enters and exits suspend. What driver? What platform? This may depend on those. One way to do that is to hack the driver itself; a slightly less-inelegant way is to

Re: Avoiding platform-specific callbacks in drivers?

2010-11-09 Thread Kevin Dankwardt
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()

Re: Avoiding platform-specific callbacks in drivers?

2010-11-09 Thread Bill Gatliff
Kevin: On Tue, Nov 9, 2010 at 6:02 PM, Kevin Dankwardt k...@kcomputing.com wrote: Isn't the general approach to avoid platform-dependencies to abstract the behavior? As is used throughout the kernel, an operations struct that provides the abstractions and each driver fills in its