summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_drv.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-02-21 18:57:42 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-03-01 12:28:40 +0300
commita38410860628909712ea6a2becd42bab56c70e9a (patch)
treea2c68fae1f8d7eb95f9fd7ec39c30e88013c80ee /drivers/gpu/drm/ast/ast_drv.h
parentba3f6db4afee3f4253dbe06f4f75f9ddc6c20b8f (diff)
downloadlinux-a38410860628909712ea6a2becd42bab56c70e9a.tar.xz
drm/ast: Remove little-endianism from I/O helpers
Replace one call to ast_io_write16() with two calls to ast_io_write8() in ast_set_index_reg(). The combined 16-bit-wide write of an index register and the corresponding data register only works on little- endian systems. Write both registers independent from each other. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230221155745.27484-2-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_drv.h')
-rw-r--r--drivers/gpu/drm/ast/ast_drv.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index d51b81fea9c8..1f46162adb64 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -282,7 +282,9 @@ static inline void ast_set_index_reg(struct ast_private *ast,
uint32_t base, uint8_t index,
uint8_t val)
{
- ast_io_write16(ast, base, ((u16)val << 8) | index);
+ ast_io_write8(ast, base, index);
+ ++base;
+ ast_io_write8(ast, base, val);
}
void ast_set_index_reg_mask(struct ast_private *ast,