Lines Matching full:usb
47 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_clk_usb_recalc_rate() local
51 regmap_read(usb->regmap, AT91_PMC_USB, &usbr); in at91sam9x5_clk_usb_recalc_rate()
113 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_clk_usb_set_parent() local
115 if (index >= usb->num_parents) in at91sam9x5_clk_usb_set_parent()
118 regmap_update_bits(usb->regmap, AT91_PMC_USB, usb->usbs_mask, index); in at91sam9x5_clk_usb_set_parent()
125 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_clk_usb_get_parent() local
128 regmap_read(usb->regmap, AT91_PMC_USB, &usbr); in at91sam9x5_clk_usb_get_parent()
130 return usbr & usb->usbs_mask; in at91sam9x5_clk_usb_get_parent()
136 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_clk_usb_set_rate() local
146 regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_OHCIUSBDIV, in at91sam9x5_clk_usb_set_rate()
154 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_usb_save_context() local
157 usb->pms.parent = at91sam9x5_clk_usb_get_parent(hw); in at91sam9x5_usb_save_context()
158 usb->pms.parent_rate = clk_hw_get_rate(parent_hw); in at91sam9x5_usb_save_context()
159 usb->pms.rate = at91sam9x5_clk_usb_recalc_rate(hw, usb->pms.parent_rate); in at91sam9x5_usb_save_context()
166 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9x5_usb_restore_context() local
169 ret = at91sam9x5_clk_usb_set_parent(hw, usb->pms.parent); in at91sam9x5_usb_restore_context()
173 at91sam9x5_clk_usb_set_rate(hw, usb->pms.rate, usb->pms.parent_rate); in at91sam9x5_usb_restore_context()
188 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9n12_clk_usb_enable() local
190 regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, in at91sam9n12_clk_usb_enable()
198 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9n12_clk_usb_disable() local
200 regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, 0); in at91sam9n12_clk_usb_disable()
205 struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); in at91sam9n12_clk_usb_is_enabled() local
208 regmap_read(usb->regmap, AT91_PMC_USB, &usbr); in at91sam9n12_clk_usb_is_enabled()
227 struct at91sam9x5_clk_usb *usb; in _at91sam9x5_clk_register_usb() local
232 usb = kzalloc(sizeof(*usb), GFP_KERNEL); in _at91sam9x5_clk_register_usb()
233 if (!usb) in _at91sam9x5_clk_register_usb()
243 usb->hw.init = &init; in _at91sam9x5_clk_register_usb()
244 usb->regmap = regmap; in _at91sam9x5_clk_register_usb()
245 usb->usbs_mask = usbs_mask; in _at91sam9x5_clk_register_usb()
246 usb->num_parents = num_parents; in _at91sam9x5_clk_register_usb()
248 hw = &usb->hw; in _at91sam9x5_clk_register_usb()
249 ret = clk_hw_register(NULL, &usb->hw); in _at91sam9x5_clk_register_usb()
251 kfree(usb); in _at91sam9x5_clk_register_usb()
278 struct at91sam9x5_clk_usb *usb; in at91sam9n12_clk_register_usb() local
283 usb = kzalloc(sizeof(*usb), GFP_KERNEL); in at91sam9n12_clk_register_usb()
284 if (!usb) in at91sam9n12_clk_register_usb()
293 usb->hw.init = &init; in at91sam9n12_clk_register_usb()
294 usb->regmap = regmap; in at91sam9n12_clk_register_usb()
296 hw = &usb->hw; in at91sam9n12_clk_register_usb()
297 ret = clk_hw_register(NULL, &usb->hw); in at91sam9n12_clk_register_usb()
299 kfree(usb); in at91sam9n12_clk_register_usb()
309 struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); in at91rm9200_clk_usb_recalc_rate() local
313 regmap_read(usb->regmap, AT91_CKGR_PLLBR, &pllbr); in at91rm9200_clk_usb_recalc_rate()
316 if (usb->divisors[usbdiv]) in at91rm9200_clk_usb_recalc_rate()
317 return parent_rate / usb->divisors[usbdiv]; in at91rm9200_clk_usb_recalc_rate()
325 struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); in at91rm9200_clk_usb_round_rate() local
336 if (!usb->divisors[i]) in at91rm9200_clk_usb_round_rate()
339 tmp_parent_rate = rate * usb->divisors[i]; in at91rm9200_clk_usb_round_rate()
341 tmprate = DIV_ROUND_CLOSEST(tmp_parent_rate, usb->divisors[i]); in at91rm9200_clk_usb_round_rate()
364 struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); in at91rm9200_clk_usb_set_rate() local
373 if (usb->divisors[i] == div) { in at91rm9200_clk_usb_set_rate()
374 regmap_update_bits(usb->regmap, AT91_CKGR_PLLBR, in at91rm9200_clk_usb_set_rate()
395 struct at91rm9200_clk_usb *usb; in at91rm9200_clk_register_usb() local
400 usb = kzalloc(sizeof(*usb), GFP_KERNEL); in at91rm9200_clk_register_usb()
401 if (!usb) in at91rm9200_clk_register_usb()
410 usb->hw.init = &init; in at91rm9200_clk_register_usb()
411 usb->regmap = regmap; in at91rm9200_clk_register_usb()
412 memcpy(usb->divisors, divisors, sizeof(usb->divisors)); in at91rm9200_clk_register_usb()
414 hw = &usb->hw; in at91rm9200_clk_register_usb()
415 ret = clk_hw_register(NULL, &usb->hw); in at91rm9200_clk_register_usb()
417 kfree(usb); in at91rm9200_clk_register_usb()