/*1* Registration of Cobalt LCD platform device.2*3* Copyright (C) 2008 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*/19#include <linux/errno.h>20#include <linux/init.h>21#include <linux/ioport.h>22#include <linux/platform_device.h>2324static struct resource cobalt_lcd_resource __initdata = {25.start = 0x1f000000,26.end = 0x1f00001f,27.flags = IORESOURCE_MEM,28};2930static __init int cobalt_lcd_add(void)31{32struct platform_device *pdev;33int retval;3435pdev = platform_device_alloc("cobalt-lcd", -1);36if (!pdev)37return -ENOMEM;3839retval = platform_device_add_resources(pdev, &cobalt_lcd_resource, 1);40if (retval)41goto err_free_device;4243retval = platform_device_add(pdev);44if (retval)45goto err_free_device;4647return 0;4849err_free_device:50platform_device_put(pdev);5152return retval;53}54device_initcall(cobalt_lcd_add);555657