Skip to content

Commit

Permalink
drm/ast: Remove little-endianism from I/O helpers
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Zimmermann committed Mar 1, 2023
1 parent ba3f6db commit a384108
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/ast/ast_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a384108

Please sign in to comment.