tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / cpu / arm926ejs / sc8800g / vibrator.c
1 #include <config.h>
2 #include <asm/io.h>
3 #include <asm/arch/chip_drv_config_extern.h>
4 #include <asm/arch/bits.h>
5 #include <linux/types.h>
6 #include <asm/arch/regs_adi.h>
7 #include <asm/arch/adi_hal_internal.h>
8 #define VIBRATOR_LEVEL (3)
9 void set_vibrator(int on)
10 {
11     if(on == 0){
12         ANA_REG_AND(VIBR_CTL, ~(VIBR_PD_SET | VIBR_PD_RST));
13         ANA_REG_OR(VIBR_CTL, VIBR_PD_SET);
14     }else{
15         ANA_REG_AND(VIBR_CTL, ~(VIBR_PD_SET | VIBR_PD_RST));
16         ANA_REG_OR(VIBR_CTL, (VIBRATOR_LEVEL << VIBR_V_SHIFT) & VIBR_V_MSK);
17         ANA_REG_OR(VIBR_CTL, VIBR_PD_RST);
18     }
19 }
20