Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3851566pxu; Sun, 20 Dec 2020 18:57:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxprWT6QxNmI3w93B74Dh9EhTED50t9I0bMmKXUBD3k1caWvhW1baPXdOzC17s3boXiFZF1 X-Received: by 2002:a05:6402:1748:: with SMTP id v8mr14457411edx.136.1608519471777; Sun, 20 Dec 2020 18:57:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608519471; cv=none; d=google.com; s=arc-20160816; b=GDZAA6ZcwApUJWr73Jnc/j4SplxZ7L/RMfHyvtQf8Zvze4YtGjlT4bir3G95AhLHDG 4EAh89nvyOiP+djMsT3/GGZn0HN5PZ8TryBaTCQjZWwIYLz3UE3HrlHkn98pnBdvp6ae /DJo51hDM3BeVPTH1UNsG5kI9dmbAsZc45/wssmHkTFoX16jHfkpclG/MwYotHKQfG2e Kd3Chx1wBIBGeNDzTJqYiM5kIUc1XFrqZcxUNp/36wEISGOamIDWrjpMSrEqP8uBHR6S EYCqc0WlgyG8fXddGQ4fsbHNVVacG2KTd1Adv8W7WHgf7LnHj3DK+VOPrSpkLgMYXcjL hnDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=syyvHwVGvFdSpdKob7uJefettkAPO6tscP98NOnOKL8=; b=WKz5jA1pHMwffQDrx9mz6DQS1uCrZlty2ILWFSucgUIQUXKgWIqI5DKZoXjdqqYoig rqRmat61HXVkfuvSbHcRbws2rXQcPZY1d7Odx/uPgMDA49x+qo+Q0rMrDLcwbwo5dkC1 W/X7afuW6d7rIsVB4kJS+avvbOnd+Rlp2/8+QJEIjBFtrgzNkJpRpcSgHTYXPThAp3aY k2ZGdy+KTfPKIYP1XJqTySazqkyDmwWkA09I9rJNI02ZCdB0bTgOBcJIRE7CmzDvJkXI 384zhz8JG1+09D4LnQ4B5z8QC3E5bVoJJKs6GxmbvtOLeV4YwB51mSSLpcjMCeKEittG GpUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z27si10495924edl.135.2020.12.20.18.57.29; Sun, 20 Dec 2020 18:57:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728462AbgLUCzz (ORCPT + 99 others); Sun, 20 Dec 2020 21:55:55 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:14140 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727404AbgLUCzS (ORCPT ); Sun, 20 Dec 2020 21:55:18 -0500 X-IronPort-AV: E=Sophos;i="5.78,436,1599490800"; d="scan'208";a="66626751" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 21 Dec 2020 11:54:44 +0900 Received: from localhost.localdomain (unknown [10.166.252.89]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 4DC1341BA02A; Mon, 21 Dec 2020 11:54:44 +0900 (JST) From: Yoshihiro Shimoda To: marek.vasut+renesas@gmail.com, lee.jones@linaro.org, matti.vaittinen@fi.rohmeurope.com, lgirdwood@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com Cc: khiem.nguyen.xt@renesas.com, linux-power@fi.rohmeurope.com, linux-gpio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v4 05/12] regulator: bd9571mwv: Add BD9574MWF support Date: Mon, 21 Dec 2020 11:54:32 +0900 Message-Id: <1608519279-13341-6-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608519279-13341-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1608519279-13341-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for BD9574MWF which is silimar chip with BD9571MWV. Note that we don't support voltage rails VD{09,18,25,33} by this driver on BD9574. The VD09 voltage could be read from PMIC but that is not supported by this commit. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Matti Vaittinen --- drivers/regulator/bd9571mwv-regulator.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c index 42b6a70..7b0cd08 100644 --- a/drivers/regulator/bd9571mwv-regulator.c +++ b/drivers/regulator/bd9571mwv-regulator.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * ROHM BD9571MWV-M regulator driver + * ROHM BD9571MWV-M and BD9574MWF-M regulator driver * * Copyright (C) 2017 Marek Vasut * @@ -9,6 +9,7 @@ * NOTE: VD09 is missing */ +#include #include #include #include @@ -277,6 +278,7 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev) struct regulator_dev *rdev; unsigned int val; int i; + enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL); if (!bdreg) @@ -292,6 +294,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev) config.regmap = bdreg->regmap; for (i = 0; i < ARRAY_SIZE(regulators); i++) { + /* BD9574MWF supports DVFS only */ + if (chip == ROHM_CHIP_TYPE_BD9574 && regulators[i].id != DVFS) + continue; rdev = devm_regulator_register(&pdev->dev, ®ulators[i], &config); if (IS_ERR(rdev)) { @@ -339,7 +344,8 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev) } static const struct platform_device_id bd9571mwv_regulator_id_table[] = { - { "bd9571mwv-regulator", }, + { "bd9571mwv-regulator", ROHM_CHIP_TYPE_BD9571 }, + { "bd9574mwf-regulator", ROHM_CHIP_TYPE_BD9574 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table); -- 2.7.4