From 11cbafb1dd027f23cd8ea150981fe251d43cf269 Mon Sep 17 00:00:00 2001 From: Moyster Date: Fri, 20 Oct 2017 13:04:50 +0200 Subject: mtk: driver: vibrator: cleanup --- drivers/misc/mediatek/vibrator/Makefile | 2 -- drivers/misc/mediatek/vibrator/mt6735/vibrator.c | 14 +++++------ .../misc/mediatek/vibrator/mt6735/vibrator_hal.h | 4 +-- .../misc/mediatek/vibrator/thunderquake_engine.c | 29 ++++++++++------------ drivers/misc/mediatek/vibrator/timed_output.h | 4 +-- drivers/misc/mediatek/vibrator/vibrator_drv.c | 4 +-- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/drivers/misc/mediatek/vibrator/Makefile b/drivers/misc/mediatek/vibrator/Makefile index 3ce20389d..361c1b86e 100644 --- a/drivers/misc/mediatek/vibrator/Makefile +++ b/drivers/misc/mediatek/vibrator/Makefile @@ -5,5 +5,3 @@ obj-$(CONFIG_MTK_VIBRATOR) := vibrator_drv.o obj-$(CONFIG_THUNDERQUAKE_ENGINE_GPL) += thunderquake_engine.o obj-y += $(subst ",,$(CONFIG_MTK_PLATFORM))/ - -#ccflags-y := -Idrivers/staging/android/ diff --git a/drivers/misc/mediatek/vibrator/mt6735/vibrator.c b/drivers/misc/mediatek/vibrator/mt6735/vibrator.c index dfa422014..14463d7bf 100644 --- a/drivers/misc/mediatek/vibrator/mt6735/vibrator.c +++ b/drivers/misc/mediatek/vibrator/mt6735/vibrator.c @@ -20,17 +20,17 @@ #include #include -extern S32 pwrap_read( U32 adr, U32 *rdata ); -extern S32 pwrap_write( U32 adr, U32 wdata ); +extern S32 pwrap_read(U32 adr, U32 *rdata); +extern S32 pwrap_write(U32 adr, U32 wdata); void vibr_Enable_HW(void) { - pmic_set_register_value(PMIC_RG_VIBR_EN,1); //[bit 1]: VIBR_EN, 1=enable + pmic_set_register_value(PMIC_RG_VIBR_EN, 1); //[bit 1]: VIBR_EN, 1=enable } void vibr_Disable_HW(void) { - pmic_set_register_value(PMIC_RG_VIBR_EN,0); //[bit 1]: VIBR_EN, 1=enable + pmic_set_register_value(PMIC_RG_VIBR_EN, 0); //[bit 1]: VIBR_EN, 1=enable } @@ -50,13 +50,13 @@ void vibr_Disable_HW(void) void vibr_power_set(void) { #ifdef CUST_VIBR_VOL - struct vibrator_hw* hw = get_cust_vibrator_hw(); + 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); + pmic_set_register_value(PMIC_RG_VIBR_VOSEL, hw->vib_vol); #endif } -struct vibrator_hw* mt_get_cust_vibrator_hw(void) +struct vibrator_hw *mt_get_cust_vibrator_hw(void) { return get_cust_vibrator_hw(); } diff --git a/drivers/misc/mediatek/vibrator/mt6735/vibrator_hal.h b/drivers/misc/mediatek/vibrator/mt6735/vibrator_hal.h index c0b416eea..60b2e4b6e 100644 --- a/drivers/misc/mediatek/vibrator/mt6735/vibrator_hal.h +++ b/drivers/misc/mediatek/vibrator/mt6735/vibrator_hal.h @@ -1,6 +1,4 @@ -/********************************************* -HAL API -**********************************************/ +/* HAL API */ void vibr_Enable_HW(void); void vibr_Disable_HW(void); diff --git a/drivers/misc/mediatek/vibrator/thunderquake_engine.c b/drivers/misc/mediatek/vibrator/thunderquake_engine.c index 7d5c09e3c..41241703d 100644 --- a/drivers/misc/mediatek/vibrator/thunderquake_engine.c +++ b/drivers/misc/mediatek/vibrator/thunderquake_engine.c @@ -11,12 +11,12 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * Please preserve this licence and driver name if you implement this + * + * Please preserve this licence and driver name if you implement this * anywhere else. * */ - + #include #include #include @@ -37,7 +37,7 @@ extern void pmic_set_register_value(PMU_FLAGS_LIST_ENUM flagname, kal_uint32 val static ssize_t vibr_vtg_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - struct vibrator_hw* hw = mt_get_cust_vibrator_hw(); + struct vibrator_hw *hw = mt_get_cust_vibrator_hw(); return sprintf(buf, "%d\n", hw->vib_vol); } @@ -45,13 +45,12 @@ static ssize_t vibr_vtg_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t vibr_vtg_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { unsigned int val; - struct vibrator_hw* hw = mt_get_cust_vibrator_hw(); + struct vibrator_hw *hw = mt_get_cust_vibrator_hw(); sscanf(buf, "%u", &val); - if(val>=MIN_VIBR && val <=MAX_VIBR) { - pmic_set_register_value(PMIC_RG_VIBR_VOSEL,val); - hw->vib_vol=val; + if (val >= MIN_VIBR && val <= MAX_VIBR) { + pmic_set_register_value(PMIC_RG_VIBR_VOSEL, val); + hw->vib_vol = val; } - return count; } @@ -70,24 +69,22 @@ static struct kobj_attribute thunderquake_level_attribute = 0666, vibr_vtg_show, vibr_vtg_store); -static struct attribute *thunderquake_engine_attrs[] = - { +static struct attribute *thunderquake_engine_attrs[] = { &thunderquake_level_attribute.attr, &thunderquake_version_attribute.attr, NULL, }; -static struct attribute_group vibr_level_control_attr_group = - { +static struct attribute_group vibr_level_control_attr_group = { .attrs = thunderquake_engine_attrs, }; - + static struct kobject *vibr_level_control_kobj; static int vibr_level_control_init(void) { int sysfs_result; - printk(KERN_DEBUG "[%s]\n",__func__); + printk(KERN_DEBUG "[%s]\n", __func__); vibr_level_control_kobj = kobject_create_and_add("thunderquake_engine", kernel_kobj); @@ -96,7 +93,7 @@ static int vibr_level_control_init(void) pr_err("%s Interface create failed!\n", __func__); return -ENOMEM; - } + } sysfs_result = sysfs_create_group(vibr_level_control_kobj, &vibr_level_control_attr_group); diff --git a/drivers/misc/mediatek/vibrator/timed_output.h b/drivers/misc/mediatek/vibrator/timed_output.h index 5a838f10f..a9e41f095 100644 --- a/drivers/misc/mediatek/vibrator/timed_output.h +++ b/drivers/misc/mediatek/vibrator/timed_output.h @@ -11,7 +11,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * -*/ + */ #ifndef _LINUX_TIMED_OUTPUT_H #define _LINUX_TIMED_OUTPUT_H @@ -20,7 +20,7 @@ struct timed_output_dev { const char *name; /* enable the output and set the timer */ - void (*enable) (struct timed_output_dev *sdev, int timeout); + void (*enable) (struct timed_output_dev *sdev, int timeout); /* returns the current number of milliseconds remaining on the timer */ int (*get_time) (struct timed_output_dev *sdev); diff --git a/drivers/misc/mediatek/vibrator/vibrator_drv.c b/drivers/misc/mediatek/vibrator/vibrator_drv.c index 154d57903..0c85c3705 100644 --- a/drivers/misc/mediatek/vibrator/vibrator_drv.c +++ b/drivers/misc/mediatek/vibrator/vibrator_drv.c @@ -93,9 +93,9 @@ static int vibr_Enable(void) static int vibr_Disable(void) { if (ldo_state) { - vibr_Disable_HW(); + vibr_Disable_HW(); ldo_state = 0; - } + } return 0; } -- cgit v1.2.3