mdp4_wfd_writeback_panel.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* Copyright (c) 2011, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include <linux/types.h>
  14. #include <linux/list.h>
  15. #include <linux/ioctl.h>
  16. #include <linux/spinlock.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/version.h>
  20. #include "mdp4_wfd_writeback_util.h"
  21. #include "msm_fb.h"
  22. static int __devinit writeback_panel_probe(struct platform_device *pdev)
  23. {
  24. int rc = 0;
  25. if (pdev->id == 0)
  26. return 0;
  27. if (!msm_fb_add_device(pdev)) {
  28. WRITEBACK_MSG_ERR("Failed to add fd device\n");
  29. rc = -ENOMEM;
  30. }
  31. return rc;
  32. }
  33. static struct msm_fb_panel_data writeback_msm_panel_data = {
  34. .panel_info = {
  35. .type = WRITEBACK_PANEL,
  36. .xres = 1280,
  37. .yres = 720,
  38. .pdest = DISPLAY_3,
  39. .wait_cycle = 0,
  40. .bpp = 24,
  41. .fb_num = 1,
  42. .clk_rate = 74250000,
  43. },
  44. };
  45. static struct platform_device writeback_panel_device = {
  46. .name = "writeback_panel",
  47. .id = 1,
  48. .dev.platform_data = &writeback_msm_panel_data,
  49. };
  50. static struct platform_driver writeback_panel_driver = {
  51. .probe = writeback_panel_probe,
  52. .driver = {
  53. .name = "writeback_panel"
  54. }
  55. };
  56. static int __init writeback_panel_init(void)
  57. {
  58. int rc = 0;
  59. rc = platform_driver_register(&writeback_panel_driver);
  60. if (rc) {
  61. WRITEBACK_MSG_ERR("Failed to register platform driver\n");
  62. goto fail_driver_registration;
  63. }
  64. rc = platform_device_register(&writeback_panel_device);
  65. if (rc) {
  66. WRITEBACK_MSG_ERR("Failed to register "
  67. "writeback_panel_device\n");
  68. goto fail_device_registration;
  69. }
  70. return rc;
  71. fail_device_registration:
  72. platform_driver_unregister(&writeback_panel_driver);
  73. fail_driver_registration:
  74. return rc;
  75. }
  76. module_init(writeback_panel_init);