netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sørensen, Stefan" <Stefan.Sorensen@spectralink.com>
To: "richardcochran@gmail.com" <richardcochran@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bhutchings@solarflare.com" <bhutchings@solarflare.com>,
	"christian.riesch@omicron.at" <christian.riesch@omicron.at>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH RFC net-next v1 1/9] ptp: introduce programmable pins.
Date: Mon, 10 Mar 2014 12:53:09 +0000	[thread overview]
Message-ID: <1394455989.2296.23.camel@e37108.spectralink.com> (raw)
In-Reply-To: <d9cb37a7d6e57d7f103dab78f98044697d3c4433.1394307304.git.richardcochran@gmail.com>

On Sat, 2014-03-08 at 20:42 +0100, Richard Cochran wrote:

>+int ptp_setpin(struct ptp_clock *ptp, unsigned int pin,
>+               enum ptp_pin_function func, unsigned int chan)

From the name I would think that this would set the state of the pin.
Rename to ptp_set_pinfunc?

> +int ptp_find_pin(struct ptp_clock *ptp,
> +		 enum ptp_pin_function func, unsigned int chan)
> +{
> +	struct ptp_pin_desc *pin = NULL;
> +	int i;
> +
> +	mutex_lock(&ptp->pincfg_mux);
> +	for (i = 0; i < ptp->info->n_pins; i++) {
> +		if (ptp->info->pin_config[i].func == func &&
> +		    ptp->info->pin_config[i].chan == chan) {
> +			pin = &ptp->info->pin_config[i];
> +			break;
> +		}
> +	}
> +	mutex_unlock(&ptp->pincfg_mux);
> +
> +	return pin ? pin - ptp->info->pin_config : -1;
> +}

Maybe replace 'pin - ptp->info->pin_config' with 'i'?

> +++ b/drivers/ptp/ptp_private.h
> @@ -48,6 +48,7 @@ struct ptp_clock {
>  	long dialed_frequency; /* remembers the frequency adjustment */
>  	struct timestamp_event_queue tsevq; /* simple fifo for time stamps */
>  	struct mutex tsevq_mux; /* one process at a time reading the fifo */
> +	struct mutex pincfg_mux; /* protect concurrent info->pin_config access */

Line over 80 chars. 

> + * @setpin:   Confirm that a pin can perform a given function. The PTP
> + *            Hardware Clock subsystem maintains the 'pin_config'
> + *            array on behalf of the drivers, but the PHC subsystem
> + *            assumes that every pin can perform every function. This
> + *            hook gives drivers a way of telling the core about
> + *            limitations on specific pins. This function must return
> + *            zero if the function can be assigned to this pin, and
> + *            nonzero otherwise.

The function does not actually set the pin. Rename to verify_pinfunc?

Stefan

  reply	other threads:[~2014-03-10 12:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08 19:42 [PATCH RFC net-next v1 0/9] ptp: dynamic pin control Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 1/9] ptp: introduce programmable pins Richard Cochran
2014-03-10 12:53   ` Sørensen, Stefan [this message]
2014-03-10 13:32     ` Richard Cochran
2014-03-11  7:58   ` Christian Riesch
2014-03-11 10:08     ` Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 2/9] ptp: add the pin GET/SETFUNC ioctls to the testptp program Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 3/9] ptp: expose the programmable pins via sysfs Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 4/9] ptp: drivers: set the number of programmable pins Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 5/9] dp83640: trivial fixes Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 6/9] dp83640: correct the periodic output frequency Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 7/9] dp83640: implement programmable pin functions Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 8/9] dp83640: let external input pins from the module parameters be defaults Richard Cochran
2014-03-08 19:42 ` [PATCH RFC net-next v1 9/9] dp83640: let the periodic pin from the module parameter be a default Richard Cochran
2014-03-10 12:52 ` [PATCH RFC net-next v1 0/9] ptp: dynamic pin control Sørensen, Stefan
2014-03-10 13:42   ` Richard Cochran
2014-03-12  6:58     ` Christian Riesch
2014-03-12 14:22       ` Richard Cochran
2014-03-10 14:05   ` Richard Cochran
2014-03-12  8:21 ` Christian Riesch
2014-03-12 14:46   ` Richard Cochran

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=1394455989.2296.23.camel@e37108.spectralink.com \
    --to=stefan.sorensen@spectralink.com \
    --cc=bhutchings@solarflare.com \
    --cc=christian.riesch@omicron.at \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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).