Am Freitag, den 28.11.2014, 17:43 +0800 schrieb Andy Yan:
Hi Zabel:Four additional lines, a new defined type, a few more changes to struct
On 2014å11æ27æ 00:34, Philipp Zabel wrote:
Am Mittwoch, den 26.11.2014, 21:32 +0800 schrieb Andy Yan:Is there any disadvantage to do like this?
On rockchip rk3288, only word(32-bit) accesses areI see no need to introduce this. Just explicitly multiply the offset in
permitted for hdmi registers. Byte width accesses (writeb,
readb) generate an imprecise external abort.
Signed-off-by: Andy Yan <andy.yan@xxxxxxxxxxxxxx>
---
Changes in v13: None
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
- refactor register access without reg_shift
Changes in v5:
- refactor reg-io-width
Changes in v4: None
Changes in v3:
- split multi-register access to one indepent patch
drivers/gpu/drm/bridge/dw_hdmi.c | 57 +++++++++++++++++++++++++++++++++++-----
1 file changed, 51 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index a53bf63..5e88c8d 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -100,6 +100,11 @@ struct hdmi_data_info {
struct hdmi_vmode video_mode;
};
+union dw_reg_ptr {
+ u32 __iomem *p32;
+ u8 __iomem *p8;
+};
dw_hdmi_writel.
The compiler can help us do the explicitly multiply by this way.
dw_hdmi and dw_hdmi_bind necessary.
Technically I see no problem to let the compiler do the multiplication,
my issue is that it ever so slightly obfuscates the code. Instead of
just writing "* 4" in two functions, we get a new union that you need to
know about when looking at struct dw_hdmi and dw_hdmi_bind, regs.p8 is
used but never assigned directly, it's just a tiny bit of additional
effort needed to understand the code. But when the cost to avoid that is
so small...
regards
Philipp
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-rockchip