Exemplo n.º 1
0
/* brightness control */
static int sm5701_brightness_control(struct SM5701_leds_data *chip,
                          u8 brightness, enum sm5701_flash_mode flash_mode)
{
        switch (flash_mode) {
        case NONE_MODE:
                break;

        case FLASH_MODE:            
                sm5701_set_ifled(brightness);
		sm5701_set_fleden(SM5701_FLEDEN_ON_FLASH);
                break;

        case MOVIE_MODE:
                sm5701_set_imled(brightness);
		sm5701_set_fleden(SM5701_FLEDEN_ON_MOVIE);
                break;

        default:
                break;
        }
        
	if(0 == brightness)
		flash_mode = NONE_MODE;
	sm5701_led_ready(flash_mode);
        return flash_mode;
}
Exemplo n.º 2
0
/* chip initialize */
static int sm5701_chip_init(struct SM5701_leds_data *chip)
{
        int ret = 0;

        chip->br_movie = 0x9; //100mA
        sm5701_set_imled(chip->br_movie);

        chip->br_flash = 0x0C; //600mA
        sm5701_set_ifled(chip->br_flash);

        //sm5701_dump_register();

        //disable ABSTMR
        sm5701_set_enabstmr(0);

        return ret;
}
/* brightness control */
static int sm5701_brightness_control(struct SM5701_leds_data *chip,
                          u8 brightness, enum sm5701_flash_mode flash_mode)
{
        switch (flash_mode) {
        case NONE_MODE:
                break;

        case FLASH_MODE:            
                sm5701_set_ifled(brightness);
                break;

        case MOVIE_MODE:
                sm5701_set_imled(brightness);
                break;

        default:
                break;
        }
        
        return flash_mode;
}