diff options
| author | Stephen Boyd <sboyd@codeaurora.org> | 2014-03-29 15:44:14 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-03-30 16:25:20 -0400 |
| commit | 877e1f1529a5c4fcc8460c1317c753ff8a6874c5 (patch) | |
| tree | d3147277678c16033c2788e9ae1bae91ccc14b6f | |
| parent | 57918dfadf717acf7d0488d5970c56a282d0aad1 (diff) | |
Input: pm8xxx-vibrator - add DT match table
The driver is only supported on DT enabled platforms. Convert the
driver to DT so that it can probe properly.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| -rw-r--r-- | Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt | 22 | ||||
| -rw-r--r-- | drivers/input/misc/pm8xxx-vibrator.c | 9 |
2 files changed, 30 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt b/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt new file mode 100644 index 000000000000..4ed467b1e402 --- /dev/null +++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | Qualcomm PM8xxx PMIC Vibrator | ||
| 2 | |||
| 3 | PROPERTIES | ||
| 4 | |||
| 5 | - compatible: | ||
| 6 | Usage: required | ||
| 7 | Value type: <string> | ||
| 8 | Definition: must be one of: | ||
| 9 | "qcom,pm8058-vib" | ||
| 10 | "qcom,pm8921-vib" | ||
| 11 | |||
| 12 | - reg: | ||
| 13 | Usage: required | ||
| 14 | Value type: <prop-encoded-array> | ||
| 15 | Definition: address of vibration control register | ||
| 16 | |||
| 17 | EXAMPLE | ||
| 18 | |||
| 19 | vibrator@4a { | ||
| 20 | compatible = "qcom,pm8058-vib"; | ||
| 21 | reg = <0x4a>; | ||
| 22 | }; | ||
diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c index b88b7cbf93e2..6a915ba31bba 100644 --- a/drivers/input/misc/pm8xxx-vibrator.c +++ b/drivers/input/misc/pm8xxx-vibrator.c | |||
| @@ -142,7 +142,6 @@ static int pm8xxx_vib_play_effect(struct input_dev *dev, void *data, | |||
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | static int pm8xxx_vib_probe(struct platform_device *pdev) | 144 | static int pm8xxx_vib_probe(struct platform_device *pdev) |
| 145 | |||
| 146 | { | 145 | { |
| 147 | struct pm8xxx_vib *vib; | 146 | struct pm8xxx_vib *vib; |
| 148 | struct input_dev *input_dev; | 147 | struct input_dev *input_dev; |
| @@ -214,12 +213,20 @@ static int pm8xxx_vib_suspend(struct device *dev) | |||
| 214 | 213 | ||
| 215 | static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); | 214 | static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); |
| 216 | 215 | ||
| 216 | static const struct of_device_id pm8xxx_vib_id_table[] = { | ||
| 217 | { .compatible = "qcom,pm8058-vib" }, | ||
| 218 | { .compatible = "qcom,pm8921-vib" }, | ||
| 219 | { } | ||
| 220 | }; | ||
| 221 | MODULE_DEVICE_TABLE(of, pm8xxx_vib_id_table); | ||
| 222 | |||
| 217 | static struct platform_driver pm8xxx_vib_driver = { | 223 | static struct platform_driver pm8xxx_vib_driver = { |
| 218 | .probe = pm8xxx_vib_probe, | 224 | .probe = pm8xxx_vib_probe, |
| 219 | .driver = { | 225 | .driver = { |
| 220 | .name = "pm8xxx-vib", | 226 | .name = "pm8xxx-vib", |
| 221 | .owner = THIS_MODULE, | 227 | .owner = THIS_MODULE, |
| 222 | .pm = &pm8xxx_vib_pm_ops, | 228 | .pm = &pm8xxx_vib_pm_ops, |
| 229 | .of_match_table = pm8xxx_vib_id_table, | ||
| 223 | }, | 230 | }, |
| 224 | }; | 231 | }; |
| 225 | module_platform_driver(pm8xxx_vib_driver); | 232 | module_platform_driver(pm8xxx_vib_driver); |
