All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 09 Sep 2015 07:55:24 +0200	[thread overview]
Message-ID: <55EFC9CC.3010008@rempel-privat.de> (raw)
In-Reply-To: <CACRpkdZn+bkDKzAD6gpnysezGZ6fzizD2o4zdBfEamFgUbzcvg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3031 bytes --]

Hi, finally i'm able to continue to work on it.

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?

If i understand it correctly, pinctrl_pin_desc is essential part of
pinmux framework. Theoretically i should define just statical array of
this struct, but by this number of pins and functions it hard to keep it
readable and error free. So i decided to create asm9260_mux_table which
contains every thing i need. The side effect is higher memory usage
since i need to create pinctrl_pin_desc on fly.

May be i miss some thing?

>>> 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.

please read debugfs.

> 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
> 


-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  parent reply	other threads:[~2015-09-09  5:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  8:42 preferable method for pinctrl driver Oleksij Rempel
2014-10-13  9:05 ` Linus Walleij
2014-11-07  8:35   ` Oleksij Rempel
2014-11-07 10:17     ` Oleksij Rempel
2014-11-14 10:01       ` Linus Walleij
2015-02-09 10:41         ` Oleksij Rempel
2015-03-05  8:44           ` Linus Walleij
2015-02-12 11:32         ` [PATCH] pinctrl: Add initial driver data for Alphascale asm9260 Oleksij Rempel
2015-03-06  8:38           ` Linus Walleij
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
2015-09-09  5:55                                   ` Oleksij Rempel [this message]
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
     [not found]                     ` <1428215185-14190-1-git-send-email-linux-YEK0n+YFykbzxQdaRaTXBw@public.gmane.org>
2015-04-05  6:26                       ` [PATCH v3 2/2] pinctrl: asm9260: add pinctrl add device tree bindings documentation Oleksij Rempel
2015-04-05  6:26                         ` 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=55EFC9CC.3010008@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.