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.

Loadable module to modify LCD controller output signals

Other Parts Discussed in Thread: DA8XX

I am currently working with TI Sitara starter kit and we have the need to modify the LCD controller output signals. We plan to do this via a loadable module. I have trace the original source code created a program that I will might do the trick. Below is code section 

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <video/da8xx-fb.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/hardware/asp.h>
#include "devices.h"

static const struct display_panel disp_panel = {
QVGA,
24,
24,
COLOR_ACTIVE,
};

static struct lcd_ctrl_config lcd_cfg = {
&disp_panel,
.ac_bias = 255,
.ac_bias_intrpt = 0,
.dma_burst_sz = 16,
.bpp = 24,
.fdd = 0x80,
.tft_alt_mode = 0,
.stn_565_mode = 0,
.mono_8bit_mode = 0,
.invert_line_clock = 1,
.invert_frm_clock = 1,
.sync_edge = 0,
.sync_ctrl = 1,
.raster_order = 0,
};

struct da8xx_lcdc_platform_data CW_pdata = {
.manu_name = "CW",
.controller_data = &lcd_cfg,
.type = "CW",
};


static struct platform_device am33xx_lcdc_device = {
.name = "CW_lcdc",
.id = 0,
.num_resources = ARRAY_SIZE(am33xx_lcdc_resources),
.resource = am33xx_lcdc_resources,
};

static int __init conf_disp_pll(int rate)
{
struct clk *disp_pll;
int ret = -EINVAL;

disp_pll = clk_get(NULL, "dpll_disp_ck");
if (IS_ERR(disp_pll)) {
printk(KERN_INFO "Cannot clk_get disp_pll\n");
} else {
ret = clk_set_rate(disp_pll, rate);
clk_put(disp_pll);
}
return ret;
}

int __init am33xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
{
int id = 0;
struct platform_device *pdev;
struct omap_hwmod *oh;
char *oh_name = "lcdc";
char *dev_name = "da8xx_lcdc";

oh = omap_hwmod_lookup(oh_name);
if (!oh) {
pr_err("Could not look up LCD%d hwmod\n", id);
return -ENODEV;
}

pdev = omap_device_build(dev_name, id, oh, pdata,
sizeof(struct da8xx_lcdc_platform_data), NULL, 0, 0);
if (IS_ERR(pdev)) {
WARN(1, "Can't build omap_device for %s:%s.\n",
dev_name, oh->name);
return PTR_ERR(pdev);
}
return 0;
}


static int __init edt_device_init(void)
{
int ret = 0;
printk(KERN_INFO "edt_device_init\n");

if ((ret = conf_disp_pll(300000000))) {
printk(KERN_ALERT "Failed configure display PLL, not attempting to register LCDC\n");
return ret;
}

if ((ret = am33xx_register_lcdc(&CW_pdata))) {
printk(KERN_ALERT "Failed to register LCDC device\n");
}

return ret;
}

module_init(edt_device_init);


MODULE_DESCRIPTION("TI da8xx/omap-l1xx");
MODULE_AUTHOR("Texas Instruments");
MODULE_LICENSE("GPL");

I would much appreciate if I can get feedback on my effort.

Currently I am trying understand the how cross compile the code that need to be uploaded to the device.

Thank you in advancd

[View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/509/2677.lcdc_5F00_load_5F00_device.c

  • Hello,

    This code should work provided that you have not called am33xx_register_lcdc from board-am335xevm.c.

    To compile as module and load from init you can follow this link.

    http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html

    Also you may need to load this module before sgx modules(omaplfb.ko and pvrsvrkm.so) are loaded from rc.pvr

    Can I know what is the end goal of this module? Normally we do LCD initialization on android boot up only.

    Regards,

    arun

  • We would like to drive a LCD display with non standard electrical specifications. Primary goals are

    1. Convert the signal to composite (NTSC)
    2. Adjust the Hsync and Vsync to meet display specification
    First we would like to create a loadable module so the we can experiment, then we will eventually compile into the kernel for production. 
    We are open for new ideas or different methods
    Thanks
  • This method would be good, but I think configuring built in display should not harm.

    Regards,

    Arun