From 8f2983fb44e5850eaf1bc876b538a5fbe05a4be8 Mon Sep 17 00:00:00 2001 From: Jianxin Pan Date: Tue, 5 Nov 2019 04:55:40 -0700 Subject: [PATCH] Revert "io: make register access in amvecm simple [1/1]" This reverts commit 7436b7dc4acf29ea9549249cbdd2ef6df1b91e92. revert this now, print_vpp_lut() stack is 1840, when this applied, it will bigger than 1880. werror will be triggerd. Change-Id: Ia7b084ee800081a75c70f4e6ea6ce739f113f2b8 --- drivers/amlogic/iomap/iomap.c | 6 ---- .../media/enhancement/amvecm/local_contrast.c | 2 +- include/linux/amlogic/iomap.h | 33 ---------------------- include/linux/amlogic/media/amvecm/amvecm.h | 10 ++++--- 4 files changed, 7 insertions(+), 44 deletions(-) diff --git a/drivers/amlogic/iomap/iomap.c b/drivers/amlogic/iomap/iomap.c index a11a4a6..239183b 100644 --- a/drivers/amlogic/iomap/iomap.c +++ b/drivers/amlogic/iomap/iomap.c @@ -39,8 +39,6 @@ static const struct of_device_id iomap_dt_match[] = { static void __iomem *meson_reg_map[IO_BUS_MAX] = { NULL }; static uint meson_reg_max[IO_BUS_MAX] = { 0 }; -void __iomem *vpp_base; -unsigned int vpp_max; inline int aml_reg_read(u32 bus_type, unsigned int reg, unsigned int *val) { @@ -297,10 +295,6 @@ static int iomap_probe(struct platform_device *pdev) meson_reg_max[i] = res.end - res.start; i++; } - if (i > IO_VAPB_BUS_BASE) { - vpp_base = meson_reg_map[IO_VAPB_BUS_BASE]; - vpp_max = meson_reg_max[IO_VAPB_BUS_BASE]; - } pr_info("amlogic iomap probe done\n"); return 0; } diff --git a/drivers/amlogic/media/enhancement/amvecm/local_contrast.c b/drivers/amlogic/media/enhancement/amvecm/local_contrast.c index 7931d5e..bcb51ac 100644 --- a/drivers/amlogic/media/enhancement/amvecm/local_contrast.c +++ b/drivers/amlogic/media/enhancement/amvecm/local_contrast.c @@ -14,7 +14,7 @@ * more details. * */ -#define SKIP_IO_TRACE + #include #include #include diff --git a/include/linux/amlogic/iomap.h b/include/linux/amlogic/iomap.h index 9dfae78..663ad76 100644 --- a/include/linux/amlogic/iomap.h +++ b/include/linux/amlogic/iomap.h @@ -93,37 +93,4 @@ extern void aml_write_hiubus(unsigned int reg, unsigned int val); extern void aml_hiubus_update_bits(unsigned int reg, unsigned int mask, unsigned int val); - -#include -extern void __iomem *vpp_base; -extern uint vpp_max; - -static inline int aml_reg_vcbus_invalid(unsigned int reg) -{ - return !(vpp_base && (vpp_max >= reg)); -} - -static inline int aml_read_vcbus_s(unsigned int reg) -{ - return readl((vpp_base + (reg << 2))); -} - -static inline void aml_write_vcbus_s(unsigned int reg, unsigned int val) -{ - writel(val, (vpp_base + (reg << 2))); -} - -static inline void aml_vcbus_update_bits_s(unsigned int reg, unsigned int value, - unsigned int start, unsigned int len) -{ - unsigned int tmp, orig; - unsigned int mask = (((1L << len) - 1) << start); - int r = (reg << 2); - - orig = readl((vpp_base + r)); - tmp = orig & ~mask; - tmp |= value & mask; - writel(tmp, (vpp_base + r)); -} - #endif diff --git a/include/linux/amlogic/media/amvecm/amvecm.h b/include/linux/amlogic/media/amvecm/amvecm.h index d136d34..a6d66ce 100644 --- a/include/linux/amlogic/media/amvecm/amvecm.h +++ b/include/linux/amlogic/media/amvecm/amvecm.h @@ -447,12 +447,12 @@ struct am_pq_parm_s { static inline void WRITE_VPP_REG(uint32_t reg, const uint32_t value) { - aml_write_vcbus_s(reg, value); + aml_write_vcbus(reg, value); } static inline uint32_t READ_VPP_REG(uint32_t reg) { - return aml_read_vcbus_s(reg); + return aml_read_vcbus(reg); } static inline void WRITE_VPP_REG_BITS(uint32_t reg, @@ -460,7 +460,9 @@ static inline void WRITE_VPP_REG_BITS(uint32_t reg, const uint32_t start, const uint32_t len) { - aml_vcbus_update_bits_s(reg, value, start, len); + WRITE_VPP_REG(reg, ((READ_VPP_REG(reg) & + ~(((1L << (len)) - 1) << (start))) | + (((value) & ((1L << (len)) - 1)) << (start)))); } static inline uint32_t READ_VPP_REG_BITS(uint32_t reg, @@ -469,7 +471,7 @@ static inline uint32_t READ_VPP_REG_BITS(uint32_t reg, { uint32_t val; - val = ((aml_read_vcbus_s(reg) >> (start)) & ((1L << (len)) - 1)); + val = ((READ_VPP_REG(reg) >> (start)) & ((1L << (len)) - 1)); return val; } -- 2.7.4