diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-11-03 17:33:05 -0500 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2014-11-04 06:40:16 -0500 |
commit | f200890f224d9ed0af207145a2279f51c6be230b (patch) | |
tree | d3d3ac0712eb44648e295ad4303c895666e35f9f /drivers/reset/reset-socfpga.c | |
parent | 1a5f77d3959b4561bf19471785e44b63740cff90 (diff) |
reset: add socfpga_reset_status
Populate the reset_status callback for SOCFPGA.
Signed-off-by: Alan Tull <atull@opensource.altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/reset/reset-socfpga.c')
-rw-r--r-- | drivers/reset/reset-socfpga.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index 79c32ca84ef1..40582089474a 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c | |||
@@ -76,9 +76,24 @@ static int socfpga_reset_deassert(struct reset_controller_dev *rcdev, | |||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | static int socfpga_reset_status(struct reset_controller_dev *rcdev, | ||
80 | unsigned long id) | ||
81 | { | ||
82 | struct socfpga_reset_data *data = container_of(rcdev, | ||
83 | struct socfpga_reset_data, rcdev); | ||
84 | int bank = id / BITS_PER_LONG; | ||
85 | int offset = id % BITS_PER_LONG; | ||
86 | u32 reg; | ||
87 | |||
88 | reg = readl(data->membase + OFFSET_MODRST + (bank * NR_BANKS)); | ||
89 | |||
90 | return !(reg & BIT(offset)); | ||
91 | } | ||
92 | |||
79 | static struct reset_control_ops socfpga_reset_ops = { | 93 | static struct reset_control_ops socfpga_reset_ops = { |
80 | .assert = socfpga_reset_assert, | 94 | .assert = socfpga_reset_assert, |
81 | .deassert = socfpga_reset_deassert, | 95 | .deassert = socfpga_reset_deassert, |
96 | .status = socfpga_reset_status, | ||
82 | }; | 97 | }; |
83 | 98 | ||
84 | static int socfpga_reset_probe(struct platform_device *pdev) | 99 | static int socfpga_reset_probe(struct platform_device *pdev) |