linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Vasut <marek.vasut@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-media@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Subject: Re: [PATCH 6/7] pinctrl: ds90ux9xx: add TI DS90Ux9xx pinmux and GPIO controller driver
Date: Wed, 10 Oct 2018 11:04:41 +0200	[thread overview]
Message-ID: <CACRpkdbMMnXzA_j_p=nGgT1SyECrhCNRC6wWQ-+COMEkSQdPAA@mail.gmail.com> (raw)
In-Reply-To: <20181008211205.2900-7-vz@mleia.com>

Hi Vladimir,

thanks for your patch! Some review comments:

On Mon, Oct 8, 2018 at 11:12 PM Vladimir Zapolskiy <vz@mleia.com> wrote:

> From: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
>
> The change adds an MFD cell driver for managing pin functions on
> TI DS90Ux9xx de-/serializers.
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>

Please mention in the commit that you are also adding a GPIO
chip driver.

> +// SPDX-License-Identifier: GPL-2.0-or-later

I prefer the simple "GPL-2.0+" here.

> +#include <linux/of_gpio.h>

You should not need this include. If you do, something is wrong.

> +#define SER_REG_PIN_CTRL               0x12
> +#define PIN_CTRL_RGB18                 BIT(2)
> +#define PIN_CTRL_I2S_DATA_ISLAND       BIT(1)
> +#define PIN_CTRL_I2S_CHANNEL_B         (BIT(0) | BIT(3))
> +
> +#define SER_REG_I2S_SURROUND           0x1A
> +#define PIN_CTRL_I2S_SURR_BIT          BIT(0)
> +
> +#define DES_REG_INDIRECT_PASS          0x16
> +
> +#define OUTPUT_HIGH                    BIT(3)
> +#define REMOTE_CONTROL                 BIT(2)
> +#define DIR_INPUT                      BIT(1)
> +#define ENABLE_GPIO                    BIT(0)
> +
> +#define GPIO_AS_INPUT                  (ENABLE_GPIO | DIR_INPUT)
> +#define GPIO_AS_OUTPUT                 ENABLE_GPIO
> +#define GPIO_OUTPUT_HIGH               (GPIO_AS_OUTPUT | OUTPUT_HIGH)
> +#define GPIO_OUTPUT_LOW                        GPIO_AS_OUTPUT
> +#define GPIO_OUTPUT_REMOTE             (GPIO_AS_OUTPUT | REMOTE_CONTROL)

These have a creepily generic look, like they hit the global GPIO
namespace without really clashing. It gets confusing when reading
the code.

Do you think you could prefix them with DS90_* or something
so it is clear that these defines belong in this driver?

