Skip to contentSkip to conversation

drm/radeon: only add the mm i2c bus if the hw_i2c module param is set

PATCH In review [email protected] 2 participants 2 messages Apr 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: only add the mm i2c bus if the hw_i2c module param is set

From: Alex Deucher <[email protected]>

It seems it can corrupt the monitor EDID in certain cases on certain boards when running sensors detect. It's rarely used anyway outside of AIW boards.

http://lists.lm-sensors.org/pipermail/lm-sensors/2012-April/035847.html
http://lists.freedesktop.org/archives/xorg/2011-January/052239.html

---
 drivers/gpu/drm/radeon/radeon_i2c.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_i2c.c +4 -0
index 85bcfc8..3edec1c 100644
@@ -900,6 +900,10 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
 	struct radeon_i2c_chan *i2c;
 	int ret;
 
+	/* don't add the mm_i2c bus unless hw_i2c is enabled */
+	if (rec->mm_i2c && (radeon_hw_i2c == 0))
+		return NULL;
+
 	i2c = kzalloc(sizeof(struct radeon_i2c_chan), GFP_KERNEL);
 	if (i2c == NULL)
 		return NULL;
Signature · 1 line
1.7.7.5
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · On Tue, 10 Apr 2012 12:14:27 -0400, [email protected] wrote:

From: Alex Deucher <[email protected]>

It seems it can corrupt the monitor EDID in certain cases on certain boards when running sensors detect. It's rarely used anyway outside of AIW boards.

http://lists.lm-sensors.org/pipermail/lm-sensors/2012-April/035847.html
http://lists.freedesktop.org/archives/xorg/2011-January/052239.html

---
 drivers/gpu/drm/radeon/radeon_i2c.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_i2c.c +0 -0
index 85bcfc8..3edec1c 100644

drivers/gpu/drm/radeon/radeon_i2c.c struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, · line 909

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_i2c.c +4 -0
@@ -900,6 +900,10 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
 	struct radeon_i2c_chan *i2c;
 	int ret;
 
+	/* don't add the mm_i2c bus unless hw_i2c is enabled */
+	if (rec->mm_i2c && (radeon_hw_i2c == 0))
+		return NULL;
+
 	i2c = kzalloc(sizeof(struct radeon_i2c_chan), GFP_KERNEL);
 	if (i2c == NULL)
 		return NULL;

Thanks Alex!

Signature · 1 line
Jean Delvare