Re: [PATCH v6 01/13] pinctrl: core: Add pinctrl_get_device()

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

 



On Tue, Mar 7, 2023 at 9:13 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Mon, Mar 06, 2023 at 09:00:02AM +0000, Biju Das kirjoitti:

> > > Add pinctrl_get_device() to find a device handle associated with a
> > > pincontrol group(i.e. by matching function name and group name for a
> > > device). This device handle can then be used for finding match for the
> > > pin output disable device that protects device against short circuits
> > > on the pins.
> >
> > Not sure I understand the use case. Please, create a better commit message.
>
> OK, Basically pinmux_enable_setting allows exclusive access of pin to a device.
> It won't allow multiple devices to claim a pin.

So what is the use case? Which two devices need to use the same
pin at the same time?

You can already:

1) Use the same pin with different devices at different times, because
   pin configs can be changed arbitrarily at runtime, see for example:
  drivers/i2c/muxes/i2c-demux-pinctrl.c

2) Mux a pin to a certain device *and* use it for GPIO at the same time,
  all that is needed is to set .strict to false in struct pinmux_ops.
  This should be false if e.g. the GPIO can be used to "sample" the
  output of a I2C block connected to the same pins, so the two
  functions (I2C and GPIO) are not electrically decoupled.

So do you really have a use case where two devices need to use the same
pin at the same time? I've seen much but I haven't seen this before!
Which two devices are that?

Yours,
Linus Walleij



[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