From patchwork Sat Mar 23 13:27:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13600654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8277CCD11DB for ; Sat, 23 Mar 2024 13:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xNFMMrpbi/eCR3rTH7IHBAJv6pzIXQAuye5nOzYOgsw=; b=MhvKGJk/RJfRQU ue7jnw3Yu7ccQWF79EMziDYsFa+s1evLne7DtK26IyI9dZH1+b19+KLZEIacrVl7KWT1WVefhL4Ml fttyRd7OsivXU/GEGi8vVzDx8zVOrJCjCTn0ueNjkTCZ9gdaC0Mc76FVLuFCcZlrhR/giNyFuT6Vh TVUhTs+cqkrR6SYGViT5DMSRbYKEptPJhR55DUep0FeW1cXmhotm3pyU64JnH3UlMA6jiEQ6RsWY6 2cNLaG8HMTiyjkWNQb6GKWLz2v+sw7wy0Gi0L2ddMpkH8ab81G3kGk3jEI4hGbzErgi96KU05hle9 /rkGxfPP+Uk9KTaPiwMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ro1QA-0000000ASRW-0Xvg; Sat, 23 Mar 2024 13:28:26 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ro1Q6-0000000ASQl-0VoS; Sat, 23 Mar 2024 13:28:23 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-34175878e30so1851195f8f.3; Sat, 23 Mar 2024 06:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711200498; x=1711805298; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EZ1pELuVvPRDiO8S0zv+ldR/r8hfFaunbVkRqdzuPe4=; b=B1NbbPWjWyonJIu1t56YVprKitLwFhpsTCQtStRmoT5lCXoa5sFz0moG01fHSvQXsg UeO5BWkqrOgIWWLtwHoRcciFZv+8bWFfONcxkgiXIGhd9xuBYEe+Q/STZVSBM8GJ9vJs H6yowRqGbgZ50RhLAVLK0ZIC78Q0BxEqSLZ/Jm21CWw2u/9xcQApmq4jKwVM1R6UP7Ce qagjXf31mO8fohrsWL4qBW9s34cdVT4y2824Swxo8BlZkz/s+CtXKbqlG/H1//GT72UJ SM+nnskLsMIA3n8AoI8ZZMArh7/yy/bu/o69cXR9SRolDDHhTZzQLm1VkJbU3OC0xDXd rshQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711200498; x=1711805298; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EZ1pELuVvPRDiO8S0zv+ldR/r8hfFaunbVkRqdzuPe4=; b=eqFP6qhdX+MRYlv34v+ar6lmvEBBYOjz2gvdUJJzAWxoj4ogbEIsMYVqMbuaXVcTpG KZmDrGyduRKsrrJm03Hhxz2cRMwQujbypYuq3KYbCnP7/dp8oabjzlDKOVFmCd1u3vy4 o701PKxj6aznHzKc3iYZtE8PVrtB8tFte3lN8IWNMefkAZpmOEf2NtS1lsw7bZLcgUvJ sco1dQuPEi7Bpia3lZIameyF/zGxSFUxoVbMMUji7pXXfUS5m8sMGDWW+jpfJKMzARMj DWN1V9CD85s9lH7SLpQwSp6ehxbF/9su44mYE3rV4nzxKS67S7QXbro4y/vFY1FL4y53 LYmQ== X-Forwarded-Encrypted: i=1; AJvYcCWg8e+eSl+SZ7Kf7jU1Fm0YSbyOsKkWvSXcbYRoNRuOe+nVwmi+g3AkzNQqywXIIFXS1MzsjqP+lWmYdU896hOETGo4s0yeiLsafmGApyFdkWb5eENZAzckJwrHYmbu9wEvtZQqge7dvtHv1Yr5VN0wUCmjBuQiLl8= X-Gm-Message-State: AOJu0YzPD/7kre+nNzZgDrvgvkaA2UNQcf0SuzvKp9CkYXqaGgV+o08G Za+nZ1rNs55MnSSN7FaKgHYxKXJanrpVOXdsNTVd8UmFlnOK0oo= X-Google-Smtp-Source: AGHT+IHWBxgXRVeLan1IbXLwr5IkdNxnlpfI/0AVMaa+FFCBgQFF1+WMjd7RRQ9wtNDRtuN2vh/s0Q== X-Received: by 2002:a5d:40cb:0:b0:33e:1f2a:d88a with SMTP id b11-20020a5d40cb000000b0033e1f2ad88amr1468113wrq.69.1711200497586; Sat, 23 Mar 2024 06:28:17 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:fbb8:7547:139d:a40f]) by smtp.gmail.com with ESMTPSA id x17-20020adfffd1000000b00341babb8af0sm3076061wrs.7.2024.03.23.06.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 06:28:17 -0700 (PDT) From: Alex Bee To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Linus Walleij , Liam Girdwood , Mark Brown Cc: Chris Zhong , Zhang Qing , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Alex Bee Subject: [PATCH v3 0/5] Add RK816 PMIC support Date: Sat, 23 Mar 2024 14:27:53 +0100 Message-ID: <20240323132757.141861-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240323_062822_192000_B5220998 X-CRM114-Status: GOOD ( 15.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series aims to add support for Rockchip RK816 PMIC series. As per datasheet it's targeted for RK3126/RK3128 (RK816-1), RK1108 (RK816-2) and PX3-SE (RK816-3) but might be used for other SoCs as well. The MFD consists of an integrated RTC, a GPIO controller, two 32k clock outputs, a power key, 3 buck- and 6 ldo regulators, 3 regulator-switches, and charger with integrated fuel gauge. Charger and fuel gauge are not part of this series. Two of the switches (otg/boost) are part of the binding, but not of the driver. They must only ever be enabled if no battery charging is happening, but it will be enabled automatically if a battery is attached and an external power source is connected. Thus that needs some incorporation of a yet to be added charger driver. Integration in the existing rk8xx-infrastructure was pretty straightforward and only needed very little tweaking. In order to not further bloat the driver(s) too much with additional `#define`s I tried to re-use existing ones wherever possible. The patches are loosely based on the vendor's implementation, verified against the datasheet and tested/measured on a RK3126 board. As they are touching several subsystems I'm sending them (very) early for the 6.10.-cycle. changes since v1: - integrated Krzysztof's feedback for the bindings and the resulting driver changes - fixed a sparse warning link to v1: https://lore.kernel.org/lkml/20240321143911.90210-2-knaerzche@gmail.com/ changes since v2: - integrated Krzysztof's feedback to v2 of the bindings and the resulting driver changes link to v2: https://lore.kernel.org/lkml/20240323085852.116756-1-knaerzche@gmail.com/ Please see individual patches for details about the changes. Alex Bee (5): dt-bindings: mfd: Add rk816 binding mfd: rk8xx: Add RK816 support pinctrl: rk805: Add rk816 pinctrl support regulator: rk808: Support apply_bit for rk808_set_suspend_voltage_range regulator: rk808: Add RK816 support .../bindings/mfd/rockchip,rk816.yaml | 274 ++++++++++++++++++ drivers/mfd/Kconfig | 4 +- drivers/mfd/rk8xx-core.c | 103 +++++++ drivers/mfd/rk8xx-i2c.c | 45 ++- drivers/pinctrl/pinctrl-rk805.c | 69 +++++ drivers/regulator/rk808-regulator.c | 218 +++++++++++++- include/linux/mfd/rk808.h | 141 +++++++++ 7 files changed, 847 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk816.yaml