summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/radeon/radeon_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/radeon/radeon_i2c.c')
-rw-r--r--sys/dev/pci/drm/radeon/radeon_i2c.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_i2c.c b/sys/dev/pci/drm/radeon/radeon_i2c.c
index fad85fb4781..e291b7d9b99 100644
--- a/sys/dev/pci/drm/radeon/radeon_i2c.c
+++ b/sys/dev/pci/drm/radeon/radeon_i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_i2c.c,v 1.3 2014/02/15 12:40:08 jsg Exp $ */
+/* $OpenBSD: radeon_i2c.c,v 1.4 2015/02/10 06:19:36 jsg Exp $ */
/*
* Copyright 2007-8 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -115,7 +115,7 @@ pre_xfer(void *cookie)
else
reg = RADEON_GPIO_CRT2_DDC;
- rw_enter_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_lock(&rdev->dc_hw_i2c_mutex);
if (rec->a_clk_reg == reg) {
WREG32(RADEON_DVI_I2C_CNTL_0, (RADEON_I2C_SOFT_RST |
R200_DVI_I2C_PIN_SEL(R200_SEL_DDC1)));
@@ -123,7 +123,7 @@ pre_xfer(void *cookie)
WREG32(RADEON_DVI_I2C_CNTL_0, (RADEON_I2C_SOFT_RST |
R200_DVI_I2C_PIN_SEL(R200_SEL_DDC3)));
}
- rw_exit_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_unlock(&rdev->dc_hw_i2c_mutex);
}
}
@@ -433,9 +433,9 @@ static int r100_hw_i2c_xfer(struct i2c_controller *i2c_adap,
u32 i2c_cntl_0, i2c_cntl_1, i2c_data;
u32 tmp, reg;
- rw_enter_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_lock(&rdev->dc_hw_i2c_mutex);
/* take the pm lock since we need a constant sclk */
- rw_enter_write(&rdev->pm.rwlock);
+ mutex_lock(&rdev->pm.mutex);
prescale = radeon_get_i2c_prescale(rdev);
@@ -665,8 +665,8 @@ done:
WREG32(RADEON_BIOS_6_SCRATCH, tmp);
}
- rw_exit_write(&rdev->pm.rwlock);
- rw_exit_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_unlock(&rdev->pm.mutex);
+ mutex_unlock(&rdev->dc_hw_i2c_mutex);
return ret;
}
@@ -686,9 +686,9 @@ static int r500_hw_i2c_xfer(struct i2c_controller *i2c_adap,
u32 tmp, reg;
u32 saved1, saved2;
- rw_enter_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_lock(&rdev->dc_hw_i2c_mutex);
/* take the pm lock since we need a constant sclk */
- rw_enter_write(&rdev->pm.rwlock);
+ mutex_lock(&rdev->pm.mutex);
prescale = radeon_get_i2c_prescale(rdev);
@@ -901,8 +901,8 @@ done:
tmp &= ~ATOM_S6_HW_I2C_BUSY_STATE;
WREG32(RADEON_BIOS_6_SCRATCH, tmp);
- rw_exit_write(&rdev->pm.rwlock);
- rw_exit_write(&rdev->dc_hw_i2c_rwlock);
+ mutex_unlock(&rdev->pm.mutex);
+ mutex_unlock(&rdev->dc_hw_i2c_mutex);
return ret;
}