Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1255816 > unrolled thread

[PATCH 3/3] reset: sti: Provide ops .status() call-back

Started byLee Jones <lee.jones@linaro.org>
First post2015-10-26 12:00 +0100
Last post2015-10-26 12:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] reset: sti: Provide ops .status() call-back Lee Jones <lee.jones@linaro.org> - 2015-10-26 12:00 +0100

#1255816 — [PATCH 3/3] reset: sti: Provide ops .status() call-back

FromLee Jones <lee.jones@linaro.org>
Date2015-10-26 12:00 +0100
Subject[PATCH 3/3] reset: sti: Provide ops .status() call-back
Message-ID<qnNFn-7br-5@gated-at.bofh.it>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/reset/sti/reset-syscfg.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/reset/sti/reset-syscfg.c b/drivers/reset/sti/reset-syscfg.c
index a145cc0..4453412 100644
--- a/drivers/reset/sti/reset-syscfg.c
+++ b/drivers/reset/sti/reset-syscfg.c
@@ -110,10 +110,33 @@ static int syscfg_reset_dev(struct reset_controller_dev *rcdev,
 	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 = {
 	.reset    = syscfg_reset_dev,
 	.assert   = syscfg_reset_assert,
 	.deassert = syscfg_reset_deassert,
+	.status   = syscfg_reset_status,
 };
 
 static int syscfg_reset_controller_register(struct device *dev,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web