int reciva_lcd_init(const struct reciva_lcd_driver *d, int height, int width) { int i, iErr; int charmap_length = 50; //XXX this is a guess but shouldn't be too bad driver = d; iHeight = height; iWidth = width; init_timer (&bl_timer); bl_timer.function = bl_timer_func; /* Initialise LCD */ driver->init_hardware(); /* Register the device */ misc_register (&lcd_miscdev); iErr = alloc_arrays(); if (iErr < 0) return iErr; /* Set up charmap hashtable */ utf8_to_char = rutl_new_hashtable(charmap_length); if (!utf8_to_char) { free_arrays(); return -ENOMEM; } i = 0; while (d->charmap[i].pcUTF8Rep) { rutl_hashtable_put(utf8_to_char, d->charmap[i].pcUTF8Rep, d->charmap[i].cLocalRep); ++i; } vDrawGreetingFrame(1); #ifdef LCD_PROFILING if (profiling) do_profiling(); #endif printk("RLCD:%s module: loaded\n", driver->name); if (driver->get_max_backlight) bl_level_max=driver->get_max_backlight(); else bl_level_max = BL_DEFAULT_MAX_BACKLIGHT; /* If backlight level is not specified as module param then set to max */ if (lcd_backlight_level < 0 || lcd_backlight_level > bl_level_max) lcd_backlight_level = bl_level_max; if (driver->set_backlight) reciva_lcd_set_backlight (lcd_backlight_level); #ifdef LCD_DEBUG if (driver->test_pattern) { driver->test_pattern(); } #endif /* handle changing text during module startup */ if (strcmp(line1frame1, line1frame2) || strcmp(line2frame1, line2frame2) || strcmp(line3frame1, line3frame2) || strcmp(line4frame1, line4frame2)) { init_MUTEX(&start_thread_sem); i = kernel_thread(iGreetingFrameThread, (void *)0, 0); if (i >= 0) { tGreetingFramePid = i; /* Wait for thread to finish init */ down(&start_thread_sem); } } return 0; }
int main(void) { const int sizes[] = {70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130}; do_profiling(sizes, sizeof(sizes)/sizeof(int)); return EXIT_SUCCESS; }