aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/reset/reset-socfpga.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-12-04 10:57:36 -0500
committerArnd Bergmann <arnd@arndb.de>2014-12-04 10:57:36 -0500
commita8afa2645ccf3525409c749c1dc4ec1cf95ff3f5 (patch)
tree0148315475b348246201f4d57b7ed5802f76cfb2 /drivers/reset/reset-socfpga.c
parent136a713d80476fe993284bdf8b21709c179c9965 (diff)
parentf200890f224d9ed0af207145a2279f51c6be230b (diff)
Merge tag 'reset-for-3.19-2' of git://git.pengutronix.de/git/pza/linux into next/drivers
Pull "Reset controller changes for v3.19" from Philipp Zabel: This adds a new driver for the sti soc family, and creates a reset_control_status interface, which is added to the existing drivers. * tag 'reset-for-3.19-2' of git://git.pengutronix.de/git/pza/linux: reset: add socfpga_reset_status reset: sti: Document sti-picophyreset controllers bindings. reset: stih407: Add softreset, powerdown and picophy controllers reset: stih407: Add reset controllers DT bindings reset: add reset_control_status helper function Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/reset/reset-socfpga.c')
-rw-r--r--drivers/reset/reset-socfpga.c15
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
79static 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
79static struct reset_control_ops socfpga_reset_ops = { 93static 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
84static int socfpga_reset_probe(struct platform_device *pdev) 99static int socfpga_reset_probe(struct platform_device *pdev)