tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / cpu / armv7 / sc8830 / vibrator_sc2723.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 #include <asm/arch/sprd_reg.h>
9
10 #define ANA_VIBRATOR_CTRL0_U      (ANA_REGS_GLB_BASE + 0xf8)
11
12 #define CUR_DRV_CAL_SEL_U       (0x0 << 12)
13 #define SLP_LDOVIBR_PD_EN_U     (0x1 << 9)
14 #define LDO_VIBR_PD_U   (0x1 << 8)
15 #define LDO_VIBR_V_U    (0xB4)
16
17 void set_vibrator(int on)
18 {
19 #if 0
20         if (on){
21                 ANA_REG_AND(ANA_VIBRATOR_CTRL0_U, ~LDO_VIBR_PD_U);
22                 ANA_REG_AND(ANA_VIBRATOR_CTRL0_U, ~SLP_LDOVIBR_PD_EN_U);
23                 }
24         else{
25                         ANA_REG_MSK_OR(ANA_VIBRATOR_CTRL0_U, LDO_VIBR_PD_U, LDO_VIBR_PD_U);
26                         ANA_REG_MSK_OR(ANA_VIBRATOR_CTRL0_U, SLP_LDOVIBR_PD_EN_U, SLP_LDOVIBR_PD_EN_U);
27                 }
28 #endif
29 }
30
31 void vibrator_hw_init(void)
32 {
33 #if 0
34         ANA_REG_OR(ANA_REG_GLB_RTC_CLK_EN, BIT_RTC_VIBR_EN);
35         ANA_REG_MSK_OR(ANA_VIBRATOR_CTRL0_U,CUR_DRV_CAL_SEL_U,CUR_DRV_CAL_SEL_U);
36         ANA_REG_MSK_OR(ANA_VIBRATOR_CTRL0_U,LDO_VIBR_V_U,LDO_VIBR_V_U);
37 #endif
38 }