Skip to content

Commit b7cec13

Browse files
Dinh NguyenMike Turquette
authored andcommitted
clk: socfpga: Look for the GPIO_DB_CLK by its offset
After the patch: "clk: socfpga: Map the clk manager base address in the clock driver" The clk->name field in socfpga_clk_recalc_rate() was getting cleared. Replace looking for the GPIO_DB_CLK by its divider offset instead. Also rename the define SOCFPGA_DB_CLK_OFFSET -> SOCFPGA_GPIO_DB_CLK_OFFSET, as this represents the GPIO_DB_CLK. Signed-off-by: Dinh Nguyen <[email protected]>
1 parent 6a7e712 commit b7cec13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/clk/socfpga/clk.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define SOCFPGA_NAND_CLK "nand_clk"
5252
#define SOCFPGA_NAND_X_CLK "nand_x_clk"
5353
#define SOCFPGA_MMC_CLK "sdmmc_clk"
54-
#define SOCFPGA_DB_CLK "gpio_db_clk"
54+
#define SOCFPGA_GPIO_DB_CLK_OFFSET 0xA8
5555

5656
#define div_mask(width) ((1 << (width)) - 1)
5757
#define streq(a, b) (strcmp((a), (b)) == 0)
@@ -234,7 +234,8 @@ static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk,
234234
else if (socfpgaclk->div_reg) {
235235
val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;
236236
val &= div_mask(socfpgaclk->width);
237-
if (streq(hwclk->init->name, SOCFPGA_DB_CLK))
237+
/* Check for GPIO_DB_CLK by its offset */
238+
if ((int)socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET)
238239
div = val + 1;
239240
else
240241
div = (1 << val);

0 commit comments

Comments
 (0)