Received: by 10.192.165.148 with SMTP id m20csp4997667imm; Tue, 24 Apr 2018 11:53:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48P2LpCPOiqf2+8RTNMSJZ3D7g7mFiGbq4oLFDZWTZv8S/cM5uQBkUpIvs77UROyRje3oU3 X-Received: by 10.98.231.21 with SMTP id s21mr20506667pfh.227.1524595980062; Tue, 24 Apr 2018 11:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524595980; cv=none; d=google.com; s=arc-20160816; b=ch6jWKGYCxlh8kyyc/VqyenB8XbswOeqEyXPA/lFr1jtm13wG3vbVVfy5cpVsM+fvf p1IYNFZisZGlAg/KOha5iSr7iEuxbF9BpFPGZDUzDF9ypxnCtyvHXgz6huby2uOJ8gA9 fldXstGkqd84kF6ziiRiOSFb+dXSO9Wq2WBC1iLAf+4VIznNHmOz3QTHRwcsLH5GbWkQ h5FpxAzT8PK1EP4Dw/6X9CVnvbpCkIOqqwQH3Eb251//wea1ITs1CShDUU8Ok5ob2fED 3n5p813J1ZOlGMb9eWs2K0qhr3OlL5PxekuhoBnZXC5Ey+6LCIAjB2o9ZiruFDKHbRZa Scng== 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:message-id:date :subject:cc:to:from:arc-authentication-results; bh=DVo94oUPoc0n5ft/ftYYnX5hE/TSe1SqO08Dsg5sZrM=; b=J1ESxQwdc+PKGeye2aGfG1MbG9vtOPzbk6Dt8OxZAAfReMHIVP3oUMkNjKlCJYxNpa qfovfQyB3JvYiReNijrb461jRROpVIVEm3p5DMwVhRdNwowB6Ykv1MunxCyBofTVjstA PsDhQ1U/LUCfMvs6S1GU8SgyeStrXPglKyjliEvXMWY9aymbmOyZsH+NtxmViswWNZwR JsYqQhl+8Mkk8s9JPDzNoOGBJblwPBGjep1uWUPyNDWLk3qkkdyT3Kgbj4lHUVTkLzz3 Hp/lFI7tno4Cr306G948zLXwgvT/cVPTiNOsTenc5yKaLE5Db0aU32wFZWIpWH32zrt+ OeqQ== 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 j11si874604pgq.347.2018.04.24.11.52.45; Tue, 24 Apr 2018 11:53:00 -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 S1752625AbeDXSvJ (ORCPT + 99 others); Tue, 24 Apr 2018 14:51:09 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:53250 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752074AbeDXSuf (ORCPT ); Tue, 24 Apr 2018 14:50:35 -0400 Received: from localhost.localdomain ([81.67.76.113]) by mwinf5d70 with ME id eJq31x00P2Sg6Vd03Jqa2a; Tue, 24 Apr 2018 20:50:34 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: bWF4aS5qb3VyZGFuQHdhbmFkb28uZnI= X-ME-Date: Tue, 24 Apr 2018 20:50:34 +0200 X-ME-IP: 81.67.76.113 From: Maxime Jourdan To: Neil Armstrong , Jerome Brunet , Kevin Hilman Cc: Mike Turquette , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Maxime Jourdan Subject: [PATCH v2 2/2] clk: meson: gxbb: add the video decoder clocks Date: Tue, 24 Apr 2018 20:48:38 +0200 Message-Id: <20180424184838.3406-3-maxi.jourdan@wanadoo.fr> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424184838.3406-1-maxi.jourdan@wanadoo.fr> References: <20180424184838.3406-1-maxi.jourdan@wanadoo.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the SEL/DIV/GATE for VDEC_1 and VDEC_HEVC. Signed-off-by: Maxime Jourdan --- drivers/clk/meson/gxbb.c | 114 +++++++++++++++++++++++++++++++++++++++ drivers/clk/meson/gxbb.h | 6 ++- 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index b1e4d9557610..a893b1edda22 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -1543,6 +1543,102 @@ static struct clk_regmap gxbb_vapb = { }, }; +/* VDEC clocks */ + +static const char * const gxbb_vdec_parent_names[] = { + "fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7" +}; + +static struct clk_regmap gxbb_vdec_1_sel = { + .data = &(struct clk_regmap_mux_data){ + .offset = HHI_VDEC_CLK_CNTL, + .mask = 0x3, + .shift = 9, + .flags = CLK_MUX_ROUND_CLOSEST, + }, + .hw.init = &(struct clk_init_data){ + .name = "vdec_1_sel", + .ops = &clk_regmap_mux_ops, + .parent_names = gxbb_vdec_parent_names, + .num_parents = ARRAY_SIZE(gxbb_vdec_parent_names), + .flags = CLK_SET_RATE_PARENT, + }, +}; + +static struct clk_regmap gxbb_vdec_1_div = { + .data = &(struct clk_regmap_div_data){ + .offset = HHI_VDEC_CLK_CNTL, + .shift = 0, + .width = 7, + }, + .hw.init = &(struct clk_init_data){ + .name = "vdec_1_div", + .ops = &clk_regmap_divider_ops, + .parent_names = (const char *[]){ "vdec_1_sel" }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + }, +}; + +static struct clk_regmap gxbb_vdec_1 = { + .data = &(struct clk_regmap_gate_data){ + .offset = HHI_VDEC_CLK_CNTL, + .bit_idx = 8, + }, + .hw.init = &(struct clk_init_data) { + .name = "vdec_1", + .ops = &clk_regmap_gate_ops, + .parent_names = (const char *[]){ "vdec_1_div" }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + }, +}; + +static struct clk_regmap gxbb_vdec_hevc_sel = { + .data = &(struct clk_regmap_mux_data){ + .offset = HHI_VDEC2_CLK_CNTL, + .mask = 0x3, + .shift = 25, + .flags = CLK_MUX_ROUND_CLOSEST, + }, + .hw.init = &(struct clk_init_data){ + .name = "vdec_hevc_sel", + .ops = &clk_regmap_mux_ops, + .parent_names = gxbb_vdec_parent_names, + .num_parents = ARRAY_SIZE(gxbb_vdec_parent_names), + .flags = CLK_SET_RATE_PARENT, + }, +}; + +static struct clk_regmap gxbb_vdec_hevc_div = { + .data = &(struct clk_regmap_div_data){ + .offset = HHI_VDEC2_CLK_CNTL, + .shift = 16, + .width = 7, + }, + .hw.init = &(struct clk_init_data){ + .name = "vdec_hevc_div", + .ops = &clk_regmap_divider_ops, + .parent_names = (const char *[]){ "vdec_hevc_sel" }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + }, +}; + +static struct clk_regmap gxbb_vdec_hevc = { + .data = &(struct clk_regmap_gate_data){ + .offset = HHI_VDEC2_CLK_CNTL, + .bit_idx = 24, + }, + .hw.init = &(struct clk_init_data) { + .name = "vdec_hevc", + .ops = &clk_regmap_gate_ops, + .parent_names = (const char *[]){ "vdec_hevc_div" }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + }, +}; + /* Everything Else (EE) domain gates */ static MESON_GATE(gxbb_ddr, HHI_GCLK_MPEG0, 0); static MESON_GATE(gxbb_dos, HHI_GCLK_MPEG0, 1); @@ -1786,6 +1882,12 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = { [CLKID_FCLK_DIV4_DIV] = &gxbb_fclk_div4_div.hw, [CLKID_FCLK_DIV5_DIV] = &gxbb_fclk_div5_div.hw, [CLKID_FCLK_DIV7_DIV] = &gxbb_fclk_div7_div.hw, + [CLKID_VDEC_1_SEL] = &gxbb_vdec_1_sel.hw, + [CLKID_VDEC_1_DIV] = &gxbb_vdec_1_div.hw, + [CLKID_VDEC_1] = &gxbb_vdec_1.hw, + [CLKID_VDEC_HEVC_SEL] = &gxbb_vdec_hevc_sel.hw, + [CLKID_VDEC_HEVC_DIV] = &gxbb_vdec_hevc_div.hw, + [CLKID_VDEC_HEVC] = &gxbb_vdec_hevc.hw, [NR_CLKS] = NULL, }, .num = NR_CLKS, @@ -1942,6 +2044,12 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { [CLKID_FCLK_DIV4_DIV] = &gxbb_fclk_div4_div.hw, [CLKID_FCLK_DIV5_DIV] = &gxbb_fclk_div5_div.hw, [CLKID_FCLK_DIV7_DIV] = &gxbb_fclk_div7_div.hw, + [CLKID_VDEC_1_SEL] = &gxbb_vdec_1_sel.hw, + [CLKID_VDEC_1_DIV] = &gxbb_vdec_1_div.hw, + [CLKID_VDEC_1] = &gxbb_vdec_1.hw, + [CLKID_VDEC_HEVC_SEL] = &gxbb_vdec_hevc_sel.hw, + [CLKID_VDEC_HEVC_DIV] = &gxbb_vdec_hevc_div.hw, + [CLKID_VDEC_HEVC] = &gxbb_vdec_hevc.hw, [NR_CLKS] = NULL, }, .num = NR_CLKS, @@ -2100,6 +2208,12 @@ static struct clk_regmap *const gx_clk_regmaps[] = { &gxbb_fclk_div4, &gxbb_fclk_div5, &gxbb_fclk_div7, + &gxbb_vdec_1_sel, + &gxbb_vdec_1_div, + &gxbb_vdec_1, + &gxbb_vdec_hevc_sel, + &gxbb_vdec_hevc_div, + &gxbb_vdec_hevc, }; struct clkc_data { diff --git a/drivers/clk/meson/gxbb.h b/drivers/clk/meson/gxbb.h index 9febf3f03739..b3ef54f65a9d 100644 --- a/drivers/clk/meson/gxbb.h +++ b/drivers/clk/meson/gxbb.h @@ -204,8 +204,12 @@ #define CLKID_FCLK_DIV4_DIV 148 #define CLKID_FCLK_DIV5_DIV 149 #define CLKID_FCLK_DIV7_DIV 150 +#define CLKID_VDEC_1_SEL 151 +#define CLKID_VDEC_1_DIV 152 +#define CLKID_VDEC_HEVC_SEL 154 +#define CLKID_VDEC_HEVC_DIV 155 -#define NR_CLKS 151 +#define NR_CLKS 157 /* include the CLKIDs that have been made part of the DT binding */ #include -- 2.17.0