summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-18 12:41:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-18 12:41:32 +0100
commitcc6ce5ac2c998d7e869d7289736e0097ce7d2ad1 (patch)
treec34dfb7eab4193f35db84504f734658efeedb215 /drivers/iio/magnetometer
parentd6cd2f85931f87dbd07c664c9c6e806db1dd7c75 (diff)
parent0bf126163c3e7e6d722622073046aed567a5551e (diff)
Merge tag 'iio-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: First set of new device support, fixes, cleanups and features for IIO in 5.18 This cycle we had quite a few series that applied similar changes to lots of drivers. To keep this description manageable I have called those out in their own section rather than per driver. Particularly pleased to see the long running AFE precision series going in this cycle. Series includes some late breaking fixes. New device support * adi,ada4250 amplifier - New driver and dt bindings for this programmable gain amplifier. * adi,admv1014 microwave down-converter - New driver, dt bindings and some device specific ABI that may be generalized as more drivers for devices similar to this are added. * adi,admv4420 K Band down-converter. - New driver and dt bindings. * adi,adxl367 accelerometer driver. - New driver, dt-bindings + some new IIO ABI definitions to support reference magnitude events where an estimate of the acceleration due to gravity has been removed. - A few fixes as follow up patches. * adi,ltc2688 DAC with toggle and dither modes. - New driver and bindings. Includes some new driver specific (for now) ABI for handling toggle mode and the addition of a dither waveform to the DAC output. * AFE (analog front end) add support for additional types of analog device in front of an ADC. - RTD temperature sensors with dt bindings. - Temperature transducers wit dt bindings. - Related cleanup and features listed in other sections below. * maxim,ds3502 potentiometer. - Add support to ds1803 driver which required significant rework. * mediatek,mt2701-auxadc driver - Add mediatek,mt8186-auxadc - id table and chip specific info only. * semtech,sx9324, semtech,ax9360 - Substantial refactoring of sx9310 to extract core logic for reuse into a separate module - New driver using this supporting sx9324 proximity sensors. - New driver using this supporting sx9360 proximity sensors. * silan,sc7a20 - Compatible with the st,lis2dh (or nearly anyway) so add ID and chip specific info to enable support. Also silan vendor ID added for dt-bindings. Staging graduation * adi,ad7280a monitoring ADC for stacked lithium-ion batteries in electric cars and similar. - Substantial rework of driver required to bring inline with current IIO best practice. An unusual device in IIO so some interesting features we may see more of in future. Multiple driver/core cleanup - Use sysfs_emit() in simple locations where there is no path to change to various core created attributes. - Trivial white space fixes around inconsistency between space after { and before } in id tables. - Introduce new handling for fractional types to avoid repeated similar implementations. Use this in 3 drivers. Note this is also targeted at future use in the AFE driver and was motivated by discussions around the precision related work on that driver. - of related header cleanups - drop of*.h and add mod_devicetable.h as appropriate. - Move a number of symbol exports into IIO_* namespaces. Two categories, 1) Library used by multiple drivers e.g. st_sensors 2) Core driver module exporting functions used by bus specific modules. A few related cleanups in this set. - Switch from CONFIG_PM_* guards to new DEFINE_SIMPLE_DEV_PM_OPS() and similar to simplify drivers and take advantage of these new macros allowing the compiler to do the job or removing unused code without the need for __maybe_unused markings. Conversion of other drivers to these new macros ongoing. Features * adi,adf4350 - Switch from of specific to generic device properties enabling use with other firmware types. * adi,adx345 - Switch from of specific to generic device properties. - Add ACPI ID ADS0345 - Related driver cleanup. * adi,hmc425a - Switch from of specific to generic device properties. * afe analog rescaler driver - Wider range of types supported for scale. - Support offset. - Kunit tests. * atlas,ezo-sensor - Convert from of to device properties. * fsl,mma8452 - Support mount matrix. * infineon,dps310: - Add ACPI ID IFX3100. * invensense,mpu6050 - Convert to generic device properties. * maxim,ds1803 - Add out_raw_available before supporting more devices. - Convert from of specific to device properties. * samsung,ssp_sensors - Convert from of specific to device properties. * st,stm32-timer trigger - Convert from of specific to device properties. * ti,hdc101x - Add ACPI ID TXNW1010. * ti,tsc2046: - Add read_raw support to enable use of iio_hwmon and similar. Fixes / cleanup. * mailmap - Update for Cai Huoqing * MAINTAINERS - Fix Analog Devices related links. - Add entry for ADRF6780 - Add entry for ADMV1013 - Add entry for AD7293 - Add entry for ADMV8818 - Update files listed for adis-lib * iio core: - Fix wrong comment about current_mode being something a driver should ever access. - Use struct_size() rather than open coding in industrialio-hw-consumer * adi,axl355 - Use units.h definitions instead of local versions. * adi,adis-lib - Simplify *updated_bits() macro - Whitespace cleanup. * afe - Note many of these fixes only apply to particular configurations so the problems have probably not been seen in the wild, but will be visible with new usecases enabled this cycle. - Fix application of consumer scale for IIO_VAL_INT. - Apply a scale of 1 when no scale is provided. - Make best effort to establish a valid offset value for fractional cases. - Use s64 for scale calculations where parameters may be signed. - Tidy up include order. - Improve accuracy for small fractional sales - Reduce risk of integer overflow. * ams,as3935 - Use devm_delayed_work_autocancel() to replace open coded equivalent. * aspeed,adc - Fix wrong use of divider flag. * atmel,sama5d2-adc - Relax atmel,trigger-edge-type to optional. - Drop Ludovic Desroches from listed maintainers of the dt-binding inline with previous MAINTAINERS entry update. * fsl,mma8452 - Fix probing when i2c_device_id used. - dev_get_drvdata() on the iio_dev->dev, no longer returns iio_dev. Use dev_to_iio_dev() instead. Note the original path in here worked more by luck than design. * invensense,mpu6050 - Drop ACPI_PTR() protection to avoid an unused warning. - Use fact ACPI_COMPANION() returns null when ACPI_HANDLE() does to simplify handling. * motorola,cpcap-adc - Drop unused assignment. * qcom,spmi-adc - Fix wrong example of 'reg' in binding document. * renesas,rzg2l-adc - Trivial typo fix. * semtech,sx9360 - Fix wrong register handling for event generation. * st_sensors - Allow manual disabling of I2C or SPI module if not needed for a particular board. Default is still to enable the bus specific module if appropriate bus is supported. * st,lsm6dsx - dev_get_drvdata() on the iio_dev->dev, no longer returns iio_dev. Use dev_to_iio_dev() instead. * ti,palmas-gpadc - Split the interrupt fields in the dt-binding example * ti,tsc2046 - Rework state machine to improve readability after recent debugging of an issue fixed elsewhere. - Add a sanity check to avoid very large memory allocations if a crazy delay is specified. * ti,twl6030 - Add error handling if devm_request_threaded_irq() fails. * xilinx,ams - Use devm_delayed_work_autocancel() instead of open coding equivalent. - Fix missing required clock entry in dt-binding. - Fix miss counting of channels resulting in ps channels not being enabled. - Fix incorrect values written to sequencer registers. - Fix sequence for single channel reading. * tag 'iio-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (245 commits) iio: adc: xilinx-ams: Fix single channel switching sequence iio: adc: xilinx-ams: Fixed wrong sequencer register settings iio: adc: xilinx-ams: Fixed missing PS channels dt-bindings: iio: adc: zynqmp_ams: Add clock entry iio: accel: mma8452: use the correct logic to get mma8452_data iio: adc: aspeed: Add divider flag to fix incorrect voltage reading. iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct dt-bindings: iio: Add ltc2688 documentation iio: ABI: add ABI file for the LTC2688 DAC iio: dac: add support for ltc2688 dt-bindings: iio: afe: add bindings for temperature transducers dt-bindings: iio: afe: add bindings for temperature-sense-rtd iio: afe: rescale: add temperature transducers iio: afe: rescale: add RTD temperature sensor support iio: test: add basic tests for the iio-rescale driver iio: afe: rescale: reduce risk of integer overflow iio: afe: rescale: fix accuracy for small fractional scales iio: afe: rescale: add offset support iio: afe: rescale: add INT_PLUS_{MICRO,NANO} support iio: afe: rescale: expose scale processing function ...
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r--drivers/iio/magnetometer/Kconfig35
-rw-r--r--drivers/iio/magnetometer/ak8975.c12
-rw-r--r--drivers/iio/magnetometer/bmc150_magn.c8
-rw-r--r--drivers/iio/magnetometer/bmc150_magn_i2c.c1
-rw-r--r--drivers/iio/magnetometer/bmc150_magn_spi.c1
-rw-r--r--drivers/iio/magnetometer/hmc5843_core.c8
-rw-r--r--drivers/iio/magnetometer/hmc5843_i2c.c1
-rw-r--r--drivers/iio/magnetometer/hmc5843_spi.c1
-rw-r--r--drivers/iio/magnetometer/mag3110.c10
-rw-r--r--drivers/iio/magnetometer/mmc35240.c9
-rw-r--r--drivers/iio/magnetometer/rm3100-core.c8
-rw-r--r--drivers/iio/magnetometer/rm3100-i2c.c1
-rw-r--r--drivers/iio/magnetometer/rm3100-spi.c1
-rw-r--r--drivers/iio/magnetometer/st_magn_buffer.c4
-rw-r--r--drivers/iio/magnetometer/st_magn_core.c5
-rw-r--r--drivers/iio/magnetometer/st_magn_i2c.c1
-rw-r--r--drivers/iio/magnetometer/st_magn_spi.c1
17 files changed, 52 insertions, 55 deletions
diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig
index 565ee41ccb3a..54445365c4bc 100644
--- a/drivers/iio/magnetometer/Kconfig
+++ b/drivers/iio/magnetometer/Kconfig
@@ -117,30 +117,35 @@ config IIO_ST_MAGN_3AXIS
tristate "STMicroelectronics magnetometers 3-Axis Driver"
depends on (I2C || SPI_MASTER) && SYSFS
select IIO_ST_SENSORS_CORE
- select IIO_ST_MAGN_I2C_3AXIS if (I2C)
- select IIO_ST_MAGN_SPI_3AXIS if (SPI_MASTER)
select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
help
Say yes here to build support for STMicroelectronics magnetometers:
LSM303DLHC, LSM303DLM, LIS3MDL.
- This driver can also be built as a module. If so, these modules
- will be created:
- - st_magn (core functions for the driver [it is mandatory]);
- - st_magn_i2c (necessary for the I2C devices [optional*]);
- - st_magn_spi (necessary for the SPI devices [optional*]);
-
- (*) one of these is necessary to do something.
+ Also need to enable at least one of I2C and SPI interface drivers
+ below.
config IIO_ST_MAGN_I2C_3AXIS
- tristate
- depends on IIO_ST_MAGN_3AXIS
- depends on IIO_ST_SENSORS_I2C
+ tristate "STMicroelectronics magnetometers 3-Axis I2C Interface"
+ depends on I2C && IIO_ST_MAGN_3AXIS
+ default I2C && IIO_ST_MAGN_3AXIS
+ select IIO_ST_SENSORS_I2C
+ help
+ Build support for STMicroelectronics magnetometers I2C interface.
+
+ To compile this driver as a module, choose M here. The module
+ will be called st_magn_i2c.
config IIO_ST_MAGN_SPI_3AXIS
- tristate
- depends on IIO_ST_MAGN_3AXIS
- depends on IIO_ST_SENSORS_SPI
+ tristate "STMicroelectronics magnetometers 3-Axis SPI Interface"
+ depends on SPI_MASTER && IIO_ST_MAGN_3AXIS
+ default SPI_MASTER && IIO_ST_MAGN_3AXIS
+ select IIO_ST_SENSORS_SPI
+ help
+ Build support for STMicroelectronics magnetometers SPI interface.
+
+ To compile this driver as a module, choose M here. The module
+ will be called st_magn_spi.
config SENSORS_HMC5843
tristate
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 55879a20ae52..088f748b683e 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -1033,7 +1033,6 @@ static int ak8975_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
static int ak8975_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -1074,14 +1073,9 @@ static int ak8975_runtime_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM */
-static const struct dev_pm_ops ak8975_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(ak8975_runtime_suspend,
- ak8975_runtime_resume, NULL)
-};
+static DEFINE_RUNTIME_DEV_PM_OPS(ak8975_dev_pm_ops, ak8975_runtime_suspend,
+ ak8975_runtime_resume, NULL);
static const struct i2c_device_id ak8975_id[] = {
{"ak8975", AK8975},
@@ -1113,7 +1107,7 @@ MODULE_DEVICE_TABLE(of, ak8975_of_match);
static struct i2c_driver ak8975_driver = {
.driver = {
.name = "ak8975",
- .pm = &ak8975_dev_pm_ops,
+ .pm = pm_ptr(&ak8975_dev_pm_ops),
.of_match_table = ak8975_of_match,
.acpi_match_table = ak_acpi_match,
},
diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
index 3d4d21f979fa..64e8b04e654b 100644
--- a/drivers/iio/magnetometer/bmc150_magn.c
+++ b/drivers/iio/magnetometer/bmc150_magn.c
@@ -226,7 +226,7 @@ const struct regmap_config bmc150_magn_regmap_config = {
.writeable_reg = bmc150_magn_is_writeable_reg,
.volatile_reg = bmc150_magn_is_volatile_reg,
};
-EXPORT_SYMBOL(bmc150_magn_regmap_config);
+EXPORT_SYMBOL_NS(bmc150_magn_regmap_config, IIO_BMC150_MAGN);
static int bmc150_magn_set_power_mode(struct bmc150_magn_data *data,
enum bmc150_magn_power_modes mode,
@@ -983,7 +983,7 @@ err_poweroff:
bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND, true);
return ret;
}
-EXPORT_SYMBOL(bmc150_magn_probe);
+EXPORT_SYMBOL_NS(bmc150_magn_probe, IIO_BMC150_MAGN);
int bmc150_magn_remove(struct device *dev)
{
@@ -1010,7 +1010,7 @@ int bmc150_magn_remove(struct device *dev)
regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
return 0;
}
-EXPORT_SYMBOL(bmc150_magn_remove);
+EXPORT_SYMBOL_NS(bmc150_magn_remove, IIO_BMC150_MAGN);
#ifdef CONFIG_PM
static int bmc150_magn_runtime_suspend(struct device *dev)
@@ -1078,7 +1078,7 @@ const struct dev_pm_ops bmc150_magn_pm_ops = {
SET_RUNTIME_PM_OPS(bmc150_magn_runtime_suspend,
bmc150_magn_runtime_resume, NULL)
};
-EXPORT_SYMBOL(bmc150_magn_pm_ops);
+EXPORT_SYMBOL_NS(bmc150_magn_pm_ops, IIO_BMC150_MAGN);
MODULE_AUTHOR("Irina Tirdea <irina.tirdea@intel.com>");
MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/magnetometer/bmc150_magn_i2c.c b/drivers/iio/magnetometer/bmc150_magn_i2c.c
index 876e96005e33..e39b89661ad1 100644
--- a/drivers/iio/magnetometer/bmc150_magn_i2c.c
+++ b/drivers/iio/magnetometer/bmc150_magn_i2c.c
@@ -80,3 +80,4 @@ module_i2c_driver(bmc150_magn_driver);
MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("BMC150 I2C magnetometer driver");
+MODULE_IMPORT_NS(IIO_BMC150_MAGN);
diff --git a/drivers/iio/magnetometer/bmc150_magn_spi.c b/drivers/iio/magnetometer/bmc150_magn_spi.c
index c6ed3ea8460a..0db363ffc462 100644
--- a/drivers/iio/magnetometer/bmc150_magn_spi.c
+++ b/drivers/iio/magnetometer/bmc150_magn_spi.c
@@ -66,3 +66,4 @@ module_spi_driver(bmc150_magn_spi_driver);
MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com");
MODULE_DESCRIPTION("BMC150 magnetometer SPI driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_BMC150_MAGN);
diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c
index 5a730d9bdbb0..92eb2d156ddb 100644
--- a/drivers/iio/magnetometer/hmc5843_core.c
+++ b/drivers/iio/magnetometer/hmc5843_core.c
@@ -608,14 +608,14 @@ int hmc5843_common_suspend(struct device *dev)
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_SLEEP);
}
-EXPORT_SYMBOL(hmc5843_common_suspend);
+EXPORT_SYMBOL_NS(hmc5843_common_suspend, IIO_HMC5843);
int hmc5843_common_resume(struct device *dev)
{
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_CONVERSION_CONTINUOUS);
}
-EXPORT_SYMBOL(hmc5843_common_resume);
+EXPORT_SYMBOL_NS(hmc5843_common_resume, IIO_HMC5843);
int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
enum hmc5843_ids id, const char *name)
@@ -669,7 +669,7 @@ buffer_setup_err:
hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
return ret;
}
-EXPORT_SYMBOL(hmc5843_common_probe);
+EXPORT_SYMBOL_NS(hmc5843_common_probe, IIO_HMC5843);
void hmc5843_common_remove(struct device *dev)
{
@@ -681,7 +681,7 @@ void hmc5843_common_remove(struct device *dev)
/* sleep mode to save power */
hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
}
-EXPORT_SYMBOL(hmc5843_common_remove);
+EXPORT_SYMBOL_NS(hmc5843_common_remove, IIO_HMC5843);
MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com>");
MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 core driver");
diff --git a/drivers/iio/magnetometer/hmc5843_i2c.c b/drivers/iio/magnetometer/hmc5843_i2c.c
index bc6e12f1d521..8d2ff8fc204d 100644
--- a/drivers/iio/magnetometer/hmc5843_i2c.c
+++ b/drivers/iio/magnetometer/hmc5843_i2c.c
@@ -105,3 +105,4 @@ module_i2c_driver(hmc5843_driver);
MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>");
MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 i2c driver");
MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_HMC5843);
diff --git a/drivers/iio/magnetometer/hmc5843_spi.c b/drivers/iio/magnetometer/hmc5843_spi.c
index 89cf59a62c28..f2a8e98d8eb5 100644
--- a/drivers/iio/magnetometer/hmc5843_spi.c
+++ b/drivers/iio/magnetometer/hmc5843_spi.c
@@ -102,3 +102,4 @@ module_spi_driver(hmc5843_driver);
MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>");
MODULE_DESCRIPTION("HMC5983 SPI driver");
MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_HMC5843);
diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index 17c62d806218..226439d0bfb5 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -573,7 +573,6 @@ static int mag3110_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int mag3110_suspend(struct device *dev)
{
struct mag3110_data *data = iio_priv(i2c_get_clientdata(
@@ -623,11 +622,8 @@ static int mag3110_resume(struct device *dev)
data->ctrl_reg1);
}
-static SIMPLE_DEV_PM_OPS(mag3110_pm_ops, mag3110_suspend, mag3110_resume);
-#define MAG3110_PM_OPS (&mag3110_pm_ops)
-#else
-#define MAG3110_PM_OPS NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(mag3110_pm_ops, mag3110_suspend,
+ mag3110_resume);
static const struct i2c_device_id mag3110_id[] = {
{ "mag3110", 0 },
@@ -645,7 +641,7 @@ static struct i2c_driver mag3110_driver = {
.driver = {
.name = "mag3110",
.of_match_table = mag3110_of_match,
- .pm = MAG3110_PM_OPS,
+ .pm = pm_sleep_ptr(&mag3110_pm_ops),
},
.probe = mag3110_probe,
.remove = mag3110_remove,
diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c
index 65f3d1ed0d59..186edfcda0b7 100644
--- a/drivers/iio/magnetometer/mmc35240.c
+++ b/drivers/iio/magnetometer/mmc35240.c
@@ -521,7 +521,6 @@ static int mmc35240_probe(struct i2c_client *client,
return devm_iio_device_register(&client->dev, indio_dev);
}
-#ifdef CONFIG_PM_SLEEP
static int mmc35240_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
@@ -548,11 +547,9 @@ static int mmc35240_resume(struct device *dev)
return 0;
}
-#endif
-static const struct dev_pm_ops mmc35240_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(mmc35240_suspend, mmc35240_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(mmc35240_pm_ops, mmc35240_suspend,
+ mmc35240_resume);
static const struct of_device_id mmc35240_of_match[] = {
{ .compatible = "memsic,mmc35240", },
@@ -576,7 +573,7 @@ static struct i2c_driver mmc35240_driver = {
.driver = {
.name = MMC35240_DRV_NAME,
.of_match_table = mmc35240_of_match,
- .pm = &mmc35240_pm_ops,
+ .pm = pm_sleep_ptr(&mmc35240_pm_ops),
.acpi_match_table = ACPI_PTR(mmc35240_acpi_match),
},
.probe = mmc35240_probe,
diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c
index 13914273c999..26195733ea3e 100644
--- a/drivers/iio/magnetometer/rm3100-core.c
+++ b/drivers/iio/magnetometer/rm3100-core.c
@@ -100,7 +100,7 @@ const struct regmap_access_table rm3100_readable_table = {
.yes_ranges = rm3100_readable_ranges,
.n_yes_ranges = ARRAY_SIZE(rm3100_readable_ranges),
};
-EXPORT_SYMBOL_GPL(rm3100_readable_table);
+EXPORT_SYMBOL_NS_GPL(rm3100_readable_table, IIO_RM3100);
static const struct regmap_range rm3100_writable_ranges[] = {
regmap_reg_range(RM3100_W_REG_START, RM3100_W_REG_END),
@@ -110,7 +110,7 @@ const struct regmap_access_table rm3100_writable_table = {
.yes_ranges = rm3100_writable_ranges,
.n_yes_ranges = ARRAY_SIZE(rm3100_writable_ranges),
};
-EXPORT_SYMBOL_GPL(rm3100_writable_table);
+EXPORT_SYMBOL_NS_GPL(rm3100_writable_table, IIO_RM3100);
static const struct regmap_range rm3100_volatile_ranges[] = {
regmap_reg_range(RM3100_V_REG_START, RM3100_V_REG_END),
@@ -120,7 +120,7 @@ const struct regmap_access_table rm3100_volatile_table = {
.yes_ranges = rm3100_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(rm3100_volatile_ranges),
};
-EXPORT_SYMBOL_GPL(rm3100_volatile_table);
+EXPORT_SYMBOL_NS_GPL(rm3100_volatile_table, IIO_RM3100);
static irqreturn_t rm3100_thread_fn(int irq, void *d)
{
@@ -607,7 +607,7 @@ int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq)
return devm_iio_device_register(dev, indio_dev);
}
-EXPORT_SYMBOL_GPL(rm3100_common_probe);
+EXPORT_SYMBOL_NS_GPL(rm3100_common_probe, IIO_RM3100);
MODULE_AUTHOR("Song Qiang <songqiang1304521@gmail.com>");
MODULE_DESCRIPTION("PNI RM3100 3-axis magnetometer i2c driver");
diff --git a/drivers/iio/magnetometer/rm3100-i2c.c b/drivers/iio/magnetometer/rm3100-i2c.c
index 1ac622c6d6c9..ba669ab7113d 100644
--- a/drivers/iio/magnetometer/rm3100-i2c.c
+++ b/drivers/iio/magnetometer/rm3100-i2c.c
@@ -52,3 +52,4 @@ module_i2c_driver(rm3100_driver);
MODULE_AUTHOR("Song Qiang <songqiang1304521@gmail.com>");
MODULE_DESCRIPTION("PNI RM3100 3-axis magnetometer i2c driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_RM3100);
diff --git a/drivers/iio/magnetometer/rm3100-spi.c b/drivers/iio/magnetometer/rm3100-spi.c
index 65d5eb9e4f5e..76dc9b66cd3c 100644
--- a/drivers/iio/magnetometer/rm3100-spi.c
+++ b/drivers/iio/magnetometer/rm3100-spi.c
@@ -62,3 +62,4 @@ module_spi_driver(rm3100_driver);
MODULE_AUTHOR("Song Qiang <songqiang1304521@gmail.com>");
MODULE_DESCRIPTION("PNI RM3100 3-axis magnetometer spi driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_RM3100);
diff --git a/drivers/iio/magnetometer/st_magn_buffer.c b/drivers/iio/magnetometer/st_magn_buffer.c
index cb43ccda808d..79987f42e8d9 100644
--- a/drivers/iio/magnetometer/st_magn_buffer.c
+++ b/drivers/iio/magnetometer/st_magn_buffer.c
@@ -7,7 +7,6 @@
* Denis Ciocca <denis.ciocca@st.com>
*/
-#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
@@ -45,6 +44,3 @@ int st_magn_allocate_ring(struct iio_dev *indio_dev)
NULL, &st_sensors_trigger_handler, &st_magn_buffer_setup_ops);
}
-MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics magnetometers buffer");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 0806a1e65ce4..74435f4a427d 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -606,7 +606,7 @@ const struct st_sensor_settings *st_magn_get_settings(const char *name)
return &st_magn_sensors_settings[index];
}
-EXPORT_SYMBOL(st_magn_get_settings);
+EXPORT_SYMBOL_NS(st_magn_get_settings, IIO_ST_SENSORS);
int st_magn_common_probe(struct iio_dev *indio_dev)
{
@@ -653,8 +653,9 @@ int st_magn_common_probe(struct iio_dev *indio_dev)
return devm_iio_device_register(parent, indio_dev);
}
-EXPORT_SYMBOL(st_magn_common_probe);
+EXPORT_SYMBOL_NS(st_magn_common_probe, IIO_ST_SENSORS);
MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
MODULE_DESCRIPTION("STMicroelectronics magnetometers driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
index 7237711fc09b..c5d8c303db4e 100644
--- a/drivers/iio/magnetometer/st_magn_i2c.c
+++ b/drivers/iio/magnetometer/st_magn_i2c.c
@@ -115,3 +115,4 @@ module_i2c_driver(st_magn_driver);
MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
MODULE_DESCRIPTION("STMicroelectronics magnetometers i2c driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
index 489d4462862f..6ddc4318564a 100644
--- a/drivers/iio/magnetometer/st_magn_spi.c
+++ b/drivers/iio/magnetometer/st_magn_spi.c
@@ -106,3 +106,4 @@ module_spi_driver(st_magn_driver);
MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
MODULE_DESCRIPTION("STMicroelectronics magnetometers spi driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);