Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753687AbeABLsC (ORCPT + 1 other); Tue, 2 Jan 2018 06:48:02 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:43979 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753334AbeABLsA (ORCPT ); Tue, 2 Jan 2018 06:48:00 -0500 X-UUID: 9d6f9cbf91ce4ed2afd875e9292220b7-20180102 From: Ryder Lee To: Stephen Boyd CC: Lee Jones , Matthias Brugger , Mark Brown , , , , , , Garlic Tseng , Ryder Lee Subject: [PATCH 10/12] clk: mediatek: switch to use dev_get_regmap() for MT7622 audsys Date: Tue, 2 Jan 2018 19:47:52 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: As the new audsys wrapper driver is in place, switch to use dev_get_regmap() to obtain the regmap from its parent. This patch also add missing clock data 'CLK_AUDIO_AFE_CONN'. Signed-off-by: Ryder Lee --- drivers/clk/mediatek/clk-mt7622-aud.c | 11 +++++++++-- include/dt-bindings/clock/mt7622-clk.h | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c index fad7d9f..261e8d7 100644 --- a/drivers/clk/mediatek/clk-mt7622-aud.c +++ b/drivers/clk/mediatek/clk-mt7622-aud.c @@ -106,6 +106,7 @@ GATE_AUDIO1(CLK_AUDIO_INTDIR, "audio_intdir", "intdir_sel", 20), GATE_AUDIO1(CLK_AUDIO_A1SYS, "audio_a1sys", "a1sys_hp_sel", 21), GATE_AUDIO1(CLK_AUDIO_A2SYS, "audio_a2sys", "a2sys_hp_sel", 22), + GATE_AUDIO1(CLK_AUDIO_AFE_CONN, "audio_afe_conn", "a1sys_hp_sel", 23), /* AUDIO2 */ GATE_AUDIO2(CLK_AUDIO_UL1, "audio_ul1", "a1sys_hp_sel", 0), GATE_AUDIO2(CLK_AUDIO_UL2, "audio_ul2", "a1sys_hp_sel", 1), @@ -141,12 +142,18 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev) { struct clk_onecell_data *clk_data; struct device_node *node = pdev->dev.of_node; + struct regmap *regmap; int r; clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK); - mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks), - clk_data); + /* Obtain the regmap from parent - audsys wrapper */ + regmap = dev_get_regmap(pdev->dev.parent, NULL); + if (!regmap) + return -ENODEV; + + mtk_clk_register_num_gates(regmap, audio_clks, ARRAY_SIZE(audio_clks), + clk_data); r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r) diff --git a/include/dt-bindings/clock/mt7622-clk.h b/include/dt-bindings/clock/mt7622-clk.h index 3e514ed..e9d77f0 100644 --- a/include/dt-bindings/clock/mt7622-clk.h +++ b/include/dt-bindings/clock/mt7622-clk.h @@ -235,7 +235,8 @@ #define CLK_AUDIO_MEM_ASRC3 43 #define CLK_AUDIO_MEM_ASRC4 44 #define CLK_AUDIO_MEM_ASRC5 45 -#define CLK_AUDIO_NR_CLK 46 +#define CLK_AUDIO_AFE_CONN 46 +#define CLK_AUDIO_NR_CLK 47 /* SSUSBSYS */ -- 1.9.1