Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259691
b: refs/heads/master
c: b21fb57
h: refs/heads/master
i:
  259689: ad5d4c3
  259687: cedbc98
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent d4ac8f7 commit a5d3b8d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3835ce2e69ff06c48984290e474b936a0fb56973
refs/heads/master: b21fb57908c02a9cc0a62edcffc7fba00286e6d2
2 changes: 1 addition & 1 deletion trunk/drivers/staging/gma500/cdv_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void cdv_get_core_freq(struct drm_device *dev)
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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/gma500/psb_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static void psb_get_core_freq(struct drm_device *dev)
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;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/gma500/psb_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ static int psb_driver_unload(struct drm_device *dev)

if (dev_priv) {
psb_lid_timer_takedown(dev_priv);
intel_opregion_exit(dev);

psb_do_takedown(dev);

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/staging/gma500/psb_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,10 @@ extern int mdfld_enable_te(struct drm_device *dev, int pipe);
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
Expand Down
14 changes: 11 additions & 3 deletions trunk/drivers/staging/gma500/psb_intel_opregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ struct opregion_acpi {
/*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;
Expand All @@ -68,6 +67,15 @@ int psb_intel_opregion_init(struct drm_device *dev)
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;
}

6 changes: 3 additions & 3 deletions trunk/drivers/staging/gma500/psb_lid.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ static void psb_lid_timer_func(unsigned long data)
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 {
Expand All @@ -54,7 +54,7 @@ static void psb_lid_timer_func(unsigned long data)
}
/* 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);
Expand Down

0 comments on commit a5d3b8d

Please sign in to comment.