aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorOctavian Purdila <octavian.purdila@intel.com>2011-07-15 12:33:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-15 13:05:07 -0400
commit173b3de9a5817ec2c264eca1b8795c7dbda3c50e (patch)
treecd7283837722efe556601b045833b849fdfcf356 /drivers/staging
parent3de78a9dbf173952270e761c21f2df3a7e1ed256 (diff)
gma500: fix compile warnings when CONFIG_BACKLIGHT_CLASS_DEVICE is not defined
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> [Fixed up for other changes, and tidied some existing variable names] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/gma500/backlight.c2
-rw-r--r--drivers/staging/gma500/mdfld_dsi_output.c5
-rw-r--r--drivers/staging/gma500/psb_drv.c28
-rw-r--r--drivers/staging/gma500/psb_intel_lvds.c19
4 files changed, 24 insertions, 30 deletions
diff --git a/drivers/staging/gma500/backlight.c b/drivers/staging/gma500/backlight.c
index d3e698b4de61..20793951fcac 100644
--- a/drivers/staging/gma500/backlight.c
+++ b/drivers/staging/gma500/backlight.c
@@ -31,6 +31,8 @@ int gma_backlight_init(struct drm_device *dev)
31#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 31#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
32 struct drm_psb_private *dev_priv = dev->dev_private; 32 struct drm_psb_private *dev_priv = dev->dev_private;
33 return dev_priv->ops->backlight_init(dev); 33 return dev_priv->ops->backlight_init(dev);
34#else
35 return 0;
34#endif 36#endif
35} 37}
36 38
diff --git a/drivers/staging/gma500/mdfld_dsi_output.c b/drivers/staging/gma500/mdfld_dsi_output.c
index e911ef2431d1..ff75ece9dcf8 100644
--- a/drivers/staging/gma500/mdfld_dsi_output.c
+++ b/drivers/staging/gma500/mdfld_dsi_output.c
@@ -467,8 +467,6 @@ static int mdfld_dsi_connector_set_property(struct drm_connector * connector,
467 uint64_t value) 467 uint64_t value)
468{ 468{
469 struct drm_encoder * encoder = connector->encoder; 469 struct drm_encoder * encoder = connector->encoder;
470 struct backlight_device * psb_bd;
471 struct drm_psb_private * dev_priv = encoder->dev->dev_private;
472 470
473 if (!strcmp(property->name, "scaling mode") && encoder) { 471 if (!strcmp(property->name, "scaling mode") && encoder) {
474 struct psb_intel_crtc * psb_crtc = to_psb_intel_crtc(encoder->crtc); 472 struct psb_intel_crtc * psb_crtc = to_psb_intel_crtc(encoder->crtc);
@@ -515,13 +513,14 @@ static int mdfld_dsi_connector_set_property(struct drm_connector * connector,
515 } 513 }
516#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 514#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
517 } else if (!strcmp(property->name, "backlight") && encoder) { 515 } else if (!strcmp(property->name, "backlight") && encoder) {
516 struct drm_psb_private *dev_priv = encoder->dev->dev_private;
517 struct backlight_device *psb_bd = dev_priv->backlight_device;
518 dev_dbg(encoder->dev->dev, "backlight level = %d\n", (int)value); 518 dev_dbg(encoder->dev->dev, "backlight level = %d\n", (int)value);
519 if (drm_connector_property_set_value(connector, property, value)) 519 if (drm_connector_property_set_value(connector, property, value))
520 goto set_prop_error; 520 goto set_prop_error;
521 else { 521 else {
522 dev_dbg(encoder->dev->dev, 522 dev_dbg(encoder->dev->dev,
523 "set brightness to %d", (int)value); 523 "set brightness to %d", (int)value);
524 psb_bd = dev_priv->backlight_device;
525 if (psb_bd) { 524 if (psb_bd) {
526 psb_bd->props.brightness = value; 525 psb_bd->props.brightness = value;
527 backlight_update_status(psb_bd); 526 backlight_update_status(psb_bd);
diff --git a/drivers/staging/gma500/psb_drv.c b/drivers/staging/gma500/psb_drv.c
index f96a619cb63f..6b03951ebd04 100644
--- a/drivers/staging/gma500/psb_drv.c
+++ b/drivers/staging/gma500/psb_drv.c
@@ -536,20 +536,24 @@ static int psb_dc_state_ioctl(struct drm_device *dev, void * data,
536 return -EINVAL; 536 return -EINVAL;
537} 537}
538 538
539static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data, 539static inline void get_brightness(struct backlight_device *bd)
540 struct drm_file *file_priv)
541{ 540{
542 struct drm_psb_private *dev_priv = psb_priv(dev);
543 uint32_t *arg = data;
544 struct backlight_device *bd = dev_priv->backlight_device;
545 dev_priv->blc_adj2 = *arg;
546
547#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 541#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
548 if (bd) { 542 if (bd) {
549 bd->props.brightness = bd->ops->get_brightness(bd); 543 bd->props.brightness = bd->ops->get_brightness(bd);
550 backlight_update_status(bd); 544 backlight_update_status(bd);
551 } 545 }
552#endif 546#endif
547}
548
549static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data,
550 struct drm_file *file_priv)
551{
552 struct drm_psb_private *dev_priv = psb_priv(dev);
553 uint32_t *arg = data;
554
555 dev_priv->blc_adj2 = *arg;
556 get_brightness(dev_priv->backlight_device);
553 return 0; 557 return 0;
554} 558}
555 559
@@ -558,15 +562,9 @@ static int psb_adb_ioctl(struct drm_device *dev, void *data,
558{ 562{
559 struct drm_psb_private *dev_priv = psb_priv(dev); 563 struct drm_psb_private *dev_priv = psb_priv(dev);
560 uint32_t *arg = data; 564 uint32_t *arg = data;
561 struct backlight_device *bd = dev_priv->backlight_device;
562 dev_priv->blc_adj1 = *arg;
563 565
564#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 566 dev_priv->blc_adj1 = *arg;
565 if (bd) { 567 get_brightness(dev_priv->backlight_device);
566 bd->props.brightness = bd->ops->get_brightness(bd);
567 backlight_update_status(bd);
568 }
569#endif
570 return 0; 568 return 0;
571} 569}
572 570
diff --git a/drivers/staging/gma500/psb_intel_lvds.c b/drivers/staging/gma500/psb_intel_lvds.c
index 03132a4e7dfd..da6f5c89e5e7 100644
--- a/drivers/staging/gma500/psb_intel_lvds.c
+++ b/drivers/staging/gma500/psb_intel_lvds.c
@@ -467,8 +467,6 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
467 struct drm_display_mode *mode, 467 struct drm_display_mode *mode,
468 struct drm_display_mode *adjusted_mode) 468 struct drm_display_mode *adjusted_mode)
469{ 469{
470 struct psb_intel_mode_device *mode_dev =
471 enc_to_psb_intel_output(encoder)->mode_dev;
472 struct drm_device *dev = encoder->dev; 470 struct drm_device *dev = encoder->dev;
473 struct drm_psb_private *dev_priv = dev->dev_private; 471 struct drm_psb_private *dev_priv = dev->dev_private;
474 u32 pfit_control; 472 u32 pfit_control;
@@ -571,17 +569,14 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
571 uint64_t value) 569 uint64_t value)
572{ 570{
573 struct drm_encoder *encoder = connector->encoder; 571 struct drm_encoder *encoder = connector->encoder;
574 struct drm_psb_private *dev_priv;
575 572
576 if (!encoder) 573 if (!encoder)
577 return -1; 574 return -1;
578 575
579 dev_priv = encoder->dev->dev_private;
580
581 if (!strcmp(property->name, "scaling mode")) { 576 if (!strcmp(property->name, "scaling mode")) {
582 struct psb_intel_crtc *crtc = 577 struct psb_intel_crtc *crtc =
583 to_psb_intel_crtc(encoder->crtc); 578 to_psb_intel_crtc(encoder->crtc);
584 uint64_t curValue; 579 uint64_t curval;
585 580
586 if (!crtc) 581 if (!crtc)
587 goto set_prop_error; 582 goto set_prop_error;
@@ -599,10 +594,10 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
599 594
600 if (drm_connector_property_get_value(connector, 595 if (drm_connector_property_get_value(connector,
601 property, 596 property,
602 &curValue)) 597 &curval))
603 goto set_prop_error; 598 goto set_prop_error;
604 599
605 if (curValue == value) 600 if (curval == value)
606 goto set_prop_done; 601 goto set_prop_done;
607 602
608 if (drm_connector_property_set_value(connector, 603 if (drm_connector_property_set_value(connector,
@@ -626,8 +621,8 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
626 goto set_prop_error; 621 goto set_prop_error;
627 else { 622 else {
628#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 623#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
629 struct backlight_device *bd = 624 struct drm_psb_private *devp = encoder->dev->dev_private;
630 dev_priv->backlight_device; 625 struct backlight_device *bd = devp->backlight_device;
631 if (bd) { 626 if (bd) {
632 bd->props.brightness = value; 627 bd->props.brightness = value;
633 backlight_update_status(bd); 628 backlight_update_status(bd);
@@ -635,9 +630,9 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
635#endif 630#endif
636 } 631 }
637 } else if (!strcmp(property->name, "DPMS")) { 632 } else if (!strcmp(property->name, "DPMS")) {
638 struct drm_encoder_helper_funcs *pEncHFuncs 633 struct drm_encoder_helper_funcs *hfuncs
639 = encoder->helper_private; 634 = encoder->helper_private;
640 pEncHFuncs->dpms(encoder, value); 635 hfuncs->dpms(encoder, value);
641 } 636 }
642 637
643set_prop_done: 638set_prop_done: