Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sudhakar Rajashekhara and committed by
Greg Kroah-Hartman
77943d31 bcb903fa

+48 -2
+48 -2
drivers/staging/panel/panel.c
··· 243 243 */ 244 244 #define LCD_PROTO_PARALLEL 0 245 245 #define LCD_PROTO_SERIAL 1 246 + #define LCD_PROTO_TI_DA8XX_LCD 2 246 247 247 248 /* 248 249 * LCD character sets ··· 441 440 442 441 static int lcd_proto = -1; 443 442 module_param(lcd_proto, int, 0000); 444 - MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial"); 443 + MODULE_PARM_DESC(lcd_proto, "LCD communication: 0=parallel (//), 1=serial," 444 + "2=TI LCD Interface"); 445 445 446 446 static int lcd_charset = -1; 447 447 module_param(lcd_charset, int, 0000); ··· 799 797 spin_unlock(&pprt_lock); 800 798 } 801 799 800 + /* send a command to the TI LCD panel */ 801 + static void lcd_write_cmd_tilcd(int cmd) 802 + { 803 + spin_lock(&pprt_lock); 804 + /* present the data to the control port */ 805 + w_ctr(pprt, cmd); 806 + udelay(60); 807 + spin_unlock(&pprt_lock); 808 + } 809 + 810 + /* send data to the TI LCD panel */ 811 + static void lcd_write_data_tilcd(int data) 812 + { 813 + spin_lock(&pprt_lock); 814 + /* present the data to the data port */ 815 + w_dtr(pprt, data); 816 + udelay(60); 817 + spin_unlock(&pprt_lock); 818 + } 819 + 802 820 static void lcd_gotoxy(void) 803 821 { 804 822 lcd_write_cmd(0x80 /* set DDRAM address */ ··· 886 864 887 865 udelay(45); /* the shortest data takes at least 45 us */ 888 866 } 867 + spin_unlock(&pprt_lock); 868 + 869 + lcd_addr_x = lcd_addr_y = 0; 870 + lcd_gotoxy(); 871 + } 872 + 873 + /* fills the display with spaces and resets X/Y */ 874 + static void lcd_clear_fast_tilcd(void) 875 + { 876 + int pos; 877 + lcd_addr_x = lcd_addr_y = 0; 878 + lcd_gotoxy(); 879 + 880 + spin_lock(&pprt_lock); 881 + for (pos = 0; pos < lcd_height * lcd_hwidth; pos++) { 882 + /* present the data to the data port */ 883 + w_dtr(pprt, ' '); 884 + udelay(60); 885 + } 886 + 889 887 spin_unlock(&pprt_lock); 890 888 891 889 lcd_addr_x = lcd_addr_y = 0; ··· 1438 1396 if (lcd_da_pin == PIN_NOT_SET) 1439 1397 lcd_da_pin = DEFAULT_LCD_PIN_SDA; 1440 1398 1441 - } else { /* PARALLEL */ 1399 + } else if (lcd_proto == LCD_PROTO_PARALLEL) { /* PARALLEL */ 1442 1400 lcd_write_cmd = lcd_write_cmd_p8; 1443 1401 lcd_write_data = lcd_write_data_p8; 1444 1402 lcd_clear_fast = lcd_clear_fast_p8; ··· 1449 1407 lcd_rs_pin = DEFAULT_LCD_PIN_RS; 1450 1408 if (lcd_rw_pin == PIN_NOT_SET) 1451 1409 lcd_rw_pin = DEFAULT_LCD_PIN_RW; 1410 + } else { 1411 + lcd_write_cmd = lcd_write_cmd_tilcd; 1412 + lcd_write_data = lcd_write_data_tilcd; 1413 + lcd_clear_fast = lcd_clear_fast_tilcd; 1452 1414 } 1453 1415 1454 1416 if (lcd_bl_pin == PIN_NOT_SET)