Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272185
b: refs/heads/master
c: ec400c9
h: refs/heads/master
i:
  272183: 5623e2b
v: v3
  • Loading branch information
Mark Brown authored and Linus Torvalds committed Nov 1, 2011
1 parent 88bb58e commit 4766869
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 895c156c044a736d8dc2239020f4530bb6245675
refs/heads/master: ec400c9fab99d16a491cea17d27d0c6a5780b97c
34 changes: 12 additions & 22 deletions trunk/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ static int lis3_i2c_init(struct lis3lv02d *lis3)
u8 reg;
int ret;

if (lis3->reg_ctrl)
lis3_reg_ctrl(lis3, LIS3_REG_ON);
lis3_reg_ctrl(lis3, LIS3_REG_ON);

lis3->read(lis3, WHO_AM_I, &reg);
if (reg != lis3->whoami)
Expand All @@ -106,10 +105,6 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
struct lis3lv02d_platform_data *pdata = client->dev.platform_data;

if (pdata) {
/* Regulator control is optional */
if (pdata->driver_features & LIS3_USE_REGULATOR_CTRL)
lis3_dev.reg_ctrl = lis3_reg_ctrl;

if ((pdata->driver_features & LIS3_USE_BLOCK_READ) &&
(i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_I2C_BLOCK)))
Expand All @@ -131,15 +126,13 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
goto fail;
}

if (lis3_dev.reg_ctrl) {
lis3_dev.regulators[0].supply = reg_vdd;
lis3_dev.regulators[1].supply = reg_vdd_io;
ret = regulator_bulk_get(&client->dev,
ARRAY_SIZE(lis3_dev.regulators),
lis3_dev.regulators);
if (ret < 0)
goto fail;
}
lis3_dev.regulators[0].supply = reg_vdd;
lis3_dev.regulators[1].supply = reg_vdd_io;
ret = regulator_bulk_get(&client->dev,
ARRAY_SIZE(lis3_dev.regulators),
lis3_dev.regulators);
if (ret < 0)
goto fail;

lis3_dev.pdata = pdata;
lis3_dev.bus_priv = client;
Expand All @@ -153,13 +146,11 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
i2c_set_clientdata(client, &lis3_dev);

/* Provide power over the init call */
if (lis3_dev.reg_ctrl)
lis3_reg_ctrl(&lis3_dev, LIS3_REG_ON);
lis3_reg_ctrl(&lis3_dev, LIS3_REG_ON);

ret = lis3lv02d_init_device(&lis3_dev);

if (lis3_dev.reg_ctrl)
lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);

if (ret)
goto fail2;
Expand All @@ -185,9 +176,8 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client)
lis3lv02d_joystick_disable(lis3);
lis3lv02d_remove_fs(&lis3_dev);

if (lis3_dev.reg_ctrl)
regulator_bulk_free(ARRAY_SIZE(lis3->regulators),
lis3_dev.regulators);
regulator_bulk_free(ARRAY_SIZE(lis3->regulators),
lis3_dev.regulators);
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/lis3lv02d.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ struct lis3lv02d_platform_data {
s8 axis_x;
s8 axis_y;
s8 axis_z;
#define LIS3_USE_REGULATOR_CTRL 0x01
#define LIS3_USE_BLOCK_READ 0x02
u16 driver_features;
int default_rate;
Expand Down

0 comments on commit 4766869

Please sign in to comment.