[PATCH 3/6] mfd: db8500-prcmu: Drop unused partial APE clock divider mode
Linus Walleij
linusw at kernel.org
Fri Nov 27 15:42:31 PST 2026
The vendor partial-25% mode is not a firmware OPP. It emulates one
by changing ACLK and DMA clock dividers around the mailbox request,
but no in-tree consumer ever selects it. Drop the unused emulation
so that the clock register lock can move with its remaining users.
Leave the actual APE 50% and 100% requests unchanged.
Signed-off-by: Linus Walleij <linusw at kernel.org>
---
drivers/mfd/db8500-prcmu.c | 55 +---------------------------------------
include/linux/mfd/db8500-prcmu.h | 2 --
2 files changed, 1 insertion(+), 56 deletions(-)
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 1d9114edfbdb..1c58cf804e4e 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -781,52 +781,6 @@ int db8500_prcmu_get_ddr_opp(void)
return readb(PRCM_DDR_SUBSYS_APE_MINBW);
}
-/* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
-static void request_even_slower_clocks(bool enable)
-{
- u32 clock_reg[] = {
- PRCM_ACLK_MGT,
- PRCM_DMACLK_MGT
- };
- unsigned long flags;
- unsigned int i;
-
- spin_lock_irqsave(&clk_mgt_lock, flags);
-
- /* Grab the HW semaphore. */
- while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0)
- cpu_relax();
-
- for (i = 0; i < ARRAY_SIZE(clock_reg); i++) {
- u32 val;
- u32 div;
-
- val = readl(prcmu_base + clock_reg[i]);
- div = (val & PRCM_CLK_MGT_CLKPLLDIV_MASK);
- if (enable) {
- if ((div <= 1) || (div > 15)) {
- pr_err("prcmu: Bad clock divider %d in %s\n",
- div, __func__);
- goto unlock_and_return;
- }
- div <<= 1;
- } else {
- if (div <= 2)
- goto unlock_and_return;
- div >>= 1;
- }
- val = ((val & ~PRCM_CLK_MGT_CLKPLLDIV_MASK) |
- (div & PRCM_CLK_MGT_CLKPLLDIV_MASK));
- writel(val, prcmu_base + clock_reg[i]);
- }
-
-unlock_and_return:
- /* Release the HW semaphore. */
- writel(0, PRCM_SEM);
-
- spin_unlock_irqrestore(&clk_mgt_lock, flags);
-}
-
/**
* db8500_prcmu_set_ape_opp - set the appropriate APE OPP
* @opp: The new APE operating point to which transition is to be made
@@ -843,9 +797,6 @@ int db8500_prcmu_set_ape_opp(u8 opp)
mutex_lock(&mb1_transfer.lock);
- if (mb1_transfer.ape_opp == APE_50_PARTLY_25_OPP)
- request_even_slower_clocks(false);
-
if ((opp != APE_100_OPP) && (mb1_transfer.ape_opp != APE_100_OPP))
goto skip_message;
@@ -854,8 +805,7 @@ int db8500_prcmu_set_ape_opp(u8 opp)
writeb(MB1H_ARM_APE_OPP, (tcdm_base + PRCM_MBOX_HEADER_REQ_MB1));
writeb(ARM_NO_CHANGE, (tcdm_base + PRCM_REQ_MB1_ARM_OPP));
- writeb(((opp == APE_50_PARTLY_25_OPP) ? APE_50_OPP : opp),
- (tcdm_base + PRCM_REQ_MB1_APE_OPP));
+ writeb(opp, (tcdm_base + PRCM_REQ_MB1_APE_OPP));
writel(MBOX_BIT(1), PRCM_MBOX_CPU_SET);
wait_for_completion(&mb1_transfer.work);
@@ -865,9 +815,6 @@ int db8500_prcmu_set_ape_opp(u8 opp)
r = -EIO;
skip_message:
- if ((!r && (opp == APE_50_PARTLY_25_OPP)) ||
- (r && (mb1_transfer.ape_opp == APE_50_PARTLY_25_OPP)))
- request_even_slower_clocks(true);
if (!r)
mb1_transfer.ape_opp = opp;
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index b6e3450b1d11..7306303494f1 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -521,14 +521,12 @@ enum prcmu_wdog_id {
* @APE_NO_CHANGE: The APE operating point is unchanged
* @APE_100_OPP: The new APE operating point is ape100opp
* @APE_50_OPP: 50%
- * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%.
*/
enum ape_opp {
APE_OPP_INIT = 0x00,
APE_NO_CHANGE = 0x01,
APE_100_OPP = 0x02,
APE_50_OPP = 0x03,
- APE_50_PARTLY_25_OPP = 0xFF,
};
/**
--
2.56.1
More information about the linux-arm-kernel
mailing list