| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2016 MediaTek Inc. |
|---|
| 3 | 4 | * Author: Ming Hsiu Tsai <minghsiu.tsai@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 | #ifndef __MTK_MDP_COMP_H__ |
|---|
| .. | .. |
|---|
| 30 | 22 | MTK_MDP_COMP_TYPE_MAX, |
|---|
| 31 | 23 | }; |
|---|
| 32 | 24 | |
|---|
| 33 | | -enum mtk_mdp_comp_id { |
|---|
| 34 | | - MTK_MDP_COMP_RDMA0, |
|---|
| 35 | | - MTK_MDP_COMP_RDMA1, |
|---|
| 36 | | - MTK_MDP_COMP_RSZ0, |
|---|
| 37 | | - MTK_MDP_COMP_RSZ1, |
|---|
| 38 | | - MTK_MDP_COMP_RSZ2, |
|---|
| 39 | | - MTK_MDP_COMP_WDMA, |
|---|
| 40 | | - MTK_MDP_COMP_WROT0, |
|---|
| 41 | | - MTK_MDP_COMP_WROT1, |
|---|
| 42 | | - MTK_MDP_COMP_ID_MAX, |
|---|
| 43 | | -}; |
|---|
| 44 | | - |
|---|
| 45 | 25 | /** |
|---|
| 46 | 26 | * struct mtk_mdp_comp - the MDP's function component data |
|---|
| 27 | + * @node: list node to track sibing MDP components |
|---|
| 47 | 28 | * @dev_node: component device node |
|---|
| 48 | 29 | * @clk: clocks required for component |
|---|
| 49 | | - * @regs: Mapped address of component registers. |
|---|
| 50 | 30 | * @larb_dev: SMI device required for component |
|---|
| 51 | 31 | * @type: component type |
|---|
| 52 | | - * @id: component ID |
|---|
| 53 | 32 | */ |
|---|
| 54 | 33 | struct mtk_mdp_comp { |
|---|
| 34 | + struct list_head node; |
|---|
| 55 | 35 | struct device_node *dev_node; |
|---|
| 56 | 36 | struct clk *clk[2]; |
|---|
| 57 | | - void __iomem *regs; |
|---|
| 58 | 37 | struct device *larb_dev; |
|---|
| 59 | 38 | enum mtk_mdp_comp_type type; |
|---|
| 60 | | - enum mtk_mdp_comp_id id; |
|---|
| 61 | 39 | }; |
|---|
| 62 | 40 | |
|---|
| 63 | 41 | int mtk_mdp_comp_init(struct device *dev, struct device_node *node, |
|---|
| 64 | | - struct mtk_mdp_comp *comp, enum mtk_mdp_comp_id comp_id); |
|---|
| 42 | + struct mtk_mdp_comp *comp, |
|---|
| 43 | + enum mtk_mdp_comp_type comp_type); |
|---|
| 65 | 44 | void mtk_mdp_comp_deinit(struct device *dev, struct mtk_mdp_comp *comp); |
|---|
| 66 | | -int mtk_mdp_comp_get_id(struct device *dev, struct device_node *node, |
|---|
| 67 | | - enum mtk_mdp_comp_type comp_type); |
|---|
| 68 | 45 | void mtk_mdp_comp_clock_on(struct device *dev, struct mtk_mdp_comp *comp); |
|---|
| 69 | 46 | void mtk_mdp_comp_clock_off(struct device *dev, struct mtk_mdp_comp *comp); |
|---|
| 70 | 47 | |
|---|