diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-01-17 13:52:54 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-03-02 12:32:07 -0500 |
commit | 8631580f4fde9584ef39480eb0f2219708e5aeba (patch) | |
tree | c218be2577df873768bc1d00009abde0933e6460 | |
parent | 77a8f0ad38844b5d4163424c4feb8abbbbb55af0 (diff) |
Input: rotary_encoder - use input_set_capability()
Instead of manipulating capability bits directly let's use appropriate
helpers. Also there is no need to explicitly set EV_ABS when calling
input_set_abs_params().
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/misc/rotary_encoder.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index 471175e5306b..70fdcce84866 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c | |||
@@ -317,14 +317,10 @@ static int rotary_encoder_probe(struct platform_device *pdev) | |||
317 | input->id.bustype = BUS_HOST; | 317 | input->id.bustype = BUS_HOST; |
318 | input->dev.parent = dev; | 318 | input->dev.parent = dev; |
319 | 319 | ||
320 | if (pdata->relative_axis) { | 320 | if (pdata->relative_axis) |
321 | input->evbit[0] = BIT_MASK(EV_REL); | 321 | input_set_capability(input, EV_REL, pdata->axis); |
322 | input->relbit[0] = BIT_MASK(pdata->axis); | 322 | else |
323 | } else { | 323 | input_set_abs_params(input, pdata->axis, 0, pdata->steps, 0, 1); |
324 | input->evbit[0] = BIT_MASK(EV_ABS); | ||
325 | input_set_abs_params(encoder->input, | ||
326 | pdata->axis, 0, pdata->steps, 0, 1); | ||
327 | } | ||
328 | 324 | ||
329 | switch (pdata->steps_per_period) { | 325 | switch (pdata->steps_per_period) { |
330 | case 4: | 326 | case 4: |