void vibr_power_set(void) { struct vibrator_hw* hw = get_cust_vibrator_hw(); vibr_voltage = hw->vosel; printk("[vibrator]vibr_init: vibrator set voltage = %d\n", vibr_voltage); //upmu_set_rg_vibr_vosel(hw->vib_vol); }
void vibr_power_set(void) { #ifdef CUST_VIBR_VOL struct vibrator_hw* hw = get_cust_vibrator_hw(); printk("[vibrator]vibr_init: vibrator set voltage = %d\n", hw->vib_vol); upmu_set_rg_vibr_vosel(hw->vib_vol); #endif }
void vibr_power_set(void) { #ifdef CUST_VIBR_VOL struct vibrator_hw* hw = get_cust_vibrator_hw(); printk("[vibrator]vibr_init: vibrator set voltage = %d\n", hw->vib_vol); pmic_set_register_value(PMIC_RG_VIBR_VOSEL,hw->vib_vol); #endif }
static s32 __devinit vib_mod_init(void) { s32 ret; struct vibrator_hw* hw = get_cust_vibrator_hw(); printk("MediaTek MTK vibrator driver register, version %s\n", VERSION); ret = platform_device_register(&vibrator_device); if (ret != 0){ printk("[vibrator]Unable to register vibrator device (%d)\n", ret); return ret; } vibrator_queue = create_singlethread_workqueue(VIB_DEVICE); if(!vibrator_queue) { printk("[vibrator]Unable to create workqueue\n"); return -ENODATA; } INIT_WORK(&vibrator_work, update_vibrator); spin_lock_init(&vibr_lock); shutdown_flag = 0; vibr_state = 0; hrtimer_init(&vibr_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); vibr_timer.function = vibrator_timer_func; timed_output_dev_register(&mtk_vibrator); ret = platform_driver_register(&vibrator_driver); if(ret) { printk("[vibrator]Unable to register vibrator driver (%d)\n", ret); return ret; } ret = device_create_file(mtk_vibrator.dev,&dev_attr_vibr_on); if(ret) { printk("[vibrator]device_create_file vibr_on fail! \n"); } vibr_voltage = hw->vosel; printk("[vibrator]vibrator voltage = %d\n", vibr_voltage); printk("[vibrator]vib_mod_init Done \n"); return RSUCCESS; }
static void vibrator_enable(struct timed_output_dev *dev, int value) { unsigned long flags; #if 1 struct vibrator_hw* hw = get_cust_vibrator_hw(); #endif printk("[vibrator]vibrator_enable: vibrator first in value = %d\n", value); spin_lock_irqsave(&vibe_lock, flags); while(hrtimer_cancel(&vibe_timer)) { printk("[vibrator]vibrator_enable: try to cancel hrtimer \n"); } if (value == 0 || shutdown_flag == 1) { printk("[vibrator]vibrator_enable: shutdown_flag = %d\n", shutdown_flag); vibe_state = 0; } else { #if 1 printk("[vibrator]vibrator_enable: vibrator cust timer: %d \n", hw->vib_timer); #ifdef CUST_VIBR_LIMIT if(value > hw->vib_limit && value < hw->vib_timer) #else if(value >= 10 && value < hw->vib_timer) #endif value = hw->vib_timer; #endif value = (value > 15000 ? 15000 : value); vibe_state = 1; hrtimer_start(&vibe_timer, ktime_set(value / 1000, (value % 1000) * 1000000), HRTIMER_MODE_REL); } spin_unlock_irqrestore(&vibe_lock, flags); printk("[vibrator]vibrator_enable: vibrator start: %d \n", value); queue_work(vibrator_queue, &vibrator_work); }
struct vibrator_hw* mt_get_cust_vibrator_hw(void) { return get_cust_vibrator_hw(); }