Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755962AbZGBJ6U (ORCPT ); Thu, 2 Jul 2009 05:58:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751846AbZGBJ6M (ORCPT ); Thu, 2 Jul 2009 05:58:12 -0400 Received: from mail-px0-f190.google.com ([209.85.216.190]:63527 "EHLO mail-px0-f190.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbZGBJ6L (ORCPT ); Thu, 2 Jul 2009 05:58:11 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=dOMpjaTZ2pAiIDE+rbV5QrqdMP6WH8FrGglyezO1vUow/JCcSAR2W7yNo6HTOIg0oP XJqorAebnSoLd66ecRDQIk6xcPW3wwAPlMpXylHC9gecTopI9vZ8DEHVOVRhJfatYI4y hQhFdi10MiFxYPxL5CS3jvAAVdx0XitByhziA= MIME-Version: 1.0 Date: Thu, 2 Jul 2009 18:58:14 +0900 Message-ID: <90b950fc0907020258r4b690e23l11543cc37f5ed4a9@mail.gmail.com> Subject: [PATCH] fixed clock setting for Samsung SoC Framebuffer. From: InKi Dae To: linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Cc: Kyungmin Park Content-Type: multipart/mixed; boundary=000e0cd183941168d3046db614db Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4701 Lines: 105 --000e0cd183941168d3046db614db Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This patch corrects CLKVAL_F field value of VIDEO MAIN CONTROLLER 0 REGITSTER. Frame Rate is 1 / [ { (VSPW+1) + (VBPD+1) + (LIINEVAL + 1) + (VFPD+1) } x {(HSPW+1) + (HBPD +1) + (HFPD+1) + (HOZVAL + 1) } x { ( CLKVAL+1 ) / ( Frequency of Clock source ) } ] and VCLK = Video Clock Source / (CLKVAL +1). therefore CLKVAL_F should be "CLKVAL_F = Frequency of Clock source / pixel clock * refresh". for this, I added refresh value in platform data like below. static struct s3c_fb_pd_win xxx_fb_win0 = { /* this is to ensure we use win0 */ .win_mode = { .refresh = 60, .pixclock = (66+4+2+480)*(15+5+3+800), .left_margin = 66, .right_margin = 2, .upper_margin = 15, .lower_margin = 3, .hsync_len = 4, .vsync_len = 5, .xres = 480, .yres = 800, }, .max_bpp = 32, .default_bpp = 24, }; static struct s3c_fb_platdata xxx_lcd_pdata __initdata = { .win[0] = &xxx_fb_win0, .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC | VIDCON1_INV_VCLK | VIDCON1_INV_VDEN, .setup_gpio = s5pc1xx_fb_gpio_setup_24bpp, }; xxx_machine_init() { . . . s3c_fb_set_platdata(&xxx_lcd_pdata); } platform data defined in machine code should be setting using s3c_fb_set_platdata(). I have tested this patch on boards based on s3c6410 and s5pc100 and worked fine. I attached the patch for s3c-fb.c file. thanks. signed-by-off : InKi Dae. --000e0cd183941168d3046db614db Content-Type: application/octet-stream; name="lcd.patch" Content-Disposition: attachment; filename="lcd.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fwnaq5d80 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvdmlkZW8vczNjLWZiLmMgYi9kcml2ZXJzL3ZpZGVvL3MzYy1m Yi5jCmluZGV4IDQzNjgwZTUuLmJiNjNjMDcgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvdmlkZW8vczNj LWZiLmMKKysrIGIvZHJpdmVycy92aWRlby9zM2MtZmIuYwpAQCAtMjExLDIzICsyMTEsMjEgQEAg c3RhdGljIGludCBzM2NfZmJfY2hlY2tfdmFyKHN0cnVjdCBmYl92YXJfc2NyZWVuaW5mbyAqdmFy LAogCiAvKioKICAqIHMzY19mYl9jYWxjX3BpeGNsaygpIC0gY2FsY3VsYX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weGYpIHwKIAkJ VklESVNEMTRDX0FMUEhBMV9HKDB4ZikgfAogCQlWSURJU0QxNENfQUxQSEExX0IoMHhmKTsK --000e0cd183941168d3046db614db-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/