2018-12-17 14:23:36 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2011-02-22 21:46:18 +01:00
|
|
|
/*
|
|
|
|
* AD7606 Parallel Interface ADC driver
|
|
|
|
*
|
2024-10-15 13:56:20 +00:00
|
|
|
* Copyright 2011 - 2024 Analog Devices Inc.
|
|
|
|
* Copyright 2024 BayLibre SAS.
|
2011-02-22 21:46:18 +01:00
|
|
|
*/
|
|
|
|
|
2024-10-04 21:48:39 +00:00
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/gpio/consumer.h>
|
|
|
|
#include <linux/io.h>
|
2022-06-10 10:45:13 +02:00
|
|
|
#include <linux/mod_devicetable.h>
|
2011-02-22 21:46:18 +01:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/platform_device.h>
|
2024-10-15 13:56:18 +00:00
|
|
|
#include <linux/property.h>
|
2011-02-22 21:46:18 +01:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2024-10-15 13:56:20 +00:00
|
|
|
#include <linux/iio/backend.h>
|
2012-04-25 15:54:58 +01:00
|
|
|
#include <linux/iio/iio.h>
|
2024-10-15 13:56:20 +00:00
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
#include "ad7606.h"
|
2025-02-10 17:10:59 +01:00
|
|
|
#include "ad7606_bus_iface.h"
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2025-02-10 17:10:59 +01:00
|
|
|
static int ad7606_par_bus_update_scan_mode(struct iio_dev *indio_dev,
|
|
|
|
const unsigned long *scan_mask)
|
2024-10-15 13:56:20 +00:00
|
|
|
{
|
|
|
|
struct ad7606_state *st = iio_priv(indio_dev);
|
|
|
|
unsigned int c, ret;
|
|
|
|
|
|
|
|
for (c = 0; c < indio_dev->num_channels; c++) {
|
|
|
|
if (test_bit(c, scan_mask))
|
|
|
|
ret = iio_backend_chan_enable(st->back, c);
|
|
|
|
else
|
|
|
|
ret = iio_backend_chan_disable(st->back, c);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-02-10 17:10:59 +01:00
|
|
|
static int ad7606_par_bus_setup_iio_backend(struct device *dev,
|
|
|
|
struct iio_dev *indio_dev)
|
2024-10-15 13:56:20 +00:00
|
|
|
{
|
|
|
|
struct ad7606_state *st = iio_priv(indio_dev);
|
|
|
|
unsigned int ret, c;
|
|
|
|
struct iio_backend_data_fmt data = {
|
|
|
|
.sign_extend = true,
|
|
|
|
.enable = true,
|
|
|
|
};
|
|
|
|
|
|
|
|
st->back = devm_iio_backend_get(dev, NULL);
|
|
|
|
if (IS_ERR(st->back))
|
|
|
|
return PTR_ERR(st->back);
|
|
|
|
|
|
|
|
/* If the device is iio_backend powered the PWM is mandatory */
|
|
|
|
if (!st->cnvst_pwm)
|
|
|
|
return dev_err_probe(st->dev, -EINVAL,
|
|
|
|
"A PWM is mandatory when using backend.\n");
|
|
|
|
|
|
|
|
ret = devm_iio_backend_request_buffer(dev, st->back, indio_dev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
ret = devm_iio_backend_enable(dev, st->back);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
for (c = 0; c < indio_dev->num_channels; c++) {
|
|
|
|
ret = iio_backend_data_format_set(st->back, c, &data);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-02-10 17:10:59 +01:00
|
|
|
static int ad7606_par_bus_reg_read(struct ad7606_state *st, unsigned int addr)
|
|
|
|
{
|
|
|
|
struct ad7606_platform_data *pdata = st->dev->platform_data;
|
|
|
|
int val, ret;
|
|
|
|
|
|
|
|
ret = pdata->bus_reg_read(st->back, addr, &val);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ad7606_par_bus_reg_write(struct ad7606_state *st, unsigned int addr,
|
|
|
|
unsigned int val)
|
|
|
|
{
|
|
|
|
struct ad7606_platform_data *pdata = st->dev->platform_data;
|
|
|
|
|
|
|
|
return pdata->bus_reg_write(st->back, addr, val);
|
|
|
|
}
|
|
|
|
|
2024-10-15 13:56:20 +00:00
|
|
|
static const struct ad7606_bus_ops ad7606_bi_bops = {
|
2025-02-10 17:10:59 +01:00
|
|
|
.iio_backend_config = ad7606_par_bus_setup_iio_backend,
|
|
|
|
.update_scan_mode = ad7606_par_bus_update_scan_mode,
|
|
|
|
.reg_read = ad7606_par_bus_reg_read,
|
|
|
|
.reg_write = ad7606_par_bus_reg_write,
|
2024-10-15 13:56:20 +00:00
|
|
|
};
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
static int ad7606_par16_read_block(struct device *dev,
|
2015-10-14 21:14:13 +03:00
|
|
|
int count, void *buf)
|
2011-02-22 21:46:18 +01:00
|
|
|
{
|
2018-04-19 16:06:18 +02:00
|
|
|
struct iio_dev *indio_dev = dev_get_drvdata(dev);
|
2011-05-18 14:42:01 +01:00
|
|
|
struct ad7606_state *st = iio_priv(indio_dev);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
|
|
|
|
iio: adc: ad7606: remove frstdata check for serial mode
The current implementation attempts to recover from an eventual glitch
in the clock by checking frstdata state after reading the first
channel's sample: If frstdata is low, it will reset the chip and
return -EIO.
This will only work in parallel mode, where frstdata pin is set low
after the 2nd sample read starts.
For the serial mode, according to the datasheet, "The FRSTDATA output
returns to a logic low following the 16th SCLK falling edge.", thus
after the Xth pulse, X being the number of bits in a sample, the check
will always be true, and the driver will not work at all in serial
mode if frstdata(optional) is defined in the devicetree as it will
reset the chip, and return -EIO every time read_sample is called.
Hence, this check must be removed for serial mode.
Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-07-02 12:52:51 +00:00
|
|
|
/*
|
|
|
|
* On the parallel interface, the frstdata signal is set to high while
|
|
|
|
* and after reading the sample of the first channel and low for all
|
|
|
|
* other channels. This can be used to check that the incoming data is
|
|
|
|
* correctly aligned. During normal operation the data should never
|
|
|
|
* become unaligned, but some glitch or electrostatic discharge might
|
|
|
|
* cause an extra read or clock cycle. Monitoring the frstdata signal
|
|
|
|
* allows to recover from such failure situations.
|
|
|
|
*/
|
|
|
|
int num = count;
|
|
|
|
u16 *_buf = buf;
|
|
|
|
|
|
|
|
if (st->gpio_frstdata) {
|
|
|
|
insw((unsigned long)st->base_address, _buf, 1);
|
|
|
|
if (!gpiod_get_value(st->gpio_frstdata)) {
|
|
|
|
ad7606_reset(st);
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
_buf++;
|
|
|
|
num--;
|
|
|
|
}
|
|
|
|
insw((unsigned long)st->base_address, _buf, num);
|
2011-02-22 21:46:18 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct ad7606_bus_ops ad7606_par16_bops = {
|
2018-12-17 14:23:38 +02:00
|
|
|
.read_block = ad7606_par16_read_block,
|
2011-02-22 21:46:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static int ad7606_par8_read_block(struct device *dev,
|
2015-10-14 21:14:13 +03:00
|
|
|
int count, void *buf)
|
2011-02-22 21:46:18 +01:00
|
|
|
{
|
2018-04-19 16:06:18 +02:00
|
|
|
struct iio_dev *indio_dev = dev_get_drvdata(dev);
|
2011-05-18 14:42:01 +01:00
|
|
|
struct ad7606_state *st = iio_priv(indio_dev);
|
iio: adc: ad7606: remove frstdata check for serial mode
The current implementation attempts to recover from an eventual glitch
in the clock by checking frstdata state after reading the first
channel's sample: If frstdata is low, it will reset the chip and
return -EIO.
This will only work in parallel mode, where frstdata pin is set low
after the 2nd sample read starts.
For the serial mode, according to the datasheet, "The FRSTDATA output
returns to a logic low following the 16th SCLK falling edge.", thus
after the Xth pulse, X being the number of bits in a sample, the check
will always be true, and the driver will not work at all in serial
mode if frstdata(optional) is defined in the devicetree as it will
reset the chip, and return -EIO every time read_sample is called.
Hence, this check must be removed for serial mode.
Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-07-02 12:52:51 +00:00
|
|
|
/*
|
|
|
|
* On the parallel interface, the frstdata signal is set to high while
|
|
|
|
* and after reading the sample of the first channel and low for all
|
|
|
|
* other channels. This can be used to check that the incoming data is
|
|
|
|
* correctly aligned. During normal operation the data should never
|
|
|
|
* become unaligned, but some glitch or electrostatic discharge might
|
|
|
|
* cause an extra read or clock cycle. Monitoring the frstdata signal
|
|
|
|
* allows to recover from such failure situations.
|
|
|
|
*/
|
|
|
|
int num = count;
|
|
|
|
u16 *_buf = buf;
|
2011-02-22 21:46:18 +01:00
|
|
|
|
iio: adc: ad7606: remove frstdata check for serial mode
The current implementation attempts to recover from an eventual glitch
in the clock by checking frstdata state after reading the first
channel's sample: If frstdata is low, it will reset the chip and
return -EIO.
This will only work in parallel mode, where frstdata pin is set low
after the 2nd sample read starts.
For the serial mode, according to the datasheet, "The FRSTDATA output
returns to a logic low following the 16th SCLK falling edge.", thus
after the Xth pulse, X being the number of bits in a sample, the check
will always be true, and the driver will not work at all in serial
mode if frstdata(optional) is defined in the devicetree as it will
reset the chip, and return -EIO every time read_sample is called.
Hence, this check must be removed for serial mode.
Fixes: b9618c0cacd7 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240702-cleanup-ad7606-v3-1-18d5ea18770e@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-07-02 12:52:51 +00:00
|
|
|
if (st->gpio_frstdata) {
|
|
|
|
insb((unsigned long)st->base_address, _buf, 2);
|
|
|
|
if (!gpiod_get_value(st->gpio_frstdata)) {
|
|
|
|
ad7606_reset(st);
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
_buf++;
|
|
|
|
num--;
|
|
|
|
}
|
|
|
|
insb((unsigned long)st->base_address, _buf, num * 2);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct ad7606_bus_ops ad7606_par8_bops = {
|
2018-12-17 14:23:38 +02:00
|
|
|
.read_block = ad7606_par8_read_block,
|
2011-02-22 21:46:18 +01:00
|
|
|
};
|
|
|
|
|
2012-11-19 13:21:57 -05:00
|
|
|
static int ad7606_par_probe(struct platform_device *pdev)
|
2011-02-22 21:46:18 +01:00
|
|
|
{
|
2024-10-15 13:56:18 +00:00
|
|
|
const struct ad7606_chip_info *chip_info;
|
|
|
|
const struct platform_device_id *id;
|
2011-02-22 21:46:18 +01:00
|
|
|
struct resource *res;
|
|
|
|
void __iomem *addr;
|
|
|
|
resource_size_t remap_size;
|
2014-01-07 19:44:00 +00:00
|
|
|
int irq;
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2024-10-15 13:56:20 +00:00
|
|
|
/*
|
|
|
|
* If a firmware node is available (ACPI or DT), platform_device_id is null
|
|
|
|
* and we must use get_match_data.
|
|
|
|
*/
|
2024-10-15 13:56:18 +00:00
|
|
|
if (dev_fwnode(&pdev->dev)) {
|
|
|
|
chip_info = device_get_match_data(&pdev->dev);
|
2024-10-15 13:56:20 +00:00
|
|
|
if (device_property_present(&pdev->dev, "io-backends"))
|
|
|
|
/*
|
|
|
|
* If a backend is available ,call the core probe with backend
|
|
|
|
* bops, otherwise use the former bops.
|
|
|
|
*/
|
|
|
|
return ad7606_probe(&pdev->dev, 0, NULL,
|
|
|
|
chip_info,
|
|
|
|
&ad7606_bi_bops);
|
2024-10-15 13:56:18 +00:00
|
|
|
} else {
|
|
|
|
id = platform_get_device_id(pdev);
|
|
|
|
chip_info = (const struct ad7606_chip_info *)id->driver_data;
|
|
|
|
}
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
irq = platform_get_irq(pdev, 0);
|
2019-07-30 11:15:19 -07:00
|
|
|
if (irq < 0)
|
2017-08-09 10:38:56 -05:00
|
|
|
return irq;
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2022-11-22 09:35:33 +08:00
|
|
|
addr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
2014-01-07 19:44:00 +00:00
|
|
|
if (IS_ERR(addr))
|
|
|
|
return PTR_ERR(addr);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
|
|
|
remap_size = resource_size(res);
|
|
|
|
|
2024-10-15 13:56:18 +00:00
|
|
|
return ad7606_probe(&pdev->dev, irq, addr, chip_info,
|
2016-10-19 19:07:04 +02:00
|
|
|
remap_size > 1 ? &ad7606_par16_bops :
|
|
|
|
&ad7606_par8_bops);
|
2011-02-22 21:46:18 +01:00
|
|
|
}
|
|
|
|
|
2015-05-02 00:43:22 +09:00
|
|
|
static const struct platform_device_id ad7606_driver_ids[] = {
|
2024-10-15 13:56:18 +00:00
|
|
|
{ .name = "ad7605-4", .driver_data = (kernel_ulong_t)&ad7605_4_info, },
|
|
|
|
{ .name = "ad7606-4", .driver_data = (kernel_ulong_t)&ad7606_4_info, },
|
|
|
|
{ .name = "ad7606-6", .driver_data = (kernel_ulong_t)&ad7606_6_info, },
|
|
|
|
{ .name = "ad7606-8", .driver_data = (kernel_ulong_t)&ad7606_8_info, },
|
2024-10-15 13:56:20 +00:00
|
|
|
{ .name = "ad7606b", .driver_data = (kernel_ulong_t)&ad7606b_info, },
|
2025-03-18 17:52:18 -05:00
|
|
|
{ .name = "ad7606c-16", .driver_data = (kernel_ulong_t)&ad7606c_16_info },
|
|
|
|
{ .name = "ad7606c-18", .driver_data = (kernel_ulong_t)&ad7606c_18_info },
|
iio: adc: ad7606: add support for AD760{7,8,9} parts
The AD7607, AD7608 and AD7609 are some older parts of the AD7606 family.
They are hardware-only, meaning that they don't have any registers
accessible via SPI or Parallel interface.
They are more similar to the AD7605-4 part, which is supported by the
'ad7606' driver, and are configurable via GPIOs.
Like the AD7605-4 part, all 3 parts have 2 CONVST (Conversion Start) pins
(CONVST A and CONVST B). But in practice, these should be tied together to
make reading of samples easier via a serial line.
The AD7607 has an 14-bit resolution and AD7608 & AD7609 have an 18-bit
resolution. The main difference between the AD7608 & AD7609 is that the
AD7609 has a larger range (±10V & ±20V) vs the ±5V & ±10V ranges for AD7608.
However, unlike AD7605-4 part, these 3 parts have oversampling which is
configurable (like for the AD7606 in HW-mode) via GPIOs.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7607.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7608.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7609.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241025095939.271811-6-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-10-25 12:59:39 +03:00
|
|
|
{ .name = "ad7607", .driver_data = (kernel_ulong_t)&ad7607_info, },
|
|
|
|
{ .name = "ad7608", .driver_data = (kernel_ulong_t)&ad7608_info, },
|
|
|
|
{ .name = "ad7609", .driver_data = (kernel_ulong_t)&ad7609_info, },
|
2011-02-22 21:46:18 +01:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(platform, ad7606_driver_ids);
|
|
|
|
|
2018-12-13 14:46:20 +02:00
|
|
|
static const struct of_device_id ad7606_of_match[] = {
|
2024-10-15 13:56:18 +00:00
|
|
|
{ .compatible = "adi,ad7605-4", .data = &ad7605_4_info },
|
|
|
|
{ .compatible = "adi,ad7606-4", .data = &ad7606_4_info },
|
|
|
|
{ .compatible = "adi,ad7606-6", .data = &ad7606_6_info },
|
|
|
|
{ .compatible = "adi,ad7606-8", .data = &ad7606_8_info },
|
2024-10-15 13:56:20 +00:00
|
|
|
{ .compatible = "adi,ad7606b", .data = &ad7606b_info },
|
2025-03-18 17:52:18 -05:00
|
|
|
{ .compatible = "adi,ad7606c-16", .data = &ad7606c_16_info },
|
|
|
|
{ .compatible = "adi,ad7606c-18", .data = &ad7606c_18_info },
|
iio: adc: ad7606: add support for AD760{7,8,9} parts
The AD7607, AD7608 and AD7609 are some older parts of the AD7606 family.
They are hardware-only, meaning that they don't have any registers
accessible via SPI or Parallel interface.
They are more similar to the AD7605-4 part, which is supported by the
'ad7606' driver, and are configurable via GPIOs.
Like the AD7605-4 part, all 3 parts have 2 CONVST (Conversion Start) pins
(CONVST A and CONVST B). But in practice, these should be tied together to
make reading of samples easier via a serial line.
The AD7607 has an 14-bit resolution and AD7608 & AD7609 have an 18-bit
resolution. The main difference between the AD7608 & AD7609 is that the
AD7609 has a larger range (±10V & ±20V) vs the ±5V & ±10V ranges for AD7608.
However, unlike AD7605-4 part, these 3 parts have oversampling which is
configurable (like for the AD7606 in HW-mode) via GPIOs.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7607.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7608.pdf
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7609.pdf
Signed-off-by: Alexandru Ardelean <aardelean@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241025095939.271811-6-aardelean@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-10-25 12:59:39 +03:00
|
|
|
{ .compatible = "adi,ad7607", .data = &ad7607_info },
|
|
|
|
{ .compatible = "adi,ad7608", .data = &ad7608_info },
|
|
|
|
{ .compatible = "adi,ad7609", .data = &ad7609_info },
|
2024-08-18 19:09:12 +01:00
|
|
|
{ }
|
2018-12-13 14:46:20 +02:00
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, ad7606_of_match);
|
|
|
|
|
2011-02-22 21:46:18 +01:00
|
|
|
static struct platform_driver ad7606_driver = {
|
|
|
|
.probe = ad7606_par_probe,
|
|
|
|
.id_table = ad7606_driver_ids,
|
|
|
|
.driver = {
|
2018-12-17 14:23:38 +02:00
|
|
|
.name = "ad7606",
|
|
|
|
.pm = AD7606_PM_OPS,
|
2018-12-13 14:46:20 +02:00
|
|
|
.of_match_table = ad7606_of_match,
|
2011-02-22 21:46:18 +01:00
|
|
|
},
|
|
|
|
};
|
2012-03-01 10:51:05 +01:00
|
|
|
module_platform_driver(ad7606_driver);
|
2011-02-22 21:46:18 +01:00
|
|
|
|
2018-08-14 13:23:17 +02:00
|
|
|
MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
|
2011-02-22 21:46:18 +01:00
|
|
|
MODULE_DESCRIPTION("Analog Devices AD7606 ADC");
|
|
|
|
MODULE_LICENSE("GPL v2");
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
MODULE_IMPORT_NS("IIO_AD7606");
|
|
|
|
MODULE_IMPORT_NS("IIO_BACKEND");
|