From nobody Sat May 10 05:36:15 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=1610577197; cv=none; d=zohomail.com; s=zohoarc; b=WtzjYRsS+yKHjrSGFKNM5g77DSuzK+iQ3nBPZpX3w8ijUmOxr1NnBsDdocVyU9R4J59qtTRJ2h5LlTo5KPUP6paS4L1I4I6I78rMqEvHfSeFcKlGX0d/9i/CrsfcJXem99cXQUI46hsT8hHiQj8A6GHiKx0zRkL8owIUZZa5LLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610577197; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=HCP+UiqivE5Sl8wYg29qb2EI1nN4FyBAZjFb96c2xmg=; b=YCbD/M3d1hKvs6ANBTUXE04ko7aW/lZzRhsc7BtMJ+bOGf0zWscwc9OkygBGW8o6jygHXq7loLK5Qahoi7oxyBhIafnUeA1dsNa85dFbcLkR2gKOvvyik8cOPL9lkLtKSUFK/rGtY5VrTS4bATn59foy0uw+Rs0rstFuUTH9Qhs= 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 1610577197015522.3709569229868; Wed, 13 Jan 2021 14:33:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729338AbhAMWcE (ORCPT ); Wed, 13 Jan 2021 17:32:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbhAMWVC (ORCPT ); Wed, 13 Jan 2021 17:21:02 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DCAC061786; Wed, 13 Jan 2021 14:20:21 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id d26so3746255wrb.12; Wed, 13 Jan 2021 14:20:21 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20: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=HCP+UiqivE5Sl8wYg29qb2EI1nN4FyBAZjFb96c2xmg=; b=qB1AqFISSnQ4XVQAnERYtklKDmYAuzzTq3KK7dYax4/RSzrWXePRReHZTFP3kJc25q wnafc1VxATDfLPHttUxPXKU0474oFoyLeb9nG/pn1UzNOnTY7ux/oW3KHCOsmLrSfZ98 Fy8RMdardHim/IcLYGDEJYKd7D3u7fJCOHoKSfZlsIgx7KDp3qBTcxF76+0vQ3yc8/nb SIzsdffYzIxY0VxgPdGlzJng3RQzOzdvuFa+daKum/IYh3MLT8Vcsymg5FLx0oHeTBqI UiNJTWjGngsEtJaI7b8bSp5zqWp/FptZDDWBzjdRRnDZJuemx8d6eKLHczWWFfUZEQCJ n6vg== 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=YbyGz5RNYtJyOW/cU5DrXza0eMApMeoYYpbg3TjeAnHbr0Ku4h/nx2DunWAGRjTFzX 1QfIpksqjFtXeyK5gMEZHyWZakO7sQRXj91y9ouksSYV1T/owZR/7s8Up9GUd2zEEdvc 9nmL6Gay+60ydiD02gcLUfaBFEY9RQbncQkFy0W/nu4i1vdaH6u2g/G8jm5WY7qWbrCy Y63aZe1qe0DiuMWbVczwFFRiRMgsuEQAbt/eDz/LJVlTXQUQYtoIxw7s+mpe0P3YyeOP PwJ+PAuW/yeibNCW3CKmq0hau3kp8If4RCKR7UwxS1IfPjwi3G42V6hHL4dKS5esOQzv QvBA== X-Gm-Message-State: AOAM530DtChOzfAIiDyVFsewbD9LTnovhmWkU1aK1ahO0JGq5jIh0Yqf XUz+VN+cIGzt14AuWG9wajDRdDOawTM= X-Google-Smtp-Source: ABdhPJzlkwd4LnPR8AMzxeXYoNePumKZK7rPFnb4by2DgtM02PqWsNG2wPSXerYIG32W0nVXK+uqjw== X-Received: by 2002:a5d:4112:: with SMTP id l18mr4620379wrp.116.1610576420235; Wed, 13 Jan 2021 14:20: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 v4 1/6] regulator: pf8x00: add a doc for the module Date: Wed, 13 Jan 2021 23:20:11 +0100 Message-Id: <20210113222016.1915993-2-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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 05:36:15 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=1610590282; cv=none; d=zohomail.com; s=zohoarc; b=IIuuOowMhbTlAxLi3O9TVz2aufoASTG9fPWnyk9lq/Q5quO30qpINvg/1E4fn5pNXBuKEnnzzRejSDlIqszytCOQiJyQe88crjSMu30hjUga1zqZnOd3f0eLiG2duGSrWYgKrO6SI1Zwu3DofMdt8wVwE/c0ZiWYq2SGs07CTgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610590282; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=DtEEhUaxTt8j5XfHcvBkIaxKk170L8EAq3Kc5q2BKFw=; b=ckmoBr9LY4u5xOocTZYENLqZ/wSKXkAlao57YgVvj9QOF5PBv8Ql8jT8mCKU3wV5HZNIZsR5zm4Kc5hTIaGvzNcR0zNbvU807icd5d6f5eFp6qLUfZQqOBW9BMeVqylhpxQTDwm8zsZsnXuYYM2sIu5idr7y360zWTSYGhFb72s= 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 1610590282687315.702528499609; Wed, 13 Jan 2021 18:11:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730160AbhANCKh (ORCPT ); Wed, 13 Jan 2021 21:10:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbhAMWVC (ORCPT ); Wed, 13 Jan 2021 17:21:02 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39868C061794; Wed, 13 Jan 2021 14:20:22 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id c5so3765562wrp.6; Wed, 13 Jan 2021 14:20:22 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20: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=DtEEhUaxTt8j5XfHcvBkIaxKk170L8EAq3Kc5q2BKFw=; b=t2jAY3yHico/ObRfDdy7xiLEy9mjYFcAcL/gAph7CoyHxUC7C6iSneBTYJCWSK0L+N 6bKDXxfWT//cIz83xyNFSICbRqgiEu7BkKecYaLyFEB9zGtyYr0imp5vCcVIPb92F+p/ JhhkIyxKMdZFl9w0w79l0qh78PlGJCZ9WVWQIetfhX3LlnRaZ4snHueKOflrfqyX9ID6 O+ZG3UCmwc6ktmBuM5QgL5EK757SwPglpNfEQQdC6EP9biCHOFmC+1GgTMeXR+8Lu8AB DviiZDxcdDxBLkT3Pn/iEDj61UfWbUPkRGBeeYYmnW32cfw7zKCY6X3lMms2by1GKBl9 nlpg== 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=UbqtG/5D2DQ/YUcndiglJMfK6LK+Zzjk5i1a9++Z3LqPxOXH0n6rr8hdWbzwfFYMhL Fj2y+UyEloIg2DgoVE5Ott5j0DF49qKsHdfCcFtn3ep6T197F6ua79vV3INeTZzW68gw sv+zDfvft1A7ScbAto0BhvFyDlx4P5ydIeZ50eW5FNki8C1EdDJeme1Jjp5NULigomDO nEiJ9N5/zYeccLtEob7EkimFv1b/ksBICOgwxTb9RIjYcOeWVp9lwU3pqqy39PVd8/O9 jQX+lY0HGg+IfY6Sv+iuRRXmxu6lci9WtSYOBUhZRQtDneNgNE+MYtFB6OsDTm1FSTyL tZvA== X-Gm-Message-State: AOAM533g+ix3/YUfKbwoxV/P3IYiHwvl5bOS9m/oYgCxMspZ6k8lk0Up KbeG23LUNFQoVYpA9WZ8OTQ= X-Google-Smtp-Source: ABdhPJytCseclbg+Aop+UVkMZhYXTGwL3POsB79+AAQXrCkjdyRDJ3wkk9zFQNdTn31DdrLEslQ5OQ== X-Received: by 2002:a5d:4905:: with SMTP id x5mr4639636wrq.75.1610576421030; Wed, 13 Jan 2021 14:20: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 , Rob Herring Subject: [PATCH v4 2/6] regulator: dt-bindings: pf8x00: fix nxp,phase-shift doc Date: Wed, 13 Jan 2021 23:20:12 +0100 Message-Id: <20210113222016.1915993-3-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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 05:36:15 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=1610590281; cv=none; d=zohomail.com; s=zohoarc; b=SnM6n42bd6q6yUgmBVQHS1W+N1az/aIkq+nT8d/GX0LgLY6MrsfB4UOq4QylhgUXvIOQtaVTiL3kvmffeIlFQ0YIw57a09Y5LLCOf8RdaQg21iPRVRQxGB3BM0tb9pBUhro40NIZA5EbavcqHoihKAEAPtQJbPsFax6gkdapPUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610590281; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=EIeFCYJ0DLGf3Q0pQGTEuf3nHXG+YCy6iHntm2rbSr4=; b=TVLjEEDbYx22hn9a1spTXmexOVfa7Y4Jd/y4yj1mZAjlSrkLesT2OOy9mmCBjQnCRLj7wLyhh9ui/oGgJVd0JLtLczq3qaSDl7CR4FCTbV18RzrQ13PMKVBtxQLssfqTZ/ghwAQJHTiqiDewaMbUBO8j2S4YobbvWpIrLuKhCE0= 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 1610590281546332.493357257933; Wed, 13 Jan 2021 18:11:21 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730224AbhANCKj (ORCPT ); Wed, 13 Jan 2021 21:10:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbhAMWVJ (ORCPT ); Wed, 13 Jan 2021 17:21:09 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2746CC061795; Wed, 13 Jan 2021 14:20:23 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id 3so3021967wmg.4; Wed, 13 Jan 2021 14:20:23 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20: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=EIeFCYJ0DLGf3Q0pQGTEuf3nHXG+YCy6iHntm2rbSr4=; b=KfW9lfxRIGsL3tqNOJ3zKDRWXD8V1A9W9mIVJP5czKpyVxm7HIQv959kN5qEWQn9yj BrqoXcY1hsyHcfAA3YZUJwR589gVhiGyD//4TQ17xUclwtyyvG0JcL3tmDoKEdlD/Uln ZBg3pkG2WUl9VKIYXsM+1QUiEBXfakuzsBV6pKaYGS9YJkcam7jWOdY7/e2ziQThtRSk dKW8rcu0J/6/jGtcBt+EEUTExTL3sP+eQNtjyho8DTrD1+gAAg9Jxp8aDcFwkLtI2Iox V9+tulU3S5TiRbdBpaYiQQ9Onib7CRALWRpCxoNbyJ5GXh1qC7DdihWfAUuPBfsO6DNH eF+w== 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=EIeFCYJ0DLGf3Q0pQGTEuf3nHXG+YCy6iHntm2rbSr4=; b=TF5SBoesgYySJm5AiCkcfIobPXnu+B4zYQfXMClNzi7mIMCmRqHE5EBd/TXwTHZZb4 NQ2jX7E+7ZEE7UtipoywlKPzDtpxZz5z6fubwHTAl6fgR+yaUfRe2hpiMf9kPpriF2Ru c8+1Kda9SAXtWCuBAOi90dNCORP05lhYJtlbYLzu8kR7fkG5gQuWeLuKYnxWoJwYkFDi WgwQqVf0W5aShQgwlGIaJuU8hz1AmZuEPlhP6JKQs7A2oaLyQ+wSl/mVam5bd5Kklu+i vKPub+J9I81H7lZELtV/WmIgMtW1URaZmaNpth74YSqeyGd2ABNU+gw33wKSEkCHY16k 1/fw== X-Gm-Message-State: AOAM530Vw89mkr2PIJtfi1Vx+Ty4url6fIB7fng27V0+2O60ZZb9G6jl wocFLy+fDDMWkedl+IyT0buhCrQjmzg= X-Google-Smtp-Source: ABdhPJzBowBGUXukqJI1Ja5gGFyaG8qBJFePHkyT6PLx6lsgqkRXgX5m//q4TCC3d6qwoqnx8bSMYw== X-Received: by 2002:a1c:2e43:: with SMTP id u64mr1137481wmu.105.1610576421827; Wed, 13 Jan 2021 14:20: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 v4 3/6] regulator: dt-bindings: pf8x00: mark nxp,ilim-ma property as deprecated Date: Wed, 13 Jan 2021 23:20:13 +0100 Message-Id: <20210113222016.1915993-4-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulat= or.yaml b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.= yaml index 095cfdae7b67..5b76bbba8fe0 100644 --- a/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml @@ -64,6 +64,8 @@ properties: maximum: 4500 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 05:36:15 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=1610589974; cv=none; d=zohomail.com; s=zohoarc; b=S/OJJCRFvU832mDoxq1z9B4nnVg4aKQfBfZTAHXmYIUCNrHUP6/PnUPqKKYkD/YGV6PzYAktEhhgBiK8IuQb8hiUc/GG4neAjbpyEGoDso6xdqEXtvW8rjop6E82WWc0fzJ5vL87eT5yhriPUzl4ZdAR7tBs3CIyg4n4KZZNnQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610589974; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=ga6RWsMGRnOBRU223li1MY5FtCYIzdzZznWAiBLHlds=; b=b6deR5c5h86N/vJtBDgvth2KKyoVjyI0yQorA0hA89s0YyupE7vKujz9XvupzzW4FpxstwgaBKRyQ73nuWx3znlJ7/7gn9/c4xmzvohL+65EqSTynVPHvbr8FJKwirKY0dUOb5PgCNPr8hQVJNYY4yffSupPanrOmqXX/7DmX4E= 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 1610589974240403.63047607742635; Wed, 13 Jan 2021 18:06:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729343AbhAMW2D (ORCPT ); Wed, 13 Jan 2021 17:28:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbhAMWVE (ORCPT ); Wed, 13 Jan 2021 17:21:04 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA03FC06179F; Wed, 13 Jan 2021 14:20:23 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id y187so3031113wmd.3; Wed, 13 Jan 2021 14:20:23 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20:22 -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=Zpi12CjpqLZABzoMsmC6r+DkHWv0xviygQSlCiD/ji3x1lBfhlzvJCMSvjBqdNPp8M Ctx4JMZExpKXPkva4YsUHZN2/whYRoTK1VmS1Q1q4X/GdprHN8w1r+cUfKzSEs9HiZPt yc+0u2oVmPb4hr+3BP8h+QQr4loJRXuQ2zQXFi3iiAW6otp1TJpynBDf/xG3SVWCbI4H pNMIQFwwdWukgGDBlcZlUjUOAJGC+lm4rZMXlbDAEj6cvzjAlUYzYdwit+xZoSgawSK7 P6fGe7Q9K63TMvZIxZUiV69BSqVZ6tifI4/TttMXECpJOQJBkR9y+WIHtiB/LJQyszW+ fW5g== 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=QDFR/DYn6MmQF8rWzTa4785ncxzI5U6fRnKUhlYwh96tLgQ52R+Bn/lffGzpHm+Z/m VqIY2gU1OiRX3QW0Sel16hVjgU4U1S+r0O3OYY2hm7ljJ5tnETnrzO4y7zOKaiCt0d+9 slm+RxCGJHV0C0+Z+uX/MfFzBO2YdTFYJFrSp1hJFZ8agopxtuigRNJo/OTNKjI6+6+I D8DzOAAw3g8veWqhxUqR0XdBCy7P7HLmum6VN6TqyewSGWUFzfKxzLES7gS9hkE6PhmU GcbU58WmKU2cVW12Q/Dha8En8dDqytmSoUB4y0tvlM8LjBlcIopj3Ourx/9jc2JIdVQN qZJA== X-Gm-Message-State: AOAM530SNeQvtdUde2dy6vbCrkEFKu8ZOb/KTJWDPBrcsPOAtesEJH0w xk7S4iEQkP/lUGI5pNYaKCoKIc65j+I= X-Google-Smtp-Source: ABdhPJzsYRZPxVIafNK7x1L9j61Dj9sqOobrkbxo3nsO5xzaEs0vM4CqzPVy08X64pJPSeEzvDwyfA== X-Received: by 2002:a1c:2d8a:: with SMTP id t132mr1081182wmt.119.1610576422600; Wed, 13 Jan 2021 14:20: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 v4 4/6] regulator: pf8x00: mark nxp,ilim-ma property as deprecated Date: Wed, 13 Jan 2021 23:20:14 +0100 Message-Id: <20210113222016.1915993-5-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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 05:36:15 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=1610590282; cv=none; d=zohomail.com; s=zohoarc; b=MIDPppHQ6Hojxv15ZAOIZxdgFmi9g1jhAyRx2BrsPcZbWvWF81ES6mypTjo+xQdU1z5vmj9l7SXzQCEO4d3NE+MWAQsyFqb3Ns8s55MFJ1Tr69GCOHa/FQVi2fYzxx5rPNCdFXLLl36leWt674M+mShydPQNBk4LUjS6RNLr0aY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610590282; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=e0qzq5GFWJhIlfTRRTu2x5Ocj16Bkaz6W/a5NchpwUE=; b=d6qWeCxNHyPMn1K6GZIzxzHZ8MIug/gntWAFnUQGcRzl2/q53AKPBUPPYKax3yY4qHgXrRVepOlCN7koMojfnj7VbczXclj/N26Z6ycWQl5eoVn2UFouD/PmMJov7eJ6mfP8VALomCbC+r9LwVJD16d/mmyT7miwOPc8eq45wjM= 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 1610590282442619.5041013234985; Wed, 13 Jan 2021 18:11:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730247AbhANCKm (ORCPT ); Wed, 13 Jan 2021 21:10:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727148AbhAMWWN (ORCPT ); Wed, 13 Jan 2021 17:22:13 -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 A7628C0617A2; Wed, 13 Jan 2021 14:20:24 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id h17so2757733wmq.1; Wed, 13 Jan 2021 14:20:24 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20:22 -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=Ox7TP60eaxinx4kYcBtjsLTVnPmt6IATpb+3D8o5JwiTlbMHNbKxFVlzTOjlAgj6Xe FIHV+6I05P9ko0ii/tZ2r50AVcPBWQBk+BRbzr2Ciy5LbQpjSzJVbzW8tZCUws6nzGbM 0GgmZBlgWHSeMS+/3hXt+p5zaNR+CVVWCrtgPn8rHodD9XoH/fv3CysRHVaDKhqg3sPA zHRaz3OchkJw2BsOUQj+DRNjQvrs6JgDOUfD0aQV+Xdre2yr4UHWFEcIetzRCxQjuCvf 6P8gZa/8v47fVYvuJYCRqSJuYmXIckS1KVMQ0tlgIDoyOXzsp5uYF+6amOptx+SSqzWs mwLQ== 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=U1LCLnaySqgHSso6uOBF5Id2V2jRJCuhnJH/v9cXU9/ntl1I7vvPUfkajYL/tJnWmx /QoDjocmay8jLT37szvc8C73p425iU3/9kgZL4AGtTP9GdfwbGvCL4TA4YFgrEvK+Wzd tN4/U3/54I6An3T81xvCerFsifG2xkInG3x77CAldIgNwmAJpkzTok5OJl0iTluOR71X w02wxWcCmoF18H/C6Zwm/jX9ONoT7iKjYvGj7rUa7PrtcuVzoWtsZXIL74+SpzpAnePB VgACM/cSHZr6Y2uMzdcFibeWN8DAwAYYGn3SeAVklVClw3cW4XjGPgni/d/qz7btGo6L zjwg== X-Gm-Message-State: AOAM533/UHM/lBsVAqw5tH0oqx5vNtx+BT84VuOKdMsuKMcrllgxRoKt 7B4lQSkHgZEnlMp9qw1TN7I= X-Google-Smtp-Source: ABdhPJyDMvhvZiI86RTCiTcra3W21i/3Kyp9XeHtG3cI63wa98WMwDOPbvhmmXvxKVr+shUe0KFanA== X-Received: by 2002:a1c:6402:: with SMTP id y2mr1113088wmb.43.1610576423451; Wed, 13 Jan 2021 14:20:23 -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 v4 5/6] regulator: pf8x00: use linear range for buck 1-6 Date: Wed, 13 Jan 2021 23:20:15 +0100 Message-Id: <20210113222016.1915993-6-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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 05:36:15 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=1610590354; cv=none; d=zohomail.com; s=zohoarc; b=GirGNiy6yhVzB5mnDoAMVzyUgp+S+8/c1BbtRJmjEVq44SGwIOsllAHAQGSOydEH321nOWuDYGSnRl3DdmgtLr2x4e1JWw3Fg5J2faUvyBOsJTtPRPMubaXzOHGiusVZ1pUJcfSgN6IXUnLYmg7uvsYQkueFg8EzPrnvKlWudNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610590354; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Subject:To; bh=hGDgOgI8/XSOFKjdfUfIFJTYsXZSv8qURm+3sJRqDQc=; b=EXupNeHsSV0dT2V6DQ8SVpPEZ7UV9sKRAYTV4/tbcMVlv2FIggXeyMakORi6tCZfu6uO3HTnaHlteCb8A4Bx7u97twSIgfTQimTBFenu+7cOpy9pvT6VVlHfWfoa8IFrv801h20EEu4SS3x0O4Ii2nvZXydPh37HRaFmkPMzaQQ= 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 1610590354918312.818331329531; Wed, 13 Jan 2021 18:12:34 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730158AbhANCMD (ORCPT ); Wed, 13 Jan 2021 21:12:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbhAMWWM (ORCPT ); Wed, 13 Jan 2021 17:22:12 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E28CC0617A3; Wed, 13 Jan 2021 14:20:25 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id n16so4415474wmc.0; Wed, 13 Jan 2021 14:20:25 -0800 (PST) Received: from localhost.localdomain (2a01cb0008bd27000d88c7723353ad1a.ipv6.abo.wanadoo.fr. [2a01:cb00:8bd:2700:d88:c772:3353:ad1a]) by smtp.gmail.com with ESMTPSA id t1sm5594929wro.27.2021.01.13.14.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 14:20:23 -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=F2pdNg88PkO4UWNhTAoj27anxGO7pus/Wu25XqLGciATAfW6hkByn8ovRSky4pWBzv MeJ4dwc1E92bk3+A9gKO7ETiuozGKGBKo1x3M568C+wDdsohztBWHq/GrerPLmHCuTLh uAyOz+VC4vb5sYUJzEinY2izUif6afTlRpQeFORZFwx7Qpx9qvI4oWpGOSHkiRgqxfgl ze85MiXAVLztiVCEHKaiVc3pHE35AxVxWBCwq5FOmPXF4SvkkpNUoCZQB0KZyge8Dfjo pFgCuaDc4DBYdoULMBEcqUodvbvsqbR8kxioAzxhTHVXu2HxJhgL4MxPEPm02qpqZMPg iFJQ== 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=KL4tzwEQ2VkWTnvbui4mjjElLzT0lkjpttc6phmJmL9DSuq5qHJwlEmjhGMQMAp9Sk UBWD9dDfNgtNHvgPz8LA0ZNH5bIxf9cBz4fbginZHNtcY2lk8A9vE8rhGnDpQjg3z1E7 qRHakUpWm8DpT5dMj5YO0G9yCo3hN9HInbkIqJbBi5UKANEa57kOrF/cNVql9FTjHprS lklngnIQ8jI3sNwoNJ5LPtj/Yo0oQXfi/c5dgDCXUEcDG+0qqDCtoV1eeD8CR7cV6xU6 kK0WFaNO5P8oduRVklMA5y9kg8+/NEFjxKWqVlxuNduxhmg2X8bpsQoIcVPfC4JHT1Gv A9RQ== X-Gm-Message-State: AOAM531ikXJgTRHwp/UMfpyvjbYyRfSMAPHHqo8qdOBQXMCOREGVzjpe kMMQOfBahWOC7qfjyzeoYXg= X-Google-Smtp-Source: ABdhPJwXoN+PFjF6m2bTRvNmTL4auskaYbJenYXLPz9wXmW6rhP6EIKQib9jXr4z/aYoTvX7y+jc8g== X-Received: by 2002:a1c:1f86:: with SMTP id f128mr1137005wmf.174.1610576424284; Wed, 13 Jan 2021 14:20:24 -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 v4 6/6] regulator: pf8x00: fix nxp,phase-shift Date: Wed, 13 Jan 2021 23:20:16 +0100 Message-Id: <20210113222016.1915993-7-adrien.grassein@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113222016.1915993-1-adrien.grassein@gmail.com> References: <20210113222016.1915993-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