[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdY8Xm0L-NY3nzySnDiP105BvonE-LJkSH=vmeMNFAPuFg@mail.gmail.com>
Date: Thu, 21 Apr 2022 22:53:02 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Patrick Rudolph <patrick.rudolph@...ements.com>
Cc: Naresh Solanki <naresh.solanki@...ements.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org
Subject: Re: [PATCH 2/2] pinctrl: Add Cypress cy8c95x0 support
Hi Patrick, Naresh,
thanks for your patch! This is a VERY good looking driver so I don't
think we will need a lot of iterations before it is finished. (Famous
last words, but it looks very good.)
On Tue, Apr 19, 2022 at 9:17 AM Patrick Rudolph
<patrick.rudolph@...ements.com> wrote:
> +static const struct i2c_device_id cy8c95x0_id[] = {
> + { "cy8c9520", 20, },
> + { "cy8c9540", 40, },
> + { "cy8c9560", 60, },
> + { }
So here is the ngpios for each expander.
> + chip->tpin = chip->driver_data & CY8C95X0_GPIO_MASK;
> + ngpios = -1;
> + if (client->dev.of_node)
> + of_property_read_u32(client->dev.of_node, "ngpios", &ngpios);
> +
> + if (ngpios < 0 || ngpios > (chip->driver_data & CY8C95X0_GPIO_MASK))
> + ngpios = chip->driver_data & CY8C95X0_GPIO_MASK;
So why should this be configurable from the device tree at all?
I understand if not all gpios are used, but we usually just expose all
GPIOs on an expander.
Yours,
Linus Walleij
Powered by blists - more mailing lists