Unverified Commit 2e0727c3 authored by Giedrius Statkevičius's avatar Giedrius Statkevičius Committed by Rodrigo Vivi
Browse files

drm/i915/lspcon: do not hardcode settle timeout



Avoid hardcoding the LSPCON settle timeout because it takes a longer
time on certain chips made by certain vendors. Use the function that
already exists to determine the timeout.

Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: default avatarGiedrius Statkevičius <giedriuswork@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017075725.207384-1-giedriuswork@gmail.com


Acked-by: default avatarSimona Vetter <simona.vetter@ffwll.ch>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent f14d81b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -486,16 +486,16 @@ EXPORT_SYMBOL(drm_lspcon_get_mode);
 * @dev: &drm_device to use
 * @adapter: I2C-over-aux adapter
 * @mode: required mode of operation
 * @time_out: LSPCON mode change settle timeout
 *
 * Returns:
 * 0 on success, -error on failure/timeout
 */
int drm_lspcon_set_mode(const struct drm_device *dev, struct i2c_adapter *adapter,
			enum drm_lspcon_mode mode)
			enum drm_lspcon_mode mode, int time_out)
{
	u8 data = 0;
	int ret;
	int time_out = 200;
	enum drm_lspcon_mode current_mode;

	if (mode == DRM_LSPCON_MODE_PCON)
+2 −1
Original line number Diff line number Diff line
@@ -212,7 +212,8 @@ static int lspcon_change_mode(struct intel_lspcon *lspcon,
		return 0;
	}

	err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, ddc, mode);
	err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, ddc, mode,
				  lspcon_get_mode_settle_timeout(lspcon));
	if (err < 0) {
		drm_err(display->drm, "LSPCON mode change failed\n");
		return err;
+1 −1
Original line number Diff line number Diff line
@@ -117,5 +117,5 @@ const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type);
int drm_lspcon_get_mode(const struct drm_device *dev, struct i2c_adapter *adapter,
			enum drm_lspcon_mode *current_mode);
int drm_lspcon_set_mode(const struct drm_device *dev, struct i2c_adapter *adapter,
			enum drm_lspcon_mode reqd_mode);
			enum drm_lspcon_mode reqd_mode, int time_out);
#endif