Received: by 10.192.165.148 with SMTP id m20csp488687imm; Fri, 27 Apr 2018 02:27:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkQOhHJA1T88HZ1ZO0SusYsovK8NH2e0EHoY3RDspjyP4g2NlgtaydH9s2ifMia0C7E87A X-Received: by 10.98.186.26 with SMTP id k26mr1518794pff.195.1524821233537; Fri, 27 Apr 2018 02:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524821233; cv=none; d=google.com; s=arc-20160816; b=QOXkwfIAn4wvyuQJdEzzhDtJVyMibjbC+lIv7PT0Lq5k5YjVUOybD4EWnSkL69o/bk sk3nVJGaNhV9mTQIf/AIpF9INmMQNhLinfROUQP+MOd/s5IOHtgAjsTXcuLD2zofLlE0 eLauqO4OJCwTkk6ufykMepgVSDmhJA4E96kI241rgi0DmbkzHjmIvKfXLZp6ex4rlr35 qie/50JIXhYwNHZr15jx45H8t3ise2crV/kuzTBwcaXmpN/+zX6oIBf4H9x6MQau/mR0 88xQlXf6zN6L8s0dteuIi79c/ar32qx1B7qznZwIT7AhtHGAANypraMko40Lw05MxBYQ DQLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=Fq4aBtV21HR25K2Nj2rwLpjpU199amEIgcEzjpwZr88=; b=BG6S1/GF79oz2m9OvmqDAva0SYKj/GA0ydcofdPMwMhaiWOwxf3i5Rl2EiENnKlM2u cMz/6ni4E5bDSbI6htMvaIwQrhv5s/ins/tBKe7dKjiCaf2Uq1VXSPqji/ZZwSCsVaAL zICcUl5BzEn3onr+wbZGIVpCPNtMgljiNfflXYdQ/NPiCAtadnhofNy1oy2JTW0GbZeI USj5+ZwTphzgmMTwIYhqJPMKOEItBuSV6X8cj3SIEjkMG2ms+S1TCWFWT5JTsV89Ebgg u3dku5Q48QExqsdq4BfAWAunsHIEE40L9q0cmzAkJALmmK6HkmxISLWOHOS+BLyQD9NP KHVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si910018pgs.456.2018.04.27.02.26.59; Fri, 27 Apr 2018 02:27:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757781AbeD0JZh (ORCPT + 99 others); Fri, 27 Apr 2018 05:25:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:37146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932488AbeD0JY6 (ORCPT ); Fri, 27 Apr 2018 05:24:58 -0400 Received: from ziggy.de (unknown [37.223.140.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB64B2187A; Fri, 27 Apr 2018 09:24:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB64B2187A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=matthias.bgg@kernel.org From: matthias.bgg@kernel.org To: ulrich.hecht+renesas@gmail.com, laurent.pinchart@ideasonboard.com, ck.hu@mediatek.com, p.zabel@pengutronix.de, airlied@linux.ie, robh+dt@kernel.org, mark.rutland@arm.com, mturquette@baylibre.com, sboyd@codeaurora.org, lee.jones@linaro.org Cc: davem@davemloft.net, gregkh@linuxfoundation.org, mchehab@kernel.org, rdunlap@infradead.org, sean.wang@mediatek.com, linux-clk@vger.kernel.org, linux@armlinux.org.uk, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [v3 08/10] clk: mediatek: mt8173-mm: switch to mfd device Date: Fri, 27 Apr 2018 11:24:00 +0200 Message-Id: <228863cbbde4a4c682a6596343a8071119b913e7.1524820923.git.mbrugger@suse.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Brugger As the new mfd device is in place, switch probing for the MMSYS to support invocation from the mfd device. Signed-off-by: Matthias Brugger Acked-by: Stephen Boyd --- drivers/clk/mediatek/clk-mt8173.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt8173.c b/drivers/clk/mediatek/clk-mt8173.c index 96c292c3e440..e31b3ee3e968 100644 --- a/drivers/clk/mediatek/clk-mt8173.c +++ b/drivers/clk/mediatek/clk-mt8173.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "clk-mtk.h" #include "clk-gate.h" @@ -791,7 +792,7 @@ static const struct mtk_gate_regs mm1_cg_regs __initconst = { .ops = &mtk_clk_gate_ops_setclr, \ } -static const struct mtk_gate mm_clks[] __initconst = { +static const struct mtk_gate mm_clks[] = { /* MM0 */ GATE_MM0(CLK_MM_SMI_COMMON, "mm_smi_common", "mm_sel", 0), GATE_MM0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 1), @@ -1152,10 +1153,13 @@ static void __init mtk_imgsys_init(struct device_node *node) } CLK_OF_DECLARE(mtk_imgsys, "mediatek,mt8173-imgsys", mtk_imgsys_init); -static void __init mtk_mmsys_init(struct device_node *node) +static int mtk_mmsys_probe(struct platform_device *pdev) { struct clk_onecell_data *clk_data; int r; + struct device_node *node; + + node = pdev->dev.parent->of_node; clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK); @@ -1166,8 +1170,17 @@ static void __init mtk_mmsys_init(struct device_node *node) if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); + + return r; } -CLK_OF_DECLARE(mtk_mmsys, "mediatek,mt8173-mmsys", mtk_mmsys_init); + +static struct platform_driver clk_mt8173_mm_drv = { + .probe = mtk_mmsys_probe, + .driver = { + .name = "clk-mt8173-mm", + }, +}; +builtin_platform_driver(clk_mt8173_mm_drv); static void __init mtk_vdecsys_init(struct device_node *node) { -- 2.16.3