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.

OMAP PWM LED driver on OMAP4430

Hello!

I have working OMAP4 PWM LED driver, based on GP Timers for 2.6.35 branch.

Source is here http://pastebin.com/rFt3xHKp

When I try use this code in 3.0 kernel branch I get such problem:

1. Back-light is turning on the maximum brightness. Changing brightness value in SW doesn't  change brightness on the real hardware.

I add some debug info to the code 

http://pastebin.com/F6T2hWCQ

and use  

static struct omap_pwm_led_platform_data acclaim4430_disp_backlight_data = {
.name = "lcd-backlight",
.intensity_timer = 11,
.def_on = 1,
.def_brightness = DEFAULT_BACKLIGHT_BRIGHTNESS,
.set_power = acclaim4430_disp_backlight_setpower,
};

static struct platform_device sdp4430_disp_led = {
.name = "omap_pwm_led",
.id = -1,
.dev = {
.platform_data = &acclaim4430_disp_backlight_data,
},
};

static struct platform_device *sdp4430_devices[] __initdata = {
&sdp4430_disp_led,
}; 

I receive such output:

<7>level 1->omap_pwm_led_init:
<7>level 1->omap_pwm_led_probe:
<6>omap_pwm_led omap_pwm_led: OMAP PWM LED (lcd-backlight) at GP timer 11/0
<7>Registered led device: lcd-backlight 

after command

echo 10 > /sys/class/leds/lcd-backlight/brightness 

output:

<7>level 1->omap_pwm_led_set:

<7>level 1->cdev_to_omap_pwm_led:
<7>level 1->omap_pwm_led_work:
<7>level 1->work_to_omap_pwm_led:
<7>level 1->omap_pwm_led_power_on:
<4>!!!!!!!!!!omap_pwm_led_power_on the brightness is 10
<4>!!!!!!!!!!Turn voltage on
<4>[BL set power] 1
<7>level 1->omap_pwm_led_set_pwm_cycle:

<4>!!!!!!!!!!cycle != LED_FULL, cycle=10

LED flashes one time, and stay black

after another coammand

echo 10 > /sys/class/leds/lcd-backlight/brightness 

output:

<7>level 1->omap_pwm_led_set:
<7>level 1->cdev_to_omap_pwm_led:
<7>level 1->omap_pwm_led_work:
<7>level 1->work_to_omap_pwm_led:
<7>level 1->omap_pwm_led_power_on:
<4>!!!!!!!!!!omap_pwm_led_power_on the brightness is 10
<4>!!!!!!!!!!LED powered, returning
<7>level 1->omap_pwm_led_set_pwm_cycle:
<4>!!!!!!!!!!cycle != LED_FULL, cycle=10

LED turning on like the maximum brightness, not 10.

Anybody can help?

I use such linux/arch/arm/plat-omap/dmtimer.c

