Lines Matching full:decoder
24 static int gpio_decoder_get_gpios_state(struct gpio_decoder *decoder) in gpio_decoder_get_gpios_state() argument
26 struct gpio_descs *gpios = decoder->input_gpios; in gpio_decoder_get_gpios_state()
33 dev_err(decoder->dev, in gpio_decoder_get_gpios_state()
48 struct gpio_decoder *decoder = input_get_drvdata(input); in gpio_decoder_poll_gpios() local
51 state = gpio_decoder_get_gpios_state(decoder); in gpio_decoder_poll_gpios()
52 if (state >= 0 && state != decoder->last_stable) { in gpio_decoder_poll_gpios()
53 input_report_abs(input, decoder->axis, state); in gpio_decoder_poll_gpios()
55 decoder->last_stable = state; in gpio_decoder_poll_gpios()
62 struct gpio_decoder *decoder; in gpio_decoder_probe() local
67 decoder = devm_kzalloc(dev, sizeof(*decoder), GFP_KERNEL); in gpio_decoder_probe()
68 if (!decoder) in gpio_decoder_probe()
71 decoder->dev = dev; in gpio_decoder_probe()
72 device_property_read_u32(dev, "linux,axis", &decoder->axis); in gpio_decoder_probe()
74 decoder->input_gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); in gpio_decoder_probe()
75 if (IS_ERR(decoder->input_gpios)) { in gpio_decoder_probe()
77 return PTR_ERR(decoder->input_gpios); in gpio_decoder_probe()
80 if (decoder->input_gpios->ndescs < 2) { in gpio_decoder_probe()
85 if (device_property_read_u32(dev, "decoder-max-value", &max)) in gpio_decoder_probe()
86 max = (1U << decoder->input_gpios->ndescs) - 1; in gpio_decoder_probe()
92 input_set_drvdata(input, decoder); in gpio_decoder_probe()
96 input_set_abs_params(input, decoder->axis, 0, max, 0, 0); in gpio_decoder_probe()
115 { .compatible = "gpio-decoder", },
124 .name = "gpio-decoder",
130 MODULE_DESCRIPTION("GPIO decoder input driver");