diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-07-13 06:13:47 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-08-19 02:22:39 -0400 |
commit | 505c7de51fe5ebb81fac096cb8cebd7cb45b7955 (patch) | |
tree | ff406ac0b768aaa16227cc5eeadc99d81d61d276 /drivers/video/sh_mobile_lcdcfb.c | |
parent | dc48665fae5aa360e80dfdb2d6cab4fa58b27ee4 (diff) |
fbdev: sh_mobile_lcdc: Compute clock pattern using divider denominator
The clock divider pattern is computed based on the dot clock register
value which stores the divider denumerator. However, when using a 1:1
divider ratio, the register is programmed with a value that must not be
interpreted as a denominator. This results in a shift left operation
with a value of 32, which produces undefined behaviour.
Compute the clock pattern using the divider denominator, not the dot
clock register value.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 99656f593de4..2d935db57eac 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -481,13 +481,15 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) | |||
481 | if (!m) | 481 | if (!m) |
482 | continue; | 482 | continue; |
483 | 483 | ||
484 | /* FIXME: sh7724 can only use 42, 48, 54 and 60 for the divider | ||
485 | * denominator. | ||
486 | */ | ||
487 | lcdc_write_chan(ch, LDDCKPAT1R, 0); | ||
488 | lcdc_write_chan(ch, LDDCKPAT2R, (1 << (m/2)) - 1); | ||
489 | |||
484 | if (m == 1) | 490 | if (m == 1) |
485 | m = LDDCKR_MOSEL; | 491 | m = LDDCKR_MOSEL; |
486 | tmp |= m << (lcdc_chan_is_sublcd(ch) ? 8 : 0); | 492 | tmp |= m << (lcdc_chan_is_sublcd(ch) ? 8 : 0); |
487 | |||
488 | /* FIXME: sh7724 can only use 42, 48, 54 and 60 for the divider denominator */ | ||
489 | lcdc_write_chan(ch, LDDCKPAT1R, 0); | ||
490 | lcdc_write_chan(ch, LDDCKPAT2R, (1 << (m/2)) - 1); | ||
491 | } | 493 | } |
492 | 494 | ||
493 | lcdc_write(priv, _LDDCKR, tmp); | 495 | lcdc_write(priv, _LDDCKR, tmp); |