for (i = 0; i < count; i++) if (IS_ERR(clks[i]))
pr_err("i.MX clk %u: register failed with %ld\n",
i, PTR_ERR(clks[i]));
}
EXPORT_SYMBOL_GPL(imx_check_clk_hws);
/* * This fixups the register CCM_CSCMR1 write value. * The write/read/divider values of the aclk_podf field * of that register have the relationship described by * the following table: * * write value read value divider * 3b'000 3b'110 7 * 3b'001 3b'111 8 * 3b'010 3b'100 5 * 3b'011 3b'101 6 * 3b'100 3b'010 3 * 3b'101 3b'011 4 * 3b'110 3b'000 1 * 3b'111 3b'001 2(default) * * That's why we do the xor operation below.
*/ #define CSCMR1_FIXUP 0x00600000
void imx_register_uart_clocks(void)
{ unsignedint num __maybe_unused;
imx_enabled_uart_clocks = 0;
/* i.MX boards use device trees now. For build tests without CONFIG_OF, do nothing */ #ifdef CONFIG_OF if (imx_keep_uart_clocks) { int i;
num = of_clk_get_parent_count(of_stdout); if (!num) return;
if (!of_stdout) return;
imx_uart_clocks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); if (!imx_uart_clocks) return;
for (i = 0; i < num; i++) {
imx_uart_clocks[imx_enabled_uart_clocks] = of_clk_get(of_stdout, i);
/* Stop if there are no more of_stdout references */ if (IS_ERR(imx_uart_clocks[imx_enabled_uart_clocks])) return;
/* Only enable the clock if it's not NULL */ if (imx_uart_clocks[imx_enabled_uart_clocks])
clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
}
} #endif
}
staticint __init imx_clk_disable_uart(void)
{ if (imx_keep_uart_clocks && imx_enabled_uart_clocks) { int i;
for (i = 0; i < imx_enabled_uart_clocks; i++) {
clk_disable_unprepare(imx_uart_clocks[i]);
clk_put(imx_uart_clocks[i]);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.