Lines Matching +full:io +full:- +full:hv
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright 2007-2009 HV Sistemas S.L.
11 #include <linux/io.h>
28 struct input_dev *input = opencores_kbd->input; in opencores_kbd_isr()
31 c = readb(opencores_kbd->addr); in opencores_kbd_isr()
46 return -EINVAL; in opencores_kbd_probe()
48 opencores_kbd = devm_kzalloc(&pdev->dev, sizeof(*opencores_kbd), in opencores_kbd_probe()
51 return -ENOMEM; in opencores_kbd_probe()
53 input = devm_input_allocate_device(&pdev->dev); in opencores_kbd_probe()
55 dev_err(&pdev->dev, "failed to allocate input device\n"); in opencores_kbd_probe()
56 return -ENOMEM; in opencores_kbd_probe()
59 opencores_kbd->input = input; in opencores_kbd_probe()
61 opencores_kbd->addr = devm_platform_ioremap_resource(pdev, 0); in opencores_kbd_probe()
62 if (IS_ERR(opencores_kbd->addr)) in opencores_kbd_probe()
63 return PTR_ERR(opencores_kbd->addr); in opencores_kbd_probe()
65 input->name = pdev->name; in opencores_kbd_probe()
66 input->phys = "opencores-kbd/input0"; in opencores_kbd_probe()
68 input->id.bustype = BUS_HOST; in opencores_kbd_probe()
69 input->id.vendor = 0x0001; in opencores_kbd_probe()
70 input->id.product = 0x0001; in opencores_kbd_probe()
71 input->id.version = 0x0100; in opencores_kbd_probe()
73 input->keycode = opencores_kbd->keycodes; in opencores_kbd_probe()
74 input->keycodesize = sizeof(opencores_kbd->keycodes[0]); in opencores_kbd_probe()
75 input->keycodemax = ARRAY_SIZE(opencores_kbd->keycodes); in opencores_kbd_probe()
77 __set_bit(EV_KEY, input->evbit); in opencores_kbd_probe()
79 for (i = 0; i < ARRAY_SIZE(opencores_kbd->keycodes); i++) { in opencores_kbd_probe()
84 opencores_kbd->keycodes[i] = i; in opencores_kbd_probe()
85 __set_bit(opencores_kbd->keycodes[i], input->keybit); in opencores_kbd_probe()
87 __clear_bit(KEY_RESERVED, input->keybit); in opencores_kbd_probe()
89 error = devm_request_irq(&pdev->dev, irq, &opencores_kbd_isr, in opencores_kbd_probe()
91 pdev->name, opencores_kbd); in opencores_kbd_probe()
93 dev_err(&pdev->dev, "unable to claim irq %d\n", irq); in opencores_kbd_probe()
99 dev_err(&pdev->dev, "unable to register input device\n"); in opencores_kbd_probe()
109 .name = "opencores-kbd",