video: ssd1307fb: Handle width and height that are not multiple of 8
authorMarko Kohtala <marko.kohtala@okoko.fi>
Tue, 18 Jun 2019 07:41:09 +0000 (10:41 +0300)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 23 Jul 2019 15:18:19 +0000 (17:18 +0200)
commitb0020d8af991a904de57dbd9a7bc7a61982a6a8c
tree8644811d4e2be773dcb84185f3c84e0053be198b
parentdd9782834dd9dde3624ff1acea8859f3d3e792d4
video: ssd1307fb: Handle width and height that are not multiple of 8

Some displays have dimensions that are not multiple of eight, for example
height of 36, but the driver divided the dimensions by 8. Defining display
to the next multiple of 8 is not good as then the display registers get
configured to dimensions that do not match. This contradicts intructions
by some display manufacturers.

Use DIV_ROUND_UP to multiple of 8 when needed so correct values can be
used.

The ssd1307fb_update_display bit reordering receives a simplification in
the process.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-5-marko.kohtala@okoko.fi
drivers/video/fbdev/ssd1307fb.c