sead3-lcd.c 959 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
  7. */
  8. #include <linux/init.h>
  9. #include <linux/platform_device.h>
  10. static struct resource __initdata sead3_lcd_resource = {
  11. .start = 0x1f000400,
  12. .end = 0x1f00041f,
  13. .flags = IORESOURCE_MEM,
  14. };
  15. static __init int sead3_lcd_add(void)
  16. {
  17. struct platform_device *pdev;
  18. int retval;
  19. /* SEAD-3 and Cobalt platforms use same display type. */
  20. pdev = platform_device_alloc("cobalt-lcd", -1);
  21. if (!pdev)
  22. return -ENOMEM;
  23. retval = platform_device_add_resources(pdev, &sead3_lcd_resource, 1);
  24. if (retval)
  25. goto err_free_device;
  26. retval = platform_device_add(pdev);
  27. if (retval)
  28. goto err_free_device;
  29. return 0;
  30. err_free_device:
  31. platform_device_put(pdev);
  32. return retval;
  33. }
  34. device_initcall(sead3_lcd_add);