| // SPDX-License-Identifier: GPL-2.0+ |
| * Actions Semi Owl Smart Power System (SPS) shared helpers |
| * Copyright 2012 Actions Semi Inc. |
| * Author: Actions Semi, Inc. |
| * Copyright (c) 2017 Andreas Färber |
| #include <linux/soc/actions/owl-sps.h> |
| #define OWL_SPS_PG_CTL 0x0 |
| int owl_sps_set_pg(void __iomem *base, u32 pwr_mask, u32 ack_mask, bool enable) |
| val = readl(base + OWL_SPS_PG_CTL); |
| writel(val, base + OWL_SPS_PG_CTL); |
| for (timeout = 5000; timeout > 0; timeout -= 50) { |
| val = readl(base + OWL_SPS_PG_CTL); |
| if ((val & ack_mask) == (enable ? ack_mask : 0)) |
| EXPORT_SYMBOL_GPL(owl_sps_set_pg); |