| /* SPDX-License-Identifier: GPL-2.0 */ |
| /************************************************************************ |
| File : Clock H/w specific Information |
| Author: Pankaj Dev <pankaj.dev@st.com> |
| Copyright (C) 2014 STMicroelectronics |
| ************************************************************************/ |
| extern spinlock_t clkgen_a9_lock; |
| static inline unsigned long clkgen_read(void __iomem *base, |
| struct clkgen_field *field) |
| return (readl(base + field->offset) >> field->shift) & field->mask; |
| static inline void clkgen_write(void __iomem *base, struct clkgen_field *field, |
| writel((readl(base + field->offset) & |
| ~(field->mask << field->shift)) | (val << field->shift), |
| #define CLKGEN_FIELD(_offset, _mask, _shift) { \ |
| #define CLKGEN_READ(pll, field) clkgen_read(pll->regs_base, \ |
| #define CLKGEN_WRITE(pll, field, val) clkgen_write(pll->regs_base, \ |
| #endif /*__CLKGEN_INFO_H*/ |