mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
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>
This commit is contained in:
parent
1a5f77d395
commit
f200890f22
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user