diff options
author | Vince Hsu <vinceh@nvidia.com> | 2014-12-02 12:50:35 +0800 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-12-02 15:37:22 +1000 |
commit | 6420c0c7712af7494cea1b72b8101695fa9bed17 (patch) | |
tree | 7fd9859fa64ceedc44d04af4d0c581f742519c9e /lib | |
parent | 334cdba5b0b699040f273cc578b123cafb4313f8 (diff) |
volt: add support for GK20A
The voltage value are calculated by the hardware characterized
result.
Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/os.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/core/os.h b/lib/core/os.h index aea628eb..43570fb9 100644 --- a/lib/core/os.h +++ b/lib/core/os.h @@ -73,6 +73,16 @@ typedef dma_addr_t resource_size_t; #define upper_32_bits(a) ((a) >> 32) #define lower_32_bits(a) ((a) & 0xffffffff) #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define DIV_ROUND_CLOSEST(x, divisor)( \ +{ \ + typeof(x) __x = x; \ + typeof(divisor) __d = divisor; \ + (((typeof(x))-1) > 0 || \ + ((typeof(divisor))-1) > 0 || (__x) > 0) ? \ + (((__x) + ((__d) / 2)) / (__d)) : \ + (((__x) - ((__d) / 2)) / (__d)); \ +} \ +) #define do_div(a,b) (a) = (a) / (b) #define div_u64(a,b) (a) / (b) #define likely(a) (a) @@ -1142,15 +1152,36 @@ clk_get_rate(struct clk *clk) } /****************************************************************************** + * regulator + *****************************************************************************/ + +struct regulator { +}; + +static inline int +regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) +{ + return -ENOSYS; +} + +static inline int +regulator_get_voltage(struct regulator *regulator) +{ + return -ENOSYS; +} + +/****************************************************************************** * nouveau drm platform device *****************************************************************************/ struct nouveau_platform_gpu { struct clk *clk; + struct regulator *vdd; }; struct nouveau_platform_device { struct nouveau_platform_gpu *gpu; + int gpu_speedo; }; #define nv_device_to_platform(x) NULL |