summaryrefslogtreecommitdiff
path: root/lib/core/os.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/os.h')
-rw-r--r--lib/core/os.h31
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