mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 12:54:37 +00:00
dm: reset: Update uclass to allow querying reset status
Add a reset operations function pointer to support querying the current status of a reset control. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
parent
aec99c9776
commit
e7012e6e1f
3 changed files with 31 additions and 0 deletions
|
@ -192,6 +192,15 @@ int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int reset_status(struct reset_ctl *reset_ctl)
|
||||||
|
{
|
||||||
|
struct reset_ops *ops = reset_dev_ops(reset_ctl->dev);
|
||||||
|
|
||||||
|
debug("%s(reset_ctl=%p)\n", __func__, reset_ctl);
|
||||||
|
|
||||||
|
return ops->rst_status(reset_ctl);
|
||||||
|
}
|
||||||
|
|
||||||
int reset_release_all(struct reset_ctl *reset_ctl, int count)
|
int reset_release_all(struct reset_ctl *reset_ctl, int count)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
|
@ -76,6 +76,14 @@ struct reset_ops {
|
||||||
* @return 0 if OK, or a negative error code.
|
* @return 0 if OK, or a negative error code.
|
||||||
*/
|
*/
|
||||||
int (*rst_deassert)(struct reset_ctl *reset_ctl);
|
int (*rst_deassert)(struct reset_ctl *reset_ctl);
|
||||||
|
/**
|
||||||
|
* rst_status - Check reset signal status.
|
||||||
|
*
|
||||||
|
* @reset_ctl: The reset signal to check.
|
||||||
|
* @return 0 if deasserted, positive if asserted, or a negative
|
||||||
|
* error code.
|
||||||
|
*/
|
||||||
|
int (*rst_status)(struct reset_ctl *reset_ctl);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -206,6 +206,15 @@ int reset_deassert(struct reset_ctl *reset_ctl);
|
||||||
*/
|
*/
|
||||||
int reset_deassert_bulk(struct reset_ctl_bulk *bulk);
|
int reset_deassert_bulk(struct reset_ctl_bulk *bulk);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rst_status - Check reset signal status.
|
||||||
|
*
|
||||||
|
* @reset_ctl: The reset signal to check.
|
||||||
|
* @return 0 if deasserted, positive if asserted, or a negative
|
||||||
|
* error code.
|
||||||
|
*/
|
||||||
|
int reset_status(struct reset_ctl *reset_ctl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset_release_all - Assert/Free an array of previously requested resets.
|
* reset_release_all - Assert/Free an array of previously requested resets.
|
||||||
*
|
*
|
||||||
|
@ -279,6 +288,11 @@ static inline int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int reset_status(struct reset_ctl *reset_ctl)
|
||||||
|
{
|
||||||
|
return -ENOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int reset_release_all(struct reset_ctl *reset_ctl, int count)
|
static inline int reset_release_all(struct reset_ctl *reset_ctl, int count)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue