Backlight PWM -

Discussion of your EDM baseboard, your add-on boards or other peripherals for your wandboard.

Backlight PWM -

Postby Lukas » Thu Sep 05, 2013 12:05 pm

I want to use/activate a backlight control to wandboard.
There are different files ;) to modify. Where should I start?

Please can anybody provide a brief description on linux(android) backlight control.

linux/drivers/video/backlight/pwm_bl.c: usage,
.../board-wand.c :
Code: Select all
/****************************************************************************
 *                                                                         
 * LCD Backlight Control
 *                                                                         
 ****************************************************************************/
#include <linux/pwm_backlight.h>

static struct platform_pwm_backlight_data wand_pwm_backlight_data = {
   .pwm_id = 2,
   .max_brightness = 248,
   .dft_brightness = 248,
   .pwm_period_ns = 50000,
};

static void wand_init_lcd_backlight(void)
{
   EDM_SET_PAD( PAD_SD4_DAT1__PWM3_PWMO ); // any pin  possible ????
   imx6q_add_mxc_pwm(2);
   imx6q_add_mxc_pwm_backlight(2, &wand_pwm_backlight_data);
}


thanks in advance!
Lukas
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am

Re: Backlight PWM -

Postby Lukas » Thu Sep 05, 2013 2:43 pm

Android 4.2.2:

There is only this device:
Code: Select all
root@android:/sys/devices/platform/pwm-backlight.2 # ls
modalias
power
subsystem
uevent


no actual values etc.....? :(
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am

Re: Backlight PWM -

Postby tungyilin1127 » Mon Sep 09, 2013 3:42 am

To operate on backlight,
you can try /sys/class/backlight/pwm-backlight.2/brightness
tungyilin1127
 
Posts: 8
Joined: Fri Aug 30, 2013 7:27 am

Re: Backlight PWM -

Postby tungyilin1127 » Mon Sep 09, 2013 3:44 am

How do you connect your panel?
Which signals do you use?
tungyilin1127
 
Posts: 8
Joined: Fri Aug 30, 2013 7:27 am

Re: Backlight PWM -

Postby Lukas » Mon Sep 09, 2013 6:39 am

tungyilin1127 wrote:To operate on backlight,
you can try /sys/class/backlight/pwm-backlight.2/brightness

The mentioned device does not exist in used android build. According wandboard_android_defconfig-file (and for other OS) it is disabled.

Even when I set :
Code: Select all
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_PWM=y


I can't activate sys/class/pwm....

Pin Configuration: I would like to control R_DISP0_CNTRST (or R_DISP0_VDDEN) pin, which is part of connector JP2.
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am

Re: Backlight PWM -

Postby tungyilin1127 » Mon Sep 09, 2013 10:45 am

grep from imx6_android_defconfig

CONFIG_HAVE_PWM=y
CONFIG_IMX_HAVE_PLATFORM_MXC_PWM=y
CONFIG_MXC_PWM=y
# CONFIG_INPUT_PWM_BEEPER is not set
CONFIG_BACKLIGHT_PWM=y
# CONFIG_LEDS_PWM is not set

seems these two are missing.
CONFIG_IMX_HAVE_PLATFORM_MXC_PWM=y
CONFIG_MXC_PWM=y
tungyilin1127
 
Posts: 8
Joined: Fri Aug 30, 2013 7:27 am

Re: Backlight PWM -

Postby Lukas » Tue Sep 10, 2013 6:52 am

@wandboard_android_defconfig
  • CONFIG_HAVE_PWM is missing at all - what is the reason?
  • CONFIG_IMX_HAVE_PLATFORM_MXC_PWM=y is set
  • CONFIG_MXC_PWM is just disabled.

To get an overview of those modules and functionality - is there any documentation available?

thx Lukas
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am

Re: Backlight PWM -

Postby Lukas » Thu Sep 12, 2013 10:55 am

I was brave and activated
  • CONFIG_HAVE_PWM=y
  • CONFIG_MXC_PWM
it built successfully. Now I'm able to change brightness value at \sys\class\backlight\.... (checked with "cat brightness") from android OS without changing brightness of lcd display.

It seems the PWM module does not receive this value....

Are there any hints where to start?

thx!
Lukas

PS: My goal is to change brightness of future electronics display (FW...) from android OS or for test purpose select an GPIO pin for PWM output.
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am

Re: Backlight PWM -

Postby Tapani » Fri Sep 13, 2013 6:38 am

It appears that the FWBADAPT expects PWM on EDM pin 76, but on the Wandboard we assumed pin 82 would be used for BL PWM.
The EDM spec is a little fuzzy on that (both pins 76 and 82 are for "Backlight control").
Tapani
 
Posts: 712
Joined: Tue Aug 27, 2013 8:32 am

Re: Backlight PWM -

Postby Lukas » Fri Sep 13, 2013 7:35 am

It works! The signal seems to be routed to PAD_SD4_DAT1__PWM3_PWMO -> B19 -> PIN27 (right!). I measured proportional to brightness slider (android) the voltage on this pin.
Now I try to multiplex the output of pwm to DISP0_VDDEN. But it looks like the pwm function is no supported by this pin (SD4_DAT3__XXXXXX).
I am going to test wheater I get the pwm signal on pin SD4_DAT2 by changing following thing:

board-wand.c
Code: Select all
static void wand_init_lcd_backlight(void)
{
//    EDM_SET_PAD( PAD_SD4_DAT1__PWM3_PWMO );
        EDM_SET_PAD( PAD_SD4_DAT2__PWM4_PWMO );
        imx6q_add_mxc_pwm(2);
        imx6q_add_mxc_pwm_backlight(2, &wand_pwm_backlight_data);
}


I let you know what happens!

Lukas
Lukas
 
Posts: 15
Joined: Tue Sep 03, 2013 7:46 am


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 8 guests

cron