From 3c5a15cc4bd7818d8ab149fe03e65d4ad452ed83 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 20 Feb 2022 17:51:48 +0000 Subject: iio: gyro: mpu3050: Drop unused symbol exports. This driver is built as a single module. There is an note in the makefile about SPI support being a reason to split the build in future. That support has never arrived so drop these symbol exports. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220220175149.503495-2-jic23@kernel.org --- drivers/iio/gyro/mpu3050-core.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index 4f19dc7ffe57..4941a2f17d22 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -1261,7 +1261,6 @@ err_power_down: return ret; } -EXPORT_SYMBOL(mpu3050_common_probe); void mpu3050_common_remove(struct device *dev) { @@ -1277,7 +1276,6 @@ void mpu3050_common_remove(struct device *dev) iio_device_unregister(indio_dev); mpu3050_power_down(mpu3050); } -EXPORT_SYMBOL(mpu3050_common_remove); #ifdef CONFIG_PM static int mpu3050_runtime_suspend(struct device *dev) @@ -1297,7 +1295,6 @@ const struct dev_pm_ops mpu3050_dev_pm_ops = { SET_RUNTIME_PM_OPS(mpu3050_runtime_suspend, mpu3050_runtime_resume, NULL) }; -EXPORT_SYMBOL(mpu3050_dev_pm_ops); MODULE_AUTHOR("Linus Walleij"); MODULE_DESCRIPTION("MPU3050 gyroscope driver"); -- cgit v1.2.3 From feb0bd2bcab6a3970422c3baf0bdc77713e547f9 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 20 Feb 2022 17:51:49 +0000 Subject: iio: gyro: mpu3050: Use pm_ptr() and DEFINE_RUNTIME_DEV_PM_OPS() Using this approach as opposed to CONFIG_PM guards allows the compiler to remove the unused code instead of doing it manually. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220220175149.503495-3-jic23@kernel.org --- drivers/iio/gyro/mpu3050-core.c | 11 ++--------- drivers/iio/gyro/mpu3050-i2c.c | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index 4941a2f17d22..c015a0c514ed 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -1277,7 +1277,6 @@ void mpu3050_common_remove(struct device *dev) mpu3050_power_down(mpu3050); } -#ifdef CONFIG_PM static int mpu3050_runtime_suspend(struct device *dev) { return mpu3050_power_down(iio_priv(dev_get_drvdata(dev))); @@ -1287,15 +1286,9 @@ static int mpu3050_runtime_resume(struct device *dev) { return mpu3050_power_up(iio_priv(dev_get_drvdata(dev))); } -#endif /* CONFIG_PM */ - -const struct dev_pm_ops mpu3050_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(mpu3050_runtime_suspend, - mpu3050_runtime_resume, NULL) -}; +DEFINE_RUNTIME_DEV_PM_OPS(mpu3050_dev_pm_ops, mpu3050_runtime_suspend, + mpu3050_runtime_resume, NULL); MODULE_AUTHOR("Linus Walleij"); MODULE_DESCRIPTION("MPU3050 gyroscope driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c index 5b5f58baaf7f..78f4a0102986 100644 --- a/drivers/iio/gyro/mpu3050-i2c.c +++ b/drivers/iio/gyro/mpu3050-i2c.c @@ -116,7 +116,7 @@ static struct i2c_driver mpu3050_i2c_driver = { .driver = { .of_match_table = mpu3050_i2c_of_match, .name = "mpu3050-i2c", - .pm = &mpu3050_dev_pm_ops, + .pm = pm_ptr(&mpu3050_dev_pm_ops), }, }; module_i2c_driver(mpu3050_i2c_driver); -- cgit v1.2.3 From ae6eeb534924ecc2afd5a394964fd6de0ca54d39 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 8 May 2022 18:56:52 +0100 Subject: iio: gyro: adis16080: Fix alignment for DMA safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Fixes tag is inaccurate but unlikely anyone will backport this beyond that point so I haven't chased the history futher than 2013. Fixes: 3c80372dae17 ("staging:iio:adis16080: be16 cleanups") Signed-off-by: Jonathan Cameron Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20220508175712.647246-73-jic23@kernel.org --- drivers/iio/gyro/adis16080.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/adis16080.c b/drivers/iio/gyro/adis16080.c index acef59d822b1..14b3abf6dce9 100644 --- a/drivers/iio/gyro/adis16080.c +++ b/drivers/iio/gyro/adis16080.c @@ -45,7 +45,7 @@ struct adis16080_state { const struct adis16080_chip_info *info; struct mutex lock; - __be16 buf ____cacheline_aligned; + __be16 buf __aligned(IIO_DMA_MINALIGN); }; static int adis16080_read_sample(struct iio_dev *indio_dev, -- cgit v1.2.3 From ff3211b2ba9afac80ceb795d148831dd879b30b7 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 8 May 2022 18:56:53 +0100 Subject: iio: gyro: adis16130: Fix alignment for DMA safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Fixes: 8e67875141b2 ("staging:iio:gyro: adis16130 cleanup, move to abi and bug fixes.") Signed-off-by: Jonathan Cameron Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20220508175712.647246-74-jic23@kernel.org --- drivers/iio/gyro/adis16130.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/adis16130.c b/drivers/iio/gyro/adis16130.c index b9c952e65b55..33cde9e6fca5 100644 --- a/drivers/iio/gyro/adis16130.c +++ b/drivers/iio/gyro/adis16130.c @@ -41,7 +41,7 @@ struct adis16130_state { struct spi_device *us; struct mutex buf_lock; - u8 buf[4] ____cacheline_aligned; + u8 buf[4] __aligned(IIO_DMA_MINALIGN); }; static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val) -- cgit v1.2.3 From 966d2f4ee7f6e189df47abf67223266ad31e201f Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 8 May 2022 18:56:54 +0100 Subject: iio: gyro: adxrs450: Fix alignment for DMA safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Fixes tag is inaccurate but unlikely anyone will be interested in backporting beyond that point. Fixes: 53ac8500ba9b ("staging:iio:adxrs450: Move header file contents to main file") Signed-off-by: Jonathan Cameron Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20220508175712.647246-75-jic23@kernel.org --- drivers/iio/gyro/adxrs450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index 04f350025215..f84438e0c42c 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/iio/gyro/adxrs450.c @@ -73,7 +73,7 @@ enum { struct adxrs450_state { struct spi_device *us; struct mutex buf_lock; - __be32 tx ____cacheline_aligned; + __be32 tx __aligned(IIO_DMA_MINALIGN); __be32 rx; }; -- cgit v1.2.3 From 3aafe923987cb4a15e16f03c6185ed4b6a78ca00 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sun, 8 May 2022 18:56:55 +0100 Subject: iio: gyro: fxas210002c: Fix alignment for DMA safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Updated the comment to 'may' require. Fixes: a0701b6263ae ("iio: gyro: add core driver for fxas21002c") Signed-off-by: Jonathan Cameron Reviewed-by: Rui Miguel Silva Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20220508175712.647246-76-jic23@kernel.org --- drivers/iio/gyro/fxas21002c_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c index 0923fd793492..a36d71d9e3ea 100644 --- a/drivers/iio/gyro/fxas21002c_core.c +++ b/drivers/iio/gyro/fxas21002c_core.c @@ -150,10 +150,10 @@ struct fxas21002c_data { struct regulator *vddio; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. */ - s16 buffer[8] ____cacheline_aligned; + s16 buffer[8] __aligned(IIO_DMA_MINALIGN); }; enum fxas21002c_channel_index { -- cgit v1.2.3 From 7f467484730c94311b651ca819abb61899d10fe8 Mon Sep 17 00:00:00 2001 From: Xiang wangx Date: Thu, 16 Jun 2022 22:15:22 +0800 Subject: iio: gyro: bmg160: Fix typo in comment Delete the redundant word 'in'. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20220616141522.2238-1-wangxiang@cdjrlc.com Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/bmg160_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 81a6d09788bd..cedd9f02ea21 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -766,7 +766,7 @@ static int bmg160_write_event_config(struct iio_dev *indio_dev, return 0; } /* - * We will expect the enable and disable to do operation in + * We will expect the enable and disable to do operation * in reverse order. This will happen here anyway as our * resume operation uses sync mode runtime pm calls, the * suspend operation will be delayed by autosuspend delay -- cgit v1.2.3