1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2013 STMicroelectronics (R&D) Limited
4 * Author: Stephen Gallimore <stephen.gallimore@st.com>
6 #ifndef __STI_RESET_SYSCFG_H
7 #define __STI_RESET_SYSCFG_H
9 #include <linux/device.h>
10 #include <linux/regmap.h>
11 #include <linux/reset-controller.h>
14 * Reset channel description for a system configuration register based
17 * @compatible: Compatible string of the syscon regmap containing this
18 * channel's control and ack (status) bits.
19 * @reset: Regmap field description of the channel's reset bit.
20 * @ack: Regmap field description of the channel's acknowledge bit.
22 struct syscfg_reset_channel_data
{
23 const char *compatible
;
24 struct reg_field reset
;
28 #define _SYSCFG_RST_CH(_c, _rr, _rb, _ar, _ab) \
30 .reset = REG_FIELD(_rr, _rb, _rb), \
31 .ack = REG_FIELD(_ar, _ab, _ab), }
33 #define _SYSCFG_RST_CH_NO_ACK(_c, _rr, _rb) \
35 .reset = REG_FIELD(_rr, _rb, _rb), }
38 * Description of a system configuration register based reset controller.
40 * @wait_for_ack: The controller will wait for reset assert and de-assert to
41 * be "ack'd" in a channel's ack field.
42 * @active_low: Are the resets in this controller active low, i.e. clearing
43 * the reset bit puts the hardware into reset.
44 * @nr_channels: The number of reset channels in this controller.
45 * @channels: An array of reset channel descriptions.
47 struct syscfg_reset_controller_data
{
51 const struct syscfg_reset_channel_data
*channels
;
55 * syscfg_reset_probe(): platform device probe function used by syscfg
56 * reset controller drivers. This registers a reset
57 * controller configured by the OF match data for
58 * the compatible device which should be of type
59 * "struct syscfg_reset_controller_data".
61 * @pdev: platform device
63 int syscfg_reset_probe(struct platform_device
*pdev
);
65 #endif /* __STI_RESET_SYSCFG_H */