Skip to contentSkip to conversation

drm/i915: Print pwm device-name when using pwm for backlight control

PATCH In review Hans de Goede 2 participants 3 messages Jun 23, 2017 – Jun 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Print pwm device-name when using pwm for backlight control

On Bay Trail devices either the Crystal Cove PMIC's pwm or the LPSS' pwm is used to control the backlight. Other drivers take core of providing a backlight_pwm alias through pwm_add_table, but it is still useful to know which pwm device actually ends up being used for debugging backlight issues, so add a DRM_INFO logging the pwm device-name.

---
 drivers/gpu/drm/i915/intel_panel.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +3 -0
index cb50c527401f..7936a64af393 100644
@@ -1670,6 +1670,9 @@ static int pwm_setup_backlight(struct intel_connector *connector,
 				 CRC_PMIC_PWM_PERIOD_NS);
 	panel->backlight.enabled = panel->backlight.level != 0;
 
+	DRM_INFO("Using %s pwm-device for backlight control\n",
+		 dev_name(panel->backlight.pwm->chip->dev));
+
 	return 0;
 }
 
Signature · 6 lines
2.13.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 17 lines · Hans de Goede

On Bay Trail devices either the Crystal Cove PMIC's pwm or the LPSS' pwm is used to control the backlight. Other drivers take core of providing a backlight_pwm alias through pwm_add_table, but it is still useful to know which pwm device actually ends up being used for debugging backlight issues, so add a DRM_INFO logging the pwm device-name.

---
 drivers/gpu/drm/i915/intel_panel.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +0 -0
index cb50c527401f..7936a64af393 100644

drivers/gpu/drm/i915/intel_panel.c static int pwm_setup_backlight(struct intel_connector *connector, · line 1674

Quoted 5 lines
drivers/gpu/drm/i915/intel_panel.c +2 -0
@@ -1670,6 +1670,9 @@ static int pwm_setup_backlight(struct intel_connector *connector,
 				 CRC_PMIC_PWM_PERIOD_NS);
 	panel->backlight.enabled = panel->backlight.level != 0;
 
+	DRM_INFO("Using %s pwm-device for backlight control\n",
+		 dev_name(panel->backlight.pwm->chip->dev));

Is DRM_DEBUG_KMS() not enough?

Quoted 6 lines
drivers/gpu/drm/i915/intel_panel.c +1 -0
+
 	return 0;
 }
 
Signature · 1 line
2.13.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Hi,

Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Hans de Goede

On Bay Trail devices either the Crystal Cove PMIC's pwm or the LPSS' pwm is used to control the backlight. Other drivers take core of providing a backlight_pwm alias through pwm_add_table, but it is still useful to know which pwm device actually ends up being used for debugging backlight issues, so add a DRM_INFO logging the pwm device-name.

---
  drivers/gpu/drm/i915/intel_panel.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +0 -0
index cb50c527401f..7936a64af393 100644
@@ -1670,6 +1670,9 @@ static int pwm_setup_backlight(struct intel_connector *connector,
  				 CRC_PMIC_PWM_PERIOD_NS);
  	panel->backlight.enabled = panel->backlight.level != 0;
 
Quoted 4 lines

drivers/gpu/drm/i915/intel_panel.c static int pwm_setup_backlight(struct intel_connector *connector, · line 1674

Quoted 2 lines
drivers/gpu/drm/i915/intel_panel.c +2 -0
+	DRM_INFO("Using %s pwm-device for backlight control\n",
+		 dev_name(panel->backlight.pwm->chip->dev));

Is DRM_DEBUG_KMS() not enough?

I prefer DRM_INFO so that I can just ask users with backlight issues to do a dmesg and then see which pwm controller is being used.

Regards,

Hans
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel