gma500: Read the GCT panel type information for Medfield
authorAlan Cox <alan@linux.intel.com>
Tue, 5 Jul 2011 14:39:06 +0000 (15:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Jul 2011 15:20:41 +0000 (08:20 -0700)
Missed in the original merge work

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/gma500/mrst_bios.c

index 0d944c47bc908b530abb56204e469134bef81bc4..103777b6776a0bcdc93d0112bd3f835824f52ec6 100644 (file)
 #include "psb_drm.h"
 #include "psb_drv.h"
 #include "mrst_bios.h"
+#include "mdfld_output.h"
+
+static int panel_id;
+module_param_named(panel_id, panel_id, int, 0600);
+MODULE_PARM_DESC(panel_id, "Panel Identifier");
+
 
 void mrst_get_fuse_settings(struct drm_device *dev)
 {
@@ -231,6 +237,27 @@ void mrst_get_vbt_data(struct drm_psb_private *dev_priv)
                dev_err(dev->dev, "Unknown revision of GCT!\n");
                vbt->size = 0;
        }
-       /* FIXME: Need to sort out Medfield panel identifiers in future */
+       if (IS_MDFLD(dev_priv->dev)){
+               if (panel_id == GCT_DETECT) {
+                       if (dev_priv->gct_data.bpi == 2) {
+                               dev_info(dev->dev, "[GFX] PYR Panel Detected\n");
+                               dev_priv->panel_id = PYR_CMD;
+                               panel_id = PYR_CMD;
+                       }
+                       else if(dev_priv->gct_data.bpi == 0) {
+                               dev_info(dev->dev, "[GFX] TMD Panel Detected.\n");
+                               dev_priv->panel_id = TMD_VID;
+                               panel_id = TMD_VID;
+                       }
+                       else {
+                               dev_info(dev->dev, "[GFX] Default Panel (TPO)\n");
+                               dev_priv->panel_id = TPO_CMD;
+                               panel_id = TPO_CMD;
+                       }
+               } else {
+                       dev_info(dev->dev, "[GFX] Panel Parameter Passed in through cmd line\n");
+                       dev_priv->panel_id = panel_id;
+               }
+       }
 }