Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 81 lines 2.2 kB view raw
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2/* 3 * Amlogic Meson Reset Auxiliary driver 4 * 5 * Copyright (c) 2024 BayLibre, SAS. 6 * Author: Jerome Brunet <jbrunet@baylibre.com> 7 */ 8 9#include <linux/err.h> 10#include <linux/module.h> 11#include <linux/auxiliary_bus.h> 12#include <linux/regmap.h> 13#include <linux/reset-controller.h> 14 15#include "reset-meson.h" 16 17static const struct meson_reset_param meson_a1_audio_param = { 18 .reset_ops = &meson_reset_toggle_ops, 19 .reset_num = 32, 20 .level_offset = 0x28, 21}; 22 23static const struct meson_reset_param meson_a1_audio_vad_param = { 24 .reset_ops = &meson_reset_toggle_ops, 25 .reset_num = 6, 26 .level_offset = 0x8, 27}; 28 29static const struct meson_reset_param meson_g12a_audio_param = { 30 .reset_ops = &meson_reset_toggle_ops, 31 .reset_num = 26, 32 .level_offset = 0x24, 33}; 34 35static const struct meson_reset_param meson_sm1_audio_param = { 36 .reset_ops = &meson_reset_toggle_ops, 37 .reset_num = 39, 38 .level_offset = 0x28, 39}; 40 41static const struct auxiliary_device_id meson_reset_aux_ids[] = { 42 { 43 .name = "a1-audio-clkc.rst-a1", 44 .driver_data = (kernel_ulong_t)&meson_a1_audio_param, 45 }, { 46 .name = "a1-audio-clkc.rst-a1-vad", 47 .driver_data = (kernel_ulong_t)&meson_a1_audio_vad_param, 48 }, { 49 .name = "axg-audio-clkc.rst-g12a", 50 .driver_data = (kernel_ulong_t)&meson_g12a_audio_param, 51 }, { 52 .name = "axg-audio-clkc.rst-sm1", 53 .driver_data = (kernel_ulong_t)&meson_sm1_audio_param, 54 }, {} 55}; 56MODULE_DEVICE_TABLE(auxiliary, meson_reset_aux_ids); 57 58static int meson_reset_aux_probe(struct auxiliary_device *adev, 59 const struct auxiliary_device_id *id) 60{ 61 const struct meson_reset_param *param = 62 (const struct meson_reset_param *)(id->driver_data); 63 struct regmap *map; 64 65 map = dev_get_regmap(adev->dev.parent, NULL); 66 if (!map) 67 return -EINVAL; 68 69 return meson_reset_controller_register(&adev->dev, map, param); 70} 71 72static struct auxiliary_driver meson_reset_aux_driver = { 73 .probe = meson_reset_aux_probe, 74 .id_table = meson_reset_aux_ids, 75}; 76module_auxiliary_driver(meson_reset_aux_driver); 77 78MODULE_DESCRIPTION("Amlogic Meson Reset Auxiliary driver"); 79MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>"); 80MODULE_LICENSE("Dual BSD/GPL"); 81MODULE_IMPORT_NS("MESON_RESET");