mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
aw869x: set config explicitly
Use explicit boost and PWM clock mode configuration Change-Id: Icaa1e0e0496b29cac522b31e84c71dbacccae94d Signed-off-by: Konstantin Makariev <hcv867@motorola.com> Reviewed-on: https://gerrit.mot.com/1208943 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
4d34365898
commit
775bfee7af
2 changed files with 15 additions and 6 deletions
|
|
@ -1059,8 +1059,8 @@ static int aw869x_haptic_init(struct aw869x *aw869x)
|
|||
aw869x_i2c_write_bits(aw869x, AW869X_REG_SYSCTRL,
|
||||
AW869X_BIT_SYSCTRL_WORK_MODE_MASK, AW869X_BIT_SYSCTRL_STANDBY);
|
||||
aw869x_i2c_write(aw869x, AW869X_REG_ANACTRL, 0x01);
|
||||
//aw869x_i2c_write(aw869x, AW869X_REG_PWMDBG, 0x41); // 24K PWM
|
||||
|
||||
//aw869x_i2c_write_bits(aw869x, AW869X_REG_PWMDBG,
|
||||
// AW869X_BIT_PWMDBG_PWMCLK_MODE_MASK, AW869X_BIT_PWMDBG_PWMCLK_MODE_24KB);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1096,8 +1096,10 @@ static void vibrator_enable( struct timed_output_dev *dev, int value)
|
|||
|
||||
if (value > 0) {
|
||||
if (value < 100) {
|
||||
aw869x_i2c_write(aw869x, AW869X_REG_PWMDBG, 0x61); // 48K PWM
|
||||
aw869x_haptic_set_bst_vol(aw869x, 0x5d);
|
||||
aw869x_i2c_write_bits(aw869x, AW869X_REG_PWMDBG,
|
||||
AW869X_BIT_PWMDBG_PWMCLK_MODE_MASK, AW869X_BIT_PWMDBG_PWMCLK_MODE_12KB);
|
||||
aw869x_haptic_set_bst_vol(aw869x, AW869X_BIT_BSTCFG_BSTVOL_8P75V);
|
||||
aw869x_haptic_set_peak_cur(aw869x, AW869X_BIT_BSTCFG_PEAKCUR_3P5A);
|
||||
aw869x_haptic_set_gain(aw869x, 0x20);
|
||||
aw869x->seq = 0x01000000;
|
||||
aw869x_haptic_set_que_seq(aw869x, aw869x->seq);
|
||||
|
|
@ -1110,8 +1112,9 @@ static void vibrator_enable( struct timed_output_dev *dev, int value)
|
|||
ns_to_ktime((u64)value * NSEC_PER_MSEC), HRTIMER_MODE_REL);
|
||||
*/
|
||||
} else {
|
||||
aw869x_i2c_write(aw869x, AW869X_REG_PWMDBG, 0x61); // 12K PWM
|
||||
aw869x_haptic_set_bst_vol(aw869x, 0x01);
|
||||
aw869x_i2c_write_bits(aw869x, AW869X_REG_PWMDBG,
|
||||
AW869X_BIT_PWMDBG_PWMCLK_MODE_MASK, AW869X_BIT_PWMDBG_PWMCLK_MODE_12KB);
|
||||
aw869x_haptic_set_bst_vol(aw869x, AW869X_BIT_BSTCFG_BSTVOL_6P25V);
|
||||
aw869x_haptic_set_gain(aw869x, 0x0e);
|
||||
aw869x->duration = value;
|
||||
/* wav index config */
|
||||
|
|
|
|||
|
|
@ -285,4 +285,10 @@ const unsigned char aw869x_reg_access[AW869X_REG_MAX]={
|
|||
#define AW869X_BIT_BSTCFG_PEAKCUR_2A (1<<0)
|
||||
#define AW869X_BIT_BSTCFG_PEAKCUR_1P5A (0<<0)
|
||||
|
||||
// PWMDBG
|
||||
#define AW869X_BIT_PWMDBG_PWMCLK_MODE_MASK (~(3<<5))
|
||||
#define AW869X_BIT_PWMDBG_PWMCLK_MODE_12KB (3<<5)
|
||||
#define AW869X_BIT_PWMDBG_PWMCLK_MODE_21KB (2<<5)
|
||||
#define AW869X_BIT_PWMDBG_PWMCLK_MODE_48KB (0<<5)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue