static void set_pmic_vibrator(int on) { if (on){ pmic_vib_mot_set_polarity(PM_VIB_MOT_POL__ACTIVE_LOW); pmic_vib_mot_set_mode(PM_VIB_MOT_MODE__DBUS2); pmic_vib_mot_set_volt(PMIC_VIBRATOR_ON_LEV); }else{ pmic_vib_mot_set_volt(0); } }
static void set_pmic_vibrator(int on) { mutex_lock(&sh_vibrator_pmic_mutex); if (on){ pmic_vib_mot_set_polarity(PM_VIB_MOT_POL__ACTIVE_LOW); pmic_vib_mot_set_mode(PM_VIB_MOT_MODE__DBUS2); pmic_vib_mot_set_volt(PMIC_VIBRATOR_ON_LEV); pr_debug("[shvibrator] PMIC vibrator On.\n"); }else{ pr_debug("[shvibrator] PMIC vibrator Off.\n"); pmic_vib_mot_set_volt(0); } mutex_unlock(&sh_vibrator_pmic_mutex); }
static int debug_vib_mot_set_polarity(char *buf, int size) { int pol; int cnt; cnt = sscanf(buf, "%d", &pol); if (cnt < 1) { printk(KERN_ERR "%s: sscanf failed cnt=%d" , __func__, cnt); return -EINVAL; } if (pmic_vib_mot_set_polarity(pol) < 0) return -EFAULT; return size; }