--- zzzz-none-000/linux-3.10.107/drivers/clk/tegra/clk-divider.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/clk/tegra/clk-divider.c 2021-02-04 17:41:59.000000000 +0000 @@ -19,7 +19,6 @@ #include #include #include -#include #include "clk.h" @@ -59,7 +58,7 @@ return 0; if (divider_ux1 > get_max_div(divider)) - return -EINVAL; + return get_max_div(divider); return divider_ux1; } @@ -185,3 +184,16 @@ return clk; } + +static const struct clk_div_table mc_div_table[] = { + { .val = 0, .div = 2 }, + { .val = 1, .div = 1 }, + { .val = 0, .div = 0 }, +}; + +struct clk *tegra_clk_register_mc(const char *name, const char *parent_name, + void __iomem *reg, spinlock_t *lock) +{ + return clk_register_divider_table(NULL, name, parent_name, 0, reg, + 16, 1, 0, mc_div_table, lock); +}