Commit 9a4cc897 authored by Lee Jones's avatar Lee Jones Committed by Philipp Zabel

reset: sti: Provide ops .status() call-back

Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 1a539387
...@@ -110,10 +110,33 @@ static int syscfg_reset_dev(struct reset_controller_dev *rcdev, ...@@ -110,10 +110,33 @@ static int syscfg_reset_dev(struct reset_controller_dev *rcdev,
return syscfg_reset_deassert(rcdev, idx); return syscfg_reset_deassert(rcdev, idx);
} }
static int syscfg_reset_status(struct reset_controller_dev *rcdev,
unsigned long idx)
{
struct syscfg_reset_controller *rst = to_syscfg_reset_controller(rcdev);
const struct syscfg_reset_channel *ch;
u32 ret_val = 0;
int err;
if (idx >= rcdev->nr_resets)
return -EINVAL;
ch = &rst->channels[idx];
if (ch->ack)
err = regmap_field_read(ch->ack, &ret_val);
else
err = regmap_field_read(ch->reset, &ret_val);
if (err)
return err;
return rst->active_low ? !ret_val : !!ret_val;
}
static struct reset_control_ops syscfg_reset_ops = { static struct reset_control_ops syscfg_reset_ops = {
.reset = syscfg_reset_dev, .reset = syscfg_reset_dev,
.assert = syscfg_reset_assert, .assert = syscfg_reset_assert,
.deassert = syscfg_reset_deassert, .deassert = syscfg_reset_deassert,
.status = syscfg_reset_status,
}; };
static int syscfg_reset_controller_register(struct device *dev, static int syscfg_reset_controller_register(struct device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment