aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_mipi_dsi.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-08-05 05:17:06 -0400
committerThierry Reding <treding@nvidia.com>2014-11-13 07:56:03 -0500
commit3d9a8fcf1c6a9032eb389d3c90323ae980c9d50a (patch)
tree0197a547bc4e1f44673a7a2707451b9ada1d1126 /drivers/gpu/drm/drm_mipi_dsi.c
parent2f16b89737e24b729305dcd4a3573c175615aa4c (diff)
drm/dsi: Implement DCS get_power_mode command
Provide a small convenience wrapper that transmits a DCS get_power_mode command. A set of bitmasks for the mode bits is also provided. Acked-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/drm_mipi_dsi.c')
-rw-r--r--drivers/gpu/drm/drm_mipi_dsi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index b3c28feff650..80d930191ce7 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -603,6 +603,31 @@ int mipi_dsi_dcs_soft_reset(struct mipi_dsi_device *dsi)
603EXPORT_SYMBOL(mipi_dsi_dcs_soft_reset); 603EXPORT_SYMBOL(mipi_dsi_dcs_soft_reset);
604 604
605/** 605/**
606 * mipi_dsi_dcs_get_power_mode() - query the display module's current power
607 * mode
608 * @dsi: DSI peripheral device
609 * @mode: return location for the current power mode
610 *
611 * Return: 0 on success or a negative error code on failure.
612 */
613int mipi_dsi_dcs_get_power_mode(struct mipi_dsi_device *dsi, u8 *mode)
614{
615 ssize_t err;
616
617 err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_POWER_MODE, mode,
618 sizeof(*mode));
619 if (err <= 0) {
620 if (err == 0)
621 err = -ENODATA;
622
623 return err;
624 }
625
626 return 0;
627}
628EXPORT_SYMBOL(mipi_dsi_dcs_get_power_mode);
629
630/**
606 * mipi_dsi_dcs_enter_sleep_mode() - disable all unnecessary blocks inside the 631 * mipi_dsi_dcs_enter_sleep_mode() - disable all unnecessary blocks inside the
607 * display module except interface communication 632 * display module except interface communication
608 * @dsi: DSI peripheral device 633 * @dsi: DSI peripheral device