1 /************************************************************************
2 File : Clock H/w specific Information
4 Author: Pankaj Dev <pankaj.dev@st.com>
6 Copyright (C) 2014 STMicroelectronics
7 ************************************************************************/
9 #ifndef __CLKGEN_INFO_H
10 #define __CLKGEN_INFO_H
12 extern spinlock_t clkgen_a9_lock
;
20 static inline unsigned long clkgen_read(void __iomem
*base
,
21 struct clkgen_field
*field
)
23 return (readl(base
+ field
->offset
) >> field
->shift
) & field
->mask
;
27 static inline void clkgen_write(void __iomem
*base
, struct clkgen_field
*field
,
30 writel((readl(base
+ field
->offset
) &
31 ~(field
->mask
<< field
->shift
)) | (val
<< field
->shift
),
32 base
+ field
->offset
);
37 #define CLKGEN_FIELD(_offset, _mask, _shift) { \
43 #define CLKGEN_READ(pll, field) clkgen_read(pll->regs_base, \
46 #define CLKGEN_WRITE(pll, field, val) clkgen_write(pll->regs_base, \
47 &pll->data->field, val)
49 #endif /*__CLKGEN_INFO_H*/