diff options
author | Werner Johansson <werner.johansson@sonymobile.com> | 2015-10-30 20:38:26 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-11-24 04:25:14 -0500 |
commit | 6e8c9e33760d0d0f8450f5ac55d10b085e07e136 (patch) | |
tree | 72426017bdedd80d9ed6b09246e104a1e56bd7dd | |
parent | 086ceb6b42caca65d726818b56b1e73c63df5b9e (diff) |
drm/dsi: Add Turn On/Shutdown Peripheral command helpers
The MIPI_DSI_TURN_ON_PERIPHERAL and MIPI_DSI_SHUTDOWN_PERIPHERAL packets
are required for some panels, for example the Panasonic VVX10F034N00.
Signed-off-by: Werner Johansson <werner.johansson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/drm/drm_mipi_dsi.c | 38 | ||||
-rw-r--r-- | include/drm/drm_mipi_dsi.h | 2 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 2d5ca8eec13a..6e6a9c58d404 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c | |||
@@ -365,6 +365,44 @@ int mipi_dsi_create_packet(struct mipi_dsi_packet *packet, | |||
365 | } | 365 | } |
366 | EXPORT_SYMBOL(mipi_dsi_create_packet); | 366 | EXPORT_SYMBOL(mipi_dsi_create_packet); |
367 | 367 | ||
368 | /** | ||
369 | * mipi_dsi_shutdown_peripheral() - sends a Shutdown Peripheral command | ||
370 | * @dsi: DSI peripheral device | ||
371 | * | ||
372 | * Return: 0 on success or a negative error code on failure. | ||
373 | */ | ||
374 | int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi) | ||
375 | { | ||
376 | struct mipi_dsi_msg msg = { | ||
377 | .channel = dsi->channel, | ||
378 | .type = MIPI_DSI_SHUTDOWN_PERIPHERAL, | ||
379 | .tx_buf = (u8 [2]) { 0, 0 }, | ||
380 | .tx_len = 2, | ||
381 | }; | ||
382 | |||
383 | return mipi_dsi_device_transfer(dsi, &msg); | ||
384 | } | ||
385 | EXPORT_SYMBOL(mipi_dsi_shutdown_peripheral); | ||
386 | |||
387 | /** | ||
388 | * mipi_dsi_turn_on_peripheral() - sends a Turn On Peripheral command | ||
389 | * @dsi: DSI peripheral device | ||
390 | * | ||
391 | * Return: 0 on success or a negative error code on failure. | ||
392 | */ | ||
393 | int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi) | ||
394 | { | ||
395 | struct mipi_dsi_msg msg = { | ||
396 | .channel = dsi->channel, | ||
397 | .type = MIPI_DSI_TURN_ON_PERIPHERAL, | ||
398 | .tx_buf = (u8 [2]) { 0, 0 }, | ||
399 | .tx_len = 2, | ||
400 | }; | ||
401 | |||
402 | return mipi_dsi_device_transfer(dsi, &msg); | ||
403 | } | ||
404 | EXPORT_SYMBOL(mipi_dsi_turn_on_peripheral); | ||
405 | |||
368 | /* | 406 | /* |
369 | * mipi_dsi_set_maximum_return_packet_size() - specify the maximum size of the | 407 | * mipi_dsi_set_maximum_return_packet_size() - specify the maximum size of the |
370 | * the payload in a long packet transmitted from the peripheral back to the | 408 | * the payload in a long packet transmitted from the peripheral back to the |
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 4396c9f22af5..1b3b1f8c8cdf 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h | |||
@@ -191,6 +191,8 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt) | |||
191 | struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np); | 191 | struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np); |
192 | int mipi_dsi_attach(struct mipi_dsi_device *dsi); | 192 | int mipi_dsi_attach(struct mipi_dsi_device *dsi); |
193 | int mipi_dsi_detach(struct mipi_dsi_device *dsi); | 193 | int mipi_dsi_detach(struct mipi_dsi_device *dsi); |
194 | int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi); | ||
195 | int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi); | ||
194 | int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, | 196 | int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, |
195 | u16 value); | 197 | u16 value); |
196 | 198 | ||