dm: button: add support for linux_code in button-gpio.c driver
Linux event code must be used in input devices, using buttons. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Tom Rini
parent
298ffdd5d6
commit
ea6fdc1359
@@ -38,6 +38,16 @@ enum button_state_t button_get_state(struct udevice *dev)
|
||||
return ops->get_state(dev);
|
||||
}
|
||||
|
||||
int button_get_code(struct udevice *dev)
|
||||
{
|
||||
struct button_ops *ops = button_get_ops(dev);
|
||||
|
||||
if (!ops->get_code)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->get_code(dev);
|
||||
}
|
||||
|
||||
UCLASS_DRIVER(button) = {
|
||||
.id = UCLASS_BUTTON,
|
||||
.name = "button",
|
||||
|
||||
Reference in New Issue
Block a user