Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162530
b: refs/heads/master
c: 77943d3
h: refs/heads/master
v: v3
  • Loading branch information
Sudhakar Rajashekhara authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 9a5132e commit 8f55a7e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bcb903fa303bea505902be8b1e275769515c2380
refs/heads/master: 77943d31b7dfdbd1ad58d49bd16ae6e7601bcd6c
50 changes: 48 additions & 2 deletions trunk/drivers/staging/panel/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ static unsigned char lcd_bits[LCD_PORTS][LCD_BITS][BIT_STATES];
*/
#define LCD_PROTO_PARALLEL 0
#define LCD_PROTO_SERIAL 1
#define LCD_PROTO_TI_DA8XX_LCD 2

/*
* LCD character sets
Expand Down Expand Up @@ -440,7 +441,8 @@ MODULE_PARM_DESC(lcd_type,

static int lcd_proto = -1;
module_param(lcd_proto, int, 0000);
MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial");
MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial,"
"2=TI LCD Interface");

static int lcd_charset = -1;
module_param(lcd_charset, int, 0000);
Expand Down Expand Up @@ -797,6 +799,26 @@ static void lcd_write_data_p8(int data)
spin_unlock(&pprt_lock);
}

/* send a command to the TI LCD panel */
static void lcd_write_cmd_tilcd(int cmd)
{
spin_lock(&pprt_lock);
/* present the data to the control port */
w_ctr(pprt, cmd);
udelay(60);
spin_unlock(&pprt_lock);
}

/* send data to the TI LCD panel */
static void lcd_write_data_tilcd(int data)
{
spin_lock(&pprt_lock);
/* present the data to the data port */
w_dtr(pprt, data);
udelay(60);
spin_unlock(&pprt_lock);
}

static void lcd_gotoxy(void)
{
lcd_write_cmd(0x80 /* set DDRAM address */
Expand Down Expand Up @@ -870,6 +892,26 @@ static void lcd_clear_fast_p8(void)
lcd_gotoxy();
}

/* fills the display with spaces and resets X/Y */
static void lcd_clear_fast_tilcd(void)
{
int pos;
lcd_addr_x = lcd_addr_y = 0;
lcd_gotoxy();

spin_lock(&pprt_lock);
for (pos = 0; pos < lcd_height * lcd_hwidth; pos++) {
/* present the data to the data port */
w_dtr(pprt, ' ');
udelay(60);
}

spin_unlock(&pprt_lock);

lcd_addr_x = lcd_addr_y = 0;
lcd_gotoxy();
}

/* clears the display and resets X/Y */
static void lcd_clear_display(void)
{
Expand Down Expand Up @@ -1396,7 +1438,7 @@ void lcd_init(void)
if (lcd_da_pin == PIN_NOT_SET)
lcd_da_pin = DEFAULT_LCD_PIN_SDA;

} else { /* PARALLEL */
} else if (lcd_proto == LCD_PROTO_PARALLEL) { /* PARALLEL */
lcd_write_cmd = lcd_write_cmd_p8;
lcd_write_data = lcd_write_data_p8;
lcd_clear_fast = lcd_clear_fast_p8;
Expand All @@ -1407,6 +1449,10 @@ void lcd_init(void)
lcd_rs_pin = DEFAULT_LCD_PIN_RS;
if (lcd_rw_pin == PIN_NOT_SET)
lcd_rw_pin = DEFAULT_LCD_PIN_RW;
} else {
lcd_write_cmd = lcd_write_cmd_tilcd;
lcd_write_data = lcd_write_data_tilcd;
lcd_clear_fast = lcd_clear_fast_tilcd;
}

if (lcd_bl_pin == PIN_NOT_SET)
Expand Down

0 comments on commit 8f55a7e

Please sign in to comment.