From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646531; cv=none; d=zohomail.com; s=zohoarc; b=J/LxMaHY0k08h0xULbBB8t7P9kok2zMQqsV4squoDHYTxmmv0p+DL4b+uF3LaUqTPwqKYCHOckrAmsoLEN1lc/XFmgS6vBdP9h5VS2BqQSkSdHnHbYtb86Mu1nqC4g2TtM1W8SUCK/bpTH/b9qymQ5U505oNmWx47XXKjP7kgfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646531; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=HCP+UiqivE5Sl8wYg29qb2EI1nN4FyBAZjFb96c2xmg=; b=H8mkbqtlRwRgpBZQaW/GxE1U6KOtAgDZ/4vcExfxGuS5gehjnoQlGAtJvBgWuKgILGEZDjCM0CRP4xYwlc+LUuz4gDBw8Fa6BwbWcg9FPajXof/9uTiyUvDWqPsS5GULgyLUTPkt/n8ndHLjo5/jSv5mnDx0Mq8O1x21s4roYOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646531874231.43091336928592; Thu, 14 Jan 2021 09:48:51 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbhANRsB (ORCPT ); Thu, 14 Jan 2021 12:48:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbhANRr7 (ORCPT ); Thu, 14 Jan 2021 12:47:59 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68377C061575; Thu, 14 Jan 2021 09:47:19 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id l12so1469050wry.2; Thu, 14 Jan 2021 09:47:19 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HCP+UiqivE5Sl8wYg29qb2EI1nN4FyBAZjFb96c2xmg=; b=svdu84/ElnlYtSiLtNgvB6KYAmxG2LhyvWU8NfyNke8coNVPKn3hW4YGJUTPRQQgUq OfG66nAI/Oldk8ptAE7zXfx6BHknix0rKlXYbXwekj/WFAUPYM0xs1CwpZRT6xlsBHEI HZx0nnLFyFB8OAMr5nIFe9Lfi1jg1tmdq1cmFIoyUurX8zNOdWL2oenyY+DLsexSy0xE WTK3FwxKKSJ87aAD4P9LZZFVsJXHruUr7hOYj1yL6fHN/RcOdiwmQr5/I4lMl/m0VJJE N4n+iHM6iO/A88P0WkqWYbcI1KH8gwACBjjUZlAhPsZ9uhUi3U1L+NYfjfgldWddhGNb 2ZWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HCP+UiqivE5Sl8wYg29qb2EI1nN4FyBAZjFb96c2xmg=; b=l41Pj0QhZxwkQnZkxO2o4q8iDpDO+V4i8OFRmEgyMonwQKvc0rgutTBG03nUYfO1Qd W+sICxMRPtCtiM70tg5SD0Hac+KzyQ07xi9+GzAkczftaHem9t+UJisTwZugLAfzCmx1 MVcgcsfrIVNI9v/5mYZn9FSpGZ5sUd4ldz9RNWP2elSzfjptsXssRa8RCYWKaT00Z6ck sR7TXr4hzPg2sj8XJDV7KrsDmJy8YEoHovmH77P198jpcibR6mnT0Gl3mqfNKugELV+U SQrY46tgugzsIFlNeJPtbD7pG8ulNauv7wsRubqC3Jz6Hj0mKEcfZuykEW07W08CHrdw wOsQ== X-Gm-Message-State: AOAM530NQ5pj5Jl7dtWYcbPCyy/CCAgF8ueTLrVU7JMnDqfmmUFma0oB SmJRmmiQ7YJhaseMG8gkjrKRFRsrJUI= X-Google-Smtp-Source: ABdhPJx8he/bKYBiu8rz/RLo8/zqjalIgYcXP5SKDmgtYC46+hFLUlE2jl9v+KPgn7wXrnAx86ZMdQ== X-Received: by 2002:adf:d085:: with SMTP id y5mr9333000wrh.41.1610646437811; Thu, 14 Jan 2021 09:47:17 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein Subject: [PATCH v5 1/6] regulator: pf8x00: add a doc for the module Date: Thu, 14 Jan 2021 18:47:09 +0100 Message-Id: <20210114174714.122561-2-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" pf8x00 module build was not documented. Signed-off-by: Adrien Grassein Reviewed-by: Jagan Teki --- drivers/regulator/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index eafa13be6e3e..ba8c09d90701 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -846,6 +846,10 @@ config REGULATOR_PF8X00 Say y here to support the regulators found on the NXP PF8100/PF8121A/PF8200 PMIC. =20 + Say M here if you want to support for the regulators found + on the NXP PF8100/PF8121A/PF8200 PMIC. The module will be named + "pf8x00-regulator". + config REGULATOR_PFUZE100 tristate "Freescale PFUZE100/200/3000/3001 regulator driver" depends on I2C && OF --=20 2.25.1 From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646532; cv=none; d=zohomail.com; s=zohoarc; b=SBxK746ovsmQrg17ITA10H/4vn3RlVwIERqx5WI7Fzr7X2dNTx3it1Ieno1iaFD+/3QsSk+HfBcJxCJISBn5T4XDssQ30d4oEOG9/+5n/S1qZcU5r03S3qrCHW8YGZS0ZxWeHYvTfM3xSMUzh4jFbrNFc+BpDenVVizAbaQoYKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646532; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=DtEEhUaxTt8j5XfHcvBkIaxKk170L8EAq3Kc5q2BKFw=; b=dRpLtuusfzBcboyiGBkjRBxseHub87+1a1br+yuMRac1uvvDb+b6mGo0nzFsQ/02Xb2X+zVh+fHhBEWm/OwALS+XKdBgBBGrdyjfjhSpouksllI+v+H98okB+23veTduWHYFQd33IrSPpPZq8aZmxBhA7By+yUQrkHUzTPyfa04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646532166839.8498024101946; Thu, 14 Jan 2021 09:48:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728645AbhANRsC (ORCPT ); Thu, 14 Jan 2021 12:48:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbhANRsA (ORCPT ); Thu, 14 Jan 2021 12:48:00 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1551C061757; Thu, 14 Jan 2021 09:47:19 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id h17so5069388wmq.1; Thu, 14 Jan 2021 09:47:19 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DtEEhUaxTt8j5XfHcvBkIaxKk170L8EAq3Kc5q2BKFw=; b=IE0vkRJiE0+WN8RvyDPbgW5cDvdQvp5UUSenmzo7NtbV8afQUXFWfl2KBMTl6MD+Ws 0giuWeq8PzD89lAWeARvRjUzJnodn2lxuKRrPeLCuzNEbUgrUHmBMCh74hJCCtc/QVzk Tg8EE9nDX+x26R5rj03ext/GvhCcYULdreU21Gol7r6w1a+HLm87YplC7L72mCvGNT15 yb6VKQMRDtSsEgVuoEEqKipe5hPGgqHNKAxb5wAYaK3rZ7iFqj/CURaOXaM9YesUg7Jc Lp839mlZJbHYXHF/W3Rxz5/Mk8sA7YdKWkCXvhzMs2NAS+oUG/If7IQ6jGOj+XsJBKhE rGGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DtEEhUaxTt8j5XfHcvBkIaxKk170L8EAq3Kc5q2BKFw=; b=eADmsXOUz/HxbYq7EBRYTHLTUL/M6iTFryR9NiVM4M7L4BbyXgl3ABC9W15tyINzg+ Pe+L3i9A1CL1HmFlaqSR+6547D9QY0hXffdRKHWjklLyh3qCrXpGJh9aQ1ht6brWAC/E 453jSbgHgg7nPIhK+kbJxB5CErH198wZQr0+ULjkve5NTJ8njjgHa+ujXTDgfMSRqeUN Mx9CvMw22f8dRF31tiOKp5EYTPBkgkxOWhCVm+jHF8DFGdxTqrbtlweQE0usXaZrJBR+ udsN0KCLbiZLABl76NB+g80oNGexgckjSF0dtOV7oTTIaXGgi+Rt3t/yIdTQpkYqcCkU 499Q== X-Gm-Message-State: AOAM533LkJYbtxCjH8QkbbmYW46Iy3bESpKXP2j11tVrMPuraJi3PJJf trux/LmcQ6PTiby2FUkYN2A= X-Google-Smtp-Source: ABdhPJzQnRwVvO7ej+aEeds+fRWVRNqY+5rduGQMyjoAgFjCV2mE2WK+4RQ+lW0F6u/cvfj8WqtXdw== X-Received: by 2002:a1c:6484:: with SMTP id y126mr4993076wmb.76.1610646438729; Thu, 14 Jan 2021 09:47:18 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein , Rob Herring Subject: [PATCH v5 2/6] regulator: dt-bindings: pf8x00: fix nxp,phase-shift doc Date: Thu, 14 Jan 2021 18:47:10 +0100 Message-Id: <20210114174714.122561-3-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" nxp,phase-shift is an enum so use enum format to describe it. Minimum and maximum values are also wrong. Signed-off-by: Adrien Grassein Reviewed-by: Rob Herring --- .../bindings/regulator/nxp,pf8x00-regulator.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulat= or.yaml b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.= yaml index 956156fe52a3..095cfdae7b67 100644 --- a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml @@ -73,21 +73,11 @@ properties: =20 nxp,phase-shift: $ref: "/schemas/types.yaml#/definitions/uint32" - minimum: 45 - maximum: 0 + default: 0 + enum: [ 0, 45, 90, 135, 180, 225, 270, 315 ] description: BUCK regulators phase shift control in degrees. =20 - Listed phase shift control values in degrees are, - 45 - 90 - 135 - 180 - 225 - 270 - 315 - 0 (default) - unevaluatedProperties: false =20 "^vsnvs$": --=20 2.25.1 From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646533; cv=none; d=zohomail.com; s=zohoarc; b=Gv7GK91xhz4+B1LCtskx33H5XOXuDni/lNcD6jwep87iOqPWin7Q10CXyRvXmIDB8oWpVGCsulNaDHMTY7lVfUpZWkph4I49jWv14yJcnkaj1OVTYqbNiq5c96K3mP746xg7433phTJniTSz2vMC2DYQxsRAPEetdhc44tZQ9rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646533; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=88PJilJPUmCioVbW/4bjwv5wSt9qwPSJ9TKxxvO9lk4=; b=EmDAVrXLP7yUIvFg9deTG2c74GgkX81/Syufxi+vW3okwkVSXWXR+oYhBl79YF4I6Foyj/8yf0fCQgXjGjC8tFnmD7T+giAwPA55MdEDh6YkTV1//cQ9/M93VL55fvtoK2RQdCHpodWO0goJG9z/0kbwD20eo/YSd2I+Qmxf4WM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646533162805.9253936114336; Thu, 14 Jan 2021 09:48:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728107AbhANRsT (ORCPT ); Thu, 14 Jan 2021 12:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbhANRsB (ORCPT ); Thu, 14 Jan 2021 12:48:01 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C63C0613C1; Thu, 14 Jan 2021 09:47:20 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id r4so5435144wmh.5; Thu, 14 Jan 2021 09:47:20 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=88PJilJPUmCioVbW/4bjwv5wSt9qwPSJ9TKxxvO9lk4=; b=GjKuuwgbh7KiCrLVqLeHpZ1Nkk9F3q/HiEfpzRMGsVLLgurZ0FLtPuC5yq87VPF+Ot XlbkyMHWKowPeQmnoVQpKkyIv20vJ2Lc0/KDUUWg3wYnqvENW82Y6WF+rnUNAeUmIoKK spuOu75LZrUEIq1jjmJ4TjuLLJ1bB5tZ14SmsPnspKExUrwBQNljf7EotWRnl9s7pG9R fCzafy7bcafAEHiqT07dzHvOBMWtMzWcvFfF5xH31U5zlwYZumHOr738fnr9QQxfEcyH W7fmKxoHLuj1djTRARtkawhBk9x5Vjfgk51Iqsf2lNzE0ktnB5lGUJHRR4Y/3HJ/KN23 5VBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=88PJilJPUmCioVbW/4bjwv5wSt9qwPSJ9TKxxvO9lk4=; b=t4zQigQhWasxRlCcnI/aEDSu1sRetMAmjSM14z1I/4K4FXKXR+UcGoicKKEceb4pOr idYME1hTyCuWrlYeo9U8ei46XI2zrrUvU8XvOKX4bXZUY/maz8EpUq9ZxITjqnIid4U/ KBf+fPxyEtZ8B5Z1EqWzJf+XdM5Zhd8XVDWHDkx/GXrNd4dEKTyAHz86r2iEdYGNyyHJ 6tI+yrmQx7QBiYk1n/TEjCnImu8M8BvFK82gVs+g5F3p64K13rG/tZTHHTZH+4rgzRRd 8uZuFI8qtF6CBaSpuvSdSmEPfyUaXJ4i8O0Q601wuqdz+eUDL65A3PgM/8rfGJKJNTns CNgg== X-Gm-Message-State: AOAM532aePzjINZdYKPKsHzzQaiaIPUCjce4b/3aDQC2pZJQmHnvU7XQ YhQZBp7iMU6wrDDAOUc9EgI= X-Google-Smtp-Source: ABdhPJwuKBUkZsTgygITotPoFgUQ+4AmoXivqWqt7idxqoxoQYDajWBpG5xIULGgRIODw/lhd3auVQ== X-Received: by 2002:a1c:bd09:: with SMTP id n9mr4890565wmf.32.1610646439475; Thu, 14 Jan 2021 09:47:19 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein Subject: [PATCH v5 3/6] regulator: dt-bindings: pf8x00: mark nxp,ilim-ma property as deprecated Date: Thu, 14 Jan 2021 18:47:11 +0100 Message-Id: <20210114174714.122561-4-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This property seems useless because we can use the regulator-max-microamp generic property to do the same and using generic code. As this property was already released in a kernel version, we can't remove it, just mark it as deprecated Signed-off-by: Adrien Grassein --- .../devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulat= or.yaml b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.= yaml index 095cfdae7b67..8761437ed8ad 100644 --- a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml @@ -62,8 +62,11 @@ properties: $ref: "/schemas/types.yaml#/definitions/uint32" minimum: 2100 maximum: 4500 + deprecated: true description: BUCK regulators current limit in mA. + This property is deprecated, please use + "regulator-max-microamp" instead. =20 Listed current limits in mA are, 2100 (default) --=20 2.25.1 From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646532; cv=none; d=zohomail.com; s=zohoarc; b=iEvftpNS8qXhlJM9gwxNNntS5NavGQVSQXflgNzngs0MCPNbRnJN1ldgvk9QFQB3UD7PV5TnXyvCDqRe1QH/jEGSzNa9NVcRjMhPxBa/i4ilRzOdOYD1nTxvxM/IXMwf9qWdLTHyZa089stgLhK42dfTFtd6h/VMEZkphB75nsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646532; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=ga6RWsMGRnOBRU223li1MY5FtCYIzdzZznWAiBLHlds=; b=IpxMidAnKrxdYXt45BXfAd7TPMvLXhwAPIBul/WgKnSZQZ5MsiV3JPtOhV8ySwc7zonMiZMFUT2iRmOPk5fh39dmgh5NVmrBpEqPyF7FhDiIcLLOWOvF/lywJ/nLlG7eOb3wH92BJr59AK2+rZaFBW2AonVCVA4LUNmkMI0iuQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646532437925.7405892562206; Thu, 14 Jan 2021 09:48:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728666AbhANRsG (ORCPT ); Thu, 14 Jan 2021 12:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728251AbhANRsB (ORCPT ); Thu, 14 Jan 2021 12:48:01 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA1BC0613CF; Thu, 14 Jan 2021 09:47:21 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id t16so6687810wra.3; Thu, 14 Jan 2021 09:47:21 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ga6RWsMGRnOBRU223li1MY5FtCYIzdzZznWAiBLHlds=; b=f/17cztYGGsFK/7aaaGpvZa5EbwK9sNQ1TmSNtC6qjocJtgpJzlKziBuakpDcUmZNd JVIxR5MFYiHgnI3h4jNRLYeld+Ec4iFhqAkziAfWjTj+xqaYvOK7qgEK/mekPdZN34MT OEQjWSMWGe0TLzzKNX3a17AKGgHaJdBMyPgErMtcHafpT620DzbQpWNxX0a3uTrqLN+O QI9+diAzfjCyuAuvBlkt/NDhH4TkrA9zq/XHbD9VtzOnm/MeJ8UBu8DgnYa3/il1Igpy TGHW4F6KPbchcrwXRMRrsO+b+GTaAsDrQsaAZX731DglmZg7Xzuf50UYg9mMcdZfxHdy Y3Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ga6RWsMGRnOBRU223li1MY5FtCYIzdzZznWAiBLHlds=; b=k09Q75C11lAyyrbpV7JkGSx54WmWDvOysHqJCIfEbIaupLRmhShiaIftAEWP5tDszD 34M+eld8JuvH/i482XUIwYP9DrdcEXPGzI4dHOU+zaUf6Z3ftJayWcUikqP9kUR9W7QA JtsfwbH4mNSgIDwqKP/SiIjpimG3PA0Ykzn4MKkuVb2q9KxIEnxapFCWp+CKif8+HDxm 583yY0LqgtRIPMQVsyexV4gKzuFgF9JQku5+f4gWb3lrdCYoEXZeda41+oPeSbuutYNC q3u0hGiR2rWPROaIbW9ly/WoOd8lA+9UypKggT6s8TfPsWdAYqcaPHGrD9bkP1MxFrOq fXbA== X-Gm-Message-State: AOAM532z2/f6dG+iRjJYTCzF/miOQ3UcZqwpCczhTPorlXa85w7KA6lg 2RXq3nLcb4X1a0CluivhqD0= X-Google-Smtp-Source: ABdhPJwiDxYJ3eb57uGDOOCwa8m9322/vFSyP7y0Bd4TDutL8scEjmM1ByljlBT/VDP1FXV/mbShig== X-Received: by 2002:a05:6000:1884:: with SMTP id a4mr9174998wri.42.1610646440227; Thu, 14 Jan 2021 09:47:20 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein Subject: [PATCH v5 4/6] regulator: pf8x00: mark nxp,ilim-ma property as deprecated Date: Thu, 14 Jan 2021 18:47:12 +0100 Message-Id: <20210114174714.122561-5-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This property seems useless because we can use the regulator-max-microamp generic property to do the same and using generic code. As this property was already released in a kernel version, we can't remove it, just mark it as deprecated. Signed-off-by: Adrien Grassein --- drivers/regulator/pf8x00-regulator.c | 55 +++++++++++++++++++++------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/drivers/regulator/pf8x00-regulator.c b/drivers/regulator/pf8x0= 0-regulator.c index af9918cd27aa..0c0f643b9c60 100644 --- a/drivers/regulator/pf8x00-regulator.c +++ b/drivers/regulator/pf8x00-regulator.c @@ -128,7 +128,6 @@ enum pf8x00_devid { =20 struct pf8x00_regulator { struct regulator_desc desc; - u8 ilim; u8 phase_shift; }; =20 @@ -150,6 +149,11 @@ static const int pf8x00_ldo_voltages[] =3D { 3100000, 3150000, 3200000, 3300000, 3350000, 1650000, 1700000, 5000000, }; =20 +/* Output: 2.1A to 4.5A */ +static const unsigned int pf8x00_sw_current_table[] =3D { + 2100000, 2600000, 3000000, 4500000, +}; + #define SWV(i) (6250 * i + 400000) #define SWV_LINE(i) SWV(i*8+0), SWV(i*8+1), SWV(i*8+2), SWV(i*8+3), \ SWV(i*8+4), SWV(i*8+5), SWV(i*8+6), SWV(i*8+7) @@ -199,10 +203,10 @@ static struct pf8x00_regulator *desc_to_regulator(con= st struct regulator_desc *d return container_of(desc, struct pf8x00_regulator, desc); } =20 -static void swxilim_select(const struct regulator_desc *desc, int ilim) +static void swxilim_select(struct pf8x00_chip *chip, int id, int ilim) { - struct pf8x00_regulator *data =3D desc_to_regulator(desc); u8 ilim_sel; + u8 reg =3D PF8X00_SW_BASE(id) + SW_CONFIG2; =20 switch (ilim) { case 2100: @@ -222,7 +226,32 @@ static void swxilim_select(const struct regulator_desc= *desc, int ilim) break; } =20 - data->ilim =3D ilim_sel; + regmap_update_bits(chip->regmap, reg, + PF8X00_SWXILIM_MASK, + ilim_sel << PF8X00_SWXILIM_SHIFT); +} + +static void handle_ilim_property(struct device_node *np, + const struct regulator_desc *desc, + struct regulator_config *config) +{ + struct pf8x00_chip *chip =3D config->driver_data; + int ret; + int val; + + if ((desc->id >=3D PF8X00_BUCK1) && (desc->id <=3D PF8X00_BUCK7)) { + ret =3D of_property_read_u32(np, "nxp,ilim-ma", &val); + if (ret) { + dev_dbg(chip->dev, "unspecified ilim for BUCK%d, use value stored in OT= P\n", + desc->id - PF8X00_LDO4); + return; + } + + dev_warn(chip->dev, "nxp,ilim-ma is deprecated, please use regulator-max= -microamp\n"); + swxilim_select(chip, desc->id, val); + + } else + dev_warn(chip->dev, "nxp,ilim-ma used with incorrect regulator (%d)\n", = desc->id); } =20 static int pf8x00_of_parse_cb(struct device_node *np, @@ -235,12 +264,7 @@ static int pf8x00_of_parse_cb(struct device_node *np, int val; int ret; =20 - ret =3D of_property_read_u32(np, "nxp,ilim-ma", &val); - if (ret) - dev_dbg(chip->dev, "unspecified ilim for BUCK%d, use 2100 mA\n", - desc->id - PF8X00_LDO4); - - swxilim_select(desc, val); + handle_ilim_property(np, desc, config); =20 ret =3D of_property_read_u32(np, "nxp,phase-shift", &val); if (ret) { @@ -279,6 +303,8 @@ static const struct regulator_ops pf8x00_buck_ops =3D { .list_voltage =3D regulator_list_voltage_table, .set_voltage_sel =3D regulator_set_voltage_sel_regmap, .get_voltage_sel =3D regulator_get_voltage_sel_regmap, + .get_current_limit =3D regulator_get_current_limit_regmap, + .set_current_limit =3D regulator_set_current_limit_regmap, }; =20 static const struct regulator_ops pf8x00_vsnvs_ops =3D { @@ -327,6 +353,11 @@ static const struct regulator_ops pf8x00_vsnvs_ops =3D= { .volt_table =3D voltages, \ .vsel_reg =3D (base) + SW_RUN_VOLT, \ .vsel_mask =3D 0xff, \ + .curr_table =3D pf8x00_sw_current_table, \ + .n_current_limits =3D \ + ARRAY_SIZE(pf8x00_sw_current_table), \ + .csel_reg =3D (base) + SW_CONFIG2, \ + .csel_mask =3D PF8X00_SWXILIM_MASK, \ .enable_reg =3D (base) + SW_MODE1, \ .enable_val =3D 0x3, \ .disable_val =3D 0x0, \ @@ -458,10 +489,6 @@ static int pf8x00_i2c_probe(struct i2c_client *client) regmap_update_bits(chip->regmap, reg, PF8X00_SWXPHASE_MASK, data->phase_shift); - - regmap_update_bits(chip->regmap, reg, - PF8X00_SWXILIM_MASK, - data->ilim << PF8X00_SWXILIM_SHIFT); } } =20 --=20 2.25.1 From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646534; cv=none; d=zohomail.com; s=zohoarc; b=d142xUiZubIUVbEDWwq0lIAHgIpx4lTgA/rYrI2yFFlUL+/0WUr2MCPHa/SXWhnVKzWwK68BmTPripr7IhKSaAKGyKz5uycsysWZbJoO6luMWUipa31X0n3P1vi6IkOJNJesKyXGJ9HV0qcJAt+6vWH/sNffaH0pyprI4Nj+SCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646534; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=e0qzq5GFWJhIlfTRRTu2x5Ocj16Bkaz6W/a5NchpwUE=; b=K+i1THBQSngdrLi92n06Z/zgml5VLr9VNcLdM99eNkCXE4bEWC3v03Z+EkQ/MiAX8nHa79sJk7Of21fklP+OTEhUhQ+rbc8RxJfafNr8Sd4Pgn2y6gr/5djceighoHTT+dREgVkFCMYPKWbFwblIS6D1ho6g4Iux+4xljyQct4E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646534138261.5573930384122; Thu, 14 Jan 2021 09:48:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728750AbhANRsj (ORCPT ); Thu, 14 Jan 2021 12:48:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbhANRsi (ORCPT ); Thu, 14 Jan 2021 12:48:38 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4643CC0613D3; Thu, 14 Jan 2021 09:47:22 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g10so5454476wmh.2; Thu, 14 Jan 2021 09:47:22 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e0qzq5GFWJhIlfTRRTu2x5Ocj16Bkaz6W/a5NchpwUE=; b=aw6mBerskmjus4D5dS1TmqusS5Ad5hokLJwa6BtO3TDb/F5+3XsCXBFZAjuM+DSrJL LH+iFoVnDuLnaCQdHRbCRbF3MDJXV9a4vKY3NA1PcnWtFntclU+9SgP5uqW8SCoe/E6W HciPjfYRaZtlbebMxCcueFCqECN6K9HQMiYnVuaymGMcsbofbcvMphXV5IZtTb2llha0 UXJ/LME5/iFFP61nT3Ipd8Ztrs4MzuUSGeXDY4KcnzqDufaKwNAEkMru2+4wyMttOu9m GrKTFNDUqlB2tHLNt8s9z3lpjG9iTJ6CCR7icTWw3o3hj9MnF3KPftCbVaI6DN+LLZIf W+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e0qzq5GFWJhIlfTRRTu2x5Ocj16Bkaz6W/a5NchpwUE=; b=URtqyKaZ6zMACA85ZF2nI9ZnF5rNEgvK/ApElrl/JY0LV2awy59MC8eNbHRpyTPhgO sPaxreDRD1tiKfXF2iapN6vMTbP2qnSYWCcKt850fF0ur7FNPYN/bhR9KSg3klT0mNzq f3qHtXExcAW33yq2i92kcdwdmCtWzoFX/KbsOOflHKFbmVhQL3h8lWq5ckRdK/l4N/IZ Si5V5UUwrcsaS21RYV5XZj+3d0kbv3EeUBG6ai+g+6sDBqKwl16KnXJr4CHTCYPSWh9J nHAAehLVAwjLfKvKo6Dk18ynSlEhEoN/DBrYL7XbRi5yiIpMnFUFtVaIyEB+GqBpqVV8 VAdg== X-Gm-Message-State: AOAM530ZtfTvX75G8C/rjfBNd9EcoPLLP3hEfzJmTsc+ncNZ8pIeQNvD EI833gl0Exp795tU+w+anZw= X-Google-Smtp-Source: ABdhPJwNJV0yDU56qMZLEWWwLX84HCWerRUgnUYCDeLtI94GDJP7RO4yn7sDgWtlYb5kmy08Jel30w== X-Received: by 2002:a7b:cf30:: with SMTP id m16mr4885648wmg.145.1610646441032; Thu, 14 Jan 2021 09:47:21 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein Subject: [PATCH v5 5/6] regulator: pf8x00: use linear range for buck 1-6 Date: Thu, 14 Jan 2021 18:47:13 +0100 Message-Id: <20210114174714.122561-6-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Use a linear range to describe the voltages of the bucks 1-6 instead of listing it one by one (via a macro) Signed-off-by: Adrien Grassein --- drivers/regulator/pf8x00-regulator.c | 83 +++++++++++++++++----------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/drivers/regulator/pf8x00-regulator.c b/drivers/regulator/pf8x0= 0-regulator.c index 0c0f643b9c60..866162fddd07 100644 --- a/drivers/regulator/pf8x00-regulator.c +++ b/drivers/regulator/pf8x00-regulator.c @@ -154,35 +154,11 @@ static const unsigned int pf8x00_sw_current_table[] = =3D { 2100000, 2600000, 3000000, 4500000, }; =20 -#define SWV(i) (6250 * i + 400000) -#define SWV_LINE(i) SWV(i*8+0), SWV(i*8+1), SWV(i*8+2), SWV(i*8+3), \ - SWV(i*8+4), SWV(i*8+5), SWV(i*8+6), SWV(i*8+7) - /* Output: 0.4V to 1.8V */ -static const int pf8x00_sw1_to_6_voltages[] =3D { - SWV_LINE(0), - SWV_LINE(1), - SWV_LINE(2), - SWV_LINE(3), - SWV_LINE(4), - SWV_LINE(5), - SWV_LINE(6), - SWV_LINE(7), - SWV_LINE(8), - SWV_LINE(9), - SWV_LINE(10), - SWV_LINE(11), - SWV_LINE(12), - SWV_LINE(13), - SWV_LINE(14), - SWV_LINE(15), - SWV_LINE(16), - SWV_LINE(17), - SWV_LINE(18), - SWV_LINE(19), - SWV_LINE(20), - SWV_LINE(21), - 1500000, 1800000, +#define PF8XOO_SW1_6_VOLTAGE_NUM 0xB2 +static const struct linear_range pf8x00_sw1_to_6_voltages[] =3D { + REGULATOR_LINEAR_RANGE(400000, 0x00, 0xB0, 6250), + REGULATOR_LINEAR_RANGE(1800000, 0xB1, 0xB1, 0), }; =20 /* Output: 1.0V to 4.1V */ @@ -296,7 +272,19 @@ static const struct regulator_ops pf8x00_ldo_ops =3D { .get_voltage_sel =3D regulator_get_voltage_sel_regmap, }; =20 -static const struct regulator_ops pf8x00_buck_ops =3D { + +static const struct regulator_ops pf8x00_buck1_6_ops =3D { + .enable =3D regulator_enable_regmap, + .disable =3D regulator_disable_regmap, + .is_enabled =3D regulator_is_enabled_regmap, + .list_voltage =3D regulator_list_voltage_linear_range, + .set_voltage_sel =3D regulator_set_voltage_sel_regmap, + .get_voltage_sel =3D regulator_get_voltage_sel_regmap, + .get_current_limit =3D regulator_get_current_limit_regmap, + .set_current_limit =3D regulator_set_current_limit_regmap, +}; + +static const struct regulator_ops pf8x00_buck7_ops =3D { .enable =3D regulator_enable_regmap, .disable =3D regulator_disable_regmap, .is_enabled =3D regulator_is_enabled_regmap, @@ -345,11 +333,41 @@ static const struct regulator_ops pf8x00_vsnvs_ops = =3D { .of_match =3D _name, \ .regulators_node =3D "regulators", \ .of_parse_cb =3D pf8x00_of_parse_cb, \ - .n_voltages =3D ARRAY_SIZE(voltages), \ - .ops =3D &pf8x00_buck_ops, \ + .n_voltages =3D PF8XOO_SW1_6_VOLTAGE_NUM, \ + .ops =3D &pf8x00_buck1_6_ops, \ .type =3D REGULATOR_VOLTAGE, \ .id =3D PF8X00_BUCK ## _id, \ .owner =3D THIS_MODULE, \ + .linear_ranges =3D pf8x00_sw1_to_6_voltages, \ + .n_linear_ranges =3D \ + ARRAY_SIZE(pf8x00_sw1_to_6_voltages), \ + .vsel_reg =3D (base) + SW_RUN_VOLT, \ + .vsel_mask =3D 0xff, \ + .curr_table =3D pf8x00_sw_current_table, \ + .n_current_limits =3D \ + ARRAY_SIZE(pf8x00_sw_current_table), \ + .csel_reg =3D (base) + SW_CONFIG2, \ + .csel_mask =3D PF8X00_SWXILIM_MASK, \ + .enable_reg =3D (base) + SW_MODE1, \ + .enable_val =3D 0x3, \ + .disable_val =3D 0x0, \ + .enable_mask =3D 0x3, \ + .enable_time =3D 500, \ + }, \ + } + +#define PF8X00BUCK7(_name, base, voltages) \ + [PF8X00_BUCK7] =3D { \ + .desc =3D { \ + .name =3D _name, \ + .of_match =3D _name, \ + .regulators_node =3D "regulators", \ + .of_parse_cb =3D pf8x00_of_parse_cb, \ + .n_voltages =3D ARRAY_SIZE(voltages), \ + .ops =3D &pf8x00_buck7_ops, \ + .type =3D REGULATOR_VOLTAGE, \ + .id =3D PF8X00_BUCK7, \ + .owner =3D THIS_MODULE, \ .volt_table =3D voltages, \ .vsel_reg =3D (base) + SW_RUN_VOLT, \ .vsel_mask =3D 0xff, \ @@ -366,6 +384,7 @@ static const struct regulator_ops pf8x00_vsnvs_ops =3D { }, \ } =20 + #define PF8X00VSNVS(_name, base, voltages) \ [PF8X00_VSNVS] =3D { \ .desc =3D { \ @@ -394,7 +413,7 @@ static struct pf8x00_regulator pf8x00_regulators_data[P= F8X00_MAX_REGULATORS] =3D { PF8X00BUCK(4, "buck4", PF8X00_SW_BASE(PF8X00_BUCK4), pf8x00_sw1_to_6_volt= ages), PF8X00BUCK(5, "buck5", PF8X00_SW_BASE(PF8X00_BUCK5), pf8x00_sw1_to_6_volt= ages), PF8X00BUCK(6, "buck6", PF8X00_SW_BASE(PF8X00_BUCK6), pf8x00_sw1_to_6_volt= ages), - PF8X00BUCK(7, "buck7", PF8X00_SW_BASE(PF8X00_BUCK7), pf8x00_sw7_voltages), + PF8X00BUCK7("buck7", PF8X00_SW_BASE(PF8X00_BUCK7), pf8x00_sw7_voltages), PF8X00VSNVS("vsnvs", PF8X00_VSNVS_CONFIG1, pf8x00_vsnvs_voltages), }; =20 --=20 2.25.1 From nobody Sat May 10 06:24:19 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610646533; cv=none; d=zohomail.com; s=zohoarc; b=QgUNz0Fs1oiJmV1Oocm3lcqbs8/ldEiB+F9hgI5AvlV3wjE+XwUhJh2NrsPWTdz6lEXouUg+d7988I5OrZcD/QZWoWa/RytXe9xROpI9AtBqSn3xMOYp3767/NRJOS55r3sE9AL6B6AegjmIazZtNOBKZLEl8mcPFvQ3jXiiRgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610646533; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=hGDgOgI8/XSOFKjdfUfIFJTYsXZSv8qURm+3sJRqDQc=; b=idNCgFOHODYhuzE1VsKIWTiYW4u5wQdYo69Y7uA4O/WO7HJtX/5x7PNPtrpFnCvz65FlbkWsLJmXDZZrI0hYHjGQHkC0TkMNpsacA2wlauEPhehbf2TBoTKO2kbddU84plOb9HR1/2N27kmrmEd14a0zueTRtEhppfb/6z3WumM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1610646533532549.6159548117065; Thu, 14 Jan 2021 09:48:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728790AbhANRsk (ORCPT ); Thu, 14 Jan 2021 12:48:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbhANRsi (ORCPT ); Thu, 14 Jan 2021 12:48:38 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5203DC0613D6; Thu, 14 Jan 2021 09:47:23 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id e25so5475785wme.0; Thu, 14 Jan 2021 09:47:23 -0800 (PST) Received: from adgra-XPS-15-9570.home (2a01cb0008bd2700adae03a5d647a4d0.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:adae:3a5:d647:a4d0]) by smtp.gmail.com with ESMTPSA id g18sm5120663wrw.61.2021.01.14.09.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 09:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hGDgOgI8/XSOFKjdfUfIFJTYsXZSv8qURm+3sJRqDQc=; b=vOTOiAt+Oycdm5PyJ/zqPfkOTzHkb3GC30OxNqxUyvvF37ofl0my5xg8pCzXEh446Z HlPf1Z/+cbv+CAWSVWnVk3nQLzW4eEmmiOgsyydVLHPSnwhKj7OW6X4uWukNyrQAC3Dq Ukvox5iZtyjCmK4rE3Mch5HiZq6en1BWDgZC4evcy3EBlgm3UUzNsaT3BAgb37Pi1YD/ m0xz1CnLhj01ee1liuhywv4EPjLlE/BrLS22VqYJr6I0tPl7Zrjw25wENcWGJSK78C/c p2fJlt1nRYaBkwmM0BA4ttgG/7fxWoRbhTF9tkT8yodOOEvUYB3MXTtkgQXMgbcZ62/E 7nTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hGDgOgI8/XSOFKjdfUfIFJTYsXZSv8qURm+3sJRqDQc=; b=A2CFm+SxvGJmmIrWvKiJ/F24YYXrqoDTV80hAS3xFP/D0jDlm54loAT3f4g0lVRyfi KGEpqYy4PMBbgvU5oZu3fPUp3G9ZyQhUP11QfmddwDW+x0Y+hJwxAhbN2A6bGA0ITqff 6Mi8Rs5mairgh9b2wZOHKzChHBmRKK/aXujEEh4j3PZ7mMWye/r7ZQM9T+poo3gVnDX0 KabP+SeTAhhoe7IyXfsYYZs131Psf1hP4c20WYKSVqlI4yiprt/WocLwCP1nt1YuNEd9 VDmtddkFXvhHQqTDvFwcul2NSrNAzsrTh02XwaPkrG9PxS0R4AZkI33jTs3c8dhdgr5s ooOg== X-Gm-Message-State: AOAM5308TGihO757ZhWf1WOlEQ+S8/8rjwX2EAzWSKrKG8warvCQNM02 iKxsSpBB+YSMv+grmcYL21I= X-Google-Smtp-Source: ABdhPJzYYzB/r1Q/y0uP9NXRK7Vl4/jWZtL5kLGI+1Uyc5kg6oN6Ib1ChuUIaNanOs+3R5tcxY/fkA== X-Received: by 2002:a1c:4843:: with SMTP id v64mr5061533wma.26.1610646442082; Thu, 14 Jan 2021 09:47:22 -0800 (PST) From: Adrien Grassein Cc: broonie@kernel.org, jagan@amarulasolutions.com, lgirdwood@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adrien Grassein Subject: [PATCH v5 6/6] regulator: pf8x00: fix nxp,phase-shift Date: Thu, 14 Jan 2021 18:47:14 +0100 Message-Id: <20210114174714.122561-7-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114174714.122561-1-adrien.grassein@gmail.com> References: <20210114174714.122561-1-adrien.grassein@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Fix the ternary condition which is a bad coding style in the kernel I also remove the defering configuration of the nxp,phase-shift. The configuration is now done at parsing time. It save some memory and it's better for comprehension. I also use the OTP default configuration when the parameter is wrong or not specified. I think that it's better to use the default configuration from the chip than an arbitrary value. Signed-off-by: Adrien Grassein --- drivers/regulator/pf8x00-regulator.c | 71 +++++++++++++++------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/drivers/regulator/pf8x00-regulator.c b/drivers/regulator/pf8x0= 0-regulator.c index 866162fddd07..1e5582d73405 100644 --- a/drivers/regulator/pf8x00-regulator.c +++ b/drivers/regulator/pf8x00-regulator.c @@ -114,7 +114,6 @@ enum swxilim_bits { #define PF8X00_SWXILIM_SHIFT 3 #define PF8X00_SWXILIM_MASK GENMASK(4, 3) #define PF8X00_SWXPHASE_MASK GENMASK(2, 0) -#define PF8X00_SWXPHASE_DEFAULT 0 #define PF8X00_SWXPHASE_SHIFT 7 =20 enum pf8x00_devid { @@ -128,7 +127,6 @@ enum pf8x00_devid { =20 struct pf8x00_regulator { struct regulator_desc desc; - u8 phase_shift; }; =20 struct pf8x00_chip { @@ -174,11 +172,6 @@ static const int pf8x00_vsnvs_voltages[] =3D { 0, 1800000, 3000000, 3300000, }; =20 -static struct pf8x00_regulator *desc_to_regulator(const struct regulator_d= esc *desc) -{ - return container_of(desc, struct pf8x00_regulator, desc); -} - static void swxilim_select(struct pf8x00_chip *chip, int id, int ilim) { u8 ilim_sel; @@ -230,35 +223,55 @@ static void handle_ilim_property(struct device_node *= np, dev_warn(chip->dev, "nxp,ilim-ma used with incorrect regulator (%d)\n", = desc->id); } =20 -static int pf8x00_of_parse_cb(struct device_node *np, +static void handle_shift_property(struct device_node *np, const struct regulator_desc *desc, struct regulator_config *config) { - struct pf8x00_regulator *data =3D desc_to_regulator(desc); + unsigned char id =3D desc->id - PF8X00_LDO4; + unsigned char reg =3D PF8X00_SW_BASE(id) + SW_CONFIG2; struct pf8x00_chip *chip =3D config->driver_data; + int phase; int val; int ret; + if ((desc->id >=3D PF8X00_BUCK1) && (desc->id <=3D PF8X00_BUCK7)) { + ret =3D of_property_read_u32(np, "nxp,phase-shift", &val); + if (ret) { + dev_dbg(chip->dev, + "unspecified phase-shift for BUCK%d, using OTP configuration\n", + id); + return; + } =20 - handle_ilim_property(np, desc, config); + if (val < 0 || val > 315 || val % 45 !=3D 0) { + dev_warn(config->dev, + "invalid phase_shift %d for BUCK%d, using OTP configuration\n", + val, id); + return; + } =20 - ret =3D of_property_read_u32(np, "nxp,phase-shift", &val); - if (ret) { - dev_dbg(chip->dev, - "unspecified phase-shift for BUCK%d, use 0 degrees\n", - desc->id - PF8X00_LDO4); - val =3D PF8X00_SWXPHASE_DEFAULT; - } + phase =3D val / 45; =20 - phase =3D val / 45; - if ((phase * 45) !=3D val) { - dev_warn(config->dev, - "invalid phase_shift %d for BUCK%d, use 0 degrees\n", - (phase * 45), desc->id - PF8X00_LDO4); - phase =3D PF8X00_SWXPHASE_SHIFT; - } + if (phase >=3D 1) + phase -=3D 1; + else + phase =3D PF8X00_SWXPHASE_SHIFT; + + regmap_update_bits(chip->regmap, reg, + PF8X00_SWXPHASE_MASK, + phase); + } else + dev_warn(chip->dev, "nxp,phase-shift used with incorrect regulator (%d)\= n", id); + +} + +static int pf8x00_of_parse_cb(struct device_node *np, + const struct regulator_desc *desc, + struct regulator_config *config) +{ =20 - data->phase_shift =3D (phase >=3D 1) ? phase - 1 : PF8X00_SWXPHASE_SHIFT; + handle_ilim_property(np, desc, config); + handle_shift_property(np, desc, config); =20 return 0; } @@ -501,14 +514,6 @@ static int pf8x00_i2c_probe(struct i2c_client *client) "failed to register %s regulator\n", data->desc.name); return PTR_ERR(rdev); } - - if ((id >=3D PF8X00_BUCK1) && (id <=3D PF8X00_BUCK7)) { - u8 reg =3D PF8X00_SW_BASE(id) + SW_CONFIG2; - - regmap_update_bits(chip->regmap, reg, - PF8X00_SWXPHASE_MASK, - data->phase_shift); - } } =20 return 0; --=20 2.25.1