Subject: Re: [PATCH] dp83640: Support a configurable number of periodic outputs

From: Richard Cochran <[email-masked]>
Date: Tue, 4 Feb 2014 10:29:39 +0100

On Tue, Feb 04, 2014 at 09:52:22AM +0100, Stefan Sørensen wrote:
> The driver is currently limited to a single periodic output.
> This patch makes the number of peridodic output dynamic by
> dropping the gpio_tab module parameter and adding cal_gpio,
> perout_gpio_tab and extts_gpio_tabs parameters.

...

>  module_param(chosen_phy, int, 0444);
> -module_param_array(gpio_tab, ushort, NULL, 0444);
> +module_param(cal_gpio, int, 0444);
> +module_param_array(perout_gpio_tab, int, &n_perout, 0444);
> +module_param_array(extts_gpio_tab, int, &n_extts, 0444);
>  
>  MODULE_PARM_DESC(chosen_phy, \
>  	"The address of the PHY to use for the ancillary clock features");
> -MODULE_PARM_DESC(gpio_tab, \
> -	"Which GPIO line to use for which purpose: cal,perout,extts1,...,extts6");
> +MODULE_PARM_DESC(cal_gpio, "Which GPIO line to use for calibration");
> +MODULE_PARM_DESC(perout_gpio_tab, "Which GPIO lines to use for periodic output");
> +MODULE_PARM_DESC(extts_gpio_tab, "Which GPIO lines to use for external timestamping");

Modules parameters are surely easiest (for the developer), but perhaps
the time has come for the "right way."

Currently there is no interface for configuring the GPIOs used by PHC
devices, and last year I was going to add the GPIOs to the igb
driver. The conclusion of the discussion was that module parameters
are bad for this, but ethtool is good.

  http://www.spinics.net/lists/netdev/msg237692.html

[ I did not follow through to come up with an ethtool way of configuring
  the igb pins. ]

Even though it is more work, I think the way forward is to invent a
way to let the user configure this kind of thing via ethtool. Would
you care to take a stab at this?

Thanks,
Richard