Skip to content

Commit 773e4e9

Browse files
superna9999jbrun3t
authored andcommitted
clk: meson: g12a: add MIPI ISP clocks
Add the MIPI ISP gate, divider and mux used to feed the MIPI CSI ISP (Image Signal Processor) IP on the Amlogic G12B SoC. Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Tested-by: Daniel Scally <[email protected]> Link: https://lore.kernel.org/r/20231114-topic-amlogic-upstream-isp-clocks-v1-2-223958791501@linaro.org Signed-off-by: Jerome Brunet <[email protected]>
1 parent 67c55b4 commit 773e4e9

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

drivers/clk/meson/g12a.c

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,6 +3754,66 @@ static struct clk_regmap g12a_mipi_dsi_pxclk = {
37543754
},
37553755
};
37563756

3757+
/* MIPI ISP Clocks */
3758+
3759+
static const struct clk_parent_data g12b_mipi_isp_parent_data[] = {
3760+
{ .fw_name = "xtal", },
3761+
{ .hw = &g12a_gp0_pll.hw },
3762+
{ .hw = &g12a_hifi_pll.hw },
3763+
{ .hw = &g12a_fclk_div2p5.hw },
3764+
{ .hw = &g12a_fclk_div3.hw },
3765+
{ .hw = &g12a_fclk_div4.hw },
3766+
{ .hw = &g12a_fclk_div5.hw },
3767+
{ .hw = &g12a_fclk_div7.hw },
3768+
};
3769+
3770+
static struct clk_regmap g12b_mipi_isp_sel = {
3771+
.data = &(struct clk_regmap_mux_data){
3772+
.offset = HHI_ISP_CLK_CNTL,
3773+
.mask = 7,
3774+
.shift = 9,
3775+
},
3776+
.hw.init = &(struct clk_init_data){
3777+
.name = "mipi_isp_sel",
3778+
.ops = &clk_regmap_mux_ops,
3779+
.parent_data = g12b_mipi_isp_parent_data,
3780+
.num_parents = ARRAY_SIZE(g12b_mipi_isp_parent_data),
3781+
},
3782+
};
3783+
3784+
static struct clk_regmap g12b_mipi_isp_div = {
3785+
.data = &(struct clk_regmap_div_data){
3786+
.offset = HHI_ISP_CLK_CNTL,
3787+
.shift = 0,
3788+
.width = 7,
3789+
},
3790+
.hw.init = &(struct clk_init_data){
3791+
.name = "mipi_isp_div",
3792+
.ops = &clk_regmap_divider_ops,
3793+
.parent_hws = (const struct clk_hw *[]) {
3794+
&g12b_mipi_isp_sel.hw
3795+
},
3796+
.num_parents = 1,
3797+
.flags = CLK_SET_RATE_PARENT,
3798+
},
3799+
};
3800+
3801+
static struct clk_regmap g12b_mipi_isp = {
3802+
.data = &(struct clk_regmap_gate_data){
3803+
.offset = HHI_ISP_CLK_CNTL,
3804+
.bit_idx = 8,
3805+
},
3806+
.hw.init = &(struct clk_init_data) {
3807+
.name = "mipi_isp",
3808+
.ops = &clk_regmap_gate_ops,
3809+
.parent_hws = (const struct clk_hw *[]) {
3810+
&g12b_mipi_isp_div.hw
3811+
},
3812+
.num_parents = 1,
3813+
.flags = CLK_SET_RATE_PARENT,
3814+
},
3815+
};
3816+
37573817
/* HDMI Clocks */
37583818

37593819
static const struct clk_parent_data g12a_hdmi_parent_data[] = {
@@ -4765,6 +4825,9 @@ static struct clk_hw *g12b_hw_clks[] = {
47654825
[CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw,
47664826
[CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw,
47674827
[CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw,
4828+
[CLKID_MIPI_ISP_SEL] = &g12b_mipi_isp_sel.hw,
4829+
[CLKID_MIPI_ISP_DIV] = &g12b_mipi_isp_div.hw,
4830+
[CLKID_MIPI_ISP] = &g12b_mipi_isp.hw,
47684831
};
47694832

47704833
static struct clk_hw *sm1_hw_clks[] = {
@@ -5261,6 +5324,9 @@ static struct clk_regmap *const g12a_clk_regmaps[] = {
52615324
&g12a_mipi_dsi_pxclk_sel,
52625325
&g12a_mipi_dsi_pxclk_div,
52635326
&g12a_mipi_dsi_pxclk,
5327+
&g12b_mipi_isp_sel,
5328+
&g12b_mipi_isp_div,
5329+
&g12b_mipi_isp,
52645330
};
52655331

52665332
static const struct reg_sequence g12a_init_regs[] = {

drivers/clk/meson/g12a.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define HHI_MALI_CLK_CNTL 0x1b0
7171
#define HHI_VPU_CLKC_CNTL 0x1b4
7272
#define HHI_VPU_CLK_CNTL 0x1bC
73+
#define HHI_ISP_CLK_CNTL 0x1C0
7374
#define HHI_NNA_CLK_CNTL 0x1C8
7475
#define HHI_HDMI_CLK_CNTL 0x1CC
7576
#define HHI_VDEC_CLK_CNTL 0x1E0

0 commit comments

Comments
 (0)