All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <ramon.fried@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] mach-snapdragon: Introduce pinctrl driver
Date: Tue, 15 May 2018 00:23:29 +0300	[thread overview]
Message-ID: <CA+Kvs9ndYhk6oZRcS7Ypv=RL+zNf917f+jzyZ73WbSciaLM=zg@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ2GpUVFHNQ8ESO72G1okZhDGE6TCOHajrU=N0niEdAUgQ@mail.gmail.com>

On Mon, May 14, 2018 at 10:51 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Ramon,
>
> On 14 May 2018 at 01:10, Ramon Fried <ramon.fried@gmail.com> wrote:
>> On Mon, May 14, 2018 at 1:00 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Hi Ramon,
>>>
>>> On 12 May 2018 at 20:15, Ramon Fried <ramon.fried@gmail.com> wrote:
>>>> This patch adds pinmux and pinctrl driver for TLMM
>>>> subsystem in snapdragon chipsets.
>>>> Currently, supporting only 8016, but implementation is
>>>> generic and 8096 can be added easily.
>>>>
>>>> Driver is using the generic dt-bindings and doesn't
>>>> introduce any new bindings (yet).
>>>>
>>>> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
>>>> ---
>>>>  arch/arm/mach-snapdragon/Makefile                |   2 +
>>>>  arch/arm/mach-snapdragon/pinctrl-apq8016.c       | 162 +++++++++++++++++++++++
>>>>  arch/arm/mach-snapdragon/pinctrl-snapdragon.c    | 118 +++++++++++++++++
>>>>  arch/arm/mach-snapdragon/pinctrl-snapdragon.h    |  21 +++
>>>>  configs/dragonboard410c_defconfig                |   5 +
>>>>  include/dt-bindings/pinctrl/pinctrl-snapdragon.h |  22 +++
>>>>  6 files changed, 330 insertions(+)
>>>>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-apq8016.c
>>>>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-snapdragon.c
>>>>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-snapdragon.h
>>>>  create mode 100644 include/dt-bindings/pinctrl/pinctrl-snapdragon.h
>>>>
>>>> diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile
>>>> index 1c23dc52cf..1d35fea912 100644
>>>> --- a/arch/arm/mach-snapdragon/Makefile
>>>> +++ b/arch/arm/mach-snapdragon/Makefile
>>>> @@ -6,4 +6,6 @@ obj-$(CONFIG_TARGET_DRAGONBOARD820C) += clock-apq8096.o
>>>>  obj-$(CONFIG_TARGET_DRAGONBOARD820C) += sysmap-apq8096.o
>>>>  obj-$(CONFIG_TARGET_DRAGONBOARD410C) += clock-apq8016.o
>>>>  obj-$(CONFIG_TARGET_DRAGONBOARD410C) += sysmap-apq8016.o
>>>> +obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-apq8016.o
>>>> +obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-snapdragon.o
>>>>  obj-y += clock-snapdragon.o
>>>> diff --git a/arch/arm/mach-snapdragon/pinctrl-apq8016.c b/arch/arm/mach-snapdragon/pinctrl-apq8016.c
>>>> new file mode 100644
>>>> index 0000000000..8e57e2338c
>>>> --- /dev/null
>>>> +++ b/arch/arm/mach-snapdragon/pinctrl-apq8016.c
>>>> @@ -0,0 +1,162 @@
>>>> +// SPDX-License-Identifier: GPL-2.0+
>>>> +/*
>>>> + * Qualcomm APQ8016 pinctrl
>>>> + *
>>>> + * (C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
>>>> + *
>>>> + */
>>>> +
>>>> +#include "pinctrl-snapdragon.h"
>>>> +#include <common.h>
>>>> +
>>>> +const char * const msm_pinctrl_pins[] = {
>>>> +       "GPIO_0",
>>>> +       "GPIO_1",
>>>> +       "GPIO_2",
>>>> +       "GPIO_3",
>>>> +       "GPIO_4",
>>>> +       "GPIO_5",
>>>> +       "GPIO_6",
>>>> +       "GPIO_7",
>>>
>>> This seems inefficient. Could you not sprintf() the name for most of
>>> these values?
>> The origin of this table is from the Linux kernel driver.
>> I'm not sure I understand how sprintf will more efficient, do you want
>> to fill up this table on runtime ?
>
> I think this table is only used in one function, so you could create
> the string there perhaps?
>
Actually, it works the other way around, the generic-pinctrl needs a
function to translate string to index.
Basically, it reads strings from the FDT and then go over all indexes
until it matches that string. this is inefficient IMHO as I think it
will be easier just
to be able to provide an index instead of a string in the FDT.

> Regards,
> Simon

  reply	other threads:[~2018-05-14 21:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-12 10:15 [U-Boot] [PATCH 0/7] *** Qualcomm Snapdraon serial fixes*** Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 1/7] db820c: set clk node to be probed before relocation Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-14  7:06     ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 2/7] serial: serial_msm: fail probe if settings clocks fails Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-14  7:07     ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 3/7] serial: serial_msm: initialize uart only before relocation Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-12 10:15 ` [U-Boot] [PATCH 4/7] mach-snapdragon: Fix UART clock flow Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 5/7] mach-snapdragon: Introduce pinctrl driver Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-14  7:10     ` Ramon Fried
2018-05-14 19:51       ` Simon Glass
2018-05-14 21:23         ` Ramon Fried [this message]
2018-05-15 16:02           ` Simon Glass
2018-05-15 16:09             ` Ramon Fried
2018-05-15 16:15               ` Simon Glass
2018-05-16  5:37                 ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 6/7] db410: added pinctrl node and serial bindings Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-12 10:15 ` [U-Boot] [PATCH 7/7] serial: serial_msm: added pinmux & config Ramon Fried
2018-05-13 22:00   ` Simon Glass

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='CA+Kvs9ndYhk6oZRcS7Ypv=RL+zNf917f+jzyZ73WbSciaLM=zg@mail.gmail.com' \
    --to=ramon.fried@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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.