#define QUICKSTART_EVENT_WAKE 0x02
#define QUICKSTART_EVENT_RUNTIME 0x80
-struct quickstart_btn {
+struct quickstart_button {
char *name;
unsigned int id;
struct list_head list;
struct quickstart_acpi {
struct acpi_device *device;
- struct quickstart_btn *btn;
+ struct quickstart_button *button;
};
static LIST_HEAD(buttons);
-static struct quickstart_btn *pressed;
+static struct quickstart_button *pressed;
static struct input_dev *quickstart_input;
char *buf)
{
int count = 0;
- struct quickstart_btn *b;
+ struct quickstart_button *b;
if (list_empty(&buttons))
return snprintf(buf, PAGE_SIZE, "none");
}
/* Helper functions */
-static struct quickstart_btn *quickstart_buttons_add(void)
+static struct quickstart_button *quickstart_buttons_add(void)
{
- struct quickstart_btn *b;
+ struct quickstart_button *b;
b = kzalloc(sizeof(*b), GFP_KERNEL);
if (!b)
return b;
}
-static void quickstart_button_del(struct quickstart_btn *data)
+static void quickstart_button_del(struct quickstart_button *data)
{
if (!data)
return;
static void quickstart_buttons_free(void)
{
- struct quickstart_btn *b, *n;
+ struct quickstart_button *b, *n;
list_for_each_entry_safe(b, n, &buttons, list)
quickstart_button_del(b);
switch (event) {
case QUICKSTART_EVENT_WAKE:
- pressed = quickstart->btn;
+ pressed = quickstart->button;
break;
case QUICKSTART_EVENT_RUNTIME:
- input_report_key(quickstart_input, quickstart->btn->id, 1);
+ input_report_key(quickstart_input, quickstart->button->id, 1);
input_sync(quickstart_input);
- input_report_key(quickstart_input, quickstart->btn->id, 0);
+ input_report_key(quickstart_input, quickstart->button->id, 0);
input_sync(quickstart_input);
break;
default:
&buffer);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR "quickstart: %s GHID method failed.\n",
- quickstart->btn->name);
+ quickstart->button->name);
return -EINVAL;
}
*/
switch (buffer.length) {
case 1:
- quickstart->btn->id = *(uint8_t *)buffer.pointer;
+ quickstart->button->id = *(uint8_t *)buffer.pointer;
break;
case 2:
- quickstart->btn->id = *(uint16_t *)buffer.pointer;
+ quickstart->button->id = *(uint16_t *)buffer.pointer;
break;
case 4:
- quickstart->btn->id = *(uint32_t *)buffer.pointer;
+ quickstart->button->id = *(uint32_t *)buffer.pointer;
break;
case 8:
- quickstart->btn->id = *(uint64_t *)buffer.pointer;
+ quickstart->button->id = *(uint64_t *)buffer.pointer;
break;
default:
printk(KERN_ERR "quickstart: %s GHID method returned buffer "
"of unexpected length %u\n",
- quickstart->btn->name, buffer.length);
+ quickstart->button->name, buffer.length);
ret = -EINVAL;
break;
}
return -ENOMEM;
/* Add new button to list */
- quickstart->btn = quickstart_buttons_add();
- if (!quickstart->btn) {
+ quickstart->button = quickstart_buttons_add();
+ if (!quickstart->button) {
kfree(name);
return -ENOMEM;
}
- quickstart->btn->name = name;
- strcpy(quickstart->btn->name, bid);
+ quickstart->button->name = name;
+ strcpy(quickstart->button->name, bid);
return 0;
}
quickstart_acpi_notify);
fail_installnotify:
- quickstart_button_del(quickstart->btn);
+ quickstart_button_del(quickstart->button);
fail_config:
static int __init quickstart_init_input(void)
{
- struct quickstart_btn *b;
+ struct quickstart_button *b;
int ret;
quickstart_input = input_allocate_device();