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: 10058387 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 2C85D601D3 for ; Tue, 14 Nov 2017 21:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C64F286B8 for ; Tue, 14 Nov 2017 21:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FB0A29AA0; Tue, 14 Nov 2017 21:44:51 +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.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C4C0286B8 for ; Tue, 14 Nov 2017 21:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aeN1DMLvP0LFSv2LIGLUPForAWx63v1zbWAQxSmHPvE=; b=cY03cKBuJZTFqQmVo5oqaA/hSH rHKGuhYxs1e/mCoGurmm2ZZBifz5j0jxMCLlV6zBe3pOH3LnoKlQO0EdkHBm1qVPHPMMYfB7wrNzM 463P9D/uyuKg72hnaCw9TpThwKmdKMcVndwicEYEbhbfT/Kw4J8FUo1vOcQZar/IkOBSE6PHsSKbq sHZ4O8WXHVdZofsilNz1VArwztErLJhujgbflPbolHdXrZ5gOmeavOxSL8tQtTQI5QFd6PNjayWev +cwfuXuGubr+cjImZ/CRUP7WBo3X3Jlxhsbxo3Usu2Kusg7RVeuA0T+U3nIjaXVJ+nMeKe2dqLmLI iRhod8VA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eEj0k-0001aa-3f; Tue, 14 Nov 2017 21:44:50 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEiyQ-0007xA-8p; Tue, 14 Nov 2017 21:42:37 +0000 Received: by mail-wm0-x241.google.com with SMTP id r68so19583116wmr.0; 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=ksRk+BND35xFiW0FwMZK8NeGstkwYZe4Aa27G2xldIBvxno+OoU7FO15bLnHm9S6GV PYTBdrkLnctV71+UfCJUsmLorco5YQd6FlrK7fcyIjmQ2JZGgLzEkSSMHjtecEqBSNEL bR/EIyTodnJPbwu+EaFJ0+wAboK56SdbKMcrdz8vOUmFELJ+BfX/grQ7+mTDMETTMWhs 2dnYzuQ/ZyAlpBTKSViSUYbsFQslROOsC/oOLhcoFBAIr5534nEzthwSCbTEkVaL8Iiz 0lSpfKvLdXT5z2JNOIV84Ki/tMC5Ufl7CwpX2i1cXMjCPAlA/AX8vS6Ifq+19rUQVZV0 ZKrg== X-Gm-Message-State: AJaThX519+VxOirJ8DbrO3f+mBIWh2Bppg81mtmdiHWX4GSvQI00zLdg F5Ea2cZ/UWJd4ZENPUPRedo= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171114_134227_280931_F9145951 X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Acked-by: Stephen Boyd --- 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) {