From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 21/25] sh-pfc: Implement generic pinconf support
Date: Thu, 14 Mar 2013 14:51:55 +0000 [thread overview]
Message-ID: <2046334.MuxPydO8CZ@avalon> (raw)
In-Reply-To: <1363214384-3870-22-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
Hi Linus,
On Thursday 14 March 2013 15:29:21 Linus Walleij wrote:
> On Thu, Mar 14, 2013 at 3:21 PM, Laurent Pinchart wrote:
> > After reading the documentation I was still a bit at loss, so I've read
> > several drivers to try and understand how pinconf get/set was supposed to
> > operate. I have to confess that it didn't really clarify the situation :-)
>
> OK let's patch Documentation/pinctrl.txt as an outcome of this discussion.
Good idea. I've found the "-EINVAL means the feature specified by the
parameter is turned off" to be pretty confusing. That definitely needs to be
documented, as well as the interactions between the different pinconf generic
parameters.
> > My understanding of the pinconf API is that the config argument carries a
> > parameter type and a value. When setting the parameter the situation is
> > pretty clear, the parameter type and value are extracted from the config
> > argument, and the value is written to the hardware based on the parameter
> > type. If the type is not supported (for example
> > PIN_CONFIG_INPUT_SCHMITT_ENABLE on a hardware that has no Schmitt
> > triggers) the pin_config_set handler returns - ENOTSUPP. If the value is
> > not valid, it returns -EINVAL.
>
> Yes.
>
> > Getting parameters is a bit more confusing. I've understood the config
> > argument as carrying the parameter type (with a 0 value) to be read. This
> > is why my pin_config_get handler first checks whether the parameter type
> > is supported and returns -ENOTSUPP if it isn't. Is that incorrect ? If
> > *config is supposed to be written only, how does the driver know which
> > parameter value to return ?
>
> Oh damned, I was totally wrong, I thought we had designed it to be
> a single call to get all the configurations, but indeed you are right,
> for example in the debugfs code in
> pinconf-generic.c:pinconf_generic_dump_pin.
>
> Mea culpa :-(
No worries :-)
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> for this patch.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2013-03-14 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 22:39 [PATCH 21/25] sh-pfc: Implement generic pinconf support Laurent Pinchart
2013-03-14 14:08 ` Linus Walleij
2013-03-14 14:21 ` Laurent Pinchart
2013-03-14 14:29 ` Linus Walleij
2013-03-14 14:51 ` Laurent Pinchart [this message]
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=2046334.MuxPydO8CZ@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-sh@vger.kernel.org \
/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).