From patchwork Tue Nov 14 21:41:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 10058993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 356D26023A for ; Wed, 15 Nov 2017 08:32:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2277429E3A for ; Wed, 15 Nov 2017 08:32:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1577E29E3C; Wed, 15 Nov 2017 08:32:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE7EE29E3A for ; Wed, 15 Nov 2017 08:32:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4DC86E3B2; Wed, 15 Nov 2017 08:31:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C0CD6E31F for ; Tue, 14 Nov 2017 21:42:08 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id n74so19504568wmi.1 for ; Tue, 14 Nov 2017 13:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6JFc/KCAl23Da1FBP9IHFdntxmJMMqtIES3DtJj74m8=; b=G8pxrCbniIaFHDomFltuj7gzXJo7D8Qt1ENHjWbOTnE+J6PYR3oHgZJ4GyN4528a3c bkBgrcJSz8uH7H6wXmNgu8n9VL8sDm47uK2VTgfHw8NhHEn4armEOPl2pop4V59bppEZ hMYklw6Xh5uqzFQZ3hRVhB2Jw7H2ULQPiNMEcxncefhX9yeR9wdLaJhJIanPrwheL8lY wASyp6cX4eHTJM6fNQ27edsfvJKwP1+5RLV9l60P+192CDEteOr4WFnXVbaq1T/Kp/W5 VK/0NCEHRzn1FwUffIo5TFfFaWmoGHvjr0CQBOsKYAWmjEH2LNcfcz7HZlMoVeixudgw iCrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6JFc/KCAl23Da1FBP9IHFdntxmJMMqtIES3DtJj74m8=; b=qmMTwoAXAd2wEaKgGLUNS7Sn0wB9/mC4lL1ZCNJt8MKxNSX0qKUYe+29teylWVWKwk XB9IRAzvAR7YbZ7gvNPPR+uQL/+MRZcMYudxp0rJ9ZRB4kBAgX3rLnLEJiAQR4mqzml4 lAlOzemVUN3xeWoZV17SEtkGeul2GRCPnFAiDLDNWIhF1K+zLpFJ47Ew9H9URzCOHJWU yog2zxnk0wwzBuwSWhHfW/HAQoDIT4AaDdFU518pzJpEEOs5pFLv/154Vck8HVmreAXh L6le1OZVuWwi+pJ08v9jS992qEQAYLbLR/WOi12E+79obp5a6KAmCi9C2hwAqpIMMEjx 4lSQ== X-Gm-Message-State: AJaThX76p0I9C7fEuDW3yQp/4rCZKccRa6XMr4thlmcabxn5nn3Ht/Zw tSpIwA7WiHlxaAHLNtQ5vbA= X-Google-Smtp-Source: AGs4zMYg7jQIjS87inWet7rgXqBOO/PmZ5ujST9UAieMKrkX7XPTfhTyR8re2pW66Qm15B8aAJt3FQ== X-Received: by 10.28.94.144 with SMTP id s138mr9167947wmb.0.1510695727073; Tue, 14 Nov 2017 13:42:07 -0800 (PST) Received: from localhost.localdomain ([92.57.80.122]) by smtp.gmail.com with ESMTPSA id s12sm46706369wrc.89.2017.11.14.13.42.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 13:42:06 -0800 (PST) From: Matthias Brugger X-Google-Original-From: Matthias Brugger 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 Subject: [PATCH 7/8] clk: mediatek: mt8173-mm: switch to mfd device Date: Tue, 14 Nov 2017 22:41:13 +0100 Message-Id: <20171114214114.15793-8-mbrugger@suse.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171114214114.15793-1-mbrugger@suse.com> References: <20171114214114.15793-1-mbrugger@suse.com> X-Mailman-Approved-At: Wed, 15 Nov 2017 08:31:51 +0000 Cc: sean.wang@mediatek.com, gregkh@linuxfoundation.org, rdunlap@infradead.org, linux@armlinux.org.uk, dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org, Matthias Brugger , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com, mchehab@kernel.org, pi-cheng.chen@linaro.org, davem@davemloft.net, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/clk/mediatek/clk-mt8173.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt8173.c b/drivers/clk/mediatek/clk-mt8173.c index 96c292c3e440..0fd39228eef4 100644 --- a/drivers/clk/mediatek/clk-mt8173.c +++ b/drivers/clk/mediatek/clk-mt8173.c @@ -13,8 +13,10 @@ */ #include +#include #include #include +#include #include "clk-mtk.h" #include "clk-gate.h" @@ -1152,10 +1154,16 @@ 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; + struct mmsys_dev *mmsys_private; + + mmsys_private = dev_get_drvdata(pdev->dev.parent); + node = mmsys_private->of_node; + clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK); @@ -1166,8 +1174,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) {