]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/mfd/twl6040.c
mfd: twl6040: Fix device init errors for ACCCTL register
[mirror_ubuntu-bionic-kernel.git] / drivers / mfd / twl6040.c
index dd19f17a1b637543965dd94e64d0d44b9178f64c..2b8c479dbfa6e1edb5db688bc0f7fe2112ea1738 100644 (file)
@@ -322,8 +322,19 @@ int twl6040_power(struct twl6040 *twl6040, int on)
                        }
                }
 
+               /*
+                * Register access can produce errors after power-up unless we
+                * wait at least 8ms based on measurements on duovero.
+                */
+               usleep_range(10000, 12000);
+
                /* Sync with the HW */
-               regcache_sync(twl6040->regmap);
+               ret = regcache_sync(twl6040->regmap);
+               if (ret) {
+                       dev_err(twl6040->dev, "Failed to sync with the HW: %i\n",
+                               ret);
+                       goto out;
+               }
 
                /* Default PLL configuration after power up */
                twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;