Exemplo n.º 1
0
static int musb_usb_remove(struct udevice *dev)
{
	struct musb_host_data *host = dev_get_priv(dev);
	struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;

	musb_stop(host->host);

	sunxi_usb_phy_exit(0);
#ifdef CONFIG_SUNXI_GEN_SUN6I
	clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0);
#endif
	clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0);

	free(host->host);
	host->host = NULL;

	return 0;
}
Exemplo n.º 2
0
static int ehci_usb_remove(struct udevice *dev)
{
	struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
	struct ehci_sunxi_priv *priv = dev_get_priv(dev);
	int ret;

	ret = ehci_deregister(dev);
	if (ret)
		return ret;

	sunxi_usb_phy_exit(priv->phy_index);

#ifdef CONFIG_SUNXI_GEN_SUN6I
	clrbits_le32(&ccm->ahb_reset0_cfg, priv->ahb_gate_mask);
#endif
	clrbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);

	return 0;
}