FreeBSD/sys/dev/bhnd/bhndb/bhndb_pci.c
/**
 * Disable externally managed clocks, if required.
 * 
 * @param sc Bridge driver state.
 */
Disable externally managed clocks, if required.

@param sc Bridge driver state.
Disable externally managed clocks if required . @param sc Bridge driver state .
static int
bhndb_disable_pci_clocks(struct bhndb_pci_softc *sc)
{
	uint32_t	gpio_out, gpio_en;
	if (sc->pci_devclass != BHND_DEVCLASS_PCI)
		return (0);
	gpio_out = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUT, 4);
	gpio_en = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, 4);
	gpio_out &= ~BHNDB_PCI_GPIO_XTAL_ON;
	gpio_out |= BHNDB_PCI_GPIO_PLL_OFF;
	pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4);
	gpio_en |= (BHNDB_PCI_GPIO_PLL_OFF|BHNDB_PCI_GPIO_XTAL_ON);
	pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, gpio_en, 4);
	return (0);
}
static int bhndb_disable_pci_clocks ( struct bhndb_pci_softc * sc ) { uint32_t gpio_out , gpio_en ; if ( sc -> pci_devclass != BHND_DEVCLASS_PCI ) return ( 0 ) ; gpio_out = pci_read_config ( sc -> parent , BHNDB_PCI_GPIO_OUT , 4 ) ; gpio_en = pci_read_config ( sc -> parent , BHNDB_PCI_GPIO_OUTEN , 4 ) ; gpio_out &= ~ BHNDB_PCI_GPIO_XTAL_ON ; gpio_out |= BHNDB_PCI_GPIO_PLL_OFF ; pci_write_config ( sc -> parent , BHNDB_PCI_GPIO_OUT , gpio_out , 4 ) ; gpio_en |= ( BHNDB_PCI_GPIO_PLL_OFF | BHNDB_PCI_GPIO_XTAL_ON ) ; pci_write_config ( sc -> parent , BHNDB_PCI_GPIO_OUTEN , gpio_en , 4 ) ; return ( 0 ) ; }
Disable externally managed clocks, if required.
Disable externally managed clocks if required .
/* Only supported and required on PCI devices */ /* Fetch current config */ /* Set PLL_OFF to HIGH, XTAL_ON to LOW. */ /* Enable both output pins */