Re: [PATCH] i2c: pca954x: Add option to skip disabling PCA954x Mux device

From: Andy Shevchenko
Date: Sat May 27 2017 - 18:31:33 EST


On Tue, May 9, 2017 at 11:20 AM, <ying.zhang22455@xxxxxxx> wrote:

> On some Layerscape boards like LS2085ARDB/LS2080ARDB,
> input pull-up resistors on PCA954x Mux device are
> missing on board. So, if mux are disabled after powered-on,
> input lines will float leading to incorrect functionality.
>
> Hence, PCA954x Mux device should never be turned-off after
> power-on.
>
> Add option to skip disabling PCA954x Mux device
> if device tree contians "i2c-mux-never-disable" property
> for pca954x device node.

> +#ifdef CONFIG_ARCH_LAYERSCAPE

This is 99.99% is no go.

You need to spend more time to make the driver more generic (perhaps
using device property instead) and not using ugly #ifdefery.


--
With Best Regards,
Andy Shevchenko