Re: Re: pinctrl:when two device use the same pin

From: Linus Walleij
Date: Sat Jun 15 2013 - 15:48:49 EST

On Sat, Jun 15, 2013 at 2:10 PM, xulinuxkernel <xulinuxkernel@xxxxxxxxx> wrote:

> In my company,on the chip, the spi nor flash and nand flash use the same
> four pins.In this case,it must be different devices and different drivers.
> In the "Runtime pinmuxing", I think it is one device has two different
> state.

This does not sound like runtime pin muxing.

This sounds like you have *either* a NOT flash *or* a NAND
flash connected to your chip, not both NOR and NAND at the
same time.

Just do not register the device nor add the pinctrl tables
for the one that is not used on a certain target system.
Atleast do not add the pinctrl tables for NOR when using
NAND and vice versa.

> when spi flash use the pin.then nand request the pin it will fail,I just add
> the current(nand) process in an wait queue,after the spi flash pinctl_put,
> spi will wake_up the wait queue.
> when nand use the pin,if spi request fail, I add the spi process on the same
> wait queue,when nand release the pin,nand will wake up the wait queue.
> Is that ok?

This sounds like a horribly complicated hack to do something
very simple. Look at the problem from a higher level.

Why do you do this? Obviously you have either NOR or NAND
connected? Don't you know from the system board file or
device tree which one it is?

Linus Walleij
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at