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)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 2 Sep 2016 08:15:38 +0000 (10:15 +0200)
commitc2f321126e31cd69365e65ecd4a7c774e4fc71d2
tree1f6d28ba15d1048c5123da49d9e93e2d53266a9d
parent29b4817d4018df78086157ea3a55c1d9424a7cfc
ARM: shmobile: fix regulator quirk for Gen2

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>
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c