Beispiel #1
0
static int m7400_attrib_write(struct device *dev, int value)
{
    struct tegra_bb_pdata *pdata;
    static struct platform_device *ehci_device;
    static bool first_enum = true;

    if (value > 1 || (!ehci_registered && !value)) {
        /* Supported values are 0/1. */
        return -1;
    }

    pdata = (struct tegra_bb_pdata *) dev->platform_data;
    if (value) {

        /* Check readiness for enumeration */
        if (first_enum)
            first_enum = false;
        else
            m7400_enum_handshake();

        /* Register ehci controller */
        ehci_device = pdata->ehci_register();
        if (ehci_device == NULL) {
            pr_info("%s - Error: ehci register failed.\n",
                    __func__);
            return -1;
        }

        /* Customize PHY setup/callbacks */
        m7400_ehci_customize(ehci_device);

        ehci_registered = true;
    } else {
        /* Unregister ehci controller */
        if (ehci_device != NULL)
            pdata->ehci_unregister(&ehci_device);

        /* Signal AP going down */
        m7400_apdown_handshake();
        ehci_registered = false;
    }

    return 0;
}
Beispiel #2
0
static void m7400_l3_suspend(void)
{
    m7400_apdown_handshake();
    modem_status = BBSTATE_L3;
}
static void m7400_l3_suspend(void)
{
	m7400_apdown_handshake();
}