On Thu, 2017-01-19 at 12:48 +0300, Mika Westerberg wrote: > Currently we already have two pin configuration related callbacks > available for GPIO chips .set_single_ended() and .set_debounce(). In > future we expect to have even more, which does not scale well if we > need > to add yet another callback to the GPIO chip structure for each > possible > configuration parameter. > > Better solution is to reuse what we already have available in the > generic pinconf. > > To support this, we introduce a new .set_config() callback for GPIO > chips. The callback takes a single packed pin configuration value as > parameter. This can then be extended easily beyond what is currently > supported by just adding new types to the generic pinconf enum. > > We then convert the existing drivers over .set_config() and finally > remove the .set_single_ended() and .set_debounce() callbacks. > > +#ifdef CONFIG_GENERIC_PINCONF > + > +#ifdef CONFIG_DEBUG_FS > +#define PCONFDUMP(a, b, c, d) { .param = a, .display = b, .format = > c, \ > + .has_arg = d } I understand you moved existing code, though 3 liner here would look better. -- Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Intel Finland Oy -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html