mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 18:36:00 +00:00
pmic warpper:
- reduce size by constifying data structures - use devm_clk_bulk_det_all_enable mutex: - reduce size by changing variable bit size -----BEGIN PGP SIGNATURE----- iQJLBAABCAA1FiEEUdvKHhzqrUYPB/u8L21+TfbCqH4FAmbfFCQXHG1hdHRoaWFz LmJnZ0BnbWFpbC5jb20ACgkQL21+TfbCqH7fARAAnHCF02WuAonLe5rWfJyR9kJF azH489t/umLCvnBm9tNwlFocrFwSspqkvaZO/47VOQINKcyEzy7idl917NuCy1WS yCo26BKTmapW7zCv619vku13JKzX78DotUUMJdUARxyzGUqD1o+pSuArWIRU2BV5 UxzkPAJljlgsVMgFgOUgv3e+qptDYFVE33qHfBGThfSbHcigChPLeVupa3oOxkXx oMFO1Tr79oBt82yR+dQgNIVfxOoviiOvS6+4WZD+a4Ud64GojmIN2iJN2Tu8I8C3 IMO6v/RU6HQl8UXvLBHq2nCrnU15gxpAoSSoBZ4ptWGmUdSqyVxUVU8AkHz0SMmC uf6qeCnVQONaUcL5c+iWcZY0vlM5c8NgHzs+dXU329HZnFlAe+QwqC9cwBSO0qE0 qk/w1GycASCe5aV2jzIq6MwTNd4xPf0wk9QqtIzFt9nfUEfl2Nv+i3Zun/xEcqC2 IqcBUNPrmSq3j0hg8bI/y1Zk61QgGTxK4jHnFozltDA9aOtyFP6vNg8ab/3ooyBw Cj+iVNHf8pL6/ACRH9OcfodILyQcaTYmiWqBvmKwu5+MgHI6WRbXw7QBeixW4gAR ogIoieLcUqdJxMBaudkp4TNtyYvn0vvJjaS368xl/swM/A3hucjJdLhOO7dgA+Hl SCRKBvMaoNpIhM1kj38= =f/35 -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmbhWxcACgkQYKtH/8kJ UieLRA//fv0PpQxPbv4iD5AUrk6iqESIJH2whZPnRjmkSrkJ02nqu+9HYKqBpFdY sZL4pY+ujM48/hfwNG6GCZXYYZCBuoanLbS+pYXm6l7ufmk34ysIIvsx6EcdzHx3 +ivsNnytBAWUzmUgkTgpbzHLfjCqoQ9X4kZc/kzA14hH6Ll6pqPwUOSYvtRBlDs9 2r+f1HVj9uWciLoXjmd7vbtsSeBRzatbptk2KE+9hB9l1dK4iAZVHpT0WQGFRUg5 0Md0o50hnS94LHMXVtPi7di/bXyVNWQxJcs+1mBTpnqGJIAWpqJkdjy95FHvtRaq 8Em1tP2jp6c50FEa3Ijfram0uyVF+kvfYbcjSvwRKnTk+XJp1dGKnt9rD/ubNs0g FSwD/RbsowHtGSiTFdyzRtE1XMYBpC+DfrZUOwgL+QYubYNEN6t5SieNIwUaiGPG yHB67XHn51eREPK07NtTu2l6XwgzeY2SwOR1rsSx7IHWxG7WqJm4Xg8+sZW6muup 8xqQADACAp5+jCi+PN9O+ZQ/Rzpmc92SdhjTsJF+cGVx6JwgsFkEaLDxYWi3Lkf0 skGA9tQUc/Zq+FUzYRPm23RvFU8Czc1XDulpf+QHB5od0so4Z4ocPNdvPLCmnv+N YiTmrLpwXXxqONfr3vNl9yKm+mjnnbcz69IVPfgeksKtMPMrB0M= =qG9s -----END PGP SIGNATURE----- Merge tag 'v6.11-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers pmic warpper: - reduce size by constifying data structures - use devm_clk_bulk_det_all_enable mutex: - reduce size by changing variable bit size * tag 'v6.11-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux: soc: mediatek: mtk-mutex: Reduce type size for mtk_mutex_data members soc: mediatek: pwrap: Use devm_clk_bulk_get_all_enable() soc: mediatek: pwrap: Constify some struct int[] soc: mediatek: pwrap: Constify struct pmic_wrapper_type Link: https://lore.kernel.org/r/bfa9ab87-9de8-41fc-bfd1-de5ec324cfe0@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
5f79d76727
@ -327,11 +327,11 @@ enum mtk_mutex_sof_id {
|
||||
};
|
||||
|
||||
struct mtk_mutex_data {
|
||||
const unsigned int *mutex_mod;
|
||||
const unsigned int *mutex_sof;
|
||||
const unsigned int mutex_mod_reg;
|
||||
const unsigned int mutex_sof_reg;
|
||||
const unsigned int *mutex_table_mod;
|
||||
const u8 *mutex_mod;
|
||||
const u8 *mutex_table_mod;
|
||||
const u16 *mutex_sof;
|
||||
const u16 mutex_mod_reg;
|
||||
const u16 mutex_sof_reg;
|
||||
const bool no_clk;
|
||||
};
|
||||
|
||||
@ -345,7 +345,7 @@ struct mtk_mutex_ctx {
|
||||
struct cmdq_client_reg cmdq_reg;
|
||||
};
|
||||
|
||||
static const unsigned int mt2701_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt2701_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_BLS] = MT2701_MUTEX_MOD_DISP_BLS,
|
||||
[DDP_COMPONENT_COLOR0] = MT2701_MUTEX_MOD_DISP_COLOR,
|
||||
[DDP_COMPONENT_OVL0] = MT2701_MUTEX_MOD_DISP_OVL,
|
||||
@ -354,7 +354,7 @@ static const unsigned int mt2701_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA0] = MT2701_MUTEX_MOD_DISP_WDMA,
|
||||
};
|
||||
|
||||
static const unsigned int mt2712_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt2712_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT2712_MUTEX_MOD_DISP_AAL0,
|
||||
[DDP_COMPONENT_AAL1] = MT2712_MUTEX_MOD2_DISP_AAL1,
|
||||
[DDP_COMPONENT_COLOR0] = MT2712_MUTEX_MOD_DISP_COLOR0,
|
||||
@ -374,7 +374,7 @@ static const unsigned int mt2712_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA1] = MT2712_MUTEX_MOD_DISP_WDMA1,
|
||||
};
|
||||
|
||||
static const unsigned int mt8167_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8167_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8167_MUTEX_MOD_DISP_AAL,
|
||||
[DDP_COMPONENT_CCORR] = MT8167_MUTEX_MOD_DISP_CCORR,
|
||||
[DDP_COMPONENT_COLOR0] = MT8167_MUTEX_MOD_DISP_COLOR,
|
||||
@ -389,7 +389,7 @@ static const unsigned int mt8167_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA0] = MT8167_MUTEX_MOD_DISP_WDMA0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8173_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8173_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8173_MUTEX_MOD_DISP_AAL,
|
||||
[DDP_COMPONENT_COLOR0] = MT8173_MUTEX_MOD_DISP_COLOR0,
|
||||
[DDP_COMPONENT_COLOR1] = MT8173_MUTEX_MOD_DISP_COLOR1,
|
||||
@ -407,7 +407,7 @@ static const unsigned int mt8173_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA1] = MT8173_MUTEX_MOD_DISP_WDMA1,
|
||||
};
|
||||
|
||||
static const unsigned int mt8183_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8183_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8183_MUTEX_MOD_DISP_AAL0,
|
||||
[DDP_COMPONENT_CCORR] = MT8183_MUTEX_MOD_DISP_CCORR0,
|
||||
[DDP_COMPONENT_COLOR0] = MT8183_MUTEX_MOD_DISP_COLOR0,
|
||||
@ -421,7 +421,7 @@ static const unsigned int mt8183_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA0] = MT8183_MUTEX_MOD_DISP_WDMA0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8183_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
static const u8 mt8183_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_RDMA0] = MT8183_MUTEX_MOD_MDP_RDMA0,
|
||||
[MUTEX_MOD_IDX_MDP_RSZ0] = MT8183_MUTEX_MOD_MDP_RSZ0,
|
||||
[MUTEX_MOD_IDX_MDP_RSZ1] = MT8183_MUTEX_MOD_MDP_RSZ1,
|
||||
@ -432,7 +432,7 @@ static const unsigned int mt8183_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_CCORR0] = MT8183_MUTEX_MOD_MDP_CCORR0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8186_MUTEX_MOD_DISP_AAL0,
|
||||
[DDP_COMPONENT_CCORR] = MT8186_MUTEX_MOD_DISP_CCORR0,
|
||||
[DDP_COMPONENT_COLOR0] = MT8186_MUTEX_MOD_DISP_COLOR0,
|
||||
@ -445,7 +445,7 @@ static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_RDMA1] = MT8186_MUTEX_MOD_DISP_RDMA1,
|
||||
};
|
||||
|
||||
static const unsigned int mt8186_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
static const u8 mt8186_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_RDMA0] = MT8186_MUTEX_MOD_MDP_RDMA0,
|
||||
[MUTEX_MOD_IDX_MDP_RSZ0] = MT8186_MUTEX_MOD_MDP_RSZ0,
|
||||
[MUTEX_MOD_IDX_MDP_RSZ1] = MT8186_MUTEX_MOD_MDP_RSZ1,
|
||||
@ -456,7 +456,7 @@ static const unsigned int mt8186_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_COLOR0] = MT8186_MUTEX_MOD_MDP_COLOR0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8188_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8188_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_OVL0] = MT8188_MUTEX_MOD_DISP_OVL0,
|
||||
[DDP_COMPONENT_WDMA0] = MT8188_MUTEX_MOD_DISP_WDMA0,
|
||||
[DDP_COMPONENT_RDMA0] = MT8188_MUTEX_MOD_DISP_RDMA0,
|
||||
@ -496,7 +496,7 @@ static const unsigned int mt8188_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_MERGE5] = MT8188_MUTEX_MOD_DISP1_VPP_MERGE4,
|
||||
};
|
||||
|
||||
static const unsigned int mt8188_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
static const u8 mt8188_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_RDMA0] = MT8195_MUTEX_MOD_MDP_RDMA0,
|
||||
[MUTEX_MOD_IDX_MDP_RDMA2] = MT8195_MUTEX_MOD_MDP_RDMA2,
|
||||
[MUTEX_MOD_IDX_MDP_RDMA3] = MT8195_MUTEX_MOD_MDP_RDMA3,
|
||||
@ -530,7 +530,7 @@ static const unsigned int mt8188_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_WROT3] = MT8195_MUTEX_MOD_MDP_WROT3,
|
||||
};
|
||||
|
||||
static const unsigned int mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8192_MUTEX_MOD_DISP_AAL0,
|
||||
[DDP_COMPONENT_CCORR] = MT8192_MUTEX_MOD_DISP_CCORR0,
|
||||
[DDP_COMPONENT_COLOR0] = MT8192_MUTEX_MOD_DISP_COLOR0,
|
||||
@ -544,7 +544,7 @@ static const unsigned int mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_RDMA4] = MT8192_MUTEX_MOD_DISP_RDMA4,
|
||||
};
|
||||
|
||||
static const unsigned int mt8195_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8195_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_OVL0] = MT8195_MUTEX_MOD_DISP_OVL0,
|
||||
[DDP_COMPONENT_WDMA0] = MT8195_MUTEX_MOD_DISP_WDMA0,
|
||||
[DDP_COMPONENT_RDMA0] = MT8195_MUTEX_MOD_DISP_RDMA0,
|
||||
@ -575,7 +575,7 @@ static const unsigned int mt8195_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_DP_INTF1] = MT8195_MUTEX_MOD_DISP1_DP_INTF0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8195_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
static const u8 mt8195_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_RDMA0] = MT8195_MUTEX_MOD_MDP_RDMA0,
|
||||
[MUTEX_MOD_IDX_MDP_RDMA1] = MT8195_MUTEX_MOD_MDP_RDMA1,
|
||||
[MUTEX_MOD_IDX_MDP_RDMA2] = MT8195_MUTEX_MOD_MDP_RDMA2,
|
||||
@ -621,7 +621,7 @@ static const unsigned int mt8195_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
|
||||
[MUTEX_MOD_IDX_MDP_WROT3] = MT8195_MUTEX_MOD_MDP_WROT3,
|
||||
};
|
||||
|
||||
static const unsigned int mt8365_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
static const u8 mt8365_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_AAL0] = MT8365_MUTEX_MOD_DISP_AAL,
|
||||
[DDP_COMPONENT_CCORR] = MT8365_MUTEX_MOD_DISP_CCORR,
|
||||
[DDP_COMPONENT_COLOR0] = MT8365_MUTEX_MOD_DISP_COLOR0,
|
||||
@ -637,7 +637,7 @@ static const unsigned int mt8365_mutex_mod[DDP_COMPONENT_ID_MAX] = {
|
||||
[DDP_COMPONENT_WDMA0] = MT8365_MUTEX_MOD_DISP_WDMA0,
|
||||
};
|
||||
|
||||
static const unsigned int mt2712_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt2712_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MUTEX_SOF_DSI0,
|
||||
[MUTEX_SOF_DSI1] = MUTEX_SOF_DSI1,
|
||||
@ -647,14 +647,14 @@ static const unsigned int mt2712_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_DSI3] = MUTEX_SOF_DSI3,
|
||||
};
|
||||
|
||||
static const unsigned int mt6795_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt6795_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MUTEX_SOF_DSI0,
|
||||
[MUTEX_SOF_DSI1] = MUTEX_SOF_DSI1,
|
||||
[MUTEX_SOF_DPI0] = MUTEX_SOF_DPI0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8167_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt8167_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MUTEX_SOF_DSI0,
|
||||
[MUTEX_SOF_DPI0] = MT8167_MUTEX_SOF_DPI0,
|
||||
@ -662,13 +662,13 @@ static const unsigned int mt8167_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
};
|
||||
|
||||
/* Add EOF setting so overlay hardware can receive frame done irq */
|
||||
static const unsigned int mt8183_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt8183_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MUTEX_SOF_DSI0 | MT8183_MUTEX_EOF_DSI0,
|
||||
[MUTEX_SOF_DPI0] = MT8183_MUTEX_SOF_DPI0 | MT8183_MUTEX_EOF_DPI0,
|
||||
};
|
||||
|
||||
static const unsigned int mt8186_mutex_sof[MUTEX_SOF_DSI3 + 1] = {
|
||||
static const u16 mt8186_mutex_sof[MUTEX_SOF_DSI3 + 1] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MT8186_MUTEX_SOF_DSI0 | MT8186_MUTEX_EOF_DSI0,
|
||||
[MUTEX_SOF_DPI0] = MT8186_MUTEX_SOF_DPI0 | MT8186_MUTEX_EOF_DPI0,
|
||||
@ -682,7 +682,7 @@ static const unsigned int mt8186_mutex_sof[MUTEX_SOF_DSI3 + 1] = {
|
||||
* but also detect the error at end of frame(EAEOF) when EOF signal
|
||||
* arrives.
|
||||
*/
|
||||
static const unsigned int mt8188_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt8188_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] =
|
||||
MT8188_MUTEX_SOF_DSI0 | MT8188_MUTEX_EOF_DSI0,
|
||||
@ -692,7 +692,7 @@ static const unsigned int mt8188_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
MT8188_MUTEX_SOF_DP_INTF1 | MT8188_MUTEX_EOF_DP_INTF1,
|
||||
};
|
||||
|
||||
static const unsigned int mt8195_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
static const u16 mt8195_mutex_sof[DDP_MUTEX_SOF_MAX] = {
|
||||
[MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
|
||||
[MUTEX_SOF_DSI0] = MT8195_MUTEX_SOF_DSI0 | MT8195_MUTEX_EOF_DSI0,
|
||||
[MUTEX_SOF_DSI1] = MT8195_MUTEX_SOF_DSI1 | MT8195_MUTEX_EOF_DSI1,
|
||||
|
@ -483,7 +483,7 @@ enum pwrap_regs {
|
||||
PWRAP_MSB_FIRST,
|
||||
};
|
||||
|
||||
static int mt2701_regs[] = {
|
||||
static const int mt2701_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -569,7 +569,7 @@ static int mt2701_regs[] = {
|
||||
[PWRAP_ADC_RDATA_ADDR2] = 0x154,
|
||||
};
|
||||
|
||||
static int mt6765_regs[] = {
|
||||
static const int mt6765_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -601,7 +601,7 @@ static int mt6765_regs[] = {
|
||||
[PWRAP_DCM_DBC_PRD] = 0x1E0,
|
||||
};
|
||||
|
||||
static int mt6779_regs[] = {
|
||||
static const int mt6779_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -640,7 +640,7 @@ static int mt6779_regs[] = {
|
||||
[PWRAP_WACS2_VLDCLR] = 0xC28,
|
||||
};
|
||||
|
||||
static int mt6795_regs[] = {
|
||||
static const int mt6795_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -725,7 +725,7 @@ static int mt6795_regs[] = {
|
||||
[PWRAP_EXT_CK] = 0x14c,
|
||||
};
|
||||
|
||||
static int mt6797_regs[] = {
|
||||
static const int mt6797_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -758,7 +758,7 @@ static int mt6797_regs[] = {
|
||||
[PWRAP_DCM_DBC_PRD] = 0x1D4,
|
||||
};
|
||||
|
||||
static int mt6873_regs[] = {
|
||||
static const int mt6873_regs[] = {
|
||||
[PWRAP_INIT_DONE2] = 0x0,
|
||||
[PWRAP_TIMER_EN] = 0x3E0,
|
||||
[PWRAP_INT_EN] = 0x448,
|
||||
@ -769,7 +769,7 @@ static int mt6873_regs[] = {
|
||||
[PWRAP_WACS2_RDATA] = 0xCA8,
|
||||
};
|
||||
|
||||
static int mt7622_regs[] = {
|
||||
static const int mt7622_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -881,7 +881,7 @@ static int mt7622_regs[] = {
|
||||
[PWRAP_SPI2_CTRL] = 0x244,
|
||||
};
|
||||
|
||||
static int mt8135_regs[] = {
|
||||
static const int mt8135_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -954,7 +954,7 @@ static int mt8135_regs[] = {
|
||||
[PWRAP_DCM_DBC_PRD] = 0x160,
|
||||
};
|
||||
|
||||
static int mt8173_regs[] = {
|
||||
static const int mt8173_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -1036,7 +1036,7 @@ static int mt8173_regs[] = {
|
||||
[PWRAP_DCM_DBC_PRD] = 0x148,
|
||||
};
|
||||
|
||||
static int mt8183_regs[] = {
|
||||
static const int mt8183_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -1087,7 +1087,7 @@ static int mt8183_regs[] = {
|
||||
[PWRAP_WACS2_VLDCLR] = 0xC28,
|
||||
};
|
||||
|
||||
static int mt8195_regs[] = {
|
||||
static const int mt8195_regs[] = {
|
||||
[PWRAP_INIT_DONE2] = 0x0,
|
||||
[PWRAP_STAUPD_CTRL] = 0x4C,
|
||||
[PWRAP_TIMER_EN] = 0x3E4,
|
||||
@ -1104,7 +1104,7 @@ static int mt8195_regs[] = {
|
||||
[PWRAP_WACS2_RDATA] = 0x8A8,
|
||||
};
|
||||
|
||||
static int mt8365_regs[] = {
|
||||
static const int mt8365_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -1166,7 +1166,7 @@ static int mt8365_regs[] = {
|
||||
[PWRAP_WDT_SRC_EN_1] = 0xf8,
|
||||
};
|
||||
|
||||
static int mt8516_regs[] = {
|
||||
static const int mt8516_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -1251,7 +1251,7 @@ static int mt8516_regs[] = {
|
||||
[PWRAP_MSB_FIRST] = 0x170,
|
||||
};
|
||||
|
||||
static int mt8186_regs[] = {
|
||||
static const int mt8186_regs[] = {
|
||||
[PWRAP_MUX_SEL] = 0x0,
|
||||
[PWRAP_WRAP_EN] = 0x4,
|
||||
[PWRAP_DIO_EN] = 0x8,
|
||||
@ -1366,10 +1366,6 @@ struct pmic_wrapper {
|
||||
struct regmap *regmap;
|
||||
const struct pmic_wrapper_type *master;
|
||||
const struct pwrap_slv_type *slave;
|
||||
struct clk *clk_spi;
|
||||
struct clk *clk_wrap;
|
||||
struct clk *clk_sys;
|
||||
struct clk *clk_tmr;
|
||||
struct reset_control *rstc;
|
||||
|
||||
struct reset_control *rstc_bridge;
|
||||
@ -1377,7 +1373,7 @@ struct pmic_wrapper {
|
||||
};
|
||||
|
||||
struct pmic_wrapper_type {
|
||||
int *regs;
|
||||
const int *regs;
|
||||
enum pwrap_type type;
|
||||
u32 arb_en_all;
|
||||
u32 int_en_all;
|
||||
@ -2397,7 +2393,7 @@ static const struct pmic_wrapper_type pwrap_mt8183 = {
|
||||
.init_soc_specific = pwrap_mt8183_init_soc_specific,
|
||||
};
|
||||
|
||||
static struct pmic_wrapper_type pwrap_mt8195 = {
|
||||
static const struct pmic_wrapper_type pwrap_mt8195 = {
|
||||
.regs = mt8195_regs,
|
||||
.type = PWRAP_MT8195,
|
||||
.arb_en_all = 0x777f, /* NEED CONFIRM */
|
||||
@ -2423,7 +2419,7 @@ static const struct pmic_wrapper_type pwrap_mt8365 = {
|
||||
.init_soc_specific = NULL,
|
||||
};
|
||||
|
||||
static struct pmic_wrapper_type pwrap_mt8516 = {
|
||||
static const struct pmic_wrapper_type pwrap_mt8516 = {
|
||||
.regs = mt8516_regs,
|
||||
.type = PWRAP_MT8516,
|
||||
.arb_en_all = 0xff,
|
||||
@ -2435,7 +2431,7 @@ static struct pmic_wrapper_type pwrap_mt8516 = {
|
||||
.init_soc_specific = NULL,
|
||||
};
|
||||
|
||||
static struct pmic_wrapper_type pwrap_mt8186 = {
|
||||
static const struct pmic_wrapper_type pwrap_mt8186 = {
|
||||
.regs = mt8186_regs,
|
||||
.type = PWRAP_MT8186,
|
||||
.arb_en_all = 0xfb27f,
|
||||
@ -2472,6 +2468,7 @@ static int pwrap_probe(struct platform_device *pdev)
|
||||
int ret, irq;
|
||||
u32 mask_done;
|
||||
struct pmic_wrapper *wrp;
|
||||
struct clk_bulk_data *clk;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
const struct of_device_id *of_slave_id = NULL;
|
||||
|
||||
@ -2521,49 +2518,10 @@ static int pwrap_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
wrp->clk_spi = devm_clk_get(wrp->dev, "spi");
|
||||
if (IS_ERR(wrp->clk_spi)) {
|
||||
dev_dbg(wrp->dev, "failed to get clock: %ld\n",
|
||||
PTR_ERR(wrp->clk_spi));
|
||||
return PTR_ERR(wrp->clk_spi);
|
||||
}
|
||||
|
||||
wrp->clk_wrap = devm_clk_get(wrp->dev, "wrap");
|
||||
if (IS_ERR(wrp->clk_wrap)) {
|
||||
dev_dbg(wrp->dev, "failed to get clock: %ld\n",
|
||||
PTR_ERR(wrp->clk_wrap));
|
||||
return PTR_ERR(wrp->clk_wrap);
|
||||
}
|
||||
|
||||
wrp->clk_sys = devm_clk_get_optional(wrp->dev, "sys");
|
||||
if (IS_ERR(wrp->clk_sys)) {
|
||||
return dev_err_probe(wrp->dev, PTR_ERR(wrp->clk_sys),
|
||||
"failed to get clock: %pe\n",
|
||||
wrp->clk_sys);
|
||||
}
|
||||
|
||||
wrp->clk_tmr = devm_clk_get_optional(wrp->dev, "tmr");
|
||||
if (IS_ERR(wrp->clk_tmr)) {
|
||||
return dev_err_probe(wrp->dev, PTR_ERR(wrp->clk_tmr),
|
||||
"failed to get clock: %pe\n",
|
||||
wrp->clk_tmr);
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(wrp->clk_spi);
|
||||
ret = devm_clk_bulk_get_all_enable(wrp->dev, &clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = clk_prepare_enable(wrp->clk_wrap);
|
||||
if (ret)
|
||||
goto err_out1;
|
||||
|
||||
ret = clk_prepare_enable(wrp->clk_sys);
|
||||
if (ret)
|
||||
goto err_out2;
|
||||
|
||||
ret = clk_prepare_enable(wrp->clk_tmr);
|
||||
if (ret)
|
||||
goto err_out3;
|
||||
return dev_err_probe(wrp->dev, ret,
|
||||
"failed to get clocks\n");
|
||||
|
||||
/* Enable internal dynamic clock */
|
||||
if (HAS_CAP(wrp->master->caps, PWRAP_CAP_DCM)) {
|
||||
@ -2579,7 +2537,7 @@ static int pwrap_probe(struct platform_device *pdev)
|
||||
ret = pwrap_init(wrp);
|
||||
if (ret) {
|
||||
dev_dbg(wrp->dev, "init failed with %d\n", ret);
|
||||
goto err_out4;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2592,8 +2550,7 @@ static int pwrap_probe(struct platform_device *pdev)
|
||||
|
||||
if (!(pwrap_readl(wrp, PWRAP_WACS2_RDATA) & mask_done)) {
|
||||
dev_dbg(wrp->dev, "initialization isn't finished\n");
|
||||
ret = -ENODEV;
|
||||
goto err_out4;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Initialize watchdog, may not be done by the bootloader */
|
||||
@ -2622,42 +2579,27 @@ static int pwrap_probe(struct platform_device *pdev)
|
||||
pwrap_writel(wrp, wrp->master->int1_en_all, PWRAP_INT1_EN);
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto err_out2;
|
||||
}
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt,
|
||||
IRQF_TRIGGER_HIGH,
|
||||
"mt-pmic-pwrap", wrp);
|
||||
if (ret)
|
||||
goto err_out4;
|
||||
return ret;
|
||||
|
||||
wrp->regmap = devm_regmap_init(wrp->dev, NULL, wrp, wrp->slave->regops->regmap);
|
||||
if (IS_ERR(wrp->regmap)) {
|
||||
ret = PTR_ERR(wrp->regmap);
|
||||
goto err_out2;
|
||||
}
|
||||
if (IS_ERR(wrp->regmap))
|
||||
return PTR_ERR(wrp->regmap);
|
||||
|
||||
ret = of_platform_populate(np, NULL, NULL, wrp->dev);
|
||||
if (ret) {
|
||||
dev_dbg(wrp->dev, "failed to create child devices at %pOF\n",
|
||||
np);
|
||||
goto err_out4;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_out4:
|
||||
clk_disable_unprepare(wrp->clk_tmr);
|
||||
err_out3:
|
||||
clk_disable_unprepare(wrp->clk_sys);
|
||||
err_out2:
|
||||
clk_disable_unprepare(wrp->clk_wrap);
|
||||
err_out1:
|
||||
clk_disable_unprepare(wrp->clk_spi);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver pwrap_drv = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user