Skip to content

Commit

Permalink
Revert "[OJ+GSensor] Fix intermitent shutdown of optical joystick"
Browse files Browse the repository at this point in the history
This reverts commit 3d49ce1.
  • Loading branch information
defer committed Jul 12, 2010
1 parent 08bd2e9 commit d711b6f
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions arch/arm/mach-msm/board-bravo-microp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* board-bravo-microp.c
*
* Copyright (C) 2009 Google.
* Copyright (C) 2009 HTC Corporation.
* Copyright (C) 2010 Giulio Cervera <giulio.cervera@gmail.com>
Expand Down Expand Up @@ -223,7 +222,6 @@ struct microp_i2c_client_data {
uint32_t als_kadc;
uint32_t als_gadc;
uint8_t als_calibrating;
uint32_t spi_devices_enabled;
};

static char *hex2string(uint8_t *data, int len)
Expand Down Expand Up @@ -1389,29 +1387,14 @@ static int microp_spi_enable(uint8_t on)
return ret;
}

/* Lookup active SPI devices and only turn it off when no device
* is using it
* */
int microp_spi_vote_enable(int spi_device, uint8_t enable) {
//XXX need to check that all that crap in the HTC kernel is needed
struct i2c_client *client = private_microp_client;
struct microp_i2c_client_data *cdata = i2c_get_clientdata(client);
int ret;

if (spi_device == SPI_OJ)
microp_oj_intr_enable(client, enable);

/* Add/remove it from the poll */
if (enable)
cdata->spi_devices_enabled |= spi_device;
else
cdata->spi_devices_enabled &= ~spi_device;

if (cdata->spi_devices_enabled)
enable = 1;
else enable = 0;


ret = microp_spi_enable(enable);
return ret;
}
Expand Down Expand Up @@ -1526,7 +1509,7 @@ static int gsensor_init_hw(void)

pr_debug("%s\n", __func__);

microp_spi_vote_enable(SPI_GSENSOR, 1);
microp_spi_enable(1);

ret = gsensor_read_reg(RANGE_BWIDTH_REG, &reg);
if (ret < 0 )
Expand All @@ -1552,7 +1535,7 @@ static int bma150_set_mode(char mode)

pr_debug("%s mode = %d\n", __func__, mode);
if (mode == BMA_MODE_NORMAL)
microp_spi_vote_enable(SPI_GSENSOR, 1);
microp_spi_enable(1);


ret = gsensor_read_reg(SMB150_CTRL_REG, &reg);
Expand All @@ -1562,7 +1545,7 @@ static int bma150_set_mode(char mode)
ret = gsensor_write_reg(SMB150_CTRL_REG, reg);

if (mode == BMA_MODE_SLEEP)
microp_spi_vote_enable(SPI_GSENSOR, 0);
microp_spi_enable(0);

return ret;
}
Expand Down Expand Up @@ -2046,7 +2029,6 @@ static int microp_i2c_probe(struct i2c_client *client,
cdata->microp_is_suspend = 0;
cdata->auto_backlight_enabled = 0;
cdata->light_sensor_enabled = 0;
cdata->spi_devices_enabled = 0;

wake_lock_init(&microp_i2c_wakelock, WAKE_LOCK_SUSPEND,
"microp_i2c_present");
Expand Down

0 comments on commit d711b6f

Please sign in to comment.