Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
voltage.h
Go to the documentation of this file.
1 /*
2  * OMAP Voltage Management Routines
3  *
4  * Author: Thara Gopinath <[email protected]>
5  *
6  * Copyright (C) 2009 Texas Instruments, Inc.
7  * Thara Gopinath <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13 
14 #ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
15 #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
16 
17 #include <linux/err.h>
18 
20 
21 #include "vc.h"
22 #include "vp.h"
23 
24 struct powerdomain;
25 
26 /* XXX document */
27 #define VOLTSCALE_VPFORCEUPDATE 1
28 #define VOLTSCALE_VCBYPASS 2
29 
30 /*
31  * OMAP3 GENERIC setup times. Revisit to see if these needs to be
32  * passed from board or PMIC file
33  */
34 #define OMAP3_CLKSETUP 0xff
35 #define OMAP3_VOLTOFFSET 0xff
36 #define OMAP3_VOLTSETUP2 0xff
37 
49 };
50 
68 struct voltagedomain {
69  char *name;
70  bool scalable;
71  struct list_head node;
74  const struct omap_vfsm_instance *vfsm;
77 
78  /* VC/VP register access functions: SoC specific */
79  u32 (*read) (u8 offset);
82 
83  union {
84  const char *name;
86  } sys_clk;
87 
88  int (*scale) (struct voltagedomain *voltdm,
89  unsigned long target_volt);
90 
93 };
94 
126  unsigned long (*vsel_to_uv) (const u8 vsel);
127  u8 (*uv_to_vsel) (unsigned long uV);
128 };
129 
130 void omap_voltage_get_volttable(struct voltagedomain *voltdm,
131  struct omap_volt_data **volt_data);
133  unsigned long volt);
134 int omap_voltage_register_pmic(struct voltagedomain *voltdm,
135  struct omap_voltdm_pmic *pmic);
136 void omap_change_voltscale_method(struct voltagedomain *voltdm,
137  int voltscale_method);
138 int omap_voltage_late_init(void);
139 
140 extern void omap2xxx_voltagedomains_init(void);
141 extern void omap3xxx_voltagedomains_init(void);
142 extern void am33xx_voltagedomains_init(void);
143 extern void omap44xx_voltagedomains_init(void);
144 
145 struct voltagedomain *voltdm_lookup(const char *name);
146 void voltdm_init(struct voltagedomain **voltdm_list);
147 int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm);
148 int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user),
149  void *user);
150 int voltdm_for_each_pwrdm(struct voltagedomain *voltdm,
151  int (*fn)(struct voltagedomain *voltdm,
152  struct powerdomain *pwrdm));
153 int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);
154 void voltdm_reset(struct voltagedomain *voltdm);
155 unsigned long voltdm_get_voltage(struct voltagedomain *voltdm);
156 #endif