Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772Ab2KTEtb (ORCPT ); Mon, 19 Nov 2012 23:49:31 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:40691 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428Ab2KTEta (ORCPT ); Mon, 19 Nov 2012 23:49:30 -0500 From: Mark Brown To: Samuel Ortiz Cc: linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com, Charles Keepax , Mark Brown Subject: [PATCH 5/5] mfd: arizona: Sync regcache after reset Date: Tue, 20 Nov 2012 13:46:21 +0900 Message-Id: <1353386781-10468-5-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1353386781-10468-1-git-send-email-broonie@opensource.wolfsonmicro.com> References: <20121120044544.GF4483@opensource.wolfsonmicro.com> <1353386781-10468-1-git-send-email-broonie@opensource.wolfsonmicro.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1524 Lines: 45 From: Charles Keepax In the absence of a physical reset line the chip is reset by writing the first register, which is done after the register patch has been applied. This patch synchronises the register cache after the reset to preserve any register changes that had been applied. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- drivers/mfd/arizona-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 202bf55..ad1ca49 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -415,11 +415,19 @@ int __devinit arizona_dev_init(struct arizona *arizona) /* If we have a /RESET GPIO we'll already be reset */ if (!arizona->pdata.reset) { + regcache_mark_dirty(arizona->regmap); + ret = regmap_write(arizona->regmap, ARIZONA_SOFTWARE_RESET, 0); if (ret != 0) { dev_err(dev, "Failed to reset device: %d\n", ret); goto err_reset; } + + ret = regcache_sync(arizona->regmap); + if (ret != 0) { + dev_err(dev, "Failed to sync device: %d\n", ret); + goto err_ldoena; + } } ret = arizona_wait_for_boot(arizona); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/