diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-07-10 22:06:34 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-16 09:27:09 -0400 |
commit | c600040f0d1fecbbe4582c00d99d8f5c4ffd0390 (patch) | |
tree | 5d7b878d2e0aaa814f768693101213e1a46d48f4 /drivers/mfd | |
parent | 706c96b7208b6b4f070b7f5c104ea917c48043f5 (diff) |
mfd: Remove unneeded io_mutex from struct twl6040
Current code has been converted to use regmap APIs, the io_mutex is not needed.
Thus remove the io_mutex.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/twl6040-core.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c index 4ded9e7aa24..5f620ae3b1f 100644 --- a/drivers/mfd/twl6040-core.c +++ b/drivers/mfd/twl6040-core.c | |||
@@ -64,19 +64,15 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) | |||
64 | int ret; | 64 | int ret; |
65 | unsigned int val; | 65 | unsigned int val; |
66 | 66 | ||
67 | mutex_lock(&twl6040->io_mutex); | ||
68 | /* Vibra control registers from cache */ | 67 | /* Vibra control registers from cache */ |
69 | if (unlikely(reg == TWL6040_REG_VIBCTLL || | 68 | if (unlikely(reg == TWL6040_REG_VIBCTLL || |
70 | reg == TWL6040_REG_VIBCTLR)) { | 69 | reg == TWL6040_REG_VIBCTLR)) { |
71 | val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)]; | 70 | val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)]; |
72 | } else { | 71 | } else { |
73 | ret = regmap_read(twl6040->regmap, reg, &val); | 72 | ret = regmap_read(twl6040->regmap, reg, &val); |
74 | if (ret < 0) { | 73 | if (ret < 0) |
75 | mutex_unlock(&twl6040->io_mutex); | ||
76 | return ret; | 74 | return ret; |
77 | } | ||
78 | } | 75 | } |
79 | mutex_unlock(&twl6040->io_mutex); | ||
80 | 76 | ||
81 | return val; | 77 | return val; |
82 | } | 78 | } |
@@ -86,12 +82,10 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val) | |||
86 | { | 82 | { |
87 | int ret; | 83 | int ret; |
88 | 84 | ||
89 | mutex_lock(&twl6040->io_mutex); | ||
90 | ret = regmap_write(twl6040->regmap, reg, val); | 85 | ret = regmap_write(twl6040->regmap, reg, val); |
91 | /* Cache the vibra control registers */ | 86 | /* Cache the vibra control registers */ |
92 | if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR) | 87 | if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR) |
93 | twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val; | 88 | twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val; |
94 | mutex_unlock(&twl6040->io_mutex); | ||
95 | 89 | ||
96 | return ret; | 90 | return ret; |
97 | } | 91 | } |
@@ -99,23 +93,13 @@ EXPORT_SYMBOL(twl6040_reg_write); | |||
99 | 93 | ||
100 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) | 94 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
101 | { | 95 | { |
102 | int ret; | 96 | return regmap_update_bits(twl6040->regmap, reg, mask, mask); |
103 | |||
104 | mutex_lock(&twl6040->io_mutex); | ||
105 | ret = regmap_update_bits(twl6040->regmap, reg, mask, mask); | ||
106 | mutex_unlock(&twl6040->io_mutex); | ||
107 | return ret; | ||
108 | } | 97 | } |
109 | EXPORT_SYMBOL(twl6040_set_bits); | 98 | EXPORT_SYMBOL(twl6040_set_bits); |
110 | 99 | ||
111 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) | 100 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
112 | { | 101 | { |
113 | int ret; | 102 | return regmap_update_bits(twl6040->regmap, reg, mask, 0); |
114 | |||
115 | mutex_lock(&twl6040->io_mutex); | ||
116 | ret = regmap_update_bits(twl6040->regmap, reg, mask, 0); | ||
117 | mutex_unlock(&twl6040->io_mutex); | ||
118 | return ret; | ||
119 | } | 103 | } |
120 | EXPORT_SYMBOL(twl6040_clear_bits); | 104 | EXPORT_SYMBOL(twl6040_clear_bits); |
121 | 105 | ||
@@ -573,7 +557,6 @@ static int __devinit twl6040_probe(struct i2c_client *client, | |||
573 | twl6040->irq = client->irq; | 557 | twl6040->irq = client->irq; |
574 | 558 | ||
575 | mutex_init(&twl6040->mutex); | 559 | mutex_init(&twl6040->mutex); |
576 | mutex_init(&twl6040->io_mutex); | ||
577 | init_completion(&twl6040->ready); | 560 | init_completion(&twl6040->ready); |
578 | 561 | ||
579 | twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV); | 562 | twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV); |