提交 8631580f 编写于 作者: D Dmitry Torokhov

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: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 77a8f0ad
...@@ -317,14 +317,10 @@ static int rotary_encoder_probe(struct platform_device *pdev) ...@@ -317,14 +317,10 @@ static int rotary_encoder_probe(struct platform_device *pdev)
input->id.bustype = BUS_HOST; input->id.bustype = BUS_HOST;
input->dev.parent = dev; input->dev.parent = dev;
if (pdata->relative_axis) { if (pdata->relative_axis)
input->evbit[0] = BIT_MASK(EV_REL); input_set_capability(input, EV_REL, pdata->axis);
input->relbit[0] = BIT_MASK(pdata->axis); else
} else { input_set_abs_params(input, pdata->axis, 0, pdata->steps, 0, 1);
input->evbit[0] = BIT_MASK(EV_ABS);
input_set_abs_params(encoder->input,
pdata->axis, 0, pdata->steps, 0, 1);
}
switch (pdata->steps_per_period) { switch (pdata->steps_per_period) {
case 4: case 4:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册