summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin Garg <nitin.garg@freescale.com>2012-02-20 16:06:41 -0600
committerNitin Garg <nitin.garg@freescale.com>2012-02-20 16:06:41 -0600
commitcda08fb5c79d5403827124c43756cb439179f433 (patch)
treea3e472a375961f658d0ea999b868186338771b67
parente22d9cc2d6b18e9dadf716bf320ac37a980ff91c (diff)
ENGR00174723-3: Integrate the mag3110 and mxc_mma8451
Intergrate the mag3110 and mxc_mma8451 drivers released by sensor team. Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
-rw-r--r--drivers/hwmon/mxc_mma8451.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/hwmon/mxc_mma8451.c b/drivers/hwmon/mxc_mma8451.c
index d33449566639..bd8d7f155b44 100644
--- a/drivers/hwmon/mxc_mma8451.c
+++ b/drivers/hwmon/mxc_mma8451.c
@@ -201,12 +201,6 @@ static int mma8451_change_mode(struct i2c_client *client, int mode)
/* Set the Active bit and Data rate in CTRL Reg 1 */
mma_status.active = MMA_STANDBY;
- mma_status.ctl_reg1 |= (DR_80_0MS<<3);
- result = i2c_smbus_write_byte_data(client, MMA8451_CTRL_REG1,
- mma_status.ctl_reg1);
- if (result < 0)
- goto out;
-
mdelay(MODE_CHANGE_DELAY_MS);
return 0;
@@ -300,10 +294,14 @@ static ssize_t mma8451_enable_store(struct device *dev,
mutex_lock(&mma8451_lock);
client = mma8451_i2c_client;
enable = (enable > 0) ? 1 : 0;
+
if (enable && mma_status.active == MMA_STANDBY) {
val = i2c_smbus_read_byte_data(client, MMA8451_CTRL_REG1);
+ /* Set the Active bit and Data rate in CTRL Reg 1 */
+ val |= (DR_80_0MS<<3);
+ val |= 1;
ret = i2c_smbus_write_byte_data(client, MMA8451_CTRL_REG1,
- val|0x01);
+ val);
if (!ret) {
mma_status.active = MMA_ACTIVED;
printk(KERN_DEBUG "mma enable setting active\n");
@@ -410,7 +408,7 @@ static int __devinit mma8451_probe(struct i2c_client *client,
mma8451_idev->poll_interval_min = POLL_INTERVAL_MIN;
mma8451_idev->poll_interval_max = POLL_INTERVAL_MAX;
idev = mma8451_idev->input;
- idev->name = MMA8451_DRV_NAME;
+ idev->name = "mma845x";
idev->id.bustype = BUS_I2C;
idev->evbit[0] = BIT_MASK(EV_ABS);