Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351943pxb; Mon, 20 Sep 2021 19:48:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzujx4o942+SuuMd/wY9Y/Hk3Lpnpn0y3aHIqwgCBgi9phHYS1w0s5l4ROhUAmw/Zk/aLL7 X-Received: by 2002:a92:1306:: with SMTP id 6mr18814895ilt.183.1632192512251; Mon, 20 Sep 2021 19:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192512; cv=none; d=google.com; s=arc-20160816; b=UpyOKULH5JDxjpEEbPpP+v5336xLmlRPRq3O+QuePyt4ZNmhnkS58WEEKiiFBcRDcX xduZ4Ub6r+LFzTMPbkeviWsxqkOUXy9kyTpXXyCkTKKLAnAY2iWHn5dRAy47s7n3wgR/ j4gofmONwnD5GVGp1O2M+xnUw/e7mM3/Ao6wLZcZPNXDnmJ/fESPzDvJ7cbyyLlcYh2/ tH8f+VuWsD9vHvdZLyMzysKIRjVup4ovvuPxfV3r+Z8eJxI1pGReT/8Do5Pg+fgPab4N rG9PyFn6NWnpay5RilIOdrIeepZcaUQJ8WiGewMOdQxTqujK3RrmLU+YB0CFwhDVWeDf oLXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QNCmjymPno/P1Pp7YluKqjTTjjiAVjCmpI+B2AnHmw4=; b=wcxfiu5hiq6MG6yP3Prtgx7qTVAl8skmFoEqECR2oKT+C7w4VEg6junSfCfciAa5w6 YZYWDKCuMxcKqEGQr7fVo9vjVxwSeaQJAYrSbgZwHksTwECAf9M+TrFQKxRNZ3vQ8v0V 2VwfxUXuhn/VkxzlaBpSN2lHRZxqbWS4ZDe28Ob4FxX8arLYLDBqKhspxkpHijr1Hu5D oRSU2czlU1Coux3FRUfAOQXtUQYwMpDUHpQk+9rp1OSGuVUbLPHMEDcyIjX5JLs9Zhfu nDURZxACiPoVtpYKy/j09A5b2aKvdgNCX6mYxVSTKqwvbwvSgvh9DowhLM89GSKSYYll 35QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IhKQBtCR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c32si14835029jaa.44.2021.09.20.19.48.20; Mon, 20 Sep 2021 19:48:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IhKQBtCR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352932AbhITSfl (ORCPT + 99 others); Mon, 20 Sep 2021 14:35:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:49302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379768AbhITSa2 (ORCPT ); Mon, 20 Sep 2021 14:30:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EEF3A63306; Mon, 20 Sep 2021 17:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158841; bh=xqUCy2wEVPZvUXtjmkGDblgtfrUTuZshliEXW4STmvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IhKQBtCRYB7T+ebKWgpaCnH+oh96d7GRNxHtq9Wz77zA+aSKiZWS5NCM+GfPN4X1u mkkQs5Og+9mgJctYYAQZxqoeO+IEhZwhoIjFuQjpC0Xy4bPI9UB+dXIOqALW8RyCQ2 sOuDZPTRRqzVKuF7q5cEYgv7k53WDGQhiv3ll70E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Chen-Yu Tsai , Lee Jones , Sasha Levin , Clamshell Subject: [PATCH 5.10 080/122] mfd: axp20x: Update AXP288 volatile ranges Date: Mon, 20 Sep 2021 18:44:12 +0200 Message-Id: <20210920163918.407457058@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit f949a9ebce7a18005266b859a17f10c891bb13d7 ] On Cherry Trail devices with an AXP288 PMIC the external SD-card slot used the AXP's DLDO2 as card-voltage and either DLDO3 or GPIO1LDO (GPIO1 pin in low noise LDO mode) as signal-voltage. These regulators are turned on/off and in case of the signal-voltage also have their output-voltage changed by the _PS0 and _PS3 power- management ACPI methods on the MMC-controllers ACPI fwnode as well as by the _DSM ACPI method for changing the signal voltage. The AML code implementing these methods is directly accessing the PMIC through ACPI I2C OpRegion accesses, instead of using the special PMIC OpRegion handled by drivers/acpi/pmic/intel_pmic_xpower.c . This means that the contents of the involved PMIC registers can change without the change being made through the regmap interface, so regmap should not cache the contents of these registers. Mark the regulator power on/off, the regulator voltage control and the GPIO1 control registers as volatile, to avoid regmap caching them. Specifically this fixes an issue on some models where the i915 driver toggles another LDO using the same on/off register on/off through MIPI sequences (through intel_soc_pmic_exec_mipi_pmic_seq_element()) which then writes back a cached on/off register-value where the card-voltage is off causing the external sdcard slot to stop working when the screen goes blank, or comes back on again. The regulator register-range now marked volatile also includes the buck regulator control registers. This is done on purpose these are normally not touched by the AML code, but they are updated directly by the SoC's PUNIT which means that they may also change without going through regmap. Note the AXP288 PMIC is only used on Bay- and Cherry-Trail platforms, so even though this is an ACPI specific problem there is no need to make the new volatile ranges conditional since these platforms always use ACPI. Fixes: dc91c3b6fe66 ("mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile") Fixes: cd53216625a0 ("mfd: axp20x: Fix axp288 volatile ranges") Reported-and-tested-by: Clamshell Signed-off-by: Hans de Goede Reviewed-by: Chen-Yu Tsai Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/axp20x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index aa59496e4376..9db1000944c3 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -125,12 +125,13 @@ static const struct regmap_range axp288_writeable_ranges[] = { static const struct regmap_range axp288_volatile_ranges[] = { regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP288_POWER_REASON), + regmap_reg_range(AXP22X_PWR_OUT_CTRL1, AXP22X_ALDO3_V_OUT), regmap_reg_range(AXP288_BC_GLOBAL, AXP288_BC_GLOBAL), regmap_reg_range(AXP288_BC_DET_STAT, AXP20X_VBUS_IPSOUT_MGMT), regmap_reg_range(AXP20X_CHRG_BAK_CTRL, AXP20X_CHRG_BAK_CTRL), regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L), regmap_reg_range(AXP20X_TIMER_CTRL, AXP20X_TIMER_CTRL), - regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE), + regmap_reg_range(AXP20X_GPIO1_CTRL, AXP22X_GPIO_STATE), regmap_reg_range(AXP288_RT_BATT_V_H, AXP288_RT_BATT_V_L), regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG), }; -- 2.30.2