Loading drivers/input/misc/bma2x2.c +42 −9 Original line number Diff line number Diff line Loading @@ -5218,6 +5218,18 @@ static int bma2x2_select_chanel(struct i2c_client *client) dev_err(&client->dev, "unknown sensor place\n"); return -EINVAL; } if (bma2x2_set_mode(client, BMA2X2_MODE_NORMAL) < 0) { dev_err(&client->dev, "set calibrate mode error\n"); return -EINVAL; } if (bma2x2_set_bandwidth(client, BMA2X2_BW_1000HZ) < 0) { dev_err(&client->dev, "set calibrate bandwidth error\n"); return -EINVAL; } if (bma2x2_set_range(client, BMA2X2_RANGE_SET) < 0) { dev_err(&client->dev, "set calibrate range error\n"); return -EINVAL; } for (i = 0; i < 3; i++) { if (bma2x2_set_offset_target(client, bmi058_channel_tb[i], (unsigned char)data_ore[i]) < 0) { Loading @@ -5225,8 +5237,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) "set offset target error\n"); return -EINVAL; } if (bma2x2_set_cal_trigger(bma2x2->bma2x2_client, (i + 1)) < 0) { if (bma2x2_set_cal_trigger(client, (i + 1)) < 0) { dev_err(&client->dev, "read calibration state error\n"); return -EINVAL; Loading @@ -5234,8 +5245,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) timeout = 0; do { WAIT_CAL_READY(); error = bma2x2_get_cal_ready(bma2x2->bma2x2_client, &tmp); error = bma2x2_get_cal_ready(client, &tmp); if (error < 0) { dev_err(&client->dev, "read cal_ready error\n"); Loading @@ -5250,6 +5260,11 @@ static int bma2x2_select_chanel(struct i2c_client *client) } while (tmp == 0); } bma2x2_set_bandwidth(client, bma2x2->bandwidth); if (error < 0) { dev_err(&client->dev, "restore calibrate bandwidth error\n"); return error; } return 0; } #else Loading @@ -5271,6 +5286,20 @@ static int bma2x2_select_chanel(struct i2c_client *client) dev_err(&client->dev, "unknown sensor place\n"); return -EINVAL; } if (bma2x2_set_mode(client, BMA2X2_MODE_NORMAL) < 0) { dev_err(&client->dev, "set calibrate mode error\n"); return -EINVAL; } if (bma2x2_set_bandwidth(client, BMA2X2_BW_1000HZ) < 0) { dev_err(&client->dev, "set calibrate bandwidth error\n"); return -EINVAL; } if (bma2x2_set_range(client, BMA2X2_RANGE_SET) < 0) { dev_err(&client->dev, "set calibrate range error\n"); return -EINVAL; } for (i = 0; i < 3; i++) { if (bma2x2_set_offset_target(client, channel_tab[i], (unsigned char)data_ore[i]) < 0) { Loading @@ -5278,8 +5307,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) "set offset target error\n"); return -EINVAL; } if (bma2x2_set_cal_trigger(bma2x2->bma2x2_client, (i + 1)) < 0) { if (bma2x2_set_cal_trigger(client, (i + 1)) < 0) { dev_err(&client->dev, "read calibration state error\n"); return -EINVAL; Loading @@ -5287,8 +5315,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) timeout = 0; do { WAIT_CAL_READY(); error = bma2x2_get_cal_ready(bma2x2->bma2x2_client, &tmp); error = bma2x2_get_cal_ready(client, &tmp); if (error < 0) { dev_err(&client->dev, "read cal_ready error\n"); Loading @@ -5303,6 +5330,12 @@ static int bma2x2_select_chanel(struct i2c_client *client) } while (tmp == 0); } error = bma2x2_set_bandwidth(client, bma2x2->bandwidth); if (error < 0) { dev_err(&client->dev, "restore calibrate bandwidth error\n"); return error; } return 0; } #endif Loading Loading @@ -5380,7 +5413,7 @@ static int bma2x2_eeprom_prog(struct i2c_client *client) dev_err(&client->dev, "read eeprom control reg error3\n"); return res; } databuf |= 0xFE; databuf &= 0xFE; res = bma2x2_smbus_write_byte(client, BMA2X2_EEPROM_CTRL_REG, &databuf); if (res < 0) { Loading Loading
drivers/input/misc/bma2x2.c +42 −9 Original line number Diff line number Diff line Loading @@ -5218,6 +5218,18 @@ static int bma2x2_select_chanel(struct i2c_client *client) dev_err(&client->dev, "unknown sensor place\n"); return -EINVAL; } if (bma2x2_set_mode(client, BMA2X2_MODE_NORMAL) < 0) { dev_err(&client->dev, "set calibrate mode error\n"); return -EINVAL; } if (bma2x2_set_bandwidth(client, BMA2X2_BW_1000HZ) < 0) { dev_err(&client->dev, "set calibrate bandwidth error\n"); return -EINVAL; } if (bma2x2_set_range(client, BMA2X2_RANGE_SET) < 0) { dev_err(&client->dev, "set calibrate range error\n"); return -EINVAL; } for (i = 0; i < 3; i++) { if (bma2x2_set_offset_target(client, bmi058_channel_tb[i], (unsigned char)data_ore[i]) < 0) { Loading @@ -5225,8 +5237,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) "set offset target error\n"); return -EINVAL; } if (bma2x2_set_cal_trigger(bma2x2->bma2x2_client, (i + 1)) < 0) { if (bma2x2_set_cal_trigger(client, (i + 1)) < 0) { dev_err(&client->dev, "read calibration state error\n"); return -EINVAL; Loading @@ -5234,8 +5245,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) timeout = 0; do { WAIT_CAL_READY(); error = bma2x2_get_cal_ready(bma2x2->bma2x2_client, &tmp); error = bma2x2_get_cal_ready(client, &tmp); if (error < 0) { dev_err(&client->dev, "read cal_ready error\n"); Loading @@ -5250,6 +5260,11 @@ static int bma2x2_select_chanel(struct i2c_client *client) } while (tmp == 0); } bma2x2_set_bandwidth(client, bma2x2->bandwidth); if (error < 0) { dev_err(&client->dev, "restore calibrate bandwidth error\n"); return error; } return 0; } #else Loading @@ -5271,6 +5286,20 @@ static int bma2x2_select_chanel(struct i2c_client *client) dev_err(&client->dev, "unknown sensor place\n"); return -EINVAL; } if (bma2x2_set_mode(client, BMA2X2_MODE_NORMAL) < 0) { dev_err(&client->dev, "set calibrate mode error\n"); return -EINVAL; } if (bma2x2_set_bandwidth(client, BMA2X2_BW_1000HZ) < 0) { dev_err(&client->dev, "set calibrate bandwidth error\n"); return -EINVAL; } if (bma2x2_set_range(client, BMA2X2_RANGE_SET) < 0) { dev_err(&client->dev, "set calibrate range error\n"); return -EINVAL; } for (i = 0; i < 3; i++) { if (bma2x2_set_offset_target(client, channel_tab[i], (unsigned char)data_ore[i]) < 0) { Loading @@ -5278,8 +5307,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) "set offset target error\n"); return -EINVAL; } if (bma2x2_set_cal_trigger(bma2x2->bma2x2_client, (i + 1)) < 0) { if (bma2x2_set_cal_trigger(client, (i + 1)) < 0) { dev_err(&client->dev, "read calibration state error\n"); return -EINVAL; Loading @@ -5287,8 +5315,7 @@ static int bma2x2_select_chanel(struct i2c_client *client) timeout = 0; do { WAIT_CAL_READY(); error = bma2x2_get_cal_ready(bma2x2->bma2x2_client, &tmp); error = bma2x2_get_cal_ready(client, &tmp); if (error < 0) { dev_err(&client->dev, "read cal_ready error\n"); Loading @@ -5303,6 +5330,12 @@ static int bma2x2_select_chanel(struct i2c_client *client) } while (tmp == 0); } error = bma2x2_set_bandwidth(client, bma2x2->bandwidth); if (error < 0) { dev_err(&client->dev, "restore calibrate bandwidth error\n"); return error; } return 0; } #endif Loading Loading @@ -5380,7 +5413,7 @@ static int bma2x2_eeprom_prog(struct i2c_client *client) dev_err(&client->dev, "read eeprom control reg error3\n"); return res; } databuf |= 0xFE; databuf &= 0xFE; res = bma2x2_smbus_write_byte(client, BMA2X2_EEPROM_CTRL_REG, &databuf); if (res < 0) { Loading