refactor(st-clock): remove unused clk function in API
Remove the unused functions in stm32mp clk API:
- stm32mp_stgen_get_counter (change to static, no more exported)
- stm32mp_stgen_restore_counter
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ib6ca72723eac3e133f1ca0dee504ef344c72e0bf
diff --git a/drivers/st/clk/stm32mp_clkfunc.c b/drivers/st/clk/stm32mp_clkfunc.c
index ed1f8a7..69922fd 100644
--- a/drivers/st/clk/stm32mp_clkfunc.c
+++ b/drivers/st/clk/stm32mp_clkfunc.c
@@ -335,6 +335,19 @@
}
/*******************************************************************************
+ * This function returns the STGEN counter value.
+ ******************************************************************************/
+static unsigned long long stm32mp_stgen_get_counter(void)
+{
+#ifdef __aarch64__
+ return mmio_read_64(STGEN_BASE + CNTCV_OFF);
+#else
+ return (((unsigned long long)mmio_read_32(STGEN_BASE + CNTCVU_OFF) << 32) |
+ mmio_read_32(STGEN_BASE + CNTCVL_OFF));
+#endif
+}
+
+/*******************************************************************************
* This function configures and restores the STGEN counter depending on the
* connected clock.
******************************************************************************/
@@ -375,34 +388,3 @@
write_cntfrq_el0((u_register_t)rate);
}
-
-/*******************************************************************************
- * This function returns the STGEN counter value.
- ******************************************************************************/
-unsigned long long stm32mp_stgen_get_counter(void)
-{
-#ifdef __aarch64__
- return mmio_read_64(STGEN_BASE + CNTCV_OFF);
-#else
- return (((unsigned long long)mmio_read_32(STGEN_BASE + CNTCVU_OFF) << 32) |
- mmio_read_32(STGEN_BASE + CNTCVL_OFF));
-#endif
-}
-
-/*******************************************************************************
- * This function restores the STGEN counter value.
- * It takes a first input value as a counter backup value to be restored and a
- * offset in ms to be added.
- ******************************************************************************/
-void stm32mp_stgen_restore_counter(unsigned long long value,
- unsigned long long offset_in_ms)
-{
- unsigned long long cnt;
-
- cnt = value + ((offset_in_ms *
- mmio_read_32(STGEN_BASE + CNTFID_OFF)) / 1000U);
-
- mmio_clrbits_32(STGEN_BASE + CNTCR_OFF, CNTCR_EN);
- stgen_set_counter(cnt);
- mmio_setbits_32(STGEN_BASE + CNTCR_OFF, CNTCR_EN);
-}
diff --git a/include/drivers/st/stm32mp_clkfunc.h b/include/drivers/st/stm32mp_clkfunc.h
index 085dcf1..8fd5ed1 100644
--- a/include/drivers/st/stm32mp_clkfunc.h
+++ b/include/drivers/st/stm32mp_clkfunc.h
@@ -30,8 +30,5 @@
void stm32mp_stgen_config(unsigned long rate);
void stm32mp_stgen_restore_rate(void);
-void stm32mp_stgen_restore_counter(unsigned long long value,
- unsigned long long offset_in_ms);
-unsigned long long stm32mp_stgen_get_counter(void);
#endif /* STM32MP_CLKFUNC_H */