linux/drivers/reset/amlogic/reset-meson-aux.c
Arnd Bergmann f51df260e8 Reset controller updates for v6.14 (v2)
* Add support for A1 SoC in amlogic reset driver.
 * Drop aux registration helper from amlogic reset driver.
 -----BEGIN PGP SIGNATURE-----
 
 iI0EABYIADUWIQRRO6F6WdpH1R0vGibVhaclGDdiwAUCZ4fp4xcccC56YWJlbEBw
 ZW5ndXRyb25peC5kZQAKCRDVhaclGDdiwPZeAQC49hnPkGyg3ju+M3ZGxkVVkCUE
 ytv2GDykOGkM/Dz9AgD+J3x9+L1T2OqhpMc90nhZxMRouWtPJztMLzFqIcTa1Ac=
 =Mivr
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmeH6uUACgkQYKtH/8kJ
 UicJQQ//dKaFiMHfBqbw3edNbsL2/U5rCJmvxRitiKOavMm5w3npH9gl1bi/XZVA
 H3uiJDum6OBQpRAXHmwltSqNZJKtPumQ2xf6hiX6KRYlxlAyLwJK5RkmOXl7Ccil
 rCTaqajSWaqadUhZUljRhqcI1dpdFG1Adb4lPoxDxgFYLs/vNeJDBJgI3rIvA8aE
 XNc+HL4LXSQfo7XKZVwpgti/FAg3uXJqSdN2LLJA/MFjqqXaP1Ky2K5khuqUYY+q
 bbfEGg62UU199GEkNGzynRO5STpIFwlu/vLtc91a+97/9gYCmD6Y5SNJL4MgEi8K
 ZQGBGBSHLF2EVSGrW5dKXhcX/Ra4hhKqxNE/AeWMBrvCTehuzF4CpZ1zLdUuSt3r
 l+xMfoWh91ot/DDFut87kGEfKsXypiCrZGSJ5eUtzuWmyjAcYRNZ87qTD3uGlKG/
 7tEVb4RpXTjAKVZnIPS55ACf/sChiAk3hf02Iki5JMNspE8bXeXCSNVszTomQGL+
 XhlQoDxBWn6cyei6c5Asfu5guhPAI5NIMli80dutYT9ZxYI7CA1nuqCqRQ+uJ6n3
 xe2d98ISMRTUCahto/1QefT14c2tZF2AI6joSbMdz13F9N/64hrl3jrS2242IN0K
 Yj8n8LPdtBPjEjZlfQu47nH0SMGlUUwIVynGMXiTNyTG9khNJL8=
 =MjNd
 -----END PGP SIGNATURE-----

Merge tag 'reset-for-v6.14-2' of git://git.pengutronix.de/pza/linux into soc/drivers

Reset controller updates for v6.14 (v2)

* Add support for A1 SoC in amlogic reset driver.
* Drop aux registration helper from amlogic reset driver.

* tag 'reset-for-v6.14-2' of git://git.pengutronix.de/pza/linux:
  reset: amlogic: aux: drop aux registration helper
  reset: amlogic: aux: get regmap through parent device
  reset: amlogic: add support for A1 SoC in auxiliary reset driver
  dt-bindings: reset: add bindings for A1 SoC audio reset controller
  clk: amlogic: axg-audio: revert reset implementation
  Revert "clk: Fix invalid execution of clk_set_rate"

Link: https://lore.kernel.org/r/20250115170247.1303656-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-01-15 18:05:41 +01:00

81 lines
2.2 KiB
C

// 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"
static const struct meson_reset_param meson_a1_audio_param = {
.reset_ops = &meson_reset_toggle_ops,
.reset_num = 32,
.level_offset = 0x28,
};
static const struct meson_reset_param meson_a1_audio_vad_param = {
.reset_ops = &meson_reset_toggle_ops,
.reset_num = 6,
.level_offset = 0x8,
};
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[] = {
{
.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,
}, {
.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);
struct regmap *map;
map = dev_get_regmap(adev->dev.parent, NULL);
if (!map)
return -EINVAL;
return meson_reset_controller_register(&adev->dev, map, param);
}
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_IMPORT_NS("MESON_RESET");