void omap_set_primary_brightness(u8 brightness) { u8 pmbr1; static int zoom_pwm1_config = 0; static int zoom_pwm1_output_enabled = 0; // printk("*######***enter [%s] (%d), brightness = %d\n", __FUNCTION__, __LINE__, brightness); if (zoom_pwm1_config == 0) { zoom_pwm_init(); zoom_pwm1_config = 1; } if (!brightness) { zoom_pwm_enable(0); zoom_pwm1_output_enabled = 0; zoom_pwm1_config = 0; return; } zoom_pwm_config(brightness); if (zoom_pwm1_output_enabled == 0) { zoom_pwm_enable(1); zoom_pwm1_output_enabled = 1; } }
// // times: always on -> 0, valid range -> 1-10, off -> -1 // void key_light_flash(int times) { static int init = 0; int i; gpio_t *gpio5_base = (gpio_t *)OMAP34XX_GPIO5_BASE; if (init == 0) { zoom_pwm_init(); if (times == 0) zoom_pwm_config(100); else zoom_pwm_config(40); init = 1; } if ((times < -1) || (times > 10)) return; /** Enable KEY_LIGHT_EN GPIO_140 **/ sr32((u32)&gpio5_base->oe, 12, 1, 0); zoom_pwm_enable(1); if (times == 0) { sr32((u32)&gpio5_base->setdataout, 12, 1, 1); return; } else if (times == -1) { sr32((u32)&gpio5_base->res2[0], 12, 1, 0); } else { for (i=0; i<times; i++) { sr32((u32)&gpio5_base->setdataout, 12, 1, 1); mdelay(300); sr32((u32)&gpio5_base->res2[0], 12, 1, 0); mdelay(300); } } zoom_pwm_enable(0); }// end of - key_light_flash -