aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorYoungJun Cho <yj44.cho@samsung.com>2014-08-05 03:27:15 -0400
committerThierry Reding <treding@nvidia.com>2014-11-13 07:55:44 -0500
commitdbf30b695809b88fd650dab4028156fb85c5f2d9 (patch)
treea54bd01563191ac5b681fe64676ae94bba2ab98a /drivers/gpu
parented6ff40ee72cc6d384a0aea5efa10c526350e84a (diff)
drm/dsi: Add mipi_dsi_set_maximum_return_packet_size() helper
This function can be used to set the maximum return packet size for a MIPI DSI peripheral. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> [treding: endianess, kerneldoc, return value] Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_mipi_dsi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 388c3ab02500..60177a3e16be 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -332,6 +332,30 @@ int mipi_dsi_create_packet(struct mipi_dsi_packet *packet,
332} 332}
333EXPORT_SYMBOL(mipi_dsi_create_packet); 333EXPORT_SYMBOL(mipi_dsi_create_packet);
334 334
335/*
336 * mipi_dsi_set_maximum_return_packet_size() - specify the maximum size of the
337 * the payload in a long packet transmitted from the peripheral back to the
338 * host processor
339 * @dsi: DSI peripheral device
340 * @value: the maximum size of the payload
341 *
342 * Return: 0 on success or a negative error code on failure.
343 */
344int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi,
345 u16 value)
346{
347 u8 tx[2] = { value & 0xff, value >> 8 };
348 struct mipi_dsi_msg msg = {
349 .channel = dsi->channel,
350 .type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
351 .tx_len = sizeof(tx),
352 .tx_buf = tx,
353 };
354
355 return mipi_dsi_device_transfer(dsi, &msg);
356}
357EXPORT_SYMBOL(mipi_dsi_set_maximum_return_packet_size);
358
335/** 359/**
336 * mipi_dsi_dcs_write_buffer() - transmit a DCS command with payload 360 * mipi_dsi_dcs_write_buffer() - transmit a DCS command with payload
337 * @dsi: DSI peripheral device 361 * @dsi: DSI peripheral device