Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/dsi: Implement DCS set_{column,page}_address commands

Provide small convenience wrappers to set the column and page extents of
the frame memory accessed by the host processors.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

+52
+48
drivers/gpu/drm/drm_mipi_dsi.c
··· 729 729 EXPORT_SYMBOL(mipi_dsi_dcs_set_display_on); 730 730 731 731 /** 732 + * mipi_dsi_dcs_set_column_address() - define the column extent of the frame 733 + * memory accessed by the host processor 734 + * @dsi: DSI peripheral device 735 + * @start: first column of frame memory 736 + * @end: last column of frame memory 737 + * 738 + * Return: 0 on success or a negative error code on failure. 739 + */ 740 + int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, 741 + u16 end) 742 + { 743 + u8 payload[4] = { start >> 8, start & 0xff, end >> 8, end & 0xff }; 744 + ssize_t err; 745 + 746 + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_COLUMN_ADDRESS, payload, 747 + sizeof(payload)); 748 + if (err < 0) 749 + return err; 750 + 751 + return 0; 752 + } 753 + EXPORT_SYMBOL(mipi_dsi_dcs_set_column_address); 754 + 755 + /** 756 + * mipi_dsi_dcs_set_page_address() - define the page extent of the frame 757 + * memory accessed by the host processor 758 + * @dsi: DSI peripheral device 759 + * @start: first page of frame memory 760 + * @end: last page of frame memory 761 + * 762 + * Return: 0 on success or a negative error code on failure. 763 + */ 764 + int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, 765 + u16 end) 766 + { 767 + u8 payload[4] = { start >> 8, start & 0xff, end >> 8, end & 0xff }; 768 + ssize_t err; 769 + 770 + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_PAGE_ADDRESS, payload, 771 + sizeof(payload)); 772 + if (err < 0) 773 + return err; 774 + 775 + return 0; 776 + } 777 + EXPORT_SYMBOL(mipi_dsi_dcs_set_page_address); 778 + 779 + /** 732 780 * mipi_dsi_dcs_set_tear_off() - turn off the display module's Tearing Effect 733 781 * output signal on the TE signal line 734 782 * @dsi: DSI peripheral device
+4
include/drm/drm_mipi_dsi.h
··· 205 205 int mipi_dsi_dcs_exit_sleep_mode(struct mipi_dsi_device *dsi); 206 206 int mipi_dsi_dcs_set_display_off(struct mipi_dsi_device *dsi); 207 207 int mipi_dsi_dcs_set_display_on(struct mipi_dsi_device *dsi); 208 + int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, 209 + u16 end); 210 + int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, 211 + u16 end); 208 212 int mipi_dsi_dcs_set_tear_off(struct mipi_dsi_device *dsi); 209 213 int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, 210 214 enum mipi_dsi_dcs_tear_mode mode);