On Monday 13 November 2006 11:43 am, Bill Gatliff wrote:
Maybe we should codify an approach for that now, i.e. add to the reference implementation some code that hands off out-of-range GPIO lines to a function in the machine descriptor:
+static inline int gpio_direction_input(unsigned gpio)
+ { if (gpio < OMAP_MAX_ARCH_GPIO) return __gpio_set_direction(gpio, 1);
+ else if(mdesc->platform_gpio_set_direction) platform_gpio_set_direction(gpio, 1); }
... conveniently neglecting the way you find mdesc. :)
Nah; look at arch/arm/plat-omap/gpio.c and ignore the mess, but observe
that what you see there is essentially a bunch of "gpio controller"
classes using the ugly "switch(type)" dispatch scheme instead of the
prettier "type->op()" dispatch scheme. All that stuff needs to be
cleaner, but for now it'd suffice to add a new FPGA typecode.