Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
diff --git a/drivers/gpio/sx150x.c b/drivers/gpio/sx150x.c
index a4f7353..93b94bd 100644
--- a/drivers/gpio/sx150x.c
+++ b/drivers/gpio/sx150x.c
@@ -8,11 +8,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
*/
#include <linux/gpio.h>
#include <linux/i2c.h>
@@ -189,9 +184,9 @@
return err;
}
-static void sx150x_set_oscio(struct sx150x_chip *chip, int val)
+static s32 sx150x_set_oscio(struct sx150x_chip *chip, int val)
{
- sx150x_i2c_write(chip->client,
+ return sx150x_i2c_write(chip->client,
chip->dev_cfg->reg_clock,
(val ? 0x1f : 0x10));
}
@@ -286,11 +281,13 @@
chip = container_of(gc, struct sx150x_chip, gpio_chip);
- if (!offset_is_oscio(chip, offset)) {
- mutex_lock(&chip->lock);
+ mutex_lock(&chip->lock);
+ if (offset_is_oscio(chip, offset))
+ status = sx150x_set_oscio(chip, val);
+ else
status = sx150x_io_output(chip, offset, val);
- mutex_unlock(&chip->lock);
- }
+ mutex_unlock(&chip->lock);
+
return status;
}