GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.kernel.org — Reset controller API — The Linux Kernel documentation Reset controller API¶Introduction¶Reset controllers are central units that control the reset signals to multiple peripherals. The reset controller API is split into two parts: the consumer driver interface (API reference), which allows peripheral drivers to request control over their reset input signals, and the reset controller driver interface (API reference), which is used by drivers for reset controller devices to register their reset controls to provide them to the consumers. While some reset controller hardware units also implement system restart functionality, restart handlers are out of scope for the reset controller API. Glossary¶The reset controller API uses these terms with a specific meaning: Reset line
Reset control
Reset controller
Reset consumer
Consumer driver interface¶This interface provides an API that is similar to the kernel clock framework. Consumer drivers use get and put operations to acquire and release reset controls. Functions are provided to assert and deassert the controlled reset lines, trigger reset pulses, or to query reset line status. When requesting reset controls, consumers can use symbolic names for their reset inputs, which are mapped to an actual reset control on an existing reset controller device by the core. A stub version of this API is provided when the reset controller framework is not in use in order to minimize the need to use ifdefs. Shared and exclusive resets¶The reset controller API provides either reference counted deassertion and
assertion or direct, exclusive control.
The distinction between shared and exclusive reset controls is made at the time
the reset control is requested, either via Shared resets behave similarly to clocks in the kernel clock framework. They provide reference counted deassertion, where only the first deassert, which increments the deassertion reference count to one, and the last assert which decrements the deassertion reference count back to zero, have a physical effect on the reset line. Exclusive resets on the other hand guarantee direct control. That is, an assert causes the reset line to be asserted immediately, and a deassert causes the reset line to be deasserted immediately. Assertion and deassertion¶Consumer drivers use the Note that since multiple consumers may be using a shared reset control, there
is no guarantee that calling Triggering¶Consumer drivers use The reset controller API allows requesting self-deasserting reset controls as
shared, but for those only the first trigger request causes an actual pulse to
be issued on the reset line.
All further calls to this function have no effect until all consumers have
called Querying¶Only some reset controllers support querying the current status of a reset
line, via Optional resets¶Often peripherals require a reset line on some platforms but not on others.
For this, reset controls can be requested as optional using
Reset control arrays¶Some drivers need to assert a bunch of reset lines in no particular order.
Reset controller driver interface¶Drivers for reset controller modules provide the functionality necessary to assert or deassert reset signals, to trigger a reset pulse on a reset line, or to query its current state. All functions are optional. Initialization¶Drivers fill a struct API reference¶The reset controller API is documented here in two parts: the reset consumer API and the reset controller driver API. Reset consumer API¶Reset consumers can control a reset line using an opaque reset control handle,
which can be obtained from
Definition: struct reset_control_bulk_data {
const char *id;
struct reset_control *rstc;
};
Members
Description The reset APIs provide a series of reset_control_bulk_*() API calls as a convenience to consumers which require multiple reset controls. This structure is used to manage data for these calls.
Constants
Parameters
Description Returns a See Use of id names is optional.
Parameters
Description Fills the rstcs array with pointers to exclusive reset controls and
returns 0, or an
Parameters
Description Returns a Use of id names is optional.
Parameters
Description Fills the rstcs array with pointers to exclusive reset controls and
returns 0, or an
Parameters
Description Optional variant of See
Parameters
Description Returns a When a reset-control is shared, the behavior of reset_control_assert / deassert is changed, the reset-core will keep track of a deassert_count and only (re-)assert the reset after reset_control_assert has been called as many times as reset_control_deassert was called. Also see the remark about shared reset-controls in the reset_control_assert docs. Calling reset_control_assert without first calling reset_control_deassert is not allowed on a shared reset control. Calling reset_control_reset is also not allowed on a shared reset control. Use of id names is optional.
Parameters
Description Fills the rstcs array with pointers to shared reset controls and
returns 0, or an
Parameters
Description Optional variant of See
Parameters
Description Optional variant of See
Parameters
Description Optional variant of See
Parameters
Description Optional variant of See
Parameters
Description Returns a Use of id names is optional.
Parameters
Description Optional variant of Returns a Use of id names is optional.
Parameters
Description When a reset-control is shared, the behavior of reset_control_assert / deassert is changed, the reset-core will keep track of a deassert_count and only (re-)assert the reset after reset_control_assert has been called as many times as reset_control_deassert was called. Also see the remark about shared reset-controls in the reset_control_assert docs. Calling reset_control_assert without first calling reset_control_deassert
is not allowed on a shared reset control. Calling reset_control_reset is
also not allowed on a shared reset control.
Returns a Use of id names is optional.
Parameters
Description This is to be used to perform a list of resets for a device or power domain
in whatever order. Returns a
Parameters
Description When a reset-control is shared, the behavior of reset_control_assert / deassert is changed, the reset-core will keep track of a deassert_count and only (re-)assert the reset after reset_control_assert has been called as many times as reset_control_deassert was called. Also see the remark about shared reset-controls in the reset_control_assert docs. Calling reset_control_assert without first calling reset_control_deassert
is not allowed on a shared reset control. Calling reset_control_reset is
also not allowed on a shared reset control.
Returns a This is to be used to perform a list of resets for a device or power domain
in whatever order. Returns a
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed-and-optional variant of See
Parameters
Description Managed See
Parameters
Description Managed
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed See
Parameters
Description Managed
Parameters
Description On a shared reset line the actual reset pulse is only triggered once for the lifetime of the reset_control instance: for all but the first caller this is a no-op. Consumers must not use reset_control_(de)assert on shared reset lines when reset_control_reset has been used. If rstc is NULL it is an optional reset and the function will just return 0.
Parameters
Description On a shared reset line the actual reset pulse is only triggered once for the lifetime of the reset_control instance, except if this call is used. Calls to this function must be balanced with calls to reset_control_reset, a warning is thrown in case triggered_count ever dips below 0. Consumers must not use reset_control_(de)assert on shared reset lines when reset_control_reset or reset_control_rearm have been used. If rstc is NULL the function will just return 0.
Parameters
Description Calling this on an exclusive reset controller guarantees that the reset will be asserted. When called on a shared reset controller the line may still be deasserted, as long as other users keep it so. For shared reset controls a driver cannot expect the hw’s registers and internal state to be reset, but must be prepared for this to happen. Consumers must not use reset_control_reset on shared reset lines when reset_control_(de)assert has been used. If rstc is NULL it is an optional reset and the function will just return 0.
Parameters
Description After calling this function, the reset is guaranteed to be deasserted. Consumers must not use reset_control_reset on shared reset lines when reset_control_(de)assert has been used. If rstc is NULL it is an optional reset and the function will just return 0.
Parameters
Parameters
Description This is used to explicitly acquire a reset control for exclusive use. Note
that exclusive resets are requested as acquired by default. In order for a
second consumer to be able to control the reset, the first consumer has to
release it first. Typically the easiest way to achieve this is to call the
Consumers implementing shared access to an exclusive reset need to follow
a specific protocol in order to work together. Before consumers can change
a reset they must acquire exclusive access using See also:
Parameters
Description Releases exclusive access right to a reset control previously obtained by a
call to See also:
Parameters
Parameters
Description The reset control array APIs are intended for a list of resets that just have to be asserted or deasserted, without any requirements on the order. Returns pointer to allocated reset_control on success or error on failure Parameters
Description Returns positive reset count on success, or error number on failure and on count being zero. Reset controller driver API¶Reset controller drivers are supposed to implement the necessary functions in
a static constant structure
Definition: struct reset_control_ops {
int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
int (*status)(struct reset_controller_dev *rcdev, unsigned long id);
};
Members
Definition: struct reset_controller_dev {
const struct reset_control_ops *ops;
struct module *owner;
struct list_head list;
struct list_head reset_control_head;
struct device *dev;
struct device_node *of_node;
int of_reset_n_cells;
int (*of_xlate)(struct reset_controller_dev *rcdev, const struct of_phandle_args *reset_spec);
struct fwnode_handle *fwnode;
int fwnode_reset_n_cells;
int (*fwnode_xlate)(struct reset_controller_dev *rcdev, const struct fwnode_reference_args *reset_spec);
unsigned int nr_resets;
struct mutex lock;
};
Members
Parameters
Description This static translation function is used by default if neither fwnode_xlate
not of_xlate in
Parameters
Parameters
Parameters
Description Managed |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |