2024-09-10 18:32:51 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
|
|
|
/*
|
|
|
|
* Amlogic Meson Reset Auxiliary driver
|
|
|
|
*
|
|
|
|
* Copyright (c) 2024 BayLibre, SAS.
|
|
|
|
* Author: Jerome Brunet <jbrunet@baylibre.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/auxiliary_bus.h>
|
|
|
|
#include <linux/regmap.h>
|
|
|
|
#include <linux/reset-controller.h>
|
|
|
|
|
|
|
|
#include "reset-meson.h"
|
|
|
|
|
2024-11-13 02:00:56 +03:00
|
|
|
static const struct meson_reset_param meson_a1_audio_param = {
|
|
|
|
.reset_ops = &meson_reset_toggle_ops,
|
|
|
|
.reset_num = 32,
|
|
|
|
.level_offset = 0x28,
|
2024-09-10 18:32:51 +02:00
|
|
|
};
|
|
|
|
|
2024-11-13 02:00:56 +03:00
|
|
|
static const struct meson_reset_param meson_a1_audio_vad_param = {
|
|
|
|
.reset_ops = &meson_reset_toggle_ops,
|
|
|
|
.reset_num = 6,
|
|
|
|
.level_offset = 0x8,
|
|
|
|
};
|
2024-09-10 18:32:51 +02:00
|
|
|
|
|
|
|
static const struct meson_reset_param meson_g12a_audio_param = {
|
|
|
|
.reset_ops = &meson_reset_toggle_ops,
|
|
|
|
.reset_num = 26,
|
|
|
|
.level_offset = 0x24,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct meson_reset_param meson_sm1_audio_param = {
|
|
|
|
.reset_ops = &meson_reset_toggle_ops,
|
|
|
|
.reset_num = 39,
|
|
|
|
.level_offset = 0x28,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct auxiliary_device_id meson_reset_aux_ids[] = {
|
|
|
|
{
|
2024-11-13 02:00:56 +03:00
|
|
|
.name = "a1-audio-clkc.rst-a1",
|
|
|
|
.driver_data = (kernel_ulong_t)&meson_a1_audio_param,
|
|
|
|
}, {
|
|
|
|
.name = "a1-audio-clkc.rst-a1-vad",
|
|
|
|
.driver_data = (kernel_ulong_t)&meson_a1_audio_vad_param,
|
|
|
|
}, {
|
2024-09-10 18:32:51 +02:00
|
|
|
.name = "axg-audio-clkc.rst-g12a",
|
|
|
|
.driver_data = (kernel_ulong_t)&meson_g12a_audio_param,
|
|
|
|
}, {
|
|
|
|
.name = "axg-audio-clkc.rst-sm1",
|
|
|
|
.driver_data = (kernel_ulong_t)&meson_sm1_audio_param,
|
|
|
|
}, {}
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(auxiliary, meson_reset_aux_ids);
|
|
|
|
|
|
|
|
static int meson_reset_aux_probe(struct auxiliary_device *adev,
|
|
|
|
const struct auxiliary_device_id *id)
|
|
|
|
{
|
|
|
|
const struct meson_reset_param *param =
|
|
|
|
(const struct meson_reset_param *)(id->driver_data);
|
2024-12-09 17:04:34 +01:00
|
|
|
struct regmap *map;
|
|
|
|
|
|
|
|
map = dev_get_regmap(adev->dev.parent, NULL);
|
|
|
|
if (!map)
|
|
|
|
return -EINVAL;
|
2024-09-10 18:32:51 +02:00
|
|
|
|
2024-12-09 17:04:34 +01:00
|
|
|
return meson_reset_controller_register(&adev->dev, map, param);
|
2024-09-10 18:32:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct auxiliary_driver meson_reset_aux_driver = {
|
|
|
|
.probe = meson_reset_aux_probe,
|
|
|
|
.id_table = meson_reset_aux_ids,
|
|
|
|
};
|
|
|
|
module_auxiliary_driver(meson_reset_aux_driver);
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("Amlogic Meson Reset Auxiliary driver");
|
|
|
|
MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
|
|
|
|
MODULE_LICENSE("Dual BSD/GPL");
|
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("MESON_RESET");
|