diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2019-01-30 15:57:56 +0100 |
---|---|---|
committer | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2019-03-27 12:18:53 +0100 |
commit | 8e1f8520a89e44763a3683ae1965e1db1e4c4318 (patch) | |
tree | 9750a71f9cd1385706a4f44ea437aff222b148c1 | |
parent | 81b35ee6c4a2d5b28d9a0c2405735ab9cd216df3 (diff) | |
download | linux-exynos-8e1f8520a89e44763a3683ae1965e1db1e4c4318.tar.gz linux-exynos-8e1f8520a89e44763a3683ae1965e1db1e4c4318.tar.bz2 linux-exynos-8e1f8520a89e44763a3683ae1965e1db1e4c4318.zip |
soc: samsung: chipid: Add exynos_chipid_read_bits() function
Add register read helper function needed by the ASV driver.
Change-Id: I90ec78cff58ac7ff424a50309e83d37605e7cbc7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
-rw-r--r-- | drivers/soc/samsung/exynos-chipid.c | 6 | ||||
-rw-r--r-- | drivers/soc/samsung/exynos-chipid.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c index 4920f0ef2c55..17d06d21bc6f 100644 --- a/drivers/soc/samsung/exynos-chipid.c +++ b/drivers/soc/samsung/exynos-chipid.c @@ -44,6 +44,12 @@ unsigned int exynos_chipid_read(unsigned int offset) return readl_relaxed(exynos_chipid_base + offset); } +unsigned int exynos_chipid_read_bits(unsigned int offset, unsigned int shift, + unsigned int mask) +{ + return (readl_relaxed(exynos_chipid_base + offset) >> shift) & mask; +} + static const char * __init product_id_to_soc_id(unsigned int product_id) { int i; diff --git a/drivers/soc/samsung/exynos-chipid.h b/drivers/soc/samsung/exynos-chipid.h index 826a12c25fa2..754528120522 100644 --- a/drivers/soc/samsung/exynos-chipid.h +++ b/drivers/soc/samsung/exynos-chipid.h @@ -46,3 +46,5 @@ #define EXYNOS5422_KFC_DN_MASK 0x03 unsigned int exynos_chipid_read(unsigned int offset); +unsigned int exynos_chipid_read_bits(unsigned int offset, unsigned int shift, + unsigned int mask); |