| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2014 MediaTek Inc. |
|---|
| 3 | 4 | * Author: James Liao <jamesjj.liao@mediatek.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | |
|---|
| 15 | 7 | #include <linux/of.h> |
|---|
| .. | .. |
|---|
| 20 | 12 | #include <linux/delay.h> |
|---|
| 21 | 13 | #include <linux/clkdev.h> |
|---|
| 22 | 14 | #include <linux/mfd/syscon.h> |
|---|
| 15 | +#include <linux/device.h> |
|---|
| 23 | 16 | |
|---|
| 24 | 17 | #include "clk-mtk.h" |
|---|
| 25 | 18 | #include "clk-gate.h" |
|---|
| .. | .. |
|---|
| 101 | 94 | } |
|---|
| 102 | 95 | } |
|---|
| 103 | 96 | |
|---|
| 104 | | -int mtk_clk_register_gates(struct device_node *node, |
|---|
| 97 | +int mtk_clk_register_gates_with_dev(struct device_node *node, |
|---|
| 105 | 98 | const struct mtk_gate *clks, |
|---|
| 106 | | - int num, struct clk_onecell_data *clk_data) |
|---|
| 99 | + int num, struct clk_onecell_data *clk_data, |
|---|
| 100 | + struct device *dev) |
|---|
| 107 | 101 | { |
|---|
| 108 | 102 | int i; |
|---|
| 109 | 103 | struct clk *clk; |
|---|
| .. | .. |
|---|
| 130 | 124 | gate->regs->set_ofs, |
|---|
| 131 | 125 | gate->regs->clr_ofs, |
|---|
| 132 | 126 | gate->regs->sta_ofs, |
|---|
| 133 | | - gate->shift, gate->ops); |
|---|
| 127 | + gate->shift, gate->ops, gate->flags, dev); |
|---|
| 134 | 128 | |
|---|
| 135 | 129 | if (IS_ERR(clk)) { |
|---|
| 136 | 130 | pr_err("Failed to register clk %s: %ld\n", |
|---|
| .. | .. |
|---|
| 142 | 136 | } |
|---|
| 143 | 137 | |
|---|
| 144 | 138 | return 0; |
|---|
| 139 | +} |
|---|
| 140 | + |
|---|
| 141 | +int mtk_clk_register_gates(struct device_node *node, |
|---|
| 142 | + const struct mtk_gate *clks, |
|---|
| 143 | + int num, struct clk_onecell_data *clk_data) |
|---|
| 144 | +{ |
|---|
| 145 | + return mtk_clk_register_gates_with_dev(node, |
|---|
| 146 | + clks, num, clk_data, NULL); |
|---|
| 145 | 147 | } |
|---|
| 146 | 148 | |
|---|
| 147 | 149 | struct clk *mtk_clk_register_composite(const struct mtk_composite *mc, |
|---|
| .. | .. |
|---|
| 167 | 169 | mux->mask = BIT(mc->mux_width) - 1; |
|---|
| 168 | 170 | mux->shift = mc->mux_shift; |
|---|
| 169 | 171 | mux->lock = lock; |
|---|
| 170 | | - |
|---|
| 172 | + mux->flags = mc->mux_flags; |
|---|
| 171 | 173 | mux_hw = &mux->hw; |
|---|
| 172 | 174 | mux_ops = &clk_mux_ops; |
|---|
| 173 | 175 | |
|---|