cobalt_btns.c (bebb8a2bc180a4c920c57e89b2d713a34c1d096c) cobalt_btns.c (d0a0515fc30b55d4b09395d44762c5f41d6d02d5)
1/*
2 * Cobalt button interface driver.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 36 unchanged lines hidden (view full) ---

45 { 0x04000000, KEY_LEFT, },
46 { 0x08000000, KEY_UP, },
47 { 0x10000000, KEY_DOWN, },
48 { 0x20000000, KEY_RIGHT, },
49 { 0x40000000, KEY_ENTER, },
50 { 0x80000000, KEY_SELECT, },
51};
52
1/*
2 * Cobalt button interface driver.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 36 unchanged lines hidden (view full) ---

45 { 0x04000000, KEY_LEFT, },
46 { 0x08000000, KEY_UP, },
47 { 0x10000000, KEY_DOWN, },
48 { 0x20000000, KEY_RIGHT, },
49 { 0x40000000, KEY_ENTER, },
50 { 0x80000000, KEY_SELECT, },
51};
52
53static struct resource cobalt_buttons_resource __initdata = {
54 .start = 0x1d000000,
55 .end = 0x1d000003,
56 .flags = IORESOURCE_MEM,
57};
58
59static struct platform_device *cobalt_buttons_device;
60
61static struct timer_list buttons_timer;
62
63static void handle_buttons(unsigned long data)
64{
65 struct buttons_map *button = buttons_map;
66 struct buttons_dev *bdev;
67 uint32_t status;
68 int i;

--- 109 unchanged lines hidden (view full) ---

178 .driver = {
179 .name = "Cobalt buttons",
180 .owner = THIS_MODULE,
181 },
182};
183
184static int __init cobalt_buttons_init(void)
185{
53static struct timer_list buttons_timer;
54
55static void handle_buttons(unsigned long data)
56{
57 struct buttons_map *button = buttons_map;
58 struct buttons_dev *bdev;
59 uint32_t status;
60 int i;

--- 109 unchanged lines hidden (view full) ---

170 .driver = {
171 .name = "Cobalt buttons",
172 .owner = THIS_MODULE,
173 },
174};
175
176static int __init cobalt_buttons_init(void)
177{
186 int retval;
187
188 cobalt_buttons_device = platform_device_register_simple("Cobalt buttons", -1,
189 &cobalt_buttons_resource, 1);
190 if (IS_ERR(cobalt_buttons_device)) {
191 retval = PTR_ERR(cobalt_buttons_device);
192 return retval;
193 }
194
195 retval = platform_driver_register(&cobalt_buttons_driver);
196 if (retval < 0)
197 platform_device_unregister(cobalt_buttons_device);
198
199 return retval;
178 return platform_driver_register(&cobalt_buttons_driver);
200}
201
202static void __exit cobalt_buttons_exit(void)
203{
204 platform_driver_unregister(&cobalt_buttons_driver);
179}
180
181static void __exit cobalt_buttons_exit(void)
182{
183 platform_driver_unregister(&cobalt_buttons_driver);
205 platform_device_unregister(cobalt_buttons_device);
206}
207
208module_init(cobalt_buttons_init);
209module_exit(cobalt_buttons_exit);
184}
185
186module_init(cobalt_buttons_init);
187module_exit(cobalt_buttons_exit);