2021-05-06 09:09:35 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
/*
|
|
|
|
* NXP FXLS8962AF/FXLS8964AF Accelerometer I2C Driver
|
|
|
|
*
|
|
|
|
* Copyright 2021 Connected Cars A/S
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/dev_printk.h>
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/i2c.h>
|
|
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/regmap.h>
|
|
|
|
|
|
|
|
#include "fxls8962af.h"
|
|
|
|
|
|
|
|
static int fxls8962af_probe(struct i2c_client *client)
|
|
|
|
{
|
|
|
|
struct regmap *regmap;
|
|
|
|
|
2021-12-20 13:51:43 +01:00
|
|
|
regmap = devm_regmap_init_i2c(client, &fxls8962af_i2c_regmap_conf);
|
2021-05-06 09:09:35 +02:00
|
|
|
if (IS_ERR(regmap)) {
|
|
|
|
dev_err(&client->dev, "Failed to initialize i2c regmap\n");
|
|
|
|
return PTR_ERR(regmap);
|
|
|
|
}
|
|
|
|
|
|
|
|
return fxls8962af_core_probe(&client->dev, regmap, client->irq);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct i2c_device_id fxls8962af_id[] = {
|
|
|
|
{ "fxls8962af", fxls8962af },
|
|
|
|
{ "fxls8964af", fxls8964af },
|
2024-11-15 15:24:00 -05:00
|
|
|
{ "fxls8967af", fxls8967af },
|
2024-11-15 15:23:59 -05:00
|
|
|
{ "fxls8974cf", fxls8974cf },
|
2025-04-11 15:49:34 -05:00
|
|
|
{ }
|
2021-05-06 09:09:35 +02:00
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(i2c, fxls8962af_id);
|
|
|
|
|
|
|
|
static const struct of_device_id fxls8962af_of_match[] = {
|
|
|
|
{ .compatible = "nxp,fxls8962af" },
|
|
|
|
{ .compatible = "nxp,fxls8964af" },
|
2025-04-11 15:49:34 -05:00
|
|
|
{ }
|
2021-05-06 09:09:35 +02:00
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, fxls8962af_of_match);
|
|
|
|
|
|
|
|
static struct i2c_driver fxls8962af_driver = {
|
|
|
|
.driver = {
|
|
|
|
.name = "fxls8962af_i2c",
|
|
|
|
.of_match_table = fxls8962af_of_match,
|
2022-09-25 16:57:16 +01:00
|
|
|
.pm = pm_ptr(&fxls8962af_pm_ops),
|
2021-05-06 09:09:35 +02:00
|
|
|
},
|
2023-05-15 22:50:48 +02:00
|
|
|
.probe = fxls8962af_probe,
|
2021-05-06 09:09:35 +02:00
|
|
|
.id_table = fxls8962af_id,
|
|
|
|
};
|
|
|
|
module_i2c_driver(fxls8962af_driver);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Sean Nyekjaer <sean@geanix.com>");
|
|
|
|
MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer i2c driver");
|
|
|
|
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_FXLS8962AF");
|