Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 130ca019 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: sensors: add sensors max delay time"

parents a8973d21 c037d562
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -131,6 +131,7 @@ static struct sensors_classdev sensors_cdev = {
	.resolution = "0.6",
	.resolution = "0.6",
	.sensor_power = "0.35",
	.sensor_power = "0.35",
	.min_delay = 10000,
	.min_delay = 10000,
	.max_delay = 10000,
	.fifo_reserved_event_count = 0,
	.fifo_reserved_event_count = 0,
	.fifo_max_event_count = 0,
	.fifo_max_event_count = 0,
	.enabled = 0,
	.enabled = 0,
+1 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,7 @@ static struct sensors_classdev sensors_cdev = {
	.resolution = "0.15",
	.resolution = "0.15",
	.sensor_power = "0.35",
	.sensor_power = "0.35",
	.min_delay = 10000,
	.min_delay = 10000,
	.max_delay = 10000,
	.fifo_reserved_event_count = 0,
	.fifo_reserved_event_count = 0,
	.fifo_max_event_count = 0,
	.fifo_max_event_count = 0,
	.enabled = 0,
	.enabled = 0,
+2 −0
Original line number Original line Diff line number Diff line
@@ -194,6 +194,7 @@ static struct sensors_classdev als_cdev = {
	.resolution = "1.0",
	.resolution = "1.0",
	.sensor_power = "0.35",
	.sensor_power = "0.35",
	.min_delay = 100000,
	.min_delay = 100000,
	.max_delay = 1375,
	.fifo_reserved_event_count = 0,
	.fifo_reserved_event_count = 0,
	.fifo_max_event_count = 0,
	.fifo_max_event_count = 0,
	.flags = 2,
	.flags = 2,
@@ -216,6 +217,7 @@ static struct sensors_classdev ps_cdev = {
	.resolution = "1.0",
	.resolution = "1.0",
	.sensor_power = "0.35",
	.sensor_power = "0.35",
	.min_delay = 5000,
	.min_delay = 5000,
	.max_delay = 1280,
	.fifo_reserved_event_count = 0,
	.fifo_reserved_event_count = 0,
	.fifo_max_event_count = 0,
	.fifo_max_event_count = 0,
	.flags = 3,
	.flags = 3,
+6 −0
Original line number Original line Diff line number Diff line
@@ -1375,6 +1375,9 @@ static const struct interrupt_map_t int_map[] = {
#define POLL_INTERVAL_MAX_MS	4000
#define POLL_INTERVAL_MAX_MS	4000
#define POLL_DEFAULT_INTERVAL_MS 200
#define POLL_DEFAULT_INTERVAL_MS 200


/* Interrupt delay in msecs */
#define BMA_INT_MAX_DELAY	64

#define MAX_RANGE_MAP	4
#define MAX_RANGE_MAP	4


struct bma2x2_type_map_t {
struct bma2x2_type_map_t {
@@ -1539,6 +1542,7 @@ static struct sensors_classdev sensors_cdev = {
		.resolution = "0.153125",	/* 15.6mg */
		.resolution = "0.153125",	/* 15.6mg */
		.sensor_power = "0.13",	/* typical value */
		.sensor_power = "0.13",	/* typical value */
		.min_delay = POLL_INTERVAL_MIN_MS * 1000, /* in microseconds */
		.min_delay = POLL_INTERVAL_MIN_MS * 1000, /* in microseconds */
		.max_delay = POLL_INTERVAL_MAX_MS,
		.max_latency = POLL_INTERVAL_MAX_MS,
		.max_latency = POLL_INTERVAL_MAX_MS,
		.fifo_reserved_event_count = 0,
		.fifo_reserved_event_count = 0,
		.fifo_max_event_count = 0,
		.fifo_max_event_count = 0,
@@ -7450,6 +7454,8 @@ static int bma2x2_probe(struct i2c_client *client,
	data->cdev.sensors_poll_delay = bma2x2_cdev_poll_delay;
	data->cdev.sensors_poll_delay = bma2x2_cdev_poll_delay;
	data->cdev.sensors_self_test = bma2x2_self_calibration_xyz;
	data->cdev.sensors_self_test = bma2x2_self_calibration_xyz;
	data->cdev.resolution = sensor_type_map[data->chip_type].resolution;
	data->cdev.resolution = sensor_type_map[data->chip_type].resolution;
	if (pdata->use_int)
		data->cdev.max_delay = BMA_INT_MAX_DELAY;
	err = sensors_classdev_register(&client->dev, &data->cdev);
	err = sensors_classdev_register(&client->dev, &data->cdev);
	if (err) {
	if (err) {
		dev_err(&client->dev, "create class device file failed!\n");
		dev_err(&client->dev, "create class device file failed!\n");
+4 −0
Original line number Original line Diff line number Diff line
@@ -230,6 +230,9 @@
#define BATCH_MODE_NORMAL		0
#define BATCH_MODE_NORMAL		0
#define BATCH_MODE_WAKE_UPON_FIFO_FULL	2
#define BATCH_MODE_WAKE_UPON_FIFO_FULL	2


/* interrput mode for sensor max delay ms */
#define LIS_INT_MAX_DELAY	1000

enum {
enum {
	LIS3DH_BYPASS_MODE = 0,
	LIS3DH_BYPASS_MODE = 0,
	LIS3DH_FIFO_MODE,
	LIS3DH_FIFO_MODE,
@@ -2185,6 +2188,7 @@ static int lis3dh_acc_probe(struct i2c_client *client,
		acc->cdev.sensors_flush = lis3dh_acc_flush;
		acc->cdev.sensors_flush = lis3dh_acc_flush;
		acc->cdev.fifo_reserved_event_count = LIS3DH_FIFO_SIZE;
		acc->cdev.fifo_reserved_event_count = LIS3DH_FIFO_SIZE;
		acc->cdev.fifo_max_event_count = LIS3DH_FIFO_SIZE;
		acc->cdev.fifo_max_event_count = LIS3DH_FIFO_SIZE;
		acc->cdev.max_delay = LIS_INT_MAX_DELAY;
	}
	}
	err = sensors_classdev_register(&client->dev, &acc->cdev);
	err = sensors_classdev_register(&client->dev, &acc->cdev);
	if (err) {
	if (err) {
Loading