Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c514387 authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Dmitry Torokhov
Browse files

Input: cobalt_btns - assorted fixes



 - fix compile errors (keymap is in bdev, not pdev)
 - cdev is no more (must use dev.parent)
 - update copiright notice

Signed-off-by: default avatarYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent baadac8b
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
/*
/*
 *  Cobalt button interface driver.
 *  Cobalt button interface driver.
 *
 *
 *  Copyright (C) 2007  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
 *  Copyright (C) 2007-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@ static void handle_buttons(struct input_polled_dev *dev)
	status = ~readl(bdev->reg) >> 24;
	status = ~readl(bdev->reg) >> 24;


	for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
	for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
		if (status & (1UL << i)) {
		if (status & (1U << i)) {
			if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
			if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
				input_event(input, EV_MSC, MSC_SCAN, i);
				input_event(input, EV_MSC, MSC_SCAN, i);
				input_report_key(input, bdev->keymap[i], 1);
				input_report_key(input, bdev->keymap[i], 1);
@@ -97,16 +97,16 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
	input->name = "Cobalt buttons";
	input->name = "Cobalt buttons";
	input->phys = "cobalt/input0";
	input->phys = "cobalt/input0";
	input->id.bustype = BUS_HOST;
	input->id.bustype = BUS_HOST;
	input->cdev.dev = &pdev->dev;
	input->dev.parent = &pdev->dev;


	input->keycode = pdev->keymap;
	input->keycode = bdev->keymap;
	input->keycodemax = ARRAY_SIZE(pdev->keymap);
	input->keycodemax = ARRAY_SIZE(bdev->keymap);
	input->keycodesize = sizeof(unsigned short);
	input->keycodesize = sizeof(unsigned short);


	input_set_capability(input, EV_MSC, MSC_SCAN);
	input_set_capability(input, EV_MSC, MSC_SCAN);
	__set_bit(EV_KEY, input->evbit);
	__set_bit(EV_KEY, input->evbit);
	for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
	for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
		__set_bit(input->keycode[i], input->keybit);
		__set_bit(bdev->keymap[i], input->keybit);
	__clear_bit(KEY_RESERVED, input->keybit);
	__clear_bit(KEY_RESERVED, input->keybit);


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);