Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: aspeed: Add SDIO gate

The clock divisor comes with an enable bit (gate). This was not
implemented as we didn't have access to SD hardware when writing the
driver. Now that we can test it, add the gate as a parent to the
divisor.

There is no reason to expose the gate separately, so users will enable
it by turning on the ASPEED_CLK_SDIO divisor.

Signed-off-by: Joel Stanley <joel@jms.id.au>
[aj: Minor style cleanup]
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Link: https://lkml.kernel.org/r/20190710141009.20651-1-andrew@aj.id.au
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Joel Stanley and committed by
Stephen Boyd
ebd5f82d 5f9e832c

+8 -3
+8 -3
drivers/clk/clk-aspeed.c
··· 500 500 return PTR_ERR(hw); 501 501 aspeed_clk_data->hws[ASPEED_CLK_MPLL] = hw; 502 502 503 - /* SD/SDIO clock divider (TODO: There's a gate too) */ 504 - hw = clk_hw_register_divider_table(dev, "sdio", "hpll", 0, 505 - scu_base + ASPEED_CLK_SELECTION, 12, 3, 0, 503 + /* SD/SDIO clock divider and gate */ 504 + hw = clk_hw_register_gate(dev, "sd_extclk_gate", "hpll", 0, 505 + scu_base + ASPEED_CLK_SELECTION, 15, 0, 506 + &aspeed_clk_lock); 507 + if (IS_ERR(hw)) 508 + return PTR_ERR(hw); 509 + hw = clk_hw_register_divider_table(dev, "sd_extclk", "sd_extclk_gate", 510 + 0, scu_base + ASPEED_CLK_SELECTION, 12, 3, 0, 506 511 soc_data->div_table, 507 512 &aspeed_clk_lock); 508 513 if (IS_ERR(hw))