hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/input/sensors/sensor-dev.c
....@@ -40,7 +40,6 @@
4040 #include <linux/compat.h>
4141 #endif
4242 #include <linux/soc/rockchip/rk_vendor_storage.h>
43
-#include <linux/regulator/consumer.h>
4443
4544 #define SENSOR_CALIBRATION_LEN 64
4645 struct sensor_calibration_data {
....@@ -546,10 +545,8 @@
546545 struct i2c_client *client = sensor->client;
547546
548547 mutex_lock(&sensor->sensor_mutex);
549
- pm_stay_awake(&client->dev);
550548 if (sensor->ops->report(client) < 0)
551549 dev_err(&client->dev, "%s: Get data failed\n", __func__);
552
- pm_relax(&client->dev);
553550 mutex_unlock(&sensor->sensor_mutex);
554551
555552 return IRQ_HANDLED;
....@@ -562,7 +559,7 @@
562559 int result = 0;
563560 int irq;
564561
565
- if ((sensor->pdata->irq_enable || sensor->pdata->wake_enable) && (sensor->pdata->irq_flags != SENSOR_UNKNOW_DATA)) {
562
+ if ((sensor->pdata->irq_enable) && (sensor->pdata->irq_flags != SENSOR_UNKNOW_DATA)) {
566563 if (sensor->pdata->poll_delay_ms <= 0)
567564 sensor->pdata->poll_delay_ms = 30;
568565 result = gpio_request(client->irq, sensor->i2c_id->name);
....@@ -578,10 +575,9 @@
578575
579576 client->irq = irq;
580577 disable_irq_nosync(client->irq);
581
- dev_info(&client->dev, "%s:use irq=%d\n", __func__, irq);
582
- }
583578
584
- if (!sensor->pdata->irq_enable) {
579
+ dev_info(&client->dev, "%s:use irq=%d\n", __func__, irq);
580
+ } else if (!sensor->pdata->irq_enable) {
585581 INIT_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);
586582 sensor->stop_work = 1;
587583 if (sensor->pdata->poll_delay_ms <= 0)
....@@ -634,13 +630,6 @@
634630 if (sensor->ops->suspend)
635631 sensor->ops->suspend(sensor->client);
636632
637
- if (mem_sleep_current == PM_SUSPEND_MEM_LITE) {
638
- if (sensor->pdata->wake_enable) {
639
- enable_irq(sensor->client->irq);
640
- enable_irq_wake(sensor->client->irq);
641
- }
642
- }
643
-
644633 return 0;
645634 }
646635
....@@ -650,15 +639,6 @@
650639
651640 if (sensor->ops->resume)
652641 sensor->ops->resume(sensor->client);
653
-
654
- if (mem_sleep_current == PM_SUSPEND_MEM_LITE) {
655
- if (sensor->pdata->wake_enable) {
656
- disable_irq_wake(sensor->client->irq);
657
- disable_irq(sensor->client->irq);
658
- }
659
- return 0;
660
- }
661
-
662642 if (sensor->pdata->power_off_in_suspend)
663643 sensor_initial(sensor->client);
664644
....@@ -1629,7 +1609,7 @@
16291609 pdata->irq_pin = of_get_named_gpio_flags(np, "irq-gpio", 0, (enum of_gpio_flags *)&irq_flags);
16301610 pdata->reset_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
16311611 pdata->power_pin = of_get_named_gpio_flags(np, "power-gpio", 0, &pwr_flags);
1632
- pdata->wake_enable = of_property_read_bool(np, "wakeup-source");
1612
+
16331613 of_property_read_u32(np, "irq_enable", &(pdata->irq_enable));
16341614 of_property_read_u32(np, "poll_delay_ms", &(pdata->poll_delay_ms));
16351615
....@@ -1759,6 +1739,20 @@
17591739 pdata->orientation[8] = -1;
17601740 break;
17611741
1742
+ case 9:
1743
+ pdata->orientation[0] = -1;
1744
+ pdata->orientation[1] = 0;
1745
+ pdata->orientation[2] = 0;
1746
+
1747
+ pdata->orientation[3] = 0;
1748
+ pdata->orientation[4] = -1;
1749
+ pdata->orientation[5] = 0;
1750
+
1751
+ pdata->orientation[6] = 0;
1752
+ pdata->orientation[7] = 0;
1753
+ pdata->orientation[8] = -1;
1754
+ break;
1755
+
17621756 default:
17631757 pdata->orientation[0] = 1;
17641758 pdata->orientation[1] = 0;