Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bhnd/bhnd.c
Show First 20 Lines • Show All 628 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/** | /** | ||||
* Default bhnd(4) bus driver implementation of BHND_BUS_ENABLE_CLOCKS(). | * Default bhnd(4) bus driver implementation of BHND_BUS_ENABLE_CLOCKS(). | ||||
*/ | */ | ||||
int | int | ||||
bhnd_generic_enable_clocks(device_t dev, device_t child, uint32_t clocks) | bhnd_generic_enable_clocks(device_t dev, device_t child, uint32_t clocks) | ||||
{ | { | ||||
struct bhnd_softc *sc; | |||||
struct bhnd_core_clkctl *clkctl; | struct bhnd_core_clkctl *clkctl; | ||||
uint32_t avail; | uint32_t avail; | ||||
uint32_t req; | uint32_t req; | ||||
int error; | int error; | ||||
sc = device_get_softc(dev); | |||||
if (device_get_parent(child) != dev) | if (device_get_parent(child) != dev) | ||||
return (EINVAL); | return (EINVAL); | ||||
if ((clkctl = bhnd_get_pmu_info(child)) == NULL) | if ((clkctl = bhnd_get_pmu_info(child)) == NULL) | ||||
panic("no active PMU allocation"); | panic("no active PMU allocation"); | ||||
BHND_ASSERT_CLKCTL_AVAIL(clkctl); | BHND_ASSERT_CLKCTL_AVAIL(clkctl); | ||||
sc = device_get_softc(dev); | |||||
avail = 0x0; | avail = 0x0; | ||||
req = 0x0; | req = 0x0; | ||||
/* Build clock request flags */ | /* Build clock request flags */ | ||||
if (clocks & BHND_CLOCK_DYN) /* nothing to enable */ | if (clocks & BHND_CLOCK_DYN) /* nothing to enable */ | ||||
clocks &= ~BHND_CLOCK_DYN; | clocks &= ~BHND_CLOCK_DYN; | ||||
▲ Show 20 Lines • Show All 553 Lines • Show Last 20 Lines |