]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mfd: twl6040: Move register patching earlier in probe
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 1 Apr 2014 13:45:00 +0000 (16:45 +0300)
committerLee Jones <lee.jones@linaro.org>
Tue, 3 Jun 2014 07:11:21 +0000 (08:11 +0100)
Make sure that we patch the ACCCTL register as the first thing when the
driver loads, thus configuring I2C fast mode and i2c access for dual access
registers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/twl6040.c

index 574774d7f826ab3d6ca047e22fcf7c6f239177ec..12b314ea48dc72ed0420f5570010c376ba3ebe6e 100644 (file)
@@ -675,6 +675,9 @@ static int twl6040_probe(struct i2c_client *client,
        mutex_init(&twl6040->mutex);
        init_completion(&twl6040->ready);
 
+       regmap_register_patch(twl6040->regmap, twl6040_patch,
+                             ARRAY_SIZE(twl6040_patch));
+
        twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
        if (twl6040->rev < 0) {
                dev_err(&client->dev, "Failed to read revision register: %d\n",
@@ -725,10 +728,6 @@ static int twl6040_probe(struct i2c_client *client,
                goto readyirq_err;
        }
 
-       /* dual-access registers controlled by I2C only */
-       regmap_register_patch(twl6040->regmap, twl6040_patch,
-                             ARRAY_SIZE(twl6040_patch));
-
        /*
         * The main functionality of twl6040 to provide audio on OMAP4+ systems.
         * We can add the ASoC codec child whenever this driver has been loaded.