http://pastebin.com/DvDSxDB4

 


 

  • Hi Aleksander,

    There is an LED PWM driver used on K3.0 for Blaze (/arch/arm/mach-omap2/board-4430sdp.c):

    static struct led_pwm sdp4430_pwm_leds[] = {
    {
    .name = "omap4:green:chrg",
    .pwm_id = 1,
    .max_brightness = 255,
    .pwm_period_ns = 7812500,
    },
    };

    static struct led_pwm_platform_data sdp4430_pwm_data = {
    .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
    .leds = sdp4430_pwm_leds,
    };

    static struct platform_device sdp4430_leds_pwm = {
    .name = "leds_pwm",
    .id = -1,
    .dev = {
    .platform_data = &sdp4430_pwm_data,
    },
    };

    Would this meet your needs?  You can adjust the period for the PWM LED, to affect the brightness:

    .pwm_period_ns = 7812500,

    Regards,
    Gina


  • Thank for reply. I have some questions.

    How to map GP timer 11 pin to it? Where I can define at which port will be PWM output with this driver?  

    Can this driver provide 128 Hz (I use driver for LCD LED back-light)? How about CPU load on such PWM clock, that realizing in software?

  • Aleksander,

    I believe this driver is already using 128 Hz on Blaze:

       .pwm_period_ns = 7812500,

    The device, PWM1 or PWM2, can be set through:

      .pwm_id = 1,

    How is the GP timer connected to the PWM in your hardware?

    Regards,

    Gina

  • omap_mux_init_signal("abe_dmic_din2.dmtimer11_pwm_evt", OMAP_MUX_MODE5);

    This pin I use as PWM output.

  • With LED PWM driver and debug in timer.c

    omap-rproc omap-rproc.1: Loaded BIOS image ducati-m3.bin, size 5756300
    omap-rproc omap-rproc.1: BIOS image version is 2
    omap-iommu omap-iommu.0: iommu_get: ducati qos_request
    omap_hwmod: ipu: failed to hardreset
    omap-iommu omap-iommu.0: ducati: version 2.1
    omap_dm_timer_request_specific: timer11 not available.
    omap-rproc omap-rproc.1: can't start rproc ipu: -16

    After boot
    cd /sys/devices/platform/omap/omap-rproc.1/power
    cat autosuspend_delay_ms
    cat: autosuspend_delay_ms: Input/output error
    cat runtime_status
    unsupported


    After commenting LED PWM driver

    Freeing init memory: 248K
    udev[185]: starting version 164
    omap-rproc omap-rproc.1: Loaded BIOS image ducati-m3.bin, size 5756300
    omap-rproc omap-rproc.1: BIOS image version is 2
    omap-iommu omap-iommu.0: iommu_get: ducati qos_request
    omap_hwmod: ipu: failed to hardreset
    omap-iommu omap-iommu.0: ducati: version 2.1
    omap-rproc omap-rproc.1: remote processor ipu is now up
    omap_rpmsg_mbox_callback: received echo reply from ipu !
    omap_rpmsg_mbox_callback: received echo reply from ipu !
    omap_rpmsg_mbox_callback: received echo reply from ipu !
    omap_rpmsg_mbox_callback: received echo reply from ipu !
    virtio_rpmsg_bus virtio0: creating channel rpmsg-client-sample addr 0x32
    virtio_rpmsg_bus virtio0: creating channel rpmsg-client-sample addr 0x33
    virtio_rpmsg_bus virtio0: creating channel rpmsg-omx addr 0x3c
    rpmsg_omx rpmsg-omx0: new OMX connection srv channel: 1024 -> 60!
    virtio_rpmsg_bus virtio1: creating channel rpmsg-omx addr 0x3c
    rpmsg_omx rpmsg-omx1: new OMX connection srv channel: 1024 -> 60!
    omap-iommu omap-iommu.0: iommu_get: ducati qos_request
    omap_hwmod: ipu: failed to hardreset
    omap-iommu omap-iommu.0: ducati: version 2.1

    cd /sys/devices/platform/omap/omap-rproc.1/power
    localhost power # cat runtime_status
    suspended
    localhost power # cat runtime_suspended_time
    81171
    localhost power # cat runtime_usage
    0
    localhost power # cat control
    auto
    localhost power # cat autosuspend_delay_ms
    5000
    localhost power # cat runtime_enabled
    enabled
    localhost power # cat async
    disabled
    localhost power # echo on > control
    <6>omap-iommu omap-iommu.0: iommu_get: ducati qos_request
    <4>omap_hwmod: ipu: failed to hardreset
    <6>omap-iommu omap-iommu.0: ducati: version 2.1
    localhost power # cat runtime_status
    active

    Looks like that ducati-m3.bin firmware uses timer11, and thus conflicts with LED PWM.  I use firmware from device/ti/proprietary-open.git

    Is it correct ducati-m3.bin load (second situation)?  What timer uses ducati-m3.bin firmware?

  • Aleksander,

    Yes, the GPTimer assignments have changed between Gingerbread and ICS, and now GPTimer11 is used as the watchdog for the M3.  You could make a change to use GPTimer10 instead of GPTimer11 for Ducati.  Here are example patches; however, this will require rebuilding the Ducati source code, so you will need to contact your TI representative.

    http://review.omapzoom.org/#change,18246

    http://review.omapzoom.org/#change,18247

    Regards,

    Gina

  • Thank you Gina.

    I have not corporate email, and thus TI representative don't want answer to me (Due to an increased number of inquiries received from private email accounts with no reference to company or corporation, we would like to inform you that we are unable to provide technical or application support to customers without company email accounts and or insufficient company details. ...)

    Can you release patched and rebuilded ducati-m3.bin?

  • Aleksander,

    I am sorry, but for any changes to the Ducati code, you will need to go through the official TI channels in order to get a license for the Ducati source.  Unfortunately, we cannot address this request on the forum.

    Regards,

    Gina

  • Can you give me contact email person, related to ducati--m3.bin  project?

  • Hello, where can I get the Ducati binary with GPTimer 10 as the watchdog for the M3 instead of 11?