bus: imx-weim: guard against timing configuration conflicts
authorSven Van Asbroeck <thesven73@gmail.com>
Mon, 17 Dec 2018 15:48:00 +0000 (10:48 -0500)
committerShawn Guo <shawnguo@kernel.org>
Fri, 11 Jan 2019 07:16:45 +0000 (15:16 +0800)
commitc7995bcb36ef61e8b4136efab31ecf3c9b1633f9
tree7f8be64f47e0407b4f2012df087de0d37cfcb5a3
parent8b8cb52af34da2faa293614b2554c8eac30faeaa
bus: imx-weim: guard against timing configuration conflicts

When specifying weim child devices, there is a risk that more than
one timing setting is specified for the same chip select.

The driver cannot support such a configuration.

In case of conflict, this patch will print a warning to the log,
and will ignore the child node in question.

In this example, node acme@1 will be ignored, as it tries to modify
timing settings for CS0:

&weim {
acme@0 {
compatible = "acme,whatever";
reg = <0 0 0x100>;
fsl,weim-cs-timing = <something>;
};
acme@1 {
compatible = "acme,whatnot";
reg = <0 0x500 0x100>;
fsl,weim-cs-timing = <something else>;
};
};

However in this example, the driver will be happy:

&weim {
        acme@0 {
                compatible = "acme,whatever";
                reg = <0 0 0x100>;
                fsl,weim-cs-timing = <something>;
        };
        acme@1 {
                compatible = "acme,whatnot";
                reg = <0 0x500 0x100>;
                fsl,weim-cs-timing = <something>;
        };
};

Signed-off-by: Sven Van Asbroeck <TheSven73@googlemail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/bus/imx-weim.c