[PATCH 06/11] drm/i915/gmbus: Add support to store scdc port in gmbus struct
Ankit Nautiyal
ankit.k.nautiyal at intel.com
Wed Mar 9 06:47:37 UTC 2022
If SCDC_RR is supported by the sink and the source, lets store the
corresponding port, so that we can enable SCDC_RR for the relavant
GPIO pins later.
This patch:
-Adds new field in intel_gmbus structure to store SCDC port
-Provides helper function to set/reset the field based on SCDC_RR
support.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
drivers/gpu/drm/i915/display/intel_gmbus.c | 13 +++++++++++++
drivers/gpu/drm/i915/display/intel_gmbus.h | 2 ++
2 files changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
index 2bb3494b93e2..ab5ae56f8a09 100644
--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
@@ -46,6 +46,7 @@ struct intel_gmbus {
i915_reg_t gpio_reg;
struct i2c_algo_bit_data bit_algo;
struct drm_i915_private *dev_priv;
+ enum scdc_pin scdc_port;
};
struct gmbus_pin {
@@ -992,3 +993,15 @@ void intel_gmbus_teardown(struct drm_i915_private *dev_priv)
dev_priv->gmbus[pin] = NULL;
}
}
+
+void intel_gmbus_set_scdc_port(struct i2c_adapter *adapter, enum scdc_pin port)
+{
+ struct intel_gmbus *bus = to_intel_gmbus(adapter);
+ struct drm_i915_private *dev_priv = bus->dev_priv;
+
+ mutex_lock(&dev_priv->gmbus_mutex);
+
+ bus->scdc_port = port;
+
+ mutex_unlock(&dev_priv->gmbus_mutex);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.h b/drivers/gpu/drm/i915/display/intel_gmbus.h
index 8edc2e99cf53..40744c84ac7c 100644
--- a/drivers/gpu/drm/i915/display/intel_gmbus.h
+++ b/drivers/gpu/drm/i915/display/intel_gmbus.h
@@ -10,6 +10,7 @@
struct drm_i915_private;
struct i2c_adapter;
+enum scdc_pin;
#define GMBUS_PIN_DISABLED 0
#define GMBUS_PIN_SSC 1
@@ -44,5 +45,6 @@ intel_gmbus_get_adapter(struct drm_i915_private *dev_priv, unsigned int pin);
void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter);
void intel_gmbus_reset(struct drm_i915_private *dev_priv);
+void intel_gmbus_set_scdc_port(struct i2c_adapter *adapter, enum scdc_pin port);
#endif /* __INTEL_GMBUS_H__ */
--
2.25.1
More information about the Intel-gfx-trybot
mailing list