Esempio n. 1
0
static int broadsheet_init(void)
{
    // Preflight the Broadsheet controller.  Note that, if any of the
    // the preflight checks fail, the preflighting process will
    // automatically put us into bootstrapping mode.
    //
    if ( BS_BOOTSTRAPPED() || !FB_INITED() )
        broadsheet_preflight();
    
    // Don't talk to the display, don't do power management, and don't
    // remember our state on reboot when we're being bootstrapped.
    //
    if ( BS_BOOTSTRAPPED() )
    {
        broadsheet_hal_ops.hal_update_display   = NULL;
        broadsheet_hal_ops.hal_update_area      = NULL;
        
        broadsheet_hal_ops.hal_set_power_level  = NULL;
        broadsheet_hal_ops.hal_get_power_level  = NULL;
        
        broadsheet_hal_ops.hal_reboot_hook      = NULL;
    }

    return ( einkfb_hal_ops_init(&broadsheet_hal_ops) );
}
Esempio n. 2
0
static int fslepdc_hal_init(void)
{
    // set up the waveform module parameter
    if (fslepdc_wf_to_use == NULL) {
	fslepdc_wf_to_use = kmalloc(EINK_WF_PATH_LEN, GFP_KERNEL);
	memset(fslepdc_wf_to_use, 0, EINK_WF_PATH_LEN);
    }

    // Preflight what's needed to bring up the FSLEPDC and the display, regardless
    // of whether we're bootstrapped or not.
    //
    // Note:  If some of the hardware doesn't come up, we can keep around the other
    //        hardware as the I/O is independent of each other.  The exit routine
    //        will still make the appropriates call to exit any of the hardware
    //        that did come up.
    //
    // If there's no PMIC available, there will be no video.  So, there's no reason
    // to do anything but go into bootstrapping mode in that case.
    //
    if ( !fslepdc_pmic_init() )
        BOOTSTRAP_FSLEPDC();

    // Verify that the epdc driver is available
    //
    if ( mxc_epdc_power_state(NULL) == MXC_EDPC_POWER_STATE_UNINITED )
        BOOTSTRAP_FSLEPDC();	
    
    // If there's no panel flash, a panel may or may not be available.
    //
    if ( !einkwf_panel_flash_present() )
    {
        // We'll be using the built-in waveform in this case...
        //
        strcpy(fslepdc_wf_to_use, EINK_WF_USE_BUILTIN_WAVEFORM);
        
        // ...so there's no reason to return that.  And, since we have no idea
        // what the panel is, we can't possibly accept a waveform to use.
        //
        fslepdc_hal_ops.hal_waveform_file_io        = NULL;
    }
        
    // If we're in bootstrapping mode (either by choice or circumstance), don't allow any
    // display updates or power management.
    //
    if ( FSLEPDC_BOOTSTRAPPED() )
    {
        fslepdc_hal_ops.hal_update_display          = NULL;
        fslepdc_hal_ops.hal_update_area             = NULL;
        
        fslepdc_hal_ops.hal_set_power_level         = NULL;
        fslepdc_hal_ops.hal_get_power_level         = NULL;
        
        fslepdc_hal_ops.hal_set_display_orientation = NULL;
        fslepdc_hal_ops.hal_get_display_orientation = NULL;
        
        // Also, disable other I/O as appropriate.
        //
        if ( !fslepdc_pmic_present() )
            fslepdc_hal_ops.hal_temperature_io      = NULL;
            
        if ( !einkwf_panel_flash_present() )
        {
            fslepdc_hal_ops.hal_waveform_version_io = NULL;
            fslepdc_hal_ops.hal_waveform_file_io    = NULL;
        }
    }

    return ( einkfb_hal_ops_init(&fslepdc_hal_ops) );
}