/*1* Cobalt buttons platform device.2*3* Copyright (C) 2007 Yoichi Yuasa <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#include <linux/platform_device.h>21#include <linux/errno.h>22#include <linux/init.h>2324static struct resource cobalt_buttons_resource __initdata = {25.start = 0x1d000000,26.end = 0x1d000003,27.flags = IORESOURCE_MEM,28};2930static __init int cobalt_add_buttons(void)31{32struct platform_device *pd;33int error;3435pd = platform_device_alloc("Cobalt buttons", -1);36if (!pd)37return -ENOMEM;3839error = platform_device_add_resources(pd, &cobalt_buttons_resource, 1);40if (error)41goto err_free_device;4243error = platform_device_add(pd);44if (error)45goto err_free_device;4647return 0;4849err_free_device:50platform_device_put(pd);51return error;52}53device_initcall(cobalt_add_buttons);545556