Input: pm8xxx-vib - add support for pm8916's vibrator
authorDamien Riegel <damien.riegel@savoirfairelinux.com>
Tue, 4 Apr 2017 23:29:59 +0000 (16:29 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 5 Apr 2017 15:52:39 +0000 (08:52 -0700)
Add pm8xxx_regs for this PMIC and the device tree match table entry.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt
drivers/input/misc/Kconfig
drivers/input/misc/pm8xxx-vibrator.c

index 4ed467b1e4021601e89254d715cc579a12676883..64bb990075c31c3c51a1b1b1aabd4b8a3083fc30 100644 (file)
@@ -7,6 +7,7 @@ PROPERTIES
        Value type: <string>
        Definition: must be one of:
                    "qcom,pm8058-vib"
+                   "qcom,pm8916-vib"
                    "qcom,pm8921-vib"
 
 - reg:
index 5b6c52210d20c3310a84c3d006363515a716d6ca..79d0be9885c575433dc6db7a146e253672d3d441 100644 (file)
@@ -143,7 +143,7 @@ config INPUT_PM8941_PWRKEY
 
 config INPUT_PM8XXX_VIBRATOR
        tristate "Qualcomm PM8XXX vibrator support"
-       depends on MFD_PM8XXX
+       depends on MFD_PM8XXX || MFD_SPMI_PMIC
        select INPUT_FF_MEMLESS
        help
          This option enables device driver support for the vibrator
index 3dc8ffbc6b9de8ce47c121f53fdf8e1a363facc0..7dd1c1fbe42a8d1079995f7ff1acb36974864fe9 100644 (file)
@@ -43,6 +43,15 @@ static const struct pm8xxx_regs pm8058_regs = {
        .drv_en_manual_mask = 0xfc,
 };
 
+static struct pm8xxx_regs pm8916_regs = {
+       .enable_addr = 0xc046,
+       .enable_mask = BIT(7),
+       .drv_addr = 0xc041,
+       .drv_mask = 0x1F,
+       .drv_shift = 0,
+       .drv_en_manual_mask = 0,
+};
+
 /**
  * struct pm8xxx_vib - structure to hold vibrator data
  * @vib_input_dev: input device supporting force feedback
@@ -240,6 +249,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL);
 static const struct of_device_id pm8xxx_vib_id_table[] = {
        { .compatible = "qcom,pm8058-vib", .data = &pm8058_regs },
        { .compatible = "qcom,pm8921-vib", .data = &pm8058_regs },
+       { .compatible = "qcom,pm8916-vib", .data = &pm8916_regs },
        { }
 };
 MODULE_DEVICE_TABLE(of, pm8xxx_vib_id_table);