mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
drivers: iio: imu: remove sync attribute in sysfs, we direct access hid-rkvr by ioctl
Change-Id: Ic3605da06f3c8388910b162cf468e03709a98dd0 Signed-off-by: lanshh <lsh@rock-chips.com>
This commit is contained in:
parent
3dedf8022e
commit
be87e0b1f2
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of.h>
|
||||
#include "../../../../hid/hid-rkvr.h"
|
||||
#include "inv_mpu_iio.h"
|
||||
|
||||
static int inv_hid_read(struct inv_mpu_iio_s *st, u8 reg, int len, u8 *data)
|
||||
|
|
@ -65,14 +64,6 @@ static struct mpu_platform_data mpu_data = {
|
|||
},
|
||||
};
|
||||
|
||||
static ssize_t inv_dev_attr_sync_store(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
return rkvr_sensor_sync_inv(buf, count);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(sync, S_IWUSR, NULL, inv_dev_attr_sync_store);
|
||||
|
||||
/**
|
||||
* inv_mpu_probe() - probe function.
|
||||
*/
|
||||
|
|
@ -142,17 +133,12 @@ static int inv_mpu_probe(struct platform_device *pdev)
|
|||
goto out_remove_trigger;
|
||||
}
|
||||
|
||||
result = device_create_file(&indio_dev->dev, &dev_attr_sync);
|
||||
if (result < 0) {
|
||||
dev_err(&pdev->dev, "create sync sys file failed\n");
|
||||
goto out_unreg_iio;
|
||||
}
|
||||
if (INV_MPU6050 == st->chip_type ||
|
||||
INV_MPU6500 == st->chip_type) {
|
||||
result = inv_create_dmp_sysfs(indio_dev);
|
||||
if (result) {
|
||||
dev_err(&pdev->dev, "create dmp sysfs failed\n");
|
||||
goto out_rmsync_iio;
|
||||
goto out_unreg_iio;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,8 +148,6 @@ static int inv_mpu_probe(struct platform_device *pdev)
|
|||
indio_dev->name);
|
||||
|
||||
return 0;
|
||||
out_rmsync_iio:
|
||||
device_remove_file(&indio_dev->dev, &dev_attr_sync);
|
||||
out_unreg_iio:
|
||||
iio_device_unregister(indio_dev);
|
||||
out_remove_trigger:
|
||||
|
|
@ -192,7 +176,6 @@ static int inv_mpu_remove(struct platform_device *pdev)
|
|||
struct inv_mpu_iio_s *st = iio_priv(indio_dev);
|
||||
|
||||
kfifo_free(&st->timestamps);
|
||||
device_remove_file(&indio_dev->dev, &dev_attr_sync);
|
||||
iio_device_unregister(indio_dev);
|
||||
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
|
||||
inv_mpu_remove_trigger(indio_dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user