Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp355790rdf; Tue, 21 Nov 2023 04:54:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaeAo4UY2BXJH9GJsqvRLZhFyW7QXy9ORWVTUawvUVOJgIUn5VC9EEiprGbh7kcnq8iynF X-Received: by 2002:a05:6870:51c6:b0:1f9:540e:aa6a with SMTP id b6-20020a05687051c600b001f9540eaa6amr4922162oaj.42.1700571292894; Tue, 21 Nov 2023 04:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700571292; cv=none; d=google.com; s=arc-20160816; b=CoA1g2dWQj8i+dCN3WF02dqJcpNeZvrrRbDWfdqkacPMTGfhCO1OjKPLytDe6VC6ar MRyhmGXglQmNTgM713e3oF6nogHGagkFW9AHmOria9J/K2q1jHP4UN/Dj+97Zg1m3fUg rhrEU4MHAbYpimORaTN21ruGiYWowF5wfWoiR4vTdju0qn24Ppqu5eNEDx7V3ovDzdcQ K8IHVr7xtldfZVDG0zQK60ViTlIL78YH7NGaaBilEdDeBdiYi5uhe65Gsc5pbgJY81bC 0L1+uSQKbGvRsxLl6XVUyciWHHDScg8js9V2KA/xd0YKdf3yuniJtfkTqIM5qLUk1/Or InOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IQLIJg24znIa486HfA91r6jHZp1ttD5Q9cgFHZ3g7XU=; fh=m5p6pcg3y47Sg5VKYWXj0f0nOzgFq4l5+GGYwGce+t4=; b=Oecq2Cp/CJs49IZdff4up890YyPgjYLN+K4BvKvrFXLR7FN4EJA4OEyt6BkPsY0Upu Mrx/q+U1CyDeqBfqftRsokrGxD4qbKh7uvRrngYGzyFDwX+p1tS0vjdEoz4uYmNQq4QV sQWNcYYN7hxWMedmfY6trjx20/+f7nR4JrNPo1VTax1BDpNSwmiEa1fc/Us0j3ClBeAx +41IxBCNAOwKfqsA0b9gCoeNJ9X4ypCLdZLBDuK5Zp1g7MA3PcWS7B7kgrK/0dhrqk7c 9Pvx2Bjexzf11Ezd9ltGQSvtXGcql0UzJLohMvciP47w6ZZ7p/Ftf2JHcO7OLG9g3KK7 DMvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JME8J0fO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q19-20020a635c13000000b005c1cc7273basi10357358pgb.257.2023.11.21.04.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 04:54:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JME8J0fO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0C8CE80AB1C1; Tue, 21 Nov 2023 04:51:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234018AbjKUMv3 (ORCPT + 99 others); Tue, 21 Nov 2023 07:51:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233865AbjKUMvO (ORCPT ); Tue, 21 Nov 2023 07:51:14 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073D7D7B; Tue, 21 Nov 2023 04:51:04 -0800 (PST) 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 madras.collabora.co.uk (Postfix) with ESMTPSA id E7F0D6607325; Tue, 21 Nov 2023 12:51:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700571063; bh=zNfya3IwOleE3gv7u+f222r6Eh2oBHfy4LgRig9Wjl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JME8J0fOzBllttmy6YP2f3UBamsismPO7cYy+ESjToe7kho7iYAUsR25Z+1uEKcm7 KE8sn6k9kq99YUINIwIybXl4NCC8KPJHC1sMS1SgspPRyMUqjWCJ4JsCEMdxEvazGl 3E0+17hF4SP9Pgo6WuYdMQj3W8NnNC7qddBmZphikoPsjgwZ6bla6gouBP3ZdMnoom 4r8/B0JZYS2FIupPHmwhvf/xfvYJfuAcesxMzeMUfAavkcocd0qAzDfUNOBw0ILJx5 5/SIUjAmJoP3xrsz4CW9iYKYMqcFM3j7Kg6DElPz6z1WpYHwpsTuvMlNLcTiDAxzsH P7ZPHcrhlUg+Q== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@collabora.com, p.zabel@pengutronix.de, 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 Subject: [PATCH v3 12/20] soc: mediatek: mtk-svs: Commonize MT8192 probe function for MT8186 Date: Tue, 21 Nov 2023 13:50:36 +0100 Message-ID: <20231121125044.78642-13-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231121125044.78642-1-angelogioacchino.delregno@collabora.com> References: <20231121125044.78642-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 04:51:48 -0800 (PST) Include the additions of svs_mt8186_platform_probe() in the common svs_mt8192_platform_probe() function, remove the former, and use the latter as .probe() callback for MT8186. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-svs.c | 44 ++++++---------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index e7df3a577b4c..cd5064683506 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -2119,7 +2119,6 @@ static struct device *svs_add_device_link(struct svs_platform *svsp, static int svs_mt8192_platform_probe(struct svs_platform *svsp) { struct device *dev; - struct svs_bank *svsb; u32 idx; svsp->rst = devm_reset_control_get_optional(svsp->dev, "svs_rst"); @@ -2133,40 +2132,7 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp) "failed to get lvts device\n"); for (idx = 0; idx < svsp->bank_max; idx++) { - svsb = &svsp->banks[idx]; - - if (svsb->type == SVSB_TYPE_HIGH) - svsb->opp_dev = svs_add_device_link(svsp, "gpu"); - else if (svsb->type == SVSB_TYPE_LOW) - svsb->opp_dev = svs_get_subsys_device(svsp, "gpu"); - - if (IS_ERR(svsb->opp_dev)) - return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev), - "failed to get OPP device for bank %d\n", - idx); - } - - return 0; -} - -static int svs_mt8186_platform_probe(struct svs_platform *svsp) -{ - struct device *dev; - struct svs_bank *svsb; - u32 idx; - - svsp->rst = devm_reset_control_get_optional(svsp->dev, "svs_rst"); - if (IS_ERR(svsp->rst)) - return dev_err_probe(svsp->dev, PTR_ERR(svsp->rst), - "cannot get svs reset control\n"); - - dev = svs_add_device_link(svsp, "thermal-sensor"); - if (IS_ERR(dev)) - return dev_err_probe(svsp->dev, PTR_ERR(dev), - "failed to get lvts device\n"); - - for (idx = 0; idx < svsp->bank_max; idx++) { - svsb = &svsp->banks[idx]; + struct svs_bank *svsb = &svsp->banks[idx]; switch (svsb->sw_id) { case SVSB_SWID_CPU_LITTLE: @@ -2177,7 +2143,11 @@ static int svs_mt8186_platform_probe(struct svs_platform *svsp) svsb->opp_dev = svs_add_device_link(svsp, "cci"); break; case SVSB_SWID_GPU: - svsb->opp_dev = svs_add_device_link(svsp, "gpu"); + if (svsb->type == SVSB_TYPE_LOW) + svsb->opp_dev = svs_get_subsys_device(svsp, "gpu"); + else + svsb->opp_dev = svs_add_device_link(svsp, "gpu"); + break; break; default: dev_err(svsb->dev, "unknown sw_id: %u\n", svsb->sw_id); @@ -2739,7 +2709,7 @@ static const struct svs_platform_data svs_mt8186_platform_data = { .name = "mt8186-svs", .banks = svs_mt8186_banks, .efuse_parsing = svs_common_parse_efuse, - .probe = svs_mt8186_platform_probe, + .probe = svs_mt8192_platform_probe, .regs = svs_regs_v2, .bank_max = ARRAY_SIZE(svs_mt8186_banks), .ts_coeff = SVSB_TS_COEFF_MT8186, -- 2.42.0