summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2016-01-13 13:52:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-19 14:24:45 -0800
commitd5ae5bc3702946c27ec5d9a84dfa3b32bb3664d2 (patch)
tree4ed62652016a904101448781e097f0c64137c2be /common
parent7b89bb029edfb74e79cc76acae4cf4690518d84c (diff)
downloadchrome-ec-d5ae5bc3702946c27ec5d9a84dfa3b32bb3664d2.tar.gz
I2C: Remove raw mode mutex
The raw mode mutex is no longer needed as the return to I2C mode is now done per pin, and not for the entire I2C module. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: Ibe9b1acb8bf89cadb3f3a3ab4c70dc06969f48b0 Reviewed-on: https://chromium-review.googlesource.com/321458 Commit-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/i2c.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/common/i2c.c b/common/i2c.c
index daf758aaa1..a051722a28 100644
--- a/common/i2c.c
+++ b/common/i2c.c
@@ -303,7 +303,6 @@ void i2c_raw_set_sda(int port, int level)
int i2c_raw_mode(int port, int enable)
{
enum gpio_signal sda, scl;
- static struct mutex raw_mode_mutex;
/* Get the SDA and SCL pins for this port. If none, then return. */
if (get_sda_from_i2c_port(port, &sda) != EC_SUCCESS)
@@ -313,15 +312,6 @@ int i2c_raw_mode(int port, int enable)
if (enable) {
/*
- * Lock access to raw mode functionality. Note, this is
- * necessary because when we exit raw mode, we put all I2C
- * ports into normal mode. This means that if another port
- * is using the raw mode capabilities, that port will be
- * re-configured from underneath it.
- */
- mutex_lock(&raw_mode_mutex);
-
- /*
* To enable raw mode, take out of alternate function mode and
* set the flags to open drain output.
*/
@@ -343,8 +333,6 @@ int i2c_raw_mode(int port, int enable)
ret_scl = gpio_config_pins(MODULE_I2C, gpio_list[scl].port,
gpio_list[scl].mask, 1);
- /* Unlock mutex, allow other I2C busses to use raw mode. */
- mutex_unlock(&raw_mode_mutex);
return ret_sda == EC_SUCCESS ? ret_scl : ret_sda;
}