From 01573e231f18eb2d99162747186f59511f56b64d Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 08 Dec 2023 10:40:48 +0000
Subject: [PATCH] 移去rt
---
kernel/drivers/input/sensors/sensor-dev.c | 42 ++++++++++++++++++------------------------
1 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/kernel/drivers/input/sensors/sensor-dev.c b/kernel/drivers/input/sensors/sensor-dev.c
index 3decfb1..eb93e19 100644
--- a/kernel/drivers/input/sensors/sensor-dev.c
+++ b/kernel/drivers/input/sensors/sensor-dev.c
@@ -40,7 +40,6 @@
#include <linux/compat.h>
#endif
#include <linux/soc/rockchip/rk_vendor_storage.h>
-#include <linux/regulator/consumer.h>
#define SENSOR_CALIBRATION_LEN 64
struct sensor_calibration_data {
@@ -546,10 +545,8 @@
struct i2c_client *client = sensor->client;
mutex_lock(&sensor->sensor_mutex);
- pm_stay_awake(&client->dev);
if (sensor->ops->report(client) < 0)
dev_err(&client->dev, "%s: Get data failed\n", __func__);
- pm_relax(&client->dev);
mutex_unlock(&sensor->sensor_mutex);
return IRQ_HANDLED;
@@ -562,7 +559,7 @@
int result = 0;
int irq;
- if ((sensor->pdata->irq_enable || sensor->pdata->wake_enable) && (sensor->pdata->irq_flags != SENSOR_UNKNOW_DATA)) {
+ if ((sensor->pdata->irq_enable) && (sensor->pdata->irq_flags != SENSOR_UNKNOW_DATA)) {
if (sensor->pdata->poll_delay_ms <= 0)
sensor->pdata->poll_delay_ms = 30;
result = gpio_request(client->irq, sensor->i2c_id->name);
@@ -578,10 +575,9 @@
client->irq = irq;
disable_irq_nosync(client->irq);
- dev_info(&client->dev, "%s:use irq=%d\n", __func__, irq);
- }
- if (!sensor->pdata->irq_enable) {
+ dev_info(&client->dev, "%s:use irq=%d\n", __func__, irq);
+ } else if (!sensor->pdata->irq_enable) {
INIT_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);
sensor->stop_work = 1;
if (sensor->pdata->poll_delay_ms <= 0)
@@ -634,13 +630,6 @@
if (sensor->ops->suspend)
sensor->ops->suspend(sensor->client);
- if (mem_sleep_current == PM_SUSPEND_MEM_LITE) {
- if (sensor->pdata->wake_enable) {
- enable_irq(sensor->client->irq);
- enable_irq_wake(sensor->client->irq);
- }
- }
-
return 0;
}
@@ -650,15 +639,6 @@
if (sensor->ops->resume)
sensor->ops->resume(sensor->client);
-
- if (mem_sleep_current == PM_SUSPEND_MEM_LITE) {
- if (sensor->pdata->wake_enable) {
- disable_irq_wake(sensor->client->irq);
- disable_irq(sensor->client->irq);
- }
- return 0;
- }
-
if (sensor->pdata->power_off_in_suspend)
sensor_initial(sensor->client);
@@ -1629,7 +1609,7 @@
pdata->irq_pin = of_get_named_gpio_flags(np, "irq-gpio", 0, (enum of_gpio_flags *)&irq_flags);
pdata->reset_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
pdata->power_pin = of_get_named_gpio_flags(np, "power-gpio", 0, &pwr_flags);
- pdata->wake_enable = of_property_read_bool(np, "wakeup-source");
+
of_property_read_u32(np, "irq_enable", &(pdata->irq_enable));
of_property_read_u32(np, "poll_delay_ms", &(pdata->poll_delay_ms));
@@ -1759,6 +1739,20 @@
pdata->orientation[8] = -1;
break;
+ case 9:
+ pdata->orientation[0] = -1;
+ pdata->orientation[1] = 0;
+ pdata->orientation[2] = 0;
+
+ pdata->orientation[3] = 0;
+ pdata->orientation[4] = -1;
+ pdata->orientation[5] = 0;
+
+ pdata->orientation[6] = 0;
+ pdata->orientation[7] = 0;
+ pdata->orientation[8] = -1;
+ break;
+
default:
pdata->orientation[0] = 1;
pdata->orientation[1] = 0;
--
Gitblit v1.6.2