Esempio n. 1
0
static void broadsheet_remove_proc_entries(void)
{
    struct einkfb_info info; einkfb_get_info(&info);
    
    // Remove Broadsheet-specific proc entries.
    //
    einkfb_remove_proc_entry(EINKFB_PROC_WAVEFORM_VERSION, einkfb_proc_waveform_version);
    einkfb_remove_proc_entry(EINKFB_PROC_COMMANDS_VERSION, einkfb_proc_commands_version);
    einkfb_remove_proc_entry(EINKFB_PROC_RECENT_COMMANDS, einkfb_proc_recent_commands);
    einkfb_remove_proc_entry(EINKFB_PROC_TEMPERATURE, einkfb_proc_temperature);
    einkfb_remove_proc_entry(EINKFB_PROC_HARDWAREFB, einkfb_proc_hardwarefb);
    einkfb_remove_proc_entry(EINKFB_PROC_EINK_RAM, einkfb_proc_eink_ram);
    einkfb_remove_proc_entry(EINKFB_PROC_EINK_REG, einkfb_proc_eink_reg);

    if ( broadsheet_supports_flash() )
        einkfb_remove_proc_entry(EINKFB_PROC_EINK_ROM, einkfb_proc_eink_rom);
    
    // Remove Broadsheet-specific sysfs entries.
    //
    device_remove_file(&info.dev->dev, &dev_attr_eink_ram_select);
    device_remove_file(&info.dev->dev, &dev_attr_ignore_hw_ready);
    device_remove_file(&info.dev->dev, &dev_attr_force_hw_not_ready);
    device_remove_file(&info.dev->dev, &dev_attr_override_upd_mode);
    device_remove_file(&info.dev->dev, &dev_attr_promote_flashing_updates); 
    device_remove_file(&info.dev->dev, &dev_attr_preflight_failure);
    device_remove_file(&info.dev->dev, &dev_attr_image_timings);
    
    if ( broadsheet_supports_flash() )
    {
        device_remove_file(&info.dev->dev, &dev_attr_eink_rom_is_flash);
        device_remove_file(&info.dev->dev, &dev_attr_eink_rom_select);
    }
    
    if ( broadsheet_supports_panel_bcd() )
        device_remove_file(&info.dev->dev, &dev_attr_panel_bcd);

    if ( broadsheet_supports_panel_id() )
        device_remove_file(&info.dev->dev, &dev_attr_panel_id);

    if ( broadsheet_supports_vcom() )
        device_remove_file(&info.dev->dev, &dev_attr_vcom);

    // External proc/sysfs entries.
    //
    if ( broadsheet_supports_eeprom_read() )
        broadsheet_eeprom_remove_proc_enteries();

    if ( BS_HAS_PMIC() )
        bs_pmic_remove_proc_enteries();
}
Esempio n. 2
0
static void fslepdc_update_display_buffer(fx_type update_mode, u8 *buffer)
{
    update_area_t update_area;
    struct einkfb_info info;
    einkfb_get_info(&info);
    
    update_area.x1 = 0;
    update_area.y1 = 0;
    update_area.x2 = info.xres;
    update_area.y2 = info.yres;
    
    update_area.which_fx = update_mode;
    update_area.buffer = (NULL == buffer) ? info.start : buffer;
    
    fslepdc_update_area(&update_area);
}
Esempio n. 3
0
static void fslepdc_update_area(update_area_t *update_area)
{
    int is_MU = 0;

    if ( einkfb_power_level_on == fslepdc_power_level )
    {
        fx_type update_mode = update_area->which_fx;
        u8 *data = update_area->buffer;

        if ( fx_display_sync == update_mode )
        {
            fslepdc_sync();
            data = NULL;
        }
    
        if ( data || UPDATE_MODE_BUFFER_DISPLAY(update_mode) )
        {
            bool    skip_buffer_display = false,
                    skip_buffer_load    = false,
                    flashing_update     = false, 
                    area_update         = false;
            u32     waveform_mode       = fslepdc_get_waveform_mode(WF_UPD_MODE_GC);
            
            struct mxcfb_update_data update_data;
            struct mxcfb_rect dirty_rect;
            struct einkfb_info info;

	    cancel_rearming_delayed_work(&fslepdc_repair_work);
            
            fslepdc_set_ld_img_start = jiffies;
            
            fsledpc_init_update_data(&update_data);
            einkfb_get_info(&info);
        
            update_data.update_region.left   = update_area->x1;
            update_data.update_region.top    = update_area->y1;
            update_data.update_region.width  = update_area->x2 - update_area->x1;
            update_data.update_region.height = update_area->y2 - update_area->y1; ;
            
            if ( (info.xres == update_data.update_region.width) && (info.yres == update_data.update_region.height) )
                area_update = false;
            else
                area_update = true;
            
            switch ( update_mode )
            {
                // Just load up the hardware's buffer; don't display it.
                //
                case fx_buffer_load:
                    skip_buffer_display = true;
                break;
        
                // Just display what's already in the hardware buffer; don't reload it.
                //
                case fx_buffer_display_partial:
                case fx_buffer_display_full:
                    skip_buffer_load = true;
                goto set_update_mode;
        
                // Regardless of what gets put into the hardware's buffer,
                // only update the black and white pixels.
                //
                case fx_update_fast:
                  waveform_mode = fslepdc_get_waveform_mode(WF_UPD_MODE_PU);
                  is_MU = is_MU_skip;
                goto set_update_mode;
        
                // Regardless of what gets put into the hardware's buffer,
                // use white transition update.
                //
                case fx_update_white_trans:
                  waveform_mode = fslepdc_get_waveform_mode(WF_UPD_MODE_GLF);
                  is_MU = is_MU_skip;
                goto set_update_mode;
                    
                // Regardless of what gets put into the hardware's buffer,
                // refresh all pixels as cleanly as possible.
                //
                case fx_update_slow:
                  waveform_mode = fslepdc_get_waveform_mode(WF_UPD_MODE_GC);
                  is_MU = is_MU_skip;
                /* goto set_update_mode; */
                    
                set_update_mode:
                default:
                    
                    // Normalize to either flashing or non-flashing.
                    //
                    update_mode     = area_update     ? UPDATE_AREA_MODE(update_mode)
                                                      : UPDATE_MODE(update_mode);
                    
                    // Simplify that.
                    //
                    flashing_update = UPDATE_FULL(update_mode);

                    // Don't use DU/MU for flashing updates
                    is_MU = flashing_update ? is_MU_skip : is_MU;

                    // Convert to the MXC EPDC's scheme.
                    //
                    update_mode     = flashing_update ? UPDATE_MODE_FULL
                                                      : UPDATE_MODE_PARTIAL;
                break;
            }
    
            // Process and load the image data if we should.
            //
            fslepdc_ld_img_start = jiffies;
           
	    if (!skip_buffer_load)
	    {
                // Check to see whether we can force an MU or not.
                //
                if (mxc_epdc_blit_to_fb(data, &update_data.update_region, &dirty_rect))
                {
                        // In the fx_update_fast & fx_update_slow cases, we want very
                        // specific waveform modes.  So, in those cases, we don't
                        // want to force an MU, even if we can.
                        //
                        if (0 == is_MU)
                                is_MU = 1;

                }
            }

            // Skip the forced MU when we should.
            //
            if (is_MU_skip == is_MU)
                is_MU = 0;

            // Update the display in the specified way if we should.
            //
            fslepdc_upd_data_start = jiffies;

            if ( !skip_buffer_display )
            {
                // If this is a flashing or a full-screen update, wait until
                // the last update completes before sending a new one.
                //
                if ( flashing_update || !area_update ) {
			if (fslepdc_repair_x1 && fslepdc_repair_y1 && 
				((fslepdc_repair_y2 - fslepdc_repair_y1) <= 300) &&
				((fslepdc_repair_x2 - fslepdc_repair_x1) <= 300) )
			{
				/* Do Nothing */
			}
			else {
				if ( (fslepdc_var.xres == (fslepdc_repair_x2 - fslepdc_repair_x1)) &&
					(fslepdc_var.yres == (fslepdc_repair_y2 - fslepdc_repair_y1)) ){
						/* Do Nothing */
				}
				else 
					fslepdc_sync();
			}
		}
                
                // Set up to perform the specified update type, marking it pseudo-uniquely.  Also,
                // if we're using the built-in waveform, which is 25C-only, don't even bother
                // using the cached temperature since it won't be used anyway.
                //
    
                update_data.update_mode   = update_mode;
                update_data.temp          = fslepdc_using_builtin_waveform() ? TEMP_USE_AMBIENT
                                                                             : fslepdc_read_temperature();

                // Send the update itself.
                //
		if (is_MU)
			update_data.waveform_mode = WF_UPD_MODE_MU;
		else
			update_data.waveform_mode = waveform_mode;

		fslepdc_last_update_marker++;
		update_data.update_marker = fslepdc_last_update_marker;
			
		/* repair logic */
		if (!fslepdc_repair_count ) {
			fslepdc_repair_x1 = update_data.update_region.left;
			fslepdc_repair_y1 = update_data.update_region.top;
			fslepdc_repair_x2 = fslepdc_repair_x1 + update_data.update_region.width;
			fslepdc_repair_y2 = fslepdc_repair_y1 + update_data.update_region.height;

			fslepdc_repair_count++;
		}
		else {
			fslepdc_repair_x1 = min(update_data.update_region.left, fslepdc_repair_x1);
			fslepdc_repair_y1 = min(update_data.update_region.top, fslepdc_repair_y1);
			fslepdc_repair_x2 = max((update_data.update_region.left +
					update_data.update_region.width), fslepdc_repair_x2);

			fslepdc_repair_y2 = max((update_data.update_region.top +
					update_data.update_region.height), fslepdc_repair_y2);
			fslepdc_repair_count++;
		}

		fslepdc_send_update(&update_data, FSLEPDC_UPDATE_NEW);
		if (UPDATE_MODE_FULL == update_data.update_mode) {
			fslepdc_repair_count = 0;
		}
		else {
			schedule_delayed_work(&fslepdc_repair_work, msecs_to_jiffies(1000));
		}
	}

	fslepdc_image_stop_time = jiffies;
    
	fslepdc_image_start_time = jiffies_to_msecs(fslepdc_set_ld_img_start - info.jif_on);
	fslepdc_image_processing_time = jiffies_to_msecs(fslepdc_ld_img_start - fslepdc_set_ld_img_start);
	fslepdc_image_loading_time = jiffies_to_msecs(fslepdc_upd_data_start - fslepdc_ld_img_start);
	fslepdc_image_display_time = jiffies_to_msecs(fslepdc_image_stop_time  - fslepdc_upd_data_start);
	fslepdc_image_stop_time = jiffies_to_msecs(fslepdc_image_stop_time  - info.jif_on);
        }
    }
}
Esempio n. 4
0
static void broadsheet_create_proc_entries(void)
{
    struct einkfb_info info; einkfb_get_info(&info);

    // Create Broadsheet-specific proc entries.
    //
    einkfb_proc_waveform_version = einkfb_create_proc_entry(EINKFB_PROC_WAVEFORM_VERSION, EINKFB_PROC_CHILD_R,
        waveform_version_read, NULL);
    
    einkfb_proc_commands_version = einkfb_create_proc_entry(EINKFB_PROC_COMMANDS_VERSION, EINKFB_PROC_CHILD_R,
        commands_version_read, NULL);
    
    einkfb_proc_recent_commands = einkfb_create_proc_entry(EINKFB_PROC_RECENT_COMMANDS, EINKFB_PROC_CHILD_R,
        recent_commands_read, NULL);

    einkfb_proc_temperature = einkfb_create_proc_entry(EINKFB_PROC_TEMPERATURE, EINKFB_PROC_CHILD_R,
        temperature_read, temperature_write);

    einkfb_proc_hardwarefb = einkfb_create_proc_entry(EINKFB_PROC_HARDWAREFB, EINKFB_PROC_CHILD_R,
        hardwarefb_read, NULL);
        
    einkfb_proc_eink_ram = einkfb_create_proc_entry(EINKFB_PROC_EINK_RAM, EINKFB_PROC_CHILD_RW,
        eink_ram_read, eink_ram_write);
        
    einkfb_proc_eink_reg = einkfb_create_proc_entry(EINKFB_PROC_EINK_REG, EINKFB_PROC_CHILD_W,
        NULL, eink_reg_write);

    if ( broadsheet_supports_flash() )
        einkfb_proc_eink_rom = einkfb_create_proc_entry(EINKFB_PROC_EINK_ROM, 
            (broadsheet_flash_is_readonly() ? EINKFB_PROC_CHILD_R
                                            : EINKFB_PROC_CHILD_RW),
            eink_rom_read, eink_rom_write);
    
    // Create Broadsheet-specific sysfs entries.
    //
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_eink_ram_select);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_ignore_hw_ready);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_force_hw_not_ready);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_override_upd_mode);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_promote_flashing_updates);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_preflight_failure);
    FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_image_timings);
    
    if ( broadsheet_supports_flash() )
    {
        FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_eink_rom_is_flash);
        FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_eink_rom_select);
    }
    
    if ( broadsheet_supports_panel_bcd() )
        FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_panel_bcd);    
    
    if ( broadsheet_supports_panel_id() )
        FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_panel_id);
        
    if ( broadsheet_supports_vcom() )
        FB_DEVICE_CREATE_FILE(&info.dev->dev, &dev_attr_vcom);
        
    // External proc/sysfs entries.
    //
    if ( broadsheet_supports_eeprom_read() )
        broadsheet_eeprom_create_proc_enteries();

    if ( BS_HAS_PMIC() )
        bs_pmic_create_proc_enteries();
}