From: Oleksij Rempel <linux@rempel-privat.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/2] pinctrl: Add driver for Alphascale asm9260 pinctrl
Date: Thu, 14 May 2015 09:26:53 +0200 [thread overview]
Message-ID: <55544E3D.70106@rempel-privat.de> (raw)
In-Reply-To: <CACRpkdZn+bkDKzAD6gpnysezGZ6fzizD2o4zdBfEamFgUbzcvg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2600 bytes --]
Am 13.05.2015 um 13:00 schrieb Linus Walleij:
> On Tue, May 12, 2015 at 6:25 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> Am 05.05.2015 um 17:12 schrieb Linus Walleij:
>
>>> Just reference the statically defined array by a pointer instead,
>>> this just takes up a lot o memory for no reason.
>>
>> This two arrays have different types this is why i convert it.
>> priv->pin_desc[i].name - here i copy pointer any ways, and
>> priv->pin_desc[i].number can be smaller then pointer.
>
> I probably do not understand what you're trying to do, sorry :(
>
> Why is it necessary for the driver to copy one description of
> the pin into another?
>
>>> Mory copying. I don't see why this is necessary at all.
>>
>> I hadn't seen the point to define groups statically, especially because
>> they are used only to make curious user happy. So, memory will be used
>> only if you request the list over sysfs. Or miss some thing?
>
> pinctrl does not even use sysfs.
>
> The group names are usually there for matching with a function,
> it is part of the core functionality. The group name + function name
> matching is even more obvious in the dt case.
>
> They also make things easier to read in debugfs yes, but
> the core of the crux is to make it easy to config function+groups
> states with e.g. DT or board files.
>
>>>> +static struct pinmux_ops asm9260_pinmux_ops = {
>>>> + .get_functions_count = asm9260_pinctrl_get_funcs_count,
>>>> + .get_function_name = asm9260_pinctrl_get_func_name,
>>>> + .get_function_groups = asm9260_pinctrl_get_func_groups,
>>>> + .set_mux = asm9260_pinctrl_set_mux,
>>>> + /* TODO: should we care about gpios here? gpio_request_enable? */
>>>
>>> I think you should, if you also have a matching GPIO driver.
>>
>> I fear it would cause unpredictable bugs. GPIO mode is just one of mux
>> modes. If some one will request gpio some busy or dangerous line it
>> would do more harm then use. So, i assume limiting this only to device
>> tree would be better.
>
> Device tree or not doesn't matter, .gpio_request_enable() is used
> as a shortcut to mux in GPIO pins.
>
> If the simultaneous use of a pin for a device and GPIO bothers
> you there is nowadays (linux-next or my devel branch) a .strict
> option in pinmux_ops that you can set to disallow simultaneous
> use by devices and GPIO of the same pin.
>
> Yours,
> Linus Walleij
>
Hi, you was right, i was blind. Will redo some parts with your suggestions.
--
Regards,
Oleksij
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
next prev parent reply other threads:[~2015-05-14 7:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CACRpkdbKLkMB6WP0zp2xN+gM4ytvs=3V5hh8uKt8e=YE4gAAqQ@mail.gmail.com>
2015-03-27 9:36 ` [PATCH v2 0/2] Add driver and documentation for Alphascale asm9260 pinctrl Oleksij Rempel
2015-03-27 9:36 ` [PATCH v2 1/2] pinctrl: Add driver " Oleksij Rempel
2015-03-27 17:10 ` Paul Bolle
2015-04-05 5:49 ` Oleksij Rempel
2015-04-05 6:16 ` Oleksij Rempel
2015-04-05 6:26 ` [PATCH v3 0/2] Add driver and documentation " Oleksij Rempel
2015-04-05 6:26 ` [PATCH v3 1/2] pinctrl: Add driver " Oleksij Rempel
2015-04-06 7:42 ` Paul Bolle
2015-04-06 8:38 ` Oleksij Rempel
2015-04-06 9:41 ` Paul Bolle
2015-04-06 9:45 ` Oleksij Rempel
2015-04-06 9:04 ` [PATCH v4 0/2] Add driver and documentation " Oleksij Rempel
2015-04-06 9:04 ` [PATCH v4 1/2] pinctrl: Add driver " Oleksij Rempel
2015-05-05 15:12 ` Linus Walleij
2015-05-12 16:25 ` Oleksij Rempel
2015-05-13 11:00 ` Linus Walleij
2015-05-14 7:26 ` Oleksij Rempel [this message]
2015-09-09 5:55 ` Oleksij Rempel
2015-09-25 17:14 ` Linus Walleij
2015-04-06 9:04 ` [PATCH v4 2/2] pinctrl: asm9260: add pinctrl add device tree bindings documentation Oleksij Rempel
2015-05-05 14:46 ` Linus Walleij
2015-05-12 16:02 ` Oleksij Rempel
2015-04-22 19:49 ` [PATCH v4 0/2] Add driver and documentation for Alphascale asm9260 pinctrl Oleksij Rempel
2015-05-05 14:41 ` Linus Walleij
2015-04-05 6:26 ` [PATCH v3 2/2] pinctrl: asm9260: add pinctrl add device tree bindings documentation Oleksij Rempel
2015-03-27 9:36 ` [PATCH v2 " Oleksij Rempel
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=55544E3D.70106@rempel-privat.de \
--to=linux@rempel-privat.de \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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