Lines Matching full:clkctl
365 struct bhnd_core_clkctl *clkctl; in bhnd_generic_alloc_pmu() local
381 clkctl = bhnd_get_pmu_info(child); in bhnd_generic_alloc_pmu()
385 if (clkctl != NULL) { in bhnd_generic_alloc_pmu()
445 /* Retain a PMU reference for the clkctl instance state */ in bhnd_generic_alloc_pmu()
467 /* Allocate the clkctl instance */ in bhnd_generic_alloc_pmu()
468 clkctl = bhnd_alloc_core_clkctl(child, pmu_dev, r, pmu_regs, in bhnd_generic_alloc_pmu()
470 if (clkctl == NULL) { in bhnd_generic_alloc_pmu()
476 bhnd_set_pmu_info(child, clkctl); in bhnd_generic_alloc_pmu()
486 struct bhnd_core_clkctl *clkctl; in bhnd_generic_release_pmu() local
495 clkctl = bhnd_get_pmu_info(child); in bhnd_generic_release_pmu()
496 if (clkctl == NULL) in bhnd_generic_release_pmu()
500 * RESET. Suspending a core clears clkctl automatically (and attempting in bhnd_generic_release_pmu()
503 if (!bhnd_is_hw_suspended(clkctl->cc_dev)) { in bhnd_generic_release_pmu()
504 BHND_CLKCTL_LOCK(clkctl); in bhnd_generic_release_pmu()
507 BHND_CLKCTL_SET_4(clkctl, 0x0, BHND_CCS_FORCE_MASK | in bhnd_generic_release_pmu()
510 BHND_CLKCTL_UNLOCK(clkctl); in bhnd_generic_release_pmu()
516 /* Before freeing the clkctl instance, save a pointer to resources we in bhnd_generic_release_pmu()
518 r = clkctl->cc_res; in bhnd_generic_release_pmu()
519 pmu_dev = clkctl->cc_pmu_dev; in bhnd_generic_release_pmu()
521 /* Free the clkctl instance */ in bhnd_generic_release_pmu()
522 bhnd_free_core_clkctl(clkctl); in bhnd_generic_release_pmu()
540 struct bhnd_core_clkctl *clkctl; in bhnd_generic_get_clock_latency() local
545 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_get_clock_latency()
548 return (bhnd_pmu_get_clock_latency(clkctl->cc_pmu_dev, clock, latency)); in bhnd_generic_get_clock_latency()
558 struct bhnd_core_clkctl *clkctl; in bhnd_generic_get_clock_freq() local
563 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_get_clock_freq()
566 return (bhnd_pmu_get_clock_freq(clkctl->cc_pmu_dev, clock, freq)); in bhnd_generic_get_clock_freq()
575 struct bhnd_core_clkctl *clkctl; in bhnd_generic_request_clock() local
583 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_request_clock()
586 BHND_ASSERT_CLKCTL_AVAIL(clkctl); in bhnd_generic_request_clock()
607 device_get_nameunit(clkctl->cc_dev), clock); in bhnd_generic_request_clock()
611 BHND_CLKCTL_LOCK(clkctl); in bhnd_generic_request_clock()
614 BHND_CLKCTL_SET_4(clkctl, req, BHND_CCS_FORCE_MASK); in bhnd_generic_request_clock()
617 error = bhnd_core_clkctl_wait(clkctl, avail, avail); in bhnd_generic_request_clock()
619 BHND_CLKCTL_UNLOCK(clkctl); in bhnd_generic_request_clock()
630 struct bhnd_core_clkctl *clkctl; in bhnd_generic_enable_clocks() local
638 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_enable_clocks()
641 BHND_ASSERT_CLKCTL_AVAIL(clkctl); in bhnd_generic_enable_clocks()
668 device_get_nameunit(clkctl->cc_dev), clocks); in bhnd_generic_enable_clocks()
672 BHND_CLKCTL_LOCK(clkctl); in bhnd_generic_enable_clocks()
675 BHND_CLKCTL_SET_4(clkctl, req, BHND_CCS_AREQ_MASK); in bhnd_generic_enable_clocks()
678 error = bhnd_core_clkctl_wait(clkctl, avail, avail); in bhnd_generic_enable_clocks()
680 BHND_CLKCTL_UNLOCK(clkctl); in bhnd_generic_enable_clocks()
691 struct bhnd_core_clkctl *clkctl; in bhnd_generic_request_ext_rsrc() local
699 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_request_ext_rsrc()
702 BHND_ASSERT_CLKCTL_AVAIL(clkctl); in bhnd_generic_request_ext_rsrc()
710 BHND_CLKCTL_LOCK(clkctl); in bhnd_generic_request_ext_rsrc()
713 BHND_CLKCTL_SET_4(clkctl, req, req); in bhnd_generic_request_ext_rsrc()
716 error = bhnd_core_clkctl_wait(clkctl, avail, avail); in bhnd_generic_request_ext_rsrc()
718 BHND_CLKCTL_UNLOCK(clkctl); in bhnd_generic_request_ext_rsrc()
729 struct bhnd_core_clkctl *clkctl; in bhnd_generic_release_ext_rsrc() local
735 if ((clkctl = bhnd_get_pmu_info(child)) == NULL) in bhnd_generic_release_ext_rsrc()
738 BHND_ASSERT_CLKCTL_AVAIL(clkctl); in bhnd_generic_release_ext_rsrc()
746 BHND_CLKCTL_LOCK(clkctl); in bhnd_generic_release_ext_rsrc()
747 BHND_CLKCTL_SET_4(clkctl, 0x0, mask); in bhnd_generic_release_ext_rsrc()
748 BHND_CLKCTL_UNLOCK(clkctl); in bhnd_generic_release_ext_rsrc()