Hi Linus and Andy, > Subject: Re: [PATCH v6 01/13] pinctrl: core: Add pinctrl_get_device() > > 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? Andy asked a question Can a pin be used by multiple devices at same time My answer is no. The reason is, There will be a single owner claiming a pin at given time. setting->data.mux will be unique for a pin. So there won't be a collision when looking by the same pair of function and group name from different device. > > 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 Agreed. > > 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? I don't have a use case like that. Cheers, Biju