summaryrefslogtreecommitdiff
path: root/drivers/clk/mediatek/reset.h
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-05-23 12:33:35 +0300
committerStephen Boyd <sboyd@kernel.org>2022-06-16 03:24:12 +0300
commit322989ddf7c478a9cbbb51da0d4b51825a47735d (patch)
tree3a4b7764809914e19aa05632a140a0ab6f564a47 /drivers/clk/mediatek/reset.h
parent723e367114dec95abe8bba4118c4c7c3542a463f (diff)
downloadlinux-322989ddf7c478a9cbbb51da0d4b51825a47735d.tar.xz
clk: mediatek: reset: Support inuput argument index mode
There is a large number of mediatek infra reset bits, but we do not use all of them. In addition, the proper input argement of reset controller soulde be index. Therefore, to be compatible with previous drivers and usage, we add description variables to store the ids which can mapping to index. To use this mode, we need to put the id in rst_idx_map to map from index to ids. For example, if we want to input index 1 (this index is used to set bank 1 bit 14) for svs, we need to declare the reset controller like this: In drivers: static u16 rst_ofs[] = { 0x120, 0x130, 0x140, 0x150, 0x730, }; static u16 rst_idx_map[] = { 0 * 32 + 0, 1 * 32 + 14, .... }; static const struct mtk_clk_rst_desc clk_rst_desc = { .version = MTK_RST_SET_CLR, .rst_bank_ofs = rst_ofs, .rst_bank_nr = ARRAY_SIZE(rst_ofs), .rst_idx_map = rst_idx_map, .rst_idx_map_nr = ARRAY_SIZE(rst_idx_map), }; In dts: svs: { ... resets = <&infra 1>; ... }; Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/20220523093346.28493-9-rex-bc.chen@mediatek.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/mediatek/reset.h')
-rw-r--r--drivers/clk/mediatek/reset.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/clk/mediatek/reset.h b/drivers/clk/mediatek/reset.h
index d991510ae2d8..cc847c67a2fc 100644
--- a/drivers/clk/mediatek/reset.h
+++ b/drivers/clk/mediatek/reset.h
@@ -28,11 +28,16 @@ enum mtk_reset_version {
* @version: Reset version which is defined in enum mtk_reset_version.
* @rst_bank_ofs: Pointer to an array containing base offsets of the reset register.
* @rst_bank_nr: Quantity of reset bank.
+ * @rst_idx_map:Pointer to an array containing ids if input argument is index.
+ * This array is not necessary if our input argument does not mean index.
+ * @rst_idx_map_nr: Quantity of reset index map.
*/
struct mtk_clk_rst_desc {
enum mtk_reset_version version;
u16 *rst_bank_ofs;
u32 rst_bank_nr;
+ u16 *rst_idx_map;
+ u32 rst_idx_map_nr;
};
/**