From patchwork Tue May 25 10:14:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 448675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16CC1C47086 for ; Tue, 25 May 2021 10:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B7E561417 for ; Tue, 25 May 2021 10:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230418AbhEYKQd (ORCPT ); Tue, 25 May 2021 06:16:33 -0400 Received: from mail-lj1-f171.google.com ([209.85.208.171]:37480 "EHLO mail-lj1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbhEYKQa (ORCPT ); Tue, 25 May 2021 06:16:30 -0400 Received: by mail-lj1-f171.google.com with SMTP id e2so31045896ljk.4; Tue, 25 May 2021 03:14:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=X3Flqbk9N3dsqYLyk7c8Z+BERCBUoCwwVjTZG6SrE5g=; b=knJ8AzM7va+2emGjrsf9F3lhgdH74bmDkAIatQQDR3uTpzfkcsYli3U5MmvOSpfcjt AHUpkyVpxoclEcwn+KjjyHWdYvnLO1UfUBsnDCXrn+xdmtoeumusQzx7ZBOQht0gyth1 xD9mRjZg1sQcpKAVMrBF6+DOkqXyaBRBRc95/FS+wwgdVSf5QS9leoxyZNI9ogzyqeXm 5d9IKROM7z0/Dw+3U6quQgU///uPbsVK3778u9q1qaCP1x/1CKgc/4e+96vUFeRaZKhA BOOqSrnx5mzOuNBqSX4kmwqs8IFdT9o1xrEx7STgzd00GK3JqAGZzFiD3H7qPFKILBBu qhHA== X-Gm-Message-State: AOAM531u4c4QyWtWx+iQEJnjl0TpW1sKG6PiEVLs+0QrkU5uCt+4UmF2 MCN4VhPxFV9/sxRp859k1eY= X-Google-Smtp-Source: ABdhPJxClozAvfEvrjZBBBjFLXf3qSGrm14mTl1CaV3bTbYFSHrbE+uh8KjlfDkPmRC53djnV0f4OQ== X-Received: by 2002:a2e:9708:: with SMTP id r8mr20085753lji.126.1621937698514; Tue, 25 May 2021 03:14:58 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyycy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::4]) by smtp.gmail.com with ESMTPSA id b6sm1690762lfb.114.2021.05.25.03.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:14:57 -0700 (PDT) Date: Tue, 25 May 2021 13:14:51 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Lee Jones , Rob Herring , Liam Girdwood , Mark Brown , Michael Turquette , Stephen Boyd , Matti Vaittinen , Linus Walleij , Bartosz Golaszewski , Sebastian Reichel , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-power@fi.rohmeurope.com, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: [PATCH 4/9] regulator: bd70528: Drop BD70528 support Message-ID: <6b1668099cde29bc6fa958773a1a311df54ab236.1621937490.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The only known BD70528 use-cases are such that the PMIC is controlled from separate MCU which is not running Linux. I am not aware of any Linux driver users. Furthermore, it seems there is no demand for this IC. Let's ease the maintenance burden and drop the driver. We can always add it back if there is sudden need for it. Signed-off-by: Matti Vaittinen --- Please let me know if some of you think the driver is needed. --- drivers/regulator/Kconfig | 11 - drivers/regulator/Makefile | 1 - drivers/regulator/bd70528-regulator.c | 283 -------------------------- 3 files changed, 295 deletions(-) delete mode 100644 drivers/regulator/bd70528-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 9d84d9245490..ebbd9e6207df 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -193,17 +193,6 @@ config REGULATOR_BCM590XX BCM590xx PMUs. This will enable support for the software controllable LDO/Switching regulators. -config REGULATOR_BD70528 - tristate "ROHM BD70528 Power Regulator" - depends on MFD_ROHM_BD70528 - help - This driver supports voltage regulators on ROHM BD70528 PMIC. - This will enable support for the software controllable buck - and LDO regulators. - - This driver can also be built as a module. If so, the module - will be called bd70528-regulator. - config REGULATOR_BD71815 tristate "ROHM BD71815 Power Regulator" depends on MFD_ROHM_BD71828 diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 580b015296ea..6a5d55e209d3 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -29,7 +29,6 @@ obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o obj-$(CONFIG_REGULATOR_ATC260X) += atc260x-regulator.o obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o -obj-$(CONFIG_REGULATOR_BD70528) += bd70528-regulator.o obj-$(CONFIG_REGULATOR_BD71815) += bd71815-regulator.o obj-$(CONFIG_REGULATOR_BD71828) += bd71828-regulator.o obj-$(CONFIG_REGULATOR_BD718XX) += bd718x7-regulator.o diff --git a/drivers/regulator/bd70528-regulator.c b/drivers/regulator/bd70528-regulator.c deleted file mode 100644 index 1f5f9482b209..000000000000 --- a/drivers/regulator/bd70528-regulator.c +++ /dev/null @@ -1,283 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// Copyright (C) 2018 ROHM Semiconductors -// bd70528-regulator.c ROHM BD70528MWV regulator driver - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BUCK_RAMPRATE_250MV 0 -#define BUCK_RAMPRATE_125MV 1 -#define BUCK_RAMP_MAX 250 - -static const struct linear_range bd70528_buck1_volts[] = { - REGULATOR_LINEAR_RANGE(1200000, 0x00, 0x1, 600000), - REGULATOR_LINEAR_RANGE(2750000, 0x2, 0xf, 50000), -}; -static const struct linear_range bd70528_buck2_volts[] = { - REGULATOR_LINEAR_RANGE(1200000, 0x00, 0x1, 300000), - REGULATOR_LINEAR_RANGE(1550000, 0x2, 0xd, 50000), - REGULATOR_LINEAR_RANGE(3000000, 0xe, 0xf, 300000), -}; -static const struct linear_range bd70528_buck3_volts[] = { - REGULATOR_LINEAR_RANGE(800000, 0x00, 0xd, 50000), - REGULATOR_LINEAR_RANGE(1800000, 0xe, 0xf, 0), -}; - -/* All LDOs have same voltage ranges */ -static const struct linear_range bd70528_ldo_volts[] = { - REGULATOR_LINEAR_RANGE(1650000, 0x0, 0x07, 50000), - REGULATOR_LINEAR_RANGE(2100000, 0x8, 0x0f, 100000), - REGULATOR_LINEAR_RANGE(2850000, 0x10, 0x19, 50000), - REGULATOR_LINEAR_RANGE(3300000, 0x19, 0x1f, 0), -}; - -/* Also both LEDs support same voltages */ -static const unsigned int led_volts[] = { - 20000, 30000 -}; - -static int bd70528_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) -{ - if (ramp_delay > 0 && ramp_delay <= BUCK_RAMP_MAX) { - unsigned int ramp_value = BUCK_RAMPRATE_250MV; - - if (ramp_delay <= 125) - ramp_value = BUCK_RAMPRATE_125MV; - - return regmap_update_bits(rdev->regmap, rdev->desc->vsel_reg, - BD70528_MASK_BUCK_RAMP, - ramp_value << BD70528_SIFT_BUCK_RAMP); - } - dev_err(&rdev->dev, "%s: ramp_delay: %d not supported\n", - rdev->desc->name, ramp_delay); - return -EINVAL; -} - -static int bd70528_led_set_voltage_sel(struct regulator_dev *rdev, - unsigned int sel) -{ - int ret; - - ret = regulator_is_enabled_regmap(rdev); - if (ret < 0) - return ret; - - if (ret == 0) - return regulator_set_voltage_sel_regmap(rdev, sel); - - dev_err(&rdev->dev, - "LED voltage change not allowed when led is enabled\n"); - - return -EBUSY; -} - -static const struct regulator_ops bd70528_buck_ops = { - .enable = regulator_enable_regmap, - .disable = regulator_disable_regmap, - .is_enabled = regulator_is_enabled_regmap, - .list_voltage = regulator_list_voltage_linear_range, - .set_voltage_sel = regulator_set_voltage_sel_regmap, - .get_voltage_sel = regulator_get_voltage_sel_regmap, - .set_voltage_time_sel = regulator_set_voltage_time_sel, - .set_ramp_delay = bd70528_set_ramp_delay, -}; - -static const struct regulator_ops bd70528_ldo_ops = { - .enable = regulator_enable_regmap, - .disable = regulator_disable_regmap, - .is_enabled = regulator_is_enabled_regmap, - .list_voltage = regulator_list_voltage_linear_range, - .set_voltage_sel = regulator_set_voltage_sel_regmap, - .get_voltage_sel = regulator_get_voltage_sel_regmap, - .set_voltage_time_sel = regulator_set_voltage_time_sel, -}; - -static const struct regulator_ops bd70528_led_ops = { - .enable = regulator_enable_regmap, - .disable = regulator_disable_regmap, - .is_enabled = regulator_is_enabled_regmap, - .list_voltage = regulator_list_voltage_table, - .set_voltage_sel = bd70528_led_set_voltage_sel, - .get_voltage_sel = regulator_get_voltage_sel_regmap, -}; - -static const struct regulator_desc bd70528_desc[] = { - { - .name = "buck1", - .of_match = of_match_ptr("BUCK1"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_BUCK1, - .ops = &bd70528_buck_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_buck1_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_buck1_volts), - .n_voltages = BD70528_BUCK_VOLTS, - .enable_reg = BD70528_REG_BUCK1_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_BUCK1_VOLT, - .vsel_mask = BD70528_MASK_BUCK_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "buck2", - .of_match = of_match_ptr("BUCK2"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_BUCK2, - .ops = &bd70528_buck_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_buck2_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_buck2_volts), - .n_voltages = BD70528_BUCK_VOLTS, - .enable_reg = BD70528_REG_BUCK2_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_BUCK2_VOLT, - .vsel_mask = BD70528_MASK_BUCK_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "buck3", - .of_match = of_match_ptr("BUCK3"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_BUCK3, - .ops = &bd70528_buck_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_buck3_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_buck3_volts), - .n_voltages = BD70528_BUCK_VOLTS, - .enable_reg = BD70528_REG_BUCK3_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_BUCK3_VOLT, - .vsel_mask = BD70528_MASK_BUCK_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "ldo1", - .of_match = of_match_ptr("LDO1"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_LDO1, - .ops = &bd70528_ldo_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_ldo_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_ldo_volts), - .n_voltages = BD70528_LDO_VOLTS, - .enable_reg = BD70528_REG_LDO1_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_LDO1_VOLT, - .vsel_mask = BD70528_MASK_LDO_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "ldo2", - .of_match = of_match_ptr("LDO2"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_LDO2, - .ops = &bd70528_ldo_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_ldo_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_ldo_volts), - .n_voltages = BD70528_LDO_VOLTS, - .enable_reg = BD70528_REG_LDO2_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_LDO2_VOLT, - .vsel_mask = BD70528_MASK_LDO_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "ldo3", - .of_match = of_match_ptr("LDO3"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_LDO3, - .ops = &bd70528_ldo_ops, - .type = REGULATOR_VOLTAGE, - .linear_ranges = bd70528_ldo_volts, - .n_linear_ranges = ARRAY_SIZE(bd70528_ldo_volts), - .n_voltages = BD70528_LDO_VOLTS, - .enable_reg = BD70528_REG_LDO3_EN, - .enable_mask = BD70528_MASK_RUN_EN, - .vsel_reg = BD70528_REG_LDO3_VOLT, - .vsel_mask = BD70528_MASK_LDO_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "ldo_led1", - .of_match = of_match_ptr("LDO_LED1"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_LED1, - .ops = &bd70528_led_ops, - .type = REGULATOR_VOLTAGE, - .volt_table = &led_volts[0], - .n_voltages = ARRAY_SIZE(led_volts), - .enable_reg = BD70528_REG_LED_EN, - .enable_mask = BD70528_MASK_LED1_EN, - .vsel_reg = BD70528_REG_LED_VOLT, - .vsel_mask = BD70528_MASK_LED1_VOLT, - .owner = THIS_MODULE, - }, - { - .name = "ldo_led2", - .of_match = of_match_ptr("LDO_LED2"), - .regulators_node = of_match_ptr("regulators"), - .id = BD70528_LED2, - .ops = &bd70528_led_ops, - .type = REGULATOR_VOLTAGE, - .volt_table = &led_volts[0], - .n_voltages = ARRAY_SIZE(led_volts), - .enable_reg = BD70528_REG_LED_EN, - .enable_mask = BD70528_MASK_LED2_EN, - .vsel_reg = BD70528_REG_LED_VOLT, - .vsel_mask = BD70528_MASK_LED2_VOLT, - .owner = THIS_MODULE, - }, - -}; - -static int bd70528_probe(struct platform_device *pdev) -{ - int i; - struct regulator_config config = { - .dev = pdev->dev.parent, - }; - - config.regmap = dev_get_regmap(pdev->dev.parent, NULL); - if (!config.regmap) - return -ENODEV; - - for (i = 0; i < ARRAY_SIZE(bd70528_desc); i++) { - struct regulator_dev *rdev; - - rdev = devm_regulator_register(&pdev->dev, &bd70528_desc[i], - &config); - if (IS_ERR(rdev)) { - dev_err(&pdev->dev, - "failed to register %s regulator\n", - bd70528_desc[i].name); - return PTR_ERR(rdev); - } - } - return 0; -} - -static struct platform_driver bd70528_regulator = { - .driver = { - .name = "bd70528-pmic" - }, - .probe = bd70528_probe, -}; - -module_platform_driver(bd70528_regulator); - -MODULE_AUTHOR("Matti Vaittinen "); -MODULE_DESCRIPTION("BD70528 voltage regulator driver"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:bd70528-pmic");