netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Karol Kolacinski <karol.kolacinski@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Subject: Re: [PATCH iwl-next 1/7] ice: Implement ice_ptp_pin_desc
Date: Mon, 1 Jul 2024 14:23:36 +0100	[thread overview]
Message-ID: <20240701132336.GY17134@kernel.org> (raw)
In-Reply-To: <20240627151127.284884-10-karol.kolacinski@intel.com>

On Thu, Jun 27, 2024 at 05:09:25PM +0200, Karol Kolacinski wrote:
> Add a new internal structure describing PTP pins.
> Use the new structure for all non-E810T products.
> 
> Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ptp.c | 271 ++++++++++++++++-------
>  drivers/net/ethernet/intel/ice/ice_ptp.h |  65 ++++--
>  2 files changed, 229 insertions(+), 107 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c

...

> +/**
> + * ice_ptp_gpio_enable - Enable/disable ancillary features of PHC
> + * @info: The driver's PTP info structure
>   * @rq: The requested feature to change
>   * @on: Enable/disable flag
> + *
> + * Return: 0 on success, -EOPNOTSUPP when request type is not supported
>   */
> -static int ice_ptp_gpio_enable_e823(struct ptp_clock_info *info,
> -				    struct ptp_clock_request *rq, int on)
> +static int ice_ptp_gpio_enable(struct ptp_clock_info *info,
> +			       struct ptp_clock_request *rq, int on)
>  {
>  	struct ice_pf *pf = ptp_info_to_pf(info);
> +	int err;

nit: This appears to be resolved by a subsequent patch in this series,
     but err is unused in this function.

     Flagged by W=1 allmodconfig builds on x86_64 with gcc-13 and clang-18.

>  
>  	switch (rq->type) {
> -	case PTP_CLK_REQ_PPS:
> +	case PTP_CLK_REQ_PEROUT:
>  	{
> -		struct ice_perout_channel clk_cfg = {};
> +		struct ice_perout_channel clk_cfg;
> +		int pin_desc_idx;
> +
> +		pin_desc_idx = ice_ptp_find_pin_idx(pf, PTP_PF_PEROUT,
> +						    rq->perout.index);
> +		if (pin_desc_idx < 0)
> +			return -EIO;
> +
>  
>  		clk_cfg.flags = rq->perout.flags;
> -		clk_cfg.gpio_pin = PPS_PIN_INDEX;
> -		clk_cfg.period = NSEC_PER_SEC;
> +		clk_cfg.gpio_pin = pf->ptp.ice_pin_desc[pin_desc_idx].gpio[1];
> +		clk_cfg.period = rq->perout.period.sec * NSEC_PER_SEC +
> +				 rq->perout.period.nsec;
> +		clk_cfg.start_time = rq->perout.start.sec * NSEC_PER_SEC +
> +				     rq->perout.start.nsec;
>  		clk_cfg.ena = !!on;
>  
> -		return ice_ptp_cfg_clkout(pf, PPS_CLK_GEN_CHAN, &clk_cfg, true);
> +		return ice_ptp_cfg_clkout(pf, rq->perout.index, &clk_cfg, true);
>  	}
>  	case PTP_CLK_REQ_EXTTS:
>  	{
>  		struct ice_extts_channel extts_cfg = {};
> +		int pin_desc_idx;
> +
> +		pin_desc_idx = ice_ptp_find_pin_idx(pf, PTP_PF_EXTTS,
> +						    rq->extts.index);
> +		if (pin_desc_idx < 0)
> +			return -EIO;
>  
>  		extts_cfg.flags = rq->extts.flags;
> -		extts_cfg.gpio_pin = TIME_SYNC_PIN_INDEX;
> +		extts_cfg.gpio_pin = pf->ptp.ice_pin_desc[pin_desc_idx].gpio[0];
>  		extts_cfg.ena = !!on;
>  
>  		return ice_ptp_cfg_extts(pf, rq->extts.index, &extts_cfg, true);

...

  reply	other threads:[~2024-07-01 13:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 15:09 [PATCH iwl-next 0/7] ice: Cleanup and refactor PTP pin handling Karol Kolacinski
2024-06-27 15:09 ` [PATCH iwl-next 1/7] ice: Implement ice_ptp_pin_desc Karol Kolacinski
2024-07-01 13:23   ` Simon Horman [this message]
2024-06-27 15:09 ` [PATCH iwl-next 2/7] ice: Add SDPs support for E825C Karol Kolacinski
2024-07-01 13:25   ` Simon Horman
2024-06-27 15:09 ` [PATCH iwl-next 3/7] ice: Align E810T GPIO to other products Karol Kolacinski
2024-07-01 13:25   ` Simon Horman
2024-06-27 15:09 ` [PATCH iwl-next 4/7] ice: Cache perout/extts requests and check flags Karol Kolacinski
2024-07-01 13:26   ` Simon Horman
2024-06-27 15:09 ` [PATCH iwl-next 5/7] ice: Disable shared pin on E810 on setfunc Karol Kolacinski
2024-07-01 13:27   ` Simon Horman
2024-06-27 15:09 ` [PATCH iwl-next 6/7] ice: Read SDP section from NVM for pin definitions Karol Kolacinski
2024-06-27 15:09 ` [PATCH iwl-next 7/7] ice: Enable 1PPS out from CGU for E825C products Karol Kolacinski
2024-06-27 15:37   ` [Intel-wired-lan] " Paul Menzel
2024-07-01 13:49     ` Kolacinski, Karol
2024-07-01 13:27   ` Simon Horman
2024-07-01 15:08     ` Przemek Kitszel
2024-07-02 10:56       ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701132336.GY17134@kernel.org \
    --to=horms@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=karol.kolacinski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).