lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdbSzU-eXCfzFVmynO_D44PYA4g7dRSvRj+0s6uZxYD+tw@mail.gmail.com>
Date:	Mon, 12 Mar 2012 13:51:35 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Stephen Warren <swarren@...dotorg.org>
Cc:	Linus Walleij <linus.walleij@...ricsson.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Shawn Guo <shawn.guo@...escale.com>,
	Thomas Abraham <thomas.abraham@...aro.org>,
	Dong Aisheng <dong.aisheng@...aro.org>,
	Rajendra Nayak <rajendra.nayak@...aro.org>,
	Haojian Zhuang <haojian.zhuang@...vell.com>
Subject: Re: [PATCH 3/4] pinctrl: support pinconfig on the U300

On Wed, Mar 7, 2012 at 11:40 PM, Stephen Warren <swarren@...dotorg.org> wrote:
> On 03/06/2012 03:05 PM, Linus Walleij wrote:
>> From: Linus Walleij <linus.walleij@...aro.org>
>>
>> This adds pin configuration support for the U300 driver pair,
>> we can now read out the biasing and drive mode in debugfs and
>> configure it using the new configuration API.
>
>> +int u300_pin_config_set(struct pinctrl_dev *pctldev,
>> +                     unsigned pin,
>> +                     unsigned long config)
>> +{
>> +     struct pinctrl_gpio_range *range = u300_match_gpio_range(pin);
>> +     int ret;
>> +
>> +     if (!range)
>> +             return -EINVAL;
>> +
>> +     /* Note: none of these configurations take any argument */
>> +     ret = u300_gpio_config_set(range->gc,
>> +                                (pin - range->pin_base + range->base),
>> +                                to_config_param(config));
>
> I'm a little confused here; the documentation for most of the
> PIN_CONFIG_* parameters that this function is passed does explicitly
> document that there is an associated argument value. For example,
> IN_CONFIG_BIAS_PULL_UP is coupled with the pull up resistance in Ohms.
> Shouldn't this code extract the argument and validate that it's a
> supported value for the HW?

It says:

 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
 *      impedance to VDD), if the controller supports specifying a certain
 *      pull-up resistance, this is given as an argument (in Ohms) when
 *      setting this parameter.

Notice "if controller supports specifying ..." clause.

The reverse holds: if the pin controller doesn't support specifying that,
the pull-up will just be enabled, no matter what the argument was.

But maybe I should try to dig out which exact value it is, since it's
anyway a 1-1 copuling between board data and this one driver it
could be clearer (though the argument will just be checked to be
the one value the chip supports, and then discarded).

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