[lkml]   [2015]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[serial] Calling platform specific code on driver bind/unbind
I'm hacking my openwrt router and look for a proper way to make a serial
driver call a platform-specific function such as this:

static void ath79_enable_uart(void) {
if (soc_is_ar933x())


static void ath79_disable_uart(void) {
if (soc_is_ar933x())

on driver bind/unbind instead of in platform initialization code, in
order to be able to
reuse the pins as gpio, without disabling uart entirely.

My current solution uses platform_data to pass function pointers,
and invokes them in driver's request_port and release_port functions

And, oddly enough, the one in release_port gets invoked on unbind but
the other one
isn't called on bind (I had to add a call to it in probe to get it working).

So I wonder, if the request/release functions are a proper place for
such a callback,
or is there some better, more 'canonical' solution.

Also, I could attach my patches but it is my first post here, and they
are a bit openwrt specific,
and I don't want to be yelled upon ;-).

Piotr Madalinski

 \ /
  Last update: 2015-12-04 23:01    [W:0.059 / U:8.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site