ARM: shmobile: fix regulator quirk for Gen2
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 30 Aug 2016 19:50:22 +0000 (21:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:23:43 +0000 (15:23 +0200)
commitf7e55f589d29c9f853d6aeab9947f89002aa89c2
tree202583dd2690320a2cfe796d373cf1c46496540b
parent0338bbade6c1b1e6524c7e74113e55043892049b
ARM: shmobile: fix regulator quirk for Gen2

commit c2f321126e31cd69365e65ecd4a7c774e4fc71d2 upstream.

The current implementation only works if the da9xxx devices are added
before their drivers are registered. Only then it can apply the fixes to
both devices. Otherwise, the driver for the first device gets probed
before the fix for the second device can be applied. This is what
fails when using the IP core switcher or when having the i2c master
driver as a module.

So, we need to disable both da9xxx once we detected one of them. We now
use i2c_transfer with hardcoded i2c_messages and device addresses, so we
don't need the da9xxx client devices to be instantiated. Because the
fixup is used on specific boards only, the addresses are not going to
change.

Fixes: 663fbb52159cca ("ARM: shmobile: R-Car Gen2: Add da9063/da9210 regulator quirk")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> (r8a7791/koelsch)
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c