staging: gma500: psb_reset actually holds lid functions
authorAlan Cox <alan@linux.jf.intel.com>
Fri, 1 Apr 2011 17:44:16 +0000 (18:44 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Apr 2011 18:36:35 +0000 (11:36 -0700)
So rename the file something sensible

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/gma500/Makefile
drivers/staging/gma500/psb_lid.c [new file with mode: 0644]
drivers/staging/gma500/psb_reset.c [deleted file]

index 4d7aabe7e37c63671a4cc10d324d9b3608441e57..e00557e40a594dd9a0d61cc05a4563c8ce11d5ff 100644 (file)
@@ -15,7 +15,7 @@ psb_gfx-y += psb_bl.o \
          psb_intel_lvds.o \
          psb_intel_modes.o \
          psb_intel_sdvo.o \
-         psb_reset.o \
+         psb_lid.o \
          psb_pvr_glue.o \
          psb_mmu.o \
          psb_powermgmt.o \
diff --git a/drivers/staging/gma500/psb_lid.c b/drivers/staging/gma500/psb_lid.c
new file mode 100644 (file)
index 0000000..21fd202
--- /dev/null
@@ -0,0 +1,90 @@
+/**************************************************************************
+ * Copyright (c) 2007, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Authors: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
+ **************************************************************************/
+
+#include <drm/drmP.h>
+#include "psb_drv.h"
+#include "psb_reg.h"
+#include "psb_intel_reg.h"
+#include <linux/spinlock.h>
+
+static void psb_lid_timer_func(unsigned long data)
+{
+       struct drm_psb_private * dev_priv = (struct drm_psb_private *)data;
+       struct drm_device *dev = (struct drm_device *)dev_priv->dev;
+       struct timer_list *lid_timer = &dev_priv->lid_timer;
+       unsigned long irq_flags;
+       u32 *lid_state = dev_priv->lid_state;
+       u32 pp_status;
+
+       if (*lid_state == dev_priv->lid_last_state)
+               goto lid_timer_schedule;
+
+       if ((*lid_state) & 0x01) {
+               /*lid state is open*/
+               REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON);
+               do {
+                       pp_status = REG_READ(PP_STATUS);
+               } while ((pp_status & PP_ON) == 0);
+
+               /*FIXME: should be backlight level before*/
+               psb_intel_lvds_set_brightness(dev, 100);
+       } else {
+               psb_intel_lvds_set_brightness(dev, 0);
+
+               REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) & ~POWER_TARGET_ON);
+               do {
+                       pp_status = REG_READ(PP_STATUS);
+               } while ((pp_status & PP_ON) == 0);
+       }
+               /* printk(KERN_INFO"%s: lid: closed\n", __FUNCTION__); */
+
+       dev_priv->lid_last_state =  *lid_state;
+
+lid_timer_schedule:
+       spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
+       if (!timer_pending(lid_timer)) {
+               lid_timer->expires = jiffies + PSB_LID_DELAY;
+               add_timer(lid_timer);
+       }
+       spin_unlock_irqrestore(&dev_priv->lid_lock, irq_flags);
+}
+
+void psb_lid_timer_init(struct drm_psb_private *dev_priv)
+{
+       struct timer_list *lid_timer = &dev_priv->lid_timer;
+       unsigned long irq_flags;
+
+       spin_lock_init(&dev_priv->lid_lock);
+       spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
+
+       init_timer(lid_timer);
+
+       lid_timer->data = (unsigned long)dev_priv;
+       lid_timer->function = psb_lid_timer_func;
+       lid_timer->expires = jiffies + PSB_LID_DELAY;
+
+       add_timer(lid_timer);
+       spin_unlock_irqrestore(&dev_priv->lid_lock, irq_flags);
+}
+
+void psb_lid_timer_takedown(struct drm_psb_private *dev_priv)
+{
+       del_timer_sync(&dev_priv->lid_timer);
+}
+
diff --git a/drivers/staging/gma500/psb_reset.c b/drivers/staging/gma500/psb_reset.c
deleted file mode 100644 (file)
index 21fd202..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/**************************************************************************
- * Copyright (c) 2007, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Authors: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
- **************************************************************************/
-
-#include <drm/drmP.h>
-#include "psb_drv.h"
-#include "psb_reg.h"
-#include "psb_intel_reg.h"
-#include <linux/spinlock.h>
-
-static void psb_lid_timer_func(unsigned long data)
-{
-       struct drm_psb_private * dev_priv = (struct drm_psb_private *)data;
-       struct drm_device *dev = (struct drm_device *)dev_priv->dev;
-       struct timer_list *lid_timer = &dev_priv->lid_timer;
-       unsigned long irq_flags;
-       u32 *lid_state = dev_priv->lid_state;
-       u32 pp_status;
-
-       if (*lid_state == dev_priv->lid_last_state)
-               goto lid_timer_schedule;
-
-       if ((*lid_state) & 0x01) {
-               /*lid state is open*/
-               REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON);
-               do {
-                       pp_status = REG_READ(PP_STATUS);
-               } while ((pp_status & PP_ON) == 0);
-
-               /*FIXME: should be backlight level before*/
-               psb_intel_lvds_set_brightness(dev, 100);
-       } else {
-               psb_intel_lvds_set_brightness(dev, 0);
-
-               REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) & ~POWER_TARGET_ON);
-               do {
-                       pp_status = REG_READ(PP_STATUS);
-               } while ((pp_status & PP_ON) == 0);
-       }
-               /* printk(KERN_INFO"%s: lid: closed\n", __FUNCTION__); */
-
-       dev_priv->lid_last_state =  *lid_state;
-
-lid_timer_schedule:
-       spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
-       if (!timer_pending(lid_timer)) {
-               lid_timer->expires = jiffies + PSB_LID_DELAY;
-               add_timer(lid_timer);
-       }
-       spin_unlock_irqrestore(&dev_priv->lid_lock, irq_flags);
-}
-
-void psb_lid_timer_init(struct drm_psb_private *dev_priv)
-{
-       struct timer_list *lid_timer = &dev_priv->lid_timer;
-       unsigned long irq_flags;
-
-       spin_lock_init(&dev_priv->lid_lock);
-       spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
-
-       init_timer(lid_timer);
-
-       lid_timer->data = (unsigned long)dev_priv;
-       lid_timer->function = psb_lid_timer_func;
-       lid_timer->expires = jiffies + PSB_LID_DELAY;
-
-       add_timer(lid_timer);
-       spin_unlock_irqrestore(&dev_priv->lid_lock, irq_flags);
-}
-
-void psb_lid_timer_takedown(struct drm_psb_private *dev_priv)
-{
-       del_timer_sync(&dev_priv->lid_timer);
-}
-