summaryrefslogtreecommitdiff
path: root/drivers/iio/common/cros_ec_sensors
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-26 11:14:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-26 11:14:21 -0700
commit8900d92fd666d936a7bfb4c567ac26736a414fb4 (patch)
tree19c37bab5adc8d40d825cb629edf0e8a337955a2 /drivers/iio/common/cros_ec_sensors
parentc01c0716ccf5db2086d9693033472f37de96a699 (diff)
parentc295d3007ff63064181befa734d9705dfc10b396 (diff)
Merge tag 'staging-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO driver updates from Greg KH: "Here is the big set of staging and IIO driver updates for 5.13-rc1. Lots of little churn in here, and some larger churn as well. Major things are: - removal of wimax drivers, no one has this hardware anymore for this failed "experiment". - removal of the Google gasket driver, turns out no one wanted to maintain it or cares about it anymore, so they asked for it to be removed. - comedi finally moves out of the staging directory into drivers/comedi This is one of the oldest kernel subsystems around, being created in the 2.0 kernel days, and was one of the first things added to drivers/staging/ when that was created over 15 years ago. It should have been moved out of staging a long time ago, it's well maintained and used by loads of different devices in the real world every day. Nice to see this finally happen. - so many tiny coding style cleanups it's not funny. Perfect storm of at least 2 different intern project application deadlines combined to provide a huge number of new contributions in this area from people learning how to do kernel development. Great job to everyone involved here. There's also the normal updates for IIO drivers with new IIO drivers and updates all over that subsystem. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (907 commits) staging: octeon: Use 'for_each_child_of_node' Staging: rtl8723bs: rtw_xmit: fixed tabbing issue staging: rtl8188eu: remove unused function parameters staging: rtl8188eu: cmdThread is a task_struct staging: rtl8188eu: remove constant variable and dead code staging: rtl8188eu: change bLeisurePs' type to bool staging: rtl8723bs: remove empty #ifdef block staging: rtl8723bs: remove unused DBG_871X_LEVEL macro declarations staging: rtl8723bs: split too long line staging: rtl8723bs: fix indentation in if block staging: rtl8723bs: fix code indent issue staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*() staging: rtl8192e: indent statement properly staging: rtl8723bs: Remove led_blink_hdl() and everything related staging: comedi: move out of staging directory staging: rtl8723bs: remove sdio_drv_priv structure staging: rtl8723bs: remove unused argument in function staging: rtl8723bs: remove DBG_871X_SEL_NL macro declaration staging: rtl8723bs: replace DBG_871X_SEL_NL with netdev_dbg() staging: rtl8723bs: fix indentation issue introduced by long line split ...
Diffstat (limited to 'drivers/iio/common/cros_ec_sensors')
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c3
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c3
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c33
3 files changed, 13 insertions, 26 deletions
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c b/drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c
index 752f59037715..af801e203623 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c
@@ -97,8 +97,7 @@ static int cros_ec_lid_angle_probe(struct platform_device *pdev)
if (!indio_dev)
return -ENOMEM;
- ret = cros_ec_sensors_core_init(pdev, indio_dev, false, NULL,
- NULL, false);
+ ret = cros_ec_sensors_core_init(pdev, indio_dev, false, NULL, NULL);
if (ret)
return ret;
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index dee1191de752..376a5b30010a 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -236,8 +236,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
ret = cros_ec_sensors_core_init(pdev, indio_dev, true,
cros_ec_sensors_capture,
- cros_ec_sensors_push_data,
- true);
+ cros_ec_sensors_push_data);
if (ret)
return ret;
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index c833ec0ef214..28bde13003b7 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -12,6 +12,7 @@
#include <linux/iio/iio.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/sysfs.h>
+#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/kernel.h>
@@ -240,7 +241,6 @@ static void cros_ec_sensors_core_clean(void *arg)
* for backward compatibility.
* @push_data: function to call when cros_ec_sensorhub receives
* a sample for that sensor.
- * @has_hw_fifo: Set true if this device has/uses a HW FIFO
*
* Return: 0 on success, -errno on failure.
*/
@@ -248,8 +248,7 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
struct iio_dev *indio_dev,
bool physical_device,
cros_ec_sensors_capture_t trigger_capture,
- cros_ec_sensorhub_push_data_cb_t push_data,
- bool has_hw_fifo)
+ cros_ec_sensorhub_push_data_cb_t push_data)
{
struct device *dev = &pdev->dev;
struct cros_ec_sensors_core_state *state = iio_priv(indio_dev);
@@ -334,14 +333,11 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
* We can not use trigger here, as events are generated
* as soon as sample_frequency is set.
*/
- struct iio_buffer *buffer;
-
- buffer = devm_iio_kfifo_allocate(dev);
- if (!buffer)
- return -ENOMEM;
-
- iio_device_attach_buffer(indio_dev, buffer);
- indio_dev->modes = INDIO_BUFFER_SOFTWARE;
+ ret = devm_iio_kfifo_buffer_setup_ext(dev, indio_dev,
+ INDIO_BUFFER_SOFTWARE, NULL,
+ cros_ec_sensor_fifo_attributes);
+ if (ret)
+ return ret;
ret = cros_ec_sensorhub_register_push_data(
sensor_hub, sensor_platform->sensor_num,
@@ -358,21 +354,14 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
ret = iio_device_set_clock(indio_dev, CLOCK_BOOTTIME);
if (ret)
return ret;
- } else {
- const struct attribute **fifo_attrs;
-
- if (has_hw_fifo)
- fifo_attrs = cros_ec_sensor_fifo_attributes;
- else
- fifo_attrs = NULL;
+ } else {
/*
* The only way to get samples in buffer is to set a
* software trigger (systrig, hrtimer).
*/
- ret = devm_iio_triggered_buffer_setup_ext(
- dev, indio_dev, NULL, trigger_capture,
- NULL, fifo_attrs);
+ ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
+ NULL, trigger_capture, NULL);
if (ret)
return ret;
}
@@ -562,7 +551,7 @@ static int cros_ec_sensors_read_until_not_busy(
}
/**
- * read_ec_sensors_data_unsafe() - read acceleration data from EC shared memory
+ * cros_ec_sensors_read_data_unsafe() - read acceleration data from EC shared memory
* @indio_dev: pointer to IIO device
* @scan_mask: bitmap of the sensor indices to scan
* @data: location to store data