From patchwork Fri Mar 24 11:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 7148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp555494vqo; Fri, 24 Mar 2023 04:38:40 -0700 (PDT) X-Google-Smtp-Source: AKy350a4X7++URhtLFB4e4CnzAD3efOsxEaaFWqDyD8US9P6zRkKntrUlbIsFHRxUCTg/uxwqsuH X-Received: by 2002:a17:906:1e08:b0:93b:d1ee:5f41 with SMTP id g8-20020a1709061e0800b0093bd1ee5f41mr2175665ejj.31.1679657920648; Fri, 24 Mar 2023 04:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679657920; cv=none; d=google.com; s=arc-20160816; b=n0Ar8YuAClCw/UqrMt9MaPvW3XgYbezOkS8wKI0f8Nj+fvJ0L8LTYFibgx06wVJFdQ AwhcLH8Ug67vfkDAFoIb90Ec/Zl3c++0W+ZAyb4Pl/d8McjpTqxUO34gKnlElHkYrRp3 IfheXF+MgUz8I01YgGEMkk8658958e5w6QEli1bNRcJoJBG40gls1eTvW4Mriq133LUd HU3uqJmGc9hixshcQ3VzmjV9oiwqSeQ8dBpuRTWtnsns7+MGdNpu+zs9qH5pn7UoV5xL kKGb6usOnvfVGHAlYKj64NU5pxxO1T4kzNmHC2xfgTu1h+60X4AkoeDjTbB92eecAGUK vEfA== 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 :message-id:date:subject:cc:to:from; bh=8SbM14UkBIicJc/IU+NXonmbn35nzkZcJfJKspmDohM=; b=mB7dYRRtvaP5FoKCqNXwktldZPOMQjEP86m+97nq83Uh+3QhcuANp0qckcn6N7zeAm vPkCroRo+jPoAre4Oi685YdgTcCZepltzADknqoAlaPzUgHAQu/UFNc6WtYnTqUYINpt olY5WicVo+R4sV0hu8otbTRoUyqeorkf6+Yt5sDZs8wkui4H93wlfcYdfjQTW7LqIPog AJjfRVv7g7AOtAl+AWXbdHWa2oPlKAc0IUWgWbNw9Qxvlly20z4Egmms1S92UlCodBLw M0ePn4aSlky5zDIgteSxWaUOuwoaKQEUem21rT+z0HmNzEjmUXrWglBzaVmO+ihf2Lwp OGUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020aa7d717000000b004be020a0537si21224258edq.512.2023.03.24.04.38.17; Fri, 24 Mar 2023 04:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231402AbjCXLat (ORCPT + 99 others); Fri, 24 Mar 2023 07:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbjCXLas (ORCPT ); Fri, 24 Mar 2023 07:30:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A5C5F1ABCD; Fri, 24 Mar 2023 04:30:46 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 716A411FB; Fri, 24 Mar 2023 04:31:30 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 828263F6C4; Fri, 24 Mar 2023 04:30:44 -0700 (PDT) From: Andre Przywara To: Lee Jones , Chen-Yu Tsai , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Martin Botka , martin.botka1@gmail.com, Shengyu Qu , Samuel Holland , Jernej Skrabec , linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v9 0/3] regulator: Add X-Powers AXP313a PMIC support Date: Fri, 24 Mar 2023 11:30:10 +0000 Message-Id: <20230324113013.254371-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761248983935138458?= X-GMAIL-MSGID: =?utf-8?q?1761248983935138458?= This patch series adds support for the X-Powers AXP313a PMIC, which is often bundled with Allwinner H616 or H313 SoCs. It's my turn again for this revision of the series, after Martin did v7 and v8. I addressed the comments that Chen-Yu gave (many thanks for that review!), which adds the power button interrupt and should fix the shutdown functionality (which is typically unused since PSCI takes precedence). For a complete changelog see below. Up to v5 this was speaking of the AXP1530, which seems to be some internal name. The chips we have seen in the wild are all labeled AXP313a, so we go with this name here, from now on. This is supported by the fact that there is an AXP313a datasheet, but none for the AXP1530. Patch 1 is the binding documentation (just the new compatible string), patch 2 adds the MFD bits (mostly describing the extent of the regmap), while patch 3 describes the actual AXP313a register definitions. Since this ties neatly into the existing AXP and generic regulator framework, the patches are indeed only structure definitions, there is little new code. For now we papered over this "fixed customizable" RTC-LDO regulator in the same way this was done before for other PMICs (AXP803, for instance), We think we can fix this properly with a follow-up patch, for all instances. Please have a look! Cheers, Andre Changelog: v8 .. v9: - use MFD_CELL_NAME macro - fix LDO regulator names to match the datasheet - only mark changing registers as volatile - use correct register for shutdown operation - add power key resources - disallow x-powers,dcdc-freq in the DT binding - drop unused OUTPUT_MONITOR register name, add SHUTDOWN_CTRL - require dcdcfreq being 0 (non-present DT property default) v7 .. v8: - Add check for dcdcfreq being zero v6 .. v7: - Use alphabetical ordering v5 .. v6: - change name from AXP1530 to AXP313a - extend commit messages - drop AXP*_FREQUENCY register (not used anyway) - better vertically align struct definitions - rename IRQs to match names used for other PMICs - add RTC_LDO regulator - use decimal numbers for selector ranges - use macro definitions to name some values - force DC/DC switching frequency to be fixed at 3 MHz - change LDO source supply to VIN1 (as per datasheet) v4 .. v5: - Use alphabetical ordering in mfd - Correct { placement line - Replace spaces with tabs in 1 struct v3 .. v4: - Fix indentation v2 .. v3: - Move AXP1530 dt-binding to alphabetical order v1 .. v2: - Remove RSB support. - Drop .id = 0 - Add dt-binding for the AXP1530 Martin Botka (3): dt-bindings: mfd: x-powers,axp152: Document the AXP313a variant mfd: axp20x: Add support for AXP313a PMIC regulator: axp20x: Add support for AXP313a variant .../bindings/mfd/x-powers,axp152.yaml | 12 +++ drivers/mfd/axp20x-i2c.c | 2 + drivers/mfd/axp20x.c | 82 ++++++++++++++++++- drivers/regulator/axp20x-regulator.c | 60 ++++++++++++++ include/linux/mfd/axp20x.h | 32 ++++++++ 5 files changed, 187 insertions(+), 1 deletion(-)