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.

reset: amlogic: add driver parameters

To allow using the same driver for the main reset controller and the
auxiliary ones embedded in the clock controllers, allow to customise
the reset offset, same as the level offset. Also add an option to make
the level reset active low or high.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240910-meson-rst-aux-v5-4-60be62635d3e@baylibre.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Jerome Brunet and committed by
Philipp Zabel
6b2d2e5c ee649986

+13 -1
+13 -1
drivers/reset/reset-meson.c
··· 18 18 19 19 struct meson_reset_param { 20 20 unsigned int reg_count; 21 + unsigned int reset_offset; 21 22 unsigned int level_offset; 23 + bool level_low_reset; 22 24 }; 23 25 24 26 struct meson_reset { ··· 48 46 unsigned int offset, bit; 49 47 50 48 meson_reset_offset_and_bit(data, id, &offset, &bit); 49 + offset += data->param->reset_offset; 51 50 52 51 return regmap_write(data->map, offset, BIT(bit)); 53 52 } ··· 62 59 63 60 meson_reset_offset_and_bit(data, id, &offset, &bit); 64 61 offset += data->param->level_offset; 62 + assert ^= data->param->level_low_reset; 65 63 66 64 return regmap_update_bits(data->map, offset, 67 - BIT(bit), assert ? 0 : BIT(bit)); 65 + BIT(bit), assert ? BIT(bit) : 0); 68 66 } 69 67 70 68 static int meson_reset_assert(struct reset_controller_dev *rcdev, ··· 88 84 89 85 static const struct meson_reset_param meson8b_param = { 90 86 .reg_count = 8, 87 + .reset_offset = 0x0, 91 88 .level_offset = 0x7c, 89 + .level_low_reset = true, 92 90 }; 93 91 94 92 static const struct meson_reset_param meson_a1_param = { 95 93 .reg_count = 3, 94 + .reset_offset = 0x0, 96 95 .level_offset = 0x40, 96 + .level_low_reset = true, 97 97 }; 98 98 99 99 static const struct meson_reset_param meson_s4_param = { 100 100 .reg_count = 6, 101 + .reset_offset = 0x0, 101 102 .level_offset = 0x40, 103 + .level_low_reset = true, 102 104 }; 103 105 104 106 static const struct meson_reset_param t7_param = { 105 107 .reg_count = 7, 108 + .reset_offset = 0x0, 106 109 .level_offset = 0x40, 110 + .level_low_reset = true, 107 111 }; 108 112 109 113 static const struct of_device_id meson_reset_dt_ids[] = {