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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ccf/atmel-fixes-for-4.1' of https://github.com/bbrezillon/linux-at91 into clk-fixes

+16 -8
+1 -1
Documentation/devicetree/bindings/clock/at91-clock.txt
··· 248 - #address-cells : shall be 1 (reg is used to encode clk id). 249 - clocks : shall be the master clock phandle. 250 e.g. clocks = <&mck>; 251 - - name: device tree node describing a specific system clock. 252 * #clock-cells : from common clock binding; shall be set to 0. 253 * reg: peripheral id. See Atmel's datasheets to get a full 254 list of peripheral ids.
··· 248 - #address-cells : shall be 1 (reg is used to encode clk id). 249 - clocks : shall be the master clock phandle. 250 e.g. clocks = <&mck>; 251 + - name: device tree node describing a specific peripheral clock. 252 * #clock-cells : from common clock binding; shall be set to 0. 253 * reg: peripheral id. See Atmel's datasheets to get a full 254 list of peripheral ids.
+4 -4
drivers/clk/at91/clk-peripheral.c
··· 29 #define PERIPHERAL_RSHIFT_MASK 0x3 30 #define PERIPHERAL_RSHIFT(val) (((val) >> 16) & PERIPHERAL_RSHIFT_MASK) 31 32 - #define PERIPHERAL_MAX_SHIFT 4 33 34 struct clk_peripheral { 35 struct clk_hw hw; ··· 242 return *parent_rate; 243 244 if (periph->range.max) { 245 - for (; shift < PERIPHERAL_MAX_SHIFT; shift++) { 246 cur_rate = *parent_rate >> shift; 247 if (cur_rate <= periph->range.max) 248 break; ··· 254 255 best_diff = cur_rate - rate; 256 best_rate = cur_rate; 257 - for (; shift < PERIPHERAL_MAX_SHIFT; shift++) { 258 cur_rate = *parent_rate >> shift; 259 if (cur_rate < rate) 260 cur_diff = rate - cur_rate; ··· 289 if (periph->range.max && rate > periph->range.max) 290 return -EINVAL; 291 292 - for (shift = 0; shift < PERIPHERAL_MAX_SHIFT; shift++) { 293 if (parent_rate >> shift == rate) { 294 periph->auto_div = false; 295 periph->div = shift;
··· 29 #define PERIPHERAL_RSHIFT_MASK 0x3 30 #define PERIPHERAL_RSHIFT(val) (((val) >> 16) & PERIPHERAL_RSHIFT_MASK) 31 32 + #define PERIPHERAL_MAX_SHIFT 3 33 34 struct clk_peripheral { 35 struct clk_hw hw; ··· 242 return *parent_rate; 243 244 if (periph->range.max) { 245 + for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) { 246 cur_rate = *parent_rate >> shift; 247 if (cur_rate <= periph->range.max) 248 break; ··· 254 255 best_diff = cur_rate - rate; 256 best_rate = cur_rate; 257 + for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) { 258 cur_rate = *parent_rate >> shift; 259 if (cur_rate < rate) 260 cur_diff = rate - cur_rate; ··· 289 if (periph->range.max && rate > periph->range.max) 290 return -EINVAL; 291 292 + for (shift = 0; shift <= PERIPHERAL_MAX_SHIFT; shift++) { 293 if (parent_rate >> shift == rate) { 294 periph->auto_div = false; 295 periph->div = shift;
+10 -2
drivers/clk/at91/clk-pll.c
··· 173 int i = 0; 174 175 /* Check if parent_rate is a valid input rate */ 176 - if (parent_rate < characteristics->input.min || 177 - parent_rate > characteristics->input.max) 178 return -ERANGE; 179 180 /* ··· 185 mindiv = (parent_rate * PLL_MUL_MIN) / rate; 186 if (!mindiv) 187 mindiv = 1; 188 189 /* 190 * Calculate the maximum divider which is limited by PLL register
··· 173 int i = 0; 174 175 /* Check if parent_rate is a valid input rate */ 176 + if (parent_rate < characteristics->input.min) 177 return -ERANGE; 178 179 /* ··· 186 mindiv = (parent_rate * PLL_MUL_MIN) / rate; 187 if (!mindiv) 188 mindiv = 1; 189 + 190 + if (parent_rate > characteristics->input.max) { 191 + tmpdiv = DIV_ROUND_UP(parent_rate, characteristics->input.max); 192 + if (tmpdiv > PLL_DIV_MAX) 193 + return -ERANGE; 194 + 195 + if (tmpdiv > mindiv) 196 + mindiv = tmpdiv; 197 + } 198 199 /* 200 * Calculate the maximum divider which is limited by PLL register
+1 -1
drivers/clk/at91/pmc.h
··· 121 struct at91_pmc *pmc); 122 #endif 123 124 - #if defined(CONFIG_HAVE_AT91_SMD) 125 extern void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, 126 struct at91_pmc *pmc); 127 #endif
··· 121 struct at91_pmc *pmc); 122 #endif 123 124 + #if defined(CONFIG_HAVE_AT91_H32MX) 125 extern void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, 126 struct at91_pmc *pmc); 127 #endif