This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PWM LCD backlight driver for Pandaboard

Other Parts Discussed in Thread: TWL6030

Hi 

     I need a driver for LCD backlight on Pandaboard. Now I need to use twl6030 pwm1 to chang the voltage.

     Now I use 3.0.21 kernel. Is there somebody can help me?

Thank you!

Yaoquan.Woo

  •     In kernel 3.0 , I enbale TWL6030 PWM (Pulse Width Modulator) Support / Generic PWM based Backlight Driver.  And in board-omap4panda.c put in driver like these codes:

    #include <linux/pwm_backlight.h>
    // pwm backlight
    static struct platform_pwm_backlight_data omap4460_backlight_data = {
        .pwm_id            = 0,
        .pwm_period_ns        = 7812500,
        .max_brightness        = 255,
        .dft_brightness        = 255,
        .init            = omap4460_bl_init,
    //    .notify            = omap4460_bl_notify,
    //    .exit            = omap4460_bl_exit,
    };

    static struct platform_device omap4460_backlight_device = {
        .name            = "pwm-backlight",
        .id            = -1,
        .dev            = {
            //.parent        = NULL,
            .platform_data    = &omap4460_backlight_data,
        },
    };

      Then , when the android run up. I can set  /sys/class/backlight/pwm-backlight/brightness value, and the kernel will run into pwm_enable(....) and pwm_config(....) in twl6030-pwm.c. But the Lcd backlight unchang.

       Is anybody know why?

    Thank you!

    Yaoquan.Woo

  • Yaoquan,

    You could reference the code for the Blaze Tablet LCD brightness functions, which are in /kernel/android-3.0/arch/arm/mach-omap2/board-44xx-tablet-panel.c.  You can obtain this kernel codebase using the instructions from this release, for example: http://omapedia.org/wiki/4AJ.1.1_OMAP4_Jelly_Bean_Release_Notes

    Regards,
    Gina 

  • Gina,

         I had try it like board-44xx-tablet-panel.c and chang some register in leds-omap4430sdp-display.c and board-44xx-tablet-panel.c, look like these  :

               LED_PWM2ON        0xba    // for twl6030 pwm1

              LED_PWM2OFF        0xbb  // for twl6030 pwm1

      But it still cant chang these backlight, and the oscilloscope have non any pwm signal out put!

      Need I set up a dmtimer for pwm ?

    Thx!

    Yaoquan.Woo

  • Yaoquan,

    I am not sure what could be the issue using the TWL6030 PWM on your system.  However, you could use a dmtimer instead.  The register configuration is described in Chapter 22.2.4.10 of the OMAP TRM.  You will also need to set the TSICR and TTGR registers.  Here is an example configuration sequence that you could perhaps use as a starting point for your system:

    PinMux(0x4a1001d0): bits 18-16: 0x001     (EMU18/DMTIMER10_PWM_EVT/AB4)

    GPTIMER10 CLOCK CONTROL(0x4a009428): 0x01000002   (selects 32.768KHz clock)

    TMAR(0X4808 6038): 0xFFFFFF6C  (for full brightness of duty cycle 10%) to 0xFFFFFFEF  (full dim of duty cycle 90%)

    TLDR(0x4808602C): 0xFFFFFF5C      -->        32768Hz / 200Hz=163(D)=A3(H);0XFFFFFFFF-A3=0xFFFFFF5C(H)

    TSICR(0x48086040): 0x00000004

    TTGR(0x48086030): 0x00000001

    TCLR(0x48086024): 0X00001843 (To be set last)

    Regards,
    Gina 

  • Gina,

        Thx you very much !

        I will try it!

    Regards,
    Yaoquan

     

  • Hi Archee Woo:

    I have difficulity in initializing the hardware .

    my PWM signal is from TIM7_OUT GP0[31].I want to ask you how can I make the GP0[31]  associate with the TIM7_OUT?

    can you tell me what have you do in the function of  omap4460_bl_init?