/arch/arm/mach-omap2/voltagedomains44xx_data.c

https://github.com/AICP/kernel_asus_grouper · C · 102 lines · 64 code · 13 blank · 25 comment · 1 complexity · 4c85dba99fcd012cc9c2341254e5a8f6 MD5 · raw file

  1. /*
  2. * OMAP3/OMAP4 Voltage Management Routines
  3. *
  4. * Author: Thara Gopinath <thara@ti.com>
  5. *
  6. * Copyright (C) 2007 Texas Instruments, Inc.
  7. * Rajendra Nayak <rnayak@ti.com>
  8. * Lesly A M <x0080970@ti.com>
  9. *
  10. * Copyright (C) 2008 Nokia Corporation
  11. * Kalle Jokiniemi
  12. *
  13. * Copyright (C) 2010 Texas Instruments, Inc.
  14. * Thara Gopinath <thara@ti.com>
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License version 2 as
  18. * published by the Free Software Foundation.
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/err.h>
  22. #include <linux/init.h>
  23. #include <plat/common.h>
  24. #include "prm-regbits-44xx.h"
  25. #include "prm44xx.h"
  26. #include "prcm44xx.h"
  27. #include "prminst44xx.h"
  28. #include "voltage.h"
  29. #include "omap_opp_data.h"
  30. #include "vc.h"
  31. #include "vp.h"
  32. static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
  33. .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
  34. };
  35. static struct omap_vdd_info omap4_vdd_mpu_info = {
  36. .vp_data = &omap4_vp_mpu_data,
  37. .vc_data = &omap4_vc_mpu_data,
  38. .vfsm = &omap4_vdd_mpu_vfsm_data,
  39. .voltdm = {
  40. .name = "mpu",
  41. },
  42. };
  43. static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
  44. .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
  45. };
  46. static struct omap_vdd_info omap4_vdd_iva_info = {
  47. .vp_data = &omap4_vp_iva_data,
  48. .vc_data = &omap4_vc_iva_data,
  49. .vfsm = &omap4_vdd_iva_vfsm_data,
  50. .voltdm = {
  51. .name = "iva",
  52. },
  53. };
  54. static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
  55. .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
  56. };
  57. static struct omap_vdd_info omap4_vdd_core_info = {
  58. .vp_data = &omap4_vp_core_data,
  59. .vc_data = &omap4_vc_core_data,
  60. .vfsm = &omap4_vdd_core_vfsm_data,
  61. .voltdm = {
  62. .name = "core",
  63. },
  64. };
  65. /* OMAP4 VDD structures */
  66. static struct omap_vdd_info *omap4_vdd_info[] = {
  67. &omap4_vdd_mpu_info,
  68. &omap4_vdd_iva_info,
  69. &omap4_vdd_core_info,
  70. };
  71. /* OMAP4 specific voltage init functions */
  72. static int __init omap44xx_voltage_early_init(void)
  73. {
  74. s16 prm_mod = OMAP4430_PRM_DEVICE_INST;
  75. s16 prm_irqst_ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST;
  76. if (!cpu_is_omap44xx())
  77. return 0;
  78. /*
  79. * XXX Will depend on the process, validation, and binning
  80. * for the currently-running IC
  81. */
  82. omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
  83. omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
  84. omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
  85. return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
  86. omap4_vdd_info,
  87. ARRAY_SIZE(omap4_vdd_info));
  88. };
  89. core_initcall(omap44xx_voltage_early_init);