Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp226078lqp; Mon, 10 Jun 2024 01:59:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXh8FZLNIRwVpUfpX+HjMEzvlptVcf1Ej1emMrw8IXKg+p/TqakIgOdnAcBeboSXypfNCEioKhW94/CwwVGYcUUSfX/bHDGzFDY9MF+EA== X-Google-Smtp-Source: AGHT+IE23jge/6po3OAl4KZW0bcnQ+NcXIc9DXHTI9g8Qr2Taen6QXxJ+5IZh1K5i1jA2mMFy1zh X-Received: by 2002:a05:6a00:230b:b0:705:9cf6:bc21 with SMTP id d2e1a72fcca58-7059cf6fa8bmr922415b3a.12.1718009944421; Mon, 10 Jun 2024 01:59:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718009944; cv=pass; d=google.com; s=arc-20160816; b=j8Xf7RXeLKQKrYJU5ifaLhk4QXNL3lEL4QZILiEoYVruM7qUPIwb8fA7zSwRebsH6r 0q0riBhkggohoCn8xvjef33jw3TUhR+JLhfhrx4jZg/B8G/XeNG+Tl6vFt/fgiP1xq5y fqlvLT0u9EvASrWusyR5FoGerYh9BlF3swWVjpjDPXlGfXC9njPffMSVa9NvqgsfhEd4 Yiw8e6zCU6O+iygodiN0KI4PFV84CR1hoDdpyhw5ReYQE9Oqbl2HqjTAMuNjWpvQhs2T enMeVnDtTNz2swKRRhyPYOMXWWcYueMVgBektNlcC0WLys6I+lJDMTUf/8KNf6NR9ZoG WaHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9I/1rpa9clFd48AL3y94fckymIoL+qf5MZTXba3ZwM4=; fh=6vVbg1oy9ZYq1MXwOGMMFhribCwVPwV59XseO9BPFU8=; b=tnKhZ5jwFsWBqRBHcLzlK9sb3gFoQZJCJCUqJHQ3M9HdeX7lIxvGZnK9cDgi07gEEo EJJe5AMAF1E/adUKSH6FADwIFiB7dwnVpN0ZggcMdgt1Py6fBPoe/IPKvpqEBhG85MvV VEGRlH9Z8lwnl1aFNQrpbJ0iYnvHR49fY0cvGlkdKHIxkgHVk8t6+ppcre/ulw3J/yuE 0IyzECLQ3pTh/YiItMZQNHtEmRdwOvDyKHbRi1mdN9kIjemLA07hymY4yRKLpSyGQCMn 4hHliVO7/UMiTquIZrCcrcBC7uw1vtXz2RG4X1B9vpyydjsrB86Byok8/6ckjgpLmeJV r5bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jc13GxRD; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-207885-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e40a05d9f6si5000690a12.39.2024.06.10.01.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:59:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207885-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jc13GxRD; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-207885-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1510CB20F0B for ; Mon, 10 Jun 2024 08:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFCBD7711B; Mon, 10 Jun 2024 08:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jc13GxRD" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 044587605E; Mon, 10 Jun 2024 08:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009870; cv=none; b=ltCrYlsAR3QVAFjoyYfgd2JxTcErEadKalOMVTMicuKZpSDKCvWYYExSCJ5U45I6wkg/+kUciineJT1f+KPkSodT5/GFfxc6qSfb03iMV9FnrzOo8yTkVRoRsZXlvH88cxovYEtMNqjzI94ekMwbMKopxlFHbTsnr9Ml3YUmHh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009870; c=relaxed/simple; bh=8uvOl5I2zPMMK0dULzTroFDA7do8i2bc+KsttAh5P1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IYR4NNRcRYaCnOj/4ZhCsQJmIppIYQaNbwLmq1B0cKtJ1SJ2pgJXIOPE26q5+9QI5+2+bP3V77rtYuI52S5F6nCOmyKCdSVewnnFc7OxaOc3qPjHJ1eHwlQ7AL4X3bGsQHsc9NV/bYRfvQCoDEuKGX+6o1lUS8XFm66nJNVmJpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=jc13GxRD; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718009867; bh=8uvOl5I2zPMMK0dULzTroFDA7do8i2bc+KsttAh5P1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jc13GxRD4v1VEqRtxdL+gOHeLPIxMM8R5h6YDY0uJPq06mMBOgqX1t8+F1CQwDDPx xhgznvwRZn6aaNqBz9mLUOePA4SBNeq0tvh9ikMcijMSWrO4SlkwHRSLP+oa3SHejG NM5OnmHu0LcDazLTSLeC79LtGUhk3AiYDx/7WXIlYGEZSTXW1YWyHvu6PgEI3g1xGt wZdmlc8gWqLCWA3lJce7/PDUeslmXjj6+64HKJniMWVsrEFQEufAJrtdrBEfFplprV vkMK08T5DRl2HRKwo3ghl2d/tHvAbEMutSXbahH5Ph2iYUPDXa7xh8IVL7fKYJFkPq 6QPPtt1eDxaMA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2C1D2378217B; Mon, 10 Jun 2024 08:57:46 +0000 (UTC) From: AngeloGioacchino Del Regno To: djakov@kernel.org Cc: robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, lgirdwood@gmail.com, broonie@kernel.org, keescook@chromium.org, gustavoars@kernel.org, henryc.chen@mediatek.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, wenst@chromium.org, amergnat@baylibre.com Subject: [PATCH v6 5/7] regulator: Remove mtk-dvfsrc-regulator.c Date: Mon, 10 Jun 2024 10:57:33 +0200 Message-ID: <20240610085735.147134-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240610085735.147134-1-angelogioacchino.delregno@collabora.com> References: <20240610085735.147134-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This driver never worked, and never got even compiled, because it was missing the DVFSRC driver entirely, including headers it relies on! In preparation of a full refactoring of this driver, remove it. The Makefile and Kconfig entries are retained, as those are reused as-is for the refactored code. Acked-by: Mark Brown Signed-off-by: AngeloGioacchino Del Regno --- drivers/regulator/mtk-dvfsrc-regulator.c | 214 ----------------------- 1 file changed, 214 deletions(-) delete mode 100644 drivers/regulator/mtk-dvfsrc-regulator.c diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c deleted file mode 100644 index f1280d45265d..000000000000 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ /dev/null @@ -1,214 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// -// Copyright (c) 2020 MediaTek Inc. - -#include -#include -#include -#include -#include -#include -#include -#include - -#define DVFSRC_ID_VCORE 0 -#define DVFSRC_ID_VSCP 1 - -#define MT_DVFSRC_REGULAR(match, _name, _volt_table) \ -[DVFSRC_ID_##_name] = { \ - .desc = { \ - .name = match, \ - .of_match = of_match_ptr(match), \ - .ops = &dvfsrc_vcore_ops, \ - .type = REGULATOR_VOLTAGE, \ - .id = DVFSRC_ID_##_name, \ - .owner = THIS_MODULE, \ - .n_voltages = ARRAY_SIZE(_volt_table), \ - .volt_table = _volt_table, \ - }, \ -} - -/* - * DVFSRC regulators' information - * - * @desc: standard fields of regulator description. - * @voltage_selector: Selector used for get_voltage_sel() and - * set_voltage_sel() callbacks - */ - -struct dvfsrc_regulator { - struct regulator_desc desc; -}; - -/* - * MTK DVFSRC regulators' init data - * - * @size: num of regulators - * @regulator_info: regulator info. - */ -struct dvfsrc_regulator_init_data { - u32 size; - struct dvfsrc_regulator *regulator_info; -}; - -static inline struct device *to_dvfsrc_dev(struct regulator_dev *rdev) -{ - return rdev_get_dev(rdev)->parent; -} - -static int dvfsrc_set_voltage_sel(struct regulator_dev *rdev, - unsigned int selector) -{ - struct device *dvfsrc_dev = to_dvfsrc_dev(rdev); - int id = rdev_get_id(rdev); - - if (id == DVFSRC_ID_VCORE) - mtk_dvfsrc_send_request(dvfsrc_dev, - MTK_DVFSRC_CMD_VCORE_REQUEST, - selector); - else if (id == DVFSRC_ID_VSCP) - mtk_dvfsrc_send_request(dvfsrc_dev, - MTK_DVFSRC_CMD_VSCP_REQUEST, - selector); - else - return -EINVAL; - - return 0; -} - -static int dvfsrc_get_voltage_sel(struct regulator_dev *rdev) -{ - struct device *dvfsrc_dev = to_dvfsrc_dev(rdev); - int id = rdev_get_id(rdev); - int val, ret; - - if (id == DVFSRC_ID_VCORE) - ret = mtk_dvfsrc_query_info(dvfsrc_dev, - MTK_DVFSRC_CMD_VCORE_LEVEL_QUERY, - &val); - else if (id == DVFSRC_ID_VSCP) - ret = mtk_dvfsrc_query_info(dvfsrc_dev, - MTK_DVFSRC_CMD_VSCP_LEVEL_QUERY, - &val); - else - return -EINVAL; - - if (ret != 0) - return ret; - - return val; -} - -static const struct regulator_ops dvfsrc_vcore_ops = { - .list_voltage = regulator_list_voltage_table, - .get_voltage_sel = dvfsrc_get_voltage_sel, - .set_voltage_sel = dvfsrc_set_voltage_sel, -}; - -static const unsigned int mt8183_voltages[] = { - 725000, - 800000, -}; - -static struct dvfsrc_regulator mt8183_regulators[] = { - MT_DVFSRC_REGULAR("dvfsrc-vcore", VCORE, - mt8183_voltages), -}; - -static const struct dvfsrc_regulator_init_data regulator_mt8183_data = { - .size = ARRAY_SIZE(mt8183_regulators), - .regulator_info = &mt8183_regulators[0], -}; - -static const unsigned int mt6873_voltages[] = { - 575000, - 600000, - 650000, - 725000, -}; - -static struct dvfsrc_regulator mt6873_regulators[] = { - MT_DVFSRC_REGULAR("dvfsrc-vcore", VCORE, - mt6873_voltages), - MT_DVFSRC_REGULAR("dvfsrc-vscp", VSCP, - mt6873_voltages), -}; - -static const struct dvfsrc_regulator_init_data regulator_mt6873_data = { - .size = ARRAY_SIZE(mt6873_regulators), - .regulator_info = &mt6873_regulators[0], -}; - -static const struct of_device_id mtk_dvfsrc_regulator_match[] = { - { - .compatible = "mediatek,mt8183-dvfsrc", - .data = ®ulator_mt8183_data, - }, { - .compatible = "mediatek,mt8192-dvfsrc", - .data = ®ulator_mt6873_data, - }, { - .compatible = "mediatek,mt6873-dvfsrc", - .data = ®ulator_mt6873_data, - }, { - /* sentinel */ - }, -}; -MODULE_DEVICE_TABLE(of, mtk_dvfsrc_regulator_match); - -static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) -{ - const struct of_device_id *match; - struct device *dev = &pdev->dev; - struct regulator_config config = { }; - struct regulator_dev *rdev; - const struct dvfsrc_regulator_init_data *regulator_init_data; - struct dvfsrc_regulator *mt_regulators; - int i; - - match = of_match_node(mtk_dvfsrc_regulator_match, dev->parent->of_node); - - if (!match) { - dev_err(dev, "invalid compatible string\n"); - return -ENODEV; - } - - regulator_init_data = match->data; - - mt_regulators = regulator_init_data->regulator_info; - for (i = 0; i < regulator_init_data->size; i++) { - config.dev = dev->parent; - config.driver_data = (mt_regulators + i); - rdev = devm_regulator_register(dev, &(mt_regulators + i)->desc, - &config); - if (IS_ERR(rdev)) { - dev_err(dev, "failed to register %s\n", - (mt_regulators + i)->desc.name); - return PTR_ERR(rdev); - } - } - - return 0; -} - -static struct platform_driver mtk_dvfsrc_regulator_driver = { - .driver = { - .name = "mtk-dvfsrc-regulator", - .probe_type = PROBE_PREFER_ASYNCHRONOUS, - }, - .probe = dvfsrc_vcore_regulator_probe, -}; - -static int __init mtk_dvfsrc_regulator_init(void) -{ - return platform_driver_register(&mtk_dvfsrc_regulator_driver); -} -subsys_initcall(mtk_dvfsrc_regulator_init); - -static void __exit mtk_dvfsrc_regulator_exit(void) -{ - platform_driver_unregister(&mtk_dvfsrc_regulator_driver); -} -module_exit(mtk_dvfsrc_regulator_exit); - -MODULE_AUTHOR("Arvin wang "); -MODULE_LICENSE("GPL v2"); -- 2.45.2