Re: [PATCH 4/4] pinctrl: mcp23s08: work around GPIO line naming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 4, 2018 at 7:05 PM, Jan Kundrát <jan.kundrat@xxxxxxxxx> wrote:

> This driver is a bit weird because it can hide several gpio_chip
> instances underneath a single SPI slave. One cannot put the
> gpio-line-names DT stanza directly to the SPI slave when the
> spi-present-mask has more than one bit set.
>
> I'm making up the `gpio-bank` DT child name as well as its `address`
> property. We need something to match the DT entries with the SPI
> address.
>
> Signed-off-by: Jan Kundrát <jan.kundrat@xxxxxxxxx>

Ah that was a tricky one.

+ #include "../gpio/gpiolib.h"
(...)
> +                       devprop_gpiochip_set_names(&data->mcp[addr]->chip, of_fwnode_handle(np));

I'm not very happy about reaching into the gpiolib internal API like
this.

As Phil says the function should be moved to <linux/gpio/driver.h>
if we need to use it from drivers.

Also, this symbol is not exported so you would get compile errors
from the test farm quickly becuase a lot of module building
starts failing. This function needs EXPORT_SYMBOL_GPL()
to be used from the outside in drivers.

Mika added this function, I don't know how he feels about
having it externalized?

I also think it would be OK with a device-tree only function,
but maybe that is not as reusable?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux