summaryrefslogtreecommitdiffstats
path: root/drivers/staging/gma500/psb_drv.h
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-07-05 15:38:26 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-05 08:20:40 -0700
commit92367fe1bca91efa7f689127ba45080d4303d609 (patch)
treee90f61df9661bf409aa371cbc94069a60bef5117 /drivers/staging/gma500/psb_drv.h
parentbcc70a64a443ec19f84bb0dc3268d2c95b52e209 (diff)
downloadop-kernel-dev-92367fe1bca91efa7f689127ba45080d4303d609.zip
op-kernel-dev-92367fe1bca91efa7f689127ba45080d4303d609.tar.gz
gma500: being abstracting out devices a bit more
We really want to move towards a completely abstracted interface rather than having tons of per chip junk in the same files. Begin with the power code which is probably the worst offender. Add a set of methods, initialise a dev_priv->ops pointer and rip the chip specifics out of the power code. While we are it pick up the display init bits. So we know it's now chip specifics clean remove the psb_ naming from it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/gma500/psb_drv.h')
-rw-r--r--drivers/staging/gma500/psb_drv.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/staging/gma500/psb_drv.h b/drivers/staging/gma500/psb_drv.h
index 3b2ee08..d1c49e7 100644
--- a/drivers/staging/gma500/psb_drv.h
+++ b/drivers/staging/gma500/psb_drv.h
@@ -258,11 +258,11 @@ struct psb_intel_opregion {
int enabled;
};
+struct psb_ops;
struct drm_psb_private {
struct drm_device *dev;
-
- unsigned long chipset;
+ const struct psb_ops *ops;
struct psb_gtt *pg;
@@ -612,6 +612,23 @@ struct drm_psb_private {
};
+/*
+ * Operations for each board type
+ */
+
+struct psb_ops {
+ /* Display management hooks */
+ int (*output_init)(struct drm_device *dev);
+ /* Power management hooks */
+ void (*init_pm)(struct drm_device *dev);
+ int (*save_regs)(struct drm_device *dev);
+ int (*restore_regs)(struct drm_device *dev);
+ int (*power_up)(struct drm_device *dev);
+ int (*power_down)(struct drm_device *dev);
+};
+
+
+
struct psb_mmu_driver;
extern int drm_crtc_probe_output_modes(struct drm_device *dev, int, int);
@@ -761,6 +778,14 @@ extern int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset);
extern int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+/* psb_device.c */
+extern const struct psb_ops psb_chip_ops;
+
+/* mrst_device.c */
+extern const struct psb_ops mrst_chip_ops;
+
+/* mdfld_device.c */
+extern const struct psb_ops mdfld_chip_ops;
/*
* Debug print bits setting
OpenPOWER on IntegriCloud