aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2009-08-20 18:13:18 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:29 -0400
commit77943d31b7dfdbd1ad58d49bd16ae6e7601bcd6c (patch)
tree3213271b71efaefcd77c09fe0eda4f1ee5c9e66f
parentbcb903fa303bea505902be8b1e275769515c2380 (diff)
Staging: panel: Add support for TI CLCD interface
On TI DA850/OMAP-L138 EVM, HD44780 (24x2) LCD panel is being used[1], but it is interfaced through the SoC specific LCD interface and not through parallel port. A parallel port driver has been developed which interfaces to the panel driver through the SoC specific LCD interface. Basically, both the serial and parallel interfaces supported by the panel driver do not suit the specific interface SoC is supporting so, a new interface type has been introduced. Ideally the panel driver should be de-coupled from parallel and serial port related items but this patch is something that can be merged in the meantime. [1]Specification of the character LCD interface on TI DA850/OMAP-L138: http://www.ti.com/litv/pdf/sprufm0a. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/panel/panel.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index c2747bc88c6f..dd7d3fde9699 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -243,6 +243,7 @@ static unsigned char lcd_bits[LCD_PORTS][LCD_BITS][BIT_STATES];
243 */ 243 */
244#define LCD_PROTO_PARALLEL 0 244#define LCD_PROTO_PARALLEL 0
245#define LCD_PROTO_SERIAL 1 245#define LCD_PROTO_SERIAL 1
246#define LCD_PROTO_TI_DA8XX_LCD 2
246 247
247/* 248/*
248 * LCD character sets 249 * LCD character sets
@@ -440,7 +441,8 @@ MODULE_PARM_DESC(lcd_type,
440 441
441static int lcd_proto = -1; 442static int lcd_proto = -1;
442module_param(lcd_proto, int, 0000); 443module_param(lcd_proto, int, 0000);
443MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial"); 444MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial,"
445 "2=TI LCD Interface");
444 446
445static int lcd_charset = -1; 447static int lcd_charset = -1;
446module_param(lcd_charset, int, 0000); 448module_param(lcd_charset, int, 0000);
@@ -797,6 +799,26 @@ static void lcd_write_data_p8(int data)
797 spin_unlock(&pprt_lock); 799 spin_unlock(&pprt_lock);
798} 800}
799 801
802/* send a command to the TI LCD panel */
803static void lcd_write_cmd_tilcd(int cmd)
804{
805 spin_lock(&pprt_lock);
806 /* present the data to the control port */
807 w_ctr(pprt, cmd);
808 udelay(60);
809 spin_unlock(&pprt_lock);
810}
811
812/* send data to the TI LCD panel */
813static void lcd_write_data_tilcd(int data)
814{
815 spin_lock(&pprt_lock);
816 /* present the data to the data port */
817 w_dtr(pprt, data);
818 udelay(60);
819 spin_unlock(&pprt_lock);
820}
821
800static void lcd_gotoxy(void) 822static void lcd_gotoxy(void)
801{ 823{
802 lcd_write_cmd(0x80 /* set DDRAM address */ 824 lcd_write_cmd(0x80 /* set DDRAM address */
@@ -870,6 +892,26 @@ static void lcd_clear_fast_p8(void)
870 lcd_gotoxy(); 892 lcd_gotoxy();
871} 893}
872 894
895/* fills the display with spaces and resets X/Y */
896static void lcd_clear_fast_tilcd(void)
897{
898 int pos;
899 lcd_addr_x = lcd_addr_y = 0;
900 lcd_gotoxy();
901
902 spin_lock(&pprt_lock);
903 for (pos = 0; pos < lcd_height * lcd_hwidth; pos++) {
904 /* present the data to the data port */
905 w_dtr(pprt, ' ');
906 udelay(60);
907 }
908
909 spin_unlock(&pprt_lock);
910
911 lcd_addr_x = lcd_addr_y = 0;
912 lcd_gotoxy();
913}
914
873/* clears the display and resets X/Y */ 915/* clears the display and resets X/Y */
874static void lcd_clear_display(void) 916static void lcd_clear_display(void)
875{ 917{
@@ -1396,7 +1438,7 @@ void lcd_init(void)
1396 if (lcd_da_pin == PIN_NOT_SET) 1438 if (lcd_da_pin == PIN_NOT_SET)
1397 lcd_da_pin = DEFAULT_LCD_PIN_SDA; 1439 lcd_da_pin = DEFAULT_LCD_PIN_SDA;
1398 1440
1399 } else { /* PARALLEL */ 1441 } else if (lcd_proto == LCD_PROTO_PARALLEL) { /* PARALLEL */
1400 lcd_write_cmd = lcd_write_cmd_p8; 1442 lcd_write_cmd = lcd_write_cmd_p8;
1401 lcd_write_data = lcd_write_data_p8; 1443 lcd_write_data = lcd_write_data_p8;
1402 lcd_clear_fast = lcd_clear_fast_p8; 1444 lcd_clear_fast = lcd_clear_fast_p8;
@@ -1407,6 +1449,10 @@ void lcd_init(void)
1407 lcd_rs_pin = DEFAULT_LCD_PIN_RS; 1449 lcd_rs_pin = DEFAULT_LCD_PIN_RS;
1408 if (lcd_rw_pin == PIN_NOT_SET) 1450 if (lcd_rw_pin == PIN_NOT_SET)
1409 lcd_rw_pin = DEFAULT_LCD_PIN_RW; 1451 lcd_rw_pin = DEFAULT_LCD_PIN_RW;
1452 } else {
1453 lcd_write_cmd = lcd_write_cmd_tilcd;
1454 lcd_write_data = lcd_write_data_tilcd;
1455 lcd_clear_fast = lcd_clear_fast_tilcd;
1410 } 1456 }
1411 1457
1412 if (lcd_bl_pin == PIN_NOT_SET) 1458 if (lcd_bl_pin == PIN_NOT_SET)