Lines Matching +full:wyse +full:- +full:ariel +full:- +full:ec +full:- +full:input
1 // SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0-or-later
3 * Dell Wyse 3020 a.k.a. "Ariel" Power Button Driver
10 #include <linux/input.h>
28 struct input_dev *input; member
36 struct spi_device *spi = priv->client; in ec_input_read()
52 struct spi_device *spi = priv->client; in ec_input_interrupt()
59 dev_err(&spi->dev, "EC read failed: %d\n", error); in ec_input_interrupt()
63 if (priv->msg_counter == RESP_COUNTER(response)) { in ec_input_interrupt()
64 dev_warn(&spi->dev, "No new data to read?\n"); in ec_input_interrupt()
68 priv->msg_counter = RESP_COUNTER(response); in ec_input_interrupt()
71 dev_dbg(&spi->dev, "Ignoring message that's not kbd data\n"); in ec_input_interrupt()
78 input_report_key(priv->input, KEY_POWER, 1); in ec_input_interrupt()
79 input_sync(priv->input); in ec_input_interrupt()
82 input_report_key(priv->input, KEY_POWER, 0); in ec_input_interrupt()
83 input_sync(priv->input); in ec_input_interrupt()
86 dev_dbg(&spi->dev, "Unknown scan code: %02x\n", in ec_input_interrupt()
101 if (!spi->irq) { in ariel_pwrbutton_probe()
102 dev_err(&spi->dev, "Missing IRQ.\n"); in ariel_pwrbutton_probe()
103 return -EINVAL; in ariel_pwrbutton_probe()
106 priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL); in ariel_pwrbutton_probe()
108 return -ENOMEM; in ariel_pwrbutton_probe()
110 priv->client = spi; in ariel_pwrbutton_probe()
113 priv->input = devm_input_allocate_device(&spi->dev); in ariel_pwrbutton_probe()
114 if (!priv->input) in ariel_pwrbutton_probe()
115 return -ENOMEM; in ariel_pwrbutton_probe()
116 priv->input->name = "Power Button"; in ariel_pwrbutton_probe()
117 priv->input->dev.parent = &spi->dev; in ariel_pwrbutton_probe()
118 input_set_capability(priv->input, EV_KEY, KEY_POWER); in ariel_pwrbutton_probe()
119 error = input_register_device(priv->input); in ariel_pwrbutton_probe()
121 dev_err(&spi->dev, "error registering input device: %d\n", error); in ariel_pwrbutton_probe()
127 dev_err(&spi->dev, "EC read failed: %d\n", error); in ariel_pwrbutton_probe()
130 priv->msg_counter = RESP_COUNTER(response); in ariel_pwrbutton_probe()
132 error = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, in ariel_pwrbutton_probe()
135 "Ariel EC Input", priv); in ariel_pwrbutton_probe()
138 dev_err(&spi->dev, "Failed to request IRQ %d: %d\n", in ariel_pwrbutton_probe()
139 spi->irq, error); in ariel_pwrbutton_probe()
147 { .compatible = "dell,wyse-ariel-ec-input" },
153 { .name = "wyse-ariel-ec-input" },
160 .name = "dell-wyse-ariel-ec-input",
169 MODULE_DESCRIPTION("Dell Wyse 3020 Power Button Input Driver");