Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp427861pxu; Fri, 11 Dec 2020 05:50:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfNFn+jPuf4d0ZF6ffXIwbO7U1BqHgSeRtnBa82ytmG8LWrlul2OPGmStJSsP8ss2ny48l X-Received: by 2002:a17:906:710b:: with SMTP id x11mr11459845ejj.433.1607694655746; Fri, 11 Dec 2020 05:50:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607694655; cv=none; d=google.com; s=arc-20160816; b=iDCm5XRdKUD1kB3HG75OSCiVItrrj9lx8knZww9O6Oq+YpBD560OxHJdnTxQsPqlkR Q6Hp5KZ1alF2pjw4fwD5esgPwGoRX1efey2lXQugxoCp+mR9CvYAdclN0T041o4fwYoo RO9zOycufrfewT/2nWG8lx23AHWfjswmtQoG+tI8eZ5xqiy4OJ9l32tX5Mcxkb72MZ7x hDw/pBE8bwczvZCt+mOjLCY0sYEFKPp3wvvnvhfRam+2DL5FPS2541nLy1nHZSXjCARD nUYRo1jeYAlLdYOpIBuMjkCE015BPkhabm6Qr3heBxEy/enH5uP2LnKxEypZPxT23s3G Qy6A== 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=CpZQjz9kw+6sGumePw3LGm9EaSq2267Nb/hLDPzh5ak=; b=X527FxevsAE+ZE7YekFcL1Mx3yLn44GJrf9lWveHbLjRDkk8Hzw7/+GO/IfXUP6ENg /aTnV7Cz5wvoDhLVmDXPd67dRANKZ27CDBPYcxSoksYflNOtrZUwfqyfLWroyjdPeKch tvnnwSiibij5rB8I2kcDd/s5AGH9xPvPiE8R6xB3vozsDuvKv+fw/csyqKQBCv/c4vK9 ipPuh9m/PMxVASInbUJU91yPUe5us2LiL5cDVeri7wj2sq8OPytfLq1uI88d51pCwCmY n2aBECYLfrtrhLPJf9YnkT2Ok4fEqabi27wvpsLhwi/e5187zTtepEdxAkBwDjrfBogE lbKQ== 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 dg17si692545edb.531.2020.12.11.05.50.32; Fri, 11 Dec 2020 05:50:55 -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 S2394733AbgLKL2i (ORCPT + 99 others); Fri, 11 Dec 2020 06:28:38 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:22276 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2394409AbgLKL22 (ORCPT ); Fri, 11 Dec 2020 06:28:28 -0500 X-IronPort-AV: E=Sophos;i="5.78,411,1599490800"; d="scan'208";a="65422222" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 11 Dec 2020 20:27:56 +0900 Received: from localhost.localdomain (unknown [10.166.252.89]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 000C942D7EA1; Fri, 11 Dec 2020 20:27:55 +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 v2 04/10] regulator: bd9571mwv: Add BD9574MWF support Date: Fri, 11 Dec 2020 20:27:34 +0900 Message-Id: <1607686060-17448-5-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607686060-17448-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1607686060-17448-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 BD9574MWF doesn't support AVS and VID. Signed-off-by: Yoshihiro Shimoda --- 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 02120b0..041339b 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