Skip to content

Commit

Permalink
reset: add socfpga_reset_status
Browse files Browse the repository at this point in the history
Populate the reset_status callback for SOCFPGA.

Signed-off-by: Alan Tull <[email protected]>
Signed-off-by: Dinh Nguyen <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
  • Loading branch information
Dinh Nguyen authored and pH5 committed Nov 4, 2014
1 parent 1a5f77d commit f200890
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/reset/reset-socfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,24 @@ static int socfpga_reset_deassert(struct reset_controller_dev *rcdev,
return 0;
}

static int socfpga_reset_status(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct socfpga_reset_data *data = container_of(rcdev,
struct socfpga_reset_data, rcdev);
int bank = id / BITS_PER_LONG;
int offset = id % BITS_PER_LONG;
u32 reg;

reg = readl(data->membase + OFFSET_MODRST + (bank * NR_BANKS));

return !(reg & BIT(offset));
}

static struct reset_control_ops socfpga_reset_ops = {
.assert = socfpga_reset_assert,
.deassert = socfpga_reset_deassert,
.status = socfpga_reset_status,
};

static int socfpga_reset_probe(struct platform_device *pdev)
Expand Down

0 comments on commit f200890

Please sign in to comment.