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

drm/mipi-dbi: Support separate I/O regulator

The MIPI DBI specification defines separate vdd (panel power) and
vddi (I/O voltage) supplies. Displays that require different voltages
for the different supplies do exist, so the supplies cannot be
combined into one as they are now. Add a new io_regulator property to
the mipi_dbi_dev struct which can be set by the panel driver along
with the regulator property.

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221201160245.2093816-2-otto.pflueger@abscue.de

authored by

Otto Pflüger and committed by
Noralf Trønnes
3b1fb8b3 58377de4

+20 -1
+14
drivers/gpu/drm/drm_mipi_dbi.c
··· 417 417 418 418 if (dbidev->regulator) 419 419 regulator_disable(dbidev->regulator); 420 + if (dbidev->io_regulator) 421 + regulator_disable(dbidev->io_regulator); 420 422 } 421 423 EXPORT_SYMBOL(mipi_dbi_pipe_disable); 422 424 ··· 728 726 } 729 727 } 730 728 729 + if (dbidev->io_regulator) { 730 + ret = regulator_enable(dbidev->io_regulator); 731 + if (ret) { 732 + DRM_DEV_ERROR(dev, "Failed to enable I/O regulator (%d)\n", ret); 733 + if (dbidev->regulator) 734 + regulator_disable(dbidev->regulator); 735 + return ret; 736 + } 737 + } 738 + 731 739 if (cond && mipi_dbi_display_is_on(dbi)) 732 740 return 1; 733 741 ··· 747 735 DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret); 748 736 if (dbidev->regulator) 749 737 regulator_disable(dbidev->regulator); 738 + if (dbidev->io_regulator) 739 + regulator_disable(dbidev->io_regulator); 750 740 return ret; 751 741 } 752 742
+6 -1
include/drm/drm_mipi_dbi.h
··· 123 123 struct backlight_device *backlight; 124 124 125 125 /** 126 - * @regulator: power regulator (optional) 126 + * @regulator: power regulator (Vdd) (optional) 127 127 */ 128 128 struct regulator *regulator; 129 + 130 + /** 131 + * @io_regulator: I/O power regulator (Vddi) (optional) 132 + */ 133 + struct regulator *io_regulator; 129 134 130 135 /** 131 136 * @dbi: MIPI DBI interface