mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
scmi: Implement scmi_clknode_recalc_freq method
Allow the SCMI clock frequency to be queried back, useful for testing
the IRQ path via sysctl access.
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43038
(cherry picked from commit ecd8cc84dc)
This commit is contained in:
parent
519141de7e
commit
4047cec132
1 changed files with 12 additions and 2 deletions
|
|
@ -56,7 +56,7 @@ struct scmi_clknode_softc {
|
|||
int clock_id;
|
||||
};
|
||||
|
||||
static int __unused
|
||||
static int
|
||||
scmi_clk_get_rate(struct scmi_clk_softc *sc, int clk_id, uint64_t *rate)
|
||||
{
|
||||
struct scmi_clk_rate_get_out out;
|
||||
|
|
@ -155,8 +155,18 @@ scmi_clknode_init(struct clknode *clk, device_t dev)
|
|||
static int
|
||||
scmi_clknode_recalc_freq(struct clknode *clk, uint64_t *freq)
|
||||
{
|
||||
struct scmi_clknode_softc *clk_sc;
|
||||
struct scmi_clk_softc *sc;
|
||||
uint64_t rate;
|
||||
int ret;
|
||||
|
||||
return (0);
|
||||
clk_sc = clknode_get_softc(clk);
|
||||
sc = device_get_softc(clk_sc->dev);
|
||||
ret = scmi_clk_get_rate(sc, clk_sc->clock_id, &rate);
|
||||
if (ret == 0)
|
||||
*freq = rate;
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue