summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorCharlie Huang <chahuang@nvidia.com>2012-11-27 18:11:24 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:43:47 -0700
commit574c1d3a0bc138cd6dc891f94d0fb7198cb1638b (patch)
treef02a0329d55e7a0331164a56c60013c54393555b /drivers/input
parentfbbd854b0fd9f1b44af537576f033c1cd571d106 (diff)
drivers: edp: add user data carrier
let edp clients can pass per-instance data to the edp core and get it returned back in the called back functions. bug 1159989 bug 1159987 Change-Id: I8a7645dfe41ae0089c9462ee50a8976f4bfb397a Signed-off-by: Charlie Huang <chahuang@nvidia.com> Reviewed-on: http://git-master/r/166747 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/max77665_haptic.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/input/misc/max77665_haptic.c b/drivers/input/misc/max77665_haptic.c
index 048478d4d328..be7b261de632 100644
--- a/drivers/input/misc/max77665_haptic.c
+++ b/drivers/input/misc/max77665_haptic.c
@@ -65,8 +65,6 @@ struct max77665_haptic {
struct edp_client *haptic_edp_client;
};
-static struct max77665_haptic *max77665_haptic_chip;
-
static int max77665_read_reg(struct max77665_haptic *chip, u8 reg, u8 *val)
{
int ret;
@@ -229,9 +227,14 @@ static void max77665_haptic_enable(struct max77665_haptic *chip, bool enable)
}
}
-static void max77665_haptic_throttle(unsigned int new_state)
+static void max77665_haptic_throttle(unsigned int new_state, void *priv_data)
{
- max77665_haptic_enable(max77665_haptic_chip, false);
+ struct max77665_haptic *chip = priv_data;
+
+ if (!chip)
+ return;
+
+ max77665_haptic_enable(chip, false);
}
static void max77665_haptic_play_effect_work(struct work_struct *work)
@@ -465,6 +468,7 @@ static int max77665_haptic_probe(struct platform_device *pdev)
chip->haptic_edp_client->e0_index = MAX77665_HAPTIC_EDP_LOW;
chip->haptic_edp_client->priority = EDP_MAX_PRIO - 2;
chip->haptic_edp_client->throttle = max77665_haptic_throttle;
+ chip->haptic_edp_client->private_data = chip;
battery_manager = edp_get_manager("battery");
if (!battery_manager) {
@@ -492,7 +496,6 @@ static int max77665_haptic_probe(struct platform_device *pdev)
register_input:
dev_set_drvdata(&pdev->dev, chip);
- max77665_haptic_chip = chip;
input_dev->name = "max77665-haptic";
input_dev->id.version = 1;
input_dev->dev.parent = &pdev->dev;