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