static int cdv_chip_setup(struct drm_device *dev)
{
cdv_get_core_freq(dev);
- psb_intel_opregion_init(dev);
+ intel_opregion_init(dev);
psb_intel_init_bios(dev);
return 0;
}
static int psb_chip_setup(struct drm_device *dev)
{
psb_get_core_freq(dev);
- psb_intel_opregion_init(dev);
+ intel_opregion_init(dev);
psb_intel_init_bios(dev);
return 0;
}
if (dev_priv) {
psb_lid_timer_takedown(dev_priv);
+ intel_opregion_exit(dev);
psb_do_takedown(dev);
extern void mdfld_disable_te(struct drm_device *dev, int pipe);
/*
- * psb_opregion.c
+ * intel_opregion.c
*/
-extern int psb_intel_opregion_init(struct drm_device *dev);
+extern int intel_opregion_init(struct drm_device *dev);
+extern int intel_opregion_exit(struct drm_device *dev);
/*
* framebuffer.c
/*FIXME: add it later*/
} __packed;
-int psb_intel_opregion_init(struct drm_device *dev)
+int intel_opregion_init(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = dev->dev_private;
- /*struct psb_intel_opregion * opregion = &dev_priv->opregion;*/
u32 opregion_phy;
void *base;
u32 *lid_state;
lid_state = base + 0x01ac;
dev_priv->lid_state = lid_state;
- dev_priv->lid_last_state = *lid_state;
+ dev_priv->lid_last_state = readl(lid_state);
return 0;
}
+
+int intel_opregion_exit(struct drm_device *dev)
+{
+ struct drm_psb_private *dev_priv = dev->dev_private;
+ if (dev_priv->lid_state)
+ iounmap(dev_priv->lid_state);
+ return 0;
+}
+
\ No newline at end of file
u32 *lid_state = dev_priv->lid_state;
u32 pp_status;
- if (*lid_state == dev_priv->lid_last_state)
+ if (readl(lid_state) == dev_priv->lid_last_state)
goto lid_timer_schedule;
- if ((*lid_state) & 0x01) {
+ if ((readl(lid_state)) & 0x01) {
/*lid state is open*/
REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON);
do {
}
/* printk(KERN_INFO"%s: lid: closed\n", __FUNCTION__); */
- dev_priv->lid_last_state = *lid_state;
+ dev_priv->lid_last_state = readl(lid_state);
lid_timer_schedule:
spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);