> +static const struct gpio_chip ds90ux9xx_gpio_chip = {
> +       .owner                  = THIS_MODULE,
> +       .get                    = ds90ux9xx_gpio_get,
> +       .set                    = ds90ux9xx_gpio_set,
> +       .get_direction          = ds90ux9xx_gpio_get_direction,
> +       .direction_input        = ds90ux9xx_gpio_direction_input,
> +       .direction_output       = ds90ux9xx_gpio_direction_output,
> +       .base                   = -1,
> +       .can_sleep              = 1,

This is bool so set it = true;

Overall it's a very nice driver. It is pretty complex but pin control
is complex so that's a fact of life.

Yours,
Linus Walleij

  reply	other threads:[~2018-10-10  9:04 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 21:11 [PATCH 0/7] mfd/pinctrl: add initial support of TI DS90Ux9xx ICs Vladimir Zapolskiy
2018-10-08 21:11 ` [PATCH 1/7] dt-bindings: mfd: ds90ux9xx: add description " Vladimir Zapolskiy
2018-10-09  0:13   ` Marek Vasut
2018-10-09 11:11     ` Vladimir Zapolskiy
2018-10-09 20:55       ` Vladimir Zapolskiy
2018-10-09 21:03         ` Marek Vasut
2018-10-10  8:41   ` Linus Walleij
2018-10-12 11:44   ` Laurent Pinchart
2018-10-13 14:28     ` Vladimir Zapolskiy
2018-10-16 12:30       ` Laurent Pinchart
2018-10-30 16:43   ` Luca Ceresoli
2018-10-30 23:40     ` Vladimir Zapolskiy
2018-10-08 21:12 ` [PATCH 2/7] dt-bindings: mfd: ds90ux9xx: add description of TI DS90Ux9xx I2C bridge Vladimir Zapolskiy
2018-10-12 11:54   ` Laurent Pinchart
2018-10-30 16:43   ` Luca Ceresoli
2018-10-31 20:12     ` Vladimir Zapolskiy
2018-11-03 21:00       ` Luca Ceresoli
2018-11-03 22:07         ` Vladimir Zapolskiy
2018-10-08 21:12 ` [PATCH 3/7] dt-bindings: pinctrl: ds90ux9xx: add description of TI DS90Ux9xx pinmux Vladimir Zapolskiy
2018-10-10  8:45   ` Linus Walleij
2018-10-17 15:02     ` Rob Herring
2018-10-12 12:01   ` Laurent Pinchart
2018-10-13 13:47     ` Vladimir Zapolskiy
2018-10-16 12:48       ` Laurent Pinchart
2018-10-30 16:44         ` Luca Ceresoli
2018-10-31 20:31           ` Vladimir Zapolskiy
2018-10-08 21:12 ` [PATCH 4/7] mfd: ds90ux9xx: add TI DS90Ux9xx de-/serializer MFD driver Vladimir Zapolskiy
2018-10-09  4:08   ` kbuild test robot
2018-10-09 11:14     ` Vladimir Zapolskiy
2018-10-12  6:03   ` Lee Jones
2018-10-12  7:41     ` Vladimir Zapolskiy
2018-10-12  8:39       ` Lee Jones
2018-10-12  9:20         ` Kieran Bingham
2018-10-12 10:58           ` Vladimir Zapolskiy
2018-10-12 11:34             ` Lee Jones
2018-10-12 14:13               ` Vladimir Zapolskiy
2018-10-12 14:25                 ` Lee Jones
2018-10-12 11:47             ` Kieran Bingham
2018-10-12 13:01               ` Laurent Pinchart
2018-10-12 13:59                 ` Vladimir Zapolskiy
2018-10-16 13:08                   ` Laurent Pinchart
2018-10-23  8:16                   ` Vladimir Zapolskiy
2018-10-30 16:44                     ` Luca Ceresoli
2018-10-13 15:10                 ` Vladimir Zapolskiy
2018-10-16 13:12                   ` Laurent Pinchart
2018-10-16 18:32                     ` Vladimir Zapolskiy
2018-10-13 12:33               ` Vladimir Zapolskiy
2018-10-12 11:24         ` Vladimir Zapolskiy
2018-10-12 11:43           ` Lee Jones
2018-10-12 14:23             ` Vladimir Zapolskiy
2018-10-12 13:07           ` Laurent Pinchart
2018-10-08 21:12 ` [PATCH 5/7] mfd: ds90ux9xx: add I2C bridge/alias and link connection driver Vladimir Zapolskiy
2018-10-12  6:04   ` Lee Jones
2018-10-12  7:32     ` Vladimir Zapolskiy
2018-10-12  9:03       ` Lee Jones
2018-10-12 13:12       ` Laurent Pinchart
2018-10-12 14:36         ` Vladimir Zapolskiy
2018-10-16 14:06           ` Laurent Pinchart
2018-10-08 21:12 ` [PATCH 6/7] pinctrl: ds90ux9xx: add TI DS90Ux9xx pinmux and GPIO controller driver Vladimir Zapolskiy
2018-10-10  9:04   ` Linus Walleij [this message]
2018-10-08 21:12 ` [PATCH 7/7] MAINTAINERS: add entry for TI DS90Ux9xx FPD-Link III drivers Vladimir Zapolskiy
2018-10-12 11:34 ` [PATCH 0/7] mfd/pinctrl: add initial support of TI DS90Ux9xx ICs Laurent Pinchart

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='CACRpkdbMMnXzA_j_p=nGgT1SyECrhCNRC6wWQ-+COMEkSQdPAA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=vz@mleia.com \
    --cc=wsa@the-dreams.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 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).