Skip to content

Commit aa1fe3d

Browse files
committed
Merge branch 'at91-4.9-trunk/clk' into linux-4.9-at91
2 parents 2979658 + 66a98cc commit aa1fe3d

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

drivers/clk/at91/clk-utmi.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,23 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np)
173173
if (IS_ERR(regmap_pmc))
174174
return;
175175

176-
/* SFR node missing is not necessarily an issue. */
177-
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
178-
if (IS_ERR(regmap_sfr))
179-
regmap_sfr = NULL;
176+
/*
177+
* If the device supports different mainck rates, this value has to be
178+
* set in the UTMI Clock Trimming register.
179+
* - 9x5: mainck supports several rates but it is indicated that a
180+
* 12 MHz is needed in case of USB.
181+
* - sama5d3 and sama5d2: mainck supports several rates. Configuring
182+
* the FREQ field of the UTMI Clock Trimming register is mandatory.
183+
* - sama5d4: mainck is at 12 MHz.
184+
*
185+
* We only need to retrieve sama5d3 or sama5d2 sfr regmap.
186+
*/
187+
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d3-sfr");
188+
if (IS_ERR(regmap_sfr)) {
189+
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
190+
if (IS_ERR(regmap_sfr))
191+
regmap_sfr = NULL;
192+
}
180193

181194
hw = at91_clk_register_utmi(regmap_pmc, regmap_sfr, name, parent_name);
182195
if (IS_ERR(hw))

0 commit comments

Comments
 (0)