fogona:vibrator bring up for driver

tirgger node will clash with driver node
remove tirgger node
reference from gerrit id 2451742

Change-Id: I0db35f3bdc5ab4692244ac0dd9fe86e2b3a054cf
Reviewed-on: https://gerrit.mot.com/2674951
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
longc 2023-07-13 20:26:25 +08:00 • committed by longc156
commit 9e08156d68

View file

@ -277,7 +277,7 @@ static int moto_vibrator_ldo_probe(struct platform_device *pdev)
{
//struct device_node *of_node = pdev->dev.of_node;
struct vib_ldo_chip *chip;
int i, ret = 0;;
int i, ret = 0;
pr_info("Vibrator LDO successfully registered: ret = %d\n",ret);
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
@ -318,6 +318,19 @@ static int moto_vibrator_ldo_probe(struct platform_device *pdev)
goto sysfs_fail;
}
}
#ifdef CONFIG_LEDS_TRIGGER_TRANSIENT
/*
* Android has a habit of trying to set the vibrator trigger to "transient",
* which destroys our own "activate", "duration", and "state" attributes.
* Remove the "trigger" attribute provided by leds_class so that no one can
* change the trigger of the vibrator LED device.
*
* Luckily, `sysfs_remove_file` only uses the `name` field, so we can use a
* compound literal instead of having to find the proper attribute struct
*/
sysfs_remove_file(&chip->cdev.dev->kobj,
&((struct attribute){.name = "trigger"}));
#endif
pr_info("Vibrator LDO successfully registered: gpio = %d\n",chip->en_gpio);
return 0;